docs-i18n 0.9.2 → 0.11.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 (267) hide show
  1. package/admin/app/lib/auth-client.ts +21 -0
  2. package/admin/app/lib/auth.server.ts +62 -0
  3. package/admin/app/routeTree.gen.ts +21 -3
  4. package/admin/app/routes/index.tsx +68 -8
  5. package/admin/app/routes/login.tsx +207 -0
  6. package/admin/app/server.ts +23 -0
  7. package/admin/app/styles.css +146 -0
  8. package/admin/app/worker.ts +18 -0
  9. package/admin/dist/client/assets/auth-client-DqJZaFZR.js +3 -0
  10. package/admin/dist/client/assets/login-CQjkiBAF.js +1 -0
  11. package/admin/dist/client/assets/main-bc5tcdGg.js +18 -0
  12. package/admin/dist/client/assets/routes-CTPOG_v1.js +3 -0
  13. package/admin/dist/client/assets/{styles-DJ6QEJmN.css → styles-zS0BbO7e.css} +1 -1
  14. package/admin/dist/client/assets/useNavigate-CEOVvMjz.js +1 -0
  15. package/admin/dist/server/assets/{react-dom-CpO9xk_L.js → __tanstack-start-server-fn-resolver-qK0Yfvti.js} +83 -507
  16. package/admin/dist/server/assets/_tanstack-start-manifest_v-BgMVPPt2.js +21 -0
  17. package/admin/dist/server/assets/adapter-DjXlUL1J.js +2253 -0
  18. package/admin/dist/server/assets/auth-client-CoUpyQIM.js +807 -0
  19. package/admin/dist/server/assets/auth-dSAIPjBw.js +72 -0
  20. package/admin/dist/server/assets/auth.server-BLVDnTCZ.js +31352 -0
  21. package/admin/dist/server/assets/bun-sqlite-dialect-C8OaCWSL-BNNY-FoT.js +154 -0
  22. package/admin/dist/server/assets/compiled-query-CnFG_BVV.js +6967 -0
  23. package/admin/dist/server/assets/d1-sqlite-dialect-sYHNqBte-Bjz-cybU.js +115 -0
  24. package/admin/dist/server/assets/dist-C3-e8E2B.js +215 -0
  25. package/admin/dist/server/assets/dist-CUzFWZag.js +6039 -0
  26. package/admin/dist/server/assets/{init-DJr2glb3.js → dist-DBv71kqn.js} +21 -381
  27. package/admin/dist/server/assets/error-CASJ5tIm.js +457 -0
  28. package/admin/dist/server/assets/error-codes-BhMTGvV6.js +1153 -0
  29. package/admin/dist/server/assets/init-CJJUsPDL.js +49 -0
  30. package/admin/dist/server/assets/job-manager-D9Ab9hgu.js +179 -0
  31. package/admin/dist/server/assets/{jobs-bQfYqSk7.js → jobs-DrEe9YOj.js} +18 -5
  32. package/admin/dist/server/assets/kysely-adapter-YC8RFPyc.js +2 -0
  33. package/admin/dist/server/assets/login-SqzTMYOZ.js +228 -0
  34. package/admin/dist/server/assets/migrator-ZpVZslbq.js +2926 -0
  35. package/admin/dist/server/assets/{misc-DOk3t9vs.js → misc-BSoYldBT.js} +22 -9
  36. package/admin/dist/server/assets/{models-CBb8Owe5.js → models-CoviNHUP.js} +1 -1
  37. package/admin/dist/server/assets/node-sqlite-dialect-BJIaP6lL.js +154 -0
  38. package/admin/dist/server/assets/{router-DlU_fGDK.js → router-D-82slI-.js} +23 -11
  39. package/admin/dist/server/assets/{routes-BcfX6iub.js → routes-B1pNmxF3.js} +43 -29
  40. package/admin/dist/server/assets/{routes-pIM0fgUO.js → routes-C9huiZHw.js} +56 -22
  41. package/admin/dist/server/assets/sqlite-adapter-CL2EidjD.js +69 -0
  42. package/admin/dist/server/assets/{start-BS52hm79.js → start-BiybVoR2.js} +1 -1
  43. package/admin/dist/server/assets/status-B1AGLvHn.js +162 -0
  44. package/admin/dist/server/assets/status-D7PU72hm.js +262 -0
  45. package/admin/dist/server/assets/string-B4XlckmJ.js +6 -0
  46. package/admin/dist/server/assets/useNavigate-0H08s_Q2.js +29 -0
  47. package/admin/dist/server/assets/useRouter-BXJvr8to.js +508 -0
  48. package/admin/dist/server/server.js +70 -90
  49. package/admin/package.json +6 -1
  50. package/admin/server/functions/auth.ts +89 -0
  51. package/admin/server/functions/jobs.ts +30 -2
  52. package/admin/server/functions/misc.ts +25 -5
  53. package/admin/server/functions/status.ts +52 -3
  54. package/admin/server/index.ts +1 -1
  55. package/admin/server/init.ts +21 -9
  56. package/admin/server/services/d1-status.ts +282 -0
  57. package/admin/vite.config.ts +29 -15
  58. package/admin/wrangler.jsonc +16 -0
  59. package/package.json +1 -1
  60. package/template/app/components/markdown/Markdown.tsx +7 -1
  61. package/template/app/utils/docs.server.ts +37 -4
  62. package/template/app/worker.ts +16 -0
  63. package/template/content/docs-i18n/en/cli.md +9 -5
  64. package/template/content/docs-i18n/en/deployment.md +85 -68
  65. package/template/dist/client/assets/{Doc-CGhUfH9r.js → Doc-BKO69_nz.js} +1 -1
  66. package/template/dist/client/assets/{DocsLayout-CoPL9BM9.js → DocsLayout-BGugXxEQ.js} +1 -1
  67. package/template/dist/client/assets/{FileTabs-DsPkEUu7.js → FileTabs-4fZriOj4.js} +1 -1
  68. package/template/dist/client/assets/{Footer-4faHyha8.js → Footer-DYh1AfWA.js} +1 -1
  69. package/template/dist/client/assets/{FrameworkContent-Cxg_X_EP.js → FrameworkContent-rVvjxASn.js} +1 -1
  70. package/template/dist/client/assets/{MarkdownHeadingContext-CwDqQdSh.js → MarkdownHeadingContext-CdvUDZFU.js} +4 -4
  71. package/template/dist/client/assets/{PostNotFound-1ZaWdycM.js → PostNotFound-WoSYGsGu.js} +1 -1
  72. package/template/dist/client/assets/{_basePickBy-FbrKkfHa.js → _basePickBy-Dd7GuR7A.js} +1 -1
  73. package/template/dist/client/assets/{_baseUniq-g6ljCkn8.js → _baseUniq-DMxQLGFI.js} +1 -1
  74. package/template/dist/client/assets/_lang-3AqGszEy.js +1 -0
  75. package/template/dist/client/assets/_lang._project-COkrIqzH.js +1 -0
  76. package/template/dist/client/assets/_lang._project._version-B8vRZczu.js +1 -0
  77. package/template/dist/client/assets/{_lang._project._version.docs-DjZ_USgK.js → _lang._project._version.docs-DokNGgvU.js} +1 -1
  78. package/template/dist/client/assets/{_lang._project._version.docs._-CNb1EMFX.js → _lang._project._version.docs._-CXCNZzOb.js} +1 -1
  79. package/template/dist/client/assets/_lang._project._version.docs._-DR0WSQEb.js +1 -0
  80. package/template/dist/client/assets/_lang._project._version.docs.framework._framework._-C_Grro8r.js +1 -0
  81. package/template/dist/client/assets/{_lang._project._version.docs.framework._framework.index-CqyVy6eq.js → _lang._project._version.docs.framework._framework.index-DsYjXRdj.js} +1 -1
  82. package/template/dist/client/assets/{_lang._project._version.docs.framework.index-S3Frbfn4.js → _lang._project._version.docs.framework.index-DQX1lBi3.js} +1 -1
  83. package/template/dist/client/assets/{_lang._project.docs-CkmM5v1V.js → _lang._project.docs-DsYQj9jI.js} +1 -1
  84. package/template/dist/client/assets/_lang._project.docs._-DlM_D6DD.js +1 -0
  85. package/template/dist/client/assets/{_lang._project.docs._-BHYKQj_2.js → _lang._project.docs._-l2tTjx80.js} +1 -1
  86. package/template/dist/client/assets/_lang.blog-CEwEtalL.js +1 -0
  87. package/template/dist/client/assets/_lang.blog-D6YGC3tK.js +1 -0
  88. package/template/dist/client/assets/_lang.blog._-DgHu4oLy.js +1 -0
  89. package/template/dist/client/assets/{_lang.blog._-bXJwKw9E.js → _lang.blog._-Umz18sQE.js} +1 -1
  90. package/template/dist/client/assets/_lang.blog.index-C8LKUFtD.js +1 -0
  91. package/template/dist/client/assets/{_lang.blog.index-CdR5PZOo.js → _lang.blog.index-DzUqpOBE.js} +1 -1
  92. package/template/dist/client/assets/{_lang.docs-Cp3wmc9k.js → _lang.docs-CUh3R7DD.js} +1 -1
  93. package/template/dist/client/assets/{_lang.docs._-0bwIpeOn.js → _lang.docs._-DlgTPy3s.js} +1 -1
  94. package/template/dist/client/assets/_lang.docs._-DmaQE7lx.js +1 -0
  95. package/template/dist/client/assets/_lang.docs.framework._framework._-B4C4uDFp.js +1 -0
  96. package/template/dist/client/assets/{_lang.docs.framework._framework.index-BLgwIvQA.js → _lang.docs.framework._framework.index-DTg6Xd3p.js} +1 -1
  97. package/template/dist/client/assets/{_lang.docs.framework.index-CzW7Dul3.js → _lang.docs.framework.index-BQ2enasl.js} +1 -1
  98. package/template/dist/client/assets/{arc-B4lRpBfi.js → arc-DGPgC_QF.js} +1 -1
  99. package/template/dist/client/assets/{architectureDiagram-2XIMDMQ5-Coq1Gceq.js → architectureDiagram-2XIMDMQ5-yI53_GAi.js} +1 -1
  100. package/template/dist/client/assets/{blockDiagram-WCTKOSBZ-C7BGTzDN.js → blockDiagram-WCTKOSBZ-C3tr24zy.js} +1 -1
  101. package/template/dist/client/assets/{c4Diagram-IC4MRINW-xTBVTs0q.js → c4Diagram-IC4MRINW-DOA-mowm.js} +1 -1
  102. package/template/dist/client/assets/channel-DzZD7dUQ.js +1 -0
  103. package/template/dist/client/assets/{chunk-4BX2VUAB-DUUHBu75.js → chunk-4BX2VUAB-B6NSnNJJ.js} +1 -1
  104. package/template/dist/client/assets/{chunk-55IACEB6-MUxF_n9_.js → chunk-55IACEB6-CWYwArBH.js} +1 -1
  105. package/template/dist/client/assets/{chunk-FMBD7UC4-BWh6wvYo.js → chunk-FMBD7UC4-DSyn2wIW.js} +1 -1
  106. package/template/dist/client/assets/{chunk-JSJVCQXG-CLUdUV5u.js → chunk-JSJVCQXG-D83nm5W0.js} +1 -1
  107. package/template/dist/client/assets/{chunk-KX2RTZJC-CAlz_cXA.js → chunk-KX2RTZJC-DD7fN9e9.js} +1 -1
  108. package/template/dist/client/assets/{chunk-NQ4KR5QH-BaYKfUVy.js → chunk-NQ4KR5QH-C3YlYiU5.js} +1 -1
  109. package/template/dist/client/assets/{chunk-QZHKN3VN-NxDloxi5.js → chunk-QZHKN3VN-B7wBEuCG.js} +1 -1
  110. package/template/dist/client/assets/{chunk-WL4C6EOR-C2Ncbi5S.js → chunk-WL4C6EOR-ByA1FloT.js} +1 -1
  111. package/template/dist/client/assets/classDiagram-VBA2DB6C-CRozKaUD.js +1 -0
  112. package/template/dist/client/assets/classDiagram-v2-RAHNMMFH-CRozKaUD.js +1 -0
  113. package/template/dist/client/assets/clone-CGnOEl4E.js +1 -0
  114. package/template/dist/client/assets/{cose-bilkent-S5V4N54A-Ct9-ZJcv.js → cose-bilkent-S5V4N54A-nt_sXfWc.js} +1 -1
  115. package/template/dist/client/assets/{dagre-KLK3FWXG-u9dz8dcq.js → dagre-KLK3FWXG-DUsyMTPd.js} +1 -1
  116. package/template/dist/client/assets/{diagram-E7M64L7V-BXmcaktT.js → diagram-E7M64L7V-D5SAypX0.js} +1 -1
  117. package/template/dist/client/assets/{diagram-IFDJBPK2-CRlP5SeV.js → diagram-IFDJBPK2-WhP5c8Vz.js} +1 -1
  118. package/template/dist/client/assets/{diagram-P4PSJMXO-B9rJcj_H.js → diagram-P4PSJMXO-AMrwIlhf.js} +1 -1
  119. package/template/dist/client/assets/{erDiagram-INFDFZHY-DX-vee6w.js → erDiagram-INFDFZHY-BxifSpCV.js} +1 -1
  120. package/template/dist/client/assets/{flowDiagram-PKNHOUZH-CoBCSOFc.js → flowDiagram-PKNHOUZH-BMAowE9I.js} +1 -1
  121. package/template/dist/client/assets/{ganttDiagram-A5KZAMGK-BlqU_ghi.js → ganttDiagram-A5KZAMGK-Bay-0iRq.js} +1 -1
  122. package/template/dist/client/assets/{gitGraphDiagram-K3NZZRJ6-CntCsuti.js → gitGraphDiagram-K3NZZRJ6-Va91W3gw.js} +1 -1
  123. package/template/dist/client/assets/{graph-CZaxZzO8.js → graph-CbBYObK_.js} +1 -1
  124. package/template/dist/client/assets/{index-XelhTkgl.js → index-CF6qz2tX.js} +1 -1
  125. package/template/dist/client/assets/{infoDiagram-LFFYTUFH-_jCC8Jtt.js → infoDiagram-LFFYTUFH-Byd5C-4U.js} +1 -1
  126. package/template/dist/client/assets/{ishikawaDiagram-PHBUUO56-D3m_r2ig.js → ishikawaDiagram-PHBUUO56-DxOKnE1v.js} +1 -1
  127. package/template/dist/client/assets/{journeyDiagram-4ABVD52K-CvRNm03C.js → journeyDiagram-4ABVD52K-IRmt7RI4.js} +1 -1
  128. package/template/dist/client/assets/{kanban-definition-K7BYSVSG-nQcLuNSy.js → kanban-definition-K7BYSVSG-BjTVXn-R.js} +1 -1
  129. package/template/dist/client/assets/{layout-DZIdDq97.js → layout-Bbx6A0bC.js} +1 -1
  130. package/template/dist/client/assets/{linear-C2JcF5ss.js → linear-Df2eAW4A.js} +1 -1
  131. package/template/dist/client/assets/{main-C8MldI1o.js → main-DqZtiCro.js} +2 -2
  132. package/template/dist/client/assets/{mermaid.core-DlB0QBo2.js → mermaid.core-BIoiBcAA.js} +4 -4
  133. package/template/dist/client/assets/{mindmap-definition-YRQLILUH-D9OjtrBW.js → mindmap-definition-YRQLILUH-Btzz0iIP.js} +1 -1
  134. package/template/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
  135. package/template/dist/client/assets/{pieDiagram-SKSYHLDU-DoYJZfNJ.js → pieDiagram-SKSYHLDU-C2amrGtU.js} +1 -1
  136. package/template/dist/client/assets/{quadrantDiagram-337W2JSQ-Bs71YHJr.js → quadrantDiagram-337W2JSQ-EVgH9VuN.js} +1 -1
  137. package/template/dist/client/assets/{react-C0klD_r9.js → react-qvbbiZob.js} +1 -1
  138. package/template/dist/client/assets/{requirementDiagram-Z7DCOOCP-BWvQcALn.js → requirementDiagram-Z7DCOOCP-BkYPbRis.js} +1 -1
  139. package/template/dist/client/assets/{sankeyDiagram-WA2Y5GQK-CiGy1SQP.js → sankeyDiagram-WA2Y5GQK-B5EIaP-h.js} +1 -1
  140. package/template/dist/client/assets/{sequenceDiagram-2WXFIKYE-DRZim8vR.js → sequenceDiagram-2WXFIKYE-BC33VGOc.js} +1 -1
  141. package/template/dist/client/assets/{stateDiagram-RAJIS63D-BoqzJeL7.js → stateDiagram-RAJIS63D-DiKvWUYb.js} +1 -1
  142. package/template/dist/client/assets/stateDiagram-v2-FVOUBMTO-DjKMPYGe.js +1 -0
  143. package/template/dist/client/assets/{timeline-definition-YZTLITO2-CyvR95Wz.js → timeline-definition-YZTLITO2-QiFlgbRA.js} +1 -1
  144. package/template/dist/client/assets/{treemap-KZPCXAKY-DkXgGvs_.js → treemap-KZPCXAKY-BOYbyS9G.js} +1 -1
  145. package/template/dist/client/assets/{vennDiagram-LZ73GAT5-CVpGZu6p.js → vennDiagram-LZ73GAT5-CqmW7j4r.js} +1 -1
  146. package/template/dist/client/assets/{xychartDiagram-JWTSCODW-Cjqbi_DU.js → xychartDiagram-JWTSCODW-gj6oWX8l.js} +1 -1
  147. package/template/dist/server/assets/{Doc-DKBxQduk.js → Doc-9tJiX5y6.js} +3 -3
  148. package/template/dist/server/assets/{DocsLayout-CQfCTal3.js → DocsLayout-BTjhU_W5.js} +2 -2
  149. package/template/dist/server/assets/{Footer-Dcw5XVqX.js → Footer-CefTi2yh.js} +1 -1
  150. package/template/dist/server/assets/{FrameworkContent-OJfvCBHi.js → FrameworkContent-BkJvuP04.js} +2 -2
  151. package/template/dist/server/assets/{MarkdownHeadingContext-h4SfZq-C.js → MarkdownHeadingContext-37oQpb36.js} +8 -4
  152. package/template/dist/server/assets/{PostNotFound-DRJpnWrj.js → PostNotFound-BqBZf83v.js} +1 -1
  153. package/template/dist/server/assets/{_basePickBy-DJ9gzwF8.js → _basePickBy-DZ3TPUta.js} +2 -2
  154. package/template/dist/server/assets/{_baseUniq-CezmbvU2.js → _baseUniq-DKicWTQT.js} +1 -1
  155. package/template/dist/server/assets/{_lang._project._version.docs-CE_Z2zvG.js → _lang._project._version.docs-DOTNQiDb.js} +1 -1
  156. package/template/dist/server/assets/{_lang._project._version.docs-sJvASz_e.js → _lang._project._version.docs-U-t4mk5_.js} +3 -3
  157. package/template/dist/server/assets/{_lang._project._version.docs._-B2vf_QGY.js → _lang._project._version.docs._-DMgnElWM.js} +5 -5
  158. package/template/dist/server/assets/{_lang._project._version.docs._-CQcamDns.js → _lang._project._version.docs._-DSg82-Ug.js} +1 -1
  159. package/template/dist/server/assets/{_lang._project._version.docs.framework._framework._-54LEIllb.js → _lang._project._version.docs.framework._framework._-DbeN6toN.js} +1 -1
  160. package/template/dist/server/assets/{_lang._project._version.docs.framework._framework._-Dmn8xCf0.js → _lang._project._version.docs.framework._framework._-kBw_9L-F.js} +5 -5
  161. package/template/dist/server/assets/{_lang._project._version.docs.framework._framework.index-COKb9ffR.js → _lang._project._version.docs.framework._framework.index-Bsyj0DD5.js} +1 -1
  162. package/template/dist/server/assets/{_lang._project._version.docs.framework.index-DoEddI6Z.js → _lang._project._version.docs.framework.index-CmLAP_Io.js} +1 -1
  163. package/template/dist/server/assets/{_lang._project.docs-BjOhmwp6.js → _lang._project.docs-Bb4ZZ_jr.js} +3 -3
  164. package/template/dist/server/assets/{_lang._project.docs-dl8MxaGg.js → _lang._project.docs-BsnkRf-R.js} +1 -1
  165. package/template/dist/server/assets/{_lang._project.docs._-hSRVM-U7.js → _lang._project.docs._-ChrpJ61j.js} +5 -5
  166. package/template/dist/server/assets/{_lang._project.docs._-Bq0ajlaH.js → _lang._project.docs._-axRfm8vS.js} +1 -1
  167. package/template/dist/server/assets/{_lang.blog-Dk36D6Ol.js → _lang.blog-8j6IvzvQ.js} +2 -2
  168. package/template/dist/server/assets/{_lang.blog._-Cm8zXsPs.js → _lang.blog._-BPzP97Ac.js} +2 -2
  169. package/template/dist/server/assets/{_lang.blog._-D4CEjSkM.js → _lang.blog._-CjgFipz7.js} +1 -1
  170. package/template/dist/server/assets/{_lang.blog.index-orWcAgbi.js → _lang.blog._-DNX8UglA.js} +2 -2
  171. package/template/dist/server/assets/{_lang.blog.index-ZhMds6Jp.js → _lang.blog.index-CeZnMJBi.js} +1 -1
  172. package/template/dist/server/assets/{_lang.blog.index-Dfy48Gbt.js → _lang.blog.index-Dk5fYp4Q.js} +1 -1
  173. package/template/dist/server/assets/{_lang.blog._-A8h17fpC.js → _lang.blog.index-DzVKqoC4.js} +2 -2
  174. package/template/dist/server/assets/{_lang.docs-CAEkhcnT.js → _lang.docs-B4StnHMb.js} +3 -3
  175. package/template/dist/server/assets/{_lang.docs-CB1sGjRO.js → _lang.docs-DSB3iI6a.js} +1 -1
  176. package/template/dist/server/assets/{_lang.docs._-Zbv8OwJU.js → _lang.docs._--c0In1AT.js} +5 -5
  177. package/template/dist/server/assets/{_lang.docs._-DEX6FutM.js → _lang.docs._-S-y4-3Qn.js} +1 -1
  178. package/template/dist/server/assets/{_lang.docs.framework._framework._-BnpTV3KM.js → _lang.docs.framework._framework._-BFWLyU2h.js} +1 -1
  179. package/template/dist/server/assets/{_lang.docs.framework._framework._-4s4-ZCYh.js → _lang.docs.framework._framework._-Be0U7cDg.js} +5 -5
  180. package/template/dist/server/assets/{_lang.docs.framework._framework.index-BLryfsl2.js → _lang.docs.framework._framework.index-BZ512aSk.js} +1 -1
  181. package/template/dist/server/assets/{_lang.docs.framework.index-DGxWQH6q.js → _lang.docs.framework.index-U8z3j4kz.js} +1 -1
  182. package/template/dist/server/assets/{_tanstack-start-manifest_v-CURwM8Tc.js → _tanstack-start-manifest_v-DXpQ8503.js} +1 -1
  183. package/template/dist/server/assets/{arc-BwftnT5H.js → arc-B4h6h_n6.js} +1 -1
  184. package/template/dist/server/assets/{architecture-PBZL5I3N-KbDVC6gM.js → architecture-PBZL5I3N-CUwqLXkR.js} +6 -6
  185. package/template/dist/server/assets/{architectureDiagram-2XIMDMQ5-BoLvWxb3.js → architectureDiagram-2XIMDMQ5-CuCoxdBe.js} +6 -6
  186. package/template/dist/server/assets/{blockDiagram-WCTKOSBZ-GPFcXs-f.js → blockDiagram-WCTKOSBZ-D5PsUOim.js} +6 -6
  187. package/template/dist/server/assets/{blog.server-Bbk2Ifog.js → blog.server-WqzZ00iA.js} +1 -1
  188. package/template/dist/server/assets/{c4Diagram-IC4MRINW-EQwQCspo.js → c4Diagram-IC4MRINW-CXy5xO3o.js} +2 -2
  189. package/template/dist/server/assets/{channel-CxvwuPH7.js → channel-D0l-mWaF.js} +1 -1
  190. package/template/dist/server/assets/{chunk-4BX2VUAB-DUgcw5ei.js → chunk-4BX2VUAB-M7FVHMss.js} +1 -1
  191. package/template/dist/server/assets/{chunk-55IACEB6-Cn15uD91.js → chunk-55IACEB6-D_gDAje5.js} +1 -1
  192. package/template/dist/server/assets/{chunk-FMBD7UC4-Ck3iyLPu.js → chunk-FMBD7UC4-B5Bebx-Y.js} +1 -1
  193. package/template/dist/server/assets/{chunk-JSJVCQXG-VAT8yncE.js → chunk-JSJVCQXG-DxBkq-uB.js} +1 -1
  194. package/template/dist/server/assets/{chunk-KX2RTZJC-B1bd2VmA.js → chunk-KX2RTZJC-BMHm1EGi.js} +1 -1
  195. package/template/dist/server/assets/{chunk-NQ4KR5QH-CR67GG9C.js → chunk-NQ4KR5QH-Cp28pTwT.js} +3 -3
  196. package/template/dist/server/assets/{chunk-QZHKN3VN-B9SSazM4.js → chunk-QZHKN3VN-Bq5GZqaR.js} +1 -1
  197. package/template/dist/server/assets/{chunk-WL4C6EOR-DZ4Pjuao.js → chunk-WL4C6EOR-C9Nj5GdW.js} +5 -5
  198. package/template/dist/server/assets/{classDiagram-VBA2DB6C-CA6_4Wb2.js → classDiagram-VBA2DB6C-CUchv9T5.js} +6 -6
  199. package/template/dist/server/assets/{classDiagram-v2-RAHNMMFH-CA6_4Wb2.js → classDiagram-v2-RAHNMMFH-CUchv9T5.js} +6 -6
  200. package/template/dist/server/assets/{clone-DJHP_iVy.js → clone-CJcTi58S.js} +1 -1
  201. package/template/dist/server/assets/{cose-bilkent-S5V4N54A-DtU-cN6W.js → cose-bilkent-S5V4N54A-CxvCMhN_.js} +1 -1
  202. package/template/dist/server/assets/{dagre-KLK3FWXG-yZYrVU4p.js → dagre-KLK3FWXG-B5bQP7FL.js} +6 -6
  203. package/template/dist/server/assets/{diagram-E7M64L7V-8Yyz0aw0.js → diagram-E7M64L7V-NjHca90S.js} +8 -8
  204. package/template/dist/server/assets/{diagram-IFDJBPK2-DcxFYI3M.js → diagram-IFDJBPK2-CoTCfBKd.js} +6 -6
  205. package/template/dist/server/assets/{diagram-P4PSJMXO-CehxUcI0.js → diagram-P4PSJMXO-DHvGgYjH.js} +6 -6
  206. package/template/dist/server/assets/{docs.server-7EUAkSBN.js → docs.server-BSH7IvIU.js} +3884 -444
  207. package/template/dist/server/assets/{erDiagram-INFDFZHY-Bu2p1_Pj.js → erDiagram-INFDFZHY-01crajKr.js} +4 -4
  208. package/template/dist/server/assets/{flowDiagram-PKNHOUZH-B_eKR7I0.js → flowDiagram-PKNHOUZH-BkUQ_vxg.js} +6 -6
  209. package/template/dist/server/assets/{ganttDiagram-A5KZAMGK-DP6YEZof.js → ganttDiagram-A5KZAMGK-DvrO-w2P.js} +2 -2
  210. package/template/dist/server/assets/{gitGraph-HDMCJU4V-Bt0qhVL4.js → gitGraph-HDMCJU4V-h9JNaxB7.js} +6 -6
  211. package/template/dist/server/assets/{gitGraphDiagram-K3NZZRJ6-DwvkdYrg.js → gitGraphDiagram-K3NZZRJ6-BoKm6Fm-.js} +7 -7
  212. package/template/dist/server/assets/{graph-BVFNe_k5.js → graph-BoxbfI7Z.js} +2 -2
  213. package/template/dist/server/assets/{index-BvagF3L5.js → index-Jfzi6SZW.js} +2 -2
  214. package/template/dist/server/assets/{info-3K5VOQVL-CFejRnvB.js → info-3K5VOQVL-DgaSHqkS.js} +6 -6
  215. package/template/dist/server/assets/{infoDiagram-LFFYTUFH-D0v9uyXI.js → infoDiagram-LFFYTUFH-DgV5W8-I.js} +5 -5
  216. package/template/dist/server/assets/{ishikawaDiagram-PHBUUO56-DZumspL4.js → ishikawaDiagram-PHBUUO56-CqlMQ0Fq.js} +1 -1
  217. package/template/dist/server/assets/{journeyDiagram-4ABVD52K-nRp_-qZp.js → journeyDiagram-4ABVD52K-D6ySTub8.js} +4 -4
  218. package/template/dist/server/assets/{kanban-definition-K7BYSVSG-BMKyyzjt.js → kanban-definition-K7BYSVSG-BT8m7Cwk.js} +2 -2
  219. package/template/dist/server/assets/{layout-mpiN5R-5.js → layout-CkYcErfn.js} +4 -4
  220. package/template/dist/server/assets/{linear-CqNYgjEx.js → linear-F_0dWGZL.js} +1 -1
  221. package/template/dist/server/assets/{mermaid-parser.core-B8Uu3QZY.js → mermaid-parser.core-q5MdUJuo.js} +11 -11
  222. package/template/dist/server/assets/{mermaid.core-BI3nMhNO.js → mermaid.core-DOWTODR1.js} +31 -31
  223. package/template/dist/server/assets/{mindmap-definition-YRQLILUH-DCoFqLPh.js → mindmap-definition-YRQLILUH-BQxlQqn-.js} +3 -3
  224. package/template/dist/server/assets/{ordinal-Bcam90FY.js → ordinal-CxptdPJm.js} +1 -1
  225. package/template/dist/server/assets/{packet-RMMSAZCW-djgonfKN.js → packet-RMMSAZCW-D8FkLZuP.js} +6 -6
  226. package/template/dist/server/assets/{pie-UPGHQEXC-Dug2t-PE.js → pie-UPGHQEXC-Diw2fHLk.js} +6 -6
  227. package/template/dist/server/assets/{pieDiagram-SKSYHLDU-CS0_hW4w.js → pieDiagram-SKSYHLDU-B1J4UJZ7.js} +8 -8
  228. package/template/dist/server/assets/{quadrantDiagram-337W2JSQ-BpQNM0zu.js → quadrantDiagram-337W2JSQ-BvjKLapg.js} +2 -2
  229. package/template/dist/server/assets/{radar-KQ55EAFF-3ir2W9Wi.js → radar-KQ55EAFF-CcBdPU3n.js} +6 -6
  230. package/template/dist/server/assets/{requirementDiagram-Z7DCOOCP-D92RyjV4.js → requirementDiagram-Z7DCOOCP-Bgr_wnAs.js} +3 -3
  231. package/template/dist/server/assets/{router-DK1vpPhv.js → router-DxwPl-Dc.js} +18 -18
  232. package/template/dist/server/assets/{sankeyDiagram-WA2Y5GQK-DCPRB-xO.js → sankeyDiagram-WA2Y5GQK-B0UwtyW3.js} +2 -2
  233. package/template/dist/server/assets/{sequenceDiagram-2WXFIKYE-C1ab2VvU.js → sequenceDiagram-2WXFIKYE-BbxQJHjO.js} +3 -3
  234. package/template/dist/server/assets/{stateDiagram-RAJIS63D-GhG1G3ff.js → stateDiagram-RAJIS63D-Cg-uJ_UO.js} +8 -8
  235. package/template/dist/server/assets/{stateDiagram-v2-FVOUBMTO-C-KtMadV.js → stateDiagram-v2-FVOUBMTO-BWVPrqfa.js} +4 -4
  236. package/template/dist/server/assets/{timeline-definition-YZTLITO2-DyfAQCd4.js → timeline-definition-YZTLITO2-DCSJT2WT.js} +2 -2
  237. package/template/dist/server/assets/{treemap-KZPCXAKY-Cn0Cw4Cl.js → treemap-KZPCXAKY-a0nhlKgx.js} +6 -6
  238. package/template/dist/server/assets/{vennDiagram-LZ73GAT5-D2Ak5JUa.js → vennDiagram-LZ73GAT5-Bk2HQEQq.js} +1 -1
  239. package/template/dist/server/assets/{xychartDiagram-JWTSCODW-DqoBOs1L.js → xychartDiagram-JWTSCODW-C4svHkt_.js} +3 -3
  240. package/template/dist/server/server.js +16 -16
  241. package/template/package.json +2 -0
  242. package/template/vite.config.ts +33 -18
  243. package/template/wrangler.jsonc +2 -2
  244. package/admin/dist/client/assets/main-CSFhgz4p.js +0 -17
  245. package/admin/dist/client/assets/routes-C6bCOSX-.js +0 -3
  246. package/admin/dist/server/assets/_tanstack-start-manifest_v-BE5XHVZ2.js +0 -17
  247. package/admin/dist/server/assets/redirect-DtfSYi2g.js +0 -51
  248. package/admin/dist/server/assets/status-CZz8Rs_7.js +0 -81
  249. package/template/dist/client/assets/_lang-Cpuy5xmU.js +0 -1
  250. package/template/dist/client/assets/_lang._project-DBdR04In.js +0 -1
  251. package/template/dist/client/assets/_lang._project._version-CtCLMJs2.js +0 -1
  252. package/template/dist/client/assets/_lang._project._version.docs._-CxgRZ17Q.js +0 -1
  253. package/template/dist/client/assets/_lang._project._version.docs.framework._framework._-Qph6wahA.js +0 -1
  254. package/template/dist/client/assets/_lang._project.docs._-C_ZfXEJ7.js +0 -1
  255. package/template/dist/client/assets/_lang.blog-BcRmhv23.js +0 -1
  256. package/template/dist/client/assets/_lang.blog-C5Aa7k5r.js +0 -1
  257. package/template/dist/client/assets/_lang.blog._-BVw4vhtF.js +0 -1
  258. package/template/dist/client/assets/_lang.blog.index-Y35iFzkp.js +0 -1
  259. package/template/dist/client/assets/_lang.docs._-B9hwwoTY.js +0 -1
  260. package/template/dist/client/assets/_lang.docs.framework._framework._-BENbKZIu.js +0 -1
  261. package/template/dist/client/assets/channel-C_1F7tzH.js +0 -1
  262. package/template/dist/client/assets/classDiagram-VBA2DB6C-CqViWWFw.js +0 -1
  263. package/template/dist/client/assets/classDiagram-v2-RAHNMMFH-CqViWWFw.js +0 -1
  264. package/template/dist/client/assets/clone-EeiNAO_N.js +0 -1
  265. package/template/dist/client/assets/ordinal-BENe2yWM.js +0 -1
  266. package/template/dist/client/assets/stateDiagram-v2-FVOUBMTO-CJYWvllO.js +0 -1
  267. /package/admin/dist/server/assets/{createServerRpc-DJq9yo-B.js → createServerRpc-Cyyxq9HQ.js} +0 -0
