dineway 0.1.15 → 0.1.16

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 (365) hide show
  1. package/dist/{activity-events-B4wp7CrU.mjs → activity-events-DbqJBNaY.mjs} +1 -1
  2. package/dist/{allowed-origins-C1AKK9AT.mjs → allowed-origins-D85wzUp6.mjs} +1 -1
  3. package/dist/api/route-utils.d.mts +10 -10
  4. package/dist/api/route-utils.mjs +15 -15
  5. package/dist/api/schemas/index.d.mts +2 -2
  6. package/dist/api/schemas/index.mjs +4 -4
  7. package/dist/{api-DX6X_a82.mjs → api-B5xMY72-.mjs} +96 -17
  8. package/dist/{api-tokens-D7UjLbdt.mjs → api-tokens-CMmUPFae.mjs} +1 -1
  9. package/dist/{apply-Bm5QgdrE.mjs → apply-CGVHi2r7.mjs} +165 -85
  10. package/dist/astro/index.d.mts +11 -11
  11. package/dist/astro/index.mjs +3 -3
  12. package/dist/astro/middleware/auth.d.mts +10 -10
  13. package/dist/astro/middleware/auth.mjs +5 -5
  14. package/dist/astro/middleware/redirect.mjs +6 -6
  15. package/dist/astro/middleware/request-context.mjs +4 -4
  16. package/dist/astro/middleware/setup.mjs +1 -1
  17. package/dist/astro/middleware.mjs +119 -77
  18. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +5 -5
  19. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +5 -5
  20. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  21. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  22. package/dist/astro/routes/api/admin/briefing.mjs +19 -19
  23. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +12 -12
  24. package/dist/astro/routes/api/admin/bylines/index.mjs +12 -12
  25. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +13 -13
  26. package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -6
  27. package/dist/astro/routes/api/admin/comments/bulk.mjs +10 -10
  28. package/dist/astro/routes/api/admin/comments/counts.mjs +6 -6
  29. package/dist/astro/routes/api/admin/comments/index.mjs +10 -10
  30. package/dist/astro/routes/api/admin/context/_id_/history.mjs +26 -26
  31. package/dist/astro/routes/api/admin/context/_id_/index.mjs +26 -26
  32. package/dist/astro/routes/api/admin/context/_id_/review.mjs +30 -30
  33. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +30 -30
  34. package/dist/astro/routes/api/admin/context/diff.mjs +29 -29
  35. package/dist/astro/routes/api/admin/context/index.mjs +30 -30
  36. package/dist/astro/routes/api/admin/context/stale.mjs +29 -29
  37. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +26 -26
  38. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +29 -29
  39. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +29 -29
  40. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +27 -27
  41. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  42. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  43. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  44. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +47 -47
  45. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +47 -47
  46. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +40 -40
  47. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +46 -46
  48. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +46 -46
  49. package/dist/astro/routes/api/admin/plugins/index.mjs +40 -40
  50. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  51. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +40 -40
  52. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +46 -46
  53. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +40 -40
  54. package/dist/astro/routes/api/admin/plugins/updates.mjs +40 -40
  55. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +6 -6
  56. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +29 -29
  57. package/dist/astro/routes/api/admin/review-requests/index.mjs +10 -10
  58. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +40 -40
  59. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  60. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +40 -40
  61. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +2 -2
  62. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  63. package/dist/astro/routes/api/admin/users/_id_/index.mjs +6 -6
  64. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  65. package/dist/astro/routes/api/admin/users/index.mjs +5 -5
  66. package/dist/astro/routes/api/auth/dev-bypass.mjs +5 -5
  67. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  68. package/dist/astro/routes/api/auth/invite/complete.mjs +10 -10
  69. package/dist/astro/routes/api/auth/invite/index.mjs +7 -7
  70. package/dist/astro/routes/api/auth/invite/register-options.mjs +9 -9
  71. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  72. package/dist/astro/routes/api/auth/magic-link/send.mjs +9 -9
  73. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  74. package/dist/astro/routes/api/auth/me.mjs +5 -5
  75. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  76. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +2 -2
  77. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  78. package/dist/astro/routes/api/auth/passkey/_id_.mjs +5 -5
  79. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  80. package/dist/astro/routes/api/auth/passkey/options.mjs +11 -11
  81. package/dist/astro/routes/api/auth/passkey/register/options.mjs +9 -9
  82. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +10 -10
  83. package/dist/astro/routes/api/auth/passkey/verify.mjs +10 -10
  84. package/dist/astro/routes/api/auth/signup/complete.mjs +10 -10
  85. package/dist/astro/routes/api/auth/signup/request.mjs +9 -9
  86. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  87. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  88. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  89. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -6
  90. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
  91. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +7 -7
  92. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +12 -12
  93. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +28 -28
  94. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
  95. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  96. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +10 -10
  97. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +13 -13
  98. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  99. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -6
  100. package/dist/astro/routes/api/content/_collection_/_id_.mjs +10 -10
  101. package/dist/astro/routes/api/content/_collection_/index.mjs +10 -10
  102. package/dist/astro/routes/api/content/_collection_/trash.mjs +6 -6
  103. package/dist/astro/routes/api/dashboard.mjs +9 -9
  104. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  105. package/dist/astro/routes/api/health.mjs +1 -1
  106. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  107. package/dist/astro/routes/api/import/probe.mjs +10 -10
  108. package/dist/astro/routes/api/import/wordpress/analyze.mjs +3 -3
  109. package/dist/astro/routes/api/import/wordpress/execute.mjs +29 -29
  110. package/dist/astro/routes/api/import/wordpress/media.mjs +7 -7
  111. package/dist/astro/routes/api/import/wordpress/prepare.mjs +33 -33
  112. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.d.mts +48 -0
  113. package/dist/astro/routes/api/import/wordpress/rewrite-url-helpers.mjs +124 -0
  114. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +32 -145
  115. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  116. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +10 -10
  117. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  118. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +1 -1
  119. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +33 -33
  120. package/dist/astro/routes/api/manifest.mjs +4 -4
  121. package/dist/astro/routes/api/mcp.mjs +277 -91
  122. package/dist/astro/routes/api/media/_id_/confirm.mjs +6 -6
  123. package/dist/astro/routes/api/media/_id_.mjs +6 -6
  124. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  125. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  126. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  127. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  128. package/dist/astro/routes/api/media/upload-url.mjs +11 -13
  129. package/dist/astro/routes/api/media.mjs +18 -18
  130. package/dist/astro/routes/api/menus/_name_/items.mjs +45 -36
  131. package/dist/astro/routes/api/menus/_name_/reorder.mjs +34 -31
  132. package/dist/astro/routes/api/menus/_name_/translations.d.mts +8 -0
  133. package/dist/astro/routes/api/menus/_name_/translations.mjs +111 -0
  134. package/dist/astro/routes/api/menus/_name_.mjs +47 -36
  135. package/dist/astro/routes/api/menus/index.mjs +34 -32
  136. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  137. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  138. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  139. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  140. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  141. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  142. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  143. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  144. package/dist/astro/routes/api/openapi.json.mjs +3 -3
  145. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +3 -3
  146. package/dist/astro/routes/api/redirects/404s/index.mjs +12 -12
  147. package/dist/astro/routes/api/redirects/404s/summary.mjs +12 -12
  148. package/dist/astro/routes/api/redirects/_id_.mjs +31 -31
  149. package/dist/astro/routes/api/redirects/index.mjs +31 -31
  150. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  151. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  152. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +41 -41
  153. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +41 -41
  154. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +41 -41
  155. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +41 -41
  156. package/dist/astro/routes/api/schema/collections/index.mjs +41 -41
  157. package/dist/astro/routes/api/schema/index.mjs +6 -6
  158. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +40 -40
  159. package/dist/astro/routes/api/schema/orphans/index.mjs +40 -40
  160. package/dist/astro/routes/api/search/enable.mjs +12 -12
  161. package/dist/astro/routes/api/search/index.mjs +11 -11
  162. package/dist/astro/routes/api/search/rebuild.mjs +12 -12
  163. package/dist/astro/routes/api/search/stats.mjs +8 -8
  164. package/dist/astro/routes/api/search/suggest.mjs +11 -11
  165. package/dist/astro/routes/api/sections/_slug_.mjs +30 -30
  166. package/dist/astro/routes/api/sections/index.mjs +30 -30
  167. package/dist/astro/routes/api/settings/email.mjs +4 -4
  168. package/dist/astro/routes/api/settings.mjs +30 -30
  169. package/dist/astro/routes/api/setup/admin-verify.mjs +12 -12
  170. package/dist/astro/routes/api/setup/admin.mjs +10 -10
  171. package/dist/astro/routes/api/setup/dev-bypass.mjs +25 -25
  172. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  173. package/dist/astro/routes/api/setup/index.mjs +26 -26
  174. package/dist/astro/routes/api/setup/status.mjs +3 -3
  175. package/dist/astro/routes/api/snapshot.mjs +7 -7
  176. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.d.mts +8 -0
  177. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +131 -0
  178. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +49 -41
  179. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +36 -34
  180. package/dist/astro/routes/api/taxonomies/index.mjs +36 -34
  181. package/dist/astro/routes/api/themes/preview.mjs +6 -6
  182. package/dist/astro/routes/api/typegen.mjs +4 -4
  183. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  184. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  185. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  186. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +29 -29
  187. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +30 -30
  188. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +30 -30
  189. package/dist/astro/routes/api/widget-areas/_name_.mjs +28 -28
  190. package/dist/astro/routes/api/widget-areas/index.mjs +30 -30
  191. package/dist/astro/routes/api/widget-components.mjs +2 -2
  192. package/dist/astro/routes/robots.txt.mjs +9 -9
  193. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  194. package/dist/astro/routes/sitemap.xml.mjs +10 -10
  195. package/dist/astro/types.d.mts +16 -14
  196. package/dist/auth/providers/github.d.mts +1 -1
  197. package/dist/auth/providers/google.d.mts +1 -1
  198. package/dist/{auth-control-guard-DOZ3UCsP.mjs → auth-control-guard--r6LlNkX.mjs} +1 -1
  199. package/dist/{authorize-BAdbMCwC.mjs → authorize-wQDmXQJ1.mjs} +1 -1
  200. package/dist/{briefing-MVYe_Uyf.mjs → briefing-4k6R0KAr.mjs} +7 -7
  201. package/dist/{briefing-rty4O-wa.mjs → briefing-DM7e2yd3.mjs} +1 -1
  202. package/dist/{byline-naZxOPSa.mjs → byline-BxAf79s1.mjs} +4 -4
  203. package/dist/{bylines-DCvz5gtm.d.mts → bylines-DE9bfDur.d.mts} +65 -3
  204. package/dist/{bylines-C4LIBOOO.mjs → bylines-DhCnhR70.mjs} +3 -3
  205. package/dist/{cache-DEbQ13c9.mjs → cache-inQvbrP5.mjs} +1 -1
  206. package/dist/{chunks-D_jVet6z.mjs → chunks-vkrCT4Ta.mjs} +7 -1
  207. package/dist/cli/index.mjs +337 -102
  208. package/dist/client/external-auth-headers.d.mts +1 -1
  209. package/dist/client/index.d.mts +1 -1
  210. package/dist/client/index.mjs +1 -1
  211. package/dist/{comment-DFO-gWDH.mjs → comment-BmJXz3lc.mjs} +1 -1
  212. package/dist/{comments--BsZ9pqA.mjs → comments-BW1qFiTa.mjs} +1 -1
  213. package/dist/{content-CyLkb-qH.mjs → content-DvpMad_N.mjs} +4 -3
  214. package/dist/{context-DNfcm853.mjs → context-CGbVhAmd.mjs} +2 -2
  215. package/dist/{context-CNIkMzot.mjs → context-CT44ux1O.mjs} +10 -10
  216. package/dist/{context-route-helpers-MurhoxWF.mjs → context-route-helpers-CcvSXJtQ.mjs} +1 -1
  217. package/dist/{dashboard-DqnYU8EU.mjs → dashboard-6gH7SlPM.mjs} +9 -18
  218. package/dist/database/instrumentation.d.mts +1 -1
  219. package/dist/database/instrumentation.mjs +14 -4
  220. package/dist/db/index.d.mts +3 -3
  221. package/dist/db/index.mjs +2 -2
  222. package/dist/db/libsql.d.mts +1 -1
  223. package/dist/db/postgres.d.mts +1 -1
  224. package/dist/db/sqlite.d.mts +1 -1
  225. package/dist/{device-flow-BGEH5jfn.mjs → device-flow-DaTBhALC.mjs} +5 -5
  226. package/dist/{dialect-helpers-DhTzaUxP.mjs → dialect-helpers-TkdbkFad.mjs} +7 -1
  227. package/dist/{fts-manager-B1pTNEG_.mjs → fts-manager-D7KVeBmg.mjs} +1 -1
  228. package/dist/{hitl-requests-ChT32Ilo.mjs → hitl-requests-CUnch_4e.mjs} +2 -2
  229. package/dist/{hitl-route-helpers-CSit54Ru.mjs → hitl-route-helpers-DcUCm57p.mjs} +4 -4
  230. package/dist/{import-BHRLhXAn.mjs → import-BVqG28WP.mjs} +3 -3
  231. package/dist/{import-CNcKWTbp.mjs → import-DE2ziezs.mjs} +2 -2
  232. package/dist/{index-CYfhYgXd.d.mts → index-DpMWSamU.d.mts} +2 -2
  233. package/dist/{index-EUAWaIxW.d.mts → index-JzJUzE4o.d.mts} +47 -47
  234. package/dist/index.d.mts +16 -16
  235. package/dist/index.mjs +65 -65
  236. package/dist/{jsonld-D2gUY4kA.d.mts → jsonld-BjsoTL5m.d.mts} +2 -2
  237. package/dist/{loader-PZnPxFLc.mjs → loader-CQFxFOt1.mjs} +2 -2
  238. package/dist/media/index.d.mts +2 -2
  239. package/dist/media/index.mjs +2 -2
  240. package/dist/media/local-runtime.d.mts +12 -12
  241. package/dist/media/local-runtime.mjs +3 -3
  242. package/dist/{media-_7Fxdu45.mjs → media-Cg4zc9fq.mjs} +12 -9
  243. package/dist/media-allowlist-eS3AZ2L_.mjs +26 -0
  244. package/dist/{menus-DYW_UHjv.mjs → menus-BDW1yIdj.mjs} +80 -87
  245. package/dist/menus-CwI7DQJ5.mjs +569 -0
  246. package/dist/mime-DJOFDGux.mjs +35 -0
  247. package/dist/{oauth-authorization-DxGjiWKL.mjs → oauth-authorization-DcYRiDfi.mjs} +5 -5
  248. package/dist/{oauth-clients-DxO_NO7k.mjs → oauth-clients-CgKFA-VH.mjs} +2 -2
  249. package/dist/page/index.d.mts +2 -2
  250. package/dist/page/index.mjs +1 -1
  251. package/dist/{parse-C9106ehs.mjs → parse-BBfZRZYb.mjs} +1 -1
  252. package/dist/{placeholder-Bh1dfUOd.d.mts → placeholder-DKMMLt42.d.mts} +1 -1
  253. package/dist/plugins/adapt-sandbox-entry.d.mts +10 -10
  254. package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
  255. package/dist/{plugins-D7-ILNib.mjs → plugins-DKceDtUM.mjs} +9 -7
  256. package/dist/{preview-DvYRU-Oy.mjs → preview-CIDYFBzd.mjs} +2 -2
  257. package/dist/{provider-loader-BiQ6lNmf.d.mts → provider-loader-D0F6E2qv.d.mts} +1 -1
  258. package/dist/{query-CsbOywSY.mjs → query-BtuwuZRd.mjs} +3 -3
  259. package/dist/{query-B9BO5goQ.mjs → query-CWPxZjGM.mjs} +11 -11
  260. package/dist/{rate-limit-DmVTHI5v.mjs → rate-limit-GN64_Jaw.mjs} +5 -5
  261. package/dist/{redirect-CGl64yOX.mjs → redirect-BHo9--Jz.mjs} +3 -3
  262. package/dist/{redirects-Cgi_cZfN.mjs → redirects-Bc40BgxA.mjs} +4 -4
  263. package/dist/{redirects-lrlmYXVE.mjs → redirects-xVDvj_yQ.mjs} +68 -15
  264. package/dist/{registry-C-_hxLqa.mjs → registry-DumDzFDn.mjs} +5 -5
  265. package/dist/{request-cache-DHMRr2Lf.mjs → request-cache-DmVyQUBh.mjs} +5 -1
  266. package/dist/request-context.d.mts +19 -1
  267. package/dist/request-context.mjs +15 -3
  268. package/dist/{request-meta-DixlNKKa.mjs → request-meta-BVx9KkL-.mjs} +1 -1
  269. package/dist/{review-requests-C2DIHwlJ.mjs → review-requests-BYuoyse0.mjs} +1 -1
  270. package/dist/{review-requests-DIyjw-K_.mjs → review-requests-vCw7_3DS.mjs} +1 -1
  271. package/dist/{runner-BU6Lo1ZS.d.mts → runner-CHR_W79l.d.mts} +1 -1
  272. package/dist/{runner-DWZm2KQm.mjs → runner-lqEiJbO-.mjs} +496 -181
  273. package/dist/{runtime-QuuFSlc6.d.mts → runtime-DY_XmE9Y.d.mts} +15 -14
  274. package/dist/runtime.d.mts +11 -11
  275. package/dist/runtime.mjs +5 -5
  276. package/dist/{schema-BECjUhP8.mjs → schema-D1z41cq_.mjs} +1 -1
  277. package/dist/{search-DqTHQqtV.mjs → search-CPcQGTHW.mjs} +2 -2
  278. package/dist/{secrets-CkoJ9zN0.mjs → secrets-AFKoqUXj.mjs} +2 -2
  279. package/dist/{sections-B61OxnfB.mjs → sections-B9RYyf3I.mjs} +2 -2
  280. package/dist/seed/index.d.mts +2 -2
  281. package/dist/seed/index.mjs +19 -19
  282. package/dist/seo/index.d.mts +1 -1
  283. package/dist/{seo-CUQctrog.mjs → seo-BPz1KkCq.mjs} +1 -1
  284. package/dist/{service-CyOsm0R6.mjs → service-DgiH1Yud.mjs} +2 -2
  285. package/dist/{settings-Dzgswvg4.mjs → settings-BGCo_c2y.mjs} +1 -1
  286. package/dist/{settings-DGtLLSaz.mjs → settings-qPzY2KIF.mjs} +4 -4
  287. package/dist/{setup-complete-ChilE-da.mjs → setup-complete-4EiBS1E5.mjs} +1 -1
  288. package/dist/{site-activity-B8FjLIVh.mjs → site-activity-lsCX_cqp.mjs} +1 -1
  289. package/dist/{site-context-WBxoD99D.mjs → site-context-DHRIU6x9.mjs} +58 -34
  290. package/dist/{site-url-BP7k7OCe.mjs → site-url-oyqzZtoL.mjs} +1 -1
  291. package/dist/storage/local.d.mts +1 -1
  292. package/dist/storage/local.mjs +1 -1
  293. package/dist/storage/s3.d.mts +1 -1
  294. package/dist/storage/s3.mjs +1 -1
  295. package/dist/taxonomies-BWmxbumf.mjs +350 -0
  296. package/dist/taxonomies-aQXvYVPm.mjs +507 -0
  297. package/dist/taxonomy-DI-0HgKe.mjs +217 -0
  298. package/dist/{tokens-BOJw-D9F.mjs → tokens-DB4dASZl.mjs} +1 -1
  299. package/dist/{types-DZPw8Rru.d.mts → types-CYBaBvtm.d.mts} +9 -0
  300. package/dist/{types-C0mmVRJN.d.mts → types-CsnHvu4J.d.mts} +1 -0
  301. package/dist/{types-Bs6lTBBW.mjs → types-D1DjBFA9.mjs} +8 -2
  302. package/dist/{types-Q616b2Hn.d.mts → types-DS5PYew4.d.mts} +1 -1
  303. package/dist/ui/server-runtime.d.mts +7 -7
  304. package/dist/ui/server-runtime.mjs +19 -19
  305. package/dist/{user-CcXq-zoL.mjs → user-2aI21yV1.mjs} +1 -1
  306. package/dist/{utils-C0ONdBul.mjs → utils-BJF19gfk.mjs} +1 -1
  307. package/dist/{validate-C7TzfamJ.mjs → validate-B8ZvLeOE.mjs} +12 -8
  308. package/dist/{validate-BwmQEbu8.d.mts → validate-BQ24E8rK.d.mts} +21 -4
  309. package/dist/version-HdNieFOD.mjs +6 -0
  310. package/dist/{widgets-B7DRpZvy.mjs → widgets-Cce2-2fM.mjs} +2 -2
  311. package/dist/{wordpress-slugs-CnporCYH.mjs → wordpress-slugs-C4EhE6fo.mjs} +1 -1
  312. package/dist/{zod-generator-DBVP8D0P.mjs → zod-generator-BKhtHT3e.mjs} +3 -3
  313. package/package.json +5 -5
  314. package/dist/menus-DS3_5nWY.mjs +0 -312
  315. package/dist/taxonomies-D2aZGuns.mjs +0 -270
  316. package/dist/taxonomies-z6Lz91BC.mjs +0 -355
  317. package/dist/taxonomy-D5cbhc8u.mjs +0 -165
  318. package/dist/version-DzWaHle7.mjs +0 -6
  319. /package/dist/{adapters-DuLQZhRY.d.mts → adapters-BPzUiHHm.d.mts} +0 -0
  320. /package/dist/{api-tokens-CPjC3zf8.mjs → api-tokens-B7fvbHM2.mjs} +0 -0
  321. /package/dist/{base64-Cz-aU0X1.mjs → base64-C1Q9yr0B.mjs} +0 -0
  322. /package/dist/{challenge-store-DDTbisbf.mjs → challenge-store-anhwVER0.mjs} +0 -0
  323. /package/dist/{components-BPknylYg.mjs → components-BQiBW_Ji.mjs} +0 -0
  324. /package/dist/{config-CAMFxGaV.mjs → config-XW5tMrH8.mjs} +0 -0
  325. /package/dist/{context-types-C-LwdAxx.mjs → context-types-DuiyY6xF.mjs} +0 -0
  326. /package/dist/{cron-CKxvBrRT.mjs → cron-fV9baRVc.mjs} +0 -0
  327. /package/dist/{db-errors-DyZkswzF.mjs → db-errors-BnUbfGsK.mjs} +0 -0
  328. /package/dist/{default-D4ngTpW8.mjs → default-2JDm1rj_.mjs} +0 -0
  329. /package/dist/{email-console-CuefUXfX.mjs → email-console-_pTim1bU.mjs} +0 -0
  330. /package/dist/{entity-aliases-C0v-yNET.mjs → entity-aliases-PJV8IxDq.mjs} +0 -0
  331. /package/dist/{error-BMUPwxgx.mjs → error-Dyf9fGZE.mjs} +0 -0
  332. /package/dist/{escape-BRVaw1Ai.mjs → escape-Bn168-uP.mjs} +0 -0
  333. /package/dist/{experimental-workflows-C9X7yblQ.mjs → experimental-workflows-CSRjuEwS.mjs} +0 -0
  334. /package/dist/{hash-CDX7M0ze.mjs → hash-V8oZo1W2.mjs} +0 -0
  335. /package/dist/{load-B2XtDw__.mjs → load-BvyvS_76.mjs} +0 -0
  336. /package/dist/{manifest-schema-CgFJAp0H.mjs → manifest-schema-CU0XL_ZK.mjs} +0 -0
  337. /package/dist/{mode-DUhxwUhv.mjs → mode-DWw2di1I.mjs} +0 -0
  338. /package/dist/{normalize-C49G_o1k.mjs → normalize-9GU-bv_T.mjs} +0 -0
  339. /package/dist/{oauth-state-store-C5UFhzwD.mjs → oauth-state-store-DhifLitQ.mjs} +0 -0
  340. /package/dist/{oauth-user-lookup-Bi0ek9eM.mjs → oauth-user-lookup-nyXQ2_6Q.mjs} +0 -0
  341. /package/dist/{options-z8VVg1Ll.mjs → options-BF11H_FD.mjs} +0 -0
  342. /package/dist/{passkey-config-BRSZx4pW.mjs → passkey-config-DZOjt0Hd.mjs} +0 -0
  343. /package/dist/{patterns-K0DLqWir.mjs → patterns-CW4n2PQs.mjs} +0 -0
  344. /package/dist/{placeholder-C2P5fKa4.mjs → placeholder-BJPmhjHP.mjs} +0 -0
  345. /package/dist/{provider-loader-C21b9OpH.mjs → provider-loader-Decn0Ktc.mjs} +0 -0
  346. /package/dist/{public-url-Cun8N3NU.mjs → public-url-5fFLJhjh.mjs} +0 -0
  347. /package/dist/{redirect-COZy-3iY.mjs → redirect-C077gVTf.mjs} +0 -0
  348. /package/dist/{seo-C007Luwn.mjs → seo-DJoop90w.mjs} +0 -0
  349. /package/dist/{seo-contributions-B1fWCnqY.mjs → seo-contributions-CQzUjJKY.mjs} +0 -0
  350. /package/dist/{setup-nonce-BpmLXAuu.mjs → setup-nonce-DN6BHIlP.mjs} +0 -0
  351. /package/dist/{sidecar-client-B1C6Cf80.mjs → sidecar-client-Dta0AELf.mjs} +0 -0
  352. /package/dist/{slugify-PDTDtMXp.mjs → slugify-BzGxlOFx.mjs} +0 -0
  353. /package/dist/{ssrf-DDwRxF6B.mjs → ssrf-BOSGjXxb.mjs} +0 -0
  354. /package/dist/{transaction-x2tJQ-A1.mjs → transaction-qfqpPVpu.mjs} +0 -0
  355. /package/dist/{transport-D3i4yWRE.mjs → transport-B3jxvfio.mjs} +0 -0
  356. /package/dist/{transport-BXe1AM79.d.mts → transport-CyOHECBA.d.mts} +0 -0
  357. /package/dist/{trusted-proxy-BbaZfkT9.mjs → trusted-proxy-8N8sX1D1.mjs} +0 -0
  358. /package/dist/{types-DJlpx5Ay.d.mts → types-6N-00csp.d.mts} +0 -0
  359. /package/dist/{types-BFmjniC2.d.mts → types-B45uSz1j.d.mts} +0 -0
  360. /package/dist/{types-B7kpsMJ3.d.mts → types-BDm7Ipoq.d.mts} +0 -0
  361. /package/dist/{types-0Vr68fc2.d.mts → types-BeYn-Yf0.d.mts} +0 -0
  362. /package/dist/{types-OPs5Q_sX.d.mts → types-D_wGrwiY.d.mts} +0 -0
  363. /package/dist/{types-DL7Y8D_t.mjs → types-Dz2EKzsX.mjs} +0 -0
  364. /package/dist/{types-fAInWQDO.mjs → types-iNqHe2-V.mjs} +0 -0
  365. /package/dist/{url-DNjT2abR.mjs → url-DOS4RGym.mjs} +0 -0
