mirror of
https://github.com/owncast/owncast.git
synced 2024-11-22 12:49:37 +03:00
38 lines
751 B
TypeScript
38 lines
751 B
TypeScript
/* eslint-disable import/prefer-default-export */
|
|
export class User {
|
|
constructor(u) {
|
|
this.id = u.id;
|
|
this.displayName = u.displayName;
|
|
this.displayColor = u.displayColor;
|
|
this.createdAt = u.createdAt;
|
|
this.previousNames = u.previousNames;
|
|
this.nameChangedAt = u.nameChangedAt;
|
|
this.scopes = u.scopes;
|
|
this.authenticated = u.authenticated;
|
|
this.isBot = u.isBot;
|
|
|
|
if (this.scopes && this.scopes.length > 0) {
|
|
this.isModerator = this.scopes.includes('MODERATOR');
|
|
}
|
|
}
|
|
|
|
id: string;
|
|
|
|
displayName: string;
|
|
|
|
displayColor: number;
|
|
|
|
createdAt: Date;
|
|
|
|
previousNames: string[];
|
|
|
|
nameChangedAt: Date;
|
|
|
|
scopes: string[];
|
|
|
|
authenticated: boolean;
|
|
|
|
isBot: boolean;
|
|
|
|
isModerator: boolean;
|
|
}
|