dineway 0.1.45 → 0.1.46

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 (387) hide show
  1. package/dist/{activity-events-CpcTzKpF.mjs → activity-events-CNk3clTT.mjs} +1 -1
  2. package/dist/{allowed-origins-3RuuoFjC.mjs → allowed-origins-DhipQNLb.mjs} +1 -1
  3. package/dist/api/route-utils.d.mts +9 -10
  4. package/dist/api/route-utils.mjs +13 -13
  5. package/dist/api/schemas/index.d.mts +2 -2
  6. package/dist/api/schemas/index.mjs +4 -4
  7. package/dist/{api-DkFSCD74.mjs → api-Bmfii2mH.mjs} +101 -56
  8. package/dist/{api-tokens-BFg7tiOQ.mjs → api-tokens-DtvdtIkm.mjs} +1 -1
  9. package/dist/{apply-TIoQ00aH.mjs → apply-BpRBCqUt.mjs} +76 -31
  10. package/dist/astro/index.d.mts +10 -11
  11. package/dist/astro/index.mjs +23 -3
  12. package/dist/astro/middleware/auth.d.mts +9 -10
  13. package/dist/astro/middleware/auth.mjs +5 -5
  14. package/dist/astro/middleware/redirect.mjs +13 -7
  15. package/dist/astro/middleware/request-context.mjs +3 -3
  16. package/dist/astro/middleware/seed.d.mts +1 -1
  17. package/dist/astro/middleware/seed.mjs +2 -2
  18. package/dist/astro/middleware/setup.mjs +1 -1
  19. package/dist/astro/middleware.mjs +120 -82
  20. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
  21. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
  22. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  23. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  24. package/dist/astro/routes/api/admin/briefing.mjs +17 -17
  25. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.d.mts +7 -0
  26. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +17 -0
  27. package/dist/astro/routes/api/admin/byline-fields/_slug_.d.mts +9 -0
  28. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +38 -0
  29. package/dist/astro/routes/api/admin/byline-fields/index.d.mts +8 -0
  30. package/dist/astro/routes/api/admin/byline-fields/index.mjs +31 -0
  31. package/dist/astro/routes/api/admin/byline-fields/reorder.d.mts +7 -0
  32. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +24 -0
  33. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +27 -27
  34. package/dist/astro/routes/api/admin/bylines/_id_/translations.d.mts +8 -0
  35. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +57 -0
  36. package/dist/astro/routes/api/admin/bylines/index.mjs +30 -26
  37. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +11 -11
  38. package/dist/astro/routes/api/admin/comments/_id_.mjs +5 -5
  39. package/dist/astro/routes/api/admin/comments/bulk.mjs +9 -9
  40. package/dist/astro/routes/api/admin/comments/counts.mjs +5 -5
  41. package/dist/astro/routes/api/admin/comments/index.mjs +9 -9
  42. package/dist/astro/routes/api/admin/context/_id_/history.mjs +23 -23
  43. package/dist/astro/routes/api/admin/context/_id_/index.mjs +23 -23
  44. package/dist/astro/routes/api/admin/context/_id_/review.mjs +27 -27
  45. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +27 -27
  46. package/dist/astro/routes/api/admin/context/diff.mjs +26 -26
  47. package/dist/astro/routes/api/admin/context/index.mjs +27 -27
  48. package/dist/astro/routes/api/admin/context/stale.mjs +26 -26
  49. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +23 -23
  50. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +26 -26
  51. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +26 -26
  52. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +24 -24
  53. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +2 -2
  54. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  55. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  56. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +48 -44
  57. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +48 -44
  58. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +42 -38
  59. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +47 -43
  60. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +47 -43
  61. package/dist/astro/routes/api/admin/plugins/index.mjs +42 -38
  62. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  63. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +42 -38
  64. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +47 -43
  65. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +42 -38
  66. package/dist/astro/routes/api/admin/plugins/updates.mjs +42 -38
  67. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
  68. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +26 -26
  69. package/dist/astro/routes/api/admin/review-requests/index.mjs +9 -9
  70. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +42 -38
  71. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  72. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +42 -38
  73. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
  74. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  75. package/dist/astro/routes/api/admin/users/_id_/index.mjs +5 -5
  76. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +2 -2
  77. package/dist/astro/routes/api/admin/users/index.mjs +5 -5
  78. package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
  79. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  80. package/dist/astro/routes/api/auth/invite/complete.mjs +9 -9
  81. package/dist/astro/routes/api/auth/invite/index.mjs +6 -6
  82. package/dist/astro/routes/api/auth/invite/register-options.mjs +8 -8
  83. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  84. package/dist/astro/routes/api/auth/magic-link/send.mjs +8 -8
  85. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  86. package/dist/astro/routes/api/auth/me.mjs +20 -11
  87. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  88. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
  89. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  90. package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
  91. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  92. package/dist/astro/routes/api/auth/passkey/options.mjs +10 -10
  93. package/dist/astro/routes/api/auth/passkey/register/options.mjs +8 -8
  94. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +9 -9
  95. package/dist/astro/routes/api/auth/passkey/verify.mjs +9 -9
  96. package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
  97. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  98. package/dist/astro/routes/api/auth/signup/complete.mjs +9 -9
  99. package/dist/astro/routes/api/auth/signup/request.mjs +8 -8
  100. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  101. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +12 -12
  102. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  103. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +5 -5
  104. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +5 -5
  105. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +5 -5
  106. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -11
  107. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +9 -9
  108. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +5 -5
  109. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  110. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +9 -9
  111. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +20 -14
  112. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  113. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +5 -5
  114. package/dist/astro/routes/api/content/_collection_/_id_.mjs +12 -10
  115. package/dist/astro/routes/api/content/_collection_/index.mjs +9 -9
  116. package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
  117. package/dist/astro/routes/api/dashboard.mjs +8 -8
  118. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  119. package/dist/astro/routes/api/health.mjs +1 -1
  120. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  121. package/dist/astro/routes/api/import/probe.mjs +10 -10
  122. package/dist/astro/routes/api/import/wordpress/analyze.mjs +7 -7
  123. package/dist/astro/routes/api/import/wordpress/execute.mjs +29 -28
  124. package/dist/astro/routes/api/import/wordpress/media.mjs +10 -10
  125. package/dist/astro/routes/api/import/wordpress/prepare.mjs +31 -31
  126. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +5 -1
  127. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +16 -1
  128. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +30 -30
  129. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  130. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +13 -13
  131. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
  132. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +31 -30
  133. package/dist/astro/routes/api/manifest.mjs +4 -4
  134. package/dist/astro/routes/api/mcp.mjs +75 -50
  135. package/dist/astro/routes/api/media/_id_/confirm.mjs +8 -8
  136. package/dist/astro/routes/api/media/_id_.mjs +6 -6
  137. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  138. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  139. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  140. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  141. package/dist/astro/routes/api/media/upload-url.mjs +10 -10
  142. package/dist/astro/routes/api/media.mjs +14 -13
  143. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +27 -27
  144. package/dist/astro/routes/api/menus/_name_/items.mjs +27 -27
  145. package/dist/astro/routes/api/menus/_name_/reorder.mjs +27 -27
  146. package/dist/astro/routes/api/menus/_name_/translations.mjs +27 -27
  147. package/dist/astro/routes/api/menus/_name_.mjs +27 -27
  148. package/dist/astro/routes/api/menus/index.mjs +27 -27
  149. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  150. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  151. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  152. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  153. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  154. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  155. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  156. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  157. package/dist/astro/routes/api/openapi.json.mjs +10 -7
  158. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
  159. package/dist/astro/routes/api/redirects/404s/index.mjs +10 -10
  160. package/dist/astro/routes/api/redirects/404s/summary.mjs +10 -10
  161. package/dist/astro/routes/api/redirects/_id_.mjs +28 -28
  162. package/dist/astro/routes/api/redirects/index.mjs +28 -28
  163. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  164. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  165. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +43 -39
  166. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +43 -39
  167. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +43 -39
  168. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +43 -39
  169. package/dist/astro/routes/api/schema/collections/index.mjs +43 -39
  170. package/dist/astro/routes/api/schema/index.mjs +7 -7
  171. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +42 -38
  172. package/dist/astro/routes/api/schema/orphans/index.mjs +42 -38
  173. package/dist/astro/routes/api/search/enable.mjs +11 -11
  174. package/dist/astro/routes/api/search/index.mjs +10 -10
  175. package/dist/astro/routes/api/search/rebuild.mjs +11 -11
  176. package/dist/astro/routes/api/search/stats.mjs +7 -7
  177. package/dist/astro/routes/api/search/suggest.mjs +10 -10
  178. package/dist/astro/routes/api/sections/_slug_.mjs +27 -27
  179. package/dist/astro/routes/api/sections/index.mjs +27 -27
  180. package/dist/astro/routes/api/settings/email.mjs +3 -3
  181. package/dist/astro/routes/api/settings.mjs +27 -27
  182. package/dist/astro/routes/api/setup/admin-verify.mjs +11 -11
  183. package/dist/astro/routes/api/setup/admin.mjs +9 -9
  184. package/dist/astro/routes/api/setup/dev-bypass.mjs +24 -23
  185. package/dist/astro/routes/api/setup/dev-reset.mjs +1 -1
  186. package/dist/astro/routes/api/setup/index.mjs +25 -24
  187. package/dist/astro/routes/api/setup/status.mjs +3 -3
  188. package/dist/astro/routes/api/snapshot.mjs +7 -6
  189. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +30 -29
  190. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +30 -29
  191. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +30 -29
  192. package/dist/astro/routes/api/taxonomies/index.mjs +30 -29
  193. package/dist/astro/routes/api/themes/preview.mjs +4 -4
  194. package/dist/astro/routes/api/typegen.mjs +4 -4
  195. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  196. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  197. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  198. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +26 -26
  199. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +27 -27
  200. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +27 -27
  201. package/dist/astro/routes/api/widget-areas/_name_.mjs +25 -25
  202. package/dist/astro/routes/api/widget-areas/index.mjs +27 -27
  203. package/dist/astro/routes/api/widget-components.mjs +2 -2
  204. package/dist/astro/routes/robots.txt.mjs +7 -7
  205. package/dist/astro/routes/sitemap-_collection_.xml.mjs +59 -15
  206. package/dist/astro/routes/sitemap.xml.mjs +8 -8
  207. package/dist/astro/session-driver.d.mts +1 -1
  208. package/dist/astro/session-driver.mjs +3 -3
  209. package/dist/astro/types.d.mts +16 -14
  210. package/dist/{audit-NgiRzqP9.mjs → audit-DuRbTm8L.mjs} +1 -1
  211. package/dist/auth/providers/github.d.mts +1 -1
  212. package/dist/auth/providers/google.d.mts +1 -1
  213. package/dist/{auth-control-guard-1FHtkDP6.mjs → auth-control-guard-Dr14I98m.mjs} +1 -1
  214. package/dist/{authorize-BbIhZi3a.mjs → authorize-BLO0m7fW.mjs} +1 -1
  215. package/dist/{briefing-Jsxs587i.mjs → briefing-BFEWeJtR.mjs} +6 -6
  216. package/dist/{briefing-DD82WaEy.mjs → briefing-C4fJSVYW.mjs} +1 -1
  217. package/dist/byline-CXQcMsBu.mjs +628 -0
  218. package/dist/{bylines-BU6b8jSi.d.mts → byline-fields-CaF_xfpj.d.mts} +146 -15
  219. package/dist/{import-Br7aP9yh.mjs → byline-fields-D7TJ_oHF.mjs} +57 -3
  220. package/dist/byline-fields-Dc7L6Yry.mjs +113 -0
  221. package/dist/byline-registry-CL8BxPPp.mjs +287 -0
  222. package/dist/bylines-BgriNlW7.mjs +165 -0
  223. package/dist/bylines-D2vqm1aZ.mjs +163 -0
  224. package/dist/{cache-DQyZ-QaB.mjs → cache-GRK71jOU.mjs} +2 -2
  225. package/dist/{chunks-D8KL0nCY.mjs → chunks-DgEw12Bc.mjs} +1 -1
  226. package/dist/cli/index.mjs +958 -89
  227. package/dist/client/external-auth-headers.d.mts +1 -1
  228. package/dist/client/index.d.mts +2 -1
  229. package/dist/client/index.mjs +5 -2
  230. package/dist/{comment-BmJXz3lc.mjs → comment-ogMaF1gk.mjs} +1 -1
  231. package/dist/{comments-yTbeIYc2.mjs → comments-CTSOKrZq.mjs} +1 -1
  232. package/dist/{connection-BCNICDWN.mjs → connection-CiJWiWya.mjs} +44 -13
  233. package/dist/{content-DvpMad_N.mjs → content-BfyjOiMi.mjs} +24 -4
  234. package/dist/content-index-names-Bbu1FY1r.mjs +26 -0
  235. package/dist/{context-DgqEfcWz.mjs → context-DRhmPCiE.mjs} +2 -2
  236. package/dist/{context-Ufrm1lOv.mjs → context-ZMHhwzkG.mjs} +8 -8
  237. package/dist/{context-route-helpers-Dq5U_AXp.mjs → context-route-helpers-YLWx2N1j.mjs} +1 -1
  238. package/dist/{dashboard-BC9bgPOH.mjs → dashboard-D0gWuzNp.mjs} +4 -4
  239. package/dist/db/index.d.mts +3 -3
  240. package/dist/db/index.mjs +2 -2
  241. package/dist/db/libsql.d.mts +1 -1
  242. package/dist/db/libsql.mjs +1 -1
  243. package/dist/db/postgres.d.mts +1 -1
  244. package/dist/db/sqlite.d.mts +1 -1
  245. package/dist/db/sqlite.mjs +1 -1
  246. package/dist/{device-flow-CTS91g4A.mjs → device-flow-BL5ZRlc1.mjs} +4 -4
  247. package/dist/{dialect-helpers-TkdbkFad.mjs → dialect-helpers-fk43GbDb.mjs} +13 -3
  248. package/dist/{fts-manager-DnfOsF4s.mjs → fts-manager-EHY2Kes9.mjs} +2 -2
  249. package/dist/{hitl-requests-DaRuZ7tb.mjs → hitl-requests-B4Hkt0TO.mjs} +2 -2
  250. package/dist/{hitl-route-helpers-DcPySbZ3.mjs → hitl-route-helpers-CHjdfQ0s.mjs} +4 -4
  251. package/dist/{import-DSXK3aQF.mjs → import-CvHY6sf5.mjs} +3 -3
  252. package/dist/{index-BwOO3vu2.d.mts → index-DJVaYiUV.d.mts} +2 -2
  253. package/dist/index.d.mts +16 -17
  254. package/dist/index.mjs +69 -65
  255. package/dist/{jsonld-CLbYsYYH.d.mts → jsonld-AcPnCEGD.d.mts} +2 -2
  256. package/dist/{load-BCCcmoW9.mjs → load-BdbvtoDb.mjs} +1 -1
  257. package/dist/{loader-p2imNN98.mjs → loader-Y0QvC_QO.mjs} +167 -61
  258. package/dist/media/index.d.mts +1 -2
  259. package/dist/media/index.mjs +2 -2
  260. package/dist/media/local-runtime.d.mts +11 -12
  261. package/dist/media/local-runtime.mjs +2 -2
  262. package/dist/{media-Cg4zc9fq.mjs → media-DhBwiCYR.mjs} +6 -1
  263. package/dist/{media-allowlist-D8gsm8_t.mjs → media-allowlist-BsXkT9RK.mjs} +1 -1
  264. package/dist/{menus-DOaL6NaF.mjs → menus-BzGQpw9d.mjs} +2 -2
  265. package/dist/{menus-DzG3-9tQ.mjs → menus-fqqzXyHd.mjs} +5 -5
  266. package/dist/{oauth-authorization-DyOFXQWq.mjs → oauth-authorization-Dk3_LOfj.mjs} +4 -4
  267. package/dist/{oauth-clients-BMs_bmoz.mjs → oauth-clients-CzeMGyUU.mjs} +2 -2
  268. package/dist/page/index.d.mts +2 -2
  269. package/dist/page/index.mjs +1 -1
  270. package/dist/{parse-D7Tu6ku4.mjs → parse-CneSgl7-.mjs} +1 -1
  271. package/dist/{types-cn-fvYQ1.d.mts → placeholder-CXfoCtCd.d.mts} +38 -1
  272. package/dist/plugin-utils.d.mts +22 -10
  273. package/dist/plugin-utils.mjs +8 -10
  274. package/dist/plugins/adapt-sandbox-entry.d.mts +9 -10
  275. package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
  276. package/dist/{plugins-DCDVDF4B.mjs → plugins-BQ5Joz6v.mjs} +36 -6
  277. package/dist/{preview-BhgxNRWI.mjs → preview-D5rvDhRt.mjs} +7 -7
  278. package/dist/{provider-loader-B19YyyBp.d.mts → provider-loader-B5PMjpN7.d.mts} +1 -1
  279. package/dist/{query-BnRpB09I.mjs → query-BJuUydtD.mjs} +3 -3
  280. package/dist/{query-DHvNhBhi.mjs → query-CSx0EdSW.mjs} +30 -18
  281. package/dist/{rate-limit-BWP_kKiZ.mjs → rate-limit-i0G3IAOX.mjs} +2 -2
  282. package/dist/{redirect-BaVvo2te.mjs → redirect-BqFMj67n.mjs} +20 -6
  283. package/dist/{redirects-Ba-lJA5j.mjs → redirects-CJwHl_YG.mjs} +3 -3
  284. package/dist/{redirects-x5ol_Qj9.mjs → redirects-q_cToaHv.mjs} +29 -8
  285. package/dist/{registry-i__XP2WV.mjs → registry-Cq3QRBW2.mjs} +14 -5
  286. package/dist/{request-cache-BpwuE2ix.mjs → request-cache-w5cj5itT.mjs} +9 -1
  287. package/dist/{request-meta-DUGfAeXy.mjs → request-meta-DAb6xaP9.mjs} +1 -1
  288. package/dist/resolve-DTuDyYKs.mjs +100 -0
  289. package/dist/{review-requests-DuIxM4YM.mjs → review-requests-GYqjl2jO.mjs} +1 -1
  290. package/dist/{review-requests-CTUU_RJm.mjs → review-requests-tPw8_pAO.mjs} +1 -1
  291. package/dist/{runner-FhUNNaqA.d.mts → runner-Cnz4dl0f.d.mts} +1 -1
  292. package/dist/{runner-DF2DgD_B.mjs → runner-DTfG5v0G.mjs} +574 -196
  293. package/dist/{runtime-1bE80cmL.d.mts → runtime-Cd-kjPfN.d.mts} +1155 -273
  294. package/dist/runtime.d.mts +10 -11
  295. package/dist/runtime.mjs +4 -4
  296. package/dist/schema-DmHMWnSA.mjs +8 -0
  297. package/dist/{search-Cl9preJT.mjs → search-BAiFLz81.mjs} +3 -3
  298. package/dist/{sections-Zx-2q9IH.mjs → sections-DsuIrFDC.mjs} +2 -2
  299. package/dist/seed/index.d.mts +2 -2
  300. package/dist/seed/index.mjs +18 -17
  301. package/dist/seo/index.d.mts +1 -1
  302. package/dist/seo/index.mjs +1 -0
  303. package/dist/{seo-CJBiMDkj.mjs → seo-5lJOtB5J.mjs} +4 -2
  304. package/dist/{seo-BPb_reaG.mjs → seo-uMFBaR8G.mjs} +1 -1
  305. package/dist/{service-wPGgmbUa.mjs → service-CifrxCru.mjs} +2 -2
  306. package/dist/{settings-nr15a8uv.mjs → settings-BYGdocdj.mjs} +2 -2
  307. package/dist/{settings-DORe02PC.mjs → settings-DNRQuX3d.mjs} +3 -3
  308. package/dist/{site-activity-KFZprBZM.mjs → site-activity-6x1JccoR.mjs} +1 -1
  309. package/dist/{site-context-DuBQk6Mp.mjs → site-context-sN12ehZF.mjs} +13 -13
  310. package/dist/storage/local.d.mts +1 -1
  311. package/dist/storage/local.mjs +1 -1
  312. package/dist/storage/s3.d.mts +1 -1
  313. package/dist/storage/s3.mjs +1 -1
  314. package/dist/{taxonomies-DGaw_-aU.mjs → taxonomies-CQFmkP5u.mjs} +3 -3
  315. package/dist/{taxonomies-BVBKoXRf.mjs → taxonomies-faQVeMgj.mjs} +7 -32
  316. package/dist/{taxonomy-BvXRL85P.mjs → taxonomy-BnH-6VsX.mjs} +2 -2
  317. package/dist/{types-DvwHUku7.d.mts → types-B7_vSiPD.d.mts} +16 -0
  318. package/dist/{types-D1DjBFA9.mjs → types-Ck7-WoUD.mjs} +1 -1
  319. package/dist/{types-t7_nCCA9.d.mts → types-DEAQG87T.d.mts} +2 -56
  320. package/dist/{types-C-CMfzSl.d.mts → types-DYKtk8f1.d.mts} +31 -0
  321. package/dist/{types-C3Em8xpG.mjs → types-DbZhHtqS.mjs} +23 -1
  322. package/dist/{types-BIM7jwxr.d.mts → types-UGmU5sWx.d.mts} +1 -1
  323. package/dist/types-nP9vGUFq.d.mts +56 -0
  324. package/dist/ui/server-runtime.d.mts +13 -7
  325. package/dist/ui/server-runtime.mjs +18 -17
  326. package/dist/{user-2aI21yV1.mjs → user-CqZwN21P.mjs} +1 -1
  327. package/dist/{validate-CvQ6cvHH.d.mts → validate-BJuG-ISL.d.mts} +21 -3
  328. package/dist/{validate-JE-WfUQ5.mjs → validate-CK4a1sIF.mjs} +22 -2
  329. package/dist/version-Cg6ur4zS.mjs +6 -0
  330. package/dist/{widgets-Cj6ULpED.mjs → widgets-CdDvF4fV.mjs} +2 -2
  331. package/dist/{wordpress-slugs-hqItqJrQ.mjs → wordpress-slugs-B6Gw9q3Q.mjs} +1 -1
  332. package/dist/{zod-generator-C4BgFBZV.mjs → zod-generator-D1ROBNuC.mjs} +2 -2
  333. package/package.json +7 -8
  334. package/src/components/InlinePortableTextEditor.tsx +66 -0
  335. package/src/components/code-block-languages.ts +76 -0
  336. package/src/components/inline-code-block.tsx +241 -0
  337. package/dist/byline-DpNNSjET.mjs +0 -219
  338. package/dist/bylines-75_STR73.mjs +0 -114
  339. package/dist/chunk-ClPoSABd.mjs +0 -21
  340. package/dist/db-errors-DHJCB_gY.mjs +0 -23
  341. package/dist/index-Ct0pjZwW.d.mts +0 -835
  342. package/dist/placeholder-BZpCpid_.d.mts +0 -40
  343. package/dist/schema-U-SeFWwn.mjs +0 -8
  344. package/dist/version-DTpFm69w.mjs +0 -6
  345. /package/dist/{adapters-kZjS7plb.d.mts → adapters-OQCImOL7.d.mts} +0 -0
  346. /package/dist/{api-tokens-L0o9Bd7v.mjs → api-tokens-CYUoFGo7.mjs} +0 -0
  347. /package/dist/{challenge-store-cJam-E5R.mjs → challenge-store-CRSz-Xim.mjs} +0 -0
  348. /package/dist/{components-BJfa-F6n.mjs → components--pg6zBvu.mjs} +0 -0
  349. /package/dist/{config-XW5tMrH8.mjs → config-CVssduLe.mjs} +0 -0
  350. /package/dist/{context-types-BrSQNye5.mjs → context-types-DQh_XKkn.mjs} +0 -0
  351. /package/dist/{cron-D7FDsRu-.mjs → cron-DxCAU_Sn.mjs} +0 -0
  352. /package/dist/{default-5A3XVR7L.mjs → default-BHauvIdG.mjs} +0 -0
  353. /package/dist/{email-console-Bs1qKx59.mjs → email-console-BOVqIYpB.mjs} +0 -0
  354. /package/dist/{error-DLkgOP5m.mjs → error-DCSuUAZW.mjs} +0 -0
  355. /package/dist/{escape-r8_GbEU2.mjs → escape-BDgouFFY.mjs} +0 -0
  356. /package/dist/{experimental-workflows-BbZbIEZp.mjs → experimental-workflows-Dh4DUoD_.mjs} +0 -0
  357. /package/dist/{hash-DFFrkivP.mjs → hash-BPmX6P8I.mjs} +0 -0
  358. /package/dist/{manifest-schema-C6fzQoWn.mjs → manifest-schema-qh2P7RDX.mjs} +0 -0
  359. /package/dist/{mime-DYP4V5Ks.mjs → mime-8pAB8-77.mjs} +0 -0
  360. /package/dist/{mode-Bd55iLcP.mjs → mode-CpyEz8pe.mjs} +0 -0
  361. /package/dist/{normalize-BY_EJnd9.mjs → normalize-O-hi3a27.mjs} +0 -0
  362. /package/dist/{oauth-state-store-BRSUEkmx.mjs → oauth-state-store-qncPB_IU.mjs} +0 -0
  363. /package/dist/{oauth-user-lookup-DdcI8ZVL.mjs → oauth-user-lookup-BFjWF8wK.mjs} +0 -0
  364. /package/dist/{parser-egIGEco-.mjs → parser-DxfsARXL.mjs} +0 -0
  365. /package/dist/{passkey-config-AX4sjpQ4.mjs → passkey-config-DzHQK90v.mjs} +0 -0
  366. /package/dist/{patterns-CiyXeDgr.mjs → patterns-D9iDO3j8.mjs} +0 -0
  367. /package/dist/{placeholder-b0Ufu0La.mjs → placeholder-BDo81Is5.mjs} +0 -0
  368. /package/dist/{provider-loader-BdRV01gr.mjs → provider-loader-DzUxejk7.mjs} +0 -0
  369. /package/dist/{public-url-BL2r8dmQ.mjs → public-url-DLUM5OOv.mjs} +0 -0
  370. /package/dist/{redirect-Ce_6Yb6z.mjs → redirect-BjIBtDWY.mjs} +0 -0
  371. /package/dist/{secrets-DfeNNoLa.mjs → secrets-CN6FCpcB.mjs} +0 -0
  372. /package/dist/{seo-contributions-C0LXoWw3.mjs → seo-contributions-CqVvReEj.mjs} +0 -0
  373. /package/dist/{setup-complete-C2ztsNhJ.mjs → setup-complete-BytMc6HO.mjs} +0 -0
  374. /package/dist/{setup-nonce-BTKq7uBi.mjs → setup-nonce-pyGfc9hV.mjs} +0 -0
  375. /package/dist/{sidecar-client-lrf7ErYJ.mjs → sidecar-client-mJxwayYN.mjs} +0 -0
  376. /package/dist/{site-url-C18yBhtv.mjs → site-url-C-cu8Ff2.mjs} +0 -0
  377. /package/dist/{ssrf-KAIQS48_.mjs → ssrf-DiKqWd3N.mjs} +0 -0
  378. /package/dist/{tokens-CsP8Se8S.mjs → tokens-CjSgb0AC.mjs} +0 -0
  379. /package/dist/{transport-nNEGdHkI.d.mts → transport-DidKKxvW.d.mts} +0 -0
  380. /package/dist/{transport-B7kO-4ee.mjs → transport-LSdZVXHF.mjs} +0 -0
  381. /package/dist/{trusted-proxy-Bbm6PLR6.mjs → trusted-proxy-BgIIcbsN.mjs} +0 -0
  382. /package/dist/{types-CNNQ8l0v.mjs → types-Cg276-3z.mjs} +0 -0
  383. /package/dist/{types-BYjPylrZ.d.mts → types-DZpT-PnG.d.mts} +0 -0
  384. /package/dist/{types-BgE6gMFI.d.mts → types-Dryvv7LH.d.mts} +0 -0
  385. /package/dist/{types-BBETcziA.d.mts → types-GaCtZ1k9.d.mts} +0 -0
  386. /package/dist/{url-BzhfYtRn.mjs → url-w7Mp5qAD.mjs} +0 -0
  387. /package/dist/{utils-FEbQMgB5.mjs → utils-wv-zvC-Y.mjs} +0 -0
