@kardalum/plugin-sdk 0.19.0 → 0.21.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 (552) hide show
  1. package/CHANGELOG.md +281 -0
  2. package/README.md +19 -0
  3. package/dist/admin-section-registry.d.ts +48 -1
  4. package/dist/admin-section-registry.js +90 -0
  5. package/dist/built-in-editor-ids.d.ts +1 -1
  6. package/dist/built-in-editor-ids.js +2 -20
  7. package/dist/built-in-settings-schemas.d.ts +10 -0
  8. package/dist/built-in-settings-schemas.js +86 -0
  9. package/dist/built-in-value-schemas.js +35 -0
  10. package/dist/built-ins.js +38 -7
  11. package/dist/capabilities.d.ts +11 -1
  12. package/dist/capabilities.js +101 -4
  13. package/dist/cli.d.ts +66 -0
  14. package/dist/cli.js +22 -0
  15. package/dist/consent-entry.d.ts +11 -0
  16. package/dist/consent-entry.js +18 -0
  17. package/dist/content-library.d.ts +102 -0
  18. package/dist/content-library.js +15 -0
  19. package/dist/content-list-extensions.d.ts +50 -0
  20. package/dist/content-list-extensions.js +11 -0
  21. package/dist/content-picker/page-picker-sheet.d.ts +15 -0
  22. package/dist/content-picker/page-picker-sheet.js +105 -0
  23. package/dist/content-picker/page-picker.d.ts +18 -0
  24. package/dist/content-picker/page-picker.js +20 -0
  25. package/dist/content-picker/page-tree.d.ts +25 -0
  26. package/dist/content-picker/page-tree.js +132 -0
  27. package/dist/data-type-plugin.d.ts +7 -1
  28. package/dist/datatype-validation.d.ts +4 -9
  29. package/dist/datatype-validation.js +147 -1
  30. package/dist/datatypes-entry.d.ts +1 -0
  31. package/dist/datatypes-entry.js +2 -0
  32. package/dist/entitlement-entry.d.ts +1 -1
  33. package/dist/entitlement-entry.js +1 -1
  34. package/dist/entitlement-gate.d.ts +14 -0
  35. package/dist/entitlement-gate.js +64 -7
  36. package/dist/entitlement-plan.d.ts +6 -0
  37. package/dist/entitlement-plan.js +10 -0
  38. package/dist/entitlement-types.d.ts +53 -12
  39. package/dist/entitlement.d.ts +31 -4
  40. package/dist/entitlement.js +58 -17
  41. package/dist/hook-entry.d.ts +5 -0
  42. package/dist/hook-entry.js +30 -0
  43. package/dist/host-entry.d.ts +7 -1
  44. package/dist/host-entry.js +14 -1
  45. package/dist/index.d.ts +67 -7
  46. package/dist/index.js +94 -6
  47. package/dist/mail.d.ts +34 -0
  48. package/dist/mail.js +1 -0
  49. package/dist/manifest-entry.d.ts +47 -4
  50. package/dist/manifest-entry.js +63 -2
  51. package/dist/manifest-schema.d.ts +993 -40
  52. package/dist/manifest-schema.js +516 -26
  53. package/dist/manifest.d.ts +1186 -62
  54. package/dist/manifest.js +8 -4
  55. package/dist/media/media-picker.js +31 -18
  56. package/dist/media/upload-error.d.ts +5 -1
  57. package/dist/media/upload-error.js +14 -2
  58. package/dist/media-library.d.ts +32 -0
  59. package/dist/media-library.js +15 -0
  60. package/dist/nested-field-host.d.ts +76 -0
  61. package/dist/nested-field-host.js +90 -0
  62. package/dist/notify.d.ts +12 -4
  63. package/dist/notify.js +1 -1
  64. package/dist/outbound.d.ts +47 -0
  65. package/dist/outbound.js +1 -0
  66. package/dist/plugin-context.d.ts +52 -0
  67. package/dist/plugin-context.js +27 -0
  68. package/dist/plugin-permissions.d.ts +18 -0
  69. package/dist/plugin-permissions.js +25 -0
  70. package/dist/plugin-screen-context.d.ts +262 -9
  71. package/dist/plugin-screen-context.js +56 -0
  72. package/dist/providers.d.ts +313 -0
  73. package/dist/providers.js +74 -0
  74. package/dist/read-all-pages.d.ts +5 -0
  75. package/dist/read-all-pages.js +3 -2
  76. package/dist/render-page.d.ts +15 -0
  77. package/dist/render-page.js +20 -0
  78. package/dist/richtext/block-panel.d.ts +12 -1
  79. package/dist/richtext/block-panel.js +36 -25
  80. package/dist/richtext/button-view.d.ts +11 -0
  81. package/dist/richtext/button-view.js +45 -0
  82. package/dist/richtext/content-guard.d.ts +4 -0
  83. package/dist/richtext/content-guard.js +27 -0
  84. package/dist/richtext/editor-handle.d.ts +34 -0
  85. package/dist/richtext/editor-handle.js +225 -0
  86. package/dist/richtext/extensions.d.ts +6 -0
  87. package/dist/richtext/extensions.js +16 -0
  88. package/dist/richtext/insert-menu.d.ts +6 -1
  89. package/dist/richtext/insert-menu.js +45 -22
  90. package/dist/richtext/item-attributes.d.ts +6 -0
  91. package/dist/richtext/item-attributes.js +19 -0
  92. package/dist/richtext/item-panel.d.ts +25 -0
  93. package/dist/richtext/item-panel.js +118 -0
  94. package/dist/richtext/item-view.d.ts +58 -0
  95. package/dist/richtext/item-view.js +172 -0
  96. package/dist/richtext/mark-form.d.ts +10 -0
  97. package/dist/richtext/mark-form.js +38 -0
  98. package/dist/richtext/paste-choice.d.ts +9 -0
  99. package/dist/richtext/paste-choice.js +13 -0
  100. package/dist/richtext/plugin-items.d.ts +72 -0
  101. package/dist/richtext/plugin-items.js +562 -0
  102. package/dist/richtext/plugin-mark-tooltips.d.ts +5 -0
  103. package/dist/richtext/plugin-mark-tooltips.js +44 -0
  104. package/dist/richtext/plugin-toolbar.d.ts +57 -0
  105. package/dist/richtext/plugin-toolbar.js +186 -0
  106. package/dist/richtext/rich-item-icons.d.ts +5 -0
  107. package/dist/richtext/rich-item-icons.js +42 -0
  108. package/dist/richtext/rich-items.d.ts +42 -0
  109. package/dist/richtext/rich-items.js +68 -0
  110. package/dist/richtext/rich-text-view-host.d.ts +24 -0
  111. package/dist/richtext/rich-text-view-host.js +11 -0
  112. package/dist/richtext/style-listbox.js +6 -4
  113. package/dist/richtext/toolbar-button.d.ts +16 -0
  114. package/dist/richtext/toolbar-button.js +9 -0
  115. package/dist/richtext/url-paste.d.ts +20 -0
  116. package/dist/richtext/url-paste.js +82 -0
  117. package/dist/richtext-html-entry.d.ts +5 -0
  118. package/dist/richtext-html-entry.js +11 -0
  119. package/dist/sdk-strings.d.ts +344 -0
  120. package/dist/sdk-strings.js +411 -0
  121. package/dist/sealing.d.ts +14 -0
  122. package/dist/sealing.js +1 -0
  123. package/dist/service-contract.d.ts +17 -0
  124. package/dist/service-contract.js +39 -0
  125. package/dist/services.d.ts +114 -0
  126. package/dist/services.js +1 -0
  127. package/dist/simple-storage-value-provider.js +24 -24
  128. package/dist/structured-storage-types.d.ts +429 -9
  129. package/dist/tailwind.js +10 -5
  130. package/dist/template-reads.d.ts +16 -0
  131. package/dist/template-reads.js +21 -0
  132. package/dist/testing-entry.d.ts +38 -0
  133. package/dist/testing-entry.js +173 -0
  134. package/dist/text-entry.d.ts +1 -0
  135. package/dist/text-entry.js +7 -0
  136. package/dist/tokens/system-dark.css +1 -0
  137. package/dist/tokens/tailwind-theme.css +7 -0
  138. package/dist/tokens/tokens.css +19 -3
  139. package/dist/tokens/tokens.json +13 -4
  140. package/dist/uploads.d.ts +43 -0
  141. package/dist/uploads.js +1 -0
  142. package/dist/user-library.d.ts +51 -0
  143. package/dist/user-library.js +15 -0
  144. package/dist/view-helpers.d.ts +18 -0
  145. package/dist/view-helpers.js +64 -0
  146. package/dist/views/asset-view.js +4 -1
  147. package/dist/views/content-list-preview.js +3 -1
  148. package/dist/views/content-list-settings-view.js +11 -7
  149. package/dist/views/content-list-view.d.ts +5 -3
  150. package/dist/views/content-list-view.js +243 -40
  151. package/dist/views/content-picker-view.d.ts +3 -0
  152. package/dist/views/content-picker-view.js +143 -0
  153. package/dist/views/crop-view.d.ts +4 -6
  154. package/dist/views/crop-view.js +22 -13
  155. package/dist/views/date-range-view.js +4 -1
  156. package/dist/views/file-upload-view.d.ts +5 -7
  157. package/dist/views/file-upload-view.js +16 -7
  158. package/dist/views/group-view.d.ts +8 -0
  159. package/dist/views/group-view.js +123 -0
  160. package/dist/views/html-view.js +7 -6
  161. package/dist/views/image-view.js +37 -19
  162. package/dist/views/link-view.d.ts +3 -0
  163. package/dist/views/link-view.js +150 -0
  164. package/dist/views/options-list-view.d.ts +3 -0
  165. package/dist/views/options-list-view.js +104 -0
  166. package/dist/views/repeatable-list-view.d.ts +3 -0
  167. package/dist/views/repeatable-list-view.js +113 -0
  168. package/dist/views/rich-text-view.d.ts +2 -0
  169. package/dist/views/rich-text-view.js +208 -35
  170. package/dist/views/suggest-key.d.ts +17 -0
  171. package/dist/views/suggest-key.js +55 -0
  172. package/dist/views/unreadable-rich-text.d.ts +17 -0
  173. package/dist/views/unreadable-rich-text.js +40 -0
  174. package/dist/visitors.d.ts +81 -0
  175. package/dist/visitors.js +1 -0
  176. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.d.ts +21 -0
  177. package/node_modules/@kardalum/api-schemas/dist/ai-app-hosts.js +39 -0
  178. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.d.ts +2 -0
  179. package/node_modules/@kardalum/api-schemas/dist/ai-app-redirects.js +31 -0
  180. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +334 -0
  181. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +254 -0
  182. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  183. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  184. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  185. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  186. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +11 -1
  187. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  188. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +8 -0
  189. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +38 -0
  190. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  191. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +144 -0
  192. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
  193. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
  194. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +137 -2
  195. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +178 -2
  196. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  197. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  198. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.d.ts +213 -0
  199. package/node_modules/@kardalum/api-schemas/dist/content-reads.schema.js +234 -0
  200. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  201. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  202. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  203. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  204. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  205. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  206. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  207. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  208. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  209. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  210. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.d.ts +11 -0
  211. package/node_modules/@kardalum/api-schemas/dist/contribution-issues.js +14 -0
  212. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +55 -13
  213. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +22 -10
  214. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  215. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
  216. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
  217. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  218. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  219. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +257 -15
  220. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +78 -5
  221. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  222. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
  223. package/node_modules/@kardalum/api-schemas/dist/experimental-points.d.ts +19 -0
  224. package/node_modules/@kardalum/api-schemas/dist/experimental-points.js +250 -0
  225. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.d.ts +29 -0
  226. package/node_modules/@kardalum/api-schemas/dist/form-protection-callers.js +31 -0
  227. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  228. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  229. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  230. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  231. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  232. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  233. package/node_modules/@kardalum/api-schemas/dist/html-scan.d.ts +22 -0
  234. package/node_modules/@kardalum/api-schemas/dist/html-scan.js +122 -0
  235. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.d.ts +48 -0
  236. package/node_modules/@kardalum/api-schemas/dist/html-start-tags.js +381 -0
  237. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +162 -48
  238. package/node_modules/@kardalum/api-schemas/dist/index.js +137 -30
  239. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  240. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  241. package/node_modules/@kardalum/api-schemas/dist/json-depth.d.ts +3 -0
  242. package/node_modules/@kardalum/api-schemas/dist/json-depth.js +20 -0
  243. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  244. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  245. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  246. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  247. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +226 -0
  248. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +409 -0
  249. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  250. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  251. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  252. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  253. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +490 -10
  254. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +53 -3
  255. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  256. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  257. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  258. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  259. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  260. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  261. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  262. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  263. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  264. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  265. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  266. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  267. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  268. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  269. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +38 -0
  270. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
  271. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  272. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  273. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  274. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  275. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  276. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +5 -0
  277. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +8 -0
  278. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  279. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  280. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +60 -0
  281. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +333 -0
  282. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  283. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  284. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  285. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  286. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  287. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  288. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  289. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  290. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  291. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.d.ts +87 -0
  292. package/node_modules/@kardalum/api-schemas/dist/page-audience.schema.js +44 -0
  293. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  294. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  295. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  296. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  297. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  298. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  299. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.d.ts +11 -0
  300. package/node_modules/@kardalum/api-schemas/dist/plugin-admin-slots.js +61 -0
  301. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  302. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  303. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  304. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  305. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +44 -0
  306. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +84 -0
  307. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.d.ts +136 -0
  308. package/node_modules/@kardalum/api-schemas/dist/plugin-content-slots.js +254 -0
  309. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.d.ts +22 -0
  310. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-checks.js +66 -0
  311. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.d.ts +130 -0
  312. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-document.js +173 -0
  313. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.d.ts +16 -0
  314. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-fetch.js +112 -0
  315. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.d.ts +70 -0
  316. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-schema.js +380 -0
  317. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.d.ts +3 -0
  318. package/node_modules/@kardalum/api-schemas/dist/plugin-contract-types.js +68 -0
  319. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  320. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  321. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +44 -2
  322. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +44 -2
  323. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +16 -5
  324. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  325. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  326. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +34 -0
  327. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +102 -0
  328. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +43 -0
  329. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +126 -0
  330. package/node_modules/@kardalum/api-schemas/dist/plugin-events.d.ts +24 -0
  331. package/node_modules/@kardalum/api-schemas/dist/plugin-events.js +53 -0
  332. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  333. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  334. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  335. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  336. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.d.ts +112 -0
  337. package/node_modules/@kardalum/api-schemas/dist/plugin-guards.js +118 -0
  338. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +119 -0
  339. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +216 -0
  340. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  341. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  342. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  343. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  344. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +46 -0
  345. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +41 -1
  346. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +304 -2
  347. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +220 -6
  348. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.d.ts +138 -0
  349. package/node_modules/@kardalum/api-schemas/dist/plugin-kept-parts.js +110 -0
  350. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  351. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  352. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  353. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  354. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +408 -14
  355. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +307 -23
  356. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +23 -1
  357. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +61 -3
  358. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  359. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  360. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +23 -1
  361. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +37 -1
  362. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  363. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  364. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  365. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  366. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  367. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  368. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +346 -0
  369. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +461 -0
  370. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  371. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  372. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.d.ts +638 -0
  373. package/node_modules/@kardalum/api-schemas/dist/plugin-rich-text.js +533 -0
  374. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  375. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  376. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  377. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  378. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.d.ts +36 -0
  379. package/node_modules/@kardalum/api-schemas/dist/plugin-service-call.js +32 -0
  380. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.d.ts +193 -0
  381. package/node_modules/@kardalum/api-schemas/dist/plugin-service-connections.js +123 -0
  382. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.d.ts +209 -0
  383. package/node_modules/@kardalum/api-schemas/dist/plugin-service-declarations.js +372 -0
  384. package/node_modules/@kardalum/api-schemas/dist/plugin-services.d.ts +90 -0
  385. package/node_modules/@kardalum/api-schemas/dist/plugin-services.js +204 -0
  386. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +352 -0
  387. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +409 -0
  388. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +347 -0
  389. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +976 -0
  390. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.d.ts +69 -0
  391. package/node_modules/@kardalum/api-schemas/dist/plugin-site-requests.js +149 -0
  392. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  393. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
  394. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.d.ts +5 -0
  395. package/node_modules/@kardalum/api-schemas/dist/plugin-styles.js +13 -0
  396. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  397. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  398. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.d.ts +96 -0
  399. package/node_modules/@kardalum/api-schemas/dist/plugin-uploads.js +185 -0
  400. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.d.ts +213 -0
  401. package/node_modules/@kardalum/api-schemas/dist/plugin-user-accounts.js +131 -0
  402. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.d.ts +54 -0
  403. package/node_modules/@kardalum/api-schemas/dist/plugin-view-kit.js +154 -0
  404. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.d.ts +37 -0
  405. package/node_modules/@kardalum/api-schemas/dist/plugin-visitor-points.js +124 -0
  406. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  407. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  408. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  409. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  410. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  411. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  412. package/node_modules/@kardalum/api-schemas/dist/render-cache.d.ts +126 -0
  413. package/node_modules/@kardalum/api-schemas/dist/render-cache.js +263 -0
  414. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +307 -4
  415. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +61 -0
  416. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  417. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.d.ts +14 -0
  418. package/node_modules/@kardalum/api-schemas/dist/rich-text-paste-hosts.js +108 -0
  419. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +71 -0
  420. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +540 -0
  421. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  422. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +394 -0
  423. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  424. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  425. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  426. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  427. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +201 -1
  428. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +36 -0
  429. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.d.ts +64 -0
  430. package/node_modules/@kardalum/api-schemas/dist/security-overview.schema.js +38 -0
  431. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +97 -8
  432. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +64 -1
  433. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +136 -0
  434. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +53 -2
  435. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.d.ts +724 -0
  436. package/node_modules/@kardalum/api-schemas/dist/sign-in-steps.js +408 -0
  437. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +386 -0
  438. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +618 -0
  439. package/node_modules/@kardalum/api-schemas/dist/site-consent.d.ts +77 -0
  440. package/node_modules/@kardalum/api-schemas/dist/site-consent.js +122 -0
  441. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  442. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  443. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  444. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  445. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +70 -0
  446. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +188 -0
  447. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +33 -0
  448. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +26 -1
  449. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  450. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  451. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  452. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  453. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  454. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  455. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +72 -1
  456. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +36 -3
  457. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  458. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  459. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.d.ts +482 -0
  460. package/node_modules/@kardalum/api-schemas/dist/visitor-accounts.js +380 -0
  461. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.d.ts +109 -0
  462. package/node_modules/@kardalum/api-schemas/dist/visitor-groups.js +62 -0
  463. package/node_modules/@kardalum/api-schemas/package.json +2 -0
  464. package/node_modules/@kardalum/design-tokens/dist/build-css.js +15 -1
  465. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +1 -0
  466. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +7 -0
  467. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +2 -1
  468. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  469. package/node_modules/@kardalum/design-tokens/dist/tokens.css +19 -3
  470. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
  471. package/node_modules/@kardalum/design-tokens/dist/tokens.js +18 -3
  472. package/node_modules/@kardalum/design-tokens/dist/tokens.json +13 -4
  473. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +5 -1
  474. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +38 -2
  475. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +17 -2
  476. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  477. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +625 -35
  478. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  479. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  480. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  481. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  482. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.d.ts +17 -0
  483. package/node_modules/@kardalum/plugin-package/dist/contract-fingerprint.js +39 -0
  484. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.d.ts +23 -0
  485. package/node_modules/@kardalum/plugin-package/dist/delivery/admin-styles.js +351 -0
  486. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  487. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  488. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  489. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  490. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +2 -0
  491. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
  492. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  493. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +47 -0
  494. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  495. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  496. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +40 -0
  497. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  498. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  499. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +3 -2
  500. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +3 -0
  501. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +3 -0
  502. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +76 -6
  503. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  504. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +99 -0
  505. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +6 -0
  506. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +6 -0
  507. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  508. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  509. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  510. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +5 -0
  511. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +316 -0
  512. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +40 -4
  513. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.d.ts +2 -0
  514. package/node_modules/@kardalum/plugin-package/dist/delivery/rich-text.js +173 -0
  515. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  516. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  517. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +150 -0
  518. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.d.ts +3 -0
  519. package/node_modules/@kardalum/plugin-package/dist/delivery/services-events.js +35 -0
  520. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.d.ts +3 -0
  521. package/node_modules/@kardalum/plugin-package/dist/delivery/sign-in-steps.js +71 -0
  522. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  523. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +69 -0
  524. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  525. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  526. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +17 -0
  527. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.d.ts +3 -0
  528. package/node_modules/@kardalum/plugin-package/dist/delivery/user-accounts.js +36 -0
  529. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.d.ts +3 -0
  530. package/node_modules/@kardalum/plugin-package/dist/delivery/visitor-points.js +33 -0
  531. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +8 -2
  532. package/node_modules/@kardalum/plugin-package/dist/index.js +7 -1
  533. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  534. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  535. package/node_modules/@kardalum/plugin-package/dist/public-suffix.d.ts +7 -0
  536. package/node_modules/@kardalum/plugin-package/dist/public-suffix.js +23 -0
  537. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.d.ts +1 -0
  538. package/node_modules/@kardalum/plugin-package/dist/rich-text-summary.js +27 -0
  539. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.d.ts +2 -0
  540. package/node_modules/@kardalum/plugin-package/dist/stylesheet-load-hook.js +28 -0
  541. package/node_modules/@kardalum/plugin-package/package.json +4 -0
  542. package/node_modules/@kardalum/ui/dist/components/select.d.ts +6 -0
  543. package/node_modules/@kardalum/ui/dist/components/select.js +7 -0
  544. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  545. package/node_modules/@kardalum/ui/dist/components/textarea.d.ts +6 -0
  546. package/node_modules/@kardalum/ui/dist/components/textarea.js +7 -0
  547. package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
  548. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
  549. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
  550. package/node_modules/@kardalum/ui/dist/index.d.ts +2 -0
  551. package/node_modules/@kardalum/ui/dist/index.js +2 -0
  552. package/package.json +25 -3
