dineway 0.1.49 → 0.2.1

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 (434) hide show
  1. package/dist/activity-DUaz_w7p.mjs +79 -0
  2. package/dist/{activity-events-CwM7yxPW.mjs → activity-events-CJDvE2uc.mjs} +5 -113
  3. package/dist/actor-0QJ1Gbtf.mjs +37 -0
  4. package/dist/after-BfniwgIf.mjs +9 -0
  5. package/dist/{allowed-origins-CyGnbgBd.mjs → allowed-origins--OwHHiY8.mjs} +1 -1
  6. package/dist/api/route-utils.d.mts +9 -10
  7. package/dist/api/route-utils.mjs +16 -13
  8. package/dist/api/schemas/index.d.mts +2 -2
  9. package/dist/api/schemas/index.mjs +5 -4
  10. package/dist/{api-BMIxRIEN.mjs → api-B4PHIF4V.mjs} +93 -41
  11. package/dist/{api-tokens-DtvdtIkm.mjs → api-tokens-tbK_sORH.mjs} +6 -2
  12. package/dist/{apply-D_RlTYtC.mjs → apply-DjTqq6Ae.mjs} +117 -77
  13. package/dist/astro/image-endpoint.d.mts +7 -0
  14. package/dist/astro/image-endpoint.mjs +54 -0
  15. package/dist/astro/index.d.mts +34 -11
  16. package/dist/astro/index.mjs +163 -24
  17. package/dist/astro/integration/shims/use-sync-external-store-with-selector.js +71 -0
  18. package/dist/astro/integration/shims/use-sync-external-store.js +1 -0
  19. package/dist/astro/middleware/auth.d.mts +8 -18
  20. package/dist/astro/middleware/auth.mjs +42 -24
  21. package/dist/astro/middleware/redirect.mjs +13 -4
  22. package/dist/astro/middleware/request-context.mjs +8 -5
  23. package/dist/astro/middleware/seed.d.mts +1 -1
  24. package/dist/astro/middleware/seed.mjs +2 -2
  25. package/dist/astro/middleware/setup.mjs +1 -1
  26. package/dist/astro/middleware.mjs +389 -206
  27. package/dist/astro/routes/admin.astro +6 -1
  28. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +7 -6
  29. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +7 -6
  30. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  31. package/dist/astro/routes/api/admin/api-tokens/index.mjs +6 -6
  32. package/dist/astro/routes/api/admin/briefing.mjs +21 -17
  33. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  34. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +9 -8
  35. package/dist/astro/routes/api/admin/byline-fields/index.mjs +9 -8
  36. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +9 -8
  37. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +17 -14
  38. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +17 -14
  39. package/dist/astro/routes/api/admin/bylines/index.mjs +17 -14
  40. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +14 -12
  41. package/dist/astro/routes/api/admin/comments/_id_.mjs +6 -5
  42. package/dist/astro/routes/api/admin/comments/bulk.mjs +11 -9
  43. package/dist/astro/routes/api/admin/comments/counts.mjs +6 -5
  44. package/dist/astro/routes/api/admin/comments/index.mjs +11 -9
  45. package/dist/astro/routes/api/admin/context/_id_/history.mjs +27 -24
  46. package/dist/astro/routes/api/admin/context/_id_/index.mjs +27 -24
  47. package/dist/astro/routes/api/admin/context/_id_/review.mjs +32 -28
  48. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +32 -28
  49. package/dist/astro/routes/api/admin/context/diff.mjs +31 -27
  50. package/dist/astro/routes/api/admin/context/index.mjs +32 -28
  51. package/dist/astro/routes/api/admin/context/stale.mjs +31 -27
  52. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +27 -24
  53. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +31 -27
  54. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +31 -27
  55. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +28 -25
  56. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  57. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +6 -6
  58. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +6 -6
  59. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +56 -51
  60. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +56 -51
  61. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +47 -43
  62. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +54 -49
  63. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +53 -48
  64. package/dist/astro/routes/api/admin/plugins/index.mjs +47 -43
  65. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  66. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +46 -42
  67. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +53 -48
  68. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +46 -42
  69. package/dist/astro/routes/api/admin/plugins/updates.mjs +46 -42
  70. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +5 -5
  71. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +32 -63
  72. package/dist/astro/routes/api/admin/review-requests/index.d.mts +2 -1
  73. package/dist/astro/routes/api/admin/review-requests/index.mjs +58 -10
  74. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +46 -42
  75. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  76. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +46 -42
  77. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +3 -3
  78. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +2 -2
  79. package/dist/astro/routes/api/admin/users/_id_/index.mjs +8 -7
  80. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +4 -4
  81. package/dist/astro/routes/api/admin/users/index.mjs +7 -6
  82. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  83. package/dist/astro/routes/api/auth/invite/accept.mjs +2 -2
  84. package/dist/astro/routes/api/auth/invite/complete.mjs +12 -11
  85. package/dist/astro/routes/api/auth/invite/index.mjs +9 -8
  86. package/dist/astro/routes/api/auth/invite/register-options.mjs +11 -10
  87. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  88. package/dist/astro/routes/api/auth/magic-link/send.mjs +11 -10
  89. package/dist/astro/routes/api/auth/magic-link/verify.mjs +3 -3
  90. package/dist/astro/routes/api/auth/me.mjs +9 -8
  91. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  92. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  93. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +2 -2
  94. package/dist/astro/routes/api/auth/passkey/_id_.mjs +6 -5
  95. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  96. package/dist/astro/routes/api/auth/passkey/options.mjs +12 -11
  97. package/dist/astro/routes/api/auth/passkey/register/options.mjs +10 -9
  98. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +11 -10
  99. package/dist/astro/routes/api/auth/passkey/verify.mjs +11 -10
  100. package/dist/astro/routes/api/auth/setup-token/index.mjs +5 -5
  101. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  102. package/dist/astro/routes/api/auth/signup/complete.mjs +12 -11
  103. package/dist/astro/routes/api/auth/signup/request.mjs +11 -10
  104. package/dist/astro/routes/api/auth/signup/verify.mjs +2 -2
  105. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +15 -13
  106. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.d.mts +8 -0
  107. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +160 -0
  108. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  109. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +6 -5
  110. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -5
  111. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -5
  112. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +11 -10
  113. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +49 -20
  114. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -5
  115. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  116. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +67 -32
  117. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +16 -14
  118. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  119. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +6 -5
  120. package/dist/astro/routes/api/content/_collection_/_id_.mjs +11 -9
  121. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  122. package/dist/astro/routes/api/content/_collection_/index.mjs +11 -9
  123. package/dist/astro/routes/api/content/_collection_/trash.mjs +7 -6
  124. package/dist/astro/routes/api/dashboard.mjs +9 -8
  125. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  126. package/dist/astro/routes/api/health.mjs +1 -1
  127. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  128. package/dist/astro/routes/api/import/probe.mjs +22 -10
  129. package/dist/astro/routes/api/import/wordpress/analyze.mjs +9 -6
  130. package/dist/astro/routes/api/import/wordpress/execute.d.mts +18 -1
  131. package/dist/astro/routes/api/import/wordpress/execute.mjs +85 -37
  132. package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -1
  133. package/dist/astro/routes/api/import/wordpress/media.mjs +20 -14
  134. package/dist/astro/routes/api/import/wordpress/prepare.mjs +36 -32
  135. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +17 -1
  136. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +121 -100
  137. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  138. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -12
  139. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +55 -2
  140. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +284 -55
  141. package/dist/astro/routes/api/manifest.mjs +14 -5
  142. package/dist/astro/routes/api/mcp.mjs +753 -170
  143. package/dist/astro/routes/api/media/_id_/confirm.mjs +38 -10
  144. package/dist/astro/routes/api/media/_id_.mjs +11 -7
  145. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  146. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  147. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  148. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  149. package/dist/astro/routes/api/media/upload-url.mjs +11 -10
  150. package/dist/astro/routes/api/media.mjs +28 -35
  151. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +32 -28
  152. package/dist/astro/routes/api/menus/_name_/items.mjs +32 -28
  153. package/dist/astro/routes/api/menus/_name_/reorder.mjs +32 -28
  154. package/dist/astro/routes/api/menus/_name_/translations.mjs +32 -28
  155. package/dist/astro/routes/api/menus/_name_.mjs +32 -28
  156. package/dist/astro/routes/api/menus/index.mjs +32 -28
  157. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  158. package/dist/astro/routes/api/oauth/device/authorize.mjs +6 -6
  159. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  160. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  161. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  162. package/dist/astro/routes/api/oauth/token/refresh.mjs +6 -6
  163. package/dist/astro/routes/api/oauth/token/revoke.mjs +6 -6
  164. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  165. package/dist/astro/routes/api/openapi.json.mjs +4 -3
  166. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +46 -31
  167. package/dist/astro/routes/api/redirects/404s/index.mjs +11 -10
  168. package/dist/astro/routes/api/redirects/404s/summary.mjs +11 -10
  169. package/dist/astro/routes/api/redirects/_id_.mjs +33 -29
  170. package/dist/astro/routes/api/redirects/index.mjs +33 -29
  171. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  172. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  173. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +48 -43
  174. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +48 -43
  175. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +48 -43
  176. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +48 -43
  177. package/dist/astro/routes/api/schema/collections/index.mjs +48 -43
  178. package/dist/astro/routes/api/schema/index.mjs +14 -15
  179. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +46 -42
  180. package/dist/astro/routes/api/schema/orphans/index.mjs +46 -42
  181. package/dist/astro/routes/api/search/enable.mjs +11 -10
  182. package/dist/astro/routes/api/search/index.mjs +10 -9
  183. package/dist/astro/routes/api/search/rebuild.mjs +11 -10
  184. package/dist/astro/routes/api/search/stats.mjs +6 -6
  185. package/dist/astro/routes/api/search/suggest.mjs +10 -9
  186. package/dist/astro/routes/api/sections/_slug_.mjs +32 -28
  187. package/dist/astro/routes/api/sections/index.mjs +32 -28
  188. package/dist/astro/routes/api/settings/email.mjs +4 -4
  189. package/dist/astro/routes/api/settings.mjs +32 -28
  190. package/dist/astro/routes/api/setup/admin-verify.mjs +14 -13
  191. package/dist/astro/routes/api/setup/admin.mjs +12 -11
  192. package/dist/astro/routes/api/setup/dev-bypass.mjs +31 -25
  193. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  194. package/dist/astro/routes/api/setup/index.mjs +29 -25
  195. package/dist/astro/routes/api/setup/status.mjs +3 -3
  196. package/dist/astro/routes/api/snapshot.mjs +8 -7
  197. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +35 -31
  198. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +35 -31
  199. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +35 -31
  200. package/dist/astro/routes/api/taxonomies/index.mjs +35 -31
  201. package/dist/astro/routes/api/themes/preview.mjs +5 -5
  202. package/dist/astro/routes/api/typegen.mjs +4 -4
  203. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  204. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  205. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  206. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +31 -27
  207. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +32 -28
  208. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +32 -28
  209. package/dist/astro/routes/api/widget-areas/_name_.mjs +29 -26
  210. package/dist/astro/routes/api/widget-areas/index.mjs +32 -28
  211. package/dist/astro/routes/api/widget-components.mjs +2 -2
  212. package/dist/astro/routes/robots.txt.mjs +8 -7
  213. package/dist/astro/routes/sitemap-_collection_.xml.mjs +23 -14
  214. package/dist/astro/routes/sitemap.xml.mjs +9 -8
  215. package/dist/astro/session-driver.d.mts +1 -1
  216. package/dist/astro/session-driver.mjs +2 -2
  217. package/dist/astro/types.d.mts +22 -13
  218. package/dist/{audit-BeNsSyfU.mjs → audit-B2pRxZ20.mjs} +1 -1
  219. package/dist/auth/providers/github.d.mts +1 -1
  220. package/dist/auth/providers/google.d.mts +1 -1
  221. package/dist/{auth-control-guard-Dr14I98m.mjs → auth-control-guard-D71jourk.mjs} +1 -1
  222. package/dist/{authorize-BLO0m7fW.mjs → authorize-ZXPGPwKn.mjs} +1 -1
  223. package/dist/{briefing-CkTee1ex.mjs → briefing-0rf-su3-.mjs} +90 -28
  224. package/dist/{briefing-DJX6irto.mjs → briefing-kRhegBoF.mjs} +2 -1
  225. package/dist/bundle-CEcdUa1s.mjs +602 -0
  226. package/dist/{byline-BVC1lV6G.mjs → byline-7xR185Ly.mjs} +30 -62
  227. package/dist/{byline-fields-Cj39WhXC.mjs → byline-fields-BKzA0fJU.mjs} +1 -1
  228. package/dist/{byline-fields-uJlygdzM.d.mts → byline-fields-Ckeqd1OY.d.mts} +88 -35
  229. package/dist/{byline-fields-cNrLJVRs.mjs → byline-fields-WN7RQT4q.mjs} +10 -4
  230. package/dist/{byline-registry-4v6tXMNX.mjs → byline-registry-Ba54M74c.mjs} +2 -2
  231. package/dist/{bylines-LN9XISRo.mjs → bylines-C-EL6dh3.mjs} +9 -3
  232. package/dist/{bylines-DwokOFj6.mjs → bylines-CmZFCMr0.mjs} +5 -5
  233. package/dist/{cache-Bac05gBd.mjs → cache-DkVCKGio.mjs} +2 -2
  234. package/dist/{chunks-CuUt7K50.mjs → chunks-ChGNDY8r.mjs} +1 -1
  235. package/dist/cli/index.d.mts +29 -1
  236. package/dist/cli/index.mjs +1466 -1763
  237. package/dist/cli/plugin-kit.d.mts +75 -0
  238. package/dist/cli/plugin-kit.mjs +4 -0
  239. package/dist/client/external-auth-headers.d.mts +1 -1
  240. package/dist/client/index.d.mts +27 -52
  241. package/dist/client/index.mjs +34 -6
  242. package/dist/client-factory-BDD9azPJ.mjs +233 -0
  243. package/dist/{comment-Beue8-15.mjs → comment-DFALgsJD.mjs} +13 -3
  244. package/dist/comment-reaction-C37bf99u.mjs +58 -0
  245. package/dist/{comments-DcjFIfqX.mjs → comments-B3NwDBxl.mjs} +1 -1
  246. package/dist/{content-CBxYGWfL.mjs → content-DJcAYFhz.mjs} +51 -34
  247. package/dist/content-refresh-B4ZCmxgd.mjs +1576 -0
  248. package/dist/{context-Df1xVYyr.mjs → context-DnpXcp6Y.mjs} +2 -2
  249. package/dist/{context-CQVNZaR8.mjs → context-fSCYLL3c.mjs} +125 -53
  250. package/dist/{context-route-helpers-B9wj8Rmh.mjs → context-route-helpers-CI8XzcsK.mjs} +2 -1
  251. package/dist/{cron-DxCAU_Sn.mjs → cron-B1SL_lsb.mjs} +7 -3
  252. package/dist/{dashboard-B7ZUNuyF.mjs → dashboard-D0nj5oWg.mjs} +4 -4
  253. package/dist/db/index.d.mts +3 -3
  254. package/dist/db/index.mjs +1 -1
  255. package/dist/db/libsql.d.mts +1 -1
  256. package/dist/db/postgres.d.mts +1 -1
  257. package/dist/db/sqlite.d.mts +1 -1
  258. package/dist/{device-flow-BZVGftqi.mjs → device-flow-BJe6VEhP.mjs} +5 -5
  259. package/dist/{placeholder-d54Qr_7n.mjs → enrich-Ck9tfMqe.mjs} +36 -9
  260. package/dist/{error-DCSuUAZW.mjs → error-CSVaQNZy.mjs} +5 -0
  261. package/dist/{experimental-workflows-CSMffP6q.mjs → experimental-workflows-GVhUgzEs.mjs} +1 -1
  262. package/dist/field-defs-cache-DL-T2XVS.mjs +49 -0
  263. package/dist/forgeway-seo-client-G5ddhVHd.mjs +456 -0
  264. package/dist/{fts-manager-B5l_qwrA.mjs → fts-manager-ewTGohf4.mjs} +1 -1
  265. package/dist/{hitl-requests-7NlzVeUA.mjs → hitl-requests-DEFj8e6u.mjs} +2 -2
  266. package/dist/{hitl-route-helpers-k---_H3-.mjs → hitl-route-helpers-C23JHaWz.mjs} +5 -4
  267. package/dist/import-CXXL5pip.mjs +1354 -0
  268. package/dist/index-DcnOCD1e.d.mts +375 -0
  269. package/dist/index.d.mts +15 -16
  270. package/dist/index.mjs +85 -70
  271. package/dist/{jsonld-DZ67souc.d.mts → jsonld-DzKbhRZ4.d.mts} +8 -4
  272. package/dist/{load-D9OiGr2m.mjs → load-CFtJRT3c.mjs} +1 -1
  273. package/dist/{loader--GOYux8M.mjs → loader-aWkkc1_o.mjs} +117 -31
  274. package/dist/{manifest-schema-qh2P7RDX.mjs → manifest-schema-uA6pRFXi.mjs} +38 -1
  275. package/dist/mcp-reviewed-executor-Dn52L_yY.mjs +558 -0
  276. package/dist/media/image-endpoint.d.mts +32 -0
  277. package/dist/media/image-endpoint.mjs +111 -0
  278. package/dist/media/index.d.mts +27 -2
  279. package/dist/media/index.mjs +5 -3
  280. package/dist/media/local-runtime.d.mts +15 -11
  281. package/dist/media/local-runtime.mjs +9 -7
  282. package/dist/{media-CbKyYukG.mjs → media-CVMOoywq.mjs} +3 -1
  283. package/dist/{media-allowlist-BYxJIcTO.mjs → media-allowlist-zDNJmXCo.mjs} +1 -1
  284. package/dist/media-url-BdoLPvg8.mjs +20 -0
  285. package/dist/{menus-C7F0sCrC.mjs → menus-CCG2z5um.mjs} +80 -15
  286. package/dist/{menus-BZbXf-ej.mjs → menus-CmyIkRG5.mjs} +19 -5
  287. package/dist/{normalize-ByemhhfW.mjs → normalize-Cyt7JdF7.mjs} +8 -1
  288. package/dist/{oauth-authorization-DF-LCsIA.mjs → oauth-authorization-B9H7X85L.mjs} +5 -5
  289. package/dist/{oauth-clients-Du-V0fEm.mjs → oauth-clients-Dwl32-Uj.mjs} +2 -2
  290. package/dist/object-cache/memory.d.mts +14 -0
  291. package/dist/object-cache/memory.mjs +55 -0
  292. package/dist/object-cache-D51qOseS.mjs +419 -0
  293. package/dist/output-DhBe5_Pi.mjs +68 -0
  294. package/dist/page/index.d.mts +10 -3
  295. package/dist/page/index.mjs +2 -2
  296. package/dist/{parse-CneSgl7-.mjs → parse-i15EFSAE.mjs} +1 -1
  297. package/dist/{parser-DxfsARXL.mjs → parser-06LLLL4E.mjs} +151 -9
  298. package/dist/{placeholder-CXfoCtCd.d.mts → placeholder-DkWkXfDI.d.mts} +12 -4
  299. package/dist/plugin-utils.d.mts +8 -9
  300. package/dist/plugins/adapt-sandbox-entry.d.mts +8 -9
  301. package/dist/plugins/adapt-sandbox-entry.mjs +13 -2
  302. package/dist/{plugins-DzfqRREq.mjs → plugins-CPA2PtfY.mjs} +919 -66
  303. package/dist/{transport-LSdZVXHF.mjs → portable-text-BASHceim.mjs} +1 -134
  304. package/dist/portable-text-E79LyjGo.d.mts +45 -0
  305. package/dist/{preview-C-3YTX2U.mjs → preview-BjedZm8G.mjs} +4 -3
  306. package/dist/process-cache-CCDgti7j.mjs +106 -0
  307. package/dist/project-env-DKibmuP8.mjs +95 -0
  308. package/dist/{provider-loader-9it4vd6L.d.mts → provider-loader-DC2JdWeO.d.mts} +1 -1
  309. package/dist/{public-url-B4xV4rGa.d.mts → public-url-DQJCnYi9.d.mts} +1 -1
  310. package/dist/publication-authorization-RKiHXKtq.mjs +985 -0
  311. package/dist/{query-CZ3TH_Uu.mjs → query-C2U5u5_p.mjs} +11 -6
  312. package/dist/{query-Ds0EnMFX.mjs → query-DEv5x6yB.mjs} +281 -76
  313. package/dist/{rate-limit-i0G3IAOX.mjs → rate-limit-DglsAJSw.mjs} +2 -2
  314. package/dist/{redirect-CEACczxo.mjs → redirect-ubhEqQCQ.mjs} +2 -2
  315. package/dist/{redirects-ocRJmQHP.mjs → redirects-Bhpm8bRe.mjs} +35 -19
  316. package/dist/{redirects-DYj1yPxs.mjs → redirects-xs2yahLq.mjs} +47 -24
  317. package/dist/{registry-D7HACema.mjs → registry-BYYyb2tF.mjs} +148 -81
  318. package/dist/request-context.d.mts +2 -0
  319. package/dist/{request-meta-DAb6xaP9.mjs → request-meta-CFe1tW2M.mjs} +1 -1
  320. package/dist/review-payload-BysRWpxS.mjs +111 -0
  321. package/dist/{review-requests-BW2NxY-l.mjs → review-requests-CTWGnWUt.mjs} +1 -1
  322. package/dist/review-requests-D42VEP1l.mjs +142 -0
  323. package/dist/review-route-helpers-C31vO6SI.mjs +41 -0
  324. package/dist/runner-BgmttQmD.mjs +7444 -0
  325. package/dist/{runner-09sTqtv0.d.mts → runner-D6hzs8L9.d.mts} +1 -1
  326. package/dist/runtime.d.mts +9 -10
  327. package/dist/runtime.mjs +3 -3
  328. package/dist/schema-DUtnZxjZ.mjs +8 -0
  329. package/dist/{search-Gdrqj582.mjs → search-DUKgZUlm.mjs} +5 -3
  330. package/dist/{secrets-CeGpBFV2.mjs → secrets-ZV5rd8yV.mjs} +14 -11
  331. package/dist/{sections-BOjU13Y-.mjs → sections-DvFgsnda.mjs} +2 -2
  332. package/dist/seed/index.d.mts +2 -2
  333. package/dist/seed/index.mjs +21 -18
  334. package/dist/seo/index.d.mts +1 -1
  335. package/dist/seo/index.mjs +3 -12
  336. package/dist/{seo-5lJOtB5J.mjs → seo-BLszyJxd.mjs} +22 -4
  337. package/dist/{seo-CLj8lS7Q.mjs → seo-BU8MLCS9.mjs} +5 -2
  338. package/dist/{seo-contributions-CqVvReEj.mjs → seo-contributions-GnCuL1ML.mjs} +11 -3
  339. package/dist/{service-jGlhrICs.mjs → service-FL3fB0Rx.mjs} +2 -2
  340. package/dist/session-user-Ct6GBLvn.mjs +22 -0
  341. package/dist/{settings-CUXOxzsT.mjs → settings-BECcAIRH.mjs} +28 -55
  342. package/dist/{settings-DlBsT2VS.mjs → settings-EzADu-dd.mjs} +2 -2
  343. package/dist/{setup-complete-BRrdPYjZ.mjs → setup-complete-Da0axZEE.mjs} +1 -1
  344. package/dist/{site-activity-DONFrMBJ.mjs → site-activity-h8smOlYI.mjs} +1 -1
  345. package/dist/{site-context-C8Az_P_I.mjs → site-context-B8T1kpUP.mjs} +337 -530
  346. package/dist/{site-url-DIMD68go.mjs → site-url-DJEid0ml.mjs} +1 -1
  347. package/dist/stable-hash-DshcXvRE.mjs +19 -0
  348. package/dist/status-NqWOSFAD.mjs +21 -0
  349. package/dist/storage/local.d.mts +1 -1
  350. package/dist/storage/local.mjs +1 -1
  351. package/dist/storage/s3.d.mts +1 -1
  352. package/dist/storage/s3.mjs +1 -1
  353. package/dist/{taxonomies-D9Sw4wWM.mjs → taxonomies-BiM9NtgW.mjs} +36 -29
  354. package/dist/taxonomies-DSnY5nOa.mjs +443 -0
  355. package/dist/{taxonomy-B169Nm6B.mjs → taxonomy-0k_vRVsD.mjs} +44 -9
  356. package/dist/transport-C46KHLMP.mjs +134 -0
  357. package/dist/types-A8fPOJnl.mjs +69 -0
  358. package/dist/types-BLQCz46p.d.mts +118 -0
  359. package/dist/{types-CwawBUTa.d.mts → types-B_FlxIIl.d.mts} +4 -1
  360. package/dist/{types-CSgR9nQB.mjs → types-ChxYDRvx.mjs} +1 -1
  361. package/dist/{types-GaCtZ1k9.d.mts → types-Cw0PeCT_.d.mts} +18 -0
  362. package/dist/types-DuQn1G7-.d.mts +2973 -0
  363. package/dist/{runtime-C4-2lSFg.d.mts → types-DwoUifGE.d.mts} +5668 -3000
  364. package/dist/{types-DRIKLmJI.d.mts → types-opjX_kz6.d.mts} +17 -2
  365. package/dist/ui/server-runtime.d.mts +13 -15
  366. package/dist/ui/server-runtime.mjs +24 -20
  367. package/dist/url-guoXQQcV.mjs +33 -0
  368. package/dist/{user-DTLoZs16.mjs → user-BH-n01y3.mjs} +2 -2
  369. package/dist/{utils-B8hBJ9Oz.mjs → utils-D1SrKGtP.mjs} +129 -7
  370. package/dist/{validate-DzjCdy6v.d.mts → validate-CbVFoJgc.d.mts} +65 -8
  371. package/dist/{validate-DWmPO6oj.mjs → validate-D1HL-oLR.mjs} +11 -6
  372. package/dist/version-C3iVRuaF.mjs +6 -0
  373. package/dist/{widgets-BpJ8EpPd.mjs → widgets-BZrLrNgS.mjs} +46 -43
  374. package/dist/{wordpress-slugs-DHNR9LpG.mjs → wordpress-slugs-C3PWcowq.mjs} +1 -1
  375. package/dist/{zod-generator-K91-g665.mjs → zod-generator-C7AsLpSB.mjs} +42 -14
  376. package/package.json +38 -8
  377. package/src/components/Block.astro +50 -0
  378. package/src/components/Comments.astro +143 -1
  379. package/src/components/DinewayHead.astro +19 -2
  380. package/src/components/DinewayImage.astro +66 -33
  381. package/src/components/DinewayMedia.astro +1 -2
  382. package/src/components/Image.astro +85 -40
  383. package/src/components/InlinePortableTextEditor.tsx +12 -2
  384. package/src/components/JsonLdScript.astro +9 -0
  385. package/src/components/LiveSearch.astro +40 -4
  386. package/src/components/index.ts +4 -0
  387. package/src/components/live-search-routing.ts +30 -0
  388. package/src/components/portable-text-text-align.ts +15 -0
  389. package/src/ui.ts +2 -0
  390. package/dist/entity-aliases-4y93Yjuc.mjs +0 -51
  391. package/dist/import-4YBXbDkI.mjs +0 -684
  392. package/dist/index-CZiWCQDp.d.mts +0 -227
  393. package/dist/review-requests-Qum4713s.mjs +0 -79
  394. package/dist/runner-DzIpHGND.mjs +0 -2836
  395. package/dist/schema-Bsi-VpYv.mjs +0 -8
  396. package/dist/taxonomies-CZ-_DitR.mjs +0 -327
  397. package/dist/types-CuJOqHfM.d.mts +0 -758
  398. package/dist/types-DSPGWjxO.d.mts +0 -1247
  399. package/dist/types-nP9vGUFq.d.mts +0 -56
  400. package/dist/version-C4gfn0PJ.mjs +0 -6
  401. /package/dist/{adapters-OQCImOL7.d.mts → adapters-BiRymx02.d.mts} +0 -0
  402. /package/dist/{api-tokens-CYUoFGo7.mjs → api-tokens-Ypaly90d.mjs} +0 -0
  403. /package/dist/{challenge-store-DFxX0_15.mjs → challenge-store-D5pSY2S1.mjs} +0 -0
  404. /package/dist/{components--pg6zBvu.mjs → components-DImzlLhb.mjs} +0 -0
  405. /package/dist/{context-types-r8oFvyOq.mjs → context-types-eBuMDAg-.mjs} +0 -0
  406. /package/dist/{default-B6iaLvP7.mjs → default-D4Vygcy_.mjs} +0 -0
  407. /package/dist/{email-console-BOVqIYpB.mjs → email-console-Bp0r68iF.mjs} +0 -0
  408. /package/dist/{escape-BDgouFFY.mjs → escape-DN4Qmjsl.mjs} +0 -0
  409. /package/dist/{hash-BPmX6P8I.mjs → hash-mxxx2oPW.mjs} +0 -0
  410. /package/dist/{mime-CbKsKDCB.mjs → mime-C0vOHFm7.mjs} +0 -0
  411. /package/dist/{mode-CZqCF9dZ.mjs → mode-C8yZnIlR.mjs} +0 -0
  412. /package/dist/{oauth-state-store-qncPB_IU.mjs → oauth-state-store-CndT35iw.mjs} +0 -0
  413. /package/dist/{oauth-user-lookup-BFjWF8wK.mjs → oauth-user-lookup-CMehAaKs.mjs} +0 -0
  414. /package/dist/{options-LsPjZlqD.mjs → options-DQPTH5n0.mjs} +0 -0
  415. /package/dist/{passkey-config-DzHQK90v.mjs → passkey-config-NYukYGed.mjs} +0 -0
  416. /package/dist/{patterns-DKAX6oqN.mjs → patterns-CoqlXUvk.mjs} +0 -0
  417. /package/dist/{provider-loader-DzUxejk7.mjs → provider-loader-BtfrrzfD.mjs} +0 -0
  418. /package/dist/{public-url-B_m9IwdV.mjs → public-url-Cp6hyjVR.mjs} +0 -0
  419. /package/dist/{redirect-BjIBtDWY.mjs → redirect-DrbEmU9a.mjs} +0 -0
  420. /package/dist/{request-cache-ho99schz.mjs → request-cache-CBFjCwSt.mjs} +0 -0
  421. /package/dist/{resolve-DTuDyYKs.mjs → resolve-DE71WcL9.mjs} +0 -0
  422. /package/dist/{setup-nonce-pyGfc9hV.mjs → setup-nonce-BtkKnvxQ.mjs} +0 -0
  423. /package/dist/{sidecar-client-mJxwayYN.mjs → sidecar-client-Ctzfyyp-.mjs} +0 -0
  424. /package/dist/{slugify-BqebcqBg.mjs → slugify-KSsVD_D3.mjs} +0 -0
  425. /package/dist/{ssrf-DiKqWd3N.mjs → ssrf-FJqwQzj4.mjs} +0 -0
  426. /package/dist/{tokens-SLmgowfd.mjs → tokens-BDQU29Vd.mjs} +0 -0
  427. /package/dist/{transaction-CFLhEOuH.mjs → transaction-0LEAAy8R.mjs} +0 -0
  428. /package/dist/{transport-BnsNxh2l.d.mts → transport-D9pKAzFP.d.mts} +0 -0
  429. /package/dist/{trusted-proxy-BgIIcbsN.mjs → trusted-proxy-Dm7Mxvt6.mjs} +0 -0
  430. /package/dist/{types-CJ8DkL0q.mjs → types-B7TDDFMG.mjs} +0 -0
  431. /package/dist/{types-Dryvv7LH.d.mts → types-g0zMtraY.d.mts} +0 -0
  432. /package/dist/{types-Cg276-3z.mjs → types-mVVgRPaU.mjs} +0 -0
  433. /package/dist/{types-DZpT-PnG.d.mts → types-wFu80FrO.d.mts} +0 -0
  434. /package/dist/{url-w7Mp5qAD.mjs → url-EMAguGVk.mjs} +0 -0
