@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
@@ -0,0 +1,316 @@
1
+ import { PLUGIN_MAIL_KINDS_MAX, PLUGIN_MAIL_KIND_ID_MAX, PLUGIN_SECRETS_MAX, PLUGIN_SECRET_NAME_MAX, PROTECTION_FIELD_PREFIX_MAX, PROTECTION_FIELD_PREFIX_MIN, PROVIDERS_PER_KIND_MAX, PROVIDER_DESCRIPTION_MAX, PROVIDER_ID_MAX, PROVIDER_LABEL_MAX, PROVIDER_TABLE_CONTRIBUTION_KEYS, PROVIDER_TABLE_FUNCTIONS, PROVIDER_TABLE_KINDS, PluginLabelSchema, SIGN_IN_DESCRIPTION_MAX, SIGN_IN_HOSTED_DOMAIN_CLAIM_MAX, SIGN_IN_MARK_BYTES_MAX, SIGN_IN_MARK_NAME_MAX, SIGN_IN_MARK_NAME_MIN, SIGN_IN_MARK_PX_MAX, SIGN_IN_MARK_PX_MIN, SIGN_IN_SCOPES_MAX, SIGN_IN_URL_MAX, SIGN_IN_USERINFO_URLS_MAX, isPluginMailKindId, isPluginSecretName, isProtectionFieldPrefix, isProtectionWidgetScript, isConsentToolFile, isProviderId, isProviderText, isSignInMark, signInDeclarationProblems, } from "@kardalum/api-schemas";
2
+ import { readFileSync, statSync } from "node:fs";
3
+ import { join } from "node:path";
4
+ import { pngSize } from "../package-contract.js";
5
+ import { createShippedLookup } from "../shipped-files.js";
6
+ import { contributionsOf, failed, listCapped, passed, plural, record } from "./support.js";
7
+ // M32 F4 (D8): the 39th delivery check. It reads the provider keys and the secrets list from the
8
+ // manifest, the live one at `kardalum plugin validate` and the redacted manifest.json at the door. The
9
+ // rules and limits are api-schemas'; a message names the declaration by position and never quotes
10
+ // what the author wrote. M32 F4b (D33) adds `signInProviders` to the same check (it stays the 39th):
11
+ // the shared base, then signInDeclarationProblems against the secrets the manifest declares.
12
+ export const PROVIDERS_CHECK_NAME = "Providers and secrets";
13
+ const CHECKED_KINDS = PROVIDER_TABLE_KINDS.filter((kind) => kind !== "signInStep");
14
+ /** The words that count each table kind's entries in the check's summary. */
15
+ const KIND_WORDS = {
16
+ formProtection: { one: "form protection provider", many: "form protection providers" },
17
+ search: { one: "search provider", many: "search providers" },
18
+ mediaStore: { one: "media store", many: "media stores" },
19
+ mail: { one: "mail sender", many: "mail senders" },
20
+ consent: { one: "consent tool", many: "consent tools" },
21
+ signIn: { one: "sign-in provider", many: "sign-in providers" },
22
+ };
23
+ /** Per kind: the functions a provider must have, the ones it may have, and the words that count it. */
24
+ const KINDS = CHECKED_KINDS.map((kind) => ({
25
+ key: PROVIDER_TABLE_CONTRIBUTION_KEYS[kind],
26
+ ...PROVIDER_TABLE_FUNCTIONS[kind],
27
+ ...KIND_WORDS[kind],
28
+ }));
29
+ /** A language-map or plain label's texts, or null when it is neither. */
30
+ function labelTexts(value) {
31
+ if (typeof value === "string")
32
+ return [value];
33
+ const map = record(value);
34
+ if (map === null)
35
+ return null;
36
+ const texts = [];
37
+ for (const text of Object.values(map)) {
38
+ if (typeof text !== "string")
39
+ return null;
40
+ texts.push(text);
41
+ }
42
+ return texts;
43
+ }
44
+ /** The valid secret names the manifest declares, which a sign-in provider's secret fields must name. */
45
+ function declaredSecretNamesOf(value) {
46
+ const names = new Set();
47
+ if (!Array.isArray(value))
48
+ return names;
49
+ for (const raw of value.slice(0, PLUGIN_SECRETS_MAX)) {
50
+ const name = record(raw)?.name;
51
+ if (typeof name === "string" && isPluginSecretName(name))
52
+ names.add(name);
53
+ }
54
+ return names;
55
+ }
56
+ /** The problem with a label or description, or null: the texts keep to `max` and are readable, and the shape is the manifest's label. */
57
+ export function providerTextProblem(value, max) {
58
+ const texts = labelTexts(value);
59
+ if (texts === null || texts.length === 0)
60
+ return "must be text, or a map of language to text with English";
61
+ for (const text of texts) {
62
+ if (text.length > max)
63
+ return `is at most ${max} characters`;
64
+ if (!isProviderText(text, max))
65
+ return "must not be blank or hold a control or hidden character";
66
+ }
67
+ // A map also keeps to the manifest's label map rule (English present, every key a language code): the texts were checked above, so the rule runs on the keys alone.
68
+ if (typeof value !== "string" && !PluginLabelSchema.safeParse(Object.fromEntries(Object.keys(value).map((key) => [key, "x"]))).success)
69
+ return "must be text, or a map of language to text with English";
70
+ return null;
71
+ }
72
+ /** Whether the entry has the function: live as a function, redacted as a name in its `functions` list. */
73
+ function hasFunction(entry, name) {
74
+ if (typeof entry[name] === "function")
75
+ return true;
76
+ return Array.isArray(entry.functions) && entry.functions.includes(name);
77
+ }
78
+ function checkEntryText(entry, where, issues, labelRequired, descriptionChecked = true) {
79
+ if (entry.label === undefined) {
80
+ if (labelRequired)
81
+ issues.push(`${where}.label is required`);
82
+ }
83
+ else {
84
+ const problem = providerTextProblem(entry.label, PROVIDER_LABEL_MAX);
85
+ if (problem !== null)
86
+ issues.push(`${where}.label ${problem}`);
87
+ }
88
+ if (descriptionChecked && entry.description !== undefined) {
89
+ const problem = providerTextProblem(entry.description, PROVIDER_DESCRIPTION_MAX);
90
+ if (problem !== null)
91
+ issues.push(`${where}.description ${problem}`);
92
+ }
93
+ }
94
+ /**
95
+ * M33 K57: the problem with a sign-in button's picture, or null. The name is signInDeclarationProblems'
96
+ * rule; only a name that passes it is opened. The file must ship, be at most SIGN_IN_MARK_BYTES_MAX
97
+ * bytes (its size read before any byte is), and be a PNG whose header says square, SIGN_IN_MARK_PX_MIN
98
+ * to SIGN_IN_MARK_PX_MAX pixels a side, read by pngSize, the one header reader the cover check uses.
99
+ */
100
+ function markProblem(dir, mark, where, whyNotShipped) {
101
+ if (!isSignInMark(mark))
102
+ return null;
103
+ const path = `public/${mark}`;
104
+ const said = `${where}.mark names ${path}, which`;
105
+ const why = whyNotShipped(path);
106
+ if (why !== null)
107
+ return `${said} ${why}`;
108
+ const file = join(dir, "public", mark);
109
+ if (statSync(file).size > SIGN_IN_MARK_BYTES_MAX)
110
+ return `${said} is larger than ${SIGN_IN_MARK_BYTES_MAX} bytes`;
111
+ const size = pngSize(readFileSync(file));
112
+ if (size === null)
113
+ return `${said} is not a PNG`;
114
+ if (size.width !== size.height)
115
+ return `${said} is not square: it is ${size.width} by ${size.height} pixels`;
116
+ if (size.width < SIGN_IN_MARK_PX_MIN || size.width > SIGN_IN_MARK_PX_MAX) {
117
+ return `${said} is ${size.width} pixels a side; a picture is ${SIGN_IN_MARK_PX_MIN} to ${SIGN_IN_MARK_PX_MAX}`;
118
+ }
119
+ return null;
120
+ }
121
+ function checkProviders(kind, value, issues, declaredSecretNames, whyNotShipped, dir) {
122
+ const base = `contributions.${kind.key}`;
123
+ if (!Array.isArray(value)) {
124
+ issues.push(`${base} must be a list`);
125
+ return 0;
126
+ }
127
+ if (value.length > PROVIDERS_PER_KIND_MAX)
128
+ issues.push(`${base} holds ${value.length} entries; at most ${PROVIDERS_PER_KIND_MAX} are allowed`);
129
+ const seen = new Set();
130
+ // Past the cap one more entry is read, so the list is refused once and a huge one costs little.
131
+ value.slice(0, PROVIDERS_PER_KIND_MAX + 1).forEach((raw, index) => {
132
+ const where = `${base}[${index}]`;
133
+ const entry = record(raw);
134
+ if (entry === null) {
135
+ issues.push(`${where} must be an object`);
136
+ return;
137
+ }
138
+ const id = entry.id;
139
+ if (typeof id !== "string" || !isProviderId(id)) {
140
+ issues.push(`${where}.id must be 1 to ${PROVIDER_ID_MAX} lower-case letters, digits and "-", starting with a letter and not ending with "-"`);
141
+ }
142
+ else if (seen.has(id)) {
143
+ issues.push(`${where}.id is used twice in ${kind.key}`);
144
+ }
145
+ else {
146
+ seen.add(id);
147
+ }
148
+ // M33 K56: a sign-in entry's description is signInDeclarationProblems' (SIGN_IN_DESCRIPTION_MAX, no direction character), so it is named once.
149
+ checkEntryText(entry, where, issues, true, kind.key !== "signInProviders");
150
+ if (kind.key === "protectionProviders") {
151
+ const prefix = entry.fieldPrefix;
152
+ if (typeof prefix !== "string" || !isProtectionFieldPrefix(prefix)) {
153
+ issues.push(`${where}.fieldPrefix must be ${PROTECTION_FIELD_PREFIX_MIN} to ${PROTECTION_FIELD_PREFIX_MAX} lower-case letters, digits and "_", starting with a letter, ending with "_" and not starting with "kp"`);
154
+ }
155
+ // M33 K51: the provider's own script, a .js file of public/ by the one rule, that the package carries.
156
+ const widgetScript = entry.widgetScript;
157
+ if (widgetScript !== undefined) {
158
+ if (!isProtectionWidgetScript(widgetScript)) {
159
+ issues.push(`${where}.widgetScript must name a .js file in the plugin's public/ folder, such as "captcha.js"`);
160
+ }
161
+ else {
162
+ const why = whyNotShipped(`public/${widgetScript}`);
163
+ if (why !== null)
164
+ issues.push(`${where}.widgetScript names public/${widgetScript}, which ${why}`);
165
+ }
166
+ }
167
+ }
168
+ if (kind.key === "consentTools") {
169
+ // M35 P5 (P5-D5): the tool's script and stylesheet, files of public/ by the one rule, that the package carries.
170
+ for (const [field, extension, example] of [["script", ".js", 'such as "consent.js"'], ["stylesheet", ".css", 'such as "consent.css"']]) {
171
+ const file = entry[field];
172
+ if (file === undefined && field === "stylesheet")
173
+ continue;
174
+ if (!isConsentToolFile(file, extension)) {
175
+ issues.push(`${where}.${field} must name a ${extension} file in the plugin's public/ folder, ${example}`);
176
+ continue;
177
+ }
178
+ const why = whyNotShipped(`public/${file}`);
179
+ if (why !== null)
180
+ issues.push(`${where}.${field} names public/${file}, which ${why}`);
181
+ }
182
+ }
183
+ if (kind.key === "signInProviders") {
184
+ // The protocol decides whether `profile` is required or refused, so its rule is signInDeclarationProblems' alone.
185
+ issues.push(...signInDeclarationProblems(entry, declaredSecretNames, where));
186
+ const mark = markProblem(dir, entry.mark, where, whyNotShipped);
187
+ if (mark !== null)
188
+ issues.push(mark);
189
+ return;
190
+ }
191
+ for (const name of kind.required)
192
+ if (!hasFunction(entry, name))
193
+ issues.push(`${where}.${name} must be a function`);
194
+ for (const name of kind.optional) {
195
+ if (entry[name] !== undefined && !hasFunction(entry, name))
196
+ issues.push(`${where}.${name} must be a function`);
197
+ }
198
+ });
199
+ return value.length;
200
+ }
201
+ /** M32 H (H19): the form replies declaration is one object with a label and an optional description. */
202
+ function checkFormReplies(value, issues) {
203
+ const entry = record(value);
204
+ if (entry === null) {
205
+ issues.push("contributions.formReplies must be an object");
206
+ return;
207
+ }
208
+ checkEntryText(entry, "contributions.formReplies", issues, true);
209
+ }
210
+ /** M33 K11: at most 10 mail kinds, each an id used once, a label and, when given, a description. */
211
+ function checkMailKinds(value, issues) {
212
+ if (!Array.isArray(value)) {
213
+ issues.push("contributions.mailKinds must be a list");
214
+ return 0;
215
+ }
216
+ if (value.length > PLUGIN_MAIL_KINDS_MAX)
217
+ issues.push(`contributions.mailKinds holds ${value.length} entries; at most ${PLUGIN_MAIL_KINDS_MAX} are allowed`);
218
+ const seen = new Set();
219
+ value.slice(0, PLUGIN_MAIL_KINDS_MAX + 1).forEach((raw, index) => {
220
+ const where = `contributions.mailKinds[${index}]`;
221
+ const entry = record(raw);
222
+ if (entry === null) {
223
+ issues.push(`${where} must be an object`);
224
+ return;
225
+ }
226
+ const id = entry.id;
227
+ if (typeof id !== "string" || !isPluginMailKindId(id)) {
228
+ issues.push(`${where}.id must be a letter, then letters, digits and "_", 1 to ${PLUGIN_MAIL_KIND_ID_MAX} characters`);
229
+ }
230
+ else if (seen.has(id)) {
231
+ issues.push(`${where}.id is used twice in mailKinds`);
232
+ }
233
+ else {
234
+ seen.add(id);
235
+ }
236
+ checkEntryText(entry, where, issues, true);
237
+ });
238
+ return value.length;
239
+ }
240
+ function checkSecrets(value, issues) {
241
+ if (!Array.isArray(value)) {
242
+ issues.push("contributions.secrets must be a list");
243
+ return 0;
244
+ }
245
+ if (value.length > PLUGIN_SECRETS_MAX)
246
+ issues.push(`contributions.secrets holds ${value.length} entries; at most ${PLUGIN_SECRETS_MAX} are allowed`);
247
+ const seen = new Set();
248
+ value.slice(0, PLUGIN_SECRETS_MAX + 1).forEach((raw, index) => {
249
+ const where = `contributions.secrets[${index}]`;
250
+ const entry = record(raw);
251
+ if (entry === null) {
252
+ issues.push(`${where} must be an object`);
253
+ return;
254
+ }
255
+ const name = entry.name;
256
+ if (typeof name !== "string" || !isPluginSecretName(name)) {
257
+ issues.push(`${where}.name must be 1 to ${PLUGIN_SECRET_NAME_MAX} lower-case letters, digits and "_", starting with a letter`);
258
+ }
259
+ else if (seen.has(name)) {
260
+ issues.push(`${where}.name is used twice in secrets`);
261
+ }
262
+ else {
263
+ seen.add(name);
264
+ }
265
+ checkEntryText(entry, where, issues, true);
266
+ });
267
+ return value.length;
268
+ }
269
+ export const providersCheck = {
270
+ name: PROVIDERS_CHECK_NAME,
271
+ rule: `\`protectionProviders\`, \`searchProviders\` and \`mediaStores\` hold at most ${PROVIDERS_PER_KIND_MAX} entries each, with an \`id\` of 1 to ${PROVIDER_ID_MAX} lower-case letters, digits and "-" starting with a letter, used once in its list, ` +
272
+ `a \`label\` of at most ${PROVIDER_LABEL_MAX} characters and, when given, a \`description\` of at most ${PROVIDER_DESCRIPTION_MAX}; a form protection provider has a \`fieldPrefix\` of ${PROTECTION_FIELD_PREFIX_MIN} to ${PROTECTION_FIELD_PREFIX_MAX} lower-case letters, digits and "_" that ends with "_" and does not start with "kp", a \`verify\` function and, when given, a \`widgetScript\` naming a \`.js\` file of its \`public/\` folder that the package carries; ` +
273
+ "a search provider has `index`, `remove` and `query` functions; a media store has `put`, `open`, `delete` and `exists` functions. " +
274
+ `\`signInProviders\` keeps to the same count, id and label rules; an \`oidc\` entry declares exactly one of \`issuer\` and \`issuerSecret\` and no \`profile\`, an \`oauth2\` entry declares \`authorizationUrl\`, \`tokenUrl\`, 1 to ${SIGN_IN_USERINFO_URLS_MAX} \`userInfoUrls\` and a \`profile\` function, every address is https with no credentials or fragment and at most ${SIGN_IN_URL_MAX} characters, \`scopes\` lists 1 to ${SIGN_IN_SCOPES_MAX} distinct scopes, \`clientIdSecret\` and \`clientSecretSecret\` name two different secrets the plugin declares in \`secrets\` (as \`issuerSecret\` does when given), and \`icon\` and \`clientAuth\` are a listed value when given; a sign-in entry's \`description\` is at most ${SIGN_IN_DESCRIPTION_MAX} characters per language with no control, direction or other hidden character, its \`mark\`, when given, names a PNG of its \`public/\` folder (${SIGN_IN_MARK_NAME_MIN} to ${SIGN_IN_MARK_NAME_MAX} lower-case letters, digits and "-", ending in ".png") that the package carries, square, ${SIGN_IN_MARK_PX_MIN} to ${SIGN_IN_MARK_PX_MAX} pixels a side and at most ${SIGN_IN_MARK_BYTES_MAX.toLocaleString("en-US")} bytes, and its \`hostedDomainClaim\`, on an \`oidc\` entry only, is 1 to ${SIGN_IN_HOSTED_DOMAIN_CLAIM_MAX} characters: a lower-case letter, then lower-case letters, digits and "_". ` +
275
+ "`mailSenders` keeps to the same count, id and label rules, and a mail sender has a `send` function (`ready` is optional). " +
276
+ "`consentTools` keeps to the same count, id and label rules, and a consent tool has a `script` naming a `.js` file and, when given, a `stylesheet` naming a `.css` file of its `public/` folder that the package carries; `formReplies` is one object with a `label` and, when given, a `description`, kept to the same limits. " +
277
+ `\`mailKinds\` holds at most ${PLUGIN_MAIL_KINDS_MAX} kinds of email, each with an \`id\` of a letter, then letters, digits and "_", 1 to ${PLUGIN_MAIL_KIND_ID_MAX} characters, used once, a \`label\` and, when given, a \`description\`, kept to the same limits. ` +
278
+ `\`secrets\` holds at most ${PLUGIN_SECRETS_MAX} entries, each with a \`name\` of 1 to ${PLUGIN_SECRET_NAME_MAX} lower-case letters, digits and "_" starting with a letter, used once, and a \`label\` and \`description\` kept to the same limits. A label or description is text, or a map of language to text with English.`,
279
+ gates: ["cli", "door"],
280
+ needsManifest: true,
281
+ run: ({ dir, manifest }) => {
282
+ const contributions = contributionsOf(manifest);
283
+ const issues = [];
284
+ const parts = [];
285
+ const declaredSecretNames = declaredSecretNamesOf(contributions.secrets);
286
+ // Made only when a widget script or a sign-in picture asks, so a check with neither reads no folder.
287
+ let lookup;
288
+ const whyNotShipped = (path) => (lookup ??= createShippedLookup(dir))(path);
289
+ for (const kind of KINDS) {
290
+ if (contributions[kind.key] === undefined)
291
+ continue;
292
+ const count = checkProviders(kind, contributions[kind.key], issues, declaredSecretNames, whyNotShipped, dir);
293
+ if (count > 0)
294
+ parts.push(`${count} ${count === 1 ? kind.one : kind.many}`);
295
+ }
296
+ if (contributions.formReplies !== undefined) {
297
+ const before = issues.length;
298
+ checkFormReplies(contributions.formReplies, issues);
299
+ if (issues.length === before)
300
+ parts.push("form replies");
301
+ }
302
+ if (contributions.mailKinds !== undefined) {
303
+ const count = checkMailKinds(contributions.mailKinds, issues);
304
+ if (count > 0)
305
+ parts.push(plural(count, "mail kind"));
306
+ }
307
+ if (contributions.secrets !== undefined) {
308
+ const count = checkSecrets(contributions.secrets, issues);
309
+ if (count > 0)
310
+ parts.push(plural(count, "secret"));
311
+ }
312
+ if (issues.length > 0)
313
+ return failed(`manifest.json declares its providers or secrets wrongly: ${listCapped(issues)}`);
314
+ return parts.length === 0 ? passed("no providers or secrets declared") : passed(parts.join(", "));
315
+ },
316
+ };
@@ -1,17 +1,32 @@
1
- import { FILE_NAME_MAX, MAX_DOC_PAGE_BYTES, MAX_ASSET_CONTENT_BYTES, MAX_DOC_PAGES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_AUTHOR_MAX, PLUGIN_CMS_VERSION_MAX, PLUGIN_DESCRIPTION_MAX, PLUGIN_ID_MAX, PLUGIN_LICENSE_MAX, PLUGIN_LOCALE_KEY_MAX_LENGTH, PLUGIN_LOCALE_MAX_BYTES, PLUGIN_LOCALE_MAX_KEYS, PLUGIN_LOCALE_VALUE_MAX_LENGTH, PLUGIN_NAME_MAX, PLUGIN_VERSION_MAX, SAMPLE_CONTENT_MAX_MEDIA, SAMPLE_CONTENT_MAX_NODES, } from "@kardalum/api-schemas";
1
+ import { FILE_NAME_MAX, MAX_DOC_PAGE_BYTES, MAX_ASSET_CONTENT_BYTES, MAX_DOC_PAGES, MAX_TEMPLATE_CONTENT_BYTES, MAX_TEMPLATE_PAYLOAD_ENTRIES, PLUGIN_AUTHOR_MAX, PLUGIN_CLI_COMMANDS_MAX, PLUGIN_CLI_COMMAND_NAME_MAX, PLUGIN_CLI_SUMMARY_MAX, PLUGIN_CMS_VERSION_MAX, PLUGIN_DESCRIPTION_MAX, PLUGIN_ID_MAX, PLUGIN_LICENSE_MAX, PLUGIN_LOCALE_KEY_MAX_LENGTH, PLUGIN_LOCALE_MAX_BYTES, PLUGIN_LOCALE_MAX_KEYS, PLUGIN_LOCALE_VALUE_MAX_LENGTH, PLUGIN_NAME_MAX, PLUGIN_VERSION_MAX, SAMPLE_CONTENT_MAX_MEDIA, SAMPLE_CONTENT_MAX_NODES, } from "@kardalum/api-schemas";
2
2
  import { ENTRY_NAME_MAX, ENTRY_SEGMENTS_MAX, MAX_ENTRIES, MAX_ENTRY_BYTES, MAX_TOTAL_BYTES } from "../extract.js";
