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
@@ -1,28 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import { t as __exportAll } from "../chunk-ClPoSABd.mjs";
3
3
  import { n as createDatabase } from "../connection-BCNICDWN.mjs";
4
- import { s as listTablesLike } from "../dialect-helpers-DhTzaUxP.mjs";
5
- import { r as runMigrations, t as getMigrationStatus } from "../runner-DWZm2KQm.mjs";
6
- import { t as ContentRepository } from "../content-CyLkb-qH.mjs";
7
- import { i as encodeBase64url } from "../base64-Cz-aU0X1.mjs";
8
- import "../types-Bs6lTBBW.mjs";
9
- import { t as MediaRepository } from "../media-_7Fxdu45.mjs";
10
- import { t as TaxonomyRepository } from "../taxonomy-D5cbhc8u.mjs";
11
- import { t as OptionsRepository } from "../options-z8VVg1Ll.mjs";
12
- import "../redirect-CGl64yOX.mjs";
13
- import "../byline-naZxOPSa.mjs";
14
- import { r as isI18nEnabled } from "../config-CAMFxGaV.mjs";
15
- import "../fts-manager-B1pTNEG_.mjs";
16
- import { n as SchemaRegistry } from "../registry-C-_hxLqa.mjs";
17
- import "../loader-PZnPxFLc.mjs";
18
- import "../settings-DGtLLSaz.mjs";
19
- import "../request-cache-DHMRr2Lf.mjs";
20
- import { i as pluginManifestSchema } from "../manifest-schema-CgFJAp0H.mjs";
21
- import "../ssrf-DDwRxF6B.mjs";
22
- import { t as validateSeed } from "../validate-C7TzfamJ.mjs";
23
- import { t as applySeed } from "../apply-Bm5QgdrE.mjs";
24
- import { n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-CkoJ9zN0.mjs";
25
- import { o as convertDataForRead } from "../transport-D3i4yWRE.mjs";
4
+ import { c as listTablesLike } from "../dialect-helpers-TkdbkFad.mjs";
5
+ import { r as runMigrations, t as getMigrationStatus } from "../runner-lqEiJbO-.mjs";
6
+ import { r as isI18nEnabled } from "../config-XW5tMrH8.mjs";
7
+ import { n as slugify } from "../slugify-BzGxlOFx.mjs";
8
+ import { t as ContentRepository } from "../content-DvpMad_N.mjs";
9
+ import { i as encodeBase64url } from "../base64-C1Q9yr0B.mjs";
10
+ import "../types-D1DjBFA9.mjs";
11
+ import { t as MediaRepository } from "../media-Cg4zc9fq.mjs";
12
+ import { t as TaxonomyRepository } from "../taxonomy-DI-0HgKe.mjs";
13
+ import { t as OptionsRepository } from "../options-BF11H_FD.mjs";
14
+ import "../redirect-BHo9--Jz.mjs";
15
+ import "../byline-BxAf79s1.mjs";
16
+ import "../request-cache-DmVyQUBh.mjs";
17
+ import "../fts-manager-D7KVeBmg.mjs";
18
+ import { n as SchemaRegistry } from "../registry-DumDzFDn.mjs";
19
+ import "../loader-CQFxFOt1.mjs";
20
+ import "../settings-qPzY2KIF.mjs";
21
+ import { i as pluginManifestSchema } from "../manifest-schema-CU0XL_ZK.mjs";
22
+ import "../ssrf-BOSGjXxb.mjs";
23
+ import { t as validateSeed } from "../validate-B8ZvLeOE.mjs";
24
+ import { t as applySeed } from "../apply-CGVHi2r7.mjs";
25
+ import { n as fingerprintKey, r as generateEncryptionKey, t as DinewaySecretsError } from "../secrets-AFKoqUXj.mjs";
26
+ import { o as convertDataForRead } from "../transport-B3jxvfio.mjs";
26
27
  import { createHeaderAwareFetch, customHeadersInterceptor, isRedirectResponse, resolveCustomHeaders } from "../client/external-auth-headers.mjs";
27
28
  import { DinewayClient } from "../client/index.mjs";
28
29
  import { LocalStorage } from "../storage/local.mjs";
@@ -2235,49 +2236,96 @@ async function exportCollections(db) {
2235
2236
  * Export taxonomy definitions and terms
2236
2237
  */
2237
2238
  async function exportTaxonomies(db) {
2238
- const defs = await db.selectFrom("_dineway_taxonomy_defs").selectAll().execute();
2239
+ const i18nEnabled = isI18nEnabled();
2240
+ const defs = await db.selectFrom("_dineway_taxonomy_defs").selectAll().orderBy(["name", "locale"]).execute();
2239
2241
  const result = [];
2240
2242
  const termRepo = new TaxonomyRepository(db);
2243
+ const defGroupToSeedId = /* @__PURE__ */ new Map();
2241
2244
  for (const def of defs) {
2242
- const terms = await termRepo.findByName(def.name);
2243
- const seedTerms = [];
2245
+ const defSeedId = i18nEnabled && def.locale ? `tax:${def.name}:${def.locale}` : `tax:${def.name}`;
2246
+ const terms = await termRepo.findByName(def.name, { locale: def.locale });
2244
2247
  const idToSlug = /* @__PURE__ */ new Map();
2245
2248
  for (const term of terms) idToSlug.set(term.id, term.slug);
2249
+ const termGroupToSeedId = /* @__PURE__ */ new Map();
2250
+ const seedTerms = [];
2246
2251
  for (const term of terms) {
2252
+ const termSeedId = i18nEnabled && term.locale ? `term:${def.name}:${term.slug}:${term.locale}` : `term:${def.name}:${term.slug}`;
2247
2253
  const seedTerm = {
2254
+ id: termSeedId,
2248
2255
  slug: term.slug,
2249
2256
  label: term.label,
2250
2257
  description: typeof term.data?.description === "string" ? term.data.description : void 0
2251
2258
  };
2252
2259
  if (term.parentId) seedTerm.parent = idToSlug.get(term.parentId);
2260
+ if (i18nEnabled && term.locale) {
2261
+ seedTerm.locale = term.locale;
2262
+ if (term.translationGroup) {
2263
+ const anchor = termGroupToSeedId.get(term.translationGroup);
2264
+ if (anchor) seedTerm.translationOf = anchor;
2265
+ else termGroupToSeedId.set(term.translationGroup, termSeedId);
2266
+ }
2267
+ }
2253
2268
  seedTerms.push(seedTerm);
2254
2269
  }
2270
+ seedTerms.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
2255
2271
  const taxonomy = {
2272
+ id: defSeedId,
2256
2273
  name: def.name,
2257
2274
  label: def.label,
2258
2275
  labelSingular: def.label_singular || void 0,
2259
2276
  hierarchical: def.hierarchical === 1,
2260
2277
  collections: def.collections ? JSON.parse(def.collections) : []
2261
2278
  };
2279
+ if (i18nEnabled && def.locale) {
2280
+ taxonomy.locale = def.locale;
2281
+ if (def.translation_group) {
2282
+ const anchor = defGroupToSeedId.get(def.translation_group);
2283
+ if (anchor) taxonomy.translationOf = anchor;
2284
+ else defGroupToSeedId.set(def.translation_group, defSeedId);
2285
+ }
2286
+ }
2262
2287
  if (seedTerms.length > 0) taxonomy.terms = seedTerms;
2263
2288
  result.push(taxonomy);
2264
2289
  }
2290
+ result.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
2265
2291
  return result;
2266
2292
  }
2267
2293
  /**
2268
2294
  * Export menus with their items
2269
2295
  */
2270
2296
  async function exportMenus(db) {
2271
- const menus = await db.selectFrom("_dineway_menus").selectAll().execute();
2297
+ const i18nEnabled = isI18nEnabled();
2298
+ const menus = await db.selectFrom("_dineway_menus").selectAll().orderBy(["name", "locale"]).execute();
2272
2299
  const result = [];
2300
+ const groupToSeedId = /* @__PURE__ */ new Map();
2301
+ const itemGroupToSeedId = /* @__PURE__ */ new Map();
2302
+ const usedItemSeedIds = /* @__PURE__ */ new Set();
2273
2303
  for (const menu of menus) {
2274
- const seedItems = buildMenuItemTree(await db.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute());
2275
- result.push({
2304
+ const seedId = i18nEnabled && menu.locale ? `menu:${menu.name}:${menu.locale}` : `menu:${menu.name}`;
2305
+ const seedItems = buildMenuItemTree(await db.selectFrom("_dineway_menu_items").selectAll().where("menu_id", "=", menu.id).orderBy("sort_order", "asc").execute(), {
2306
+ i18nEnabled,
2307
+ menuName: menu.name,
2308
+ menuLocale: menu.locale ?? null,
2309
+ itemGroupToSeedId,
2310
+ usedItemSeedIds
2311
+ });
2312
+ const seedMenu = {
2313
+ id: seedId,
2276
2314
  name: menu.name,
2277
2315
  label: menu.label,
2278
2316
  items: seedItems
2279
- });
2317
+ };
2318
+ if (i18nEnabled && menu.locale) {
2319
+ seedMenu.locale = menu.locale;
2320
+ if (menu.translation_group) {
2321
+ const anchor = groupToSeedId.get(menu.translation_group);
2322
+ if (anchor) seedMenu.translationOf = anchor;
2323
+ else groupToSeedId.set(menu.translation_group, seedId);
2324
+ }
2325
+ }
2326
+ result.push(seedMenu);
2280
2327
  }
2328
+ result.sort((a, b) => Number(!!a.translationOf) - Number(!!b.translationOf));
2281
2329
  return result;
2282
2330
  }
2283
2331
  /** Type guard for valid widget types */
@@ -2287,13 +2335,25 @@ function isWidgetType(t) {
2287
2335
  /**
2288
2336
  * Build hierarchical menu item tree from flat array
2289
2337
  */
2290
- function buildMenuItemTree(items) {
2338
+ function buildMenuItemTree(items, i18nCtx) {
2291
2339
  const childMap = /* @__PURE__ */ new Map();
2292
2340
  for (const item of items) {
2293
2341
  const parentId = item.parent_id;
2294
2342
  if (!childMap.has(parentId)) childMap.set(parentId, []);
2295
2343
  childMap.get(parentId).push(item);
2296
2344
  }
2345
+ function makeSeedId(item) {
2346
+ const base = slugify(item.label || "") || item.id;
2347
+ const locale = i18nCtx.i18nEnabled ? item.locale ?? i18nCtx.menuLocale : null;
2348
+ const candidate = locale ? `item:${i18nCtx.menuName}:${base}:${locale}` : `item:${i18nCtx.menuName}:${base}`;
2349
+ if (!i18nCtx.usedItemSeedIds.has(candidate)) {
2350
+ i18nCtx.usedItemSeedIds.add(candidate);
2351
+ return candidate;
2352
+ }
2353
+ const fallback = locale ? `item:${i18nCtx.menuName}:${base}:${item.id}:${locale}` : `item:${i18nCtx.menuName}:${base}:${item.id}`;
2354
+ i18nCtx.usedItemSeedIds.add(fallback);
2355
+ return fallback;
2356
+ }
2297
2357
  function buildLevel(parentId) {
2298
2358
  return (childMap.get(parentId) || []).map((item) => {
2299
2359
  const seedItem = {
@@ -2308,6 +2368,17 @@ function buildMenuItemTree(items) {
2308
2368
  if (item.target === "_blank") seedItem.target = "_blank";
2309
2369
  if (item.title_attr) seedItem.titleAttr = item.title_attr;
2310
2370
  if (item.css_classes) seedItem.cssClasses = item.css_classes;
2371
+ if (i18nCtx.i18nEnabled) {
2372
+ const itemLocale = item.locale ?? i18nCtx.menuLocale;
2373
+ const seedId = makeSeedId(item);
2374
+ seedItem.id = seedId;
2375
+ if (itemLocale) seedItem.locale = itemLocale;
2376
+ if (item.translation_group) {
2377
+ const anchor = i18nCtx.itemGroupToSeedId.get(item.translation_group);
2378
+ if (anchor && anchor !== seedId) seedItem.translationOf = anchor;
2379
+ else if (!anchor) i18nCtx.itemGroupToSeedId.set(item.translation_group, seedId);
2380
+ }
2381
+ }
2311
2382
  const itemChildren = buildLevel(item.id);
2312
2383
  if (itemChildren.length > 0) seedItem.children = itemChildren;
2313
2384
  return seedItem;
@@ -3115,7 +3186,9 @@ const menuCommand = defineCommand({
3115
3186
  * Shared logic extracted from the bundle command so it can be tested
3116
3187
  * without the CLI harness and tsdown dependency.
3117
3188
  */
3118
- const MAX_BUNDLE_SIZE = 5 * 1024 * 1024;
3189
+ const MAX_BUNDLE_SIZE = 256 * 1024;
3190
+ const MAX_FILE_SIZE = 128 * 1024;
3191
+ const MAX_FILE_COUNT = 20;
3119
3192
  const MAX_SCREENSHOTS = 5;
3120
3193
  const MAX_SCREENSHOT_WIDTH = 1920;
3121
3194
  const MAX_SCREENSHOT_HEIGHT = 1080;
@@ -3282,21 +3355,52 @@ function findSourceExports(exports) {
3282
3355
  return issues;
3283
3356
  }
3284
3357
  /**
3285
- * Recursively calculate the total size of all files in a directory.
3358
+ * Recursively walk a staging directory and return all regular files with
3359
+ * tarball-relative names.
3286
3360
  */
3287
- async function calculateDirectorySize(dir) {
3288
- let total = 0;
3361
+ async function collectBundleEntries(dir) {
3362
+ const entries = [];
3363
+ await walkBundle(dir, "", entries);
3364
+ return entries;
3365
+ }
3366
+ async function walkBundle(dir, prefix, into) {
3289
3367
  const items = await readdir(dir, { withFileTypes: true });
3290
3368
  for (const item of items) {
3291
3369
  const fullPath = join(dir, item.name);
3370
+ const relPath = prefix ? `${prefix}/${item.name}` : item.name;
3292
3371
  if (item.isFile()) {
3293
3372
  const s = await stat(fullPath);
3294
- total += s.size;
3295
- } else if (item.isDirectory()) total += await calculateDirectorySize(fullPath);
3373
+ into.push({
3374
+ name: relPath,
3375
+ bytes: s.size
3376
+ });
3377
+ } else if (item.isDirectory()) await walkBundle(fullPath, relPath, into);
3296
3378
  }
3379
+ }
3380
+ function totalBundleBytes(entries) {
3381
+ let total = 0;
3382
+ for (const entry of entries) total += entry.bytes;
3297
3383
  return total;
3298
3384
  }
3299
3385
  /**
3386
+ * Enforce sandboxed plugin caps against decompressed bundle files:
3387
+ * total size, per-file size, and file count.
3388
+ */
3389
+ function validateBundleSize(entries) {
3390
+ const violations = [];
3391
+ const total = totalBundleBytes(entries);
3392
+ if (total > MAX_BUNDLE_SIZE) violations.push(`Bundle size ${formatBytes(total)} exceeds maximum of ${formatBytes(MAX_BUNDLE_SIZE)}.`);
3393
+ if (entries.length > MAX_FILE_COUNT) violations.push(`Bundle contains ${entries.length} files, exceeds maximum of ${MAX_FILE_COUNT}.`);
3394
+ const oversized = entries.filter((entry) => entry.bytes > MAX_FILE_SIZE).toSorted((a, b) => a.name.localeCompare(b.name));
3395
+ for (const entry of oversized) violations.push(`File ${entry.name} is ${formatBytes(entry.bytes)}, exceeds per-file maximum of ${formatBytes(MAX_FILE_SIZE)}.`);
3396
+ return violations;
3397
+ }
3398
+ function formatBytes(bytes) {
3399
+ if (bytes < 1024) return `${bytes} B`;
3400
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
3401
+ return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
3402
+ }
3403
+ /**
3300
3404
  * Create a gzipped tarball from a directory.
3301
3405
  */
3302
3406
  async function createTarball(sourceDir, outputPath) {
@@ -3396,6 +3500,7 @@ const bundleCommand = defineCommand({
3396
3500
  const tmpDir = join(pluginDir, ".dineway-bundle-tmp");
3397
3501
  try {
3398
3502
  await mkdir(tmpDir, { recursive: true });
3503
+ await copyFile(pkgPath, join(tmpDir, "package.json"));
3399
3504
  const mainOutDir = join(tmpDir, "main");
3400
3505
  await build({
3401
3506
  config: false,
@@ -3625,15 +3730,12 @@ const bundleCommand = defineCommand({
3625
3730
  hasErrors = true;
3626
3731
  }
3627
3732
  }
3628
- const totalSize = await calculateDirectorySize(bundleDir);
3629
- if (totalSize > MAX_BUNDLE_SIZE) {
3630
- const sizeMB = (totalSize / 1024 / 1024).toFixed(2);
3631
- consola.error(`Bundle size ${sizeMB}MB exceeds maximum of 5MB`);
3733
+ const bundleEntries = await collectBundleEntries(bundleDir);
3734
+ const sizeViolations = validateBundleSize(bundleEntries);
3735
+ if (sizeViolations.length > 0) {
3736
+ for (const violation of sizeViolations) consola.error(violation);
3632
3737
  hasErrors = true;
3633
- } else {
3634
- const sizeKB = (totalSize / 1024).toFixed(1);
3635
- consola.info(`Bundle size: ${sizeKB}KB`);
3636
- }
3738
+ } else consola.info(`Bundle size: ${formatBytes(totalBundleBytes(bundleEntries))} across ${bundleEntries.length} file${bundleEntries.length === 1 ? "" : "s"}`);
3637
3739
  if (hasErrors) {
3638
3740
  consola.error("Bundle validation failed");
3639
3741
  process.exit(1);
@@ -3665,17 +3767,34 @@ const bundleCommand = defineCommand({
3665
3767
  /**
3666
3768
  * dineway plugin init
3667
3769
  *
3668
- * Scaffold a new Dineway plugin. Generates the standard-format boilerplate:
3770
+ * Scaffold a new Dineway plugin. Generates the sandboxed-format boilerplate:
3669
3771
  * src/index.ts -- descriptor factory
3670
3772
  * src/sandbox-entry.ts -- definePlugin({ hooks, routes })
3671
3773
  * package.json
3672
3774
  * tsconfig.json
3673
3775
  *
3674
- * Use --native to generate native-format boilerplate instead (createPlugin + React admin).
3675
- *
3776
+ * Use --format=native (or --native) to generate native-format boilerplate
3777
+ * instead (createPlugin + React admin). When neither is passed and stdout
3778
+ * is a TTY, the user is prompted to choose.
3676
3779
  */
3677
3780
  const SLUG_RE = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
3678
3781
  const SCOPE_RE = /^@[^/]+\//;
3782
+ const TSDOWN_VERSION = "^0.20.0";
3783
+ const TYPESCRIPT_VERSION = "^5.9.0";
3784
+ const TSCONFIG = {
3785
+ compilerOptions: {
3786
+ target: "ES2022",
3787
+ module: "preserve",
3788
+ moduleResolution: "bundler",
3789
+ strict: true,
3790
+ esModuleInterop: true,
3791
+ declaration: true,
3792
+ outDir: "./dist",
3793
+ rootDir: "./src"
3794
+ },
3795
+ include: ["src/**/*"],
3796
+ exclude: ["node_modules", "dist"]
3797
+ };
3679
3798
  const pluginInitCommand = defineCommand({
3680
3799
  meta: {
3681
3800
  name: "init",
@@ -3691,15 +3810,25 @@ const pluginInitCommand = defineCommand({
3691
3810
  type: "string",
3692
3811
  description: "Plugin name/id (e.g. my-plugin or @org/my-plugin)"
3693
3812
  },
3813
+ format: {
3814
+ type: "string",
3815
+ description: "Plugin format: sandboxed or native. Prompts when running interactively if not set.",
3816
+ valueHint: "sandboxed|native"
3817
+ },
3694
3818
  native: {
3695
3819
  type: "boolean",
3696
- description: "Generate native-format plugin (createPlugin + React admin)",
3820
+ description: "Shortcut for --format=native",
3697
3821
  default: false
3698
3822
  }
3699
3823
  },
3700
3824
  async run({ args }) {
3701
3825
  const targetDir = resolve(args.dir);
3702
- const isNative = args.native;
3826
+ const format = await resolveFormat(args.format, args.native);
3827
+ if (!format) {
3828
+ consola.info("Cancelled");
3829
+ return;
3830
+ }
3831
+ const isNative = format === "native";
3703
3832
  let pluginName = args.name || basename(targetDir);
3704
3833
  if (!pluginName || pluginName === ".") pluginName = basename(resolve("."));
3705
3834
  const slug = pluginName.replace(SCOPE_RE, "");
@@ -3712,69 +3841,146 @@ const pluginInitCommand = defineCommand({
3712
3841
  consola.error(`package.json already exists in ${targetDir}`);
3713
3842
  process.exit(1);
3714
3843
  }
3715
- consola.start(`Scaffolding ${isNative ? "native" : "standard"} plugin: ${pluginName}`);
3844
+ consola.start(`Scaffolding ${isNative ? "native" : "sandboxed"} plugin: ${pluginName}`);
3716
3845
  await mkdir(srcDir, { recursive: true });
3717
3846
  if (isNative) await scaffoldNative(targetDir, srcDir, pluginName, slug);
3718
3847
  else await scaffoldStandard(targetDir, srcDir, pluginName, slug);
3719
3848
  consola.success(`Plugin scaffolded in ${targetDir}`);
3720
3849
  consola.info("Next steps:");
3721
- if (args.dir !== ".") consola.info(` 1. cd ${args.dir}`);
3722
- consola.info(` ${args.dir !== "." ? "2" : "1"}. pnpm install`);
3723
- if (isNative) consola.info(` ${args.dir !== "." ? "3" : "2"}. Edit src/index.ts to add hooks and routes`);
3724
- else consola.info(` ${args.dir !== "." ? "3" : "2"}. Edit src/sandbox-entry.ts to add hooks and routes`);
3725
- consola.info(` ${args.dir !== "." ? "4" : "3"}. dineway plugin validate --dir .`);
3850
+ const steps = [];
3851
+ if (args.dir !== ".") steps.push(`cd ${args.dir}`);
3852
+ steps.push("pnpm install");
3853
+ steps.push(isNative ? "Edit src/index.ts to add hooks and routes" : "Edit src/sandbox-entry.ts to add hooks and routes");
3854
+ steps.push("pnpm build");
3855
+ if (!isNative) steps.push("dineway plugin validate --dir .");
3856
+ steps.forEach((step, index) => consola.info(` ${index + 1}. ${step}`));
3726
3857
  }
3727
3858
  });
3859
+ async function resolveFormat(formatArg, nativeFlag) {
3860
+ if (formatArg) {
3861
+ const normalized = formatArg.toLowerCase();
3862
+ let parsed;
3863
+ if (normalized === "native") parsed = "native";
3864
+ else if (normalized === "sandboxed" || normalized === "standard") parsed = "standard";
3865
+ else {
3866
+ consola.error(`Invalid --format "${formatArg}". Use "sandboxed" or "native".`);
3867
+ process.exit(1);
3868
+ }
3869
+ if (nativeFlag && parsed !== "native") {
3870
+ consola.error(`Conflicting flags: --native and --format=${formatArg}. Pass only one.`);
3871
+ process.exit(1);
3872
+ }
3873
+ return parsed;
3874
+ }
3875
+ if (nativeFlag) return "native";
3876
+ if (!process.stdout.isTTY) return "standard";
3877
+ const choice = await consola.prompt("Which plugin format?", {
3878
+ type: "select",
3879
+ initial: "standard",
3880
+ options: [{
3881
+ label: "Sandboxed",
3882
+ value: "standard",
3883
+ hint: "runs in an isolated sandbox; safe to install from the marketplace"
3884
+ }, {
3885
+ label: "Native",
3886
+ value: "native",
3887
+ hint: "full runtime access; install from npm"
3888
+ }],
3889
+ cancel: "null"
3890
+ });
3891
+ if (choice === null) return null;
3892
+ return choice;
3893
+ }
3894
+ function camelCase(slug) {
3895
+ return slug.split("-").map((part, index) => index === 0 ? part : part.charAt(0).toUpperCase() + part.slice(1)).join("");
3896
+ }
3897
+ function pascalCase(slug) {
3898
+ return slug.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
3899
+ }
3728
3900
  async function scaffoldStandard(targetDir, srcDir, pluginName, slug) {
3729
- const fnName = slug.split("-").map((s, i) => i === 0 ? s : s[0].toUpperCase() + s.slice(1)).join("");
3901
+ const fnName = camelCase(slug);
3730
3902
  await writeFile(join(targetDir, "package.json"), JSON.stringify({
3731
3903
  name: pluginName,
3732
3904
  version: "0.1.0",
3733
3905
  type: "module",
3906
+ main: "./dist/index.mjs",
3734
3907
  exports: {
3735
- ".": "./src/index.ts",
3736
- "./sandbox": "./src/sandbox-entry.ts"
3908
+ ".": {
3909
+ types: "./dist/index.d.mts",
3910
+ import: "./dist/index.mjs"
3911
+ },
3912
+ "./sandbox": {
3913
+ types: "./dist/sandbox-entry.d.mts",
3914
+ import: "./dist/sandbox-entry.mjs"
3915
+ }
3737
3916
  },
3738
- files: ["src"],
3739
- peerDependencies: { dineway: "*" }
3740
- }, null, " ") + "\n");
3741
- await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify({
3742
- compilerOptions: {
3743
- target: "ES2022",
3744
- module: "preserve",
3745
- moduleResolution: "bundler",
3746
- strict: true,
3747
- esModuleInterop: true,
3748
- declaration: true,
3749
- outDir: "./dist",
3750
- rootDir: "./src"
3917
+ files: ["dist"],
3918
+ scripts: {
3919
+ build: "tsdown src/index.ts src/sandbox-entry.ts --format esm --dts --clean",
3920
+ dev: "tsdown src/index.ts src/sandbox-entry.ts --format esm --dts --watch",
3921
+ typecheck: "tsc --noEmit"
3751
3922
  },
3752
- include: ["src/**/*"],
3753
- exclude: ["node_modules", "dist"]
3923
+ keywords: ["dineway", "dineway-plugin"],
3924
+ license: "MIT",
3925
+ peerDependencies: { dineway: "*" },
3926
+ devDependencies: {
3927
+ dineway: "*",
3928
+ tsdown: TSDOWN_VERSION,
3929
+ typescript: TYPESCRIPT_VERSION
3930
+ }
3754
3931
  }, null, " ") + "\n");
3932
+ await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify(TSCONFIG, null, " ") + "\n");
3755
3933
  await writeFile(join(srcDir, "index.ts"), `import type { PluginDescriptor } from "dineway";
3756
3934
 
3757
3935
  export function ${fnName}Plugin(): PluginDescriptor {
3758
3936
  \treturn {
3759
- \t\tid: "${pluginName}",
3937
+ \t\tid: "${slug}",
3760
3938
  \t\tversion: "0.1.0",
3761
3939
  \t\tformat: "standard",
3762
3940
  \t\tentrypoint: "${pluginName}/sandbox",
3763
- \t\tcapabilities: [],
3941
+
3942
+ \t\tcapabilities: ["content:read"],
3943
+ \t\tstorage: {
3944
+ \t\t\tevents: { indexes: ["timestamp"] },
3945
+ \t\t},
3764
3946
  \t};
3765
3947
  }
3766
3948
  `);
3767
3949
  await writeFile(join(srcDir, "sandbox-entry.ts"), `import { definePlugin } from "dineway";
3768
3950
  import type { PluginContext } from "dineway";
3769
3951
 
3952
+ interface ContentSaveEvent {
3953
+ \tcollection: string;
3954
+ \tcontent: { id: string };
3955
+ \tisNew: boolean;
3956
+ }
3957
+
3770
3958
  export default definePlugin({
3771
3959
  \thooks: {
3772
3960
  \t\t"content:afterSave": {
3773
- \t\t\thandler: async (event: any, ctx: PluginContext) => {
3961
+ \t\t\thandler: async (event: ContentSaveEvent, ctx: PluginContext) => {
3774
3962
  \t\t\t\tctx.log.info("Content saved", {
3775
3963
  \t\t\t\t\tcollection: event.collection,
3776
3964
  \t\t\t\t\tid: event.content.id,
3777
3965
  \t\t\t\t});
3966
+
3967
+ \t\t\t\tawait ctx.storage.events.put(\`save-\${Date.now()}\`, {
3968
+ \t\t\t\t\ttimestamp: new Date().toISOString(),
3969
+ \t\t\t\t\tcollection: event.collection,
3970
+ \t\t\t\t\tcontentId: event.content.id,
3971
+ \t\t\t\t});
3972
+ \t\t\t},
3973
+ \t\t},
3974
+ \t},
3975
+
3976
+ \troutes: {
3977
+ \t\trecent: {
3978
+ \t\t\thandler: async (_routeCtx: unknown, ctx: PluginContext) => {
3979
+ \t\t\t\tconst result = await ctx.storage.events.query({
3980
+ \t\t\t\t\torderBy: { timestamp: "desc" },
3981
+ \t\t\t\t\tlimit: 10,
3982
+ \t\t\t\t});
3983
+ \t\t\t\treturn { events: result.items };
3778
3984
  \t\t\t},
3779
3985
  \t\t},
3780
3986
  \t},
@@ -3782,55 +3988,84 @@ export default definePlugin({
3782
3988
  `);
3783
3989
  }
3784
3990
  async function scaffoldNative(targetDir, srcDir, pluginName, slug) {
3785
- const fnName = slug.split("-").map((s, i) => i === 0 ? s : s[0].toUpperCase() + s.slice(1)).join("");
3991
+ const fnName = camelCase(slug);
3992
+ const typeName = pascalCase(slug);
3786
3993
  await writeFile(join(targetDir, "package.json"), JSON.stringify({
3787
3994
  name: pluginName,
3788
3995
  version: "0.1.0",
3789
3996
  type: "module",
3790
- exports: { ".": "./src/index.ts" },
3791
- files: ["src"],
3792
- peerDependencies: { dineway: "*" }
3793
- }, null, " ") + "\n");
3794
- await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify({
3795
- compilerOptions: {
3796
- target: "ES2022",
3797
- module: "preserve",
3798
- moduleResolution: "bundler",
3799
- strict: true,
3800
- esModuleInterop: true,
3801
- declaration: true,
3802
- outDir: "./dist",
3803
- rootDir: "./src"
3997
+ main: "./dist/index.mjs",
3998
+ exports: { ".": {
3999
+ types: "./dist/index.d.mts",
4000
+ import: "./dist/index.mjs"
4001
+ } },
4002
+ files: ["dist"],
4003
+ scripts: {
4004
+ build: "tsdown src/index.ts --format esm --dts --clean",
4005
+ dev: "tsdown src/index.ts --format esm --dts --watch",
4006
+ typecheck: "tsc --noEmit"
3804
4007
  },
3805
- include: ["src/**/*"],
3806
- exclude: ["node_modules", "dist"]
4008
+ keywords: ["dineway", "dineway-plugin"],
4009
+ license: "MIT",
4010
+ peerDependencies: { dineway: "*" },
4011
+ devDependencies: {
4012
+ dineway: "*",
4013
+ tsdown: TSDOWN_VERSION,
4014
+ typescript: TYPESCRIPT_VERSION
4015
+ }
3807
4016
  }, null, " ") + "\n");
4017
+ await writeFile(join(targetDir, "tsconfig.json"), JSON.stringify(TSCONFIG, null, " ") + "\n");
3808
4018
  await writeFile(join(srcDir, "index.ts"), `import { definePlugin } from "dineway";
3809
- import type { PluginDescriptor } from "dineway";
4019
+ import type { ContentHookEvent, PluginContext, PluginDescriptor, RouteContext } from "dineway";
3810
4020
 
3811
- export function ${fnName}Plugin(): PluginDescriptor {
4021
+ export interface ${typeName}Options {
4022
+ \tenabled?: boolean;
4023
+ }
4024
+
4025
+ export function ${fnName}Plugin(
4026
+ \toptions: ${typeName}Options = {},
4027
+ ): PluginDescriptor<${typeName}Options> {
3812
4028
  \treturn {
3813
- \t\tid: "${pluginName}",
4029
+ \t\tid: "${slug}",
3814
4030
  \t\tversion: "0.1.0",
3815
4031
  \t\tformat: "native",
3816
4032
  \t\tentrypoint: "${pluginName}",
3817
- \t\toptions: {},
4033
+ \t\toptions,
3818
4034
  \t};
3819
4035
  }
3820
4036
 
3821
- export function createPlugin() {
4037
+ export function createPlugin(options: ${typeName}Options = {}) {
3822
4038
  \treturn definePlugin({
3823
- \t\tid: "${pluginName}",
4039
+ \t\tid: "${slug}",
3824
4040
  \t\tversion: "0.1.0",
3825
4041
 
4042
+ \t\tcapabilities: ["content:read"],
4043
+ \t\tstorage: {
4044
+ \t\t\tevents: { indexes: ["createdAt"] },
4045
+ \t\t},
4046
+
3826
4047
  \t\thooks: {
3827
- \t\t\t"content:afterSave": async (event, ctx) => {
3828
- \t\t\t\tctx.log.info("Content saved", {
4048
+ \t\t\t"content:afterSave": async (event: ContentHookEvent, ctx: PluginContext) => {
4049
+ \t\t\t\tif (options.enabled === false) return;
4050
+ \t\t\t\tawait ctx.storage.events.put(\`evt_\${Date.now()}\`, {
3829
4051
  \t\t\t\t\tcollection: event.collection,
3830
- \t\t\t\t\tid: event.content.id,
4052
+ \t\t\t\t\tcontentId: event.content.id,
4053
+ \t\t\t\t\tcreatedAt: new Date().toISOString(),
3831
4054
  \t\t\t\t});
3832
4055
  \t\t\t},
3833
4056
  \t\t},
4057
+
4058
+ \t\troutes: {
4059
+ \t\t\trecent: {
4060
+ \t\t\t\thandler: async (ctx: RouteContext) => {
4061
+ \t\t\t\t\tconst result = await ctx.storage.events.query({
4062
+ \t\t\t\t\t\torderBy: { createdAt: "desc" },
4063
+ \t\t\t\t\t\tlimit: 10,
4064
+ \t\t\t\t\t});
4065
+ \t\t\t\t\treturn { events: result.items };
4066
+ \t\t\t\t},
4067
+ \t\t\t},
4068
+ \t\t},
3834
4069
  \t});
3835
4070
  }
3836
4071
 
@@ -1,4 +1,4 @@
1
- import { t as Interceptor } from "../transport-BXe1AM79.mjs";
1
+ import { t as Interceptor } from "../transport-CyOHECBA.mjs";
2
2
 
3
3
  //#region src/client/external-auth-headers.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as tokenInterceptor, i as devBypassInterceptor, n as createTransport, r as csrfInterceptor, t as Interceptor } from "../transport-BXe1AM79.mjs";
1
+ import { a as tokenInterceptor, i as devBypassInterceptor, n as createTransport, r as csrfInterceptor, t as Interceptor } from "../transport-CyOHECBA.mjs";
2
2
 
3
3
  //#region src/client/portable-text.d.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { a as tokenInterceptor, c as markdownToPortableText, i as refreshInterceptor, l as portableTextToMarkdown, n as csrfInterceptor, o as convertDataForRead, r as devBypassInterceptor, s as convertDataForWrite, t as createTransport } from "../transport-D3i4yWRE.mjs";
1
+ import { a as tokenInterceptor, c as markdownToPortableText, i as refreshInterceptor, l as portableTextToMarkdown, n as csrfInterceptor, o as convertDataForRead, r as devBypassInterceptor, s as convertDataForWrite, t as createTransport } from "../transport-B3jxvfio.mjs";
2
2
  import mime from "mime/lite";
3
3
 
4
4
  //#region src/client/index.ts