dineway 0.2.40 → 0.2.42

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 (460) hide show
  1. package/dist/{activity-LXZdjKwI.mjs → activity-BuhkMdv8.mjs} +2 -2
  2. package/dist/{activity-events-DoqeOM8x.mjs → activity-events-DkHsy7Y0.mjs} +1 -1
  3. package/dist/{allowed-origins-B4zstd2d.mjs → allowed-origins-DASdFW-l.mjs} +1 -1
  4. package/dist/api/route-utils.d.mts +15 -12
  5. package/dist/api/route-utils.mjs +27 -20
  6. package/dist/api/schemas/index.d.mts +1 -1
  7. package/dist/api/schemas/index.mjs +10 -5
  8. package/dist/{api-CQishNjZ.mjs → api-BBXfpMJw.mjs} +41 -13
  9. package/dist/{api-tokens-CNHnKO57.mjs → api-tokens-ciHNTdN2.mjs} +1 -1
  10. package/dist/{apply-D4rZHDyg.mjs → apply-CZDKUvZ4.mjs} +62 -18
  11. package/dist/astro/index.d.mts +16 -13
  12. package/dist/astro/index.mjs +31 -5
  13. package/dist/astro/middleware/auth.d.mts +14 -11
  14. package/dist/astro/middleware/auth.mjs +8 -8
  15. package/dist/astro/middleware/redirect.mjs +10 -6
  16. package/dist/astro/middleware/request-context.mjs +5 -5
  17. package/dist/astro/middleware/seed.d.mts +1 -1
  18. package/dist/astro/middleware/seed.mjs +2 -2
  19. package/dist/astro/middleware/setup.mjs +1 -1
  20. package/dist/astro/middleware.d.mts +2 -2
  21. package/dist/astro/middleware.mjs +266 -176
  22. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +12 -7
  23. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +12 -7
  24. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +4 -4
  25. package/dist/astro/routes/api/admin/api-tokens/index.mjs +7 -7
  26. package/dist/astro/routes/api/admin/briefing.mjs +41 -22
  27. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +4 -4
  28. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +14 -10
  29. package/dist/astro/routes/api/admin/byline-fields/index.mjs +14 -10
  30. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +14 -10
  31. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +25 -19
  32. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +25 -19
  33. package/dist/astro/routes/api/admin/bylines/index.mjs +25 -19
  34. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +20 -16
  35. package/dist/astro/routes/api/admin/comments/_id_.mjs +10 -7
  36. package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -13
  37. package/dist/astro/routes/api/admin/comments/counts.mjs +10 -7
  38. package/dist/astro/routes/api/admin/comments/index.mjs +18 -13
  39. package/dist/astro/routes/api/admin/context/_id_/history.mjs +51 -39
  40. package/dist/astro/routes/api/admin/context/_id_/index.mjs +51 -39
  41. package/dist/astro/routes/api/admin/context/_id_/review.mjs +57 -44
  42. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +57 -44
  43. package/dist/astro/routes/api/admin/context/diff.mjs +56 -43
  44. package/dist/astro/routes/api/admin/context/index.mjs +57 -44
  45. package/dist/astro/routes/api/admin/context/stale.mjs +56 -43
  46. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +51 -39
  47. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +56 -43
  48. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +56 -43
  49. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +52 -40
  50. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +3 -3
  51. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
  52. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
  53. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +78 -68
  54. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +78 -68
  55. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +71 -60
  56. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +78 -67
  57. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +78 -67
  58. package/dist/astro/routes/api/admin/plugins/index.mjs +71 -60
  59. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +2 -2
  60. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +71 -60
  61. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +78 -67
  62. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +71 -60
  63. package/dist/astro/routes/api/admin/plugins/updates.mjs +71 -60
  64. package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +38 -23
  65. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +46 -36
  66. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +63 -52
  67. package/dist/astro/routes/api/admin/review-requests/_id_/revoke.mjs +9 -9
  68. package/dist/astro/routes/api/admin/review-requests/index.mjs +61 -50
  69. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +71 -60
  70. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +2 -2
  71. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +71 -60
  72. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +1 -1
  73. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +1 -1
  74. package/dist/astro/routes/api/admin/users/_id_/index.mjs +11 -7
  75. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +3 -3
  76. package/dist/astro/routes/api/admin/users/index.mjs +12 -7
  77. package/dist/astro/routes/api/auth/dev-bypass.mjs +4 -4
  78. package/dist/astro/routes/api/auth/invite/accept.mjs +1 -1
  79. package/dist/astro/routes/api/auth/invite/complete.mjs +17 -12
  80. package/dist/astro/routes/api/auth/invite/index.mjs +14 -9
  81. package/dist/astro/routes/api/auth/invite/register-options.mjs +16 -11
  82. package/dist/astro/routes/api/auth/logout.mjs +2 -2
  83. package/dist/astro/routes/api/auth/magic-link/send.mjs +17 -12
  84. package/dist/astro/routes/api/auth/magic-link/verify.mjs +2 -2
  85. package/dist/astro/routes/api/auth/me.mjs +14 -11
  86. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  87. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +3 -3
  88. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +3 -3
  89. package/dist/astro/routes/api/auth/passkey/_id_.mjs +12 -7
  90. package/dist/astro/routes/api/auth/passkey/index.mjs +1 -1
  91. package/dist/astro/routes/api/auth/passkey/options.mjs +19 -14
  92. package/dist/astro/routes/api/auth/passkey/register/options.mjs +16 -11
  93. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +17 -12
  94. package/dist/astro/routes/api/auth/passkey/verify.mjs +17 -12
  95. package/dist/astro/routes/api/auth/setup-token/index.mjs +6 -6
  96. package/dist/astro/routes/api/auth/setup-token/verify.mjs +2 -2
  97. package/dist/astro/routes/api/auth/signup/complete.mjs +17 -12
  98. package/dist/astro/routes/api/auth/signup/request.mjs +17 -12
  99. package/dist/astro/routes/api/auth/signup/verify.mjs +1 -1
  100. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +14 -11
  101. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +23 -19
  102. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +23 -18
  103. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +2 -2
  104. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +8 -8
  105. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +8 -8
  106. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +8 -8
  107. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +25 -20
  108. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +41 -31
  109. package/dist/astro/routes/api/content/_collection_/_id_/release-readiness.mjs +14 -9
  110. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +8 -8
  111. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +2 -2
  112. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +41 -31
  113. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +30 -20
  114. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +2 -2
  115. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +8 -8
  116. package/dist/astro/routes/api/content/_collection_/_id_.mjs +25 -14
  117. package/dist/astro/routes/api/content/_collection_/authors.mjs +2 -2
  118. package/dist/astro/routes/api/content/_collection_/index.mjs +25 -14
  119. package/dist/astro/routes/api/content/_collection_/trash.mjs +13 -8
  120. package/dist/astro/routes/api/dashboard.mjs +21 -13
  121. package/dist/astro/routes/api/dev/emails.mjs +2 -2
  122. package/dist/astro/routes/api/health.mjs +1 -1
  123. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  124. package/dist/astro/routes/api/import/probe.mjs +30 -23
  125. package/dist/astro/routes/api/import/wordpress/analyze.mjs +13 -10
  126. package/dist/astro/routes/api/import/wordpress/execute.d.mts +14 -11
  127. package/dist/astro/routes/api/import/wordpress/execute.mjs +58 -47
  128. package/dist/astro/routes/api/import/wordpress/media.d.mts +14 -11
  129. package/dist/astro/routes/api/import/wordpress/media.mjs +17 -14
  130. package/dist/astro/routes/api/import/wordpress/prepare.mjs +61 -48
  131. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +15 -12
  132. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +58 -45
  133. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  134. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +32 -26
  135. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  136. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +14 -11
  137. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +63 -52
  138. package/dist/astro/routes/api/integration/artifact.mjs +9 -9
  139. package/dist/astro/routes/api/integration/dispatch.mjs +14 -14
  140. package/dist/astro/routes/api/integrations/_provider_.mjs +9 -9
  141. package/dist/astro/routes/api/integrations/index.mjs +8 -8
  142. package/dist/astro/routes/api/manifest.mjs +5 -5
  143. package/dist/astro/routes/api/mcp.mjs +141 -93
  144. package/dist/astro/routes/api/media/_id_/confirm.mjs +15 -12
  145. package/dist/astro/routes/api/media/_id_.mjs +14 -9
  146. package/dist/astro/routes/api/media/file/_...key_.mjs +1 -1
  147. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +2 -2
  148. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +2 -2
  149. package/dist/astro/routes/api/media/providers/index.mjs +2 -2
  150. package/dist/astro/routes/api/media/upload-url.mjs +16 -13
  151. package/dist/astro/routes/api/media.mjs +19 -16
  152. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +57 -44
  153. package/dist/astro/routes/api/menus/_name_/items.mjs +57 -44
  154. package/dist/astro/routes/api/menus/_name_/reorder.mjs +57 -44
  155. package/dist/astro/routes/api/menus/_name_/translations.mjs +57 -44
  156. package/dist/astro/routes/api/menus/_name_.mjs +57 -44
  157. package/dist/astro/routes/api/menus/index.mjs +57 -44
  158. package/dist/astro/routes/api/oauth/authorize.mjs +7 -7
  159. package/dist/astro/routes/api/oauth/device/authorize.mjs +5 -5
  160. package/dist/astro/routes/api/oauth/device/code.mjs +9 -9
  161. package/dist/astro/routes/api/oauth/device/token.mjs +8 -8
  162. package/dist/astro/routes/api/oauth/register.mjs +4 -4
  163. package/dist/astro/routes/api/oauth/token/refresh.mjs +5 -5
  164. package/dist/astro/routes/api/oauth/token/revoke.mjs +5 -5
  165. package/dist/astro/routes/api/oauth/token.mjs +6 -6
  166. package/dist/astro/routes/api/openapi.json.mjs +10 -5
  167. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +4 -4
  168. package/dist/astro/routes/api/redirects/404s/index.mjs +15 -13
  169. package/dist/astro/routes/api/redirects/404s/summary.mjs +15 -13
  170. package/dist/astro/routes/api/redirects/_id_.mjs +57 -44
  171. package/dist/astro/routes/api/redirects/index.mjs +57 -44
  172. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +2 -2
  173. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +2 -2
  174. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +73 -62
  175. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +73 -62
  176. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +73 -62
  177. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +73 -62
  178. package/dist/astro/routes/api/schema/collections/index.mjs +73 -62
  179. package/dist/astro/routes/api/schema/index.mjs +13 -10
  180. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +71 -60
  181. package/dist/astro/routes/api/schema/orphans/index.mjs +71 -60
  182. package/dist/astro/routes/api/search/enable.mjs +20 -13
  183. package/dist/astro/routes/api/search/index.mjs +19 -12
  184. package/dist/astro/routes/api/search/rebuild.mjs +20 -13
  185. package/dist/astro/routes/api/search/stats.mjs +12 -7
  186. package/dist/astro/routes/api/search/suggest.mjs +19 -12
  187. package/dist/astro/routes/api/sections/_slug_.mjs +57 -44
  188. package/dist/astro/routes/api/sections/index.mjs +57 -44
  189. package/dist/astro/routes/api/settings/email.mjs +5 -5
  190. package/dist/astro/routes/api/settings/reviews.mjs +11 -11
  191. package/dist/astro/routes/api/settings.mjs +57 -44
  192. package/dist/astro/routes/api/setup/admin-verify.mjs +19 -14
  193. package/dist/astro/routes/api/setup/admin.mjs +17 -12
  194. package/dist/astro/routes/api/setup/dev-bypass.mjs +44 -32
  195. package/dist/astro/routes/api/setup/dev-reset.mjs +2 -2
  196. package/dist/astro/routes/api/setup/index.mjs +47 -34
  197. package/dist/astro/routes/api/setup/status.mjs +3 -3
  198. package/dist/astro/routes/api/snapshot.mjs +9 -9
  199. package/dist/astro/routes/api/system/heartbeat.mjs +2 -2
  200. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +60 -47
  201. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +60 -47
  202. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +60 -47
  203. package/dist/astro/routes/api/taxonomies/index.mjs +60 -47
  204. package/dist/astro/routes/api/themes/preview.mjs +7 -7
  205. package/dist/astro/routes/api/typegen.mjs +4 -4
  206. package/dist/astro/routes/api/well-known/auth.mjs +3 -3
  207. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +3 -3
  208. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +3 -3
  209. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +56 -43
  210. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +57 -44
  211. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +57 -44
  212. package/dist/astro/routes/api/widget-areas/_name_.mjs +53 -41
  213. package/dist/astro/routes/api/widget-areas/index.mjs +57 -44
  214. package/dist/astro/routes/api/widget-components.mjs +2 -2
  215. package/dist/astro/routes/robots.txt.mjs +14 -9
  216. package/dist/astro/routes/sitemap-_collection_.xml.mjs +20 -16
  217. package/dist/astro/routes/sitemap.xml.mjs +19 -15
  218. package/dist/astro/session-driver.d.mts +1 -1
  219. package/dist/astro/session-driver.mjs +8 -3
  220. package/dist/astro/types.d.mts +21 -14
  221. package/dist/{atomic-authority-CnBQJ14T.mjs → atomic-authority-Bf5QZboB.mjs} +2 -2
  222. package/dist/{audit-Cl495Ze3.mjs → audit-hXJBTPY0.mjs} +1 -1
  223. package/dist/auth/providers/github.d.mts +1 -1
  224. package/dist/auth/providers/google.d.mts +1 -1
  225. package/dist/{auth-control-guard-DbjgJdlo.mjs → auth-control-guard-DpUP6Fs_.mjs} +1 -1
  226. package/dist/{authorize-DDmgmnW-.mjs → authorize-DWNOqMKq.mjs} +1 -1
  227. package/dist/{briefing-DsD-Ouwc.mjs → briefing-BShyAm_Z.mjs} +1 -1
  228. package/dist/{briefing-COw-WcYz.mjs → briefing-CaeEFvkD.mjs} +995 -7
  229. package/dist/{bundle-bhiszAui.mjs → bundle-DWn5eFKz.mjs} +2 -2
  230. package/dist/{byline-fields-D-b9CWux.d.mts → byline-fields-B7pQ3LMi.d.mts} +14 -10
  231. package/dist/{byline-fields-BKj5f3Ub.mjs → byline-fields-DRMCc0V_.mjs} +1 -1
  232. package/dist/{byline-fields-DZ46DF10.mjs → byline-fields-wWu2Cb3l.mjs} +3 -3
  233. package/dist/{byline-registry-CJihchD1.mjs → byline-registry-Caj0_gbU.mjs} +1 -1
  234. package/dist/{byline-TYk2kad6.mjs → byline-uuVB2B3E.mjs} +65 -14
  235. package/dist/{bylines-6T9iVC9j.mjs → bylines-PLlsL31L.mjs} +3 -3
  236. package/dist/{bylines-CvTSCAw9.mjs → bylines-XGlNK0Lo.mjs} +5 -5
  237. package/dist/{patterns-Ay-4KImK.mjs → cache-DsEbwFVE.mjs} +51 -1
  238. package/dist/{chunks-C8vSD_5L.mjs → chunks-Bb56aCtB.mjs} +1 -1
  239. package/dist/cli/index.mjs +486 -48
  240. package/dist/cli/plugin-kit.d.mts +14 -11
  241. package/dist/cli/plugin-kit.mjs +2 -2
  242. package/dist/client/external-auth-headers.d.mts +1 -1
  243. package/dist/client/index.d.mts +16 -13
  244. package/dist/client/index.mjs +2 -2
  245. package/dist/{client-factory-C1ZQCMog.mjs → client-factory-BLbm250o.mjs} +1 -1
  246. package/dist/{comment-DAQfUjqt.mjs → comment-BWDG1nQm.mjs} +2 -2
  247. package/dist/{comment-reaction-Dp3G7UZc.mjs → comment-reaction-B7pLTlQ7.mjs} +1 -1
  248. package/dist/{comments-BrvIaRAx.mjs → comments-xkten8nV.mjs} +1 -1
  249. package/dist/config-6R0bchVE.mjs +125 -0
  250. package/dist/{content-CIKsrvU9.mjs → content-BNeuaVCS.mjs} +302 -45
  251. package/dist/content-Dr22fzA_.mjs +390 -0
  252. package/dist/{content-refresh-BilzqcLt.mjs → content-refresh-D7wpVFJ_.mjs} +14 -8
  253. package/dist/content-storage/index.d.mts +193 -0
  254. package/dist/content-storage/index.mjs +29 -0
  255. package/dist/content-storage/store.d.mts +3 -0
  256. package/dist/content-storage/store.mjs +5 -0
  257. package/dist/{review-payload-Bap86e75.mjs → content-write-43KZZ7dz.mjs} +838 -131
  258. package/dist/{context-DAs_MZjJ.mjs → context-Cjz0y4Al.mjs} +292 -23
  259. package/dist/{context-DVTvucNb.mjs → context-DuYXPlfZ.mjs} +2 -2
  260. package/dist/{context-route-helpers-BP-UJ4u8.mjs → context-route-helpers-TP3EqxRQ.mjs} +2 -2
  261. package/dist/{dashboard-BAjWCGCP.mjs → dashboard-BquGX1ue.mjs} +4 -4
  262. package/dist/database/batch.d.mts +1 -1
  263. package/dist/database/batch.mjs +1 -1
  264. package/dist/database/d1/index.d.mts +14 -11
  265. package/dist/database/d1/index.mjs +4 -4
  266. package/dist/database/instrumentation.mjs +3 -2
  267. package/dist/db/index.d.mts +3 -3
  268. package/dist/db/index.mjs +1 -1
  269. package/dist/db/libsql.d.mts +1 -1
  270. package/dist/db/postgres.d.mts +1 -1
  271. package/dist/db/sqlite.d.mts +1 -1
  272. package/dist/{device-flow-Dh0rNlh1.mjs → device-flow-SoZh-HvN.mjs} +3 -3
  273. package/dist/{discovery-V0e0Gg8j.mjs → discovery-BwCZFUXm.mjs} +4 -4
  274. package/dist/{enrich-B7PIJ8Iy.mjs → enrich-CAMsD1aT.mjs} +1 -1
  275. package/dist/{error-B5a45Tfb.mjs → error-sL4aemcW.mjs} +2 -0
  276. package/dist/{evidence-Vnp_fQbC.mjs → evidence-1Gr8TlTf.mjs} +7 -7
  277. package/dist/{field-defs-cache-aXUeXJdC.mjs → field-defs-cache-dn5Tw79A.mjs} +4 -4
  278. package/dist/{fts-manager-BrPpYtK0.mjs → fts-manager-Zu5ITic0.mjs} +1 -1
  279. package/dist/{hitl-requests-BxMMON3s.mjs → hitl-requests-Bdab4DhO.mjs} +2 -2
  280. package/dist/{hitl-route-helpers-sdnjpx2k.mjs → hitl-route-helpers-DGMLQajA.mjs} +5 -5
  281. package/dist/hook-events-BQw73jc7.d.mts +32 -0
  282. package/dist/{import-C2-v4FCs.mjs → import-DJFlvQey.mjs} +9 -9
  283. package/dist/{index-BVGe04wF.d.mts → index-CLj17kW9.d.mts} +12 -5
  284. package/dist/index.d.mts +19 -16
  285. package/dist/index.mjs +107 -98
  286. package/dist/{integration-credentials-DMEXZU2J.mjs → integration-credentials-DpuRw1kx.mjs} +2 -2
  287. package/dist/{jsonld-wRF85RXo.d.mts → jsonld-CPijKSUe.d.mts} +2 -2
  288. package/dist/{load-DvCVppOF.mjs → load-CiRTddkJ.mjs} +1 -1
  289. package/dist/{loader-Dp6zLmQm.mjs → loader-Bq1aW12P.mjs} +16 -5
  290. package/dist/{manifest-schema-CCvogfrP.mjs → manifest-schema-DaQpgyTB.mjs} +1 -1
  291. package/dist/{mcp-reviewed-executor-B8Gbin3T.mjs → mcp-reviewed-executor-DtTnFcqC.mjs} +6 -6
  292. package/dist/media/image-endpoint.mjs +1 -1
  293. package/dist/media/index.d.mts +1 -1
  294. package/dist/media/index.mjs +2 -2
  295. package/dist/media/local-runtime.d.mts +16 -13
  296. package/dist/media/local-runtime.mjs +3 -3
  297. package/dist/{media-C5ba8fvI.mjs → media-BjH5OD-A.mjs} +1 -1
  298. package/dist/{media-allowlist-DQvscVkS.mjs → media-allowlist-C8HJ2O61.mjs} +1 -1
  299. package/dist/{menus-w5xwT-f5.mjs → menus-BXkfzNR1.mjs} +7 -7
  300. package/dist/{menus-CyNpBQrX.mjs → menus-CbBi7Ad7.mjs} +2 -2
  301. package/dist/migration-D9OY6vI9.mjs +526 -0
  302. package/dist/{migrations-CLlX25HO.mjs → migrations-BAjF60cl.mjs} +1 -1
  303. package/dist/{oauth-authorization-CdqJZUMf.mjs → oauth-authorization-CSSRMOKn.mjs} +4 -4
  304. package/dist/{oauth-clients-CHNb9MAZ.mjs → oauth-clients-DX5HIJJv.mjs} +2 -2
  305. package/dist/object-cache/memory.d.mts +1 -1
  306. package/dist/{object-cache-mxCW-Rpt.mjs → object-cache-DyI1SOBK.mjs} +3 -1
  307. package/dist/owned-metadata-C99DzQuq.mjs +69 -0
  308. package/dist/page/index.d.mts +15 -12
  309. package/dist/page/index.mjs +1 -1
  310. package/dist/{parse-THHCpJLB.mjs → parse-C6kCR1OT.mjs} +1 -1
  311. package/dist/plugin-utils.d.mts +14 -11
  312. package/dist/plugins/adapt-sandbox-entry.d.mts +14 -11
  313. package/dist/plugins/adapt-sandbox-entry.mjs +1 -1
  314. package/dist/{plugins-pfraURNp.mjs → plugins-LtyuDuIb.mjs} +16 -962
  315. package/dist/{policy-D2USlibj.mjs → policy-Drg5yr1-.mjs} +2 -2
  316. package/dist/{preview-Bh7D7F27.mjs → preview-CWiIjMDi.mjs} +2 -2
  317. package/dist/{provider-loader-DT7vQ5FI.d.mts → provider-loader-oLKm1AU8.d.mts} +1 -1
  318. package/dist/{public-url-Ccv0Xmue.d.mts → public-url-CEC1vj02.d.mts} +2 -2
  319. package/dist/{public-url-CG5YbNqB.d.mts → public-url-cMnsBUZB.d.mts} +1 -1
  320. package/dist/{publication-authorization-B_HJSnzR.mjs → publication-authorization-CJ4Jr5Hg.mjs} +43 -17
  321. package/dist/{query-xspvw7Ui.mjs → query-CLWTwcTr.mjs} +14 -14
  322. package/dist/{query-DLeahg3x.mjs → query-CP9M8xxX.mjs} +4 -4
  323. package/dist/{rate-limit-BsBr_U9g.mjs → rate-limit-DeVLLe4z.mjs} +2 -2
  324. package/dist/{redirect-BQFa1THe.mjs → redirect-CJ-FAbNK.mjs} +2 -2
  325. package/dist/{redirects-DJcsgz_X.mjs → redirects-BKi6mek4.mjs} +4 -5
  326. package/dist/{redirects-CVfxefrz.mjs → redirects-I78-ZYLV.mjs} +5 -386
  327. package/dist/{registry-Dclv9iHv.mjs → registry-B-HULaJI.mjs} +7 -7
  328. package/dist/{release-Da2UFygt.mjs → release-D615eKav.mjs} +173 -22
  329. package/dist/request-context.d.mts +30 -0
  330. package/dist/{request-meta-CjORiJQ_.mjs → request-meta-DZYuLXx_.mjs} +1 -1
  331. package/dist/review-payload-Bhi52CbI.mjs +112 -0
  332. package/dist/{review-requests-CcSUTm_l.mjs → review-requests-CGQ1u7uY.mjs} +2 -2
  333. package/dist/{review-requests-CUVn0RBl.mjs → review-requests-DZYM51yI.mjs} +2 -2
  334. package/dist/{review-route-helpers-CKBfGKCi.mjs → review-route-helpers-DXNDyx_q.mjs} +2 -2
  335. package/dist/{revision-W6FDfDqx.mjs → revision-DlxUfOD5.mjs} +42 -7
  336. package/dist/revisions-qNkae-Dq.mjs +57 -0
  337. package/dist/{revocation-C_ZQvGRT.mjs → revocation-4we8kfBg.mjs} +2 -2
  338. package/dist/{runner-CRU7BXjr.mjs → runner-CuG8o1uW.mjs} +558 -487
  339. package/dist/{runner-SoP1rphP.d.mts → runner-DXQkyPeX.d.mts} +1 -1
  340. package/dist/{runs-BtaAiLTw.mjs → runs-BjgLfqCn.mjs} +5 -5
  341. package/dist/runtime-Bs2JMbb2.d.mts +45 -0
  342. package/dist/runtime-Ch5G-tnG.mjs +400 -0
  343. package/dist/runtime.d.mts +15 -12
  344. package/dist/runtime.mjs +9 -4
  345. package/dist/schema-DVeOJpqA.mjs +8 -0
  346. package/dist/{search-BI9uKr7U.mjs → search-zMoM2_uq.mjs} +4 -98
  347. package/dist/{secrets-D_pergcD.mjs → secrets-CIYcw9T9.mjs} +4 -4
  348. package/dist/{sections-BqqYq9RW.mjs → sections-BtO0Zdv5.mjs} +2 -2
  349. package/dist/seed/index.d.mts +2 -2
  350. package/dist/seed/index.mjs +38 -26
  351. package/dist/seo/index.d.mts +3 -3
  352. package/dist/seo/index.mjs +12 -9
  353. package/dist/{seo-B-5PsaJO.mjs → seo-DwcULb78.mjs} +1 -1
  354. package/dist/{seo-Bs_DUxJf.mjs → seo-uliFa7s-.mjs} +44 -5
  355. package/dist/{service-W2xuGLgw.mjs → service-BBJM08uD.mjs} +2 -2
  356. package/dist/{service-B65aJsN7.mjs → service-CkMuD5AE.mjs} +3 -3
  357. package/dist/{settings-CyJ2-MKx.mjs → settings-D31Y4msD.mjs} +2 -2
  358. package/dist/{settings-DsBzKeUQ.mjs → settings-DDOB3gW1.mjs} +7 -7
  359. package/dist/{setup-complete-t9yamqBb.mjs → setup-complete-5GxB7hiF.mjs} +1 -1
  360. package/dist/{site-activity-DU0UPDji.mjs → site-activity-hpfJkmxQ.mjs} +1 -1
  361. package/dist/{site-context-Dic2jHuw.mjs → site-context-D3AmDdpQ.mjs} +15 -15
  362. package/dist/{site-url-Tw6CfBB2.mjs → site-url-CYatfe3q.mjs} +1 -1
  363. package/dist/{state-jx6Yiwsm.mjs → state-ClG1I4wl.mjs} +1 -1
  364. package/dist/storage/local.d.mts +1 -1
  365. package/dist/storage/local.mjs +1 -1
  366. package/dist/storage/s3.d.mts +1 -1
  367. package/dist/storage/s3.mjs +2 -2
  368. package/dist/{store-32e6dfD-.mjs → store-BzaAtszy.mjs} +3 -3
  369. package/dist/submission-DgLES24O.mjs +205 -0
  370. package/dist/{taxonomies-BFsUR7kc.mjs → taxonomies-B4hE8Yb3.mjs} +3 -3
  371. package/dist/{taxonomies-lWGNLKgn.mjs → taxonomies-BI26Bk-M.mjs} +7 -7
  372. package/dist/{taxonomy-DN6i1upz.mjs → taxonomy-B8w8F2Cs.mjs} +53 -3
  373. package/dist/terms-EskuqbKE.mjs +104 -0
  374. package/dist/text-extraction-CdqMGYQK.mjs +96 -0
  375. package/dist/{tokens-D-StaTAQ.mjs → tokens-D8HEH277.mjs} +1 -1
  376. package/dist/{trusted-proxy-hYufGFPK.mjs → trusted-proxy-Dg3U9Lrv.mjs} +1 -1
  377. package/dist/{types-D5JfvPvx.d.mts → types-0gRlZbhN.d.mts} +88 -32
  378. package/dist/{types-RFzE_V1M.mjs → types-BI3ULB3A.mjs} +2 -2
  379. package/dist/{types-B--VyN3n.d.mts → types-Dpv_MvwZ.d.mts} +1 -1
  380. package/dist/{types-CgcOeaiQ.d.mts → types-ex-UrNlz.d.mts} +1 -1
  381. package/dist/types-qOEot0UQ.d.mts +83 -0
  382. package/dist/ui/server-runtime.d.mts +18 -15
  383. package/dist/ui/server-runtime.mjs +29 -25
  384. package/dist/{user-Btai9rl3.mjs → user-Bl2_8rhJ.mjs} +2 -2
  385. package/dist/{utils-CYxGuO_P.mjs → utils-CklSLz9F.mjs} +2 -2
  386. package/dist/{validate-C05z0m7M.mjs → validate-C-yk7mmX.mjs} +3 -3
  387. package/dist/{validate-kmN2lS8H.d.mts → validate-DUscf6VG.d.mts} +3 -3
  388. package/dist/version-Co258u70.mjs +6 -0
  389. package/dist/version-store-BXv2D0de.mjs +208 -0
  390. package/dist/version-store-B_THJCc0.d.mts +98 -0
  391. package/dist/{widgets-BOrDZdQ3.mjs → widgets-B99mnftw.mjs} +3 -3
  392. package/dist/{wordpress-slugs-ROzITIBK.mjs → wordpress-slugs-yaeD7cxn.mjs} +1 -1
  393. package/dist/{worker-CKU70ODm.mjs → worker-DdI-KtvF.mjs} +10 -10
  394. package/dist/write-intent-DuHVqks9.mjs +108 -0
  395. package/dist/{zod-generator-DkrWuID7.mjs → zod-generator-B5Pt8fv0.mjs} +2 -2
  396. package/package.json +16 -4
  397. package/dist/cache-B5NSHhxG.mjs +0 -52
  398. package/dist/cron-C7HCJPPl.mjs +0 -271
  399. package/dist/schema-CosVhHJt.mjs +0 -8
  400. package/dist/submission-DJmRejGR.mjs +0 -411
  401. package/dist/version-CISd4wX_.mjs +0 -6
  402. /package/dist/{actor-DxUAJgQX.mjs → actor-D0AW80ld.mjs} +0 -0
  403. /package/dist/{adapter-symbols-Bq3JsWGM.d.mts → adapter-symbols-B9mi-BUh.d.mts} +0 -0
  404. /package/dist/{adapters-C8nRpUuj.d.mts → adapters-lDnJjNDz.d.mts} +0 -0
  405. /package/dist/{api-tokens-0N3nafqZ.mjs → api-tokens-CdfsE9PL.mjs} +0 -0
  406. /package/dist/{base64-Cz-aU0X1.mjs → base64-qvSs0Gxy.mjs} +0 -0
  407. /package/dist/{challenge-store-DFGsDtCj.mjs → challenge-store-Dq5HiMO3.mjs} +0 -0
  408. /package/dist/{components-rFN8NH3N.mjs → components-JA6tFHmE.mjs} +0 -0
  409. /package/dist/{context-types-CPWAJRs5.mjs → context-types-DDIJhGLs.mjs} +0 -0
  410. /package/dist/{default-BS6VQRkB.mjs → default-C2azCFSB.mjs} +0 -0
  411. /package/dist/{email-console-GqK6hgMJ.mjs → email-console-BYQp_5Qr.mjs} +0 -0
  412. /package/dist/{escape-CE7xOWzJ.mjs → escape-4_NNa6GR.mjs} +0 -0
  413. /package/dist/{experimental-workflows-BbxpWwBy.mjs → experimental-workflows-CPNiI2EL.mjs} +0 -0
  414. /package/dist/{forgeway-account-DcTxh3Gw.mjs → forgeway-account-7N-3srH-.mjs} +0 -0
  415. /package/dist/{hash-D2Rqd2J2.mjs → hash-qSYPMJ8w.mjs} +0 -0
  416. /package/dist/{media-url-D9kdpoLS.mjs → media-url-D5E1a47B.mjs} +0 -0
  417. /package/dist/{mime-BnVhH671.mjs → mime-FkfazULS.mjs} +0 -0
  418. /package/dist/{mode-BJwb_MgK.mjs → mode-B_m1BGFh.mjs} +0 -0
  419. /package/dist/{normalize-aTwryvvi.mjs → normalize-DrmlLn40.mjs} +0 -0
  420. /package/dist/{oauth-authority-P5YMSk2z.mjs → oauth-authority-DVlLFhsZ.mjs} +0 -0
  421. /package/dist/{oauth-state-store-CMqLdo4I.mjs → oauth-state-store-nf-78RbK.mjs} +0 -0
  422. /package/dist/{options-JiLWB6Bt.mjs → options-yFkLUuTw.mjs} +0 -0
  423. /package/dist/{output-7HDrYTSQ.mjs → output-B1GiXeT8.mjs} +0 -0
  424. /package/dist/{parser-kettsjWc.mjs → parser-CTlxybRo.mjs} +0 -0
  425. /package/dist/{passkey-config-DVzQ3dv3.mjs → passkey-config-BLon3ct9.mjs} +0 -0
  426. /package/dist/{placeholder-DJLP_HY7.d.mts → placeholder-DdZV3I8x.d.mts} +0 -0
  427. /package/dist/{portable-text-BE7nszX6.d.mts → portable-text-HNmwL-7L.d.mts} +0 -0
  428. /package/dist/{portable-text-tQhvPLf1.mjs → portable-text-p0Ojfpfo.mjs} +0 -0
  429. /package/dist/{process-cache-C19OA3am.mjs → process-cache-CMy5M80h.mjs} +0 -0
  430. /package/dist/{provider-loader-DERzBMUz.mjs → provider-loader-DlaT1usE.mjs} +0 -0
  431. /package/dist/{public-discovery-BGyhuD5U.mjs → public-discovery-BnqYofSK.mjs} +0 -0
  432. /package/dist/{public-url-DFXUU6Wp.mjs → public-url-BHjYWuaN.mjs} +0 -0
  433. /package/dist/{public-url-sR8SVmTt.mjs → public-url-GQygrYmg.mjs} +0 -0
  434. /package/dist/{redirect-BxacnBYL.mjs → redirect-CokmLN5o.mjs} +0 -0
  435. /package/dist/{request-cache-8_ifFzVw.mjs → request-cache-CizvDoxV.mjs} +0 -0
  436. /package/dist/{resolve-DEKC4qVa.mjs → resolve-BxFGSKYu.mjs} +0 -0
  437. /package/dist/{runtime-env-CPTzh0mZ.mjs → runtime-env-DpYGy4pT.mjs} +0 -0
  438. /package/dist/{scheduled-publish-BxdShRGs.d.mts → scheduled-publish-eCNGpvNm.d.mts} +0 -0
  439. /package/dist/{seo-contributions-LEFs1d7w.mjs → seo-contributions-ZKqrqsdT.mjs} +0 -0
  440. /package/dist/{service-kQ5ljRzX.mjs → service-DeX1PRNt.mjs} +0 -0
  441. /package/dist/{session-user-B8yYh0g5.mjs → session-user-B0XMp1GC.mjs} +0 -0
  442. /package/dist/{setup-nonce-B6A5Y1ea.mjs → setup-nonce-B9IO7PbK.mjs} +0 -0
  443. /package/dist/{sidecar-client-BwPhhz-F.mjs → sidecar-client-2hx5G46s.mjs} +0 -0
  444. /package/dist/{slugify-kD31VIv2.mjs → slugify-DvoaEPtL.mjs} +0 -0
  445. /package/dist/{ssrf-C9dyjU8O.mjs → ssrf-DcD8vn3E.mjs} +0 -0
  446. /package/dist/{stable-hash-B9Tbb2f_.mjs → stable-hash-9RDJgfif.mjs} +0 -0
  447. /package/dist/{status-Bjf_uSrW.mjs → status-B2xUokyJ.mjs} +0 -0
  448. /package/dist/{transport-BrU1aDY5.mjs → transport-BK_me2MZ.mjs} +0 -0
  449. /package/dist/{transport-CZbtxgKZ.d.mts → transport-CVU5rp7W.d.mts} +0 -0
  450. /package/dist/{types-DNBL-4Sn.mjs → types-B3Uq7Czg.mjs} +0 -0
  451. /package/dist/{types-DsJTXStN.d.mts → types-BJztoTbF.d.mts} +0 -0
  452. /package/dist/{types-COvyXIp7.mjs → types-BgUxCuwu.mjs} +0 -0
  453. /package/dist/{types-KFzuijKE.d.mts → types-C0heD9oI.d.mts} +0 -0
  454. /package/dist/{types-B03h5jt_.d.mts → types-DheoByey.d.mts} +0 -0
  455. /package/dist/{types-SlLXjRpg.d.mts → types-I5LHzk_M.d.mts} +0 -0
  456. /package/dist/{types-PLJ9hlhh.mjs → types-Nm0cMxEh.mjs} +0 -0
  457. /package/dist/{types-CtGSEKEJ.d.mts → types-PxxPTFSl.d.mts} +0 -0
  458. /package/dist/{url-DGG3hw_h.mjs → url-Coamqvs4.mjs} +0 -0
  459. /package/dist/{url-DUz3LbCs.mjs → url-dn4mFfCI.mjs} +0 -0
  460. /package/dist/{workers-build-BkmPhclj.mjs → workers-build-XNBt1wGF.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { t as Database } from "./types-B--VyN3n.mjs";
1
+ import { n as Database } from "./types-Dpv_MvwZ.mjs";
2
2
  import { Kysely } from "kysely";
3
3
 
4
4
  //#region src/database/migrations/runner.d.ts
@@ -1,8 +1,8 @@
1
- import { n as decodeBase64url, r as encodeBase64 } from "./base64-Cz-aU0X1.mjs";
2
- import { i as encodeCursor, r as decodeCursor } from "./types-RFzE_V1M.mjs";
3
- import { t as buildStableHash } from "./stable-hash-B9Tbb2f_.mjs";
4
- import { t as DinewayToolsError } from "./service-kQ5ljRzX.mjs";
5
- import { t as DinewaySecretsError } from "./secrets-D_pergcD.mjs";
1
+ import { n as decodeBase64url, r as encodeBase64 } from "./base64-qvSs0Gxy.mjs";
2
+ import { i as encodeCursor, r as decodeCursor } from "./types-BI3ULB3A.mjs";
3
+ import { t as buildStableHash } from "./stable-hash-9RDJgfif.mjs";
4
+ import { t as DinewayToolsError } from "./service-DeX1PRNt.mjs";
5
+ import { t as DinewaySecretsError } from "./secrets-CIYcw9T9.mjs";
6
6
  import { z } from "zod";
7
7
  import MiniSearch from "minisearch";
8
8
 
@@ -0,0 +1,45 @@
1
+ import { AtomicBatch } from "./database/batch.mjs";
2
+ import { a as ContentStorageActivation, d as ContentStore, p as PreparedContentVersion, r as ContentPartitionResolver, s as ContentStorageConfig, t as ContentLocation } from "./types-qOEot0UQ.mjs";
3
+ import { n as ContentStorageHookName, r as ContentStorageHookTarget } from "./hook-events-BQw73jc7.mjs";
4
+ import { Kysely } from "kysely";
5
+
6
+ //#region src/content-storage/coordinator.d.ts
7
+ /** Run only during explicit deployment or migration, before serving requests. */
8
+ declare function installContentStorageConfig<DB>(db: Kysely<DB>, config: ContentStorageConfig, options?: {
9
+ initial?: "primary" | "configured";
10
+ }): Promise<void>;
11
+ declare class ContentStorageCoordinator<DB> {
12
+ private readonly db;
13
+ private readonly config;
14
+ private readonly stores;
15
+ private readonly resolvers;
16
+ private readonly configDigest;
17
+ constructor(db: Kysely<DB>, config: ContentStorageConfig, stores: Readonly<Record<string, ContentStore>>, resolvers?: Readonly<Record<string, ContentPartitionResolver>>);
18
+ locate(collection: string, entryId: string): Promise<ContentLocation | null>;
19
+ read(collection: string, entryId: string): Promise<PreparedContentVersion | null>;
20
+ /** Locations come from the same directory query that selected and paginated the entries. */
21
+ readLocations(locations: readonly ContentLocation[], fields?: readonly string[]): Promise<PreparedContentVersion[]>;
22
+ commit(version: PreparedContentVersion, activation: ContentStorageActivation): Promise<ContentLocation>;
23
+ /** Stage remotely, then compose this activation with other primary-database business writes. */
24
+ prepareCommit(version: PreparedContentVersion, activation: ContentStorageActivation): Promise<AtomicBatch>;
25
+ private operation;
26
+ }
27
+ //#endregion
28
+ //#region src/content-storage/runtime.d.ts
29
+ interface ContentStorageRuntime {
30
+ config: ContentStorageConfig;
31
+ createStores(primary: boolean): Record<string, ContentStore>;
32
+ resolvers: Record<string, ContentPartitionResolver>;
33
+ hookTargets?: (names: readonly ContentStorageHookName[]) => readonly ContentStorageHookTarget[];
34
+ }
35
+ declare function registerContentStorage<DB>(db: Kysely<DB>, runtime: ContentStorageRuntime): void;
36
+ declare function assertContentStorageConfiguration<DB>(db: Kysely<DB>, config?: ContentStorageConfig): Promise<void>;
37
+ declare function getContentStorage<DB>(db: Kysely<DB>, collection: string): {
38
+ runtime: ContentStorageRuntime;
39
+ stores: Record<string, ContentStore>;
40
+ coordinator: ContentStorageCoordinator<DB>;
41
+ } | undefined;
42
+ /** Resolve a bounded primary-index page in bulk, retaining the selected metadata and order. */
43
+ declare function hydrateContentRows<DB>(db: Kysely<DB>, collection: string, rows: Record<string, unknown>[], fields?: readonly string[]): Promise<void>;
44
+ //#endregion
45
+ export { registerContentStorage as a, hydrateContentRows as i, assertContentStorageConfiguration as n, ContentStorageCoordinator as o, getContentStorage as r, installContentStorageConfig as s, ContentStorageRuntime as t };
@@ -0,0 +1,400 @@
1
+ import { getRequestContext } from "./request-context.mjs";
2
+ import { atomicBatch, rowUnchanged } from "./database/batch.mjs";
3
+ import { a as validateContentStorage, i as resolveContentPartition, n as contentDigest, o as ContentStorageError, s as ContentStorageReplay, t as canonicalContentJson } from "./config-6R0bchVE.mjs";
4
+ import { sql } from "kysely";
5
+
6
+ //#region src/content-storage/change-journal.ts
7
+ /** Installed explicitly with routing; triggers also capture composed metadata writes and deletion. */
8
+ async function prepareContentChangeJournal(db, collection) {
9
+ const sources = [
10
+ {
11
+ table: `ec_${collection}`,
12
+ entry: "id",
13
+ collection: null
14
+ },
15
+ {
16
+ table: "revisions",
17
+ entry: "entry_id",
18
+ collection: "collection"
19
+ },
20
+ {
21
+ table: "content_taxonomies",
22
+ entry: "entry_id",
23
+ collection: "collection"
24
+ },
25
+ {
26
+ table: "_dineway_content_bylines",
27
+ entry: "content_id",
28
+ collection: "collection_slug"
29
+ },
30
+ {
31
+ table: "_dineway_seo",
32
+ entry: "content_id",
33
+ collection: "collection"
34
+ }
35
+ ];
36
+ const statements = [];
37
+ for (const source of sources) {
38
+ if (!(await sql`SELECT 1 FROM sqlite_master WHERE type='table' AND name=${source.table}`.execute(db)).rows.length) continue;
39
+ for (const action of [
40
+ "INSERT",
41
+ "UPDATE",
42
+ "DELETE"
43
+ ]) {
44
+ const row = action === "DELETE" ? "OLD" : "NEW";
45
+ const name = `content_changes_${collection}_${source.table}_${action.toLowerCase()}`;
46
+ statements.push(sql`CREATE TRIGGER IF NOT EXISTS ${sql.ref(name)} AFTER ${sql.raw(action)} ON ${sql.table(source.table)}
47
+ ${source.collection ? sql`WHEN ${sql.ref(`${row}.${source.collection}`)}=${sql.lit(collection)}` : sql``}
48
+ BEGIN INSERT INTO _dineway_content_changes (collection,entry_id,source,action,changed_at)
49
+ VALUES (${sql.lit(collection)},${sql.ref(`${row}.${source.entry}`)},${sql.lit(source.table)},${sql.lit(action.toLowerCase())},strftime('%Y-%m-%dT%H:%M:%fZ','now')); END`.compile(db));
50
+ }
51
+ }
52
+ return statements;
53
+ }
54
+ function contentChangeSequence(collection, entryId) {
55
+ return sql`(SELECT COALESCE(MAX(sequence),0) FROM _dineway_content_changes WHERE collection=${collection} AND entry_id=${entryId})`;
56
+ }
57
+
58
+ //#endregion
59
+ //#region src/content-storage/routing.ts
60
+ const MIGRATION_ID = /^[a-zA-Z0-9_-]{1,128}$/;
61
+ async function readContentPartitionRoute(db, collection, partition) {
62
+ const row = (await sql`SELECT * FROM _dineway_content_partitions WHERE collection = ${collection} AND partition = ${partition}`.execute(db)).rows[0];
63
+ if (!row) throw new ContentStorageError("ROUTE_CHANGED", "The content partition has not been installed.");
64
+ return {
65
+ route: row,
66
+ check: rowUnchanged("_dineway_content_partitions", { ...row })
67
+ };
68
+ }
69
+ /** Also fences metadata-only operations, such as trash, scheduling and review activation. */
70
+ function contentPartitionWritable(collection, id) {
71
+ return sql`NOT EXISTS (SELECT 1 FROM _dineway_content_locations l JOIN _dineway_content_partitions p ON p.collection = l.collection AND p.partition = l.partition WHERE l.collection = ${collection} AND l.entry_id = ${id} AND p.state = 'frozen')`;
72
+ }
73
+ /** Starts copying while the partition remains writable on its current store. */
74
+ async function beginContentMigration(db, config, migration) {
75
+ if (!MIGRATION_ID.test(migration.id)) throw new ContentStorageError("CONFLICT", "A stable migration identifier is required.");
76
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
77
+ if (current.route.migration_id === migration.id && current.route.state !== "active") return current.route;
78
+ const target = config.rules[migration.collection]?.stores[migration.partition];
79
+ if (!target || current.route.store === target || current.route.state !== "active" || current.route.migration_id) throw new ContentStorageError("CONFLICT", "The partition cannot start this migration.");
80
+ await atomicBatch(db, {
81
+ checks: [current.check, sql`EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id='active' AND version=${config.version} AND digest=${await contentDigest(config)})`],
82
+ statements: [sql`INSERT INTO _dineway_content_migrations (id, collection, partition, source_store, target_store, routing_version, state, created_at, updated_at, retain_until) VALUES (${migration.id}, ${migration.collection}, ${migration.partition}, ${current.route.store}, ${target}, ${config.version}, 'copying', ${(/* @__PURE__ */ new Date()).toISOString()}, ${(/* @__PURE__ */ new Date()).toISOString()}, ${new Date(Date.now() + 7 * 864e5).toISOString()})`.compile(db), sql`UPDATE _dineway_content_partitions SET state='copying', migration_id=${migration.id}, target_store=${target}, epoch=epoch+1, updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE collection=${migration.collection} AND partition=${migration.partition}`.compile(db)]
83
+ });
84
+ return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
85
+ }
86
+ /** Epoch fencing makes all previously prepared writes fail before primary activation. */
87
+ async function freezeContentPartition(db, migration) {
88
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
89
+ if (current.route.migration_id !== migration.id || !["copying", "frozen"].includes(current.route.state)) throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
90
+ if (current.route.state === "frozen") return current.route;
91
+ await atomicBatch(db, {
92
+ checks: [current.check, sql`NOT EXISTS (SELECT 1 FROM ${sql.table(`ec_${migration.collection}`)} c WHERE NOT EXISTS (SELECT 1 FROM _dineway_content_locations l WHERE l.collection=${migration.collection} AND l.entry_id=c.id))`],
93
+ statements: [
94
+ sql`UPDATE _dineway_content_migrations SET state='frozen', updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE id=${migration.id}`.compile(db),
95
+ sql`UPDATE _dineway_content_partitions SET state='frozen', epoch=epoch+1, updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE collection=${migration.collection} AND partition=${migration.partition}`.compile(db),
96
+ sql`UPDATE _dineway_content_operations SET state='aborted', updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE collection=${migration.collection} AND state='pending' AND json_extract(command, '$.partition')=${migration.partition}`.compile(db)
97
+ ]
98
+ });
99
+ return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
100
+ }
101
+ /** Resume the old store only while every entry still points to it. */
102
+ async function cancelContentMigration(db, migration) {
103
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
104
+ if (current.route.migration_id !== migration.id || current.route.state === "active") throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
105
+ await atomicBatch(db, {
106
+ checks: [current.check, sql`NOT EXISTS (SELECT 1 FROM _dineway_content_locations WHERE collection=${migration.collection} AND partition=${migration.partition} AND store<>${current.route.store})`],
107
+ statements: [sql`UPDATE _dineway_content_migrations SET state='cancelled', updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE id=${migration.id}`.compile(db), sql`UPDATE _dineway_content_partitions SET state='active', migration_id=NULL, epoch=epoch+1, updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE collection=${migration.collection} AND partition=${migration.partition}`.compile(db)]
108
+ });
109
+ }
110
+
111
+ //#endregion
112
+ //#region src/content-storage/coordinator.ts
113
+ const locationKey = (location) => JSON.stringify([
114
+ location.collection,
115
+ location.entryId,
116
+ location.store,
117
+ location.partition,
118
+ location.routingVersion,
119
+ location.version,
120
+ location.digest
121
+ ]);
122
+ /** Run only during explicit deployment or migration, before serving requests. */
123
+ async function installContentStorageConfig(db, config, options = {}) {
124
+ validateContentStorage(config);
125
+ const digest = await contentDigest(config);
126
+ const checks = [];
127
+ const statements = [];
128
+ for (const collection of Object.keys(config.rules)) statements.push(...await prepareContentChangeJournal(db, collection));
129
+ if (!((await sql`SELECT 1 FROM _dineway_content_storage_config WHERE id = 'active'`.execute(db)).rows.length > 0)) for (const [collection, rule] of Object.entries(config.rules)) {
130
+ if (options.initial !== "primary") {
131
+ if ((await sql`SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ${`ec_${collection}`}`.execute(db)).rows.length > 0) checks.push(sql`NOT EXISTS (SELECT 1 FROM ${sql.table(`ec_${collection}`)})`);
132
+ }
133
+ for (const [partition, target] of Object.entries(rule.stores)) statements.push(sql`INSERT INTO _dineway_content_partitions (collection, partition, store, target_store, state, epoch, migration_id, updated_at) VALUES (${collection}, ${partition}, ${options.initial === "primary" ? "primary" : target}, ${target}, 'active', 1, NULL, ${(/* @__PURE__ */ new Date()).toISOString()})`.compile(db));
134
+ }
135
+ await atomicBatch(db, {
136
+ checks: [...checks, sql`NOT EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id = 'active' AND (version <> ${config.version} OR digest <> ${digest}))`],
137
+ statements: [...statements, sql`INSERT INTO _dineway_content_storage_config (id, version, digest) VALUES ('active', ${config.version}, ${digest}) ON CONFLICT (id) DO NOTHING`.compile(db)]
138
+ });
139
+ }
140
+ var ContentStorageCoordinator = class {
141
+ configDigest;
142
+ constructor(db, config, stores, resolvers = {}) {
143
+ this.db = db;
144
+ this.config = config;
145
+ this.stores = stores;
146
+ this.resolvers = resolvers;
147
+ validateContentStorage(config);
148
+ for (const name of Object.keys(config.stores)) if (!Object.hasOwn(stores, name)) throw new ContentStorageError("INVALID_CONFIG", `Content store ${name} is not loaded.`);
149
+ this.configDigest = contentDigest(config);
150
+ }
151
+ async locate(collection, entryId) {
152
+ const row = (await sql`SELECT collection, entry_id, store, partition, routing_version, version, digest FROM _dineway_content_locations WHERE collection = ${collection} AND entry_id = ${entryId}`.execute(this.db)).rows[0];
153
+ if (!row) return null;
154
+ return {
155
+ collection: row.collection,
156
+ entryId: row.entry_id,
157
+ store: row.store,
158
+ partition: row.partition,
159
+ routingVersion: row.routing_version,
160
+ version: row.version,
161
+ digest: row.digest
162
+ };
163
+ }
164
+ async read(collection, entryId) {
165
+ const location = await this.locate(collection, entryId);
166
+ if (!location) return null;
167
+ return (await this.readLocations([location]))[0] ?? null;
168
+ }
169
+ /** Locations come from the same directory query that selected and paginated the entries. */
170
+ async readLocations(locations, fields) {
171
+ const groups = /* @__PURE__ */ new Map();
172
+ for (const location of locations) {
173
+ const group = groups.get(location.store) ?? /* @__PURE__ */ new Map();
174
+ group.set(locationKey(location), location);
175
+ groups.set(location.store, group);
176
+ }
177
+ const result = /* @__PURE__ */ new Map();
178
+ const entries = [...groups];
179
+ for (let groupOffset = 0; groupOffset < entries.length; groupOffset += 4) await Promise.all(entries.slice(groupOffset, groupOffset + 4).map(async ([name, group]) => {
180
+ const store = this.stores[name];
181
+ if (!store) throw new ContentStorageError("UNAVAILABLE", "The content store is unavailable; the primary database is not a fallback.");
182
+ const requested = [...group.values()];
183
+ for (let offset = 0; offset < requested.length; offset += 16) {
184
+ const batch = requested.slice(offset, offset + 16);
185
+ const expected = new Set(batch.map(locationKey));
186
+ const values = await store.read(batch, fields);
187
+ for (const value of values) {
188
+ const identity = locationKey(value.command);
189
+ if (!expected.delete(identity) || (fields ? Object.keys(value.data).some((field) => !fields.includes(field)) : await contentDigest(value.data) !== value.command.digest)) throw new ContentStorageError("UNAVAILABLE", "The committed content version could not be verified.");
190
+ result.set(identity, value);
191
+ }
192
+ if (expected.size) throw new ContentStorageError("UNAVAILABLE", "The content store did not return all committed versions.");
193
+ }
194
+ }));
195
+ return locations.map((location) => result.get(locationKey(location)));
196
+ }
197
+ async commit(version, activation) {
198
+ let batch;
199
+ try {
200
+ batch = await this.prepareCommit(version, activation);
201
+ } catch (error) {
202
+ if (error instanceof ContentStorageReplay) return error.location;
203
+ throw error;
204
+ }
205
+ try {
206
+ await atomicBatch(this.db, batch);
207
+ } catch (error) {
208
+ const outcome = await this.operation(version.command.operationId);
209
+ if (outcome?.state !== "committed" || outcome.command !== canonicalContentJson(version.command)) throw error;
210
+ }
211
+ return version.command;
212
+ }
213
+ /** Stage remotely, then compose this activation with other primary-database business writes. */
214
+ async prepareCommit(version, activation) {
215
+ const { command, data } = version;
216
+ const partition = await readContentPartitionRoute(this.db, command.collection, command.partition);
217
+ if (partition.route.state === "frozen" || partition.route.store !== command.store || partition.route.epoch !== (command.partitionEpoch ?? 1)) throw new ContentStorageError("ROUTE_CHANGED", "The content partition is migrating or its route has changed.");
218
+ if (!command.operationId || !command.version || !command.principalId || !command.entryId) throw new ContentStorageError("CONFLICT", "Content writes require stable operation, principal, entry and version identifiers.");
219
+ if (command.version === command.expectedVersion) throw new ContentStorageError("CONFLICT", "A write must create a new immutable version.");
220
+ if (command.routingVersion !== this.config.version) throw new ContentStorageError("ROUTE_CHANGED", "The content routing version has changed.");
221
+ const destination = await resolveContentPartition(this.config, {
222
+ collection: command.collection,
223
+ id: command.entryId,
224
+ data
225
+ }, this.resolvers);
226
+ if (!destination || destination.store !== partition.route.target_store || destination.partition !== command.partition) throw new ContentStorageError("INVALID_PARTITION", "The write does not match its configured content partition.");
227
+ if (await contentDigest(data) !== command.digest) throw new ContentStorageError("CONFLICT", "Content does not match its prepared digest.");
228
+ const serialized = canonicalContentJson(command);
229
+ const existing = await this.operation(command.operationId);
230
+ if (existing && existing.command !== serialized) throw new ContentStorageError("CONFLICT", "An operation identifier cannot be reused for different content or authority.");
231
+ const routeCheck = sql`(${partition.check}) AND EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id = 'active' AND version = ${this.config.version} AND digest = ${await this.configDigest})`;
232
+ const authority = await activation.authorize(command);
233
+ if (existing?.state === "committed") {
234
+ await atomicBatch(this.db, {
235
+ checks: [routeCheck, ...authority],
236
+ statements: []
237
+ });
238
+ throw new ContentStorageReplay(command);
239
+ }
240
+ const locationCheck = command.expectedVersion === null ? sql`NOT EXISTS (SELECT 1 FROM _dineway_content_locations WHERE collection = ${command.collection} AND entry_id = ${command.entryId})` : sql`EXISTS (SELECT 1 FROM _dineway_content_locations WHERE collection = ${command.collection} AND entry_id = ${command.entryId} AND version = ${command.expectedVersion})`;
241
+ const now = (/* @__PURE__ */ new Date()).toISOString();
242
+ try {
243
+ await atomicBatch(this.db, {
244
+ checks: [
245
+ routeCheck,
246
+ locationCheck,
247
+ ...authority,
248
+ sql`NOT EXISTS (SELECT 1 FROM _dineway_content_operations WHERE id = ${command.operationId} AND command <> ${serialized})`
249
+ ],
250
+ statements: [sql`INSERT INTO _dineway_content_operations (id, collection, entry_id, command, state, created_at, updated_at) VALUES (${command.operationId}, ${command.collection}, ${command.entryId}, ${serialized}, 'pending', ${now}, ${now}) ON CONFLICT (id) DO NOTHING`.compile(this.db)]
251
+ });
252
+ } catch (error) {
253
+ const outcome = await this.operation(command.operationId);
254
+ if (outcome?.state !== "committed" || outcome.command !== serialized) throw error;
255
+ await atomicBatch(this.db, {
256
+ checks: [routeCheck, ...await activation.authorize(command)],
257
+ statements: []
258
+ });
259
+ throw new ContentStorageReplay(command);
260
+ }
261
+ await this.stores[command.store].prepare(version);
262
+ const projection = await activation.prepare(command);
263
+ return {
264
+ checks: [
265
+ routeCheck,
266
+ locationCheck,
267
+ ...await activation.authorize(command),
268
+ ...projection.checks ?? [],
269
+ sql`EXISTS (SELECT 1 FROM _dineway_content_operations WHERE id = ${command.operationId} AND command = ${serialized} AND state = 'pending')`
270
+ ],
271
+ statements: [
272
+ ...projection.statements,
273
+ sql`INSERT INTO _dineway_content_locations (collection, entry_id, store, partition, routing_version, version, digest) VALUES (${command.collection}, ${command.entryId}, ${command.store}, ${command.partition}, ${command.routingVersion}, ${command.version}, ${command.digest}) ON CONFLICT (collection, entry_id) DO UPDATE SET store = excluded.store, partition = excluded.partition, routing_version = excluded.routing_version, version = excluded.version, digest = excluded.digest`.compile(this.db),
274
+ sql`UPDATE _dineway_content_operations SET state = 'committed', updated_at = ${now} WHERE id = ${command.operationId}`.compile(this.db),
275
+ sql`INSERT INTO _dineway_content_commit_events (operation_id, collection, entry_id, command, created_at) VALUES (${command.operationId}, ${command.collection}, ${command.entryId}, ${serialized}, ${now}) ON CONFLICT (operation_id) DO NOTHING`.compile(this.db)
276
+ ]
277
+ };
278
+ }
279
+ async operation(id) {
280
+ return (await sql`SELECT command, state FROM _dineway_content_operations WHERE id = ${id}`.execute(this.db)).rows[0];
281
+ }
282
+ };
283
+
284
+ //#endregion
285
+ //#region src/content-storage/system-fields.ts
286
+ /** Primary directory metadata cannot be overwritten by a remote content payload. */
287
+ const CONTENT_SYSTEM_FIELDS = new Set([
288
+ "id",
289
+ "slug",
290
+ "status",
291
+ "author_id",
292
+ "primary_byline_id",
293
+ "created_at",
294
+ "updated_at",
295
+ "published_at",
296
+ "scheduled_at",
297
+ "deleted_at",
298
+ "version",
299
+ "live_revision_id",
300
+ "draft_revision_id",
301
+ "locale",
302
+ "translation_group"
303
+ ]);
304
+
305
+ //#endregion
306
+ //#region src/content-storage/runtime.ts
307
+ const REGISTRY = Symbol.for("dineway:content-storage-runtimes");
308
+ const root = globalThis;
309
+ const runtimes = root[REGISTRY] ??= /* @__PURE__ */ new WeakMap();
310
+ const REQUEST_STORES = Symbol.for("dineway:request-content-stores");
311
+ const requestStores = root[REQUEST_STORES] ??= /* @__PURE__ */ new WeakMap();
312
+ function registerContentStorage(db, runtime) {
313
+ runtimes.set(db, runtime);
314
+ }
315
+ /** Namespace object-cache values by deployment routing and stable physical identities. */
316
+ function contentStorageCacheScope() {
317
+ const context = getRequestContext();
318
+ if (context?.dbIsIsolated) return "";
319
+ const database = context?.primaryDb ?? context?.db;
320
+ const config = (database && typeof database === "object" ? runtimes.get(database) : void 0)?.config ?? globalThis.__dinewayConfig?.contentStorage;
321
+ if (!config) return "";
322
+ return canonicalContentJson({
323
+ version: config.version,
324
+ stores: Object.fromEntries(Object.entries(config.stores).map(([name, store]) => [name, store.identity]))
325
+ });
326
+ }
327
+ async function assertContentStorageConfiguration(db, config) {
328
+ const row = (await sql`SELECT version, digest FROM _dineway_content_storage_config WHERE id = 'active'`.execute(db)).rows[0];
329
+ if (!config && !row) return;
330
+ if (!config || !row || row.version !== config.version || row.digest !== await contentDigest(config)) throw new ContentStorageError("UNAVAILABLE", "Content routing configuration does not match the installed database configuration. Apply the explicit content storage migration before serving requests.");
331
+ }
332
+ function getContentStorageRuntime(db) {
333
+ const context = getRequestContext();
334
+ if (context?.dbIsIsolated) return void 0;
335
+ const primary = context?.primaryDb;
336
+ return runtimes.get(db) ?? (typeof primary === "object" && primary !== null ? runtimes.get(primary) : void 0);
337
+ }
338
+ function getContentStorage(db, collection) {
339
+ const context = getRequestContext();
340
+ const runtime = getContentStorageRuntime(db);
341
+ if (!runtime || !Object.hasOwn(runtime.config.rules, collection)) return void 0;
342
+ let stores = context ? requestStores.get(context)?.get(runtime) : void 0;
343
+ if (!stores) {
344
+ stores = runtime.createStores(context?.databaseMode === "primary" || !!context?.writePrincipal);
345
+ if (context) {
346
+ let entries = requestStores.get(context);
347
+ if (!entries) {
348
+ entries = /* @__PURE__ */ new Map();
349
+ requestStores.set(context, entries);
350
+ }
351
+ entries.set(runtime, stores);
352
+ }
353
+ }
354
+ return {
355
+ runtime,
356
+ stores,
357
+ coordinator: new ContentStorageCoordinator(db, runtime.config, stores, runtime.resolvers)
358
+ };
359
+ }
360
+ /** Resolve a bounded primary-index page in bulk, retaining the selected metadata and order. */
361
+ async function hydrateContentRows(db, collection, rows, fields) {
362
+ const storage = getContentStorage(db, collection);
363
+ if (!storage || !rows.length) return;
364
+ const byId = new Map(rows.filter((row) => typeof row.id === "string").map((row) => [String(row.id), row]));
365
+ const ids = [...byId.keys()];
366
+ const locations = [];
367
+ for (let offset = 0; offset < ids.length; offset += 80) {
368
+ const result = await sql`SELECT l.collection, l.entry_id, l.store, l.partition, l.routing_version, l.version, l.digest, c.version AS _entry_version, c.updated_at AS _entry_updated_at, c.status AS _entry_status, c.deleted_at AS _entry_deleted_at FROM _dineway_content_locations l JOIN ${sql.table(`ec_${collection}`)} c ON c.id = l.entry_id WHERE l.collection = ${collection} AND l.entry_id IN (${sql.join(ids.slice(offset, offset + 80))})`.execute(db);
369
+ for (const location of result.rows) {
370
+ const previous = byId.get(location.entry_id);
371
+ if (previous.version !== location._entry_version || [
372
+ "updated_at",
373
+ "status",
374
+ "deleted_at"
375
+ ].some((field) => Object.hasOwn(previous, field) && previous[field] !== Reflect.get(location, `_entry_${field}`))) throw new ContentStorageError("CONFLICT", "The content index changed while loading its stored version. Retry the read.");
376
+ }
377
+ locations.push(...result.rows.filter((row) => row.store !== "primary").map((row) => ({
378
+ collection: row.collection,
379
+ entryId: row.entry_id,
380
+ store: row.store,
381
+ partition: row.partition,
382
+ routingVersion: row.routing_version,
383
+ version: row.version,
384
+ digest: row.digest
385
+ })));
386
+ }
387
+ const versions = await storage.coordinator.readLocations(locations, fields?.filter((field) => !CONTENT_SYSTEM_FIELDS.has(field) && !field.startsWith("_")));
388
+ const byEntry = new Map(versions.map((version) => [version.command.entryId, version]));
389
+ for (const row of rows) {
390
+ const version = byEntry.get(String(row.id));
391
+ if (!version) continue;
392
+ for (const [field, value] of Object.entries(version.data)) {
393
+ if (field.startsWith("_") || CONTENT_SYSTEM_FIELDS.has(field) || fields && !fields.includes(field)) continue;
394
+ row[field] = value;
395
+ }
396
+ }
397
+ }
398
+
399
+ //#endregion
400
+ export { hydrateContentRows as a, installContentStorageConfig as c, contentPartitionWritable as d, freezeContentPartition as f, prepareContentChangeJournal as h, getContentStorageRuntime as i, beginContentMigration as l, contentChangeSequence as m, contentStorageCacheScope as n, registerContentStorage as o, readContentPartitionRoute as p, getContentStorage as r, ContentStorageCoordinator as s, assertContentStorageConfiguration as t, cancelContentMigration as u };
@@ -1,14 +1,17 @@
1
- import { $s as getDb, Js as EntryData, Qs as dinewayLoader, Ys as EntryFilter, qs as CollectionFilter } from "./types-D5JfvPvx.mjs";
2
- import "./types-B--VyN3n.mjs";
3
- import "./runner-SoP1rphP.mjs";
4
- import "./index-BVGe04wF.mjs";
5
- import "./types-B03h5jt_.mjs";
6
- import "./adapters-C8nRpUuj.mjs";
7
- import "./scheduled-publish-BxdShRGs.mjs";
8
- import "./public-url-Ccv0Xmue.mjs";
9
- import "./validate-kmN2lS8H.mjs";
10
- import "./byline-fields-D-b9CWux.mjs";
1
+ import { $s as getDb, Js as EntryData, Qs as dinewayLoader, Ys as EntryFilter, qs as CollectionFilter } from "./types-0gRlZbhN.mjs";
2
+ import "./types-Dpv_MvwZ.mjs";
3
+ import "./runner-DXQkyPeX.mjs";
4
+ import "./index-CLj17kW9.mjs";
5
+ import "./types-qOEot0UQ.mjs";
6
+ import "./types-DheoByey.mjs";
7
+ import "./adapters-lDnJjNDz.mjs";
8
+ import "./runtime-Bs2JMbb2.mjs";
9
+ import "./hook-events-BQw73jc7.mjs";
10
+ import "./scheduled-publish-eCNGpvNm.mjs";
11
+ import "./public-url-CEC1vj02.mjs";
12
+ import "./validate-DUscf6VG.mjs";
13
+ import "./byline-fields-B7pQ3LMi.mjs";
11
14
  import { withPrimaryDatabase } from "./request-context.mjs";
12
- import "./types-DsJTXStN.mjs";
13
- import { t as getMediaProvider } from "./provider-loader-DT7vQ5FI.mjs";
15
+ import "./types-BJztoTbF.mjs";
16
+ import { t as getMediaProvider } from "./provider-loader-oLKm1AU8.mjs";
14
17
  export { type CollectionFilter, type EntryData, type EntryFilter, dinewayLoader, getDb, getMediaProvider, withPrimaryDatabase };
package/dist/runtime.mjs CHANGED
@@ -1,8 +1,13 @@
1
1
  import { withPrimaryDatabase } from "./request-context.mjs";
2
+ import "./d1-binding-DrLMBUxu.mjs";
2
3
  import "./dialect-helpers-C6xtO-Ui.mjs";
3
- import "./base64-Cz-aU0X1.mjs";
4
- import "./types-RFzE_V1M.mjs";
5
- import { n as dinewayLoader, r as getDb } from "./loader-Dp6zLmQm.mjs";
6
- import { t as getMediaProvider } from "./provider-loader-DERzBMUz.mjs";
4
+ import "./config-6R0bchVE.mjs";
5
+ import "./runtime-Ch5G-tnG.mjs";
6
+ import "./revisions-qNkae-Dq.mjs";
7
+ import "./runtime-env-DpYGy4pT.mjs";
8
+ import "./base64-qvSs0Gxy.mjs";
9
+ import "./types-BI3ULB3A.mjs";
10
+ import { n as dinewayLoader, r as getDb } from "./loader-Bq1aW12P.mjs";
11
+ import { t as getMediaProvider } from "./provider-loader-DlaT1usE.mjs";
7
12
 
8
13
  export { dinewayLoader, getDb, getMediaProvider, withPrimaryDatabase };
@@ -0,0 +1,8 @@
1
+ import { c as __exportAll } from "./runner-CuG8o1uW.mjs";
2
+ import { n as SchemaRegistry } from "./registry-B-HULaJI.mjs";
3
+
4
+ //#region src/schema/index.ts
5
+ var schema_exports = /* @__PURE__ */ __exportAll({ SchemaRegistry: () => SchemaRegistry });
6
+
7
+ //#endregion
8
+ export { schema_exports as t };
@@ -1,9 +1,8 @@
1
- import { c as __exportAll } from "./runner-CRU7BXjr.mjs";
1
+ import { c as __exportAll } from "./runner-CuG8o1uW.mjs";
2
2
  import { t as validateIdentifier } from "./validate-Co3j6T_K.mjs";
3
- import { r as getDb } from "./loader-Dp6zLmQm.mjs";
4
- import { t as FTSManager } from "./fts-manager-BrPpYtK0.mjs";
3
+ import { r as getDb } from "./loader-Bq1aW12P.mjs";
4
+ import { t as FTSManager } from "./fts-manager-Zu5ITic0.mjs";
5
5
  import { sql } from "kysely";
6
- import { toPlainText } from "@portabletext/toolkit";
7
6
 
8
7
  //#region src/search/query.ts
9
8
  /** Pattern to split on whitespace for query term extraction */
@@ -238,102 +237,9 @@ function escapeQuery(query) {
238
237
  return terms.map((t) => `"${t}"*`).join(" ");
239
238
  }
240
239
 
241
- //#endregion
242
- //#region src/search/text-extraction.ts
243
- /**
244
- * Text Extraction
245
- *
246
- * Extracts plain text from Portable Text blocks for FTS indexing.
247
- * Uses @portabletext/toolkit as base with extensions for custom block types.
248
- */
249
- /**
250
- * Validate that a value looks like a Portable Text block array.
251
- * Each element must have at least a `_type` string property.
252
- */
253
- function isPortableTextArray(value) {
254
- return value.every((item) => typeof item === "object" && item !== null && "_type" in item && typeof item._type === "string");
255
- }
256
- /**
257
- * Extract additional text from custom block types that toPlainText doesn't handle
258
- */
259
- function extractCustomBlockText(block) {
260
- if (block._type === "code" && "code" in block && typeof block.code === "string") return block.code;
261
- if (block._type === "image") {
262
- const parts = [];
263
- if ("alt" in block && typeof block.alt === "string" && block.alt) parts.push(block.alt);
264
- if ("caption" in block && typeof block.caption === "string" && block.caption) parts.push(block.caption);
265
- return parts.join(" ");
266
- }
267
- return "";
268
- }
269
- /**
270
- * Extract plain text from Portable Text blocks
271
- *
272
- * Uses @portabletext/toolkit's toPlainText for standard blocks,
273
- * plus extracts text from custom block types (code, images with alt/caption).
274
- *
275
- * @param blocks - Array of Portable Text blocks (or a JSON string)
276
- * @returns Plain text content
277
- *
278
- * @example
279
- * ```typescript
280
- * const text = extractPlainText([
281
- * {
282
- * _type: "block",
283
- * _key: "abc",
284
- * children: [{ _type: "span", _key: "s1", text: "Hello World" }]
285
- * }
286
- * ]);
287
- * // Returns: "Hello World"
288
- * ```
289
- */
290
- function extractPlainText(blocks) {
291
- if (!blocks) return "";
292
- let parsedBlocks;
293
- if (typeof blocks === "string") try {
294
- parsedBlocks = JSON.parse(blocks);
295
- } catch {
296
- return blocks;
297
- }
298
- else parsedBlocks = blocks;
299
- if (!Array.isArray(parsedBlocks)) return "";
300
- return [toPlainText(parsedBlocks.map((b) => {
301
- const obj = { _type: b._type };
302
- for (const [key, val] of Object.entries(b)) obj[key] = val;
303
- return obj;
304
- })), ...parsedBlocks.map(extractCustomBlockText).filter((text) => text.length > 0)].filter((t) => t.length > 0).join("\n");
305
- }
306
- /**
307
- * Extract searchable text from a content entry
308
- *
309
- * Extracts text from specified fields, handling both plain text and Portable Text.
310
- *
311
- * @param entry - Content entry data
312
- * @param fields - Field names to extract text from
313
- * @returns Object mapping field names to extracted text
314
- */
315
- function extractSearchableFields(entry, fields) {
316
- const result = {};
317
- for (const field of fields) {
318
- const value = entry[field];
319
- if (value === null || value === void 0) {
320
- result[field] = "";
321
- continue;
322
- }
323
- if (typeof value === "string") if (value.startsWith("[")) result[field] = extractPlainText(value);
324
- else result[field] = value;
325
- else if (Array.isArray(value)) if (isPortableTextArray(value)) result[field] = extractPlainText(value);
326
- else result[field] = JSON.stringify(value);
327
- else if (typeof value === "object") result[field] = JSON.stringify(value);
328
- else if (typeof value === "number" || typeof value === "boolean") result[field] = `${value}`;
329
- else result[field] = "";
330
- }
331
- return result;
332
- }
333
-
334
240
  //#endregion
335
241
  //#region src/search/index.ts
336
242
  var search_exports = /* @__PURE__ */ __exportAll({ searchWithDb: () => searchWithDb });
337
243
 
338
244
  //#endregion
339
- export { getSuggestions as a, searchWithDb as c, getSearchStats as i, extractPlainText as n, search as o, extractSearchableFields as r, searchCollection as s, search_exports as t };
245
+ export { searchCollection as a, search as i, getSearchStats as n, searchWithDb as o, getSuggestions as r, search_exports as t };