@moh-sso/report-scheduler 0.0.0-stage → 0.4.2

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.
Files changed (124) hide show
  1. package/README.md +117 -2
  2. package/dist/_types/apps/report-scheduler/src/api/index.d.ts +3418 -0
  3. package/dist/_types/apps/report-scheduler/src/components/RecipientSelect.d.ts +10 -0
  4. package/dist/_types/apps/report-scheduler/src/components/ScheduleFormPanel.d.ts +9 -0
  5. package/dist/_types/apps/report-scheduler/src/components/SchedulerTables.d.ts +33 -0
  6. package/dist/_types/apps/report-scheduler/src/hooks/useSchedulerPermissions.d.ts +9 -0
  7. package/dist/_types/apps/report-scheduler/src/hooks/useSchedulerQueryToasts.d.ts +9 -0
  8. package/dist/_types/apps/report-scheduler/src/index.d.ts +4 -0
  9. package/dist/_types/apps/report-scheduler/src/root.component.d.ts +2 -0
  10. package/dist/_types/apps/report-scheduler/src/routes.d.ts +2 -0
  11. package/dist/_types/apps/report-scheduler/src/single-spa.d.ts +1 -0
  12. package/dist/_types/apps/report-scheduler/src/types/index.d.ts +185 -0
  13. package/dist/_types/apps/report-scheduler/src/utils/report-parameters.d.ts +3 -0
  14. package/dist/_types/apps/report-scheduler/src/utils/scheduler-permissions.d.ts +12 -0
  15. package/dist/_types/packages/api/src/api/baseApi.d.ts +2 -0
  16. package/dist/_types/packages/api/src/index.d.ts +1 -0
  17. package/dist/_types/packages/auth/src/api/auth.api.d.ts +531 -0
  18. package/dist/_types/packages/auth/src/api/health-context.api.d.ts +374 -0
  19. package/dist/_types/packages/auth/src/auth/AuthBootstrap.d.ts +1 -0
  20. package/dist/_types/packages/auth/src/auth/HealthContextProvider.d.ts +20 -0
  21. package/dist/_types/packages/auth/src/auth/PermissionGuard.d.ts +10 -0
  22. package/dist/_types/packages/auth/src/auth/auth.selectors.d.ts +896 -0
  23. package/dist/_types/packages/auth/src/auth/auth.slice.d.ts +14 -0
  24. package/dist/_types/packages/auth/src/auth/auth.types.d.ts +61 -0
  25. package/dist/_types/packages/auth/src/auth/login-url.d.ts +2 -0
  26. package/dist/_types/packages/auth/src/auth/permissions.d.ts +58 -0
  27. package/dist/_types/packages/auth/src/auth/rbac.d.ts +8 -0
  28. package/dist/_types/packages/auth/src/auth/system-launch-url.d.ts +9 -0
  29. package/dist/_types/packages/auth/src/auth/useAuthorization.d.ts +14 -0
  30. package/dist/_types/packages/auth/src/index.d.ts +14 -0
  31. package/dist/_types/packages/config/src/appMeta.d.ts +3 -0
  32. package/dist/_types/packages/config/src/index.d.ts +6 -0
  33. package/dist/_types/packages/config/src/lib/constants/api.constants.d.ts +178 -0
  34. package/dist/_types/packages/config/src/lib/constants/document-templates.d.ts +11 -0
  35. package/dist/_types/packages/config/src/lib/errors/errorMessages.d.ts +2 -0
  36. package/dist/_types/packages/config/src/lib/errors/errorSeverity.d.ts +3 -0
  37. package/dist/_types/packages/config/src/lib/errors/errorTypes.d.ts +1 -0
  38. package/dist/_types/packages/microfrontend/src/basename.d.ts +1 -0
  39. package/dist/_types/packages/microfrontend/src/index.d.ts +6 -0
  40. package/dist/_types/packages/microfrontend/src/lifecycle.d.ts +6 -0
  41. package/dist/_types/packages/microfrontend/src/navigation.d.ts +2 -0
  42. package/dist/_types/packages/microfrontend/src/props.d.ts +44 -0
  43. package/dist/_types/packages/microfrontend/src/react-lifecycle.d.ts +11 -0
  44. package/dist/_types/packages/microfrontend/src/routes.d.ts +13 -0
  45. package/dist/_types/packages/state/src/clients/clients.selectors.d.ts +534 -0
  46. package/dist/_types/packages/state/src/clients/clients.slice.d.ts +4 -0
  47. package/dist/_types/packages/state/src/document/documents.selectors.d.ts +1 -0
  48. package/dist/_types/packages/state/src/index.d.ts +29 -0
  49. package/dist/_types/packages/state/src/ui/ui.state.d.ts +1 -0
  50. package/dist/_types/packages/types/src/index.d.ts +6 -0
  51. package/dist/_types/packages/types/src/types/announcement-summary.types.d.ts +16 -0
  52. package/dist/_types/packages/types/src/types/client-role.types.d.ts +6 -0
  53. package/dist/_types/packages/types/src/types/client.types.d.ts +46 -0
  54. package/dist/_types/packages/types/src/types/document-processing.types.d.ts +1 -0
  55. package/dist/_types/packages/types/src/types/notifications.types.d.ts +96 -0
  56. package/dist/_types/packages/types/src/types/system-navigation.types.d.ts +18 -0
  57. package/dist/_types/packages/ui/src/accessibility/index.d.ts +1 -0
  58. package/dist/_types/packages/ui/src/accessibility/useFocusTrap.d.ts +10 -0
  59. package/dist/_types/packages/ui/src/branding/BuildMeta.d.ts +6 -0
  60. package/dist/_types/packages/ui/src/branding/PublicFooter.d.ts +6 -0
  61. package/dist/_types/packages/ui/src/branding/index.d.ts +2 -0
  62. package/dist/_types/packages/ui/src/data-display/DataTablePagination.d.ts +12 -0
  63. package/dist/_types/packages/ui/src/data-display/DataTableShell.d.ts +35 -0
  64. package/dist/_types/packages/ui/src/data-display/RowActionsCell.d.ts +7 -0
  65. package/dist/_types/packages/ui/src/data-display/TableEmptyState.d.ts +8 -0
  66. package/dist/_types/packages/ui/src/data-display/TableStatusTag.d.ts +8 -0
  67. package/dist/_types/packages/ui/src/data-display/index.d.ts +5 -0
  68. package/dist/_types/packages/ui/src/feedback/comingsoon/ComingSoon.d.ts +7 -0
  69. package/dist/_types/packages/ui/src/feedback/emptystate/EmptyState.d.ts +15 -0
  70. package/dist/_types/packages/ui/src/feedback/errorstate/ErrorState.d.ts +14 -0
  71. package/dist/_types/packages/ui/src/feedback/errorstate/MicrofrontendErrorBoundary.d.ts +16 -0
  72. package/dist/_types/packages/ui/src/feedback/index.d.ts +5 -0
  73. package/dist/_types/packages/ui/src/feedback/loadingstate/LoadingState.d.ts +5 -0
  74. package/dist/_types/packages/ui/src/forms/CaseFormsGrid.d.ts +1 -0
  75. package/dist/_types/packages/ui/src/forms/index.d.ts +1 -0
  76. package/dist/_types/packages/ui/src/index.d.ts +16 -0
  77. package/dist/_types/packages/ui/src/layout/PageShell/PageShell.d.ts +9 -0
  78. package/dist/_types/packages/ui/src/layout/SectionCard/SectionCard.d.ts +11 -0
  79. package/dist/_types/packages/ui/src/layout/index.d.ts +2 -0
  80. package/dist/_types/packages/ui/src/navigation/appmenu/AppGridContent.d.ts +12 -0
  81. package/dist/_types/packages/ui/src/navigation/appmenu/AppMenu.component.d.ts +6 -0
  82. package/dist/_types/packages/ui/src/navigation/appmenu/AppMenuItem.component.d.ts +13 -0
  83. package/dist/_types/packages/ui/src/navigation/appmenu/appMenuGroups.d.ts +11 -0
  84. package/dist/_types/packages/ui/src/navigation/breadcrumbs/AppBreadcrumbs.d.ts +12 -0
  85. package/dist/_types/packages/ui/src/navigation/breadcrumbs/BreadcrumbBar.d.ts +10 -0
  86. package/dist/_types/packages/ui/src/navigation/index.d.ts +2 -0
  87. package/dist/_types/packages/ui/src/navigation/sidenav/ClientSideNav.d.ts +14 -0
  88. package/dist/_types/packages/ui/src/notifications/FormInlineAlert.d.ts +7 -0
  89. package/dist/_types/packages/ui/src/notifications/NotificationsPanel.d.ts +14 -0
  90. package/dist/_types/packages/ui/src/notifications/index.d.ts +4 -0
  91. package/dist/_types/packages/ui/src/notifications/toast/ToastProvider.d.ts +20 -0
  92. package/dist/_types/packages/ui/src/notifications/toast/useToast.d.ts +20 -0
  93. package/dist/_types/packages/ui/src/overlays/header-panel/ReusableHeaderPanel.d.ts +17 -0
  94. package/dist/_types/packages/ui/src/overlays/header-panel/header-panel.context.d.ts +23 -0
  95. package/dist/_types/packages/ui/src/overlays/index.d.ts +4 -0
  96. package/dist/_types/packages/ui/src/overlays/modal/ReusableModal.d.ts +20 -0
  97. package/dist/_types/packages/ui/src/overlays/modal/modal.context.d.ts +14 -0
  98. package/dist/_types/packages/ui/src/shell/ExternalAppHeader.d.ts +22 -0
  99. package/dist/_types/packages/ui/src/shell/PublicHeader.component.d.ts +8 -0
  100. package/dist/_types/packages/ui/src/shell/UserHeader.component.d.ts +17 -0
  101. package/dist/_types/packages/ui/src/shell/index.d.ts +5 -0
  102. package/dist/_types/packages/ui/src/theme/ThemeProvider.d.ts +8 -0
  103. package/dist/_types/packages/ui/src/theme/index.d.ts +1 -0
  104. package/dist/_types/packages/ui/src/utils/severity.d.ts +22 -0
  105. package/dist/_types/packages/ui/src/utils/status.d.ts +1 -0
  106. package/dist/api.d.ts +1 -0
  107. package/dist/api.js +154 -0
  108. package/dist/api.js.map +1 -0
  109. package/dist/assets/report-scheduler-CR8i8OX0.css +1 -0
  110. package/dist/assets/root.component-CObknIW7.js +1411 -0
  111. package/dist/assets/root.component-CObknIW7.js.map +1 -0
  112. package/dist/index.d.ts +1 -0
  113. package/dist/index.js +51 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/routes.d.ts +1 -0
  116. package/dist/routes.js +33 -0
  117. package/dist/routes.js.map +1 -0
  118. package/dist/single-spa.d.ts +1 -0
  119. package/dist/single-spa.js +32 -0
  120. package/dist/single-spa.js.map +1 -0
  121. package/dist/types.d.ts +1 -0
  122. package/dist/types.js +25 -0
  123. package/dist/types.js.map +1 -0
  124. package/package.json +61 -4
