@moh-sso/e-services 0.0.0-stage → 1.3.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 (118) hide show
  1. package/README.md +24 -2
  2. package/dist/_types/apps/e-services/src/components/eservice-empty-state.component.d.ts +8 -0
  3. package/dist/_types/apps/e-services/src/components/eservice-page-shell.component.d.ts +10 -0
  4. package/dist/_types/apps/e-services/src/index.d.ts +2 -0
  5. package/dist/_types/apps/e-services/src/pages/action-tracker.page.d.ts +1 -0
  6. package/dist/_types/apps/e-services/src/pages/activity-reporting.page.d.ts +1 -0
  7. package/dist/_types/apps/e-services/src/pages/budget-tracker.page.d.ts +1 -0
  8. package/dist/_types/apps/e-services/src/pages/clinician-outputs.page.d.ts +1 -0
  9. package/dist/_types/apps/e-services/src/pages/leave-absence-management.page.d.ts +1 -0
  10. package/dist/_types/apps/e-services/src/pages/meeting-manager.page.d.ts +1 -0
  11. package/dist/_types/apps/e-services/src/pages/workplans.page.d.ts +1 -0
  12. package/dist/_types/apps/e-services/src/root.component.d.ts +2 -0
  13. package/dist/_types/apps/e-services/src/routes.d.ts +2 -0
  14. package/dist/_types/apps/e-services/src/single-spa.d.ts +1 -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/assets/e-services-DSyYLmlE.css +1 -0
  107. package/dist/assets/root.component-CP4U4iq0.js +242 -0
  108. package/dist/assets/root.component-CP4U4iq0.js.map +1 -0
  109. package/dist/index.d.ts +1 -0
  110. package/dist/index.js +30 -0
  111. package/dist/index.js.map +1 -0
  112. package/dist/routes.d.ts +1 -0
  113. package/dist/routes.js +32 -0
  114. package/dist/routes.js.map +1 -0
  115. package/dist/single-spa.d.ts +1 -0
  116. package/dist/single-spa.js +32 -0
  117. package/dist/single-spa.js.map +1 -0
  118. package/package.json +52 -4
