@nhost/nhost-js 3.3.0 → 4.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.
Files changed (147) hide show
  1. package/README.md +68 -32
  2. package/dist/fetch-2PHmQBIJ.mjs +61 -0
  3. package/dist/fetch-2PHmQBIJ.mjs.map +1 -0
  4. package/dist/fetch-DWXwEnoe.js +2 -0
  5. package/dist/fetch-DWXwEnoe.js.map +1 -0
  6. package/dist/nhost-js/auth.cjs.js +2 -0
  7. package/dist/nhost-js/auth.cjs.js.map +1 -0
  8. package/dist/nhost-js/auth.es.js +917 -0
  9. package/dist/nhost-js/auth.es.js.map +1 -0
  10. package/dist/nhost-js/fetch.cjs.js +2 -0
  11. package/dist/nhost-js/fetch.cjs.js.map +1 -0
  12. package/dist/nhost-js/fetch.es.js +90 -0
  13. package/dist/nhost-js/fetch.es.js.map +1 -0
  14. package/dist/nhost-js/functions.cjs.js +2 -0
  15. package/dist/nhost-js/functions.cjs.js.map +1 -0
  16. package/dist/nhost-js/functions.es.js +45 -0
  17. package/dist/nhost-js/functions.es.js.map +1 -0
  18. package/dist/nhost-js/graphql.cjs.js +2 -0
  19. package/dist/nhost-js/graphql.cjs.js.map +1 -0
  20. package/dist/nhost-js/graphql.es.js +48 -0
  21. package/dist/nhost-js/graphql.es.js.map +1 -0
  22. package/dist/nhost-js/session.cjs.js +2 -0
  23. package/dist/nhost-js/session.cjs.js.map +1 -0
  24. package/dist/nhost-js/session.es.js +234 -0
  25. package/dist/nhost-js/session.es.js.map +1 -0
  26. package/dist/nhost-js/storage.cjs.js +2 -0
  27. package/dist/nhost-js/storage.cjs.js.map +1 -0
  28. package/dist/nhost-js/storage.es.js +324 -0
  29. package/dist/nhost-js/storage.es.js.map +1 -0
  30. package/dist/nhost-js.cjs.js +2 -0
  31. package/dist/nhost-js.cjs.js.map +1 -0
  32. package/dist/nhost-js.es.js +228 -0
  33. package/dist/nhost-js.es.js.map +1 -0
  34. package/dist/nhost-js.umd.js +2 -0
  35. package/dist/nhost-js.umd.js.map +1 -0
  36. package/dist/refreshSession-Bw715ZmX.js +2 -0
  37. package/dist/refreshSession-Bw715ZmX.js.map +1 -0
  38. package/dist/refreshSession-WwGlzgtM.mjs +95 -0
  39. package/dist/refreshSession-WwGlzgtM.mjs.map +1 -0
  40. package/dist/src/auth/client.d.ts +1763 -0
  41. package/dist/src/auth/client.d.ts.map +1 -0
  42. package/dist/src/auth/client.js +1043 -0
  43. package/dist/src/auth/client.js.map +1 -0
  44. package/dist/src/auth/index.d.ts +35 -0
  45. package/dist/src/auth/index.d.ts.map +1 -0
  46. package/dist/src/auth/index.js +35 -0
  47. package/dist/src/auth/index.js.map +1 -0
  48. package/dist/src/fetch/fetch.d.ts +88 -0
  49. package/dist/src/fetch/fetch.d.ts.map +1 -0
  50. package/dist/src/fetch/fetch.js +98 -0
  51. package/dist/src/fetch/fetch.js.map +1 -0
  52. package/dist/src/fetch/index.d.ts +38 -0
  53. package/dist/src/fetch/index.d.ts.map +1 -0
  54. package/dist/src/fetch/index.js +38 -0
  55. package/dist/src/fetch/index.js.map +1 -0
  56. package/dist/src/fetch/middlewareAttachAccessToken.d.ts +24 -0
  57. package/dist/src/fetch/middlewareAttachAccessToken.d.ts.map +1 -0
  58. package/dist/src/fetch/middlewareAttachAccessToken.js +54 -0
  59. package/dist/src/fetch/middlewareAttachAccessToken.js.map +1 -0
  60. package/dist/src/fetch/middlewareSessionRefresh.d.ts +30 -0
  61. package/dist/src/fetch/middlewareSessionRefresh.d.ts.map +1 -0
  62. package/dist/src/fetch/middlewareSessionRefresh.js +61 -0
  63. package/dist/src/fetch/middlewareSessionRefresh.js.map +1 -0
  64. package/dist/src/fetch/middlewareUpdateSessionFromResponse.d.ts +26 -0
  65. package/dist/src/fetch/middlewareUpdateSessionFromResponse.d.ts.map +1 -0
  66. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js +79 -0
  67. package/dist/src/fetch/middlewareUpdateSessionFromResponse.js.map +1 -0
  68. package/dist/src/functions/client.d.ts +52 -0
  69. package/dist/src/functions/client.d.ts.map +1 -0
  70. package/dist/src/functions/client.js +89 -0
  71. package/dist/src/functions/client.js.map +1 -0
  72. package/dist/src/functions/index.d.ts +43 -0
  73. package/dist/src/functions/index.d.ts.map +1 -0
  74. package/dist/src/functions/index.js +43 -0
  75. package/dist/src/functions/index.js.map +1 -0
  76. package/dist/src/graphql/client.d.ts +93 -0
  77. package/dist/src/graphql/client.d.ts.map +1 -0
  78. package/dist/src/graphql/client.js +66 -0
  79. package/dist/src/graphql/client.js.map +1 -0
  80. package/dist/src/graphql/index.d.ts +65 -0
  81. package/dist/src/graphql/index.d.ts.map +1 -0
  82. package/dist/src/graphql/index.js +65 -0
  83. package/dist/src/graphql/index.js.map +1 -0
  84. package/dist/src/index.d.ts +35 -0
  85. package/dist/src/index.d.ts.map +1 -0
  86. package/dist/src/index.js +45 -0
  87. package/dist/src/index.js.map +1 -0
  88. package/dist/src/nhost.d.ts +301 -0
  89. package/dist/src/nhost.d.ts.map +1 -0
  90. package/dist/src/nhost.js +323 -0
  91. package/dist/src/nhost.js.map +1 -0
  92. package/dist/src/session/index.d.ts +20 -0
  93. package/dist/src/session/index.d.ts.map +1 -0
  94. package/dist/src/session/index.js +19 -0
  95. package/dist/src/session/index.js.map +1 -0
  96. package/dist/src/session/refreshSession.d.ts +17 -0
  97. package/dist/src/session/refreshSession.d.ts.map +1 -0
  98. package/dist/src/session/refreshSession.js +120 -0
  99. package/dist/src/session/refreshSession.js.map +1 -0
  100. package/dist/src/session/session.d.ts +24 -0
  101. package/dist/src/session/session.d.ts.map +1 -0
  102. package/dist/src/session/session.js +48 -0
  103. package/dist/src/session/session.js.map +1 -0
  104. package/dist/src/session/storage.d.ts +62 -0
  105. package/dist/src/session/storage.d.ts.map +1 -0
  106. package/dist/src/session/storage.js +91 -0
  107. package/dist/src/session/storage.js.map +1 -0
  108. package/dist/src/session/storageBackend.d.ts +122 -0
  109. package/dist/src/session/storageBackend.d.ts.map +1 -0
  110. package/dist/src/session/storageBackend.js +145 -0
  111. package/dist/src/session/storageBackend.js.map +1 -0
  112. package/dist/src/storage/client.d.ts +546 -0
  113. package/dist/src/storage/client.d.ts.map +1 -0
  114. package/dist/src/storage/client.js +368 -0
  115. package/dist/src/storage/client.js.map +1 -0
  116. package/dist/src/storage/index.d.ts +37 -0
  117. package/dist/src/storage/index.d.ts.map +1 -0
  118. package/dist/src/storage/index.js +37 -0
  119. package/dist/src/storage/index.js.map +1 -0
  120. package/dist/tsconfig.tsbuildinfo +1 -0
  121. package/package.json +103 -59
  122. package/dist/clients/auth.d.ts +0 -8
  123. package/dist/clients/auth.d.ts.map +0 -1
  124. package/dist/clients/functions/index.d.ts +0 -107
  125. package/dist/clients/functions/index.d.ts.map +0 -1
  126. package/dist/clients/functions/types.d.ts +0 -28
  127. package/dist/clients/functions/types.d.ts.map +0 -1
  128. package/dist/clients/graphql.d.ts +0 -8
  129. package/dist/clients/graphql.d.ts.map +0 -1
  130. package/dist/clients/index.d.ts +0 -6
  131. package/dist/clients/index.d.ts.map +0 -1
  132. package/dist/clients/nhost.d.ts +0 -83
  133. package/dist/clients/nhost.d.ts.map +0 -1
  134. package/dist/clients/storage.d.ts +0 -8
  135. package/dist/clients/storage.d.ts.map +0 -1
  136. package/dist/index.cjs.js +0 -2
  137. package/dist/index.cjs.js.map +0 -1
  138. package/dist/index.d.ts +0 -6
  139. package/dist/index.d.ts.map +0 -1
  140. package/dist/index.esm.js +0 -356
  141. package/dist/index.esm.js.map +0 -1
  142. package/dist/utils/helpers.d.ts +0 -20
  143. package/dist/utils/helpers.d.ts.map +0 -1
  144. package/dist/utils/types.d.ts +0 -57
  145. package/dist/utils/types.d.ts.map +0 -1
  146. package/umd/nhost-js.umd.js +0 -22
  147. package/umd/nhost-js.umd.js.map +0 -1
