@acorex-platform/module-report-management-server 0.0.15
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/contracts/src/entities/index.d.ts +2 -0
- package/contracts/src/entities/index.js +6 -0
- package/contracts/src/entities/index.js.map +1 -0
- package/contracts/src/entities/report/index.d.ts +1 -0
- package/contracts/src/entities/report/index.js +5 -0
- package/contracts/src/entities/report/index.js.map +1 -0
- package/contracts/src/entities/report/report.entity.d.ts +2 -0
- package/contracts/src/entities/report/report.entity.js +83 -0
- package/contracts/src/entities/report/report.entity.js.map +1 -0
- package/contracts/src/entities/report-category/index.d.ts +1 -0
- package/contracts/src/entities/report-category/index.js +5 -0
- package/contracts/src/entities/report-category/index.js.map +1 -0
- package/contracts/src/entities/report-category/report-category.entity.d.ts +2 -0
- package/contracts/src/entities/report-category/report-category.entity.js +72 -0
- package/contracts/src/entities/report-category/report-category.entity.js.map +1 -0
- package/contracts/src/features.keys.d.ts +6 -0
- package/contracts/src/features.keys.js +10 -0
- package/contracts/src/features.keys.js.map +1 -0
- package/contracts/src/index.d.ts +6 -0
- package/contracts/src/index.js +12 -0
- package/contracts/src/index.js.map +1 -0
- package/contracts/src/menu.keys.d.ts +6 -0
- package/contracts/src/menu.keys.js +10 -0
- package/contracts/src/menu.keys.js.map +1 -0
- package/contracts/src/permission.keys.d.ts +19 -0
- package/contracts/src/permission.keys.js +23 -0
- package/contracts/src/permission.keys.js.map +1 -0
- package/contracts/src/report.types.d.ts +477 -0
- package/contracts/src/report.types.js +5 -0
- package/contracts/src/report.types.js.map +1 -0
- package/contracts/src/root-config.d.ts +34 -0
- package/contracts/src/root-config.js +39 -0
- package/contracts/src/root-config.js.map +1 -0
- package/package.json +27 -0
- package/server/src/index.d.ts +8 -0
- package/server/src/index.js +16 -0
- package/server/src/index.js.map +1 -0
- package/server/src/lib/report-browse.service.d.ts +13 -0
- package/server/src/lib/report-browse.service.js +128 -0
- package/server/src/lib/report-browse.service.js.map +1 -0
- package/server/src/lib/report-browse.types.d.ts +69 -0
- package/server/src/lib/report-browse.types.js +5 -0
- package/server/src/lib/report-browse.types.js.map +1 -0
- package/server/src/lib/report-management-server.module.d.ts +2 -0
- package/server/src/lib/report-management-server.module.js +30 -0
- package/server/src/lib/report-management-server.module.js.map +1 -0
- package/server/src/lib/report-management.controller.d.ts +11 -0
- package/server/src/lib/report-management.controller.js +74 -0
- package/server/src/lib/report-management.controller.js.map +1 -0
- package/server/src/lib/seed/index.d.ts +19 -0
- package/server/src/lib/seed/index.js +21 -0
- package/server/src/lib/seed/index.js.map +1 -0
- package/server/src/lib/seed/report-management-seed.provider.d.ts +4 -0
- package/server/src/lib/seed/report-management-seed.provider.js +18 -0
- package/server/src/lib/seed/report-management-seed.provider.js.map +1 -0
- package/server/src/lib/seed/report-management-seed.tokens.d.ts +1 -0
- package/server/src/lib/seed/report-management-seed.tokens.js +7 -0
- package/server/src/lib/seed/report-management-seed.tokens.js.map +1 -0
- package/server/src/lib/seed/report-management.seed-catalog.d.ts +2 -0
- package/server/src/lib/seed/report-management.seed-catalog.js +10 -0
- package/server/src/lib/seed/report-management.seed-catalog.js.map +1 -0
- package/server/src/lib/seed/samples/employee-report.mock.d.ts +9 -0
- package/server/src/lib/seed/samples/employee-report.mock.js +322 -0
- package/server/src/lib/seed/samples/employee-report.mock.js.map +1 -0
- package/server/src/lib/seed/samples/index.d.ts +2 -0
- package/server/src/lib/seed/samples/index.js +6 -0
- package/server/src/lib/seed/samples/index.js.map +1 -0
- package/server/src/lib/seed/samples/location-report.mock.d.ts +9 -0
- package/server/src/lib/seed/samples/location-report.mock.js +339 -0
- package/server/src/lib/seed/samples/location-report.mock.js.map +1 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { AXPWidgetColumnNode } from '@acorex-platform/framework-shared/widget-core';
|
|
2
|
+
import { AXPCommand } from '@acorex-platform/framework-shared/runtime';
|
|
3
|
+
import { AXPQuerySort } from '@acorex-platform/framework-shared/entity';
|
|
4
|
+
import { AXPActionMenuItem, AXPCategoryEntity, AXPExportOptions, AXPFilterClause, AXPSystemActionType, type AXPWidgetNode } from '@acorex-platform/framework-shared/core';
|
|
5
|
+
export type AXPReportLayoutType = 'table' | 'chart' | 'cards' | 'custom' | 'pdf';
|
|
6
|
+
/**
|
|
7
|
+
* Report Category - Extends AXPCategoryEntity for consistency and performance
|
|
8
|
+
*
|
|
9
|
+
* Inherited properties from AXPCategoryEntity:
|
|
10
|
+
* - id: string - Unique identifier
|
|
11
|
+
* - title: string - Display name
|
|
12
|
+
* - description?: string - Category description
|
|
13
|
+
* - parentId?: string - Parent category ID
|
|
14
|
+
* - childrenCount: number - Direct child categories count (enables lazy loading)
|
|
15
|
+
* - itemsCount?: number - Direct reports count (replaces hasReport boolean)
|
|
16
|
+
* - totalChildrenCount?: number - Total nested categories (optional, for analytics)
|
|
17
|
+
* - totalItemsCount?: number - Total reports in tree (optional, for analytics)
|
|
18
|
+
*
|
|
19
|
+
* Performance benefits:
|
|
20
|
+
* - Lazy loading support (childrenCount > 0 shows expand icon)
|
|
21
|
+
* - Report count display (itemsCount shows "5 reports" badge)
|
|
22
|
+
* - Efficient queries (no need to query to know if expandable)
|
|
23
|
+
*/
|
|
24
|
+
export interface AXPReportCategory extends AXPCategoryEntity {
|
|
25
|
+
}
|
|
26
|
+
export interface AXPReportDefinition {
|
|
27
|
+
id: string;
|
|
28
|
+
title: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
categoryIds: string[];
|
|
31
|
+
parameterGroups: AXPReportParameterGroup[];
|
|
32
|
+
permissions?: string[];
|
|
33
|
+
layouts: AXPReportLayoutDefinition[];
|
|
34
|
+
defaultLayoutId: string;
|
|
35
|
+
}
|
|
36
|
+
export type AXPReportLayoutAction = AXPActionMenuItem & {
|
|
37
|
+
priority: 'primary' | 'secondary';
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Layout Definition - Associates a layout with metadata
|
|
41
|
+
*/
|
|
42
|
+
export interface AXPReportLayoutDefinition {
|
|
43
|
+
id: string;
|
|
44
|
+
title: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
icon?: string;
|
|
47
|
+
layout: AXPReportLayout;
|
|
48
|
+
dataSource?: AXPReportDataSource;
|
|
49
|
+
isDefault?: boolean;
|
|
50
|
+
actions?: AXPReportLayoutAction[];
|
|
51
|
+
export?: AXPExportOptions;
|
|
52
|
+
}
|
|
53
|
+
export interface AXPReportParameterGroup {
|
|
54
|
+
name: string;
|
|
55
|
+
title: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
parameters: AXPReportParameter[];
|
|
58
|
+
}
|
|
59
|
+
export interface AXPReportParameter {
|
|
60
|
+
path: string;
|
|
61
|
+
title: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
widget: AXPWidgetNode;
|
|
64
|
+
}
|
|
65
|
+
export type AXPReportDataSource = AXPQueryDataSource | AXPCustomDataSource | AXPAggregatedDataSource | AXPTransformedDataSource;
|
|
66
|
+
/**
|
|
67
|
+
* Query Data Source - Used for executing predefined queries (AXPQuery)
|
|
68
|
+
*/
|
|
69
|
+
export interface AXPQueryDataSource {
|
|
70
|
+
type: 'query';
|
|
71
|
+
name: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
inputs?: AXPReportParameterBinding[];
|
|
74
|
+
sortFields?: AXPQuerySort[];
|
|
75
|
+
pagination?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Custom Data Source - Used for fetching data from custom providers like REST APIs or external services
|
|
79
|
+
*/
|
|
80
|
+
export interface AXPCustomDataSource {
|
|
81
|
+
type: 'custom';
|
|
82
|
+
provider: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
inputs?: AXPReportParameterBinding[];
|
|
85
|
+
options?: {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Parameter Binding - Maps report-level parameters to actual query/command input structure
|
|
91
|
+
*/
|
|
92
|
+
export interface AXPReportParameterBinding {
|
|
93
|
+
parameterKey: string;
|
|
94
|
+
bindTo: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Aggregated Data Source - Used for pre-aggregated data optimized for charts
|
|
98
|
+
*/
|
|
99
|
+
export interface AXPAggregatedDataSource {
|
|
100
|
+
type: 'aggregated';
|
|
101
|
+
baseQuery: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
groupBy: string[];
|
|
104
|
+
aggregations: AXPAggregation[];
|
|
105
|
+
inputs?: AXPReportParameterBinding[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Transformed Data Source - Applies transformations to existing data sources
|
|
109
|
+
*/
|
|
110
|
+
export interface AXPTransformedDataSource {
|
|
111
|
+
type: 'transformed';
|
|
112
|
+
baseDataSource: AXPReportDataSource;
|
|
113
|
+
description?: string;
|
|
114
|
+
transformations: AXPDataTransformation[];
|
|
115
|
+
inputs?: AXPReportParameterBinding[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Aggregation operation for aggregated data sources
|
|
119
|
+
*/
|
|
120
|
+
export interface AXPAggregation {
|
|
121
|
+
field: string;
|
|
122
|
+
operation: 'sum' | 'avg' | 'count' | 'min' | 'max' | 'distinct';
|
|
123
|
+
alias?: string;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Data transformation operation
|
|
127
|
+
*/
|
|
128
|
+
export interface AXPDataTransformation {
|
|
129
|
+
type: 'filter' | 'sort' | 'group' | 'pivot' | 'format';
|
|
130
|
+
config: Record<string, any>;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Drill-down target for a grouped report row.
|
|
134
|
+
* When reportId is omitted, the current report is used.
|
|
135
|
+
*/
|
|
136
|
+
export interface AXPReportDrillDownConfig {
|
|
137
|
+
reportId?: string;
|
|
138
|
+
layoutId?: string;
|
|
139
|
+
title?: string;
|
|
140
|
+
parameters?: Record<string, string>;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Declares how a summary report is grouped and which detail view opens on drill-down.
|
|
144
|
+
* Multiple definitions allow alternative drill paths (e.g. by brand vs by category).
|
|
145
|
+
*/
|
|
146
|
+
export interface AXPReportGroupByDefinition {
|
|
147
|
+
fields: string[];
|
|
148
|
+
displayField?: string;
|
|
149
|
+
/** When true (default), `displayField` renders as a link instead of a row command column. */
|
|
150
|
+
linkDisplay?: boolean;
|
|
151
|
+
title?: string;
|
|
152
|
+
default?: boolean;
|
|
153
|
+
priority?: 'primary' | 'secondary';
|
|
154
|
+
drillDown: AXPReportDrillDownConfig;
|
|
155
|
+
}
|
|
156
|
+
export type AXPReportLayout = AXPReportTableLayout | AXPReportChartLayout | AXPReportPdfLayout;
|
|
157
|
+
/**
|
|
158
|
+
* Table Layout - Displays data in tabular format
|
|
159
|
+
*/
|
|
160
|
+
export interface AXPReportTableLayoutRowAction extends AXPActionMenuItem {
|
|
161
|
+
priority: 'primary' | 'secondary';
|
|
162
|
+
type: AXPSystemActionType | string;
|
|
163
|
+
default?: boolean;
|
|
164
|
+
}
|
|
165
|
+
export interface AXPReportTableLayout {
|
|
166
|
+
type: 'table';
|
|
167
|
+
columns: AXPReportColumn[];
|
|
168
|
+
actions?: AXPReportTableLayoutRowAction[];
|
|
169
|
+
options?: AXPTableOptions;
|
|
170
|
+
groupBy?: AXPReportGroupByDefinition[];
|
|
171
|
+
conditionalFormatting?: AXPConditionalFormatRule[];
|
|
172
|
+
summary?: AXPReportSummaryOptions[];
|
|
173
|
+
header?: AXPReportHeaderFooter;
|
|
174
|
+
footer?: AXPReportHeaderFooter;
|
|
175
|
+
}
|
|
176
|
+
export interface AXPTableOptions {
|
|
177
|
+
pagination?: boolean;
|
|
178
|
+
stickyHeader?: boolean;
|
|
179
|
+
stripedRows?: boolean;
|
|
180
|
+
sorting?: AXPQuerySort[];
|
|
181
|
+
selectable?: {
|
|
182
|
+
mode: 'single' | 'multiple' | 'none';
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Chart Layout - Displays data in various chart formats
|
|
187
|
+
*/
|
|
188
|
+
export interface AXPReportChartLayout {
|
|
189
|
+
type: 'chart';
|
|
190
|
+
options: AXPReportChartOptions;
|
|
191
|
+
header?: AXPReportHeaderFooter;
|
|
192
|
+
footer?: AXPReportHeaderFooter;
|
|
193
|
+
}
|
|
194
|
+
export interface AXPReportChartOptions {
|
|
195
|
+
chartType: 'bar' | 'line' | 'pie' | 'doughnut' | 'area' | 'scatter' | 'radar' | 'mixed';
|
|
196
|
+
dataMapping: AXPChartDataMapping;
|
|
197
|
+
styling?: AXPChartStyling;
|
|
198
|
+
interactivity?: AXPChartInteractivity;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Chart Data Mapping Configuration
|
|
202
|
+
*/
|
|
203
|
+
export interface AXPChartDataMapping {
|
|
204
|
+
xField: string;
|
|
205
|
+
yFields: string | string[];
|
|
206
|
+
groupBy?: string;
|
|
207
|
+
seriesField?: string;
|
|
208
|
+
sizeField?: string;
|
|
209
|
+
colorField?: string;
|
|
210
|
+
labelField?: string;
|
|
211
|
+
aggregation?: {
|
|
212
|
+
method: 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
213
|
+
field: string;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Chart Visual Styling Configuration
|
|
218
|
+
*/
|
|
219
|
+
export interface AXPChartStyling {
|
|
220
|
+
colorScheme?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'custom';
|
|
221
|
+
customColors?: string[];
|
|
222
|
+
gridLines?: boolean;
|
|
223
|
+
legend?: {
|
|
224
|
+
show: boolean;
|
|
225
|
+
position: 'top' | 'bottom' | 'left' | 'right';
|
|
226
|
+
};
|
|
227
|
+
xAxis?: AXPChartAxisConfig;
|
|
228
|
+
yAxis?: AXPChartAxisConfig;
|
|
229
|
+
animation?: {
|
|
230
|
+
enabled: boolean;
|
|
231
|
+
duration?: number;
|
|
232
|
+
};
|
|
233
|
+
chartSpecific?: {
|
|
234
|
+
bar?: {
|
|
235
|
+
orientation: 'vertical' | 'horizontal';
|
|
236
|
+
mode: 'grouped' | 'stacked';
|
|
237
|
+
barWidth?: number;
|
|
238
|
+
};
|
|
239
|
+
line?: {
|
|
240
|
+
style: 'straight' | 'curved' | 'stepped';
|
|
241
|
+
showPoints?: boolean;
|
|
242
|
+
tension?: number;
|
|
243
|
+
};
|
|
244
|
+
area?: {
|
|
245
|
+
mode: 'normal' | 'stacked' | 'percentage';
|
|
246
|
+
opacity?: number;
|
|
247
|
+
};
|
|
248
|
+
pie?: {
|
|
249
|
+
startAngle?: number;
|
|
250
|
+
innerRadius?: number;
|
|
251
|
+
showLabels?: boolean;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Chart Axis Configuration
|
|
257
|
+
*/
|
|
258
|
+
export interface AXPChartAxisConfig {
|
|
259
|
+
title?: string;
|
|
260
|
+
show?: boolean;
|
|
261
|
+
type?: 'linear' | 'logarithmic' | 'datetime' | 'category';
|
|
262
|
+
min?: number | string;
|
|
263
|
+
max?: number | string;
|
|
264
|
+
format?: string;
|
|
265
|
+
gridLines?: boolean;
|
|
266
|
+
tickInterval?: number;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Chart Interactivity Configuration
|
|
270
|
+
*/
|
|
271
|
+
export interface AXPChartInteractivity {
|
|
272
|
+
zoom?: {
|
|
273
|
+
enabled: boolean;
|
|
274
|
+
mode?: 'x' | 'y' | 'xy';
|
|
275
|
+
};
|
|
276
|
+
tooltips?: {
|
|
277
|
+
enabled: boolean;
|
|
278
|
+
format?: string;
|
|
279
|
+
showOnHover?: boolean;
|
|
280
|
+
};
|
|
281
|
+
onClick?: {
|
|
282
|
+
enabled: boolean;
|
|
283
|
+
action?: 'drill-down' | 'filter' | 'custom';
|
|
284
|
+
};
|
|
285
|
+
selection?: {
|
|
286
|
+
enabled: boolean;
|
|
287
|
+
mode?: 'single' | 'multiple';
|
|
288
|
+
};
|
|
289
|
+
export?: {
|
|
290
|
+
enabled: boolean;
|
|
291
|
+
formats?: ('png' | 'jpg' | 'pdf' | 'svg')[];
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* PDF Layout - Displays PDF documents
|
|
296
|
+
*/
|
|
297
|
+
export interface AXPReportPdfLayout {
|
|
298
|
+
type: 'pdf';
|
|
299
|
+
options?: AXPReportPdfOptions;
|
|
300
|
+
header?: AXPReportHeaderFooter;
|
|
301
|
+
footer?: AXPReportHeaderFooter;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* PDF Layout Options
|
|
305
|
+
*/
|
|
306
|
+
export interface AXPReportPdfOptions {
|
|
307
|
+
showDownloadButton?: boolean;
|
|
308
|
+
showPrintButton?: boolean;
|
|
309
|
+
showZoomControls?: boolean;
|
|
310
|
+
showFullscreenButton?: boolean;
|
|
311
|
+
defaultZoom?: number;
|
|
312
|
+
height?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface AXPReportColumn {
|
|
315
|
+
field: string;
|
|
316
|
+
title?: string;
|
|
317
|
+
visible?: boolean;
|
|
318
|
+
width?: number | 'auto';
|
|
319
|
+
align?: 'left' | 'center' | 'right';
|
|
320
|
+
/** When true, column header supports interactive sort (opt-in). */
|
|
321
|
+
sortable?: boolean;
|
|
322
|
+
/** Pin column to the start or end of the table (definition-only). */
|
|
323
|
+
pin?: 'start' | 'end';
|
|
324
|
+
widget?: AXPWidgetColumnNode;
|
|
325
|
+
/**
|
|
326
|
+
* Optional cell interactivity. When omitted, group-by `displayField` columns
|
|
327
|
+
* can still render as drill links automatically in report table view.
|
|
328
|
+
*/
|
|
329
|
+
interactivity?: AXPReportColumnInteractivity;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Column cell interaction — link triggers a command with the current row as context.
|
|
333
|
+
* Platform widgets may mirror this via column `options.displayAs: 'link'` in the future.
|
|
334
|
+
*/
|
|
335
|
+
export interface AXPReportColumnInteractivity {
|
|
336
|
+
type: 'link';
|
|
337
|
+
command: {
|
|
338
|
+
name: string;
|
|
339
|
+
options?: Record<string, unknown>;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/** Server-computed report footer totals keyed by column field. */
|
|
343
|
+
export type AXPReportTableSummaryResult = Record<string, number | null>;
|
|
344
|
+
export interface AXPReportSummaryOptions {
|
|
345
|
+
field: string;
|
|
346
|
+
operation: 'sum' | 'avg' | 'count' | 'min' | 'max';
|
|
347
|
+
displayIn: 'groupFooter' | 'reportFooter';
|
|
348
|
+
}
|
|
349
|
+
export interface AXPConditionalFormatRule {
|
|
350
|
+
field: string;
|
|
351
|
+
condition: '>' | '<' | '=' | '!=' | 'contains';
|
|
352
|
+
value: any;
|
|
353
|
+
style: {
|
|
354
|
+
color?: string;
|
|
355
|
+
backgroundColor?: string;
|
|
356
|
+
fontWeight?: 'normal' | 'bold';
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
export interface AXPReportHeaderFooter {
|
|
360
|
+
title?: string;
|
|
361
|
+
logoUrl?: string;
|
|
362
|
+
showDate?: boolean;
|
|
363
|
+
showParameters?: boolean;
|
|
364
|
+
customHtml?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Layout switcher options for UI components
|
|
368
|
+
*/
|
|
369
|
+
export interface AXPLayoutSwitcherOption {
|
|
370
|
+
id: string;
|
|
371
|
+
title: string;
|
|
372
|
+
icon?: string;
|
|
373
|
+
type: AXPReportLayoutType;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Runtime layout selection state
|
|
377
|
+
*/
|
|
378
|
+
export interface AXPReportLayoutState {
|
|
379
|
+
reportId: string;
|
|
380
|
+
activeLayoutId: string;
|
|
381
|
+
availableLayouts: AXPLayoutSwitcherOption[];
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Layout validation result
|
|
385
|
+
*/
|
|
386
|
+
export interface AXPLayoutValidationResult {
|
|
387
|
+
isValid: boolean;
|
|
388
|
+
errors: string[];
|
|
389
|
+
layoutId: string;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Data source resolution result for a specific layout
|
|
393
|
+
*/
|
|
394
|
+
export interface AXPLayoutDataSourceResolution {
|
|
395
|
+
layoutId: string;
|
|
396
|
+
dataSource: AXPReportDataSource;
|
|
397
|
+
source: 'layout' | 'report' | 'none';
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Layout execution context with resolved data source
|
|
401
|
+
*/
|
|
402
|
+
export interface AXPLayoutExecutionContext {
|
|
403
|
+
reportId: string;
|
|
404
|
+
layoutId: string;
|
|
405
|
+
dataSource: AXPReportDataSource;
|
|
406
|
+
filters: AXPFilterClause;
|
|
407
|
+
skip?: number;
|
|
408
|
+
take?: number;
|
|
409
|
+
/** Runtime/user sort — platform shape `{ name, dir }`. */
|
|
410
|
+
sort?: AXPQuerySort[];
|
|
411
|
+
}
|
|
412
|
+
export type AXPExecutionReportResult = {
|
|
413
|
+
type: 'table';
|
|
414
|
+
items: Record<string, unknown>[];
|
|
415
|
+
total: number;
|
|
416
|
+
summary?: AXPReportTableSummaryResult;
|
|
417
|
+
} | {
|
|
418
|
+
type: 'chart';
|
|
419
|
+
data: Record<string, unknown>;
|
|
420
|
+
} | {
|
|
421
|
+
type: 'cards';
|
|
422
|
+
items: Record<string, unknown>[];
|
|
423
|
+
} | {
|
|
424
|
+
type: 'custom';
|
|
425
|
+
data: unknown;
|
|
426
|
+
} | {
|
|
427
|
+
type: 'pdf';
|
|
428
|
+
url?: string;
|
|
429
|
+
base64?: string;
|
|
430
|
+
blob?: Blob;
|
|
431
|
+
filename?: string;
|
|
432
|
+
};
|
|
433
|
+
export type AXPExecutionReportCommandResult = AXPReportLayout & {
|
|
434
|
+
data: AXPExecutionReportResult;
|
|
435
|
+
};
|
|
436
|
+
export interface AXPExecutionReportCommand extends AXPCommand<AXPLayoutExecutionContext, AXPExecutionReportCommandResult> {
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Report execution status and metadata
|
|
440
|
+
*/
|
|
441
|
+
export interface AXPReportExecutionStatus {
|
|
442
|
+
reportId: string;
|
|
443
|
+
layoutId: string;
|
|
444
|
+
status: 'pending' | 'executing' | 'completed' | 'failed' | 'cancelled';
|
|
445
|
+
startTime: Date;
|
|
446
|
+
endTime?: Date;
|
|
447
|
+
duration?: number;
|
|
448
|
+
recordCount?: number;
|
|
449
|
+
error?: AXPReportExecutionError;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Detailed error information for report execution
|
|
453
|
+
*/
|
|
454
|
+
export interface AXPReportExecutionError {
|
|
455
|
+
code: string;
|
|
456
|
+
message: string;
|
|
457
|
+
details?: Record<string, unknown>;
|
|
458
|
+
stack?: string;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Report execution request with options
|
|
462
|
+
*/
|
|
463
|
+
export interface AXPReportExecutionRequest {
|
|
464
|
+
reportId: string;
|
|
465
|
+
layoutId: string;
|
|
466
|
+
parameters: Record<string, unknown>;
|
|
467
|
+
options?: AXPReportExecutionOptions;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Options for report execution
|
|
471
|
+
*/
|
|
472
|
+
export interface AXPReportExecutionOptions {
|
|
473
|
+
timeout?: number;
|
|
474
|
+
priority?: 'low' | 'normal' | 'high';
|
|
475
|
+
cache?: boolean;
|
|
476
|
+
cacheTimeout?: number;
|
|
477
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.types.js","sourceRoot":"","sources":["../../../../../libs/modules/report-management/contracts/src/report.types.ts"],"names":[],"mappings":";AAAA,+BAA+B;;AA4jB/B,YAAY"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const RootConfig: {
|
|
2
|
+
readonly config: {
|
|
3
|
+
i18n: string;
|
|
4
|
+
module: string;
|
|
5
|
+
};
|
|
6
|
+
readonly module: {
|
|
7
|
+
readonly route: "report-management";
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly title: `@${string}:module.title`;
|
|
10
|
+
readonly icon: "fa-light fa-chart-bar";
|
|
11
|
+
};
|
|
12
|
+
readonly entities: {
|
|
13
|
+
readonly dataSet: {
|
|
14
|
+
readonly name: "DataSet";
|
|
15
|
+
readonly title: `t("dataSet", { scope: "${string}" })`;
|
|
16
|
+
readonly titlePlural: `t("dataSetPlural", { scope: "${string}" })`;
|
|
17
|
+
readonly icon: "fa-light fa-default";
|
|
18
|
+
};
|
|
19
|
+
readonly category: {
|
|
20
|
+
readonly name: "Category";
|
|
21
|
+
readonly fullName: `${string}.Category`;
|
|
22
|
+
readonly title: `@${string}:reports.entities.category.title`;
|
|
23
|
+
readonly titlePlural: `@${string}:reports.entities.category.plural`;
|
|
24
|
+
readonly icon: "fa-light fa-folder";
|
|
25
|
+
};
|
|
26
|
+
readonly report: {
|
|
27
|
+
readonly name: "Report";
|
|
28
|
+
readonly fullName: `${string}.Report`;
|
|
29
|
+
readonly title: `@${string}:reports.entities.report.title`;
|
|
30
|
+
readonly titlePlural: `@${string}:reports.entities.report.plural`;
|
|
31
|
+
readonly icon: "fa-light fa-file-chart-pie";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RootConfig = void 0;
|
|
4
|
+
const config = {
|
|
5
|
+
i18n: 'report-management',
|
|
6
|
+
module: 'ReportManagement',
|
|
7
|
+
};
|
|
8
|
+
exports.RootConfig = {
|
|
9
|
+
config,
|
|
10
|
+
module: {
|
|
11
|
+
route: 'report-management',
|
|
12
|
+
name: config.module,
|
|
13
|
+
title: `@${config.i18n}:module.title`,
|
|
14
|
+
icon: 'fa-light fa-chart-bar',
|
|
15
|
+
},
|
|
16
|
+
entities: {
|
|
17
|
+
dataSet: {
|
|
18
|
+
name: 'DataSet',
|
|
19
|
+
title: `t("dataSet", { scope: "${config.i18n}" })`,
|
|
20
|
+
titlePlural: `t("dataSetPlural", { scope: "${config.i18n}" })`,
|
|
21
|
+
icon: 'fa-light fa-default',
|
|
22
|
+
},
|
|
23
|
+
category: {
|
|
24
|
+
name: 'Category',
|
|
25
|
+
fullName: `${config.module}.Category`,
|
|
26
|
+
title: `@${config.i18n}:reports.entities.category.title`,
|
|
27
|
+
titlePlural: `@${config.i18n}:reports.entities.category.plural`,
|
|
28
|
+
icon: 'fa-light fa-folder',
|
|
29
|
+
},
|
|
30
|
+
report: {
|
|
31
|
+
name: 'Report',
|
|
32
|
+
fullName: `${config.module}.Report`,
|
|
33
|
+
title: `@${config.i18n}:reports.entities.report.title`,
|
|
34
|
+
titlePlural: `@${config.i18n}:reports.entities.report.plural`,
|
|
35
|
+
icon: 'fa-light fa-file-chart-pie',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=root-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-config.js","sourceRoot":"","sources":["../../../../../libs/modules/report-management/contracts/src/root-config.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEW,QAAA,UAAU,GAAG;IACxB,MAAM;IACN,MAAM,EAAE;QACN,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,MAAM,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI,MAAM,CAAC,IAAI,eAAe;QACrC,IAAI,EAAE,uBAAuB;KAC9B;IACD,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,0BAA0B,MAAM,CAAC,IAAI,MAAM;YAClD,WAAW,EAAE,gCAAgC,MAAM,CAAC,IAAI,MAAM;YAC9D,IAAI,EAAE,qBAAqB;SAC5B;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,WAAW;YACrC,KAAK,EAAE,IAAI,MAAM,CAAC,IAAI,kCAAkC;YACxD,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,mCAAmC;YAC/D,IAAI,EAAE,oBAAoB;SAC3B;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,SAAS;YACnC,KAAK,EAAE,IAAI,MAAM,CAAC,IAAI,gCAAgC;YACtD,WAAW,EAAE,IAAI,MAAM,CAAC,IAAI,iCAAiC;YAC7D,IAAI,EAAE,4BAA4B;SACnC;KACF;CACO,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acorex-platform/module-report-management-server",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./server/src/index.js",
|
|
6
|
+
"types": "./server/src/index.d.ts",
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@nestjs/common": "^11.0.0",
|
|
9
|
+
"@acorex-platform/framework-server": "0.0.15",
|
|
10
|
+
"@acorex-platform/module-common-server": "0.0.15"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./server/src/index.d.ts",
|
|
16
|
+
"default": "./server/src/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./contracts": {
|
|
19
|
+
"types": "./contracts/src/index.d.ts",
|
|
20
|
+
"default": "./contracts/src/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./seed": {
|
|
23
|
+
"types": "./server/src/lib/seed/index.d.ts",
|
|
24
|
+
"default": "./server/src/lib/seed/index.js"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './lib/report-management-server.module';
|
|
2
|
+
export * from './lib/report-management.controller';
|
|
3
|
+
export * from './lib/report-browse.service';
|
|
4
|
+
export * from './lib/report-browse.types';
|
|
5
|
+
export { reportmanagementSeedCatalog } from './lib/seed/report-management.seed-catalog';
|
|
6
|
+
export { REPORT_MANAGEMENT_MODULE_SEED } from './lib/seed/report-management-seed.tokens';
|
|
7
|
+
export { ReportManagementSeedCatalogProvider } from './lib/seed/report-management-seed.provider';
|
|
8
|
+
export * from './lib/seed';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReportManagementSeedCatalogProvider = exports.REPORT_MANAGEMENT_MODULE_SEED = exports.reportmanagementSeedCatalog = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./lib/report-management-server.module"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/report-management.controller"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/report-browse.service"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/report-browse.types"), exports);
|
|
9
|
+
var report_management_seed_catalog_1 = require("./lib/seed/report-management.seed-catalog");
|
|
10
|
+
Object.defineProperty(exports, "reportmanagementSeedCatalog", { enumerable: true, get: function () { return report_management_seed_catalog_1.reportmanagementSeedCatalog; } });
|
|
11
|
+
var report_management_seed_tokens_1 = require("./lib/seed/report-management-seed.tokens");
|
|
12
|
+
Object.defineProperty(exports, "REPORT_MANAGEMENT_MODULE_SEED", { enumerable: true, get: function () { return report_management_seed_tokens_1.REPORT_MANAGEMENT_MODULE_SEED; } });
|
|
13
|
+
var report_management_seed_provider_1 = require("./lib/seed/report-management-seed.provider");
|
|
14
|
+
Object.defineProperty(exports, "ReportManagementSeedCatalogProvider", { enumerable: true, get: function () { return report_management_seed_provider_1.ReportManagementSeedCatalogProvider; } });
|
|
15
|
+
tslib_1.__exportStar(require("./lib/seed"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/modules/report-management/server/src/index.ts"],"names":[],"mappings":";;;;AAAA,gFAAsD;AACtD,6EAAmD;AACnD,sEAA4C;AAC5C,oEAA0C;AAC1C,4FAAwF;AAA/E,6IAAA,2BAA2B,OAAA;AACpC,0FAAyF;AAAhF,8IAAA,6BAA6B,OAAA;AACtC,8FAAiG;AAAxF,sJAAA,mCAAmC,OAAA;AAC5C,qDAA2B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EntityStorageMiddlewareService } from '@acorex-platform/framework-server/core';
|
|
2
|
+
import type { ReportCategoryApiResponse, ReportDefinitionApiResponse } from './report-browse.types';
|
|
3
|
+
export declare class ReportBrowseService {
|
|
4
|
+
private readonly storage;
|
|
5
|
+
constructor(storage: EntityStorageMiddlewareService);
|
|
6
|
+
listRootCategories(skip?: number, take?: number): Promise<ReportCategoryApiResponse>;
|
|
7
|
+
getCategoryById(categoryId: string): Promise<ReportCategoryApiResponse>;
|
|
8
|
+
getReportDefinition(reportId: string): Promise<ReportDefinitionApiResponse>;
|
|
9
|
+
private loadAll;
|
|
10
|
+
private mapCategoryToApiItem;
|
|
11
|
+
private mapReportToApiItem;
|
|
12
|
+
private mapReportToApiResponse;
|
|
13
|
+
}
|