@synqauth/js 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2215 @@
1
+ import { A as SignInFlowStep, C as browserLocalStorage, D as PasskeyRequestOptionsJSON, E as PasskeyAssertionJSON, F as ChallengeMethod, I as ChallengeProblem, L as DeniedReason, M as StartSignInOptions, N as CHALLENGE_METHODS, O as SavedSignIn, P as CHALLENGE_PROBLEMS, R as RedirectReason, S as SynqStorage, T as memoryStorage, _ as SessionEvent, a as Problem, b as SynqClientOptions, c as SynqError, d as ERROR_CODES, f as SynqErrorCode, g as Session, h as ServerSignInOptions, i as OAuthErrorCode, j as SignInStepResult, k as SignInFlow, l as isSynqError, m as IdTokenClaims, n as operations$1, o as SynqAnyErrorCode, p as AuthorizationUrlOptions, r as paths$1, s as SynqClientErrorCode, t as components$1, u as problemError, v as SignOutOptions, w as browserSessionStorage, x as createSynqClient, y as SynqClient } from "./management-CWdCiiEv.js";
2
+ //#region src/generated/account.d.ts
3
+ interface paths {
4
+ readonly "/v1/api-keys": {
5
+ readonly parameters: {
6
+ readonly query?: never;
7
+ readonly header?: never;
8
+ readonly path?: never;
9
+ readonly cookie?: never;
10
+ };
11
+ /**
12
+ * The signed-in person's API keys
13
+ * @description Oldest first, revoked and expired ones too; never a key itself. Needs `me:read`.
14
+ */
15
+ readonly get: {
16
+ readonly parameters: {
17
+ readonly query?: never;
18
+ readonly header?: never;
19
+ readonly path?: never;
20
+ readonly cookie?: never;
21
+ };
22
+ readonly requestBody?: never;
23
+ readonly responses: {
24
+ /** @description Their API keys */
25
+ readonly 200: {
26
+ headers: {
27
+ readonly [name: string]: unknown;
28
+ };
29
+ content: {
30
+ readonly "application/json": {
31
+ readonly data: readonly components["schemas"]["UserApiKey"][];
32
+ };
33
+ };
34
+ };
35
+ /** @description No access token for this API, or one that is not valid */
36
+ readonly 401: {
37
+ headers: {
38
+ readonly [name: string]: unknown;
39
+ };
40
+ content: {
41
+ readonly "application/problem+json": components["schemas"]["Problem"];
42
+ };
43
+ };
44
+ /** @description The token lacks the scope this route needs */
45
+ readonly 403: {
46
+ headers: {
47
+ readonly [name: string]: unknown;
48
+ };
49
+ content: {
50
+ readonly "application/problem+json": components["schemas"]["Problem"];
51
+ };
52
+ };
53
+ /** @description Too many requests */
54
+ readonly 429: {
55
+ headers: {
56
+ readonly [name: string]: unknown;
57
+ };
58
+ content: {
59
+ readonly "application/problem+json": components["schemas"]["Problem"];
60
+ };
61
+ };
62
+ };
63
+ };
64
+ readonly put?: never;
65
+ /**
66
+ * Make an API key
67
+ * @description A key for one of the brand's APIs that lets its users make them (`GET /v1/apis`): `ak_live_…` in production, `ak_test_…` elsewhere, in this response only. It acts as the person, with the scopes given, until it is revoked or expires, or the API stops letting its users make keys. At most 25 live at once. Needs `me:write`, from a sign-in in the last 5 minutes whose time Synq proved (send the person to sign in with `max_age=300`; a provider that can't show when they signed in, such as Discord, never counts), else 403 `fresh_sign_in_required`. Send `max_age` only when you need a fresh sign-in: it asks someone signed in that way to sign in again. Recorded as `user.api_key_created`.
68
+ */
69
+ readonly post: {
70
+ readonly parameters: {
71
+ readonly query?: never;
72
+ readonly header?: never;
73
+ readonly path?: never;
74
+ readonly cookie?: never;
75
+ };
76
+ readonly requestBody: {
77
+ readonly content: {
78
+ readonly "application/json": components["schemas"]["UserApiKeyCreate"];
79
+ };
80
+ };
81
+ readonly responses: {
82
+ /** @description The new key */
83
+ readonly 201: {
84
+ headers: {
85
+ readonly [name: string]: unknown;
86
+ };
87
+ content: {
88
+ readonly "application/json": components["schemas"]["NewUserApiKey"];
89
+ };
90
+ };
91
+ /** @description A body that is not valid: an API none lists, a scope it doesn’t define, or an expiry not ahead */
92
+ readonly 400: {
93
+ headers: {
94
+ readonly [name: string]: unknown;
95
+ };
96
+ content: {
97
+ readonly "application/problem+json": components["schemas"]["Problem"];
98
+ };
99
+ };
100
+ /** @description No access token for this API, or one that is not valid */
101
+ readonly 401: {
102
+ headers: {
103
+ readonly [name: string]: unknown;
104
+ };
105
+ content: {
106
+ readonly "application/problem+json": components["schemas"]["Problem"];
107
+ };
108
+ };
109
+ /** @description The token lacks `me:write` (`insufficient_permissions`), the sign-in isn’t recent enough (`fresh_sign_in_required`), or the API doesn’t let its users make keys (`api_keys_not_allowed`) */
110
+ readonly 403: {
111
+ headers: {
112
+ readonly [name: string]: unknown;
113
+ };
114
+ content: {
115
+ readonly "application/problem+json": components["schemas"]["Problem"];
116
+ };
117
+ };
118
+ /** @description The person has 25 live keys already (`api_key_limit_reached`) */
119
+ readonly 409: {
120
+ headers: {
121
+ readonly [name: string]: unknown;
122
+ };
123
+ content: {
124
+ readonly "application/problem+json": components["schemas"]["Problem"];
125
+ };
126
+ };
127
+ /** @description Too many requests */
128
+ readonly 429: {
129
+ headers: {
130
+ readonly [name: string]: unknown;
131
+ };
132
+ content: {
133
+ readonly "application/problem+json": components["schemas"]["Problem"];
134
+ };
135
+ };
136
+ };
137
+ };
138
+ readonly delete?: never;
139
+ readonly options?: never;
140
+ readonly head?: never;
141
+ readonly patch?: never;
142
+ readonly trace?: never;
143
+ };
144
+ readonly "/v1/api-keys/{key}": {
145
+ readonly parameters: {
146
+ readonly query?: never;
147
+ readonly header?: never;
148
+ readonly path?: never;
149
+ readonly cookie?: never;
150
+ };
151
+ readonly get?: never;
152
+ readonly put?: never;
153
+ readonly post?: never;
154
+ /**
155
+ * Revoke an API key
156
+ * @description At once: its API's next check of it answers `active: false`. Needs `me:write`. Recorded as `user.api_key_revoked`.
157
+ */
158
+ readonly delete: {
159
+ readonly parameters: {
160
+ readonly query?: never;
161
+ readonly header?: never;
162
+ readonly path: {
163
+ readonly key: string;
164
+ };
165
+ readonly cookie?: never;
166
+ };
167
+ readonly requestBody?: never;
168
+ readonly responses: {
169
+ /** @description Revoked */
170
+ readonly 204: {
171
+ headers: {
172
+ readonly [name: string]: unknown;
173
+ };
174
+ content?: never;
175
+ };
176
+ /** @description No access token for this API, or one that is not valid */
177
+ readonly 401: {
178
+ headers: {
179
+ readonly [name: string]: unknown;
180
+ };
181
+ content: {
182
+ readonly "application/problem+json": components["schemas"]["Problem"];
183
+ };
184
+ };
185
+ /** @description The token lacks the scope this route needs */
186
+ readonly 403: {
187
+ headers: {
188
+ readonly [name: string]: unknown;
189
+ };
190
+ content: {
191
+ readonly "application/problem+json": components["schemas"]["Problem"];
192
+ };
193
+ };
194
+ /** @description No such live key */
195
+ readonly 404: {
196
+ headers: {
197
+ readonly [name: string]: unknown;
198
+ };
199
+ content: {
200
+ readonly "application/problem+json": components["schemas"]["Problem"];
201
+ };
202
+ };
203
+ /** @description Too many requests */
204
+ readonly 429: {
205
+ headers: {
206
+ readonly [name: string]: unknown;
207
+ };
208
+ content: {
209
+ readonly "application/problem+json": components["schemas"]["Problem"];
210
+ };
211
+ };
212
+ };
213
+ };
214
+ readonly options?: never;
215
+ readonly head?: never;
216
+ readonly patch?: never;
217
+ readonly trace?: never;
218
+ };
219
+ readonly "/v1/apis": {
220
+ readonly parameters: {
221
+ readonly query?: never;
222
+ readonly header?: never;
223
+ readonly path?: never;
224
+ readonly cookie?: never;
225
+ };
226
+ /**
227
+ * The APIs the person may make API keys for
228
+ * @description The brand's APIs whose tenant lets its users make API keys for them, with the scopes each defines, by name. Needs `me:read`.
229
+ */
230
+ readonly get: {
231
+ readonly parameters: {
232
+ readonly query?: never;
233
+ readonly header?: never;
234
+ readonly path?: never;
235
+ readonly cookie?: never;
236
+ };
237
+ readonly requestBody?: never;
238
+ readonly responses: {
239
+ /** @description The APIs */
240
+ readonly 200: {
241
+ headers: {
242
+ readonly [name: string]: unknown;
243
+ };
244
+ content: {
245
+ readonly "application/json": {
246
+ readonly data: readonly components["schemas"]["KeyableApi"][];
247
+ };
248
+ };
249
+ };
250
+ /** @description No access token for this API, or one that is not valid */
251
+ readonly 401: {
252
+ headers: {
253
+ readonly [name: string]: unknown;
254
+ };
255
+ content: {
256
+ readonly "application/problem+json": components["schemas"]["Problem"];
257
+ };
258
+ };
259
+ /** @description The token lacks the scope this route needs */
260
+ readonly 403: {
261
+ headers: {
262
+ readonly [name: string]: unknown;
263
+ };
264
+ content: {
265
+ readonly "application/problem+json": components["schemas"]["Problem"];
266
+ };
267
+ };
268
+ /** @description Too many requests */
269
+ readonly 429: {
270
+ headers: {
271
+ readonly [name: string]: unknown;
272
+ };
273
+ content: {
274
+ readonly "application/problem+json": components["schemas"]["Problem"];
275
+ };
276
+ };
277
+ };
278
+ };
279
+ readonly put?: never;
280
+ readonly post?: never;
281
+ readonly delete?: never;
282
+ readonly options?: never;
283
+ readonly head?: never;
284
+ readonly patch?: never;
285
+ readonly trace?: never;
286
+ };
287
+ readonly "/v1/consents": {
288
+ readonly parameters: {
289
+ readonly query?: never;
290
+ readonly header?: never;
291
+ readonly path?: never;
292
+ readonly cookie?: never;
293
+ };
294
+ /**
295
+ * The apps the signed-in person allowed
296
+ * @description What they allowed each app that isn't the brand's own, oldest first: signing in to it again doesn't ask again for that. Needs `me:read`.
297
+ */
298
+ readonly get: {
299
+ readonly parameters: {
300
+ readonly query?: never;
301
+ readonly header?: never;
302
+ readonly path?: never;
303
+ readonly cookie?: never;
304
+ };
305
+ readonly requestBody?: never;
306
+ readonly responses: {
307
+ /** @description Their consents */
308
+ readonly 200: {
309
+ headers: {
310
+ readonly [name: string]: unknown;
311
+ };
312
+ content: {
313
+ readonly "application/json": {
314
+ readonly data: readonly components["schemas"]["Consent"][];
315
+ };
316
+ };
317
+ };
318
+ /** @description No access token for this API, or one that is not valid */
319
+ readonly 401: {
320
+ headers: {
321
+ readonly [name: string]: unknown;
322
+ };
323
+ content: {
324
+ readonly "application/problem+json": components["schemas"]["Problem"];
325
+ };
326
+ };
327
+ /** @description The token lacks the scope this route needs */
328
+ readonly 403: {
329
+ headers: {
330
+ readonly [name: string]: unknown;
331
+ };
332
+ content: {
333
+ readonly "application/problem+json": components["schemas"]["Problem"];
334
+ };
335
+ };
336
+ /** @description Too many requests */
337
+ readonly 429: {
338
+ headers: {
339
+ readonly [name: string]: unknown;
340
+ };
341
+ content: {
342
+ readonly "application/problem+json": components["schemas"]["Problem"];
343
+ };
344
+ };
345
+ };
346
+ };
347
+ readonly put?: never;
348
+ readonly post?: never;
349
+ readonly delete?: never;
350
+ readonly options?: never;
351
+ readonly head?: never;
352
+ readonly patch?: never;
353
+ readonly trace?: never;
354
+ };
355
+ readonly "/v1/consents/{consent}": {
356
+ readonly parameters: {
357
+ readonly query?: never;
358
+ readonly header?: never;
359
+ readonly path?: never;
360
+ readonly cookie?: never;
361
+ };
362
+ readonly get?: never;
363
+ readonly put?: never;
364
+ readonly post?: never;
365
+ /**
366
+ * Withdraw what the person allowed an app
367
+ * @description The app's grants and tokens for them end, its refresh tokens included, and each session it was signed in to that registered a `backchannel_logout_uri` gets a logout token; their next sign-in to it asks again. Needs `me:write`. Recorded as `user.consent_revoked`.
368
+ */
369
+ readonly delete: {
370
+ readonly parameters: {
371
+ readonly query?: never;
372
+ readonly header?: never;
373
+ readonly path: {
374
+ readonly consent: string;
375
+ };
376
+ readonly cookie?: never;
377
+ };
378
+ readonly requestBody?: never;
379
+ readonly responses: {
380
+ /** @description Withdrawn */
381
+ readonly 204: {
382
+ headers: {
383
+ readonly [name: string]: unknown;
384
+ };
385
+ content?: never;
386
+ };
387
+ /** @description No access token for this API, or one that is not valid */
388
+ readonly 401: {
389
+ headers: {
390
+ readonly [name: string]: unknown;
391
+ };
392
+ content: {
393
+ readonly "application/problem+json": components["schemas"]["Problem"];
394
+ };
395
+ };
396
+ /** @description The token lacks the scope this route needs */
397
+ readonly 403: {
398
+ headers: {
399
+ readonly [name: string]: unknown;
400
+ };
401
+ content: {
402
+ readonly "application/problem+json": components["schemas"]["Problem"];
403
+ };
404
+ };
405
+ /** @description No such consent */
406
+ readonly 404: {
407
+ headers: {
408
+ readonly [name: string]: unknown;
409
+ };
410
+ content: {
411
+ readonly "application/problem+json": components["schemas"]["Problem"];
412
+ };
413
+ };
414
+ /** @description Too many requests */
415
+ readonly 429: {
416
+ headers: {
417
+ readonly [name: string]: unknown;
418
+ };
419
+ content: {
420
+ readonly "application/problem+json": components["schemas"]["Problem"];
421
+ };
422
+ };
423
+ };
424
+ };
425
+ readonly options?: never;
426
+ readonly head?: never;
427
+ readonly patch?: never;
428
+ readonly trace?: never;
429
+ };
430
+ readonly "/v1/deletion": {
431
+ readonly parameters: {
432
+ readonly query?: never;
433
+ readonly header?: never;
434
+ readonly path?: never;
435
+ readonly cookie?: never;
436
+ };
437
+ readonly get?: never;
438
+ readonly put?: never;
439
+ /**
440
+ * Schedule the signed-in person's account for deletion
441
+ * @description It is deleted 30 days later. Their sessions end at once, and each app they had signed in to that registered a `backchannel_logout_uri` gets a logout token; they can't sign in meanwhile. Someone who owns a Synq org hands it over or deletes it first. Needs `me:write`. Recorded as `user.deletion_scheduled`.
442
+ */
443
+ readonly post: {
444
+ readonly parameters: {
445
+ readonly query?: never;
446
+ readonly header?: never;
447
+ readonly path?: never;
448
+ readonly cookie?: never;
449
+ };
450
+ readonly requestBody?: never;
451
+ readonly responses: {
452
+ /** @description Scheduled */
453
+ readonly 202: {
454
+ headers: {
455
+ readonly [name: string]: unknown;
456
+ };
457
+ content: {
458
+ readonly "application/json": components["schemas"]["Profile"];
459
+ };
460
+ };
461
+ /** @description No access token for this API, or one that is not valid */
462
+ readonly 401: {
463
+ headers: {
464
+ readonly [name: string]: unknown;
465
+ };
466
+ content: {
467
+ readonly "application/problem+json": components["schemas"]["Problem"];
468
+ };
469
+ };
470
+ /** @description The token lacks the scope this route needs */
471
+ readonly 403: {
472
+ headers: {
473
+ readonly [name: string]: unknown;
474
+ };
475
+ content: {
476
+ readonly "application/problem+json": components["schemas"]["Problem"];
477
+ };
478
+ };
479
+ /** @description Someone who owns an org */
480
+ readonly 409: {
481
+ headers: {
482
+ readonly [name: string]: unknown;
483
+ };
484
+ content: {
485
+ readonly "application/problem+json": components["schemas"]["Problem"];
486
+ };
487
+ };
488
+ /** @description Too many requests */
489
+ readonly 429: {
490
+ headers: {
491
+ readonly [name: string]: unknown;
492
+ };
493
+ content: {
494
+ readonly "application/problem+json": components["schemas"]["Problem"];
495
+ };
496
+ };
497
+ };
498
+ };
499
+ /**
500
+ * Cancel a scheduled deletion
501
+ * @description Needs `me:write`. Recorded as `user.deletion_cancelled`.
502
+ */
503
+ readonly delete: {
504
+ readonly parameters: {
505
+ readonly query?: never;
506
+ readonly header?: never;
507
+ readonly path?: never;
508
+ readonly cookie?: never;
509
+ };
510
+ readonly requestBody?: never;
511
+ readonly responses: {
512
+ /** @description Cancelled */
513
+ readonly 200: {
514
+ headers: {
515
+ readonly [name: string]: unknown;
516
+ };
517
+ content: {
518
+ readonly "application/json": components["schemas"]["Profile"];
519
+ };
520
+ };
521
+ /** @description No access token for this API, or one that is not valid */
522
+ readonly 401: {
523
+ headers: {
524
+ readonly [name: string]: unknown;
525
+ };
526
+ content: {
527
+ readonly "application/problem+json": components["schemas"]["Problem"];
528
+ };
529
+ };
530
+ /** @description The token lacks the scope this route needs */
531
+ readonly 403: {
532
+ headers: {
533
+ readonly [name: string]: unknown;
534
+ };
535
+ content: {
536
+ readonly "application/problem+json": components["schemas"]["Problem"];
537
+ };
538
+ };
539
+ /** @description Too many requests */
540
+ readonly 429: {
541
+ headers: {
542
+ readonly [name: string]: unknown;
543
+ };
544
+ content: {
545
+ readonly "application/problem+json": components["schemas"]["Problem"];
546
+ };
547
+ };
548
+ };
549
+ };
550
+ readonly options?: never;
551
+ readonly head?: never;
552
+ readonly patch?: never;
553
+ readonly trace?: never;
554
+ };
555
+ readonly "/v1/identities": {
556
+ readonly parameters: {
557
+ readonly query?: never;
558
+ readonly header?: never;
559
+ readonly path?: never;
560
+ readonly cookie?: never;
561
+ };
562
+ /**
563
+ * List the signed-in person's ways to sign in
564
+ * @description Their wallets, their email address and the accounts at providers they sign in with, oldest first. Passkeys are at `/v1/passkeys`. Needs `me:read`.
565
+ */
566
+ readonly get: {
567
+ readonly parameters: {
568
+ readonly query?: never;
569
+ readonly header?: never;
570
+ readonly path?: never;
571
+ readonly cookie?: never;
572
+ };
573
+ readonly requestBody?: never;
574
+ readonly responses: {
575
+ /** @description Their ways to sign in */
576
+ readonly 200: {
577
+ headers: {
578
+ readonly [name: string]: unknown;
579
+ };
580
+ content: {
581
+ readonly "application/json": {
582
+ readonly data: readonly components["schemas"]["Identity"][];
583
+ };
584
+ };
585
+ };
586
+ /** @description No access token for this API, or one that is not valid */
587
+ readonly 401: {
588
+ headers: {
589
+ readonly [name: string]: unknown;
590
+ };
591
+ content: {
592
+ readonly "application/problem+json": components["schemas"]["Problem"];
593
+ };
594
+ };
595
+ /** @description The token lacks the scope this route needs */
596
+ readonly 403: {
597
+ headers: {
598
+ readonly [name: string]: unknown;
599
+ };
600
+ content: {
601
+ readonly "application/problem+json": components["schemas"]["Problem"];
602
+ };
603
+ };
604
+ /** @description Too many requests */
605
+ readonly 429: {
606
+ headers: {
607
+ readonly [name: string]: unknown;
608
+ };
609
+ content: {
610
+ readonly "application/problem+json": components["schemas"]["Problem"];
611
+ };
612
+ };
613
+ };
614
+ };
615
+ readonly put?: never;
616
+ readonly post?: never;
617
+ readonly delete?: never;
618
+ readonly options?: never;
619
+ readonly head?: never;
620
+ readonly patch?: never;
621
+ readonly trace?: never;
622
+ };
623
+ readonly "/v1/identities/{identity}": {
624
+ readonly parameters: {
625
+ readonly query?: never;
626
+ readonly header?: never;
627
+ readonly path?: never;
628
+ readonly cookie?: never;
629
+ };
630
+ readonly get?: never;
631
+ readonly put?: never;
632
+ readonly post?: never;
633
+ /**
634
+ * Remove a way to sign in
635
+ * @description A wallet, the email address (with its password) or an account at a provider stops signing the person in. Their last way to sign in can't be removed (`last_sign_in_method`): an email address counts only with its password, or where people can sign in with an emailed code. Removing their primary wallet makes their most recently used other wallet primary. Removing the email address leaves it their contact address, no longer verified. Sessions it signed in keep going: end them with `DELETE /v1/sessions/{session}`. Passkeys are removed at `/v1/passkeys`. Needs `me:write`, from a sign-in in the last 5 minutes whose time Synq proved (send the person to sign in with `max_age=300`; a provider that can't show when they signed in, such as Discord, never counts), else 403 `fresh_sign_in_required`. Send `max_age` only when you need a fresh sign-in: it asks someone signed in that way to sign in again. Recorded as `user.identity_unlinked`.
636
+ */
637
+ readonly delete: {
638
+ readonly parameters: {
639
+ readonly query?: never;
640
+ readonly header?: never;
641
+ readonly path: {
642
+ readonly identity: string;
643
+ };
644
+ readonly cookie?: never;
645
+ };
646
+ readonly requestBody?: never;
647
+ readonly responses: {
648
+ /** @description Removed */
649
+ readonly 204: {
650
+ headers: {
651
+ readonly [name: string]: unknown;
652
+ };
653
+ content?: never;
654
+ };
655
+ /** @description No access token for this API, or one that is not valid */
656
+ readonly 401: {
657
+ headers: {
658
+ readonly [name: string]: unknown;
659
+ };
660
+ content: {
661
+ readonly "application/problem+json": components["schemas"]["Problem"];
662
+ };
663
+ };
664
+ /** @description The token lacks the scope this route needs */
665
+ readonly 403: {
666
+ headers: {
667
+ readonly [name: string]: unknown;
668
+ };
669
+ content: {
670
+ readonly "application/problem+json": components["schemas"]["Problem"];
671
+ };
672
+ };
673
+ /** @description No such way to sign in */
674
+ readonly 404: {
675
+ headers: {
676
+ readonly [name: string]: unknown;
677
+ };
678
+ content: {
679
+ readonly "application/problem+json": components["schemas"]["Problem"];
680
+ };
681
+ };
682
+ /** @description It is their last way to sign in (`last_sign_in_method`) */
683
+ readonly 409: {
684
+ headers: {
685
+ readonly [name: string]: unknown;
686
+ };
687
+ content: {
688
+ readonly "application/problem+json": components["schemas"]["Problem"];
689
+ };
690
+ };
691
+ /** @description Too many requests */
692
+ readonly 429: {
693
+ headers: {
694
+ readonly [name: string]: unknown;
695
+ };
696
+ content: {
697
+ readonly "application/problem+json": components["schemas"]["Problem"];
698
+ };
699
+ };
700
+ };
701
+ };
702
+ readonly options?: never;
703
+ readonly head?: never;
704
+ readonly patch?: never;
705
+ readonly trace?: never;
706
+ };
707
+ readonly "/v1/link-requests": {
708
+ readonly parameters: {
709
+ readonly query?: never;
710
+ readonly header?: never;
711
+ readonly path?: never;
712
+ readonly cookie?: never;
713
+ };
714
+ readonly get?: never;
715
+ readonly put?: never;
716
+ /**
717
+ * Start adding a way to sign in
718
+ * @description A link request for the person, through this app: send them to sign in from this app with its `authorization_params` added. They sign in again as themselves, then use the method being added (a wallet, an emailed code, a provider), and it joins their account; a way in another person has is never merged. Methods the brand doesn't offer, or that can't show a fresh sign-in (Apple, Facebook, X, Discord), answer 409 `sign_in_method_unavailable`; so does an email address for an account that has one. One person has at most 20 ways to sign in (409 `identity_limit_reached`). Needs `me:write`. An account that signs in with an email address nobody proved yet takes no new way to sign in: 403 `email_unverified` until the person verifies it.
719
+ */
720
+ readonly post: {
721
+ readonly parameters: {
722
+ readonly query?: never;
723
+ readonly header?: never;
724
+ readonly path?: never;
725
+ readonly cookie?: never;
726
+ };
727
+ readonly requestBody: {
728
+ readonly content: {
729
+ readonly "application/json": components["schemas"]["NewLinkRequest"];
730
+ };
731
+ };
732
+ readonly responses: {
733
+ /** @description The link request */
734
+ readonly 201: {
735
+ headers: {
736
+ readonly [name: string]: unknown;
737
+ };
738
+ content: {
739
+ readonly "application/json": components["schemas"]["LinkRequest"];
740
+ };
741
+ };
742
+ /** @description A body that is not valid, such as a method that can’t be added */
743
+ readonly 400: {
744
+ headers: {
745
+ readonly [name: string]: unknown;
746
+ };
747
+ content: {
748
+ readonly "application/problem+json": components["schemas"]["Problem"];
749
+ };
750
+ };
751
+ /** @description No access token for this API, or one that is not valid */
752
+ readonly 401: {
753
+ headers: {
754
+ readonly [name: string]: unknown;
755
+ };
756
+ content: {
757
+ readonly "application/problem+json": components["schemas"]["Problem"];
758
+ };
759
+ };
760
+ /** @description The token lacks `me:write` (`insufficient_permissions`), or the account signs in with an email address nobody proved yet (`email_unverified`) */
761
+ readonly 403: {
762
+ headers: {
763
+ readonly [name: string]: unknown;
764
+ };
765
+ content: {
766
+ readonly "application/problem+json": components["schemas"]["Problem"];
767
+ };
768
+ };
769
+ /** @description The method can’t be added here (`sign_in_method_unavailable`), or the person has as many ways to sign in as one may (`identity_limit_reached`) */
770
+ readonly 409: {
771
+ headers: {
772
+ readonly [name: string]: unknown;
773
+ };
774
+ content: {
775
+ readonly "application/problem+json": components["schemas"]["Problem"];
776
+ };
777
+ };
778
+ /** @description Too many requests */
779
+ readonly 429: {
780
+ headers: {
781
+ readonly [name: string]: unknown;
782
+ };
783
+ content: {
784
+ readonly "application/problem+json": components["schemas"]["Problem"];
785
+ };
786
+ };
787
+ /** @description Adding ways to sign in is not set up here */
788
+ readonly 503: {
789
+ headers: {
790
+ readonly [name: string]: unknown;
791
+ };
792
+ content: {
793
+ readonly "application/problem+json": components["schemas"]["Problem"];
794
+ };
795
+ };
796
+ };
797
+ };
798
+ readonly delete?: never;
799
+ readonly options?: never;
800
+ readonly head?: never;
801
+ readonly patch?: never;
802
+ readonly trace?: never;
803
+ };
804
+ readonly "/v1/metadata": {
805
+ readonly parameters: {
806
+ readonly query?: never;
807
+ readonly header?: never;
808
+ readonly path?: never;
809
+ readonly cookie?: never;
810
+ };
811
+ /**
812
+ * Read what the brand keeps about the signed-in person
813
+ * @description The tenant's own JSON for this user, read-only here. Needs `me:read`.
814
+ */
815
+ readonly get: {
816
+ readonly parameters: {
817
+ readonly query?: never;
818
+ readonly header?: never;
819
+ readonly path?: never;
820
+ readonly cookie?: never;
821
+ };
822
+ readonly requestBody?: never;
823
+ readonly responses: {
824
+ /** @description The metadata */
825
+ readonly 200: {
826
+ headers: {
827
+ readonly [name: string]: unknown;
828
+ };
829
+ content: {
830
+ readonly "application/json": {
831
+ readonly [key: string]: unknown;
832
+ };
833
+ };
834
+ };
835
+ /** @description No access token for this API, or one that is not valid */
836
+ readonly 401: {
837
+ headers: {
838
+ readonly [name: string]: unknown;
839
+ };
840
+ content: {
841
+ readonly "application/problem+json": components["schemas"]["Problem"];
842
+ };
843
+ };
844
+ /** @description The token lacks the scope this route needs */
845
+ readonly 403: {
846
+ headers: {
847
+ readonly [name: string]: unknown;
848
+ };
849
+ content: {
850
+ readonly "application/problem+json": components["schemas"]["Problem"];
851
+ };
852
+ };
853
+ /** @description Too many requests */
854
+ readonly 429: {
855
+ headers: {
856
+ readonly [name: string]: unknown;
857
+ };
858
+ content: {
859
+ readonly "application/problem+json": components["schemas"]["Problem"];
860
+ };
861
+ };
862
+ };
863
+ };
864
+ readonly put?: never;
865
+ readonly post?: never;
866
+ readonly delete?: never;
867
+ readonly options?: never;
868
+ readonly head?: never;
869
+ readonly patch?: never;
870
+ readonly trace?: never;
871
+ };
872
+ readonly "/v1/passkeys": {
873
+ readonly parameters: {
874
+ readonly query?: never;
875
+ readonly header?: never;
876
+ readonly path?: never;
877
+ readonly cookie?: never;
878
+ };
879
+ /**
880
+ * List the signed-in person's passkeys
881
+ * @description Oldest first. Needs `me:read`.
882
+ */
883
+ readonly get: {
884
+ readonly parameters: {
885
+ readonly query?: never;
886
+ readonly header?: never;
887
+ readonly path?: never;
888
+ readonly cookie?: never;
889
+ };
890
+ readonly requestBody?: never;
891
+ readonly responses: {
892
+ /** @description Their passkeys */
893
+ readonly 200: {
894
+ headers: {
895
+ readonly [name: string]: unknown;
896
+ };
897
+ content: {
898
+ readonly "application/json": {
899
+ readonly data: readonly components["schemas"]["Passkey"][];
900
+ };
901
+ };
902
+ };
903
+ /** @description No access token for this API, or one that is not valid */
904
+ readonly 401: {
905
+ headers: {
906
+ readonly [name: string]: unknown;
907
+ };
908
+ content: {
909
+ readonly "application/problem+json": components["schemas"]["Problem"];
910
+ };
911
+ };
912
+ /** @description The token lacks the scope this route needs */
913
+ readonly 403: {
914
+ headers: {
915
+ readonly [name: string]: unknown;
916
+ };
917
+ content: {
918
+ readonly "application/problem+json": components["schemas"]["Problem"];
919
+ };
920
+ };
921
+ /** @description Too many requests */
922
+ readonly 429: {
923
+ headers: {
924
+ readonly [name: string]: unknown;
925
+ };
926
+ content: {
927
+ readonly "application/problem+json": components["schemas"]["Problem"];
928
+ };
929
+ };
930
+ /** @description Passkeys are not set up here */
931
+ readonly 503: {
932
+ headers: {
933
+ readonly [name: string]: unknown;
934
+ };
935
+ content: {
936
+ readonly "application/problem+json": components["schemas"]["Problem"];
937
+ };
938
+ };
939
+ };
940
+ };
941
+ readonly put?: never;
942
+ /**
943
+ * Keep a new passkey
944
+ * @description Checks what the browser made from the options of `POST /v1/passkeys/registration-options` (its challenge, origin, relying party and user verification) and keeps it, and emails the person's verified address that a passkey was added. Needs `me:write`, from a sign-in in the last 5 minutes whose time Synq proved (send the person to sign in with `max_age=300`; a provider that can't show when they signed in, such as Discord, never counts), else 403 `fresh_sign_in_required`. Send `max_age` only when you need a fresh sign-in: it asks someone signed in that way to sign in again. An account that signs in with an email address nobody proved yet takes no new way to sign in: 403 `email_unverified` until the person verifies it. Recorded as `user.passkey_added`.
945
+ */
946
+ readonly post: {
947
+ readonly parameters: {
948
+ readonly query?: never;
949
+ readonly header?: never;
950
+ readonly path?: never;
951
+ readonly cookie?: never;
952
+ };
953
+ readonly requestBody?: {
954
+ readonly content: {
955
+ readonly "application/json": components["schemas"]["NewPasskey"];
956
+ };
957
+ };
958
+ readonly responses: {
959
+ /** @description The new passkey */
960
+ readonly 201: {
961
+ headers: {
962
+ readonly [name: string]: unknown;
963
+ };
964
+ content: {
965
+ readonly "application/json": components["schemas"]["Passkey"];
966
+ };
967
+ };
968
+ /** @description The passkey didn't check out (`passkey_rejected`) */
969
+ readonly 400: {
970
+ headers: {
971
+ readonly [name: string]: unknown;
972
+ };
973
+ content: {
974
+ readonly "application/problem+json": components["schemas"]["Problem"];
975
+ };
976
+ };
977
+ /** @description No access token for this API, or one that is not valid */
978
+ readonly 401: {
979
+ headers: {
980
+ readonly [name: string]: unknown;
981
+ };
982
+ content: {
983
+ readonly "application/problem+json": components["schemas"]["Problem"];
984
+ };
985
+ };
986
+ /** @description The token lacks `me:write` (`insufficient_permissions`), the sign-in isn’t recent enough (`fresh_sign_in_required`), or the account signs in with an email address nobody proved yet (`email_unverified`) */
987
+ readonly 403: {
988
+ headers: {
989
+ readonly [name: string]: unknown;
990
+ };
991
+ content: {
992
+ readonly "application/problem+json": components["schemas"]["Problem"];
993
+ };
994
+ };
995
+ /** @description The person has this passkey already (`passkey_exists`) */
996
+ readonly 409: {
997
+ headers: {
998
+ readonly [name: string]: unknown;
999
+ };
1000
+ content: {
1001
+ readonly "application/problem+json": components["schemas"]["Problem"];
1002
+ };
1003
+ };
1004
+ /** @description Too many requests */
1005
+ readonly 429: {
1006
+ headers: {
1007
+ readonly [name: string]: unknown;
1008
+ };
1009
+ content: {
1010
+ readonly "application/problem+json": components["schemas"]["Problem"];
1011
+ };
1012
+ };
1013
+ /** @description Passkeys are not set up here */
1014
+ readonly 503: {
1015
+ headers: {
1016
+ readonly [name: string]: unknown;
1017
+ };
1018
+ content: {
1019
+ readonly "application/problem+json": components["schemas"]["Problem"];
1020
+ };
1021
+ };
1022
+ };
1023
+ };
1024
+ readonly delete?: never;
1025
+ readonly options?: never;
1026
+ readonly head?: never;
1027
+ readonly patch?: never;
1028
+ readonly trace?: never;
1029
+ };
1030
+ readonly "/v1/passkeys/{passkey}": {
1031
+ readonly parameters: {
1032
+ readonly query?: never;
1033
+ readonly header?: never;
1034
+ readonly path?: never;
1035
+ readonly cookie?: never;
1036
+ };
1037
+ readonly get?: never;
1038
+ readonly put?: never;
1039
+ readonly post?: never;
1040
+ /**
1041
+ * Remove a passkey
1042
+ * @description It stops signing the person in. Their last way to sign in can't be removed (`last_sign_in_method`): an email address counts only with its password, or where people can sign in with an emailed code. Needs `me:write`, from a sign-in in the last 5 minutes whose time Synq proved (send the person to sign in with `max_age=300`; a provider that can't show when they signed in, such as Discord, never counts), else 403 `fresh_sign_in_required`. Send `max_age` only when you need a fresh sign-in: it asks someone signed in that way to sign in again. Recorded as `user.passkey_removed`.
1043
+ */
1044
+ readonly delete: {
1045
+ readonly parameters: {
1046
+ readonly query?: never;
1047
+ readonly header?: never;
1048
+ readonly path: {
1049
+ readonly passkey: string;
1050
+ };
1051
+ readonly cookie?: never;
1052
+ };
1053
+ readonly requestBody?: never;
1054
+ readonly responses: {
1055
+ /** @description Removed */
1056
+ readonly 204: {
1057
+ headers: {
1058
+ readonly [name: string]: unknown;
1059
+ };
1060
+ content?: never;
1061
+ };
1062
+ /** @description No access token for this API, or one that is not valid */
1063
+ readonly 401: {
1064
+ headers: {
1065
+ readonly [name: string]: unknown;
1066
+ };
1067
+ content: {
1068
+ readonly "application/problem+json": components["schemas"]["Problem"];
1069
+ };
1070
+ };
1071
+ /** @description The token lacks `me:write` (`insufficient_permissions`), or the sign-in isn’t recent enough (`fresh_sign_in_required`) */
1072
+ readonly 403: {
1073
+ headers: {
1074
+ readonly [name: string]: unknown;
1075
+ };
1076
+ content: {
1077
+ readonly "application/problem+json": components["schemas"]["Problem"];
1078
+ };
1079
+ };
1080
+ /** @description No such passkey */
1081
+ readonly 404: {
1082
+ headers: {
1083
+ readonly [name: string]: unknown;
1084
+ };
1085
+ content: {
1086
+ readonly "application/problem+json": components["schemas"]["Problem"];
1087
+ };
1088
+ };
1089
+ /** @description It is their last way to sign in (`last_sign_in_method`) */
1090
+ readonly 409: {
1091
+ headers: {
1092
+ readonly [name: string]: unknown;
1093
+ };
1094
+ content: {
1095
+ readonly "application/problem+json": components["schemas"]["Problem"];
1096
+ };
1097
+ };
1098
+ /** @description Too many requests */
1099
+ readonly 429: {
1100
+ headers: {
1101
+ readonly [name: string]: unknown;
1102
+ };
1103
+ content: {
1104
+ readonly "application/problem+json": components["schemas"]["Problem"];
1105
+ };
1106
+ };
1107
+ /** @description Passkeys are not set up here */
1108
+ readonly 503: {
1109
+ headers: {
1110
+ readonly [name: string]: unknown;
1111
+ };
1112
+ content: {
1113
+ readonly "application/problem+json": components["schemas"]["Problem"];
1114
+ };
1115
+ };
1116
+ };
1117
+ };
1118
+ readonly options?: never;
1119
+ readonly head?: never;
1120
+ readonly patch?: never;
1121
+ readonly trace?: never;
1122
+ };
1123
+ readonly "/v1/passkeys/registration-options": {
1124
+ readonly parameters: {
1125
+ readonly query?: never;
1126
+ readonly header?: never;
1127
+ readonly path?: never;
1128
+ readonly cookie?: never;
1129
+ };
1130
+ readonly get?: never;
1131
+ readonly put?: never;
1132
+ /**
1133
+ * Start making a passkey
1134
+ * @description The options to hand the browser for a new passkey: discoverable, with user verification, and none the person has already. Send what the browser makes to `POST /v1/passkeys` within 5 minutes. Needs `me:write`, from a sign-in in the last 5 minutes whose time Synq proved (send the person to sign in with `max_age=300`; a provider that can't show when they signed in, such as Discord, never counts), else 403 `fresh_sign_in_required`. Send `max_age` only when you need a fresh sign-in: it asks someone signed in that way to sign in again. An account that signs in with an email address nobody proved yet takes no new way to sign in: 403 `email_unverified` until the person verifies it.
1135
+ */
1136
+ readonly post: {
1137
+ readonly parameters: {
1138
+ readonly query?: never;
1139
+ readonly header?: never;
1140
+ readonly path?: never;
1141
+ readonly cookie?: never;
1142
+ };
1143
+ readonly requestBody?: never;
1144
+ readonly responses: {
1145
+ /** @description The options */
1146
+ readonly 200: {
1147
+ headers: {
1148
+ readonly [name: string]: unknown;
1149
+ };
1150
+ content: {
1151
+ readonly "application/json": components["schemas"]["PasskeyCreationOptions"];
1152
+ };
1153
+ };
1154
+ /** @description No access token for this API, or one that is not valid */
1155
+ readonly 401: {
1156
+ headers: {
1157
+ readonly [name: string]: unknown;
1158
+ };
1159
+ content: {
1160
+ readonly "application/problem+json": components["schemas"]["Problem"];
1161
+ };
1162
+ };
1163
+ /** @description The token lacks `me:write` (`insufficient_permissions`), the sign-in isn’t recent enough (`fresh_sign_in_required`), or the account signs in with an email address nobody proved yet (`email_unverified`) */
1164
+ readonly 403: {
1165
+ headers: {
1166
+ readonly [name: string]: unknown;
1167
+ };
1168
+ content: {
1169
+ readonly "application/problem+json": components["schemas"]["Problem"];
1170
+ };
1171
+ };
1172
+ /** @description Too many requests */
1173
+ readonly 429: {
1174
+ headers: {
1175
+ readonly [name: string]: unknown;
1176
+ };
1177
+ content: {
1178
+ readonly "application/problem+json": components["schemas"]["Problem"];
1179
+ };
1180
+ };
1181
+ /** @description Passkeys are not set up here */
1182
+ readonly 503: {
1183
+ headers: {
1184
+ readonly [name: string]: unknown;
1185
+ };
1186
+ content: {
1187
+ readonly "application/problem+json": components["schemas"]["Problem"];
1188
+ };
1189
+ };
1190
+ };
1191
+ };
1192
+ readonly delete?: never;
1193
+ readonly options?: never;
1194
+ readonly head?: never;
1195
+ readonly patch?: never;
1196
+ readonly trace?: never;
1197
+ };
1198
+ readonly "/v1/profile": {
1199
+ readonly parameters: {
1200
+ readonly query?: never;
1201
+ readonly header?: never;
1202
+ readonly path?: never;
1203
+ readonly cookie?: never;
1204
+ };
1205
+ /**
1206
+ * Read the signed-in person's profile
1207
+ * @description Needs `me:read`.
1208
+ */
1209
+ readonly get: {
1210
+ readonly parameters: {
1211
+ readonly query?: never;
1212
+ readonly header?: never;
1213
+ readonly path?: never;
1214
+ readonly cookie?: never;
1215
+ };
1216
+ readonly requestBody?: never;
1217
+ readonly responses: {
1218
+ /** @description The profile */
1219
+ readonly 200: {
1220
+ headers: {
1221
+ readonly [name: string]: unknown;
1222
+ };
1223
+ content: {
1224
+ readonly "application/json": components["schemas"]["Profile"];
1225
+ };
1226
+ };
1227
+ /** @description No access token for this API, or one that is not valid */
1228
+ readonly 401: {
1229
+ headers: {
1230
+ readonly [name: string]: unknown;
1231
+ };
1232
+ content: {
1233
+ readonly "application/problem+json": components["schemas"]["Problem"];
1234
+ };
1235
+ };
1236
+ /** @description The token lacks the scope this route needs */
1237
+ readonly 403: {
1238
+ headers: {
1239
+ readonly [name: string]: unknown;
1240
+ };
1241
+ content: {
1242
+ readonly "application/problem+json": components["schemas"]["Problem"];
1243
+ };
1244
+ };
1245
+ /** @description Too many requests */
1246
+ readonly 429: {
1247
+ headers: {
1248
+ readonly [name: string]: unknown;
1249
+ };
1250
+ content: {
1251
+ readonly "application/problem+json": components["schemas"]["Problem"];
1252
+ };
1253
+ };
1254
+ };
1255
+ };
1256
+ readonly put?: never;
1257
+ readonly post?: never;
1258
+ readonly delete?: never;
1259
+ readonly options?: never;
1260
+ readonly head?: never;
1261
+ /**
1262
+ * Change the signed-in person's profile
1263
+ * @description Their username, names, picture and language; null clears one. Not their email, which a sign-in method proves. Needs `me:write`. Recorded as `user.updated`.
1264
+ */
1265
+ readonly patch: {
1266
+ readonly parameters: {
1267
+ readonly query?: never;
1268
+ readonly header?: never;
1269
+ readonly path?: never;
1270
+ readonly cookie?: never;
1271
+ };
1272
+ readonly requestBody: {
1273
+ readonly content: {
1274
+ readonly "application/json": components["schemas"]["ProfileUpdate"];
1275
+ };
1276
+ };
1277
+ readonly responses: {
1278
+ /** @description The profile, changed */
1279
+ readonly 200: {
1280
+ headers: {
1281
+ readonly [name: string]: unknown;
1282
+ };
1283
+ content: {
1284
+ readonly "application/json": components["schemas"]["Profile"];
1285
+ };
1286
+ };
1287
+ /** @description A field that is not valid */
1288
+ readonly 400: {
1289
+ headers: {
1290
+ readonly [name: string]: unknown;
1291
+ };
1292
+ content: {
1293
+ readonly "application/problem+json": components["schemas"]["Problem"];
1294
+ };
1295
+ };
1296
+ /** @description No access token for this API, or one that is not valid */
1297
+ readonly 401: {
1298
+ headers: {
1299
+ readonly [name: string]: unknown;
1300
+ };
1301
+ content: {
1302
+ readonly "application/problem+json": components["schemas"]["Problem"];
1303
+ };
1304
+ };
1305
+ /** @description The token lacks the scope this route needs */
1306
+ readonly 403: {
1307
+ headers: {
1308
+ readonly [name: string]: unknown;
1309
+ };
1310
+ content: {
1311
+ readonly "application/problem+json": components["schemas"]["Problem"];
1312
+ };
1313
+ };
1314
+ /** @description A username someone else in the brand has */
1315
+ readonly 409: {
1316
+ headers: {
1317
+ readonly [name: string]: unknown;
1318
+ };
1319
+ content: {
1320
+ readonly "application/problem+json": components["schemas"]["Problem"];
1321
+ };
1322
+ };
1323
+ /** @description Too many requests */
1324
+ readonly 429: {
1325
+ headers: {
1326
+ readonly [name: string]: unknown;
1327
+ };
1328
+ content: {
1329
+ readonly "application/problem+json": components["schemas"]["Problem"];
1330
+ };
1331
+ };
1332
+ };
1333
+ };
1334
+ readonly trace?: never;
1335
+ };
1336
+ readonly "/v1/sessions": {
1337
+ readonly parameters: {
1338
+ readonly query?: never;
1339
+ readonly header?: never;
1340
+ readonly path?: never;
1341
+ readonly cookie?: never;
1342
+ };
1343
+ /**
1344
+ * List the signed-in person's sessions
1345
+ * @description Newest first, the caller's own marked `current`. Needs `me:read`.
1346
+ */
1347
+ readonly get: {
1348
+ readonly parameters: {
1349
+ readonly query?: never;
1350
+ readonly header?: never;
1351
+ readonly path?: never;
1352
+ readonly cookie?: never;
1353
+ };
1354
+ readonly requestBody?: never;
1355
+ readonly responses: {
1356
+ /** @description Their sessions */
1357
+ readonly 200: {
1358
+ headers: {
1359
+ readonly [name: string]: unknown;
1360
+ };
1361
+ content: {
1362
+ readonly "application/json": {
1363
+ readonly data: readonly components["schemas"]["Session"][];
1364
+ };
1365
+ };
1366
+ };
1367
+ /** @description No access token for this API, or one that is not valid */
1368
+ readonly 401: {
1369
+ headers: {
1370
+ readonly [name: string]: unknown;
1371
+ };
1372
+ content: {
1373
+ readonly "application/problem+json": components["schemas"]["Problem"];
1374
+ };
1375
+ };
1376
+ /** @description The token lacks the scope this route needs */
1377
+ readonly 403: {
1378
+ headers: {
1379
+ readonly [name: string]: unknown;
1380
+ };
1381
+ content: {
1382
+ readonly "application/problem+json": components["schemas"]["Problem"];
1383
+ };
1384
+ };
1385
+ /** @description Too many requests */
1386
+ readonly 429: {
1387
+ headers: {
1388
+ readonly [name: string]: unknown;
1389
+ };
1390
+ content: {
1391
+ readonly "application/problem+json": components["schemas"]["Problem"];
1392
+ };
1393
+ };
1394
+ };
1395
+ };
1396
+ readonly put?: never;
1397
+ readonly post?: never;
1398
+ readonly delete?: never;
1399
+ readonly options?: never;
1400
+ readonly head?: never;
1401
+ readonly patch?: never;
1402
+ readonly trace?: never;
1403
+ };
1404
+ readonly "/v1/sessions/{session}": {
1405
+ readonly parameters: {
1406
+ readonly query?: never;
1407
+ readonly header?: never;
1408
+ readonly path?: never;
1409
+ readonly cookie?: never;
1410
+ };
1411
+ readonly get?: never;
1412
+ readonly put?: never;
1413
+ readonly post?: never;
1414
+ /**
1415
+ * Sign out of one session
1416
+ * @description Ends it and every grant it made: its refresh tokens stop working. Each app the session had signed in to that registered a `backchannel_logout_uri` gets a logout token; one that turned `backchannel_logout_session_required` off gets it without `sid`, so it signs the person out of every session it has. Needs `me:write`. Recorded as `user.sessions_revoked`.
1417
+ */
1418
+ readonly delete: {
1419
+ readonly parameters: {
1420
+ readonly query?: never;
1421
+ readonly header?: never;
1422
+ readonly path: {
1423
+ readonly session: string;
1424
+ };
1425
+ readonly cookie?: never;
1426
+ };
1427
+ readonly requestBody?: never;
1428
+ readonly responses: {
1429
+ /** @description Ended */
1430
+ readonly 204: {
1431
+ headers: {
1432
+ readonly [name: string]: unknown;
1433
+ };
1434
+ content?: never;
1435
+ };
1436
+ /** @description No access token for this API, or one that is not valid */
1437
+ readonly 401: {
1438
+ headers: {
1439
+ readonly [name: string]: unknown;
1440
+ };
1441
+ content: {
1442
+ readonly "application/problem+json": components["schemas"]["Problem"];
1443
+ };
1444
+ };
1445
+ /** @description The token lacks the scope this route needs */
1446
+ readonly 403: {
1447
+ headers: {
1448
+ readonly [name: string]: unknown;
1449
+ };
1450
+ content: {
1451
+ readonly "application/problem+json": components["schemas"]["Problem"];
1452
+ };
1453
+ };
1454
+ /** @description No such session */
1455
+ readonly 404: {
1456
+ headers: {
1457
+ readonly [name: string]: unknown;
1458
+ };
1459
+ content: {
1460
+ readonly "application/problem+json": components["schemas"]["Problem"];
1461
+ };
1462
+ };
1463
+ /** @description Too many requests */
1464
+ readonly 429: {
1465
+ headers: {
1466
+ readonly [name: string]: unknown;
1467
+ };
1468
+ content: {
1469
+ readonly "application/problem+json": components["schemas"]["Problem"];
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ readonly options?: never;
1475
+ readonly head?: never;
1476
+ readonly patch?: never;
1477
+ readonly trace?: never;
1478
+ };
1479
+ readonly "/v1/sign-ins": {
1480
+ readonly parameters: {
1481
+ readonly query?: never;
1482
+ readonly header?: never;
1483
+ readonly path?: never;
1484
+ readonly cookie?: never;
1485
+ };
1486
+ /**
1487
+ * The signed-in person's recent sign-ins
1488
+ * @description The last 50, newest first. Needs `me:read`.
1489
+ */
1490
+ readonly get: {
1491
+ readonly parameters: {
1492
+ readonly query?: never;
1493
+ readonly header?: never;
1494
+ readonly path?: never;
1495
+ readonly cookie?: never;
1496
+ };
1497
+ readonly requestBody?: never;
1498
+ readonly responses: {
1499
+ /** @description Their sign-ins */
1500
+ readonly 200: {
1501
+ headers: {
1502
+ readonly [name: string]: unknown;
1503
+ };
1504
+ content: {
1505
+ readonly "application/json": {
1506
+ readonly data: readonly components["schemas"]["SignIn"][];
1507
+ };
1508
+ };
1509
+ };
1510
+ /** @description No access token for this API, or one that is not valid */
1511
+ readonly 401: {
1512
+ headers: {
1513
+ readonly [name: string]: unknown;
1514
+ };
1515
+ content: {
1516
+ readonly "application/problem+json": components["schemas"]["Problem"];
1517
+ };
1518
+ };
1519
+ /** @description The token lacks the scope this route needs */
1520
+ readonly 403: {
1521
+ headers: {
1522
+ readonly [name: string]: unknown;
1523
+ };
1524
+ content: {
1525
+ readonly "application/problem+json": components["schemas"]["Problem"];
1526
+ };
1527
+ };
1528
+ /** @description Too many requests */
1529
+ readonly 429: {
1530
+ headers: {
1531
+ readonly [name: string]: unknown;
1532
+ };
1533
+ content: {
1534
+ readonly "application/problem+json": components["schemas"]["Problem"];
1535
+ };
1536
+ };
1537
+ };
1538
+ };
1539
+ readonly put?: never;
1540
+ readonly post?: never;
1541
+ readonly delete?: never;
1542
+ readonly options?: never;
1543
+ readonly head?: never;
1544
+ readonly patch?: never;
1545
+ readonly trace?: never;
1546
+ };
1547
+ readonly "/v1/usernames/{username}": {
1548
+ readonly parameters: {
1549
+ readonly query?: never;
1550
+ readonly header?: never;
1551
+ readonly path?: never;
1552
+ readonly cookie?: never;
1553
+ };
1554
+ /**
1555
+ * Check whether a username is free
1556
+ * @description In this brand. Needs `me:read`.
1557
+ */
1558
+ readonly get: {
1559
+ readonly parameters: {
1560
+ readonly query?: never;
1561
+ readonly header?: never;
1562
+ readonly path: {
1563
+ readonly username: string;
1564
+ };
1565
+ readonly cookie?: never;
1566
+ };
1567
+ readonly requestBody?: never;
1568
+ readonly responses: {
1569
+ /** @description Whether it is free */
1570
+ readonly 200: {
1571
+ headers: {
1572
+ readonly [name: string]: unknown;
1573
+ };
1574
+ content: {
1575
+ readonly "application/json": components["schemas"]["UsernameAvailability"];
1576
+ };
1577
+ };
1578
+ /** @description No access token for this API, or one that is not valid */
1579
+ readonly 401: {
1580
+ headers: {
1581
+ readonly [name: string]: unknown;
1582
+ };
1583
+ content: {
1584
+ readonly "application/problem+json": components["schemas"]["Problem"];
1585
+ };
1586
+ };
1587
+ /** @description The token lacks the scope this route needs */
1588
+ readonly 403: {
1589
+ headers: {
1590
+ readonly [name: string]: unknown;
1591
+ };
1592
+ content: {
1593
+ readonly "application/problem+json": components["schemas"]["Problem"];
1594
+ };
1595
+ };
1596
+ /** @description Too many requests */
1597
+ readonly 429: {
1598
+ headers: {
1599
+ readonly [name: string]: unknown;
1600
+ };
1601
+ content: {
1602
+ readonly "application/problem+json": components["schemas"]["Problem"];
1603
+ };
1604
+ };
1605
+ };
1606
+ };
1607
+ readonly put?: never;
1608
+ readonly post?: never;
1609
+ readonly delete?: never;
1610
+ readonly options?: never;
1611
+ readonly head?: never;
1612
+ readonly patch?: never;
1613
+ readonly trace?: never;
1614
+ };
1615
+ readonly "/v1/wallets": {
1616
+ readonly parameters: {
1617
+ readonly query?: never;
1618
+ readonly header?: never;
1619
+ readonly path?: never;
1620
+ readonly cookie?: never;
1621
+ };
1622
+ /**
1623
+ * List the signed-in person's wallets
1624
+ * @description The Solana wallets they sign in with, oldest first. Needs `me:read`.
1625
+ */
1626
+ readonly get: {
1627
+ readonly parameters: {
1628
+ readonly query?: never;
1629
+ readonly header?: never;
1630
+ readonly path?: never;
1631
+ readonly cookie?: never;
1632
+ };
1633
+ readonly requestBody?: never;
1634
+ readonly responses: {
1635
+ /** @description Their wallets */
1636
+ readonly 200: {
1637
+ headers: {
1638
+ readonly [name: string]: unknown;
1639
+ };
1640
+ content: {
1641
+ readonly "application/json": {
1642
+ readonly data: readonly components["schemas"]["Wallet"][];
1643
+ };
1644
+ };
1645
+ };
1646
+ /** @description No access token for this API, or one that is not valid */
1647
+ readonly 401: {
1648
+ headers: {
1649
+ readonly [name: string]: unknown;
1650
+ };
1651
+ content: {
1652
+ readonly "application/problem+json": components["schemas"]["Problem"];
1653
+ };
1654
+ };
1655
+ /** @description The token lacks the scope this route needs */
1656
+ readonly 403: {
1657
+ headers: {
1658
+ readonly [name: string]: unknown;
1659
+ };
1660
+ content: {
1661
+ readonly "application/problem+json": components["schemas"]["Problem"];
1662
+ };
1663
+ };
1664
+ /** @description Too many requests */
1665
+ readonly 429: {
1666
+ headers: {
1667
+ readonly [name: string]: unknown;
1668
+ };
1669
+ content: {
1670
+ readonly "application/problem+json": components["schemas"]["Problem"];
1671
+ };
1672
+ };
1673
+ };
1674
+ };
1675
+ readonly put?: never;
1676
+ readonly post?: never;
1677
+ readonly delete?: never;
1678
+ readonly options?: never;
1679
+ readonly head?: never;
1680
+ readonly patch?: never;
1681
+ readonly trace?: never;
1682
+ };
1683
+ readonly "/v1/wallets/{wallet}": {
1684
+ readonly parameters: {
1685
+ readonly query?: never;
1686
+ readonly header?: never;
1687
+ readonly path?: never;
1688
+ readonly cookie?: never;
1689
+ };
1690
+ readonly get?: never;
1691
+ readonly put?: never;
1692
+ readonly post?: never;
1693
+ readonly delete?: never;
1694
+ readonly options?: never;
1695
+ readonly head?: never;
1696
+ /**
1697
+ * Name a wallet, or make it primary
1698
+ * @description Its label (null clears it), and `primary: true` makes it their primary wallet in place of the one that was. Needs `me:write`. Recorded as `user.updated`.
1699
+ */
1700
+ readonly patch: {
1701
+ readonly parameters: {
1702
+ readonly query?: never;
1703
+ readonly header?: never;
1704
+ readonly path: {
1705
+ readonly wallet: string;
1706
+ };
1707
+ readonly cookie?: never;
1708
+ };
1709
+ readonly requestBody: {
1710
+ readonly content: {
1711
+ readonly "application/json": components["schemas"]["WalletUpdate"];
1712
+ };
1713
+ };
1714
+ readonly responses: {
1715
+ /** @description The wallet, changed */
1716
+ readonly 200: {
1717
+ headers: {
1718
+ readonly [name: string]: unknown;
1719
+ };
1720
+ content: {
1721
+ readonly "application/json": components["schemas"]["Wallet"];
1722
+ };
1723
+ };
1724
+ /** @description No access token for this API, or one that is not valid */
1725
+ readonly 401: {
1726
+ headers: {
1727
+ readonly [name: string]: unknown;
1728
+ };
1729
+ content: {
1730
+ readonly "application/problem+json": components["schemas"]["Problem"];
1731
+ };
1732
+ };
1733
+ /** @description The token lacks the scope this route needs */
1734
+ readonly 403: {
1735
+ headers: {
1736
+ readonly [name: string]: unknown;
1737
+ };
1738
+ content: {
1739
+ readonly "application/problem+json": components["schemas"]["Problem"];
1740
+ };
1741
+ };
1742
+ /** @description No such wallet */
1743
+ readonly 404: {
1744
+ headers: {
1745
+ readonly [name: string]: unknown;
1746
+ };
1747
+ content: {
1748
+ readonly "application/problem+json": components["schemas"]["Problem"];
1749
+ };
1750
+ };
1751
+ /** @description Too many requests */
1752
+ readonly 429: {
1753
+ headers: {
1754
+ readonly [name: string]: unknown;
1755
+ };
1756
+ content: {
1757
+ readonly "application/problem+json": components["schemas"]["Problem"];
1758
+ };
1759
+ };
1760
+ };
1761
+ };
1762
+ readonly trace?: never;
1763
+ };
1764
+ }
1765
+ interface components {
1766
+ schemas: {
1767
+ readonly Consent: {
1768
+ /**
1769
+ * Format: date-time
1770
+ * @description When the person first allowed it
1771
+ */
1772
+ readonly allowed_at: string;
1773
+ /** @description Each API's scopes allowed, by the API's identifier */
1774
+ readonly apis: readonly {
1775
+ readonly identifier: string;
1776
+ readonly scopes: readonly string[];
1777
+ }[];
1778
+ readonly app: {
1779
+ /** @example app_01h455vb4pex5vsknk084sn02q */
1780
+ readonly client_id: string;
1781
+ /** @description Its name, for one of the brand’s apps; null for an app known only by its metadata document */
1782
+ readonly name: string | null;
1783
+ };
1784
+ /**
1785
+ * @description The OpenID claims allowed besides what the scopes carry (the `claims` request parameter)
1786
+ * @example []
1787
+ */
1788
+ readonly claims: readonly string[];
1789
+ /** @example cns_01h455vb4pex5vsknk084sn02q */
1790
+ readonly id: string;
1791
+ /**
1792
+ * @description The OpenID scopes allowed
1793
+ * @example [
1794
+ * "openid",
1795
+ * "email"
1796
+ * ]
1797
+ */
1798
+ readonly scopes: readonly string[];
1799
+ /**
1800
+ * Format: date-time
1801
+ * @description When they last allowed it more
1802
+ */
1803
+ readonly updated_at: string;
1804
+ };
1805
+ readonly Identity: {
1806
+ /** Format: date-time */
1807
+ readonly created_at: string;
1808
+ /**
1809
+ * @description Their handle there, without the @, as the provider showed it at their last sign-in with it: X’s, Discord’s, Telegram’s and Matrica’s username. Null where the provider has none. For showing people only: it changes, and never identifies anyone
1810
+ * @example ada
1811
+ */
1812
+ readonly handle: string | null;
1813
+ /** @example idn_01h455vb4pex5vsknk084sn02q */
1814
+ readonly id: string;
1815
+ /** Format: date-time */
1816
+ readonly last_used_at: string | null;
1817
+ /** @description For `email`: whether a password signs in with the address */
1818
+ readonly password?: boolean;
1819
+ /** @example google */
1820
+ readonly provider: string;
1821
+ /** @description Who the person is there: a wallet address (`solana`), their email address (`email`), or the provider’s own id for them */
1822
+ readonly subject: string;
1823
+ };
1824
+ readonly KeyableApi: {
1825
+ /** @example https://api.acme.example */
1826
+ readonly identifier: string;
1827
+ readonly name: string;
1828
+ readonly scopes: readonly {
1829
+ readonly description: string;
1830
+ readonly name: string;
1831
+ }[];
1832
+ };
1833
+ readonly LinkRequest: {
1834
+ /** @description Add these to an authorization request from the same app (its own PKCE, state and redirect URI): the person signs in again as themselves, then uses the method, which joins their account. The request works for 10 minutes, for this person through this app, and only with that sign-in in the browser; it authorizes nothing by itself. */
1835
+ readonly authorization_params: {
1836
+ /** @enum {string} */
1837
+ readonly prompt: "login";
1838
+ /** @enum {string} */
1839
+ readonly synq_intent: "link";
1840
+ readonly synq_link: string;
1841
+ };
1842
+ /** Format: date-time */
1843
+ readonly expires_at: string;
1844
+ /**
1845
+ * @description The way to sign in being added. More are added over time.
1846
+ * @example wallet
1847
+ */
1848
+ readonly method: string;
1849
+ };
1850
+ readonly NewLinkRequest: {
1851
+ /**
1852
+ * @description The way to sign in to add: a Solana wallet, an email address (proved with an emailed code), or an account at a provider the brand offers
1853
+ * @enum {string}
1854
+ */
1855
+ readonly method: "wallet" | "email" | "google" | "microsoft" | "apple" | "facebook" | "x" | "discord" | "telegram" | "matrica";
1856
+ };
1857
+ readonly NewPasskey: {
1858
+ /** @description The new credential, as `PublicKeyCredential.toJSON()` writes it */
1859
+ readonly credential: {
1860
+ readonly [key: string]: unknown;
1861
+ };
1862
+ };
1863
+ readonly NewUserApiKey: components["schemas"]["UserApiKey"] & {
1864
+ /**
1865
+ * @description The key itself, shown this once. Only its hash is kept.
1866
+ * @example ak_live_Ab3dEf…
1867
+ */
1868
+ readonly key: string;
1869
+ };
1870
+ readonly Passkey: {
1871
+ /** @description Whether a synced passkey is backed up now */
1872
+ readonly backed_up: boolean;
1873
+ /** Format: date-time */
1874
+ readonly created_at: string;
1875
+ /** @example pky_01h455vb4pex5vsknk084sn02q */
1876
+ readonly id: string;
1877
+ /** Format: date-time */
1878
+ readonly last_used_at: string | null;
1879
+ /** @description Whether the passkey can leave its device: a synced passkey, kept by a password manager or a platform account */
1880
+ readonly synced: boolean;
1881
+ /**
1882
+ * @example [
1883
+ * "internal",
1884
+ * "hybrid"
1885
+ * ]
1886
+ */
1887
+ readonly transports: readonly string[];
1888
+ };
1889
+ /** @description WebAuthn's `PublicKeyCredentialCreationOptionsJSON`, for `navigator.credentials.create` (through `PublicKeyCredential.parseCreationOptionsFromJSON`). The relying party is this issuer's host; a page on one of the brand's own apps' origins may use it where the browser supports related origins (`/.well-known/webauthn`). Its challenge works for 5 minutes, once, for this person through this app. */
1890
+ readonly PasskeyCreationOptions: {
1891
+ readonly [key: string]: unknown;
1892
+ };
1893
+ readonly Problem: {
1894
+ /** @example insufficient_permissions */
1895
+ readonly code: string;
1896
+ /** @example This key lacks org.brands.edit. */
1897
+ readonly detail?: string;
1898
+ /** @description What was wrong with the request, field by field */
1899
+ readonly errors?: readonly {
1900
+ readonly message: string;
1901
+ readonly path: string;
1902
+ }[];
1903
+ /** @example org.brands.edit */
1904
+ readonly missing_permission?: string;
1905
+ /**
1906
+ * @description Why, for code to read, where a code has several causes
1907
+ * @example public_mailbox
1908
+ */
1909
+ readonly reason?: string;
1910
+ /** @example 403 */
1911
+ readonly status: number;
1912
+ /** @example Insufficient permissions */
1913
+ readonly title: string;
1914
+ /** @example https://docs.synq.build/errors/insufficient_permissions */
1915
+ readonly type: string;
1916
+ };
1917
+ readonly Profile: {
1918
+ /** Format: date-time */
1919
+ readonly created_at: string;
1920
+ /**
1921
+ * Format: date-time
1922
+ * @description When the account will be deleted, if the person asked for it
1923
+ */
1924
+ readonly deletion_scheduled_for: string | null;
1925
+ readonly email: string | null;
1926
+ readonly email_verified: boolean;
1927
+ readonly family_name: string | null;
1928
+ readonly given_name: string | null;
1929
+ readonly locale: string | null;
1930
+ readonly name: string | null;
1931
+ readonly picture: string | null;
1932
+ /** @example usr_01h455vb4pex5vsknk084sn02q */
1933
+ readonly sub: string;
1934
+ readonly username: string | null;
1935
+ };
1936
+ readonly ProfileUpdate: {
1937
+ readonly family_name?: string | null;
1938
+ readonly given_name?: string | null;
1939
+ readonly locale?: string | null;
1940
+ readonly name?: string | null;
1941
+ /** Format: uri */
1942
+ readonly picture?: string | null;
1943
+ readonly username?: string | null;
1944
+ };
1945
+ readonly Session: {
1946
+ readonly amr: readonly string[];
1947
+ /** @description The apps signed in to: their client ids */
1948
+ readonly apps: readonly string[];
1949
+ /** @description Whether this is the session the calling access token came from: the device making the call */
1950
+ readonly current: boolean;
1951
+ /** Format: date-time */
1952
+ readonly expires_at: string | null;
1953
+ readonly id: string;
1954
+ /** Format: date-time */
1955
+ readonly signed_in_at: string | null;
1956
+ /**
1957
+ * @description Where it was signed in: the brand's hosted page, or an app's own screens, whose session no browser holds
1958
+ * @enum {string}
1959
+ */
1960
+ readonly via: "hosted" | "app";
1961
+ };
1962
+ readonly SignIn: {
1963
+ readonly amr: readonly string[];
1964
+ /** @description The client id of the app signed in to */
1965
+ readonly app: string;
1966
+ /** Format: date-time */
1967
+ readonly at: string;
1968
+ /** @example email */
1969
+ readonly provider: string;
1970
+ };
1971
+ readonly UserApiKey: {
1972
+ readonly api: {
1973
+ /** @example https://api.acme.example */
1974
+ readonly identifier: string;
1975
+ readonly name: string;
1976
+ };
1977
+ /** Format: date-time */
1978
+ readonly created_at: string;
1979
+ /** Format: date-time */
1980
+ readonly expires_at: string | null;
1981
+ /** @example uak_01h455vb4pex5vsknk084sn02q */
1982
+ readonly id: string;
1983
+ /**
1984
+ * Format: date-time
1985
+ * @description When its API last checked it, to the minute
1986
+ */
1987
+ readonly last_used_at: string | null;
1988
+ /** @example Reports script */
1989
+ readonly name: string;
1990
+ /**
1991
+ * @description The start of the key, to tell keys apart
1992
+ * @example ak_live_Ab3d
1993
+ */
1994
+ readonly prefix: string;
1995
+ /** Format: date-time */
1996
+ readonly revoked_at: string | null;
1997
+ /**
1998
+ * @description What it may do: scopes of its API (one the API drops leaves every key)
1999
+ * @example [
2000
+ * "reports:read"
2001
+ * ]
2002
+ */
2003
+ readonly scopes: readonly string[];
2004
+ };
2005
+ readonly UserApiKeyCreate: {
2006
+ /**
2007
+ * @description The API's identifier, one `GET /v1/apis` lists
2008
+ * @example https://api.acme.example
2009
+ */
2010
+ readonly api: string;
2011
+ /**
2012
+ * Format: date-time
2013
+ * @description When it stops working, within 366 days; never, when not given
2014
+ */
2015
+ readonly expires_at?: string;
2016
+ /** @example Reports script */
2017
+ readonly name: string;
2018
+ /**
2019
+ * @description What it may do: scopes the API defines
2020
+ * @example [
2021
+ * "reports:read"
2022
+ * ]
2023
+ */
2024
+ readonly scopes: readonly string[];
2025
+ };
2026
+ readonly UsernameAvailability: {
2027
+ readonly available: boolean;
2028
+ /** @enum {string|null} */
2029
+ readonly reason: "format" | "taken" | null;
2030
+ readonly username: string;
2031
+ };
2032
+ readonly Wallet: {
2033
+ /** @example seedYs9i7pN9W4yJ5wUZn3tqxV4o5fH8sZ7mJm6dRKA */
2034
+ readonly address: string;
2035
+ /** Format: date-time */
2036
+ readonly created_at: string;
2037
+ /** @example idn_01h455vb4pex5vsknk084sn02q */
2038
+ readonly id: string;
2039
+ /** @description What the person calls it */
2040
+ readonly label: string | null;
2041
+ /** Format: date-time */
2042
+ readonly last_used_at: string | null;
2043
+ /** @description Their primary wallet: at most one is */
2044
+ readonly primary: boolean;
2045
+ };
2046
+ readonly WalletUpdate: {
2047
+ readonly label?: string | null;
2048
+ /**
2049
+ * @description Makes it their primary wallet, in place of the one that was
2050
+ * @enum {boolean}
2051
+ */
2052
+ readonly primary?: true;
2053
+ };
2054
+ };
2055
+ responses: never;
2056
+ parameters: never;
2057
+ requestBodies: never;
2058
+ headers: never;
2059
+ pathItems: never;
2060
+ }
2061
+ type operations = Record<string, never>;
2062
+ //#endregion
2063
+ //#region src/account.d.ts
2064
+ type Schemas = components['schemas'];
2065
+ /** The signed-in person's profile, as the account API answers it. */
2066
+ type AccountProfile = Schemas['Profile'];
2067
+ /** What `user.update()` may change: only the fields given. */
2068
+ type AccountProfileUpdate = Schemas['ProfileUpdate'];
2069
+ /** One of the person's wallets. */
2070
+ type AccountWallet = Schemas['Wallet'];
2071
+ /** What `wallets.update()` may change: the label, or making it primary. */
2072
+ type AccountWalletUpdate = Schemas['WalletUpdate'];
2073
+ /** One of the person's ways to sign in: a wallet, an email address or a provider's account. */
2074
+ type AccountIdentity = Schemas['Identity'];
2075
+ /** One of the person's sessions at the brand; `current` marks the one the call came from. */
2076
+ type AccountSession = Schemas['Session'];
2077
+ /** One recent sign-in: when, how and to which app. */
2078
+ type AccountSignIn = Schemas['SignIn'];
2079
+ /** What the person allowed an app outside the brand's own to do. */
2080
+ type AccountConsent = Schemas['Consent'];
2081
+ /** One of the person's passkeys. */
2082
+ type AccountPasskey = Schemas['Passkey'];
2083
+ /** A link request: the sign-in that adds a way in carries its `authorization_params`. */
2084
+ type AccountLinkRequest = Schemas['LinkRequest'];
2085
+ /** Whether a username is free for the person to take, and why not. */
2086
+ type AccountUsernameAvailability = Schemas['UsernameAvailability'];
2087
+ /** A way to sign in a link request can add. */
2088
+ type LinkMethod = Schemas['NewLinkRequest']['method'];
2089
+ /** One of the person's API keys for the brand's APIs (AERO-1693): never the key itself. */
2090
+ type AccountApiKey = Schemas['UserApiKey'];
2091
+ /** A new API key: `key` is the key itself, in this answer only. */
2092
+ type AccountNewApiKey = Schemas['NewUserApiKey'];
2093
+ /** What `apiKeys.create()` takes: the API's identifier, a name, its scopes, and an expiry if any. */
2094
+ type AccountApiKeyCreate = Schemas['UserApiKeyCreate'];
2095
+ /** An API the person may make keys for, with the scopes it defines. */
2096
+ type AccountKeyableApi = Schemas['KeyableApi'];
2097
+ /** A call's outcome: its data, or the `SynqError` it failed with (branch on `error.code`). */
2098
+ type AccountResult<T> = {
2099
+ readonly data: T;
2100
+ readonly error: null;
2101
+ } | {
2102
+ readonly data: null;
2103
+ readonly error: SynqError;
2104
+ };
2105
+ /** What every change takes. */
2106
+ interface ChangeOptions {
2107
+ /** Sent as `Idempotency-Key`. One is made for each call when left out; pass your own to send a call again after a lost answer. */
2108
+ idempotencyKey?: string;
2109
+ signal?: AbortSignal;
2110
+ }
2111
+ /** What every read takes. */
2112
+ interface ReadOptions {
2113
+ signal?: AbortSignal;
2114
+ }
2115
+ /** What `createAccountClient` takes. */
2116
+ interface AccountClientOptions {
2117
+ /** The brand's issuer URL, as for `createSynqClient`. */
2118
+ issuer: string | URL;
2119
+ /**
2120
+ * The access token for the account API, a token Synq issued for the
2121
+ * resource `accountApiUrl(issuer)`. Pass a `SynqClient`'s `getAccessToken`
2122
+ * when that client's `resource` is the account API, so the token refreshes
2123
+ * on its own.
2124
+ */
2125
+ accessToken: () => string | Promise<string>;
2126
+ /** The `fetch` to call Synq with: the global one by default. */
2127
+ fetch?: typeof fetch;
2128
+ }
2129
+ /** The brand's account API for the signed-in person, as `createAccountClient` makes it: every call answers `{ data, error }`. */
2130
+ interface AccountClient {
2131
+ /** Who is signed in: their profile. */
2132
+ me: (options?: ReadOptions) => Promise<AccountResult<AccountProfile>>;
2133
+ user: {
2134
+ /** Changes their profile: only the fields given. */
2135
+ update: (changes: AccountProfileUpdate, options?: ChangeOptions) => Promise<AccountResult<AccountProfile>>;
2136
+ /** What the brand keeps for them (the brand's servers write it, through the management API). */
2137
+ metadata: (options?: ReadOptions) => Promise<AccountResult<Record<string, unknown>>>;
2138
+ /** Whether a username is free for them to take. */
2139
+ usernameAvailable: (username: string, options?: ReadOptions) => Promise<AccountResult<AccountUsernameAvailability>>;
2140
+ };
2141
+ wallets: {
2142
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountWallet[]>>;
2143
+ /** Names a wallet, or makes it their primary one. */
2144
+ update: (wallet: string, changes: AccountWalletUpdate, options?: ChangeOptions) => Promise<AccountResult<AccountWallet>>;
2145
+ /** Removes a wallet: it is one of their ways to sign in, so its identity goes. */
2146
+ remove: (wallet: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2147
+ };
2148
+ accounts: {
2149
+ /** Their ways to sign in: wallets, email, providers. */
2150
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountIdentity[]>>;
2151
+ /**
2152
+ * Starts adding a way to sign in: send them to sign in from the same
2153
+ * app with `linkSignIn(answer)`, as `client.signIn(linkSignIn(answer))`.
2154
+ */
2155
+ link: (method: LinkMethod, options?: ChangeOptions) => Promise<AccountResult<AccountLinkRequest>>;
2156
+ /** Removes a way to sign in; the last one can't go (`last_sign_in_method`). */
2157
+ unlink: (identity: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2158
+ };
2159
+ sessions: {
2160
+ /** Where they are signed in; `current` marks this one. */
2161
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountSession[]>>;
2162
+ /** Signs that session out, at every app in it. */
2163
+ revoke: (session: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2164
+ };
2165
+ passkeys: {
2166
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountPasskey[]>>;
2167
+ /** WebAuthn creation options, for `navigator.credentials.create`. */
2168
+ registrationOptions: (options?: ChangeOptions) => Promise<AccountResult<Record<string, unknown>>>;
2169
+ /** Adds the passkey `navigator.credentials.create` made, as `credential.toJSON()` writes it. */
2170
+ register: (credential: Record<string, unknown>, options?: ChangeOptions) => Promise<AccountResult<AccountPasskey>>;
2171
+ remove: (passkey: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2172
+ };
2173
+ consents: {
2174
+ /** What they allowed apps outside the brand's own to do. */
2175
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountConsent[]>>;
2176
+ withdraw: (consent: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2177
+ };
2178
+ /**
2179
+ * Their API keys for the brand's own APIs (AERO-1693): what a script of
2180
+ * theirs sends the brand's API in place of an access token.
2181
+ */
2182
+ apiKeys: {
2183
+ /** The brand's APIs that let them make keys, with each scope it defines. */
2184
+ apis: (options?: ReadOptions) => Promise<AccountResult<readonly AccountKeyableApi[]>>;
2185
+ /** Their keys, revoked and expired ones too; never a key itself. */
2186
+ list: (options?: ReadOptions) => Promise<AccountResult<readonly AccountApiKey[]>>;
2187
+ /**
2188
+ * Makes a key: its `key` is in this answer only, so show it once. Needs
2189
+ * a sign-in from the last 5 minutes (`fresh_sign_in_required`: sign in
2190
+ * again with `maxAge: 300`).
2191
+ */
2192
+ create: (input: AccountApiKeyCreate, options?: ChangeOptions) => Promise<AccountResult<AccountNewApiKey>>;
2193
+ /** Revokes a key at once. */
2194
+ revoke: (key: string, options?: ChangeOptions) => Promise<AccountResult<null>>;
2195
+ };
2196
+ /** Their recent sign-ins, newest first. */
2197
+ activity: (options?: ReadOptions) => Promise<AccountResult<readonly AccountSignIn[]>>;
2198
+ deletion: {
2199
+ /** Asks for the account to be deleted, after the grace period: `me().deletion_scheduled_for` says when. */
2200
+ schedule: (options?: ChangeOptions) => Promise<AccountResult<unknown>>;
2201
+ /** Takes the request back while the grace period lasts. */
2202
+ cancel: (options?: ChangeOptions) => Promise<AccountResult<unknown>>;
2203
+ };
2204
+ }
2205
+ /**
2206
+ * The sign-in that finishes a link request, for `SynqClient.signIn` or
2207
+ * `authorizationUrl`: a fresh sign-in (`prompt=login`) carrying the request.
2208
+ */
2209
+ export declare function linkSignIn(request: AccountLinkRequest): AuthorizationUrlOptions;
2210
+ /** The account API's URL for a brand: the resource its access tokens are for. */
2211
+ export declare function accountApiUrl(issuer: string | URL): string;
2212
+ /** A client for the brand's account API, for an app that holds its own session: everything the signed-in person can do to their own account. */
2213
+ export declare function createAccountClient(options: AccountClientOptions): AccountClient;
2214
+ //#endregion
2215
+ export { type AccountApiKey, type AccountApiKeyCreate, type AccountClient, type AccountClientOptions, type components as AccountComponents, type AccountConsent, type AccountIdentity, type AccountKeyableApi, type AccountLinkRequest, type AccountNewApiKey, type operations as AccountOperations, type AccountPasskey, type paths as AccountPaths, type AccountProfile, type AccountProfileUpdate, type AccountResult, type AccountSession, type AccountSignIn, type AccountUsernameAvailability, type AccountWallet, type AccountWalletUpdate, type AuthorizationUrlOptions, CHALLENGE_METHODS, CHALLENGE_PROBLEMS, type ChallengeMethod, type ChallengeProblem, type ChangeOptions, type DeniedReason, ERROR_CODES, type IdTokenClaims, type LinkMethod, type components$1 as ManagementComponents, type operations$1 as ManagementOperations, type paths$1 as ManagementPaths, type OAuthErrorCode, type PasskeyAssertionJSON, type PasskeyRequestOptionsJSON, type Problem, type ReadOptions, type RedirectReason, type SavedSignIn, type ServerSignInOptions, type Session, type SessionEvent, SignInFlow, type SignInFlowStep, type SignInStepResult, type SignOutOptions, type StartSignInOptions, type SynqAnyErrorCode, type SynqClient, type SynqClientErrorCode, type SynqClientOptions, SynqError, type SynqErrorCode, type SynqStorage, browserLocalStorage, browserSessionStorage, createSynqClient, isSynqError, memoryStorage, problemError };