@jmruthers/pace-core 0.5.116 → 0.5.117

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 (114) hide show
  1. package/dist/{chunk-KMPWND3F.js → chunk-IZXS7RZK.js} +2 -2
  2. package/dist/{chunk-LZYHAL7Y.js → chunk-XN2LYHDI.js} +39 -3
  3. package/dist/chunk-XN2LYHDI.js.map +1 -0
  4. package/dist/hooks.js +1 -1
  5. package/dist/index.js +2 -2
  6. package/dist/rbac/index.js +2 -2
  7. package/docs/api/classes/ColumnFactory.md +1 -1
  8. package/docs/api/classes/ErrorBoundary.md +1 -1
  9. package/docs/api/classes/InvalidScopeError.md +1 -1
  10. package/docs/api/classes/MissingUserContextError.md +1 -1
  11. package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
  12. package/docs/api/classes/PermissionDeniedError.md +1 -1
  13. package/docs/api/classes/PublicErrorBoundary.md +1 -1
  14. package/docs/api/classes/RBACAuditManager.md +1 -1
  15. package/docs/api/classes/RBACCache.md +1 -1
  16. package/docs/api/classes/RBACEngine.md +1 -1
  17. package/docs/api/classes/RBACError.md +1 -1
  18. package/docs/api/classes/RBACNotInitializedError.md +1 -1
  19. package/docs/api/classes/SecureSupabaseClient.md +1 -1
  20. package/docs/api/classes/StorageUtils.md +1 -1
  21. package/docs/api/enums/FileCategory.md +1 -1
  22. package/docs/api/interfaces/AggregateConfig.md +1 -1
  23. package/docs/api/interfaces/ButtonProps.md +1 -1
  24. package/docs/api/interfaces/CardProps.md +1 -1
  25. package/docs/api/interfaces/ColorPalette.md +1 -1
  26. package/docs/api/interfaces/ColorShade.md +1 -1
  27. package/docs/api/interfaces/DataAccessRecord.md +1 -1
  28. package/docs/api/interfaces/DataRecord.md +1 -1
  29. package/docs/api/interfaces/DataTableAction.md +1 -1
  30. package/docs/api/interfaces/DataTableColumn.md +1 -1
  31. package/docs/api/interfaces/DataTableProps.md +1 -1
  32. package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
  33. package/docs/api/interfaces/EmptyStateConfig.md +1 -1
  34. package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
  35. package/docs/api/interfaces/EventAppRoleData.md +1 -1
  36. package/docs/api/interfaces/FileDisplayProps.md +1 -1
  37. package/docs/api/interfaces/FileMetadata.md +1 -1
  38. package/docs/api/interfaces/FileReference.md +1 -1
  39. package/docs/api/interfaces/FileSizeLimits.md +1 -1
  40. package/docs/api/interfaces/FileUploadOptions.md +1 -1
  41. package/docs/api/interfaces/FileUploadProps.md +1 -1
  42. package/docs/api/interfaces/FooterProps.md +1 -1
  43. package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
  44. package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
  45. package/docs/api/interfaces/InputProps.md +1 -1
  46. package/docs/api/interfaces/LabelProps.md +1 -1
  47. package/docs/api/interfaces/LoginFormProps.md +1 -1
  48. package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
  49. package/docs/api/interfaces/NavigationContextType.md +1 -1
  50. package/docs/api/interfaces/NavigationGuardProps.md +1 -1
  51. package/docs/api/interfaces/NavigationItem.md +1 -1
  52. package/docs/api/interfaces/NavigationMenuProps.md +1 -1
  53. package/docs/api/interfaces/NavigationProviderProps.md +1 -1
  54. package/docs/api/interfaces/Organisation.md +1 -1
  55. package/docs/api/interfaces/OrganisationContextType.md +1 -1
  56. package/docs/api/interfaces/OrganisationMembership.md +1 -1
  57. package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
  58. package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
  59. package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
  60. package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
  61. package/docs/api/interfaces/PageAccessRecord.md +1 -1
  62. package/docs/api/interfaces/PagePermissionContextType.md +1 -1
  63. package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
  64. package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
  65. package/docs/api/interfaces/PaletteData.md +1 -1
  66. package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
  67. package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
  68. package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
  69. package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
  70. package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
  71. package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
  72. package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
  73. package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
  74. package/docs/api/interfaces/RBACConfig.md +1 -1
  75. package/docs/api/interfaces/RBACLogger.md +1 -1
  76. package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
  77. package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
  78. package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
  79. package/docs/api/interfaces/RoleManagementResult.md +1 -1
  80. package/docs/api/interfaces/RouteAccessRecord.md +1 -1
  81. package/docs/api/interfaces/RouteConfig.md +1 -1
  82. package/docs/api/interfaces/SecureDataContextType.md +1 -1
  83. package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
  84. package/docs/api/interfaces/StorageConfig.md +1 -1
  85. package/docs/api/interfaces/StorageFileInfo.md +1 -1
  86. package/docs/api/interfaces/StorageFileMetadata.md +1 -1
  87. package/docs/api/interfaces/StorageListOptions.md +1 -1
  88. package/docs/api/interfaces/StorageListResult.md +1 -1
  89. package/docs/api/interfaces/StorageUploadOptions.md +1 -1
  90. package/docs/api/interfaces/StorageUploadResult.md +1 -1
  91. package/docs/api/interfaces/StorageUrlOptions.md +1 -1
  92. package/docs/api/interfaces/StyleImport.md +1 -1
  93. package/docs/api/interfaces/SwitchProps.md +1 -1
  94. package/docs/api/interfaces/ToastActionElement.md +1 -1
  95. package/docs/api/interfaces/ToastProps.md +1 -1
  96. package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
  97. package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
  98. package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
  99. package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
  100. package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
  101. package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
  102. package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
  103. package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
  104. package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
  105. package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
  106. package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
  107. package/docs/api/interfaces/UserEventAccess.md +1 -1
  108. package/docs/api/interfaces/UserMenuProps.md +1 -1
  109. package/docs/api/interfaces/UserProfile.md +1 -1
  110. package/docs/api/modules.md +2 -2
  111. package/package.json +1 -1
  112. package/src/hooks/useSecureDataAccess.ts +45 -2
  113. package/dist/chunk-LZYHAL7Y.js.map +0 -1
  114. /package/dist/{chunk-KMPWND3F.js.map → chunk-IZXS7RZK.js.map} +0 -0
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-WP5I5GLN.js";
13
13
  import {
14
14
  useSecureDataAccess
15
- } from "./chunk-LZYHAL7Y.js";
15
+ } from "./chunk-XN2LYHDI.js";
16
16
  import {
17
17
  init_UnifiedAuthProvider
18
18
  } from "./chunk-VN3OOE35.js";
