better-auth 1.2.0-beta.6 → 1.2.0-beta.9

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 (119) hide show
  1. package/dist/adapters/drizzle.d.cts +1 -1
  2. package/dist/adapters/drizzle.d.ts +1 -1
  3. package/dist/adapters/kysely.d.cts +1 -1
  4. package/dist/adapters/kysely.d.ts +1 -1
  5. package/dist/adapters/memory.d.cts +1 -1
  6. package/dist/adapters/memory.d.ts +1 -1
  7. package/dist/adapters/mongodb.cjs +16 -3
  8. package/dist/adapters/mongodb.d.cts +1 -1
  9. package/dist/adapters/mongodb.d.ts +1 -1
  10. package/dist/adapters/mongodb.js +16 -3
  11. package/dist/adapters/prisma.d.cts +1 -1
  12. package/dist/adapters/prisma.d.ts +1 -1
  13. package/dist/adapters/test.d.cts +1 -1
  14. package/dist/adapters/test.d.ts +1 -1
  15. package/dist/api.d.cts +2 -2
  16. package/dist/api.d.ts +2 -2
  17. package/dist/{auth-CC4kpwks.d.cts → auth-BLwS7t0V.d.cts} +7266 -3010
  18. package/dist/{auth-BfbTouIV.d.ts → auth-C42JqOR9.d.ts} +7266 -3010
  19. package/dist/{chunk-XKCN2VRG.cjs → chunk-45RBYQKI.cjs} +58 -2
  20. package/dist/{chunk-KAEQXMEV.cjs → chunk-GSEEAIRZ.cjs} +1 -1
  21. package/dist/{chunk-RMPI2YZ3.js → chunk-IQUHEVLH.js} +1 -1
  22. package/dist/{chunk-5AOJMBJI.js → chunk-J6VNT2T4.js} +8 -0
  23. package/dist/{chunk-75SPUXMY.cjs → chunk-QNLSMTXF.cjs} +9 -4
  24. package/dist/{chunk-GWJDRQJ3.js → chunk-QQGRNAM2.js} +9 -4
  25. package/dist/{chunk-OALLKKNX.cjs → chunk-SMZIOWVN.cjs} +8 -0
  26. package/dist/{chunk-FX2ZHENM.js → chunk-TZ34QTAV.js} +58 -2
  27. package/dist/{chunk-LIGJVOZ4.cjs → chunk-WLOSPOQJ.cjs} +45 -24
  28. package/dist/{chunk-V56HFQQX.js → chunk-YHW4KODD.js} +45 -24
  29. package/dist/client/plugins.cjs +45 -12
  30. package/dist/client/plugins.d.cts +44 -6
  31. package/dist/client/plugins.d.ts +44 -6
  32. package/dist/client/plugins.js +45 -12
  33. package/dist/client.d.cts +1 -1
  34. package/dist/client.d.ts +1 -1
  35. package/dist/cookies.d.cts +1 -1
  36. package/dist/cookies.d.ts +1 -1
  37. package/dist/db.d.cts +2 -2
  38. package/dist/db.d.ts +2 -2
  39. package/dist/index-Bszx4yMW.d.cts +7755 -0
  40. package/dist/index-DbIhOM3X.d.ts +7755 -0
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.cts +2 -2
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.js +1 -1
  45. package/dist/next-js.cjs +5 -5
  46. package/dist/next-js.d.cts +1 -1
  47. package/dist/next-js.d.ts +1 -1
  48. package/dist/next-js.js +5 -5
  49. package/dist/node.d.cts +1 -1
  50. package/dist/node.d.ts +1 -1
  51. package/dist/oauth2.d.cts +2 -2
  52. package/dist/oauth2.d.ts +2 -2
  53. package/dist/plugins/admin.cjs +2 -2
  54. package/dist/plugins/admin.d.cts +79 -25
  55. package/dist/plugins/admin.d.ts +79 -25
  56. package/dist/plugins/admin.js +1 -1
  57. package/dist/plugins/anonymous.d.cts +7 -3
  58. package/dist/plugins/anonymous.d.ts +7 -3
  59. package/dist/plugins/bearer.d.cts +1 -1
  60. package/dist/plugins/bearer.d.ts +1 -1
  61. package/dist/plugins/custom-session.d.cts +7 -3
  62. package/dist/plugins/custom-session.d.ts +7 -3
  63. package/dist/plugins/email-otp.d.cts +43 -15
  64. package/dist/plugins/email-otp.d.ts +43 -15
  65. package/dist/plugins/generic-oauth.d.cts +19 -7
  66. package/dist/plugins/generic-oauth.d.ts +19 -7
  67. package/dist/plugins/jwt.d.cts +13 -5
  68. package/dist/plugins/jwt.d.ts +13 -5
  69. package/dist/plugins/magic-link.d.cts +12 -4
  70. package/dist/plugins/magic-link.d.ts +12 -4
  71. package/dist/plugins/multi-session.d.cts +19 -7
  72. package/dist/plugins/multi-session.d.ts +19 -7
  73. package/dist/plugins/oidc-provider.cjs +2 -2
  74. package/dist/plugins/oidc-provider.d.cts +43 -15
  75. package/dist/plugins/oidc-provider.d.ts +43 -15
  76. package/dist/plugins/oidc-provider.js +1 -1
  77. package/dist/plugins/one-tap.cjs +2 -2
  78. package/dist/plugins/one-tap.d.cts +13 -2
  79. package/dist/plugins/one-tap.d.ts +13 -2
  80. package/dist/plugins/one-tap.js +1 -1
  81. package/dist/plugins/open-api.cjs +2 -2
  82. package/dist/plugins/open-api.d.cts +13 -5
  83. package/dist/plugins/open-api.d.ts +13 -5
  84. package/dist/plugins/open-api.js +1 -1
  85. package/dist/plugins/organization.d.cts +2 -2
  86. package/dist/plugins/organization.d.ts +2 -2
  87. package/dist/plugins/passkey.d.cts +43 -15
  88. package/dist/plugins/passkey.d.ts +43 -15
  89. package/dist/plugins/phone-number.d.cts +31 -11
  90. package/dist/plugins/phone-number.d.ts +31 -11
  91. package/dist/plugins/sso.d.cts +19 -7
  92. package/dist/plugins/sso.d.ts +19 -7
  93. package/dist/plugins/two-factor.d.cts +61 -21
  94. package/dist/plugins/two-factor.d.ts +61 -21
  95. package/dist/plugins/username.cjs +2 -2
  96. package/dist/plugins/username.d.cts +28 -4
  97. package/dist/plugins/username.d.ts +28 -4
  98. package/dist/plugins/username.js +1 -1
  99. package/dist/plugins.cjs +10 -10
  100. package/dist/plugins.d.cts +9 -5
  101. package/dist/plugins.d.ts +9 -5
  102. package/dist/plugins.js +5 -5
  103. package/dist/react.d.cts +1 -1
  104. package/dist/react.d.ts +1 -1
  105. package/dist/solid.d.cts +1 -1
  106. package/dist/solid.d.ts +1 -1
  107. package/dist/{state-BlyN0kTT.d.ts → state-BlQHfd32.d.ts} +1 -1
  108. package/dist/{state-ClV1x8my.d.cts → state-lA7cG1Em.d.cts} +1 -1
  109. package/dist/svelte-kit.d.cts +1 -1
  110. package/dist/svelte-kit.d.ts +1 -1
  111. package/dist/svelte.d.cts +1 -1
  112. package/dist/svelte.d.ts +1 -1
  113. package/dist/types.d.cts +2 -2
  114. package/dist/types.d.ts +2 -2
  115. package/dist/vue.d.cts +1 -1
  116. package/dist/vue.d.ts +1 -1
  117. package/package.json +3 -3
  118. package/dist/index-CtbEb8Ls.d.ts +0 -4211
  119. package/dist/index-F5NLq5XF.d.cts +0 -4211
