@porulle/core 0.10.8 → 0.13.0

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 (360) hide show
  1. package/dist/auth/auth-schema-guard.d.ts +2444 -0
  2. package/dist/auth/auth-schema-guard.d.ts.map +1 -0
  3. package/dist/auth/auth-schema-guard.js +113 -0
  4. package/dist/auth/auth-schema.d.ts +228 -0
  5. package/dist/auth/auth-schema.d.ts.map +1 -1
  6. package/dist/auth/auth-schema.js +24 -2
  7. package/dist/auth/middleware.d.ts +1 -0
  8. package/dist/auth/middleware.d.ts.map +1 -1
  9. package/dist/auth/middleware.js +13 -5
  10. package/dist/auth/org.d.ts +8 -2
  11. package/dist/auth/org.d.ts.map +1 -1
  12. package/dist/auth/org.js +12 -4
  13. package/dist/auth/organization-guard.d.ts +5 -0
  14. package/dist/auth/organization-guard.d.ts.map +1 -0
  15. package/dist/auth/organization-guard.js +124 -0
  16. package/dist/auth/permissions.d.ts +10 -0
  17. package/dist/auth/permissions.d.ts.map +1 -1
  18. package/dist/auth/permissions.js +31 -7
  19. package/dist/auth/role-authority.d.ts +44 -0
  20. package/dist/auth/role-authority.d.ts.map +1 -0
  21. package/dist/auth/role-authority.js +85 -0
  22. package/dist/auth/setup.d.ts.map +1 -1
  23. package/dist/auth/setup.js +17 -0
  24. package/dist/auth/strict-org-resolution.d.ts.map +1 -1
  25. package/dist/auth/strict-org-resolution.js +9 -1
  26. package/dist/auth/types.d.ts +1 -1
  27. package/dist/auth/types.d.ts.map +1 -1
  28. package/dist/config/defaults.d.ts.map +1 -1
  29. package/dist/config/defaults.js +2 -0
  30. package/dist/config/types.d.ts +33 -4
  31. package/dist/config/types.d.ts.map +1 -1
  32. package/dist/hooks/checkout.d.ts.map +1 -1
  33. package/dist/hooks/checkout.js +10 -9
  34. package/dist/index.d.ts +9 -6
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +5 -3
  37. package/dist/interfaces/rest/audit-middleware.d.ts.map +1 -1
  38. package/dist/interfaces/rest/audit-middleware.js +2 -0
  39. package/dist/interfaces/rest/customer-portal.d.ts.map +1 -1
  40. package/dist/interfaces/rest/customer-portal.js +9 -8
  41. package/dist/interfaces/rest/index.d.ts.map +1 -1
  42. package/dist/interfaces/rest/index.js +4 -0
  43. package/dist/interfaces/rest/route-coverage.d.ts +14 -0
  44. package/dist/interfaces/rest/route-coverage.d.ts.map +1 -0
  45. package/dist/interfaces/rest/route-coverage.js +81 -0
  46. package/dist/interfaces/rest/router.d.ts +7 -2
  47. package/dist/interfaces/rest/router.d.ts.map +1 -1
  48. package/dist/interfaces/rest/router.js +8 -4
  49. package/dist/interfaces/rest/routes/admin/compensation-failures.d.ts.map +1 -1
  50. package/dist/interfaces/rest/routes/admin/compensation-failures.js +7 -5
  51. package/dist/interfaces/rest/routes/admin/custom-field-proposals.d.ts +5 -0
  52. package/dist/interfaces/rest/routes/admin/custom-field-proposals.d.ts.map +1 -0
  53. package/dist/interfaces/rest/routes/admin/custom-field-proposals.js +22 -0
  54. package/dist/interfaces/rest/routes/admin/entity-field-definitions.d.ts +5 -0
  55. package/dist/interfaces/rest/routes/admin/entity-field-definitions.d.ts.map +1 -0
  56. package/dist/interfaces/rest/routes/admin/entity-field-definitions.js +39 -0
  57. package/dist/interfaces/rest/routes/admin/permissions.d.ts +1 -1
  58. package/dist/interfaces/rest/routes/admin/permissions.d.ts.map +1 -1
  59. package/dist/interfaces/rest/routes/admin/permissions.js +2 -0
  60. package/dist/interfaces/rest/routes/admin/staff.d.ts.map +1 -1
  61. package/dist/interfaces/rest/routes/admin/staff.js +126 -66
  62. package/dist/interfaces/rest/routes/admin-jobs.js +3 -3
  63. package/dist/interfaces/rest/routes/audit.js +3 -3
  64. package/dist/interfaces/rest/routes/carts.d.ts.map +1 -1
  65. package/dist/interfaces/rest/routes/carts.js +13 -10
  66. package/dist/interfaces/rest/routes/catalog.d.ts.map +1 -1
  67. package/dist/interfaces/rest/routes/catalog.js +47 -4
  68. package/dist/interfaces/rest/routes/checkout.d.ts.map +1 -1
  69. package/dist/interfaces/rest/routes/checkout.js +30 -35
  70. package/dist/interfaces/rest/routes/documents.d.ts.map +1 -1
  71. package/dist/interfaces/rest/routes/documents.js +10 -5
  72. package/dist/interfaces/rest/routes/inventory.d.ts.map +1 -1
  73. package/dist/interfaces/rest/routes/inventory.js +2 -0
  74. package/dist/interfaces/rest/routes/media.d.ts.map +1 -1
  75. package/dist/interfaces/rest/routes/media.js +7 -3
  76. package/dist/interfaces/rest/routes/orders.d.ts.map +1 -1
  77. package/dist/interfaces/rest/routes/orders.js +26 -8
  78. package/dist/interfaces/rest/routes/pricing.js +2 -2
  79. package/dist/interfaces/rest/routes/promotions.d.ts.map +1 -1
  80. package/dist/interfaces/rest/routes/promotions.js +13 -10
  81. package/dist/interfaces/rest/routes/search.d.ts.map +1 -1
  82. package/dist/interfaces/rest/routes/search.js +14 -1
  83. package/dist/interfaces/rest/schemas/admin-custom-field-proposals.d.ts +134 -0
  84. package/dist/interfaces/rest/schemas/admin-custom-field-proposals.d.ts.map +1 -0
  85. package/dist/interfaces/rest/schemas/admin-custom-field-proposals.js +26 -0
  86. package/dist/interfaces/rest/schemas/admin-entity-field-definitions.d.ts +592 -0
  87. package/dist/interfaces/rest/schemas/admin-entity-field-definitions.d.ts.map +1 -0
  88. package/dist/interfaces/rest/schemas/admin-entity-field-definitions.js +109 -0
  89. package/dist/interfaces/rest/schemas/carts.d.ts +7 -0
  90. package/dist/interfaces/rest/schemas/carts.d.ts.map +1 -1
  91. package/dist/interfaces/rest/schemas/catalog.d.ts +1364 -401
  92. package/dist/interfaces/rest/schemas/catalog.d.ts.map +1 -1
  93. package/dist/interfaces/rest/schemas/catalog.js +86 -0
  94. package/dist/interfaces/rest/schemas/customer-portal.d.ts +35 -0
  95. package/dist/interfaces/rest/schemas/customer-portal.d.ts.map +1 -1
  96. package/dist/interfaces/rest/schemas/orders.d.ts +204 -0
  97. package/dist/interfaces/rest/schemas/orders.d.ts.map +1 -1
  98. package/dist/interfaces/rest/schemas/pricing.d.ts +1 -0
  99. package/dist/interfaces/rest/schemas/pricing.d.ts.map +1 -1
  100. package/dist/interfaces/rest/schemas/responses.d.ts +71 -0
  101. package/dist/interfaces/rest/schemas/responses.d.ts.map +1 -1
  102. package/dist/interfaces/rest/schemas/search.d.ts +1 -0
  103. package/dist/interfaces/rest/schemas/search.d.ts.map +1 -1
  104. package/dist/interfaces/rest/schemas/search.js +1 -0
  105. package/dist/interfaces/rest/utils.d.ts +15 -0
  106. package/dist/interfaces/rest/utils.d.ts.map +1 -1
  107. package/dist/interfaces/rest/utils.js +45 -2
  108. package/dist/kernel/compensation/executor.js +2 -2
  109. package/dist/kernel/database/tx-context.d.ts +8 -0
  110. package/dist/kernel/database/tx-context.d.ts.map +1 -1
  111. package/dist/kernel/database/tx-context.js +13 -0
  112. package/dist/kernel/hooks/create-context.d.ts +2 -0
  113. package/dist/kernel/hooks/create-context.d.ts.map +1 -1
  114. package/dist/kernel/hooks/create-context.js +1 -0
  115. package/dist/kernel/hooks/types.d.ts +2 -0
  116. package/dist/kernel/hooks/types.d.ts.map +1 -1
  117. package/dist/kernel/plugin/manifest.d.ts.map +1 -1
  118. package/dist/kernel/plugin/manifest.js +9 -5
  119. package/dist/modules/analytics/service.js +2 -2
  120. package/dist/modules/audit/service.js +3 -3
  121. package/dist/modules/cart/repository/index.d.ts +13 -7
  122. package/dist/modules/cart/repository/index.d.ts.map +1 -1
  123. package/dist/modules/cart/repository/index.js +16 -10
  124. package/dist/modules/cart/schema.d.ts +17 -0
  125. package/dist/modules/cart/schema.d.ts.map +1 -1
  126. package/dist/modules/cart/schema.js +4 -0
  127. package/dist/modules/cart/service.d.ts +22 -9
  128. package/dist/modules/cart/service.d.ts.map +1 -1
  129. package/dist/modules/cart/service.js +57 -33
  130. package/dist/modules/catalog/brand-service.js +7 -7
  131. package/dist/modules/catalog/category-service.js +7 -7
  132. package/dist/modules/catalog/entity-service.d.ts +19 -10
  133. package/dist/modules/catalog/entity-service.d.ts.map +1 -1
  134. package/dist/modules/catalog/entity-service.js +180 -51
  135. package/dist/modules/catalog/module.d.ts +6 -1
  136. package/dist/modules/catalog/module.d.ts.map +1 -1
  137. package/dist/modules/catalog/module.js +6 -1
  138. package/dist/modules/catalog/ownership.d.ts +5 -0
  139. package/dist/modules/catalog/ownership.d.ts.map +1 -0
  140. package/dist/modules/catalog/ownership.js +11 -0
  141. package/dist/modules/catalog/read-policy.d.ts +9 -0
  142. package/dist/modules/catalog/read-policy.d.ts.map +1 -0
  143. package/dist/modules/catalog/read-policy.js +8 -0
  144. package/dist/modules/catalog/repository/index.d.ts +55 -3
  145. package/dist/modules/catalog/repository/index.d.ts.map +1 -1
  146. package/dist/modules/catalog/repository/index.js +335 -6
  147. package/dist/modules/catalog/revision.d.ts +4 -0
  148. package/dist/modules/catalog/revision.d.ts.map +1 -0
  149. package/dist/modules/catalog/revision.js +33 -0
  150. package/dist/modules/catalog/schema.d.ts +979 -110
  151. package/dist/modules/catalog/schema.d.ts.map +1 -1
  152. package/dist/modules/catalog/schema.js +112 -2
  153. package/dist/modules/catalog/schemas.d.ts +2 -0
  154. package/dist/modules/catalog/schemas.d.ts.map +1 -1
  155. package/dist/modules/catalog/schemas.js +2 -0
  156. package/dist/modules/catalog/service.d.ts +80 -15
  157. package/dist/modules/catalog/service.d.ts.map +1 -1
  158. package/dist/modules/catalog/service.js +522 -14
  159. package/dist/modules/channels/adapter.d.ts +85 -0
  160. package/dist/modules/channels/adapter.d.ts.map +1 -1
  161. package/dist/modules/channels/adapter.js +9 -1
  162. package/dist/modules/customers/module.d.ts.map +1 -1
  163. package/dist/modules/customers/module.js +1 -0
  164. package/dist/modules/customers/service.d.ts +2 -0
  165. package/dist/modules/customers/service.d.ts.map +1 -1
  166. package/dist/modules/customers/service.js +21 -20
  167. package/dist/modules/documents/module.d.ts.map +1 -1
  168. package/dist/modules/documents/module.js +1 -0
  169. package/dist/modules/documents/service.d.ts +18 -4
  170. package/dist/modules/documents/service.d.ts.map +1 -1
  171. package/dist/modules/documents/service.js +54 -16
  172. package/dist/modules/fulfillment/module.d.ts.map +1 -1
  173. package/dist/modules/fulfillment/module.js +1 -0
  174. package/dist/modules/fulfillment/service.d.ts +2 -0
  175. package/dist/modules/fulfillment/service.d.ts.map +1 -1
  176. package/dist/modules/fulfillment/service.js +15 -6
  177. package/dist/modules/inventory/service.d.ts.map +1 -1
  178. package/dist/modules/inventory/service.js +15 -14
  179. package/dist/modules/media/module.d.ts +68 -0
  180. package/dist/modules/media/module.d.ts.map +1 -1
  181. package/dist/modules/media/module.js +2 -0
  182. package/dist/modules/media/schema.d.ts +70 -0
  183. package/dist/modules/media/schema.d.ts.map +1 -1
  184. package/dist/modules/media/schema.js +20 -2
  185. package/dist/modules/media/service.d.ts +8 -1
  186. package/dist/modules/media/service.d.ts.map +1 -1
  187. package/dist/modules/media/service.js +71 -23
  188. package/dist/modules/orders/guest-access.d.ts +27 -0
  189. package/dist/modules/orders/guest-access.d.ts.map +1 -0
  190. package/dist/modules/orders/guest-access.js +46 -0
  191. package/dist/modules/orders/module.d.ts.map +1 -1
  192. package/dist/modules/orders/module.js +1 -0
  193. package/dist/modules/orders/quote.d.ts.map +1 -1
  194. package/dist/modules/orders/quote.js +1 -0
  195. package/dist/modules/orders/repository/index.d.ts +1 -1
  196. package/dist/modules/orders/repository/index.d.ts.map +1 -1
  197. package/dist/modules/orders/repository/index.js +2 -2
  198. package/dist/modules/orders/schema.d.ts +17 -0
  199. package/dist/modules/orders/schema.d.ts.map +1 -1
  200. package/dist/modules/orders/schema.js +5 -3
  201. package/dist/modules/orders/service.d.ts +16 -7
  202. package/dist/modules/orders/service.d.ts.map +1 -1
  203. package/dist/modules/orders/service.js +184 -55
  204. package/dist/modules/pricing/module.d.ts.map +1 -1
  205. package/dist/modules/pricing/module.js +1 -0
  206. package/dist/modules/pricing/schema.d.ts +17 -0
  207. package/dist/modules/pricing/schema.d.ts.map +1 -1
  208. package/dist/modules/pricing/schema.js +1 -0
  209. package/dist/modules/pricing/schemas.d.ts +1 -0
  210. package/dist/modules/pricing/schemas.d.ts.map +1 -1
  211. package/dist/modules/pricing/schemas.js +1 -0
  212. package/dist/modules/pricing/service.d.ts +2 -0
  213. package/dist/modules/pricing/service.d.ts.map +1 -1
  214. package/dist/modules/pricing/service.js +18 -12
  215. package/dist/modules/promotions/module.d.ts.map +1 -1
  216. package/dist/modules/promotions/module.js +1 -0
  217. package/dist/modules/promotions/service.d.ts +3 -0
  218. package/dist/modules/promotions/service.d.ts.map +1 -1
  219. package/dist/modules/promotions/service.js +19 -11
  220. package/dist/modules/search/adapter.d.ts +8 -0
  221. package/dist/modules/search/adapter.d.ts.map +1 -1
  222. package/dist/modules/search/module.d.ts.map +1 -1
  223. package/dist/modules/search/module.js +3 -0
  224. package/dist/modules/search/service.d.ts +5 -0
  225. package/dist/modules/search/service.d.ts.map +1 -1
  226. package/dist/modules/search/service.js +131 -11
  227. package/dist/modules/settings/module.d.ts.map +1 -1
  228. package/dist/modules/settings/module.js +1 -0
  229. package/dist/modules/settings/service.d.ts +3 -0
  230. package/dist/modules/settings/service.d.ts.map +1 -1
  231. package/dist/modules/settings/service.js +6 -4
  232. package/dist/modules/shipping/service.js +9 -9
  233. package/dist/modules/tax/module.d.ts.map +1 -1
  234. package/dist/modules/tax/module.js +1 -0
  235. package/dist/modules/tax/service.d.ts +3 -0
  236. package/dist/modules/tax/service.d.ts.map +1 -1
  237. package/dist/modules/tax/service.js +11 -9
  238. package/dist/modules/webhooks/hook.js +2 -2
  239. package/dist/modules/webhooks/module.d.ts.map +1 -1
  240. package/dist/modules/webhooks/module.js +1 -0
  241. package/dist/modules/webhooks/service.d.ts +2 -0
  242. package/dist/modules/webhooks/service.d.ts.map +1 -1
  243. package/dist/modules/webhooks/service.js +4 -4
  244. package/dist/runtime/kernel-modules.d.ts +73 -0
  245. package/dist/runtime/kernel-modules.d.ts.map +1 -1
  246. package/dist/runtime/server.d.ts.map +1 -1
  247. package/dist/runtime/server.js +10 -2
  248. package/dist/test-utils/create-pglite-adapter.d.ts.map +1 -1
  249. package/dist/test-utils/create-pglite-adapter.js +35 -13
  250. package/dist/test-utils/create-test-config.d.ts.map +1 -1
  251. package/dist/test-utils/create-test-config.js +4 -0
  252. package/dist/test-utils/rest-api-test-utils.d.ts.map +1 -1
  253. package/dist/test-utils/rest-api-test-utils.js +2 -0
  254. package/dist/test-utils/test-actors.js +2 -2
  255. package/dist/utils/id.d.ts +2 -0
  256. package/dist/utils/id.d.ts.map +1 -1
  257. package/dist/utils/id.js +11 -0
  258. package/package.json +6 -5
  259. package/src/auth/auth-schema-guard.ts +143 -0
  260. package/src/auth/auth-schema.ts +50 -19
  261. package/src/auth/middleware.ts +17 -5
  262. package/src/auth/org.ts +15 -3
  263. package/src/auth/organization-guard.ts +158 -0
  264. package/src/auth/permissions.ts +31 -8
  265. package/src/auth/role-authority.ts +107 -0
  266. package/src/auth/setup.ts +17 -0
  267. package/src/auth/strict-org-resolution.ts +7 -1
  268. package/src/auth/types.ts +1 -1
  269. package/src/config/defaults.ts +2 -0
  270. package/src/config/types.ts +32 -4
  271. package/src/hooks/checkout.ts +19 -12
  272. package/src/index.ts +30 -6
  273. package/src/interfaces/rest/audit-middleware.ts +2 -0
  274. package/src/interfaces/rest/customer-portal.ts +31 -24
  275. package/src/interfaces/rest/index.ts +4 -0
  276. package/src/interfaces/rest/route-coverage.ts +103 -0
  277. package/src/interfaces/rest/router.ts +16 -10
  278. package/src/interfaces/rest/routes/admin/compensation-failures.ts +8 -5
  279. package/src/interfaces/rest/routes/admin/custom-field-proposals.ts +37 -0
  280. package/src/interfaces/rest/routes/admin/entity-field-definitions.ts +89 -0
  281. package/src/interfaces/rest/routes/admin/permissions.ts +3 -1
  282. package/src/interfaces/rest/routes/admin/staff.ts +161 -72
  283. package/src/interfaces/rest/routes/admin-jobs.ts +3 -3
  284. package/src/interfaces/rest/routes/audit.ts +3 -3
  285. package/src/interfaces/rest/routes/carts.ts +17 -7
  286. package/src/interfaces/rest/routes/catalog.ts +96 -0
  287. package/src/interfaces/rest/routes/checkout.ts +41 -38
  288. package/src/interfaces/rest/routes/documents.ts +15 -1
  289. package/src/interfaces/rest/routes/inventory.ts +2 -0
  290. package/src/interfaces/rest/routes/media.ts +8 -3
  291. package/src/interfaces/rest/routes/orders.ts +27 -8
  292. package/src/interfaces/rest/routes/pricing.ts +2 -2
  293. package/src/interfaces/rest/routes/promotions.ts +12 -9
  294. package/src/interfaces/rest/routes/search.ts +19 -1
  295. package/src/interfaces/rest/schemas/admin-custom-field-proposals.ts +29 -0
  296. package/src/interfaces/rest/schemas/admin-entity-field-definitions.ts +120 -0
  297. package/src/interfaces/rest/schemas/catalog.ts +92 -0
  298. package/src/interfaces/rest/schemas/search.ts +2 -0
  299. package/src/interfaces/rest/utils.ts +61 -2
  300. package/src/kernel/compensation/executor.ts +2 -2
  301. package/src/kernel/database/tx-context.ts +25 -0
  302. package/src/kernel/hooks/create-context.ts +3 -0
  303. package/src/kernel/hooks/types.ts +2 -0
  304. package/src/kernel/plugin/manifest.ts +9 -5
  305. package/src/modules/analytics/service.ts +2 -2
  306. package/src/modules/audit/service.ts +3 -3
  307. package/src/modules/cart/repository/index.ts +22 -8
  308. package/src/modules/cart/schema.ts +4 -0
  309. package/src/modules/cart/service.ts +62 -27
  310. package/src/modules/catalog/brand-service.ts +7 -7
  311. package/src/modules/catalog/category-service.ts +7 -7
  312. package/src/modules/catalog/entity-service.ts +188 -53
  313. package/src/modules/catalog/module.ts +15 -0
  314. package/src/modules/catalog/ownership.ts +17 -0
  315. package/src/modules/catalog/read-policy.ts +16 -0
  316. package/src/modules/catalog/repository/index.ts +566 -4
  317. package/src/modules/catalog/revision.ts +35 -0
  318. package/src/modules/catalog/schema.ts +169 -1
  319. package/src/modules/catalog/schemas.ts +2 -0
  320. package/src/modules/catalog/service.ts +766 -26
  321. package/src/modules/channels/adapter.ts +107 -1
  322. package/src/modules/customers/module.ts +2 -0
  323. package/src/modules/customers/service.ts +23 -22
  324. package/src/modules/documents/module.ts +2 -0
  325. package/src/modules/documents/service.ts +74 -11
  326. package/src/modules/fulfillment/module.ts +2 -0
  327. package/src/modules/fulfillment/service.ts +17 -6
  328. package/src/modules/inventory/service.ts +15 -24
  329. package/src/modules/media/module.ts +2 -0
  330. package/src/modules/media/schema.ts +23 -2
  331. package/src/modules/media/service.ts +89 -28
  332. package/src/modules/orders/guest-access.ts +55 -0
  333. package/src/modules/orders/module.ts +1 -0
  334. package/src/modules/orders/quote.ts +1 -0
  335. package/src/modules/orders/repository/index.ts +2 -0
  336. package/src/modules/orders/schema.ts +5 -3
  337. package/src/modules/orders/service.ts +302 -52
  338. package/src/modules/pricing/module.ts +2 -0
  339. package/src/modules/pricing/schema.ts +1 -0
  340. package/src/modules/pricing/schemas.ts +1 -0
  341. package/src/modules/pricing/service.ts +21 -18
  342. package/src/modules/promotions/module.ts +2 -0
  343. package/src/modules/promotions/service.ts +25 -16
  344. package/src/modules/search/adapter.ts +8 -0
  345. package/src/modules/search/module.ts +3 -0
  346. package/src/modules/search/service.ts +142 -12
  347. package/src/modules/settings/module.ts +2 -0
  348. package/src/modules/settings/service.ts +8 -4
  349. package/src/modules/shipping/service.ts +9 -9
  350. package/src/modules/tax/module.ts +1 -0
  351. package/src/modules/tax/service.ts +13 -9
  352. package/src/modules/webhooks/hook.ts +2 -2
  353. package/src/modules/webhooks/module.ts +2 -0
  354. package/src/modules/webhooks/service.ts +6 -4
  355. package/src/runtime/server.ts +16 -2
  356. package/src/test-utils/create-pglite-adapter.ts +34 -12
  357. package/src/test-utils/create-test-config.ts +10 -6
  358. package/src/test-utils/rest-api-test-utils.ts +2 -0
  359. package/src/test-utils/test-actors.ts +2 -2
  360. package/src/utils/id.ts +20 -0