@@ -1,17 +1,18 @@
1
- import { a as ContentSeoInput, c as FindManyOptions, l as FindManyResult, o as CreateContentInput, r as ContentItem, t as BylineSummary, u as UpdateContentInput } from "./types-DvwHUku7.mjs";
2
- import { t as Database } from "./types-C-CMfzSl.mjs";
3
- import { A as PageMetadataContribution, B as PluginDefinition, D as PageFragmentContribution, H as PluginManifest, J as RequestMeta, O as PageFragmentEvent, W as PluginStorageConfig, X as ResolvedPlugin, a as CommentAfterModerateEvent, g as EmailMessage, h as CronEvent, j as PageMetadataEvent, r as CommentAfterCreateEvent, s as CommentBeforeCreateEvent, tt as StandardPluginDefinition, w as MediaItem$1 } from "./types-BIM7jwxr.mjs";
4
- import { a as Collection, b as UpdateFieldInput, c as CollectionWithFields, d as CreateFieldInput, p as Field, u as CreateCollectionInput, y as UpdateCollectionInput } from "./types-t7_nCCA9.mjs";
5
- import { r as AuthProviderDescriptor, t as AuthDescriptor } from "./types-BgE6gMFI.mjs";
6
- import { t as DatabaseDescriptor } from "./adapters-kZjS7plb.mjs";
7
- import { d as MediaProviderDescriptor } from "./types-cn-fvYQ1.mjs";
8
- import { xt as PortableTextBlock$1 } from "./index-Ct0pjZwW.mjs";
9
- import { S as ContentBylineInput } from "./index-BwOO3vu2.mjs";
10
- import { d as Storage } from "./types-BYjPylrZ.mjs";
1
+ import { _ as UpdateFieldInput, f as FieldValidation, g as UpdateCollectionInput, i as CollectionWithFields, o as CreateCollectionInput, s as CreateFieldInput, t as Collection, u as Field } from "./types-DEAQG87T.mjs";
2
+ import { a as ContentSeoInput, c as FindManyOptions, l as FindManyResult, o as CreateContentInput, r as ContentItem, t as BylineSummary, u as UpdateContentInput } from "./types-B7_vSiPD.mjs";
3
+ import { t as Database } from "./types-DYKtk8f1.mjs";
4
+ import { A as PageMetadataContribution, B as PluginDefinition, D as PageFragmentContribution, H as PluginManifest, J as RequestMeta, O as PageFragmentEvent, W as PluginStorageConfig, X as ResolvedPlugin, a as CommentAfterModerateEvent, g as EmailMessage, h as CronEvent, j as PageMetadataEvent, r as CommentAfterCreateEvent, s as CommentBeforeCreateEvent, tt as StandardPluginDefinition, w as MediaItem$1 } from "./types-UGmU5sWx.mjs";
5
+ import { r as AuthProviderDescriptor, t as AuthDescriptor } from "./types-Dryvv7LH.mjs";
6
+ import { t as DatabaseDescriptor } from "./adapters-OQCImOL7.mjs";
7
+ import { _ as MediaValue, m as MediaProviderDescriptor } from "./placeholder-CXfoCtCd.mjs";
8
+ import { S as ContentBylineInput } from "./index-DJVaYiUV.mjs";
9
+ import { d as Storage } from "./types-DZpT-PnG.mjs";
10
+ import { i as SiteSettings, r as SiteSettingKey } from "./types-nP9vGUFq.mjs";
11
11
  import { Kysely } from "kysely";
