@velora-cms/server 0.11.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 (367) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +65 -0
  3. package/dist/admin-bundle/assets/__virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-Ng0fOpdU.js +1 -0
  4. package/dist/admin-bundle/assets/__virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-oc1i_iBU.js +9 -0
  5. package/dist/admin-bundle/assets/_virtual_mf-localSharedImportMap___mfe_internal__velora_admin__mf_owner__1-DOKdWYyj.js +1 -0
  6. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare___mf_0_velora_mf_2_cms_mf_1_plugin_mf_2_sdk__loadShare__.js-C1-ZAxwO.js +2 -0
  7. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react__loadShare__.js-BuUBskgj.js +9 -0
  8. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DMaku-HC.js +9 -0
  9. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-DYfqn12F.js +1 -0
  10. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BPoj3DC9.js +25 -0
  11. package/dist/admin-bundle/assets/content-trash.schema-DfXHkC-w.js +72 -0
  12. package/dist/admin-bundle/assets/hostInit--C4xK6nj.js +1 -0
  13. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  14. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  15. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  16. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  17. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  18. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  19. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  20. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  21. package/dist/admin-bundle/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  22. package/dist/admin-bundle/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  23. package/dist/admin-bundle/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  24. package/dist/admin-bundle/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  25. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  26. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  27. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  28. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  29. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  30. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  31. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  32. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  33. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-400-normal-CyU-ddYS.woff2 +0 -0
  34. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-400-normal-EA1o-u_Q.woff +0 -0
  35. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-500-normal-C4MQITzh.woff2 +0 -0
  36. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-500-normal-DPXcppbm.woff +0 -0
  37. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-600-normal-0pRdybE_.woff2 +0 -0
  38. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-600-normal-MJZ0liF5.woff +0 -0
  39. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-400-normal-Bo5KPYvw.woff2 +0 -0
  40. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-400-normal-CFZh1unN.woff +0 -0
  41. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-500-normal-BletK1Hp.woff +0 -0
  42. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-500-normal-Cd6jVIg7.woff2 +0 -0
  43. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-600-normal-Dk5eISD_.woff +0 -0
  44. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-600-normal-KrqB56Mw.woff2 +0 -0
  45. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-400-normal-BeVLg08x.woff +0 -0
  46. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-400-normal-BpLfq-63.woff2 +0 -0
  47. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-500-normal-Ck_W4G78.woff2 +0 -0
  48. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-500-normal-eJxPnL1P.woff +0 -0
  49. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-600-normal-DT29Q8HW.woff +0 -0
  50. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-600-normal-DjDAeNQD.woff2 +0 -0
  51. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  52. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  53. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
  54. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
  55. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  56. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  57. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  58. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  59. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
  60. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
  61. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  62. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  63. package/dist/admin-bundle/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  64. package/dist/admin-bundle/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  65. package/dist/admin-bundle/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
  66. package/dist/admin-bundle/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
  67. package/dist/admin-bundle/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  68. package/dist/admin-bundle/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  69. package/dist/admin-bundle/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  70. package/dist/admin-bundle/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  71. package/dist/admin-bundle/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  72. package/dist/admin-bundle/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  73. package/dist/admin-bundle/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  74. package/dist/admin-bundle/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  75. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  76. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  77. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
  78. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
  79. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  80. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  81. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  82. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  83. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
  84. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
  85. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  86. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  87. package/dist/admin-bundle/assets/index-BIAF0ShP.js +542 -0
  88. package/dist/admin-bundle/assets/index-DhMY-0sC.js +148 -0
  89. package/dist/admin-bundle/assets/index-DnZV_gsg.css +1 -0
  90. package/dist/admin-bundle/assets/index-Do71v6NZ.js +7 -0
  91. package/dist/admin-bundle/assets/literata-cyrillic-ext-opsz-italic-5yUt4G_9.woff2 +0 -0
  92. package/dist/admin-bundle/assets/literata-cyrillic-ext-opsz-normal-C5tfwALZ.woff2 +0 -0
  93. package/dist/admin-bundle/assets/literata-cyrillic-opsz-italic-Bj0ndbyp.woff2 +0 -0
  94. package/dist/admin-bundle/assets/literata-cyrillic-opsz-normal-DgmypKXX.woff2 +0 -0
  95. package/dist/admin-bundle/assets/literata-greek-ext-opsz-italic-DFpO5j-Z.woff2 +0 -0
  96. package/dist/admin-bundle/assets/literata-greek-ext-opsz-normal-DGm64vGR.woff2 +0 -0
  97. package/dist/admin-bundle/assets/literata-greek-opsz-italic-CHERNRFq.woff2 +0 -0
  98. package/dist/admin-bundle/assets/literata-greek-opsz-normal-DFglUmAd.woff2 +0 -0
  99. package/dist/admin-bundle/assets/literata-latin-ext-opsz-italic-4y8iAqqs.woff2 +0 -0
  100. package/dist/admin-bundle/assets/literata-latin-ext-opsz-normal-STiTPs0F.woff2 +0 -0
  101. package/dist/admin-bundle/assets/literata-latin-opsz-italic-CJ93D38p.woff2 +0 -0
  102. package/dist/admin-bundle/assets/literata-latin-opsz-normal-BHZsWIlc.woff2 +0 -0
  103. package/dist/admin-bundle/assets/literata-vietnamese-opsz-italic-BdcrZMcO.woff2 +0 -0
  104. package/dist/admin-bundle/assets/literata-vietnamese-opsz-normal-Gqw5JQlq.woff2 +0 -0
  105. package/dist/admin-bundle/assets/mf-entry-bootstrap-0-aef015cd.js +41 -0
  106. package/dist/admin-bundle/assets/remoteEntry-CNyN68bc.js +14 -0
  107. package/dist/admin-bundle/assets/virtualExposes-BDCSo5OS.js +1 -0
  108. package/dist/admin-bundle/assets/vite-preload-helper-Cgledu0r.js +1 -0
  109. package/dist/admin-bundle/index.html +16 -0
  110. package/dist/app.d.ts +8 -0
  111. package/dist/app.js +252 -0
  112. package/dist/auth/api-content-author.d.ts +2 -0
  113. package/dist/auth/api-content-author.js +27 -0
  114. package/dist/auth/api-keys.d.ts +7 -0
  115. package/dist/auth/api-keys.js +85 -0
  116. package/dist/auth/jwt-payload.d.ts +16 -0
  117. package/dist/auth/jwt-payload.js +1 -0
  118. package/dist/auth/preview-tokens.d.ts +7 -0
  119. package/dist/auth/preview-tokens.js +76 -0
  120. package/dist/auth/rate-limit.d.ts +16 -0
  121. package/dist/auth/rate-limit.js +283 -0
  122. package/dist/auth/require-auth.d.ts +4 -0
  123. package/dist/auth/require-auth.js +28 -0
  124. package/dist/auth/route-rate-limits.d.ts +31 -0
  125. package/dist/auth/route-rate-limits.js +155 -0
  126. package/dist/auth/tokens.d.ts +15 -0
  127. package/dist/auth/tokens.js +38 -0
  128. package/dist/bin.d.ts +2 -0
  129. package/dist/bin.js +6 -0
  130. package/dist/boot/core-migration-gate.d.ts +12 -0
  131. package/dist/boot/core-migration-gate.js +52 -0
  132. package/dist/boot/resolve-boot-mode.d.ts +6 -0
  133. package/dist/boot/resolve-boot-mode.js +206 -0
  134. package/dist/bundled-templates/com.velora.blog/manifest.json +39 -0
  135. package/dist/bundled-templates/com.velora.blog/package.tar.gz +0 -0
  136. package/dist/bundled-templates/com.velora.blog/sample-content.json +14 -0
  137. package/dist/config/admin-ui.d.ts +1 -0
  138. package/dist/config/admin-ui.js +10 -0
  139. package/dist/config/cors.d.ts +7 -0
  140. package/dist/config/cors.js +53 -0
  141. package/dist/config/env-file-path.d.ts +2 -0
  142. package/dist/config/env-file-path.js +22 -0
  143. package/dist/config/graphql-limits.d.ts +2 -0
  144. package/dist/config/graphql-limits.js +26 -0
  145. package/dist/config/headless.d.ts +1 -0
  146. package/dist/config/headless.js +8 -0
  147. package/dist/config/license-revalidation.d.ts +2 -0
  148. package/dist/config/license-revalidation.js +16 -0
  149. package/dist/config/load-env.d.ts +1 -0
  150. package/dist/config/load-env.js +53 -0
  151. package/dist/config/marketplace.d.ts +11 -0
  152. package/dist/config/marketplace.js +19 -0
  153. package/dist/config/preview.d.ts +3 -0
  154. package/dist/config/preview.js +39 -0
  155. package/dist/config/public-docs.d.ts +1 -0
  156. package/dist/config/public-docs.js +9 -0
  157. package/dist/config/site.d.ts +7 -0
  158. package/dist/config/site.js +12 -0
  159. package/dist/config/trust-proxy.d.ts +2 -0
  160. package/dist/config/trust-proxy.js +42 -0
  161. package/dist/data-types/validate-data-type-settings.d.ts +1 -0
  162. package/dist/data-types/validate-data-type-settings.js +33 -0
  163. package/dist/db/content-db.d.ts +16 -0
  164. package/dist/db/content-db.js +109 -0
  165. package/dist/db/core-migrations/index.d.ts +14 -0
  166. package/dist/db/core-migrations/index.js +184 -0
  167. package/dist/db/core-migrations/steps.d.ts +4 -0
  168. package/dist/db/core-migrations/steps.js +66 -0
  169. package/dist/db/load-prisma-client.d.ts +2 -0
  170. package/dist/db/load-prisma-client.js +44 -0
  171. package/dist/db/prisma.d.ts +3 -0
  172. package/dist/db/prisma.js +67 -0
  173. package/dist/db/resolve-client-dir.d.ts +2 -0
  174. package/dist/db/resolve-client-dir.js +83 -0
  175. package/dist/docs/filter-public-api-spec.d.ts +2 -0
  176. package/dist/docs/filter-public-api-spec.js +52 -0
  177. package/dist/docs-bundle/404.html +41 -0
  178. package/dist/docs-bundle/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js +1 -0
  179. package/dist/docs-bundle/_astro/Search.astro_astro_type_script_index_0_lang.CavldbAs.js +1 -0
  180. package/dist/docs-bundle/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js +1 -0
  181. package/dist/docs-bundle/_astro/common.DTXA7sXM.css +3 -0
  182. package/dist/docs-bundle/_astro/ec.0vx5m.js +3 -0
  183. package/dist/docs-bundle/_astro/ec.w36nc.css +1 -0
  184. package/dist/docs-bundle/_astro/page.Dwipeu-R.js +1 -0
  185. package/dist/docs-bundle/_astro/print.ehPL0gv-.css +1 -0
  186. package/dist/docs-bundle/_astro/starlight-toc.CTCQXEge.js +1 -0
  187. package/dist/docs-bundle/_astro/ui-core.D-7Scnhs.js +2 -0
  188. package/dist/docs-bundle/favicon.svg +1 -0
  189. package/dist/docs-bundle/index.html +1 -0
  190. package/dist/docs-bundle/pagefind/fragment/en_18a36d7.pf_fragment +0 -0
  191. package/dist/docs-bundle/pagefind/fragment/en_1d9eb24.pf_fragment +0 -0
  192. package/dist/docs-bundle/pagefind/fragment/en_1ef320c.pf_fragment +0 -0
  193. package/dist/docs-bundle/pagefind/fragment/en_3099406.pf_fragment +0 -0
  194. package/dist/docs-bundle/pagefind/fragment/en_4a5b6fe.pf_fragment +0 -0
  195. package/dist/docs-bundle/pagefind/fragment/en_9aa652e.pf_fragment +0 -0
  196. package/dist/docs-bundle/pagefind/fragment/en_baccdf6.pf_fragment +0 -0
  197. package/dist/docs-bundle/pagefind/fragment/en_d81f3fe.pf_fragment +0 -0
  198. package/dist/docs-bundle/pagefind/fragment/en_d855550.pf_fragment +0 -0
  199. package/dist/docs-bundle/pagefind/fragment/en_e6d88d8.pf_fragment +0 -0
  200. package/dist/docs-bundle/pagefind/fragment/en_e9d3189.pf_fragment +0 -0
  201. package/dist/docs-bundle/pagefind/index/en_5feeed7.pf_index +0 -0
  202. package/dist/docs-bundle/pagefind/index/en_c6981f9.pf_index +0 -0
  203. package/dist/docs-bundle/pagefind/index/en_ce4f6bf.pf_index +0 -0
  204. package/dist/docs-bundle/pagefind/pagefind-component-ui.css +1509 -0
  205. package/dist/docs-bundle/pagefind/pagefind-component-ui.js +56 -0
  206. package/dist/docs-bundle/pagefind/pagefind-entry.json +1 -0
  207. package/dist/docs-bundle/pagefind/pagefind-highlight.js +1070 -0
  208. package/dist/docs-bundle/pagefind/pagefind-modular-ui.css +214 -0
  209. package/dist/docs-bundle/pagefind/pagefind-modular-ui.js +8 -0
  210. package/dist/docs-bundle/pagefind/pagefind-ui.css +1 -0
  211. package/dist/docs-bundle/pagefind/pagefind-ui.js +2 -0
  212. package/dist/docs-bundle/pagefind/pagefind-worker.js +6 -0
  213. package/dist/docs-bundle/pagefind/pagefind.en_1e94abd852.pf_meta +0 -0
  214. package/dist/docs-bundle/pagefind/pagefind.js +6 -0
  215. package/dist/docs-bundle/pagefind/wasm.en.pagefind +0 -0
  216. package/dist/docs-bundle/pagefind/wasm.unknown.pagefind +0 -0
  217. package/dist/docs-bundle/v1/index.html +86 -0
  218. package/dist/docs-bundle/v1/using-velora/build-a-headless-frontend/index.html +413 -0
  219. package/dist/docs-bundle/v1/using-velora/content-model/index.html +858 -0
  220. package/dist/docs-bundle/v1/using-velora/editing/index.html +748 -0
  221. package/dist/docs-bundle/v1/using-velora/getting-started/index.html +588 -0
  222. package/dist/docs-bundle/v1/using-velora/headless-api/index.html +1620 -0
  223. package/dist/docs-bundle/v1/using-velora/index.html +215 -0
  224. package/dist/docs-bundle/v1/using-velora/installation/index.html +886 -0
  225. package/dist/docs-bundle/v1/using-velora/installing-plugins/index.html +836 -0
  226. package/dist/docs-bundle/v1/using-velora/media/index.html +468 -0
  227. package/dist/docs-bundle/v1/using-velora/users-and-roles/index.html +561 -0
  228. package/dist/graphql/field-count-rule.d.ts +5 -0
  229. package/dist/graphql/field-count-rule.js +59 -0
  230. package/dist/graphql/schema.d.ts +12 -0
  231. package/dist/graphql/schema.js +330 -0
  232. package/dist/index.d.ts +1 -0
  233. package/dist/index.js +180 -0
  234. package/dist/lib.d.ts +2 -0
  235. package/dist/lib.js +39 -0
  236. package/dist/marketplace/install-bundle-members.d.ts +33 -0
  237. package/dist/marketplace/install-bundle-members.js +137 -0
  238. package/dist/marketplace/install-from-marketplace.d.ts +60 -0
  239. package/dist/marketplace/install-from-marketplace.js +581 -0
  240. package/dist/marketplace/license-revalidation-job.d.ts +38 -0
  241. package/dist/marketplace/license-revalidation-job.js +139 -0
  242. package/dist/marketplace/marketplace-client.d.ts +43 -0
  243. package/dist/marketplace/marketplace-client.js +228 -0
  244. package/dist/marketplace/revalidate-license.d.ts +39 -0
  245. package/dist/marketplace/revalidate-license.js +103 -0
  246. package/dist/media/media-service.d.ts +36 -0
  247. package/dist/media/media-service.js +162 -0
  248. package/dist/plugins/boot-plugin-loader.d.ts +32 -0
  249. package/dist/plugins/boot-plugin-loader.js +57 -0
  250. package/dist/plugins/hook-dispatcher.d.ts +13 -0
  251. package/dist/plugins/hook-dispatcher.js +68 -0
  252. package/dist/plugins/install-built-package.d.ts +36 -0
  253. package/dist/plugins/install-built-package.js +199 -0
  254. package/dist/plugins/install-package-tarball.d.ts +25 -0
  255. package/dist/plugins/install-package-tarball.js +73 -0
  256. package/dist/plugins/plugin-context.d.ts +5 -0
  257. package/dist/plugins/plugin-context.js +26 -0
  258. package/dist/plugins/plugin-package-store.d.ts +31 -0
  259. package/dist/plugins/plugin-package-store.js +64 -0
  260. package/dist/plugins/plugin-registry-service.d.ts +227 -0
  261. package/dist/plugins/plugin-registry-service.js +636 -0
  262. package/dist/plugins/seed-template-content.d.ts +23 -0
  263. package/dist/plugins/seed-template-content.js +198 -0
  264. package/dist/plugins/server-serializers.d.ts +3 -0
  265. package/dist/plugins/server-serializers.js +16 -0
  266. package/dist/plugins/simple-storage-api.d.ts +9 -0
  267. package/dist/plugins/simple-storage-api.js +26 -0
  268. package/dist/plugins/snapshot-groups.d.ts +16 -0
  269. package/dist/plugins/snapshot-groups.js +81 -0
  270. package/dist/plugins/structured-query-builder.d.ts +21 -0
  271. package/dist/plugins/structured-query-builder.js +60 -0
  272. package/dist/plugins/structured-snapshot-service.d.ts +16 -0
  273. package/dist/plugins/structured-snapshot-service.js +286 -0
  274. package/dist/plugins/structured-storage-api.d.ts +22 -0
  275. package/dist/plugins/structured-storage-api.js +91 -0
  276. package/dist/plugins/structured-storage-transaction.d.ts +22 -0
  277. package/dist/plugins/structured-storage-transaction.js +63 -0
  278. package/dist/plugins/structured-table-naming.d.ts +1 -0
  279. package/dist/plugins/structured-table-naming.js +18 -0
  280. package/dist/plugins/trusted-keys.d.ts +11 -0
  281. package/dist/plugins/trusted-keys.js +67 -0
  282. package/dist/plugins/trusted-signing-keys.d.ts +27 -0
  283. package/dist/plugins/trusted-signing-keys.js +40 -0
  284. package/dist/plugins/uninstall-bundle.d.ts +29 -0
  285. package/dist/plugins/uninstall-bundle.js +150 -0
  286. package/dist/plugins/verify-package.d.ts +36 -0
  287. package/dist/plugins/verify-package.js +121 -0
  288. package/dist/routes/admin-static.d.ts +8 -0
  289. package/dist/routes/admin-static.js +196 -0
  290. package/dist/routes/api-keys.d.ts +2 -0
  291. package/dist/routes/api-keys.js +95 -0
  292. package/dist/routes/api-playground.d.ts +2 -0
  293. package/dist/routes/api-playground.js +21 -0
  294. package/dist/routes/auth.d.ts +2 -0
  295. package/dist/routes/auth.js +102 -0
  296. package/dist/routes/content.d.ts +3 -0
  297. package/dist/routes/content.js +471 -0
  298. package/dist/routes/data-types.d.ts +3 -0
  299. package/dist/routes/data-types.js +100 -0
  300. package/dist/routes/docs-static.d.ts +8 -0
  301. package/dist/routes/docs-static.js +137 -0
  302. package/dist/routes/document-types.d.ts +3 -0
  303. package/dist/routes/document-types.js +149 -0
  304. package/dist/routes/headless-bridge.d.ts +10 -0
  305. package/dist/routes/headless-bridge.js +207 -0
  306. package/dist/routes/health.d.ts +2 -0
  307. package/dist/routes/health.js +15 -0
  308. package/dist/routes/marketplace-proxy.d.ts +8 -0
  309. package/dist/routes/marketplace-proxy.js +135 -0
  310. package/dist/routes/media.d.ts +6 -0
  311. package/dist/routes/media.js +93 -0
  312. package/dist/routes/plugin-api-routes.d.ts +12 -0
  313. package/dist/routes/plugin-api-routes.js +224 -0
  314. package/dist/routes/plugin-assets.d.ts +8 -0
  315. package/dist/routes/plugin-assets.js +51 -0
  316. package/dist/routes/plugin-management.d.ts +7 -0
  317. package/dist/routes/plugin-management.js +525 -0
  318. package/dist/routes/plugin-storage.d.ts +8 -0
  319. package/dist/routes/plugin-storage.js +104 -0
  320. package/dist/routes/plugins.d.ts +2 -0
  321. package/dist/routes/plugins.js +36 -0
  322. package/dist/routes/public-api.d.ts +9 -0
  323. package/dist/routes/public-api.js +545 -0
  324. package/dist/routes/published-item.d.ts +57 -0
  325. package/dist/routes/published-item.js +236 -0
  326. package/dist/routes/setup.d.ts +9 -0
  327. package/dist/routes/setup.js +477 -0
  328. package/dist/routes/snapshots.d.ts +3 -0
  329. package/dist/routes/snapshots.js +65 -0
  330. package/dist/routes/templates.d.ts +3 -0
  331. package/dist/routes/templates.js +37 -0
  332. package/dist/routes/themes.d.ts +2 -0
  333. package/dist/routes/themes.js +30 -0
  334. package/dist/routes/users.d.ts +2 -0
  335. package/dist/routes/users.js +113 -0
  336. package/dist/sandbox/register-local-plugin.d.ts +36 -0
  337. package/dist/sandbox/register-local-plugin.js +108 -0
  338. package/dist/sandbox/seed-sandbox.d.ts +20 -0
  339. package/dist/sandbox/seed-sandbox.js +122 -0
  340. package/dist/scripts/copy-admin-bundle.d.ts +1 -0
  341. package/dist/scripts/copy-admin-bundle.js +24 -0
  342. package/dist/scripts/copy-docs-bundle.d.ts +1 -0
  343. package/dist/scripts/copy-docs-bundle.js +22 -0
  344. package/dist/scripts/create-api-key.d.ts +5 -0
  345. package/dist/scripts/create-api-key.js +56 -0
  346. package/dist/scripts/generate-prisma-clients.d.ts +6 -0
  347. package/dist/scripts/generate-prisma-clients.js +125 -0
  348. package/dist/scripts/pack-bundled-templates.d.ts +1 -0
  349. package/dist/scripts/pack-bundled-templates.js +87 -0
  350. package/dist/setup/build-connection-string.d.ts +19 -0
  351. package/dist/setup/build-connection-string.js +14 -0
  352. package/dist/setup/bundled-templates.d.ts +19 -0
  353. package/dist/setup/bundled-templates.js +121 -0
  354. package/dist/setup/ensure-prisma-client.d.ts +3 -0
  355. package/dist/setup/ensure-prisma-client.js +23 -0
  356. package/dist/setup/install-starter.d.ts +14 -0
  357. package/dist/setup/install-starter.js +76 -0
  358. package/dist/setup/normalize-database-url.d.ts +2 -0
  359. package/dist/setup/normalize-database-url.js +35 -0
  360. package/dist/setup/persist-env-config.d.ts +2 -0
  361. package/dist/setup/persist-env-config.js +63 -0
  362. package/dist/setup/provision-database.d.ts +2 -0
  363. package/dist/setup/provision-database.js +89 -0
  364. package/dist/setup-app.d.ts +4 -0
  365. package/dist/setup-app.js +43 -0
  366. package/package.json +96 -0
  367. package/prisma/schema.prisma +303 -0
