emdash 1.0.1 → 1.1.0

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 (1267) hide show
  1. package/dist/action-token-AgOs1UWD.mjs +26 -0
  2. package/dist/action-token-AgOs1UWD.mjs.map +1 -0
  3. package/dist/activation-xomsCMJg.mjs +387 -0
  4. package/dist/activation-xomsCMJg.mjs.map +1 -0
  5. package/dist/adapters-DM1oyHIN.d.mts +173 -0
  6. package/dist/adapters-DM1oyHIN.d.mts.map +1 -0
  7. package/dist/allowed-origins-CFtudhyw.mjs +116 -0
  8. package/dist/allowed-origins-CFtudhyw.mjs.map +1 -0
  9. package/dist/api/route-utils.d.mts +4 -4
  10. package/dist/api/route-utils.mjs +48 -47
  11. package/dist/api/route-utils.mjs.map +1 -1
  12. package/dist/api/schemas/index.d.mts +2 -2
  13. package/dist/api/schemas/index.mjs +10 -10
  14. package/dist/api-CltsXhiX.mjs +4980 -0
  15. package/dist/api-CltsXhiX.mjs.map +1 -0
  16. package/dist/api-tokens-P3mAaQgr.mjs +166 -0
  17. package/dist/api-tokens-P3mAaQgr.mjs.map +1 -0
  18. package/dist/apply-Q7uvzBWW.mjs +1680 -0
  19. package/dist/apply-Q7uvzBWW.mjs.map +1 -0
  20. package/dist/approvals-DycwI6lZ.mjs +460 -0
  21. package/dist/approvals-DycwI6lZ.mjs.map +1 -0
  22. package/dist/artifact-fetch-CWxyELVI.mjs +659 -0
  23. package/dist/artifact-fetch-CWxyELVI.mjs.map +1 -0
  24. package/dist/artifacts-UzWbysb8.mjs +307 -0
  25. package/dist/artifacts-UzWbysb8.mjs.map +1 -0
  26. package/dist/astro/index.d.mts +14 -14
  27. package/dist/astro/index.d.mts.map +1 -1
  28. package/dist/astro/index.mjs +38 -12
  29. package/dist/astro/index.mjs.map +1 -1
  30. package/dist/astro/middleware/auth.d.mts +12 -12
  31. package/dist/astro/middleware/auth.mjs +12 -11
  32. package/dist/astro/middleware/auth.mjs.map +1 -1
  33. package/dist/astro/middleware/media-usage-write-fence.mjs +6 -6
  34. package/dist/astro/middleware/redirect.d.mts.map +1 -1
  35. package/dist/astro/middleware/redirect.mjs +9 -22
  36. package/dist/astro/middleware/redirect.mjs.map +1 -1
  37. package/dist/astro/middleware/request-context.d.mts.map +1 -1
  38. package/dist/astro/middleware/request-context.mjs +33 -21
  39. package/dist/astro/middleware/request-context.mjs.map +1 -1
  40. package/dist/astro/middleware/setup.mjs +1 -1
  41. package/dist/astro/middleware.d.mts +12 -12
  42. package/dist/astro/middleware.d.mts.map +1 -1
  43. package/dist/astro/middleware.mjs +203 -120
  44. package/dist/astro/middleware.mjs.map +1 -1
  45. package/dist/astro/routes/api/admin/allowed-domains/_domain_.mjs +15 -15
  46. package/dist/astro/routes/api/admin/allowed-domains/index.mjs +15 -15
  47. package/dist/astro/routes/api/admin/api-tokens/_id_.mjs +7 -7
  48. package/dist/astro/routes/api/admin/api-tokens/index.mjs +8 -8
  49. package/dist/astro/routes/api/admin/byline-fields/_slug_/usage.mjs +7 -7
  50. package/dist/astro/routes/api/admin/byline-fields/_slug_.mjs +17 -17
  51. package/dist/astro/routes/api/admin/byline-fields/index.mjs +17 -17
  52. package/dist/astro/routes/api/admin/byline-fields/reorder.mjs +17 -17
  53. package/dist/astro/routes/api/admin/bylines/_id_/index.mjs +22 -22
  54. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs +22 -23
  55. package/dist/astro/routes/api/admin/bylines/_id_/translations.mjs.map +1 -1
  56. package/dist/astro/routes/api/admin/bylines/index.mjs +23 -23
  57. package/dist/astro/routes/api/admin/bylines/index.mjs.map +1 -1
  58. package/dist/astro/routes/api/admin/comments/_id_/status.mjs +19 -19
  59. package/dist/astro/routes/api/admin/comments/_id_.mjs +8 -8
  60. package/dist/astro/routes/api/admin/comments/bulk.mjs +18 -18
  61. package/dist/astro/routes/api/admin/comments/counts.mjs +8 -8
  62. package/dist/astro/routes/api/admin/comments/index.mjs +18 -18
  63. package/dist/astro/routes/api/admin/core-update.mjs +8 -8
  64. package/dist/astro/routes/api/admin/hooks/exclusive/_hookName_.mjs +7 -7
  65. package/dist/astro/routes/api/admin/hooks/exclusive/index.mjs +6 -6
  66. package/dist/astro/routes/api/admin/media-usage/activation.mjs +21 -21
  67. package/dist/astro/routes/api/admin/media-usage/collection-deletions/index.mjs +22 -22
  68. package/dist/astro/routes/api/admin/media-usage/collection-deletions/retry.mjs +22 -22
  69. package/dist/astro/routes/api/admin/media-usage/progress.mjs +23 -23
  70. package/dist/astro/routes/api/admin/media-usage/repair.mjs +29 -29
  71. package/dist/astro/routes/api/admin/media-usage/work/index.mjs +22 -22
  72. package/dist/astro/routes/api/admin/media-usage/work/retry.mjs +22 -22
  73. package/dist/astro/routes/api/admin/oauth-clients/_id_.mjs +7 -7
  74. package/dist/astro/routes/api/admin/oauth-clients/index.mjs +7 -7
  75. package/dist/astro/routes/api/admin/plugins/_id_/disable.mjs +9 -9
  76. package/dist/astro/routes/api/admin/plugins/_id_/enable.mjs +9 -9
  77. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs +72 -71
  78. package/dist/astro/routes/api/admin/plugins/_id_/index.mjs.map +1 -1
  79. package/dist/astro/routes/api/admin/plugins/_id_/mcp.mjs +8 -8
  80. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs +70 -69
  81. package/dist/astro/routes/api/admin/plugins/_id_/settings.mjs.map +1 -1
  82. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs +71 -70
  83. package/dist/astro/routes/api/admin/plugins/_id_/uninstall.mjs.map +1 -1
  84. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs +81 -80
  85. package/dist/astro/routes/api/admin/plugins/_id_/update.mjs.map +1 -1
  86. package/dist/astro/routes/api/admin/plugins/index.mjs +71 -70
  87. package/dist/astro/routes/api/admin/plugins/index.mjs.map +1 -1
  88. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/icon.mjs +8 -8
  89. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs +70 -69
  90. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/index.mjs.map +1 -1
  91. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs +80 -79
  92. package/dist/astro/routes/api/admin/plugins/marketplace/_id_/install.mjs.map +1 -1
  93. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs +70 -69
  94. package/dist/astro/routes/api/admin/plugins/marketplace/index.mjs.map +1 -1
  95. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs +71 -70
  96. package/dist/astro/routes/api/admin/plugins/registry/_id_/uninstall.mjs.map +1 -1
  97. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs +82 -81
  98. package/dist/astro/routes/api/admin/plugins/registry/_id_/update.mjs.map +1 -1
  99. package/dist/astro/routes/api/admin/plugins/registry/artifact.mjs +10 -10
  100. package/dist/astro/routes/api/admin/plugins/registry/install.mjs +73 -72
  101. package/dist/astro/routes/api/admin/plugins/registry/install.mjs.map +1 -1
  102. package/dist/astro/routes/api/admin/plugins/registry/publisher-handle.mjs +8 -8
  103. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs +71 -70
  104. package/dist/astro/routes/api/admin/plugins/registry/verify.mjs.map +1 -1
  105. package/dist/astro/routes/api/admin/plugins/updates.mjs +70 -69
  106. package/dist/astro/routes/api/admin/plugins/updates.mjs.map +1 -1
  107. package/dist/astro/routes/api/admin/scheduled-policy-rejections/_collection_/_id_.mjs +6 -6
  108. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs +70 -69
  109. package/dist/astro/routes/api/admin/themes/marketplace/_id_/index.mjs.map +1 -1
  110. package/dist/astro/routes/api/admin/themes/marketplace/_id_/thumbnail.mjs +8 -8
  111. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs +70 -69
  112. package/dist/astro/routes/api/admin/themes/marketplace/index.mjs.map +1 -1
  113. package/dist/astro/routes/api/admin/transfer/_...path_.mjs +5 -5
  114. package/dist/astro/routes/api/admin/transfer/approvals/_id_/approve.mjs +39 -39
  115. package/dist/astro/routes/api/admin/transfer/approvals/_id_/deny.mjs +39 -39
  116. package/dist/astro/routes/api/admin/transfer/approvals/index.mjs +41 -41
  117. package/dist/astro/routes/api/admin/transfer/capabilities.mjs +41 -41
  118. package/dist/astro/routes/api/admin/transfer/exports/_id_/advance.mjs +41 -41
  119. package/dist/astro/routes/api/admin/transfer/exports/_id_/archive.mjs +42 -42
  120. package/dist/astro/routes/api/admin/transfer/exports/_id_/files/_...path_.mjs +42 -42
  121. package/dist/astro/routes/api/admin/transfer/exports/_id_/index.mjs +41 -41
  122. package/dist/astro/routes/api/admin/transfer/exports/_id_/manifest.mjs +42 -42
  123. package/dist/astro/routes/api/admin/transfer/exports/index.mjs +43 -43
  124. package/dist/astro/routes/api/admin/transfer/imports/_id_/abandon.mjs +41 -41
  125. package/dist/astro/routes/api/admin/transfer/imports/_id_/advance.mjs +41 -41
  126. package/dist/astro/routes/api/admin/transfer/imports/_id_/analyze.mjs +43 -43
  127. package/dist/astro/routes/api/admin/transfer/imports/_id_/cancel.mjs +41 -41
  128. package/dist/astro/routes/api/admin/transfer/imports/_id_/execute.mjs +43 -43
  129. package/dist/astro/routes/api/admin/transfer/imports/_id_/files/_...path_.mjs +41 -41
  130. package/dist/astro/routes/api/admin/transfer/imports/_id_/index.mjs +41 -41
  131. package/dist/astro/routes/api/admin/transfer/imports/_id_/missing.mjs +43 -43
  132. package/dist/astro/routes/api/admin/transfer/imports/_id_/plan.mjs +41 -41
  133. package/dist/astro/routes/api/admin/transfer/imports/_id_/receipt.mjs +41 -41
  134. package/dist/astro/routes/api/admin/transfer/imports/index.mjs +43 -43
  135. package/dist/astro/routes/api/admin/users/_id_/disable.mjs +5 -5
  136. package/dist/astro/routes/api/admin/users/_id_/enable.mjs +5 -5
  137. package/dist/astro/routes/api/admin/users/_id_/index.mjs +15 -15
  138. package/dist/astro/routes/api/admin/users/_id_/send-recovery.mjs +7 -7
  139. package/dist/astro/routes/api/admin/users/index.mjs +15 -15
  140. package/dist/astro/routes/api/auth/dev-bypass.mjs +7 -7
  141. package/dist/astro/routes/api/auth/invite/accept.mjs +5 -5
  142. package/dist/astro/routes/api/auth/invite/complete.mjs +20 -20
  143. package/dist/astro/routes/api/auth/invite/index.mjs +17 -17
  144. package/dist/astro/routes/api/auth/invite/register-options.mjs +18 -18
  145. package/dist/astro/routes/api/auth/logout.mjs +6 -6
  146. package/dist/astro/routes/api/auth/magic-link/send.mjs +19 -19
  147. package/dist/astro/routes/api/auth/magic-link/verify.mjs +16 -16
  148. package/dist/astro/routes/api/auth/me.mjs +16 -16
  149. package/dist/astro/routes/api/auth/mode.mjs +6 -6
  150. package/dist/astro/routes/api/auth/oauth/_provider_/callback.d.mts.map +1 -1
  151. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs +36 -13
  152. package/dist/astro/routes/api/auth/oauth/_provider_/callback.mjs.map +1 -1
  153. package/dist/astro/routes/api/auth/oauth/_provider_.d.mts.map +1 -1
  154. package/dist/astro/routes/api/auth/oauth/_provider_.mjs +20 -5
  155. package/dist/astro/routes/api/auth/oauth/_provider_.mjs.map +1 -1
  156. package/dist/astro/routes/api/auth/passkey/_id_.mjs +15 -15
  157. package/dist/astro/routes/api/auth/passkey/index.mjs +5 -5
  158. package/dist/astro/routes/api/auth/passkey/options.mjs +20 -20
  159. package/dist/astro/routes/api/auth/passkey/register/options.mjs +18 -18
  160. package/dist/astro/routes/api/auth/passkey/register/verify.mjs +19 -19
  161. package/dist/astro/routes/api/auth/passkey/verify.mjs +20 -20
  162. package/dist/astro/routes/api/auth/signup/complete.mjs +20 -20
  163. package/dist/astro/routes/api/auth/signup/request.mjs +18 -18
  164. package/dist/astro/routes/api/auth/signup/verify.mjs +5 -5
  165. package/dist/astro/routes/api/calendar.d.mts +8 -0
  166. package/dist/astro/routes/api/calendar.d.mts.map +1 -0
  167. package/dist/astro/routes/api/calendar.mjs +204 -0
  168. package/dist/astro/routes/api/calendar.mjs.map +1 -0
  169. package/dist/astro/routes/api/comments/_collection_/_contentId_/index.mjs +14 -14
  170. package/dist/astro/routes/api/comments/_collection_/_contentId_/reactions.mjs +20 -20
  171. package/dist/astro/routes/api/content/_collection_/_id_/compare.mjs +6 -6
  172. package/dist/astro/routes/api/content/_collection_/_id_/discard-draft.mjs +17 -17
  173. package/dist/astro/routes/api/content/_collection_/_id_/duplicate.mjs +6 -6
  174. package/dist/astro/routes/api/content/_collection_/_id_/lock.mjs +17 -17
  175. package/dist/astro/routes/api/content/_collection_/_id_/permanent.mjs +6 -6
  176. package/dist/astro/routes/api/content/_collection_/_id_/plugin-extensions/_pluginId_/_kind_/_extensionId_.mjs +12 -12
  177. package/dist/astro/routes/api/content/_collection_/_id_/preview-url.mjs +31 -31
  178. package/dist/astro/routes/api/content/_collection_/_id_/publish.mjs +17 -17
  179. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/children.mjs +34 -34
  180. package/dist/astro/routes/api/content/_collection_/_id_/references/_relation_/parents.mjs +34 -34
  181. package/dist/astro/routes/api/content/_collection_/_id_/restore.mjs +6 -6
  182. package/dist/astro/routes/api/content/_collection_/_id_/revisions.mjs +6 -6
  183. package/dist/astro/routes/api/content/_collection_/_id_/schedule.mjs +17 -17
  184. package/dist/astro/routes/api/content/_collection_/_id_/terms/_taxonomy_.mjs +24 -24
  185. package/dist/astro/routes/api/content/_collection_/_id_/translations.mjs +6 -6
  186. package/dist/astro/routes/api/content/_collection_/_id_/unpublish.mjs +17 -17
  187. package/dist/astro/routes/api/content/_collection_/_id_.mjs +17 -17
  188. package/dist/astro/routes/api/content/_collection_/authors.mjs +6 -6
  189. package/dist/astro/routes/api/content/_collection_/index.mjs +16 -16
  190. package/dist/astro/routes/api/content/_collection_/trash.mjs +16 -16
  191. package/dist/astro/routes/api/dashboard.mjs +11 -11
  192. package/dist/astro/routes/api/dev/emails.mjs +6 -6
  193. package/dist/astro/routes/api/health.mjs +7 -7
  194. package/dist/astro/routes/api/import/probe.d.mts +3 -3
  195. package/dist/astro/routes/api/import/probe.mjs +24 -24
  196. package/dist/astro/routes/api/import/wordpress/analyze.mjs +6 -6
  197. package/dist/astro/routes/api/import/wordpress/execute.d.mts +13 -13
  198. package/dist/astro/routes/api/import/wordpress/execute.mjs +23 -23
  199. package/dist/astro/routes/api/import/wordpress/media.d.mts +12 -12
  200. package/dist/astro/routes/api/import/wordpress/media.mjs +20 -20
  201. package/dist/astro/routes/api/import/wordpress/prepare.mjs +18 -18
  202. package/dist/astro/routes/api/import/wordpress/rewrite-urls.d.mts +13 -13
  203. package/dist/astro/routes/api/import/wordpress/rewrite-urls.mjs +27 -27
  204. package/dist/astro/routes/api/import/wordpress-plugin/analyze.d.mts +1 -1
  205. package/dist/astro/routes/api/import/wordpress-plugin/analyze.mjs +24 -24
  206. package/dist/astro/routes/api/import/wordpress-plugin/callback.mjs +1 -1
  207. package/dist/astro/routes/api/import/wordpress-plugin/execute.d.mts +13 -13
  208. package/dist/astro/routes/api/import/wordpress-plugin/execute.mjs +32 -32
  209. package/dist/astro/routes/api/manifest.mjs +7 -7
  210. package/dist/astro/routes/api/mcp.mjs +94 -94
  211. package/dist/astro/routes/api/mcp.mjs.map +1 -1
  212. package/dist/astro/routes/api/media/_id_/confirm.mjs +19 -19
  213. package/dist/astro/routes/api/media/_id_/replace.mjs +17 -17
  214. package/dist/astro/routes/api/media/_id_/upload.mjs +10 -10
  215. package/dist/astro/routes/api/media/_id_/usage.mjs +31 -31
  216. package/dist/astro/routes/api/media/_id_.mjs +29 -29
  217. package/dist/astro/routes/api/media/asset/_id_/_filename_.mjs +7 -7
  218. package/dist/astro/routes/api/media/file/_...key_.mjs +10 -10
  219. package/dist/astro/routes/api/media/folders/_id_.mjs +17 -17
  220. package/dist/astro/routes/api/media/folders/index.mjs +17 -17
  221. package/dist/astro/routes/api/media/providers/_providerId_/_itemId_.mjs +6 -6
  222. package/dist/astro/routes/api/media/providers/_providerId_/index.mjs +6 -6
  223. package/dist/astro/routes/api/media/providers/index.mjs +6 -6
  224. package/dist/astro/routes/api/media/upload-url.mjs +23 -23
  225. package/dist/astro/routes/api/media/upload-url.mjs.map +1 -1
  226. package/dist/astro/routes/api/media.mjs +37 -36
  227. package/dist/astro/routes/api/media.mjs.map +1 -1
  228. package/dist/astro/routes/api/menus/_name_/items/_id_.mjs +18 -18
  229. package/dist/astro/routes/api/menus/_name_/items.mjs +18 -18
  230. package/dist/astro/routes/api/menus/_name_/reorder.mjs +18 -18
  231. package/dist/astro/routes/api/menus/_name_/translations.mjs +18 -18
  232. package/dist/astro/routes/api/menus/_name_.mjs +18 -18
  233. package/dist/astro/routes/api/menus/index.mjs +18 -18
  234. package/dist/astro/routes/api/oauth/authorize.mjs +6 -6
  235. package/dist/astro/routes/api/oauth/device/authorize.mjs +9 -9
  236. package/dist/astro/routes/api/oauth/device/code.mjs +12 -12
  237. package/dist/astro/routes/api/oauth/device/token.mjs +11 -11
  238. package/dist/astro/routes/api/oauth/register.mjs +8 -8
  239. package/dist/astro/routes/api/oauth/token/refresh.mjs +9 -9
  240. package/dist/astro/routes/api/oauth/token/revoke.mjs +9 -9
  241. package/dist/astro/routes/api/oauth/token.mjs +9 -9
  242. package/dist/astro/routes/api/openapi.json.mjs +21 -21
  243. package/dist/astro/routes/api/plugins/_pluginId_/_...path_.mjs +12 -12
  244. package/dist/astro/routes/api/redirects/404s/index.mjs +20 -19
  245. package/dist/astro/routes/api/redirects/404s/index.mjs.map +1 -1
  246. package/dist/astro/routes/api/redirects/404s/summary.mjs +20 -19
  247. package/dist/astro/routes/api/redirects/404s/summary.mjs.map +1 -1
  248. package/dist/astro/routes/api/redirects/_id_.mjs +20 -19
  249. package/dist/astro/routes/api/redirects/_id_.mjs.map +1 -1
  250. package/dist/astro/routes/api/redirects/index.mjs +20 -19
  251. package/dist/astro/routes/api/redirects/index.mjs.map +1 -1
  252. package/dist/astro/routes/api/relations/_id_/index.mjs +34 -34
  253. package/dist/astro/routes/api/relations/index.mjs +34 -34
  254. package/dist/astro/routes/api/revisions/_revisionId_/index.mjs +6 -6
  255. package/dist/astro/routes/api/revisions/_revisionId_/restore.mjs +17 -17
  256. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs +70 -69
  257. package/dist/astro/routes/api/schema/block-types/_slug_/index.mjs.map +1 -1
  258. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs +70 -69
  259. package/dist/astro/routes/api/schema/block-types/_slug_/versions/_version_/activate.mjs.map +1 -1
  260. package/dist/astro/routes/api/schema/block-types/index.mjs +70 -69
  261. package/dist/astro/routes/api/schema/block-types/index.mjs.map +1 -1
  262. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs +70 -69
  263. package/dist/astro/routes/api/schema/collections/_slug_/fields/_fieldSlug_.mjs.map +1 -1
  264. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs +70 -69
  265. package/dist/astro/routes/api/schema/collections/_slug_/fields/index.mjs.map +1 -1
  266. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs +70 -69
  267. package/dist/astro/routes/api/schema/collections/_slug_/fields/reorder.mjs.map +1 -1
  268. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs +70 -69
  269. package/dist/astro/routes/api/schema/collections/_slug_/index.mjs.map +1 -1
  270. package/dist/astro/routes/api/schema/collections/index.mjs +70 -69
  271. package/dist/astro/routes/api/schema/collections/index.mjs.map +1 -1
  272. package/dist/astro/routes/api/schema/collections/reorder.mjs +70 -69
  273. package/dist/astro/routes/api/schema/collections/reorder.mjs.map +1 -1
  274. package/dist/astro/routes/api/schema/index.mjs +16 -16
  275. package/dist/astro/routes/api/schema/orphans/_slug_.mjs +70 -69
  276. package/dist/astro/routes/api/schema/orphans/_slug_.mjs.map +1 -1
  277. package/dist/astro/routes/api/schema/orphans/index.mjs +70 -69
  278. package/dist/astro/routes/api/schema/orphans/index.mjs.map +1 -1
  279. package/dist/astro/routes/api/search/enable.mjs +19 -19
  280. package/dist/astro/routes/api/search/index.mjs +18 -18
  281. package/dist/astro/routes/api/search/rebuild.mjs +19 -19
  282. package/dist/astro/routes/api/search/stats.mjs +9 -9
  283. package/dist/astro/routes/api/search/suggest.mjs +18 -18
  284. package/dist/astro/routes/api/sections/_slug_.mjs +18 -18
  285. package/dist/astro/routes/api/sections/index.mjs +18 -18
  286. package/dist/astro/routes/api/settings/backups/archives/_name_.mjs +8 -8
  287. package/dist/astro/routes/api/settings/backups/archives/index.mjs +8 -8
  288. package/dist/astro/routes/api/settings/backups/export.mjs +8 -8
  289. package/dist/astro/routes/api/settings/backups/index.mjs +9 -9
  290. package/dist/astro/routes/api/settings/email.mjs +7 -7
  291. package/dist/astro/routes/api/settings.mjs +22 -22
  292. package/dist/astro/routes/api/setup/admin-verify.mjs +21 -21
  293. package/dist/astro/routes/api/setup/admin.mjs +19 -19
  294. package/dist/astro/routes/api/setup/dev-bypass.mjs +42 -42
  295. package/dist/astro/routes/api/setup/dev-reset.mjs +5 -5
  296. package/dist/astro/routes/api/setup/index.mjs +54 -49
  297. package/dist/astro/routes/api/setup/index.mjs.map +1 -1
  298. package/dist/astro/routes/api/setup/status.mjs +7 -7
  299. package/dist/astro/routes/api/snapshot.mjs +10 -10
  300. package/dist/astro/routes/api/taxonomies/_name_/reorder.mjs +22 -22
  301. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_/translations.mjs +22 -22
  302. package/dist/astro/routes/api/taxonomies/_name_/terms/_slug_.mjs +22 -22
  303. package/dist/astro/routes/api/taxonomies/_name_/terms/index.mjs +22 -22
  304. package/dist/astro/routes/api/taxonomies/_name_/translations.mjs +21 -21
  305. package/dist/astro/routes/api/taxonomies/_name_.mjs +22 -22
  306. package/dist/astro/routes/api/taxonomies/bulk-tag.mjs +35 -35
  307. package/dist/astro/routes/api/taxonomies/index.mjs +22 -22
  308. package/dist/astro/routes/api/themes/preview.mjs +8 -8
  309. package/dist/astro/routes/api/typegen.mjs +7 -7
  310. package/dist/astro/routes/api/visual-editing/action-token.mjs +8 -8
  311. package/dist/astro/routes/api/visual-editing/content/_collection_/_id_/publish.mjs +20 -20
  312. package/dist/astro/routes/api/visual-editing/toolbar-labels.mjs +5 -5
  313. package/dist/astro/routes/api/well-known/auth.mjs +1 -1
  314. package/dist/astro/routes/api/well-known/oauth-authorization-server.mjs +2 -2
  315. package/dist/astro/routes/api/well-known/oauth-protected-resource.mjs +2 -2
  316. package/dist/astro/routes/api/widget-areas/_name_/reorder.mjs +17 -17
  317. package/dist/astro/routes/api/widget-areas/_name_/widgets/_id_.mjs +19 -19
  318. package/dist/astro/routes/api/widget-areas/_name_/widgets.mjs +19 -19
  319. package/dist/astro/routes/api/widget-areas/_name_.mjs +9 -9
  320. package/dist/astro/routes/api/widget-areas/index.mjs +19 -19
  321. package/dist/astro/routes/api/widget-components.mjs +6 -6
  322. package/dist/astro/routes/robots.txt.mjs +7 -7
  323. package/dist/astro/routes/sitemap-_collection_.xml.mjs +9 -9
  324. package/dist/astro/routes/sitemap.xml.mjs +8 -8
  325. package/dist/astro/types.d.mts +17 -17
  326. package/dist/audit-CCH3MA4Y.mjs +127 -0
  327. package/dist/audit-CCH3MA4Y.mjs.map +1 -0
  328. package/dist/auth/providers/github.d.mts +1 -1
  329. package/dist/auth/providers/google.d.mts +1 -1
  330. package/dist/auth/providers/microsoft.d.mts +27 -0
  331. package/dist/auth/providers/microsoft.d.mts.map +1 -0
  332. package/dist/auth/providers/microsoft.mjs +20 -0
  333. package/dist/auth/providers/microsoft.mjs.map +1 -0
  334. package/dist/authoritative-records-dSvXCfzb.mjs +5172 -0
  335. package/dist/authoritative-records-dSvXCfzb.mjs.map +1 -0
  336. package/dist/authorize-DeWfk--K.mjs +49 -0
  337. package/dist/authorize-DeWfk--K.mjs.map +1 -0
  338. package/dist/backup-CFnbdTSJ.mjs +246 -0
  339. package/dist/backup-CFnbdTSJ.mjs.map +1 -0
  340. package/dist/base64-BQBZwXCx.mjs +63 -0
  341. package/dist/base64-BQBZwXCx.mjs.map +1 -0
  342. package/dist/block-types-C0YFSfR7.mjs +132 -0
  343. package/dist/block-types-C0YFSfR7.mjs.map +1 -0
  344. package/dist/block-values-H4E0XwE8.mjs +175 -0
  345. package/dist/block-values-H4E0XwE8.mjs.map +1 -0
  346. package/dist/byline-BhVslYLz.mjs +909 -0
  347. package/dist/byline-BhVslYLz.mjs.map +1 -0
  348. package/dist/byline-fields-DHJs0Mja.mjs +280 -0
  349. package/dist/byline-fields-DHJs0Mja.mjs.map +1 -0
  350. package/dist/byline-fields-xdxE9kxZ.mjs +123 -0
  351. package/dist/byline-fields-xdxE9kxZ.mjs.map +1 -0
  352. package/dist/bylines-B_nN9liM.mjs +234 -0
  353. package/dist/bylines-B_nN9liM.mjs.map +1 -0
  354. package/dist/bylines-C71YACkL.mjs +150 -0
  355. package/dist/bylines-C71YACkL.mjs.map +1 -0
  356. package/dist/cache-aTYCL9nK.mjs +133 -0
  357. package/dist/cache-aTYCL9nK.mjs.map +1 -0
  358. package/dist/canonical-Y1dpjCnp.mjs +174 -0
  359. package/dist/canonical-Y1dpjCnp.mjs.map +1 -0
  360. package/dist/capture-triggers-C9JKoIdT.mjs +362 -0
  361. package/dist/capture-triggers-C9JKoIdT.mjs.map +1 -0
  362. package/dist/challenge-store-CxZxPqaw.mjs +51 -0
  363. package/dist/challenge-store-CxZxPqaw.mjs.map +1 -0
  364. package/dist/checksum-DtH6m5uk.mjs +162 -0
  365. package/dist/checksum-DtH6m5uk.mjs.map +1 -0
  366. package/dist/chrome-tags-BIKBMZYO.mjs +24 -0
  367. package/dist/chrome-tags-BIKBMZYO.mjs.map +1 -0
  368. package/dist/chunks-zlGB5IQP.mjs +25 -0
  369. package/dist/chunks-zlGB5IQP.mjs.map +1 -0
  370. package/dist/cli/index.mjs +47 -47
  371. package/dist/client/cf-access.d.mts +1 -1
  372. package/dist/client/index.d.mts +121 -121
  373. package/dist/client/index.mjs +2 -2
  374. package/dist/collection-slugs-cache-B2Gs9Jwx.mjs +85 -0
  375. package/dist/collection-slugs-cache-B2Gs9Jwx.mjs.map +1 -0
  376. package/dist/comment-Bu08Wvr3.mjs +313 -0
  377. package/dist/comment-Bu08Wvr3.mjs.map +1 -0
  378. package/dist/comment-reaction-B8SfT-yM.mjs +85 -0
  379. package/dist/comment-reaction-B8SfT-yM.mjs.map +1 -0
  380. package/dist/comments-BRtp992B.mjs +99 -0
  381. package/dist/comments-BRtp992B.mjs.map +1 -0
  382. package/dist/comments-DVUYqdyC.mjs +195 -0
  383. package/dist/comments-DVUYqdyC.mjs.map +1 -0
  384. package/dist/components-CQY-Sgm-.mjs +108 -0
  385. package/dist/components-CQY-Sgm-.mjs.map +1 -0
  386. package/dist/config-B-uePMLj.d.mts +39 -0
  387. package/dist/config-B-uePMLj.d.mts.map +1 -0
  388. package/dist/config-B6BDSsz2.d.mts +6712 -0
  389. package/dist/config-B6BDSsz2.d.mts.map +1 -0
  390. package/dist/config-BsJHiQxC.mjs +228 -0
  391. package/dist/config-BsJHiQxC.mjs.map +1 -0
  392. package/dist/connection-B9pIasFd.mjs +36 -0
  393. package/dist/connection-B9pIasFd.mjs.map +1 -0
  394. package/dist/content-Dji9vEiW.mjs +2063 -0
  395. package/dist/content-Dji9vEiW.mjs.map +1 -0
  396. package/dist/content-list-query-DiNwyKtd.d.mts +26 -0
  397. package/dist/content-list-query-DiNwyKtd.d.mts.map +1 -0
  398. package/dist/content-repair-B7wnbzhN.mjs +442 -0
  399. package/dist/content-repair-B7wnbzhN.mjs.map +1 -0
  400. package/dist/context-Ctcxc8Ia.mjs +2026 -0
  401. package/dist/context-Ctcxc8Ia.mjs.map +1 -0
  402. package/dist/credits-Bu7dlobo.mjs +110 -0
  403. package/dist/credits-Bu7dlobo.mjs.map +1 -0
  404. package/dist/cron-xe5XKqA-.mjs +306 -0
  405. package/dist/cron-xe5XKqA-.mjs.map +1 -0
  406. package/dist/dashboard-B5hVHOtf.mjs +151 -0
  407. package/dist/dashboard-B5hVHOtf.mjs.map +1 -0
  408. package/dist/db/index.d.mts +3 -3
  409. package/dist/db/index.mjs +1 -1
  410. package/dist/db/index.mjs.map +1 -1
  411. package/dist/db/libsql-migrations.d.mts +1 -1
  412. package/dist/db/libsql-migrations.mjs +5 -5
  413. package/dist/db/libsql.d.mts +1 -1
  414. package/dist/db/postgres-migrations.d.mts +1 -1
  415. package/dist/db/postgres-migrations.mjs +4 -4
  416. package/dist/db/postgres.d.mts +1 -1
  417. package/dist/db/sqlite-migrations.d.mts +1 -1
  418. package/dist/db/sqlite-migrations.mjs +4 -4
  419. package/dist/db/sqlite.d.mts +1 -1
  420. package/dist/db/sqlite.mjs +1 -1
  421. package/dist/default-DaoYyFRS.mjs +81 -0
  422. package/dist/default-DaoYyFRS.mjs.map +1 -0
  423. package/dist/deferred-tasks-BYcDx2o_.d.mts +9 -0
  424. package/dist/deferred-tasks-BYcDx2o_.d.mts.map +1 -0
  425. package/dist/dev-typegen-Dtl8AfS6.mjs +29 -0
  426. package/dist/dev-typegen-Dtl8AfS6.mjs.map +1 -0
  427. package/dist/device-flow-Ma5P5d2e.mjs +521 -0
  428. package/dist/device-flow-Ma5P5d2e.mjs.map +1 -0
  429. package/dist/digest-xIpR3o64.mjs +194 -0
  430. package/dist/digest-xIpR3o64.mjs.map +1 -0
  431. package/dist/direct-executor-DMWwCey3.mjs +104 -0
  432. package/dist/direct-executor-DMWwCey3.mjs.map +1 -0
  433. package/dist/email-console-DmqVF5J_.mjs +50 -0
  434. package/dist/email-console-DmqVF5J_.mjs.map +1 -0
  435. package/dist/email-locale-Cc5YSXfJ.mjs +25 -0
  436. package/dist/email-locale-Cc5YSXfJ.mjs.map +1 -0
  437. package/dist/emdash-runtime-BlybX9Ui.mjs +4249 -0
  438. package/dist/emdash-runtime-BlybX9Ui.mjs.map +1 -0
  439. package/dist/enrich-Duu4sV3a.mjs +194 -0
  440. package/dist/enrich-Duu4sV3a.mjs.map +1 -0
  441. package/dist/entry-lock-De1L8qUQ.mjs +163 -0
  442. package/dist/entry-lock-De1L8qUQ.mjs.map +1 -0
  443. package/dist/entry-lock-esmMbgI9.d.mts +4551 -0
  444. package/dist/entry-lock-esmMbgI9.d.mts.map +1 -0
  445. package/dist/entry-lock-sxz2PGAT.mjs +1197 -0
  446. package/dist/entry-lock-sxz2PGAT.mjs.map +1 -0
  447. package/dist/env-types-BkjCtN13.mjs +38 -0
  448. package/dist/env-types-BkjCtN13.mjs.map +1 -0
  449. package/dist/error-B0rgPgsQ.mjs +90 -0
  450. package/dist/error-B0rgPgsQ.mjs.map +1 -0
  451. package/dist/errors-CuHQRiBW.mjs +120 -0
  452. package/dist/errors-CuHQRiBW.mjs.map +1 -0
  453. package/dist/errors-DTE6C3K_.mjs +470 -0
  454. package/dist/errors-DTE6C3K_.mjs.map +1 -0
  455. package/dist/escape-nJW7dR0s.mjs +9 -0
  456. package/dist/escape-nJW7dR0s.mjs.map +1 -0
  457. package/dist/fence-CGw57S4v.mjs +162 -0
  458. package/dist/fence-CGw57S4v.mjs.map +1 -0
  459. package/dist/field-defs-cache-Bw8w499w.mjs +77 -0
  460. package/dist/field-defs-cache-Bw8w499w.mjs.map +1 -0
  461. package/dist/field-map-hn-D-SyH.mjs +83 -0
  462. package/dist/field-map-hn-D-SyH.mjs.map +1 -0
  463. package/dist/fts-manager-DacCYIe4.mjs +443 -0
  464. package/dist/fts-manager-DacCYIe4.mjs.map +1 -0
  465. package/dist/gc-BBplHrv6.mjs +75 -0
  466. package/dist/gc-BBplHrv6.mjs.map +1 -0
  467. package/dist/hash-C4DFoJ7Z.mjs +37 -0
  468. package/dist/hash-C4DFoJ7Z.mjs.map +1 -0
  469. package/dist/hook-result-DSRRxu_-.d.mts +31 -0
  470. package/dist/hook-result-DSRRxu_-.d.mts.map +1 -0
  471. package/dist/hreflang-CKPunvU0.mjs +105 -0
  472. package/dist/hreflang-CKPunvU0.mjs.map +1 -0
  473. package/dist/hreflang-egumj6WF.d.mts +50 -0
  474. package/dist/hreflang-egumj6WF.d.mts.map +1 -0
  475. package/dist/http-route-dispatch-DjNFZcJ2.mjs +339 -0
  476. package/dist/http-route-dispatch-DjNFZcJ2.mjs.map +1 -0
  477. package/dist/identity-Dfrx2_Bc.mjs +35 -0
  478. package/dist/identity-Dfrx2_Bc.mjs.map +1 -0
  479. package/dist/import-ROBvhbNc.mjs +2021 -0
  480. package/dist/import-ROBvhbNc.mjs.map +1 -0
  481. package/dist/index-B4sIdCAT.d.mts +623 -0
  482. package/dist/index-B4sIdCAT.d.mts.map +1 -0
  483. package/dist/index.d.mts +24 -24
  484. package/dist/index.mjs +98 -97
  485. package/dist/init-lock-BGmew3r1.mjs +56 -0
  486. package/dist/init-lock-BGmew3r1.mjs.map +1 -0
  487. package/dist/install-finalization-CPM7Gged.mjs +58 -0
  488. package/dist/install-finalization-CPM7Gged.mjs.map +1 -0
  489. package/dist/keys-DxqxcAD4.mjs +61 -0
  490. package/dist/keys-DxqxcAD4.mjs.map +1 -0
  491. package/dist/kinds-BQl5gN6e.mjs +974 -0
  492. package/dist/kinds-BQl5gN6e.mjs.map +1 -0
  493. package/dist/lifecycle-DGQI7itS.mjs +25 -0
  494. package/dist/lifecycle-DGQI7itS.mjs.map +1 -0
  495. package/dist/load-DMxRl4VK.mjs +28 -0
  496. package/dist/load-DMxRl4VK.mjs.map +1 -0
  497. package/dist/loader-1DMiOq5s.mjs +1303 -0
  498. package/dist/loader-1DMiOq5s.mjs.map +1 -0
  499. package/dist/loops-Dn1i16FP.mjs +205 -0
  500. package/dist/loops-Dn1i16FP.mjs.map +1 -0
  501. package/dist/manifest-builder-CTw4FmZk.mjs +189 -0
  502. package/dist/manifest-builder-CTw4FmZk.mjs.map +1 -0
  503. package/dist/manifest-schema-gy37bD_D.mjs +496 -0
  504. package/dist/manifest-schema-gy37bD_D.mjs.map +1 -0
  505. package/dist/marketplace-tHWSsCUo.mjs +257 -0
  506. package/dist/marketplace-tHWSsCUo.mjs.map +1 -0
  507. package/dist/media/index.d.mts +1 -1
  508. package/dist/media/index.mjs +1 -1
  509. package/dist/media/local-runtime.d.mts +14 -14
  510. package/dist/media/local-runtime.mjs +7 -7
  511. package/dist/media-Bw-Q65ve.mjs +294 -0
  512. package/dist/media-Bw-Q65ve.mjs.map +1 -0
  513. package/dist/media-BzUDu7nl.mjs +373 -0
  514. package/dist/media-BzUDu7nl.mjs.map +1 -0
  515. package/dist/media-aahnKHze.mjs +408 -0
  516. package/dist/media-aahnKHze.mjs.map +1 -0
  517. package/dist/media-allowlist-RMrjo8TU.mjs +45 -0
  518. package/dist/media-allowlist-RMrjo8TU.mjs.map +1 -0
  519. package/dist/media-folders-kabR1oJf.mjs +210 -0
  520. package/dist/media-folders-kabR1oJf.mjs.map +1 -0
  521. package/dist/media-url-DloW2xrP.mjs +43 -0
  522. package/dist/media-url-DloW2xrP.mjs.map +1 -0
  523. package/dist/media-usage-CHHpV7ee.mjs +282 -0
  524. package/dist/media-usage-CHHpV7ee.mjs.map +1 -0
  525. package/dist/media-usage-activation-BinYqC_r.mjs +78 -0
  526. package/dist/media-usage-activation-BinYqC_r.mjs.map +1 -0
  527. package/dist/media-usage-work-C734aq6s.mjs +1015 -0
  528. package/dist/media-usage-work-C734aq6s.mjs.map +1 -0
  529. package/dist/media-usage-work-lxvV0-UO.mjs +151 -0
  530. package/dist/media-usage-work-lxvV0-UO.mjs.map +1 -0
  531. package/dist/menus-6RHNq4ZK.mjs +753 -0
  532. package/dist/menus-6RHNq4ZK.mjs.map +1 -0
  533. package/dist/menus-AuCTaO9W.mjs +3704 -0
  534. package/dist/menus-AuCTaO9W.mjs.map +1 -0
  535. package/dist/menus-BQKqf0Up.mjs +92 -0
  536. package/dist/menus-BQKqf0Up.mjs.map +1 -0
  537. package/dist/migrations/index.d.mts +1 -1
  538. package/dist/migrations/index.mjs +3 -3
  539. package/dist/mime-B5M9R53H.mjs +81 -0
  540. package/dist/mime-B5M9R53H.mjs.map +1 -0
  541. package/dist/mode-nh0ppSX5.mjs +23 -0
  542. package/dist/mode-nh0ppSX5.mjs.map +1 -0
  543. package/dist/node-sqlite-compat-CDOEcc97.mjs +63 -0
  544. package/dist/node-sqlite-compat-CDOEcc97.mjs.map +1 -0
  545. package/dist/oauth-authorization-BtYQ80uU.mjs +274 -0
  546. package/dist/oauth-authorization-BtYQ80uU.mjs.map +1 -0
  547. package/dist/oauth-clients-C1S4NQHh.mjs +266 -0
  548. package/dist/oauth-clients-C1S4NQHh.mjs.map +1 -0
  549. package/dist/oauth-state-store-CpGi2FZH.mjs +50 -0
  550. package/dist/oauth-state-store-CpGi2FZH.mjs.map +1 -0
  551. package/dist/oauth-user-lookup-BNp1aFAr.mjs +26 -0
  552. package/dist/oauth-user-lookup-BNp1aFAr.mjs.map +1 -0
  553. package/dist/object-cache/memory.d.mts +1 -1
  554. package/dist/options-B41aLm1I.d.mts +81 -0
  555. package/dist/options-B41aLm1I.d.mts.map +1 -0
  556. package/dist/ownership-DoeAIuTg.mjs +12 -0
  557. package/dist/ownership-DoeAIuTg.mjs.map +1 -0
  558. package/dist/page/index.d.mts +2 -2
  559. package/dist/page/index.mjs +6 -6
  560. package/dist/parse-CmFDTGzp.mjs +81 -0
  561. package/dist/parse-CmFDTGzp.mjs.map +1 -0
  562. package/dist/parse-QVS0t5oR.d.mts +172 -0
  563. package/dist/parse-QVS0t5oR.d.mts.map +1 -0
  564. package/dist/passkey-config-C-MxsV22.mjs +46 -0
  565. package/dist/passkey-config-C-MxsV22.mjs.map +1 -0
  566. package/dist/paths-kr8hAMMI.mjs +77 -0
  567. package/dist/paths-kr8hAMMI.mjs.map +1 -0
  568. package/dist/placeholder-Dn7MMdWr.d.mts +306 -0
  569. package/dist/placeholder-Dn7MMdWr.d.mts.map +1 -0
  570. package/dist/plan-CuQOeU9g.mjs +135 -0
  571. package/dist/plan-CuQOeU9g.mjs.map +1 -0
  572. package/dist/plugin-test-runtime.d.mts +14 -14
  573. package/dist/plugin-test-runtime.mjs +110 -109
  574. package/dist/plugin-types.d.mts +2 -2
  575. package/dist/plugin-utils.d.mts +12 -12
  576. package/dist/plugins/adapt-sandbox-entry.d.mts +12 -12
  577. package/dist/plugins/adapt-sandbox-entry.mjs +3 -3
  578. package/dist/plugins/host.d.mts +5 -5
  579. package/dist/plugins/host.mjs +44 -43
  580. package/dist/plugins-CGb-G98c.mjs +261 -0
  581. package/dist/plugins-CGb-G98c.mjs.map +1 -0
  582. package/dist/policy-C5wrDXYV.mjs +45 -0
  583. package/dist/policy-C5wrDXYV.mjs.map +1 -0
  584. package/dist/portable-text-BnRuiR1-.mjs +307 -0
  585. package/dist/portable-text-BnRuiR1-.mjs.map +1 -0
  586. package/dist/preview-xWNSR1Li.mjs +107 -0
  587. package/dist/preview-xWNSR1Li.mjs.map +1 -0
  588. package/dist/protocol-ClxN-m1e.d.mts +61 -0
  589. package/dist/protocol-ClxN-m1e.d.mts.map +1 -0
  590. package/dist/public-submission-CkmT2SKv.mjs +250 -0
  591. package/dist/public-submission-CkmT2SKv.mjs.map +1 -0
  592. package/dist/public-url-B5a0QAh6.mjs +101 -0
  593. package/dist/public-url-B5a0QAh6.mjs.map +1 -0
  594. package/dist/query-DHqFiqqH.mjs +41 -0
  595. package/dist/query-DHqFiqqH.mjs.map +1 -0
  596. package/dist/query-DT85BehD.mjs +1125 -0
  597. package/dist/query-DT85BehD.mjs.map +1 -0
  598. package/dist/rate-limit-iMvcu3eu.mjs +120 -0
  599. package/dist/rate-limit-iMvcu3eu.mjs.map +1 -0
  600. package/dist/receipt-Dpp1uaX9.mjs +43 -0
  601. package/dist/receipt-Dpp1uaX9.mjs.map +1 -0
  602. package/dist/redirect-BRoLiWQE.mjs +19 -0
  603. package/dist/redirect-BRoLiWQE.mjs.map +1 -0
  604. package/dist/redirect-xZNpBoGp.mjs +417 -0
  605. package/dist/redirect-xZNpBoGp.mjs.map +1 -0
  606. package/dist/redirects-D4EWeXAo.mjs +148 -0
  607. package/dist/redirects-D4EWeXAo.mjs.map +1 -0
  608. package/dist/redirects-DCKqwiWp.mjs +446 -0
  609. package/dist/redirects-DCKqwiWp.mjs.map +1 -0
  610. package/dist/registry/testing.mjs +3 -3
  611. package/dist/registry-DaXmUsD4.mjs +8369 -0
  612. package/dist/registry-DaXmUsD4.mjs.map +1 -0
  613. package/dist/relations-JvBP8nGP.mjs +776 -0
  614. package/dist/relations-JvBP8nGP.mjs.map +1 -0
  615. package/dist/request-context.d.mts +2 -2
  616. package/dist/request-context.mjs.map +1 -1
  617. package/dist/request-meta-B6blULFY.mjs +141 -0
  618. package/dist/request-meta-B6blULFY.mjs.map +1 -0
  619. package/dist/resolve-DAhHi5tn.mjs +100 -0
  620. package/dist/resolve-DAhHi5tn.mjs.map +1 -0
  621. package/dist/revision-BWEH2qQB.mjs +368 -0
  622. package/dist/revision-BWEH2qQB.mjs.map +1 -0
  623. package/dist/route-wire-DK600v4u.mjs +197 -0
  624. package/dist/route-wire-DK600v4u.mjs.map +1 -0
  625. package/dist/routes-BeZyaCzv.mjs +272 -0
  626. package/dist/routes-BeZyaCzv.mjs.map +1 -0
  627. package/dist/runner-CskI4Hmq.mjs +6372 -0
  628. package/dist/runner-CskI4Hmq.mjs.map +1 -0
  629. package/dist/runner-J3Cj6DGk.d.mts +68 -0
  630. package/dist/runner-J3Cj6DGk.d.mts.map +1 -0
  631. package/dist/runtime.d.mts +13 -13
  632. package/dist/runtime.mjs +3 -3
  633. package/dist/schema/project-env-types.mjs +37 -37
  634. package/dist/schema-CK0ihqMR.mjs +815 -0
  635. package/dist/schema-CK0ihqMR.mjs.map +1 -0
  636. package/dist/schema-VtaZSrC-.mjs +13 -0
  637. package/dist/schema-VtaZSrC-.mjs.map +1 -0
  638. package/dist/scopes-BRnGlL9t.mjs +34 -0
  639. package/dist/scopes-BRnGlL9t.mjs.map +1 -0
  640. package/dist/search-D6-XK1Sn.mjs +448 -0
  641. package/dist/search-D6-XK1Sn.mjs.map +1 -0
  642. package/dist/secrets-Cc_O3Kp-.mjs +369 -0
  643. package/dist/secrets-Cc_O3Kp-.mjs.map +1 -0
  644. package/dist/sections-CBDCf7qR.mjs +346 -0
  645. package/dist/sections-CBDCf7qR.mjs.map +1 -0
  646. package/dist/seed/index.d.mts +2 -2
  647. package/dist/seed/index.mjs +35 -35
  648. package/dist/seo/index.d.mts +3 -3
  649. package/dist/seo/index.mjs +22 -22
  650. package/dist/seo-BdeEPDNW.mjs +133 -0
  651. package/dist/seo-BdeEPDNW.mjs.map +1 -0
  652. package/dist/seo-C61bnPuV.mjs +114 -0
  653. package/dist/seo-C61bnPuV.mjs.map +1 -0
  654. package/dist/service-BuRKLMxa.mjs +150 -0
  655. package/dist/service-BuRKLMxa.mjs.map +1 -0
  656. package/dist/session-user-CqkPtrPL.mjs +61 -0
  657. package/dist/session-user-CqkPtrPL.mjs.map +1 -0
  658. package/dist/settings-0u0lTthS.mjs +51 -0
  659. package/dist/settings-0u0lTthS.mjs.map +1 -0
  660. package/dist/settings-WHr45II1.mjs +61 -0
  661. package/dist/settings-WHr45II1.mjs.map +1 -0
  662. package/dist/settings-m5tIYnF0.mjs +443 -0
  663. package/dist/settings-m5tIYnF0.mjs.map +1 -0
  664. package/dist/setup-complete-B2_dhZZz.mjs +65 -0
  665. package/dist/setup-complete-B2_dhZZz.mjs.map +1 -0
  666. package/dist/setup-nonce-CJV9ftSK.mjs +25 -0
  667. package/dist/setup-nonce-CJV9ftSK.mjs.map +1 -0
  668. package/dist/single-flight-cache-D0EaGbN1.mjs +104 -0
  669. package/dist/single-flight-cache-D0EaGbN1.mjs.map +1 -0
  670. package/dist/site-settings-KJOqJW6W.mjs +50 -0
  671. package/dist/site-settings-KJOqJW6W.mjs.map +1 -0
  672. package/dist/site-url-Ceq_AUK0.mjs +16 -0
  673. package/dist/site-url-Ceq_AUK0.mjs.map +1 -0
  674. package/dist/snapshot-Dzsn3NZa.mjs +414 -0
  675. package/dist/snapshot-Dzsn3NZa.mjs.map +1 -0
  676. package/dist/ssrf-DsmvZB80.mjs +406 -0
  677. package/dist/ssrf-DsmvZB80.mjs.map +1 -0
  678. package/dist/stage-Csnh_yEd.mjs +662 -0
  679. package/dist/stage-Csnh_yEd.mjs.map +1 -0
  680. package/dist/staged-Q7pnEVvI.mjs +686 -0
  681. package/dist/staged-Q7pnEVvI.mjs.map +1 -0
  682. package/dist/state-kGdOMQRY.mjs +153 -0
  683. package/dist/state-kGdOMQRY.mjs.map +1 -0
  684. package/dist/status-D39Fpy8R.mjs +30 -0
  685. package/dist/status-D39Fpy8R.mjs.map +1 -0
  686. package/dist/storage/local.d.mts +1 -1
  687. package/dist/storage/local.mjs +2 -2
  688. package/dist/storage/s3.d.mts +1 -1
  689. package/dist/storage/s3.mjs +1 -1
  690. package/dist/storage-query-C7iy6eUb.d.mts +1615 -0
  691. package/dist/storage-query-C7iy6eUb.d.mts.map +1 -0
  692. package/dist/tar-BWiraSUY.mjs +449 -0
  693. package/dist/tar-BWiraSUY.mjs.map +1 -0
  694. package/dist/target-DOFs5oUC.mjs +27 -0
  695. package/dist/target-DOFs5oUC.mjs.map +1 -0
  696. package/dist/taxonomies-BS40Wxvi.mjs +939 -0
  697. package/dist/taxonomies-BS40Wxvi.mjs.map +1 -0
  698. package/dist/taxonomies-DAZU9VDd.mjs +697 -0
  699. package/dist/taxonomies-DAZU9VDd.mjs.map +1 -0
  700. package/dist/taxonomy-XzLE95Vx.mjs +525 -0
  701. package/dist/taxonomy-XzLE95Vx.mjs.map +1 -0
  702. package/dist/tokens-DSQan4p7.mjs +171 -0
  703. package/dist/tokens-DSQan4p7.mjs.map +1 -0
  704. package/dist/transfer-BcCVxDgf.mjs +166 -0
  705. package/dist/transfer-BcCVxDgf.mjs.map +1 -0
  706. package/dist/transfer-OMrancOt.mjs +8873 -0
  707. package/dist/transfer-OMrancOt.mjs.map +1 -0
  708. package/dist/transfer-download-Dc-ltjZY.mjs +33 -0
  709. package/dist/transfer-download-Dc-ltjZY.mjs.map +1 -0
  710. package/dist/transformations-Ddx7UtrY.mjs +196 -0
  711. package/dist/transformations-Ddx7UtrY.mjs.map +1 -0
  712. package/dist/transport-flR-Zmds.d.mts +42 -0
  713. package/dist/transport-flR-Zmds.d.mts.map +1 -0
  714. package/dist/transport-umzEbgYO.mjs +136 -0
  715. package/dist/transport-umzEbgYO.mjs.map +1 -0
  716. package/dist/trusted-proxy-BqfQFs6a.mjs +51 -0
  717. package/dist/trusted-proxy-BqfQFs6a.mjs.map +1 -0
  718. package/dist/turnstile-Do60baId.mjs +58 -0
  719. package/dist/turnstile-Do60baId.mjs.map +1 -0
  720. package/dist/types-BT1p3uyb.d.mts +1735 -0
  721. package/dist/types-BT1p3uyb.d.mts.map +1 -0
  722. package/dist/types-BYaPWs_F.d.mts +198 -0
  723. package/dist/types-BYaPWs_F.d.mts.map +1 -0
  724. package/dist/types-C-Xp0CcN.mjs +103 -0
  725. package/dist/types-C-Xp0CcN.mjs.map +1 -0
  726. package/dist/types-CLTQ9b_r.d.mts +374 -0
  727. package/dist/types-CLTQ9b_r.d.mts.map +1 -0
  728. package/dist/types-CPkQw2T2.d.mts +85 -0
  729. package/dist/types-CPkQw2T2.d.mts.map +1 -0
  730. package/dist/types-CQLvuXoZ.d.mts +198 -0
  731. package/dist/types-CQLvuXoZ.d.mts.map +1 -0
  732. package/dist/types-CV5xszpF.d.mts +363 -0
  733. package/dist/types-CV5xszpF.d.mts.map +1 -0
  734. package/dist/types-CdEMurNh.mjs +77 -0
  735. package/dist/types-CdEMurNh.mjs.map +1 -0
  736. package/dist/types-Cj0_yZkn.mjs +18 -0
  737. package/dist/types-Cj0_yZkn.mjs.map +1 -0
  738. package/dist/types-CxwtnuSS.mjs +37 -0
  739. package/dist/types-CxwtnuSS.mjs.map +1 -0
  740. package/dist/types-DGw8KMX_.mjs +16 -0
  741. package/dist/types-DGw8KMX_.mjs.map +1 -0
  742. package/dist/types-DOfVMPoo.d.mts +125 -0
  743. package/dist/types-DOfVMPoo.d.mts.map +1 -0
  744. package/dist/types-LtS0SM4F.d.mts +287 -0
  745. package/dist/types-LtS0SM4F.d.mts.map +1 -0
  746. package/dist/types-ifgOkcBa.d.mts +916 -0
  747. package/dist/types-ifgOkcBa.d.mts.map +1 -0
  748. package/dist/update-check-DOc2aBIU.mjs +161 -0
  749. package/dist/update-check-DOc2aBIU.mjs.map +1 -0
  750. package/dist/upload-attempts-nzdc3cay.mjs +32 -0
  751. package/dist/upload-attempts-nzdc3cay.mjs.map +1 -0
  752. package/dist/url-pattern-hVbqpXs6.mjs +41 -0
  753. package/dist/url-pattern-hVbqpXs6.mjs.map +1 -0
  754. package/dist/user-Dnp53zTq.mjs +171 -0
  755. package/dist/user-Dnp53zTq.mjs.map +1 -0
  756. package/dist/utils-CoV-PYhg.mjs +439 -0
  757. package/dist/utils-CoV-PYhg.mjs.map +1 -0
  758. package/dist/validate-CfQ9_YlD.d.mts +468 -0
  759. package/dist/validate-CfQ9_YlD.d.mts.map +1 -0
  760. package/dist/validate-DBX3DKtL.mjs +516 -0
  761. package/dist/validate-DBX3DKtL.mjs.map +1 -0
  762. package/dist/validation-BJMiDhB1.mjs +219 -0
  763. package/dist/validation-BJMiDhB1.mjs.map +1 -0
  764. package/dist/version-BaT8yKIT.mjs +7 -0
  765. package/dist/version-BaT8yKIT.mjs.map +1 -0
  766. package/dist/version-BwEGkqkx.mjs +9 -0
  767. package/dist/version-BwEGkqkx.mjs.map +1 -0
  768. package/dist/virtual-modules-B6vJW15k.mjs +516 -0
  769. package/dist/virtual-modules-B6vJW15k.mjs.map +1 -0
  770. package/dist/widgets-BkxBAgZ_.mjs +126 -0
  771. package/dist/widgets-BkxBAgZ_.mjs.map +1 -0
  772. package/dist/wxr-taxonomies-D7gAJyOF.mjs +453 -0
  773. package/dist/wxr-taxonomies-D7gAJyOF.mjs.map +1 -0
  774. package/dist/wxr-taxonomies-DM5J9AsT.d.mts +34 -0
  775. package/dist/wxr-taxonomies-DM5J9AsT.d.mts.map +1 -0
  776. package/dist/zod-generator-BQilAboC.mjs +424 -0
  777. package/dist/zod-generator-BQilAboC.mjs.map +1 -0
  778. package/package.json +11 -5
  779. package/src/api/errors.ts +3 -0
  780. package/src/api/handlers/bylines.ts +24 -3
  781. package/src/api/handlers/calendar.ts +246 -0
  782. package/src/api/handlers/content.ts +12 -5
  783. package/src/api/handlers/media-allowlist.ts +1 -0
  784. package/src/api/handlers/media-upload.ts +13 -10
  785. package/src/api/handlers/plugins.ts +21 -29
  786. package/src/api/handlers/redirects.ts +6 -6
  787. package/src/api/schemas/bylines.ts +3 -1
  788. package/src/api/schemas/content.ts +16 -0
  789. package/src/astro/integration/index.ts +18 -1
  790. package/src/astro/integration/routes.ts +5 -0
  791. package/src/astro/integration/vite-config.ts +11 -0
  792. package/src/astro/middleware/csp.ts +1 -0
  793. package/src/astro/middleware/redirect.ts +20 -9
  794. package/src/astro/middleware/request-context.ts +54 -27
  795. package/src/astro/middleware.ts +97 -12
  796. package/src/astro/prefetch.ts +10 -3
  797. package/src/astro/routes/api/admin/bylines/[id]/translations.ts +0 -5
  798. package/src/astro/routes/api/admin/bylines/index.ts +1 -1
  799. package/src/astro/routes/api/admin/plugins/[id]/index.ts +1 -0
  800. package/src/astro/routes/api/auth/oauth/[provider]/callback.ts +56 -4
  801. package/src/astro/routes/api/auth/oauth/[provider].ts +37 -4
  802. package/src/astro/routes/api/calendar.ts +35 -0
  803. package/src/astro/routes/api/media/upload-url.ts +8 -4
  804. package/src/astro/routes/api/media.ts +9 -5
  805. package/src/astro/routes/api/setup/index.ts +14 -2
  806. package/src/auth/providers/microsoft-admin.tsx +31 -0
  807. package/src/auth/providers/microsoft.ts +47 -0
  808. package/src/comments/turnstile.ts +6 -1
  809. package/src/components/HtmlBlock.astro +17 -6
  810. package/src/components/HtmlBlockFrame.astro +63 -0
  811. package/src/components/Iframe.astro +141 -0
  812. package/src/components/InlinePortableTextEditor.tsx +8 -7
  813. package/src/components/WebMcpSearch.astro +80 -0
  814. package/src/components/index.ts +5 -2
  815. package/src/components/webmcp-search.ts +142 -0
  816. package/src/config/secrets.ts +27 -15
  817. package/src/content/converters/portable-text-identity.ts +1 -0
  818. package/src/content/converters/portable-text-to-prosemirror.ts +36 -2
  819. package/src/content/converters/prosemirror-to-portable-text.ts +28 -2
  820. package/src/content/converters/types.ts +24 -0
  821. package/src/database/content-datetime.ts +11 -4
  822. package/src/database/migrations/090_redirect_enable_loop_guard.ts +70 -0
  823. package/src/database/migrations/091_redirect_artifacts.ts +141 -0
  824. package/src/database/migrations/runner.ts +4 -0
  825. package/src/database/repositories/content.ts +81 -26
  826. package/src/database/repositories/redirect.ts +6 -1
  827. package/src/database/request-scoped.ts +34 -0
  828. package/src/database/types.ts +23 -0
  829. package/src/db/adapters.ts +2 -0
  830. package/src/emdash-runtime.ts +28 -3
  831. package/src/import/menus.ts +3 -0
  832. package/src/index.ts +1 -0
  833. package/src/loader.ts +226 -55
  834. package/src/mcp/server.ts +12 -4
  835. package/src/media/mime.ts +21 -0
  836. package/src/menus/index.ts +30 -26
  837. package/src/plugins/hooks.ts +10 -0
  838. package/src/plugins/manager.ts +12 -2
  839. package/src/plugins/types.ts +16 -0
  840. package/src/query.ts +12 -29
  841. package/src/redirects/artifacts.ts +460 -0
  842. package/src/redirects/cache.ts +76 -41
  843. package/src/request-context.ts +1 -1
  844. package/src/seed/apply.ts +65 -57
  845. package/src/settings/index.ts +17 -12
  846. package/src/transfer/format/columns.ts +3 -0
  847. package/src/transfer/import/rebuild.ts +17 -2
  848. package/src/transfer/import/scaffold.ts +16 -9
  849. package/src/ui.ts +1 -0
  850. package/src/utils/sanitize.ts +14 -9
  851. package/src/virtual-modules.d.ts +3 -0
  852. package/dist/action-token-D2KE1Rqf.mjs +0 -26
  853. package/dist/action-token-D2KE1Rqf.mjs.map +0 -1
  854. package/dist/activation-DDuqAat2.mjs +0 -387
  855. package/dist/activation-DDuqAat2.mjs.map +0 -1
  856. package/dist/adapters-Ds-1Pmkm.d.mts +0 -171
  857. package/dist/adapters-Ds-1Pmkm.d.mts.map +0 -1
  858. package/dist/allowed-origins-D78QvbTO.mjs +0 -116
  859. package/dist/allowed-origins-D78QvbTO.mjs.map +0 -1
  860. package/dist/api-BBZlif0y.mjs +0 -4974
  861. package/dist/api-BBZlif0y.mjs.map +0 -1
  862. package/dist/api-tokens-BGbfWZVO.mjs +0 -166
  863. package/dist/api-tokens-BGbfWZVO.mjs.map +0 -1
  864. package/dist/apply-CDNV4JJ-.mjs +0 -1672
  865. package/dist/apply-CDNV4JJ-.mjs.map +0 -1
  866. package/dist/approvals-CVvJSEBF.mjs +0 -460
  867. package/dist/approvals-CVvJSEBF.mjs.map +0 -1
  868. package/dist/artifact-fetch-CGK0DQLj.mjs +0 -659
  869. package/dist/artifact-fetch-CGK0DQLj.mjs.map +0 -1
  870. package/dist/audit-BszbE_BP.mjs +0 -127
  871. package/dist/audit-BszbE_BP.mjs.map +0 -1
  872. package/dist/authoritative-records-ChM8dTeV.mjs +0 -5172
  873. package/dist/authoritative-records-ChM8dTeV.mjs.map +0 -1
  874. package/dist/authorize-CTGywswM.mjs +0 -49
  875. package/dist/authorize-CTGywswM.mjs.map +0 -1
  876. package/dist/backup-CDrPP8fI.mjs +0 -246
  877. package/dist/backup-CDrPP8fI.mjs.map +0 -1
  878. package/dist/base64-DvnNgP7e.mjs +0 -63
  879. package/dist/base64-DvnNgP7e.mjs.map +0 -1
  880. package/dist/block-types-nNEaPkvx.mjs +0 -132
  881. package/dist/block-types-nNEaPkvx.mjs.map +0 -1
  882. package/dist/block-values-Bho1nsZF.mjs +0 -175
  883. package/dist/block-values-Bho1nsZF.mjs.map +0 -1
  884. package/dist/byline-02tu_Uc-.mjs +0 -909
  885. package/dist/byline-02tu_Uc-.mjs.map +0 -1
  886. package/dist/byline-fields-BYbTptTU.mjs +0 -280
  887. package/dist/byline-fields-BYbTptTU.mjs.map +0 -1
  888. package/dist/byline-fields-BjQH-1z9.mjs +0 -123
  889. package/dist/byline-fields-BjQH-1z9.mjs.map +0 -1
  890. package/dist/bylines-VytjeHBI.mjs +0 -214
  891. package/dist/bylines-VytjeHBI.mjs.map +0 -1
  892. package/dist/bylines-gyWBWUUc.mjs +0 -150
  893. package/dist/bylines-gyWBWUUc.mjs.map +0 -1
  894. package/dist/cache-CPanL9IO.mjs +0 -114
  895. package/dist/cache-CPanL9IO.mjs.map +0 -1
  896. package/dist/canonical-CAecl1UQ.mjs +0 -174
  897. package/dist/canonical-CAecl1UQ.mjs.map +0 -1
  898. package/dist/capture-triggers-CdZfvHtF.mjs +0 -362
  899. package/dist/capture-triggers-CdZfvHtF.mjs.map +0 -1
  900. package/dist/challenge-store-VePApay4.mjs +0 -51
  901. package/dist/challenge-store-VePApay4.mjs.map +0 -1
  902. package/dist/checksum-BSIhEAYW.mjs +0 -162
  903. package/dist/checksum-BSIhEAYW.mjs.map +0 -1
  904. package/dist/chrome-tags-CKELm-bo.mjs +0 -24
  905. package/dist/chrome-tags-CKELm-bo.mjs.map +0 -1
  906. package/dist/chunks-DBmkKmBH.mjs +0 -25
  907. package/dist/chunks-DBmkKmBH.mjs.map +0 -1
  908. package/dist/collection-slugs-cache-BNRAPNiu.mjs +0 -85
  909. package/dist/collection-slugs-cache-BNRAPNiu.mjs.map +0 -1
  910. package/dist/comment-Cq1UYN8_.mjs +0 -313
  911. package/dist/comment-Cq1UYN8_.mjs.map +0 -1
  912. package/dist/comment-reaction-B5sZzSoA.mjs +0 -85
  913. package/dist/comment-reaction-B5sZzSoA.mjs.map +0 -1
  914. package/dist/comments-B3F-ETyh.mjs +0 -195
  915. package/dist/comments-B3F-ETyh.mjs.map +0 -1
  916. package/dist/comments-zrTgWBSg.mjs +0 -99
  917. package/dist/comments-zrTgWBSg.mjs.map +0 -1
  918. package/dist/components-Dbf4Eq16.mjs +0 -108
  919. package/dist/components-Dbf4Eq16.mjs.map +0 -1
  920. package/dist/config-BCM5sQP7.d.mts +0 -6688
  921. package/dist/config-BCM5sQP7.d.mts.map +0 -1
  922. package/dist/config-CXPcy2iY.mjs +0 -228
  923. package/dist/config-CXPcy2iY.mjs.map +0 -1
  924. package/dist/config-CZkZBuBK.d.mts +0 -39
  925. package/dist/config-CZkZBuBK.d.mts.map +0 -1
  926. package/dist/connection-C5GIciX9.mjs +0 -36
  927. package/dist/connection-C5GIciX9.mjs.map +0 -1
  928. package/dist/content-RzEXY3QX.mjs +0 -2020
  929. package/dist/content-RzEXY3QX.mjs.map +0 -1
  930. package/dist/content-list-query-B6P37Ug_.d.mts +0 -26
  931. package/dist/content-list-query-B6P37Ug_.d.mts.map +0 -1
  932. package/dist/content-repair-BDVsYXWK.mjs +0 -442
  933. package/dist/content-repair-BDVsYXWK.mjs.map +0 -1
  934. package/dist/context-BpTIzY5h.mjs +0 -2026
  935. package/dist/context-BpTIzY5h.mjs.map +0 -1
  936. package/dist/credits-JOE92Gr7.mjs +0 -110
  937. package/dist/credits-JOE92Gr7.mjs.map +0 -1
  938. package/dist/cron-ktyapbdB.mjs +0 -306
  939. package/dist/cron-ktyapbdB.mjs.map +0 -1
  940. package/dist/dashboard-BoV4pwPP.mjs +0 -151
  941. package/dist/dashboard-BoV4pwPP.mjs.map +0 -1
  942. package/dist/default-B7KnYwtQ.mjs +0 -81
  943. package/dist/default-B7KnYwtQ.mjs.map +0 -1
  944. package/dist/deferred-tasks-eaUIqXj8.d.mts +0 -9
  945. package/dist/deferred-tasks-eaUIqXj8.d.mts.map +0 -1
  946. package/dist/dev-typegen-8JlYYFno.mjs +0 -29
  947. package/dist/dev-typegen-8JlYYFno.mjs.map +0 -1
  948. package/dist/device-flow-BlV_z24g.mjs +0 -521
  949. package/dist/device-flow-BlV_z24g.mjs.map +0 -1
  950. package/dist/digest-DiYAoZpf.mjs +0 -194
  951. package/dist/digest-DiYAoZpf.mjs.map +0 -1
  952. package/dist/direct-executor-Db8xA3zg.mjs +0 -104
  953. package/dist/direct-executor-Db8xA3zg.mjs.map +0 -1
  954. package/dist/email-console-Dm78wSmg.mjs +0 -50
  955. package/dist/email-console-Dm78wSmg.mjs.map +0 -1
  956. package/dist/email-locale-B4X9LXe9.mjs +0 -25
  957. package/dist/email-locale-B4X9LXe9.mjs.map +0 -1
  958. package/dist/emdash-runtime-BakQ6io7.mjs +0 -4239
  959. package/dist/emdash-runtime-BakQ6io7.mjs.map +0 -1
  960. package/dist/enrich-BDdVNeDK.mjs +0 -194
  961. package/dist/enrich-BDdVNeDK.mjs.map +0 -1
  962. package/dist/entry-lock-DY8B-xcr.d.mts +0 -4544
  963. package/dist/entry-lock-DY8B-xcr.d.mts.map +0 -1
  964. package/dist/entry-lock-DrUAdTzf.mjs +0 -163
  965. package/dist/entry-lock-DrUAdTzf.mjs.map +0 -1
  966. package/dist/entry-lock-yIkBduqJ.mjs +0 -1180
  967. package/dist/entry-lock-yIkBduqJ.mjs.map +0 -1
  968. package/dist/env-types-DkHYR2pl.mjs +0 -38
  969. package/dist/env-types-DkHYR2pl.mjs.map +0 -1
  970. package/dist/error-DIYXAVk4.mjs +0 -90
  971. package/dist/error-DIYXAVk4.mjs.map +0 -1
  972. package/dist/errors-CNvATh_7.mjs +0 -469
  973. package/dist/errors-CNvATh_7.mjs.map +0 -1
  974. package/dist/errors-CjXd1LgH.mjs +0 -120
  975. package/dist/errors-CjXd1LgH.mjs.map +0 -1
  976. package/dist/escape-B1GM0yJU.mjs +0 -9
  977. package/dist/escape-B1GM0yJU.mjs.map +0 -1
  978. package/dist/fence-8MaKKWhp.mjs +0 -162
  979. package/dist/fence-8MaKKWhp.mjs.map +0 -1
  980. package/dist/field-defs-cache-DEkFYCDE.mjs +0 -77
  981. package/dist/field-defs-cache-DEkFYCDE.mjs.map +0 -1
  982. package/dist/field-map-D7ioN0r0.mjs +0 -83
  983. package/dist/field-map-D7ioN0r0.mjs.map +0 -1
  984. package/dist/fts-manager-DU03MxWu.mjs +0 -443
  985. package/dist/fts-manager-DU03MxWu.mjs.map +0 -1
  986. package/dist/gc-DMiE7ezk.mjs +0 -75
  987. package/dist/gc-DMiE7ezk.mjs.map +0 -1
  988. package/dist/hash-CY4QdeMJ.mjs +0 -37
  989. package/dist/hash-CY4QdeMJ.mjs.map +0 -1
  990. package/dist/hook-result-Cb67D3P3.d.mts +0 -31
  991. package/dist/hook-result-Cb67D3P3.d.mts.map +0 -1
  992. package/dist/hreflang-Bterc3b7.mjs +0 -105
  993. package/dist/hreflang-Bterc3b7.mjs.map +0 -1
  994. package/dist/hreflang-uIBOE5yg.d.mts +0 -50
  995. package/dist/hreflang-uIBOE5yg.d.mts.map +0 -1
  996. package/dist/http-route-dispatch-DubjTibD.mjs +0 -339
  997. package/dist/http-route-dispatch-DubjTibD.mjs.map +0 -1
  998. package/dist/identity-DJ-5AcdG.mjs +0 -35
  999. package/dist/identity-DJ-5AcdG.mjs.map +0 -1
  1000. package/dist/import-DEfuIgRz.mjs +0 -2020
  1001. package/dist/import-DEfuIgRz.mjs.map +0 -1
  1002. package/dist/index-xCy3j0f6.d.mts +0 -623
  1003. package/dist/index-xCy3j0f6.d.mts.map +0 -1
  1004. package/dist/init-lock-4eRRB4Le.mjs +0 -56
  1005. package/dist/init-lock-4eRRB4Le.mjs.map +0 -1
  1006. package/dist/install-finalization-DeGRbaVa.mjs +0 -58
  1007. package/dist/install-finalization-DeGRbaVa.mjs.map +0 -1
  1008. package/dist/keys-DWwMxdZh.mjs +0 -61
  1009. package/dist/keys-DWwMxdZh.mjs.map +0 -1
  1010. package/dist/kinds-D1A-00-F.mjs +0 -974
  1011. package/dist/kinds-D1A-00-F.mjs.map +0 -1
  1012. package/dist/lifecycle-BWtBGNEn.mjs +0 -25
  1013. package/dist/lifecycle-BWtBGNEn.mjs.map +0 -1
  1014. package/dist/load-BR1NEa_3.mjs +0 -28
  1015. package/dist/load-BR1NEa_3.mjs.map +0 -1
  1016. package/dist/loader-D4edocWH.mjs +0 -1197
  1017. package/dist/loader-D4edocWH.mjs.map +0 -1
  1018. package/dist/loops-DLaHFrvI.mjs +0 -205
  1019. package/dist/loops-DLaHFrvI.mjs.map +0 -1
  1020. package/dist/manifest-builder-8jsSLR7s.mjs +0 -189
  1021. package/dist/manifest-builder-8jsSLR7s.mjs.map +0 -1
  1022. package/dist/manifest-schema-DcZjRNEv.mjs +0 -496
  1023. package/dist/manifest-schema-DcZjRNEv.mjs.map +0 -1
  1024. package/dist/marketplace-CNxjq10S.mjs +0 -257
  1025. package/dist/marketplace-CNxjq10S.mjs.map +0 -1
  1026. package/dist/media-3v7mqAVX.mjs +0 -294
  1027. package/dist/media-3v7mqAVX.mjs.map +0 -1
  1028. package/dist/media-Bs6qmlVl.mjs +0 -408
  1029. package/dist/media-Bs6qmlVl.mjs.map +0 -1
  1030. package/dist/media-CputjGE1.mjs +0 -373
  1031. package/dist/media-CputjGE1.mjs.map +0 -1
  1032. package/dist/media-allowlist-isqF1gAh.mjs +0 -44
  1033. package/dist/media-allowlist-isqF1gAh.mjs.map +0 -1
  1034. package/dist/media-folders-D2VdVBf6.mjs +0 -210
  1035. package/dist/media-folders-D2VdVBf6.mjs.map +0 -1
  1036. package/dist/media-url-DbkMY3y6.mjs +0 -43
  1037. package/dist/media-url-DbkMY3y6.mjs.map +0 -1
  1038. package/dist/media-usage-activation-BaT4AlNI.mjs +0 -78
  1039. package/dist/media-usage-activation-BaT4AlNI.mjs.map +0 -1
  1040. package/dist/media-usage-v43L0kR_.mjs +0 -282
  1041. package/dist/media-usage-v43L0kR_.mjs.map +0 -1
  1042. package/dist/media-usage-work-CY8gIeU-.mjs +0 -151
  1043. package/dist/media-usage-work-CY8gIeU-.mjs.map +0 -1
  1044. package/dist/media-usage-work-VO108Q9E.mjs +0 -1015
  1045. package/dist/media-usage-work-VO108Q9E.mjs.map +0 -1
  1046. package/dist/menus-BYyeRemR.mjs +0 -3647
  1047. package/dist/menus-BYyeRemR.mjs.map +0 -1
  1048. package/dist/menus-mC_XTxD7.mjs +0 -92
  1049. package/dist/menus-mC_XTxD7.mjs.map +0 -1
  1050. package/dist/menus-trvc6_fW.mjs +0 -753
  1051. package/dist/menus-trvc6_fW.mjs.map +0 -1
  1052. package/dist/mime-IZf-LHIS.mjs +0 -36
  1053. package/dist/mime-IZf-LHIS.mjs.map +0 -1
  1054. package/dist/mode-B9-gMXL9.mjs +0 -23
  1055. package/dist/mode-B9-gMXL9.mjs.map +0 -1
  1056. package/dist/node-sqlite-compat-DztcWs4y.mjs +0 -63
  1057. package/dist/node-sqlite-compat-DztcWs4y.mjs.map +0 -1
  1058. package/dist/oauth-authorization-BIHy9SGU.mjs +0 -274
  1059. package/dist/oauth-authorization-BIHy9SGU.mjs.map +0 -1
  1060. package/dist/oauth-clients-BZWZvKXa.mjs +0 -266
  1061. package/dist/oauth-clients-BZWZvKXa.mjs.map +0 -1
  1062. package/dist/oauth-state-store-CxXTjXdI.mjs +0 -50
  1063. package/dist/oauth-state-store-CxXTjXdI.mjs.map +0 -1
  1064. package/dist/oauth-user-lookup-GWojfxRl.mjs +0 -26
  1065. package/dist/oauth-user-lookup-GWojfxRl.mjs.map +0 -1
  1066. package/dist/options-DRF6dlXY.d.mts +0 -81
  1067. package/dist/options-DRF6dlXY.d.mts.map +0 -1
  1068. package/dist/ownership-Bd77AmJz.mjs +0 -12
  1069. package/dist/ownership-Bd77AmJz.mjs.map +0 -1
  1070. package/dist/parse-5Y0W39xR.mjs +0 -81
  1071. package/dist/parse-5Y0W39xR.mjs.map +0 -1
  1072. package/dist/parse-BPblgoa-.d.mts +0 -172
  1073. package/dist/parse-BPblgoa-.d.mts.map +0 -1
  1074. package/dist/passkey-config-PiQ5cBnt.mjs +0 -46
  1075. package/dist/passkey-config-PiQ5cBnt.mjs.map +0 -1
  1076. package/dist/paths-DkS74lBM.mjs +0 -77
  1077. package/dist/paths-DkS74lBM.mjs.map +0 -1
  1078. package/dist/placeholder-Bez2282x.d.mts +0 -306
  1079. package/dist/placeholder-Bez2282x.d.mts.map +0 -1
  1080. package/dist/plan-Lw7iGnGD.mjs +0 -135
  1081. package/dist/plan-Lw7iGnGD.mjs.map +0 -1
  1082. package/dist/plugins-D7xSh1Lu.mjs +0 -277
  1083. package/dist/plugins-D7xSh1Lu.mjs.map +0 -1
  1084. package/dist/policy-DMRiMdLn.mjs +0 -45
  1085. package/dist/policy-DMRiMdLn.mjs.map +0 -1
  1086. package/dist/portable-text-kcyN3F-a.mjs +0 -307
  1087. package/dist/portable-text-kcyN3F-a.mjs.map +0 -1
  1088. package/dist/preview--2VDLaND.mjs +0 -107
  1089. package/dist/preview--2VDLaND.mjs.map +0 -1
  1090. package/dist/protocol-FvwLA8P-.d.mts +0 -61
  1091. package/dist/protocol-FvwLA8P-.d.mts.map +0 -1
  1092. package/dist/public-submission-BRyK76U8.mjs +0 -250
  1093. package/dist/public-submission-BRyK76U8.mjs.map +0 -1
  1094. package/dist/public-url-7j0cpCFc.mjs +0 -101
  1095. package/dist/public-url-7j0cpCFc.mjs.map +0 -1
  1096. package/dist/query-BRNTde3V.mjs +0 -41
  1097. package/dist/query-BRNTde3V.mjs.map +0 -1
  1098. package/dist/query-DyYYWOKk.mjs +0 -1161
  1099. package/dist/query-DyYYWOKk.mjs.map +0 -1
  1100. package/dist/rate-limit-D0BcE76H.mjs +0 -120
  1101. package/dist/rate-limit-D0BcE76H.mjs.map +0 -1
  1102. package/dist/receipt-C4icyHlC.mjs +0 -43
  1103. package/dist/receipt-C4icyHlC.mjs.map +0 -1
  1104. package/dist/redirect-9DbtxSNG.mjs +0 -19
  1105. package/dist/redirect-9DbtxSNG.mjs.map +0 -1
  1106. package/dist/redirect-BvFKh8Sz.mjs +0 -416
  1107. package/dist/redirect-BvFKh8Sz.mjs.map +0 -1
  1108. package/dist/redirects-1nhdEaTq.mjs +0 -148
  1109. package/dist/redirects-1nhdEaTq.mjs.map +0 -1
  1110. package/dist/redirects-D1yMnSR9.mjs +0 -446
  1111. package/dist/redirects-D1yMnSR9.mjs.map +0 -1
  1112. package/dist/registry-CzPJNu3H.mjs +0 -8366
  1113. package/dist/registry-CzPJNu3H.mjs.map +0 -1
  1114. package/dist/relations-C8JpSkU6.mjs +0 -776
  1115. package/dist/relations-C8JpSkU6.mjs.map +0 -1
  1116. package/dist/request-meta-Bs60XW1m.mjs +0 -141
  1117. package/dist/request-meta-Bs60XW1m.mjs.map +0 -1
  1118. package/dist/resolve-BHWgMU_X.mjs +0 -100
  1119. package/dist/resolve-BHWgMU_X.mjs.map +0 -1
  1120. package/dist/revision-CGkQA0e5.mjs +0 -366
  1121. package/dist/revision-CGkQA0e5.mjs.map +0 -1
  1122. package/dist/route-wire-ClUVQduA.mjs +0 -197
  1123. package/dist/route-wire-ClUVQduA.mjs.map +0 -1
  1124. package/dist/routes-D2GFl3B7.mjs +0 -272
  1125. package/dist/routes-D2GFl3B7.mjs.map +0 -1
  1126. package/dist/runner-CLpxmhl8.mjs +0 -6197
  1127. package/dist/runner-CLpxmhl8.mjs.map +0 -1
  1128. package/dist/runner-CWl76CH3.d.mts +0 -68
  1129. package/dist/runner-CWl76CH3.d.mts.map +0 -1
  1130. package/dist/schema-27XefSYG.mjs +0 -13
  1131. package/dist/schema-27XefSYG.mjs.map +0 -1
  1132. package/dist/schema-Btvj3BMh.mjs +0 -815
  1133. package/dist/schema-Btvj3BMh.mjs.map +0 -1
  1134. package/dist/scopes-DGCj6K4p.mjs +0 -34
  1135. package/dist/scopes-DGCj6K4p.mjs.map +0 -1
  1136. package/dist/search-pZRRmWjh.mjs +0 -448
  1137. package/dist/search-pZRRmWjh.mjs.map +0 -1
  1138. package/dist/secrets-CIi0nFiR.mjs +0 -341
  1139. package/dist/secrets-CIi0nFiR.mjs.map +0 -1
  1140. package/dist/sections-CIhqs3Ao.mjs +0 -346
  1141. package/dist/sections-CIhqs3Ao.mjs.map +0 -1
  1142. package/dist/seo-DifeiGdl.mjs +0 -114
  1143. package/dist/seo-DifeiGdl.mjs.map +0 -1
  1144. package/dist/seo-DpYxmGaL.mjs +0 -133
  1145. package/dist/seo-DpYxmGaL.mjs.map +0 -1
  1146. package/dist/service-COVdVpSK.mjs +0 -150
  1147. package/dist/service-COVdVpSK.mjs.map +0 -1
  1148. package/dist/session-user-C6IEjuty.mjs +0 -61
  1149. package/dist/session-user-C6IEjuty.mjs.map +0 -1
  1150. package/dist/settings-CwcrX-Ay.mjs +0 -61
  1151. package/dist/settings-CwcrX-Ay.mjs.map +0 -1
  1152. package/dist/settings-D_cJtT48.mjs +0 -439
  1153. package/dist/settings-D_cJtT48.mjs.map +0 -1
  1154. package/dist/settings-tnPQN3Z2.mjs +0 -51
  1155. package/dist/settings-tnPQN3Z2.mjs.map +0 -1
  1156. package/dist/setup-complete-BOrI10UY.mjs +0 -65
  1157. package/dist/setup-complete-BOrI10UY.mjs.map +0 -1
  1158. package/dist/setup-nonce-0XTBLTsX.mjs +0 -25
  1159. package/dist/setup-nonce-0XTBLTsX.mjs.map +0 -1
  1160. package/dist/single-flight-cache-B5O2qhO1.mjs +0 -104
  1161. package/dist/single-flight-cache-B5O2qhO1.mjs.map +0 -1
  1162. package/dist/site-settings-B7vGFRDT.mjs +0 -50
  1163. package/dist/site-settings-B7vGFRDT.mjs.map +0 -1
  1164. package/dist/site-url-wEYRMHBv.mjs +0 -16
  1165. package/dist/site-url-wEYRMHBv.mjs.map +0 -1
  1166. package/dist/snapshot-W36KbLmc.mjs +0 -414
  1167. package/dist/snapshot-W36KbLmc.mjs.map +0 -1
  1168. package/dist/ssrf-CRJ-xom5.mjs +0 -406
  1169. package/dist/ssrf-CRJ-xom5.mjs.map +0 -1
  1170. package/dist/stage-DA0NrTRZ.mjs +0 -662
  1171. package/dist/stage-DA0NrTRZ.mjs.map +0 -1
  1172. package/dist/staged-Bw5eHbKS.mjs +0 -686
  1173. package/dist/staged-Bw5eHbKS.mjs.map +0 -1
  1174. package/dist/state-BTlprvUF.mjs +0 -153
  1175. package/dist/state-BTlprvUF.mjs.map +0 -1
  1176. package/dist/status-C6IrSLMT.mjs +0 -30
  1177. package/dist/status-C6IrSLMT.mjs.map +0 -1
  1178. package/dist/storage-query-CdVF2bng.d.mts +0 -1614
  1179. package/dist/storage-query-CdVF2bng.d.mts.map +0 -1
  1180. package/dist/tar-BGOZARjy.mjs +0 -449
  1181. package/dist/tar-BGOZARjy.mjs.map +0 -1
  1182. package/dist/target-YhYH_0uc.mjs +0 -27
  1183. package/dist/target-YhYH_0uc.mjs.map +0 -1
  1184. package/dist/taxonomies-DK_XBrmT.mjs +0 -697
  1185. package/dist/taxonomies-DK_XBrmT.mjs.map +0 -1
  1186. package/dist/taxonomies-S1M3rUC0.mjs +0 -939
  1187. package/dist/taxonomies-S1M3rUC0.mjs.map +0 -1
  1188. package/dist/taxonomy-BesdHIwi.mjs +0 -525
  1189. package/dist/taxonomy-BesdHIwi.mjs.map +0 -1
  1190. package/dist/tokens-B_ffPF1q.mjs +0 -171
  1191. package/dist/tokens-B_ffPF1q.mjs.map +0 -1
  1192. package/dist/transfer-9fVSxyrV.mjs +0 -166
  1193. package/dist/transfer-9fVSxyrV.mjs.map +0 -1
  1194. package/dist/transfer-B7LUTaYD.mjs +0 -8855
  1195. package/dist/transfer-B7LUTaYD.mjs.map +0 -1
  1196. package/dist/transfer-download-BdNq4VWN.mjs +0 -33
  1197. package/dist/transfer-download-BdNq4VWN.mjs.map +0 -1
  1198. package/dist/transformations-BtQdvyly.mjs +0 -196
  1199. package/dist/transformations-BtQdvyly.mjs.map +0 -1
  1200. package/dist/transport-CriYXY1c.mjs +0 -136
  1201. package/dist/transport-CriYXY1c.mjs.map +0 -1
  1202. package/dist/transport-SnhS6xku.d.mts +0 -42
  1203. package/dist/transport-SnhS6xku.d.mts.map +0 -1
  1204. package/dist/trusted-proxy-C0eHXPd-.mjs +0 -51
  1205. package/dist/trusted-proxy-C0eHXPd-.mjs.map +0 -1
  1206. package/dist/turnstile-BNPrWd1e.mjs +0 -53
  1207. package/dist/turnstile-BNPrWd1e.mjs.map +0 -1
  1208. package/dist/types-B8sF_kE5.d.mts +0 -287
  1209. package/dist/types-B8sF_kE5.d.mts.map +0 -1
  1210. package/dist/types-BYVIYOlD.d.mts +0 -1720
  1211. package/dist/types-BYVIYOlD.d.mts.map +0 -1
  1212. package/dist/types-Bs4bi95j.d.mts +0 -374
  1213. package/dist/types-Bs4bi95j.d.mts.map +0 -1
  1214. package/dist/types-CGuODCZi.d.mts +0 -198
  1215. package/dist/types-CGuODCZi.d.mts.map +0 -1
  1216. package/dist/types-CVsmpTcU.mjs +0 -18
  1217. package/dist/types-CVsmpTcU.mjs.map +0 -1
  1218. package/dist/types-ClFEExxn.mjs +0 -37
  1219. package/dist/types-ClFEExxn.mjs.map +0 -1
  1220. package/dist/types-D994zUWB.d.mts +0 -85
  1221. package/dist/types-D994zUWB.d.mts.map +0 -1
  1222. package/dist/types-DAj1ByJQ.d.mts +0 -125
  1223. package/dist/types-DAj1ByJQ.d.mts.map +0 -1
  1224. package/dist/types-Dlv6esp4.mjs +0 -77
  1225. package/dist/types-Dlv6esp4.mjs.map +0 -1
  1226. package/dist/types-Dr1LVwL7.d.mts +0 -363
  1227. package/dist/types-Dr1LVwL7.d.mts.map +0 -1
  1228. package/dist/types-MN9bOQ1g.d.mts +0 -198
  1229. package/dist/types-MN9bOQ1g.d.mts.map +0 -1
  1230. package/dist/types-d2Szb1oz.mjs +0 -16
  1231. package/dist/types-d2Szb1oz.mjs.map +0 -1
  1232. package/dist/types-ibtP7GEA.d.mts +0 -896
  1233. package/dist/types-ibtP7GEA.d.mts.map +0 -1
  1234. package/dist/types-j6MBDjlZ.mjs +0 -103
  1235. package/dist/types-j6MBDjlZ.mjs.map +0 -1
  1236. package/dist/update-check-D8No-E5s.mjs +0 -161
  1237. package/dist/update-check-D8No-E5s.mjs.map +0 -1
  1238. package/dist/upload-attempts-BodUoFBu.mjs +0 -32
  1239. package/dist/upload-attempts-BodUoFBu.mjs.map +0 -1
  1240. package/dist/url-pattern-DGAG6ZP2.mjs +0 -41
  1241. package/dist/url-pattern-DGAG6ZP2.mjs.map +0 -1
  1242. package/dist/user-BOvuF1sQ.mjs +0 -171
  1243. package/dist/user-BOvuF1sQ.mjs.map +0 -1
  1244. package/dist/utils-Dr01wRKt.mjs +0 -439
  1245. package/dist/utils-Dr01wRKt.mjs.map +0 -1
  1246. package/dist/validate-BttYU7NK.mjs +0 -516
  1247. package/dist/validate-BttYU7NK.mjs.map +0 -1
  1248. package/dist/validate-Df09inbC.d.mts +0 -468
  1249. package/dist/validate-Df09inbC.d.mts.map +0 -1
  1250. package/dist/validation-DH2WRwWO.mjs +0 -219
  1251. package/dist/validation-DH2WRwWO.mjs.map +0 -1
  1252. package/dist/version-BbygH8CT.mjs +0 -7
  1253. package/dist/version-BbygH8CT.mjs.map +0 -1
  1254. package/dist/version-CseoDDOd.mjs +0 -9
  1255. package/dist/version-CseoDDOd.mjs.map +0 -1
  1256. package/dist/virtual-modules-82GlnQyG.mjs +0 -516
  1257. package/dist/virtual-modules-82GlnQyG.mjs.map +0 -1
  1258. package/dist/widgets-DMAgGcQt.mjs +0 -126
  1259. package/dist/widgets-DMAgGcQt.mjs.map +0 -1
  1260. package/dist/wxr-taxonomies-Bi5kFSxQ.mjs +0 -453
  1261. package/dist/wxr-taxonomies-Bi5kFSxQ.mjs.map +0 -1
  1262. package/dist/wxr-taxonomies-y_FpYlDn.d.mts +0 -34
  1263. package/dist/wxr-taxonomies-y_FpYlDn.d.mts.map +0 -1
  1264. package/dist/zod-generator-DnfG5sGQ.mjs +0 -424
  1265. package/dist/zod-generator-DnfG5sGQ.mjs.map +0 -1
  1266. /package/dist/{api-tokens-B4COohsb.mjs → api-tokens-BLz2MtQs.mjs} +0 -0
  1267. /package/dist/{ssrf-sC4_5rxm.mjs → ssrf-tA45vIPX.mjs} +0 -0
