-
Notifications
You must be signed in to change notification settings - Fork 13
/
schema.graphql
395 lines (351 loc) · 9.67 KB
/
schema.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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# This file was generated. Do not edit manually.
schema {
query: Query
mutation: Mutation
}
interface InstanceObjectUsageStats {
total: Int!
years: [InstanceObjectUsageYearlyStats]
}
type Article {
_id: ID!
addContributor(userId: ID!): Article
addTags(tags: [ID]!): [Tag]
collaborativeSession: CollaborativeSession
contributors: [ArticleContributor]!
createVersion(articleVersionInput: ArticleVersionInput!): Article
createdAt: DateTime
delete(dryRun: Boolean): Boolean
owner: User
preview: ArticlePreviewSettings
removeContributor(userId: ID!): Article
removeTags(tags: [ID]!): [Tag]
rename(title: String!): Boolean
setPreviewSettings(settings: ArticlePreviewInput!): Article
setZoteroLink(zotero: String!): Boolean
soloSession: SoloSession
startCollaborativeSession: CollaborativeSession!
startSoloSession: SoloSession!
stopCollaborativeSession: Article
stopSoloSession: Article
tags(limit: Int, page: Int): [Tag!]!
takeOverSoloSession: SoloSession!
title: String
updateWorkingVersion(content: WorkingVersionInput!): Article
updatedAt: DateTime
versions(limit: Int, page: Int): [Version!]
workingVersion: WorkingVersion
workspaces: [Workspace!]
zoteroLink: String
}
type ArticleContributor {
roles: [String]
user: User!
}
type ArticlePreviewSettings {
stylesheet: String!
template: String
}
type CollaborativeSession {
createdAt: DateTime
creator: User
id: ID
}
type Corpus {
_id: String!
addArticle(articleId: ID!): Corpus
article(articleId: ID!): CorpusArticle
articles: [CorpusArticle!]!
createdAt: DateTime
creator: User!
delete: Corpus!
description: String
metadata: String
name: String!
rename(name: String!): Corpus
update(updateCorpusInput: UpdateCorpusInput!): Corpus!
updateArticlesOrder(articlesOrderInput: [ArticleOrder!]!): Corpus
updateMetadata(metadata: String!): Corpus
updatedAt: DateTime
workspace: String
}
type CorpusArticle {
article: Article
corpus: Corpus!
move(order: Int): Corpus
order: Int
remove: Corpus!
}
type InstanceArticleStats implements InstanceObjectUsageStats {
total: Int!
years: [InstanceObjectUsageYearlyStats]
}
type InstanceObjectUsageYearlyStats {
count: Int
year: Int
}
type InstanceUsageStats {
articles: InstanceArticleStats
users: InstanceUserStats
version: String
}
type InstanceUserStats implements InstanceObjectUsageStats {
local: Int
openid: Int
total: Int!
years: [InstanceObjectUsageYearlyStats]
}
type Mutation {
"Add an email to your acquintances [need to be authentificated as user]"
addAcquintance(email: EmailAddress!, user: ID): User
"Give access to a user using a password's email"
addCredential(email: EmailAddress!, user: ID): User
"""
Get an article for a given id.
Returns an error if the corpus does not exist or cannot be accessed.
"""
article(articleId: ID!): Article
"Change password"
changePassword(new: String!, old: String!, user: ID): User
"""
Get a corpus for a given id.
Returns an error if the corpus does not exist or cannot be accessed.
"""
corpus(corpusId: ID!): Corpus
"Create article for specified user [need to be authenticated as specified user]"
createArticle(tags: [ID], title: String!, user: ID): Article
"Create a new corpus"
createCorpus(createCorpusInput: CreateCorpusInput!): Corpus
"Create tag [need to be authenticated as specified user]"
createTag(color: HexColorCode!, description: String, name: String!, user: ID): Tag
"Create user + password + default article"
createUser(details: NewUserInput!): User!
"Create a new workspace"
createWorkspace(createWorkspaceInput: CreateWorkspaceInput!): Workspace
"Delete tag, and remove it from all related articles"
deleteTag(tag: ID!, user: ID): Boolean
"Duplicate the working version of an article, with someone, or yourself"
duplicateArticle(article: ID!, to: ID!, user: ID): Article
"Remove access to a user using a password's email (can't be the main email)"
removeCredential(email: EmailAddress!, user: ID): User
"add a user to an article"
shareArticle(article: ID!, to: ID!, user: ID): Article
"remove a user to an article"
unshareArticle(article: ID!, to: ID!, user: ID): Article
"update name and description of a tag [need to be authenticated as specified user]"
updateTag(color: HexColorCode, description: String, name: String, tag: ID!, user: ID): Tag
"Change user information"
updateUser(details: UserProfileInput!, user: ID): User
"Get a workspace for mutation"
workspace(workspaceId: ID!): Workspace
}
type Query {
"Fetch article info [need to have access to this article]"
article(article: ID!, user: ID): Article
"Fetch a given user articles"
articles(user: ID): [Article]
"Get a list of corpus with an optional filter"
corpus(filter: FilterCorpusInput): [Corpus!]
getUser(filter: UserFilter): User
"Fetch instance stats"
stats: InstanceUsageStats
"Fetch tagged articles for a given user"
tag(tag: ID!, user: ID): Tag
"Fetch tagged articles for a given user"
tags(user: ID): [Tag]
"Get authenticated user info."
user(user: ID): User
"Fetch all users [Reserved for admins]"
users: [User]
"Fetch version info"
version(version: ID!): Version
"Get a given workspace"
workspace(workspaceId: ID!): Workspace
"Get a list of workspaces for the authenticated user"
workspaces: [Workspace!]
}
type SoloSession {
createdAt: DateTime
creator: User
creatorUsername: String
id: ID
}
type Tag {
_id: ID!
articles: [Article]
color: HexColorCode
createdAt: DateTime
description: String
name: String!
owner: ID
updatedAt: DateTime
}
type User {
_id: ID
acquintances(limit: Int, page: Int): [User]
addContact(userId: ID!): User
admin: Boolean
apiToken: JWT
articles(limit: Int, page: Int): [Article]
authType: String
createdAt: DateTime
displayName: String
email: EmailAddress
firstName: String
institution: String
lastName: String
permissions: [UserPermission]
removeContact(userId: ID!): User
stats: UserStats
tags(limit: Int, page: Int): [Tag]
updatedAt: DateTime
username: String
workspaces: [Workspace!]
yaml: String
zoteroToken: String
}
type UserPermission {
roles: [String]
scope: String!
user: User!
}
type UserSearch {
_id: ID
displayName: String
email: EmailAddress
firstName: String
lastName: String
}
type UserStats {
contributedArticlesCount: Int
myArticlesCount: Int
}
type Version {
_id: ID!
article: Article
bib: String
bibPreview: String
createdAt: DateTime
md: String
message: String
name: String
owner: User
rename(name: String): Boolean
revision: Int
sommaire: String
type: String
updatedAt: DateTime
version: Int
yaml(options: YamlFormattingInput): String
}
type WorkingVersion {
bib: String
bibPreview: String
md: String
yaml(options: YamlFormattingInput): String
}
type Workspace {
_id: String!
addArticle(articleId: ID!): Workspace
article(articleId: ID!): WorkspaceArticle
articles: [Article!]!
bibliographyStyle: String
color: HexColorCode!
corpus: [Corpus!]!
createdAt: DateTime
creator: User!
description: String
inviteMember(role: String, userId: ID!): Workspace
leave: Workspace
member(userId: ID!): WorkspaceMember
members: [User!]!
name: String!
stats: WorkspaceStats
updatedAt: DateTime
}
type WorkspaceArticle {
article: Article
remove: Workspace!
workspace: Workspace!
}
type WorkspaceMember {
remove: Workspace!
role: String
user: User
workspace: Workspace!
}
type WorkspaceStats {
articlesCount: Int
membersCount: Int
}
"A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar."
scalar DateTime
"A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/."
scalar EmailAddress
"A field whose value is a hex color code: https://en.wikipedia.org/wiki/Web_colors."
scalar HexColorCode
"A field whose value is a JSON Web Token (JWT): https://jwt.io/introduction."
scalar JWT
input ArticleOrder {
articleId: ID!
order: Int!
}
input ArticlePreviewInput {
stylesheet: String
template: String
}
input ArticleVersionInput {
major: Boolean
message: String
userId: ID!
}
input CreateCorpusInput {
description: String
metadata: String
name: String!
workspace: String
}
"Input to create a new workspace"
input CreateWorkspaceInput {
color: String!
description: String
name: String!
}
input FilterCorpusInput {
corpusId: ID
workspaceId: String
}
input NewUserInput {
displayName: String
email: EmailAddress!
firstName: String
institution: String
lastName: String
password: String!
passwordC: String!
username: String!
}
input UpdateCorpusInput {
description: String
metadata: String
name: String!
}
input UserFilter {
email: String!
}
input UserProfileInput {
displayName: String
firstName: String
institution: String
lastName: String
yaml: String
zoteroToken: String
}
input WorkingVersionInput {
bib: String
md: String
yaml: String
}
input YamlFormattingInput {
strip_markdown: Boolean
}