better-auth 1.3.4-beta.1 → 1.3.4-beta.3

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 (232) hide show
  1. package/dist/adapters/drizzle-adapter/index.d.cts +4 -3
  2. package/dist/adapters/drizzle-adapter/index.d.mts +4 -3
  3. package/dist/adapters/drizzle-adapter/index.d.ts +4 -3
  4. package/dist/adapters/index.d.cts +5 -4
  5. package/dist/adapters/index.d.mts +5 -4
  6. package/dist/adapters/index.d.ts +5 -4
  7. package/dist/adapters/kysely-adapter/index.d.cts +4 -3
  8. package/dist/adapters/kysely-adapter/index.d.mts +4 -3
  9. package/dist/adapters/kysely-adapter/index.d.ts +4 -3
  10. package/dist/adapters/memory-adapter/index.d.cts +4 -3
  11. package/dist/adapters/memory-adapter/index.d.mts +4 -3
  12. package/dist/adapters/memory-adapter/index.d.ts +4 -3
  13. package/dist/adapters/mongodb-adapter/index.d.cts +4 -3
  14. package/dist/adapters/mongodb-adapter/index.d.mts +4 -3
  15. package/dist/adapters/mongodb-adapter/index.d.ts +4 -3
  16. package/dist/adapters/prisma-adapter/index.d.cts +4 -3
  17. package/dist/adapters/prisma-adapter/index.d.mts +4 -3
  18. package/dist/adapters/prisma-adapter/index.d.ts +4 -3
  19. package/dist/adapters/test.d.cts +4 -3
  20. package/dist/adapters/test.d.mts +4 -3
  21. package/dist/adapters/test.d.ts +4 -3
  22. package/dist/api/index.cjs +1 -1
  23. package/dist/api/index.d.cts +4 -3
  24. package/dist/api/index.d.mts +4 -3
  25. package/dist/api/index.d.ts +4 -3
  26. package/dist/api/index.mjs +2 -2
  27. package/dist/client/index.d.cts +6 -5
  28. package/dist/client/index.d.mts +6 -5
  29. package/dist/client/index.d.ts +6 -5
  30. package/dist/client/plugins/index.cjs +4 -0
  31. package/dist/client/plugins/index.d.cts +119 -98
  32. package/dist/client/plugins/index.d.mts +119 -98
  33. package/dist/client/plugins/index.d.ts +119 -98
  34. package/dist/client/plugins/index.mjs +4 -1
  35. package/dist/client/react/index.d.cts +5 -4
  36. package/dist/client/react/index.d.mts +5 -4
  37. package/dist/client/react/index.d.ts +5 -4
  38. package/dist/client/solid/index.d.cts +5 -4
  39. package/dist/client/solid/index.d.mts +5 -4
  40. package/dist/client/solid/index.d.ts +5 -4
  41. package/dist/client/svelte/index.d.cts +11 -10
  42. package/dist/client/svelte/index.d.mts +11 -10
  43. package/dist/client/svelte/index.d.ts +11 -10
  44. package/dist/client/vue/index.d.cts +14 -13
  45. package/dist/client/vue/index.d.mts +14 -13
  46. package/dist/client/vue/index.d.ts +14 -13
  47. package/dist/cookies/index.d.cts +4 -3
  48. package/dist/cookies/index.d.mts +4 -3
  49. package/dist/cookies/index.d.ts +4 -3
  50. package/dist/db/index.d.cts +4 -3
  51. package/dist/db/index.d.mts +4 -3
  52. package/dist/db/index.d.ts +4 -3
  53. package/dist/index.cjs +2 -2
  54. package/dist/index.d.cts +5 -4
  55. package/dist/index.d.mts +5 -4
  56. package/dist/index.d.ts +5 -4
  57. package/dist/index.mjs +2 -2
  58. package/dist/integrations/next-js.cjs +4 -2
  59. package/dist/integrations/next-js.d.cts +4 -3
  60. package/dist/integrations/next-js.d.mts +4 -3
  61. package/dist/integrations/next-js.d.ts +4 -3
  62. package/dist/integrations/next-js.mjs +4 -2
  63. package/dist/integrations/node.d.cts +4 -3
  64. package/dist/integrations/node.d.mts +4 -3
  65. package/dist/integrations/node.d.ts +4 -3
  66. package/dist/integrations/react-start.cjs +4 -2
  67. package/dist/integrations/react-start.d.cts +4 -3
  68. package/dist/integrations/react-start.d.mts +4 -3
  69. package/dist/integrations/react-start.d.ts +4 -3
  70. package/dist/integrations/react-start.mjs +4 -2
  71. package/dist/integrations/svelte-kit.cjs +1 -1
  72. package/dist/integrations/svelte-kit.d.cts +4 -3
  73. package/dist/integrations/svelte-kit.d.mts +4 -3
  74. package/dist/integrations/svelte-kit.d.ts +4 -3
  75. package/dist/integrations/svelte-kit.mjs +1 -1
  76. package/dist/oauth2/index.cjs +1 -1
  77. package/dist/oauth2/index.d.cts +5 -4
  78. package/dist/oauth2/index.d.mts +5 -4
  79. package/dist/oauth2/index.d.ts +5 -4
  80. package/dist/oauth2/index.mjs +1 -1
  81. package/dist/plugins/admin/index.cjs +2 -2
  82. package/dist/plugins/admin/index.d.cts +5 -4
  83. package/dist/plugins/admin/index.d.mts +5 -4
  84. package/dist/plugins/admin/index.d.ts +5 -4
  85. package/dist/plugins/admin/index.mjs +2 -2
  86. package/dist/plugins/anonymous/index.cjs +1 -1
  87. package/dist/plugins/anonymous/index.d.cts +4 -3
  88. package/dist/plugins/anonymous/index.d.mts +4 -3
  89. package/dist/plugins/anonymous/index.d.ts +4 -3
  90. package/dist/plugins/anonymous/index.mjs +1 -1
  91. package/dist/plugins/bearer/index.cjs +1 -1
  92. package/dist/plugins/bearer/index.d.cts +4 -3
  93. package/dist/plugins/bearer/index.d.mts +4 -3
  94. package/dist/plugins/bearer/index.d.ts +4 -3
  95. package/dist/plugins/bearer/index.mjs +1 -1
  96. package/dist/plugins/captcha/index.d.cts +4 -3
  97. package/dist/plugins/captcha/index.d.mts +4 -3
  98. package/dist/plugins/captcha/index.d.ts +4 -3
  99. package/dist/plugins/custom-session/index.cjs +1 -1
  100. package/dist/plugins/custom-session/index.d.cts +3 -2
  101. package/dist/plugins/custom-session/index.d.mts +3 -2
  102. package/dist/plugins/custom-session/index.d.ts +3 -2
  103. package/dist/plugins/custom-session/index.mjs +1 -1
  104. package/dist/plugins/email-otp/index.cjs +1 -1
  105. package/dist/plugins/email-otp/index.d.cts +3 -2
  106. package/dist/plugins/email-otp/index.d.mts +3 -2
  107. package/dist/plugins/email-otp/index.d.ts +3 -2
  108. package/dist/plugins/email-otp/index.mjs +1 -1
  109. package/dist/plugins/generic-oauth/index.cjs +1 -1
  110. package/dist/plugins/generic-oauth/index.d.cts +3 -2
  111. package/dist/plugins/generic-oauth/index.d.mts +3 -2
  112. package/dist/plugins/generic-oauth/index.d.ts +3 -2
  113. package/dist/plugins/generic-oauth/index.mjs +1 -1
  114. package/dist/plugins/haveibeenpwned/index.cjs +1 -1
  115. package/dist/plugins/haveibeenpwned/index.d.cts +4 -3
  116. package/dist/plugins/haveibeenpwned/index.d.mts +4 -3
  117. package/dist/plugins/haveibeenpwned/index.d.ts +4 -3
  118. package/dist/plugins/haveibeenpwned/index.mjs +1 -1
  119. package/dist/plugins/index.cjs +10 -6
  120. package/dist/plugins/index.d.cts +6 -4
  121. package/dist/plugins/index.d.mts +6 -4
  122. package/dist/plugins/index.d.ts +6 -4
  123. package/dist/plugins/index.mjs +11 -8
  124. package/dist/plugins/jwt/index.cjs +3 -2
  125. package/dist/plugins/jwt/index.d.cts +4 -3
  126. package/dist/plugins/jwt/index.d.mts +4 -3
  127. package/dist/plugins/jwt/index.d.ts +4 -3
  128. package/dist/plugins/jwt/index.mjs +3 -2
  129. package/dist/plugins/magic-link/index.cjs +1 -1
  130. package/dist/plugins/magic-link/index.mjs +1 -1
  131. package/dist/plugins/multi-session/index.cjs +1 -1
  132. package/dist/plugins/multi-session/index.d.cts +3 -2
  133. package/dist/plugins/multi-session/index.d.mts +3 -2
  134. package/dist/plugins/multi-session/index.d.ts +3 -2
  135. package/dist/plugins/multi-session/index.mjs +1 -1
  136. package/dist/plugins/oauth-proxy/index.cjs +1 -1
  137. package/dist/plugins/oauth-proxy/index.d.cts +3 -2
  138. package/dist/plugins/oauth-proxy/index.d.mts +3 -2
  139. package/dist/plugins/oauth-proxy/index.d.ts +3 -2
  140. package/dist/plugins/oauth-proxy/index.mjs +1 -1
  141. package/dist/plugins/oidc-provider/index.cjs +2 -2
  142. package/dist/plugins/oidc-provider/index.d.cts +7 -6
  143. package/dist/plugins/oidc-provider/index.d.mts +7 -6
  144. package/dist/plugins/oidc-provider/index.d.ts +7 -6
  145. package/dist/plugins/oidc-provider/index.mjs +2 -2
  146. package/dist/plugins/one-tap/index.cjs +1 -1
  147. package/dist/plugins/one-tap/index.mjs +1 -1
  148. package/dist/plugins/one-time-token/index.cjs +5 -3
  149. package/dist/plugins/one-time-token/index.d.cts +3 -2
  150. package/dist/plugins/one-time-token/index.d.mts +3 -2
  151. package/dist/plugins/one-time-token/index.d.ts +3 -2
  152. package/dist/plugins/one-time-token/index.mjs +5 -3
  153. package/dist/plugins/open-api/index.cjs +1 -1
  154. package/dist/plugins/open-api/index.d.cts +4 -3
  155. package/dist/plugins/open-api/index.d.mts +4 -3
  156. package/dist/plugins/open-api/index.d.ts +4 -3
  157. package/dist/plugins/open-api/index.mjs +1 -1
  158. package/dist/plugins/organization/index.cjs +3 -3
  159. package/dist/plugins/organization/index.d.cts +340 -2
  160. package/dist/plugins/organization/index.d.mts +340 -2
  161. package/dist/plugins/organization/index.d.ts +340 -2
  162. package/dist/plugins/organization/index.mjs +3 -3
  163. package/dist/plugins/passkey/index.cjs +1 -1
  164. package/dist/plugins/passkey/index.d.cts +3 -2
  165. package/dist/plugins/passkey/index.d.mts +3 -2
  166. package/dist/plugins/passkey/index.d.ts +3 -2
  167. package/dist/plugins/passkey/index.mjs +1 -1
  168. package/dist/plugins/phone-number/index.cjs +1 -1
  169. package/dist/plugins/phone-number/index.d.cts +3 -2
  170. package/dist/plugins/phone-number/index.d.mts +3 -2
  171. package/dist/plugins/phone-number/index.d.ts +3 -2
  172. package/dist/plugins/phone-number/index.mjs +1 -1
  173. package/dist/plugins/siwe/index.cjs +1 -1
  174. package/dist/plugins/siwe/index.mjs +1 -1
  175. package/dist/plugins/sso/index.cjs +1 -1
  176. package/dist/plugins/sso/index.d.cts +5 -4
  177. package/dist/plugins/sso/index.d.mts +5 -4
  178. package/dist/plugins/sso/index.d.ts +5 -4
  179. package/dist/plugins/sso/index.mjs +1 -1
  180. package/dist/plugins/two-factor/index.cjs +1 -1
  181. package/dist/plugins/two-factor/index.d.cts +3 -2
  182. package/dist/plugins/two-factor/index.d.mts +3 -2
  183. package/dist/plugins/two-factor/index.d.ts +3 -2
  184. package/dist/plugins/two-factor/index.mjs +1 -1
  185. package/dist/plugins/username/index.cjs +1 -1
  186. package/dist/plugins/username/index.d.cts +3 -2
  187. package/dist/plugins/username/index.d.mts +3 -2
  188. package/dist/plugins/username/index.d.ts +3 -2
  189. package/dist/plugins/username/index.mjs +1 -1
  190. package/dist/shared/{better-auth.CgwuYRI6.d.ts → better-auth.BDu3UNgE.d.ts} +1 -1
  191. package/dist/shared/{better-auth.BEVGcJcB.d.cts → better-auth.BIwmvzkV.d.cts} +1 -1
  192. package/dist/shared/{better-auth.DPa2nz5L.d.ts → better-auth.BVGuK4ar.d.ts} +1 -7
  193. package/dist/shared/{better-auth.BmlmaKyX.cjs → better-auth.Bafolo-S.cjs} +21 -18
  194. package/dist/shared/{better-auth.CBRy7Kfv.mjs → better-auth.Bi_HZkIu.mjs} +1 -1
  195. package/dist/shared/{better-auth.CGbzPs1f.d.mts → better-auth.Bnb80B_N.d.mts} +36 -36
  196. package/dist/shared/{better-auth.DZrpkFKF.d.mts → better-auth.Bp23Ki79.d.mts} +1 -1
  197. package/dist/shared/{better-auth.D-e_NZP_.d.cts → better-auth.BpvmjfpK.d.cts} +1 -1
  198. package/dist/shared/{better-auth.D3yxPPAx.cjs → better-auth.Bu6UgQrE.cjs} +1 -1
  199. package/dist/shared/{better-auth.npEvGVS_.d.cts → better-auth.CO5IkT5Y.d.cts} +1 -7
  200. package/dist/shared/{better-auth.BSlYEj4a.mjs → better-auth.CSmnO3Gi.mjs} +7 -5
  201. package/dist/shared/{better-auth.Dh7-tTG_.cjs → better-auth.CVwggEK6.cjs} +1 -1
  202. package/dist/shared/{better-auth.qAQLs3oh.mjs → better-auth.CXlGSHh_.mjs} +183 -19
  203. package/dist/shared/{better-auth.suSxVjlG.mjs → better-auth.Cbhy6WDJ.mjs} +1 -1
  204. package/dist/shared/{better-auth.qqdBtFXF.mjs → better-auth.CeHRmQ1_.mjs} +2 -2
  205. package/dist/shared/{better-auth.g3dyHRq3.cjs → better-auth.Clgagr7Y.cjs} +1 -1
  206. package/dist/shared/{better-auth.DmgxJVMw.cjs → better-auth.Cm8OvsAW.cjs} +7 -5
  207. package/dist/shared/{better-auth.Dk9tboye.d.ts → better-auth.D42SEnNn.d.ts} +36 -36
  208. package/dist/shared/{better-auth.IegS6fw_.d.mts → better-auth.D4Hrcjya.d.mts} +1 -7
  209. package/dist/shared/{better-auth.BJBqdZRj.d.mts → better-auth.DIdmptNT.d.mts} +1 -1
  210. package/dist/shared/{better-auth.DFbPZcJB.cjs → better-auth.DPjhN9w6.cjs} +183 -19
  211. package/dist/shared/{better-auth.DuVeV56y.mjs → better-auth.DbQJKdHV.mjs} +1 -1
  212. package/dist/shared/{better-auth.CRoWmkul.d.cts → better-auth.DbpYnd_w.d.cts} +332 -331
  213. package/dist/shared/{better-auth.erA-UimG.d.cts → better-auth.DkEQxRof.d.cts} +36 -36
  214. package/dist/shared/{better-auth.BM-fcff3.d.mts → better-auth.RqYFOC7x.d.mts} +332 -331
  215. package/dist/shared/{better-auth.Mp2Y0CFO.d.ts → better-auth.ao1BAkzn.d.ts} +332 -331
  216. package/dist/shared/{better-auth.BKXQcVm3.d.ts → better-auth.boErnd2B.d.ts} +1 -1
  217. package/dist/shared/{better-auth.B4Ok5fZz.cjs → better-auth.rzigBjjF.cjs} +2 -2
  218. package/dist/shared/{better-auth.BbLNIhjs.mjs → better-auth.z3dsxLxE.mjs} +21 -18
  219. package/dist/social-providers/index.cjs +1 -1
  220. package/dist/social-providers/index.d.cts +1 -1
  221. package/dist/social-providers/index.d.mts +1 -1
  222. package/dist/social-providers/index.d.ts +1 -1
  223. package/dist/social-providers/index.mjs +1 -1
  224. package/dist/test-utils/index.cjs +5 -3
  225. package/dist/test-utils/index.d.cts +3 -3
  226. package/dist/test-utils/index.d.mts +3 -3
  227. package/dist/test-utils/index.d.ts +3 -3
  228. package/dist/test-utils/index.mjs +5 -3
  229. package/dist/types/index.d.cts +5 -4
  230. package/dist/types/index.d.mts +5 -4
  231. package/dist/types/index.d.ts +5 -4
  232. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