@@ -0,0 +1,73 @@
1
+ import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { extractArtifact } from "@velora-cms/plugin-package";
5
+ import { installBuiltPackage } from "./install-built-package.js";
6
+ import { loadTrustedKeys } from "./trusted-keys.js";
7
+ import { checkPackageIdentity, describeVerifyResult, resolveSidecarPath, trustTierFor, verifyPackage } from "./verify-package.js";
8
+ /** Best-effort cleanup shared by both extraction-temp-dir removal sites
9
+ * below. Cleanup is housekeeping, never the operation that matters — a
10
+ * failure here must never mask a real error already propagating out of
11
+ * the caller, so it only ever warns. */
12
+ function removeTempDir(dir) {
13
+ try {
14
+ rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 500 });
15
+ }
16
+ catch (cleanupError) {
17
+ console.warn(`[install-package-tarball] failed to remove temp extraction directory ${dir} — leaving it behind`, cleanupError);
18
+ }
19
+ }
20
+ export async function installPackageTarball(service, tarballPath, remoteUrl, setRemoteUrl, syncManifestFields, setPackagePath, options = {}) {
21
+ const defaultSidecar = resolveSidecarPath(tarballPath);
22
+ const sidecarPath = options.sidecarPath === undefined ? (existsSync(defaultSidecar) ? defaultSidecar : null) : options.sidecarPath;
23
+ const trustedKeys = options.trustedKeys ?? loadTrustedKeys();
24
+ const verification = await verifyPackage(tarballPath, sidecarPath, trustedKeys);
25
+ const extractDir = mkdtempSync(join(tmpdir(), "velora-install-"));
26
+ const extracted = await extractArtifact(tarballPath, extractDir);
27
+ if (!extracted.ok) {
28
+ // extractArtifact writes entries incrementally and does NOT roll back a
29
+ // partial extraction — deleting the directory is the caller's job.
30
+ // maxRetries/retryDelay: on Windows, files the extractor just finished
31
+ // writing (e.g. a corrupt-trailer archive that still decoded some real
32
+ // entries before its gzip integrity check failed at the end — observed
33
+ // directly while developing this module's own tests, by flipping the
34
+ // last byte of a real .tar.gz) can have their handles released
35
+ // asynchronously a moment after extraction settles, making an
36
+ // immediate recursive rmSync race an ENOTEMPTY — the same reality
37
+ // documented at every other rmSync of a just-written temp tree in this
38
+ // codebase (e.g. build-and-sideload.integration.test.ts's TMP_ROOT
39
+ // cleanup).
40
+ //
41
+ // Even with those retries, rmSync can still throw. Cleanup is
42
+ // best-effort housekeeping; the extraction failure below is the real,
43
+ // diagnosable problem. A cleanup failure must never mask it — leaving
44
+ // the temp directory behind is a far smaller cost than surfacing a
45
+ // filesystem error that names neither the real cause nor the package.
46
+ removeTempDir(extractDir);
47
+ throw new Error(`Package could not be extracted: ${extracted.reason}`);
48
+ }
49
+ try {
50
+ // The identity cross-check can only happen now: manifest.json does not
51
+ // exist until extraction. It DOWNGRADES a verified verdict, never
52
+ // upgrades one. The envelope it checks against comes off `verification`
53
+ // itself (the authenticated result from verifyPackage) — never from a
54
+ // second, unauthenticated read of the sidecar file.
55
+ const manifestPath = join(extractDir, "manifest.json");
56
+ if (!existsSync(manifestPath)) {
57
+ throw new Error(`No manifest.json found in ${tarballPath} — not a velora-plugin built package`);
58
+ }
59
+ const summary = JSON.parse(readFileSync(manifestPath, "utf8"));
60
+ const finalVerdict = checkPackageIdentity(verification, summary.id ?? "", summary.version ?? "");
61
+ describeVerifyResult(finalVerdict, tarballPath);
62
+ const outcome = await installBuiltPackage(service, extractDir, remoteUrl, setRemoteUrl, syncManifestFields, setPackagePath, { trustTier: trustTierFor(finalVerdict), seed: options.seed });
63
+ return { outcome, verification: finalVerdict };
64
+ }
65
+ finally {
66
+ // installBuiltPackage copies the package into the managed store
67
+ // (S122) before importing, so the temp extraction is disposable.
68
+ // Same cleanup as the extraction-failure branch above: a failure here
69
+ // must not mask a successful install, nor replace a genuine error
70
+ // already propagating out of installBuiltPackage.
71
+ removeTempDir(extractDir);
72
+ }
73
+ }
@@ -0,0 +1,5 @@
1
+ import type { ContentService } from "@velora-cms/content-service";
2
+ import type { DatabaseAdapter } from "@velora-cms/db-adapter";
3
+ import type { PluginApiRouteContext } from "@velora-cms/plugin-sdk/manifest";
4
+ import type { StructuredStorageAPI } from "./structured-storage-api.js";
5
+ export declare function buildContext(pluginId: string, structuredStorageAPI: StructuredStorageAPI, contentService: ContentService, adapter: DatabaseAdapter): PluginApiRouteContext;
@@ -0,0 +1,26 @@
1
+ // Shared by plugin-api-routes.ts and hook-dispatcher.ts (S159) — both need
2
+ // to build the exact same plugin-scoped capabilities object (structured
3
+ // storage bound to the calling plugin's id, plus getPublishedContent), so
4
+ // there is exactly ONE definition of that shape rather than two that could
5
+ // drift. PluginApiRouteContext and the SDK's PluginHookContext are
6
+ // structurally identical (manifest.ts), so this single builder satisfies
7
+ // both call sites without a cast.
8
+ export function buildContext(pluginId, structuredStorageAPI, contentService, adapter) {
9
+ return {
10
+ structuredStorage: {
11
+ defineTable: (schema) => structuredStorageAPI.defineTable(pluginId, schema),
12
+ insert: (tableName, data) => structuredStorageAPI.insert(pluginId, tableName, data),
13
+ update: (tableName, where, data) => structuredStorageAPI.update(pluginId, tableName, where, data),
14
+ delete: (tableName, where) => structuredStorageAPI.delete(pluginId, tableName, where),
15
+ query: (tableName) => structuredStorageAPI.query(pluginId, tableName),
16
+ transaction: (fn) => structuredStorageAPI.transaction(pluginId, fn),
17
+ },
18
+ getPublishedContent: async (contentId) => {
19
+ const node = await adapter.getContentNode(contentId);
20
+ if (!node || node.publishedAt === null)
21
+ return null;
22
+ const version = await contentService.getCurrentVersion(contentId);
23
+ return { id: node.id, documentTypeId: node.documentTypeId, data: version.data };
24
+ },
25
+ };
26
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Server-owned store for installed plugin packages (Session 122). A
3
+ * built package is COPIED here at install time and imported from here —
4
+ * both immediately and by the boot loader on every later restart — so
5
+ * the caller's extraction directory (usually an OS tmpdir) can vanish
6
+ * without breaking the installation.
7
+ *
8
+ * Layout: <root>/<pluginId>/<version>/ holding the ENTIRE extracted
9
+ * package. Copying the whole tree is load-bearing: server/package.json
10
+ * (Session 121's ESM marker) must ride along or plain-Node imports of
11
+ * server/plugin.js regress to CJS misparsing. Version-keyed paths are
12
+ * the ESM-cache answer: a future plugin UPDATE lands at a new path and
13
+ * therefore a new module URL. Re-installing the SAME version into a
14
+ * running process keeps serving the already-imported module for hooks
15
+ * (Node caches by URL) — accepted: install() attaches the manifest it
16
+ * just imported, so the running process is internally consistent, and
17
+ * the fresh files take over at next boot.
18
+ *
19
+ * pluginId and version become directory names here, so they must already
20
+ * be path-safe by the time they reach this module. The actual gate lives
21
+ * in install-built-package.ts's regexes (id: reverse-domain shape;
22
+ * version: path-safe characters with no ".."), run BEFORE storePackage()
23
+ * is called — validatePluginManifest itself only requires version to be
24
+ * a non-empty string (`z.string().min(1)`), so it is NOT what makes this
25
+ * safe. Any other caller of storePackage() must pre-vet its own id and
26
+ * version the same way; this module does no validation of its own.
27
+ */
28
+ export declare function resolvePluginsDir(): string;
29
+ export declare function packageStorePath(pluginId: string, version: string): string;
30
+ export declare function storePackage(sourceDir: string, pluginId: string, version: string): string;
31
+ export declare function removePluginPackages(pluginId: string): void;
@@ -0,0 +1,64 @@
1
+ import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
2
+ import { join, resolve, sep } from "node:path";
3
+ /**
4
+ * Server-owned store for installed plugin packages (Session 122). A
5
+ * built package is COPIED here at install time and imported from here —
6
+ * both immediately and by the boot loader on every later restart — so
7
+ * the caller's extraction directory (usually an OS tmpdir) can vanish
8
+ * without breaking the installation.
9
+ *
10
+ * Layout: <root>/<pluginId>/<version>/ holding the ENTIRE extracted
11
+ * package. Copying the whole tree is load-bearing: server/package.json
12
+ * (Session 121's ESM marker) must ride along or plain-Node imports of
13
+ * server/plugin.js regress to CJS misparsing. Version-keyed paths are
14
+ * the ESM-cache answer: a future plugin UPDATE lands at a new path and
15
+ * therefore a new module URL. Re-installing the SAME version into a
16
+ * running process keeps serving the already-imported module for hooks
17
+ * (Node caches by URL) — accepted: install() attaches the manifest it
18
+ * just imported, so the running process is internally consistent, and
19
+ * the fresh files take over at next boot.
20
+ *
21
+ * pluginId and version become directory names here, so they must already
22
+ * be path-safe by the time they reach this module. The actual gate lives
23
+ * in install-built-package.ts's regexes (id: reverse-domain shape;
24
+ * version: path-safe characters with no ".."), run BEFORE storePackage()
25
+ * is called — validatePluginManifest itself only requires version to be
26
+ * a non-empty string (`z.string().min(1)`), so it is NOT what makes this
27
+ * safe. Any other caller of storePackage() must pre-vet its own id and
28
+ * version the same way; this module does no validation of its own.
29
+ */
30
+ export function resolvePluginsDir() {
31
+ return resolve(process.env.VELORA_PLUGINS_DIR ?? join(process.cwd(), ".velora", "plugins"));
32
+ }
33
+ export function packageStorePath(pluginId, version) {
34
+ return join(resolvePluginsDir(), pluginId, version);
35
+ }
36
+ export function storePackage(sourceDir, pluginId, version) {
37
+ const target = packageStorePath(pluginId, version);
38
+ const resolvedSource = resolve(sourceDir);
39
+ // Self-destruction guard: if the caller passes the ALREADY-STORED copy
40
+ // back in as its own source (an operator re-running the install CLI
41
+ // against `.velora/plugins/<id>/<version>` itself, say), the rmSync
42
+ // below would delete the target and then try to copy from the very
43
+ // directory it just deleted — destroying the only copy of the package.
44
+ // Same-path is a no-op success; a source nested INSIDE the target is a
45
+ // hard error rather than a silent partial delete.
46
+ if (resolvedSource === target) {
47
+ return target;
48
+ }
49
+ if (resolvedSource.startsWith(target + sep)) {
50
+ throw new Error(`storePackage: source "${resolvedSource}" is inside the target directory "${target}" it would be copied into — refusing to delete the target first`);
51
+ }
52
+ // Replace, never merge — a leftover file from a previous copy of the
53
+ // same version must not survive into the new package's directory.
54
+ rmSync(target, { recursive: true, force: true, maxRetries: 10, retryDelay: 500 });
55
+ mkdirSync(target, { recursive: true });
56
+ cpSync(resolvedSource, target, { recursive: true });
57
+ return target;
58
+ }
59
+ export function removePluginPackages(pluginId) {
60
+ const dir = join(resolvePluginsDir(), pluginId);
61
+ if (!existsSync(dir))
62
+ return;
63
+ rmSync(dir, { recursive: true, force: true, maxRetries: 10, retryDelay: 500 });
64
+ }
@@ -0,0 +1,227 @@
1
+ import type { PluginRegistry, PrismaClient } from "@prisma/client";
2
+ import { type CMSPlugin, type DatabaseDialect, type HookEvent, type HookHandler, type SerializerContribution } from "@velora-cms/plugin-sdk/manifest";
3
+ import type { DatabaseAdapter } from "@velora-cms/db-adapter";
4
+ import type { TrustTier } from "./verify-package.js";
5
+ /** A persisted plugin registry row (Prisma's shape, re-exported under a
6
+ * service-level name so route/consumer code doesn't couple to Prisma). */
7
+ export type InstalledPlugin = PluginRegistry;
8
+ /** Manifest failed Session 60's validation — carries the readable
9
+ * `path: message` errors for the future install route to surface. */
10
+ export declare class PluginInstallError extends Error {
11
+ readonly errors: string[];
12
+ constructor(message: string, errors?: string[]);
13
+ }
14
+ /** The manifest is valid but declares it doesn't support the site's
15
+ * active database — blocked with the declared reason, never a silent
16
+ * failure. Subclass of PluginInstallError so general install handling
17
+ * keeps working while the marketplace/UI can distinguish. */
18
+ export declare class PluginIncompatibleError extends PluginInstallError {
19
+ constructor(message: string);
20
+ }
21
+ export declare class PluginNotInstalledError extends Error {
22
+ constructor(pluginId: string);
23
+ }
24
+ /** The manifest declares pluginDependencies that aren't all installed AND
25
+ * active. Rejected with the full list, not just the first miss, so the
26
+ * installer can resolve everything in one pass rather than discovering
27
+ * missing dependencies one at a time. Subclass of PluginInstallError so
28
+ * existing catch sites keep working. */
29
+ export declare class PluginDependencyError extends PluginInstallError {
30
+ readonly missingDependencies: string[];
31
+ constructor(pluginId: string, missingDependencies: string[]);
32
+ }
33
+ /** A declared migration's up()/down() threw during install. Carries the
34
+ * plugin id, the specific migration id that failed, and the original
35
+ * cause — install() has already rolled back every migration that
36
+ * succeeded earlier in this same batch by the time this is thrown, so
37
+ * the plugin is left with no partial migration state and no registry
38
+ * row. Subclass of PluginInstallError so existing catch sites keep
39
+ * working. */
40
+ export declare class PluginMigrationError extends PluginInstallError {
41
+ readonly migrationId: string;
42
+ readonly cause: unknown;
43
+ constructor(pluginId: string, migrationId: string, cause: unknown);
44
+ }
45
+ /** Installed but disabled — the gate SimpleStorageAPI needs before an
46
+ * HTTP request touches a plugin's stored values: a disabled plugin's
47
+ * views aren't mounted anywhere, so its storage shouldn't be live either. */
48
+ export declare class PluginNotActiveError extends Error {
49
+ constructor(pluginId: string);
50
+ }
51
+ /** The plugin is installed but its manifest (the CODE — hooks are
52
+ * functions) isn't attached in this process, so it can't be activated:
53
+ * enabled:true for something that isn't running would be a lying state.
54
+ * Whatever loads plugin code at boot re-attaches via attachManifest. */
55
+ export declare class PluginNotLoadedError extends Error {
56
+ constructor(pluginId: string);
57
+ }
58
+ /** Thrown when uninstall() is called on a structured-storage plugin
59
+ * without confirmStructuredDataCleanup: true. The snapshot has ALREADY
60
+ * been taken by this point — nothing else has happened (no onUninstall,
61
+ * no migration rollback, no row deletion) — so retrying with
62
+ * confirmStructuredDataCleanup: true is always safe. */
63
+ export declare class StructuredDataCleanupRequiresConfirmationError extends Error {
64
+ readonly snapshotGroupId: string;
65
+ constructor(pluginId: string, snapshotGroupId: string);
66
+ }
67
+ /** One tracked document type that failed assertDocumentTypeDeletable(),
68
+ * resolved to a display name (not just the id uninstall() only tracks) so
69
+ * the caller — ultimately the admin uninstall dialog — can name it. */
70
+ export interface PluginDocumentTypeBlocker {
71
+ documentTypeId: string;
72
+ documentType: string;
73
+ reason: "has-content" | "has-templates";
74
+ contentCount?: number;
75
+ }
76
+ /** F1 QA fix wave: thrown by uninstall()'s document-type guard when one or
77
+ * MORE tracked document types are still in use — aggregated across EVERY
78
+ * tracked document type, not just the first to fail, so the operator sees
79
+ * the whole blocking set in one 409 instead of discovering it one retry at
80
+ * a time. Distinct from content-service's own DocumentTypeInUseError
81
+ * (which only ever describes a single document type, by id) — that class
82
+ * is still what assertDocumentTypeDeletable() throws per-call; this one is
83
+ * what uninstall() throws once it's walked every tracked document type and
84
+ * collected every failure. */
85
+ export declare class PluginDocumentTypesInUseError extends Error {
86
+ readonly blockers: PluginDocumentTypeBlocker[];
87
+ constructor(pluginId: string, blockers: PluginDocumentTypeBlocker[]);
88
+ }
89
+ export interface PluginRegistryOptions {
90
+ activeDialect: DatabaseDialect;
91
+ structuredDataLifecycle?: {
92
+ snapshot: (pluginId: string) => Promise<string>;
93
+ cleanup: (pluginId: string) => Promise<void>;
94
+ };
95
+ }
96
+ export declare class PluginRegistryService {
97
+ private readonly prisma;
98
+ private readonly adapter;
99
+ private readonly manifests;
100
+ private readonly enabledIds;
101
+ private readonly activeDialect;
102
+ private readonly structuredDataLifecycle;
103
+ private readonly documentTypeService;
104
+ constructor(prisma: PrismaClient, adapter: DatabaseAdapter, options: PluginRegistryOptions);
105
+ /** Non-throwing lookup — the read every other method here already does
106
+ * privately, exposed for callers (SimpleStorageAPI) that need to check
107
+ * installation state without triggering a lifecycle transition. */
108
+ getInstalledPlugin(pluginId: string): Promise<InstalledPlugin | null>;
109
+ /** Installed AND enabled, or throw — the exact gate SimpleStorageAPI
110
+ * needs on every get()/set(). */
111
+ requireActivePlugin(pluginId: string): Promise<InstalledPlugin>;
112
+ /** Read-only exposure of the attached manifest for a plugin id — used
113
+ * by request-time dispatchers (plugin-api-routes.ts) that need a
114
+ * plugin's declared contributions without going through install()/
115
+ * activate() again. Returns undefined if the manifest isn't attached
116
+ * in this process (never installed, or a restart happened and
117
+ * attachManifest() hasn't re-attached it yet). */
118
+ getManifest(pluginId: string): CMSPlugin | undefined;
119
+ /** Re-attach a loaded plugin's manifest to an existing installation
120
+ * (post-restart bridge for the boot-time plugin loader). */
121
+ attachManifest(manifest: CMSPlugin): Promise<void>;
122
+ /** The inverse of attachManifest: forget the in-process manifest so
123
+ * request-time consumers (the S89 apiRoutes dispatcher's
124
+ * requireActivePlugin/route lookup) stop answering for this plugin
125
+ * immediately — the uninstall route calls this so no restart is
126
+ * needed. A manifest that was never attached is a no-op. */
127
+ detachManifest(pluginId: string): void;
128
+ /**
129
+ * Validate a manifest (Session 60's validator — the contribution
130
+ * matrix included) and persist it. Session 127: the trust tier is now
131
+ * an optional caller-supplied value (`opts.trustTier`), defaulting to
132
+ * 'unverified' so every pre-S127 caller (which never supplied one)
133
+ * behaves identically. Local/dev plugins remain unsigned by
134
+ * definition and so always take the default.
135
+ * Installed ≠ active — rows start disabled; activate() is Session 63.
136
+ */
137
+ install(manifest: unknown, opts?: {
138
+ trustTier?: TrustTier;
139
+ }): Promise<InstalledPlugin>;
140
+ /** Roll back a batch of already-applied migrations in reverse order,
141
+ * removing each tracking row as it rolls back. Shared by install()'s
142
+ * two failure paths (a later migration failing, or onInstall failing
143
+ * after all migrations succeeded). */
144
+ private rollbackMigrations;
145
+ /** Delete every document type created so far in THIS install() call, in
146
+ * reverse order, plus its PluginDocumentType tracking row — always safe
147
+ * to hard-delete without assertDocumentTypeDeletable first, since these
148
+ * were just created inside this same call and cannot yet have any
149
+ * content or template referencing them. Shared by install()'s two
150
+ * documentTypes-era failure paths (a later entry failing, or onInstall
151
+ * failing after all entries succeeded) — same shape as
152
+ * rollbackMigrations. */
153
+ private rollbackDocumentTypes;
154
+ /**
155
+ * Enable an installed plugin. Hooks fire on TRANSITIONS only —
156
+ * activating an already-active plugin is a no-op. onActivate runs
157
+ * BEFORE enabled:true is persisted: a plugin that fails to start
158
+ * stays disabled. Requires the manifest to be attached (installed
159
+ * but unloaded code can't be "active" — that would be a lying state).
160
+ */
161
+ activate(pluginId: string): Promise<void>;
162
+ /**
163
+ * Disable an installed plugin without losing its configuration or
164
+ * data. Deliberately asymmetric with activate(): enabled:false is
165
+ * persisted FIRST and onDeactivate runs after (a hook error
166
+ * propagates, but the plugin is already off — you deactivate things
167
+ * BECAUSE they're broken, so disabling must never be blocked), and a
168
+ * missing manifest is fine (post-restart you can still switch a
169
+ * plugin off; the hook is skipped).
170
+ */
171
+ deactivate(pluginId: string): Promise<void>;
172
+ /**
173
+ * Remove an installed plugin. For structured-storage plugins, the
174
+ * confirmation gate is checked FIRST — before onUninstall, before
175
+ * migration rollback, before anything else destructive (Month 8,
176
+ * Session 87): a snapshot is always taken, and if the caller hasn't
177
+ * passed confirmStructuredDataCleanup: true, uninstall() throws
178
+ * StructuredDataCleanupRequiresConfirmationError right there, having
179
+ * changed nothing else — the row, migrations, and manifest are all
180
+ * untouched, so retrying with confirmation is always safe. Only once
181
+ * past that gate does the rest of teardown proceed: fallible cleanup
182
+ * (onUninstall, migration rollback) runs BEFORE the irreversible row
183
+ * delete (Session 72) — a failure there leaves the plugin
184
+ * still-installed and retryable rather than orphaned. Order is
185
+ * stack-shaped, inverse of install(): onUninstall (the last thing
186
+ * installed) runs first, migrations (the first thing installed) roll
187
+ * back last, in LIFO order — reversing manifest.migrations' own
188
+ * declared array, the same source of truth install() walked forward
189
+ * through, rather than sorting the tracked rows by appliedAt. Two
190
+ * migrations applied back-to-back inside the same install() call can
191
+ * land the exact same DateTime (Postgres' now() has finite, and on
192
+ * some platforms coarse, resolution — reproduced on real CI: two
193
+ * inserts a few microseconds apart still tied, and ORDER BY gives no
194
+ * guarantee which tied row sorts first), which silently rolled
195
+ * migrations back out of order. The manifest array has no such
196
+ * ambiguity: array position is exact. If the manifest isn't attached
197
+ * (no server restart re-attached it), both are silently skipped —
198
+ * can't call functions that don't exist in this process — matching
199
+ * deactivate()'s "destructive operations must never be blocked by a
200
+ * missing manifest," applied more strongly here since uninstall is far
201
+ * less reversible than deactivate. The actual structured-data cleanup
202
+ * (dropping the plugin's tables) runs only after confirmation, right
203
+ * before the registry row is deleted.
204
+ */
205
+ uninstall(pluginId: string, options?: {
206
+ confirmStructuredDataCleanup?: boolean;
207
+ }): Promise<{
208
+ snapshotGroupId: string | null;
209
+ }>;
210
+ /** Active plugins with an attached manifest declaring serializers —
211
+ * the public read path's per-request lookup (Session 112). Sync and
212
+ * in-memory: an active-but-unattached plugin (the standing S89
213
+ * no-boot-loader gap) is skipped exactly like its apiRoutes are. */
214
+ listActiveSerializerContributions(): Array<{
215
+ pluginId: string;
216
+ serializers: SerializerContribution;
217
+ }>;
218
+ /** Active plugins with an attached manifest declaring a handler for
219
+ * this specific event — the hook dispatcher's per-event lookup (S159).
220
+ * Sync and in-memory, same shape as listActiveSerializerContributions:
221
+ * an active-but-unattached plugin is skipped exactly like its apiRoutes
222
+ * and serializers are. */
223
+ listActiveHookContributions(event: HookEvent): Array<{
224
+ pluginId: string;
225
+ handler: HookHandler;
226
+ }>;
227
+ }