@@ -1860,4 +1860,4 @@ export {
1860
1860
  getPermissionsForRole,
1861
1861
  ALL_PERMISSIONS
1862
1862
  };
1863
- //# sourceMappingURL=chunk-KMPWND3F.js.map
1863
+ //# sourceMappingURL=chunk-IZXS7RZK.js.map
@@ -3,6 +3,8 @@ import {
3
3
  useOrganisations
4
4
  } from "./chunk-LFS45U62.js";
5
5
  import {
6
+ EventServiceContext,
7
+ init_EventServiceProvider,
6
8
  useUnifiedAuth
7
9
  } from "./chunk-KA3PSVNV.js";
8
10
  import {
@@ -11,12 +13,15 @@ import {
11
13
  } from "./chunk-BDZUMRBD.js";
12
14
 
13
15
  // src/hooks/useSecureDataAccess.ts
14
- import { useCallback, useState } from "react";
16
+ import { useCallback, useState, useContext } from "react";
15
17
  init_useOrganisations();
18
+ init_EventServiceProvider();
16
19
  init_organisationContext();
17
20
  function useSecureDataAccess() {
18
21
  const { supabase, user, session } = useUnifiedAuth();
19
22
  const { ensureOrganisationContext } = useOrganisations();
23
+ const eventServiceContext = useContext(EventServiceContext);
24
+ const selectedEvent = eventServiceContext?.eventService?.getSelectedEvent() || null;
20
25
  const validateContext = useCallback(() => {
21
26
  if (!supabase) {
22
27
  throw new Error("No Supabase client available");
@@ -295,10 +300,41 @@ function useSecureDataAccess() {
295
300
  "data_cake_mealplans_list"
296
301
  ];
297
302
  const paramName = functionsWithPOrganisationId.includes(functionName) ? "p_organisation_id" : "organisation_id";
303
+ const functionsNeedingEventId = [
304
+ "data_cake_items_list",
305
+ "data_cake_packages_list",
306
+ "data_cake_suppliers_list",
307
+ "data_cake_diettypes_list",
308
+ "data_cake_mealtypes_list",
309
+ "data_cake_diners_list",
310
+ "data_cake_mealplans_list",
311
+ "data_cake_dishes_list",
312
+ "data_cake_recipes_list",
313
+ "data_cake_meals_list",
314
+ "data_cake_units_list",
315
+ "data_cake_orders_list",
316
+ "app_cake_item_create",
317
+ "app_cake_item_update",
318
+ "app_cake_package_create",
319
+ "app_cake_package_update",
320
+ "app_cake_supplier_create",
321
+ "app_cake_supplier_update",
322
+ "app_cake_supplier_delete",
323
+ "app_cake_meal_create",
324
+ "app_cake_meal_update",
325
+ "app_cake_meal_delete",
326
+ "app_cake_unit_create",
327
+ "app_cake_unit_update",
328
+ "app_cake_unit_delete",
329
+ "app_cake_delivery_upsert"
330
+ ];
298
331
  const secureParams = {
299
332
  ...params,
300
333
  [paramName]: organisationId
301
334
  };
335
+ if (functionsNeedingEventId.includes(functionName) && selectedEvent?.event_id) {
336
+ secureParams.p_event_id = selectedEvent.event_id;
337
+ }
302
338
  const { data, error } = await supabase.rpc(functionName, secureParams);
303
339
  if (error) {
304
340
  console.error("[useSecureDataAccess] RPC failed:", error);
@@ -308,7 +344,7 @@ function useSecureDataAccess() {
308
344
  functionName
309
345
  });
310
346
  return data;
311
- }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);
347
+ }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase, selectedEvent?.event_id]);
312
348
  const [dataAccessHistory, setDataAccessHistory] = useState([]);
