@objectstack/spec 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +73 -1
  2. package/dist/api/contract.zod.d.ts +1733 -0
  3. package/dist/api/contract.zod.d.ts.map +1 -0
  4. package/dist/api/contract.zod.js +138 -0
  5. package/dist/data/dataset.zod.d.ts +2 -2
  6. package/dist/data/field.zod.d.ts +1648 -10
  7. package/dist/data/field.zod.d.ts.map +1 -1
  8. package/dist/data/field.zod.js +149 -8
  9. package/dist/data/mapping.zod.d.ts +215 -2
  10. package/dist/data/mapping.zod.d.ts.map +1 -1
  11. package/dist/data/object.zod.d.ts +505 -25
  12. package/dist/data/object.zod.d.ts.map +1 -1
  13. package/dist/data/object.zod.js +32 -5
  14. package/dist/data/query.zod.d.ts +349 -0
  15. package/dist/data/query.zod.d.ts.map +1 -1
  16. package/dist/data/query.zod.js +77 -1
  17. package/dist/data/trigger.zod.d.ts +354 -0
  18. package/dist/data/trigger.zod.d.ts.map +1 -0
  19. package/dist/data/trigger.zod.js +195 -0
  20. package/dist/data/validation.zod.d.ts +83 -43
  21. package/dist/data/validation.zod.d.ts.map +1 -1
  22. package/dist/data/validation.zod.js +51 -5
  23. package/dist/index.d.ts +8 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +9 -0
  26. package/dist/system/api.zod.d.ts +130 -4
  27. package/dist/system/api.zod.d.ts.map +1 -1
  28. package/dist/system/api.zod.js +4 -1
  29. package/dist/system/datasource.zod.d.ts +89 -6
  30. package/dist/system/datasource.zod.d.ts.map +1 -1
  31. package/dist/system/datasource.zod.js +33 -5
  32. package/dist/system/discovery.zod.d.ts +174 -0
  33. package/dist/system/discovery.zod.d.ts.map +1 -0
  34. package/dist/system/discovery.zod.js +53 -0
  35. package/dist/system/driver.zod.d.ts +1525 -0
  36. package/dist/system/driver.zod.d.ts.map +1 -0
  37. package/dist/system/driver.zod.js +290 -0
  38. package/dist/system/license.zod.d.ts +2 -2
  39. package/dist/system/manifest.zod.d.ts +323 -52
  40. package/dist/system/manifest.zod.d.ts.map +1 -1
  41. package/dist/system/manifest.zod.js +91 -17
  42. package/dist/system/plugin.zod.d.ts +3516 -0
  43. package/dist/system/plugin.zod.d.ts.map +1 -0
  44. package/dist/system/plugin.zod.js +226 -0
  45. package/dist/system/territory.zod.d.ts +1 -1
  46. package/dist/system/webhook.zod.d.ts +3 -3
  47. package/dist/ui/action.zod.d.ts +19 -12
  48. package/dist/ui/action.zod.d.ts.map +1 -1
  49. package/dist/ui/action.zod.js +7 -1
  50. package/dist/ui/app.zod.d.ts +109 -3
  51. package/dist/ui/app.zod.d.ts.map +1 -1
  52. package/dist/ui/app.zod.js +13 -2
  53. package/dist/ui/dashboard.zod.d.ts +9 -3
  54. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  55. package/dist/ui/dashboard.zod.js +7 -1
  56. package/dist/ui/page.zod.d.ts +6 -6
  57. package/dist/ui/report.zod.d.ts +9 -0
  58. package/dist/ui/report.zod.d.ts.map +1 -1
  59. package/dist/ui/report.zod.js +7 -1
  60. package/dist/ui/theme.zod.d.ts +1221 -0
  61. package/dist/ui/theme.zod.d.ts.map +1 -0
  62. package/dist/ui/theme.zod.js +202 -0
  63. package/dist/ui/widget.zod.d.ts +350 -0
  64. package/dist/ui/widget.zod.d.ts.map +1 -0
  65. package/dist/ui/widget.zod.js +66 -0
  66. package/json-schema/Action.json +8 -2
  67. package/json-schema/ActionParam.json +8 -2
  68. package/json-schema/Address.json +40 -0
  69. package/json-schema/AggregationFunction.json +19 -0
  70. package/json-schema/AggregationNode.json +42 -0
  71. package/json-schema/Animation.json +56 -0
  72. package/json-schema/ApiCapabilities.json +28 -0
  73. package/json-schema/ApiError.json +27 -0
  74. package/json-schema/ApiRoutes.json +41 -0
  75. package/json-schema/App.json +13 -2
  76. package/json-schema/AsyncValidation.json +70 -0
  77. package/json-schema/BaseResponse.json +63 -0
  78. package/json-schema/BorderRadius.json +44 -0
  79. package/json-schema/Breakpoints.json +36 -0
  80. package/json-schema/BulkRequest.json +29 -0
  81. package/json-schema/BulkResponse.json +108 -0
  82. package/json-schema/ColorPalette.json +83 -0
  83. package/json-schema/ConditionalValidation.json +793 -0
  84. package/json-schema/CreateRequest.json +20 -0
  85. package/json-schema/CrossFieldValidation.json +56 -0
  86. package/json-schema/CustomValidator.json +57 -0
  87. package/json-schema/Datasource.json +0 -18
  88. package/json-schema/DeleteResponse.json +68 -0
  89. package/json-schema/Discovery.json +114 -0
  90. package/json-schema/DriverCapabilities.json +39 -0
  91. package/json-schema/DriverDefinition.json +66 -0
  92. package/json-schema/DriverInterface.json +58 -0
  93. package/json-schema/DriverOptions.json +23 -0
  94. package/json-schema/DriverType.json +1 -18
  95. package/json-schema/ExportRequest.json +786 -0
  96. package/json-schema/Field.json +75 -4
  97. package/json-schema/FieldType.json +8 -2
  98. package/json-schema/FieldWidgetProps.json +327 -0
  99. package/json-schema/I18nContext.json +12 -0
  100. package/json-schema/JoinNode.json +455 -0
  101. package/json-schema/JoinType.json +15 -0
  102. package/json-schema/ListRecordResponse.json +103 -0
  103. package/json-schema/LocationCoordinates.json +36 -0
  104. package/json-schema/Logger.json +25 -0
  105. package/json-schema/Manifest.json +243 -18
  106. package/json-schema/Mapping.json +328 -0
  107. package/json-schema/ModificationResult.json +46 -0
  108. package/json-schema/Object.json +103 -6
  109. package/json-schema/ObjectCapabilities.json +26 -0
  110. package/json-schema/ObjectQLClient.json +12 -0
  111. package/json-schema/Plugin.json +20 -0
  112. package/json-schema/PluginContext.json +91 -0
  113. package/json-schema/PluginLifecycle.json +11 -0
  114. package/json-schema/Query.json +328 -0
  115. package/json-schema/RecordData.json +11 -0
  116. package/json-schema/Router.json +12 -0
  117. package/json-schema/Scheduler.json +12 -0
  118. package/json-schema/ScopedStorage.json +12 -0
  119. package/json-schema/Shadow.json +44 -0
  120. package/json-schema/SingleRecordResponse.json +69 -0
  121. package/json-schema/Spacing.json +64 -0
  122. package/json-schema/SystemAPI.json +12 -0
  123. package/json-schema/Theme.json +543 -0
  124. package/json-schema/ThemeMode.json +14 -0
  125. package/json-schema/Trigger.json +73 -0
  126. package/json-schema/TriggerAction.json +14 -0
  127. package/json-schema/TriggerContext.json +61 -0
  128. package/json-schema/TriggerTiming.json +13 -0
  129. package/json-schema/Typography.json +142 -0
  130. package/json-schema/UpdateRequest.json +20 -0
  131. package/json-schema/ValidationRule.json +583 -0
  132. package/json-schema/WindowFunction.json +24 -0
  133. package/json-schema/WindowFunctionNode.json +104 -0
  134. package/json-schema/WindowSpec.json +65 -0
  135. package/json-schema/ZIndex.json +44 -0
  136. package/package.json +8 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.zod.d.ts","sourceRoot":"","sources":["../../src/system/plugin.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAKO,CAAC;AAEjC,eAAO,MAAM,oBAAoB;;;;;;;;;EAGS,CAAC;AAE3C,eAAO,MAAM,YAAY;;;;;;;;;;;;EAIW,CAAC;AAErC,eAAO,MAAM,eAAe;;;;;;EAEU,CAAC;AAEvC,eAAO,MAAM,eAAe;;;;;;;;;EAGQ,CAAC;AAErC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAIc,CAAC;AAE/C,eAAO,MAAM,iBAAiB;;;;;;;;;EAGY,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;;;;;;OAOG;;;;;;;;;;;IAGH;;;;;;;OAOG;;;;;;;;;;;IAGH;;;;;;;OAOG;;;;;;;;;;;;;;;;;IAGH;;;;;;OAMG;;;;;;;;;;;;;;IAGH;;;;;OAKG;;;;;;;;;;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;OAOG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;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;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PluginSchema = exports.PluginLifecycleSchema = exports.PluginContextSchema = exports.I18nContextSchema = exports.ScopedStorageSchema = exports.SystemAPISchema = exports.SchedulerSchema = exports.RouterSchema = exports.ObjectQLClientSchema = exports.LoggerSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Interface schemas for Context Capabilities
