dineway 0.2.45 → 0.2.47

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 (220) hide show
  1. package/dist/api/route-utils.d.mts +4 -4
  2. package/dist/api/route-utils.mjs +11 -11
  3. package/dist/api/schemas/index.d.mts +1 -1
  4. package/dist/{api-CB2KRW3W.mjs → api-CJ_MN3ZM.mjs} +9 -9
  5. package/dist/{apply-SoTzf8LK.mjs → apply-AOuBTila.mjs} +14 -14
  6. package/dist/astro/index.d.mts +3 -3
  7. package/dist/astro/index.mjs +4 -4
  8. package/dist/astro/middleware/auth.d.mts +3 -3
  9. package/dist/astro/middleware/auth.mjs +2 -2
  10. package/dist/astro/middleware/redirect.mjs +3 -3
  11. package/dist/astro/middleware/setup.mjs +1 -1
  12. package/dist/astro/middleware.mjs +58 -58
  13. package/dist/astro/routes/api/admin/briefing.mjs +15 -15
  14. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +7 -7
  15. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +7 -7
  16. package/dist/astro/routes/api/admin/bylines/index.mjs +7 -7
  17. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +5 -5
  18. package/dist/astro/routes/api/admin/comments/_id_.mjs +4 -4
  19. package/dist/astro/routes/api/admin/comments/bulk.mjs +4 -4
  20. package/dist/astro/routes/api/admin/comments/counts.mjs +4 -4
  21. package/dist/astro/routes/api/admin/comments/index.mjs +4 -4
  22. package/dist/astro/routes/api/admin/context/_id_/history.mjs +23 -23
  23. package/dist/astro/routes/api/admin/context/_id_/index.mjs +23 -23
  24. package/dist/astro/routes/api/admin/context/_id_/review.mjs +24 -24
  25. package/dist/astro/routes/api/admin/context/_id_/supersede.mjs +24 -24
  26. package/dist/astro/routes/api/admin/context/diff.mjs +23 -23
  27. package/dist/astro/routes/api/admin/context/index.mjs +24 -24
  28. package/dist/astro/routes/api/admin/context/stale.mjs +23 -23
  29. package/dist/astro/routes/api/admin/hitl-requests/_id_/index.mjs +24 -24
  30. package/dist/astro/routes/api/admin/hitl-requests/_id_/resolve.mjs +24 -24
  31. package/dist/astro/routes/api/admin/hitl-requests/index.mjs +24 -24
  32. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +23 -23
  33. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +38 -38
  34. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +38 -38
  35. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +34 -34
  36. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +38 -38
  37. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +38 -38
  38. package/dist/astro/routes/api/admin/plugins/index.mjs +34 -34
  39. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +34 -34
  40. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +38 -38
  41. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +34 -34
  42. package/dist/astro/routes/api/admin/plugins/updates.mjs +34 -34
  43. package/dist/astro/routes/api/admin/review-requests/_id_/image.mjs +15 -15
  44. package/dist/astro/routes/api/admin/review-requests/_id_/index.mjs +20 -20
  45. package/dist/astro/routes/api/admin/review-requests/_id_/resolve.mjs +27 -27
  46. package/dist/astro/routes/api/admin/review-requests/index.mjs +25 -25
  47. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +34 -34
  48. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +34 -34
  49. package/dist/astro/routes/api/auth/invite/complete.mjs +2 -2
  50. package/dist/astro/routes/api/auth/invite/register-options.mjs +1 -1
  51. package/dist/astro/routes/api/auth/mode.mjs +1 -1
  52. package/dist/astro/routes/api/auth/passkey/options.mjs +1 -1
  53. package/dist/astro/routes/api/auth/passkey/register/options.mjs +1 -1
  54. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +2 -2
  55. package/dist/astro/routes/api/auth/passkey/verify.mjs +2 -2
  56. package/dist/astro/routes/api/auth/signup/complete.mjs +2 -2
  57. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.d.mts +3 -3
  58. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +5 -5
  59. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +4 -4
  60. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +5 -5
  61. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +14 -14
  62. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +14 -14
  63. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +10 -10
  64. package/dist/astro/routes/api/content/_collection_/_id_.mjs +3 -3
  65. package/dist/astro/routes/api/content/_collection_/index.mjs +3 -3
  66. package/dist/astro/routes/api/dashboard.mjs +8 -8
  67. package/dist/astro/routes/api/health.mjs +1 -1
  68. package/dist/astro/routes/api/import/probe.mjs +8 -8
  69. package/dist/astro/routes/api/import/wordpress/analyze.mjs +4 -4
  70. package/dist/astro/routes/api/import/wordpress/execute.d.mts +3 -3
  71. package/dist/astro/routes/api/import/wordpress/execute.mjs +26 -26
  72. package/dist/astro/routes/api/import/wordpress/media.d.mts +3 -3
  73. package/dist/astro/routes/api/import/wordpress/prepare.mjs +24 -24
  74. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +3 -3
  75. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +24 -24
  76. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +10 -10
  77. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +3 -3
  78. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +27 -27
  79. package/dist/astro/routes/api/manifest.mjs +2 -2
  80. package/dist/astro/routes/api/mcp.mjs +59 -59
  81. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +24 -24
  82. package/dist/astro/routes/api/menus/_name_/items.mjs +24 -24
  83. package/dist/astro/routes/api/menus/_name_/reorder.mjs +24 -24
  84. package/dist/astro/routes/api/menus/_name_/translations.mjs +24 -24
  85. package/dist/astro/routes/api/menus/_name_.mjs +24 -24
  86. package/dist/astro/routes/api/menus/index.mjs +24 -24
  87. package/dist/astro/routes/api/openapi.json.mjs +1 -1
  88. package/dist/astro/routes/api/redirects/_id_.mjs +23 -23
  89. package/dist/astro/routes/api/redirects/index.mjs +23 -23
  90. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +34 -34
  91. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +34 -34
  92. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +34 -34
  93. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +34 -34
  94. package/dist/astro/routes/api/schema/collections/index.mjs +34 -34
  95. package/dist/astro/routes/api/schema/index.mjs +4 -4
  96. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +34 -34
  97. package/dist/astro/routes/api/schema/orphans/index.mjs +34 -34
  98. package/dist/astro/routes/api/search/enable.mjs +4 -4
  99. package/dist/astro/routes/api/search/index.mjs +4 -4
  100. package/dist/astro/routes/api/search/rebuild.mjs +4 -4
  101. package/dist/astro/routes/api/search/stats.mjs +4 -4
  102. package/dist/astro/routes/api/search/suggest.mjs +4 -4
  103. package/dist/astro/routes/api/sections/_slug_.mjs +24 -24
  104. package/dist/astro/routes/api/sections/index.mjs +24 -24
  105. package/dist/astro/routes/api/settings/reviews.mjs +1 -1
  106. package/dist/astro/routes/api/settings.mjs +24 -24
  107. package/dist/astro/routes/api/setup/admin-verify.mjs +3 -3
  108. package/dist/astro/routes/api/setup/admin.mjs +1 -1
  109. package/dist/astro/routes/api/setup/dev-bypass.mjs +17 -17
  110. package/dist/astro/routes/api/setup/index.mjs +18 -18
  111. package/dist/astro/routes/api/setup/status.mjs +1 -1
  112. package/dist/astro/routes/api/snapshot.mjs +1 -1
  113. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +26 -26
  114. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +26 -26
  115. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +26 -26
  116. package/dist/astro/routes/api/taxonomies/index.mjs +26 -26
  117. package/dist/astro/routes/api/typegen.mjs +2 -2
  118. package/dist/astro/routes/api/well-known/auth.mjs +2 -2
  119. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +23 -23
  120. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +24 -24
  121. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +24 -24
  122. package/dist/astro/routes/api/widget-areas/_name_.mjs +24 -24
  123. package/dist/astro/routes/api/widget-areas/index.mjs +24 -24
  124. package/dist/astro/routes/robots.txt.mjs +5 -5
  125. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  126. package/dist/astro/routes/sitemap.xml.mjs +9 -9
  127. package/dist/astro/session-driver.mjs +3 -3
  128. package/dist/astro/types.d.mts +3 -3
  129. package/dist/{briefing-CXQA-DpY.mjs → briefing-8OgwfN-y.mjs} +1 -1
  130. package/dist/{briefing-9YqN5XoW.mjs → briefing-CQk5h4t6.mjs} +5 -5
  131. package/dist/{byline-BvFH-UZw.mjs → byline-DGTZqRM0.mjs} +5 -5
  132. package/dist/{byline-fields-Dyts_tJ5.d.mts → byline-fields-DvYufwxE.d.mts} +30 -30
  133. package/dist/{bylines-DLFjKcNr.mjs → bylines-BO0rdeMa.mjs} +3 -3
  134. package/dist/{bylines-ZfS9Qm_E.mjs → bylines-D27pVrb-.mjs} +1 -1
  135. package/dist/cli/index.mjs +36 -30
  136. package/dist/cli/plugin-kit.d.mts +3 -3
  137. package/dist/client/index.d.mts +3 -3
  138. package/dist/{comment-CbGlRPPS.mjs → comment--XUWDcJD.mjs} +1 -1
  139. package/dist/{comments-BFXekTqN.mjs → comments-1RMjBvK3.mjs} +1 -1
  140. package/dist/{content-Dxx0H4k8.mjs → content-rb8lZEfT.mjs} +4 -4
  141. package/dist/{content-refresh-COi0WfKw.mjs → content-refresh-Dl938dTm.mjs} +2 -2
  142. package/dist/content-storage/index.d.mts +5 -3
  143. package/dist/content-storage/index.mjs +13 -13
  144. package/dist/content-storage/store.d.mts +2 -2
  145. package/dist/content-storage/store.mjs +2 -2
  146. package/dist/{content-write-eOTKAf2d.mjs → content-write-DPszY76R.mjs} +10 -10
  147. package/dist/{context-c4OnrX-0.mjs → context-BrzB9nTR.mjs} +4 -4
  148. package/dist/{context-CjeMWXtq.mjs → context-I9mz_9uB.mjs} +2 -2
  149. package/dist/{dashboard-C_x93lbv.mjs → dashboard-CZtacCz9.mjs} +1 -1
  150. package/dist/database/d1/index.d.mts +3 -3
  151. package/dist/database/d1/index.mjs +2 -2
  152. package/dist/{discovery-CIgViNk9.mjs → discovery-BjyZQy47.mjs} +1 -1
  153. package/dist/{evidence-FRy3SVTP.mjs → evidence-DE40B1zz.mjs} +2 -2
  154. package/dist/{hitl-requests-DtPNPiYe.mjs → hitl-requests-DsLqU9VX.mjs} +1 -1
  155. package/dist/{hitl-route-helpers-BKI0ZeUF.mjs → hitl-route-helpers-BVgtDm47.mjs} +1 -1
  156. package/dist/{import-Cn1_u1S2.mjs → import-DrzBQKha.mjs} +3 -3
  157. package/dist/index.d.mts +3 -3
  158. package/dist/index.mjs +46 -46
  159. package/dist/{jsonld-DZXdAyOK.d.mts → jsonld-Qr9dwCK4.d.mts} +1 -1
  160. package/dist/{loader-C9hvIKEW.mjs → loader-Q07mEStb.mjs} +4 -4
  161. package/dist/{mcp-reviewed-executor-B4O9L9MT.mjs → mcp-reviewed-executor-mRdtNIf1.mjs} +2 -2
  162. package/dist/media/local-runtime.d.mts +3 -3
  163. package/dist/{menus-DL-BYzwG.mjs → menus-Coq8FLPj.mjs} +3 -3
  164. package/dist/{menus-BfQjG9Wc.mjs → menus-DDxZ0JiZ.mjs} +1 -1
  165. package/dist/{migration-B9FyV3ET.mjs → migration-B7DanZKm.mjs} +38 -8
  166. package/dist/{object-cache-qP60KjUp.mjs → object-cache-DeIkrWmq.mjs} +1 -1
  167. package/dist/{owned-metadata-CJs4-k1w.mjs → owned-metadata-LUF0xC0h.mjs} +1 -1
  168. package/dist/page/index.d.mts +4 -4
  169. package/dist/plugin-utils.d.mts +3 -3
  170. package/dist/plugins/adapt-sandbox-entry.d.mts +3 -3
  171. package/dist/{plugins-rop9tkYG.mjs → plugins-Dh2fBfX7.mjs} +2 -2
  172. package/dist/{public-url-DLcDMtBJ.d.mts → public-url-C60HX3NR.d.mts} +1 -1
  173. package/dist/{publication-authorization-CS8WqkzL.mjs → publication-authorization-e0sPJ9OP.mjs} +4 -4
  174. package/dist/{query-B1t4PSfw.mjs → query-BvYbhblK.mjs} +10 -10
  175. package/dist/{query-D0qnvePL.mjs → query-CyzBZrWv.mjs} +3 -3
  176. package/dist/{registry-3xWpSYNI.mjs → registry-BpNZLrXn.mjs} +1 -1
  177. package/dist/{release-Bk-UaI2C.mjs → release-CIYyinzY.mjs} +1 -1
  178. package/dist/request-context.d.mts +1 -11
  179. package/dist/{review-requests-BQZp6VaG.mjs → review-requests-R9L2Aubm.mjs} +1 -1
  180. package/dist/{revision-BhnVYOMz.mjs → revision-DfrRhPgw.mjs} +2 -2
  181. package/dist/{revisions-C-T9CdGo.mjs → revisions-DnV1P4O5.mjs} +1 -1
  182. package/dist/{runtime-Dz7vZRPU.mjs → runtime-CmupMaEb.mjs} +124 -61
  183. package/dist/{runtime-Dx9QpCL5.d.mts → runtime-ecsN2xL9.d.mts} +1 -1
  184. package/dist/runtime.d.mts +3 -3
  185. package/dist/runtime.mjs +3 -3
  186. package/dist/{schema-2x9K4t9t.mjs → schema-siddXiB9.mjs} +1 -1
  187. package/dist/{search--Qmm2s6n.mjs → search-giRjxqrh.mjs} +1 -1
  188. package/dist/{sections-0cg9Dhp6.mjs → sections-DqBH0bCm.mjs} +1 -1
  189. package/dist/seed/index.mjs +17 -17
  190. package/dist/seo/index.mjs +5 -5
  191. package/dist/{seo-BYBqbsZk.mjs → seo-Dsh31oy8.mjs} +1 -1
  192. package/dist/{seo-DxrTizK0.mjs → seo-TWEsRapq.mjs} +5 -5
  193. package/dist/{service-Y-ZEhFVM.mjs → service-CFLkZn2S.mjs} +2 -2
  194. package/dist/{settings-DM4P-jVe.mjs → settings-ByRmK-Mg.mjs} +1 -1
  195. package/dist/{settings-D0SBKo-W.mjs → settings-Dn4XvS7H.mjs} +2 -2
  196. package/dist/{site-context-DNiKKCc1.mjs → site-context-CHfuvD9v.mjs} +6 -6
  197. package/dist/{submission-C7tI1Frs.mjs → submission-C_DNrA5y.mjs} +4 -4
  198. package/dist/{taxonomies-CZHI0fCa.mjs → taxonomies-BCuDkFFS.mjs} +3 -3
  199. package/dist/{taxonomies-Cf9huhQ6.mjs → taxonomies-PWPhdhgN.mjs} +2 -2
  200. package/dist/{taxonomy-B4O77tAe.mjs → taxonomy-YxipNvfL.mjs} +3 -3
  201. package/dist/{types-z2nZassR.d.mts → types-1NHQF2Yh.d.mts} +4 -4
  202. package/dist/ui/server-runtime.d.mts +5 -5
  203. package/dist/ui/server-runtime.mjs +13 -13
  204. package/dist/version-DkCuTQ-N.mjs +6 -0
  205. package/dist/{version-store-DyYULGd3.mjs → version-store-B2n_Gfkq.mjs} +2 -10
  206. package/dist/{version-store-B6i81L9W.d.mts → version-store-mMm7pcYK.d.mts} +1 -36
  207. package/dist/{widgets-P1hMbKIT.mjs → widgets-C_9KBEwT.mjs} +1 -1
  208. package/dist/{worker-CcvePQzq.mjs → worker-Dl9S5-Tl.mjs} +4 -4
  209. package/dist/{write-intent-D6xfcx1f.mjs → write-intent-4Q8sNg11.mjs} +2 -2
  210. package/package.json +2 -2
  211. package/dist/version-CtBv2gNa.mjs +0 -6
  212. /package/dist/{allowed-origins-CQyKpMbJ.mjs → allowed-origins-SQbPK6WG.mjs} +0 -0
  213. /package/dist/{challenge-store-BImHCJvl.mjs → challenge-store-7IZ_NqWg.mjs} +0 -0
  214. /package/dist/{context-route-helpers-CGA2fsiz.mjs → context-route-helpers-CUrRB8qt.mjs} +0 -0
  215. /package/dist/{mode-BoM5FjH7.mjs → mode-C3RI5Z5t.mjs} +0 -0
  216. /package/dist/{policy-BL8yj6uD.mjs → policy-DbceGc4P.mjs} +0 -0
  217. /package/dist/{session-user-j7I8GMvK.mjs → session-user-D36BRaZY.mjs} +0 -0
  218. /package/dist/{setup-complete-Cn-Ho9RX.mjs → setup-complete-eTV6C0-E.mjs} +0 -0
  219. /package/dist/{state-LzJZ7qpq.mjs → state-CKkqoA6i.mjs} +0 -0
  220. /package/dist/{workers-build-Bd4w1aw9.mjs → workers-build-4926MPc0.mjs} +0 -0
