@data-loom/auth-js 0.0.2-alpha.2 → 0.0.2

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 (137) hide show
  1. package/dist/main/AuthAdminApi.d.ts +4 -0
  2. package/dist/main/AuthAdminApi.d.ts.map +1 -0
  3. package/dist/main/AuthAdminApi.js +9 -0
  4. package/dist/main/AuthAdminApi.js.map +1 -0
  5. package/dist/main/AuthClient.d.ts +4 -0
  6. package/dist/main/AuthClient.d.ts.map +1 -0
  7. package/dist/main/AuthClient.js +9 -0
  8. package/dist/main/AuthClient.js.map +1 -0
  9. package/dist/main/GoTrueAdminApi.d.ts +99 -0
  10. package/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  11. package/dist/main/GoTrueAdminApi.js +268 -0
  12. package/dist/main/GoTrueAdminApi.js.map +1 -0
  13. package/dist/main/GoTrueClient.d.ts +492 -0
  14. package/dist/main/GoTrueClient.d.ts.map +1 -0
  15. package/dist/main/GoTrueClient.js +2227 -0
  16. package/dist/main/GoTrueClient.js.map +1 -0
  17. package/dist/main/index.d.ts +9 -0
  18. package/dist/main/index.d.ts.map +1 -0
  19. package/dist/main/index.js +35 -0
  20. package/dist/main/index.js.map +1 -0
  21. package/dist/main/lib/version.d.ts +2 -0
  22. package/dist/main/lib/version.d.ts.map +1 -0
  23. package/dist/main/lib/version.js +6 -0
  24. package/dist/main/lib/version.js.map +1 -0
  25. package/dist/main/utils/base64url.d.ts +75 -0
  26. package/dist/main/utils/base64url.d.ts.map +1 -0
  27. package/dist/main/utils/base64url.js +270 -0
  28. package/dist/main/utils/base64url.js.map +1 -0
  29. package/dist/main/utils/constants.d.ts +26 -0
  30. package/dist/main/utils/constants.d.ts.map +1 -0
  31. package/dist/main/utils/constants.js +31 -0
  32. package/dist/main/utils/constants.js.map +1 -0
  33. package/dist/main/utils/error-codes.d.ts +7 -0
  34. package/dist/main/utils/error-codes.d.ts.map +1 -0
  35. package/dist/main/utils/error-codes.js +3 -0
  36. package/dist/main/utils/error-codes.js.map +1 -0
  37. package/dist/main/utils/errors.d.ts +100 -0
  38. package/dist/main/utils/errors.d.ts.map +1 -0
  39. package/dist/main/utils/errors.js +137 -0
  40. package/dist/main/utils/errors.js.map +1 -0
  41. package/dist/main/utils/fetch.d.ts +34 -0
  42. package/dist/main/utils/fetch.d.ts.map +1 -0
  43. package/dist/main/utils/fetch.js +195 -0
  44. package/dist/main/utils/fetch.js.map +1 -0
  45. package/dist/main/utils/helpers.d.ts +59 -0
  46. package/dist/main/utils/helpers.d.ts.map +1 -0
  47. package/dist/main/utils/helpers.js +334 -0
  48. package/dist/main/utils/helpers.js.map +1 -0
  49. package/dist/main/utils/local-storage.d.ts +13 -0
  50. package/dist/main/utils/local-storage.d.ts.map +1 -0
  51. package/dist/main/utils/local-storage.js +46 -0
  52. package/dist/main/utils/local-storage.js.map +1 -0
  53. package/dist/main/utils/locks.d.ts +64 -0
  54. package/dist/main/utils/locks.d.ts.map +1 -0
  55. package/dist/main/utils/locks.js +187 -0
  56. package/dist/main/utils/locks.js.map +1 -0
  57. package/dist/main/utils/polyfills.d.ts +5 -0
  58. package/dist/main/utils/polyfills.d.ts.map +1 -0
  59. package/dist/main/utils/polyfills.js +30 -0
  60. package/dist/main/utils/polyfills.js.map +1 -0
  61. package/dist/main/utils/types.d.ts +1074 -0
  62. package/dist/main/utils/types.d.ts.map +1 -0
  63. package/dist/main/utils/types.js +3 -0
  64. package/dist/main/utils/types.js.map +1 -0
  65. package/dist/main/utils/version.d.ts +2 -0
  66. package/dist/main/utils/version.d.ts.map +1 -0
  67. package/dist/main/utils/version.js +6 -0
  68. package/dist/main/utils/version.js.map +1 -0
  69. package/dist/module/AuthAdminApi.d.ts +4 -0
  70. package/dist/module/AuthAdminApi.d.ts.map +1 -0
  71. package/dist/module/AuthAdminApi.js +4 -0
  72. package/dist/module/AuthAdminApi.js.map +1 -0
  73. package/dist/module/AuthClient.d.ts +4 -0
  74. package/dist/module/AuthClient.d.ts.map +1 -0
  75. package/dist/module/AuthClient.js +4 -0
  76. package/dist/module/AuthClient.js.map +1 -0
  77. package/dist/module/GoTrueAdminApi.d.ts +99 -0
  78. package/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  79. package/dist/module/GoTrueAdminApi.js +265 -0
  80. package/dist/module/GoTrueAdminApi.js.map +1 -0
  81. package/dist/module/GoTrueClient.d.ts +492 -0
  82. package/dist/module/GoTrueClient.d.ts.map +1 -0
  83. package/dist/module/GoTrueClient.js +2221 -0
  84. package/dist/module/GoTrueClient.js.map +1 -0
  85. package/dist/module/index.d.ts +9 -0
  86. package/dist/module/index.d.ts.map +1 -0
  87. package/dist/module/index.js +9 -0
  88. package/dist/module/index.js.map +1 -0
  89. package/dist/module/lib/version.d.ts +2 -0
  90. package/dist/module/lib/version.d.ts.map +1 -0
  91. package/dist/module/lib/version.js +3 -0
  92. package/dist/module/lib/version.js.map +1 -0
  93. package/dist/module/utils/base64url.d.ts +75 -0
  94. package/dist/module/utils/base64url.d.ts.map +1 -0
  95. package/dist/module/utils/base64url.js +257 -0
  96. package/dist/module/utils/base64url.js.map +1 -0
  97. package/dist/module/utils/constants.d.ts +26 -0
  98. package/dist/module/utils/constants.d.ts.map +1 -0
  99. package/dist/module/utils/constants.js +28 -0
  100. package/dist/module/utils/constants.js.map +1 -0
  101. package/dist/module/utils/error-codes.d.ts +7 -0
  102. package/dist/module/utils/error-codes.d.ts.map +1 -0
  103. package/dist/module/utils/error-codes.js +2 -0
  104. package/dist/module/utils/error-codes.js.map +1 -0
  105. package/dist/module/utils/errors.d.ts +100 -0
  106. package/dist/module/utils/errors.d.ts.map +1 -0
  107. package/dist/module/utils/errors.js +116 -0
  108. package/dist/module/utils/errors.js.map +1 -0
  109. package/dist/module/utils/fetch.d.ts +34 -0
  110. package/dist/module/utils/fetch.d.ts.map +1 -0
  111. package/dist/module/utils/fetch.js +184 -0
  112. package/dist/module/utils/fetch.js.map +1 -0
  113. package/dist/module/utils/helpers.d.ts +59 -0
  114. package/dist/module/utils/helpers.d.ts.map +1 -0
  115. package/dist/module/utils/helpers.js +288 -0
  116. package/dist/module/utils/helpers.js.map +1 -0
  117. package/dist/module/utils/local-storage.d.ts +13 -0
  118. package/dist/module/utils/local-storage.d.ts.map +1 -0
  119. package/dist/module/utils/local-storage.js +42 -0
  120. package/dist/module/utils/local-storage.js.map +1 -0
  121. package/dist/module/utils/locks.d.ts +64 -0
  122. package/dist/module/utils/locks.d.ts.map +1 -0
  123. package/dist/module/utils/locks.js +179 -0
  124. package/dist/module/utils/locks.js.map +1 -0
  125. package/dist/module/utils/polyfills.d.ts +5 -0
  126. package/dist/module/utils/polyfills.d.ts.map +1 -0
  127. package/dist/module/utils/polyfills.js +26 -0
  128. package/dist/module/utils/polyfills.js.map +1 -0
  129. package/dist/module/utils/types.d.ts +1074 -0
  130. package/dist/module/utils/types.d.ts.map +1 -0
  131. package/dist/module/utils/types.js +2 -0
  132. package/dist/module/utils/types.js.map +1 -0
  133. package/dist/module/utils/version.d.ts +2 -0
  134. package/dist/module/utils/version.d.ts.map +1 -0
  135. package/dist/module/utils/version.js +3 -0
  136. package/dist/module/utils/version.js.map +1 -0
  137. package/package.json +2 -2