@@ -1,1247 +0,0 @@
1
- import { d as FieldType } from "./types-CwawBUTa.mjs";
2
- import { z } from "astro/zod";
3
- import "react/jsx-runtime";
4
- import { JSX } from "astro/jsx-runtime";
5
-
6
- //#region ../blocks/dist/validation-b1zbwCOE.d.ts
7
- //#region src/types.d.ts
8
- interface ConfirmDialog {
9
- title: string;
10
- text: string;
11
- confirm: string;
12
- deny: string;
13
- style?: "danger";
14
- }
15
- interface ButtonElement {
16
- type: "button";
17
- action_id: string;
18
- label: string;
19
- style?: "primary" | "danger" | "secondary";
20
- value?: unknown;
21
- confirm?: ConfirmDialog;
22
- }
23
- interface TextInputElement {
24
- type: "text_input";
25
- action_id: string;
26
- label: string;
27
- placeholder?: string;
28
- initial_value?: string;
29
- multiline?: boolean;
30
- }
31
- interface NumberInputElement {
32
- type: "number_input";
33
- action_id: string;
34
- label: string;
35
- initial_value?: number;
36
- min?: number;
37
- max?: number;
38
- }
39
- interface SelectElement {
40
- type: "select";
41
- action_id: string;
42
- label: string;
43
- options: Array<{
44
- label: string;
45
- value: string;
46
- }>;
47
- initial_value?: string;
48
- /** Plugin route that returns `{ items: Array<{ id, name }> }` to populate options dynamically */
49
- optionsRoute?: string;
50
- }
51
- interface ToggleElement {
52
- type: "toggle";
53
- action_id: string;
54
- label: string;
55
- description?: string;
56
- initial_value?: boolean;
57
- }
58
- interface SecretInputElement {
59
- type: "secret_input";
60
- action_id: string;
61
- label: string;
62
- placeholder?: string;
63
- has_value?: boolean;
64
- }
65
- interface CheckboxElement {
66
- type: "checkbox";
67
- action_id: string;
68
- label: string;
69
- options: Array<{
70
- label: string;
71
- value: string;
72
- }>;
73
- initial_value?: string[];
74
- }
75
- interface DateInputElement {
76
- type: "date_input";
77
- action_id: string;
78
- label: string;
79
- initial_value?: string;
80
- placeholder?: string;
81
- }
82
- interface ComboboxElement {
83
- type: "combobox";
84
- action_id: string;
85
- label: string;
86
- options: Array<{
87
- label: string;
88
- value: string;
89
- }>;
90
- initial_value?: string;
91
- placeholder?: string;
92
- }
93
- interface RadioElement {
94
- type: "radio";
95
- action_id: string;
96
- label: string;
97
- options: Array<{
98
- label: string;
99
- value: string;
100
- }>;
101
- initial_value?: string;
102
- }
103
- interface MediaPickerElement {
104
- type: "media_picker";
105
- action_id: string;
106
- label: string;
107
- mime_type_filter?: string;
108
- initial_value?: string;
109
- placeholder?: string;
110
- }
111
- type RepeaterSubField = TextInputElement | NumberInputElement | SelectElement | ToggleElement;
112
- interface RepeaterElement {
113
- type: "repeater";
114
- action_id: string;
115
- label: string;
116
- item_label?: string;
117
- fields: RepeaterSubField[];
118
- min_items?: number;
119
- max_items?: number;
120
- initial_value?: Array<Record<string, unknown>>;
121
- }
122
- type Element = ButtonElement | TextInputElement | NumberInputElement | SelectElement | ToggleElement | SecretInputElement | CheckboxElement | DateInputElement | ComboboxElement | RadioElement | MediaPickerElement | RepeaterElement;
123
- //#endregion
124
- //#region src/plugins/types.d.ts
125
- /**
126
- * Plugin capabilities determine what APIs are available in context
127
- */
128
- type PluginCapability = "network:request" | "network:request:unrestricted" | "content:read" | "content:write" | "media:read" | "media:write" | "users:read" | "email:send" | "hooks.email-transport:register" | "hooks.email-events:register" | "hooks.page-fragments:register";
129
- /**
130
- * Storage collection declaration in plugin definition
131
- */
132
- interface StorageCollectionConfig {
133
- /**
134
- * Fields to index for querying.
135
- * Each entry can be a single field name or an array for composite indexes.
136
- */
137
- indexes: Array<string | string[]>;
138
- /**
139
- * Fields with unique constraints.
140
- * Each entry can be a single field name or an array for composite unique indexes.
141
- * Unique indexes are also queryable (no need to duplicate in `indexes`).
142
- */
143
- uniqueIndexes?: Array<string | string[]>;
144
- }
145
- /**
146
- * Plugin storage configuration
147
- */
148
- type PluginStorageConfig = Record<string, StorageCollectionConfig>;
149
- /**
150
- * Query filter operators
151
- */
152
- interface RangeFilter {
153
- gt?: number | string;
154
- gte?: number | string;
155
- lt?: number | string;
156
- lte?: number | string;
157
- }
158
- interface InFilter {
159
- in: Array<string | number>;
160
- }
161
- interface StartsWithFilter {
162
- startsWith: string;
163
- }
164
- /**
165
- * Where clause value types
166
- */
167
- type WhereValue = string | number | boolean | null | RangeFilter | InFilter | StartsWithFilter;
168
- /**
169
- * Where clause for storage queries
170
- */
171
- type WhereClause = Record<string, WhereValue>;
172
- /**
173
- * Query options for storage.query()
174
- */
175
- interface QueryOptions {
176
- where?: WhereClause;
177
- orderBy?: Record<string, "asc" | "desc">;
178
- limit?: number;
179
- cursor?: string;
180
- }
181
- /**
182
- * Paginated result (used by storage.query, content.list, media.list)
183
- */
184
- interface PaginatedResult<T> {
185
- items: T[];
186
- cursor?: string;
187
- hasMore: boolean;
188
- }
189
- /**
190
- * Storage collection interface - the API exposed to plugins
191
- * No async iterators - all operations return promises with pagination
192
- */
193
- interface StorageCollection<T = unknown> {
194
- get(id: string): Promise<T | null>;
195
- put(id: string, data: T): Promise<void>;
196
- delete(id: string): Promise<boolean>;
197
- exists(id: string): Promise<boolean>;
198
- getMany(ids: string[]): Promise<Map<string, T>>;
199
- putMany(items: Array<{
200
- id: string;
201
- data: T;
202
- }>): Promise<void>;
203
- deleteMany(ids: string[]): Promise<number>;
204
- query(options?: QueryOptions): Promise<PaginatedResult<{
205
- id: string;
206
- data: T;
207
- }>>;
208
- count(where?: WhereClause): Promise<number>;
209
- }
210
- /**
211
- * Plugin storage context - typed based on declared collections
212
- */
213
- type PluginStorage<T extends PluginStorageConfig> = { [K in keyof T]: StorageCollection };
214
- /**
215
- * KV store interface - unified replacement for settings + options
216
- *
217
- * Convention:
218
- * - `settings:*` - User-configurable preferences (shown in admin UI)
219
- * - `state:*` - Internal plugin state (not shown to users)
220
- */
221
- interface KVAccess {
222
- get<T>(key: string): Promise<T | null>;
223
- set(key: string, value: unknown): Promise<void>;
224
- delete(key: string): Promise<boolean>;
225
- list(prefix?: string): Promise<Array<{
226
- key: string;
227
- value: unknown;
228
- }>>;
229
- }
230
- /**
231
- * SEO metadata for a content item, as stored in the core SEO panel.
232
- *
233
- * Only present on items in collections with `has_seo = 1`. For collections
234
- * without SEO enabled, `ContentItem.seo` is `undefined`.
235
- */
236
- interface ContentItemSeo {
237
- title: string | null;
238
- description: string | null;
239
- image: string | null;
240
- canonical: string | null;
241
- noIndex: boolean;
242
- }
243
- /**
244
- * SEO input accepted by content write operations.
245
- *
246
- * All fields are optional — only fields that are present overwrite existing
247
- * values. An empty object is treated as a no-op.
248
- */
249
- interface ContentItemSeoInput {
250
- title?: string | null;
251
- description?: string | null;
252
- image?: string | null;
253
- canonical?: string | null;
254
- noIndex?: boolean;
255
- }
256
- /**
257
- * Content item returned from content API
258
- */
259
- interface ContentItem {
260
- id: string;
261
- type: string;
262
- slug: string | null;
263
- status: string;
264
- data: Record<string, unknown>;
265
- /**
266
- * SEO metadata, populated when the collection has SEO enabled
267
- * (`has_seo = 1`). `undefined` for non-SEO collections.
268
- */
269
- seo?: ContentItemSeo;
270
- createdAt: string;
271
- updatedAt: string;
272
- publishedAt: string | null;
273
- locale: string | null;
274
- }
275
- /**
276
- * Content filters supported by the plugin content API.
277
- */
278
- interface ContentListWhere {
279
- status?: string;
280
- locale?: string;
281
- }
282
- /**
283
- * Content list options
284
- */
285
- interface ContentListOptions {
286
- where?: ContentListWhere;
287
- limit?: number;
288
- cursor?: string;
289
- orderBy?: Record<string, "asc" | "desc">;
290
- }
291
- /**
292
- * Input accepted by `content.create` / `content.update`.
293
- *
294
- * Most entries are field slugs mapped to their values. The reserved `seo`
295
- * key is extracted and routed to the core SEO panel (the `_dineway_seo`
296
- * table), matching the shape accepted by the REST API. Passing `seo` for a
297
- * collection that does not have SEO enabled throws a validation error.
298
- */
299
- type ContentWriteInput = Record<string, unknown> & {
300
- seo?: ContentItemSeoInput;
301
- };
302
- /**
303
- * Content access interface - capability-gated
304
- */
305
- interface ContentAccess {
306
- get(collection: string, id: string): Promise<ContentItem | null>;
307
- list(collection: string, options?: ContentListOptions): Promise<PaginatedResult<ContentItem>>;
308
- create?(collection: string, data: ContentWriteInput): Promise<ContentItem>;
309
- update?(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;
310
- delete?(collection: string, id: string): Promise<boolean>;
311
- }
312
- /**
313
- * Full content access with write operations
314
- */
315
- interface ContentAccessWithWrite extends ContentAccess {
316
- create(collection: string, data: ContentWriteInput): Promise<ContentItem>;
317
- update(collection: string, id: string, data: ContentWriteInput): Promise<ContentItem>;
318
- delete(collection: string, id: string): Promise<boolean>;
319
- }
320
- /**
321
- * Media item returned from media API
322
- */
323
- interface MediaItem {
324
- id: string;
325
- filename: string;
326
- mimeType: string;
327
- size: number | null;
328
- url: string;
329
- createdAt: string;
330
- }
331
- /**
332
- * Media list options
333
- */
334
- interface MediaListOptions {
335
- limit?: number;
336
- cursor?: string;
337
- mimeType?: string;
338
- }
339
- /**
340
- * Media access interface - capability-gated
341
- */
342
- interface MediaAccess {
343
- get(id: string): Promise<MediaItem | null>;
344
- list(options?: MediaListOptions): Promise<PaginatedResult<MediaItem>>;
345
- getUploadUrl?(filename: string, contentType: string): Promise<{
346
- uploadUrl: string;
347
- mediaId: string;
348
- }>;
349
- /**
350
- * Upload media bytes directly. Preferred in sandboxed mode where
351
- * plugins cannot make external requests to a presigned URL.
352
- * Returns the created media item.
353
- */
354
- upload?(filename: string, contentType: string, bytes: ArrayBuffer): Promise<{
355
- mediaId: string;
356
- storageKey: string;
357
- url: string;
358
- }>;
359
- delete?(id: string): Promise<boolean>;
360
- }
361
- /**
362
- * Full media access with write operations
363
- */
364
- interface MediaAccessWithWrite extends MediaAccess {
365
- getUploadUrl(filename: string, contentType: string): Promise<{
366
- uploadUrl: string;
367
- mediaId: string;
368
- }>;
369
- upload(filename: string, contentType: string, bytes: ArrayBuffer): Promise<{
370
- mediaId: string;
371
- storageKey: string;
372
- url: string;
373
- }>;
374
- delete(id: string): Promise<boolean>;
375
- }
376
- /**
377
- * HTTP client interface - requires network:request capability
378
- */
379
- interface HttpAccess {
380
- fetch(url: string, init?: RequestInit): Promise<Response>;
381
- }
382
- /**
383
- * Logger interface - always available
384
- */
385
- interface LogAccess {
386
- debug(message: string, data?: unknown): void;
387
- info(message: string, data?: unknown): void;
388
- warn(message: string, data?: unknown): void;
389
- error(message: string, data?: unknown): void;
390
- }
391
- /**
392
- * Site information available to all plugins
393
- */
394
- interface SiteInfo {
395
- /** Site name (from settings) */
396
- name: string;
397
- /** Site URL (from settings or request) */
398
- url: string;
399
- /** Site locale (from settings, defaults to "en") */
400
- locale: string;
401
- }
402
- /**
403
- * Read-only user information exposed to plugins.
404
- * Sensitive fields (password hashes, sessions, passkeys) are excluded.
405
- */
406
- interface UserInfo {
407
- id: string;
408
- email: string;
409
- name: string | null;
410
- role: number;
411
- createdAt: string;
412
- }
413
- /**
414
- * User access interface - requires users:read capability
415
- */
416
- interface UserAccess {
417
- /** Get a user by ID */
418
- get(id: string): Promise<UserInfo | null>;
419
- /** Get a user by email */
420
- getByEmail(email: string): Promise<UserInfo | null>;
421
- /** List users with optional filters */
422
- list(opts?: {
423
- role?: number;
424
- limit?: number;
425
- cursor?: string;
426
- }): Promise<{
427
- items: UserInfo[];
428
- nextCursor?: string;
429
- }>;
430
- }
431
- /**
432
- * The unified plugin context - same shape for all hooks and routes
433
- */
434
- interface PluginContext<TStorage extends PluginStorageConfig = PluginStorageConfig> {
435
- /** Plugin metadata */
436
- plugin: {
437
- id: string;
438
- version: string;
439
- };
440
- /** Storage collections - only if plugin declares storage */
441
- storage: PluginStorage<TStorage>;
442
- /** Key-value store for config and state */
443
- kv: KVAccess;
444
- /** Content access - only if content:read or content:write capability */
445
- content?: ContentAccess | ContentAccessWithWrite;
446
- /** Media access - only if media:read or media:write capability */
447
- media?: MediaAccess | MediaAccessWithWrite;
448
- /** HTTP client - only if network:request capability */
449
- http?: HttpAccess;
450
- /** Logger - always available */
451
- log: LogAccess;
452
- /** Site information - always available */
453
- site: SiteInfo;
454
- /** URL helper - generates absolute URLs from paths. Always available. */
455
- url(path: string): string;
456
- /** User access - only if users:read capability */
457
- users?: UserAccess;
458
- /** Cron task scheduling - always available, scoped to plugin */
459
- cron?: CronAccess;
460
- /** Email access - only if email:send capability and a provider is configured */
461
- email?: EmailAccess;
462
- }
463
- /**
464
- * Cron access interface �� always available on plugin context, scoped to plugin.
465
- */
466
- interface CronAccess {
467
- /** Schedule a recurring or one-shot task */
468
- schedule(name: string, opts: {
469
- schedule: string;
470
- data?: Record<string, unknown>;
471
- }): Promise<void>;
472
- /** Cancel a scheduled task */
473
- cancel(name: string): Promise<void>;
474
- /** List this plugin's scheduled tasks */
475
- list(): Promise<CronTaskInfo[]>;
476
- }
477
- /**
478
- * Task info returned from CronAccess.list()
479
- */
480
- interface CronTaskInfo {
481
- name: string;
482
- schedule: string;
483
- nextRunAt: string;
484
- lastRunAt: string | null;
485
- }
486
- /**
487
- * Event passed to the `cron` hook handler
488
- */
489
- interface CronEvent {
490
- name: string;
491
- data?: Record<string, unknown>;
492
- scheduledAt: string;
493
- }
494
- /**
495
- * Cron hook handler type
496
- */
497
- type CronHandler = (event: CronEvent, ctx: PluginContext) => Promise<void>;
498
- /**
499
- * Email access interface — requires `email:send` capability.
500
- * Undefined when no `email:deliver` provider is configured.
501
- *
502
- * Related capabilities:
503
- * - `email:send` — grants ctx.email (this interface)
504
- * - `hooks.email-transport:register` — allows registering the `email:deliver` exclusive hook
505
- * - `hooks.email-events:register` — allows registering `email:beforeSend` / `email:afterSend` hooks
506
- */
507
- interface EmailAccess {
508
- send(message: EmailMessage): Promise<void>;
509
- }
510
- /**
511
- * Email message shape
512
- */
513
- interface EmailMessage {
514
- to: string;
515
- subject: string;
516
- text: string;
517
- html?: string;
518
- }
519
- /**
520
- * Event passed to email:beforeSend hooks (middleware — transform, validate, cancel)
521
- */
522
- interface EmailBeforeSendEvent {
523
- message: EmailMessage;
524
- /** Where the email originated — "system" for auth emails, plugin ID for plugin emails */
525
- source: string;
526
- }
527
- /**
528
- * Event passed to email:deliver hook (exclusive — exactly one provider delivers)
529
- */
530
- interface EmailDeliverEvent {
531
- message: EmailMessage;
532
- source: string;
533
- }
534
- /**
535
- * Event passed to email:afterSend hooks (logging, analytics, fire-and-forget)
536
- */
537
- interface EmailAfterSendEvent {
538
- message: EmailMessage;
539
- source: string;
540
- }
541
- /**
542
- * Handler type for email:beforeSend hooks.
543
- * Returns modified message, or false to cancel delivery.
544
- */
545
- type EmailBeforeSendHandler = (event: EmailBeforeSendEvent, ctx: PluginContext) => Promise<EmailMessage | false>;
546
- /**
547
- * Handler type for email:deliver hooks (exclusive provider).
548
- */
549
- type EmailDeliverHandler = (event: EmailDeliverEvent, ctx: PluginContext) => Promise<void>;
550
- /**
551
- * Handler type for email:afterSend hooks (fire-and-forget).
552
- */
553
- type EmailAfterSendHandler = (event: EmailAfterSendEvent, ctx: PluginContext) => Promise<void>;
554
- /**
555
- * Collection comment settings (read from _dineway_collections)
556
- */
557
- interface CollectionCommentSettings {
558
- commentsEnabled: boolean;
559
- commentsModeration: "all" | "first_time" | "none";
560
- commentsClosedAfterDays: number;
561
- commentsAutoApproveUsers: boolean;
562
- }
563
- /**
564
- * Event passed to comment:beforeCreate hooks (middleware — transform, enrich, reject)
565
- */
566
- interface CommentBeforeCreateEvent {
567
- comment: {
568
- collection: string;
569
- contentId: string;
570
- parentId: string | null;
571
- authorName: string;
572
- authorEmail: string;
573
- authorUserId: string | null;
574
- body: string;
575
- ipHash: string | null;
576
- userAgent: string | null;
577
- };
578
- /** Metadata bag — plugins can attach signals for the moderator */
579
- metadata: Record<string, unknown>;
580
- }
581
- /**
582
- * Event passed to comment:moderate hook (exclusive — decides initial status)
583
- */
584
- interface CommentModerateEvent {
585
- comment: CommentBeforeCreateEvent["comment"];
586
- metadata: Record<string, unknown>;
587
- collectionSettings: CollectionCommentSettings;
588
- /** Number of prior approved comments from this email address */
589
- priorApprovedCount: number;
590
- }
591
- /**
592
- * Moderation decision returned by the comment:moderate handler
593
- */
594
- interface ModerationDecision {
595
- status: "approved" | "pending" | "spam";
596
- /** Optional reason for admin visibility */
597
- reason?: string;
598
- }
599
- /**
600
- * Stored comment shape (full record with id, status, timestamps)
601
- */
602
- interface StoredComment {
603
- id: string;
604
- collection: string;
605
- contentId: string;
606
- parentId: string | null;
607
- authorName: string;
608
- authorEmail: string;
609
- authorUserId: string | null;
610
- body: string;
611
- status: string;
612
- moderationMetadata: Record<string, unknown> | null;
613
- createdAt: string;
614
- updatedAt: string;
615
- }
616
- /**
617
- * Event passed to comment:afterCreate hooks (fire-and-forget)
618
- */
619
- interface CommentAfterCreateEvent {
620
- comment: StoredComment;
621
- metadata: Record<string, unknown>;
622
- /** The content item the comment is on */
623
- content: {
624
- id: string;
625
- collection: string;
626
- slug: string;
627
- title?: string;
628
- };
629
- /** The content author (for notifications) */
630
- contentAuthor?: {
631
- id: string;
632
- name: string | null;
633
- email: string;
634
- };
635
- }
636
- /**
637
- * Event passed to comment:afterModerate hooks (fire-and-forget, admin status change)
638
- */
639
- interface CommentAfterModerateEvent {
640
- comment: StoredComment;
641
- previousStatus: string;
642
- newStatus: string;
643
- /** The admin who moderated */
644
- moderator: {
645
- id: string;
646
- name: string | null;
647
- };
648
- }
649
- /**
650
- * Handler type for comment:beforeCreate hooks.
651
- * Returns modified event, or false to reject the comment.
652
- */
653
- type CommentBeforeCreateHandler = (event: CommentBeforeCreateEvent, ctx: PluginContext) => Promise<CommentBeforeCreateEvent | false | void>;
654
- /**
655
- * Handler type for comment:moderate hook (exclusive provider).
656
- */
657
- type CommentModerateHandler = (event: CommentModerateEvent, ctx: PluginContext) => Promise<ModerationDecision>;
658
- /**
659
- * Handler type for comment:afterCreate hooks (fire-and-forget).
660
- */
661
- type CommentAfterCreateHandler = (event: CommentAfterCreateEvent, ctx: PluginContext) => Promise<void>;
662
- /**
663
- * Handler type for comment:afterModerate hooks (fire-and-forget).
664
- */
665
- type CommentAfterModerateHandler = (event: CommentAfterModerateEvent, ctx: PluginContext) => Promise<void>;
666
- /**
667
- * Hook configuration
668
- */
669
- interface HookConfig<THandler> {
670
- /** Explicit ordering - lower numbers run first (default: 100) */
671
- priority?: number;
672
- /** Max execution time in ms (default: 5000) */
673
- timeout?: number;
674
- /** Run after these plugins */
675
- dependencies?: string[];
676
- /** Error handling policy */
677
- errorPolicy?: "continue" | "abort";
678
- /**
679
- * Mark this hook as exclusive — only one plugin can be the active provider.
680
- * Exclusive hooks skip the priority pipeline and dispatch only to the
681
- * admin-selected provider. Used for email:deliver, search, image optimization, etc.
682
- */
683
- exclusive?: boolean;
684
- /** The hook handler */
685
- handler: THandler;
686
- }
687
- /**
688
- * Content hook event
689
- */
690
- interface ContentHookEvent {
691
- content: Record<string, unknown>;
692
- collection: string;
693
- isNew: boolean;
694
- }
695
- /**
696
- * Content delete hook event
697
- */
698
- interface ContentDeleteEvent {
699
- id: string;
700
- collection: string;
701
- permanent: boolean;
702
- }
703
- /**
704
- * Content publish state change hook event (fired after publish or unpublish)
705
- */
706
- interface ContentPublishStateChangeEvent {
707
- content: Record<string, unknown>;
708
- collection: string;
709
- }
710
- /**
711
- * Media hook event
712
- */
713
- interface MediaUploadEvent {
714
- file: {
715
- name: string;
716
- type: string;
717
- size: number;
718
- };
719
- }
720
- /**
721
- * Media after upload event
722
- */
723
- interface MediaAfterUploadEvent {
724
- media: MediaItem;
725
- }
726
- /**
727
- * Lifecycle hook event
728
- */
729
- interface LifecycleEvent {}
730
- /**
731
- * Uninstall hook event
732
- */
733
- interface UninstallEvent {
734
- deleteData: boolean;
735
- }
736
- type ContentBeforeSaveHandler = (event: ContentHookEvent, ctx: PluginContext) => Promise<Record<string, unknown> | void>;
737
- type ContentAfterSaveHandler = (event: ContentHookEvent, ctx: PluginContext) => Promise<void>;
738
- type ContentBeforeDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext) => Promise<boolean | void>;
739
- type ContentAfterDeleteHandler = (event: ContentDeleteEvent, ctx: PluginContext) => Promise<void>;
740
- type ContentAfterPublishHandler = (event: ContentPublishStateChangeEvent, ctx: PluginContext) => Promise<void>;
741
- type ContentAfterUnpublishHandler = (event: ContentPublishStateChangeEvent, ctx: PluginContext) => Promise<void>;
742
- type MediaBeforeUploadHandler = (event: MediaUploadEvent, ctx: PluginContext) => Promise<{
743
- name: string;
744
- type: string;
745
- size: number;
746
- } | void>;
747
- type MediaAfterUploadHandler = (event: MediaAfterUploadEvent, ctx: PluginContext) => Promise<void>;
748
- type LifecycleHandler = (event: LifecycleEvent, ctx: PluginContext) => Promise<void>;
749
- type UninstallHandler = (event: UninstallEvent, ctx: PluginContext) => Promise<void>;
750
- /** Placement targets for page fragment contributions */
751
- type PagePlacement = "head" | "body:start" | "body:end";
752
- /**
753
- * A single breadcrumb trail item. Used by `PublicPageContext.breadcrumbs`
754
- * so themes can publish breadcrumb trails that SEO plugins consume.
755
- */
756
- interface BreadcrumbItem {
757
- /** Display name for this crumb (e.g. "Home", "Blog", "My Post"). */
758
- name: string;
759
- /** Absolute or root-relative URL for this crumb. */
760
- url: string;
761
- }
762
- /**
763
- * Describes the page being rendered. Passed to page hooks so plugins
764
- * can decide what to contribute without fetching content themselves.
765
- */
766
- interface PublicPageContext {
767
- url: string;
768
- path: string;
769
- locale: string | null;
770
- kind: "content" | "custom";
771
- pageType: string;
772
- /** Full document title for the rendered page */
773
- title: string | null;
774
- /** Page-only title for OG/Twitter/JSON-LD headline output */
775
- pageTitle?: string | null;
776
- description: string | null;
777
- canonical: string | null;
778
- image: string | null;
779
- content?: {
780
- collection: string;
781
- id: string;
782
- slug: string | null;
783
- };
784
- /** SEO meta for base metadata generation in DinewayHead */
785
- seo?: {
786
- ogTitle?: string | null;
787
- ogDescription?: string | null;
788
- ogImage?: string | null;
789
- robots?: string | null;
790
- };
791
- /** Article metadata for Open Graph article: tags */
792
- articleMeta?: {
793
- publishedTime?: string | null;
794
- modifiedTime?: string | null;
795
- author?: string | null;
796
- };
797
- /** Site name for structured data and og:site_name */
798
- siteName?: string;
799
- /**
800
- * Optional breadcrumb trail for this page, root first. When set,
801
- * SEO plugins should use this verbatim rather than deriving a trail
802
- * from `path`. Themes typically populate this at the point they
803
- * build the context (e.g. from a content hierarchy walk, taxonomy
804
- * lookup, or per-`pageType` routing logic).
805
- *
806
- * Semantics for consumers:
807
- * - `undefined` — theme has no opinion; consumer falls back to
808
- * its own derivation.
809
- * - `[]` — this page has no breadcrumbs (e.g. homepage); consumer
810
- * should skip `BreadcrumbList` emission entirely.
811
- * - Non-empty array — used verbatim for `BreadcrumbList` output.
812
- */
813
- breadcrumbs?: BreadcrumbItem[];
814
- /** Public-facing site URL (origin) for structured data */
815
- siteUrl?: string;
816
- }
817
- interface PageMetadataEvent {
818
- page: PublicPageContext;
819
- }
820
- /**
821
- * Allowed rel values for link contributions.
822
- * This is a security-critical allowlist -- sandboxed plugins can only inject
823
- * link tags with these rel values. Adding "stylesheet", "prefetch", "prerender"
824
- * etc. would allow sandboxed plugins to inject external resources.
825
- */
826
- type PageMetadataLinkRel = "canonical" | "alternate" | "author" | "license" | "nlweb" | "site.standard.document";
827
- type PageMetadataContribution = {
828
- kind: "meta";
829
- name: string;
830
- content: string;
831
- key?: string;
832
- } | {
833
- kind: "property";
834
- property: string;
835
- content: string;
836
- key?: string;
837
- } | {
838
- kind: "link";
839
- rel: PageMetadataLinkRel;
840
- href: string;
841
- hreflang?: string;
842
- key?: string;
843
- } | {
844
- kind: "jsonld";
845
- id?: string;
846
- graph: Record<string, unknown> | Array<Record<string, unknown>>;
847
- };
848
- type PageMetadataHandler = (event: PageMetadataEvent, ctx: PluginContext) => PageMetadataContribution | PageMetadataContribution[] | null | Promise<PageMetadataContribution | PageMetadataContribution[] | null>;
849
- interface PageFragmentEvent {
850
- page: PublicPageContext;
851
- }
852
- type PageFragmentContribution = {
853
- kind: "external-script";
854
- placement: PagePlacement;
855
- src: string;
856
- async?: boolean;
857
- defer?: boolean;
858
- attributes?: Record<string, string>;
859
- key?: string;
860
- } | {
861
- kind: "inline-script";
862
- placement: PagePlacement;
863
- code: string;
864
- attributes?: Record<string, string>;
865
- key?: string;
866
- } | {
867
- kind: "html";
868
- placement: PagePlacement;
869
- html: string;
870
- key?: string;
871
- };
872
- type PageFragmentHandler = (event: PageFragmentEvent, ctx: PluginContext) => PageFragmentContribution | PageFragmentContribution[] | null | Promise<PageFragmentContribution | PageFragmentContribution[] | null>;
873
- /**
874
- * Plugin hooks definition
875
- */
876
- interface PluginHooks {
877
- "plugin:install"?: HookConfig<LifecycleHandler> | LifecycleHandler;
878
- "plugin:activate"?: HookConfig<LifecycleHandler> | LifecycleHandler;
879
- "plugin:deactivate"?: HookConfig<LifecycleHandler> | LifecycleHandler;
880
- "plugin:uninstall"?: HookConfig<UninstallHandler> | UninstallHandler;
881
- "content:beforeSave"?: HookConfig<ContentBeforeSaveHandler> | ContentBeforeSaveHandler;
882
- "content:afterSave"?: HookConfig<ContentAfterSaveHandler> | ContentAfterSaveHandler;
883
- "content:beforeDelete"?: HookConfig<ContentBeforeDeleteHandler> | ContentBeforeDeleteHandler;
884
- "content:afterDelete"?: HookConfig<ContentAfterDeleteHandler> | ContentAfterDeleteHandler;
885
- "content:afterPublish"?: HookConfig<ContentAfterPublishHandler> | ContentAfterPublishHandler;
886
- "content:afterUnpublish"?: HookConfig<ContentAfterUnpublishHandler> | ContentAfterUnpublishHandler;
887
- "media:beforeUpload"?: HookConfig<MediaBeforeUploadHandler> | MediaBeforeUploadHandler;
888
- "media:afterUpload"?: HookConfig<MediaAfterUploadHandler> | MediaAfterUploadHandler;
889
- cron?: HookConfig<CronHandler> | CronHandler;
890
- "email:beforeSend"?: HookConfig<EmailBeforeSendHandler> | EmailBeforeSendHandler;
891
- "email:deliver"?: HookConfig<EmailDeliverHandler> | EmailDeliverHandler;
892
- "email:afterSend"?: HookConfig<EmailAfterSendHandler> | EmailAfterSendHandler;
893
- "comment:beforeCreate"?: HookConfig<CommentBeforeCreateHandler> | CommentBeforeCreateHandler;
894
- "comment:moderate"?: HookConfig<CommentModerateHandler> | CommentModerateHandler;
895
- "comment:afterCreate"?: HookConfig<CommentAfterCreateHandler> | CommentAfterCreateHandler;
896
- "comment:afterModerate"?: HookConfig<CommentAfterModerateHandler> | CommentAfterModerateHandler;
897
- "page:metadata"?: HookConfig<PageMetadataHandler> | PageMetadataHandler;
898
- "page:fragments"?: HookConfig<PageFragmentHandler> | PageFragmentHandler;
899
- }
900
- /**
901
- * Hook names
902
- */
903
- type HookName = keyof PluginHooks;
904
- /**
905
- * Hook metadata entry in a plugin manifest.
906
- * Replaces the plain hook name string with structured metadata.
907
- */
908
- interface ManifestHookEntry {
909
- name: string;
910
- exclusive?: boolean;
911
- priority?: number;
912
- timeout?: number;
913
- }
914
- /**
915
- * Route metadata entry in a plugin manifest.
916
- * Replaces the plain route name string with structured metadata.
917
- */
918
- interface ManifestRouteEntry {
919
- name: string;
920
- public?: boolean;
921
- }
922
- /**
923
- * Resolved hook with normalized config
924
- */
925
- interface ResolvedHook<THandler> {
926
- priority: number;
927
- timeout: number;
928
- dependencies: string[];
929
- errorPolicy: "continue" | "abort";
930
- /** Whether this hook is exclusive (provider pattern) */
931
- exclusive: boolean;
932
- handler: THandler;
933
- pluginId: string;
934
- }
935
- /**
936
- * Geographic location information derived from the request.
937
- * Available when the host runtime provides geographic request metadata
938
- * (for example via a `request.cf` object).
939
- */
940
- interface GeoInfo {
941
- country: string | null;
942
- region: string | null;
943
- city: string | null;
944
- }
945
- /**
946
- * Normalized request metadata available to plugin route handlers.
947
- * Extracted from request headers and platform-specific properties.
948
- */
949
- interface RequestMeta {
950
- ip: string | null;
951
- userAgent: string | null;
952
- referer: string | null;
953
- geo: GeoInfo | null;
954
- }
955
- /**
956
- * Route handler context extends plugin context with request-specific data
957
- */
958
- interface RouteContext<TInput = unknown> extends PluginContext {
959
- /** Validated input from request body */
960
- input: TInput;
961
- /** Original request */
962
- request: Request;
963
- /** Normalized request metadata (IP, user agent, geo) */
964
- requestMeta: RequestMeta;
965
- }
966
- /**
967
- * Route definition
968
- */
969
- interface PluginRoute<TInput = unknown> {
970
- /** Zod schema for input validation */
971
- input?: z.ZodType<TInput>;
972
- /**
973
- * Mark this route as publicly accessible (no authentication required).
974
- * Public routes skip session/token auth and CSRF checks.
975
- */
976
- public?: boolean;
977
- /** Route handler */
978
- handler: (ctx: RouteContext<TInput>) => Promise<unknown>;
979
- }
980
- /**
981
- * Admin page definition
982
- */
983
- interface PluginAdminPage {
984
- path: string;
985
- label: string;
986
- icon?: string;
987
- }
988
- /**
989
- * Dashboard widget definition
990
- */
991
- interface PluginDashboardWidget {
992
- id: string;
993
- size?: "full" | "half" | "third";
994
- title?: string;
995
- }
996
- /**
997
- * Settings field types (for admin UI generation)
998
- */
999
- type SettingFieldType = "string" | "number" | "boolean" | "select" | "secret" | "url" | "email";
1000
- interface BaseSettingField {
1001
- type: SettingFieldType;
1002
- label: string;
1003
- description?: string;
1004
- }
1005
- interface StringSettingField extends BaseSettingField {
1006
- type: "string";
1007
- default?: string;
1008
- multiline?: boolean;
1009
- }
1010
- interface NumberSettingField extends BaseSettingField {
1011
- type: "number";
1012
- default?: number;
1013
- min?: number;
1014
- max?: number;
1015
- }
1016
- interface BooleanSettingField extends BaseSettingField {
1017
- type: "boolean";
1018
- default?: boolean;
1019
- }
1020
- interface SelectSettingField extends BaseSettingField {
1021
- type: "select";
1022
- options: Array<{
1023
- value: string;
1024
- label: string;
1025
- }>;
1026
- default?: string;
1027
- }
1028
- interface SecretSettingField extends BaseSettingField {
1029
- type: "secret";
1030
- }
1031
- interface UrlSettingField extends BaseSettingField {
1032
- type: "url";
1033
- default?: string;
1034
- placeholder?: string;
1035
- }
1036
- interface EmailSettingField extends BaseSettingField {
1037
- type: "email";
1038
- default?: string;
1039
- placeholder?: string;
1040
- }
1041
- type SettingField = StringSettingField | NumberSettingField | BooleanSettingField | SelectSettingField | SecretSettingField | UrlSettingField | EmailSettingField;
1042
- /**
1043
- * Block Kit element for block editing fields.
1044
- * This is the `Element` discriminated union from `@dineway-ai/blocks`.
1045
- * Plugin authors should use `@dineway-ai/blocks` builder functions to create these.
1046
- */
1047
- type PortableTextBlockField = Element;
1048
- /**
1049
- * Configuration for a Portable Text block type contributed by a plugin
1050
- */
1051
- interface PortableTextBlockConfig {
1052
- /** Block type name (must match the `_type` in Portable Text) */
1053
- type: string;
1054
- /** Human-readable label shown in slash commands and modals */
1055
- label: string;
1056
- /** Icon key (e.g., "video", "code", "link", "link-external") */
1057
- icon?: string;
1058
- /** Description shown in slash command menu */
1059
- description?: string;
1060
- /** Placeholder text for the URL input */
1061
- placeholder?: string;
1062
- /** Block Kit form fields for the editing UI. If declared, replaces the simple URL input. */
1063
- fields?: PortableTextBlockField[];
1064
- /**
1065
- * Optional display category in the slash menu. Defaults to "Embeds".
1066
- *
1067
- * Plugin authors should pick a meaningful category that reflects what the
1068
- * block actually is, for example "Sections", "Marketing", "Media",
1069
- * "Embeds", or "Layout".
1070
- */
1071
- category?: string;
1072
- }
1073
- /**
1074
- * Configuration for a field widget type contributed by a plugin.
1075
- * A field widget provides a custom editing UI for a schema field.
1076
- * The field references the widget via `widget: "pluginId:widgetName"`.
1077
- */
1078
- interface FieldWidgetConfig {
1079
- /** Widget name (without plugin ID prefix) */
1080
- name: string;
1081
- /** Human-readable label for the admin UI */
1082
- label: string;
1083
- /** Which field types this widget can edit (e.g., ["json", "string"]) */
1084
- fieldTypes: FieldType[];
1085
- /** Block Kit elements for sandboxed rendering. Omit for trusted plugins using React. */
1086
- elements?: Element[];
1087
- }
1088
- /**
1089
- * Admin configuration
1090
- */
1091
- interface PluginAdminConfig {
1092
- /** Module specifier for admin UI exports (e.g., "@dineway-ai/plugin-audit-log/admin") */
1093
- entry?: string;
1094
- /** Settings schema for auto-generated UI */
1095
- settingsSchema?: Record<string, SettingField>;
1096
- /** Admin pages */
1097
- pages?: PluginAdminPage[];
1098
- /** Dashboard widgets */
1099
- widgets?: PluginDashboardWidget[];
1100
- /** Portable Text block types this plugin provides */
1101
- portableTextBlocks?: PortableTextBlockConfig[];
1102
- /** Field widget types this plugin provides */
1103
- fieldWidgets?: FieldWidgetConfig[];
1104
- }
1105
- /**
1106
- * Plugin definition - input to definePlugin()
1107
- */
1108
- interface PluginDefinition<TStorage extends PluginStorageConfig = PluginStorageConfig> {
1109
- /** Unique plugin identifier */
1110
- id: string;
1111
- /** Plugin version (semver) */
1112
- version: string;
1113
- /** Declared capabilities */
1114
- capabilities?: PluginCapability[];
1115
- /** Allowed hosts for network:request (wildcards supported: *.example.com) */
1116
- allowedHosts?: string[];
1117
- /** Storage collections with indexes */
1118
- storage?: TStorage;
1119
- /** Hooks */
1120
- hooks?: PluginHooks;
1121
- /** API routes */
1122
- routes?: Record<string, PluginRoute>;
1123
- /** Admin UI configuration */
1124
- admin?: PluginAdminConfig;
1125
- }
1126
- /**
1127
- * Resolved plugin - after definePlugin() processing
1128
- */
1129
- interface ResolvedPlugin<TStorage extends PluginStorageConfig = PluginStorageConfig> {
1130
- id: string;
1131
- version: string;
1132
- capabilities: PluginCapability[];
1133
- allowedHosts: string[];
1134
- storage: TStorage;
1135
- hooks: ResolvedPluginHooks;
1136
- routes: Record<string, PluginRoute>;
1137
- admin: PluginAdminConfig;
1138
- }
1139
- /**
1140
- * Resolved hooks with normalized config
1141
- */
1142
- interface ResolvedPluginHooks {
1143
- "plugin:install"?: ResolvedHook<LifecycleHandler>;
1144
- "plugin:activate"?: ResolvedHook<LifecycleHandler>;
1145
- "plugin:deactivate"?: ResolvedHook<LifecycleHandler>;
1146
- "plugin:uninstall"?: ResolvedHook<UninstallHandler>;
1147
- "content:beforeSave"?: ResolvedHook<ContentBeforeSaveHandler>;
1148
- "content:afterSave"?: ResolvedHook<ContentAfterSaveHandler>;
1149
- "content:beforeDelete"?: ResolvedHook<ContentBeforeDeleteHandler>;
1150
- "content:afterDelete"?: ResolvedHook<ContentAfterDeleteHandler>;
1151
- "content:afterPublish"?: ResolvedHook<ContentAfterPublishHandler>;
1152
- "content:afterUnpublish"?: ResolvedHook<ContentAfterUnpublishHandler>;
1153
- "media:beforeUpload"?: ResolvedHook<MediaBeforeUploadHandler>;
1154
- "media:afterUpload"?: ResolvedHook<MediaAfterUploadHandler>;
1155
- cron?: ResolvedHook<CronHandler>;
1156
- "email:beforeSend"?: ResolvedHook<EmailBeforeSendHandler>;
1157
- "email:deliver"?: ResolvedHook<EmailDeliverHandler>;
1158
- "email:afterSend"?: ResolvedHook<EmailAfterSendHandler>;
1159
- "comment:beforeCreate"?: ResolvedHook<CommentBeforeCreateHandler>;
1160
- "comment:moderate"?: ResolvedHook<CommentModerateHandler>;
1161
- "comment:afterCreate"?: ResolvedHook<CommentAfterCreateHandler>;
1162
- "comment:afterModerate"?: ResolvedHook<CommentAfterModerateHandler>;
1163
- "page:metadata"?: ResolvedHook<PageMetadataHandler>;
1164
- "page:fragments"?: ResolvedHook<PageFragmentHandler>;
1165
- }
1166
- /**
1167
- * Standard plugin hook handler -- same as sandbox entry format.
1168
- * Receives the event as the first argument and a PluginContext as the second.
1169
- *
1170
- * Plugin authors annotate their event parameters with specific types for IDE
1171
- * support. At the type level, we accept any function with compatible arity.
1172
- */
1173
- type StandardHookHandler = (...args: any[]) => Promise<any>;
1174
- /**
1175
- * Standard plugin hook entry -- either a bare handler or a config object.
1176
- */
1177
- type StandardHookEntry = StandardHookHandler | {
1178
- handler: StandardHookHandler;
1179
- priority?: number;
1180
- timeout?: number;
1181
- dependencies?: string[];
1182
- errorPolicy?: "continue" | "abort";
1183
- exclusive?: boolean;
1184
- };
1185
- /**
1186
- * Standard plugin route handler -- takes (routeCtx, pluginCtx) like sandbox entries.
1187
- * The routeCtx contains input and request info; pluginCtx is the full plugin context.
1188
- *
1189
- * Uses `any` for routeCtx to allow plugins to access properties like
1190
- * `routeCtx.request.url` without needing exact type matches across
1191
- * trusted (Request object) and sandboxed (plain object) modes.
1192
- */
1193
- type StandardRouteHandler = (routeCtx: any, ctx: PluginContext) => Promise<unknown>;
1194
- /**
1195
- * Standard plugin route entry -- either a config object with handler, or just a handler.
1196
- */
1197
- interface StandardRouteEntry {
1198
- handler: StandardRouteHandler;
1199
- input?: unknown;
1200
- public?: boolean;
1201
- }
1202
- /**
1203
- * Standard plugin definition -- the sandbox entry format.
1204
- * Used by standard plugins that work in both trusted and sandboxed modes.
1205
- * No id/version/capabilities -- those come from the descriptor.
1206
- *
1207
- * This is the input to definePlugin() for standard-format plugins.
1208
- *
1209
- * The hooks and routes use permissive types (Record<string, any>) so that
1210
- * plugin authors can annotate their handlers with specific event types
1211
- * without type errors from strictFunctionTypes contravariance.
1212
- */
1213
- interface StandardPluginDefinition {
1214
- hooks?: Record<string, any>;
1215
- routes?: Record<string, any>;
1216
- }
1217
- /**
1218
- * Check if a value is a StandardPluginDefinition (has hooks/routes but no id/version).
1219
- */
1220
- declare function isStandardPluginDefinition(value: unknown): value is StandardPluginDefinition;
1221
- /**
1222
- * What a plugin exports from its /admin entrypoint
1223
- * Uses generic component type to avoid React dependency
1224
- */
1225
- interface PluginAdminExports {
1226
- widgets?: Record<string, JSX.Element>;
1227
- pages?: Record<string, JSX.Element>;
1228
- fields?: Record<string, JSX.Element>;
1229
- }
1230
- /**
1231
- * Plugin manifest - the metadata portion of a plugin bundle
1232
- * Used for sandboxed plugins loaded from marketplace
1233
- */
1234
- interface PluginManifest {
1235
- id: string;
1236
- version: string;
1237
- capabilities: PluginCapability[];
1238
- allowedHosts: string[];
1239
- storage: PluginStorageConfig;
1240
- /** Hook declarations — either plain name strings or structured objects */
1241
- hooks: Array<ManifestHookEntry | HookName>;
1242
- /** Route declarations — either plain name strings or structured objects */
1243
- routes: Array<ManifestRouteEntry | string>;
1244
- admin: PluginAdminConfig;
1245
- }
1246
- //#endregion
1247
- export { StandardHookEntry as $, PageMetadataContribution as A, PluginDefinition as B, MediaAccess as C, PageFragmentContribution as D, ModerationDecision as E, PluginAdminConfig as F, PortableTextBlockConfig as G, PluginManifest as H, PluginAdminExports as I, RequestMeta as J, PortableTextBlockField as K, PluginAdminPage as L, PageMetadataHandler as M, PageMetadataLinkRel as N, PageFragmentEvent as O, PagePlacement as P, RouteContext as Q, PluginCapability as R, LogAccess as S, MediaUploadEvent as T, PluginRoute as U, PluginHooks as V, PluginStorageConfig as W, ResolvedPlugin as X, ResolvedHook as Y, ResolvedPluginHooks as Z, FieldWidgetConfig as _, CommentAfterModerateEvent as a, StorageCollectionConfig as at, HttpAccess as b, CommentBeforeCreateHandler as c, Element as ct, ContentAccess as d, StandardHookHandler as et, ContentDeleteEvent as f, EmailMessage as g, CronEvent as h, CommentAfterCreateHandler as i, StorageCollection as it, PageMetadataEvent as j, PageFragmentHandler as k, CommentModerateEvent as l, ContentPublishStateChangeEvent as m, CollectionCommentSettings as n, StandardRouteEntry as nt, CommentAfterModerateHandler as o, StoredComment as ot, ContentHookEvent as p, PublicPageContext as q, CommentAfterCreateEvent as r, StandardRouteHandler as rt, CommentBeforeCreateEvent as s, isStandardPluginDefinition as st, BreadcrumbItem as t, StandardPluginDefinition as tt, CommentModerateHandler as u, HookConfig as v, MediaItem as w, KVAccess as x, HookName as y, PluginContext as z };