generated from taylorbryant/gatsby-starter-tailwind
-
-
Notifications
You must be signed in to change notification settings - Fork 112
/
User.ts
46 lines (41 loc) · 1.32 KB
/
User.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export interface IReadOnlyUserMetadata {
uuid: string
roles: string[]
loginsCount: number
}
export interface IWritableUserMetadata {
name: string
nick: string
bio: string
website?: string
ticksImported?: boolean
collections?: {
/** Users can organize entities into their own 'climbing playlists'
* Strictly speaking, this should always be mutated as a SET rather than an
* array. JSON does not support set serialization, but we ideally wish to minimize
* the actual space, so do whatever needs to be done to avoid ID duplicates.
* The key of each collection is its name.
*/
climbCollections?: {[key: string]: string[]}
/**
* Areas are seperated into their own collection rather than mixing them in with
* the climbs. Partially because they are different entities altogether, and partly
* because it seems sensible to me.
* The key of each collection is its name.
*/
areaCollections?: { [key: string]: string[] }
}
}
export type IUserMetadata = IWritableUserMetadata & IReadOnlyUserMetadata
export interface IUserProfile extends IUserMetadata {
email?: string
avatar?: string
authProviderId: string
}
export interface WithOwnerProfile {
ownerProfile: IUserProfile
}
export interface WithPermission {
isAuthorized: boolean
isAuthenticated: boolean
}