@@ -1,1672 +0,0 @@
1
- import { u as __exportAll } from "./runner-CLpxmhl8.mjs";
2
- import { o as resolveConfiguredLocale, r as getI18nConfig } from "./config-CvmjJcVw.mjs";
3
- import { t as OptionsRepository } from "./options-DhrI7eMv.mjs";
4
- import { t as ContentRepository } from "./content-RzEXY3QX.mjs";
5
- import { r as coalesceObjectCacheWrites } from "./object-cache-Bo6DGaC9.mjs";
6
- import { n as chunks, t as SQL_BATCH_SIZE } from "./chunks-DBmkKmBH.mjs";
7
- import { t as RevisionRepository } from "./revision-CGkQA0e5.mjs";
8
- import { t as withTransaction } from "./transaction-BVYIo_yu.mjs";
9
- import { t as MediaRepository } from "./media-CputjGE1.mjs";
10
- import { t as TaxonomyRepository } from "./taxonomy-BesdHIwi.mjs";
11
- import { t as RedirectRepository } from "./redirect-BvFKh8Sz.mjs";
12
- import { t as BylineRepository } from "./byline-02tu_Uc-.mjs";
13
- import { t as INTERNAL_MEDIA_PREFIX } from "./normalize-BuWa0lvd.mjs";
14
- import { t as imageSize } from "./dist-Cfu8mMBs.mjs";
15
- import { t as FTSManager } from "./fts-manager-DU03MxWu.mjs";
16
- import { f as findTaxonomyStructure, m as saveTaxonomyStructure } from "./loader-D4edocWH.mjs";
17
- import { L as BlockTypeRegistry, U as markContentMediaUsageCollectionStaleSafely, n as SchemaRegistry, t as SchemaError } from "./registry-CzPJNu3H.mjs";
18
- import { i as resolveBlockTypes, r as normalizeBlocksData } from "./block-values-Bho1nsZF.mjs";
19
- import { m as setReferenceSelection } from "./relations-C8JpSkU6.mjs";
20
- import { n as createFieldRelation, t as bindReferenceField } from "./schema-Btvj3BMh.mjs";
21
- import { c as setSiteSettings, s as invalidateSiteSettingsCache } from "./settings-D_cJtT48.mjs";
22
- import { a as ssrfSafeFetch, s as validateExternalUrl } from "./ssrf-CRJ-xom5.mjs";
23
- import { n as validateSeed, t as findTaxonomyStructureSource } from "./validate-BttYU7NK.mjs";
24
- import { ulid } from "ulidx";
25
- import mime from "mime/lite";
26
-
27
- //#region src/media/url.ts
28
- /**
29
- * Build the internal file route URL for a storage key, encoding each path
30
- * segment so `?`, `#` and `%` stay inside the path. A key with an empty, `.` or
31
- * `..` segment is encoded whole, because the URL parser would collapse those
32
- * segments and move the request off the route. Mirrors the admin's
33
- * `localMediaFileUrl`.
34
- */
35
- function localMediaFileUrl(key) {
36
- const segments = key.split("/");
37
- if (segments.some((segment) => segment === "" || segment === "." || segment === "..")) return `${INTERNAL_MEDIA_PREFIX}${encodeURIComponent(key)}`;
38
- return `${INTERNAL_MEDIA_PREFIX}${segments.map(encodeURIComponent).join("/")}`;
39
- }
40
- /**
41
- * Resolve the public URL for a locally stored media key. Returns an empty
42
- * string when no key is given. When a storage adapter is supplied, defers to
43
- * `storage.getPublicUrl()`; otherwise returns the internal proxy route.
44
- */
45
- function resolvePublicMediaUrl(storage, storageKey) {
46
- if (!storageKey) return "";
47
- if (storage) return storage.getPublicUrl(storageKey);
48
- return `/_emdash/api/media/file/${storageKey}`;
49
- }
50
- /**
51
- * Build the `getPublicMediaUrl` closure attached to `Astro.locals.emdash`.
52
- * Shared by the anonymous fast path and the full-runtime path in middleware.
53
- *
54
- * @internal
55
- */
56
- function createPublicMediaUrlResolver(storage) {
57
- return (key) => resolvePublicMediaUrl(storage, key);
58
- }
59
-
60
- //#endregion
61
- //#region src/content/converters/gallery.ts
62
- /**
63
- * Shared sanitization for gallery block images and image media, used by both
64
- * converters so the editor round-trip and the stored shape stay in lockstep.
65
- */
66
- /**
67
- * Read an image's media reference, alt text, and dimensions. Accepts the
68
- * reference shape (`_ref`, `url`) and the MediaValue that seeded `$media`
69
- * stores instead (`id`, `src`, `meta.storageKey`, dimensions). The image's own
70
- * `alt`, `width`, and `height` take precedence over the asset's.
71
- */
72
- function resolveImageMedia(image) {
73
- const record = isRecord(image) ? image : {};
74
- const asset = isRecord(record.asset) ? record.asset : {};
75
- const storageKey = isRecord(asset.meta) ? nonEmptyString(asset.meta.storageKey) : void 0;
76
- const url = nonEmptyString(asset.url) ?? nonEmptyString(asset.src) ?? (storageKey ? localMediaFileUrl(storageKey) : void 0);
77
- const provider = nonEmptyString(asset.provider);
78
- const alt = nonEmptyString(record.alt) ?? nonEmptyString(asset.alt);
79
- const width = typeof record.width === "number" ? record.width : asset.width;
80
- const height = typeof record.height === "number" ? record.height : asset.height;
81
- const media = { asset: {
82
- _type: "reference",
83
- _ref: nonEmptyString(asset._ref) ?? nonEmptyString(asset.id) ?? "",
84
- ...url ? { url } : {},
85
- ...provider ? { provider } : {}
86
- } };
87
- if (alt) media.alt = alt;
88
- if (typeof width === "number") media.width = width;
89
- if (typeof height === "number") media.height = height;
90
- return media;
91
- }
92
- /**
93
- * Normalize an untrusted `images` value into well-formed gallery images.
94
- * Non-object entries and entries without an asset object are dropped.
95
- * Missing `_key`s are filled via `generateKey` when provided (PM → PT);
96
- * left empty otherwise (PT → PM keeps whatever the block carried).
97
- */
98
- function sanitizeGalleryImages(value, generateKey) {
99
- if (!Array.isArray(value)) return [];
100
- const images = [];
101
- for (const entry of value) {
102
- if (!isRecord(entry)) continue;
103
- const record = entry;
104
- if (!isRecord(record.asset)) continue;
105
- const { asset, alt, width, height } = resolveImageMedia(record);
106
- const image = {
107
- _type: "image",
108
- _key: typeof record._key === "string" && record._key ? record._key : generateKey ? generateKey() : "",
109
- asset
110
- };
111
- if (alt) image.alt = alt;
112
- if (typeof record.caption === "string" && record.caption) image.caption = record.caption;
113
- if (width !== void 0) image.width = width;
114
- if (height !== void 0) image.height = height;
115
- if (typeof record.focalX === "number") image.focalX = record.focalX;
116
- if (typeof record.focalY === "number") image.focalY = record.focalY;
117
- if (typeof record.blurhash === "string" && record.blurhash) image.blurhash = record.blurhash;
118
- if (typeof record.dominantColor === "string" && record.dominantColor) image.dominantColor = record.dominantColor;
119
- images.push(image);
120
- }
121
- return images;
122
- }
123
- function nonEmptyString(value) {
124
- return typeof value === "string" && value ? value : void 0;
125
- }
126
- function isRecord(value) {
127
- return typeof value === "object" && value !== null && !Array.isArray(value);
128
- }
129
-
130
- //#endregion
131
- //#region src/seed/apply.ts
132
- /**
133
- * Seed engine - applies seed files to database
134
- *
135
- * This is the core implementation that bootstraps an EmDash site from a seed file.
136
- * Apply order is critical for foreign keys and references.
137
- */
138
- var apply_exports = /* @__PURE__ */ __exportAll({
139
- applySeed: () => applySeed,
140
- applySeedWithinBudget: () => applySeedWithinBudget
141
- });
142
- async function applySiteSettings(db, settings, onConflict, result) {
143
- const entries = Object.entries(settings).filter(([, value]) => value !== void 0);
144
- if (entries.length === 0) return;
145
- if (onConflict === "update") {
146
- await setSiteSettings(settings, db);
147
- result.settings.applied += entries.length;
148
- return;
149
- }
150
- const options = new OptionsRepository(db);
151
- let applied = 0;
152
- try {
153
- for (const [key, value] of entries) {
154
- const write = await options.compareAndSet(`site:${key}`, null, value);
155
- if (!write.applied && onConflict === "error") throw new Error(`Conflict: site setting "site:${key}" already exists`);
156
- if (write.applied) applied++;
157
- }
158
- } finally {
159
- if (applied > 0) {
160
- result.settings.applied += applied;
161
- invalidateSiteSettingsCache();
162
- }
163
- }
164
- }
165
- /**
166
- * Set a collection's `titleField`/`dateField`: a separate write run after the
167
- * fields exist, so `updateCollection` can validate them. No-op when neither is set.
168
- */
169
- async function applyDisplayDateFields(registry, collection) {
170
- if (collection.titleField === void 0 && collection.dateField === void 0) return;
171
- await registry.updateCollection(collection.slug, {
172
- titleField: collection.titleField,
173
- dateField: collection.dateField
174
- });
175
- }
176
- const FILE_EXTENSION_PATTERN = /\.([a-z0-9]+)(?:\?|$)/i;
177
- const SEED_RELATION_NAME_MAX_ATTEMPTS = 5;
178
- const SEED_RELATION_INSERT_BATCH_SIZE = 10;
179
- /** Pattern to remove file extensions */
180
- const EXTENSION_PATTERN = /\.[^.]+$/;
181
- /** Pattern to remove query parameters */
182
- const QUERY_PARAM_PATTERN = /\?.*$/;
183
- /** Pattern to remove non-alphanumeric characters (except dash and underscore) */
184
- const SANITIZE_PATTERN = /[^a-zA-Z0-9_-]/g;
185
- /** Pattern to collapse multiple hyphens */
186
- const MULTIPLE_HYPHENS_PATTERN = /-+/g;
187
- /** The `category` and `tag` defs that migrations insert on every new database. */
188
- const BUILT_IN_TAXONOMY_DEFS = new Map([["taxdef_category", {
189
- label: "Categories",
190
- label_singular: "Category",
191
- hierarchical: 1,
192
- collections: "[\"posts\"]"
193
- }], ["taxdef_tag", {
194
- label: "Tags",
195
- label_singular: "Tag",
196
- hierarchical: 0,
197
- collections: "[\"posts\"]"
198
- }]]);
199
- /** Whether `def` is a built-in `category`/`tag` definition still holding its migration defaults. */
200
- function isUntouchedBuiltInTaxonomyDef(def) {
201
- const builtIn = BUILT_IN_TAXONOMY_DEFS.get(def.id);
202
- return builtIn !== void 0 && def.label === builtIn.label && def.label_singular === builtIn.label_singular && def.hierarchical === builtIn.hierarchical && def.collections === builtIn.collections;
203
- }
204
- /**
205
- * Apply a seed file to the database
206
- *
207
- * This function is idempotent - safe to run multiple times.
208
- *
209
- * @param db - Kysely database instance
210
- * @param seed - Seed file to apply
211
- * @param options - Application options
212
- * @returns Result summary
213
- */
214
- async function applySeed(db, seed, options = {}) {
215
- const { result } = await coalesceObjectCacheWrites(() => applySeedWrites(db, seed, options, null));
216
- return result;
217
- }
218
- /**
219
- * Apply a seed over several calls, for a platform that caps the queries or
220
- * fetches of one request.
221
- *
222
- * The limits are thresholds, checked before each taxonomy term, byline and
223
- * content entry is created and before the phases that follow content. Schema,
224
- * taxonomy definitions and settings are applied in every call, the item that
225
- * crosses a threshold finishes, and the phases after content (menus,
226
- * redirects, widgets, sections) run in one call, so set the limits well below
227
- * the platform's. A call that stops returns `complete: false`; applying the
228
- * same seed again continues with the first item not yet created. A call
229
- * creates at least one item before it stops, so repeated calls finish. A
230
- * `$media` URL used by entries in different calls is downloaded and stored
231
- * again, as a new media row, in each of those calls. Requires
232
- * `onConflict: "skip"`.
233
- */
234
- async function applySeedWithinBudget(db, seed, options, limits) {
235
- const budget = new SeedBudget(limits);
236
- return coalesceObjectCacheWrites(() => applySeedWrites(db.withPlugin(budget), seed, options, budget));
237
- }
238
- /**
239
- * Counts what a budgeted call spends. As a Kysely plugin it sees every query
240
- * the call runs, including those inside transactions.
241
- */
242
- var SeedBudget = class {
243
- #queries = 0;
244
- #mediaDownloads = 0;
245
- constructor(limits) {
246
- this.limits = limits;
247
- }
248
- transformQuery(args) {
249
- this.#queries++;
250
- return args.node;
251
- }
252
- transformResult(args) {
253
- return Promise.resolve(args.result);
254
- }
255
- countMediaDownload() {
256
- this.#mediaDownloads++;
257
- }
258
- isSpent() {
259
- const { queries, mediaDownloads } = this.limits;
260
- return queries !== void 0 && this.#queries >= queries || mediaDownloads !== void 0 && this.#mediaDownloads >= mediaDownloads;
261
- }
262
- };
263
- async function applySeedWrites(db, seed, options, budget) {
264
- const validation = validateSeed(seed);
265
- if (!validation.valid) throw new Error(`Invalid seed file:\n${validation.errors.join("\n")}`);
266
- const { includeContent = false, storage, skipMediaDownload = false, onConflict = "skip" } = options;
267
- if (budget && onConflict !== "skip") throw new Error("A seed budget requires onConflict: \"skip\"");
268
- const result = {
269
- blockTypes: {
270
- created: 0,
271
- skipped: 0,
272
- updated: 0
273
- },
274
- collections: {
275
- created: 0,
276
- skipped: 0,
277
- updated: 0
278
- },
279
- fields: {
280
- created: 0,
281
- skipped: 0,
282
- updated: 0
283
- },
284
- relations: {
285
- created: 0,
286
- skipped: 0,
287
- updated: 0
288
- },
289
- taxonomies: {
290
- created: 0,
291
- skipped: 0,
292
- terms: 0
293
- },
294
- bylines: {
295
- created: 0,
296
- skipped: 0,
297
- updated: 0
298
- },
299
- menus: {
300
- created: 0,
301
- items: 0
302
- },
303
- redirects: {
304
- created: 0,
305
- skipped: 0,
306
- updated: 0
307
- },
308
- widgetAreas: {
309
- created: 0,
310
- widgets: 0
311
- },
312
- sections: {
313
- created: 0,
314
- skipped: 0,
315
- updated: 0
316
- },
317
- settings: { applied: 0 },
318
- content: {
319
- created: 0,
320
- skipped: 0,
321
- updated: 0
322
- },
323
- media: {
324
- created: 0,
325
- skipped: 0
326
- }
327
- };
328
- let complete = true;
329
- const progress = {
330
- done: 0,
331
- total: countSeedItems(seed, includeContent)
332
- };
333
- const mayCreateItem = () => !budget || result.taxonomies.terms + result.bylines.created + result.content.created === 0 || !budget.isSpent();
334
- const mediaContext = {
335
- db,
336
- storage: storage ?? null,
337
- skipMediaDownload,
338
- mediaCache: /* @__PURE__ */ new Map(),
339
- budget
340
- };
341
- const seedIdMap = /* @__PURE__ */ new Map();
342
- const seedBylineIdMap = /* @__PURE__ */ new Map();
343
- const staleMarkedContentCollections = /* @__PURE__ */ new Set();
344
- const failedStaleContentCollections = /* @__PURE__ */ new Set();
345
- const defaultLocale = getI18nConfig()?.defaultLocale ?? seed.defaultLocale ?? "en";
346
- const markSeedContentCollectionStale = async (collectionSlug) => {
347
- if (staleMarkedContentCollections.has(collectionSlug)) return;
348
- if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
349
- staleMarkedContentCollections.add(collectionSlug);
350
- failedStaleContentCollections.delete(collectionSlug);
351
- } else failedStaleContentCollections.add(collectionSlug);
352
- };
353
- const retryFailedSeedContentStaleMarks = async () => {
354
- for (const collectionSlug of failedStaleContentCollections) if (await markContentMediaUsageCollectionStaleSafely(db, collectionSlug, "CONTENT_USAGE_STALE")) {
355
- staleMarkedContentCollections.add(collectionSlug);
356
- failedStaleContentCollections.delete(collectionSlug);
357
- }
358
- };
359
- if (seed.settings) await applySiteSettings(db, seed.settings, onConflict, result);
360
- if (seed.relations) await applySeedRelations(db, seed.relations, seed.collections ?? [], onConflict, result);
361
- if (seed.blockTypes) {
362
- const registry = new BlockTypeRegistry(db);
363
- for (const blockType of seed.blockTypes) {
364
- const existing = await registry.getBlockType(blockType.slug);
365
- await registry.applySeedBlockType(blockType, onConflict);
366
- if (!existing) result.blockTypes.created++;
367
- else if (onConflict === "update") result.blockTypes.updated++;
368
- else result.blockTypes.skipped++;
369
- }
370
- }
371
- if (seed.collections) {
372
- const registry = new SchemaRegistry(db);
373
- const seedCollectionSlugs = new Set(seed.collections.map((collection) => collection.slug));
374
- const knownRelations = await readRelationEnds(db);
375
- const relationSlugs = new Set(knownRelations.keys());
376
- const externalTargetExists = /* @__PURE__ */ new Map();
377
- const pendingRelations = [];
378
- for (const collection of seed.collections) {
379
- if (await registry.getCollection(collection.slug)) {
380
- if (onConflict === "error") throw new Error(`Conflict: collection "${collection.slug}" already exists`);
381
- if (onConflict === "update") {
382
- await registry.updateCollection(collection.slug, {
383
- label: collection.label,
384
- labelSingular: collection.labelSingular,
385
- description: collection.description,
386
- icon: collection.icon,
387
- admin: collection.admin,
388
- supports: collection.supports || [],
389
- urlPattern: collection.urlPattern,
390
- routable: collection.routable,
391
- hidden: collection.hidden,
392
- sortOrder: collection.sortOrder,
393
- group: collection.group,
394
- commentsEnabled: collection.commentsEnabled,
395
- editLocking: collection.editLocking
396
- });
397
- result.collections.updated++;
398
- for (const field of collection.fields) {
399
- const existingField = await registry.getField(collection.slug, field.slug);
400
- await upsertSeedField(db, collection.slug, field, existingField, knownRelations);
401
- if (existingField) result.fields.updated++;
402
- else result.fields.created++;
403
- }
404
- await applyDisplayDateFields(registry, collection);
405
- continue;
406
- }
407
- result.collections.skipped++;
408
- result.fields.skipped += collection.fields.length;
409
- continue;
410
- }
411
- const fields = [];
412
- for (const field of collection.fields) {
413
- let fieldValidation = field.validation;
414
- const bound = resolveSeedFieldRelation(collection.slug, field, knownRelations);
415
- const targetCollection = !bound && field.type === "reference" && typeof fieldValidation?.targetCollection === "string" ? fieldValidation.targetCollection : void 0;
416
- if (bound) fieldValidation = {
417
- ...fieldValidation,
418
- ...bound
419
- };
420
- if (targetCollection) {
421
- let targetExists = seedCollectionSlugs.has(targetCollection);
422
- if (!targetExists) {
423
- targetExists = externalTargetExists.get(targetCollection) ?? false;
424
- if (!externalTargetExists.has(targetCollection)) {
425
- targetExists = Boolean(await registry.getCollection(targetCollection));
426
- externalTargetExists.set(targetCollection, targetExists);
427
- }
428
- }
429
- if (!targetExists) throw new SchemaError(`Target collection "${targetCollection}" not found`, "COLLECTION_NOT_FOUND");
430
- const relationId = ulid();
431
- const relationSlug = allocateSeedRelationName(collection.slug, field.slug, relationSlugs);
432
- pendingRelations.push({
433
- id: relationId,
434
- slug: relationSlug,
435
- parent_collection: collection.slug,
436
- child_collection: targetCollection,
437
- parent_label: collection.label,
438
- parent_label_singular: collection.labelSingular ?? null,
439
- child_label: field.label,
440
- max_children_per_parent: fieldValidation?.multiple ? null : 1
441
- });
442
- fieldValidation = {
443
- ...fieldValidation,
444
- relation: relationSlug,
445
- relationSide: "parent"
446
- };
447
- }
448
- fields.push({
449
- slug: field.slug,
450
- label: field.label,
451
- type: field.type,
452
- required: field.required || false,
453
- unique: field.unique || false,
454
- searchable: field.searchable || false,
455
- indexed: field.indexed || false,
456
- translatable: field.translatable,
457
- defaultValue: field.defaultValue,
458
- validation: fieldValidation,
459
- widget: field.widget,
460
- options: field.options
461
- });
462
- }
463
- await registry.createSeedCollection({
464
- slug: collection.slug,
465
- label: collection.label,
466
- labelSingular: collection.labelSingular,
467
- description: collection.description,
468
- icon: collection.icon,
469
- admin: collection.admin,
470
- supports: collection.supports || [],
471
- urlPattern: collection.urlPattern,
472
- routable: collection.routable,
473
- hidden: collection.hidden,
474
- sortOrder: collection.sortOrder,
475
- group: collection.group,
476
- commentsEnabled: collection.commentsEnabled,
477
- editLocking: collection.editLocking
478
- }, fields);
479
- await applyDisplayDateFields(registry, collection);
480
- result.collections.created++;
481
- result.fields.created += collection.fields.length;
482
- }
483
- for (const relationBatch of chunks(pendingRelations, SEED_RELATION_INSERT_BATCH_SIZE)) await db.insertInto("_emdash_relations").values(relationBatch).execute();
484
- }
485
- if (seed.taxonomies) {
486
- const termSeedIdMap = /* @__PURE__ */ new Map();
487
- const taxonomiesBySeedId = /* @__PURE__ */ new Map();
488
- for (const taxonomy of seed.taxonomies) if (taxonomy.id) taxonomiesBySeedId.set(taxonomy.id, taxonomy);
489
- const untouchedBuiltInDefIds = new Set((await db.selectFrom("_emdash_taxonomy_defs").select([
490
- "id",
491
- "label",
492
- "label_singular",
493
- "hierarchical",
494
- "collections"
495
- ]).where("id", "in", [...BUILT_IN_TAXONOMY_DEFS.keys()]).execute()).filter(isUntouchedBuiltInTaxonomyDef).map((def) => def.id));
496
- const declaresOwnStructure = (taxonomy) => findTaxonomyStructureSource(taxonomy, taxonomiesBySeedId) === taxonomy;
497
- const orderedTaxonomies = [...seed.taxonomies.filter(declaresOwnStructure), ...seed.taxonomies.filter((taxonomy) => !declaresOwnStructure(taxonomy))];
498
- for (const taxonomy of orderedTaxonomies) {
499
- const defLocale = resolveConfiguredLocale(taxonomy.locale ?? defaultLocale);
500
- const defsOfName = await db.selectFrom("_emdash_taxonomy_defs").select(["id", "locale"]).where("name", "=", taxonomy.name).execute();
501
- const existingDef = defsOfName.find((def) => def.locale === defLocale);
502
- const unclaimed = existingDef !== void 0 && untouchedBuiltInDefIds.has(existingDef.id);
503
- if (existingDef && onConflict === "error" && !unclaimed) throw new Error(`Conflict: taxonomy "${taxonomy.name}" (${defLocale}) already exists`);
504
- const replacesDef = onConflict === "update" || unclaimed;
505
- const existingStructure = await findTaxonomyStructure(db, taxonomy.name);
506
- const replacesStructure = replacesDef || defsOfName.every((def) => untouchedBuiltInDefIds.has(def.id));
507
- const writesStructure = !existingStructure || replacesStructure && !taxonomy.translationOf;
508
- const structure = existingStructure && !writesStructure ? existingStructure : {
509
- hierarchical: taxonomy.hierarchical ?? existingStructure?.hierarchical ?? false,
510
- collections: taxonomy.collections ?? existingStructure?.collections ?? []
511
- };
512
- const defId = existingDef?.id ?? ulid();
513
- const translationGroup = writesStructure ? await saveTaxonomyStructure(db, taxonomy.name, existingStructure?.id ?? defId, structure) : existingStructure.id;
514
- if (existingDef) if (replacesDef) await db.updateTable("_emdash_taxonomy_defs").set({
515
- label: taxonomy.label,
516
- label_singular: taxonomy.labelSingular ?? null
517
- }).where("id", "=", existingDef.id).execute();
518
- else result.taxonomies.skipped++;
519
- else {
520
- await db.insertInto("_emdash_taxonomy_defs").values({
521
- id: defId,
522
- name: taxonomy.name,
523
- label: taxonomy.label,
524
- label_singular: taxonomy.labelSingular ?? null,
525
- hierarchical: structure.hierarchical ? 1 : 0,
526
- collections: JSON.stringify(structure.collections),
527
- locale: defLocale,
528
- translation_group: translationGroup
529
- }).execute();
530
- result.taxonomies.created++;
531
- }
532
- if (includeContent && taxonomy.terms && taxonomy.terms.length > 0) {
533
- const termRepo = new TaxonomyRepository(db);
534
- const existingTerms = await findExistingSeedTerms(db, taxonomy.name, taxonomy.terms);
535
- if (structure.hierarchical) {
536
- const applied = await applyHierarchicalTerms(termRepo, taxonomy.name, defLocale, taxonomy.terms, existingTerms, termSeedIdMap, result, onConflict, mayCreateItem);
537
- progress.done += applied.processed;
538
- complete = applied.complete;
539
- } else for (const term of taxonomy.terms) {
540
- const termLocale = resolveConfiguredLocale(term.locale ?? defLocale);
541
- const termKey = seedTermKey(termLocale, term.slug);
542
- const existingId = existingTerms.get(termKey);
543
- if (existingId) {
544
- if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomy.name}" (${termLocale}) already exists`);
545
- if (onConflict === "update") {
546
- await termRepo.update(existingId, {
547
- label: term.label,
548
- data: term.description ? { description: term.description } : {}
549
- });
550
- result.taxonomies.terms++;
551
- }
552
- if (term.id) termSeedIdMap.set(term.id, existingId);
553
- progress.done++;
554
- } else {
555
- if (!mayCreateItem()) {
556
- complete = false;
557
- break;
558
- }
559
- const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
560
- const created = await termRepo.create({
561
- name: taxonomy.name,
562
- slug: term.slug,
563
- label: term.label,
564
- data: term.description ? { description: term.description } : void 0,
565
- locale: termLocale,
566
- translationOf
567
- });
568
- existingTerms.set(termKey, created.id);
569
- if (term.id) termSeedIdMap.set(term.id, created.id);
570
- result.taxonomies.terms++;
571
- progress.done++;
572
- }
573
- }
574
- }
575
- if (!complete) break;
576
- }
577
- const { invalidateTaxonomyDefsCache } = await import("./taxonomies-DK_XBrmT.mjs").then((n) => n.f);
578
- invalidateTaxonomyDefsCache();
579
- }
580
- if (complete && includeContent && seed.bylines) {
581
- const bylineRepo = new BylineRepository(db);
582
- const existingBylines = await findExistingSeedBylines(db, seed.bylines.map((byline) => byline.slug));
583
- for (const byline of seed.bylines) {
584
- const existingId = existingBylines.get(byline.slug);
585
- if (existingId) {
586
- if (onConflict === "error") throw new Error(`Conflict: byline "${byline.slug}" already exists`);
587
- if (onConflict === "update") {
588
- const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
589
- try {
590
- if (!await bylineRepo.update(existingId, {
591
- displayName: byline.displayName,
592
- bio: byline.bio ?? null,
593
- websiteUrl: byline.websiteUrl ?? null,
594
- isGuest: byline.isGuest,
595
- ...avatar ? { avatarMediaId: avatar.id } : {}
596
- })) throw new Error(`Byline "${byline.slug}" disappeared during update`);
597
- } catch (error) {
598
- if (avatar?.created) await deleteMediaRow(db, avatar.id);
599
- throw error;
600
- }
601
- seedBylineIdMap.set(byline.id, existingId);
602
- result.bylines.updated++;
603
- if (avatar?.created) result.media.created++;
604
- progress.done++;
605
- continue;
606
- }
607
- seedBylineIdMap.set(byline.id, existingId);
608
- result.bylines.skipped++;
609
- progress.done++;
610
- continue;
611
- }
612
- if (!mayCreateItem()) {
613
- complete = false;
614
- break;
615
- }
616
- const avatar = byline.avatar ? await resolveSeedBylineAvatar(db, byline.avatar) : null;
617
- let createdId;
618
- try {
619
- createdId = (await bylineRepo.create({
620
- slug: byline.slug,
621
- displayName: byline.displayName,
622
- bio: byline.bio ?? null,
623
- websiteUrl: byline.websiteUrl ?? null,
624
- isGuest: byline.isGuest,
625
- avatarMediaId: avatar?.id ?? null
626
- })).id;
627
- } catch (error) {
628
- if (avatar?.created) await deleteMediaRow(db, avatar.id);
629
- throw error;
630
- }
631
- existingBylines.set(byline.slug, createdId);
632
- seedBylineIdMap.set(byline.id, createdId);
633
- result.bylines.created++;
634
- if (avatar?.created) result.media.created++;
635
- progress.done++;
636
- }
637
- }
638
- if (complete && includeContent && seed.content) {
639
- const contentRepo = new ContentRepository(db);
640
- const schemaRegistry = new SchemaRegistry(db);
641
- const datetimeContexts = /* @__PURE__ */ new Map();
642
- try {
643
- for (const [collectionSlug, entries] of Object.entries(seed.content)) {
644
- const collectionInfo = await schemaRegistry.getCollectionWithFields(collectionSlug);
645
- const collectionRoutable = collectionInfo?.routable !== false;
646
- const referenceFields = referenceFieldsOf(collectionInfo);
647
- const resolvedBlockTypes = collectionInfo?.fields.some((field) => field.type === "blocks") ? await resolveBlockTypes(db) : void 0;
648
- const existingEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries, defaultLocale);
649
- const trashedEntries = await findExistingSeedEntries(contentRepo, collectionSlug, entries.filter((entry) => {
650
- const { slug, locale } = seedEntryIdentity(entry, defaultLocale);
651
- return !existingEntries.has(seedEntryKey(entry, slug, locale));
652
- }), defaultLocale, true);
653
- for (const entry of entries) {
654
- const { slug: entrySlug, locale: entryLocale } = seedEntryIdentity(entry, defaultLocale);
655
- const entryKey = seedEntryKey(entry, entrySlug, entryLocale);
656
- const existing = existingEntries.get(entryKey);
657
- if (!existing) {
658
- if (trashedEntries.get(entryKey)) {
659
- if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists (in trash)`);
660
- console.warn(`content.${collectionSlug}: "${entrySlug ?? entry.id}" (${entryLocale}) exists in the trash — skipping`);
661
- result.content.skipped++;
662
- progress.done++;
663
- continue;
664
- }
665
- }
666
- if (existing) {
667
- if (onConflict === "error") throw new Error(`Conflict: content "${entrySlug ?? entry.id}" in "${collectionSlug}" already exists`);
668
- if (onConflict === "update") {
669
- let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
670
- if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, existing.data, { restoreBlocks: true }, false, resolvedBlockTypes);
671
- const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
672
- const status = entry.status || "published";
673
- let contentMutated = false;
674
- try {
675
- await withTransaction(db, async (trx) => {
676
- const trxContentRepo = new ContentRepository(trx, datetimeContexts);
677
- const trxBylineRepo = new BylineRepository(trx);
678
- const trxRevisionRepo = new RevisionRepository(trx, datetimeContexts);
679
- await trxContentRepo.update(collectionSlug, existing.id, {
680
- status,
681
- data: columnData
682
- });
683
- contentMutated = true;
684
- await applyContentBylines(trxBylineRepo, collectionSlug, existing.id, entry, seedBylineIdMap, true);
685
- await applyContentTaxonomies(trx, collectionSlug, existing.id, entry, true);
686
- await applyContentReferences(trx, collectionSlug, existing.id, edges);
687
- if (status === "published") {
688
- const draft = await trxRevisionRepo.create({
689
- collection: collectionSlug,
690
- entryId: existing.id,
691
- data: columnData
692
- });
693
- try {
694
- await trxContentRepo.setDraftRevision(collectionSlug, existing.id, draft.id);
695
- await trxContentRepo.publish(collectionSlug, existing.id, void 0, false, void 0, true, collectionRoutable);
696
- } catch (error) {
697
- try {
698
- await trxRevisionRepo.deleteIfUnreferenced(collectionSlug, existing.id, draft.id);
699
- } catch (cleanupError) {
700
- console.error(`[seed] Failed to clean up unstaged revision ${draft.id}:`, cleanupError);
701
- }
702
- throw error;
703
- }
704
- }
705
- });
706
- } catch (error) {
707
- if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
708
- throw error;
709
- }
710
- seedIdMap.set(entry.id, existing.id);
711
- result.content.updated++;
712
- progress.done++;
713
- await markSeedContentCollectionStale(collectionSlug);
714
- continue;
715
- }
716
- result.content.skipped++;
717
- seedIdMap.set(entry.id, existing.id);
718
- progress.done++;
719
- continue;
720
- }
721
- if (!mayCreateItem()) {
722
- complete = false;
723
- break;
724
- }
725
- let resolvedData = await resolveReferences(entry.data, seedIdMap, mediaContext, result);
726
- if (collectionInfo) resolvedData = await normalizeBlocksData(db, collectionInfo, resolvedData, {}, { restoreBlocks: true }, false, resolvedBlockTypes);
727
- const { columnData, edges } = splitReferenceFields(collectionSlug, referenceFields, resolvedData);
728
- let translationOf;
729
- if (entry.translationOf) {
730
- const sourceId = seedIdMap.get(entry.translationOf);
731
- if (!sourceId) console.warn(`content.${collectionSlug}: translationOf "${entry.translationOf}" not found (not yet created or missing). Skipping translation link.`);
732
- else translationOf = sourceId;
733
- }
734
- const status = entry.status || "published";
735
- let contentMutated = false;
736
- let created;
737
- try {
738
- created = await withTransaction(db, async (trx) => {
739
- const trxContentRepo = new ContentRepository(trx, datetimeContexts);
740
- const trxBylineRepo = new BylineRepository(trx);
741
- const item = await trxContentRepo.create({
742
- ...entrySlug ? {} : { id: entry.id },
743
- type: collectionSlug,
744
- slug: entrySlug,
745
- status,
746
- data: columnData,
747
- locale: entryLocale,
748
- translationOf,
749
- publishedAt: status === "published" ? (/* @__PURE__ */ new Date()).toISOString() : null
750
- });
751
- contentMutated = true;
752
- await applyContentBylines(trxBylineRepo, collectionSlug, item.id, entry, seedBylineIdMap);
753
- await applyContentTaxonomies(trx, collectionSlug, item.id, entry, false);
754
- await applyContentReferences(trx, collectionSlug, item.id, edges);
755
- if (status === "published") await trxContentRepo.publish(collectionSlug, item.id, void 0, false, void 0, true, collectionRoutable);
756
- return item;
757
- });
758
- } catch (error) {
759
- if (contentMutated) await markSeedContentCollectionStale(collectionSlug);
760
- throw error;
761
- }
762
- seedIdMap.set(entry.id, created.id);
763
- existingEntries.set(entryKey, created);
764
- result.content.created++;
765
- progress.done++;
766
- await markSeedContentCollectionStale(collectionSlug);
767
- }
768
- if (!complete) break;
769
- }
770
- } finally {
771
- await retryFailedSeedContentStaleMarks();
772
- }
773
- }
774
- if (complete && !mayCreateItem()) complete = false;
775
- if (!complete) {
776
- await invalidateSeedCaches();
777
- return {
778
- result,
779
- complete,
780
- progress
781
- };
782
- }
783
- if (seed.menus) {
784
- const menuSeedIdMap = /* @__PURE__ */ new Map();
785
- const itemSeedIdMap = /* @__PURE__ */ new Map();
786
- for (const menu of seed.menus) {
787
- const locale = resolveConfiguredLocale(menu.locale ?? defaultLocale);
788
- const existingMenu = await db.selectFrom("_emdash_menus").selectAll().where("name", "=", menu.name).where("locale", "=", locale).executeTakeFirst();
789
- let menuId;
790
- let translationGroup;
791
- if (existingMenu) {
792
- menuId = existingMenu.id;
793
- translationGroup = existingMenu.translation_group ?? existingMenu.id;
794
- await db.deleteFrom("_emdash_menu_items").where("menu_id", "=", menuId).execute();
795
- } else {
796
- menuId = ulid();
797
- translationGroup = menuId;
798
- if (menu.translationOf) {
799
- const source = menuSeedIdMap.get(menu.translationOf);
800
- if (source) translationGroup = source.translationGroup;
801
- else console.warn(`menu "${menu.name}" (${locale}): translationOf "${menu.translationOf}" not found yet; minting a fresh group.`);
802
- }
803
- await db.insertInto("_emdash_menus").values({
804
- id: menuId,
805
- name: menu.name,
806
- label: menu.label,
807
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
808
- updated_at: (/* @__PURE__ */ new Date()).toISOString(),
809
- locale,
810
- translation_group: translationGroup
811
- }).execute();
812
- result.menus.created++;
813
- }
814
- if (menu.id) menuSeedIdMap.set(menu.id, {
815
- id: menuId,
816
- translationGroup
817
- });
818
- const itemCount = await applyMenuItems(db, menuId, locale, menu.items, null, 0, seedIdMap, itemSeedIdMap);
819
- result.menus.items += itemCount;
820
- }
821
- }
822
- if (seed.redirects) {
823
- const redirectRepo = new RedirectRepository(db);
824
- for (const redirect of seed.redirects) {
825
- const existing = await redirectRepo.findBySource(redirect.source);
826
- if (existing) {
827
- if (onConflict === "error") throw new Error(`Conflict: redirect "${redirect.source}" already exists`);
828
- if (onConflict === "update") {
829
- await redirectRepo.update(existing.id, {
830
- destination: redirect.destination,
831
- type: redirect.type,
832
- enabled: redirect.enabled,
833
- groupName: redirect.groupName
834
- });
835
- result.redirects.updated++;
836
- continue;
837
- }
838
- result.redirects.skipped++;
839
- continue;
840
- }
841
- await redirectRepo.create({
842
- source: redirect.source,
843
- destination: redirect.destination,
844
- type: redirect.type,
845
- enabled: redirect.enabled,
846
- groupName: redirect.groupName
847
- });
848
- result.redirects.created++;
849
- }
850
- }
851
- if (seed.widgetAreas) for (const area of seed.widgetAreas) {
852
- const existingArea = await db.selectFrom("_emdash_widget_areas").selectAll().where("name", "=", area.name).executeTakeFirst();
853
- let areaId;
854
- if (existingArea) {
855
- areaId = existingArea.id;
856
- await db.deleteFrom("_emdash_widgets").where("area_id", "=", areaId).execute();
857
- } else {
858
- areaId = ulid();
859
- await db.insertInto("_emdash_widget_areas").values({
860
- id: areaId,
861
- name: area.name,
862
- label: area.label,
863
- description: area.description ?? null
864
- }).execute();
865
- result.widgetAreas.created++;
866
- }
867
- for (let i = 0; i < area.widgets.length; i++) {
868
- const widget = area.widgets[i];
869
- await applyWidget(db, areaId, widget, i);
870
- result.widgetAreas.widgets++;
871
- }
872
- }
873
- if (seed.sections) for (const section of seed.sections) {
874
- const existing = await db.selectFrom("_emdash_sections").select("id").where("slug", "=", section.slug).executeTakeFirst();
875
- if (existing) {
876
- if (onConflict === "error") throw new Error(`Conflict: section "${section.slug}" already exists`);
877
- if (onConflict === "update") {
878
- await db.updateTable("_emdash_sections").set({
879
- title: section.title,
880
- description: section.description ?? null,
881
- keywords: section.keywords ? JSON.stringify(section.keywords) : null,
882
- content: JSON.stringify(section.content),
883
- source: section.source || "theme",
884
- updated_at: (/* @__PURE__ */ new Date()).toISOString()
885
- }).where("id", "=", existing.id).execute();
886
- result.sections.updated++;
887
- continue;
888
- }
889
- result.sections.skipped++;
890
- continue;
891
- }
892
- const id = ulid();
893
- const now = (/* @__PURE__ */ new Date()).toISOString();
894
- await db.insertInto("_emdash_sections").values({
895
- id,
896
- slug: section.slug,
897
- title: section.title,
898
- description: section.description ?? null,
899
- keywords: section.keywords ? JSON.stringify(section.keywords) : null,
900
- content: JSON.stringify(section.content),
901
- preview_media_id: null,
902
- source: section.source || "theme",
903
- theme_id: section.source === "theme" ? section.slug : null,
904
- created_at: now,
905
- updated_at: now
906
- }).execute();
907
- result.sections.created++;
908
- }
909
- if (seed.collections) {
910
- const ftsManager = new FTSManager(db);
911
- for (const collection of seed.collections) if (collection.supports?.includes("search")) {
912
- if ((await ftsManager.getSearchableFields(collection.slug)).length > 0) try {
913
- await ftsManager.enableSearch(collection.slug);
914
- } catch (err) {
915
- console.warn(`Failed to enable search for ${collection.slug}:`, err);
916
- }
917
- }
918
- }
919
- await invalidateSeedCaches();
920
- return {
921
- result,
922
- complete,
923
- progress
924
- };
925
- }
926
- function countSeedItems(seed, includeContent) {
927
- if (!includeContent) return 0;
928
- const terms = (seed.taxonomies ?? []).reduce((total, taxonomy) => total + (taxonomy.terms?.length ?? 0), 0);
929
- const entries = Object.values(seed.content ?? {}).reduce((total, collectionEntries) => total + collectionEntries.length, 0);
930
- return terms + (seed.bylines?.length ?? 0) + entries;
931
- }
932
- function seedTermKey(locale, slug) {
933
- return `${locale}::${slug}`;
934
- }
935
- /**
936
- * Find which of a taxonomy's seed terms already exist, as term ids keyed by
937
- * `seedTermKey`. Each query covers a batch of slugs.
938
- */
939
- async function findExistingSeedTerms(db, taxonomyName, terms) {
940
- const existing = /* @__PURE__ */ new Map();
941
- for (const batch of chunks([...new Set(terms.map((term) => term.slug))], SQL_BATCH_SIZE)) {
942
- const rows = await db.selectFrom("taxonomies").select([
943
- "id",
944
- "slug",
945
- "locale"
946
- ]).where("name", "=", taxonomyName).where("slug", "in", batch).execute();
947
- for (const row of rows) existing.set(seedTermKey(row.locale, row.slug), row.id);
948
- }
949
- return existing;
950
- }
951
- /**
952
- * Find which seed bylines already exist, as byline ids keyed by slug. A slug
953
- * in several locales resolves to the lowest locale code, as
954
- * `BylineRepository.findBySlug` does. Each query covers a batch of slugs.
955
- */
956
- async function findExistingSeedBylines(db, slugs) {
957
- const existing = /* @__PURE__ */ new Map();
958
- for (const batch of chunks([...new Set(slugs)], SQL_BATCH_SIZE)) {
959
- const rows = await db.selectFrom("_emdash_bylines").select(["id", "slug"]).where("slug", "in", batch).orderBy("locale", "asc").execute();
960
- for (const row of rows) if (!existing.has(row.slug)) existing.set(row.slug, row.id);
961
- }
962
- return existing;
963
- }
964
- /**
965
- * Invalidate caches that may have been affected by seed data.
966
- * Seed creates bylines, redirects, and collections, all of which
967
- * have module-level caches in the hot path.
968
- */
969
- async function invalidateSeedCaches() {
970
- const { invalidateBylineCache } = await import("./bylines-gyWBWUUc.mjs").then((n) => n.t);
971
- const { invalidateRedirectCache } = await import("./cache-CPanL9IO.mjs").then((n) => n.t);
972
- const { invalidateUrlPatternCache } = await import("./query-DyYYWOKk.mjs").then((n) => n.s);
973
- invalidateBylineCache();
974
- invalidateRedirectCache();
975
- invalidateUrlPatternCache();
976
- }
977
- function seedEntryIdentity(entry, defaultLocale) {
978
- return {
979
- slug: typeof entry.slug === "string" && entry.slug.trim().length > 0 ? entry.slug : null,
980
- locale: resolveConfiguredLocale(entry.locale ?? defaultLocale)
981
- };
982
- }
983
- async function readRelationEnds(db) {
984
- const rows = await db.selectFrom("_emdash_relations").select([
985
- "slug",
986
- "parent_collection",
987
- "child_collection"
988
- ]).execute();
989
- return new Map(rows.map((row) => [row.slug, {
990
- parentCollection: row.parent_collection,
991
- childCollection: row.child_collection
992
- }]));
993
- }
994
- /**
995
- * Resolve the relation a seed reference field names, and which end of it this
996
- * collection sits on.
997
- *
998
- * `relationSide` is only needed for a self-referential relation, where both ends
999
- * are this collection; otherwise the side follows from which end matches.
1000
- * `targetCollection` is the collection at the other end, derived rather than
1001
- * trusted, so a seed cannot declare a target the relation disagrees with.
1002
- */
1003
- function resolveSeedFieldRelation(collectionSlug, field, knownRelations) {
1004
- if (field.type !== "reference") return null;
1005
- const named = field.validation?.relation;
1006
- if (typeof named !== "string" || named.length === 0) return null;
1007
- const relation = knownRelations.get(named);
1008
- if (!relation) throw new SchemaError(`Relation "${named}" not found`, "RELATION_NOT_FOUND");
1009
- const declared = field.validation?.relationSide;
1010
- const side = declared === "parent" || declared === "child" ? declared : relation.parentCollection === collectionSlug ? "parent" : "child";
1011
- if ((side === "parent" ? relation.parentCollection : relation.childCollection) !== collectionSlug) throw new SchemaError(`Relation "${named}" has no ${side} end on collection "${collectionSlug}"`, "VALIDATION_ERROR");
1012
- return {
1013
- relation: named,
1014
- relationSide: side,
1015
- targetCollection: side === "parent" ? relation.childCollection : relation.parentCollection
1016
- };
1017
- }
1018
- /**
1019
- * Create or update the relations a seed declares, before the fields that name
1020
- * them.
1021
- *
1022
- * A relation's two collections are fixed once it exists: changing one would
1023
- * leave its links pointing into a collection that is no longer an end of it, so
1024
- * a seed that names different ones fails rather than rewriting the row. Labels
1025
- * and limits are updated under `onConflict: "update"`.
1026
- */
1027
- async function applySeedRelations(db, relations, seedCollections, onConflict, result) {
1028
- const existing = await readRelationEnds(db);
1029
- const known = new Set(seedCollections.map((collection) => collection.slug));
1030
- for (const row of await db.selectFrom("_emdash_collections").select("slug").execute()) known.add(row.slug);
1031
- const now = (/* @__PURE__ */ new Date()).toISOString();
1032
- for (const relation of relations) {
1033
- for (const end of [relation.parentCollection, relation.childCollection]) if (!known.has(end)) throw new SchemaError(`Relation "${relation.slug}" names collection "${end}", which does not exist`, "COLLECTION_NOT_FOUND");
1034
- const current = existing.get(relation.slug);
1035
- if (current) {
1036
- if (current.parentCollection !== relation.parentCollection || current.childCollection !== relation.childCollection) throw new SchemaError(`Relation "${relation.slug}" joins ${current.parentCollection} to ${current.childCollection}; a relation's collections cannot change`, "RELATION_COLLECTIONS_IMMUTABLE");
1037
- if (onConflict === "error") throw new Error(`Conflict: relation "${relation.slug}" already exists`);
1038
- if (onConflict !== "update") {
1039
- result.relations.skipped++;
1040
- continue;
1041
- }
1042
- await db.updateTable("_emdash_relations").set({
1043
- parent_label: relation.parentLabel,
1044
- parent_label_singular: relation.parentLabelSingular ?? null,
1045
- child_label: relation.childLabel,
1046
- child_label_singular: relation.childLabelSingular ?? null,
1047
- max_children_per_parent: relation.maxChildrenPerParent ?? null,
1048
- max_parents_per_child: relation.maxParentsPerChild ?? null,
1049
- updated_at: now
1050
- }).where("slug", "=", relation.slug).execute();
1051
- result.relations.updated++;
1052
- continue;
1053
- }
1054
- await db.insertInto("_emdash_relations").values({
1055
- id: ulid(),
1056
- slug: relation.slug,
1057
- parent_collection: relation.parentCollection,
1058
- child_collection: relation.childCollection,
1059
- parent_label: relation.parentLabel,
1060
- parent_label_singular: relation.parentLabelSingular ?? null,
1061
- child_label: relation.childLabel,
1062
- child_label_singular: relation.childLabelSingular ?? null,
1063
- max_children_per_parent: relation.maxChildrenPerParent ?? null,
1064
- max_parents_per_child: relation.maxParentsPerChild ?? null,
1065
- created_at: now,
1066
- updated_at: now
1067
- }).execute();
1068
- existing.set(relation.slug, {
1069
- parentCollection: relation.parentCollection,
1070
- childCollection: relation.childCollection
1071
- });
1072
- result.relations.created++;
1073
- }
1074
- }
1075
- function allocateSeedRelationName(collectionSlug, fieldSlug, usedNames) {
1076
- const baseName = `${collectionSlug}_${fieldSlug}`.slice(0, 63);
1077
- for (let attempt = 0; attempt < SEED_RELATION_NAME_MAX_ATTEMPTS; attempt++) {
1078
- const suffix = attempt === 0 ? "" : `_${attempt + 1}`;
1079
- const name = attempt === 0 ? baseName : `${baseName.slice(0, 63 - suffix.length)}${suffix}`;
1080
- if (!usedNames.has(name)) {
1081
- usedNames.add(name);
1082
- return name;
1083
- }
1084
- }
1085
- throw new SchemaError("Could not allocate a unique relation name", "RELATION_NAME_CONFLICT");
1086
- }
1087
- /**
1088
- * Slugful entries use the existing locale-aware key. Slugless seed entries
1089
- * persist their seed ID, which keeps re-application idempotent.
1090
- */
1091
- function seedEntryKey(entry, slug, locale) {
1092
- return slug === null ? `id:${entry.id}` : `slug:${locale}:${slug}`;
1093
- }
1094
- /**
1095
- * Find which of a collection's seed entries already exist, keyed by
1096
- * `seedEntryKey`. Each query covers a batch of entries.
1097
- */
1098
- async function findExistingSeedEntries(repo, collectionSlug, entries, defaultLocale, includeTrashed = false) {
1099
- const identities = entries.map((entry) => ({
1100
- entry,
1101
- ...seedEntryIdentity(entry, defaultLocale)
1102
- }));
1103
- const slugsByLocale = /* @__PURE__ */ new Map();
1104
- for (const { slug, locale } of identities) {
1105
- if (slug === null) continue;
1106
- const slugs = slugsByLocale.get(locale);
1107
- if (slugs) slugs.push(slug);
1108
- else slugsByLocale.set(locale, [slug]);
1109
- }
1110
- const bySlug = /* @__PURE__ */ new Map();
1111
- for (const [locale, slugs] of slugsByLocale) bySlug.set(locale, await repo.findManyBySlugsInLocale(collectionSlug, slugs, locale, { includeTrashed }));
1112
- const byId = await repo.findManyByIds(collectionSlug, identities.filter(({ slug }) => slug === null).map(({ entry }) => entry.id), { includeTrashed });
1113
- const existing = /* @__PURE__ */ new Map();
1114
- for (const { entry, slug, locale } of identities) {
1115
- const item = slug === null ? byId.get(entry.id) : bySlug.get(locale)?.get(slug);
1116
- if (item) existing.set(seedEntryKey(entry, slug, locale), item);
1117
- }
1118
- return existing;
1119
- }
1120
- /**
1121
- * Apply hierarchical taxonomy terms (parents before children). Stops before
1122
- * creating a term once `mayCreate` returns false, and returns how many terms
1123
- * were found or created.
1124
- */
1125
- async function applyHierarchicalTerms(termRepo, taxonomyName, defLocale, terms, existingTerms, termSeedIdMap, result, onConflict, mayCreate) {
1126
- let processed = 0;
1127
- const slugToId = /* @__PURE__ */ new Map();
1128
- const resolveTermLocale = (term) => resolveConfiguredLocale(term.locale ?? defLocale);
1129
- let remaining = [...terms];
1130
- let maxPasses = 10;
1131
- while (remaining.length > 0 && maxPasses > 0) {
1132
- const processedThisPass = [];
1133
- for (const term of remaining) {
1134
- const termLocale = resolveTermLocale(term);
1135
- const parentReady = !term.parent || slugToId.has(`${termLocale}::${term.parent}`);
1136
- const translationReady = !term.translationOf || termSeedIdMap.has(term.translationOf);
1137
- if (!parentReady || !translationReady) continue;
1138
- const parentId = term.parent ? slugToId.get(`${termLocale}::${term.parent}`) : void 0;
1139
- const translationOf = term.translationOf ? termSeedIdMap.get(term.translationOf) : void 0;
1140
- const termKey = seedTermKey(termLocale, term.slug);
1141
- const existingId = existingTerms.get(termKey);
1142
- if (existingId) {
1143
- if (onConflict === "error") throw new Error(`Conflict: taxonomy term "${term.slug}" in "${taxonomyName}" (${termLocale}) already exists`);
1144
- if (onConflict === "update") {
1145
- await termRepo.update(existingId, {
1146
- label: term.label,
1147
- parentId,
1148
- data: term.description ? { description: term.description } : {}
1149
- });
1150
- result.taxonomies.terms++;
1151
- }
1152
- slugToId.set(termKey, existingId);
1153
- if (term.id) termSeedIdMap.set(term.id, existingId);
1154
- } else {
1155
- if (!mayCreate()) return {
1156
- processed,
1157
- complete: false
1158
- };
1159
- const created = await termRepo.create({
1160
- name: taxonomyName,
1161
- slug: term.slug,
1162
- label: term.label,
1163
- parentId,
1164
- data: term.description ? { description: term.description } : void 0,
1165
- locale: termLocale,
1166
- translationOf
1167
- });
1168
- existingTerms.set(termKey, created.id);
1169
- slugToId.set(termKey, created.id);
1170
- if (term.id) termSeedIdMap.set(term.id, created.id);
1171
- result.taxonomies.terms++;
1172
- }
1173
- processed++;
1174
- processedThisPass.push(term.slug + "::" + termLocale);
1175
- }
1176
- remaining = remaining.filter((term) => !processedThisPass.includes(term.slug + "::" + resolveTermLocale(term)));
1177
- maxPasses--;
1178
- }
1179
- if (remaining.length > 0) console.warn(`Could not process ${remaining.length} terms due to missing parents/translations`);
1180
- return {
1181
- processed,
1182
- complete: true
1183
- };
1184
- }
1185
- /**
1186
- * Apply byline credits to a content entry.
1187
- * In update mode, clears existing credits even if the seed has none.
1188
- */
1189
- async function applyContentBylines(bylineRepo, collectionSlug, contentId, entry, seedBylineIdMap, isUpdate = false) {
1190
- if (!entry.bylines || entry.bylines.length === 0) {
1191
- if (isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, []);
1192
- return;
1193
- }
1194
- const credits = entry.bylines.map((credit) => {
1195
- const bylineId = seedBylineIdMap.get(credit.byline);
1196
- if (!bylineId) return null;
1197
- return {
1198
- bylineId,
1199
- roleLabel: credit.roleLabel ?? null
1200
- };
1201
- }).filter((credit) => Boolean(credit));
1202
- if (credits.length !== entry.bylines.length) console.warn(`content.${collectionSlug}.${entry.slug ?? entry.id}: one or more byline refs could not be resolved`);
1203
- if (credits.length > 0 || isUpdate) await bylineRepo.setContentBylines(collectionSlug, contentId, credits);
1204
- }
1205
- /**
1206
- * Apply taxonomy term assignments to a content entry.
1207
- * In update mode, clears existing assignments before re-attaching.
1208
- */
1209
- /**
1210
- * Create or update a field from a seed.
1211
- *
1212
- * A reference field bound to a relation is storage-less: it persists no column
1213
- * and its edges live in `_emdash_content_references`. Seeds create fields
1214
- * through the registry (not the schema handler that owns the relation
1215
- * lifecycle), so this mirrors the handler — it creates the relation on first
1216
- * insert (field + relation in one transaction) and preserves the
1217
- * server-assigned `validation.relation`/`targetCollection` on re-apply, since a
1218
- * seed's field validation omits them and would otherwise orphan the relation. A
1219
- * reference field with no `targetCollection` cannot form a relation, so it is
1220
- * created column-backed, holding a plain entry id.
1221
- */
1222
- async function upsertSeedField(db, collectionSlug, field, existing, knownRelations) {
1223
- const bound = resolveSeedFieldRelation(collectionSlug, field, knownRelations);
1224
- if (existing) {
1225
- const update = {
1226
- label: field.label,
1227
- type: field.type,
1228
- required: field.required || false,
1229
- unique: field.unique || false,
1230
- searchable: field.searchable || false,
1231
- indexed: field.indexed || false,
1232
- translatable: field.translatable,
1233
- defaultValue: field.defaultValue,
1234
- widget: field.widget,
1235
- options: field.options
1236
- };
1237
- if (!bound && field.type === "reference" && !existing.validation?.relation && typeof field.validation?.targetCollection === "string") {
1238
- await bindReferenceField(db, collectionSlug, existing, {
1239
- ...update,
1240
- validation: field.validation
1241
- }, field.validation.targetCollection);
1242
- return;
1243
- }
1244
- const validation = bound ? {
1245
- ...field.validation,
1246
- ...bound
1247
- } : field.type === "reference" && existing.validation?.relation ? {
1248
- ...field.validation,
1249
- relation: existing.validation.relation,
1250
- relationSide: existing.validation.relationSide,
1251
- targetCollection: existing.validation.targetCollection
1252
- } : field.validation;
1253
- await new SchemaRegistry(db).updateField(collectionSlug, field.slug, {
1254
- ...update,
1255
- validation
1256
- });
1257
- return;
1258
- }
1259
- const input = {
1260
- slug: field.slug,
1261
- label: field.label,
1262
- type: field.type,
1263
- required: field.required || false,
1264
- unique: field.unique || false,
1265
- searchable: field.searchable || false,
1266
- indexed: field.indexed || false,
1267
- translatable: field.translatable,
1268
- defaultValue: field.defaultValue,
1269
- validation: field.validation,
1270
- widget: field.widget,
1271
- options: field.options
1272
- };
1273
- if (bound) {
1274
- await new SchemaRegistry(db).createField(collectionSlug, {
1275
- ...input,
1276
- validation: {
1277
- ...field.validation,
1278
- ...bound
1279
- }
1280
- });
1281
- return;
1282
- }
1283
- const targetCollection = field.type === "reference" && typeof field.validation?.targetCollection === "string" ? field.validation.targetCollection : void 0;
1284
- if (targetCollection) {
1285
- await withTransaction(db, async (trx) => {
1286
- const relation = await createFieldRelation(trx, collectionSlug, field.slug, field.label, targetCollection, field.validation?.multiple ? null : 1);
1287
- await new SchemaRegistry(trx).createField(collectionSlug, {
1288
- ...input,
1289
- validation: {
1290
- ...field.validation,
1291
- relation: relation.slug,
1292
- relationSide: "parent"
1293
- }
1294
- });
1295
- });
1296
- return;
1297
- }
1298
- await new SchemaRegistry(db).createField(collectionSlug, input);
1299
- }
1300
- /**
1301
- * Split resolved content `data` into the plain column data and the reference
1302
- * edge writes. A reference field bound to a relation is storage-less, so its key
1303
- * left in `data` would hit the column writer (and `syncDataColumns` on publish)
1304
- * and throw "no such column". Its `$ref:`-resolved value — a child entry id or
1305
- * an array of them — is captured as an edge write instead, keyed by the field's
1306
- * relation. A reference field with no relation still owns its column, so its
1307
- * resolved id is written there like any other string.
1308
- */
1309
- /** One collection's reference fields by slug, read once per collection: the
1310
- * schema phase has finished by the time content is applied. */
1311
- function referenceFieldsOf(collection) {
1312
- return new Map((collection?.fields ?? []).filter((f) => f.type === "reference").map((f) => [f.slug, f]));
1313
- }
1314
- function splitReferenceFields(collectionSlug, referenceFields, data) {
1315
- if (referenceFields.size === 0) return {
1316
- columnData: data,
1317
- edges: []
1318
- };
1319
- const columnData = {};
1320
- const edges = [];
1321
- for (const [key, value] of Object.entries(data)) {
1322
- if (!referenceFields.get(key)?.validation?.relation) {
1323
- columnData[key] = value;
1324
- continue;
1325
- }
1326
- const childIds = [];
1327
- for (const candidate of Array.isArray(value) ? value : [value]) {
1328
- if (typeof candidate !== "string" || candidate.length === 0) continue;
1329
- if (candidate.startsWith("$ref:")) {
1330
- console.warn(`content.${collectionSlug}: reference "${candidate}" in field "${key}" did not resolve (not yet created or missing). Skipping.`);
1331
- continue;
1332
- }
1333
- childIds.push(candidate);
1334
- }
1335
- edges.push({
1336
- fieldSlug: key,
1337
- childIds
1338
- });
1339
- }
1340
- return {
1341
- columnData,
1342
- edges
1343
- };
1344
- }
1345
- /**
1346
- * Write reference edges for a content entry, replacing any existing set per
1347
- * relation (so re-applying a seed is idempotent). Throws to abort the enclosing
1348
- * transaction if a child entry cannot be resolved — a half-written entry is
1349
- * worse than a failed apply.
1350
- */
1351
- async function applyContentReferences(trx, collectionSlug, contentId, edges) {
1352
- for (const { fieldSlug, childIds } of edges) {
1353
- const result = await setReferenceSelection(trx, collectionSlug, contentId, fieldSlug, childIds);
1354
- if (!result.success) throw new Error(`content.${collectionSlug}: failed to write references for "${contentId}": ${result.error.message}`);
1355
- }
1356
- }
1357
- async function applyContentTaxonomies(db, collectionSlug, contentId, entry, isUpdate) {
1358
- const termRepo = new TaxonomyRepository(db);
1359
- if (isUpdate) await termRepo.clearEntryTerms(collectionSlug, contentId);
1360
- if (!entry.taxonomies) {
1361
- if (isUpdate) {
1362
- const { invalidateTermCache } = await import("./taxonomies-DK_XBrmT.mjs").then((n) => n.f);
1363
- invalidateTermCache();
1364
- }
1365
- return;
1366
- }
1367
- for (const [taxonomyName, termSlugs] of Object.entries(entry.taxonomies)) for (const termSlug of termSlugs) {
1368
- const term = await termRepo.findBySlug(taxonomyName, termSlug);
1369
- if (term) await termRepo.attachToEntry(collectionSlug, contentId, term.id);
1370
- }
1371
- const { invalidateTermCache } = await import("./taxonomies-DK_XBrmT.mjs").then((n) => n.f);
1372
- invalidateTermCache();
1373
- }
1374
- /**
1375
- * Apply menu items recursively.
1376
- *
1377
- * When a `SeedMenuItem` carries `id`/`translationOf`, the import resolves the
1378
- * source item's `translation_group` so cross-locale "same nav entry" links
1379
- * survive export → apply. Items without `translationOf` get a fresh group
1380
- * (= their own id).
1381
- */
1382
- async function applyMenuItems(db, menuId, locale, items, parentId, startOrder, seedIdMap, itemSeedIdMap) {
1383
- let count = 0;
1384
- let order = startOrder;
1385
- for (const item of items) {
1386
- const itemId = ulid();
1387
- const itemLocale = item.locale ?? locale;
1388
- let referenceId = null;
1389
- let referenceCollection = null;
1390
- if (item.type !== "custom" && item.type !== "taxonomy") {
1391
- const collection = item.collection || (item.type === "page" || item.type === "post" ? `${item.type}s` : null);
1392
- if (item.ref) {
1393
- const resolved = seedIdMap.get(item.ref);
1394
- if (resolved && collection) {
1395
- referenceId = resolved;
1396
- referenceCollection = collection;
1397
- }
1398
- } else referenceCollection = collection;
1399
- }
1400
- let translationGroup = itemId;
1401
- if (item.translationOf) {
1402
- const source = itemSeedIdMap.get(item.translationOf);
1403
- if (source) translationGroup = source.translationGroup;
1404
- else console.warn(`menu item "${item.label ?? item.url ?? item.ref ?? "(unlabeled)"}" (${itemLocale}): translationOf "${item.translationOf}" not found yet; minting a fresh group.`);
1405
- }
1406
- await db.insertInto("_emdash_menu_items").values({
1407
- id: itemId,
1408
- menu_id: menuId,
1409
- parent_id: parentId,
1410
- sort_order: order,
1411
- type: item.type,
1412
- reference_collection: referenceCollection,
1413
- reference_id: referenceId,
1414
- custom_url: item.url ?? null,
1415
- label: item.label || "",
1416
- title_attr: item.titleAttr ?? null,
1417
- target: item.target ?? null,
1418
- css_classes: item.cssClasses ?? null,
1419
- created_at: (/* @__PURE__ */ new Date()).toISOString(),
1420
- locale: itemLocale,
1421
- translation_group: translationGroup
1422
- }).execute();
1423
- if (item.id) itemSeedIdMap.set(item.id, {
1424
- id: itemId,
1425
- translationGroup
1426
- });
1427
- count++;
1428
- order++;
1429
- if (item.children && item.children.length > 0) {
1430
- const childCount = await applyMenuItems(db, menuId, itemLocale, item.children, itemId, 0, seedIdMap, itemSeedIdMap);
1431
- count += childCount;
1432
- }
1433
- }
1434
- return count;
1435
- }
1436
- /**
1437
- * Apply a widget
1438
- */
1439
- async function applyWidget(db, areaId, widget, sortOrder) {
1440
- await db.insertInto("_emdash_widgets").values({
1441
- id: ulid(),
1442
- area_id: areaId,
1443
- sort_order: sortOrder,
1444
- type: widget.type,
1445
- title: widget.title ?? null,
1446
- content: widget.content ? JSON.stringify(widget.content) : null,
1447
- menu_name: widget.menuName ?? null,
1448
- component_id: widget.componentId ?? null,
1449
- component_props: widget.props ? JSON.stringify(widget.props) : null
1450
- }).execute();
1451
- }
1452
- /**
1453
- * Type guard for $media reference
1454
- */
1455
- function isSeedMediaReference(value) {
1456
- if (typeof value !== "object" || value === null || !("$media" in value)) return false;
1457
- const media = value.$media;
1458
- return typeof media === "object" && media !== null && "url" in media && typeof media.url === "string";
1459
- }
1460
- /**
1461
- * Resolve $ref: and $media references in content data
1462
- */
1463
- async function resolveReferences(data, seedIdMap, mediaContext, result) {
1464
- const resolved = {};
1465
- for (const [key, value] of Object.entries(data)) resolved[key] = await resolveValue(value, seedIdMap, mediaContext, result);
1466
- return resolved;
1467
- }
1468
- /**
1469
- * Resolve a single value recursively
1470
- */
1471
- async function resolveValue(value, seedIdMap, mediaContext, result) {
1472
- if (typeof value === "string" && value.startsWith("$ref:")) {
1473
- const seedId = value.slice(5);
1474
- return seedIdMap.get(seedId) ?? value;
1475
- }
1476
- if (isSeedMediaReference(value)) return resolveMedia(value, mediaContext, result);
1477
- if (Array.isArray(value)) return Promise.all(value.map((item) => resolveValue(item, seedIdMap, mediaContext, result)));
1478
- if (typeof value === "object" && value !== null) {
1479
- const resolved = {};
1480
- for (const [k, v] of Object.entries(value)) resolved[k] = await resolveValue(v, seedIdMap, mediaContext, result);
1481
- if (resolved._type === "gallery" && Array.isArray(resolved.images)) resolved.images = sanitizeGalleryImages(resolved.images, ulid);
1482
- else if (resolved._type === "image" && "asset" in value && isSeedMediaReference(value.asset)) {
1483
- const [image] = sanitizeGalleryImages([resolved], ulid);
1484
- if (image) Object.assign(resolved, image);
1485
- }
1486
- return resolved;
1487
- }
1488
- return value;
1489
- }
1490
- /**
1491
- * Resolve a seeded byline avatar to a `media` row id. The file is assumed to
1492
- * already exist in storage (the caller supplies its `storageKey`), so nothing
1493
- * is downloaded or uploaded.
1494
- *
1495
- * Idempotent: if a media row with the same `storageKey` already exists it is
1496
- * reused rather than duplicated, so re-applying a seed in `update` mode does
1497
- * not leak rows. `created` reports whether a new row was inserted, so the
1498
- * caller can both account for it and delete it if the subsequent byline write
1499
- * fails (the only cross-dialect way to avoid an orphan — `withTransaction`
1500
- * is a no-op on D1).
1501
- */
1502
- async function resolveSeedBylineAvatar(db, avatar) {
1503
- const existing = await db.selectFrom("media").select("id").where("storage_key", "=", avatar.storageKey).orderBy("id", "asc").executeTakeFirst();
1504
- if (existing) return {
1505
- id: existing.id,
1506
- created: false
1507
- };
1508
- const basename = avatar.storageKey.split("/").pop();
1509
- const filename = avatar.filename ?? (basename && basename.length > 0 ? basename : avatar.storageKey);
1510
- return {
1511
- id: (await new MediaRepository(db).create({
1512
- filename,
1513
- mimeType: avatar.mimeType ?? "image/jpeg",
1514
- storageKey: avatar.storageKey,
1515
- alt: avatar.alt,
1516
- width: avatar.width,
1517
- height: avatar.height,
1518
- status: "ready"
1519
- })).id,
1520
- created: true
1521
- };
1522
- }
1523
- /**
1524
- * Delete a media row by id. Best-effort cleanup for a failed byline write: a
1525
- * failure here must not mask the original error that triggered the cleanup, so
1526
- * it is logged and swallowed rather than thrown.
1527
- */
1528
- async function deleteMediaRow(db, id) {
1529
- try {
1530
- await db.deleteFrom("media").where("id", "=", id).execute();
1531
- } catch (error) {
1532
- console.warn(`[seed] failed to clean up orphaned avatar media ${id}:`, error);
1533
- }
1534
- }
1535
- /**
1536
- * Resolve a $media reference by downloading and uploading the media
1537
- */
1538
- async function resolveMedia(ref, ctx, result) {
1539
- const { url, alt, filename, caption } = ref.$media;
1540
- const cached = ctx.mediaCache.get(url);
1541
- if (cached) {
1542
- result.media.skipped++;
1543
- return {
1544
- ...cached,
1545
- alt: alt ?? cached.alt
1546
- };
1547
- }
1548
- if (ctx.skipMediaDownload) {
1549
- const mediaValue = {
1550
- provider: "external",
1551
- id: ulid(),
1552
- src: url,
1553
- alt: alt ?? void 0,
1554
- filename: filename ?? void 0
1555
- };
1556
- ctx.mediaCache.set(url, mediaValue);
1557
- result.media.created++;
1558
- return mediaValue;
1559
- }
1560
- if (!ctx.storage) {
1561
- console.warn(`Skipping $media reference (no storage configured): ${url}`);
1562
- result.media.skipped++;
1563
- return null;
1564
- }
1565
- try {
1566
- validateExternalUrl(url);
1567
- console.log(` 📥 Downloading: ${url}`);
1568
- ctx.budget?.countMediaDownload();
1569
- const response = await ssrfSafeFetch(url, { headers: { "User-Agent": "EmDash-CMS/1.0" } });
1570
- if (!response.ok) {
1571
- console.warn(` ⚠️ Failed to download ${url}: ${response.status}`);
1572
- result.media.skipped++;
1573
- return null;
1574
- }
1575
- const contentType = response.headers.get("content-type") || "application/octet-stream";
1576
- const ext = getExtensionFromContentType(contentType) || getExtensionFromUrl(url) || ".bin";
1577
- const storageId = ulid();
1578
- const finalFilename = filename || generateFilename(url, ext);
1579
- const storageKey = `${storageId}${ext}`;
1580
- const arrayBuffer = await response.arrayBuffer();
1581
- const body = new Uint8Array(arrayBuffer);
1582
- let width;
1583
- let height;
1584
- if (contentType.startsWith("image/")) {
1585
- const dimensions = getImageDimensions(body);
1586
- width = dimensions?.width;
1587
- height = dimensions?.height;
1588
- }
1589
- await ctx.storage.upload({
1590
- key: storageKey,
1591
- body,
1592
- contentType
1593
- });
1594
- const mediaValue = {
1595
- provider: "local",
1596
- id: (await new MediaRepository(ctx.db).create({
1597
- filename: finalFilename,
1598
- mimeType: contentType,
1599
- size: body.length,
1600
- width,
1601
- height,
1602
- alt,
1603
- caption,
1604
- storageKey,
1605
- status: "ready"
1606
- })).id,
1607
- alt: alt ?? void 0,
1608
- width,
1609
- height,
1610
- mimeType: contentType,
1611
- filename: finalFilename,
1612
- meta: { storageKey }
1613
- };
1614
- ctx.mediaCache.set(url, mediaValue);
1615
- result.media.created++;
1616
- console.log(` ✅ Uploaded: ${finalFilename}`);
1617
- return mediaValue;
1618
- } catch (error) {
1619
- console.warn(` ⚠️ Error processing $media ${url}:`, error instanceof Error ? error.message : error);
1620
- result.media.skipped++;
1621
- return null;
1622
- }
1623
- }
1624
- /**
1625
- * Get file extension from content type
1626
- */
1627
- function getExtensionFromContentType(contentType) {
1628
- const baseMime = contentType.split(";")[0].trim();
1629
- const ext = mime.getExtension(baseMime);
1630
- return ext ? `.${ext}` : null;
1631
- }
1632
- /**
1633
- * Get file extension from URL
1634
- */
1635
- function getExtensionFromUrl(url) {
1636
- try {
1637
- const match = new URL(url).pathname.match(FILE_EXTENSION_PATTERN);
1638
- return match ? `.${match[1]}` : null;
1639
- } catch {
1640
- return null;
1641
- }
1642
- }
1643
- /**
1644
- * Generate a filename from URL
1645
- */
1646
- function generateFilename(url, ext) {
1647
- try {
1648
- return `${(new URL(url).pathname.split("/").pop() || "media").replace(EXTENSION_PATTERN, "").replace(QUERY_PARAM_PATTERN, "").replace(SANITIZE_PATTERN, "-").replace(MULTIPLE_HYPHENS_PATTERN, "-") || "media"}${ext}`;
1649
- } catch {
1650
- return `media${ext}`;
1651
- }
1652
- }
1653
- /**
1654
- * Get image dimensions from buffer using image-size.
1655
- * Supports PNG, JPEG, GIF, WebP, AVIF, SVG, TIFF, and more.
1656
- */
1657
- function getImageDimensions(buffer) {
1658
- try {
1659
- const result = imageSize(buffer);
1660
- if (result.width != null && result.height != null) return {
1661
- width: result.width,
1662
- height: result.height
1663
- };
1664
- return null;
1665
- } catch {
1666
- return null;
1667
- }
1668
- }
1669
-
1670
- //#endregion
1671
- export { sanitizeGalleryImages as a, resolveImageMedia as i, applySeedWithinBudget as n, createPublicMediaUrlResolver as o, apply_exports as r, applySeed as t };
1672
- //# sourceMappingURL=apply-CDNV4JJ-.mjs.map