feat(server): add websocket events for activity changes
- Add 'activity.change' event to event repository - Emit event when new activity (reaction/comment) is created - Add notification handler to broadcast activity changes to relevant users - Update frontend websocket types to include on_activity_change event - Update tests to mock album repository calls
This commit is contained in:
@@ -47,6 +47,9 @@ type EventMap = {
|
||||
];
|
||||
'config.validate': [{ newConfig: SystemConfig; oldConfig: SystemConfig }];
|
||||
|
||||
// activity events
|
||||
'activity.change': [{ recipientId: string[]; userId: string; albumId: string; assetId: string | null }];
|
||||
|
||||
// album events
|
||||
'album.update': [
|
||||
{ id: string; recipientId: string[]; assetId: string[]; userId: string; status: 'added' | 'removed' },
|
||||
@@ -54,6 +57,7 @@ type EventMap = {
|
||||
'album.invite': [{ id: string; userId: string }];
|
||||
|
||||
// asset events
|
||||
'asset.update': [{ assetIds: string[]; userId: string }];
|
||||
'asset.person': [
|
||||
{ assetId: string; userId: string; personId: string | undefined; status: 'created' | 'removed' | 'removed_soft' },
|
||||
];
|
||||
@@ -102,11 +106,12 @@ export type ArgsOf<T extends EmitEvent> = EventMap[T];
|
||||
export interface ClientEventMap {
|
||||
on_upload_success: [AssetResponseDto];
|
||||
on_user_delete: [string];
|
||||
on_activity_change: [{ albumId: string; assetId: string | null }];
|
||||
on_album_update: [{ albumId: string; assetId: string[]; status: 'added' | 'removed' }];
|
||||
on_asset_person: [{ assetId: string; personId: string | undefined; status: 'created' | 'removed' | 'removed_soft' }];
|
||||
on_asset_delete: [string];
|
||||
on_asset_trash: [string[]];
|
||||
on_asset_update: [AssetResponseDto];
|
||||
on_asset_update: [string[]];
|
||||
on_asset_hidden: [string];
|
||||
on_asset_restore: [string[]];
|
||||
on_asset_stack_update: string[];
|
||||
|
||||
Reference in New Issue
Block a user