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