@@ -0,0 +1,10 @@
1
+ import type { RecipientOption } from "../types";
2
+ type RecipientSelectProps = {
3
+ kind: "email" | "group" | "portal";
4
+ label: string;
5
+ selected: RecipientOption[];
6
+ onChange: (items: RecipientOption[]) => void;
7
+ disabled?: boolean;
8
+ };
9
+ export declare function RecipientSelect({ kind, label, selected, onChange, disabled, }: RecipientSelectProps): import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { ReportSchedule } from "../types";
2
+ type ScheduleFormPanelProps = {
3
+ initialSchedule?: ReportSchedule;
4
+ currentUserId: string;
5
+ onSuccess: () => void;
6
+ onCancel: () => void;
7
+ };
8
+ export declare function ScheduleFormPanel(props: ScheduleFormPanelProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ import type { SchedulerPermissions } from "../utils/scheduler-permissions";
3
+ import type { PortalReport, ReportExecution, ReportSchedule } from "../types";
4
+ export type ScheduleAction = "pause" | "resume" | "duplicate" | "run" | "delete";
5
+ export declare const readableLabel: (value: string) => string;
6
+ export declare const formatReportDate: (value?: string) => string;
7
+ export declare function SchedulesTable({ rows, access, busy, pending, onEdit, onAction, empty, }: {
8
+ rows: ReportSchedule[];
9
+ access: SchedulerPermissions;
10
+ busy: boolean;
11
+ pending?: {
12
+ id: string;
13
+ action: ScheduleAction;
14
+ };
15
+ onEdit: (schedule: ReportSchedule) => void;
16
+ onAction: (action: ScheduleAction, schedule: ReportSchedule) => void;
17
+ empty: ReactNode;
18
+ }): import("react").JSX.Element;
19
+ export declare function ExecutionsTable({ rows, schedules, onDetails, onRetry, retrying, canRetry, selectedId, expandedDetails, empty, }: {
20
+ rows: ReportExecution[];
21
+ schedules: ReportSchedule[];
22
+ onDetails: (id?: string) => void;
23
+ onRetry: (id: string) => void;
24
+ retrying: boolean;
25
+ canRetry: boolean;
26
+ selectedId?: string;
27
+ expandedDetails: ReactNode;
28
+ empty: ReactNode;
29
+ }): import("react").JSX.Element;
30
+ export declare function DeliveredReportsTable({ rows, empty }: {
31
+ rows: PortalReport[];
32
+ empty: ReactNode;
33
+ }): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare function useSchedulerPermissions(): {
2
+ read: boolean;
3
+ create: boolean;
4
+ update: boolean;
5
+ delete: boolean;
6
+ execute: boolean;
7
+ history: boolean;
8
+ manage: boolean;
9
+ };
@@ -0,0 +1,9 @@
1
+ type QueryNotice = {
2
+ id: string;
3
+ active: boolean;
4
+ kind: "error" | "warning";
5
+ title: string;
6
+ subtitle?: string;
7
+ };
8
+ export declare function useSchedulerQueryToasts(notices: QueryNotice[]): void;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ export { ReportSchedulerRoot } from "./root.component";
2
+ export { reportSchedulerRoute } from "./routes";
3
+ export * from "./api";
4
+ export * from "./types";
@@ -0,0 +1,2 @@
1
+ import type { MicrofrontendRuntimeProps } from "../../../packages/microfrontend/src/index.js";
2
+ export declare function ReportSchedulerRoot(props: MicrofrontendRuntimeProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { MicrofrontendRoute } from "../../../packages/microfrontend/src/index.js";
2
+ export declare const reportSchedulerRoute: MicrofrontendRoute;
@@ -0,0 +1 @@
1
+ export declare const bootstrap: (props: import("../../../packages/microfrontend/src/index.js").MicrofrontendMountProps) => Promise<void> | void, mount: (props: import("../../../packages/microfrontend/src/index.js").MicrofrontendMountProps) => Promise<void> | void, unmount: (props: import("../../../packages/microfrontend/src/index.js").MicrofrontendMountProps) => Promise<void> | void;
@@ -0,0 +1,185 @@
1
+ export type HealthContext = {
2
+ level?: "national" | "district" | "facility" | string;
3
+ district?: string;
4
+ facility?: string;
5
+ };
6
+ export type ReportSchedulerModule = {
7
+ name: string;
8
+ status: "ready";
9
+ schedulingEnabled: boolean;
10
+ healthBiEnabled: boolean;
11
+ healthContext: HealthContext;
12
+ };
13
+ export type HealthBIReport = {
14
+ id: string;
15
+ name: string;
16
+ description?: string;
17
+ category?: string;
18
+ supportedFormats?: string[];
19
+ metadata?: {
20
+ periodStrategies?: string[];
21
+ [key: string]: unknown;
22
+ };
23
+ };
24
+ export type HealthBIParameter = {
25
+ name: string;
26
+ label?: string;
27
+ type: string;
28
+ required: boolean;
29
+ description?: string;
30
+ options?: unknown[];
31
+ defaultValue?: unknown;
32
+ metadata?: Record<string, unknown>;
33
+ };
34
+ export type ScheduleRecipient = {
35
+ id?: string;
36
+ type: "user" | "group" | "email";
37
+ value: string;
38
+ deliveryChannel: "email" | "portal";
39
+ };
40
+ export type RecipientOption = {
41
+ id: string;
42
+ type: ScheduleRecipient["type"];
43
+ value: string;
44
+ label: string;
45
+ };
46
+ export type OutputConfig = {
47
+ format: string;
48
+ deliveryMode?: string;
49
+ fileNamePrefix?: string;
50
+ };
51
+ export type ScheduleTiming = {
52
+ timeOfDay: string;
53
+ weekday?: number;
54
+ dayOfMonth?: number;
55
+ };
56
+ export type ReportSchedule = {
57
+ id: string;
58
+ healthBiReportId: string;
59
+ reportName: string;
60
+ description?: string;
61
+ frequency: string;
62
+ cronExpression?: string;
63
+ timezone: string;
64
+ periodStrategy: string;
65
+ parameters: Record<string, unknown>;
66
+ outputFormat: string;
67
+ outputConfig: OutputConfig;
68
+ timing: ScheduleTiming;
69
+ healthContext: HealthContext;
70
+ recipients: ScheduleRecipient[];
71
+ enabled: boolean;
72
+ createdBy: string;
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ lastRunAt?: string;
76
+ nextRunAt?: string;
77
+ };
78
+ export type CreateScheduleRequest = {
79
+ healthBiReportId: string;
80
+ reportName: string;
81
+ description?: string;
82
+ frequency: string;
83
+ cronExpression?: string;
84
+ timezone: string;
85
+ periodStrategy: string;
86
+ parameters: Record<string, unknown>;
87
+ outputFormat: string;
88
+ outputConfig: OutputConfig;
89
+ timing: ScheduleTiming;
90
+ healthContext: HealthContext;
91
+ recipients: ScheduleRecipient[];
92
+ enabled: boolean;
93
+ };
94
+ export type RecipientPreview = {
95
+ emailRecipients: string[];
96
+ portalRecipients: string[];
97
+ emailCount: number;
98
+ portalCount: number;
99
+ };
100
+ export type PortalReport = {
101
+ deliveryId: string;
102
+ executionId: string;
103
+ reportId: string;
104
+ reportName: string;
105
+ deliveredAt: string;
106
+ artifact: {
107
+ id: string;
108
+ fileName: string;
109
+ contentType?: string;
110
+ downloadUrl?: string;
111
+ };
112
+ };
113
+ export type SchedulerStatusCount = {
114
+ status: string;
115
+ count: number;
116
+ };
117
+ export type SchedulerOverview = {
118
+ totalSchedules: number;
119
+ enabledSchedules: number;
120
+ executions24h: number;
121
+ completed24h: number;
122
+ failed24h: number;
123
+ retryingNow: number;
124
+ deliveryFailures24h: number;
125
+ successRate24h: number;
126
+ executionStatuses: SchedulerStatusCount[];
127
+ deliveryStatuses: SchedulerStatusCount[];
128
+ recentFailures: ReportExecution[];
129
+ workerLastHeartbeatAt?: string;
130
+ workerLastCycleError?: string;
131
+ workerHealthy: boolean;
132
+ generatedAt: string;
133
+ };
134
+ export type ReportExecution = {
135
+ id: string;
136
+ scheduleId?: string;
137
+ healthBiJobId?: string;
138
+ reportId: string;
139
+ status: string;
140
+ outputFormat: string;
141
+ triggerType: "scheduled" | "manual" | string;
142
+ scheduledFor?: string;
143
+ generationAttempts: number;
144
+ maxGenerationAttempts: number;
145
+ nextRetryAt?: string;
146
+ lastAttemptAt?: string;
147
+ errorMessage?: string;
148
+ resolvedPeriod?: {
149
+ strategy: string;
150
+ start: string;
151
+ end: string;
152
+ };
153
+ createdAt: string;
154
+ };
155
+ export type ReportDelivery = {
156
+ id: string;
157
+ executionId: string;
158
+ artifactId?: string;
159
+ recipientType: string;
160
+ recipientValue: string;
161
+ deliveryChannel: string;
162
+ status: string;
163
+ attempts: number;
164
+ maxAttempts: number;
165
+ lastError?: string;
166
+ nextRetryAt?: string;
167
+ lastAttemptAt?: string;
168
+ sentAt?: string;
169
+ createdAt: string;
170
+ updatedAt: string;
171
+ };
172
+ export type ExecutionDetail = {
173
+ execution: ReportExecution;
174
+ schedule?: ReportSchedule;
175
+ artifacts: Array<{
176
+ id: string;
177
+ executionId: string;
178
+ fileName: string;
179
+ contentType?: string;
180
+ downloadUrl?: string;
181
+ sizeBytes?: number;
182
+ createdAt: string;
183
+ }>;
184
+ deliveries: ReportDelivery[];
185
+ };
@@ -0,0 +1,3 @@
1
+ import type { HealthBIParameter } from "../types";
2
+ export declare function populateReportParameters(schema: HealthBIParameter[], overrides: Record<string, unknown>): Record<string, unknown>;
3
+ export declare function parameterInputValue(value: unknown): string;
@@ -0,0 +1,12 @@
1
+ import { type Permission } from "../../../../packages/auth/src/index.js";
2
+ export declare function schedulerPermissions(can: (permission: Permission) => boolean, hasSystem: boolean): {
3
+ read: boolean;
4
+ create: boolean;
5
+ update: boolean;
6
+ delete: boolean;
7
+ execute: boolean;
8
+ history: boolean;
9
+ manage: boolean;
10
+ };
11
+ export type SchedulerPermissions = ReturnType<typeof schedulerPermissions>;
12
+ export declare function canScheduleAction(access: SchedulerPermissions, action: string): boolean;
@@ -0,0 +1,2 @@
1
+ import { type BaseQueryFn, type FetchArgs, type FetchBaseQueryError } from "@reduxjs/toolkit/query/react";
2
+ export declare const baseApi: import("@reduxjs/toolkit/query").Api<BaseQueryFn<string | FetchArgs, unknown, FetchBaseQueryError>, {}, "api", "Surveillance" | "Documents" | "Auth" | "User" | "Client" | "Audit" | "Metrics" | "Notification" | "ClientRole" | "UserClientRole" | "Document" | "DocumentProcesses" | "StorageLocations" | "StorageLocation" | "UserSession" | "UserSessions" | "Announcements" | "ThemeElement" | "GeoJson" | "Issues" | "Transactions" | "Emails" | "DocumentTemplates" | "DocumentSheets" | "DocumentColumns" | "RbacSystem" | "RbacGroup" | "RbacPermission" | "RbacRealmRole" | "RbacAccessRequest" | "RbacChangeRequest" | "RbacAudit" | "Datasets" | "DataElements" | "DataValidationRules" | "HealthContext" | "DQATables" | "DQARules" | "DQARuns" | "DQASchedules" | "DQAFlags", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/query/react").reactHooksModuleName>;
@@ -0,0 +1 @@
1
+ export * from "./api/baseApi";