better-auth 0.0.8-beta.2 → 0.0.8-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access.d.ts +3 -4
- package/dist/access.js +3 -13
- package/dist/access.js.map +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +36 -44
- package/dist/cli.js.map +1 -1
- package/dist/client/plugins.d.ts +97 -2407
- package/dist/client/plugins.js +143 -203
- package/dist/client/plugins.js.map +1 -1
- package/dist/client.d.ts +159 -1213
- package/dist/client.js +125 -527
- package/dist/client.js.map +1 -1
- package/dist/{helper-B5_2Vzba.d.ts → helper-D8dhRz72.d.ts} +1 -4
- package/dist/{index-Dg4eEXZW.d.ts → index-B9jOjqnF.d.ts} +1 -1
- package/dist/{schema-BOszzrbQ.d.ts → index-CcxejJTH.d.ts} +172 -142
- package/dist/{client-CaF9eUcv.d.ts → index-Dwhjsk4l.d.ts} +2014 -1971
- package/dist/index.d.ts +1124 -6
- package/dist/index.js +737 -707
- package/dist/index.js.map +1 -1
- package/dist/internal-adapter-CVKQ4XR9.d.ts +637 -0
- package/dist/next-js.d.ts +17 -7
- package/dist/next-js.js +20 -3
- package/dist/next-js.js.map +1 -1
- package/dist/plugins.d.ts +12 -883
- package/dist/plugins.js +743 -679
- package/dist/plugins.js.map +1 -1
- package/dist/react.d.ts +312 -12
- package/dist/react.js +138 -148
- package/dist/react.js.map +1 -1
- package/dist/social.d.ts +2 -2
- package/dist/social.js +179 -151
- package/dist/social.js.map +1 -1
- package/dist/solid-start.d.ts +7 -6
- package/dist/solid-start.js +3 -3
- package/dist/solid-start.js.map +1 -1
- package/dist/solid.d.ts +91 -2713
- package/dist/solid.js +130 -139
- package/dist/solid.js.map +1 -1
- package/dist/{statement-COylZd3J.d.ts → statement-D6SPoYOh.d.ts} +7 -7
- package/dist/svelte-kit.d.ts +6 -5
- package/dist/svelte-kit.js +10 -9
- package/dist/svelte-kit.js.map +1 -1
- package/dist/svelte.d.ts +89 -2713
- package/dist/svelte.js +124 -138
- package/dist/svelte.js.map +1 -1
- package/dist/types-D4WrjKeJ.d.ts +81 -0
- package/dist/types.d.ts +31 -5
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/dist/vue.d.ts +313 -12
- package/dist/vue.js +131 -145
- package/dist/vue.js.map +1 -1
- package/package.json +8 -3
- package/dist/index-CGeV0d2g.d.ts +0 -1498
- package/dist/preact.d.ts +0 -8
- package/dist/preact.js +0 -291
- package/dist/preact.js.map +0 -1
- package/dist/type-tYx_kmry.d.ts +0 -5724
|
@@ -1,7 +1,92 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import * as arctic from 'arctic';
|
|
3
2
|
import { OAuth2Tokens } from 'arctic';
|
|
4
|
-
import {
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { L as LiteralString } from './helper-D8dhRz72.js';
|
|
5
|
+
|
|
6
|
+
declare const accountSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
providerId: z.ZodString;
|
|
9
|
+
accountId: z.ZodString;
|
|
10
|
+
userId: z.ZodString;
|
|
11
|
+
accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
|
+
idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
accessTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
15
|
+
refreshTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
16
|
+
/**
|
|
17
|
+
* Password is only stored in the credential provider
|
|
18
|
+
*/
|
|
19
|
+
password: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
id: string;
|
|
22
|
+
providerId: string;
|
|
23
|
+
accountId: string;
|
|
24
|
+
userId: string;
|
|
25
|
+
accessToken?: string | null | undefined;
|
|
26
|
+
refreshToken?: string | null | undefined;
|
|
27
|
+
idToken?: string | null | undefined;
|
|
28
|
+
accessTokenExpiresAt?: Date | null | undefined;
|
|
29
|
+
refreshTokenExpiresAt?: Date | null | undefined;
|
|
30
|
+
password?: string | null | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
id: string;
|
|
33
|
+
providerId: string;
|
|
34
|
+
accountId: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
accessToken?: string | null | undefined;
|
|
37
|
+
refreshToken?: string | null | undefined;
|
|
38
|
+
idToken?: string | null | undefined;
|
|
39
|
+
accessTokenExpiresAt?: Date | null | undefined;
|
|
40
|
+
refreshTokenExpiresAt?: Date | null | undefined;
|
|
41
|
+
password?: string | null | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
declare const userSchema: z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
email: z.ZodEffects<z.ZodString, string, string>;
|
|
46
|
+
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
name: z.ZodString;
|
|
48
|
+
image: z.ZodOptional<z.ZodString>;
|
|
49
|
+
createdAt: z.ZodDefault<z.ZodDate>;
|
|
50
|
+
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
id: string;
|
|
53
|
+
email: string;
|
|
54
|
+
emailVerified: boolean;
|
|
55
|
+
name: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
image?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
id: string;
|
|
61
|
+
email: string;
|
|
62
|
+
name: string;
|
|
63
|
+
emailVerified?: boolean | undefined;
|
|
64
|
+
image?: string | undefined;
|
|
65
|
+
createdAt?: Date | undefined;
|
|
66
|
+
updatedAt?: Date | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
declare const sessionSchema: z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
userId: z.ZodString;
|
|
71
|
+
expiresAt: z.ZodDate;
|
|
72
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
73
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
id: string;
|
|
76
|
+
userId: string;
|
|
77
|
+
expiresAt: Date;
|
|
78
|
+
ipAddress?: string | undefined;
|
|
79
|
+
userAgent?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
id: string;
|
|
82
|
+
userId: string;
|
|
83
|
+
expiresAt: Date;
|
|
84
|
+
ipAddress?: string | undefined;
|
|
85
|
+
userAgent?: string | undefined;
|
|
86
|
+
}>;
|
|
87
|
+
type User = z.infer<typeof userSchema>;
|
|
88
|
+
type Account = z.infer<typeof accountSchema>;
|
|
89
|
+
type Session = z.infer<typeof sessionSchema>;
|
|
5
90
|
|
|
6
91
|
interface TwitterProfile {
|
|
7
92
|
data: {
|
|
@@ -96,15 +181,16 @@ interface TwitterOption {
|
|
|
96
181
|
clientSecret: string;
|
|
97
182
|
redirectURI?: string;
|
|
98
183
|
}
|
|
99
|
-
declare const twitter: (
|
|
184
|
+
declare const twitter: (options: TwitterOption) => {
|
|
100
185
|
id: "twitter";
|
|
101
186
|
name: string;
|
|
102
187
|
createAuthorizationURL(data: {
|
|
103
188
|
state: string;
|
|
104
189
|
codeVerifier: string;
|
|
105
190
|
scopes?: string[];
|
|
191
|
+
redirectURI?: string;
|
|
106
192
|
}): URL;
|
|
107
|
-
validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
193
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
108
194
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
109
195
|
user: {
|
|
110
196
|
id: string;
|
|
@@ -140,15 +226,16 @@ interface TwitchOptions {
|
|
|
140
226
|
clientSecret: string;
|
|
141
227
|
redirectURI?: string;
|
|
142
228
|
}
|
|
143
|
-
declare const twitch: (
|
|
229
|
+
declare const twitch: (options: TwitchOptions) => {
|
|
144
230
|
id: "twitch";
|
|
145
231
|
name: string;
|
|
146
232
|
createAuthorizationURL({ state, scopes }: {
|
|
147
233
|
state: string;
|
|
148
234
|
codeVerifier: string;
|
|
149
235
|
scopes?: string[];
|
|
236
|
+
redirectURI?: string;
|
|
150
237
|
}): URL;
|
|
151
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
238
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
152
239
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
153
240
|
user: {
|
|
154
241
|
id: string;
|
|
@@ -174,15 +261,16 @@ interface SpotifyOptions {
|
|
|
174
261
|
clientSecret: string;
|
|
175
262
|
redirectURI?: string;
|
|
176
263
|
}
|
|
177
|
-
declare const spotify: (
|
|
264
|
+
declare const spotify: (options: SpotifyOptions) => {
|
|
178
265
|
id: "spotify";
|
|
179
266
|
name: string;
|
|
180
267
|
createAuthorizationURL({ state, scopes }: {
|
|
181
268
|
state: string;
|
|
182
269
|
codeVerifier: string;
|
|
183
270
|
scopes?: string[];
|
|
271
|
+
redirectURI?: string;
|
|
184
272
|
}): URL;
|
|
185
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
273
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
186
274
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
187
275
|
user: {
|
|
188
276
|
id: string;
|
|
@@ -206,10 +294,6 @@ interface GoogleProfile {
|
|
|
206
294
|
* Western languages.
|
|
207
295
|
*/
|
|
208
296
|
family_name: string;
|
|
209
|
-
/**
|
|
210
|
-
* The given name of the user, or first name in most
|
|
211
|
-
* Western languages.
|
|
212
|
-
*/
|
|
213
297
|
given_name: string;
|
|
214
298
|
hd?: string;
|
|
215
299
|
iat: number;
|
|
@@ -221,20 +305,18 @@ interface GoogleProfile {
|
|
|
221
305
|
picture: string;
|
|
222
306
|
sub: string;
|
|
223
307
|
}
|
|
224
|
-
interface GoogleOptions {
|
|
225
|
-
clientId: string;
|
|
226
|
-
clientSecret: string;
|
|
227
|
-
redirectURI?: string;
|
|
308
|
+
interface GoogleOptions extends ProviderOptions {
|
|
228
309
|
}
|
|
229
|
-
declare const google: (
|
|
310
|
+
declare const google: (options: GoogleOptions) => {
|
|
230
311
|
id: "google";
|
|
231
312
|
name: string;
|
|
232
|
-
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
313
|
+
createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }: {
|
|
233
314
|
state: string;
|
|
234
315
|
codeVerifier: string;
|
|
235
316
|
scopes?: string[];
|
|
317
|
+
redirectURI?: string;
|
|
236
318
|
}): URL;
|
|
237
|
-
validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
319
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
238
320
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
239
321
|
user: {
|
|
240
322
|
id: string;
|
|
@@ -307,8 +389,9 @@ declare const github: ({ clientId, clientSecret, redirectURI, }: GithubOptions)
|
|
|
307
389
|
state: string;
|
|
308
390
|
codeVerifier: string;
|
|
309
391
|
scopes?: string[];
|
|
392
|
+
redirectURI?: string;
|
|
310
393
|
}): URL;
|
|
311
|
-
validateAuthorizationCode: (
|
|
394
|
+
validateAuthorizationCode: (state: string) => Promise<arctic.OAuth2Tokens>;
|
|
312
395
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
313
396
|
user: {
|
|
314
397
|
id: string;
|
|
@@ -342,15 +425,16 @@ interface FacebookOptions {
|
|
|
342
425
|
clientSecret: string;
|
|
343
426
|
redirectURI?: string;
|
|
344
427
|
}
|
|
345
|
-
declare const facebook: (
|
|
428
|
+
declare const facebook: (options: FacebookOptions) => {
|
|
346
429
|
id: "facebook";
|
|
347
430
|
name: string;
|
|
348
431
|
createAuthorizationURL({ state, scopes }: {
|
|
349
432
|
state: string;
|
|
350
433
|
codeVerifier: string;
|
|
351
434
|
scopes?: string[];
|
|
435
|
+
redirectURI?: string;
|
|
352
436
|
}): URL;
|
|
353
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
437
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
354
438
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
355
439
|
user: {
|
|
356
440
|
id: string;
|
|
@@ -436,15 +520,16 @@ interface DiscordOptions {
|
|
|
436
520
|
clientSecret: string;
|
|
437
521
|
redirectURI?: string;
|
|
438
522
|
}
|
|
439
|
-
declare const discord: (
|
|
523
|
+
declare const discord: (options: DiscordOptions) => {
|
|
440
524
|
id: "discord";
|
|
441
525
|
name: string;
|
|
442
526
|
createAuthorizationURL({ state, scopes }: {
|
|
443
527
|
state: string;
|
|
444
528
|
codeVerifier: string;
|
|
445
529
|
scopes?: string[];
|
|
530
|
+
redirectURI?: string;
|
|
446
531
|
}): URL;
|
|
447
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
532
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
448
533
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
449
534
|
user: {
|
|
450
535
|
id: string;
|
|
@@ -510,6 +595,7 @@ declare const apple: ({ clientId, clientSecret, redirectURI, }: AppleOptions) =>
|
|
|
510
595
|
state: string;
|
|
511
596
|
codeVerifier: string;
|
|
512
597
|
scopes?: string[];
|
|
598
|
+
redirectURI?: string;
|
|
513
599
|
}): URL;
|
|
514
600
|
validateAuthorizationCode: (code: string) => Promise<OAuth2Tokens>;
|
|
515
601
|
getUserInfo(token: OAuth2Tokens): Promise<{
|
|
@@ -523,6 +609,45 @@ declare const apple: ({ clientId, clientSecret, redirectURI, }: AppleOptions) =>
|
|
|
523
609
|
} | null>;
|
|
524
610
|
};
|
|
525
611
|
|
|
612
|
+
interface OAuthProvider<T extends Record<string, any> = Record<string, any>> {
|
|
613
|
+
id: LiteralString;
|
|
614
|
+
createAuthorizationURL: (data: {
|
|
615
|
+
state: string;
|
|
616
|
+
codeVerifier: string;
|
|
617
|
+
scopes?: string[];
|
|
618
|
+
redirectURI?: string;
|
|
619
|
+
}) => URL;
|
|
620
|
+
name: string;
|
|
621
|
+
validateAuthorizationCode: (code: string, codeVerifier?: string, redirectURI?: string) => Promise<OAuth2Tokens>;
|
|
622
|
+
getUserInfo: (token: OAuth2Tokens) => Promise<{
|
|
623
|
+
user: Omit<User, "createdAt" | "updatedAt">;
|
|
624
|
+
data: T;
|
|
625
|
+
} | null>;
|
|
626
|
+
refreshAccessToken?: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
627
|
+
revokeToken?: (token: string) => Promise<void>;
|
|
628
|
+
}
|
|
629
|
+
type OAuthProviderList = typeof oAuthProviderList;
|
|
630
|
+
type ProviderOptions = {
|
|
631
|
+
/**
|
|
632
|
+
* The client ID of your application
|
|
633
|
+
*/
|
|
634
|
+
clientId: string;
|
|
635
|
+
/**
|
|
636
|
+
* The client secret of your application
|
|
637
|
+
*/
|
|
638
|
+
clientSecret: string;
|
|
639
|
+
/**
|
|
640
|
+
* The scopes you want to request from the provider
|
|
641
|
+
*/
|
|
642
|
+
scope?: string[];
|
|
643
|
+
/**
|
|
644
|
+
* The redirect URL for your application. This is where the provider will
|
|
645
|
+
* redirect the user after the sign in process. Make sure this URL is
|
|
646
|
+
* whitelisted in the provider's dashboard.
|
|
647
|
+
*/
|
|
648
|
+
redirectURI?: string;
|
|
649
|
+
};
|
|
650
|
+
|
|
526
651
|
declare const oAuthProviders: {
|
|
527
652
|
apple: ({ clientId, clientSecret, redirectURI, }: AppleOptions) => {
|
|
528
653
|
id: "apple";
|
|
@@ -531,6 +656,7 @@ declare const oAuthProviders: {
|
|
|
531
656
|
state: string;
|
|
532
657
|
codeVerifier: string;
|
|
533
658
|
scopes?: string[];
|
|
659
|
+
redirectURI?: string;
|
|
534
660
|
}): URL;
|
|
535
661
|
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
536
662
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
@@ -543,15 +669,16 @@ declare const oAuthProviders: {
|
|
|
543
669
|
data: AppleProfile;
|
|
544
670
|
} | null>;
|
|
545
671
|
};
|
|
546
|
-
discord: (
|
|
672
|
+
discord: (options: DiscordOptions) => {
|
|
547
673
|
id: "discord";
|
|
548
674
|
name: string;
|
|
549
675
|
createAuthorizationURL({ state, scopes }: {
|
|
550
676
|
state: string;
|
|
551
677
|
codeVerifier: string;
|
|
552
678
|
scopes?: string[];
|
|
679
|
+
redirectURI?: string;
|
|
553
680
|
}): URL;
|
|
554
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
681
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
555
682
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
556
683
|
user: {
|
|
557
684
|
id: string;
|
|
@@ -562,15 +689,16 @@ declare const oAuthProviders: {
|
|
|
562
689
|
data: DiscordProfile;
|
|
563
690
|
} | null>;
|
|
564
691
|
};
|
|
565
|
-
facebook: (
|
|
692
|
+
facebook: (options: FacebookOptions) => {
|
|
566
693
|
id: "facebook";
|
|
567
694
|
name: string;
|
|
568
695
|
createAuthorizationURL({ state, scopes }: {
|
|
569
696
|
state: string;
|
|
570
697
|
codeVerifier: string;
|
|
571
698
|
scopes?: string[];
|
|
699
|
+
redirectURI?: string;
|
|
572
700
|
}): URL;
|
|
573
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
701
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
574
702
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
575
703
|
user: {
|
|
576
704
|
id: string;
|
|
@@ -588,8 +716,9 @@ declare const oAuthProviders: {
|
|
|
588
716
|
state: string;
|
|
589
717
|
codeVerifier: string;
|
|
590
718
|
scopes?: string[];
|
|
719
|
+
redirectURI?: string;
|
|
591
720
|
}): URL;
|
|
592
|
-
validateAuthorizationCode: (
|
|
721
|
+
validateAuthorizationCode: (state: string) => Promise<arctic.OAuth2Tokens>;
|
|
593
722
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
594
723
|
user: {
|
|
595
724
|
id: string;
|
|
@@ -603,15 +732,16 @@ declare const oAuthProviders: {
|
|
|
603
732
|
data: GithubProfile;
|
|
604
733
|
} | null>;
|
|
605
734
|
};
|
|
606
|
-
google: (
|
|
735
|
+
google: (options: GoogleOptions) => {
|
|
607
736
|
id: "google";
|
|
608
737
|
name: string;
|
|
609
|
-
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
738
|
+
createAuthorizationURL({ state, scopes, codeVerifier, redirectURI }: {
|
|
610
739
|
state: string;
|
|
611
740
|
codeVerifier: string;
|
|
612
741
|
scopes?: string[];
|
|
742
|
+
redirectURI?: string;
|
|
613
743
|
}): URL;
|
|
614
|
-
validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
744
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
615
745
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
616
746
|
user: {
|
|
617
747
|
id: string;
|
|
@@ -623,15 +753,16 @@ declare const oAuthProviders: {
|
|
|
623
753
|
data: GoogleProfile;
|
|
624
754
|
} | null>;
|
|
625
755
|
};
|
|
626
|
-
spotify: (
|
|
756
|
+
spotify: (options: SpotifyOptions) => {
|
|
627
757
|
id: "spotify";
|
|
628
758
|
name: string;
|
|
629
759
|
createAuthorizationURL({ state, scopes }: {
|
|
630
760
|
state: string;
|
|
631
761
|
codeVerifier: string;
|
|
632
762
|
scopes?: string[];
|
|
763
|
+
redirectURI?: string;
|
|
633
764
|
}): URL;
|
|
634
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
765
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
635
766
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
636
767
|
user: {
|
|
637
768
|
id: string;
|
|
@@ -643,15 +774,16 @@ declare const oAuthProviders: {
|
|
|
643
774
|
data: SpotifyProfile;
|
|
644
775
|
} | null>;
|
|
645
776
|
};
|
|
646
|
-
twitch: (
|
|
777
|
+
twitch: (options: TwitchOptions) => {
|
|
647
778
|
id: "twitch";
|
|
648
779
|
name: string;
|
|
649
780
|
createAuthorizationURL({ state, scopes }: {
|
|
650
781
|
state: string;
|
|
651
782
|
codeVerifier: string;
|
|
652
783
|
scopes?: string[];
|
|
784
|
+
redirectURI?: string;
|
|
653
785
|
}): URL;
|
|
654
|
-
validateAuthorizationCode: (code: string) => Promise<arctic.OAuth2Tokens>;
|
|
786
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
655
787
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
656
788
|
user: {
|
|
657
789
|
id: string;
|
|
@@ -663,15 +795,16 @@ declare const oAuthProviders: {
|
|
|
663
795
|
data: TwitchProfile;
|
|
664
796
|
} | null>;
|
|
665
797
|
};
|
|
666
|
-
twitter: (
|
|
798
|
+
twitter: (options: TwitterOption) => {
|
|
667
799
|
id: "twitter";
|
|
668
800
|
name: string;
|
|
669
801
|
createAuthorizationURL(data: {
|
|
670
802
|
state: string;
|
|
671
803
|
codeVerifier: string;
|
|
672
804
|
scopes?: string[];
|
|
805
|
+
redirectURI?: string;
|
|
673
806
|
}): URL;
|
|
674
|
-
validateAuthorizationCode: (code: string, codeVerifier: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
807
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
675
808
|
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
676
809
|
user: {
|
|
677
810
|
id: string;
|
|
@@ -686,107 +819,4 @@ declare const oAuthProviders: {
|
|
|
686
819
|
};
|
|
687
820
|
declare const oAuthProviderList: ["github", ...(keyof typeof oAuthProviders)[]];
|
|
688
821
|
|
|
689
|
-
|
|
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 };
|
|
822
|
+
export { type Account as A, type DiscordProfile as D, type FacebookProfile as F, type GithubProfile as G, type OAuthProvider as O, type ProviderOptions as P, 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 };
|