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