@moh-sso/api 0.0.0-stage → 1.4.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/README.md +33 -2
- package/dist/_types/packages/api/src/api/baseApi.d.ts +2 -0
- package/dist/_types/packages/api/src/index.d.ts +1 -0
- package/dist/_types/packages/auth/src/auth/auth.slice.d.ts +14 -0
- package/dist/_types/packages/auth/src/auth/auth.types.d.ts +61 -0
- package/dist/_types/packages/config/src/appMeta.d.ts +3 -0
- package/dist/_types/packages/config/src/index.d.ts +6 -0
- package/dist/_types/packages/config/src/lib/constants/api.constants.d.ts +178 -0
- package/dist/_types/packages/config/src/lib/constants/document-templates.d.ts +11 -0
- package/dist/_types/packages/config/src/lib/errors/errorMessages.d.ts +2 -0
- package/dist/_types/packages/config/src/lib/errors/errorSeverity.d.ts +3 -0
- package/dist/_types/packages/config/src/lib/errors/errorTypes.d.ts +1 -0
- package/dist/_types/packages/types/src/index.d.ts +6 -0
- package/dist/_types/packages/types/src/types/announcement-summary.types.d.ts +16 -0
- package/dist/_types/packages/types/src/types/client-role.types.d.ts +6 -0
- package/dist/_types/packages/types/src/types/client.types.d.ts +46 -0
- package/dist/_types/packages/types/src/types/document-processing.types.d.ts +1 -0
- package/dist/_types/packages/types/src/types/notifications.types.d.ts +96 -0
- package/dist/_types/packages/types/src/types/system-navigation.types.d.ts +18 -0
- package/dist/_types/packages/ui/src/accessibility/index.d.ts +1 -0
- package/dist/_types/packages/ui/src/accessibility/useFocusTrap.d.ts +10 -0
- package/dist/_types/packages/ui/src/branding/BuildMeta.d.ts +6 -0
- package/dist/_types/packages/ui/src/branding/PublicFooter.d.ts +6 -0
- package/dist/_types/packages/ui/src/branding/index.d.ts +2 -0
- package/dist/_types/packages/ui/src/data-display/DataTablePagination.d.ts +12 -0
- package/dist/_types/packages/ui/src/data-display/DataTableShell.d.ts +35 -0
- package/dist/_types/packages/ui/src/data-display/RowActionsCell.d.ts +7 -0
- package/dist/_types/packages/ui/src/data-display/TableEmptyState.d.ts +8 -0
- package/dist/_types/packages/ui/src/data-display/TableStatusTag.d.ts +8 -0
- package/dist/_types/packages/ui/src/data-display/index.d.ts +5 -0
- package/dist/_types/packages/ui/src/feedback/comingsoon/ComingSoon.d.ts +7 -0
- package/dist/_types/packages/ui/src/feedback/emptystate/EmptyState.d.ts +15 -0
- package/dist/_types/packages/ui/src/feedback/errorstate/ErrorState.d.ts +14 -0
- package/dist/_types/packages/ui/src/feedback/errorstate/MicrofrontendErrorBoundary.d.ts +16 -0
- package/dist/_types/packages/ui/src/feedback/index.d.ts +5 -0
- package/dist/_types/packages/ui/src/feedback/loadingstate/LoadingState.d.ts +5 -0
- package/dist/_types/packages/ui/src/forms/CaseFormsGrid.d.ts +1 -0
- package/dist/_types/packages/ui/src/forms/index.d.ts +1 -0
- package/dist/_types/packages/ui/src/index.d.ts +16 -0
- package/dist/_types/packages/ui/src/layout/PageShell/PageShell.d.ts +9 -0
- package/dist/_types/packages/ui/src/layout/SectionCard/SectionCard.d.ts +11 -0
- package/dist/_types/packages/ui/src/layout/index.d.ts +2 -0
- package/dist/_types/packages/ui/src/navigation/appmenu/AppGridContent.d.ts +12 -0
- package/dist/_types/packages/ui/src/navigation/appmenu/AppMenu.component.d.ts +6 -0
- package/dist/_types/packages/ui/src/navigation/appmenu/AppMenuItem.component.d.ts +13 -0
- package/dist/_types/packages/ui/src/navigation/appmenu/appMenuGroups.d.ts +11 -0
- package/dist/_types/packages/ui/src/navigation/breadcrumbs/AppBreadcrumbs.d.ts +12 -0
- package/dist/_types/packages/ui/src/navigation/breadcrumbs/BreadcrumbBar.d.ts +10 -0
- package/dist/_types/packages/ui/src/navigation/index.d.ts +2 -0
- package/dist/_types/packages/ui/src/navigation/sidenav/ClientSideNav.d.ts +14 -0
- package/dist/_types/packages/ui/src/notifications/FormInlineAlert.d.ts +7 -0
- package/dist/_types/packages/ui/src/notifications/NotificationsPanel.d.ts +14 -0
- package/dist/_types/packages/ui/src/notifications/index.d.ts +4 -0
- package/dist/_types/packages/ui/src/notifications/toast/ToastProvider.d.ts +20 -0
- package/dist/_types/packages/ui/src/notifications/toast/useToast.d.ts +20 -0
- package/dist/_types/packages/ui/src/overlays/header-panel/ReusableHeaderPanel.d.ts +17 -0
- package/dist/_types/packages/ui/src/overlays/header-panel/header-panel.context.d.ts +23 -0
- package/dist/_types/packages/ui/src/overlays/index.d.ts +4 -0
- package/dist/_types/packages/ui/src/overlays/modal/ReusableModal.d.ts +20 -0
- package/dist/_types/packages/ui/src/overlays/modal/modal.context.d.ts +14 -0
- package/dist/_types/packages/ui/src/shell/ExternalAppHeader.d.ts +22 -0
- package/dist/_types/packages/ui/src/shell/PublicHeader.component.d.ts +8 -0
- package/dist/_types/packages/ui/src/shell/UserHeader.component.d.ts +17 -0
- package/dist/_types/packages/ui/src/shell/index.d.ts +5 -0
- package/dist/_types/packages/ui/src/theme/ThemeProvider.d.ts +8 -0
- package/dist/_types/packages/ui/src/theme/index.d.ts +1 -0
- package/dist/_types/packages/ui/src/utils/severity.d.ts +22 -0
- package/dist/_types/packages/ui/src/utils/status.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3830 -0
- package/package.json +37 -4
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# API Package
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@moh-sso/api` contains the shared RTK Query base API used by frontend apps.
|
|
4
|
+
|
|
5
|
+
## Responsibilities
|
|
6
|
+
|
|
7
|
+
- Provide the shared `baseApi`.
|
|
8
|
+
- Centralize request credentials, refresh handling, and backend base URL behavior.
|
|
9
|
+
- Keep feature endpoint definitions out of the shared package.
|
|
10
|
+
- Let each app inject its own endpoints into `baseApi` from its local `src/api` folder.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
Feature modules should import `baseApi`, inject endpoints locally, and export their hooks from
|
|
15
|
+
their own app package.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { baseApi } from "@moh-sso/api";
|
|
19
|
+
|
|
20
|
+
export const usersApi = baseApi.injectEndpoints({
|
|
21
|
+
endpoints: (builder) => ({
|
|
22
|
+
// feature-owned endpoints
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Consumers should import hooks from the owning module, for example `@moh-sso/users`,
|
|
28
|
+
`@moh-sso/clients`, or a local `src/api` barrel inside that module.
|
|
29
|
+
|
|
30
|
+
## Development
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run build -w @moh-sso/api
|
|
34
|
+
```
|
|
@@ -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";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AuthUser } from "./auth.types";
|
|
2
|
+
type AuthState = {
|
|
3
|
+
accessToken: string | null;
|
|
4
|
+
user: AuthUser | null;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
loaded: boolean;
|
|
7
|
+
isAuthenticated: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const loginSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
user: AuthUser;
|
|
11
|
+
accessToken?: string | null;
|
|
12
|
+
}, "auth/loginSuccess">, logout: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/logout">, setAccessToken: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "auth/setAccessToken">, authLoaded: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"auth/authLoaded">;
|
|
13
|
+
declare const _default: import("redux").Reducer<AuthState>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export interface AuthUser {
|
|
2
|
+
id: string;
|
|
3
|
+
username: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
firstName?: string;
|
|
6
|
+
lastName?: string;
|
|
7
|
+
fullName?: string;
|
|
8
|
+
isAdmin: boolean;
|
|
9
|
+
isUser: boolean;
|
|
10
|
+
realmRoles: string[];
|
|
11
|
+
clientRoles: Record<string, string[]>;
|
|
12
|
+
permissions: Permission[];
|
|
13
|
+
systems: System[];
|
|
14
|
+
accessibleSystems: SystemAccess[];
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
emailVerified: boolean;
|
|
17
|
+
requirePwdChange: boolean;
|
|
18
|
+
lastLoginAt?: string;
|
|
19
|
+
createdAt?: string;
|
|
20
|
+
updatedAt?: string;
|
|
21
|
+
healthContexts?: EffectiveHealthContext[];
|
|
22
|
+
activeHealthContext?: EffectiveHealthContext;
|
|
23
|
+
}
|
|
24
|
+
export type HealthContextType = "NATIONAL" | "REGION" | "DISTRICT" | "CITY" | "DIVISION" | "MUNICIPALITY" | "COUNTY" | "SUB_COUNTY" | "PARISH" | "FACILITY" | "PROGRAM" | "DEPARTMENT" | "TEAM" | "CUSTOM";
|
|
25
|
+
export type HealthContextScopeMode = "NODE_ONLY" | "NODE_AND_DESCENDANTS";
|
|
26
|
+
export interface EffectiveHealthContext {
|
|
27
|
+
id: string;
|
|
28
|
+
code: string;
|
|
29
|
+
name: string;
|
|
30
|
+
contextType: HealthContextType;
|
|
31
|
+
parentId?: string;
|
|
32
|
+
source: string;
|
|
33
|
+
metadata: Record<string, unknown>;
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
version: number;
|
|
36
|
+
scopeMode: HealthContextScopeMode;
|
|
37
|
+
assignmentType: "DIRECT" | "GROUP" | "DEFAULT";
|
|
38
|
+
assignmentId: string;
|
|
39
|
+
sourceGroupId?: string;
|
|
40
|
+
sourceGroupPath?: string;
|
|
41
|
+
isDefault: boolean;
|
|
42
|
+
isActive: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface SystemAccess {
|
|
45
|
+
clientId: string;
|
|
46
|
+
displayName: string;
|
|
47
|
+
launchUrl?: string;
|
|
48
|
+
authenticatedLaunchUrl?: string;
|
|
49
|
+
icon?: string;
|
|
50
|
+
category?: string;
|
|
51
|
+
navigation?: string;
|
|
52
|
+
systemType?: "platform" | "external";
|
|
53
|
+
displayInLauncher?: boolean;
|
|
54
|
+
displayInSideNav?: boolean;
|
|
55
|
+
launchMode?: "internal" | "new_tab" | "same_tab";
|
|
56
|
+
sortOrder?: number;
|
|
57
|
+
roles: string[];
|
|
58
|
+
}
|
|
59
|
+
export type Role = string;
|
|
60
|
+
export type System = string;
|
|
61
|
+
export type Permission = "portal:access" | "systems:read" | "systems:launch" | "users:read" | "users:write" | "users:roles:write" | "clients:read" | "clients:write" | "clients:roles:write" | "announcements:read" | "announcements:write" | "announcements:publish" | "documents:read" | "documents:write" | "documents:process" | "document_templates:read" | "document_templates:write" | "document_templates:publish" | "surveillance:read" | "surveillance:import" | "surveillance:manage_locations" | "surveillance:manage_alerts" | "email:read" | "email:send" | "email:manage" | "storage_locations:read" | "storage_locations:write" | "data_quality:read" | "data_quality:write" | "data_quality:resolve" | "issue_tracker:resolve" | "report_browser:read" | "report_scheduler:read" | "report_scheduler:create" | "report_scheduler:update" | "report_scheduler:delete" | "report_scheduler:execute" | "report_scheduler:history" | "report_scheduler:manage" | "outbreak:access" | "outbreak:manage" | "metrics:read" | "audit:read" | "notifications:read" | "notifications:write" | "rbac:read" | "rbac:write" | "rbac:roles:write" | "rbac:permissions:write" | "issue_tracker:read" | "issue_tracker:write" | "issue_tracker:manage" | "issue_tracker:assign" | "issue_tracker:close" | "issue_tracker:reopen" | "issue_tracker:comment";
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export declare const API: {
|
|
2
|
+
readonly serviceBase: any;
|
|
3
|
+
readonly root: string;
|
|
4
|
+
readonly version: "v1";
|
|
5
|
+
readonly base: string;
|
|
6
|
+
readonly build: {
|
|
7
|
+
readonly version: () => string;
|
|
8
|
+
};
|
|
9
|
+
readonly auth: {
|
|
10
|
+
readonly base: `${string}/auth`;
|
|
11
|
+
readonly login: () => string;
|
|
12
|
+
readonly launch: () => string;
|
|
13
|
+
readonly callback: () => string;
|
|
14
|
+
readonly refresh: () => string;
|
|
15
|
+
readonly logout: () => string;
|
|
16
|
+
readonly me: () => string;
|
|
17
|
+
};
|
|
18
|
+
readonly healthContexts: {
|
|
19
|
+
readonly mine: () => string;
|
|
20
|
+
readonly explanation: (contextId: string) => string;
|
|
21
|
+
readonly select: () => string;
|
|
22
|
+
readonly admin: () => string;
|
|
23
|
+
readonly userAssignments: (userId: string) => string;
|
|
24
|
+
readonly groupAssignments: (groupId: string) => string;
|
|
25
|
+
};
|
|
26
|
+
readonly clients: {
|
|
27
|
+
readonly base: `${string}/clients`;
|
|
28
|
+
readonly list: () => string;
|
|
29
|
+
readonly byId: (id: string) => string;
|
|
30
|
+
readonly create: () => string;
|
|
31
|
+
readonly delete: (id: string) => string;
|
|
32
|
+
readonly update: (id: string) => string;
|
|
33
|
+
readonly roles: {
|
|
34
|
+
readonly list: (clientId: string) => string;
|
|
35
|
+
readonly create: (clientId: string) => string;
|
|
36
|
+
readonly delete: (clientId: string, role: string) => string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly users: {
|
|
40
|
+
readonly base: `${string}/users`;
|
|
41
|
+
readonly list: () => string;
|
|
42
|
+
readonly byId: (id: string) => string;
|
|
43
|
+
readonly create: () => string;
|
|
44
|
+
readonly delete: (id: string) => string;
|
|
45
|
+
readonly update: (id: string) => string;
|
|
46
|
+
readonly resetPassword: (id: string) => string;
|
|
47
|
+
};
|
|
48
|
+
readonly visualizer: {
|
|
49
|
+
readonly themes: () => string;
|
|
50
|
+
readonly theme: () => string;
|
|
51
|
+
readonly hierarchy: () => string;
|
|
52
|
+
readonly dataValues: () => string;
|
|
53
|
+
readonly datasets: () => string;
|
|
54
|
+
readonly dataElements: () => string;
|
|
55
|
+
};
|
|
56
|
+
readonly issue: {
|
|
57
|
+
readonly list: () => string;
|
|
58
|
+
};
|
|
59
|
+
readonly dataValidation: {
|
|
60
|
+
readonly dqa: {
|
|
61
|
+
readonly tables: {
|
|
62
|
+
readonly list: () => string;
|
|
63
|
+
readonly upsert: () => string;
|
|
64
|
+
readonly remove: (tableId: string) => string;
|
|
65
|
+
};
|
|
66
|
+
readonly columns: (table: string) => string;
|
|
67
|
+
readonly rules: {
|
|
68
|
+
readonly list: (tableId?: string) => string;
|
|
69
|
+
readonly upsert: () => string;
|
|
70
|
+
readonly compile: () => string;
|
|
71
|
+
readonly mapping: {
|
|
72
|
+
readonly preview: () => string;
|
|
73
|
+
readonly apply: () => string;
|
|
74
|
+
};
|
|
75
|
+
readonly remove: (tableId: string, code: string) => string;
|
|
76
|
+
};
|
|
77
|
+
readonly run: () => string;
|
|
78
|
+
readonly schedules: {
|
|
79
|
+
readonly create: () => string;
|
|
80
|
+
readonly list: (status?: string) => string;
|
|
81
|
+
readonly cancel: (scheduleId: number | string) => string;
|
|
82
|
+
};
|
|
83
|
+
readonly runs: {
|
|
84
|
+
readonly list: (tableId?: string) => string;
|
|
85
|
+
readonly flags: (runId: number | string, severity?: string) => string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly admin: {
|
|
90
|
+
readonly base: `${string}/admin`;
|
|
91
|
+
readonly users: {
|
|
92
|
+
readonly list: () => string;
|
|
93
|
+
readonly byId: (id: string) => string;
|
|
94
|
+
readonly create: () => string;
|
|
95
|
+
readonly update: (id: string) => string;
|
|
96
|
+
readonly delete: (id: string) => string;
|
|
97
|
+
readonly toggle: (id: string) => string;
|
|
98
|
+
readonly resetPassword: (id: string) => string;
|
|
99
|
+
readonly passwordResetEmail: (id: string) => string;
|
|
100
|
+
readonly import: {
|
|
101
|
+
readonly preview: () => string;
|
|
102
|
+
readonly execute: () => string;
|
|
103
|
+
readonly job: (jobId: string) => string;
|
|
104
|
+
readonly errorsCsv: (jobId: string) => string;
|
|
105
|
+
readonly templateCsv: () => string;
|
|
106
|
+
};
|
|
107
|
+
readonly clientRoles: {
|
|
108
|
+
readonly list: (userId: string, clientId: string) => string;
|
|
109
|
+
readonly update: (userId: string) => string;
|
|
110
|
+
readonly assign: (userId: string, clientId: string) => string;
|
|
111
|
+
readonly remove: (userId: string, clientId: string, role: string) => string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
readonly metrics: {
|
|
115
|
+
readonly overview: () => string;
|
|
116
|
+
readonly system: {
|
|
117
|
+
readonly countUsers: () => string;
|
|
118
|
+
readonly countDisabledUsers: () => string;
|
|
119
|
+
readonly activeToday: () => string;
|
|
120
|
+
readonly activeThisWeek: () => string;
|
|
121
|
+
readonly loginTrend: () => string;
|
|
122
|
+
readonly loginTrendRange: () => string;
|
|
123
|
+
};
|
|
124
|
+
readonly security: {
|
|
125
|
+
readonly failedLogins: () => string;
|
|
126
|
+
readonly failedLoginsRange: () => string;
|
|
127
|
+
readonly suspiciousLogins: () => string;
|
|
128
|
+
};
|
|
129
|
+
readonly clients: {
|
|
130
|
+
readonly count: () => string;
|
|
131
|
+
readonly mostAccessed: () => string;
|
|
132
|
+
readonly loginCount: () => string;
|
|
133
|
+
readonly activeToday: () => string;
|
|
134
|
+
};
|
|
135
|
+
readonly users: {
|
|
136
|
+
readonly newRange: () => string;
|
|
137
|
+
readonly newTrend: () => string;
|
|
138
|
+
readonly neverLoggedIn: () => string;
|
|
139
|
+
readonly lastLogin: (userId: string) => string;
|
|
140
|
+
readonly clientUsage: (userId: string) => string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly audit: {
|
|
144
|
+
readonly base: `${string}/admin/audit-logs`;
|
|
145
|
+
readonly list: () => string;
|
|
146
|
+
readonly actions: () => string;
|
|
147
|
+
readonly byId: (id: string) => string;
|
|
148
|
+
readonly metrics: {
|
|
149
|
+
readonly overview: () => string;
|
|
150
|
+
readonly failedLoginsByDay: () => string;
|
|
151
|
+
readonly topFailureIps: () => string;
|
|
152
|
+
};
|
|
153
|
+
readonly export: () => string;
|
|
154
|
+
};
|
|
155
|
+
readonly notifications: {
|
|
156
|
+
readonly base: `${string}/admin/notifications`;
|
|
157
|
+
readonly notify: () => string;
|
|
158
|
+
readonly list: () => string;
|
|
159
|
+
readonly byId: (id: string) => string;
|
|
160
|
+
readonly markAsRead: (id: string) => string;
|
|
161
|
+
readonly delete: (id: string) => string;
|
|
162
|
+
readonly count: () => string;
|
|
163
|
+
readonly countUnread: () => string;
|
|
164
|
+
readonly deleteOld: () => string;
|
|
165
|
+
readonly deliveries: (id: string) => string;
|
|
166
|
+
readonly deliveryList: () => string;
|
|
167
|
+
readonly deliveryMetrics: () => string;
|
|
168
|
+
readonly deliveryById: (deliveryId: string) => string;
|
|
169
|
+
readonly retryDelivery: (deliveryId: string) => string;
|
|
170
|
+
readonly cancelDelivery: (deliveryId: string) => string;
|
|
171
|
+
readonly testSms: () => string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly notifications: {
|
|
175
|
+
readonly preferences: () => string;
|
|
176
|
+
};
|
|
177
|
+
readonly health: () => string;
|
|
178
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DocumentProcessType } from "../../../../types/src/index.js";
|
|
2
|
+
export type StandardTemplateKey = "" | "district_status" | "facility_metrics" | "alerts" | "lab_results";
|
|
3
|
+
export type StandardTemplate = {
|
|
4
|
+
key: Exclude<StandardTemplateKey, "">;
|
|
5
|
+
label: string;
|
|
6
|
+
requiredHeaders: string[];
|
|
7
|
+
optionalHeaders?: string[];
|
|
8
|
+
allowedExtensions: string[];
|
|
9
|
+
suggestedProcessType?: DocumentProcessType;
|
|
10
|
+
};
|
|
11
|
+
export declare const STANDARD_TEMPLATES: StandardTemplate[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type BackendErrorCode = "CLIENT_ALREADY_EXISTS" | "USER_ALREADY_EXISTS" | "INVALID_CLIENT_ID" | "VALIDATION_FAILED" | "UNAUTHORIZED" | "FORBIDDEN" | "CLIENT_DISABLED" | "USER_DISABLED" | "RATE_LIMITED" | "INTERNAL_ERROR";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./types/announcement-summary.types";
|
|
2
|
+
export * from "./types/client-role.types";
|
|
3
|
+
export * from "./types/client.types";
|
|
4
|
+
export * from "./types/document-processing.types";
|
|
5
|
+
export * from "./types/notifications.types";
|
|
6
|
+
export * from "./types/system-navigation.types";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type AnnouncementLevel = "INFO" | "SUCCESS" | "WARNING" | "CRITICAL";
|
|
2
|
+
export type AnnouncementStatus = "DRAFT" | "SCHEDULED" | "PUBLISHED" | "ARCHIVED";
|
|
3
|
+
export type Announcement = {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
summary: string | null;
|
|
8
|
+
level: AnnouncementLevel;
|
|
9
|
+
tag: string | null;
|
|
10
|
+
link_url?: string | null;
|
|
11
|
+
link_label?: string | null;
|
|
12
|
+
status: AnnouncementStatus;
|
|
13
|
+
publish_at: string | null;
|
|
14
|
+
expires_at: string | null;
|
|
15
|
+
is_pinned?: boolean;
|
|
16
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ClientRole } from "./client-role.types";
|
|
2
|
+
export interface Client {
|
|
3
|
+
id: string;
|
|
4
|
+
clientId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
publicClient: boolean;
|
|
10
|
+
rootUrl?: string;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
redirectUris: string[];
|
|
13
|
+
webOrigins?: string[];
|
|
14
|
+
roles?: ClientRole[];
|
|
15
|
+
attributes?: ClientAttributes;
|
|
16
|
+
createdAt?: string;
|
|
17
|
+
updatedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ClientAttributes = Record<string, string | undefined>;
|
|
20
|
+
export interface CreateClientPayload {
|
|
21
|
+
clientId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
publicClient?: boolean;
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
rootUrl?: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
redirectUris?: string[];
|
|
30
|
+
webOrigins?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface UpdateClientPayload {
|
|
33
|
+
name?: string;
|
|
34
|
+
description?: string;
|
|
35
|
+
icon?: string;
|
|
36
|
+
publicClient?: boolean;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
rootUrl?: string;
|
|
39
|
+
baseUrl?: string;
|
|
40
|
+
redirectUris?: string[];
|
|
41
|
+
webOrigins?: string[];
|
|
42
|
+
}
|
|
43
|
+
export type ClientsState = {
|
|
44
|
+
items: Client[];
|
|
45
|
+
activeClientId: string | null;
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DocumentProcessType = "SURVEILLANCE_CSV_IMPORT" | "CSV_IMPORT" | "EXCEL_IMPORT" | "FHIR_IMPORT" | "USER_BULK_IMPORT" | "SURVEILLANCE_EXCEL_IMPORT" | "FACILITY_IMPORT" | "LAB_RESULT_IMPORT" | "INVENTORY_IMPORT" | "HISTORICAL_BACKFILL_IMPORT" | "DRY_RUN_IMPORT" | "ETL_IMPORT" | "ARCHIVE_IMPORT" | "IMAGE_PROCESSING" | "DOCUMENT_EXTRACTION" | "NO_OP_UPLOAD";
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Severity } from "../../../ui/src/index.js";
|
|
2
|
+
export type Notification = {
|
|
3
|
+
id: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
title: string;
|
|
6
|
+
message: string;
|
|
7
|
+
severity: Severity;
|
|
8
|
+
target_role?: string;
|
|
9
|
+
client_id?: string;
|
|
10
|
+
user_id?: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
created_at: string;
|
|
13
|
+
read: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type GetNotificationsParams = {
|
|
16
|
+
unread?: boolean;
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
};
|
|
20
|
+
export type NotificationDeliveryStatus = "PENDING" | "PROCESSING" | "SENT" | "FAILED" | "RETRY" | "CANCELLED";
|
|
21
|
+
export type NotificationDelivery = {
|
|
22
|
+
id: string;
|
|
23
|
+
notification_id: string;
|
|
24
|
+
channel: string;
|
|
25
|
+
status: NotificationDeliveryStatus | string;
|
|
26
|
+
recipient?: Record<string, unknown>;
|
|
27
|
+
template_name?: string;
|
|
28
|
+
template_data?: Record<string, unknown>;
|
|
29
|
+
payload?: Record<string, unknown>;
|
|
30
|
+
scheduled_at?: string;
|
|
31
|
+
locked_at?: string;
|
|
32
|
+
sent_at?: string;
|
|
33
|
+
attempts: number;
|
|
34
|
+
max_attempts: number;
|
|
35
|
+
last_error?: string;
|
|
36
|
+
provider?: string;
|
|
37
|
+
provider_message_id?: string;
|
|
38
|
+
provider_status?: string;
|
|
39
|
+
provider_metadata?: Record<string, unknown>;
|
|
40
|
+
created_at: string;
|
|
41
|
+
updated_at: string;
|
|
42
|
+
};
|
|
43
|
+
export type NotificationDeliveryListParams = {
|
|
44
|
+
channel?: "in_app" | "email" | "sms" | "webhook" | string;
|
|
45
|
+
status?: NotificationDeliveryStatus | string;
|
|
46
|
+
search?: string;
|
|
47
|
+
limit?: number;
|
|
48
|
+
offset?: number;
|
|
49
|
+
};
|
|
50
|
+
export type NotificationDeliveryList = {
|
|
51
|
+
items: NotificationDelivery[];
|
|
52
|
+
total: number;
|
|
53
|
+
limit: number;
|
|
54
|
+
offset: number;
|
|
55
|
+
};
|
|
56
|
+
export type NotificationDeliveryMetric = {
|
|
57
|
+
channel: string;
|
|
58
|
+
provider?: string;
|
|
59
|
+
total: number;
|
|
60
|
+
pending: number;
|
|
61
|
+
processing: number;
|
|
62
|
+
sent: number;
|
|
63
|
+
failed: number;
|
|
64
|
+
retry: number;
|
|
65
|
+
cancelled: number;
|
|
66
|
+
avg_processing_seconds: number;
|
|
67
|
+
};
|
|
68
|
+
export type NotificationDeliveryMetrics = {
|
|
69
|
+
items: NotificationDeliveryMetric[];
|
|
70
|
+
};
|
|
71
|
+
export type TestSMSRequest = {
|
|
72
|
+
to: string;
|
|
73
|
+
message: string;
|
|
74
|
+
};
|
|
75
|
+
export type TestSMSResponse = {
|
|
76
|
+
notification_id: string;
|
|
77
|
+
status: string;
|
|
78
|
+
};
|
|
79
|
+
export type NotificationPreferences = {
|
|
80
|
+
user_id: string;
|
|
81
|
+
email_enabled: boolean;
|
|
82
|
+
sms_enabled: boolean;
|
|
83
|
+
phone_number?: string;
|
|
84
|
+
phone_verified: boolean;
|
|
85
|
+
quiet_hours_start?: string;
|
|
86
|
+
quiet_hours_end?: string;
|
|
87
|
+
created_at?: string;
|
|
88
|
+
updated_at?: string;
|
|
89
|
+
};
|
|
90
|
+
export type UpdateNotificationPreferencesRequest = {
|
|
91
|
+
email_enabled?: boolean;
|
|
92
|
+
sms_enabled?: boolean;
|
|
93
|
+
phone_number?: string;
|
|
94
|
+
quiet_hours_start?: string;
|
|
95
|
+
quiet_hours_end?: string;
|
|
96
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type NavigationLaunchMode = "internal" | "new_tab" | "same_tab";
|
|
2
|
+
export interface SystemNavigationItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
permission?: string;
|
|
7
|
+
requiredPermissions?: string[];
|
|
8
|
+
requiredAnyPermissions?: string[];
|
|
9
|
+
order?: number;
|
|
10
|
+
icon?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
/** Optional launcher category; otherwise inherits the system category. */
|
|
13
|
+
category?: string;
|
|
14
|
+
displayInLauncher?: boolean;
|
|
15
|
+
displayInSideNav?: boolean;
|
|
16
|
+
launchMode?: NavigationLaunchMode;
|
|
17
|
+
children?: SystemNavigationItem[];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useFocusTrap } from "./useFocusTrap";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
type FocusTrapOptions = {
|
|
3
|
+
active: boolean;
|
|
4
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
5
|
+
restoreFocus?: boolean;
|
|
6
|
+
initialFocusRef?: RefObject<HTMLElement | HTMLButtonElement | null>;
|
|
7
|
+
initialFocusSelector?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function useFocusTrap({ active, containerRef, restoreFocus, initialFocusRef, initialFocusSelector, }: FocusTrapOptions): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type FooterVersionInfo = {
|
|
2
|
+
frontendVersion?: string;
|
|
3
|
+
backendVersion?: string;
|
|
4
|
+
backendUnavailable?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function PublicFooter({ frontendVersion, backendVersion, backendUnavailable, }?: FooterVersionInfo): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type DataTablePaginationProps = {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
totalItems: number;
|
|
5
|
+
pageSizes?: number[];
|
|
6
|
+
onChange: (pagination: {
|
|
7
|
+
page: number;
|
|
8
|
+
pageSize: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function DataTablePagination({ page, pageSize, totalItems, pageSizes, onChange, }: DataTablePaginationProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type DataTableHeader = {
|
|
3
|
+
key: string;
|
|
4
|
+
header: string;
|
|
5
|
+
};
|
|
6
|
+
type DataTableShellProps<T> = {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
rows: T[];
|
|
10
|
+
headers: DataTableHeader[];
|
|
11
|
+
getRowId: (row: T) => string;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
isFetching?: boolean;
|
|
14
|
+
loadingDescription?: string;
|
|
15
|
+
tableState?: ReactNode;
|
|
16
|
+
emptyTitle?: string;
|
|
17
|
+
emptyDescription?: string;
|
|
18
|
+
emptyActions?: ReactNode;
|
|
19
|
+
searchValue?: string;
|
|
20
|
+
resultsDescription?: string;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
onSearch?: (value: string) => void;
|
|
23
|
+
toolbarActions?: ReactNode;
|
|
24
|
+
topContent?: ReactNode;
|
|
25
|
+
filters?: ReactNode;
|
|
26
|
+
bulkActions?: ReactNode;
|
|
27
|
+
children: (args: {
|
|
28
|
+
rows: Array<T & {
|
|
29
|
+
id: string;
|
|
30
|
+
}>;
|
|
31
|
+
headers: DataTableHeader[];
|
|
32
|
+
}) => ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export declare function DataTableShell<T extends object>({ title, description, rows, headers, getRowId, isLoading, isFetching, searchValue, searchPlaceholder, onSearch, resultsDescription, toolbarActions, loadingDescription, tableState, emptyTitle, emptyDescription, emptyActions, filters, topContent, bulkActions, children, }: DataTableShellProps<T>): import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type TableEmptyStateProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function TableEmptyState({ title, description, actions }: TableEmptyStateProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type TagKind = "red" | "magenta" | "purple" | "blue" | "cyan" | "teal" | "green" | "gray" | "cool-gray" | "warm-gray" | "high-contrast" | "outline";
|
|
2
|
+
type TableStatusTagProps = {
|
|
3
|
+
status: string;
|
|
4
|
+
kind?: TagKind;
|
|
5
|
+
mapStatusToKind?: (status: string) => TagKind;
|
|
6
|
+
};
|
|
7
|
+
export declare function TableStatusTag({ status, kind, mapStatusToKind }: TableStatusTagProps): import("react").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DataTableShell, type DataTableHeader } from "./DataTableShell";
|
|
2
|
+
export { DataTablePagination } from "./DataTablePagination";
|
|
3
|
+
export { RowActionsCell } from "./RowActionsCell";
|
|
4
|
+
export { TableEmptyState } from "./TableEmptyState";
|
|
5
|
+
export { TableStatusTag } from "./TableStatusTag";
|