faire-auth 1.0.3 → 1.1.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 (228) hide show
  1. package/dist/{adapter-factory-lKIOf2OR.mjs → adapter-factory-qPVW8x9-.mjs} +34 -36
  2. package/dist/{adapter-factory-D1I7joki.cjs → adapter-factory-u8r3oTez.cjs} +66 -68
  3. package/dist/adapters/drizzle-adapter/index.cjs +34 -40
  4. package/dist/adapters/drizzle-adapter/index.d.cts +4 -9
  5. package/dist/adapters/drizzle-adapter/index.d.mts +4 -9
  6. package/dist/adapters/drizzle-adapter/index.mjs +20 -26
  7. package/dist/adapters/index.cjs +11 -16
  8. package/dist/adapters/index.d.cts +11 -37
  9. package/dist/adapters/index.d.mts +11 -37
  10. package/dist/adapters/index.mjs +4 -13
  11. package/dist/adapters/kysely-adapter/index.cjs +270 -11
  12. package/dist/adapters/kysely-adapter/index.d.cts +9 -19
  13. package/dist/adapters/kysely-adapter/index.d.mts +9 -19
  14. package/dist/adapters/kysely-adapter/index.mjs +267 -9
  15. package/dist/adapters/memory-adapter/index.cjs +146 -9
  16. package/dist/adapters/memory-adapter/index.d.cts +4 -10
  17. package/dist/adapters/memory-adapter/index.d.mts +4 -10
  18. package/dist/adapters/memory-adapter/index.mjs +145 -9
  19. package/dist/adapters/mongodb-adapter/index.cjs +13 -21
  20. package/dist/adapters/mongodb-adapter/index.d.cts +3 -8
  21. package/dist/adapters/mongodb-adapter/index.d.mts +4 -9
  22. package/dist/adapters/mongodb-adapter/index.mjs +12 -20
  23. package/dist/adapters/prisma-adapter/index.cjs +12 -20
  24. package/dist/adapters/prisma-adapter/index.d.cts +4 -8
  25. package/dist/adapters/prisma-adapter/index.d.mts +4 -8
  26. package/dist/adapters/prisma-adapter/index.mjs +5 -13
  27. package/dist/adapters/test.cjs +86 -69
  28. package/dist/adapters/test.d.cts +7 -11
  29. package/dist/adapters/test.d.mts +7 -11
  30. package/dist/adapters/test.mjs +83 -66
  31. package/dist/api/index.cjs +3 -20
  32. package/dist/api/index.d.cts +2 -3
  33. package/dist/api/index.d.mts +2 -3
  34. package/dist/api/index.mjs +1 -20
  35. package/dist/api/middleware/index.cjs +4 -11
  36. package/dist/api/middleware/index.d.cts +3 -9
  37. package/dist/api/middleware/index.d.mts +3 -9
  38. package/dist/api/middleware/index.mjs +3 -11
  39. package/dist/{api-B4RDwBty.mjs → api-0f-F-Fi2.mjs} +292 -189
  40. package/dist/{api-CaRC1Gio.cjs → api-LjfH6hQi.cjs} +557 -452
  41. package/dist/{test-utils/bun-sqlite-dialect-BZBvHchL.cjs → bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
  42. package/dist/{test-utils/bun-sqlite-dialect-BSWhhKNs.mjs → bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
  43. package/dist/client/index.cjs +8 -15
  44. package/dist/client/index.d.cts +9 -14
  45. package/dist/client/index.d.mts +9 -14
  46. package/dist/client/index.mjs +7 -15
  47. package/dist/client/lynx/index.cjs +10 -18
  48. package/dist/client/lynx/index.d.cts +402 -71
  49. package/dist/client/lynx/index.d.mts +402 -71
  50. package/dist/client/lynx/index.mjs +5 -13
  51. package/dist/client/plugins/index.cjs +3 -5
  52. package/dist/client/plugins/index.d.cts +5 -10
  53. package/dist/client/plugins/index.d.mts +5 -10
  54. package/dist/client/plugins/index.mjs +2 -4
  55. package/dist/client/react/index.cjs +6 -14
  56. package/dist/client/react/index.d.cts +402 -71
  57. package/dist/client/react/index.d.mts +402 -71
  58. package/dist/client/react/index.mjs +5 -13
  59. package/dist/client/solid/index.cjs +6 -14
  60. package/dist/client/solid/index.d.cts +393 -57
  61. package/dist/client/solid/index.d.mts +393 -57
  62. package/dist/client/solid/index.mjs +5 -13
  63. package/dist/client/svelte/index.cjs +5 -10
  64. package/dist/client/svelte/index.d.cts +400 -67
  65. package/dist/client/svelte/index.d.mts +400 -67
  66. package/dist/client/svelte/index.mjs +4 -10
  67. package/dist/client/vue/index.cjs +6 -14
  68. package/dist/client/vue/index.d.cts +401 -68
  69. package/dist/client/vue/index.d.mts +401 -68
  70. package/dist/client/vue/index.mjs +5 -13
  71. package/dist/{cookies-BTs1o992.mjs → cookies-D9aY_gJh.mjs} +25 -21
  72. package/dist/{cookies-BTl72THv.cjs → cookies-DQ52rcOy.cjs} +119 -115
  73. package/dist/crypto/index.cjs +10 -8
  74. package/dist/crypto/index.d.cts +5 -13
  75. package/dist/crypto/index.d.mts +5 -13
  76. package/dist/crypto/index.mjs +2 -5
  77. package/dist/{crypto-DH2Aa7jN.mjs → crypto-BH-hD0lJ.mjs} +7 -10
  78. package/dist/{crypto-DpSCnrTp.cjs → crypto-BITfWVwD.cjs} +24 -27
  79. package/dist/db/index.cjs +1135 -29
  80. package/dist/db/index.d.cts +1 -2
  81. package/dist/db/index.d.mts +1 -2
  82. package/dist/db/index.mjs +1115 -16
  83. package/dist/defu-D2h4S3X-.mjs +87 -0
  84. package/dist/defu-DWS5RPWt.cjs +134 -0
  85. package/dist/{email-verification-DI_0H4JC.cjs → email-verification-DOPnSgbI.cjs} +65 -71
  86. package/dist/{email-verification-C_lBu_JY.mjs → email-verification-YSR5n5lb.mjs} +23 -29
  87. package/dist/{hono-CO-zsqI-.mjs → hono-BAV2wQkK.mjs} +16 -33
  88. package/dist/hono-SVQuc5Ru.mjs +4 -0
  89. package/dist/hono-pgK4H_U1.cjs +9 -0
  90. package/dist/{hono-DnW5crl1.cjs → hono-tyFFJFdS.cjs} +42 -60
  91. package/dist/index-B86Cy0dE.d.cts +2 -0
  92. package/dist/index-B86Cy0dE.d.mts +2 -0
  93. package/dist/index.cjs +115 -150
  94. package/dist/index.d.cts +4 -5
  95. package/dist/index.d.mts +4 -5
  96. package/dist/index.mjs +46 -81
  97. package/dist/integrations/next-js.cjs +5 -9
  98. package/dist/integrations/next-js.d.cts +6 -14
  99. package/dist/integrations/next-js.d.mts +6 -14
  100. package/dist/integrations/next-js.mjs +4 -9
  101. package/dist/integrations/node.cjs +16 -14
  102. package/dist/integrations/node.d.cts +6 -14
  103. package/dist/integrations/node.d.mts +6 -14
  104. package/dist/integrations/node.mjs +15 -13
  105. package/dist/integrations/react-start.cjs +7 -11
  106. package/dist/integrations/react-start.d.cts +5 -13
  107. package/dist/integrations/react-start.d.mts +5 -13
  108. package/dist/integrations/react-start.mjs +6 -11
  109. package/dist/integrations/solid-start.cjs +3 -5
  110. package/dist/integrations/solid-start.d.cts +2 -5
  111. package/dist/integrations/solid-start.d.mts +2 -5
  112. package/dist/integrations/solid-start.mjs +2 -4
  113. package/dist/integrations/svelte-kit.cjs +6 -10
  114. package/dist/integrations/svelte-kit.d.cts +11 -23
  115. package/dist/integrations/svelte-kit.d.mts +11 -23
  116. package/dist/integrations/svelte-kit.mjs +5 -10
  117. package/dist/{ip-BjNYspCH.mjs → ip-6Lv2o42m.mjs} +4 -9
  118. package/dist/{ip-C17Qdq-G.cjs → ip-DPydExzV.cjs} +21 -27
  119. package/dist/{json--tl7Grvs.cjs → json-D3aq-nH2.cjs} +9 -13
  120. package/dist/{json-B1v2qRTQ.mjs → json-DooGMtnJ.mjs} +2 -5
  121. package/dist/{logged-CyGfp8_H.mjs → logged-B83SzMnJ.mjs} +6 -10
  122. package/dist/{logged-Dv3st5qc.cjs → logged-BIpCpnVY.cjs} +13 -18
  123. package/dist/{middleware-CE6OhDkq.mjs → middleware-Cakg4e1D.mjs} +2 -4
  124. package/dist/{middleware-CWvRH4EW.cjs → middleware-Cd-VkNxB.cjs} +17 -20
  125. package/dist/{node-sqlite-dialect-w4DAg0PH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
  126. package/dist/{test-utils/node-sqlite-dialect-BgJqjBOu.cjs → node-sqlite-dialect-D3QPFROH.cjs} +5 -9
  127. package/dist/oauth2/index.cjs +166 -22
  128. package/dist/oauth2/index.d.cts +5 -17
  129. package/dist/oauth2/index.d.mts +5 -17
  130. package/dist/oauth2/index.mjs +156 -16
  131. package/dist/{origin-check-DjLTuZQ8.cjs → origin-check-BflGhEEN.cjs} +34 -38
  132. package/dist/{origin-check-8Gajklvh.mjs → origin-check-CRgs1M7k.mjs} +13 -16
  133. package/dist/{parser-B25ylT5u.mjs → parser-CqwvpF6l.cjs} +12 -10
  134. package/dist/{parser-B_wxvaAr.cjs → parser-DcKDjjHO.mjs} +7 -22
  135. package/dist/plugins/access/index.cjs +38 -4
  136. package/dist/plugins/access/index.d.cts +36 -2
  137. package/dist/plugins/access/index.d.mts +36 -2
  138. package/dist/plugins/access/index.mjs +36 -3
  139. package/dist/plugins/bearer/index.cjs +52 -7
  140. package/dist/plugins/bearer/index.d.cts +27 -4
  141. package/dist/plugins/bearer/index.d.mts +27 -4
  142. package/dist/plugins/bearer/index.mjs +51 -7
  143. package/dist/plugins/index.cjs +1385 -842
  144. package/dist/plugins/index.d.cts +489 -7566
  145. package/dist/plugins/index.d.mts +489 -7566
  146. package/dist/plugins/index.mjs +1118 -576
  147. package/dist/plugins/passkey/index.cjs +551 -15
  148. package/dist/plugins/passkey/index.d.cts +123 -4
  149. package/dist/plugins/passkey/index.d.mts +123 -4
  150. package/dist/plugins/passkey/index.mjs +547 -15
  151. package/dist/{chunk-BFnQceUY.mjs → rolldown-runtime-BKpuH2hG.mjs} +6 -7
  152. package/dist/{chunk-fPmz2rbM.cjs → rolldown-runtime-C_Pgydhf.cjs} +22 -24
  153. package/dist/{schema-DTIwLLmf.mjs → schema-CFCpv0tK.mjs} +3 -6
  154. package/dist/{schema-CirKflVs.cjs → schema-b-lKhMkG.cjs} +51 -55
  155. package/dist/{session-CM3rmOYF.mjs → session-BGjJgihS.mjs} +51 -74
  156. package/dist/{session-Cwrj4GfV.cjs → session-CzZSMmQC.cjs} +197 -219
  157. package/dist/shared.d.cts +1581 -0
  158. package/dist/shared.d.mts +1581 -0
  159. package/dist/social-providers/index.cjs +9 -9
  160. package/dist/social-providers/index.d.cts +1 -1
  161. package/dist/social-providers/index.d.mts +1 -1
  162. package/dist/social-providers/index.mjs +3 -5
  163. package/dist/social-providers-CjPww-qf.mjs +6 -0
  164. package/dist/social-providers-D7w_7Ym8.cjs +10 -0
  165. package/dist/{state-CvSihlVT.cjs → state-2OrNjOO-.cjs} +24 -24
  166. package/dist/{state-CQghgH9I.mjs → state-Dooeisfq.mjs} +17 -17
  167. package/dist/{bun-sqlite-dialect-DPgTzc0w.cjs → test-utils/bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
  168. package/dist/{bun-sqlite-dialect-6NqeV3px.mjs → test-utils/bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
  169. package/dist/test-utils/index.cjs +8831 -7941
  170. package/dist/test-utils/index.d.cts +310 -12440
  171. package/dist/test-utils/index.d.mts +313 -12440
  172. package/dist/test-utils/index.mjs +8591 -7701
  173. package/dist/test-utils/{node-sqlite-dialect-DAQXiobH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
  174. package/dist/{node-sqlite-dialect-DP11CB0y.cjs → test-utils/node-sqlite-dialect-D3QPFROH.cjs} +5 -9
  175. package/dist/types/index.d.cts +2 -3
  176. package/dist/types/index.d.mts +2 -3
  177. package/dist/types/index.mjs +1 -1
  178. package/dist/{url-BoUuoIwZ.mjs → url-CJtdrrUu.mjs} +12 -13
  179. package/dist/{url-Ce7CVaQD.cjs → url-DjCmCUHS.cjs} +42 -44
  180. package/dist/utils/cookies.cjs +29 -30
  181. package/dist/utils/cookies.d.cts +21 -25
  182. package/dist/utils/cookies.d.mts +20 -24
  183. package/dist/utils/cookies.mjs +2 -7
  184. package/dist/utils-C7OHyfHa.mjs +4 -0
  185. package/dist/utils-iX0Vy_UL.cjs +3 -0
  186. package/package.json +40 -30
  187. package/dist/access-BZ7-AbTM.cjs +0 -51
  188. package/dist/access-D0DRqUKC.mjs +0 -39
  189. package/dist/bearer-DDzrp5M7.cjs +0 -60
  190. package/dist/bearer-WZcs7gxL.mjs +0 -54
  191. package/dist/db-4tUsQJXd.mjs +0 -1119
  192. package/dist/db-ChMbb_U-.cjs +0 -1180
  193. package/dist/defu-BmOYq4PU.cjs +0 -34
  194. package/dist/defu-D9ZTXqlo.mjs +0 -28
  195. package/dist/hono-C14rpOEa.cjs +0 -13
  196. package/dist/hono-CoKYWnXA.mjs +0 -7
  197. package/dist/hono-D0VqxVy1.d.mts +0 -18
  198. package/dist/hono-DOM31WQz.d.cts +0 -18
  199. package/dist/index-BCTFWP_o.d.mts +0 -992
  200. package/dist/index-BDhhaE6Y.d.cts +0 -3
  201. package/dist/index-BVRfQy6L.d.mts +0 -992
  202. package/dist/index-Baarsq5J.d.mts +0 -33
  203. package/dist/index-By364WbF.d.cts +0 -992
  204. package/dist/index-BzWwMgxr.d.cts +0 -992
  205. package/dist/index-CF9iq55a.d.mts +0 -3
  206. package/dist/index-CJD2yB-W.d.cts +0 -33
  207. package/dist/index-CRt_fppq.d.mts +0 -41
  208. package/dist/index-CdLyn7qP.d.cts +0 -41
  209. package/dist/index-CsWF3f7U.d.cts +0 -13350
  210. package/dist/index-CzidsAyA.d.mts +0 -13350
  211. package/dist/index-DvW-GCcI.d.cts +0 -33
  212. package/dist/index-f-5OJ9yV.d.cts +0 -13350
  213. package/dist/index-rFv8Hxld.d.mts +0 -13350
  214. package/dist/index-ztVZPQdV.d.mts +0 -33
  215. package/dist/kysely-adapter-CtIdoHa8.mjs +0 -270
  216. package/dist/kysely-adapter-QZTx077T.cjs +0 -288
  217. package/dist/memory-adapter-17RZd5df.cjs +0 -154
  218. package/dist/memory-adapter-Dp4XdCZK.mjs +0 -148
  219. package/dist/oauth2-5RL4cVNS.cjs +0 -177
  220. package/dist/oauth2-C56wz-n9.mjs +0 -159
  221. package/dist/passkey-BTT-v5c-.cjs +0 -512
  222. package/dist/passkey-CzY_W2us.mjs +0 -505
  223. package/dist/request-1NL_1lyJ.mjs +0 -58
  224. package/dist/request-CPNlp-DK.cjs +0 -100
  225. package/dist/social-providers-B8RK5yqI.mjs +0 -9
  226. package/dist/social-providers-BmFOIIPk.cjs +0 -13
  227. package/dist/utils-44aDDP8f.cjs +0 -2
  228. package/dist/utils-D4vZd1-9.mjs +0 -4
package/dist/index.cjs CHANGED
@@ -1,35 +1,23 @@
1
- const require_chunk = require('./chunk-fPmz2rbM.cjs');
2
- require('./hono-C14rpOEa.cjs');
3
- const require_ip = require('./ip-C17Qdq-G.cjs');
4
- const require_crypto = require('./crypto-DpSCnrTp.cjs');
5
- require('./json--tl7Grvs.cjs');
6
- const require_cookies = require('./cookies-BTl72THv.cjs');
7
- require('./logged-Dv3st5qc.cjs');
8
- const require_url = require('./url-Ce7CVaQD.cjs');
9
- require('./middleware-CWvRH4EW.cjs');
10
- require('./session-Cwrj4GfV.cjs');
11
- require('./origin-check-DjLTuZQ8.cjs');
12
- require('./email-verification-DI_0H4JC.cjs');
13
- require('./oauth2-5RL4cVNS.cjs');
14
- const require_state = require('./state-CvSihlVT.cjs');
15
- const require_social_providers = require('./social-providers-BmFOIIPk.cjs');
16
- const require_api = require('./api-CaRC1Gio.cjs');
17
- const require_request = require('./request-CPNlp-DK.cjs');
18
- require('./utils-44aDDP8f.cjs');
19
- require('./schema-CirKflVs.cjs');
20
- const require_kysely_adapter = require('./kysely-adapter-QZTx077T.cjs');
21
- const require_adapter_factory = require('./adapter-factory-D1I7joki.cjs');
22
- const require_db = require('./db-ChMbb_U-.cjs');
23
- require('./memory-adapter-17RZd5df.cjs');
24
- const require_defu = require('./defu-BmOYq4PU.cjs');
25
- let __faire_auth_core_env = require("@faire-auth/core/env");
26
- let __faire_auth_core_error = require("@faire-auth/core/error");
27
- let __faire_auth_core_static = require("@faire-auth/core/static");
28
- let __faire_auth_core_datatypes = require("@faire-auth/core/datatypes");
29
- let __better_fetch_fetch = require("@better-fetch/fetch");
30
- let __faire_auth_core_crypto = require("@faire-auth/core/crypto");
31
-
32
- //#region src/context/cloudflare.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_ip = require("./ip-DPydExzV.cjs");
3
+ const require_api = require("./api-LjfH6hQi.cjs");
4
+ const require_adapters_kysely_adapter_index = require("./adapters/kysely-adapter/index.cjs");
5
+ const require_crypto = require("./crypto-BITfWVwD.cjs");
6
+ const require_state = require("./state-2OrNjOO-.cjs");
7
+ const require_db_index = require("./db/index.cjs");
8
+ const require_adapter_factory = require("./adapter-factory-u8r3oTez.cjs");
9
+ const require_social_providers = require("./social-providers-D7w_7Ym8.cjs");
10
+ require("./utils-iX0Vy_UL.cjs");
11
+ const require_cookies = require("./cookies-DQ52rcOy.cjs");
12
+ const require_defu = require("./defu-DWS5RPWt.cjs");
13
+ const require_url = require("./url-DjCmCUHS.cjs");
14
+ let _faire_auth_core_env = require("@faire-auth/core/env");
15
+ let _faire_auth_core_error = require("@faire-auth/core/error");
16
+ let _faire_auth_core_static = require("@faire-auth/core/static");
17
+ let _faire_auth_core_datatypes = require("@faire-auth/core/datatypes");
18
+ let _better_fetch_fetch = require("@better-fetch/fetch");
19
+ let _faire_auth_core_crypto = require("@faire-auth/core/crypto");
20
+ // src/context/cloudflare.ts
33
21
  /**
34
22
  * Symbol used as an index in the global scope to set and retrieve the Cloudflare context
35
23
  *
@@ -44,9 +32,7 @@ const cloudflareContextSymbol = Symbol.for("__cloudflare-context__");
44
32
  function getCloudflareContext() {
45
33
  return globalThis[cloudflareContextSymbol];
46
34
  }
47
-
48
- //#endregion
49
- //#region src/telemetry/detectors/detect-auth-config.ts
35
+ // src/telemetry/detectors/detect-auth-config.ts
50
36
  function getTelemetryAuthConfig(options, context) {
51
37
  return {
52
38
  database: context?.database,
@@ -232,9 +218,7 @@ function getTelemetryAuthConfig(options, context) {
232
218
  }
233
219
  };
234
220
  }
235
-
236
- //#endregion
237
- //#region src/utils/package-json.ts
221
+ // src/utils/package-json.ts
238
222
  let packageJSONCache;
239
223
  async function readRootPackageJson() {
240
224
  if (packageJSONCache) return packageJSONCache;
@@ -273,9 +257,7 @@ async function getVersionFromLocalPackageJson(pkg) {
273
257
  async function getNameFromLocalPackageJson() {
274
258
  return (await readRootPackageJson())?.name;
275
259
  }
276
-
277
- //#endregion
278
- //#region src/telemetry/detectors/detect-database.ts
260
+ // src/telemetry/detectors/detect-database.ts
279
261
  const DATABASES = {
280
262
  pg: "postgresql",
281
263
  mysql: "mysql",
@@ -296,9 +278,7 @@ async function detectDatabase() {
296
278
  };
297
279
  }
298
280
  }
299
-
300
- //#endregion
301
- //#region src/telemetry/detectors/detect-framework.ts
281
+ // src/telemetry/detectors/detect-framework.ts
302
282
  const FRAMEWORKS = {
303
283
  next: "next",
304
284
  nuxt: "nuxt",
@@ -321,9 +301,7 @@ async function detectFramework() {
321
301
  };
322
302
  }
323
303
  }
324
-
325
- //#endregion
326
- //#region src/telemetry/detectors/detect-project-info.ts
304
+ // src/telemetry/detectors/detect-project-info.ts
327
305
  function detectPackageManager() {
328
306
  const userAgent = process.env.npm_config_user_agent;
329
307
  if (!userAgent) return;
@@ -335,11 +313,9 @@ function detectPackageManager() {
335
313
  version: pmSpec.substring(separatorPos + 1)
336
314
  };
337
315
  }
338
-
339
- //#endregion
340
- //#region src/telemetry/detectors/detect-system-info.ts
316
+ // src/telemetry/detectors/detect-system-info.ts
341
317
  function getVendor() {
342
- const hasAny = (...keys) => keys.some((k) => Boolean(__faire_auth_core_env.env[k]));
318
+ const hasAny = (...keys) => keys.some((k) => Boolean(_faire_auth_core_env.env[k]));
343
319
  if (hasAny("CF_PAGES", "CF_PAGES_URL", "CF_ACCOUNT_ID") || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers") return "cloudflare";
344
320
  if (hasAny("VERCEL", "VERCEL_URL", "VERCEL_ENV")) return "vercel";
345
321
  if (hasAny("NETLIFY", "NETLIFY_URL")) return "netlify";
@@ -449,11 +425,9 @@ async function isInsideContainer() {
449
425
  return isInsideContainerCached;
450
426
  }
451
427
  function isCI() {
452
- return __faire_auth_core_env.env.CI !== "false" && ("BUILD_ID" in __faire_auth_core_env.env || "BUILD_NUMBER" in __faire_auth_core_env.env || "CI" in __faire_auth_core_env.env || "CI_APP_ID" in __faire_auth_core_env.env || "CI_BUILD_ID" in __faire_auth_core_env.env || "CI_BUILD_NUMBER" in __faire_auth_core_env.env || "CI_NAME" in __faire_auth_core_env.env || "CONTINUOUS_INTEGRATION" in __faire_auth_core_env.env || "RUN_ID" in __faire_auth_core_env.env);
428
+ return _faire_auth_core_env.env.CI !== "false" && ("BUILD_ID" in _faire_auth_core_env.env || "BUILD_NUMBER" in _faire_auth_core_env.env || "CI" in _faire_auth_core_env.env || "CI_APP_ID" in _faire_auth_core_env.env || "CI_BUILD_ID" in _faire_auth_core_env.env || "CI_BUILD_NUMBER" in _faire_auth_core_env.env || "CI_NAME" in _faire_auth_core_env.env || "CONTINUOUS_INTEGRATION" in _faire_auth_core_env.env || "RUN_ID" in _faire_auth_core_env.env);
453
429
  }
454
-
455
- //#endregion
456
- //#region src/telemetry/detectors/detect-runtime.ts
430
+ // src/telemetry/detectors/detect-runtime.ts
457
431
  function detectRuntime() {
458
432
  if (typeof Deno !== "undefined") return {
459
433
  name: "deno",
@@ -473,37 +447,33 @@ function detectRuntime() {
473
447
  };
474
448
  }
475
449
  function detectEnvironment() {
476
- return (0, __faire_auth_core_env.getEnvVar)("NODE_ENV") === "production" ? "production" : isCI() ? "ci" : (0, __faire_auth_core_env.isTest)() ? "test" : "development";
450
+ return (0, _faire_auth_core_env.getEnvVar)("NODE_ENV") === "production" ? "production" : isCI() ? "ci" : (0, _faire_auth_core_env.isTest)() ? "test" : "development";
477
451
  }
478
-
479
- //#endregion
480
- //#region src/telemetry/project-id.ts
452
+ // src/telemetry/project-id.ts
481
453
  let projectIdCached = null;
482
454
  async function getProjectId(baseUrl) {
483
455
  if (projectIdCached) return projectIdCached;
484
456
  const projectName = await getNameFromLocalPackageJson();
485
457
  if (projectName) {
486
- projectIdCached = await (0, __faire_auth_core_datatypes.hashToBase64)(baseUrl ? baseUrl + projectName : projectName);
458
+ projectIdCached = await (0, _faire_auth_core_datatypes.hashToBase64)(baseUrl ? baseUrl + projectName : projectName);
487
459
  return projectIdCached;
488
460
  }
489
461
  if (baseUrl) {
490
- projectIdCached = await (0, __faire_auth_core_datatypes.hashToBase64)(baseUrl);
462
+ projectIdCached = await (0, _faire_auth_core_datatypes.hashToBase64)(baseUrl);
491
463
  return projectIdCached;
492
464
  }
493
- projectIdCached = (0, __faire_auth_core_crypto.generateId)(32);
465
+ projectIdCached = (0, _faire_auth_core_crypto.generateId)(32);
494
466
  return projectIdCached;
495
467
  }
496
-
497
- //#endregion
498
- //#region src/telemetry/index.ts
468
+ // src/telemetry/index.ts
499
469
  function createTelemetry(options, context) {
500
- const debugEnabled = options.telemetry?.debug || (0, __faire_auth_core_env.getBooleanEnvVar)("FAIRE_AUTH_TELEMETRY_DEBUG", false);
501
- const TELEMETRY_ENDPOINT = __faire_auth_core_env.ENV.FAIRE_AUTH_TELEMETRY_ENDPOINT;
470
+ const debugEnabled = options.telemetry?.debug || (0, _faire_auth_core_env.getBooleanEnvVar)("FAIRE_AUTH_TELEMETRY_DEBUG", false);
471
+ const TELEMETRY_ENDPOINT = _faire_auth_core_env.ENV.FAIRE_AUTH_TELEMETRY_ENDPOINT;
502
472
  const track = async (event) => {
503
473
  try {
504
474
  if (context?.customTrack) await context.customTrack(event);
505
- else if (debugEnabled) await Promise.resolve(__faire_auth_core_env.logger.info("telemetry event", JSON.stringify(event, null, 2)));
506
- else await (0, __better_fetch_fetch.betterFetch)(TELEMETRY_ENDPOINT, {
475
+ else if (debugEnabled) await Promise.resolve(_faire_auth_core_env.logger.info("telemetry event", JSON.stringify(event, null, 2)));
476
+ else await (0, _better_fetch_fetch.betterFetch)(TELEMETRY_ENDPOINT, {
507
477
  method: "POST",
508
478
  body: event
509
479
  });
@@ -511,14 +481,14 @@ function createTelemetry(options, context) {
511
481
  };
512
482
  const isEnabled = () => {
513
483
  const telemetryEnabled = options.telemetry?.enabled !== void 0 ? options.telemetry.enabled : false;
514
- return ((0, __faire_auth_core_env.getBooleanEnvVar)("FAIRE_AUTH_TELEMETRY", false) || telemetryEnabled) && (context?.skipTestCheck || !(0, __faire_auth_core_env.isTest)());
484
+ return ((0, _faire_auth_core_env.getBooleanEnvVar)("FAIRE_AUTH_TELEMETRY", false) || telemetryEnabled) && (context?.skipTestCheck || !(0, _faire_auth_core_env.isTest)());
515
485
  };
516
486
  let initDone;
517
487
  let anonymousId;
518
488
  let payload;
519
489
  const enabled = isEnabled();
520
490
  async function ensureInitialized() {
521
- if (initDone) return initDone;
491
+ if (initDone !== void 0) return initDone;
522
492
  initDone = (async () => {
523
493
  anonymousId = await getProjectId(options.baseURL);
524
494
  payload = {
@@ -550,18 +520,16 @@ function createTelemetry(options, context) {
550
520
  }
551
521
  };
552
522
  }
553
-
554
- //#endregion
555
- //#region src/init.ts
523
+ // src/init.ts
556
524
  const getInternalPlugins = (options) => {
557
525
  const plugins = [];
558
526
  if (options.advanced?.crossSubDomainCookies?.enabled === true) {}
559
527
  return plugins;
560
528
  };
561
- const loadSecret = (options, logger$2) => {
562
- const secret = options.secret ?? __faire_auth_core_env.env["FAIRE_AUTH_SECRET"] ?? __faire_auth_core_env.env["AUTH_SECRET"] ?? __faire_auth_core_static.DEFAULT_SECRET;
563
- if (secret === __faire_auth_core_static.DEFAULT_SECRET) {
564
- if ((0, __faire_auth_core_env.isProduction)()) logger$2.error("You are using the default secret. Please set `FAIRE_AUTH_SECRET` in your environment variables or pass `secret` in your auth config.");
529
+ const loadSecret = (options, logger) => {
530
+ const secret = options.secret ?? _faire_auth_core_env.env["FAIRE_AUTH_SECRET"] ?? _faire_auth_core_env.env["AUTH_SECRET"] ?? _faire_auth_core_static.DEFAULT_SECRET;
531
+ if (secret === _faire_auth_core_static.DEFAULT_SECRET) {
532
+ if ((0, _faire_auth_core_env.isProduction)()) logger.error("You are using the default secret. Please set `FAIRE_AUTH_SECRET` in your environment variables or pass `secret` in your auth config.");
565
533
  }
566
534
  return secret;
567
535
  };
@@ -572,7 +540,7 @@ const runPluginInit = (ctx, options) => {
572
540
  const result = plugin.init(context);
573
541
  if (typeof result === "object") {
574
542
  if (result.options) {
575
- const { databaseHooks,...restOpts } = result.options;
543
+ const { databaseHooks, ...restOpts } = result.options;
576
544
  if (result.options.databaseHooks) dbHooks.push(result.options.databaseHooks);
577
545
  options = require_defu.defu(options, restOpts);
578
546
  }
@@ -583,7 +551,7 @@ const runPluginInit = (ctx, options) => {
583
551
  }
584
552
  }
585
553
  if (options.databaseHooks) dbHooks.push(options.databaseHooks);
586
- context.internalAdapter = require_db.createInternalAdapter(ctx.adapter, options, context, dbHooks);
554
+ context.internalAdapter = require_db_index.createInternalAdapter(ctx.adapter, options, context, dbHooks);
587
555
  return [context, options];
588
556
  };
589
557
  const initGenerateId = (options) => {
@@ -593,22 +561,22 @@ const initGenerateId = (options) => {
593
561
  model,
594
562
  ...size != null ? { size } : {}
595
563
  });
596
- return (0, __faire_auth_core_crypto.generateId)(size);
564
+ return (0, _faire_auth_core_crypto.generateId)(size);
597
565
  };
598
566
  };
599
567
  const init = (options) => {
600
568
  const baseURL = require_url.getBaseURL(options.baseURL, options.basePath);
601
- if (baseURL == null && !(0, __faire_auth_core_env.isDevelopment)() && !(0, __faire_auth_core_env.isTest)()) throw new Error("baseURL is required for auth context");
602
- const adapter = require_db.getAdapter(options);
569
+ if (baseURL == null && !(0, _faire_auth_core_env.isDevelopment)() && !(0, _faire_auth_core_env.isTest)()) throw new Error("baseURL is required for auth context");
570
+ const adapter = require_db_index.getAdapter(options);
603
571
  const internalPlugins = getInternalPlugins(options);
604
- const logger$2 = (0, __faire_auth_core_env.createLogger)(options.logger);
605
- const secret = loadSecret(options, logger$2);
606
- const generateId$1 = initGenerateId(options);
572
+ const logger = (0, _faire_auth_core_env.createLogger)(options.logger);
573
+ const secret = loadSecret(options, logger);
574
+ const generateId = initGenerateId(options);
607
575
  const secondaryStorage = options.secondaryStorage;
608
576
  const sessionConfig = {
609
- updateAge: options.session?.updateAge ?? 1440 * 60,
610
- expiresIn: options.session?.expiresIn ?? 3600 * 24 * 7,
611
- freshAge: options.session?.freshAge ?? 3600 * 24,
577
+ updateAge: options.session?.updateAge ?? 86400,
578
+ expiresIn: options.session?.expiresIn ?? 604800,
579
+ freshAge: options.session?.freshAge ?? 86400,
612
580
  cookieRefreshCache: (() => {
613
581
  const refreshCache = options.session?.cookieCache?.refreshCache;
614
582
  const maxAge = options.session?.cookieCache?.maxAge ?? 300;
@@ -625,7 +593,7 @@ const init = (options) => {
625
593
  };
626
594
  const rateLimit = {
627
595
  ...options.rateLimit,
628
- enabled: options.rateLimit?.enabled ?? (0, __faire_auth_core_env.isProduction)(),
596
+ enabled: options.rateLimit?.enabled ?? (0, _faire_auth_core_env.isProduction)(),
629
597
  window: options.rateLimit?.window ?? 10,
630
598
  max: options.rateLimit?.max ?? 100,
631
599
  storage: options.rateLimit?.storage ?? (options.secondaryStorage ? "secondary-storage" : "memory")
@@ -635,12 +603,12 @@ const init = (options) => {
635
603
  options.basePath ??= "/api/auth";
636
604
  options.plugins ??= [];
637
605
  options.plugins.push(...internalPlugins);
638
- return runPluginInit({
606
+ const context = {
639
607
  appName: options.appName ?? "Faire Auth",
640
608
  socialProviders: Object.entries(options.socialProviders ?? {}).map(([key, value]) => {
641
609
  if (value == null) return null;
642
610
  if (value.enabled === false) return null;
643
- if (!value.clientId) logger$2.warn(`Social provider ${key} is missing clientId or clientSecret`);
611
+ if (!value.clientId) logger.warn(`Social provider ${key} is missing clientId or clientSecret`);
644
612
  if (!(key in require_social_providers.social_providers_exports.socialProviders)) throw new Error(`${key} does not exist in known social providers`);
645
613
  const provider = require_social_providers.social_providers_exports.socialProviders[key](value);
646
614
  if (value.disableImplicitSignUp) provider.disableImplicitSignUp = value.disableImplicitSignUp;
@@ -652,9 +620,9 @@ const init = (options) => {
652
620
  sessionConfig,
653
621
  secret,
654
622
  authCookies: require_cookies.getCookies(options),
655
- logger: logger$2,
623
+ logger,
656
624
  rateLimit,
657
- generateId: generateId$1,
625
+ generateId,
658
626
  password: {
659
627
  hash: options.emailAndPassword?.password?.hash ?? require_crypto.crypto_exports.hashPassword,
660
628
  verify: options.emailAndPassword?.password?.verify ?? require_crypto.crypto_exports.verifyPassword,
@@ -666,28 +634,27 @@ const init = (options) => {
666
634
  },
667
635
  newSession: null,
668
636
  adapter,
669
- internalAdapter: require_db.createInternalAdapter(adapter, options, {
670
- logger: logger$2,
671
- generateId: generateId$1,
637
+ internalAdapter: require_db_index.createInternalAdapter(adapter, options, {
638
+ logger,
639
+ generateId,
672
640
  sessionConfig,
673
641
  ...secondaryStorage && { secondaryStorage }
674
642
  }, options.databaseHooks ? [options.databaseHooks] : []),
675
643
  createAuthCookie: require_cookies.createCookieCreator(options),
676
644
  runMigrations: async () => {
677
- if (!options.database || "updateMany" in options.database) throw new __faire_auth_core_error.FaireAuthError("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");
678
- const { runMigrations } = await require_db.getMigrations(options);
645
+ if (!options.database || "updateMany" in options.database) throw new _faire_auth_core_error.FaireAuthError("Database is not provided or it's an adapter. Migrations are only supported with a database instance.");
646
+ const { runMigrations } = await require_db_index.getMigrations(options);
679
647
  await runMigrations();
680
648
  },
681
649
  publishTelemetry: createTelemetry(options, {
682
650
  adapter: adapter.id,
683
- database: typeof options.database === "function" ? "adapter" : require_kysely_adapter.getKyselyDatabaseType(options.database) || "unknown"
651
+ database: typeof options.database === "function" ? "adapter" : require_adapters_kysely_adapter_index.getKyselyDatabaseType(options.database) || "unknown"
684
652
  }).publish,
685
653
  ...secondaryStorage && { secondaryStorage }
686
- }, options);
654
+ };
655
+ return runPluginInit(context, options);
687
656
  };
688
-
689
- //#endregion
690
- //#region src/auth.ts
657
+ // src/auth.ts
691
658
  function defineOptions(config) {
692
659
  return config;
693
660
  }
@@ -697,7 +664,7 @@ const faireAuth = (options) => {
697
664
  return {
698
665
  handler: (request, Env, executionCtx) => {
699
666
  const cfCtx = getCloudflareContext();
700
- return app.fetch(request, Object.assign(__faire_auth_core_env.ENV, cfCtx?.env, Env), executionCtx ?? cfCtx?.ctx);
667
+ return app.fetch(request, Env ?? cfCtx?.env ?? _faire_auth_core_env.ENV, executionCtx ?? cfCtx?.ctx);
701
668
  },
702
669
  app,
703
670
  api,
@@ -715,65 +682,63 @@ const faireAuth = (options) => {
715
682
  };
716
683
  return acc;
717
684
  }, {}),
718
- ...__faire_auth_core_error.BASE_ERROR_CODES
685
+ ..._faire_auth_core_error.BASE_ERROR_CODES
719
686
  }
720
687
  };
721
688
  };
722
-
723
- //#endregion
724
- Object.defineProperty(exports, 'APIError', {
725
- enumerable: true,
726
- get: function () {
727
- return __faire_auth_core_error.APIError;
728
- }
689
+ Object.defineProperty(exports, "APIError", {
690
+ enumerable: true,
691
+ get: function() {
692
+ return _faire_auth_core_error.APIError;
693
+ }
729
694
  });
730
- Object.defineProperty(exports, 'ENV', {
731
- enumerable: true,
732
- get: function () {
733
- return __faire_auth_core_env.ENV;
734
- }
695
+ Object.defineProperty(exports, "ENV", {
696
+ enumerable: true,
697
+ get: function() {
698
+ return _faire_auth_core_env.ENV;
699
+ }
735
700
  });
736
- Object.defineProperty(exports, 'FaireAuthError', {
737
- enumerable: true,
738
- get: function () {
739
- return __faire_auth_core_error.FaireAuthError;
740
- }
701
+ Object.defineProperty(exports, "FaireAuthError", {
702
+ enumerable: true,
703
+ get: function() {
704
+ return _faire_auth_core_error.FaireAuthError;
705
+ }
741
706
  });
742
- Object.defineProperty(exports, 'MissingDependencyError', {
743
- enumerable: true,
744
- get: function () {
745
- return __faire_auth_core_error.MissingDependencyError;
746
- }
707
+ Object.defineProperty(exports, "MissingDependencyError", {
708
+ enumerable: true,
709
+ get: function() {
710
+ return _faire_auth_core_error.MissingDependencyError;
711
+ }
747
712
  });
748
- Object.defineProperty(exports, 'createLogger', {
749
- enumerable: true,
750
- get: function () {
751
- return __faire_auth_core_env.createLogger;
752
- }
713
+ Object.defineProperty(exports, "createLogger", {
714
+ enumerable: true,
715
+ get: function() {
716
+ return _faire_auth_core_env.createLogger;
717
+ }
753
718
  });
754
719
  exports.createTelemetry = createTelemetry;
755
720
  exports.defineOptions = defineOptions;
756
721
  exports.faireAuth = faireAuth;
757
- Object.defineProperty(exports, 'generateId', {
758
- enumerable: true,
759
- get: function () {
760
- return __faire_auth_core_crypto.generateId;
761
- }
722
+ Object.defineProperty(exports, "generateId", {
723
+ enumerable: true,
724
+ get: function() {
725
+ return _faire_auth_core_crypto.generateId;
726
+ }
762
727
  });
763
- Object.defineProperty(exports, 'generateRandomString', {
764
- enumerable: true,
765
- get: function () {
766
- return __faire_auth_core_crypto.generateRandomString;
767
- }
728
+ Object.defineProperty(exports, "generateRandomString", {
729
+ enumerable: true,
730
+ get: function() {
731
+ return _faire_auth_core_crypto.generateRandomString;
732
+ }
768
733
  });
769
734
  exports.generateState = require_state.generateState;
770
735
  exports.getCurrentAdapter = require_ip.getCurrentAdapter;
771
736
  exports.getTelemetryAuthConfig = getTelemetryAuthConfig;
772
- Object.defineProperty(exports, 'logger', {
773
- enumerable: true,
774
- get: function () {
775
- return __faire_auth_core_env.logger;
776
- }
737
+ Object.defineProperty(exports, "logger", {
738
+ enumerable: true,
739
+ get: function() {
740
+ return _faire_auth_core_env.logger;
741
+ }
777
742
  });
778
- exports.mergeHeaders = require_request.mergeHeaders;
779
- exports.parseState = require_state.parseState;
743
+ exports.mergeHeaders = require_defu.mergeHeaders;
744
+ exports.parseState = require_state.parseState;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { $ as Client, A as logger, C as InternalLogger, Ct as InferPluginRateLimit, D as createLogger, E as Logger, F as DTO, H as InferApp, I as FaireAuthOptions, L as FaireAuthRateLimitOptions, M as generateState, N as parseState, O as generateId, P as CustomRules, Q as CamelCase, R as Hooks, S as ENV, St as InferPluginMiddleware, T as LogLevel, U as InferClient, V as InferAPI, Z as AtomListener, _ as MissingDependencyError, _t as FaireAuthPlugin, a as InferPluginTypes, an as AuthContext, at as InferAdditionalAsClient, b as createTelemetry, bt as InferPluginErrorCodes, c as Models, cn as Adapter, ct as InferPluginsFromClient, d as WithJsDoc, dn as DBAdapter, dt as IsSignal, et as ClientOptions, f as defineOptions, fn as DBAdapterInstance, ft as RevalidateOptions, g as FaireAuthError, gn as Where, gt as AuthPluginSchema, h as APIError, hn as TransactionAdapter, i as AdditionalUserFieldsOutput, it as InferActions, j as mergeHeaders, k as generateRandomString, l as RateLimit, ln as AdapterInstance, lt as InferSessionFromClient, mn as DBTransactionAdapter, mt as Store, n as AdditionalSessionFieldsOutput, nn as AuthFactory, nt as FaireAuthClientPlugin, o as InferSession, on as init, ot as InferAdditionalFromClient, p as faireAuth, pn as DBAdapterSchemaCreation, pt as SessionQueryParams, r as AdditionalUserFieldsInput, rn as AuthProperties, rt as Inc, s as InferUser, sn as getCurrentAdapter, st as InferErrorCodes, t as AdditionalSessionFieldsInput, tn as AuthEndpoint, tt as CreateSchemaType, u as Auth, un as AdapterSchemaCreation, ut as InferUserFromClient, v as OpenAPIHono, vt as InferOptionSchema, w as LogHandlerParams, x as TelemetryEvent, xt as InferPluginHooks, y as getTelemetryAuthConfig, yt as InferPluginDTO, z as Middleware } from "./index-CsWF3f7U.cjs";
2
- import { n as Execute, r as ToExecFull, t as ContextVars } from "./hono-DOM31WQz.cjs";
3
- export * from "zod";
4
- export * from "zod/v4/core";
5
- export { APIError, Adapter, AdapterInstance, AdapterSchemaCreation, AdditionalSessionFieldsInput, AdditionalSessionFieldsOutput, AdditionalUserFieldsInput, AdditionalUserFieldsOutput, AtomListener, Auth, AuthContext, AuthEndpoint, AuthFactory, AuthPluginSchema, AuthProperties, CamelCase, Client, ClientOptions, ContextVars, CreateSchemaType, CustomRules, DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, DTO, ENV, Execute, FaireAuthClientPlugin, FaireAuthError, FaireAuthOptions, FaireAuthPlugin, FaireAuthRateLimitOptions, Hooks, Inc, InferAPI, InferActions, InferAdditionalAsClient, InferAdditionalFromClient, InferApp, InferClient, InferErrorCodes, InferOptionSchema, InferPluginDTO, InferPluginErrorCodes, InferPluginHooks, InferPluginMiddleware, InferPluginRateLimit, InferPluginTypes, InferPluginsFromClient, InferSession, InferSessionFromClient, InferUser, InferUserFromClient, InternalLogger, IsSignal, LogHandlerParams, LogLevel, Logger, Middleware, MissingDependencyError, Models, OpenAPIHono, RateLimit, RevalidateOptions, SessionQueryParams, Store, TelemetryEvent, ToExecFull, TransactionAdapter, Where, WithJsDoc, createLogger, createTelemetry, defineOptions, faireAuth, generateId, generateRandomString, generateState, getCurrentAdapter, getTelemetryAuthConfig, init, logger, mergeHeaders, parseState };
1
+ import { $ as FaireAuthClientPlugin, A as InferSession, B as InferClient, C as faireAuth, Ct as InferPluginErrorCodes, D as AdditionalUserFieldsInput, E as AdditionalSessionFieldsOutput, Et as InferPluginRateLimit, F as Execute, I as ToExecFull, J as AtomListener, M as Models, N as RateLimit, O as AdditionalUserFieldsOutput, P as ContextVars, Q as CreateSchemaType, R as InferAPI, S as defineOptions, St as InferPluginDTO, T as AdditionalSessionFieldsInput, Tt as InferPluginMiddleware, X as Client, Y as CamelCase, Z as ClientOptions, _ as mergeHeaders, _n as TransactionAdapter, _t as Hooks, a as getTelemetryAuthConfig, an as AuthFactory, at as InferPluginsFromClient, b as Auth, bt as FaireAuthPlugin, c as ENV, cn as AuthContext, ct as IsSignal, d as LogLevel, dn as AdapterInstance, dt as Store, et as Inc, f as Logger, fn as AdapterSchemaCreation, g as logger, gn as DBTransactionAdapter, gt as FaireAuthRateLimitOptions, h as generateRandomString, hn as DBAdapterSchemaCreation, ht as FaireAuthOptions, i as OpenAPIHono, in as AuthEndpoint, it as InferErrorCodes, j as InferUser, k as InferPluginTypes, l as InternalLogger, ln as init, lt as RevalidateOptions, m as generateId, mn as DBAdapterInstance, mt as DTO, n as FaireAuthError, nt as InferAdditionalAsClient, o as createTelemetry, on as AuthProperties, ot as InferSessionFromClient, p as createLogger, pn as DBAdapter, pt as CustomRules, r as MissingDependencyError, rt as InferAdditionalFromClient, s as TelemetryEvent, st as InferUserFromClient, t as APIError, tt as InferActions, u as LogHandlerParams, un as Adapter, ut as SessionQueryParams, v as generateState, vn as Where, vt as Middleware, wt as InferPluginHooks, x as WithJsDoc, xt as InferOptionSchema, y as parseState, yn as getCurrentAdapter, yt as AuthPluginSchema, z as InferApp } from "./shared.cjs";
2
+ export type * from "zod";
3
+ export type * from "zod/v4/core";
4
+ export { APIError, type Adapter, type AdapterInstance, type AdapterSchemaCreation, type AdditionalSessionFieldsInput, type AdditionalSessionFieldsOutput, type AdditionalUserFieldsInput, type AdditionalUserFieldsOutput, type AtomListener, Auth, type AuthContext, type AuthEndpoint, type AuthFactory, type AuthPluginSchema, type AuthProperties, type CamelCase, type Client, type ClientOptions, type ContextVars, type CreateSchemaType, type CustomRules, type DBAdapter, type DBAdapterInstance, type DBAdapterSchemaCreation, type DBTransactionAdapter, type DTO, ENV, type Execute, type FaireAuthClientPlugin, FaireAuthError, type FaireAuthOptions, type FaireAuthPlugin, type FaireAuthRateLimitOptions, type Hooks, type Inc, type InferAPI, type InferActions, type InferAdditionalAsClient, type InferAdditionalFromClient, type InferApp, type InferClient, type InferErrorCodes, type InferOptionSchema, type InferPluginDTO, type InferPluginErrorCodes, type InferPluginHooks, type InferPluginMiddleware, type InferPluginRateLimit, type InferPluginTypes, type InferPluginsFromClient, type InferSession, type InferSessionFromClient, type InferUser, type InferUserFromClient, type InternalLogger, type IsSignal, type LogHandlerParams, type LogLevel, type Logger, type Middleware, MissingDependencyError, type Models, type OpenAPIHono, type RateLimit, type RevalidateOptions, type SessionQueryParams, type Store, type TelemetryEvent, type ToExecFull, type TransactionAdapter, type Where, WithJsDoc, createLogger, createTelemetry, defineOptions, faireAuth, generateId, generateRandomString, generateState, getCurrentAdapter, getTelemetryAuthConfig, type init, logger, mergeHeaders, parseState };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import { $ as Client, A as logger, C as InternalLogger, Ct as InferPluginRateLimit, D as createLogger, E as Logger, F as DTO, H as InferApp, I as FaireAuthOptions, L as FaireAuthRateLimitOptions, M as generateState, N as parseState, O as generateId, P as CustomRules, Q as CamelCase, R as Hooks, S as ENV, St as InferPluginMiddleware, T as LogLevel, U as InferClient, V as InferAPI, Z as AtomListener, _ as MissingDependencyError, _t as FaireAuthPlugin, a as InferPluginTypes, an as AuthContext, at as InferAdditionalAsClient, b as createTelemetry, bt as InferPluginErrorCodes, c as Models, cn as Adapter, ct as InferPluginsFromClient, d as WithJsDoc, dn as DBAdapter, dt as IsSignal, et as ClientOptions, f as defineOptions, fn as DBAdapterInstance, ft as RevalidateOptions, g as FaireAuthError, gn as Where, gt as AuthPluginSchema, h as APIError, hn as TransactionAdapter, i as AdditionalUserFieldsOutput, it as InferActions, j as mergeHeaders, k as generateRandomString, l as RateLimit, ln as AdapterInstance, lt as InferSessionFromClient, mn as DBTransactionAdapter, mt as Store, n as AdditionalSessionFieldsOutput, nn as AuthFactory, nt as FaireAuthClientPlugin, o as InferSession, on as init, ot as InferAdditionalFromClient, p as faireAuth, pn as DBAdapterSchemaCreation, pt as SessionQueryParams, r as AdditionalUserFieldsInput, rn as AuthProperties, rt as Inc, s as InferUser, sn as getCurrentAdapter, st as InferErrorCodes, t as AdditionalSessionFieldsInput, tn as AuthEndpoint, tt as CreateSchemaType, u as Auth, un as AdapterSchemaCreation, ut as InferUserFromClient, v as OpenAPIHono, vt as InferOptionSchema, w as LogHandlerParams, x as TelemetryEvent, xt as InferPluginHooks, y as getTelemetryAuthConfig, yt as InferPluginDTO, z as Middleware } from "./index-rFv8Hxld.mjs";
2
- import { n as Execute, r as ToExecFull, t as ContextVars } from "./hono-D0VqxVy1.mjs";
3
- export * from "zod";
4
- export * from "zod/v4/core";
5
- export { APIError, Adapter, AdapterInstance, AdapterSchemaCreation, AdditionalSessionFieldsInput, AdditionalSessionFieldsOutput, AdditionalUserFieldsInput, AdditionalUserFieldsOutput, AtomListener, Auth, AuthContext, AuthEndpoint, AuthFactory, AuthPluginSchema, AuthProperties, CamelCase, Client, ClientOptions, ContextVars, CreateSchemaType, CustomRules, DBAdapter, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, DTO, ENV, Execute, FaireAuthClientPlugin, FaireAuthError, FaireAuthOptions, FaireAuthPlugin, FaireAuthRateLimitOptions, Hooks, Inc, InferAPI, InferActions, InferAdditionalAsClient, InferAdditionalFromClient, InferApp, InferClient, InferErrorCodes, InferOptionSchema, InferPluginDTO, InferPluginErrorCodes, InferPluginHooks, InferPluginMiddleware, InferPluginRateLimit, InferPluginTypes, InferPluginsFromClient, InferSession, InferSessionFromClient, InferUser, InferUserFromClient, InternalLogger, IsSignal, LogHandlerParams, LogLevel, Logger, Middleware, MissingDependencyError, Models, OpenAPIHono, RateLimit, RevalidateOptions, SessionQueryParams, Store, TelemetryEvent, ToExecFull, TransactionAdapter, Where, WithJsDoc, createLogger, createTelemetry, defineOptions, faireAuth, generateId, generateRandomString, generateState, getCurrentAdapter, getTelemetryAuthConfig, init, logger, mergeHeaders, parseState };
1
+ import { $ as CreateSchemaType, A as generateState, B as InferPluginTypes, C as LogLevel, Ct as InferPluginDTO, D as generateRandomString, Dt as InferPluginRateLimit, E as generateId, Et as InferPluginMiddleware, F as faireAuth, H as InferUser, I as AdditionalSessionFieldsInput, K as getCurrentAdapter, L as AdditionalSessionFieldsOutput, M as Auth, N as WithJsDoc, O as logger, P as defineOptions, Q as ClientOptions, R as AdditionalUserFieldsInput, S as LogHandlerParams, St as InferOptionSchema, T as createLogger, Tt as InferPluginHooks, U as Models, V as InferSession, W as RateLimit, X as CamelCase, Y as AtomListener, Z as Client, _ as getTelemetryAuthConfig, _n as DBTransactionAdapter, _t as FaireAuthRateLimitOptions, a as InferAPI, an as AuthEndpoint, at as InferErrorCodes, b as ENV, bt as AuthPluginSchema, ct as InferUserFromClient, dn as Adapter, dt as SessionQueryParams, et as FaireAuthClientPlugin, fn as AdapterInstance, ft as Store, g as OpenAPIHono, gn as DBAdapterSchemaCreation, gt as FaireAuthOptions, h as MissingDependencyError, hn as DBAdapterInstance, ht as DTO, it as InferAdditionalFromClient, j as parseState, k as mergeHeaders, ln as AuthContext, lt as IsSignal, m as FaireAuthError, mn as DBAdapter, mt as CustomRules, n as Execute, nt as InferActions, o as InferApp, on as AuthFactory, ot as InferPluginsFromClient, p as APIError, pn as AdapterSchemaCreation, r as ToExecFull, rt as InferAdditionalAsClient, s as InferClient, sn as AuthProperties, st as InferSessionFromClient, t as ContextVars, tt as Inc, un as init, ut as RevalidateOptions, v as createTelemetry, vn as TransactionAdapter, vt as Hooks, w as Logger, wt as InferPluginErrorCodes, x as InternalLogger, xt as FaireAuthPlugin, y as TelemetryEvent, yn as Where, yt as Middleware, z as AdditionalUserFieldsOutput } from "./shared.mjs";
2
+ export type * from "zod";
3
+ export type * from "zod/v4/core";
4
+ export { APIError, type Adapter, type AdapterInstance, type AdapterSchemaCreation, type AdditionalSessionFieldsInput, type AdditionalSessionFieldsOutput, type AdditionalUserFieldsInput, type AdditionalUserFieldsOutput, type AtomListener, Auth, type AuthContext, type AuthEndpoint, type AuthFactory, type AuthPluginSchema, type AuthProperties, type CamelCase, type Client, type ClientOptions, type ContextVars, type CreateSchemaType, type CustomRules, type DBAdapter, type DBAdapterInstance, type DBAdapterSchemaCreation, type DBTransactionAdapter, type DTO, ENV, type Execute, type FaireAuthClientPlugin, FaireAuthError, type FaireAuthOptions, type FaireAuthPlugin, type FaireAuthRateLimitOptions, type Hooks, type Inc, type InferAPI, type InferActions, type InferAdditionalAsClient, type InferAdditionalFromClient, type InferApp, type InferClient, type InferErrorCodes, type InferOptionSchema, type InferPluginDTO, type InferPluginErrorCodes, type InferPluginHooks, type InferPluginMiddleware, type InferPluginRateLimit, type InferPluginTypes, type InferPluginsFromClient, type InferSession, type InferSessionFromClient, type InferUser, type InferUserFromClient, type InternalLogger, type IsSignal, type LogHandlerParams, type LogLevel, type Logger, type Middleware, MissingDependencyError, type Models, type OpenAPIHono, type RateLimit, type RevalidateOptions, type SessionQueryParams, type Store, type TelemetryEvent, type ToExecFull, type TransactionAdapter, type Where, WithJsDoc, createLogger, createTelemetry, defineOptions, faireAuth, generateId, generateRandomString, generateState, getCurrentAdapter, getTelemetryAuthConfig, type init, logger, mergeHeaders, parseState };