12
- import { z } from "zod";
13
- import { MiddlewareHandler } from "astro";
12
+ import { z } from "astro/zod";
13
+ import { z as z$1 } from "zod";
14
14
  import { LiveLoader } from "astro/loaders";
15
+ import { MiddlewareHandler } from "astro";
15
16
 
16
17
  //#region src/api/types.d.ts
17
18
  /**
@@ -20,6 +21,11 @@ import { LiveLoader } from "astro/loaders";
20
21
  interface ListResponse<T> {
21
22
  items: T[];
22
23
  nextCursor?: string;
24
+ /**
25
+ * Total number of rows matching filters, ignoring pagination. Optional so
26
+ * list handlers that do not surface a count do not need an extra query.
27
+ */
28
+ total?: number;
23
29
  }
24
30
  /**
25
31
  * Content API responses
@@ -131,7 +137,7 @@ type ParseResult<T> = T | Response;
131
137
  * Returns the validated data on success, or a 400 Response on failure.
132
138
  * Replaces all `(await request.json()) as T` casts.
133
139
  */
134
- declare function parseBody<T extends z.ZodType>(request: Request, schema: T): Promise<ParseResult<z.infer<T>>>;
140
+ declare function parseBody<T extends z$1.ZodType>(request: Request, schema: T): Promise<ParseResult<z$1.infer<T>>>;
135
141
  /**
136
142
  * Parse and validate URL search params against a Zod schema.
137
143
  *
@@ -139,7 +145,7 @@ declare function parseBody<T extends z.ZodType>(request: Request, schema: T): Pr
139
145
  * Zod coercion handles string -> number/boolean conversion.
140
146
  * Replaces manual `url.searchParams.get()` + `parseInt()` patterns.
141
147
  */
142
- declare function parseQuery<T extends z.ZodType>(url: URL, schema: T): ParseResult<z.infer<T>>;
148
+ declare function parseQuery<T extends z$1.ZodType>(url: URL, schema: T): ParseResult<z$1.infer<T>>;
143
149
  /**
144
150
  * Type guard to check if a ParseResult is an error Response.
145
151
  * Usage: `if (isParseError(result)) return result;`
@@ -205,15 +211,21 @@ declare class OptionsRepository {
205
211
  deleteByPrefix(prefix: string): Promise<number>;
206
212
  }
207
213
  //#endregion
214
+ //#region src/database/errors.d.ts
215
+ /**
216
+ * Database error types. Keep these free of driver imports so public barrels can
217
+ * re-export them without loading native database drivers for unused dialects.
218
+ */
219
+ declare class DinewayDatabaseError extends Error {
220
+ cause?: unknown | undefined;
221
+ constructor(message: string, cause?: unknown | undefined);
222
+ }
223
+ //#endregion
208
224
  //#region src/database/connection.d.ts
209
225
  interface DatabaseConfig {
210
226
  url: string;
211
227
  authToken?: string;
212
228
  }
213
- declare class DinewayDatabaseError extends Error {
214
- cause?: unknown | undefined;
215
- constructor(message: string, cause?: unknown | undefined);
216
- }
217
229
  //#endregion
218
230
  //#region src/database/repositories/content.d.ts