+ import { organization, InferMember, InferInvitation, Team, Organization, Member, Invitation, OrganizationOptions, TeamMember } from '../../plugins/organization/index.cjs';
2
+ import { AccessControl, Role, Statements } from '../../plugins/access/index.cjs';
1
3
  import * as nanostores from 'nanostores';
2
4
  import { atom } from 'nanostores';
3
- import { AccessControl, Role, Statements } from '../../plugins/access/index.cjs';
4
5
  import * as _better_fetch_fetch from '@better-fetch/fetch';
5
6
  import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
6
- import { OrganizationOptions, organization, InferMember, InferInvitation, Team, Organization, Member, Invitation } from '../../plugins/organization/index.cjs';
7
- import { h as BetterAuthPlugin, a4 as FieldAttribute, B as BetterAuthOptions } from '../../shared/better-auth.CRoWmkul.cjs';
8
7
  import { a as Prettify } from '../../shared/better-auth.ZSfSbnQT.cjs';
8
+ import { a4 as FieldAttribute, B as BetterAuthOptions, h as BetterAuthPlugin } from '../../shared/better-auth.DbpYnd_w.cjs';
9
9
  import { username } from '../../plugins/username/index.cjs';
10
10
  import { Passkey, passkey } from '../../plugins/passkey/index.cjs';
