|
| 1 | +import { z } from 'zod'; |
| 2 | + |
| 3 | +import { ManifestSchema } from './manifest.zod'; |
| 4 | + |
| 5 | +// Data Protocol |
| 6 | +import { ObjectSchema } from '../data/object.zod'; |
| 7 | +import { FieldSchema } from '../data/field.zod'; |
| 8 | + |
| 9 | +// UI Protocol |
| 10 | +import { AppSchema } from '../ui/app.zod'; |
| 11 | +import { ViewSchema } from '../ui/view.zod'; |
| 12 | +import { PageSchema } from '../ui/page.zod'; |
| 13 | +import { DashboardSchema } from '../ui/dashboard.zod'; |
| 14 | + |
| 15 | +// Automation Protocol |
| 16 | +import { ApprovalProcessSchema } from '../automation/approval.zod'; |
| 17 | +import { WorkflowSchema } from '../automation/workflow.zod'; |
| 18 | + |
| 19 | +// Security Protocol (Future expansion) |
| 20 | +// import { RoleSchema } from '../auth/role.zod'; |
| 21 | + |
| 22 | +/** |
| 23 | + * ObjectStack Ecosystem Definition |
| 24 | + * |
| 25 | + * This schema represents the "Full Stack" definition of a project or environment. |
| 26 | + * It is used for: |
| 27 | + * 1. Project Export/Import (YAML/JSON dumps) |
| 28 | + * 2. IDE Validation (IntelliSense) |
| 29 | + * 3. Runtime Bootstrapping (In-memory loading) |
| 30 | + */ |
| 31 | +export const ObjectStackSchema = z.object({ |
| 32 | + /** System Configuration */ |
| 33 | + manifest: ManifestSchema.describe('Project Package Configuration'), |
| 34 | + |
| 35 | + /** |
| 36 | + * ObjectQL: Data Layer |
| 37 | + * All business objects and entities. |
| 38 | + */ |
| 39 | + objects: z.array(ObjectSchema).optional().describe('Business Objects definition'), |
| 40 | + |
| 41 | + /** |
| 42 | + * ObjectUI: User Interface Layer |
| 43 | + * Apps, Menus, Pages, and Visualizations. |
| 44 | + */ |
| 45 | + apps: z.array(AppSchema).optional().describe('Applications'), |
| 46 | + views: z.array(ViewSchema).optional().describe('List Views'), |
| 47 | + pages: z.array(PageSchema).optional().describe('Custom Pages'), |
| 48 | + dashboards: z.array(DashboardSchema).optional().describe('Dashboards'), |
| 49 | + |
| 50 | + /** |
| 51 | + * ObjectFlow: Automation Layer |
| 52 | + * Business logic, approvals, and workflows. |
| 53 | + */ |
| 54 | + workflows: z.array(WorkflowSchema).optional().describe('Event-driven workflows'), |
| 55 | + approvals: z.array(ApprovalProcessSchema).optional().describe('Approval processes'), |
| 56 | + |
| 57 | + /** |
| 58 | + * ObjectGuard: Security Layer |
| 59 | + */ |
| 60 | + // roles: z.array(RoleSchema).optional(), |
| 61 | +}); |
| 62 | + |
| 63 | +export type ObjectStack = z.infer<typeof ObjectStackSchema>; |
0 commit comments