@@ -3,8 +3,8 @@ import { t as readRuntimeEnv } from "./runtime-env-DpYGy4pT.mjs";
3
3
  import { i as encodeBase64url, n as decodeBase64url } from "./base64-qvSs0Gxy.mjs";
4
4
  import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-Bb56aCtB.mjs";
5
5
  import { t as OptionsRepository } from "./options-yFkLUuTw.mjs";
6
- import { a as setCronTasksEnabled, n as createPluginContext, t as PluginContextFactory } from "./context-c4OnrX-0.mjs";
7
- import { d as HookPipeline, p as resolveExclusiveHooks } from "./briefing-9YqN5XoW.mjs";
6
+ import { a as setCronTasksEnabled, n as createPluginContext, t as PluginContextFactory } from "./context-BrzB9nTR.mjs";
7
+ import { d as HookPipeline, p as resolveExclusiveHooks } from "./briefing-CQk5h4t6.mjs";
8
8
  import { i as parseEncryptionKeys, t as DinewaySecretsError } from "./secrets-D52WNV_c.mjs";
9
9
  import { t as extractRequestMeta } from "./request-meta-DOBXMRX0.mjs";
10
10
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,4 +1,4 @@
1
- import { Oo as DinewayConfig } from "./types-z2nZassR.mjs";
1
+ import { Oo as DinewayConfig } from "./types-1NHQF2Yh.mjs";
2
2
 
