@objectql/types 4.0.2 → 4.0.4

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/dist/form.d.ts DELETED
@@ -1,322 +0,0 @@
1
- /**
2
- * ObjectQL
3
- * Copyright (c) 2026-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
- * Form Metadata Definition
10
- *
11
- * Defines the structure for forms, layouts, and field arrangements in ObjectQL.
12
- * Forms control how data is entered, edited, and displayed to users with
13
- * sections, tabs, columns, and conditional visibility.
14
- *
15
- * Based on patterns from Salesforce Page Layouts, Dynamics Forms, and similar platforms.
16
- */
17
- import { ValidationCondition } from './validation';
18
- /**
19
- * Form types supported by ObjectQL
20
- */
21
- export type FormType = 'create' | 'edit' | 'view' | 'wizard' | 'quick_create' | 'inline' | 'custom';
22
- /**
23
- * Layout types for form arrangement
24
- */
25
- export type FormLayoutType = 'single_column' | 'two_column' | 'three_column' | 'tabs' | 'accordion' | 'custom';
26
- /**
27
- * Field display configuration in form
28
- */
29
- export interface FormField {
30
- /** Field name */
31
- name: string;
32
- /** Display label (overrides field config) */
33
- label?: string;
34
- /** Help text (overrides field config) */
35
- help_text?: string;
36
- /** Placeholder text */
37
- placeholder?: string;
38
- /** Whether field is required in this form */
39
- required?: boolean;
40
- /** Whether field is readonly in this form */
41
- readonly?: boolean;
42
- /** Whether field is hidden in this form */
43
- hidden?: boolean;
44
- /** Field width in columns (for multi-column layouts) */
45
- width?: number;
46
- /** Span across columns */
47
- span?: number;
48
- /** Visibility condition */
49
- visible_when?: ValidationCondition | string;
50
- /** Enabled condition */
51
- enabled_when?: ValidationCondition | string;
52
- /** Default value override */
53
- default_value?: any;
54
- /** Field-specific validation override */
55
- validation?: any;
56
- /** Custom CSS class */
57
- class_name?: string;
58
- /** Field-specific configuration */
59
- config?: Record<string, any>;
60
- }
61
- /**
62
- * Form section configuration
63
- */
64
- export interface FormSection {
65
- /** Section identifier */
66
- id?: string;
67
- /** Section label */
68
- label?: string;
69
- /** Section description */
70
- description?: string;
71
- /** Number of columns in this section */
72
- columns?: number;
73
- /** Fields in this section */
74
- fields: (string | FormField)[];
75
- /** Whether section is collapsible */
76
- collapsible?: boolean;
77
- /** Default collapsed state */
78
- collapsed?: boolean;
79
- /** Visibility condition */
80
- visible_when?: ValidationCondition | string;
81
- /** Section border style */
82
- border?: boolean;
83
- /** Section background color */
84
- background?: string;
85
- /** Custom CSS class */
86
- class_name?: string;
87
- }
88
- /**
89
- * Form tab configuration
90
- */
91
- export interface FormTab {
92
- /** Tab identifier */
93
- id: string;
94
- /** Tab label */
95
- label: string;
96
- /** Tab icon */
97
- icon?: string;
98
- /** Sections within this tab */
99
- sections: FormSection[];
100
- /** Visibility condition */
101
- visible_when?: ValidationCondition | string;
102
- /** Badge/count to display on tab */
103
- badge?: string | number;
104
- /** Whether this tab is disabled */
105
- disabled?: boolean;
106
- }
107
- /**
108
- * Wizard step configuration
109
- */
110
- export interface WizardStep {
111
- /** Step identifier */
112
- id: string;
113
- /** Step label */
114
- label: string;
115
- /** Step description */
116
- description?: string;
117
- /** Icon for step */
118
- icon?: string;
119
- /** Sections in this step */
120
- sections: FormSection[];
121
- /** Validation to pass before proceeding */
122
- validation?: ValidationCondition;
123
- /** Whether user can skip this step */
124
- skippable?: boolean;
125
- /** Visibility condition */
126
- visible_when?: ValidationCondition | string;
127
- /** Action to execute when step is completed */
128
- on_complete?: string;
129
- }
130
- /**
131
- * Form action/button configuration
132
- */
133
- export interface FormAction {
134
- /** Action identifier */
135
- name: string;
136
- /** Display label */
137
- label: string;
138
- /** Button type */
139
- type?: 'submit' | 'cancel' | 'custom' | 'save' | 'save_new' | 'save_close';
140
- /** Icon */
141
- icon?: string;
142
- /** Button style variant */
143
- variant?: 'primary' | 'secondary' | 'danger' | 'success' | 'ghost';
144
- /** Position */
145
- position?: 'header' | 'footer' | 'both';
146
- /** Confirmation message before executing */
147
- confirm?: string;
148
- /** Visibility condition */
149
- visible_when?: ValidationCondition | string;
150
- /** Enabled condition */
151
- enabled_when?: ValidationCondition | string;
152
- /** Custom action handler */
153
- handler?: string;
154
- /** Navigate to path after action */
155
- redirect?: string;
156
- }
157
- /**
158
- * Form validation configuration
159
- */
160
- export interface FormValidationConfig {
161
- /** Enable real-time validation */
162
- realtime?: boolean;
163
- /** Validate on blur */
164
- validate_on_blur?: boolean;
165
- /** Validate on change */
166
- validate_on_change?: boolean;
167
- /** Show validation summary */
168
- show_summary?: boolean;
169
- /** Custom validation rules */
170
- rules?: any[];
171
- }
172
- /**
173
- * Form header configuration
174
- */
175
- export interface FormHeader {
176
- /** Show header */
177
- show?: boolean;
178
- /** Header title */
179
- title?: string;
180
- /** Header subtitle */
181
- subtitle?: string;
182
- /** Show record info (created, updated dates) */
183
- show_record_info?: boolean;
184
- /** Custom header component */
185
- component?: string;
186
- }
187
- /**
188
- * Form footer configuration
189
- */
190
- export interface FormFooter {
191
- /** Show footer */
192
- show?: boolean;
193
- /** Footer actions */
194
- actions?: FormAction[];
195
- /** Footer position */
196
- position?: 'sticky' | 'static';
197
- /** Custom footer component */
198
- component?: string;
199
- }
200
- /**
201
- * Form autosave configuration
202
- */
203
- export interface FormAutosaveConfig {
204
- /** Enable autosave */
205
- enabled: boolean;
206
- /** Autosave interval in milliseconds */
207
- interval?: number;
208
- /** Show autosave indicator */
209
- show_indicator?: boolean;
210
- /** Autosave on field blur */
211
- on_blur?: boolean;
212
- }
213
- /**
214
- * Complete form configuration
215
- */
216
- export interface FormConfig {
217
- /** Unique form identifier */
218
- name: string;
219
- /** Display label */
220
- label: string;
221
- /** Form type */
222
- type?: FormType;
223
- /** Object this form is for */
224
- object: string;
225
- /** Form description */
226
- description?: string;
227
- /** Layout type */
228
- layout: FormLayoutType;
229
- /** Number of columns (for column layouts) */
230
- columns?: number;
231
- /** Sections (for non-tab layouts) */
232
- sections?: FormSection[];
233
- /** Tabs (for tab layout) */
234
- tabs?: FormTab[];
235
- /** Wizard steps (for wizard layout) */
236
- steps?: WizardStep[];
237
- /** Form header */
238
- header?: FormHeader;
239
- /** Form footer */
240
- footer?: FormFooter;
241
- /** Form actions/buttons */
242
- actions?: FormAction[];
243
- /** Validation configuration */
244
- validation?: FormValidationConfig;
245
- /** Autosave configuration */
246
- autosave?: FormAutosaveConfig;
247
- /** Show required field indicator */
248
- show_required_indicator?: boolean;
249
- /** Show field help text */
250
- show_help_text?: boolean;
251
- /** Compact mode (reduced spacing) */
252
- compact?: boolean;
253
- /** Read-only mode */
254
- readonly?: boolean;
255
- /** Disable all fields */
256
- disabled?: boolean;
257
- /** Show success message after save */
258
- success_message?: string;
259
- /** Redirect after successful save */
260
- redirect_on_success?: string;
261
- /** Access control */
262
- permissions?: {
263
- /** Roles that can view this form */
264
- view?: string[];
265
- /** Roles that can edit using this form */
266
- edit?: string[];
267
- };
268
- /** Custom form handler */
269
- handler?: string;
270
- /** Custom CSS class */
271
- class_name?: string;
272
- /** Form width (for modal forms) */
273
- width?: string;
274
- /** Maximum width */
275
- max_width?: string;
276
- /** Custom form configuration */
277
- config?: Record<string, any>;
278
- /** AI context for form generation */
279
- ai_context?: {
280
- /** Purpose of this form */
281
- intent?: string;
282
- /** User experience goals */
283
- ux_goals?: string[];
284
- /** Field organization strategy */
285
- organization_strategy?: string;
286
- };
287
- }
288
- /**
289
- * Lightweight form reference
290
- * Used in navigation, dropdowns, and form selectors
291
- */
292
- export interface FormReference {
293
- /** Form name/identifier */
294
- name: string;
295
- /** Display label */
296
- label?: string;
297
- /** Form type */
298
- type?: FormType;
299
- /** Whether this is the default form */
300
- is_default?: boolean;
301
- }
302
- /**
303
- * Dynamic form state (runtime)
304
- */
305
- export interface FormState {
306
- /** Current form values */
307
- values: Record<string, any>;
308
- /** Field errors */
309
- errors: Record<string, string>;
310
- /** Touched fields */
311
- touched: Record<string, boolean>;
312
- /** Whether form is submitting */
313
- submitting: boolean;
314
- /** Whether form is valid */
315
- valid: boolean;
316
- /** Whether form is dirty (has changes) */
317
- dirty: boolean;
318
- /** Current wizard step (for wizard forms) */
319
- current_step?: number;
320
- /** Custom state */
321
- custom?: Record<string, any>;
322
- }
package/dist/form.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- /**
3
- * ObjectQL
4
- * Copyright (c) 2026-present ObjectStack Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- //# sourceMappingURL=form.js.map
package/dist/form.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"form.js","sourceRoot":"","sources":["../src/form.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
package/dist/menu.d.ts DELETED
@@ -1,89 +0,0 @@
1
- /**
2
- * ObjectQL
3
- * Copyright (c) 2026-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
- export type MenuType = 'sidebar' | 'topnav' | 'context' | 'mobile' | 'admin';
9
- export type MenuItemType = 'page' | 'section' | 'url' | 'folder' | 'object' | 'action';
10
- export interface MenuItem {
11
- /**
12
- * Unique identifier for the menu item
13
- */
14
- name: string;
15
- /**
16
- * Display label
17
- */
18
- label: string;
19
- /**
20
- * Icon name
21
- */
22
- icon?: string;
23
- /**
24
- * Item type
25
- */
26
- type?: MenuItemType;
27
- /**
28
- * Navigation path (for type: page/url)
29
- */
30
- path?: string;
31
- /**
32
- * Associated Object name (for type: object)
33
- */
34
- object?: string;
35
- /**
36
- * Object View name (for type: object)
37
- */
38
- view?: string;
39
- /**
40
- * Nested menu items
41
- */
42
- items?: MenuItem[];
43
- /**
44
- * Link target (e.g. _blank)
45
- */
46
- target?: string;
47
- /**
48
- * Visibility condition
49
- */
50
- hidden?: boolean | string;
51
- /**
52
- * Badge value or expression
53
- */
54
- badge?: string;
55
- /**
56
- * Custom properties
57
- */
58
- [key: string]: any;
59
- }
60
- export interface MenuConfig {
61
- /**
62
- * Unique identifier for the menu
63
- */
64
- name: string;
65
- /**
66
- * Display label
67
- */
68
- label: string;
69
- /**
70
- * Menu type/location
71
- */
72
- type?: MenuType;
73
- /**
74
- * The application this menu belongs to
75
- */
76
- app?: string;
77
- /**
78
- * Menu items
79
- */
80
- items: MenuItem[];
81
- /**
82
- * Whether the menu is active
83
- */
84
- is_active?: boolean;
85
- /**
86
- * Custom properties
87
- */
88
- [key: string]: any;
89
- }
package/dist/menu.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["../src/menu.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
package/dist/page.d.ts DELETED
@@ -1,279 +0,0 @@
1
- /**
2
- * ObjectQL
3
- * Copyright (c) 2026-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
- * Page Metadata Definition
10
- *
11
- * Defines the structure for pages in ObjectQL applications.
12
- * Inspired by low-code platforms like Airtable, Retool, Appsmith, and Salesforce Lightning.
13
- *
14
- * Pages are composable UI containers that can render data from objects,
15
- * display custom components, and orchestrate user interactions.
16
- */
17
- /**
18
- * Layout types for page arrangement
19
- */
20
- export type PageLayoutType = 'single_column' | 'two_column' | 'three_column' | 'dashboard' | 'canvas' | 'tabs' | 'wizard' | 'custom';
21
- /**
22
- * Component types that can be placed on a page
23
- */
24
- export type PageComponentType = 'data_grid' | 'form' | 'detail_view' | 'chart' | 'metric' | 'list' | 'calendar' | 'kanban' | 'timeline' | 'text' | 'html' | 'iframe' | 'button' | 'tabs' | 'container' | 'divider' | 'image' | 'custom';
25
- /**
26
- * Responsive breakpoint configuration
27
- */
28
- export interface ResponsiveConfig {
29
- /** Mobile viewport (< 640px) */
30
- mobile?: {
31
- columns?: number;
32
- visible?: boolean;
33
- order?: number;
34
- };
35
- /** Tablet viewport (640px - 1024px) */
36
- tablet?: {
37
- columns?: number;
38
- visible?: boolean;
39
- order?: number;
40
- };
41
- /** Desktop viewport (> 1024px) */
42
- desktop?: {
43
- columns?: number;
44
- visible?: boolean;
45
- order?: number;
46
- };
47
- }
48
- /**
49
- * Data source configuration for components
50
- */
51
- export interface ComponentDataSource {
52
- /** Object name to query */
53
- object?: string;
54
- /** Filter conditions */
55
- filters?: any[];
56
- /** Fields to display */
57
- fields?: string[];
58
- /** Sort configuration */
59
- sort?: Array<[string, 'asc' | 'desc']>;
60
- /** Maximum records to fetch */
61
- limit?: number;
62
- /** Enable pagination */
63
- paginate?: boolean;
64
- /** Related objects to expand */
65
- expand?: Record<string, any>;
66
- /** Custom query override */
67
- query?: any;
68
- }
69
- /**
70
- * Action triggered by component interaction
71
- */
72
- export interface ComponentAction {
73
- /** Action type */
74
- type: 'navigate' | 'open_modal' | 'run_action' | 'submit_form' | 'refresh' | 'custom';
75
- /** Navigation path (for type: navigate) */
76
- path?: string;
77
- /** Modal component to open (for type: open_modal) */
78
- modal?: string;
79
- /** Action name to execute (for type: run_action) */
80
- action?: string;
81
- /** Target object for action */
82
- object?: string;
83
- /** Custom handler function */
84
- handler?: string;
85
- /** Confirmation message before executing */
86
- confirm?: string;
87
- /** Success message after execution */
88
- success_message?: string;
89
- /** Error handling */
90
- on_error?: 'show_toast' | 'show_modal' | 'ignore';
91
- }
92
- /**
93
- * Styling configuration for components
94
- */
95
- export interface ComponentStyle {
96
- /** Width (e.g., '100%', '300px', 'auto') */
97
- width?: string;
98
- /** Height */
99
- height?: string;
100
- /** Minimum width */
101
- min_width?: string;
102
- /** Minimum height */
103
- min_height?: string;
104
- /** Background color */
105
- background?: string;
106
- /** Text color */
107
- color?: string;
108
- /** Border */
109
- border?: string;
110
- /** Border radius */
111
- border_radius?: string;
112
- /** Padding */
113
- padding?: string;
114
- /** Margin */
115
- margin?: string;
116
- /** Custom CSS classes */
117
- class_name?: string;
118
- /** Inline styles */
119
- custom_css?: Record<string, any>;
120
- }
121
- /**
122
- * Base component configuration
123
- */
124
- export interface PageComponent {
125
- /** Unique component identifier within the page */
126
- id: string;
127
- /** Component type */
128
- type: PageComponentType;
129
- /** Display label */
130
- label?: string;
131
- /** Component description */
132
- description?: string;
133
- /** Data source configuration */
134
- data_source?: ComponentDataSource;
135
- /** Component-specific configuration */
136
- config?: Record<string, any>;
137
- /** Actions triggered by this component */
138
- actions?: {
139
- on_click?: ComponentAction;
140
- on_submit?: ComponentAction;
141
- on_load?: ComponentAction;
142
- on_change?: ComponentAction;
143
- [key: string]: ComponentAction | undefined;
144
- };
145
- /** Visual styling */
146
- style?: ComponentStyle;
147
- /** Responsive behavior */
148
- responsive?: ResponsiveConfig;
149
- /** Visibility conditions */
150
- visible_when?: Record<string, any>;
151
- /** Access control */
152
- permissions?: string[];
153
- /** Nested components (for containers, tabs, etc.) */
154
- components?: PageComponent[];
155
- /** Grid position (for dashboard layout) */
156
- grid?: {
157
- x: number;
158
- y: number;
159
- w: number;
160
- h: number;
161
- };
162
- /** Custom component reference */
163
- component?: string;
164
- }
165
- /**
166
- * Page section/region configuration
167
- */
168
- export interface PageSection {
169
- /** Section identifier */
170
- id: string;
171
- /** Section label */
172
- label?: string;
173
- /** Section type */
174
- type?: 'header' | 'sidebar' | 'content' | 'footer' | 'custom';
175
- /** Components in this section */
176
- components: PageComponent[];
177
- /** Section styling */
178
- style?: ComponentStyle;
179
- /** Collapsible section */
180
- collapsible?: boolean;
181
- /** Default collapsed state */
182
- collapsed?: boolean;
183
- /** Visibility conditions */
184
- visible_when?: Record<string, any>;
185
- }
186
- /**
187
- * Page metadata configuration
188
- */
189
- export interface PageConfig {
190
- /** Unique page identifier */
191
- name: string;
192
- /** Display label */
193
- label: string;
194
- /** Page description */
195
- description?: string;
196
- /** Icon for navigation */
197
- icon?: string;
198
- /** Layout type */
199
- layout: PageLayoutType;
200
- /** Page sections */
201
- sections?: PageSection[];
202
- /** Components (alternative to sections for simple layouts) */
203
- components?: PageComponent[];
204
- /** Page-level data sources */
205
- data_sources?: Record<string, ComponentDataSource>;
206
- /** Page-level actions */
207
- actions?: Record<string, ComponentAction>;
208
- /** Page styling */
209
- style?: ComponentStyle;
210
- /** Access control */
211
- permissions?: {
212
- /** Roles allowed to view this page */
213
- view?: string[];
214
- /** Roles allowed to edit this page */
215
- edit?: string[];
216
- };
217
- /** SEO and metadata */
218
- meta?: {
219
- title?: string;
220
- description?: string;
221
- keywords?: string[];
222
- };
223
- /** Page state management */
224
- state?: {
225
- /** Initial state values */
226
- initial?: Record<string, any>;
227
- /** State persistence */
228
- persist?: boolean;
229
- /** Storage key for persistence */
230
- storage_key?: string;
231
- };
232
- /** Responsive configuration */
233
- responsive?: ResponsiveConfig;
234
- /** Custom page handler/controller */
235
- handler?: string;
236
- /** Enable real-time updates */
237
- realtime?: boolean;
238
- /** Refresh interval in seconds */
239
- refresh_interval?: number;
240
- /** AI context for page generation and understanding */
241
- ai_context?: {
242
- /** Purpose of the page */
243
- intent?: string;
244
- /** Target user persona */
245
- persona?: string;
246
- /** Key user tasks */
247
- tasks?: string[];
248
- };
249
- }
250
- /**
251
- * Lightweight page reference (for menus, navigation, etc.)
252
- *
253
- * Used in application navigation menus and links to reference pages
254
- * without loading the full page configuration. This is useful for:
255
- * - Building navigation menus
256
- * - Creating page links
257
- * - Page selection dropdowns
258
- *
259
- * @example
260
- * ```typescript
261
- * // In navigation menu
262
- * const menuItem: PageReference = {
263
- * name: 'dashboard',
264
- * label: 'Dashboard',
265
- * icon: 'dashboard',
266
- * path: '/dashboard'
267
- * };
268
- * ```
269
- */
270
- export interface PageReference {
271
- /** Page name/identifier */
272
- name: string;
273
- /** Display label */
274
- label?: string;
275
- /** Icon */
276
- icon?: string;
277
- /** Path/route */
278
- path?: string;
279
- }