@@ -1,6 +1,6 @@
1
1
  import * as better_call from 'better-call';
2
2
  import { z } from 'zod';
3
- import { U as User, S as Session, I as InferOptionSchema, b as AuthContext, H as HookEndpointContext } from '../auth-BfbTouIV.js';
3
+ import { U as User, S as Session, I as InferOptionSchema, b as AuthContext, H as HookEndpointContext } from '../auth-C42JqOR9.js';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
6
6
  import '../index-moQjyfmm.js';
@@ -53,6 +53,12 @@ interface AdminOptions {
53
53
  * Custom schema for the admin plugin
54
54
  */
55
55
  schema?: InferOptionSchema<typeof schema>;
56
+ /**
57
+ * List of user ids that should have admin access
58
+ *
59
+ * If this is set, the `adminRole` option is ignored
60
+ */
61
+ adminUserIds?: string[];
56
62
  }
57
63
  declare const admin: <O extends AdminOptions>(options?: O) => {
58
64
  id: "admin";
@@ -109,7 +115,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
109
115
  };
110
116
  endpoints: {
111
117
  setRole: {
112
- <Context extends {
118
+ <C extends [{
113
119
  body: {
114
120
  userId: string;
115
121
  role: string;
@@ -123,7 +129,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
123
129
  returnHeaders?: boolean | undefined;
124
130
  use?: better_call.Middleware[] | undefined;
125
131
  path?: string | undefined;
126
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
132
+ }]>(...inputCtx: C): Promise<C extends [{
133
+ asResponse: true;
134
+ }] ? Response : C extends [{
135
+ returnHeaders: true;
136
+ }] ? {
127
137
  headers: Headers;
128
138
  response: {
129
139
  user: UserWithRole;
@@ -196,7 +206,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
196
206
  path: "/admin/set-role";
197
207
  };
198
208
  createUser: {
199
- <Context extends {
209
+ <C extends [{
200
210
  body: {
201
211
  password: string;
202
212
  name: string;
@@ -213,7 +223,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
213
223
  returnHeaders?: boolean | undefined;
214
224
  use?: better_call.Middleware[] | undefined;
215
225
  path?: string | undefined;
216
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
226
+ }]>(...inputCtx: C): Promise<C extends [{
227
+ asResponse: true;
228
+ }] ? Response : C extends [{
229
+ returnHeaders: true;
230
+ }] ? {
217
231
  headers: Headers;
218
232
  response: {
219
233
  user: UserWithRole;
@@ -298,7 +312,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
298
312
  path: "/admin/create-user";
299
313
  };
300
314
  listUsers: {
301
- <Context extends {
315
+ <C extends [{
302
316
  query: {
303
317
  searchValue?: string | undefined;
304
318
  searchField?: "name" | "email" | undefined;
@@ -320,7 +334,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
320
334
  returnHeaders?: boolean | undefined;
321
335
  use?: better_call.Middleware[] | undefined;
322
336
  path?: string | undefined;
323
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
337
+ }]>(...inputCtx: C): Promise<C extends [{
338
+ asResponse: true;
339
+ }] ? Response : C extends [{
340
+ returnHeaders: true;
341
+ }] ? {
324
342
  headers: Headers;
325
343
  response: {
326
344
  users: UserWithRole[];
@@ -441,7 +459,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
441
459
  path: "/admin/list-users";
442
460
  };
443
461
  listUserSessions: {
444
- <Context extends {
462
+ <C extends [{
445
463
  body: {
446
464
  userId: string;
447
465
  };
@@ -454,7 +472,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
454
472
  returnHeaders?: boolean | undefined;
455
473
  use?: better_call.Middleware[] | undefined;
456
474
  path?: string | undefined;
457
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
475
+ }]>(...inputCtx: C): Promise<C extends [{
476
+ asResponse: true;
477
+ }] ? Response : C extends [{
478
+ returnHeaders: true;
479
+ }] ? {
458
480
  headers: Headers;
459
481
  response: {
460
482
  sessions: {
@@ -545,7 +567,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
545
567
  path: "/admin/list-user-sessions";
546
568
  };
547
569
  unbanUser: {
548
- <Context extends {
570
+ <C extends [{
549
571
  body: {
550
572
  userId: string;
551
573
  };
@@ -558,7 +580,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
558
580
  returnHeaders?: boolean | undefined;
559
581
  use?: better_call.Middleware[] | undefined;
560
582
  path?: string | undefined;
561
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
583
+ }]>(...inputCtx: C): Promise<C extends [{
584
+ asResponse: true;
585
+ }] ? Response : C extends [{
586
+ returnHeaders: true;
587
+ }] ? {
562
588
  headers: Headers;
563
589
  response: {
564
590
  user: any;
@@ -628,7 +654,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
628
654
  path: "/admin/unban-user";
629
655
  };
630
656
  banUser: {
631
- <Context extends {
657
+ <C extends [{
632
658
  body: {
633
659
  userId: string;
634
660
  banReason?: string | undefined;
@@ -643,7 +669,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
643
669
  returnHeaders?: boolean | undefined;
644
670
  use?: better_call.Middleware[] | undefined;
645
671
  path?: string | undefined;
646
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
672
+ }]>(...inputCtx: C): Promise<C extends [{
673
+ asResponse: true;
674
+ }] ? Response : C extends [{
675
+ returnHeaders: true;
676
+ }] ? {
647
677
  headers: Headers;
648
678
  response: {
649
679
  user: any;
@@ -725,7 +755,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
725
755
  path: "/admin/ban-user";
726
756
  };
727
757
  impersonateUser: {
728
- <Context extends {
758
+ <C extends [{
729
759
  body: {
730
760
  userId: string;
731
761
  };
@@ -738,7 +768,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
738
768
  returnHeaders?: boolean | undefined;
739
769
  use?: better_call.Middleware[] | undefined;
740
770
  path?: string | undefined;
741
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
771
+ }]>(...inputCtx: C): Promise<C extends [{
772
+ asResponse: true;
773
+ }] ? Response : C extends [{
774
+ returnHeaders: true;
775
+ }] ? {
742
776
  headers: Headers;
743
777
  response: {
744
778
  session: {
@@ -847,7 +881,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
847
881
  path: "/admin/impersonate-user";
848
882
  };
849
883
  stopImpersonating: {
850
- <Context extends {
884
+ <C extends [({
851
885
  body?: undefined;
852
886
  method?: "POST" | undefined;
853
887
  query?: Record<string, any> | undefined;
@@ -858,7 +892,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
858
892
  returnHeaders?: boolean | undefined;
859
893
  use?: better_call.Middleware[] | undefined;
860
894
  path?: string | undefined;
861
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
895
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
896
+ asResponse: true;
897
+ }] ? Response : C extends [{
898
+ returnHeaders: true;
899
+ }] ? {
862
900
  headers: Headers;
863
901
  response: {
864
902
  session: Session & Record<string, any>;
@@ -876,7 +914,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
876
914
  path: "/admin/stop-impersonating";
877
915
  };
878
916
  revokeUserSession: {
879
- <Context extends {
917
+ <C extends [{
880
918
  body: {
881
919
  sessionToken: string;
882
920
  };
@@ -889,7 +927,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
889
927
  returnHeaders?: boolean | undefined;
890
928
  use?: better_call.Middleware[] | undefined;
891
929
  path?: string | undefined;
892
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
930
+ }]>(...inputCtx: C): Promise<C extends [{
931
+ asResponse: true;
932
+ }] ? Response : C extends [{
933
+ returnHeaders: true;
934
+ }] ? {
893
935
  headers: Headers;
894
936
  response: {
895
937
  success: boolean;
@@ -959,7 +1001,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
959
1001
  path: "/admin/revoke-user-session";
960
1002
  };
961
1003
  revokeUserSessions: {
962
- <Context extends {
1004
+ <C extends [{
963
1005
  body: {
964
1006
  userId: string;
965
1007
  };
@@ -972,7 +1014,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
972
1014
  returnHeaders?: boolean | undefined;
973
1015
  use?: better_call.Middleware[] | undefined;
974
1016
  path?: string | undefined;
975
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
1017
+ }]>(...inputCtx: C): Promise<C extends [{
1018
+ asResponse: true;
1019
+ }] ? Response : C extends [{
1020
+ returnHeaders: true;
1021
+ }] ? {
976
1022
  headers: Headers;
977
1023
  response: {
978
1024
  success: boolean;
@@ -1042,7 +1088,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
1042
1088
  path: "/admin/revoke-user-sessions";
1043
1089
  };
1044
1090
  removeUser: {
1045
- <Context extends {
1091
+ <C extends [{
1046
1092
  body: {
1047
1093
  userId: string;
1048
1094
  };
@@ -1055,7 +1101,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
1055
1101
  returnHeaders?: boolean | undefined;
1056
1102
  use?: better_call.Middleware[] | undefined;
1057
1103
  path?: string | undefined;
1058
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
1104
+ }]>(...inputCtx: C): Promise<C extends [{
1105
+ asResponse: true;
1106
+ }] ? Response : C extends [{
1107
+ returnHeaders: true;
1108
+ }] ? {
1059
1109
  headers: Headers;
1060
1110
  response: {
1061
1111
  success: boolean;
@@ -1125,7 +1175,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
1125
1175
  path: "/admin/remove-user";
1126
1176
  };
1127
1177
  setUserPassword: {
1128
- <Context extends {
1178
+ <C extends [{
1129
1179
  body: {
1130
1180
  userId: string;
1131
1181
  newPassword: string;
@@ -1139,7 +1189,11 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
1139
1189
  returnHeaders?: boolean | undefined;
1140
1190
  use?: better_call.Middleware[] | undefined;
1141
1191
  path?: string | undefined;
1142
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
1192
+ }]>(...inputCtx: C): Promise<C extends [{
1193
+ asResponse: true;
1194
+ }] ? Response : C extends [{
1195
+ returnHeaders: true;
1196
+ }] ? {
1143
1197
  headers: Headers;
1144
1198
  response: {
1145
1199
  status: boolean;
@@ -1,4 +1,4 @@
1
- export { admin } from '../chunk-5AOJMBJI.js';
1
+ export { admin } from '../chunk-J6VNT2T4.js';
2
2
  import '../chunk-JEYF2ARX.js';
3
3
  import '../chunk-SCXZXQTZ.js';
4
4
  import '../chunk-TODG5RSV.js';
@@ -1,5 +1,5 @@
1
1
  import * as better_call from 'better-call';
2
- import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext } from '../auth-CC4kpwks.cjs';
2
+ import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext } from '../auth-BLwS7t0V.cjs';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
@@ -54,7 +54,7 @@ declare const anonymous: (options?: AnonymousOptions) => {
54
54
  id: "anonymous";
55
55
  endpoints: {
56
56
  signInAnonymous: {
57
- <Context extends {
57
+ <C extends [({
58
58
  body?: undefined;
59
59
  method?: "POST" | undefined;
60
60
  query?: Record<string, any> | undefined;
@@ -65,7 +65,11 @@ declare const anonymous: (options?: AnonymousOptions) => {
65
65
  returnHeaders?: boolean | undefined;
66
66
  use?: better_call.Middleware[] | undefined;
67
67
  path?: string | undefined;
68
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
68
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
69
+ asResponse: true;
70
+ }] ? Response : C extends [{
71
+ returnHeaders: true;
72
+ }] ? {
69
73
  headers: Headers;
70
74
  response: {
71
75
  token: string;
@@ -1,5 +1,5 @@
1
1
  import * as better_call from 'better-call';
2
- import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext } from '../auth-BfbTouIV.js';
2
+ import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext } from '../auth-C42JqOR9.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
@@ -54,7 +54,7 @@ declare const anonymous: (options?: AnonymousOptions) => {
54
54
  id: "anonymous";
55
55
  endpoints: {
56
56
  signInAnonymous: {
57
- <Context extends {
57
+ <C extends [({
58
58
  body?: undefined;
59
59
  method?: "POST" | undefined;
60
60
  query?: Record<string, any> | undefined;
@@ -65,7 +65,11 @@ declare const anonymous: (options?: AnonymousOptions) => {
65
65
  returnHeaders?: boolean | undefined;
66
66
  use?: better_call.Middleware[] | undefined;
67
67
  path?: string | undefined;
68
- }>(...inputCtx: better_call.HasRequiredKeys<Context> extends true ? [Context] : [(Context | undefined)?]): Promise<Context["asResponse"] extends true ? Response : Context["returnHeaders"] extends true ? {
68
+ } | undefined)?]>(...inputCtx: C): Promise<C extends [{
69
+ asResponse: true;
70
+ }] ? Response : C extends [{
71
+ returnHeaders: true;
72
+ }] ? {
69
73
  headers: Headers;
70
74
  response: {
71
75
  token: string;
@@ -1,5 +1,5 @@
1
1
  import * as better_call from 'better-call';
2
- import { H as HookEndpointContext } from '../auth-CC4kpwks.cjs';
2
+ import { H as HookEndpointContext } from '../auth-BLwS7t0V.cjs';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
@@ -1,5 +1,5 @@
1
1
  import * as better_call from 'better-call';
2
- import { H as HookEndpointContext } from '../auth-BfbTouIV.js';
2
+ import { H as HookEndpointContext } from '../auth-C42JqOR9.js';
3
3
  import 'zod';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
@@ -1,6 +1,6 @@
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-CC4kpwks.cjs';
3
+ import { B as BetterAuthOptions, k as InferUser, l as InferSession } from '../auth-BLwS7t0V.cjs';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
6
6
  import '../index-BuRgaJZR.cjs';
@@ -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,6 +1,6 @@
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-BfbTouIV.js';
3
+ import { B as BetterAuthOptions, k as InferUser, l as InferSession } from '../auth-C42JqOR9.js';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.js';
6
6
  import '../index-moQjyfmm.js';
@@ -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,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import * as better_call from 'better-call';
3
- import { H as HookEndpointContext } from '../auth-CC4kpwks.cjs';
3
+ import { H as HookEndpointContext } from '../auth-BLwS7t0V.cjs';
4
4
  import 'kysely';
5
5
  import '../helper-Bi8FQwDD.cjs';
6
6
  import '../index-BuRgaJZR.cjs';
@@ -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;