better-auth 1.2.0-beta.1 → 1.2.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 (205) hide show
  1. package/dist/adapters/drizzle.cjs +12 -5
  2. package/dist/adapters/drizzle.d.cts +6 -2
  3. package/dist/adapters/drizzle.d.ts +6 -2
  4. package/dist/adapters/drizzle.js +11 -4
  5. package/dist/adapters/kysely.cjs +5 -5
  6. package/dist/adapters/kysely.d.cts +6 -2
  7. package/dist/adapters/kysely.d.ts +6 -2
  8. package/dist/adapters/kysely.js +3 -3
  9. package/dist/adapters/memory.cjs +4 -4
  10. package/dist/adapters/memory.d.cts +6 -2
  11. package/dist/adapters/memory.d.ts +6 -2
  12. package/dist/adapters/memory.js +3 -3
  13. package/dist/adapters/mongodb.cjs +26 -8
  14. package/dist/adapters/mongodb.d.cts +6 -2
  15. package/dist/adapters/mongodb.d.ts +6 -2
  16. package/dist/adapters/mongodb.js +24 -6
  17. package/dist/adapters/prisma.cjs +18 -5
  18. package/dist/adapters/prisma.d.cts +6 -2
  19. package/dist/adapters/prisma.d.ts +6 -2
  20. package/dist/adapters/prisma.js +16 -3
  21. package/dist/adapters/test.cjs +1 -1
  22. package/dist/adapters/test.d.cts +2 -2
  23. package/dist/adapters/test.d.ts +2 -2
  24. package/dist/adapters/test.js +1 -1
  25. package/dist/api.cjs +48 -44
  26. package/dist/api.d.cts +3 -3
  27. package/dist/api.d.ts +3 -3
  28. package/dist/api.js +5 -5
  29. package/dist/{auth-DcMc3BIq.d.ts → auth-C-uLTIcY.d.ts} +12002 -7646
  30. package/dist/{auth-D4rdpxtI.d.cts → auth-lDfjrjVd.d.cts} +12002 -7646
  31. package/dist/{chunk-MGJLVQOV.js → chunk-2OAHQPLI.js} +100 -38
  32. package/dist/{chunk-5E75URIA.cjs → chunk-2Z6CVQHH.cjs} +0 -4
  33. package/dist/{chunk-WVLPJXQR.cjs → chunk-3FWLBBDV.cjs} +109 -51
  34. package/dist/{chunk-WDOY7YUW.cjs → chunk-6P33VPUY.cjs} +106 -44
  35. package/dist/{chunk-ADGXBH3Y.js → chunk-6XMAWIGH.js} +29 -26
  36. package/dist/{chunk-G7HOSQ5N.cjs → chunk-75MYIQ34.cjs} +15 -18
  37. package/dist/{chunk-YW3B2ST3.js → chunk-BY25AMN4.js} +116 -5
  38. package/dist/{chunk-LZ5DEQVH.cjs → chunk-C4T7TNDG.cjs} +3 -3
  39. package/dist/{chunk-PJ4KWXLQ.cjs → chunk-DH5E7574.cjs} +8 -8
  40. package/dist/{chunk-5RY45WFV.js → chunk-DIIVSN3J.js} +36 -13
  41. package/dist/{chunk-OSBTXYDD.cjs → chunk-GQKBG2VQ.cjs} +125 -14
  42. package/dist/{chunk-BKFMDM3P.js → chunk-HRI7BYTU.js} +115 -16
  43. package/dist/{chunk-6O2GLU2U.cjs → chunk-ICONG5HP.cjs} +18 -13
  44. package/dist/{chunk-3EY3LSQR.js → chunk-IVS5VS3V.js} +75 -36
  45. package/dist/{chunk-YRUDZRY3.cjs → chunk-IYCSNEDU.cjs} +79 -56
  46. package/dist/{chunk-NU4SXYJ5.cjs → chunk-JDAHD767.cjs} +198 -42
  47. package/dist/{chunk-UP6VJQDB.js → chunk-JHLVXVME.js} +17 -10
  48. package/dist/{chunk-WLXFBYQ6.cjs → chunk-JU56U5MW.cjs} +79 -9
  49. package/dist/{chunk-QFYRLTM5.cjs → chunk-JYPC7ZAL.cjs} +52 -49
  50. package/dist/{chunk-UHGAA4GH.cjs → chunk-KNVDJ4WK.cjs} +5 -5
  51. package/dist/{chunk-CVDYU5OC.js → chunk-M6SPJGF4.js} +5 -8
  52. package/dist/{chunk-BAPXDO3E.cjs → chunk-MKNA7SED.cjs} +125 -26
  53. package/dist/{chunk-GTM45OYP.cjs → chunk-NQFRXDEY.cjs} +3 -3
  54. package/dist/{chunk-FXNG3YQA.js → chunk-NXQP77NI.js} +146 -79
  55. package/dist/{chunk-FA6UYV37.js → chunk-PR54V2QL.js} +29 -10
  56. package/dist/{chunk-JLATHUM5.cjs → chunk-QBYD37C7.cjs} +21 -14
  57. package/dist/{chunk-E6LJZ5ME.js → chunk-QFIG4XKQ.js} +1 -1
  58. package/dist/{chunk-764RYNTE.cjs → chunk-QS2XIJC4.cjs} +63 -29
  59. package/dist/{chunk-GTQM7JU7.js → chunk-R42K7GPF.js} +3 -1
  60. package/dist/{chunk-3BWJXTLC.cjs → chunk-RHWADEUT.cjs} +81 -58
  61. package/dist/{chunk-JNZYTS3B.js → chunk-RS2A52JD.js} +1 -1
  62. package/dist/{chunk-5OBRFII2.js → chunk-SIAKIOPW.js} +81 -23
  63. package/dist/{chunk-V6RGXSG4.cjs → chunk-SVC7H7K4.cjs} +3 -1
  64. package/dist/{chunk-EM73ZZSP.cjs → chunk-TID6AR5K.cjs} +49 -30
  65. package/dist/{chunk-VXDYNCOX.js → chunk-TODG5RSV.js} +172 -19
  66. package/dist/{chunk-VPCROEJW.cjs → chunk-TZ2VLKIG.cjs} +170 -103
  67. package/dist/{chunk-WGCTQNSQ.js → chunk-UHBMFLSF.js} +1 -1
  68. package/dist/{chunk-PIWBUHRB.cjs → chunk-UPQLFVFU.cjs} +83 -43
  69. package/dist/{chunk-B5UCLTPZ.cjs → chunk-UQC2FUXC.cjs} +2 -1
  70. package/dist/{chunk-RGG6OEA3.js → chunk-VUXQHI6K.js} +60 -26
  71. package/dist/{chunk-2LQ7T2GE.js → chunk-WUUDJ3TF.js} +3 -3
  72. package/dist/{chunk-HZBNUY7E.js → chunk-WZ6OIVJK.js} +2 -1
  73. package/dist/{chunk-5XAVWKUN.js → chunk-X4X6WCXH.js} +74 -4
  74. package/dist/{chunk-NPO64SVN.js → chunk-ZFUBVSZD.js} +0 -4
  75. package/dist/{chunk-S6MI7ZLE.js → chunk-ZKNBNGHR.js} +12 -7
  76. package/dist/{chunk-5KMF6HGF.js → chunk-ZUGWIOG4.js} +75 -52
  77. package/dist/client/plugins.cjs +215 -21
  78. package/dist/client/plugins.d.cts +176 -10
  79. package/dist/client/plugins.d.ts +176 -10
  80. package/dist/client/plugins.js +214 -14
  81. package/dist/client.d.cts +6 -7
  82. package/dist/client.d.ts +6 -7
  83. package/dist/cookies.d.cts +2 -2
  84. package/dist/cookies.d.ts +2 -2
  85. package/dist/db.cjs +29 -29
  86. package/dist/db.d.cts +6 -6
  87. package/dist/db.d.ts +6 -6
  88. package/dist/db.js +3 -3
  89. package/dist/index-BX_H-j6k.d.cts +7755 -0
  90. package/dist/{index-Ba5bMY6A.d.cts → index-BuRgaJZR.d.cts} +194 -2
  91. package/dist/index-D5zWKzf9.d.ts +7755 -0
  92. package/dist/{index-XrJz4AYF.d.ts → index-moQjyfmm.d.ts} +194 -2
  93. package/dist/index.cjs +19 -19
  94. package/dist/index.d.cts +3 -3
  95. package/dist/index.d.ts +3 -3
  96. package/dist/index.js +9 -9
  97. package/dist/next-js.cjs +24 -24
  98. package/dist/next-js.d.cts +2 -2
  99. package/dist/next-js.d.ts +2 -2
  100. package/dist/next-js.js +23 -23
  101. package/dist/node.d.cts +2 -2
  102. package/dist/node.d.ts +2 -2
  103. package/dist/oauth2.cjs +9 -9
  104. package/dist/oauth2.d.cts +6 -5
  105. package/dist/oauth2.d.ts +6 -5
  106. package/dist/oauth2.js +2 -2
  107. package/dist/plugins/admin.cjs +7 -7
  108. package/dist/plugins/admin.d.cts +163 -32
  109. package/dist/plugins/admin.d.ts +163 -32
  110. package/dist/plugins/admin.js +6 -6
  111. package/dist/plugins/anonymous.cjs +7 -7
  112. package/dist/plugins/anonymous.d.cts +8 -4
  113. package/dist/plugins/anonymous.d.ts +8 -4
  114. package/dist/plugins/anonymous.js +6 -6
  115. package/dist/plugins/bearer.cjs +7 -7
  116. package/dist/plugins/bearer.d.cts +2 -2
  117. package/dist/plugins/bearer.d.ts +2 -2
  118. package/dist/plugins/bearer.js +6 -6
  119. package/dist/{plugin → plugins}/custom-session.cjs +7 -7
  120. package/dist/{plugin → plugins}/custom-session.d.cts +8 -4
  121. package/dist/{plugin → plugins}/custom-session.d.ts +8 -4
  122. package/dist/{plugin → plugins}/custom-session.js +6 -6
  123. package/dist/plugins/email-otp.cjs +7 -7
  124. package/dist/plugins/email-otp.d.cts +44 -16
  125. package/dist/plugins/email-otp.d.ts +44 -16
  126. package/dist/plugins/email-otp.js +6 -6
  127. package/dist/plugins/generic-oauth.cjs +7 -7
  128. package/dist/plugins/generic-oauth.d.cts +95 -6
  129. package/dist/plugins/generic-oauth.d.ts +95 -6
  130. package/dist/plugins/generic-oauth.js +6 -6
  131. package/dist/plugins/jwt.cjs +7 -7
  132. package/dist/plugins/jwt.d.cts +28 -6
  133. package/dist/plugins/jwt.d.ts +28 -6
  134. package/dist/plugins/jwt.js +6 -6
  135. package/dist/plugins/magic-link.cjs +7 -7
  136. package/dist/plugins/magic-link.d.cts +16 -4
  137. package/dist/plugins/magic-link.d.ts +16 -4
  138. package/dist/plugins/magic-link.js +6 -6
  139. package/dist/plugins/multi-session.cjs +7 -7
  140. package/dist/plugins/multi-session.d.cts +20 -8
  141. package/dist/plugins/multi-session.d.ts +20 -8
  142. package/dist/plugins/multi-session.js +6 -6
  143. package/dist/plugins/oidc-provider.cjs +7 -7
  144. package/dist/plugins/oidc-provider.d.cts +58 -15
  145. package/dist/plugins/oidc-provider.d.ts +58 -15
  146. package/dist/plugins/oidc-provider.js +6 -6
  147. package/dist/plugins/one-tap.cjs +7 -7
  148. package/dist/plugins/one-tap.d.cts +13 -2
  149. package/dist/plugins/one-tap.d.ts +13 -2
  150. package/dist/plugins/one-tap.js +6 -6
  151. package/dist/plugins/open-api.cjs +8 -8
  152. package/dist/plugins/open-api.d.cts +14 -6
  153. package/dist/plugins/open-api.d.ts +14 -6
  154. package/dist/plugins/open-api.js +7 -7
  155. package/dist/plugins/organization.cjs +7 -7
  156. package/dist/plugins/organization.d.cts +3 -3
  157. package/dist/plugins/organization.d.ts +3 -3
  158. package/dist/plugins/organization.js +6 -6
  159. package/dist/plugins/passkey.cjs +19 -31
  160. package/dist/plugins/passkey.d.cts +45 -148
  161. package/dist/plugins/passkey.d.ts +45 -148
  162. package/dist/plugins/passkey.js +5 -9
  163. package/dist/plugins/phone-number.cjs +7 -7
  164. package/dist/plugins/phone-number.d.cts +122 -9
  165. package/dist/plugins/phone-number.d.ts +122 -9
  166. package/dist/plugins/phone-number.js +6 -6
  167. package/dist/plugins/sso.cjs +27 -19
  168. package/dist/plugins/sso.d.cts +24 -8
  169. package/dist/plugins/sso.d.ts +24 -8
  170. package/dist/plugins/sso.js +14 -6
  171. package/dist/plugins/two-factor.cjs +7 -7
  172. package/dist/plugins/two-factor.d.cts +62 -22
  173. package/dist/plugins/two-factor.d.ts +62 -22
  174. package/dist/plugins/two-factor.js +6 -6
  175. package/dist/plugins/username.cjs +7 -7
  176. package/dist/plugins/username.d.cts +36 -4
  177. package/dist/plugins/username.d.ts +36 -4
  178. package/dist/plugins/username.js +6 -6
  179. package/dist/plugins.cjs +43 -43
  180. package/dist/plugins.d.cts +11 -7
  181. package/dist/plugins.d.ts +11 -7
  182. package/dist/plugins.js +23 -23
  183. package/dist/react.d.cts +7 -9
  184. package/dist/react.d.ts +7 -9
  185. package/dist/social.cjs +32 -20
  186. package/dist/social.d.cts +1 -1
  187. package/dist/social.d.ts +1 -1
  188. package/dist/social.js +3 -3
  189. package/dist/solid.d.cts +7 -7
  190. package/dist/solid.d.ts +7 -7
  191. package/dist/{state-Cm8el5M1.d.ts → state-CLmFUxz3.d.ts} +1 -1
  192. package/dist/{state-DcraY2_H.d.cts → state-CZgzjtR5.d.cts} +1 -1
  193. package/dist/svelte-kit.d.cts +2 -2
  194. package/dist/svelte-kit.d.ts +2 -2
  195. package/dist/svelte.d.cts +7 -7
  196. package/dist/svelte.d.ts +7 -7
  197. package/dist/types.d.cts +4 -4
  198. package/dist/types.d.ts +4 -4
  199. package/dist/vue.d.cts +7 -7
  200. package/dist/vue.d.ts +7 -7
  201. package/package.json +4 -4
  202. package/dist/chunk-4WCY4Y5J.js +0 -173
  203. package/dist/chunk-5AZFOKWY.cjs +0 -176
  204. package/dist/index-CvlKSqnF.d.cts +0 -4023
  205. package/dist/index-Ivs2EsUL.d.ts +0 -4023
