All checks were successful
Queue Release Build / prepare (push) Successful in 28s
Deploy Web Apps / deploy (push) Successful in 5m2s
Queue Release Build / build-windows (push) Successful in 16m44s
Queue Release Build / build-linux (push) Successful in 27m12s
Queue Release Build / finalize (push) Successful in 22s
101 lines
3.0 KiB
TypeScript
101 lines
3.0 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;
|
|
};
|
|
}>()
|
|
}
|
|
});
|