3
3
  import { COVER_HEIGHT, COVER_WIDTH } from "../package-contract.js";
4
+ import { SAMPLE_CONTENT_MAX_BYTES, readShippedSampleContent } from "../sample-content.js";
5
+ import { adminStylesCheck } from "./admin-styles.js";
6
+ import { aiDeclarationsCheck } from "./ai-declarations.js";
4
7
  import { archiveNamesCheck } from "./archive-names.js";
5
8
  import { bundleSizeCheck } from "./bundle.js";
9
+ import { contentAccessCheck } from "./content-access.js";
6
10
  import { apiRoutesCheck, databaseCheck, iconNamesCheck, requiredViewsCheck, vendorServiceCheck } from "./contributions.js";
11
+ import { editorExtensionsCheck } from "./editor-extensions.js";
12
+ import { richTextCheck } from "./rich-text.js";
13
+ import { graphqlFieldsCheck } from "./graphql-fields.js";
7
14
  import { labelLanguagesCheck } from "./label-languages.js";
15
+ import { licenceCheck } from "./licence-check.js";
8
16
  import { BUNDLE_MAX_GZIP_BYTES, MANIFEST_MAX_BYTES, formatBinarySize } from "./limits.js";
9
17
  import { localeParityCheck, localesCheck } from "./locales.js";