3
3
  //#region src/api/public-url.d.ts
4
4
  /**
@@ -2,15 +2,15 @@ import { AtomicWriteConflict, atomicBatch, isD1Database, rowUnchanged } from "./
2
2
  import { r as currentIsoTimestampValue } from "./dialect-helpers-C6xtO-Ui.mjs";
3
3
  import { i as encodeCursor, r as decodeCursor } from "./types-BI3ULB3A.mjs";
4
4
  import { r as getOAuthTokenHash, t as SYSTEM_ACTOR_ID } from "./actor-D0AW80ld.mjs";
5
- import { r as prepareContentLifecycleEvents, t as ContentRepository } from "./content-Dxx0H4k8.mjs";
6
- import { o as invalidateCollectionCache } from "./object-cache-qP60KjUp.mjs";
5
+ import { r as prepareContentLifecycleEvents, t as ContentRepository } from "./content-rb8lZEfT.mjs";
6
+ import { o as invalidateCollectionCache } from "./object-cache-DeIkrWmq.mjs";
7
7
  import { t as SiteActivityRepository } from "./site-activity-hpfJkmxQ.mjs";
8
8
  import { n as stableStringify } from "./stable-hash-9RDJgfif.mjs";
9
9
  import { r as ReviewRequestRepository } from "./review-requests-DZYM51yI.mjs";
10
10
  import { i as invalidateRedirectCache } from "./cache-DsEbwFVE.mjs";
11
- import { T as prepareContentPublication } from "./content-write-eOTKAf2d.mjs";
11
+ import { T as prepareContentPublication } from "./content-write-DPszY76R.mjs";
12
12
  import { n as buildStableActionHash, t as ReviewPayloadBuilder } from "./review-payload-mDJIgcFy.mjs";
13
- import { a as getSiteSettingsWithDb } from "./settings-D0SBKo-W.mjs";
13
+ import { a as getSiteSettingsWithDb } from "./settings-Dn4XvS7H.mjs";
14
14
  import { n as redactActivityRecord } from "./activity-lyE6xCrf.mjs";
15
15
  import { sql } from "kysely";
16
16
  import { ulid } from "ulidx";
@@ -2,9 +2,9 @@ import { c as __exportAll } from "./runner-CuG8o1uW.mjs";
2
2
  import { getRequestContext } from "./request-context.mjs";
3
3
  import { n as getI18nConfig, r as isI18nEnabled, t as getFallbackChain } from "./config-XW5tMrH8.mjs";
4
4
  import { i as encodeCursor } from "./types-BI3ULB3A.mjs";
5
- import { o as isMissingTableError, s as takeLiveCollectionMeta, t as CURSOR_RAW_VALUES } from "./loader-C9hvIKEW.mjs";
5
+ import { o as isMissingTableError, s as takeLiveCollectionMeta, t as CURSOR_RAW_VALUES } from "./loader-Q07mEStb.mjs";
6
6
  import { r as requestCached } from "./request-cache-CizvDoxV.mjs";
7
- import { i as contentNamespaces, n as cachedQuery, u as invalidateSchemaObjectCache } from "./object-cache-qP60KjUp.mjs";
7
+ import { i as contentNamespaces, n as cachedQuery, u as invalidateSchemaObjectCache } from "./object-cache-DeIkrWmq.mjs";
8
8
 
9
9
  //#region src/visual-editing/editable.ts
10
10
  /**
@@ -597,7 +597,7 @@ async function hydrateEntryBylines(type, entries) {
597
597
  let needsQueryPath = parsed.some((item) => item.credits.length === 0 && (dataStr(item.data, "authorId") !== "" || dataStr(item.data, "primaryBylineId") !== ""));
598
598
  let hasCustomFields = false;
599
599
  if (!needsQueryPath) try {
600
- const { getDb } = await import("./loader-C9hvIKEW.mjs").then((n) => n.i);
600
+ const { getDb } = await import("./loader-Q07mEStb.mjs").then((n) => n.i);
601
601
  const db = await getDb();
602
602
  const { getBylineFieldDefs } = await import("./field-defs-cache-dn5Tw79A.mjs").then((n) => n.t);
603
603
  hasCustomFields = (await getBylineFieldDefs(db)).length > 0;
@@ -613,7 +613,7 @@ async function hydrateEntryBylines(type, entries) {
613
613
  }
614
614
  }
615
615
  try {
616
- const { getBylinesForEntries } = await import("./bylines-DLFjKcNr.mjs").then((n) => n.t);
616
+ const { getBylinesForEntries } = await import("./bylines-BO0rdeMa.mjs").then((n) => n.t);
617
617
  const refs = entries.map((entry) => {
618
618
  const data = entryData(entry);
619
619
  const id = dataStr(data, "id");
@@ -671,12 +671,12 @@ async function hydrateEntryTerms(type, entries, locale) {
671
671
  byTaxonomy: grouped
672
672
  });
673
673
  }
674
- const { primeFoldedEntryTerms } = await import("./taxonomies-CZHI0fCa.mjs").then((n) => n.u);
674
+ const { primeFoldedEntryTerms } = await import("./taxonomies-BCuDkFFS.mjs").then((n) => n.u);
675
675
  primeFoldedEntryTerms(type, perEntry, { locale });
676
676
  return;
677
677
  }
678
678
  try {
679
- const { getAllTermsForEntries } = await import("./taxonomies-CZHI0fCa.mjs").then((n) => n.u);
679
+ const { getAllTermsForEntries } = await import("./taxonomies-BCuDkFFS.mjs").then((n) => n.u);
680
680
  const ids = entries.map((entry) => dataStr(entryData(entry), "id")).filter(Boolean);
681
681
  if (ids.length === 0) return;
682
682
  const termsMap = await getAllTermsForEntries(type, ids, { locale });
@@ -710,9 +710,9 @@ async function hydrateEntryTerms(type, entries, locale) {
710
710
  */