@@ -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,2 @@
1
+ export declare function currentPortalReturnTo(): string;
2
+ export declare function buildLoginURL(loginURL: string, returnTo?: string): string;
@@ -0,0 +1,58 @@
1
+ export declare const PERMISSIONS: {
2
+ readonly portalAccess: "portal:access";
3
+ readonly systemsRead: "systems:read";
4
+ readonly systemsLaunch: "systems:launch";
5
+ readonly usersRead: "users:read";
6
+ readonly usersWrite: "users:write";
7
+ readonly usersRolesWrite: "users:roles:write";
8
+ readonly clientsRead: "clients:read";
9
+ readonly clientsWrite: "clients:write";
10
+ readonly clientsRolesWrite: "clients:roles:write";
11
+ readonly announcementsRead: "announcements:read";
12
+ readonly announcementsWrite: "announcements:write";
13
+ readonly announcementsPublish: "announcements:publish";
14
+ readonly documentsRead: "documents:read";
15
+ readonly documentsWrite: "documents:write";
16
+ readonly documentsProcess: "documents:process";
17
+ readonly documentTemplatesRead: "document_templates:read";
18
+ readonly documentTemplatesWrite: "document_templates:write";
19
+ readonly documentTemplatesPublish: "document_templates:publish";
20
+ readonly surveillanceRead: "surveillance:read";
21
+ readonly surveillanceImport: "surveillance:import";
22
+ readonly surveillanceManageLocations: "surveillance:manage_locations";
23
+ readonly surveillanceManageAlerts: "surveillance:manage_alerts";
24
+ readonly emailRead: "email:read";
25
+ readonly emailSend: "email:send";
26
+ readonly emailManage: "email:manage";
27
+ readonly storageLocationsRead: "storage_locations:read";
28
+ readonly storageLocationsWrite: "storage_locations:write";
29
+ readonly dataQualityRead: "data_quality:read";
30
+ readonly dataQualityWrite: "data_quality:write";
31
+ readonly dataQualityResolve: "data_quality:resolve";
32
+ readonly reportBrowserRead: "report_browser:read";
33
+ readonly reportSchedulerRead: "report_scheduler:read";
34
+ readonly reportSchedulerCreate: "report_scheduler:create";
35
+ readonly reportSchedulerUpdate: "report_scheduler:update";
36
+ readonly reportSchedulerDelete: "report_scheduler:delete";
37
+ readonly reportSchedulerExecute: "report_scheduler:execute";
38
+ readonly reportSchedulerHistory: "report_scheduler:history";
39
+ readonly reportSchedulerManage: "report_scheduler:manage";
40
+ readonly outbreakAccess: "outbreak:access";
41
+ readonly outbreakManage: "outbreak:manage";
42
+ readonly metricsRead: "metrics:read";
43
+ readonly auditRead: "audit:read";
44
+ readonly notificationsRead: "notifications:read";
45
+ readonly notificationsWrite: "notifications:write";
46
+ readonly rbacRead: "rbac:read";
47
+ readonly rbacWrite: "rbac:write";
48
+ readonly rbacRolesWrite: "rbac:roles:write";
49
+ readonly rbacPermissionsWrite: "rbac:permissions:write";
50
+ readonly issueTrackerResolve: "issue_tracker:resolve";
51
+ readonly issueTrackerRead: "issue_tracker:read";
52
+ readonly issueTrackerWrite: "issue_tracker:write";
53
+ readonly issueTrackerManage: "issue_tracker:manage";
54
+ readonly issueTrackerAssign: "issue_tracker:assign";
55
+ readonly issueTrackerClose: "issue_tracker:close";
56
+ readonly issueTrackerReopen: "issue_tracker:reopen";
57
+ readonly issueTrackerComment: "issue_tracker:comment";
58
+ };
@@ -0,0 +1,8 @@
1
+ import type { AuthUser, Permission, System, SystemAccess } from "./auth.types";
2
+ export declare function hasPermission(user: AuthUser | null | undefined, permission: Permission): boolean;
3
+ export declare function hasAnyPermission(user: AuthUser | null | undefined, permissions: Permission[]): boolean;
4
+ export declare function hasAllPermissions(user: AuthUser | null | undefined, permissions: Permission[]): boolean;
5
+ export declare function hasSystem(user: AuthUser | null | undefined, systemClientId: System | string): boolean;
6
+ export declare function hasSystemRole(user: AuthUser | null | undefined, systemClientId: System | string, role: string): boolean;
7
+ export declare function canLaunchSystem(user: AuthUser | null | undefined, systemClientId: System | string): boolean;
8
+ export declare function getAccessibleSystems(user: AuthUser | null | undefined): SystemAccess[];
@@ -0,0 +1,9 @@
1
+ export type LaunchableSystem = {
2
+ launchUrl?: string;
3
+ authenticatedLaunchUrl?: string;
4
+ };
5
+ export type SystemLaunchRuntime = {
6
+ apiBaseUrl: string;
7
+ hasPortalSession: boolean;
8
+ };
9
+ export declare function resolveSystemLaunchUrl(system: LaunchableSystem, runtime: SystemLaunchRuntime): string;
@@ -0,0 +1,14 @@
1
+ import type { Permission, System } from "./auth.types";
2
+ export declare function useAuthorization(): {
3
+ can: (permission: Permission) => boolean;
4
+ canAny: (requiredPermissions: Permission[]) => boolean;
5
+ canAll: (requiredPermissions: Permission[]) => boolean;
6
+ hasRealmRole: (role: string) => boolean;
7
+ hasClientRole: (clientId: string, role: string) => boolean;
8
+ hasSystem: (system: System | string) => boolean;
9
+ hasSystemRole: (system: System | string, role: string) => boolean;
10
+ canLaunchSystem: (system: System | string) => boolean;
11
+ permissions: Permission[];
12
+ systems: string[];
13
+ accessibleSystems: import("./auth.types").SystemAccess[];
14
+ };
@@ -0,0 +1,14 @@
1
+ export { default as AuthBootstrap } from "./auth/AuthBootstrap";
2
+ export * from "./api/auth.api";
3
+ export * from "./api/health-context.api";
4
+ export { default as authReducer } from "./auth/auth.slice";
5
+ export * from "./auth/auth.selectors";
6
+ export * from "./auth/auth.slice";
7
+ export * from "./auth/auth.types";
8
+ export * from "./auth/PermissionGuard";
9
+ export * from "./auth/permissions";
10
+ export * from "./auth/rbac";
11
+ export * from "./auth/useAuthorization";
12
+ export * from "./auth/login-url";
13
+ export * from "./auth/system-launch-url";
14
+ export * from "./auth/HealthContextProvider";
@@ -0,0 +1,3 @@
1
+ export declare const APP_ENV: any;
2
+ export declare const APP_VERSION: any;
3
+ export declare const BUILD_TIME: any;
@@ -0,0 +1,6 @@
1
+ export * from "./appMeta";
2
+ export * from "./lib/constants/api.constants";
3
+ export * from "./lib/constants/document-templates";
4
+ export * from "./lib/errors/errorMessages";
5
+ export * from "./lib/errors/errorSeverity";
6
+ export * from "./lib/errors/errorTypes";
@@ -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,2 @@
1
+ import type { BackendErrorCode } from "./errorTypes";
2
+ export declare function mapErrorToMessage(code?: BackendErrorCode, fallback?: string): string;
@@ -0,0 +1,3 @@
1
+ import type { BackendErrorCode } from "./errorTypes";
2
+ export type ToastSeverity = "error" | "warning" | "info";
3
+ export declare function mapErrorToSeverity(code?: BackendErrorCode): ToastSeverity;
@@ -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 @@
1
+ export declare function resolveRuntimeBasename(basename: string, deploymentBase?: string): string;
@@ -0,0 +1,6 @@
1
+ export type { AppEvent, EventBus, MicrofrontendMountProps, MicrofrontendRuntimeProps, } from "./props";
2
+ export type { MicrofrontendLifecycle } from "./lifecycle";
3
+ export type { MicrofrontendRoute } from "./routes";
4
+ export { resolveRuntimeBasename } from "./basename";
5
+ export { createReactMicrofrontendLifecycle } from "./react-lifecycle";
6
+ export { MICROFRONTEND_NAVIGATION_EVENT, notifyMicrofrontendNavigation } from "./navigation";
@@ -0,0 +1,6 @@
1
+ import type { MicrofrontendMountProps } from "./props";
2
+ export type MicrofrontendLifecycle = {
3
+ bootstrap: (props: MicrofrontendMountProps) => Promise<void> | void;
4
+ mount: (props: MicrofrontendMountProps) => Promise<void> | void;
5
+ unmount: (props: MicrofrontendMountProps) => Promise<void> | void;
6
+ };
@@ -0,0 +1,2 @@
1
+ export declare const MICROFRONTEND_NAVIGATION_EVENT = "moh-sso:navigation";
2
+ export declare function notifyMicrofrontendNavigation(): void;
@@ -0,0 +1,44 @@
1
+ export type AppEvent = {
2
+ type: string;
3
+ source: string;
4
+ payload?: unknown;
5
+ };
6
+ export type EventBus = {
7
+ publish: (event: AppEvent) => void;
8
+ subscribe: (type: string, handler: (event: AppEvent) => void) => () => void;
9
+ };
10
+ export type MicrofrontendRuntimeProps = {
11
+ basename: string;
12
+ auth?: {
13
+ isAuthenticated: boolean;
14
+ user?: unknown;
15
+ };
16
+ apiBaseUrl?: string;
17
+ eventBus?: EventBus;
18
+ healthContext?: {
19
+ activeContext?: {
20
+ id: string;
21
+ code: string;
22
+ name: string;
23
+ contextType: string;
24
+ };
25
+ contexts: Array<{
26
+ id: string;
27
+ code: string;
28
+ name: string;
29
+ contextType: string;
30
+ scopeMode: string;
31
+ assignmentType: string;
32
+ }>;
33
+ selectContext?: (contextId: string) => Promise<void>;
34
+ };
35
+ };
36
+ export type MicrofrontendMountProps = MicrofrontendRuntimeProps & {
37
+ domElement: HTMLElement;
38
+ };
39
+ declare global {
40
+ interface Window {
41
+ __MOH_SSO_AUTH__?: MicrofrontendRuntimeProps["auth"];
42
+ __MOH_SSO_HEALTH_CONTEXT__?: MicrofrontendRuntimeProps["healthContext"];
43
+ }
44
+ }
@@ -0,0 +1,11 @@
1
+ import type { ComponentType } from "react";
2
+ import type { MicrofrontendLifecycle } from "./lifecycle";
3
+ import type { MicrofrontendRuntimeProps } from "./props";
4
+ type ReactLifecycleOptions = {
5
+ withRedux?: boolean;
6
+ withModal?: boolean;
7
+ withToast?: boolean;
8
+ withHeaderPanel?: boolean;
9
+ };
10
+ export declare function createReactMicrofrontendLifecycle(RootComponent: ComponentType<MicrofrontendRuntimeProps>, lifecycleOptions?: ReactLifecycleOptions): MicrofrontendLifecycle;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ export type MicrofrontendRoute = {
2
+ appName: string;
3
+ path: string;
4
+ paths?: string[];
5
+ excludedPaths?: string[];
6
+ requiredPermissions?: string[];
7
+ requiredAnyPermissions?: string[];
8
+ requiredSystems?: string[];
9
+ requiredSystemRoles?: Array<{
10
+ system: string;
11
+ role: string;
12
+ }>;
13
+ };