@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,9 +1,76 @@
1
- import { installInterfaceFor, installOptionNeedsAnswer } from "@kardalum/api-schemas";
1
+ import { BUILT_IN_DATA_TYPE_CONFIGS, RICHTEXT_EDITOR_ID, installInterfaceFor, installOptionNeedsAnswer, richTextShapeProblem, sampleDeferredFieldIds, samplePageTokens, } from "@kardalum/api-schemas";
2
2
  import { SAMPLE_CONTENT_MAX_BYTES, hasSampleContentConsumer, installFactsOf, readShippedSampleContent } from "../sample-content.js";
3
3
  import { createShippedLookup } from "../shipped-files.js";
4
4
  import { formatBinarySize } from "./limits.js";
5
5
  import { contributionsOf, failed, list, listCapped, passed, plural, record } from "./support.js";
6
6
  const declaredTypeNames = (manifest) => new Set(list(contributionsOf(manifest).documentTypes).map((entry) => record(entry)?.name).filter((name) => typeof name === "string"));
7
+ /** The id of the rich text data type, read from the built-in list by editor id. */
8
+ const RICH_TEXT_ID = BUILT_IN_DATA_TYPE_CONFIGS.find((config) => config.editorId === RICHTEXT_EDITOR_ID)?.id;
9
+ /** Each document type's rich text field ids, by the type's name (M32 I5b, E14). */
10
+ function richTextFieldsByType(manifest) {
11
+ const byType = new Map();
12
+ const contributions = contributionsOf(manifest);
13
+ // M32 J (J3): a field may name a data type the manifest declares, so a declared rich text data
14
+ // type's name counts like the built-in's id (the name as the rule reads it, trimmed).
15
+ const declaredRichText = new Set();
16
+ for (const entry of list(contributions.dataTypeConfigs)) {
17
+ const config = record(entry);
18
+ if (config && config.editorId === RICHTEXT_EDITOR_ID && typeof config.name === "string")
19
+ declaredRichText.add(config.name.trim());
20
+ }
21
+ const isRichText = (datatypeId) => datatypeId === RICH_TEXT_ID || (typeof datatypeId === "string" && declaredRichText.has(datatypeId));
22
+ for (const entry of list(contributions.documentTypes)) {
23
+ const type = record(entry);
24
+ if (!type || typeof type.name !== "string" || byType.has(type.name))
25
+ continue;
26
+ const ids = [];
27
+ for (const field of list(type.fields)) {
28
+ const declared = record(field);
29
+ if (declared && isRichText(declared.datatypeId) && typeof declared.id === "string")
30
+ ids.push(declared.id);
31
+ }
32
+ byType.set(type.name, ids);
33
+ }
34
+ return byType;
35
+ }
36
+ /** Each document type's required field ids, by the type's name (M32 J, J10), read with type checks. */
37
+ function requiredFieldsByType(manifest) {
38
+ const byType = new Map();
39
+ for (const entry of list(contributionsOf(manifest).documentTypes)) {
40
+ const type = record(entry);
41
+ if (!type || typeof type.name !== "string" || byType.has(type.name))
42
+ continue;
43
+ const ids = new Set();
44
+ for (const field of list(type.fields)) {
45
+ const declared = record(field);
46
+ if (declared && typeof declared.id === "string" && record(declared.validation)?.required === true)
47
+ ids.add(declared.id);
48
+ }
49
+ byType.set(type.name, ids);
50
+ }
51
+ return byType;
52
+ }
53
+ /** M32 J (J10): the first page token that names no other slug of the file, or that fills a
54
+ * required field (the seeder creates the page without it and saves it after), as the refusal. */
55
+ function pageTokenProblem(nodes, manifest) {
56
+ const slugs = new Set(nodes.map((node) => node.slug));
57
+ for (const node of nodes) {
58
+ for (const slug of samplePageTokens(node.data)) {
59
+ if (slug === node.slug || !slugs.has(slug)) {
60
+ return `sample-content.json node "${node.slug}" names the page "${slug}", which is not another slug of the file`;
61
+ }
62
+ }
63
+ }
64
+ const required = requiredFieldsByType(manifest);
65
+ for (const node of nodes) {
66
+ for (const fieldId of sampleDeferredFieldIds(node.data)) {
67
+ if (required.get(node.documentType)?.has(fieldId) === true) {
68
+ return `sample-content.json node "${node.slug}" field "${fieldId}": a page token cannot fill a required field: the sample is checked before any of its pages exist, so the field would be checked empty`;
69
+ }
70
+ }
71
+ }
72
+ return null;
73
+ }
7
74
  /** The run's one read of sample-content.json: the gate's, or this check's own
8
75
  * when it runs outside a gate. */
