@objectstack/spec 1.0.5 → 1.0.7

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 (64) hide show
  1. package/dist/ai/index.d.mts +1 -1
  2. package/dist/ai/index.d.ts +1 -1
  3. package/dist/api/index.d.mts +2 -2
  4. package/dist/api/index.d.ts +2 -2
  5. package/dist/api/index.js +1880 -1784
  6. package/dist/api/index.js.map +1 -1
  7. package/dist/api/index.mjs +1880 -1784
  8. package/dist/api/index.mjs.map +1 -1
  9. package/dist/automation/index.d.mts +1 -1
  10. package/dist/automation/index.d.ts +1 -1
  11. package/dist/contracts/index.d.mts +3 -3
  12. package/dist/contracts/index.d.ts +3 -3
  13. package/dist/data/index.d.mts +3 -3
  14. package/dist/data/index.d.ts +3 -3
  15. package/dist/data/index.js +5 -1
  16. package/dist/data/index.js.map +1 -1
  17. package/dist/data/index.mjs +5 -1
  18. package/dist/data/index.mjs.map +1 -1
  19. package/dist/{driver.zod-YoPJRbBk.d.mts → driver.zod-BOM_Etco.d.mts} +164 -3467
  20. package/dist/{driver.zod-B0DitHQ2.d.ts → driver.zod-lfi00zVT.d.ts} +164 -3467
  21. package/dist/{field.zod-Da5S-hAo.d.mts → field.zod-B_lzVsuC.d.ts} +871 -1
  22. package/dist/{field.zod-Da5S-hAo.d.ts → field.zod-dhbAw0SA.d.mts} +871 -1
  23. package/dist/hub/index.d.mts +1 -1
  24. package/dist/hub/index.d.ts +1 -1
  25. package/dist/hub/index.js +796 -707
  26. package/dist/hub/index.js.map +1 -1
  27. package/dist/hub/index.mjs +796 -707
  28. package/dist/hub/index.mjs.map +1 -1
  29. package/dist/{index-DSLwt2M_.d.ts → index-C67cfwmW.d.ts} +6 -355
  30. package/dist/{index-BMqjuD4e.d.ts → index-CH5zloR3.d.ts} +2 -2
  31. package/dist/{index-CIBOjiZG.d.mts → index-CU4m6noq.d.mts} +2 -2
  32. package/dist/{index-BeFe7iF_.d.mts → index-CyognKSZ.d.ts} +268 -1565
  33. package/dist/{index-CFaoWA3X.d.ts → index-DE_lJ11p.d.mts} +268 -1565
  34. package/dist/{index-C34qbBQr.d.mts → index-DLcySG7U.d.mts} +262 -241
  35. package/dist/{index-C34qbBQr.d.ts → index-DLcySG7U.d.ts} +262 -241
  36. package/dist/{index-BYtinxqf.d.mts → index-Dp7GFJ8V.d.mts} +6 -355
  37. package/dist/{index-D8XFyX0x.d.mts → index-Os7lItRe.d.mts} +108 -108
  38. package/dist/{index-D8XFyX0x.d.ts → index-Os7lItRe.d.ts} +108 -108
  39. package/dist/{index-CsF8m5Wj.d.mts → index-l6WIlmOD.d.mts} +39 -39
  40. package/dist/{index-CsF8m5Wj.d.ts → index-l6WIlmOD.d.ts} +39 -39
  41. package/dist/index.d.mts +162 -162
  42. package/dist/index.d.ts +162 -162
  43. package/dist/index.js +714 -672
  44. package/dist/index.js.map +1 -1
  45. package/dist/index.mjs +714 -672
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/kernel/index.d.mts +1 -1
  48. package/dist/kernel/index.d.ts +1 -1
  49. package/dist/kernel/index.js +705 -669
  50. package/dist/kernel/index.js.map +1 -1
  51. package/dist/kernel/index.mjs +704 -669
  52. package/dist/kernel/index.mjs.map +1 -1
  53. package/json-schema/api/CompileManifestResponse.json +6 -2
  54. package/json-schema/api/ExportRequest.json +419 -758
  55. package/json-schema/api/FindDataRequest.json +9 -0
  56. package/json-schema/data/JoinNode.json +9 -0
  57. package/json-schema/data/Mapping.json +9 -0
  58. package/json-schema/data/Query.json +9 -0
  59. package/json-schema/hub/ComposerResponse.json +6 -2
  60. package/json-schema/kernel/Manifest.json +6 -2
  61. package/json-schema/kernel/Plugin.json +28 -0
  62. package/package.json +1 -1
  63. package/dist/{index-iGrpxfqq.d.mts → index-D12rNohm.d.mts} +1 -1
  64. package/dist/{index-iGrpxfqq.d.ts → index-D12rNohm.d.ts} +1 -1
@@ -1,5 +1,875 @@
1
+ import { F as FilterCondition } from './filter.zod-BMWnz4HE.mjs';
1
2
  import { z } from 'zod';
2
3
 