@@ -0,0 +1,1153 @@
1
+ import { c as defineErrorCodes, h as env, n as BetterAuthError } from "./error-CASJ5tIm.js";
2
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/utils/wildcard.mjs
3
+ /**
4
+ * Escapes a character if it has a special meaning in regular expressions
5
+ * and returns the character as is if it doesn't
6
+ */
7
+ function escapeRegExpChar(char) {
8
+ if (char === "-" || char === "^" || char === "$" || char === "+" || char === "." || char === "(" || char === ")" || char === "|" || char === "[" || char === "]" || char === "{" || char === "}" || char === "*" || char === "?" || char === "\\") return `\\${char}`;
9
+ else return char;
10
+ }
11
+ /**
12
+ * Escapes all characters in a given string that have a special meaning in regular expressions
13
+ */
14
+ function escapeRegExpString(str) {
15
+ let result = "";
16
+ for (let i = 0; i < str.length; i++) result += escapeRegExpChar(str[i]);
17
+ return result;
18
+ }
19
+ /**
20
+ * Transforms one or more glob patterns into a RegExp pattern
21
+ */
22
+ function transform(pattern, separator = true) {
23
+ if (Array.isArray(pattern)) return `(?:${pattern.map((p) => `^${transform(p, separator)}$`).join("|")})`;
24
+ let separatorSplitter = "";
25
+ let separatorMatcher = "";
26
+ let wildcard = ".";
27
+ if (separator === true) {
28
+ separatorSplitter = "/";
29
+ separatorMatcher = "[/\\\\]";
30
+ wildcard = "[^/\\\\]";
31
+ } else if (separator) {
32
+ separatorSplitter = separator;
33
+ separatorMatcher = escapeRegExpString(separatorSplitter);
34
+ if (separatorMatcher.length > 1) {
35
+ separatorMatcher = `(?:${separatorMatcher})`;
36
+ wildcard = `((?!${separatorMatcher}).)`;
37
+ } else wildcard = `[^${separatorMatcher}]`;
38
+ }
39
+ const requiredSeparator = separator ? `${separatorMatcher}+?` : "";
40
+ const optionalSeparator = separator ? `${separatorMatcher}*?` : "";
41
+ const segments = separator ? pattern.split(separatorSplitter) : [pattern];
42
+ let result = "";
43
+ for (let s = 0; s < segments.length; s++) {
44
+ const segment = segments[s];
45
+ const nextSegment = segments[s + 1];
46
+ let currentSeparator = "";
47
+ if (!segment && s > 0) continue;
48
+ if (separator) if (s === segments.length - 1) currentSeparator = optionalSeparator;
49
+ else if (nextSegment !== "**") currentSeparator = requiredSeparator;
50
+ else currentSeparator = "";
51
+ if (separator && segment === "**") {
52
+ if (currentSeparator) {
53
+ result += s === 0 ? "" : currentSeparator;
54
+ result += `(?:${wildcard}*?${currentSeparator})*?`;
55
+ }
56
+ continue;
57
+ }
58
+ for (let c = 0; c < segment.length; c++) {
59
+ const char = segment[c];
60
+ if (char === "\\") {
61
+ if (c < segment.length - 1) {
62
+ result += escapeRegExpChar(segment[c + 1]);
63
+ c++;
64
+ }
65
+ } else if (char === "?") result += wildcard;
66
+ else if (char === "*") result += `${wildcard}*?`;
67
+ else result += escapeRegExpChar(char);
68
+ }
69
+ result += currentSeparator;
70
+ }
71
+ return result;
72
+ }
73
+ function isMatch(regexp, sample) {
74
+ if (typeof sample !== "string") throw new TypeError(`Sample must be a string, but ${typeof sample} given`);
75
+ return regexp.test(sample);
76
+ }
77
+ /**
78
+ * Compiles one or more glob patterns into a RegExp and returns an isMatch function.
79
+ * The isMatch function takes a sample string as its only argument and returns `true`
80
+ * if the string matches the pattern(s).
81
+ *
82
+ * ```js
83
+ * wildcardMatch('src/*.js')('src/index.js') //=> true
84
+ * ```
85
+ *
86
+ * ```js
87
+ * const isMatch = wildcardMatch('*.example.com', '.')
88
+ * isMatch('foo.example.com') //=> true
89
+ * isMatch('foo.bar.com') //=> false
90
+ * ```
91
+ */
92
+ function wildcardMatch(pattern, options) {
93
+ if (typeof pattern !== "string" && !Array.isArray(pattern)) throw new TypeError(`The first argument must be a single pattern string or an array of patterns, but ${typeof pattern} given`);
94
+ if (typeof options === "string" || typeof options === "boolean") options = { separator: options };
95
+ if (arguments.length === 2 && !(typeof options === "undefined" || typeof options === "object" && options !== null && !Array.isArray(options))) throw new TypeError(`The second argument must be an options object or a string/boolean separator, but ${typeof options} given`);
96
+ options = options || {};
97
+ if (options.separator === "\\") throw new Error("\\ is not a valid separator because it is used for escaping. Try setting the separator to `true` instead");
98
+ const regexpPattern = transform(pattern, options.separator);
99
+ const regexp = new RegExp(`^${regexpPattern}$`, options.flags);
100
+ const fn = isMatch.bind(null, regexp);
101
+ fn.options = options;
102
+ fn.pattern = pattern;
103
+ fn.regexp = regexp;
104
+ return fn;
105
+ }
106
+ //#endregion
107
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/utils/url.mjs
108
+ function checkHasPath(url) {
109
+ try {
110
+ return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
111
+ } catch {
112
+ throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`);
113
+ }
114
+ }
115
+ function assertHasProtocol(url) {
116
+ try {
117
+ const parsedUrl = new URL(url);
118
+ if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") throw new BetterAuthError(`Invalid base URL: ${url}. URL must include 'http://' or 'https://'`);
119
+ } catch (error) {
120
+ if (error instanceof BetterAuthError) throw error;
121
+ throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`, { cause: error });
122
+ }
123
+ }
124
+ function withPath(url, path = "/api/auth") {
125
+ assertHasProtocol(url);
126
+ if (checkHasPath(url)) return url;
127
+ const trimmedUrl = url.replace(/\/+$/, "");
128
+ if (!path || path === "/") return trimmedUrl;
129
+ path = path.startsWith("/") ? path : `/${path}`;
130
+ return `${trimmedUrl}${path}`;
131
+ }
132
+ function validateProxyHeader(header, type) {
133
+ if (!header || header.trim() === "") return false;
134
+ if (type === "proto") return header === "http" || header === "https";
135
+ if (type === "host") {
136
+ if ([
137
+ /\.\./,
138
+ /\0/,
139
+ /[\s]/,
140
+ /^[.]/,
141
+ /[<>'"]/,
142
+ /javascript:/i,
143
+ /file:/i,
144
+ /data:/i
145
+ ].some((pattern) => pattern.test(header))) return false;
146
+ return /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(header) || /^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(header) || /^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(header) || /^localhost(:[0-9]{1,5})?$/i.test(header);
147
+ }
148
+ return false;
149
+ }
150
+ function getBaseURL(url, path, request, loadEnv, trustedProxyHeaders) {
151
+ if (url) return withPath(url, path);
152
+ if (loadEnv !== false) {
153
+ const fromEnv = env.BETTER_AUTH_URL || env.NEXT_PUBLIC_BETTER_AUTH_URL || env.PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_AUTH_URL || (env.BASE_URL !== "/" ? env.BASE_URL : void 0);
154
+ if (fromEnv) return withPath(fromEnv, path);
155
+ }
156
+ const fromRequest = request?.headers.get("x-forwarded-host");
157
+ const fromRequestProto = request?.headers.get("x-forwarded-proto");
158
+ if (fromRequest && fromRequestProto && trustedProxyHeaders) {
159
+ if (validateProxyHeader(fromRequestProto, "proto") && validateProxyHeader(fromRequest, "host")) try {
160
+ return withPath(`${fromRequestProto}://${fromRequest}`, path);
161
+ } catch (_error) {}
162
+ }
163
+ if (request) {
164
+ const url = getOrigin(request.url);
165
+ if (!url) throw new BetterAuthError("Could not get origin from request. Please provide a valid base URL.");
166
+ return withPath(url, path);
167
+ }
168
+ if (typeof window !== "undefined" && window.location) return withPath(window.location.origin, path);
169
+ }
170
+ function getOrigin(url) {
171
+ try {
172
+ const parsedUrl = new URL(url);
173
+ return parsedUrl.origin === "null" ? null : parsedUrl.origin;
174
+ } catch {
175
+ return null;
176
+ }
177
+ }
178
+ function getProtocol(url) {
179
+ try {
180
+ return new URL(url).protocol;
181
+ } catch {
182
+ return null;
183
+ }
184
+ }
185
+ function getHost(url) {
186
+ try {
187
+ return new URL(url).host;
188
+ } catch {
189
+ return null;
190
+ }
191
+ }
192
+ /**
193
+ * Checks if the baseURL config is a dynamic config object
194
+ */
195
+ function isDynamicBaseURLConfig(config) {
196
+ return typeof config === "object" && config !== null && "allowedHosts" in config && Array.isArray(config.allowedHosts);
197
+ }
198
+ /**
199
+ * Extracts the host from the request headers.
200
+ * Tries x-forwarded-host first (for proxy setups), then falls back to host header.
201
+ *
202
+ * @param request The incoming request
203
+ * @returns The host string or null if not found
204
+ */
205
+ function getHostFromRequest(request) {
206
+ const forwardedHost = request.headers.get("x-forwarded-host");
207
+ if (forwardedHost && validateProxyHeader(forwardedHost, "host")) return forwardedHost;
208
+ const host = request.headers.get("host");
209
+ if (host && validateProxyHeader(host, "host")) return host;
210
+ try {
211
+ return new URL(request.url).host;
212
+ } catch {
213
+ return null;
214
+ }
215
+ }
216
+ /**
217
+ * Extracts the protocol from the request headers.
218
+ * Tries x-forwarded-proto first (for proxy setups), then infers from request URL.
219
+ *
220
+ * @param request The incoming request
221
+ * @param configProtocol Protocol override from config
222
+ * @returns The protocol ("http" or "https")
223
+ */
224
+ function getProtocolFromRequest(request, configProtocol) {
225
+ if (configProtocol === "http" || configProtocol === "https") return configProtocol;
226
+ const forwardedProto = request.headers.get("x-forwarded-proto");
227
+ if (forwardedProto && validateProxyHeader(forwardedProto, "proto")) return forwardedProto;
228
+ try {
229
+ const url = new URL(request.url);
230
+ if (url.protocol === "http:" || url.protocol === "https:") return url.protocol.slice(0, -1);
231
+ } catch {}
232
+ return "https";
233
+ }
234
+ /**
235
+ * Matches a hostname against a host pattern.
236
+ * Supports wildcard patterns like `*.vercel.app` or `preview-*.myapp.com`.
237
+ *
238
+ * @param host The hostname to test (e.g., "myapp.com", "preview-123.vercel.app")
239
+ * @param pattern The host pattern (e.g., "myapp.com", "*.vercel.app")
240
+ * @returns {boolean} true if the host matches the pattern, false otherwise.
241
+ *
242
+ * @example
243
+ * ```ts
244
+ * matchesHostPattern("myapp.com", "myapp.com") // true
245
+ * matchesHostPattern("preview-123.vercel.app", "*.vercel.app") // true
246
+ * matchesHostPattern("preview-123.myapp.com", "preview-*.myapp.com") // true
247
+ * matchesHostPattern("evil.com", "myapp.com") // false
248
+ * ```
249
+ */
250
+ var matchesHostPattern = (host, pattern) => {
251
+ if (!host || !pattern) return false;
252
+ const normalizedHost = host.replace(/^https?:\/\//, "").split("/")[0].toLowerCase();
253
+ const normalizedPattern = pattern.replace(/^https?:\/\//, "").split("/")[0].toLowerCase();
254
+ if (normalizedPattern.includes("*") || normalizedPattern.includes("?")) return wildcardMatch(normalizedPattern)(normalizedHost);
255
+ return normalizedHost.toLowerCase() === normalizedPattern.toLowerCase();
256
+ };
257
+ /**
258
+ * Resolves the base URL from a dynamic config based on the incoming request.
259
+ * Validates the derived host against the allowedHosts allowlist.
260
+ *
261
+ * @param config The dynamic base URL config
262
+ * @param request The incoming request
263
+ * @param basePath The base path to append
264
+ * @returns The resolved base URL with path
265
+ * @throws BetterAuthError if host is not in allowedHosts and no fallback is set
266
+ */
267
+ function resolveDynamicBaseURL(config, request, basePath) {
268
+ const host = getHostFromRequest(request);
269
+ if (!host) {
270
+ if (config.fallback) return withPath(config.fallback, basePath);
271
+ throw new BetterAuthError("Could not determine host from request headers. Please provide a fallback URL in your baseURL config.");
272
+ }
273
+ if (config.allowedHosts.some((pattern) => matchesHostPattern(host, pattern))) return withPath(`${getProtocolFromRequest(request, config.protocol)}://${host}`, basePath);
274
+ if (config.fallback) return withPath(config.fallback, basePath);
275
+ throw new BetterAuthError(`Host "${host}" is not in the allowed hosts list. Allowed hosts: ${config.allowedHosts.join(", ")}. Add this host to your allowedHosts config or provide a fallback URL.`);
276
+ }
277
+ /**
278
+ * Resolves the base URL from any config type (static string or dynamic object).
279
+ * This is the main entry point for base URL resolution.
280
+ *
281
+ * @param config The base URL config (string or object)
282
+ * @param basePath The base path to append
283
+ * @param request Optional request for dynamic resolution
284
+ * @param loadEnv Whether to load from environment variables
285
+ * @param trustedProxyHeaders Whether to trust proxy headers (for legacy behavior)
286
+ * @returns The resolved base URL with path
287
+ */
288
+ function resolveBaseURL(config, basePath, request, loadEnv, trustedProxyHeaders) {
289
+ if (isDynamicBaseURLConfig(config)) {
290
+ if (request) return resolveDynamicBaseURL(config, request, basePath);
291
+ if (config.fallback) return withPath(config.fallback, basePath);
292
+ return getBaseURL(void 0, basePath, request, loadEnv, trustedProxyHeaders);
293
+ }
294
+ if (typeof config === "string") return getBaseURL(config, basePath, request, loadEnv, trustedProxyHeaders);
295
+ return getBaseURL(void 0, basePath, request, loadEnv, trustedProxyHeaders);
296
+ }
297
+ //#endregion
298
+ //#region ../../node_modules/.bun/defu@6.1.4/node_modules/defu/dist/defu.mjs
299
+ function isPlainObject(value) {
300
+ if (value === null || typeof value !== "object") return false;
301
+ const prototype = Object.getPrototypeOf(value);
302
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
303
+ if (Symbol.iterator in value) return false;
304
+ if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
305
+ return true;
306
+ }
307
+ function _defu(baseObject, defaults, namespace = ".", merger) {
308
+ if (!isPlainObject(defaults)) return _defu(baseObject, {}, namespace, merger);
309
+ const object = Object.assign({}, defaults);
310
+ for (const key in baseObject) {
311
+ if (key === "__proto__" || key === "constructor") continue;
312
+ const value = baseObject[key];
313
+ if (value === null || value === void 0) continue;
314
+ if (merger && merger(object, key, value, namespace)) continue;
315
+ if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
316
+ else if (isPlainObject(value) && isPlainObject(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
317
+ else object[key] = value;
318
+ }
319
+ return object;
320
+ }
321
+ function createDefu(merger) {
322
+ return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
323
+ }
324
+ var defu = createDefu();
325
+ createDefu((object, key, currentValue) => {
326
+ if (object[key] !== void 0 && typeof currentValue === "function") {
327
+ object[key] = currentValue(object[key]);
328
+ return true;
329
+ }
330
+ });
331
+ createDefu((object, key, currentValue) => {
332
+ if (Array.isArray(object[key]) && typeof currentValue === "function") {
333
+ object[key] = currentValue(object[key]);
334
+ return true;
335
+ }
336
+ });
337
+ //#endregion
338
+ //#region ../../node_modules/.bun/@better-fetch+fetch@1.1.21/node_modules/@better-fetch/fetch/dist/index.js
339
+ var __defProp = Object.defineProperty;
340
+ var __defProps = Object.defineProperties;
341
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
342
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
343
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
344
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
345
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
346
+ enumerable: true,
347
+ configurable: true,
348
+ writable: true,
349
+ value
350
+ }) : obj[key] = value;
351
+ var __spreadValues = (a, b) => {
352
+ for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
353
+ if (__getOwnPropSymbols) {
354
+ for (var prop of __getOwnPropSymbols(b)) if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
355
+ }
356
+ return a;
357
+ };
358
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
359
+ var BetterFetchError = class extends Error {
360
+ constructor(status, statusText, error) {
361
+ super(statusText || status.toString(), { cause: error });
362
+ this.status = status;
363
+ this.statusText = statusText;
364
+ this.error = error;
365
+ Error.captureStackTrace(this, this.constructor);
366
+ }
367
+ };
368
+ var initializePlugins = async (url, options) => {
369
+ var _a, _b, _c, _d, _e, _f;
370
+ let opts = options || {};
371
+ const hooks = {
372
+ onRequest: [options == null ? void 0 : options.onRequest],
373
+ onResponse: [options == null ? void 0 : options.onResponse],
374
+ onSuccess: [options == null ? void 0 : options.onSuccess],
375
+ onError: [options == null ? void 0 : options.onError],
376
+ onRetry: [options == null ? void 0 : options.onRetry]
377
+ };
378
+ if (!options || !(options == null ? void 0 : options.plugins)) return {
379
+ url,
380
+ options: opts,
381
+ hooks
382
+ };
383
+ for (const plugin of (options == null ? void 0 : options.plugins) || []) {
384
+ if (plugin.init) {
385
+ const pluginRes = await ((_a = plugin.init) == null ? void 0 : _a.call(plugin, url.toString(), options));
386
+ opts = pluginRes.options || opts;
387
+ url = pluginRes.url;
388
+ }
389
+ hooks.onRequest.push((_b = plugin.hooks) == null ? void 0 : _b.onRequest);
390
+ hooks.onResponse.push((_c = plugin.hooks) == null ? void 0 : _c.onResponse);
391
+ hooks.onSuccess.push((_d = plugin.hooks) == null ? void 0 : _d.onSuccess);
392
+ hooks.onError.push((_e = plugin.hooks) == null ? void 0 : _e.onError);
393
+ hooks.onRetry.push((_f = plugin.hooks) == null ? void 0 : _f.onRetry);
394
+ }
395
+ return {
396
+ url,
397
+ options: opts,
398
+ hooks
399
+ };
400
+ };
401
+ var LinearRetryStrategy = class {
402
+ constructor(options) {
403
+ this.options = options;
404
+ }
405
+ shouldAttemptRetry(attempt, response) {
406
+ if (this.options.shouldRetry) return Promise.resolve(attempt < this.options.attempts && this.options.shouldRetry(response));
407
+ return Promise.resolve(attempt < this.options.attempts);
408
+ }
409
+ getDelay() {
410
+ return this.options.delay;
411
+ }
412
+ };
413
+ var ExponentialRetryStrategy = class {
414
+ constructor(options) {
415
+ this.options = options;
416
+ }
417
+ shouldAttemptRetry(attempt, response) {
418
+ if (this.options.shouldRetry) return Promise.resolve(attempt < this.options.attempts && this.options.shouldRetry(response));
419
+ return Promise.resolve(attempt < this.options.attempts);
420
+ }
421
+ getDelay(attempt) {
422
+ return Math.min(this.options.maxDelay, this.options.baseDelay * 2 ** attempt);
423
+ }
424
+ };
425
+ function createRetryStrategy(options) {
426
+ if (typeof options === "number") return new LinearRetryStrategy({
427
+ type: "linear",
428
+ attempts: options,
429
+ delay: 1e3
430
+ });
431
+ switch (options.type) {
432
+ case "linear": return new LinearRetryStrategy(options);
433
+ case "exponential": return new ExponentialRetryStrategy(options);
434
+ default: throw new Error("Invalid retry strategy");
435
+ }
436
+ }
437
+ var getAuthHeader = async (options) => {
438
+ const headers = {};
439
+ const getValue = async (value) => typeof value === "function" ? await value() : value;
440
+ if (options == null ? void 0 : options.auth) {
441
+ if (options.auth.type === "Bearer") {
442
+ const token = await getValue(options.auth.token);
443
+ if (!token) return headers;
444
+ headers["authorization"] = `Bearer ${token}`;
445
+ } else if (options.auth.type === "Basic") {
446
+ const [username, password] = await Promise.all([getValue(options.auth.username), getValue(options.auth.password)]);
447
+ if (!username || !password) return headers;
448
+ headers["authorization"] = `Basic ${btoa(`${username}:${password}`)}`;
449
+ } else if (options.auth.type === "Custom") {
450
+ const [prefix, value] = await Promise.all([getValue(options.auth.prefix), getValue(options.auth.value)]);
451
+ if (!value) return headers;
452
+ headers["authorization"] = `${prefix != null ? prefix : ""} ${value}`;
453
+ }
454
+ }
455
+ return headers;
456
+ };
457
+ var JSON_RE = /^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;
458
+ function detectResponseType(request) {
459
+ const _contentType = request.headers.get("content-type");
460
+ const textTypes = /* @__PURE__ */ new Set([
461
+ "image/svg",
462
+ "application/xml",
463
+ "application/xhtml",
464
+ "application/html"
465
+ ]);
466
+ if (!_contentType) return "json";
467
+ const contentType = _contentType.split(";").shift() || "";
468
+ if (JSON_RE.test(contentType)) return "json";
469
+ if (textTypes.has(contentType) || contentType.startsWith("text/")) return "text";
470
+ return "blob";
471
+ }
472
+ function isJSONParsable(value) {
473
+ try {
474
+ JSON.parse(value);
475
+ return true;
476
+ } catch (error) {
477
+ return false;
478
+ }
479
+ }
480
+ function isJSONSerializable(value) {
481
+ if (value === void 0) return false;
482
+ const t = typeof value;
483
+ if (t === "string" || t === "number" || t === "boolean" || t === null) return true;
484
+ if (t !== "object") return false;
485
+ if (Array.isArray(value)) return true;
486
+ if (value.buffer) return false;
487
+ return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function";
488
+ }
489
+ function jsonParse(text) {
490
+ try {
491
+ return JSON.parse(text);
492
+ } catch (error) {
493
+ return text;
494
+ }
495
+ }
496
+ function isFunction(value) {
497
+ return typeof value === "function";
498
+ }
499
+ function getFetch(options) {
500
+ if (options == null ? void 0 : options.customFetchImpl) return options.customFetchImpl;
501
+ if (typeof globalThis !== "undefined" && isFunction(globalThis.fetch)) return globalThis.fetch;
502
+ if (typeof window !== "undefined" && isFunction(window.fetch)) return window.fetch;
503
+ throw new Error("No fetch implementation found");
504
+ }
505
+ async function getHeaders(opts) {
506
+ const headers = new Headers(opts == null ? void 0 : opts.headers);
507
+ const authHeader = await getAuthHeader(opts);
508
+ for (const [key, value] of Object.entries(authHeader || {})) headers.set(key, value);
509
+ if (!headers.has("content-type")) {
510
+ const t = detectContentType(opts == null ? void 0 : opts.body);
511
+ if (t) headers.set("content-type", t);
512
+ }
513
+ return headers;
514
+ }
515
+ function detectContentType(body) {
516
+ if (isJSONSerializable(body)) return "application/json";
517
+ return null;
518
+ }
519
+ function getBody(options) {
520
+ if (!(options == null ? void 0 : options.body)) return null;
521
+ const headers = new Headers(options == null ? void 0 : options.headers);
522
+ if (isJSONSerializable(options.body) && !headers.has("content-type")) {
523
+ for (const [key, value] of Object.entries(options == null ? void 0 : options.body)) if (value instanceof Date) options.body[key] = value.toISOString();
524
+ return JSON.stringify(options.body);
525
+ }
526
+ if (headers.has("content-type") && headers.get("content-type") === "application/x-www-form-urlencoded") {
527
+ if (isJSONSerializable(options.body)) return new URLSearchParams(options.body).toString();
528
+ return options.body;
529
+ }
530
+ return options.body;
531
+ }
532
+ function getMethod(url, options) {
533
+ var _a;
534
+ if (options == null ? void 0 : options.method) return options.method.toUpperCase();
535
+ if (url.startsWith("@")) {
536
+ const pMethod = (_a = url.split("@")[1]) == null ? void 0 : _a.split("/")[0];
537
+ if (!methods.includes(pMethod)) return (options == null ? void 0 : options.body) ? "POST" : "GET";
538
+ return pMethod.toUpperCase();
539
+ }
540
+ return (options == null ? void 0 : options.body) ? "POST" : "GET";
541
+ }
542
+ function getTimeout(options, controller) {
543
+ let abortTimeout;
544
+ if (!(options == null ? void 0 : options.signal) && (options == null ? void 0 : options.timeout)) abortTimeout = setTimeout(() => controller == null ? void 0 : controller.abort(), options == null ? void 0 : options.timeout);
545
+ return {
546
+ abortTimeout,
547
+ clearTimeout: () => {
548
+ if (abortTimeout) clearTimeout(abortTimeout);
549
+ }
550
+ };
551
+ }
552
+ var ValidationError = class _ValidationError extends Error {
553
+ constructor(issues, message) {
554
+ super(message || JSON.stringify(issues, null, 2));
555
+ this.issues = issues;
556
+ Object.setPrototypeOf(this, _ValidationError.prototype);
557
+ }
558
+ };
559
+ async function parseStandardSchema(schema, input) {
560
+ const result = await schema["~standard"].validate(input);
561
+ if (result.issues) throw new ValidationError(result.issues);
562
+ return result.value;
563
+ }
564
+ var methods = [
565
+ "get",
566
+ "post",
567
+ "put",
568
+ "patch",
569
+ "delete"
570
+ ];
571
+ var applySchemaPlugin = (config) => ({
572
+ id: "apply-schema",
573
+ name: "Apply Schema",
574
+ version: "1.0.0",
575
+ async init(url, options) {
576
+ var _a, _b, _c, _d;
577
+ const schema = ((_b = (_a = config.plugins) == null ? void 0 : _a.find((plugin) => {
578
+ var _a2;
579
+ return ((_a2 = plugin.schema) == null ? void 0 : _a2.config) ? url.startsWith(plugin.schema.config.baseURL || "") || url.startsWith(plugin.schema.config.prefix || "") : false;
580
+ })) == null ? void 0 : _b.schema) || config.schema;
581
+ if (schema) {
582
+ let urlKey = url;
583
+ if ((_c = schema.config) == null ? void 0 : _c.prefix) {
584
+ if (urlKey.startsWith(schema.config.prefix)) {
585
+ urlKey = urlKey.replace(schema.config.prefix, "");
586
+ if (schema.config.baseURL) url = url.replace(schema.config.prefix, schema.config.baseURL);
587
+ }
588
+ }
589
+ if ((_d = schema.config) == null ? void 0 : _d.baseURL) {
590
+ if (urlKey.startsWith(schema.config.baseURL)) urlKey = urlKey.replace(schema.config.baseURL, "");
591
+ }
592
+ const keySchema = schema.schema[urlKey];
593
+ if (keySchema) {
594
+ let opts = __spreadProps(__spreadValues({}, options), {
595
+ method: keySchema.method,
596
+ output: keySchema.output
597
+ });
598
+ if (!(options == null ? void 0 : options.disableValidation)) opts = __spreadProps(__spreadValues({}, opts), {
599
+ body: keySchema.input ? await parseStandardSchema(keySchema.input, options == null ? void 0 : options.body) : options == null ? void 0 : options.body,
600
+ params: keySchema.params ? await parseStandardSchema(keySchema.params, options == null ? void 0 : options.params) : options == null ? void 0 : options.params,
601
+ query: keySchema.query ? await parseStandardSchema(keySchema.query, options == null ? void 0 : options.query) : options == null ? void 0 : options.query
602
+ });
603
+ return {
604
+ url,
605
+ options: opts
606
+ };
607
+ }
608
+ }
609
+ return {
610
+ url,
611
+ options
612
+ };
613
+ }
614
+ });
615
+ var createFetch = (config) => {
616
+ async function $fetch(url, options) {
617
+ const opts = __spreadProps(__spreadValues(__spreadValues({}, config), options), { plugins: [
618
+ ...(config == null ? void 0 : config.plugins) || [],
619
+ applySchemaPlugin(config || {}),
620
+ ...(options == null ? void 0 : options.plugins) || []
621
+ ] });
622
+ if (config == null ? void 0 : config.catchAllError) try {
623
+ return await betterFetch(url, opts);
624
+ } catch (error) {
625
+ return {
626
+ data: null,
627
+ error: {
628
+ status: 500,
629
+ statusText: "Fetch Error",
630
+ message: "Fetch related error. Captured by catchAllError option. See error property for more details.",
631
+ error
632
+ }
633
+ };
634
+ }
635
+ return await betterFetch(url, opts);
636
+ }
637
+ return $fetch;
638
+ };
639
+ function getURL2(url, option) {
640
+ const { baseURL, params, query } = option || {
641
+ query: {},
642
+ params: {},
643
+ baseURL: ""
644
+ };
645
+ let basePath = url.startsWith("http") ? url.split("/").slice(0, 3).join("/") : baseURL || "";
646
+ if (url.startsWith("@")) {
647
+ const m = url.toString().split("@")[1].split("/")[0];
648
+ if (methods.includes(m)) url = url.replace(`@${m}/`, "/");
649
+ }
650
+ if (!basePath.endsWith("/")) basePath += "/";
651
+ let [path, urlQuery] = url.replace(basePath, "").split("?");
652
+ const queryParams = new URLSearchParams(urlQuery);
653
+ for (const [key, value] of Object.entries(query || {})) {
654
+ if (value == null) continue;
655
+ let serializedValue;
656
+ if (typeof value === "string") serializedValue = value;
657
+ else if (Array.isArray(value)) {
658
+ for (const val of value) queryParams.append(key, val);
659
+ continue;
660
+ } else serializedValue = JSON.stringify(value);
661
+ queryParams.set(key, serializedValue);
662
+ }
663
+ if (params) if (Array.isArray(params)) {
664
+ const paramPaths = path.split("/").filter((p) => p.startsWith(":"));
665
+ for (const [index, key] of paramPaths.entries()) {
666
+ const value = params[index];
667
+ path = path.replace(key, value);
668
+ }
669
+ } else for (const [key, value] of Object.entries(params)) path = path.replace(`:${key}`, String(value));
670
+ path = path.split("/").map(encodeURIComponent).join("/");
671
+ if (path.startsWith("/")) path = path.slice(1);
672
+ let queryParamString = queryParams.toString();
673
+ queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\+/g, "%20") : "";
674
+ if (!basePath.startsWith("http")) return `${basePath}${path}${queryParamString}`;
675
+ return new URL(`${path}${queryParamString}`, basePath);
676
+ }
677
+ var betterFetch = async (url, options) => {
678
+ var _a, _b, _c, _d, _e, _f, _g, _h;
679
+ const { hooks, url: __url, options: opts } = await initializePlugins(url, options);
680
+ const fetch = getFetch(opts);
681
+ const controller = new AbortController();
682
+ const signal = (_a = opts.signal) != null ? _a : controller.signal;
683
+ const _url = getURL2(__url, opts);
684
+ const body = getBody(opts);
685
+ const headers = await getHeaders(opts);
686
+ const method = getMethod(__url, opts);
687
+ let context = __spreadProps(__spreadValues({}, opts), {
688
+ url: _url,
689
+ headers,
690
+ body,
691
+ method,
692
+ signal
693
+ });
694
+ for (const onRequest of hooks.onRequest) if (onRequest) {
695
+ const res = await onRequest(context);
696
+ if (typeof res === "object" && res !== null) context = res;
697
+ }
698
+ if ("pipeTo" in context && typeof context.pipeTo === "function" || typeof ((_b = options == null ? void 0 : options.body) == null ? void 0 : _b.pipe) === "function") {
699
+ if (!("duplex" in context)) context.duplex = "half";
700
+ }
701
+ const { clearTimeout: clearTimeout2 } = getTimeout(opts, controller);
702
+ let response = await fetch(context.url, context);
703
+ clearTimeout2();
704
+ const responseContext = {
705
+ response,
706
+ request: context
707
+ };
708
+ for (const onResponse of hooks.onResponse) if (onResponse) {
709
+ const r = await onResponse(__spreadProps(__spreadValues({}, responseContext), { response: ((_c = options == null ? void 0 : options.hookOptions) == null ? void 0 : _c.cloneResponse) ? response.clone() : response }));
710
+ if (r instanceof Response) response = r;
711
+ else if (typeof r === "object" && r !== null) response = r.response;
712
+ }
713
+ if (response.ok) {
714
+ if (!(context.method !== "HEAD")) return {
715
+ data: "",
716
+ error: null
717
+ };
718
+ const responseType = detectResponseType(response);
719
+ const successContext = {
720
+ data: null,
721
+ response,
722
+ request: context
723
+ };
724
+ if (responseType === "json" || responseType === "text") {
725
+ const text = await response.text();
726
+ successContext.data = await ((_d = context.jsonParser) != null ? _d : jsonParse)(text);
727
+ } else successContext.data = await response[responseType]();
728
+ if (context == null ? void 0 : context.output) {
729
+ if (context.output && !context.disableValidation) successContext.data = await parseStandardSchema(context.output, successContext.data);
730
+ }
731
+ for (const onSuccess of hooks.onSuccess) if (onSuccess) await onSuccess(__spreadProps(__spreadValues({}, successContext), { response: ((_e = options == null ? void 0 : options.hookOptions) == null ? void 0 : _e.cloneResponse) ? response.clone() : response }));
732
+ if (options == null ? void 0 : options.throw) return successContext.data;
733
+ return {
734
+ data: successContext.data,
735
+ error: null
736
+ };
737
+ }
738
+ const parser = (_f = options == null ? void 0 : options.jsonParser) != null ? _f : jsonParse;
739
+ const responseText = await response.text();
740
+ const isJSONResponse = isJSONParsable(responseText);
741
+ const errorObject = isJSONResponse ? await parser(responseText) : null;
742
+ const errorContext = {
743
+ response,
744
+ responseText,
745
+ request: context,
746
+ error: __spreadProps(__spreadValues({}, errorObject), {
747
+ status: response.status,
748
+ statusText: response.statusText
749
+ })
750
+ };
751
+ for (const onError of hooks.onError) if (onError) await onError(__spreadProps(__spreadValues({}, errorContext), { response: ((_g = options == null ? void 0 : options.hookOptions) == null ? void 0 : _g.cloneResponse) ? response.clone() : response }));
752
+ if (options == null ? void 0 : options.retry) {
753
+ const retryStrategy = createRetryStrategy(options.retry);
754
+ const _retryAttempt = (_h = options.retryAttempt) != null ? _h : 0;
755
+ if (await retryStrategy.shouldAttemptRetry(_retryAttempt, response)) {
756
+ for (const onRetry of hooks.onRetry) if (onRetry) await onRetry(responseContext);
757
+ const delay = retryStrategy.getDelay(_retryAttempt);
758
+ await new Promise((resolve) => setTimeout(resolve, delay));
759
+ return await betterFetch(url, __spreadProps(__spreadValues({}, options), { retryAttempt: _retryAttempt + 1 }));
760
+ }
761
+ }
762
+ if (options == null ? void 0 : options.throw) throw new BetterFetchError(response.status, response.statusText, isJSONResponse ? errorObject : responseText);
763
+ return {
764
+ data: null,
765
+ error: __spreadProps(__spreadValues({}, errorObject), {
766
+ status: response.status,
767
+ statusText: response.statusText
768
+ })
769
+ };
770
+ };
771
+ //#endregion
772
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/plugins/access/access.mjs
773
+ function role(statements) {
774
+ return {
775
+ authorize(request, connector = "AND") {
776
+ let success = false;
777
+ for (const [requestedResource, requestedActions] of Object.entries(request)) {
778
+ const allowedActions = statements[requestedResource];
779
+ if (!allowedActions) return {
780
+ success: false,
781
+ error: `You are not allowed to access resource: ${requestedResource}`
782
+ };
783
+ if (Array.isArray(requestedActions)) success = requestedActions.every((requestedAction) => allowedActions.includes(requestedAction));
784
+ else if (typeof requestedActions === "object") {
785
+ const actions = requestedActions;
786
+ if (actions.connector === "OR") success = actions.actions.some((requestedAction) => allowedActions.includes(requestedAction));
787
+ else success = actions.actions.every((requestedAction) => allowedActions.includes(requestedAction));
788
+ } else throw new BetterAuthError("Invalid access control request");
789
+ if (success && connector === "OR") return { success };
790
+ if (!success && connector === "AND") return {
791
+ success: false,
792
+ error: `unauthorized to access resource "${requestedResource}"`
793
+ };
794
+ }
795
+ if (success) return { success };
796
+ return {
797
+ success: false,
798
+ error: "Not authorized"
799
+ };
800
+ },
801
+ statements
802
+ };
803
+ }
804
+ function createAccessControl(s) {
805
+ return {
806
+ newRole(statements) {
807
+ return role(statements);
808
+ },
809
+ statements: s
810
+ };
811
+ }
812
+ defineErrorCodes({ INVALID_SESSION_TOKEN: "Invalid session token" });
813
+ defineErrorCodes({
814
+ OTP_NOT_ENABLED: "OTP not enabled",
815
+ OTP_HAS_EXPIRED: "OTP has expired",
816
+ TOTP_NOT_ENABLED: "TOTP not enabled",
817
+ TWO_FACTOR_NOT_ENABLED: "Two factor isn't enabled",
818
+ BACKUP_CODES_NOT_ENABLED: "Backup codes aren't enabled",
819
+ INVALID_BACKUP_CODE: "Invalid backup code",
820
+ INVALID_CODE: "Invalid code",
821
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: "Too many attempts. Please request a new code.",
822
+ INVALID_TWO_FACTOR_COOKIE: "Invalid two factor cookie"
823
+ });
824
+ //#endregion
825
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/plugins/username/error-codes.mjs
826
+ var USERNAME_ERROR_CODES = defineErrorCodes({
827
+ INVALID_USERNAME_OR_PASSWORD: "Invalid username or password",
828
+ EMAIL_NOT_VERIFIED: "Email not verified",
829
+ UNEXPECTED_ERROR: "Unexpected error",
830
+ USERNAME_IS_ALREADY_TAKEN: "Username is already taken. Please try another.",
831
+ USERNAME_TOO_SHORT: "Username is too short",
832
+ USERNAME_TOO_LONG: "Username is too long",
833
+ INVALID_USERNAME: "Username is invalid",
834
+ INVALID_DISPLAY_USERNAME: "Display username is invalid"
835
+ });
836
+ var defaultAc$1 = createAccessControl({
837
+ user: [
838
+ "create",
839
+ "list",
840
+ "set-role",
841
+ "ban",
842
+ "impersonate",
843
+ "impersonate-admins",
844
+ "delete",
845
+ "set-password",
846
+ "get",
847
+ "update"
848
+ ],
849
+ session: [
850
+ "list",
851
+ "revoke",
852
+ "delete"
853
+ ]
854
+ });
855
+ var adminAc$1 = defaultAc$1.newRole({
856
+ user: [
857
+ "create",
858
+ "list",
859
+ "set-role",
860
+ "ban",
861
+ "impersonate",
862
+ "delete",
863
+ "set-password",
864
+ "get",
865
+ "update"
866
+ ],
867
+ session: [
868
+ "list",
869
+ "revoke",
870
+ "delete"
871
+ ]
872
+ });
873
+ var userAc = defaultAc$1.newRole({
874
+ user: [],
875
+ session: []
876
+ });
877
+ var defaultRoles = {
878
+ admin: adminAc$1,
879
+ user: userAc
880
+ };
881
+ //#endregion
882
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/plugins/admin/error-codes.mjs
883
+ var ADMIN_ERROR_CODES = defineErrorCodes({
884
+ FAILED_TO_CREATE_USER: "Failed to create user",
885
+ USER_ALREADY_EXISTS: "User already exists.",
886
+ USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.",
887
+ YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself",
888
+ YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role",
889
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users",
890
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users",
891
+ YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions",
892
+ YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users",
893
+ YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users",
894
+ YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions",
895
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users",
896
+ YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password",
897
+ BANNED_USER: "You have been banned from this application",
898
+ YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user",
899
+ NO_DATA_TO_UPDATE: "No data to update",
900
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users",
901
+ YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself",
902
+ YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value",
903
+ YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins",
904
+ INVALID_ROLE_TYPE: "Invalid role type"
905
+ });
906
+ //#endregion
907
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/plugins/admin/has-permission.mjs
908
+ var hasPermission = (input) => {
909
+ if (input.userId && input.options?.adminUserIds?.includes(input.userId)) return true;
910
+ if (!input.permissions) return false;
911
+ const roles = (input.role || input.options?.defaultRole || "user").split(",");
912
+ const acRoles = input.options?.roles || defaultRoles;
913
+ for (const role of roles) if ((acRoles[role]?.authorize(input.permissions))?.success) return true;
914
+ return false;
915
+ };
916
+ //#endregion
917
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/plugins/anonymous/error-codes.mjs
918
+ var ANONYMOUS_ERROR_CODES = defineErrorCodes({
919
+ INVALID_EMAIL_FORMAT: "Email was not generated in a valid format",
920
+ FAILED_TO_CREATE_USER: "Failed to create user",
921
+ COULD_NOT_CREATE_SESSION: "Could not create session",
922
+ ANONYMOUS_USERS_CANNOT_SIGN_IN_AGAIN_ANONYMOUSLY: "Anonymous users cannot sign in again anonymously",
923
+ FAILED_TO_DELETE_ANONYMOUS_USER: "Failed to delete anonymous user",
924
+ USER_IS_NOT_ANONYMOUS: "User is not anonymous",
925
+ DELETE_ANONYMOUS_USER_DISABLED: "Deleting anonymous users is disabled"
926
+ });
927
+ defineErrorCodes({
928
+ OTP_EXPIRED: "OTP expired",
929
+ INVALID_OTP: "Invalid OTP",
930
+ TOO_MANY_ATTEMPTS: "Too many attempts"
931
+ });
932
+ defineErrorCodes({
933
+ INVALID_OAUTH_CONFIGURATION: "Invalid OAuth configuration",
934
+ TOKEN_URL_NOT_FOUND: "Invalid OAuth configuration. Token URL not found.",
935
+ PROVIDER_CONFIG_NOT_FOUND: "No config found for provider",
936
+ PROVIDER_ID_REQUIRED: "Provider ID is required",
937
+ INVALID_OAUTH_CONFIG: "Invalid OAuth configuration.",
938
+ SESSION_REQUIRED: "Session is required",
939
+ ISSUER_MISMATCH: "OAuth issuer mismatch. The authorization server issuer does not match the expected value (RFC 9207).",
940
+ ISSUER_MISSING: "OAuth issuer parameter missing. The authorization server did not include the required iss parameter (RFC 9207)."
941
+ });
942
+ //#endregion
943
+ //#region ../../node_modules/.bun/better-auth@1.5.6+a1a83433c99f55aa/node_modules/better-auth/dist/client/parser.mjs
944
+ var PROTO_POLLUTION_PATTERNS = {
945
+ proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
946
+ constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
947
+ protoShort: /"__proto__"\s*:/,
948
+ constructorShort: /"constructor"\s*:/
949
+ };
950
+ var JSON_SIGNATURE = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
951
+ var SPECIAL_VALUES = {
952
+ true: true,
953
+ false: false,
954
+ null: null,
955
+ undefined: void 0,
956
+ nan: NaN,
957
+ infinity: Number.POSITIVE_INFINITY,
958
+ "-infinity": Number.NEGATIVE_INFINITY
959
+ };
960
+ var ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;
961
+ function isValidDate(date) {
962
+ return date instanceof Date && !isNaN(date.getTime());
963
+ }
964
+ function parseISODate(value) {
965
+ const match = ISO_DATE_REGEX.exec(value);
966
+ if (!match) return null;
967
+ const [, year, month, day, hour, minute, second, ms, offsetSign, offsetHour, offsetMinute] = match;
968
+ const date = new Date(Date.UTC(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10), ms ? parseInt(ms.padEnd(3, "0"), 10) : 0));
969
+ if (offsetSign) {
970
+ const offset = (parseInt(offsetHour, 10) * 60 + parseInt(offsetMinute, 10)) * (offsetSign === "+" ? -1 : 1);
971
+ date.setUTCMinutes(date.getUTCMinutes() + offset);
972
+ }
973
+ return isValidDate(date) ? date : null;
974
+ }
975
+ function betterJSONParse(value, options = {}) {
976
+ const { strict = false, warnings = false, reviver, parseDates = true } = options;
977
+ if (typeof value !== "string") return value;
978
+ const trimmed = value.trim();
979
+ if (trimmed.length > 0 && trimmed[0] === "\"" && trimmed.endsWith("\"") && !trimmed.slice(1, -1).includes("\"")) return trimmed.slice(1, -1);
980
+ const lowerValue = trimmed.toLowerCase();
981
+ if (lowerValue.length <= 9 && lowerValue in SPECIAL_VALUES) return SPECIAL_VALUES[lowerValue];
982
+ if (!JSON_SIGNATURE.test(trimmed)) {
983
+ if (strict) throw new SyntaxError("[better-json] Invalid JSON");
984
+ return value;
985
+ }
986
+ if (Object.entries(PROTO_POLLUTION_PATTERNS).some(([key, pattern]) => {
987
+ const matches = pattern.test(trimmed);
988
+ if (matches && warnings) console.warn(`[better-json] Detected potential prototype pollution attempt using ${key} pattern`);
989
+ return matches;
990
+ }) && strict) throw new Error("[better-json] Potential prototype pollution attempt detected");
991
+ try {
992
+ const secureReviver = (key, value) => {
993
+ if (key === "__proto__" || key === "constructor" && value && typeof value === "object" && "prototype" in value) {
994
+ if (warnings) console.warn(`[better-json] Dropping "${key}" key to prevent prototype pollution`);
995
+ return;
996
+ }
997
+ if (parseDates && typeof value === "string") {
998
+ const date = parseISODate(value);
999
+ if (date) return date;
1000
+ }
1001
+ return reviver ? reviver(key, value) : value;
1002
+ };
1003
+ return JSON.parse(trimmed, secureReviver);
1004
+ } catch (error) {
1005
+ if (strict) throw error;
1006
+ return value;
1007
+ }
1008
+ }
1009
+ function parseJSON(value, options = { strict: true }) {
1010
+ return betterJSONParse(value, options);
1011
+ }
1012
+ var defaultAc = createAccessControl({
1013
+ organization: ["update", "delete"],
1014
+ member: [
1015
+ "create",
1016
+ "update",
1017
+ "delete"
1018
+ ],
1019
+ invitation: ["create", "cancel"],
1020
+ team: [
1021
+ "create",
1022
+ "update",
1023
+ "delete"
1024
+ ],
1025
+ ac: [
1026
+ "create",
1027
+ "read",
1028
+ "update",
1029
+ "delete"
1030
+ ]
1031
+ });
1032
+ defaultAc.newRole({
1033
+ organization: ["update"],
1034
+ invitation: ["create", "cancel"],
1035
+ member: [
1036
+ "create",
1037
+ "update",
1038
+ "delete"
1039
+ ],
1040
+ team: [
1041
+ "create",
1042
+ "update",
1043
+ "delete"
1044
+ ],
1045
+ ac: [
1046
+ "create",
1047
+ "read",
1048
+ "update",
1049
+ "delete"
1050
+ ]
1051
+ });
1052
+ defaultAc.newRole({
1053
+ organization: ["update", "delete"],
1054
+ member: [
1055
+ "create",
1056
+ "update",
1057
+ "delete"
1058
+ ],
1059
+ invitation: ["create", "cancel"],
1060
+ team: [
1061
+ "create",
1062
+ "update",
1063
+ "delete"
1064
+ ],
1065
+ ac: [
1066
+ "create",
1067
+ "read",
1068
+ "update",
1069
+ "delete"
1070
+ ]
1071
+ });
1072
+ defaultAc.newRole({
1073
+ organization: [],
1074
+ member: [],
1075
+ invitation: [],
1076
+ team: [],
1077
+ ac: ["read"]
1078
+ });
1079
+ defineErrorCodes({
1080
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: "You are not allowed to create a new organization",
1081
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: "You have reached the maximum number of organizations",
1082
+ ORGANIZATION_ALREADY_EXISTS: "Organization already exists",
1083
+ ORGANIZATION_SLUG_ALREADY_TAKEN: "Organization slug already taken",
1084
+ ORGANIZATION_NOT_FOUND: "Organization not found",
1085
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: "User is not a member of the organization",
1086
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: "You are not allowed to update this organization",
1087
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: "You are not allowed to delete this organization",
1088
+ NO_ACTIVE_ORGANIZATION: "No active organization",
1089
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: "User is already a member of this organization",
1090
+ MEMBER_NOT_FOUND: "Member not found",
1091
+ ROLE_NOT_FOUND: "Role not found",
1092
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: "You are not allowed to create a new team",
1093
+ TEAM_ALREADY_EXISTS: "Team already exists",
1094
+ TEAM_NOT_FOUND: "Team not found",
1095
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: "You cannot leave the organization as the only owner",
1096
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: "You cannot leave the organization without an owner",
1097
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: "You are not allowed to delete this member",
1098
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: "You are not allowed to invite users to this organization",
1099
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: "User is already invited to this organization",
1100
+ INVITATION_NOT_FOUND: "Invitation not found",
1101
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: "You are not the recipient of the invitation",
1102
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: "Email verification required before accepting or rejecting invitation",
1103
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: "You are not allowed to cancel this invitation",
1104
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: "Inviter is no longer a member of the organization",
1105
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: "You are not allowed to invite a user with this role",
1106
+ FAILED_TO_RETRIEVE_INVITATION: "Failed to retrieve invitation",
1107
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: "You have reached the maximum number of teams",
1108
+ UNABLE_TO_REMOVE_LAST_TEAM: "Unable to remove last team",
1109
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: "You are not allowed to update this member",
1110
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: "Organization membership limit reached",
1111
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to create teams in this organization",
1112
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: "You are not allowed to delete teams in this organization",
1113
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: "You are not allowed to update this team",
1114
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: "You are not allowed to delete this team",
1115
+ INVITATION_LIMIT_REACHED: "Invitation limit reached",
1116
+ TEAM_MEMBER_LIMIT_REACHED: "Team member limit reached",
1117
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: "User is not a member of the team",
1118
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: "You are not allowed to list the members of this team",
1119
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: "You do not have an active team",
1120
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: "You are not allowed to create a new member",
1121
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: "You are not allowed to remove a team member",
1122
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: "You are not allowed to access this organization as an owner",
1123
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: "You are not a member of this organization",
1124
+ MISSING_AC_INSTANCE: "Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information",
1125
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: "You must be in an organization to create a role",
1126
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: "You are not allowed to create a role",
1127
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: "You are not allowed to update a role",
1128
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: "You are not allowed to delete a role",
1129
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: "You are not allowed to read a role",
1130
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: "You are not allowed to list a role",
1131
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: "You are not allowed to get a role",
1132
+ TOO_MANY_ROLES: "This organization has too many roles",
1133
+ INVALID_RESOURCE: "The provided permission includes an invalid resource",
1134
+ ROLE_NAME_IS_ALREADY_TAKEN: "That role name is already taken",
1135
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: "Cannot delete a pre-defined role",
1136
+ ROLE_IS_ASSIGNED_TO_MEMBERS: "Cannot delete a role that is assigned to members. Please reassign the members to a different role first"
1137
+ });
1138
+ defineErrorCodes({
1139
+ INVALID_PHONE_NUMBER: "Invalid phone number",
1140
+ PHONE_NUMBER_EXIST: "Phone number already exists",
1141
+ PHONE_NUMBER_NOT_EXIST: "phone number isn't registered",
1142
+ INVALID_PHONE_NUMBER_OR_PASSWORD: "Invalid phone number or password",
1143
+ UNEXPECTED_ERROR: "Unexpected error",
1144
+ OTP_NOT_FOUND: "OTP not found",
1145
+ OTP_EXPIRED: "OTP expired",
1146
+ INVALID_OTP: "Invalid OTP",
1147
+ PHONE_NUMBER_NOT_VERIFIED: "Phone number not verified",
1148
+ PHONE_NUMBER_CANNOT_BE_UPDATED: "Phone number cannot be updated",
1149
+ SEND_OTP_NOT_IMPLEMENTED: "sendOTP not implemented",
1150
+ TOO_MANY_ATTEMPTS: "Too many attempts"
1151
+ });
1152
+ //#endregion
1153
+ export { isDynamicBaseURLConfig as _, adminAc$1 as a, USERNAME_ERROR_CODES as c, createDefu as d, defu as f, getProtocol as g, getOrigin as h, ADMIN_ERROR_CODES as i, betterFetch as l, getHost as m, ANONYMOUS_ERROR_CODES as n, defaultRoles as o, getBaseURL as p, hasPermission as r, userAc as s, parseJSON as t, createFetch as u, resolveBaseURL as v, wildcardMatch as y };