@jmruthers/pace-core 0.5.125 → 0.5.127
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-IHD4JP4W.js → DataTable-QZH6SEUM.js} +6 -6
- package/dist/{PublicLoadingSpinner-CaoRbHvJ.d.ts → PublicLoadingSpinner-qqvM-NUe.d.ts} +34 -21
- package/dist/{UnifiedAuthProvider-6C47WIML.js → UnifiedAuthProvider-CQDZRJIS.js} +3 -3
- package/dist/{chunk-ZBLK676C.js → chunk-3CG5L6RN.js} +1 -19
- package/dist/chunk-3CG5L6RN.js.map +1 -0
- package/dist/{chunk-35ZDPMBM.js → chunk-BYXRHAIF.js} +3 -3
- package/dist/{chunk-IJOZZOGT.js → chunk-CQZU6TFE.js} +5 -5
- package/dist/{chunk-C43QIDN3.js → chunk-CTJRBUX2.js} +2 -2
- package/dist/{chunk-ESJTIADP.js → chunk-F64FFPOZ.js} +5 -15
- package/dist/{chunk-ESJTIADP.js.map → chunk-F64FFPOZ.js.map} +1 -1
- package/dist/{chunk-JJVLYIEO.js → chunk-JDBO5NCG.js} +253 -135
- package/dist/chunk-JDBO5NCG.js.map +1 -0
- package/dist/{chunk-4MXVZVNS.js → chunk-TGIY2AR2.js} +2 -2
- package/dist/{chunk-HC7AOIC2.js → chunk-TMUNK34W.js} +428 -446
- package/dist/chunk-TMUNK34W.js.map +1 -0
- package/dist/{chunk-XN6GWKMV.js → chunk-VZ5OR6HD.js} +161 -14
- package/dist/chunk-VZ5OR6HD.js.map +1 -0
- package/dist/{chunk-QWNJCQXZ.js → chunk-ZV77RZMU.js} +2 -2
- package/dist/{chunk-NZGLXZGP.js → chunk-ZYZCRSBD.js} +3 -54
- package/dist/chunk-ZYZCRSBD.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +9 -9
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/providers.js +2 -2
- package/dist/rbac/index.js +7 -7
- package/dist/utils.js +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +10 -62
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +46 -28
- package/docs/architecture/rpc-function-standards.md +39 -5
- package/package.json +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/DataTable/components/ImportModal.tsx +134 -2
- package/src/components/DataTable/components/UnifiedTableBody.tsx +6 -3
- package/src/components/Dialog/Dialog.tsx +0 -13
- package/src/components/FileDisplay/FileDisplay.tsx +76 -0
- package/src/components/Header/Header.tsx +5 -0
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +12 -39
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +69 -128
- package/src/components/PublicLayout/PublicPageLayout.tsx +4 -4
- package/src/components/PublicLayout/PublicPageProvider.tsx +12 -3
- package/src/components/PublicLayout/__tests__/PublicPageFooter.test.tsx +1 -1
- package/src/components/PublicLayout/__tests__/PublicPageHeader.test.tsx +3 -18
- package/src/hooks/__tests__/useAppConfig.unit.test.ts +3 -1
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +11 -5
- package/src/hooks/__tests__/usePublicRouteParams.unit.test.ts +8 -7
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +41 -46
- package/src/hooks/public/usePublicFileDisplay.ts +176 -7
- package/src/hooks/public/usePublicRouteParams.ts +0 -12
- package/src/hooks/useAppConfig.ts +15 -6
- package/src/hooks/usePermissionCache.test.ts +12 -4
- package/src/hooks/usePermissionCache.ts +3 -19
- package/src/hooks/useSecureDataAccess.ts +0 -63
- package/src/services/EventService.ts +0 -19
- package/dist/chunk-HC7AOIC2.js.map +0 -1
- package/dist/chunk-JJVLYIEO.js.map +0 -1
- package/dist/chunk-NZGLXZGP.js.map +0 -1
- package/dist/chunk-XN6GWKMV.js.map +0 -1
- package/dist/chunk-ZBLK676C.js.map +0 -1
- /package/dist/{DataTable-IHD4JP4W.js.map → DataTable-QZH6SEUM.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-6C47WIML.js.map → UnifiedAuthProvider-CQDZRJIS.js.map} +0 -0
- /package/dist/{chunk-35ZDPMBM.js.map → chunk-BYXRHAIF.js.map} +0 -0
- /package/dist/{chunk-IJOZZOGT.js.map → chunk-CQZU6TFE.js.map} +0 -0
- /package/dist/{chunk-C43QIDN3.js.map → chunk-CTJRBUX2.js.map} +0 -0
- /package/dist/{chunk-4MXVZVNS.js.map → chunk-TGIY2AR2.js.map} +0 -0
- /package/dist/{chunk-QWNJCQXZ.js.map → chunk-ZV77RZMU.js.map} +0 -0
|
@@ -199,12 +199,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
199
199
|
): Promise<T[]> => {
|
|
200
200
|
validateContext();
|
|
201
201
|
const organisationId = getCurrentOrganisationId();
|
|
202
|
-
|
|
203
|
-
console.log('[useSecureDataAccess] Executing secure query:', {
|
|
204
|
-
table,
|
|
205
|
-
organisationId,
|
|
206
|
-
filters
|
|
207
|
-
});
|
|
208
202
|
|
|
209
203
|
// Set organisation context in database session
|
|
210
204
|
await setOrganisationContextInSession(organisationId);
|
|
@@ -273,11 +267,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
273
267
|
throw error;
|
|
274
268
|
}
|
|
275
269
|
|
|
276
|
-
console.log('[useSecureDataAccess] Query successful:', {
|
|
277
|
-
table,
|
|
278
|
-
resultCount: data?.length || 0
|
|
279
|
-
});
|
|
280
|
-
|
|
281
270
|
// NEW: Phase 1 - Record successful data access attempt
|
|
282
271
|
recordDataAccess(table, 'read', true, `SELECT ${columns} FROM ${table}`, filters);
|
|
283
272
|
|
|
@@ -290,11 +279,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
290
279
|
): Promise<T> => {
|
|
291
280
|
validateContext();
|
|
292
281
|
const organisationId = getCurrentOrganisationId();
|
|
293
|
-
|
|
294
|
-
console.log('[useSecureDataAccess] Executing secure insert:', {
|
|
295
|
-
table,
|
|
296
|
-
organisationId
|
|
297
|
-
});
|
|
298
282
|
|
|
299
283
|
// Set organisation context in database session
|
|
300
284
|
await setOrganisationContextInSession(organisationId);
|
|
@@ -316,11 +300,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
316
300
|
throw error;
|
|
317
301
|
}
|
|
318
302
|
|
|
319
|
-
console.log('[useSecureDataAccess] Insert successful:', {
|
|
320
|
-
table,
|
|
321
|
-
id: insertData?.id
|
|
322
|
-
});
|
|
323
|
-
|
|
324
303
|
return insertData as T;
|
|
325
304
|
}, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);
|
|
326
305
|
|
|
@@ -331,12 +310,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
331
310
|
): Promise<T[]> => {
|
|
332
311
|
validateContext();
|
|
333
312
|
const organisationId = getCurrentOrganisationId();
|
|
334
|
-
|
|
335
|
-
console.log('[useSecureDataAccess] Executing secure update:', {
|
|
336
|
-
table,
|
|
337
|
-
organisationId,
|
|
338
|
-
filters
|
|
339
|
-
});
|
|
340
313
|
|
|
341
314
|
// Set organisation context in database session
|
|
342
315
|
await setOrganisationContextInSession(organisationId);
|
|
@@ -377,11 +350,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
377
350
|
throw error;
|
|
378
351
|
}
|
|
379
352
|
|
|
380
|
-
console.log('[useSecureDataAccess] Update successful:', {
|
|
381
|
-
table,
|
|
382
|
-
updatedCount: updateData?.length || 0
|
|
383
|
-
});
|
|
384
|
-
|
|
385
353
|
return (updateData as T[]) || [];
|
|
386
354
|
}, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);
|
|
387
355
|
|
|
@@ -391,12 +359,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
391
359
|
): Promise<void> => {
|
|
392
360
|
validateContext();
|
|
393
361
|
const organisationId = getCurrentOrganisationId();
|
|
394
|
-
|
|
395
|
-
console.log('[useSecureDataAccess] Executing secure delete:', {
|
|
396
|
-
table,
|
|
397
|
-
organisationId,
|
|
398
|
-
filters
|
|
399
|
-
});
|
|
400
362
|
|
|
401
363
|
// Set organisation context in database session
|
|
402
364
|
await setOrganisationContextInSession(organisationId);
|
|
@@ -443,10 +405,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
443
405
|
console.error('[useSecureDataAccess] Delete failed:', error);
|
|
444
406
|
throw error;
|
|
445
407
|
}
|
|
446
|
-
|
|
447
|
-
console.log('[useSecureDataAccess] Delete successful:', {
|
|
448
|
-
table
|
|
449
|
-
});
|
|
450
408
|
}, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase]);
|
|
451
409
|
|
|
452
410
|
const secureRpc = useCallback(async <T = any>(
|
|
@@ -455,11 +413,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
455
413
|
): Promise<T> => {
|
|
456
414
|
validateContext();
|
|
457
415
|
const organisationId = getCurrentOrganisationId();
|
|
458
|
-
|
|
459
|
-
console.log('[useSecureDataAccess] Executing secure RPC:', {
|
|
460
|
-
functionName,
|
|
461
|
-
organisationId
|
|
462
|
-
});
|
|
463
416
|
|
|
464
417
|
// Set organisation context in database session
|
|
465
418
|
await setOrganisationContextInSession(organisationId);
|
|
@@ -543,18 +496,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
543
496
|
secureParams.p_event_id = selectedEvent.event_id;
|
|
544
497
|
}
|
|
545
498
|
|
|
546
|
-
// Debug logging for items list to help diagnose issues
|
|
547
|
-
if (functionName === 'data_cake_items_list') {
|
|
548
|
-
console.log('[useSecureDataAccess] Calling data_cake_items_list with params:', {
|
|
549
|
-
p_user_id: secureParams.p_user_id,
|
|
550
|
-
p_organisation_id: secureParams.organisation_id || secureParams.p_organisation_id,
|
|
551
|
-
p_event_id: secureParams.p_event_id,
|
|
552
|
-
hasEvent: !!selectedEvent?.event_id,
|
|
553
|
-
eventId: selectedEvent?.event_id,
|
|
554
|
-
allParams: secureParams
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
|
|
558
499
|
const { data, error } = await supabase!.rpc(functionName, secureParams);
|
|
559
500
|
|
|
560
501
|
if (error) {
|
|
@@ -562,10 +503,6 @@ export function useSecureDataAccess(): SecureDataAccessReturn {
|
|
|
562
503
|
throw error;
|
|
563
504
|
}
|
|
564
505
|
|
|
565
|
-
console.log('[useSecureDataAccess] RPC successful:', {
|
|
566
|
-
functionName
|
|
567
|
-
});
|
|
568
|
-
|
|
569
506
|
return data as T;
|
|
570
507
|
}, [validateContext, getCurrentOrganisationId, setOrganisationContextInSession, supabase, selectedEvent?.event_id, user?.id]);
|
|
571
508
|
|
|
@@ -133,15 +133,6 @@ export class EventService extends BaseService implements IEventService {
|
|
|
133
133
|
if (event) {
|
|
134
134
|
// SECURITY: Validate event belongs to current organisation
|
|
135
135
|
try {
|
|
136
|
-
console.log('[EventService] Event selection validation:', {
|
|
137
|
-
eventId: event.event_id,
|
|
138
|
-
eventName: event.event_name,
|
|
139
|
-
eventOrganisationId: event.organisation_id,
|
|
140
|
-
selectedOrganisationId: this.selectedOrganisation?.id,
|
|
141
|
-
selectedOrganisationName: this.selectedOrganisation?.display_name,
|
|
142
|
-
match: event.organisation_id === this.selectedOrganisation?.id
|
|
143
|
-
});
|
|
144
|
-
|
|
145
136
|
if (this.selectedOrganisation && event.organisation_id !== this.selectedOrganisation.id) {
|
|
146
137
|
console.error('[EventService] Event organisation_id does not match selected organisation', {
|
|
147
138
|
eventOrganisationId: event.organisation_id,
|
|
@@ -355,12 +346,6 @@ export class EventService extends BaseService implements IEventService {
|
|
|
355
346
|
|
|
356
347
|
if (isMounted) {
|
|
357
348
|
const eventsData = data || [];
|
|
358
|
-
console.log('[EventService] Loaded events:', eventsData.map((event: any) => ({
|
|
359
|
-
eventId: event.event_id,
|
|
360
|
-
eventName: event.event_name,
|
|
361
|
-
organisationId: event.organisation_id,
|
|
362
|
-
selectedOrganisationId: this.selectedOrganisation?.id
|
|
363
|
-
})));
|
|
364
349
|
|
|
365
350
|
// Transform the data to match our Event interface
|
|
366
351
|
const transformedEvents: Event[] = eventsData.map((event: any) => ({
|
|
@@ -381,10 +366,6 @@ export class EventService extends BaseService implements IEventService {
|
|
|
381
366
|
}));
|
|
382
367
|
|
|
383
368
|
this.events = transformedEvents;
|
|
384
|
-
console.log('[EventService] Set events in service:', {
|
|
385
|
-
count: transformedEvents.length,
|
|
386
|
-
events: transformedEvents.map(e => ({ id: e.event_id, name: e.event_name }))
|
|
387
|
-
});
|
|
388
369
|
this.error = null;
|
|
389
370
|
|
|
390
371
|
// Reset auto-selection ref for new events
|