@@ -0,0 +1,569 @@
1
+ import { t as __exportAll } from "./chunk-ClPoSABd.mjs";
2
+ import { n as getI18nConfig } from "./config-XW5tMrH8.mjs";
3
+ import { t as withTransaction } from "./transaction-qfqpPVpu.mjs";
4
+ import { ulid } from "ulidx";
5
+
6
+ //#region src/api/handlers/menus.ts
7
+ var menus_exports = /* @__PURE__ */ __exportAll({
8
+ handleMenuCreate: () => handleMenuCreate,
9
+ handleMenuDelete: () => handleMenuDelete,
10
+ handleMenuGet: () => handleMenuGet,
11
+ handleMenuItemCreate: () => handleMenuItemCreate,
12
+ handleMenuItemDelete: () => handleMenuItemDelete,
13
+ handleMenuItemReorder: () => handleMenuItemReorder,
14
+ handleMenuItemUpdate: () => handleMenuItemUpdate,
15
+ handleMenuList: () => handleMenuList,
16
+ handleMenuSetItems: () => handleMenuSetItems,
17
+ handleMenuTranslations: () => handleMenuTranslations,
18
+ handleMenuUpdate: () => handleMenuUpdate
19
+ });
20
+ /**
21
+ * Error returned when a menu lookup by `name` matches multiple locale
22
+ * variants and the caller did not pass `locale` to disambiguate. Maps to
23
+ * HTTP 400 via `mapErrorStatus`. The available locales are surfaced in the
24
+ * message so MCP/REST callers can recover by re-issuing with `locale`.
25
+ */
26
+ function ambiguousMenuLocaleError(name, locales) {
27
+ return {
28
+ success: false,
29
+ error: {
30
+ code: "AMBIGUOUS_LOCALE",
31
+ message: `Menu '${name}' exists in multiple locales (${locales.toSorted().join(", ")}); pass 'locale' to disambiguate.`
32
+ }
33
+ };
34
+ }
35
+ /**
36
+ * List menus with item counts. Filter by `locale` when provided; otherwise
37
+ * return every menu row (each locale counts as its own menu for admin listing
38
+ * purposes).
39
+ */
40
+ async function handleMenuList(db, options = {}) {
41
+ try {
42
+ let query = db.selectFrom("_dineway_menus as m").leftJoin("_dineway_menu_items as i", "i.menu_id", "m.id").select(({ fn }) => [
43
+ "m.id",
44
+ "m.name",
45
+ "m.label",
46
+ "m.created_at",
47
+ "m.updated_at",
48
+ "m.locale",
49
+ "m.translation_group",
50
+ fn.count("i.id").as("itemCount")
51
+ ]).groupBy([
52
+ "m.id",
53
+ "m.name",
54
+ "m.label",
55
+ "m.created_at",
56
+ "m.updated_at",
57
+ "m.locale",
58
+ "m.translation_group"
59
+ ]).orderBy("m.name", "asc");
60
+ if (options.locale !== void 0) query = query.where("m.locale", "=", options.locale);
61
+ return {
62
+ success: true,
63
+ data: (await query.execute()).map((row) => ({
64
+ id: row.id,
65
+ name: row.name,
66
+ label: row.label,
67
+ created_at: row.created_at,
68
+ updated_at: row.updated_at,
69
+ locale: row.locale,
70
+ translation_group: row.translation_group,
71
+ itemCount: typeof row.itemCount === "string" ? Number(row.itemCount) : row.itemCount
72
+ }))
73
+ };
74
+ } catch {
75
+ return {
76
+ success: false,
77
+ error: {
78
+ code: "MENU_LIST_ERROR",
79
+ message: "Failed to fetch menus"
80
+ }
81
+ };
82
+ }
83
+ }
84
+ /**
85
+ * Create a new menu. When `translationOf` is supplied the new menu joins the
86
+ * source menu's translation_group (and gets the source's items cloned).
87
+ */
88
+ async function handleMenuCreate(db, input) {
89
+ try {
90
+ if (input.translationOf && !input.locale) return {
91
+ success: false,
92
+ error: {
93
+ code: "VALIDATION_ERROR",
94
+ message: "`locale` is required when `translationOf` is provided"
95
+ }
96
+ };
97
+ let translationGroup = null;
98
+ let sourceMenu = null;
99
+ if (input.translationOf) {
100
+ const src = await db.selectFrom("_dineway_menus").selectAll().where("id", "=", input.translationOf).executeTakeFirst();
101
+ if (!src) return {
102
+ success: false,
103
+ error: {
104
+ code: "NOT_FOUND",
105
+ message: "Source menu for translation not found"
106
+ }
107
+ };
108
+ sourceMenu = src;
109
+ translationGroup = src.translation_group ?? src.id;
110
+ }
111
+ const effectiveLocale = input.locale ?? getI18nConfig()?.defaultLocale ?? "en";
112
+ if (await db.selectFrom("_dineway_menus").select("id").where("name", "=", input.name).where("locale", "=", effectiveLocale).executeTakeFirst()) return {
113
+ success: false,
114
+ error: {
115
+ code: "CONFLICT",
116
+ message: `Menu "${input.name}" already exists${input.locale ? ` in locale "${input.locale}"` : ""}`
117
+ }
118
+ };
119
+ const id = ulid();
120
+ await withTransaction(db, async (trx) => {
121
+ await trx.insertInto("_dineway_menus").values({
122
+ id,
123
+ name: input.name,
124
+ label: input.label,
125
+ ...input.locale !== void 0 ? { locale: input.locale } : {},
126
+ translation_group: translationGroup ?? id
127
+ }).execute();
128
+ if (sourceMenu) {
129
+ const sourceItems = await trx.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", sourceMenu.id).orderBy("sort_order", "asc").execute();
130
+ if (sourceItems.length > 0) {
131
+ const idMap = /* @__PURE__ */ new Map();
132
+ for (const item of sourceItems) idMap.set(item.id, ulid());
133
+ await trx.insertInto("_dineway_menu_items").values(sourceItems.map((item) => {
134
+ return {
135
+ id: idMap.get(item.id),
136
+ menu_id: id,
137
+ parent_id: item.parent_id ? idMap.get(item.parent_id) ?? null : null,
138
+ sort_order: item.sort_order,
139
+ type: item.type,
140
+ reference_collection: item.reference_collection,
141
+ reference_id: item.reference_id,
142
+ custom_url: item.custom_url,
143
+ label: item.label,
144
+ title_attr: item.title_attr,
145
+ target: item.target,
146
+ css_classes: item.css_classes,
147
+ ...input.locale !== void 0 ? { locale: input.locale } : {},
148
+ translation_group: item.translation_group ?? item.id
149
+ };
150
+ })).execute();
151
+ }
152
+ }
153
+ });
154
+ return {
155
+ success: true,
156
+ data: await db.selectFrom("_dineway_menus").selectAll().where("id", "=", id).executeTakeFirstOrThrow()
157
+ };
158
+ } catch {
159
+ return {
160
+ success: false,
161
+ error: {
162
+ code: "MENU_CREATE_ERROR",
163
+ message: "Failed to create menu"
164
+ }
165
+ };
166
+ }
167
+ }
168
+ /**
169
+ * Get a single menu by name. Honours an optional `locale` filter; when two
170
+ * menus share a name across locales, the locale distinguishes them.
171
+ */
172
+ async function handleMenuGet(db, name, options = {}) {
173
+ try {
174
+ let query = db.selectFrom("_dineway_menus").selectAll().where("name", "=", name);
175
+ if (options.locale !== void 0) query = query.where("locale", "=", options.locale);
176
+ const menu = await query.orderBy("locale", "asc").executeTakeFirst();
177
+ if (!menu) return {
178
+ success: false,
179
+ error: {
180
+ code: "NOT_FOUND",
181
+ message: `Menu '${name}' not found`
182
+ }
183
+ };
184
+ const items = await db.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute();
185
+ return {
186
+ success: true,
187
+ data: {
188
+ ...menu,
189
+ items
190
+ }
191
+ };
192
+ } catch {
193
+ return {
194
+ success: false,
195
+ error: {
196
+ code: "MENU_GET_ERROR",
197
+ message: "Failed to fetch menu"
198
+ }
199
+ };
200
+ }
201
+ }
202
+ /**
203
+ * Update a menu's label. The name + locale are immutable.
204
+ */
205
+ async function handleMenuUpdate(db, name, input) {
206
+ try {
207
+ let query = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", name);
208
+ if (input.locale !== void 0) query = query.where("locale", "=", input.locale);
209
+ const matches = await query.execute();
210
+ if (matches.length === 0) return {
211
+ success: false,
212
+ error: {
213
+ code: "NOT_FOUND",
214
+ message: `Menu '${name}' not found${input.locale ? ` in locale '${input.locale}'` : ""}`
215
+ }
216
+ };
217
+ if (matches.length > 1) return ambiguousMenuLocaleError(name, matches.map((m) => m.locale));
218
+ const menu = matches[0];
219
+ if (input.label) await db.updateTable("_dineway_menus").set({ label: input.label }).where("id", "=", menu.id).execute();
220
+ return {
221
+ success: true,
222
+ data: await db.selectFrom("_dineway_menus").selectAll().where("id", "=", menu.id).executeTakeFirstOrThrow()
223
+ };
224
+ } catch {
225
+ return {
226
+ success: false,
227
+ error: {
228
+ code: "MENU_UPDATE_ERROR",
229
+ message: "Failed to update menu"
230
+ }
231
+ };
232
+ }
233
+ }
234
+ /**
235
+ * Delete a menu (and items, via cascade).
236
+ */
237
+ async function handleMenuDelete(db, name, options = {}) {
238
+ try {
239
+ let query = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", name);
240
+ if (options.locale !== void 0) query = query.where("locale", "=", options.locale);
241
+ const matches = await query.execute();
242
+ if (matches.length === 0) return {
243
+ success: false,
244
+ error: {
245
+ code: "NOT_FOUND",
246
+ message: `Menu '${name}' not found${options.locale ? ` in locale '${options.locale}'` : ""}`
247
+ }
248
+ };
249
+ if (matches.length > 1) return ambiguousMenuLocaleError(name, matches.map((m) => m.locale));
250
+ const menu = matches[0];
251
+ await db.deleteFrom("_dineway_menu_items").where("menu_id", "=", menu.id).execute();
252
+ await db.deleteFrom("_dineway_menus").where("id", "=", menu.id).execute();
253
+ return {
254
+ success: true,
255
+ data: { deleted: true }
256
+ };
257
+ } catch {
258
+ return {
259
+ success: false,
260
+ error: {
261
+ code: "MENU_DELETE_ERROR",
262
+ message: "Failed to delete menu"
263
+ }
264
+ };
265
+ }
266
+ }
267
+ /**
268
+ * List every translation of a menu (by id or translation_group).
269
+ */
270
+ async function handleMenuTranslations(db, idOrGroup) {
271
+ try {
272
+ const anchor = await db.selectFrom("_dineway_menus").selectAll().where((eb) => eb.or([eb("id", "=", idOrGroup), eb("translation_group", "=", idOrGroup)])).executeTakeFirst();
273
+ if (!anchor) return {
274
+ success: false,
275
+ error: {
276
+ code: "NOT_FOUND",
277
+ message: "Menu not found"
278
+ }
279
+ };
280
+ const group = anchor.translation_group ?? anchor.id;
281
+ return {
282
+ success: true,
283
+ data: {
284
+ translationGroup: group,
285
+ translations: (await db.selectFrom("_dineway_menus").selectAll().where("translation_group", "=", group).orderBy("locale", "asc").execute()).map((row) => ({
286
+ id: row.id,
287
+ name: row.name,
288
+ locale: row.locale,
289
+ label: row.label,
290
+ updatedAt: row.updated_at
291
+ }))
292
+ }
293
+ };
294
+ } catch {
295
+ return {
296
+ success: false,
297
+ error: {
298
+ code: "MENU_TRANSLATIONS_ERROR",
299
+ message: "Failed to list menu translations"
300
+ }
301
+ };
302
+ }
303
+ }
304
+ /**
305
+ * Add an item to a menu. The item inherits the menu's locale (so listing
306
+ * items by locale stays trivial).
307
+ */
308
+ async function handleMenuItemCreate(db, menuName, input, options = {}) {
309
+ try {
310
+ let menuQuery = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", menuName);
311
+ if (options.locale !== void 0) menuQuery = menuQuery.where("locale", "=", options.locale);
312
+ const matches = await menuQuery.execute();
313
+ if (matches.length === 0) return {
314
+ success: false,
315
+ error: {
316
+ code: "NOT_FOUND",
317
+ message: "Menu not found"
318
+ }
319
+ };
320
+ if (matches.length > 1) return ambiguousMenuLocaleError(menuName, matches.map((m) => m.locale));
321
+ const menu = matches[0];
322
+ let sortOrder = input.sortOrder ?? 0;
323
+ if (input.sortOrder === void 0) sortOrder = ((await db.selectFrom("_dineway_menu_items").select(({ fn }) => fn.max("sort_order").as("max")).where("menu_id", "=", menu.id).where("parent_id", "is", input.parentId ?? null).executeTakeFirst())?.max ?? -1) + 1;
324
+ const id = ulid();
325
+ await db.insertInto("_dineway_menu_items").values({
326
+ id,
327
+ menu_id: menu.id,
328
+ parent_id: input.parentId ?? null,
329
+ sort_order: sortOrder,
330
+ type: input.type,
331
+ reference_collection: input.referenceCollection ?? null,
332
+ reference_id: input.referenceId ?? null,
333
+ custom_url: input.customUrl ?? null,
334
+ label: input.label,
335
+ title_attr: input.titleAttr ?? null,
336
+ target: input.target ?? null,
337
+ css_classes: input.cssClasses ?? null,
338
+ locale: menu.locale,
339
+ translation_group: id
340
+ }).execute();
341
+ return {
342
+ success: true,
343
+ data: await db.selectFrom("_dineway_menu_items").selectAll().where("id", "=", id).executeTakeFirstOrThrow()
344
+ };
345
+ } catch {
346
+ return {
347
+ success: false,
348
+ error: {
349
+ code: "MENU_ITEM_CREATE_ERROR",
350
+ message: "Failed to create menu item"
351
+ }
352
+ };
353
+ }
354
+ }
355
+ /**
356
+ * Update a menu item.
357
+ */
358
+ async function handleMenuItemUpdate(db, menuName, itemId, input, options = {}) {
359
+ try {
360
+ let menuQuery = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", menuName);
361
+ if (options.locale !== void 0) menuQuery = menuQuery.where("locale", "=", options.locale);
362
+ const matches = await menuQuery.execute();
363
+ if (matches.length === 0) return {
364
+ success: false,
365
+ error: {
366
+ code: "NOT_FOUND",
367
+ message: "Menu not found"
368
+ }
369
+ };
370
+ if (matches.length > 1) return ambiguousMenuLocaleError(menuName, matches.map((m) => m.locale));
371
+ const menu = matches[0];
372
+ if (!await db.selectFrom("_dineway_menu_items").select("id").where("id", "=", itemId).where("menu_id", "=", menu.id).executeTakeFirst()) return {
373
+ success: false,
374
+ error: {
375
+ code: "NOT_FOUND",
376
+ message: "Menu item not found"
377
+ }
378
+ };
379
+ const updates = {};
380
+ if (input.label !== void 0) updates.label = input.label;
381
+ if (input.customUrl !== void 0) updates.custom_url = input.customUrl;
382
+ if (input.target !== void 0) updates.target = input.target;
383
+ if (input.titleAttr !== void 0) updates.title_attr = input.titleAttr;
384
+ if (input.cssClasses !== void 0) updates.css_classes = input.cssClasses;
385
+ if (input.parentId !== void 0) updates.parent_id = input.parentId;
386
+ if (input.sortOrder !== void 0) updates.sort_order = input.sortOrder;
387
+ if (Object.keys(updates).length > 0) await db.updateTable("_dineway_menu_items").set(updates).where("id", "=", itemId).execute();
388
+ return {
389
+ success: true,
390
+ data: await db.selectFrom("_dineway_menu_items").selectAll().where("id", "=", itemId).executeTakeFirstOrThrow()
391
+ };
392
+ } catch {
393
+ return {
394
+ success: false,
395
+ error: {
396
+ code: "MENU_ITEM_UPDATE_ERROR",
397
+ message: "Failed to update menu item"
398
+ }
399
+ };
400
+ }
401
+ }
402
+ /**
403
+ * Delete a menu item.
404
+ */
405
+ async function handleMenuItemDelete(db, menuName, itemId, options = {}) {
406
+ try {
407
+ let menuQuery = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", menuName);
408
+ if (options.locale !== void 0) menuQuery = menuQuery.where("locale", "=", options.locale);
409
+ const matches = await menuQuery.execute();
410
+ if (matches.length === 0) return {
411
+ success: false,
412
+ error: {
413
+ code: "NOT_FOUND",
414
+ message: "Menu not found"
415
+ }
416
+ };
417
+ if (matches.length > 1) return ambiguousMenuLocaleError(menuName, matches.map((m) => m.locale));
418
+ const menu = matches[0];
419
+ if ((await db.deleteFrom("_dineway_menu_items").where("id", "=", itemId).where("menu_id", "=", menu.id).execute())[0]?.numDeletedRows === 0n) return {
420
+ success: false,
421
+ error: {
422
+ code: "NOT_FOUND",
423
+ message: "Menu item not found"
424
+ }
425
+ };
426
+ return {
427
+ success: true,
428
+ data: { deleted: true }
429
+ };
430
+ } catch {
431
+ return {
432
+ success: false,
433
+ error: {
434
+ code: "MENU_ITEM_DELETE_ERROR",
435
+ message: "Failed to delete menu item"
436
+ }
437
+ };
438
+ }
439
+ }
440
+ /**
441
+ * Replace the entire set of items for a menu in one atomic transaction.
442
+ *
443
+ * Existing items are deleted and the new list is inserted in the order
444
+ * provided. `parentIndex` references resolve to actual parent IDs as the
445
+ * insert proceeds.
446
+ */
447
+ async function handleMenuSetItems(db, menuName, items, options = {}) {
448
+ for (let i = 0; i < items.length; i++) {
449
+ const item = items[i];
450
+ if (item?.parentIndex !== void 0) {
451
+ if (item.parentIndex < 0 || item.parentIndex >= i) return {
452
+ success: false,
453
+ error: {
454
+ code: "VALIDATION_ERROR",
455
+ message: `item[${i}].parentIndex (${item.parentIndex}) must reference an earlier item`
456
+ }
457
+ };
458
+ }
459
+ }
460
+ try {
461
+ const notFoundSentinel = Symbol("menu-not-found");
462
+ let ambiguousLocales = null;
463
+ const ambiguousSentinel = Symbol("menu-ambiguous-locale");
464
+ try {
465
+ await withTransaction(db, async (trx) => {
466
+ let menuQuery = trx.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", menuName);
467
+ if (options.locale !== void 0) menuQuery = menuQuery.where("locale", "=", options.locale);
468
+ const matches = await menuQuery.execute();
469
+ if (matches.length === 0) throw notFoundSentinel;
470
+ if (matches.length > 1) {
471
+ ambiguousLocales = matches.map((m) => m.locale);
472
+ throw ambiguousSentinel;
473
+ }
474
+ const menu = matches[0];
475
+ await trx.deleteFrom("_dineway_menu_items").where("menu_id", "=", menu.id).execute();
476
+ const insertedIds = [];
477
+ for (let i = 0; i < items.length; i++) {
478
+ const item = items[i];
479
+ if (!item) continue;
480
+ const id = ulid();
481
+ const parentId = item.parentIndex !== void 0 ? insertedIds[item.parentIndex] ?? null : null;
482
+ await trx.insertInto("_dineway_menu_items").values({
483
+ id,
484
+ menu_id: menu.id,
485
+ parent_id: parentId,
486
+ sort_order: i,
487
+ type: item.type,
488
+ reference_collection: item.referenceCollection ?? null,
489
+ reference_id: item.referenceId ?? null,
490
+ custom_url: item.customUrl ?? null,
491
+ label: item.label,
492
+ title_attr: item.titleAttr ?? null,
493
+ target: item.target ?? null,
494
+ css_classes: item.cssClasses ?? null,
495
+ locale: menu.locale
496
+ }).execute();
497
+ insertedIds.push(id);
498
+ }
499
+ await trx.updateTable("_dineway_menus").set({ updated_at: (/* @__PURE__ */ new Date()).toISOString() }).where("id", "=", menu.id).execute();
500
+ });
501
+ } catch (error) {
502
+ if (error === notFoundSentinel) return {
503
+ success: false,
504
+ error: {
505
+ code: "NOT_FOUND",
506
+ message: `Menu '${menuName}' not found${options.locale ? ` in locale '${options.locale}'` : ""}`
507
+ }
508
+ };
509
+ if (error === ambiguousSentinel && ambiguousLocales) return ambiguousMenuLocaleError(menuName, ambiguousLocales);
510
+ throw error;
511
+ }
512
+ return {
513
+ success: true,
514
+ data: {
515
+ name: menuName,
516
+ itemCount: items.length
517
+ }
518
+ };
519
+ } catch (error) {
520
+ console.error("[dineway] handleMenuSetItems failed:", error);
521
+ return {
522
+ success: false,
523
+ error: {
524
+ code: "MENU_SET_ITEMS_ERROR",
525
+ message: "Failed to set menu items"
526
+ }
527
+ };
528
+ }
529
+ }
530
+ /**
531
+ * Batch reorder menu items.
532
+ */
533
+ async function handleMenuItemReorder(db, menuName, items, options = {}) {
534
+ try {
535
+ let menuQuery = db.selectFrom("_dineway_menus").select(["id", "locale"]).where("name", "=", menuName);
536
+ if (options.locale !== void 0) menuQuery = menuQuery.where("locale", "=", options.locale);
537
+ const matches = await menuQuery.execute();
538
+ if (matches.length === 0) return {
539
+ success: false,
540
+ error: {
541
+ code: "NOT_FOUND",
542
+ message: "Menu not found"
543
+ }
544
+ };
545
+ if (matches.length > 1) return ambiguousMenuLocaleError(menuName, matches.map((m) => m.locale));
546
+ const menu = matches[0];
547
+ return {
548
+ success: true,
549
+ data: await withTransaction(db, async (trx) => {
550
+ for (const item of items) await trx.updateTable("_dineway_menu_items").set({
551
+ parent_id: item.parentId,
552
+ sort_order: item.sortOrder
553
+ }).where("id", "=", item.id).where("menu_id", "=", menu.id).execute();
554
+ return trx.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute();
555
+ })
556
+ };
557
+ } catch {
558
+ return {
559
+ success: false,
560
+ error: {
561
+ code: "MENU_REORDER_ERROR",
562
+ message: "Failed to reorder menu items"
563
+ }
564
+ };
565
+ }
566
+ }
567
+
568
+ //#endregion
569
+ export { handleMenuItemDelete as a, handleMenuList as c, menus_exports as d, handleMenuItemCreate as i, handleMenuTranslations as l, handleMenuDelete as n, handleMenuItemReorder as o, handleMenuGet as r, handleMenuItemUpdate as s, handleMenuCreate as t, handleMenuUpdate as u };
@@ -0,0 +1,35 @@
1
+ //#region src/media/mime.ts
2
+ function normalizeMime(mime) {
3
+ return mime.split(";")[0].trim().toLowerCase();
4
+ }
5
+ function matchesMimeAllowlist(mime, allowList) {
6
+ const normalized = normalizeMime(mime);
7
+ for (const entry of allowList) {
8
+ if (!entry || !entry.includes("/")) continue;
9
+ const normalizedEntry = normalizeMime(entry);
10
+ if (normalizedEntry.endsWith("/")) {
11
+ if (normalized.startsWith(normalizedEntry)) return true;
12
+ } else if (normalized === normalizedEntry) return true;
13
+ }
14
+ return false;
15
+ }
16
+ /**
17
+ * Extract the `allowedMimeTypes` list from a `_dineway_fields.validation` row
18
+ * (raw JSON string). Returns null when the value is missing, malformed, or the
19
+ * list is empty; callers treat that as no field-specific constraint.
20
+ */
21
+ function parseAllowedMimeTypes(rawValidation) {
22
+ if (!rawValidation) return null;
23
+ try {
24
+ const parsed = JSON.parse(rawValidation);
25
+ if (typeof parsed !== "object" || parsed === null) return null;
26
+ const list = parsed.allowedMimeTypes;
27
+ if (!Array.isArray(list) || list.length === 0) return null;
28
+ return list.filter((entry) => typeof entry === "string");
29
+ } catch {
30
+ return null;
31
+ }
32
+ }
33
+
34
+ //#endregion
35
+ export { normalizeMime as n, parseAllowedMimeTypes as r, matchesMimeAllowlist as t };
@@ -1,8 +1,8 @@
1
- import { t as withTransaction } from "./transaction-x2tJQ-A1.mjs";
2
- import { a as filterExperimentalSiteContextWorkflowScopes, i as experimentalSiteContextWorkflowsEnabled, o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-C9X7yblQ.mjs";
3
- import { a as hashApiToken, n as TOKEN_PREFIXES, r as generatePrefixedToken, t as ALL_VALID_SCOPES } from "./api-tokens-CPjC3zf8.mjs";
4
- import { c as validateRedirectUri, o as lookupOAuthClient, s as validateClientRedirectUri } from "./oauth-clients-DxO_NO7k.mjs";
5
- import { t as lookupUserRoleAndStatus } from "./oauth-user-lookup-Bi0ek9eM.mjs";
1
+ import { t as withTransaction } from "./transaction-qfqpPVpu.mjs";
2
+ import { a as filterExperimentalSiteContextWorkflowScopes, i as experimentalSiteContextWorkflowsEnabled, o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-CSRjuEwS.mjs";
3
+ import { a as hashApiToken, n as TOKEN_PREFIXES, r as generatePrefixedToken, t as ALL_VALID_SCOPES } from "./api-tokens-B7fvbHM2.mjs";
4
+ import { c as validateRedirectUri, o as lookupOAuthClient, s as validateClientRedirectUri } from "./oauth-clients-CgKFA-VH.mjs";
5
+ import { t as lookupUserRoleAndStatus } from "./oauth-user-lookup-nyXQ2_6Q.mjs";
6
6
  import { clampScopes, computeS256Challenge, secureCompare } from "@dineway-ai/auth";
7
7
  import { generateCodeVerifier } from "arctic";
8
8
 
@@ -1,5 +1,5 @@
1
- import { o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-C9X7yblQ.mjs";
2
- import { o as validateScopes } from "./api-tokens-CPjC3zf8.mjs";
1
+ import { o as getExperimentalSiteContextWorkflowScopesDisabledMessage, r as disabledExperimentalSiteContextWorkflowScopes } from "./experimental-workflows-CSRjuEwS.mjs";
2
+ import { o as validateScopes } from "./api-tokens-B7fvbHM2.mjs";
3
3
 
4
4
  //#region src/api/oauth/redirect-uri.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { A as PageMetadataContribution, D as PageFragmentContribution, q as PublicPageContext } from "../types-Q616b2Hn.mjs";
2
- import { a as generateSiteSeoContributions, c as ResolvedPageMetadata, d as resolvePageMetadata, f as safeJsonLdSerialize, i as generateBaseSeoContributions, l as escapeHtmlAttr, m as createPublicPageContext, n as buildWebSiteJsonLd, o as renderFragments, p as CreatePublicPageContextInput, r as cleanJsonLd, s as resolveFragments, t as buildBlogPostingJsonLd, u as renderPageMetadata } from "../jsonld-D2gUY4kA.mjs";
1
+ import { A as PageMetadataContribution, D as PageFragmentContribution, q as PublicPageContext } from "../types-DS5PYew4.mjs";
2
+ import { a as generateSiteSeoContributions, c as ResolvedPageMetadata, d as resolvePageMetadata, f as safeJsonLdSerialize, i as generateBaseSeoContributions, l as escapeHtmlAttr, m as createPublicPageContext, n as buildWebSiteJsonLd, o as renderFragments, p as CreatePublicPageContextInput, r as cleanJsonLd, s as resolveFragments, t as buildBlogPostingJsonLd, u as renderPageMetadata } from "../jsonld-BjsoTL5m.mjs";
3
3
 
4
4
  //#region src/page/index.d.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { a as cleanJsonLd, c as escapeHtmlAttr, d as safeJsonLdSerialize, f as createPublicPageContext, i as buildWebSiteJsonLd, l as renderPageMetadata, n as generateSiteSeoContributions, o as renderFragments, r as buildBlogPostingJsonLd, s as resolveFragments, t as generateBaseSeoContributions, u as resolvePageMetadata } from "../seo-contributions-B1fWCnqY.mjs";
1
+ import { a as cleanJsonLd, c as escapeHtmlAttr, d as safeJsonLdSerialize, f as createPublicPageContext, i as buildWebSiteJsonLd, l as renderPageMetadata, n as generateSiteSeoContributions, o as renderFragments, r as buildBlogPostingJsonLd, s as resolveFragments, t as generateBaseSeoContributions, u as resolvePageMetadata } from "../seo-contributions-CQzUjJKY.mjs";
2
2
 
3
3
  //#region src/page/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as apiError } from "./error-BMUPwxgx.mjs";
1
+ import { t as apiError } from "./error-Dyf9fGZE.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/api/parse.ts
@@ -1,4 +1,4 @@
1
- import { l as MediaProvider, m as MediaValue } from "./types-OPs5Q_sX.mjs";
1
+ import { l as MediaProvider, m as MediaValue } from "./types-D_wGrwiY.mjs";
2
2
 
3
3
  //#region src/media/normalize.d.ts
4
4
  /**
@@ -1,13 +1,13 @@
1
- import { n as PluginDescriptor } from "../runtime-QuuFSlc6.mjs";
2
- import "../types-DZPw8Rru.mjs";
3
- import { X as ResolvedPlugin, tt as StandardPluginDefinition } from "../types-Q616b2Hn.mjs";
4
- import "../types-BFmjniC2.mjs";
5
- import "../runner-BU6Lo1ZS.mjs";
6
- import "../index-EUAWaIxW.mjs";
7
- import "../index-CYfhYgXd.mjs";
8
- import "../bylines-DCvz5gtm.mjs";
9
- import "../types-0Vr68fc2.mjs";
10
- import "../validate-BwmQEbu8.mjs";
1
+ import { n as PluginDescriptor } from "../runtime-DY_XmE9Y.mjs";
2
+ import "../types-CYBaBvtm.mjs";
3
+ import { X as ResolvedPlugin, tt as StandardPluginDefinition } from "../types-DS5PYew4.mjs";
4
+ import "../types-B45uSz1j.mjs";
5
+ import "../runner-CHR_W79l.mjs";
6
+ import "../index-JzJUzE4o.mjs";
7
+ import "../index-DpMWSamU.mjs";
8
+ import "../bylines-DE9bfDur.mjs";
9
+ import "../types-BeYn-Yf0.mjs";
10
+ import "../validate-BQ24E8rK.mjs";
11
11
 
12
12
  //#region src/plugins/adapt-sandbox-entry.d.ts
13
13
  /**