11
11
  export { twoFactorClient } from '../../plugins/two-factor/index.cjs';
@@ -17,10 +17,10 @@ import { genericOAuth } from '../../plugins/generic-oauth/index.cjs';
17
17
  import { jwt } from '../../plugins/jwt/index.cjs';
18
18
  import { multiSession } from '../../plugins/multi-session/index.cjs';
19
19
  import { emailOTP } from '../../plugins/email-otp/index.cjs';
20
- import { S as Store } from '../../shared/better-auth.D-e_NZP_.cjs';
20
+ import { S as Store } from '../../shared/better-auth.BpvmjfpK.cjs';
21
21
  import { sso } from '../../plugins/sso/index.cjs';
22
22
  import { oidcProvider } from '../../plugins/oidc-provider/index.cjs';
23
- import { a as apiKey } from '../../shared/better-auth.erA-UimG.cjs';
23
+ import { a as apiKey } from '../../shared/better-auth.DkEQxRof.cjs';
24
24
  import { oneTimeToken } from '../../plugins/one-time-token/index.cjs';
25
25
  export * from '@simplewebauthn/server';
26
26
  export { global } from '@simplewebauthn/server';
@@ -28,9 +28,10 @@ import 'zod/v4';
28
28
  import 'better-call';
29
29
  import '../../plugins/organization/access/index.cjs';