219
231
  /**
@@ -311,7 +323,14 @@ declare class ContentRepository {
311
323
  status?: string;
312
324
  authorId?: string;
313
325
  locale?: string;
326
+ q?: string;
327
+ searchColumns?: string[];
314
328
  }): Promise<number>;
329
+ /**
330
+ * Apply an optional case-insensitive substring search across handler-resolved
331
+ * columns. User input is treated literally by escaping LIKE wildcards.
332
+ */
333
+ private applySearchFilter;
315
334
  getStats(type: string): Promise<{
316
335
  total: number;
317
336
  published: number;
@@ -441,6 +460,8 @@ interface FindManyMediaOptions {
441
460
  /** Filter by MIME type. Entries ending with "/" are prefix matches; other entries are exact matches. */
442
461
  mimeType?: string | readonly string[];
443
462
  status?: MediaStatus | "all";
463
+ /** Case-insensitive substring matched against the filename, including extensions. */
464
+ q?: string;
444
465
  }
445
466
  /**
446
467
  * Media repository for database operations
@@ -532,6 +553,103 @@ interface Revision {
532
553
  createdAt: string;
533
554
  }
534
555
  //#endregion
556
+ //#region src/database/repositories/comment.d.ts
557
+ /** Public-facing comment shape — no private fields */
558
+ interface PublicComment {
559
+ id: string;
560
+ parentId: string | null;
561
+ authorName: string;
562
+ isRegisteredUser: boolean;
563
+ body: string;
564
+ createdAt: string;
565
+ replies?: PublicComment[];
566
+ }
567
+ //#endregion
568
+ //#region src/fields/types.d.ts
569
+ /**
570
+ * SQLite column types that map from field types
571
+ */
572
+ type ColumnType = "TEXT" | "REAL" | "INTEGER" | "JSON";
573
+ /**
574
+ * Base field definition
575
+ *
576
+ * Note: schema uses z.ZodTypeAny to accommodate optional/default wrappers
577
+ */
578
+ interface FieldDefinition<_T = unknown> {
579
+ type: string;
580
+ /**
581
+ * The SQLite column type to use when storing this field
582
+ */
583
+ columnType: ColumnType;
584
+ schema: z.ZodTypeAny;
585
+ options?: unknown;
586
+ ui?: FieldUIHints;
587
+ validation?: FieldValidation;
588
+ }
589
+ /**
590
+ * UI hints for admin rendering
591
+ */
592
+ interface FieldUIHints {
593
+ widget?: string;
594
+ placeholder?: string;
595
+ helpText?: string;
596
+ rows?: number;
597
+ min?: number | string;
598
+ max?: number | string;
599
+ [key: string]: unknown;
600
+ }
601
+ /**
602
+ * Portable Text block structure
603
+ */
604
+ interface PortableTextBlock$1 {
605
+ _type: string;
606
+ _key: string;
607
+ [key: string]: unknown;
608
+ }
609
+ /**
610
+ * @deprecated Use MediaValue instead. ImageValue is an alias for backwards compatibility.
611
+ */
612
+ type ImageValue = MediaValue;
613
+ /**
614
+ * File field value
615
+ */
616
+ interface FileValue {
617
+ id: string;
618
+ url: string;
619
+ filename: string;
620
+ mimeType: string;
621
+ size: number;
622
+ }
623
+ //#endregion
624
+ //#region src/fields/image.d.ts
625
+ /**
626
+ * Image field
627
+ * References media items from the media library
628
+ */
629
+ declare function image(options?: {
630
+ required?: boolean;
631
+ maxSize?: number;
632
+ allowedTypes?: string[];
633
+ }): FieldDefinition<ImageValue | undefined>;
634
+ //#endregion
635
+ //#region src/fields/reference.d.ts
636
+ /**
637
+ * Reference field
638
+ * References another content item by ID
639
+ */
640
+ declare function reference(collection: string, options?: {
641
+ required?: boolean;
642
+ }): FieldDefinition<string | undefined>;
643
+ //#endregion
644
+ //#region src/fields/portable-text.d.ts
645
+ /**
646
+ * Portable Text field
647
+ * Stores structured content in Portable Text format
648
+ */
649
+ declare function portableText(options?: {
650
+ required?: boolean;
651
+ }): FieldDefinition<PortableTextBlock$1[] | undefined>;
652
+ //#endregion
535
653
  //#region src/api/handlers/content.d.ts
536
654
  /**
537
655
  * Trashed content item with deletion timestamp
@@ -558,6 +676,7 @@ declare function handleContentList(db: Kysely<Database>, collection: string, par
558
676
  orderBy?: string;
559
677
  order?: "asc" | "desc";
560
678
  locale?: string;
679
+ q?: string;
561
680
  }): Promise<ApiResult<ContentListResponse>>;
562
681
  /**
563
682
  * Get single content item
@@ -600,6 +719,7 @@ declare function handleContentUpdate(db: Kysely<Database>, collection: string, i
600
719
  status?: string;
601
720
  authorId?: string | null;
602
721
  bylines?: ContentBylineInput[];
722
+ locale?: string;
603
723
  _rev?: string;
604
724
  seo?: ContentSeoInput;
605
725
  publishedAt?: string | null;
@@ -770,6 +890,7 @@ declare function handleMediaList(db: Kysely<Database>, params: {
770
890
  cursor?: string;
771
891
  limit?: number;
772
892
  mimeType?: string | readonly string[];
893
+ q?: string;
773
894
  }): Promise<ApiResult<MediaListResponse>>;
774
895
  /**
775
896
  * Get single media item
@@ -972,6 +1093,22 @@ declare class SchemaRegistry {
972
1093
  private slugToLabel;
973
1094
  }
974
1095
  //#endregion
1096
+ //#region src/schema/query.d.ts
1097
+ /**
1098
+ * Get collection metadata by slug.
1099
+ *
1100
+ * @example
1101
+ * ```ts
1102
+ * import { getCollectionInfo } from "dineway";
1103
+ *
1104
+ * const info = await getCollectionInfo("posts");
1105
+ * if (info?.commentsEnabled) {
1106
+ * // render comment UI
1107
+ * }
1108
+ * ```
1109
+ */
1110
+ declare function getCollectionInfo(slug: string): Promise<Collection | null>;
1111
+ //#endregion
975
1112
  //#region src/sections/types.d.ts
976
1113
  /**
977
1114
  * Section source types
@@ -1285,6 +1422,14 @@ interface PortableTextCodeBlock {
1285
1422
  language?: string;
1286
1423
  filename?: string;
1287
1424
  }
1425
+ /**
1426
+ * HTML block (raw HTML content)
1427
+ */
1428
+ interface PortableTextHtmlBlock {
1429
+ _type: "htmlBlock";
1430
+ _key: string;
1431
+ html: string;
1432
+ }
1288
1433
  /**
1289
1434
  * Unknown/custom block (preserved for plugin compatibility)
1290
1435
  */
@@ -1296,7 +1441,7 @@ interface PortableTextUnknownBlock {
1296
1441
  /**
1297
1442
  * Any Portable Text block
1298
1443
  */
1299
- type PortableTextBlock = PortableTextTextBlock | PortableTextImageBlock | PortableTextCodeBlock | PortableTextUnknownBlock;
1444
+ type PortableTextBlock = PortableTextTextBlock | PortableTextImageBlock | PortableTextCodeBlock | PortableTextHtmlBlock | PortableTextUnknownBlock;
1300
1445
  /**
1301
1446
  * ProseMirror JSON types (simplified for TipTap)
1302
1447
  */
@@ -1345,145 +1490,35 @@ declare function hashString(content: string): Promise<string>;
1345
1490
  */
1346
1491
  declare function computeContentHash(content: Uint8Array | ArrayBuffer): Promise<string>;
1347
1492
  //#endregion
1348
- //#region src/after.d.ts
1493
+ //#region src/utils/url.d.ts
1349
1494
  /**
1350
- * Defer work past the current synchronous path.
1495
+ * URL scheme validation utilities
1351
1496
  *
1352
- * Use this for best-effort bookkeeping that should not block runtime
1353
- * initialization or response handling. Node keeps the process alive for
1354
- * pending work; callers that need stronger durability should await their own
1355
- * operation instead of using this helper.
1497
+ * Prevents XSS via dangerous URL schemes (javascript:, data:, vbscript:, etc.)
1498
+ * by allowlisting known-safe schemes before rendering into href attributes.
1356
1499
  */
1357
- type AfterCallback = () => void | Promise<void>;
1358
- declare function after(fn: AfterCallback): void;
1359
- //#endregion
1360
- //#region src/i18n/config.d.ts
1361
1500
  /**
1362
- * Dineway i18n Configuration
1501
+ * Returns the URL unchanged if it uses a safe scheme, otherwise returns "#".
1363
1502
  *
1364
- * Reads locale configuration from the virtual module (sourced from Astro config).
1365
- * Initialized during runtime startup, then available via getI18nConfig().
1366
- */
1367
- interface I18nConfig {
1368
- defaultLocale: string;
1369
- locales: string[];
1370
- fallback?: Record<string, string>;
1371
- prefixDefaultLocale?: boolean;
1372
- }
1373
- /**
1374
- * Get the current i18n config.
1375
- * Returns null if i18n is not configured.
1376
- */
1377
- declare function getI18nConfig(): I18nConfig | null;
1378
- /**
1379
- * Check if i18n is enabled.
1380
- * Returns true when multiple locales are configured.
1381
- */
1382
- declare function isI18nEnabled(): boolean;
1383
- /**
1384
- * Resolve fallback locale chain for a given locale.
1385
- * Returns array of locales to try, from most preferred to least.
1386
- * Always ends with defaultLocale.
1503
+ * Use this at the render layer as the primary defense against XSS via
1504
+ * dangerous URL schemes like `javascript:`, `data:`, or `vbscript:`.
1505
+ *
1506
+ * @example
1507
+ * ```ts
1508
+ * sanitizeHref("https://example.com") // "https://example.com"
1509
+ * sanitizeHref("/about") // "/about"
1510
+ * sanitizeHref("#section") // "#section"
1511
+ * sanitizeHref("mailto:a@b.com") // "mailto:a@b.com"
1512
+ * sanitizeHref("javascript:alert(1)") // "#"
1513
+ * sanitizeHref("data:text/html,<script>") // "#"
1514
+ * sanitizeHref("") // "#"
1515
+ * ```
1387
1516
  */
1388
- declare function getFallbackChain(locale: string): string[];
1389
- //#endregion
1390
- //#region src/preview/sidecar-client.d.ts
1517
+ declare function sanitizeHref(url: string | undefined | null): string;
1391
1518
  /**
1392
- * Preview sidecar protocol helpers.
1393
- *
1394
- * These utilities define the signed URL and snapshot-auth contract shared
1395
- * by preview sidecars and the source site serving snapshot exports.
1519
+ * Returns true if the URL uses a safe scheme for rendering in href attributes.
1396
1520
  */
1397
- interface PreviewSidecarSignature {
1398
- source: string;
1399
- exp: number;
1400
- sig: string;
1401
- }
1402
- interface PreviewSidecarClient {
1403
- signPreviewUrl(previewBase: string, source: string, secret: string, ttl?: number): Promise<string>;
1404
- buildSnapshotSignatureHeader(signature: PreviewSidecarSignature): string;
1405
- }
1406
- declare function signPreviewUrl(previewBase: string, source: string, secret: string, ttl?: number): Promise<string>;
1407
- declare function buildPreviewSignatureHeader(signature: PreviewSidecarSignature): string;
1408
- declare function parsePreviewSignatureHeader(header: string): PreviewSidecarSignature | null;
1409
- declare function verifyPreviewSignature(source: string, exp: number, sig: string, secret: string): Promise<boolean>;
1410
- declare const defaultPreviewSidecarClient: PreviewSidecarClient;
1411
- //#endregion
1412
- //#region src/preview/session-database-factory.d.ts
1413
- interface SessionDatabaseInfo {
1414
- id: string;
1415
- dbPath: string;
1416
- createdAt: number;
1417
- expiresAt: number;
1418
- lastTouchedAt: number;
1419
- }
1420
- interface SessionDatabaseHandle {
1421
- created: boolean;
1422
- session: SessionDatabaseInfo;
1423
- db: Kysely<Database>;
1424
- close(): Promise<void>;
1425
- }
1426
- interface SessionCleanupResult {
1427
- removedSessionIds: string[];
1428
- removedPaths: string[];
1429
- }
1430
- interface SessionOpenOptions {
1431
- id: string;
1432
- now?: number;
1433
- }
1434
- interface SessionOpenOrCreateOptions extends SessionOpenOptions {
1435
- ttlMs: number;
1436
- }
1437
- interface SessionDatabaseFactory {
1438
- open(input: SessionOpenOptions): Promise<SessionDatabaseHandle | null>;
1439
- openOrCreate(input: SessionOpenOrCreateOptions): Promise<SessionDatabaseHandle>;
1440
- destroy(id: string): Promise<boolean>;
1441
- cleanup(now?: number): Promise<SessionCleanupResult>;
1442
- close(): Promise<void>;
1443
- }
1444
- interface FileSessionDatabaseFactoryOptions {
1445
- rootDir: string;
1446
- maxDiskBytes?: number;
1447
- registryFileName?: string;
1448
- sessionsDirName?: string;
1449
- }
1450
- declare class SessionDatabaseLimitError extends Error {
1451
- constructor(message?: string);
1452
- }
1453
- declare class FileSessionDatabaseFactory implements SessionDatabaseFactory {
1454
- private readonly options;
1455
- private readonly registry;
1456
- private readonly sessionsDir;
1457
- private readonly maxDiskBytes;
1458
- constructor(options: FileSessionDatabaseFactoryOptions);
1459
- open(input: SessionOpenOptions): Promise<SessionDatabaseHandle | null>;
1460
- openOrCreate(input: SessionOpenOrCreateOptions): Promise<SessionDatabaseHandle>;
1461
- destroy(id: string): Promise<boolean>;
1462
- cleanup(now?: number): Promise<SessionCleanupResult>;
1463
- close(): Promise<void>;
1464
- private createHandle;
1465
- private getSessionRow;
1466
- private toSessionInfo;
1467
- private deleteSession;
1468
- private getActiveDiskBytes;
1469
- private getDbPath;
1470
- private getManagedPaths;
1471
- private listSessionRows;
1472
- private listDbPathRows;
1473
- }
1474
- //#endregion
1475
- //#region src/preview/middleware.d.ts
1476
- interface FilePreviewMiddlewareConfig {
1477
- rootDir?: string;
1478
- secret: string;
1479
- ttlSeconds?: number;
1480
- cookieName?: string;
1481
- snapshotPath?: string;
1482
- maxSessionDiskBytes?: number;
1483
- sessionFactory?: SessionDatabaseFactory;
1484
- fetch?: typeof globalThis.fetch;
1485
- }
1486
- declare function createFilePreviewMiddleware(config: FilePreviewMiddlewareConfig): MiddlewareHandler;
1521
+ declare function isSafeHref(url: string): boolean;
1487
1522
  //#endregion
1488
1523
  //#region src/loader.d.ts
1489
1524
  /**
@@ -1493,17 +1528,28 @@ type EntryData = Record<string, unknown>;
1493
1528
  /**
1494
1529
  * Sort direction
1495
1530
  */
1496
- type SortDirection = "asc" | "desc";
1531
+ type SortDirection$1 = "asc" | "desc";
1497
1532
  /**
1498
1533
  * Order by specification - field name to direction
1499
1534
  * @example { created_at: "desc" } - Sort by created_at descending
1500
1535
  * @example { title: "asc" } - Sort by title ascending
1501
1536
  */
1502
- type OrderBySpec = Record<string, SortDirection>;
1537
+ type OrderBySpec$1 = Record<string, SortDirection$1>;
1538
+ /**
1539
+ * Range filter for comparison operators on field values.
1540
+ * ISO 8601 timestamps sort lexicographically in the same order as time.
1541
+ */
1542
+ interface WhereRange {
1543
+ gt?: string;
1544
+ gte?: string;
1545
+ lt?: string;
1546
+ lte?: string;
1547
+ }
1548
+ type WhereValue = string | string[] | WhereRange;
1503
1549
  /**
1504
1550
  * Filter for loadCollection - type is required
1505
1551
  */
1506
- interface CollectionFilter {
1552
+ interface CollectionFilter$1 {
1507
1553
  type: string;
1508
1554
  status?: "draft" | "published" | "archived";
1509
1555
  limit?: number;
@@ -1513,14 +1559,17 @@ interface CollectionFilter {
1513
1559
  */
1514
1560
  cursor?: string;
1515
1561
  /**
1516
- * Filter by field values or taxonomy terms
1562
+ * Filter by field values, taxonomy terms, or ranges.
1563
+ *
1564
+ * Taxonomy names are detected automatically and filtered via JOIN.
1565
+ * Other keys are treated as content table column filters.
1517
1566
  */
1518
- where?: Record<string, string | string[]>;
1567
+ where?: Record<string, WhereValue>;
1519
1568
  /**
1520
1569
  * Order results by field(s)
1521
1570
  * @default { created_at: "desc" }
1522
1571
  */
1523
- orderBy?: OrderBySpec;
1572
+ orderBy?: OrderBySpec$1;
1524
1573
  /**
1525
1574
  * Filter by locale (e.g. 'en', 'fr').
1526
1575
  * When set, only returns content in this locale.
@@ -1577,37 +1626,485 @@ declare function getDb(): Promise<Kysely<Database>>;
1577
1626
  * };
1578
1627
  * ```
1579
1628
  */
1580
- declare function dinewayLoader(): LiveLoader<EntryData, EntryFilter, CollectionFilter>;
1629
+ declare function dinewayLoader(): LiveLoader<EntryData, EntryFilter, CollectionFilter$1>;
1581
1630
  //#endregion
1582
- //#region src/plugins/define-plugin.d.ts
1631
+ //#region src/visual-editing/editable.d.ts
1583
1632
  /**
1584
- * Define a Dineway plugin.
1633
+ * Visual editing annotation system
1585
1634
  *
1586
- * **Standard format** -- the canonical format for plugins that work in both
1587
- * trusted and sandboxed modes. No id/version -- those come from the descriptor.
1635
+ * Creates Proxy objects that emit data-dineway-ref attributes when spread onto elements.
1636
+ */
1637
+ interface CMSAnnotation {
1638
+ collection: string;
1639
+ id: string;
1640
+ field?: string;
1641
+ /** Entry status — only present on entry-level annotations (not field-level) */
1642
+ status?: string;
1643
+ /** Whether the entry has unpublished draft changes */
1644
+ hasDraft?: boolean;
1645
+ }
1646
+ /** The shape returned when spreading an edit annotation onto an element */
1647
+ interface FieldAnnotation {
1648
+ "data-dineway-ref": string;
1649
+ }
1650
+ interface EditableOptions {
1651
+ /** Entry status: "draft", "published", "scheduled" */
1652
+ status?: string;
1653
+ /** true when draftRevisionId exists and differs from liveRevisionId */
1654
+ hasDraft?: boolean;
1655
+ }
1656
+ /**
1657
+ * Create an editable proxy for an entry.
1588
1658
  *
1589
- * @example
1590
- * ```typescript
1591
- * import { definePlugin } from "dineway";
1659
+ * Usage:
1660
+ * - `{...entry.edit}` - entry-level annotation (includes status/hasDraft)
1661
+ * - `{...entry.edit.title}` - field-level annotation
1662
+ * - `{...entry.edit['nested.field']}` - nested field (bracket notation)
1663
+ */
1664
+ declare function createEditable(collection: string, id: string, options?: EditableOptions): EditProxy;
1665
+ /**
1666
+ * Create a noop proxy for production mode.
1667
+ * Spreading this produces no attributes.
1668
+ */
1669
+ declare function createNoop(): EditProxy;
1670
+ /**
1671
+ * Visual editing proxy type.
1592
1672
  *
1593
- * export default definePlugin({
1594
- * hooks: {
1595
- * "content:afterSave": {
1596
- * handler: async (event, ctx) => {
1597
- * await ctx.kv.set("lastSave", Date.now());
1598
- * },
1599
- * },
1600
- * },
1601
- * routes: {
1602
- * status: {
1603
- * handler: async (routeCtx, ctx) => ({ ok: true }),
1604
- * },
1605
- * },
1606
- * });
1607
- * ```
1673
+ * Spread directly onto elements for entry-level annotations: `{...entry.edit}`
1674
+ * Access a field for field-level annotations: `{...entry.edit.title}`
1608
1675
  *
1609
- * **Native format** -- for plugins that need React admin, direct DB access,
1610
- * or other capabilities not available in the sandbox.
1676
+ * In production, spreading produces no attributes (noop).
1677
+ */
1678
+ type EditProxy = {
1679
+ readonly [field: string]: Partial<FieldAnnotation>;
1680
+ };
1681
+ //#endregion
1682
+ //#region src/query.d.ts
1683
+ /**
1684
+ * Collection type registry for type-safe queries.
1685
+ *
1686
+ * This interface is extended by the generated dineway-env.d.ts file
1687
+ * to provide type inference for collection names and their data shapes.
1688
+ *
1689
+ * @example
1690
+ * ```ts
1691
+ * // In dineway-env.d.ts (generated):
1692
+ * declare module "dineway" {
1693
+ * interface DinewayCollections {
1694
+ * posts: { title: string; content: PortableTextBlock[]; };
1695
+ * pages: { title: string; body: PortableTextBlock[]; };
1696
+ * }
1697
+ * }
1698
+ *
1699
+ * // Then in your code:
1700
+ * const { entries } = await getDinewayCollection("posts");
1701
+ * // entries[0].data.title is typed as string
1702
+ * ```
1703
+ */
1704
+ interface DinewayCollections {}
1705
+ /**
1706
+ * Helper type to infer the data type for a collection.
1707
+ * Returns the registered type if known, otherwise falls back to Record<string, unknown>.
1708
+ */
1709
+ type InferCollectionData<T extends string> = T extends keyof DinewayCollections ? DinewayCollections[T] : Record<string, unknown>;
1710
+ /**
1711
+ * Sort direction
1712
+ */
1713
+ type SortDirection = "asc" | "desc";
1714
+ /**
1715
+ * Order by specification - field name to direction
1716
+ * @example { created_at: "desc" } - Sort by created_at descending
1717
+ * @example { title: "asc" } - Sort by title ascending
1718
+ * @example { published_at: "desc", title: "asc" } - Multi-field sort
1719
+ */
1720
+ type OrderBySpec = Record<string, SortDirection>;
1721
+ interface CollectionFilter {
1722
+ status?: "draft" | "published" | "archived";
1723
+ limit?: number;
1724
+ /**
1725
+ * Opaque cursor for keyset pagination.
1726
+ * Pass the `nextCursor` value from a previous result to fetch the next page.
1727
+ * @example
1728
+ * ```ts
1729
+ * const cursor = Astro.url.searchParams.get("cursor") ?? undefined;
1730
+ * const { entries, nextCursor } = await getDinewayCollection("posts", {
1731
+ * limit: 10,
1732
+ * cursor,
1733
+ * });
1734
+ * ```
1735
+ */
1736
+ cursor?: string;
1737
+ /**
1738
+ * Filter by field values, taxonomy terms, or ranges.
1739
+ *
1740
+ * Taxonomy names are detected automatically and filtered via JOIN.
1741
+ * Other keys are treated as content table column filters.
1742
+ *
1743
+ * @example { category: 'news' } - Filter by taxonomy term
1744
+ * @example { category: ['news', 'featured'] } - Filter by multiple terms (OR)
1745
+ * @example { series: 'main' } - Exact match on a content field
1746
+ * @example { published_at: { gte: '2024-01-01', lt: '2025-01-01' } } - Date range
1747
+ */
1748
+ where?: Record<string, WhereValue>;
1749
+ /**
1750
+ * Order results by field(s)
1751
+ * @default { created_at: "desc" }
1752
+ * @example { created_at: "desc" } - Sort by created_at descending (default)
1753
+ * @example { title: "asc" } - Sort by title ascending
1754
+ * @example { published_at: "desc", title: "asc" } - Multi-field sort
1755
+ */
1756
+ orderBy?: OrderBySpec;
1757
+ /**
1758
+ * Filter by locale. When set, only returns entries in this locale.
1759
+ * Only relevant when i18n is configured.
1760
+ * @example "en" — English entries only
1761
+ * @example "fr" — French entries only
1762
+ */
1763
+ locale?: string;
1764
+ }
1765
+ interface ContentEntry<T = Record<string, unknown>> {
1766
+ id: string;
1767
+ data: T;
1768
+ /** Visual editing annotations. Spread onto elements: {...entry.edit.title} */
1769
+ edit: EditProxy;
1770
+ }
1771
+ /** Cache hint returned by the content loader for route caching */
1772
+ interface CacheHint {
1773
+ tags?: string[];
1774
+ lastModified?: Date;
1775
+ }
1776
+ /**
1777
+ * Result from getDinewayCollection
1778
+ */
1779
+ interface CollectionResult<T> {
1780
+ /** The entries (empty array if error or none found) */
1781
+ entries: ContentEntry<T>[];
1782
+ /** Error if the query failed */
1783
+ error?: Error;
1784
+ /** Cache hint for route caching (pass to Astro.cache.set()) */
1785
+ cacheHint: CacheHint;
1786
+ /**
1787
+ * Opaque cursor for the next page.
1788
+ * Undefined when there are no more results.
1789
+ * Pass this as `cursor` in the next query to get the next page.
1790
+ */
1791
+ nextCursor?: string;
1792
+ }
1793
+ /**
1794
+ * Result from getDinewayEntry
1795
+ */
1796
+ interface EntryResult<T> {
1797
+ /** The entry, or null if not found */
1798
+ entry: ContentEntry<T> | null;
1799
+ /** Error if the query failed (not set for "not found", only for actual errors) */
1800
+ error?: Error;
1801
+ /** Whether we're in preview mode (valid token was provided) */
1802
+ isPreview: boolean;
1803
+ /** Set when a fallback locale was used instead of the requested locale */
1804
+ fallbackLocale?: string;
1805
+ /** Cache hint for route caching (pass to Astro.cache.set()) */
1806
+ cacheHint: CacheHint;
1807
+ }
1808
+ /** Edit metadata attached to PT arrays in edit mode */
1809
+ interface EditFieldMeta {
1810
+ collection: string;
1811
+ id: string;
1812
+ field: string;
1813
+ }
1814
+ /**
1815
+ * Read edit metadata from a value (returns undefined if not tagged).
1816
+ * Uses Object.getOwnPropertyDescriptor to access Symbol-keyed property
1817
+ * without an unsafe type assertion.
1818
+ */
1819
+ declare function getEditMeta(value: unknown): EditFieldMeta | undefined;
1820
+ /**
1821
+ * Get all entries of a content type
1822
+ *
1823
+ * Returns { entries, error } for graceful error handling.
1824
+ *
1825
+ * When dineway-env.d.ts is generated, the collection name will be
1826
+ * type-checked and the return type will be inferred automatically.
1827
+ *
1828
+ * @example
1829
+ * ```ts
1830
+ * import { getDinewayCollection } from "dineway";
1831
+ *
1832
+ * const { entries: posts, error } = await getDinewayCollection("posts");
1833
+ * if (error) {
1834
+ * console.error("Failed to load posts:", error);
1835
+ * return;
1836
+ * }
1837
+ * // posts[0].data.title is typed (if dineway-env.d.ts exists)
1838
+ *
1839
+ * // With filters
1840
+ * const { entries: drafts } = await getDinewayCollection("posts", { status: "draft" });
1841
+ * ```
1842
+ */
1843
+ declare function getDinewayCollection<T extends string, D = InferCollectionData<T>>(type: T, filter?: CollectionFilter): Promise<CollectionResult<D>>;
1844
+ /**
1845
+ * Get a single entry by type and ID/slug
1846
+ *
1847
+ * Returns { entry, error, isPreview } for graceful error handling.
1848
+ * - entry is null if not found (not an error)
1849
+ * - error is set only for actual errors (db issues, etc.)
1850
+ *
1851
+ * Preview mode is detected automatically from request context (ALS).
1852
+ * When the URL has a valid `_preview` token, the middleware sets preview
1853
+ * context and this function serves draft revision data if available.
1854
+ *
1855
+ * @example
1856
+ * ```ts
1857
+ * import { getDinewayEntry } from "dineway";
1858
+ *
1859
+ * // Simple usage — preview just works via middleware
1860
+ * const { entry: post, isPreview, error } = await getDinewayEntry("posts", "my-slug");
1861
+ * if (!post) return Astro.redirect("/404");
1862
+ * ```
1863
+ */
1864
+ declare function getDinewayEntry<T extends string, D = InferCollectionData<T>>(type: T, id: string, options?: {
1865
+ locale?: string;
1866
+ }): Promise<EntryResult<D>>;
1867
+ /**
1868
+ * Translation summary for a single locale variant
1869
+ */
1870
+ interface TranslationSummary {
1871
+ /** Content item ID */
1872
+ id: string;
1873
+ /** Locale code (e.g. "en", "fr") */
1874
+ locale: string;
1875
+ /** URL slug */
1876
+ slug: string | null;
1877
+ /** Current status */
1878
+ status: string;
1879
+ }
1880
+ /**
1881
+ * Result from getTranslations
1882
+ */
1883
+ interface TranslationsResult {
1884
+ /** The translation group ID (shared across locales) */
1885
+ translationGroup: string;
1886
+ /** All locale variants in this group */
1887
+ translations: TranslationSummary[];
1888
+ /** Error if the query failed */
1889
+ error?: Error;
1890
+ }
1891
+ /**
1892
+ * Get all translations of a content item.
1893
+ *
1894
+ * Given a content entry, returns all locale variants that share the same
1895
+ * translation group. This is useful for building language switcher UI.
1896
+ *
1897
+ * @example
1898
+ * ```ts
1899
+ * import { getDinewayEntry, getTranslations } from "dineway";
1900
+ *
1901
+ * const { entry: post } = await getDinewayEntry("posts", "hello-world", { locale: "en" });
1902
+ * const { translations } = await getTranslations("posts", post.data.id);
1903
+ * // translations = [{ id: "...", locale: "en", slug: "hello-world", status: "published" }, ...]
1904
+ * ```
1905
+ */
1906
+ declare function getTranslations(type: string, id: string): Promise<TranslationsResult>;
1907
+ /**
1908
+ * Result from resolveDinewayPath
1909
+ */
1910
+ interface ResolvePathResult<T = Record<string, unknown>> {
1911
+ /** The matched entry */
1912
+ entry: ContentEntry<T>;
1913
+ /** The collection slug that matched */
1914
+ collection: string;
1915
+ /** Extracted parameters from the URL pattern (e.g. { slug: "my-post" }) */
1916
+ params: Record<string, string>;
1917
+ }
1918
+ /**
1919
+ * Resolve a URL path to a content entry by matching against collection URL patterns.
1920
+ *
1921
+ * Loads all collections with a `urlPattern` set, converts each pattern to a regex,
1922
+ * and tests the given path. On match, extracts the slug and fetches the entry.
1923
+ *
1924
+ * @example
1925
+ * ```ts
1926
+ * import { resolveDinewayPath } from "dineway";
1927
+ *
1928
+ * // Given pages with urlPattern "/{slug}" and posts with "/blog/{slug}":
1929
+ * const result = await resolveDinewayPath("/blog/hello-world");
1930
+ * if (result) {
1931
+ * console.log(result.collection); // "posts"
1932
+ * console.log(result.params.slug); // "hello-world"
1933
+ * console.log(result.entry.data); // post data
1934
+ * }
1935
+ * ```
1936
+ */
1937
+ declare function resolveDinewayPath<T = Record<string, unknown>>(path: string): Promise<ResolvePathResult<T> | null>;
1938
+ //#endregion
1939
+ //#region src/after.d.ts
1940
+ /**
1941
+ * Defer work past the current synchronous path.
1942
+ *
1943
+ * Use this for best-effort bookkeeping that should not block runtime
1944
+ * initialization or response handling. Node keeps the process alive for
1945
+ * pending work; callers that need stronger durability should await their own
1946
+ * operation instead of using this helper.
1947
+ */
1948
+ type AfterCallback = () => void | Promise<void>;
1949
+ declare function after(fn: AfterCallback): void;
1950
+ //#endregion
1951
+ //#region src/i18n/config.d.ts
1952
+ /**
1953
+ * Dineway i18n Configuration
1954
+ *
1955
+ * Reads locale configuration from the virtual module (sourced from Astro config).
1956
+ * Initialized during runtime startup, then available via getI18nConfig().
1957
+ */
1958
+ interface I18nConfig {
1959
+ defaultLocale: string;
1960
+ locales: string[];
1961
+ fallback?: Record<string, string>;
1962
+ prefixDefaultLocale?: boolean;
1963
+ }
1964
+ /**
1965
+ * Get the current i18n config.
1966
+ * Returns null if i18n is not configured.
1967
+ */
1968
+ declare function getI18nConfig(): I18nConfig | null;
1969
+ /**
1970
+ * Check if i18n is enabled.
1971
+ * Returns true when multiple locales are configured.
1972
+ */
1973
+ declare function isI18nEnabled(): boolean;
1974
+ /**
1975
+ * Resolve fallback locale chain for a given locale.
1976
+ * Returns array of locales to try, from most preferred to least.
1977
+ * Always ends with defaultLocale.
1978
+ */
1979
+ declare function getFallbackChain(locale: string): string[];
1980
+ //#endregion
1981
+ //#region src/preview/sidecar-client.d.ts
1982
+ /**
1983
+ * Preview sidecar protocol helpers.
1984
+ *
1985
+ * These utilities define the signed URL and snapshot-auth contract shared
1986
+ * by preview sidecars and the source site serving snapshot exports.
1987
+ */
1988
+ interface PreviewSidecarSignature {
1989
+ source: string;
1990
+ exp: number;
1991
+ sig: string;
1992
+ }
1993
+ interface PreviewSidecarClient {
1994
+ signPreviewUrl(previewBase: string, source: string, secret: string, ttl?: number): Promise<string>;
1995
+ buildSnapshotSignatureHeader(signature: PreviewSidecarSignature): string;
1996
+ }
1997
+ declare function signPreviewUrl(previewBase: string, source: string, secret: string, ttl?: number): Promise<string>;
1998
+ declare function buildPreviewSignatureHeader(signature: PreviewSidecarSignature): string;
1999
+ declare function parsePreviewSignatureHeader(header: string): PreviewSidecarSignature | null;
2000
+ declare function verifyPreviewSignature(source: string, exp: number, sig: string, secret: string): Promise<boolean>;
2001
+ declare const defaultPreviewSidecarClient: PreviewSidecarClient;
2002
+ //#endregion
2003
+ //#region src/preview/session-database-factory.d.ts
2004
+ interface SessionDatabaseInfo {
2005
+ id: string;
2006
+ dbPath: string;
2007
+ createdAt: number;
2008
+ expiresAt: number;
2009
+ lastTouchedAt: number;
2010
+ }
2011
+ interface SessionDatabaseHandle {
2012
+ created: boolean;
2013
+ session: SessionDatabaseInfo;
2014
+ db: Kysely<Database>;
2015
+ close(): Promise<void>;
2016
+ }
2017
+ interface SessionCleanupResult {
2018
+ removedSessionIds: string[];
2019
+ removedPaths: string[];
2020
+ }
2021
+ interface SessionOpenOptions {
2022
+ id: string;
2023
+ now?: number;
2024
+ }
2025
+ interface SessionOpenOrCreateOptions extends SessionOpenOptions {
2026
+ ttlMs: number;
2027
+ }
2028
+ interface SessionDatabaseFactory {
2029
+ open(input: SessionOpenOptions): Promise<SessionDatabaseHandle | null>;
2030
+ openOrCreate(input: SessionOpenOrCreateOptions): Promise<SessionDatabaseHandle>;
2031
+ destroy(id: string): Promise<boolean>;
2032
+ cleanup(now?: number): Promise<SessionCleanupResult>;
2033
+ close(): Promise<void>;
2034
+ }
2035
+ interface FileSessionDatabaseFactoryOptions {
2036
+ rootDir: string;
2037
+ maxDiskBytes?: number;
2038
+ registryFileName?: string;
2039
+ sessionsDirName?: string;
2040
+ }
2041
+ declare class SessionDatabaseLimitError extends Error {
2042
+ constructor(message?: string);
2043
+ }
2044
+ declare class FileSessionDatabaseFactory implements SessionDatabaseFactory {
2045
+ private readonly options;
2046
+ private readonly registry;
2047
+ private readonly sessionsDir;
2048
+ private readonly maxDiskBytes;
2049
+ constructor(options: FileSessionDatabaseFactoryOptions);
2050
+ open(input: SessionOpenOptions): Promise<SessionDatabaseHandle | null>;
2051
+ openOrCreate(input: SessionOpenOrCreateOptions): Promise<SessionDatabaseHandle>;
2052
+ destroy(id: string): Promise<boolean>;
2053
+ cleanup(now?: number): Promise<SessionCleanupResult>;
2054
+ close(): Promise<void>;
2055
+ private createHandle;
2056
+ private getSessionRow;
2057
+ private toSessionInfo;
2058
+ private deleteSession;
2059
+ private getActiveDiskBytes;
2060
+ private getDbPath;
2061
+ private getManagedPaths;
2062
+ private listSessionRows;
2063
+ private listDbPathRows;
2064
+ }
2065
+ //#endregion
2066
+ //#region src/preview/middleware.d.ts
2067
+ interface FilePreviewMiddlewareConfig {
2068
+ rootDir?: string;
2069
+ secret: string;
2070
+ ttlSeconds?: number;
2071
+ cookieName?: string;
2072
+ snapshotPath?: string;
2073
+ maxSessionDiskBytes?: number;
2074
+ sessionFactory?: SessionDatabaseFactory;
2075
+ fetch?: typeof globalThis.fetch;
2076
+ }
2077
+ declare function createFilePreviewMiddleware(config: FilePreviewMiddlewareConfig): MiddlewareHandler;
2078
+ //#endregion
2079
+ //#region src/plugins/define-plugin.d.ts
2080
+ /**
2081
+ * Define a Dineway plugin.
2082
+ *
2083
+ * **Standard format** -- the canonical format for plugins that work in both
2084
+ * trusted and sandboxed modes. No id/version -- those come from the descriptor.
2085
+ *
2086
+ * @example
2087
+ * ```typescript
2088
+ * import { definePlugin } from "dineway";
2089
+ *
2090
+ * export default definePlugin({
2091
+ * hooks: {
2092
+ * "content:afterSave": {
2093
+ * handler: async (event, ctx) => {
2094
+ * await ctx.kv.set("lastSave", Date.now());
2095
+ * },
2096
+ * },
2097
+ * },
2098
+ * routes: {
2099
+ * status: {
2100
+ * handler: async (routeCtx, ctx) => ({ ok: true }),
2101
+ * },
2102
+ * },
2103
+ * });
2104
+ * ```
2105
+ *
2106
+ * **Native format** -- for plugins that need React admin, direct DB access,
2107
+ * or other capabilities not available in the sandbox.
1611
2108
  *
1612
2109
  * @example
1613
2110
  * ```typescript
@@ -1642,10 +2139,10 @@ declare function definePlugin(definition: StandardPluginDefinition): StandardPlu
1642
2139
  *
1643
2140
  * Every JSON.parse of a manifest.json should validate through this.
1644
2141
  */
1645
- declare const pluginManifestSchema: z.ZodObject<{
1646
- id: z.ZodString;
1647
- version: z.ZodString;
1648
- capabilities: z.ZodArray<z.ZodEnum<{
2142
+ declare const pluginManifestSchema: z$1.ZodObject<{
2143
+ id: z$1.ZodString;
2144
+ version: z$1.ZodString;
2145
+ capabilities: z$1.ZodArray<z$1.ZodEnum<{
1649
2146
  "network:request": "network:request";
1650
2147
  "network:request:unrestricted": "network:request:unrestricted";
1651
2148
  "content:read": "content:read";
@@ -1658,12 +2155,12 @@ declare const pluginManifestSchema: z.ZodObject<{
1658
2155
  "hooks.email-events:register": "hooks.email-events:register";
1659
2156
  "hooks.page-fragments:register": "hooks.page-fragments:register";
1660
2157
  }>>;
1661
- allowedHosts: z.ZodArray<z.ZodString>;
1662
- storage: z.ZodRecord<z.ZodString, z.ZodObject<{
1663
- indexes: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
1664
- uniqueIndexes: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
1665
- }, z.core.$strip>>;
1666
- hooks: z.ZodArray<z.ZodUnion<readonly [z.ZodEnum<{
2158
+ allowedHosts: z$1.ZodArray<z$1.ZodString>;
2159
+ storage: z$1.ZodRecord<z$1.ZodString, z$1.ZodObject<{
2160
+ indexes: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
2161
+ uniqueIndexes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>>;
2162
+ }, z$1.core.$strip>>;
2163
+ hooks: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodEnum<{
1667
2164
  "plugin:install": "plugin:install";
1668
2165
  "plugin:activate": "plugin:activate";
1669
2166
  "plugin:deactivate": "plugin:deactivate";
@@ -1686,8 +2183,8 @@ declare const pluginManifestSchema: z.ZodObject<{
1686
2183
  "comment:afterModerate": "comment:afterModerate";
1687
2184
  "page:metadata": "page:metadata";
1688
2185
  "page:fragments": "page:fragments";
1689
- }>, z.ZodObject<{
1690
- name: z.ZodEnum<{
2186
+ }>, z$1.ZodObject<{
2187
+ name: z$1.ZodEnum<{
1691
2188
  "plugin:install": "plugin:install";
1692
2189
  "plugin:activate": "plugin:activate";
1693
2190
  "plugin:deactivate": "plugin:deactivate";
@@ -1711,85 +2208,85 @@ declare const pluginManifestSchema: z.ZodObject<{
1711
2208
  "page:metadata": "page:metadata";
1712
2209
  "page:fragments": "page:fragments";
1713
2210
  }>;
1714
- exclusive: z.ZodOptional<z.ZodBoolean>;
1715
- priority: z.ZodOptional<z.ZodNumber>;
1716
- timeout: z.ZodOptional<z.ZodNumber>;
1717
- }, z.core.$strip>]>>;
1718
- routes: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
1719
- name: z.ZodString;
1720
- public: z.ZodOptional<z.ZodBoolean>;
1721
- }, z.core.$strip>]>>;
1722
- admin: z.ZodObject<{
1723
- entry: z.ZodOptional<z.ZodString>;
1724
- settingsSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1725
- type: z.ZodLiteral<"string">;
1726
- default: z.ZodOptional<z.ZodString>;
1727
- multiline: z.ZodOptional<z.ZodBoolean>;
1728
- label: z.ZodString;
1729
- description: z.ZodOptional<z.ZodString>;
1730
- }, z.core.$strip>, z.ZodObject<{
1731
- type: z.ZodLiteral<"number">;
1732
- default: z.ZodOptional<z.ZodNumber>;
1733
- min: z.ZodOptional<z.ZodNumber>;
1734
- max: z.ZodOptional<z.ZodNumber>;
1735
- label: z.ZodString;
1736
- description: z.ZodOptional<z.ZodString>;
1737
- }, z.core.$strip>, z.ZodObject<{
1738
- type: z.ZodLiteral<"boolean">;
1739
- default: z.ZodOptional<z.ZodBoolean>;
1740
- label: z.ZodString;
1741
- description: z.ZodOptional<z.ZodString>;
1742
- }, z.core.$strip>, z.ZodObject<{
1743
- type: z.ZodLiteral<"select">;
1744
- options: z.ZodArray<z.ZodObject<{
1745
- value: z.ZodString;
1746
- label: z.ZodString;
1747
- }, z.core.$strip>>;
1748
- default: z.ZodOptional<z.ZodString>;
1749
- label: z.ZodString;
1750
- description: z.ZodOptional<z.ZodString>;
1751
- }, z.core.$strip>, z.ZodObject<{
1752
- type: z.ZodLiteral<"secret">;
1753
- label: z.ZodString;
1754
- description: z.ZodOptional<z.ZodString>;
1755
- }, z.core.$strip>, z.ZodObject<{
1756
- type: z.ZodLiteral<"url">;
1757
- default: z.ZodOptional<z.ZodString>;
1758
- placeholder: z.ZodOptional<z.ZodString>;
1759
- label: z.ZodString;
1760
- description: z.ZodOptional<z.ZodString>;
1761
- }, z.core.$strip>, z.ZodObject<{
1762
- type: z.ZodLiteral<"email">;
1763
- default: z.ZodOptional<z.ZodString>;
1764
- placeholder: z.ZodOptional<z.ZodString>;
1765
- label: z.ZodString;
1766
- description: z.ZodOptional<z.ZodString>;
1767
- }, z.core.$strip>], "type">>>;
1768
- pages: z.ZodOptional<z.ZodArray<z.ZodObject<{
1769
- path: z.ZodString;
1770
- label: z.ZodString;
1771
- icon: z.ZodOptional<z.ZodString>;
1772
- }, z.core.$strip>>>;
1773
- widgets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1774
- id: z.ZodString;
1775
- size: z.ZodOptional<z.ZodEnum<{
2211
+ exclusive: z$1.ZodOptional<z$1.ZodBoolean>;
2212
+ priority: z$1.ZodOptional<z$1.ZodNumber>;
2213
+ timeout: z$1.ZodOptional<z$1.ZodNumber>;
2214
+ }, z$1.core.$strip>]>>;
2215
+ routes: z$1.ZodArray<z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodObject<{
2216
+ name: z$1.ZodString;
2217
+ public: z$1.ZodOptional<z$1.ZodBoolean>;
2218
+ }, z$1.core.$strip>]>>;
2219
+ admin: z$1.ZodObject<{
2220
+ entry: z$1.ZodOptional<z$1.ZodString>;
2221
+ settingsSchema: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
2222
+ type: z$1.ZodLiteral<"string">;
2223
+ default: z$1.ZodOptional<z$1.ZodString>;
2224
+ multiline: z$1.ZodOptional<z$1.ZodBoolean>;
2225
+ label: z$1.ZodString;
2226
+ description: z$1.ZodOptional<z$1.ZodString>;
2227
+ }, z$1.core.$strip>, z$1.ZodObject<{
2228
+ type: z$1.ZodLiteral<"number">;
2229
+ default: z$1.ZodOptional<z$1.ZodNumber>;
2230
+ min: z$1.ZodOptional<z$1.ZodNumber>;
2231
+ max: z$1.ZodOptional<z$1.ZodNumber>;
2232
+ label: z$1.ZodString;
2233
+ description: z$1.ZodOptional<z$1.ZodString>;
2234
+ }, z$1.core.$strip>, z$1.ZodObject<{
2235
+ type: z$1.ZodLiteral<"boolean">;
2236
+ default: z$1.ZodOptional<z$1.ZodBoolean>;
2237
+ label: z$1.ZodString;
2238
+ description: z$1.ZodOptional<z$1.ZodString>;
2239
+ }, z$1.core.$strip>, z$1.ZodObject<{
2240
+ type: z$1.ZodLiteral<"select">;
2241
+ options: z$1.ZodArray<z$1.ZodObject<{
2242
+ value: z$1.ZodString;
2243
+ label: z$1.ZodString;
2244
+ }, z$1.core.$strip>>;
2245
+ default: z$1.ZodOptional<z$1.ZodString>;
2246
+ label: z$1.ZodString;
2247
+ description: z$1.ZodOptional<z$1.ZodString>;
2248
+ }, z$1.core.$strip>, z$1.ZodObject<{
2249
+ type: z$1.ZodLiteral<"secret">;
2250
+ label: z$1.ZodString;
2251
+ description: z$1.ZodOptional<z$1.ZodString>;
2252
+ }, z$1.core.$strip>, z$1.ZodObject<{
2253
+ type: z$1.ZodLiteral<"url">;
2254
+ default: z$1.ZodOptional<z$1.ZodString>;
2255
+ placeholder: z$1.ZodOptional<z$1.ZodString>;
2256
+ label: z$1.ZodString;
2257
+ description: z$1.ZodOptional<z$1.ZodString>;
2258
+ }, z$1.core.$strip>, z$1.ZodObject<{
2259
+ type: z$1.ZodLiteral<"email">;
2260
+ default: z$1.ZodOptional<z$1.ZodString>;
2261
+ placeholder: z$1.ZodOptional<z$1.ZodString>;
2262
+ label: z$1.ZodString;
2263
+ description: z$1.ZodOptional<z$1.ZodString>;
2264
+ }, z$1.core.$strip>], "type">>>;
2265
+ pages: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2266
+ path: z$1.ZodString;
2267
+ label: z$1.ZodString;
2268
+ icon: z$1.ZodOptional<z$1.ZodString>;
2269
+ }, z$1.core.$strip>>>;
2270
+ widgets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2271
+ id: z$1.ZodString;
2272
+ size: z$1.ZodOptional<z$1.ZodEnum<{
1776
2273
  full: "full";
1777
2274
  half: "half";
1778
2275
  third: "third";
1779
2276
  }>>;
1780
- title: z.ZodOptional<z.ZodString>;
1781
- }, z.core.$strip>>>;
1782
- fieldWidgets: z.ZodOptional<z.ZodArray<z.ZodObject<{
1783
- name: z.ZodString;
1784
- label: z.ZodString;
1785
- fieldTypes: z.ZodArray<z.ZodEnum<{
2277
+ title: z$1.ZodOptional<z$1.ZodString>;
2278
+ }, z$1.core.$strip>>>;
2279
+ fieldWidgets: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2280
+ name: z$1.ZodString;
2281
+ label: z$1.ZodString;
2282
+ fieldTypes: z$1.ZodArray<z$1.ZodEnum<{
1786
2283
  string: "string";
1787
2284
  number: "number";
1788
2285
  boolean: "boolean";
1789
2286
  file: "file";
2287
+ image: "image";
1790
2288
  slug: "slug";
1791
2289
  datetime: "datetime";
1792
- image: "image";
1793
2290
  text: "text";
1794
2291
  integer: "integer";
1795
2292
  select: "select";
@@ -1799,15 +2296,15 @@ declare const pluginManifestSchema: z.ZodObject<{
1799
2296
  json: "json";
1800
2297
  repeater: "repeater";
1801
2298
  }>>;
1802
- elements: z.ZodOptional<z.ZodArray<z.ZodObject<{
1803
- type: z.ZodString;
1804
- action_id: z.ZodString;
1805
- label: z.ZodOptional<z.ZodString>;
1806
- }, z.core.$loose>>>;
1807
- }, z.core.$strip>>>;
1808
- }, z.core.$strip>;
1809
- }, z.core.$strip>;
1810
- type ValidatedPluginManifest = z.infer<typeof pluginManifestSchema>;
2299
+ elements: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2300
+ type: z$1.ZodString;
2301
+ action_id: z$1.ZodString;
2302
+ label: z$1.ZodOptional<z$1.ZodString>;
2303
+ }, z$1.core.$loose>>>;
2304
+ }, z$1.core.$strip>>>;
2305
+ }, z$1.core.$strip>;
2306
+ }, z$1.core.$strip>;
2307
+ type ValidatedPluginManifest = z$1.infer<typeof pluginManifestSchema>;
1811
2308
  //#endregion