4
+ /**
5
+ * Sort Node
6
+ * Represents "Order By".
7
+ */
8
+ declare const SortNodeSchema: z.ZodObject<{
9
+ field: z.ZodString;
10
+ order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ field: string;
13
+ order: "asc" | "desc";
14
+ }, {
15
+ field: string;
16
+ order?: "asc" | "desc" | undefined;
17
+ }>;
18
+ /**
19
+ * Aggregation Function Enum
20
+ * Standard aggregation functions for data analysis.
21
+ *
22
+ * Supported Functions:
23
+ * - **count**: Count rows (SQL: COUNT(*) or COUNT(field))
24
+ * - **sum**: Sum numeric values (SQL: SUM(field))
25
+ * - **avg**: Average numeric values (SQL: AVG(field))
26
+ * - **min**: Minimum value (SQL: MIN(field))
27
+ * - **max**: Maximum value (SQL: MAX(field))
28
+ * - **count_distinct**: Count unique values (SQL: COUNT(DISTINCT field))
29
+ * - **array_agg**: Aggregate values into array (SQL: ARRAY_AGG(field))
30
+ * - **string_agg**: Concatenate values (SQL: STRING_AGG(field, delimiter))
31
+ *
32
+ * Performance Considerations:
33
+ * - COUNT(*) is typically faster than COUNT(field) as it doesn't check for nulls
34
+ * - COUNT DISTINCT may require additional memory for tracking unique values
35
+ * - Window aggregates (with OVER clause) can be more efficient than subqueries
36
+ * - Large GROUP BY operations benefit from proper indexing on grouped fields
37
+ *
38
+ * @example
39
+ * // SQL: SELECT region, SUM(amount) FROM sales GROUP BY region
40
+ * {
41
+ * object: 'sales',
42
+ * fields: ['region'],
43
+ * aggregations: [
44
+ * { function: 'sum', field: 'amount', alias: 'total_sales' }
45
+ * ],
46
+ * groupBy: ['region']
47
+ * }
48
+ *
49
+ * @example
50
+ * // Salesforce SOQL: SELECT COUNT(Id) FROM Account
51
+ * {
52
+ * object: 'account',
53
+ * aggregations: [
54
+ * { function: 'count', alias: 'total_accounts' }
55
+ * ]
56
+ * }
57
+ */
58
+ declare const AggregationFunction: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
59
+ /**
60
+ * Aggregation Node
61
+ * Represents an aggregated field with function.
62
+ *
63
+ * Aggregations summarize data across groups of rows (GROUP BY).
64
+ * Used with `groupBy` to create analytical queries.
65
+ *
66
+ * @example
67
+ * // SQL: SELECT customer_id, COUNT(*), SUM(amount) FROM orders GROUP BY customer_id
68
+ * {
69
+ * object: 'order',
70
+ * fields: ['customer_id'],
71
+ * aggregations: [
72
+ * { function: 'count', alias: 'order_count' },
73
+ * { function: 'sum', field: 'amount', alias: 'total_amount' }
74
+ * ],
75
+ * groupBy: ['customer_id']
76
+ * }
77
+ *
78
+ * @example
79
+ * // Salesforce SOQL: SELECT LeadSource, COUNT(Id) FROM Lead GROUP BY LeadSource
80
+ * {
81
+ * object: 'lead',
82
+ * fields: ['lead_source'],
83
+ * aggregations: [
84
+ * { function: 'count', alias: 'lead_count' }
85
+ * ],
86
+ * groupBy: ['lead_source']
87
+ * }
88
+ */
89
+ declare const AggregationNodeSchema: z.ZodObject<{
90
+ function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
91
+ field: z.ZodOptional<z.ZodString>;
92
+ alias: z.ZodString;
93
+ distinct: z.ZodOptional<z.ZodBoolean>;
94
+ filter: z.ZodOptional<z.ZodType<FilterCondition, z.ZodTypeDef, FilterCondition>>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
97
+ alias: string;
98
+ filter?: FilterCondition | undefined;
99
+ field?: string | undefined;
100
+ distinct?: boolean | undefined;
101
+ }, {
102
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
103
+ alias: string;
104
+ filter?: FilterCondition | undefined;
105
+ field?: string | undefined;
106
+ distinct?: boolean | undefined;
107
+ }>;
108
+ /**
109
+ * Join Type Enum
110
+ * Standard SQL join types for combining tables.
111
+ *
112
+ * Join Types:
113
+ * - **inner**: Returns only matching rows from both tables (SQL: INNER JOIN)
114
+ * - **left**: Returns all rows from left table, matching rows from right (SQL: LEFT JOIN)
115
+ * - **right**: Returns all rows from right table, matching rows from left (SQL: RIGHT JOIN)
116
+ * - **full**: Returns all rows from both tables (SQL: FULL OUTER JOIN)
117
+ *
118
+ * @example
119
+ * // SQL: SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id
120
+ * {
121
+ * object: 'order',
122
+ * joins: [
123
+ * {
124
+ * type: 'inner',
125
+ * object: 'customer',
126
+ * on: ['order.customer_id', '=', 'customer.id']
127
+ * }
128
+ * ]
129
+ * }
130
+ *
131
+ * @example
132
+ * // Salesforce SOQL-style: Find all customers and their orders (if any)
133
+ * {
134
+ * object: 'customer',
135
+ * joins: [
136
+ * {
137
+ * type: 'left',
138
+ * object: 'order',
139
+ * on: ['customer.id', '=', 'order.customer_id']
140
+ * }
141
+ * ]
142
+ * }
143
+ */
144
+ declare const JoinType: z.ZodEnum<["inner", "left", "right", "full"]>;
145
+ /**
146
+ * Join Execution Strategy
147
+ * Hints to the query engine on how to execute the join.
148
+ *
149
+ * Strategies:
150
+ * - **auto**: Engine decides best strategy (Default).
151
+ * - **database**: Push down join to the database (Requires same datasource).
152
+ * - **hash**: Load both sets into memory and hash join (Cross-datasource, memory intensive).
153
+ * - **loop**: Nested loop lookup (N+1 safe version). (Good for small right-side lookups).
154
+ */
155
+ declare const JoinStrategy: z.ZodEnum<["auto", "database", "hash", "loop"]>;
156
+ /**
157
+ * Join Node
158
+ * Represents table joins for combining data from multiple objects.
159
+ *
160
+ * Joins connect related data across multiple tables using ON conditions.
161
+ * Supports both direct object joins and subquery joins.
162
+ *
163
+ * @example
164
+ * // SQL: SELECT o.*, c.name FROM orders o INNER JOIN customers c ON o.customer_id = c.id
165
+ * {
166
+ * object: 'order',
167
+ * fields: ['id', 'amount'],
168
+ * joins: [
169
+ * {
170
+ * type: 'inner',
171
+ * object: 'customer',
172
+ * alias: 'c',
173
+ * on: ['order.customer_id', '=', 'c.id']
174
+ * }
175
+ * ]
176
+ * }
177
+ *
178
+ * @example
179
+ * // SQL: Multi-table join
180
+ * // SELECT * FROM orders o
181
+ * // INNER JOIN customers c ON o.customer_id = c.id
182
+ * // LEFT JOIN shipments s ON o.id = s.order_id
183
+ * {
184
+ * object: 'order',
185
+ * joins: [
186
+ * {
187
+ * type: 'inner',
188
+ * object: 'customer',
189
+ * alias: 'c',
190
+ * on: ['order.customer_id', '=', 'c.id']
191
+ * },
192
+ * {
193
+ * type: 'left',
194
+ * object: 'shipment',
195
+ * alias: 's',
196
+ * on: ['order.id', '=', 's.order_id']
197
+ * }
198
+ * ]
199
+ * }
200
+ *
201
+ * @example
202
+ * // Salesforce SOQL: SELECT Name, (SELECT LastName FROM Contacts) FROM Account
203
+ * {
204
+ * object: 'account',
205
+ * fields: ['name'],
206
+ * joins: [
207
+ * {
208
+ * type: 'left',
209
+ * object: 'contact',
210
+ * on: ['account.id', '=', 'contact.account_id']
211
+ * }
212
+ * ]
213
+ * }
214
+ *
215
+ * @example
216
+ * // Subquery Join: Join with a filtered/aggregated dataset
217
+ * {
218
+ * object: 'customer',
219
+ * joins: [
220
+ * {
221
+ * type: 'left',
222
+ * object: 'order',
223
+ * alias: 'high_value_orders',
224
+ * on: ['customer.id', '=', 'high_value_orders.customer_id'],
225
+ * subquery: {
226
+ * object: 'order',
227
+ * fields: ['customer_id', 'total'],
228
+ * filters: ['total', '>', 1000]
229
+ * }
230
+ * }
231
+ * ]
232
+ * }
233
+ */
234
+ declare const JoinNodeSchema: z.ZodType<any>;
235
+ /**
236
+ * Window Function Enum
237
+ * Advanced analytical functions for row-based calculations.
238
+ *
239
+ * Window Functions:
240
+ * - **row_number**: Sequential number within partition (SQL: ROW_NUMBER() OVER (...))
241
+ * - **rank**: Rank with gaps for ties (SQL: RANK() OVER (...))
242
+ * - **dense_rank**: Rank without gaps (SQL: DENSE_RANK() OVER (...))
243
+ * - **percent_rank**: Relative rank as percentage (SQL: PERCENT_RANK() OVER (...))
244
+ * - **lag**: Access previous row value (SQL: LAG(field) OVER (...))
245
+ * - **lead**: Access next row value (SQL: LEAD(field) OVER (...))
246
+ * - **first_value**: First value in window (SQL: FIRST_VALUE(field) OVER (...))
247
+ * - **last_value**: Last value in window (SQL: LAST_VALUE(field) OVER (...))
248
+ * - **sum/avg/count/min/max**: Aggregates over window (SQL: SUM(field) OVER (...))
249
+ *
250
+ * @example
251
+ * // SQL: SELECT *, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY amount DESC) as rank
252
+ * // FROM orders
253
+ * {
254
+ * object: 'order',
255
+ * fields: ['id', 'customer_id', 'amount'],
256
+ * windowFunctions: [
257
+ * {
258
+ * function: 'row_number',
259
+ * alias: 'rank',
260
+ * over: {
261
+ * partitionBy: ['customer_id'],
262
+ * orderBy: [{ field: 'amount', order: 'desc' }]
263
+ * }
264
+ * }
265
+ * ]
266
+ * }
267
+ *
268
+ * @example
269
+ * // SQL: Running total with SUM() OVER (...)
270
+ * {
271
+ * object: 'transaction',
272
+ * fields: ['date', 'amount'],
273
+ * windowFunctions: [
274
+ * {
275
+ * function: 'sum',
276
+ * field: 'amount',
277
+ * alias: 'running_total',
278
+ * over: {
279
+ * orderBy: [{ field: 'date', order: 'asc' }],
280
+ * frame: {
281
+ * type: 'rows',
282
+ * start: 'UNBOUNDED PRECEDING',
283
+ * end: 'CURRENT ROW'
284
+ * }
285
+ * }
286
+ * }
287
+ * ]
288
+ * }
289
+ */
290
+ declare const WindowFunction: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
291
+ /**
292
+ * Window Specification
293
+ * Defines PARTITION BY and ORDER BY for window functions.
294
+ *
295
+ * Window specifications control how window functions compute values:
296
+ * - **partitionBy**: Divide rows into groups (like GROUP BY but without collapsing rows)
297
+ * - **orderBy**: Define order for ranking and offset functions
298
+ * - **frame**: Specify which rows to include in aggregate calculations
299
+ *
300
+ * @example
301
+ * // Partition by department, order by salary
302
+ * {
303
+ * partitionBy: ['department'],
304
+ * orderBy: [{ field: 'salary', order: 'desc' }]
305
+ * }
306
+ *
307
+ * @example
308
+ * // Moving average with frame specification
309
+ * {
310
+ * orderBy: [{ field: 'date', order: 'asc' }],
311
+ * frame: {
312
+ * type: 'rows',
313
+ * start: '6 PRECEDING',
314
+ * end: 'CURRENT ROW'
315
+ * }
316
+ * }
317
+ */
318
+ declare const WindowSpecSchema: z.ZodObject<{
319
+ partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
320
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
321
+ field: z.ZodString;
322
+ order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
323
+ }, "strip", z.ZodTypeAny, {
324
+ field: string;
325
+ order: "asc" | "desc";
326
+ }, {
327
+ field: string;
328
+ order?: "asc" | "desc" | undefined;
329
+ }>, "many">>;
330
+ frame: z.ZodOptional<z.ZodObject<{
331
+ type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
332
+ start: z.ZodOptional<z.ZodString>;
333
+ end: z.ZodOptional<z.ZodString>;
334
+ }, "strip", z.ZodTypeAny, {
335
+ type?: "rows" | "range" | undefined;
336
+ start?: string | undefined;
337
+ end?: string | undefined;
338
+ }, {
339
+ type?: "rows" | "range" | undefined;
340
+ start?: string | undefined;
341
+ end?: string | undefined;
342
+ }>>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ orderBy?: {
345
+ field: string;
346
+ order: "asc" | "desc";
347
+ }[] | undefined;
348
+ partitionBy?: string[] | undefined;
349
+ frame?: {
350
+ type?: "rows" | "range" | undefined;
351
+ start?: string | undefined;
352
+ end?: string | undefined;
353
+ } | undefined;
354
+ }, {
355
+ orderBy?: {
356
+ field: string;
357
+ order?: "asc" | "desc" | undefined;
358
+ }[] | undefined;
359
+ partitionBy?: string[] | undefined;
360
+ frame?: {
361
+ type?: "rows" | "range" | undefined;
362
+ start?: string | undefined;
363
+ end?: string | undefined;
364
+ } | undefined;
365
+ }>;
366
+ /**
367
+ * Window Function Node
368
+ * Represents window function with OVER clause.
369
+ *
370
+ * Window functions perform calculations across a set of rows related to the current row,
371
+ * without collapsing the result set (unlike GROUP BY aggregations).
372
+ *
373
+ * @example
374
+ * // SQL: Top 3 products per category
375
+ * // SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank
376
+ * // FROM products
377
+ * {
378
+ * object: 'product',
379
+ * fields: ['name', 'category', 'sales'],
380
+ * windowFunctions: [
381
+ * {
382
+ * function: 'row_number',
383
+ * alias: 'category_rank',
384
+ * over: {
385
+ * partitionBy: ['category'],
386
+ * orderBy: [{ field: 'sales', order: 'desc' }]
387
+ * }
388
+ * }
389
+ * ]
390
+ * }
391
+ *
392
+ * @example
393
+ * // SQL: Year-over-year comparison with LAG
394
+ * {
395
+ * object: 'monthly_sales',
396
+ * fields: ['month', 'revenue'],
397
+ * windowFunctions: [
398
+ * {
399
+ * function: 'lag',
400
+ * field: 'revenue',
401
+ * alias: 'prev_year_revenue',
402
+ * over: {
403
+ * orderBy: [{ field: 'month', order: 'asc' }]
404
+ * }
405
+ * }
406
+ * ]
407
+ * }
408
+ */
409
+ declare const WindowFunctionNodeSchema: z.ZodObject<{
410
+ function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
411
+ field: z.ZodOptional<z.ZodString>;
412
+ alias: z.ZodString;
413
+ over: z.ZodObject<{
414
+ partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
415
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
416
+ field: z.ZodString;
417
+ order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ field: string;
420
+ order: "asc" | "desc";
421
+ }, {
422
+ field: string;
423
+ order?: "asc" | "desc" | undefined;
424
+ }>, "many">>;
425
+ frame: z.ZodOptional<z.ZodObject<{
426
+ type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
427
+ start: z.ZodOptional<z.ZodString>;
428
+ end: z.ZodOptional<z.ZodString>;
429
+ }, "strip", z.ZodTypeAny, {
430
+ type?: "rows" | "range" | undefined;
431
+ start?: string | undefined;
432
+ end?: string | undefined;
433
+ }, {
434
+ type?: "rows" | "range" | undefined;
435
+ start?: string | undefined;
436
+ end?: string | undefined;
437
+ }>>;
438
+ }, "strip", z.ZodTypeAny, {
439
+ orderBy?: {
440
+ field: string;
441
+ order: "asc" | "desc";
442
+ }[] | undefined;
443
+ partitionBy?: string[] | undefined;
444
+ frame?: {
445
+ type?: "rows" | "range" | undefined;
446
+ start?: string | undefined;
447
+ end?: string | undefined;
448
+ } | undefined;
449
+ }, {
450
+ orderBy?: {
451
+ field: string;
452
+ order?: "asc" | "desc" | undefined;
453
+ }[] | undefined;
454
+ partitionBy?: string[] | undefined;
455
+ frame?: {
456
+ type?: "rows" | "range" | undefined;
457
+ start?: string | undefined;
458
+ end?: string | undefined;
459
+ } | undefined;
460
+ }>;
461
+ }, "strip", z.ZodTypeAny, {
462
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
463
+ alias: string;
464
+ over: {
465
+ orderBy?: {
466
+ field: string;
467
+ order: "asc" | "desc";
468
+ }[] | undefined;
469
+ partitionBy?: string[] | undefined;
470
+ frame?: {
471
+ type?: "rows" | "range" | undefined;
472
+ start?: string | undefined;
473
+ end?: string | undefined;
474
+ } | undefined;
475
+ };
476
+ field?: string | undefined;
477
+ }, {
478
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
479
+ alias: string;
480
+ over: {
481
+ orderBy?: {
482
+ field: string;
483
+ order?: "asc" | "desc" | undefined;
484
+ }[] | undefined;
485
+ partitionBy?: string[] | undefined;
486
+ frame?: {
487
+ type?: "rows" | "range" | undefined;
488
+ start?: string | undefined;
489
+ end?: string | undefined;
490
+ } | undefined;
491
+ };
492
+ field?: string | undefined;
493
+ }>;
494
+ /**
495
+ * Field Selection Node
496
+ * Represents "Select" attributes, including joins.
497
+ */
498
+ declare const FieldNodeSchema: z.ZodType<any>;
499
+ /**
500
+ * Full-Text Search Configuration
501
+ * Defines full-text search parameters for text queries.
502
+ *
503
+ * Supports:
504
+ * - Multi-field search
505
+ * - Relevance scoring
506
+ * - Fuzzy matching
507
+ * - Language-specific analyzers
508
+ *
509
+ * @example
510
+ * {
511
+ * query: "John Smith",
512
+ * fields: ["name", "email", "description"],
513
+ * fuzzy: true,
514
+ * boost: { "name": 2.0, "email": 1.5 }
515
+ * }
516
+ */
517
+ declare const FullTextSearchSchema: z.ZodObject<{
518
+ query: z.ZodString;
519
+ fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
520
+ fuzzy: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
521
+ operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<["and", "or"]>>>;
522
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
523
+ minScore: z.ZodOptional<z.ZodNumber>;
524
+ language: z.ZodOptional<z.ZodString>;
525
+ highlight: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
526
+ }, "strip", z.ZodTypeAny, {
527
+ query: string;
528
+ fuzzy: boolean;
529
+ operator: "and" | "or";
530
+ highlight: boolean;
531
+ fields?: string[] | undefined;
532
+ boost?: Record<string, number> | undefined;
533
+ minScore?: number | undefined;
534
+ language?: string | undefined;
535
+ }, {
536
+ query: string;
537
+ fields?: string[] | undefined;
538
+ fuzzy?: boolean | undefined;
539
+ operator?: "and" | "or" | undefined;
540
+ boost?: Record<string, number> | undefined;
541
+ minScore?: number | undefined;
542
+ language?: string | undefined;
543
+ highlight?: boolean | undefined;
544
+ }>;
545
+ type FullTextSearch = z.infer<typeof FullTextSearchSchema>;
546
+ /**
547
+ * Query AST Schema
548
+ * The universal data retrieval contract defined in `ast-structure.mdx`.
549
+ *
550
+ * This schema represents ObjectQL - a universal query language that abstracts
551
+ * SQL, NoSQL, and SaaS APIs into a single unified interface.
552
+ *
553
+ * Updates (v2):
554
+ * - Aligned with modern ORM standards (Prisma/TypeORM)
555
+ * - Added `cursor` based pagination support
556
+ * - Renamed `top`/`skip` to `limit`/`offset`
557
+ * - Unified filtering syntax with `FilterConditionSchema`
558
+ *
559
+ * Updates (v3):
560
+ * - Added `search` parameter for full-text search (P2 requirement)
561
+ *
562
+ * @example
563
+ * // Simple query: SELECT name, email FROM account WHERE status = 'active'
564
+ * {
565
+ * object: 'account',
566
+ * fields: ['name', 'email'],
567
+ * where: { status: 'active' }
568
+ * }
569
+ *
570
+ * @example
571
+ * // Pagination with Limit/Offset
572
+ * {
573
+ * object: 'post',
574
+ * where: { published: true },
575
+ * orderBy: [{ field: 'created_at', order: 'desc' }],
576
+ * limit: 20,
577
+ * offset: 40
578
+ * }
579
+ *
580
+ * @example
581
+ * // Full-text search
582
+ * {
583
+ * object: 'article',
584
+ * search: {
585
+ * query: "machine learning",
586
+ * fields: ["title", "content"],
587
+ * fuzzy: true,
588
+ * boost: { "title": 2.0 }
589
+ * },
590
+ * limit: 10
591
+ * }
592
+ */
593
+ declare const BaseQuerySchema: z.ZodObject<{
594
+ /** Target Entity */
595
+ object: z.ZodString;
596
+ /** Select Clause */
597
+ fields: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
598
+ /** Where Clause (Filtering) */
599
+ where: z.ZodOptional<z.ZodType<FilterCondition, z.ZodTypeDef, FilterCondition>>;
600
+ /** Full-Text Search */
601
+ search: z.ZodOptional<z.ZodObject<{
602
+ query: z.ZodString;
603
+ fields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
604
+ fuzzy: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
605
+ operator: z.ZodDefault<z.ZodOptional<z.ZodEnum<["and", "or"]>>>;
606
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
607
+ minScore: z.ZodOptional<z.ZodNumber>;
608
+ language: z.ZodOptional<z.ZodString>;
609
+ highlight: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
610
+ }, "strip", z.ZodTypeAny, {
611
+ query: string;
612
+ fuzzy: boolean;
613
+ operator: "and" | "or";
614
+ highlight: boolean;
615
+ fields?: string[] | undefined;
616
+ boost?: Record<string, number> | undefined;
617
+ minScore?: number | undefined;
618
+ language?: string | undefined;
619
+ }, {
620
+ query: string;
621
+ fields?: string[] | undefined;
622
+ fuzzy?: boolean | undefined;
623
+ operator?: "and" | "or" | undefined;
624
+ boost?: Record<string, number> | undefined;
625
+ minScore?: number | undefined;
626
+ language?: string | undefined;
627
+ highlight?: boolean | undefined;
628
+ }>>;
629
+ /** Order By Clause (Sorting) */
630
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
631
+ field: z.ZodString;
632
+ order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ field: string;
635
+ order: "asc" | "desc";
636
+ }, {
637
+ field: string;
638
+ order?: "asc" | "desc" | undefined;
639
+ }>, "many">>;
640
+ /** Pagination */
641
+ limit: z.ZodOptional<z.ZodNumber>;
642
+ offset: z.ZodOptional<z.ZodNumber>;
643
+ top: z.ZodOptional<z.ZodNumber>;
644
+ cursor: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
645
+ /** Joins */
646
+ joins: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
647
+ /** Aggregations */
648
+ aggregations: z.ZodOptional<z.ZodArray<z.ZodObject<{
649
+ function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
650
+ field: z.ZodOptional<z.ZodString>;
651
+ alias: z.ZodString;
652
+ distinct: z.ZodOptional<z.ZodBoolean>;
653
+ filter: z.ZodOptional<z.ZodType<FilterCondition, z.ZodTypeDef, FilterCondition>>;
654
+ }, "strip", z.ZodTypeAny, {
655
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
656
+ alias: string;
657
+ filter?: FilterCondition | undefined;
658
+ field?: string | undefined;
659
+ distinct?: boolean | undefined;
660
+ }, {
661
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
662
+ alias: string;
663
+ filter?: FilterCondition | undefined;
664
+ field?: string | undefined;
665
+ distinct?: boolean | undefined;
666
+ }>, "many">>;
667
+ /** Group By Clause */
668
+ groupBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
669
+ /** Having Clause */
670
+ having: z.ZodOptional<z.ZodType<FilterCondition, z.ZodTypeDef, FilterCondition>>;
671
+ /** Window Functions */
672
+ windowFunctions: z.ZodOptional<z.ZodArray<z.ZodObject<{
673
+ function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
674
+ field: z.ZodOptional<z.ZodString>;
675
+ alias: z.ZodString;
676
+ over: z.ZodObject<{
677
+ partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
678
+ orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
679
+ field: z.ZodString;
680
+ order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
681
+ }, "strip", z.ZodTypeAny, {
682
+ field: string;
683
+ order: "asc" | "desc";
684
+ }, {
685
+ field: string;
686
+ order?: "asc" | "desc" | undefined;
687
+ }>, "many">>;
688
+ frame: z.ZodOptional<z.ZodObject<{
689
+ type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
690
+ start: z.ZodOptional<z.ZodString>;
691
+ end: z.ZodOptional<z.ZodString>;
692
+ }, "strip", z.ZodTypeAny, {
693
+ type?: "rows" | "range" | undefined;
694
+ start?: string | undefined;
695
+ end?: string | undefined;
696
+ }, {
697
+ type?: "rows" | "range" | undefined;
698
+ start?: string | undefined;
699
+ end?: string | undefined;
700
+ }>>;
701
+ }, "strip", z.ZodTypeAny, {
702
+ orderBy?: {
703
+ field: string;
704
+ order: "asc" | "desc";
705
+ }[] | undefined;
706
+ partitionBy?: string[] | undefined;
707
+ frame?: {
708
+ type?: "rows" | "range" | undefined;
709
+ start?: string | undefined;
710
+ end?: string | undefined;
711
+ } | undefined;
712
+ }, {
713
+ orderBy?: {
714
+ field: string;
715
+ order?: "asc" | "desc" | undefined;
716
+ }[] | undefined;
717
+ partitionBy?: string[] | undefined;
718
+ frame?: {
719
+ type?: "rows" | "range" | undefined;
720
+ start?: string | undefined;
721
+ end?: string | undefined;
722
+ } | undefined;
723
+ }>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
726
+ alias: string;
727
+ over: {
728
+ orderBy?: {
729
+ field: string;
730
+ order: "asc" | "desc";
731
+ }[] | undefined;
732
+ partitionBy?: string[] | undefined;
733
+ frame?: {
734
+ type?: "rows" | "range" | undefined;
735
+ start?: string | undefined;
736
+ end?: string | undefined;
737
+ } | undefined;
738
+ };
739
+ field?: string | undefined;
740
+ }, {
741
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
742
+ alias: string;
743
+ over: {
744
+ orderBy?: {
745
+ field: string;
746
+ order?: "asc" | "desc" | undefined;
747
+ }[] | undefined;
748
+ partitionBy?: string[] | undefined;
749
+ frame?: {
750
+ type?: "rows" | "range" | undefined;
751
+ start?: string | undefined;
752
+ end?: string | undefined;
753
+ } | undefined;
754
+ };
755
+ field?: string | undefined;
756
+ }>, "many">>;
757
+ /** Subquery flag */
758
+ distinct: z.ZodOptional<z.ZodBoolean>;
759
+ }, "strip", z.ZodTypeAny, {
760
+ object: string;
761
+ where?: FilterCondition | undefined;
762
+ distinct?: boolean | undefined;
763
+ fields?: any[] | undefined;
764
+ search?: {
765
+ query: string;
766
+ fuzzy: boolean;
767
+ operator: "and" | "or";
768
+ highlight: boolean;
769
+ fields?: string[] | undefined;
770
+ boost?: Record<string, number> | undefined;
771
+ minScore?: number | undefined;
772
+ language?: string | undefined;
773
+ } | undefined;
774
+ orderBy?: {
775
+ field: string;
776
+ order: "asc" | "desc";
777
+ }[] | undefined;
778
+ limit?: number | undefined;
779
+ offset?: number | undefined;
780
+ top?: number | undefined;
781
+ cursor?: Record<string, any> | undefined;
782
+ joins?: any[] | undefined;
783
+ aggregations?: {
784
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
785
+ alias: string;
786
+ filter?: FilterCondition | undefined;
787
+ field?: string | undefined;
788
+ distinct?: boolean | undefined;
789
+ }[] | undefined;
790
+ groupBy?: string[] | undefined;
791
+ having?: FilterCondition | undefined;
792
+ windowFunctions?: {
793
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
794
+ alias: string;
795
+ over: {
796
+ orderBy?: {
797
+ field: string;
798
+ order: "asc" | "desc";
799
+ }[] | undefined;
800
+ partitionBy?: string[] | undefined;
801
+ frame?: {
802
+ type?: "rows" | "range" | undefined;
803
+ start?: string | undefined;
804
+ end?: string | undefined;
805
+ } | undefined;
806
+ };
807
+ field?: string | undefined;
808
+ }[] | undefined;
809
+ }, {
810
+ object: string;
811
+ where?: FilterCondition | undefined;
812
+ distinct?: boolean | undefined;
813
+ fields?: any[] | undefined;
814
+ search?: {
815
+ query: string;
816
+ fields?: string[] | undefined;
817
+ fuzzy?: boolean | undefined;
818
+ operator?: "and" | "or" | undefined;
819
+ boost?: Record<string, number> | undefined;
820
+ minScore?: number | undefined;
821
+ language?: string | undefined;
822
+ highlight?: boolean | undefined;
823
+ } | undefined;
824
+ orderBy?: {
825
+ field: string;
826
+ order?: "asc" | "desc" | undefined;
827
+ }[] | undefined;
828
+ limit?: number | undefined;
829
+ offset?: number | undefined;
830
+ top?: number | undefined;
831
+ cursor?: Record<string, any> | undefined;
832
+ joins?: any[] | undefined;
833
+ aggregations?: {
834
+ function: "count" | "sum" | "avg" | "min" | "max" | "count_distinct" | "array_agg" | "string_agg";
835
+ alias: string;
836
+ filter?: FilterCondition | undefined;
837
+ field?: string | undefined;
838
+ distinct?: boolean | undefined;
839
+ }[] | undefined;
840
+ groupBy?: string[] | undefined;
841
+ having?: FilterCondition | undefined;
842
+ windowFunctions?: {
843
+ function: "count" | "sum" | "avg" | "min" | "max" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
844
+ alias: string;
845
+ over: {
846
+ orderBy?: {
847
+ field: string;
848
+ order?: "asc" | "desc" | undefined;
849
+ }[] | undefined;
850
+ partitionBy?: string[] | undefined;
851
+ frame?: {
852
+ type?: "rows" | "range" | undefined;
853
+ start?: string | undefined;
854
+ end?: string | undefined;
855
+ } | undefined;
856
+ };
857
+ field?: string | undefined;
858
+ }[] | undefined;
859
+ }>;
860
+ type QueryAST = z.infer<typeof BaseQuerySchema> & {
861
+ expand?: Record<string, QueryAST>;
862
+ };
863
+ type QueryInput = z.input<typeof BaseQuerySchema> & {
864
+ expand?: Record<string, QueryInput>;
865
+ };
866
+ declare const QuerySchema: z.ZodType<QueryAST, z.ZodTypeDef, QueryInput>;
867
+ type SortNode = z.infer<typeof SortNodeSchema>;
868
+ type AggregationNode = z.infer<typeof AggregationNodeSchema>;
869
+ type JoinNode = z.infer<typeof JoinNodeSchema>;
870
+ type WindowFunctionNode = z.infer<typeof WindowFunctionNodeSchema>;
871
+ type WindowSpec = z.infer<typeof WindowSpecSchema>;
872
+
3
873
  /**
4
874
  * Field Type Enum
5
875
  */