30
30
  import 'kysely';
31
- import '../../shared/better-auth.npEvGVS_.cjs';
31
+ import '../../shared/better-auth.CO5IkT5Y.cjs';
32
32
  import 'jose';
33
33
  import 'zod/v4/core';
34
+ import 'zod';
34
35
  import 'better-sqlite3';
35
36
  import 'bun:sqlite';
36
37
 
@@ -42,11 +43,28 @@ interface OrganizationClientOptions {
42
43
  teams?: {
43
44
  enabled: boolean;
44
45
  };
45
- $inferAuth?: {
46
- options: {
47
- plugins: BetterAuthPlugin[];
46
+ schema?: {
47
+ organization?: {
48
+ additionalFields?: {
49
+ [key: string]: FieldAttribute;
50
+ };
51
+ };
52
+ member?: {
53
+ additionalFields?: {
54
+ [key: string]: FieldAttribute;
55
+ };
56
+ };
57
+ invitation?: {
58
+ additionalFields?: {
59
+ [key: string]: FieldAttribute;
60
+ };
61
+ };
62
+ team?: {
63
+ additionalFields?: {
64
+ [key: string]: FieldAttribute;
65
+ };
48
66
  };
49
- } | OrganizationOptions["schema"];
67
+ };
50
68
  }
51
69
  declare const organizationClient: <CO extends OrganizationClientOptions>(options?: CO) => {
52
70
  id: "organization";
@@ -67,87 +85,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
67
85
  enabled: true;
68
86
  } ? true : false;
69
87
  };