711
711
  async function getTranslations(type, id) {
712
712
  try {
713
- const db = (await import("./loader-C9hvIKEW.mjs").then((n) => n.i)).getDb;
713
+ const db = (await import("./loader-Q07mEStb.mjs").then((n) => n.i)).getDb;
714
714
  const dbInstance = await db();
715
- const { ContentRepository } = await import("./content-Dxx0H4k8.mjs").then((n) => n.n);
715
+ const { ContentRepository } = await import("./content-rb8lZEfT.mjs").then((n) => n.n);
716
716
  const repo = new ContentRepository(dbInstance);
717
717
  const item = await repo.findByIdOrSlug(type, id);
718
718
  if (!item) return {
@@ -780,8 +780,8 @@ async function resolveDinewayPath(path) {
780
780
  const hasDbOverride = !!getRequestContext()?.db && getRequestContext()?.dbIsIsolated !== false;
781
781
  let patterns = !hasDbOverride ? cachedUrlPatterns : null;
782
782
  if (!patterns) {
783
- const { getDb } = await import("./loader-C9hvIKEW.mjs").then((n) => n.i);
784
- const { SchemaRegistry } = await import("./registry-3xWpSYNI.mjs").then((n) => n.r);
783
+ const { getDb } = await import("./loader-Q07mEStb.mjs").then((n) => n.i);
784
+ const { SchemaRegistry } = await import("./registry-BpNZLrXn.mjs").then((n) => n.r);
785
785
  patterns = (await new SchemaRegistry(await getDb()).listCollections()).filter((collection) => collection.urlPattern).map((collection) => {
786
786
  const { regex, paramNames } = patternToRegex(collection.urlPattern);
787
787
  return {
@@ -1,7 +1,7 @@
1
- import { r as getDb } from "./loader-C9hvIKEW.mjs";
1
+ import { r as getDb } from "./loader-Q07mEStb.mjs";
2
2
  import { r as requestCached } from "./request-cache-CizvDoxV.mjs";
3
- import { n as cachedQuery, t as CacheNamespace } from "./object-cache-qP60KjUp.mjs";
4
- import { n as SchemaRegistry } from "./registry-3xWpSYNI.mjs";
3
+ import { n as cachedQuery, t as CacheNamespace } from "./object-cache-DeIkrWmq.mjs";
4
+ import { n as SchemaRegistry } from "./registry-BpNZLrXn.mjs";
5
5
 
6
6
  //#region src/schema/query.ts
7
7
  /**
@@ -6,7 +6,7 @@ import { n as contentLocaleUpdatedIndexName, t as contentLocaleCreatedIndexName
6
6
  import { a as RESERVED_COLLECTION_SLUGS, o as RESERVED_FIELD_SLUGS, r as FIELD_TYPE_TO_COLUMN } from "./types-BgUxCuwu.mjs";
7
7
  import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-Bb56aCtB.mjs";
8
8
  import { t as buildStableHash } from "./stable-hash-9RDJgfif.mjs";
9
- import { a as markContentMediaUsageCollectionStaleSafely, n as deleteContentMediaUsageCollection } from "./content-refresh-COi0WfKw.mjs";
9
+ import { a as markContentMediaUsageCollectionStaleSafely, n as deleteContentMediaUsageCollection } from "./content-refresh-Dl938dTm.mjs";
10
10
  import { r as parseSearchConfig, t as FTSManager } from "./fts-manager-BHwhq1lC.mjs";
11
11
  import { t as parsePublicDiscoveryRules } from "./public-discovery-CGRirTJH.mjs";
12
12
  import { sql } from "kysely";
@@ -1,7 +1,7 @@
1
1
  import { s as migrateD1, t as MIGRATION_NAMES } from "./runner-CuG8o1uW.mjs";
2
2
  import { atomicBatch, ensureAtomicBatchSchema, isD1Database } from "./database/batch.mjs";
3
3
  import { t as pluginMigrationTableNames } from "./migrations-DTCIQJ2_.mjs";
4
- import { n as d1ReleaseRevision } from "./state-LzJZ7qpq.mjs";
4
+ import { n as d1ReleaseRevision } from "./state-CKkqoA6i.mjs";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { CompiledQuery, sql } from "kysely";
7
7
 
@@ -21,17 +21,7 @@ interface RequestMetrics {
21
21
  rowsRead: number;
22
22
  rowsWritten: number;
23
23
  };
24
- contentStores?: {
25
- calls: number;
26
- queueMs: number;
27
- totalMs: number;
28
- serviceMs: number;
29
- databaseMs: number;
30
- sqlMs: number;
31
- statements: number;
32
- rowsRead: number;
33
- rowsWritten: number;
34
- };
24
+ contentStores?: RequestMetrics["d1"];
35
25
  dbCount: number;
36
26
  dbTotalMs: number;
37
27
  dbFirstOffset: number | null;
@@ -1,5 +1,5 @@
1
1
  import { n as RejectedReviewContentError, r as ReviewRequestRepository } from "./review-requests-DZYM51yI.mjs";
2
- import { r as submitAutomatedReview, t as ReviewSubmissionError } from "./submission-C7tI1Frs.mjs";
2
+ import { r as submitAutomatedReview, t as ReviewSubmissionError } from "./submission-C_DNrA5y.mjs";
3
3
 
4
4
  //#region src/api/handlers/review-requests.ts
5
5
  async function handleReviewRequestCreate(db, handlers, input) {
@@ -1,7 +1,7 @@
1
1
  import { atomicBatch } from "./database/batch.mjs";
2
2
  import { t as validateIdentifier } from "./validate-Co3j6T_K.mjs";
3
- import { g as contentPartitionWritable, r as getContentStorage } from "./runtime-Dz7vZRPU.mjs";
4
- import { n as readRevisionDataBatch, t as readRevisionData } from "./revisions-C-T9CdGo.mjs";
3
+ import { d as contentPartitionWritable, r as getContentStorage } from "./runtime-CmupMaEb.mjs";
4
+ import { n as readRevisionDataBatch, t as readRevisionData } from "./revisions-DnV1P4O5.mjs";
5
5
  import { t as DinewayValidationError } from "./types-BI3ULB3A.mjs";
6
6
  import { sql } from "kysely";
7
7
  import { monotonicFactory } from "ulidx";
@@ -1,5 +1,5 @@
1
1
  import { o as ContentStorageError } from "./config---A7Bg68.mjs";
2
- import { r as getContentStorage } from "./runtime-Dz7vZRPU.mjs";
2
+ import { r as getContentStorage } from "./runtime-CmupMaEb.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/content-storage/revisions.ts
@@ -56,59 +56,6 @@ function contentChangeSequence(collection, entryId) {
56
56
  return sql`(SELECT COALESCE(MAX(sequence),0) FROM _dineway_content_changes WHERE collection=${collection} AND entry_id=${entryId})`;
57
57
  }
58
58
 
59
- //#endregion
60
- //#region src/content-storage/routing.ts
61
- const MIGRATION_ID = /^[a-zA-Z0-9_-]{1,128}$/;
62
- async function readContentPartitionRoute(db, collection, partition) {
63
- const row = (await sql`SELECT * FROM _dineway_content_partitions WHERE collection = ${collection} AND partition = ${partition}`.execute(db)).rows[0];
64
- if (!row) throw new ContentStorageError("ROUTE_CHANGED", "The content partition has not been installed.");
65
- return {
66
- route: row,
67
- check: rowUnchanged("_dineway_content_partitions", { ...row })
68
- };
69
- }
70
- /** Also fences metadata-only operations, such as trash, scheduling and review activation. */
71
- function contentPartitionWritable(collection, id) {
72
- 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')`;
73
- }
74
- /** Starts copying while the partition remains writable on its current store. */
75
- async function beginContentMigration(db, config, migration) {
76
- if (!MIGRATION_ID.test(migration.id)) throw new ContentStorageError("CONFLICT", "A stable migration identifier is required.");
77
- const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
78
- if (current.route.migration_id === migration.id && current.route.state !== "active") return current.route;
79
- const target = config.rules[migration.collection]?.stores[migration.partition];
80
- if (!target || current.route.store === target || current.route.state !== "active" || current.route.migration_id) throw new ContentStorageError("CONFLICT", "The partition cannot start this migration.");
81
- await atomicBatch(db, {
82
- checks: [current.check, sql`EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id='active' AND version=${config.version} AND digest=${await contentDigest(config)})`],
83
- 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)]
84
- });
85
- return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
86
- }
87
- /** Epoch fencing makes all previously prepared writes fail before primary activation. */
88
- async function freezeContentPartition(db, migration) {
89
- const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
90
- if (current.route.migration_id !== migration.id || !["copying", "frozen"].includes(current.route.state)) throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
91
- if (current.route.state === "frozen") return current.route;
92
- await atomicBatch(db, {
93
- 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))`],
94
- statements: [
95
- sql`UPDATE _dineway_content_migrations SET state='frozen', updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE id=${migration.id}`.compile(db),
96
- 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),
97
- 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)
98
- ]
99
- });
100
- return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
101
- }
102
- /** Resume the old store only while every entry still points to it. */
103
- async function cancelContentMigration(db, migration) {
104
- const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
105
- if (current.route.migration_id !== migration.id || current.route.state === "active") throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
106
- await atomicBatch(db, {
107
- 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})`],
108
- 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)]
109
- });
110
- }
111
-
112
59
  //#endregion
113
60
  //#region src/search/text-extraction.ts
114
61
  /**
@@ -246,6 +193,59 @@ function prepareContentProjection(db, collection, item, fields, create, full = f
246
193
  return create ? sql`INSERT INTO ${sql.table(`ec_${collection}`)} (${sql.join(columns.map((column) => sql.ref(column)))}) VALUES (${sql.join(columns.map((column) => values[column] === null ? sql`NULL` : sql`${values[column]}`))})`.compile(db) : sql`UPDATE ${sql.table(`ec_${collection}`)} SET ${sql.join(columns.filter((column) => column !== "id").map((column) => sql`${sql.ref(column)} = ${values[column] === null ? sql`NULL` : sql`${values[column]}`} `))} WHERE id = ${item.id}`.compile(db);
247
194
  }
248
195
 
196
+ //#endregion
197
+ //#region src/content-storage/routing.ts
198
+ const MIGRATION_ID = /^[a-zA-Z0-9_-]{1,128}$/;
199
+ async function readContentPartitionRoute(db, collection, partition) {
200
+ const row = (await sql`SELECT * FROM _dineway_content_partitions WHERE collection = ${collection} AND partition = ${partition}`.execute(db)).rows[0];
201
+ if (!row) throw new ContentStorageError("ROUTE_CHANGED", "The content partition has not been installed.");
202
+ return {
203
+ route: row,
204
+ check: rowUnchanged("_dineway_content_partitions", { ...row })
205
+ };
206
+ }
207
+ /** Also fences metadata-only operations, such as trash, scheduling and review activation. */
208
+ function contentPartitionWritable(collection, id) {
209
+ 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')`;
210
+ }
211
+ /** Starts copying while the partition remains writable on its current store. */
212
+ async function beginContentMigration(db, config, migration) {
213
+ if (!MIGRATION_ID.test(migration.id)) throw new ContentStorageError("CONFLICT", "A stable migration identifier is required.");
214
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
215
+ if (current.route.migration_id === migration.id && current.route.state !== "active") return current.route;
216
+ const target = config.rules[migration.collection]?.stores[migration.partition];
217
+ if (!target || current.route.store === target || current.route.state !== "active" || current.route.migration_id) throw new ContentStorageError("CONFLICT", "The partition cannot start this migration.");
218
+ await atomicBatch(db, {
219
+ checks: [current.check, sql`EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id IN ('active','bindings') AND version=${config.version} AND digest=${await contentDigest(config)})`],
220
+ 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)]
221
+ });
222
+ return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
223
+ }
224
+ /** Epoch fencing makes all previously prepared writes fail before primary activation. */
225
+ async function freezeContentPartition(db, migration) {
226
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
227
+ if (current.route.migration_id !== migration.id || !["copying", "frozen"].includes(current.route.state)) throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
228
+ if (current.route.state === "frozen") return current.route;
229
+ await atomicBatch(db, {
230
+ 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))`],
231
+ statements: [
232
+ sql`UPDATE _dineway_content_migrations SET state='frozen', updated_at=${(/* @__PURE__ */ new Date()).toISOString()} WHERE id=${migration.id}`.compile(db),
233
+ 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),
234
+ 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)
235
+ ]
236
+ });
237
+ return (await readContentPartitionRoute(db, migration.collection, migration.partition)).route;
238
+ }
239
+ /** Resume the old store only while every entry still points to it. */
240
+ async function cancelContentMigration(db, migration) {
241
+ const current = await readContentPartitionRoute(db, migration.collection, migration.partition);
242
+ if (current.route.migration_id !== migration.id || current.route.state === "active") throw new ContentStorageError("CONFLICT", "The migration does not own this partition.");
243
+ await atomicBatch(db, {
244
+ 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})`],
245
+ 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)]
246
+ });
247
+ }
248
+
249
249
  //#endregion
