@objectstack/spec 0.1.0 → 0.1.1

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 (231) hide show
  1. package/README.md +66 -125
  2. package/dist/ai/agent.zod.d.ts +164 -0
  3. package/dist/ai/agent.zod.d.ts.map +1 -0
  4. package/dist/ai/agent.zod.js +51 -0
  5. package/dist/data/dataset.zod.d.ts +60 -0
  6. package/dist/data/dataset.zod.d.ts.map +1 -0
  7. package/dist/data/dataset.zod.js +54 -0
  8. package/dist/data/field.zod.d.ts +170 -0
  9. package/dist/data/field.zod.d.ts.map +1 -0
  10. package/dist/data/field.zod.js +81 -0
  11. package/dist/data/flow.zod.d.ts +242 -0
  12. package/dist/data/flow.zod.d.ts.map +1 -0
  13. package/dist/data/flow.zod.js +77 -0
  14. package/dist/data/mapping.zod.d.ts +257 -0
  15. package/dist/data/mapping.zod.d.ts.map +1 -0
  16. package/dist/data/mapping.zod.js +65 -0
  17. package/dist/data/object.zod.d.ts +364 -0
  18. package/dist/data/object.zod.d.ts.map +1 -0
  19. package/dist/data/object.zod.js +54 -0
  20. package/dist/data/permission.zod.d.ts +163 -0
  21. package/dist/data/permission.zod.d.ts.map +1 -0
  22. package/dist/data/permission.zod.js +62 -0
  23. package/dist/data/query.zod.d.ts +89 -0
  24. package/dist/data/query.zod.d.ts.map +1 -0
  25. package/dist/data/query.zod.js +71 -0
  26. package/dist/data/sharing.zod.d.ts +63 -0
  27. package/dist/data/sharing.zod.d.ts.map +1 -0
  28. package/dist/data/sharing.zod.js +57 -0
  29. package/dist/data/validation.zod.d.ts +236 -0
  30. package/dist/data/validation.zod.d.ts.map +1 -0
  31. package/dist/data/validation.zod.js +59 -0
  32. package/dist/data/workflow.zod.d.ts +195 -0
  33. package/dist/data/workflow.zod.d.ts.map +1 -0
  34. package/dist/data/workflow.zod.js +64 -0
  35. package/dist/index.d.ts +33 -5
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +53 -5
  38. package/dist/system/api.zod.d.ts +168 -0
  39. package/dist/system/api.zod.d.ts.map +1 -0
  40. package/dist/system/api.zod.js +53 -0
  41. package/dist/system/constants/index.d.ts +11 -0
  42. package/dist/system/constants/index.d.ts.map +1 -0
  43. package/dist/system/constants/index.js +26 -0
  44. package/dist/system/constants/paths.d.ts +71 -0
  45. package/dist/system/constants/paths.d.ts.map +1 -0
  46. package/dist/system/constants/paths.js +65 -0
  47. package/dist/system/datasource.zod.d.ts +127 -0
  48. package/dist/system/datasource.zod.d.ts.map +1 -0
  49. package/dist/system/datasource.zod.js +62 -0
  50. package/dist/system/identity.zod.d.ts +204 -0
  51. package/dist/system/identity.zod.d.ts.map +1 -0
  52. package/dist/system/identity.zod.js +68 -0
  53. package/dist/system/license.zod.d.ts +110 -0
  54. package/dist/system/license.zod.d.ts.map +1 -0
  55. package/dist/system/license.zod.js +63 -0
  56. package/dist/system/manifest.zod.d.ts +126 -0
  57. package/dist/system/manifest.zod.d.ts.map +1 -0
  58. package/dist/system/manifest.zod.js +68 -0
  59. package/dist/system/policy.zod.d.ts +209 -0
  60. package/dist/system/policy.zod.d.ts.map +1 -0
  61. package/dist/system/policy.zod.js +54 -0
  62. package/dist/system/role.zod.d.ts +34 -0
  63. package/dist/system/role.zod.d.ts.map +1 -0
  64. package/dist/system/role.zod.js +25 -0
  65. package/dist/system/territory.zod.d.ts +91 -0
  66. package/dist/system/territory.zod.d.ts.map +1 -0
  67. package/dist/system/territory.zod.js +64 -0
  68. package/dist/system/translation.zod.d.ts +171 -0
  69. package/dist/system/translation.zod.d.ts.map +1 -0
  70. package/dist/system/translation.zod.js +34 -0
  71. package/dist/system/types/index.d.ts +7 -0
  72. package/dist/system/types/index.d.ts.map +1 -0
  73. package/dist/system/types/index.js +22 -0
  74. package/dist/system/types/plugin.d.ts +113 -0
  75. package/dist/system/types/plugin.d.ts.map +1 -0
  76. package/dist/system/types/plugin.js +6 -0
  77. package/dist/system/webhook.zod.d.ts +106 -0
  78. package/dist/system/webhook.zod.d.ts.map +1 -0
  79. package/dist/system/webhook.zod.js +56 -0
  80. package/dist/ui/action.zod.d.ts +148 -0
  81. package/dist/ui/action.zod.d.ts.map +1 -0
  82. package/dist/ui/action.zod.js +48 -0
  83. package/dist/ui/app.zod.d.ts +299 -0
  84. package/dist/ui/app.zod.d.ts.map +1 -0
  85. package/dist/ui/app.zod.js +127 -0
  86. package/dist/ui/dashboard.zod.d.ts +207 -0
  87. package/dist/ui/dashboard.zod.d.ts.map +1 -0
  88. package/dist/ui/dashboard.zod.js +66 -0
  89. package/dist/ui/page.zod.d.ts +187 -0
  90. package/dist/ui/page.zod.d.ts.map +1 -0
  91. package/dist/ui/page.zod.js +48 -0
  92. package/dist/ui/report.zod.d.ts +224 -0
  93. package/dist/ui/report.zod.d.ts.map +1 -0
  94. package/dist/ui/report.zod.js +68 -0
  95. package/dist/ui/view.zod.d.ts +887 -0
  96. package/dist/ui/view.zod.d.ts.map +1 -0
  97. package/dist/ui/view.zod.js +83 -0
  98. package/json-schema/AIKnowledge.json +30 -0
  99. package/json-schema/AIModelConfig.json +41 -0
  100. package/json-schema/AITool.json +33 -0
  101. package/json-schema/Action.json +156 -0
  102. package/json-schema/ActionParam.json +76 -0
  103. package/json-schema/Agent.json +140 -0
  104. package/json-schema/ApiEndpoint.json +162 -0
  105. package/json-schema/ApiMapping.json +28 -0
  106. package/json-schema/App.json +286 -0
  107. package/json-schema/AppBranding.json +24 -0
  108. package/json-schema/AuditPolicy.json +31 -0
  109. package/json-schema/AuthProtocol.json +17 -0
  110. package/json-schema/AuthProvider.json +171 -0
  111. package/json-schema/CalendarConfig.json +28 -0
  112. package/json-schema/ChartType.json +19 -0
  113. package/json-schema/Dashboard.json +117 -0
  114. package/json-schema/DashboardNavItem.json +42 -0
  115. package/json-schema/DashboardWidget.json +89 -0
  116. package/json-schema/Dataset.json +63 -0
  117. package/json-schema/DatasetMode.json +16 -0
  118. package/json-schema/Datasource.json +93 -0
  119. package/json-schema/DatasourceCapabilities.json +36 -0
  120. package/json-schema/DriverType.json +27 -0
  121. package/json-schema/EmailAlertAction.json +37 -0
  122. package/json-schema/Feature.json +51 -0
  123. package/json-schema/Field.json +219 -0
  124. package/json-schema/FieldMapping.json +83 -0
  125. package/json-schema/FieldNode.json +32 -0
  126. package/json-schema/FieldPermission.json +22 -0
  127. package/json-schema/FieldType.json +36 -0
  128. package/json-schema/FieldUpdateAction.json +32 -0
  129. package/json-schema/FilterNode.json +52 -0
  130. package/json-schema/FilterOperator.json +26 -0
  131. package/json-schema/Flow.json +186 -0
  132. package/json-schema/FlowEdge.json +37 -0
  133. package/json-schema/FlowNode.json +65 -0
  134. package/json-schema/FlowNodeAction.json +24 -0
  135. package/json-schema/FlowVariable.json +34 -0
  136. package/json-schema/FormSection.json +42 -0
  137. package/json-schema/FormView.json +99 -0
  138. package/json-schema/FormatValidation.json +59 -0
  139. package/json-schema/GanttConfig.json +32 -0
  140. package/json-schema/GroupNavItem.json +42 -0
  141. package/json-schema/HttpMethod.json +16 -0
  142. package/json-schema/Index.json +30 -0
  143. package/json-schema/KanbanConfig.json +31 -0
  144. package/json-schema/LDAPConfig.json +39 -0
  145. package/json-schema/License.json +57 -0
  146. package/json-schema/ListView.json +153 -0
  147. package/json-schema/Locale.json +10 -0
  148. package/json-schema/LogicOperator.json +14 -0
  149. package/json-schema/Manifest.json +90 -0
  150. package/json-schema/Mapping.json +270 -0
  151. package/json-schema/MenuItem.json +28 -0
  152. package/json-schema/MetricType.json +14 -0
  153. package/json-schema/NavigationItem.json +214 -0
  154. package/json-schema/NetworkPolicy.json +31 -0
  155. package/json-schema/OIDCConfig.json +46 -0
  156. package/json-schema/OWDModel.json +14 -0
  157. package/json-schema/Object.json +331 -0
  158. package/json-schema/ObjectCapabilities.json +36 -0
  159. package/json-schema/ObjectNavItem.json +46 -0
  160. package/json-schema/ObjectPermission.json +42 -0
  161. package/json-schema/Page.json +117 -0
  162. package/json-schema/PageComponent.json +36 -0
  163. package/json-schema/PageNavItem.json +47 -0
  164. package/json-schema/PageRegion.json +63 -0
  165. package/json-schema/PasswordPolicy.json +41 -0
  166. package/json-schema/PermissionSet.json +96 -0
  167. package/json-schema/Plan.json +53 -0
  168. package/json-schema/Policy.json +138 -0
  169. package/json-schema/Query.json +128 -0
  170. package/json-schema/RateLimit.json +26 -0
  171. package/json-schema/Report.json +219 -0
  172. package/json-schema/ReportChart.json +45 -0
  173. package/json-schema/ReportColumn.json +35 -0
  174. package/json-schema/ReportGrouping.json +38 -0
  175. package/json-schema/ReportType.json +15 -0
  176. package/json-schema/Role.json +32 -0
  177. package/json-schema/SAMLConfig.json +44 -0
  178. package/json-schema/ScriptValidation.json +48 -0
  179. package/json-schema/SelectOption.json +32 -0
  180. package/json-schema/SessionPolicy.json +27 -0
  181. package/json-schema/SharingLevel.json +13 -0
  182. package/json-schema/SharingRule.json +58 -0
  183. package/json-schema/SharingRuleType.json +15 -0
  184. package/json-schema/SortNode.json +26 -0
  185. package/json-schema/StateMachineValidation.json +59 -0
  186. package/json-schema/Territory.json +77 -0
  187. package/json-schema/TerritoryModel.json +34 -0
  188. package/json-schema/TerritoryType.json +15 -0
  189. package/json-schema/TransformType.json +18 -0
  190. package/json-schema/TranslationBundle.json +78 -0
  191. package/json-schema/TranslationData.json +75 -0
  192. package/json-schema/UniquenessValidation.json +59 -0
  193. package/json-schema/UrlNavItem.json +51 -0
  194. package/json-schema/ValidationRule.json +211 -0
  195. package/json-schema/View.json +500 -0
  196. package/json-schema/Webhook.json +88 -0
  197. package/json-schema/WebhookReceiver.json +66 -0
  198. package/json-schema/WebhookTriggerType.json +16 -0
  199. package/json-schema/WorkflowAction.json +84 -0
  200. package/json-schema/WorkflowRule.json +128 -0
  201. package/json-schema/WorkflowTriggerType.json +16 -0
  202. package/package.json +28 -19
  203. package/dist/examples.d.ts +0 -28
  204. package/dist/examples.d.ts.map +0 -1
  205. package/dist/examples.js +0 -250
  206. package/dist/types/index.d.ts +0 -9
  207. package/dist/types/index.d.ts.map +0 -1
  208. package/dist/types/index.js +0 -8
  209. package/dist/types/meta/field-type.d.ts +0 -54
  210. package/dist/types/meta/field-type.d.ts.map +0 -1
  211. package/dist/types/meta/field-type.js +0 -42
  212. package/dist/types/meta/index.d.ts +0 -13
  213. package/dist/types/meta/index.d.ts.map +0 -1
  214. package/dist/types/meta/index.js +0 -12
  215. package/dist/types/meta/object-entity.d.ts +0 -246
  216. package/dist/types/meta/object-entity.d.ts.map +0 -1
  217. package/dist/types/meta/object-entity.js +0 -9
  218. package/dist/types/meta/object-field.d.ts +0 -199
  219. package/dist/types/meta/object-field.d.ts.map +0 -1
  220. package/dist/types/meta/object-field.js +0 -9
  221. package/dist/types/meta/object-view.d.ts +0 -430
  222. package/dist/types/meta/object-view.d.ts.map +0 -1
  223. package/dist/types/meta/object-view.js +0 -9
  224. package/src/examples.ts +0 -257
  225. package/src/index.ts +0 -10
  226. package/src/types/index.ts +0 -9
  227. package/src/types/meta/field-type.ts +0 -91
  228. package/src/types/meta/index.ts +0 -13
  229. package/src/types/meta/object-entity.ts +0 -265
  230. package/src/types/meta/object-field.ts +0 -218
  231. package/src/types/meta/object-view.ts +0 -475
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TranslationBundleSchema = exports.LocaleSchema = exports.TranslationDataSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Translation Schema
7
+ * Supports i18n for labels, messages, and options.
8
+ * Example structure:
9
+ * {
10
+ * "en": { "objects": { "account": { "label": "Account" } } },
11
+ * "zh-CN": { "objects": { "account": { "label": "客户" } } }
12
+ * }
13
+ */
14
+ exports.TranslationDataSchema = zod_1.z.object({
15
+ /** Object translations */
16
+ objects: zod_1.z.record(zod_1.z.object({
17
+ label: zod_1.z.string(),
18
+ pluralLabel: zod_1.z.string().optional(),
19
+ fields: zod_1.z.record(zod_1.z.object({
20
+ label: zod_1.z.string().optional(),
21
+ help: zod_1.z.string().optional(),
22
+ options: zod_1.z.record(zod_1.z.string()).optional(), // Option value -> Label map
23
+ })).optional(),
24
+ })).optional(),
25
+ /** App/Menu translations */
26
+ apps: zod_1.z.record(zod_1.z.object({
27
+ label: zod_1.z.string(),
28
+ description: zod_1.z.string().optional(),
29
+ })).optional(),
30
+ /** UI Messages */
31
+ messages: zod_1.z.record(zod_1.z.string()).optional(),
32
+ });
33
+ exports.LocaleSchema = zod_1.z.string().describe('BCP-47 Language Tag (e.g. en-US, zh-CN)');
34
+ exports.TranslationBundleSchema = zod_1.z.record(exports.LocaleSchema, exports.TranslationDataSchema);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ObjectStack Plugin Runtime Interfaces
3
+ *
4
+ * This package defines the contract that every plugin must implement to be loaded by ObjectOS.
5
+ */
6
+ export * from './plugin';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/system/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,UAAU,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * ObjectStack Plugin Runtime Interfaces
4
+ *
5
+ * This package defines the contract that every plugin must implement to be loaded by ObjectOS.
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./plugin"), exports);
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Runtime interfaces for ObjectStack plugins.
3
+ * These define the contract that every plugin must implement to be loaded by ObjectOS.
4
+ */
5
+ /**
6
+ * Logger interface provided to plugins for structured logging.
7
+ */
8
+ export interface PluginLogger {
9
+ /** Log an informational message */
10
+ info(message: string, meta?: Record<string, any>): void;
11
+ /** Log a warning message */
12
+ warn(message: string, meta?: Record<string, any>): void;
13
+ /** Log an error message */
14
+ error(message: string, error?: Error, meta?: Record<string, any>): void;
15
+ /** Log a debug message */
16
+ debug(message: string, meta?: Record<string, any>): void;
17
+ }
18
+ /**
19
+ * ObjectQL Client interface for database operations.
20
+ * Provides a GraphQL-like query interface to the ObjectStack data layer.
21
+ */
22
+ export interface ObjectQLClient {
23
+ /**
24
+ * Execute a query against the ObjectQL engine.
25
+ * @param query - The ObjectQL query string
26
+ * @param variables - Optional variables for the query
27
+ * @returns Promise resolving to query results
28
+ */
29
+ query<T = any>(query: string, variables?: Record<string, any>): Promise<T>;
30
+ /**
31
+ * Execute a mutation against the ObjectQL engine.
32
+ * @param mutation - The ObjectQL mutation string
33
+ * @param variables - Optional variables for the mutation
34
+ * @returns Promise resolving to mutation results
35
+ */
36
+ mutate<T = any>(mutation: string, variables?: Record<string, any>): Promise<T>;
37
+ }
38
+ /**
39
+ * ObjectOS Kernel interface.
40
+ * Provides access to core operating system services.
41
+ */
42
+ export interface ObjectOSKernel {
43
+ /**
44
+ * Get a reference to another installed plugin by its ID.
45
+ * @param pluginId - The unique identifier of the plugin
46
+ * @returns The plugin instance or null if not found
47
+ */
48
+ getPlugin(pluginId: string): any | null;
49
+ /**
50
+ * Emit an event to the system event bus.
51
+ * @param event - The event name
52
+ * @param data - The event payload
53
+ */
54
+ emit(event: string, data?: any): void;
55
+ /**
56
+ * Subscribe to system events.
57
+ * @param event - The event name to listen for
58
+ * @param handler - Callback function to handle the event
59
+ * @returns Unsubscribe function
60
+ */
61
+ on(event: string, handler: (data: any) => void): () => void;
62
+ }
63
+ /**
64
+ * Plugin Context provided to plugin lifecycle methods.
65
+ * This context gives plugins access to the ObjectStack runtime environment.
66
+ */
67
+ export interface PluginContext {
68
+ /**
69
+ * ObjectQL client for database operations.
70
+ * Use this to query and mutate data in the ObjectStack data layer.
71
+ */
72
+ ql: ObjectQLClient;
73
+ /**
74
+ * ObjectOS kernel for system-level operations.
75
+ * Use this to interact with other plugins and system services.
76
+ */
77
+ os: ObjectOSKernel;
78
+ /**
79
+ * Logger instance for structured logging.
80
+ * All logs are automatically tagged with the plugin ID.
81
+ */
82
+ logger: PluginLogger;
83
+ /**
84
+ * The unique identifier of this plugin.
85
+ */
86
+ pluginId: string;
87
+ /**
88
+ * Plugin configuration values (from manifest or runtime config).
89
+ */
90
+ config: Record<string, any>;
91
+ }
92
+ /**
93
+ * Plugin Lifecycle Interface.
94
+ * Every ObjectStack plugin must default export an object implementing this interface.
95
+ */
96
+ export interface ObjectStackPlugin {
97
+ /**
98
+ * Called when the plugin is installed for the first time.
99
+ * Use this to run one-time setup tasks (e.g. creating database tables).
100
+ */
101
+ onInstall?: (context: PluginContext) => Promise<void>;
102
+ /**
103
+ * Called when the plugin is enabled (at startup or manually).
104
+ * Use this to register event listeners, start background tasks, etc.
105
+ */
106
+ onEnable?: (context: PluginContext) => Promise<void>;
107
+ /**
108
+ * Called when the plugin is disabled (at shutdown or manually).
109
+ * Use this to cleanup resources, stop tasks, remove listeners.
110
+ */
111
+ onDisable?: (context: PluginContext) => Promise<void>;
112
+ }
113
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/system/types/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxD,4BAA4B;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxD,2BAA2B;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACxE,0BAA0B;IAC1B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;CAC1D;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,KAAK,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE3E;;;;;OAKG;IACH,MAAM,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChF;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC;IAExC;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC;IAEtC;;;;;OAKG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC7D;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,EAAE,EAAE,cAAc,CAAC;IAEnB;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Runtime interfaces for ObjectStack plugins.
4
+ * These define the contract that every plugin must implement to be loaded by ObjectOS.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,106 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Webhook Trigger Event
4
+ * When should this webhook fire?
5
+ */
6
+ export declare const WebhookTriggerType: z.ZodEnum<["create", "update", "delete", "undelete", "api"]>;
7
+ /**
8
+ * Webhook Schema
9
+ * outbound Integration: Push data to external URL when events happen.
10
+ */
11
+ export declare const WebhookSchema: z.ZodObject<{
12
+ name: z.ZodString;
13
+ label: z.ZodOptional<z.ZodString>;
14
+ /** Scope */
15
+ object: z.ZodString;
16
+ triggers: z.ZodArray<z.ZodEnum<["create", "update", "delete", "undelete", "api"]>, "many">;
17
+ /** Target */
18
+ url: z.ZodString;
19
+ method: z.ZodDefault<z.ZodEnum<["POST", "PUT", "GET"]>>;
20
+ /** Security */
21
+ secret: z.ZodOptional<z.ZodString>;
22
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
23
+ /** Payload Configuration */
24
+ payloadFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
+ includeSession: z.ZodDefault<z.ZodBoolean>;
26
+ /** Reliability */
27
+ retryCount: z.ZodDefault<z.ZodNumber>;
28
+ isActive: z.ZodDefault<z.ZodBoolean>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ object: string;
31
+ url: string;
32
+ name: string;
33
+ method: "GET" | "POST" | "PUT";
34
+ triggers: ("api" | "update" | "create" | "delete" | "undelete")[];
35
+ includeSession: boolean;
36
+ retryCount: number;
37
+ isActive: boolean;
38
+ label?: string | undefined;
39
+ secret?: string | undefined;
40
+ headers?: Record<string, string> | undefined;
41
+ payloadFields?: string[] | undefined;
42
+ }, {
43
+ object: string;
44
+ url: string;
45
+ name: string;
46
+ triggers: ("api" | "update" | "create" | "delete" | "undelete")[];
47
+ label?: string | undefined;
48
+ method?: "GET" | "POST" | "PUT" | undefined;
49
+ secret?: string | undefined;
50
+ headers?: Record<string, string> | undefined;
51
+ payloadFields?: string[] | undefined;
52
+ includeSession?: boolean | undefined;
53
+ retryCount?: number | undefined;
54
+ isActive?: boolean | undefined;
55
+ }>;
56
+ /**
57
+ * Webhook Receiver Schema (Inbound)
58
+ * Handling incoming HTTP hooks from Stripe, Slack, etc.
59
+ */
60
+ export declare const WebhookReceiverSchema: z.ZodObject<{
61
+ name: z.ZodString;
62
+ path: z.ZodString;
63
+ /** Verification */
64
+ verificationType: z.ZodDefault<z.ZodEnum<["none", "header_token", "hmac", "ip_whitelist"]>>;
65
+ verificationParams: z.ZodOptional<z.ZodObject<{
66
+ header: z.ZodOptional<z.ZodString>;
67
+ secret: z.ZodOptional<z.ZodString>;
68
+ ips: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ secret?: string | undefined;
71
+ header?: string | undefined;
72
+ ips?: string[] | undefined;
73
+ }, {
74
+ secret?: string | undefined;
75
+ header?: string | undefined;
76
+ ips?: string[] | undefined;
77
+ }>>;
78
+ /** Action */
79
+ action: z.ZodDefault<z.ZodEnum<["trigger_flow", "script", "upsert_record"]>>;
80
+ target: z.ZodString;
81
+ }, "strip", z.ZodTypeAny, {
82
+ path: string;
83
+ name: string;
84
+ target: string;
85
+ action: "script" | "trigger_flow" | "upsert_record";
86
+ verificationType: "none" | "header_token" | "hmac" | "ip_whitelist";
87
+ verificationParams?: {
88
+ secret?: string | undefined;
89
+ header?: string | undefined;
90
+ ips?: string[] | undefined;
91
+ } | undefined;
92
+ }, {
93
+ path: string;
94
+ name: string;
95
+ target: string;
96
+ action?: "script" | "trigger_flow" | "upsert_record" | undefined;
97
+ verificationType?: "none" | "header_token" | "hmac" | "ip_whitelist" | undefined;
98
+ verificationParams?: {
99
+ secret?: string | undefined;
100
+ header?: string | undefined;
101
+ ips?: string[] | undefined;
102
+ } | undefined;
103
+ }>;
104
+ export type Webhook = z.infer<typeof WebhookSchema>;
105
+ export type WebhookReceiver = z.infer<typeof WebhookReceiverSchema>;
106
+ //# sourceMappingURL=webhook.zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.zod.d.ts","sourceRoot":"","sources":["../../src/system/webhook.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB,8DAM7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa;;;IAIxB,YAAY;;;IAIZ,aAAa;;;IAIb,eAAe;;;IAIf,4BAA4B;;;IAI5B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;IAIhC,mBAAmB;;;;;;;;;;;;;;;IAQnB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;EAGb,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookReceiverSchema = exports.WebhookSchema = exports.WebhookTriggerType = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Webhook Trigger Event
7
+ * When should this webhook fire?
8
+ */
9
+ exports.WebhookTriggerType = zod_1.z.enum([
10
+ 'create',
11
+ 'update',
12
+ 'delete',
13
+ 'undelete',
14
+ 'api' // Manually triggered
15
+ ]);
16
+ /**
17
+ * Webhook Schema
18
+ * outbound Integration: Push data to external URL when events happen.
19
+ */
20
+ exports.WebhookSchema = zod_1.z.object({
21
+ name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/),
22
+ label: zod_1.z.string().optional(),
23
+ /** Scope */
24
+ object: zod_1.z.string().describe('Object to listen to'),
25
+ triggers: zod_1.z.array(exports.WebhookTriggerType).describe('Events that trigger execution'),
26
+ /** Target */
27
+ url: zod_1.z.string().url().describe('External URL payload'),
28
+ method: zod_1.z.enum(['POST', 'PUT', 'GET']).default('POST'),
29
+ /** Security */
30
+ secret: zod_1.z.string().optional().describe('Signing secret (HMAC)'),
31
+ headers: zod_1.z.record(zod_1.z.string()).optional().describe('Custom headers (Auth)'),
32
+ /** Payload Configuration */
33
+ payloadFields: zod_1.z.array(zod_1.z.string()).optional().describe('Fields to include. Empty = All'),
34
+ includeSession: zod_1.z.boolean().default(false).describe('Include user session info'),
35
+ /** Reliability */
36
+ retryCount: zod_1.z.number().default(3),
37
+ isActive: zod_1.z.boolean().default(true)
38
+ });
39
+ /**
40
+ * Webhook Receiver Schema (Inbound)
41
+ * Handling incoming HTTP hooks from Stripe, Slack, etc.
42
+ */
43
+ exports.WebhookReceiverSchema = zod_1.z.object({
44
+ name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/),
45
+ path: zod_1.z.string().describe('URL Path (e.g. /webhooks/stripe)'),
46
+ /** Verification */
47
+ verificationType: zod_1.z.enum(['none', 'header_token', 'hmac', 'ip_whitelist']).default('none'),
48
+ verificationParams: zod_1.z.object({
49
+ header: zod_1.z.string().optional(),
50
+ secret: zod_1.z.string().optional(),
51
+ ips: zod_1.z.array(zod_1.z.string()).optional()
52
+ }).optional(),
53
+ /** Action */
54
+ action: zod_1.z.enum(['trigger_flow', 'script', 'upsert_record']).default('trigger_flow'),
55
+ target: zod_1.z.string().describe('Flow ID or Script name'),
56
+ });
@@ -0,0 +1,148 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Action Parameter Schema
4
+ * Defines inputs required before executing an action.
5
+ */
6
+ export declare const ActionParamSchema: z.ZodObject<{
7
+ name: z.ZodString;
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"]>;
10
+ required: z.ZodDefault<z.ZodBoolean>;
11
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
+ label: z.ZodString;
13
+ value: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ value: string;
16
+ label: string;
17
+ }, {
18
+ value: string;
19
+ label: string;
20
+ }>, "many">>;
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";
23
+ label: string;
24
+ name: string;
25
+ required: boolean;
26
+ options?: {
27
+ value: string;
28
+ label: string;
29
+ }[] | undefined;
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";
32
+ label: string;
33
+ name: string;
34
+ options?: {
35
+ value: string;
36
+ label: string;
37
+ }[] | undefined;
38
+ required?: boolean | undefined;
39
+ }>;
40
+ /**
41
+ * Action Schema
42
+ */
43
+ export declare const ActionSchema: z.ZodObject<{
44
+ /** Machine name of the action */
45
+ name: z.ZodString;
46
+ /** Display label */
47
+ label: z.ZodString;
48
+ /** Icon name (Lucide) */
49
+ icon: z.ZodOptional<z.ZodString>;
50
+ /** Where does this action appear? */
51
+ locations: z.ZodOptional<z.ZodArray<z.ZodEnum<["list_toolbar", "list_item", "record_header", "record_more", "record_related", "global_nav"]>, "many">>;
52
+ /** Legacy location support */
53
+ location: z.ZodOptional<z.ZodAny>;
54
+ /** What type of interaction? */
55
+ type: z.ZodDefault<z.ZodEnum<["script", "url", "modal", "flow", "api"]>>;
56
+ /** Payload / Target */
57
+ target: z.ZodOptional<z.ZodString>;
58
+ execute: z.ZodOptional<z.ZodString>;
59
+ /** User Input Requirements */
60
+ params: z.ZodOptional<z.ZodArray<z.ZodObject<{
61
+ name: z.ZodString;
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"]>;
64
+ required: z.ZodDefault<z.ZodBoolean>;
65
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
+ label: z.ZodString;
67
+ value: z.ZodString;
68
+ }, "strip", z.ZodTypeAny, {
69
+ value: string;
70
+ label: string;
71
+ }, {
72
+ value: string;
73
+ label: string;
74
+ }>, "many">>;
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";
77
+ label: string;
78
+ name: string;
79
+ required: boolean;
80
+ options?: {
81
+ value: string;
82
+ label: string;
83
+ }[] | undefined;
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";
86
+ label: string;
87
+ name: string;
88
+ options?: {
89
+ value: string;
90
+ label: string;
91
+ }[] | undefined;
92
+ required?: boolean | undefined;
93
+ }>, "many">>;
94
+ /** UX Behavior */
95
+ confirmText: z.ZodOptional<z.ZodString>;
96
+ successMessage: z.ZodOptional<z.ZodString>;
97
+ refreshAfter: z.ZodDefault<z.ZodBoolean>;
98
+ /** Access */
99
+ visible: z.ZodOptional<z.ZodString>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ type: "url" | "script" | "api" | "flow" | "modal";
102
+ label: string;
103
+ name: string;
104
+ refreshAfter: boolean;
105
+ 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
+ label: string;
108
+ name: string;
109
+ required: boolean;
110
+ options?: {
111
+ value: string;
112
+ label: string;
113
+ }[] | undefined;
114
+ }[] | undefined;
115
+ icon?: string | undefined;
116
+ target?: string | undefined;
117
+ visible?: string | undefined;
118
+ locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined;
119
+ location?: any;
120
+ execute?: string | undefined;
121
+ confirmText?: string | undefined;
122
+ successMessage?: string | undefined;
123
+ }, {
124
+ label: string;
125
+ name: string;
126
+ 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
+ label: string;
129
+ name: string;
130
+ options?: {
131
+ value: string;
132
+ label: string;
133
+ }[] | undefined;
134
+ required?: boolean | undefined;
135
+ }[] | undefined;
136
+ type?: "url" | "script" | "api" | "flow" | "modal" | undefined;
137
+ icon?: string | undefined;
138
+ target?: string | undefined;
139
+ visible?: string | undefined;
140
+ locations?: ("list_toolbar" | "list_item" | "record_header" | "record_more" | "record_related" | "global_nav")[] | undefined;
141
+ location?: any;
142
+ execute?: string | undefined;
143
+ confirmText?: string | undefined;
144
+ successMessage?: string | undefined;
145
+ refreshAfter?: boolean | undefined;
146
+ }>;
147
+ export type Action = z.infer<typeof ActionSchema>;
148
+ //# sourceMappingURL=action.zod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.zod.d.ts","sourceRoot":"","sources":["../../src/ui/action.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,iCAAiC;;IAGjC,oBAAoB;;IAGpB,yBAAyB;;IAGzB,qCAAqC;;IAOrC,8BAA8B;;IAG9B,gCAAgC;;IAGhC,uBAAuB;;;IAIvB,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG9B,kBAAkB;;;;IAKlB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEb,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ActionSchema = exports.ActionParamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const field_zod_1 = require("../data/field.zod");
6
+ /**
7
+ * Action Parameter Schema
8
+ * Defines inputs required before executing an action.
9
+ */
10
+ exports.ActionParamSchema = zod_1.z.object({
11
+ name: zod_1.z.string(),
12
+ label: zod_1.z.string(),
13
+ type: field_zod_1.FieldType,
14
+ required: zod_1.z.boolean().default(false),
15
+ options: zod_1.z.array(zod_1.z.object({ label: zod_1.z.string(), value: zod_1.z.string() })).optional(),
16
+ });
17
+ /**
18
+ * Action Schema
19
+ */
20
+ exports.ActionSchema = zod_1.z.object({
21
+ /** Machine name of the action */
22
+ name: zod_1.z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)'),
23
+ /** Display label */
24
+ label: zod_1.z.string().describe('Display label'),
25
+ /** Icon name (Lucide) */
26
+ icon: zod_1.z.string().optional().describe('Icon name'),
27
+ /** Where does this action appear? */
28
+ locations: zod_1.z.array(zod_1.z.enum([
29
+ 'list_toolbar', 'list_item',
30
+ 'record_header', 'record_more', 'record_related',
31
+ 'global_nav'
32
+ ])).optional().describe('Locations where this action is visible'),
33
+ /** Legacy location support */
34
+ location: zod_1.z.any().optional(),
35
+ /** What type of interaction? */
36
+ type: zod_1.z.enum(['script', 'url', 'modal', 'flow', 'api']).default('script').describe('Action functionality type'),
37
+ /** Payload / Target */
38
+ target: zod_1.z.string().optional().describe('URL, Script Name, Flow ID, or API Endpoint'), // For URL/Flow types
39
+ execute: zod_1.z.string().optional().describe('Legacy execution logic'),
40
+ /** User Input Requirements */
41
+ params: zod_1.z.array(exports.ActionParamSchema).optional().describe('Input parameters required from user'),
42
+ /** UX Behavior */
43
+ confirmText: zod_1.z.string().optional().describe('Confirmation message before execution'),
44
+ successMessage: zod_1.z.string().optional().describe('Success message to show after execution'),
45
+ refreshAfter: zod_1.z.boolean().default(false).describe('Refresh view after execution'),
46
+ /** Access */
47
+ visible: zod_1.z.string().optional().describe('Formula returning boolean'),
48
+ });