@@ -0,0 +1,2444 @@
1
+ /**
2
+ * Compares Porulle's Drizzle auth tables against better-auth's canonical
3
+ * {@link getAuthTables} output so a dependency minor bump cannot add a column
4
+ * the declared schema omits.
5
+ */
6
+ import type { BetterAuthOptions } from "better-auth";
7
+ /**
8
+ * Every plugin {@link createAuth} can enable, not only the ones it enables by
9
+ * default. The shipped schema has to satisfy any configuration a merchant
10
+ * chooses, so the guard compares against the maximal table set: a column that
11
+ * only `twoFactor` needs is still a column this package must declare.
12
+ */
13
+ export declare const AUTH_SCHEMA_GUARD_OPTIONS: {
14
+ plugins: [import("better-auth/plugins").DefaultOrganizationPlugin<{
15
+ roles: {};
16
+ }>, {
17
+ id: "bearer";
18
+ version: string;
19
+ hooks: {
20
+ before: {
21
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
22
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
23
+ context: {
24
+ headers: Headers;
25
+ };
26
+ } | undefined>>;
27
+ }[];
28
+ after: {
29
+ matcher(context: import("better-auth").HookEndpointContext): true;
30
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
31
+ }[];
32
+ };
33
+ options: import("better-auth/plugins").BearerOptions | undefined;
34
+ }, {
35
+ id: "jwt";
36
+ version: string;
37
+ options: NoInfer<import("better-auth/plugins").JwtOptions>;
38
+ init(ctx: import("better-auth").AuthContext): {
39
+ context: {
40
+ sessionConfig: {
41
+ cookieCacheSigner: import("better-auth").CookieCacheSigner;
42
+ updateAge: number;
43
+ expiresIn: number;
44
+ freshAge: number;
45
+ cookieRefreshCache: false | {
46
+ enabled: true;
47
+ updateAge: number;
48
+ };
49
+ };
50
+ };
51
+ } | undefined;
52
+ endpoints: {
53
+ getJwks: import("better-auth").StrictEndpoint<string, {
54
+ method: "GET";
55
+ metadata: {
56
+ openapi: {
57
+ operationId: string;
58
+ description: string;
59
+ responses: {
60
+ "200": {
61
+ description: string;
62
+ content: {
63
+ "application/json": {
64
+ schema: {
65
+ type: "object";
66
+ properties: {
67
+ keys: {
68
+ type: string;
69
+ description: string;
70
+ items: {
71
+ type: string;
72
+ properties: {
73
+ kid: {
74
+ type: string;
75
+ description: string;
76
+ };
77
+ kty: {
78
+ type: string;
79
+ description: string;
80
+ };
81
+ alg: {
82
+ type: string;
83
+ description: string;
84
+ };
85
+ use: {
86
+ type: string;
87
+ description: string;
88
+ enum: string[];
89
+ nullable: boolean;
90
+ };
91
+ n: {
92
+ type: string;
93
+ description: string;
94
+ nullable: boolean;
95
+ };
96
+ e: {
97
+ type: string;
98
+ description: string;
99
+ nullable: boolean;
100
+ };
101
+ crv: {
102
+ type: string;
103
+ description: string;
104
+ nullable: boolean;
105
+ };
106
+ x: {
107
+ type: string;
108
+ description: string;
109
+ nullable: boolean;
110
+ };
111
+ y: {
112
+ type: string;
113
+ description: string;
114
+ nullable: boolean;
115
+ };
116
+ };
117
+ required: string[];
118
+ };
119
+ };
120
+ };
121
+ required: string[];
122
+ };
123
+ };
124
+ };
125
+ };
126
+ };
127
+ };
128
+ };
129
+ }, import("better-auth").JSONWebKeySet>;
130
+ getToken: import("better-auth").StrictEndpoint<"/token", {
131
+ method: "GET";
132
+ requireHeaders: true;
133
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
134
+ session: {
135
+ session: Record<string, any> & {
136
+ id: string;
137
+ createdAt: Date;
138
+ updatedAt: Date;
139
+ userId: string;
140
+ expiresAt: Date;
141
+ token: string;
142
+ ipAddress?: string | null | undefined;
143
+ userAgent?: string | null | undefined;
144
+ };
145
+ user: Record<string, any> & {
146
+ id: string;
147
+ createdAt: Date;
148
+ updatedAt: Date;
149
+ email: string;
150
+ emailVerified: boolean;
151
+ name: string;
152
+ image?: string | null | undefined;
153
+ };
154
+ };
155
+ }>>[];
156
+ metadata: {
157
+ openapi: {
158
+ operationId: string;
159
+ description: string;
160
+ responses: {
161
+ 200: {
162
+ description: string;
163
+ content: {
164
+ "application/json": {
165
+ schema: {
166
+ type: "object";
167
+ properties: {
168
+ token: {
169
+ type: string;
170
+ };
171
+ };
172
+ };
173
+ };
174
+ };
175
+ };
176
+ };
177
+ };
178
+ };
179
+ }, {
180
+ token: string;
181
+ }>;
182
+ signJWT: import("better-auth").StrictEndpoint<string, {
183
+ method: "POST";
184
+ metadata: {
185
+ $Infer: {
186
+ body: {
187
+ payload: import("better-auth").JWTPayload;
188
+ overrideOptions?: import("better-auth/plugins").JwtOptions | undefined;
189
+ };
190
+ };
191
+ };
192
+ body: import("better-auth").ZodObject<{
193
+ payload: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>;
194
+ overrideOptions: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
195
+ }, import("zod/v4/core").$strip>;
196
+ }, {
197
+ token: string;
198
+ }>;
199
+ verifyJWT: import("better-auth").StrictEndpoint<string, {
200
+ method: "POST";
201
+ metadata: {
202
+ $Infer: {
203
+ body: {
204
+ token: string;
205
+ issuer?: string;
206
+ };
207
+ response: {
208
+ payload: {
209
+ sub: string;
210
+ aud: string;
211
+ [key: string]: any;
212
+ } | null;
213
+ };
214
+ };
215
+ };
216
+ body: import("better-auth").ZodObject<{
217
+ token: import("better-auth").ZodString;
218
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
219
+ }, import("zod/v4/core").$strip>;
220
+ }, {
221
+ payload: (import("better-auth").JWTPayload & Required<Pick<import("better-auth").JWTPayload, "sub" | "aud">>) | null;
222
+ }>;
223
+ };
224
+ hooks: {
225
+ after: {
226
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
227
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
228
+ }[];
229
+ };
230
+ schema: {
231
+ jwks: {
232
+ fields: {
233
+ publicKey: {
234
+ type: "string";
235
+ required: true;
236
+ };
237
+ privateKey: {
238
+ type: "string";
239
+ required: true;
240
+ };
241
+ createdAt: {
242
+ type: "date";
243
+ required: true;
244
+ };
245
+ expiresAt: {
246
+ type: "date";
247
+ required: false;
248
+ };
249
+ alg: {
250
+ type: "string";
251
+ required: false;
252
+ };
253
+ crv: {
254
+ type: "string";
255
+ required: false;
256
+ };
257
+ };
258
+ };
259
+ };
260
+ }, {
261
+ id: "two-factor";
262
+ version: string;
263
+ endpoints: {
264
+ enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
265
+ method: "POST";
266
+ body: import("better-auth").ZodObject<{
267
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
268
+ method: import("better-auth").ZodDefault<import("better-auth").ZodEnum<{
269
+ otp: "otp";
270
+ totp: "totp";
271
+ }>>;
272
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
273
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
274
+ password: import("better-auth").ZodString;
275
+ method: import("better-auth").ZodDefault<import("better-auth").ZodEnum<{
276
+ otp: "otp";
277
+ totp: "totp";
278
+ }>>;
279
+ issuer: import("better-auth").ZodOptional<import("better-auth").ZodString>;
280
+ }, import("zod/v4/core").$strip>;
281
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
282
+ session: {
283
+ session: Record<string, any> & {
284
+ id: string;
285
+ createdAt: Date;
286
+ updatedAt: Date;
287
+ userId: string;
288
+ expiresAt: Date;
289
+ token: string;
290
+ ipAddress?: string | null | undefined;
291
+ userAgent?: string | null | undefined;
292
+ };
293
+ user: Record<string, any> & {
294
+ id: string;
295
+ createdAt: Date;
296
+ updatedAt: Date;
297
+ email: string;
298
+ emailVerified: boolean;
299
+ name: string;
300
+ image?: string | null | undefined;
301
+ };
302
+ };
303
+ }>>[];
304
+ metadata: {
305
+ openapi: {
306
+ summary: string;
307
+ description: string;
308
+ responses: {
309
+ 200: {
310
+ description: string;
311
+ content: {
312
+ "application/json": {
313
+ schema: {
314
+ type: "object";
315
+ properties: {
316
+ method: {
317
+ type: string;
318
+ enum: string[];
319
+ description: string;
320
+ };
321
+ totpURI: {
322
+ type: string;
323
+ description: string;
324
+ };
325
+ backupCodes: {
326
+ type: string;
327
+ items: {
328
+ type: string;
329
+ };
330
+ description: string;
331
+ };
332
+ };
333
+ required: string[];
334
+ };
335
+ };
336
+ };
337
+ };
338
+ };
339
+ };
340
+ };
341
+ }, {
342
+ method: "otp";
343
+ } | {
344
+ method: "totp";
345
+ totpURI: string;
346
+ backupCodes: string[];
347
+ }>;
348
+ disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
349
+ method: "POST";
350
+ body: import("better-auth").ZodObject<{
351
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
352
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
353
+ password: import("better-auth").ZodString;
354
+ }, import("zod/v4/core").$strip>;
355
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
356
+ session: {
357
+ session: Record<string, any> & {
358
+ id: string;
359
+ createdAt: Date;
360
+ updatedAt: Date;
361
+ userId: string;
362
+ expiresAt: Date;
363
+ token: string;
364
+ ipAddress?: string | null | undefined;
365
+ userAgent?: string | null | undefined;
366
+ };
367
+ user: Record<string, any> & {
368
+ id: string;
369
+ createdAt: Date;
370
+ updatedAt: Date;
371
+ email: string;
372
+ emailVerified: boolean;
373
+ name: string;
374
+ image?: string | null | undefined;
375
+ };
376
+ };
377
+ }>>[];
378
+ metadata: {
379
+ openapi: {
380
+ summary: string;
381
+ description: string;
382
+ responses: {
383
+ 200: {
384
+ description: string;
385
+ content: {
386
+ "application/json": {
387
+ schema: {
388
+ type: "object";
389
+ properties: {
390
+ status: {
391
+ type: string;
392
+ };
393
+ };
394
+ };
395
+ };
396
+ };
397
+ };
398
+ };
399
+ };
400
+ };
401
+ }, {
402
+ status: boolean;
403
+ }>;
404
+ verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
405
+ method: "POST";
406
+ body: import("better-auth").ZodObject<{
407
+ code: import("better-auth").ZodString;
408
+ disableSession: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
409
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
410
+ }, import("zod/v4/core").$strip>;
411
+ metadata: {
412
+ openapi: {
413
+ description: string;
414
+ responses: {
415
+ "200": {
416
+ description: string;
417
+ content: {
418
+ "application/json": {
419
+ schema: {
420
+ type: "object";
421
+ properties: {
422
+ user: {
423
+ type: string;
424
+ properties: {
425
+ id: {
426
+ type: string;
427
+ description: string;
428
+ };
429
+ email: {
430
+ type: string;
431
+ format: string;
432
+ nullable: boolean;
433
+ description: string;
434
+ };
435
+ emailVerified: {
436
+ type: string;
437
+ nullable: boolean;
438
+ description: string;
439
+ };
440
+ name: {
441
+ type: string;
442
+ nullable: boolean;
443
+ description: string;
444
+ };
445
+ image: {
446
+ type: string;
447
+ format: string;
448
+ nullable: boolean;
449
+ description: string;
450
+ };
451
+ twoFactorEnabled: {
452
+ type: string;
453
+ description: string;
454
+ };
455
+ createdAt: {
456
+ type: string;
457
+ format: string;
458
+ description: string;
459
+ };
460
+ updatedAt: {
461
+ type: string;
462
+ format: string;
463
+ description: string;
464
+ };
465
+ };
466
+ required: string[];
467
+ description: string;
468
+ };
469
+ session: {
470
+ type: string;
471
+ properties: {
472
+ token: {
473
+ type: string;
474
+ description: string;
475
+ };
476
+ userId: {
477
+ type: string;
478
+ description: string;
479
+ };
480
+ createdAt: {
481
+ type: string;
482
+ format: string;
483
+ description: string;
484
+ };
485
+ expiresAt: {
486
+ type: string;
487
+ format: string;
488
+ description: string;
489
+ };
490
+ };
491
+ required: string[];
492
+ description: string;
493
+ };
494
+ };
495
+ required: string[];
496
+ };
497
+ };
498
+ };
499
+ };
500
+ };
501
+ };
502
+ };
503
+ }, {
504
+ token: string | undefined;
505
+ user: (Record<string, any> & {
506
+ id: string;
507
+ createdAt: Date;
508
+ updatedAt: Date;
509
+ email: string;
510
+ emailVerified: boolean;
511
+ name: string;
512
+ image?: string | null | undefined;
513
+ }) | import("better-auth/plugins").UserWithTwoFactor;
514
+ }>;
515
+ generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
516
+ method: "POST";
517
+ body: import("better-auth").ZodObject<{
518
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
519
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
520
+ password: import("better-auth").ZodString;
521
+ }, import("zod/v4/core").$strip>;
522
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
523
+ session: {
524
+ session: Record<string, any> & {
525
+ id: string;
526
+ createdAt: Date;
527
+ updatedAt: Date;
528
+ userId: string;
529
+ expiresAt: Date;
530
+ token: string;
531
+ ipAddress?: string | null | undefined;
532
+ userAgent?: string | null | undefined;
533
+ };
534
+ user: Record<string, any> & {
535
+ id: string;
536
+ createdAt: Date;
537
+ updatedAt: Date;
538
+ email: string;
539
+ emailVerified: boolean;
540
+ name: string;
541
+ image?: string | null | undefined;
542
+ };
543
+ };
544
+ }>>[];
545
+ metadata: {
546
+ openapi: {
547
+ description: string;
548
+ responses: {
549
+ "200": {
550
+ description: string;
551
+ content: {
552
+ "application/json": {
553
+ schema: {
554
+ type: "object";
555
+ properties: {
556
+ status: {
557
+ type: string;
558
+ description: string;
559
+ enum: boolean[];
560
+ };
561
+ backupCodes: {
562
+ type: string;
563
+ items: {
564
+ type: string;
565
+ };
566
+ description: string;
567
+ };
568
+ };
569
+ required: string[];
570
+ };
571
+ };
572
+ };
573
+ };
574
+ };
575
+ };
576
+ };
577
+ }, {
578
+ status: boolean;
579
+ backupCodes: string[];
580
+ }>;
581
+ viewBackupCodes: import("better-auth").StrictEndpoint<string, {
582
+ method: "POST";
583
+ body: import("better-auth").ZodObject<{
584
+ userId: import("better-auth").ZodCoercedString<unknown>;
585
+ }, import("zod/v4/core").$strip>;
586
+ }, {
587
+ status: boolean;
588
+ backupCodes: string[];
589
+ }>;
590
+ sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
591
+ method: "POST";
592
+ body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
593
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
594
+ }, import("zod/v4/core").$strip>>;
595
+ metadata: {
596
+ openapi: {
597
+ summary: string;
598
+ description: string;
599
+ responses: {
600
+ 200: {
601
+ description: string;
602
+ content: {
603
+ "application/json": {
604
+ schema: {
605
+ type: "object";
606
+ properties: {
607
+ status: {
608
+ type: string;
609
+ };
610
+ };
611
+ };
612
+ };
613
+ };
614
+ };
615
+ };
616
+ };
617
+ };
618
+ }, {
619
+ status: boolean;
620
+ }>;
621
+ verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
622
+ method: "POST";
623
+ body: import("better-auth").ZodObject<{
624
+ code: import("better-auth").ZodString;
625
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
626
+ }, import("zod/v4/core").$strip>;
627
+ metadata: {
628
+ openapi: {
629
+ summary: string;
630
+ description: string;
631
+ responses: {
632
+ "200": {
633
+ description: string;
634
+ content: {
635
+ "application/json": {
636
+ schema: {
637
+ type: "object";
638
+ properties: {
639
+ token: {
640
+ type: string;
641
+ description: string;
642
+ };
643
+ user: {
644
+ type: string;
645
+ properties: {
646
+ id: {
647
+ type: string;
648
+ description: string;
649
+ };
650
+ email: {
651
+ type: string;
652
+ format: string;
653
+ nullable: boolean;
654
+ description: string;
655
+ };
656
+ emailVerified: {
657
+ type: string;
658
+ nullable: boolean;
659
+ description: string;
660
+ };
661
+ name: {
662
+ type: string;
663
+ nullable: boolean;
664
+ description: string;
665
+ };
666
+ image: {
667
+ type: string;
668
+ format: string;
669
+ nullable: boolean;
670
+ description: string;
671
+ };
672
+ createdAt: {
673
+ type: string;
674
+ format: string;
675
+ description: string;
676
+ };
677
+ updatedAt: {
678
+ type: string;
679
+ format: string;
680
+ description: string;
681
+ };
682
+ };
683
+ required: string[];
684
+ description: string;
685
+ };
686
+ };
687
+ required: string[];
688
+ };
689
+ };
690
+ };
691
+ };
692
+ };
693
+ };
694
+ };
695
+ }, {
696
+ token: string;
697
+ user: import("better-auth/plugins").UserWithTwoFactor;
698
+ } | {
699
+ token: string;
700
+ user: Record<string, any> & {
701
+ id: string;
702
+ createdAt: Date;
703
+ updatedAt: Date;
704
+ email: string;
705
+ emailVerified: boolean;
706
+ name: string;
707
+ image?: string | null | undefined;
708
+ };
709
+ }>;
710
+ generateTOTP: import("better-auth").StrictEndpoint<string, {
711
+ method: "POST";
712
+ body: import("better-auth").ZodObject<{
713
+ secret: import("better-auth").ZodString;
714
+ }, import("zod/v4/core").$strip>;
715
+ metadata: {
716
+ openapi: {
717
+ summary: string;
718
+ description: string;
719
+ responses: {
720
+ 200: {
721
+ description: string;
722
+ content: {
723
+ "application/json": {
724
+ schema: {
725
+ type: "object";
726
+ properties: {
727
+ code: {
728
+ type: string;
729
+ };
730
+ };
731
+ };
732
+ };
733
+ };
734
+ };
735
+ };
736
+ };
737
+ };
738
+ }, {
739
+ code: string;
740
+ }>;
741
+ getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
742
+ method: "POST";
743
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
744
+ session: {
745
+ session: Record<string, any> & {
746
+ id: string;
747
+ createdAt: Date;
748
+ updatedAt: Date;
749
+ userId: string;
750
+ expiresAt: Date;
751
+ token: string;
752
+ ipAddress?: string | null | undefined;
753
+ userAgent?: string | null | undefined;
754
+ };
755
+ user: Record<string, any> & {
756
+ id: string;
757
+ createdAt: Date;
758
+ updatedAt: Date;
759
+ email: string;
760
+ emailVerified: boolean;
761
+ name: string;
762
+ image?: string | null | undefined;
763
+ };
764
+ };
765
+ }>>[];
766
+ body: import("better-auth").ZodObject<{
767
+ password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
768
+ }, import("zod/v4/core").$strip> | import("better-auth").ZodObject<{
769
+ password: import("better-auth").ZodString;
770
+ }, import("zod/v4/core").$strip>;
771
+ metadata: {
772
+ openapi: {
773
+ summary: string;
774
+ description: string;
775
+ responses: {
776
+ 200: {
777
+ description: string;
778
+ content: {
779
+ "application/json": {
780
+ schema: {
781
+ type: "object";
782
+ properties: {
783
+ totpURI: {
784
+ type: string;
785
+ };
786
+ };
787
+ };
788
+ };
789
+ };
790
+ };
791
+ };
792
+ };
793
+ };
794
+ }, {
795
+ totpURI: string;
796
+ }>;
797
+ verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
798
+ method: "POST";
799
+ body: import("better-auth").ZodObject<{
800
+ code: import("better-auth").ZodString;
801
+ trustDevice: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
802
+ }, import("zod/v4/core").$strip>;
803
+ metadata: {
804
+ openapi: {
805
+ summary: string;
806
+ description: string;
807
+ responses: {
808
+ 200: {
809
+ description: string;
810
+ content: {
811
+ "application/json": {
812
+ schema: {
813
+ type: "object";
814
+ properties: {
815
+ status: {
816
+ type: string;
817
+ };
818
+ };
819
+ };
820
+ };
821
+ };
822
+ };
823
+ };
824
+ };
825
+ };
826
+ }, {
827
+ token: string;
828
+ user: import("better-auth/plugins").UserWithTwoFactor;
829
+ } | {
830
+ token: string;
831
+ user: Record<string, any> & {
832
+ id: string;
833
+ createdAt: Date;
834
+ updatedAt: Date;
835
+ email: string;
836
+ emailVerified: boolean;
837
+ name: string;
838
+ image?: string | null | undefined;
839
+ };
840
+ }>;
841
+ };
842
+ options: NoInfer<{
843
+ issuer: string;
844
+ }>;
845
+ hooks: {
846
+ after: {
847
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
848
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
849
+ twoFactorRedirect: boolean;
850
+ twoFactorMethods: string[];
851
+ } | undefined>>;
852
+ }[];
853
+ };
854
+ schema: {
855
+ user: {
856
+ fields: {
857
+ twoFactorEnabled: {
858
+ type: "boolean";
859
+ required: false;
860
+ defaultValue: false;
861
+ input: false;
862
+ };
863
+ };
864
+ };
865
+ twoFactor: {
866
+ fields: {
867
+ secret: {
868
+ type: "string";
869
+ required: true;
870
+ returned: false;
871
+ index: true;
872
+ };
873
+ backupCodes: {
874
+ type: "string";
875
+ required: true;
876
+ returned: false;
877
+ };
878
+ userId: {
879
+ type: "string";
880
+ required: true;
881
+ returned: false;
882
+ references: {
883
+ model: string;
884
+ field: string;
885
+ };
886
+ index: true;
887
+ };
888
+ verified: {
889
+ type: "boolean";
890
+ required: false;
891
+ defaultValue: true;
892
+ input: false;
893
+ };
894
+ failedVerificationCount: {
895
+ type: "number";
896
+ required: false;
897
+ defaultValue: number;
898
+ input: false;
899
+ returned: false;
900
+ };
901
+ lockedUntil: {
902
+ type: "date";
903
+ required: false;
904
+ input: false;
905
+ returned: false;
906
+ };
907
+ };
908
+ };
909
+ };
910
+ rateLimit: {
911
+ pathMatcher(path: string): boolean;
912
+ window: number;
913
+ max: number;
914
+ }[];
915
+ $ERROR_CODES: {
916
+ OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
917
+ OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
918
+ OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
919
+ TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
920
+ TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
921
+ TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
922
+ BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
923
+ INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
924
+ INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
925
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
926
+ ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
927
+ INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
928
+ };
929
+ }, {
930
+ id: "api-key";
931
+ version: string;
932
+ $ERROR_CODES: {
933
+ INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
934
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
935
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
936
+ USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
937
+ UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
938
+ KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
939
+ KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
940
+ KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
941
+ USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
942
+ KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
943
+ EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
944
+ EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
945
+ INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
946
+ INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
947
+ INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
948
+ METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
949
+ RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
950
+ NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
951
+ KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
952
+ INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
953
+ INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
954
+ INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
955
+ INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
956
+ SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
957
+ FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
958
+ NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
959
+ ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
960
+ USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
961
+ INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
962
+ NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
963
+ ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
964
+ };
965
+ hooks: {
966
+ before: {
967
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
968
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
969
+ user: {
970
+ id: string;
971
+ createdAt: Date;
972
+ updatedAt: Date;
973
+ email: string;
974
+ emailVerified: boolean;
975
+ name: string;
976
+ image?: string | null | undefined;
977
+ };
978
+ session: {
979
+ id: string;
980
+ token: string;
981
+ userId: string;
982
+ userAgent: string | null;
983
+ ipAddress: string | null;
984
+ createdAt: Date;
985
+ updatedAt: Date;
986
+ expiresAt: Date;
987
+ };
988
+ } | {
989
+ context: import("better-auth").MiddlewareContext<import("better-auth").MiddlewareOptions, import("better-auth").PluginContext<BetterAuthOptions> & import("better-auth").InfoContext & {
990
+ options: BetterAuthOptions;
991
+ trustedOrigins: string[];
992
+ trustedProviders: string[];
993
+ isTrustedOrigin: (url: string, settings?: {
994
+ allowRelativePaths: boolean;
995
+ }) => boolean;
996
+ oauthConfig: {
997
+ skipStateCookieCheck?: boolean | undefined;
998
+ storeStateStrategy: "database" | "cookie";
999
+ };
1000
+ newSession: {
1001
+ session: {
1002
+ id: string;
1003
+ createdAt: Date;
1004
+ updatedAt: Date;
1005
+ userId: string;
1006
+ expiresAt: Date;
1007
+ token: string;
1008
+ ipAddress?: string | null | undefined;
1009
+ userAgent?: string | null | undefined;
1010
+ } & Record<string, any>;
1011
+ user: {
1012
+ id: string;
1013
+ createdAt: Date;
1014
+ updatedAt: Date;
1015
+ email: string;
1016
+ emailVerified: boolean;
1017
+ name: string;
1018
+ image?: string | null | undefined;
1019
+ } & Record<string, any>;
1020
+ } | null;
1021
+ session: {
1022
+ session: {
1023
+ id: string;
1024
+ createdAt: Date;
1025
+ updatedAt: Date;
1026
+ userId: string;
1027
+ expiresAt: Date;
1028
+ token: string;
1029
+ ipAddress?: string | null | undefined;
1030
+ userAgent?: string | null | undefined;
1031
+ } & Record<string, any>;
1032
+ user: {
1033
+ id: string;
1034
+ createdAt: Date;
1035
+ updatedAt: Date;
1036
+ email: string;
1037
+ emailVerified: boolean;
1038
+ name: string;
1039
+ image?: string | null | undefined;
1040
+ } & Record<string, any>;
1041
+ } | null;
1042
+ setNewSession: (session: {
1043
+ session: {
1044
+ id: string;
1045
+ createdAt: Date;
1046
+ updatedAt: Date;
1047
+ userId: string;
1048
+ expiresAt: Date;
1049
+ token: string;
1050
+ ipAddress?: string | null | undefined;
1051
+ userAgent?: string | null | undefined;
1052
+ } & Record<string, any>;
1053
+ user: {
1054
+ id: string;
1055
+ createdAt: Date;
1056
+ updatedAt: Date;
1057
+ email: string;
1058
+ emailVerified: boolean;
1059
+ name: string;
1060
+ image?: string | null | undefined;
1061
+ } & Record<string, any>;
1062
+ } | null) => void;
1063
+ socialProviders: import("better-auth").OAuthProvider[];
1064
+ authCookies: import("better-auth").BetterAuthCookies;
1065
+ logger: ReturnType<(options?: import("better-auth").Logger | undefined) => import("better-auth").InternalLogger>;
1066
+ rateLimit: {
1067
+ enabled: boolean;
1068
+ window: number;
1069
+ max: number;
1070
+ storage: "memory" | "database" | "secondary-storage";
1071
+ } & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
1072
+ adapter: import("better-auth").DBAdapter<BetterAuthOptions>;
1073
+ internalAdapter: import("better-auth").InternalAdapter<BetterAuthOptions>;
1074
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-auth").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
1075
+ secret: string;
1076
+ secretConfig: string | import("better-auth").SecretConfig;
1077
+ sessionConfig: {
1078
+ updateAge: number;
1079
+ expiresIn: number;
1080
+ freshAge: number;
1081
+ cookieCacheSigner?: import("better-auth").CookieCacheSigner | undefined;
1082
+ cookieRefreshCache: false | {
1083
+ enabled: true;
1084
+ updateAge: number;
1085
+ };
1086
+ };
1087
+ generateId: (options: {
1088
+ model: import("better-auth").ModelNames;
1089
+ size?: number | undefined;
1090
+ }) => string | false;
1091
+ secondaryStorage: import("better-auth").SecondaryStorage | undefined;
1092
+ password: {
1093
+ hash: (password: string) => Promise<string>;
1094
+ verify: (data: {
1095
+ password: string;
1096
+ hash: string;
1097
+ }) => Promise<boolean>;
1098
+ config: {
1099
+ minPasswordLength: number;
1100
+ maxPasswordLength: number;
1101
+ };
1102
+ checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<BetterAuthOptions>) => Promise<boolean>;
1103
+ };
1104
+ tables: import("better-auth").BetterAuthDBSchema;
1105
+ runMigrations: () => Promise<void>;
1106
+ publishTelemetry: (event: {
1107
+ type: string;
1108
+ anonymousId?: string | undefined;
1109
+ payload: Record<string, any>;
1110
+ }) => Promise<void>;
1111
+ skipOriginCheck: boolean | string[];
1112
+ skipCSRFCheck: boolean;
1113
+ runInBackground: (promise: Promise<unknown>) => void;
1114
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
1115
+ } & {
1116
+ returned?: unknown | undefined;
1117
+ responseHeaders?: Headers | undefined;
1118
+ }>;
1119
+ }>>;
1120
+ }[];
1121
+ };
1122
+ endpoints: {
1123
+ createApiKey: import("better-auth").StrictEndpoint<"/api-key/create", {
1124
+ method: "POST";
1125
+ body: import("better-auth").ZodObject<{
1126
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1127
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1128
+ expiresIn: import("better-auth").ZodDefault<import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>>;
1129
+ prefix: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1130
+ remaining: import("better-auth").ZodDefault<import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>>;
1131
+ metadata: import("better-auth").ZodOptional<import("better-auth").ZodAny>;
1132
+ refillAmount: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1133
+ refillInterval: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1134
+ rateLimitTimeWindow: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1135
+ rateLimitMax: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1136
+ rateLimitEnabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1137
+ permissions: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>;
1138
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
1139
+ organizationId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
1140
+ }, import("zod/v4/core").$strip>;
1141
+ metadata: {
1142
+ openapi: {
1143
+ description: string;
1144
+ responses: {
1145
+ "200": {
1146
+ description: string;
1147
+ content: {
1148
+ "application/json": {
1149
+ schema: {
1150
+ type: "object";
1151
+ properties: {
1152
+ id: {
1153
+ type: string;
1154
+ description: string;
1155
+ };
1156
+ createdAt: {
1157
+ type: string;
1158
+ format: string;
1159
+ description: string;
1160
+ };
1161
+ updatedAt: {
1162
+ type: string;
1163
+ format: string;
1164
+ description: string;
1165
+ };
1166
+ name: {
1167
+ type: string;
1168
+ nullable: boolean;
1169
+ description: string;
1170
+ };
1171
+ prefix: {
1172
+ type: string;
1173
+ nullable: boolean;
1174
+ description: string;
1175
+ };
1176
+ start: {
1177
+ type: string;
1178
+ nullable: boolean;
1179
+ description: string;
1180
+ };
1181
+ key: {
1182
+ type: string;
1183
+ description: string;
1184
+ };
1185
+ enabled: {
1186
+ type: string;
1187
+ description: string;
1188
+ };
1189
+ expiresAt: {
1190
+ type: string;
1191
+ format: string;
1192
+ nullable: boolean;
1193
+ description: string;
1194
+ };
1195
+ referenceId: {
1196
+ type: string;
1197
+ description: string;
1198
+ };
1199
+ lastRefillAt: {
1200
+ type: string;
1201
+ format: string;
1202
+ nullable: boolean;
1203
+ description: string;
1204
+ };
1205
+ lastRequest: {
1206
+ type: string;
1207
+ format: string;
1208
+ nullable: boolean;
1209
+ description: string;
1210
+ };
1211
+ metadata: {
1212
+ type: string;
1213
+ nullable: boolean;
1214
+ additionalProperties: boolean;
1215
+ description: string;
1216
+ };
1217
+ rateLimitMax: {
1218
+ type: string;
1219
+ nullable: boolean;
1220
+ description: string;
1221
+ };
1222
+ rateLimitTimeWindow: {
1223
+ type: string;
1224
+ nullable: boolean;
1225
+ description: string;
1226
+ };
1227
+ remaining: {
1228
+ type: string;
1229
+ nullable: boolean;
1230
+ description: string;
1231
+ };
1232
+ refillAmount: {
1233
+ type: string;
1234
+ nullable: boolean;
1235
+ description: string;
1236
+ };
1237
+ refillInterval: {
1238
+ type: string;
1239
+ nullable: boolean;
1240
+ description: string;
1241
+ };
1242
+ rateLimitEnabled: {
1243
+ type: string;
1244
+ description: string;
1245
+ };
1246
+ requestCount: {
1247
+ type: string;
1248
+ description: string;
1249
+ };
1250
+ permissions: {
1251
+ type: string;
1252
+ nullable: boolean;
1253
+ additionalProperties: {
1254
+ type: string;
1255
+ items: {
1256
+ type: string;
1257
+ };
1258
+ };
1259
+ description: string;
1260
+ };
1261
+ };
1262
+ required: string[];
1263
+ };
1264
+ };
1265
+ };
1266
+ };
1267
+ };
1268
+ };
1269
+ };
1270
+ }, {
1271
+ key: string;
1272
+ metadata: any;
1273
+ permissions: any;
1274
+ id: string;
1275
+ configId: string;
1276
+ name: string | null;
1277
+ start: string | null;
1278
+ prefix: string | null;
1279
+ referenceId: string;
1280
+ refillInterval: number | null;
1281
+ refillAmount: number | null;
1282
+ lastRefillAt: Date | null;
1283
+ enabled: boolean;
1284
+ rateLimitEnabled: boolean;
1285
+ rateLimitTimeWindow: number | null;
1286
+ rateLimitMax: number | null;
1287
+ requestCount: number;
1288
+ remaining: number | null;
1289
+ lastRequest: Date | null;
1290
+ expiresAt: Date | null;
1291
+ createdAt: Date;
1292
+ updatedAt: Date;
1293
+ }>;
1294
+ verifyApiKey: import("better-auth").StrictEndpoint<string, {
1295
+ method: "POST";
1296
+ body: import("better-auth").ZodObject<{
1297
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1298
+ key: import("better-auth").ZodString;
1299
+ permissions: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>;
1300
+ }, import("zod/v4/core").$strip>;
1301
+ }, {
1302
+ valid: boolean;
1303
+ error: {
1304
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
1305
+ code: "KEY_NOT_FOUND";
1306
+ };
1307
+ key: null;
1308
+ } | {
1309
+ valid: boolean;
1310
+ error: {
1311
+ message: string | undefined;
1312
+ code: string;
1313
+ cause?: unknown;
1314
+ };
1315
+ key: null;
1316
+ } | {
1317
+ valid: boolean;
1318
+ error: {
1319
+ message: import("better-auth").RawError<"INVALID_API_KEY">;
1320
+ code: "INVALID_API_KEY";
1321
+ };
1322
+ key: null;
1323
+ } | {
1324
+ valid: boolean;
1325
+ error: null;
1326
+ key: Omit<import("@better-auth/api-key").ApiKey, "key"> | null;
1327
+ }>;
1328
+ getApiKey: import("better-auth").StrictEndpoint<"/api-key/get", {
1329
+ method: "GET";
1330
+ query: import("better-auth").ZodObject<{
1331
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1332
+ id: import("better-auth").ZodString;
1333
+ }, import("zod/v4/core").$strip>;
1334
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1335
+ session: {
1336
+ session: Record<string, any> & {
1337
+ id: string;
1338
+ createdAt: Date;
1339
+ updatedAt: Date;
1340
+ userId: string;
1341
+ expiresAt: Date;
1342
+ token: string;
1343
+ ipAddress?: string | null | undefined;
1344
+ userAgent?: string | null | undefined;
1345
+ };
1346
+ user: Record<string, any> & {
1347
+ id: string;
1348
+ createdAt: Date;
1349
+ updatedAt: Date;
1350
+ email: string;
1351
+ emailVerified: boolean;
1352
+ name: string;
1353
+ image?: string | null | undefined;
1354
+ };
1355
+ };
1356
+ }>>[];
1357
+ metadata: {
1358
+ openapi: {
1359
+ description: string;
1360
+ responses: {
1361
+ "200": {
1362
+ description: string;
1363
+ content: {
1364
+ "application/json": {
1365
+ schema: {
1366
+ type: "object";
1367
+ properties: {
1368
+ id: {
1369
+ type: string;
1370
+ description: string;
1371
+ };
1372
+ name: {
1373
+ type: string;
1374
+ nullable: boolean;
1375
+ description: string;
1376
+ };
1377
+ start: {
1378
+ type: string;
1379
+ nullable: boolean;
1380
+ description: string;
1381
+ };
1382
+ prefix: {
1383
+ type: string;
1384
+ nullable: boolean;
1385
+ description: string;
1386
+ };
1387
+ userId: {
1388
+ type: string;
1389
+ description: string;
1390
+ };
1391
+ refillInterval: {
1392
+ type: string;
1393
+ nullable: boolean;
1394
+ description: string;
1395
+ };
1396
+ refillAmount: {
1397
+ type: string;
1398
+ nullable: boolean;
1399
+ description: string;
1400
+ };
1401
+ lastRefillAt: {
1402
+ type: string;
1403
+ format: string;
1404
+ nullable: boolean;
1405
+ description: string;
1406
+ };
1407
+ enabled: {
1408
+ type: string;
1409
+ description: string;
1410
+ default: boolean;
1411
+ };
1412
+ rateLimitEnabled: {
1413
+ type: string;
1414
+ description: string;
1415
+ };
1416
+ rateLimitTimeWindow: {
1417
+ type: string;
1418
+ nullable: boolean;
1419
+ description: string;
1420
+ };
1421
+ rateLimitMax: {
1422
+ type: string;
1423
+ nullable: boolean;
1424
+ description: string;
1425
+ };
1426
+ requestCount: {
1427
+ type: string;
1428
+ description: string;
1429
+ };
1430
+ remaining: {
1431
+ type: string;
1432
+ nullable: boolean;
1433
+ description: string;
1434
+ };
1435
+ lastRequest: {
1436
+ type: string;
1437
+ format: string;
1438
+ nullable: boolean;
1439
+ description: string;
1440
+ };
1441
+ expiresAt: {
1442
+ type: string;
1443
+ format: string;
1444
+ nullable: boolean;
1445
+ description: string;
1446
+ };
1447
+ createdAt: {
1448
+ type: string;
1449
+ format: string;
1450
+ description: string;
1451
+ };
1452
+ updatedAt: {
1453
+ type: string;
1454
+ format: string;
1455
+ description: string;
1456
+ };
1457
+ metadata: {
1458
+ type: string;
1459
+ nullable: boolean;
1460
+ additionalProperties: boolean;
1461
+ description: string;
1462
+ };
1463
+ permissions: {
1464
+ type: string;
1465
+ nullable: boolean;
1466
+ description: string;
1467
+ };
1468
+ };
1469
+ required: string[];
1470
+ };
1471
+ };
1472
+ };
1473
+ };
1474
+ };
1475
+ };
1476
+ };
1477
+ }, {
1478
+ metadata: Record<string, any> | null;
1479
+ permissions: {
1480
+ [key: string]: string[];
1481
+ } | null;
1482
+ id: string;
1483
+ configId: string;
1484
+ name: string | null;
1485
+ start: string | null;
1486
+ prefix: string | null;
1487
+ referenceId: string;
1488
+ refillInterval: number | null;
1489
+ refillAmount: number | null;
1490
+ lastRefillAt: Date | null;
1491
+ enabled: boolean;
1492
+ rateLimitEnabled: boolean;
1493
+ rateLimitTimeWindow: number | null;
1494
+ rateLimitMax: number | null;
1495
+ requestCount: number;
1496
+ remaining: number | null;
1497
+ lastRequest: Date | null;
1498
+ expiresAt: Date | null;
1499
+ createdAt: Date;
1500
+ updatedAt: Date;
1501
+ }>;
1502
+ updateApiKey: import("better-auth").StrictEndpoint<"/api-key/update", {
1503
+ method: "POST";
1504
+ body: import("better-auth").ZodObject<{
1505
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1506
+ keyId: import("better-auth").ZodString;
1507
+ userId: import("better-auth").ZodOptional<import("better-auth").ZodCoercedString<unknown>>;
1508
+ name: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1509
+ enabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1510
+ remaining: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1511
+ refillAmount: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1512
+ refillInterval: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1513
+ metadata: import("better-auth").ZodOptional<import("better-auth").ZodAny>;
1514
+ expiresIn: import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodNumber>>;
1515
+ rateLimitEnabled: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1516
+ rateLimitTimeWindow: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1517
+ rateLimitMax: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
1518
+ permissions: import("better-auth").ZodNullable<import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodArray<import("better-auth").ZodString>>>>;
1519
+ }, import("zod/v4/core").$strip>;
1520
+ metadata: {
1521
+ openapi: {
1522
+ description: string;
1523
+ responses: {
1524
+ "200": {
1525
+ description: string;
1526
+ content: {
1527
+ "application/json": {
1528
+ schema: {
1529
+ type: "object";
1530
+ properties: {
1531
+ id: {
1532
+ type: string;
1533
+ description: string;
1534
+ };
1535
+ name: {
1536
+ type: string;
1537
+ nullable: boolean;
1538
+ description: string;
1539
+ };
1540
+ start: {
1541
+ type: string;
1542
+ nullable: boolean;
1543
+ description: string;
1544
+ };
1545
+ prefix: {
1546
+ type: string;
1547
+ nullable: boolean;
1548
+ description: string;
1549
+ };
1550
+ userId: {
1551
+ type: string;
1552
+ description: string;
1553
+ };
1554
+ refillInterval: {
1555
+ type: string;
1556
+ nullable: boolean;
1557
+ description: string;
1558
+ };
1559
+ refillAmount: {
1560
+ type: string;
1561
+ nullable: boolean;
1562
+ description: string;
1563
+ };
1564
+ lastRefillAt: {
1565
+ type: string;
1566
+ format: string;
1567
+ nullable: boolean;
1568
+ description: string;
1569
+ };
1570
+ enabled: {
1571
+ type: string;
1572
+ description: string;
1573
+ default: boolean;
1574
+ };
1575
+ rateLimitEnabled: {
1576
+ type: string;
1577
+ description: string;
1578
+ };
1579
+ rateLimitTimeWindow: {
1580
+ type: string;
1581
+ nullable: boolean;
1582
+ description: string;
1583
+ };
1584
+ rateLimitMax: {
1585
+ type: string;
1586
+ nullable: boolean;
1587
+ description: string;
1588
+ };
1589
+ requestCount: {
1590
+ type: string;
1591
+ description: string;
1592
+ };
1593
+ remaining: {
1594
+ type: string;
1595
+ nullable: boolean;
1596
+ description: string;
1597
+ };
1598
+ lastRequest: {
1599
+ type: string;
1600
+ format: string;
1601
+ nullable: boolean;
1602
+ description: string;
1603
+ };
1604
+ expiresAt: {
1605
+ type: string;
1606
+ format: string;
1607
+ nullable: boolean;
1608
+ description: string;
1609
+ };
1610
+ createdAt: {
1611
+ type: string;
1612
+ format: string;
1613
+ description: string;
1614
+ };
1615
+ updatedAt: {
1616
+ type: string;
1617
+ format: string;
1618
+ description: string;
1619
+ };
1620
+ metadata: {
1621
+ type: string;
1622
+ nullable: boolean;
1623
+ additionalProperties: boolean;
1624
+ description: string;
1625
+ };
1626
+ permissions: {
1627
+ type: string;
1628
+ nullable: boolean;
1629
+ description: string;
1630
+ };
1631
+ };
1632
+ required: string[];
1633
+ };
1634
+ };
1635
+ };
1636
+ };
1637
+ };
1638
+ };
1639
+ };
1640
+ }, {
1641
+ metadata: Record<string, any> | null;
1642
+ permissions: {
1643
+ [key: string]: string[];
1644
+ } | null;
1645
+ id: string;
1646
+ configId: string;
1647
+ name: string | null;
1648
+ start: string | null;
1649
+ prefix: string | null;
1650
+ referenceId: string;
1651
+ refillInterval: number | null;
1652
+ refillAmount: number | null;
1653
+ lastRefillAt: Date | null;
1654
+ enabled: boolean;
1655
+ rateLimitEnabled: boolean;
1656
+ rateLimitTimeWindow: number | null;
1657
+ rateLimitMax: number | null;
1658
+ requestCount: number;
1659
+ remaining: number | null;
1660
+ lastRequest: Date | null;
1661
+ expiresAt: Date | null;
1662
+ createdAt: Date;
1663
+ updatedAt: Date;
1664
+ }>;
1665
+ deleteApiKey: import("better-auth").StrictEndpoint<"/api-key/delete", {
1666
+ method: "POST";
1667
+ body: import("better-auth").ZodObject<{
1668
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1669
+ keyId: import("better-auth").ZodString;
1670
+ }, import("zod/v4/core").$strip>;
1671
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1672
+ session: {
1673
+ session: Record<string, any> & {
1674
+ id: string;
1675
+ createdAt: Date;
1676
+ updatedAt: Date;
1677
+ userId: string;
1678
+ expiresAt: Date;
1679
+ token: string;
1680
+ ipAddress?: string | null | undefined;
1681
+ userAgent?: string | null | undefined;
1682
+ };
1683
+ user: Record<string, any> & {
1684
+ id: string;
1685
+ createdAt: Date;
1686
+ updatedAt: Date;
1687
+ email: string;
1688
+ emailVerified: boolean;
1689
+ name: string;
1690
+ image?: string | null | undefined;
1691
+ };
1692
+ };
1693
+ }>>[];
1694
+ metadata: {
1695
+ openapi: {
1696
+ description: string;
1697
+ requestBody: {
1698
+ content: {
1699
+ "application/json": {
1700
+ schema: {
1701
+ type: "object";
1702
+ properties: {
1703
+ keyId: {
1704
+ type: string;
1705
+ description: string;
1706
+ };
1707
+ };
1708
+ required: string[];
1709
+ };
1710
+ };
1711
+ };
1712
+ };
1713
+ responses: {
1714
+ "200": {
1715
+ description: string;
1716
+ content: {
1717
+ "application/json": {
1718
+ schema: {
1719
+ type: "object";
1720
+ properties: {
1721
+ success: {
1722
+ type: string;
1723
+ description: string;
1724
+ };
1725
+ };
1726
+ required: string[];
1727
+ };
1728
+ };
1729
+ };
1730
+ };
1731
+ };
1732
+ };
1733
+ };
1734
+ }, {
1735
+ success: boolean;
1736
+ }>;
1737
+ listApiKeys: import("better-auth").StrictEndpoint<"/api-key/list", {
1738
+ method: "GET";
1739
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1740
+ session: {
1741
+ session: Record<string, any> & {
1742
+ id: string;
1743
+ createdAt: Date;
1744
+ updatedAt: Date;
1745
+ userId: string;
1746
+ expiresAt: Date;
1747
+ token: string;
1748
+ ipAddress?: string | null | undefined;
1749
+ userAgent?: string | null | undefined;
1750
+ };
1751
+ user: Record<string, any> & {
1752
+ id: string;
1753
+ createdAt: Date;
1754
+ updatedAt: Date;
1755
+ email: string;
1756
+ emailVerified: boolean;
1757
+ name: string;
1758
+ image?: string | null | undefined;
1759
+ };
1760
+ };
1761
+ }>>[];
1762
+ query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1763
+ configId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1764
+ organizationId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1765
+ limit: import("better-auth").ZodOptional<import("better-auth").ZodCoercedNumber<unknown>>;
1766
+ offset: import("better-auth").ZodOptional<import("better-auth").ZodCoercedNumber<unknown>>;
1767
+ sortBy: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1768
+ sortDirection: import("better-auth").ZodOptional<import("better-auth").ZodEnum<{
1769
+ asc: "asc";
1770
+ desc: "desc";
1771
+ }>>;
1772
+ }, import("zod/v4/core").$strip>>;
1773
+ metadata: {
1774
+ openapi: {
1775
+ description: string;
1776
+ responses: {
1777
+ "200": {
1778
+ description: string;
1779
+ content: {
1780
+ "application/json": {
1781
+ schema: {
1782
+ type: "object";
1783
+ properties: {
1784
+ apiKeys: {
1785
+ type: string;
1786
+ items: {
1787
+ type: string;
1788
+ properties: {
1789
+ id: {
1790
+ type: string;
1791
+ description: string;
1792
+ };
1793
+ name: {
1794
+ type: string;
1795
+ nullable: boolean;
1796
+ description: string;
1797
+ };
1798
+ start: {
1799
+ type: string;
1800
+ nullable: boolean;
1801
+ description: string;
1802
+ };
1803
+ prefix: {
1804
+ type: string;
1805
+ nullable: boolean;
1806
+ description: string;
1807
+ };
1808
+ userId: {
1809
+ type: string;
1810
+ description: string;
1811
+ };
1812
+ refillInterval: {
1813
+ type: string;
1814
+ nullable: boolean;
1815
+ description: string;
1816
+ };
1817
+ refillAmount: {
1818
+ type: string;
1819
+ nullable: boolean;
1820
+ description: string;
1821
+ };
1822
+ lastRefillAt: {
1823
+ type: string;
1824
+ format: string;
1825
+ nullable: boolean;
1826
+ description: string;
1827
+ };
1828
+ enabled: {
1829
+ type: string;
1830
+ description: string;
1831
+ default: boolean;
1832
+ };
1833
+ rateLimitEnabled: {
1834
+ type: string;
1835
+ description: string;
1836
+ };
1837
+ rateLimitTimeWindow: {
1838
+ type: string;
1839
+ nullable: boolean;
1840
+ description: string;
1841
+ };
1842
+ rateLimitMax: {
1843
+ type: string;
1844
+ nullable: boolean;
1845
+ description: string;
1846
+ };
1847
+ requestCount: {
1848
+ type: string;
1849
+ description: string;
1850
+ };
1851
+ remaining: {
1852
+ type: string;
1853
+ nullable: boolean;
1854
+ description: string;
1855
+ };
1856
+ lastRequest: {
1857
+ type: string;
1858
+ format: string;
1859
+ nullable: boolean;
1860
+ description: string;
1861
+ };
1862
+ expiresAt: {
1863
+ type: string;
1864
+ format: string;
1865
+ nullable: boolean;
1866
+ description: string;
1867
+ };
1868
+ createdAt: {
1869
+ type: string;
1870
+ format: string;
1871
+ description: string;
1872
+ };
1873
+ updatedAt: {
1874
+ type: string;
1875
+ format: string;
1876
+ description: string;
1877
+ };
1878
+ metadata: {
1879
+ type: string;
1880
+ nullable: boolean;
1881
+ additionalProperties: boolean;
1882
+ description: string;
1883
+ };
1884
+ permissions: {
1885
+ type: string;
1886
+ nullable: boolean;
1887
+ description: string;
1888
+ };
1889
+ };
1890
+ required: string[];
1891
+ };
1892
+ };
1893
+ total: {
1894
+ type: string;
1895
+ description: string;
1896
+ };
1897
+ limit: {
1898
+ type: string;
1899
+ nullable: boolean;
1900
+ description: string;
1901
+ };
1902
+ offset: {
1903
+ type: string;
1904
+ nullable: boolean;
1905
+ description: string;
1906
+ };
1907
+ };
1908
+ required: string[];
1909
+ };
1910
+ };
1911
+ };
1912
+ };
1913
+ };
1914
+ };
1915
+ };
1916
+ }, {
1917
+ apiKeys: {
1918
+ metadata: Record<string, any> | null;
1919
+ permissions: {
1920
+ [key: string]: string[];
1921
+ } | null;
1922
+ id: string;
1923
+ configId: string;
1924
+ name: string | null;
1925
+ start: string | null;
1926
+ prefix: string | null;
1927
+ referenceId: string;
1928
+ refillInterval: number | null;
1929
+ refillAmount: number | null;
1930
+ lastRefillAt: Date | null;
1931
+ enabled: boolean;
1932
+ rateLimitEnabled: boolean;
1933
+ rateLimitTimeWindow: number | null;
1934
+ rateLimitMax: number | null;
1935
+ requestCount: number;
1936
+ remaining: number | null;
1937
+ lastRequest: Date | null;
1938
+ expiresAt: Date | null;
1939
+ createdAt: Date;
1940
+ updatedAt: Date;
1941
+ }[];
1942
+ total: number;
1943
+ limit: number | undefined;
1944
+ offset: number | undefined;
1945
+ }>;
1946
+ deleteAllExpiredApiKeys: import("better-auth").StrictEndpoint<string, {
1947
+ method: "POST";
1948
+ }, {
1949
+ success: boolean;
1950
+ error: unknown;
1951
+ }>;
1952
+ };
1953
+ schema: {
1954
+ apikey: {
1955
+ fields: {
1956
+ configId: {
1957
+ type: "string";
1958
+ required: true;
1959
+ defaultValue: string;
1960
+ input: false;
1961
+ index: true;
1962
+ };
1963
+ name: {
1964
+ type: "string";
1965
+ required: false;
1966
+ input: false;
1967
+ };
1968
+ start: {
1969
+ type: "string";
1970
+ required: false;
1971
+ input: false;
1972
+ };
1973
+ referenceId: {
1974
+ type: "string";
1975
+ required: true;
1976
+ input: false;
1977
+ index: true;
1978
+ };
1979
+ prefix: {
1980
+ type: "string";
1981
+ required: false;
1982
+ input: false;
1983
+ };
1984
+ key: {
1985
+ type: "string";
1986
+ required: true;
1987
+ input: false;
1988
+ index: true;
1989
+ };
1990
+ refillInterval: {
1991
+ type: "number";
1992
+ required: false;
1993
+ input: false;
1994
+ };
1995
+ refillAmount: {
1996
+ type: "number";
1997
+ required: false;
1998
+ input: false;
1999
+ };
2000
+ lastRefillAt: {
2001
+ type: "date";
2002
+ required: false;
2003
+ input: false;
2004
+ };
2005
+ enabled: {
2006
+ type: "boolean";
2007
+ required: false;
2008
+ input: false;
2009
+ defaultValue: true;
2010
+ };
2011
+ rateLimitEnabled: {
2012
+ type: "boolean";
2013
+ required: false;
2014
+ input: false;
2015
+ defaultValue: true;
2016
+ };
2017
+ rateLimitTimeWindow: {
2018
+ type: "number";
2019
+ required: false;
2020
+ input: false;
2021
+ defaultValue: number;
2022
+ };
2023
+ rateLimitMax: {
2024
+ type: "number";
2025
+ required: false;
2026
+ input: false;
2027
+ defaultValue: number;
2028
+ };
2029
+ requestCount: {
2030
+ type: "number";
2031
+ required: false;
2032
+ input: false;
2033
+ defaultValue: number;
2034
+ };
2035
+ remaining: {
2036
+ type: "number";
2037
+ required: false;
2038
+ input: false;
2039
+ };
2040
+ lastRequest: {
2041
+ type: "date";
2042
+ required: false;
2043
+ input: false;
2044
+ };
2045
+ expiresAt: {
2046
+ type: "date";
2047
+ required: false;
2048
+ input: false;
2049
+ };
2050
+ createdAt: {
2051
+ type: "date";
2052
+ required: true;
2053
+ input: false;
2054
+ };
2055
+ updatedAt: {
2056
+ type: "date";
2057
+ required: true;
2058
+ input: false;
2059
+ };
2060
+ permissions: {
2061
+ type: "string";
2062
+ required: false;
2063
+ input: false;
2064
+ };
2065
+ metadata: {
2066
+ type: "string";
2067
+ required: false;
2068
+ input: true;
2069
+ transform: {
2070
+ input(value: import("better-auth").DBPrimitive): string;
2071
+ output(value: import("better-auth").DBPrimitive): any;
2072
+ };
2073
+ };
2074
+ };
2075
+ };
2076
+ };
2077
+ }, {
2078
+ id: "phone-number";
2079
+ version: string;
2080
+ init(): {
2081
+ options: {
2082
+ databaseHooks: {
2083
+ user: {
2084
+ update: {
2085
+ before(data: Partial<{
2086
+ id: string;
2087
+ createdAt: Date;
2088
+ updatedAt: Date;
2089
+ email: string;
2090
+ emailVerified: boolean;
2091
+ name: string;
2092
+ image?: string | null | undefined;
2093
+ }> & Record<string, unknown>): Promise<{
2094
+ data: {
2095
+ [x: string]: unknown;
2096
+ id?: string | undefined;
2097
+ createdAt?: Date | undefined;
2098
+ updatedAt?: Date | undefined;
2099
+ email?: string | undefined;
2100
+ emailVerified?: boolean | undefined;
2101
+ name?: string | undefined;
2102
+ image?: string | null | undefined;
2103
+ };
2104
+ } | undefined>;
2105
+ };
2106
+ };
2107
+ };
2108
+ };
2109
+ };
2110
+ hooks: {
2111
+ before: {
2112
+ matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
2113
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<never>>;
2114
+ }[];
2115
+ };
2116
+ endpoints: {
2117
+ signInPhoneNumber: import("better-auth").StrictEndpoint<"/sign-in/phone-number", {
2118
+ method: "POST";
2119
+ body: import("better-auth").ZodObject<{
2120
+ phoneNumber: import("better-auth").ZodString;
2121
+ password: import("better-auth").ZodString;
2122
+ rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2123
+ }, import("zod/v4/core").$strip>;
2124
+ metadata: {
2125
+ openapi: {
2126
+ summary: string;
2127
+ description: string;
2128
+ responses: {
2129
+ 200: {
2130
+ description: string;
2131
+ content: {
2132
+ "application/json": {
2133
+ schema: {
2134
+ type: "object";
2135
+ properties: {
2136
+ user: {
2137
+ $ref: string;
2138
+ };
2139
+ session: {
2140
+ $ref: string;
2141
+ };
2142
+ };
2143
+ };
2144
+ };
2145
+ };
2146
+ };
2147
+ 400: {
2148
+ description: string;
2149
+ };
2150
+ };
2151
+ };
2152
+ };
2153
+ }, {
2154
+ token: string;
2155
+ user: import("better-auth/plugins").UserWithPhoneNumber;
2156
+ }>;
2157
+ sendPhoneNumberOTP: import("better-auth").StrictEndpoint<"/phone-number/send-otp", {
2158
+ method: "POST";
2159
+ body: import("better-auth").ZodObject<{
2160
+ phoneNumber: import("better-auth").ZodString;
2161
+ }, import("zod/v4/core").$strip>;
2162
+ metadata: {
2163
+ openapi: {
2164
+ summary: string;
2165
+ description: string;
2166
+ responses: {
2167
+ 200: {
2168
+ description: string;
2169
+ content: {
2170
+ "application/json": {
2171
+ schema: {
2172
+ type: "object";
2173
+ properties: {
2174
+ message: {
2175
+ type: string;
2176
+ };
2177
+ };
2178
+ };
2179
+ };
2180
+ };
2181
+ };
2182
+ };
2183
+ };
2184
+ };
2185
+ }, {
2186
+ message: string;
2187
+ }>;
2188
+ consumePhoneNumberOTP: import("better-auth").StrictEndpoint<string, {
2189
+ method: "POST";
2190
+ body: import("better-auth").ZodObject<{
2191
+ phoneNumber: import("better-auth").ZodString;
2192
+ code: import("better-auth").ZodString;
2193
+ }, import("zod/v4/core").$strip>;
2194
+ metadata: {
2195
+ readonly scope: "server";
2196
+ };
2197
+ }, {
2198
+ status: boolean;
2199
+ }>;
2200
+ verifyPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/verify", {
2201
+ method: "POST";
2202
+ body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
2203
+ phoneNumber: import("better-auth").ZodString;
2204
+ code: import("better-auth").ZodString;
2205
+ disableSession: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2206
+ updatePhoneNumber: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
2207
+ }, import("zod/v4/core").$strip>, import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
2208
+ metadata: {
2209
+ openapi: {
2210
+ summary: string;
2211
+ description: string;
2212
+ responses: {
2213
+ "200": {
2214
+ description: string;
2215
+ content: {
2216
+ "application/json": {
2217
+ schema: {
2218
+ type: "object";
2219
+ properties: {
2220
+ status: {
2221
+ type: string;
2222
+ description: string;
2223
+ enum: boolean[];
2224
+ };
2225
+ token: {
2226
+ type: string;
2227
+ nullable: boolean;
2228
+ description: string;
2229
+ };
2230
+ user: {
2231
+ type: string;
2232
+ nullable: boolean;
2233
+ properties: {
2234
+ id: {
2235
+ type: string;
2236
+ description: string;
2237
+ };
2238
+ email: {
2239
+ type: string;
2240
+ format: string;
2241
+ nullable: boolean;
2242
+ description: string;
2243
+ };
2244
+ emailVerified: {
2245
+ type: string;
2246
+ nullable: boolean;
2247
+ description: string;
2248
+ };
2249
+ name: {
2250
+ type: string;
2251
+ nullable: boolean;
2252
+ description: string;
2253
+ };
2254
+ image: {
2255
+ type: string;
2256
+ format: string;
2257
+ nullable: boolean;
2258
+ description: string;
2259
+ };
2260
+ phoneNumber: {
2261
+ type: string;
2262
+ description: string;
2263
+ };
2264
+ phoneNumberVerified: {
2265
+ type: string;
2266
+ description: string;
2267
+ };
2268
+ createdAt: {
2269
+ type: string;
2270
+ format: string;
2271
+ description: string;
2272
+ };
2273
+ updatedAt: {
2274
+ type: string;
2275
+ format: string;
2276
+ description: string;
2277
+ };
2278
+ };
2279
+ required: string[];
2280
+ description: string;
2281
+ };
2282
+ };
2283
+ required: string[];
2284
+ };
2285
+ };
2286
+ };
2287
+ };
2288
+ 400: {
2289
+ description: string;
2290
+ };
2291
+ };
2292
+ };
2293
+ };
2294
+ }, {
2295
+ status: boolean;
2296
+ token: string;
2297
+ user: {
2298
+ id: string;
2299
+ createdAt: Date;
2300
+ updatedAt: Date;
2301
+ email: string;
2302
+ emailVerified: boolean;
2303
+ name: string;
2304
+ image?: string | null | undefined;
2305
+ } & import("better-auth/plugins").UserWithPhoneNumber;
2306
+ } | {
2307
+ status: boolean;
2308
+ token: null;
2309
+ user: import("better-auth/plugins").UserWithPhoneNumber;
2310
+ }>;
2311
+ requestPasswordResetPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/request-password-reset", {
2312
+ method: "POST";
2313
+ body: import("better-auth").ZodObject<{
2314
+ phoneNumber: import("better-auth").ZodString;
2315
+ }, import("zod/v4/core").$strip>;
2316
+ metadata: {
2317
+ openapi: {
2318
+ description: string;
2319
+ responses: {
2320
+ "200": {
2321
+ description: string;
2322
+ content: {
2323
+ "application/json": {
2324
+ schema: {
2325
+ type: "object";
2326
+ properties: {
2327
+ status: {
2328
+ type: string;
2329
+ description: string;
2330
+ enum: boolean[];
2331
+ };
2332
+ };
2333
+ required: string[];
2334
+ };
2335
+ };
2336
+ };
2337
+ };
2338
+ };
2339
+ };
2340
+ };
2341
+ }, {
2342
+ status: boolean;
2343
+ }>;
2344
+ resetPasswordPhoneNumber: import("better-auth").StrictEndpoint<"/phone-number/reset-password", {
2345
+ method: "POST";
2346
+ body: import("better-auth").ZodObject<{
2347
+ otp: import("better-auth").ZodString;
2348
+ phoneNumber: import("better-auth").ZodString;
2349
+ newPassword: import("better-auth").ZodString;
2350
+ }, import("zod/v4/core").$strip>;
2351
+ metadata: {
2352
+ openapi: {
2353
+ description: string;
2354
+ responses: {
2355
+ "200": {
2356
+ description: string;
2357
+ content: {
2358
+ "application/json": {
2359
+ schema: {
2360
+ type: "object";
2361
+ properties: {
2362
+ status: {
2363
+ type: string;
2364
+ description: string;
2365
+ enum: boolean[];
2366
+ };
2367
+ };
2368
+ required: string[];
2369
+ };
2370
+ };
2371
+ };
2372
+ };
2373
+ };
2374
+ };
2375
+ };
2376
+ }, {
2377
+ status: boolean;
2378
+ }>;
2379
+ };
2380
+ schema: {
2381
+ user: {
2382
+ fields: {
2383
+ phoneNumber: {
2384
+ type: "string";
2385
+ required: false;
2386
+ unique: true;
2387
+ sortable: true;
2388
+ returned: true;
2389
+ };
2390
+ phoneNumberVerified: {
2391
+ type: "boolean";
2392
+ required: false;
2393
+ returned: true;
2394
+ input: false;
2395
+ };
2396
+ };
2397
+ };
2398
+ };
2399
+ rateLimit: {
2400
+ pathMatcher(path: string): boolean;
2401
+ window: number;
2402
+ max: number;
2403
+ }[];
2404
+ options: import("better-auth/plugins").PhoneNumberOptions | undefined;
2405
+ $ERROR_CODES: {
2406
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
2407
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
2408
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
2409
+ INVALID_PHONE_NUMBER: import("better-auth").RawError<"INVALID_PHONE_NUMBER">;
2410
+ PHONE_NUMBER_EXIST: import("better-auth").RawError<"PHONE_NUMBER_EXIST">;
2411
+ PHONE_NUMBER_NOT_EXIST: import("better-auth").RawError<"PHONE_NUMBER_NOT_EXIST">;
2412
+ INVALID_PHONE_NUMBER_OR_PASSWORD: import("better-auth").RawError<"INVALID_PHONE_NUMBER_OR_PASSWORD">;
2413
+ UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
2414
+ OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
2415
+ PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
2416
+ PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
2417
+ SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
2418
+ };
2419
+ }];
2420
+ user: {
2421
+ additionalFields: {
2422
+ vendorId: {
2423
+ type: "string";
2424
+ required: false;
2425
+ };
2426
+ posOperatorPin: {
2427
+ type: "string";
2428
+ required: false;
2429
+ };
2430
+ };
2431
+ };
2432
+ };
2433
+ export type AuthSchemaParityMismatch = {
2434
+ model: string;
2435
+ field: string;
2436
+ issue: string;
2437
+ };
2438
+ /**
2439
+ * Returns every mismatch between better-auth's expected auth tables and the
2440
+ * Drizzle definitions Porulle ships. An empty array means parity holds.
2441
+ */
2442
+ export declare function findAuthSchemaParityMismatches(options?: BetterAuthOptions): AuthSchemaParityMismatch[];
2443
+ export declare function assertAuthSchemaParity(options?: BetterAuthOptions): void;
2444
+ //# sourceMappingURL=auth-schema-guard.d.ts.map