@better-auth/core 1.3.28 → 1.4.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/.turbo/turbo-build.log +81 -76
  2. package/dist/api/index.cjs +30 -0
  3. package/dist/api/index.d.cts +7 -0
  4. package/dist/api/index.d.ts +7 -0
  5. package/dist/api/index.js +26 -0
  6. package/dist/async_hooks/index.cjs +2 -26
  7. package/dist/async_hooks/index.d.cts +4 -7
  8. package/dist/async_hooks/index.d.ts +4 -7
  9. package/dist/async_hooks/index.js +3 -0
  10. package/dist/async_hooks-CaXONcb9.cjs +24 -0
  11. package/dist/async_hooks-CkLtIFa6.js +18 -0
  12. package/dist/chunk-CUT6urMc.cjs +30 -0
  13. package/dist/context/index.cjs +8 -0
  14. package/dist/context/index.d.cts +17 -0
  15. package/dist/context/index.d.ts +17 -0
  16. package/dist/context/index.js +4 -0
  17. package/dist/context-DAu9ytQl.cjs +85 -0
  18. package/dist/context-rhoB1CVr.js +56 -0
  19. package/dist/db/adapter/index.cjs +0 -2
  20. package/dist/db/adapter/index.d.cts +7 -14
  21. package/dist/db/adapter/index.d.ts +7 -14
  22. package/dist/db/adapter/index.js +1 -0
  23. package/dist/db/index.cjs +46 -69
  24. package/dist/db/index.d.cts +3 -39
  25. package/dist/db/index.d.ts +3 -39
  26. package/dist/db/index.js +61 -0
  27. package/dist/env/index.cjs +15 -311
  28. package/dist/env/index.d.cts +2 -36
  29. package/dist/env/index.d.ts +2 -36
  30. package/dist/env/index.js +3 -0
  31. package/dist/env-D1OdwBk9.cjs +330 -0
  32. package/dist/env-DzHiLVFb.js +246 -0
  33. package/dist/error/index.cjs +4 -43
  34. package/dist/error/index.d.cts +31 -29
  35. package/dist/error/index.d.ts +31 -29
  36. package/dist/error/index.js +4 -0
  37. package/dist/error-H6U5qGNP.js +45 -0
  38. package/dist/error-k9KM7GAb.cjs +56 -0
  39. package/dist/helper-DVgWo5zB.d.cts +6 -0
  40. package/dist/helper-Dm5AtPVS.d.ts +6 -0
  41. package/dist/index-BPsqLi68.d.ts +4410 -0
  42. package/dist/index-CgIE2ECh.d.cts +262 -0
  43. package/dist/index-ChlC5Vy3.d.ts +344 -0
  44. package/dist/index-Cmh0x42V.d.ts +262 -0
  45. package/dist/index-CsHMVqbX.d.ts +82 -0
  46. package/dist/index-DFwrZMma.d.cts +82 -0
  47. package/dist/index-OrTFOyAG.d.ts +1871 -0
  48. package/dist/index-_Oiv-VVr.d.cts +344 -0
  49. package/dist/index-ehsSkBxt.d.cts +4410 -0
  50. package/dist/index-yBChAjSS.d.cts +1871 -0
  51. package/dist/index.cjs +0 -2
  52. package/dist/index.d.cts +7 -180
  53. package/dist/index.d.ts +7 -180
  54. package/dist/index.js +1 -0
  55. package/dist/oauth2/index.cjs +12 -368
  56. package/dist/oauth2/index.d.cts +3 -100
  57. package/dist/oauth2/index.d.ts +3 -100
  58. package/dist/oauth2/index.js +3 -0
  59. package/dist/oauth2-D_FUKfC8.js +239 -0
  60. package/dist/oauth2-DqX_pPhp.cjs +302 -0
  61. package/dist/social-providers/index.cjs +2262 -2645
  62. package/dist/social-providers/index.d.cts +4 -3903
  63. package/dist/social-providers/index.d.ts +4 -3903
  64. package/dist/social-providers/index.js +2370 -0
  65. package/dist/utils/index.cjs +2 -6
  66. package/dist/utils/index.d.cts +4 -5
  67. package/dist/utils/index.d.ts +4 -5
  68. package/dist/utils/index.js +3 -0
  69. package/dist/utils-Bs-jKit4.cjs +13 -0
  70. package/dist/utils-Sn10glI8.js +7 -0
  71. package/package.json +35 -25
  72. package/src/api/index.ts +57 -0
  73. package/src/async_hooks/index.ts +1 -9
  74. package/src/context/endpoint-context.ts +32 -0
  75. package/src/context/index.ts +6 -0
  76. package/src/context/transaction.ts +63 -0
  77. package/src/db/index.ts +2 -0
  78. package/src/db/type.ts +1 -10
  79. package/src/env/color-depth.ts +4 -5
  80. package/src/error/codes.ts +1 -1
  81. package/src/social-providers/apple.ts +2 -2
  82. package/src/social-providers/atlassian.ts +4 -7
  83. package/src/social-providers/cognito.ts +4 -7
  84. package/src/social-providers/discord.ts +2 -5
  85. package/src/social-providers/dropbox.ts +2 -2
  86. package/src/social-providers/facebook.ts +3 -6
  87. package/src/social-providers/figma.ts +4 -7
  88. package/src/social-providers/github.ts +2 -2
  89. package/src/social-providers/gitlab.ts +2 -2
  90. package/src/social-providers/google.ts +4 -7
  91. package/src/social-providers/huggingface.ts +2 -2
  92. package/src/social-providers/kakao.ts +2 -2
  93. package/src/social-providers/kick.ts +2 -5
  94. package/src/social-providers/line.ts +2 -2
  95. package/src/social-providers/linear.ts +2 -2
  96. package/src/social-providers/linkedin.ts +2 -2
  97. package/src/social-providers/microsoft-entra-id.ts +3 -3
  98. package/src/social-providers/naver.ts +2 -2
  99. package/src/social-providers/notion.ts +2 -2
  100. package/src/social-providers/paypal.ts +3 -3
  101. package/src/social-providers/reddit.ts +2 -2
  102. package/src/social-providers/roblox.ts +2 -5
  103. package/src/social-providers/salesforce.ts +4 -7
  104. package/src/social-providers/slack.ts +2 -5
  105. package/src/social-providers/spotify.ts +2 -2
  106. package/src/social-providers/tiktok.ts +2 -5
  107. package/src/social-providers/twitch.ts +3 -3
  108. package/src/social-providers/twitter.ts +2 -2
  109. package/src/social-providers/vk.ts +2 -5
  110. package/src/social-providers/zoom.ts +2 -5
  111. package/src/types/context.ts +20 -99
  112. package/src/types/index.ts +1 -1
  113. package/src/types/init-options.ts +20 -22
  114. package/src/types/plugin.ts +3 -3
  115. package/{build.config.ts → tsdown.config.ts} +8 -11
  116. package/dist/async_hooks/index.d.mts +0 -10
  117. package/dist/async_hooks/index.mjs +0 -25
  118. package/dist/db/adapter/index.d.mts +0 -14
  119. package/dist/db/adapter/index.mjs +0 -1
  120. package/dist/db/index.d.mts +0 -39
  121. package/dist/db/index.mjs +0 -70
  122. package/dist/env/index.d.mts +0 -36
  123. package/dist/env/index.mjs +0 -297
  124. package/dist/error/index.d.mts +0 -33
  125. package/dist/error/index.mjs +0 -41
  126. package/dist/index.d.mts +0 -180
  127. package/dist/index.mjs +0 -1
  128. package/dist/middleware/index.cjs +0 -25
  129. package/dist/middleware/index.d.cts +0 -14
  130. package/dist/middleware/index.d.mts +0 -14
  131. package/dist/middleware/index.d.ts +0 -14
  132. package/dist/middleware/index.mjs +0 -21
  133. package/dist/oauth2/index.d.mts +0 -100
  134. package/dist/oauth2/index.mjs +0 -357
  135. package/dist/shared/core.BJPBStdk.d.ts +0 -1693
  136. package/dist/shared/core.Bl6TpxyD.d.mts +0 -181
  137. package/dist/shared/core.Bqe5IGAi.d.ts +0 -13
  138. package/dist/shared/core.BwoNUcJQ.d.cts +0 -53
  139. package/dist/shared/core.BwoNUcJQ.d.mts +0 -53
  140. package/dist/shared/core.BwoNUcJQ.d.ts +0 -53
  141. package/dist/shared/core.CajxAutx.d.cts +0 -143
  142. package/dist/shared/core.CajxAutx.d.mts +0 -143
  143. package/dist/shared/core.CajxAutx.d.ts +0 -143
  144. package/dist/shared/core.CkkLHQWc.d.mts +0 -1693
  145. package/dist/shared/core.DkdZ1o38.d.ts +0 -181
  146. package/dist/shared/core.Dl-70uns.d.cts +0 -84
  147. package/dist/shared/core.Dl-70uns.d.mts +0 -84
  148. package/dist/shared/core.Dl-70uns.d.ts +0 -84
  149. package/dist/shared/core.DyEdx0m7.d.cts +0 -181
  150. package/dist/shared/core.E9DfzGLz.d.mts +0 -13
  151. package/dist/shared/core.HqYn20Fi.d.cts +0 -13
  152. package/dist/shared/core.gYIBmdi1.d.cts +0 -1693
  153. package/dist/social-providers/index.d.mts +0 -3903
  154. package/dist/social-providers/index.mjs +0 -2743
  155. package/dist/utils/index.d.mts +0 -10
  156. package/dist/utils/index.mjs +0 -5
  157. package/src/middleware/index.ts +0 -33