313
349
  const [isStrictMode] = useState(true);
314
350
  const [isAuditLogEnabled] = useState(true);
@@ -385,4 +421,4 @@ function useSecureDataAccess() {
385
421
  export {
386
422
  useSecureDataAccess
387
423
  };
388
- //# sourceMappingURL=chunk-LZYHAL7Y.js.map
424
+ //# sourceMappingURL=chunk-XN2LYHDI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/useSecureDataAccess.ts"],"sourcesContent":["/**\n * @file useSecureDataAccess Hook\n * @package @jmruthers/pace-core\n * @module Hooks/useSecureDataAccess\n * @since 0.4.0\n *\n * Hook for secure database operations with mandatory organisation context.\n * Ensures all data access is properly scoped to the user's current organisation.\n *\n * @example\n * ```tsx\n * function DataComponent() {\n * const { secureQuery, secureInsert, secureUpdate, secureDelete } = useSecureDataAccess();\n * \n * const loadData = async () => {\n * try {\n * // Automatically includes organisation_id filter\n * const events = await secureQuery('event', '*', { is_visible: true });\n * console.log('Organisation events:', events);\n * } catch (error) {\n * console.error('Failed to load data:', error);\n * }\n * };\n * \n * const createEvent = async (eventData) => {\n * try {\n * // Automatically sets organisation_id\n * const newEvent = await secureInsert('event', eventData);\n * console.log('Created event:', newEvent);\n * } catch (error) {\n * console.error('Failed to create event:', error);\n * }\n * };\n * \n * return (\n * <div>\n * <button onClick={loadData}>Load Data</button>\n * <button onClick={() => createEvent({ event_name: 'New Event' })}>\n * Create Event\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * @security\n * - All queries automatically include organisation_id filter\n * - Validates organisation context before any operation\n * - Prevents data leaks between organisations\n * - Error handling for security violations\n * - Type-safe database operations\n */\n\nimport { useCallback, useState, useContext } from 'react';\nimport { useUnifiedAuth } from '../providers';\nimport { useOrganisations } from './useOrganisations';\nimport { EventServiceContext } from '../providers/services/EventServiceProvider';\nimport { setOrganisationContext } from '../utils/organisationContext';\nimport type { Permission } from '../rbac/types';\nimport type { OrganisationSecurityError } from '../types/organisation';\n\nexport interface SecureDataAccessReturn {\n /** Execute a secure query with organisation filtering */\n secureQuery: <T = any>(\n table: string,\n columns: string,\n filters?: Record<string, any>,\n options?: {\n orderBy?: string;\n ascending?: boolean;\n limit?: number;\n offset?: number;\n }\n ) => Promise<T[]>;\n \n /** Execute a secure insert with organisation context */\n secureInsert: <T = any>(\n table: string,\n data: Record<string, any>\n ) => Promise<T>;\n \n /** Execute a secure update with organisation filtering */\n secureUpdate: <T = any>(\n table: string,\n data: Record<string, any>,\n filters: Record<string, any>\n ) => Promise<T[]>;\n \n /** Execute a secure delete with organisation filtering */\n secureDelete: (\n table: string,\n filters: Record<string, any>\n ) => Promise<void>;\n \n /** Execute a secure RPC call with organisation context */\n secureRpc: <T = any>(\n functionName: string,\n params?: Record<string, any>\n ) => Promise<T>;\n \n /** Get current organisation ID */\n getCurrentOrganisationId: () => string;\n \n /** Validate organisation context */\n validateContext: () => void;\n \n // NEW: Phase 1 - Enhanced Security Features\n /** Check if data access is allowed for a table and operation */\n isDataAccessAllowed: (table: string, operation: string) => boolean;\n \n /** Get all data access permissions for current user */\n getDataAccessPermissions: () => Record<string, string[]>;\n \n /** Check if strict mode is enabled */\n isStrictMode: boolean;\n \n /** Check if audit logging is enabled */\n isAuditLogEnabled: boolean;\n \n /** Get data access history */\n getDataAccessHistory: () => DataAccessRecord[];\n \n /** Clear data access history */\n clearDataAccessHistory: () => void;\n \n /** Validate data access attempt */\n validateDataAccess: (table: string, operation: string) => boolean;\n}\n\nexport interface DataAccessRecord {\n table: string;\n operation: string;\n userId: string;\n organisationId: string;\n allowed: boolean;\n timestamp: string;\n query?: string;\n filters?: Record<string, any>;\n}\n\n/**\n * Hook for secure data access with automatic organisation filtering\n * \n * All database operations automatically include organisation context:\n * - Queries filter by organisation_id\n * - Inserts include organisation_id\n * - Updates/deletes are scoped to organisation\n * - RPC calls include organisation_id parameter\n */\nexport function useSecureDataAccess(): SecureDataAccessReturn {\n const { supabase, user, session } = useUnifiedAuth();\n const { ensureOrganisationContext } = useOrganisations();\n \n // Get selected event for event-scoped RPC calls\n // Use useContext directly to safely check if EventServiceProvider is available\n const eventServiceContext = useContext(EventServiceContext);\n const selectedEvent = eventServiceContext?.eventService?.getSelectedEvent() || null;\n\n const validateContext = useCallback((): void => {\n if (!supabase) {\n throw new Error('No Supabase client available') as OrganisationSecurityError;\n }\n if (!user || !session) {\n throw new Error('User must be authenticated with valid session') as OrganisationSecurityError;\n }\n \n try {\n ensureOrganisationContext();\n } catch (error) {\n throw new Error('Organisation context is required for data access') as OrganisationSecurityError;\n }\n }, [supabase, user, session, ensureOrganisationContext]);\n\n const getCurrentOrganisationId = useCallback((): string => {\n validateContext();\n const currentOrg = ensureOrganisationContext();\n return currentOrg.id;\n }, [validateContext, ensureOrganisationContext]);\n\n // Set organisation context in database session\n const setOrganisationContextInSession = useCallback(async (organisationId: string): Promise<void> => {\n if (!supabase) {\n throw new Error('No Supabase client available') as OrganisationSecurityError;\n }\n\n await setOrganisationContext(supabase, organisationId);\n }, [supabase]);\n\n const secureQuery = useCallback(async <T = any>(\n table: string,\n columns: string,\n filters: Record<string, any> = {},\n options: {\n orderBy?: string;\n ascending?: boolean;\n limit?: number;\n offset?: number;\n } = {}\n ): Promise<T[]> => {\n validateContext();\n const organisationId = getCurrentOrganisationId();\n \n console.log('[useSecureDataAccess] Executing secure query:', {\n table,\n organisationId,\n filters\n });\n\n // Set organisation context in database session\n await setOrganisationContextInSession(organisationId);\n\n // Build query with organisation filter\n let query = supabase!\n .from(table)\n .select(columns);\n\n // Add organisation filter only if table has organisation_id column\n const tablesWithOrganisation = [\n 'event', 'organisation_settings',\n 'rbac_event_app_roles', 'rbac_organisation_roles',\n // SECURITY: Phase 2 additions - complete organisation table mapping\n 'organisation_audit_log', 'organisation_invitations', 'organisation_app_access',\n // SECURITY: Emergency additions for Phase 1 fixes\n 'cake_meal', 'cake_mealtype', 'pace_person', 'pace_member',\n // SECURITY: Phase 3A additions - medical and personal data\n 'medi_profile', 'medi_condition', 'medi_diet', 'medi_action_plan', 'medi_profile_versions',\n 'pace_consent', 'pace_contact', 'pace_id_documents', 'pace_qualifications',\n 'form_responses', 'form_response_values', 'forms',\n // SECURITY: Phase 3B additions - remaining critical tables\n 'invoice', 'line_item', 'credit_balance', 'payment_method',\n 'form_contexts', 'form_field_config', 'form_fields',\n 'cake_delivery', 'cake_diettype', 'cake_diner', 'cake_dish', 'cake_item', \n 'cake_logistics', 'cake_mealplan', 'cake_package', 'cake_recipe', 'cake_supplier', \n 'cake_supply', 'cake_unit', 'event_app_access', 'base_application', 'base_questions'\n ];\n \n if (tablesWithOrganisation.includes(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n\n // Apply additional filters\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n // Handle qualified column names (e.g., 'users.role')\n const columnName = key.includes('.') ? key.split('.').pop()! : key;\n query = query.eq(columnName, value);\n }\n });\n\n // Apply options\n if (options.orderBy) {\n // Only use the column name, not a qualified name\n const orderByColumn = options.orderBy.split('.').pop();\n if (orderByColumn) {\n query = query.order(orderByColumn, { ascending: options.ascending ?? true });\n }\n }\n \n if (options.limit) {\n query = query.limit(options.limit);\n }\n \n if (options.offset) {\n query = query.range(options.offset, options.offset + (options.limit || 100) - 1);\n }\n\n const { data, error } = await query;\n \n if (error) {\n console.error('[useSecureDataAccess] Query failed:', error);\n // NEW: Phase 1 - Record failed data access attempt\n recordDataAccess(table, 'read', false, `SELECT ${columns} FROM ${table}`, filters);\n throw error;\n }\n\n console.log('[useSecureDataAccess] Query successful:', {\n table,\n resultCount: data?.length || 0\n });\n\n // NEW: Phase 1 - Record successful data access attempt\n recordDataAccess(table, 'read', true, `SELECT ${columns} FROM ${table}`, filters);\n\n return (data as T[]) || [];\n }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);\n\n const secureInsert = useCallback(async <T = any>(\n table: string,\n data: Record<string, any>\n ): Promise<T> => {\n validateContext();\n const organisationId = getCurrentOrganisationId();\n \n console.log('[useSecureDataAccess] Executing secure insert:', {\n table,\n organisationId\n });\n\n // Set organisation context in database session\n await setOrganisationContextInSession(organisationId);\n\n // Ensure organisation_id is set\n const secureData = {\n ...data,\n organisation_id: organisationId\n };\n\n const { data: insertData, error } = await supabase!\n .from(table)\n .insert(secureData)\n .select()\n .single();\n\n if (error) {\n console.error('[useSecureDataAccess] Insert failed:', error);\n throw error;\n }\n\n console.log('[useSecureDataAccess] Insert successful:', {\n table,\n id: insertData?.id\n });\n\n return insertData as T;\n }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);\n\n const secureUpdate = useCallback(async <T = any>(\n table: string,\n data: Record<string, any>,\n filters: Record<string, any>\n ): Promise<T[]> => {\n validateContext();\n const organisationId = getCurrentOrganisationId();\n \n console.log('[useSecureDataAccess] Executing secure update:', {\n table,\n organisationId,\n filters\n });\n\n // Set organisation context in database session\n await setOrganisationContextInSession(organisationId);\n\n // Filter out organisation_id from data to prevent manipulation\n const { organisation_id, ...secureData } = data;\n \n // Build update query with organisation filter\n let query = supabase!\n .from(table)\n .update(secureData);\n\n // Add organisation filter only if table has organisation_id column\n const tablesWithOrganisation = [\n 'event', 'organisation_settings',\n 'rbac_event_app_roles', 'rbac_organisation_roles',\n // SECURITY: Phase 2 additions - complete organisation table mapping\n 'organisation_audit_log', 'organisation_invitations', 'organisation_app_access',\n // SECURITY: Emergency additions for Phase 1 fixes\n 'cake_meal', 'cake_mealtype', 'pace_person', 'pace_member'\n ];\n \n if (tablesWithOrganisation.includes(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n\n // Apply filters\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n\n const { data: updateData, error } = await query.select();\n\n if (error) {\n console.error('[useSecureDataAccess] Update failed:', error);\n throw error;\n }\n\n console.log('[useSecureDataAccess] Update successful:', {\n table,\n updatedCount: updateData?.length || 0\n });\n\n return (updateData as T[]) || [];\n }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);\n\n const secureDelete = useCallback(async (\n table: string,\n filters: Record<string, any>\n ): Promise<void> => {\n validateContext();\n const organisationId = getCurrentOrganisationId();\n \n console.log('[useSecureDataAccess] Executing secure delete:', {\n table,\n organisationId,\n filters\n });\n\n // Set organisation context in database session\n await setOrganisationContextInSession(organisationId);\n\n // Build delete query with organisation filter\n let query = supabase!\n .from(table)\n .delete();\n\n // Add organisation filter only if table has organisation_id column\n const tablesWithOrganisation = [\n 'event', 'organisation_settings',\n 'rbac_event_app_roles', 'rbac_organisation_roles',\n // SECURITY: Phase 2 additions - complete organisation table mapping\n 'organisation_audit_log', 'organisation_invitations', 'organisation_app_access',\n // SECURITY: Emergency additions for Phase 1 fixes\n 'cake_meal', 'cake_mealtype', 'pace_person', 'pace_member',\n // SECURITY: Phase 3A additions - medical and personal data\n 'medi_profile', 'medi_condition', 'medi_diet', 'medi_action_plan', 'medi_profile_versions',\n 'pace_consent', 'pace_contact', 'pace_id_documents', 'pace_qualifications',\n 'form_responses', 'form_response_values', 'forms',\n // SECURITY: Phase 3B additions - remaining critical tables\n 'invoice', 'line_item', 'credit_balance', 'payment_method',\n 'form_contexts', 'form_field_config', 'form_fields',\n 'cake_delivery', 'cake_diettype', 'cake_diner', 'cake_dish', 'cake_item', \n 'cake_logistics', 'cake_mealplan', 'cake_package', 'cake_recipe', 'cake_supplier', \n 'cake_supply', 'cake_unit', 'event_app_access', 'base_application', 'base_questions'\n ];\n \n if (tablesWithOrganisation.includes(table)) {\n query = query.eq('organisation_id', organisationId);\n }\n\n // Apply filters\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n query = query.eq(key, value);\n }\n });\n\n const { error } = await query;\n\n if (error) {\n console.error('[useSecureDataAccess] Delete failed:', error);\n throw error;\n }\n\n console.log('[useSecureDataAccess] Delete successful:', {\n table\n });\n }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);\n\n const secureRpc = useCallback(async <T = any>(\n functionName: string,\n params: Record<string, any> = {}\n ): Promise<T> => {\n validateContext();\n const organisationId = getCurrentOrganisationId();\n \n console.log('[useSecureDataAccess] Executing secure RPC:', {\n functionName,\n organisationId\n });\n\n // Set organisation context in database session\n await setOrganisationContextInSession(organisationId);\n\n // Include organisation_id in RPC parameters\n // Some functions use p_organisation_id instead of organisation_id (to avoid conflicts with RETURNS TABLE columns)\n const functionsWithPOrganisationId = [\n 'data_cake_diners_list',\n 'data_cake_mealplans_list'\n ];\n \n const paramName = functionsWithPOrganisationId.includes(functionName) \n ? 'p_organisation_id' \n : 'organisation_id';\n \n // Functions that need p_event_id for event-app role permission checks\n // Note: Even org-scoped functions (like items, packages, suppliers) need event_id\n // for permission checks when users have event-app roles\n const functionsNeedingEventId = [\n 'data_cake_items_list',\n 'data_cake_packages_list',\n 'data_cake_suppliers_list',\n 'data_cake_diettypes_list',\n 'data_cake_mealtypes_list',\n 'data_cake_diners_list',\n 'data_cake_mealplans_list',\n 'data_cake_dishes_list',\n 'data_cake_recipes_list',\n 'data_cake_meals_list',\n 'data_cake_units_list',\n 'data_cake_orders_list',\n 'app_cake_item_create',\n 'app_cake_item_update',\n 'app_cake_package_create',\n 'app_cake_package_update',\n 'app_cake_supplier_create',\n 'app_cake_supplier_update',\n 'app_cake_supplier_delete',\n 'app_cake_meal_create',\n 'app_cake_meal_update',\n 'app_cake_meal_delete',\n 'app_cake_unit_create',\n 'app_cake_unit_update',\n 'app_cake_unit_delete',\n 'app_cake_delivery_upsert'\n ];\n \n const secureParams = {\n ...params,\n [paramName]: organisationId\n };\n \n // Add p_event_id if function needs it and event is selected\n if (functionsNeedingEventId.includes(functionName) && selectedEvent?.event_id) {\n secureParams.p_event_id = selectedEvent.event_id;\n }\n\n const { data, error } = await supabase!.rpc(functionName, secureParams);\n\n if (error) {\n console.error('[useSecureDataAccess] RPC failed:', error);\n throw error;\n }\n\n console.log('[useSecureDataAccess] RPC successful:', {\n functionName\n });\n\n return data as T;\n }, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase, selectedEvent?.event_id]);\n\n // NEW: Phase 1 - Enhanced Security Features\n const [dataAccessHistory, setDataAccessHistory] = useState<DataAccessRecord[]>([]);\n const [isStrictMode] = useState(true); // Always enabled in Phase 1\n const [isAuditLogEnabled] = useState(true); // Always enabled in Phase 1\n\n // Check if data access is allowed for a table and operation\n const isDataAccessAllowed = useCallback((table: string, operation: string): boolean => {\n if (!user?.id) return false;\n \n // Use the existing RBAC system to check data access permissions\n // This is a synchronous check for the context - actual permission checking\n // happens in the secure data operations using the RBAC engine\n const permission = `${operation}:data.${table}` as Permission;\n \n // For now, we'll return true and let the secure data operations\n // handle the actual permission checking asynchronously\n // This context is mainly for tracking and audit purposes\n return true;\n }, [user?.id]);\n\n // Get all data access permissions for current user\n const getDataAccessPermissions = useCallback((): Record<string, string[]> => {\n if (!user?.id) return {};\n \n // For now, return empty object - this will be enhanced with actual permission checking\n // when we integrate with the existing RBAC system\n return {};\n }, [user?.id]);\n\n // Get data access history\n const getDataAccessHistory = useCallback((): DataAccessRecord[] => {\n return [...dataAccessHistory];\n }, [dataAccessHistory]);\n\n // Clear data access history\n const clearDataAccessHistory = useCallback(() => {\n setDataAccessHistory([]);\n }, []);\n\n // Validate data access attempt\n const validateDataAccess = useCallback((table: string, operation: string): boolean => {\n if (!user?.id) return false;\n \n // Validate organisation context\n try {\n validateContext();\n } catch (error) {\n console.error(`[useSecureDataAccess] Organisation context validation failed:`, error);\n return false;\n }\n \n return isDataAccessAllowed(table, operation);\n }, [user?.id, validateContext, isDataAccessAllowed]);\n\n // Record data access attempt\n const recordDataAccess = useCallback((\n table: string,\n operation: string,\n allowed: boolean,\n query?: string,\n filters?: Record<string, any>\n ) => {\n if (!isAuditLogEnabled || !user?.id) return;\n \n const record: DataAccessRecord = {\n table,\n operation,\n userId: user.id,\n organisationId: getCurrentOrganisationId(),\n allowed,\n timestamp: new Date().toISOString(),\n query,\n filters\n };\n \n setDataAccessHistory(prev => {\n const newHistory = [record, ...prev];\n return newHistory.slice(0, 1000); // Keep last 1000 records\n });\n \n if (isStrictMode && !allowed) {\n console.error(`[useSecureDataAccess] STRICT MODE VIOLATION: User attempted data access without permission`, {\n table,\n operation,\n userId: user.id,\n organisationId: getCurrentOrganisationId(),\n timestamp: new Date().toISOString()\n });\n }\n }, [isAuditLogEnabled, isStrictMode, user?.id, getCurrentOrganisationId]);\n\n return {\n secureQuery,\n secureInsert,\n secureUpdate,\n secureDelete,\n secureRpc,\n getCurrentOrganisationId,\n validateContext,\n // NEW: Phase 1 - Enhanced Security Features\n isDataAccessAllowed,\n getDataAccessPermissions,\n isStrictMode,\n isAuditLogEnabled,\n getDataAccessHistory,\n clearDataAccessHistory,\n validateDataAccess\n };\n} "],"mappings":";;;;;;;;;;;;;;;AAqDA,SAAS,aAAa,UAAU,kBAAkB;AAElD;AACA;AACA;AA4FO,SAAS,sBAA8C;AAC5D,QAAM,EAAE,UAAU,MAAM,QAAQ,IAAI,eAAe;AACnD,QAAM,EAAE,0BAA0B,IAAI,iBAAiB;AAIvD,QAAM,sBAAsB,WAAW,mBAAmB;AAC1D,QAAM,gBAAgB,qBAAqB,cAAc,iBAAiB,KAAK;AAE/E,QAAM,kBAAkB,YAAY,MAAY;AAC9C,QAAI,CAAC,UAAU;AACb,YAAM,IAAI,MAAM,8BAA8B;AAAA,IAChD;AACA,QAAI,CAAC,QAAQ,CAAC,SAAS;AACrB,YAAM,IAAI,MAAM,+CAA+C;AAAA,IACjE;AAEA,QAAI;AACF,gCAA0B;AAAA,IAC5B,SAAS,OAAO;AACd,YAAM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F,aAAO;AAAA,IACT;AAEA,WAAO,oBAAoB,OAAO,SAAS;AAAA,EAC7C,GAAG,CAAC,MAAM,IAAI,iBAAiB,mBAAmB,CAAC;AAGnD,QAAM,mBAAmB,YAAY,CACnC,OACA,WACA,SACA,OACA,YACG;AACH,QAAI,CAAC,qBAAqB,CAAC,MAAM,GAAI;AAErC,UAAM,SAA2B;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,QAAQ,KAAK;AAAA,MACb,gBAAgB,yBAAyB;AAAA,MACzC;AAAA,MACA,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MAClC;AAAA,MACA;AAAA,IACF;AAEA,yBAAqB,UAAQ;AAC3B,YAAM,aAAa,CAAC,QAAQ,GAAG,IAAI;AACnC,aAAO,WAAW,MAAM,GAAG,GAAI;AAAA,IACjC,CAAC;AAED,QAAI,gBAAgB,CAAC,SAAS;AAC5B,cAAQ,MAAM,8FAA8F;AAAA,QAC1G;AAAA,QACA;AAAA,QACA,QAAQ,KAAK;AAAA,QACb,gBAAgB,yBAAyB;AAAA,QACzC,YAAW,oBAAI,KAAK,GAAE,YAAY;AAAA,MACpC,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,mBAAmB,cAAc,MAAM,IAAI,wBAAwB,CAAC;AAExE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
package/dist/hooks.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-ECOVPXYS.js";
12
12
  import {
13
13
  useSecureDataAccess
14
- } from "./chunk-LZYHAL7Y.js";
14
+ } from "./chunk-XN2LYHDI.js";
15
15
  import {
16
16
  clearFileDisplayCache,
17
17
  clearPublicFileDisplayCache,
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  withAccessLevelGuard,
31
31
  withPermissionGuard,
32
32
  withRoleGuard
33
- } from "./chunk-KMPWND3F.js";
33
+ } from "./chunk-IZXS7RZK.js";
34
34
  import {
35
35
  init_useInactivityTracker,
36
36
  useInactivityTracker
@@ -184,7 +184,7 @@ import {
184
184
  usePublicEventCode,
185
185
  usePublicRouteParams
186
186
  } from "./chunk-ECOVPXYS.js";
187
- import "./chunk-LZYHAL7Y.js";
187
+ import "./chunk-XN2LYHDI.js";
188
188
  import {
189
189
  APP_PATH_MAPPING,
190
190
  DEFAULT_FILE_SIZE_LIMIT,
@@ -30,7 +30,7 @@ import {
30
30
  withAccessLevelGuard,
31
31
  withPermissionGuard,
32
32
  withRoleGuard
33
- } from "../chunk-KMPWND3F.js";
33
+ } from "../chunk-IZXS7RZK.js";
34
34
  import {
35
35
  useAccessLevel,
36
36
  useCachedPermissions,
@@ -72,7 +72,7 @@ import {
72
72
  getGlobalAuditManager,
73
73
  setGlobalAuditManager
74
74
  } from "../chunk-3DBFLLLU.js";
75
- import "../chunk-LZYHAL7Y.js";
75
+ import "../chunk-XN2LYHDI.js";
76
76
  import "../chunk-LFS45U62.js";
77
77
  import "../chunk-VN3OOE35.js";
78
78
  import "../chunk-O3FTRYEU.js";
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / ColumnFactory
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / ColumnFactory
2
2
 
3
3
  # Class: ColumnFactory\<TData\>
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / ErrorBoundary
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / ErrorBoundary
2
2
 
3
3
  # Class: ErrorBoundary
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / InvalidScopeError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / InvalidScopeError
2
2
 
3
3
  # Class: InvalidScopeError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / MissingUserContextError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / MissingUserContextError
2
2
 
3
3
  # Class: MissingUserContextError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / OrganisationContextRequiredError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / OrganisationContextRequiredError
2
2
 
3
3
  # Class: OrganisationContextRequiredError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / PermissionDeniedError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / PermissionDeniedError
2
2
 
3
3
  # Class: PermissionDeniedError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / PublicErrorBoundary
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / PublicErrorBoundary
2
2
 
3
3
  # Class: PublicErrorBoundary
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / RBACAuditManager
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / RBACAuditManager
2
2
 
3
3
  # Class: RBACAuditManager
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / RBACCache
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / RBACCache
2
2
 
3
3
  # Class: RBACCache
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / RBACEngine
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / RBACEngine
2
2
 
3
3
  # Class: RBACEngine
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / RBACError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / RBACError
2
2
 
3
3
  # Class: RBACError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / RBACNotInitializedError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / RBACNotInitializedError
2
2
 
3
3
  # Class: RBACNotInitializedError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / SecureSupabaseClient
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / SecureSupabaseClient
2
2
 
3
3
  # Class: SecureSupabaseClient
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / StorageUtils
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / StorageUtils
2
2
 
3
3
  # Class: StorageUtils
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileCategory
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileCategory
2
2
 
3
3
  # Enumeration: FileCategory
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / AggregateConfig
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / AggregateConfig
2
2
 
3
3
  # Interface: AggregateConfig
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / ButtonProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / ButtonProps
2
2
 
3
3
  # Interface: ButtonProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / CardProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / CardProps
2
2
 
3
3
  # Interface: CardProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / ColorPalette
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / ColorPalette
2
2
 
3
3
  # Interface: ColorPalette
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / ColorShade
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / ColorShade
2
2
 
3
3
  # Interface: ColorShade
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataAccessRecord
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataAccessRecord
2
2
 
3
3
  # Interface: DataAccessRecord
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataRecord
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataRecord
2
2
 
3
3
  # Interface: DataRecord
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataTableAction
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataTableAction
2
2
 
3
3
  # Interface: DataTableAction\<TData\>
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataTableColumn
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataTableColumn
2
2
 
3
3
  # Interface: DataTableColumn\<TData\>
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataTableProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataTableProps
2
2
 
3
3
  # Interface: DataTableProps\<TData\>
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / DataTableToolbarButton
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / DataTableToolbarButton
2
2
 
3
3
  # Interface: DataTableToolbarButton
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / EmptyStateConfig
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / EmptyStateConfig
2
2
 
3
3
  # Interface: EmptyStateConfig
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / EnhancedNavigationMenuProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / EnhancedNavigationMenuProps
2
2
 
3
3
  # Interface: EnhancedNavigationMenuProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / EventAppRoleData
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / EventAppRoleData
2
2
 
3
3
  # Interface: EventAppRoleData
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileDisplayProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileDisplayProps
2
2
 
3
3
  # Interface: FileDisplayProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileMetadata
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileMetadata
2
2
 
3
3
  # Interface: FileMetadata
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileReference
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileReference
2
2
 
3
3
  # Interface: FileReference
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileSizeLimits
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileSizeLimits
2
2
 
3
3
  # Interface: FileSizeLimits
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileUploadOptions
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileUploadOptions
2
2
 
3
3
  # Interface: FileUploadOptions
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FileUploadProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FileUploadProps
2
2
 
3
3
  # Interface: FileUploadProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / FooterProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / FooterProps
2
2
 
3
3
  # Interface: FooterProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / GrantEventAppRoleParams
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / GrantEventAppRoleParams
2
2
 
3
3
  # Interface: GrantEventAppRoleParams
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / InactivityWarningModalProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / InactivityWarningModalProps
2
2
 
3
3
  # Interface: InactivityWarningModalProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / InputProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / InputProps
2
2
 
3
3
  # Interface: InputProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / LabelProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / LabelProps
2
2
 
3
3
  # Interface: LabelProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / LoginFormProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / LoginFormProps
2
2
 
3
3
  # Interface: LoginFormProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationAccessRecord
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationAccessRecord
2
2
 
3
3
  # Interface: NavigationAccessRecord
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationContextType
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationContextType
2
2
 
3
3
  # Interface: NavigationContextType
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationGuardProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationGuardProps
2
2
 
3
3
  # Interface: NavigationGuardProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationItem
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationItem
2
2
 
3
3
  # Interface: NavigationItem
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationMenuProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationMenuProps
2
2
 
3
3
  # Interface: NavigationMenuProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / NavigationProviderProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / NavigationProviderProps
2
2
 
3
3
  # Interface: NavigationProviderProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / Organisation
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / Organisation
2
2
 
3
3
  # Interface: Organisation
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / OrganisationContextType
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / OrganisationContextType
2
2
 
3
3
  # Interface: OrganisationContextType
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / OrganisationMembership
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / OrganisationMembership
2
2
 
3
3
  # Interface: OrganisationMembership
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / OrganisationProviderProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / OrganisationProviderProps
2
2
 
3
3
  # Interface: OrganisationProviderProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / OrganisationSecurityError
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / OrganisationSecurityError
2
2
 
3
3
  # Interface: OrganisationSecurityError
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / PaceAppLayoutProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / PaceAppLayoutProps
2
2
 
3
3
  # Interface: PaceAppLayoutProps
4
4
 
@@ -1,4 +1,4 @@
1
- [@jmruthers/pace-core - v0.5.116](../README.md) / [Exports](../modules.md) / PaceLoginPageProps
1
+ [@jmruthers/pace-core - v0.5.117](../README.md) / [Exports](../modules.md) / PaceLoginPageProps
2
2
 
3
3
  # Interface: PaceLoginPageProps
4
4