@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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / Tooltip
|
|
6
|
+
|
|
7
|
+
# Variable: Tooltip
|
|
8
|
+
|
|
9
|
+
> `const` **Tooltip**: `ForwardRefExoticComponent`\<`TooltipProps` & `RefAttributes`\<`HTMLButtonElement`\>\>
|
|
10
|
+
|
|
11
|
+
Defined in: [components/Tooltip/Tooltip.tsx:142](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Tooltip/Tooltip.tsx#L142)
|
|
12
|
+
|
|
13
|
+
Tooltip component
|
|
14
|
+
A simplified tooltip component for easy usage
|
|
15
|
+
|
|
16
|
+
## Param
|
|
17
|
+
|
|
18
|
+
Tooltip configuration
|
|
19
|
+
|
|
20
|
+
## Param
|
|
21
|
+
|
|
22
|
+
Forwarded ref to the trigger element
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
JSX.Element - The tooltip with trigger and content
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<Tooltip content="This is a helpful tooltip">
|
|
32
|
+
<Button>Hover me</Button>
|
|
33
|
+
</Tooltip>
|
|
34
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / TooltipContent
|
|
6
|
+
|
|
7
|
+
# Variable: TooltipContent
|
|
8
|
+
|
|
9
|
+
> `const` **TooltipContent**: `ForwardRefExoticComponent`\<`Omit`\<`TooltipContentProps` & `RefAttributes`\<`HTMLDivElement`\>, `"ref"`\> & `RefAttributes`\<`HTMLDivElement`\>\>
|
|
10
|
+
|
|
11
|
+
Defined in: [components/Tooltip/Tooltip.tsx:99](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Tooltip/Tooltip.tsx#L99)
|
|
12
|
+
|
|
13
|
+
TooltipContent component
|
|
14
|
+
The content container for tooltip information
|
|
15
|
+
|
|
16
|
+
## Param
|
|
17
|
+
|
|
18
|
+
Content configuration and styling
|
|
19
|
+
|
|
20
|
+
## Param
|
|
21
|
+
|
|
22
|
+
Forwarded ref to the content element
|
|
23
|
+
|
|
24
|
+
## Returns
|
|
25
|
+
|
|
26
|
+
JSX.Element - The tooltip content container
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
<TooltipContent side="top" className="bg-main-500">
|
|
32
|
+
Custom tooltip content
|
|
33
|
+
</TooltipContent>
|
|
34
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / TooltipProvider
|
|
6
|
+
|
|
7
|
+
# Variable: TooltipProvider
|
|
8
|
+
|
|
9
|
+
> `const` **TooltipProvider**: `FC`\<`TooltipProviderProps`\> = `TooltipPrimitive.Provider`
|
|
10
|
+
|
|
11
|
+
Defined in: [components/Tooltip/Tooltip.tsx:78](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Tooltip/Tooltip.tsx#L78)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / TooltipRoot
|
|
6
|
+
|
|
7
|
+
# Variable: TooltipRoot
|
|
8
|
+
|
|
9
|
+
> `const` **TooltipRoot**: `FC`\<`TooltipProps`\> = `TooltipPrimitive.Root`
|
|
10
|
+
|
|
11
|
+
Defined in: [components/Tooltip/Tooltip.tsx:80](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Tooltip/Tooltip.tsx#L80)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / TooltipTrigger
|
|
6
|
+
|
|
7
|
+
# Variable: TooltipTrigger
|
|
8
|
+
|
|
9
|
+
> `const` **TooltipTrigger**: `ForwardRefExoticComponent`\<`TooltipTriggerProps` & `RefAttributes`\<`HTMLButtonElement`\>\> = `TooltipPrimitive.Trigger`
|
|
10
|
+
|
|
11
|
+
Defined in: [components/Tooltip/Tooltip.tsx:82](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Tooltip/Tooltip.tsx#L82)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / UserMenu
|
|
6
|
+
|
|
7
|
+
# Variable: UserMenu
|
|
8
|
+
|
|
9
|
+
> `const` **UserMenu**: `NamedExoticComponent`\<[`UserMenuProps`](../interfaces/UserMenuProps.md)\>
|
|
10
|
+
|
|
11
|
+
Defined in: [components/UserMenu/UserMenu.tsx:137](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/UserMenu/UserMenu.tsx#L137)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / emailSchema
|
|
6
|
+
|
|
7
|
+
# Variable: emailSchema
|
|
8
|
+
|
|
9
|
+
> `const` **emailSchema**: `ZodString`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/validation/common.ts:12](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/validation/common.ts#L12)
|
|
12
|
+
|
|
13
|
+
Email validation schema
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / logger
|
|
6
|
+
|
|
7
|
+
# Variable: logger
|
|
8
|
+
|
|
9
|
+
> `const` **logger**: `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/core/logger.ts:167](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/core/logger.ts#L167)
|
|
12
|
+
|
|
13
|
+
Default logger instance for convenience
|
|
14
|
+
|
|
15
|
+
## Type Declaration
|
|
16
|
+
|
|
17
|
+
### debug()
|
|
18
|
+
|
|
19
|
+
> **debug**: (`component`, `message`, ...`args`) => `void`
|
|
20
|
+
|
|
21
|
+
#### Parameters
|
|
22
|
+
|
|
23
|
+
##### component
|
|
24
|
+
|
|
25
|
+
`string`
|
|
26
|
+
|
|
27
|
+
##### message
|
|
28
|
+
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
##### args
|
|
32
|
+
|
|
33
|
+
...`unknown`[]
|
|
34
|
+
|
|
35
|
+
#### Returns
|
|
36
|
+
|
|
37
|
+
`void`
|
|
38
|
+
|
|
39
|
+
### info()
|
|
40
|
+
|
|
41
|
+
> **info**: (`component`, `message`, ...`args`) => `void`
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
##### component
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
##### message
|
|
50
|
+
|
|
51
|
+
`string`
|
|
52
|
+
|
|
53
|
+
##### args
|
|
54
|
+
|
|
55
|
+
...`unknown`[]
|
|
56
|
+
|
|
57
|
+
#### Returns
|
|
58
|
+
|
|
59
|
+
`void`
|
|
60
|
+
|
|
61
|
+
### warn()
|
|
62
|
+
|
|
63
|
+
> **warn**: (`component`, `message`, ...`args`) => `void`
|
|
64
|
+
|
|
65
|
+
#### Parameters
|
|
66
|
+
|
|
67
|
+
##### component
|
|
68
|
+
|
|
69
|
+
`string`
|
|
70
|
+
|
|
71
|
+
##### message
|
|
72
|
+
|
|
73
|
+
`string`
|
|
74
|
+
|
|
75
|
+
##### args
|
|
76
|
+
|
|
77
|
+
...`unknown`[]
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`void`
|
|
82
|
+
|
|
83
|
+
### error()
|
|
84
|
+
|
|
85
|
+
> **error**: (`component`, `message`, ...`args`) => `void`
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
##### component
|
|
90
|
+
|
|
91
|
+
`string`
|
|
92
|
+
|
|
93
|
+
##### message
|
|
94
|
+
|
|
95
|
+
`string`
|
|
96
|
+
|
|
97
|
+
##### args
|
|
98
|
+
|
|
99
|
+
...`unknown`[]
|
|
100
|
+
|
|
101
|
+
#### Returns
|
|
102
|
+
|
|
103
|
+
`void`
|
|
104
|
+
|
|
105
|
+
### createScopedLogger()
|
|
106
|
+
|
|
107
|
+
> **createScopedLogger**: (`component`) => `object`
|
|
108
|
+
|
|
109
|
+
#### Parameters
|
|
110
|
+
|
|
111
|
+
##### component
|
|
112
|
+
|
|
113
|
+
`string`
|
|
114
|
+
|
|
115
|
+
#### Returns
|
|
116
|
+
|
|
117
|
+
`object`
|
|
118
|
+
|
|
119
|
+
##### debug()
|
|
120
|
+
|
|
121
|
+
> **debug**: (`message`, ...`args`) => `void`
|
|
122
|
+
|
|
123
|
+
###### Parameters
|
|
124
|
+
|
|
125
|
+
###### message
|
|
126
|
+
|
|
127
|
+
`string`
|
|
128
|
+
|
|
129
|
+
###### args
|
|
130
|
+
|
|
131
|
+
...`unknown`[]
|
|
132
|
+
|
|
133
|
+
###### Returns
|
|
134
|
+
|
|
135
|
+
`void`
|
|
136
|
+
|
|
137
|
+
##### info()
|
|
138
|
+
|
|
139
|
+
> **info**: (`message`, ...`args`) => `void`
|
|
140
|
+
|
|
141
|
+
###### Parameters
|
|
142
|
+
|
|
143
|
+
###### message
|
|
144
|
+
|
|
145
|
+
`string`
|
|
146
|
+
|
|
147
|
+
###### args
|
|
148
|
+
|
|
149
|
+
...`unknown`[]
|
|
150
|
+
|
|
151
|
+
###### Returns
|
|
152
|
+
|
|
153
|
+
`void`
|
|
154
|
+
|
|
155
|
+
##### warn()
|
|
156
|
+
|
|
157
|
+
> **warn**: (`message`, ...`args`) => `void`
|
|
158
|
+
|
|
159
|
+
###### Parameters
|
|
160
|
+
|
|
161
|
+
###### message
|
|
162
|
+
|
|
163
|
+
`string`
|
|
164
|
+
|
|
165
|
+
###### args
|
|
166
|
+
|
|
167
|
+
...`unknown`[]
|
|
168
|
+
|
|
169
|
+
###### Returns
|
|
170
|
+
|
|
171
|
+
`void`
|
|
172
|
+
|
|
173
|
+
##### error()
|
|
174
|
+
|
|
175
|
+
> **error**: (`message`, ...`args`) => `void`
|
|
176
|
+
|
|
177
|
+
###### Parameters
|
|
178
|
+
|
|
179
|
+
###### message
|
|
180
|
+
|
|
181
|
+
`string`
|
|
182
|
+
|
|
183
|
+
###### args
|
|
184
|
+
|
|
185
|
+
...`unknown`[]
|
|
186
|
+
|
|
187
|
+
###### Returns
|
|
188
|
+
|
|
189
|
+
`void`
|
|
190
|
+
|
|
191
|
+
### configure()
|
|
192
|
+
|
|
193
|
+
> **configure**: (`config`) => `void`
|
|
194
|
+
|
|
195
|
+
#### Parameters
|
|
196
|
+
|
|
197
|
+
##### config
|
|
198
|
+
|
|
199
|
+
`Partial`\<[`LoggerConfig`](../interfaces/LoggerConfig.md)\>
|
|
200
|
+
|
|
201
|
+
#### Returns
|
|
202
|
+
|
|
203
|
+
`void`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / nameSchema
|
|
6
|
+
|
|
7
|
+
# Variable: nameSchema
|
|
8
|
+
|
|
9
|
+
> `const` **nameSchema**: `ZodString`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/validation/common.ts:21](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/validation/common.ts#L21)
|
|
12
|
+
|
|
13
|
+
Name validation schema
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / passwordSchema
|
|
6
|
+
|
|
7
|
+
# Variable: passwordSchema
|
|
8
|
+
|
|
9
|
+
> `const` **passwordSchema**: `ZodString`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/validation/passwordSchema.ts:67](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/validation/passwordSchema.ts#L67)
|
|
12
|
+
|
|
13
|
+
Basic password schema for less strict requirements
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / phoneSchema
|
|
6
|
+
|
|
7
|
+
# Variable: phoneSchema
|
|
8
|
+
|
|
9
|
+
> `const` **phoneSchema**: `ZodString`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/validation/common.ts:30](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/validation/common.ts#L30)
|
|
12
|
+
|
|
13
|
+
Phone number validation schema
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / rbacCache
|
|
6
|
+
|
|
7
|
+
# Variable: rbacCache
|
|
8
|
+
|
|
9
|
+
> `const` **rbacCache**: [`RBACCache`](../classes/RBACCache.md)
|
|
10
|
+
|
|
11
|
+
Defined in: [rbac/cache.ts:302](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/cache.ts#L302)
|
|
12
|
+
|
|
13
|
+
Global cache instance
|
|
14
|
+
|
|
15
|
+
This is the default cache instance used by the RBAC system.
|
|
16
|
+
You can create additional instances if needed for different contexts.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / styleConfig
|
|
6
|
+
|
|
7
|
+
# Variable: styleConfig
|
|
8
|
+
|
|
9
|
+
> `const` **styleConfig**: `object`
|
|
10
|
+
|
|
11
|
+
Defined in: [styles/index.ts:32](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/styles/index.ts#L32)
|
|
12
|
+
|
|
13
|
+
## Type Declaration
|
|
14
|
+
|
|
15
|
+
### core
|
|
16
|
+
|
|
17
|
+
> `readonly` **core**: `object`
|
|
18
|
+
|
|
19
|
+
#### core.path
|
|
20
|
+
|
|
21
|
+
> `readonly` **path**: `"./core.css"` = `'./core.css'`
|
|
22
|
+
|
|
23
|
+
#### core.description
|
|
24
|
+
|
|
25
|
+
> `readonly` **description**: `"Complete CSS foundation including base styles, theme mappings, fonts, resets, and neutral tokens"` = `'Complete CSS foundation including base styles, theme mappings, fonts, resets, and neutral tokens'`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[**@jmruthers/pace-core v0.6.12**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@jmruthers/pace-core](../globals.md) / urlSchema
|
|
6
|
+
|
|
7
|
+
# Variable: urlSchema
|
|
8
|
+
|
|
9
|
+
> `const` **urlSchema**: `ZodString`
|
|
10
|
+
|
|
11
|
+
Defined in: [utils/validation/common.ts:39](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/utils/validation/common.ts#L39)
|
|
12
|
+
|
|
13
|
+
URL validation schema
|
|
@@ -288,6 +288,8 @@ function UserActions({ userId, scope }) {
|
|
|
288
288
|
}
|
|
289
289
|
```
|
|
290
290
|
|
|
291
|
+
**Page-name permission checks:** For checks that use a page name (e.g. `useCan(userId, scope, 'read:page.items', 'items')`), scope should include `appId` so the backend can resolve event roles. For event-scoped pages, include both `eventId` and `appId`; when `eventId` is present but `appId` is missing, pace-core may resolve `appId` from the current app name. You can also use `useResolvedScope` to obtain a scope with `organisationId`, `eventId`, and `appId`.
|
|
292
|
+
|
|
291
293
|
### usePermissions
|
|
292
294
|
|
|
293
295
|
Get all permissions for a user in a specific scope.
|
|
@@ -50,6 +50,14 @@ When `deleteSelected` is enabled, a **confirmation dialog** is shown by pace-cor
|
|
|
50
50
|
>
|
|
51
51
|
> The DataTable simply calls your provided handlers (`onDeleteRow`, `onEditRow`, `onCreateRow`) - it does not intercept or modify them to add audit logging.
|
|
52
52
|
|
|
53
|
+
### Organisation and event context (edit/delete buttons)
|
|
54
|
+
|
|
55
|
+
DataTable permission checks (and thus visibility of edit/delete/import buttons) depend on **RBAC scope**: organisation and, for event-scoped pages, **event** must be available when the table mounts.
|
|
56
|
+
|
|
57
|
+
- **If organisation or event is set asynchronously** (e.g. after navigation or from a restored session), the first render may have no scope or incomplete scope, so permission checks return "no access" and buttons stay hidden. After a **refresh**, context is often already in state, so scope is ready and buttons appear.
|
|
58
|
+
- **Fix in the app:** Ensure organisation and, for event-scoped pages, event are set **before** or **as** the user reaches the page (e.g. from URL, storage, or a layout that sets context on load). That way scope is ready when the DataTable runs its permission checks and edit/delete/import buttons show without needing a refresh.
|
|
59
|
+
- **Event-scoped pages (e.g. CAKE units/menus):** The selected **event** must be in scope. If the user navigates to the page without an event selected, scope is incomplete and buttons will not show until context is set (or the page is refreshed with event in state).
|
|
60
|
+
|
|
53
61
|
## Basic Usage
|
|
54
62
|
|
|
55
63
|
### Simple Data Table
|
|
@@ -837,6 +837,13 @@ function AdaptiveComponent({ appId }) {
|
|
|
837
837
|
}
|
|
838
838
|
```
|
|
839
839
|
|
|
840
|
+
### Page permissions and scope
|
|
841
|
+
|
|
842
|
+
For page permission checks that use a **page name** (e.g. `useCan(userId, scope, 'read:page.items', 'items')`), the backend can only return **event-role** permissions when the scope includes both `eventId` and `appId`. For event-scoped pages, include both in scope so the RPC considers event roles (e.g. `planner`, `event_admin`).
|
|
843
|
+
|
|
844
|
+
- **Scope:** When calling `useCan` for event-scoped page permissions, pass a scope that includes `eventId` and `appId` (and `organisationId` when required). The library may resolve `appId` from the current app name when `eventId` is present but `appId` is missing, so you can pass `{ organisationId, eventId }` and pace-core will resolve `appId` before calling the backend.
|
|
845
|
+
- **useResolvedScope:** For event-scoped pages, you can use the `useResolvedScope` hook to obtain a scope with `organisationId`, `eventId`, and `appId` resolved from the current app and selection context.
|
|
846
|
+
|
|
840
847
|
## Next Steps
|
|
841
848
|
|
|
842
849
|
- [API Reference](./api-reference.md) - Complete API documentation
|
|
@@ -143,9 +143,13 @@ setupRBAC(supabase, {
|
|
|
143
143
|
- Console shows `scope: { organisationId: "...", eventId: "..." }` (missing `appId`)
|
|
144
144
|
- All permission checks return `false`
|
|
145
145
|
|
|
146
|
-
**Root Cause:** App name not
|
|
146
|
+
**Root Cause:** For page permission checks with a page name, the backend returns event-role permissions only when both `eventId` and `appId` are provided. If scope is missing `appId`, event-scoped page checks may deny. App name may also not be set globally for RBAC resolution.
|
|
147
147
|
|
|
148
148
|
**Fix:**
|
|
149
|
+
|
|
150
|
+
For **event-scoped page checks**, scope should include both `eventId` and `appId`. pace-core can resolve `appId` from the current app name when `eventId` is present (so passing `{ organisationId, eventId }` is enough in that case). Alternatively, use the `useResolvedScope` hook to obtain a scope with `organisationId`, `eventId`, and `appId` before calling `useCan`.
|
|
151
|
+
|
|
152
|
+
**Fix (app name not set):**
|
|
149
153
|
```typescript
|
|
150
154
|
// ❌ WRONG - Missing setRBACAppName call
|
|
151
155
|
import { UnifiedAuthProvider } from '@jmruthers/pace-core/providers'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmruthers/pace-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"description": "React component library with Tailwind v4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -268,8 +268,8 @@
|
|
|
268
268
|
"jsdom": "^25.0.1",
|
|
269
269
|
"react-router-dom": "^6.26.2",
|
|
270
270
|
"tsup": "^8.5.1",
|
|
271
|
-
"typedoc": "^0.
|
|
272
|
-
"typedoc-plugin-markdown": "^
|
|
271
|
+
"typedoc": "^0.28.0",
|
|
272
|
+
"typedoc-plugin-markdown": "^4.10.0",
|
|
273
273
|
"typedoc-plugin-merge-modules": "^5.1.0",
|
|
274
274
|
"typescript": "^5.9.3",
|
|
275
275
|
"typescript-eslint": "^8.39.0",
|
|
@@ -172,26 +172,36 @@ export function useDataTableEffectiveActions<TData extends DataRecord>(
|
|
|
172
172
|
]);
|
|
173
173
|
|
|
174
174
|
const effectiveActions = useMemo(() => {
|
|
175
|
+
const defaultEditOnClick = (row: TData) => {
|
|
176
|
+
if (!permissions.canUpdate.can) {
|
|
177
|
+
throw new Error('Insufficient permissions to edit this resource');
|
|
178
|
+
}
|
|
179
|
+
const rowIndex = data.findIndex((r) => r === row);
|
|
180
|
+
const rowId = resolvedGetRowId(row, rowIndex >= 0 ? rowIndex : 0);
|
|
181
|
+
stateActions.setEditingRow(rowId, toCellValueRecord(row));
|
|
182
|
+
};
|
|
183
|
+
|
|
175
184
|
const result = [...actions];
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
if (secureFeatures.editing && secureHandlers.onEditRow) {
|
|
186
|
+
const existingEditIndex = result.findIndex((a) => a.label === 'Edit');
|
|
187
|
+
if (existingEditIndex >= 0) {
|
|
188
|
+
const customEdit = result[existingEditIndex];
|
|
189
|
+
result[existingEditIndex] = {
|
|
190
|
+
...customEdit,
|
|
191
|
+
onClick: defaultEditOnClick,
|
|
192
|
+
icon: customEdit.icon ?? Edit,
|
|
193
|
+
testId: customEdit.testId ?? 'edit',
|
|
194
|
+
hidden: customEdit.hidden ?? !permissions.canUpdate.can,
|
|
195
|
+
};
|
|
196
|
+
} else {
|
|
197
|
+
result.push({
|
|
198
|
+
label: 'Edit',
|
|
199
|
+
onClick: defaultEditOnClick,
|
|
200
|
+
icon: Edit,
|
|
201
|
+
testId: 'edit',
|
|
202
|
+
hidden: !permissions.canUpdate.can,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
195
205
|
}
|
|
196
206
|
if (
|
|
197
207
|
secureFeatures.deletion &&
|
|
@@ -49,7 +49,7 @@ describe('[unit] useDataTableScope', () => {
|
|
|
49
49
|
});
|
|
50
50
|
}, TEST_TIMEOUT);
|
|
51
51
|
|
|
52
|
-
it('returns
|
|
52
|
+
it('returns null scope when resolvedScope is null and not loading', () => {
|
|
53
53
|
const { result } = renderHook(() =>
|
|
54
54
|
useDataTableScope({
|
|
55
55
|
selectedOrganisation: null,
|
|
@@ -59,17 +59,13 @@ describe('[unit] useDataTableScope', () => {
|
|
|
59
59
|
pageName: undefined,
|
|
60
60
|
})
|
|
61
61
|
);
|
|
62
|
-
expect(result.current.consistentScope).
|
|
63
|
-
organisationId: undefined,
|
|
64
|
-
eventId: undefined,
|
|
65
|
-
appId: undefined,
|
|
66
|
-
});
|
|
62
|
+
expect(result.current.consistentScope).toBeNull();
|
|
67
63
|
}, TEST_TIMEOUT);
|
|
68
64
|
|
|
69
|
-
it('with pageId and no pageName,
|
|
65
|
+
it('with pageId and no pageName, returns null when no scope values (never pass empty scope to RPC)', () => {
|
|
70
66
|
mockUseResolvedScope.mockReturnValue({
|
|
71
67
|
resolvedScope: null,
|
|
72
|
-
isLoading:
|
|
68
|
+
isLoading: false,
|
|
73
69
|
});
|
|
74
70
|
const { result } = renderHook(() =>
|
|
75
71
|
useDataTableScope({
|
|
@@ -80,11 +76,7 @@ describe('[unit] useDataTableScope', () => {
|
|
|
80
76
|
pageName: undefined,
|
|
81
77
|
})
|
|
82
78
|
);
|
|
83
|
-
expect(result.current.consistentScope).
|
|
84
|
-
organisationId: undefined,
|
|
85
|
-
eventId: undefined,
|
|
86
|
-
appId: undefined,
|
|
87
|
-
});
|
|
79
|
+
expect(result.current.consistentScope).toBeNull();
|
|
88
80
|
}, TEST_TIMEOUT);
|
|
89
81
|
|
|
90
82
|
it('calls useResolvedScope with supabase and selected ids', () => {
|
|
@@ -34,7 +34,8 @@ export interface UseDataTableScopeOptions {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export interface UseDataTableScopeReturn {
|
|
37
|
-
|
|
37
|
+
/** Scope for permission checks; null when not ready (e.g. appId still resolving). */
|
|
38
|
+
consistentScope: DataTableScopeShape | null;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function scopeValuesEqual(
|
|
@@ -82,10 +83,14 @@ export function useDataTableScope(
|
|
|
82
83
|
const stableScopeRef = useRef<DataTableScopeShape>({ ...EMPTY_SCOPE });
|
|
83
84
|
|
|
84
85
|
if (rawResolvedScope) {
|
|
86
|
+
// Normalise empty strings to undefined so scope never fails validateScope (engine invalid_input)
|
|
87
|
+
const org = rawResolvedScope.organisationId;
|
|
88
|
+
const ev = rawResolvedScope.eventId;
|
|
89
|
+
const app = rawResolvedScope.appId;
|
|
85
90
|
const newScope: DataTableScopeShape = {
|
|
86
|
-
organisationId:
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
organisationId: typeof org === 'string' && org.trim() !== '' ? org : undefined,
|
|
92
|
+
eventId: typeof ev === 'string' && ev.trim() !== '' ? ev : undefined,
|
|
93
|
+
appId: typeof app === 'string' && app.trim() !== '' ? app : undefined,
|
|
89
94
|
};
|
|
90
95
|
if (!scopeValuesEqual(stableScopeRef.current, newScope)) {
|
|
91
96
|
stableScopeRef.current = { ...newScope };
|
|
@@ -105,19 +110,16 @@ export function useDataTableScope(
|
|
|
105
110
|
(scopeLoading && !canProceedWithoutFullScope);
|
|
106
111
|
|
|
107
112
|
const hasScopeValues =
|
|
108
|
-
stableScope.organisationId ||
|
|
109
|
-
stableScope.appId ||
|
|
110
|
-
stableScope.eventId
|
|
111
|
-
canProceedWithoutFullScope;
|
|
113
|
+
!!stableScope.organisationId ||
|
|
114
|
+
!!stableScope.appId ||
|
|
115
|
+
!!stableScope.eventId;
|
|
112
116
|
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
// Never pass EMPTY_SCOPE to useCan — validateScope requires at least one of org/event/app.
|
|
118
|
+
const effectiveScope: DataTableScopeShape | null = !shouldWaitForScope && hasScopeValues
|
|
115
119
|
? stableScope
|
|
116
|
-
:
|
|
117
|
-
? { ...EMPTY_SCOPE }
|
|
118
|
-
: null;
|
|
120
|
+
: null;
|
|
119
121
|
|
|
120
|
-
const consistentScope
|
|
122
|
+
const consistentScope: DataTableScopeShape | null = effectiveScope;
|
|
121
123
|
|
|
122
124
|
return { consistentScope };
|
|
123
125
|
}
|