7
+ */
8
+ exports.LoggerSchema = zod_1.z.object({
9
+ debug: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
10
+ info: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
11
+ warn: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
12
+ error: zod_1.z.any().describe('(message: string, ...meta: any[]) => void'),
13
+ }).describe('Structured Logger');
14
+ exports.ObjectQLClientSchema = zod_1.z.object({
15
+ object: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.any()).describe('Get query interface for an object'),
16
+ query: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())).describe('Execute arbitrary SOQL-like query'),
17
+ }).describe('ObjectQL Data Access Client');
18
+ exports.RouterSchema = zod_1.z.object({
19
+ get: zod_1.z.function().args(zod_1.z.string(), zod_1.z.function()).describe('Register GET route'),
20
+ post: zod_1.z.function().args(zod_1.z.string(), zod_1.z.function()).describe('Register POST route'),
21
+ use: zod_1.z.function().args(zod_1.z.string().optional(), zod_1.z.function()).describe('Register Middleware'),
22
+ }).describe('HTTP Router Interface');
23
+ exports.SchedulerSchema = zod_1.z.object({
24
+ schedule: zod_1.z.function().args(zod_1.z.string(), zod_1.z.string(), zod_1.z.function()).describe('Schedule a cron job'),
25
+ }).describe('Job Scheduler Interface');
26
+ exports.SystemAPISchema = zod_1.z.object({
27
+ getCurrentUser: zod_1.z.function().returns(zod_1.z.promise(zod_1.z.any())),
28
+ getConfig: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())),
29
+ }).describe('Access to System Core');
30
+ exports.ScopedStorageSchema = zod_1.z.object({
31
+ get: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.any())).describe('Get value by key'),
32
+ set: zod_1.z.function().args(zod_1.z.string(), zod_1.z.any()).returns(zod_1.z.promise(zod_1.z.void())).describe('Set value for key'),
33
+ delete: zod_1.z.function().args(zod_1.z.string()).returns(zod_1.z.promise(zod_1.z.void())).describe('Delete key'),
34
+ }).describe('Plugin Scoped Data Storage (KV)');
35
+ exports.I18nContextSchema = zod_1.z.object({
36
+ t: zod_1.z.function().args(zod_1.z.string(), zod_1.z.record(zod_1.z.any()).optional()).returns(zod_1.z.string()).describe('Translate a key'),
37
+ getLocale: zod_1.z.function().returns(zod_1.z.string()).describe('Get current context locale'),
38
+ }).describe('Internationalization Helper');
39
+ /**
40
+ * Plugin Context Schema
41
+ *
42
+ * This defines the runtime context available to plugins during their lifecycle.
43
+ * The context provides access to core ObjectStack APIs and services.
44
+ *
45
+ * @example
46
+ * export default {
47
+ * onEnable: async (context: PluginContext) => {
48
+ * const { ql, os, logger } = context;
49
+ * logger.info('Plugin enabled');
50
+ * await ql.object('custom_object').find({});
51
+ * }
52
+ * };
53
+ */
54
+ exports.PluginContextSchema = zod_1.z.object({
55
+ /**
56
+ * ObjectQL data access API.
57
+ * Provides methods to query and manipulate business objects.
58
+ *
59
+ * @example
60
+ * await context.ql.object('account').find({ status: 'active' });
61
+ * await context.ql.object('contact').create({ name: 'John Doe' });
62
+ */
63
+ ql: exports.ObjectQLClientSchema,
64
+ /**
65
+ * ObjectOS system API.
66
+ * Provides access to system-level functionality and configuration.
67
+ *
68
+ * @example
69
+ * const user = await context.os.getCurrentUser();
70
+ * const config = await context.os.getConfig('plugin.settings');
71
+ */
72
+ os: exports.SystemAPISchema,
73
+ /**
74
+ * Logging interface.
75
+ * Provides structured logging capabilities with different levels.
76
+ *
77
+ * @example
78
+ * context.logger.info('Operation completed');
79
+ * context.logger.error('Operation failed', { error });
80
+ */
81
+ logger: exports.LoggerSchema,
82
+ /**
83
+ * Scoped Storage.
84
+ * Key-Value store isolated for this plugin.
85
+ *
86
+ * @example
87
+ * await context.storage.set('last_sync', Date.now());
88
+ */
89
+ storage: exports.ScopedStorageSchema,
90
+ /**
91
+ * I18n Helper.
92
+ *
93
+ * @example
94
+ * const msg = context.i18n.t('error.invalid_input');
95
+ */
96
+ i18n: exports.I18nContextSchema,
97
+ /**
98
+ * Metadata registry.
99
+ * Provides access to system metadata like object schemas, field definitions, etc.
100
+ *
101
+ * @example
102
+ * const schema = await context.metadata.getObject('account');
103
+ * const fields = await context.metadata.getFields('account');
104
+ */
105
+ metadata: zod_1.z.any().describe('Metadata registry'),
106
+ /**
107
+ * Event bus.
108
+ * Provides pub/sub capabilities for system and custom events.
109
+ *
110
+ * @example
111
+ * context.events.on('record.created', handler);
112
+ * context.events.emit('custom.event', data);
113
+ */
114
+ events: zod_1.z.any().describe('Event bus'),
115
+ /**
116
+ * Application Runtime Capabilities.
117
+ * Provides mechanisms to extend the running application (Routes, Jobs, etc).
118
+ */
119
+ app: zod_1.z.object({
120
+ router: exports.RouterSchema,
121
+ scheduler: exports.SchedulerSchema.optional(),
122
+ }).describe('App Runtime Capabilities'),
123
+ });
124
+ /**
125
+ * Plugin Lifecycle Schema
126
+ *
127
+ * This defines the lifecycle hooks available to plugins.
128
+ * Plugins can implement any or all of these hooks to respond to lifecycle events.
129
+ *
130
+ * All hooks receive PluginContext as their first parameter.
131
+ * All hooks are optional and asynchronous.
132
+ *
133
+ * @example
134
+ * export default {
135
+ * onInstall: async (context) => {
136
+ * // Initialize database tables
137
+ * await context.ql.object('plugin_data').syncSchema();
138
+ * },
139
+ *
140
+ * onEnable: async (context) => {
141
+ * // Start background services
142
+ * await startScheduler(context);
143
+ * },
144
+ *
145
+ * onDisable: async (context) => {
146
+ * // Stop background services
147
+ * await stopScheduler();
148
+ * }
149
+ * };
150
+ */
151
+ exports.PluginLifecycleSchema = zod_1.z.object({
152
+ /**
153
+ * Called when the plugin is first installed.
154
+ * Use this to set up initial data, create database tables, or register resources.
155
+ *
156
+ * @param context - Plugin runtime context
157
+ */
158
+ onInstall: zod_1.z.function()
159
+ .args(exports.PluginContextSchema)
160
+ .returns(zod_1.z.promise(zod_1.z.void()))
161
+ .optional()
162
+ .describe('Hook called on plugin installation'),
163
+ /**
164
+ * Called when the plugin is enabled.
165
+ * Use this to start services, register event handlers, or initialize runtime state.
166
+ *
167
+ * @param context - Plugin runtime context
168
+ */
169
+ onEnable: zod_1.z.function()
170
+ .args(exports.PluginContextSchema)
171
+ .returns(zod_1.z.promise(zod_1.z.void()))
172
+ .optional()
173
+ .describe('Hook called when plugin is enabled'),
174
+ /**
175
+ * Called when the plugin is disabled.
176
+ * Use this to stop services, unregister handlers, or clean up runtime state.
177
+ *
178
+ * @param context - Plugin runtime context
179
+ */
180
+ onDisable: zod_1.z.function()
181
+ .args(exports.PluginContextSchema)
182
+ .returns(zod_1.z.promise(zod_1.z.void()))
183
+ .optional()
184
+ .describe('Hook called when plugin is disabled'),
185
+ /**
186
+ * Called when the plugin is uninstalled.
187
+ * Use this to clean up data, remove database tables, or unregister resources.
188
+ *
189
+ * @param context - Plugin runtime context
190
+ */
191
+ onUninstall: zod_1.z.function()
192
+ .args(exports.PluginContextSchema)
193
+ .returns(zod_1.z.promise(zod_1.z.void()))
194
+ .optional()
195
+ .describe('Hook called on plugin uninstallation'),
196
+ /**
197
+ * Called when the plugin is upgraded to a new version.
198
+ * Use this to migrate data, update schemas, or handle breaking changes.
199
+ *
200
+ * @param context - Plugin runtime context
201
+ * @param fromVersion - Previous version string
202
+ * @param toVersion - New version string
203
+ */
204
+ onUpgrade: zod_1.z.function()
205
+ .args(exports.PluginContextSchema, zod_1.z.string(), zod_1.z.string())
206
+ .returns(zod_1.z.promise(zod_1.z.void()))
207
+ .optional()
208
+ .describe('Hook called on plugin upgrade'),
209
+ });
210
+ /**
211
+ * Complete Plugin Definition Schema
212
+ *
213
+ * Combines lifecycle hooks with plugin metadata.
214
+ */
215
+ exports.PluginSchema = exports.PluginLifecycleSchema.extend({
216
+ /**
217
+ * Plugin metadata identifier.
218
+ * Should match the id in the manifest.
219
+ */
220
+ id: zod_1.z.string().optional().describe('Plugin identifier'),
221
+ /**
222
+ * Plugin version.
223
+ * Should match the version in the manifest.
224
+ */
225
+ version: zod_1.z.string().optional().describe('Plugin version'),
226
+ });
@@ -26,8 +26,8 @@ export declare const TerritoryModelSchema: z.ZodObject<{
26
26
  startDate: z.ZodOptional<z.ZodString>;
27
27
  endDate: z.ZodOptional<z.ZodString>;
28
28
  }, "strip", z.ZodTypeAny, {
29
- name: string;
30
29
  state: "active" | "planning" | "archived";
30
+ name: string;
31
31
  startDate?: string | undefined;
32
32
  endDate?: string | undefined;
33
33
  }, {
@@ -31,7 +31,7 @@ export declare const WebhookSchema: z.ZodObject<{
31
31
  url: string;
32
32
  name: string;
33
33
  method: "GET" | "POST" | "PUT";
34
- triggers: ("api" | "update" | "create" | "delete" | "undelete")[];
34
+ triggers: ("create" | "update" | "delete" | "api" | "undelete")[];
35
35
  includeSession: boolean;
36
36
  retryCount: number;
37
37
  isActive: boolean;
@@ -43,10 +43,10 @@ export declare const WebhookSchema: z.ZodObject<{
43
43
  object: string;
44
44
  url: string;
45
45
  name: string;
46
- triggers: ("api" | "update" | "create" | "delete" | "undelete")[];
46
+ triggers: ("create" | "update" | "delete" | "api" | "undelete")[];
47
47
  label?: string | undefined;
48
- method?: "GET" | "POST" | "PUT" | undefined;
49
48
  secret?: string | undefined;
49
+ method?: "GET" | "POST" | "PUT" | undefined;
50
50
  headers?: Record<string, string> | undefined;
51
51
  payloadFields?: string[] | undefined;
52
52
  includeSession?: boolean | undefined;
@@ -6,7 +6,7 @@ import { z } from 'zod';
6
6
  export declare const ActionParamSchema: z.ZodObject<{
7
7
  name: z.ZodString;
8
8
  label: z.ZodString;
9
- type: z.ZodEnum<["text", "textarea", "email", "url", "phone", "password", "markdown", "html", "number", "currency", "percent", "date", "datetime", "time", "boolean", "select", "multiselect", "lookup", "master_detail", "image", "file", "avatar", "formula", "summary", "autonumber"]>;
9
+ type: z.ZodEnum<["text", "textarea", "email", "url", "phone", "password", "markdown", "html", "richtext", "number", "currency", "percent", "date", "datetime", "time", "boolean", "select", "lookup", "master_detail", "image", "file", "avatar", "formula", "summary", "autonumber", "location", "address", "code", "color", "rating", "signature"]>;
10
10
  required: z.ZodDefault<z.ZodBoolean>;
11
11
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
12
  label: z.ZodString;
@@ -19,7 +19,7 @@ export declare const ActionParamSchema: z.ZodObject<{
19
19
  label: string;
20
20
  }>, "many">>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
22
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
23
23
  label: string;
24
24
  name: string;
25
25
  required: boolean;
@@ -28,7 +28,7 @@ export declare const ActionParamSchema: z.ZodObject<{
28
28
  label: string;
29
29
  }[] | undefined;
30
30
  }, {
31
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
31
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
32
32
  label: string;
33
33
  name: string;
34
34
  options?: {
@@ -60,7 +60,7 @@ export declare const ActionSchema: z.ZodObject<{
60
60
  params: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
61
  name: z.ZodString;
62
62
  label: z.ZodString;
63
- type: z.ZodEnum<["text", "textarea", "email", "url", "phone", "password", "markdown", "html", "number", "currency", "percent", "date", "datetime", "time", "boolean", "select", "multiselect", "lookup", "master_detail", "image", "file", "avatar", "formula", "summary", "autonumber"]>;
63
+ type: z.ZodEnum<["text", "textarea", "email", "url", "phone", "password", "markdown", "html", "richtext", "number", "currency", "percent", "date", "datetime", "time", "boolean", "select", "lookup", "master_detail", "image", "file", "avatar", "formula", "summary", "autonumber", "location", "address", "code", "color", "rating", "signature"]>;
64
64
  required: z.ZodDefault<z.ZodBoolean>;
65
65
  options: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
66
  label: z.ZodString;
@@ -73,7 +73,7 @@ export declare const ActionSchema: z.ZodObject<{
73
73
  label: string;
74
74
  }>, "many">>;
75
75
  }, "strip", z.ZodTypeAny, {
76
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
76
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
77
77
  label: string;
78
78
  name: string;
79
79
  required: boolean;
@@ -82,7 +82,7 @@ export declare const ActionSchema: z.ZodObject<{
82
82
  label: string;
83
83
  }[] | undefined;
84
84
  }, {
85
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
85
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
86
86
  label: string;
87
87
  name: string;
88
88
  options?: {
@@ -102,8 +102,9 @@ export declare const ActionSchema: z.ZodObject<{
102
102
  label: string;
103
103
  name: string;
104
104
  refreshAfter: boolean;
105
+ location?: any;
105
106
  params?: {
106
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
107
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
107
108
  label: string;
108
109
  name: string;
109
110
  required: boolean;
@@ -114,17 +115,17 @@ export declare const ActionSchema: z.ZodObject<{
114
115
  }[] | undefined;
115
116
  icon?: string | undefined;
116
117
  target?: string | undefined;
118
+ execute?: string | undefined;
117
119
  visible?: string | undefined;
118
120
  locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined;
119
- location?: any;
120
- execute?: string | undefined;
121
121
  confirmText?: string | undefined;
122
122
  successMessage?: string | undefined;
123
123
  }, {
124
124
  label: string;
125
125
  name: string;
126
+ location?: any;
126
127
  params?: {
127
- type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "multiselect" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber";
128
+ type: "number" | "boolean" | "text" | "textarea" | "email" | "url" | "phone" | "password" | "markdown" | "html" | "richtext" | "currency" | "percent" | "date" | "datetime" | "time" | "select" | "lookup" | "master_detail" | "image" | "file" | "avatar" | "formula" | "summary" | "autonumber" | "location" | "address" | "code" | "color" | "rating" | "signature";
128
129
  label: string;
129
130
  name: string;
130
131
  options?: {
@@ -136,13 +137,19 @@ export declare const ActionSchema: z.ZodObject<{
136
137
  type?: "url" | "script" | "api" | "flow" | "modal" | undefined;
137
138
  icon?: string | undefined;
138
139
  target?: string | undefined;
140
+ execute?: string | undefined;
139
141
  visible?: string | undefined;
140
142
  locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined;
141
- location?: any;
142
- execute?: string | undefined;
143
143
  confirmText?: string | undefined;
144
144
  successMessage?: string | undefined;
145
145
  refreshAfter?: boolean | undefined;
146
146
  }>;
147
147
  export type Action = z.infer<typeof ActionSchema>;
148
+ export type ActionParam = z.infer<typeof ActionParamSchema>;
149
+ /**
150
+ * Action Factory Helper
151
+ */
152
+ export declare const Action: {
153
+ readonly create: (config: z.input<typeof ActionSchema>) => Action;
154
+ };
148
155
  //# sourceMappingURL=action.zod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action.zod.d.ts","sourceRoot":"","sources":["../../src/ui/action.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CA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MAAM;8BACA,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,KAAG,MAAM;CAC9C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActionSchema = exports.ActionParamSchema = void 0;
3
+ exports.Action = exports.ActionSchema = exports.ActionParamSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const field_zod_1 = require("../data/field.zod");
6
6
  /**
@@ -46,3 +46,9 @@ exports.ActionSchema = zod_1.z.object({
46
46
  /** Access */
47
47
  visible: zod_1.z.string().optional().describe('Formula returning boolean'),
48
48
  });
49
+ /**
50
+ * Action Factory Helper
51
+ */
52
+ exports.Action = {
53
+ create: (config) => exports.ActionSchema.parse(config),
54
+ };
@@ -215,6 +215,8 @@ export declare const AppSchema: z.ZodObject<{
215
215
  name: z.ZodString;
216
216
  /** Display label */
217
217
  label: z.ZodString;
218
+ /** App version */
219
+ version: z.ZodOptional<z.ZodString>;
218
220
  /** Description */
219
221
  description: z.ZodOptional<z.ZodString>;
220
222
  /** Icon name (Lucide) */
@@ -241,7 +243,7 @@ export declare const AppSchema: z.ZodObject<{
241
243
  * Navigation Tree Structure.
242
244
  * Replaces the old flat 'tabs' list with a structured menu.
243
245
  */
244
- navigation: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
246
+ navigation: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
245
247
  /**
246
248
  * App-level Home Page Override
247
249
  * ID of the navigation item to act as the landing page.
@@ -255,37 +257,141 @@ export declare const AppSchema: z.ZodObject<{
255
257
  * Example: ["app.access.crm"]
256
258
  */
257
259
  requiredPermissions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
260
+ /**
261
+ * Package Components (For config file convenience)
262
+ * In a real monorepo these might be auto-discovered, but here we allow explicit registration.
263
+ */
264
+ objects: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
265
+ apis: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
258
266
  }, "strip", z.ZodTypeAny, {
259
267
  label: string;
260
268
  name: string;
261
269
  active: boolean;
262
270
  isDefault: boolean;
263
- navigation: any[];
264
271
  description?: string | undefined;
265
272
  icon?: string | undefined;
273
+ objects?: any[] | undefined;
274
+ version?: string | undefined;
266
275
  branding?: {
267
276
  primaryColor?: string | undefined;
268
277
  logo?: string | undefined;
269
278
  favicon?: string | undefined;
270
279
  } | undefined;
280
+ navigation?: any[] | undefined;
271
281
  homePageId?: string | undefined;
272
282
  requiredPermissions?: string[] | undefined;
283
+ apis?: any[] | undefined;
273
284
  }, {
274
285
  label: string;
275
286
  name: string;
276
- navigation: any[];
277
287
  description?: string | undefined;
278
288
  icon?: string | undefined;
279
289
  active?: boolean | undefined;
290
+ objects?: any[] | undefined;
291
+ version?: string | undefined;
280
292
  branding?: {
281
293
  primaryColor?: string | undefined;
282
294
  logo?: string | undefined;
283
295
  favicon?: string | undefined;
284
296
  } | undefined;
285
297
  isDefault?: boolean | undefined;
298
+ navigation?: any[] | undefined;
286
299
  homePageId?: string | undefined;
287
300
  requiredPermissions?: string[] | undefined;
301
+ apis?: any[] | undefined;
288
302
  }>;
303
+ export declare const App: z.ZodObject<{
304
+ /** Machine name (id) */
305
+ name: z.ZodString;
306
+ /** Display label */
307
+ label: z.ZodString;
308
+ /** App version */
309
+ version: z.ZodOptional<z.ZodString>;
310
+ /** Description */
311
+ description: z.ZodOptional<z.ZodString>;
312
+ /** Icon name (Lucide) */
313
+ icon: z.ZodOptional<z.ZodString>;
314
+ /** Branding/Theming Configuration */
315
+ branding: z.ZodOptional<z.ZodObject<{
316
+ primaryColor: z.ZodOptional<z.ZodString>;
317
+ logo: z.ZodOptional<z.ZodString>;
318
+ favicon: z.ZodOptional<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ primaryColor?: string | undefined;
321
+ logo?: string | undefined;
322
+ favicon?: string | undefined;
323
+ }, {
324
+ primaryColor?: string | undefined;
325
+ logo?: string | undefined;
326
+ favicon?: string | undefined;
327
+ }>>;
328
+ /** Application status */
329
+ active: z.ZodDefault<z.ZodBoolean>;
330
+ /** Is this the default app for new users? */
331
+ isDefault: z.ZodDefault<z.ZodBoolean>;
332
+ /**
333
+ * Navigation Tree Structure.
334
+ * Replaces the old flat 'tabs' list with a structured menu.
335
+ */
336
+ navigation: z.ZodOptional<z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">>;
337
+ /**
338
+ * App-level Home Page Override
339
+ * ID of the navigation item to act as the landing page.
340
+ * If not set, usually defaults to the first navigation item.
341
+ */
342
+ homePageId: z.ZodOptional<z.ZodString>;
343
+ /**
344
+ * Access Control
345
+ * List of permissions required to access this app.
346
+ * Modern replacement for role/profile based assignment.
347
+ * Example: ["app.access.crm"]
348
+ */
349
+ requiredPermissions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
350
+ /**
351
+ * Package Components (For config file convenience)
352
+ * In a real monorepo these might be auto-discovered, but here we allow explicit registration.
353
+ */
354
+ objects: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
355
+ apis: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
356
+ }, "strip", z.ZodTypeAny, {
357
+ label: string;
358
+ name: string;
359
+ active: boolean;
360
+ isDefault: boolean;
361
+ description?: string | undefined;
362
+ icon?: string | undefined;
363
+ objects?: any[] | undefined;
364
+ version?: string | undefined;
365
+ branding?: {
366
+ primaryColor?: string | undefined;
367
+ logo?: string | undefined;
368
+ favicon?: string | undefined;
369
+ } | undefined;
370
+ navigation?: any[] | undefined;
371
+ homePageId?: string | undefined;
372
+ requiredPermissions?: string[] | undefined;
373
+ apis?: any[] | undefined;
374
+ }, {
375
+ label: string;
376
+ name: string;
377
+ description?: string | undefined;
378
+ icon?: string | undefined;
379
+ active?: boolean | undefined;
380
+ objects?: any[] | undefined;
381
+ version?: string | undefined;
382
+ branding?: {
383
+ primaryColor?: string | undefined;
384
+ logo?: string | undefined;
385
+ favicon?: string | undefined;
386
+ } | undefined;
387
+ isDefault?: boolean | undefined;
388
+ navigation?: any[] | undefined;
389
+ homePageId?: string | undefined;
390
+ requiredPermissions?: string[] | undefined;
391
+ apis?: any[] | undefined;
392
+ }> & {
393
+ create: <T extends z.input<typeof AppSchema>>(config: T) => T;
394
+ };
289
395
  export type App = z.infer<typeof AppSchema>;
290
396
  export type AppBranding = z.infer<typeof AppBrandingSchema>;
291
397
  export type NavigationItem = z.infer<typeof NavigationItemSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"app.zod.d.ts","sourceRoot":"","sources":["../../src/ui/app.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IArB9B,qCAAqC;;IAGrC,oBAAoB;;IAGpB,yBAAyB;;IAGzB;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;EAYH,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,sBAAsB;IA/BjC,qCAAqC;;IAGrC,oBAAoB;;IAGpB,yBAAyB;;IAGzB;;;;OAIG;;;;;;;;;;;;;;;;;;;EAqBH,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;IAxC5B,qCAAqC;;IAGrC,oBAAoB;;IAGpB,yBAAyB;;IAGzB;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;EA+BH,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAlD3B,qCAAqC;;IAGrC,oBAAoB;;IAGpB,yBAAyB;;IAGzB;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;EAyCH,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;IA7D7B,qCAAqC;;IAGrC,oBAAoB;;IAGpB,yBAAyB;;IAGzB;;;;OAIG;;;;;;;;;;;;;;;;;;;EAoDH,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,CAAC,CAAC,O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,kBAAkB;;IAGlB,yBAAyB;;IAGzB,qCAAqC;;;;;;;;;;;;;;IAGrC,yBAAyB;;IAGzB,6CAA6C;;IAG7C;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;;;OAKG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAMM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,UAAU,CAAC;CACvD,CAAC;AAGH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,GAAG;IAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;CAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppSchema = exports.AppBrandingSchema = exports.NavigationItemSchema = exports.GroupNavItemSchema = exports.UrlNavItemSchema = exports.PageNavItemSchema = exports.DashboardNavItemSchema = exports.ObjectNavItemSchema = void 0;
3
+ exports.App = exports.AppSchema = exports.AppBrandingSchema = exports.NavigationItemSchema = exports.GroupNavItemSchema = exports.UrlNavItemSchema = exports.PageNavItemSchema = exports.DashboardNavItemSchema = exports.ObjectNavItemSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  /**
6
6
  * Base Navigation Item Schema
@@ -96,6 +96,8 @@ exports.AppSchema = zod_1.z.object({
96
96
  name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('App unique machine name'),
97
97
  /** Display label */
98
98
  label: zod_1.z.string().describe('App display label'),
99
+ /** App version */
100
+ version: zod_1.z.string().optional().describe('App version'),
99
101
  /** Description */
100
102
  description: zod_1.z.string().optional().describe('App description'),
101
103
  /** Icon name (Lucide) */
@@ -110,7 +112,7 @@ exports.AppSchema = zod_1.z.object({
110
112
  * Navigation Tree Structure.
111
113
  * Replaces the old flat 'tabs' list with a structured menu.
112
114
  */
113
- navigation: zod_1.z.array(exports.NavigationItemSchema).describe('Structured navigation menu tree'),
115
+ navigation: zod_1.z.array(exports.NavigationItemSchema).optional().describe('Structured navigation menu tree'),
114
116
  /**
115
117
  * App-level Home Page Override
116
118
  * ID of the navigation item to act as the landing page.
@@ -124,4 +126,13 @@ exports.AppSchema = zod_1.z.object({
124
126
  * Example: ["app.access.crm"]
125
127
  */
126
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,
127
138
  });