@objectstack/spec 0.1.1 → 0.1.2
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 +73 -1
- package/dist/api/contract.zod.d.ts +1733 -0
- package/dist/api/contract.zod.d.ts.map +1 -0
- package/dist/api/contract.zod.js +138 -0
- package/dist/data/dataset.zod.d.ts +2 -2
- package/dist/data/field.zod.d.ts +1648 -10
- package/dist/data/field.zod.d.ts.map +1 -1
- package/dist/data/field.zod.js +149 -8
- package/dist/data/mapping.zod.d.ts +215 -2
- package/dist/data/mapping.zod.d.ts.map +1 -1
- package/dist/data/object.zod.d.ts +505 -25
- package/dist/data/object.zod.d.ts.map +1 -1
- package/dist/data/object.zod.js +32 -5
- package/dist/data/query.zod.d.ts +349 -0
- package/dist/data/query.zod.d.ts.map +1 -1
- package/dist/data/query.zod.js +77 -1
- package/dist/data/trigger.zod.d.ts +354 -0
- package/dist/data/trigger.zod.d.ts.map +1 -0
- package/dist/data/trigger.zod.js +195 -0
- package/dist/data/validation.zod.d.ts +83 -43
- package/dist/data/validation.zod.d.ts.map +1 -1
- package/dist/data/validation.zod.js +51 -5
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/system/api.zod.d.ts +130 -4
- package/dist/system/api.zod.d.ts.map +1 -1
- package/dist/system/api.zod.js +4 -1
- package/dist/system/datasource.zod.d.ts +89 -6
- package/dist/system/datasource.zod.d.ts.map +1 -1
- package/dist/system/datasource.zod.js +33 -5
- package/dist/system/discovery.zod.d.ts +174 -0
- package/dist/system/discovery.zod.d.ts.map +1 -0
- package/dist/system/discovery.zod.js +53 -0
- package/dist/system/driver.zod.d.ts +1525 -0
- package/dist/system/driver.zod.d.ts.map +1 -0
- package/dist/system/driver.zod.js +290 -0
- package/dist/system/license.zod.d.ts +2 -2
- package/dist/system/manifest.zod.d.ts +323 -52
- package/dist/system/manifest.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.js +91 -17
- package/dist/system/plugin.zod.d.ts +3516 -0
- package/dist/system/plugin.zod.d.ts.map +1 -0
- package/dist/system/plugin.zod.js +226 -0
- package/dist/system/territory.zod.d.ts +1 -1
- package/dist/system/webhook.zod.d.ts +3 -3
- package/dist/ui/action.zod.d.ts +19 -12
- package/dist/ui/action.zod.d.ts.map +1 -1
- package/dist/ui/action.zod.js +7 -1
- package/dist/ui/app.zod.d.ts +109 -3
- package/dist/ui/app.zod.d.ts.map +1 -1
- package/dist/ui/app.zod.js +13 -2
- package/dist/ui/dashboard.zod.d.ts +9 -3
- package/dist/ui/dashboard.zod.d.ts.map +1 -1
- package/dist/ui/dashboard.zod.js +7 -1
- package/dist/ui/page.zod.d.ts +6 -6
- package/dist/ui/report.zod.d.ts +9 -0
- package/dist/ui/report.zod.d.ts.map +1 -1
- package/dist/ui/report.zod.js +7 -1
- package/dist/ui/theme.zod.d.ts +1221 -0
- package/dist/ui/theme.zod.d.ts.map +1 -0
- package/dist/ui/theme.zod.js +202 -0
- package/dist/ui/widget.zod.d.ts +350 -0
- package/dist/ui/widget.zod.d.ts.map +1 -0
- package/dist/ui/widget.zod.js +66 -0
- package/json-schema/Action.json +8 -2
- package/json-schema/ActionParam.json +8 -2
- package/json-schema/Address.json +40 -0
- package/json-schema/AggregationFunction.json +19 -0
- package/json-schema/AggregationNode.json +42 -0
- package/json-schema/Animation.json +56 -0
- package/json-schema/ApiCapabilities.json +28 -0
- package/json-schema/ApiError.json +27 -0
- package/json-schema/ApiRoutes.json +41 -0
- package/json-schema/App.json +13 -2
- package/json-schema/AsyncValidation.json +70 -0
- package/json-schema/BaseResponse.json +63 -0
- package/json-schema/BorderRadius.json +44 -0
- package/json-schema/Breakpoints.json +36 -0
- package/json-schema/BulkRequest.json +29 -0
- package/json-schema/BulkResponse.json +108 -0
- package/json-schema/ColorPalette.json +83 -0
- package/json-schema/ConditionalValidation.json +793 -0
- package/json-schema/CreateRequest.json +20 -0
- package/json-schema/CrossFieldValidation.json +56 -0
- package/json-schema/CustomValidator.json +57 -0
- package/json-schema/Datasource.json +0 -18
- package/json-schema/DeleteResponse.json +68 -0
- package/json-schema/Discovery.json +114 -0
- package/json-schema/DriverCapabilities.json +39 -0
- package/json-schema/DriverDefinition.json +66 -0
- package/json-schema/DriverInterface.json +58 -0
- package/json-schema/DriverOptions.json +23 -0
- package/json-schema/DriverType.json +1 -18
- package/json-schema/ExportRequest.json +786 -0
- package/json-schema/Field.json +75 -4
- package/json-schema/FieldType.json +8 -2
- package/json-schema/FieldWidgetProps.json +327 -0
- package/json-schema/I18nContext.json +12 -0
- package/json-schema/JoinNode.json +455 -0
- package/json-schema/JoinType.json +15 -0
- package/json-schema/ListRecordResponse.json +103 -0
- package/json-schema/LocationCoordinates.json +36 -0
- package/json-schema/Logger.json +25 -0
- package/json-schema/Manifest.json +243 -18
- package/json-schema/Mapping.json +328 -0
- package/json-schema/ModificationResult.json +46 -0
- package/json-schema/Object.json +103 -6
- package/json-schema/ObjectCapabilities.json +26 -0
- package/json-schema/ObjectQLClient.json +12 -0
- package/json-schema/Plugin.json +20 -0
- package/json-schema/PluginContext.json +91 -0
- package/json-schema/PluginLifecycle.json +11 -0
- package/json-schema/Query.json +328 -0
- package/json-schema/RecordData.json +11 -0
- package/json-schema/Router.json +12 -0
- package/json-schema/Scheduler.json +12 -0
- package/json-schema/ScopedStorage.json +12 -0
- package/json-schema/Shadow.json +44 -0
- package/json-schema/SingleRecordResponse.json +69 -0
- package/json-schema/Spacing.json +64 -0
- package/json-schema/SystemAPI.json +12 -0
- package/json-schema/Theme.json +543 -0
- package/json-schema/ThemeMode.json +14 -0
- package/json-schema/Trigger.json +73 -0
- package/json-schema/TriggerAction.json +14 -0
- package/json-schema/TriggerContext.json +61 -0
- package/json-schema/TriggerTiming.json +13 -0
- package/json-schema/Typography.json +142 -0
- package/json-schema/UpdateRequest.json +20 -0
- package/json-schema/ValidationRule.json +583 -0
- package/json-schema/WindowFunction.json +24 -0
- package/json-schema/WindowFunctionNode.json +104 -0
- package/json-schema/WindowSpec.json +65 -0
- package/json-schema/ZIndex.json +44 -0
- package/package.json +8 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.zod.d.ts","sourceRoot":"","sources":["../../src/data/object.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B,4CAA4C;;IAG5C,oCAAoC;;IAGpC,qCAAqC;;IAGrC,+BAA+B;;IAG/B,iCAAiC;;IAGjC,mCAAmC
|
|
1
|
+
{"version":3,"file":"object.zod.d.ts","sourceRoot":"","sources":["../../src/data/object.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;IAC7B,4CAA4C;;IAG5C,oCAAoC;;IAGpC,qCAAqC;;IAGrC;;;;OAIG;;IAeH,+BAA+B;;IAG/B,iCAAiC;;IAGjC,mCAAmC;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;EAItB,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,gBAAgB;IACpB,eAAe;;;;;;IAOf;;;OAGG;;;;IAKH,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGxB,cAAc;;;;;;;;;;;;;;IAGd,iBAAiB;;IAGjB,8BAA8B;;QA3E9B,4CAA4C;;QAG5C,oCAAoC;;QAGpC,qCAAqC;;QAGrC;;;;WAIG;;QAeH,+BAA+B;;QAG/B,iCAAiC;;QAGjC,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;IA/BvB,eAAe;;;;;;IAOf;;;OAGG;;;;IAKH,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGxB,cAAc;;;;;;;;;;;;;;IAGd,iBAAiB;;IAGjB,8BAA8B;;QA3E9B,4CAA4C;;QAG5C,oCAAoC;;QAGpC,qCAAqC;;QAGrC;;;;WAIG;;QAeH,+BAA+B;;QAG/B,iCAAiC;;QAGjC,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAiD1B,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,UAAU,CAAC;CAC9D,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/data/object.zod.js
CHANGED
|
@@ -14,6 +14,24 @@ exports.ObjectCapabilities = zod_1.z.object({
|
|
|
14
14
|
searchable: zod_1.z.boolean().default(true),
|
|
15
15
|
/** Enable REST/GraphQL API access */
|
|
16
16
|
apiEnabled: zod_1.z.boolean().default(true),
|
|
17
|
+
/**
|
|
18
|
+
* API Supported Operations
|
|
19
|
+
* Explicitly whitelist allowed operations.
|
|
20
|
+
* If not defined, all standard operations are allowed (if apiEnabled=true).
|
|
21
|
+
*/
|
|
22
|
+
apiMethods: zod_1.z.array(zod_1.z.enum([
|
|
23
|
+
'get', 'list',
|
|
24
|
+
'create', 'update', 'delete',
|
|
25
|
+
'upsert',
|
|
26
|
+
'bulkCreate', 'bulkUpdate', 'bulkDelete', 'bulkUpsert',
|
|
27
|
+
'aggregate', // count, sum, group by
|
|
28
|
+
'history', // audit trail access
|
|
29
|
+
'search', // full text search
|
|
30
|
+
'restore', // undelete from trash
|
|
31
|
+
'purge', // hard delete
|
|
32
|
+
'import', // data import
|
|
33
|
+
'export', // data export
|
|
34
|
+
])).optional().describe('Allowed API operations'),
|
|
17
35
|
/** Enable attachments/files */
|
|
18
36
|
files: zod_1.z.boolean().default(false),
|
|
19
37
|
/** Enable discussions/chatter */
|
|
@@ -30,18 +48,21 @@ exports.IndexSchema = zod_1.z.object({
|
|
|
30
48
|
unique: zod_1.z.boolean().optional().describe('Whether the index is unique'),
|
|
31
49
|
});
|
|
32
50
|
/**
|
|
33
|
-
* Object Schema
|
|
51
|
+
* Base Object Schema Definition
|
|
34
52
|
*/
|
|
35
|
-
|
|
53
|
+
const ObjectSchemaBase = zod_1.z.object({
|
|
36
54
|
/** Identify */
|
|
37
55
|
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)'),
|
|
38
56
|
label: zod_1.z.string().optional().describe('Singular Label (e.g. "Account")'),
|
|
39
57
|
pluralLabel: zod_1.z.string().optional().describe('Plural Label (e.g. "Accounts")'),
|
|
40
58
|
description: zod_1.z.string().optional().describe('Internal description'),
|
|
41
59
|
icon: zod_1.z.string().optional().describe('Lucide icon name'),
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Storage / Virtualization Config
|
|
62
|
+
* Defines where the data actually lives.
|
|
63
|
+
*/
|
|
64
|
+
datasource: zod_1.z.string().default('default').describe('Target Datasource ID (e.g. "postgres", "salesforce"). references sys_datasource.'),
|
|
65
|
+
tableName: zod_1.z.string().optional().describe('Physical table/collection name in the target datasource'),
|
|
45
66
|
isSystem: zod_1.z.boolean().default(false).describe('Is system object (protected)'),
|
|
46
67
|
/** Fields Definition */
|
|
47
68
|
fields: zod_1.z.record(field_zod_1.FieldSchema).describe('Map of field definitions'),
|
|
@@ -52,3 +73,9 @@ exports.ObjectSchema = zod_1.z.object({
|
|
|
52
73
|
/** Features & Capabilities */
|
|
53
74
|
enable: exports.ObjectCapabilities.optional().describe('Enabled system capabilities'),
|
|
54
75
|
});
|
|
76
|
+
/**
|
|
77
|
+
* Enhanced ObjectSchema with Factory
|
|
78
|
+
*/
|
|
79
|
+
exports.ObjectSchema = Object.assign(ObjectSchemaBase, {
|
|
80
|
+
create: (config) => config,
|
|
81
|
+
});
|
package/dist/data/query.zod.d.ts
CHANGED
|
@@ -32,6 +32,185 @@ export declare const SortNodeSchema: z.ZodObject<{
|
|
|
32
32
|
field: string;
|
|
33
33
|
order?: "asc" | "desc" | undefined;
|
|
34
34
|
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Aggregation Function Enum
|
|
37
|
+
* Standard aggregation functions.
|
|
38
|
+
*/
|
|
39
|
+
export declare const AggregationFunction: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
40
|
+
/**
|
|
41
|
+
* Aggregation Node
|
|
42
|
+
* Represents aggregated field with function.
|
|
43
|
+
*/
|
|
44
|
+
export declare const AggregationNodeSchema: z.ZodObject<{
|
|
45
|
+
function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
46
|
+
field: z.ZodOptional<z.ZodString>;
|
|
47
|
+
alias: z.ZodString;
|
|
48
|
+
distinct: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
51
|
+
alias: string;
|
|
52
|
+
field?: string | undefined;
|
|
53
|
+
distinct?: boolean | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
56
|
+
alias: string;
|
|
57
|
+
field?: string | undefined;
|
|
58
|
+
distinct?: boolean | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Join Type Enum
|
|
62
|
+
*/
|
|
63
|
+
export declare const JoinType: z.ZodEnum<["inner", "left", "right", "full"]>;
|
|
64
|
+
/**
|
|
65
|
+
* Join Node
|
|
66
|
+
* Represents table joins.
|
|
67
|
+
*/
|
|
68
|
+
export declare const JoinNodeSchema: z.ZodType<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Window Function Enum
|
|
71
|
+
*/
|
|
72
|
+
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
|
+
/**
|
|
74
|
+
* Window Specification
|
|
75
|
+
* Defines PARTITION BY and ORDER BY for window functions.
|
|
76
|
+
*/
|
|
77
|
+
export declare const WindowSpecSchema: z.ZodObject<{
|
|
78
|
+
partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
|
+
orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
80
|
+
field: z.ZodString;
|
|
81
|
+
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
field: string;
|
|
84
|
+
order: "asc" | "desc";
|
|
85
|
+
}, {
|
|
86
|
+
field: string;
|
|
87
|
+
order?: "asc" | "desc" | undefined;
|
|
88
|
+
}>, "many">>;
|
|
89
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
|
|
91
|
+
start: z.ZodOptional<z.ZodString>;
|
|
92
|
+
end: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
type?: "rows" | "range" | undefined;
|
|
95
|
+
start?: string | undefined;
|
|
96
|
+
end?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
type?: "rows" | "range" | undefined;
|
|
99
|
+
start?: string | undefined;
|
|
100
|
+
end?: string | undefined;
|
|
101
|
+
}>>;
|
|
102
|
+
}, "strip", z.ZodTypeAny, {
|
|
103
|
+
partitionBy?: string[] | undefined;
|
|
104
|
+
orderBy?: {
|
|
105
|
+
field: string;
|
|
106
|
+
order: "asc" | "desc";
|
|
107
|
+
}[] | undefined;
|
|
108
|
+
frame?: {
|
|
109
|
+
type?: "rows" | "range" | undefined;
|
|
110
|
+
start?: string | undefined;
|
|
111
|
+
end?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
}, {
|
|
114
|
+
partitionBy?: string[] | undefined;
|
|
115
|
+
orderBy?: {
|
|
116
|
+
field: string;
|
|
117
|
+
order?: "asc" | "desc" | undefined;
|
|
118
|
+
}[] | undefined;
|
|
119
|
+
frame?: {
|
|
120
|
+
type?: "rows" | "range" | undefined;
|
|
121
|
+
start?: string | undefined;
|
|
122
|
+
end?: string | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* Window Function Node
|
|
127
|
+
* Represents window function with OVER clause.
|
|
128
|
+
*/
|
|
129
|
+
export declare const WindowFunctionNodeSchema: z.ZodObject<{
|
|
130
|
+
function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
|
|
131
|
+
field: z.ZodOptional<z.ZodString>;
|
|
132
|
+
alias: z.ZodString;
|
|
133
|
+
over: z.ZodObject<{
|
|
134
|
+
partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
135
|
+
orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
|
+
field: z.ZodString;
|
|
137
|
+
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
field: string;
|
|
140
|
+
order: "asc" | "desc";
|
|
141
|
+
}, {
|
|
142
|
+
field: string;
|
|
143
|
+
order?: "asc" | "desc" | undefined;
|
|
144
|
+
}>, "many">>;
|
|
145
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
146
|
+
type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
|
|
147
|
+
start: z.ZodOptional<z.ZodString>;
|
|
148
|
+
end: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
type?: "rows" | "range" | undefined;
|
|
151
|
+
start?: string | undefined;
|
|
152
|
+
end?: string | undefined;
|
|
153
|
+
}, {
|
|
154
|
+
type?: "rows" | "range" | undefined;
|
|
155
|
+
start?: string | undefined;
|
|
156
|
+
end?: string | undefined;
|
|
157
|
+
}>>;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
partitionBy?: string[] | undefined;
|
|
160
|
+
orderBy?: {
|
|
161
|
+
field: string;
|
|
162
|
+
order: "asc" | "desc";
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
frame?: {
|
|
165
|
+
type?: "rows" | "range" | undefined;
|
|
166
|
+
start?: string | undefined;
|
|
167
|
+
end?: string | undefined;
|
|
168
|
+
} | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
partitionBy?: string[] | undefined;
|
|
171
|
+
orderBy?: {
|
|
172
|
+
field: string;
|
|
173
|
+
order?: "asc" | "desc" | undefined;
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
frame?: {
|
|
176
|
+
type?: "rows" | "range" | undefined;
|
|
177
|
+
start?: string | undefined;
|
|
178
|
+
end?: string | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
183
|
+
alias: string;
|
|
184
|
+
over: {
|
|
185
|
+
partitionBy?: string[] | undefined;
|
|
186
|
+
orderBy?: {
|
|
187
|
+
field: string;
|
|
188
|
+
order: "asc" | "desc";
|
|
189
|
+
}[] | undefined;
|
|
190
|
+
frame?: {
|
|
191
|
+
type?: "rows" | "range" | undefined;
|
|
192
|
+
start?: string | undefined;
|
|
193
|
+
end?: string | undefined;
|
|
194
|
+
} | undefined;
|
|
195
|
+
};
|
|
196
|
+
field?: string | undefined;
|
|
197
|
+
}, {
|
|
198
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
199
|
+
alias: string;
|
|
200
|
+
over: {
|
|
201
|
+
partitionBy?: string[] | undefined;
|
|
202
|
+
orderBy?: {
|
|
203
|
+
field: string;
|
|
204
|
+
order?: "asc" | "desc" | undefined;
|
|
205
|
+
}[] | undefined;
|
|
206
|
+
frame?: {
|
|
207
|
+
type?: "rows" | "range" | undefined;
|
|
208
|
+
start?: string | undefined;
|
|
209
|
+
end?: string | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
};
|
|
212
|
+
field?: string | undefined;
|
|
213
|
+
}>;
|
|
35
214
|
/**
|
|
36
215
|
* Field Selection Node
|
|
37
216
|
* Represents "Select" attributes, including joins.
|
|
@@ -46,8 +225,117 @@ export declare const QuerySchema: z.ZodObject<{
|
|
|
46
225
|
object: z.ZodString;
|
|
47
226
|
/** Select Clause */
|
|
48
227
|
fields: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
|
|
228
|
+
/** Aggregations */
|
|
229
|
+
aggregations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
230
|
+
function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
231
|
+
field: z.ZodOptional<z.ZodString>;
|
|
232
|
+
alias: z.ZodString;
|
|
233
|
+
distinct: z.ZodOptional<z.ZodBoolean>;
|
|
234
|
+
}, "strip", z.ZodTypeAny, {
|
|
235
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
236
|
+
alias: string;
|
|
237
|
+
field?: string | undefined;
|
|
238
|
+
distinct?: boolean | undefined;
|
|
239
|
+
}, {
|
|
240
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
241
|
+
alias: string;
|
|
242
|
+
field?: string | undefined;
|
|
243
|
+
distinct?: boolean | undefined;
|
|
244
|
+
}>, "many">>;
|
|
245
|
+
/** Window Functions */
|
|
246
|
+
windowFunctions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
247
|
+
function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
|
|
248
|
+
field: z.ZodOptional<z.ZodString>;
|
|
249
|
+
alias: z.ZodString;
|
|
250
|
+
over: z.ZodObject<{
|
|
251
|
+
partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
252
|
+
orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
253
|
+
field: z.ZodString;
|
|
254
|
+
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
field: string;
|
|
257
|
+
order: "asc" | "desc";
|
|
258
|
+
}, {
|
|
259
|
+
field: string;
|
|
260
|
+
order?: "asc" | "desc" | undefined;
|
|
261
|
+
}>, "many">>;
|
|
262
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
|
|
264
|
+
start: z.ZodOptional<z.ZodString>;
|
|
265
|
+
end: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, "strip", z.ZodTypeAny, {
|
|
267
|
+
type?: "rows" | "range" | undefined;
|
|
268
|
+
start?: string | undefined;
|
|
269
|
+
end?: string | undefined;
|
|
270
|
+
}, {
|
|
271
|
+
type?: "rows" | "range" | undefined;
|
|
272
|
+
start?: string | undefined;
|
|
273
|
+
end?: string | undefined;
|
|
274
|
+
}>>;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
partitionBy?: string[] | undefined;
|
|
277
|
+
orderBy?: {
|
|
278
|
+
field: string;
|
|
279
|
+
order: "asc" | "desc";
|
|
280
|
+
}[] | undefined;
|
|
281
|
+
frame?: {
|
|
282
|
+
type?: "rows" | "range" | undefined;
|
|
283
|
+
start?: string | undefined;
|
|
284
|
+
end?: string | undefined;
|
|
285
|
+
} | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
partitionBy?: string[] | undefined;
|
|
288
|
+
orderBy?: {
|
|
289
|
+
field: string;
|
|
290
|
+
order?: "asc" | "desc" | undefined;
|
|
291
|
+
}[] | undefined;
|
|
292
|
+
frame?: {
|
|
293
|
+
type?: "rows" | "range" | undefined;
|
|
294
|
+
start?: string | undefined;
|
|
295
|
+
end?: string | undefined;
|
|
296
|
+
} | undefined;
|
|
297
|
+
}>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
300
|
+
alias: string;
|
|
301
|
+
over: {
|
|
302
|
+
partitionBy?: string[] | undefined;
|
|
303
|
+
orderBy?: {
|
|
304
|
+
field: string;
|
|
305
|
+
order: "asc" | "desc";
|
|
306
|
+
}[] | undefined;
|
|
307
|
+
frame?: {
|
|
308
|
+
type?: "rows" | "range" | undefined;
|
|
309
|
+
start?: string | undefined;
|
|
310
|
+
end?: string | undefined;
|
|
311
|
+
} | undefined;
|
|
312
|
+
};
|
|
313
|
+
field?: string | undefined;
|
|
314
|
+
}, {
|
|
315
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
316
|
+
alias: string;
|
|
317
|
+
over: {
|
|
318
|
+
partitionBy?: string[] | undefined;
|
|
319
|
+
orderBy?: {
|
|
320
|
+
field: string;
|
|
321
|
+
order?: "asc" | "desc" | undefined;
|
|
322
|
+
}[] | undefined;
|
|
323
|
+
frame?: {
|
|
324
|
+
type?: "rows" | "range" | undefined;
|
|
325
|
+
start?: string | undefined;
|
|
326
|
+
end?: string | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
};
|
|
329
|
+
field?: string | undefined;
|
|
330
|
+
}>, "many">>;
|
|
49
331
|
/** Where Clause */
|
|
50
332
|
filters: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
333
|
+
/** Joins */
|
|
334
|
+
joins: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
|
|
335
|
+
/** Group By Clause */
|
|
336
|
+
groupBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
337
|
+
/** Having Clause */
|
|
338
|
+
having: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
51
339
|
/** Order By Clause */
|
|
52
340
|
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
53
341
|
field: z.ZodString;
|
|
@@ -62,6 +350,8 @@ export declare const QuerySchema: z.ZodObject<{
|
|
|
62
350
|
/** Pagination */
|
|
63
351
|
top: z.ZodOptional<z.ZodNumber>;
|
|
64
352
|
skip: z.ZodOptional<z.ZodNumber>;
|
|
353
|
+
/** Subquery flag */
|
|
354
|
+
distinct: z.ZodOptional<z.ZodBoolean>;
|
|
65
355
|
}, "strip", z.ZodTypeAny, {
|
|
66
356
|
object: string;
|
|
67
357
|
sort?: {
|
|
@@ -69,7 +359,34 @@ export declare const QuerySchema: z.ZodObject<{
|
|
|
69
359
|
order: "asc" | "desc";
|
|
70
360
|
}[] | undefined;
|
|
71
361
|
fields?: any[] | undefined;
|
|
362
|
+
distinct?: boolean | undefined;
|
|
363
|
+
aggregations?: {
|
|
364
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
365
|
+
alias: string;
|
|
366
|
+
field?: string | undefined;
|
|
367
|
+
distinct?: boolean | undefined;
|
|
368
|
+
}[] | undefined;
|
|
369
|
+
windowFunctions?: {
|
|
370
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
371
|
+
alias: string;
|
|
372
|
+
over: {
|
|
373
|
+
partitionBy?: string[] | undefined;
|
|
374
|
+
orderBy?: {
|
|
375
|
+
field: string;
|
|
376
|
+
order: "asc" | "desc";
|
|
377
|
+
}[] | undefined;
|
|
378
|
+
frame?: {
|
|
379
|
+
type?: "rows" | "range" | undefined;
|
|
380
|
+
start?: string | undefined;
|
|
381
|
+
end?: string | undefined;
|
|
382
|
+
} | undefined;
|
|
383
|
+
};
|
|
384
|
+
field?: string | undefined;
|
|
385
|
+
}[] | undefined;
|
|
72
386
|
filters?: any;
|
|
387
|
+
joins?: any[] | undefined;
|
|
388
|
+
groupBy?: string[] | undefined;
|
|
389
|
+
having?: any;
|
|
73
390
|
top?: number | undefined;
|
|
74
391
|
skip?: number | undefined;
|
|
75
392
|
}, {
|
|
@@ -79,11 +396,43 @@ export declare const QuerySchema: z.ZodObject<{
|
|
|
79
396
|
order?: "asc" | "desc" | undefined;
|
|
80
397
|
}[] | undefined;
|
|
81
398
|
fields?: any[] | undefined;
|
|
399
|
+
distinct?: boolean | undefined;
|
|
400
|
+
aggregations?: {
|
|
401
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
402
|
+
alias: string;
|
|
403
|
+
field?: string | undefined;
|
|
404
|
+
distinct?: boolean | undefined;
|
|
405
|
+
}[] | undefined;
|
|
406
|
+
windowFunctions?: {
|
|
407
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
408
|
+
alias: string;
|
|
409
|
+
over: {
|
|
410
|
+
partitionBy?: string[] | undefined;
|
|
411
|
+
orderBy?: {
|
|
412
|
+
field: string;
|
|
413
|
+
order?: "asc" | "desc" | undefined;
|
|
414
|
+
}[] | undefined;
|
|
415
|
+
frame?: {
|
|
416
|
+
type?: "rows" | "range" | undefined;
|
|
417
|
+
start?: string | undefined;
|
|
418
|
+
end?: string | undefined;
|
|
419
|
+
} | undefined;
|
|
420
|
+
};
|
|
421
|
+
field?: string | undefined;
|
|
422
|
+
}[] | undefined;
|
|
82
423
|
filters?: any;
|
|
424
|
+
joins?: any[] | undefined;
|
|
425
|
+
groupBy?: string[] | undefined;
|
|
426
|
+
having?: any;
|
|
83
427
|
top?: number | undefined;
|
|
84
428
|
skip?: number | undefined;
|
|
85
429
|
}>;
|
|
86
430
|
export type QueryAST = z.infer<typeof QuerySchema>;
|
|
431
|
+
export type QueryInput = z.input<typeof QuerySchema>;
|
|
87
432
|
export type FilterNode = z.infer<typeof FilterNodeSchema>;
|
|
88
433
|
export type SortNode = z.infer<typeof SortNodeSchema>;
|
|
434
|
+
export type AggregationNode = z.infer<typeof AggregationNodeSchema>;
|
|
435
|
+
export type JoinNode = z.infer<typeof JoinNodeSchema>;
|
|
436
|
+
export type WindowFunctionNode = z.infer<typeof WindowFunctionNodeSchema>;
|
|
437
|
+
export type WindowSpec = z.infer<typeof WindowSpecSchema>;
|
|
89
438
|
//# sourceMappingURL=query.zod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.zod.d.ts","sourceRoot":"","sources":["../../src/data/query.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,cAAc,iJAMzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,iCAA+B,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAQ3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAS1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW;IACtB,oBAAoB;;IAGpB,oBAAoB;;IAGpB,mBAAmB;;IAGnB,sBAAsB;;;;;;;;;;;IAGtB,iBAAiB
|
|
1
|
+
{"version":3,"file":"query.zod.d.ts","sourceRoot":"","sources":["../../src/data/query.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,cAAc,iJAMzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,iCAA+B,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAQ3C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,+FAG9B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ,+CAA6C,CAAC;AAEnE;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAQzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,kJAIzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAS1C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW;IACtB,oBAAoB;;IAGpB,oBAAoB;;IAGpB,mBAAmB;;;;;;;;;;;;;;;;;IAGnB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGvB,mBAAmB;;IAGnB,YAAY;;IAGZ,sBAAsB;;IAGtB,oBAAoB;;IAGpB,sBAAsB;;;;;;;;;;;IAGtB,iBAAiB;;;IAIjB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/data/query.zod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuerySchema = exports.FieldNodeSchema = exports.SortNodeSchema = exports.FilterNodeSchema = exports.LogicOperator = exports.FilterOperator = void 0;
|
|
3
|
+
exports.QuerySchema = exports.FieldNodeSchema = exports.WindowFunctionNodeSchema = exports.WindowSpecSchema = exports.WindowFunction = exports.JoinNodeSchema = exports.JoinType = exports.AggregationNodeSchema = exports.AggregationFunction = exports.SortNodeSchema = exports.FilterNodeSchema = exports.LogicOperator = exports.FilterOperator = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
6
|
* Filter Operator Enum
|
|
@@ -40,6 +40,70 @@ exports.SortNodeSchema = zod_1.z.object({
|
|
|
40
40
|
field: zod_1.z.string(),
|
|
41
41
|
order: zod_1.z.enum(['asc', 'desc']).default('asc')
|
|
42
42
|
});
|
|
43
|
+
/**
|
|
44
|
+
* Aggregation Function Enum
|
|
45
|
+
* Standard aggregation functions.
|
|
46
|
+
*/
|
|
47
|
+
exports.AggregationFunction = zod_1.z.enum([
|
|
48
|
+
'count', 'sum', 'avg', 'min', 'max',
|
|
49
|
+
'count_distinct', 'array_agg', 'string_agg'
|
|
50
|
+
]);
|
|
51
|
+
/**
|
|
52
|
+
* Aggregation Node
|
|
53
|
+
* Represents aggregated field with function.
|
|
54
|
+
*/
|
|
55
|
+
exports.AggregationNodeSchema = zod_1.z.object({
|
|
56
|
+
function: exports.AggregationFunction.describe('Aggregation function'),
|
|
57
|
+
field: zod_1.z.string().optional().describe('Field to aggregate (optional for COUNT(*))'),
|
|
58
|
+
alias: zod_1.z.string().describe('Result column alias'),
|
|
59
|
+
distinct: zod_1.z.boolean().optional().describe('Apply DISTINCT before aggregation'),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Join Type Enum
|
|
63
|
+
*/
|
|
64
|
+
exports.JoinType = zod_1.z.enum(['inner', 'left', 'right', 'full']);
|
|
65
|
+
/**
|
|
66
|
+
* Join Node
|
|
67
|
+
* Represents table joins.
|
|
68
|
+
*/
|
|
69
|
+
exports.JoinNodeSchema = zod_1.z.lazy(() => zod_1.z.object({
|
|
70
|
+
type: exports.JoinType.describe('Join type'),
|
|
71
|
+
object: zod_1.z.string().describe('Object/table to join'),
|
|
72
|
+
alias: zod_1.z.string().optional().describe('Table alias'),
|
|
73
|
+
on: exports.FilterNodeSchema.describe('Join condition'),
|
|
74
|
+
subquery: zod_1.z.lazy(() => exports.QuerySchema).optional().describe('Subquery instead of object'),
|
|
75
|
+
}));
|
|
76
|
+
/**
|
|
77
|
+
* Window Function Enum
|
|
78
|
+
*/
|
|
79
|
+
exports.WindowFunction = zod_1.z.enum([
|
|
80
|
+
'row_number', 'rank', 'dense_rank', 'percent_rank',
|
|
81
|
+
'lag', 'lead', 'first_value', 'last_value',
|
|
82
|
+
'sum', 'avg', 'count', 'min', 'max'
|
|
83
|
+
]);
|
|
84
|
+
/**
|
|
85
|
+
* Window Specification
|
|
86
|
+
* Defines PARTITION BY and ORDER BY for window functions.
|
|
87
|
+
*/
|
|
88
|
+
exports.WindowSpecSchema = zod_1.z.object({
|
|
89
|
+
partitionBy: zod_1.z.array(zod_1.z.string()).optional().describe('PARTITION BY fields'),
|
|
90
|
+
orderBy: zod_1.z.array(exports.SortNodeSchema).optional().describe('ORDER BY specification'),
|
|
91
|
+
frame: zod_1.z.object({
|
|
92
|
+
type: zod_1.z.enum(['rows', 'range']).optional(),
|
|
93
|
+
start: zod_1.z.string().optional().describe('Frame start (e.g., "UNBOUNDED PRECEDING", "1 PRECEDING")'),
|
|
94
|
+
end: zod_1.z.string().optional().describe('Frame end (e.g., "CURRENT ROW", "1 FOLLOWING")'),
|
|
95
|
+
}).optional().describe('Window frame specification'),
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Window Function Node
|
|
99
|
+
* Represents window function with OVER clause.
|
|
100
|
+
*/
|
|
101
|
+
exports.WindowFunctionNodeSchema = zod_1.z.object({
|
|
102
|
+
function: exports.WindowFunction.describe('Window function name'),
|
|
103
|
+
field: zod_1.z.string().optional().describe('Field to operate on (for aggregate window functions)'),
|
|
104
|
+
alias: zod_1.z.string().describe('Result column alias'),
|
|
105
|
+
over: exports.WindowSpecSchema.describe('Window specification (OVER clause)'),
|
|
106
|
+
});
|
|
43
107
|
/**
|
|
44
108
|
* Field Selection Node
|
|
45
109
|
* Represents "Select" attributes, including joins.
|
|
@@ -61,11 +125,23 @@ exports.QuerySchema = zod_1.z.object({
|
|
|
61
125
|
object: zod_1.z.string().describe('Object name (e.g. account)'),
|
|
62
126
|
/** Select Clause */
|
|
63
127
|
fields: zod_1.z.array(exports.FieldNodeSchema).optional().describe('Fields to retrieve'),
|
|
128
|
+
/** Aggregations */
|
|
129
|
+
aggregations: zod_1.z.array(exports.AggregationNodeSchema).optional().describe('Aggregation functions (GROUP BY)'),
|
|
130
|
+
/** Window Functions */
|
|
131
|
+
windowFunctions: zod_1.z.array(exports.WindowFunctionNodeSchema).optional().describe('Window functions with OVER clause'),
|
|
64
132
|
/** Where Clause */
|
|
65
133
|
filters: exports.FilterNodeSchema.optional().describe('Filtering criteria'),
|
|
134
|
+
/** Joins */
|
|
135
|
+
joins: zod_1.z.array(exports.JoinNodeSchema).optional().describe('Table joins'),
|
|
136
|
+
/** Group By Clause */
|
|
137
|
+
groupBy: zod_1.z.array(zod_1.z.string()).optional().describe('GROUP BY fields'),
|
|
138
|
+
/** Having Clause */
|
|
139
|
+
having: exports.FilterNodeSchema.optional().describe('HAVING clause for aggregation filtering'),
|
|
66
140
|
/** Order By Clause */
|
|
67
141
|
sort: zod_1.z.array(exports.SortNodeSchema).optional().describe('Sorting instructions'),
|
|
68
142
|
/** Pagination */
|
|
69
143
|
top: zod_1.z.number().optional().describe('Limit results'),
|
|
70
144
|
skip: zod_1.z.number().optional().describe('Offset results'),
|
|
145
|
+
/** Subquery flag */
|
|
146
|
+
distinct: zod_1.z.boolean().optional().describe('SELECT DISTINCT flag'),
|
|
71
147
|
});
|