forked from Joystream/orion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.graphql
216 lines (169 loc) · 6.28 KB
/
auth.graphql
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
enum OperatorPermission {
GRANT_OPERATOR_PERMISSIONS
REVOKE_OPERATOR_PERMISSIONS
SET_VIDEO_WEIGHTS
SET_CHANNEL_WEIGHTS
SET_KILL_SWITCH
SET_VIDEO_VIEW_PER_USER_TIME_LIMIT
SET_VIDEO_HERO
SET_CATEGORY_FEATURED_VIDEOS
SET_SUPPORTED_CATEGORIES
SET_FEATURED_NFTS
EXCLUDE_CONTENT
RESTORE_CONTENT
SET_PUBLIC_FEED_VIDEOS
SET_FEATURED_CRTS
}
type User @entity @schema(name: "admin") {
"Unique identifier (32-byte string, securely random)"
id: ID!
"Whether the user has root (gateway operator) privileges"
isRoot: Boolean!
"List of all the gateway operator permissions that this user has"
permissions: [OperatorPermission!]
"The account associated with the user (if any)"
account: Account @derivedFrom(field: "user")
"User's channel follows"
channelFollows: [ChannelFollow!]! @derivedFrom(field: "user")
"Video views associated with the user"
videoViewEvents: [VideoViewEvent!]! @derivedFrom(field: "user")
"Reports associated with the user"
reports: [Report!]! @derivedFrom(field: "user")
"NFT featuring requests associated with the user"
nftFeaturingRequests: [NftFeaturingRequest!]! @derivedFrom(field: "user")
}
type EncryptionArtifacts @entity {
"ID / lookupKey"
id: ID!
"The account the encryption artifacts are associated with"
account: Account! @unique
"The IV used to encrypt the wallet seed with user credentials"
cipherIv: String!
"Wallet seed encrypted with user credentials"
encryptedSeed: String!
}
type SessionEncryptionArtifacts @entity {
"Unique identifier"
id: ID!
"The session the encryption artifacts are associated with"
session: Session! @unique
"The IV used to encrypt the seed with cipherKey"
cipherIv: String!
"cipherKey used to encrypt the seed stored client-side for the duration of the session"
cipherKey: String!
}
type Session @entity @schema(name: "admin") {
"Unique identifier (32-byte string, securely random)"
id: ID!
"Browser (as deterimned based on user-agent header)"
browser: String!
"Operating system (as deterimned based on user-agent header)"
os: String!
"Device (as deterimned based on user-agent header)"
device: String!
"Device type (as deterimned based on user-agent header)"
deviceType: String
"User associated with the session"
user: User!
"Account associated with the session (if any)"
account: Account
"IP address associated with the session"
ip: String! @index
"Time when the session started"
startedAt: DateTime!
"Time when the session expires or did expire"
expiry: DateTime!
}
"A Gateway Account"
type Account @entity @schema(name: "admin") {
"Unique identifier (can be sequential)"
id: ID!
"The user associated with the gateway account (the Gateway Account Owner)"
user: User! @unique
"Gateway account's e-mail address"
email: String! @unique
"""
Indicates whether the gateway account's e-mail has been confirmed or not.
"""
isEmailConfirmed: Boolean!
"Indicates whether the access to the gateway account is blocked"
isBlocked: Boolean!
"Time when the gateway account was registered"
registeredAt: DateTime!
"On-chain membership associated with the gateway account"
membership: Membership! @unique
"Blockchain (joystream) account associated with the gateway account"
joystreamAccount: String! @unique
"runtime notifications"
notifications: [Notification!]! @derivedFrom(field: "account")
"notification preferences for the account"
notificationPreferences: AccountNotificationPreferences!
"ID of the channel which referred the user to the platform"
referrerChannelId: String
}
type AccountNotificationPreferences {
# channel notifications: https://www.figma.com/file/zi5siPUXme0Fivq2i40XBd/My-channel?type=design&node-id=1721-82420&mode=design:
channelExcludedFromApp: NotificationPreference!
videoExcludedFromApp: NotificationPreference!
nftFeaturedOnMarketPlace: NotificationPreference!
newChannelFollower: NotificationPreference!
videoCommentCreated: NotificationPreference!
videoLiked: NotificationPreference!
videoDisliked: NotificationPreference!
yppChannelVerified: NotificationPreference!
yppSignupSuccessful: NotificationPreference! #v2
yppChannelSuspended: NotificationPreference!
nftBought: NotificationPreference!
creatorTimedAuctionExpired: NotificationPreference! #v2
bidMadeOnNft: NotificationPreference!
royaltyReceived: NotificationPreference!
channelPaymentReceived: NotificationPreference!
channelReceivedFundsFromWg: NotificationPreference!
newPayoutUpdatedByCouncil: NotificationPreference! #v2
channelFundsWithdrawn: NotificationPreference!
# member notifications: https://www.figma.com/file/yhZpTHdf1sxJx13uRZ71GV/Membership-profile?type=design&node-id=2977-58785&mode=design
channelCreated: NotificationPreference!
replyToComment: NotificationPreference!
reactionToComment: NotificationPreference!
videoPosted: NotificationPreference!
newNftOnAuction: NotificationPreference!
newNftOnSale: NotificationPreference!
timedAuctionExpired: NotificationPreference! #v2
higherBidThanYoursMade: NotificationPreference!
auctionWon: NotificationPreference!
auctionLost: NotificationPreference!
openAuctionBidCanBeWithdrawn: NotificationPreference! #v2
fundsFromCouncilReceived: NotificationPreference! #v2
fundsToExternalWalletSent: NotificationPreference! #v2
fundsFromWgReceived: NotificationPreference! # v2
crtIssued: NotificationPreference!
crtMarketStarted: NotificationPreference!
crtMarketMint: NotificationPreference!
crtMarketBurn: NotificationPreference!
crtSaleStarted: NotificationPreference!
crtSaleMint: NotificationPreference!
crtRevenueShareStarted: NotificationPreference!
crtRevenueSharePlanned: NotificationPreference!
crtRevenueShareEnded: NotificationPreference!
}
type NotificationPreference {
"Notification is enabled in the app"
inAppEnabled: Boolean!
"Allows to send email for the notification"
emailEnabled: Boolean!
}
enum TokenType {
EMAIL_CONFIRMATION
}
type Token @entity @schema(name: "admin") {
"The token itself (32-byte string, securely random)"
id: ID!
"Type of the token (its intended purpose)"
type: TokenType!
"When was the token issued"
issuedAt: DateTime!
"When does the token expire or when has it expired"
expiry: DateTime!
"The account the token was issued for"
issuedFor: Account!
}