@objectstack/spec 0.1.1 → 0.2.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 +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/filter.zod.d.ts +295 -0
- package/dist/data/filter.zod.d.ts.map +1 -0
- package/dist/data/filter.zod.js +226 -0
- 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 +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -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/auth.zod.d.ts +2287 -0
- package/dist/system/auth.zod.d.ts.map +1 -0
- package/dist/system/auth.zod.js +365 -0
- package/dist/system/datasource.zod.d.ts +193 -30
- package/dist/system/datasource.zod.d.ts.map +1 -1
- package/dist/system/datasource.zod.js +58 -11
- 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 +1631 -0
- package/dist/system/driver.zod.d.ts.map +1 -0
- package/dist/system/driver.zod.js +337 -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/policy.zod.d.ts +10 -10
- 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 +19 -13
- package/dist/ui/dashboard.zod.d.ts.map +1 -1
- package/dist/ui/dashboard.zod.js +10 -3
- package/dist/ui/page.zod.d.ts +6 -6
- package/dist/ui/report.zod.d.ts +13 -32
- package/dist/ui/report.zod.d.ts.map +1 -1
- package/dist/ui/report.zod.js +10 -9
- 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/AccountLinkingConfig.json +27 -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/AuthConfig.json +606 -0
- package/json-schema/AuthPluginConfig.json +28 -0
- package/json-schema/AuthStrategy.json +17 -0
- package/json-schema/AuthenticationConfig.json +601 -0
- package/json-schema/AuthenticationProvider.json +617 -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/CSRFConfig.json +31 -0
- package/json-schema/ColorPalette.json +83 -0
- package/json-schema/ComparisonOperator.json +56 -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/Dashboard.json +20 -0
- package/json-schema/DashboardWidget.json +20 -0
- package/json-schema/DatabaseAdapter.json +38 -0
- package/json-schema/Datasource.json +25 -23
- package/json-schema/DatasourceCapabilities.json +25 -5
- package/json-schema/DeleteResponse.json +68 -0
- package/json-schema/Discovery.json +114 -0
- package/json-schema/DriverCapabilities.json +69 -0
- package/json-schema/DriverDefinition.json +86 -0
- package/json-schema/DriverInterface.json +88 -0
- package/json-schema/DriverOptions.json +23 -0
- package/json-schema/DriverType.json +1 -18
- package/json-schema/EmailPasswordConfig.json +43 -0
- package/json-schema/EqualityOperator.json +14 -0
- package/json-schema/ExportRequest.json +786 -0
- package/json-schema/Field.json +75 -4
- package/json-schema/FieldOperators.json +108 -0
- package/json-schema/FieldType.json +8 -2
- package/json-schema/FieldWidgetProps.json +327 -0
- package/json-schema/FilterCondition.json +28 -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/MagicLinkConfig.json +21 -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/NormalizedFilter.json +348 -0
- package/json-schema/OAuthProvider.json +66 -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/PasskeyConfig.json +54 -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/QueryFilter.json +34 -0
- package/json-schema/RangeOperator.json +41 -0
- package/json-schema/RateLimitConfig.json +36 -0
- package/json-schema/RecordData.json +11 -0
- package/json-schema/Report.json +20 -26
- package/json-schema/Router.json +12 -0
- package/json-schema/Scheduler.json +12 -0
- package/json-schema/ScopedStorage.json +12 -0
- package/json-schema/SessionConfig.json +56 -0
- package/json-schema/SetOperator.json +18 -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/SpecialOperator.json +18 -0
- package/json-schema/StandardAuthProvider.json +622 -0
- package/json-schema/StringOperator.json +21 -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/TwoFactorConfig.json +40 -0
- package/json-schema/Typography.json +142 -0
- package/json-schema/UpdateRequest.json +20 -0
- package/json-schema/UserFieldMapping.json +47 -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
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALL_OPERATORS = exports.LOGICAL_OPERATORS = exports.FILTER_OPERATORS = exports.NormalizedFilterSchema = exports.QueryFilterSchema = exports.FilterConditionSchema = exports.FieldOperatorsSchema = exports.SpecialOperatorSchema = exports.StringOperatorSchema = exports.RangeOperatorSchema = exports.SetOperatorSchema = exports.ComparisonOperatorSchema = exports.EqualityOperatorSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Unified Query DSL Specification
|
|
7
|
+
*
|
|
8
|
+
* Based on industry best practices from:
|
|
9
|
+
* - Prisma ORM
|
|
10
|
+
* - Strapi CMS
|
|
11
|
+
* - TypeORM
|
|
12
|
+
* - LoopBack Framework
|
|
13
|
+
*
|
|
14
|
+
* Version: 1.0.0
|
|
15
|
+
* Status: Draft
|
|
16
|
+
*
|
|
17
|
+
* Objective: Define a JSON-based, database-agnostic query syntax standard
|
|
18
|
+
* for data filtering interactions between frontend and backend APIs.
|
|
19
|
+
*
|
|
20
|
+
* Design Principles:
|
|
21
|
+
* 1. Declarative: Frontend describes "what data to get", not "how to query"
|
|
22
|
+
* 2. Database Agnostic: Syntax contains no database-specific directives
|
|
23
|
+
* 3. Type Safe: Structure can be statically inferred by TypeScript
|
|
24
|
+
* 4. Convention over Configuration: Implicit syntax for common queries
|
|
25
|
+
*/
|
|
26
|
+
// ============================================================================
|
|
27
|
+
// 3.1 Comparison Operators
|
|
28
|
+
// ============================================================================
|
|
29
|
+
/**
|
|
30
|
+
* Comparison operators for equality and inequality checks.
|
|
31
|
+
* Supported data types: Any
|
|
32
|
+
*/
|
|
33
|
+
exports.EqualityOperatorSchema = zod_1.z.object({
|
|
34
|
+
/** Equal to (default) - SQL: = | MongoDB: $eq */
|
|
35
|
+
$eq: zod_1.z.any().optional(),
|
|
36
|
+
/** Not equal to - SQL: <> or != | MongoDB: $ne */
|
|
37
|
+
$ne: zod_1.z.any().optional(),
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Comparison operators for numeric and date comparisons.
|
|
41
|
+
* Supported data types: Number, Date
|
|
42
|
+
*/
|
|
43
|
+
exports.ComparisonOperatorSchema = zod_1.z.object({
|
|
44
|
+
/** Greater than - SQL: > | MongoDB: $gt */
|
|
45
|
+
$gt: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
46
|
+
/** Greater than or equal to - SQL: >= | MongoDB: $gte */
|
|
47
|
+
$gte: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
48
|
+
/** Less than - SQL: < | MongoDB: $lt */
|
|
49
|
+
$lt: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
50
|
+
/** Less than or equal to - SQL: <= | MongoDB: $lte */
|
|
51
|
+
$lte: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
52
|
+
});
|
|
53
|
+
// ============================================================================
|
|
54
|
+
// 3.2 Set & Range Operators
|
|
55
|
+
// ============================================================================
|
|
56
|
+
/**
|
|
57
|
+
* Set operators for membership checks.
|
|
58
|
+
*/
|
|
59
|
+
exports.SetOperatorSchema = zod_1.z.object({
|
|
60
|
+
/** In list - SQL: IN (?, ?, ?) | MongoDB: $in */
|
|
61
|
+
$in: zod_1.z.array(zod_1.z.any()).optional(),
|
|
62
|
+
/** Not in list - SQL: NOT IN (...) | MongoDB: $nin */
|
|
63
|
+
$nin: zod_1.z.array(zod_1.z.any()).optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Range operator for interval checks (closed interval).
|
|
67
|
+
* SQL: BETWEEN ? AND ? | MongoDB: $gte AND $lte
|
|
68
|
+
*/
|
|
69
|
+
exports.RangeOperatorSchema = zod_1.z.object({
|
|
70
|
+
/** Between (inclusive) - takes [min, max] array */
|
|
71
|
+
$between: zod_1.z.tuple([
|
|
72
|
+
zod_1.z.union([zod_1.z.number(), zod_1.z.date()]),
|
|
73
|
+
zod_1.z.union([zod_1.z.number(), zod_1.z.date()])
|
|
74
|
+
]).optional(),
|
|
75
|
+
});
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// 3.3 String-Specific Operators
|
|
78
|
+
// ============================================================================
|
|
79
|
+
/**
|
|
80
|
+
* String pattern matching operators.
|
|
81
|
+
* Note: Case sensitivity should be handled at backend level.
|
|
82
|
+
*/
|
|
83
|
+
exports.StringOperatorSchema = zod_1.z.object({
|
|
84
|
+
/** Contains substring - SQL: LIKE %?% | MongoDB: $regex */
|
|
85
|
+
$contains: zod_1.z.string().optional(),
|
|
86
|
+
/** Starts with prefix - SQL: LIKE ?% | MongoDB: $regex */
|
|
87
|
+
$startsWith: zod_1.z.string().optional(),
|
|
88
|
+
/** Ends with suffix - SQL: LIKE %? | MongoDB: $regex */
|
|
89
|
+
$endsWith: zod_1.z.string().optional(),
|
|
90
|
+
});
|
|
91
|
+
// ============================================================================
|
|
92
|
+
// 3.5 Special Operators
|
|
93
|
+
// ============================================================================
|
|
94
|
+
/**
|
|
95
|
+
* Special check operators for null and existence.
|
|
96
|
+
*/
|
|
97
|
+
exports.SpecialOperatorSchema = zod_1.z.object({
|
|
98
|
+
/** Is null check - SQL: IS NULL (true) / IS NOT NULL (false) | MongoDB: field: null */
|
|
99
|
+
$null: zod_1.z.boolean().optional(),
|
|
100
|
+
/** Field exists check (primarily for NoSQL) - MongoDB: $exists */
|
|
101
|
+
$exist: zod_1.z.boolean().optional(),
|
|
102
|
+
});
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// Combined Field Operators
|
|
105
|
+
// ============================================================================
|
|
106
|
+
/**
|
|
107
|
+
* All field-level operators combined.
|
|
108
|
+
* These can be applied to individual fields in a filter.
|
|
109
|
+
*/
|
|
110
|
+
exports.FieldOperatorsSchema = zod_1.z.object({
|
|
111
|
+
// Equality
|
|
112
|
+
$eq: zod_1.z.any().optional(),
|
|
113
|
+
$ne: zod_1.z.any().optional(),
|
|
114
|
+
// Comparison (numeric/date)
|
|
115
|
+
$gt: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
116
|
+
$gte: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
117
|
+
$lt: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
118
|
+
$lte: zod_1.z.union([zod_1.z.number(), zod_1.z.date()]).optional(),
|
|
119
|
+
// Set & Range
|
|
120
|
+
$in: zod_1.z.array(zod_1.z.any()).optional(),
|
|
121
|
+
$nin: zod_1.z.array(zod_1.z.any()).optional(),
|
|
122
|
+
$between: zod_1.z.tuple([
|
|
123
|
+
zod_1.z.union([zod_1.z.number(), zod_1.z.date()]),
|
|
124
|
+
zod_1.z.union([zod_1.z.number(), zod_1.z.date()])
|
|
125
|
+
]).optional(),
|
|
126
|
+
// String-specific
|
|
127
|
+
$contains: zod_1.z.string().optional(),
|
|
128
|
+
$startsWith: zod_1.z.string().optional(),
|
|
129
|
+
$endsWith: zod_1.z.string().optional(),
|
|
130
|
+
// Special
|
|
131
|
+
$null: zod_1.z.boolean().optional(),
|
|
132
|
+
$exist: zod_1.z.boolean().optional(),
|
|
133
|
+
});
|
|
134
|
+
/**
|
|
135
|
+
* Zod schema for recursive filter validation.
|
|
136
|
+
* Uses z.lazy() to handle recursive structure.
|
|
137
|
+
*/
|
|
138
|
+
exports.FilterConditionSchema = zod_1.z.lazy(() => zod_1.z.record(zod_1.z.string(), zod_1.z.any()).and(zod_1.z.object({
|
|
139
|
+
$and: zod_1.z.array(exports.FilterConditionSchema).optional(),
|
|
140
|
+
$or: zod_1.z.array(exports.FilterConditionSchema).optional(),
|
|
141
|
+
$not: exports.FilterConditionSchema.optional(),
|
|
142
|
+
})));
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// Query Filter Wrapper
|
|
145
|
+
// ============================================================================
|
|
146
|
+
/**
|
|
147
|
+
* Top-level query filter wrapper.
|
|
148
|
+
* This is typically used as the "where" clause in a query.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const filter: QueryFilter = {
|
|
153
|
+
* where: {
|
|
154
|
+
* status: "active", // Implicit equality
|
|
155
|
+
* age: { $gte: 18 }, // Explicit operator
|
|
156
|
+
* $or: [ // Logical combination
|
|
157
|
+
* { role: "admin" },
|
|
158
|
+
* { email: { $contains: "@company.com" } }
|
|
159
|
+
* ],
|
|
160
|
+
* profile: { // Nested relation
|
|
161
|
+
* verified: true
|
|
162
|
+
* }
|
|
163
|
+
* }
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
exports.QueryFilterSchema = zod_1.z.object({
|
|
168
|
+
where: exports.FilterConditionSchema.optional(),
|
|
169
|
+
});
|
|
170
|
+
// ============================================================================
|
|
171
|
+
// Normalization Utilities (Internal Representation)
|
|
172
|
+
// ============================================================================
|
|
173
|
+
/**
|
|
174
|
+
* Normalized filter AST structure.
|
|
175
|
+
* This is the internal representation after converting all syntactic sugar
|
|
176
|
+
* to explicit operators.
|
|
177
|
+
*
|
|
178
|
+
* Stage 1: Normalization Pass
|
|
179
|
+
* Input: { age: 18, role: "admin" }
|
|
180
|
+
* Output: { $and: [{ age: { $eq: 18 } }, { role: { $eq: "admin" } }] }
|
|
181
|
+
*
|
|
182
|
+
* This simplifies adapter implementation by providing a consistent structure.
|
|
183
|
+
*/
|
|
184
|
+
exports.NormalizedFilterSchema = zod_1.z.lazy(() => zod_1.z.object({
|
|
185
|
+
$and: zod_1.z.array(zod_1.z.union([
|
|
186
|
+
// Field condition: { field: { $op: value } }
|
|
187
|
+
zod_1.z.record(zod_1.z.string(), exports.FieldOperatorsSchema),
|
|
188
|
+
// Nested logical group
|
|
189
|
+
exports.NormalizedFilterSchema,
|
|
190
|
+
])).optional(),
|
|
191
|
+
$or: zod_1.z.array(zod_1.z.union([
|
|
192
|
+
zod_1.z.record(zod_1.z.string(), exports.FieldOperatorsSchema),
|
|
193
|
+
exports.NormalizedFilterSchema,
|
|
194
|
+
])).optional(),
|
|
195
|
+
$not: zod_1.z.union([
|
|
196
|
+
zod_1.z.record(zod_1.z.string(), exports.FieldOperatorsSchema),
|
|
197
|
+
exports.NormalizedFilterSchema,
|
|
198
|
+
]).optional(),
|
|
199
|
+
}));
|
|
200
|
+
// ============================================================================
|
|
201
|
+
// Constants & Metadata
|
|
202
|
+
// ============================================================================
|
|
203
|
+
/**
|
|
204
|
+
* All supported operator keys.
|
|
205
|
+
* Useful for validation and parsing.
|
|
206
|
+
*/
|
|
207
|
+
exports.FILTER_OPERATORS = [
|
|
208
|
+
// Equality
|
|
209
|
+
'$eq', '$ne',
|
|
210
|
+
// Comparison
|
|
211
|
+
'$gt', '$gte', '$lt', '$lte',
|
|
212
|
+
// Set & Range
|
|
213
|
+
'$in', '$nin', '$between',
|
|
214
|
+
// String
|
|
215
|
+
'$contains', '$startsWith', '$endsWith',
|
|
216
|
+
// Special
|
|
217
|
+
'$null', '$exist',
|
|
218
|
+
];
|
|
219
|
+
/**
|
|
220
|
+
* Logical operator keys.
|
|
221
|
+
*/
|
|
222
|
+
exports.LOGICAL_OPERATORS = ['$and', '$or', '$not'];
|
|
223
|
+
/**
|
|
224
|
+
* All operator keys (field + logical).
|
|
225
|
+
*/
|
|
226
|
+
exports.ALL_OPERATORS = [...exports.FILTER_OPERATORS, ...exports.LOGICAL_OPERATORS];
|
|
@@ -146,7 +146,111 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
146
146
|
extractQuery: z.ZodOptional<z.ZodObject<{
|
|
147
147
|
object: z.ZodString;
|
|
148
148
|
fields: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
|
|
149
|
+
aggregations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
150
|
+
function: z.ZodEnum<["count", "sum", "avg", "min", "max", "count_distinct", "array_agg", "string_agg"]>;
|
|
151
|
+
field: z.ZodOptional<z.ZodString>;
|
|
152
|
+
alias: z.ZodString;
|
|
153
|
+
distinct: z.ZodOptional<z.ZodBoolean>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
156
|
+
alias: string;
|
|
157
|
+
field?: string | undefined;
|
|
158
|
+
distinct?: boolean | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
161
|
+
alias: string;
|
|
162
|
+
field?: string | undefined;
|
|
163
|
+
distinct?: boolean | undefined;
|
|
164
|
+
}>, "many">>;
|
|
165
|
+
windowFunctions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
166
|
+
function: z.ZodEnum<["row_number", "rank", "dense_rank", "percent_rank", "lag", "lead", "first_value", "last_value", "sum", "avg", "count", "min", "max"]>;
|
|
167
|
+
field: z.ZodOptional<z.ZodString>;
|
|
168
|
+
alias: z.ZodString;
|
|
169
|
+
over: z.ZodObject<{
|
|
170
|
+
partitionBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
171
|
+
orderBy: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
172
|
+
field: z.ZodString;
|
|
173
|
+
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
field: string;
|
|
176
|
+
order: "asc" | "desc";
|
|
177
|
+
}, {
|
|
178
|
+
field: string;
|
|
179
|
+
order?: "asc" | "desc" | undefined;
|
|
180
|
+
}>, "many">>;
|
|
181
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
182
|
+
type: z.ZodOptional<z.ZodEnum<["rows", "range"]>>;
|
|
183
|
+
start: z.ZodOptional<z.ZodString>;
|
|
184
|
+
end: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
type?: "rows" | "range" | undefined;
|
|
187
|
+
start?: string | undefined;
|
|
188
|
+
end?: string | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
type?: "rows" | "range" | undefined;
|
|
191
|
+
start?: string | undefined;
|
|
192
|
+
end?: string | undefined;
|
|
193
|
+
}>>;
|
|
194
|
+
}, "strip", z.ZodTypeAny, {
|
|
195
|
+
partitionBy?: string[] | undefined;
|
|
196
|
+
orderBy?: {
|
|
197
|
+
field: string;
|
|
198
|
+
order: "asc" | "desc";
|
|
199
|
+
}[] | undefined;
|
|
200
|
+
frame?: {
|
|
201
|
+
type?: "rows" | "range" | undefined;
|
|
202
|
+
start?: string | undefined;
|
|
203
|
+
end?: string | undefined;
|
|
204
|
+
} | undefined;
|
|
205
|
+
}, {
|
|
206
|
+
partitionBy?: string[] | undefined;
|
|
207
|
+
orderBy?: {
|
|
208
|
+
field: string;
|
|
209
|
+
order?: "asc" | "desc" | undefined;
|
|
210
|
+
}[] | undefined;
|
|
211
|
+
frame?: {
|
|
212
|
+
type?: "rows" | "range" | undefined;
|
|
213
|
+
start?: string | undefined;
|
|
214
|
+
end?: string | undefined;
|
|
215
|
+
} | undefined;
|
|
216
|
+
}>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
219
|
+
alias: string;
|
|
220
|
+
over: {
|
|
221
|
+
partitionBy?: string[] | undefined;
|
|
222
|
+
orderBy?: {
|
|
223
|
+
field: string;
|
|
224
|
+
order: "asc" | "desc";
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
frame?: {
|
|
227
|
+
type?: "rows" | "range" | undefined;
|
|
228
|
+
start?: string | undefined;
|
|
229
|
+
end?: string | undefined;
|
|
230
|
+
} | undefined;
|
|
231
|
+
};
|
|
232
|
+
field?: string | undefined;
|
|
233
|
+
}, {
|
|
234
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
235
|
+
alias: string;
|
|
236
|
+
over: {
|
|
237
|
+
partitionBy?: string[] | undefined;
|
|
238
|
+
orderBy?: {
|
|
239
|
+
field: string;
|
|
240
|
+
order?: "asc" | "desc" | undefined;
|
|
241
|
+
}[] | undefined;
|
|
242
|
+
frame?: {
|
|
243
|
+
type?: "rows" | "range" | undefined;
|
|
244
|
+
start?: string | undefined;
|
|
245
|
+
end?: string | undefined;
|
|
246
|
+
} | undefined;
|
|
247
|
+
};
|
|
248
|
+
field?: string | undefined;
|
|
249
|
+
}>, "many">>;
|
|
149
250
|
filters: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
251
|
+
joins: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
|
|
252
|
+
groupBy: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
253
|
+
having: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>;
|
|
150
254
|
sort: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
151
255
|
field: z.ZodString;
|
|
152
256
|
order: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
@@ -159,6 +263,7 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
159
263
|
}>, "many">>;
|
|
160
264
|
top: z.ZodOptional<z.ZodNumber>;
|
|
161
265
|
skip: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
distinct: z.ZodOptional<z.ZodBoolean>;
|
|
162
267
|
}, "strip", z.ZodTypeAny, {
|
|
163
268
|
object: string;
|
|
164
269
|
sort?: {
|
|
@@ -166,7 +271,34 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
166
271
|
order: "asc" | "desc";
|
|
167
272
|
}[] | undefined;
|
|
168
273
|
fields?: any[] | undefined;
|
|
274
|
+
distinct?: boolean | undefined;
|
|
275
|
+
aggregations?: {
|
|
276
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
277
|
+
alias: string;
|
|
278
|
+
field?: string | undefined;
|
|
279
|
+
distinct?: boolean | undefined;
|
|
280
|
+
}[] | undefined;
|
|
281
|
+
windowFunctions?: {
|
|
282
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
283
|
+
alias: string;
|
|
284
|
+
over: {
|
|
285
|
+
partitionBy?: string[] | undefined;
|
|
286
|
+
orderBy?: {
|
|
287
|
+
field: string;
|
|
288
|
+
order: "asc" | "desc";
|
|
289
|
+
}[] | undefined;
|
|
290
|
+
frame?: {
|
|
291
|
+
type?: "rows" | "range" | undefined;
|
|
292
|
+
start?: string | undefined;
|
|
293
|
+
end?: string | undefined;
|
|
294
|
+
} | undefined;
|
|
295
|
+
};
|
|
296
|
+
field?: string | undefined;
|
|
297
|
+
}[] | undefined;
|
|
169
298
|
filters?: any;
|
|
299
|
+
joins?: any[] | undefined;
|
|
300
|
+
groupBy?: string[] | undefined;
|
|
301
|
+
having?: any;
|
|
170
302
|
top?: number | undefined;
|
|
171
303
|
skip?: number | undefined;
|
|
172
304
|
}, {
|
|
@@ -176,7 +308,34 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
176
308
|
order?: "asc" | "desc" | undefined;
|
|
177
309
|
}[] | undefined;
|
|
178
310
|
fields?: any[] | undefined;
|
|
311
|
+
distinct?: boolean | undefined;
|
|
312
|
+
aggregations?: {
|
|
313
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
314
|
+
alias: string;
|
|
315
|
+
field?: string | undefined;
|
|
316
|
+
distinct?: boolean | undefined;
|
|
317
|
+
}[] | undefined;
|
|
318
|
+
windowFunctions?: {
|
|
319
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
320
|
+
alias: string;
|
|
321
|
+
over: {
|
|
322
|
+
partitionBy?: string[] | undefined;
|
|
323
|
+
orderBy?: {
|
|
324
|
+
field: string;
|
|
325
|
+
order?: "asc" | "desc" | undefined;
|
|
326
|
+
}[] | undefined;
|
|
327
|
+
frame?: {
|
|
328
|
+
type?: "rows" | "range" | undefined;
|
|
329
|
+
start?: string | undefined;
|
|
330
|
+
end?: string | undefined;
|
|
331
|
+
} | undefined;
|
|
332
|
+
};
|
|
333
|
+
field?: string | undefined;
|
|
334
|
+
}[] | undefined;
|
|
179
335
|
filters?: any;
|
|
336
|
+
joins?: any[] | undefined;
|
|
337
|
+
groupBy?: string[] | undefined;
|
|
338
|
+
having?: any;
|
|
180
339
|
top?: number | undefined;
|
|
181
340
|
skip?: number | undefined;
|
|
182
341
|
}>>;
|
|
@@ -185,7 +344,7 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
185
344
|
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
186
345
|
}, "strip", z.ZodTypeAny, {
|
|
187
346
|
name: string;
|
|
188
|
-
mode: "
|
|
347
|
+
mode: "update" | "upsert" | "insert";
|
|
189
348
|
sourceFormat: "json" | "csv" | "xml" | "sql";
|
|
190
349
|
targetObject: string;
|
|
191
350
|
fieldMapping: {
|
|
@@ -213,7 +372,34 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
213
372
|
order: "asc" | "desc";
|
|
214
373
|
}[] | undefined;
|
|
215
374
|
fields?: any[] | undefined;
|
|
375
|
+
distinct?: boolean | undefined;
|
|
376
|
+
aggregations?: {
|
|
377
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
378
|
+
alias: string;
|
|
379
|
+
field?: string | undefined;
|
|
380
|
+
distinct?: boolean | undefined;
|
|
381
|
+
}[] | undefined;
|
|
382
|
+
windowFunctions?: {
|
|
383
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
384
|
+
alias: string;
|
|
385
|
+
over: {
|
|
386
|
+
partitionBy?: string[] | undefined;
|
|
387
|
+
orderBy?: {
|
|
388
|
+
field: string;
|
|
389
|
+
order: "asc" | "desc";
|
|
390
|
+
}[] | undefined;
|
|
391
|
+
frame?: {
|
|
392
|
+
type?: "rows" | "range" | undefined;
|
|
393
|
+
start?: string | undefined;
|
|
394
|
+
end?: string | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
};
|
|
397
|
+
field?: string | undefined;
|
|
398
|
+
}[] | undefined;
|
|
216
399
|
filters?: any;
|
|
400
|
+
joins?: any[] | undefined;
|
|
401
|
+
groupBy?: string[] | undefined;
|
|
402
|
+
having?: any;
|
|
217
403
|
top?: number | undefined;
|
|
218
404
|
skip?: number | undefined;
|
|
219
405
|
} | undefined;
|
|
@@ -235,7 +421,7 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
235
421
|
transform?: "lookup" | "join" | "map" | "none" | "constant" | "split" | "javascript" | undefined;
|
|
236
422
|
}[];
|
|
237
423
|
label?: string | undefined;
|
|
238
|
-
mode?: "
|
|
424
|
+
mode?: "update" | "upsert" | "insert" | undefined;
|
|
239
425
|
sourceFormat?: "json" | "csv" | "xml" | "sql" | undefined;
|
|
240
426
|
upsertKey?: string[] | undefined;
|
|
241
427
|
extractQuery?: {
|
|
@@ -245,7 +431,34 @@ export declare const MappingSchema: z.ZodObject<{
|
|
|
245
431
|
order?: "asc" | "desc" | undefined;
|
|
246
432
|
}[] | undefined;
|
|
247
433
|
fields?: any[] | undefined;
|
|
434
|
+
distinct?: boolean | undefined;
|
|
435
|
+
aggregations?: {
|
|
436
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "count_distinct" | "array_agg" | "string_agg";
|
|
437
|
+
alias: string;
|
|
438
|
+
field?: string | undefined;
|
|
439
|
+
distinct?: boolean | undefined;
|
|
440
|
+
}[] | undefined;
|
|
441
|
+
windowFunctions?: {
|
|
442
|
+
function: "min" | "max" | "count" | "sum" | "avg" | "row_number" | "rank" | "dense_rank" | "percent_rank" | "lag" | "lead" | "first_value" | "last_value";
|
|
443
|
+
alias: string;
|
|
444
|
+
over: {
|
|
445
|
+
partitionBy?: string[] | undefined;
|
|
446
|
+
orderBy?: {
|
|
447
|
+
field: string;
|
|
448
|
+
order?: "asc" | "desc" | undefined;
|
|
449
|
+
}[] | undefined;
|
|
450
|
+
frame?: {
|
|
451
|
+
type?: "rows" | "range" | undefined;
|
|
452
|
+
start?: string | undefined;
|
|
453
|
+
end?: string | undefined;
|
|
454
|
+
} | undefined;
|
|
455
|
+
};
|
|
456
|
+
field?: string | undefined;
|
|
457
|
+
}[] | undefined;
|
|
248
458
|
filters?: any;
|
|
459
|
+
joins?: any[] | undefined;
|
|
460
|
+
groupBy?: string[] | undefined;
|
|
461
|
+
having?: any;
|
|
249
462
|
top?: number | undefined;
|
|
250
463
|
skip?: number | undefined;
|
|
251
464
|
} | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.zod.d.ts","sourceRoot":"","sources":["../../src/data/mapping.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,aAAa,iFAQxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B,oBAAoB;;IAGpB,mBAAmB;;IAGnB,qBAAqB;;IAGrB,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBlC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB,eAAe;;;IAIf,YAAY;;;IAIZ,sBAAsB;;QAzCtB,oBAAoB;;QAGpB,mBAAmB;;QAGnB,qBAAqB;;QAGrB,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmClC,mBAAmB;;;IAInB,iCAAiC
|
|
1
|
+
{"version":3,"file":"mapping.zod.d.ts","sourceRoot":"","sources":["../../src/data/mapping.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,aAAa,iFAQxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B,oBAAoB;;IAGpB,mBAAmB;;IAGnB,qBAAqB;;IAGrB,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBlC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;IACxB,eAAe;;;IAIf,YAAY;;;IAIZ,sBAAsB;;QAzCtB,oBAAoB;;QAGpB,mBAAmB;;QAGnB,qBAAqB;;QAGrB,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmClC,mBAAmB;;;IAInB,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGjC,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGrB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|