@@ -1,15 +1,30 @@
1
1
  import type { ComponentType } from "react";
2
- import type { CreateDocumentTypeRequest, PluginDocsPage, PluginInstallDeclaration, PluginLabel, PluginVendorServiceDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
2
+ import type { DataTypeValidatorIssue, RichTextButton, RichTextMarkDeclaration, RichTextNodeDeclaration } from "@kardalum/api-schemas";
3
+ import type { AdminSlotPlace, BadgeTone, PluginActionOfferTarget, PluginDataTypeConfig, PluginDocumentType, PluginDocsPage, PluginNotificationKind, PluginInstallDeclaration, PluginLabel, PluginSettingField, PluginUserAccess, PluginUserField, PluginVendorServiceDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
3
4
  export type { InstallChoice, InstallOption, InstallStep, PluginInstallDeclaration, ResolvedInstallAnswers } from "@kardalum/api-schemas";
5
+ export type { PluginDataTypeConfig } from "@kardalum/api-schemas";
4
6
  import type { ThemeTokenOverrides } from "@kardalum/design-tokens";
5
7
  import { VIEW_BEARING_CONTRIBUTIONS, declaresClientBundle } from "@kardalum/plugin-package/reference";
6
8
  import type { ZodType } from "zod";
7
9
  import type { DataTypePlugin } from "./data-type-plugin.js";
10
+ import type { IconName } from "./icon-name.js";
8
11
  import type { BUILT_IN_RAIL_SECTIONS } from "./manifest-schema.js";
9
- import type { PluginApiRouteContext, PublishedContent, ScopedStructuredStorage } from "./structured-storage-types.js";
12
+ import type { PluginAddressLookup, PluginApiRouteContext, PluginRenderCache, PluginRenderPage, PluginServerContextBase, ScopedStructuredStorage } from "./structured-storage-types.js";
13
+ import type { PluginMail } from "./mail.js";
14
+ import type { OutboundRequestsContribution, PluginOutbound } from "./outbound.js";
15
+ import type { PluginSealing, SealedValueContribution } from "./sealing.js";
16
+ import type { PluginUserFields } from "./user-library.js";
17
+ import type { ExposedServiceContribution, PluginEventContribution, PluginEventKey, PluginEvents, PluginServices, ServiceContractContribution, UsedServiceContribution } from "./services.js";
18
+ export type * from "./services.js";
19
+ import type { PluginVisitor, PluginVisitorAccountSectionContribution, PluginVisitorDataContribution, PluginVisitorGroupContribution, PluginVisitorIdentityContribution, PluginVisitors, VisitorGroupHookPayload, VisitorHookPayload, VisitorSignInHookPayload } from "./visitors.js";
20
+ export type * from "./visitors.js";
21
+ import type { RouteUploadsDeclaration } from "./uploads.js";
22
+ export type { PluginKeepResult, PluginUploadedFile, PluginUploads, RouteUploadsDeclaration } from "./uploads.js";
23
+ export type { GetPublishedContentOptions, ListPublishedPagesOptions, PageReadAsOptions, PageAddresses, PageAddressTarget, PageAtAddressAnswer, PluginAddressLookup, PluginServerContextBase, PluginSimpleStorage, PublishedContent, PublishedPageItem, PublishedPagesPage, SiteOfHost, SiteOfHostOptions } from "./structured-storage-types.js";
24
+ export type { ListPublishedOptions, PublishedFilter, PublishedListItem, PublishedListPage, PublishedSearchPage, SearchPublishedOptions } from "@kardalum/api-schemas";
10
25
  import type { Entitlement, PluginTaskContext } from "./entitlement-types.js";
11
- import type { PluginNotify } from "./notify.js";
12
- import type { PluginVendorService } from "./vendor-service.js";
26
+ import type { AuditActorKind, GuardFailureMode, GuardOperation, GuardPoint, GuardSubject, HeldEmbedRequest, PageAddress, PageAddressState, PageCacheAnswer, PageHeadEntry, PluginConsentView, PluginHeldEmbed, PluginContentAccess, PluginFieldInfo, PluginMediaAccess, SettingsChangeArea, SiteFallbackAnswer, RequestGuardAnswer, SiteRequestSurface, TemplateBlockOnFailure, TemplateBlockWrapElement, TemplateData, TemplateFilterOnFailure } from "@kardalum/api-schemas";
27
+ import type { ConsentToolContribution, MailSenderContribution, MediaStoreContribution, PluginSettingsReader, ProtectionProviderContribution, SearchProviderContribution, SecretDeclaration, SignInProviderContribution, SignInStepContribution } from "./providers.js";
13
28
  /**
14
29
  * The seven plugin types. Since S268 this is a marketplace listing and
15
30
  * filter label only: it does not decide which contributions a plugin may
@@ -120,40 +135,384 @@ export interface PluginMigrationHooks {
120
135
  afterMigration?: (from: DatabaseDialect, to: DatabaseDialect) => void | Promise<void>;
121
136
  validateMigration?: (from: DatabaseDialect, to: DatabaseDialect) => PluginMigrationValidation | Promise<PluginMigrationValidation>;
122
137
  }
123
- /** The events a plugin can hook. The hook engine (S159) actually FIRES
124
- * only three of these: content:afterPublish (including rollbacks),
125
- * content:afterTrash, content:afterRestore, with the
126
- * ContentLifecycleHookPayload shape declared below; every other event in
127
- * this catalog is declared for forward compatibility and stays inert. */
128
- export type HookEvent = "content:beforeSave" | "content:afterSave" | "content:beforePublish" | "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:beforeDelete" | "media:afterUpload" | "user:afterLogin" | "api:beforeResponse";
138
+ /** The events a plugin can hook. Every event in this catalog fires; none is inert (M32 F4c).
139
+ * The content events: content:afterSave (ContentSaveHookPayload), content:afterMove
140
+ * (ContentMoveHookPayload), and content:afterPublish (including rollbacks), content:afterTrash,
141
+ * content:afterRestore and content:afterUnpublish (ContentLifecycleHookPayload). The media events
142
+ * (MediaHookPayload), user:afterCreate and user:afterDelete (UserHookPayload), user:afterLogin
143
+ * (UserLoginHookPayload), settings:afterChange (SettingsHookPayload), the five plugin lifecycle
144
+ * events (PluginLifecycleHookPayload) and audit:afterRecord (AuditHookPayload).
145
+ * M35 B2: eleven more, experimental: the content model, people, site, page view and system events. */
146
+ export type HookEvent = "content:afterSave" | "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:afterUnpublish" | "content:afterMove" | "media:afterUpload" | "media:afterTrash" | "media:afterDelete" | "user:afterLogin" | "user:afterCreate" | "user:afterDelete" | "settings:afterChange" | "plugin:afterInstall" | "plugin:afterUninstall" | "plugin:afterUpdate" | "plugin:afterActivate" | "plugin:afterDeactivate" | "audit:afterRecord" | "content:afterSort" | "content:afterAccessChange" | "documentType:afterChange" | "dataType:afterChange" | "role:afterChange" | "user:afterChange" | "site:afterAddressChange" | "site:afterPageViews" | "system:afterStart" | "system:beforeShutdown" | "system:afterError" | "visitor:afterRegister" | "visitor:afterConfirm" | "visitor:afterSignIn" | "visitor:afterGroupChange" | "visitor:afterDelete";
129
147
  export interface ContentLifecycleHookPayload {
130
- event: "content:afterPublish" | "content:afterTrash" | "content:afterRestore";
148
+ event: "content:afterPublish" | "content:afterTrash" | "content:afterRestore" | "content:afterUnpublish";
131
149
  contentId: string;
132
150
  path: string;
133
151
  documentTypeId: string;
134
152
  occurredAt: string;
153
+ /** M31.5 D (D7): content:afterUnpublish only: every culture that call took off the site. */
154
+ cultures?: string[];
135
155
  }
136
- export interface PluginHookContext {
137
- structuredStorage: ScopedStructuredStorage;
138
- getPublishedContent(contentId: string): Promise<PublishedContent | null>;
139
- /** S284b: the host's latest licence verdict for this plugin
140
- * (`kind: "verdict"`), `kind: "exempt"` on a non-production install,
141
- * `kind: "none"` when the host holds no verdict. Check it with
142
- * `requireEntitlement` from `@kardalum/plugin-sdk/entitlement`; a hook
143
- * that throws its EntitlementError is skipped with one log line. */
144
- entitlement: Entitlement;
145
- /** S318: true while the plugin's licence term is lapsed: the host refuses its writes (403 plugin_read_only), so a route or hook can skip them. Set by the host; absent reads as false. */
146
- readOnly?: boolean;
147
- /** S314n3: sends a notification to people in the admin. Present only for a plugin that
148
- * declares `contributions.notifications: true` and is active; a refusal throws
149
- * NotificationRefusedError (check it with `isNotificationRefusedError`). */
150
- notify?: PluginNotify;
151
- /** S320: calls the plugin's declared vendor service with a 5-minute licence
152
- * token. Present only when the manifest declares `vendorService`. */
153
- vendorService?: PluginVendorService;
156
+ /** M32 F3: a user was created or deleted. `name` is the stored name, null for a user with none (as the
157
+ * users API answers it). `actorId` is the signed-in user who did it, null when a key or nobody acted. */
158
+ export interface UserHookPayload {
159
+ event: "user:afterCreate" | "user:afterDelete";
160
+ userId: string;
161
+ name: string | null;
162
+ role: string;
163
+ actorId: string | null;
164
+ occurredAt: string;
165
+ }
166
+ /** M32 F4b (D55): a person signed in, with a password or through a sign-in provider. Fired after the
167
+ * session is issued, never for a refresh or a link. `provider` is the provider key
168
+ * (`<pluginId>/<providerId>`) for a provider sign-in and null for a password. Never an email, an
169
+ * address or a token. */
170
+ export interface UserLoginHookPayload {
171
+ event: "user:afterLogin";
172
+ userId: string;
173
+ method: "password" | "provider";
174
+ provider: string | null;
175
+ /** M35 U3a (D12, experimental): the steps passed, `<pluginId>/<stepId>`; absent when none was asked. */
176
+ steps?: string[];
177
+ occurredAt: string;
178
+ }
179
+ /** M32 F3: a media item was uploaded, moved to the trash or deleted for good. */
180
+ export interface MediaHookPayload {
181
+ event: "media:afterUpload" | "media:afterTrash" | "media:afterDelete";
182
+ mediaId: string;
183
+ mimeType: string;
184
+ size?: number;
185
+ occurredAt: string;
186
+ }
187
+ /** M32 F3: a settings area changed. `keys` names what changed, never the values. M32 F4d (D6): in
188
+ * the `plugin` area, `pluginId` names the plugin whose settings changed and `keys` its field ids.
189
+ * M32 H: in the `mail` area, a form reply switch carries the plugin's `pluginId` and `keys: ["on"]`.
190
+ * M35 U1: in the `server` area, the form protection chosen for one plugin's visitor sends carries that
191
+ * plugin's `pluginId` and `keys: ["formProtectionCallers"]`; it is not a change to its settings. */
192
+ export interface SettingsHookPayload {
193
+ event: "settings:afterChange";
194
+ area: SettingsChangeArea;
195
+ keys: string[];
196
+ siteId?: string;
197
+ pluginId?: string;
198
+ occurredAt: string;
199
+ }
200
+ /** M32 F3, F4c: a plugin was installed, uninstalled, updated, activated or deactivated. */
201
+ export interface PluginLifecycleHookPayload {
202
+ event: "plugin:afterInstall" | "plugin:afterUninstall" | "plugin:afterUpdate" | "plugin:afterActivate" | "plugin:afterDeactivate";
203
+ pluginId: string;
204
+ version: string;
205
+ /** plugin:afterUpdate only: the version it was updated from. */
206
+ fromVersion?: string;
207
+ occurredAt: string;
208
+ }
209
+ /** M32 F4c: a page was saved. Identifiers only, never a field value. */
210
+ export interface ContentSaveHookPayload {
211
+ event: "content:afterSave";
212
+ contentId: string;
213
+ path: string;
214
+ documentTypeId: string;
215
+ version: number;
216
+ /** The language the save wrote, null for a save of the shared values only. */
217
+ culture: string | null;
218
+ /** True for a page's first version (a create or a copy). */
219
+ created: boolean;
220
+ occurredAt: string;
221
+ }
222
+ /** M32 F4c: a page was moved or renamed. */
223
+ export interface ContentMoveHookPayload {
224
+ event: "content:afterMove";
225
+ contentId: string;
226
+ documentTypeId: string;
227
+ path: string;
228
+ previousPath: string;
229
+ reason: "move" | "rename";
230
+ /** M35 B2 (experimental, evidence 93): the page's address in every language of the site as it was
231
+ * before the move, read just before the write; null when no plugin hooked the move or the old
232
+ * place had no address a visitor reaches. Absent when the site has more than EVENT_ADDRESSES_MAX
233
+ * languages (never a cut list), and from an event an older server raised: read the old place then.
234
+ * @experimental */
235
+ previousAddresses?: PageAddressState[] | null;
236
+ occurredAt: string;
237
+ }
238
+ /** M32 F4c: an audit entry was recorded. No email, address or person's name. */
239
+ export interface AuditHookPayload {
240
+ event: "audit:afterRecord";
241
+ at: string;
242
+ requestId: string;
243
+ actorKind: AuditActorKind;
244
+ userId: string | null;
245
+ userRole: string | null;
246
+ keyId: string | null;
247
+ keyName: string | null;
248
+ pluginId: string | null;
249
+ method: string;
250
+ route: string;
251
+ action: string | null;
252
+ targetType: string | null;
253
+ targetId: string | null;
254
+ status: number;
255
+ /** Always `{}` in release 1. Route summaries are free-form and some record an email, and no
256
+ * checked list of keys exists yet, so none is handed over; a later release may add allowed keys. */
257
+ summary: Record<string, unknown> | null;
258
+ }
259
+ /** Who made a write the event reports: the audit's actor kinds, and the user, key or plugin id (null for the site itself).
260
+ * @experimental */
261
+ export interface HookActor {
262
+ actorKind: AuditActorKind;
263
+ actorId: string | null;
264
+ }
265
+ /** M35 B2 (experimental): the order of a parent's children, or of the sites, changed.
266
+ * @experimental */
267
+ export interface ContentSortHookPayload extends HookActor {
268
+ event: "content:afterSort";
269
+ /** Null for the top level (the sites). */
270
+ parentId: string | null;
271
+ parentPath: string | null;
272
+ /** How many pages the new order named. */
273
+ count: number;
274
+ occurredAt: string;
275
+ }
276
+ /** M35 B2 (experimental): who may read or change a page was changed. Never the grants themselves.
277
+ * @experimental */
278
+ export interface ContentAccessHookPayload extends HookActor {
279
+ event: "content:afterAccessChange";
280
+ contentId: string;
281
+ path: string;
282
+ /** M35 U2b: "audience" when who may see the page on the public site changed. */
283
+ change: "permissions" | "restrictions" | "audience";
284
+ occurredAt: string;
285
+ }
286
+ /** M35 B2 (experimental): a document type was created, changed or deleted. Field ids only, never a setting's value.
287
+ * @experimental */
288
+ export interface DocumentTypeHookPayload extends HookActor {
289
+ event: "documentType:afterChange";
290
+ documentTypeId: string;
291
+ name: string;
292
+ kind: "page" | "element" | "media";
293
+ change: "create" | "update" | "delete";
294
+ /** The ids of the fields added, removed or changed, sorted, at most DOCUMENT_TYPE_EVENT_FIELDS_MAX; empty for a delete. */
295
+ fieldIds: string[];
296
+ occurredAt: string;
297
+ }
298
+ /** M35 B2 (experimental): a data type was created, changed or deleted. Never its settings.
299
+ * @experimental */
300
+ export interface DataTypeHookPayload extends HookActor {
301
+ event: "dataType:afterChange";
302
+ dataTypeId: string;
303
+ name: string;
304
+ editorId: string;
305
+ change: "create" | "update" | "delete";
306
+ occurredAt: string;
307
+ }
308
+ /** M35 B2 (experimental): a role was created, changed or deleted, with the actions it gained and lost.
309
+ * @experimental */
310
+ export interface RoleHookPayload extends HookActor {
311
+ event: "role:afterChange";
312
+ roleId: string;
313
+ label: string;
314
+ change: "create" | "update" | "delete";
315
+ /** Sorted, at most ROLE_EVENT_ACTIONS_MAX each. */
316
+ actionsAdded: string[];
317
+ actionsRemoved: string[];
318
+ occurredAt: string;
319
+ }
320
+ /** M35 B2 (experimental): a user's role changed, the account was disabled or enabled, or (M35 U2a, carried
321
+ * from 35-U1) a plugin's account fields of the person changed. The user event's own shape: `name` is the
322
+ * stored name (null for none), never an email, an address or a field's value.
323
+ * @experimental */
324
+ export interface UserChangeHookPayload {
325
+ event: "user:afterChange";
326
+ userId: string;
327
+ name: string | null;
328
+ role: string;
329
+ change: "role" | "disabled" | "enabled" | "fields";
330
+ /** The role before a role change; null for the other changes. */
331
+ previousRole: string | null;
332
+ /** For a `fields` change, the plugin whose fields changed; null for the other changes. */
333
+ pluginId: string | null;
334
+ /** For a `fields` change, the ids of the fields whose value changed, sorted; empty for the other changes. Never a value. */
335
+ fieldIds: string[];
336
+ actorId: string | null;
337
+ occurredAt: string;
338
+ }
339
+ /** M35 B2 (experimental, evidence 104): a site's addresses changed without a page move (its domains,
340
+ * or which site is the default). The site root's address in every language before and after.
341
+ * @experimental */
342
+ export interface SiteAddressHookPayload extends HookActor {
343
+ event: "site:afterAddressChange";
344
+ siteId: string;
345
+ change: "hostnames" | "default";
346
+ previousAddresses: PageAddressState[] | null;
347
+ addresses: PageAddressState[] | null;
348
+ occurredAt: string;
349
+ }
350
+ /** M35 B2 (experimental, W4): one page and language's views in a batch.
351
+ * @experimental */
352
+ export interface PageViewCount {
353
+ pageId: string;
354
+ path: string;
355
+ documentTypeId: string;
356
+ siteId: string | null;
357
+ culture: string;
358
+ views: number;
359
+ /** Of `views`, those whose user agent read as a bot, a script or nothing. */
360
+ likelyBotViews: number;
361
+ }
362
+ /** M35 B2 (experimental, W4): the public pages served by this instance since the last batch,
363
+ * counted. Never an address, agent, cookie, referrer or the time of one view.
364
+ * @experimental */
365
+ export interface SitePageViewsHookPayload {
366
+ event: "site:afterPageViews";
367
+ instanceId: string;
368
+ /** The first counted view's time and the batch's end. */
369
+ from: string;
370
+ to: string;
371
+ pages: PageViewCount[];
372
+ /** Views past PAGE_VIEW_BATCH_PAGES_MAX pairs, counted but not itemised. */
373
+ otherViews: number;
374
+ occurredAt: string;
375
+ }
376
+ /** M35 B2 (experimental, W31): this server instance answers requests. Once per process.
377
+ * @experimental */
378
+ export interface SystemStartHookPayload {
379
+ event: "system:afterStart";
380
+ /** This process's boot id: the same in every event it raises, new at every start. */
381
+ instanceId: string;
382
+ /** The running Kardalum version. */
383
+ version: string;
384
+ occurredAt: string;
385
+ }
386
+ /** M35 B2 (experimental, W31): this instance is shutting down; handlers get HOOK_DRAIN_WAIT_MS. Never durable.
387
+ * @experimental */
388
+ export interface SystemShutdownHookPayload {
389
+ event: "system:beforeShutdown";
390
+ instanceId: string;
391
+ occurredAt: string;
392
+ }
393
+ /** M35 B2 (experimental, W31): a request was answered with a 5xx status. Never the message, stack, body or query.
394
+ * @experimental */
395
+ export interface SystemErrorHookPayload {
396
+ event: "system:afterError";
397
+ requestId: string;
398
+ method: string;
399
+ /** The route pattern (`/api/manage/v1/content/:id`), "" when no route matched; at most SYSTEM_ERROR_ROUTE_MAX characters. */
400
+ route: string;
401
+ status: number;
402
+ /** The error's class name (errorClassOf), "Error" when unreadable. */
403
+ errorClass: string;
404
+ /** Errors not raised since the last event because of SYSTEM_ERROR_EVENTS_PER_MINUTE. */
405
+ suppressed: number;
406
+ occurredAt: string;
407
+ }
408
+ /** Every payload the hook engine hands a handler. */
409
+ export type HookPayload = ContentLifecycleHookPayload | ContentSaveHookPayload | ContentMoveHookPayload | UserHookPayload | UserLoginHookPayload | MediaHookPayload | SettingsHookPayload | PluginLifecycleHookPayload | AuditHookPayload | ContentSortHookPayload | ContentAccessHookPayload | DocumentTypeHookPayload | DataTypeHookPayload | RoleHookPayload | UserChangeHookPayload | SiteAddressHookPayload | SitePageViewsHookPayload | SystemStartHookPayload | SystemShutdownHookPayload | SystemErrorHookPayload | VisitorHookPayload | VisitorSignInHookPayload | VisitorGroupHookPayload;
410
+ export interface PluginHookContext extends PluginServerContextBase, PluginAddressLookup {
411
+ /** M33 K19: the id of this occurrence of the event, minted once when it is raised: the same for
412
+ * every plugin that hears it and on every replay of a durable event, so a handler recognises an
413
+ * event it already handled. An id of the occurrence only; it grants nothing. */
414
+ eventId: string;
415
+ /** M33 K11: one email to one person, of a kind the manifest declares under `mailKinds` and the
416
+ * site owner switched on. Present only for a plugin that declares `mailKinds`. */
417
+ mail?: PluginMail;
418
+ /** M33 K16: calls web addresses through the server's checked connection (`check`, `request`). Present only
419
+ * for a plugin that declares `outboundRequests`; a call after the plugin is switched off answers `inactive`. */
420
+ outbound?: PluginOutbound;
421
+ /** M33 K17: seals values the plugin makes under a key of its own for each declared kind (`seal`, `open`).
422
+ * Present only for a plugin that declares `sealedValues`; a call after the plugin is switched off answers `inactive`. */
423
+ sealing?: PluginSealing;
424
+ /** @experimental M35 U1 (W6): this plugin's own account fields. Present only when the manifest declares userFields. */
425
+ userFields?: PluginUserFields;
426
+ /** @experimental M35 B1a: another plugin's services, for the contracts this plugin uses. */
427
+ services?: PluginServices;
428
+ /** @experimental M35 B1a: this plugin's own declared events. */
429
+ events?: PluginEvents;
430
+ /** @experimental M35 P4 (W53): renders a published page to HTML (PluginRenderPage). Set by the host. */
431
+ renderPage?: PluginRenderPage;
432
+ /** @experimental M35 P4 (W32): the core's render cache (PluginRenderCache). Set by the host. */
433
+ renderCache?: PluginRenderCache;
434
+ /** @experimental M35 U2b (W8): the site's visitor accounts by id. Present only when the manifest declares visitorIdentity. */
435
+ visitors?: PluginVisitors;
436
+ }
437
+ /** M33 K1: what a site fallback's `resolve` receives. Today the members every server context has;
438
+ * a member a fallback must not get (an event id, a caller) is declared on the other contexts only. */
439
+ export interface SiteFallbackContext extends PluginServerContextBase {
154
440
  }
155
441
  export type HookHandler = (payload: unknown, context?: PluginHookContext) => void | Promise<void>;
156
- export type PluginHooks = Partial<Record<HookEvent, HookHandler>>;
442
+ /** M33 K18: a hook the host keeps across restarts. Each raised event is stored in the core outbox
443
+ * until the handler settles, tried up to 4 times, delivered at least once (a handler may see one
444
+ * event twice: tell them apart by `context.eventId`). */
445
+ export type DurableHookEntry = {
446
+ handler: HookHandler;
447
+ durable: true;
448
+ };
449
+ /** M33 K18: a `hooks` value: a handler, or a durable one. */
450
+ export type PluginHookEntry = HookHandler | DurableHookEntry;
451
+ /** M35 B1a (experimental): another plugin's events are heard under `<plugin id>:<event name>`, plain or durable. */
452
+ export type PluginHooks = Partial<Record<HookEvent, PluginHookEntry>> & {
453
+ [event: PluginEventKey]: PluginHookEntry | undefined;
454
+ };
455
+ /** M35 B2 (experimental, W1): what a guard is asked. A frozen copy made for this guard alone.
456
+ * @experimental */
457
+ export interface ContentGuardRequest {
458
+ point: GuardPoint;
459
+ operation: GuardOperation;
460
+ /** Null for a create. */
461
+ contentId: string | null;
462
+ documentTypeId: string;
463
+ /** The document type's name, as `contentAccess` and `documentTypes` name it. */
464
+ documentType: string;
465
+ /** The page's tree path now; null for a create. */
466
+ path: string | null;
467
+ /** Where the page goes: a create, a copy, a move or a restore under a parent (parentId null for the top level). */
468
+ destination: {
469
+ parentId: string | null;
470
+ parentPath: string | null;
471
+ } | null;
472
+ /** A save that renames the page, and so moves it and its subtree. */
473
+ renames: boolean;
474
+ culture: string | null;
475
+ /** publishAll and an unpublish of every language: the languages; otherwise null. */
476
+ cultures: readonly string[] | null;
477
+ /** A publish: the version it puts live. */
478
+ version: number | null;
479
+ /** create, save, publish and publishAll only, and only for a plugin whose contentAccess declares
480
+ * content.read for this type: the values being saved, or the version being published (the default
481
+ * language's for publishAll), private fields included, as context.content would read them. */
482
+ values?: Readonly<Record<string, unknown>>;
483
+ subject: Readonly<GuardSubject>;
484
+ requestedAt: string;
485
+ }
486
+ /** Allow, or refuse with a snake_case code and a message (plain text, or a map with `en`).
487
+ * @experimental */
488
+ export type GuardAnswer = {
489
+ allow: true;
490
+ } | {
491
+ allow: false;
492
+ code: string;
493
+ message: string | Readonly<Record<string, string>>;
494
+ };
495
+ /** M35 B2: what a guard's handler receives beside the request.
496
+ * @experimental */
497
+ export interface PluginGuardContext extends PluginServerContextBase {
498
+ /** Aborted when GUARD_TIME_MS has passed: the write no longer waits for this answer. */
499
+ signal: AbortSignal;
500
+ /** Present only for a plugin that declares `outboundRequests`. */
501
+ outbound?: PluginOutbound;
502
+ }
503
+ /** M35 B2: a guard's handler.
504
+ * @experimental */
505
+ export type GuardHandler = (request: ContentGuardRequest, context: PluginGuardContext) => GuardAnswer | Promise<GuardAnswer>;
506
+ /** M35 B2 (experimental): one guard. At most one per point. `documentTypes` (names) limits it to
507
+ * those types; `onFailure` says what a timeout, a throw or an answer out of shape means
508
+ * (`refuse`, the default, or `allow`).
509
+ * @experimental */
510
+ export interface GuardContribution {
511
+ point: GuardPoint;
512
+ handler: GuardHandler;
513
+ documentTypes?: string[];
514
+ onFailure?: GuardFailureMode;
515
+ }
157
516
  /** A slot's label: a map of language code to text, `en` required (spec D5).
158
517
  * Each key is a language code such as `en`, `de` or `pt-BR`. The admin
159
518
  * shows the active language's text, else English; `resolveLabel` in
@@ -228,6 +587,150 @@ export interface DashboardWidgetContribution {
228
587
  * plugin cannot declare an action in another's namespace or in core's. */
229
588
  action: string;
230
589
  }
590
+ /** M32 F3 (D1): a panel shown beside an existing page's editor. Its `view` reads the page through
591
+ * `usePluginEditorPanel()`. `documentTypes` limits it to pages of those document types; leave it
592
+ * out for every type. `id` is 1 to 40 lower-case letters, digits and "-", starting with a letter. */
593
+ export interface EditorPanelContribution {
594
+ id: string;
595
+ label: SlotLabel;
596
+ /** The named permission action a subject must hold to see the panel, prefixed with this plugin's own id. */
597
+ action: string;
598
+ documentTypes?: string[];
599
+ view: ComponentType;
600
+ }
601
+ /** M32 F3 (D7): an item in a content tree row's menu. Its `view` opens in a dialog and reads the
602
+ * row through `usePluginTreeAction()`. The same rules as an editor panel. */
603
+ export interface TreeActionContribution {
604
+ id: string;
605
+ label: SlotLabel;
606
+ /** The named permission action a subject must hold to see the item, prefixed with this plugin's own id. */
607
+ action: string;
608
+ documentTypes?: string[];
609
+ view: ComponentType;
610
+ }
611
+ /** M35 C2 (W5, experimental): one row a content slot function is handed. A frozen copy; no field value.
612
+ * @experimental */
613
+ export interface ContentSlotRow {
614
+ id: string;
615
+ path: string;
616
+ name: string;
617
+ parentId: string | null;
618
+ documentTypeId: string;
619
+ /** The document type's name, as `documentTypes` names it. */
620
+ documentType: string;
621
+ /** The content language the screen shows. */
622
+ culture: string;
623
+ }
624
+ /** M35 C2: what a column's or a badge's `values` receives: at most CONTENT_SLOT_ROWS_MAX rows the person may
625
+ * read, of the entry's documentTypes when it names some, and the admin's language for the plugin's own words.
626
+ * @experimental */
627
+ export interface ContentSlotInput {
628
+ rows: ReadonlyArray<Readonly<ContentSlotRow>>;
629
+ /** The content language the screen shows (the default language where none is given). */
630
+ culture: string;
631
+ /** The admin's language, for the plugin's own words. */
632
+ language: string;
633
+ }
634
+ /** M35 C2: a list filter's `match` input: the rows of one scanned page and the chosen option value.
635
+ * @experimental */
636
+ export interface ListFilterInput extends ContentSlotInput {
637
+ value: string;
638
+ }
639
+ /** M35 C2: the context of a content slot call. `signal` is aborted once CONTENT_SLOT_CALL_TIME_MS has passed.
640
+ * A value is read from the plugin's own storage or published content, never fetched from outside while a
641
+ * list waits.
642
+ * @experimental */
643
+ export interface PluginContentSlotContext extends PluginServerContextBase {
644
+ signal: AbortSignal;
645
+ }
646
+ /** M35 C2 (experimental): a column of the Content List table. `values` answers plain text per row id (at most
647
+ * CONTENT_COLUMN_TEXT_MAX characters) or null; the core trims, cuts and drops what is not text.
648
+ * @experimental */
649
+ export interface ContentColumnContribution {
650
+ id: string;
651
+ label: SlotLabel;
652
+ /** The named permission action a subject must hold to see the column, prefixed with this plugin's own id. */
653
+ action: string;
654
+ documentTypes?: string[];
655
+ values: (input: ContentSlotInput, context: PluginContentSlotContext) => Record<string, string | null> | Promise<Record<string, string | null>>;
656
+ }
657
+ /** M35 C2 (experimental): a badge on rows of the content tree. `values` answers `{ text, tone? }` per row id
658
+ * (text at most TREE_BADGE_TEXT_MAX characters, `tone` one of BADGE_TONES, `neutral` when left out) or null.
659
+ * The text always carries the meaning; the tone only colours it.
660
+ * @experimental */
661
+ export interface TreeBadgeContribution {
662
+ id: string;
663
+ label: SlotLabel;
664
+ /** The named permission action a subject must hold to see the badge, prefixed with this plugin's own id. */
665
+ action: string;
666
+ documentTypes?: string[];
667
+ values: (input: ContentSlotInput, context: PluginContentSlotContext) => Record<string, {
668
+ text: string;
669
+ tone?: BadgeTone;
670
+ } | null> | Promise<Record<string, {
671
+ text: string;
672
+ tone?: BadgeTone;
673
+ } | null>>;
674
+ }
675
+ /** M35 C2 (experimental): a choice in the Content List table's filter. `options` are 1 to
676
+ * LIST_FILTER_OPTIONS_MAX choices (each value unique, the id rule); `match` answers the ids of the rows it
677
+ * is handed that match the chosen value. The core scans the list a page at a time and bounds the scan.
678
+ * `match` answers at most LIST_FILTER_ANSWER_MAX (200) ids; a longer array fails the call (503
679
+ * `list_filter_unavailable`), so answer only ids of the rows you were handed.
680
+ * @experimental */
681
+ export interface ListFilterContribution {
682
+ id: string;
683
+ label: SlotLabel;
684
+ /** The named permission action a subject must hold to use the filter, prefixed with this plugin's own id. */
685
+ action: string;
686
+ documentTypes?: string[];
687
+ options: Array<{
688
+ value: string;
689
+ label: SlotLabel;
690
+ }>;
691
+ match: (input: ListFilterInput, context: PluginContentSlotContext) => string[] | Promise<string[]>;
692
+ }
693
+ /** M35 C2 (experimental): a button over the Content List table while rows are selected. Its `view` opens in
694
+ * a dialog and reads the selected rows through `usePluginBulkAction()`; it acts through the plugin's own
695
+ * routes, within its `contentAccess`.
696
+ * @experimental */
697
+ export interface BulkActionContribution {
698
+ id: string;
699
+ label: SlotLabel;
700
+ /** The named permission action a subject must hold to see the button, prefixed with this plugin's own id. */
701
+ action: string;
702
+ documentTypes?: string[];
703
+ view: ComponentType;
704
+ }
705
+ /** M35 C2 (W26, experimental): a view in one of the core's own screens, one of ADMIN_SLOT_PLACES. It reads
706
+ * where it sits through `usePluginAdminSlot()`. A `topBar.item` needs an `icon` (a Lucide name) and opens
707
+ * its view in a dialog; no other place takes one.
708
+ * @experimental */
709
+ export interface AdminSlotContribution {
710
+ id: string;
711
+ slot: AdminSlotPlace;
712
+ label: SlotLabel;
713
+ /** The named permission action a subject must hold to see the view, prefixed with this plugin's own id. */
714
+ action: string;
715
+ icon?: IconName;
716
+ view: ComponentType;
717
+ }
718
+ /** M31.5 D (D1): marks an "apiKey" route as a tool an MCP host may call. */
719
+ export interface McpToolDeclaration {
720
+ /** 1 to 40 lower-case letters, digits and "_", starting with a letter. The host sees
721
+ * `<the plugin id's last segment>_<name>`, for example `commerce_list_orders`. */
722
+ name: string;
723
+ /** 1 to 500 characters: what the tool does and what it answers, for the AI. */
724
+ description: string;
725
+ }
726
+ /** M32 F3b (D12): marks an "apiKey" GET route as a field of the delivery API's GraphQL `Query` type. */
727
+ export interface GraphqlFieldDeclaration {
728
+ /** 1 to 40 lower-case letters, digits and "_", starting with a letter. The query has
729
+ * `<the plugin id's last segment>_<name>`, for example `seo_stats`. */
730
+ name: string;
731
+ /** 1 to 500 characters: what the field answers, for the schema's description. */
732
+ description: string;
733
+ }
231
734
  /** Mounted under /api/plugins/:pluginId/… so two plugins can never
232
735
  * collide on a path (api-design.md). The host routes every declaration
233
736
  * through Fastify's own router, rebuilt whenever a plugin is attached or
@@ -247,15 +750,15 @@ export interface ApiRouteContribution {
247
750
  path: string;
248
751
  /** Who may call this route.
249
752
  * - "admin" (the default when omitted) requires a JWT session whose role
250
- * holds `action`: for admin-facing plugin UIs like Commerce Orders or
251
- * the Forms builder.
753
+ * holds `action`: for admin-facing plugin UIs like a shop's order list or
754
+ * the builder screens of a plugin that keeps its own records.
252
755
  * - "apiKey" requires a live API key that holds `action`, for a read and a
253
756
  * write alike (S299): for credentialed headless callers like a
254
757
  * storefront checkout.
255
758
  * - "public" requires NO credentials: for genuinely anonymous browser
256
- * traffic such as a contact-form submission (Session 160's Forms plugin
257
- * was the first consumer). A public route owns its own abuse controls
258
- * (honeypot, per-IP bucket, body caps) and only reaches browsers
759
+ * traffic such as a contact-form submission. A public route owns its
760
+ * own abuse controls (a honeypot, a limit per visitor, body caps; the
761
+ * host's own per-IP ceiling and body limit apply first) and only reaches browsers
259
762
  * cross-origin when the operator allowlists their origin in
260
763
  * KARDALUM_CORS_ORIGINS.
261
764
  * Anything unrecognized falls back to "admin": secure by default. */
@@ -280,8 +783,14 @@ export interface ApiRouteContribution {
280
783
  * unknown keys dropped, defaults and transforms applied. A value that
281
784
  * does not match answers a 500 and is logged with the problems. A status
282
785
  * with no entry is sent unchecked, and so is anything the handler sends
283
- * through `reply.send`. The schemas also document the response in the
284
- * server's OpenAPI documents. */
786
+ * through `reply.send`. An answer with a status outside 200 to 299, sent
787
+ * or returned, is the plugin's own error body, sent unchecked: an object
788
+ * or array as JSON exactly as given, a string as text and bytes as bytes,
789
+ * up to PLUGIN_ROUTE_ERROR_BODY_LIMIT_BYTES (64 KiB, `@kardalum/api-schemas`);
790
+ * a larger one, or one JSON cannot hold (a cycle, a BigInt), answers the
791
+ * host's own 500 `{ message }`.
792
+ * The schemas also document the response in the server's OpenAPI
793
+ * documents. */
285
794
  response?: Record<string, ZodType>;
286
795
  };
287
796
  /** Third argument added Month 8, Session 90, the first server-side
@@ -297,13 +806,35 @@ export interface ApiRouteContribution {
297
806
  * `access` decides WHICH CREDENTIAL reaches the handler; this decides
298
807
  * WHAT THAT SUBJECT MAY DO. They are orthogonal. */
299
808
  action?: string;
809
+ /** M33 K4: `true` hands the handler `request.rawBody`, a fresh copy of the request's exact
810
+ * bytes as they arrived, beside the parsed `body`, so the route can check a payment
811
+ * provider's signature over them. Only on a POST, PUT or PATCH route. The body limit is the
812
+ * same 64 KiB as every plugin route's (PLUGIN_ROUTE_BODY_LIMIT_BYTES), and every check of the
813
+ * body still runs: the parse, its refusal of prototype poisoning, and `schema.body`. The
814
+ * install screen notes that the route reads the request exactly as sent. */
815
+ rawBody?: true;
816
+ /** @experimental M35 B3 (W17): the files this route takes, as `multipart/form-data`. Only on a POST, PUT or
817
+ * PATCH route, never beside `rawBody`. The core reads the body within these limits and the site's media
818
+ * size setting, checks each file's type by its first bytes, and hands the handler `request.files` and
819
+ * `context.uploads`. A multipart body to a route without it answers 415. The install screen notes it. */
820
+ uploads?: RouteUploadsDeclaration;
821
+ /** M31.5 D (D1, D2): this route as a tool of an MCP host. Only an "apiKey" route can be one;
822
+ * its `action` decides which keys are offered it, and its `schema` (params, querystring and
823
+ * body, each a z.object) is the tool's input, so nothing is declared twice. */
824
+ mcpTool?: McpToolDeclaration;
825
+ /** M32 F3b (D12): this route as a field of the delivery API's GraphQL `Query` type. Only an
826
+ * "apiKey" `GET` route with an `action` and no `:` or `*` in its path can be one; its `schema`
827
+ * `querystring` gives the field's arguments, so nothing is declared twice. */
828
+ graphqlField?: GraphqlFieldDeclaration;
300
829
  }
301
830
  export interface ScheduledTaskContribution {
302
831
  id: string;
303
832
  name: PluginLabel;
304
833
  /** Standard 5-field cron expression. */
305
834
  cron: string;
306
- run: (context?: PluginTaskContext) => void | Promise<void>;
835
+ /** M32 F4d (D10, D11): the host runner calls this on the cron's UTC minutes, once across
836
+ * instances, with a full context (settings, secrets, storage, content and media where declared). */
837
+ run: (context: PluginTaskContext) => void | Promise<void>;
307
838
  }
308
839
  /** Media pipeline processor (thumbnails, optimization). The file/result
309
840
  * contract firms up when the BullMQ media pipeline lands. */
@@ -312,17 +843,8 @@ export interface MediaProcessorContribution {
312
843
  name: PluginLabel;
313
844
  process: (file: unknown) => unknown | Promise<unknown>;
314
845
  }
315
- /** A service an integration plugin exposes for other plugins to consume
316
- * (e.g. a Stripe client). Shape intentionally opaque until the
317
- * cross-plugin service registry exists. */
318
- export interface ExposedServiceContribution {
319
- id: string;
320
- name: PluginLabel;
321
- service: unknown;
322
- }
323
- /** A ready-made frontend starter shipped alongside a plugin (e.g. the
324
- * Commerce plugin's "Online Store" Next.js starter), one marketplace
325
- * listing, working site immediately. Packaging lands Month 13. */
846
+ /** A ready-made frontend starter shipped alongside a plugin (a Next.js
847
+ * storefront, say), one marketplace listing, working site immediately. */
326
848
  export interface BundledTemplateContribution {
327
849
  name: string;
328
850
  description?: string;
@@ -366,6 +888,10 @@ export interface SerializerContext {
366
888
  id: string;
367
889
  name: string;
368
890
  };
891
+ /** M33 K21: the document type's fields in order, with what a Group or a list holds, private fields
892
+ * and a field whose data type is gone left out, as `data` leaves them out; `[]` when the type is
893
+ * missing. Each call gets its own frozen copy. */
894
+ fields: ReadonlyArray<Readonly<PluginFieldInfo>>;
369
895
  }
370
896
  export interface CustomFormatContribution {
371
897
  /** Plugin-scoped name, /^[a-z0-9-]+$/, addressed as `<pluginId>:<name>`. */
@@ -376,24 +902,131 @@ export interface SerializerContribution {
376
902
  extendContentResponse?: (context: SerializerContext) => Record<string, unknown> | Promise<Record<string, unknown>>;
377
903
  customFormats?: CustomFormatContribution[];
378
904
  }
905
+ /** M32 H (H19): what the site owner reads when switching a plugin's form replies on. */
906
+ export interface FormRepliesContribution {
907
+ label: PluginLabel;
908
+ description?: PluginLabel;
909
+ }
910
+ /** M33 K11: one kind of email the plugin sends to one person through `context.mail` (an order
911
+ * confirmation to a buyer), off until the site owner switches it on in Server settings, Email.
912
+ * `id` is a letter, then letters, digits and "_", 1 to 40; the label and description are what
913
+ * the site owner reads beside the switch and on the install screen. */
914
+ export interface MailKindContribution {
915
+ id: string;
916
+ label: PluginLabel;
917
+ description?: PluginLabel;
918
+ }
919
+ /**
920
+ * M35 C4a (W9, design D3): what a node's `validate` is told. `v` is the item's stored version, `culture` the save's
921
+ * language for a field that varies and null for a shared one.
922
+ * @experimental
923
+ */
924
+ export interface RichTextItemValidateContext {
925
+ v: number;
926
+ culture: string | null;
927
+ }
928
+ /**
929
+ * M35 C4a (design D3): a node a plugin adds to rich text. The serializable members are api-schemas'
930
+ * (`RichTextNodeDeclaration`); `validate` is server only, pure and synchronous, and is called only for an item that is
931
+ * new or changed against the version the save starts from, while the plugin is switched on. A partial must never
932
+ * assume it passed: data stored while the plugin was off was never judged.
933
+ * @experimental
934
+ */
935
+ export interface RichTextNodeContribution extends Omit<RichTextNodeDeclaration, "hasView"> {
936
+ validate?: (data: Readonly<Record<string, unknown>>, context: RichTextItemValidateContext) => DataTypeValidatorIssue[] | undefined;
937
+ /** M35 C4b (design D15): the item's own view in its side panel, instead of the core form. It reads useRichTextItem().
938
+ * @experimental */
939
+ view?: ComponentType;
940
+ }
941
+ /**
942
+ * M35 C4b (design D15): a mark a plugin adds, with its own view when the core's small form will not do.
943
+ * @experimental
944
+ */
945
+ export interface RichTextMarkContribution extends Omit<RichTextMarkDeclaration, "hasView"> {
946
+ view?: ComponentType;
947
+ }
948
+ /**
949
+ * M35 C4b (design D16): a toolbar button inserts a node, toggles a mark, or opens the plugin's view in a dialog, which
950
+ * reads useRichTextEditorHandle(); a view names a plugin-prefixed action, and a person without it does not see it.
951
+ * @experimental
952
+ */
953
+ export interface RichTextButtonContribution extends Omit<RichTextButton, "does"> {
954
+ does: {
955
+ insert: string;
956
+ } | {
957
+ toggle: string;
958
+ } | {
959
+ view: ComponentType;
960
+ action: string;
961
+ };
962
+ }
963
+ /**
964
+ * M35 C4a (design D1): items, marks and toolbar buttons a plugin adds to rich text. The core draws and stores every
965
+ * one; no plugin code runs inside the editor (a view runs in the admin's view host, M35 C4b).
966
+ * @experimental
967
+ */
968
+ export interface RichTextExtensionsContribution {
969
+ nodes?: RichTextNodeContribution[];
970
+ marks?: RichTextMarkContribution[];
971
+ buttons?: RichTextButtonContribution[];
972
+ }
379
973
  export interface PluginContributions {
380
974
  /** The Month 3 datatype contract, referenced verbatim: a plugin can
381
975
  * ship several field types (id/version on each entry are the
382
976
  * datatype's own, distinct from the plugin's). */
383
977
  dataTypes?: DataTypePlugin[];
978
+ /** M32 J (J2): data types this plugin's install creates, of any built-in editor or of the plugin's
979
+ * own editors (for example a Group, a Repeatable list, or a picker of its own document types),
980
+ * named, and referred to by name from its document types' fields, from each other and (a picker)
981
+ * to its document types. */
982
+ dataTypeConfigs?: PluginDataTypeConfig[];
384
983
  adminSections?: AdminSectionContribution[];
385
984
  /** Rail entries in the built-in sections' rails (S280). */
386
985
  railEntries?: BuiltInRailEntryContribution[];
387
986
  dashboardWidgets?: DashboardWidgetContribution[];
987
+ /** M32 F3 (D1): panels beside an existing page's editor (at most 5). Derives `admin.editorPanel`. */
988
+ editorPanels?: EditorPanelContribution[];
989
+ /** M32 F3 (D7): items in a content tree row's menu (at most 5). Derives `admin.treeAction`. */
990
+ treeActions?: TreeActionContribution[];
991
+ /** M35 C4a (W9): rich text items. @experimental */
992
+ richTextExtensions?: RichTextExtensionsContribution;
993
+ /** M35 C2 (W5, experimental): columns of the Content List table (at most 3). Derives `admin.contentColumn`.
994
+ * @experimental */
995
+ contentColumns?: ContentColumnContribution[];
996
+ /** M35 C2 (W5, experimental): a badge on content tree rows (at most 1). Derives `admin.treeBadge`.
997
+ * @experimental */
998
+ treeBadges?: TreeBadgeContribution[];
999
+ /** M35 C2 (W5, experimental): choices of the Content List table's filter (at most 2). Derives `admin.listFilter`.
1000
+ * @experimental */
1001
+ listFilters?: ListFilterContribution[];
1002
+ /** M35 C2 (W5, experimental): actions on the selected rows of the Content List table (at most 3). Derives `admin.bulkAction`.
1003
+ * @experimental */
1004
+ bulkActions?: BulkActionContribution[];
1005
+ /** M35 C2 (W26, experimental): views in the core's own screens, one of ADMIN_SLOT_PLACES each. Derives `admin.slot`.
1006
+ * @experimental */
1007
+ adminSlots?: AdminSlotContribution[];
388
1008
  apiRoutes?: ApiRouteContribution[];
389
1009
  hooks?: PluginHooks;
1010
+ /** M35 B2 (experimental, W1): before-points that may refuse a content write. Derives `server.guard`.
1011
+ * @experimental */
1012
+ guards?: GuardContribution[];
390
1013
  scheduledTasks?: ScheduledTaskContribution[];
391
1014
  mediaProcessors?: MediaProcessorContribution[];
1015
+ /** @experimental M35 B1a (W16): contracts this plugin owns, which others may offer and use. Derives `service.contract`. */
1016
+ serviceContracts?: ServiceContractContribution[];
1017
+ /** @experimental M35 B1a: implementations of a contract this plugin offers. Derives `service.offer`. */
392
1018
  exposedServices?: ExposedServiceContribution[];
1019
+ /** @experimental M35 B1a: contracts this plugin calls through `context.services`. Derives `service.use`. */
1020
+ usedServices?: UsedServiceContribution[];
1021
+ /** @experimental M35 B1a: events this plugin raises through `context.events`. Derives `event.raise`. */
1022
+ events?: PluginEventContribution[];
393
1023
  serializers?: SerializerContribution;
394
1024
  /** Document types the plugin provisions at install: the creation shape
395
- * (server mints ids), same schema the admin's builder POSTs. */
396
- documentTypes?: CreateDocumentTypeRequest[];
1025
+ * (server mints ids) the admin's builder POSTs, except that a field's
1026
+ * `name` and `help` and a tab's `name` may be a label map (M33 K12),
1027
+ * resolved in the site's default language when the type is written. The
1028
+ * type's own `name` stays a plain string: code names the type by it. */
1029
+ documentTypes?: PluginDocumentType[];
397
1030
  /** Tokens only, never components: the same ThemeTokenOverrides shape
398
1031
  * the built-in Light/Dark themes use (color scales + radius, enforced
399
1032
  * structurally by @kardalum/design-tokens). */
@@ -412,25 +1045,505 @@ export interface PluginContributions {
412
1045
  /** Plugin ids installed together, resolved by the marketplace. */
413
1046
  bundledPlugins?: string[];
414
1047
  bundledTemplate?: BundledTemplateContribution;
415
- /** S314n3 (D1): the plugin sends notifications to people in the admin through
416
- * `context.notify` in its hooks and API routes; a plugin that does not declare it
417
- * gets no `notify`. It derives the `admin.notifications` capability, which
418
- * is a promised capability, so a reviewer reads it against your code. */
419
- notifications?: true;
1048
+ /** M32 G (G1): the kinds of notification the plugin sends to people in the admin through
1049
+ * `context.notify` in its hooks, API routes and scheduled tasks. Each kind has an id, a label
1050
+ * and an audience of actions and roles (its own offered roles included); a plugin that
1051
+ * declares none gets no `notify`, and a send names one of these kinds. It derives the
1052
+ * `admin.notifications` capability, which is a promised capability, so a reviewer reads
1053
+ * it against your code. */
1054
+ notifications?: PluginNotificationKind[];
1055
+ /** M31.5 D (D5): a short text for an MCP host on how the plugin's content and tools work,
1056
+ * 1 to 2,000 characters. The host receives it while the plugin is active, framed as data with
1057
+ * the plugin's name, and the site owner reads it on Settings, AI assistant. It derives no
1058
+ * capability: it lets the plugin do nothing. */
1059
+ aiContext?: string;
1060
+ /** M32 F (D1, D4): the document types this plugin's code may create, read or change through
1061
+ * `context.content`, each with the actions it may take and optionally the parent types it may
1062
+ * act under. A call outside the list throws ContentAccessRefusedError. The top level of the
1063
+ * content tree is never covered. It derives the `content.access` capability. */
1064
+ contentAccess?: PluginContentAccess;
1065
+ /** M32 F4c (D10): what this plugin's code may do with the media library through
1066
+ * `context.media`: `media.read` reads every file, private ones included, and `media.create`
1067
+ * adds files. Each action once. It derives the `media.access` capability. */
1068
+ mediaAccess?: PluginMediaAccess;
1069
+ /** @experimental M35 U1 (W6): what this plugin's code may do with the site's admin accounts through
1070
+ * `context.users`: `users.read` lists and reads accounts, `users.update` moves people between the
1071
+ * roles this plugin offered and Editor, `roles.read` lists roles. Derives `users.access`. */
1072
+ userAccess?: PluginUserAccess;
1073
+ /** @experimental M35 U1 (W6): fields this plugin keeps on each admin account (at most 16, the plugin
1074
+ * settings field types without `secret`). The core stores, checks and draws them on a person's
1075
+ * Details and hands them back through `context.userFields`. Derives `users.fields`. */
1076
+ userFields?: PluginUserField[];
1077
+ /** @experimental M35 U2b (W8): hands this plugin the signed-in visitor of the site (`context.visitor`) and the
1078
+ * accounts by id (`context.visitors`); `{ email: true }` adds the email. Derives `visitors.identify`. */
1079
+ visitorIdentity?: PluginVisitorIdentityContribution;
1080
+ /** @experimental M35 U2b (W8): 1 to 20 groups of the plugin's own, whose members only it changes (needs
1081
+ * visitorIdentity). Derives `visitors.groups`. */
1082
+ visitorGroups?: PluginVisitorGroupContribution[];
1083
+ /** @experimental M35 U2b (W8): 1 to 3 sections of the visitor's account page, each drawn with one of the plugin's
1084
+ * own partials (needs visitorIdentity). Derives `visitors.accountSections`. */
1085
+ visitorAccountSections?: PluginVisitorAccountSectionContribution[];
1086
+ /** @experimental M35 U2b (W8): the plugin's part of a visitor's data download and of an account's deletion (needs
1087
+ * visitorIdentity). Derives `visitors.data`. */
1088
+ visitorData?: PluginVisitorDataContribution;
1089
+ /** M32 F2 (D2): fixed site addresses the plugin answers (at most 20). Derives `site.route`. */
1090
+ siteRoutes?: SiteRouteContribution[];
1091
+ /** M32 F2 (D10): answers an address no page holds. Derives `site.fallback`. */
1092
+ siteFallback?: SiteFallbackContribution;
1093
+ /** @experimental M35 P2 (W2): asked about every request for the site's pages and files, public media and the
1094
+ * delivery API before anything answers it; may refuse or redirect it. Derives `site.requestGuard`, a promised capability. */
1095
+ requestGuard?: RequestGuardContribution;
1096
+ /** @experimental M35 P2 (W2): adds headers from a fixed list (a content security policy, transport security,
1097
+ * robots) to those answers. Derives `site.responseHeaders`. */
1098
+ responseHeaders?: ResponseHeadersContribution;
1099
+ /** @experimental M35 P4 (W46): asked before a live page is sent, with the page's id, type and language; may
1100
+ * redirect it or answer it as gone. Derives `site.pageGate`, a promised capability. */
1101
+ pageGate?: PageGateContribution;
1102
+ /** M32 F2 (D14): template filters under the plugin's prefix (at most 20). Derives `render.templateFilter`. */
1103
+ templateFilters?: TemplateFilterContribution[];
1104
+ /** M32 F2 (D14): template tags under the plugin's prefix (at most 20; M35 P3: a tag may be a block, experimental). Derives `render.templateTag`. */
1105
+ templateTags?: Array<TemplateTagContribution | TemplateBlockTagContribution>;
1106
+ /** M32 F2 (D20): entries for every page's head. Derives `render.pageHead`. */
1107
+ pageHead?: PageHeadContribution;
1108
+ /** M33 K42: content from other sites (at most HELD_EMBEDS_DECLARED_MAX) a template tag may show, held until a visitor clicks: the core writes the placeholder and its words and builds the frame from the declared origin and path prefix only. Derives `render.heldEmbed`. */
1109
+ heldEmbeds?: HeldEmbedContribution[];
1110
+ /** M35 P1 (W3), experimental: changes the HTML of every public page Kardalum renders, after the render. Derives `render.pageOutput`, a promised capability. */
1111
+ pageOutput?: PageOutputContribution;
1112
+ /** @experimental M35 P4 (W32): says how long caches and CDNs may keep a rendered page and labels it with tags; the
1113
+ * core writes the headers. Derives `render.pageCache`. */
1114
+ pageCache?: PageCacheContribution;
1115
+ /** M32 F4 (D1, D15): form protection providers (at most 3), run after the built-in checks. Derives `provider.formProtection`. */
1116
+ protectionProviders?: ProtectionProviderContribution[];
1117
+ /** M32 F4 (D1, D19): search providers (at most 3) for the delivery API's `?q=`. Derives `provider.search`. */
1118
+ searchProviders?: SearchProviderContribution[];
1119
+ /** M32 F4 (D1, D25): media stores (at most 3) the site owner may keep uploaded files in. Derives `provider.mediaStore`. */
1120
+ mediaStores?: MediaStoreContribution[];
1121
+ /** M32 H (H1): mail senders (at most 3) the site owner may send every email through, instead of the built-in SMTP one. Derives `provider.mail`. */
1122
+ mailSenders?: MailSenderContribution[];
1123
+ /** @experimental M35 P5 (W37): consent tools (at most 3) the site owner may choose, one for the whole site. Derives `provider.consent`, a promised capability. */
1124
+ consentTools?: ConsentToolContribution[];
1125
+ /** M32 H (H19): the plugin may send one reply email to the address a visitor typed into a protected form, once the site owner switches it on. Derives `mail.formReplies`. */
1126
+ formReplies?: FormRepliesContribution;
1127
+ /** M33 K11: the kinds of email (at most 10) the plugin sends, each to one person, with `context.mail.send` in its hooks, routes, site routes and scheduled tasks. Each kind is off until the site owner switches it on. Derives `mail.direct`, a promised capability: send only to a person a completed transaction or the person's own request names, and never put a visitor's words into an email to someone else. */
1128
+ mailKinds?: MailKindContribution[];
1129
+ /** M32 F4b (D33): sign-in providers (at most 3) the admin's login page offers, OpenID Connect or OAuth 2, the protocol run by the core. Derives `provider.signIn`. */
1130
+ signInProviders?: SignInProviderContribution[];
1131
+ /** M35 U3a (experimental): sign-in steps (at most 3) asked after the password or a sign-in provider, before the session exists; a factor step is offered only to people who set it up. Derives `provider.signInStep`, a promised capability. */
1132
+ signInSteps?: SignInStepContribution[];
1133
+ /** M33 K16: the plugin may call web addresses through `context.outbound`, the server's checked connection, with the methods it names. Derives `network.outbound`. */
1134
+ outboundRequests?: OutboundRequestsContribution;
1135
+ /** M33 K17: kinds of value (at most 10) the plugin makes and seals under the server's key with `context.sealing`. Derives `secrets.sealedValues`. */
1136
+ sealedValues?: SealedValueContribution[];
1137
+ /** M32 F4 (D10): secrets a person enters in the admin (at most 10) and only the plugin's server code reads, with `context.secrets.get`. Derives `secrets`. */
1138
+ secrets?: SecretDeclaration[];
1139
+ /** M32 F4d (D1): plugin settings fields (at most 32) the core draws, checks, stores and hands back. Derives nothing. */
1140
+ settings?: PluginSettingField[];
1141
+ }
1142
+ export type { TemplateData, PageHeadEntry, SiteFallbackAnswer, RequestGuardAnswer, SiteRequestSurface, PageCacheAnswer, PluginConsentView };
1143
+ /**
1144
+ * M32 F2 (D2, D3): a site address a plugin answers beside the pages. A fixed path, a GET one with a "."
1145
+ * in some segment (a file such as /sitemap.xml) or a POST one without a parameter, answers before the
1146
+ * pages, and GET also answers HEAD; a POST route takes a form post. M35 P3 (W18, experimental): a path
1147
+ * with `:name` parameters and a last `*`, or a GET path with no "." (a clean address such as /shop/cart),
1148
+ * answers after the pages, so a page at the same address always wins; its first segment is a fixed name
1149
+ * no other plugin's route starts with. The path is outside the server's own addresses
1150
+ * (siteRoutePathProblem), and a GET path is no .html or .htm file, which a page or the owner's public/
1151
+ * folder answers. The handler returns its answer or sends one through the reply; one that does neither
1152
+ * gets a logged 500.
1153
+ */
1154
+ export interface SiteRouteContribution {
1155
+ method: "GET" | "POST";
1156
+ /** A site address such as "/sitemap.xml" or "/shop/products/:slug" (api-schemas' readSiteRoutePath). GET also answers HEAD. */
1157
+ path: string;
1158
+ schema?: {
1159
+ querystring?: ZodType;
1160
+ body?: ZodType;
1161
+ /** M35 P3 (W18, experimental): checks request.params; only on a path with a parameter or "*". */
1162
+ params?: ZodType;
1163
+ };
1164
+ handler: (request: unknown, reply: unknown, context: PluginApiRouteContext) => unknown;
1165
+ /** @experimental M35 P2 (W21): `true` hands a POST route `request.rawBody`, a fresh copy of the request's exact
1166
+ * bytes (a JSON, plain text or form-encoded body), beside the parsed `body`, so it can check a signature over
1167
+ * them. POST only. The install screen notes that the route reads the request exactly as sent. */
1168
+ rawBody?: true;
1169
+ /** @experimental M35 B3 (W17): the files this route takes, as `multipart/form-data`. Only on a POST site
1170
+ * route, never beside `rawBody`. The core reads the body within these limits and the site's media size
1171
+ * setting, checks each file's type by its first bytes, and hands the handler `request.files` and
1172
+ * `context.uploads`. A multipart body to a route without it answers 415. The install screen notes it. */
1173
+ uploads?: RouteUploadsDeclaration;
1174
+ }
1175
+ /** M32 F2 (D10): the address a site fallback is asked about. */
1176
+ export interface SiteFallbackAddress {
1177
+ path: string;
1178
+ query: string;
1179
+ host: string;
1180
+ }
1181
+ /**
1182
+ * M32 F2 (D10): answers an address no page holds, with a redirect or "gone", or null to leave it
1183
+ * unanswered. It is asked within 250 ms (SITE_FALLBACK_TIME_MS) and its answer is checked.
1184
+ */
1185
+ export interface SiteFallbackContribution {
1186
+ resolve(address: SiteFallbackAddress, context: SiteFallbackContext): SiteFallbackAnswer | null | Promise<SiteFallbackAnswer | null>;
1187
+ }
1188
+ /**
1189
+ * M35 P2 (W2): a public request as a request guard sees it. One frozen object for every guard of the
1190
+ * request. `path` is decoded, `query` is the raw query without "?", `host` and `ip` are read as the
1191
+ * server reads them behind its trusted proxy, and `headers` is a frozen copy without `authorization`
1192
+ * and `proxy-authorization`, whose `cookie` header leaves the visitor cookies out (the visitor session
1193
+ * and the provider sign-in binding, M35 U2a); a header holding nothing else is left out.
1194
+ * @experimental
1195
+ */
1196
+ export interface SiteRequest {
1197
+ readonly surface: SiteRequestSurface;
1198
+ readonly method: string;
1199
+ readonly path: string;
1200
+ readonly query: string;
1201
+ readonly host: string;
1202
+ readonly ip: string;
1203
+ readonly headers: Readonly<Record<string, string | readonly string[] | undefined>>;
1204
+ }
1205
+ /**
1206
+ * M35 P2 (W2): a public answer as a response headers function sees it, frozen. `contentType` is the
1207
+ * media type in lower case, without parameters. `page` is the rendered public page, else null.
1208
+ * `inlineHashes` are the `sha256-<base64>` sources a Content-Security-Policy names the answer's inline
1209
+ * code by: a rendered page's inline snippets, or the core notice page's one stylesheet; null otherwise.
1210
+ * Null on a rendered page (`page` set) means the page carries no plugin inline snippet, so there is no
1211
+ * inline code to allow: a policy still applies to that page.
1212
+ * @experimental
1213
+ */
1214
+ export interface SiteResponse {
1215
+ readonly surface: SiteRequestSurface;
1216
+ readonly method: string;
1217
+ readonly path: string;
1218
+ readonly status: number;
1219
+ readonly contentType: string | null;
1220
+ readonly page: {
1221
+ readonly id: string;
1222
+ readonly path: string;
1223
+ readonly culture: string;
1224
+ } | null;
1225
+ readonly inlineHashes: {
1226
+ readonly scripts: readonly string[];
1227
+ readonly styles: readonly string[];
1228
+ } | null;
1229
+ }
1230
+ /** M35 P2 (W2): what a request guard and a response headers function may read: read-only storage, the
1231
+ * licence answer, the plugin's settings (read once for the request before the call's time starts) and the host.
1232
+ * @experimental */
1233
+ export interface SiteRequestContext {
1234
+ structuredStorage: Pick<ScopedStructuredStorage, "query">;
1235
+ /** Check it with requireEntitlement. */
1236
+ entitlement: Entitlement;
1237
+ settings: PluginSettingsReader;
1238
+ requestHost: string;
1239
+ }
1240
+ /**
1241
+ * M35 P2 (W2): asked about every request for the site's own addresses, `/media/` and `/api/v1/`, before
1242
+ * anything answers it; never about the admin, sign-in, the management API, `/api/plugins/`, the docs,
1243
+ * plugin assets or the on-page editor. Answers null to let it through, `{ block: { status, message?,
1244
+ * retryAfterSeconds? } }` (403, 404, 410, 429, 451 or 503; the core writes its own page or JSON) or a
1245
+ * redirect checked like a site fallback's. Guards are asked in plugin id order, at most
1246
+ * REQUEST_GUARDS_MAX a request, each within REQUEST_GUARD_TIME_MS and all within
1247
+ * REQUEST_GUARD_TIME_PER_REQUEST_MS; the first answer that is not null answers. A guard that throws, is
1248
+ * slow or answers anything else lets the request through. It runs on every request: keep it fast, and
1249
+ * let a scheduled task write what it reads. Heavy synchronous work cannot be stopped and blocks the server.
1250
+ * @experimental
1251
+ */
1252
+ export interface RequestGuardContribution {
1253
+ check(request: SiteRequest, context: SiteRequestContext): RequestGuardAnswer | null | Promise<RequestGuardAnswer | null>;
1254
+ }
1255
+ /**
1256
+ * M35 P2 (W2): asked for headers of every answer on the surfaces a request guard sees. Answers null or
1257
+ * an object of header names (RESPONSE_HEADER_NAMES, any case) to values (printable ASCII, at most
1258
+ * RESPONSE_HEADER_VALUE_MAX), at most RESPONSE_HEADERS_PER_PLUGIN_MAX names. A header the answer already
1259
+ * carries is kept; of two plugins naming one header the earlier plugin id wins. Within
1260
+ * RESPONSE_HEADERS_TIME_MS each and RESPONSE_HEADERS_TIME_PER_RESPONSE_MS together.
1261
+ * @experimental
1262
+ */
1263
+ export interface ResponseHeadersContribution {
1264
+ headers(response: SiteResponse, context: SiteRequestContext): Record<string, string> | null | Promise<Record<string, string> | null>;
1265
+ }
1266
+ /** M35 P4 (W32): the rendered public page a page cache function is asked about, frozen. `dependencies` are the
1267
+ * core's tags of what the render read (`page:<id>`, `list:<id>`, `type:<id>`, `under:<id>` for each ancestor,
1268
+ * `all`). @experimental */
1269
+ export interface PageCachePage {
1270
+ readonly id: string;
1271
+ readonly path: string;
1272
+ readonly documentTypeId: string;
1273
+ readonly culture: string;
1274
+ readonly dependencies: readonly string[];
1275
+ }
1276
+ /**
1277
+ * M35 P4 (W32): asked for every rendered public page that may be shared (never a signed-in visitor's, an edit
1278
+ * render or any other answer), in plugin id order, at most PAGE_CACHE_PLUGINS_MAX, within PAGE_CACHE_TIME_MS each
1279
+ * and PAGE_CACHE_TIME_PER_RESPONSE_MS together. Answers null or a PageCacheAnswer; several answers merge to the
1280
+ * strictest, and the core writes Cache-Control, Vary, Surrogate-Key and Cache-Tag itself. It is asked only while a
1281
+ * public URL is configured (Server settings, else KARDALUM_PUBLIC_URL): without one a page prints the request's own
1282
+ * origin, so a site behind a CDN sets its public URL. The full rule is the manifest reference's pageCache section,
1283
+ * "When it is asked". @experimental
1284
+ */
1285
+ export interface PageCacheContribution {
1286
+ headers(page: PageCachePage, context: SiteRequestContext): PageCacheAnswer | null | Promise<PageCacheAnswer | null>;
1287
+ }
1288
+ /** M35 P4 (W46): the live page a gate is asked about, frozen. `address` is the visitor's (the query without
1289
+ * credential values), null when `context.renderPage` asks. @experimental */
1290
+ export interface PageGatePage {
1291
+ readonly id: string;
1292
+ readonly path: string;
1293
+ readonly documentTypeId: string;
1294
+ readonly culture: string;
1295
+ readonly address: Readonly<SiteFallbackAddress> | null;
1296
+ }
1297
+ /**
1298
+ * M35 P4 (W46): asked before a live public page is sent, on a render and a cache hit alike, in plugin id order, at
1299
+ * most PAGE_GATES_MAX, within PAGE_GATE_TIME_MS each and PAGE_GATE_TIME_PER_REQUEST_MS together. Answers null (the
1300
+ * page is sent), a redirect or `{ gone: true }`, checked as a site fallback's answer. A gate that throws, is slow,
1301
+ * answers anything else or redirects to the address asked lets the page through. It runs on every page view: keep it
1302
+ * fast and let a scheduled task write what it reads. @experimental
1303
+ */
1304
+ export interface PageGateContribution {
1305
+ check(page: PageGatePage, context: SiteRequestContext): SiteFallbackAnswer | null | Promise<SiteFallbackAnswer | null>;
1306
+ }
1307
+ /** M32 F2 (D15): what a template filter or tag may read while it runs: read-only storage only. */
1308
+ export interface TemplateCallContext {
1309
+ culture: string | null;
1310
+ page: {
1311
+ id: string;
1312
+ path: string;
1313
+ } | null;
1314
+ structuredStorage: Pick<ScopedStructuredStorage, "query">;
1315
+ /** M32 F4c (D1): the host's licence answer for this plugin; check it with requireEntitlement. */
1316
+ entitlement: Entitlement;
1317
+ /** M32 F4d (D7): the plugin's settings values, read once a render before the call's time budget starts. */
1318
+ settings: PluginSettingsReader;
1319
+ /** The host the page is rendered for; null when no request (the block preview). Pass it to requireEntitlement. */
1320
+ requestHost: string | null;
1321
+ /** @experimental M35 P3 (W19): a published page, as on a route (PluginServerContextBase). Each read takes one of the
1322
+ * render's list reads and of TEMPLATE_PLUGIN_READS_PER_RENDER_MAX; past them, or after the call ended, it throws
1323
+ * TemplateReadRefusedError. */
1324
+ getPublishedContent: PluginServerContextBase["getPublishedContent"];
1325
+ /** @experimental M35 P3 (W19): published pages sorted and filtered, a cursor at a time, on the same budget. */
1326
+ listPublished: PluginServerContextBase["listPublished"];
1327
+ /** @experimental M35 P3 (W19): the delivery search, on the same budget and TEMPLATE_PLUGIN_SEARCHES_PER_RENDER_MAX. */
1328
+ searchPublished: PluginServerContextBase["searchPublished"];
1329
+ /** @experimental M35 P3 (W19): the addresses of pages in every language (a language switcher), on the same budget. */
1330
+ pageAddresses: PluginServerContextBase["pageAddresses"];
1331
+ /** @experimental M35 P3 (W19): a public media item's address, on the same budget. */
1332
+ publicMediaUrl: PluginServerContextBase["publicMediaUrl"];
1333
+ /** @experimental M35 U2b (W8): the signed-in visitor the page is rendered for, null for none. Present only for a
1334
+ * plugin that declares visitorIdentity. A render with a visitor is never cached. */
1335
+ visitor?: PluginVisitor | null;
1336
+ /** @experimental M35 P5 (W37): the visitor's consent as the request's cookie carries it (undecided in an edit render,
1337
+ * a preview, `renderPage` and while no consent tool is chosen). Reading it makes this render answer for that cookie
1338
+ * alone: it is never stored for another request carrying a consent cookie and never handed to a page cache, so read
1339
+ * it only when the HTML itself must differ; a head script waits for a category with `consent` on its entry instead.
1340
+ * Present from the CMS that ships 35-P5. */
1341
+ consent?: PluginConsentView;
1342
+ }
1343
+ /**
1344
+ * M32 F2 (D14): a template filter, used as <the id's last segment>_<name>. Its value and result are
1345
+ * plain data bounded by TEMPLATE_DATA_* and it runs within TEMPLATE_CALL_TIME_MS.
1346
+ */
1347
+ export interface TemplateFilterContribution {
1348
+ name: string;
1349
+ /** @experimental M35 P3 (evidence 116): what the filter prints when it cannot answer; "value" by default. */
1350
+ onFailure?: TemplateFilterOnFailure;
1351
+ filter(value: TemplateData, args: TemplateData[], context: TemplateCallContext): TemplateData | Promise<TemplateData>;
1352
+ }
1353
+ /**
1354
+ * M33 K42: one held embed. `id` (a letter, then letters, digits and "_") names it to a tag's
1355
+ * `{ embed }`; `origin` is a bare https origin and `pathPrefix` (starting and ending with "/", no
1356
+ * "..", "%2e", "%2f" or "%5c", written as the URL parser writes it) the part of it a frame may come from; `provider` names who the visitor's
1357
+ * browser contacts (a label map, English required); `privacyNotice` is the provider's https privacy
1358
+ * notice; `kind` picks the core's words (`map`, or the generic `content`); `allow` lists what the
1359
+ * frame may use, each once. The rules and limits are api-schemas' (`PluginHeldEmbedSchema` and the
1360
+ * HELD_EMBED_* constants), never restated here.
1361
+ */
1362
+ export type HeldEmbedContribution = PluginHeldEmbed;
1363
+ /**
1364
+ * M32 F2 (D16): what a template tag gives back: text the host escapes, or { html } the host sanitizes.
1365
+ * M33 K42: or `{ embed, html? }`: held content from one of the plugin's own `heldEmbeds`. The host
1366
+ * checks the request against the declarations it copied when the plugin was attached
1367
+ * (`heldEmbedRequestProblem`), writes its own placeholder with the visitor words, then the cleaned
1368
+ * `html` (a fallback such as a link); the frame is built only after a visitor clicks. A refused
1369
+ * request, or one past HELD_EMBEDS_PER_RENDER_MAX in a render, writes only the cleaned `html`.
1370
+ */
1371
+ export type TemplateTagOutput = string | {
1372
+ html: string;
1373
+ } | {
1374
+ embed: HeldEmbedRequest;
1375
+ html?: string;
1376
+ };
1377
+ /** M32 F2 (D14, D16): a template tag, named like a filter, with its named arguments as plain data; no body. */
1378
+ export interface TemplateTagContribution {
1379
+ name: string;
1380
+ block?: undefined;
1381
+ render(args: Record<string, TemplateData>, context: TemplateCallContext): TemplateTagOutput | Promise<TemplateTagOutput>;
1382
+ }
1383
+ /**
1384
+ * M35 P3 (W19): what a block tag gives back: a TemplateTagOutput (it replaces the body, cleaned), or
1385
+ * `{ keepBody: true, before?, after?, wrap? }`: the cleaned `before`, the author's body exactly as rendered
1386
+ * (inside one `wrap` element of TEMPLATE_BLOCK_WRAP_ELEMENTS with an optional class), the cleaned `after`.
1387
+ * @experimental
1388
+ */
1389
+ export type TemplateBlockTagOutput = TemplateTagOutput | {
1390
+ keepBody: true;
1391
+ before?: string;
1392
+ after?: string;
1393
+ wrap?: {
1394
+ element: TemplateBlockWrapElement;
1395
+ class?: string;
1396
+ };
1397
+ };
1398
+ /**
1399
+ * M35 P3 (W19): a block tag, written `{% <prefix>_<name> args %}...{% end<prefix>_<name> %}`. The core renders the
1400
+ * body first and hands it over as HTML (null over TEMPLATE_BLOCK_BODY_MAX_BYTES). `onFailure` says what is written
1401
+ * when the call cannot answer: the body ("body", the default) or nothing.
1402
+ * @experimental
1403
+ */
1404
+ export interface TemplateBlockTagContribution {
1405
+ name: string;
1406
+ block: true;
1407
+ onFailure?: TemplateBlockOnFailure;
1408
+ render(args: Record<string, TemplateData>, context: TemplateCallContext, body: string | null): TemplateBlockTagOutput | Promise<TemplateBlockTagOutput>;
1409
+ }
1410
+ /** M32 F2 (D24): what the page head function is told about the page being rendered. */
1411
+ export interface PageHeadContext {
1412
+ culture: string;
1413
+ page: {
1414
+ id: string;
1415
+ path: string;
1416
+ documentType: string;
1417
+ /** The page's address as the page prints it: short on its own domain; null when no link can be made. */
1418
+ url: string | null;
1419
+ data: Record<string, TemplateData>;
1420
+ /** M33 K25: the page's name as a public read in this language names it; its path segment when it has none. */
1421
+ name: string;
1422
+ /** M33 K25: the page's canonical address, always a full URL, the one `kardalum.culture.canonical` prints. */
1423
+ canonical: string;
1424
+ /** M33 K25: the page's full address in each language it is served in, in the site's order; one entry on a page served in one language. */
1425
+ alternates: PageAddress[];
1426
+ /** M33 K21: the document type's fields in order, with what a Group or a list holds, private fields left out, as `data` leaves them out. */
1427
+ fields: PluginFieldInfo[];
1428
+ };
1429
+ structuredStorage: Pick<ScopedStructuredStorage, "query">;
1430
+ /** M32 F4c (D1): the host's licence answer for this plugin; check it with requireEntitlement. */
1431
+ entitlement: Entitlement;
1432
+ /** M32 F4d (D7): the plugin's settings values, read once a render before the call's time budget starts. */
1433
+ settings: PluginSettingsReader;
1434
+ /** The host the page is rendered for; null when no request. Pass it to requireEntitlement. */
1435
+ requestHost: string | null;
1436
+ /** M33 K49: the address of the plugin's own public/ folder at its installed version,
1437
+ * `/plugin-assets/<id>/<version>/public/`, with the closing slash. Append a file named by the
1438
+ * one rule (letters, digits, `-`, `_`, `.`; 1 to 200 characters; no `.` or `..` segment). */
1439
+ assetBase: string;
1440
+ /** M33 K26: a public, live media item's address, a full URL on the request's base (the store's
1441
+ * own public address when it has one); null for a private, trashed, missing or malformed id, and
1442
+ * from the fifth call in one render (PAGE_HEAD_MEDIA_READS_MAX). Never a private file's address. */
1443
+ publicMediaUrl(id: string): Promise<string | null>;
1444
+ /** @experimental M35 U2b (W8): the signed-in visitor the page is rendered for, null for none. Present only for a
1445
+ * plugin that declares visitorIdentity. */
1446
+ visitor?: PluginVisitor | null;
1447
+ /** @experimental M35 P5 (W37): the visitor's consent as the request's cookie carries it (undecided in an edit render,
1448
+ * a preview, `renderPage` and while no consent tool is chosen). Reading it makes this render answer for that cookie
1449
+ * alone: it is never stored for another request carrying a consent cookie and never handed to a page cache, so read
1450
+ * it only when the HTML itself must differ; a head script waits for a category with `consent` on its entry instead.
1451
+ * Present from the CMS that ships 35-P5. */
1452
+ consent?: PluginConsentView;
1453
+ }
1454
+ /**
1455
+ * M32 F2 (D20, D21): entries added to the head of every page. A script or stylesheet comes from the
1456
+ * plugin's own files (/plugin-assets/<id>/<version>/public/<file>) or from an origin named in
1457
+ * scriptOrigins (at most 10 bare https origins), which the install screen shows; an icon, manifest,
1458
+ * preconnect or dns-prefetch link also takes a site path. Every entry is checked by checkPageHeadEntry.
1459
+ *
1460
+ * M33 K27: with `setsTitle: true`, a `{ tag: "title", text }` entry (1 to PAGE_HEAD_TITLE_MAX, 300,
1461
+ * characters, no control character) sets the page's title: the first declaring plugin in id order that
1462
+ * gives one wins, and the core writes it, escaped, in place of the text of the layout's first <title> in
1463
+ * <head>, or inserts a <title> before </head>. Only on a page whose layout writes {% plugin_head %},
1464
+ * never in the on-page editor. A title entry from a plugin without the declaration is dropped and
1465
+ * logged. The install screen notes "may set the page title".
1466
+ *
1467
+ * M35 P1 (W40): with `inlineSnippets: true`, inline code (at most PAGE_HEAD_INLINE_SNIPPETS_MAX entries
1468
+ * a render, each at most PAGE_HEAD_INLINE_TEXT_MAX_BYTES) that holds nothing that could end its element
1469
+ * (`inlineSnippetProblem`); the core writes each text with its line breaks as LF, records the sha256
1470
+ * hash of that text for a Content-Security-Policy, and writes none in the on-page editor.
1471
+ */
1472
+ export interface PageHeadContribution {
1473
+ scriptOrigins?: string[];
1474
+ setsTitle?: true;
1475
+ /** M35 P1 (W40), experimental: lets `entries` give `{ tag: "inlineScript", text, module? }` and
1476
+ * `{ tag: "inlineStyle", text, media? }`, written into the page as given. Read once, when the plugin
1477
+ * is attached. The install screen notes "writes its own code into every page". */
1478
+ inlineSnippets?: true;
1479
+ entries(context: PageHeadContext): PageHeadEntry[] | Promise<PageHeadEntry[]>;
1480
+ }
1481
+ /**
1482
+ * M35 P1 (W3): what a page output transform is told about the page. No visitor data (no cookie,
1483
+ * query string, address or header): the answer is kept in the render cache and served to every
1484
+ * visitor of the page, language and base address.
1485
+ * @experimental
1486
+ */
1487
+ export interface PageOutputContext {
1488
+ culture: string;
1489
+ page: {
1490
+ id: string;
1491
+ /** The tree path, not the public address. */
1492
+ path: string;
1493
+ documentType: string;
1494
+ /** The page's address as the page prints it; null when no link can be made. */
1495
+ url: string | null;
1496
+ };
1497
+ structuredStorage: Pick<ScopedStructuredStorage, "query">;
1498
+ /** The host's licence answer for this plugin; check it with requireEntitlement. */
1499
+ entitlement: Entitlement;
1500
+ /** The plugin's settings, read once a render before the transform's time starts. */
1501
+ settings: PluginSettingsReader;
1502
+ /** The host the page is rendered for. Pass it to requireEntitlement. While no site has a domain,
1503
+ * the answer is cached by `baseUrl` alone and served to every host that shares it. */
1504
+ requestHost: string | null;
1505
+ /** The base URL the page's own links are written with, without the closing slash, for example
1506
+ * "https://www.example.com". It is part of the render cache's key for every page, so an answer
1507
+ * that depends on the site's own address reads it here. */
1508
+ baseUrl: string;
1509
+ /** The address of the plugin's own public/ folder at its installed version, with the closing slash. */
1510
+ assetBase: string;
1511
+ }
1512
+ /**
1513
+ * M35 P1 (W3): a transform of every public page Kardalum renders, run after the template and its
1514
+ * blocks, in plugin id order, each handed the previous answer. It answers the new HTML, or null to
1515
+ * leave the page as it is. It never runs in the on-page editor, on a cache hit, on the 404 or error
1516
+ * pages, a public/ file or a site route, and it never sees the response's headers or status. Each
1517
+ * transform has PAGE_OUTPUT_TIME_MS and all of one render PAGE_OUTPUT_TIME_PER_RENDER_MS; at most
1518
+ * PAGE_OUTPUT_TRANSFORMS_MAX run a render, on pages of at most PAGE_OUTPUT_INPUT_MAX_BYTES, and an
1519
+ * answer may add at most PAGE_OUTPUT_GROWTH_MAX_BYTES. The head the layout writes through
1520
+ * {% plugin_head %} reaches the transform as a `<!--kardalum-slot:...-->` comment, which the answer
1521
+ * keeps exactly as often as it found it. One that throws, is slow, answers something else, grows the
1522
+ * page too much or loses a slot is skipped, and the page is always served. Read tags with
1523
+ * `rewriteStartTags` from `@kardalum/plugin-sdk/text`, never a regular expression. Heavy synchronous
1524
+ * work cannot be stopped and blocks the server.
1525
+ * @experimental
1526
+ */
1527
+ export interface PageOutputContribution {
1528
+ transform(html: string, context: PageOutputContext): string | null | undefined | Promise<string | null | undefined>;
420
1529
  }
421
1530
  /**
422
1531
  * The contributions that put code in the browser, and so the ones that
423
1532
  * make a plugin ship a client bundle (S267 section 5, implemented by
424
1533
  * S268 Task 3). `dataTypes`, `adminSections`, `railEntries` (S280) and
425
- * `dashboardWidgets` carry React views. S313b retired `settingsPages`,
1534
+ * `dashboardWidgets`, `editorPanels`, `treeActions`, `bulkActions` and `adminSlots` carry React views;
1535
+ * `contentColumns`, `treeBadges` and `listFilters` (M35 C2) carry none, but the admin registers them
1536
+ * for their labels and options. S313b retired `settingsPages`,
426
1537
  * `contentTreeActions` and `editorToolbar`, which no admin screen hosted;
427
1538
  * the last two return when a host and an editor-handle API are designed.
1539
+ * M35 C4a: rich text gained `richTextExtensions` (the 35-C4 design); `editorToolbar` is not revived.
428
1540
  *
429
1541
  * Everything else is absent on purpose: `apiRoutes`, `hooks`,
430
1542
  * `scheduledTasks`, `mediaProcessors` and `serializers` run on the
431
- * server, and `documentTypes`, `themeTokens`, `templates`, `assets`,
432
- * `bundledPlugins`, `bundledTemplate` and `exposedServices` are data the
433
- * host consumes rather than code the browser runs.
1543
+ * server, and `documentTypes`, `themeTokens`, `templates` and `assets` are
1544
+ * data the host consumes rather than code the browser runs.
1545
+ * `bundledPlugins` and `bundledTemplate` are data the marketplace resolves;
1546
+ * `exposedServices` (M35 B1a) carries functions, like `apiRoutes`.
434
1547
  *
435
1548
  * This replaces the type-keyed CLIENT_BUNDLE_TYPES. It is more correct
436
1549
  * than that list was, not merely equivalent: a plugin listed as
@@ -519,8 +1632,10 @@ export interface PluginManifestBase {
519
1632
  * is identical for both tiers.
520
1633
  */
521
1634
  signature?: string;
522
- /** Semver range of compatible CMS versions, e.g. '^1.0.0'. */
523
- cmsVersion: string;
1635
+ /** Semver range of the Kardalum versions this plugin works with. Left out,
1636
+ * `kardalum plugin build` writes it from the plugin SDK the plugin is built
1637
+ * with (`>=0.20.0 <1.0.0`); an author writes it only to narrow it. */
1638
+ cmsVersion?: string;
524
1639
  /** Ids of plugins this one requires. */
525
1640
  pluginDependencies?: string[];
526
1641
  databaseCompatibility: DatabaseCompatibility;
@@ -546,10 +1661,19 @@ export interface PluginManifestBase {
546
1661
  * nothing ever shows an operator a raw action string. A label is a string
547
1662
  * or a map of language code to text with `en` required (S311); the install
548
1663
  * stores the text of the site's default language.
1664
+ *
1665
+ * `offerTo` (M33 K29) offers the action to every role that holds one core
1666
+ * action (`PLUGIN_ACTION_OFFER_TARGETS` in @kardalum/api-schemas:
1667
+ * `content.read`, `content.update`, `content.publish`, `media.read`), the
1668
+ * administrator left out. Never applied unasked: a person who holds
1669
+ * `roles.update` and the action accepts it at install (its box is ticked
1670
+ * when only panels, sections, widgets and GET routes name the action) or
1671
+ * later with Apply under Plugins, Installed, and it adds ordinary grants.
549
1672
  */
550
1673
  actions?: Array<{
551
1674
  id: string;
552
1675
  label: PluginLabel;
1676
+ offerTo?: PluginActionOfferTarget;
553
1677
  }>;
554
1678
  /**
555
1679
  * Roles this plugin offers (S273). An offer is never applied unasked: the