Files
Toju/toju-app/src/app/store/users/users.actions.ts
Myx 180333dc35
Some checks failed
Queue Release Build / prepare (push) Successful in 27s
Deploy Web Apps / deploy (push) Failing after 4m58s
Queue Release Build / build-linux (push) Failing after 10m55s
Queue Release Build / build-windows (push) Successful in 16m14s
Queue Release Build / finalize (push) Has been skipped
feat: Add user metadata changing display name and description with sync
2026-04-17 22:04:18 +02:00

69 lines
2.8 KiB
TypeScript

/**
* Users store actions using `createActionGroup`.
*/
import {
createActionGroup,
emptyProps,
props
} from '@ngrx/store';
import {
User,
UserStatus,
BanEntry,
VoiceState,
ScreenShareState,
CameraState
} from '../../shared-kernel';
export const UsersActions = createActionGroup({
source: 'Users',
events: {
'Load Current User': emptyProps(),
'Load Current User Success': props<{ user: User }>(),
'Load Current User Failure': props<{ error: string }>(),
'Set Current User': props<{ user: User }>(),
'Update Current User': props<{ updates: Partial<User> }>(),
'Load Room Users': props<{ roomId: string }>(),
'Load Room Users Success': props<{ users: User[] }>(),
'Load Room Users Failure': props<{ error: string }>(),
'User Joined': props<{ user: User }>(),
'User Left': props<{ userId: string; serverId?: string; serverIds?: string[] }>(),
'Sync Server Presence': props<{ roomId: string; users: User[] }>(),
'Update User': props<{ userId: string; updates: Partial<User> }>(),
'Update User Role': props<{ userId: string; role: User['role'] }>(),
'Kick User': props<{ userId: string; roomId?: string }>(),
'Kick User Success': props<{ userId: string; roomId: string }>(),
'Ban User': props<{ userId: string; roomId?: string; displayName?: string; reason?: string; expiresAt?: number }>(),
'Ban User Success': props<{ userId: string; roomId: string; ban: BanEntry }>(),
'Unban User': props<{ roomId: string; oderId: string }>(),
'Unban User Success': props<{ oderId: string }>(),
'Load Bans': emptyProps(),
'Load Bans Success': props<{ bans: BanEntry[] }>(),
'Admin Mute User': props<{ userId: string }>(),
'Admin Unmute User': props<{ userId: string }>(),
'Sync Users': props<{ users: User[] }>(),
'Clear Users': emptyProps(),
'Update Host': props<{ userId: string }>(),
'Update Voice State': props<{ userId: string; voiceState: Partial<VoiceState> }>(),
'Update Screen Share State': props<{ userId: string; screenShareState: Partial<ScreenShareState> }>(),
'Update Camera State': props<{ userId: string; cameraState: Partial<CameraState> }>(),
'Set Manual Status': props<{ status: UserStatus | null }>(),
'Update Remote User Status': props<{ userId: string; status: UserStatus }>(),
'Update Current User Profile': props<{ profile: { displayName: string; description?: string; profileUpdatedAt: number } }>(),
'Update Current User Avatar': props<{ avatar: { avatarUrl: string; avatarHash: string; avatarMime: string; avatarUpdatedAt: number } }>(),
'Upsert Remote User Avatar': props<{ user: { id: string; oderId: string; username: string; displayName: string; description?: string; profileUpdatedAt?: number; avatarUrl?: string; avatarHash?: string; avatarMime?: string; avatarUpdatedAt?: number } }>()
}
});