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.
83 lines
1.5 KiB
83 lines
1.5 KiB
export enum EntityType {
|
|
User = 'users',
|
|
Group = 'groups',
|
|
Log = 'logs',
|
|
Invitation = 'invitations',
|
|
App = 'apps',
|
|
}
|
|
|
|
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
|
|
about: string
|
|
}
|
|
|
|
export type Installation = {
|
|
app: App
|
|
settings: object
|
|
created: number
|
|
}
|
|
|
|
export type User = Entity & {
|
|
name: string
|
|
group?: Group
|
|
about?: string
|
|
imageUrl?: string
|
|
coverImageUrl?: string
|
|
requiresApproval: boolean
|
|
privacy: string
|
|
installations: Installation[]
|
|
}
|
|
|
|
export type GroupLog = Entity & {
|
|
user: User
|
|
content: string
|
|
}
|
|
|
|
export type Invitation = Entity & {
|
|
user: User
|
|
uses: number
|
|
expires: number
|
|
}
|
|
|
|
export type App = Entity & {
|
|
version: string
|
|
name: string
|
|
imageUrl?: string
|
|
coverImageUrl?: string
|
|
about?: string
|
|
websiteUrl?: string
|
|
companyName?: string
|
|
composerUrl?: string
|
|
composerSchema?: object
|
|
rendererUrl?: string
|
|
rendererSchema?: object
|
|
initCallbackUrl?: string
|
|
composeCallbackUrl?: string
|
|
rating: number
|
|
publicKey?: string
|
|
privateKey?: string
|
|
active: boolean
|
|
updated: number
|
|
created: number
|
|
}
|
|
|
|
export interface EntityCollection {
|
|
[id: string]: Entity
|
|
}
|
|
|
|
export interface EntityStore {
|
|
[type: string]: EntityCollection
|
|
}
|