@better-auth/core 1.4.0-beta.13 → 1.4.0-beta.14
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 +37 -45
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.d.cts +2 -6
- package/dist/api/index.d.ts +2 -6
- package/dist/api/index.js +1 -1
- package/dist/async_hooks/index.d.cts +1 -1
- package/dist/async_hooks/index.d.ts +1 -1
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.cts +14 -18
- package/dist/context/index.d.ts +14 -18
- package/dist/context/index.js +1 -1
- package/dist/{context-Bm0rm76r.js → context-BAOGRjRS.js} +30 -30
- package/dist/{context-7VgEbfs3.cjs → context-BRDf96na.cjs} +29 -29
- package/dist/db/adapter/index.d.cts +2 -6
- package/dist/db/adapter/index.d.ts +2 -6
- package/dist/db/index.cjs +17 -17
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.js +17 -17
- package/dist/env/index.d.cts +1 -1
- package/dist/env/index.d.ts +1 -1
- package/dist/{index-Cg7SVnu9.d.cts → index-6-zeCbRA.d.cts} +5005 -2553
- package/dist/{index-D5uj-vER.d.ts → index-C8vNYjIq.d.ts} +4 -4
- package/dist/{index-Dy_s5RNc.d.cts → index-DAzyP5GG.d.cts} +4 -4
- package/dist/{index-RfHoxHB4.d.ts → index-DTT2geV_.d.ts} +3662 -1211
- package/dist/index.d.cts +3 -65
- package/dist/index.d.ts +3 -65
- package/dist/oauth2/index.cjs +1 -1
- package/dist/oauth2/index.d.cts +2 -2
- package/dist/oauth2/index.d.ts +2 -2
- package/dist/oauth2/index.js +1 -1
- package/dist/{oauth2-C8-hfKTF.cjs → oauth2-C4Pt8KMZ.cjs} +87 -87
- package/dist/{oauth2-CjVUvPq7.js → oauth2-CP3eVHS_.js} +88 -88
- package/dist/social-providers/index.cjs +891 -891
- package/dist/social-providers/index.d.cts +2 -3
- package/dist/social-providers/index.d.ts +2 -3
- package/dist/social-providers/index.js +891 -891
- package/package.json +4 -3
- package/src/api/index.ts +1 -1
- package/src/context/endpoint-context.ts +1 -1
- package/src/context/index.ts +7 -7
- package/src/context/transaction.ts +2 -2
- package/src/db/adapter/index.ts +1 -1
- package/src/db/index.ts +11 -11
- package/src/db/plugin.ts +1 -1
- package/src/db/type.ts +3 -3
- package/src/env/index.ts +9 -9
- package/src/env/logger.test.ts +2 -2
- package/src/oauth2/client-credentials-token.ts +1 -1
- package/src/oauth2/index.ts +10 -11
- package/src/oauth2/refresh-access-token.ts +1 -1
- package/src/oauth2/validate-authorization-code.ts +1 -1
- package/src/social-providers/apple.ts +1 -1
- package/src/social-providers/atlassian.ts +6 -3
- package/src/social-providers/cognito.ts +7 -4
- package/src/social-providers/facebook.ts +6 -3
- package/src/social-providers/figma.ts +6 -3
- package/src/social-providers/gitlab.ts +1 -1
- package/src/social-providers/google.ts +6 -3
- package/src/social-providers/huggingface.ts +1 -1
- package/src/social-providers/index.ts +25 -25
- package/src/social-providers/kakao.ts +1 -1
- package/src/social-providers/kick.ts +1 -1
- package/src/social-providers/linkedin.ts +1 -1
- package/src/social-providers/microsoft-entra-id.ts +6 -6
- package/src/social-providers/naver.ts +1 -1
- package/src/social-providers/paypal.ts +3 -3
- package/src/social-providers/polar.ts +1 -1
- package/src/social-providers/reddit.ts +1 -1
- package/src/social-providers/roblox.ts +1 -1
- package/src/social-providers/salesforce.ts +6 -3
- package/src/social-providers/slack.ts +1 -1
- package/src/social-providers/spotify.ts +1 -1
- package/src/social-providers/twitch.ts +3 -3
- package/src/social-providers/vk.ts +3 -2
- package/src/social-providers/zoom.ts +1 -1
- package/src/types/context.ts +5 -4
- package/src/types/index.ts +11 -10
- package/src/types/init-options.ts +33 -7
- package/src/types/plugin-client.ts +2 -2
- package/src/types/plugin.ts +3 -3
- package/dist/helper-BH5srn6K.d.ts +0 -6
- package/dist/helper-ChPUVnMr.d.cts +0 -6
- package/dist/index-BCxkjvux.d.cts +0 -344
- package/dist/index-CZCOI9An.d.ts +0 -344
- package/dist/index-DQNPxXof.d.ts +0 -262
- package/dist/index-DXj1sY8B.d.cts +0 -1772
- package/dist/index-DgTKobWC.d.ts +0 -1772
- package/dist/index-daoIWR6L.d.cts +0 -262
- /package/dist/{index-CR-gJyzm.d.ts → index-BzepAavo.d.cts} +0 -0
- /package/dist/{index-CilaMiAm.d.cts → index-DT7CRnvv.d.ts} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/core@1.4.0-beta.
|
|
2
|
+
> @better-auth/core@1.4.0-beta.14 build /home/runner/work/better-auth/better-auth/packages/core
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
|
-
[34mℹ[39m tsdown [2mv0.15.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.15.10[22m powered by rolldown [2mv1.0.0-beta.44[22m
|
|
6
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/api/index.ts, src/async_hooks/index.ts, src/
|
|
7
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/api/index.ts, src/async_hooks/index.ts, src/db/index.ts, src/context/index.ts, src/env/index.ts, src/error/index.ts, src/oauth2/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/db/adapter/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1msocial-providers/index.cjs[22m [2m79.35 kB[22m [2m│ gzip: 10.
|
|
10
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1msocial-providers/index.cjs[22m [2m79.35 kB[22m [2m│ gzip: 10.25 kB[22m
|
|
11
11
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mdb/index.cjs[22m [2m 1.86 kB[22m [2m│ gzip: 0.56 kB[22m
|
|
12
12
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mapi/index.cjs[22m [2m 1.07 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
13
13
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1moauth2/index.cjs[22m [2m 0.80 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
@@ -18,23 +18,23 @@
|
|
|
18
18
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mutils/index.cjs[22m [2m 0.12 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
19
19
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mdb/adapter/index.cjs[22m [2m 0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
20
20
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[1mindex.cjs[22m [2m 0.00 kB[22m [2m│ gzip: 0.02 kB[22m
|
|
21
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22moauth2-
|
|
21
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22moauth2-C4Pt8KMZ.cjs [2m10.80 kB[22m [2m│ gzip: 2.29 kB[22m
|
|
22
22
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22menv-CuEMo0ZI.cjs [2m 9.08 kB[22m [2m│ gzip: 2.62 kB[22m
|
|
23
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22mcontext-
|
|
23
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22mcontext-BRDf96na.cjs [2m 3.34 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
24
24
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22merror-k9KM7GAb.cjs [2m 1.98 kB[22m [2m│ gzip: 0.86 kB[22m
|
|
25
25
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22mchunk-CUT6urMc.cjs [2m 1.09 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
26
26
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22masync_hooks-CaXONcb9.cjs [2m 0.97 kB[22m [2m│ gzip: 0.51 kB[22m
|
|
27
27
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22mutils-Bs-jKit4.cjs [2m 0.23 kB[22m [2m│ gzip: 0.17 kB[22m
|
|
28
|
-
[34mℹ[39m [33m[CJS][39m 18 files, total: 112.
|
|
28
|
+
[34mℹ[39m [33m[CJS][39m 18 files, total: 112.32 kB
|
|
29
29
|
[33m[UNRESOLVED_IMPORT] Warning:[0m Could not resolve '@better-auth/core/oauth2' in src/social-providers/polar.ts
|
|
30
|
-
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/social-providers/polar.ts:
|
|
30
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/social-providers/polar.ts:6:8 [38;5;246m][0m
|
|
31
31
|
[38;5;246m│[0m
|
|
32
|
-
[38;5;
|
|
32
|
+
[38;5;246m6 │[0m [38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m"@better-auth/core/oauth2"[38;5;249m;[0m
|
|
33
33
|
[38;5;240m │[0m ─────────────┬────────────
|
|
34
34
|
[38;5;240m │[0m ╰────────────── Module not found, treating it as an external dependency
|
|
35
35
|
[38;5;246m───╯[0m
|
|
36
36
|
|
|
37
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1msocial-providers/index.js[22m [2m 75.54 kB[22m [2m│ gzip:
|
|
37
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1msocial-providers/index.js[22m [2m 75.54 kB[22m [2m│ gzip: 9.98 kB[22m
|
|
38
38
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mdb/index.js[22m [2m 1.58 kB[22m [2m│ gzip: 0.49 kB[22m
|
|
39
39
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mapi/index.js[22m [2m 0.83 kB[22m [2m│ gzip: 0.40 kB[22m
|
|
40
40
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1moauth2/index.js[22m [2m 0.60 kB[22m [2m│ gzip: 0.24 kB[22m
|
|
@@ -45,56 +45,48 @@
|
|
|
45
45
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mutils/index.js[22m [2m 0.09 kB[22m [2m│ gzip: 0.09 kB[22m
|
|
46
46
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mdb/adapter/index.js[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
47
47
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[1mindex.js[22m [2m 0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
48
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22moauth2-
|
|
48
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22moauth2-CP3eVHS_.js [2m 9.16 kB[22m [2m│ gzip: 2.12 kB[22m
|
|
49
49
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22menv-DZG_k5Hh.js [2m 7.67 kB[22m [2m│ gzip: 2.54 kB[22m
|
|
50
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22mcontext-
|
|
50
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22mcontext-BAOGRjRS.js [2m 2.50 kB[22m [2m│ gzip: 0.72 kB[22m
|
|
51
51
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22merror-CxOXAZsS.js [2m 1.77 kB[22m [2m│ gzip: 0.79 kB[22m
|
|
52
52
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22masync_hooks-qYTIyHB7.js [2m 0.87 kB[22m [2m│ gzip: 0.46 kB[22m
|
|
53
53
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22mutils-CK1IUN9R.js [2m 0.13 kB[22m [2m│ gzip: 0.12 kB[22m
|
|
54
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1msocial-providers/index.d.ts[22m[39m [2m 3.
|
|
55
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 2.50 kB[22m [2m│ gzip: 0.97 kB[22m
|
|
56
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mcontext/index.d.ts[22m[39m [2m 1.89 kB[22m [2m│ gzip: 0.61 kB[22m
|
|
54
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1msocial-providers/index.d.ts[22m[39m [2m 3.65 kB[22m [2m│ gzip: 1.14 kB[22m
|
|
57
55
|
[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
|
|
58
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[
|
|
56
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mcontext/index.d.ts[22m[39m [2m 1.77 kB[22m [2m│ gzip: 0.56 kB[22m
|
|
57
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mdb/index.d.ts[22m[39m [2m 1.01 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
59
58
|
[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
|
|
60
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[
|
|
61
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[
|
|
59
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mindex.d.ts[22m[39m [2m 0.82 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
60
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1moauth2/index.d.ts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
62
61
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1menv/index.d.ts[22m[39m [2m 0.59 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
63
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[
|
|
62
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mdb/adapter/index.d.ts[22m[39m [2m 0.46 kB[22m [2m│ gzip: 0.23 kB[22m
|
|
63
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1mapi/index.d.ts[22m[39m [2m 0.29 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
64
64
|
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32m[1masync_hooks/index.d.ts[22m[39m [2m 0.14 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
65
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-
|
|
66
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-
|
|
67
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-
|
|
68
|
-
[34mℹ[39m [34m[ESM][39m
|
|
69
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-D5uj-vER.d.ts[39m [2m 3.25 kB[22m [2m│ gzip: 1.10 kB[22m
|
|
70
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mhelper-BH5srn6K.d.ts[39m [2m 0.34 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
71
|
-
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-CR-gJyzm.d.ts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
72
|
-
[34mℹ[39m [34m[ESM][39m 35 files, total: 302.94 kB
|
|
65
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-DTT2geV_.d.ts[39m [2m185.45 kB[22m [2m│ gzip: 29.86 kB[22m
|
|
66
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-C8vNYjIq.d.ts[39m [2m 3.25 kB[22m [2m│ gzip: 1.10 kB[22m
|
|
67
|
+
[34mℹ[39m [34m[ESM][39m [2mdist/[22m[32mindex-DT7CRnvv.d.ts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
68
|
+
[34mℹ[39m [34m[ESM][39m 31 files, total: 303.10 kB
|
|
73
69
|
[33m[UNRESOLVED_IMPORT] Warning:[0m Could not resolve '@better-auth/core/oauth2' in src/social-providers/polar.ts
|
|
74
|
-
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/social-providers/polar.ts:
|
|
70
|
+
[38;5;246m╭[0m[38;5;246m─[0m[38;5;246m[[0m src/social-providers/polar.ts:6:8 [38;5;246m][0m
|
|
75
71
|
[38;5;246m│[0m
|
|
76
|
-
[38;5;
|
|
72
|
+
[38;5;246m6 │[0m [38;5;249m}[0m[38;5;249m [0m[38;5;249mf[0m[38;5;249mr[0m[38;5;249mo[0m[38;5;249mm[0m[38;5;249m [0m"@better-auth/core/oauth2"[38;5;249m;[0m
|
|
77
73
|
[38;5;240m │[0m ─────────────┬────────────
|
|
78
74
|
[38;5;240m │[0m ╰────────────── Module not found, treating it as an external dependency
|
|
79
75
|
[38;5;246m───╯[0m
|
|
80
76
|
|
|
81
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1msocial-providers/index.d.cts[22m[39m [2m 3.
|
|
82
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m 2.50 kB[22m [2m│ gzip: 0.97 kB[22m
|
|
83
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mcontext/index.d.cts[22m[39m [2m 1.90 kB[22m [2m│ gzip: 0.61 kB[22m
|
|
77
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1msocial-providers/index.d.cts[22m[39m [2m 3.65 kB[22m [2m│ gzip: 1.14 kB[22m
|
|
84
78
|
[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
|
|
85
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[
|
|
79
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mcontext/index.d.cts[22m[39m [2m 1.77 kB[22m [2m│ gzip: 0.56 kB[22m
|
|
80
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mdb/index.d.cts[22m[39m [2m 1.01 kB[22m [2m│ gzip: 0.38 kB[22m
|
|
86
81
|
[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
|
|
87
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[
|
|
88
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[
|
|
82
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m 0.83 kB[22m [2m│ gzip: 0.32 kB[22m
|
|
83
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1moauth2/index.d.cts[22m[39m [2m 0.79 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
89
84
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1menv/index.d.cts[22m[39m [2m 0.59 kB[22m [2m│ gzip: 0.30 kB[22m
|
|
90
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[
|
|
85
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mdb/adapter/index.d.cts[22m[39m [2m 0.47 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
86
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mapi/index.d.cts[22m[39m [2m 0.29 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
91
87
|
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1masync_hooks/index.d.cts[22m[39m [2m 0.14 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
92
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-
|
|
93
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-
|
|
94
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-
|
|
95
|
-
[34mℹ[39m [33m[CJS][39m
|
|
96
|
-
[
|
|
97
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mhelper-ChPUVnMr.d.cts[39m [2m 0.34 kB[22m [2m│ gzip: 0.22 kB[22m
|
|
98
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-CilaMiAm.d.cts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
99
|
-
[34mℹ[39m [33m[CJS][39m 18 files, total: 204.31 kB
|
|
100
|
-
[32m✔[39m Build complete in [32m4730ms[39m
|
|
88
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-6-zeCbRA.d.cts[39m [2m188.69 kB[22m [2m│ gzip: 30.59 kB[22m
|
|
89
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-DAzyP5GG.d.cts[39m [2m 3.25 kB[22m [2m│ gzip: 1.10 kB[22m
|
|
90
|
+
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32mindex-BzepAavo.d.cts[39m [2m 0.24 kB[22m [2m│ gzip: 0.16 kB[22m
|
|
91
|
+
[34mℹ[39m [33m[CJS][39m 14 files, total: 204.40 kB
|
|
92
|
+
[32m✔[39m Build complete in [32m4733ms[39m
|
package/dist/api/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-CUT6urMc.cjs');
|
|
2
2
|
require('../async_hooks-CaXONcb9.cjs');
|
|
3
|
-
const require_context = require('../context-
|
|
3
|
+
const require_context = require('../context-BRDf96na.cjs');
|
|
4
4
|
let better_call = require("better-call");
|
|
5
5
|
better_call = require_chunk.__toESM(better_call);
|
|
6
6
|
|
package/dist/api/index.d.cts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../index-
|
|
3
|
-
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-DXj1sY8B.cjs";
|
|
4
|
-
import "../index-BCxkjvux.cjs";
|
|
5
|
-
import "../index-Cg7SVnu9.cjs";
|
|
6
|
-
import "../index-Dy_s5RNc.cjs";
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-6-zeCbRA.cjs";
|
|
2
|
+
import "../index-DAzyP5GG.cjs";
|
|
7
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../index-
|
|
3
|
-
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-DgTKobWC.js";
|
|
4
|
-
import "../index-CZCOI9An.js";
|
|
5
|
-
import "../index-RfHoxHB4.js";
|
|
6
|
-
import "../index-D5uj-vER.js";
|
|
1
|
+
import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-DTT2geV_.js";
|
|
2
|
+
import "../index-C8vNYjIq.js";
|
|
7
3
|
export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
|
package/dist/api/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../async_hooks-qYTIyHB7.js";
|
|
2
|
-
import {
|
|
2
|
+
import { s as runWithEndpointContext } from "../context-BAOGRjRS.js";
|
|
3
3
|
import { createEndpoint, createMiddleware } from "better-call";
|
|
4
4
|
|
|
5
5
|
//#region src/api/index.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-
|
|
1
|
+
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-BzepAavo.cjs";
|
|
2
2
|
export { AsyncLocalStorage, getAsyncLocalStorage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-
|
|
1
|
+
import { n as getAsyncLocalStorage, t as AsyncLocalStorage } from "../index-DT7CRnvv.js";
|
|
2
2
|
export { AsyncLocalStorage, getAsyncLocalStorage };
|
package/dist/context/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require('../async_hooks-CaXONcb9.cjs');
|
|
2
|
-
const require_context = require('../context-
|
|
2
|
+
const require_context = require('../context-BRDf96na.cjs');
|
|
3
3
|
|
|
4
4
|
exports.getCurrentAdapter = require_context.getCurrentAdapter;
|
|
5
5
|
exports.getCurrentAuthContext = require_context.getCurrentAuthContext;
|
package/dist/context/index.d.cts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../index-
|
|
3
|
-
import {
|
|
4
|
-
import "../index-BCxkjvux.cjs";
|
|
5
|
-
import "../index-Cg7SVnu9.cjs";
|
|
6
|
-
import "../index-Dy_s5RNc.cjs";
|
|
7
|
-
import { t as AsyncLocalStorage } from "../index-CilaMiAm.cjs";
|
|
1
|
+
import { Wn as DBTransactionAdapter, d as AuthContext, zn as DBAdapter } from "../index-6-zeCbRA.cjs";
|
|
2
|
+
import "../index-DAzyP5GG.cjs";
|
|
3
|
+
import { t as AsyncLocalStorage } from "../index-BzepAavo.cjs";
|
|
8
4
|
import { EndpointContext, InputContext } from "better-call";
|
|
9
5
|
|
|
10
|
-
//#region src/context/transaction.d.ts
|
|
11
|
-
/**
|
|
12
|
-
* This is for internal use only. Most users should use `getCurrentAdapter` instead.
|
|
13
|
-
*
|
|
14
|
-
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
15
|
-
*/
|
|
16
|
-
declare const getCurrentDBAdapterAsyncLocalStorage: () => Promise<AsyncLocalStorage<DBTransactionAdapter>>;
|
|
17
|
-
declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
|
|
18
|
-
declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
19
|
-
declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region src/context/endpoint-context.d.ts
|
|
22
7
|
type AuthEndpointContext = Partial<InputContext<string, any> & EndpointContext<string, any>> & {
|
|
23
8
|
context: AuthContext;
|
|
@@ -31,4 +16,15 @@ declare function getCurrentAuthContextAsyncLocalStorage(): Promise<AsyncLocalSto
|
|
|
31
16
|
declare function getCurrentAuthContext(): Promise<AuthEndpointContext>;
|
|
32
17
|
declare function runWithEndpointContext<T>(context: AuthEndpointContext, fn: () => T): Promise<T>;
|
|
33
18
|
//#endregion
|
|
19
|
+
//#region src/context/transaction.d.ts
|
|
20
|
+
/**
|
|
21
|
+
* This is for internal use only. Most users should use `getCurrentAdapter` instead.
|
|
22
|
+
*
|
|
23
|
+
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
24
|
+
*/
|
|
25
|
+
declare const getCurrentDBAdapterAsyncLocalStorage: () => Promise<AsyncLocalStorage<DBTransactionAdapter>>;
|
|
26
|
+
declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
|
|
27
|
+
declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
28
|
+
declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
29
|
+
//#endregion
|
|
34
30
|
export { type AuthEndpointContext, getCurrentAdapter, getCurrentAuthContext, getCurrentAuthContextAsyncLocalStorage, getCurrentDBAdapterAsyncLocalStorage, runWithAdapter, runWithEndpointContext, runWithTransaction };
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import "../index-
|
|
3
|
-
import {
|
|
4
|
-
import "../index-CZCOI9An.js";
|
|
5
|
-
import "../index-RfHoxHB4.js";
|
|
6
|
-
import "../index-D5uj-vER.js";
|
|
7
|
-
import { t as AsyncLocalStorage } from "../index-CR-gJyzm.js";
|
|
1
|
+
import { Wn as DBTransactionAdapter, d as AuthContext, zn as DBAdapter } from "../index-DTT2geV_.js";
|
|
2
|
+
import "../index-C8vNYjIq.js";
|
|
3
|
+
import { t as AsyncLocalStorage } from "../index-DT7CRnvv.js";
|
|
8
4
|
import { EndpointContext, InputContext } from "better-call";
|
|
9
5
|
|
|
10
|
-
//#region src/context/transaction.d.ts
|
|
11
|
-
/**
|
|
12
|
-
* This is for internal use only. Most users should use `getCurrentAdapter` instead.
|
|
13
|
-
*
|
|
14
|
-
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
15
|
-
*/
|
|
16
|
-
declare const getCurrentDBAdapterAsyncLocalStorage: () => Promise<AsyncLocalStorage<DBTransactionAdapter>>;
|
|
17
|
-
declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
|
|
18
|
-
declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
19
|
-
declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region src/context/endpoint-context.d.ts
|
|
22
7
|
type AuthEndpointContext = Partial<InputContext<string, any> & EndpointContext<string, any>> & {
|
|
23
8
|
context: AuthContext;
|
|
@@ -31,4 +16,15 @@ declare function getCurrentAuthContextAsyncLocalStorage(): Promise<AsyncLocalSto
|
|
|
31
16
|
declare function getCurrentAuthContext(): Promise<AuthEndpointContext>;
|
|
32
17
|
declare function runWithEndpointContext<T>(context: AuthEndpointContext, fn: () => T): Promise<T>;
|
|
33
18
|
//#endregion
|
|
19
|
+
//#region src/context/transaction.d.ts
|
|
20
|
+
/**
|
|
21
|
+
* This is for internal use only. Most users should use `getCurrentAdapter` instead.
|
|
22
|
+
*
|
|
23
|
+
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
24
|
+
*/
|
|
25
|
+
declare const getCurrentDBAdapterAsyncLocalStorage: () => Promise<AsyncLocalStorage<DBTransactionAdapter>>;
|
|
26
|
+
declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
|
|
27
|
+
declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
28
|
+
declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
|
|
29
|
+
//#endregion
|
|
34
30
|
export { type AuthEndpointContext, getCurrentAdapter, getCurrentAuthContext, getCurrentAuthContextAsyncLocalStorage, getCurrentDBAdapterAsyncLocalStorage, runWithAdapter, runWithEndpointContext, runWithTransaction };
|
package/dist/context/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../async_hooks-qYTIyHB7.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as getCurrentAuthContext, i as runWithTransaction, n as getCurrentDBAdapterAsyncLocalStorage, o as getCurrentAuthContextAsyncLocalStorage, r as runWithAdapter, s as runWithEndpointContext, t as getCurrentAdapter } from "../context-BAOGRjRS.js";
|
|
3
3
|
|
|
4
4
|
export { getCurrentAdapter, getCurrentAuthContext, getCurrentAuthContextAsyncLocalStorage, getCurrentDBAdapterAsyncLocalStorage, runWithAdapter, runWithEndpointContext, runWithTransaction };
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
import { t as getAsyncLocalStorage } from "./async_hooks-qYTIyHB7.js";
|
|
2
2
|
|
|
3
|
+
//#region src/context/endpoint-context.ts
|
|
4
|
+
let currentContextAsyncStorage = null;
|
|
5
|
+
const ensureAsyncStorage$1 = async () => {
|
|
6
|
+
if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (getAsyncLocalStorage()))();
|
|
7
|
+
return currentContextAsyncStorage;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* This is for internal use only. Most users should use `getCurrentAuthContext` instead.
|
|
11
|
+
*
|
|
12
|
+
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
13
|
+
*/
|
|
14
|
+
async function getCurrentAuthContextAsyncLocalStorage() {
|
|
15
|
+
return ensureAsyncStorage$1();
|
|
16
|
+
}
|
|
17
|
+
async function getCurrentAuthContext() {
|
|
18
|
+
const context = (await ensureAsyncStorage$1()).getStore();
|
|
19
|
+
if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");
|
|
20
|
+
return context;
|
|
21
|
+
}
|
|
22
|
+
async function runWithEndpointContext(context, fn) {
|
|
23
|
+
return (await ensureAsyncStorage$1()).run(context, fn);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
3
27
|
//#region src/context/transaction.ts
|
|
4
28
|
let currentAdapterAsyncStorage = null;
|
|
5
|
-
const ensureAsyncStorage
|
|
29
|
+
const ensureAsyncStorage = async () => {
|
|
6
30
|
if (!currentAdapterAsyncStorage) currentAdapterAsyncStorage = new (await (getAsyncLocalStorage()))();
|
|
7
31
|
return currentAdapterAsyncStorage;
|
|
8
32
|
};
|
|
@@ -12,10 +36,10 @@ const ensureAsyncStorage$1 = async () => {
|
|
|
12
36
|
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
13
37
|
*/
|
|
14
38
|
const getCurrentDBAdapterAsyncLocalStorage = async () => {
|
|
15
|
-
return ensureAsyncStorage
|
|
39
|
+
return ensureAsyncStorage();
|
|
16
40
|
};
|
|
17
41
|
const getCurrentAdapter = async (fallback) => {
|
|
18
|
-
return ensureAsyncStorage
|
|
42
|
+
return ensureAsyncStorage().then((als) => {
|
|
19
43
|
return als.getStore() || fallback;
|
|
20
44
|
}).catch(() => {
|
|
21
45
|
return fallback;
|
|
@@ -23,7 +47,7 @@ const getCurrentAdapter = async (fallback) => {
|
|
|
23
47
|
};
|
|
24
48
|
const runWithAdapter = async (adapter, fn) => {
|
|
25
49
|
let called = true;
|
|
26
|
-
return ensureAsyncStorage
|
|
50
|
+
return ensureAsyncStorage().then((als) => {
|
|
27
51
|
called = true;
|
|
28
52
|
return als.run(adapter, fn);
|
|
29
53
|
}).catch((err) => {
|
|
@@ -33,7 +57,7 @@ const runWithAdapter = async (adapter, fn) => {
|
|
|
33
57
|
};
|
|
34
58
|
const runWithTransaction = async (adapter, fn) => {
|
|
35
59
|
let called = true;
|
|
36
|
-
return ensureAsyncStorage
|
|
60
|
+
return ensureAsyncStorage().then((als) => {
|
|
37
61
|
called = true;
|
|
38
62
|
return adapter.transaction(async (trx) => {
|
|
39
63
|
return als.run(trx, fn);
|
|
@@ -45,28 +69,4 @@ const runWithTransaction = async (adapter, fn) => {
|
|
|
45
69
|
};
|
|
46
70
|
|
|
47
71
|
//#endregion
|
|
48
|
-
|
|
49
|
-
let currentContextAsyncStorage = null;
|
|
50
|
-
const ensureAsyncStorage = async () => {
|
|
51
|
-
if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (getAsyncLocalStorage()))();
|
|
52
|
-
return currentContextAsyncStorage;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* This is for internal use only. Most users should use `getCurrentAuthContext` instead.
|
|
56
|
-
*
|
|
57
|
-
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
58
|
-
*/
|
|
59
|
-
async function getCurrentAuthContextAsyncLocalStorage() {
|
|
60
|
-
return ensureAsyncStorage();
|
|
61
|
-
}
|
|
62
|
-
async function getCurrentAuthContext() {
|
|
63
|
-
const context = (await ensureAsyncStorage()).getStore();
|
|
64
|
-
if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");
|
|
65
|
-
return context;
|
|
66
|
-
}
|
|
67
|
-
async function runWithEndpointContext(context, fn) {
|
|
68
|
-
return (await ensureAsyncStorage()).run(context, fn);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
export { getCurrentDBAdapterAsyncLocalStorage as a, getCurrentAdapter as i, getCurrentAuthContextAsyncLocalStorage as n, runWithAdapter as o, runWithEndpointContext as r, runWithTransaction as s, getCurrentAuthContext as t };
|
|
72
|
+
export { getCurrentAuthContext as a, runWithTransaction as i, getCurrentDBAdapterAsyncLocalStorage as n, getCurrentAuthContextAsyncLocalStorage as o, runWithAdapter as r, runWithEndpointContext as s, getCurrentAdapter as t };
|
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
const require_async_hooks = require('./async_hooks-CaXONcb9.cjs');
|
|
2
2
|
|
|
3
|
+
//#region src/context/endpoint-context.ts
|
|
4
|
+
let currentContextAsyncStorage = null;
|
|
5
|
+
const ensureAsyncStorage$1 = async () => {
|
|
6
|
+
if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (require_async_hooks.getAsyncLocalStorage()))();
|
|
7
|
+
return currentContextAsyncStorage;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* This is for internal use only. Most users should use `getCurrentAuthContext` instead.
|
|
11
|
+
*
|
|
12
|
+
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
13
|
+
*/
|
|
14
|
+
async function getCurrentAuthContextAsyncLocalStorage() {
|
|
15
|
+
return ensureAsyncStorage$1();
|
|
16
|
+
}
|
|
17
|
+
async function getCurrentAuthContext() {
|
|
18
|
+
const context = (await ensureAsyncStorage$1()).getStore();
|
|
19
|
+
if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");
|
|
20
|
+
return context;
|
|
21
|
+
}
|
|
22
|
+
async function runWithEndpointContext(context, fn) {
|
|
23
|
+
return (await ensureAsyncStorage$1()).run(context, fn);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
3
27
|
//#region src/context/transaction.ts
|
|
4
28
|
let currentAdapterAsyncStorage = null;
|
|
5
|
-
const ensureAsyncStorage
|
|
29
|
+
const ensureAsyncStorage = async () => {
|
|
6
30
|
if (!currentAdapterAsyncStorage) currentAdapterAsyncStorage = new (await (require_async_hooks.getAsyncLocalStorage()))();
|
|
7
31
|
return currentAdapterAsyncStorage;
|
|
8
32
|
};
|
|
@@ -12,10 +36,10 @@ const ensureAsyncStorage$1 = async () => {
|
|
|
12
36
|
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
13
37
|
*/
|
|
14
38
|
const getCurrentDBAdapterAsyncLocalStorage = async () => {
|
|
15
|
-
return ensureAsyncStorage
|
|
39
|
+
return ensureAsyncStorage();
|
|
16
40
|
};
|
|
17
41
|
const getCurrentAdapter = async (fallback) => {
|
|
18
|
-
return ensureAsyncStorage
|
|
42
|
+
return ensureAsyncStorage().then((als) => {
|
|
19
43
|
return als.getStore() || fallback;
|
|
20
44
|
}).catch(() => {
|
|
21
45
|
return fallback;
|
|
@@ -23,7 +47,7 @@ const getCurrentAdapter = async (fallback) => {
|
|
|
23
47
|
};
|
|
24
48
|
const runWithAdapter = async (adapter, fn) => {
|
|
25
49
|
let called = true;
|
|
26
|
-
return ensureAsyncStorage
|
|
50
|
+
return ensureAsyncStorage().then((als) => {
|
|
27
51
|
called = true;
|
|
28
52
|
return als.run(adapter, fn);
|
|
29
53
|
}).catch((err) => {
|
|
@@ -33,7 +57,7 @@ const runWithAdapter = async (adapter, fn) => {
|
|
|
33
57
|
};
|
|
34
58
|
const runWithTransaction = async (adapter, fn) => {
|
|
35
59
|
let called = true;
|
|
36
|
-
return ensureAsyncStorage
|
|
60
|
+
return ensureAsyncStorage().then((als) => {
|
|
37
61
|
called = true;
|
|
38
62
|
return adapter.transaction(async (trx) => {
|
|
39
63
|
return als.run(trx, fn);
|
|
@@ -44,30 +68,6 @@ const runWithTransaction = async (adapter, fn) => {
|
|
|
44
68
|
});
|
|
45
69
|
};
|
|
46
70
|
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/context/endpoint-context.ts
|
|
49
|
-
let currentContextAsyncStorage = null;
|
|
50
|
-
const ensureAsyncStorage = async () => {
|
|
51
|
-
if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (require_async_hooks.getAsyncLocalStorage()))();
|
|
52
|
-
return currentContextAsyncStorage;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* This is for internal use only. Most users should use `getCurrentAuthContext` instead.
|
|
56
|
-
*
|
|
57
|
-
* It is exposed for advanced use cases where you need direct access to the AsyncLocalStorage instance.
|
|
58
|
-
*/
|
|
59
|
-
async function getCurrentAuthContextAsyncLocalStorage() {
|
|
60
|
-
return ensureAsyncStorage();
|
|
61
|
-
}
|
|
62
|
-
async function getCurrentAuthContext() {
|
|
63
|
-
const context = (await ensureAsyncStorage()).getStore();
|
|
64
|
-
if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `runWithEndpointContext` callback.");
|
|
65
|
-
return context;
|
|
66
|
-
}
|
|
67
|
-
async function runWithEndpointContext(context, fn) {
|
|
68
|
-
return (await ensureAsyncStorage()).run(context, fn);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
71
|
//#endregion
|
|
72
72
|
Object.defineProperty(exports, 'getCurrentAdapter', {
|
|
73
73
|
enumerable: true,
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { C as DBTransactionAdapter, S as DBAdapterSchemaCreation, _ as CustomAdapter, b as DBAdapterFactoryConfig, g as CleanedWhere, v as DBAdapter, w as Where, x as DBAdapterInstance, y as DBAdapterDebugLogOption } from "../../index-DXj1sY8B.cjs";
|
|
4
|
-
import "../../index-BCxkjvux.cjs";
|
|
5
|
-
import "../../index-Cg7SVnu9.cjs";
|
|
6
|
-
import "../../index-Dy_s5RNc.cjs";
|
|
1
|
+
import { Bn as DBAdapterDebugLogOption, Gn as Where, Hn as DBAdapterInstance, Ln as CleanedWhere, Rn as CustomAdapter, Un as DBAdapterSchemaCreation, Vn as DBAdapterFactoryConfig, Wn as DBTransactionAdapter, zn as DBAdapter } from "../../index-6-zeCbRA.cjs";
|
|
2
|
+
import "../../index-DAzyP5GG.cjs";
|
|
7
3
|
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../index-
|
|
3
|
-
import { C as DBTransactionAdapter, S as DBAdapterSchemaCreation, _ as CustomAdapter, b as DBAdapterFactoryConfig, g as CleanedWhere, v as DBAdapter, w as Where, x as DBAdapterInstance, y as DBAdapterDebugLogOption } from "../../index-DgTKobWC.js";
|
|
4
|
-
import "../../index-CZCOI9An.js";
|
|
5
|
-
import "../../index-RfHoxHB4.js";
|
|
6
|
-
import "../../index-D5uj-vER.js";
|
|
1
|
+
import { Bn as DBAdapterDebugLogOption, Gn as Where, Hn as DBAdapterInstance, Ln as CleanedWhere, Rn as CustomAdapter, Un as DBAdapterSchemaCreation, Vn as DBAdapterFactoryConfig, Wn as DBTransactionAdapter, zn as DBAdapter } from "../../index-DTT2geV_.js";
|
|
2
|
+
import "../../index-C8vNYjIq.js";
|
|
7
3
|
export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, Where };
|
package/dist/db/index.cjs
CHANGED
|
@@ -9,15 +9,6 @@ const coreSchema = zod.object({
|
|
|
9
9
|
updatedAt: zod.date().default(() => /* @__PURE__ */ new Date())
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/db/schema/user.ts
|
|
14
|
-
const userSchema = coreSchema.extend({
|
|
15
|
-
email: zod.string().transform((val) => val.toLowerCase()),
|
|
16
|
-
emailVerified: zod.boolean().default(false),
|
|
17
|
-
name: zod.string(),
|
|
18
|
-
image: zod.string().nullish()
|
|
19
|
-
});
|
|
20
|
-
|
|
21
12
|
//#endregion
|
|
22
13
|
//#region src/db/schema/account.ts
|
|
23
14
|
const accountSchema = coreSchema.extend({
|
|
@@ -33,6 +24,14 @@ const accountSchema = coreSchema.extend({
|
|
|
33
24
|
password: zod.string().nullish()
|
|
34
25
|
});
|
|
35
26
|
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/db/schema/rate-limit.ts
|
|
29
|
+
const rateLimitSchema = zod.object({
|
|
30
|
+
key: zod.string(),
|
|
31
|
+
count: zod.number(),
|
|
32
|
+
lastRequest: zod.number()
|
|
33
|
+
});
|
|
34
|
+
|
|
36
35
|
//#endregion
|
|
37
36
|
//#region src/db/schema/session.ts
|
|
38
37
|
const sessionSchema = coreSchema.extend({
|
|
@@ -43,6 +42,15 @@ const sessionSchema = coreSchema.extend({
|
|
|
43
42
|
userAgent: zod.string().nullish()
|
|
44
43
|
});
|
|
45
44
|
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/db/schema/user.ts
|
|
47
|
+
const userSchema = coreSchema.extend({
|
|
48
|
+
email: zod.string().transform((val) => val.toLowerCase()),
|
|
49
|
+
emailVerified: zod.boolean().default(false),
|
|
50
|
+
name: zod.string(),
|
|
51
|
+
image: zod.string().nullish()
|
|
52
|
+
});
|
|
53
|
+
|
|
46
54
|
//#endregion
|
|
47
55
|
//#region src/db/schema/verification.ts
|
|
48
56
|
const verificationSchema = coreSchema.extend({
|
|
@@ -51,14 +59,6 @@ const verificationSchema = coreSchema.extend({
|
|
|
51
59
|
identifier: zod.string()
|
|
52
60
|
});
|
|
53
61
|
|
|
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()
|
|
60
|
-
});
|
|
61
|
-
|
|
62
62
|
//#endregion
|
|
63
63
|
exports.accountSchema = accountSchema;
|
|
64
64
|
exports.coreSchema = coreSchema;
|
package/dist/db/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
1
|
+
import { $n as verificationSchema, Jn as FieldAttribute, Kn as AuthPluginSchema, Qn as Verification, Xn as FieldType, Yn as FieldAttributeConfig, Zn as Primitive, ar as RateLimit, cr as accountSchema, dr as DBFieldAttribute, er as User, fr as DBFieldAttributeConfig, gr as SecondaryStorage, hr as DBPrimitive, ir as sessionSchema, lr as BetterAuthPluginDBSchema, mr as DBPreservedModels, nr as coreSchema, or as rateLimitSchema, pr as DBFieldType, qn as BetterAuthDbSchema, rr as Session, sr as Account, tr as userSchema, ur as BetterAuthDBSchema } from "../index-6-zeCbRA.cjs";
|
|
2
|
+
import "../index-DAzyP5GG.cjs";
|
|
3
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 };
|
package/dist/db/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../
|
|
2
|
-
import
|
|
1
|
+
import { $n as verificationSchema, Jn as FieldAttribute, Kn as AuthPluginSchema, Qn as Verification, Xn as FieldType, Yn as FieldAttributeConfig, Zn as Primitive, ar as RateLimit, cr as accountSchema, dr as DBFieldAttribute, er as User, fr as DBFieldAttributeConfig, gr as SecondaryStorage, hr as DBPrimitive, ir as sessionSchema, lr as BetterAuthPluginDBSchema, mr as DBPreservedModels, nr as coreSchema, or as rateLimitSchema, pr as DBFieldType, qn as BetterAuthDbSchema, rr as Session, sr as Account, tr as userSchema, ur as BetterAuthDBSchema } from "../index-DTT2geV_.js";
|
|
2
|
+
import "../index-C8vNYjIq.js";
|
|
3
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 };
|