-
Notifications
You must be signed in to change notification settings - Fork 12
/
schema.graphql
2091 lines (1988 loc) · 36.8 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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
The input for the `addEmail` mutation
"""
input AddEmailInput {
"""
The email address to add
"""
email: String!
"""
The ID of the user to add the email address to
"""
userId: ID!
"""
Skip the email address verification. Only allowed for admins.
"""
skipVerification: Boolean
"""
Skip the email address policy check. Only allowed for admins.
"""
skipPolicyCheck: Boolean
}
"""
The payload of the `addEmail` mutation
"""
type AddEmailPayload {
"""
Status of the operation
"""
status: AddEmailStatus!
"""
The email address that was added
"""
email: UserEmail
"""
The user to whom the email address was added
"""
user: User
"""
The list of policy violations if the email address was denied
"""
violations: [String!]
}
"""
The status of the `addEmail` mutation
"""
enum AddEmailStatus {
"""
The email address was added
"""
ADDED
"""
The email address already exists
"""
EXISTS
"""
The email address is invalid
"""
INVALID
"""
The email address is not allowed by the policy
"""
DENIED
}
"""
The input for the `addUser` mutation.
"""
input AddUserInput {
"""
The username of the user to add.
"""
username: String!
"""
Skip checking with the homeserver whether the username is valid.
Use this with caution! The main reason to use this, is when a user used
by an application service needs to exist in MAS to craft special
tokens (like with admin access) for them
"""
skipHomeserverCheck: Boolean
}
"""
The payload for the `addUser` mutation.
"""
type AddUserPayload {
"""
Status of the operation
"""
status: AddUserStatus!
"""
The user that was added.
"""
user: User
}
"""
The status of the `addUser` mutation.
"""
enum AddUserStatus {
"""
The user was added.
"""
ADDED
"""
The user already exists.
"""
EXISTS
"""
The username is reserved.
"""
RESERVED
"""
The username is invalid.
"""
INVALID
}
"""
The input for the `allowUserCrossSigningReset` mutation.
"""
input AllowUserCrossSigningResetInput {
"""
The ID of the user to update.
"""
userId: ID!
}
"""
The payload for the `allowUserCrossSigningReset` mutation.
"""
type AllowUserCrossSigningResetPayload {
"""
The user that was updated.
"""
user: User
}
type Anonymous implements Node {
id: ID!
}
"""
A session in an application, either a compatibility or an OAuth 2.0 one
"""
union AppSession = CompatSession | Oauth2Session
type AppSessionConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [AppSessionEdge!]!
"""
A list of nodes.
"""
nodes: [AppSession!]!
"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}
"""
An edge in a connection.
"""
type AppSessionEdge {
"""
The item at the end of the edge
"""
node: AppSession!
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
An authentication records when a user enter their credential in a browser
session.
"""
type Authentication implements Node & CreationEvent {
"""
ID of the object.
"""
id: ID!
"""
When the object was created.
"""
createdAt: DateTime!
}
"""
A browser session represents a logged in user in a browser.
"""
type BrowserSession implements Node & CreationEvent {
"""
ID of the object.
"""
id: ID!
"""
The user logged in this session.
"""
user: User!
"""
The most recent authentication of this session.
"""
lastAuthentication: Authentication
"""
When the object was created.
"""
createdAt: DateTime!
"""
When the session was finished.
"""
finishedAt: DateTime
"""
The state of the session.
"""
state: SessionState!
"""
The user-agent with which the session was created.
"""
userAgent: UserAgent
"""
The last IP address used by the session.
"""
lastActiveIp: String
"""
The last time the session was active.
"""
lastActiveAt: DateTime
"""
Get the list of both compat and OAuth 2.0 sessions started by this
browser session, chronologically sorted
"""
appSessions(
"""
List only sessions in the given state.
"""
state: SessionState
"""
List only sessions for the given device.
"""
device: String
"""
Returns the elements in the list that come after the cursor.
"""
after: String
"""
Returns the elements in the list that come before the cursor.
"""
before: String
"""
Returns the first *n* elements from the list.
"""
first: Int
"""
Returns the last *n* elements from the list.
"""
last: Int
): AppSessionConnection!
}
type BrowserSessionConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [BrowserSessionEdge!]!
"""
A list of nodes.
"""
nodes: [BrowserSession!]!
"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}
"""
An edge in a connection.
"""
type BrowserSessionEdge {
"""
The item at the end of the edge
"""
node: BrowserSession!
"""
A cursor for use in pagination
"""
cursor: String!
}
type CaptchaConfig {
"""
Which Captcha service is being used
"""
service: CaptchaService!
"""
The site key used by the instance
"""
siteKey: String!
id: ID!
}
"""
Which Captcha service is being used
"""
enum CaptchaService {
RECAPTCHA_V2
CLOUDFLARE_TURNSTILE
H_CAPTCHA
}
"""
A compat session represents a client session which used the legacy Matrix
login API.
"""
type CompatSession implements Node & CreationEvent {
"""
ID of the object.
"""
id: ID!
"""
The user authorized for this session.
"""
user: User!
"""
The Matrix Device ID of this session.
"""
deviceId: String!
"""
When the object was created.
"""
createdAt: DateTime!
"""
When the session ended.
"""
finishedAt: DateTime
"""
The user-agent with which the session was created.
"""
userAgent: UserAgent
"""
The associated SSO login, if any.
"""
ssoLogin: CompatSsoLogin
"""
The browser session which started this session, if any.
"""
browserSession: BrowserSession
"""
The state of the session.
"""
state: SessionState!
"""
The last IP address used by the session.
"""
lastActiveIp: String
"""
The last time the session was active.
"""
lastActiveAt: DateTime
}
type CompatSessionConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [CompatSessionEdge!]!
"""
A list of nodes.
"""
nodes: [CompatSession!]!
"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}
"""
An edge in a connection.
"""
type CompatSessionEdge {
"""
The item at the end of the edge
"""
node: CompatSession!
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
The type of a compatibility session.
"""
enum CompatSessionType {
"""
The session was created by a SSO login.
"""
SSO_LOGIN
"""
The session was created by an unknown method.
"""
UNKNOWN
}
"""
A compat SSO login represents a login done through the legacy Matrix login
API, via the `m.login.sso` login method.
"""
type CompatSsoLogin implements Node {
"""
ID of the object.
"""
id: ID!
"""
When the object was created.
"""
createdAt: DateTime!
"""
The redirect URI used during the login.
"""
redirectUri: Url!
"""
When the login was fulfilled, and the user was redirected back to the
client.
"""
fulfilledAt: DateTime
"""
When the client exchanged the login token sent during the redirection.
"""
exchangedAt: DateTime
"""
The compat session which was started by this login.
"""
session: CompatSession
}
type CompatSsoLoginConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [CompatSsoLoginEdge!]!
"""
A list of nodes.
"""
nodes: [CompatSsoLogin!]!
"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}
"""
An edge in a connection.
"""
type CompatSsoLoginEdge {
"""
The item at the end of the edge
"""
node: CompatSsoLogin!
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
The input of the `createOauth2Session` mutation.
"""
input CreateOAuth2SessionInput {
"""
The scope of the session
"""
scope: String!
"""
The ID of the user for which to create the session
"""
userId: ID!
"""
Whether the session should issue a never-expiring access token
"""
permanent: Boolean
}
"""
The payload of the `createOauth2Session` mutation.
"""
type CreateOAuth2SessionPayload {
"""
Access token for this session
"""
accessToken: String!
"""
Refresh token for this session, if it is not a permanent session
"""
refreshToken: String
"""
The OAuth 2.0 session which was just created
"""
oauth2Session: Oauth2Session!
}
"""
An object with a creation date.
"""
interface CreationEvent {
"""
When the object was created.
"""
createdAt: DateTime!
}
"""
A filter for dates, with a lower bound and an upper bound
"""
input DateFilter {
"""
The lower bound of the date range
"""
after: DateTime
"""
The upper bound of the date range
"""
before: DateTime
}
"""
Implement the DateTime<Utc> scalar
The input/output is a string in RFC3339 format.
"""
scalar DateTime
"""
The type of a user agent
"""
enum DeviceType {
"""
A personal computer, laptop or desktop
"""
PC
"""
A mobile phone. Can also sometimes be a tablet.
"""
MOBILE
"""
A tablet
"""
TABLET
"""
Unknown device type
"""
UNKNOWN
}
"""
The input of the `endBrowserSession` mutation.
"""
input EndBrowserSessionInput {
"""
The ID of the session to end.
"""
browserSessionId: ID!
}
type EndBrowserSessionPayload {
"""
The status of the mutation.
"""
status: EndBrowserSessionStatus!
"""
Returns the ended session.
"""
browserSession: BrowserSession
}
"""
The status of the `endBrowserSession` mutation.
"""
enum EndBrowserSessionStatus {
"""
The session was ended.
"""
ENDED
"""
The session was not found.
"""
NOT_FOUND
}
"""
The input of the `endCompatSession` mutation.
"""
input EndCompatSessionInput {
"""
The ID of the session to end.
"""
compatSessionId: ID!
}
type EndCompatSessionPayload {
"""
The status of the mutation.
"""
status: EndCompatSessionStatus!
"""
Returns the ended session.
"""
compatSession: CompatSession
}
"""
The status of the `endCompatSession` mutation.
"""
enum EndCompatSessionStatus {
"""
The session was ended.
"""
ENDED
"""
The session was not found.
"""
NOT_FOUND
}
"""
The input of the `endOauth2Session` mutation.
"""
input EndOAuth2SessionInput {
"""
The ID of the session to end.
"""
oauth2SessionId: ID!
}
type EndOAuth2SessionPayload {
"""
The status of the mutation.
"""
status: EndOAuth2SessionStatus!
"""
Returns the ended session.
"""
oauth2Session: Oauth2Session
}
"""
The status of the `endOauth2Session` mutation.
"""
enum EndOAuth2SessionStatus {
"""
The session was ended.
"""
ENDED
"""
The session was not found.
"""
NOT_FOUND
}
"""
The input for the `lockUser` mutation.
"""
input LockUserInput {
"""
The ID of the user to lock.
"""
userId: ID!
"""
Permanently lock the user.
"""
deactivate: Boolean
}
"""
The payload for the `lockUser` mutation.
"""
type LockUserPayload {
"""
Status of the operation
"""
status: LockUserStatus!
"""
The user that was locked.
"""
user: User
}
"""
The status of the `lockUser` mutation.
"""
enum LockUserStatus {
"""
The user was locked.
"""
LOCKED
"""
The user was not found.
"""
NOT_FOUND
}
type MatrixUser {
"""
The Matrix ID of the user.
"""
mxid: String!
"""
The display name of the user, if any.
"""
displayName: String
"""
The avatar URL of the user, if any.
"""
avatarUrl: String
"""
Whether the user is deactivated on the homeserver.
"""
deactivated: Boolean!
}
"""
The mutations root of the GraphQL interface.
"""
type Mutation {
"""
Add an email address to the specified user
"""
addEmail(input: AddEmailInput!): AddEmailPayload!
"""
Send a verification code for an email address
"""
sendVerificationEmail(
input: SendVerificationEmailInput!
): SendVerificationEmailPayload!
"""
Submit a verification code for an email address
"""
verifyEmail(input: VerifyEmailInput!): VerifyEmailPayload!
"""
Remove an email address
"""
removeEmail(input: RemoveEmailInput!): RemoveEmailPayload!
"""
Set an email address as primary
"""
setPrimaryEmail(input: SetPrimaryEmailInput!): SetPrimaryEmailPayload!
"""
Add a user. This is only available to administrators.
"""
addUser(input: AddUserInput!): AddUserPayload!
"""
Lock a user. This is only available to administrators.
"""
lockUser(input: LockUserInput!): LockUserPayload!
"""
Unlock a user. This is only available to administrators.
"""
unlockUser(input: UnlockUserInput!): UnlockUserPayload!
"""
Set whether a user can request admin. This is only available to
administrators.
"""
setCanRequestAdmin(
input: SetCanRequestAdminInput!
): SetCanRequestAdminPayload!
"""
Temporarily allow user to reset their cross-signing keys.
"""
allowUserCrossSigningReset(
input: AllowUserCrossSigningResetInput!
): AllowUserCrossSigningResetPayload!
"""
Set the password for a user.
This can be used by server administrators to set any user's password,
or, provided the capability hasn't been disabled on this server,
by a user to change their own password as long as they know their
current password.
"""
setPassword(input: SetPasswordInput!): SetPasswordPayload!
"""
Set the password for yourself, using a recovery ticket sent by e-mail.
"""
setPasswordByRecovery(input: SetPasswordByRecoveryInput!): SetPasswordPayload!
"""
Create a new arbitrary OAuth 2.0 Session.
Only available for administrators.
"""
createOauth2Session(
input: CreateOAuth2SessionInput!
): CreateOAuth2SessionPayload!
endOauth2Session(input: EndOAuth2SessionInput!): EndOAuth2SessionPayload!
endCompatSession(input: EndCompatSessionInput!): EndCompatSessionPayload!
endBrowserSession(input: EndBrowserSessionInput!): EndBrowserSessionPayload!
"""
Set the display name of a user
"""
setDisplayName(input: SetDisplayNameInput!): SetDisplayNamePayload!
}
"""
An object with an ID.
"""
interface Node {
"""
ID of the object.
"""
id: ID!
}
"""
The application type advertised by the client.
"""
enum Oauth2ApplicationType {
"""
Client is a web application.
"""
WEB
"""
Client is a native application.
"""
NATIVE
}
"""
An OAuth 2.0 client
"""
type Oauth2Client implements Node {
"""
ID of the object.
"""
id: ID!
"""
OAuth 2.0 client ID
"""
clientId: String!
"""
Client name advertised by the client.
"""
clientName: String
"""
Client URI advertised by the client.
"""
clientUri: Url
"""
Logo URI advertised by the client.
"""
logoUri: Url
"""
Terms of services URI advertised by the client.
"""
tosUri: Url
"""
Privacy policy URI advertised by the client.
"""
policyUri: Url
"""
List of redirect URIs used for authorization grants by the client.
"""
redirectUris: [Url!]!
"""
The application type advertised by the client.
"""
applicationType: Oauth2ApplicationType
}
"""
An OAuth 2.0 session represents a client session which used the OAuth APIs
to login.
"""
type Oauth2Session implements Node & CreationEvent {
"""
ID of the object.
"""
id: ID!
"""
OAuth 2.0 client used by this session.
"""
client: Oauth2Client!
"""
Scope granted for this session.
"""
scope: String!
"""
When the object was created.
"""
createdAt: DateTime!
"""
When the session ended.
"""
finishedAt: DateTime
"""
The user-agent with which the session was created.
"""
userAgent: UserAgent
"""
The state of the session.
"""
state: SessionState!
"""
The browser session which started this OAuth 2.0 session.
"""
browserSession: BrowserSession
"""
User authorized for this session.
"""
user: User
"""
The last IP address used by the session.
"""
lastActiveIp: String
"""
The last time the session was active.
"""
lastActiveAt: DateTime
}
type Oauth2SessionConnection {
"""
Information to aid in pagination.
"""
pageInfo: PageInfo!
"""
A list of edges.
"""
edges: [Oauth2SessionEdge!]!
"""
A list of nodes.
"""
nodes: [Oauth2Session!]!
"""
Identifies the total count of items in the connection.
"""
totalCount: Int!
}
"""
An edge in a connection.
"""
type Oauth2SessionEdge {
"""
The item at the end of the edge
"""
node: Oauth2Session!
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
Information about pagination in a connection
"""
type PageInfo {
"""
When paginating backwards, are there more items?
"""
hasPreviousPage: Boolean!
"""
When paginating forwards, are there more items?
"""
hasNextPage: Boolean!
"""
When paginating backwards, the cursor to continue.
"""
startCursor: String
"""
When paginating forwards, the cursor to continue.
"""
endCursor: String
}
"""
The query root of the GraphQL interface.
"""
type Query {
"""
Get the current logged in browser session