@@ -0,0 +1,1074 @@
1
+ import { AuthError } from './errors';
2
+ import { Fetch } from './fetch';
3
+ import type { SolanaSignInInput, SolanaSignInOutput } from '@solana/wallet-standard-features';
4
+ /** One of the providers supported by GoTrue. */
5
+ export type Provider = 'apple' | 'azure' | 'bitbucket' | 'discord' | 'facebook' | 'figma' | 'github' | 'gitlab' | 'google' | 'kakao' | 'keycloak' | 'linkedin' | 'linkedin_oidc' | 'notion' | 'slack' | 'slack_oidc' | 'spotify' | 'twitch' | 'twitter' | 'workos' | 'zoom' | 'fly';
6
+ export type AuthChangeEventMFA = 'MFA_CHALLENGE_VERIFIED';
7
+ export type AuthChangeEvent = 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | AuthChangeEventMFA;
8
+ /**
9
+ * Provide your own global lock implementation instead of the default
10
+ * implementation. The function should acquire a lock for the duration of the
11
+ * `fn` async function, such that no other client instances will be able to
12
+ * hold it at the same time.
13
+ *
14
+ * @experimental
15
+ *
16
+ * @param name Name of the lock to be acquired.
17
+ * @param acquireTimeout If negative, no timeout should occur. If positive it
18
+ * should throw an Error with an `isAcquireTimeout`
19
+ * property set to true if the operation fails to be
20
+ * acquired after this much time (ms).
21
+ * @param fn The operation to execute when the lock is acquired.
22
+ */
23
+ export type LockFunc = <R>(name: string, acquireTimeout: number, fn: () => Promise<R>) => Promise<R>;
24
+ export type GoTrueClientOptions = {
25
+ url?: string;
26
+ headers?: {
27
+ [key: string]: string;
28
+ };
29
+ storageKey?: string;
30
+ detectSessionInUrl?: boolean;
31
+ autoRefreshToken?: boolean;
32
+ persistSession?: boolean;
33
+ storage?: SupportedStorage;
34
+ fetch?: Fetch;
35
+ flowType?: AuthFlowType;
36
+ debug?: boolean | ((message: string, ...args: any[]) => void);
37
+ /**
38
+ * Provide your own locking mechanism based on the environment. By default no locking is done at this time.
39
+ *
40
+ * @experimental
41
+ */
42
+ lock?: LockFunc;
43
+ /**
44
+ * Set to "true" if there is a custom authorization header set globally.
45
+ * @experimental
46
+ */
47
+ hasCustomAuthorizationHeader?: boolean;
48
+ };
49
+ export type WeakPasswordReasons = 'length' | 'characters' | 'pwned' | (string & {});
50
+ export type WeakPassword = {
51
+ reasons: WeakPasswordReasons[];
52
+ message: string;
53
+ };
54
+ export type AuthResponse = {
55
+ data: {
56
+ user: User | null;
57
+ session: Session | null;
58
+ };
59
+ error: null;
60
+ } | {
61
+ data: {
62
+ user: null;
63
+ session: null;
64
+ };
65
+ error: AuthError;
66
+ };
67
+ export type AuthResponsePassword = {
68
+ data: {
69
+ user: User | null;
70
+ session: Session | null;
71
+ weak_password?: WeakPassword | null;
72
+ };
73
+ error: null;
74
+ } | {
75
+ data: {
76
+ user: null;
77
+ session: null;
78
+ };
79
+ error: AuthError;
80
+ };
81
+ /**
82
+ * AuthOtpResponse is returned when OTP is used.
83
+ *
84
+ * {@see AuthResponse}
85
+ */
86
+ export type AuthOtpResponse = {
87
+ data: {
88
+ user: null;
89
+ session: null;
90
+ messageId?: string | null;
91
+ };
92
+ error: null;
93
+ } | {
94
+ data: {
95
+ user: null;
96
+ session: null;
97
+ messageId?: string | null;
98
+ };
99
+ error: AuthError;
100
+ };
101
+ export type AuthTokenResponse = {
102
+ data: {
103
+ user: User;
104
+ session: Session;
105
+ };
106
+ error: null;
107
+ } | {
108
+ data: {
109
+ user: null;
110
+ session: null;
111
+ };
112
+ error: AuthError;
113
+ };
114
+ export type AuthTokenResponsePassword = {
115
+ data: {
116
+ user: User;
117
+ session: Session;
118
+ weakPassword?: WeakPassword;
119
+ };
120
+ error: null;
121
+ } | {
122
+ data: {
123
+ user: null;
124
+ session: null;
125
+ weakPassword?: null;
126
+ };
127
+ error: AuthError;
128
+ };
129
+ export type OAuthResponse = {
130
+ data: {
131
+ provider: Provider;
132
+ url: string;
133
+ };
134
+ error: null;
135
+ } | {
136
+ data: {
137
+ provider: Provider;
138
+ url: null;
139
+ };
140
+ error: AuthError;
141
+ };
142
+ export type SSOResponse = {
143
+ data: {
144
+ /**
145
+ * URL to open in a browser which will complete the sign-in flow by
146
+ * taking the user to the identity provider's authentication flow.
147
+ *
148
+ * On browsers you can set the URL to `window.location.href` to take
149
+ * the user to the authentication flow.
150
+ */
151
+ url: string;
152
+ };
153
+ error: null;
154
+ } | {
155
+ data: null;
156
+ error: AuthError;
157
+ };
158
+ export type UserResponse = {
159
+ data: {
160
+ user: User;
161
+ };
162
+ error: null;
163
+ } | {
164
+ data: {
165
+ user: null;
166
+ };
167
+ error: AuthError;
168
+ };
169
+ export interface Session {
170
+ /**
171
+ * The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.
172
+ */
173
+ provider_token?: string | null;
174
+ /**
175
+ * The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.
176
+ * Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.
177
+ */
178
+ provider_refresh_token?: string | null;
179
+ /**
180
+ * The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.
181
+ */
182
+ access_token: string;
183
+ /**
184
+ * A one-time used refresh token that never expires.
185
+ */
186
+ refresh_token: string;
187
+ /**
188
+ * The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.
189
+ */
190
+ expires_in: number;
191
+ /**
192
+ * A timestamp of when the token will expire. Returned when a login is confirmed.
193
+ */
194
+ expires_at?: number;
195
+ token_type: string;
196
+ user: User;
197
+ }
198
+ /**
199
+ * An authentication methord reference (AMR) entry.
200
+ *
201
+ * An entry designates what method was used by the user to verify their
202
+ * identity and at what time.
203
+ *
204
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}.
205
+ */
206
+ export interface AMREntry {
207
+ /** Authentication method name. */
208
+ method: 'password' | 'otp' | 'oauth' | 'mfa/totp' | (string & {});
209
+ /**
210
+ * Timestamp when the method was successfully used. Represents number of
211
+ * seconds since 1st January 1970 (UNIX epoch) in UTC.
212
+ */
213
+ timestamp: number;
214
+ }
215
+ export interface UserIdentity {
216
+ id: string;
217
+ user_id: string;
218
+ identity_data?: {
219
+ [key: string]: any;
220
+ };
221
+ identity_id: string;
222
+ provider: string;
223
+ created_at?: string;
224
+ last_sign_in_at?: string;
225
+ updated_at?: string;
226
+ }
227
+ /**
228
+ * A MFA factor.
229
+ *
230
+ * @see {@link GoTrueMFAApi#enroll}
231
+ * @see {@link GoTrueMFAApi#listFactors}
232
+ * @see {@link GoTrueMFAAdminApi#listFactors}
233
+ */
234
+ export interface Factor {
235
+ /** ID of the factor. */
236
+ id: string;
237
+ /** Friendly name of the factor, useful to disambiguate between multiple factors. */
238
+ friendly_name?: string;
239
+ /**
240
+ * Type of factor. `totp` and `phone` supported with this version
241
+ */
242
+ factor_type: 'totp' | 'phone' | (string & {});
243
+ /** Factor's status. */
244
+ status: 'verified' | 'unverified';
245
+ created_at: string;
246
+ updated_at: string;
247
+ }
248
+ export interface UserAppMetadata {
249
+ provider?: string;
250
+ [key: string]: any;
251
+ }
252
+ export interface UserMetadata {
253
+ [key: string]: any;
254
+ }
255
+ export interface User {
256
+ id: string;
257
+ app_metadata: UserAppMetadata;
258
+ user_metadata: UserMetadata;
259
+ aud: string;
260
+ confirmation_sent_at?: string;
261
+ recovery_sent_at?: string;
262
+ email_change_sent_at?: string;
263
+ new_email?: string;
264
+ new_phone?: string;
265
+ invited_at?: string;
266
+ action_link?: string;
267
+ email?: string;
268
+ phone?: string;
269
+ created_at: string;
270
+ confirmed_at?: string;
271
+ email_confirmed_at?: string;
272
+ phone_confirmed_at?: string;
273
+ last_sign_in_at?: string;
274
+ role?: string;
275
+ updated_at?: string;
276
+ identities?: UserIdentity[];
277
+ is_anonymous?: boolean;
278
+ is_sso_user?: boolean;
279
+ factors?: Factor[];
280
+ }
281
+ export interface UserAttributes {
282
+ /**
283
+ * The user's email.
284
+ */
285
+ email?: string;
286
+ /**
287
+ * The user's phone.
288
+ */
289
+ phone?: string;
290
+ /**
291
+ * The user's password.
292
+ */
293
+ password?: string;
294
+ /**
295
+ * The nonce sent for reauthentication if the user's password is to be updated.
296
+ *
297
+ * Call reauthenticate() to obtain the nonce first.
298
+ */
299
+ nonce?: string;
300
+ /**
301
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
302
+ *
303
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
304
+ *
305
+ */
306
+ data?: object;
307
+ }
308
+ export interface AdminUserAttributes extends Omit<UserAttributes, 'data'> {
309
+ /**
310
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
311
+ *
312
+ *
313
+ * The `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.
314
+ *
315
+ * Note: When using the GoTrueAdminApi and wanting to modify a user's metadata,
316
+ * this attribute is used instead of UserAttributes data.
317
+ *
318
+ */
319
+ user_metadata?: object;
320
+ /**
321
+ * A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.
322
+ *
323
+ * Only a service role can modify.
324
+ *
325
+ * The `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other
326
+ * access control information.
327
+ */
328
+ app_metadata?: object;
329
+ /**
330
+ * Confirms the user's email address if set to true.
331
+ *
332
+ * Only a service role can modify.
333
+ */
334
+ email_confirm?: boolean;
335
+ /**
336
+ * Confirms the user's phone number if set to true.
337
+ *
338
+ * Only a service role can modify.
339
+ */
340
+ phone_confirm?: boolean;
341
+ /**
342
+ * Determines how long a user is banned for.
343
+ *
344
+ * The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.
345
+ * Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
346
+ *
347
+ * For example, some possible durations include: '300ms', '2h45m'.
348
+ *
349
+ * Setting the ban duration to 'none' lifts the ban on the user.
350
+ */
351
+ ban_duration?: string | 'none';
352
+ /**
353
+ * The `role` claim set in the user's access token JWT.
354
+ *
355
+ * When a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.
356
+ *
357
+ * Setting this role to `service_role` is not recommended as it grants the user admin privileges.
358
+ */
359
+ role?: string;
360
+ /**
361
+ * The `password_hash` for the user's password.
362
+ *
363
+ * Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.
364
+ *
365
+ * Supports bcrypt, scrypt (firebase), and argon2 password hashes.
366
+ */
367
+ password_hash?: string;
368
+ /**
369
+ * The `id` for the user.
370
+ *
371
+ * Allows you to overwrite the default `id` set for the user.
372
+ */
373
+ id?: string;
374
+ }
375
+ export interface Subscription {
376
+ /**
377
+ * The subscriber UUID. This will be set by the client.
378
+ */
379
+ id: string;
380
+ /**
381
+ * The function to call every time there is an event. eg: (eventName) => {}
382
+ */
383
+ callback: (event: AuthChangeEvent, session: Session | null) => void;
384
+ /**
385
+ * Call this to remove the listener.
386
+ */
387
+ unsubscribe: () => void;
388
+ }
389
+ export type SignInAnonymouslyCredentials = {
390
+ options?: {
391
+ /**
392
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
393
+ *
394
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
395
+ */
396
+ data?: object;
397
+ /** Verification token received when the user completes the captcha on the site. */
398
+ captchaToken?: string;
399
+ };
400
+ };
401
+ export type SignUpWithPasswordCredentials = {
402
+ /** The user's email address. */
403
+ email: string;
404
+ /** The user's password. */
405
+ password: string;
406
+ options?: {
407
+ /** The redirect url embedded in the email link */
408
+ emailRedirectTo?: string;
409
+ /**
410
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
411
+ *
412
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
413
+ */
414
+ data?: object;
415
+ /** Verification token received when the user completes the captcha on the site. */
416
+ captchaToken?: string;
417
+ };
418
+ } | {
419
+ /** The user's phone number. */
420
+ phone: string;
421
+ /** The user's password. */
422
+ password: string;
423
+ options?: {
424
+ /**
425
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
426
+ *
427
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
428
+ */
429
+ data?: object;
430
+ /** Verification token received when the user completes the captcha on the site. Requires a configured WhatsApp sender on Twilio */
431
+ captchaToken?: string;
432
+ /** Messaging channel to use (e.g. whatsapp or sms) */
433
+ channel?: 'sms' | 'whatsapp';
434
+ };
435
+ };
436
+ export type SignInWithPasswordCredentials = {
437
+ /** The user's email address. */
438
+ email: string;
439
+ /** The user's password. */
440
+ password: string;
441
+ options?: {
442
+ /** Verification token received when the user completes the captcha on the site. */
443
+ captchaToken?: string;
444
+ };
445
+ } | {
446
+ /** The user's phone number. */
447
+ phone: string;
448
+ /** The user's password. */
449
+ password: string;
450
+ options?: {
451
+ /** Verification token received when the user completes the captcha on the site. */
452
+ captchaToken?: string;
453
+ };
454
+ };
455
+ export type SignInWithPasswordlessCredentials = {
456
+ /** The user's email address. */
457
+ email: string;
458
+ options?: {
459
+ /** The redirect url embedded in the email link */
460
+ emailRedirectTo?: string;
461
+ /** If set to false, this method will not create a new user. Defaults to true. */
462
+ shouldCreateUser?: boolean;
463
+ /**
464
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
465
+ *
466
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
467
+ */
468
+ data?: object;
469
+ /** Verification token received when the user completes the captcha on the site. */
470
+ captchaToken?: string;
471
+ };
472
+ } | {
473
+ /** The user's phone number. */
474
+ phone: string;
475
+ options?: {
476
+ /** If set to false, this method will not create a new user. Defaults to true. */
477
+ shouldCreateUser?: boolean;
478
+ /**
479
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
480
+ *
481
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
482
+ */
483
+ data?: object;
484
+ /** Verification token received when the user completes the captcha on the site. */
485
+ captchaToken?: string;
486
+ /** Messaging channel to use (e.g. whatsapp or sms) */
487
+ channel?: 'sms' | 'whatsapp';
488
+ };
489
+ };
490
+ export type AuthFlowType = 'implicit' | 'pkce';
491
+ export type SignInWithOAuthCredentials = {
492
+ /** One of the providers supported by GoTrue. */
493
+ provider: Provider;
494
+ options?: {
495
+ /** A URL to send the user to after they are confirmed. */
496
+ redirectTo?: string;
497
+ /** A space-separated list of scopes granted to the OAuth application. */
498
+ scopes?: string;
499
+ /** An object of query params */
500
+ queryParams?: {
501
+ [key: string]: string;
502
+ };
503
+ /** If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider. */
504
+ skipBrowserRedirect?: boolean;
505
+ };
506
+ };
507
+ export type SignInWithIdTokenCredentials = {
508
+ /** Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`, `keycloak` (deprecated). */
509
+ provider: 'google' | 'apple' | 'azure' | 'facebook' | 'kakao' | (string & {});
510
+ /** OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token. */
511
+ token: string;
512
+ /** If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token. */
513
+ access_token?: string;
514
+ /** If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token. */
515
+ nonce?: string;
516
+ options?: {
517
+ /** Verification token received when the user completes the captcha on the site. */
518
+ captchaToken?: string;
519
+ };
520
+ };
521
+ export type SolanaWallet = {
522
+ signIn?: (...inputs: SolanaSignInInput[]) => Promise<SolanaSignInOutput | SolanaSignInOutput[]>;
523
+ publicKey?: {
524
+ toBase58: () => string;
525
+ } | null;
526
+ signMessage?: (message: Uint8Array, encoding?: 'utf8' | string) => Promise<Uint8Array> | undefined;
527
+ };
528
+ export type SolanaWeb3Credentials = {
529
+ chain: 'solana';
530
+ /** Wallet interface to use. If not specified will default to `window.solana`. */
531
+ wallet?: SolanaWallet;
532
+ /** Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
533
+ statement?: string;
534
+ options?: {
535
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
536
+ url?: string;
537
+ /** Verification token received when the user completes the captcha on the site. */
538
+ captchaToken?: string;
539
+ signInWithSolana?: Partial<Omit<SolanaSignInInput, 'version' | 'chain' | 'domain' | 'uri' | 'statement'>>;
540
+ };
541
+ } | {
542
+ chain: 'solana';
543
+ /** Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`. */
544
+ message: string;
545
+ /** Ed25519 signature of the message. */
546
+ signature: Uint8Array;
547
+ options?: {
548
+ /** Verification token received when the user completes the captcha on the site. */
549
+ captchaToken?: string;
550
+ };
551
+ };
552
+ export type Web3Credentials = SolanaWeb3Credentials;
553
+ export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams | VerifyTokenHashParams;
554
+ export interface VerifyMobileOtpParams {
555
+ /** The user's phone number. */
556
+ phone: string;
557
+ /** The otp sent to the user's phone number. */
558
+ token: string;
559
+ /** The user's verification type. */
560
+ type: MobileOtpType;
561
+ options?: {
562
+ /** A URL to send the user to after they are confirmed. */
563
+ redirectTo?: string;
564
+ /**
565
+ * Verification token received when the user completes the captcha on the site.
566
+ *
567
+ * @deprecated
568
+ */
569
+ captchaToken?: string;
570
+ };
571
+ }
572
+ export interface VerifyEmailOtpParams {
573
+ /** The user's email address. */
574
+ email: string;
575
+ /** The otp sent to the user's email address. */
576
+ token: string;
577
+ /** The user's verification type. */
578
+ type: EmailOtpType;
579
+ options?: {
580
+ /** A URL to send the user to after they are confirmed. */
581
+ redirectTo?: string;
582
+ /** Verification token received when the user completes the captcha on the site.
583
+ *
584
+ * @deprecated
585
+ */
586
+ captchaToken?: string;
587
+ };
588
+ }
589
+ export interface VerifyTokenHashParams {
590
+ /** The token hash used in an email link */
591
+ token_hash: string;
592
+ /** The user's verification type. */
593
+ type: EmailOtpType;
594
+ }
595
+ export type MobileOtpType = 'sms' | 'phone_change';
596
+ export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email';
597
+ export type ResendParams = {
598
+ type: Extract<EmailOtpType, 'signup' | 'email_change'>;
599
+ email: string;
600
+ options?: {
601
+ /** A URL to send the user to after they have signed-in. */
602
+ emailRedirectTo?: string;
603
+ /** Verification token received when the user completes the captcha on the site. */
604
+ captchaToken?: string;
605
+ };
606
+ } | {
607
+ type: Extract<MobileOtpType, 'sms' | 'phone_change'>;
608
+ phone: string;
609
+ options?: {
610
+ /** Verification token received when the user completes the captcha on the site. */
611
+ captchaToken?: string;
612
+ };
613
+ };
614
+ export type SignInWithSSO = {
615
+ /** UUID of the SSO provider to invoke single-sign on to. */
616
+ providerId: string;
617
+ options?: {
618
+ /** A URL to send the user to after they have signed-in. */
619
+ redirectTo?: string;
620
+ /** Verification token received when the user completes the captcha on the site. */
621
+ captchaToken?: string;
622
+ };
623
+ } | {
624
+ /** Domain name of the organization for which to invoke single-sign on. */
625
+ domain: string;
626
+ options?: {
627
+ /** A URL to send the user to after they have signed-in. */
628
+ redirectTo?: string;
629
+ /** Verification token received when the user completes the captcha on the site. */
630
+ captchaToken?: string;
631
+ };
632
+ };
633
+ export type GenerateSignupLinkParams = {
634
+ type: 'signup';
635
+ email: string;
636
+ password: string;
637
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
638
+ };
639
+ export type GenerateInviteOrMagiclinkParams = {
640
+ type: 'invite' | 'magiclink';
641
+ /** The user's email */
642
+ email: string;
643
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
644
+ };
645
+ export type GenerateRecoveryLinkParams = {
646
+ type: 'recovery';
647
+ /** The user's email */
648
+ email: string;
649
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
650
+ };
651
+ export type GenerateEmailChangeLinkParams = {
652
+ type: 'email_change_current' | 'email_change_new';
653
+ /** The user's email */
654
+ email: string;
655
+ /**
656
+ * The user's new email. Only required if type is 'email_change_current' or 'email_change_new'.
657
+ */
658
+ newEmail: string;
659
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
660
+ };
661
+ export interface GenerateLinkOptions {
662
+ /**
663
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
664
+ *
665
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
666
+ */
667
+ data?: object;
668
+ /** The URL which will be appended to the email link generated. */
669
+ redirectTo?: string;
670
+ }
671
+ export type GenerateLinkParams = GenerateSignupLinkParams | GenerateInviteOrMagiclinkParams | GenerateRecoveryLinkParams | GenerateEmailChangeLinkParams;
672
+ export type GenerateLinkResponse = {
673
+ data: {
674
+ properties: GenerateLinkProperties;
675
+ user: User;
676
+ };
677
+ error: null;
678
+ } | {
679
+ data: {
680
+ properties: null;
681
+ user: null;
682
+ };
683
+ error: AuthError;
684
+ };
685
+ /** The properties related to the email link generated */
686
+ export type GenerateLinkProperties = {
687
+ /**
688
+ * The email link to send to the user.
689
+ * The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
690
+ * */
691
+ action_link: string;
692
+ /**
693
+ * The raw email OTP.
694
+ * You should send this in the email if you want your users to verify using an OTP instead of the action link.
695
+ * */
696
+ email_otp: string;
697
+ /**
698
+ * The hashed token appended to the action link.
699
+ * */
700
+ hashed_token: string;
701
+ /** The URL appended to the action link. */
702
+ redirect_to: string;
703
+ /** The verification type that the email link is associated to. */
704
+ verification_type: GenerateLinkType;
705
+ };
706
+ export type GenerateLinkType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change_current' | 'email_change_new';
707
+ export type MFAEnrollParams = MFAEnrollTOTPParams | MFAEnrollPhoneParams;
708
+ export type MFAUnenrollParams = {
709
+ /** ID of the factor being unenrolled. */
710
+ factorId: string;
711
+ };
712
+ export type MFAVerifyParams = {
713
+ /** ID of the factor being verified. Returned in enroll(). */
714
+ factorId: string;
715
+ /** ID of the challenge being verified. Returned in challenge(). */
716
+ challengeId: string;
717
+ /** Verification code provided by the user. */
718
+ code: string;
719
+ };
720
+ export type MFAChallengeParams = {
721
+ /** ID of the factor to be challenged. Returned in enroll(). */
722
+ factorId: string;
723
+ /** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
724
+ channel?: 'sms' | 'whatsapp';
725
+ };
726
+ export type MFAChallengeAndVerifyParams = {
727
+ /** ID of the factor being verified. Returned in enroll(). */
728
+ factorId: string;
729
+ /** Verification code provided by the user. */
730
+ code: string;
731
+ };
732
+ export type AuthMFAVerifyResponse = {
733
+ data: {
734
+ /** New access token (JWT) after successful verification. */
735
+ access_token: string;
736
+ /** Type of token, typically `Bearer`. */
737
+ token_type: string;
738
+ /** Number of seconds in which the access token will expire. */
739
+ expires_in: number;
740
+ /** Refresh token you can use to obtain new access tokens when expired. */
741
+ refresh_token: string;
742
+ /** Updated user profile. */
743
+ user: User;
744
+ };
745
+ error: null;
746
+ } | {
747
+ data: null;
748
+ error: AuthError;
749
+ };
750
+ export type AuthMFAEnrollResponse = AuthMFAEnrollTOTPResponse | AuthMFAEnrollPhoneResponse;
751
+ export type AuthMFAUnenrollResponse = {
752
+ data: {
753
+ /** ID of the factor that was successfully unenrolled. */
754
+ id: string;
755
+ };
756
+ error: null;
757
+ } | {
758
+ data: null;
759
+ error: AuthError;
760
+ };
761
+ export type AuthMFAChallengeResponse = {
762
+ data: {
763
+ /** ID of the newly created challenge. */
764
+ id: string;
765
+ /** Factor Type which generated the challenge */
766
+ type: 'totp' | 'phone';
767
+ /** Timestamp in UNIX seconds when this challenge will no longer be usable. */
768
+ expires_at: number;
769
+ };
770
+ error: null;
771
+ } | {
772
+ data: null;
773
+ error: AuthError;
774
+ };
775
+ export type AuthMFAListFactorsResponse = {
776
+ data: {
777
+ /** All available factors (verified and unverified). */
778
+ all: Factor[];
779
+ /** Only verified TOTP factors. (A subset of `all`.) */
780
+ totp: Factor[];
781
+ /** Only verified Phone factors. (A subset of `all`.) */
782
+ phone: Factor[];
783
+ };
784
+ error: null;
785
+ } | {
786
+ data: null;
787
+ error: AuthError;
788
+ };
789
+ export type AuthenticatorAssuranceLevels = 'aal1' | 'aal2';
790
+ export type AuthMFAGetAuthenticatorAssuranceLevelResponse = {
791
+ data: {
792
+ /** Current AAL level of the session. */
793
+ currentLevel: AuthenticatorAssuranceLevels | null;
794
+ /**
795
+ * Next possible AAL level for the session. If the next level is higher
796
+ * than the current one, the user should go through MFA.
797
+ *
798
+ * @see {@link GoTrueMFAApi#challenge}
799
+ */
800
+ nextLevel: AuthenticatorAssuranceLevels | null;
801
+ /**
802
+ * A list of all authentication methods attached to this session. Use
803
+ * the information here to detect the last time a user verified a
804
+ * factor, for example if implementing a step-up scenario.
805
+ */
806
+ currentAuthenticationMethods: AMREntry[];
807
+ };
808
+ error: null;
809
+ } | {
810
+ data: null;
811
+ error: AuthError;
812
+ };
813
+ /**
814
+ * Contains the full multi-factor authentication API.
815
+ *
816
+ */
817
+ export interface GoTrueMFAApi {
818
+ /**
819
+ * Starts the enrollment process for a new Multi-Factor Authentication (MFA)
820
+ * factor. This method creates a new `unverified` factor.
821
+ * To verify a factor, present the QR code or secret to the user and ask them to add it to their
822
+ * authenticator app.
823
+ * The user has to enter the code from their authenticator app to verify it.
824
+ *
825
+ * Upon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.
826
+ *
827
+ */
828
+ enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>;
829
+ enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>;
830
+ enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>;
831
+ /**
832
+ * Prepares a challenge used to verify that a user has access to a MFA
833
+ * factor.
834
+ */
835
+ challenge(params: MFAChallengeParams): Promise<AuthMFAChallengeResponse>;
836
+ /**
837
+ * Verifies a code against a challenge. The verification code is
838
+ * provided by the user by entering a code seen in their authenticator app.
839
+ */
840
+ verify(params: MFAVerifyParams): Promise<AuthMFAVerifyResponse>;
841
+ /**
842
+ * Unenroll removes a MFA factor.
843
+ * A user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.
844
+ */
845
+ unenroll(params: MFAUnenrollParams): Promise<AuthMFAUnenrollResponse>;
846
+ /**
847
+ * Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is
848
+ * provided by the user by entering a code seen in their authenticator app.
849
+ */
850
+ challengeAndVerify(params: MFAChallengeAndVerifyParams): Promise<AuthMFAVerifyResponse>;
851
+ /**
852
+ * Returns the list of MFA factors enabled for this user.
853
+ *
854
+ * @see {@link GoTrueMFAApi#enroll}
855
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}
856
+ * @see {@link GoTrueClient#getUser}
857
+ *
858
+ */
859
+ listFactors(): Promise<AuthMFAListFactorsResponse>;
860
+ /**
861
+ * Returns the Authenticator Assurance Level (AAL) for the active session.
862
+ *
863
+ * - `aal1` (or `null`) means that the user's identity has been verified only
864
+ * with a conventional login (email+password, OTP, magic link, social login,
865
+ * etc.).
866
+ * - `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.
867
+ *
868
+ * Although this method returns a promise, it's fairly quick (microseconds)
869
+ * and rarely uses the network. You can use this to check whether the current
870
+ * user needs to be shown a screen to verify their MFA factors.
871
+ *
872
+ */
873
+ getAuthenticatorAssuranceLevel(): Promise<AuthMFAGetAuthenticatorAssuranceLevelResponse>;
874
+ }
875
+ /**
876
+ * @expermental
877
+ */
878
+ export type AuthMFAAdminDeleteFactorResponse = {
879
+ data: {
880
+ /** ID of the factor that was successfully deleted. */
881
+ id: string;
882
+ };
883
+ error: null;
884
+ } | {
885
+ data: null;
886
+ error: AuthError;
887
+ };
888
+ /**
889
+ * @expermental
890
+ */
891
+ export type AuthMFAAdminDeleteFactorParams = {
892
+ /** ID of the MFA factor to delete. */
893
+ id: string;
894
+ /** ID of the user whose factor is being deleted. */
895
+ userId: string;
896
+ };
897
+ /**
898
+ * @expermental
899
+ */
900
+ export type AuthMFAAdminListFactorsResponse = {
901
+ data: {
902
+ /** All factors attached to the user. */
903
+ factors: Factor[];
904
+ };
905
+ error: null;
906
+ } | {
907
+ data: null;
908
+ error: AuthError;
909
+ };
910
+ /**
911
+ * @expermental
912
+ */
913
+ export type AuthMFAAdminListFactorsParams = {
914
+ /** ID of the user. */
915
+ userId: string;
916
+ };
917
+ /**
918
+ * Contains the full multi-factor authentication administration API.
919
+ *
920
+ * @expermental
921
+ */
922
+ export interface GoTrueAdminMFAApi {
923
+ /**
924
+ * Lists all factors associated to a user.
925
+ *
926
+ */
927
+ listFactors(params: AuthMFAAdminListFactorsParams): Promise<AuthMFAAdminListFactorsResponse>;
928
+ /**
929
+ * Deletes a factor on a user. This will log the user out of all active
930
+ * sessions if the deleted factor was verified.
931
+ *
932
+ * @see {@link GoTrueMFAApi#unenroll}
933
+ *
934
+ * @expermental
935
+ */
936
+ deleteFactor(params: AuthMFAAdminDeleteFactorParams): Promise<AuthMFAAdminDeleteFactorResponse>;
937
+ }
938
+ type AnyFunction = (...args: any[]) => any;
939
+ type MaybePromisify<T> = T | Promise<T>;
940
+ type PromisifyMethods<T> = {
941
+ [K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
942
+ };
943
+ export type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>> & {
944
+ /**
945
+ * If set to `true` signals to the library that the storage medium is used
946
+ * on a server and the values may not be authentic, such as reading from
947
+ * request cookies. Implementations should not set this to true if the client
948
+ * is used on a server that reads storage information from authenticated
949
+ * sources, such as a secure database or file.
950
+ */
951
+ isServer?: boolean;
952
+ };
953
+ export type InitializeResult = {
954
+ error: AuthError | null;
955
+ };
956
+ export type CallRefreshTokenResult = {
957
+ session: Session;
958
+ error: null;
959
+ } | {
960
+ session: null;
961
+ error: AuthError;
962
+ };
963
+ export type Pagination = {
964
+ [key: string]: any;
965
+ nextPage: number | null;
966
+ lastPage: number;
967
+ total: number;
968
+ };
969
+ export type PageParams = {
970
+ /** The page number */
971
+ page?: number;
972
+ /** Number of items returned per page */
973
+ perPage?: number;
974
+ };
975
+ export type SignOut = {
976
+ /**
977
+ * Determines which sessions should be
978
+ * logged out. Global means all
979
+ * sessions by this account. Local
980
+ * means only this session. Others
981
+ * means all other sessions except the
982
+ * current one. When using others,
983
+ * there is no sign-out event fired on
984
+ * the current session!
985
+ */
986
+ scope?: 'global' | 'local' | 'others';
987
+ };
988
+ export type MFAEnrollTOTPParams = {
989
+ /** The type of factor being enrolled. */
990
+ factorType: 'totp';
991
+ /** Domain which the user is enrolled with. */
992
+ issuer?: string;
993
+ /** Human readable name assigned to the factor. */
994
+ friendlyName?: string;
995
+ };
996
+ export type MFAEnrollPhoneParams = {
997
+ /** The type of factor being enrolled. */
998
+ factorType: 'phone';
999
+ /** Human readable name assigned to the factor. */
1000
+ friendlyName?: string;
1001
+ /** Phone number associated with a factor. Number should conform to E.164 format */
1002
+ phone: string;
1003
+ };
1004
+ export type AuthMFAEnrollTOTPResponse = {
1005
+ data: {
1006
+ /** ID of the factor that was just enrolled (in an unverified state). */
1007
+ id: string;
1008
+ /** Type of MFA factor.*/
1009
+ type: 'totp';
1010
+ /** TOTP enrollment information. */
1011
+ totp: {
1012
+ /** Contains a QR code encoding the authenticator URI. You can
1013
+ * convert it to a URL by prepending `data:image/svg+xml;utf-8,` to
1014
+ * the value. Avoid logging this value to the console. */
1015
+ qr_code: string;
1016
+ /** The TOTP secret (also encoded in the QR code). Show this secret
1017
+ * in a password-style field to the user, in case they are unable to
1018
+ * scan the QR code. Avoid logging this value to the console. */
1019
+ secret: string;
1020
+ /** The authenticator URI encoded within the QR code, should you need
1021
+ * to use it. Avoid loggin this value to the console. */
1022
+ uri: string;
1023
+ };
1024
+ /** Friendly name of the factor, useful for distinguishing between factors **/
1025
+ friendly_name?: string;
1026
+ };
1027
+ error: null;
1028
+ } | {
1029
+ data: null;
1030
+ error: AuthError;
1031
+ };
1032
+ export type AuthMFAEnrollPhoneResponse = {
1033
+ data: {
1034
+ /** ID of the factor that was just enrolled (in an unverified state). */
1035
+ id: string;
1036
+ /** Type of MFA factor. */
1037
+ type: 'phone';
1038
+ /** Friendly name of the factor, useful for distinguishing between factors **/
1039
+ friendly_name?: string;
1040
+ /** Phone number of the MFA factor in E.164 format. Used to send messages */
1041
+ phone: string;
1042
+ };
1043
+ error: null;
1044
+ } | {
1045
+ data: null;
1046
+ error: AuthError;
1047
+ };
1048
+ export type JwtHeader = {
1049
+ alg: 'RS256' | 'ES256' | 'HS256';
1050
+ kid: string;
1051
+ typ: string;
1052
+ };
1053
+ export type RequiredClaims = {
1054
+ iss: string;
1055
+ sub: string;
1056
+ aud: string | string[];
1057
+ exp: number;
1058
+ iat: number;
1059
+ role: string;
1060
+ aal: AuthenticatorAssuranceLevels;
1061
+ session_id: string;
1062
+ };
1063
+ export type JwtPayload = RequiredClaims & {
1064
+ [key: string]: any;
1065
+ };
1066
+ export interface JWK {
1067
+ kty: 'RSA' | 'EC' | 'oct';
1068
+ key_ops: string[];
1069
+ alg?: string;
1070
+ kid?: string;
1071
+ [key: string]: any;
1072
+ }
1073
+ export {};
1074
+ //# sourceMappingURL=types.d.ts.map