@jmruthers/pace-core 0.5.115 → 0.5.116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/dist/{AuthService-CVgsgtaZ.d.ts → AuthService-D4646R4b.d.ts} +9 -4
  2. package/dist/{DataTable-H5KJCAIS.js → DataTable-ZOAKQ3SU.js} +10 -9
  3. package/dist/{UnifiedAuthProvider-KZZUO27W.js → UnifiedAuthProvider-YFN7YGVN.js} +4 -3
  4. package/dist/{api-PKU4PUBO.js → api-TNIBJWLM.js} +3 -3
  5. package/dist/{audit-H4YJJF7R.js → audit-T36HM7IM.js} +2 -2
  6. package/dist/{chunk-SYXOZQ4P.js → chunk-2GJ5GL77.js} +1 -1
  7. package/dist/chunk-2GJ5GL77.js.map +1 -0
  8. package/dist/{chunk-XYRZV7R5.js → chunk-2LM4QQGH.js} +30 -34
  9. package/dist/chunk-2LM4QQGH.js.map +1 -0
  10. package/dist/{chunk-3OGQLOJM.js → chunk-3DBFLLLU.js} +30 -1
  11. package/dist/chunk-3DBFLLLU.js.map +1 -0
  12. package/dist/{chunk-KTHLNIMA.js → chunk-ECOVPXYS.js} +13 -62
  13. package/dist/chunk-ECOVPXYS.js.map +1 -0
  14. package/dist/{chunk-OO3V7W4H.js → chunk-KA3PSVNV.js} +87 -40
  15. package/dist/chunk-KA3PSVNV.js.map +1 -0
  16. package/dist/{chunk-HKWQN44G.js → chunk-KMPWND3F.js} +15 -15
  17. package/dist/{chunk-L36JW4KV.js → chunk-LFS45U62.js} +2 -2
  18. package/dist/{chunk-NEONKMTU.js → chunk-LZYHAL7Y.js} +9 -4
  19. package/dist/{chunk-NEONKMTU.js.map → chunk-LZYHAL7Y.js.map} +1 -1
  20. package/dist/{chunk-BUN7NMV7.js → chunk-O3FTRYEU.js} +2 -2
  21. package/dist/{chunk-F6QB26OS.js → chunk-P3PUOL6B.js} +80 -8
  22. package/dist/chunk-P3PUOL6B.js.map +1 -0
  23. package/dist/{chunk-ZPXWJA4H.js → chunk-PHDAXDHB.js} +131 -5
  24. package/dist/chunk-PHDAXDHB.js.map +1 -0
  25. package/dist/chunk-UJI6WSMD.js +201 -0
  26. package/dist/{chunk-5CDJCTOO.js.map → chunk-UJI6WSMD.js.map} +1 -1
  27. package/dist/{chunk-OUU3SP6I.js → chunk-UKZWNQMB.js} +50 -7
  28. package/dist/{chunk-OUU3SP6I.js.map → chunk-UKZWNQMB.js.map} +1 -1
  29. package/dist/{chunk-7H75SHXZ.js → chunk-VN3OOE35.js} +2 -2
  30. package/dist/{chunk-QKIVSZ2O.js → chunk-WP5I5GLN.js} +2 -2
  31. package/dist/components.d.ts +1 -1
  32. package/dist/components.js +12 -11
  33. package/dist/components.js.map +1 -1
  34. package/dist/hooks.d.ts +1 -1
  35. package/dist/hooks.js +10 -9
  36. package/dist/hooks.js.map +1 -1
  37. package/dist/index.d.ts +4 -4
  38. package/dist/index.js +19 -16
  39. package/dist/index.js.map +1 -1
  40. package/dist/providers.d.ts +2 -2
  41. package/dist/providers.js +3 -2
  42. package/dist/rbac/index.d.ts +82 -1
  43. package/dist/rbac/index.js +13 -10
  44. package/dist/{useToast-DVT4dMtf.d.ts → useToast-Cs_g32bg.d.ts} +1 -1
  45. package/dist/utils.js +6 -4
  46. package/dist/utils.js.map +1 -1
  47. package/dist/validation.js +3 -1
  48. package/dist/validation.js.map +1 -1
  49. package/docs/README.md +4 -0
  50. package/docs/api/classes/ColumnFactory.md +1 -1
  51. package/docs/api/classes/ErrorBoundary.md +1 -1
  52. package/docs/api/classes/InvalidScopeError.md +1 -1
  53. package/docs/api/classes/MissingUserContextError.md +1 -1
  54. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  55. package/docs/api/classes/PermissionDeniedError.md +1 -1
  56. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  57. package/docs/api/classes/RBACAuditManager.md +35 -12
  58. package/docs/api/classes/RBACCache.md +1 -1
  59. package/docs/api/classes/RBACEngine.md +1 -1
  60. package/docs/api/classes/RBACError.md +1 -1
  61. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  62. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  63. package/docs/api/classes/StorageUtils.md +1 -1
  64. package/docs/api/enums/FileCategory.md +1 -1
  65. package/docs/api/interfaces/AggregateConfig.md +1 -1
  66. package/docs/api/interfaces/ButtonProps.md +1 -1
  67. package/docs/api/interfaces/CardProps.md +1 -1
  68. package/docs/api/interfaces/ColorPalette.md +1 -1
  69. package/docs/api/interfaces/ColorShade.md +1 -1
  70. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  71. package/docs/api/interfaces/DataRecord.md +1 -1
  72. package/docs/api/interfaces/DataTableAction.md +1 -1
  73. package/docs/api/interfaces/DataTableColumn.md +1 -1
  74. package/docs/api/interfaces/DataTableProps.md +1 -1
  75. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  76. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  77. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  78. package/docs/api/interfaces/EventAppRoleData.md +71 -0
  79. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  80. package/docs/api/interfaces/FileMetadata.md +1 -1
  81. package/docs/api/interfaces/FileReference.md +1 -1
  82. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  83. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  84. package/docs/api/interfaces/FileUploadProps.md +1 -1
  85. package/docs/api/interfaces/FooterProps.md +1 -1
  86. package/docs/api/interfaces/GrantEventAppRoleParams.md +122 -0
  87. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  88. package/docs/api/interfaces/InputProps.md +1 -1
  89. package/docs/api/interfaces/LabelProps.md +1 -1
  90. package/docs/api/interfaces/LoginFormProps.md +1 -1
  91. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  92. package/docs/api/interfaces/NavigationContextType.md +1 -1
  93. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  94. package/docs/api/interfaces/NavigationItem.md +1 -1
  95. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  96. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  97. package/docs/api/interfaces/Organisation.md +1 -1
  98. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  99. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  100. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  101. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  102. package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
  103. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  104. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  105. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  106. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  107. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  108. package/docs/api/interfaces/PaletteData.md +1 -1
  109. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  110. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  111. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  112. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  113. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  114. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  115. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  116. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  117. package/docs/api/interfaces/RBACConfig.md +1 -1
  118. package/docs/api/interfaces/RBACLogger.md +1 -1
  119. package/docs/api/interfaces/RevokeEventAppRoleParams.md +100 -0
  120. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  121. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  122. package/docs/api/interfaces/RoleManagementResult.md +52 -0
  123. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  124. package/docs/api/interfaces/RouteConfig.md +1 -1
  125. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  126. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  127. package/docs/api/interfaces/StorageConfig.md +1 -1
  128. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  129. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  130. package/docs/api/interfaces/StorageListOptions.md +1 -1
  131. package/docs/api/interfaces/StorageListResult.md +1 -1
  132. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  133. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  134. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  135. package/docs/api/interfaces/StyleImport.md +1 -1
  136. package/docs/api/interfaces/SwitchProps.md +1 -1
  137. package/docs/api/interfaces/ToastActionElement.md +1 -1
  138. package/docs/api/interfaces/ToastProps.md +1 -1
  139. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  140. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  141. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  142. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  143. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  144. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  145. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  146. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  147. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  148. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  149. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  150. package/docs/api/interfaces/UserEventAccess.md +1 -1
  151. package/docs/api/interfaces/UserMenuProps.md +1 -1
  152. package/docs/api/interfaces/UserProfile.md +1 -1
  153. package/docs/api/modules.md +41 -14
  154. package/docs/architecture/rpc-function-standards.md +193 -0
  155. package/package.json +1 -1
  156. package/src/__tests__/TEST_STANDARD.md +244 -2
  157. package/src/components/DataTable/__tests__/a11y.basic.test.tsx +46 -16
  158. package/src/components/DataTable/__tests__/keyboard.test.tsx +276 -217
  159. package/src/components/DataTable/components/DataTableCore.tsx +29 -2
  160. package/src/components/DataTable/components/DataTableToolbar.tsx +3 -2
  161. package/src/components/DataTable/components/EditableRow.tsx +18 -1
  162. package/src/components/DataTable/components/ViewRowModal.tsx +1 -1
  163. package/src/components/DataTable/components/__tests__/AccessDeniedPage.test.tsx +735 -0
  164. package/src/components/DataTable/components/__tests__/BulkOperationsDropdown.test.tsx +572 -0
  165. package/src/components/DataTable/components/__tests__/ColumnVisibilityDropdown.test.tsx +708 -0
  166. package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +451 -0
  167. package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +456 -0
  168. package/src/components/DataTable/components/__tests__/EditableRow.test.tsx +454 -0
  169. package/src/components/DataTable/components/__tests__/ExpandButton.test.tsx +462 -0
  170. package/src/components/DataTable/components/__tests__/FilterRow.test.tsx +423 -0
  171. package/src/components/DataTable/components/__tests__/GroupHeader.test.tsx +393 -0
  172. package/src/components/DataTable/components/__tests__/GroupingDropdown.test.tsx +617 -0
  173. package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +734 -0
  174. package/src/components/DataTable/components/__tests__/ViewRowModal.test.tsx +412 -0
  175. package/src/components/DataTable/hooks/useTableHandlers.ts +4 -0
  176. package/src/components/EventSelector/EventSelector.tsx +5 -25
  177. package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +12 -7
  178. package/src/components/PaceAppLayout/PaceAppLayout.tsx +4 -0
  179. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.accessibility.test.tsx +7 -2
  180. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +13 -8
  181. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.performance.test.tsx +109 -100
  182. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +18 -13
  183. package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +17 -12
  184. package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +2 -0
  185. package/src/components/PaceLoginPage/PaceLoginPage.tsx +11 -1
  186. package/src/components/PasswordReset/PasswordChangeForm.test.tsx +2 -2
  187. package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +648 -0
  188. package/src/components/ProtectedRoute/ProtectedRoute.tsx +10 -7
  189. package/src/components/PublicLayout/__tests__/PublicErrorBoundary.test.tsx +4 -12
  190. package/src/components/Select/Select.tsx +8 -0
  191. package/src/components/Toast/Toast.tsx +1 -1
  192. package/src/hooks/__tests__/usePublicEvent.simple.test.ts +367 -3
  193. package/src/hooks/__tests__/usePublicFileDisplay.test.ts +916 -0
  194. package/src/hooks/useEventTheme.ts +49 -18
  195. package/src/hooks/usePermissionCache.ts +5 -3
  196. package/src/hooks/useSecureDataAccess.ts +11 -1
  197. package/src/hooks/useToast.ts +1 -1
  198. package/src/providers/services/EventServiceProvider.tsx +15 -8
  199. package/src/rbac/__tests__/cache-invalidation.test.ts +385 -0
  200. package/src/rbac/audit.test.ts +206 -0
  201. package/src/rbac/audit.ts +37 -2
  202. package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +26 -23
  203. package/src/rbac/errors.test.ts +340 -0
  204. package/src/rbac/hooks/index.ts +9 -0
  205. package/src/rbac/hooks/useResolvedScope.test.ts +1063 -0
  206. package/src/rbac/hooks/useRoleManagement.test.ts +908 -0
  207. package/src/rbac/hooks/useRoleManagement.ts +255 -0
  208. package/src/services/AuthService.ts +10 -0
  209. package/src/services/EventService.ts +111 -50
  210. package/src/services/__tests__/AuthService.test.ts +1 -1
  211. package/src/services/__tests__/EventService.test.ts +60 -45
  212. package/src/services/interfaces/IEventService.ts +1 -1
  213. package/src/utils/__tests__/deviceFingerprint.unit.test.ts +320 -0
  214. package/src/utils/__tests__/logger.unit.test.ts +398 -0
  215. package/src/utils/__tests__/validation.unit.test.ts +225 -1
  216. package/src/utils/file-reference.test.ts +214 -0
  217. package/dist/chunk-3OGQLOJM.js.map +0 -1
  218. package/dist/chunk-5CDJCTOO.js +0 -190
  219. package/dist/chunk-F6QB26OS.js.map +0 -1
  220. package/dist/chunk-KTHLNIMA.js.map +0 -1
  221. package/dist/chunk-OO3V7W4H.js.map +0 -1
  222. package/dist/chunk-SYXOZQ4P.js.map +0 -1
  223. package/dist/chunk-XYRZV7R5.js.map +0 -1
  224. package/dist/chunk-ZPXWJA4H.js.map +0 -1
  225. package/src/rbac/audit-enhanced.ts +0 -351
  226. /package/dist/{DataTable-H5KJCAIS.js.map → DataTable-ZOAKQ3SU.js.map} +0 -0
  227. /package/dist/{UnifiedAuthProvider-KZZUO27W.js.map → UnifiedAuthProvider-YFN7YGVN.js.map} +0 -0
  228. /package/dist/{api-PKU4PUBO.js.map → api-TNIBJWLM.js.map} +0 -0
  229. /package/dist/{audit-H4YJJF7R.js.map → audit-T36HM7IM.js.map} +0 -0
  230. /package/dist/{chunk-HKWQN44G.js.map → chunk-KMPWND3F.js.map} +0 -0
  231. /package/dist/{chunk-L36JW4KV.js.map → chunk-LFS45U62.js.map} +0 -0
  232. /package/dist/{chunk-BUN7NMV7.js.map → chunk-O3FTRYEU.js.map} +0 -0
  233. /package/dist/{chunk-7H75SHXZ.js.map → chunk-VN3OOE35.js.map} +0 -0
  234. /package/dist/{chunk-QKIVSZ2O.js.map → chunk-WP5I5GLN.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UnifiedAuthContextType
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UnifiedAuthContextType
2
2
 
3
3
  # Interface: UnifiedAuthContextType
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UnifiedAuthProviderProps
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UnifiedAuthProviderProps
2
2
 
3
3
  # Interface: UnifiedAuthProviderProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UseInactivityTrackerOptions
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UseInactivityTrackerOptions
2
2
 
3
3
  # Interface: UseInactivityTrackerOptions
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UseInactivityTrackerReturn
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UseInactivityTrackerReturn
2
2
 
3
3
  # Interface: UseInactivityTrackerReturn
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UsePublicEventOptions
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UsePublicEventOptions
2
2
 
3
3
  # Interface: UsePublicEventOptions
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UsePublicEventReturn
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UsePublicEventReturn
2
2
 
3
3
  # Interface: UsePublicEventReturn
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UsePublicFileDisplayOptions
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UsePublicFileDisplayOptions
2
2
 
3
3
  # Interface: UsePublicFileDisplayOptions
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UsePublicFileDisplayReturn
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UsePublicFileDisplayReturn
2
2
 
3
3
  # Interface: UsePublicFileDisplayReturn
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UsePublicRouteParamsReturn
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UsePublicRouteParamsReturn
2
2
 
3
3
  # Interface: UsePublicRouteParamsReturn
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UseResolvedScopeOptions
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UseResolvedScopeOptions
2
2
 
3
3
  # Interface: UseResolvedScopeOptions
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UseResolvedScopeReturn
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UseResolvedScopeReturn
2
2
 
3
3
  # Interface: UseResolvedScopeReturn
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UserEventAccess
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UserEventAccess
2
2
 
3
3
  # Interface: UserEventAccess
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UserMenuProps
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UserMenuProps
2
2
 
3
3
  # Interface: UserMenuProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.115](../README.md) / [Exports](../modules.md) / UserProfile
1
+ [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / UserProfile
2
2
 
3
3
  # Interface: UserProfile
4
4
 
@@ -1,6 +1,6 @@
1
- [@jmruthers/pace-core - v0.5.115](README.md) / Exports
1
+ [@jmruthers/pace-core - v0.5.116](README.md) / Exports
2
2
 
3
- # @jmruthers/pace-core - v0.5.115
3
+ # @jmruthers/pace-core - v0.5.116
4
4
 
5
5
  **`File`**
6
6
 
@@ -114,6 +114,10 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
114
114
  - [RBACLogger](interfaces/RBACLogger.md)
115
115
  - [UseResolvedScopeOptions](interfaces/UseResolvedScopeOptions.md)
116
116
  - [UseResolvedScopeReturn](interfaces/UseResolvedScopeReturn.md)
117
+ - [EventAppRoleData](interfaces/EventAppRoleData.md)
118
+ - [RevokeEventAppRoleParams](interfaces/RevokeEventAppRoleParams.md)
119
+ - [GrantEventAppRoleParams](interfaces/GrantEventAppRoleParams.md)
120
+ - [RoleManagementResult](interfaces/RoleManagementResult.md)
117
121
  - [StyleImport](interfaces/StyleImport.md)
118
122
  - [ColorShade](interfaces/ColorShade.md)
119
123
  - [ColorPalette](interfaces/ColorPalette.md)
@@ -348,6 +352,7 @@ import { Dialog, NavigationMenu } from '@jmruthers/pace-core/components';
348
352
  - [useCachedPermissions](modules.md#usecachedpermissions)
349
353
  - [useRBAC](modules.md#userbac)
350
354
  - [useResolvedScope](modules.md#useresolvedscope)
355
+ - [useRoleManagement](modules.md#userolemanagement)
351
356
  - [isValidPermission](modules.md#isvalidpermission)
352
357
  - [getPermissionsForRole](modules.md#getpermissionsforrole)
353
358
  - [createSecureClient](modules.md#createsecureclient)
@@ -2436,7 +2441,7 @@ function AdminApp() {
2436
2441
 
2437
2442
  #### Defined in
2438
2443
 
2439
- [packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx:327](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx#L327)
2444
+ [packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx:328](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/PaceAppLayout/PaceAppLayout.tsx#L328)
2440
2445
 
2441
2446
  ___
2442
2447
 
@@ -3013,7 +3018,7 @@ ___
3013
3018
 
3014
3019
  #### Defined in
3015
3020
 
3016
- [packages/core/src/components/Select/Select.tsx:465](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L465)
3021
+ [packages/core/src/components/Select/Select.tsx:473](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L473)
3017
3022
 
3018
3023
  ___
3019
3024
 
@@ -3033,7 +3038,7 @@ ___
3033
3038
 
3034
3039
  #### Defined in
3035
3040
 
3036
- [packages/core/src/components/Select/Select.tsx:482](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L482)
3041
+ [packages/core/src/components/Select/Select.tsx:490](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L490)
3037
3042
 
3038
3043
  ___
3039
3044
 
@@ -3053,7 +3058,7 @@ ___
3053
3058
 
3054
3059
  #### Defined in
3055
3060
 
3056
- [packages/core/src/components/Select/Select.tsx:585](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L585)
3061
+ [packages/core/src/components/Select/Select.tsx:593](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L593)
3057
3062
 
3058
3063
  ___
3059
3064
 
@@ -3073,7 +3078,7 @@ ___
3073
3078
 
3074
3079
  #### Defined in
3075
3080
 
3076
- [packages/core/src/components/Select/Select.tsx:686](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L686)
3081
+ [packages/core/src/components/Select/Select.tsx:694](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L694)
3077
3082
 
3078
3083
  ___
3079
3084
 
@@ -3093,7 +3098,7 @@ ___
3093
3098
 
3094
3099
  #### Defined in
3095
3100
 
3096
- [packages/core/src/components/Select/Select.tsx:697](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L697)
3101
+ [packages/core/src/components/Select/Select.tsx:705](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L705)
3097
3102
 
3098
3103
  ___
3099
3104
 
@@ -3113,7 +3118,7 @@ ___
3113
3118
 
3114
3119
  #### Defined in
3115
3120
 
3116
- [packages/core/src/components/Select/Select.tsx:708](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L708)
3121
+ [packages/core/src/components/Select/Select.tsx:716](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/components/Select/Select.tsx#L716)
3117
3122
 
3118
3123
  ___
3119
3124
 
@@ -4062,7 +4067,7 @@ void - This is an effect hook with no return value
4062
4067
 
4063
4068
  #### Defined in
4064
4069
 
4065
- [packages/core/src/hooks/useEventTheme.ts:41](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useEventTheme.ts#L41)
4070
+ [packages/core/src/hooks/useEventTheme.ts:85](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/hooks/useEventTheme.ts#L85)
4066
4071
 
4067
4072
  ___
4068
4073
 
@@ -5273,7 +5278,7 @@ RBACAuditManager instance
5273
5278
 
5274
5279
  #### Defined in
5275
5280
 
5276
- [packages/core/src/rbac/audit.ts:340](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L340)
5281
+ [packages/core/src/rbac/audit.ts:375](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L375)
5277
5282
 
5278
5283
  ___
5279
5284
 
@@ -5295,7 +5300,7 @@ Set the global audit manager
5295
5300
 
5296
5301
  #### Defined in
5297
5302
 
5298
- [packages/core/src/rbac/audit.ts:356](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L356)
5303
+ [packages/core/src/rbac/audit.ts:391](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L391)
5299
5304
 
5300
5305
  ___
5301
5306
 
@@ -5313,7 +5318,7 @@ Global audit manager or null if not set
5313
5318
 
5314
5319
  #### Defined in
5315
5320
 
5316
- [packages/core/src/rbac/audit.ts:365](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L365)
5321
+ [packages/core/src/rbac/audit.ts:400](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L400)
5317
5322
 
5318
5323
  ___
5319
5324
 
@@ -5335,7 +5340,7 @@ Emit an audit event using the global audit manager
5335
5340
 
5336
5341
  #### Defined in
5337
5342
 
5338
- [packages/core/src/rbac/audit.ts:374](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L374)
5343
+ [packages/core/src/rbac/audit.ts:409](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/audit.ts#L409)
5339
5344
 
5340
5345
  ___
5341
5346
 
@@ -6171,6 +6176,28 @@ const permission = useCan(userId, resolvedScope, permission);
6171
6176
 
6172
6177
  ___
6173
6178
 
6179
+ ### useRoleManagement
6180
+
6181
+ ▸ **useRoleManagement**(): `Object`
6182
+
6183
+ #### Returns
6184
+
6185
+ `Object`
6186
+
6187
+ | Name | Type |
6188
+ | :------ | :------ |
6189
+ | `revokeEventAppRole` | (`params`: [`RevokeEventAppRoleParams`](interfaces/RevokeEventAppRoleParams.md)) => `Promise`\<[`RoleManagementResult`](interfaces/RoleManagementResult.md)\> |
6190
+ | `grantEventAppRole` | (`params`: [`GrantEventAppRoleParams`](interfaces/GrantEventAppRoleParams.md)) => `Promise`\<[`RoleManagementResult`](interfaces/RoleManagementResult.md)\> |
6191
+ | `revokeRoleById` | (`roleId`: `string`) => `Promise`\<[`RoleManagementResult`](interfaces/RoleManagementResult.md)\> |
6192
+ | `isLoading` | `boolean` |
6193
+ | `error` | ``null`` \| `Error` |
6194
+
6195
+ #### Defined in
6196
+
6197
+ [packages/core/src/rbac/hooks/useRoleManagement.ts:68](https://github.com/jmruthers/pace-core/blob/main/packages/core/src/rbac/hooks/useRoleManagement.ts#L68)
6198
+
6199
+ ___
6200
+
6174
6201
  ### isValidPermission
6175
6202
 
6176
6203
  ▸ **isValidPermission**(`permission`): permission is \`create:$\{string}\` \| \`update:$\{string}\` \| \`read:$\{string}\` \| \`delete:$\{string}\`
@@ -714,6 +714,9 @@ rbac_check_permission_simplified(
714
714
  - ❌ **WRONG**: `SELECT mealtype_name FROM cake_mealtype`
715
715
  - ✅ **CORRECT**: `SELECT cake_mealtype.mealtype_name FROM cake_mealtype`
716
716
  - Always fully qualify table names when there might be ambiguity
717
+ - **MANDATORY**: When using JOINs, always use table aliases and prefix ALL column references
718
+ - Common ambiguous columns: `organisation_id`, `created_by`, `updated_by`, `created_at`, `updated_at`
719
+ - See "Avoiding Ambiguous Column References" section below for detailed guidance
717
720
 
718
721
  5. **Not checking existing migrations**: Before creating a new migration, check if a similar one already exists to avoid duplicates
719
722
 
@@ -736,6 +739,190 @@ rbac_check_permission_simplified(
736
739
 
737
740
  3. **Update references** - Update all callers before removing
738
741
 
742
+ ## Avoiding Ambiguous Column References
743
+
744
+ ### Overview
745
+
746
+ Ambiguous column reference errors occur when PostgreSQL cannot determine which table a column belongs to in a query with JOINs. This is a common source of silent failures in RPC functions.
747
+
748
+ ### Mandatory Rules
749
+
750
+ 1. **Always use table aliases in JOINs**: Never write JOINs without table aliases
751
+ 2. **Fully qualify ALL column references**: Every column in SELECT, WHERE, ORDER BY, GROUP BY, and HAVING clauses must be prefixed with its table alias
752
+ 3. **Common ambiguous columns**: The following columns exist in multiple tables and MUST always be prefixed:
753
+ - `organisation_id`
754
+ - `created_by`, `updated_by`
755
+ - `created_at`, `updated_at`
756
+ - `event_id` and its variations (e.g., `dish_event_id`, `meal_event_id`)
757
+
758
+ ### Correct Patterns
759
+
760
+ ```sql
761
+ -- ✅ CORRECT: All columns properly prefixed with table aliases
762
+ SELECT
763
+ d.dish_id,
764
+ d.dish_name,
765
+ d.organisation_id,
766
+ d.created_at,
767
+ mt.mealtype_name,
768
+ e.event_name,
769
+ e.organisation_id AS event_organisation_id
770
+ FROM cake_dish d
771
+ LEFT JOIN cake_mealtype mt ON d.dish_mealtype_id = mt.mealtype_id
772
+ LEFT JOIN event e ON d.dish_event_id = e.event_id
773
+ WHERE d.dish_event_id = p_event_id
774
+ AND d.organisation_id = p_organisation_id
775
+ ORDER BY d.dish_code, mt.mealtype_name;
776
+
777
+ -- ✅ CORRECT: CTEs with proper aliases
778
+ WITH distribution_items AS (
779
+ SELECT
780
+ d.item_id,
781
+ d.collection_date,
782
+ SUM(d.required_quantity) as total_quantity
783
+ FROM data_cake_distribution_list(p_event_id, p_user_id, p_organisation_id) d
784
+ GROUP BY d.item_id, d.collection_date
785
+ )
786
+ SELECT
787
+ di.item_id,
788
+ di.collection_date,
789
+ di.total_quantity
790
+ FROM distribution_items di
791
+ WHERE di.item_id = p_item_id;
792
+ ```
793
+
794
+ ### Incorrect Patterns
795
+
796
+ ```sql
797
+ -- ❌ WRONG: Missing table prefixes in SELECT
798
+ SELECT
799
+ dish_id,
800
+ dish_name,
801
+ organisation_id, -- AMBIGUOUS: Could be from cake_dish or event
802
+ mealtype_name
803
+ FROM cake_dish d
804
+ LEFT JOIN cake_mealtype mt ON d.dish_mealtype_id = mt.mealtype_id
805
+ LEFT JOIN event e ON d.dish_event_id = e.event_id;
806
+
807
+ -- ❌ WRONG: Missing table prefix in WHERE clause
808
+ SELECT d.dish_id, d.dish_name
809
+ FROM cake_dish d
810
+ LEFT JOIN event e ON d.dish_event_id = e.event_id
811
+ WHERE organisation_id = p_organisation_id; -- AMBIGUOUS: Which table?
812
+
813
+ -- ❌ WRONG: Missing table prefix in ORDER BY
814
+ SELECT d.dish_id, d.dish_name, e.event_name
815
+ FROM cake_dish d
816
+ LEFT JOIN event e ON d.dish_event_id = e.event_id
817
+ ORDER BY created_at; -- AMBIGUOUS: Which table's created_at?
818
+
819
+ -- ❌ WRONG: SELECT INTO with multiple columns but wrong variable count
820
+ SELECT d.dish_code, d.dish_name, mt.mealtype_name
821
+ INTO v_mealtype_name -- WRONG: Only one variable for three columns
822
+ FROM cake_dish d
823
+ LEFT JOIN cake_mealtype mt ON d.dish_mealtype_id = mt.mealtype_id;
824
+ ```
825
+
826
+ ### SELECT INTO Statements
827
+
828
+ When using `SELECT ... INTO`, ensure:
829
+ 1. The number of columns matches the number of variables
830
+ 2. All columns are properly prefixed with table aliases
831
+ 3. Use separate variables for each column
832
+
833
+ ```sql
834
+ -- ✅ CORRECT: Proper SELECT INTO with multiple variables
835
+ DECLARE
836
+ v_dish_code TEXT;
837
+ v_dish_name TEXT;
838
+ v_mealtype_name TEXT;
839
+ v_updated_at TIMESTAMPTZ;
840
+ BEGIN
841
+ SELECT
842
+ d.dish_code,
843
+ d.dish_name,
844
+ mt.mealtype_name,
845
+ d.updated_at
846
+ INTO
847
+ v_dish_code,
848
+ v_dish_name,
849
+ v_mealtype_name,
850
+ v_updated_at
851
+ FROM cake_dish d
852
+ LEFT JOIN cake_mealtype mt ON d.dish_mealtype_id = mt.mealtype_id
853
+ WHERE d.dish_id = p_dish_id;
854
+ END;
855
+ ```
856
+
857
+ ### CTEs and Subqueries
858
+
859
+ When using CTEs (Common Table Expressions) or subqueries:
860
+ 1. Use descriptive aliases for CTEs
861
+ 2. Fully qualify all column references within CTEs
862
+ 3. When referencing CTEs in the main query, use the CTE alias
863
+
864
+ ```sql
865
+ -- ✅ CORRECT: CTE with proper aliases
866
+ WITH unit_diners AS (
867
+ SELECT
868
+ d.diner_unit_id,
869
+ d.diner_diettype_id,
870
+ SUM(COALESCE(d.diner_adult, 0)) as adults,
871
+ SUM(COALESCE(d.diner_youth, 0)) as youth
872
+ FROM cake_diner d
873
+ INNER JOIN event_units eu ON d.diner_unit_id = eu.unit_id
874
+ WHERE (d.diner_adult > 0 OR d.diner_youth > 0)
875
+ GROUP BY d.diner_unit_id, d.diner_diettype_id
876
+ )
877
+ SELECT
878
+ ud.diner_unit_id,
879
+ ud.adults,
880
+ ud.youth
881
+ FROM unit_diners ud
882
+ WHERE ud.diner_unit_id = p_unit_id;
883
+ ```
884
+
885
+ ### Table Alias Naming Conventions
886
+
887
+ Use short, descriptive aliases:
888
+ - `d` for `cake_dish`
889
+ - `r` for `cake_recipe`
890
+ - `m` for `cake_meal`
891
+ - `mt` for `cake_mealtype`
892
+ - `i` for `cake_item`
893
+ - `dt` for `cake_diettype`
894
+ - `e` for `event`
895
+ - `u` for `cake_unit`
896
+ - `mp` for `cake_mealplan`
897
+
898
+ ### UPDATE Statements
899
+
900
+ For UPDATE statements, the WHERE clause should reference the table being updated:
901
+
902
+ ```sql
903
+ -- ✅ CORRECT: WHERE clause uses table name or alias
904
+ UPDATE cake_dish
905
+ SET dish_name = p_dish_name,
906
+ updated_by = p_user_id,
907
+ updated_at = now()
908
+ WHERE dish_id = p_dish_id; -- dish_id is unambiguous (primary key)
909
+
910
+ -- ✅ CORRECT: When updating with JOIN, qualify all columns
911
+ UPDATE cake_dish d
912
+ SET d.dish_name = p_dish_name
913
+ FROM cake_mealtype mt
914
+ WHERE d.dish_mealtype_id = mt.mealtype_id
915
+ AND d.dish_id = p_dish_id;
916
+ ```
917
+
918
+ ### Testing for Ambiguous References
919
+
920
+ Before deploying, test your function:
921
+ 1. Call the function with valid parameters
922
+ 2. Check PostgreSQL logs for "ambiguous column reference" errors
923
+ 3. Verify all column references are prefixed in JOINs
924
+ 4. Test with multiple tables that share column names
925
+
739
926
  ## Common Patterns
740
927
 
741
928
  ### Pattern 1: Simple Data Retrieval
@@ -871,6 +1058,12 @@ When creating or reviewing an RPC function, ensure:
871
1058
  - ✅ **File naming**: `YYYYMMDDHHMMSS_descriptive_name.sql`
872
1059
  - ✅ **No ambiguous column references**: Fully qualify table names (e.g., `cake_mealtype.mealtype_name`)
873
1060
 
1061
+ ### ⚠️ Column Reference Requirements
1062
+ - ✅ **All column references in JOINs are fully qualified with table aliases**: Every column in SELECT, WHERE, ORDER BY, GROUP BY, HAVING must have table prefix
1063
+ - ✅ **No ambiguous column references in WHERE, ORDER BY, GROUP BY, HAVING clauses**: All columns must be prefixed with table alias
1064
+ - ✅ **Table aliases used consistently and meaningfully**: Use short, descriptive aliases (e.g., `d` for dish, `r` for recipe)
1065
+ - ✅ **SELECT INTO statements match variable count**: Number of columns must match number of variables
1066
+
874
1067
  ## References
875
1068
 
876
1069
  - [RBAC System Documentation](../core-concepts/rbac-system.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmruthers/pace-core",
3
- "version": "0.5.115",
3
+ "version": "0.5.116",
4
4
  "description": "Clean, modern React component library with Tailwind v4 styling and native utilities",
5
5
  "private": false,
6
6
  "publishConfig": {