better-auth 0.0.2-beta.7 → 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 (96) hide show
  1. package/dist/access.d.ts +4 -0
  2. package/dist/access.js +126 -0
  3. package/dist/access.js.map +1 -0
  4. package/dist/cli.d.ts +2 -0
  5. package/dist/cli.js +553 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/client/plugins.d.ts +2436 -0
  8. package/dist/client/plugins.js +411 -0
  9. package/dist/client/plugins.js.map +1 -0
  10. package/dist/client-A2Mt04KQ.d.ts +3503 -0
  11. package/dist/client.d.ts +1433 -0
  12. package/dist/client.js +693 -0
  13. package/dist/client.js.map +1 -0
  14. package/dist/helper-B5_2Vzba.d.ts +14 -0
  15. package/dist/index-Dg4eEXZW.d.ts +24 -0
  16. package/dist/index-W5nXvJ-p.d.ts +1498 -0
  17. package/dist/index.d.ts +6 -4
  18. package/dist/index.js +2195 -1191
  19. package/dist/index.js.map +1 -1
  20. package/dist/next-js.d.ts +14 -0
  21. package/dist/next-js.js +14 -0
  22. package/dist/next-js.js.map +1 -0
  23. package/dist/plugins.d.ts +892 -49
  24. package/dist/plugins.js +3951 -253
  25. package/dist/plugins.js.map +1 -1
  26. package/dist/preact.d.ts +8 -0
  27. package/dist/preact.js +294 -0
  28. package/dist/preact.js.map +1 -0
  29. package/dist/react.d.ts +14 -0
  30. package/dist/react.js +314 -0
  31. package/dist/react.js.map +1 -0
  32. package/dist/schema-BOszzrbQ.d.ts +792 -0
  33. package/dist/social.d.ts +4 -0
  34. package/dist/social.js +509 -0
  35. package/dist/social.js.map +1 -0
  36. package/dist/solid-start.d.ts +18 -0
  37. package/dist/solid-start.js +14 -0
  38. package/dist/solid-start.js.map +1 -0
  39. package/dist/solid.d.ts +2790 -0
  40. package/dist/solid.js +306 -0
  41. package/dist/solid.js.map +1 -0
  42. package/dist/statement-COylZd3J.d.ts +81 -0
  43. package/dist/svelte-kit.d.ts +10 -7
  44. package/dist/svelte-kit.js +12 -17
  45. package/dist/svelte-kit.js.map +1 -1
  46. package/dist/svelte.d.ts +2791 -0
  47. package/dist/svelte.js +304 -0
  48. package/dist/svelte.js.map +1 -0
  49. package/dist/type-DbMyI3b5.d.ts +5724 -0
  50. package/dist/types.d.ts +7 -0
  51. package/dist/types.js +1 -0
  52. package/dist/types.js.map +1 -0
  53. package/dist/vue.d.ts +14 -0
  54. package/dist/vue.js +311 -0
  55. package/dist/vue.js.map +1 -0
  56. package/package.json +80 -54
  57. package/LICENSE +0 -21
  58. package/dist/actions.d.ts +0 -33
  59. package/dist/actions.js +0 -1373
  60. package/dist/actions.js.map +0 -1
  61. package/dist/adapters/drizzle-adapter.d.ts +0 -10
  62. package/dist/adapters/drizzle-adapter.js +0 -1095
  63. package/dist/adapters/drizzle-adapter.js.map +0 -1
  64. package/dist/adapters/memory.d.ts +0 -8
  65. package/dist/adapters/memory.js +0 -136
  66. package/dist/adapters/memory.js.map +0 -1
  67. package/dist/adapters/mongodb-adapter.d.ts +0 -9
  68. package/dist/adapters/mongodb-adapter.js +0 -97
  69. package/dist/adapters/mongodb-adapter.js.map +0 -1
  70. package/dist/adapters/prisma-adapter.d.ts +0 -7
  71. package/dist/adapters/prisma-adapter.js +0 -144
  72. package/dist/adapters/prisma-adapter.js.map +0 -1
  73. package/dist/adapters/redis-adapter.d.ts +0 -7
  74. package/dist/adapters/redis-adapter.js +0 -65
  75. package/dist/adapters/redis-adapter.js.map +0 -1
  76. package/dist/adapters.d.ts +0 -3
  77. package/dist/adapters.js +0 -206
  78. package/dist/adapters.js.map +0 -1
  79. package/dist/h3.d.ts +0 -10
  80. package/dist/h3.js +0 -326
  81. package/dist/h3.js.map +0 -1
  82. package/dist/hono.d.ts +0 -10
  83. package/dist/hono.js +0 -25
  84. package/dist/hono.js.map +0 -1
  85. package/dist/index-UcTu1vUg.d.ts +0 -107
  86. package/dist/next.d.ts +0 -17
  87. package/dist/next.js +0 -26
  88. package/dist/next.js.map +0 -1
  89. package/dist/options-CH15FEBw.d.ts +0 -1562
  90. package/dist/providers.d.ts +0 -3
  91. package/dist/providers.js +0 -653
  92. package/dist/providers.js.map +0 -1
  93. package/dist/routes/session.d.ts +0 -39
  94. package/dist/routes/session.js +0 -128
  95. package/dist/routes/session.js.map +0 -1
  96. package/dist/types-DAxaMWCy.d.ts +0 -136
