@object-ui/types 0.3.1 → 0.5.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 +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 +174 -3
- package/dist/crud.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 +6 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/field-types.d.ts +353 -11
- package/dist/field-types.d.ts.map +1 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/objectql.d.ts +8 -1
- package/dist/objectql.d.ts.map +1 -1
- 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/theme.d.ts +289 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +8 -0
- package/dist/ui-action.d.ts +175 -0
- package/dist/ui-action.d.ts.map +1 -0
- package/dist/ui-action.js +8 -0
- package/dist/views.d.ts +417 -0
- package/dist/views.d.ts.map +1 -0
- package/dist/views.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.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.js +1 -1
- package/dist/zod/form.zod.js +1 -1
- package/dist/zod/index.zod.d.ts +1829 -18
- 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 +2 -2
- package/dist/zod/layout.zod.js +1 -1
- package/dist/zod/navigation.zod.js +1 -1
- package/dist/zod/objectql.zod.d.ts +10 -10
- package/dist/zod/objectql.zod.js +1 -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 +611 -0
- package/dist/zod/theme.zod.d.ts.map +1 -0
- package/dist/zod/theme.zod.js +130 -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 +2 -2
- package/src/__tests__/namespace-exports.test.ts +80 -0
- package/src/__tests__/phase2-schemas.test.ts +639 -0
- package/src/app.ts +12 -0
- package/src/blocks.ts +405 -0
- package/src/crud.ts +177 -3
- package/src/data-protocol.ts +1679 -0
- package/src/data.ts +3 -1
- package/src/field-types.ts +392 -11
- package/src/index.ts +214 -0
- package/src/objectql.ts +9 -1
- package/src/plugin-scope.ts +210 -0
- package/src/reports.ts +408 -0
- package/src/theme.ts +351 -0
- package/src/ui-action.ts +276 -0
- package/src/views.ts +429 -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 +167 -19
- package/src/zod/layout.zod.ts +1 -1
- package/src/zod/navigation.zod.ts +1 -1
- package/src/zod/objectql.zod.ts +1 -1
- package/src/zod/overlay.zod.ts +1 -1
- package/src/zod/reports.zod.ts +183 -0
- package/src/zod/theme.zod.ts +155 -0
- package/src/zod/views.zod.ts +182 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reports.zod.d.ts","sourceRoot":"","sources":["../../src/zod/reports.zod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;EAAmF,CAAC;AAEzH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;EAA8G,CAAC;AAEzJ;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;EAAgG,CAAC;AAEzI;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;iBAQ5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;iBAK7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;iBAI9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;iBAW/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;iBAOnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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CAAC,CAAC;AAC5D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC1E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
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
|
+
* @object-ui/types/zod - Report Schema Zod Validators
|
|
10
|
+
*
|
|
11
|
+
* Zod validation schemas for report configuration.
|
|
12
|
+
* Following @objectstack/spec UI specification format.
|
|
13
|
+
*
|
|
14
|
+
* @module zod/reports
|
|
15
|
+
* @packageDocumentation
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
|
|
19
|
+
import { ChartSchema } from './data-display.zod.js';
|
|
20
|
+
/**
|
|
21
|
+
* Report Export Format Schema
|
|
22
|
+
*/
|
|
23
|
+
export const ReportExportFormatSchema = z.enum(['pdf', 'excel', 'csv', 'json', 'html']).describe('Report export format');
|
|
24
|
+
/**
|
|
25
|
+
* Report Schedule Frequency Schema
|
|
26
|
+
*/
|
|
27
|
+
export const ReportScheduleFrequencySchema = z.enum(['once', 'daily', 'weekly', 'monthly', 'quarterly', 'yearly']).describe('Report schedule frequency');
|
|
28
|
+
/**
|
|
29
|
+
* Report Aggregation Type Schema
|
|
30
|
+
*/
|
|
31
|
+
export const ReportAggregationTypeSchema = z.enum(['sum', 'avg', 'min', 'max', 'count', 'distinct']).describe('Report aggregation type');
|
|
32
|
+
/**
|
|
33
|
+
* Report Field Schema
|
|
34
|
+
*/
|
|
35
|
+
export const ReportFieldSchema = z.object({
|
|
36
|
+
name: z.string().describe('Field name/identifier'),
|
|
37
|
+
label: z.string().optional().describe('Display label'),
|
|
38
|
+
type: z.enum(['string', 'number', 'date', 'boolean']).optional().describe('Field type'),
|
|
39
|
+
aggregation: ReportAggregationTypeSchema.optional().describe('Aggregation function'),
|
|
40
|
+
format: z.string().optional().describe('Format string'),
|
|
41
|
+
showInSummary: z.boolean().optional().describe('Show in summary'),
|
|
42
|
+
sortOrder: z.number().optional().describe('Sort order'),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Report Filter Schema
|
|
46
|
+
*/
|
|
47
|
+
export const ReportFilterSchema = z.object({
|
|
48
|
+
field: z.string().describe('Field to filter on'),
|
|
49
|
+
operator: z.enum(['equals', 'not_equals', 'contains', 'greater_than', 'less_than', 'between', 'in', 'not_in']).describe('Filter operator'),
|
|
50
|
+
value: z.any().optional().describe('Filter value'),
|
|
51
|
+
values: z.array(z.any()).optional().describe('Multiple values (for "in" operator)'),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Report Group By Schema
|
|
55
|
+
*/
|
|
56
|
+
export const ReportGroupBySchema = z.object({
|
|
57
|
+
field: z.string().describe('Field to group by'),
|
|
58
|
+
label: z.string().optional().describe('Display label'),
|
|
59
|
+
sort: z.enum(['asc', 'desc']).optional().describe('Sort direction'),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Report Section Schema
|
|
63
|
+
*/
|
|
64
|
+
export const ReportSectionSchema = z.object({
|
|
65
|
+
type: z.enum(['header', 'summary', 'chart', 'table', 'text', 'page-break']).describe('Section type'),
|
|
66
|
+
title: z.string().optional().describe('Section title'),
|
|
67
|
+
content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Section content'),
|
|
68
|
+
chart: ChartSchema.optional().describe('Chart configuration (for type="chart")'),
|
|
69
|
+
columns: z.array(ReportFieldSchema).optional().describe('Columns to display (for type="table")'),
|
|
70
|
+
text: z.string().optional().describe('Text content (for type="text")'),
|
|
71
|
+
visible: z.union([z.boolean(), z.string()]).optional().describe('Visibility condition'),
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Report Schedule Schema
|
|
75
|
+
*/
|
|
76
|
+
export const ReportScheduleSchema = z.object({
|
|
77
|
+
enabled: z.boolean().optional().describe('Schedule enabled'),
|
|
78
|
+
frequency: ReportScheduleFrequencySchema.optional().describe('Frequency'),
|
|
79
|
+
dayOfWeek: z.number().optional().describe('Specific day of week (for weekly)'),
|
|
80
|
+
dayOfMonth: z.number().optional().describe('Specific day of month (for monthly)'),
|
|
81
|
+
time: z.string().optional().describe('Time to run (HH:mm format)'),
|
|
82
|
+
timezone: z.string().optional().describe('Timezone'),
|
|
83
|
+
recipients: z.array(z.string()).optional().describe('Email recipients'),
|
|
84
|
+
subject: z.string().optional().describe('Email subject'),
|
|
85
|
+
body: z.string().optional().describe('Email body'),
|
|
86
|
+
formats: z.array(ReportExportFormatSchema).optional().describe('Export formats to attach'),
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* Report Export Config Schema
|
|
90
|
+
*/
|
|
91
|
+
export const ReportExportConfigSchema = z.object({
|
|
92
|
+
format: ReportExportFormatSchema.describe('Export format'),
|
|
93
|
+
filename: z.string().optional().describe('Filename template'),
|
|
94
|
+
includeHeaders: z.boolean().optional().describe('Include headers'),
|
|
95
|
+
orientation: z.enum(['portrait', 'landscape']).optional().describe('Page orientation (for PDF)'),
|
|
96
|
+
pageSize: z.enum(['A4', 'A3', 'Letter', 'Legal']).optional().describe('Page size (for PDF)'),
|
|
97
|
+
options: z.record(z.string(), z.any()).optional().describe('Custom options'),
|
|
98
|
+
});
|
|
99
|
+
/**
|
|
100
|
+
* Report Schema
|
|
101
|
+
*/
|
|
102
|
+
export const ReportSchema = BaseSchema.extend({
|
|
103
|
+
type: z.literal('report'),
|
|
104
|
+
title: z.string().optional().describe('Report title'),
|
|
105
|
+
description: z.string().optional().describe('Report description'),
|
|
106
|
+
dataSource: z.any().optional().describe('Data source configuration'),
|
|
107
|
+
fields: z.array(ReportFieldSchema).optional().describe('Report fields'),
|
|
108
|
+
filters: z.array(ReportFilterSchema).optional().describe('Report filters'),
|
|
109
|
+
groupBy: z.array(ReportGroupBySchema).optional().describe('Group by configuration'),
|
|
110
|
+
sections: z.array(ReportSectionSchema).optional().describe('Report sections'),
|
|
111
|
+
schedule: ReportScheduleSchema.optional().describe('Schedule configuration'),
|
|
112
|
+
defaultExportFormat: ReportExportFormatSchema.optional().describe('Default export format'),
|
|
113
|
+
exportConfigs: z.record(z.string(), ReportExportConfigSchema).optional().describe('Export configurations'),
|
|
114
|
+
showExportButtons: z.boolean().optional().describe('Show export buttons'),
|
|
115
|
+
showPrintButton: z.boolean().optional().describe('Show print button'),
|
|
116
|
+
showScheduleButton: z.boolean().optional().describe('Show schedule button'),
|
|
117
|
+
refreshInterval: z.number().optional().describe('Auto-refresh interval (in seconds)'),
|
|
118
|
+
loading: z.boolean().optional().describe('Loading state'),
|
|
119
|
+
data: z.array(z.any()).optional().describe('Report data'),
|
|
120
|
+
});
|
|
121
|
+
/**
|
|
122
|
+
* Report Builder Schema
|
|
123
|
+
*/
|
|
124
|
+
export const ReportBuilderSchema = BaseSchema.extend({
|
|
125
|
+
type: z.literal('report-builder'),
|
|
126
|
+
report: ReportSchema.optional().describe('Initial report configuration'),
|
|
127
|
+
dataSources: z.array(z.any()).optional().describe('Available data sources'),
|
|
128
|
+
availableFields: z.array(ReportFieldSchema).optional().describe('Available fields'),
|
|
129
|
+
showPreview: z.boolean().optional().describe('Show preview'),
|
|
130
|
+
onSave: z.string().optional().describe('Save callback'),
|
|
131
|
+
onCancel: z.string().optional().describe('Cancel callback'),
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Report Viewer Schema
|
|
135
|
+
*/
|
|
136
|
+
export const ReportViewerSchema = BaseSchema.extend({
|
|
137
|
+
type: z.literal('report-viewer'),
|
|
138
|
+
report: ReportSchema.optional().describe('Report to display'),
|
|
139
|
+
data: z.array(z.any()).optional().describe('Report data'),
|
|
140
|
+
showToolbar: z.boolean().optional().describe('Show toolbar'),
|
|
141
|
+
allowExport: z.boolean().optional().describe('Allow export'),
|
|
142
|
+
allowPrint: z.boolean().optional().describe('Allow print'),
|
|
143
|
+
loading: z.boolean().optional().describe('Loading state'),
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Union of all report schemas
|
|
147
|
+
*/
|
|
148
|
+
export const ReportComponentSchema = z.union([
|
|
149
|
+
ReportSchema,
|
|
150
|
+
ReportBuilderSchema,
|
|
151
|
+
ReportViewerSchema,
|
|
152
|
+
]);
|