-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathapi-gql.gql
717 lines (578 loc) · 17.2 KB
/
api-gql.gql
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
# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type BasicPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
type ChangeRecoveryCodesPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
recoveryCodes: [String!]!
}
type CreateTotpPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
qrCodeUrl: String!
secret: String!
recoveryCodes: [String!]!
}
type PasswordForgotSendCodePayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
passwordForgotToken: String!
}
type PasswordForgotVerifyCodePayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
accountResetToken: String!
}
type PasswordForgotCodeStatusPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
tries: Float!
ttl: Float!
}
type AccountResetPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String
sessionToken: String
verified: Boolean
authAt: Float
keyFetchToken: String
unwrapBKey: String
}
type SessionReauthedAccountPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
verified: Boolean!
authAt: Float!
metricsEnabled: Boolean!
keyFetchToken: String
verificationMethod: String
verificationReason: String
}
type SignedInAccountPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
verified: Boolean!
authAt: Float!
metricsEnabled: Boolean!
keyFetchToken: String
verificationMethod: String
verificationReason: String
sessionToken: String!
}
type Avatar {
"""url for the user's avatar."""
url: String
"""ID for the user's avatar."""
id: String
}
type UpdateDisplayNamePayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Updated display name. Null if an error occurred."""
displayName: String
}
type VerifyTotpPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
success: Boolean!
recoveryCodes: [String!]
}
type AccountStatusPayload {
"""Whether or not the account exists"""
exists: Boolean!
}
type RecoveryKeyBundlePayload {
recoveryData: String!
}
type PasswordChangePayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
sessionToken: String!
verified: Boolean!
authAt: Float!
unwrapBKey: String
keyFetchToken: String
}
type LegalDoc {
"""Document in markdown format"""
markdown: String!
}
type SignedUpAccountPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
sessionToken: String!
keyFetchToken: String
authAt: Float!
verificationMethod: String
}
type Location {
city: String
country: String
state: String
stateCode: String
}
type AttachedClient {
clientId: String
sessionTokenId: String
refreshTokenId: String
deviceId: String
deviceType: String
isCurrentSession: Boolean!
name: String
createdTime: Float
createdTimeFormatted: String
lastAccessTime: Float
lastAccessTimeFormatted: String
approximateLastAccessTime: Float
approximateLastAccessTimeFormatted: String
scope: [String!]
location: Location
userAgent: String!
os: String
}
type Email {
email: String!
isPrimary: Boolean!
verified: Boolean!
}
type Subscription {
created: Float
currentPeriodEnd: Float!
currentPeriodStart: Float!
cancelAtPeriodEnd: Boolean!
endAt: Float!
latestInvoice: String!
planId: String!
productName: String!
productId: String!
status: String!
subscriptionId: String!
}
"""Two-factor authentication configuration (TOTP)."""
type Totp {
"""Whether a TOTP token exists for the user."""
exists: Boolean!
"""Whether the current session was verified with the TOTP token."""
verified: Boolean!
}
type LinkedAccount {
providerId: Float!
enabled: Boolean!
authAt: Float!
}
type SecurityEvent {
name: String!
createdAt: Float!
verified: Boolean
}
"""The current authenticated user's Firefox Account record."""
type Account {
"""Firefox Account User ID."""
uid: ID!
"""Timestamp when the account was created."""
accountCreated: Float!
"""Timestamp the password was created or last changed."""
passwordCreated: Float!
"""Display name the user has set."""
displayName: String
avatar: Avatar!
"""User locale."""
locale: String
"""Active subscriptions for the user."""
subscriptions: [Subscription!]!
totp: Totp!
"""Whether the user has had an account recovery key issued."""
recoveryKey: Boolean!
"""Whether metrics are enabled and may be reported"""
metricsEnabled: Boolean!
"""Email addresses for the user."""
emails: [Email!]!
"""Client sessions attached to the user."""
attachedClients: [AttachedClient!]!
"""Linked accounts"""
linkedAccounts: [LinkedAccount!]!
"""Security events"""
securityEvents: [SecurityEvent!]!
}
type FinishedSetupAccountPayload {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
sessionToken: String!
verified: Boolean!
}
"""Session (token) info"""
type Session {
"""Whether the current session is verified"""
verified: Boolean!
}
"""Session status"""
type SessionStatus {
"""uid of the account"""
uid: String!
"""Whether the current session is verified"""
state: String!
}
type Query {
account: Account
"""
Check the status of an account using session token or uid. This query is equivalent to the GET /account/status endpoint in auth-server.
"""
accountStatus(input: AccountStatusInput!): AccountStatusPayload!
"""
Retrieves a user recovery key bundle from its recovery key id. The bundle contains an encrypted copy for the sync key.
"""
getRecoveryKeyBundle(input: RecoveryKeyBundleInput!): RecoveryKeyBundlePayload!
session: Session!
sessionStatus: SessionStatus!
getLegalDoc(input: LegalInput!): LegalDoc!
}
input AccountStatusInput {
"""The uid to apply this operation to."""
uid: String
"""The token id to apply this operation to."""
token: String
}
input RecoveryKeyBundleInput {
"""Account reset token"""
accountResetToken: String!
"""Recovery key to check"""
recoveryKeyId: String!
}
input LegalInput {
"""The requested l10n locale."""
locale: String
"""The requested legal file."""
file: String!
}
type Mutation {
"""Creates a new password for a user and overrides encryption keys"""
createPassword(input: CreatePassword!): BasicPayload!
"""
Create a new randomly generated TOTP token for a user if they do not currently have one.
"""
createTotp(input: CreateTotpInput!): CreateTotpPayload!
"""Verifies the current session if the passed TOTP code is valid."""
verifyTotp(input: VerifyTotpInput!): VerifyTotpPayload!
"""Deletes the current TOTP token for the user."""
deleteTotp(input: DeleteTotpInput!): BasicPayload!
"""Deletes the current recovery key for the user."""
deleteRecoveryKey(input: DeleteRecoveryKeyInput!): BasicPayload!
"""Return new backup authentication codes while removing old ones."""
changeRecoveryCodes(input: ChangeRecoveryCodesInput!): ChangeRecoveryCodesPayload!
"""Update the display name."""
updateDisplayName(input: UpdateDisplayNameInput!): UpdateDisplayNamePayload!
"""Delete the avatar."""
deleteAvatar(input: DeleteAvatarInput!): BasicPayload!
"""Create a secondary email for the signed in account."""
createSecondaryEmail(input: EmailInput!): BasicPayload!
"""Reset the verification code to a secondary email."""
resendSecondaryEmailCode(input: EmailInput!): BasicPayload!
"""Verify the email address with a code."""
verifySecondaryEmail(input: VerifyEmailInput!): BasicPayload!
"""Remove the secondary email for the signed in account."""
deleteSecondaryEmail(input: EmailInput!): BasicPayload!
"""
Change users primary email address, this email address must belong to the user and be verified.
"""
updatePrimaryEmail(input: EmailInput!): BasicPayload!
"""
Destroy all tokens held by a connected client, disconnecting it from the user's account.
"""
attachedClientDisconnect(input: AttachedClientDisconnectInput!): BasicPayload!
"""Send a session verification email."""
sendSessionVerificationCode(input: SendSessionVerificationInput!): BasicPayload!
"""Verify the session via an email code."""
verifySession(input: VerifySessionInput!): BasicPayload!
"""Set the metrics opt in or out state"""
metricsOpt(input: MetricsOptInput!): BasicPayload!
"""Send a password reset email."""
passwordForgotSendCode(input: PasswordForgotSendCodeInput!): PasswordForgotSendCodePayload!
"""Verify password forgot token, returns account reset token"""
passwordForgotVerifyCode(input: PasswordForgotVerifyCodeInput!): PasswordForgotVerifyCodePayload!
"""Verify password forgot token, returns account reset token"""
passwordForgotCodeStatus(input: PasswordForgotCodeStatusInput!): PasswordForgotCodeStatusPayload!
"""Resets an account"""
accountReset(input: AccountResetInput!): AccountResetPayload!
"""Call auth-server to sign up an account"""
SignUp(input: SignUpInput!): SignedUpAccountPayload!
"""Call auth-server to finish signing up a "stub" account"""
finishSetup(input: FinishSetupInput!): FinishedSetupAccountPayload!
"""Call auth-server to sign in an account"""
signIn(input: SignInInput!): SignedInAccountPayload!
"""
Used to reject and report unblock codes that were not requested by the user.
"""
rejectUnblockCode(input: RejectUnblockCodeInput!): BasicPayload!
"""Used to verify a users primary email address."""
emailVerifyCode(input: VerifyEmailCodeInput!): BasicPayload!
"""
Change a user's password. The client is required to compute authPW since we don't send the clear password to our server.
"""
passwordChange(input: PasswordChangeInput!): PasswordChangePayload!
"""Logs out the current session"""
destroySession(input: DestroySessionInput!): BasicPayload!
"""Re-authenticate an existing session token."""
reauthSession(input: SessionReauthInput!): SessionReauthedAccountPayload!
"""Resend a verify code."""
resendVerifyCode(input: BasicMutationInput!): BasicPayload!
"""Verify a OTP code."""
verifyCode(input: SessionVerifyCodeInput!): BasicPayload!
}
input CreatePassword {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Users email, used to hash password"""
email: String!
"""The new password"""
password: String!
}
input CreateTotpInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
metricsContext: MetricsContext
}
"""Metrics context."""
input MetricsContext {
"""The id of the client's device record, if it has registered one."""
deviceId: String
entrypoint: String
entrypointExperiment: String
entrypointVariation: String
flowId: String
flowBeginTime: Float
productId: String
planId: String
utmCampaign: String
utmContent: String
utmMedium: String
utmSource: String
utmTerm: String
}
input VerifyTotpInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The TOTP code to check"""
code: String!
service: String
}
input DeleteTotpInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input DeleteRecoveryKeyInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input ChangeRecoveryCodesInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input UpdateDisplayNameInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Updated display name."""
displayName: String
}
input DeleteAvatarInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The avatar id to delete."""
id: String!
}
input EmailInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The email address to apply this operation to."""
email: String!
}
input VerifyEmailInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The email to verify"""
email: String!
"""The code to check"""
code: String!
}
input AttachedClientDisconnectInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The OAuth client_id of the connected application."""
clientId: String
"""The id of the sessionToken held by that client, if any."""
sessionTokenId: String
"""The id of the OAuth refreshToken held by that client, if any."""
refreshTokenId: String
"""The id of the client's device record, if it has registered one."""
deviceId: String
}
input SendSessionVerificationInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input VerifySessionInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The code to check"""
code: String!
}
input MetricsOptInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""
The desired state: "in" or "out"
"""
state: String!
}
input PasswordForgotSendCodeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Users email"""
email: String!
metricsContext: MetricsContext
resume: String
service: String
lang: String
redirectTo: String
}
input PasswordForgotVerifyCodeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Password forgot token"""
token: String!
"""Code"""
code: String!
}
input PasswordForgotCodeStatusInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""Password forgot token"""
token: String!
}
input AccountResetInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
accountResetToken: String!
email: String!
newPassword: String!
options: AccountResetInputOptions
}
input AccountResetInputOptions {
keys: Boolean
sessionToken: Boolean
}
input SignUpInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
authPW: String!
email: String!
options: SignUpOptionsInput!
}
input SignUpOptionsInput {
keys: Boolean
service: String
redirectTo: String
resume: String
verificationMethod: String
preVerified: String
metricsContext: MetricsContext
}
input FinishSetupInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
token: String!
authPW: String!
}
input SignInInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
authPW: String!
email: String!
options: SignInOptionsInput!
}
input SignInOptionsInput {
keys: Boolean
service: String
reason: String
redirectTo: String
resume: String
verificationMethod: String
unblockCode: String
metricsContext: MetricsContext
}
input RejectUnblockCodeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
uid: String!
unblockCode: String!
}
input VerifyEmailCodeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The code to check"""
code: String!
"""Account uid"""
uid: String!
service: String
}
input PasswordChangeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
email: String!
oldPasswordAuthPW: String!
newPasswordAuthPW: String!
oldUnwrapBKey: String!
newUnwrapBKey: String!
options: PasswordChangeInputOptions
}
input PasswordChangeInputOptions {
keys: Boolean
sessionToken: String
}
input DestroySessionInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input SessionReauthInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
authPW: String!
email: String!
options: SessionReauthOptionsInput!
sessionToken: String!
}
input SessionReauthOptionsInput {
keys: Boolean
service: String
reason: String
redirectTo: String
resume: String
verificationMethod: String
unblockCode: String
metricsContext: MetricsContext
}
input BasicMutationInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
}
input SessionVerifyCodeInput {
"""A unique identifier for the client performing the mutation."""
clientMutationId: String
"""The code to check"""
code: String!
options: SessionVerifyCodeOptionsInput!
}
input SessionVerifyCodeOptionsInput {
service: String
scopes: [String!]
newsletters: [String!]
}