250
250
  //#region src/content-storage/coordinator.ts
251
251
  const locationKey = (location) => JSON.stringify([
@@ -367,7 +367,7 @@ var ContentStorageCoordinator = class {
367
367
  const serialized = canonicalContentJson(command);
368
368
  const existing = await this.operation(command.operationId);
369
369
  if (existing && existing.command !== serialized) throw new ContentStorageError("CONFLICT", "An operation identifier cannot be reused for different content or authority.");
370
- 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})`;
370
+ const routeCheck = sql`(${partition.check}) AND EXISTS (SELECT 1 FROM _dineway_content_storage_config WHERE id IN ('active','bindings') AND version = ${this.config.version} AND digest = ${await this.configDigest})`;
371
371
  const authority = await activation.authorize(command);
372
372
  if (existing?.state === "committed") {
373
373
  await atomicBatch(this.db, {
@@ -420,6 +420,33 @@ var ContentStorageCoordinator = class {
420
420
  }
421
421
  };
422
422
 
423
+ //#endregion
424
+ //#region src/content-storage/public-version-cache.ts
425
+ const values = /* @__PURE__ */ new Map();
426
+ const MAX_UNITS = 2 * 1024 * 1024;
427
+ let units = 0;
428
+ function cachedPublicVersion(key) {
429
+ const value = values.get(key);
430
+ if (value === void 0) return void 0;
431
+ values.delete(key);
432
+ values.set(key, value);
433
+ return JSON.parse(value);
434
+ }
435
+ function rememberPublicVersion(key, version) {
436
+ if (values.has(key)) return;
437
+ const value = JSON.stringify(version);
438
+ const size = key.length + value.length;
439
+ if (size > MAX_UNITS / 8) return;
440
+ while (values.size && (units + size > MAX_UNITS || values.size >= 512)) {
441
+ const oldest = values.entries().next().value;
442
+ if (!oldest) break;
443
+ units -= oldest[0].length + oldest[1].length;
444
+ values.delete(oldest[0]);
445
+ }
446
+ values.set(key, value);
447
+ units += size;
448
+ }
449
+
423
450
  //#endregion
424
451
  //#region src/content-storage/system-fields.ts
425
452
  /** Primary directory metadata cannot be overwritten by a remote content payload. */
@@ -464,9 +491,11 @@ function contentStorageCacheScope() {
464
491
  });
465
492
  }
466
493
  async function assertContentStorageConfiguration(db, config) {
467
- const row = (await sql`SELECT version, digest FROM _dineway_content_storage_config WHERE id = 'active'`.execute(db)).rows[0];
468
- if (!config && !row) return;
469
- 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.");
494
+ const { rows } = await sql`SELECT id,version,digest FROM _dineway_content_storage_config WHERE id IN ('active','bindings')`.execute(db);
495
+ const digest = config && await contentDigest(config);
496
+ const active = rows.find((row) => row.id === "active");
497
+ if (!config && !rows.length) return;
498
+ if (!config || active?.version !== config.version || !rows.some((row) => row.version === config.version && row.digest === digest)) throw new ContentStorageError("UNAVAILABLE", "Content routing configuration does not match the installed database configuration. Apply the explicit content storage migration before serving requests.");
470
499
  }
471
500
  function getContentStorageRuntime(db) {
472
501
  const context = getRequestContext();
@@ -497,7 +526,7 @@ function getContentStorage(db, collection) {
497
526
  };
498
527
  }
499
528
  /** Resolve a bounded primary-index page in bulk, retaining the selected metadata and order. */
500
- async function hydrateContentRows(db, collection, rows, fields) {
529
+ async function hydrateContentRows(db, collection, rows, fields, publicLoaderRead = false) {
501
530
  const storage = getContentStorage(db, collection);
502
531
  if (!storage || !rows.length) return;
503
532
  const byId = new Map(rows.filter((row) => typeof row.id === "string").map((row) => [String(row.id), row]));
@@ -523,8 +552,42 @@ async function hydrateContentRows(db, collection, rows, fields) {
523
552
  digest: row.digest
524
553
  })));
525
554
  }
526
- const versions = await storage.coordinator.readLocations(locations, fields?.filter((field) => !CONTENT_SYSTEM_FIELDS.has(field) && !field.startsWith("_")));
527
- const byEntry = new Map(versions.map((version) => [version.command.entryId, version]));
555
+ const selected = fields?.filter((field) => !CONTENT_SYSTEM_FIELDS.has(field) && !field.startsWith("_"));
556
+ const context = getRequestContext();
557
+ const allowCache = publicLoaderRead && context && !context.editMode && !context.preview && !context.writePrincipal && context.databaseMode !== "primary";
558
+ const projection = selected ? [...new Set(selected)].toSorted() : null;
559
+ const missing = [];
560
+ const keys = /* @__PURE__ */ new Map();
561
+ const byEntry = /* @__PURE__ */ new Map();
562
+ for (const location of locations) {
563
+ const row = byId.get(location.entryId);
564
+ const identity = storage.runtime.config.stores[location.store]?.identity;
565
+ if (identity && allowCache && row.status === "published" && row.live_revision_id && row.draft_revision_id === null) {
566
+ const key = JSON.stringify([
567
+ identity,
568
+ location.routingVersion,
569
+ location.store,
570
+ location.partition,
571
+ collection,
572
+ location.entryId,
573
+ location.version,
574
+ location.digest,
575
+ projection
576
+ ]);
577
+ keys.set(location.entryId, key);
578
+ const cached = cachedPublicVersion(key);
579
+ if (cached) {
580
+ byEntry.set(location.entryId, cached);
581
+ continue;
582
+ }
583
+ }
584
+ missing.push(location);
585
+ }
586
+ for (const version of await storage.coordinator.readLocations(missing, selected)) {
587
+ byEntry.set(version.command.entryId, version);
588
+ const key = keys.get(version.command.entryId);
589
+ if (key) rememberPublicVersion(key, version);
590
+ }
528
591
  for (const row of rows) {
529
592
  const version = byEntry.get(String(row.id));
530
593
  if (!version) continue;
@@ -536,4 +599,4 @@ async function hydrateContentRows(db, collection, rows, fields) {
536
599
  }
537
600
 
538
601
  //#endregion
539
- export { freezeContentPartition as _, hydrateContentRows as a, prepareContentChangeJournal as b, installContentStorageConfig as c, prepareContentProjection as d, extractPlainText as f, contentPartitionWritable as g, cancelContentMigration as h, getContentStorageRuntime as i, assertContentIndexFields as l, beginContentMigration as m, contentStorageCacheScope as n, registerContentStorage as o, extractSearchableFields as p, getContentStorage as r, ContentStorageCoordinator as s, assertContentStorageConfiguration as t, contentProjectionValues as u, readContentPartitionRoute as v, contentChangeSequence as y };
602
+ export { extractPlainText as _, hydrateContentRows as a, prepareContentChangeJournal as b, installContentStorageConfig as c, contentPartitionWritable as d, freezeContentPartition as f, prepareContentProjection as g, contentProjectionValues as h, getContentStorageRuntime as i, beginContentMigration as l, assertContentIndexFields as m, contentStorageCacheScope as n, registerContentStorage as o, readContentPartitionRoute as p, getContentStorage as r, ContentStorageCoordinator as s, assertContentStorageConfiguration as t, cancelContentMigration as u, extractSearchableFields as v, contentChangeSequence as y };
@@ -40,6 +40,6 @@ declare function getContentStorage<DB>(db: Kysely<DB>, collection: string): {
40
40
  coordinator: ContentStorageCoordinator<DB>;
41
41
  } | undefined;
42
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>;
43
+ declare function hydrateContentRows<DB>(db: Kysely<DB>, collection: string, rows: Record<string, unknown>[], fields?: readonly string[], publicLoaderRead?: boolean): Promise<void>;
44
44
  //#endregion
45
45
  export { registerContentStorage as a, hydrateContentRows as i, assertContentStorageConfiguration as n, ContentStorageCoordinator as o, getContentStorage as r, installContentStorageConfig as s, ContentStorageRuntime as t };
@@ -1,16 +1,16 @@
1
- import { $s as getDb, Js as EntryData, Qs as dinewayLoader, Ys as EntryFilter, qs as CollectionFilter } from "./types-z2nZassR.mjs";
1
+ import { $s as getDb, Js as EntryData, Qs as dinewayLoader, Ys as EntryFilter, qs as CollectionFilter } from "./types-1NHQF2Yh.mjs";
2
2
  import "./types-CG9uGPBL.mjs";
3
3
  import "./runner-DlkOiguI.mjs";
4
4
  import "./index-_fCUsJx9.mjs";
5
5
  import "./types-CeFGasN8.mjs";
6
6
  import "./types-DLwh1QkC.mjs";
7
7
  import "./adapters-cL325h6c.mjs";
8
- import "./runtime-Dx9QpCL5.mjs";
8
+ import "./runtime-ecsN2xL9.mjs";
9
9
  import "./hook-events-lN-kz-4_.mjs";
10
10
  import "./scheduled-publish-7kZkKw7t.mjs";
11
11
  import "./public-url-CvNSyMJJ.mjs";
12
12
  import "./validate-CleBZbkv.mjs";
13
- import "./byline-fields-Dyts_tJ5.mjs";
13
+ import "./byline-fields-DvYufwxE.mjs";
14
14
  import { withPrimaryDatabase } from "./request-context.mjs";
15
15
  import "./types-BuplUVZ4.mjs";
16
16
  import { t as getMediaProvider } from "./provider-loader-Dl8SscrT.mjs";
package/dist/runtime.mjs CHANGED
@@ -2,12 +2,12 @@ import { withPrimaryDatabase } from "./request-context.mjs";
2
2
  import "./d1-binding-DrLMBUxu.mjs";
3
3
  import "./dialect-helpers-C6xtO-Ui.mjs";
4
4
  import "./config---A7Bg68.mjs";
5
- import "./runtime-Dz7vZRPU.mjs";
6
- import "./revisions-C-T9CdGo.mjs";
5
+ import "./runtime-CmupMaEb.mjs";
6
+ import "./revisions-DnV1P4O5.mjs";
7
7
  import "./runtime-env-DpYGy4pT.mjs";
8
8
  import "./base64-qvSs0Gxy.mjs";
9
9
  import "./types-BI3ULB3A.mjs";
10
- import { n as dinewayLoader, r as getDb } from "./loader-C9hvIKEW.mjs";
10
+ import { n as dinewayLoader, r as getDb } from "./loader-Q07mEStb.mjs";
11
11
  import { t as getMediaProvider } from "./provider-loader-BWu5kGxR.mjs";
12
12
 
13
13
  export { dinewayLoader, getDb, getMediaProvider, withPrimaryDatabase };
@@ -1,5 +1,5 @@
1
1
  import { c as __exportAll } from "./runner-CuG8o1uW.mjs";
2
- import { n as SchemaRegistry } from "./registry-3xWpSYNI.mjs";
2
+ import { n as SchemaRegistry } from "./registry-BpNZLrXn.mjs";
3
3
 
4
4
  //#region src/schema/index.ts
5
5
  var schema_exports = /* @__PURE__ */ __exportAll({ SchemaRegistry: () => SchemaRegistry });
@@ -1,6 +1,6 @@
1
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-C9hvIKEW.mjs";
3
+ import { r as getDb } from "./loader-Q07mEStb.mjs";
4
4
  import { t as FTSManager } from "./fts-manager-BHwhq1lC.mjs";
5
5
  import { sql } from "kysely";
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { i as encodeCursor, r as decodeCursor } from "./types-BI3ULB3A.mjs";
2
- import { r as getDb } from "./loader-C9hvIKEW.mjs";
2
+ import { r as getDb } from "./loader-Q07mEStb.mjs";
3
3
  import { ulid } from "ulidx";
4
4
 
5
5
  //#region src/sections/index.ts
@@ -1,40 +1,40 @@
1
1
  import "../d1-binding-DrLMBUxu.mjs";
2
2
  import "../dialect-helpers-C6xtO-Ui.mjs";
3
3
  import "../config---A7Bg68.mjs";
4
- import "../runtime-Dz7vZRPU.mjs";
5
- import "../revisions-C-T9CdGo.mjs";
4
+ import "../runtime-CmupMaEb.mjs";
5
+ import "../revisions-DnV1P4O5.mjs";
6
6
  import "../runtime-env-DpYGy4pT.mjs";
7
7
  import "../base64-qvSs0Gxy.mjs";
8
8
  import "../types-BI3ULB3A.mjs";
9
- import "../loader-C9hvIKEW.mjs";
9
+ import "../loader-Q07mEStb.mjs";
10
10
  import "../actor-D0AW80ld.mjs";
11
11
  import "../atomic-authority-Bf5QZboB.mjs";
12
- import "../content-Dxx0H4k8.mjs";
12
+ import "../content-rb8lZEfT.mjs";
13
13
  import "../request-cache-CizvDoxV.mjs";
14
14
  import "../byline-registry-Caj0_gbU.mjs";
15
15
  import "../field-defs-cache-dn5Tw79A.mjs";
16
- import "../object-cache-qP60KjUp.mjs";
17
- import "../byline-BvFH-UZw.mjs";
18
- import "../owned-metadata-CJs4-k1w.mjs";
19
- import "../revision-BhnVYOMz.mjs";
16
+ import "../object-cache-DeIkrWmq.mjs";
17
+ import "../byline-DGTZqRM0.mjs";
18
+ import "../owned-metadata-LUF0xC0h.mjs";
19
+ import "../revision-DfrRhPgw.mjs";
20
20
  import "../media-BjH5OD-A.mjs";
21
21
  import "../user-Bl2_8rhJ.mjs";
22
22
  import "../terms-EskuqbKE.mjs";
23
- import "../taxonomy-B4O77tAe.mjs";
23
+ import "../taxonomy-YxipNvfL.mjs";
24
24
  import "../options-yFkLUuTw.mjs";
25
25
  import "../redirect-CJ-FAbNK.mjs";
26
- import "../content-write-eOTKAf2d.mjs";
27
- import "../version-store-DyYULGd3.mjs";
28
- import "../write-intent-D6xfcx1f.mjs";
29
- import "../seo-DxrTizK0.mjs";
30
- import "../content-refresh-COi0WfKw.mjs";
26
+ import "../content-write-DPszY76R.mjs";
27
+ import "../version-store-B2n_Gfkq.mjs";
28
+ import "../write-intent-4Q8sNg11.mjs";
29
+ import "../seo-TWEsRapq.mjs";
30
+ import "../content-refresh-Dl938dTm.mjs";
31
31
  import "../ssrf-C7tTSD1r.mjs";
32
32
  import "../fts-manager-BHwhq1lC.mjs";
33
33
  import "../public-discovery-CGRirTJH.mjs";
34
- import "../registry-3xWpSYNI.mjs";
35
- import "../settings-D0SBKo-W.mjs";
34
+ import "../registry-BpNZLrXn.mjs";
35
+ import "../settings-Dn4XvS7H.mjs";
36
36
  import { t as validateSeed } from "../validate-WOW5vZz_.mjs";
37
- import { t as applySeed } from "../apply-SoTzf8LK.mjs";
37
+ import { t as applySeed } from "../apply-AOuBTila.mjs";
38
38
  import { t as defaultSeed } from "../default-BxRRjN_x.mjs";
39
39
  import { n as loadUserSeed, t as loadSeed } from "../load-XTcFS1Dp.mjs";
40
40
 
@@ -1,15 +1,15 @@
1
1
  import "../d1-binding-DrLMBUxu.mjs";
2
2
  import "../dialect-helpers-C6xtO-Ui.mjs";
3
3
  import "../config---A7Bg68.mjs";
4
- import "../runtime-Dz7vZRPU.mjs";
5
- import "../revisions-C-T9CdGo.mjs";
4
+ import "../runtime-CmupMaEb.mjs";
5
+ import "../revisions-DnV1P4O5.mjs";
6
6
  import "../base64-qvSs0Gxy.mjs";
7
7
  import "../types-BI3ULB3A.mjs";
8
- import "../content-refresh-COi0WfKw.mjs";
8
+ import "../content-refresh-Dl938dTm.mjs";
9
9
  import "../fts-manager-BHwhq1lC.mjs";
10
10
  import { i as satisfiesPublicDiscoveryRules } from "../public-discovery-CGRirTJH.mjs";
11
- import "../registry-3xWpSYNI.mjs";
12
- import { n as resolveCanonicalUrl, t as listPublicContent } from "../discovery-CIgViNk9.mjs";
11
+ import "../registry-BpNZLrXn.mjs";
12
+ import { n as resolveCanonicalUrl, t as listPublicContent } from "../discovery-BjyZQy47.mjs";
13
13
  import { t as resolveContentUrl } from "../public-url-NCefkiXz.mjs";
14
14
  import { t as buildSeoImageUrl } from "../media-url-VHHHoHGL.mjs";
15
15
 
@@ -1,4 +1,4 @@
1
- import { t as listPublicContent } from "./discovery-CIgViNk9.mjs";
1
+ import { t as listPublicContent } from "./discovery-BjyZQy47.mjs";
2
2
 
3
3
  //#region src/api/handlers/seo.ts
4
4
  /** Internal XML batch, not an unbounded public JSON list endpoint. */
@@ -1,6 +1,6 @@
1
1
  import { atomicBatch } from "./database/batch.mjs";
2
- import { r as getContentStorage } from "./runtime-Dz7vZRPU.mjs";
3
- import { o as invalidateCollectionCache } from "./object-cache-qP60KjUp.mjs";
2
+ import { r as getContentStorage } from "./runtime-CmupMaEb.mjs";
3
+ import { o as invalidateCollectionCache } from "./object-cache-DeIkrWmq.mjs";
4
4
  import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-Bb56aCtB.mjs";
5
5
  import { sql } from "kysely";
6
6
 
@@ -108,7 +108,7 @@ var SeoRepository = class {
108
108
  }
109
109
  async upsert(collection, contentId, input) {
110
110
  if (getContentStorage(this.db, collection)) {
111
- const { prepareContentWrite } = await import("./content-write-eOTKAf2d.mjs").then((n) => n.t);
111
+ const { prepareContentWrite } = await import("./content-write-DPszY76R.mjs").then((n) => n.t);
112
112
  const write = await prepareContentWrite(this.db, collection, {
113
113
  id: contentId,
114
114
  seo: input,
@@ -153,8 +153,8 @@ var SeoRepository = class {
153
153
  }
154
154
  async copyForDuplicate(collection, sourceId, targetId) {
155
155
  if (getContentStorage(this.db, collection)) {
156
- const { snapshotOwnedContentMetadata } = await import("./owned-metadata-CJs4-k1w.mjs").then((n) => n.n);
157
- const { prepareContentWrite } = await import("./content-write-eOTKAf2d.mjs").then((n) => n.t);
156
+ const { snapshotOwnedContentMetadata } = await import("./owned-metadata-LUF0xC0h.mjs").then((n) => n.n);
157
+ const { prepareContentWrite } = await import("./content-write-DPszY76R.mjs").then((n) => n.t);
158
158
  const source = await snapshotOwnedContentMetadata(this.db, collection, sourceId);
159
159
  const seo = await this.get(collection, sourceId);
160
160
  const write = await prepareContentWrite(this.db, collection, {