@object-ui/types 3.0.3 → 3.1.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/dist/app.d.ts +217 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +85 -1
- package/dist/complex.d.ts +118 -0
- package/dist/complex.d.ts.map +1 -1
- package/dist/data-display.d.ts +105 -1
- package/dist/data-display.d.ts.map +1 -1
- package/dist/data.d.ts +45 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/designer.d.ts +197 -35
- package/dist/designer.d.ts.map +1 -1
- package/dist/designer.js +11 -1
- package/dist/index.d.ts +21 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/layout.d.ts +39 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/navigation.d.ts +27 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/objectql.d.ts +641 -7
- package/dist/objectql.d.ts.map +1 -1
- package/dist/record-components.d.ts +160 -0
- package/dist/record-components.d.ts.map +1 -0
- package/dist/record-components.js +8 -0
- package/dist/reports.d.ts +37 -0
- package/dist/reports.d.ts.map +1 -1
- package/dist/theme.d.ts +5 -0
- package/dist/theme.d.ts.map +1 -1
- package/dist/views.d.ts +257 -3
- package/dist/views.d.ts.map +1 -1
- package/dist/workflow.d.ts +198 -0
- package/dist/workflow.d.ts.map +1 -1
- package/dist/zod/app.zod.d.ts +42 -2
- package/dist/zod/app.zod.d.ts.map +1 -1
- package/dist/zod/app.zod.js +61 -1
- package/dist/zod/complex.zod.d.ts +122 -0
- package/dist/zod/complex.zod.d.ts.map +1 -1
- package/dist/zod/complex.zod.js +57 -0
- package/dist/zod/data-display.zod.d.ts +4 -0
- package/dist/zod/data-display.zod.d.ts.map +1 -1
- package/dist/zod/data-display.zod.js +2 -0
- package/dist/zod/form.zod.d.ts +6 -6
- package/dist/zod/index.zod.d.ts +364 -41
- package/dist/zod/index.zod.d.ts.map +1 -1
- package/dist/zod/index.zod.js +2 -2
- package/dist/zod/layout.zod.d.ts +6 -6
- package/dist/zod/navigation.zod.d.ts +58 -12
- package/dist/zod/navigation.zod.d.ts.map +1 -1
- package/dist/zod/navigation.zod.js +21 -9
- package/dist/zod/objectql.zod.d.ts +515 -27
- package/dist/zod/objectql.zod.d.ts.map +1 -1
- package/dist/zod/objectql.zod.js +162 -0
- package/dist/zod/reports.zod.d.ts +38 -38
- package/dist/zod/views.zod.d.ts +161 -7
- package/dist/zod/views.zod.d.ts.map +1 -1
- package/dist/zod/views.zod.js +21 -2
- package/package.json +2 -2
- package/src/__tests__/app-creation-types.test.ts +177 -0
- package/src/__tests__/dashboard-config.test.ts +208 -0
- package/src/__tests__/examples-metadata-compliance.test.ts +264 -0
- package/src/__tests__/navigation-model.test.ts +406 -0
- package/src/__tests__/p1-spec-alignment.test.ts +660 -0
- package/src/__tests__/p2-spec-exports.test.ts +312 -0
- package/src/__tests__/phase2-schemas.test.ts +108 -0
- package/src/app.ts +377 -0
- package/src/complex.ts +120 -0
- package/src/data-display.ts +107 -0
- package/src/data.ts +49 -0
- package/src/designer.ts +219 -30
- package/src/index.ts +192 -3
- package/src/layout.ts +55 -2
- package/src/navigation.ts +20 -0
- package/src/objectql.ts +757 -8
- package/src/record-components.ts +188 -0
- package/src/reports.ts +43 -0
- package/src/theme.ts +6 -0
- package/src/views.ts +275 -3
- package/src/workflow.ts +226 -0
- package/src/zod/app.zod.ts +74 -1
- package/src/zod/complex.zod.ts +59 -0
- package/src/zod/data-display.zod.ts +2 -0
- package/src/zod/index.zod.ts +5 -0
- package/src/zod/navigation.zod.ts +22 -10
- package/src/zod/objectql.zod.ts +167 -0
- package/src/zod/views.zod.ts +21 -2
package/src/workflow.ts
CHANGED
|
@@ -407,3 +407,229 @@ export interface WorkflowInstanceSchema extends BaseSchema {
|
|
|
407
407
|
*/
|
|
408
408
|
data?: Record<string, any>;
|
|
409
409
|
}
|
|
410
|
+
|
|
411
|
+
// ============================================================================
|
|
412
|
+
// Flow Designer — spec v3.0.9 enhanced flow editor
|
|
413
|
+
// ============================================================================
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Flow node types — includes v3.0.9 gateway/boundary additions
|
|
417
|
+
*/
|
|
418
|
+
export type FlowNodeType =
|
|
419
|
+
| 'start'
|
|
420
|
+
| 'end'
|
|
421
|
+
| 'task'
|
|
422
|
+
| 'user_task'
|
|
423
|
+
| 'service_task'
|
|
424
|
+
| 'script_task'
|
|
425
|
+
| 'approval'
|
|
426
|
+
| 'condition'
|
|
427
|
+
| 'parallel_gateway'
|
|
428
|
+
| 'join_gateway'
|
|
429
|
+
| 'boundary_event'
|
|
430
|
+
| 'delay'
|
|
431
|
+
| 'notification'
|
|
432
|
+
| 'webhook';
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Wait event type for boundary/delay nodes (spec v3.0.9 WaitEventType)
|
|
436
|
+
*/
|
|
437
|
+
export type FlowWaitEventType = 'condition' | 'manual' | 'webhook' | 'timer' | 'signal';
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Execution status for a flow node
|
|
441
|
+
*/
|
|
442
|
+
export type FlowNodeExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Node executor descriptor (spec v3.0.9 NodeExecutorDescriptor)
|
|
446
|
+
*/
|
|
447
|
+
export interface FlowNodeExecutorDescriptor {
|
|
448
|
+
/** Executor type identifier */
|
|
449
|
+
type: string;
|
|
450
|
+
/** Human-readable label */
|
|
451
|
+
label?: string;
|
|
452
|
+
/** Input schema (JSON Schema) */
|
|
453
|
+
inputSchema?: Record<string, unknown>;
|
|
454
|
+
/** Output schema (JSON Schema) */
|
|
455
|
+
outputSchema?: Record<string, unknown>;
|
|
456
|
+
/** Wait event configuration for wait/timer executors */
|
|
457
|
+
waitEventConfig?: {
|
|
458
|
+
eventType: FlowWaitEventType;
|
|
459
|
+
/** Timer duration expression (ISO 8601 or expression) */
|
|
460
|
+
timer?: string;
|
|
461
|
+
/** Condition expression */
|
|
462
|
+
condition?: string;
|
|
463
|
+
/** Webhook URL */
|
|
464
|
+
webhookUrl?: string;
|
|
465
|
+
/** Signal name */
|
|
466
|
+
signalName?: string;
|
|
467
|
+
};
|
|
468
|
+
/** Timeout behavior */
|
|
469
|
+
timeoutMs?: number;
|
|
470
|
+
/** Retry configuration (spec v3.0.9 enhanced retry) */
|
|
471
|
+
retry?: {
|
|
472
|
+
maxAttempts?: number;
|
|
473
|
+
delayMs?: number;
|
|
474
|
+
backoffMultiplier?: number;
|
|
475
|
+
maxRetryDelayMs?: number;
|
|
476
|
+
jitter?: boolean;
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Boundary configuration for boundary event nodes (spec v3.0.9)
|
|
482
|
+
*/
|
|
483
|
+
export interface FlowBoundaryConfig {
|
|
484
|
+
/** The host node this boundary event is attached to */
|
|
485
|
+
attachedToNodeId: string;
|
|
486
|
+
/** Boundary event sub-type */
|
|
487
|
+
eventType: 'error' | 'timer' | 'message' | 'signal' | 'compensation';
|
|
488
|
+
/** Whether the boundary event is interrupting */
|
|
489
|
+
cancelActivity?: boolean;
|
|
490
|
+
/** Timer expression (ISO 8601) for timer boundary events */
|
|
491
|
+
timer?: string;
|
|
492
|
+
/** Error code pattern for error boundary events */
|
|
493
|
+
errorCode?: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* A node in the flow graph
|
|
498
|
+
*/
|
|
499
|
+
export interface FlowNode {
|
|
500
|
+
/** Unique node identifier */
|
|
501
|
+
id: string;
|
|
502
|
+
/** Node type */
|
|
503
|
+
type: FlowNodeType;
|
|
504
|
+
/** Display label */
|
|
505
|
+
label: string;
|
|
506
|
+
/** Node description */
|
|
507
|
+
description?: string;
|
|
508
|
+
/** Canvas position */
|
|
509
|
+
position: { x: number; y: number };
|
|
510
|
+
/** Node executor configuration (spec v3.0.9) */
|
|
511
|
+
executor?: FlowNodeExecutorDescriptor;
|
|
512
|
+
/** Boundary event configuration (spec v3.0.9, only for boundary_event nodes) */
|
|
513
|
+
boundaryConfig?: FlowBoundaryConfig;
|
|
514
|
+
/** Runtime execution status (used in monitoring view) */
|
|
515
|
+
executionStatus?: FlowNodeExecutionStatus;
|
|
516
|
+
/** Node-specific properties */
|
|
517
|
+
properties?: Record<string, unknown>;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Flow edge types — includes v3.0.9 conditional edges
|
|
522
|
+
*/
|
|
523
|
+
export type FlowEdgeType = 'default' | 'conditional' | 'timeout';
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* An edge connecting two flow nodes
|
|
527
|
+
*/
|
|
528
|
+
export interface FlowEdge {
|
|
529
|
+
/** Unique edge identifier */
|
|
530
|
+
id: string;
|
|
531
|
+
/** Source node identifier */
|
|
532
|
+
source: string;
|
|
533
|
+
/** Target node identifier */
|
|
534
|
+
target: string;
|
|
535
|
+
/** Edge type */
|
|
536
|
+
type?: FlowEdgeType;
|
|
537
|
+
/** Display label */
|
|
538
|
+
label?: string;
|
|
539
|
+
/** Condition expression (for conditional edges) */
|
|
540
|
+
condition?: string;
|
|
541
|
+
/** Whether this is the default/fallthrough edge (spec v3.0.9 isDefault flag) */
|
|
542
|
+
isDefault?: boolean;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Flow version entry (spec v3.0.9 FlowVersionHistory)
|
|
547
|
+
*/
|
|
548
|
+
export interface FlowVersionEntry {
|
|
549
|
+
/** Version number */
|
|
550
|
+
version: number;
|
|
551
|
+
/** ISO 8601 timestamp */
|
|
552
|
+
createdAt: string;
|
|
553
|
+
/** Author identifier */
|
|
554
|
+
author?: string;
|
|
555
|
+
/** Change description */
|
|
556
|
+
changeNote?: string;
|
|
557
|
+
/** Whether this version is currently active */
|
|
558
|
+
isCurrent?: boolean;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* Concurrency policy (spec v3.0.9 ConcurrencyPolicy)
|
|
563
|
+
*/
|
|
564
|
+
export type FlowConcurrencyPolicy = 'allow' | 'forbid' | 'replace' | 'queue';
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* BPMN interop result (spec v3.0.9 BpmnInteropResult)
|
|
568
|
+
*/
|
|
569
|
+
export interface FlowBpmnInteropResult {
|
|
570
|
+
/** Whether the operation succeeded */
|
|
571
|
+
success: boolean;
|
|
572
|
+
/** Number of nodes mapped */
|
|
573
|
+
nodeCount?: number;
|
|
574
|
+
/** Number of edges mapped */
|
|
575
|
+
edgeCount?: number;
|
|
576
|
+
/** Warnings produced during mapping */
|
|
577
|
+
warnings?: string[];
|
|
578
|
+
/** Errors produced during mapping */
|
|
579
|
+
errors?: string[];
|
|
580
|
+
/** Raw BPMN XML string (for export) */
|
|
581
|
+
bpmnXml?: string;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Execution log step (spec v3.0.9 ExecutionStepLog)
|
|
586
|
+
*/
|
|
587
|
+
export interface FlowExecutionStep {
|
|
588
|
+
/** Node identifier */
|
|
589
|
+
nodeId: string;
|
|
590
|
+
/** Step status */
|
|
591
|
+
status: FlowNodeExecutionStatus;
|
|
592
|
+
/** ISO 8601 start timestamp */
|
|
593
|
+
startedAt?: string;
|
|
594
|
+
/** ISO 8601 end timestamp */
|
|
595
|
+
completedAt?: string;
|
|
596
|
+
/** Error message (if failed) */
|
|
597
|
+
error?: string;
|
|
598
|
+
/** Step output data */
|
|
599
|
+
output?: Record<string, unknown>;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Flow Designer Schema — canvas-based flow editor component
|
|
604
|
+
*/
|
|
605
|
+
export interface FlowDesignerSchema extends BaseSchema {
|
|
606
|
+
type: 'flow-designer';
|
|
607
|
+
/** Flow nodes */
|
|
608
|
+
nodes?: FlowNode[];
|
|
609
|
+
/** Flow edges */
|
|
610
|
+
edges?: FlowEdge[];
|
|
611
|
+
/** Flow title */
|
|
612
|
+
title?: string;
|
|
613
|
+
/** Flow description */
|
|
614
|
+
description?: string;
|
|
615
|
+
/** Flow lifecycle status */
|
|
616
|
+
status?: WorkflowStatus;
|
|
617
|
+
/** Concurrency policy (spec v3.0.9) */
|
|
618
|
+
concurrencyPolicy?: FlowConcurrencyPolicy;
|
|
619
|
+
/** Version history */
|
|
620
|
+
versionHistory?: FlowVersionEntry[];
|
|
621
|
+
/** Execution steps (for monitoring overlay) */
|
|
622
|
+
executionSteps?: FlowExecutionStep[];
|
|
623
|
+
/** Whether the designer is read-only */
|
|
624
|
+
readOnly?: boolean;
|
|
625
|
+
/** Show minimap */
|
|
626
|
+
showMinimap?: boolean;
|
|
627
|
+
/** Show toolbar */
|
|
628
|
+
showToolbar?: boolean;
|
|
629
|
+
/** Show version history panel */
|
|
630
|
+
showVersionHistory?: boolean;
|
|
631
|
+
/** Show execution monitoring overlay */
|
|
632
|
+
showExecutionOverlay?: boolean;
|
|
633
|
+
/** Callback action name for save */
|
|
634
|
+
onSave?: string;
|
|
635
|
+
}
|
package/src/zod/app.zod.ts
CHANGED
|
@@ -19,8 +19,69 @@
|
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
import { BaseSchema } from './base.zod.js';
|
|
21
21
|
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Unified NavigationItem Schema
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Navigation Item Type enum
|
|
28
|
+
*/
|
|
29
|
+
export const NavigationItemTypeSchema = z.enum([
|
|
30
|
+
'object', 'dashboard', 'page', 'report', 'url', 'group', 'separator', 'action',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Navigation Item Schema — unified model aligned with @objectstack/spec.
|
|
35
|
+
*/
|
|
36
|
+
export const NavigationItemSchema: z.ZodType<any> = z.lazy(() => z.object({
|
|
37
|
+
id: z.string().describe('Unique identifier'),
|
|
38
|
+
type: NavigationItemTypeSchema.describe('Navigation item type'),
|
|
39
|
+
label: z.string().describe('Display label'),
|
|
40
|
+
icon: z.string().optional().describe('Icon name (Lucide)'),
|
|
41
|
+
|
|
42
|
+
// Type-specific target fields
|
|
43
|
+
objectName: z.string().optional().describe('Target object name (type: object)'),
|
|
44
|
+
viewName: z.string().optional().describe('Target view name (type: object) — named list view e.g. calendar, pipeline'),
|
|
45
|
+
dashboardName: z.string().optional().describe('Target dashboard name (type: dashboard)'),
|
|
46
|
+
pageName: z.string().optional().describe('Target page name (type: page)'),
|
|
47
|
+
reportName: z.string().optional().describe('Target report name (type: report)'),
|
|
48
|
+
url: z.string().optional().describe('Target URL (type: url)'),
|
|
49
|
+
target: z.enum(['_blank', '_self']).optional().describe('Link target (type: url)'),
|
|
50
|
+
|
|
51
|
+
// Grouping
|
|
52
|
+
children: z.array(z.lazy(() => NavigationItemSchema)).optional().describe('Child items (type: group)'),
|
|
53
|
+
|
|
54
|
+
// Visibility & Permissions
|
|
55
|
+
visible: z.union([z.boolean(), z.string()]).optional().describe('Visibility expression'),
|
|
56
|
+
requiredPermissions: z.array(z.string()).optional().describe('Required permissions'),
|
|
57
|
+
|
|
58
|
+
// UX Enhancements
|
|
59
|
+
badge: z.union([z.string(), z.number()]).optional().describe('Badge text or count'),
|
|
60
|
+
badgeVariant: z.enum(['default', 'destructive', 'outline']).optional().describe('Badge variant'),
|
|
61
|
+
defaultOpen: z.boolean().optional().describe('Group default expanded state'),
|
|
62
|
+
pinned: z.boolean().optional().describe('Pinned item'),
|
|
63
|
+
order: z.number().optional().describe('Sort order weight'),
|
|
64
|
+
}));
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Navigation Area Schema — business-domain partition of navigation.
|
|
68
|
+
*/
|
|
69
|
+
export const NavigationAreaSchema = z.object({
|
|
70
|
+
id: z.string().describe('Unique identifier'),
|
|
71
|
+
label: z.string().describe('Display label'),
|
|
72
|
+
icon: z.string().optional().describe('Icon name (Lucide)'),
|
|
73
|
+
navigation: z.array(NavigationItemSchema).describe('Navigation items within area'),
|
|
74
|
+
visible: z.union([z.boolean(), z.string()]).optional().describe('Visibility expression'),
|
|
75
|
+
requiredPermissions: z.array(z.string()).optional().describe('Required permissions'),
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// Legacy MenuItem Schema (backward compat)
|
|
80
|
+
// ============================================================================
|
|
81
|
+
|
|
22
82
|
/**
|
|
23
83
|
* Menu Item Schema - Navigation menu item
|
|
84
|
+
* @deprecated Use NavigationItemSchema instead.
|
|
24
85
|
*/
|
|
25
86
|
export const MenuItemSchema: z.ZodType<any> = z.lazy(() => z.object({
|
|
26
87
|
type: z.enum(['item', 'group', 'separator']).optional().describe('Item type'),
|
|
@@ -33,6 +94,10 @@ export const MenuItemSchema: z.ZodType<any> = z.lazy(() => z.object({
|
|
|
33
94
|
hidden: z.union([z.boolean(), z.string()]).optional().describe('Visibility condition'),
|
|
34
95
|
}));
|
|
35
96
|
|
|
97
|
+
// ============================================================================
|
|
98
|
+
// App Action Schema
|
|
99
|
+
// ============================================================================
|
|
100
|
+
|
|
36
101
|
/**
|
|
37
102
|
* App Action Schema - Application header/toolbar action
|
|
38
103
|
*/
|
|
@@ -49,6 +114,10 @@ export const AppActionSchema = z.object({
|
|
|
49
114
|
size: z.enum(['default', 'sm', 'lg', 'icon']).optional().describe('Button size'),
|
|
50
115
|
});
|
|
51
116
|
|
|
117
|
+
// ============================================================================
|
|
118
|
+
// App Schema
|
|
119
|
+
// ============================================================================
|
|
120
|
+
|
|
52
121
|
/**
|
|
53
122
|
* App Schema - Top-level application configuration
|
|
54
123
|
*/
|
|
@@ -60,13 +129,17 @@ export const AppSchema = BaseSchema.extend({
|
|
|
60
129
|
logo: z.string().optional().describe('Logo URL or icon name'),
|
|
61
130
|
favicon: z.string().optional().describe('Favicon URL'),
|
|
62
131
|
layout: z.enum(['sidebar', 'header', 'empty']).optional().default('sidebar').describe('Global layout strategy'),
|
|
63
|
-
menu: z.array(MenuItemSchema).optional().describe('
|
|
132
|
+
menu: z.array(MenuItemSchema).optional().describe('Legacy navigation menu (deprecated, use navigation)'),
|
|
133
|
+
navigation: z.array(NavigationItemSchema).optional().describe('Unified navigation tree'),
|
|
134
|
+
areas: z.array(NavigationAreaSchema).optional().describe('Navigation areas (business-domain partitions)'),
|
|
64
135
|
actions: z.array(AppActionSchema).optional().describe('Global actions (user profile, settings, etc.)'),
|
|
65
136
|
});
|
|
66
137
|
|
|
67
138
|
/**
|
|
68
139
|
* Export type inference helpers
|
|
69
140
|
*/
|
|
141
|
+
export type NavigationItemSchemaType = z.infer<typeof NavigationItemSchema>;
|
|
142
|
+
export type NavigationAreaSchemaType = z.infer<typeof NavigationAreaSchema>;
|
|
70
143
|
export type MenuItemSchemaType = z.infer<typeof MenuItemSchema>;
|
|
71
144
|
export type AppActionSchemaType = z.infer<typeof AppActionSchema>;
|
|
72
145
|
export type AppSchemaType = z.infer<typeof AppSchema>;
|
package/src/zod/complex.zod.ts
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { z } from 'zod';
|
|
20
20
|
import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
|
|
21
|
+
import { DASHBOARD_COLOR_VARIANTS, DASHBOARD_WIDGET_TYPES } from '../designer.js';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Kanban Card Schema
|
|
@@ -251,6 +252,64 @@ export const DashboardSchema = BaseSchema.extend({
|
|
|
251
252
|
widgets: z.array(DashboardWidgetSchema).describe('Dashboard widgets'),
|
|
252
253
|
});
|
|
253
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Dashboard Widget Config Schema (for DashboardConfigPanel)
|
|
257
|
+
*/
|
|
258
|
+
export const DashboardWidgetConfigSchema = z.object({
|
|
259
|
+
id: z.string().describe('Widget ID'),
|
|
260
|
+
title: z.string().optional().describe('Widget title'),
|
|
261
|
+
description: z.string().optional().describe('Widget description'),
|
|
262
|
+
type: z.enum(DASHBOARD_WIDGET_TYPES).optional().describe('Widget visualization type'),
|
|
263
|
+
object: z.string().optional().describe('Data source object name'),
|
|
264
|
+
filter: z.array(z.any()).optional().describe('Widget filter conditions'),
|
|
265
|
+
categoryField: z.string().optional().describe('Category/x-axis field'),
|
|
266
|
+
valueField: z.string().optional().describe('Value/y-axis field'),
|
|
267
|
+
aggregate: z.string().optional().describe('Aggregation function'),
|
|
268
|
+
chartConfig: z.any().optional().describe('Chart configuration'),
|
|
269
|
+
colorVariant: z.enum(DASHBOARD_COLOR_VARIANTS).optional().describe('Color variant'),
|
|
270
|
+
layout: DashboardWidgetLayoutSchema.optional().describe('Widget grid layout'),
|
|
271
|
+
actionUrl: z.string().optional().describe('Clickable action URL'),
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Dashboard Config Schema — Zod validator for DashboardConfigPanel data model.
|
|
276
|
+
*
|
|
277
|
+
* Validates the unified dashboard configuration used by create/edit workflows.
|
|
278
|
+
*/
|
|
279
|
+
export const DashboardConfigSchema = z.object({
|
|
280
|
+
id: z.string().optional().describe('Dashboard identifier'),
|
|
281
|
+
title: z.string().optional().describe('Dashboard title'),
|
|
282
|
+
description: z.string().optional().describe('Dashboard description'),
|
|
283
|
+
columns: z.number().min(1).max(24).optional().describe('Grid columns (1-24)'),
|
|
284
|
+
gap: z.number().min(0).optional().describe('Grid gap in pixels'),
|
|
285
|
+
refreshInterval: z.number().min(0).optional().describe('Auto-refresh interval in seconds'),
|
|
286
|
+
widgets: z.array(DashboardWidgetConfigSchema).optional().describe('Dashboard widgets'),
|
|
287
|
+
globalFilters: z.array(z.any()).optional().describe('Global filter conditions'),
|
|
288
|
+
dateRange: z.object({
|
|
289
|
+
enabled: z.boolean().optional(),
|
|
290
|
+
field: z.string().optional(),
|
|
291
|
+
presets: z.array(z.string()).optional(),
|
|
292
|
+
}).optional().describe('Date range filter'),
|
|
293
|
+
userFilters: z.array(z.object({
|
|
294
|
+
field: z.string(),
|
|
295
|
+
label: z.string().optional(),
|
|
296
|
+
type: z.string().optional(),
|
|
297
|
+
})).optional().describe('User-selectable filters'),
|
|
298
|
+
showHeader: z.boolean().optional().describe('Show dashboard header'),
|
|
299
|
+
showFilters: z.boolean().optional().describe('Show global filter bar'),
|
|
300
|
+
showDateRange: z.boolean().optional().describe('Show date range picker'),
|
|
301
|
+
headerActions: z.array(z.object({
|
|
302
|
+
label: z.string(),
|
|
303
|
+
action: z.string().optional(),
|
|
304
|
+
icon: z.string().optional(),
|
|
305
|
+
variant: z.string().optional(),
|
|
306
|
+
})).optional().describe('Header action buttons'),
|
|
307
|
+
aria: z.object({
|
|
308
|
+
label: z.string().optional(),
|
|
309
|
+
description: z.string().optional(),
|
|
310
|
+
}).optional().describe('ARIA accessibility attributes'),
|
|
311
|
+
});
|
|
312
|
+
|
|
254
313
|
/**
|
|
255
314
|
* Complex Schema Union - All complex component schemas
|
|
256
315
|
*/
|
|
@@ -147,6 +147,8 @@ export const DataTableSchema = BaseSchema.extend({
|
|
|
147
147
|
onRowDelete: z.function().optional().describe('Row delete handler'),
|
|
148
148
|
onSelectionChange: z.function().optional().describe('Selection change handler'),
|
|
149
149
|
onColumnsReorder: z.function().optional().describe('Column reorder handler'),
|
|
150
|
+
frozenColumns: z.number().optional().describe('Number of frozen columns'),
|
|
151
|
+
showRowNumbers: z.boolean().optional().describe('Show row numbers'),
|
|
150
152
|
});
|
|
151
153
|
|
|
152
154
|
/**
|
package/src/zod/index.zod.ts
CHANGED
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
export {
|
|
41
41
|
AppSchema,
|
|
42
42
|
AppActionSchema,
|
|
43
|
+
NavigationItemSchema,
|
|
44
|
+
NavigationItemTypeSchema,
|
|
45
|
+
NavigationAreaSchema,
|
|
43
46
|
MenuItemSchema as AppMenuItemSchema,
|
|
44
47
|
} from './app.zod.js';
|
|
45
48
|
|
|
@@ -227,6 +230,8 @@ export {
|
|
|
227
230
|
DashboardWidgetLayoutSchema,
|
|
228
231
|
DashboardWidgetSchema,
|
|
229
232
|
DashboardSchema,
|
|
233
|
+
DashboardWidgetConfigSchema,
|
|
234
|
+
DashboardConfigSchema,
|
|
230
235
|
ComplexSchema,
|
|
231
236
|
} from './complex.zod.js';
|
|
232
237
|
|
|
@@ -34,6 +34,20 @@ export const NavLinkSchema: z.ZodType<any> = z.lazy(() =>
|
|
|
34
34
|
})
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Breadcrumb Item Schema
|
|
39
|
+
*/
|
|
40
|
+
export const BreadcrumbItemSchema = z.object({
|
|
41
|
+
label: z.string().describe('Breadcrumb label'),
|
|
42
|
+
href: z.string().optional().describe('Link URL'),
|
|
43
|
+
icon: z.string().optional().describe('Breadcrumb icon'),
|
|
44
|
+
onClick: z.function().optional().describe('Click handler'),
|
|
45
|
+
siblings: z.array(z.object({
|
|
46
|
+
label: z.string().describe('Sibling label'),
|
|
47
|
+
href: z.string().describe('Sibling URL'),
|
|
48
|
+
})).optional().describe('Sibling items for dropdown navigation'),
|
|
49
|
+
});
|
|
50
|
+
|
|
37
51
|
/**
|
|
38
52
|
* Header Bar Schema - Header/navigation bar component
|
|
39
53
|
*/
|
|
@@ -42,6 +56,14 @@ export const HeaderBarSchema = BaseSchema.extend({
|
|
|
42
56
|
title: z.string().optional().describe('Header title'),
|
|
43
57
|
logo: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Logo content'),
|
|
44
58
|
nav: z.array(NavLinkSchema).optional().describe('Navigation links'),
|
|
59
|
+
crumbs: z.array(BreadcrumbItemSchema).optional().describe('Breadcrumb items'),
|
|
60
|
+
search: z.object({
|
|
61
|
+
enabled: z.boolean().describe('Whether search is enabled'),
|
|
62
|
+
placeholder: z.string().optional().describe('Search placeholder text'),
|
|
63
|
+
shortcut: z.string().optional().describe('Keyboard shortcut (e.g., "⌘K")'),
|
|
64
|
+
}).optional().describe('Search configuration'),
|
|
65
|
+
actions: z.array(SchemaNodeSchema).optional().describe('Right-side action slots'),
|
|
66
|
+
rightContent: SchemaNodeSchema.optional().describe('Custom right content area'),
|
|
45
67
|
left: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Left content'),
|
|
46
68
|
center: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Center content'),
|
|
47
69
|
right: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Right content'),
|
|
@@ -69,16 +91,6 @@ export const SidebarSchema = BaseSchema.extend({
|
|
|
69
91
|
variant: z.enum(['default', 'bordered', 'floating']).optional().describe('Sidebar variant'),
|
|
70
92
|
});
|
|
71
93
|
|
|
72
|
-
/**
|
|
73
|
-
* Breadcrumb Item Schema
|
|
74
|
-
*/
|
|
75
|
-
export const BreadcrumbItemSchema = z.object({
|
|
76
|
-
label: z.string().describe('Breadcrumb label'),
|
|
77
|
-
href: z.string().optional().describe('Link URL'),
|
|
78
|
-
icon: z.string().optional().describe('Breadcrumb icon'),
|
|
79
|
-
onClick: z.function().optional().describe('Click handler'),
|
|
80
|
-
});
|
|
81
|
-
|
|
82
94
|
/**
|
|
83
95
|
* Breadcrumb Schema - Breadcrumb navigation
|
|
84
96
|
*/
|