9
76
  function sampleOf({ dir, sampleContent }) {
@@ -32,6 +99,9 @@ function checkSampleContent(sample, dir, manifest) {
32
99
  if (unknown.length > 0) {
33
100
  return failed(`sample-content.json references documentType(s) not in this manifest's documentTypes: ${listCapped(unknown, "names")}`);
34
101
  }
102
+ const tokenProblem = pageTokenProblem(nodes, manifest);
103
+ if (tokenProblem !== null)
104
+ return failed(tokenProblem);
35
105
  const problems = [];
36
106
  const whyNotShipped = createShippedLookup(dir);
37
107
  for (const entry of media) {
@@ -42,13 +112,32 @@ function checkSampleContent(sample, dir, manifest) {
42
112
  if (problems.length > 0) {
43
113
  return failed(`sample-content.json declares ${plural(problems.length, "media file")} the package does not carry`, problems);
44
114
  }
115
+ // A pure read of the file already in memory. A value written as an object on a rich text
116
+ // field is an editor document and must have a shape the editor can open; an HTML string or
117
+ // any other value is not this check's business. richTextShapeProblem is bounded (depth and
118
+ // node counts, no recursion).
119
+ const richFields = richTextFieldsByType(manifest);
120
+ const shapeProblems = [];
121
+ for (const sampleNode of nodes) {
122
+ for (const fieldId of richFields.get(sampleNode.documentType) ?? []) {
123
+ const value = sampleNode.data[fieldId];
124
+ if (value === null || typeof value !== "object")
125
+ continue;
126
+ const problem = richTextShapeProblem(value);
127
+ if (problem !== null)
128
+ shapeProblems.push(`${sampleNode.slug}.${fieldId}: ${problem}`);
129
+ }
130
+ }
131
+ if (shapeProblems.length > 0) {
132
+ return failed(`sample-content.json holds ${plural(shapeProblems.length, "rich text value")} the editor cannot open`, shapeProblems);
133
+ }
45
134
  return passed(media.length > 0
46
135
  ? `${plural(nodes.length, "sample content node")} valid, ${plural(media.length, "media file")} present`
47
136
  : `${plural(nodes.length, "sample content node")} valid`);
48
137
  }
49
138
  export const sampleContentCheck = {
50
139
  name: "sample content valid",
51
- rule: `\`sample-content.json\` is a regular file within ${formatBinarySize(SAMPLE_CONTENT_MAX_BYTES)} that parses, names only document types the manifest declares, and whose media files are files under \`media/\` the build carries.`,
140
+ rule: `\`sample-content.json\` is a regular file within ${formatBinarySize(SAMPLE_CONTENT_MAX_BYTES)} that parses, names only document types the manifest declares, whose media files are files under \`media/\` the build carries, and whose rich text values written as editor documents have a shape the editor can open. A string that is exactly \`{{page:<slug>}}\` names another page of the file, declared before or after it, and becomes its id; it cannot fill a required field.`,
52
141
  gates: ["cli", "door"],
53
142
  needsManifest: true,
54
143
  run: (context) => checkSampleContent(sampleOf(context), context.dir, context.manifest),
@@ -0,0 +1,6 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const SERVER_POWERS_CHECK_NAME = "outbound, sealing and durable hooks";
3
+ /** The first CMS that runs `context.outbound`, `context.sealing` and durable hooks, and writes a
4
+ * tag's held embed (M33 K42, core part 6: the floor widened to `heldEmbeds`, no new check). */
5
+ export declare const SERVER_POWERS_CMS_FLOOR = "0.20.0";
6
+ export declare const serverPowersCheck: DeliveryCheck;
@@ -0,0 +1,150 @@
1
+ import { DURABLE_EVENT_TRIES, NON_DURABLE_HOOK_EVENTS, OUTBOUND_METHODS, OUTBOUND_REASON_MAX, PLUGIN_HOOK_EVENTS, PLUGIN_SEALED_KINDS_MAX, PLUGIN_SEALED_KIND_ID_MAX, PLUGIN_SEALED_VALUE_MAX_BYTES, PluginOutboundRequestsSchema, PluginSealedValuesSchema, isDurableAllowed, parsePluginEventKey, } from "@kardalum/api-schemas";
2
+ import { cmsRangeAdmitsBelow } from "../cms-range.js";
3
+ import { contributionsOf, failed, listCapped, passed, plural, record } from "./support.js";
4
+ // M33 K16, K17, K18 (core part 3): the 42nd delivery check. `outboundRequests` and `sealedValues` are
5
+ // checked by the schemas the SDK's manifest schema runs (api-schemas), and `hooks` by the events the SDK
6
+ // lists. The live manifest and the redacted one at the door read alike: a hook is an event name or
7
+ // `{ event, durable: true }` in manifest.json, and an event key with a handler or `{ handler, durable: true }`
8
+ // live. A message names the declaration by position and quotes only the event name an author wrote there.
9
+ export const SERVER_POWERS_CHECK_NAME = "outbound, sealing and durable hooks";
10
+ /** The first CMS that runs `context.outbound`, `context.sealing` and durable hooks, and writes a
11
+ * tag's held embed (M33 K42, core part 6: the floor widened to `heldEmbeds`, no new check). */
12
+ export const SERVER_POWERS_CMS_FLOOR = "0.20.0";
13
+ const CMS_RANGE_QUOTED_MAX = 64;
14
+ const EVENTS = new Set(PLUGIN_HOOK_EVENTS);
15
+ const EVENT_NAME_QUOTED_MAX = 64;
16
+ function quoted(event) {
17
+ return JSON.stringify(event.length > EVENT_NAME_QUOTED_MAX ? `${event.slice(0, EVENT_NAME_QUOTED_MAX)}...` : event);
18
+ }
19
+ function atPath(root, path) {
20
+ return path.reduce((out, part) => (typeof part === "number" ? `${out}[${part}]` : `${out}.${String(part)}`), root);
21
+ }
22
+ /** The durable events of a `hooks` declaration, and what is wrong with it. */
23
+ function readHooks(value) {
24
+ const issues = [];
25
+ const seen = new Set();
26
+ let durable = 0;
27
+ const take = (event, where) => {
28
+ if (typeof event !== "string" || (!EVENTS.has(event) && parsePluginEventKey(event) === null)) {
29
+ issues.push(`${where} names ${typeof event === "string" ? quoted(event) : "no event"}, which is not an event a plugin can hook`);
30
+ return false;
31
+ }
32
+ if (seen.has(event)) {
33
+ issues.push(`${where} names ${quoted(event)}, which is named twice`);
34
+ return false;
35
+ }
36
+ seen.add(event);
37
+ return true;
38
+ };
39
+ if (Array.isArray(value)) {
40
+ value.forEach((entry, index) => {
41
+ const where = `contributions.hooks[${index}]`;
42
+ if (typeof entry === "string") {
43
+ take(entry, where);
44
+ return;
45
+ }
46
+ const plain = record(entry);
47
+ const keys = plain === null ? [] : Object.keys(plain);
48
+ if (plain === null || keys.length !== 2 || plain.durable !== true || typeof plain.event !== "string") {
49
+ issues.push(`${where} must be an event name or { event, durable: true }`);
50
+ return;
51
+ }
52
+ if (take(plain.event, where)) {
53
+ // M35 B2: a shutdown is gone after a restart, so its hook is never kept in the outbox.
54
+ if (!isDurableAllowed(plain.event)) {
55
+ issues.push(`${where} names ${quoted(plain.event)} as durable: ${plain.event} is never durable, because its moment is gone after a restart`);
56
+ return;
57
+ }
58
+ durable += 1;
59
+ }
60
+ });
61
+ return { durable, issues };
62
+ }
63
+ const plain = record(value);
64
+ if (plain === null)
65
+ return { durable, issues: ["contributions.hooks must be a list of events or an object of handlers by event"] };
66
+ for (const [event, entry] of Object.entries(plain)) {
67
+ const where = `contributions.hooks[${quoted(event)}]`;
68
+ if (!take(event, where))
69
+ continue;
70
+ if (typeof entry === "function")
71
+ continue;
72
+ const shape = record(entry);
73
+ if (shape === null || shape.durable !== true || typeof shape.handler !== "function" || Object.keys(shape).length !== 2) {
74
+ issues.push(`${where} must be a handler or { handler, durable: true }`);
75
+ continue;
76
+ }
77
+ if (!isDurableAllowed(event)) {
78
+ issues.push(`${where} is durable: ${event} is never durable, because its moment is gone after a restart`);
79
+ continue;
80
+ }
81
+ durable += 1;
82
+ }
83
+ return { durable, issues };
84
+ }
85
+ export const serverPowersCheck = {
86
+ name: SERVER_POWERS_CHECK_NAME,
87
+ rule: `\`outboundRequests\` has a \`reason\` of 1 to ${OUTBOUND_REASON_MAX} characters in each language, with English, and 1 to ${OUTBOUND_METHODS.length} \`methods\` from ${OUTBOUND_METHODS.join(", ")}, each once; ` +
88
+ `\`sealedValues\` lists 1 to ${PLUGIN_SEALED_KINDS_MAX} kinds, each with an \`id\` of 1 to ${PLUGIN_SEALED_KIND_ID_MAX} characters used once and a \`label\`, and a sealed value is at most ${PLUGIN_SEALED_VALUE_MAX_BYTES} bytes; ` +
89
+ `a \`hooks\` entry names an event a plugin can hook, or another plugin's event as \`<plugin id>:<event name>\`, once, and is durable only as \`{ handler, durable: true }\` (\`{ event, durable: true }\` in \`manifest.json\`), which keeps the event until the handler finishes and tries it ${DURABLE_EVENT_TRIES} times, while ${NON_DURABLE_HOOK_EVENTS.map((event) => `\`${event}\``).join(", ")} is never durable, because its moment is gone after a restart; ` +
90
+ `a package that uses any of the three, declares \`heldEmbeds\`, has a form protection provider with a \`widgetScript\` or has a sign-in entry with a \`hostedDomainClaim\`, has a \`cmsVersion\` admitting no version below ${SERVER_POWERS_CMS_FLOOR}, because an older CMS cannot run them.`,
91
+ gates: ["cli", "door"],
92
+ needsManifest: true,
93
+ run: ({ manifest }) => {
94
+ const contributions = contributionsOf(manifest);
95
+ const issues = [];
96
+ const outboundDeclared = contributions.outboundRequests !== undefined;
97
+ if (outboundDeclared) {
98
+ const parsed = PluginOutboundRequestsSchema.safeParse(contributions.outboundRequests);
99
+ if (!parsed.success) {
100
+ for (const issue of parsed.error.issues.slice(0, 3))
101
+ issues.push(`${atPath("contributions.outboundRequests", issue.path)} ${issue.message}`);
102
+ }
103
+ }
104
+ const sealed = contributions.sealedValues;
105
+ if (sealed !== undefined) {
106
+ if (!Array.isArray(sealed)) {
107
+ issues.push("contributions.sealedValues must be a list");
108
+ }
109
+ else {
110
+ const parsed = PluginSealedValuesSchema.safeParse(sealed);
111
+ if (!parsed.success) {
112
+ for (const issue of parsed.error.issues.slice(0, 3))
113
+ issues.push(`${atPath("contributions.sealedValues", issue.path)} ${issue.message}`);
114
+ }
115
+ }
116
+ }
117
+ const hooks = contributions.hooks === undefined ? { durable: 0, issues: [] } : readHooks(contributions.hooks);
118
+ issues.push(...hooks.issues);
119
+ if (issues.length > 0)
120
+ return failed(`manifest.json declares its outbound requests, sealed values or durable hooks wrongly: ${listCapped(issues)}`);
121
+ // Core part 3 fix wave: an older CMS refuses these keys at its own schema step with a message
122
+ // that does not say why, so the package states the version that runs them.
123
+ // M33 K42: an older CMS ignores `heldEmbeds` and writes nothing for a tag's `{ embed }`.
124
+ const heldDeclared = contributions.heldEmbeds !== undefined;
125
+ // M33 K51 (part 7): an older CMS ignores a provider's `widgetScript`, so its widget loads no script.
126
+ const providers = contributions.protectionProviders;
127
+ const scriptDeclared = Array.isArray(providers) &&
128
+ providers.some((entry) => entry !== null && typeof entry === "object" && entry.widgetScript !== undefined);
129
+ // M33 K58 (part 7): an older CMS ignores a sign-in entry's `hostedDomainClaim` and would let a private
130
+ // account at a listed domain make or reach an account. `mark` is not held: an older CMS draws the icon.
131
+ const signIn = contributions.signInProviders;
132
+ const claimDeclared = Array.isArray(signIn) &&
133
+ signIn.some((entry) => entry !== null && typeof entry === "object" && entry.hostedDomainClaim !== undefined);
134
+ if (outboundDeclared || sealed !== undefined || hooks.durable > 0 || heldDeclared || scriptDeclared || claimDeclared) {
135
+ const range = typeof manifest.cmsVersion === "string" ? manifest.cmsVersion : null;
136
+ if (range === null || cmsRangeAdmitsBelow(range, SERVER_POWERS_CMS_FLOOR)) {
137
+ const named = range === null ? "no cmsVersion" : `cmsVersion ${JSON.stringify(range.length > CMS_RANGE_QUOTED_MAX ? `${range.slice(0, CMS_RANGE_QUOTED_MAX)}...` : range)}`;
138
+ return failed(`manifest.json uses outbound requests, sealed values, durable hooks, held embeds, a form protection widget script or a sign-in hosted domain claim with ${named}, which admits a version below ${SERVER_POWERS_CMS_FLOOR}: an older CMS cannot run them, so the range must start at ${SERVER_POWERS_CMS_FLOOR} (for example ">=${SERVER_POWERS_CMS_FLOOR}")`);
139
+ }
140
+ }
141
+ const parts = [
142
+ ...(outboundDeclared ? ["outbound requests"] : []),
143
+ ...(Array.isArray(sealed) ? [plural(sealed.length, "sealed value kind")] : []),
144
+ ...(hooks.durable > 0 ? [plural(hooks.durable, "durable hook")] : []),
145
+ ];
146
+ if (parts.length === 0)
147
+ return passed("no outbound requests, sealed values or durable hooks declared");
148
+ return passed(parts.length === 1 ? parts[0] : `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}`);
149
+ },
150
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const SERVICES_EVENTS_CHECK_NAME = "services and events";
3
+ export declare const servicesEventsCheck: DeliveryCheck;
@@ -0,0 +1,35 @@
1
+ import { checkServiceDeclarations, experimentalPointsDeclared, listIssues, readServiceDeclarations } from "@kardalum/api-schemas";
2
+ import { failed, passed, plural } from "./support.js";
3
+ // M35 B1a (W16): the 44th delivery check. The four keys and plugin event hook keys, by the rule the SDK's
4
+ // manifest schema and the server run (api-schemas). The comparison with versions on the marketplace
5
+ // (does an offer name a published version, has the owner grown its contract by the rule) is the door's
6
+ // (Task 16 of 35-B1a), and for an author the CLI's own "service contracts" check (35-B1c), which compares an
7
+ // offer or a use with the project's copy and, with --online, the marketplace, and online runs the growth rule
8
+ // on the plugin's own contracts. No CMS floor yet (the wave 1 decision).
9
+ export const SERVICES_EVENTS_CHECK_NAME = "services and events";
10
+ export const servicesEventsCheck = {
11
+ name: SERVICES_EVENTS_CHECK_NAME,
12
+ rule: "`serviceContracts`, `exposedServices`, `usedServices` and `events` follow the services rule: names and versions in their alphabets, " +
13
+ "method schemas in the contract subset (JSON Schema of plain data, built by `contractMethod`), no field named like a secret, no personal field in an event, " +
14
+ "an offer of the plugin's own contract implementing every method of the version it names; a `hooks` key names a core event or another plugin's event as `<plugin id>:<event name>`, never the plugin's own.",
15
+ gates: ["cli", "door"],
16
+ needsManifest: true,
17
+ run: ({ manifest }) => {
18
+ const issues = checkServiceDeclarations(manifest);
19
+ if (issues.length > 0)
20
+ return failed(`manifest.json declares its services or events wrongly: ${listIssues(issues)}`);
21
+ const declarations = readServiceDeclarations(manifest);
22
+ const parts = [
23
+ declarations.contracts.length > 0 ? plural(declarations.contracts.length, "contract") : null,
24
+ declarations.offers.length > 0 ? plural(declarations.offers.length, "offer") : null,
25
+ declarations.uses.length > 0 ? plural(declarations.uses.length, "use") : null,
26
+ declarations.events.length > 0 ? plural(declarations.events.length, "event") : null,
27
+ declarations.listens.length > 0 ? `hears ${plural(declarations.listens.length, "plugin event")}` : null,
28
+ ].filter((part) => part !== null);
29
+ if (parts.length === 0)
30
+ return passed("no services or plugin events declared");
31
+ const keys = ["serviceContracts", "exposedServices", "usedServices", "events"];
32
+ const experimental = experimentalPointsDeclared(manifest).filter((point) => keys.includes(point));
33
+ return passed(`${parts.join(", ")}${experimental.length > 0 ? ` (experimental: ${experimental.join(", ")})` : ""}`);
34
+ },
35
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const SIGN_IN_STEPS_CHECK_NAME = "sign-in steps";
3
+ export declare const signInStepsCheck: DeliveryCheck;
@@ -0,0 +1,71 @@
1
+ import { PROVIDER_ID_MAX, PROVIDER_LABEL_MAX, PROVIDER_TABLE_FUNCTIONS, PROVIDERS_PER_KIND_MAX, isProviderId, isSignInStepKind, signInStepDeclarationProblems, signInStepFunctionsProblem, signInStepManifestProblems, } from "@kardalum/api-schemas";
2
+ import { providerTextProblem } from "./providers.js";
3
+ import { contributionsOf, failed, list, passed, plural, record } from "./support.js";
4
+ // M35 U3a (D5): the delivery check that runs right after the `Providers and secrets` check. It owns
5
+ // `signInSteps` whole: the `Providers and secrets` check skips that key. A step entry keeps to the provider table's count, id and label rules, its kind's functions (live as functions,
6
+ // in manifest.json as names in `functions`), a description of at most SIGN_IN_DESCRIPTION_MAX
7
+ // (signInStepDeclarationProblems), and a factor step's plugin declares sealedValues and structured
8
+ // storage. Names a field, never a value.
9
+ export const SIGN_IN_STEPS_CHECK_NAME = "sign-in steps";
10
+ /** Every function a step kind may have, read from the one definition in api-schemas. */
11
+ const STEP_FUNCTION_NAMES = [...PROVIDER_TABLE_FUNCTIONS.signInStep.required, ...PROVIDER_TABLE_FUNCTIONS.signInStep.optional];
12
+ function present(entry) {
13
+ const names = new Set();
14
+ for (const name of STEP_FUNCTION_NAMES) {
15
+ if (typeof entry[name] === "function" || (Array.isArray(entry.functions) && entry.functions.includes(name)))
16
+ names.add(name);
17
+ }
18
+ return names;
19
+ }
20
+ export const signInStepsCheck = {
21
+ name: SIGN_IN_STEPS_CHECK_NAME,
22
+ rule: `\`signInSteps\` lists at most ${PROVIDERS_PER_KIND_MAX} steps, each with an \`id\` of 1 to ${PROVIDER_ID_MAX} lower-case letters, digits and "-", ` +
23
+ `a \`label\` of at most ${PROVIDER_LABEL_MAX} characters, a \`kind\` of "factor" and the functions \`status\`, \`challenge\`, \`verify\`, ` +
24
+ "`setupBegin`, `setupFinish` and `setupRemove`; a plugin with a factor step declares `sealedValues` and structured storage. Experimental.",
25
+ gates: ["cli", "door"],
26
+ needsManifest: true,
27
+ run: ({ manifest }) => {
28
+ const steps = contributionsOf(manifest).signInSteps;
29
+ if (steps === undefined)
30
+ return passed("no sign-in steps declared");
31
+ if (!Array.isArray(steps))
32
+ return failed("contributions.signInSteps must be a list");
33
+ const issues = [];
34
+ if (steps.length > PROVIDERS_PER_KIND_MAX)
35
+ issues.push(`contributions.signInSteps holds ${steps.length} entries; at most ${PROVIDERS_PER_KIND_MAX} are allowed`);
36
+ const seen = new Set();
37
+ list(steps)
38
+ .slice(0, PROVIDERS_PER_KIND_MAX + 1)
39
+ .forEach((raw, index) => {
40
+ const where = `contributions.signInSteps[${index}]`;
41
+ const entry = record(raw);
42
+ if (entry === null)
43
+ return void issues.push(`${where} must be an object`);
44
+ if (typeof entry.id !== "string" || !isProviderId(entry.id))
45
+ issues.push(`${where}.id must be 1 to ${PROVIDER_ID_MAX} lower-case letters, digits and "-"`);
46
+ else if (seen.has(entry.id))
47
+ issues.push(`${where}.id is used twice`);
48
+ else
49
+ seen.add(entry.id);
50
+ if (entry.label === undefined)
51
+ issues.push(`${where}.label is required`);
52
+ else {
53
+ const problem = providerTextProblem(entry.label, PROVIDER_LABEL_MAX);
54
+ if (problem !== null)
55
+ issues.push(`${where}.label ${problem}`);
56
+ }
57
+ // The description is signInStepDeclarationProblems' (SIGN_IN_DESCRIPTION_MAX, 160), named once, as the
58
+ // providers check leaves a sign-in provider's description to signInDeclarationProblems.
59
+ issues.push(...signInStepDeclarationProblems(entry, where));
60
+ if (isSignInStepKind(entry.kind)) {
61
+ const problem = signInStepFunctionsProblem(entry.kind, present(entry));
62
+ if (problem !== null)
63
+ issues.push(`${where}: ${problem}`);
64
+ }
65
+ });
66
+ issues.push(...signInStepManifestProblems(manifest));
67
+ if (issues.length > 0)
68
+ return failed(issues.join("; "));
69
+ return passed(`${plural(steps.length, "sign-in step")} (experimental: signInSteps)`);
70
+ },
71
+ };
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const siteExtensionsCheck: DeliveryCheck;
@@ -0,0 +1,69 @@
1
+ import { HELD_EMBEDS_DECLARED_MAX, HELD_EMBED_PATH_PREFIX_MAX, PAGE_HEAD_SCRIPT_ORIGINS_MAX, SITE_ROUTES_MAX, SITE_ROUTE_PARAMS_MAX, TEMPLATE_BLOCK_ON_FAILURE, TEMPLATE_EXTENSIONS_MAX, TEMPLATE_FILTER_ON_FAILURE, checkSiteExtensionDeclarations, experimentalPointsDeclared, listIssues, readSiteRoutePath, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, record } from "./support.js";
3
+ /** The contribution keys this check reads, so its pass line names only their experimental points. */
4
+ const SITE_EXTENSION_KEYS = new Set(["siteRoutes", "siteFallback", "templateFilters", "templateTags", "pageHead", "heldEmbeds", "pageOutput", "requestGuard", "responseHeaders", "pageCache", "pageGate"]);
5
+ const count = (n, one, many) => `${n} ${n === 1 ? one : many}`;
6
+ // M32 F2: the rules the SDK's manifest schema runs, read here from manifest.json so the CLI and the
7
+ // marketplace door cannot disagree.
8
+ export const siteExtensionsCheck = {
9
+ name: "site extensions",
10
+ rule: `\`siteRoutes\` (at most ${SITE_ROUTES_MAX}) are GET or POST site addresses outside the server's own: a fixed path, a GET one holding a "." in some segment, answers before the pages; ` +
11
+ `a path with \`:name\` parameters (at most ${SITE_ROUTE_PARAMS_MAX}), a last \`*\` or no "." in a GET answers after the pages, its first segment a fixed name no other plugin's route starts with; ` +
12
+ `\`templateFilters\` and \`templateTags\` (at most ${TEMPLATE_EXTENSIONS_MAX} each) have lower-case names used as <the id's last segment>_<name>; a tag's \`block\` is \`true\` when given, ` +
13
+ `a filter's \`onFailure\` is one of ${TEMPLATE_FILTER_ON_FAILURE.join(", ")} and a block tag's one of ${TEMPLATE_BLOCK_ON_FAILURE.join(", ")}; ` +
14
+ `\`pageHead.scriptOrigins\` (at most ${PAGE_HEAD_SCRIPT_ORIGINS_MAX}) are bare https origins; ` +
15
+ `\`pageHead.inlineSnippets\` is \`true\` when declared; \`pageOutput\` is \`true\` or an object (its \`transform\` is code); ` +
16
+ `\`requestGuard\`, \`responseHeaders\`, \`pageGate\` and \`pageCache\` are \`true\` or an object (each is code); a site route's \`rawBody\` is \`true\` on a POST route; its \`uploads\` is a good declaration on a POST route without \`rawBody\`; ` +
17
+ `\`heldEmbeds\` (at most ${HELD_EMBEDS_DECLARED_MAX}) each name a bare https origin, a path prefix of at most ${HELD_EMBED_PATH_PREFIX_MAX} characters that starts and ends with "/", holds no "..", "%2e", "%2f" or "%5c" and is written as the URL parser writes it, a provider, an https privacy notice and a kind.`,
18
+ gates: ["cli", "door"],
19
+ needsManifest: true,
20
+ run: ({ manifest }) => {
21
+ const issues = checkSiteExtensionDeclarations(manifest);
22
+ if (issues.length > 0)
23
+ return failed(`manifest.json declares its site extensions wrongly: ${listIssues(issues)}`);
24
+ const contributions = contributionsOf(manifest);
25
+ const parts = [];
26
+ const routeList = list(contributions.siteRoutes);
27
+ if (routeList.length > 0) {
28
+ const after = routeList.filter((route) => {
29
+ const entry = record(route);
30
+ if (entry === null || typeof entry.method !== "string" || typeof entry.path !== "string")
31
+ return false;
32
+ const read = readSiteRoutePath(entry.method, entry.path);
33
+ return read.ok && read.pattern.phase === "afterPages";
34
+ }).length;
35
+ parts.push(`${count(routeList.length, "site route", "site routes")}${after > 0 ? ` (${after} after the pages)` : ""}`);
36
+ }
37
+ if (contributions.siteFallback !== undefined)
38
+ parts.push("a fallback");
39
+ if (contributions.requestGuard !== undefined)
40
+ parts.push("a request guard");
41
+ if (contributions.responseHeaders !== undefined)
42
+ parts.push("response headers");
43
+ if (contributions.pageGate !== undefined)
44
+ parts.push("a page gate");
45
+ const tagList = list(contributions.templateTags);
46
+ const names = list(contributions.templateFilters).length + tagList.length;
47
+ const blocks = tagList.filter((tag) => record(tag)?.block === true).length;
48
+ if (names > 0)
49
+ parts.push(`${count(names, "template name", "template names")}${blocks > 0 ? ` (${count(blocks, "block tag", "block tags")})` : ""}`);
50
+ const head = record(contributions.pageHead);
51
+ if (head !== null) {
52
+ const title = head.setsTitle === true ? " that sets the page title" : "";
53
+ const inline = head.inlineSnippets === true ? `${title === "" ? " that" : " and"} writes inline code` : "";
54
+ parts.push(`page head with ${count(list(head.scriptOrigins).length, "script origin", "script origins")}${title}${inline}`);
55
+ }
56
+ const held = list(contributions.heldEmbeds).length;
57
+ if (held > 0)
58
+ parts.push(count(held, "held embed", "held embeds"));
59
+ if (contributions.pageOutput !== undefined)
60
+ parts.push("a page output transform");
61
+ if (contributions.pageCache !== undefined)
62
+ parts.push("a page cache");
63
+ if (parts.length === 0)
64
+ return passed("no site extensions declared");
65
+ // M35 P1 (D4): the experimental points among these keys, so an author knows what may still change.
66
+ const experimental = experimentalPointsDeclared(manifest).filter((point) => SITE_EXTENSION_KEYS.has(point.split(".")[0]));
67
+ return passed(`${parts.join(", ")}${experimental.length > 0 ? ` (experimental: ${experimental.join(", ")})` : ""}`);
68
+ },
69
+ };
@@ -1,5 +1,6 @@
1
1
  import type { DeliveryCheck } from "./types.js";
2
2
  export declare const templateDeclarationsCheck: DeliveryCheck;
3
+ export declare const declaredDataTypesCheck: DeliveryCheck;
3
4
  export declare const templateFilesCheck: DeliveryCheck;
4
5
  export declare const templateWiringCheck: DeliveryCheck;
5
6
  export declare const assetsCheck: DeliveryCheck;
@@ -1,6 +1,6 @@
1
1
  import { lstatSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { MAX_ASSET_CONTENT_BYTES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkTemplateAndAssetDeclarations, effectiveDocsPages, isAssetTextPath, listIssues, } from "@kardalum/api-schemas";
3
+ import { MAX_ASSET_CONTENT_BYTES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_DATA_TYPE_CONFIGS_MAX, PluginAssetPathSchema, PluginTemplateFileSchema, PluginTemplatePayloadSchema, RESERVED_ASSET_ROOTS, TEMPLATE_KINDS, checkDataTypeConfigDeclarations, checkTemplateAndAssetDeclarations, effectiveDocsPages, isAssetTextPath, listIssues, } from "@kardalum/api-schemas";
4
4
  import { docsFilesToShip } from "../docs-contract.js";
5
5
  import { createShippedLookup, walkShipped } from "../shipped-files.js";
6
6
  import { formatBinarySize } from "./limits.js";
@@ -67,6 +67,26 @@ export const templateDeclarationsCheck = {
67
67
  return passed(`${plural(list(c.templates).length, "template")}, ${plural(list(c.assets).length, "asset")}: declarations valid`);
68
68
  },
69
69
  };
70
+ // M32 K (J6): the declared data types are their own check, by the one rule the SDK's manifest schema
71
+ // and the install read (moved out of template declarations valid, unchanged).
72
+ export const declaredDataTypesCheck = {
73
+ name: "declared data types",
74
+ rule: `Declared data types (\`dataTypeConfigs\`, at most ${PLUGIN_DATA_TYPE_CONFIGS_MAX}) have unique names that are not ids, a built-in editor or one of the plugin's own, ` +
75
+ "references only to data types declared before them, pickers that name the manifest's own document types and no start node, " +
76
+ "and, for a group, a repeatable list, a content picker, an options list and a link, settings their editor accepts " +
77
+ "(the install checks the settings of the other built-in editors only where the editor has a settings schema; for number, boolean, date, richtext and daterange, and for the plugin's own editors, the server stores the settings as declared).",
78
+ gates: ["cli", "door"],
79
+ needsManifest: true,
80
+ run: ({ manifest }) => {
81
+ const declared = contributionsOf(manifest).dataTypeConfigs;
82
+ if (declared === undefined)
83
+ return passed("no data types declared");
84
+ const issues = checkDataTypeConfigDeclarations(manifest);
85
+ if (issues.length > 0)
86
+ return failed(listIssues(issues, 10));
87
+ return passed(`${plural(list(declared).length, "declared data type")} valid`);
88
+ },
89
+ };
70
90
  // S311 fix wave (W1): a declared file is there when the build carries it into
71
91
  // the package (whyNotShipped, the rule the CLI's copy follows), not merely when
72
92
  // it is on disk: a file under a left-out folder such as dist/, or behind a
@@ -1,3 +1,4 @@
1
+ import type { RichTextVersionSummary } from "@kardalum/api-schemas";
1
2
  import type { DocsContractInput } from "../docs-contract.js";
2
3
  import type { ShippedSampleContent } from "../sample-content.js";
3
4
  export type DeliveryGate = "cli" | "door";
@@ -34,6 +35,22 @@ export interface DeliveryContext {
34
35
  * here, so a gate parses the file once. The door hands its own read on to
35
36
  * the stored install interface. */
36
37
  sampleContent?: ShippedSampleContent;
38
+ /** S367d (D8): the door's answer to "is this a paid plugin": a live plan
39
+ * with a price above 0. The manifest's `price` counts at both gates. */
40
+ paid?: boolean;
41
+ /** S367d (D8): where server/plugin.js is when not under `dir`/server: the
42
+ * CLI bundles the server entry for the licence check, with the error when
43
+ * that failed. The door's package holds its own server folder. */
44
+ server?: {
45
+ dir: string;
46
+ buildError?: string;
47
+ };
48
+ /** M35 C4b (C4b-D13): the previous published version's rich text summary, which the door reads from its own store and
49
+ * `validate --online` from the listing; absent offline. `summary` is null for a version stored before summaries. */
50
+ previousRichText?: {
51
+ version: string;
52
+ summary: RichTextVersionSummary | null;
53
+ };
37
54
  }
38
55
  export interface DeliveryRunContext extends Omit<DeliveryContext, "manifest"> {
39
56
  manifest: Record<string, unknown>;
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const USER_ACCOUNTS_CHECK_NAME = "user accounts";
3
+ export declare const userAccountsCheck: DeliveryCheck;
@@ -0,0 +1,36 @@
1
+ import { PLUGIN_USER_ACCESS_ACTIONS, PLUGIN_USER_FIELDS_MAX, checkUserAccessDeclarations, checkUserFieldsDeclarations, experimentalPointsDeclared, listIssues } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, plural, record } from "./support.js";
3
+ // M35 U1 (W6): the 43rd delivery check. `userAccess` and `userFields` are checked by the schemas the
4
+ // SDK's manifest schema runs (api-schemas). No CMS floor yet: the workspace is at the published
5
+ // 0.20.0, and the floor for every month 35 point comes with the next release's version bump (D8).
6
+ // The pass line names the experimental points the package declares.
7
+ export const USER_ACCOUNTS_CHECK_NAME = "user accounts";
8
+ export const userAccountsCheck = {
9
+ name: USER_ACCOUNTS_CHECK_NAME,
10
+ rule: `\`userAccess\` is an object whose \`actions\` names 1 or more of ${PLUGIN_USER_ACCESS_ACTIONS.map((a) => `\`${a}\``).join(", ")}, each once, \`users.update\` only with \`users.read\`; ` +
11
+ `\`userFields\` lists at most ${PLUGIN_USER_FIELDS_MAX} account fields of the plugin settings field types other than \`secret\`, each id once and none \`askAtInstall\`.`,
12
+ gates: ["cli", "door"],
13
+ needsManifest: true,
14
+ run: ({ manifest }) => {
15
+ const problems = [];
16
+ const access = checkUserAccessDeclarations(manifest);
17
+ const fields = checkUserFieldsDeclarations(manifest);
18
+ if (access.length > 0)
19
+ problems.push(`manifest.json declares its account access wrongly: ${listIssues(access)}`);
20
+ if (fields.length > 0)
21
+ problems.push(`manifest.json declares its account fields wrongly: ${listIssues(fields)}`);
22
+ if (problems.length > 0)
23
+ return failed(problems.join("; "));
24
+ const contributions = contributionsOf(manifest);
25
+ const accessDeclared = contributions.userAccess !== undefined;
26
+ const fieldsDeclared = contributions.userFields !== undefined;
27
+ if (!accessDeclared && !fieldsDeclared)
28
+ return passed("no account access or account fields declared");
29
+ const parts = [
30
+ ...(accessDeclared ? [`account access: ${list(record(contributions.userAccess)?.actions).map(String).join(", ")}`] : []),
31
+ ...(fieldsDeclared ? [plural(list(contributions.userFields).length, "account field")] : []),
32
+ ];
33
+ const experimental = experimentalPointsDeclared(manifest).filter((point) => point === "userAccess" || point === "userFields");
34
+ return passed(`${parts.join("; ")}${experimental.length > 0 ? ` (experimental: ${experimental.join(", ")})` : ""}`);
35
+ },
36
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const VISITOR_POINTS_CHECK_NAME = "visitor accounts";
3
+ export declare const visitorPointsCheck: DeliveryCheck;
@@ -0,0 +1,33 @@
1
+ import { PLUGIN_VISITOR_ACCOUNT_SECTIONS_MAX, PLUGIN_VISITOR_GROUPS_MAX, VISITOR_POINTS_WITHOUT_DATA_WARNING, checkVisitorPointDeclarations, experimentalPointsDeclared, listIssues } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, list, passed, plural, record, warning } from "./support.js";
3
+ // M35 U2b (W8, design 4.13): the visitor points, checked by the rules the SDK's manifest schema runs
4
+ // (api-schemas' checkVisitorPointDeclarations). The functions (`data`, `export`, `erase`) are the SDK's
5
+ // runtime check: manifest.json carries none. The pass line names the experimental points declared.
6
+ export const VISITOR_POINTS_CHECK_NAME = "visitor accounts";
7
+ const VISITOR_KEYS = ["visitorIdentity", "visitorGroups", "visitorAccountSections", "visitorData"];
8
+ export const visitorPointsCheck = {
9
+ name: VISITOR_POINTS_CHECK_NAME,
10
+ rule: `\`visitorGroups\` (1 to ${PLUGIN_VISITOR_GROUPS_MAX} groups), \`visitorAccountSections\` (1 to ${PLUGIN_VISITOR_ACCOUNT_SECTIONS_MAX} sections, each drawn with one of the plugin's own partial templates) and \`visitorData\` each need \`visitorIdentity\`; ` +
11
+ "an id is 1 to 40 of a-z, 0-9, `-` and `_`, a letter first, each once. `visitorIdentity` without `visitorData` warns: deletion and export reach only what a plugin declares.",
12
+ gates: ["cli", "door"],
13
+ needsManifest: true,
14
+ run: ({ manifest }) => {
15
+ const issues = checkVisitorPointDeclarations(manifest);
16
+ if (issues.length > 0)
17
+ return failed(`manifest.json declares its visitor points wrongly: ${listIssues(issues)}`);
18
+ const contributions = contributionsOf(manifest);
19
+ if (VISITOR_KEYS.every((key) => contributions[key] === undefined))
20
+ return passed("no visitor points declared");
21
+ if (contributions.visitorIdentity !== undefined && contributions.visitorData === undefined)
22
+ return warning(VISITOR_POINTS_WITHOUT_DATA_WARNING);
23
+ const identity = record(contributions.visitorIdentity);
24
+ const parts = [
25
+ ...(contributions.visitorIdentity !== undefined ? [identity?.email === true ? "visitor identity with email" : "visitor identity"] : []),
26
+ ...(contributions.visitorGroups !== undefined ? [plural(list(contributions.visitorGroups).length, "visitor group")] : []),
27
+ ...(contributions.visitorAccountSections !== undefined ? [plural(list(contributions.visitorAccountSections).length, "account section")] : []),
28
+ ...(contributions.visitorData !== undefined ? ["visitor data"] : []),
29
+ ];
30
+ const experimental = experimentalPointsDeclared(manifest).filter((point) => VISITOR_KEYS.includes(point) || point.startsWith("hooks.visitor:"));
31
+ return passed(`${parts.join("; ")}${experimental.length > 0 ? ` (experimental: ${experimental.join(", ")})` : ""}`);
32
+ },
33
+ };