@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.zod.d.ts","sourceRoot":"","sources":["../../src/system/driver.zod.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DriverInterfaceSchema = exports.DriverCapabilitiesSchema = exports.DriverOptionsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const query_zod_1 = require("../data/query.zod");
|
|
6
|
+
/**
|
|
7
|
+
* Common Driver Options
|
|
8
|
+
* Passed to most driver methods to control behavior (transactions, timeouts, etc.)
|
|
9
|
+
*/
|
|
10
|
+
exports.DriverOptionsSchema = zod_1.z.object({
|
|
11
|
+
/**
|
|
12
|
+
* Transaction handle/identifier.
|
|
13
|
+
* If provided, the operation must run within this transaction.
|
|
14
|
+
*/
|
|
15
|
+
transaction: zod_1.z.any().optional().describe('Transaction handle'),
|
|
16
|
+
/**
|
|
17
|
+
* Operation timeout in milliseconds.
|
|
18
|
+
*/
|
|
19
|
+
timeout: zod_1.z.number().optional().describe('Timeout in ms'),
|
|
20
|
+
/**
|
|
21
|
+
* Whether to bypass cache and force a fresh read.
|
|
22
|
+
*/
|
|
23
|
+
skipCache: zod_1.z.boolean().optional().describe('Bypass cache'),
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Driver Capabilities Schema
|
|
27
|
+
*
|
|
28
|
+
* Defines what features a database driver supports.
|
|
29
|
+
* This allows ObjectQL to adapt its behavior based on underlying database capabilities.
|
|
30
|
+
*/
|
|
31
|
+
exports.DriverCapabilitiesSchema = zod_1.z.object({
|
|
32
|
+
/**
|
|
33
|
+
* Whether the driver supports database transactions.
|
|
34
|
+
* If true, beginTransaction, commit, and rollback must be implemented.
|
|
35
|
+
*/
|
|
36
|
+
transactions: zod_1.z.boolean().describe('Supports transactions'),
|
|
37
|
+
/**
|
|
38
|
+
* Whether the driver supports SQL-style joins.
|
|
39
|
+
* If false, ObjectQL will fetch related data separately and join in memory.
|
|
40
|
+
*/
|
|
41
|
+
joins: zod_1.z.boolean().describe('Supports SQL joins'),
|
|
42
|
+
/**
|
|
43
|
+
* Whether the driver supports full-text search.
|
|
44
|
+
* If true, text search queries can be pushed to the database.
|
|
45
|
+
*/
|
|
46
|
+
fullTextSearch: zod_1.z.boolean().describe('Supports full-text search'),
|
|
47
|
+
/**
|
|
48
|
+
* Whether the driver supports JSON field types.
|
|
49
|
+
* If false, JSON data will be serialized as strings.
|
|
50
|
+
*/
|
|
51
|
+
jsonFields: zod_1.z.boolean().describe('Supports JSON field types'),
|
|
52
|
+
/**
|
|
53
|
+
* Whether the driver supports array field types.
|
|
54
|
+
* If false, arrays will be stored as JSON strings or in separate tables.
|
|
55
|
+
*/
|
|
56
|
+
arrayFields: zod_1.z.boolean().describe('Supports array field types'),
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Unified Database Driver Interface
|
|
60
|
+
*
|
|
61
|
+
* This is the contract that all storage adapters (Postgres, Mongo, Excel, Salesforce) must implement.
|
|
62
|
+
* It abstracts the underlying engine, enabling ObjectStack to be "Database Agnostic".
|
|
63
|
+
*/
|
|
64
|
+
exports.DriverInterfaceSchema = zod_1.z.object({
|
|
65
|
+
/**
|
|
66
|
+
* Driver name (e.g., 'postgresql', 'mongodb', 'rest_api').
|
|
67
|
+
*/
|
|
68
|
+
name: zod_1.z.string().describe('Driver unique name'),
|
|
69
|
+
/**
|
|
70
|
+
* Driver version.
|
|
71
|
+
*/
|
|
72
|
+
version: zod_1.z.string().describe('Driver version'),
|
|
73
|
+
/**
|
|
74
|
+
* Capabilities descriptor.
|
|
75
|
+
*/
|
|
76
|
+
supports: exports.DriverCapabilitiesSchema,
|
|
77
|
+
// ============================================================================
|
|
78
|
+
// Lifecycle Management
|
|
79
|
+
// ============================================================================
|
|
80
|
+
/**
|
|
81
|
+
* Initialize connection pool or authenticate.
|
|
82
|
+
*/
|
|
83
|
+
connect: zod_1.z.function()
|
|
84
|
+
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
85
|
+
.describe('Establish connection'),
|
|
86
|
+
/**
|
|
87
|
+
* Close connections and cleanup resources.
|
|
88
|
+
*/
|
|
89
|
+
disconnect: zod_1.z.function()
|
|
90
|
+
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
91
|
+
.describe('Close connection'),
|
|
92
|
+
/**
|
|
93
|
+
* Check connection health.
|
|
94
|
+
* @returns true if healthy, false otherwise.
|
|
95
|
+
*/
|
|
96
|
+
checkHealth: zod_1.z.function()
|
|
97
|
+
.returns(zod_1.z.promise(zod_1.z.boolean()))
|
|
98
|
+
.describe('Health check'),
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Raw Execution (Escape Hatch)
|
|
101
|
+
// ============================================================================
|
|
102
|
+
/**
|
|
103
|
+
* Execute a raw command/query native to the driver.
|
|
104
|
+
* Useful for complex reports, stored procedures, or DDL not covered by standard sync.
|
|
105
|
+
*
|
|
106
|
+
* @param command - The raw command (e.g., SQL string, shell command, or remote API payload).
|
|
107
|
+
* @param parameters - Optional array of bound parameters for safe execution (prevention of injection).
|
|
108
|
+
* @param options - Driver options (transaction context, timeout).
|
|
109
|
+
* @returns Promise resolving to the raw result from the driver.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // SQL Driver
|
|
113
|
+
* await driver.execute('SELECT * FROM complex_view WHERE id = ?', [123]);
|
|
114
|
+
*
|
|
115
|
+
* // Mongo Driver
|
|
116
|
+
* await driver.execute({ aggregate: 'orders', pipeline: [...] });
|
|
117
|
+
*/
|
|
118
|
+
execute: zod_1.z.function()
|
|
119
|
+
.args(zod_1.z.any(), zod_1.z.array(zod_1.z.any()).optional(), exports.DriverOptionsSchema.optional())
|
|
120
|
+
.returns(zod_1.z.promise(zod_1.z.any()))
|
|
121
|
+
.describe('Execute raw command'),
|
|
122
|
+
// ============================================================================
|
|
123
|
+
// CRUD Operations
|
|
124
|
+
// ============================================================================
|
|
125
|
+
/**
|
|
126
|
+
* Find multiple records matching the structured query.
|
|
127
|
+
* Parsing the QueryAST is the responsibility of the driver implementation.
|
|
128
|
+
*
|
|
129
|
+
* @param object - The name of the object/table to query (e.g. 'account').
|
|
130
|
+
* @param query - The structured QueryAST (filters, sorts, joins, pagination).
|
|
131
|
+
* @param options - Driver options.
|
|
132
|
+
* @returns Array of records.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* await driver.find('account', {
|
|
136
|
+
* filters: [['status', '=', 'active'], 'and', ['amount', '>', 500]],
|
|
137
|
+
* sort: [{ field: 'created_at', order: 'desc' }],
|
|
138
|
+
* top: 10
|
|
139
|
+
* });
|
|
140
|
+
*/
|
|
141
|
+
find: zod_1.z.function()
|
|
142
|
+
.args(zod_1.z.string(), query_zod_1.QuerySchema, exports.DriverOptionsSchema.optional())
|
|
143
|
+
.returns(zod_1.z.promise(zod_1.z.array(zod_1.z.record(zod_1.z.any()))))
|
|
144
|
+
.describe('Find records'),
|
|
145
|
+
/**
|
|
146
|
+
* Find a single record by query.
|
|
147
|
+
* Similar to find(), but returns only the first match or null.
|
|
148
|
+
*
|
|
149
|
+
* @param object - The name of the object.
|
|
150
|
+
* @param query - QueryAST.
|
|
151
|
+
* @param options - Driver options.
|
|
152
|
+
*/
|
|
153
|
+
findOne: zod_1.z.function()
|
|
154
|
+
.args(zod_1.z.string(), query_zod_1.QuerySchema, exports.DriverOptionsSchema.optional())
|
|
155
|
+
.returns(zod_1.z.promise(zod_1.z.record(zod_1.z.any()).nullable()))
|
|
156
|
+
.describe('Find one record'),
|
|
157
|
+
/**
|
|
158
|
+
* Create a new record.
|
|
159
|
+
*
|
|
160
|
+
* @param object - The object name.
|
|
161
|
+
* @param data - Key-value map of field data.
|
|
162
|
+
* @param options - Driver options.
|
|
163
|
+
* @returns The created record, including server-generated fields (id, created_at, etc.).
|
|
164
|
+
*/
|
|
165
|
+
create: zod_1.z.function()
|
|
166
|
+
.args(zod_1.z.string(), zod_1.z.record(zod_1.z.any()), exports.DriverOptionsSchema.optional())
|
|
167
|
+
.returns(zod_1.z.promise(zod_1.z.record(zod_1.z.any())))
|
|
168
|
+
.describe('Create record'),
|
|
169
|
+
/**
|
|
170
|
+
* Update an existing record by ID.
|
|
171
|
+
*
|
|
172
|
+
* @param object - The object name.
|
|
173
|
+
* @param id - The unique identifier of the record.
|
|
174
|
+
* @param data - The fields to update.
|
|
175
|
+
* @param options - Driver options.
|
|
176
|
+
* @returns The updated record.
|
|
177
|
+
*/
|
|
178
|
+
update: zod_1.z.function()
|
|
179
|
+
.args(zod_1.z.string(), zod_1.z.string().or(zod_1.z.number()), zod_1.z.record(zod_1.z.any()), exports.DriverOptionsSchema.optional())
|
|
180
|
+
.returns(zod_1.z.promise(zod_1.z.record(zod_1.z.any())))
|
|
181
|
+
.describe('Update record'),
|
|
182
|
+
/**
|
|
183
|
+
* Delete a record by ID.
|
|
184
|
+
*
|
|
185
|
+
* @param object - The object name.
|
|
186
|
+
* @param id - The unique identifier of the record.
|
|
187
|
+
* @param options - Driver options.
|
|
188
|
+
* @returns True if deleted, false if not found.
|
|
189
|
+
*/
|
|
190
|
+
delete: zod_1.z.function()
|
|
191
|
+
.args(zod_1.z.string(), zod_1.z.string().or(zod_1.z.number()), exports.DriverOptionsSchema.optional())
|
|
192
|
+
.returns(zod_1.z.promise(zod_1.z.boolean()))
|
|
193
|
+
.describe('Delete record'),
|
|
194
|
+
/**
|
|
195
|
+
* Count records matching a query.
|
|
196
|
+
*
|
|
197
|
+
* @param object - The object name.
|
|
198
|
+
* @param query - Optional filtering criteria.
|
|
199
|
+
* @param options - Driver options.
|
|
200
|
+
* @returns Total count.
|
|
201
|
+
*/
|
|
202
|
+
count: zod_1.z.function()
|
|
203
|
+
.args(zod_1.z.string(), query_zod_1.QuerySchema.optional(), exports.DriverOptionsSchema.optional())
|
|
204
|
+
.returns(zod_1.z.promise(zod_1.z.number()))
|
|
205
|
+
.describe('Count records'),
|
|
206
|
+
// ============================================================================
|
|
207
|
+
// Bulk Operations
|
|
208
|
+
// ============================================================================
|
|
209
|
+
/**
|
|
210
|
+
* Create multiple records in a single batch.
|
|
211
|
+
* Optimized for performance.
|
|
212
|
+
*
|
|
213
|
+
* @param object - The object name.
|
|
214
|
+
* @param dataArray - Array of record data.
|
|
215
|
+
* @returns Array of created records.
|
|
216
|
+
*/
|
|
217
|
+
bulkCreate: zod_1.z.function()
|
|
218
|
+
.args(zod_1.z.string(), zod_1.z.array(zod_1.z.record(zod_1.z.any())), exports.DriverOptionsSchema.optional())
|
|
219
|
+
.returns(zod_1.z.promise(zod_1.z.array(zod_1.z.record(zod_1.z.any())))),
|
|
220
|
+
/**
|
|
221
|
+
* Update multiple records in a single batch.
|
|
222
|
+
*
|
|
223
|
+
* @param object - The object name.
|
|
224
|
+
* @param updates - Array of objects containing {id, data}.
|
|
225
|
+
* @returns Array of updated records.
|
|
226
|
+
*/
|
|
227
|
+
bulkUpdate: zod_1.z.function()
|
|
228
|
+
.args(zod_1.z.string(), zod_1.z.array(zod_1.z.object({ id: zod_1.z.string().or(zod_1.z.number()), data: zod_1.z.record(zod_1.z.any()) })), exports.DriverOptionsSchema.optional())
|
|
229
|
+
.returns(zod_1.z.promise(zod_1.z.array(zod_1.z.record(zod_1.z.any())))),
|
|
230
|
+
/**
|
|
231
|
+
* Delete multiple records in a single batch.
|
|
232
|
+
*
|
|
233
|
+
* @param object - The object name.
|
|
234
|
+
* @param ids - Array of record IDs.
|
|
235
|
+
*/
|
|
236
|
+
bulkDelete: zod_1.z.function()
|
|
237
|
+
.args(zod_1.z.string(), zod_1.z.array(zod_1.z.string().or(zod_1.z.number())), exports.DriverOptionsSchema.optional())
|
|
238
|
+
.returns(zod_1.z.promise(zod_1.z.void())),
|
|
239
|
+
// ============================================================================
|
|
240
|
+
// Transaction Management
|
|
241
|
+
// ============================================================================
|
|
242
|
+
/**
|
|
243
|
+
* Begin a new database transaction.
|
|
244
|
+
* @returns A transaction handle to be passed to subsequent operations via `options.transaction`.
|
|
245
|
+
*/
|
|
246
|
+
beginTransaction: zod_1.z.function()
|
|
247
|
+
.returns(zod_1.z.promise(zod_1.z.any()))
|
|
248
|
+
.describe('Start transaction'),
|
|
249
|
+
/**
|
|
250
|
+
* Commit the transaction.
|
|
251
|
+
* @param transaction - The transaction handle.
|
|
252
|
+
*/
|
|
253
|
+
commit: zod_1.z.function()
|
|
254
|
+
.args(zod_1.z.any())
|
|
255
|
+
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
256
|
+
.describe('Commit transaction'),
|
|
257
|
+
/**
|
|
258
|
+
* Rollback the transaction.
|
|
259
|
+
* @param transaction - The transaction handle.
|
|
260
|
+
*/
|
|
261
|
+
rollback: zod_1.z.function()
|
|
262
|
+
.args(zod_1.z.any())
|
|
263
|
+
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
264
|
+
.describe('Rollback transaction'),
|
|
265
|
+
// ============================================================================
|
|
266
|
+
// Schema Management
|
|
267
|
+
// ============================================================================
|
|
268
|
+
/**
|
|
269
|
+
* Synchronize the database schema with the Object definition.
|
|
270
|
+
* This is an idempotent operation: it should create tables if missing,
|
|
271
|
+
* add columns if missing, and update indexes.
|
|
272
|
+
*
|
|
273
|
+
* @param object - The object name.
|
|
274
|
+
* @param schema - The full Object Schema (fields, indexes, etc).
|
|
275
|
+
* @param options - Driver options.
|
|
276
|
+
*/
|
|
277
|
+
syncSchema: zod_1.z.function()
|
|
278
|
+
.args(zod_1.z.string(), zod_1.z.any(), exports.DriverOptionsSchema.optional())
|
|
279
|
+
.returns(zod_1.z.promise(zod_1.z.void()))
|
|
280
|
+
.describe('Sync object schema to DB'),
|
|
281
|
+
/**
|
|
282
|
+
* Drop the underlying table or collection for an object.
|
|
283
|
+
* WARNING: Destructive operation.
|
|
284
|
+
*
|
|
285
|
+
* @param object - The object name.
|
|
286
|
+
*/
|
|
287
|
+
dropTable: zod_1.z.function()
|
|
288
|
+
.args(zod_1.z.string(), exports.DriverOptionsSchema.optional())
|
|
289
|
+
.returns(zod_1.z.promise(zod_1.z.void())),
|
|
290
|
+
});
|
|
@@ -90,19 +90,19 @@ export declare const LicenseSchema: z.ZodObject<{
|
|
|
90
90
|
tenantId: string;
|
|
91
91
|
planCode: string;
|
|
92
92
|
issuedAt: string;
|
|
93
|
+
signature?: string | undefined;
|
|
93
94
|
expiresAt?: string | undefined;
|
|
94
95
|
customFeatures?: string[] | undefined;
|
|
95
96
|
customLimits?: Record<string, number> | undefined;
|
|
96
|
-
signature?: string | undefined;
|
|
97
97
|
}, {
|
|
98
98
|
status: "active" | "expired" | "suspended" | "trial";
|
|
99
99
|
tenantId: string;
|
|
100
100
|
planCode: string;
|
|
101
101
|
issuedAt: string;
|
|
102
|
+
signature?: string | undefined;
|
|
102
103
|
expiresAt?: string | undefined;
|
|
103
104
|
customFeatures?: string[] | undefined;
|
|
104
105
|
customLimits?: Record<string, number> | undefined;
|
|
105
|
-
signature?: string | undefined;
|
|
106
106
|
}>;
|
|
107
107
|
export type Feature = z.infer<typeof FeatureSchema>;
|
|
108
108
|
export type Plan = z.infer<typeof PlanSchema>;
|