@@ -1,9 +1,9 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { B as BetterAuthOptions, k as InferUser, l as InferSession } from '../auth-DcMc3BIq.js';
3
+ import { B as BetterAuthOptions, k as InferUser, l as InferSession } from '../auth-C-uLTIcY.js';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
6
- import '../index-XrJz4AYF.js';
6
+ import '../index-moQjyfmm.js';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
9
9
 
@@ -14,7 +14,7 @@ declare const customSession: <Returns extends Record<string, any>, O extends Bet
14
14
  id: "custom-session";
15
15
  endpoints: {
16
16
  getSession: {
17
- <Context extends {
17
+ <C extends [({
18
18
  body?: undefined;
19
19
  method?: "GET" | undefined;
20
20
  query?: {
@@ -28,7 +28,11 @@ declare const customSession: <Returns extends Record<string, any>, O extends Bet
28
28
  returnHeaders?: boolean | undefined;
29
29
  use?: better_call.Middleware[] | undefined;
30
30
  path?: string | undefined;
31
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
31
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
32
+ asResponse: true;
33
+ }] ? Response : C extends [{
34
+ returnHeaders: true;
35
+ }] ? {
32
36
  headers: Headers;
33
37
  response: Returns | null;
34
38
  } : Returns | null>;
@@ -1,12 +1,12 @@
1
- export { customSession } from '../chunk-WGCTQNSQ.js';
2
- import '../chunk-3EY3LSQR.js';
3
- import '../chunk-VXDYNCOX.js';
4
- import '../chunk-GTQM7JU7.js';
1
+ export { customSession } from '../chunk-UHBMFLSF.js';
2
+ import '../chunk-IVS5VS3V.js';
3
+ import '../chunk-TODG5RSV.js';
4
+ import '../chunk-R42K7GPF.js';
5
5
  import '../chunk-XFCIANZX.js';
6
6
  import '../chunk-QQGZ3XGI.js';
7
- import '../chunk-HZBNUY7E.js';
7
+ import '../chunk-WZ6OIVJK.js';
8
8
  import '../chunk-KLDFBLYL.js';
9
- import '../chunk-NPO64SVN.js';
9
+ import '../chunk-ZFUBVSZD.js';
10
10
  import '../chunk-3XTQSPPA.js';
11
11
  import '../chunk-DBPOZRMS.js';
12
12
  import '../chunk-53IPO2PJ.js';
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkQFYRLTM5_cjs = require('../chunk-QFYRLTM5.cjs');
3
+ var chunkJYPC7ZAL_cjs = require('../chunk-JYPC7ZAL.cjs');
4
4
  require('../chunk-JUPDDQC4.cjs');
5
- require('../chunk-PIWBUHRB.cjs');
6
- require('../chunk-NU4SXYJ5.cjs');
7
- require('../chunk-V6RGXSG4.cjs');
5
+ require('../chunk-UPQLFVFU.cjs');
6
+ require('../chunk-JDAHD767.cjs');
7
+ require('../chunk-SVC7H7K4.cjs');
8
8
  require('../chunk-S5UORXJH.cjs');
9
9
  require('../chunk-V6HE2MP7.cjs');
10
- require('../chunk-B5UCLTPZ.cjs');
10
+ require('../chunk-UQC2FUXC.cjs');
11
11
  require('../chunk-H74YRRNV.cjs');
12
- require('../chunk-5E75URIA.cjs');
12
+ require('../chunk-2Z6CVQHH.cjs');
13
13
  require('../chunk-CCKQSGIR.cjs');
14
14
  require('../chunk-G2LZ73E2.cjs');
15
15
  require('../chunk-OA7Z7IZT.cjs');
@@ -21,5 +21,5 @@ require('../chunk-PEZRSDZS.cjs');
21
21
 
22
22
  Object.defineProperty(exports, "emailOTP", {
23
23
  enumerable: true,
24
- get: function () { return chunkQFYRLTM5_cjs.emailOTP; }
24
+ get: function () { return chunkJYPC7ZAL_cjs.emailOTP; }
25
25
  });
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import * as better_call from 'better-call';
3
- import { H as HookEndpointContext } from '../auth-D4rdpxtI.cjs';
3
+ import { H as HookEndpointContext } from '../auth-lDfjrjVd.cjs';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
6
- import '../index-Ba5bMY6A.cjs';
6
+ import '../index-BuRgaJZR.cjs';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
9
9
 
@@ -46,7 +46,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
46
46
  id: "email-otp";
47
47
  endpoints: {
48
48
  sendVerificationOTP: {
49
- <Context extends {
49
+ <C extends [{
50
50
  body: {
51
51
  email: string;
52
52
  type: "sign-in" | "forget-password" | "email-verification";
@@ -60,7 +60,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
60
60
  returnHeaders?: boolean | undefined;
61
61
  use?: better_call.Middleware[] | undefined;
62
62
  path?: string | undefined;
63
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
63
+ }]>(...inputCtx: C): Promise<C extends [{
64
+ asResponse: true;
65
+ }] ? Response : C extends [{
66
+ returnHeaders: true;
67
+ }] ? {
64
68
  headers: Headers;
65
69
  response: {
66
70
  success: boolean;
@@ -108,7 +112,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
108
112
  path: "/email-otp/send-verification-otp";
109
113
  };
110
114
  createVerificationOTP: {
111
- <Context extends {
115
+ <C extends [{
112
116
  body: {
113
117
  email: string;
114
118
  type: "sign-in" | "forget-password" | "email-verification";
@@ -122,7 +126,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
122
126
  returnHeaders?: boolean | undefined;
123
127
  use?: better_call.Middleware[] | undefined;
124
128
  path?: string | undefined;
125
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
129
+ }]>(...inputCtx: C): Promise<C extends [{
130
+ asResponse: true;
131
+ }] ? Response : C extends [{
132
+ returnHeaders: true;
133
+ }] ? {
126
134
  headers: Headers;
127
135
  response: string;
128
136
  } : string>;
@@ -162,7 +170,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
162
170
  path: "/email-otp/create-verification-otp";
163
171
  };
164
172
  getVerificationOTP: {
165
- <Context extends {
173
+ <C extends [{
166
174
  query: {
167
175
  email: string;
168
176
  type: "sign-in" | "forget-password" | "email-verification";
@@ -176,7 +184,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
176
184
  returnHeaders?: boolean | undefined;
177
185
  use?: better_call.Middleware[] | undefined;
178
186
  path?: string | undefined;
179
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
187
+ }]>(...inputCtx: C): Promise<C extends [{
188
+ asResponse: true;
189
+ }] ? Response : C extends [{
190
+ returnHeaders: true;
191
+ }] ? {
180
192
  headers: Headers;
181
193
  response: {
182
194
  otp: null;
@@ -229,7 +241,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
229
241
  path: "/email-otp/get-verification-otp";
230
242
  };
231
243
  verifyEmailOTP: {
232
- <Context extends {
244
+ <C extends [{
233
245
  body: {
234
246
  email: string;
235
247
  otp: string;
@@ -243,7 +255,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
243
255
  returnHeaders?: boolean | undefined;
244
256
  use?: better_call.Middleware[] | undefined;
245
257
  path?: string | undefined;
246
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
258
+ }]>(...inputCtx: C): Promise<C extends [{
259
+ asResponse: true;
260
+ }] ? Response : C extends [{
261
+ returnHeaders: true;
262
+ }] ? {
247
263
  headers: Headers;
248
264
  response: {
249
265
  status: boolean;
@@ -335,7 +351,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
335
351
  path: "/email-otp/verify-email";
336
352
  };
337
353
  signInEmailOTP: {
338
- <Context extends {
354
+ <C extends [{
339
355
  body: {
340
356
  email: string;
341
357
  otp: string;
@@ -349,7 +365,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
349
365
  returnHeaders?: boolean | undefined;
350
366
  use?: better_call.Middleware[] | undefined;
351
367
  path?: string | undefined;
352
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
368
+ }]>(...inputCtx: C): Promise<C extends [{
369
+ asResponse: true;
370
+ }] ? Response : C extends [{
371
+ returnHeaders: true;
372
+ }] ? {
353
373
  headers: Headers;
354
374
  response: {
355
375
  token: string;
@@ -418,7 +438,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
418
438
  path: "/sign-in/email-otp";
419
439
  };
420
440
  forgetPasswordEmailOTP: {
421
- <Context extends {
441
+ <C extends [{
422
442
  body: {
423
443
  email: string;
424
444
  };
@@ -431,7 +451,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
431
451
  returnHeaders?: boolean | undefined;
432
452
  use?: better_call.Middleware[] | undefined;
433
453
  path?: string | undefined;
434
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
454
+ }]>(...inputCtx: C): Promise<C extends [{
455
+ asResponse: true;
456
+ }] ? Response : C extends [{
457
+ returnHeaders: true;
458
+ }] ? {
435
459
  headers: Headers;
436
460
  response: {
437
461
  success: boolean;
@@ -476,7 +500,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
476
500
  path: "/forget-password/email-otp";
477
501
  };
478
502
  resetPasswordEmailOTP: {
479
- <Context extends {
503
+ <C extends [{
480
504
  body: {
481
505
  password: string;
482
506
  email: string;
@@ -491,7 +515,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
491
515
  returnHeaders?: boolean | undefined;
492
516
  use?: better_call.Middleware[] | undefined;
493
517
  path?: string | undefined;
494
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
518
+ }]>(...inputCtx: C): Promise<C extends [{
519
+ asResponse: true;
520
+ }] ? Response : C extends [{
521
+ returnHeaders: true;
522
+ }] ? {
495
523
  headers: Headers;
496
524
  response: {
497
525
  success: boolean;
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  import * as better_call from 'better-call';
3
- import { H as HookEndpointContext } from '../auth-DcMc3BIq.js';
3
+ import { H as HookEndpointContext } from '../auth-C-uLTIcY.js';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
6
- import '../index-XrJz4AYF.js';
6
+ import '../index-moQjyfmm.js';
7
7
  import 'jose';
8
8
  import 'better-sqlite3';
9
9
 
@@ -46,7 +46,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
46
46
  id: "email-otp";
47
47
  endpoints: {
48
48
  sendVerificationOTP: {
49
- <Context extends {
49
+ <C extends [{
50
50
  body: {
51
51
  email: string;
52
52
  type: "sign-in" | "forget-password" | "email-verification";
@@ -60,7 +60,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
60
60
  returnHeaders?: boolean | undefined;
61
61
  use?: better_call.Middleware[] | undefined;
62
62
  path?: string | undefined;
63
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
63
+ }]>(...inputCtx: C): Promise<C extends [{
64
+ asResponse: true;
65
+ }] ? Response : C extends [{
66
+ returnHeaders: true;
67
+ }] ? {
64
68
  headers: Headers;
65
69
  response: {
66
70
  success: boolean;
@@ -108,7 +112,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
108
112
  path: "/email-otp/send-verification-otp";
109
113
  };
110
114
  createVerificationOTP: {
111
- <Context extends {
115
+ <C extends [{
112
116
  body: {
113
117
  email: string;
114
118
  type: "sign-in" | "forget-password" | "email-verification";
@@ -122,7 +126,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
122
126
  returnHeaders?: boolean | undefined;
123
127
  use?: better_call.Middleware[] | undefined;
124
128
  path?: string | undefined;
125
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
129
+ }]>(...inputCtx: C): Promise<C extends [{
130
+ asResponse: true;
131
+ }] ? Response : C extends [{
132
+ returnHeaders: true;
133
+ }] ? {
126
134
  headers: Headers;
127
135
  response: string;
128
136
  } : string>;
@@ -162,7 +170,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
162
170
  path: "/email-otp/create-verification-otp";
163
171
  };
164
172
  getVerificationOTP: {
165
- <Context extends {
173
+ <C extends [{
166
174
  query: {
167
175
  email: string;
168
176
  type: "sign-in" | "forget-password" | "email-verification";
@@ -176,7 +184,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
176
184
  returnHeaders?: boolean | undefined;
177
185
  use?: better_call.Middleware[] | undefined;
178
186
  path?: string | undefined;
179
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
187
+ }]>(...inputCtx: C): Promise<C extends [{
188
+ asResponse: true;
189
+ }] ? Response : C extends [{
190
+ returnHeaders: true;
191
+ }] ? {
180
192
  headers: Headers;
181
193
  response: {
182
194
  otp: null;
@@ -229,7 +241,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
229
241
  path: "/email-otp/get-verification-otp";
230
242
  };
231
243
  verifyEmailOTP: {
232
- <Context extends {
244
+ <C extends [{
233
245
  body: {
234
246
  email: string;
235
247
  otp: string;
@@ -243,7 +255,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
243
255
  returnHeaders?: boolean | undefined;
244
256
  use?: better_call.Middleware[] | undefined;
245
257
  path?: string | undefined;
246
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
258
+ }]>(...inputCtx: C): Promise<C extends [{
259
+ asResponse: true;
260
+ }] ? Response : C extends [{
261
+ returnHeaders: true;
262
+ }] ? {
247
263
  headers: Headers;
248
264
  response: {
249
265
  status: boolean;
@@ -335,7 +351,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
335
351
  path: "/email-otp/verify-email";
336
352
  };
337
353
  signInEmailOTP: {
338
- <Context extends {
354
+ <C extends [{
339
355
  body: {
340
356
  email: string;
341
357
  otp: string;
@@ -349,7 +365,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
349
365
  returnHeaders?: boolean | undefined;
350
366
  use?: better_call.Middleware[] | undefined;
351
367
  path?: string | undefined;
352
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
368
+ }]>(...inputCtx: C): Promise<C extends [{
369
+ asResponse: true;
370
+ }] ? Response : C extends [{
371
+ returnHeaders: true;
372
+ }] ? {
353
373
  headers: Headers;
354
374
  response: {
355
375
  token: string;
@@ -418,7 +438,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
418
438
  path: "/sign-in/email-otp";
419
439
  };
420
440
  forgetPasswordEmailOTP: {
421
- <Context extends {
441
+ <C extends [{
422
442
  body: {
423
443
  email: string;
424
444
  };
@@ -431,7 +451,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
431
451
  returnHeaders?: boolean | undefined;
432
452
  use?: better_call.Middleware[] | undefined;
433
453
  path?: string | undefined;
434
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
454
+ }]>(...inputCtx: C): Promise<C extends [{
455
+ asResponse: true;
456
+ }] ? Response : C extends [{
457
+ returnHeaders: true;
458
+ }] ? {
435
459
  headers: Headers;
436
460
  response: {
437
461
  success: boolean;
@@ -476,7 +500,7 @@ declare const emailOTP: (options: EmailOTPOptions) => {
476
500
  path: "/forget-password/email-otp";
477
501
  };
478
502
  resetPasswordEmailOTP: {
479
- <Context extends {
503
+ <C extends [{
480
504
  body: {
481
505
  password: string;
482
506
  email: string;
@@ -491,7 +515,11 @@ declare const emailOTP: (options: EmailOTPOptions) => {
491
515
  returnHeaders?: boolean | undefined;
492
516
  use?: better_call.Middleware[] | undefined;
493
517
  path?: string | undefined;
494
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
518
+ }]>(...inputCtx: C): Promise<C extends [{
519
+ asResponse: true;
520
+ }] ? Response : C extends [{
521
+ returnHeaders: true;
522
+ }] ? {
495
523
  headers: Headers;
496
524
  response: {
497
525
  success: boolean;
@@ -1,13 +1,13 @@
1
- export { emailOTP } from '../chunk-ADGXBH3Y.js';
1
+ export { emailOTP } from '../chunk-6XMAWIGH.js';
2
2
  import '../chunk-JEYF2ARX.js';
3
- import '../chunk-3EY3LSQR.js';
4
- import '../chunk-VXDYNCOX.js';
5
- import '../chunk-GTQM7JU7.js';
3
+ import '../chunk-IVS5VS3V.js';
4
+ import '../chunk-TODG5RSV.js';
5
+ import '../chunk-R42K7GPF.js';
6
6
  import '../chunk-XFCIANZX.js';
7
7
  import '../chunk-QQGZ3XGI.js';
8
- import '../chunk-HZBNUY7E.js';
8
+ import '../chunk-WZ6OIVJK.js';
9
9
  import '../chunk-KLDFBLYL.js';
10
- import '../chunk-NPO64SVN.js';
10
+ import '../chunk-ZFUBVSZD.js';
11
11
  import '../chunk-3XTQSPPA.js';
12
12
  import '../chunk-DBPOZRMS.js';
13
13
  import '../chunk-53IPO2PJ.js';
@@ -1,14 +1,14 @@
1
1
  'use strict';
2
2
 
3
- var chunkOSBTXYDD_cjs = require('../chunk-OSBTXYDD.cjs');
4
- require('../chunk-PIWBUHRB.cjs');
5
- require('../chunk-NU4SXYJ5.cjs');
6
- require('../chunk-V6RGXSG4.cjs');
3
+ var chunkGQKBG2VQ_cjs = require('../chunk-GQKBG2VQ.cjs');
4
+ require('../chunk-UPQLFVFU.cjs');
5
+ require('../chunk-JDAHD767.cjs');
6
+ require('../chunk-SVC7H7K4.cjs');
7
7
  require('../chunk-S5UORXJH.cjs');
8
8
  require('../chunk-V6HE2MP7.cjs');
9
- require('../chunk-B5UCLTPZ.cjs');
9
+ require('../chunk-UQC2FUXC.cjs');
10
10
  require('../chunk-H74YRRNV.cjs');
11
- require('../chunk-5E75URIA.cjs');
11
+ require('../chunk-2Z6CVQHH.cjs');
12
12
  require('../chunk-CCKQSGIR.cjs');
13
13
  require('../chunk-G2LZ73E2.cjs');
14
14
  require('../chunk-OA7Z7IZT.cjs');
@@ -20,5 +20,5 @@ require('../chunk-PEZRSDZS.cjs');
20
20
 
21
21
  Object.defineProperty(exports, "genericOAuth", {
22
22
  enumerable: true,
23
- get: function () { return chunkOSBTXYDD_cjs.genericOAuth; }
23
+ get: function () { return chunkGQKBG2VQ_cjs.genericOAuth; }
24
24
  });
@@ -1,7 +1,7 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { b as AuthContext, U as User } from '../auth-D4rdpxtI.cjs';
4
- import { O as OAuthProvider, a as OAuth2Tokens } from '../index-Ba5bMY6A.cjs';
3
+ import { b as AuthContext, U as User } from '../auth-lDfjrjVd.cjs';
4
+ import { O as OAuthProvider, a as OAuth2Tokens } from '../index-BuRgaJZR.cjs';
5
5
  import 'kysely';
6
6
  import '../helper-Bi8FQwDD.cjs';
7
7
  import 'better-sqlite3';
@@ -116,9 +116,10 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
116
116
  };
117
117
  endpoints: {
118
118
  signInWithOAuth2: {
119
- <Context extends {
119
+ <C extends [{
120
120
  body: {
121
121
  providerId: string;
122
+ scopes?: string[] | undefined;
122
123
  callbackURL?: string | undefined;
123
124
  errorCallbackURL?: string | undefined;
124
125
  newUserCallbackURL?: string | undefined;
@@ -133,7 +134,11 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
133
134
  returnHeaders?: boolean | undefined;
134
135
  use?: better_call.Middleware[] | undefined;
135
136
  path?: string | undefined;
136
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
137
+ }]>(...inputCtx: C): Promise<C extends [{
138
+ asResponse: true;
139
+ }] ? Response : C extends [{
140
+ returnHeaders: true;
141
+ }] ? {
137
142
  headers: Headers;
138
143
  response: {
139
144
  url: string;
@@ -151,14 +156,17 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
151
156
  errorCallbackURL: z.ZodOptional<z.ZodString>;
152
157
  newUserCallbackURL: z.ZodOptional<z.ZodString>;
153
158
  disableRedirect: z.ZodOptional<z.ZodBoolean>;
159
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
154
160
  }, "strip", z.ZodTypeAny, {
155
161
  providerId: string;
162
+ scopes?: string[] | undefined;
156
163
  callbackURL?: string | undefined;
157
164
  errorCallbackURL?: string | undefined;
158
165
  newUserCallbackURL?: string | undefined;
159
166
  disableRedirect?: boolean | undefined;
160
167
  }, {
161
168
  providerId: string;
169
+ scopes?: string[] | undefined;
162
170
  callbackURL?: string | undefined;
163
171
  errorCallbackURL?: string | undefined;
164
172
  newUserCallbackURL?: string | undefined;
@@ -195,7 +203,7 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
195
203
  path: "/sign-in/oauth2";
196
204
  };
197
205
  oAuth2Callback: {
198
- <Context extends {
206
+ <C extends [{
199
207
  query: {
200
208
  state?: string | undefined;
201
209
  code?: string | undefined;
@@ -212,7 +220,11 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
212
220
  returnHeaders?: boolean | undefined;
213
221
  use?: better_call.Middleware[] | undefined;
214
222
  path?: string | undefined;
215
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
223
+ }]>(...inputCtx: C): Promise<C extends [{
224
+ asResponse: true;
225
+ }] ? Response : C extends [{
226
+ returnHeaders: true;
227
+ }] ? {
216
228
  headers: Headers;
217
229
  response: void;
218
230
  } : void>;
@@ -258,6 +270,83 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
258
270
  };
259
271
  path: "/oauth2/callback/:providerId";
260
272
  };
273
+ oAuth2LinkAccount: {
274
+ <C extends [{
275
+ body: {
276
+ providerId: string;
277
+ callbackURL: string;
278
+ };
279
+ method?: "POST" | undefined;
280
+ query?: Record<string, any> | undefined;
281
+ params?: Record<string, any> | undefined;
282
+ request?: Request | undefined;
283
+ headers?: HeadersInit | undefined;
284
+ asResponse?: boolean | undefined;
285
+ returnHeaders?: boolean | undefined;
286
+ use?: better_call.Middleware[] | undefined;
287
+ path?: string | undefined;
288
+ }]>(...inputCtx: C): Promise<C extends [{
289
+ asResponse: true;
290
+ }] ? Response : C extends [{
291
+ returnHeaders: true;
292
+ }] ? {
293
+ headers: Headers;
294
+ response: {
295
+ url: string;
296
+ redirect: boolean;
297
+ };
298
+ } : {
299
+ url: string;
300
+ redirect: boolean;
301
+ }>;
302
+ options: {
303
+ method: "POST";
304
+ body: z.ZodObject<{
305
+ providerId: z.ZodString;
306
+ callbackURL: z.ZodString;
307
+ }, "strip", z.ZodTypeAny, {
308
+ providerId: string;
309
+ callbackURL: string;
310
+ }, {
311
+ providerId: string;
312
+ callbackURL: string;
313
+ }>;
314
+ use: ((inputContext: {
315
+ body?: any;
316
+ query?: Record<string, any> | undefined;
317
+ request?: Request | undefined;
318
+ headers?: Headers | undefined;
319
+ asResponse?: boolean | undefined;
320
+ returnHeaders?: boolean | undefined;
321
+ use?: better_call.Middleware[] | undefined;
322
+ }) => Promise<{
323
+ session: {
324
+ session: Record<string, any> & {
325
+ id: string;
326
+ createdAt: Date;
327
+ updatedAt: Date;
328
+ userId: string;
329
+ expiresAt: Date;
330
+ token: string;
331
+ ipAddress?: string | null | undefined;
332
+ userAgent?: string | null | undefined;
333
+ };
334
+ user: Record<string, any> & {
335
+ id: string;
336
+ name: string;
337
+ email: string;
338
+ emailVerified: boolean;
339
+ createdAt: Date;
340
+ updatedAt: Date;
341
+ image?: string | null | undefined;
342
+ };
343
+ };
344
+ }>)[];
345
+ } & {
346
+ use: any[];
347
+ };
348
+ path: "/oauth2/link";
349
+ };
261
350
  };
262
351
  $ERROR_CODES: {
263
352
  readonly INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration";