better-auth 1.2.0-beta.5 → 1.2.0-beta.8

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 (183) hide show
  1. package/dist/adapters/drizzle.cjs +3 -3
  2. package/dist/adapters/drizzle.d.cts +1 -1
  3. package/dist/adapters/drizzle.d.ts +1 -1
  4. package/dist/adapters/drizzle.js +1 -1
  5. package/dist/adapters/kysely.cjs +3 -3
  6. package/dist/adapters/kysely.d.cts +1 -1
  7. package/dist/adapters/kysely.d.ts +1 -1
  8. package/dist/adapters/kysely.js +1 -1
  9. package/dist/adapters/memory.cjs +2 -2
  10. package/dist/adapters/memory.d.cts +1 -1
  11. package/dist/adapters/memory.d.ts +1 -1
  12. package/dist/adapters/memory.js +1 -1
  13. package/dist/adapters/mongodb.cjs +3 -3
  14. package/dist/adapters/mongodb.d.cts +1 -1
  15. package/dist/adapters/mongodb.d.ts +1 -1
  16. package/dist/adapters/mongodb.js +1 -1
  17. package/dist/adapters/prisma.cjs +3 -3
  18. package/dist/adapters/prisma.d.cts +1 -1
  19. package/dist/adapters/prisma.d.ts +1 -1
  20. package/dist/adapters/prisma.js +1 -1
  21. package/dist/adapters/test.d.cts +1 -1
  22. package/dist/adapters/test.d.ts +1 -1
  23. package/dist/api.cjs +41 -41
  24. package/dist/api.d.cts +2 -2
  25. package/dist/api.d.ts +2 -2
  26. package/dist/api.js +1 -1
  27. package/dist/{auth-DYJ8ix3G.d.cts → auth-BLwS7t0V.d.cts} +7271 -3015
  28. package/dist/{auth-BIKkqX3w.d.ts → auth-C42JqOR9.d.ts} +7271 -3015
  29. package/dist/{chunk-7P2P7Y35.js → chunk-2F3IX7O2.js} +1 -1
  30. package/dist/{chunk-VG5Y5QXC.js → chunk-4KMR5H5T.js} +1 -1
  31. package/dist/{chunk-XXGFGD3E.js → chunk-52TDJNDX.js} +11 -10
  32. package/dist/{chunk-YTMPZIP7.js → chunk-5AOJMBJI.js} +25 -3
  33. package/dist/{chunk-HQFWDJO3.cjs → chunk-5ECP2UE2.cjs} +5 -5
  34. package/dist/{chunk-VLA6IUW4.js → chunk-5G6XUCMS.js} +51 -2
  35. package/dist/{chunk-7H42DKFN.cjs → chunk-5KTUVZ3H.cjs} +5 -5
  36. package/dist/{chunk-QBBUTLKA.cjs → chunk-5RR5WN52.cjs} +5 -5
  37. package/dist/{chunk-XWK7ZOPU.cjs → chunk-75SPUXMY.cjs} +8 -8
  38. package/dist/{chunk-5LTLUS6A.js → chunk-BZOIXJ2Q.js} +1 -1
  39. package/dist/{chunk-SOFKSYNA.js → chunk-CG2CK6HR.js} +1 -1
  40. package/dist/{chunk-YZFX73MG.cjs → chunk-DURU7ZRA.cjs} +20 -20
  41. package/dist/{chunk-CLHJAEU2.js → chunk-EQYRCOOF.js} +5 -2
  42. package/dist/{chunk-IBIVHEIM.js → chunk-FX2ZHENM.js} +1 -1
  43. package/dist/{chunk-G6W6UQWJ.js → chunk-GWJDRQJ3.js} +2 -2
  44. package/dist/{chunk-C5LREWPU.cjs → chunk-HUDPJXOF.cjs} +24 -24
  45. package/dist/{chunk-DSB4P3WF.cjs → chunk-IUGQVFPG.cjs} +6 -6
  46. package/dist/{chunk-K46S33M5.cjs → chunk-K6WRBJAV.cjs} +3 -3
  47. package/dist/{chunk-C37NPGBI.cjs → chunk-KAEQXMEV.cjs} +46 -46
  48. package/dist/{chunk-CV5JTF37.cjs → chunk-KAR56MJZ.cjs} +5 -2
  49. package/dist/{chunk-6FRITF4C.cjs → chunk-LIGJVOZ4.cjs} +4 -4
  50. package/dist/{chunk-WKBV4PRW.cjs → chunk-MKNDCNWD.cjs} +3 -3
  51. package/dist/{chunk-WKXM7XUV.cjs → chunk-N7UWN6ND.cjs} +16 -4
  52. package/dist/{chunk-TV24P5IW.cjs → chunk-OALLKKNX.cjs} +52 -30
  53. package/dist/{chunk-3BXU3Z5H.js → chunk-QKCLO6S5.js} +1 -1
  54. package/dist/{chunk-E3CHTKRP.js → chunk-QLKU77BF.js} +1 -1
  55. package/dist/{chunk-CYI7H6T2.js → chunk-RMPI2YZ3.js} +1 -1
  56. package/dist/{chunk-R62AOMGV.js → chunk-SCXZXQTZ.js} +16 -4
  57. package/dist/{chunk-G365UCY7.js → chunk-ST2CQ4A2.js} +2 -2
  58. package/dist/{chunk-5RIBF22K.cjs → chunk-U44XLDNH.cjs} +22 -21
  59. package/dist/{chunk-OLGASOBP.cjs → chunk-UZNKBUDH.cjs} +11 -11
  60. package/dist/{chunk-7S7YLBK4.js → chunk-V56HFQQX.js} +1 -1
  61. package/dist/{chunk-HCHSHY7R.cjs → chunk-WD65CNWK.cjs} +77 -28
  62. package/dist/{chunk-H4A3GCFC.cjs → chunk-XKCN2VRG.cjs} +5 -5
  63. package/dist/{chunk-QG2HKEKG.js → chunk-XREMX2NV.js} +1 -1
  64. package/dist/{chunk-MHZNWING.js → chunk-ZDYKAJ67.js} +110 -2
  65. package/dist/{chunk-6QI5735F.js → chunk-ZKMUJOIP.js} +1 -1
  66. package/dist/{chunk-LHWLPZ6K.cjs → chunk-ZUUQ3FFY.cjs} +113 -5
  67. package/dist/client/plugins.d.cts +2 -2
  68. package/dist/client/plugins.d.ts +2 -2
  69. package/dist/client.d.cts +1 -1
  70. package/dist/client.d.ts +1 -1
  71. package/dist/cookies.d.cts +1 -1
  72. package/dist/cookies.d.ts +1 -1
  73. package/dist/db.cjs +12 -12
  74. package/dist/db.d.cts +2 -2
  75. package/dist/db.d.ts +2 -2
  76. package/dist/db.js +1 -1
  77. package/dist/index-Bszx4yMW.d.cts +7755 -0
  78. package/dist/index-DbIhOM3X.d.ts +7755 -0
  79. package/dist/index.cjs +11 -11
  80. package/dist/index.d.cts +2 -2
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.js +4 -4
  83. package/dist/next-js.cjs +20 -20
  84. package/dist/next-js.d.cts +1 -1
  85. package/dist/next-js.d.ts +1 -1
  86. package/dist/next-js.js +19 -19
  87. package/dist/node.d.cts +1 -1
  88. package/dist/node.d.ts +1 -1
  89. package/dist/oauth2.d.cts +2 -2
  90. package/dist/oauth2.d.ts +2 -2
  91. package/dist/plugins/admin.cjs +3 -3
  92. package/dist/plugins/admin.d.cts +134 -30
  93. package/dist/plugins/admin.d.ts +134 -30
  94. package/dist/plugins/admin.js +2 -2
  95. package/dist/plugins/anonymous.cjs +3 -3
  96. package/dist/plugins/anonymous.d.cts +7 -3
  97. package/dist/plugins/anonymous.d.ts +7 -3
  98. package/dist/plugins/anonymous.js +2 -2
  99. package/dist/plugins/bearer.cjs +3 -3
  100. package/dist/plugins/bearer.d.cts +1 -1
  101. package/dist/plugins/bearer.d.ts +1 -1
  102. package/dist/plugins/bearer.js +2 -2
  103. package/dist/plugins/custom-session.cjs +3 -3
  104. package/dist/plugins/custom-session.d.cts +7 -3
  105. package/dist/plugins/custom-session.d.ts +7 -3
  106. package/dist/plugins/custom-session.js +2 -2
  107. package/dist/plugins/email-otp.cjs +3 -3
  108. package/dist/plugins/email-otp.d.cts +43 -15
  109. package/dist/plugins/email-otp.d.ts +43 -15
  110. package/dist/plugins/email-otp.js +2 -2
  111. package/dist/plugins/generic-oauth.cjs +3 -3
  112. package/dist/plugins/generic-oauth.d.cts +90 -5
  113. package/dist/plugins/generic-oauth.d.ts +90 -5
  114. package/dist/plugins/generic-oauth.js +2 -2
  115. package/dist/plugins/jwt.cjs +3 -3
  116. package/dist/plugins/jwt.d.cts +13 -5
  117. package/dist/plugins/jwt.d.ts +13 -5
  118. package/dist/plugins/jwt.js +2 -2
  119. package/dist/plugins/magic-link.cjs +3 -3
  120. package/dist/plugins/magic-link.d.cts +16 -4
  121. package/dist/plugins/magic-link.d.ts +16 -4
  122. package/dist/plugins/magic-link.js +2 -2
  123. package/dist/plugins/multi-session.cjs +3 -3
  124. package/dist/plugins/multi-session.d.cts +19 -7
  125. package/dist/plugins/multi-session.d.ts +19 -7
  126. package/dist/plugins/multi-session.js +2 -2
  127. package/dist/plugins/oidc-provider.cjs +3 -3
  128. package/dist/plugins/oidc-provider.d.cts +42 -14
  129. package/dist/plugins/oidc-provider.d.ts +42 -14
  130. package/dist/plugins/oidc-provider.js +2 -2
  131. package/dist/plugins/one-tap.cjs +3 -3
  132. package/dist/plugins/one-tap.d.cts +6 -2
  133. package/dist/plugins/one-tap.d.ts +6 -2
  134. package/dist/plugins/one-tap.js +2 -2
  135. package/dist/plugins/open-api.cjs +4 -4
  136. package/dist/plugins/open-api.d.cts +13 -5
  137. package/dist/plugins/open-api.d.ts +13 -5
  138. package/dist/plugins/open-api.js +3 -3
  139. package/dist/plugins/organization.cjs +3 -3
  140. package/dist/plugins/organization.d.cts +2 -2
  141. package/dist/plugins/organization.d.ts +2 -2
  142. package/dist/plugins/organization.js +2 -2
  143. package/dist/plugins/passkey.cjs +14 -14
  144. package/dist/plugins/passkey.d.cts +43 -15
  145. package/dist/plugins/passkey.d.ts +43 -15
  146. package/dist/plugins/passkey.js +1 -1
  147. package/dist/plugins/phone-number.cjs +3 -3
  148. package/dist/plugins/phone-number.d.cts +32 -12
  149. package/dist/plugins/phone-number.d.ts +32 -12
  150. package/dist/plugins/phone-number.js +2 -2
  151. package/dist/plugins/sso.cjs +9 -9
  152. package/dist/plugins/sso.d.cts +19 -7
  153. package/dist/plugins/sso.d.ts +19 -7
  154. package/dist/plugins/sso.js +1 -1
  155. package/dist/plugins/two-factor.cjs +3 -3
  156. package/dist/plugins/two-factor.d.cts +61 -21
  157. package/dist/plugins/two-factor.d.ts +61 -21
  158. package/dist/plugins/two-factor.js +2 -2
  159. package/dist/plugins/username.cjs +3 -3
  160. package/dist/plugins/username.d.cts +7 -3
  161. package/dist/plugins/username.d.ts +7 -3
  162. package/dist/plugins/username.js +2 -2
  163. package/dist/plugins.cjs +39 -39
  164. package/dist/plugins.d.cts +9 -5
  165. package/dist/plugins.d.ts +9 -5
  166. package/dist/plugins.js +19 -19
  167. package/dist/react.d.cts +2 -3
  168. package/dist/react.d.ts +2 -3
  169. package/dist/solid.d.cts +1 -1
  170. package/dist/solid.d.ts +1 -1
  171. package/dist/{state-DXzHe8jb.d.ts → state-BlQHfd32.d.ts} +1 -1
  172. package/dist/{state-CEqdZ_y_.d.cts → state-lA7cG1Em.d.cts} +1 -1
  173. package/dist/svelte-kit.d.cts +1 -1
  174. package/dist/svelte-kit.d.ts +1 -1
  175. package/dist/svelte.d.cts +1 -1
  176. package/dist/svelte.d.ts +1 -1
  177. package/dist/types.d.cts +3 -3
  178. package/dist/types.d.ts +3 -3
  179. package/dist/vue.d.cts +1 -1
  180. package/dist/vue.d.ts +1 -1
  181. package/package.json +3 -3
  182. package/dist/index-BL6paKGE.d.cts +0 -4105
  183. package/dist/index-DOB91DVD.d.ts +0 -4105
@@ -1,9 +1,9 @@
1
- export { O as OrganizationOptions, o as organization } from '../index-DOB91DVD.js';
1
+ export { O as OrganizationOptions, o as organization } from '../index-DbIhOM3X.js';
2
2
  import 'zod';
3
3
  import 'better-call';
4
4
  import './access.js';
5
5
  import '../helper-Bi8FQwDD.js';
6
- import '../auth-BIKkqX3w.js';
6
+ import '../auth-C42JqOR9.js';
7
7
  import 'kysely';
8
8
  import '../index-moQjyfmm.js';
9
9
  import 'jose';
@@ -1,6 +1,6 @@
1
- export { organization } from '../chunk-VLA6IUW4.js';
1
+ export { organization } from '../chunk-5G6XUCMS.js';
2
2
  import '../chunk-GBLEGHZW.js';
3
- import '../chunk-R62AOMGV.js';
3
+ import '../chunk-SCXZXQTZ.js';
4
4
  import '../chunk-TODG5RSV.js';
5
5
  import '../chunk-R42K7GPF.js';
6
6
  import '../chunk-HVHN3Y2L.js';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk5AZFOKWY_cjs = require('../chunk-5AZFOKWY.cjs');
4
- var chunkWKXM7XUV_cjs = require('../chunk-WKXM7XUV.cjs');
4
+ var chunkN7UWN6ND_cjs = require('../chunk-N7UWN6ND.cjs');
5
5
  require('../chunk-JDAHD767.cjs');
6
6
  require('../chunk-SVC7H7K4.cjs');
7
7
  require('../chunk-6AFMN526.cjs');
@@ -51,11 +51,11 @@ var passkey = (options) => {
51
51
  return {
52
52
  id: "passkey",
53
53
  endpoints: {
54
- generatePasskeyRegistrationOptions: chunkWKXM7XUV_cjs.createAuthEndpoint(
54
+ generatePasskeyRegistrationOptions: chunkN7UWN6ND_cjs.createAuthEndpoint(
55
55
  "/passkey/generate-register-options",
56
56
  {
57
57
  method: "GET",
58
- use: [chunkWKXM7XUV_cjs.freshSessionMiddleware],
58
+ use: [chunkN7UWN6ND_cjs.freshSessionMiddleware],
59
59
  metadata: {
60
60
  client: false,
61
61
  openapi: {
@@ -223,7 +223,7 @@ var passkey = (options) => {
223
223
  });
224
224
  }
225
225
  ),
226
- generatePasskeyAuthenticationOptions: chunkWKXM7XUV_cjs.createAuthEndpoint(
226
+ generatePasskeyAuthenticationOptions: chunkN7UWN6ND_cjs.createAuthEndpoint(
227
227
  "/passkey/generate-authenticate-options",
228
228
  {
229
229
  method: "POST",
@@ -324,7 +324,7 @@ var passkey = (options) => {
324
324
  }
325
325
  },
326
326
  async (ctx) => {
327
- const session = await chunkWKXM7XUV_cjs.getSessionFromCtx(ctx);
327
+ const session = await chunkN7UWN6ND_cjs.getSessionFromCtx(ctx);
328
328
  let userPasskeys = [];
329
329
  if (session) {
330
330
  userPasskeys = await ctx.context.adapter.findMany({
@@ -378,7 +378,7 @@ var passkey = (options) => {
378
378
  });
379
379
  }
380
380
  ),
381
- verifyPasskeyRegistration: chunkWKXM7XUV_cjs.createAuthEndpoint(
381
+ verifyPasskeyRegistration: chunkN7UWN6ND_cjs.createAuthEndpoint(
382
382
  "/passkey/verify-registration",
383
383
  {
384
384
  method: "POST",
@@ -390,7 +390,7 @@ var passkey = (options) => {
390
390
  description: "Name of the passkey"
391
391
  }).optional()
392
392
  }),
393
- use: [chunkWKXM7XUV_cjs.freshSessionMiddleware],
393
+ use: [chunkN7UWN6ND_cjs.freshSessionMiddleware],
394
394
  metadata: {
395
395
  openapi: {
396
396
  description: "Verify registration of a new passkey",
@@ -499,7 +499,7 @@ var passkey = (options) => {
499
499
  }
500
500
  }
501
501
  ),
502
- verifyPasskeyAuthentication: chunkWKXM7XUV_cjs.createAuthEndpoint(
502
+ verifyPasskeyAuthentication: chunkN7UWN6ND_cjs.createAuthEndpoint(
503
503
  "/passkey/verify-authentication",
504
504
  {
505
505
  method: "POST",
@@ -652,11 +652,11 @@ var passkey = (options) => {
652
652
  }
653
653
  }
654
654
  ),
655
- listPasskeys: chunkWKXM7XUV_cjs.createAuthEndpoint(
655
+ listPasskeys: chunkN7UWN6ND_cjs.createAuthEndpoint(
656
656
  "/passkey/list-user-passkeys",
657
657
  {
658
658
  method: "GET",
659
- use: [chunkWKXM7XUV_cjs.sessionMiddleware]
659
+ use: [chunkN7UWN6ND_cjs.sessionMiddleware]
660
660
  },
661
661
  async (ctx) => {
662
662
  const passkeys = await ctx.context.adapter.findMany({
@@ -668,14 +668,14 @@ var passkey = (options) => {
668
668
  });
669
669
  }
670
670
  ),
671
- deletePasskey: chunkWKXM7XUV_cjs.createAuthEndpoint(
671
+ deletePasskey: chunkN7UWN6ND_cjs.createAuthEndpoint(
672
672
  "/passkey/delete-passkey",
673
673
  {
674
674
  method: "POST",
675
675
  body: zod.z.object({
676
676
  id: zod.z.string()
677
677
  }),
678
- use: [chunkWKXM7XUV_cjs.sessionMiddleware]
678
+ use: [chunkN7UWN6ND_cjs.sessionMiddleware]
679
679
  },
680
680
  async (ctx) => {
681
681
  await ctx.context.adapter.delete({
@@ -692,7 +692,7 @@ var passkey = (options) => {
692
692
  });
693
693
  }
694
694
  ),
695
- updatePasskey: chunkWKXM7XUV_cjs.createAuthEndpoint(
695
+ updatePasskey: chunkN7UWN6ND_cjs.createAuthEndpoint(
696
696
  "/passkey/update-passkey",
697
697
  {
698
698
  method: "POST",
@@ -700,7 +700,7 @@ var passkey = (options) => {
700
700
  id: zod.z.string(),
701
701
  name: zod.z.string()
702
702
  }),
703
- use: [chunkWKXM7XUV_cjs.sessionMiddleware]
703
+ use: [chunkN7UWN6ND_cjs.sessionMiddleware]
704
704
  },
705
705
  async (ctx) => {
706
706
  const passkey2 = await ctx.context.adapter.findOne({
@@ -6,7 +6,7 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
6
6
  import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
7
7
  import * as better_call from 'better-call';
8
8
  import { z } from 'zod';
9
- import { I as InferOptionSchema } from '../auth-DYJ8ix3G.cjs';
9
+ import { I as InferOptionSchema } from '../auth-BLwS7t0V.cjs';
10
10
  import 'kysely';
11
11
  import '../helper-Bi8FQwDD.cjs';
12
12
  import '../index-BuRgaJZR.cjs';
@@ -63,7 +63,7 @@ declare const passkey: (options?: PasskeyOptions) => {
63
63
  id: "passkey";
64
64
  endpoints: {
65
65
  generatePasskeyRegistrationOptions: {
66
- <Context extends {
66
+ <C extends [({
67
67
  body?: undefined;
68
68
  method?: "GET" | undefined;
69
69
  query?: Record<string, any> | undefined;
@@ -74,7 +74,11 @@ declare const passkey: (options?: PasskeyOptions) => {
74
74
  returnHeaders?: boolean | undefined;
75
75
  use?: better_call.Middleware[] | undefined;
76
76
  path?: string | undefined;
77
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
77
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
78
+ asResponse: true;
79
+ }] ? Response : C extends [{
80
+ returnHeaders: true;
81
+ }] ? {
78
82
  headers: Headers;
79
83
  response: PublicKeyCredentialCreationOptionsJSON;
80
84
  } : PublicKeyCredentialCreationOptionsJSON>;
@@ -222,7 +226,7 @@ declare const passkey: (options?: PasskeyOptions) => {
222
226
  path: "/passkey/generate-register-options";
223
227
  };
224
228
  generatePasskeyAuthenticationOptions: {
225
- <Context extends {
229
+ <C extends [({
226
230
  body?: {
227
231
  email?: string | undefined;
228
232
  } | undefined;
@@ -235,7 +239,11 @@ declare const passkey: (options?: PasskeyOptions) => {
235
239
  returnHeaders?: boolean | undefined;
236
240
  use?: better_call.Middleware[] | undefined;
237
241
  path?: string | undefined;
238
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
242
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
243
+ asResponse: true;
244
+ }] ? Response : C extends [{
245
+ returnHeaders: true;
246
+ }] ? {
239
247
  headers: Headers;
240
248
  response: _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON;
241
249
  } : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
@@ -344,7 +352,7 @@ declare const passkey: (options?: PasskeyOptions) => {
344
352
  path: "/passkey/generate-authenticate-options";
345
353
  };
346
354
  verifyPasskeyRegistration: {
347
- <Context extends {
355
+ <C extends [{
348
356
  body: {
349
357
  name?: string | undefined;
350
358
  response?: any;
@@ -358,7 +366,11 @@ declare const passkey: (options?: PasskeyOptions) => {
358
366
  returnHeaders?: boolean | undefined;
359
367
  use?: better_call.Middleware[] | undefined;
360
368
  path?: string | undefined;
361
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
369
+ }]>(...inputCtx: C): Promise<C extends [{
370
+ asResponse: true;
371
+ }] ? Response : C extends [{
372
+ returnHeaders: true;
373
+ }] ? {
362
374
  headers: Headers;
363
375
  response: Passkey | null;
364
376
  } : Passkey | null>;
@@ -431,7 +443,7 @@ declare const passkey: (options?: PasskeyOptions) => {
431
443
  path: "/passkey/verify-registration";
432
444
  };
433
445
  verifyPasskeyAuthentication: {
434
- <Context extends {
446
+ <C extends [{
435
447
  body: {
436
448
  response: AuthenticationResponseJSON;
437
449
  };
@@ -444,7 +456,11 @@ declare const passkey: (options?: PasskeyOptions) => {
444
456
  returnHeaders?: boolean | undefined;
445
457
  use?: better_call.Middleware[] | undefined;
446
458
  path?: string | undefined;
447
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
459
+ }]>(...inputCtx: C): Promise<C extends [{
460
+ asResponse: true;
461
+ }] ? Response : C extends [{
462
+ returnHeaders: true;
463
+ }] ? {
448
464
  headers: Headers;
449
465
  response: {
450
466
  session: {
@@ -515,7 +531,7 @@ declare const passkey: (options?: PasskeyOptions) => {
515
531
  path: "/passkey/verify-authentication";
516
532
  };
517
533
  listPasskeys: {
518
- <Context extends {
534
+ <C extends [({
519
535
  body?: undefined;
520
536
  method?: "GET" | undefined;
521
537
  query?: Record<string, any> | undefined;
@@ -526,7 +542,11 @@ declare const passkey: (options?: PasskeyOptions) => {
526
542
  returnHeaders?: boolean | undefined;
527
543
  use?: better_call.Middleware[] | undefined;
528
544
  path?: string | undefined;
529
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
545
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
546
+ asResponse: true;
547
+ }] ? Response : C extends [{
548
+ returnHeaders: true;
549
+ }] ? {
530
550
  headers: Headers;
531
551
  response: Passkey[];
532
552
  } : Passkey[]>;
@@ -569,7 +589,7 @@ declare const passkey: (options?: PasskeyOptions) => {
569
589
  path: "/passkey/list-user-passkeys";
570
590
  };
571
591
  deletePasskey: {
572
- <Context extends {
592
+ <C extends [{
573
593
  body: {
574
594
  id: string;
575
595
  };
@@ -582,7 +602,11 @@ declare const passkey: (options?: PasskeyOptions) => {
582
602
  returnHeaders?: boolean | undefined;
583
603
  use?: better_call.Middleware[] | undefined;
584
604
  path?: string | undefined;
585
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
605
+ }]>(...inputCtx: C): Promise<C extends [{
606
+ asResponse: true;
607
+ }] ? Response : C extends [{
608
+ returnHeaders: true;
609
+ }] ? {
586
610
  headers: Headers;
587
611
  response: null;
588
612
  } : null>;
@@ -632,7 +656,7 @@ declare const passkey: (options?: PasskeyOptions) => {
632
656
  path: "/passkey/delete-passkey";
633
657
  };
634
658
  updatePasskey: {
635
- <Context extends {
659
+ <C extends [{
636
660
  body: {
637
661
  id: string;
638
662
  name: string;
@@ -646,7 +670,11 @@ declare const passkey: (options?: PasskeyOptions) => {
646
670
  returnHeaders?: boolean | undefined;
647
671
  use?: better_call.Middleware[] | undefined;
648
672
  path?: string | undefined;
649
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
673
+ }]>(...inputCtx: C): Promise<C extends [{
674
+ asResponse: true;
675
+ }] ? Response : C extends [{
676
+ returnHeaders: true;
677
+ }] ? {
650
678
  headers: Headers;
651
679
  response: {
652
680
  passkey: Passkey;
@@ -6,7 +6,7 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
6
6
  import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
7
7
  import * as better_call from 'better-call';
8
8
  import { z } from 'zod';
9
- import { I as InferOptionSchema } from '../auth-BIKkqX3w.js';
9
+ import { I as InferOptionSchema } from '../auth-C42JqOR9.js';
10
10
  import 'kysely';
11
11
  import '../helper-Bi8FQwDD.js';
12
12
  import '../index-moQjyfmm.js';
@@ -63,7 +63,7 @@ declare const passkey: (options?: PasskeyOptions) => {
63
63
  id: "passkey";
64
64
  endpoints: {
65
65
  generatePasskeyRegistrationOptions: {
66
- <Context extends {
66
+ <C extends [({
67
67
  body?: undefined;
68
68
  method?: "GET" | undefined;
69
69
  query?: Record<string, any> | undefined;
@@ -74,7 +74,11 @@ declare const passkey: (options?: PasskeyOptions) => {
74
74
  returnHeaders?: boolean | undefined;
75
75
  use?: better_call.Middleware[] | undefined;
76
76
  path?: string | undefined;
77
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
77
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
78
+ asResponse: true;
79
+ }] ? Response : C extends [{
80
+ returnHeaders: true;
81
+ }] ? {
78
82
  headers: Headers;
79
83
  response: PublicKeyCredentialCreationOptionsJSON;
80
84
  } : PublicKeyCredentialCreationOptionsJSON>;
@@ -222,7 +226,7 @@ declare const passkey: (options?: PasskeyOptions) => {
222
226
  path: "/passkey/generate-register-options";
223
227
  };
224
228
  generatePasskeyAuthenticationOptions: {
225
- <Context extends {
229
+ <C extends [({
226
230
  body?: {
227
231
  email?: string | undefined;
228
232
  } | undefined;
@@ -235,7 +239,11 @@ declare const passkey: (options?: PasskeyOptions) => {
235
239
  returnHeaders?: boolean | undefined;
236
240
  use?: better_call.Middleware[] | undefined;
237
241
  path?: string | undefined;
238
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
242
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
243
+ asResponse: true;
244
+ }] ? Response : C extends [{
245
+ returnHeaders: true;
246
+ }] ? {
239
247
  headers: Headers;
240
248
  response: _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON;
241
249
  } : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
@@ -344,7 +352,7 @@ declare const passkey: (options?: PasskeyOptions) => {
344
352
  path: "/passkey/generate-authenticate-options";
345
353
  };
346
354
  verifyPasskeyRegistration: {
347
- <Context extends {
355
+ <C extends [{
348
356
  body: {
349
357
  name?: string | undefined;
350
358
  response?: any;
@@ -358,7 +366,11 @@ declare const passkey: (options?: PasskeyOptions) => {
358
366
  returnHeaders?: boolean | undefined;
359
367
  use?: better_call.Middleware[] | undefined;
360
368
  path?: string | undefined;
361
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
369
+ }]>(...inputCtx: C): Promise<C extends [{
370
+ asResponse: true;
371
+ }] ? Response : C extends [{
372
+ returnHeaders: true;
373
+ }] ? {
362
374
  headers: Headers;
363
375
  response: Passkey | null;
364
376
  } : Passkey | null>;
@@ -431,7 +443,7 @@ declare const passkey: (options?: PasskeyOptions) => {
431
443
  path: "/passkey/verify-registration";
432
444
  };
433
445
  verifyPasskeyAuthentication: {
434
- <Context extends {
446
+ <C extends [{
435
447
  body: {
436
448
  response: AuthenticationResponseJSON;
437
449
  };
@@ -444,7 +456,11 @@ declare const passkey: (options?: PasskeyOptions) => {
444
456
  returnHeaders?: boolean | undefined;
445
457
  use?: better_call.Middleware[] | undefined;
446
458
  path?: string | undefined;
447
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
459
+ }]>(...inputCtx: C): Promise<C extends [{
460
+ asResponse: true;
461
+ }] ? Response : C extends [{
462
+ returnHeaders: true;
463
+ }] ? {
448
464
  headers: Headers;
449
465
  response: {
450
466
  session: {
@@ -515,7 +531,7 @@ declare const passkey: (options?: PasskeyOptions) => {
515
531
  path: "/passkey/verify-authentication";
516
532
  };
517
533
  listPasskeys: {
518
- <Context extends {
534
+ <C extends [({
519
535
  body?: undefined;
520
536
  method?: "GET" | undefined;
521
537
  query?: Record<string, any> | undefined;
@@ -526,7 +542,11 @@ declare const passkey: (options?: PasskeyOptions) => {
526
542
  returnHeaders?: boolean | undefined;
527
543
  use?: better_call.Middleware[] | undefined;
528
544
  path?: string | undefined;
529
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
545
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
546
+ asResponse: true;
547
+ }] ? Response : C extends [{
548
+ returnHeaders: true;
549
+ }] ? {
530
550
  headers: Headers;
531
551
  response: Passkey[];
532
552
  } : Passkey[]>;
@@ -569,7 +589,7 @@ declare const passkey: (options?: PasskeyOptions) => {
569
589
  path: "/passkey/list-user-passkeys";
570
590
  };
571
591
  deletePasskey: {
572
- <Context extends {
592
+ <C extends [{
573
593
  body: {
574
594
  id: string;
575
595
  };
@@ -582,7 +602,11 @@ declare const passkey: (options?: PasskeyOptions) => {
582
602
  returnHeaders?: boolean | undefined;
583
603
  use?: better_call.Middleware[] | undefined;
584
604
  path?: string | undefined;
585
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
605
+ }]>(...inputCtx: C): Promise<C extends [{
606
+ asResponse: true;
607
+ }] ? Response : C extends [{
608
+ returnHeaders: true;
609
+ }] ? {
586
610
  headers: Headers;
587
611
  response: null;
588
612
  } : null>;
@@ -632,7 +656,7 @@ declare const passkey: (options?: PasskeyOptions) => {
632
656
  path: "/passkey/delete-passkey";
633
657
  };
634
658
  updatePasskey: {
635
- <Context extends {
659
+ <C extends [{
636
660
  body: {
637
661
  id: string;
638
662
  name: string;
@@ -646,7 +670,11 @@ declare const passkey: (options?: PasskeyOptions) => {
646
670
  returnHeaders?: boolean | undefined;
647
671
  use?: better_call.Middleware[] | undefined;
648
672
  path?: string | undefined;
649
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
673
+ }]>(...inputCtx: C): Promise<C extends [{
674
+ asResponse: true;
675
+ }] ? Response : C extends [{
676
+ returnHeaders: true;
677
+ }] ? {
650
678
  headers: Headers;
651
679
  response: {
652
680
  passkey: Passkey;
@@ -1,5 +1,5 @@
1
1
  export { getPasskeyActions, passkeyClient } from '../chunk-4WCY4Y5J.js';
2
- import { createAuthEndpoint, freshSessionMiddleware, getSessionFromCtx, sessionMiddleware } from '../chunk-R62AOMGV.js';
2
+ import { createAuthEndpoint, freshSessionMiddleware, getSessionFromCtx, sessionMiddleware } from '../chunk-SCXZXQTZ.js';
3
3
  import '../chunk-TODG5RSV.js';
4
4
  import '../chunk-R42K7GPF.js';
5
5
  import '../chunk-7KKMYVNZ.js';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunk5RIBF22K_cjs = require('../chunk-5RIBF22K.cjs');
4
- require('../chunk-WKXM7XUV.cjs');
3
+ var chunkU44XLDNH_cjs = require('../chunk-U44XLDNH.cjs');
4
+ require('../chunk-N7UWN6ND.cjs');
5
5
  require('../chunk-JDAHD767.cjs');
6
6
  require('../chunk-SVC7H7K4.cjs');
7
7
  require('../chunk-S5UORXJH.cjs');
@@ -20,5 +20,5 @@ require('../chunk-PEZRSDZS.cjs');
20
20
 
21
21
  Object.defineProperty(exports, "phoneNumber", {
22
22
  enumerable: true,
23
- get: function () { return chunk5RIBF22K_cjs.phoneNumber; }
23
+ get: function () { return chunkU44XLDNH_cjs.phoneNumber; }
24
24
  });
@@ -1,6 +1,6 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { U as User, I as InferOptionSchema } from '../auth-DYJ8ix3G.cjs';
3
+ import { U as User, I as InferOptionSchema } from '../auth-BLwS7t0V.cjs';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
6
6
  import '../index-BuRgaJZR.cjs';
@@ -55,7 +55,7 @@ interface PhoneNumberOptions {
55
55
  */
56
56
  callbackOnVerification?: (data: {
57
57
  phoneNumber: string;
58
- user: UserWithPhoneNumber | null;
58
+ user: UserWithPhoneNumber;
59
59
  }, request?: Request) => void | Promise<void>;
60
60
  /**
61
61
  * Sign up user after phone number verification
@@ -94,7 +94,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
94
94
  id: "phone-number";
95
95
  endpoints: {
96
96
  signInPhoneNumber: {
97
- <Context extends {
97
+ <C extends [{
98
98
  body: {
99
99
  password: string;
100
100
  phoneNumber: string;
@@ -109,7 +109,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
109
109
  returnHeaders?: boolean | undefined;
110
110
  use?: better_call.Middleware[] | undefined;
111
111
  path?: string | undefined;
112
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
112
+ }]>(...inputCtx: C): Promise<C extends [{
113
+ asResponse: true;
114
+ }] ? Response : C extends [{
115
+ returnHeaders: true;
116
+ }] ? {
113
117
  headers: Headers;
114
118
  response: {
115
119
  token: string;
@@ -169,7 +173,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
169
173
  path: "/sign-in/phone-number";
170
174
  };
171
175
  sendPhoneNumberOTP: {
172
- <Context extends {
176
+ <C extends [{
173
177
  body: {
174
178
  phoneNumber: string;
175
179
  };
@@ -182,7 +186,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
182
186
  returnHeaders?: boolean | undefined;
183
187
  use?: better_call.Middleware[] | undefined;
184
188
  path?: string | undefined;
185
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
189
+ }]>(...inputCtx: C): Promise<C extends [{
190
+ asResponse: true;
191
+ }] ? Response : C extends [{
192
+ returnHeaders: true;
193
+ }] ? {
186
194
  headers: Headers;
187
195
  response: {
188
196
  code: string;
@@ -228,7 +236,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
228
236
  path: "/phone-number/send-otp";
229
237
  };
230
238
  verifyPhoneNumber: {
231
- <Context extends {
239
+ <C extends [{
232
240
  body: {
233
241
  code: string;
234
242
  phoneNumber: string;
@@ -244,7 +252,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
244
252
  returnHeaders?: boolean | undefined;
245
253
  use?: better_call.Middleware[] | undefined;
246
254
  path?: string | undefined;
247
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
255
+ }]>(...inputCtx: C): Promise<C extends [{
256
+ asResponse: true;
257
+ }] ? Response : C extends [{
258
+ returnHeaders: true;
259
+ }] ? {
248
260
  headers: Headers;
249
261
  response: {
250
262
  status: boolean;
@@ -332,7 +344,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
332
344
  path: "/phone-number/verify";
333
345
  };
334
346
  forgetPasswordPhoneNumber: {
335
- <Context extends {
347
+ <C extends [{
336
348
  body: {
337
349
  phoneNumber: string;
338
350
  };
@@ -345,7 +357,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
345
357
  returnHeaders?: boolean | undefined;
346
358
  use?: better_call.Middleware[] | undefined;
347
359
  path?: string | undefined;
348
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
360
+ }]>(...inputCtx: C): Promise<C extends [{
361
+ asResponse: true;
362
+ }] ? Response : C extends [{
363
+ returnHeaders: true;
364
+ }] ? {
349
365
  headers: Headers;
350
366
  response: {
351
367
  status: boolean;
@@ -368,7 +384,7 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
368
384
  path: "/phone-number/forget-password";
369
385
  };
370
386
  resetPasswordPhoneNumber: {
371
- <Context extends {
387
+ <C extends [{
372
388
  body: {
373
389
  newPassword: string;
374
390
  otp: string;
@@ -383,7 +399,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions) => {
383
399
  returnHeaders?: boolean | undefined;
384
400
  use?: better_call.Middleware[] | undefined;
385
401
  path?: string | undefined;
386
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
402
+ }]>(...inputCtx: C): Promise<C extends [{
403
+ asResponse: true;
404
+ }] ? Response : C extends [{
405
+ returnHeaders: true;
406
+ }] ? {
387
407
  headers: Headers;
388
408
  response: {
389
409
  status: boolean;