@@ -0,0 +1,1763 @@
1
+ /**
2
+ * This file is auto-generated. Do not edit manually.
3
+ */
4
+ import type { ChainFunction, FetchResponse } from "../fetch";
5
+ /**
6
+ * The attestation statement format
7
+ */
8
+ export type AttestationFormat = "packed" | "tpm" | "android-key" | "android-safetynet" | "fido-u2f" | "apple" | "none";
9
+ /**
10
+ * Map of extension outputs from the client
11
+ @property appid? (`boolean`) - Application identifier extension output
12
+ @property credProps? (`CredentialPropertiesOutput`) - Credential properties extension output
13
+ @property hmacCreateSecret? (`boolean`) - HMAC secret extension output*/
14
+ export interface AuthenticationExtensionsClientOutputs {
15
+ /**
16
+ * Application identifier extension output
17
+ */
18
+ appid?: boolean;
19
+ /**
20
+ * Credential properties extension output
21
+ */
22
+ credProps?: CredentialPropertiesOutput;
23
+ /**
24
+ * HMAC secret extension output
25
+ */
26
+ hmacCreateSecret?: boolean;
27
+ }
28
+ /**
29
+ *
30
+ @property clientDataJSON (`string`) - Base64url encoded client data JSON
31
+ @property authenticatorData (`string`) - Base64url encoded authenticator data
32
+ @property signature (`string`) - Base64url encoded assertion signature
33
+ @property userHandle? (`string`) - Base64url encoded user handle*/
34
+ export interface AuthenticatorAssertionResponse {
35
+ /**
36
+ * Base64url encoded client data JSON
37
+ */
38
+ clientDataJSON: string;
39
+ /**
40
+ * Base64url encoded authenticator data
41
+ */
42
+ authenticatorData: string;
43
+ /**
44
+ * Base64url encoded assertion signature
45
+ */
46
+ signature: string;
47
+ /**
48
+ * Base64url encoded user handle
49
+ */
50
+ userHandle?: string;
51
+ }
52
+ /**
53
+ * The authenticator attachment modality
54
+ */
55
+ export type AuthenticatorAttachment = "platform" | "cross-platform";
56
+ /**
57
+ *
58
+ @property clientDataJSON (`string`) - Base64url-encoded binary data
59
+ * Format - byte
60
+ @property transports? (`string[]`) - The authenticator transports
61
+ @property authenticatorData? (`string`) - Base64url-encoded binary data
62
+ * Format - byte
63
+ @property publicKey? (`string`) - Base64url-encoded binary data
64
+ * Format - byte
65
+ @property publicKeyAlgorithm? (`number`) - The public key algorithm identifier
66
+ * Format - int64
67
+ @property attestationObject (`string`) - Base64url-encoded binary data
68
+ * Format - byte*/
69
+ export interface AuthenticatorAttestationResponse {
70
+ /**
71
+ * Base64url-encoded binary data
72
+ * Format - byte
73
+ */
74
+ clientDataJSON: string;
75
+ /**
76
+ * The authenticator transports
77
+ */
78
+ transports?: string[];
79
+ /**
80
+ * Base64url-encoded binary data
81
+ * Format - byte
82
+ */
83
+ authenticatorData?: string;
84
+ /**
85
+ * Base64url-encoded binary data
86
+ * Format - byte
87
+ */
88
+ publicKey?: string;
89
+ /**
90
+ * The public key algorithm identifier
91
+ * Format - int64
92
+ */
93
+ publicKeyAlgorithm?: number;
94
+ /**
95
+ * Base64url-encoded binary data
96
+ * Format - byte
97
+ */
98
+ attestationObject: string;
99
+ }
100
+ /**
101
+ *
102
+ @property authenticatorAttachment? (`AuthenticatorAttachment`) - The authenticator attachment modality
103
+ @property requireResidentKey? (`boolean`) - Whether the authenticator must create a client-side-resident public key credential source
104
+ @property residentKey? (`ResidentKeyRequirement`) - The resident key requirement
105
+ @property userVerification? (`UserVerificationRequirement`) - A requirement for user verification for the operation*/
106
+ export interface AuthenticatorSelection {
107
+ /**
108
+ * The authenticator attachment modality
109
+ */
110
+ authenticatorAttachment?: AuthenticatorAttachment;
111
+ /**
112
+ * Whether the authenticator must create a client-side-resident public key credential source
113
+ */
114
+ requireResidentKey?: boolean;
115
+ /**
116
+ * The resident key requirement
117
+ */
118
+ residentKey?: ResidentKeyRequirement;
119
+ /**
120
+ * A requirement for user verification for the operation
121
+ */
122
+ userVerification?: UserVerificationRequirement;
123
+ }
124
+ /**
125
+ * The authenticator transports that can be used
126
+ */
127
+ export type AuthenticatorTransport = "usb" | "nfc" | "ble" | "smart-card" | "hybrid" | "internal";
128
+ /**
129
+ * The attestation conveyance preference
130
+ */
131
+ export type ConveyancePreference = "none" | "indirect" | "direct" | "enterprise";
132
+ /**
133
+ *
134
+ @property expiresAt (`string`) - Expiration date of the PAT
135
+ * Format - date-time
136
+ @property metadata? (`Record<string, unknown>`) -
137
+ * Example - `{"name":"my-pat","used-by":"my-app-cli"}`*/
138
+ export interface CreatePATRequest {
139
+ /**
140
+ * Expiration date of the PAT
141
+ * Format - date-time
142
+ */
143
+ expiresAt: string;
144
+ /**
145
+ *
146
+ * Example - `{"name":"my-pat","used-by":"my-app-cli"}`
147
+ */
148
+ metadata?: Record<string, unknown>;
149
+ }
150
+ /**
151
+ *
152
+ @property id (`string`) - ID of the PAT
153
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
154
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
155
+ @property personalAccessToken (`string`) - PAT
156
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
157
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b*/
158
+ export interface CreatePATResponse {
159
+ /**
160
+ * ID of the PAT
161
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
162
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
163
+ */
164
+ id: string;
165
+ /**
166
+ * PAT
167
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
168
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
169
+ */
170
+ personalAccessToken: string;
171
+ }
172
+ /**
173
+ *
174
+ @property id (`string`) - The credential's identifier
175
+ @property type (`string`) - The credential type represented by this object
176
+ @property rawId (`string`) - Base64url-encoded binary data
177
+ * Format - byte
178
+ @property clientExtensionResults? (`AuthenticationExtensionsClientOutputs`) - Map of extension outputs from the client
179
+ @property authenticatorAttachment? (`string`) - The authenticator attachment
180
+ @property response (`AuthenticatorAssertionResponse`) - */
181
+ export interface CredentialAssertionResponse {
182
+ /**
183
+ * The credential's identifier
184
+ */
185
+ id: string;
186
+ /**
187
+ * The credential type represented by this object
188
+ */
189
+ type: string;
190
+ /**
191
+ * Base64url-encoded binary data
192
+ * Format - byte
193
+ */
194
+ rawId: string;
195
+ /**
196
+ * Map of extension outputs from the client
197
+ */
198
+ clientExtensionResults?: AuthenticationExtensionsClientOutputs;
199
+ /**
200
+ * The authenticator attachment
201
+ */
202
+ authenticatorAttachment?: string;
203
+ /**
204
+ *
205
+ */
206
+ response: AuthenticatorAssertionResponse;
207
+ }
208
+ /**
209
+ *
210
+ @property id (`string`) - The credential's identifier
211
+ @property type (`string`) - The credential type represented by this object
212
+ @property rawId (`string`) - Base64url-encoded binary data
213
+ * Format - byte
214
+ @property clientExtensionResults? (`AuthenticationExtensionsClientOutputs`) - Map of extension outputs from the client
215
+ @property authenticatorAttachment? (`string`) - The authenticator attachment
216
+ @property response (`AuthenticatorAttestationResponse`) - */
217
+ export interface CredentialCreationResponse {
218
+ /**
219
+ * The credential's identifier
220
+ */
221
+ id: string;
222
+ /**
223
+ * The credential type represented by this object
224
+ */
225
+ type: string;
226
+ /**
227
+ * Base64url-encoded binary data
228
+ * Format - byte
229
+ */
230
+ rawId: string;
231
+ /**
232
+ * Map of extension outputs from the client
233
+ */
234
+ clientExtensionResults?: AuthenticationExtensionsClientOutputs;
235
+ /**
236
+ * The authenticator attachment
237
+ */
238
+ authenticatorAttachment?: string;
239
+ /**
240
+ *
241
+ */
242
+ response: AuthenticatorAttestationResponse;
243
+ }
244
+ /**
245
+ *
246
+ @property type (`CredentialType`) - The valid credential types
247
+ @property alg (`number`) - The cryptographic algorithm identifier*/
248
+ export interface CredentialParameter {
249
+ /**
250
+ * The valid credential types
251
+ */
252
+ type: CredentialType;
253
+ /**
254
+ * The cryptographic algorithm identifier
255
+ */
256
+ alg: number;
257
+ }
258
+ /**
259
+ * Credential properties extension output
260
+ @property rk? (`boolean`) - Indicates if the credential is a resident key*/
261
+ export interface CredentialPropertiesOutput {
262
+ /**
263
+ * Indicates if the credential is a resident key
264
+ */
265
+ rk?: boolean;
266
+ }
267
+ /**
268
+ * The valid credential types
269
+ */
270
+ export type CredentialType = "public-key";
271
+ /**
272
+ * Error code identifying the specific application error
273
+ */
274
+ export type ErrorResponseError = "default-role-must-be-in-allowed-roles" | "disabled-endpoint" | "disabled-user" | "email-already-in-use" | "email-already-verified" | "forbidden-anonymous" | "internal-server-error" | "invalid-email-password" | "invalid-request" | "locale-not-allowed" | "password-too-short" | "password-in-hibp-database" | "redirectTo-not-allowed" | "role-not-allowed" | "signup-disabled" | "unverified-user" | "user-not-anonymous" | "invalid-pat" | "invalid-refresh-token" | "invalid-ticket" | "disabled-mfa-totp" | "no-totp-secret" | "invalid-totp" | "mfa-type-not-found" | "totp-already-active" | "invalid-state" | "oauth-token-echange-failed" | "oauth-profile-fetch-failed" | "oauth-provider-error" | "invalid-otp" | "cannot-send-sms";
275
+ /**
276
+ * Standardized error response
277
+ @property status (`number`) - HTTP status error code
278
+ * Example - `400`
279
+ @property message (`string`) - Human-friendly error message
280
+ * Example - `"Invalid email format"`
281
+ @property error (`ErrorResponseError`) - Error code identifying the specific application error*/
282
+ export interface ErrorResponse {
283
+ /**
284
+ * HTTP status error code
285
+ * Example - `400`
286
+ */
287
+ status: number;
288
+ /**
289
+ * Human-friendly error message
290
+ * Example - `"Invalid email format"`
291
+ */
292
+ message: string;
293
+ /**
294
+ * Error code identifying the specific application error
295
+ */
296
+ error: ErrorResponseError;
297
+ }
298
+ /**
299
+ *
300
+ */
301
+ export type IdTokenProvider = "apple" | "google";
302
+ /**
303
+ * JSON Web Key for JWT verification
304
+ @property alg (`string`) - Algorithm used with this key
305
+ * Example - `"RS256"`
306
+ @property e (`string`) - RSA public exponent
307
+ * Example - `"AQAB"`
308
+ @property kid (`string`) - Key ID
309
+ * Example - `"key-id-1"`
310
+ @property kty (`string`) - Key type
311
+ * Example - `"RSA"`
312
+ @property n (`string`) - RSA modulus
313
+ * Example - `"abcd1234..."`
314
+ @property use (`string`) - Key usage
315
+ * Example - `"sig"`*/
316
+ export interface JWK {
317
+ /**
318
+ * Algorithm used with this key
319
+ * Example - `"RS256"`
320
+ */
321
+ alg: string;
322
+ /**
323
+ * RSA public exponent
324
+ * Example - `"AQAB"`
325
+ */
326
+ e: string;
327
+ /**
328
+ * Key ID
329
+ * Example - `"key-id-1"`
330
+ */
331
+ kid: string;
332
+ /**
333
+ * Key type
334
+ * Example - `"RSA"`
335
+ */
336
+ kty: string;
337
+ /**
338
+ * RSA modulus
339
+ * Example - `"abcd1234..."`
340
+ */
341
+ n: string;
342
+ /**
343
+ * Key usage
344
+ * Example - `"sig"`
345
+ */
346
+ use: string;
347
+ }
348
+ /**
349
+ * JSON Web Key Set for verifying JWT signatures
350
+ @property keys (`JWK[]`) - Array of public keys*/
351
+ export interface JWKSet {
352
+ /**
353
+ * Array of public keys
354
+ */
355
+ keys: JWK[];
356
+ }
357
+ /**
358
+ *
359
+ @property provider (`IdTokenProvider`) -
360
+ @property idToken (`string`) - Apple ID token
361
+ @property nonce? (`string`) - Nonce used during sign in process*/
362
+ export interface LinkIdTokenRequest {
363
+ /**
364
+ *
365
+ */
366
+ provider: IdTokenProvider;
367
+ /**
368
+ * Apple ID token
369
+ */
370
+ idToken: string;
371
+ /**
372
+ * Nonce used during sign in process
373
+ */
374
+ nonce?: string;
375
+ }
376
+ /**
377
+ * Challenge payload for multi-factor authentication
378
+ @property ticket (`string`) - Ticket to use when completing the MFA challenge
379
+ * Example - `"mfaTotp:abc123def456"`*/
380
+ export interface MFAChallengePayload {
381
+ /**
382
+ * Ticket to use when completing the MFA challenge
383
+ * Example - `"mfaTotp:abc123def456"`
384
+ */
385
+ ticket: string;
386
+ }
387
+ /**
388
+ *
389
+ */
390
+ export type OKResponse = "OK";
391
+ /**
392
+ *
393
+ @property redirectTo? (`string`) -
394
+ * Example - `"https://my-app.com/catch-redirection"`
395
+ * Format - uri*/
396
+ export interface OptionsRedirectTo {
397
+ /**
398
+ *
399
+ * Example - `"https://my-app.com/catch-redirection"`
400
+ * Format - uri
401
+ */
402
+ redirectTo?: string;
403
+ }
404
+ /**
405
+ *
406
+ @property rp (`RelyingPartyEntity`) -
407
+ @property user (`UserEntity`) -
408
+ @property challenge (`string`) - Base64url-encoded binary data
409
+ * Format - byte
410
+ @property pubKeyCredParams (`CredentialParameter[]`) - The desired credential types and their respective cryptographic parameters
411
+ @property timeout? (`number`) - A time, in milliseconds, that the caller is willing to wait for the call to complete
412
+ @property excludeCredentials? (`PublicKeyCredentialDescriptor[]`) - A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller
413
+ @property authenticatorSelection? (`AuthenticatorSelection`) -
414
+ @property hints? (`PublicKeyCredentialHints[]`) - Hints to help guide the user through the experience
415
+ @property attestation? (`ConveyancePreference`) - The attestation conveyance preference
416
+ @property attestationFormats? (`AttestationFormat[]`) - The preferred attestation statement formats
417
+ @property extensions? (`Record<string, unknown>`) - Additional parameters requesting additional processing by the client and authenticator*/
418
+ export interface PublicKeyCredentialCreationOptions {
419
+ /**
420
+ *
421
+ */
422
+ rp: RelyingPartyEntity;
423
+ /**
424
+ *
425
+ */
426
+ user: UserEntity;
427
+ /**
428
+ * Base64url-encoded binary data
429
+ * Format - byte
430
+ */
431
+ challenge: string;
432
+ /**
433
+ * The desired credential types and their respective cryptographic parameters
434
+ */
435
+ pubKeyCredParams: CredentialParameter[];
436
+ /**
437
+ * A time, in milliseconds, that the caller is willing to wait for the call to complete
438
+ */
439
+ timeout?: number;
440
+ /**
441
+ * A list of PublicKeyCredentialDescriptor objects representing public key credentials that are not acceptable to the caller
442
+ */
443
+ excludeCredentials?: PublicKeyCredentialDescriptor[];
444
+ /**
445
+ *
446
+ */
447
+ authenticatorSelection?: AuthenticatorSelection;
448
+ /**
449
+ * Hints to help guide the user through the experience
450
+ */
451
+ hints?: PublicKeyCredentialHints[];
452
+ /**
453
+ * The attestation conveyance preference
454
+ */
455
+ attestation?: ConveyancePreference;
456
+ /**
457
+ * The preferred attestation statement formats
458
+ */
459
+ attestationFormats?: AttestationFormat[];
460
+ /**
461
+ * Additional parameters requesting additional processing by the client and authenticator
462
+ */
463
+ extensions?: Record<string, unknown>;
464
+ }
465
+ /**
466
+ *
467
+ @property type (`CredentialType`) - The valid credential types
468
+ @property id (`string`) - Base64url-encoded binary data
469
+ * Format - byte
470
+ @property transports? (`AuthenticatorTransport[]`) - The authenticator transports that can be used*/
471
+ export interface PublicKeyCredentialDescriptor {
472
+ /**
473
+ * The valid credential types
474
+ */
475
+ type: CredentialType;
476
+ /**
477
+ * Base64url-encoded binary data
478
+ * Format - byte
479
+ */
480
+ id: string;
481
+ /**
482
+ * The authenticator transports that can be used
483
+ */
484
+ transports?: AuthenticatorTransport[];
485
+ }
486
+ /**
487
+ * Hints to help guide the user through the experience
488
+ */
489
+ export type PublicKeyCredentialHints = "security-key" | "client-device" | "hybrid";
490
+ /**
491
+ *
492
+ @property challenge (`string`) - Base64url-encoded binary data
493
+ * Format - byte
494
+ @property timeout? (`number`) - A time, in milliseconds, that the caller is willing to wait for the call to complete
495
+ @property rpId? (`string`) - The RP ID the credential should be scoped to
496
+ @property allowCredentials? (`PublicKeyCredentialDescriptor[]`) - A list of CredentialDescriptor objects representing public key credentials acceptable to the caller
497
+ @property userVerification? (`UserVerificationRequirement`) - A requirement for user verification for the operation
498
+ @property hints? (`PublicKeyCredentialHints[]`) - Hints to help guide the user through the experience
499
+ @property extensions? (`Record<string, unknown>`) - Additional parameters requesting additional processing by the client and authenticator*/
500
+ export interface PublicKeyCredentialRequestOptions {
501
+ /**
502
+ * Base64url-encoded binary data
503
+ * Format - byte
504
+ */
505
+ challenge: string;
506
+ /**
507
+ * A time, in milliseconds, that the caller is willing to wait for the call to complete
508
+ */
509
+ timeout?: number;
510
+ /**
511
+ * The RP ID the credential should be scoped to
512
+ */
513
+ rpId?: string;
514
+ /**
515
+ * A list of CredentialDescriptor objects representing public key credentials acceptable to the caller
516
+ */
517
+ allowCredentials?: PublicKeyCredentialDescriptor[];
518
+ /**
519
+ * A requirement for user verification for the operation
520
+ */
521
+ userVerification?: UserVerificationRequirement;
522
+ /**
523
+ * Hints to help guide the user through the experience
524
+ */
525
+ hints?: PublicKeyCredentialHints[];
526
+ /**
527
+ * Additional parameters requesting additional processing by the client and authenticator
528
+ */
529
+ extensions?: Record<string, unknown>;
530
+ }
531
+ /**
532
+ * Request to refresh an access token
533
+ @property refreshToken (`string`) - Refresh token used to generate a new access token
534
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
535
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b*/
536
+ export interface RefreshTokenRequest {
537
+ /**
538
+ * Refresh token used to generate a new access token
539
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
540
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
541
+ */
542
+ refreshToken: string;
543
+ }
544
+ /**
545
+ *
546
+ @property name (`string`) - A human-palatable name for the entity
547
+ @property id (`string`) - A unique identifier for the Relying Party entity, which sets the RP ID*/
548
+ export interface RelyingPartyEntity {
549
+ /**
550
+ * A human-palatable name for the entity
551
+ */
552
+ name: string;
553
+ /**
554
+ * A unique identifier for the Relying Party entity, which sets the RP ID
555
+ */
556
+ id: string;
557
+ }
558
+ /**
559
+ * The resident key requirement
560
+ */
561
+ export type ResidentKeyRequirement = "discouraged" | "preferred" | "required";
562
+ /**
563
+ * User authentication session containing tokens and user information
564
+ @property accessToken (`string`) - JWT token for authenticating API requests
565
+ * Example - `"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."`
566
+ @property accessTokenExpiresIn (`number`) - Expiration time of the access token in seconds
567
+ * Example - `900`
568
+ * Format - int64
569
+ @property refreshTokenId (`string`) - Identifier for the refresh token
570
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
571
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
572
+ @property refreshToken (`string`) - Token used to refresh the access token
573
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
574
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
575
+ @property user? (`User`) - User profile and account information*/
576
+ export interface Session {
577
+ /**
578
+ * JWT token for authenticating API requests
579
+ * Example - `"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."`
580
+ */
581
+ accessToken: string;
582
+ /**
583
+ * Expiration time of the access token in seconds
584
+ * Example - `900`
585
+ * Format - int64
586
+ */
587
+ accessTokenExpiresIn: number;
588
+ /**
589
+ * Identifier for the refresh token
590
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
591
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
592
+ */
593
+ refreshTokenId: string;
594
+ /**
595
+ * Token used to refresh the access token
596
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
597
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
598
+ */
599
+ refreshToken: string;
600
+ /**
601
+ * User profile and account information
602
+ */
603
+ user?: User;
604
+ }
605
+ /**
606
+ * Container for session information
607
+ @property session? (`Session`) - User authentication session containing tokens and user information*/
608
+ export interface SessionPayload {
609
+ /**
610
+ * User authentication session containing tokens and user information
611
+ */
612
+ session?: Session;
613
+ }
614
+ /**
615
+ *
616
+ @property displayName? (`string`) -
617
+ * Example - `"John Smith"`
618
+ @property locale? (`string`) - A two-characters locale
619
+ * Example - `"en"`
620
+ * MinLength - 2
621
+ * MaxLength - 2
622
+ @property metadata? (`Record<string, unknown>`) -
623
+ * Example - `{"firstName":"John","lastName":"Smith"}`*/
624
+ export interface SignInAnonymousRequest {
625
+ /**
626
+ *
627
+ * Example - `"John Smith"`
628
+ */
629
+ displayName?: string;
630
+ /**
631
+ * A two-characters locale
632
+ * Example - `"en"`
633
+ * MinLength - 2
634
+ * MaxLength - 2
635
+ */
636
+ locale?: string;
637
+ /**
638
+ *
639
+ * Example - `{"firstName":"John","lastName":"Smith"}`
640
+ */
641
+ metadata?: Record<string, unknown>;
642
+ }
643
+ /**
644
+ * Request to authenticate using email and password
645
+ @property email (`string`) - User's email address
646
+ * Example - `"john.smith@nhost.io"`
647
+ * Format - email
648
+ @property password (`string`) - User's password
649
+ * Example - `"Str0ngPassw#ord-94|%"`
650
+ * MinLength - 3
651
+ * MaxLength - 50*/
652
+ export interface SignInEmailPasswordRequest {
653
+ /**
654
+ * User's email address
655
+ * Example - `"john.smith@nhost.io"`
656
+ * Format - email
657
+ */
658
+ email: string;
659
+ /**
660
+ * User's password
661
+ * Example - `"Str0ngPassw#ord-94|%"`
662
+ * MinLength - 3
663
+ * MaxLength - 50
664
+ */
665
+ password: string;
666
+ }
667
+ /**
668
+ * Response for email-password authentication that may include a session or MFA challenge
669
+ @property session? (`Session`) - User authentication session containing tokens and user information
670
+ @property mfa? (`MFAChallengePayload`) - Challenge payload for multi-factor authentication*/
671
+ export interface SignInEmailPasswordResponse {
672
+ /**
673
+ * User authentication session containing tokens and user information
674
+ */
675
+ session?: Session;
676
+ /**
677
+ * Challenge payload for multi-factor authentication
678
+ */
679
+ mfa?: MFAChallengePayload;
680
+ }
681
+ /**
682
+ *
683
+ @property provider (`IdTokenProvider`) -
684
+ @property idToken (`string`) - Apple ID token
685
+ @property nonce? (`string`) - Nonce used during sign in process
686
+ @property options? (`SignUpOptions`) - */
687
+ export interface SignInIdTokenRequest {
688
+ /**
689
+ *
690
+ */
691
+ provider: IdTokenProvider;
692
+ /**
693
+ * Apple ID token
694
+ */
695
+ idToken: string;
696
+ /**
697
+ * Nonce used during sign in process
698
+ */
699
+ nonce?: string;
700
+ /**
701
+ *
702
+ */
703
+ options?: SignUpOptions;
704
+ }
705
+ /**
706
+ *
707
+ @property ticket (`string`) - Ticket
708
+ * Pattern - ^mfaTotp:.*$
709
+ @property otp (`string`) - One time password*/
710
+ export interface SignInMfaTotpRequest {
711
+ /**
712
+ * Ticket
713
+ * Pattern - ^mfaTotp:.*$
714
+ */
715
+ ticket: string;
716
+ /**
717
+ * One time password
718
+ */
719
+ otp: string;
720
+ }
721
+ /**
722
+ *
723
+ @property email (`string`) - A valid email
724
+ * Example - `"john.smith@nhost.io"`
725
+ * Format - email
726
+ @property options? (`SignUpOptions`) - */
727
+ export interface SignInOTPEmailRequest {
728
+ /**
729
+ * A valid email
730
+ * Example - `"john.smith@nhost.io"`
731
+ * Format - email
732
+ */
733
+ email: string;
734
+ /**
735
+ *
736
+ */
737
+ options?: SignUpOptions;
738
+ }
739
+ /**
740
+ *
741
+ @property otp (`string`) - One time password
742
+ @property email (`string`) - A valid email
743
+ * Example - `"john.smith@nhost.io"`
744
+ * Format - email*/
745
+ export interface SignInOTPEmailVerifyRequest {
746
+ /**
747
+ * One time password
748
+ */
749
+ otp: string;
750
+ /**
751
+ * A valid email
752
+ * Example - `"john.smith@nhost.io"`
753
+ * Format - email
754
+ */
755
+ email: string;
756
+ }
757
+ /**
758
+ *
759
+ @property session? (`Session`) - User authentication session containing tokens and user information*/
760
+ export interface SignInOTPEmailVerifyResponse {
761
+ /**
762
+ * User authentication session containing tokens and user information
763
+ */
764
+ session?: Session;
765
+ }
766
+ /**
767
+ *
768
+ @property personalAccessToken (`string`) - PAT
769
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
770
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b*/
771
+ export interface SignInPATRequest {
772
+ /**
773
+ * PAT
774
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
775
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
776
+ */
777
+ personalAccessToken: string;
778
+ }
779
+ /**
780
+ *
781
+ @property email (`string`) - A valid email
782
+ * Example - `"john.smith@nhost.io"`
783
+ * Format - email
784
+ @property options? (`SignUpOptions`) - */
785
+ export interface SignInPasswordlessEmailRequest {
786
+ /**
787
+ * A valid email
788
+ * Example - `"john.smith@nhost.io"`
789
+ * Format - email
790
+ */
791
+ email: string;
792
+ /**
793
+ *
794
+ */
795
+ options?: SignUpOptions;
796
+ }
797
+ /**
798
+ *
799
+ @property phoneNumber (`string`) - Phone number of the user
800
+ * Example - `"+123456789"`
801
+ @property otp (`string`) - One-time password received by SMS*/
802
+ export interface SignInPasswordlessSmsOtpRequest {
803
+ /**
804
+ * Phone number of the user
805
+ * Example - `"+123456789"`
806
+ */
807
+ phoneNumber: string;
808
+ /**
809
+ * One-time password received by SMS
810
+ */
811
+ otp: string;
812
+ }
813
+ /**
814
+ *
815
+ @property session? (`Session`) - User authentication session containing tokens and user information
816
+ @property mfa? (`MFAChallengePayload`) - Challenge payload for multi-factor authentication*/
817
+ export interface SignInPasswordlessSmsOtpResponse {
818
+ /**
819
+ * User authentication session containing tokens and user information
820
+ */
821
+ session?: Session;
822
+ /**
823
+ * Challenge payload for multi-factor authentication
824
+ */
825
+ mfa?: MFAChallengePayload;
826
+ }
827
+ /**
828
+ *
829
+ @property phoneNumber (`string`) - Phone number of the user
830
+ * Example - `"+123456789"`
831
+ @property options? (`SignUpOptions`) - */
832
+ export interface SignInPasswordlessSmsRequest {
833
+ /**
834
+ * Phone number of the user
835
+ * Example - `"+123456789"`
836
+ */
837
+ phoneNumber: string;
838
+ /**
839
+ *
840
+ */
841
+ options?: SignUpOptions;
842
+ }
843
+ /**
844
+ *
845
+ @property email? (`string`) - A valid email
846
+ * Example - `"john.smith@nhost.io"`
847
+ * Format - email*/
848
+ export interface SignInWebauthnRequest {
849
+ /**
850
+ * A valid email
851
+ * Example - `"john.smith@nhost.io"`
852
+ * Format - email
853
+ */
854
+ email?: string;
855
+ }
856
+ /**
857
+ *
858
+ @property email? (`string`) - A valid email. Deprecated, no longer used
859
+ * Example - `"john.smith@nhost.io"`
860
+ * Format - email
861
+ @property credential (`CredentialAssertionResponse`) - */
862
+ export interface SignInWebauthnVerifyRequest {
863
+ /**
864
+ * A valid email. Deprecated, no longer used
865
+ * Example - `"john.smith@nhost.io"`
866
+ * Format - email
867
+ */
868
+ email?: string;
869
+ /**
870
+ *
871
+ */
872
+ credential: CredentialAssertionResponse;
873
+ }
874
+ /**
875
+ *
876
+ @property refreshToken? (`string`) - Refresh token for the current session
877
+ @property all? (`boolean`) - Sign out from all connected devices*/
878
+ export interface SignOutRequest {
879
+ /**
880
+ * Refresh token for the current session
881
+ */
882
+ refreshToken?: string;
883
+ /**
884
+ * Sign out from all connected devices
885
+ */
886
+ all?: boolean;
887
+ }
888
+ /**
889
+ * Request to register a new user with email and password
890
+ @property email (`string`) - Email address for the new user account
891
+ * Example - `"john.smith@nhost.io"`
892
+ * Format - email
893
+ @property password (`string`) - Password for the new user account
894
+ * Example - `"Str0ngPassw#ord-94|%"`
895
+ * MinLength - 3
896
+ * MaxLength - 50
897
+ @property options? (`SignUpOptions`) - */
898
+ export interface SignUpEmailPasswordRequest {
899
+ /**
900
+ * Email address for the new user account
901
+ * Example - `"john.smith@nhost.io"`
902
+ * Format - email
903
+ */
904
+ email: string;
905
+ /**
906
+ * Password for the new user account
907
+ * Example - `"Str0ngPassw#ord-94|%"`
908
+ * MinLength - 3
909
+ * MaxLength - 50
910
+ */
911
+ password: string;
912
+ /**
913
+ *
914
+ */
915
+ options?: SignUpOptions;
916
+ }
917
+ /**
918
+ *
919
+ @property allowedRoles? (`string[]`) -
920
+ * Example - `["me","user"]`
921
+ @property defaultRole? (`string`) -
922
+ * Example - `"user"`
923
+ @property displayName? (`string`) -
924
+ * Example - `"John Smith"`
925
+ * Pattern - ^[\p{L}\p{N}\p{S} ,.'-]+$
926
+ * MaxLength - 32
927
+ @property locale? (`string`) - A two-characters locale
928
+ * Example - `"en"`
929
+ * MinLength - 2
930
+ * MaxLength - 2
931
+ @property metadata? (`Record<string, unknown>`) -
932
+ * Example - `{"firstName":"John","lastName":"Smith"}`
933
+ @property redirectTo? (`string`) -
934
+ * Example - `"https://my-app.com/catch-redirection"`
935
+ * Format - uri*/
936
+ export interface SignUpOptions {
937
+ /**
938
+ *
939
+ * Example - `["me","user"]`
940
+ */
941
+ allowedRoles?: string[];
942
+ /**
943
+ *
944
+ * Example - `"user"`
945
+ */
946
+ defaultRole?: string;
947
+ /**
948
+ *
949
+ * Example - `"John Smith"`
950
+ * Pattern - ^[\p{L}\p{N}\p{S} ,.'-]+$
951
+ * MaxLength - 32
952
+ */
953
+ displayName?: string;
954
+ /**
955
+ * A two-characters locale
956
+ * Example - `"en"`
957
+ * MinLength - 2
958
+ * MaxLength - 2
959
+ */
960
+ locale?: string;
961
+ /**
962
+ *
963
+ * Example - `{"firstName":"John","lastName":"Smith"}`
964
+ */
965
+ metadata?: Record<string, unknown>;
966
+ /**
967
+ *
968
+ * Example - `"https://my-app.com/catch-redirection"`
969
+ * Format - uri
970
+ */
971
+ redirectTo?: string;
972
+ }
973
+ /**
974
+ *
975
+ @property email (`string`) - A valid email
976
+ * Example - `"john.smith@nhost.io"`
977
+ * Format - email
978
+ @property options? (`SignUpOptions`) - */
979
+ export interface SignUpWebauthnRequest {
980
+ /**
981
+ * A valid email
982
+ * Example - `"john.smith@nhost.io"`
983
+ * Format - email
984
+ */
985
+ email: string;
986
+ /**
987
+ *
988
+ */
989
+ options?: SignUpOptions;
990
+ }
991
+ /**
992
+ *
993
+ @property credential (`CredentialCreationResponse`) -
994
+ @property options? (`SignUpOptions`) -
995
+ @property nickname? (`string`) - Nickname for the security key*/
996
+ export interface SignUpWebauthnVerifyRequest {
997
+ /**
998
+ *
999
+ */
1000
+ credential: CredentialCreationResponse;
1001
+ /**
1002
+ *
1003
+ */
1004
+ options?: SignUpOptions;
1005
+ /**
1006
+ * Nickname for the security key
1007
+ */
1008
+ nickname?: string;
1009
+ }
1010
+ /**
1011
+ * Response containing TOTP setup information for MFA
1012
+ @property imageUrl (`string`) - URL to QR code image for scanning with an authenticator app
1013
+ * Example - `"data:image/png;base64,iVBORw0KGg..."`
1014
+ @property totpSecret (`string`) - TOTP secret key for manual setup with an authenticator app
1015
+ * Example - `"ABCDEFGHIJK23456"`*/
1016
+ export interface TotpGenerateResponse {
1017
+ /**
1018
+ * URL to QR code image for scanning with an authenticator app
1019
+ * Example - `"data:image/png;base64,iVBORw0KGg..."`
1020
+ */
1021
+ imageUrl: string;
1022
+ /**
1023
+ * TOTP secret key for manual setup with an authenticator app
1024
+ * Example - `"ABCDEFGHIJK23456"`
1025
+ */
1026
+ totpSecret: string;
1027
+ }
1028
+ /**
1029
+ * Base64url-encoded binary data
1030
+ */
1031
+ export type URLEncodedBase64 = string;
1032
+ /**
1033
+ * User profile and account information
1034
+ @property avatarUrl (`string`) - URL to the user's profile picture
1035
+ * Example - `"https://myapp.com/avatars/user123.jpg"`
1036
+ @property createdAt (`string`) - Timestamp when the user account was created
1037
+ * Example - `"2023-01-15T12:34:56Z"`
1038
+ * Format - date-time
1039
+ @property defaultRole (`string`) - Default authorization role for the user
1040
+ * Example - `"user"`
1041
+ @property displayName (`string`) - User's display name
1042
+ * Example - `"John Smith"`
1043
+ @property email? (`string`) - User's email address
1044
+ * Example - `"john.smith@nhost.io"`
1045
+ * Format - email
1046
+ @property emailVerified (`boolean`) - Whether the user's email has been verified
1047
+ * Example - `true`
1048
+ @property id (`string`) - Unique identifier for the user
1049
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
1050
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
1051
+ @property isAnonymous (`boolean`) - Whether this is an anonymous user account
1052
+ * Example - `false`
1053
+ @property locale (`string`) - User's preferred locale (language code)
1054
+ * Example - `"en"`
1055
+ * MinLength - 2
1056
+ * MaxLength - 2
1057
+ @property metadata (`Record<string, unknown>`) - Custom metadata associated with the user
1058
+ * Example - `{"firstName":"John","lastName":"Smith"}`
1059
+ @property phoneNumber? (`string`) - User's phone number
1060
+ * Example - `"+12025550123"`
1061
+ @property phoneNumberVerified (`boolean`) - Whether the user's phone number has been verified
1062
+ * Example - `false`
1063
+ @property roles (`string[]`) - List of roles assigned to the user
1064
+ * Example - `["user","customer"]`
1065
+ @property activeMfaType? (`string`) - Active MFA type for the user*/
1066
+ export interface User {
1067
+ /**
1068
+ * URL to the user's profile picture
1069
+ * Example - `"https://myapp.com/avatars/user123.jpg"`
1070
+ */
1071
+ avatarUrl: string;
1072
+ /**
1073
+ * Timestamp when the user account was created
1074
+ * Example - `"2023-01-15T12:34:56Z"`
1075
+ * Format - date-time
1076
+ */
1077
+ createdAt: string;
1078
+ /**
1079
+ * Default authorization role for the user
1080
+ * Example - `"user"`
1081
+ */
1082
+ defaultRole: string;
1083
+ /**
1084
+ * User's display name
1085
+ * Example - `"John Smith"`
1086
+ */
1087
+ displayName: string;
1088
+ /**
1089
+ * User's email address
1090
+ * Example - `"john.smith@nhost.io"`
1091
+ * Format - email
1092
+ */
1093
+ email?: string;
1094
+ /**
1095
+ * Whether the user's email has been verified
1096
+ * Example - `true`
1097
+ */
1098
+ emailVerified: boolean;
1099
+ /**
1100
+ * Unique identifier for the user
1101
+ * Example - `"2c35b6f3-c4b9-48e3-978a-d4d0f1d42e24"`
1102
+ * Pattern - \b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b
1103
+ */
1104
+ id: string;
1105
+ /**
1106
+ * Whether this is an anonymous user account
1107
+ * Example - `false`
1108
+ */
1109
+ isAnonymous: boolean;
1110
+ /**
1111
+ * User's preferred locale (language code)
1112
+ * Example - `"en"`
1113
+ * MinLength - 2
1114
+ * MaxLength - 2
1115
+ */
1116
+ locale: string;
1117
+ /**
1118
+ * Custom metadata associated with the user
1119
+ * Example - `{"firstName":"John","lastName":"Smith"}`
1120
+ */
1121
+ metadata: Record<string, unknown>;
1122
+ /**
1123
+ * User's phone number
1124
+ * Example - `"+12025550123"`
1125
+ */
1126
+ phoneNumber?: string;
1127
+ /**
1128
+ * Whether the user's phone number has been verified
1129
+ * Example - `false`
1130
+ */
1131
+ phoneNumberVerified: boolean;
1132
+ /**
1133
+ * List of roles assigned to the user
1134
+ * Example - `["user","customer"]`
1135
+ */
1136
+ roles: string[];
1137
+ /**
1138
+ * Active MFA type for the user
1139
+ */
1140
+ activeMfaType?: string;
1141
+ }
1142
+ /**
1143
+ * Which sign-in method to use
1144
+ */
1145
+ export type UserDeanonymizeRequestSignInMethod = "email-password" | "passwordless";
1146
+ /**
1147
+ *
1148
+ @property signInMethod (`UserDeanonymizeRequestSignInMethod`) - Which sign-in method to use
1149
+ @property email (`string`) - A valid email
1150
+ * Example - `"john.smith@nhost.io"`
1151
+ * Format - email
1152
+ @property password? (`string`) - A password of minimum 3 characters
1153
+ * Example - `"Str0ngPassw#ord-94|%"`
1154
+ * MinLength - 3
1155
+ * MaxLength - 50
1156
+ @property connection? (`string`) - Deprecated, will be ignored
1157
+ @property options? (`SignUpOptions`) - */
1158
+ export interface UserDeanonymizeRequest {
1159
+ /**
1160
+ * Which sign-in method to use
1161
+ */
1162
+ signInMethod: UserDeanonymizeRequestSignInMethod;
1163
+ /**
1164
+ * A valid email
1165
+ * Example - `"john.smith@nhost.io"`
1166
+ * Format - email
1167
+ */
1168
+ email: string;
1169
+ /**
1170
+ * A password of minimum 3 characters
1171
+ * Example - `"Str0ngPassw#ord-94|%"`
1172
+ * MinLength - 3
1173
+ * MaxLength - 50
1174
+ */
1175
+ password?: string;
1176
+ /**
1177
+ * Deprecated, will be ignored
1178
+ */
1179
+ connection?: string;
1180
+ /**
1181
+ *
1182
+ */
1183
+ options?: SignUpOptions;
1184
+ }
1185
+ /**
1186
+ *
1187
+ @property newEmail (`string`) - A valid email
1188
+ * Example - `"john.smith@nhost.io"`
1189
+ * Format - email
1190
+ @property options? (`OptionsRedirectTo`) - */
1191
+ export interface UserEmailChangeRequest {
1192
+ /**
1193
+ * A valid email
1194
+ * Example - `"john.smith@nhost.io"`
1195
+ * Format - email
1196
+ */
1197
+ newEmail: string;
1198
+ /**
1199
+ *
1200
+ */
1201
+ options?: OptionsRedirectTo;
1202
+ }
1203
+ /**
1204
+ *
1205
+ @property email (`string`) - A valid email
1206
+ * Example - `"john.smith@nhost.io"`
1207
+ * Format - email
1208
+ @property options? (`OptionsRedirectTo`) - */
1209
+ export interface UserEmailSendVerificationEmailRequest {
1210
+ /**
1211
+ * A valid email
1212
+ * Example - `"john.smith@nhost.io"`
1213
+ * Format - email
1214
+ */
1215
+ email: string;
1216
+ /**
1217
+ *
1218
+ */
1219
+ options?: OptionsRedirectTo;
1220
+ }
1221
+ /**
1222
+ *
1223
+ @property name (`string`) - A human-palatable name for the entity
1224
+ @property displayName (`string`) - A human-palatable name for the user account, intended only for display
1225
+ @property id (`string`) - The user handle of the user account entity*/
1226
+ export interface UserEntity {
1227
+ /**
1228
+ * A human-palatable name for the entity
1229
+ */
1230
+ name: string;
1231
+ /**
1232
+ * A human-palatable name for the user account, intended only for display
1233
+ */
1234
+ displayName: string;
1235
+ /**
1236
+ * The user handle of the user account entity
1237
+ */
1238
+ id: string;
1239
+ }
1240
+ /**
1241
+ * Type of MFA to activate. Use empty string to disable MFA.
1242
+ */
1243
+ export type UserMfaRequestActiveMfaType = "totp" | "";
1244
+ /**
1245
+ * Request to activate or deactivate multi-factor authentication
1246
+ @property code (`string`) - Verification code from the authenticator app when activating MFA
1247
+ * Example - `"123456"`
1248
+ @property activeMfaType? (`UserMfaRequestActiveMfaType`) - Type of MFA to activate. Use empty string to disable MFA.
1249
+ * Example - `"totp"`*/
1250
+ export interface UserMfaRequest {
1251
+ /**
1252
+ * Verification code from the authenticator app when activating MFA
1253
+ * Example - `"123456"`
1254
+ */
1255
+ code: string;
1256
+ /**
1257
+ * Type of MFA to activate. Use empty string to disable MFA.
1258
+ * Example - `"totp"`
1259
+ */
1260
+ activeMfaType?: UserMfaRequestActiveMfaType;
1261
+ }
1262
+ /**
1263
+ *
1264
+ @property newPassword (`string`) - A password of minimum 3 characters
1265
+ * Example - `"Str0ngPassw#ord-94|%"`
1266
+ * MinLength - 3
1267
+ * MaxLength - 50
1268
+ @property ticket? (`string`) - Ticket to reset the password, required if the user is not authenticated
1269
+ * Pattern - ^passwordReset\:.*$*/
1270
+ export interface UserPasswordRequest {
1271
+ /**
1272
+ * A password of minimum 3 characters
1273
+ * Example - `"Str0ngPassw#ord-94|%"`
1274
+ * MinLength - 3
1275
+ * MaxLength - 50
1276
+ */
1277
+ newPassword: string;
1278
+ /**
1279
+ * Ticket to reset the password, required if the user is not authenticated
1280
+ * Pattern - ^passwordReset\:.*$
1281
+ */
1282
+ ticket?: string;
1283
+ }
1284
+ /**
1285
+ *
1286
+ @property email (`string`) - A valid email
1287
+ * Example - `"john.smith@nhost.io"`
1288
+ * Format - email
1289
+ @property options? (`OptionsRedirectTo`) - */
1290
+ export interface UserPasswordResetRequest {
1291
+ /**
1292
+ * A valid email
1293
+ * Example - `"john.smith@nhost.io"`
1294
+ * Format - email
1295
+ */
1296
+ email: string;
1297
+ /**
1298
+ *
1299
+ */
1300
+ options?: OptionsRedirectTo;
1301
+ }
1302
+ /**
1303
+ * A requirement for user verification for the operation
1304
+ */
1305
+ export type UserVerificationRequirement = "required" | "preferred" | "discouraged";
1306
+ /**
1307
+ *
1308
+ @property credential (`CredentialCreationResponse`) -
1309
+ @property nickname? (`string`) - Optional nickname for the security key*/
1310
+ export interface VerifyAddSecurityKeyRequest {
1311
+ /**
1312
+ *
1313
+ */
1314
+ credential: CredentialCreationResponse;
1315
+ /**
1316
+ * Optional nickname for the security key
1317
+ */
1318
+ nickname?: string;
1319
+ }
1320
+ /**
1321
+ *
1322
+ @property id (`string`) - The ID of the newly added security key
1323
+ * Example - `"123e4567-e89b-12d3-a456-426614174000"`
1324
+ @property nickname? (`string`) - The nickname of the security key if provided*/
1325
+ export interface VerifyAddSecurityKeyResponse {
1326
+ /**
1327
+ * The ID of the newly added security key
1328
+ * Example - `"123e4567-e89b-12d3-a456-426614174000"`
1329
+ */
1330
+ id: string;
1331
+ /**
1332
+ * The nickname of the security key if provided
1333
+ */
1334
+ nickname?: string;
1335
+ }
1336
+ /**
1337
+ *
1338
+ @property token? (`string`) - JWT token to verify*/
1339
+ export interface VerifyTokenRequest {
1340
+ /**
1341
+ * JWT token to verify
1342
+ */
1343
+ token?: string;
1344
+ }
1345
+ /**
1346
+ * Target URL for the redirect
1347
+ */
1348
+ export type RedirectToQuery = string;
1349
+ /**
1350
+ *
1351
+ */
1352
+ export type SignInProvider = "apple" | "github" | "google" | "linkedin" | "discord" | "spotify" | "twitch" | "gitlab" | "bitbucket" | "workos" | "azuread" | "strava" | "facebook" | "windowslive" | "twitter";
1353
+ /**
1354
+ * Ticket
1355
+ */
1356
+ export type TicketQuery = string;
1357
+ /**
1358
+ * Type of the ticket
1359
+ */
1360
+ export type TicketTypeQuery = "emailVerify" | "emailConfirmChange" | "signinPasswordless" | "passwordReset";
1361
+ /**
1362
+ *
1363
+ @property version (`string`) - The version of the authentication service
1364
+ * Example - `"1.2.3"`*/
1365
+ export interface GetVersionResponse200 {
1366
+ /**
1367
+ * The version of the authentication service
1368
+ * Example - `"1.2.3"`
1369
+ */
1370
+ version: string;
1371
+ }
1372
+ /**
1373
+ * Parameters for the signInProvider method.
1374
+ @property allowedRoles? (string[]) - Array of allowed roles for the user
1375
+
1376
+ @property defaultRole? (string) - Default role for the user
1377
+
1378
+ @property displayName? (string) - Display name for the user
1379
+
1380
+ @property locale? (string) - A two-characters locale
1381
+
1382
+ @property metadata? (Record<string, unknown>) - Additional metadata for the user (JSON encoded string)
1383
+
1384
+ @property redirectTo? (string) - URI to redirect to
1385
+
1386
+ @property connect? (string) - If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.
1387
+ */
1388
+ export interface SignInProviderParams {
1389
+ /**
1390
+ * Array of allowed roles for the user
1391
+
1392
+ */
1393
+ allowedRoles?: string[];
1394
+ /**
1395
+ * Default role for the user
1396
+
1397
+ */
1398
+ defaultRole?: string;
1399
+ /**
1400
+ * Display name for the user
1401
+
1402
+ */
1403
+ displayName?: string;
1404
+ /**
1405
+ * A two-characters locale
1406
+
1407
+ */
1408
+ locale?: string;
1409
+ /**
1410
+ * Additional metadata for the user (JSON encoded string)
1411
+
1412
+ */
1413
+ metadata?: Record<string, unknown>;
1414
+ /**
1415
+ * URI to redirect to
1416
+
1417
+ */
1418
+ redirectTo?: string;
1419
+ /**
1420
+ * If set, this means that the user is already authenticated and wants to link their account. This needs to be a valid JWT access token.
1421
+
1422
+ */
1423
+ connect?: string;
1424
+ }
1425
+ /**
1426
+ * Parameters for the verifyTicket method.
1427
+ @property ticket (TicketQuery) - Ticket
1428
+
1429
+ * Ticket
1430
+ @property type? (TicketTypeQuery) - Type of the ticket. Deprecated, no longer used
1431
+
1432
+ * Type of the ticket
1433
+ @property redirectTo (RedirectToQuery) - Target URL for the redirect
1434
+
1435
+ * Target URL for the redirect*/
1436
+ export interface VerifyTicketParams {
1437
+ /**
1438
+ * Ticket
1439
+
1440
+ * Ticket
1441
+ */
1442
+ ticket: TicketQuery;
1443
+ /**
1444
+ * Type of the ticket. Deprecated, no longer used
1445
+
1446
+ * Type of the ticket
1447
+ */
1448
+ type?: TicketTypeQuery;
1449
+ /**
1450
+ * Target URL for the redirect
1451
+
1452
+ * Target URL for the redirect
1453
+ */
1454
+ redirectTo: RedirectToQuery;
1455
+ }
1456
+ export interface Client {
1457
+ baseURL: string;
1458
+ pushChainFunction(chainFunction: ChainFunction): void;
1459
+ /**
1460
+ Summary: Get public keys for JWT verification in JWK Set format
1461
+ Retrieve the JSON Web Key Set (JWKS) containing public keys used to verify JWT signatures. This endpoint is used by clients to validate access tokens.
1462
+
1463
+ This method may return different T based on the response code:
1464
+ - 200: JWKSet
1465
+ */
1466
+ getJWKs(options?: RequestInit): Promise<FetchResponse<JWKSet>>;
1467
+ /**
1468
+ Summary: Elevate access for an already signed in user using FIDO2 Webauthn
1469
+ Generate a Webauthn challenge for elevating user permissions
1470
+
1471
+ This method may return different T based on the response code:
1472
+ - 200: PublicKeyCredentialRequestOptions
1473
+ */
1474
+ elevateWebauthn(options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;
1475
+ /**
1476
+ Summary: Verify FIDO2 Webauthn authentication using public-key cryptography for elevation
1477
+ Complete Webauthn elevation by verifying the authentication response
1478
+
1479
+ This method may return different T based on the response code:
1480
+ - 200: SessionPayload
1481
+ */
1482
+ verifyElevateWebauthn(body: SignInWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1483
+ /**
1484
+ Summary: Health check (GET)
1485
+ Verify if the authentication service is operational using GET method
1486
+
1487
+ This method may return different T based on the response code:
1488
+ - 200: OKResponse
1489
+ */
1490
+ healthCheckGet(options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1491
+ /**
1492
+ Summary: Health check (HEAD)
1493
+ Verify if the authentication service is operational using HEAD method
1494
+
1495
+ This method may return different T based on the response code:
1496
+ - 200: void
1497
+ */
1498
+ healthCheckHead(options?: RequestInit): Promise<FetchResponse<void>>;
1499
+ /**
1500
+ Summary: Link a user account with the provider's account using an id token
1501
+ Link the authenticated user's account with an external OAuth provider account using an ID token. Requires elevated permissions.
1502
+
1503
+ This method may return different T based on the response code:
1504
+ - 200: OKResponse
1505
+ */
1506
+ linkIdToken(body: LinkIdTokenRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1507
+ /**
1508
+ Summary: Generate TOTP secret
1509
+ Generate a Time-based One-Time Password (TOTP) secret for setting up multi-factor authentication
1510
+
1511
+ This method may return different T based on the response code:
1512
+ - 200: TotpGenerateResponse
1513
+ */
1514
+ changeUserMfa(options?: RequestInit): Promise<FetchResponse<TotpGenerateResponse>>;
1515
+ /**
1516
+ Summary: Create a Personal Access Token (PAT)
1517
+ Generate a new Personal Access Token for programmatic API access. PATs are long-lived tokens that can be used instead of regular authentication for automated systems. Requires elevated permissions.
1518
+
1519
+ This method may return different T based on the response code:
1520
+ - 200: CreatePATResponse
1521
+ */
1522
+ createPAT(body: CreatePATRequest, options?: RequestInit): Promise<FetchResponse<CreatePATResponse>>;
1523
+ /**
1524
+ Summary: Sign in anonymously
1525
+ Create an anonymous user session without providing credentials. Anonymous users can be converted to regular users later via the deanonymize endpoint.
1526
+
1527
+ This method may return different T based on the response code:
1528
+ - 200: SessionPayload
1529
+ */
1530
+ signInAnonymous(body?: SignInAnonymousRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1531
+ /**
1532
+ Summary: Sign in with email and password
1533
+ Authenticate a user with their email and password. Returns a session object or MFA challenge if two-factor authentication is enabled.
1534
+
1535
+ This method may return different T based on the response code:
1536
+ - 200: SignInEmailPasswordResponse
1537
+ */
1538
+ signInEmailPassword(body: SignInEmailPasswordRequest, options?: RequestInit): Promise<FetchResponse<SignInEmailPasswordResponse>>;
1539
+ /**
1540
+ Summary: Sign in with an ID token
1541
+ Authenticate using an ID token from a supported OAuth provider (Apple or Google). Creates a new user account if one doesn't exist.
1542
+
1543
+ This method may return different T based on the response code:
1544
+ - 200: SessionPayload
1545
+ */
1546
+ signInIdToken(body: SignInIdTokenRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1547
+ /**
1548
+ Summary: Verify TOTP for MFA
1549
+ Complete the multi-factor authentication by verifying a Time-based One-Time Password (TOTP). Returns a session if validation is successful.
1550
+
1551
+ This method may return different T based on the response code:
1552
+ - 200: SessionPayload
1553
+ */
1554
+ verifySignInMfaTotp(body: SignInMfaTotpRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1555
+ /**
1556
+ Summary: Sign in with email OTP
1557
+ Initiate email-based one-time password authentication. Sends an OTP to the specified email address. If the user doesn't exist, a new account will be created with the provided options.
1558
+
1559
+ This method may return different T based on the response code:
1560
+ - 200: OKResponse
1561
+ */
1562
+ signInOTPEmail(body: SignInOTPEmailRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1563
+ /**
1564
+ Summary: Verify email OTP
1565
+ Complete email OTP authentication by verifying the one-time password. Returns a session if validation is successful.
1566
+
1567
+ This method may return different T based on the response code:
1568
+ - 200: SignInOTPEmailVerifyResponse
1569
+ */
1570
+ verifySignInOTPEmail(body: SignInOTPEmailVerifyRequest, options?: RequestInit): Promise<FetchResponse<SignInOTPEmailVerifyResponse>>;
1571
+ /**
1572
+ Summary: Sign in with magic link email
1573
+ Initiate passwordless authentication by sending a magic link to the user's email. If the user doesn't exist, a new account will be created with the provided options.
1574
+
1575
+ This method may return different T based on the response code:
1576
+ - 200: OKResponse
1577
+ */
1578
+ signInPasswordlessEmail(body: SignInPasswordlessEmailRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1579
+ /**
1580
+ Summary: Sign in with SMS OTP
1581
+ Initiate passwordless authentication by sending a one-time password to the user's phone number. If the user doesn't exist, a new account will be created with the provided options.
1582
+
1583
+ This method may return different T based on the response code:
1584
+ - 200: OKResponse
1585
+ */
1586
+ signInPasswordlessSms(body: SignInPasswordlessSmsRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1587
+ /**
1588
+ Summary: Verify SMS OTP
1589
+ Complete passwordless SMS authentication by verifying the one-time password. Returns a session if validation is successful.
1590
+
1591
+ This method may return different T based on the response code:
1592
+ - 200: SignInPasswordlessSmsOtpResponse
1593
+ */
1594
+ verifySignInPasswordlessSms(body: SignInPasswordlessSmsOtpRequest, options?: RequestInit): Promise<FetchResponse<SignInPasswordlessSmsOtpResponse>>;
1595
+ /**
1596
+ Summary: Sign in with Personal Access Token (PAT)
1597
+ Authenticate using a Personal Access Token. PATs are long-lived tokens that can be used for programmatic access to the API.
1598
+
1599
+ This method may return different T based on the response code:
1600
+ - 200: SessionPayload
1601
+ */
1602
+ signInPAT(body: SignInPATRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1603
+ /**
1604
+ Summary: Sign in with an OAuth2 provider
1605
+ Initiate OAuth2 authentication flow with a social provider. Redirects the user to the provider's authorization page.
1606
+
1607
+ As this method is a redirect, it returns a URL string instead of a Promise
1608
+ */
1609
+ signInProviderURL(provider: SignInProvider, params?: SignInProviderParams, options?: RequestInit): string;
1610
+ /**
1611
+ Summary: Sign in with Webauthn
1612
+ Initiate a Webauthn sign-in process by sending a challenge to the user's device. The user must have previously registered a Webauthn credential.
1613
+
1614
+ This method may return different T based on the response code:
1615
+ - 200: PublicKeyCredentialRequestOptions
1616
+ */
1617
+ signInWebauthn(body?: SignInWebauthnRequest, options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialRequestOptions>>;
1618
+ /**
1619
+ Summary: Verify Webauthn sign-in
1620
+ Complete the Webauthn sign-in process by verifying the response from the user's device. Returns a session if validation is successful.
1621
+
1622
+ This method may return different T based on the response code:
1623
+ - 200: SessionPayload
1624
+ */
1625
+ verifySignInWebauthn(body: SignInWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1626
+ /**
1627
+ Summary: Sign out
1628
+ End the current user session by invalidating refresh tokens. Optionally sign out from all devices.
1629
+
1630
+ This method may return different T based on the response code:
1631
+ - 200: OKResponse
1632
+ */
1633
+ signOut(body: SignOutRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1634
+ /**
1635
+ Summary: Sign up with email and password
1636
+ Register a new user account with email and password. Returns a session if email verification is not required, otherwise returns null session.
1637
+
1638
+ This method may return different T based on the response code:
1639
+ - 200: SessionPayload
1640
+ */
1641
+ signUpEmailPassword(body: SignUpEmailPasswordRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1642
+ /**
1643
+ Summary: Sign up with Webauthn
1644
+ Initiate a Webauthn sign-up process by sending a challenge to the user's device. The user must not have an existing account.
1645
+
1646
+ This method may return different T based on the response code:
1647
+ - 200: PublicKeyCredentialCreationOptions
1648
+ */
1649
+ signUpWebauthn(body: SignUpWebauthnRequest, options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;
1650
+ /**
1651
+ Summary: Verify Webauthn sign-up
1652
+ Complete the Webauthn sign-up process by verifying the response from the user's device. Returns a session if validation is successful.
1653
+
1654
+ This method may return different T based on the response code:
1655
+ - 200: SessionPayload
1656
+ */
1657
+ verifySignUpWebauthn(body: SignUpWebauthnVerifyRequest, options?: RequestInit): Promise<FetchResponse<SessionPayload>>;
1658
+ /**
1659
+ Summary: Refresh access token
1660
+ Generate a new JWT access token using a valid refresh token. The refresh token used will be revoked and a new one will be issued.
1661
+
1662
+ This method may return different T based on the response code:
1663
+ - 200: Session
1664
+ */
1665
+ refreshToken(body: RefreshTokenRequest, options?: RequestInit): Promise<FetchResponse<Session>>;
1666
+ /**
1667
+ Summary: Verify JWT token
1668
+ Verify the validity of a JWT access token. If no request body is provided, the Authorization header will be used for verification.
1669
+
1670
+ This method may return different T based on the response code:
1671
+ - 200: string
1672
+ */
1673
+ verifyToken(body?: VerifyTokenRequest, options?: RequestInit): Promise<FetchResponse<string>>;
1674
+ /**
1675
+ Summary: Get user information
1676
+ Retrieve the authenticated user's profile information including roles, metadata, and account status.
1677
+
1678
+ This method may return different T based on the response code:
1679
+ - 200: User
1680
+ */
1681
+ getUser(options?: RequestInit): Promise<FetchResponse<User>>;
1682
+ /**
1683
+ Summary: Deanonymize an anonymous user
1684
+ Convert an anonymous user to a regular user by adding email and optionally password credentials. A confirmation email will be sent if the server is configured to do so.
1685
+
1686
+ This method may return different T based on the response code:
1687
+ - 200: OKResponse
1688
+ */
1689
+ deanonymizeUser(body: UserDeanonymizeRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1690
+ /**
1691
+ Summary: Change user email
1692
+ Request to change the authenticated user's email address. A verification email will be sent to the new address to confirm the change. Requires elevated permissions.
1693
+
1694
+ This method may return different T based on the response code:
1695
+ - 200: OKResponse
1696
+ */
1697
+ changeUserEmail(body: UserEmailChangeRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1698
+ /**
1699
+ Summary: Send verification email
1700
+ Send an email verification link to the specified email address. Used to verify email addresses for new accounts or email changes.
1701
+
1702
+ This method may return different T based on the response code:
1703
+ - 200: OKResponse
1704
+ */
1705
+ sendVerificationEmail(body: UserEmailSendVerificationEmailRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1706
+ /**
1707
+ Summary: Manage multi-factor authentication
1708
+ Activate or deactivate multi-factor authentication for the authenticated user
1709
+
1710
+ This method may return different T based on the response code:
1711
+ - 200: OKResponse
1712
+ */
1713
+ verifyChangeUserMfa(body: UserMfaRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1714
+ /**
1715
+ Summary: Change user password
1716
+ Change the user's password. The user must be authenticated with elevated permissions or provide a valid password reset ticket.
1717
+
1718
+ This method may return different T based on the response code:
1719
+ - 200: OKResponse
1720
+ */
1721
+ changeUserPassword(body: UserPasswordRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1722
+ /**
1723
+ Summary: Request password reset
1724
+ Request a password reset for a user account. An email with a verification link will be sent to the user's email address to complete the password reset process.
1725
+
1726
+ This method may return different T based on the response code:
1727
+ - 200: OKResponse
1728
+ */
1729
+ sendPasswordResetEmail(body: UserPasswordResetRequest, options?: RequestInit): Promise<FetchResponse<OKResponse>>;
1730
+ /**
1731
+ Summary: Initialize adding of a new webauthn security key
1732
+ Start the process of adding a new WebAuthn security key to the user's account. Returns a challenge that must be completed by the user's authenticator device. Requires elevated permissions.
1733
+
1734
+ This method may return different T based on the response code:
1735
+ - 200: PublicKeyCredentialCreationOptions
1736
+ */
1737
+ addSecurityKey(options?: RequestInit): Promise<FetchResponse<PublicKeyCredentialCreationOptions>>;
1738
+ /**
1739
+ Summary: Verify adding of a new webauthn security key
1740
+ Complete the process of adding a new WebAuthn security key by verifying the authenticator response. Requires elevated permissions.
1741
+
1742
+ This method may return different T based on the response code:
1743
+ - 200: VerifyAddSecurityKeyResponse
1744
+ */
1745
+ verifyAddSecurityKey(body: VerifyAddSecurityKeyRequest, options?: RequestInit): Promise<FetchResponse<VerifyAddSecurityKeyResponse>>;
1746
+ /**
1747
+ Summary: Verify email and authentication tickets
1748
+ Verify tickets created by email verification, magic link authentication, or password reset processes. Redirects the user to the appropriate destination upon successful verification.
1749
+
1750
+ As this method is a redirect, it returns a URL string instead of a Promise
1751
+ */
1752
+ verifyTicketURL(params?: VerifyTicketParams, options?: RequestInit): string;
1753
+ /**
1754
+ Summary: Get service version
1755
+ Retrieve version information about the authentication service
1756
+
1757
+ This method may return different T based on the response code:
1758
+ - 200: GetVersionResponse200
1759
+ */
1760
+ getVersion(options?: RequestInit): Promise<FetchResponse<GetVersionResponse200>>;
1761
+ }
1762
+ export declare const createAPIClient: (baseURL: string, chainFunctions?: ChainFunction[]) => Client;
1763
+ //# sourceMappingURL=client.d.ts.map