70
- schema: CO["$inferAuth"] extends Object ? CO["$inferAuth"] extends {
71
- session?: {
72
- fields?: {
73
- activeOrganizationId?: string;
74
- activeTeamId?: string;
75
- };
76
- };
77
- organization?: {
78
- modelName?: string;
79
- fields?: { [key in keyof Omit<Organization, "id">]?: string; };
80
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
81
- };
82
- member?: {
83
- modelName?: string;
84
- fields?: { [key in keyof Omit<Member, "id">]?: string; };
85
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
86
- };
87
- invitation?: {
88
- modelName?: string;
89
- fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
90
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
91
- };
92
- team?: {
93
- modelName?: string;
94
- fields?: { [key in keyof Omit<Team, "id">]?: string; };
95
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
96
- };
97
- teamMember?: {
98
- modelName?: string;
99
- fields?: { [key in keyof Omit<_.TeamMember, "id">]?: string; };
100
- };
101
- } ? CO["$inferAuth"] : ((CO["$inferAuth"] extends {
102
- options: any;
103
- } ? CO["$inferAuth"] : {
104
- options: {
105
- plugins: [];
106
- };
107
- })["options"]["plugins"][number] extends infer T ? T extends (CO["$inferAuth"] extends {
108
- options: any;
109
- } ? CO["$inferAuth"] : {
110
- options: {
111
- plugins: [];
112
- };
113
- })["options"]["plugins"][number] ? T extends {
114
- id: "organization";
115
- } ? T : never : never : never) extends {
116
- options: {
117
- schema: infer S;
118
- };
119
- } ? S extends {
120
- session?: {
121
- fields?: {
122
- activeOrganizationId?: string;
123
- activeTeamId?: string;
124
- };
125
- };
126
- organization?: {
127
- modelName?: string;
128
- fields?: { [key in keyof Omit<Organization, "id">]?: string; };
129
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
130
- };
131
- member?: {
132
- modelName?: string;
133
- fields?: { [key in keyof Omit<Member, "id">]?: string; };
134
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
135
- };
136
- invitation?: {
137
- modelName?: string;
138
- fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
139
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
140
- };
141
- team?: {
142
- modelName?: string;
143
- fields?: { [key in keyof Omit<Team, "id">]?: string; };
144
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
145
- };
146
- teamMember?: {
147
- modelName?: string;
148
- fields?: { [key in keyof Omit<_.TeamMember, "id">]?: string; };
149
- };
150
- } | undefined ? S : undefined : undefined : undefined;
88
+ schema: CO["schema"];
151
89
  }>>;
152
90
  getActions: ($fetch: _better_fetch_fetch.BetterFetch) => {
153
91
  $Infer: {
@@ -187,17 +125,17 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
187
125
  /**
188
126
  * @deprecated Use `permissions` instead
189
127
  */
190
- permission: { [key in keyof (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
128
+ permission: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
191
129
  readonly organization: readonly ["update", "delete"];
192
130
  readonly member: readonly ["create", "update", "delete"];
193
131
  readonly invitation: readonly ["create", "cancel"];
194
132
  readonly team: readonly ["create", "update", "delete"];
195
- })]?: ((CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
133
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
196
134
  readonly organization: readonly ["update", "delete"];
197
135
  readonly member: readonly ["create", "update", "delete"];
198
136
  readonly invitation: readonly ["create", "cancel"];
199
137
  readonly team: readonly ["create", "update", "delete"];
200
- })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
138
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
201
139
  readonly organization: readonly ["update", "delete"];
202
140
  readonly member: readonly ["create", "update", "delete"];
203
141
  readonly invitation: readonly ["create", "cancel"];
@@ -205,17 +143,17 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
205
143
  })[key][number] : never)[] | undefined; };
206
144
  permissions?: never;
207
145
  } | {
208
- permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
146
+ permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
209
147
  readonly organization: readonly ["update", "delete"];
210
148
  readonly member: readonly ["create", "update", "delete"];
211
149
  readonly invitation: readonly ["create", "cancel"];
212
150
  readonly team: readonly ["create", "update", "delete"];
213
- })]?: ((CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
151
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
214
152
  readonly organization: readonly ["update", "delete"];
215
153
  readonly member: readonly ["create", "update", "delete"];
216
154
  readonly invitation: readonly ["create", "cancel"];
217
155
  readonly team: readonly ["create", "update", "delete"];
218
- })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
156
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
219
157
  readonly organization: readonly ["update", "delete"];
220
158
  readonly member: readonly ["create", "update", "delete"];
221
159
  readonly invitation: readonly ["create", "cancel"];