@@ -0,0 +1,792 @@
1
+ import { z } from 'zod';
2
+ import * as arctic from 'arctic';
3
+ import { OAuth2Tokens } from 'arctic';
4
+ import { L as LiteralString } from './helper-B5_2Vzba.js';
5
+
6
+ interface TwitterProfile {
7
+ data: {
8
+ /**
9
+ * Unique identifier of this user. This is returned as a string in order to avoid complications with languages and tools
10
+ * that cannot handle large integers.
11
+ */
12
+ id: string;
13
+ /** The friendly name of this user, as shown on their profile. */
14
+ name: string;
15
+ /** @note Email is currently unsupported by Twitter. */
16
+ email?: string;
17
+ /** The Twitter handle (screen name) of this user. */
18
+ username: string;
19
+ /**
20
+ * The location specified in the user's profile, if the user provided one.
21
+ * As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries.
22
+ *
23
+ * To return this field, add `user.fields=location` in the authorization request's query parameter.
24
+ */
25
+ location?: string;
26
+ /**
27
+ * This object and its children fields contain details about text that has a special meaning in the user's description.
28
+ *
29
+ *To return this field, add `user.fields=entities` in the authorization request's query parameter.
30
+ */
31
+ entities?: {
32
+ /** Contains details about the user's profile website. */
33
+ url: {
34
+ /** Contains details about the user's profile website. */
35
+ urls: Array<{
36
+ /** The start position (zero-based) of the recognized user's profile website. All start indices are inclusive. */
37
+ start: number;
38
+ /** The end position (zero-based) of the recognized user's profile website. This end index is exclusive. */
39
+ end: number;
40
+ /** The URL in the format entered by the user. */
41
+ url: string;
42
+ /** The fully resolved URL. */
43
+ expanded_url: string;
44
+ /** The URL as displayed in the user's profile. */
45
+ display_url: string;
46
+ }>;
47
+ };
48
+ /** Contains details about URLs, Hashtags, Cashtags, or mentions located within a user's description. */
49
+ description: {
50
+ hashtags: Array<{
51
+ start: number;
52
+ end: number;
53
+ tag: string;
54
+ }>;
55
+ };
56
+ };
57
+ /**
58
+ * Indicate if this user is a verified Twitter user.
59
+ *
60
+ * To return this field, add `user.fields=verified` in the authorization request's query parameter.
61
+ */
62
+ verified?: boolean;
63
+ /**
64
+ * The text of this user's profile description (also known as bio), if the user provided one.
65
+ *
66
+ * To return this field, add `user.fields=description` in the authorization request's query parameter.
67
+ */
68
+ description?: string;
69
+ /**
70
+ * The URL specified in the user's profile, if present.
71
+ *
72
+ * To return this field, add `user.fields=url` in the authorization request's query parameter.
73
+ */
74
+ url?: string;
75
+ /** The URL to the profile image for this user, as shown on the user's profile. */
76
+ profile_image_url?: string;
77
+ protected?: boolean;
78
+ /**
79
+ * Unique identifier of this user's pinned Tweet.
80
+ *
81
+ * You can obtain the expanded object in `includes.tweets` by adding `expansions=pinned_tweet_id` in the authorization request's query parameter.
82
+ */
83
+ pinned_tweet_id?: string;
84
+ created_at?: string;
85
+ };
86
+ includes?: {
87
+ tweets?: Array<{
88
+ id: string;
89
+ text: string;
90
+ }>;
91
+ };
92
+ [claims: string]: unknown;
93
+ }
94
+ interface TwitterOption {
95
+ clientId: string;
96
+ clientSecret: string;
97
+ redirectURI?: string;
98
+ }
99
+ declare const twitter: ({ clientId, clientSecret, redirectURI, }: TwitterOption) => {
100
+ id: "twitter";
101
+ name: string;
102
+ createAuthorizationURL(data: {
103
+ state: string;
104
+ codeVerifier: string;
105
+ scopes?: string[];
106
+ }): URL;
107
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
108
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
109
+ user: {
110
+ id: string;
111
+ name: string;
112
+ email: string;
113
+ image: string | undefined;
114
+ emailVerified: boolean;
115
+ };
116
+ data: TwitterProfile;
117
+ } | null>;
118
+ };
119
+
120
+ interface TwitchProfile {
121
+ /**
122
+ * The sub of the user
123
+ */
124
+ sub: string;
125
+ /**
126
+ * The preferred username of the user
127
+ */
128
+ preferred_username: string;
129
+ /**
130
+ * The email of the user
131
+ */
132
+ email: string;
133
+ /**
134
+ * The picture of the user
135
+ */
136
+ picture: string;
137
+ }
138
+ interface TwitchOptions {
139
+ clientId: string;
140
+ clientSecret: string;
141
+ redirectURI?: string;
142
+ }
143
+ declare const twitch: ({ clientId, clientSecret, redirectURI, }: TwitchOptions) => {
144
+ id: "twitch";
145
+ name: string;
146
+ createAuthorizationURL({ state, scopes }: {
147
+ state: string;
148
+ codeVerifier: string;
149
+ scopes?: string[];
150
+ }): URL;
151
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
152
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
153
+ user: {
154
+ id: string;
155
+ name: string;
156
+ email: string;
157
+ image: string;
158
+ emailVerified: false;
159
+ };
160
+ data: TwitchProfile;
161
+ } | null>;
162
+ };
163
+
164
+ interface SpotifyProfile {
165
+ id: string;
166
+ display_name: string;
167
+ email: string;
168
+ images: {
169
+ url: string;
170
+ }[];
171
+ }
172
+ interface SpotifyOptions {
173
+ clientId: string;
174
+ clientSecret: string;
175
+ redirectURI?: string;
176
+ }
177
+ declare const spotify: ({ clientId, clientSecret, redirectURI, }: SpotifyOptions) => {
178
+ id: "spotify";
179
+ name: string;
180
+ createAuthorizationURL({ state, scopes }: {
181
+ state: string;
182
+ codeVerifier: string;
183
+ scopes?: string[];
184
+ }): URL;
185
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
186
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
187
+ user: {
188
+ id: string;
189
+ name: string;
190
+ email: string;
191
+ image: string;
192
+ emailVerified: false;
193
+ };
194
+ data: SpotifyProfile;
195
+ } | null>;
196
+ };
197
+
198
+ interface GoogleProfile {
199
+ aud: string;
200
+ azp: string;
201
+ email: string;
202
+ email_verified: boolean;
203
+ exp: number;
204
+ /**
205
+ * The family name of the user, or last name in most
206
+ * Western languages.
207
+ */
208
+ family_name: string;
209
+ /**
210
+ * The given name of the user, or first name in most
211
+ * Western languages.
212
+ */
213
+ given_name: string;
214
+ hd?: string;
215
+ iat: number;
216
+ iss: string;
217
+ jti?: string;
218
+ locale?: string;
219
+ name: string;
220
+ nbf?: number;
221
+ picture: string;
222
+ sub: string;
223
+ }
224
+ interface GoogleOptions {
225
+ clientId: string;
226
+ clientSecret: string;
227
+ redirectURI?: string;
228
+ }
229
+ declare const google: ({ clientId, clientSecret, redirectURI, }: GoogleOptions) => {
230
+ id: "google";
231
+ name: string;
232
+ createAuthorizationURL({ state, scopes, codeVerifier }: {
233
+ state: string;
234
+ codeVerifier: string;
235
+ scopes?: string[];
236
+ }): URL;
237
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
238
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
239
+ user: {
240
+ id: string;
241
+ name: string;
242
+ email: string;
243
+ image: string;
244
+ emailVerified: boolean;
245
+ };
246
+ data: GoogleProfile;
247
+ } | null>;
248
+ };
249
+
250
+ interface GithubProfile {
251
+ login: string;
252
+ id: string;
253
+ node_id: string;
254
+ avatar_url: string;
255
+ gravatar_id: string;
256
+ url: string;
257
+ html_url: string;
258
+ followers_url: string;
259
+ following_url: string;
260
+ gists_url: string;
261
+ starred_url: string;
262
+ subscriptions_url: string;
263
+ organizations_url: string;
264
+ repos_url: string;
265
+ events_url: string;
266
+ received_events_url: string;
267
+ type: string;
268
+ site_admin: boolean;
269
+ name: string;
270
+ company: string;
271
+ blog: string;
272
+ location: string;
273
+ email: string;
274
+ hireable: boolean;
275
+ bio: string;
276
+ twitter_username: string;
277
+ public_repos: string;
278
+ public_gists: string;
279
+ followers: string;
280
+ following: string;
281
+ created_at: string;
282
+ updated_at: string;
283
+ private_gists: string;
284
+ total_private_repos: string;
285
+ owned_private_repos: string;
286
+ disk_usage: string;
287
+ collaborators: string;
288
+ two_factor_authentication: boolean;
289
+ plan: {
290
+ name: string;
291
+ space: string;
292
+ private_repos: string;
293
+ collaborators: string;
294
+ };
295
+ first_name: string;
296
+ last_name: string;
297
+ }
298
+ interface GithubOptions {
299
+ clientId: string;
300
+ clientSecret: string;
301
+ redirectURI?: string;
302
+ }
303
+ declare const github: ({ clientId, clientSecret, redirectURI, }: GithubOptions) => {
304
+ id: "github";
305
+ name: string;
306
+ createAuthorizationURL({ state, scopes }: {
307
+ state: string;
308
+ codeVerifier: string;
309
+ scopes?: string[];
310
+ }): URL;
311
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
312
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
313
+ user: {
314
+ id: string;
315
+ name: string;
316
+ email: string;
317
+ image: string;
318
+ emailVerified: boolean;
319
+ createdAt: Date;
320
+ updatedAt: Date;
321
+ };
322
+ data: GithubProfile;
323
+ } | null>;
324
+ };
325
+
326
+ interface FacebookProfile {
327
+ id: string;
328
+ name: string;
329
+ email: string;
330
+ email_verified: boolean;
331
+ picture: {
332
+ data: {
333
+ height: number;
334
+ is_silhouette: boolean;
335
+ url: string;
336
+ width: number;
337
+ };
338
+ };
339
+ }
340
+ interface FacebookOptions {
341
+ clientId: string;
342
+ clientSecret: string;
343
+ redirectURI?: string;
344
+ }
345
+ declare const facebook: ({ clientId, clientSecret, redirectURI, }: FacebookOptions) => {
346
+ id: "facebook";
347
+ name: string;
348
+ createAuthorizationURL({ state, scopes }: {
349
+ state: string;
350
+ codeVerifier: string;
351
+ scopes?: string[];
352
+ }): URL;
353
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
354
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
355
+ user: {
356
+ id: string;
357
+ name: string;
358
+ email: string;
359
+ emailVerified: boolean;
360
+ };
361
+ data: FacebookProfile;
362
+ } | null>;
363
+ };
364
+
365
+ interface DiscordProfile extends Record<string, any> {
366
+ /** the user's id (i.e. the numerical snowflake) */
367
+ id: string;
368
+ /** the user's username, not unique across the platform */
369
+ username: string;
370
+ /** the user's Discord-tag */
371
+ discriminator: string;
372
+ /** the user's display name, if it is set */
373
+ global_name: string | null;
374
+ /**
375
+ * the user's avatar hash:
376
+ * https://discord.com/developers/docs/reference#image-formatting
377
+ */
378
+ avatar: string | null;
379
+ /** whether the user belongs to an OAuth2 application */
380
+ bot?: boolean;
381
+ /**
382
+ * whether the user is an Official Discord System user (part of the urgent
383
+ * message system)
384
+ */
385
+ system?: boolean;
386
+ /** whether the user has two factor enabled on their account */
387
+ mfa_enabled: boolean;
388
+ /**
389
+ * the user's banner hash:
390
+ * https://discord.com/developers/docs/reference#image-formatting
391
+ */
392
+ banner: string | null;
393
+ /** the user's banner color encoded as an integer representation of hexadecimal color code */
394
+ accent_color: number | null;
395
+ /**
396
+ * the user's chosen language option:
397
+ * https://discord.com/developers/docs/reference#locales
398
+ */
399
+ locale: string;
400
+ /** whether the email on this account has been verified */
401
+ verified: boolean;
402
+ /** the user's email */
403
+ email: string;
404
+ /**
405
+ * the flags on a user's account:
406
+ * https://discord.com/developers/docs/resources/user#user-object-user-flags
407
+ */
408
+ flags: number;
409
+ /**
410
+ * the type of Nitro subscription on a user's account:
411
+ * https://discord.com/developers/docs/resources/user#user-object-premium-types
412
+ */
413
+ premium_type: number;
414
+ /**
415
+ * the public flags on a user's account:
416
+ * https://discord.com/developers/docs/resources/user#user-object-user-flags
417
+ */
418
+ public_flags: number;
419
+ /** undocumented field; corresponds to the user's custom nickname */
420
+ display_name: string | null;
421
+ /**
422
+ * undocumented field; corresponds to the Discord feature where you can e.g.
423
+ * put your avatar inside of an ice cube
424
+ */
425
+ avatar_decoration: string | null;
426
+ /**
427
+ * undocumented field; corresponds to the premium feature where you can
428
+ * select a custom banner color
429
+ */
430
+ banner_color: string | null;
431
+ /** undocumented field; the CDN URL of their profile picture */
432
+ image_url: string;
433
+ }
434
+ interface DiscordOptions {
435
+ clientId: string;
436
+ clientSecret: string;
437
+ redirectURI?: string;
438
+ }
439
+ declare const discord: ({ clientId, clientSecret, redirectURI, }: DiscordOptions) => {
440
+ id: "discord";
441
+ name: string;
442
+ createAuthorizationURL({ state, scopes }: {
443
+ state: string;
444
+ codeVerifier: string;
445
+ scopes?: string[];
446
+ }): URL;
447
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
448
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
449
+ user: {
450
+ id: string;
451
+ name: string;
452
+ email: string;
453
+ emailVerified: boolean;
454
+ };
455
+ data: DiscordProfile;
456
+ } | null>;
457
+ };
458
+
459
+ interface AppleProfile {
460
+ /**
461
+ * The subject registered claim identifies the principal that’s the subject
462
+ * of the identity token. Because this token is for your app, the value is
463
+ * the unique identifier for the user.
464
+ */
465
+ sub: string;
466
+ /**
467
+ * A String value representing the user's email address.
468
+ * The email address is either the user's real email address or the proxy
469
+ * address, depending on their status private email relay service.
470
+ */
471
+ email: string;
472
+ /**
473
+ * A string or Boolean value that indicates whether the service verifies
474
+ * the email. The value can either be a string ("true" or "false") or a
475
+ * Boolean (true or false). The system may not verify email addresses for
476
+ * Sign in with Apple at Work & School users, and this claim is "false" or
477
+ * false for those users.
478
+ */
479
+ email_verified: true | "true";
480
+ /**
481
+ * A string or Boolean value that indicates whether the email that the user
482
+ * shares is the proxy address. The value can either be a string ("true" or
483
+ * "false") or a Boolean (true or false).
484
+ */
485
+ is_private_email: boolean;
486
+ /**
487
+ * An Integer value that indicates whether the user appears to be a real
488
+ * person. Use the value of this claim to mitigate fraud. The possible
489
+ * values are: 0 (or Unsupported), 1 (or Unknown), 2 (or LikelyReal). For
490
+ * more information, see ASUserDetectionStatus. This claim is present only
491
+ * in iOS 14 and later, macOS 11 and later, watchOS 7 and later, tvOS 14
492
+ * and later. The claim isn’t present or supported for web-based apps.
493
+ */
494
+ real_user_status: number;
495
+ /**
496
+ * The user’s full name in the format provided during the authorization
497
+ * process.
498
+ */
499
+ name: string;
500
+ }
501
+ interface AppleOptions {
502
+ clientId: string;
503
+ clientSecret: string;
504
+ redirectURI?: string;
505
+ }
506
+ declare const apple: ({ clientId, clientSecret, redirectURI, }: AppleOptions) => {
507
+ id: "apple";
508
+ name: string;
509
+ createAuthorizationURL({ state, scopes }: {
510
+ state: string;
511
+ codeVerifier: string;
512
+ scopes?: string[];
513
+ }): URL;
514
+ validateAuthorizationCode: (code: string) => Promise<OAuth2Tokens>;
515
+ getUserInfo(token: OAuth2Tokens): Promise<{
516
+ user: {
517
+ id: string;
518
+ name: string;
519
+ email: string;
520
+ emailVerified: boolean;
521
+ };
522
+ data: AppleProfile;
523
+ } | null>;
524
+ };
525
+
526
+ declare const oAuthProviders: {
527
+ apple: ({ clientId, clientSecret, redirectURI, }: AppleOptions) => {
528
+ id: "apple";
529
+ name: string;
530
+ createAuthorizationURL({ state, scopes }: {
531
+ state: string;
532
+ codeVerifier: string;
533
+ scopes?: string[];
534
+ }): URL;
535
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
536
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
537
+ user: {
538
+ id: string;
539
+ name: string;
540
+ email: string;
541
+ emailVerified: boolean;
542
+ };
543
+ data: AppleProfile;
544
+ } | null>;
545
+ };
546
+ discord: ({ clientId, clientSecret, redirectURI, }: DiscordOptions) => {
547
+ id: "discord";
548
+ name: string;
549
+ createAuthorizationURL({ state, scopes }: {
550
+ state: string;
551
+ codeVerifier: string;
552
+ scopes?: string[];
553
+ }): URL;
554
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
555
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
556
+ user: {
557
+ id: string;
558
+ name: string;
559
+ email: string;
560
+ emailVerified: boolean;
561
+ };
562
+ data: DiscordProfile;
563
+ } | null>;
564
+ };
565
+ facebook: ({ clientId, clientSecret, redirectURI, }: FacebookOptions) => {
566
+ id: "facebook";
567
+ name: string;
568
+ createAuthorizationURL({ state, scopes }: {
569
+ state: string;
570
+ codeVerifier: string;
571
+ scopes?: string[];
572
+ }): URL;
573
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
574
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
575
+ user: {
576
+ id: string;
577
+ name: string;
578
+ email: string;
579
+ emailVerified: boolean;
580
+ };
581
+ data: FacebookProfile;
582
+ } | null>;
583
+ };
584
+ github: ({ clientId, clientSecret, redirectURI, }: GithubOptions) => {
585
+ id: "github";
586
+ name: string;
587
+ createAuthorizationURL({ state, scopes }: {
588
+ state: string;
589
+ codeVerifier: string;
590
+ scopes?: string[];
591
+ }): URL;
592
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
593
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
594
+ user: {
595
+ id: string;
596
+ name: string;
597
+ email: string;
598
+ image: string;
599
+ emailVerified: boolean;
600
+ createdAt: Date;
601
+ updatedAt: Date;
602
+ };
603
+ data: GithubProfile;
604
+ } | null>;
605
+ };
606
+ google: ({ clientId, clientSecret, redirectURI, }: GoogleOptions) => {
607
+ id: "google";
608
+ name: string;
609
+ createAuthorizationURL({ state, scopes, codeVerifier }: {
610
+ state: string;
611
+ codeVerifier: string;
612
+ scopes?: string[];
613
+ }): URL;
614
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
615
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
616
+ user: {
617
+ id: string;
618
+ name: string;
619
+ email: string;
620
+ image: string;
621
+ emailVerified: boolean;
622
+ };
623
+ data: GoogleProfile;
624
+ } | null>;
625
+ };
626
+ spotify: ({ clientId, clientSecret, redirectURI, }: SpotifyOptions) => {
627
+ id: "spotify";
628
+ name: string;
629
+ createAuthorizationURL({ state, scopes }: {
630
+ state: string;
631
+ codeVerifier: string;
632
+ scopes?: string[];
633
+ }): URL;
634
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
635
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
636
+ user: {
637
+ id: string;
638
+ name: string;
639
+ email: string;
640
+ image: string;
641
+ emailVerified: false;
642
+ };
643
+ data: SpotifyProfile;
644
+ } | null>;
645
+ };
646
+ twitch: ({ clientId, clientSecret, redirectURI, }: TwitchOptions) => {
647
+ id: "twitch";
648
+ name: string;
649
+ createAuthorizationURL({ state, scopes }: {
650
+ state: string;
651
+ codeVerifier: string;
652
+ scopes?: string[];
653
+ }): URL;
654
+ validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
655
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
656
+ user: {
657
+ id: string;
658
+ name: string;
659
+ email: string;
660
+ image: string;
661
+ emailVerified: false;
662
+ };
663
+ data: TwitchProfile;
664
+ } | null>;
665
+ };
666
+ twitter: ({ clientId, clientSecret, redirectURI, }: TwitterOption) => {
667
+ id: "twitter";
668
+ name: string;
669
+ createAuthorizationURL(data: {
670
+ state: string;
671
+ codeVerifier: string;
672
+ scopes?: string[];
673
+ }): URL;
674
+ validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
675
+ getUserInfo(token: arctic.OAuth2Tokens): Promise<{
676
+ user: {
677
+ id: string;
678
+ name: string;
679
+ email: string;
680
+ image: string | undefined;
681
+ emailVerified: boolean;
682
+ };
683
+ data: TwitterProfile;
684
+ } | null>;
685
+ };
686
+ };
687
+ declare const oAuthProviderList: ["github", ...(keyof typeof oAuthProviders)[]];
688
+
689
+ interface OAuthProvider<T extends Record<string, any> = Record<string, any>> {
690
+ id: LiteralString;
691
+ createAuthorizationURL: (data: {
692
+ state: string;
693
+ codeVerifier: string;
694
+ scopes?: string[];
695
+ }) => URL;
696
+ name: string;
697
+ validateAuthorizationCode: (code: string, codeVerifier?: string) => Promise<OAuth2Tokens>;
698
+ getUserInfo: (token: OAuth2Tokens) => Promise<{
699
+ user: Omit<User, "createdAt" | "updatedAt">;
700
+ data: T;
701
+ } | null>;
702
+ refreshAccessToken?: (refreshToken: string) => Promise<OAuth2Tokens>;
703
+ revokeToken?: (token: string) => Promise<void>;
704
+ }
705
+ type OAuthProviderList = typeof oAuthProviderList;
706
+
707
+ declare const accountSchema: z.ZodObject<{
708
+ id: z.ZodString;
709
+ providerId: z.ZodString;
710
+ accountId: z.ZodString;
711
+ userId: z.ZodString;
712
+ accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
713
+ refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
714
+ idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
715
+ accessTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
716
+ refreshTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
717
+ /**
718
+ * Password is only stored in the credential provider
719
+ */
720
+ password: z.ZodNullable<z.ZodOptional<z.ZodString>>;
721
+ }, "strip", z.ZodTypeAny, {
722
+ id: string;
723
+ userId: string;
724
+ accountId: string;
725
+ providerId: string;
726
+ password?: string | null | undefined;
727
+ accessToken?: string | null | undefined;
728
+ refreshToken?: string | null | undefined;
729
+ idToken?: string | null | undefined;
730
+ accessTokenExpiresAt?: Date | null | undefined;
731
+ refreshTokenExpiresAt?: Date | null | undefined;
732
+ }, {
733
+ id: string;
734
+ userId: string;
735
+ accountId: string;
736
+ providerId: string;
737
+ password?: string | null | undefined;
738
+ accessToken?: string | null | undefined;
739
+ refreshToken?: string | null | undefined;
740
+ idToken?: string | null | undefined;
741
+ accessTokenExpiresAt?: Date | null | undefined;
742
+ refreshTokenExpiresAt?: Date | null | undefined;
743
+ }>;
744
+ declare const userSchema: z.ZodObject<{
745
+ id: z.ZodString;
746
+ email: z.ZodEffects<z.ZodString, string, string>;
747
+ emailVerified: z.ZodDefault<z.ZodBoolean>;
748
+ name: z.ZodString;
749
+ image: z.ZodOptional<z.ZodString>;
750
+ createdAt: z.ZodDefault<z.ZodDate>;
751
+ updatedAt: z.ZodDefault<z.ZodDate>;
752
+ }, "strip", z.ZodTypeAny, {
753
+ id: string;
754
+ name: string;
755
+ email: string;
756
+ emailVerified: boolean;
757
+ createdAt: Date;
758
+ updatedAt: Date;
759
+ image?: string | undefined;
760
+ }, {
761
+ id: string;
762
+ name: string;
763
+ email: string;
764
+ emailVerified?: boolean | undefined;
765
+ image?: string | undefined;
766
+ createdAt?: Date | undefined;
767
+ updatedAt?: Date | undefined;
768
+ }>;
769
+ declare const sessionSchema: z.ZodObject<{
770
+ id: z.ZodString;
771
+ userId: z.ZodString;
772
+ expiresAt: z.ZodDate;
773
+ ipAddress: z.ZodOptional<z.ZodString>;
774
+ userAgent: z.ZodOptional<z.ZodString>;
775
+ }, "strip", z.ZodTypeAny, {
776
+ id: string;
777
+ userId: string;
778
+ expiresAt: Date;
779
+ ipAddress?: string | undefined;
780
+ userAgent?: string | undefined;
781
+ }, {
782
+ id: string;
783
+ userId: string;
784
+ expiresAt: Date;
785
+ ipAddress?: string | undefined;
786
+ userAgent?: string | undefined;
787
+ }>;
788
+ type User = z.infer<typeof userSchema>;
789
+ type Account = z.infer<typeof accountSchema>;
790
+ type Session = z.infer<typeof sessionSchema>;
791
+
792
+ export { type Account as A, type DiscordProfile as D, type FacebookProfile as F, type GithubProfile as G, type OAuthProvider as O, type Session as S, type TwitchProfile as T, type User as U, oAuthProviderList as a, type GithubOptions as b, type GoogleProfile as c, type GoogleOptions as d, google as e, type AppleProfile as f, github as g, type AppleOptions as h, apple as i, type DiscordOptions as j, discord as k, type SpotifyProfile as l, type SpotifyOptions as m, type TwitchOptions as n, oAuthProviders as o, type FacebookOptions as p, facebook as q, type TwitterProfile as r, spotify as s, twitch as t, type TwitterOption as u, twitter as v, type OAuthProviderList as w };