@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,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.App = exports.AppSchema = exports.AppBrandingSchema = exports.NavigationItemSchema = exports.GroupNavItemSchema = exports.UrlNavItemSchema = exports.PageNavItemSchema = exports.DashboardNavItemSchema = exports.ObjectNavItemSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Base Navigation Item Schema
|
|
7
|
+
* Shared properties for all navigation types.
|
|
8
|
+
*/
|
|
9
|
+
const BaseNavItemSchema = zod_1.z.object({
|
|
10
|
+
/** Unique identifier for the item */
|
|
11
|
+
id: zod_1.z.string().describe('Unique identifier for this navigation item'),
|
|
12
|
+
/** Display label */
|
|
13
|
+
label: zod_1.z.string().describe('Display proper label'),
|
|
14
|
+
/** Icon name (Lucide) */
|
|
15
|
+
icon: zod_1.z.string().optional().describe('Icon name'),
|
|
16
|
+
/**
|
|
17
|
+
* Visibility condition.
|
|
18
|
+
* Formula expression returning boolean.
|
|
19
|
+
* e.g. "user.is_admin || user.department == 'sales'"
|
|
20
|
+
*/
|
|
21
|
+
visible: zod_1.z.string().optional().describe('Visibility formula condition'),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* 1. Object Navigation Item
|
|
25
|
+
* Navigates to an object's list view.
|
|
26
|
+
*/
|
|
27
|
+
exports.ObjectNavItemSchema = BaseNavItemSchema.extend({
|
|
28
|
+
type: zod_1.z.literal('object'),
|
|
29
|
+
objectName: zod_1.z.string().describe('Target object name'),
|
|
30
|
+
viewName: zod_1.z.string().optional().describe('Default list view to open. Defaults to "all"'),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* 2. Dashboard Navigation Item
|
|
34
|
+
* Navigates to a specific dashboard.
|
|
35
|
+
*/
|
|
36
|
+
exports.DashboardNavItemSchema = BaseNavItemSchema.extend({
|
|
37
|
+
type: zod_1.z.literal('dashboard'),
|
|
38
|
+
dashboardName: zod_1.z.string().describe('Target dashboard name'),
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* 3. Page Navigation Item
|
|
42
|
+
* Navigates to a custom UI page/component.
|
|
43
|
+
*/
|
|
44
|
+
exports.PageNavItemSchema = BaseNavItemSchema.extend({
|
|
45
|
+
type: zod_1.z.literal('page'),
|
|
46
|
+
pageName: zod_1.z.string().describe('Target custom page component name'),
|
|
47
|
+
params: zod_1.z.record(zod_1.z.any()).optional().describe('Parameters passed to the page context'),
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* 4. URL Navigation Item
|
|
51
|
+
* Navigates to an external or absolute URL.
|
|
52
|
+
*/
|
|
53
|
+
exports.UrlNavItemSchema = BaseNavItemSchema.extend({
|
|
54
|
+
type: zod_1.z.literal('url'),
|
|
55
|
+
url: zod_1.z.string().describe('Target external URL'),
|
|
56
|
+
target: zod_1.z.enum(['_self', '_blank']).default('_self').describe('Link target window'),
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* 5. Group Navigation Item
|
|
60
|
+
* A container for child navigation items (Sub-menu).
|
|
61
|
+
* Does not perform navigation itself.
|
|
62
|
+
*/
|
|
63
|
+
exports.GroupNavItemSchema = BaseNavItemSchema.extend({
|
|
64
|
+
type: zod_1.z.literal('group'),
|
|
65
|
+
expanded: zod_1.z.boolean().default(false).describe('Default expansion state in sidebar'),
|
|
66
|
+
// children property is added in the recursive definition below
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Recursive Union of all navigation item types.
|
|
70
|
+
* Allows constructing a navigation tree.
|
|
71
|
+
*/
|
|
72
|
+
exports.NavigationItemSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
73
|
+
exports.ObjectNavItemSchema,
|
|
74
|
+
exports.DashboardNavItemSchema,
|
|
75
|
+
exports.PageNavItemSchema,
|
|
76
|
+
exports.UrlNavItemSchema,
|
|
77
|
+
exports.GroupNavItemSchema.extend({
|
|
78
|
+
children: zod_1.z.array(exports.NavigationItemSchema).describe('Child navigation items'),
|
|
79
|
+
})
|
|
80
|
+
]));
|
|
81
|
+
/**
|
|
82
|
+
* App Branding Configuration
|
|
83
|
+
* Allows configuring the look and feel of the specific app.
|
|
84
|
+
*/
|
|
85
|
+
exports.AppBrandingSchema = zod_1.z.object({
|
|
86
|
+
primaryColor: zod_1.z.string().optional().describe('Primary theme color hex code'),
|
|
87
|
+
logo: zod_1.z.string().optional().describe('Custom logo URL for this app'),
|
|
88
|
+
favicon: zod_1.z.string().optional().describe('Custom favicon URL for this app'),
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Schema for Applications (Apps).
|
|
92
|
+
* A logical container for business functionality (e.g., "Sales CRM", "HR Portal").
|
|
93
|
+
*/
|
|
94
|
+
exports.AppSchema = zod_1.z.object({
|
|
95
|
+
/** Machine name (id) */
|
|
96
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('App unique machine name'),
|
|
97
|
+
/** Display label */
|
|
98
|
+
label: zod_1.z.string().describe('App display label'),
|
|
99
|
+
/** App version */
|
|
100
|
+
version: zod_1.z.string().optional().describe('App version'),
|
|
101
|
+
/** Description */
|
|
102
|
+
description: zod_1.z.string().optional().describe('App description'),
|
|
103
|
+
/** Icon name (Lucide) */
|
|
104
|
+
icon: zod_1.z.string().optional().describe('App icon used in the App Launcher'),
|
|
105
|
+
/** Branding/Theming Configuration */
|
|
106
|
+
branding: exports.AppBrandingSchema.optional().describe('App-specific branding'),
|
|
107
|
+
/** Application status */
|
|
108
|
+
active: zod_1.z.boolean().default(true).describe('Whether the app is enabled'),
|
|
109
|
+
/** Is this the default app for new users? */
|
|
110
|
+
isDefault: zod_1.z.boolean().default(false).describe('Is default app'),
|
|
111
|
+
/**
|
|
112
|
+
* Navigation Tree Structure.
|
|
113
|
+
* Replaces the old flat 'tabs' list with a structured menu.
|
|
114
|
+
*/
|
|
115
|
+
navigation: zod_1.z.array(exports.NavigationItemSchema).optional().describe('Structured navigation menu tree'),
|
|
116
|
+
/**
|
|
117
|
+
* App-level Home Page Override
|
|
118
|
+
* ID of the navigation item to act as the landing page.
|
|
119
|
+
* If not set, usually defaults to the first navigation item.
|
|
120
|
+
*/
|
|
121
|
+
homePageId: zod_1.z.string().optional().describe('ID of the navigation item to serve as landing page'),
|
|
122
|
+
/**
|
|
123
|
+
* Access Control
|
|
124
|
+
* List of permissions required to access this app.
|
|
125
|
+
* Modern replacement for role/profile based assignment.
|
|
126
|
+
* Example: ["app.access.crm"]
|
|
127
|
+
*/
|
|
128
|
+
requiredPermissions: zod_1.z.array(zod_1.z.string()).optional().describe('Permissions required to access this app'),
|
|
129
|
+
/**
|
|
130
|
+
* Package Components (For config file convenience)
|
|
131
|
+
* In a real monorepo these might be auto-discovered, but here we allow explicit registration.
|
|
132
|
+
*/
|
|
133
|
+
objects: zod_1.z.array(zod_1.z.any()).optional().describe('Objects belonging to this app'),
|
|
134
|
+
apis: zod_1.z.array(zod_1.z.any()).optional().describe('Custom APIs belonging to this app'),
|
|
135
|
+
});
|
|
136
|
+
exports.App = Object.assign(exports.AppSchema, {
|
|
137
|
+
create: (config) => config,
|
|
138
|
+
});
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Chart Type Enum
|
|
4
|
+
*/
|
|
5
|
+
export declare const ChartType: z.ZodEnum<["metric", "bar", "line", "pie", "donut", "funnel", "table", "text"]>;
|
|
6
|
+
/**
|
|
7
|
+
* Dashboard Widget Schema
|
|
8
|
+
* A single component on the dashboard grid.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DashboardWidgetSchema: z.ZodObject<{
|
|
11
|
+
/** Widget Title */
|
|
12
|
+
title: z.ZodOptional<z.ZodString>;
|
|
13
|
+
/** Visualization Type */
|
|
14
|
+
type: z.ZodDefault<z.ZodEnum<["metric", "bar", "line", "pie", "donut", "funnel", "table", "text"]>>;
|
|
15
|
+
/** Data Source Object */
|
|
16
|
+
object: z.ZodOptional<z.ZodString>;
|
|
17
|
+
/** Data Filter (ObjectQL JSON) */
|
|
18
|
+
filter: z.ZodOptional<z.ZodAny>;
|
|
19
|
+
/** Category Field (X-Axis / Group By) */
|
|
20
|
+
categoryField: z.ZodOptional<z.ZodString>;
|
|
21
|
+
/** Value Field (Y-Axis) */
|
|
22
|
+
valueField: z.ZodOptional<z.ZodString>;
|
|
23
|
+
/** Aggregate operation */
|
|
24
|
+
aggregate: z.ZodDefault<z.ZodOptional<z.ZodEnum<["count", "sum", "avg", "min", "max"]>>>;
|
|
25
|
+
/**
|
|
26
|
+
* Layout Position (React-Grid-Layout style)
|
|
27
|
+
* x: column (0-11)
|
|
28
|
+
* y: row
|
|
29
|
+
* w: width (1-12)
|
|
30
|
+
* h: height
|
|
31
|
+
*/
|
|
32
|
+
layout: z.ZodObject<{
|
|
33
|
+
x: z.ZodNumber;
|
|
34
|
+
y: z.ZodNumber;
|
|
35
|
+
w: z.ZodNumber;
|
|
36
|
+
h: z.ZodNumber;
|
|
37
|
+
}, "strip", z.ZodTypeAny, {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
w: number;
|
|
41
|
+
h: number;
|
|
42
|
+
}, {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
w: number;
|
|
46
|
+
h: number;
|
|
47
|
+
}>;
|
|
48
|
+
/** Widget specific options (colors, legend, etc.) */
|
|
49
|
+
options: z.ZodOptional<z.ZodAny>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table";
|
|
52
|
+
aggregate: "min" | "max" | "count" | "sum" | "avg";
|
|
53
|
+
layout: {
|
|
54
|
+
x: number;
|
|
55
|
+
y: number;
|
|
56
|
+
w: number;
|
|
57
|
+
h: number;
|
|
58
|
+
};
|
|
59
|
+
object?: string | undefined;
|
|
60
|
+
filter?: any;
|
|
61
|
+
options?: any;
|
|
62
|
+
title?: string | undefined;
|
|
63
|
+
categoryField?: string | undefined;
|
|
64
|
+
valueField?: string | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
layout: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
w: number;
|
|
70
|
+
h: number;
|
|
71
|
+
};
|
|
72
|
+
object?: string | undefined;
|
|
73
|
+
filter?: any;
|
|
74
|
+
options?: any;
|
|
75
|
+
type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
|
|
76
|
+
aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
|
|
77
|
+
title?: string | undefined;
|
|
78
|
+
categoryField?: string | undefined;
|
|
79
|
+
valueField?: string | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Dashboard Schema
|
|
83
|
+
* Represents a page containing multiple visualizations.
|
|
84
|
+
*/
|
|
85
|
+
export declare const DashboardSchema: z.ZodObject<{
|
|
86
|
+
/** Machine name */
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
/** Display label */
|
|
89
|
+
label: z.ZodString;
|
|
90
|
+
/** Description */
|
|
91
|
+
description: z.ZodOptional<z.ZodString>;
|
|
92
|
+
/** Collection of widgets */
|
|
93
|
+
widgets: z.ZodArray<z.ZodObject<{
|
|
94
|
+
/** Widget Title */
|
|
95
|
+
title: z.ZodOptional<z.ZodString>;
|
|
96
|
+
/** Visualization Type */
|
|
97
|
+
type: z.ZodDefault<z.ZodEnum<["metric", "bar", "line", "pie", "donut", "funnel", "table", "text"]>>;
|
|
98
|
+
/** Data Source Object */
|
|
99
|
+
object: z.ZodOptional<z.ZodString>;
|
|
100
|
+
/** Data Filter (ObjectQL JSON) */
|
|
101
|
+
filter: z.ZodOptional<z.ZodAny>;
|
|
102
|
+
/** Category Field (X-Axis / Group By) */
|
|
103
|
+
categoryField: z.ZodOptional<z.ZodString>;
|
|
104
|
+
/** Value Field (Y-Axis) */
|
|
105
|
+
valueField: z.ZodOptional<z.ZodString>;
|
|
106
|
+
/** Aggregate operation */
|
|
107
|
+
aggregate: z.ZodDefault<z.ZodOptional<z.ZodEnum<["count", "sum", "avg", "min", "max"]>>>;
|
|
108
|
+
/**
|
|
109
|
+
* Layout Position (React-Grid-Layout style)
|
|
110
|
+
* x: column (0-11)
|
|
111
|
+
* y: row
|
|
112
|
+
* w: width (1-12)
|
|
113
|
+
* h: height
|
|
114
|
+
*/
|
|
115
|
+
layout: z.ZodObject<{
|
|
116
|
+
x: z.ZodNumber;
|
|
117
|
+
y: z.ZodNumber;
|
|
118
|
+
w: z.ZodNumber;
|
|
119
|
+
h: z.ZodNumber;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
w: number;
|
|
124
|
+
h: number;
|
|
125
|
+
}, {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
w: number;
|
|
129
|
+
h: number;
|
|
130
|
+
}>;
|
|
131
|
+
/** Widget specific options (colors, legend, etc.) */
|
|
132
|
+
options: z.ZodOptional<z.ZodAny>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table";
|
|
135
|
+
aggregate: "min" | "max" | "count" | "sum" | "avg";
|
|
136
|
+
layout: {
|
|
137
|
+
x: number;
|
|
138
|
+
y: number;
|
|
139
|
+
w: number;
|
|
140
|
+
h: number;
|
|
141
|
+
};
|
|
142
|
+
object?: string | undefined;
|
|
143
|
+
filter?: any;
|
|
144
|
+
options?: any;
|
|
145
|
+
title?: string | undefined;
|
|
146
|
+
categoryField?: string | undefined;
|
|
147
|
+
valueField?: string | undefined;
|
|
148
|
+
}, {
|
|
149
|
+
layout: {
|
|
150
|
+
x: number;
|
|
151
|
+
y: number;
|
|
152
|
+
w: number;
|
|
153
|
+
h: number;
|
|
154
|
+
};
|
|
155
|
+
object?: string | undefined;
|
|
156
|
+
filter?: any;
|
|
157
|
+
options?: any;
|
|
158
|
+
type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
|
|
159
|
+
aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
|
|
160
|
+
title?: string | undefined;
|
|
161
|
+
categoryField?: string | undefined;
|
|
162
|
+
valueField?: string | undefined;
|
|
163
|
+
}>, "many">;
|
|
164
|
+
}, "strip", z.ZodTypeAny, {
|
|
165
|
+
label: string;
|
|
166
|
+
name: string;
|
|
167
|
+
widgets: {
|
|
168
|
+
type: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table";
|
|
169
|
+
aggregate: "min" | "max" | "count" | "sum" | "avg";
|
|
170
|
+
layout: {
|
|
171
|
+
x: number;
|
|
172
|
+
y: number;
|
|
173
|
+
w: number;
|
|
174
|
+
h: number;
|
|
175
|
+
};
|
|
176
|
+
object?: string | undefined;
|
|
177
|
+
filter?: any;
|
|
178
|
+
options?: any;
|
|
179
|
+
title?: string | undefined;
|
|
180
|
+
categoryField?: string | undefined;
|
|
181
|
+
valueField?: string | undefined;
|
|
182
|
+
}[];
|
|
183
|
+
description?: string | undefined;
|
|
184
|
+
}, {
|
|
185
|
+
label: string;
|
|
186
|
+
name: string;
|
|
187
|
+
widgets: {
|
|
188
|
+
layout: {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
w: number;
|
|
192
|
+
h: number;
|
|
193
|
+
};
|
|
194
|
+
object?: string | undefined;
|
|
195
|
+
filter?: any;
|
|
196
|
+
options?: any;
|
|
197
|
+
type?: "text" | "metric" | "bar" | "line" | "pie" | "donut" | "funnel" | "table" | undefined;
|
|
198
|
+
aggregate?: "min" | "max" | "count" | "sum" | "avg" | undefined;
|
|
199
|
+
title?: string | undefined;
|
|
200
|
+
categoryField?: string | undefined;
|
|
201
|
+
valueField?: string | undefined;
|
|
202
|
+
}[];
|
|
203
|
+
description?: string | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
export type Dashboard = z.infer<typeof DashboardSchema>;
|
|
206
|
+
export type DashboardWidget = z.infer<typeof DashboardWidgetSchema>;
|
|
207
|
+
/**
|
|
208
|
+
* Dashboard Factory Helper
|
|
209
|
+
*/
|
|
210
|
+
export declare const Dashboard: {
|
|
211
|
+
readonly create: (config: z.input<typeof DashboardSchema>) => Dashboard;
|
|
212
|
+
};
|
|
213
|
+
//# sourceMappingURL=dashboard.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.zod.d.ts","sourceRoot":"","sources":["../../src/ui/dashboard.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,SAAS,iFASpB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;IAChC,mBAAmB;;IAGnB,yBAAyB;;IAGzB,yBAAyB;;IAGzB,kCAAkC;;IAGlC,yCAAyC;;IAGzC,2BAA2B;;IAG3B,0BAA0B;;IAG1B;;;;;;OAMG;;;;;;;;;;;;;;;;;IAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAErD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,mBAAmB;;IAGnB,oBAAoB;;IAGpB,kBAAkB;;IAGlB,4BAA4B;;QArD5B,mBAAmB;;QAGnB,yBAAyB;;QAGzB,yBAAyB;;QAGzB,kCAAkC;;QAGlC,yCAAyC;;QAGzC,2BAA2B;;QAG3B,0BAA0B;;QAG1B;;;;;;WAMG;;;;;;;;;;;;;;;;;QAQH,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBrD,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,SAAS;8BACH,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,KAAG,SAAS;CACpD,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Dashboard = exports.DashboardSchema = exports.DashboardWidgetSchema = exports.ChartType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Chart Type Enum
|
|
7
|
+
*/
|
|
8
|
+
exports.ChartType = zod_1.z.enum([
|
|
9
|
+
'metric', // Single big number
|
|
10
|
+
'bar', // Bar chart
|
|
11
|
+
'line', // Line chart
|
|
12
|
+
'pie', // Pie/Donut chart
|
|
13
|
+
'donut', // Donut chart
|
|
14
|
+
'funnel', // Funnel chart
|
|
15
|
+
'table', // Data table
|
|
16
|
+
'text' // Rich text / Markdown
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Dashboard Widget Schema
|
|
20
|
+
* A single component on the dashboard grid.
|
|
21
|
+
*/
|
|
22
|
+
exports.DashboardWidgetSchema = zod_1.z.object({
|
|
23
|
+
/** Widget Title */
|
|
24
|
+
title: zod_1.z.string().optional().describe('Widget title'),
|
|
25
|
+
/** Visualization Type */
|
|
26
|
+
type: exports.ChartType.default('metric').describe('Visualization type'),
|
|
27
|
+
/** Data Source Object */
|
|
28
|
+
object: zod_1.z.string().optional().describe('Data source object name'),
|
|
29
|
+
/** Data Filter (ObjectQL JSON) */
|
|
30
|
+
filter: zod_1.z.any().optional().describe('Data filter criteria'),
|
|
31
|
+
/** Category Field (X-Axis / Group By) */
|
|
32
|
+
categoryField: zod_1.z.string().optional().describe('Field for grouping (X-Axis)'),
|
|
33
|
+
/** Value Field (Y-Axis) */
|
|
34
|
+
valueField: zod_1.z.string().optional().describe('Field for values (Y-Axis)'),
|
|
35
|
+
/** Aggregate operation */
|
|
36
|
+
aggregate: zod_1.z.enum(['count', 'sum', 'avg', 'min', 'max']).optional().default('count').describe('Aggregate function'),
|
|
37
|
+
/**
|
|
38
|
+
* Layout Position (React-Grid-Layout style)
|
|
39
|
+
* x: column (0-11)
|
|
40
|
+
* y: row
|
|
41
|
+
* w: width (1-12)
|
|
42
|
+
* h: height
|
|
43
|
+
*/
|
|
44
|
+
layout: zod_1.z.object({
|
|
45
|
+
x: zod_1.z.number(),
|
|
46
|
+
y: zod_1.z.number(),
|
|
47
|
+
w: zod_1.z.number(),
|
|
48
|
+
h: zod_1.z.number(),
|
|
49
|
+
}).describe('Grid layout position'),
|
|
50
|
+
/** Widget specific options (colors, legend, etc.) */
|
|
51
|
+
options: zod_1.z.any().optional().describe('Widget specific configuration'),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Dashboard Schema
|
|
55
|
+
* Represents a page containing multiple visualizations.
|
|
56
|
+
*/
|
|
57
|
+
exports.DashboardSchema = zod_1.z.object({
|
|
58
|
+
/** Machine name */
|
|
59
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Dashboard unique name'),
|
|
60
|
+
/** Display label */
|
|
61
|
+
label: zod_1.z.string().describe('Dashboard label'),
|
|
62
|
+
/** Description */
|
|
63
|
+
description: zod_1.z.string().optional().describe('Dashboard description'),
|
|
64
|
+
/** Collection of widgets */
|
|
65
|
+
widgets: zod_1.z.array(exports.DashboardWidgetSchema).describe('Widgets to display'),
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Dashboard Factory Helper
|
|
69
|
+
*/
|
|
70
|
+
exports.Dashboard = {
|
|
71
|
+
create: (config) => exports.DashboardSchema.parse(config),
|
|
72
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Page Region Schema
|
|
4
|
+
* A named region in the template where components are dropped.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PageRegionSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
width: z.ZodOptional<z.ZodEnum<["small", "medium", "large", "full"]>>;
|
|
9
|
+
components: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
10
|
+
/** Definition */
|
|
11
|
+
type: z.ZodString;
|
|
12
|
+
id: z.ZodOptional<z.ZodString>;
|
|
13
|
+
/** Configuration */
|
|
14
|
+
label: z.ZodOptional<z.ZodString>;
|
|
15
|
+
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
16
|
+
/** Visibility Rule */
|
|
17
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: string;
|
|
20
|
+
properties: Record<string, any>;
|
|
21
|
+
label?: string | undefined;
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
visibility?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
type: string;
|
|
26
|
+
properties: Record<string, any>;
|
|
27
|
+
label?: string | undefined;
|
|
28
|
+
id?: string | undefined;
|
|
29
|
+
visibility?: string | undefined;
|
|
30
|
+
}>>, "many">;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
name: string;
|
|
33
|
+
components: {
|
|
34
|
+
type: string;
|
|
35
|
+
properties: Record<string, any>;
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
id?: string | undefined;
|
|
38
|
+
visibility?: string | undefined;
|
|
39
|
+
}[];
|
|
40
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
name: string;
|
|
43
|
+
components: {
|
|
44
|
+
type: string;
|
|
45
|
+
properties: Record<string, any>;
|
|
46
|
+
label?: string | undefined;
|
|
47
|
+
id?: string | undefined;
|
|
48
|
+
visibility?: string | undefined;
|
|
49
|
+
}[];
|
|
50
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Page Component Schema
|
|
54
|
+
* A configured instance of a UI component.
|
|
55
|
+
*/
|
|
56
|
+
export declare const PageComponentSchema: z.ZodObject<{
|
|
57
|
+
/** Definition */
|
|
58
|
+
type: z.ZodString;
|
|
59
|
+
id: z.ZodOptional<z.ZodString>;
|
|
60
|
+
/** Configuration */
|
|
61
|
+
label: z.ZodOptional<z.ZodString>;
|
|
62
|
+
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
63
|
+
/** Visibility Rule */
|
|
64
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
type: string;
|
|
67
|
+
properties: Record<string, any>;
|
|
68
|
+
label?: string | undefined;
|
|
69
|
+
id?: string | undefined;
|
|
70
|
+
visibility?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
type: string;
|
|
73
|
+
properties: Record<string, any>;
|
|
74
|
+
label?: string | undefined;
|
|
75
|
+
id?: string | undefined;
|
|
76
|
+
visibility?: string | undefined;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Page Schema
|
|
80
|
+
* Defines a composition of components for a specific context (Record, Home, App).
|
|
81
|
+
* Compare to Salesforce FlexiPage.
|
|
82
|
+
*/
|
|
83
|
+
export declare const PageSchema: z.ZodObject<{
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
label: z.ZodString;
|
|
86
|
+
description: z.ZodOptional<z.ZodString>;
|
|
87
|
+
/** Page Type */
|
|
88
|
+
type: z.ZodDefault<z.ZodEnum<["record", "home", "app", "utility"]>>;
|
|
89
|
+
/** Context */
|
|
90
|
+
object: z.ZodOptional<z.ZodString>;
|
|
91
|
+
/** Layout Template */
|
|
92
|
+
template: z.ZodDefault<z.ZodString>;
|
|
93
|
+
/** Regions & Content */
|
|
94
|
+
regions: z.ZodArray<z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
width: z.ZodOptional<z.ZodEnum<["small", "medium", "large", "full"]>>;
|
|
97
|
+
components: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
98
|
+
/** Definition */
|
|
99
|
+
type: z.ZodString;
|
|
100
|
+
id: z.ZodOptional<z.ZodString>;
|
|
101
|
+
/** Configuration */
|
|
102
|
+
label: z.ZodOptional<z.ZodString>;
|
|
103
|
+
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
104
|
+
/** Visibility Rule */
|
|
105
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
type: string;
|
|
108
|
+
properties: Record<string, any>;
|
|
109
|
+
label?: string | undefined;
|
|
110
|
+
id?: string | undefined;
|
|
111
|
+
visibility?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
type: string;
|
|
114
|
+
properties: Record<string, any>;
|
|
115
|
+
label?: string | undefined;
|
|
116
|
+
id?: string | undefined;
|
|
117
|
+
visibility?: string | undefined;
|
|
118
|
+
}>>, "many">;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
name: string;
|
|
121
|
+
components: {
|
|
122
|
+
type: string;
|
|
123
|
+
properties: Record<string, any>;
|
|
124
|
+
label?: string | undefined;
|
|
125
|
+
id?: string | undefined;
|
|
126
|
+
visibility?: string | undefined;
|
|
127
|
+
}[];
|
|
128
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
name: string;
|
|
131
|
+
components: {
|
|
132
|
+
type: string;
|
|
133
|
+
properties: Record<string, any>;
|
|
134
|
+
label?: string | undefined;
|
|
135
|
+
id?: string | undefined;
|
|
136
|
+
visibility?: string | undefined;
|
|
137
|
+
}[];
|
|
138
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
139
|
+
}>, "many">;
|
|
140
|
+
/** Activation */
|
|
141
|
+
isDefault: z.ZodDefault<z.ZodBoolean>;
|
|
142
|
+
assignedProfiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
type: "record" | "home" | "app" | "utility";
|
|
145
|
+
label: string;
|
|
146
|
+
name: string;
|
|
147
|
+
template: string;
|
|
148
|
+
isDefault: boolean;
|
|
149
|
+
regions: {
|
|
150
|
+
name: string;
|
|
151
|
+
components: {
|
|
152
|
+
type: string;
|
|
153
|
+
properties: Record<string, any>;
|
|
154
|
+
label?: string | undefined;
|
|
155
|
+
id?: string | undefined;
|
|
156
|
+
visibility?: string | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
159
|
+
}[];
|
|
160
|
+
object?: string | undefined;
|
|
161
|
+
description?: string | undefined;
|
|
162
|
+
assignedProfiles?: string[] | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
label: string;
|
|
165
|
+
name: string;
|
|
166
|
+
regions: {
|
|
167
|
+
name: string;
|
|
168
|
+
components: {
|
|
169
|
+
type: string;
|
|
170
|
+
properties: Record<string, any>;
|
|
171
|
+
label?: string | undefined;
|
|
172
|
+
id?: string | undefined;
|
|
173
|
+
visibility?: string | undefined;
|
|
174
|
+
}[];
|
|
175
|
+
width?: "full" | "small" | "medium" | "large" | undefined;
|
|
176
|
+
}[];
|
|
177
|
+
object?: string | undefined;
|
|
178
|
+
type?: "record" | "home" | "app" | "utility" | undefined;
|
|
179
|
+
description?: string | undefined;
|
|
180
|
+
template?: string | undefined;
|
|
181
|
+
isDefault?: boolean | undefined;
|
|
182
|
+
assignedProfiles?: string[] | undefined;
|
|
183
|
+
}>;
|
|
184
|
+
export type Page = z.infer<typeof PageSchema>;
|
|
185
|
+
export type PageComponent = z.infer<typeof PageComponentSchema>;
|
|
186
|
+
export type PageRegion = z.infer<typeof PageRegionSchema>;
|
|
187
|
+
//# sourceMappingURL=page.zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.zod.d.ts","sourceRoot":"","sources":["../../src/ui/page.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;QAW3B,iBAAiB;;;QAIjB,oBAAoB;;;QAIpB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAftB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,iBAAiB;;;IAIjB,oBAAoB;;;IAIpB,sBAAsB;;;;;;;;;;;;;;EAEtB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;;IAKrB,gBAAgB;;IAGhB,cAAc;;IAGd,sBAAsB;;IAGtB,wBAAwB;;;;;YA/BxB,iBAAiB;;;YAIjB,oBAAoB;;;YAIpB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BtB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageSchema = exports.PageComponentSchema = exports.PageRegionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Page Region Schema
|
|
7
|
+
* A named region in the template where components are dropped.
|
|
8
|
+
*/
|
|
9
|
+
exports.PageRegionSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string().describe('Region name (e.g. "sidebar", "main", "header")'),
|
|
11
|
+
width: zod_1.z.enum(['small', 'medium', 'large', 'full']).optional(),
|
|
12
|
+
components: zod_1.z.array(zod_1.z.lazy(() => exports.PageComponentSchema)).describe('Components in this region')
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Page Component Schema
|
|
16
|
+
* A configured instance of a UI component.
|
|
17
|
+
*/
|
|
18
|
+
exports.PageComponentSchema = zod_1.z.object({
|
|
19
|
+
/** Definition */
|
|
20
|
+
type: zod_1.z.string().describe('Component Type (e.g. "steedos-labs.related-list")'),
|
|
21
|
+
id: zod_1.z.string().optional().describe('Unique instance ID'),
|
|
22
|
+
/** Configuration */
|
|
23
|
+
label: zod_1.z.string().optional(),
|
|
24
|
+
properties: zod_1.z.record(zod_1.z.any()).describe('Component props passed to the widget'),
|
|
25
|
+
/** Visibility Rule */
|
|
26
|
+
visibility: zod_1.z.string().optional().describe('Visibility filter/formula')
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Page Schema
|
|
30
|
+
* Defines a composition of components for a specific context (Record, Home, App).
|
|
31
|
+
* Compare to Salesforce FlexiPage.
|
|
32
|
+
*/
|
|
33
|
+
exports.PageSchema = zod_1.z.object({
|
|
34
|
+
name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/),
|
|
35
|
+
label: zod_1.z.string(),
|
|
36
|
+
description: zod_1.z.string().optional(),
|
|
37
|
+
/** Page Type */
|
|
38
|
+
type: zod_1.z.enum(['record', 'home', 'app', 'utility']).default('record'),
|
|
39
|
+
/** Context */
|
|
40
|
+
object: zod_1.z.string().optional().describe('Bound object (for Record pages)'),
|
|
41
|
+
/** Layout Template */
|
|
42
|
+
template: zod_1.z.string().default('default').describe('Layout template name (e.g. "header-sidebar-main")'),
|
|
43
|
+
/** Regions & Content */
|
|
44
|
+
regions: zod_1.z.array(exports.PageRegionSchema).describe('Defined regions with components'),
|
|
45
|
+
/** Activation */
|
|
46
|
+
isDefault: zod_1.z.boolean().default(false),
|
|
47
|
+
assignedProfiles: zod_1.z.array(zod_1.z.string()).optional()
|
|
48
|
+
});
|