@objectstack/spec 0.2.0 → 0.3.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.
- package/README.md +127 -5
- package/dist/ai/index.d.ts +14 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +29 -0
- package/dist/ai/model-registry.zod.d.ts +1389 -0
- package/dist/ai/model-registry.zod.d.ts.map +1 -0
- package/dist/ai/model-registry.zod.js +164 -0
- package/dist/ai/nlq.zod.d.ts +1126 -0
- package/dist/ai/nlq.zod.d.ts.map +1 -0
- package/dist/ai/nlq.zod.js +246 -0
- package/dist/ai/rag-pipeline.zod.d.ts +1034 -0
- package/dist/ai/rag-pipeline.zod.d.ts.map +1 -0
- package/dist/ai/rag-pipeline.zod.js +244 -0
- package/dist/api/index.d.ts +9 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +24 -0
- package/dist/data/index.d.ts +21 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +36 -0
- package/dist/data/query.zod.d.ts +386 -3
- package/dist/data/query.zod.d.ts.map +1 -1
- package/dist/data/query.zod.js +386 -3
- package/dist/data/validation.zod.d.ts +349 -0
- package/dist/data/validation.zod.d.ts.map +1 -1
- package/dist/data/validation.zod.js +395 -0
- package/dist/index.d.ts +36 -41
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -49
- package/dist/system/auth-protocol.d.ts +175 -0
- package/dist/system/auth-protocol.d.ts.map +1 -0
- package/dist/system/auth-protocol.js +60 -0
- package/dist/system/auth.zod.d.ts +1097 -65
- package/dist/system/auth.zod.d.ts.map +1 -1
- package/dist/system/auth.zod.js +135 -1
- package/dist/system/identity.zod.d.ts +234 -180
- package/dist/system/identity.zod.d.ts.map +1 -1
- package/dist/system/identity.zod.js +168 -51
- package/dist/system/index.d.ts +28 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/system/index.js +43 -0
- package/dist/system/manifest.zod.d.ts +10 -10
- package/dist/system/organization.zod.d.ts +179 -0
- package/dist/system/organization.zod.d.ts.map +1 -0
- package/dist/system/organization.zod.js +129 -0
- package/dist/ui/action.zod.d.ts +2 -2
- package/dist/ui/index.d.ts +17 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/theme.zod.d.ts +6 -6
- package/json-schema/Account.json +87 -0
- package/json-schema/AuthConfig.json +235 -0
- package/json-schema/ChunkingStrategy.json +133 -0
- package/json-schema/DatabaseMapping.json +48 -0
- package/json-schema/DocumentChunk.json +97 -0
- package/json-schema/DocumentLoaderConfig.json +69 -0
- package/json-schema/DocumentMetadata.json +61 -0
- package/json-schema/EmbeddingModel.json +57 -0
- package/json-schema/EnterpriseAuthConfig.json +172 -0
- package/json-schema/Entity.json +55 -0
- package/json-schema/FieldSynonymConfig.json +39 -0
- package/json-schema/Invitation.json +69 -0
- package/json-schema/InvitationStatus.json +15 -0
- package/json-schema/LDAPConfig.json +22 -5
- package/json-schema/Member.json +46 -0
- package/json-schema/ModelCapability.json +47 -0
- package/json-schema/ModelConfig.json +181 -0
- package/json-schema/ModelLimits.json +45 -0
- package/json-schema/ModelPricing.json +28 -0
- package/json-schema/ModelProvider.json +19 -0
- package/json-schema/ModelRegistry.json +427 -0
- package/json-schema/ModelRegistryEntry.json +239 -0
- package/json-schema/ModelSelectionCriteria.json +50 -0
- package/json-schema/NLQAnalytics.json +106 -0
- package/json-schema/NLQFieldMapping.json +40 -0
- package/json-schema/NLQModelConfig.json +78 -0
- package/json-schema/NLQParseResult.json +252 -0
- package/json-schema/NLQRequest.json +110 -0
- package/json-schema/NLQResponse.json +288 -0
- package/json-schema/NLQTrainingExample.json +120 -0
- package/json-schema/OIDCConfig.json +18 -3
- package/json-schema/Organization.json +52 -0
- package/json-schema/PromptTemplate.json +163 -0
- package/json-schema/PromptVariable.json +56 -0
- package/json-schema/QueryContext.json +72 -0
- package/json-schema/QueryIntent.json +21 -0
- package/json-schema/QueryTemplate.json +81 -0
- package/json-schema/RAGPipelineConfig.json +552 -0
- package/json-schema/RAGPipelineStatus.json +66 -0
- package/json-schema/RAGQueryRequest.json +64 -0
- package/json-schema/RAGQueryResponse.json +108 -0
- package/json-schema/RerankingConfig.json +34 -0
- package/json-schema/RetrievalStrategy.json +121 -0
- package/json-schema/SAMLConfig.json +17 -3
- package/json-schema/Session.json +63 -0
- package/json-schema/StandardAuthProvider.json +235 -0
- package/json-schema/Timeframe.json +68 -0
- package/json-schema/User.json +51 -0
- package/json-schema/VectorStoreConfig.json +82 -0
- package/json-schema/VectorStoreProvider.json +21 -0
- package/json-schema/VerificationToken.json +36 -0
- package/package.json +27 -1
- package/json-schema/AuthProtocol.json +0 -17
- package/json-schema/AuthProvider.json +0 -171
package/dist/data/query.zod.d.ts
CHANGED
|
@@ -34,12 +34,74 @@ export declare const SortNodeSchema: z.ZodObject<{
|
|
|
34
34
|
}>;
|
|
35
35
|
/**
|
|
36
36
|
* Aggregation Function Enum
|
|
37
|
-
* Standard aggregation functions.
|
|
37
|
+
* Standard aggregation functions for data analysis.
|
|
38
|
+
*
|
|
39
|
+
* Supported Functions:
|
|
40
|
+
* - **count**: Count rows (SQL: COUNT(*) or COUNT(field))
|
|
41
|
+
* - **sum**: Sum numeric values (SQL: SUM(field))
|
|
42
|
+
* - **avg**: Average numeric values (SQL: AVG(field))
|
|
43
|
+
* - **min**: Minimum value (SQL: MIN(field))
|
|
44
|
+
* - **max**: Maximum value (SQL: MAX(field))
|
|
45
|
+
* - **count_distinct**: Count unique values (SQL: COUNT(DISTINCT field))
|
|
46
|
+
* - **array_agg**: Aggregate values into array (SQL: ARRAY_AGG(field))
|
|
47
|
+
* - **string_agg**: Concatenate values (SQL: STRING_AGG(field, delimiter))
|
|
48
|
+
*
|
|
49
|
+
* Performance Considerations:
|
|
50
|
+
* - COUNT(*) is typically faster than COUNT(field) as it doesn't check for nulls
|
|
51
|
+
* - COUNT DISTINCT may require additional memory for tracking unique values
|
|
52
|
+
* - Window aggregates (with OVER clause) can be more efficient than subqueries
|
|
53
|
+
* - Large GROUP BY operations benefit from proper indexing on grouped fields
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // SQL: SELECT region, SUM(amount) FROM sales GROUP BY region
|
|
57
|
+
* {
|
|
58
|
+
* object: 'sales',
|
|
59
|
+
* fields: ['region'],
|
|
60
|
+
* aggregations: [
|
|
61
|
+
* { function: 'sum', field: 'amount', alias: 'total_sales' }
|
|
62
|
+
* ],
|
|
63
|
+
* groupBy: ['region']
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Salesforce SOQL: SELECT COUNT(Id) FROM Account
|
|
68
|
+
* {
|
|
69
|
+
* object: 'account',
|
|
70
|
+
* aggregations: [
|
|
71
|
+
* { function: 'count', alias: 'total_accounts' }
|
|
72
|
+
* ]
|
|
73
|
+
* }
|
|
38
74
|
*/
|
|
39
75
|
export declare const AggregationFunction: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
40
76
|
/**
|
|
41
77
|
* Aggregation Node
|
|
42
|
-
* Represents aggregated field with function.
|
|
78
|
+
* Represents an aggregated field with function.
|
|
79
|
+
*
|
|
80
|
+
* Aggregations summarize data across groups of rows (GROUP BY).
|
|
81
|
+
* Used with `groupBy` to create analytical queries.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* // SQL: SELECT customer_id, COUNT(*), SUM(amount) FROM orders GROUP BY customer_id
|
|
85
|
+
* {
|
|
86
|
+
* object: 'order',
|
|
87
|
+
* fields: ['customer_id'],
|
|
88
|
+
* aggregations: [
|
|
89
|
+
* { function: 'count', alias: 'order_count' },
|
|
90
|
+
* { function: 'sum', field: 'amount', alias: 'total_amount' }
|
|
91
|
+
* ],
|
|
92
|
+
* groupBy: ['customer_id']
|
|
93
|
+
* }
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* // Salesforce SOQL: SELECT LeadSource, COUNT(Id) FROM Lead GROUP BY LeadSource
|
|
97
|
+
* {
|
|
98
|
+
* object: 'lead',
|
|
99
|
+
* fields: ['lead_source'],
|
|
100
|
+
* aggregations: [
|
|
101
|
+
* { function: 'count', alias: 'lead_count' }
|
|
102
|
+
* ],
|
|
103
|
+
* groupBy: ['lead_source']
|
|
104
|
+
* }
|
|
43
105
|
*/
|
|
44
106
|
export declare const AggregationNodeSchema: z.ZodObject<{
|
|
45
107
|
function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
@@ -59,20 +121,202 @@ export declare const AggregationNodeSchema: z.ZodObject<{
|
|
|
59
121
|
}>;
|
|
60
122
|
/**
|
|
61
123
|
* Join Type Enum
|
|
124
|
+
* Standard SQL join types for combining tables.
|
|
125
|
+
*
|
|
126
|
+
* Join Types:
|
|
127
|
+
* - **inner**: Returns only matching rows from both tables (SQL: INNER JOIN)
|
|
128
|
+
* - **left**: Returns all rows from left table, matching rows from right (SQL: LEFT JOIN)
|
|
129
|
+
* - **right**: Returns all rows from right table, matching rows from left (SQL: RIGHT JOIN)
|
|
130
|
+
* - **full**: Returns all rows from both tables (SQL: FULL OUTER JOIN)
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* // SQL: SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id
|
|
134
|
+
* {
|
|
135
|
+
* object: 'order',
|
|
136
|
+
* joins: [
|
|
137
|
+
* {
|
|
138
|
+
* type: 'inner',
|
|
139
|
+
* object: 'customer',
|
|
140
|
+
* on: ['order.customer_id', '=', 'customer.id']
|
|
141
|
+
* }
|
|
142
|
+
* ]
|
|
143
|
+
* }
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* // Salesforce SOQL-style: Find all customers and their orders (if any)
|
|
147
|
+
* {
|
|
148
|
+
* object: 'customer',
|
|
149
|
+
* joins: [
|
|
150
|
+
* {
|
|
151
|
+
* type: 'left',
|
|
152
|
+
* object: 'order',
|
|
153
|
+
* on: ['customer.id', '=', 'order.customer_id']
|
|
154
|
+
* }
|
|
155
|
+
* ]
|
|
156
|
+
* }
|
|
62
157
|
*/
|
|
63
158
|
export declare const JoinType: z.ZodEnum<["inner", "left", "right", "full"]>;
|
|
64
159
|
/**
|
|
65
160
|
* Join Node
|
|
66
|
-
* Represents table joins.
|
|
161
|
+
* Represents table joins for combining data from multiple objects.
|
|
162
|
+
*
|
|
163
|
+
* Joins connect related data across multiple tables using ON conditions.
|
|
164
|
+
* Supports both direct object joins and subquery joins.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* // SQL: SELECT o.*, c.name FROM orders o INNER JOIN customers c ON o.customer_id = c.id
|
|
168
|
+
* {
|
|
169
|
+
* object: 'order',
|
|
170
|
+
* fields: ['id', 'amount'],
|
|
171
|
+
* joins: [
|
|
172
|
+
* {
|
|
173
|
+
* type: 'inner',
|
|
174
|
+
* object: 'customer',
|
|
175
|
+
* alias: 'c',
|
|
176
|
+
* on: ['order.customer_id', '=', 'c.id']
|
|
177
|
+
* }
|
|
178
|
+
* ]
|
|
179
|
+
* }
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* // SQL: Multi-table join
|
|
183
|
+
* // SELECT * FROM orders o
|
|
184
|
+
* // INNER JOIN customers c ON o.customer_id = c.id
|
|
185
|
+
* // LEFT JOIN shipments s ON o.id = s.order_id
|
|
186
|
+
* {
|
|
187
|
+
* object: 'order',
|
|
188
|
+
* joins: [
|
|
189
|
+
* {
|
|
190
|
+
* type: 'inner',
|
|
191
|
+
* object: 'customer',
|
|
192
|
+
* alias: 'c',
|
|
193
|
+
* on: ['order.customer_id', '=', 'c.id']
|
|
194
|
+
* },
|
|
195
|
+
* {
|
|
196
|
+
* type: 'left',
|
|
197
|
+
* object: 'shipment',
|
|
198
|
+
* alias: 's',
|
|
199
|
+
* on: ['order.id', '=', 's.order_id']
|
|
200
|
+
* }
|
|
201
|
+
* ]
|
|
202
|
+
* }
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* // Salesforce SOQL: SELECT Name, (SELECT LastName FROM Contacts) FROM Account
|
|
206
|
+
* {
|
|
207
|
+
* object: 'account',
|
|
208
|
+
* fields: ['name'],
|
|
209
|
+
* joins: [
|
|
210
|
+
* {
|
|
211
|
+
* type: 'left',
|
|
212
|
+
* object: 'contact',
|
|
213
|
+
* on: ['account.id', '=', 'contact.account_id']
|
|
214
|
+
* }
|
|
215
|
+
* ]
|
|
216
|
+
* }
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* // Subquery Join: Join with a filtered/aggregated dataset
|
|
220
|
+
* {
|
|
221
|
+
* object: 'customer',
|
|
222
|
+
* joins: [
|
|
223
|
+
* {
|
|
224
|
+
* type: 'left',
|
|
225
|
+
* object: 'order',
|
|
226
|
+
* alias: 'high_value_orders',
|
|
227
|
+
* on: ['customer.id', '=', 'high_value_orders.customer_id'],
|
|
228
|
+
* subquery: {
|
|
229
|
+
* object: 'order',
|
|
230
|
+
* fields: ['customer_id', 'total'],
|
|
231
|
+
* filters: ['total', '>', 1000]
|
|
232
|
+
* }
|
|
233
|
+
* }
|
|
234
|
+
* ]
|
|
235
|
+
* }
|
|
67
236
|
*/
|
|
68
237
|
export declare const JoinNodeSchema: z.ZodType<any>;
|
|
69
238
|
/**
|
|
70
239
|
* Window Function Enum
|
|
240
|
+
* Advanced analytical functions for row-based calculations.
|
|
241
|
+
*
|
|
242
|
+
* Window Functions:
|
|
243
|
+
* - **row_number**: Sequential number within partition (SQL: ROW_NUMBER() OVER (...))
|
|
244
|
+
* - **rank**: Rank with gaps for ties (SQL: RANK() OVER (...))
|
|
245
|
+
* - **dense_rank**: Rank without gaps (SQL: DENSE_RANK() OVER (...))
|
|
246
|
+
* - **percent_rank**: Relative rank as percentage (SQL: PERCENT_RANK() OVER (...))
|
|
247
|
+
* - **lag**: Access previous row value (SQL: LAG(field) OVER (...))
|
|
248
|
+
* - **lead**: Access next row value (SQL: LEAD(field) OVER (...))
|
|
249
|
+
* - **first_value**: First value in window (SQL: FIRST_VALUE(field) OVER (...))
|
|
250
|
+
* - **last_value**: Last value in window (SQL: LAST_VALUE(field) OVER (...))
|
|
251
|
+
* - **sum/avg/count/min/max**: Aggregates over window (SQL: SUM(field) OVER (...))
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* // SQL: SELECT *, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY amount DESC) as rank
|
|
255
|
+
* // FROM orders
|
|
256
|
+
* {
|
|
257
|
+
* object: 'order',
|
|
258
|
+
* fields: ['id', 'customer_id', 'amount'],
|
|
259
|
+
* windowFunctions: [
|
|
260
|
+
* {
|
|
261
|
+
* function: 'row_number',
|
|
262
|
+
* alias: 'rank',
|
|
263
|
+
* over: {
|
|
264
|
+
* partitionBy: ['customer_id'],
|
|
265
|
+
* orderBy: [{ field: 'amount', order: 'desc' }]
|
|
266
|
+
* }
|
|
267
|
+
* }
|
|
268
|
+
* ]
|
|
269
|
+
* }
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* // SQL: Running total with SUM() OVER (...)
|
|
273
|
+
* {
|
|
274
|
+
* object: 'transaction',
|
|
275
|
+
* fields: ['date', 'amount'],
|
|
276
|
+
* windowFunctions: [
|
|
277
|
+
* {
|
|
278
|
+
* function: 'sum',
|
|
279
|
+
* field: 'amount',
|
|
280
|
+
* alias: 'running_total',
|
|
281
|
+
* over: {
|
|
282
|
+
* orderBy: [{ field: 'date', order: 'asc' }],
|
|
283
|
+
* frame: {
|
|
284
|
+
* type: 'rows',
|
|
285
|
+
* start: 'UNBOUNDED PRECEDING',
|
|
286
|
+
* end: 'CURRENT ROW'
|
|
287
|
+
* }
|
|
288
|
+
* }
|
|
289
|
+
* }
|
|
290
|
+
* ]
|
|
291
|
+
* }
|
|
71
292
|
*/
|
|
72
293
|
export declare const WindowFunction: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
|
|
73
294
|
/**
|
|
74
295
|
* Window Specification
|
|
75
296
|
* Defines PARTITION BY and ORDER BY for window functions.
|
|
297
|
+
*
|
|
298
|
+
* Window specifications control how window functions compute values:
|
|
299
|
+
* - **partitionBy**: Divide rows into groups (like GROUP BY but without collapsing rows)
|
|
300
|
+
* - **orderBy**: Define order for ranking and offset functions
|
|
301
|
+
* - **frame**: Specify which rows to include in aggregate calculations
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Partition by department, order by salary
|
|
305
|
+
* {
|
|
306
|
+
* partitionBy: ['department'],
|
|
307
|
+
* orderBy: [{ field: 'salary', order: 'desc' }]
|
|
308
|
+
* }
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* // Moving average with frame specification
|
|
312
|
+
* {
|
|
313
|
+
* orderBy: [{ field: 'date', order: 'asc' }],
|
|
314
|
+
* frame: {
|
|
315
|
+
* type: 'rows',
|
|
316
|
+
* start: '6 PRECEDING',
|
|
317
|
+
* end: 'CURRENT ROW'
|
|
318
|
+
* }
|
|
319
|
+
* }
|
|
76
320
|
*/
|
|
77
321
|
export declare const WindowSpecSchema: z.ZodObject<{
|
|
78
322
|
partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -125,6 +369,45 @@ export declare const WindowSpecSchema: z.ZodObject<{
|
|
|
125
369
|
/**
|
|
126
370
|
* Window Function Node
|
|
127
371
|
* Represents window function with OVER clause.
|
|
372
|
+
*
|
|
373
|
+
* Window functions perform calculations across a set of rows related to the current row,
|
|
374
|
+
* without collapsing the result set (unlike GROUP BY aggregations).
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* // SQL: Top 3 products per category
|
|
378
|
+
* // SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank
|
|
379
|
+
* // FROM products
|
|
380
|
+
* {
|
|
381
|
+
* object: 'product',
|
|
382
|
+
* fields: ['name', 'category', 'sales'],
|
|
383
|
+
* windowFunctions: [
|
|
384
|
+
* {
|
|
385
|
+
* function: 'row_number',
|
|
386
|
+
* alias: 'category_rank',
|
|
387
|
+
* over: {
|
|
388
|
+
* partitionBy: ['category'],
|
|
389
|
+
* orderBy: [{ field: 'sales', order: 'desc' }]
|
|
390
|
+
* }
|
|
391
|
+
* }
|
|
392
|
+
* ]
|
|
393
|
+
* }
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* // SQL: Year-over-year comparison with LAG
|
|
397
|
+
* {
|
|
398
|
+
* object: 'monthly_sales',
|
|
399
|
+
* fields: ['month', 'revenue'],
|
|
400
|
+
* windowFunctions: [
|
|
401
|
+
* {
|
|
402
|
+
* function: 'lag',
|
|
403
|
+
* field: 'revenue',
|
|
404
|
+
* alias: 'prev_year_revenue',
|
|
405
|
+
* over: {
|
|
406
|
+
* orderBy: [{ field: 'month', order: 'asc' }]
|
|
407
|
+
* }
|
|
408
|
+
* }
|
|
409
|
+
* ]
|
|
410
|
+
* }
|
|
128
411
|
*/
|
|
129
412
|
export declare const WindowFunctionNodeSchema: z.ZodObject<{
|
|
130
413
|
function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
|
|
@@ -219,6 +502,106 @@ export declare const FieldNodeSchema: z.ZodType<any>;
|
|
|
219
502
|
/**
|
|
220
503
|
* Query AST Schema
|
|
221
504
|
* The universal data retrieval contract defined in `ast-structure.mdx`.
|
|
505
|
+
*
|
|
506
|
+
* This schema represents ObjectQL - a universal query language that abstracts
|
|
507
|
+
* SQL, NoSQL, and SaaS APIs into a single unified interface.
|
|
508
|
+
*
|
|
509
|
+
* Key Features:
|
|
510
|
+
* - **Filtering**: WHERE clauses with nested logic
|
|
511
|
+
* - **Aggregations**: GROUP BY with COUNT, SUM, AVG, MIN, MAX
|
|
512
|
+
* - **Joins**: INNER, LEFT, RIGHT, FULL OUTER joins
|
|
513
|
+
* - **Window Functions**: ROW_NUMBER, RANK, LAG, LEAD, running totals
|
|
514
|
+
* - **Subqueries**: Nested queries in joins and filters
|
|
515
|
+
* - **Sorting & Pagination**: ORDER BY, LIMIT, OFFSET
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* // Simple query: SELECT name, email FROM account WHERE status = 'active'
|
|
519
|
+
* {
|
|
520
|
+
* object: 'account',
|
|
521
|
+
* fields: ['name', 'email'],
|
|
522
|
+
* filters: ['status', '=', 'active']
|
|
523
|
+
* }
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* // Aggregation: SELECT region, SUM(amount) as total FROM sales GROUP BY region HAVING total > 10000
|
|
527
|
+
* {
|
|
528
|
+
* object: 'sales',
|
|
529
|
+
* fields: ['region'],
|
|
530
|
+
* aggregations: [
|
|
531
|
+
* { function: 'sum', field: 'amount', alias: 'total' }
|
|
532
|
+
* ],
|
|
533
|
+
* groupBy: ['region'],
|
|
534
|
+
* having: ['total', '>', 10000]
|
|
535
|
+
* }
|
|
536
|
+
*
|
|
537
|
+
* @example
|
|
538
|
+
* // Join: SELECT o.*, c.name FROM orders o INNER JOIN customers c ON o.customer_id = c.id
|
|
539
|
+
* {
|
|
540
|
+
* object: 'order',
|
|
541
|
+
* fields: ['id', 'amount'],
|
|
542
|
+
* joins: [
|
|
543
|
+
* {
|
|
544
|
+
* type: 'inner',
|
|
545
|
+
* object: 'customer',
|
|
546
|
+
* alias: 'c',
|
|
547
|
+
* on: ['order.customer_id', '=', 'c.id']
|
|
548
|
+
* }
|
|
549
|
+
* ]
|
|
550
|
+
* }
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* // Window Function: Top 5 orders per customer
|
|
554
|
+
* {
|
|
555
|
+
* object: 'order',
|
|
556
|
+
* fields: ['customer_id', 'amount', 'created_at'],
|
|
557
|
+
* windowFunctions: [
|
|
558
|
+
* {
|
|
559
|
+
* function: 'row_number',
|
|
560
|
+
* alias: 'customer_order_rank',
|
|
561
|
+
* over: {
|
|
562
|
+
* partitionBy: ['customer_id'],
|
|
563
|
+
* orderBy: [{ field: 'amount', order: 'desc' }]
|
|
564
|
+
* }
|
|
565
|
+
* }
|
|
566
|
+
* ]
|
|
567
|
+
* }
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* // Complex: Customer lifetime value with rankings
|
|
571
|
+
* {
|
|
572
|
+
* object: 'customer',
|
|
573
|
+
* fields: ['id', 'name'],
|
|
574
|
+
* joins: [
|
|
575
|
+
* {
|
|
576
|
+
* type: 'left',
|
|
577
|
+
* object: 'order',
|
|
578
|
+
* alias: 'o',
|
|
579
|
+
* on: ['customer.id', '=', 'o.customer_id']
|
|
580
|
+
* }
|
|
581
|
+
* ],
|
|
582
|
+
* aggregations: [
|
|
583
|
+
* { function: 'count', field: 'o.id', alias: 'order_count' },
|
|
584
|
+
* { function: 'sum', field: 'o.amount', alias: 'lifetime_value' }
|
|
585
|
+
* ],
|
|
586
|
+
* groupBy: ['customer.id', 'customer.name'],
|
|
587
|
+
* having: ['order_count', '>', 0],
|
|
588
|
+
* sort: [{ field: 'lifetime_value', order: 'desc' }],
|
|
589
|
+
* top: 100
|
|
590
|
+
* }
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
* // Salesforce SOQL: SELECT Name, (SELECT LastName FROM Contacts) FROM Account
|
|
594
|
+
* {
|
|
595
|
+
* object: 'account',
|
|
596
|
+
* fields: ['name'],
|
|
597
|
+
* joins: [
|
|
598
|
+
* {
|
|
599
|
+
* type: 'left',
|
|
600
|
+
* object: 'contact',
|
|
601
|
+
* on: ['account.id', '=', 'contact.account_id']
|
|
602
|
+
* }
|
|
603
|
+
* ]
|
|
604
|
+
* }
|
|
222
605
|
*/
|
|
223
606
|
export declare const QuerySchema: z.ZodObject<{
|
|
224
607
|
/** Target Entity */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.zod.d.ts","sourceRoot":"","sources":["../../src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