@kardalum/plugin-sdk 0.19.0 → 0.20.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 (366) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/README.md +19 -0
  3. package/dist/admin-section-registry.d.ts +16 -1
  4. package/dist/admin-section-registry.js +23 -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 +55 -3
  13. package/dist/cli.d.ts +66 -0
  14. package/dist/cli.js +22 -0
  15. package/dist/content-library.d.ts +85 -0
  16. package/dist/content-library.js +15 -0
  17. package/dist/content-picker/page-picker-sheet.d.ts +13 -0
  18. package/dist/content-picker/page-picker-sheet.js +105 -0
  19. package/dist/content-picker/page-tree.d.ts +25 -0
  20. package/dist/content-picker/page-tree.js +132 -0
  21. package/dist/data-type-plugin.d.ts +7 -1
  22. package/dist/datatype-validation.d.ts +4 -9
  23. package/dist/datatype-validation.js +139 -1
  24. package/dist/entitlement-entry.d.ts +1 -1
  25. package/dist/entitlement-entry.js +1 -1
  26. package/dist/entitlement-gate.d.ts +14 -0
  27. package/dist/entitlement-gate.js +64 -7
  28. package/dist/entitlement-plan.d.ts +6 -0
  29. package/dist/entitlement-plan.js +10 -0
  30. package/dist/entitlement-types.d.ts +36 -12
  31. package/dist/entitlement.d.ts +31 -4
  32. package/dist/entitlement.js +58 -17
  33. package/dist/hook-entry.d.ts +5 -0
  34. package/dist/hook-entry.js +30 -0
  35. package/dist/host-entry.d.ts +1 -1
  36. package/dist/host-entry.js +1 -1
  37. package/dist/index.d.ts +36 -4
  38. package/dist/index.js +50 -3
  39. package/dist/mail.d.ts +30 -0
  40. package/dist/mail.js +1 -0
  41. package/dist/manifest-entry.d.ts +29 -4
  42. package/dist/manifest-entry.js +39 -2
  43. package/dist/manifest-schema.d.ts +443 -29
  44. package/dist/manifest-schema.js +285 -23
  45. package/dist/manifest.d.ts +450 -51
  46. package/dist/manifest.js +1 -1
  47. package/dist/media/media-picker.js +31 -18
  48. package/dist/media/upload-error.d.ts +5 -1
  49. package/dist/media/upload-error.js +14 -2
  50. package/dist/media-library.d.ts +32 -0
  51. package/dist/media-library.js +15 -0
  52. package/dist/nested-field-host.d.ts +76 -0
  53. package/dist/nested-field-host.js +90 -0
  54. package/dist/notify.d.ts +12 -4
  55. package/dist/notify.js +1 -1
  56. package/dist/outbound.d.ts +47 -0
  57. package/dist/outbound.js +1 -0
  58. package/dist/plugin-context.d.ts +5 -0
  59. package/dist/plugin-screen-context.d.ts +112 -0
  60. package/dist/plugin-screen-context.js +26 -0
  61. package/dist/providers.d.ts +268 -0
  62. package/dist/providers.js +74 -0
  63. package/dist/read-all-pages.d.ts +5 -0
  64. package/dist/read-all-pages.js +3 -2
  65. package/dist/richtext/block-panel.js +11 -6
  66. package/dist/richtext/insert-menu.js +9 -6
  67. package/dist/richtext/style-listbox.js +6 -4
  68. package/dist/sdk-strings.d.ts +285 -0
  69. package/dist/sdk-strings.js +347 -0
  70. package/dist/sealing.d.ts +14 -0
  71. package/dist/sealing.js +1 -0
  72. package/dist/simple-storage-value-provider.js +24 -24
  73. package/dist/structured-storage-types.d.ts +309 -9
  74. package/dist/text-entry.d.ts +1 -0
  75. package/dist/text-entry.js +6 -0
  76. package/dist/tokens/tailwind-theme.css +5 -0
  77. package/dist/tokens/tokens.css +15 -3
  78. package/dist/tokens/tokens.json +8 -3
  79. package/dist/views/asset-view.js +4 -1
  80. package/dist/views/content-list-preview.js +3 -1
  81. package/dist/views/content-list-settings-view.js +11 -7
  82. package/dist/views/content-list-view.d.ts +5 -3
  83. package/dist/views/content-list-view.js +38 -34
  84. package/dist/views/content-picker-view.d.ts +3 -0
  85. package/dist/views/content-picker-view.js +143 -0
  86. package/dist/views/crop-view.d.ts +4 -6
  87. package/dist/views/crop-view.js +22 -13
  88. package/dist/views/date-range-view.js +4 -1
  89. package/dist/views/file-upload-view.d.ts +5 -7
  90. package/dist/views/file-upload-view.js +16 -7
  91. package/dist/views/group-view.d.ts +8 -0
  92. package/dist/views/group-view.js +123 -0
  93. package/dist/views/html-view.js +7 -6
  94. package/dist/views/image-view.js +37 -19
  95. package/dist/views/link-view.d.ts +3 -0
  96. package/dist/views/link-view.js +150 -0
  97. package/dist/views/options-list-view.d.ts +3 -0
  98. package/dist/views/options-list-view.js +104 -0
  99. package/dist/views/repeatable-list-view.d.ts +3 -0
  100. package/dist/views/repeatable-list-view.js +113 -0
  101. package/dist/views/rich-text-view.js +28 -13
  102. package/dist/views/suggest-key.d.ts +17 -0
  103. package/dist/views/suggest-key.js +55 -0
  104. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
  105. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
  106. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  107. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  108. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  109. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  110. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
  111. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  112. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
  113. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
  114. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  115. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
  116. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
  117. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
  118. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
  119. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
  120. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  122. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  130. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  131. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  132. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
  133. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
  134. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  135. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
  136. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
  137. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  138. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  139. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +180 -15
  140. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -5
  141. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  142. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
  143. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  144. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  145. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  146. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  147. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  148. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  149. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +117 -41
  150. package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
  151. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  152. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  153. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  154. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  157. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
  158. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  163. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +312 -8
  164. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -3
  165. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  166. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  167. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  168. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  169. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  170. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  171. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  172. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  173. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  174. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  175. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  176. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  178. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  179. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
  180. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
  181. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  182. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  183. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  184. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  185. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  186. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
  187. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  188. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  189. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  190. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
  191. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
  192. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  193. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  194. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  195. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  196. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  197. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  198. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  199. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  200. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  201. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  202. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  204. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  226. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  227. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  228. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
  229. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
  230. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  231. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  233. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  234. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
  235. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
  236. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
  237. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
  238. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  239. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  240. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  241. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  242. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +335 -6
  243. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
  244. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
  245. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
  246. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  247. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  248. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
  249. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
  250. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  251. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  252. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  253. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  254. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  255. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  256. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
  257. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
  258. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  259. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  260. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  261. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  262. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  263. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  264. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
  265. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
  266. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
  267. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
  268. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  269. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
  270. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  271. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  272. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  273. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  274. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  275. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  276. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  277. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  278. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  279. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  280. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
  281. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
  282. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  283. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
  284. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  285. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  286. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  287. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  288. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
  289. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +90 -8
  290. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
  291. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
  292. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
  293. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
  294. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
  295. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  296. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  297. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  298. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  299. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
  300. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
  301. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  302. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  303. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  304. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  305. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  306. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  307. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
  308. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +34 -3
  309. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  310. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  311. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  312. package/node_modules/@kardalum/design-tokens/dist/build-css.js +6 -0
  313. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
  314. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  315. package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
  316. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
  317. package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
  318. package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
  319. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -1
  320. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
  321. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
  322. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  323. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
  324. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  325. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
  326. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  327. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  328. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  329. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  330. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  331. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  332. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  333. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
  334. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  335. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  336. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
  337. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  338. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  339. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
  340. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
  341. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
  342. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  343. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
  344. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  345. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  346. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  347. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
  348. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
  349. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +25 -4
  350. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  351. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  352. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
  353. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  354. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
  355. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  356. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  357. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
  358. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  359. package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
  360. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  361. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  362. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  363. package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
  364. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
  365. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
  366. package/package.json +12 -2
