You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
838 B
50 lines
838 B
export enum EntityType {
|
|
User = 'users',
|
|
Group = 'groups',
|
|
Log = 'logs',
|
|
Invitation = 'invitations',
|
|
}
|
|
|
|
export enum GroupMembershipType {
|
|
Admin = 'admin',
|
|
Moderator = 'moderator',
|
|
Member = 'member',
|
|
}
|
|
|
|
export interface Entity {
|
|
[key: string]: any
|
|
id: string
|
|
created: number
|
|
}
|
|
|
|
export type Group = Entity & {
|
|
name: string
|
|
membership?: GroupMembershipType
|
|
}
|
|
|
|
export type User = Entity & {
|
|
name: string
|
|
group?: Group
|
|
about?: string
|
|
imageUrl?: string
|
|
coverImageUrl?: string
|
|
}
|
|
|
|
export type GroupLog = Entity & {
|
|
user: User
|
|
content: string
|
|
}
|
|
|
|
export type Invitation = Entity & {
|
|
user: User
|
|
uses: number
|
|
expires: number
|
|
}
|
|
|
|
export interface EntityCollection {
|
|
[id: string]: Entity
|
|
}
|
|
|
|
export interface EntityStore {
|
|
[type: string]: EntityCollection
|
|
}
|