@acorex-platform/module-dashboard-management-client 0.0.21

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.
@@ -0,0 +1,368 @@
1
+ declare const AXPDashboardManagementFeatureKeys: {};
2
+
3
+ declare const AXPDashboardManagementMenuKeys: {
4
+ readonly Root: "DashboardManagement:Menu";
5
+ readonly Dashboards: "DashboardManagement:Menu:Dashboards";
6
+ };
7
+
8
+ /**
9
+ * Administration capabilities used by this module.
10
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
11
+ */
12
+ declare const AXPAdministrationPermissionKeys: {
13
+ readonly Access: "Administration:Permission:Access";
14
+ readonly MaintainUsersAndRoles: "Administration:Permission:MaintainUsersAndRoles";
15
+ readonly ManageSessions: "Administration:Permission:ManageSessions";
16
+ readonly MaintainPolicies: "Administration:Permission:MaintainPolicies";
17
+ readonly ViewIntegrations: "Administration:Permission:ViewIntegrations";
18
+ readonly MaintainConnections: "Administration:Permission:MaintainConnections";
19
+ readonly MaintainWorkflows: "Administration:Permission:MaintainWorkflows";
20
+ readonly ManageWorkflowActions: "Administration:Permission:ManageWorkflowActions";
21
+ readonly ViewRules: "Administration:Permission:ViewRules";
22
+ readonly MaintainRules: "Administration:Permission:MaintainRules";
23
+ readonly ManageRuleActions: "Administration:Permission:ManageRuleActions";
24
+ readonly MaintainAi: "Administration:Permission:MaintainAi";
25
+ readonly UseAiAssist: "Administration:Permission:UseAiAssist";
26
+ readonly MaintainDashboards: "Administration:Permission:MaintainDashboards";
27
+ readonly ViewJobs: "Administration:Permission:ViewJobs";
28
+ readonly ManageJobActions: "Administration:Permission:ManageJobActions";
29
+ readonly ViewObservability: "Administration:Permission:ViewObservability";
30
+ readonly MaintainObservability: "Administration:Permission:MaintainObservability";
31
+ };
32
+ /**
33
+ * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.
34
+ * Legacy nested shape kept so existing imports compile during migration.
35
+ */
36
+ declare const AXMPermissionsKeys: {
37
+ readonly DashboardManagement: {
38
+ readonly Management: "Administration:Permission:MaintainDashboards";
39
+ readonly Dashboard: {
40
+ readonly Management: "Administration:Permission:MaintainDashboards";
41
+ readonly View: "Administration:Permission:MaintainDashboards";
42
+ readonly Edit: "Administration:Permission:MaintainDashboards";
43
+ readonly Delete: "Administration:Permission:MaintainDashboards";
44
+ readonly Create: "Administration:Permission:MaintainDashboards";
45
+ };
46
+ };
47
+ };
48
+
49
+ declare enum AXPHomeDashboardSetting {
50
+ CurrentDashboard = "DashboardManagement:Setting:Home.CurrentDashboard"
51
+ }
52
+
53
+ /** Component key for the dashboard Layout page tab. Register via AXP_PAGE_COMPONENT_PROVIDER. */
54
+ declare const DASHBOARD_LAYOUT_PAGE_COMPONENT_KEY = "dashboard-layout-page";
55
+
56
+ declare const RootConfig: {
57
+ config: {
58
+ readonly i18n: "dashboard-management";
59
+ readonly module: "DashboardManagement";
60
+ };
61
+ module: {
62
+ module: "DashboardManagement";
63
+ name: "DashboardManagement";
64
+ title: string;
65
+ icon: string;
66
+ };
67
+ entities: {
68
+ dashboard: {
69
+ name: string;
70
+ title: string;
71
+ titlePlural: string;
72
+ icon: string;
73
+ };
74
+ };
75
+ /** Dashboard widget type ids owned by dashboard-management. */
76
+ widgets: {
77
+ barChart: string;
78
+ donutChart: string;
79
+ lineChart: string;
80
+ gaugeChart: string;
81
+ funnelChart: string;
82
+ heatmapChart: string;
83
+ stickyNote: string;
84
+ clockCalendar: string;
85
+ weather: string;
86
+ shortcut: string;
87
+ kpiProgress: string;
88
+ kpiSegmented: string;
89
+ kpiDetails: string;
90
+ kpiStatCard: string;
91
+ };
92
+ /**
93
+ * @deprecated Dashboard queries moved to owning modules (`{Module}:Dashboard:*`).
94
+ * Update seeds/widgets to module keys; these aliases remain for transitional references only.
95
+ */
96
+ queries: {
97
+ tenantAdmin: {
98
+ activeUsersKpi: string;
99
+ employeesKpi: string;
100
+ openTasksKpi: string;
101
+ activeProjectsKpi: string;
102
+ openHazardsKpi: string;
103
+ documentsKpi: string;
104
+ workflowDefinitionsKpi: string;
105
+ subscriptionKpi: string;
106
+ usersByRoleDonut: string;
107
+ taskStatusDonut: string;
108
+ deliveryStatusDonut: string;
109
+ integrationsDonut: string;
110
+ jobsByStatusBar: string;
111
+ jobSchedulesByStatusBar: string;
112
+ workflowsByStatusBar: string;
113
+ teamsBar: string;
114
+ projectsByStatusBar: string;
115
+ trainingComplianceGauge: string;
116
+ };
117
+ };
118
+ };
119
+
120
+ /**
121
+ * Dashboard visibility scope.
122
+ * - `T`: Tenant shared dashboard
123
+ * - `U`: User personal dashboard
124
+ * - `E`: Entity-scoped dashboard
125
+ */
126
+ type AXMDashboardScope = 'U' | 'T' | 'E';
127
+ /** Scope reference for personal dashboards. */
128
+ interface AXMDashboardUserScopeRef {
129
+ userId: string;
130
+ }
131
+ /** Scope reference for tenant dashboards. */
132
+ interface AXMDashboardTenantScopeRef {
133
+ tenantId: string;
134
+ roleIds: string[];
135
+ }
136
+ /** Scope reference for entity-type dashboards (one layout shared by all records of the type). */
137
+ interface AXMDashboardEntityScopeRef {
138
+ entityType: string;
139
+ }
140
+ /**
141
+ * Scope-specific reference payload.
142
+ * Shape depends on {@link AXMDashboardScope}.
143
+ */
144
+ type AXMDashboardScopeRef = AXMDashboardUserScopeRef | AXMDashboardTenantScopeRef | AXMDashboardEntityScopeRef;
145
+
146
+ /** Grid size preset as `[width, height]` in column/row units. */
147
+ type AXGridLayoutSize = readonly [width: number, height: number];
148
+ interface AXGridLayoutNode {
149
+ id?: string;
150
+ x?: number;
151
+ y?: number;
152
+ width?: number;
153
+ height?: number;
154
+ minWidth?: number;
155
+ minHeight?: number;
156
+ maxWidth?: number;
157
+ maxHeight?: number;
158
+ /** When set, resize snaps to one of these `[width, height]` presets. */
159
+ allowedSizes?: readonly AXGridLayoutSize[];
160
+ }
161
+ type AXMDashboardBreakpoint = 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl';
162
+ interface AXMDashboardWidgetLayoutMap {
163
+ id: string;
164
+ title?: string;
165
+ lg: AXGridLayoutNode;
166
+ md: AXGridLayoutNode;
167
+ sm: AXGridLayoutNode;
168
+ xl?: AXGridLayoutNode;
169
+ '2xl'?: AXGridLayoutNode;
170
+ '3xl'?: AXGridLayoutNode;
171
+ '4xl'?: AXGridLayoutNode;
172
+ }
173
+ interface AXMDashboardWidgetData {
174
+ config: AXMDashboardWidgetLayoutMap;
175
+ node?: unknown;
176
+ }
177
+ type AXPMultiLanguageString = string | Record<string, string>;
178
+ interface AXPEntityModel<Id> {
179
+ id: Id;
180
+ auditInfo?: {
181
+ created?: {
182
+ at?: string | Date;
183
+ by?: {
184
+ id: string;
185
+ type?: string;
186
+ };
187
+ };
188
+ updated?: {
189
+ at?: string | Date;
190
+ by?: {
191
+ id: string;
192
+ type?: string;
193
+ };
194
+ };
195
+ };
196
+ stateInfo?: Record<string, unknown>;
197
+ scopeInfo?: {
198
+ tenantId?: string;
199
+ userId?: string;
200
+ applicationId?: string;
201
+ };
202
+ }
203
+ interface AXMCommonDashboardEntityModel extends AXPEntityModel<string> {
204
+ title: AXPMultiLanguageString;
205
+ description?: AXPMultiLanguageString;
206
+ widgets: AXMDashboardWidgetData[];
207
+ isArchived?: boolean;
208
+ archivedAt?: string | Date;
209
+ locked?: boolean;
210
+ scope: AXMDashboardScope;
211
+ scopeRef: AXMDashboardScopeRef;
212
+ categoryIds?: string[];
213
+ }
214
+
215
+ /**
216
+ * Strict DTOs for dashboard chart / KPI queries.
217
+ * Chart widgets fetch an AXPQuery whose result matches one of these shapes.
218
+ */
219
+ /** Stable result-type ids stored on query definitions for designer filtering. */
220
+ declare const AXP_CHART_QUERY_RESULT_TYPE: {
221
+ readonly barSeries: "AXPBarChartQueryResult";
222
+ readonly lineSeries: "AXPLineChartQueryResult";
223
+ readonly donutSeries: "AXPDonutChartQueryResult";
224
+ readonly gaugeValue: "AXPGaugeChartQueryResult";
225
+ readonly funnelSeries: "AXPFunnelChartQueryResult";
226
+ readonly heatmapSeries: "AXPHeatmapChartQueryResult";
227
+ readonly kpiStatCard: "AXPKpiStatCardQueryResult";
228
+ readonly kpiSegmented: "AXPKpiSegmentedQueryResult";
229
+ readonly kpiProgress: "AXPKpiProgressQueryResult";
230
+ readonly kpiDetails: "AXPKpiDetailsQueryResult";
231
+ };
232
+ type AXPChartQueryResultType = (typeof AXP_CHART_QUERY_RESULT_TYPE)[keyof typeof AXP_CHART_QUERY_RESULT_TYPE];
233
+ interface AXPBarChartQueryItem {
234
+ id: string;
235
+ label: string;
236
+ value: number;
237
+ color?: string;
238
+ tooltipLabel?: string;
239
+ }
240
+ interface AXPLineChartQueryPoint {
241
+ x: number | string;
242
+ y: number;
243
+ tooltipLabel?: string;
244
+ }
245
+ interface AXPLineChartQuerySeries {
246
+ id?: string;
247
+ label?: string;
248
+ lineColor?: string;
249
+ fillColor?: string;
250
+ data: AXPLineChartQueryPoint[];
251
+ }
252
+ interface AXPDonutChartQueryItem {
253
+ id: string;
254
+ label: string;
255
+ value: number;
256
+ color?: string;
257
+ tooltipLabel?: string;
258
+ }
259
+ interface AXPFunnelChartQueryItem {
260
+ id?: string;
261
+ name: string;
262
+ value: number;
263
+ color?: string;
264
+ }
265
+ interface AXPHeatmapChartQueryItem {
266
+ x: number | string;
267
+ y: number | string;
268
+ value: number;
269
+ label?: string;
270
+ }
271
+ interface AXPBarChartQueryResult {
272
+ items: AXPBarChartQueryItem[];
273
+ }
274
+ interface AXPLineChartQueryResult {
275
+ series: AXPLineChartQuerySeries[];
276
+ }
277
+ interface AXPDonutChartQueryResult {
278
+ items: AXPDonutChartQueryItem[];
279
+ }
280
+ interface AXPGaugeChartQueryResult {
281
+ value: number;
282
+ }
283
+ interface AXPFunnelChartQueryResult {
284
+ items: AXPFunnelChartQueryItem[];
285
+ }
286
+ interface AXPHeatmapChartQueryResult {
287
+ items: AXPHeatmapChartQueryItem[];
288
+ }
289
+ interface AXPKpiStatCardQueryResult {
290
+ title?: string;
291
+ titleBadgeText?: string;
292
+ titleBadgeTone?: string;
293
+ value?: number | string;
294
+ valuePrefix?: string;
295
+ valueSuffix?: string;
296
+ format?: {
297
+ style?: 'decimal' | 'currency' | 'percent';
298
+ currency?: string;
299
+ minimumFractionDigits?: number;
300
+ maximumFractionDigits?: number;
301
+ };
302
+ icon?: string;
303
+ iconTone?: string;
304
+ trendValue?: string;
305
+ trendLabel?: string;
306
+ trendStatus?: 'success' | 'danger' | 'neutral';
307
+ }
308
+ interface AXPKpiSegmentedQueryResult {
309
+ title?: string;
310
+ icon?: string;
311
+ segments: Array<{
312
+ label: string;
313
+ value: number;
314
+ color?: string;
315
+ }>;
316
+ }
317
+ interface AXPKpiProgressQueryResult {
318
+ title?: string;
319
+ icon?: string;
320
+ value?: number | string;
321
+ valuePrefix?: string;
322
+ valueSuffix?: string;
323
+ subtitle?: string;
324
+ targetValue?: number | string;
325
+ progressValue?: number;
326
+ progressPercent?: number;
327
+ }
328
+ interface AXPKpiDetailsQueryResult {
329
+ title?: string;
330
+ value?: number | string;
331
+ valuePrefix?: string;
332
+ valueSuffix?: string;
333
+ subtitle?: string;
334
+ details: Array<{
335
+ label: string;
336
+ value: string | number;
337
+ color?: string;
338
+ }>;
339
+ }
340
+ /** Chart/KPI widget options for data binding (dashboard query and/or AI inline data). */
341
+ interface AXPChartQueryWidgetOptions {
342
+ /** Runtime AXPQuery key (e.g. `PlatformManagement:Dashboard:TenantsByStatusBar`). */
343
+ query?: string;
344
+ /** Optional input payload passed to `queryExecutor.fetch(query, queryInput)`. */
345
+ queryInput?: Record<string, unknown>;
346
+ /** Inline chart rows/series for AI chat (see chart-widget-data.util.ts). */
347
+ dataSource?: unknown;
348
+ }
349
+
350
+ declare function buildUserScopeRef(userId: string): AXMDashboardUserScopeRef;
351
+ declare function buildTenantScopeRef(tenantId: string, roleIds: readonly string[]): AXMDashboardTenantScopeRef;
352
+ declare function buildEntityScopeRef(entityType: string): AXMDashboardEntityScopeRef;
353
+ declare function readScopeUserId(scopeRef: AXMDashboardScopeRef | undefined): string | undefined;
354
+ declare function readScopeTenantId(scopeRef: AXMDashboardScopeRef | undefined): string | undefined;
355
+ declare function readScopeRoleIds(scopeRef: AXMDashboardScopeRef | undefined): string[];
356
+ declare function readScopeEntityType(scopeRef: AXMDashboardScopeRef | undefined): string | undefined;
357
+ /**
358
+ * Ensures {@link scopeRef} matches {@link scope} and strips incompatible keys.
359
+ */
360
+ declare function normalizeDashboardScopeRef(scope: AXMDashboardScope, scopeRef: unknown, fallback?: Partial<{
361
+ userId: string;
362
+ tenantId: string;
363
+ roleIds: readonly string[];
364
+ entityType: string;
365
+ }>): AXMDashboardScopeRef;
366
+
367
+ export { AXMPermissionsKeys, AXPAdministrationPermissionKeys, AXPDashboardManagementFeatureKeys, AXPDashboardManagementMenuKeys, AXPHomeDashboardSetting, AXP_CHART_QUERY_RESULT_TYPE, DASHBOARD_LAYOUT_PAGE_COMPONENT_KEY, RootConfig, buildEntityScopeRef, buildTenantScopeRef, buildUserScopeRef, normalizeDashboardScopeRef, readScopeEntityType, readScopeRoleIds, readScopeTenantId, readScopeUserId };
368
+ export type { AXGridLayoutNode, AXGridLayoutSize, AXMCommonDashboardEntityModel, AXMDashboardBreakpoint, AXMDashboardEntityScopeRef, AXMDashboardScope, AXMDashboardScopeRef, AXMDashboardTenantScopeRef, AXMDashboardUserScopeRef, AXMDashboardWidgetData, AXMDashboardWidgetLayoutMap, AXPBarChartQueryItem, AXPBarChartQueryResult, AXPChartQueryResultType, AXPChartQueryWidgetOptions, AXPDonutChartQueryItem, AXPDonutChartQueryResult, AXPEntityModel, AXPFunnelChartQueryItem, AXPFunnelChartQueryResult, AXPGaugeChartQueryResult, AXPHeatmapChartQueryItem, AXPHeatmapChartQueryResult, AXPKpiDetailsQueryResult, AXPKpiProgressQueryResult, AXPKpiSegmentedQueryResult, AXPKpiStatCardQueryResult, AXPLineChartQueryPoint, AXPLineChartQueryResult, AXPLineChartQuerySeries, AXPMultiLanguageString };