@jmruthers/pace-core 0.5.73 → 0.5.75
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/dist/{DataTable-INW5YIFV.js → DataTable-HWZQGASI.js} +8 -8
- package/dist/{PublicLoadingSpinner-DLpF5bbs.d.ts → PublicLoadingSpinner-BKNBT6b6.d.ts} +2 -2
- package/dist/RBACService-C4udt_Zp.d.ts +528 -0
- package/dist/{UnifiedAuthProvider-6SYT5WFN.js → UnifiedAuthProvider-3NKDOSOK.js} +6 -4
- package/dist/UnifiedAuthProvider-Bj6YCf7c.d.ts +113 -0
- package/dist/{chunk-2PRPDH66.js → chunk-2CHATWBF.js} +5 -7
- package/dist/chunk-2CHATWBF.js.map +1 -0
- package/dist/{chunk-43C63KLH.js → chunk-2DFZ432F.js} +496 -30
- package/dist/chunk-2DFZ432F.js.map +1 -0
- package/dist/{chunk-M4UMXYNK.js → chunk-33PHABLB.js} +36 -3
- package/dist/chunk-33PHABLB.js.map +1 -0
- package/dist/chunk-5F3NDPJV.js +232 -0
- package/dist/chunk-5F3NDPJV.js.map +1 -0
- package/dist/chunk-A4FUBC7B.js +17 -0
- package/dist/chunk-A4FUBC7B.js.map +1 -0
- package/dist/{chunk-SMJZMKYN.js → chunk-A6HBIY5P.js} +2 -11
- package/dist/{chunk-SMJZMKYN.js.map → chunk-A6HBIY5P.js.map} +1 -1
- package/dist/{chunk-GBC5PC3N.js → chunk-CY3AHGO4.js} +6256 -1937
- package/dist/chunk-CY3AHGO4.js.map +1 -0
- package/dist/{chunk-BYG6OSTC.js → chunk-DAXLNIDY.js} +48 -50
- package/dist/chunk-DAXLNIDY.js.map +1 -0
- package/dist/{chunk-VKOCWWVY.js → chunk-L3RV2ALE.js} +1 -6
- package/dist/{chunk-VKOCWWVY.js.map → chunk-L3RV2ALE.js.map} +1 -1
- package/dist/chunk-LW7MMEAQ.js +59 -0
- package/dist/chunk-LW7MMEAQ.js.map +1 -0
- package/dist/{chunk-LANO5IFV.js → chunk-NTNILOBC.js} +7 -9
- package/dist/chunk-NTNILOBC.js.map +1 -0
- package/dist/chunk-PYUXFQJ3.js +11 -0
- package/dist/chunk-PYUXFQJ3.js.map +1 -0
- package/dist/chunk-URUTVZ7N.js +27 -0
- package/dist/chunk-URUTVZ7N.js.map +1 -0
- package/dist/chunk-WN6XJWOS.js +2468 -0
- package/dist/chunk-WN6XJWOS.js.map +1 -0
- package/dist/{chunk-3SP4P7NS.js → chunk-XLZ7U46Z.js} +59 -1
- package/dist/chunk-XLZ7U46Z.js.map +1 -0
- package/dist/{chunk-UC2BWIK7.js → chunk-ZTT2AXMX.js} +9 -14
- package/dist/chunk-ZTT2AXMX.js.map +1 -0
- package/dist/components.d.ts +4 -5
- package/dist/components.js +32 -39
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +9 -8
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +156 -10
- package/dist/index.js +188 -93
- package/dist/index.js.map +1 -1
- package/dist/{organisation-t-vvQC3g.d.ts → organisation-BtshODVF.d.ts} +4 -3
- package/dist/providers.d.ts +27 -38
- package/dist/providers.js +33 -23
- package/dist/rbac/index.d.ts +61 -5
- package/dist/rbac/index.js +13 -14
- package/dist/styles/index.js +2 -2
- package/dist/theming/runtime.js +1 -3
- package/dist/types.d.ts +3 -3
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/{unified-CMPjE_fv.d.ts → unified-CM7T0aTK.d.ts} +1 -1
- package/dist/useInactivityTracker-MRUU55XI.js +10 -0
- package/dist/useInactivityTracker-MRUU55XI.js.map +1 -0
- package/dist/{usePublicRouteParams-Ua1Vz-HG.d.ts → usePublicRouteParams-B-CumWRc.d.ts} +3 -3
- package/dist/utils.js +7 -9
- package/dist/utils.js.map +1 -1
- package/dist/validation.d.ts +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +3 -3
- package/docs/api/interfaces/CardProps.md +2 -2
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +2 -2
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +2 -2
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +28 -17
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +2 -2
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +2 -2
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACContextType.md +5 -11
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +524 -440
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +14 -14
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +179 -52
- package/docs/architecture/services.md +30 -32
- package/docs/breaking-changes.md +2 -5
- package/docs/implementation-guides/data-tables.md +82 -1
- package/docs/migration/service-architecture.md +121 -260
- package/docs/rbac/README-rbac-rls-integration.md +48 -38
- package/{src/rbac/examples → examples/RBAC}/CompleteRBACExample.tsx +3 -2
- package/{src/rbac/examples → examples/RBAC}/EventBasedApp.tsx +5 -4
- package/{src/components/examples → examples/RBAC}/PermissionExample.tsx +7 -6
- package/examples/RBAC/__tests__/PermissionExample.test.tsx +150 -0
- package/examples/RBAC/index.ts +13 -0
- package/examples/README.md +37 -0
- package/examples/index.ts +22 -0
- package/{src/examples → examples/public-pages}/CorrectPublicPageImplementation.tsx +1 -1
- package/{src/examples → examples/public-pages}/PublicEventPage.tsx +1 -1
- package/{src/examples → examples/public-pages}/PublicPageApp.tsx +1 -1
- package/{src/examples → examples/public-pages}/PublicPageUsageExample.tsx +1 -1
- package/examples/public-pages/__tests__/PublicPageUsageExample.test.tsx +159 -0
- package/examples/public-pages/index.ts +14 -0
- package/package.json +22 -18
- package/src/__tests__/TEST_GUIDE_CURSOR.md +650 -9
- package/src/__tests__/helpers/README.md +255 -0
- package/src/__tests__/helpers/index.ts +62 -0
- package/src/__tests__/helpers/supabaseMock.ts +27 -3
- package/src/__tests__/rbac/PagePermissionGuard.test.tsx +6 -8
- package/src/components/DataTable/components/DataTableCore.tsx +37 -3
- package/src/components/DataTable/components/__tests__/COVERAGE_NOTE.md +55 -0
- package/src/components/DataTable/core/ColumnManager.ts +10 -0
- package/src/components/DataTable/core/__tests__/ColumnFactory.test.ts +254 -0
- package/src/components/DataTable/core/__tests__/ColumnManager.test.ts +193 -0
- package/src/components/DataTable/examples/__tests__/HierarchicalExample.test.tsx +45 -0
- package/src/components/DataTable/examples/__tests__/PerformanceExample.test.tsx +117 -0
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/Dialog/examples/__tests__/HtmlDialogExample.test.tsx +71 -0
- package/src/components/Dialog/examples/__tests__/SimpleHtmlTest.test.tsx +122 -0
- package/src/components/EventSelector/EventSelector.tsx +1 -1
- package/src/components/Header/Header.test.tsx +35 -1
- package/src/components/Header/Header.tsx +3 -1
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +3 -3
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.rbac.test.tsx +24 -4
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +3 -2
- package/src/components/Toast/Toast.test.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/hooks/__tests__/useFocusManagement.unit.test.ts +220 -0
- package/src/hooks/__tests__/useIsMobile.unit.test.ts +117 -0
- package/src/hooks/__tests__/useKeyboardShortcuts.unit.test.ts +295 -0
- package/src/hooks/__tests__/useOrganisationSecurity.unit.test.tsx +29 -19
- package/src/hooks/__tests__/useRBAC.unit.test.ts +7 -3
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +115 -19
- package/src/hooks/useEventTheme.test.ts +350 -0
- package/src/hooks/useEventTheme.ts +1 -1
- package/src/hooks/useEvents.ts +61 -0
- package/src/hooks/useOrganisationSecurity.test.ts +4 -4
- package/src/hooks/useOrganisationSecurity.ts +2 -2
- package/src/hooks/useOrganisations.ts +64 -0
- package/src/hooks/useSecureDataAccess.test.ts +9 -5
- package/src/hooks/useSecureDataAccess.ts +2 -2
- package/src/index.ts +18 -3
- package/src/providers/AuthProvider.tsx +8 -292
- package/src/providers/EventProvider.tsx +15 -425
- package/src/providers/InactivityProvider.tsx +8 -231
- package/src/providers/OrganisationProvider.test.simple.tsx +3 -2
- package/src/providers/OrganisationProvider.tsx +11 -890
- package/src/providers/UnifiedAuthProvider.tsx +8 -320
- package/src/providers/__tests__/AuthProvider.test.tsx +18 -17
- package/src/providers/__tests__/EventProvider.test.tsx +253 -2
- package/src/providers/__tests__/InactivityProvider.test-helper.tsx +65 -0
- package/src/providers/__tests__/InactivityProvider.test.tsx +46 -114
- package/src/providers/__tests__/OrganisationProvider.test.tsx +313 -3
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx +383 -2
- package/src/providers/index.ts +8 -7
- package/src/providers/services/EventServiceProvider.tsx +3 -0
- package/src/providers/services/UnifiedAuthProvider.tsx +3 -0
- package/src/rbac/hooks/usePermissions.test.ts +296 -0
- package/src/rbac/hooks/useRBAC.test.ts +9 -5
- package/src/rbac/hooks/useRBAC.ts +3 -3
- package/src/rbac/providers/__tests__/RBACProvider.integration.test.tsx +688 -0
- package/src/rbac/providers/__tests__/RBACProvider.test.tsx +507 -0
- package/src/services/AuthService.ts +19 -4
- package/src/services/__tests__/AuthService.test.ts +288 -0
- package/src/styles/core.css +2 -0
- package/src/types/__tests__/guards.test.ts +246 -0
- package/src/types/guards.ts +1 -0
- package/src/types/organisation.ts +3 -2
- package/src/validation/__tests__/sanitization.unit.test.ts +250 -0
- package/src/validation/__tests__/schemaUtils.unit.test.ts +451 -0
- package/src/validation/__tests__/user.unit.test.ts +440 -0
- package/dist/RBACProvider-BO4ilsQB.d.ts +0 -63
- package/dist/UnifiedAuthProvider-D02AMXgO.d.ts +0 -103
- package/dist/chunk-2PRPDH66.js.map +0 -1
- package/dist/chunk-3SP4P7NS.js.map +0 -1
- package/dist/chunk-43C63KLH.js.map +0 -1
- package/dist/chunk-5A4RL4BC.js +0 -5670
- package/dist/chunk-5A4RL4BC.js.map +0 -1
- package/dist/chunk-BYG6OSTC.js.map +0 -1
- package/dist/chunk-CDDYJCYU.js +0 -79
- package/dist/chunk-CDDYJCYU.js.map +0 -1
- package/dist/chunk-F24P24TZ.js +0 -17
- package/dist/chunk-F24P24TZ.js.map +0 -1
- package/dist/chunk-GBC5PC3N.js.map +0 -1
- package/dist/chunk-LANO5IFV.js.map +0 -1
- package/dist/chunk-M4UMXYNK.js.map +0 -1
- package/dist/chunk-RJNE764D.js +0 -953
- package/dist/chunk-RJNE764D.js.map +0 -1
- package/dist/chunk-UC2BWIK7.js.map +0 -1
- package/dist/rbac/cli/policy-manager.js +0 -278
- package/dist/rbac/cli/policy-manager.js.map +0 -1
- package/docs/api/interfaces/EventContextType.md +0 -96
- package/docs/api/interfaces/EventProviderProps.md +0 -19
- package/src/providers/OrganisationProvider.test.tsx +0 -164
- package/src/providers/UnifiedAuthProvider.test.tsx +0 -124
- package/src/providers/__tests__/AuthProvider.test.tsx.backup +0 -771
- package/src/providers/__tests__/EventProvider.test.tsx.backup +0 -824
- package/src/providers/__tests__/OrganisationProvider.test.tsx.backup +0 -820
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup +0 -911
- package/src/providers/__tests__/UnifiedAuthProvider.test.tsx.backup2 +0 -166
- package/src/rbac/cli/__tests__/policy-manager.test.ts +0 -339
- package/src/rbac/cli/policy-manager.ts +0 -443
- package/dist/{DataTable-INW5YIFV.js.map → DataTable-HWZQGASI.js.map} +0 -0
- package/dist/{UnifiedAuthProvider-6SYT5WFN.js.map → UnifiedAuthProvider-3NKDOSOK.js.map} +0 -0
- package/dist/{validation-PM_iOaTI.d.ts → validation-D8VcbTzC.d.ts} +2 -2
- /package/src/utils/{appNameResolver.test.ts.backup → appNameResolver.test 2.ts} +0 -0
|
@@ -32,8 +32,8 @@ import {
|
|
|
32
32
|
useDataTableContext,
|
|
33
33
|
usePluginRegistry,
|
|
34
34
|
useStateManager
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-CY3AHGO4.js";
|
|
36
|
+
import "./chunk-2CHATWBF.js";
|
|
37
37
|
import "./chunk-FGMFQSHX.js";
|
|
38
38
|
import "./chunk-B2WTCLCV.js";
|
|
39
39
|
import {
|
|
@@ -47,13 +47,13 @@ import {
|
|
|
47
47
|
throttle,
|
|
48
48
|
useDataTablePerformance
|
|
49
49
|
} from "./chunk-YNUBMSMV.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-LW7MMEAQ.js";
|
|
51
|
+
import "./chunk-URUTVZ7N.js";
|
|
52
|
+
import "./chunk-WN6XJWOS.js";
|
|
52
53
|
import "./chunk-ULBI5JGB.js";
|
|
54
|
+
import "./chunk-PYUXFQJ3.js";
|
|
53
55
|
import "./chunk-5BSLGBYI.js";
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-CDDYJCYU.js";
|
|
56
|
-
import "./chunk-SMJZMKYN.js";
|
|
56
|
+
import "./chunk-XLZ7U46Z.js";
|
|
57
57
|
import "./chunk-PLDDJCW6.js";
|
|
58
58
|
export {
|
|
59
59
|
ActionButtons,
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
usePluginRegistry,
|
|
100
100
|
useStateManager
|
|
101
101
|
};
|
|
102
|
-
//# sourceMappingURL=DataTable-
|
|
102
|
+
//# sourceMappingURL=DataTable-HWZQGASI.js.map
|
|
@@ -12,8 +12,8 @@ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
|
12
12
|
import { FieldValues, DefaultValues, SubmitHandler, SubmitErrorHandler, UseFormReturn } from 'react-hook-form';
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { User, SupabaseClient, createClient } from '@supabase/supabase-js';
|
|
15
|
-
import { r as Event } from './unified-
|
|
16
|
-
import { b as Organisation } from './organisation-
|
|
15
|
+
import { r as Event } from './unified-CM7T0aTK.js';
|
|
16
|
+
import { b as Organisation } from './organisation-BtshODVF.js';
|
|
17
17
|
import { b as FileCategory, c as FileUploadOptions, e as FileUploadResult, F as FileReference } from './file-reference-9xUOnwyt.js';
|
|
18
18
|
|
|
19
19
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { SupabaseClient, User, Session, AuthError } from '@supabase/supabase-js';
|
|
4
|
+
import { c as AccessLevel, r as Event } from './unified-CM7T0aTK.js';
|
|
5
|
+
import { b as Organisation, c as OrganisationMembership, d as OrganisationHierarchy } from './organisation-BtshODVF.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @file RBAC Service Interface
|
|
9
|
+
* @package @jmruthers/pace-core
|
|
10
|
+
* @module Services/Interfaces
|
|
11
|
+
* @since 0.1.0
|
|
12
|
+
*
|
|
13
|
+
* Interface for RBAC service operations.
|
|
14
|
+
* Defines the contract for role-based access control functionality.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface UserEventAccess {
|
|
18
|
+
event_id: string;
|
|
19
|
+
event_name: string;
|
|
20
|
+
event_description?: string | null;
|
|
21
|
+
start_date: string;
|
|
22
|
+
end_date: string;
|
|
23
|
+
event_status: string;
|
|
24
|
+
app_id: string;
|
|
25
|
+
access_level: string;
|
|
26
|
+
granted_at: string;
|
|
27
|
+
organisation_id: string;
|
|
28
|
+
}
|
|
29
|
+
interface AppConfig {
|
|
30
|
+
supports_direct_access: boolean;
|
|
31
|
+
requires_event: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface IRBACService {
|
|
34
|
+
getPermissions(): Record<string, boolean>;
|
|
35
|
+
getRoles(): string[];
|
|
36
|
+
getAccessLevel(): AccessLevel;
|
|
37
|
+
isLoading(): boolean;
|
|
38
|
+
getError(): Error | null;
|
|
39
|
+
getSelectedEventId(): string | null;
|
|
40
|
+
getAppConfig(): AppConfig | null;
|
|
41
|
+
getUserEventAccess(): UserEventAccess[];
|
|
42
|
+
isEventAccessLoading(): boolean;
|
|
43
|
+
getSelectedOrganisationId(): string | null;
|
|
44
|
+
hasPermission(permission: string, orgId?: string): boolean;
|
|
45
|
+
hasAnyPermission(permissions: string[], orgId?: string): boolean;
|
|
46
|
+
hasAllPermissions(permissions: string[], orgId?: string): boolean;
|
|
47
|
+
hasRole(role: string): boolean;
|
|
48
|
+
hasAccessLevel(level: AccessLevel): boolean;
|
|
49
|
+
canAccess(resource: string, action: string, orgId?: string): boolean;
|
|
50
|
+
validatePermission(permission: string, orgId?: string): Promise<boolean>;
|
|
51
|
+
validateAccess(resource: string, action: string, orgId?: string): Promise<boolean>;
|
|
52
|
+
refreshPermissions(eventId?: string, orgId?: string): Promise<void>;
|
|
53
|
+
setSelectedEventId(eventId: string | null): void;
|
|
54
|
+
loadUserEventAccess(orgId?: string): Promise<void>;
|
|
55
|
+
getUserEventAccessById(eventId: string): UserEventAccess | undefined;
|
|
56
|
+
requireOrganisationContext(): string;
|
|
57
|
+
initialize(): Promise<void>;
|
|
58
|
+
cleanup(): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @file Base Service Class
|
|
63
|
+
* @package @jmruthers/pace-core
|
|
64
|
+
* @module Services/Base
|
|
65
|
+
* @since 0.1.0
|
|
66
|
+
*
|
|
67
|
+
* Base service class implementing the observable pattern for React subscriptions.
|
|
68
|
+
* All services extend this class to provide state change notifications.
|
|
69
|
+
*/
|
|
70
|
+
type StateChangeCallback = () => void;
|
|
71
|
+
declare abstract class BaseService {
|
|
72
|
+
private subscribers;
|
|
73
|
+
private isInitialized;
|
|
74
|
+
/**
|
|
75
|
+
* Subscribe to state changes
|
|
76
|
+
* @param callback Function to call when state changes
|
|
77
|
+
* @returns Unsubscribe function
|
|
78
|
+
*/
|
|
79
|
+
subscribe(callback: StateChangeCallback): () => void;
|
|
80
|
+
/**
|
|
81
|
+
* Notify all subscribers of state changes
|
|
82
|
+
* This triggers React re-renders
|
|
83
|
+
*/
|
|
84
|
+
protected notify(): void;
|
|
85
|
+
/**
|
|
86
|
+
* Initialize the service
|
|
87
|
+
* Override in subclasses to implement initialization logic
|
|
88
|
+
*/
|
|
89
|
+
initialize(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Cleanup the service
|
|
92
|
+
* Override in subclasses to implement cleanup logic
|
|
93
|
+
*/
|
|
94
|
+
cleanup(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Check if service is initialized
|
|
97
|
+
*/
|
|
98
|
+
protected getInitialized(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Override in subclasses to implement initialization logic
|
|
101
|
+
*/
|
|
102
|
+
protected abstract doInitialize(): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Override in subclasses to implement cleanup logic
|
|
105
|
+
*/
|
|
106
|
+
protected abstract doCleanup(): void;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @file Event Service Interface
|
|
111
|
+
* @package @jmruthers/pace-core
|
|
112
|
+
* @module Services/Interfaces
|
|
113
|
+
* @since 0.1.0
|
|
114
|
+
*
|
|
115
|
+
* Interface for event service operations.
|
|
116
|
+
* Defines the contract for event management functionality.
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
interface IEventService {
|
|
120
|
+
getEvents(): Event[];
|
|
121
|
+
getSelectedEvent(): Event | null;
|
|
122
|
+
isLoading(): boolean;
|
|
123
|
+
getError(): Error | null;
|
|
124
|
+
setSelectedEvent(event: Event | null): void;
|
|
125
|
+
refreshEvents(): Promise<void>;
|
|
126
|
+
loadPersistedEvent(events: Event[]): Promise<boolean>;
|
|
127
|
+
persistEventSelection(eventId: string): void;
|
|
128
|
+
autoSelectNextEvent(events: Event[]): void;
|
|
129
|
+
initialize(): Promise<void>;
|
|
130
|
+
cleanup(): void;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @file Event Service
|
|
135
|
+
* @package @jmruthers/pace-core
|
|
136
|
+
* @module Services
|
|
137
|
+
* @since 0.1.0
|
|
138
|
+
*
|
|
139
|
+
* Event service implementation.
|
|
140
|
+
* Handles event management and selection with organisation context validation.
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
declare class EventService extends BaseService implements IEventService {
|
|
144
|
+
private events;
|
|
145
|
+
private selectedEvent;
|
|
146
|
+
private _isLoading;
|
|
147
|
+
private error;
|
|
148
|
+
private supabaseClient;
|
|
149
|
+
private user;
|
|
150
|
+
private session;
|
|
151
|
+
private appName;
|
|
152
|
+
private selectedOrganisation;
|
|
153
|
+
private setSelectedEventId;
|
|
154
|
+
private isInitializedRef;
|
|
155
|
+
private isFetchingRef;
|
|
156
|
+
private hasAutoSelectedRef;
|
|
157
|
+
private userClearedEventRef;
|
|
158
|
+
constructor(supabaseClient: any, user: any, session: any, appName: string, selectedOrganisation: any, setSelectedEventId: (eventId: string | null) => void);
|
|
159
|
+
updateDependencies(supabaseClient: any, user: any, session: any, appName: string, selectedOrganisation: any, setSelectedEventId: (eventId: string | null) => void): void;
|
|
160
|
+
getEvents(): Event[];
|
|
161
|
+
getSelectedEvent(): Event | null;
|
|
162
|
+
isLoading(): boolean;
|
|
163
|
+
getError(): Error | null;
|
|
164
|
+
setSelectedEvent(event: Event | null): void;
|
|
165
|
+
refreshEvents(): Promise<void>;
|
|
166
|
+
loadPersistedEvent(events: Event[]): Promise<boolean>;
|
|
167
|
+
persistEventSelection(eventId: string): void;
|
|
168
|
+
clearEventSelection(): void;
|
|
169
|
+
autoSelectNextEvent(events: Event[]): void;
|
|
170
|
+
initialize(): Promise<void>;
|
|
171
|
+
cleanup(): void;
|
|
172
|
+
protected doInitialize(): Promise<void>;
|
|
173
|
+
protected doCleanup(): void;
|
|
174
|
+
private fetchEvents;
|
|
175
|
+
getNextEventByDate(events?: Event[]): Event | null;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface EventServiceContextType {
|
|
179
|
+
eventService: EventService;
|
|
180
|
+
}
|
|
181
|
+
type EventContextType = EventServiceContextType;
|
|
182
|
+
declare const EventServiceContext: React__default.Context<EventServiceContextType | null>;
|
|
183
|
+
interface EventServiceProviderProps {
|
|
184
|
+
children: React__default.ReactNode;
|
|
185
|
+
supabaseClient: SupabaseClient;
|
|
186
|
+
user: User | null;
|
|
187
|
+
session: Session | null;
|
|
188
|
+
appName: string;
|
|
189
|
+
selectedOrganisation: any;
|
|
190
|
+
setSelectedEventId: (eventId: string | null) => void;
|
|
191
|
+
}
|
|
192
|
+
declare function EventServiceProvider({ children, supabaseClient, user, session, appName, selectedOrganisation, setSelectedEventId }: EventServiceProviderProps): react_jsx_runtime.JSX.Element;
|
|
193
|
+
declare const useEventService: () => EventService;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @file Organisation Service Interface
|
|
197
|
+
* @package @jmruthers/pace-core
|
|
198
|
+
* @module Services/Interfaces
|
|
199
|
+
* @since 0.1.0
|
|
200
|
+
*
|
|
201
|
+
* Interface for organisation service operations.
|
|
202
|
+
* Defines the contract for organisation management functionality.
|
|
203
|
+
*/
|
|
204
|
+
|
|
205
|
+
interface IOrganisationService {
|
|
206
|
+
getSelectedOrganisation(): Organisation | null;
|
|
207
|
+
getOrganisations(): Organisation[];
|
|
208
|
+
getUserMemberships(): OrganisationMembership[];
|
|
209
|
+
isLoading(): boolean;
|
|
210
|
+
getError(): Error | null;
|
|
211
|
+
hasValidOrganisationContext(): boolean;
|
|
212
|
+
isContextReady(): boolean;
|
|
213
|
+
switchOrganisation(orgId: string): Promise<void>;
|
|
214
|
+
getUserRole(orgId?: string): string;
|
|
215
|
+
validateOrganisationAccess(orgId: string): boolean;
|
|
216
|
+
refreshOrganisations(): Promise<void>;
|
|
217
|
+
ensureOrganisationContext(): Organisation;
|
|
218
|
+
isOrganisationSecure(): boolean;
|
|
219
|
+
getPrimaryOrganisation(): Organisation | null;
|
|
220
|
+
buildOrganisationHierarchy(orgs: Organisation[]): OrganisationHierarchy[];
|
|
221
|
+
initialize(): Promise<void>;
|
|
222
|
+
cleanup(): void;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* @file Organisation Service
|
|
227
|
+
* @package @jmruthers/pace-core
|
|
228
|
+
* @module Services
|
|
229
|
+
* @since 0.1.0
|
|
230
|
+
*
|
|
231
|
+
* Organisation service implementation.
|
|
232
|
+
* Handles organisation management and selection with security-first approach.
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
declare class OrganisationService extends BaseService implements IOrganisationService {
|
|
236
|
+
private _selectedOrganisation;
|
|
237
|
+
private _organisations;
|
|
238
|
+
private _userMemberships;
|
|
239
|
+
private _roleMapState;
|
|
240
|
+
private _isLoading;
|
|
241
|
+
private _error;
|
|
242
|
+
private _isContextReady;
|
|
243
|
+
private retryCount;
|
|
244
|
+
private supabaseClient;
|
|
245
|
+
private user;
|
|
246
|
+
private session;
|
|
247
|
+
private isLoadingRef;
|
|
248
|
+
private lastLoadTimeRef;
|
|
249
|
+
private hasFailedRef;
|
|
250
|
+
private abortControllerRef;
|
|
251
|
+
constructor(supabaseClient: SupabaseClient, user: User | null, session: Session | null);
|
|
252
|
+
getSelectedOrganisation(): Organisation | null;
|
|
253
|
+
getOrganisations(): Organisation[];
|
|
254
|
+
getUserMemberships(): OrganisationMembership[];
|
|
255
|
+
isLoading(): boolean;
|
|
256
|
+
getError(): Error | null;
|
|
257
|
+
hasValidOrganisationContext(): boolean;
|
|
258
|
+
isContextReady(): boolean;
|
|
259
|
+
setSelectedOrganisation(organisation: Organisation | null): void;
|
|
260
|
+
getDependencies(): {
|
|
261
|
+
user: User | null;
|
|
262
|
+
session: Session | null;
|
|
263
|
+
supabaseClient: SupabaseClient | null;
|
|
264
|
+
};
|
|
265
|
+
setTestState(organisations: Organisation[], memberships: OrganisationMembership[], roleMap: Map<string, string>, selectedOrg?: Organisation | null): void;
|
|
266
|
+
updateDependencies(user: User | null, session: Session | null): void;
|
|
267
|
+
switchOrganisation(orgId: string): Promise<void>;
|
|
268
|
+
getUserRole(orgId?: string): string;
|
|
269
|
+
validateOrganisationAccess(orgId: string): boolean;
|
|
270
|
+
refreshOrganisations(): Promise<void>;
|
|
271
|
+
ensureOrganisationContext(): Organisation;
|
|
272
|
+
isOrganisationSecure(): boolean;
|
|
273
|
+
getPrimaryOrganisation(): Organisation | null;
|
|
274
|
+
buildOrganisationHierarchy(orgs: Organisation[]): OrganisationHierarchy[];
|
|
275
|
+
initialize(): Promise<void>;
|
|
276
|
+
cleanup(): void;
|
|
277
|
+
protected doInitialize(): Promise<void>;
|
|
278
|
+
protected doCleanup(): void;
|
|
279
|
+
private setDatabaseOrganisationContext;
|
|
280
|
+
private loadUserOrganisations;
|
|
281
|
+
private clearAllCachedData;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
interface OrganisationServiceContextType {
|
|
285
|
+
organisationService: OrganisationService;
|
|
286
|
+
}
|
|
287
|
+
declare const OrganisationServiceContext: React__default.Context<OrganisationServiceContextType | null>;
|
|
288
|
+
interface OrganisationServiceProviderProps {
|
|
289
|
+
children: React__default.ReactNode;
|
|
290
|
+
supabaseClient: SupabaseClient;
|
|
291
|
+
user: User | null;
|
|
292
|
+
session: Session | null;
|
|
293
|
+
}
|
|
294
|
+
declare function OrganisationServiceProvider({ children, supabaseClient, user, session }: OrganisationServiceProviderProps): react_jsx_runtime.JSX.Element;
|
|
295
|
+
declare const useOrganisationService: () => OrganisationService;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @file Inactivity Service Interface
|
|
299
|
+
* @package @jmruthers/pace-core
|
|
300
|
+
* @module Services/Interfaces
|
|
301
|
+
* @since 0.1.0
|
|
302
|
+
*
|
|
303
|
+
* Interface for inactivity service operations.
|
|
304
|
+
* Defines the contract for inactivity tracking functionality.
|
|
305
|
+
*/
|
|
306
|
+
interface IInactivityService {
|
|
307
|
+
isIdle(): boolean;
|
|
308
|
+
getTimeRemaining(): number;
|
|
309
|
+
isWarningShown(): boolean;
|
|
310
|
+
isTracking(): boolean;
|
|
311
|
+
getShowInactivityWarning(): boolean;
|
|
312
|
+
getInactivityTimeRemaining(): number;
|
|
313
|
+
resetActivity(): void;
|
|
314
|
+
startTracking(): void;
|
|
315
|
+
stopTracking(): void;
|
|
316
|
+
handleIdleLogout(): Promise<void>;
|
|
317
|
+
handleStaySignedIn(): void;
|
|
318
|
+
handleSignOutNow(): Promise<void>;
|
|
319
|
+
initialize(): Promise<void>;
|
|
320
|
+
cleanup(): void;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* @file Inactivity Service
|
|
325
|
+
* @package @jmruthers/pace-core
|
|
326
|
+
* @module Services
|
|
327
|
+
* @since 0.1.0
|
|
328
|
+
*
|
|
329
|
+
* Inactivity service implementation.
|
|
330
|
+
* Handles inactivity tracking, auto-logout, and warning modals.
|
|
331
|
+
*/
|
|
332
|
+
|
|
333
|
+
declare class InactivityService extends BaseService implements IInactivityService {
|
|
334
|
+
private _showInactivityWarning;
|
|
335
|
+
private _inactivityTimeRemaining;
|
|
336
|
+
private _isIdle;
|
|
337
|
+
private _timeRemaining;
|
|
338
|
+
private _showWarning;
|
|
339
|
+
private _isTracking;
|
|
340
|
+
private supabaseClient;
|
|
341
|
+
private user;
|
|
342
|
+
private session;
|
|
343
|
+
private idleTimeoutMs;
|
|
344
|
+
private warnBeforeMs;
|
|
345
|
+
private onIdleLogout;
|
|
346
|
+
private inactivityTracker;
|
|
347
|
+
private isInactivityEnabled;
|
|
348
|
+
constructor(supabaseClient: any, user: any, session: any, idleTimeoutMs: number | undefined, warnBeforeMs: number | undefined, onIdleLogout: (reason: 'inactivity') => void);
|
|
349
|
+
isIdle(): boolean;
|
|
350
|
+
getTimeRemaining(): number;
|
|
351
|
+
isWarningShown(): boolean;
|
|
352
|
+
isTracking(): boolean;
|
|
353
|
+
getShowInactivityWarning(): boolean;
|
|
354
|
+
getInactivityTimeRemaining(): number;
|
|
355
|
+
getIsIdle(): boolean;
|
|
356
|
+
getIsTracking(): boolean;
|
|
357
|
+
getShowWarning(): boolean;
|
|
358
|
+
setShowInactivityWarning(value: boolean): void;
|
|
359
|
+
setInactivityTimeRemaining(value: number): void;
|
|
360
|
+
setIsIdle(value: boolean): void;
|
|
361
|
+
setTimeRemaining(value: number): void;
|
|
362
|
+
setShowWarning(value: boolean): void;
|
|
363
|
+
setIsTracking(value: boolean): void;
|
|
364
|
+
triggerWarning(timeRemaining: number): void;
|
|
365
|
+
triggerIdle(): void;
|
|
366
|
+
updateDependencies(supabaseClient: any, user: any, session: any, idleTimeoutMs?: number, warnBeforeMs?: number, onIdleLogout?: (reason: 'inactivity') => void): void;
|
|
367
|
+
resetActivity(): void;
|
|
368
|
+
startTracking(): void;
|
|
369
|
+
stopTracking(): void;
|
|
370
|
+
handleIdleLogout(): Promise<void>;
|
|
371
|
+
handleStaySignedIn(): void;
|
|
372
|
+
handleSignOutNow(): Promise<void>;
|
|
373
|
+
initialize(): Promise<void>;
|
|
374
|
+
cleanup(): void;
|
|
375
|
+
protected doInitialize(): Promise<void>;
|
|
376
|
+
protected doCleanup(): void;
|
|
377
|
+
private setupInactivityTracker;
|
|
378
|
+
private setupEventHandlers;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
interface InactivityServiceContextType {
|
|
382
|
+
inactivityService: InactivityService;
|
|
383
|
+
}
|
|
384
|
+
declare const InactivityServiceContext: React__default.Context<InactivityServiceContextType | null>;
|
|
385
|
+
interface InactivityServiceProviderProps {
|
|
386
|
+
children: React__default.ReactNode;
|
|
387
|
+
supabaseClient: SupabaseClient;
|
|
388
|
+
user: User | null;
|
|
389
|
+
session: Session | null;
|
|
390
|
+
idleTimeoutMs?: number;
|
|
391
|
+
warnBeforeMs?: number;
|
|
392
|
+
onIdleLogout: (reason: 'inactivity') => void;
|
|
393
|
+
}
|
|
394
|
+
declare function InactivityServiceProvider({ children, supabaseClient, user, session, idleTimeoutMs, warnBeforeMs, onIdleLogout }: InactivityServiceProviderProps): react_jsx_runtime.JSX.Element;
|
|
395
|
+
declare const useInactivityService: () => InactivityService;
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* @file Authentication Service Interface
|
|
399
|
+
* @package @jmruthers/pace-core
|
|
400
|
+
* @module Services/Interfaces
|
|
401
|
+
* @since 0.1.0
|
|
402
|
+
*
|
|
403
|
+
* Interface for authentication service operations.
|
|
404
|
+
* Defines the contract for authentication-related functionality.
|
|
405
|
+
*/
|
|
406
|
+
|
|
407
|
+
interface AuthResult {
|
|
408
|
+
user: User | null;
|
|
409
|
+
session: Session | null;
|
|
410
|
+
error: AuthError | null;
|
|
411
|
+
}
|
|
412
|
+
interface IAuthService {
|
|
413
|
+
getUser(): User | null;
|
|
414
|
+
getSession(): Session | null;
|
|
415
|
+
isAuthenticated(): boolean;
|
|
416
|
+
isLoading(): boolean;
|
|
417
|
+
getError(): AuthError | null;
|
|
418
|
+
getSupabaseClient(): SupabaseClient | null;
|
|
419
|
+
signIn(email: string, password?: string): Promise<AuthResult>;
|
|
420
|
+
signUp(email: string, password: string): Promise<AuthResult>;
|
|
421
|
+
signOut(): Promise<AuthResult>;
|
|
422
|
+
resetPassword(email: string): Promise<AuthResult>;
|
|
423
|
+
updatePassword(password: string): Promise<AuthResult>;
|
|
424
|
+
refreshSession(): Promise<AuthResult>;
|
|
425
|
+
initialize(): Promise<void>;
|
|
426
|
+
cleanup(): void;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @file Authentication Service
|
|
431
|
+
* @package @jmruthers/pace-core
|
|
432
|
+
* @module Services
|
|
433
|
+
* @since 0.1.0
|
|
434
|
+
*
|
|
435
|
+
* Authentication service implementation.
|
|
436
|
+
* Handles user authentication, session management, and auth-related operations.
|
|
437
|
+
*/
|
|
438
|
+
|
|
439
|
+
declare class AuthService extends BaseService implements IAuthService {
|
|
440
|
+
private user;
|
|
441
|
+
private session;
|
|
442
|
+
private authLoading;
|
|
443
|
+
private authError;
|
|
444
|
+
private supabaseClient;
|
|
445
|
+
private authStateSubscription;
|
|
446
|
+
constructor(supabaseClient: SupabaseClient);
|
|
447
|
+
getUser(): User | null;
|
|
448
|
+
getSession(): Session | null;
|
|
449
|
+
isAuthenticated(): boolean;
|
|
450
|
+
isLoading(): boolean;
|
|
451
|
+
getError(): AuthError | null;
|
|
452
|
+
getSupabaseClient(): SupabaseClient | null;
|
|
453
|
+
signIn(email: string, password?: string): Promise<AuthResult>;
|
|
454
|
+
signUp(email: string, password: string): Promise<AuthResult>;
|
|
455
|
+
signOut(): Promise<AuthResult>;
|
|
456
|
+
resetPassword(email: string): Promise<AuthResult>;
|
|
457
|
+
updatePassword(password: string): Promise<AuthResult>;
|
|
458
|
+
refreshSession(): Promise<AuthResult>;
|
|
459
|
+
initialize(): Promise<void>;
|
|
460
|
+
cleanup(): void;
|
|
461
|
+
protected doInitialize(): Promise<void>;
|
|
462
|
+
protected doCleanup(): void;
|
|
463
|
+
private setupAuthStateListener;
|
|
464
|
+
private restoreSession;
|
|
465
|
+
private setupErrorHandlers;
|
|
466
|
+
private removeErrorHandlers;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* @file RBAC Service
|
|
471
|
+
* @package @jmruthers/pace-core
|
|
472
|
+
* @module Services
|
|
473
|
+
* @since 0.1.0
|
|
474
|
+
*
|
|
475
|
+
* RBAC service implementation.
|
|
476
|
+
* Handles role-based access control, permissions, and event access management.
|
|
477
|
+
*/
|
|
478
|
+
|
|
479
|
+
declare class RBACService extends BaseService implements IRBACService {
|
|
480
|
+
private permissions;
|
|
481
|
+
private roles;
|
|
482
|
+
private accessLevel;
|
|
483
|
+
private rbacLoading;
|
|
484
|
+
private rbacError;
|
|
485
|
+
private selectedEventId;
|
|
486
|
+
private appConfig;
|
|
487
|
+
private userEventAccess;
|
|
488
|
+
private eventAccessLoading;
|
|
489
|
+
private selectedOrganisationId;
|
|
490
|
+
private supabaseClient;
|
|
491
|
+
private user;
|
|
492
|
+
private session;
|
|
493
|
+
private appName;
|
|
494
|
+
constructor(supabaseClient: SupabaseClient, user: User | null, session: Session | null, appName: string);
|
|
495
|
+
updateDependencies(user: User | null, session: Session | null, appName: string): void;
|
|
496
|
+
getPermissions(): Record<string, boolean>;
|
|
497
|
+
getRoles(): string[];
|
|
498
|
+
getAccessLevel(): AccessLevel;
|
|
499
|
+
isLoading(): boolean;
|
|
500
|
+
getError(): Error | null;
|
|
501
|
+
getSelectedEventId(): string | null;
|
|
502
|
+
getAppConfig(): AppConfig | null;
|
|
503
|
+
getUserEventAccess(): UserEventAccess[];
|
|
504
|
+
isEventAccessLoading(): boolean;
|
|
505
|
+
getSelectedOrganisationId(): string | null;
|
|
506
|
+
hasPermission(permission: string, orgId?: string): boolean;
|
|
507
|
+
hasAnyPermission(permissions: string[], orgId?: string): boolean;
|
|
508
|
+
hasAllPermissions(permissions: string[], orgId?: string): boolean;
|
|
509
|
+
hasRole(role: string): boolean;
|
|
510
|
+
hasAccessLevel(level: AccessLevel): boolean;
|
|
511
|
+
canAccess(resource: string, action: string, orgId?: string): boolean;
|
|
512
|
+
validatePermission(permission: string, orgId?: string): Promise<boolean>;
|
|
513
|
+
validateAccess(resource: string, action: string, orgId?: string): Promise<boolean>;
|
|
514
|
+
refreshPermissions(eventId?: string, orgId?: string): Promise<void>;
|
|
515
|
+
setSelectedEventId(eventId: string | null): void;
|
|
516
|
+
loadUserEventAccess(orgId?: string): Promise<void>;
|
|
517
|
+
getUserEventAccessById(eventId: string): UserEventAccess | undefined;
|
|
518
|
+
requireOrganisationContext(): string;
|
|
519
|
+
initialize(): Promise<void>;
|
|
520
|
+
cleanup(): void;
|
|
521
|
+
protected doInitialize(): Promise<void>;
|
|
522
|
+
protected doCleanup(): void;
|
|
523
|
+
private loadAppConfig;
|
|
524
|
+
private loadPersistedState;
|
|
525
|
+
private transformRBACPermissions;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
export { AuthService as A, type EventServiceContextType as E, type InactivityServiceContextType as I, type OrganisationServiceContextType as O, RBACService as R, type UserEventAccess as U, type EventContextType as a, EventServiceContext as b, type EventServiceProviderProps as c, EventServiceProvider as d, OrganisationServiceContext as e, type OrganisationServiceProviderProps as f, OrganisationServiceProvider as g, useOrganisationService as h, InactivityServiceContext as i, type InactivityServiceProviderProps as j, InactivityServiceProvider as k, useInactivityService as l, InactivityService as m, EventService as n, OrganisationService as o, useEventService as u };
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_UnifiedAuthProvider
|
|
3
|
+
} from "./chunk-URUTVZ7N.js";
|
|
1
4
|
import {
|
|
2
5
|
UnifiedAuthProvider,
|
|
3
|
-
init_UnifiedAuthProvider,
|
|
4
6
|
useUnifiedAuth
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WN6XJWOS.js";
|
|
6
8
|
import "./chunk-ULBI5JGB.js";
|
|
7
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-XLZ7U46Z.js";
|
|
8
10
|
import "./chunk-PLDDJCW6.js";
|
|
9
11
|
init_UnifiedAuthProvider();
|
|
10
12
|
export {
|
|
11
13
|
UnifiedAuthProvider,
|
|
12
14
|
useUnifiedAuth
|
|
13
15
|
};
|
|
14
|
-
//# sourceMappingURL=UnifiedAuthProvider-
|
|
16
|
+
//# sourceMappingURL=UnifiedAuthProvider-3NKDOSOK.js.map
|