10
18
  import { coverCheck, docsContractCheck, docsLinksCheck, readmeCheck } from "./package-files.js";
19
+ import { pluginSettingsCheck } from "./plugin-settings.js";
20
+ import { serverPowersCheck } from "./server-powers.js";
21
+ import { userAccountsCheck } from "./user-accounts.js";
22
+ import { servicesEventsCheck } from "./services-events.js";
23
+ import { visitorPointsCheck } from "./visitor-points.js";
24
+ import { providersCheck } from "./providers.js";
25
+ import { signInStepsCheck } from "./sign-in-steps.js";
11
26
  import { installOptionsCheck, sampleContentCheck } from "./sample-content.js";
12
- import { SAMPLE_CONTENT_MAX_BYTES, readShippedSampleContent } from "../sample-content.js";
27
+ import { siteExtensionsCheck } from "./site-extensions.js";
13
28
  import { describeError } from "./support.js";
14
- import { assetsCheck, entryBudgetCheck, payloadSizesCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
29
+ import { assetsCheck, declaredDataTypesCheck, entryBudgetCheck, payloadSizesCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
15
30
  /** Runs the checks of one gate in order. A check that cannot run because the
16
31
  * manifest did not parse says so; a check that throws is a failed result, never
17
32
  * an exception that escapes the gate (a directory where a file belongs is the
@@ -41,8 +56,24 @@ export function runChecks(checks, context, gate) {
41
56
  export const DELIVERY_CHECKS = [
42
57
  requiredViewsCheck,
43
58
  apiRoutesCheck,
59
+ aiDeclarationsCheck,
60
+ graphqlFieldsCheck,
61
+ contentAccessCheck,
62
+ siteExtensionsCheck,
63
+ editorExtensionsCheck,
64
+ // M35 C4a (design D14): rich text items, after the editor extensions.
65
+ richTextCheck,
66
+ providersCheck,
67
+ // M35 U3a (D5): sign-in steps, after the providers check that leaves that key to it.
68
+ signInStepsCheck,
69
+ pluginSettingsCheck,
70
+ serverPowersCheck,
71
+ userAccountsCheck,
72
+ servicesEventsCheck,
73
+ visitorPointsCheck,
44
74
  databaseCheck,
45
75
  vendorServiceCheck,
76
+ licenceCheck,
46
77
  iconNamesCheck,
47
78
  readmeCheck,
48
79
  coverCheck,
@@ -54,6 +85,7 @@ export const DELIVERY_CHECKS = [
54
85
  installOptionsCheck,
55
86
  sampleContentCheck,
56
87
  templateDeclarationsCheck,
88
+ declaredDataTypesCheck,
57
89
  templateFilesCheck,
58
90
  templateWiringCheck,
59
91
  assetsCheck,
@@ -61,6 +93,7 @@ export const DELIVERY_CHECKS = [
61
93
  entryBudgetCheck,
62
94
  archiveNamesCheck,
63
95
  bundleSizeCheck,
96
+ adminStylesCheck,
64
97
  ];
65
98
  /** What only one gate can measure, as data, so the page and the tests see every
66
99
  * check either gate can emit. Each CLI name is the one its check module in the
@@ -73,14 +106,17 @@ export const GATE_ONLY_CHECKS = [
73
106
  { name: "npm audit", gate: "cli", rule: "No high or critical advisory in the plugin's production dependencies (its devDependencies are build tooling and are not audited); the marketplace reports it skipped.", skippedAtDoor: true },
74
107
  { name: "templates parse", gate: "cli", rule: "Every template parses as Liquid; the marketplace never parses template code and reports it skipped.", skippedAtDoor: true },
75
108
  { name: "template references resolve", gate: "cli", rule: "Every `render` and `layout` target names a declared alias; the marketplace does not read template text and reports it skipped.", skippedAtDoor: true },
109
+ { name: "CLI commands", gate: "cli", rule: `The \`kardalum.cli\` member of the plugin's own \`package.json\`, when there is one, declares at most ${PLUGIN_CLI_COMMANDS_MAX} commands, each with a name of 1 to ${PLUGIN_CLI_COMMAND_NAME_MAX} lower-case letters, digits and \`-\` and a summary of 1 to ${PLUGIN_CLI_SUMMARY_MAX} printable characters, used once, a module path inside the package ending in \`.js\` or \`.mjs\`, and a \`plugin\` equal to the manifest's \`id\` whose last segment is not a word the CLI keeps for its own commands. The marketplace receives a built package without that \`package.json\`, so it never runs this check.`, skippedAtDoor: false },
110
+ { name: "service contracts", gate: "cli", rule: "Each offer or use of another plugin's service contract matches the project's copy in `contracts/`, which `kardalum plugin contract add` writes: an offer implements every method of its version, a use's range admits the copy, and a copy changed by hand fails. With `--online`, and always on `kardalum plugin publish`, the copies are also compared with the marketplace, and the plugin's own contracts are held to the growth rule against the newest published version of each. A newer minor, or a marketplace that cannot be reached, is reported on an advisory `service contract updates` line that never fails.", skippedAtDoor: false },
76
111
  { name: "reference", gate: "cli", rule: "The manifest yields a valid `reference.json`, which the build writes and the marketplace reads.", skippedAtDoor: false },
112
+ { name: "CMS version range", gate: "cli", rule: "Advisory beside a written range: the build writes `cmsVersion` from the plugin SDK it is built with (the manifest need not name one), and this check says which range that is. A written `cmsVersion` that admits Kardalum versions the plugin was not built against, or that cannot be read, warns; one that admits no version, or a missing plugin SDK when none is written, fails.", skippedAtDoor: false },
77
113
  { name: "plugin SDK federation share key correct", gate: "cli", rule: "The federation config shares the SDK under its package name, and react, react-dom and the SDK each set `singleton: true` and `import: false`, so the bundle carries no fallback copy of what the host provides. The check reads the literal `shared: { ... }` in `vite.config.ts`, so write every entry out in it: it cannot follow a spread, a variable or a helper.", skippedAtDoor: false },
78
114
  { name: "federation type declarations off", gate: "cli", rule: "Advisory: the `federation()` options in `vite.config.ts` set `dts: false`. No Kardalum host reads federated type declarations, so generating them only costs build time, and the build leaves them out of the package either way. The check reads the options with the TypeScript parser and warns, never fails, when it cannot find `dts: false` there.", skippedAtDoor: false },
79
115
  { name: "archive-safety", gate: "door", rule: "The archive extracts safely: no unsafe path, no entry that carries a second name for itself, no path twice in any spelling, within the entry and byte ceilings; a link is extracted as a plain file, never as a link. The upload's reader applies the same rules.", skippedAtDoor: false },
80
116
  { name: "manifest-schema", gate: "door", rule: `\`manifest.json\` is at most ${formatBinarySize(MANIFEST_MAX_BYTES)}, parses, and matches the shape rule built from the shared vocabularies, declaration rules and field limits.`, skippedAtDoor: false },
81
117
  { name: "required-files", gate: "door", rule: "`manifest.json`, `server/plugin.js` and `server/package.json` (declaring the ESM marker) are present, plus `remoteEntry.js` when a view-bearing contribution is declared.", skippedAtDoor: false },
82
118
  { name: "manifest-consistency", gate: "door", rule: "The manifest's id and version match the submission record, and the extracted `manifest.json` is byte for byte the one read at upload.", skippedAtDoor: false },
83
- { name: "reserved-names", gate: "door", rule: "Nothing at the package root is named `kardalum-license.json`, in any case: the marketplace writes that file into every licensed download.", skippedAtDoor: false },
119
+ { name: "reserved-names", gate: "door", rule: "Nothing at the package root is named `kardalum-license.json`, `LICENCE-TERMS.md` or `PLUGIN-LICENCE.md`, in any case: the marketplace writes those files into every licensed download.", skippedAtDoor: false },
84
120
  { name: "bundle-members", gate: "door", rule: "Every plugin that declares bundledPlugins: each member id is a published listing, and a paid member belongs to the bundle's author; a listing labelled bundle must declare at least one member.", skippedAtDoor: false },
85
121
  { name: "internal-validation-error", gate: "door", rule: "Not a rule a package breaks: the marketplace could not read the stored package, or could not finish checking it in time. Submit again under a new version number and every check runs afresh.", skippedAtDoor: false },
86
122
  ];
@@ -0,0 +1,2 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const richTextCheck: DeliveryCheck;
@@ -0,0 +1,173 @@
1
+ import { join } from "node:path";
2
+ import { lstatSync, readFileSync } from "node:fs";
3
+ import { PluginTemplateFileSchema, RICH_TEXT_BUTTONS_PER_PLUGIN_MAX, RICH_TEXT_MARKS_PER_PLUGIN_MAX, RICH_TEXT_NODES_PER_PLUGIN_MAX, RichTextExtensionsSchema, checkRichTextExtensionDeclarations, compareRichTextVersions, forEachRichTextItem, listIssues, richTextVersionSummaryOf } from "@kardalum/api-schemas";
4
+ import { publicSuffixPasteHosts } from "../public-suffix.js";
5
+ import { contributionsOf, failed, list, passed, record, warning } from "./support.js";
6
+ /** The most of a template file the warnings read (a partial is small; the template checks bound the rest). */
7
+ const PARTIAL_READ_MAX_BYTES = 262_144;
8
+ const RAW_WARNING = "A partial must never assume the plugin's validate passed: data stored while the plugin was off was never judged";
9
+ /** The text between each `{{` and its `}}`, by indexOf, never a pattern. */
10
+ function outputTags(text) {
11
+ const tags = [];
12
+ let at = 0;
13
+ while (at < text.length) {
14
+ const open = text.indexOf("{{", at);
15
+ if (open === -1)
16
+ break;
17
+ const close = text.indexOf("}}", open + 2);
18
+ if (close === -1)
19
+ break;
20
+ tags.push(text.slice(open + 2, close));
21
+ at = close + 2;
22
+ }
23
+ return tags;
24
+ }
25
+ /** Whether an output tag's first word is `content`, after Liquid's whitespace control (`{{- content -}}`): a leading
26
+ * `-` and spaces are skipped by a forward loop. */
27
+ function printsContent(tag) {
28
+ let at = 0;
29
+ while (at < tag.length) {
30
+ const code = tag.charCodeAt(at);
31
+ if (code !== 0x2d && code !== 0x20 && code !== 0x09 && code !== 0x0a && code !== 0x0d)
32
+ break;
33
+ at += 1;
34
+ }
35
+ if (!tag.startsWith("content", at))
36
+ return false;
37
+ const after = tag.charCodeAt(at + "content".length);
38
+ // The word ends at the tag's end, a space, a filter's "|" or whitespace control's "-"; `contents` is another name.
39
+ return Number.isNaN(after) || after === 0x20 || after === 0x09 || after === 0x0a || after === 0x0d || after === 0x7c || after === 0x2d;
40
+ }
41
+ /** A partial's text, read only when its name is a valid template file and it is a regular file within the cap. At the
42
+ * door the manifest's templates are unchecked when this runs, so a `../` name, a link, a directory or a device is
43
+ * never read (the same guard as templates.ts's fileSize). */
44
+ function partialText(dir, file) {
45
+ if (!PluginTemplateFileSchema.safeParse(file).success)
46
+ return null;
47
+ try {
48
+ const path = join(dir, "templates", ...file.split("/"));
49
+ const stat = lstatSync(path, { throwIfNoEntry: false });
50
+ if (!stat?.isFile() || stat.size > PARTIAL_READ_MAX_BYTES)
51
+ return null;
52
+ return readFileSync(path, "utf8");
53
+ }
54
+ catch {
55
+ return null;
56
+ }
57
+ }
58
+ /** How many values of a sample-content.json the foreign item walk reads before it gives up. */
59
+ const SAMPLE_CONTENT_WALK_MAX = 100_000;
60
+ /** The plugin ids items in a sample document name, other than `own`. Answers false when the walk could not read the
61
+ * whole file (past SAMPLE_CONTENT_WALK_MAX values, or a document past the rich text walk's bounds), so the check
62
+ * fails closed instead of passing what it never saw. */
63
+ function foreignItems(value, own, into) {
64
+ const stack = [value];
65
+ let visited = 0;
66
+ while (stack.length > 0) {
67
+ if (visited >= SAMPLE_CONTENT_WALK_MAX)
68
+ return false;
69
+ const current = stack.pop();
70
+ visited += 1;
71
+ if (current === null || typeof current !== "object")
72
+ continue;
73
+ const node = current;
74
+ if (node.type === "doc") {
75
+ const whole = forEachRichTextItem(node, (item) => {
76
+ if (typeof item.attrs.plugin === "string" && item.attrs.plugin !== own)
77
+ into.add(item.attrs.plugin);
78
+ });
79
+ if (!whole)
80
+ return false;
81
+ continue;
82
+ }
83
+ for (const member of Array.isArray(current) ? current : Object.values(node))
84
+ stack.push(member);
85
+ }
86
+ return true;
87
+ }
88
+ // M35 C4a (design D14): one check at validate and at the door, on the same manifest.json.
89
+ export const richTextCheck = {
90
+ name: "rich text extensions",
91
+ rule: `\`richTextExtensions\` declares at most ${RICH_TEXT_NODES_PER_PLUGIN_MAX} nodes, ${RICH_TEXT_MARKS_PER_PLUGIN_MAX} marks and ` +
92
+ `${RICH_TEXT_BUTTONS_PER_PLUGIN_MAX} buttons; each node's partial is a partial template of this plugin; a button inserts a declared ` +
93
+ "node, toggles a declared mark or opens a view with the plugin's own action; a node made from pasted addresses names a " +
94
+ "`url` attribute and lists hosts of the core's form (`*.` only as the whole first label), none covering a public suffix; " +
95
+ "a `json` attribute and `textFromView` need the node's own view; icons come from the core's list; sample content holds " +
96
+ "only this plugin's items; against the previous published version (the marketplace, and validate --online), an item keeps " +
97
+ "its shape and its editorial setting. It warns " +
98
+ "for a partial that also carries a `kardalum:block` annotation, a wrapper partial that never prints `content`, and a partial " +
99
+ "that prints `item.data` through `raw`.",
100
+ gates: ["cli", "door"],
101
+ needsManifest: true,
102
+ run: ({ manifest, dir, sampleContent, previousRichText }) => {
103
+ const contributions = contributionsOf(manifest);
104
+ const declared = contributions.richTextExtensions;
105
+ if (declared === undefined)
106
+ return { status: "skipped", message: "no rich text extensions declared" };
107
+ const parsed = RichTextExtensionsSchema.safeParse(declared);
108
+ if (!parsed.success) {
109
+ return failed(`manifest.json declares its rich text extensions wrongly: ${parsed.error.issues.slice(0, 5).map((issue) => `${issue.path.join(".")}: ${issue.message.slice(0, 160)}`).join("; ")}`);
110
+ }
111
+ const issues = checkRichTextExtensionDeclarations(manifest);
112
+ if (issues.length > 0)
113
+ return failed(`manifest.json declares its rich text extensions wrongly: ${listIssues(issues)}`);
114
+ // M35 C4b (design D17): a wildcard whose remainder is a public suffix would match every site under it.
115
+ const wide = publicSuffixPasteHosts(declared);
116
+ if (wide.length > 0) {
117
+ return failed(`manifest.json lists paste hosts that cover a public suffix, so every site under them would match: ${wide.slice(0, 5).map(({ node, host }) => `the item "${node.slice(0, 40)}" pastes from ${host.slice(0, 80)}`).join("; ")}`);
118
+ }
119
+ // M35 C4b (design D13, D14, evidence 169): against the previous published version. A changed shape or editorial
120
+ // setting fails (stored items would no longer match); a dropped name, a retyped or dropped attribute and a newly
121
+ // required one warn, with the server's own sentences.
122
+ const warnings = [];
123
+ const notes = [];
124
+ if (previousRichText !== undefined) {
125
+ const after = richTextVersionSummaryOf(declared);
126
+ if (previousRichText.summary === null)
127
+ notes.push(`the previous version ${previousRichText.version} has no rich text summary, so it was not compared`);
128
+ else if (after !== null) {
129
+ const changes = compareRichTextVersions(previousRichText.summary, after);
130
+ const refused = [
131
+ ...changes.shapeChanged.map((name) => `changes the shape of the rich text item "${name}" from version ${previousRichText.version}: a new shape needs a new name`),
132
+ ...changes.editorialChanged.map((name) => `turns the rich text item "${name}" editorial or back from version ${previousRichText.version}: a new editorial item needs a new name`),
133
+ ];
134
+ if (refused.length > 0)
135
+ return failed(`manifest.json ${refused.slice(0, 5).join("; ")}`);
136
+ warnings.push(...changes.warnings);
137
+ }
138
+ }
139
+ const own = typeof manifest.id === "string" ? manifest.id : "";
140
+ // ShippedSampleContent's states are "absent", "unreadable" and "ships"; the registry always fills it (registry.ts:60).
141
+ if (sampleContent?.status === "ships") {
142
+ const foreign = new Set();
143
+ if (!foreignItems(sampleContent.file, own, foreign))
144
+ return failed("sample content is too large to check for other plugins' items");
145
+ if (foreign.size > 0)
146
+ return failed(`sample content holds rich text items of other plugins: ${[...foreign].slice(0, 5).map((id) => id.slice(0, 60)).join(", ")}`);
147
+ }
148
+ const files = new Map();
149
+ for (const raw of list(contributions.templates)) {
150
+ const entry = record(raw);
151
+ if (entry && entry.kind === "partial" && typeof entry.alias === "string" && typeof entry.file === "string")
152
+ files.set(entry.alias, entry.file);
153
+ }
154
+ const nodes = parsed.data.nodes ?? [];
155
+ for (const node of nodes) {
156
+ const file = files.get(node.partial);
157
+ const text = file === undefined ? null : partialText(dir, file);
158
+ if (text === null)
159
+ continue;
160
+ if (text.includes("kardalum:block"))
161
+ warnings.push(`the partial "${node.partial}" also carries a kardalum:block annotation, so it shows twice in the insert menu`);
162
+ const tags = outputTags(text);
163
+ if (node.shape === "wrapper" && !tags.some(printsContent)) {
164
+ warnings.push(`the wrapper "${node.name}"'s partial never prints content, so the text inside the box is not shown`);
165
+ }
166
+ if (tags.some((tag) => tag.includes("item.data") && tag.includes("raw")))
167
+ warnings.push(`the partial "${node.partial}" prints item.data through raw. ${RAW_WARNING}`);
168
+ }
169
+ const marks = parsed.data.marks ?? [];
170
+ const summary = `${nodes.length + marks.length} item${nodes.length + marks.length === 1 ? "" : "s"}`;
171
+ return warnings.length > 0 ? warning(summary, [...warnings, ...notes]) : passed(summary, notes.length > 0 ? notes : undefined);
172
+ },
173
+ };