@@ -0,0 +1,27 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const LICENCE_CHECK_NAME = "licence check";
3
+ /** Every marker an SDK release that honours a closing verdict carries in
4
+ * EntitlementError. A later change to the check adds its number here. */
5
+ export declare const LICENCE_CHECK_MARKERS: readonly string[];
6
+ /** The public halves of the SDK's LICENSE_VERDICT_PUBLIC_KEYS, as text: the
7
+ * marker with one of these in the same package is the SDK's own verifier. */
8
+ export declare const LICENCE_CHECK_KEY_TEXTS: readonly string[];
9
+ /** The contributions whose work runs as the plugin's own server code, read
10
+ * from the contribution keys deriveCapabilities classifies, plus the
11
+ * manifest's vendorService. A package declaring none of them has no paid
12
+ * server work for requireEntitlement to guard. */
13
+ export declare const SERVER_CODE_CONTRIBUTIONS: readonly string[];
14
+ export declare function hasServerCode(manifest: Record<string, unknown>): boolean;
15
+ /** S367h (D5): what a package whose server code does not call the check is
16
+ * told, true whether its listing is free or sells a paid plan. */
17
+ export declare const NO_LICENCE_CHECK_FOUND = "no licence check found; a listing that sells a paid plan is refused at upload without one";
18
+ /** S367d (D8, D9; author agreement `the licence check`): a paid package whose
19
+ * server code does not reach the SDK's requireEntitlement is refused. The
20
+ * marker survives bundling only through a real call path, and the verdict
21
+ * key beside it ties it to the SDK's own verifier. A search with indexOf,
22
+ * never a pattern, in `server/plugin.js` only. A free package reports passed
23
+ * when it would pass if paid, so its listing can add a paid plan later;
24
+ * otherwise skipped, saying a paid listing needs it. */
25
+ export declare const licenceCheck: DeliveryCheck;
26
+ /** S367d (D10): whether a stored validation report holds a passed licence check row. */
27
+ export declare function passedLicenceCheck(report: unknown): boolean;
@@ -0,0 +1,95 @@
1
+ import { lstatSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import { contributionsOf, failed, passed, record } from "./support.js";
4
+ // S367d (D7, D8; author agreement `the licence check`): what the shared
5
+ // "licence check" looks for in a paid package's server code. The SDK owns the
6
+ // marker and the verdict keys, but depends on this package, so the lists
7
+ // are kept here and the SDK's entitlement-marker test fails when they differ.
8
+ export const LICENCE_CHECK_NAME = "licence check";
9
+ /** Every marker an SDK release that honours a closing verdict carries in
10
+ * EntitlementError. A later change to the check adds its number here. */
11
+ export const LICENCE_CHECK_MARKERS = ["kardalum-entitlement-check:1"];
12
+ /** The public halves of the SDK's LICENSE_VERDICT_PUBLIC_KEYS, as text: the
13
+ * marker with one of these in the same package is the SDK's own verifier. */
14
+ export const LICENCE_CHECK_KEY_TEXTS = ["MCowBQYDK2VwAyEA5k/u12E1qUYgQRR4+sjtdmBoYieQdXyunB//groWtCo="];
15
+ /** The contributions whose work runs as the plugin's own server code, read
16
+ * from the contribution keys deriveCapabilities classifies, plus the
17
+ * manifest's vendorService. A package declaring none of them has no paid
18
+ * server work for requireEntitlement to guard. */
19
+ // M32 F2: the five site extension keys run plugin code (route handlers, a fallback resolver, filter and tag functions,
20
+ // and the head function that builds a page's entries at render time), so a paid plugin declaring them is checked too.
21
+ // M32 F4: the three provider keys run plugin code too (verify, index and query, put and open), so they count.
22
+ // M32 F4b: a sign-in provider is server work the core runs (and an oauth2 one's `profile` is plugin code), so it counts.
23
+ export const SERVER_CODE_CONTRIBUTIONS = ["hooks", "scheduledTasks", "mediaProcessors", "serializers", "apiRoutes", "exposedServices", "notifications", "siteRoutes", "siteFallback", "templateFilters", "templateTags", "pageHead", "protectionProviders", "searchProviders", "mediaStores", "signInProviders", "mailSenders"];
24
+ function declared(value) {
25
+ if (value === true)
26
+ return true;
27
+ if (Array.isArray(value))
28
+ return value.length > 0;
29
+ const object = record(value);
30
+ return object !== null && Object.keys(object).length > 0;
31
+ }
32
+ export function hasServerCode(manifest) {
33
+ const contributions = contributionsOf(manifest);
34
+ return SERVER_CODE_CONTRIBUTIONS.some((key) => declared(contributions[key])) || manifest.vendorService !== undefined;
35
+ }
36
+ /** S367h (D5): what a package whose server code does not call the check is
37
+ * told, true whether its listing is free or sells a paid plan. */
38
+ export const NO_LICENCE_CHECK_FOUND = "no licence check found; a listing that sells a paid plan is refused at upload without one";
39
+ /** S367h (D7): the server bundle, `plugin.js` in the server folder: the one
40
+ * file bundleServerManifest writes and the CMS loads. Read whole (the door's
41
+ * archive limits already bound it); a missing file reads as empty, so a paid
42
+ * package without it fails. */
43
+ function serverBundleText(serverDir) {
44
+ // M32 I7 (task 13): only a regular file counts; a folder or a symbolic link reads as empty.
45
+ const file = join(serverDir, "plugin.js");
46
+ try {
47
+ if (!lstatSync(file).isFile())
48
+ return "";
49
+ return readFileSync(file, "utf8");
50
+ }
51
+ catch {
52
+ return "";
53
+ }
54
+ }
55
+ const NO_MARKER = "A paid plugin must call requireEntitlement from @kardalum/plugin-sdk/entitlement in its server code (SDK 0.20 or later). server/plugin.js does not reach it: call it at the top of every route, hook or task that is the paid value.";
56
+ const NO_KEY = "server/plugin.js carries the licence check but not Kardalum's verdict key: use requireEntitlement as the SDK ships it, without your own trustedKeys.";
57
+ /** S367d (D8, D9; author agreement `the licence check`): a paid package whose
58
+ * server code does not reach the SDK's requireEntitlement is refused. The
59
+ * marker survives bundling only through a real call path, and the verdict
60
+ * key beside it ties it to the SDK's own verifier. A search with indexOf,
61
+ * never a pattern, in `server/plugin.js` only. A free package reports passed
62
+ * when it would pass if paid, so its listing can add a paid plan later;
63
+ * otherwise skipped, saying a paid listing needs it. */
64
+ export const licenceCheck = {
65
+ name: LICENCE_CHECK_NAME,
66
+ rule: "A paid plugin (a manifest `price` above 0, or at the marketplace a listing with a live paid plan) whose manifest declares server code (`hooks`, `scheduledTasks`, `mediaProcessors`, `serializers`, `apiRoutes`, `exposedServices`, `notifications`, `siteRoutes`, `siteFallback`, `templateFilters`, `templateTags`, `pageHead`, `protectionProviders`, `searchProviders`, `mediaStores`, `signInProviders`, `mailSenders` or a `vendorService`) calls `requireEntitlement` from `@kardalum/plugin-sdk/entitlement` (SDK 0.20 or later): `server/plugin.js`, the one server bundle, carries the SDK's licence check marker and one of Kardalum's verdict keys. A paid plugin without server code passes, since the CMS's own licence gate covers it; a plugin that does not call it is skipped while its listing sells no paid plan.",
67
+ gates: ["cli", "door"],
68
+ needsManifest: true,
69
+ run: ({ dir, manifest, paid, server }) => {
70
+ const isPaid = paid === true || (typeof manifest.price === "number" && manifest.price > 0);
71
+ if (!hasServerCode(manifest))
72
+ return passed("no server code: the CMS's own licence gate covers this package");
73
+ if (server?.buildError !== undefined) {
74
+ return isPaid ? failed(`could not bundle the server code to check it: ${server.buildError}`) : { status: "skipped", message: NO_LICENCE_CHECK_FOUND };
75
+ }
76
+ const text = serverBundleText(server?.dir ?? join(dir, "server"));
77
+ const marker = LICENCE_CHECK_MARKERS.some((needle) => text.indexOf(needle) >= 0);
78
+ const key = LICENCE_CHECK_KEY_TEXTS.some((needle) => text.indexOf(needle) >= 0);
79
+ if (marker && key)
80
+ return passed("server code calls the licence check");
81
+ if (!isPaid)
82
+ return { status: "skipped", message: NO_LICENCE_CHECK_FOUND };
83
+ return failed(marker ? NO_KEY : NO_MARKER);
84
+ },
85
+ };
86
+ /** S367d (D10): whether a stored validation report holds a passed licence check row. */
87
+ export function passedLicenceCheck(report) {
88
+ const checks = record(report)?.checks;
89
+ if (!Array.isArray(checks))
90
+ return false;
91
+ return checks.some((check) => {
92
+ const row = record(check);
93
+ return row !== null && row.name === LICENCE_CHECK_NAME && row.status === "passed";
94
+ });
95
+ }
@@ -1,6 +1,6 @@
1
1
  import { lstatSync, readdirSync, readFileSync, statSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import { PLUGIN_LOCALE_MAX_BYTES, compareLocaleFiles, parsePluginLocaleFile, pluginLocaleFileLanguage, } from "@kardalum/api-schemas";
3
+ import { PLUGIN_LOCALE_MAX_BYTES, compareLocaleFiles, localeKeysAsked, parsePluginLocaleFile, pluginLocaleFileLanguage, } from "@kardalum/api-schemas";
4
4
  import { failed, listCapped, passed, warning } from "./support.js";
5
5
  // S290: a plugin's own strings ship as locales/<language>.json. The folder
6
6
  // is optional (a plugin whose screens hold no words of their own needs
@@ -70,6 +70,10 @@ export function checkLocalesFolder(pluginDir) {
70
70
  // value whose {{placeholders}} differ from the English value's (the
71
71
  // sentence renders with a hole or a stray brace). A key a language lacks
72
72
  // only warns, with the count: the admin shows the plugin's English for it.
73
+ // M33 K37: each file is compared in its own language, so an English plural
74
+ // group (`x_one`, `x_other`) asks the language for its own CLDR forms (a
75
+ // form it does not use fails as extra; the zero, one and two forms may
76
+ // leave {{count}} out), and the count of keys asked is the language's.
73
77
  // The comparison is compareLocaleFiles from @kardalum/api-schemas, the one
74
78
  // the marketplace's language line and the admin's own locale-parity test
75
79
  // use. A file the `locales` check refuses is skipped here, so one problem is
@@ -114,13 +118,14 @@ export function checkLocaleParityFolder(pluginDir) {
114
118
  const bundle = readBundle(dir, fileName);
115
119
  if (bundle === null)
116
120
  continue;
117
- const { extra, missing, mismatched } = compareLocaleFiles(en, bundle);
121
+ const language = pluginLocaleFileLanguage(fileName);
122
+ const { extra, missing, mismatched } = compareLocaleFiles(language, en, bundle);
118
123
  if (extra.length > 0)
119
124
  failures.push(`${fileName}: ${extra.length} ${extra.length === 1 ? "key" : "keys"} en.json lacks: ${listKeys(extra)}`);
120
125
  if (mismatched.length > 0)
121
126
  failures.push(`${fileName}: placeholders differ from en.json in ${listKeys(mismatched)}`);
122
127
  if (missing.length > 0)
123
- warnings.push(`${fileName}: ${missing.length} of ${total} keys missing, those show English`);
128
+ warnings.push(`${fileName}: ${missing.length} of ${localeKeysAsked(language, en)} keys missing, those show English`);
124
129
  if (extra.length === 0 && mismatched.length === 0 && missing.length === 0)
125
130
  matching.push(fileName);
126
131
  }
@@ -141,7 +146,7 @@ export const localesCheck = {
141
146
  };
142
147
  export const localeParityCheck = {
143
148
  name: "locale parity",
144
- rule: "A language never has a key English lacks or a different placeholder (both fail); a missing key only warns and shows English.",
149
+ rule: "A language never has a key English lacks or a different placeholder (both fail); a missing key only warns and shows English. A plural group (`x_one`, `x_other`) asks each language for its own forms (Arabic all six), and the zero, one and two forms may leave `{{count}}` out.",
145
150
  gates: ["cli", "door"],
146
151
  needsManifest: false,
147
152
  run: ({ dir }) => checkLocaleParityFolder(dir),
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const PLUGIN_SETTINGS_CHECK_NAME = "Plugin settings";
3
+ export declare const pluginSettingsCheck: DeliveryCheck;
@@ -0,0 +1,68 @@
1
+ import { PLUGIN_SECRETS_MAX, PLUGIN_SETTINGS_FIELDS_MAX, PLUGIN_SETTING_CHOICES_MAX, PLUGIN_LABEL_MAX, PLUGIN_SETTING_DESCRIPTION_MAX, PLUGIN_SETTING_ID_MAX, PluginSettingFieldSchema, checkPluginSettingsDeclaration, isPluginSecretName, } from "@kardalum/api-schemas";
2
+ import { contributionsOf, failed, listCapped, passed, plural, record } from "./support.js";
3
+ // M32 F4d (D8): the 40th delivery check. It reads `contributions.settings` from the manifest (data, so
4
+ // the live manifest and the redacted one at the door read alike). The rules and limits are api-schemas';
5
+ // a message names the declaration by position, and some quote what the author declared there: a field
6
+ // id, a secret's name, and the choice value a duplicate-choice message names. None quotes a stored value.
7
+ export const PLUGIN_SETTINGS_CHECK_NAME = "Plugin settings";
8
+ function declaredSecretNamesOf(value) {
9
+ const names = [];
10
+ if (!Array.isArray(value))
11
+ return names;
12
+ for (const raw of value.slice(0, PLUGIN_SECRETS_MAX)) {
13
+ const name = record(raw)?.name;
14
+ if (typeof name === "string" && isPluginSecretName(name))
15
+ names.push(name);
16
+ }
17
+ return names;
18
+ }
19
+ /** "1.id" becomes "contributions.settings[1].id". */
20
+ function whereOf(path) {
21
+ if (path === "")
22
+ return "contributions.settings";
23
+ const parts = path.split(".");
24
+ const index = parts.shift() ?? "";
25
+ return `contributions.settings[${index}]${parts.map((p) => `.${p}`).join("")}`;
26
+ }
27
+ export const pluginSettingsCheck = {
28
+ name: PLUGIN_SETTINGS_CHECK_NAME,
29
+ rule: "`settings` holds at most " + PLUGIN_SETTINGS_FIELDS_MAX + " fields, each of type `text`, `number`, `onOff`, `choice` or `secret`, with an `id` of 1 to " + PLUGIN_SETTING_ID_MAX + " characters (a letter, then letters, digits and \"_\") used once, " +
30
+ "a `label` of at most " + PLUGIN_LABEL_MAX + " characters and, when given, a `description` of at most " + PLUGIN_SETTING_DESCRIPTION_MAX + " characters (each text, or a map of language to text with English, the cap holding in every language). A `choice` field lists 1 to " + PLUGIN_SETTING_CHOICES_MAX + " choices with distinct values and a `default` that is one of them; " +
31
+ "a `text` field's `default` fits its `maxLength`; a `number` field's `min`, `max` and `default` agree and a whole-number field has a whole-number default; " +
32
+ "a `secret` field names a secret the plugin declares in `secrets`, and no secret is named by two fields.",
33
+ gates: ["cli", "door"],
34
+ needsManifest: true,
35
+ run: ({ manifest }) => {
36
+ const value = contributionsOf(manifest).settings;
37
+ if (value === undefined)
38
+ return passed("no settings declared");
39
+ if (!Array.isArray(value))
40
+ return failed("manifest.json declares its settings wrongly: contributions.settings must be a list");
41
+ const issues = [];
42
+ if (value.length > PLUGIN_SETTINGS_FIELDS_MAX) {
43
+ issues.push(`contributions.settings holds ${value.length} entries; at most ${PLUGIN_SETTINGS_FIELDS_MAX} are allowed`);
44
+ }
45
+ // Past the cap one more entry is read, so a huge list costs little.
46
+ const fields = [];
47
+ value.slice(0, PLUGIN_SETTINGS_FIELDS_MAX + 1).forEach((raw, index) => {
48
+ const parsed = PluginSettingFieldSchema.safeParse(raw);
49
+ if (parsed.success) {
50
+ fields.push(parsed.data);
51
+ return;
52
+ }
53
+ for (const issue of parsed.error.issues.slice(0, 3)) {
54
+ const path = [String(index), ...issue.path.map(String)].join(".");
55
+ issues.push(`${whereOf(path)} ${issue.message}`);
56
+ }
57
+ });
58
+ // The cross-field rules run on the fields that parsed; an unparsed one is reported above.
59
+ if (fields.length === value.length && value.length <= PLUGIN_SETTINGS_FIELDS_MAX) {
60
+ for (const problem of checkPluginSettingsDeclaration(fields, declaredSecretNamesOf(contributionsOf(manifest).secrets))) {
61
+ issues.push(`${whereOf(problem.path)} ${problem.message}`);
62
+ }
63
+ }
64
+ if (issues.length > 0)
65
+ return failed(`manifest.json declares its settings wrongly: ${listCapped(issues)}`);
66
+ return passed(plural(value.length, "settings field"));
67
+ },
68
+ };
@@ -0,0 +1,3 @@
1
+ import type { DeliveryCheck } from "./types.js";
2
+ export declare const PROVIDERS_CHECK_NAME = "Providers and secrets";
3
+ export declare const providersCheck: DeliveryCheck;
@@ -0,0 +1,298 @@
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, 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
+ /** The words that count each table kind's entries in the check's summary. */
14
+ const KIND_WORDS = {
15
+ formProtection: { one: "form protection provider", many: "form protection providers" },
16
+ search: { one: "search provider", many: "search providers" },
17
+ mediaStore: { one: "media store", many: "media stores" },
18
+ mail: { one: "mail sender", many: "mail senders" },
19
+ signIn: { one: "sign-in provider", many: "sign-in providers" },
20
+ };
21
+ /** Per kind: the functions a provider must have, the ones it may have, and the words that count it. */
22
+ const KINDS = PROVIDER_TABLE_KINDS.map((kind) => ({
23
+ key: PROVIDER_TABLE_CONTRIBUTION_KEYS[kind],
24
+ ...PROVIDER_TABLE_FUNCTIONS[kind],
25
+ ...KIND_WORDS[kind],
26
+ }));
27
+ /** A language-map or plain label's texts, or null when it is neither. */
28
+ function labelTexts(value) {
29
+ if (typeof value === "string")
30
+ return [value];
31
+ const map = record(value);
32
+ if (map === null)
33
+ return null;
34
+ const texts = [];
35
+ for (const text of Object.values(map)) {
36
+ if (typeof text !== "string")
37
+ return null;
38
+ texts.push(text);
39
+ }
40
+ return texts;
41
+ }
42
+ /** The valid secret names the manifest declares, which a sign-in provider's secret fields must name. */
43
+ function declaredSecretNamesOf(value) {
44
+ const names = new Set();
45
+ if (!Array.isArray(value))
46
+ return names;
47
+ for (const raw of value.slice(0, PLUGIN_SECRETS_MAX)) {
48
+ const name = record(raw)?.name;
49
+ if (typeof name === "string" && isPluginSecretName(name))
50
+ names.add(name);
51
+ }
52
+ return names;
53
+ }
54
+ /** 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. */
55
+ function textProblem(value, max) {
56
+ const texts = labelTexts(value);
57
+ if (texts === null || texts.length === 0)
58
+ return "must be text, or a map of language to text with English";
59
+ for (const text of texts) {
60
+ if (text.length > max)
61
+ return `is at most ${max} characters`;
62
+ if (!isProviderText(text, max))
63
+ return "must not be blank or hold a control or hidden character";
64
+ }
65
+ // 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.
66
+ if (typeof value !== "string" && !PluginLabelSchema.safeParse(Object.fromEntries(Object.keys(value).map((key) => [key, "x"]))).success)
67
+ return "must be text, or a map of language to text with English";
68
+ return null;
69
+ }
70
+ /** Whether the entry has the function: live as a function, redacted as a name in its `functions` list. */
71
+ function hasFunction(entry, name) {
72
+ if (typeof entry[name] === "function")
73
+ return true;
74
+ return Array.isArray(entry.functions) && entry.functions.includes(name);
75
+ }
76
+ function checkEntryText(entry, where, issues, labelRequired, descriptionChecked = true) {
77
+ if (entry.label === undefined) {
78
+ if (labelRequired)
79
+ issues.push(`${where}.label is required`);
80
+ }
81
+ else {
82
+ const problem = textProblem(entry.label, PROVIDER_LABEL_MAX);
83
+ if (problem !== null)
84
+ issues.push(`${where}.label ${problem}`);
85
+ }
86
+ if (descriptionChecked && entry.description !== undefined) {
87
+ const problem = textProblem(entry.description, PROVIDER_DESCRIPTION_MAX);
88
+ if (problem !== null)
89
+ issues.push(`${where}.description ${problem}`);
90
+ }
91
+ }
92
+ /**
93
+ * M33 K57: the problem with a sign-in button's picture, or null. The name is signInDeclarationProblems'
94
+ * rule; only a name that passes it is opened. The file must ship, be at most SIGN_IN_MARK_BYTES_MAX
95
+ * bytes (its size read before any byte is), and be a PNG whose header says square, SIGN_IN_MARK_PX_MIN
96
+ * to SIGN_IN_MARK_PX_MAX pixels a side, read by pngSize, the one header reader the cover check uses.
97
+ */
98
+ function markProblem(dir, mark, where, whyNotShipped) {
99
+ if (!isSignInMark(mark))
100
+ return null;
101
+ const path = `public/${mark}`;
102
+ const said = `${where}.mark names ${path}, which`;
103
+ const why = whyNotShipped(path);
104
+ if (why !== null)
105
+ return `${said} ${why}`;
106
+ const file = join(dir, "public", mark);
107
+ if (statSync(file).size > SIGN_IN_MARK_BYTES_MAX)
108
+ return `${said} is larger than ${SIGN_IN_MARK_BYTES_MAX} bytes`;
109
+ const size = pngSize(readFileSync(file));
110
+ if (size === null)
111
+ return `${said} is not a PNG`;
112
+ if (size.width !== size.height)
113
+ return `${said} is not square: it is ${size.width} by ${size.height} pixels`;
114
+ if (size.width < SIGN_IN_MARK_PX_MIN || size.width > SIGN_IN_MARK_PX_MAX) {
115
+ return `${said} is ${size.width} pixels a side; a picture is ${SIGN_IN_MARK_PX_MIN} to ${SIGN_IN_MARK_PX_MAX}`;
116
+ }
117
+ return null;
118
+ }
119
+ function checkProviders(kind, value, issues, declaredSecretNames, whyNotShipped, dir) {
120
+ const base = `contributions.${kind.key}`;
121
+ if (!Array.isArray(value)) {
122
+ issues.push(`${base} must be a list`);
123
+ return 0;
124
+ }
125
+ if (value.length > PROVIDERS_PER_KIND_MAX)
126
+ issues.push(`${base} holds ${value.length} entries; at most ${PROVIDERS_PER_KIND_MAX} are allowed`);
127
+ const seen = new Set();
128
+ // Past the cap one more entry is read, so the list is refused once and a huge one costs little.
129
+ value.slice(0, PROVIDERS_PER_KIND_MAX + 1).forEach((raw, index) => {
130
+ const where = `${base}[${index}]`;
131
+ const entry = record(raw);
132
+ if (entry === null) {
133
+ issues.push(`${where} must be an object`);
134
+ return;
135
+ }
136
+ const id = entry.id;
137
+ if (typeof id !== "string" || !isProviderId(id)) {
138
+ issues.push(`${where}.id must be 1 to ${PROVIDER_ID_MAX} lower-case letters, digits and "-", starting with a letter and not ending with "-"`);
139
+ }
140
+ else if (seen.has(id)) {
141
+ issues.push(`${where}.id is used twice in ${kind.key}`);
142
+ }
143
+ else {
144
+ seen.add(id);
145
+ }
146
+ // M33 K56: a sign-in entry's description is signInDeclarationProblems' (SIGN_IN_DESCRIPTION_MAX, no direction character), so it is named once.
147
+ checkEntryText(entry, where, issues, true, kind.key !== "signInProviders");
148
+ if (kind.key === "protectionProviders") {
149
+ const prefix = entry.fieldPrefix;
150
+ if (typeof prefix !== "string" || !isProtectionFieldPrefix(prefix)) {
151
+ 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"`);
152
+ }
153
+ // M33 K51: the provider's own script, a .js file of public/ by the one rule, that the package carries.
154
+ const widgetScript = entry.widgetScript;
155
+ if (widgetScript !== undefined) {
156
+ if (!isProtectionWidgetScript(widgetScript)) {
157
+ issues.push(`${where}.widgetScript must name a .js file in the plugin's public/ folder, such as "captcha.js"`);
158
+ }
159
+ else {
160
+ const why = whyNotShipped(`public/${widgetScript}`);
161
+ if (why !== null)
162
+ issues.push(`${where}.widgetScript names public/${widgetScript}, which ${why}`);
163
+ }
164
+ }
165
+ }
166
+ if (kind.key === "signInProviders") {
167
+ // The protocol decides whether `profile` is required or refused, so its rule is signInDeclarationProblems' alone.
168
+ issues.push(...signInDeclarationProblems(entry, declaredSecretNames, where));
169
+ const mark = markProblem(dir, entry.mark, where, whyNotShipped);
170
+ if (mark !== null)
171
+ issues.push(mark);
172
+ return;
173
+ }
174
+ for (const name of kind.required)
175
+ if (!hasFunction(entry, name))
176
+ issues.push(`${where}.${name} must be a function`);
177
+ for (const name of kind.optional) {
178
+ if (entry[name] !== undefined && !hasFunction(entry, name))
179
+ issues.push(`${where}.${name} must be a function`);
180
+ }
181
+ });
182
+ return value.length;
183
+ }
184
+ /** M32 H (H19): the form replies declaration is one object with a label and an optional description. */
185
+ function checkFormReplies(value, issues) {
186
+ const entry = record(value);
187
+ if (entry === null) {
188
+ issues.push("contributions.formReplies must be an object");
189
+ return;
190
+ }
191
+ checkEntryText(entry, "contributions.formReplies", issues, true);
192
+ }
193
+ /** M33 K11: at most 10 mail kinds, each an id used once, a label and, when given, a description. */
194
+ function checkMailKinds(value, issues) {
195
+ if (!Array.isArray(value)) {
196
+ issues.push("contributions.mailKinds must be a list");
197
+ return 0;
198
+ }
199
+ if (value.length > PLUGIN_MAIL_KINDS_MAX)
200
+ issues.push(`contributions.mailKinds holds ${value.length} entries; at most ${PLUGIN_MAIL_KINDS_MAX} are allowed`);
201
+ const seen = new Set();
202
+ value.slice(0, PLUGIN_MAIL_KINDS_MAX + 1).forEach((raw, index) => {
203
+ const where = `contributions.mailKinds[${index}]`;
204
+ const entry = record(raw);
205
+ if (entry === null) {
206
+ issues.push(`${where} must be an object`);
207
+ return;
208
+ }
209
+ const id = entry.id;
210
+ if (typeof id !== "string" || !isPluginMailKindId(id)) {
211
+ issues.push(`${where}.id must be a letter, then letters, digits and "_", 1 to ${PLUGIN_MAIL_KIND_ID_MAX} characters`);
212
+ }
213
+ else if (seen.has(id)) {
214
+ issues.push(`${where}.id is used twice in mailKinds`);
215
+ }
216
+ else {
217
+ seen.add(id);
218
+ }
219
+ checkEntryText(entry, where, issues, true);
220
+ });
221
+ return value.length;
222
+ }
223
+ function checkSecrets(value, issues) {
224
+ if (!Array.isArray(value)) {
225
+ issues.push("contributions.secrets must be a list");
226
+ return 0;
227
+ }
228
+ if (value.length > PLUGIN_SECRETS_MAX)
229
+ issues.push(`contributions.secrets holds ${value.length} entries; at most ${PLUGIN_SECRETS_MAX} are allowed`);
230
+ const seen = new Set();
231
+ value.slice(0, PLUGIN_SECRETS_MAX + 1).forEach((raw, index) => {
232
+ const where = `contributions.secrets[${index}]`;
233
+ const entry = record(raw);
234
+ if (entry === null) {
235
+ issues.push(`${where} must be an object`);
236
+ return;
237
+ }
238
+ const name = entry.name;
239
+ if (typeof name !== "string" || !isPluginSecretName(name)) {
240
+ issues.push(`${where}.name must be 1 to ${PLUGIN_SECRET_NAME_MAX} lower-case letters, digits and "_", starting with a letter`);
241
+ }
242
+ else if (seen.has(name)) {
243
+ issues.push(`${where}.name is used twice in secrets`);
244
+ }
245
+ else {
246
+ seen.add(name);
247
+ }
248
+ checkEntryText(entry, where, issues, true);
249
+ });
250
+ return value.length;
251
+ }
252
+ export const providersCheck = {
253
+ name: PROVIDERS_CHECK_NAME,
254
+ 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, ` +
255
+ `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; ` +
256
+ "a search provider has `index`, `remove` and `query` functions; a media store has `put`, `open`, `delete` and `exists` functions. " +
257
+ `\`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 "_". ` +
258
+ "`mailSenders` keeps to the same count, id and label rules, and a mail sender has a `send` function (`ready` is optional); `formReplies` is one object with a `label` and, when given, a `description`, kept to the same limits. " +
259
+ `\`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. ` +
260
+ `\`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.`,
261
+ gates: ["cli", "door"],
262
+ needsManifest: true,
263
+ run: ({ dir, manifest }) => {
264
+ const contributions = contributionsOf(manifest);
265
+ const issues = [];
266
+ const parts = [];
267
+ const declaredSecretNames = declaredSecretNamesOf(contributions.secrets);
268
+ // Made only when a widget script or a sign-in picture asks, so a check with neither reads no folder.
269
+ let lookup;
270
+ const whyNotShipped = (path) => (lookup ??= createShippedLookup(dir))(path);
271
+ for (const kind of KINDS) {
272
+ if (contributions[kind.key] === undefined)
273
+ continue;
274
+ const count = checkProviders(kind, contributions[kind.key], issues, declaredSecretNames, whyNotShipped, dir);
275
+ if (count > 0)
276
+ parts.push(`${count} ${count === 1 ? kind.one : kind.many}`);
277
+ }
278
+ if (contributions.formReplies !== undefined) {
279
+ const before = issues.length;
280
+ checkFormReplies(contributions.formReplies, issues);
281
+ if (issues.length === before)
282
+ parts.push("form replies");
283
+ }
284
+ if (contributions.mailKinds !== undefined) {
285
+ const count = checkMailKinds(contributions.mailKinds, issues);
286
+ if (count > 0)
287
+ parts.push(plural(count, "mail kind"));
288
+ }
289
+ if (contributions.secrets !== undefined) {
290
+ const count = checkSecrets(contributions.secrets, issues);
291
+ if (count > 0)
292
+ parts.push(plural(count, "secret"));
293
+ }
294
+ if (issues.length > 0)
295
+ return failed(`manifest.json declares its providers or secrets wrongly: ${listCapped(issues)}`);
296
+ return parts.length === 0 ? passed("no providers or secrets declared") : passed(parts.join(", "));
297
+ },
298
+ };
@@ -1,17 +1,26 @@
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 { aiDeclarationsCheck } from "./ai-declarations.js";
4
6
  import { archiveNamesCheck } from "./archive-names.js";
5
7
  import { bundleSizeCheck } from "./bundle.js";
8
+ import { contentAccessCheck } from "./content-access.js";
6
9
  import { apiRoutesCheck, databaseCheck, iconNamesCheck, requiredViewsCheck, vendorServiceCheck } from "./contributions.js";
10
+ import { editorExtensionsCheck } from "./editor-extensions.js";
11
+ import { graphqlFieldsCheck } from "./graphql-fields.js";
7
12
  import { labelLanguagesCheck } from "./label-languages.js";
13
+ import { licenceCheck } from "./licence-check.js";
8
14
  import { BUNDLE_MAX_GZIP_BYTES, MANIFEST_MAX_BYTES, formatBinarySize } from "./limits.js";
9
15
  import { localeParityCheck, localesCheck } from "./locales.js";
10
16
  import { coverCheck, docsContractCheck, docsLinksCheck, readmeCheck } from "./package-files.js";
17
+ import { pluginSettingsCheck } from "./plugin-settings.js";
18
+ import { serverPowersCheck } from "./server-powers.js";
19
+ import { providersCheck } from "./providers.js";
11
20
  import { installOptionsCheck, sampleContentCheck } from "./sample-content.js";
12
- import { SAMPLE_CONTENT_MAX_BYTES, readShippedSampleContent } from "../sample-content.js";
21
+ import { siteExtensionsCheck } from "./site-extensions.js";
13
22
  import { describeError } from "./support.js";
14
- import { assetsCheck, entryBudgetCheck, payloadSizesCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
23
+ import { assetsCheck, declaredDataTypesCheck, entryBudgetCheck, payloadSizesCheck, templateDeclarationsCheck, templateFilesCheck, templateWiringCheck } from "./templates.js";
15
24
  /** Runs the checks of one gate in order. A check that cannot run because the
16
25
  * manifest did not parse says so; a check that throws is a failed result, never
17
26
  * an exception that escapes the gate (a directory where a file belongs is the
@@ -41,8 +50,17 @@ export function runChecks(checks, context, gate) {
41
50
  export const DELIVERY_CHECKS = [
42
51
  requiredViewsCheck,
43
52
  apiRoutesCheck,
53
+ aiDeclarationsCheck,
54
+ graphqlFieldsCheck,
55
+ contentAccessCheck,
56
+ siteExtensionsCheck,
57
+ editorExtensionsCheck,
58
+ providersCheck,
59
+ pluginSettingsCheck,
60
+ serverPowersCheck,
44
61
  databaseCheck,
45
62
  vendorServiceCheck,
63
+ licenceCheck,
46
64
  iconNamesCheck,
47
65
  readmeCheck,
48
66
  coverCheck,
@@ -54,6 +72,7 @@ export const DELIVERY_CHECKS = [
54
72
  installOptionsCheck,
55
73
  sampleContentCheck,
56
74
  templateDeclarationsCheck,
75
+ declaredDataTypesCheck,
57
76
  templateFilesCheck,
58
77
  templateWiringCheck,
59
78
  assetsCheck,
@@ -73,14 +92,16 @@ export const GATE_ONLY_CHECKS = [
73
92
  { 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
93
  { name: "templates parse", gate: "cli", rule: "Every template parses as Liquid; the marketplace never parses template code and reports it skipped.", skippedAtDoor: true },
75
94
  { 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 },
95
+ { 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 },
76
96
  { name: "reference", gate: "cli", rule: "The manifest yields a valid `reference.json`, which the build writes and the marketplace reads.", skippedAtDoor: false },
97
+ { 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
98
  { 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
99
  { 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
100
  { 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
101
  { 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
102
  { 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
103
  { 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 },
104
+ { 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
105
  { 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
106
  { 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
107
  ];