@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":"field.zod.d.ts","sourceRoot":"","sources":["../../src/data/field.zod.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Field = exports.FieldSchema = exports.AddressSchema = exports.LocationCoordinatesSchema = exports.SelectOptionSchema = exports.FieldType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Field Type Enum
|
|
7
|
+
*/
|
|
8
|
+
exports.FieldType = zod_1.z.enum([
|
|
9
|
+
// Core Text
|
|
10
|
+
'text', 'textarea', 'email', 'url', 'phone', 'password',
|
|
11
|
+
// Rich Content
|
|
12
|
+
'markdown', 'html', 'richtext',
|
|
13
|
+
// Numbers
|
|
14
|
+
'number', 'currency', 'percent',
|
|
15
|
+
// Date & Time
|
|
16
|
+
'date', 'datetime', 'time',
|
|
17
|
+
// Logic
|
|
18
|
+
'boolean',
|
|
19
|
+
// Selection
|
|
20
|
+
'select', // Static options
|
|
21
|
+
// Relational
|
|
22
|
+
'lookup', 'master_detail', // Dynamic reference to other objects
|
|
23
|
+
// Media
|
|
24
|
+
'image', 'file', 'avatar',
|
|
25
|
+
// Calculated / System
|
|
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
|
|
34
|
+
]);
|
|
35
|
+
/**
|
|
36
|
+
* Select Option Schema
|
|
37
|
+
*/
|
|
38
|
+
exports.SelectOptionSchema = zod_1.z.object({
|
|
39
|
+
label: zod_1.z.string().describe('Display label'),
|
|
40
|
+
value: zod_1.z.string().describe('Stored value'),
|
|
41
|
+
color: zod_1.z.string().optional().describe('Color code for badges/charts'),
|
|
42
|
+
default: zod_1.z.boolean().optional().describe('Is default option'),
|
|
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
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Field Schema - Best Practice Enterprise Pattern
|
|
69
|
+
*/
|
|
70
|
+
exports.FieldSchema = zod_1.z.object({
|
|
71
|
+
/** Identity */
|
|
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'),
|
|
74
|
+
type: exports.FieldType.describe('Field Data Type'),
|
|
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)'),
|
|
77
|
+
/** Database Constraints */
|
|
78
|
+
required: zod_1.z.boolean().default(false).describe('Is required'),
|
|
79
|
+
searchable: zod_1.z.boolean().default(false).describe('Is searchable'),
|
|
80
|
+
multiple: zod_1.z.boolean().default(false).describe('Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.'),
|
|
81
|
+
unique: zod_1.z.boolean().default(false).describe('Is unique constraint'),
|
|
82
|
+
defaultValue: zod_1.z.any().optional().describe('Default value'),
|
|
83
|
+
/** Text/String Constraints */
|
|
84
|
+
maxLength: zod_1.z.number().optional().describe('Max character length'),
|
|
85
|
+
minLength: zod_1.z.number().optional().describe('Min character length'),
|
|
86
|
+
/** Number Constraints */
|
|
87
|
+
precision: zod_1.z.number().optional().describe('Total digits'),
|
|
88
|
+
scale: zod_1.z.number().optional().describe('Decimal places'),
|
|
89
|
+
min: zod_1.z.number().optional().describe('Minimum value'),
|
|
90
|
+
max: zod_1.z.number().optional().describe('Maximum value'),
|
|
91
|
+
/** Selection Options */
|
|
92
|
+
options: zod_1.z.array(exports.SelectOptionSchema).optional().describe('Static options for select/multiselect'),
|
|
93
|
+
/** Relationship Config */
|
|
94
|
+
reference: zod_1.z.string().optional().describe('Target Object Name'),
|
|
95
|
+
referenceFilters: zod_1.z.array(zod_1.z.string()).optional().describe('Filters applied to lookup dialogs (e.g. "active = true")'),
|
|
96
|
+
writeRequiresMasterRead: zod_1.z.boolean().optional().describe('If true, user needs read access to master record to edit this field'),
|
|
97
|
+
deleteBehavior: zod_1.z.enum(['set_null', 'cascade', 'restrict']).optional().default('set_null').describe('What happens if referenced record is deleted'),
|
|
98
|
+
/** Calculation */
|
|
99
|
+
expression: zod_1.z.string().optional().describe('Formula expression'),
|
|
100
|
+
formula: zod_1.z.string().optional().describe('Deprecated: Use expression'),
|
|
101
|
+
summaryOperations: zod_1.z.object({
|
|
102
|
+
object: zod_1.z.string(),
|
|
103
|
+
field: zod_1.z.string(),
|
|
104
|
+
function: zod_1.z.enum(['count', 'sum', 'min', 'max', 'avg'])
|
|
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'),
|
|
123
|
+
/** Security & Visibility */
|
|
124
|
+
hidden: zod_1.z.boolean().default(false).describe('Hidden from default UI'),
|
|
125
|
+
readonly: zod_1.z.boolean().default(false).describe('Read-only in UI'),
|
|
126
|
+
encryption: zod_1.z.boolean().default(false).describe('Encrypt at rest'),
|
|
127
|
+
/** Indexing */
|
|
128
|
+
index: zod_1.z.boolean().default(false).describe('Create standard database index'),
|
|
129
|
+
externalId: zod_1.z.boolean().default(false).describe('Is external ID for upsert operations'),
|
|
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,242 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Flow Node Types
|
|
4
|
+
*/
|
|
5
|
+
export declare const FlowNodeAction: z.ZodEnum<["start", "end", "decision", "assignment", "loop", "create_record", "update_record", "delete_record", "get_record", "http_request", "script", "wait", "subflow"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Flow Variable Schema
|
|
8
|
+
* Variables available within the flow execution context.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FlowVariableSchema: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
type: z.ZodString;
|
|
13
|
+
isInput: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
isOutput: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
type: string;
|
|
17
|
+
name: string;
|
|
18
|
+
isInput: boolean;
|
|
19
|
+
isOutput: boolean;
|
|
20
|
+
}, {
|
|
21
|
+
type: string;
|
|
22
|
+
name: string;
|
|
23
|
+
isInput?: boolean | undefined;
|
|
24
|
+
isOutput?: boolean | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Flow Node Schema
|
|
28
|
+
* A single step in the visual logic graph.
|
|
29
|
+
*/
|
|
30
|
+
export declare const FlowNodeSchema: z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
type: z.ZodEnum<["start", "end", "decision", "assignment", "loop", "create_record", "update_record", "delete_record", "get_record", "http_request", "script", "wait", "subflow"]>;
|
|
33
|
+
label: z.ZodString;
|
|
34
|
+
/** Node Configuration Options (Specific to type) */
|
|
35
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
36
|
+
/** UI Position (for the canvas) */
|
|
37
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
38
|
+
x: z.ZodNumber;
|
|
39
|
+
y: z.ZodNumber;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
}, {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
}>>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
49
|
+
label: string;
|
|
50
|
+
id: string;
|
|
51
|
+
config?: Record<string, any> | undefined;
|
|
52
|
+
position?: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
58
|
+
label: string;
|
|
59
|
+
id: string;
|
|
60
|
+
config?: Record<string, any> | undefined;
|
|
61
|
+
position?: {
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
} | undefined;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Flow Edge Schema
|
|
68
|
+
* Connections between nodes.
|
|
69
|
+
*/
|
|
70
|
+
export declare const FlowEdgeSchema: z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
source: z.ZodString;
|
|
73
|
+
target: z.ZodString;
|
|
74
|
+
/** Condition for this path (only for decision/branch nodes) */
|
|
75
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
76
|
+
label: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
id: string;
|
|
79
|
+
source: string;
|
|
80
|
+
target: string;
|
|
81
|
+
label?: string | undefined;
|
|
82
|
+
condition?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
id: string;
|
|
85
|
+
source: string;
|
|
86
|
+
target: string;
|
|
87
|
+
label?: string | undefined;
|
|
88
|
+
condition?: string | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Flow Schema
|
|
92
|
+
* Visual Business Logic Orchestration.
|
|
93
|
+
*/
|
|
94
|
+
export declare const FlowSchema: z.ZodObject<{
|
|
95
|
+
/** Identity */
|
|
96
|
+
name: z.ZodString;
|
|
97
|
+
label: z.ZodString;
|
|
98
|
+
description: z.ZodOptional<z.ZodString>;
|
|
99
|
+
/** Trigger Type */
|
|
100
|
+
type: z.ZodEnum<["autolaunched", "record_change", "schedule", "screen", "api"]>;
|
|
101
|
+
/** Configuration Variables */
|
|
102
|
+
variables: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
type: z.ZodString;
|
|
105
|
+
isInput: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
isOutput: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
type: string;
|
|
109
|
+
name: string;
|
|
110
|
+
isInput: boolean;
|
|
111
|
+
isOutput: boolean;
|
|
112
|
+
}, {
|
|
113
|
+
type: string;
|
|
114
|
+
name: string;
|
|
115
|
+
isInput?: boolean | undefined;
|
|
116
|
+
isOutput?: boolean | undefined;
|
|
117
|
+
}>, "many">>;
|
|
118
|
+
/** Graph Definition */
|
|
119
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
type: z.ZodEnum<["start", "end", "decision", "assignment", "loop", "create_record", "update_record", "delete_record", "get_record", "http_request", "script", "wait", "subflow"]>;
|
|
122
|
+
label: z.ZodString;
|
|
123
|
+
/** Node Configuration Options (Specific to type) */
|
|
124
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
125
|
+
/** UI Position (for the canvas) */
|
|
126
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
x: z.ZodNumber;
|
|
128
|
+
y: z.ZodNumber;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
x: number;
|
|
131
|
+
y: number;
|
|
132
|
+
}, {
|
|
133
|
+
x: number;
|
|
134
|
+
y: number;
|
|
135
|
+
}>>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
138
|
+
label: string;
|
|
139
|
+
id: string;
|
|
140
|
+
config?: Record<string, any> | undefined;
|
|
141
|
+
position?: {
|
|
142
|
+
x: number;
|
|
143
|
+
y: number;
|
|
144
|
+
} | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
147
|
+
label: string;
|
|
148
|
+
id: string;
|
|
149
|
+
config?: Record<string, any> | undefined;
|
|
150
|
+
position?: {
|
|
151
|
+
x: number;
|
|
152
|
+
y: number;
|
|
153
|
+
} | undefined;
|
|
154
|
+
}>, "many">;
|
|
155
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
source: z.ZodString;
|
|
158
|
+
target: z.ZodString;
|
|
159
|
+
/** Condition for this path (only for decision/branch nodes) */
|
|
160
|
+
condition: z.ZodOptional<z.ZodString>;
|
|
161
|
+
label: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
id: string;
|
|
164
|
+
source: string;
|
|
165
|
+
target: string;
|
|
166
|
+
label?: string | undefined;
|
|
167
|
+
condition?: string | undefined;
|
|
168
|
+
}, {
|
|
169
|
+
id: string;
|
|
170
|
+
source: string;
|
|
171
|
+
target: string;
|
|
172
|
+
label?: string | undefined;
|
|
173
|
+
condition?: string | undefined;
|
|
174
|
+
}>, "many">;
|
|
175
|
+
/** Execution Config */
|
|
176
|
+
active: z.ZodDefault<z.ZodBoolean>;
|
|
177
|
+
runAs: z.ZodDefault<z.ZodEnum<["system", "user"]>>;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
type: "schedule" | "autolaunched" | "record_change" | "screen" | "api";
|
|
180
|
+
label: string;
|
|
181
|
+
name: string;
|
|
182
|
+
active: boolean;
|
|
183
|
+
nodes: {
|
|
184
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
185
|
+
label: string;
|
|
186
|
+
id: string;
|
|
187
|
+
config?: Record<string, any> | undefined;
|
|
188
|
+
position?: {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
} | undefined;
|
|
192
|
+
}[];
|
|
193
|
+
edges: {
|
|
194
|
+
id: string;
|
|
195
|
+
source: string;
|
|
196
|
+
target: string;
|
|
197
|
+
label?: string | undefined;
|
|
198
|
+
condition?: string | undefined;
|
|
199
|
+
}[];
|
|
200
|
+
runAs: "system" | "user";
|
|
201
|
+
description?: string | undefined;
|
|
202
|
+
variables?: {
|
|
203
|
+
type: string;
|
|
204
|
+
name: string;
|
|
205
|
+
isInput: boolean;
|
|
206
|
+
isOutput: boolean;
|
|
207
|
+
}[] | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
type: "schedule" | "autolaunched" | "record_change" | "screen" | "api";
|
|
210
|
+
label: string;
|
|
211
|
+
name: string;
|
|
212
|
+
nodes: {
|
|
213
|
+
type: "script" | "start" | "end" | "decision" | "assignment" | "loop" | "create_record" | "update_record" | "delete_record" | "get_record" | "http_request" | "wait" | "subflow";
|
|
214
|
+
label: string;
|
|
215
|
+
id: string;
|
|
216
|
+
config?: Record<string, any> | undefined;
|
|
217
|
+
position?: {
|
|
218
|
+
x: number;
|
|
219
|
+
y: number;
|
|
220
|
+
} | undefined;
|
|
221
|
+
}[];
|
|
222
|
+
edges: {
|
|
223
|
+
id: string;
|
|
224
|
+
source: string;
|
|
225
|
+
target: string;
|
|
226
|
+
label?: string | undefined;
|
|
227
|
+
condition?: string | undefined;
|
|
228
|
+
}[];
|
|
229
|
+
description?: string | undefined;
|
|
230
|
+
active?: boolean | undefined;
|
|
231
|
+
variables?: {
|
|
232
|
+
type: string;
|
|
233
|
+
name: string;
|
|
234
|
+
isInput?: boolean | undefined;
|
|
235
|
+
isOutput?: boolean | undefined;
|
|
236
|
+
}[] | undefined;
|
|
237
|
+
runAs?: "system" | "user" | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
export type Flow = z.infer<typeof FlowSchema>;
|
|
240
|
+
export type FlowNode = z.infer<typeof FlowNodeSchema>;
|
|
241
|
+
export type FlowEdge = z.infer<typeof FlowEdgeSchema>;
|
|
242
|
+
//# sourceMappingURL=flow.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.zod.d.ts","sourceRoot":"","sources":["../../src/data/flow.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc,6KAczB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;IAKzB,oDAAoD;;IAGpD,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;IAKzB,+DAA+D;;;;;;;;;;;;;;;EAI/D,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,UAAU;IACrB,eAAe;;;;IAKf,mBAAmB;;IAGnB,8BAA8B;;;;;;;;;;;;;;;;;IAG9B,uBAAuB;;;;;QAtCvB,oDAAoD;;QAGpD,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAanC,+DAA+D;;;;;;;;;;;;;;;;IA0B/D,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowSchema = exports.FlowEdgeSchema = exports.FlowNodeSchema = exports.FlowVariableSchema = exports.FlowNodeAction = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Flow Node Types
|
|
7
|
+
*/
|
|
8
|
+
exports.FlowNodeAction = zod_1.z.enum([
|
|
9
|
+
'start', // Trigger
|
|
10
|
+
'end', // Return/Stop
|
|
11
|
+
'decision', // If/Else logic
|
|
12
|
+
'assignment', // Set Variable
|
|
13
|
+
'loop', // For Each
|
|
14
|
+
'create_record', // CRUD: Create
|
|
15
|
+
'update_record', // CRUD: Update
|
|
16
|
+
'delete_record', // CRUD: Delete
|
|
17
|
+
'get_record', // CRUD: Get/Query
|
|
18
|
+
'http_request', // Webhook/API Call
|
|
19
|
+
'script', // Custom Script (JS/TS)
|
|
20
|
+
'wait', // Delay/Sleep
|
|
21
|
+
'subflow' // Call another flow
|
|
22
|
+
]);
|
|
23
|
+
/**
|
|
24
|
+
* Flow Variable Schema
|
|
25
|
+
* Variables available within the flow execution context.
|
|
26
|
+
*/
|
|
27
|
+
exports.FlowVariableSchema = zod_1.z.object({
|
|
28
|
+
name: zod_1.z.string().describe('Variable name'),
|
|
29
|
+
type: zod_1.z.string().describe('Data type (text, number, boolean, object, list)'),
|
|
30
|
+
isInput: zod_1.z.boolean().default(false).describe('Is input parameter'),
|
|
31
|
+
isOutput: zod_1.z.boolean().default(false).describe('Is output parameter'),
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Flow Node Schema
|
|
35
|
+
* A single step in the visual logic graph.
|
|
36
|
+
*/
|
|
37
|
+
exports.FlowNodeSchema = zod_1.z.object({
|
|
38
|
+
id: zod_1.z.string().describe('Node unique ID'),
|
|
39
|
+
type: exports.FlowNodeAction.describe('Action type'),
|
|
40
|
+
label: zod_1.z.string().describe('Node label'),
|
|
41
|
+
/** Node Configuration Options (Specific to type) */
|
|
42
|
+
config: zod_1.z.record(zod_1.z.any()).optional().describe('Node configuration'),
|
|
43
|
+
/** UI Position (for the canvas) */
|
|
44
|
+
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number() }).optional(),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Flow Edge Schema
|
|
48
|
+
* Connections between nodes.
|
|
49
|
+
*/
|
|
50
|
+
exports.FlowEdgeSchema = zod_1.z.object({
|
|
51
|
+
id: zod_1.z.string().describe('Edge unique ID'),
|
|
52
|
+
source: zod_1.z.string().describe('Source Node ID'),
|
|
53
|
+
target: zod_1.z.string().describe('Target Node ID'),
|
|
54
|
+
/** Condition for this path (only for decision/branch nodes) */
|
|
55
|
+
condition: zod_1.z.string().optional().describe('Expression returning boolean used for branching'),
|
|
56
|
+
label: zod_1.z.string().optional().describe('Label on the connector'),
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Flow Schema
|
|
60
|
+
* Visual Business Logic Orchestration.
|
|
61
|
+
*/
|
|
62
|
+
exports.FlowSchema = zod_1.z.object({
|
|
63
|
+
/** Identity */
|
|
64
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name'),
|
|
65
|
+
label: zod_1.z.string().describe('Flow label'),
|
|
66
|
+
description: zod_1.z.string().optional(),
|
|
67
|
+
/** Trigger Type */
|
|
68
|
+
type: zod_1.z.enum(['autolaunched', 'record_change', 'schedule', 'screen', 'api']).describe('Flow type'),
|
|
69
|
+
/** Configuration Variables */
|
|
70
|
+
variables: zod_1.z.array(exports.FlowVariableSchema).optional().describe('Flow variables'),
|
|
71
|
+
/** Graph Definition */
|
|
72
|
+
nodes: zod_1.z.array(exports.FlowNodeSchema).describe('Flow nodes'),
|
|
73
|
+
edges: zod_1.z.array(exports.FlowEdgeSchema).describe('Flow connections'),
|
|
74
|
+
/** Execution Config */
|
|
75
|
+
active: zod_1.z.boolean().default(false).describe('Is active'),
|
|
76
|
+
runAs: zod_1.z.enum(['system', 'user']).default('user').describe('Execution context'),
|
|
77
|
+
});
|