@@ -300,6 +238,89 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
300
238
  signal: "$activeMemberSignal";
301
239
  })[];
302
240
  };
241
+ declare const inferOrgAdditionalFields: <O extends {
242
+ options: BetterAuthOptions;
243
+ }, S extends OrganizationOptions["schema"] = undefined>(schema?: S) => undefined extends S ? O extends Object ? O extends {
244
+ session?: {
245
+ fields?: {
246
+ activeOrganizationId?: string;
247
+ activeTeamId?: string;
248
+ };
249
+ };
250
+ organization?: {
251
+ modelName?: string;
252
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
253
+ additionalFields?: { [key in string]: FieldAttribute; };
254
+ };
255
+ member?: {
256
+ modelName?: string;
257
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
258
+ additionalFields?: { [key in string]: FieldAttribute; };
259
+ };
260
+ invitation?: {
261
+ modelName?: string;
262
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
263
+ additionalFields?: { [key in string]: FieldAttribute; };
264
+ };
265
+ team?: {
266
+ modelName?: string;
267
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
268
+ additionalFields?: { [key in string]: FieldAttribute; };
269
+ };
270
+ teamMember?: {
271
+ modelName?: string;
272
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
273
+ };
274
+ } ? O : ((O extends {
275
+ options: any;
276
+ } ? O : {
277
+ options: {
278
+ plugins: [];
279
+ };
280
+ })["options"]["plugins"][number] extends infer T ? T extends (O extends {
281
+ options: any;
282
+ } ? O : {
283
+ options: {
284
+ plugins: [];
285
+ };
286
+ })["options"]["plugins"][number] ? T extends {
287
+ id: "organization";
288
+ } ? T : never : never : never) extends {
289
+ options: {
290
+ schema: infer S_1;
291
+ };
292
+ } ? S_1 extends {
293
+ session?: {
294
+ fields?: {
295
+ activeOrganizationId?: string;
296
+ activeTeamId?: string;
297
+ };
298
+ };
299
+ organization?: {
300
+ modelName?: string;
301
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
302
+ additionalFields?: { [key in string]: FieldAttribute; };
303
+ };
304
+ member?: {
305
+ modelName?: string;
306
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
307
+ additionalFields?: { [key in string]: FieldAttribute; };
308
+ };
309
+ invitation?: {
310
+ modelName?: string;
311
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
312
+ additionalFields?: { [key in string]: FieldAttribute; };
313
+ };
314
+ team?: {
315
+ modelName?: string;
316
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
317
+ additionalFields?: { [key in string]: FieldAttribute; };
318
+ };
319
+ teamMember?: {
320
+ modelName?: string;
321
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
322
+ };
323
+ } | undefined ? S_1 : undefined : undefined : undefined : S;
303
324
 
304
325
  declare const usernameClient: () => {
305
326
  id: "username";
@@ -767,5 +788,5 @@ declare const oneTimeTokenClient: () => {
767
788
  $InferServerPlugin: ReturnType<typeof oneTimeToken>;
768
789
  };
769
790
 
770
- export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, customSessionClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, jwtClient, magicLinkClient, multiSessionClient, oidcClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, ssoClient, usernameClient };
791
+ export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, customSessionClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, magicLinkClient, multiSessionClient, oidcClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, ssoClient, usernameClient };
771
792
  export type { GoogleOneTapActionOptions, GoogleOneTapOptions };
@@ -1,11 +1,11 @@
1
+ import { organization, InferMember, InferInvitation, Team, Organization, Member, Invitation, OrganizationOptions, TeamMember } from '../../plugins/organization/index.mjs';
2
+ import { AccessControl, Role, Statements } from '../../plugins/access/index.mjs';
1
3
  import * as nanostores from 'nanostores';
2
4
  import { atom } from 'nanostores';
3
- import { AccessControl, Role, Statements } from '../../plugins/access/index.mjs';
4
5
  import * as _better_fetch_fetch from '@better-fetch/fetch';
5
6
  import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
6
- import { OrganizationOptions, organization, InferMember, InferInvitation, Team, Organization, Member, Invitation } from '../../plugins/organization/index.mjs';
7
- import { h as BetterAuthPlugin, a4 as FieldAttribute, B as BetterAuthOptions } from '../../shared/better-auth.BM-fcff3.mjs';
8
7
  import { a as Prettify } from '../../shared/better-auth.ZSfSbnQT.mjs';
8
+ import { a4 as FieldAttribute, B as BetterAuthOptions, h as BetterAuthPlugin } from '../../shared/better-auth.RqYFOC7x.mjs';
9
9
  import { username } from '../../plugins/username/index.mjs';
10
10
  import { Passkey, passkey } from '../../plugins/passkey/index.mjs';
11
11
  export { twoFactorClient } from '../../plugins/two-factor/index.mjs';
@@ -17,10 +17,10 @@ import { genericOAuth } from '../../plugins/generic-oauth/index.mjs';
17
17
  import { jwt } from '../../plugins/jwt/index.mjs';
18
18
  import { multiSession } from '../../plugins/multi-session/index.mjs';
19
19
  import { emailOTP } from '../../plugins/email-otp/index.mjs';