@@ -1,77 +1,82 @@
1
1
 
2
- > @better-auth/core@1.3.28 build /home/runner/work/better-auth/better-auth/packages/core
3
- > unbuild --clean
4
-
5
- [info] Building core
6
- [info] Cleaning dist directory: `./dist`
7
- Generated an empty chunk: "index".
8
- Generated an empty chunk: "db/adapter/index".
9
- Generated an empty chunk: "index".
10
- Generated an empty chunk: "db/adapter/index".
11
- "bun:sqlite" is imported by "src/types/init-options.ts", but could not be resolved – treating it as an external dependency.
12
- "node:sqlite" is imported by "src/types/init-options.ts", but could not be resolved – treating it as an external dependency.
13
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
14
- Either change the import in "src/oauth2/create-authorization-url.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
15
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
16
- Either change the import in "src/oauth2/validate-authorization-code.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
17
- Export "OAuthProvider" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
18
- Either change the import in "src/types/context.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
19
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
20
- Either change the import in "src/oauth2/create-authorization-url.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
21
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
22
- Either change the import in "src/oauth2/validate-authorization-code.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
23
- Export "OAuthProvider" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
24
- Either change the import in "src/types/context.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
25
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
26
- Either change the import in "src/oauth2/create-authorization-url.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
27
- Export "ProviderOptions" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
28
- Either change the import in "src/oauth2/validate-authorization-code.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
29
- Export "OAuthProvider" of module "src/oauth2/oauth-provider.ts" was reexported through module "src/oauth2/index.ts" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.
30
- Either change the import in "src/types/context.ts" to point directly to the exporting module or reconfigure "output.manualChunks" to ensure these modules end up in the same chunk.
31
- [success] Build succeeded for core
32
- [log] dist/index.cjs (total size: 15 B, chunk size: 15 B)
33
-
34
- [log] dist/async_hooks/index.cjs (total size: 922 B, chunk size: 922 B, exports: getAsyncLocalStorage)
35
-
36
- [log] dist/middleware/index.cjs (total size: 610 B, chunk size: 610 B, exports: createAuthEndpoint, createAuthMiddleware, optionsMiddleware)
37
-
38
- [log] dist/utils/index.cjs (total size: 114 B, chunk size: 114 B, exports: defineErrorCodes)
39
-
40
- [log] dist/error/index.cjs (total size: 1.75 kB, chunk size: 1.75 kB, exports: BASE_ERROR_CODES, BetterAuthError)
41
-
42
- [log] dist/env/index.cjs (total size: 8.61 kB, chunk size: 8.61 kB, exports: ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog)
43
-
44
- [log] dist/oauth2/index.cjs (total size: 10.3 kB, chunk size: 10.3 kB, exports: clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken)
45
-
46
- [log] dist/db/index.cjs (total size: 2.43 kB, chunk size: 2.43 kB, exports: accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema)
47
-
48
- [log] dist/social-providers/index.cjs (total size: 87.9 kB, chunk size: 86.1 kB, exports: SocialProviderListEnum, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paypal, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom)
49
- └─ dist/error/index.cjs (1.75 kB)
50
-
51
- [log] dist/db/adapter/index.cjs (total size: 15 B, chunk size: 15 B)
52
- [log] dist/index.mjs (total size: 1 B, chunk size: 1 B)
53
-
54
- [log] dist/async_hooks/index.mjs (total size: 887 B, chunk size: 887 B, exports: getAsyncLocalStorage)
55
-
56
- [log] dist/middleware/index.mjs (total size: 495 B, chunk size: 495 B, exports: createAuthEndpoint, createAuthMiddleware, optionsMiddleware)
57
-
58
- [log] dist/utils/index.mjs (total size: 83 B, chunk size: 83 B, exports: defineErrorCodes)
59
-
60
- [log] dist/error/index.mjs (total size: 1.7 kB, chunk size: 1.7 kB, exports: BASE_ERROR_CODES, BetterAuthError)
61
-
62
- [log] dist/env/index.mjs (total size: 8.32 kB, chunk size: 8.32 kB, exports: ENV, TTY_COLORS, createLogger, env, getBooleanEnvVar, getColorDepth, getEnvVar, isDevelopment, isProduction, isTest, levels, logger, nodeENV, shouldPublishLog)
63
-
64
- [log] dist/oauth2/index.mjs (total size: 9.88 kB, chunk size: 9.88 kB, exports: clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken)
65
-
66
- [log] dist/db/index.mjs (total size: 1.67 kB, chunk size: 1.67 kB, exports: accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema)
67
-
68
- [log] dist/social-providers/index.mjs (total size: 85.8 kB, chunk size: 84.1 kB, exports: SocialProviderListEnum, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paypal, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom)
69
- └─ dist/error/index.mjs (1.7 kB)
70
-
71
- [log] dist/db/adapter/index.mjs (total size: 1 B, chunk size: 1 B)
72
- Σ Total dist size (byte size): 863 kB
73
- [log]
74
- [warn] Build is done with some warnings:
75
-
76
- - Implicitly bundling "bun:sqlite"
77
- - Implicitly bundling "node:sqlite"
2
+ > @better-auth/core@1.4.0-beta.11 build /home/runner/work/better-auth/better-auth/packages/core
3
+ > tsdown
4
+
5
+ ℹ tsdown v0.15.6 powered by rolldown v1.0.0-beta.43
6
+ ℹ Using tsdown config: /home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts
7
+ ℹ entry: src/index.ts, src/api/index.ts, src/async_hooks/index.ts, src/context/index.ts, src/db/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
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ [CJS] dist/social-providers/index.cjs 77.23 kB │ gzip: 10.22 kB
11
+ ℹ [CJS] dist/db/index.cjs  1.86 kB │ gzip: 0.56 kB
12
+ ℹ [CJS] dist/api/index.cjs  1.07 kB │ gzip: 0.46 kB
13
+ ℹ [CJS] dist/oauth2/index.cjs  0.80 kB │ gzip: 0.24 kB
14
+ ℹ [CJS] dist/env/index.cjs  0.67 kB │ gzip: 0.24 kB
15
+ ℹ [CJS] dist/context/index.cjs  0.42 kB │ gzip: 0.18 kB
16
+ ℹ [CJS] dist/error/index.cjs  0.21 kB │ gzip: 0.14 kB
17
+ ℹ [CJS] dist/async_hooks/index.cjs  0.14 kB │ gzip: 0.11 kB
18
+ ℹ [CJS] dist/utils/index.cjs  0.12 kB │ gzip: 0.10 kB
19
+ ℹ [CJS] dist/db/adapter/index.cjs  0.00 kB │ gzip: 0.02 kB
20
+ ℹ [CJS] dist/index.cjs  0.00 kB │ gzip: 0.02 kB
21
+ ℹ [CJS] dist/oauth2-DqX_pPhp.cjs 10.87 kB │ gzip: 2.29 kB
22
+ ℹ [CJS] dist/env-D1OdwBk9.cjs  9.16 kB │ gzip: 2.64 kB
23
+ ℹ [CJS] dist/context-DAu9ytQl.cjs  2.40 kB │ gzip: 0.64 kB
24
+ ℹ [CJS] dist/error-k9KM7GAb.cjs  1.98 kB │ gzip: 0.86 kB
25
+ ℹ [CJS] dist/chunk-CUT6urMc.cjs  1.09 kB │ gzip: 0.54 kB
26
+ ℹ [CJS] dist/async_hooks-CaXONcb9.cjs  0.97 kB │ gzip: 0.51 kB
27
+ ℹ [CJS] dist/utils-Bs-jKit4.cjs  0.23 kB │ gzip: 0.17 kB
28
+ ℹ [CJS] 18 files, total: 109.21 kB
29
+ ℹ [ESM] dist/social-providers/index.js  73.39 kB │ gzip: 9.98 kB
30
+ ℹ [ESM] dist/db/index.js  1.58 kB │ gzip: 0.49 kB
31
+ ℹ [ESM] dist/api/index.js  0.83 kB │ gzip: 0.40 kB
32
+ ℹ [ESM] dist/oauth2/index.js  0.56 kB │ gzip: 0.19 kB
33
+ ℹ [ESM] dist/env/index.js  0.37 kB │ gzip: 0.18 kB
34
+ ℹ [ESM] dist/context/index.js  0.29 kB │ gzip: 0.15 kB
35
+ ℹ [ESM] dist/error/index.js  0.15 kB │ gzip: 0.12 kB
36
+ ℹ [ESM] dist/async_hooks/index.js  0.10 kB │ gzip: 0.09 kB
37
+ ℹ [ESM] dist/utils/index.js  0.09 kB │ gzip: 0.08 kB
38
+ ℹ [ESM] dist/db/adapter/index.js  0.01 kB │ gzip: 0.03 kB
39
+ ℹ [ESM] dist/index.js  0.01 kB │ gzip: 0.03 kB
40
+ ℹ [ESM] dist/oauth2-D_FUKfC8.js  9.18 kB │ gzip: 2.10 kB
41
+ ℹ [ESM] dist/env-DzHiLVFb.js  7.68 kB │ gzip: 2.52 kB
42
+ ℹ [ESM] dist/context-rhoB1CVr.js  1.79 kB │ gzip: 0.56 kB
43
+ ℹ [ESM] dist/error-H6U5qGNP.js  1.75 kB │ gzip: 0.78 kB
44
+ ℹ [ESM] dist/async_hooks-CkLtIFa6.js  0.86 kB │ gzip: 0.46 kB
45
+ ℹ [ESM] dist/utils-Sn10glI8.js  0.13 kB │ gzip: 0.11 kB
46
+ ℹ [ESM] dist/social-providers/index.d.ts  3.00 kB │ gzip: 0.63 kB
47
+ ℹ [ESM] dist/error/index.d.ts  1.83 kB │ gzip: 0.71 kB
48
+ ℹ [ESM] dist/context/index.d.ts  0.91 kB │ gzip: 0.35 kB
49
+ ℹ [ESM] dist/db/index.d.ts  0.86 kB │ gzip: 0.26 kB
50
+ ℹ [ESM] dist/utils/index.d.ts  0.84 kB │ gzip: 0.43 kB
51
+ ℹ [ESM] dist/index.d.ts  0.83 kB │ gzip: 0.28 kB
52
+ ℹ [ESM] dist/oauth2/index.d.ts  0.71 kB │ gzip: 0.23 kB
53
+ ℹ [ESM] dist/db/adapter/index.d.ts  0.55 kB │ gzip: 0.22 kB
54
+ ℹ [ESM] dist/env/index.d.ts  0.49 kB │ gzip: 0.22 kB
55
+ ℹ [ESM] dist/api/index.d.ts  0.39 kB │ gzip: 0.17 kB
56
+ ℹ [ESM] dist/async_hooks/index.d.ts  0.24 kB │ gzip: 0.16 kB
57
+ ℹ [ESM] dist/index-BPsqLi68.d.ts 109.59 kB │ gzip: 13.64 kB
58
+ ℹ [ESM] dist/index-OrTFOyAG.d.ts  55.46 kB │ gzip: 11.63 kB
59
+ ℹ [ESM] dist/index-ChlC5Vy3.d.ts  8.95 kB │ gzip: 2.13 kB
60
+ ℹ [ESM] dist/index-Cmh0x42V.d.ts  8.24 kB │ gzip: 2.05 kB
61
+ ℹ [ESM] dist/index-CsHMVqbX.d.ts  3.18 kB │ gzip: 1.06 kB
62
+ ℹ [ESM] dist/helper-Dm5AtPVS.d.ts  0.33 kB │ gzip: 0.21 kB
63
+ ℹ [ESM] 34 files, total: 295.16 kB
64
+ ℹ [CJS] dist/social-providers/index.d.cts  3.00 kB │ gzip: 0.63 kB
65
+ ℹ [CJS] dist/error/index.d.cts  1.83 kB │ gzip: 0.71 kB
66
+ ℹ [CJS] dist/context/index.d.cts  0.92 kB │ gzip: 0.35 kB
67
+ ℹ [CJS] dist/db/index.d.cts  0.86 kB │ gzip: 0.26 kB
68
+ ℹ [CJS] dist/utils/index.d.cts  0.84 kB │ gzip: 0.43 kB
69
+ ℹ [CJS] dist/index.d.cts  0.83 kB │ gzip: 0.28 kB
70
+ ℹ [CJS] dist/oauth2/index.d.cts  0.71 kB │ gzip: 0.23 kB
71
+ ℹ [CJS] dist/db/adapter/index.d.cts  0.55 kB │ gzip: 0.22 kB
72
+ ℹ [CJS] dist/env/index.d.cts  0.50 kB │ gzip: 0.22 kB
73
+ ℹ [CJS] dist/api/index.d.cts  0.39 kB │ gzip: 0.18 kB
74
+ ℹ [CJS] dist/async_hooks/index.d.cts  0.24 kB │ gzip: 0.16 kB
75
+ ℹ [CJS] dist/index-ehsSkBxt.d.cts 109.59 kB │ gzip: 13.64 kB
76
+ ℹ [CJS] dist/index-yBChAjSS.d.cts  55.47 kB │ gzip: 11.63 kB
77
+ ℹ [CJS] dist/index-_Oiv-VVr.d.cts  8.95 kB │ gzip: 2.13 kB
78
+ ℹ [CJS] dist/index-CgIE2ECh.d.cts  8.24 kB │ gzip: 2.06 kB
79
+ ℹ [CJS] dist/index-DFwrZMma.d.cts  3.18 kB │ gzip: 1.06 kB
80
+ ℹ [CJS] dist/helper-DVgWo5zB.d.cts  0.33 kB │ gzip: 0.21 kB
81
+ ℹ [CJS] 17 files, total: 196.44 kB
82
+ ✔ Build complete in 3927ms
@@ -0,0 +1,30 @@
1
+ const require_chunk = require('../chunk-CUT6urMc.cjs');
2
+ require('../async_hooks-CaXONcb9.cjs');
3
+ const require_context = require('../context-DAu9ytQl.cjs');
4
+ let better_call = require("better-call");
5
+ better_call = require_chunk.__toESM(better_call);
6
+
7
+ //#region src/api/index.ts
8
+ const optionsMiddleware = (0, better_call.createMiddleware)(async () => {
9
+ /**
10
+ * This will be passed on the instance of
11
+ * the context. Used to infer the type
12
+ * here.
13
+ */
14
+ return {};
15
+ });
16
+ const createAuthMiddleware = better_call.createMiddleware.create({ use: [optionsMiddleware, (0, better_call.createMiddleware)(async () => {
17
+ return {};
18
+ })] });
19
+ const use = [optionsMiddleware];
20
+ const createAuthEndpoint = (path, options, handler) => {
21
+ return (0, better_call.createEndpoint)(path, {
22
+ ...options,
23
+ use: [...options?.use || [], ...use]
24
+ }, async (ctx) => require_context.runWithEndpointContext(ctx, () => handler(ctx)));
25
+ };
26
+
27
+ //#endregion
28
+ exports.createAuthEndpoint = createAuthEndpoint;
29
+ exports.createAuthMiddleware = createAuthMiddleware;
30
+ exports.optionsMiddleware = optionsMiddleware;
@@ -0,0 +1,7 @@
1
+ import "../helper-DVgWo5zB.cjs";
2
+ import "../index-CgIE2ECh.cjs";
3
+ import { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware } from "../index-yBChAjSS.cjs";
4
+ import "../index-_Oiv-VVr.cjs";
5
+ import "../index-ehsSkBxt.cjs";
6
+ import "../index-DFwrZMma.cjs";
7
+ export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
@@ -0,0 +1,7 @@
1
+ import "../helper-Dm5AtPVS.js";
2
+ import "../index-Cmh0x42V.js";
3
+ import { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware } from "../index-OrTFOyAG.js";
4
+ import "../index-ChlC5Vy3.js";
5
+ import "../index-BPsqLi68.js";
6
+ import "../index-CsHMVqbX.js";
7
+ export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
@@ -0,0 +1,26 @@
1
+ import "../async_hooks-CkLtIFa6.js";
2
+ import { runWithEndpointContext } from "../context-rhoB1CVr.js";
3
+ import { createEndpoint, createMiddleware } from "better-call";
4
+
5
+ //#region src/api/index.ts
6
+ const optionsMiddleware = createMiddleware(async () => {
7
+ /**
8
+ * This will be passed on the instance of
9
+ * the context. Used to infer the type
10
+ * here.
11
+ */
12
+ return {};
13
+ });
14
+ const createAuthMiddleware = createMiddleware.create({ use: [optionsMiddleware, createMiddleware(async () => {
15
+ return {};
16
+ })] });
17
+ const use = [optionsMiddleware];
18
+ const createAuthEndpoint = (path, options, handler) => {
19
+ return createEndpoint(path, {
20
+ ...options,
21
+ use: [...options?.use || [], ...use]
22
+ }, async (ctx) => runWithEndpointContext(ctx, () => handler(ctx)));
23
+ };
24
+
25
+ //#endregion
26
+ export { createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
@@ -1,27 +1,3 @@
1
- 'use strict';
1
+ const require_async_hooks = require('../async_hooks-CaXONcb9.cjs');
2
2
 
3
- let moduleName = "node:async_hooks";
4
- const AsyncLocalStoragePromise = import(
5
- /* @vite-ignore */
6
- /* webpackIgnore: true */
7
- moduleName
8
- ).then((mod) => mod.AsyncLocalStorage).catch((err) => {
9
- if ("AsyncLocalStorage" in globalThis) {
10
- return globalThis.AsyncLocalStorage;
11
- }
12
- console.warn(
13
- "[better-auth] Warning: AsyncLocalStorage is not available in this environment. Some features may not work as expected."
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;
22
- });
23
- async function getAsyncLocalStorage() {
24
- return AsyncLocalStoragePromise;
25
- }
26
-
27
- exports.getAsyncLocalStorage = getAsyncLocalStorage;
3
+ exports.getAsyncLocalStorage = require_async_hooks.getAsyncLocalStorage;
@@ -1,10 +1,7 @@
1
- import { AsyncLocalStorage } from 'node:async_hooks';
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 'node:async_hooks';
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,3 @@
1
+ import { getAsyncLocalStorage } from "../async_hooks-CkLtIFa6.js";
2
+
3
+ export { getAsyncLocalStorage };
@@ -0,0 +1,24 @@
1
+
2
+ //#region src/async_hooks/index.ts
3
+ const AsyncLocalStoragePromise = import(
4
+ /* @vite-ignore */
5
+ /* webpackIgnore: true */
6
+ "node:async_hooks"
7
+ ).then((mod) => mod.AsyncLocalStorage).catch((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;
13
+ });
14
+ async function getAsyncLocalStorage() {
15
+ return AsyncLocalStoragePromise;
16
+ }
17
+
18
+ //#endregion
19
+ Object.defineProperty(exports, 'getAsyncLocalStorage', {
20
+ enumerable: true,
21
+ get: function () {
22
+ return getAsyncLocalStorage;
23
+ }
24
+ });
@@ -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
+ });
@@ -0,0 +1,8 @@
1
+ require('../async_hooks-CaXONcb9.cjs');
2
+ const require_context = require('../context-DAu9ytQl.cjs');
3
+
4
+ exports.getCurrentAdapter = require_context.getCurrentAdapter;
5
+ exports.getEndpointContext = require_context.getEndpointContext;
6
+ exports.runWithAdapter = require_context.runWithAdapter;
7
+ exports.runWithEndpointContext = require_context.runWithEndpointContext;
8
+ exports.runWithTransaction = require_context.runWithTransaction;
@@ -0,0 +1,17 @@
1
+ import "../helper-DVgWo5zB.cjs";
2
+ import "../index-CgIE2ECh.cjs";
3
+ import { DBAdapter, DBTransactionAdapter, GenericEndpointContext } from "../index-yBChAjSS.cjs";
4
+ import "../index-_Oiv-VVr.cjs";
5
+ import "../index-ehsSkBxt.cjs";
6
+ import "../index-DFwrZMma.cjs";
7
+
8
+ //#region src/context/transaction.d.ts
9
+ declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
10
+ declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
11
+ declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
12
+ //#endregion
13
+ //#region src/context/endpoint-context.d.ts
14
+ declare function getEndpointContext(): Promise<GenericEndpointContext>;
15
+ declare function runWithEndpointContext<T>(context: GenericEndpointContext, fn: () => T): Promise<T>;
16
+ //#endregion
17
+ export { getCurrentAdapter, getEndpointContext, runWithAdapter, runWithEndpointContext, runWithTransaction };
@@ -0,0 +1,17 @@
1
+ import "../helper-Dm5AtPVS.js";
2
+ import "../index-Cmh0x42V.js";
3
+ import { DBAdapter, DBTransactionAdapter, GenericEndpointContext } from "../index-OrTFOyAG.js";
4
+ import "../index-ChlC5Vy3.js";
5
+ import "../index-BPsqLi68.js";
6
+ import "../index-CsHMVqbX.js";
7
+
8
+ //#region src/context/transaction.d.ts
9
+ declare const getCurrentAdapter: (fallback: DBTransactionAdapter) => Promise<DBTransactionAdapter>;
10
+ declare const runWithAdapter: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
11
+ declare const runWithTransaction: <R>(adapter: DBAdapter, fn: () => R) => Promise<R>;
12
+ //#endregion
13
+ //#region src/context/endpoint-context.d.ts
14
+ declare function getEndpointContext(): Promise<GenericEndpointContext>;
15
+ declare function runWithEndpointContext<T>(context: GenericEndpointContext, fn: () => T): Promise<T>;
16
+ //#endregion
17
+ export { getCurrentAdapter, getEndpointContext, runWithAdapter, runWithEndpointContext, runWithTransaction };
@@ -0,0 +1,4 @@
1
+ import "../async_hooks-CkLtIFa6.js";
2
+ import { getCurrentAdapter, getEndpointContext, runWithAdapter, runWithEndpointContext, runWithTransaction } from "../context-rhoB1CVr.js";
3
+
4
+ export { getCurrentAdapter, getEndpointContext, runWithAdapter, runWithEndpointContext, runWithTransaction };
@@ -0,0 +1,85 @@
1
+ const require_async_hooks = require('./async_hooks-CaXONcb9.cjs');
2
+
3
+ //#region src/context/transaction.ts
4
+ let currentAdapterAsyncStorage = null;
5
+ const ensureAsyncStorage$1 = async () => {
6
+ if (!currentAdapterAsyncStorage) currentAdapterAsyncStorage = new (await (require_async_hooks.getAsyncLocalStorage()))();
7
+ return currentAdapterAsyncStorage;
8
+ };
9
+ const getCurrentAdapter = async (fallback) => {
10
+ return ensureAsyncStorage$1().then((als) => {
11
+ return als.getStore() || fallback;
12
+ }).catch(() => {
13
+ return fallback;
14
+ });
15
+ };
16
+ const runWithAdapter = async (adapter, fn) => {
17
+ let called = true;
18
+ return ensureAsyncStorage$1().then((als) => {
19
+ called = true;
20
+ return als.run(adapter, fn);
21
+ }).catch((err) => {
22
+ if (!called) return fn();
23
+ throw err;
24
+ });
25
+ };
26
+ const runWithTransaction = async (adapter, fn) => {
27
+ let called = true;
28
+ return ensureAsyncStorage$1().then((als) => {
29
+ called = true;
30
+ return adapter.transaction(async (trx) => {
31
+ return als.run(trx, fn);
32
+ });
33
+ }).catch((err) => {
34
+ if (!called) return fn();
35
+ throw err;
36
+ });
37
+ };
38
+
39
+ //#endregion
40
+ //#region src/context/endpoint-context.ts
41
+ let currentContextAsyncStorage = null;
42
+ const ensureAsyncStorage = async () => {
43
+ if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (require_async_hooks.getAsyncLocalStorage()))();
44
+ return currentContextAsyncStorage;
45
+ };
46
+ async function getEndpointContext() {
47
+ const context = (await ensureAsyncStorage()).getStore();
48
+ if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `getEndpointContext` callback.");
49
+ return context;
50
+ }
51
+ async function runWithEndpointContext(context, fn) {
52
+ return (await ensureAsyncStorage()).run(context, fn);
53
+ }
54
+
55
+ //#endregion
56
+ Object.defineProperty(exports, 'getCurrentAdapter', {
57
+ enumerable: true,
58
+ get: function () {
59
+ return getCurrentAdapter;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, 'getEndpointContext', {
63
+ enumerable: true,
64
+ get: function () {
65
+ return getEndpointContext;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, 'runWithAdapter', {
69
+ enumerable: true,
70
+ get: function () {
71
+ return runWithAdapter;
72
+ }
73
+ });
74
+ Object.defineProperty(exports, 'runWithEndpointContext', {
75
+ enumerable: true,
76
+ get: function () {
77
+ return runWithEndpointContext;
78
+ }
79
+ });
80
+ Object.defineProperty(exports, 'runWithTransaction', {
81
+ enumerable: true,
82
+ get: function () {
83
+ return runWithTransaction;
84
+ }
85
+ });
@@ -0,0 +1,56 @@
1
+ import { getAsyncLocalStorage } from "./async_hooks-CkLtIFa6.js";
2
+
3
+ //#region src/context/transaction.ts
4
+ let currentAdapterAsyncStorage = null;
5
+ const ensureAsyncStorage$1 = async () => {
6
+ if (!currentAdapterAsyncStorage) currentAdapterAsyncStorage = new (await (getAsyncLocalStorage()))();
7
+ return currentAdapterAsyncStorage;
8
+ };
9
+ const getCurrentAdapter = async (fallback) => {
10
+ return ensureAsyncStorage$1().then((als) => {
11
+ return als.getStore() || fallback;
12
+ }).catch(() => {
13
+ return fallback;
14
+ });
15
+ };
16
+ const runWithAdapter = async (adapter, fn) => {
17
+ let called = true;
18
+ return ensureAsyncStorage$1().then((als) => {
19
+ called = true;
20
+ return als.run(adapter, fn);
21
+ }).catch((err) => {
22
+ if (!called) return fn();
23
+ throw err;
24
+ });
25
+ };
26
+ const runWithTransaction = async (adapter, fn) => {
27
+ let called = true;
28
+ return ensureAsyncStorage$1().then((als) => {
29
+ called = true;
30
+ return adapter.transaction(async (trx) => {
31
+ return als.run(trx, fn);
32
+ });
33
+ }).catch((err) => {
34
+ if (!called) return fn();
35
+ throw err;
36
+ });
37
+ };
38
+
39
+ //#endregion
40
+ //#region src/context/endpoint-context.ts
41
+ let currentContextAsyncStorage = null;
42
+ const ensureAsyncStorage = async () => {
43
+ if (!currentContextAsyncStorage) currentContextAsyncStorage = new (await (getAsyncLocalStorage()))();
44
+ return currentContextAsyncStorage;
45
+ };
46
+ async function getEndpointContext() {
47
+ const context = (await ensureAsyncStorage()).getStore();
48
+ if (!context) throw new Error("No auth context found. Please make sure you are calling this function within a `getEndpointContext` callback.");
49
+ return context;
50
+ }
51
+ async function runWithEndpointContext(context, fn) {
52
+ return (await ensureAsyncStorage()).run(context, fn);
53
+ }
54
+
55
+ //#endregion
56
+ export { getCurrentAdapter, getEndpointContext, runWithAdapter, runWithEndpointContext, runWithTransaction };
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-