@object-ui/types 0.3.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/ai.d.ts +376 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +8 -0
- package/dist/app.d.ts +10 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/blocks.d.ts +332 -0
- package/dist/blocks.d.ts.map +1 -0
- package/dist/blocks.js +8 -0
- package/dist/crud.d.ts +177 -3
- package/dist/crud.d.ts.map +1 -1
- package/dist/data-display.d.ts +35 -0
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data-protocol.d.ts +1268 -0
- package/dist/data-protocol.d.ts.map +1 -0
- package/dist/data-protocol.js +8 -0
- package/dist/data.d.ts +74 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/designer.d.ts +473 -0
- package/dist/designer.d.ts.map +1 -0
- package/dist/designer.js +8 -0
- package/dist/field-types.d.ts +353 -11
- package/dist/field-types.d.ts.map +1 -1
- package/dist/form.d.ts +35 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/index.d.ts +58 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -0
- package/dist/layout.d.ts +63 -8
- package/dist/layout.d.ts.map +1 -1
- package/dist/mobile.d.ts +186 -0
- package/dist/mobile.d.ts.map +1 -0
- package/dist/mobile.js +8 -0
- package/dist/objectql.d.ts +337 -89
- package/dist/objectql.d.ts.map +1 -1
- package/dist/permissions.d.ts +150 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +8 -0
- package/dist/plugin-scope.d.ts +194 -0
- package/dist/plugin-scope.d.ts.map +1 -0
- package/dist/plugin-scope.js +8 -0
- package/dist/reports.d.ts +336 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +8 -0
- package/dist/tenant.d.ts +138 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/tenant.js +8 -0
- package/dist/theme.d.ts +180 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +8 -0
- package/dist/ui-action.d.ts +290 -0
- package/dist/ui-action.d.ts.map +1 -0
- package/dist/ui-action.js +8 -0
- package/dist/views.d.ts +427 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.js +8 -0
- package/dist/widget.d.ts +181 -0
- package/dist/widget.d.ts.map +1 -0
- package/dist/widget.js +8 -0
- package/dist/workflow.d.ts +340 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +8 -0
- package/dist/zod/app.zod.d.ts +120 -0
- package/dist/zod/app.zod.d.ts.map +1 -0
- package/dist/zod/app.zod.js +60 -0
- package/dist/zod/blocks.zod.d.ts +834 -0
- package/dist/zod/blocks.zod.d.ts.map +1 -0
- package/dist/zod/blocks.zod.js +145 -0
- package/dist/zod/complex.zod.d.ts +4 -4
- package/dist/zod/complex.zod.js +1 -1
- package/dist/zod/crud.zod.d.ts +598 -0
- package/dist/zod/crud.zod.d.ts.map +1 -0
- package/dist/zod/crud.zod.js +230 -0
- package/dist/zod/data-display.zod.js +1 -1
- package/dist/zod/disclosure.zod.js +1 -1
- package/dist/zod/feedback.zod.d.ts +10 -10
- package/dist/zod/feedback.zod.js +1 -1
- package/dist/zod/form.zod.d.ts +4 -4
- package/dist/zod/form.zod.js +1 -1
- package/dist/zod/index.zod.d.ts +2032 -30
- package/dist/zod/index.zod.d.ts.map +1 -1
- package/dist/zod/index.zod.js +96 -19
- package/dist/zod/layout.zod.d.ts +134 -2
- package/dist/zod/layout.zod.d.ts.map +1 -1
- package/dist/zod/layout.zod.js +35 -1
- package/dist/zod/navigation.zod.js +1 -1
- package/dist/zod/objectql.zod.d.ts +34 -18
- package/dist/zod/objectql.zod.d.ts.map +1 -1
- package/dist/zod/objectql.zod.js +9 -1
- package/dist/zod/overlay.zod.js +1 -1
- package/dist/zod/reports.zod.d.ts +1628 -0
- package/dist/zod/reports.zod.d.ts.map +1 -0
- package/dist/zod/reports.zod.js +152 -0
- package/dist/zod/theme.zod.d.ts +1292 -0
- package/dist/zod/theme.zod.d.ts.map +1 -0
- package/dist/zod/theme.zod.js +260 -0
- package/dist/zod/views.zod.d.ts +675 -0
- package/dist/zod/views.zod.d.ts.map +1 -0
- package/dist/zod/views.zod.js +159 -0
- package/package.json +3 -2
- package/src/__tests__/namespace-exports.test.ts +36 -0
- package/src/__tests__/phase2-schemas.test.ts +634 -0
- package/src/ai.ts +454 -0
- package/src/app.ts +12 -0
- package/src/blocks.ts +405 -0
- package/src/crud.ts +180 -3
- package/src/data-display.ts +31 -0
- package/src/data-protocol.ts +1679 -0
- package/src/data.ts +84 -1
- package/src/designer.ts +509 -0
- package/src/field-types.ts +392 -11
- package/src/form.ts +35 -1
- package/src/index.ts +426 -0
- package/src/layout.ts +66 -8
- package/src/mobile.ts +205 -0
- package/src/objectql.ts +412 -94
- package/src/permissions.ts +166 -0
- package/src/plugin-scope.ts +210 -0
- package/src/reports.ts +408 -0
- package/src/tenant.ts +153 -0
- package/src/theme.ts +238 -0
- package/src/ui-action.ts +415 -0
- package/src/views.ts +436 -0
- package/src/widget.ts +197 -0
- package/src/workflow.ts +409 -0
- package/src/zod/app.zod.ts +72 -0
- package/src/zod/blocks.zod.ts +170 -0
- package/src/zod/complex.zod.ts +1 -1
- package/src/zod/crud.zod.ts +259 -0
- package/src/zod/data-display.zod.ts +1 -1
- package/src/zod/disclosure.zod.ts +1 -1
- package/src/zod/feedback.zod.ts +1 -1
- package/src/zod/form.zod.ts +1 -1
- package/src/zod/index.zod.ts +178 -19
- package/src/zod/layout.zod.ts +39 -1
- package/src/zod/navigation.zod.ts +1 -1
- package/src/zod/objectql.zod.ts +9 -1
- package/src/zod/overlay.zod.ts +1 -1
- package/src/zod/reports.zod.ts +183 -0
- package/src/zod/theme.zod.ts +296 -0
- package/src/zod/views.zod.ts +182 -0
package/src/data.ts
CHANGED
|
@@ -35,9 +35,11 @@ export interface QueryParams {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Sort order
|
|
38
|
+
* Can be a Map { field: 'asc' }, an Array of strings ['field', '-field'], or Array of sort objects
|
|
38
39
|
* @example { createdAt: 'desc', name: 'asc' }
|
|
40
|
+
* @example ['name', '-createdAt']
|
|
39
41
|
*/
|
|
40
|
-
$orderby?: Record<string, 'asc' | 'desc'>;
|
|
42
|
+
$orderby?: Record<string, 'asc' | 'desc'> | string[] | Array<{ field: string; order?: 'asc' | 'desc' }>;
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* Number of records to skip (for pagination)
|
|
@@ -111,6 +113,26 @@ export interface QueryResult<T = any> {
|
|
|
111
113
|
metadata?: Record<string, any>;
|
|
112
114
|
}
|
|
113
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Result of a file upload operation.
|
|
118
|
+
*/
|
|
119
|
+
export interface FileUploadResult {
|
|
120
|
+
/** Server-assigned unique ID for the uploaded file */
|
|
121
|
+
id: string;
|
|
122
|
+
/** Original filename */
|
|
123
|
+
filename: string;
|
|
124
|
+
/** MIME type of the uploaded file */
|
|
125
|
+
mimeType: string;
|
|
126
|
+
/** File size in bytes */
|
|
127
|
+
size: number;
|
|
128
|
+
/** Public URL to access the file */
|
|
129
|
+
url: string;
|
|
130
|
+
/** Thumbnail URL (for images) */
|
|
131
|
+
thumbnailUrl?: string;
|
|
132
|
+
/** Additional server-side metadata */
|
|
133
|
+
metadata?: Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
|
|
114
136
|
/**
|
|
115
137
|
* Universal data source interface.
|
|
116
138
|
* This is the core abstraction that makes Object UI backend-agnostic.
|
|
@@ -203,6 +225,67 @@ export interface DataSource<T = any> {
|
|
|
203
225
|
* @returns Promise resolving to the object schema
|
|
204
226
|
*/
|
|
205
227
|
getObjectSchema(objectName: string): Promise<any>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get a view definition for an object.
|
|
231
|
+
* Used by view components to render server-defined UI configurations.
|
|
232
|
+
* Optional — implementations may return null to fall back to static config.
|
|
233
|
+
*
|
|
234
|
+
* @param objectName - Object name
|
|
235
|
+
* @param viewId - View identifier (e.g., 'all', 'active', 'my_records')
|
|
236
|
+
* @returns Promise resolving to the view definition or null
|
|
237
|
+
*/
|
|
238
|
+
getView?(objectName: string, viewId: string): Promise<any | null>;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Get an application definition by name or ID.
|
|
242
|
+
* Used by app shells to render server-defined navigation, branding, and layout.
|
|
243
|
+
* Optional — implementations may return null to fall back to static config.
|
|
244
|
+
*
|
|
245
|
+
* @param appId - Application identifier
|
|
246
|
+
* @returns Promise resolving to the app definition or null
|
|
247
|
+
*/
|
|
248
|
+
getApp?(appId: string): Promise<any | null>;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Upload a single file to a resource.
|
|
252
|
+
* Optional — only supported by data sources with file storage integration.
|
|
253
|
+
*
|
|
254
|
+
* @param resource - Resource name
|
|
255
|
+
* @param file - File or Blob to upload
|
|
256
|
+
* @param options - Upload options (recordId, fieldName, metadata)
|
|
257
|
+
* @returns Promise resolving to the upload result
|
|
258
|
+
*/
|
|
259
|
+
uploadFile?(
|
|
260
|
+
resource: string,
|
|
261
|
+
file: File | Blob,
|
|
262
|
+
options?: {
|
|
263
|
+
recordId?: string;
|
|
264
|
+
fieldName?: string;
|
|
265
|
+
metadata?: Record<string, unknown>;
|
|
266
|
+
onProgress?: (percent: number) => void;
|
|
267
|
+
},
|
|
268
|
+
): Promise<FileUploadResult>;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Upload multiple files to a resource.
|
|
272
|
+
* Optional — only supported by data sources with file storage integration.
|
|
273
|
+
*
|
|
274
|
+
* @param resource - Resource name
|
|
275
|
+
* @param files - Array of Files or Blobs to upload
|
|
276
|
+
* @param options - Upload options
|
|
277
|
+
* @returns Promise resolving to array of upload results
|
|
278
|
+
*/
|
|
279
|
+
uploadFiles?(
|
|
280
|
+
resource: string,
|
|
281
|
+
files: (File | Blob)[],
|
|
282
|
+
options?: {
|
|
283
|
+
recordId?: string;
|
|
284
|
+
fieldName?: string;
|
|
285
|
+
metadata?: Record<string, unknown>;
|
|
286
|
+
onProgress?: (percent: number) => void;
|
|
287
|
+
},
|
|
288
|
+
): Promise<FileUploadResult[]>;
|
|
206
289
|
}
|
|
207
290
|
|
|
208
291
|
/**
|
package/src/designer.ts
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @object-ui/types - Visual Designer Types
|
|
11
|
+
*
|
|
12
|
+
* Type definitions for the visual designer system including page designer,
|
|
13
|
+
* data model designer, process designer, report designer,
|
|
14
|
+
* and multi-user collaborative editing.
|
|
15
|
+
*
|
|
16
|
+
* @module designer
|
|
17
|
+
* @packageDocumentation
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import type { BaseSchema } from './base';
|
|
21
|
+
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Page Designer (Drag-and-Drop)
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
/** Drag-and-drop item position */
|
|
27
|
+
export interface DesignerPosition {
|
|
28
|
+
/** X coordinate (pixels or grid units) */
|
|
29
|
+
x: number;
|
|
30
|
+
/** Y coordinate (pixels or grid units) */
|
|
31
|
+
y: number;
|
|
32
|
+
/** Width */
|
|
33
|
+
width: number | string;
|
|
34
|
+
/** Height */
|
|
35
|
+
height: number | string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Designer canvas configuration */
|
|
39
|
+
export interface DesignerCanvasConfig {
|
|
40
|
+
/** Canvas width */
|
|
41
|
+
width: number;
|
|
42
|
+
/** Canvas height */
|
|
43
|
+
height: number;
|
|
44
|
+
/** Grid snap size */
|
|
45
|
+
gridSize?: number;
|
|
46
|
+
/** Whether to show grid */
|
|
47
|
+
showGrid?: boolean;
|
|
48
|
+
/** Whether to enable snap-to-grid */
|
|
49
|
+
snapToGrid?: boolean;
|
|
50
|
+
/** Zoom level (1.0 = 100%) */
|
|
51
|
+
zoom?: number;
|
|
52
|
+
/** Background color */
|
|
53
|
+
backgroundColor?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Page designer component on canvas */
|
|
57
|
+
export interface DesignerComponent {
|
|
58
|
+
/** Unique component ID */
|
|
59
|
+
id: string;
|
|
60
|
+
/** Component type */
|
|
61
|
+
type: string;
|
|
62
|
+
/** Display label */
|
|
63
|
+
label?: string;
|
|
64
|
+
/** Position on canvas */
|
|
65
|
+
position: DesignerPosition;
|
|
66
|
+
/** Component properties */
|
|
67
|
+
props: Record<string, unknown>;
|
|
68
|
+
/** Child components */
|
|
69
|
+
children?: DesignerComponent[];
|
|
70
|
+
/** Parent component ID */
|
|
71
|
+
parentId?: string;
|
|
72
|
+
/** Lock state */
|
|
73
|
+
locked?: boolean;
|
|
74
|
+
/** Visibility */
|
|
75
|
+
visible?: boolean;
|
|
76
|
+
/** Z-index for layering */
|
|
77
|
+
zIndex?: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Page designer schema */
|
|
81
|
+
export interface PageDesignerSchema extends BaseSchema {
|
|
82
|
+
type: 'page-designer';
|
|
83
|
+
/** Canvas configuration */
|
|
84
|
+
canvas: DesignerCanvasConfig;
|
|
85
|
+
/** Components on the canvas */
|
|
86
|
+
components: DesignerComponent[];
|
|
87
|
+
/** Available component palette */
|
|
88
|
+
palette?: DesignerPaletteCategory[];
|
|
89
|
+
/** Property editor configuration */
|
|
90
|
+
propertyEditor?: boolean;
|
|
91
|
+
/** Component tree visibility */
|
|
92
|
+
showComponentTree?: boolean;
|
|
93
|
+
/** Undo/redo support */
|
|
94
|
+
undoRedo?: boolean;
|
|
95
|
+
/** Read-only mode */
|
|
96
|
+
readOnly?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Component palette category */
|
|
100
|
+
export interface DesignerPaletteCategory {
|
|
101
|
+
/** Category name */
|
|
102
|
+
name: string;
|
|
103
|
+
/** Category label */
|
|
104
|
+
label: string;
|
|
105
|
+
/** Category icon */
|
|
106
|
+
icon?: string;
|
|
107
|
+
/** Available components */
|
|
108
|
+
items: DesignerPaletteItem[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Palette item for drag-and-drop */
|
|
112
|
+
export interface DesignerPaletteItem {
|
|
113
|
+
/** Component type */
|
|
114
|
+
type: string;
|
|
115
|
+
/** Display label */
|
|
116
|
+
label: string;
|
|
117
|
+
/** Icon */
|
|
118
|
+
icon?: string;
|
|
119
|
+
/** Default properties */
|
|
120
|
+
defaultProps?: Record<string, unknown>;
|
|
121
|
+
/** Default size */
|
|
122
|
+
defaultSize?: { width: number | string; height: number | string };
|
|
123
|
+
/** Preview image URL */
|
|
124
|
+
preview?: string;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ============================================================================
|
|
128
|
+
// Data Model Designer (ER Diagrams)
|
|
129
|
+
// ============================================================================
|
|
130
|
+
|
|
131
|
+
/** Data model entity (table/object) */
|
|
132
|
+
export interface DataModelEntity {
|
|
133
|
+
/** Entity identifier */
|
|
134
|
+
id: string;
|
|
135
|
+
/** Entity name */
|
|
136
|
+
name: string;
|
|
137
|
+
/** Display label */
|
|
138
|
+
label: string;
|
|
139
|
+
/** Entity fields */
|
|
140
|
+
fields: DataModelField[];
|
|
141
|
+
/** Position on canvas */
|
|
142
|
+
position: { x: number; y: number };
|
|
143
|
+
/** Entity color */
|
|
144
|
+
color?: string;
|
|
145
|
+
/** Entity description */
|
|
146
|
+
description?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Data model field definition */
|
|
150
|
+
export interface DataModelField {
|
|
151
|
+
/** Field name */
|
|
152
|
+
name: string;
|
|
153
|
+
/** Display label */
|
|
154
|
+
label?: string;
|
|
155
|
+
/** Field data type */
|
|
156
|
+
type: string;
|
|
157
|
+
/** Whether this is a primary key */
|
|
158
|
+
primaryKey?: boolean;
|
|
159
|
+
/** Whether this field is required */
|
|
160
|
+
required?: boolean;
|
|
161
|
+
/** Whether this field is unique */
|
|
162
|
+
unique?: boolean;
|
|
163
|
+
/** Default value */
|
|
164
|
+
defaultValue?: unknown;
|
|
165
|
+
/** Field description */
|
|
166
|
+
description?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Relationship between entities */
|
|
170
|
+
export interface DataModelRelationship {
|
|
171
|
+
/** Relationship identifier */
|
|
172
|
+
id: string;
|
|
173
|
+
/** Source entity ID */
|
|
174
|
+
sourceEntity: string;
|
|
175
|
+
/** Source field */
|
|
176
|
+
sourceField: string;
|
|
177
|
+
/** Target entity ID */
|
|
178
|
+
targetEntity: string;
|
|
179
|
+
/** Target field */
|
|
180
|
+
targetField: string;
|
|
181
|
+
/** Relationship type */
|
|
182
|
+
type: 'one-to-one' | 'one-to-many' | 'many-to-many';
|
|
183
|
+
/** Relationship label */
|
|
184
|
+
label?: string;
|
|
185
|
+
/** Cascade behavior on delete */
|
|
186
|
+
onDelete?: 'cascade' | 'set-null' | 'restrict' | 'no-action';
|
|
187
|
+
/** Cascade behavior on update */
|
|
188
|
+
onUpdate?: 'cascade' | 'set-null' | 'restrict' | 'no-action';
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** Data model designer schema */
|
|
192
|
+
export interface DataModelDesignerSchema extends BaseSchema {
|
|
193
|
+
type: 'data-model-designer';
|
|
194
|
+
/** Entities in the model */
|
|
195
|
+
entities: DataModelEntity[];
|
|
196
|
+
/** Relationships between entities */
|
|
197
|
+
relationships: DataModelRelationship[];
|
|
198
|
+
/** Canvas configuration */
|
|
199
|
+
canvas?: DesignerCanvasConfig;
|
|
200
|
+
/** Show relationship labels */
|
|
201
|
+
showRelationshipLabels?: boolean;
|
|
202
|
+
/** Auto-layout enabled */
|
|
203
|
+
autoLayout?: boolean;
|
|
204
|
+
/** Read-only mode */
|
|
205
|
+
readOnly?: boolean;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// ============================================================================
|
|
209
|
+
// Process Designer (BPMN 2.0)
|
|
210
|
+
// ============================================================================
|
|
211
|
+
|
|
212
|
+
/** BPMN node types */
|
|
213
|
+
export type BPMNNodeType =
|
|
214
|
+
| 'start-event'
|
|
215
|
+
| 'end-event'
|
|
216
|
+
| 'task'
|
|
217
|
+
| 'user-task'
|
|
218
|
+
| 'service-task'
|
|
219
|
+
| 'script-task'
|
|
220
|
+
| 'send-task'
|
|
221
|
+
| 'receive-task'
|
|
222
|
+
| 'manual-task'
|
|
223
|
+
| 'business-rule-task'
|
|
224
|
+
| 'sub-process'
|
|
225
|
+
| 'call-activity'
|
|
226
|
+
| 'exclusive-gateway'
|
|
227
|
+
| 'parallel-gateway'
|
|
228
|
+
| 'inclusive-gateway'
|
|
229
|
+
| 'event-based-gateway'
|
|
230
|
+
| 'intermediate-catch-event'
|
|
231
|
+
| 'intermediate-throw-event'
|
|
232
|
+
| 'boundary-event'
|
|
233
|
+
| 'timer-event'
|
|
234
|
+
| 'message-event'
|
|
235
|
+
| 'signal-event'
|
|
236
|
+
| 'error-event'
|
|
237
|
+
| 'compensation-event';
|
|
238
|
+
|
|
239
|
+
/** BPMN process node */
|
|
240
|
+
export interface BPMNNode {
|
|
241
|
+
/** Node identifier */
|
|
242
|
+
id: string;
|
|
243
|
+
/** Node type */
|
|
244
|
+
type: BPMNNodeType;
|
|
245
|
+
/** Display label */
|
|
246
|
+
label: string;
|
|
247
|
+
/** Position on canvas */
|
|
248
|
+
position: { x: number; y: number };
|
|
249
|
+
/** Node properties */
|
|
250
|
+
properties?: Record<string, unknown>;
|
|
251
|
+
/** Assigned user/role (for user tasks) */
|
|
252
|
+
assignee?: string;
|
|
253
|
+
/** Due date expression */
|
|
254
|
+
dueDate?: string;
|
|
255
|
+
/** Script content (for script tasks) */
|
|
256
|
+
script?: string;
|
|
257
|
+
/** Service endpoint (for service tasks) */
|
|
258
|
+
serviceEndpoint?: string;
|
|
259
|
+
/** Description */
|
|
260
|
+
description?: string;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** BPMN sequence flow (edge) */
|
|
264
|
+
export interface BPMNEdge {
|
|
265
|
+
/** Edge identifier */
|
|
266
|
+
id: string;
|
|
267
|
+
/** Source node ID */
|
|
268
|
+
source: string;
|
|
269
|
+
/** Target node ID */
|
|
270
|
+
target: string;
|
|
271
|
+
/** Condition expression (for conditional flows) */
|
|
272
|
+
condition?: string;
|
|
273
|
+
/** Edge label */
|
|
274
|
+
label?: string;
|
|
275
|
+
/** Whether this is the default flow */
|
|
276
|
+
isDefault?: boolean;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** BPMN lane */
|
|
280
|
+
export interface BPMNLane {
|
|
281
|
+
/** Lane identifier */
|
|
282
|
+
id: string;
|
|
283
|
+
/** Lane label */
|
|
284
|
+
label: string;
|
|
285
|
+
/** Associated role or department */
|
|
286
|
+
role?: string;
|
|
287
|
+
/** Nodes in this lane */
|
|
288
|
+
nodeIds: string[];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Process designer schema */
|
|
292
|
+
export interface ProcessDesignerSchema extends BaseSchema {
|
|
293
|
+
type: 'process-designer';
|
|
294
|
+
/** Process name */
|
|
295
|
+
processName: string;
|
|
296
|
+
/** Process version */
|
|
297
|
+
version?: string;
|
|
298
|
+
/** BPMN nodes */
|
|
299
|
+
nodes: BPMNNode[];
|
|
300
|
+
/** BPMN edges/flows */
|
|
301
|
+
edges: BPMNEdge[];
|
|
302
|
+
/** Swim lanes */
|
|
303
|
+
lanes?: BPMNLane[];
|
|
304
|
+
/** Canvas configuration */
|
|
305
|
+
canvas?: DesignerCanvasConfig;
|
|
306
|
+
/** Process variables */
|
|
307
|
+
variables?: Array<{ name: string; type: string; defaultValue?: unknown }>;
|
|
308
|
+
/** Show minimap */
|
|
309
|
+
showMinimap?: boolean;
|
|
310
|
+
/** Show toolbar */
|
|
311
|
+
showToolbar?: boolean;
|
|
312
|
+
/** Read-only mode */
|
|
313
|
+
readOnly?: boolean;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ============================================================================
|
|
317
|
+
// Report Designer
|
|
318
|
+
// ============================================================================
|
|
319
|
+
|
|
320
|
+
/** Report designer section type */
|
|
321
|
+
export type ReportSectionType = 'header' | 'detail' | 'footer' | 'group-header' | 'group-footer' | 'page-header' | 'page-footer';
|
|
322
|
+
|
|
323
|
+
/** Report designer element */
|
|
324
|
+
export interface ReportDesignerElement {
|
|
325
|
+
/** Element identifier */
|
|
326
|
+
id: string;
|
|
327
|
+
/** Element type */
|
|
328
|
+
type: 'text' | 'field' | 'image' | 'chart' | 'table' | 'barcode' | 'line' | 'rectangle' | 'expression';
|
|
329
|
+
/** Position within section */
|
|
330
|
+
position: DesignerPosition;
|
|
331
|
+
/** Element properties */
|
|
332
|
+
properties: Record<string, unknown>;
|
|
333
|
+
/** Data binding expression */
|
|
334
|
+
dataBinding?: string;
|
|
335
|
+
/** Formatting options */
|
|
336
|
+
format?: {
|
|
337
|
+
fontFamily?: string;
|
|
338
|
+
fontSize?: number;
|
|
339
|
+
fontWeight?: 'normal' | 'bold';
|
|
340
|
+
fontStyle?: 'normal' | 'italic';
|
|
341
|
+
color?: string;
|
|
342
|
+
backgroundColor?: string;
|
|
343
|
+
alignment?: 'left' | 'center' | 'right';
|
|
344
|
+
verticalAlignment?: 'top' | 'middle' | 'bottom';
|
|
345
|
+
border?: string;
|
|
346
|
+
padding?: string;
|
|
347
|
+
numberFormat?: string;
|
|
348
|
+
dateFormat?: string;
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** Report designer section */
|
|
353
|
+
export interface ReportDesignerSection {
|
|
354
|
+
/** Section type */
|
|
355
|
+
type: ReportSectionType;
|
|
356
|
+
/** Section height */
|
|
357
|
+
height: number;
|
|
358
|
+
/** Elements in this section */
|
|
359
|
+
elements: ReportDesignerElement[];
|
|
360
|
+
/** Group field (for group headers/footers) */
|
|
361
|
+
groupField?: string;
|
|
362
|
+
/** Whether section repeats */
|
|
363
|
+
repeat?: boolean;
|
|
364
|
+
/** Page break before */
|
|
365
|
+
pageBreakBefore?: boolean;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/** Report designer schema */
|
|
369
|
+
export interface ReportDesignerSchema extends BaseSchema {
|
|
370
|
+
type: 'report-designer';
|
|
371
|
+
/** Report name */
|
|
372
|
+
reportName: string;
|
|
373
|
+
/** Data source object */
|
|
374
|
+
objectName: string;
|
|
375
|
+
/** Page size */
|
|
376
|
+
pageSize?: 'A4' | 'A3' | 'Letter' | 'Legal' | 'Tabloid';
|
|
377
|
+
/** Page orientation */
|
|
378
|
+
orientation?: 'portrait' | 'landscape';
|
|
379
|
+
/** Page margins */
|
|
380
|
+
margins?: { top: number; right: number; bottom: number; left: number };
|
|
381
|
+
/** Report sections */
|
|
382
|
+
sections: ReportDesignerSection[];
|
|
383
|
+
/** Report parameters */
|
|
384
|
+
parameters?: Array<{ name: string; type: string; label: string; defaultValue?: unknown }>;
|
|
385
|
+
/** Show designer toolbar */
|
|
386
|
+
showToolbar?: boolean;
|
|
387
|
+
/** Show property panel */
|
|
388
|
+
showPropertyPanel?: boolean;
|
|
389
|
+
/** Preview mode */
|
|
390
|
+
previewMode?: boolean;
|
|
391
|
+
/** Read-only mode */
|
|
392
|
+
readOnly?: boolean;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// ============================================================================
|
|
396
|
+
// View Designer (List View Layout Editor)
|
|
397
|
+
// ============================================================================
|
|
398
|
+
|
|
399
|
+
/** Column configuration for the view designer */
|
|
400
|
+
export interface ViewDesignerColumn {
|
|
401
|
+
/** Field name */
|
|
402
|
+
field: string;
|
|
403
|
+
/** Display label */
|
|
404
|
+
label?: string;
|
|
405
|
+
/** Column width */
|
|
406
|
+
width?: number | string;
|
|
407
|
+
/** Whether column is visible */
|
|
408
|
+
visible?: boolean;
|
|
409
|
+
/** Sort direction */
|
|
410
|
+
sortDirection?: 'asc' | 'desc';
|
|
411
|
+
/** Column order index */
|
|
412
|
+
order?: number;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** View designer schema */
|
|
416
|
+
export interface ViewDesignerSchema extends BaseSchema {
|
|
417
|
+
type: 'view-designer';
|
|
418
|
+
/** Object name this view is for */
|
|
419
|
+
objectName: string;
|
|
420
|
+
/** View identifier (for editing existing views) */
|
|
421
|
+
viewId?: string;
|
|
422
|
+
/** View display label */
|
|
423
|
+
viewLabel?: string;
|
|
424
|
+
/** View type */
|
|
425
|
+
viewType?: 'grid' | 'kanban' | 'gallery' | 'calendar' | 'timeline' | 'gantt' | 'map';
|
|
426
|
+
/** Columns / fields to display */
|
|
427
|
+
columns?: ViewDesignerColumn[];
|
|
428
|
+
/** Filter conditions */
|
|
429
|
+
filters?: Array<{ field: string; operator: string; value: any }>;
|
|
430
|
+
/** Sort configuration */
|
|
431
|
+
sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;
|
|
432
|
+
/** Available fields from the object schema */
|
|
433
|
+
availableFields?: Array<{ name: string; label: string; type: string }>;
|
|
434
|
+
/** Type-specific options */
|
|
435
|
+
options?: Record<string, any>;
|
|
436
|
+
/** Read-only mode */
|
|
437
|
+
readOnly?: boolean;
|
|
438
|
+
/** Callback when view config changes */
|
|
439
|
+
onChange?: string;
|
|
440
|
+
/** Callback when view is saved */
|
|
441
|
+
onSave?: string;
|
|
442
|
+
/** Callback when cancelled */
|
|
443
|
+
onCancel?: string;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// ============================================================================
|
|
447
|
+
// Multi-User Collaborative Editing
|
|
448
|
+
// ============================================================================
|
|
449
|
+
|
|
450
|
+
/** Collaboration user presence */
|
|
451
|
+
export interface CollaborationPresence {
|
|
452
|
+
/** User identifier */
|
|
453
|
+
userId: string;
|
|
454
|
+
/** User display name */
|
|
455
|
+
userName: string;
|
|
456
|
+
/** User avatar URL */
|
|
457
|
+
avatar?: string;
|
|
458
|
+
/** User cursor color */
|
|
459
|
+
color: string;
|
|
460
|
+
/** Current selection/cursor position */
|
|
461
|
+
cursor?: {
|
|
462
|
+
elementId?: string;
|
|
463
|
+
position?: { x: number; y: number };
|
|
464
|
+
};
|
|
465
|
+
/** User status */
|
|
466
|
+
status: 'active' | 'idle' | 'away';
|
|
467
|
+
/** Last activity timestamp */
|
|
468
|
+
lastActivity: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** Collaboration operation for conflict resolution */
|
|
472
|
+
export interface CollaborationOperation {
|
|
473
|
+
/** Operation ID */
|
|
474
|
+
id: string;
|
|
475
|
+
/** User who performed the operation */
|
|
476
|
+
userId: string;
|
|
477
|
+
/** Operation type */
|
|
478
|
+
type: 'insert' | 'update' | 'delete' | 'move' | 'resize';
|
|
479
|
+
/** Target element ID */
|
|
480
|
+
elementId: string;
|
|
481
|
+
/** Operation data */
|
|
482
|
+
data: Record<string, unknown>;
|
|
483
|
+
/** Timestamp */
|
|
484
|
+
timestamp: string;
|
|
485
|
+
/** Operation version for OT */
|
|
486
|
+
version: number;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** Collaborative editing configuration */
|
|
490
|
+
export interface CollaborationConfig {
|
|
491
|
+
/** Enable real-time collaboration */
|
|
492
|
+
enabled: boolean;
|
|
493
|
+
/** WebSocket server URL */
|
|
494
|
+
serverUrl?: string;
|
|
495
|
+
/** Room/document identifier */
|
|
496
|
+
roomId?: string;
|
|
497
|
+
/** Maximum concurrent users */
|
|
498
|
+
maxUsers?: number;
|
|
499
|
+
/** Show user cursors */
|
|
500
|
+
showCursors?: boolean;
|
|
501
|
+
/** Show user presence list */
|
|
502
|
+
showPresence?: boolean;
|
|
503
|
+
/** Conflict resolution strategy */
|
|
504
|
+
conflictResolution?: 'last-write-wins' | 'operational-transform' | 'crdt';
|
|
505
|
+
/** Auto-save interval in milliseconds */
|
|
506
|
+
autoSaveInterval?: number;
|
|
507
|
+
/** Version history enabled */
|
|
508
|
+
versionHistory?: boolean;
|
|
509
|
+
}
|