20
- import { S as Store } from '../../shared/better-auth.DZrpkFKF.mjs';
20
+ import { S as Store } from '../../shared/better-auth.Bp23Ki79.mjs';
21
21
  import { sso } from '../../plugins/sso/index.mjs';
22
22
  import { oidcProvider } from '../../plugins/oidc-provider/index.mjs';
23
- import { a as apiKey } from '../../shared/better-auth.CGbzPs1f.mjs';
23
+ import { a as apiKey } from '../../shared/better-auth.Bnb80B_N.mjs';
24
24
  import { oneTimeToken } from '../../plugins/one-time-token/index.mjs';
25
25
  export * from '@simplewebauthn/server';
26
26
  export { global } from '@simplewebauthn/server';
@@ -28,9 +28,10 @@ import 'zod/v4';
28
28
  import 'better-call';
29
29
  import '../../plugins/organization/access/index.mjs';
30
30
  import 'kysely';
31
- import '../../shared/better-auth.IegS6fw_.mjs';
31
+ import '../../shared/better-auth.D4Hrcjya.mjs';
32
32
  import 'jose';
33
33
  import 'zod/v4/core';
34
+ import 'zod';
34
35
  import 'better-sqlite3';
35
36
  import 'bun:sqlite';
36
37
 
@@ -42,11 +43,28 @@ interface OrganizationClientOptions {
42
43
  teams?: {
43
44
  enabled: boolean;
44
45
  };
45
- $inferAuth?: {
46
- options: {
47
- plugins: BetterAuthPlugin[];
46
+ schema?: {
47
+ organization?: {
48
+ additionalFields?: {
49
+ [key: string]: FieldAttribute;
50
+ };
51
+ };
52
+ member?: {
53
+ additionalFields?: {
54
+ [key: string]: FieldAttribute;
55
+ };
56
+ };
57
+ invitation?: {
58
+ additionalFields?: {
59
+ [key: string]: FieldAttribute;
60
+ };
61
+ };
62
+ team?: {
63
+ additionalFields?: {
64
+ [key: string]: FieldAttribute;
65
+ };
48
66
  };
49
- } | OrganizationOptions["schema"];
67
+ };
50
68
  }
51
69
  declare const organizationClient: <CO extends OrganizationClientOptions>(options?: CO) => {
52
70
  id: "organization";
@@ -67,87 +85,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
67
85
  enabled: true;
68
86
  } ? true : false;
69
87
  };
70
- schema: CO["$inferAuth"] extends Object ? CO["$inferAuth"] extends {
71
- session?: {
72
- fields?: {
73
- activeOrganizationId?: string;
74
- activeTeamId?: string;
75
- };
76
- };
77
- organization?: {
78
- modelName?: string;
79
- fields?: { [key in keyof Omit<Organization, "id">]?: string; };
80
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
81
- };
82
- member?: {
83
- modelName?: string;
84
- fields?: { [key in keyof Omit<Member, "id">]?: string; };
85
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
86
- };
87
- invitation?: {
88
- modelName?: string;
89
- fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
90
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
91
- };
92
- team?: {
93
- modelName?: string;
94
- fields?: { [key in keyof Omit<Team, "id">]?: string; };
95
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
96
- };
97
- teamMember?: {
98
- modelName?: string;
99
- fields?: { [key in keyof Omit<_.TeamMember, "id">]?: string; };
100
- };
101
- } ? CO["$inferAuth"] : ((CO["$inferAuth"] extends {
102
- options: any;
103
- } ? CO["$inferAuth"] : {
104
- options: {
105
- plugins: [];
106
- };
107
- })["options"]["plugins"][number] extends infer T ? T extends (CO["$inferAuth"] extends {
108
- options: any;
109
- } ? CO["$inferAuth"] : {
110
- options: {
111
- plugins: [];
112
- };
113
- })["options"]["plugins"][number] ? T extends {
114
- id: "organization";
115
- } ? T : never : never : never) extends {
116
- options: {
117
- schema: infer S;
118
- };
119
- } ? S extends {
120
- session?: {
121
- fields?: {
122
- activeOrganizationId?: string;
123
- activeTeamId?: string;
124
- };
125
- };
126
- organization?: {
127
- modelName?: string;
128
- fields?: { [key in keyof Omit<Organization, "id">]?: string; };
129
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
130
- };
131
- member?: {
132
- modelName?: string;
133
- fields?: { [key in keyof Omit<Member, "id">]?: string; };
134
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
135
- };
136
- invitation?: {
137
- modelName?: string;
138
- fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
139
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
140
- };
141
- team?: {
142
- modelName?: string;
143
- fields?: { [key in keyof Omit<Team, "id">]?: string; };
144
- additionalFields?: { [key in string]: ______db.FieldAttribute; };
145
- };
146
- teamMember?: {
147
- modelName?: string;
148
- fields?: { [key in keyof Omit<_.TeamMember, "id">]?: string; };
149
- };
150
- } | undefined ? S : undefined : undefined : undefined;
88
+ schema: CO["schema"];
151
89
  }>>;