@@ -6586,4 +7456,4 @@ declare const Field: {
6586
7456
  };
6587
7457
  };
6588
7458
 
6589
- export { type Address as A, type ComputedFieldCache as C, type DataQualityRules as D, FieldType as F, type LocationCoordinates as L, type SelectOption as S, type VectorConfig as V, FieldSchema as a, AddressSchema as b, ComputedFieldCacheSchema as c, type CurrencyConfig as d, CurrencyConfigSchema as e, type CurrencyValue as f, CurrencyValueSchema as g, DataQualityRulesSchema as h, Field as i, type FieldInput as j, type FileAttachmentConfig as k, FileAttachmentConfigSchema as l, LocationCoordinatesSchema as m, SelectOptionSchema as n, VectorConfigSchema as o };
7459
+ export { type Address as A, SortNodeSchema as B, type ComputedFieldCache as C, type DataQualityRules as D, VectorConfigSchema as E, FieldType as F, type WindowFunctionNode as G, WindowFunctionNodeSchema as H, type WindowSpec as I, type JoinNode as J, WindowSpecSchema as K, type LocationCoordinates as L, type QueryAST as Q, type SelectOption as S, type VectorConfig as V, WindowFunction as W, type QueryInput as a, FieldSchema as b, AddressSchema as c, AggregationFunction as d, type AggregationNode as e, AggregationNodeSchema as f, ComputedFieldCacheSchema as g, type CurrencyConfig as h, CurrencyConfigSchema as i, type CurrencyValue as j, CurrencyValueSchema as k, DataQualityRulesSchema as l, Field as m, type FieldInput as n, FieldNodeSchema as o, type FileAttachmentConfig as p, FileAttachmentConfigSchema as q, type FullTextSearch as r, FullTextSearchSchema as s, JoinNodeSchema as t, JoinStrategy as u, JoinType as v, LocationCoordinatesSchema as w, QuerySchema as x, SelectOptionSchema as y, type SortNode as z };