@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
@@ -1,199 +0,0 @@
1
- /**
2
- * Object Field Interface
3
- *
4
- * Defines the structure of a field within an ObjectEntity.
5
- * Fields represent individual data attributes and their metadata.
6
- *
7
- * @module types/meta/object-field
8
- */
9
- import { FieldType } from './field-type';
10
- /**
11
- * Represents a field definition within an ObjectEntity
12
- *
13
- * @remarks
14
- * ObjectField defines the complete metadata for a single field/attribute
15
- * in an entity. This includes its type, validation rules, UI hints, and
16
- * relationships to other entities (in the case of lookup fields).
17
- *
18
- * @example
19
- * ```typescript
20
- * const nameField: ObjectField = {
21
- * name: 'name',
22
- * label: 'Full Name',
23
- * type: 'text',
24
- * required: true,
25
- * maxLength: 100
26
- * };
27
- *
28
- * const ownerField: ObjectField = {
29
- * name: 'owner',
30
- * label: 'Owner',
31
- * type: 'lookup',
32
- * required: true,
33
- * lookupEntity: 'User',
34
- * lookupDisplayField: 'name'
35
- * };
36
- * ```
37
- */
38
- export interface ObjectField {
39
- /**
40
- * Technical name of the field (used in code and database)
41
- *
42
- * @remarks
43
- * Should be in camelCase or snake_case format.
44
- * Must be unique within the entity.
45
- *
46
- * @example 'firstName', 'email', 'created_at'
47
- */
48
- name: string;
49
- /**
50
- * Human-readable label for the field
51
- *
52
- * @remarks
53
- * Used in UI forms, tables, and documentation.
54
- *
55
- * @example 'First Name', 'Email Address', 'Created At'
56
- */
57
- label: string;
58
- /**
59
- * Data type of the field
60
- *
61
- * @see FieldType
62
- */
63
- type: FieldType;
64
- /**
65
- * Detailed description of the field's purpose and usage
66
- *
67
- * @remarks
68
- * Used for tooltips, help text, and documentation.
69
- */
70
- description?: string;
71
- /**
72
- * Whether the field is required (cannot be null/empty)
73
- *
74
- * @defaultValue false
75
- */
76
- required?: boolean;
77
- /**
78
- * Whether the field value must be unique across all records
79
- *
80
- * @defaultValue false
81
- */
82
- unique?: boolean;
83
- /**
84
- * Default value when creating new records
85
- *
86
- * @remarks
87
- * Can be a static value or a function reference (e.g., 'NOW()' for timestamps)
88
- */
89
- defaultValue?: unknown;
90
- /**
91
- * Maximum length for text fields
92
- *
93
- * @remarks
94
- * Only applicable to 'text', 'textarea', 'email', 'url' field types
95
- */
96
- maxLength?: number;
97
- /**
98
- * Minimum length for text fields
99
- *
100
- * @remarks
101
- * Only applicable to 'text', 'textarea', 'email', 'url' field types
102
- */
103
- minLength?: number;
104
- /**
105
- * Minimum value for numeric fields
106
- *
107
- * @remarks
108
- * Only applicable to 'number', 'currency', 'percentage' field types
109
- */
110
- min?: number;
111
- /**
112
- * Maximum value for numeric fields
113
- *
114
- * @remarks
115
- * Only applicable to 'number', 'currency', 'percentage' field types
116
- */
117
- max?: number;
118
- /**
119
- * Regular expression pattern for validation
120
- *
121
- * @remarks
122
- * Applied to text-based field types for custom validation rules
123
- *
124
- * @example '^[A-Z]{2}-\\d{4}$' for pattern like 'AB-1234'
125
- */
126
- pattern?: string;
127
- /**
128
- * Target entity name for lookup fields
129
- *
130
- * @remarks
131
- * Required when type is 'lookup'. Specifies which entity this field references.
132
- *
133
- * @example 'User', 'Account', 'Product'
134
- */
135
- lookupEntity?: string;
136
- /**
137
- * Field name in the lookup entity to display
138
- *
139
- * @remarks
140
- * Used to show human-readable text instead of IDs.
141
- * Common values: 'name', 'title', 'label'
142
- *
143
- * @defaultValue 'name'
144
- */
145
- lookupDisplayField?: string;
146
- /**
147
- * Available options for select/multiselect fields
148
- *
149
- * @remarks
150
- * Only applicable to 'select' and 'multiselect' field types
151
- *
152
- * @example
153
- * ```typescript
154
- * options: [
155
- * { value: 'draft', label: 'Draft' },
156
- * { value: 'published', label: 'Published' }
157
- * ]
158
- * ```
159
- */
160
- options?: Array<{
161
- /** Internal value stored in database */
162
- value: string | number;
163
- /** Human-readable label shown in UI */
164
- label: string;
165
- }>;
166
- /**
167
- * Whether the field is indexed for faster queries
168
- *
169
- * @defaultValue false
170
- */
171
- indexed?: boolean;
172
- /**
173
- * Whether the field is read-only
174
- *
175
- * @remarks
176
- * Read-only fields can only be set by the system, not by users
177
- *
178
- * @defaultValue false
179
- */
180
- readonly?: boolean;
181
- /**
182
- * Whether the field is hidden from UI by default
183
- *
184
- * @remarks
185
- * Hidden fields are still stored and queryable but not shown in standard forms/views
186
- *
187
- * @defaultValue false
188
- */
189
- hidden?: boolean;
190
- /**
191
- * Custom metadata for extensions and plugins
192
- *
193
- * @remarks
194
- * Allows third-party code to attach arbitrary metadata to fields
195
- * without modifying the core interface
196
- */
197
- metadata?: Record<string, unknown>;
198
- }
199
- //# sourceMappingURL=object-field.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object-field.d.ts","sourceRoot":"","sources":["../../../src/types/meta/object-field.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,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
- * Defines the structure of a field within an ObjectEntity.
5
- * Fields represent individual data attributes and their metadata.
6
- *
7
- * @module types/meta/object-field
8
- */
9
- export {};
@@ -1,430 +0,0 @@
1
- /**
2
- * Object View Interface
3
- *
4
- * Defines the structure of a view in the ObjectStack metamodel.
5
- * Views represent different UI presentations of entity data (list, form, detail, etc.).
6
- *
7
- * @module types/meta/object-view
8
- */
9
- /**
10
- * Available view types in the ObjectStack metamodel
11
- *
12
- * @remarks
13
- * Each view type corresponds to a different UI presentation pattern:
14
- *
15
- * - `list`: Tabular list view (grid/table)
16
- * - `detail`: Single record detail view (read-only)
17
- * - `form`: Single record form view (editable)
18
- * - `card`: Card-based list view
19
- * - `kanban`: Kanban board view
20
- * - `calendar`: Calendar view (for date-based records)
21
- * - `chart`: Chart/graph visualization
22
- * - `map`: Geographic map view
23
- * - `timeline`: Timeline view for chronological data
24
- * - `custom`: Custom view implementation
25
- */
26
- export type ViewType = 'list' | 'detail' | 'form' | 'card' | 'kanban' | 'calendar' | 'chart' | 'map' | 'timeline' | 'custom';
27
- /**
28
- * Layout configuration for a view
29
- *
30
- * @remarks
31
- * Defines how fields are organized visually in the view
32
- */
33
- export interface ViewLayout {
34
- /**
35
- * Layout type/strategy
36
- *
37
- * @remarks
38
- * - `single-column`: One field per row
39
- * - `two-column`: Two fields per row
40
- * - `grid`: Flexible grid layout
41
- * - `tabs`: Fields organized in tabs
42
- * - `sections`: Fields grouped in named sections
43
- *
44
- * @defaultValue 'single-column'
45
- */
46
- type?: 'single-column' | 'two-column' | 'grid' | 'tabs' | 'sections';
47
- /**
48
- * Sections for organizing fields
49
- *
50
- * @remarks
51
- * Only applicable when layout type is 'sections' or 'tabs'
52
- */
53
- sections?: Array<{
54
- /** Section identifier */
55
- id: string;
56
- /** Section title */
57
- title: string;
58
- /** Field names to include in this section */
59
- fields: string[];
60
- /** Whether section is collapsed by default */
61
- collapsed?: boolean;
62
- }>;
63
- }
64
- /**
65
- * Filter configuration for a view
66
- *
67
- * @remarks
68
- * Defines how records are filtered in the view
69
- */
70
- export interface ViewFilter {
71
- /**
72
- * Field name to filter on
73
- *
74
- * @example 'status', 'createdAt', 'owner'
75
- */
76
- field: string;
77
- /**
78
- * Filter operator
79
- *
80
- * @remarks
81
- * Available operators depend on the field type:
82
- * - Text: equals, contains, startsWith, endsWith
83
- * - Number: equals, gt, gte, lt, lte, between
84
- * - Boolean: equals
85
- * - Date: equals, before, after, between
86
- * - Lookup: equals, in
87
- */
88
- operator: 'equals' | 'contains' | 'startsWith' | 'endsWith' | 'gt' | 'gte' | 'lt' | 'lte' | 'between' | 'before' | 'after' | 'in' | 'notIn';
89
- /**
90
- * Filter value(s)
91
- *
92
- * @remarks
93
- * Type depends on operator and field type.
94
- * For 'between' operator, should be an array of two values.
95
- */
96
- value: unknown;
97
- }
98
- /**
99
- * Sort configuration for a view
100
- *
101
- * @remarks
102
- * Defines how records are sorted in the view
103
- */
104
- export interface ViewSort {
105
- /**
106
- * Field name to sort by
107
- *
108
- * @example 'name', 'createdAt', 'priority'
109
- */
110
- field: string;
111
- /**
112
- * Sort direction
113
- *
114
- * @defaultValue 'asc'
115
- */
116
- direction: 'asc' | 'desc';
117
- }
118
- /**
119
- * Column configuration for list views
120
- *
121
- * @remarks
122
- * Defines how a field is displayed as a column in a list/table view
123
- */
124
- export interface ViewColumn {
125
- /**
126
- * Field name to display
127
- *
128
- * @remarks
129
- * Must be a valid field name from the entity
130
- */
131
- field: string;
132
- /**
133
- * Column header label
134
- *
135
- * @remarks
136
- * If not provided, uses the field's label
137
- */
138
- label?: string;
139
- /**
140
- * Column width
141
- *
142
- * @remarks
143
- * Can be in pixels (e.g., 100) or percentage (e.g., '20%')
144
- */
145
- width?: number | string;
146
- /**
147
- * Whether the column is sortable
148
- *
149
- * @defaultValue true
150
- */
151
- sortable?: boolean;
152
- /**
153
- * Whether the column is visible by default
154
- *
155
- * @defaultValue true
156
- */
157
- visible?: boolean;
158
- /**
159
- * Text alignment in the column
160
- *
161
- * @defaultValue 'left'
162
- */
163
- align?: 'left' | 'center' | 'right';
164
- /**
165
- * Custom formatting function name
166
- *
167
- * @remarks
168
- * Reference to a formatting function (e.g., 'currency', 'date', 'percentage')
169
- *
170
- * @example 'currency', 'date:MM/DD/YYYY', 'number:2' (2 decimal places)
171
- */
172
- format?: string;
173
- }
174
- /**
175
- * Represents a view definition for an ObjectEntity
176
- *
177
- * @remarks
178
- * ObjectView defines how an entity's data is presented in the UI.
179
- * Multiple views can exist for the same entity, each tailored for
180
- * different use cases (e.g., "All Users", "Active Users", "Admin Users").
181
- *
182
- * Views are used by ObjectUI to:
183
- * - Render lists with specific columns and filters
184
- * - Display forms with specific field layouts
185
- * - Show detailed records with custom presentations
186
- *
187
- * @example
188
- * ```typescript
189
- * const allUsersView: ObjectView = {
190
- * name: 'all_users',
191
- * label: 'All Users',
192
- * entityName: 'User',
193
- * type: 'list',
194
- * columns: [
195
- * { field: 'name', width: '30%' },
196
- * { field: 'email', width: '30%' },
197
- * { field: 'status', width: '20%' },
198
- * { field: 'createdAt', width: '20%', format: 'date:MM/DD/YYYY' }
199
- * ],
200
- * sort: [
201
- * { field: 'name', direction: 'asc' }
202
- * ]
203
- * };
204
- *
205
- * const userFormView: ObjectView = {
206
- * name: 'user_form',
207
- * label: 'User Form',
208
- * entityName: 'User',
209
- * type: 'form',
210
- * fields: ['name', 'email', 'role', 'status'],
211
- * layout: {
212
- * type: 'sections',
213
- * sections: [
214
- * {
215
- * id: 'basic',
216
- * title: 'Basic Information',
217
- * fields: ['name', 'email']
218
- * },
219
- * {
220
- * id: 'settings',
221
- * title: 'Settings',
222
- * fields: ['role', 'status']
223
- * }
224
- * ]
225
- * }
226
- * };
227
- * ```
228
- */
229
- export interface ObjectView {
230
- /**
231
- * Technical name of the view
232
- *
233
- * @remarks
234
- * Used in code and URLs.
235
- * Should be in snake_case format.
236
- * Must be unique within the entity's views.
237
- *
238
- * @example 'all_users', 'active_orders', 'recent_products'
239
- */
240
- name: string;
241
- /**
242
- * Human-readable label for the view
243
- *
244
- * @remarks
245
- * Used in UI menus, tabs, and headers.
246
- *
247
- * @example 'All Users', 'Active Orders', 'Recent Products'
248
- */
249
- label: string;
250
- /**
251
- * Name of the entity this view is for
252
- *
253
- * @remarks
254
- * Must be a valid entity name in the system.
255
- *
256
- * @example 'User', 'SalesOrder', 'Product'
257
- */
258
- entityName: string;
259
- /**
260
- * Type of view presentation
261
- *
262
- * @see ViewType
263
- */
264
- type: ViewType;
265
- /**
266
- * Detailed description of the view's purpose
267
- *
268
- * @remarks
269
- * Used for tooltips and documentation
270
- */
271
- description?: string;
272
- /**
273
- * Field names to display in the view
274
- *
275
- * @remarks
276
- * For form/detail views: determines which fields to show and in what order.
277
- * For list views: used if columns are not specified.
278
- * Must be valid field names from the entity.
279
- */
280
- fields?: string[];
281
- /**
282
- * Column configurations for list views
283
- *
284
- * @remarks
285
- * Only applicable to 'list', 'card', 'kanban' view types.
286
- * Defines how each field is rendered as a column.
287
- *
288
- * @see ViewColumn
289
- */
290
- columns?: ViewColumn[];
291
- /**
292
- * Layout configuration for the view
293
- *
294
- * @remarks
295
- * Only applicable to 'form' and 'detail' view types.
296
- *
297
- * @see ViewLayout
298
- */
299
- layout?: ViewLayout;
300
- /**
301
- * Default filters to apply to the view
302
- *
303
- * @remarks
304
- * Filters are applied when the view is loaded.
305
- * Users can typically modify or remove these filters.
306
- *
307
- * @see ViewFilter
308
- */
309
- filters?: ViewFilter[];
310
- /**
311
- * Default sort order for the view
312
- *
313
- * @remarks
314
- * Can specify multiple sort levels (first by field1, then by field2, etc.)
315
- *
316
- * @see ViewSort
317
- */
318
- sort?: ViewSort[];
319
- /**
320
- * Number of records to display per page
321
- *
322
- * @remarks
323
- * Only applicable to list-based views.
324
- *
325
- * @defaultValue 25
326
- */
327
- pageSize?: number;
328
- /**
329
- * Icon identifier for the view
330
- *
331
- * @remarks
332
- * Used in view switchers, menus, and tabs.
333
- *
334
- * @example 'list', 'grid', 'calendar'
335
- */
336
- icon?: string;
337
- /**
338
- * Whether this is the default view for the entity
339
- *
340
- * @remarks
341
- * The default view is shown when navigating to the entity
342
- * without specifying a view.
343
- *
344
- * @defaultValue false
345
- */
346
- default?: boolean;
347
- /**
348
- * Whether the view is visible in navigation menus
349
- *
350
- * @remarks
351
- * Hidden views can still be accessed directly via URL
352
- *
353
- * @defaultValue true
354
- */
355
- visible?: boolean;
356
- /**
357
- * Permission required to access this view
358
- *
359
- * @remarks
360
- * Users without this permission cannot see or access the view.
361
- *
362
- * @example 'user.read', 'sales.order.view.active'
363
- */
364
- permission?: string;
365
- /**
366
- * Query string for advanced filtering
367
- *
368
- * @remarks
369
- * Alternative to the filters array for complex queries.
370
- * Uses the ObjectQL query syntax.
371
- *
372
- * @example 'status = "active" AND createdAt > NOW() - 30d'
373
- */
374
- query?: string;
375
- /**
376
- * Field name for grouping records (kanban view)
377
- *
378
- * @remarks
379
- * Only applicable to 'kanban' view type.
380
- * The field should have predefined options (select/lookup).
381
- *
382
- * @example 'status', 'priority', 'assignedTo'
383
- */
384
- groupBy?: string;
385
- /**
386
- * Date field name for calendar/timeline views
387
- *
388
- * @remarks
389
- * Only applicable to 'calendar' and 'timeline' view types.
390
- * Must be a date or datetime field.
391
- *
392
- * @example 'dueDate', 'scheduledAt', 'eventDate'
393
- */
394
- dateField?: string;
395
- /**
396
- * Chart configuration for chart views
397
- *
398
- * @remarks
399
- * Only applicable to 'chart' view type.
400
- */
401
- chartConfig?: {
402
- /** Chart type (bar, line, pie, etc.) */
403
- type: 'bar' | 'line' | 'pie' | 'donut' | 'area' | 'scatter';
404
- /** Field for x-axis */
405
- xAxis?: string;
406
- /** Field for y-axis */
407
- yAxis?: string;
408
- /** Aggregation function (count, sum, avg, etc.) */
409
- aggregation?: 'count' | 'sum' | 'avg' | 'min' | 'max';
410
- };
411
- /**
412
- * Custom component reference for custom views
413
- *
414
- * @remarks
415
- * Only applicable to 'custom' view type.
416
- * References a registered custom component.
417
- *
418
- * @example 'MyCustomDashboard', 'AnalyticsView'
419
- */
420
- customComponent?: string;
421
- /**
422
- * Custom metadata for extensions and plugins
423
- *
424
- * @remarks
425
- * Allows third-party code to attach arbitrary metadata to views
426
- * without modifying the core interface
427
- */
428
- metadata?: Record<string, unknown>;
429
- }
430
- //# sourceMappingURL=object-view.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object-view.d.ts","sourceRoot":"","sources":["../../../src/types/meta/object-view.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,QAAQ,GACR,UAAU,GACV,OAAO,GACP,KAAK,GACL,UAAU,GACV,QAAQ,CAAC;AAEb;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,eAAe,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;IAErE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,yBAAyB;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,oBAAoB;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,6CAA6C;QAC7C,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,8CAA8C;QAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;CACJ;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC;IAE5I;;;;;;OAMG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;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AOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;IACH,WAAW,CAAC,EAAE;QACZ,wCAAwC;QACxC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;QAC5D,uBAAuB;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,uBAAuB;QACvB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,mDAAmD;QACnD,WAAW,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;KACvD,CAAC;IAEF;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Object View Interface
3
- *
4
- * Defines the structure of a view in the ObjectStack metamodel.
5
- * Views represent different UI presentations of entity data (list, form, detail, etc.).
6
- *
7
- * @module types/meta/object-view
8
- */
9
- export {};