152
90
  getActions: ($fetch: _better_fetch_fetch.BetterFetch) => {
153
91
  $Infer: {
@@ -187,17 +125,17 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
187
125
  /**
188
126
  * @deprecated Use `permissions` instead
189
127
  */
190
- permission: { [key in keyof (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
128
+ permission: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
191
129
  readonly organization: readonly ["update", "delete"];
192
130
  readonly member: readonly ["create", "update", "delete"];
193
131
  readonly invitation: readonly ["create", "cancel"];
194
132
  readonly team: readonly ["create", "update", "delete"];
195
- })]?: ((CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
133
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
196
134
  readonly organization: readonly ["update", "delete"];
197
135
  readonly member: readonly ["create", "update", "delete"];
198
136
  readonly invitation: readonly ["create", "cancel"];
199
137
  readonly team: readonly ["create", "update", "delete"];
200
- })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
138
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
201
139
  readonly organization: readonly ["update", "delete"];
202
140
  readonly member: readonly ["create", "update", "delete"];
203
141
  readonly invitation: readonly ["create", "cancel"];
@@ -205,17 +143,17 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
205
143
  })[key][number] : never)[] | undefined; };
206
144
  permissions?: never;
207
145
  } | {
208
- permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
146
+ permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
209
147
  readonly organization: readonly ["update", "delete"];
210
148
  readonly member: readonly ["create", "update", "delete"];
211
149
  readonly invitation: readonly ["create", "cancel"];
212
150
  readonly team: readonly ["create", "update", "delete"];
213
- })]?: ((CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
151
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
214
152
  readonly organization: readonly ["update", "delete"];
215
153
  readonly member: readonly ["create", "update", "delete"];
216
154
  readonly invitation: readonly ["create", "cancel"];
217
155
  readonly team: readonly ["create", "update", "delete"];
218
- })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S_1 extends Statements> ? S_1 : {
156
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
219
157
  readonly organization: readonly ["update", "delete"];
220
158
  readonly member: readonly ["create", "update", "delete"];
221
159
  readonly invitation: readonly ["create", "cancel"];
@@ -300,6 +238,89 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
300
238
  signal: "$activeMemberSignal";
301
239
  })[];
302
240
  };
241
+ declare const inferOrgAdditionalFields: <O extends {
242
+ options: BetterAuthOptions;
243
+ }, S extends OrganizationOptions["schema"] = undefined>(schema?: S) => undefined extends S ? O extends Object ? O extends {
244
+ session?: {
245
+ fields?: {
246
+ activeOrganizationId?: string;
247
+ activeTeamId?: string;
248
+ };
249
+ };
250
+ organization?: {
251
+ modelName?: string;
252
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
253
+ additionalFields?: { [key in string]: FieldAttribute; };
254
+ };
255
+ member?: {
256
+ modelName?: string;
257
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
258
+ additionalFields?: { [key in string]: FieldAttribute; };
259
+ };
260
+ invitation?: {
261
+ modelName?: string;
262
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
263
+ additionalFields?: { [key in string]: FieldAttribute; };
264
+ };
265
+ team?: {
266
+ modelName?: string;
267
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
268
+ additionalFields?: { [key in string]: FieldAttribute; };
269
+ };
270
+ teamMember?: {
271
+ modelName?: string;
272
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
273
+ };
274
+ } ? O : ((O extends {
275
+ options: any;
276
+ } ? O : {
277
+ options: {
278
+ plugins: [];
279
+ };
280
+ })["options"]["plugins"][number] extends infer T ? T extends (O extends {
281
+ options: any;
282
+ } ? O : {
283
+ options: {
284
+ plugins: [];
285
+ };
286
+ })["options"]["plugins"][number] ? T extends {
287
+ id: "organization";
288
+ } ? T : never : never : never) extends {
289
+ options: {
290
+ schema: infer S_1;
291
+ };
292
+ } ? S_1 extends {
293
+ session?: {
294
+ fields?: {
295
+ activeOrganizationId?: string;
296
+ activeTeamId?: string;
297
+ };
298
+ };
299
+ organization?: {
300
+ modelName?: string;
301
+ fields?: { [key in keyof Omit<Organization, "id">]?: string; };
302
+ additionalFields?: { [key in string]: FieldAttribute; };
303
+ };
304
+ member?: {
305
+ modelName?: string;
306
+ fields?: { [key in keyof Omit<Member, "id">]?: string; };
307
+ additionalFields?: { [key in string]: FieldAttribute; };
308
+ };
309
+ invitation?: {
310
+ modelName?: string;
311
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string; };
312
+ additionalFields?: { [key in string]: FieldAttribute; };
313
+ };
314
+ team?: {
315
+ modelName?: string;
316
+ fields?: { [key in keyof Omit<Team, "id">]?: string; };
317
+ additionalFields?: { [key in string]: FieldAttribute; };
318
+ };
319
+ teamMember?: {
320
+ modelName?: string;
321
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string; };
322
+ };
323
+ } | undefined ? S_1 : undefined : undefined : undefined : S;
303
324
 
304
325
  declare const usernameClient: () => {
305
326
  id: "username";
@@ -767,5 +788,5 @@ declare const oneTimeTokenClient: () => {
767
788
  $InferServerPlugin: ReturnType<typeof oneTimeToken>;
768
789
  };
769
790
 
770
- export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, customSessionClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, jwtClient, magicLinkClient, multiSessionClient, oidcClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, ssoClient, usernameClient };
791
+ export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, customSessionClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, magicLinkClient, multiSessionClient, oidcClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, ssoClient, usernameClient };
771
792
  export type { GoogleOneTapActionOptions, GoogleOneTapOptions };