@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.zod.d.ts","sourceRoot":"","sources":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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAM9B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI/B,CAAC"}
|
package/dist/data/field.zod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FieldSchema = exports.SelectOptionSchema = exports.FieldType = void 0;
|
|
3
|
+
exports.Field = exports.FieldSchema = exports.AddressSchema = exports.LocationCoordinatesSchema = exports.SelectOptionSchema = exports.FieldType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
6
|
* Field Type Enum
|
|
@@ -9,7 +9,7 @@ exports.FieldType = zod_1.z.enum([
|
|
|
9
9
|
// Core Text
|
|
10
10
|
'text', 'textarea', 'email', 'url', 'phone', 'password',
|
|
11
11
|
// Rich Content
|
|
12
|
-
'markdown', 'html',
|
|
12
|
+
'markdown', 'html', 'richtext',
|
|
13
13
|
// Numbers
|
|
14
14
|
'number', 'currency', 'percent',
|
|
15
15
|
// Date & Time
|
|
@@ -17,13 +17,20 @@ exports.FieldType = zod_1.z.enum([
|
|
|
17
17
|
// Logic
|
|
18
18
|
'boolean',
|
|
19
19
|
// Selection
|
|
20
|
-
'select',
|
|
20
|
+
'select', // Static options
|
|
21
21
|
// Relational
|
|
22
22
|
'lookup', 'master_detail', // Dynamic reference to other objects
|
|
23
23
|
// Media
|
|
24
24
|
'image', 'file', 'avatar',
|
|
25
25
|
// Calculated / System
|
|
26
|
-
'formula', 'summary', 'autonumber'
|
|
26
|
+
'formula', 'summary', 'autonumber',
|
|
27
|
+
// Enhanced Types
|
|
28
|
+
'location', // GPS coordinates
|
|
29
|
+
'address', // Structured address
|
|
30
|
+
'code', // Code with syntax highlighting
|
|
31
|
+
'color', // Color picker
|
|
32
|
+
'rating', // Star rating
|
|
33
|
+
'signature' // Digital signature
|
|
27
34
|
]);
|
|
28
35
|
/**
|
|
29
36
|
* Select Option Schema
|
|
@@ -34,17 +41,42 @@ exports.SelectOptionSchema = zod_1.z.object({
|
|
|
34
41
|
color: zod_1.z.string().optional().describe('Color code for badges/charts'),
|
|
35
42
|
default: zod_1.z.boolean().optional().describe('Is default option'),
|
|
36
43
|
});
|
|
44
|
+
/**
|
|
45
|
+
* Location Coordinates Schema
|
|
46
|
+
* GPS coordinates for location field type
|
|
47
|
+
*/
|
|
48
|
+
exports.LocationCoordinatesSchema = zod_1.z.object({
|
|
49
|
+
latitude: zod_1.z.number().min(-90).max(90).describe('Latitude coordinate'),
|
|
50
|
+
longitude: zod_1.z.number().min(-180).max(180).describe('Longitude coordinate'),
|
|
51
|
+
altitude: zod_1.z.number().optional().describe('Altitude in meters'),
|
|
52
|
+
accuracy: zod_1.z.number().optional().describe('Accuracy in meters'),
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Address Schema
|
|
56
|
+
* Structured address for address field type
|
|
57
|
+
*/
|
|
58
|
+
exports.AddressSchema = zod_1.z.object({
|
|
59
|
+
street: zod_1.z.string().optional().describe('Street address'),
|
|
60
|
+
city: zod_1.z.string().optional().describe('City name'),
|
|
61
|
+
state: zod_1.z.string().optional().describe('State/Province'),
|
|
62
|
+
postalCode: zod_1.z.string().optional().describe('Postal/ZIP code'),
|
|
63
|
+
country: zod_1.z.string().optional().describe('Country name or code'),
|
|
64
|
+
countryCode: zod_1.z.string().optional().describe('ISO country code (e.g., US, GB)'),
|
|
65
|
+
formatted: zod_1.z.string().optional().describe('Formatted address string'),
|
|
66
|
+
});
|
|
37
67
|
/**
|
|
38
68
|
* Field Schema - Best Practice Enterprise Pattern
|
|
39
69
|
*/
|
|
40
70
|
exports.FieldSchema = zod_1.z.object({
|
|
41
71
|
/** Identity */
|
|
42
|
-
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)'),
|
|
43
|
-
label: zod_1.z.string().describe('Human readable label'),
|
|
72
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)').optional(),
|
|
73
|
+
label: zod_1.z.string().optional().describe('Human readable label'),
|
|
44
74
|
type: exports.FieldType.describe('Field Data Type'),
|
|
45
75
|
description: zod_1.z.string().optional().describe('Tooltip/Help text'),
|
|
76
|
+
format: zod_1.z.string().optional().describe('Format string (e.g. email, phone)'),
|
|
46
77
|
/** Database Constraints */
|
|
47
78
|
required: zod_1.z.boolean().default(false).describe('Is required'),
|
|
79
|
+
searchable: zod_1.z.boolean().default(false).describe('Is searchable'),
|
|
48
80
|
multiple: zod_1.z.boolean().default(false).describe('Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.'),
|
|
49
81
|
unique: zod_1.z.boolean().default(false).describe('Is unique constraint'),
|
|
50
82
|
defaultValue: zod_1.z.any().optional().describe('Default value'),
|
|
@@ -64,13 +96,30 @@ exports.FieldSchema = zod_1.z.object({
|
|
|
64
96
|
writeRequiresMasterRead: zod_1.z.boolean().optional().describe('If true, user needs read access to master record to edit this field'),
|
|
65
97
|
deleteBehavior: zod_1.z.enum(['set_null', 'cascade', 'restrict']).optional().default('set_null').describe('What happens if referenced record is deleted'),
|
|
66
98
|
/** Calculation */
|
|
67
|
-
expression: zod_1.z.string().optional().describe('Formula expression'),
|
|
68
|
-
formula: zod_1.z.string().optional().describe('Deprecated: Use expression'),
|
|
99
|
+
expression: zod_1.z.string().optional().describe('Formula expression'),
|
|
100
|
+
formula: zod_1.z.string().optional().describe('Deprecated: Use expression'),
|
|
69
101
|
summaryOperations: zod_1.z.object({
|
|
70
102
|
object: zod_1.z.string(),
|
|
71
103
|
field: zod_1.z.string(),
|
|
72
104
|
function: zod_1.z.enum(['count', 'sum', 'min', 'max', 'avg'])
|
|
73
105
|
}).optional().describe('Roll-up summary definition'),
|
|
106
|
+
/** Enhanced Field Type Configurations */
|
|
107
|
+
// Code field config
|
|
108
|
+
language: zod_1.z.string().optional().describe('Programming language for syntax highlighting (e.g., javascript, python, sql)'),
|
|
109
|
+
theme: zod_1.z.string().optional().describe('Code editor theme (e.g., dark, light, monokai)'),
|
|
110
|
+
lineNumbers: zod_1.z.boolean().optional().describe('Show line numbers in code editor'),
|
|
111
|
+
// Rating field config
|
|
112
|
+
maxRating: zod_1.z.number().optional().describe('Maximum rating value (default: 5)'),
|
|
113
|
+
allowHalf: zod_1.z.boolean().optional().describe('Allow half-star ratings'),
|
|
114
|
+
// Location field config
|
|
115
|
+
displayMap: zod_1.z.boolean().optional().describe('Display map widget for location field'),
|
|
116
|
+
allowGeocoding: zod_1.z.boolean().optional().describe('Allow address-to-coordinate conversion'),
|
|
117
|
+
// Address field config
|
|
118
|
+
addressFormat: zod_1.z.enum(['us', 'uk', 'international']).optional().describe('Address format template'),
|
|
119
|
+
// Color field config
|
|
120
|
+
colorFormat: zod_1.z.enum(['hex', 'rgb', 'rgba', 'hsl']).optional().describe('Color value format'),
|
|
121
|
+
allowAlpha: zod_1.z.boolean().optional().describe('Allow transparency/alpha channel'),
|
|
122
|
+
presetColors: zod_1.z.array(zod_1.z.string()).optional().describe('Preset color options'),
|
|
74
123
|
/** Security & Visibility */
|
|
75
124
|
hidden: zod_1.z.boolean().default(false).describe('Hidden from default UI'),
|
|
76
125
|
readonly: zod_1.z.boolean().default(false).describe('Read-only in UI'),
|
|
@@ -79,3 +128,95 @@ exports.FieldSchema = zod_1.z.object({
|
|
|
79
128
|
index: zod_1.z.boolean().default(false).describe('Create standard database index'),
|
|
80
129
|
externalId: zod_1.z.boolean().default(false).describe('Is external ID for upsert operations'),
|
|
81
130
|
});
|
|
131
|
+
exports.Field = {
|
|
132
|
+
text: (config = {}) => ({ type: 'text', ...config }),
|
|
133
|
+
textarea: (config = {}) => ({ type: 'textarea', ...config }),
|
|
134
|
+
number: (config = {}) => ({ type: 'number', ...config }),
|
|
135
|
+
boolean: (config = {}) => ({ type: 'boolean', ...config }),
|
|
136
|
+
date: (config = {}) => ({ type: 'date', ...config }),
|
|
137
|
+
datetime: (config = {}) => ({ type: 'datetime', ...config }),
|
|
138
|
+
currency: (config = {}) => ({ type: 'currency', ...config }),
|
|
139
|
+
percent: (config = {}) => ({ type: 'percent', ...config }),
|
|
140
|
+
url: (config = {}) => ({ type: 'url', ...config }),
|
|
141
|
+
email: (config = {}) => ({ type: 'email', ...config }),
|
|
142
|
+
phone: (config = {}) => ({ type: 'phone', ...config }),
|
|
143
|
+
image: (config = {}) => ({ type: 'image', ...config }),
|
|
144
|
+
file: (config = {}) => ({ type: 'file', ...config }),
|
|
145
|
+
avatar: (config = {}) => ({ type: 'avatar', ...config }),
|
|
146
|
+
formula: (config = {}) => ({ type: 'formula', ...config }),
|
|
147
|
+
summary: (config = {}) => ({ type: 'summary', ...config }),
|
|
148
|
+
autonumber: (config = {}) => ({ type: 'autonumber', ...config }),
|
|
149
|
+
markdown: (config = {}) => ({ type: 'markdown', ...config }),
|
|
150
|
+
html: (config = {}) => ({ type: 'html', ...config }),
|
|
151
|
+
password: (config = {}) => ({ type: 'password', ...config }),
|
|
152
|
+
/**
|
|
153
|
+
* Select field helper with backward-compatible API
|
|
154
|
+
*
|
|
155
|
+
* @example Old API (array first)
|
|
156
|
+
* Field.select(['High', 'Low'], { label: 'Priority' })
|
|
157
|
+
*
|
|
158
|
+
* @example New API (config object)
|
|
159
|
+
* Field.select({ options: [{label: 'High', value: 'high'}], label: 'Priority' })
|
|
160
|
+
*/
|
|
161
|
+
select: (optionsOrConfig, config) => {
|
|
162
|
+
// Support both old and new signatures:
|
|
163
|
+
// Old: Field.select(['a', 'b'], { label: 'X' })
|
|
164
|
+
// New: Field.select({ options: [{label: 'A', value: 'a'}], label: 'X' })
|
|
165
|
+
let options;
|
|
166
|
+
let finalConfig;
|
|
167
|
+
if (Array.isArray(optionsOrConfig)) {
|
|
168
|
+
// Old signature: array as first param
|
|
169
|
+
options = optionsOrConfig.map(o => typeof o === 'string' ? { label: o, value: o } : o);
|
|
170
|
+
finalConfig = config || {};
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// New signature: config object with options
|
|
174
|
+
options = (optionsOrConfig.options || []).map(o => typeof o === 'string' ? { label: o, value: o } : o);
|
|
175
|
+
// Remove options from config to avoid confusion
|
|
176
|
+
const { options: _, ...restConfig } = optionsOrConfig;
|
|
177
|
+
finalConfig = restConfig;
|
|
178
|
+
}
|
|
179
|
+
return { type: 'select', options, ...finalConfig };
|
|
180
|
+
},
|
|
181
|
+
lookup: (reference, config = {}) => ({
|
|
182
|
+
type: 'lookup',
|
|
183
|
+
reference,
|
|
184
|
+
...config
|
|
185
|
+
}),
|
|
186
|
+
masterDetail: (reference, config = {}) => ({
|
|
187
|
+
type: 'master_detail',
|
|
188
|
+
reference,
|
|
189
|
+
...config
|
|
190
|
+
}),
|
|
191
|
+
// Enhanced Field Type Helpers
|
|
192
|
+
location: (config = {}) => ({
|
|
193
|
+
type: 'location',
|
|
194
|
+
...config
|
|
195
|
+
}),
|
|
196
|
+
address: (config = {}) => ({
|
|
197
|
+
type: 'address',
|
|
198
|
+
...config
|
|
199
|
+
}),
|
|
200
|
+
richtext: (config = {}) => ({
|
|
201
|
+
type: 'richtext',
|
|
202
|
+
...config
|
|
203
|
+
}),
|
|
204
|
+
code: (language, config = {}) => ({
|
|
205
|
+
type: 'code',
|
|
206
|
+
language,
|
|
207
|
+
...config
|
|
208
|
+
}),
|
|
209
|
+
color: (config = {}) => ({
|
|
210
|
+
type: 'color',
|
|
211
|
+
...config
|
|
212
|
+
}),
|
|
213
|
+
rating: (maxRating = 5, config = {}) => ({
|
|
214
|
+
type: 'rating',
|
|
215
|
+
maxRating,
|
|
216
|
+
...config
|
|
217
|
+
}),
|
|
218
|
+
signature: (config = {}) => ({
|
|
219
|
+
type: 'signature',
|
|
220
|
+
...config
|
|
221
|
+
}),
|
|
222
|
+
};
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Unified Query DSL Specification
|
|
4
|
+
*
|
|
5
|
+
* Based on industry best practices from:
|
|
6
|
+
* - Prisma ORM
|
|
7
|
+
* - Strapi CMS
|
|
8
|
+
* - TypeORM
|
|
9
|
+
* - LoopBack Framework
|
|
10
|
+
*
|
|
11
|
+
* Version: 1.0.0
|
|
12
|
+
* Status: Draft
|
|
13
|
+
*
|
|
14
|
+
* Objective: Define a JSON-based, database-agnostic query syntax standard
|
|
15
|
+
* for data filtering interactions between frontend and backend APIs.
|
|
16
|
+
*
|
|
17
|
+
* Design Principles:
|
|
18
|
+
* 1. Declarative: Frontend describes "what data to get", not "how to query"
|
|
19
|
+
* 2. Database Agnostic: Syntax contains no database-specific directives
|
|
20
|
+
* 3. Type Safe: Structure can be statically inferred by TypeScript
|
|
21
|
+
* 4. Convention over Configuration: Implicit syntax for common queries
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Comparison operators for equality and inequality checks.
|
|
25
|
+
* Supported data types: Any
|
|
26
|
+
*/
|
|
27
|
+
export declare const EqualityOperatorSchema: z.ZodObject<{
|
|
28
|
+
/** Equal to (default) - SQL: = | MongoDB: $eq */
|
|
29
|
+
$eq: z.ZodOptional<z.ZodAny>;
|
|
30
|
+
/** Not equal to - SQL: <> or != | MongoDB: $ne */
|
|
31
|
+
$ne: z.ZodOptional<z.ZodAny>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
$eq?: any;
|
|
34
|
+
$ne?: any;
|
|
35
|
+
}, {
|
|
36
|
+
$eq?: any;
|
|
37
|
+
$ne?: any;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Comparison operators for numeric and date comparisons.
|
|
41
|
+
* Supported data types: Number, Date
|
|
42
|
+
*/
|
|
43
|
+
export declare const ComparisonOperatorSchema: z.ZodObject<{
|
|
44
|
+
/** Greater than - SQL: > | MongoDB: $gt */
|
|
45
|
+
$gt: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
46
|
+
/** Greater than or equal to - SQL: >= | MongoDB: $gte */
|
|
47
|
+
$gte: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
48
|
+
/** Less than - SQL: < | MongoDB: $lt */
|
|
49
|
+
$lt: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
50
|
+
/** Less than or equal to - SQL: <= | MongoDB: $lte */
|
|
51
|
+
$lte: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
$gt?: number | Date | undefined;
|
|
54
|
+
$gte?: number | Date | undefined;
|
|
55
|
+
$lt?: number | Date | undefined;
|
|
56
|
+
$lte?: number | Date | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
$gt?: number | Date | undefined;
|
|
59
|
+
$gte?: number | Date | undefined;
|
|
60
|
+
$lt?: number | Date | undefined;
|
|
61
|
+
$lte?: number | Date | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
/**
|
|
64
|
+
* Set operators for membership checks.
|
|
65
|
+
*/
|
|
66
|
+
export declare const SetOperatorSchema: z.ZodObject<{
|
|
67
|
+
/** In list - SQL: IN (?, ?, ?) | MongoDB: $in */
|
|
68
|
+
$in: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
69
|
+
/** Not in list - SQL: NOT IN (...) | MongoDB: $nin */
|
|
70
|
+
$nin: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
$in?: any[] | undefined;
|
|
73
|
+
$nin?: any[] | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
$in?: any[] | undefined;
|
|
76
|
+
$nin?: any[] | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Range operator for interval checks (closed interval).
|
|
80
|
+
* SQL: BETWEEN ? AND ? | MongoDB: $gte AND $lte
|
|
81
|
+
*/
|
|
82
|
+
export declare const RangeOperatorSchema: z.ZodObject<{
|
|
83
|
+
/** Between (inclusive) - takes [min, max] array */
|
|
84
|
+
$between: z.ZodOptional<z.ZodTuple<[z.ZodUnion<[z.ZodNumber, z.ZodDate]>, z.ZodUnion<[z.ZodNumber, z.ZodDate]>], null>>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
$between?: [number | Date, number | Date] | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
$between?: [number | Date, number | Date] | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* String pattern matching operators.
|
|
92
|
+
* Note: Case sensitivity should be handled at backend level.
|
|
93
|
+
*/
|
|
94
|
+
export declare const StringOperatorSchema: z.ZodObject<{
|
|
95
|
+
/** Contains substring - SQL: LIKE %?% | MongoDB: $regex */
|
|
96
|
+
$contains: z.ZodOptional<z.ZodString>;
|
|
97
|
+
/** Starts with prefix - SQL: LIKE ?% | MongoDB: $regex */
|
|
98
|
+
$startsWith: z.ZodOptional<z.ZodString>;
|
|
99
|
+
/** Ends with suffix - SQL: LIKE %? | MongoDB: $regex */
|
|
100
|
+
$endsWith: z.ZodOptional<z.ZodString>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
$contains?: string | undefined;
|
|
103
|
+
$startsWith?: string | undefined;
|
|
104
|
+
$endsWith?: string | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
$contains?: string | undefined;
|
|
107
|
+
$startsWith?: string | undefined;
|
|
108
|
+
$endsWith?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Special check operators for null and existence.
|
|
112
|
+
*/
|
|
113
|
+
export declare const SpecialOperatorSchema: z.ZodObject<{
|
|
114
|
+
/** Is null check - SQL: IS NULL (true) / IS NOT NULL (false) | MongoDB: field: null */
|
|
115
|
+
$null: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
/** Field exists check (primarily for NoSQL) - MongoDB: $exists */
|
|
117
|
+
$exist: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
$null?: boolean | undefined;
|
|
120
|
+
$exist?: boolean | undefined;
|
|
121
|
+
}, {
|
|
122
|
+
$null?: boolean | undefined;
|
|
123
|
+
$exist?: boolean | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
/**
|
|
126
|
+
* All field-level operators combined.
|
|
127
|
+
* These can be applied to individual fields in a filter.
|
|
128
|
+
*/
|
|
129
|
+
export declare const FieldOperatorsSchema: z.ZodObject<{
|
|
130
|
+
$eq: z.ZodOptional<z.ZodAny>;
|
|
131
|
+
$ne: z.ZodOptional<z.ZodAny>;
|
|
132
|
+
$gt: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
133
|
+
$gte: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
134
|
+
$lt: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
135
|
+
$lte: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodDate]>>;
|
|
136
|
+
$in: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
137
|
+
$nin: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
138
|
+
$between: z.ZodOptional<z.ZodTuple<[z.ZodUnion<[z.ZodNumber, z.ZodDate]>, z.ZodUnion<[z.ZodNumber, z.ZodDate]>], null>>;
|
|
139
|
+
$contains: z.ZodOptional<z.ZodString>;
|
|
140
|
+
$startsWith: z.ZodOptional<z.ZodString>;
|
|
141
|
+
$endsWith: z.ZodOptional<z.ZodString>;
|
|
142
|
+
$null: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
$exist: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
$eq?: any;
|
|
146
|
+
$ne?: any;
|
|
147
|
+
$gt?: number | Date | undefined;
|
|
148
|
+
$gte?: number | Date | undefined;
|
|
149
|
+
$lt?: number | Date | undefined;
|
|
150
|
+
$lte?: number | Date | undefined;
|
|
151
|
+
$in?: any[] | undefined;
|
|
152
|
+
$nin?: any[] | undefined;
|
|
153
|
+
$between?: [number | Date, number | Date] | undefined;
|
|
154
|
+
$contains?: string | undefined;
|
|
155
|
+
$startsWith?: string | undefined;
|
|
156
|
+
$endsWith?: string | undefined;
|
|
157
|
+
$null?: boolean | undefined;
|
|
158
|
+
$exist?: boolean | undefined;
|
|
159
|
+
}, {
|
|
160
|
+
$eq?: any;
|
|
161
|
+
$ne?: any;
|
|
162
|
+
$gt?: number | Date | undefined;
|
|
163
|
+
$gte?: number | Date | undefined;
|
|
164
|
+
$lt?: number | Date | undefined;
|
|
165
|
+
$lte?: number | Date | undefined;
|
|
166
|
+
$in?: any[] | undefined;
|
|
167
|
+
$nin?: any[] | undefined;
|
|
168
|
+
$between?: [number | Date, number | Date] | undefined;
|
|
169
|
+
$contains?: string | undefined;
|
|
170
|
+
$startsWith?: string | undefined;
|
|
171
|
+
$endsWith?: string | undefined;
|
|
172
|
+
$null?: boolean | undefined;
|
|
173
|
+
$exist?: boolean | undefined;
|
|
174
|
+
}>;
|
|
175
|
+
/**
|
|
176
|
+
* Recursive filter type that supports:
|
|
177
|
+
* 1. Implicit equality: { field: value }
|
|
178
|
+
* 2. Explicit operators: { field: { $op: value } }
|
|
179
|
+
* 3. Logical combinations: { $and: [...], $or: [...], $not: {...} }
|
|
180
|
+
* 4. Nested relations: { relation: { field: value } }
|
|
181
|
+
*/
|
|
182
|
+
export type FilterCondition = {
|
|
183
|
+
[key: string]: any | z.infer<typeof FieldOperatorsSchema> | FilterCondition;
|
|
184
|
+
} & {
|
|
185
|
+
/** Logical AND - combines all conditions that must be true */
|
|
186
|
+
$and?: FilterCondition[];
|
|
187
|
+
/** Logical OR - at least one condition must be true */
|
|
188
|
+
$or?: FilterCondition[];
|
|
189
|
+
/** Logical NOT - negates the condition */
|
|
190
|
+
$not?: FilterCondition;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Zod schema for recursive filter validation.
|
|
194
|
+
* Uses z.lazy() to handle recursive structure.
|
|
195
|
+
*/
|
|
196
|
+
export declare const FilterConditionSchema: z.ZodType<FilterCondition>;
|
|
197
|
+
/**
|
|
198
|
+
* Top-level query filter wrapper.
|
|
199
|
+
* This is typically used as the "where" clause in a query.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* const filter: QueryFilter = {
|
|
204
|
+
* where: {
|
|
205
|
+
* status: "active", // Implicit equality
|
|
206
|
+
* age: { $gte: 18 }, // Explicit operator
|
|
207
|
+
* $or: [ // Logical combination
|
|
208
|
+
* { role: "admin" },
|
|
209
|
+
* { email: { $contains: "@company.com" } }
|
|
210
|
+
* ],
|
|
211
|
+
* profile: { // Nested relation
|
|
212
|
+
* verified: true
|
|
213
|
+
* }
|
|
214
|
+
* }
|
|
215
|
+
* }
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
export declare const QueryFilterSchema: z.ZodObject<{
|
|
219
|
+
where: z.ZodOptional<z.ZodType<FilterCondition, z.ZodTypeDef, FilterCondition>>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
where?: FilterCondition | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
where?: FilterCondition | undefined;
|
|
224
|
+
}>;
|
|
225
|
+
/**
|
|
226
|
+
* Type-safe filter operators for use in TypeScript.
|
|
227
|
+
*
|
|
228
|
+
* @example
|
|
229
|
+
* ```typescript
|
|
230
|
+
* type UserFilter = Filter<User>;
|
|
231
|
+
*
|
|
232
|
+
* const filter: UserFilter = {
|
|
233
|
+
* age: { $gte: 18 },
|
|
234
|
+
* email: { $contains: "@example.com" }
|
|
235
|
+
* };
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
export type Filter<T = any> = {
|
|
239
|
+
[K in keyof T]?: T[K] | {
|
|
240
|
+
$eq?: T[K];
|
|
241
|
+
$ne?: T[K];
|
|
242
|
+
$gt?: T[K] extends number | Date ? T[K] : never;
|
|
243
|
+
$gte?: T[K] extends number | Date ? T[K] : never;
|
|
244
|
+
$lt?: T[K] extends number | Date ? T[K] : never;
|
|
245
|
+
$lte?: T[K] extends number | Date ? T[K] : never;
|
|
246
|
+
$in?: T[K][];
|
|
247
|
+
$nin?: T[K][];
|
|
248
|
+
$between?: T[K] extends number | Date ? [T[K], T[K]] : never;
|
|
249
|
+
$contains?: T[K] extends string ? string : never;
|
|
250
|
+
$startsWith?: T[K] extends string ? string : never;
|
|
251
|
+
$endsWith?: T[K] extends string ? string : never;
|
|
252
|
+
$null?: boolean;
|
|
253
|
+
$exist?: boolean;
|
|
254
|
+
} | (T[K] extends object ? Filter<T[K]> : never);
|
|
255
|
+
} & {
|
|
256
|
+
$and?: Filter<T>[];
|
|
257
|
+
$or?: Filter<T>[];
|
|
258
|
+
$not?: Filter<T>;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Scalar types supported by the filter system.
|
|
262
|
+
*/
|
|
263
|
+
export type Scalar = string | number | boolean | Date | null;
|
|
264
|
+
export type FieldOperators = z.infer<typeof FieldOperatorsSchema>;
|
|
265
|
+
export type QueryFilter = z.infer<typeof QueryFilterSchema>;
|
|
266
|
+
/**
|
|
267
|
+
* Normalized filter AST structure.
|
|
268
|
+
* This is the internal representation after converting all syntactic sugar
|
|
269
|
+
* to explicit operators.
|
|
270
|
+
*
|
|
271
|
+
* Stage 1: Normalization Pass
|
|
272
|
+
* Input: { age: 18, role: "admin" }
|
|
273
|
+
* Output: { $and: [{ age: { $eq: 18 } }, { role: { $eq: "admin" } }] }
|
|
274
|
+
*
|
|
275
|
+
* This simplifies adapter implementation by providing a consistent structure.
|
|
276
|
+
*/
|
|
277
|
+
export declare const NormalizedFilterSchema: z.ZodType<any>;
|
|
278
|
+
export type NormalizedFilter = z.infer<typeof NormalizedFilterSchema>;
|
|
279
|
+
/**
|
|
280
|
+
* All supported operator keys.
|
|
281
|
+
* Useful for validation and parsing.
|
|
282
|
+
*/
|
|
283
|
+
export declare const FILTER_OPERATORS: readonly ["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$nin", "$between", "$contains", "$startsWith", "$endsWith", "$null", "$exist"];
|
|
284
|
+
/**
|
|
285
|
+
* Logical operator keys.
|
|
286
|
+
*/
|
|
287
|
+
export declare const LOGICAL_OPERATORS: readonly ["$and", "$or", "$not"];
|
|
288
|
+
/**
|
|
289
|
+
* All operator keys (field + logical).
|
|
290
|
+
*/
|
|
291
|
+
export declare const ALL_OPERATORS: readonly ["$eq", "$ne", "$gt", "$gte", "$lt", "$lte", "$in", "$nin", "$between", "$contains", "$startsWith", "$endsWith", "$null", "$exist", "$and", "$or", "$not"];
|
|
292
|
+
export type FilterOperatorKey = typeof FILTER_OPERATORS[number];
|
|
293
|
+
export type LogicalOperatorKey = typeof LOGICAL_OPERATORS[number];
|
|
294
|
+
export type OperatorKey = typeof ALL_OPERATORS[number];
|
|
295
|
+
//# sourceMappingURL=filter.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.zod.d.ts","sourceRoot":"","sources":["../../src/data/filter.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;IACjC,iDAAiD;;IAGjD,kDAAkD;;;;;;;;EAElD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB;IACnC,2CAA2C;;IAG3C,yDAAyD;;IAGzD,wCAAwC;;IAGxC,sDAAsD;;;;;;;;;;;;EAEtD,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B,iDAAiD;;IAGjD,sDAAsD;;;;;;;;EAEtD,CAAC;AAEH;;;GAGG;AACH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