@objectstack/spec 0.1.0 → 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 +134 -121
- package/dist/ai/agent.zod.d.ts +164 -0
- package/dist/ai/agent.zod.d.ts.map +1 -0
- package/dist/ai/agent.zod.js +51 -0
- 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 +60 -0
- package/dist/data/dataset.zod.d.ts.map +1 -0
- package/dist/data/dataset.zod.js +54 -0
- package/dist/data/field.zod.d.ts +1808 -0
- package/dist/data/field.zod.d.ts.map +1 -0
- package/dist/data/field.zod.js +222 -0
- package/dist/data/flow.zod.d.ts +242 -0
- package/dist/data/flow.zod.d.ts.map +1 -0
- package/dist/data/flow.zod.js +77 -0
- package/dist/data/mapping.zod.d.ts +470 -0
- package/dist/data/mapping.zod.d.ts.map +1 -0
- package/dist/data/mapping.zod.js +65 -0
- package/dist/data/object.zod.d.ts +844 -0
- package/dist/data/object.zod.d.ts.map +1 -0
- package/dist/data/object.zod.js +81 -0
- package/dist/data/permission.zod.d.ts +163 -0
- package/dist/data/permission.zod.d.ts.map +1 -0
- package/dist/data/permission.zod.js +62 -0
- package/dist/data/query.zod.d.ts +438 -0
- package/dist/data/query.zod.d.ts.map +1 -0
- package/dist/data/query.zod.js +147 -0
- package/dist/data/sharing.zod.d.ts +63 -0
- package/dist/data/sharing.zod.d.ts.map +1 -0
- package/dist/data/sharing.zod.js +57 -0
- 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 +276 -0
- package/dist/data/validation.zod.d.ts.map +1 -0
- package/dist/data/validation.zod.js +105 -0
- package/dist/data/workflow.zod.d.ts +195 -0
- package/dist/data/workflow.zod.d.ts.map +1 -0
- package/dist/data/workflow.zod.js +64 -0
- package/dist/index.d.ts +41 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +62 -5
- package/dist/system/api.zod.d.ts +294 -0
- package/dist/system/api.zod.d.ts.map +1 -0
- package/dist/system/api.zod.js +56 -0
- package/dist/system/constants/index.d.ts +11 -0
- package/dist/system/constants/index.d.ts.map +1 -0
- package/dist/system/constants/index.js +26 -0
- package/dist/system/constants/paths.d.ts +71 -0
- package/dist/system/constants/paths.d.ts.map +1 -0
- package/dist/system/constants/paths.js +65 -0
- package/dist/system/datasource.zod.d.ts +210 -0
- package/dist/system/datasource.zod.d.ts.map +1 -0
- package/dist/system/datasource.zod.js +90 -0
- 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/identity.zod.d.ts +204 -0
- package/dist/system/identity.zod.d.ts.map +1 -0
- package/dist/system/identity.zod.js +68 -0
- package/dist/system/license.zod.d.ts +110 -0
- package/dist/system/license.zod.d.ts.map +1 -0
- package/dist/system/license.zod.js +63 -0
- package/dist/system/manifest.zod.d.ts +397 -0
- package/dist/system/manifest.zod.d.ts.map +1 -0
- package/dist/system/manifest.zod.js +142 -0
- 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 +209 -0
- package/dist/system/policy.zod.d.ts.map +1 -0
- package/dist/system/policy.zod.js +54 -0
- package/dist/system/role.zod.d.ts +34 -0
- package/dist/system/role.zod.d.ts.map +1 -0
- package/dist/system/role.zod.js +25 -0
- package/dist/system/territory.zod.d.ts +91 -0
- package/dist/system/territory.zod.d.ts.map +1 -0
- package/dist/system/territory.zod.js +64 -0
- package/dist/system/translation.zod.d.ts +171 -0
- package/dist/system/translation.zod.d.ts.map +1 -0
- package/dist/system/translation.zod.js +34 -0
- package/dist/system/types/index.d.ts +7 -0
- package/dist/system/types/index.d.ts.map +1 -0
- package/dist/system/types/index.js +22 -0
- package/dist/system/types/plugin.d.ts +113 -0
- package/dist/system/types/plugin.d.ts.map +1 -0
- package/dist/system/types/plugin.js +6 -0
- package/dist/system/webhook.zod.d.ts +106 -0
- package/dist/system/webhook.zod.d.ts.map +1 -0
- package/dist/system/webhook.zod.js +56 -0
- package/dist/ui/action.zod.d.ts +155 -0
- package/dist/ui/action.zod.d.ts.map +1 -0
- package/dist/ui/action.zod.js +54 -0
- package/dist/ui/app.zod.d.ts +405 -0
- package/dist/ui/app.zod.d.ts.map +1 -0
- package/dist/ui/app.zod.js +138 -0
- package/dist/ui/dashboard.zod.d.ts +213 -0
- package/dist/ui/dashboard.zod.d.ts.map +1 -0
- package/dist/ui/dashboard.zod.js +72 -0
- package/dist/ui/page.zod.d.ts +187 -0
- package/dist/ui/page.zod.d.ts.map +1 -0
- package/dist/ui/page.zod.js +48 -0
- package/dist/ui/report.zod.d.ts +233 -0
- package/dist/ui/report.zod.d.ts.map +1 -0
- package/dist/ui/report.zod.js +74 -0
- 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/view.zod.d.ts +887 -0
- package/dist/ui/view.zod.d.ts.map +1 -0
- package/dist/ui/view.zod.js +83 -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/AIKnowledge.json +30 -0
- package/json-schema/AIModelConfig.json +41 -0
- package/json-schema/AITool.json +33 -0
- package/json-schema/Action.json +162 -0
- package/json-schema/ActionParam.json +82 -0
- package/json-schema/Address.json +40 -0
- package/json-schema/Agent.json +140 -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/ApiEndpoint.json +162 -0
- package/json-schema/ApiError.json +27 -0
- package/json-schema/ApiMapping.json +28 -0
- package/json-schema/ApiRoutes.json +41 -0
- package/json-schema/App.json +297 -0
- package/json-schema/AppBranding.json +24 -0
- package/json-schema/AsyncValidation.json +70 -0
- package/json-schema/AuditPolicy.json +31 -0
- package/json-schema/AuthProtocol.json +17 -0
- package/json-schema/AuthProvider.json +171 -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/CalendarConfig.json +28 -0
- package/json-schema/ChartType.json +19 -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/Dashboard.json +117 -0
- package/json-schema/DashboardNavItem.json +42 -0
- package/json-schema/DashboardWidget.json +89 -0
- package/json-schema/Dataset.json +63 -0
- package/json-schema/DatasetMode.json +16 -0
- package/json-schema/Datasource.json +75 -0
- package/json-schema/DatasourceCapabilities.json +36 -0
- 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 +10 -0
- package/json-schema/EmailAlertAction.json +37 -0
- package/json-schema/ExportRequest.json +786 -0
- package/json-schema/Feature.json +51 -0
- package/json-schema/Field.json +290 -0
- package/json-schema/FieldMapping.json +83 -0
- package/json-schema/FieldNode.json +32 -0
- package/json-schema/FieldPermission.json +22 -0
- package/json-schema/FieldType.json +42 -0
- package/json-schema/FieldUpdateAction.json +32 -0
- package/json-schema/FieldWidgetProps.json +327 -0
- package/json-schema/FilterNode.json +52 -0
- package/json-schema/FilterOperator.json +26 -0
- package/json-schema/Flow.json +186 -0
- package/json-schema/FlowEdge.json +37 -0
- package/json-schema/FlowNode.json +65 -0
- package/json-schema/FlowNodeAction.json +24 -0
- package/json-schema/FlowVariable.json +34 -0
- package/json-schema/FormSection.json +42 -0
- package/json-schema/FormView.json +99 -0
- package/json-schema/FormatValidation.json +59 -0
- package/json-schema/GanttConfig.json +32 -0
- package/json-schema/GroupNavItem.json +42 -0
- package/json-schema/HttpMethod.json +16 -0
- package/json-schema/I18nContext.json +12 -0
- package/json-schema/Index.json +30 -0
- package/json-schema/JoinNode.json +455 -0
- package/json-schema/JoinType.json +15 -0
- package/json-schema/KanbanConfig.json +31 -0
- package/json-schema/LDAPConfig.json +39 -0
- package/json-schema/License.json +57 -0
- package/json-schema/ListRecordResponse.json +103 -0
- package/json-schema/ListView.json +153 -0
- package/json-schema/Locale.json +10 -0
- package/json-schema/LocationCoordinates.json +36 -0
- package/json-schema/Logger.json +25 -0
- package/json-schema/LogicOperator.json +14 -0
- package/json-schema/Manifest.json +315 -0
- package/json-schema/Mapping.json +598 -0
- package/json-schema/MenuItem.json +28 -0
- package/json-schema/MetricType.json +14 -0
- package/json-schema/ModificationResult.json +46 -0
- package/json-schema/NavigationItem.json +214 -0
- package/json-schema/NetworkPolicy.json +31 -0
- package/json-schema/OIDCConfig.json +46 -0
- package/json-schema/OWDModel.json +14 -0
- package/json-schema/Object.json +428 -0
- package/json-schema/ObjectCapabilities.json +62 -0
- package/json-schema/ObjectNavItem.json +46 -0
- package/json-schema/ObjectPermission.json +42 -0
- package/json-schema/ObjectQLClient.json +12 -0
- package/json-schema/Page.json +117 -0
- package/json-schema/PageComponent.json +36 -0
- package/json-schema/PageNavItem.json +47 -0
- package/json-schema/PageRegion.json +63 -0
- package/json-schema/PasswordPolicy.json +41 -0
- package/json-schema/PermissionSet.json +96 -0
- package/json-schema/Plan.json +53 -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/Policy.json +138 -0
- package/json-schema/Query.json +456 -0
- package/json-schema/RateLimit.json +26 -0
- package/json-schema/RecordData.json +11 -0
- package/json-schema/Report.json +219 -0
- package/json-schema/ReportChart.json +45 -0
- package/json-schema/ReportColumn.json +35 -0
- package/json-schema/ReportGrouping.json +38 -0
- package/json-schema/ReportType.json +15 -0
- package/json-schema/Role.json +32 -0
- package/json-schema/Router.json +12 -0
- package/json-schema/SAMLConfig.json +44 -0
- package/json-schema/Scheduler.json +12 -0
- package/json-schema/ScopedStorage.json +12 -0
- package/json-schema/ScriptValidation.json +48 -0
- package/json-schema/SelectOption.json +32 -0
- package/json-schema/SessionPolicy.json +27 -0
- package/json-schema/Shadow.json +44 -0
- package/json-schema/SharingLevel.json +13 -0
- package/json-schema/SharingRule.json +58 -0
- package/json-schema/SharingRuleType.json +15 -0
- package/json-schema/SingleRecordResponse.json +69 -0
- package/json-schema/SortNode.json +26 -0
- package/json-schema/Spacing.json +64 -0
- package/json-schema/StateMachineValidation.json +59 -0
- package/json-schema/SystemAPI.json +12 -0
- package/json-schema/Territory.json +77 -0
- package/json-schema/TerritoryModel.json +34 -0
- package/json-schema/TerritoryType.json +15 -0
- package/json-schema/Theme.json +543 -0
- package/json-schema/ThemeMode.json +14 -0
- package/json-schema/TransformType.json +18 -0
- package/json-schema/TranslationBundle.json +78 -0
- package/json-schema/TranslationData.json +75 -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/UniquenessValidation.json +59 -0
- package/json-schema/UpdateRequest.json +20 -0
- package/json-schema/UrlNavItem.json +51 -0
- package/json-schema/ValidationRule.json +794 -0
- package/json-schema/View.json +500 -0
- package/json-schema/Webhook.json +88 -0
- package/json-schema/WebhookReceiver.json +66 -0
- package/json-schema/WebhookTriggerType.json +16 -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/WorkflowAction.json +84 -0
- package/json-schema/WorkflowRule.json +128 -0
- package/json-schema/WorkflowTriggerType.json +16 -0
- package/json-schema/ZIndex.json +44 -0
- package/package.json +34 -20
- package/dist/examples.d.ts +0 -28
- package/dist/examples.d.ts.map +0 -1
- package/dist/examples.js +0 -250
- package/dist/types/index.d.ts +0 -9
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -8
- package/dist/types/meta/field-type.d.ts +0 -54
- package/dist/types/meta/field-type.d.ts.map +0 -1
- package/dist/types/meta/field-type.js +0 -42
- package/dist/types/meta/index.d.ts +0 -13
- package/dist/types/meta/index.d.ts.map +0 -1
- package/dist/types/meta/index.js +0 -12
- package/dist/types/meta/object-entity.d.ts +0 -246
- package/dist/types/meta/object-entity.d.ts.map +0 -1
- package/dist/types/meta/object-entity.js +0 -9
- package/dist/types/meta/object-field.d.ts +0 -199
- package/dist/types/meta/object-field.d.ts.map +0 -1
- package/dist/types/meta/object-field.js +0 -9
- package/dist/types/meta/object-view.d.ts +0 -430
- package/dist/types/meta/object-view.d.ts.map +0 -1
- package/dist/types/meta/object-view.js +0 -9
- package/src/examples.ts +0 -257
- package/src/index.ts +0 -10
- package/src/types/index.ts +0 -9
- package/src/types/meta/field-type.ts +0 -91
- package/src/types/meta/index.ts +0 -13
- package/src/types/meta/object-entity.ts +0 -265
- package/src/types/meta/object-field.ts +0 -218
- package/src/types/meta/object-view.ts +0 -475
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Authentication Protocol
|
|
4
|
+
* Defines supported authentication standards (OIDC, SAML, LDAP).
|
|
5
|
+
*/
|
|
6
|
+
export declare const AuthProtocol: z.ZodEnum<["oidc", "saml", "ldap", "oauth2", "local", "mock"]>;
|
|
7
|
+
/**
|
|
8
|
+
* OIDC / OAuth2 Config (Standard)
|
|
9
|
+
*/
|
|
10
|
+
export declare const OIDCConfigSchema: z.ZodObject<{
|
|
11
|
+
issuer: z.ZodString;
|
|
12
|
+
clientId: z.ZodString;
|
|
13
|
+
clientSecret: z.ZodString;
|
|
14
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
issuer: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
clientSecret: string;
|
|
20
|
+
scopes: string[];
|
|
21
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
issuer: string;
|
|
24
|
+
clientId: string;
|
|
25
|
+
clientSecret: string;
|
|
26
|
+
scopes?: string[] | undefined;
|
|
27
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* SAML 2.0 Config (Enterprise)
|
|
31
|
+
*/
|
|
32
|
+
export declare const SAMLConfigSchema: z.ZodObject<{
|
|
33
|
+
entryPoint: z.ZodString;
|
|
34
|
+
cert: z.ZodString;
|
|
35
|
+
issuer: z.ZodString;
|
|
36
|
+
signatureAlgorithm: z.ZodDefault<z.ZodEnum<["sha256", "sha512"]>>;
|
|
37
|
+
attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
issuer: string;
|
|
40
|
+
entryPoint: string;
|
|
41
|
+
cert: string;
|
|
42
|
+
signatureAlgorithm: "sha256" | "sha512";
|
|
43
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
issuer: string;
|
|
46
|
+
entryPoint: string;
|
|
47
|
+
cert: string;
|
|
48
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
49
|
+
signatureAlgorithm?: "sha256" | "sha512" | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* LDAP / AD Config (On-premise)
|
|
53
|
+
*/
|
|
54
|
+
export declare const LDAPConfigSchema: z.ZodObject<{
|
|
55
|
+
url: z.ZodString;
|
|
56
|
+
bindDn: z.ZodString;
|
|
57
|
+
bindCredentials: z.ZodString;
|
|
58
|
+
searchBase: z.ZodString;
|
|
59
|
+
searchFilter: z.ZodString;
|
|
60
|
+
groupSearchBase: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
url: string;
|
|
63
|
+
bindDn: string;
|
|
64
|
+
bindCredentials: string;
|
|
65
|
+
searchBase: string;
|
|
66
|
+
searchFilter: string;
|
|
67
|
+
groupSearchBase?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
url: string;
|
|
70
|
+
bindDn: string;
|
|
71
|
+
bindCredentials: string;
|
|
72
|
+
searchBase: string;
|
|
73
|
+
searchFilter: string;
|
|
74
|
+
groupSearchBase?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Identity Provider (IdP) Schema
|
|
78
|
+
* Connects the OS to an external source of truth for identities.
|
|
79
|
+
*/
|
|
80
|
+
export declare const AuthProviderSchema: z.ZodObject<{
|
|
81
|
+
name: z.ZodString;
|
|
82
|
+
label: z.ZodString;
|
|
83
|
+
type: z.ZodEnum<["oidc", "saml", "ldap", "oauth2", "local", "mock"]>;
|
|
84
|
+
/** Configuration (Polymorphic based on type) */
|
|
85
|
+
config: z.ZodUnion<[z.ZodObject<{
|
|
86
|
+
issuer: z.ZodString;
|
|
87
|
+
clientId: z.ZodString;
|
|
88
|
+
clientSecret: z.ZodString;
|
|
89
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
90
|
+
attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
issuer: string;
|
|
93
|
+
clientId: string;
|
|
94
|
+
clientSecret: string;
|
|
95
|
+
scopes: string[];
|
|
96
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
issuer: string;
|
|
99
|
+
clientId: string;
|
|
100
|
+
clientSecret: string;
|
|
101
|
+
scopes?: string[] | undefined;
|
|
102
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
103
|
+
}>, z.ZodObject<{
|
|
104
|
+
entryPoint: z.ZodString;
|
|
105
|
+
cert: z.ZodString;
|
|
106
|
+
issuer: z.ZodString;
|
|
107
|
+
signatureAlgorithm: z.ZodDefault<z.ZodEnum<["sha256", "sha512"]>>;
|
|
108
|
+
attributeMapping: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
issuer: string;
|
|
111
|
+
entryPoint: string;
|
|
112
|
+
cert: string;
|
|
113
|
+
signatureAlgorithm: "sha256" | "sha512";
|
|
114
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
issuer: string;
|
|
117
|
+
entryPoint: string;
|
|
118
|
+
cert: string;
|
|
119
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
120
|
+
signatureAlgorithm?: "sha256" | "sha512" | undefined;
|
|
121
|
+
}>, z.ZodObject<{
|
|
122
|
+
url: z.ZodString;
|
|
123
|
+
bindDn: z.ZodString;
|
|
124
|
+
bindCredentials: z.ZodString;
|
|
125
|
+
searchBase: z.ZodString;
|
|
126
|
+
searchFilter: z.ZodString;
|
|
127
|
+
groupSearchBase: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
url: string;
|
|
130
|
+
bindDn: string;
|
|
131
|
+
bindCredentials: string;
|
|
132
|
+
searchBase: string;
|
|
133
|
+
searchFilter: string;
|
|
134
|
+
groupSearchBase?: string | undefined;
|
|
135
|
+
}, {
|
|
136
|
+
url: string;
|
|
137
|
+
bindDn: string;
|
|
138
|
+
bindCredentials: string;
|
|
139
|
+
searchBase: string;
|
|
140
|
+
searchFilter: string;
|
|
141
|
+
groupSearchBase?: string | undefined;
|
|
142
|
+
}>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
143
|
+
/** Visuals */
|
|
144
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
145
|
+
/** Policies */
|
|
146
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
147
|
+
registrationEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
type: "local" | "oidc" | "saml" | "ldap" | "oauth2" | "mock";
|
|
150
|
+
label: string;
|
|
151
|
+
name: string;
|
|
152
|
+
active: boolean;
|
|
153
|
+
config: Record<string, any> | {
|
|
154
|
+
issuer: string;
|
|
155
|
+
clientId: string;
|
|
156
|
+
clientSecret: string;
|
|
157
|
+
scopes: string[];
|
|
158
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
159
|
+
} | {
|
|
160
|
+
issuer: string;
|
|
161
|
+
entryPoint: string;
|
|
162
|
+
cert: string;
|
|
163
|
+
signatureAlgorithm: "sha256" | "sha512";
|
|
164
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
165
|
+
} | {
|
|
166
|
+
url: string;
|
|
167
|
+
bindDn: string;
|
|
168
|
+
bindCredentials: string;
|
|
169
|
+
searchBase: string;
|
|
170
|
+
searchFilter: string;
|
|
171
|
+
groupSearchBase?: string | undefined;
|
|
172
|
+
};
|
|
173
|
+
registrationEnabled: boolean;
|
|
174
|
+
icon?: string | undefined;
|
|
175
|
+
}, {
|
|
176
|
+
type: "local" | "oidc" | "saml" | "ldap" | "oauth2" | "mock";
|
|
177
|
+
label: string;
|
|
178
|
+
name: string;
|
|
179
|
+
config: Record<string, any> | {
|
|
180
|
+
issuer: string;
|
|
181
|
+
clientId: string;
|
|
182
|
+
clientSecret: string;
|
|
183
|
+
scopes?: string[] | undefined;
|
|
184
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
185
|
+
} | {
|
|
186
|
+
issuer: string;
|
|
187
|
+
entryPoint: string;
|
|
188
|
+
cert: string;
|
|
189
|
+
attributeMapping?: Record<string, string> | undefined;
|
|
190
|
+
signatureAlgorithm?: "sha256" | "sha512" | undefined;
|
|
191
|
+
} | {
|
|
192
|
+
url: string;
|
|
193
|
+
bindDn: string;
|
|
194
|
+
bindCredentials: string;
|
|
195
|
+
searchBase: string;
|
|
196
|
+
searchFilter: string;
|
|
197
|
+
groupSearchBase?: string | undefined;
|
|
198
|
+
};
|
|
199
|
+
icon?: string | undefined;
|
|
200
|
+
active?: boolean | undefined;
|
|
201
|
+
registrationEnabled?: boolean | undefined;
|
|
202
|
+
}>;
|
|
203
|
+
export type AuthProvider = z.infer<typeof AuthProviderSchema>;
|
|
204
|
+
//# sourceMappingURL=identity.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.zod.d.ts","sourceRoot":"","sources":["../../src/system/identity.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY,gEAOvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAO3B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;IAK7B,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAQhD,cAAc;;IAGd,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGf,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthProviderSchema = exports.LDAPConfigSchema = exports.SAMLConfigSchema = exports.OIDCConfigSchema = exports.AuthProtocol = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Authentication Protocol
|
|
7
|
+
* Defines supported authentication standards (OIDC, SAML, LDAP).
|
|
8
|
+
*/
|
|
9
|
+
exports.AuthProtocol = zod_1.z.enum([
|
|
10
|
+
'oidc', // OpenID Connect (Modern standard)
|
|
11
|
+
'saml', // SAML 2.0 (Legacy Enterprise)
|
|
12
|
+
'ldap', // LDAP/Active Directory (On-premise)
|
|
13
|
+
'oauth2', // Generic OAuth2
|
|
14
|
+
'local', // Database username/password
|
|
15
|
+
'mock' // Testing
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* OIDC / OAuth2 Config (Standard)
|
|
19
|
+
*/
|
|
20
|
+
exports.OIDCConfigSchema = zod_1.z.object({
|
|
21
|
+
issuer: zod_1.z.string().url().describe('OIDC Issuer URL (.well-known/openid-configuration)'),
|
|
22
|
+
clientId: zod_1.z.string(),
|
|
23
|
+
clientSecret: zod_1.z.string(), // Usually value is ENV reference
|
|
24
|
+
scopes: zod_1.z.array(zod_1.z.string()).default(['openid', 'profile', 'email']),
|
|
25
|
+
attributeMapping: zod_1.z.record(zod_1.z.string()).optional().describe('Map IdP claims to User fields'),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* SAML 2.0 Config (Enterprise)
|
|
29
|
+
*/
|
|
30
|
+
exports.SAMLConfigSchema = zod_1.z.object({
|
|
31
|
+
entryPoint: zod_1.z.string().url().describe('IdP SSO URL'),
|
|
32
|
+
cert: zod_1.z.string().describe('IdP Public Certificate'), // PEM format
|
|
33
|
+
issuer: zod_1.z.string().describe('Entity ID of the IdP'),
|
|
34
|
+
signatureAlgorithm: zod_1.z.enum(['sha256', 'sha512']).default('sha256'),
|
|
35
|
+
attributeMapping: zod_1.z.record(zod_1.z.string()).optional(),
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* LDAP / AD Config (On-premise)
|
|
39
|
+
*/
|
|
40
|
+
exports.LDAPConfigSchema = zod_1.z.object({
|
|
41
|
+
url: zod_1.z.string().url().describe('LDAP Server URL (ldap:// or ldaps://)'),
|
|
42
|
+
bindDn: zod_1.z.string(),
|
|
43
|
+
bindCredentials: zod_1.z.string(),
|
|
44
|
+
searchBase: zod_1.z.string(),
|
|
45
|
+
searchFilter: zod_1.z.string(),
|
|
46
|
+
groupSearchBase: zod_1.z.string().optional(),
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Identity Provider (IdP) Schema
|
|
50
|
+
* Connects the OS to an external source of truth for identities.
|
|
51
|
+
*/
|
|
52
|
+
exports.AuthProviderSchema = zod_1.z.object({
|
|
53
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Provider ID'),
|
|
54
|
+
label: zod_1.z.string().describe('Button Label (e.g. "Login with Okta")'),
|
|
55
|
+
type: exports.AuthProtocol,
|
|
56
|
+
/** Configuration (Polymorphic based on type) */
|
|
57
|
+
config: zod_1.z.union([
|
|
58
|
+
exports.OIDCConfigSchema,
|
|
59
|
+
exports.SAMLConfigSchema,
|
|
60
|
+
exports.LDAPConfigSchema,
|
|
61
|
+
zod_1.z.record(zod_1.z.any()) // Fallback
|
|
62
|
+
]).describe('Provider specific configuration'),
|
|
63
|
+
/** Visuals */
|
|
64
|
+
icon: zod_1.z.string().optional().describe('Icon URL or helper class'),
|
|
65
|
+
/** Policies */
|
|
66
|
+
active: zod_1.z.boolean().default(true),
|
|
67
|
+
registrationEnabled: zod_1.z.boolean().default(false).describe('Allow new users to sign up via this provider'),
|
|
68
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Metric Type Classification
|
|
4
|
+
*/
|
|
5
|
+
export declare const MetricType: z.ZodEnum<["boolean", "counter", "gauge"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Feature/Limit Definition Schema
|
|
8
|
+
* Defines a controllable capability of the system.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FeatureSchema: z.ZodObject<{
|
|
11
|
+
code: z.ZodString;
|
|
12
|
+
label: z.ZodString;
|
|
13
|
+
description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
type: z.ZodDefault<z.ZodEnum<["boolean", "counter", "gauge"]>>;
|
|
15
|
+
/** For counters/gauges */
|
|
16
|
+
unit: z.ZodOptional<z.ZodEnum<["count", "bytes", "seconds", "percent"]>>;
|
|
17
|
+
/** Dependencies (e.g. 'audit_log' requires 'enterprise_tier') */
|
|
18
|
+
requires: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
code: string;
|
|
21
|
+
type: "boolean" | "counter" | "gauge";
|
|
22
|
+
label: string;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
unit?: "percent" | "count" | "bytes" | "seconds" | undefined;
|
|
25
|
+
requires?: string[] | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
code: string;
|
|
28
|
+
label: string;
|
|
29
|
+
type?: "boolean" | "counter" | "gauge" | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
unit?: "percent" | "count" | "bytes" | "seconds" | undefined;
|
|
32
|
+
requires?: string[] | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Subscription Plan Schema
|
|
36
|
+
* Defines a tier of service (e.g. "Free", "Pro", "Enterprise").
|
|
37
|
+
*/
|
|
38
|
+
export declare const PlanSchema: z.ZodObject<{
|
|
39
|
+
code: z.ZodString;
|
|
40
|
+
label: z.ZodString;
|
|
41
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
42
|
+
/** Feature Entitlements */
|
|
43
|
+
features: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
/** Limit Quotas */
|
|
45
|
+
limits: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
46
|
+
/** Pricing (Optional Metadata) */
|
|
47
|
+
currency: z.ZodOptional<z.ZodDefault<z.ZodString>>;
|
|
48
|
+
priceMonthly: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
priceYearly: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
code: string;
|
|
52
|
+
label: string;
|
|
53
|
+
active: boolean;
|
|
54
|
+
features: string[];
|
|
55
|
+
limits: Record<string, number>;
|
|
56
|
+
currency?: string | undefined;
|
|
57
|
+
priceMonthly?: number | undefined;
|
|
58
|
+
priceYearly?: number | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
code: string;
|
|
61
|
+
label: string;
|
|
62
|
+
features: string[];
|
|
63
|
+
limits: Record<string, number>;
|
|
64
|
+
currency?: string | undefined;
|
|
65
|
+
active?: boolean | undefined;
|
|
66
|
+
priceMonthly?: number | undefined;
|
|
67
|
+
priceYearly?: number | undefined;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* License Schema
|
|
71
|
+
* The actual entitlement object assigned to a Tenant.
|
|
72
|
+
* Often signed as a JWT.
|
|
73
|
+
*/
|
|
74
|
+
export declare const LicenseSchema: z.ZodObject<{
|
|
75
|
+
/** Identity */
|
|
76
|
+
tenantId: z.ZodString;
|
|
77
|
+
planCode: z.ZodString;
|
|
78
|
+
/** Validity */
|
|
79
|
+
issuedAt: z.ZodString;
|
|
80
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
81
|
+
/** Status */
|
|
82
|
+
status: z.ZodEnum<["active", "expired", "suspended", "trial"]>;
|
|
83
|
+
/** Overrides (Specific to this tenant, exceeding the plan) */
|
|
84
|
+
customFeatures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
|
+
customLimits: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
86
|
+
/** Signature */
|
|
87
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
status: "active" | "expired" | "suspended" | "trial";
|
|
90
|
+
tenantId: string;
|
|
91
|
+
planCode: string;
|
|
92
|
+
issuedAt: string;
|
|
93
|
+
signature?: string | undefined;
|
|
94
|
+
expiresAt?: string | undefined;
|
|
95
|
+
customFeatures?: string[] | undefined;
|
|
96
|
+
customLimits?: Record<string, number> | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
status: "active" | "expired" | "suspended" | "trial";
|
|
99
|
+
tenantId: string;
|
|
100
|
+
planCode: string;
|
|
101
|
+
issuedAt: string;
|
|
102
|
+
signature?: string | undefined;
|
|
103
|
+
expiresAt?: string | undefined;
|
|
104
|
+
customFeatures?: string[] | undefined;
|
|
105
|
+
customLimits?: Record<string, number> | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
export type Feature = z.infer<typeof FeatureSchema>;
|
|
108
|
+
export type Plan = z.infer<typeof PlanSchema>;
|
|
109
|
+
export type License = z.infer<typeof LicenseSchema>;
|
|
110
|
+
//# sourceMappingURL=license.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.zod.d.ts","sourceRoot":"","sources":["../../src/system/license.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,UAAU,4CAIrB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;IAOxB,0BAA0B;;IAG1B,iEAAiE;;;;;;;;;;;;;;;;EAEjE,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;IAKrB,2BAA2B;;IAG3B,mBAAmB;;IAGnB,kCAAkC;;;;;;;;;;;;;;;;;;;;;;EAIlC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa;IACxB,eAAe;;;IAIf,eAAe;;;IAIf,aAAa;;IAGb,8DAA8D;;;IAI9D,gBAAgB;;;;;;;;;;;;;;;;;;;;EAEhB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|