@better-auth/core 1.3.27 → 1.4.0-beta.10
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/.turbo/turbo-build.log +72 -25
- package/dist/async_hooks/index.cjs +12 -20
- package/dist/async_hooks/index.d.cts +4 -7
- package/dist/async_hooks/index.d.ts +4 -7
- package/dist/async_hooks/index.js +18 -0
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/db/adapter/index.cjs +0 -2
- package/dist/db/adapter/index.d.cts +7 -23
- package/dist/db/adapter/index.d.ts +7 -23
- package/dist/db/adapter/index.js +1 -0
- package/dist/db/index.cjs +49 -56
- package/dist/db/index.d.cts +3 -116
- package/dist/db/index.d.ts +3 -116
- package/dist/db/index.js +61 -0
- package/dist/env/index.cjs +16 -0
- package/dist/env/index.d.cts +2 -0
- package/dist/env/index.d.ts +2 -0
- package/dist/env/index.js +3 -0
- package/dist/env-B05JceKx.cjs +330 -0
- package/dist/env-BZ5Nwx0e.js +246 -0
- package/dist/error/index.cjs +5 -0
- package/dist/error/index.d.cts +35 -0
- package/dist/error/index.d.ts +35 -0
- package/dist/error/index.js +4 -0
- package/dist/error-Hbg10Ynz.cjs +56 -0
- package/dist/error-ULaqTKlI.js +45 -0
- package/dist/helper-5oNxdxzu.d.ts +6 -0
- package/dist/helper-DVgWo5zB.d.cts +6 -0
- package/dist/index-B7m2jDWm.d.cts +344 -0
- package/dist/index-CESTxPyW.d.cts +82 -0
- package/dist/index-Cw9Gfaxd.d.cts +4410 -0
- package/dist/index-Cx8dCSTo.d.ts +82 -0
- package/dist/index-DJdmnKQr.d.ts +4410 -0
- package/dist/index-DNvIh1jX.d.cts +1870 -0
- package/dist/index-DoyF8K2U.d.ts +344 -0
- package/dist/index-ujq2DkG7.d.ts +1870 -0
- package/dist/index.cjs +0 -2
- package/dist/index.d.cts +7 -124
- package/dist/index.d.ts +7 -124
- package/dist/index.js +1 -0
- package/dist/middleware/index.cjs +22 -0
- package/dist/middleware/index.d.cts +7 -0
- package/dist/middleware/index.d.ts +7 -0
- package/dist/middleware/index.js +18 -0
- package/dist/oauth2/index.cjs +12 -0
- package/dist/oauth2/index.d.cts +3 -0
- package/dist/oauth2/index.d.ts +3 -0
- package/dist/oauth2/index.js +3 -0
- package/dist/oauth2-BokgssHJ.js +239 -0
- package/dist/oauth2-CLON8fY4.cjs +302 -0
- package/dist/social-providers/index.cjs +2410 -0
- package/dist/social-providers/index.d.cts +4 -0
- package/dist/social-providers/index.d.ts +4 -0
- package/dist/social-providers/index.js +2370 -0
- package/dist/type-BNCR-kIK.d.cts +262 -0
- package/dist/type-eT5TjHFp.d.ts +262 -0
- package/dist/utils/index.cjs +3 -0
- package/dist/utils/index.d.cts +9 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils-AcCtPmwG.cjs +13 -0
- package/dist/utils-BQjFFU97.js +7 -0
- package/package.json +107 -11
- package/src/async_hooks/index.ts +1 -9
- package/src/db/adapter/index.ts +424 -0
- package/src/db/index.ts +4 -0
- package/src/db/schema/rate-limit.ts +21 -0
- package/src/db/type.ts +29 -10
- package/src/env/color-depth.ts +171 -0
- package/src/env/env-impl.ts +123 -0
- package/src/env/index.ts +23 -0
- package/src/env/logger.test.ts +33 -0
- package/src/env/logger.ts +145 -0
- package/src/error/codes.ts +31 -0
- package/src/error/index.ts +11 -0
- package/src/index.ts +0 -2
- package/src/middleware/index.ts +33 -0
- package/src/oauth2/client-credentials-token.ts +102 -0
- package/src/oauth2/create-authorization-url.ts +85 -0
- package/src/oauth2/index.ts +22 -0
- package/src/oauth2/oauth-provider.ts +194 -0
- package/src/oauth2/refresh-access-token.ts +124 -0
- package/src/oauth2/utils.ts +36 -0
- package/src/oauth2/validate-authorization-code.ts +156 -0
- package/src/social-providers/apple.ts +213 -0
- package/src/social-providers/atlassian.ts +127 -0
- package/src/social-providers/cognito.ts +266 -0
- package/src/social-providers/discord.ts +169 -0
- package/src/social-providers/dropbox.ts +112 -0
- package/src/social-providers/facebook.ts +201 -0
- package/src/social-providers/figma.ts +112 -0
- package/src/social-providers/github.ts +154 -0
- package/src/social-providers/gitlab.ts +152 -0
- package/src/social-providers/google.ts +168 -0
- package/src/social-providers/huggingface.ts +116 -0
- package/src/social-providers/index.ts +118 -0
- package/src/social-providers/kakao.ts +178 -0
- package/src/social-providers/kick.ts +92 -0
- package/src/social-providers/line.ts +169 -0
- package/src/social-providers/linear.ts +120 -0
- package/src/social-providers/linkedin.ts +110 -0
- package/src/social-providers/microsoft-entra-id.ts +243 -0
- package/src/social-providers/naver.ts +112 -0
- package/src/social-providers/notion.ts +106 -0
- package/src/social-providers/paypal.ts +261 -0
- package/src/social-providers/reddit.ts +122 -0
- package/src/social-providers/roblox.ts +107 -0
- package/src/social-providers/salesforce.ts +154 -0
- package/src/social-providers/slack.ts +111 -0
- package/src/social-providers/spotify.ts +93 -0
- package/src/social-providers/tiktok.ts +208 -0
- package/src/social-providers/twitch.ts +111 -0
- package/src/social-providers/twitter.ts +194 -0
- package/src/social-providers/vk.ts +125 -0
- package/src/social-providers/zoom.ts +215 -0
- package/src/types/context.ts +270 -0
- package/src/types/cookie.ts +7 -0
- package/src/types/index.ts +19 -1
- package/src/types/init-options.ts +1035 -7
- package/src/types/plugin-client.ts +69 -0
- package/src/types/plugin.ts +134 -0
- package/src/utils/error-codes.ts +51 -0
- package/src/utils/index.ts +1 -0
- package/tsdown.config.ts +19 -0
- package/build.config.ts +0 -17
- package/dist/async_hooks/index.d.mts +0 -10
- package/dist/async_hooks/index.mjs +0 -25
- package/dist/db/adapter/index.d.mts +0 -23
- package/dist/db/adapter/index.mjs +0 -1
- package/dist/db/index.d.mts +0 -116
- package/dist/db/index.mjs +0 -55
- package/dist/index.d.mts +0 -124
- package/dist/index.mjs +0 -1
- package/dist/shared/core.CnvFgghY.d.cts +0 -117
- package/dist/shared/core.CnvFgghY.d.mts +0 -117
- package/dist/shared/core.CnvFgghY.d.ts +0 -117
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,27 +1,74 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.
|
|
3
|
-
>
|
|
2
|
+
> @better-auth/core@1.4.0-beta.10 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
|
+
> tsdown
|
|
4
4
|
|
|
5
|
-
[
|
|
6
|
-
[
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
|
|
14
|
-
[
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
[
|
|
22
|
-
|
|
23
|
-
[
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
|
|
27
|
-
[
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.15.6[22m powered by rolldown [2mv1.0.0-beta.43[22m
|
|
6
|
+
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts[24m
|
|
7
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/async_hooks/index.ts, src/db/index.ts, src/env/index.ts, src/error/index.ts, src/middleware/index.ts, src/oauth2/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/db/adapter/index.ts[39m
|
|
8
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
|
+
[34mℹ[39m Build start
|
|
10
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1msocial-providers/index.cjs[22m [2m77.23 kB[22m [2m│ gzip: 10.22 kB[22m
|
|
11
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mdb/index.cjs[22m [2m 1.86 kB[22m [2m│ gzip: 0.56 kB[22m
|
|
12
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1masync_hooks/index.cjs[22m [2m 0.88 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
13
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1moauth2/index.cjs[22m [2m 0.80 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
14
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mmiddleware/index.cjs[22m [2m 0.79 kB[22m [2m│ gzip: 0.34 kB[22m
|
|
15
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1menv/index.cjs[22m [2m 0.67 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
16
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1merror/index.cjs[22m [2m 0.21 kB[22m [2m│ gzip: 0.14 kB[22m
|
|
17
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mutils/index.cjs[22m [2m 0.12 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
18
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mdb/adapter/index.cjs[22m [2m 0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
19
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m [2m 0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
20
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22moauth2-CLON8fY4.cjs [2m10.87 kB[22m [2m│ gzip: 2.29 kB[22m
|
|
21
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22menv-B05JceKx.cjs [2m 9.16 kB[22m [2m│ gzip: 2.64 kB[22m
|
|
22
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22merror-Hbg10Ynz.cjs [2m 1.98 kB[22m [2m│ gzip: 0.85 kB[22m
|
|
23
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mchunk-CUT6urMc.cjs [2m 1.09 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
24
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mutils-AcCtPmwG.cjs [2m 0.23 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
25
|
+
[34mℹ[39m [33m[CJS][39m 15 files, total: 105.88 kB
|
|
26
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1msocial-providers/index.js[22m [2m 73.39 kB[22m [2m│ gzip: 9.98 kB[22m
|
|
27
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mdb/index.js[22m [2m 1.58 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
28
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1masync_hooks/index.js[22m [2m 0.86 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
29
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mmiddleware/index.js[22m [2m 0.57 kB[22m [2m│ gzip: 0.27 kB[22m
|
|
30
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1moauth2/index.js[22m [2m 0.56 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
31
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1menv/index.js[22m [2m 0.37 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
32
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1merror/index.js[22m [2m 0.15 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
33
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mutils/index.js[22m [2m 0.09 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
34
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mdb/adapter/index.js[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
35
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.js[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
36
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22moauth2-BokgssHJ.js [2m 9.18 kB[22m [2m│ gzip: 2.10 kB[22m
|
|
37
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22menv-BZ5Nwx0e.js [2m 7.68 kB[22m [2m│ gzip: 2.52 kB[22m
|
|
38
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22merror-ULaqTKlI.js [2m 1.75 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
39
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mutils-BQjFFU97.js [2m 0.13 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
40
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1msocial-providers/index.d.ts[22m[39m [2m 3.00 kB[22m [2m│ gzip: 0.62 kB[22m
|
|
41
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1merror/index.d.ts[22m[39m [2m 1.83 kB[22m [2m│ gzip: 0.71 kB[22m
|
|
42
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mdb/index.d.ts[22m[39m [2m 0.86 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
43
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mutils/index.d.ts[22m[39m [2m 0.84 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
44
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
45
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1moauth2/index.d.ts[22m[39m [2m 0.71 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
46
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mdb/adapter/index.d.ts[22m[39m [2m 0.55 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
47
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1menv/index.d.ts[22m[39m [2m 0.49 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
48
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mmiddleware/index.d.ts[22m[39m [2m 0.39 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
49
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1masync_hooks/index.d.ts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
50
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-DJdmnKQr.d.ts[39m [2m109.59 kB[22m [2m│ gzip: 13.64 kB[22m
|
|
51
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-ujq2DkG7.d.ts[39m [2m 56.16 kB[22m [2m│ gzip: 11.73 kB[22m
|
|
52
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-DoyF8K2U.d.ts[39m [2m 8.95 kB[22m [2m│ gzip: 2.13 kB[22m
|
|
53
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mtype-eT5TjHFp.d.ts[39m [2m 8.24 kB[22m [2m│ gzip: 2.08 kB[22m
|
|
54
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-Cx8dCSTo.d.ts[39m [2m 3.18 kB[22m [2m│ gzip: 1.06 kB[22m
|
|
55
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mhelper-5oNxdxzu.d.ts[39m [2m 0.33 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
56
|
+
[34mℹ[39m [34m[ESM][39m 30 files, total: 292.45 kB
|
|
57
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1msocial-providers/index.d.cts[22m[39m [2m 3.00 kB[22m [2m│ gzip: 0.63 kB[22m
|
|
58
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1merror/index.d.cts[22m[39m [2m 1.83 kB[22m [2m│ gzip: 0.71 kB[22m
|
|
59
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mdb/index.d.cts[22m[39m [2m 0.86 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
60
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mutils/index.d.cts[22m[39m [2m 0.84 kB[22m [2m│ gzip: 0.43 kB[22m
|
|
61
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.28 kB[22m
|
|
62
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1moauth2/index.d.cts[22m[39m [2m 0.71 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
63
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mdb/adapter/index.d.cts[22m[39m [2m 0.55 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
64
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1menv/index.d.cts[22m[39m [2m 0.50 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
65
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mmiddleware/index.d.cts[22m[39m [2m 0.39 kB[22m [2m│ gzip: 0.18 kB[22m
|
|
66
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1masync_hooks/index.d.cts[22m[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
67
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-Cw9Gfaxd.d.cts[39m [2m109.59 kB[22m [2m│ gzip: 13.64 kB[22m
|
|
68
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-DNvIh1jX.d.cts[39m [2m 56.16 kB[22m [2m│ gzip: 11.73 kB[22m
|
|
69
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-B7m2jDWm.d.cts[39m [2m 8.95 kB[22m [2m│ gzip: 2.13 kB[22m
|
|
70
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mtype-BNCR-kIK.d.cts[39m [2m 8.24 kB[22m [2m│ gzip: 2.08 kB[22m
|
|
71
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-CESTxPyW.d.cts[39m [2m 3.18 kB[22m [2m│ gzip: 1.06 kB[22m
|
|
72
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mhelper-DVgWo5zB.d.cts[39m [2m 0.33 kB[22m [2m│ gzip: 0.21 kB[22m
|
|
73
|
+
[34mℹ[39m [33m[CJS][39m 16 files, total: 196.16 kB
|
|
74
|
+
[32m✔[39m Build complete in [32m4060ms[39m
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
'use strict';
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
//#region src/async_hooks/index.ts
|
|
4
3
|
const AsyncLocalStoragePromise = import(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
/* @vite-ignore */
|
|
5
|
+
/* webpackIgnore: true */
|
|
6
|
+
"node:async_hooks"
|
|
8
7
|
).then((mod) => mod.AsyncLocalStorage).catch((err) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
console.warn(
|
|
16
|
-
"[better-auth] Please read more about this warning at https://better-auth.com/docs/installation#mount-handler"
|
|
17
|
-
);
|
|
18
|
-
console.warn(
|
|
19
|
-
"[better-auth] If you are using Cloudflare Workers, please see: https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag"
|
|
20
|
-
);
|
|
21
|
-
throw err;
|
|
8
|
+
if ("AsyncLocalStorage" in globalThis) return globalThis.AsyncLocalStorage;
|
|
9
|
+
console.warn("[better-auth] Warning: AsyncLocalStorage is not available in this environment. Some features may not work as expected.");
|
|
10
|
+
console.warn("[better-auth] Please read more about this warning at https://better-auth.com/docs/installation#mount-handler");
|
|
11
|
+
console.warn("[better-auth] If you are using Cloudflare Workers, please see: https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag");
|
|
12
|
+
throw err;
|
|
22
13
|
});
|
|
23
14
|
async function getAsyncLocalStorage() {
|
|
24
|
-
|
|
15
|
+
return AsyncLocalStoragePromise;
|
|
25
16
|
}
|
|
26
17
|
|
|
27
|
-
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.getAsyncLocalStorage = getAsyncLocalStorage;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from
|
|
2
|
-
export { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
* AsyncLocalStorage will be import directly in 1.5.x
|
|
6
|
-
*/
|
|
3
|
+
//#region src/async_hooks/index.d.ts
|
|
7
4
|
|
|
8
5
|
declare function getAsyncLocalStorage(): Promise<typeof AsyncLocalStorage>;
|
|
9
|
-
|
|
10
|
-
export { getAsyncLocalStorage };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { type AsyncLocalStorage, getAsyncLocalStorage };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { AsyncLocalStorage } from
|
|
2
|
-
export { AsyncLocalStorage } from 'node:async_hooks';
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
* AsyncLocalStorage will be import directly in 1.5.x
|
|
6
|
-
*/
|
|
3
|
+
//#region src/async_hooks/index.d.ts
|
|
7
4
|
|
|
8
5
|
declare function getAsyncLocalStorage(): Promise<typeof AsyncLocalStorage>;
|
|
9
|
-
|
|
10
|
-
export { getAsyncLocalStorage };
|
|
6
|
+
//#endregion
|
|
7
|
+
export { type AsyncLocalStorage, getAsyncLocalStorage };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/async_hooks/index.ts
|
|
2
|
+
const AsyncLocalStoragePromise = import(
|
|
3
|
+
/* @vite-ignore */
|
|
4
|
+
/* webpackIgnore: true */
|
|
5
|
+
"node:async_hooks"
|
|
6
|
+
).then((mod) => mod.AsyncLocalStorage).catch((err) => {
|
|
7
|
+
if ("AsyncLocalStorage" in globalThis) return globalThis.AsyncLocalStorage;
|
|
8
|
+
console.warn("[better-auth] Warning: AsyncLocalStorage is not available in this environment. Some features may not work as expected.");
|
|
9
|
+
console.warn("[better-auth] Please read more about this warning at https://better-auth.com/docs/installation#mount-handler");
|
|
10
|
+
console.warn("[better-auth] If you are using Cloudflare Workers, please see: https://developers.cloudflare.com/workers/configuration/compatibility-flags/#nodejs-compatibility-flag");
|
|
11
|
+
throw err;
|
|
12
|
+
});
|
|
13
|
+
async function getAsyncLocalStorage() {
|
|
14
|
+
return AsyncLocalStoragePromise;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { getAsyncLocalStorage };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, '__toESM', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return __toESM;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
updateMany?: boolean;
|
|
9
|
-
findOne?: boolean;
|
|
10
|
-
findMany?: boolean;
|
|
11
|
-
delete?: boolean;
|
|
12
|
-
deleteMany?: boolean;
|
|
13
|
-
count?: boolean;
|
|
14
|
-
} | {
|
|
15
|
-
/**
|
|
16
|
-
* Only used for adapter tests to show debug logs if a test fails.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Not actually deprecated. Doing this for IDEs to show this option at the very bottom and stop end-users from using this.
|
|
19
|
-
*/
|
|
20
|
-
isRunningAdapterTests: boolean;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type { DBAdapterDebugLogOption };
|
|
1
|
+
import "../../helper-DVgWo5zB.cjs";
|
|
2
|
+
import "../../type-BNCR-kIK.cjs";
|
|
3
|
+
import "../../index-B7m2jDWm.cjs";
|
|
4
|
+
import "../../index-Cw9Gfaxd.cjs";
|
|
5
|
+
import "../../index-CESTxPyW.cjs";
|
|
6
|
+
import { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where } from "../../index-DNvIh1jX.cjs";
|
|
7
|
+
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where };
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
updateMany?: boolean;
|
|
9
|
-
findOne?: boolean;
|
|
10
|
-
findMany?: boolean;
|
|
11
|
-
delete?: boolean;
|
|
12
|
-
deleteMany?: boolean;
|
|
13
|
-
count?: boolean;
|
|
14
|
-
} | {
|
|
15
|
-
/**
|
|
16
|
-
* Only used for adapter tests to show debug logs if a test fails.
|
|
17
|
-
*
|
|
18
|
-
* @deprecated Not actually deprecated. Doing this for IDEs to show this option at the very bottom and stop end-users from using this.
|
|
19
|
-
*/
|
|
20
|
-
isRunningAdapterTests: boolean;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type { DBAdapterDebugLogOption };
|
|
1
|
+
import "../../helper-5oNxdxzu.js";
|
|
2
|
+
import "../../type-eT5TjHFp.js";
|
|
3
|
+
import "../../index-DoyF8K2U.js";
|
|
4
|
+
import "../../index-DJdmnKQr.js";
|
|
5
|
+
import "../../index-Cx8dCSTo.js";
|
|
6
|
+
import { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where } from "../../index-ujq2DkG7.js";
|
|
7
|
+
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/db/index.cjs
CHANGED
|
@@ -1,75 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
zod = require_chunk.__toESM(zod);
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
if (e) {
|
|
9
|
-
for (const k in e) {
|
|
10
|
-
n[k] = e[k];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
n.default = e;
|
|
14
|
-
return n;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const z__namespace = /*#__PURE__*/_interopNamespaceCompat(z);
|
|
18
|
-
|
|
19
|
-
const coreSchema = z__namespace.object({
|
|
20
|
-
id: z__namespace.string(),
|
|
21
|
-
createdAt: z__namespace.date().default(() => /* @__PURE__ */ new Date()),
|
|
22
|
-
updatedAt: z__namespace.date().default(() => /* @__PURE__ */ new Date())
|
|
5
|
+
//#region src/db/schema/shared.ts
|
|
6
|
+
const coreSchema = zod.object({
|
|
7
|
+
id: zod.string(),
|
|
8
|
+
createdAt: zod.date().default(() => /* @__PURE__ */ new Date()),
|
|
9
|
+
updatedAt: zod.date().default(() => /* @__PURE__ */ new Date())
|
|
23
10
|
});
|
|
24
11
|
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/db/schema/user.ts
|
|
25
14
|
const userSchema = coreSchema.extend({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
email: zod.string().transform((val) => val.toLowerCase()),
|
|
16
|
+
emailVerified: zod.boolean().default(false),
|
|
17
|
+
name: zod.string(),
|
|
18
|
+
image: zod.string().nullish()
|
|
30
19
|
});
|
|
31
20
|
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/db/schema/account.ts
|
|
32
23
|
const accountSchema = coreSchema.extend({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Refresh token expires at
|
|
45
|
-
*/
|
|
46
|
-
refreshTokenExpiresAt: z__namespace.date().nullish(),
|
|
47
|
-
/**
|
|
48
|
-
* The scopes that the user has authorized
|
|
49
|
-
*/
|
|
50
|
-
scope: z__namespace.string().nullish(),
|
|
51
|
-
/**
|
|
52
|
-
* Password is only stored in the credential provider
|
|
53
|
-
*/
|
|
54
|
-
password: z__namespace.string().nullish()
|
|
24
|
+
providerId: zod.string(),
|
|
25
|
+
accountId: zod.string(),
|
|
26
|
+
userId: zod.coerce.string(),
|
|
27
|
+
accessToken: zod.string().nullish(),
|
|
28
|
+
refreshToken: zod.string().nullish(),
|
|
29
|
+
idToken: zod.string().nullish(),
|
|
30
|
+
accessTokenExpiresAt: zod.date().nullish(),
|
|
31
|
+
refreshTokenExpiresAt: zod.date().nullish(),
|
|
32
|
+
scope: zod.string().nullish(),
|
|
33
|
+
password: zod.string().nullish()
|
|
55
34
|
});
|
|
56
35
|
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/db/schema/session.ts
|
|
57
38
|
const sessionSchema = coreSchema.extend({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
39
|
+
userId: zod.coerce.string(),
|
|
40
|
+
expiresAt: zod.date(),
|
|
41
|
+
token: zod.string(),
|
|
42
|
+
ipAddress: zod.string().nullish(),
|
|
43
|
+
userAgent: zod.string().nullish()
|
|
63
44
|
});
|
|
64
45
|
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/db/schema/verification.ts
|
|
65
48
|
const verificationSchema = coreSchema.extend({
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
49
|
+
value: zod.string(),
|
|
50
|
+
expiresAt: zod.date(),
|
|
51
|
+
identifier: zod.string()
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/db/schema/rate-limit.ts
|
|
56
|
+
const rateLimitSchema = zod.object({
|
|
57
|
+
key: zod.string(),
|
|
58
|
+
count: zod.number(),
|
|
59
|
+
lastRequest: zod.number()
|
|
69
60
|
});
|
|
70
61
|
|
|
62
|
+
//#endregion
|
|
71
63
|
exports.accountSchema = accountSchema;
|
|
72
64
|
exports.coreSchema = coreSchema;
|
|
65
|
+
exports.rateLimitSchema = rateLimitSchema;
|
|
73
66
|
exports.sessionSchema = sessionSchema;
|
|
74
67
|
exports.userSchema = userSchema;
|
|
75
|
-
exports.verificationSchema = verificationSchema;
|
|
68
|
+
exports.verificationSchema = verificationSchema;
|
package/dist/db/index.d.cts
CHANGED
|
@@ -1,116 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
type BetterAuthPluginDBSchema = {
|
|
5
|
-
[table in string]: {
|
|
6
|
-
fields: {
|
|
7
|
-
[field in string]: DBFieldAttribute;
|
|
8
|
-
};
|
|
9
|
-
disableMigration?: boolean;
|
|
10
|
-
modelName?: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
declare const coreSchema: z.ZodObject<{
|
|
15
|
-
id: z.ZodString;
|
|
16
|
-
createdAt: z.ZodDefault<z.ZodDate>;
|
|
17
|
-
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
|
|
20
|
-
declare const userSchema: z.ZodObject<{
|
|
21
|
-
id: z.ZodString;
|
|
22
|
-
createdAt: z.ZodDefault<z.ZodDate>;
|
|
23
|
-
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
24
|
-
email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
25
|
-
emailVerified: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
-
name: z.ZodString;
|
|
27
|
-
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
-
}, z.core.$strip>;
|
|
29
|
-
/**
|
|
30
|
-
* User schema type used by better-auth, note that it's possible that user could have additional fields
|
|
31
|
-
*
|
|
32
|
-
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
33
|
-
*/
|
|
34
|
-
type User = z.infer<typeof userSchema>;
|
|
35
|
-
|
|
36
|
-
declare const accountSchema: z.ZodObject<{
|
|
37
|
-
id: z.ZodString;
|
|
38
|
-
createdAt: z.ZodDefault<z.ZodDate>;
|
|
39
|
-
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
40
|
-
providerId: z.ZodString;
|
|
41
|
-
accountId: z.ZodString;
|
|
42
|
-
userId: z.ZodCoercedString<unknown>;
|
|
43
|
-
accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
-
refreshToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
-
idToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
-
accessTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
47
|
-
refreshTokenExpiresAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
48
|
-
scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
-
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
-
}, z.core.$strip>;
|
|
51
|
-
/**
|
|
52
|
-
* Account schema type used by better-auth, note that it's possible that account could have additional fields
|
|
53
|
-
*
|
|
54
|
-
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
55
|
-
*/
|
|
56
|
-
type Account = z.infer<typeof accountSchema>;
|
|
57
|
-
|
|
58
|
-
declare const sessionSchema: z.ZodObject<{
|
|
59
|
-
id: z.ZodString;
|
|
60
|
-
createdAt: z.ZodDefault<z.ZodDate>;
|
|
61
|
-
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
62
|
-
userId: z.ZodCoercedString<unknown>;
|
|
63
|
-
expiresAt: z.ZodDate;
|
|
64
|
-
token: z.ZodString;
|
|
65
|
-
ipAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
-
userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
67
|
-
}, z.core.$strip>;
|
|
68
|
-
/**
|
|
69
|
-
* Session schema type used by better-auth, note that it's possible that session could have additional fields
|
|
70
|
-
*
|
|
71
|
-
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
72
|
-
*/
|
|
73
|
-
type Session = z.infer<typeof sessionSchema>;
|
|
74
|
-
|
|
75
|
-
declare const verificationSchema: z.ZodObject<{
|
|
76
|
-
id: z.ZodString;
|
|
77
|
-
createdAt: z.ZodDefault<z.ZodDate>;
|
|
78
|
-
updatedAt: z.ZodDefault<z.ZodDate>;
|
|
79
|
-
value: z.ZodString;
|
|
80
|
-
expiresAt: z.ZodDate;
|
|
81
|
-
identifier: z.ZodString;
|
|
82
|
-
}, z.core.$strip>;
|
|
83
|
-
/**
|
|
84
|
-
* Verification schema type used by better-auth, note that it's possible that verification could have additional fields
|
|
85
|
-
*
|
|
86
|
-
* todo: we should use generics to extend this type with additional fields from plugins and options in the future
|
|
87
|
-
*/
|
|
88
|
-
type Verification = z.infer<typeof verificationSchema>;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
92
|
-
*/
|
|
93
|
-
type AuthPluginSchema = BetterAuthPluginDBSchema;
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
96
|
-
*/
|
|
97
|
-
type FieldAttribute = DBFieldAttribute;
|
|
98
|
-
/**
|
|
99
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
100
|
-
*/
|
|
101
|
-
type FieldAttributeConfig = DBFieldAttributeConfig;
|
|
102
|
-
/**
|
|
103
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
104
|
-
*/
|
|
105
|
-
type FieldType = DBFieldType;
|
|
106
|
-
/**
|
|
107
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
108
|
-
*/
|
|
109
|
-
type Primitive = DBPrimitive;
|
|
110
|
-
/**
|
|
111
|
-
* @deprecated Backport for 1.3.x, we will remove this in 1.4.x
|
|
112
|
-
*/
|
|
113
|
-
type BetterAuthDbSchema = BetterAuthDBSchema;
|
|
114
|
-
|
|
115
|
-
export { BetterAuthDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPrimitive, accountSchema, coreSchema, sessionSchema, userSchema, verificationSchema };
|
|
116
|
-
export type { Account, AuthPluginSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, Session, User, Verification };
|
|
1
|
+
import "../helper-DVgWo5zB.cjs";
|
|
2
|
+
import { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema } from "../type-BNCR-kIK.cjs";
|
|
3
|
+
export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
|