@jmruthers/pace-core 0.6.11 → 0.6.12
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-EFYP2QLE.js → DataTable-AQAHSFLM.js} +7 -6
- package/dist/{api-BZR2CYXL.js → api-6OQXYT67.js} +2 -1
- package/dist/{chunk-L5LFKKLJ.js → chunk-2GBDPPUC.js} +1 -1
- package/dist/{chunk-J2KQK6DG.js → chunk-AP5FG7W4.js} +2 -2
- package/dist/{chunk-UZNAFKGW.js → chunk-GHCUP64P.js} +1 -21
- package/dist/{chunk-V7FTM2LU.js → chunk-H6RTU4DZ.js} +37 -19
- package/dist/{chunk-KJXRL3XE.js → chunk-HQTYP6BX.js} +79 -45
- package/dist/{chunk-YFTFFJIV.js → chunk-M7QE7XOA.js} +3 -3
- package/dist/{chunk-YYTWKVHO.js → chunk-MVVWZ7JV.js} +25 -30
- package/dist/{chunk-PCSHBLPB.js → chunk-NJ7FGQWB.js} +5 -5
- package/dist/{chunk-WY6Y7KC3.js → chunk-QWIG36BZ.js} +3 -3
- package/dist/{chunk-4R3T5ENU.js → chunk-S57OLCLO.js} +9 -6
- package/dist/chunk-VFLR5K2H.js +23 -0
- package/dist/{chunk-2OEVOGGR.js → chunk-Y2LWSLLB.js} +41 -25
- package/dist/{chunk-7A6IMHH2.js → chunk-YFGNMB67.js} +75 -6
- package/dist/components.d.ts +3 -3
- package/dist/components.js +13 -12
- package/dist/{functions-DH45k8ec.d.ts → functions-hF5ImHCr.d.ts} +1 -1
- package/dist/hooks.js +8 -7
- package/dist/index.d.ts +5 -5
- package/dist/index.js +17 -16
- package/dist/providers.js +3 -2
- package/dist/rbac/index.d.ts +10 -10
- package/dist/rbac/index.js +9 -8
- package/dist/{types-BE2sEHKd.d.ts → types-Besvoyzb.d.ts} +1 -1
- package/dist/{types-CvOPXWWZ.d.ts → types-CGHrxfqc.d.ts} +3 -0
- package/dist/types.d.ts +2 -2
- package/dist/{usePublicPageContext-B91dGYW1.d.ts → usePublicPageContext-BQrHf95t.d.ts} +1 -1
- package/dist/utils.js +4 -3
- package/docs/api/@jmruthers/namespaces/DialogPortal/README.md +14 -0
- package/docs/api/@jmruthers/namespaces/DialogPortal/variables/displayName.md +11 -0
- package/docs/api/README.md +6 -2
- package/docs/api/_media/README.md +186 -0
- package/docs/api/classes/ColumnFactory.md +225 -0
- package/docs/api/classes/Logger.md +246 -0
- package/docs/api/classes/RBACAuditManager.md +299 -0
- package/docs/api/classes/RBACCache.md +389 -0
- package/docs/api/classes/RBACEngine.md +181 -0
- package/docs/api/classes/SecureSupabaseClient.md +168 -0
- package/docs/api/classes/StorageUtils.md +324 -0
- package/docs/api/enumerations/FileCategory.md +137 -0
- package/docs/api/enumerations/LogLevel.md +43 -0
- package/docs/api/enumerations/RBACErrorCode.md +169 -0
- package/docs/api/enumerations/RPCFunction.md +89 -0
- package/docs/api/functions/AccessDenied.md +30 -0
- package/docs/api/functions/AppSwitcher.md +21 -0
- package/docs/api/functions/Badge.md +42 -0
- package/docs/api/functions/ContextSelector.md +43 -0
- package/docs/api/functions/DataTable.md +36 -0
- package/docs/api/functions/DatePickerWithTimezone.md +28 -0
- package/docs/api/functions/DialogBody.md +24 -0
- package/docs/api/functions/DialogFooter.md +24 -0
- package/docs/api/functions/DialogHeader.md +24 -0
- package/docs/api/functions/ErrorBoundaryProvider.md +28 -0
- package/docs/api/functions/EventServiceProvider.md +28 -0
- package/docs/api/functions/FileDisplay.md +25 -0
- package/docs/api/functions/FileUpload.md +21 -0
- package/docs/api/functions/Form.md +50 -0
- package/docs/api/functions/FormField.md +102 -0
- package/docs/api/functions/Header.md +21 -0
- package/docs/api/functions/InactivityServiceProvider.md +28 -0
- package/docs/api/functions/InactivityWarningModal.md +21 -0
- package/docs/api/functions/Input.md +49 -0
- package/docs/api/functions/NavigationGuard.md +31 -0
- package/docs/api/functions/OrganisationServiceProvider.md +28 -0
- package/docs/api/functions/PaceAppLayout.md +169 -0
- package/docs/api/functions/PasswordChangeForm.md +21 -0
- package/docs/api/functions/ProtectedRoute.md +37 -0
- package/docs/api/functions/PublicPageFooter.md +21 -0
- package/docs/api/functions/PublicPageHeader.md +21 -0
- package/docs/api/functions/PublicPageLayout.md +33 -0
- package/docs/api/functions/PublicPageProvider.md +30 -0
- package/docs/api/functions/Textarea.md +49 -0
- package/docs/api/functions/Toaster.md +34 -0
- package/docs/api/functions/UnifiedAuthProvider.md +28 -0
- package/docs/api/functions/applyPalette.md +33 -0
- package/docs/api/functions/archiveFile.md +47 -0
- package/docs/api/functions/average.md +63 -0
- package/docs/api/functions/buildAppUrl.md +46 -0
- package/docs/api/functions/clearInFlightRequests.md +17 -0
- package/docs/api/functions/clearPalette.md +18 -0
- package/docs/api/functions/clearPublicEventCache.md +18 -0
- package/docs/api/functions/clearPublicFileDisplayCache.md +18 -0
- package/docs/api/functions/clearPublicLogoCache.md +18 -0
- package/docs/api/functions/cn.md +21 -0
- package/docs/api/functions/count.md +56 -0
- package/docs/api/functions/createAuditManager.md +45 -0
- package/docs/api/functions/createBaseClient.md +75 -0
- package/docs/api/functions/createLogger.md +95 -0
- package/docs/api/functions/createRBACConfig.md +21 -0
- package/docs/api/functions/createRBACEngine.md +33 -0
- package/docs/api/functions/createRBACExpressMiddleware.md +84 -0
- package/docs/api/functions/createRBACMiddleware.md +88 -0
- package/docs/api/functions/createSecureClient.md +80 -0
- package/docs/api/functions/createSecureDataAccess.md +39 -0
- package/docs/api/functions/deleteFile.md +33 -0
- package/docs/api/functions/disablePerformanceMonitoring.md +17 -0
- package/docs/api/functions/downloadFile.md +33 -0
- package/docs/api/functions/emitAuditEvent.md +27 -0
- package/docs/api/functions/enablePerformanceMonitoring.md +17 -0
- package/docs/api/functions/err.md +23 -0
- package/docs/api/functions/exportToCSV.md +56 -0
- package/docs/api/functions/exportToCSVWithTableRows.md +46 -0
- package/docs/api/functions/extractEventCodeFromPath.md +24 -0
- package/docs/api/functions/extractFileMetadata.md +33 -0
- package/docs/api/functions/formatCompactNumber.md +27 -0
- package/docs/api/functions/formatCurrency.md +31 -0
- package/docs/api/functions/formatDate.md +23 -0
- package/docs/api/functions/formatDateTime.md +24 -0
- package/docs/api/functions/formatFileSize.md +23 -0
- package/docs/api/functions/formatInTimeZone.md +46 -0
- package/docs/api/functions/formatNumber.md +31 -0
- package/docs/api/functions/formatPercent.md +64 -0
- package/docs/api/functions/formatTime.md +24 -0
- package/docs/api/functions/formatTimeInTimeZone.md +40 -0
- package/docs/api/functions/fromSupabaseClient.md +49 -0
- package/docs/api/functions/fromZonedTime.md +41 -0
- package/docs/api/functions/generateCSVContent.md +55 -0
- package/docs/api/functions/generateFilePath.md +29 -0
- package/docs/api/functions/generateFileUrlsBatch.md +33 -0
- package/docs/api/functions/generatePublicRoutePath.md +27 -0
- package/docs/api/functions/generateUniqueFileName.md +24 -0
- package/docs/api/functions/getAccessLevel.md +48 -0
- package/docs/api/functions/getAllAppPorts.md +19 -0
- package/docs/api/functions/getAllStylePaths.md +15 -0
- package/docs/api/functions/getAppConfig.md +17 -0
- package/docs/api/functions/getAppPort.md +34 -0
- package/docs/api/functions/getBucketName.md +27 -0
- package/docs/api/functions/getCurrentAppId.md +17 -0
- package/docs/api/functions/getCurrentAppName.md +17 -0
- package/docs/api/functions/getFileSizeLimit.md +23 -0
- package/docs/api/functions/getGlobalAuditManager.md +19 -0
- package/docs/api/functions/getInFlightRequestCount.md +19 -0
- package/docs/api/functions/getPerformanceMetrics.md +17 -0
- package/docs/api/functions/getPerformanceSummary.md +17 -0
- package/docs/api/functions/getPermissionMap.md +52 -0
- package/docs/api/functions/getPublicEventCacheStats.md +25 -0
- package/docs/api/functions/getPublicFileDisplayCacheStats.md +25 -0
- package/docs/api/functions/getPublicLogoCacheStats.md +25 -0
- package/docs/api/functions/getPublicUrl.md +39 -0
- package/docs/api/functions/getRBACConfig.md +15 -0
- package/docs/api/functions/getRBACLogger.md +15 -0
- package/docs/api/functions/getRoleContext.md +31 -0
- package/docs/api/functions/getSignedUrl.md +34 -0
- package/docs/api/functions/getStylePath.md +21 -0
- package/docs/api/functions/getTimeZoneDifference.md +40 -0
- package/docs/api/functions/getTimezoneAbbreviation.md +40 -0
- package/docs/api/functions/getUserTimeZone.md +26 -0
- package/docs/api/functions/hasAllPermissions.md +41 -0
- package/docs/api/functions/hasAnyPermission.md +41 -0
- package/docs/api/functions/isDebugMode.md +15 -0
- package/docs/api/functions/isDevelopmentMode.md +15 -0
- package/docs/api/functions/isErr.md +29 -0
- package/docs/api/functions/isOk.md +29 -0
- package/docs/api/functions/isPerformanceMonitoringEnabled.md +17 -0
- package/docs/api/functions/isPermitted.md +58 -0
- package/docs/api/functions/isPermittedCached.md +36 -0
- package/docs/api/functions/isRBACInitialized.md +19 -0
- package/docs/api/functions/isSecureClient.md +38 -0
- package/docs/api/functions/isValidPermission.md +27 -0
- package/docs/api/functions/listFiles.md +29 -0
- package/docs/api/functions/max.md +63 -0
- package/docs/api/functions/min.md +63 -0
- package/docs/api/functions/ok.md +29 -0
- package/docs/api/functions/parseAndNormalizeEventColours.md +105 -0
- package/docs/api/functions/recordAuditEvent.md +23 -0
- package/docs/api/functions/recordPermissionCheck.md +31 -0
- package/docs/api/functions/resetPerformanceMetrics.md +17 -0
- package/docs/api/functions/resolveAppContext.md +27 -0
- package/docs/api/functions/roundToNearestMinutes.md +41 -0
- package/docs/api/functions/sanitizeFormData.md +49 -0
- package/docs/api/functions/sanitizeHtml.md +39 -0
- package/docs/api/functions/sanitizeUserInput.md +27 -0
- package/docs/api/functions/setAppConfig.md +23 -0
- package/docs/api/functions/setGlobalAuditManager.md +25 -0
- package/docs/api/functions/setupRBAC.md +31 -0
- package/docs/api/functions/sum.md +63 -0
- package/docs/api/functions/toZonedTime.md +41 -0
- package/docs/api/functions/uploadFile.md +32 -0
- package/docs/api/functions/useAccessLevel.md +71 -0
- package/docs/api/functions/useAccessibleApps.md +55 -0
- package/docs/api/functions/useAppConfig.md +20 -0
- package/docs/api/functions/useAuthService.md +15 -0
- package/docs/api/functions/useCan.md +99 -0
- package/docs/api/functions/useEventService.md +15 -0
- package/docs/api/functions/useEventTheme.md +26 -0
- package/docs/api/functions/useEvents.md +45 -0
- package/docs/api/functions/useFileReference.md +264 -0
- package/docs/api/functions/useFileReferenceById.md +63 -0
- package/docs/api/functions/useFileReferenceForRecord.md +129 -0
- package/docs/api/functions/useFilesByCategory.md +80 -0
- package/docs/api/functions/useFormDialog.md +62 -0
- package/docs/api/functions/useInactivityService.md +15 -0
- package/docs/api/functions/useInactivityTracker.md +21 -0
- package/docs/api/functions/useIsPublicPage.md +19 -0
- package/docs/api/functions/useMultiplePermissions.md +88 -0
- package/docs/api/functions/useOptionalEvents.md +31 -0
- package/docs/api/functions/useOrganisationPermissions.md +27 -0
- package/docs/api/functions/useOrganisationSecurity.md +15 -0
- package/docs/api/functions/useOrganisationService.md +15 -0
- package/docs/api/functions/useOrganisations.md +48 -0
- package/docs/api/functions/usePermissions.md +130 -0
- package/docs/api/functions/usePublicEvent.md +36 -0
- package/docs/api/functions/usePublicEventCode.md +32 -0
- package/docs/api/functions/usePublicEventLogo.md +48 -0
- package/docs/api/functions/usePublicFileDisplay.md +54 -0
- package/docs/api/functions/usePublicPageContext.md +19 -0
- package/docs/api/functions/usePublicRouteParams.md +31 -0
- package/docs/api/functions/useRBAC.md +21 -0
- package/docs/api/functions/useResolvedScope.md +46 -0
- package/docs/api/functions/useResourcePermissions.md +25 -0
- package/docs/api/functions/useRoleManagement.md +121 -0
- package/docs/api/functions/useSecureSupabase.md +51 -0
- package/docs/api/functions/useSessionRestoration.md +15 -0
- package/docs/api/functions/useSessionTracking.md +62 -0
- package/docs/api/functions/useToast.md +83 -0
- package/docs/api/functions/useUnifiedAuth.md +24 -0
- package/docs/api/functions/useZodForm.md +27 -0
- package/docs/api/functions/validateFileSize.md +31 -0
- package/docs/api/functions/warnIfInsecureClient.md +40 -0
- package/docs/api/functions/withAccessLevelGuard.md +67 -0
- package/docs/api/functions/withPermissionGuard.md +73 -0
- package/docs/api/functions/withRoleGuard.md +86 -0
- package/docs/api/globals.md +502 -0
- package/docs/api/interfaces/AccessDeniedProps.md +87 -0
- package/docs/api/interfaces/AccessibleApp.md +41 -0
- package/docs/api/interfaces/AddressFieldProps.md +195 -0
- package/docs/api/interfaces/AddressFieldRef.md +67 -0
- package/docs/api/interfaces/AggregateConfig.md +35 -0
- package/docs/api/interfaces/AppSwitcherProps.md +51 -0
- package/docs/api/interfaces/AuthSessionData.md +27 -0
- package/docs/api/interfaces/AutocompleteOptions.md +61 -0
- package/docs/api/interfaces/AvatarProps.md +97 -0
- package/docs/api/interfaces/BadgeProps.md +30 -0
- package/docs/api/interfaces/BuildAppUrlOptions.md +41 -0
- package/docs/api/interfaces/ButtonProps.md +46 -0
- package/docs/api/interfaces/CalendarProps.md +60 -0
- package/docs/api/interfaces/CardProps.md +56 -0
- package/docs/api/interfaces/ColorPalette.md +13 -0
- package/docs/api/interfaces/ColorShade.md +58 -0
- package/docs/api/interfaces/ContextSelectorProps.md +131 -0
- package/docs/api/interfaces/DataRecord.md +16 -0
- package/docs/api/interfaces/DataTableAction.md +198 -0
- package/docs/api/interfaces/DataTableColumn.md +422 -0
- package/docs/api/interfaces/DataTableProps.md +511 -0
- package/docs/api/interfaces/DataTableToolbarButton.md +75 -0
- package/docs/api/interfaces/DatePickerWithTimezoneProps.md +75 -0
- package/docs/api/interfaces/DialogBodyProps.md +55 -0
- package/docs/api/interfaces/DialogCloseProps.md +25 -0
- package/docs/api/interfaces/DialogContentProps.md +160 -0
- package/docs/api/interfaces/DialogFooterProps.md +25 -0
- package/docs/api/interfaces/DialogHeaderProps.md +25 -0
- package/docs/api/interfaces/DialogPortalProps.md +19 -0
- package/docs/api/interfaces/DialogProps.md +53 -0
- package/docs/api/interfaces/DialogTriggerProps.md +53 -0
- package/docs/api/interfaces/EmptyStateConfig.md +55 -0
- package/docs/api/interfaces/ErrorBoundaryProps.md +131 -0
- package/docs/api/interfaces/ErrorBoundaryProviderProps.md +31 -0
- package/docs/api/interfaces/ErrorBoundaryState.md +61 -0
- package/docs/api/interfaces/EventAppRoleData.md +54 -0
- package/docs/api/interfaces/ExportColumn.md +69 -0
- package/docs/api/interfaces/ExportOptions.md +109 -0
- package/docs/api/interfaces/FileDisplayProps.md +192 -0
- package/docs/api/interfaces/FileMetadata.md +97 -0
- package/docs/api/interfaces/FileReference.md +89 -0
- package/docs/api/interfaces/FileSizeLimits.md +13 -0
- package/docs/api/interfaces/FileUploadOptions.md +107 -0
- package/docs/api/interfaces/FooterProps.md +37 -0
- package/docs/api/interfaces/FormFieldProps.md +171 -0
- package/docs/api/interfaces/FormProps.md +93 -0
- package/docs/api/interfaces/GrantEventAppRoleParams.md +97 -0
- package/docs/api/interfaces/ImportSummary.md +49 -0
- package/docs/api/interfaces/InactivityWarningModalProps.md +87 -0
- package/docs/api/interfaces/InputProps.md +46 -0
- package/docs/api/interfaces/InvalidScopeError.md +37 -0
- package/docs/api/interfaces/LabelProps.md +85 -0
- package/docs/api/interfaces/LoggerConfig.md +51 -0
- package/docs/api/interfaces/LoginFormProps.md +146 -0
- package/docs/api/interfaces/MissingUserContextError.md +37 -0
- package/docs/api/interfaces/NavigationGuardProps.md +109 -0
- package/docs/api/interfaces/NavigationItem.md +91 -0
- package/docs/api/interfaces/NavigationMenuProps.md +169 -0
- package/docs/api/interfaces/Organisation.md +105 -0
- package/docs/api/interfaces/OrganisationContextRequiredError.md +37 -0
- package/docs/api/interfaces/OrganisationMembership.md +105 -0
- package/docs/api/interfaces/OrganisationSecurityError.md +49 -0
- package/docs/api/interfaces/PaceAppLayoutPermissionConfig.md +127 -0
- package/docs/api/interfaces/PaceAppLayoutRouteConfigItem.md +91 -0
- package/docs/api/interfaces/PaceAppLayoutRoutingConfig.md +79 -0
- package/docs/api/interfaces/PaceLoginPageProps.md +41 -0
- package/docs/api/interfaces/PagePermissionGuardProps.md +143 -0
- package/docs/api/interfaces/PaletteData.md +33 -0
- package/docs/api/interfaces/ParsedAddress.md +91 -0
- package/docs/api/interfaces/PermissionDeniedError.md +37 -0
- package/docs/api/interfaces/ProgressProps.md +35 -0
- package/docs/api/interfaces/ProtectedRouteProps.md +67 -0
- package/docs/api/interfaces/PublicPageFooterProps.md +97 -0
- package/docs/api/interfaces/PublicPageHeaderProps.md +99 -0
- package/docs/api/interfaces/PublicPageLayoutProps.md +153 -0
- package/docs/api/interfaces/RBACAccessValidateParams.md +41 -0
- package/docs/api/interfaces/RBACAccessValidateResult.md +33 -0
- package/docs/api/interfaces/RBACAuditLogParams.md +65 -0
- package/docs/api/interfaces/RBACAuditLogResult.md +41 -0
- package/docs/api/interfaces/RBACContext.md +41 -0
- package/docs/api/interfaces/RBACError.md +37 -0
- package/docs/api/interfaces/RBACLogger.md +97 -0
- package/docs/api/interfaces/RBACNotInitializedError.md +37 -0
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +57 -0
- package/docs/api/interfaces/RBACPerformanceMetrics.md +109 -0
- package/docs/api/interfaces/RBACPermissionCheckParams.md +57 -0
- package/docs/api/interfaces/RBACPermissionCheckResult.md +41 -0
- package/docs/api/interfaces/RBACPermissionsGetParams.md +49 -0
- package/docs/api/interfaces/RBACPermissionsGetResult.md +49 -0
- package/docs/api/interfaces/RBACResult.md +47 -0
- package/docs/api/interfaces/RBACRoleGrantParams.md +49 -0
- package/docs/api/interfaces/RBACRoleGrantResult.md +41 -0
- package/docs/api/interfaces/RBACRoleRevokeParams.md +49 -0
- package/docs/api/interfaces/RBACRoleRevokeResult.md +41 -0
- package/docs/api/interfaces/RBACRoleValidateParams.md +41 -0
- package/docs/api/interfaces/RBACRoleValidateResult.md +49 -0
- package/docs/api/interfaces/RBACRolesListParams.md +41 -0
- package/docs/api/interfaces/RBACRolesListResult.md +57 -0
- package/docs/api/interfaces/RBACSessionTrackParams.md +57 -0
- package/docs/api/interfaces/RBACSessionTrackResult.md +41 -0
- package/docs/api/interfaces/ResourcePermissions.md +119 -0
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +81 -0
- package/docs/api/interfaces/RoleManagementResult.md +41 -0
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +29 -0
- package/docs/api/interfaces/StorageConfig.md +33 -0
- package/docs/api/interfaces/StorageFileInfo.md +57 -0
- package/docs/api/interfaces/StorageFileMetadata.md +113 -0
- package/docs/api/interfaces/StorageListOptions.md +79 -0
- package/docs/api/interfaces/StorageListResult.md +33 -0
- package/docs/api/interfaces/StorageUploadOptions.md +81 -0
- package/docs/api/interfaces/StorageUploadResult.md +49 -0
- package/docs/api/interfaces/StorageUploadSuccess.md +35 -0
- package/docs/api/interfaces/StorageUrlOptions.md +49 -0
- package/docs/api/interfaces/StyleImport.md +17 -0
- package/docs/api/interfaces/SwitchProps.md +30 -0
- package/docs/api/interfaces/TabsContentProps.md +13 -0
- package/docs/api/interfaces/TabsListProps.md +13 -0
- package/docs/api/interfaces/TabsProps.md +13 -0
- package/docs/api/interfaces/TabsTriggerProps.md +41 -0
- package/docs/api/interfaces/TextareaProps.md +43 -0
- package/docs/api/interfaces/ToastActionElement.md +16 -0
- package/docs/api/interfaces/ToastProps.md +13 -0
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +129 -0
- package/docs/api/interfaces/UseAccessibleAppsReturn.md +55 -0
- package/docs/api/interfaces/UseFormDialogOptions.md +49 -0
- package/docs/api/interfaces/UseFormDialogReturn.md +95 -0
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +103 -0
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +91 -0
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +69 -0
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +66 -0
- package/docs/api/interfaces/UsePublicEventOptions.md +29 -0
- package/docs/api/interfaces/UsePublicEventReturn.md +56 -0
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +39 -0
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +96 -0
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +76 -0
- package/docs/api/interfaces/UseResolvedScopeOptions.md +49 -0
- package/docs/api/interfaces/UseResolvedScopeReturn.md +39 -0
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +29 -0
- package/docs/api/interfaces/UserEventAccess.md +92 -0
- package/docs/api/interfaces/UserMenuProps.md +69 -0
- package/docs/api/interfaces/UserProfile.md +49 -0
- package/docs/api/type-aliases/AccessLevel.md +11 -0
- package/docs/api/type-aliases/AccessLevelContext.md +14 -0
- package/docs/api/type-aliases/AllPermissions.md +11 -0
- package/docs/api/type-aliases/ApiError.md +37 -0
- package/docs/api/type-aliases/ApiResult.md +19 -0
- package/docs/api/type-aliases/AuditEventType.md +11 -0
- package/docs/api/type-aliases/BadgeVariant.md +18 -0
- package/docs/api/type-aliases/DataTableFeatureConfig.md +14 -0
- package/docs/api/type-aliases/DialogSize.md +13 -0
- package/docs/api/type-aliases/EventAppRole.md +11 -0
- package/docs/api/type-aliases/FileUploadProps.md +15 -0
- package/docs/api/type-aliases/GetRowId.md +33 -0
- package/docs/api/type-aliases/GlobalErrorHandler.md +35 -0
- package/docs/api/type-aliases/GlobalRole.md +11 -0
- package/docs/api/type-aliases/ImportHandlerResult.md +13 -0
- package/docs/api/type-aliases/NavigationMode.md +13 -0
- package/docs/api/type-aliases/Operation.md +11 -0
- package/docs/api/type-aliases/OrganisationContextType.md +13 -0
- package/docs/api/type-aliases/OrganisationRole.md +11 -0
- package/docs/api/type-aliases/PaceAppLayoutProps.md +14 -0
- package/docs/api/type-aliases/Permission.md +11 -0
- package/docs/api/type-aliases/PermissionCheck.md +46 -0
- package/docs/api/type-aliases/PermissionMap.md +11 -0
- package/docs/api/type-aliases/PermissionSource.md +13 -0
- package/docs/api/type-aliases/RBACConfig.md +13 -0
- package/docs/api/type-aliases/RBACFunctionResponse.md +57 -0
- package/docs/api/type-aliases/Scope.md +41 -0
- package/docs/api/type-aliases/SessionType.md +11 -0
- package/docs/api/type-aliases/UUID.md +11 -0
- package/docs/api/type-aliases/UnifiedAuthContextType.md +13 -0
- package/docs/api/type-aliases/UseFileReferenceForRecordReturn.md +161 -0
- package/docs/api/type-aliases/UseFileReferenceOptions.md +35 -0
- package/docs/api/type-aliases/UseFileReferenceReturn.md +13 -0
- package/docs/api/variables/ALL_PERMISSIONS.md +281 -0
- package/docs/api/variables/APP_PATH_MAPPING.md +14 -0
- package/docs/api/variables/AddressField.md +41 -0
- package/docs/api/variables/Alert.md +11 -0
- package/docs/api/variables/AlertDescription.md +11 -0
- package/docs/api/variables/AlertTitle.md +11 -0
- package/docs/api/variables/Avatar.md +13 -0
- package/docs/api/variables/Button.md +31 -0
- package/docs/api/variables/CACHE_PATTERNS.md +89 -0
- package/docs/api/variables/Calendar.md +74 -0
- package/docs/api/variables/Card.md +11 -0
- package/docs/api/variables/CardActions.md +11 -0
- package/docs/api/variables/CardContent.md +11 -0
- package/docs/api/variables/CardDescription.md +11 -0
- package/docs/api/variables/CardFooter.md +11 -0
- package/docs/api/variables/CardHeader.md +11 -0
- package/docs/api/variables/CardTitle.md +11 -0
- package/docs/api/variables/Checkbox.md +11 -0
- package/docs/api/variables/DEFAULT_APP_PORT_MAP.md +14 -0
- package/docs/api/variables/DEFAULT_FILE_SIZE_LIMIT.md +13 -0
- package/docs/api/variables/Dialog.md +14 -0
- package/docs/api/variables/DialogClose.md +14 -0
- package/docs/api/variables/DialogContent.md +28 -0
- package/docs/api/variables/DialogDescription.md +14 -0
- package/docs/api/variables/DialogPortal.md +14 -0
- package/docs/api/variables/DialogTitle.md +14 -0
- package/docs/api/variables/DialogTrigger.md +14 -0
- package/docs/api/variables/EVENT_APP_PERMISSIONS.md +109 -0
- package/docs/api/variables/ErrorBoundary.md +15 -0
- package/docs/api/variables/FILE_SIZE_LIMITS.md +13 -0
- package/docs/api/variables/Footer.md +11 -0
- package/docs/api/variables/GLOBAL_PERMISSIONS.md +29 -0
- package/docs/api/variables/Label.md +34 -0
- package/docs/api/variables/LoadingSpinner.md +28 -0
- package/docs/api/variables/LoginForm.md +34 -0
- package/docs/api/variables/NavigationMenu.md +203 -0
- package/docs/api/variables/ORGANISATION_PERMISSIONS.md +89 -0
- package/docs/api/variables/PAGE_PERMISSIONS.md +93 -0
- package/docs/api/variables/PaceLoginPage.md +40 -0
- package/docs/api/variables/PagePermissionGuard.md +11 -0
- package/docs/api/variables/Progress.md +32 -0
- package/docs/api/variables/SECURE_CLIENT_SYMBOL.md +14 -0
- package/docs/api/variables/STORAGE_CONFIG.md +13 -0
- package/docs/api/variables/Select.md +26 -0
- package/docs/api/variables/SelectContent.md +26 -0
- package/docs/api/variables/SelectGroup.md +26 -0
- package/docs/api/variables/SelectItem.md +26 -0
- package/docs/api/variables/SelectLabel.md +26 -0
- package/docs/api/variables/SelectSeparator.md +26 -0
- package/docs/api/variables/SelectTrigger.md +26 -0
- package/docs/api/variables/SelectValue.md +26 -0
- package/docs/api/variables/SessionRestorationLoader.md +11 -0
- package/docs/api/variables/Switch.md +23 -0
- package/docs/api/variables/Table.md +35 -0
- package/docs/api/variables/TableBody.md +11 -0
- package/docs/api/variables/TableCaption.md +11 -0
- package/docs/api/variables/TableCell.md +11 -0
- package/docs/api/variables/TableFooter.md +11 -0
- package/docs/api/variables/TableHead.md +11 -0
- package/docs/api/variables/TableHeader.md +11 -0
- package/docs/api/variables/TableRow.md +11 -0
- package/docs/api/variables/Tabs.md +25 -0
- package/docs/api/variables/TabsContent.md +24 -0
- package/docs/api/variables/TabsList.md +25 -0
- package/docs/api/variables/TabsTrigger.md +34 -0
- package/docs/api/variables/Toast.md +36 -0
- package/docs/api/variables/ToastAction.md +32 -0
- package/docs/api/variables/ToastClose.md +32 -0
- package/docs/api/variables/ToastDescription.md +32 -0
- package/docs/api/variables/ToastProvider.md +11 -0
- package/docs/api/variables/ToastTitle.md +32 -0
- package/docs/api/variables/ToastViewport.md +26 -0
- package/docs/api/variables/Tooltip.md +34 -0
- package/docs/api/variables/TooltipContent.md +34 -0
- package/docs/api/variables/TooltipProvider.md +11 -0
- package/docs/api/variables/TooltipRoot.md +11 -0
- package/docs/api/variables/TooltipTrigger.md +11 -0
- package/docs/api/variables/UserMenu.md +11 -0
- package/docs/api/variables/emailSchema.md +13 -0
- package/docs/api/variables/logger.md +203 -0
- package/docs/api/variables/nameSchema.md +13 -0
- package/docs/api/variables/passwordSchema.md +13 -0
- package/docs/api/variables/phoneSchema.md +13 -0
- package/docs/api/variables/rbacCache.md +16 -0
- package/docs/api/variables/styleConfig.md +25 -0
- package/docs/api/variables/urlSchema.md +13 -0
- package/docs/api-reference/hooks.md +2 -0
- package/docs/implementation-guides/data-tables.md +8 -0
- package/docs/rbac/getting-started.md +7 -0
- package/docs/rbac/troubleshooting.md +5 -1
- package/package.json +3 -3
- package/src/components/DataTable/hooks/useDataTableEffectiveActions.ts +29 -19
- package/src/components/DataTable/hooks/useDataTableScope.test.ts +5 -13
- package/src/components/DataTable/hooks/useDataTableScope.ts +16 -14
- package/src/components/Dialog/useDialogLifecycle.test.ts +4 -1
- package/src/components/FileDisplay/useFileDisplay.unit.test.ts +12 -8
- package/src/components/PaceAppLayout/PaceAppLayout.edge-cases.test.tsx +33 -9
- package/src/components/PaceAppLayout/useFilteredNavItems.ts +22 -7
- package/src/components/PaceAppLayout/usePaceAppLayoutConfig.ts +44 -23
- package/src/components/PaceAppLayout/usePaceAppLayoutPermissions.ts +1 -1
- package/src/components/PaceAppLayout/usePaceAppLayoutScope.ts +6 -4
- package/src/components/PaceAppLayout/useRoleBasedRouteAccess.ts +2 -2
- package/src/hooks/useAppConfig.unit.test.ts +74 -66
- package/src/hooks/useComponentPerformance.unit.test.tsx +6 -4
- package/src/hooks/useFileUrl.unit.test.ts +1 -3
- package/src/hooks/useInactivityTracker.unit.test.ts +6 -2
- package/src/hooks/usePerformanceMonitor.unit.test.ts +6 -16
- package/src/hooks/usePublicEvent.simple.test.ts +32 -47
- package/src/hooks/usePublicEvent.test.ts +9 -15
- package/src/providers/services/AuthServiceProvider.test.tsx +10 -5
- package/src/providers/services/EventServiceProvider.test.tsx +8 -3
- package/src/providers/services/InactivityServiceProvider.test.tsx +8 -3
- package/src/providers/services/OrganisationServiceProvider.test.tsx +8 -3
- package/src/rbac/README.md +7 -5
- package/src/rbac/api.test.ts +113 -56
- package/src/rbac/api.ts +80 -10
- package/src/rbac/components/NavigationGuard.tsx +2 -1
- package/src/rbac/components/PagePermissionGuard.test.tsx +23 -10
- package/src/rbac/engine.ts +23 -1
- package/src/rbac/hooks/permissions/runPermissionCheck.ts +18 -4
- package/src/rbac/hooks/permissions/useCan.test.ts +59 -20
- package/src/rbac/hooks/permissions/useCan.ts +7 -3
- package/src/rbac/hooks/permissions/useMultiplePermissions.ts +18 -9
- package/src/rbac/hooks/useCan.test.ts +2 -3
- package/src/rbac/hooks/usePageGuardScope.ts +6 -4
- package/src/rbac/hooks/usePagePermissionCheck.ts +4 -4
- package/src/rbac/hooks/useResolvedScope.ts +16 -10
- package/src/rbac/hooks/useResourcePermissions.test.ts +48 -58
- package/src/rbac/hooks/useResourcePermissions.ts +11 -20
- package/src/rbac/types.ts +3 -0
- package/src/services/AuthService.edge-cases.test.ts +2 -2
- package/src/services/EventService.ts +9 -4
- package/src/utils/file-reference/file-reference.test.ts +25 -14
- package/src/utils/supabase/createBaseClient.test.ts +30 -13
- package/docs/api/modules.md +0 -10028
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
export { ActionButtons, BulkOperationsDropdown, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, LoadingState, PaginationControls, SortIndicator, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, exportToCSV, exportToCSVWithTableRows, findSelectLabel, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, max, min, normalizeDataTableFeatures, optionMatchesSearch, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, validateHierarchicalData, validatePaginationConfig } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { ActionButtons, BulkOperationsDropdown, ColumnFactory, ColumnVisibilityDropdown, DataTable, DataTableCore, DataTableErrorBoundary, DataTableModals, DataTableToolbar, EditableRow, EmptyState, EnhancedPaginationControls, GroupingDropdown, ImportModal, LoadingState, PaginationControls, SortIndicator, UnifiedTableBody, announce, announceBulkOperation, announceFilterChange, announceLoadingState, announcePaginationChange, announceSearchResults, announceSelectionChange, announceSortChange, average, calculateAllDepths, calculateAllIndentation, calculateIndentation, calculateOptimalPageSize, cleanupLiveRegion, count, createHierarchicalStructure, defaultDataTableFeatures, exportToCSV, exportToCSVWithTableRows, findSelectLabel, generateCSVContent, getAriaSortState, getAriaSortValue, getCellRenderer, getColumnHeaderText, getHierarchicalSortConfig, getPageSizeOptions, getPaginationBinding, getRowDepth, getRowDescription, getRowIdSafe, getSortButtonLabel, groupHierarchicalData, hasValidRowId, initializeLiveRegion, isHierarchicalSortableColumn, max, min, normalizeDataTableFeatures, optionMatchesSearch, shouldShowColumnForRow, sortHierarchicalDataByStructure, sortHierarchicalDataWithSorting, sum, validateHierarchicalData, validatePaginationConfig } from './chunk-Y2LWSLLB.js';
|
|
2
|
+
import './chunk-H6RTU4DZ.js';
|
|
3
3
|
export { CircuitBreaker, DEFAULT_FALLBACK_CONFIG, DataChunkManager, DataTableError, DataTableErrorType, ErrorRecoveryManager, MemoryMonitor, SearchIndex, VisibilityTracker, chunkData, debounce, determinePaginationMode, getOptimalPageSizeOptions, safeExecute, throttle, useDataTablePerformance } from './chunk-ENLXB7GP.js';
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
4
|
+
import './chunk-2GBDPPUC.js';
|
|
5
|
+
import './chunk-S57OLCLO.js';
|
|
6
6
|
import './chunk-D6BMFMQZ.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import './chunk-YFGNMB67.js';
|
|
8
8
|
import './chunk-QRYSEPHB.js';
|
|
9
9
|
import './chunk-4SXLQIZO.js';
|
|
10
10
|
import './chunk-DDMPHZ3D.js';
|
|
11
|
-
import './chunk-
|
|
11
|
+
import './chunk-VFLR5K2H.js';
|
|
12
12
|
import './chunk-RMLY6KB5.js';
|
|
13
|
+
import './chunk-GHCUP64P.js';
|
|
13
14
|
import './chunk-BTHN5MKC.js';
|
|
14
15
|
import './chunk-44CNXN4P.js';
|
|
15
16
|
import './chunk-CU2BU2MQ.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { OrganisationContextRequiredError, clearCache, getAccessLevel, getPageScopeType, getPermissionMap, getRoleContext, hasAllPermissions, hasAnyPermission, invalidateAppCache, invalidateEventCache, invalidateOrganisationCache, invalidateUserCache, isEventAdmin, isOrganisationAdmin, isPermitted, isPermittedCached, isRBACInitialized, isSuperAdmin, resolveAppContext, setupRBAC } from './chunk-
|
|
1
|
+
export { OrganisationContextRequiredError, clearCache, getAccessLevel, getPageScopeType, getPermissionMap, getRoleContext, hasAllPermissions, hasAnyPermission, invalidateAppCache, invalidateEventCache, invalidateOrganisationCache, invalidateUserCache, isEventAdmin, isOrganisationAdmin, isPermitted, isPermittedCached, isRBACInitialized, isSuperAdmin, resolveAppContext, setupRBAC } from './chunk-YFGNMB67.js';
|
|
2
2
|
import './chunk-QRYSEPHB.js';
|
|
3
|
+
import './chunk-GHCUP64P.js';
|
|
3
4
|
import './chunk-BTHN5MKC.js';
|
|
4
5
|
import './chunk-44CNXN4P.js';
|
|
5
6
|
import './chunk-3RG5ZIWI.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventServiceContext } from './chunk-
|
|
1
|
+
import { EventServiceContext } from './chunk-S57OLCLO.js';
|
|
2
2
|
import { clearPalette, parseAndNormalizeEventColours, applyPalette } from './chunk-D6BMFMQZ.js';
|
|
3
3
|
import { assertAppId } from './chunk-4SXLQIZO.js';
|
|
4
4
|
import { fetchPlaceDetails, createAddressFromPlaceResult, getAddressByPlaceId, fetchPlaceAutocomplete, setOrganisationContext } from './chunk-XPFVT3GN.js';
|
|
@@ -1316,7 +1316,7 @@ var FileReferenceServiceImpl = class {
|
|
|
1316
1316
|
async checkSuperAdminUser(userId) {
|
|
1317
1317
|
if (!userId) return false;
|
|
1318
1318
|
try {
|
|
1319
|
-
const { isSuperAdmin } = await import('./api-
|
|
1319
|
+
const { isSuperAdmin } = await import('./api-6OQXYT67.js');
|
|
1320
1320
|
const superResult = await isSuperAdmin(userId);
|
|
1321
1321
|
if (superResult.ok && superResult.data) {
|
|
1322
1322
|
log3.debug("Super admin detected - bypassing permission checks", { userId });
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { createLogger } from './chunk-BTHN5MKC.js';
|
|
2
2
|
import { __require } from './chunk-3RG5ZIWI.js';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function cn(...inputs) {
|
|
8
|
-
return twMerge(clsx(inputs));
|
|
9
|
-
}
|
|
10
3
|
|
|
11
4
|
// src/utils/app/appNameResolver.ts
|
|
12
5
|
var log = createLogger("AppNameResolver");
|
|
@@ -108,18 +101,5 @@ function setRBACAppName(appName) {
|
|
|
108
101
|
function getCurrentAppNameWithFallback(fallback = "default-app") {
|
|
109
102
|
return getCurrentAppName() || fallback;
|
|
110
103
|
}
|
|
111
|
-
var LoadingSpinner = ({
|
|
112
|
-
size = "md",
|
|
113
|
-
className = ""
|
|
114
|
-
}) => {
|
|
115
|
-
const sizeClasses = {
|
|
116
|
-
sm: "size-4",
|
|
117
|
-
md: "size-6",
|
|
118
|
-
lg: "size-8"
|
|
119
|
-
};
|
|
120
|
-
const validSize = size && size in sizeClasses ? size : "md";
|
|
121
|
-
const sizeClass = sizeClasses[validSize];
|
|
122
|
-
return /* @__PURE__ */ jsx("canvas", { className: `inline-block animate-spin rounded-full border-2 border-solid border-current border-r-transparent motion-reduce:animate-[spin_1.5s_linear_infinite] ${sizeClass} ${className}`.trim(), role: "status", children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading..." }) });
|
|
123
|
-
};
|
|
124
104
|
|
|
125
|
-
export {
|
|
105
|
+
export { getAppNameFromBuildTime, getAppNameFromEnvironment, getAppNameFromGlobal, getAppNameFromPackageJson, getCurrentAppName, getCurrentAppNameWithFallback, setRBACAppName };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useAppConfig } from './chunk-
|
|
2
|
-
import { OrganisationContextRequiredError, getAccessLevel, getRBACLogger, isPermittedCached, isPermitted, getPermissionMap } from './chunk-
|
|
3
|
-
import { cn
|
|
1
|
+
import { useAppConfig } from './chunk-2GBDPPUC.js';
|
|
2
|
+
import { OrganisationContextRequiredError, getAccessLevel, getRBACLogger, isPermittedCached, isPermitted, getRBACConfig, getPermissionMap } from './chunk-YFGNMB67.js';
|
|
3
|
+
import { cn } from './chunk-VFLR5K2H.js';
|
|
4
|
+
import { getCurrentAppName } from './chunk-GHCUP64P.js';
|
|
4
5
|
import { createLogger } from './chunk-BTHN5MKC.js';
|
|
5
6
|
import * as React3 from 'react';
|
|
6
7
|
import { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
@@ -340,8 +341,9 @@ function useResolvedScope({
|
|
|
340
341
|
selectedEventId,
|
|
341
342
|
selectedEventOrganisationId
|
|
342
343
|
}) {
|
|
343
|
-
const
|
|
344
|
-
const
|
|
344
|
+
const rawOrgId = selectedEventOrganisationId || selectedOrganisationId || void 0;
|
|
345
|
+
const immediateOrganisationId = typeof rawOrgId === "string" && rawOrgId.trim() !== "" ? rawOrgId.trim() : void 0;
|
|
346
|
+
const immediateEventId = typeof selectedEventId === "string" && selectedEventId.trim() !== "" ? selectedEventId.trim() : void 0;
|
|
345
347
|
const [appId, setAppId] = useState(void 0);
|
|
346
348
|
const [isResolvingAppId, setIsResolvingAppId] = useState(false);
|
|
347
349
|
const [error, setError] = useState(null);
|
|
@@ -422,10 +424,11 @@ function useResolvedScope({
|
|
|
422
424
|
}, [supabase, selectedOrganisationId, selectedEventId]);
|
|
423
425
|
const immediateScope = useMemo(() => {
|
|
424
426
|
if (appName === "PORTAL" || appName === "ADMIN") {
|
|
427
|
+
if (!appId) return null;
|
|
425
428
|
return {
|
|
426
429
|
organisationId: void 0,
|
|
427
430
|
eventId: void 0,
|
|
428
|
-
appId
|
|
431
|
+
appId
|
|
429
432
|
};
|
|
430
433
|
}
|
|
431
434
|
const scope = {};
|
|
@@ -438,7 +441,7 @@ function useResolvedScope({
|
|
|
438
441
|
if (appId) {
|
|
439
442
|
scope.appId = appId;
|
|
440
443
|
}
|
|
441
|
-
if (!scope.organisationId && !scope.appId) {
|
|
444
|
+
if (!scope.organisationId && !scope.eventId && !scope.appId) {
|
|
442
445
|
return null;
|
|
443
446
|
}
|
|
444
447
|
return scope;
|
|
@@ -464,7 +467,7 @@ function useAccessLevel(userId, scope) {
|
|
|
464
467
|
try {
|
|
465
468
|
setIsLoading(true);
|
|
466
469
|
setError(null);
|
|
467
|
-
const { isSuperAdmin: checkSuperAdmin } = await import('./api-
|
|
470
|
+
const { isSuperAdmin: checkSuperAdmin } = await import('./api-6OQXYT67.js');
|
|
468
471
|
const superResult = await checkSuperAdmin(userId);
|
|
469
472
|
if (!superResult.ok) {
|
|
470
473
|
setError(new Error(superResult.error.message));
|
|
@@ -551,14 +554,21 @@ async function runPermissionCheck(params) {
|
|
|
551
554
|
}
|
|
552
555
|
const isPageName = pageId && typeof pageId === "string" && !UUID_REGEX.test(pageId);
|
|
553
556
|
const needsAppIdForPageName = isPagePermission && !!isPageName;
|
|
554
|
-
if (needsAppIdForPageName && isEmptyString(appId)) {
|
|
557
|
+
if (needsAppIdForPageName && isEmptyString(appId) && isEmptyString(eventId)) {
|
|
555
558
|
return { ok: true, data: false };
|
|
556
559
|
}
|
|
557
560
|
const validScope = {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
+
...!isEmptyString(organisationId) && organisationId ? { organisationId } : {},
|
|
562
|
+
...!isEmptyString(eventId) && eventId ? { eventId } : {},
|
|
563
|
+
...!isEmptyString(appId) && appId ? { appId } : {}
|
|
561
564
|
};
|
|
565
|
+
if (!validScope.organisationId && !validScope.eventId && !validScope.appId) {
|
|
566
|
+
return { ok: true, data: false };
|
|
567
|
+
}
|
|
568
|
+
const config = getRBACConfig();
|
|
569
|
+
if (config?.debug || config?.logLevel === "debug") {
|
|
570
|
+
getRBACLogger().debug("[RBAC] runPermissionCheck", { scope: validScope, permission, pageId, useCache });
|
|
571
|
+
}
|
|
562
572
|
if (useCache) {
|
|
563
573
|
return isPermittedCached({ userId, scope: validScope, permission, pageId }, appName);
|
|
564
574
|
}
|
|
@@ -589,7 +599,7 @@ function useSuperAdminForCan(userId, precomputedSuperAdmin) {
|
|
|
589
599
|
const checkSuperAdmin = async () => {
|
|
590
600
|
const startTime = Date.now();
|
|
591
601
|
try {
|
|
592
|
-
const { isSuperAdmin: checkSuperAdminFn } = await import('./api-
|
|
602
|
+
const { isSuperAdmin: checkSuperAdminFn } = await import('./api-6OQXYT67.js');
|
|
593
603
|
const timeoutWarning = setTimeout(() => {
|
|
594
604
|
if (!cancelled) {
|
|
595
605
|
getRBACLogger().warn("[useCan] Super admin check taking longer than 5 seconds", {
|
|
@@ -640,7 +650,7 @@ function useCan(userId, scope, permission, pageId, useCache = true, precomputedS
|
|
|
640
650
|
const [can, setCan] = useState(initialCan);
|
|
641
651
|
const [isLoading, setIsLoading] = useState(initialIsLoading);
|
|
642
652
|
const [error, setError] = useState(null);
|
|
643
|
-
const isValidScope = scope && typeof scope === "object";
|
|
653
|
+
const isValidScope = scope != null && typeof scope === "object" && !!(scope.organisationId || scope.eventId || scope.appId);
|
|
644
654
|
const organisationId = isValidScope ? scope.organisationId : void 0;
|
|
645
655
|
const eventId = isValidScope ? scope.eventId : void 0;
|
|
646
656
|
const appId = isValidScope ? scope.appId : void 0;
|
|
@@ -802,6 +812,11 @@ function useMultiplePermissions(userId, scope, permissions, useCache = true) {
|
|
|
802
812
|
setIsLoading(false);
|
|
803
813
|
return;
|
|
804
814
|
}
|
|
815
|
+
if (scope === null) {
|
|
816
|
+
setIsLoading(true);
|
|
817
|
+
setError(null);
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
805
820
|
if (isCheckingRef.current) {
|
|
806
821
|
return;
|
|
807
822
|
}
|
|
@@ -828,21 +843,24 @@ function useMultiplePermissions(userId, scope, permissions, useCache = true) {
|
|
|
828
843
|
isCheckingRef.current = false;
|
|
829
844
|
}
|
|
830
845
|
}, [userId, scope, permissions, useCache]);
|
|
846
|
+
const scopeOrgId = scope?.organisationId;
|
|
847
|
+
const scopeEventId = scope?.eventId;
|
|
848
|
+
const scopeAppId = scope?.appId;
|
|
831
849
|
useEffect(() => {
|
|
832
850
|
const permissionsKey = JSON.stringify(permissions);
|
|
833
|
-
const hasChanged = prevValuesRef.current.userId !== userId || prevValuesRef.current.organisationId !==
|
|
851
|
+
const hasChanged = prevValuesRef.current.userId !== userId || prevValuesRef.current.organisationId !== scopeOrgId || prevValuesRef.current.eventId !== scopeEventId || prevValuesRef.current.appId !== scopeAppId || prevValuesRef.current.permissions !== permissionsKey || prevValuesRef.current.useCache !== useCache;
|
|
834
852
|
if (hasChanged) {
|
|
835
853
|
prevValuesRef.current = {
|
|
836
854
|
userId,
|
|
837
|
-
organisationId:
|
|
838
|
-
eventId:
|
|
839
|
-
appId:
|
|
855
|
+
organisationId: scopeOrgId,
|
|
856
|
+
eventId: scopeEventId,
|
|
857
|
+
appId: scopeAppId,
|
|
840
858
|
permissions: permissionsKey,
|
|
841
859
|
useCache
|
|
842
860
|
};
|
|
843
861
|
checkPermissions();
|
|
844
862
|
}
|
|
845
|
-
}, [userId,
|
|
863
|
+
}, [userId, scopeOrgId, scopeEventId, scopeAppId, permissions, useCache, checkPermissions]);
|
|
846
864
|
return useMemo(() => ({
|
|
847
865
|
results,
|
|
848
866
|
isLoading,
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { useRBAC, useSecureSupabase, AccessDenied } from './chunk-
|
|
2
|
-
import { Input, Label, Select, SelectTrigger, SelectContent, SelectLabel, SelectSeparator, SelectItem, Dialog, DialogContent, DialogHeader, DialogTitle, SelectValue, DialogBody, DialogFooter, deriveFormKey, useSessionDraft, filterSensitiveFields, isSensitiveField, SelectGroup, Progress } from './chunk-
|
|
3
|
-
import { Button, Card, CardHeader, CardTitle, CardDescription, CardContent, Alert, AlertDescription, CardFooter, usePermissions, useResolvedScope, AlertTitle, useCan } from './chunk-
|
|
4
|
-
import { useAddressAutocomplete, createFileReferenceService, usePublicFileDisplay, useFileDisplay, uploadFileWithReference, getPublicUrl, getSignedUrl, generateFileUrlsBatch, useEventTheme, usePreventTabReload } from './chunk-
|
|
5
|
-
import { useOrganisationSecurity, useEvents, useOptionalEvents } from './chunk-
|
|
1
|
+
import { useRBAC, useSecureSupabase, AccessDenied } from './chunk-NJ7FGQWB.js';
|
|
2
|
+
import { Input, Label, Select, SelectTrigger, SelectContent, SelectLabel, SelectSeparator, SelectItem, Dialog, DialogContent, DialogHeader, DialogTitle, SelectValue, DialogBody, DialogFooter, deriveFormKey, useSessionDraft, filterSensitiveFields, isSensitiveField, SelectGroup, Progress } from './chunk-Y2LWSLLB.js';
|
|
3
|
+
import { Button, Card, CardHeader, CardTitle, CardDescription, CardContent, Alert, AlertDescription, CardFooter, usePermissions, useResolvedScope, AlertTitle, useCan } from './chunk-H6RTU4DZ.js';
|
|
4
|
+
import { useAddressAutocomplete, createFileReferenceService, usePublicFileDisplay, useFileDisplay, uploadFileWithReference, getPublicUrl, getSignedUrl, generateFileUrlsBatch, useEventTheme, usePreventTabReload } from './chunk-AP5FG7W4.js';
|
|
5
|
+
import { useOrganisationSecurity, useEvents, useOptionalEvents } from './chunk-QWIG36BZ.js';
|
|
6
6
|
import { useToast } from './chunk-ENLXB7GP.js';
|
|
7
|
-
import { useIsPublicPage, PublicPageContext, useAppConfig } from './chunk-
|
|
8
|
-
import { useUnifiedAuth, useOrganisations, UnifiedAuthContext, EventServiceContext, useSessionRestoration } from './chunk-
|
|
7
|
+
import { useIsPublicPage, PublicPageContext, useAppConfig } from './chunk-2GBDPPUC.js';
|
|
8
|
+
import { useUnifiedAuth, useOrganisations, UnifiedAuthContext, EventServiceContext, useSessionRestoration } from './chunk-S57OLCLO.js';
|
|
9
9
|
import { setupPrintDateTime, clearPalette } from './chunk-D6BMFMQZ.js';
|
|
10
|
-
import { EventContextRequiredError, OrganisationContextRequiredError, isSuperAdmin } from './chunk-
|
|
10
|
+
import { EventContextRequiredError, OrganisationContextRequiredError, isSuperAdmin } from './chunk-YFGNMB67.js';
|
|
11
11
|
import { assertAppId } from './chunk-4SXLQIZO.js';
|
|
12
12
|
import { getUserTimeZone, getAppIcon, getAppId, formatFileSize } from './chunk-XOJME5T7.js';
|
|
13
|
-
import { cn, LoadingSpinner
|
|
13
|
+
import { cn, LoadingSpinner } from './chunk-VFLR5K2H.js';
|
|
14
14
|
import { performanceBudgetMonitor } from './chunk-XPFVT3GN.js';
|
|
15
|
+
import { getCurrentAppName } from './chunk-GHCUP64P.js';
|
|
15
16
|
import { createLogger, logger } from './chunk-BTHN5MKC.js';
|
|
16
17
|
import * as React from 'react';
|
|
17
18
|
import React__default, { useState, useRef, useMemo, useCallback, useEffect, createContext, useContext, Component } from 'react';
|
|
@@ -3707,7 +3708,7 @@ function useNavigationScope({
|
|
|
3707
3708
|
}
|
|
3708
3709
|
const userId = authContext.user.id;
|
|
3709
3710
|
const appName = authContext.appName;
|
|
3710
|
-
import('./api-
|
|
3711
|
+
import('./api-6OQXYT67.js').then(({ resolveAppContext }) => {
|
|
3711
3712
|
resolveAppContext({ userId, appName }).then((result) => {
|
|
3712
3713
|
if (result?.ok && result.data?.appId) {
|
|
3713
3714
|
setResolvedAppId(result.data.appId);
|
|
@@ -4369,7 +4370,7 @@ async function getEarlyReturnItems(user, scope, baseMenuItems) {
|
|
|
4369
4370
|
if (!user?.id) return baseMenuItems;
|
|
4370
4371
|
if (!scope.organisationId) return baseMenuItems;
|
|
4371
4372
|
try {
|
|
4372
|
-
const { isSuperAdmin: checkSuperAdminDynamic } = await import('./api-
|
|
4373
|
+
const { isSuperAdmin: checkSuperAdminDynamic } = await import('./api-6OQXYT67.js');
|
|
4373
4374
|
const superResult = await checkSuperAdminDynamic(user.id);
|
|
4374
4375
|
if (superResult.ok && superResult.data) return baseMenuItems;
|
|
4375
4376
|
} catch (error) {
|
|
@@ -4412,6 +4413,13 @@ function applyFilterResults(filtered, baseMenuItems, scope) {
|
|
|
4412
4413
|
}
|
|
4413
4414
|
return accessibleItems;
|
|
4414
4415
|
}
|
|
4416
|
+
function navItemsEqual(a, b) {
|
|
4417
|
+
if (a.length !== b.length) return false;
|
|
4418
|
+
return a.every((item, i) => {
|
|
4419
|
+
const other = b[i];
|
|
4420
|
+
return other && item.id === other.id && item.href === other.href;
|
|
4421
|
+
});
|
|
4422
|
+
}
|
|
4415
4423
|
function useFilteredNavItems(options) {
|
|
4416
4424
|
const {
|
|
4417
4425
|
baseMenuItems,
|
|
@@ -4429,17 +4437,23 @@ function useFilteredNavItems(options) {
|
|
|
4429
4437
|
selectedEventId
|
|
4430
4438
|
} = options;
|
|
4431
4439
|
const [filteredMenuItems, setFilteredMenuItems] = useState(baseMenuItems);
|
|
4440
|
+
const runIdRef = useRef(0);
|
|
4432
4441
|
useEffect(() => {
|
|
4442
|
+
const runId = ++runIdRef.current;
|
|
4433
4443
|
let isMounted = true;
|
|
4444
|
+
const isStale = () => !isMounted || runIdRef.current !== runId;
|
|
4434
4445
|
const filterItems = async () => {
|
|
4446
|
+
if (scope === null) {
|
|
4447
|
+
return;
|
|
4448
|
+
}
|
|
4435
4449
|
const earlyItems = await getEarlyReturnItems(user, scope, baseMenuItems);
|
|
4436
4450
|
if (earlyItems !== null) {
|
|
4437
|
-
if (
|
|
4451
|
+
if (!isStale()) setFilteredMenuItems((prev) => navItemsEqual(prev, earlyItems) ? prev : earlyItems);
|
|
4438
4452
|
return;
|
|
4439
4453
|
}
|
|
4440
4454
|
try {
|
|
4441
4455
|
const currentScope = scope;
|
|
4442
|
-
const { getPermissionMap, getPageScopeType } = await import('./api-
|
|
4456
|
+
const { getPermissionMap, getPageScopeType } = await import('./api-6OQXYT67.js');
|
|
4443
4457
|
const permissionScope = {
|
|
4444
4458
|
organisationId: currentScope.organisationId,
|
|
4445
4459
|
eventId: currentScope.eventId,
|
|
@@ -4450,7 +4464,7 @@ function useFilteredNavItems(options) {
|
|
|
4450
4464
|
scope: permissionScope
|
|
4451
4465
|
});
|
|
4452
4466
|
if (!mapResult.ok) {
|
|
4453
|
-
if (
|
|
4467
|
+
if (!isStale()) setFilteredMenuItems((prev) => navItemsEqual(prev, baseMenuItems) ? prev : baseMenuItems);
|
|
4454
4468
|
return;
|
|
4455
4469
|
}
|
|
4456
4470
|
const permissionMap = mapResult.data;
|
|
@@ -4467,15 +4481,15 @@ function useFilteredNavItems(options) {
|
|
|
4467
4481
|
const filtered = await Promise.all(
|
|
4468
4482
|
baseMenuItems.map((item) => filterNavItemByPermissionAndScope(item, filterOptions))
|
|
4469
4483
|
);
|
|
4470
|
-
if (
|
|
4484
|
+
if (isStale()) return;
|
|
4471
4485
|
const itemsToSet = applyFilterResults(filtered, baseMenuItems, currentScope);
|
|
4472
|
-
setFilteredMenuItems(itemsToSet);
|
|
4486
|
+
setFilteredMenuItems((prev) => navItemsEqual(prev, itemsToSet) ? prev : itemsToSet);
|
|
4473
4487
|
} catch (error) {
|
|
4474
4488
|
logger.error("PaceAppLayout", "Failed to load permission map for navigation filtering", {
|
|
4475
4489
|
userId: user?.id,
|
|
4476
4490
|
error
|
|
4477
4491
|
});
|
|
4478
|
-
if (
|
|
4492
|
+
if (!isStale()) setFilteredMenuItems((prev) => navItemsEqual(prev, baseMenuItems) ? prev : baseMenuItems);
|
|
4479
4493
|
}
|
|
4480
4494
|
};
|
|
4481
4495
|
filterItems();
|
|
@@ -4513,7 +4527,7 @@ function useRoleBasedRouteAccess(options) {
|
|
|
4513
4527
|
onRouteStrictModeViolation
|
|
4514
4528
|
} = options;
|
|
4515
4529
|
useEffect(() => {
|
|
4516
|
-
if (!roleBasedRouting || routeConfig.length === 0) return;
|
|
4530
|
+
if (!roleBasedRouting || routeConfig.length === 0 || scope === null) return;
|
|
4517
4531
|
let isMounted = true;
|
|
4518
4532
|
const checkRouteAccess = async () => {
|
|
4519
4533
|
const currentRoute = routeConfig.find((route) => route.path === currentPath);
|
|
@@ -4533,7 +4547,7 @@ function useRoleBasedRouteAccess(options) {
|
|
|
4533
4547
|
let hasAccess = true;
|
|
4534
4548
|
if (currentRoute.pageId && currentRoute.permissions && currentRoute.permissions.length > 0) {
|
|
4535
4549
|
try {
|
|
4536
|
-
const { isPermittedCached } = await import('./api-
|
|
4550
|
+
const { isPermittedCached } = await import('./api-6OQXYT67.js');
|
|
4537
4551
|
const hasPagePermission = await isPermittedCached({
|
|
4538
4552
|
userId: user?.id || "",
|
|
4539
4553
|
scope,
|
|
@@ -4593,8 +4607,6 @@ function useRoleBasedRouteAccess(options) {
|
|
|
4593
4607
|
onRouteStrictModeViolation
|
|
4594
4608
|
]);
|
|
4595
4609
|
}
|
|
4596
|
-
|
|
4597
|
-
// src/components/PaceAppLayout/usePaceAppLayoutConfig.ts
|
|
4598
4610
|
var EMPTY_PAGE_ID_MAPPING = {};
|
|
4599
4611
|
var EMPTY_ROUTE_PERMISSIONS = {};
|
|
4600
4612
|
function mergePermissionConfig(flat, config) {
|
|
@@ -4623,28 +4635,48 @@ function mergeRoutingConfig(flat, config) {
|
|
|
4623
4635
|
};
|
|
4624
4636
|
}
|
|
4625
4637
|
function usePaceAppLayoutConfig(props) {
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4638
|
+
return useMemo(() => {
|
|
4639
|
+
const flatPerm = {
|
|
4640
|
+
enforcePermissions: props.enforcePermissions ?? false,
|
|
4641
|
+
defaultPermission: props.defaultPermission ?? "read",
|
|
4642
|
+
routePermissions: props.routePermissions ?? EMPTY_ROUTE_PERMISSIONS,
|
|
4643
|
+
permissionFallback: props.permissionFallback,
|
|
4644
|
+
pageIdMapping: props.pageIdMapping ?? EMPTY_PAGE_ID_MAPPING,
|
|
4645
|
+
strictMode: props.strictMode ?? true,
|
|
4646
|
+
enforcePagePermissions: props.enforcePagePermissions ?? false,
|
|
4647
|
+
pagePermissionFallback: props.pagePermissionFallback,
|
|
4648
|
+
onPageAccessDenied: props.onPageAccessDenied,
|
|
4649
|
+
onStrictModeViolation: props.onStrictModeViolation
|
|
4650
|
+
};
|
|
4651
|
+
const flatRoute = {
|
|
4652
|
+
roleBasedRouting: props.roleBasedRouting ?? false,
|
|
4653
|
+
routeConfig: props.routeConfig ?? [],
|
|
4654
|
+
fallbackRoute: props.fallbackRoute ?? "/unauthorized",
|
|
4655
|
+
onRouteAccessDenied: props.onRouteAccessDenied,
|
|
4656
|
+
onRouteStrictModeViolation: props.onRouteStrictModeViolation
|
|
4657
|
+
};
|
|
4658
|
+
const perm = mergePermissionConfig(flatPerm, props.permissionConfig);
|
|
4659
|
+
const route = mergeRoutingConfig(flatRoute, props.routingConfig);
|
|
4660
|
+
return { ...perm, ...route };
|
|
4661
|
+
}, [
|
|
4662
|
+
props.enforcePermissions,
|
|
4663
|
+
props.defaultPermission,
|
|
4664
|
+
props.routePermissions,
|
|
4665
|
+
props.permissionFallback,
|
|
4666
|
+
props.pageIdMapping,
|
|
4667
|
+
props.strictMode,
|
|
4668
|
+
props.enforcePagePermissions,
|
|
4669
|
+
props.pagePermissionFallback,
|
|
4670
|
+
props.onPageAccessDenied,
|
|
4671
|
+
props.onStrictModeViolation,
|
|
4672
|
+
props.roleBasedRouting,
|
|
4673
|
+
props.routeConfig,
|
|
4674
|
+
props.fallbackRoute,
|
|
4675
|
+
props.onRouteAccessDenied,
|
|
4676
|
+
props.onRouteStrictModeViolation,
|
|
4677
|
+
props.permissionConfig,
|
|
4678
|
+
props.routingConfig
|
|
4679
|
+
]);
|
|
4648
4680
|
}
|
|
4649
4681
|
function usePaceAppLayoutPermissions({
|
|
4650
4682
|
config,
|
|
@@ -4848,12 +4880,14 @@ function usePaceAppLayoutScope({
|
|
|
4848
4880
|
const scopeEventId = resolvedScope?.eventId || selectedEvent?.event_id || void 0;
|
|
4849
4881
|
const scopeAppId = resolvedScope?.appId || resolvedAppId || void 0;
|
|
4850
4882
|
const scope = useMemo(() => {
|
|
4883
|
+
if (scopeLoading || resolvedScope === null) return null;
|
|
4851
4884
|
const newScope = {};
|
|
4852
|
-
if (scopeOrgId) newScope.organisationId = scopeOrgId;
|
|
4885
|
+
if (scopeOrgId && scopeOrgId.trim() !== "") newScope.organisationId = scopeOrgId;
|
|
4853
4886
|
if (scopeEventId) newScope.eventId = scopeEventId;
|
|
4854
4887
|
if (scopeAppId) newScope.appId = scopeAppId;
|
|
4888
|
+
if (!newScope.organisationId && !newScope.eventId && !newScope.appId) return null;
|
|
4855
4889
|
return newScope;
|
|
4856
|
-
}, [scopeOrgId, scopeEventId, scopeAppId]);
|
|
4890
|
+
}, [scopeLoading, resolvedScope, scopeOrgId, scopeEventId, scopeAppId]);
|
|
4857
4891
|
const baseMenuItems = useMemo(
|
|
4858
4892
|
() => navItems ?? DEFAULT_NAV_ITEMS,
|
|
4859
4893
|
[navItems]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useOrganisationSecurity } from './chunk-
|
|
2
|
-
import { usePublicPageContext } from './chunk-
|
|
3
|
-
import { useOrganisations } from './chunk-
|
|
1
|
+
import { useOrganisationSecurity } from './chunk-QWIG36BZ.js';
|
|
2
|
+
import { usePublicPageContext } from './chunk-2GBDPPUC.js';
|
|
3
|
+
import { useOrganisations } from './chunk-S57OLCLO.js';
|
|
4
4
|
import { assertOrganisationId } from './chunk-4SXLQIZO.js';
|
|
5
5
|
import { createLogger, logger } from './chunk-BTHN5MKC.js';
|
|
6
6
|
import { useForm } from 'react-hook-form';
|