1812
2309
  //#region src/plugins/hooks.d.ts
1813
2310
  type HookNameV2 = "plugin:install" | "plugin:activate" | "plugin:deactivate" | "plugin:uninstall" | "content:beforeSave" | "content:afterSave" | "content:beforeDelete" | "content:afterDelete" | "content:afterPublish" | "content:afterUnpublish" | "media:beforeUpload" | "media:afterUpload" | "cron" | "email:beforeSend" | "email:deliver" | "email:afterSend" | "comment:beforeCreate" | "comment:moderate" | "comment:afterCreate" | "comment:afterModerate" | "page:metadata" | "page:fragments";
@@ -2776,6 +3273,221 @@ interface PreviewToolbarConfig {
2776
3273
  }
2777
3274
  declare function renderPreviewToolbar(config: PreviewToolbarConfig): string;
2778
3275
  //#endregion
3276
+ //#region src/settings/index.d.ts
3277
+ /**
3278
+ * Get a single site setting by key
3279
+ *
3280
+ * Returns `undefined` if the setting has not been configured.
3281
+ * For media settings (logo, favicon), the URL is resolved automatically.
3282
+ *
3283
+ * @param key - The setting key (e.g., "title", "logo", "social")
3284
+ * @returns The setting value, or undefined if not set
3285
+ *
3286
+ * @example
3287
+ * ```ts
3288
+ * import { getSiteSetting } from "dineway";
3289
+ *
3290
+ * const title = await getSiteSetting("title");
3291
+ * const logo = await getSiteSetting("logo");
3292
+ * console.log(logo?.url); // Resolved URL
3293
+ * ```
3294
+ */
3295
+ declare function getSiteSetting<K extends SiteSettingKey>(key: K): Promise<SiteSettings[K] | undefined>;
3296
+ /**
3297
+ * Get all site settings
3298
+ *
3299
+ * Returns all configured settings. Unset values are undefined.
3300
+ * Media references (logo/favicon) are resolved to include URLs.
3301
+ *
3302
+ * @example
3303
+ * ```ts
3304
+ * import { getSiteSettings } from "dineway";
3305
+ *
3306
+ * const settings = await getSiteSettings();
3307
+ * console.log(settings.title); // "My Site"
3308
+ * console.log(settings.logo?.url); // "/_dineway/api/media/file/abc123"
3309
+ * ```
3310
+ */
3311
+ declare function getSiteSettings(): Promise<Partial<SiteSettings>>;
3312
+ /**
3313
+ * Set site settings (internal function used by admin API)
3314
+ *
3315
+ * Merges provided settings with existing ones. Only provided fields are updated.
3316
+ * Media references should include just the mediaId; URLs are resolved on read.
3317
+ *
3318
+ * @param settings - Partial settings object with values to update
3319
+ * @param db - Kysely database instance
3320
+ * @returns Promise that resolves when settings are saved
3321
+ *
3322
+ * @internal
3323
+ *
3324
+ * @example
3325
+ * ```ts
3326
+ * // Update multiple settings at once
3327
+ * await setSiteSettings({
3328
+ * title: "My Site",
3329
+ * tagline: "Welcome",
3330
+ * logo: { mediaId: "med_123", alt: "Logo" }
3331
+ * }, db);
3332
+ * ```
3333
+ */
3334
+ declare function setSiteSettings(settings: Partial<SiteSettings>, db: Kysely<Database>): Promise<void>;
3335
+ /**
3336
+ * Get a single plugin setting by key.
3337
+ *
3338
+ * Plugin settings are stored in the options table under
3339
+ * `plugin:<pluginId>:settings:<key>`.
3340
+ */
3341
+ declare function getPluginSetting<T = unknown>(pluginId: string, key: string): Promise<T | undefined>;
3342
+ /**
3343
+ * Get all persisted plugin settings for a plugin.
3344
+ *
3345
+ * Defaults declared in `admin.settingsSchema` are not materialized
3346
+ * automatically; callers should apply their own fallback defaults.
3347
+ */
3348
+ declare function getPluginSettings(pluginId: string): Promise<Record<string, unknown>>;
3349
+ //#endregion
3350
+ //#region src/comments/query.d.ts
3351
+ interface GetCommentsOptions {
3352
+ collection: string;
3353
+ contentId: string;
3354
+ threaded?: boolean;
3355
+ }
3356
+ interface GetCommentsResult {
3357
+ items: PublicComment[];
3358
+ total: number;
3359
+ }
3360
+ /**
3361
+ * Get approved comments for a content item.
3362
+ *
3363
+ * @example
3364
+ * ```ts
3365
+ * import { getComments } from "dineway";
3366
+ *
3367
+ * const { items, total } = await getComments({
3368
+ * collection: "posts",
3369
+ * contentId: post.id,
3370
+ * threaded: true,
3371
+ * });
3372
+ * ```
3373
+ */
3374
+ declare function getComments(options: GetCommentsOptions): Promise<GetCommentsResult>;
3375
+ /**
3376
+ * Get the count of approved comments for a content item.
3377
+ *
3378
+ * @example
3379
+ * ```ts
3380
+ * import { getCommentCount } from "dineway";
3381
+ *
3382
+ * const count = await getCommentCount("posts", post.id);
3383
+ * ```
3384
+ */
3385
+ declare function getCommentCount(collection: string, contentId: string): Promise<number>;
3386
+ //#endregion
3387
+ //#region src/menus/types.d.ts
3388
+ /**
3389
+ * Menu item types
3390
+ */
3391
+ type MenuItemType = string;
3392
+ /**
3393
+ * Menu item as returned to templates (with resolved URL)
3394
+ */
3395
+ interface MenuItem {
3396
+ id: string;
3397
+ label: string;
3398
+ url: string;
3399
+ target?: string;
3400
+ titleAttr?: string;
3401
+ cssClasses?: string;
3402
+ children: MenuItem[];
3403
+ }
3404
+ /**
3405
+ * Menu as returned to templates
3406
+ */
3407
+ interface Menu {
3408
+ id: string;
3409
+ name: string;
3410
+ label: string;
3411
+ items: MenuItem[];
3412
+ locale: string;
3413
+ translationGroup: string | null;
3414
+ }
3415
+ /**
3416
+ * Input for creating a menu item
3417
+ */
3418
+ interface CreateMenuItemInput {
3419
+ type: MenuItemType;
3420
+ label: string;
3421
+ /**
3422
+ * Identifier of the referenced entity. For content and taxonomy items it is
3423
+ * the target row's translation_group.
3424
+ */
3425
+ referenceCollection?: string;
3426
+ referenceId?: string;
3427
+ customUrl?: string;
3428
+ target?: string;
3429
+ titleAttr?: string;
3430
+ cssClasses?: string;
3431
+ parentId?: string;
3432
+ sortOrder?: number;
3433
+ }
3434
+ /**
3435
+ * Input for updating a menu item
3436
+ */
3437
+ interface UpdateMenuItemInput {
3438
+ label?: string;
3439
+ customUrl?: string;
3440
+ target?: string;
3441
+ titleAttr?: string;
3442
+ cssClasses?: string;
3443
+ parentId?: string | null;
3444
+ sortOrder?: number;
3445
+ }
3446
+ /**
3447
+ * Input for creating a menu
3448
+ */
3449
+ interface CreateMenuInput {
3450
+ name: string;
3451
+ label: string;
3452
+ locale?: string;
3453
+ /** Existing menu id to join as a locale translation. */
3454
+ translationOf?: string;
3455
+ }
3456
+ /**
3457
+ * Input for updating a menu
3458
+ */
3459
+ interface UpdateMenuInput {
3460
+ label?: string;
3461
+ }
3462
+ /**
3463
+ * Input for reordering menu items
3464
+ */
3465
+ interface ReorderMenuItemsInput {
3466
+ items: Array<{
3467
+ id: string;
3468
+ parentId: string | null;
3469
+ sortOrder: number;
3470
+ }>;
3471
+ }
3472
+ //#endregion
3473
+ //#region src/menus/index.d.ts
3474
+ interface MenuQueryOptions {
3475
+ locale?: string;
3476
+ }
3477
+ /**
3478
+ * Get menu by name with resolved URLs.
3479
+ */
3480
+ declare function getMenu(name: string, options?: MenuQueryOptions): Promise<Menu | null>;
3481
+ /**
3482
+ * Get all menus without items.
3483
+ */
3484
+ declare function getMenus(options?: MenuQueryOptions): Promise<Array<{
3485
+ id: string;
3486
+ name: string;
3487
+ label: string;
3488
+ locale: string;
3489
+ }>>;
3490
+ //#endregion
2779
3491
  //#region src/bylines/index.d.ts
2780
3492
  /**
2781
3493
  * Get a byline by ID.
@@ -2804,7 +3516,177 @@ declare function getByline(id: string): Promise<BylineSummary | null>;
2804
3516
  * }
2805
3517
  * ```
2806
3518
  */
2807
- declare function getBylineBySlug(slug: string): Promise<BylineSummary | null>;
3519
+ declare function getBylineBySlug(slug: string, options?: {
3520
+ locale?: string;
3521
+ }): Promise<BylineSummary | null>;
3522
+ //#endregion
3523
+ //#region src/taxonomies/types.d.ts
3524
+ /**
3525
+ * Taxonomy types for Dineway Agentic Web builder
3526
+ */
3527
+ /**
3528
+ * Taxonomy definition - describes a taxonomy like "category" or "tag"
3529
+ */
3530
+ interface TaxonomyDef {
3531
+ id: string;
3532
+ name: string;
3533
+ label: string;
3534
+ labelSingular?: string;
3535
+ hierarchical: boolean;
3536
+ collections: string[];
3537
+ locale: string;
3538
+ translationGroup: string | null;
3539
+ }
3540
+ /**
3541
+ * Taxonomy term - a specific term within a taxonomy (e.g., "News" in "category")
3542
+ */
3543
+ interface TaxonomyTerm {
3544
+ id: string;
3545
+ name: string;
3546
+ slug: string;
3547
+ label: string;
3548
+ parentId?: string;
3549
+ description?: string;
3550
+ children: TaxonomyTerm[];
3551
+ count?: number;
3552
+ locale: string;
3553
+ translationGroup: string | null;
3554
+ }
3555
+ /**
3556
+ * Flat version for DB row
3557
+ */
3558
+ interface TaxonomyTermRow {
3559
+ id: string;
3560
+ name: string;
3561
+ slug: string;
3562
+ label: string;
3563
+ parent_id: string | null;
3564
+ data: string | null;
3565
+ locale: string;
3566
+ translation_group: string | null;
3567
+ }
3568
+ /**
3569
+ * Input for creating a term
3570
+ */
3571
+ interface CreateTermInput {
3572
+ slug: string;
3573
+ label: string;
3574
+ parentId?: string;
3575
+ description?: string;
3576
+ locale?: string;
3577
+ /** Existing term id to join as a locale translation. */
3578
+ translationOf?: string;
3579
+ }
3580
+ /**
3581
+ * Input for updating a term
3582
+ */
3583
+ interface UpdateTermInput {
3584
+ slug?: string;
3585
+ label?: string;
3586
+ parentId?: string | null;
3587
+ description?: string;
3588
+ }
3589
+ //#endregion
3590
+ //#region src/taxonomies/index.d.ts
3591
+ interface TaxonomyQueryOptions {
3592
+ locale?: string;
3593
+ }
3594
+ /**
3595
+ * Get every taxonomy definition for the active locale.
3596
+ */
3597
+ declare function getTaxonomyDefs(options?: TaxonomyQueryOptions): Promise<TaxonomyDef[]>;
3598
+ /**
3599
+ * Get a single taxonomy definition by name, following the locale fallback chain.
3600
+ */
3601
+ declare function getTaxonomyDef(name: string, options?: TaxonomyQueryOptions): Promise<TaxonomyDef | null>;
3602
+ /**
3603
+ * Get all terms for a taxonomy in the active locale.
3604
+ */
3605
+ declare function getTaxonomyTerms(taxonomyName: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm[]>;
3606
+ /**
3607
+ * Get a single term by taxonomy and slug, following the locale fallback chain.
3608
+ */
3609
+ declare function getTerm(taxonomyName: string, slug: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm | null>;
3610
+ /**
3611
+ * Get terms assigned to an entry, resolved into the active locale.
3612
+ */
3613
+ declare function getEntryTerms(collection: string, entryId: string, taxonomyName?: string, options?: TaxonomyQueryOptions): Promise<TaxonomyTerm[]>;
3614
+ /**
3615
+ * Get terms for multiple entries in one taxonomy.
3616
+ */
3617
+ declare function getTermsForEntries(collection: string, entryIds: string[], taxonomyName: string, options?: TaxonomyQueryOptions): Promise<Map<string, TaxonomyTerm[]>>;
3618
+ /**
3619
+ * Get entries by term.
3620
+ */
3621
+ declare function getEntriesByTerm(collection: string, taxonomyName: string, termSlug: string, options?: TaxonomyQueryOptions): Promise<Array<{
3622
+ id: string;
3623
+ data: Record<string, unknown>;
3624
+ }>>;
3625
+ //#endregion
3626
+ //#region src/widgets/types.d.ts
3627
+ type WidgetType = "content" | "menu" | "component";
3628
+ interface Widget {
3629
+ id: string;
3630
+ type: WidgetType;
3631
+ title?: string;
3632
+ content?: PortableTextBlock$1[];
3633
+ menuName?: string;
3634
+ componentId?: string;
3635
+ componentProps?: Record<string, unknown>;
3636
+ }
3637
+ interface WidgetArea {
3638
+ id: string;
3639
+ name: string;
3640
+ label: string;
3641
+ description?: string;
3642
+ widgets: Widget[];
3643
+ }
3644
+ interface WidgetComponentDef {
3645
+ id: string;
3646
+ label: string;
3647
+ description?: string;
3648
+ props: Record<string, PropDef>;
3649
+ }
3650
+ interface PropDef {
3651
+ type: "string" | "number" | "boolean" | "select";
3652
+ label: string;
3653
+ default?: unknown;
3654
+ options?: Array<{
3655
+ value: string;
3656
+ label: string;
3657
+ }>;
3658
+ }
3659
+ interface CreateWidgetAreaInput {
3660
+ name: string;
3661
+ label: string;
3662
+ description?: string;
3663
+ }
3664
+ interface CreateWidgetInput {
3665
+ type: WidgetType;
3666
+ title?: string;
3667
+ content?: PortableTextBlock$1[];
3668
+ menuName?: string;
3669
+ componentId?: string;
3670
+ componentProps?: Record<string, unknown>;
3671
+ }
3672
+ interface UpdateWidgetInput extends Partial<CreateWidgetInput> {}
3673
+ interface ReorderWidgetsInput {
3674
+ widgetIds: string[];
3675
+ }
3676
+ //#endregion
3677
+ //#region src/widgets/index.d.ts
3678
+ /**
3679
+ * Get a widget area by name, with all its widgets
3680
+ */
3681
+ declare function getWidgetArea(name: string): Promise<WidgetArea | null>;
3682
+ /**
3683
+ * Get all widget areas with their widgets
3684
+ */
3685
+ declare function getWidgetAreas(): Promise<WidgetArea[]>;
3686
+ /**
3687
+ * Get available widget components (for admin UI)
3688
+ */
3689
+ declare function getWidgetComponents(): WidgetComponentDef[];
2808
3690
  //#endregion
2809
3691
  //#region src/search/types.d.ts
2810
3692
  /**
@@ -3600,4 +4482,4 @@ declare global {
3600
4482
  var __dinewayConfig: DinewayConfig | undefined;
3601
4483
  }
3602
4484
  //#endregion
3603
- export { createPluginManager as $, isParseError as $n, SandboxOptions as $t, dropSessionDatabaseTables as A, handleContentDelete as An, verifyPreviewSignature as At, GeneratePreviewTokenOptions as B, handleContentSchedule as Bn, prosemirrorToPortableText as Bt, getByline as C, handleRevisionList as Cn, SessionOpenOrCreateOptions as Ct, AppliedSnapshotMeta as D, handleContentCountScheduled as Dn, defaultPreviewSidecarClient as Dt, renderPreviewToolbar as E, handleContentCompare as En, buildPreviewSignatureHeader as Et, getPreviewToken as F, handleContentList as Fn, AfterCallback as Ft, parseContentId as G, CreateMediaInput as Gn, PortableTextSpan as Gt, VerifyPreviewTokenOptions as H, handleContentUnpublish as Hn, PortableTextImageBlock as Ht, isPreviewRequest as I, handleContentListTrashed as In, after as It, createNodeSandboxRunner as J, ContentRepository as Jn, ProseMirrorDocument as Jt, verifyPreviewToken as K, MediaItem as Kn, PortableTextTextBlock as Kt, GetPreviewUrlOptions as L, handleContentPermanentDelete as Ln, computeContentHash as Lt, Snapshot as M, handleContentDuplicate as Mn, getFallbackChain as Mt, renderPreviewLoadingPage as N, handleContentGet as Nn, getI18nConfig as Nt, ApplySnapshotToDatabaseOptions as O, handleContentCountTrashed as On, parsePreviewSignatureHeader as Ot, isBlockedInPreview as P, handleContentGetIncludingTrashed as Pn, isI18nEnabled as Pt, PluginManager as Q, ParseResult as Qn, SandboxEmailSendCallback as Qt, buildPreviewUrl as R, handleContentPublish as Rn, hashString as Rt, Suggestion as S, handleRevisionGet as Sn, SessionOpenOptions as St, PreviewToolbarConfig as T, generateManifest as Tn, PreviewSidecarSignature as Tt, VerifyPreviewTokenResult as U, handleContentUnschedule as Un, PortableTextLinkMark as Ut, PreviewTokenPayload as V, handleContentTranslations as Vn, PortableTextCodeBlock as Vt, generatePreviewToken as W, handleContentUpdate as Wn, PortableTextMarkDef as Wt, SandboxNotAvailableError as X, DinewayDatabaseError as Xn, ProseMirrorNode as Xt, NoopSandboxRunner as Y, DatabaseConfig as Yn, ProseMirrorMark as Yt, createNoopSandboxRunner as Z, OptionsRepository as Zn, SandboxEmailMessage as Zt, SearchOptions as _, handleMediaGet as _n, SessionCleanupResult as _t, S3StorageConfig as a, getSections as an, ApiContext as ar, ValidatedPluginManifest as at, SearchStats as b, RevisionListResponse as bn, SessionDatabaseInfo as bt, extractSearchableFields as c, Section as cn, FieldDescriptor as cr, CollectionFilter as ct, search as d, SchemaError as dn, dinewayLoader as dt, SandboxRunner as en, parseBody as er, PluginRouteError as et, searchCollection as f, SchemaRegistry as fn, getDb as ft, SearchConfig as g, handleMediaDelete as gn, FileSessionDatabaseFactoryOptions as gt, CollectionSearchOptions as h, handleMediaCreate as hn, FileSessionDatabaseFactory as ht, LocalStorageConfig as i, getSection as in, handleError as ir, createHookPipeline as it, getAppliedSnapshotMeta as j, handleContentDiscardDraft as jn, I18nConfig as jt, applySnapshotToDatabase as k, handleContentCreate as kn, signPreviewUrl as kt, getSearchStats as l, SectionSource as ln, ListResponse as lr, EntryData as lt, FTSManager as m, MediaResponse as mn, createFilePreviewMiddleware as mt, PluginDescriptor as n, SandboxedPlugin as nn, apiError as nr, HookPipeline as nt, StorageDescriptor as o, CreateSectionInput as on, ContentListResponse as or, pluginManifestSchema as ot, searchWithDb as p, MediaListResponse as pn, FilePreviewMiddlewareConfig as pt, NodeSandboxRunner as q, MediaRepository as qn, PortableTextUnknownBlock as qt, getStoredConfig as r, SerializedRequest as rn, apiSuccess as rr, HookResult as rt, extractPlainText as s, GetSectionsOptions as sn, ContentResponse as sr, definePlugin as st, DinewayConfig as t, SandboxRunnerFactory as tn, parseQuery as tr, EmailPipeline as tt, getSuggestions as u, UpdateSectionInput as un, ManifestResponse as ur, EntryFilter as ut, SearchResponse as v, handleMediaList as vn, SessionDatabaseFactory as vt, getBylineBySlug as w, handleRevisionRestore as wn, PreviewSidecarClient as wt, SuggestOptions as x, RevisionResponse as xn, SessionDatabaseLimitError as xt, SearchResult as y, handleMediaUpdate as yn, SessionDatabaseHandle as yt, getPreviewUrl as z, handleContentRestore as zn, portableTextToProsemirror as zt };
4485
+ export { Menu as $, portableTextToProsemirror as $n, handleContentPermanentDelete as $r, FileSessionDatabaseFactory as $t, UpdateWidgetInput as A, ApiContext as Ai, TranslationSummary as An, MediaResponse as Ar, PreviewTokenPayload as At, getTerm as B, createEditable as Bn, handleRevisionRestore as Br, createNoopSandboxRunner as Bt, getWidgetArea as C, ParseResult as Ci, CollectionResult as Cn, Section as Cr, isBlockedInPreview as Ct, CreateWidgetInput as D, apiError as Di, EntryResult as Dn, SchemaError as Dr, buildPreviewUrl as Dt, CreateWidgetAreaInput as E, parseQuery as Ei, EditFieldMeta as En, getCollectionInfo as Er, GetPreviewUrlOptions as Et, getEntriesByTerm as F, ManifestResponse as Fi, getTranslations as Fn, handleMediaUpdate as Fr, verifyPreviewToken as Ft, TaxonomyTermRow as G, WhereRange as Gn, handleContentCreate as Gr, HookPipeline as Gt, CreateTermInput as H, CollectionFilter$1 as Hn, handleContentCompare as Hr, createPluginManager as Ht, getEntryTerms as I, resolveDinewayPath as In, RevisionListResponse as Ir, NodeSandboxRunner as It, getBylineBySlug as J, getDb as Jn, handleContentDuplicate as Jr, ValidatedPluginManifest as Jt, UpdateTermInput as K, WhereValue as Kn, handleContentDelete as Kr, HookResult as Kt, getTaxonomyDef as L, CMSAnnotation as Ln, RevisionResponse as Lr, createNodeSandboxRunner as Lt, WidgetArea as M, ContentResponse as Mi, getDinewayCollection as Mn, handleMediaDelete as Mr, VerifyPreviewTokenResult as Mt, WidgetComponentDef as N, FieldDescriptor as Ni, getDinewayEntry as Nn, handleMediaGet as Nr, generatePreviewToken as Nt, PropDef as O, apiSuccess as Oi, InferCollectionData as On, SchemaRegistry as Or, getPreviewUrl as Ot, WidgetType as P, ListResponse as Pi, getEditMeta as Pn, handleMediaList as Pr, parseContentId as Pt, CreateMenuItemInput as Q, hashString as Qn, handleContentListTrashed as Qr, createFilePreviewMiddleware as Qt, getTaxonomyDefs as R, EditProxy as Rn, handleRevisionGet as Rr, NoopSandboxRunner as Rt, Suggestion as S, OptionsRepository as Si, CollectionFilter as Sn, GetSectionsOptions as Sr, renderPreviewLoadingPage as St, getWidgetComponents as T, parseBody as Ti, DinewayCollections as Tn, UpdateSectionInput as Tr, isPreviewRequest as Tt, TaxonomyDef as U, EntryData as Un, handleContentCountScheduled as Ur, PluginRouteError as Ut, getTermsForEntries as V, createNoop as Vn, generateManifest as Vr, PluginManager as Vt, TaxonomyTerm as W, EntryFilter as Wn, handleContentCountTrashed as Wr, EmailPipeline as Wt, getMenus as X, sanitizeHref as Xn, handleContentGetIncludingTrashed as Xr, definePlugin as Xt, getMenu as Y, isSafeHref as Yn, handleContentGet as Yr, pluginManifestSchema as Yt, CreateMenuInput as Z, computeContentHash as Zn, handleContentList as Zr, FilePreviewMiddlewareConfig as Zt, SearchOptions as _, MediaItem as _i, getI18nConfig as _n, SandboxedPlugin as _r, ApplySnapshotToDatabaseOptions as _t, S3StorageConfig as a, handleContentUnschedule as ai, SessionDatabaseLimitError as an, PortableTextMarkDef as ar, GetCommentsOptions as at, SearchStats as b, DatabaseConfig as bi, after as bn, getSections as br, getAppliedSnapshotMeta as bt, extractSearchableFields as c, reference as ci, PreviewSidecarClient as cn, PortableTextUnknownBlock as cr, getComments as ct, search as d, FieldUIHints as di, defaultPreviewSidecarClient as dn, ProseMirrorNode as dr, getSiteSetting as dt, handleContentPublish as ei, FileSessionDatabaseFactoryOptions as en, prosemirrorToPortableText as er, MenuItem as et, searchCollection as f, FileValue as fi, parsePreviewSignatureHeader as fn, SandboxEmailMessage as fr, getSiteSettings as ft, SearchConfig as g, CreateMediaInput as gi, getFallbackChain as gn, SandboxRunnerFactory as gr, AppliedSnapshotMeta as gt, CollectionSearchOptions as h, PublicComment as hi, I18nConfig as hn, SandboxRunner as hr, renderPreviewToolbar as ht, LocalStorageConfig as i, handleContentUnpublish as ii, SessionDatabaseInfo as in, PortableTextLinkMark as ir, UpdateMenuItemInput as it, Widget as j, ContentListResponse as ji, TranslationsResult as jn, handleMediaCreate as jr, VerifyPreviewTokenOptions as jt, ReorderWidgetsInput as k, handleError as ki, ResolvePathResult as kn, MediaListResponse as kr, GeneratePreviewTokenOptions as kt, getSearchStats as l, image as li, PreviewSidecarSignature as ln, ProseMirrorDocument as lr, getPluginSetting as lt, FTSManager as m, PortableTextBlock$1 as mi, verifyPreviewSignature as mn, SandboxOptions as mr, PreviewToolbarConfig as mt, PluginDescriptor as n, handleContentSchedule as ni, SessionDatabaseFactory as nn, PortableTextHtmlBlock as nr, ReorderMenuItemsInput as nt, StorageDescriptor as o, handleContentUpdate as oi, SessionOpenOptions as on, PortableTextSpan as or, GetCommentsResult as ot, searchWithDb as p, ImageValue as pi, signPreviewUrl as pn, SandboxEmailSendCallback as pr, setSiteSettings as pt, getByline as q, dinewayLoader as qn, handleContentDiscardDraft as qr, createHookPipeline as qt, getStoredConfig as r, handleContentTranslations as ri, SessionDatabaseHandle as rn, PortableTextImageBlock as rr, UpdateMenuInput as rt, extractPlainText as s, portableText as si, SessionOpenOrCreateOptions as sn, PortableTextTextBlock as sr, getCommentCount as st, DinewayConfig as t, handleContentRestore as ti, SessionCleanupResult as tn, PortableTextCodeBlock as tr, MenuItemType as tt, getSuggestions as u, FieldDefinition as ui, buildPreviewSignatureHeader as un, ProseMirrorMark as ur, getPluginSettings as ut, SearchResponse as v, MediaRepository as vi, isI18nEnabled as vn, SerializedRequest as vr, applySnapshotToDatabase as vt, getWidgetAreas as w, isParseError as wi, ContentEntry as wn, SectionSource as wr, getPreviewToken as wt, SuggestOptions as x, DinewayDatabaseError as xi, CacheHint as xn, CreateSectionInput as xr, Snapshot as xt, SearchResult as y, ContentRepository as yi, AfterCallback as yn, getSection as yr, dropSessionDatabaseTables as yt, getTaxonomyTerms as z, FieldAnnotation as zn, handleRevisionList as zr, SandboxNotAvailableError as zt };