@kardalum/plugin-sdk 0.0.0-stage → 0.16.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 (332) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/LICENSE +202 -0
  3. package/README.md +80 -2
  4. package/dist/admin-section-registry.d.ts +34 -0
  5. package/dist/admin-section-registry.js +49 -0
  6. package/dist/built-in-serializers.d.ts +3 -0
  7. package/dist/built-in-serializers.js +18 -0
  8. package/dist/built-in-settings-schemas.d.ts +14 -0
  9. package/dist/built-in-settings-schemas.js +225 -0
  10. package/dist/built-in-value-schemas.d.ts +4 -0
  11. package/dist/built-in-value-schemas.js +47 -0
  12. package/dist/built-ins.d.ts +1 -0
  13. package/dist/built-ins.js +257 -0
  14. package/dist/capabilities.d.ts +29 -0
  15. package/dist/capabilities.js +67 -0
  16. package/dist/data-type-plugin.d.ts +28 -0
  17. package/dist/data-type-plugin.js +1 -0
  18. package/dist/datatype-validation.d.ts +26 -0
  19. package/dist/datatype-validation.js +110 -0
  20. package/dist/datatypes-entry.d.ts +4 -0
  21. package/dist/datatypes-entry.js +18 -0
  22. package/dist/define-plugin.d.ts +25 -0
  23. package/dist/define-plugin.js +51 -0
  24. package/dist/entitlement-entry.d.ts +5 -0
  25. package/dist/entitlement-entry.js +24 -0
  26. package/dist/entitlement-gate.d.ts +36 -0
  27. package/dist/entitlement-gate.js +201 -0
  28. package/dist/entitlement-types.d.ts +39 -0
  29. package/dist/entitlement-types.js +1 -0
  30. package/dist/entitlement.d.ts +57 -0
  31. package/dist/entitlement.js +170 -0
  32. package/dist/host-entry.d.ts +1 -0
  33. package/dist/host-entry.js +11 -0
  34. package/dist/icon-name.d.ts +1 -0
  35. package/dist/icon-name.js +1 -0
  36. package/dist/icons.d.ts +2 -0
  37. package/dist/icons.js +10 -0
  38. package/dist/index.d.ts +28 -0
  39. package/dist/index.js +94 -0
  40. package/dist/license-verdict-keys.d.ts +18 -0
  41. package/dist/license-verdict-keys.js +26 -0
  42. package/dist/local-host.d.ts +3 -0
  43. package/dist/local-host.js +38 -0
  44. package/dist/manifest-entry.d.ts +8 -0
  45. package/dist/manifest-entry.js +13 -0
  46. package/dist/manifest-schema.d.ts +476 -0
  47. package/dist/manifest-schema.js +823 -0
  48. package/dist/manifest.d.ts +611 -0
  49. package/dist/manifest.js +86 -0
  50. package/dist/media/media-picker.d.ts +39 -0
  51. package/dist/media/media-picker.js +447 -0
  52. package/dist/media/upload-error.d.ts +12 -0
  53. package/dist/media/upload-error.js +30 -0
  54. package/dist/plugin-context.d.ts +82 -0
  55. package/dist/plugin-context.js +77 -0
  56. package/dist/plugin-screen-context.d.ts +71 -0
  57. package/dist/plugin-screen-context.js +41 -0
  58. package/dist/read-all-pages.d.ts +23 -0
  59. package/dist/read-all-pages.js +30 -0
  60. package/dist/register-built-ins.d.ts +1 -0
  61. package/dist/register-built-ins.js +41 -0
  62. package/dist/registry.d.ts +4 -0
  63. package/dist/registry.js +17 -0
  64. package/dist/rendition-eligibility.d.ts +24 -0
  65. package/dist/rendition-eligibility.js +40 -0
  66. package/dist/richtext/block-panel.d.ts +27 -0
  67. package/dist/richtext/block-panel.js +232 -0
  68. package/dist/richtext/extensions.d.ts +19 -0
  69. package/dist/richtext/extensions.js +56 -0
  70. package/dist/richtext/insert-menu.d.ts +24 -0
  71. package/dist/richtext/insert-menu.js +142 -0
  72. package/dist/richtext/kardalum-block.d.ts +33 -0
  73. package/dist/richtext/kardalum-block.js +282 -0
  74. package/dist/richtext/style-listbox.d.ts +10 -0
  75. package/dist/richtext/style-listbox.js +69 -0
  76. package/dist/richtext/text-style-class.d.ts +18 -0
  77. package/dist/richtext/text-style-class.js +36 -0
  78. package/dist/simple-storage-value-provider.d.ts +9 -0
  79. package/dist/simple-storage-value-provider.js +96 -0
  80. package/dist/structured-storage-types.d.ts +61 -0
  81. package/dist/structured-storage-types.js +11 -0
  82. package/dist/tailwind.d.ts +1 -0
  83. package/dist/tailwind.js +5 -0
  84. package/dist/tokens/system-dark.css +75 -0
  85. package/dist/tokens/tokens.css +239 -0
  86. package/dist/tokens/tokens.json +212 -0
  87. package/dist/tokens.d.ts +1 -0
  88. package/dist/tokens.js +11 -0
  89. package/dist/ui-entry.d.ts +5 -0
  90. package/dist/ui-entry.js +42 -0
  91. package/dist/views/content-list-preview.d.ts +1 -0
  92. package/dist/views/content-list-preview.js +14 -0
  93. package/dist/views/content-list-settings-view.d.ts +1 -0
  94. package/dist/views/content-list-settings-view.js +97 -0
  95. package/dist/views/content-list-view.d.ts +19 -0
  96. package/dist/views/content-list-view.js +248 -0
  97. package/dist/views/crop-view.d.ts +55 -0
  98. package/dist/views/crop-view.js +161 -0
  99. package/dist/views/date-range-view.d.ts +6 -0
  100. package/dist/views/date-range-view.js +55 -0
  101. package/dist/views/file-upload-view.d.ts +43 -0
  102. package/dist/views/file-upload-view.js +104 -0
  103. package/dist/views/html-code-editor.d.ts +10 -0
  104. package/dist/views/html-code-editor.js +101 -0
  105. package/dist/views/html-view.d.ts +3 -0
  106. package/dist/views/html-view.js +53 -0
  107. package/dist/views/image-view.d.ts +3 -0
  108. package/dist/views/image-view.js +372 -0
  109. package/dist/views/rich-text-view.d.ts +2 -0
  110. package/dist/views/rich-text-view.js +429 -0
  111. package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
  112. package/node_modules/@kardalum/api-schemas/README.md +56 -0
  113. package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
  114. package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
  115. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +17 -0
  116. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +25 -0
  117. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +93 -0
  118. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +88 -0
  119. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
  120. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
  121. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
  122. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
  123. package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
  124. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +542 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +357 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
  130. package/node_modules/@kardalum/api-schemas/dist/content-path.js +260 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
  132. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
  133. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +152 -0
  134. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
  136. package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
  138. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
  139. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +352 -0
  140. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +133 -0
  141. package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
  142. package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
  143. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +37 -0
  144. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
  145. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
  146. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
  147. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +298 -0
  148. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
  149. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
  150. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
  151. package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
  152. package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
  153. package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
  154. package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
  155. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +113 -0
  156. package/node_modules/@kardalum/api-schemas/dist/index.js +64 -0
  157. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
  158. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +682 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +269 -0
  163. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +177 -0
  164. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +222 -0
  165. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
  166. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
  167. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
  168. package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
  169. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
  170. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
  171. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
  172. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
  173. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
  174. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
  175. package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
  176. package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
  177. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
  178. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
  179. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
  180. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
  181. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +249 -0
  182. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +84 -0
  183. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
  184. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
  185. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +172 -0
  186. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +196 -0
  187. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
  188. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
  189. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  190. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  191. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +585 -0
  192. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +536 -0
  193. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +75 -0
  194. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +213 -0
  195. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +391 -0
  196. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +413 -0
  197. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +29 -0
  198. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +100 -0
  199. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +44 -0
  200. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +162 -0
  201. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
  202. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
  204. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
  205. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +314 -0
  206. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +338 -0
  207. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
  208. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
  209. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
  210. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
  211. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
  212. package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
  213. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +96 -0
  214. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +75 -0
  215. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
  216. package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
  217. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +35 -0
  218. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +79 -0
  219. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +138 -0
  220. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +105 -0
  221. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
  222. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
  223. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +47 -0
  224. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +27 -0
  225. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
  226. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
  227. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
  228. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
  229. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
  230. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
  231. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
  233. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +97 -0
  234. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +73 -0
  235. package/node_modules/@kardalum/api-schemas/package.json +35 -0
  236. package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
  237. package/node_modules/@kardalum/design-tokens/README.md +29 -0
  238. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
  239. package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
  240. package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
  241. package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
  242. package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
  243. package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
  244. package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
  245. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
  246. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
  247. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
  248. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
  249. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
  250. package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
  251. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
  252. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
  253. package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
  254. package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
  255. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
  256. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
  257. package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
  258. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
  259. package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
  260. package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
  261. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
  262. package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
  263. package/node_modules/@kardalum/design-tokens/package.json +42 -0
  264. package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
  265. package/node_modules/@kardalum/plugin-package/README.md +71 -0
  266. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +111 -0
  267. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +61 -0
  268. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  269. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +351 -0
  270. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
  271. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
  272. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
  273. package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
  274. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
  275. package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
  276. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
  277. package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
  278. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +13 -0
  279. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -0
  280. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
  281. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
  282. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
  283. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
  284. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +2 -0
  285. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +6 -0
  286. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +20 -0
  287. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +57 -0
  288. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +43 -0
  289. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -0
  290. package/node_modules/@kardalum/plugin-package/package.json +54 -0
  291. package/node_modules/@kardalum/ui/LICENSE +202 -0
  292. package/node_modules/@kardalum/ui/README.md +35 -0
  293. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
  294. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
  295. package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
  296. package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
  297. package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
  298. package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
  299. package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
  300. package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
  301. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
  302. package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
  303. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
  304. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
  305. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
  306. package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
  307. package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
  308. package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
  309. package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
  310. package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
  311. package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
  312. package/node_modules/@kardalum/ui/dist/components/property-field.js +89 -0
  313. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
  314. package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
  315. package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
  316. package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
  317. package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
  318. package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
  319. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
  320. package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
  321. package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
  322. package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
  323. package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
  324. package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
  325. package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
  326. package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
  327. package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
  328. package/node_modules/@kardalum/ui/dist/index.js +18 -0
  329. package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
  330. package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
  331. package/node_modules/@kardalum/ui/package.json +63 -0
  332. package/package.json +146 -4
@@ -0,0 +1,413 @@
1
+ import { z } from "zod";
2
+ import { PluginRoleOfferSchema } from "./plugin-actions.schema.js";
3
+ import { InstallRoleOutcomeSchema } from "./plugin-install-record.schema.js";
4
+ import { SampleContentOutcomeSchema } from "./sample-content-outcome.schema.js";
5
+ // The ADMIN management view of the registry (S135): unlike the public
6
+ // GET /api/plugins (enabled-only, boot-loader metadata), this surface
7
+ // lists every installed plugin, disabled included. licenseStatus reflects
8
+ // the PluginLicense row's last verdict ("valid" | "revoked" |
9
+ // "domain_mismatch" | "unknown" | "grace_expired"), or null when the plugin has no license
10
+ // row at all (free plugins, or a paid plugin never validated yet,
11
+ // S138/S139). The three fields below (S139 Task 5) ride along so the
12
+ // admin's license cell can render an honest state without a second
13
+ // request per row: licenseReason mirrors PluginLicense.lastReason (the
14
+ // server's explanation for a non-valid verdict), licenseLastValidatedAt
15
+ // mirrors lastValidatedAt (the last SUCCESSFUL verdict), and
16
+ // licenseLastAttemptError mirrors lastAttemptError (why the most recent
17
+ // ATTEMPT — successful or not — failed to reach a verdict; null when it
18
+ // didn't). Together the last two let the cell compute "unreachable since"
19
+ // itself. boundDomain mirrors PluginLicense.boundDomain (the domain this
20
+ // site bound the license to at S138 install; never mutated by later
21
+ // revalidation — see revalidate-license.ts) so a domain_mismatch warning
22
+ // can name the actual bound domain instead of the raw upstream reason
23
+ // token (S139 fix wave, spec section 6). Never add `key` here — see the
24
+ // route's comment on the same prisma select.
25
+ // licenseLocked / buyHref (S209 Task 7, hardened by the S209 criticals
26
+ // fix): whether THIS production domain has locked the plugin's admin UI —
27
+ // distinct from licenseStatus === "domain_mismatch" on its own, which also
28
+ // covers the plain warn-only case (localhost, or any domain the license
29
+ // server hasn't been asked to lock on production for). True for either of
30
+ // two reasons: a stored domain_mismatch verdict, or — closing the gap a
31
+ // paid plugin side-loaded through the ZIP door left open, since that door
32
+ // never writes a PluginLicense row at all — a plugin pluginRequiresLicense()
33
+ // (apps/server/src/licensing/entitlement.ts) reports as a paid marketplace
34
+ // listing with no valid licence on record. Computed at read time from the
35
+ // stored license row (plus, for the no-row case, a cached marketplace
36
+ // lookup) and the CURRENT request's own domain
37
+ // (apps/server/src/licensing/production-domain.ts's isProductionDomain),
38
+ // never persisted — a licensed plugin re-checked from a different admin
39
+ // domain must never keep yesterday's lock. `revoked` never sets this: that
40
+ // status already deactivates the plugin outright (see revalidate-license.ts),
41
+ // which is a different, harder consequence than a lock. buyHref is the
42
+ // marketplace listing URL for this plugin id, present only alongside a
43
+ // true licenseLocked (there is nothing to buy a fix for otherwise) and
44
+ // null when no marketplace is configured for this instance.
45
+ /** S274b (spec D4): an offer on the installed-plugins list says whether a
46
+ * role with its id already exists, so the view can hide "Create role"
47
+ * without reading the roles list (which needs roles.read). */
48
+ export const ManagedPluginRoleOfferSchema = PluginRoleOfferSchema.extend({ created: z.boolean() });
49
+ /** S284b: the marketplace's classification of an installed package that is
50
+ * not the one it delivered for the licence (the verdict's `tamper`). */
51
+ export const PluginTamperKindSchema = z.enum(["foreign-package", "sideloaded", "modified-on-disk"]);
52
+ export const ManagedPluginSchema = z.object({
53
+ pluginId: z.string(),
54
+ name: z.string(),
55
+ type: z.string(),
56
+ version: z.string(),
57
+ trustTier: z.enum(["verified", "unverified"]),
58
+ storageType: z.enum(["simple", "structured"]),
59
+ enabled: z.boolean(),
60
+ licenseStatus: z
61
+ .string()
62
+ .nullable()
63
+ .describe('The licence row\'s last verdict: "valid", "revoked", "domain_mismatch", "unknown", or "grace_expired" (no valid verdict within the grace period, so the plugin is switched off until one arrives). Null when the plugin has no licence row.'),
64
+ licenseReason: z.string().nullable(),
65
+ // S284b fix wave: the signed `detail` of the latest verdict, today the
66
+ // marketplace operator's reason for a `domain_blocked` answer, which the
67
+ // admin shows after its sentence. Null when the verdict carried none.
68
+ licenseReasonDetail: z.string().nullable(),
69
+ licenseLastValidatedAt: z.string().nullable(),
70
+ // S284b: the newest issuedAt of any valid verdict this site has stored
71
+ // (ISO), the clock the grace period runs on. Null before the first one.
72
+ licenseLastValidIssuedAt: z.string().nullable(),
73
+ licenseLastAttemptError: z.string().nullable(),
74
+ boundDomain: z.string().nullable(),
75
+ // S284b: what THIS row's `enabled` was when a grace lock closed (the
76
+ // registry row's own value since the fix wave, so a bundle member keeps
77
+ // its own), so the first valid verdict can restore it. Null when no grace
78
+ // lock is outstanding on the row.
79
+ lockedFromEnabled: z.boolean().nullable(),
80
+ // S284b: the marketplace's tamper finding from the latest valid verdict.
81
+ // It only explains; nothing on the host acts on it. Null when clean.
82
+ tamperKind: PluginTamperKindSchema.nullable(),
83
+ // True for a production domain_mismatch, a paid plugin with no licence on
84
+ // record (both above) and, since S284b, a grace_expired lock.
85
+ licenseLocked: z.boolean(),
86
+ buyHref: z.string().nullable(),
87
+ // S273: the roles this plugin's attached manifest offers, so an uploaded
88
+ // or sideloaded plugin, which has no install screen, can have an offer
89
+ // accepted from the installed-plugins view. Empty when the manifest is
90
+ // not attached (package missing at boot) or offers nothing.
91
+ roleOffers: z.array(ManagedPluginRoleOfferSchema),
92
+ // S274c: distinct roles holding any of this plugin's actions, for the
93
+ // uninstall dialog.
94
+ grantedRoleCount: z.number().int().nonnegative(),
95
+ // S294 (2026-10-14-s294-update-available-design.md 3.6): the newer version
96
+ // the marketplace has for this plugin and this site can take
97
+ // (updateAvailableFor, the detail view's Update rule), or null: no such
98
+ // version, no listing, a bundle, no marketplace configured, or a
99
+ // marketplace that cannot be reached when nothing was learned from it
100
+ // before (a cold cache). The lookup fails open: a version learned earlier
101
+ // is served through a failure and its backoff, and while a lookup slower
102
+ // than the list's two-second wait runs.
103
+ updateAvailable: z.object({ version: z.string() }).nullable(),
104
+ });
105
+ export const ManagedPluginListQuerySchema = z.object({
106
+ cursor: z.string().uuid().optional(),
107
+ limit: z.coerce.number().int().min(1).max(100).default(50),
108
+ });
109
+ export const ManagedPluginListResponseSchema = z.object({
110
+ items: z.array(ManagedPluginSchema),
111
+ nextCursor: z.string().uuid().nullable(),
112
+ // S284b: the grace period this server applies (KARDALUM_LICENSE_GRACE_DAYS,
113
+ // 1 to 14), so the admin's grace_expired sentence names the real days.
114
+ licenseGraceDays: z.number().int(),
115
+ });
116
+ export const PluginIdParamsSchema = z.object({
117
+ pluginId: z.string().min(1),
118
+ });
119
+ // Fastify substitutes `null` for a genuinely absent body before handing it
120
+ // to the validator (lib/validation.js's validateParam: `isUndefined ? null
121
+ // : request[paramName]`) — a DELETE sent with no payload at all lands here
122
+ // as `null`, not `undefined`. `.nullish()` (not `.optional()`) is required
123
+ // so an absent body validates; `request.body?.confirmStructuredDataCleanup`
124
+ // in the route handler already tolerates both null and undefined.
125
+ export const UninstallPluginBodySchema = z
126
+ .object({
127
+ confirmStructuredDataCleanup: z.boolean().optional(),
128
+ // S293: the uninstall mirror; absent means true, and each only acts on
129
+ // what the install record holds.
130
+ removeSampleContent: z.boolean().optional(),
131
+ removeRoles: z.boolean().optional(),
132
+ })
133
+ // S293: strict, because an absent flag means true: a misspelt opt-out
134
+ // dropped as an unknown key would be read as consent to remove.
135
+ .strict()
136
+ .nullish();
137
+ // 409 payload when a structured plugin's uninstall needs confirmation —
138
+ // the snapshot has ALREADY been taken (S87's safe-to-retry design).
139
+ export const UninstallConfirmationRequiredSchema = z.object({
140
+ requiresConfirmation: z.literal(true),
141
+ snapshotGroupId: z.string(),
142
+ message: z.string(),
143
+ });
144
+ // S152: the BUNDLE uninstall's aggregated 409 — one snapshot group per
145
+ // structured plugin in the removal set (owned members, and the bundle
146
+ // itself if structured). A separate schema rather than widening
147
+ // UninstallConfirmationRequiredSchema: the single-plugin contract
148
+ // (snapshotGroupId, required) stays byte-identical for existing clients.
149
+ // Every snapshot is ALREADY taken when this is sent (S87's safe-to-retry
150
+ // property, kept cross-plugin).
151
+ export const BundleUninstallConfirmationRequiredSchema = z.object({
152
+ requiresConfirmation: z.literal(true),
153
+ memberSnapshots: z.array(z.object({
154
+ pluginId: z.string(),
155
+ snapshotGroupId: z.string(),
156
+ })),
157
+ message: z.string(),
158
+ });
159
+ // F1 QA fix wave: the content-guard 409 — a single-plugin uninstall()
160
+ // blocked because one or more of its tracked document types still have
161
+ // content or templates referencing them. Distinct from the two
162
+ // confirmation schemas above (those are "confirm to proceed," this is a
163
+ // terminal refusal the caller must resolve by hand, never retried with a
164
+ // flag) and from the bare ApiErrorSchema (that still covers every OTHER
165
+ // refusal this route can throw, e.g. a bundle member blocked by an outside
166
+ // dependent) — a separate shape so `blockedBy` only ever appears when the
167
+ // server actually has a list of named blockers to put in it.
168
+ // contentCount is optional: the guard only knows a count for the
169
+ // "has-content" reason, not "has-templates" (document-type-service.ts's
170
+ // DocumentTypeInUseError never carries one for that reason either).
171
+ export const UninstallBlockedByDocumentTypesSchema = z.object({
172
+ message: z.string(),
173
+ blockedBy: z.array(z.object({
174
+ documentType: z.string(),
175
+ contentCount: z.number().int().nonnegative().optional(),
176
+ })),
177
+ });
178
+ // Task 6: the 200 success body for a single-plugin DELETE — the CONFIRMED
179
+ // pass's freshly-minted snapshotGroupId (the gate site already took it;
180
+ // this just stops discarding it), null for a simple-storage plugin (never
181
+ // snapshotted) or for the earlier PluginRegistry.uninstall() callers that
182
+ // route around the HTTP layer entirely.
183
+ export const UninstallSucceededSchema = z.object({
184
+ snapshotGroupId: z.string().nullable(),
185
+ });
186
+ // Task 6: the 200 success body for a BUNDLE DELETE — one entry per
187
+ // structured plugin in the cascade (owned members, and the bundle itself
188
+ // if structured) that got a fresh snapshot on this confirmed pass. Simple-
189
+ // storage members never appear here, same as the 409 aggregate above.
190
+ export const BundleUninstallSucceededSchema = z.object({
191
+ memberSnapshots: z.array(z.object({
192
+ pluginId: z.string(),
193
+ snapshotGroupId: z.string(),
194
+ })),
195
+ });
196
+ // S180: whether this instance has a marketplace to browse at all —
197
+ // `getMarketplaceBaseUrl()` returning undefined (KARDALUM_MARKETPLACE_URL
198
+ // explicitly set to "off", or blank) means `configured: false`. Distinct
199
+ // from the marketplace being unreachable (a `configured: true` instance
200
+ // whose upstream is down still gets the existing load-error treatment,
201
+ // never this). The admin gates the Marketplace browse/detail screens on
202
+ // this once, at the section level, so both render the same honest empty
203
+ // state when there's genuinely nothing to browse.
204
+ export const MarketplaceStatusResponseSchema = z.object({
205
+ configured: z.boolean(),
206
+ });
207
+ // The manual re-check route's response (S139): mirrors revalidateLicense's
208
+ // RevalidationOutcome, flattened for the wire. `checked: false` covers
209
+ // every fail-open case that still has a license row to report on
210
+ // (unreachable license server, no KARDALUM_SITE_DOMAIN, no marketplace
211
+ // configured) — `status` and `lastValidatedAt` stay null in that shape
212
+ // since nothing was verified. A plugin with no license row at all gets a
213
+ // 404 instead of this body (ApiErrorSchema) — there's nothing to recheck.
214
+ export const LicenseRecheckResponseSchema = z.object({
215
+ pluginId: z.string(),
216
+ checked: z.boolean(),
217
+ status: z.string().nullable(),
218
+ reason: z.string().nullable(),
219
+ lastValidatedAt: z.string().nullable(),
220
+ });
221
+ // S284b (design 3.2): the host's latest licence verdict for a plugin, valid
222
+ // or not, handed to the plugin's own code unchanged so the plugin can verify
223
+ // the marketplace's signature itself. The envelope is the signed shape from
224
+ // @kardalum/plugin-package's LicenseVerdictEnvelope; a verdict is public
225
+ // and signed, never a secret (the licence key never appears in it, only its
226
+ // hash).
227
+ export const LicenseVerdictEnvelopeSchema = z.object({
228
+ v: z.literal(1),
229
+ alg: z.literal("ed25519"),
230
+ typ: z.literal("license-verdict"),
231
+ keyId: z.string(),
232
+ keyHash: z.string(),
233
+ pluginId: z.string(),
234
+ domain: z.string(),
235
+ nonce: z.string(),
236
+ status: z.enum(["valid", "invalid", "revoked"]),
237
+ // Absent and null mean the same thing to the signature (both canonicalize
238
+ // to null), so either is carried as stored.
239
+ reason: z.string().nullish(),
240
+ issuedAt: z.string(),
241
+ tamper: PluginTamperKindSchema.optional(),
242
+ // The signed human sentence explaining `reason` (a domain block's reason).
243
+ detail: z.string().max(500).optional(),
244
+ });
245
+ // The tagged entitlement (S284b fix wave), the same value plugin server code
246
+ // receives on `context.entitlement`: `exempt` on a non-production install
247
+ // (no licence rule applies, nothing is checked), `none` when the host holds
248
+ // no verdict for the plugin (the plugin's check refuses with `missing`), and
249
+ // `verdict` with the stored verdict to verify.
250
+ export const EntitlementSchema = z.discriminatedUnion("kind", [
251
+ z.object({ kind: z.literal("exempt"), reason: z.literal("non-production") }),
252
+ z.object({
253
+ kind: z.literal("verdict"),
254
+ envelope: LicenseVerdictEnvelopeSchema,
255
+ /** base64 Ed25519 signature over the envelope's canonical form. */
256
+ signature: z.string(),
257
+ }),
258
+ z.object({ kind: z.literal("none") }),
259
+ ]);
260
+ // GET /api/plugin-management/entitlement/:pluginId (any authenticated admin
261
+ // session; no permission beyond it, since a plugin view is gated by the
262
+ // plugin's own action): what `useEntitlement()` reads in a plugin's admin
263
+ // view. `valid` is the host's own check of the signature and the 14-day age
264
+ // (true for `exempt`, false for `none`), the answer a browser without
265
+ // WebCrypto Ed25519 falls back to. It means authentic and fresh, whatever
266
+ // the verdict's status: a revoked or invalid verdict is `valid: true` too,
267
+ // so `valid` is never an entitlement on its own.
268
+ export const EntitlementResponseSchema = z.object({
269
+ entitlement: EntitlementSchema,
270
+ valid: z.boolean(),
271
+ });
272
+ // The 403 a plugin API route answers when its handler throws the SDK's
273
+ // EntitlementError (`requireEntitlement` refused the verdict). `reason` is
274
+ // the SDK's EntitlementErrorCode.
275
+ export const EntitlementRefusalSchema = z.object({
276
+ code: z.literal("entitlement"),
277
+ reason: z.enum(["missing", "invalid-signature", "wrong-plugin", "not-valid", "expired"]),
278
+ message: z.string(),
279
+ });
280
+ // S154 Task 4: a plugin's structured-data snapshot GROUPS, derived from
281
+ // PluginStructuredSnapshot (GROUP BY snapshotGroupId) rather than tracked
282
+ // by their own table — see apps/server/src/plugins/snapshot-groups.ts for
283
+ // the derivation. takenAt is the group's earliest row's createdAt (every
284
+ // row in a group is written in one snapshotPluginTables() call, so in
285
+ // practice they're all within the same transaction-ish burst — min is a
286
+ // defensive, not load-bearing, choice). trigger rides along from Task 3's
287
+ // column ("uninstall", "restore", or null for pre-Task-3 rows). status
288
+ // compares the group's own tableNames against totalTableCount — the
289
+ // UNION of distinct tableNames across ALL of the plugin's snapshot rows,
290
+ // the only denominator that survives an uninstall (which deletes the
291
+ // PluginStructuredTable tracking rows, never the snapshots themselves).
292
+ export const SnapshotGroupSchema = z.object({
293
+ snapshotGroupId: z.string(),
294
+ takenAt: z.string(),
295
+ trigger: z.string().nullable(),
296
+ tableNames: z.array(z.string()),
297
+ totalTableCount: z.number().int(),
298
+ status: z.enum(["complete", "partial"]),
299
+ });
300
+ export const SnapshotGroupListQuerySchema = z.object({
301
+ cursor: z.string().uuid().optional(),
302
+ limit: z.coerce.number().int().min(1).max(100).default(50),
303
+ });
304
+ export const SnapshotGroupListResponseSchema = z.object({
305
+ pluginId: z.string(),
306
+ items: z.array(SnapshotGroupSchema), // newest first
307
+ nextCursor: z.string().nullable(),
308
+ });
309
+ // S154 Task 5: the UNION restore plan — the newest available snapshot copy
310
+ // of each DISTINCT table this plugin has ever snapshotted, chosen
311
+ // independently per table across every group (not "pick one group and use
312
+ // only its tables"). This is what makes restore recover from the S87
313
+ // retry wedge: no single group need be complete for a full restore to be
314
+ // possible, as long as every table appears in SOME group.
315
+ export const RestorePlanEntrySchema = z.object({
316
+ tableName: z.string(),
317
+ snapshotGroupId: z.string(),
318
+ groupTakenAt: z.string(),
319
+ });
320
+ // 409 payload for an unconfirmed restore — nothing has been touched yet,
321
+ // the plan is offered for the admin to review before confirming. planHash
322
+ // (S161, S154 rider) is a stable digest of this exact plan: the confirm
323
+ // request must echo it back, and the handler refuses to proceed if a fresh
324
+ // re-plan hashes differently (a snapshot landed between the operator
325
+ // seeing this plan and confirming it) — closing the requestRestorePlan ->
326
+ // confirmRestore TOCTOU. A mismatch response reuses this same schema, with
327
+ // a fresh plan/planHash and a message explaining the plan changed.
328
+ export const RestoreConfirmationRequiredSchema = z.object({
329
+ requiresConfirmation: z.literal(true),
330
+ plan: z.array(RestorePlanEntrySchema),
331
+ planHash: z.string(),
332
+ message: z.string(),
333
+ });
334
+ export const RestoreSucceededSchema = z.object({
335
+ // The pre-restore safety snapshot's group id — null only when the
336
+ // plugin had no live tracked tables to protect (restoring onto empty).
337
+ preRestoreSnapshotGroupId: z.string().nullable(),
338
+ restoredTables: z.array(z.string()),
339
+ });
340
+ // Same DELETE-body-null convention as UninstallPluginBodySchema above: an
341
+ // absent POST body lands as `null` (not `undefined`) once Fastify's
342
+ // validator substitutes for a genuinely missing payload, so `.nullish()`
343
+ // (not `.optional()`) is required for an absent body to validate at all.
344
+ // planHash (S161, S154 rider) is optional at the schema level only
345
+ // because the SAME body shape covers the unconfirmed call (`{}`, no plan
346
+ // to hash yet) — the route handler enforces it as effectively required
347
+ // whenever confirmRestore is true: a confirm with a missing or stale
348
+ // planHash is refused exactly the same way (409, fresh plan reissued).
349
+ export const RestoreBodySchema = z
350
+ .object({
351
+ confirmRestore: z.boolean().optional(),
352
+ planHash: z.string().optional(),
353
+ })
354
+ .nullish();
355
+ // The second install door (Task 4): POST /api/manage/v1/plugins/upload lands an
356
+ // admin-uploaded .zip through the same installPackageArchive spine the
357
+ // marketplace uses, but with no marketplace signature to check — trust is
358
+ // always the literal "unregistered" here, never the registry's own
359
+ // "verified" | "unverified" tier (ManagedPluginSchema.trustTier above).
360
+ // That tier answers "did a signature check pass"; `trust: "unregistered"`
361
+ // answers a different question this route always answers the same way:
362
+ // "this package carries no marketplace listing at all."
363
+ //
364
+ // `outcome` never mirrors RegisterLocalPluginResult's full union. A fresh
365
+ // upload reports "installed". Since S274c a newer version of an installed
366
+ // plugin updates it in place and reports "updated" (a verified plugin asks
367
+ // first, through the 409 TrustDowngradeConfirmationSchema). The same or an
368
+ // older version is refused with 409 before installPackageArchive runs, so
369
+ // "activated"/"already-active" (registerLocalPlugin's tolerant re-attach
370
+ // onto an existing row) are never the outcome of a successful upload, and
371
+ // an unsigned side-load can never silently replace a plugin at the same
372
+ // version.
373
+ export const PluginUploadResponseSchema = z.object({
374
+ pluginId: z.string(),
375
+ // S284 (D5): the plugin's display name from its manifest, the value its
376
+ // registry row stores as `name`, so the admin's toast names the plugin
377
+ // the way the plugins list does rather than by its id.
378
+ name: z.string(),
379
+ version: z.string(),
380
+ // S274c: a newer version of an installed plugin now updates it in place,
381
+ // so the outcome is "installed" or "updated" and `fromVersion` names the
382
+ // version an update replaced (null for a fresh install).
383
+ outcome: z.enum(["installed", "updated"]),
384
+ fromVersion: z.string().nullable(),
385
+ trust: z.literal("unregistered"),
386
+ // S277e: what the install did with the package's sample content. Absent
387
+ // for an update and for a package that ships none.
388
+ sampleContent: SampleContentOutcomeSchema.optional(),
389
+ // S293: what the install did with each offered role its answers named;
390
+ // absent when they named none.
391
+ roles: z.array(InstallRoleOutcomeSchema).optional(),
392
+ });
393
+ /** S274c: the upload's confirmation travels as a query flag because the
394
+ * route reads only the multipart file part. */
395
+ export const PluginUploadQuerySchema = z.object({
396
+ confirmTrustDowngrade: z.enum(["true", "false"]).optional(),
397
+ });
398
+ /** The 400 an upload answers when the package fails the listing contract
399
+ * (README, cover and docs pages): every violation, one entry each, and
400
+ * `message` as the same list on one line for a caller that shows one. */
401
+ export const PackageRefusedSchema = z.object({
402
+ message: z.string(),
403
+ reasons: z.array(z.string()),
404
+ });
405
+ /** S274c: the 409 an upload over a verified plugin answers before it stores
406
+ * anything, until the retry carries confirmTrustDowngrade=true. */
407
+ export const TrustDowngradeConfirmationSchema = z.object({
408
+ requiresConfirmation: z.literal(true),
409
+ reason: z.literal("trust-downgrade"),
410
+ /** The installed plugin's display name, so the client can name it in its own language. */
411
+ pluginName: z.string(),
412
+ message: z.string(),
413
+ });
@@ -0,0 +1,29 @@
1
+ /** The contribution kinds that sit behind a named action. The SDK classifies
2
+ * these on its CONTRIBUTION_RULES table; its test pins that table to this
3
+ * list, so the two cannot drift apart silently. */
4
+ export declare const ACTION_GATED_CONTRIBUTION_KEYS: readonly ["adminSections", "railEntries", "dashboardWidgets", "settingsPages", "contentTreeActions", "editorToolbar", "apiRoutes"];
5
+ /** S293 (S283's decision, 2026-10-13-s293-the-wizard-installed-design.md 3.9):
6
+ * the built-in rights an offered role may grant beside the plugin's own
7
+ * actions: the read right of each built-in section a rail entry may join
8
+ * (the SDK's BUILT_IN_RAIL_SECTIONS; its test pins the two together), so an
9
+ * accepted offer can open the section its plugin's screen sits in. A write
10
+ * right is never offerable. */
11
+ export declare const OFFERABLE_BUILT_IN_ACTIONS: readonly ["content.read", "media.read", "settings.read", "users.read"];
12
+ export interface ActionDeclarationIssue {
13
+ path: (string | number)[];
14
+ message: string;
15
+ }
16
+ export interface ActionDeclarationInput {
17
+ id: string;
18
+ actions?: ReadonlyArray<{
19
+ id: string;
20
+ label: string;
21
+ }>;
22
+ roles?: ReadonlyArray<{
23
+ id: string;
24
+ label: string;
25
+ actions: ReadonlyArray<string>;
26
+ }>;
27
+ contributions?: unknown;
28
+ }
29
+ export declare function checkActionDeclarations(manifest: ActionDeclarationInput): ActionDeclarationIssue[];
@@ -0,0 +1,100 @@
1
+ import { isPluginActionFor } from "./action.schema.js";
2
+ // S274b (spec D3): the one rule for what a plugin declares about actions,
3
+ // as plain data, so the SDK's manifest schema and the marketplace's
4
+ // submission gate run the same function. The rule is S273 section 3: every
5
+ // declared id in the plugin's namespace; the declared set equals the set the
6
+ // gated contributions reference (every gated kind, every entry, any route
7
+ // access); no two ids equal case-insensitively; each offer's actions a
8
+ // subset of the declared ids and OFFERABLE_BUILT_IN_ACTIONS; no two offers
9
+ // sharing an id.
10
+ /** The contribution kinds that sit behind a named action. The SDK classifies
11
+ * these on its CONTRIBUTION_RULES table; its test pins that table to this
12
+ * list, so the two cannot drift apart silently. */
13
+ export const ACTION_GATED_CONTRIBUTION_KEYS = ["adminSections", "railEntries", "dashboardWidgets", "settingsPages", "contentTreeActions", "editorToolbar", "apiRoutes"];
14
+ /** S293 (S283's decision, 2026-10-13-s293-the-wizard-installed-design.md 3.9):
15
+ * the built-in rights an offered role may grant beside the plugin's own
16
+ * actions: the read right of each built-in section a rail entry may join
17
+ * (the SDK's BUILT_IN_RAIL_SECTIONS; its test pins the two together), so an
18
+ * accepted offer can open the section its plugin's screen sits in. A write
19
+ * right is never offerable. */
20
+ export const OFFERABLE_BUILT_IN_ACTIONS = ["content.read", "media.read", "settings.read", "users.read"];
21
+ const OFFERABLE = new Set(OFFERABLE_BUILT_IN_ACTIONS);
22
+ const OFFERABLE_LIST = `${OFFERABLE_BUILT_IN_ACTIONS.slice(0, -1).map((action) => `"${action}"`).join(", ")} or "${OFFERABLE_BUILT_IN_ACTIONS[OFFERABLE_BUILT_IN_ACTIONS.length - 1]}"`;
23
+ function referencedActions(contributions) {
24
+ const referenced = new Set();
25
+ if (!contributions || typeof contributions !== "object")
26
+ return referenced;
27
+ const record = contributions;
28
+ for (const key of ACTION_GATED_CONTRIBUTION_KEYS) {
29
+ const entries = record[key];
30
+ if (!Array.isArray(entries))
31
+ continue;
32
+ for (const entry of entries) {
33
+ const action = entry?.action;
34
+ if (typeof action === "string")
35
+ referenced.add(action);
36
+ // S280: a section's own rail entries each name an action too. They
37
+ // are not a contribution key of their own, so they are read here,
38
+ // beside the section that carries them.
39
+ const rail = entry?.rail;
40
+ if (!Array.isArray(rail))
41
+ continue;
42
+ for (const railEntry of rail) {
43
+ const railAction = railEntry?.action;
44
+ if (typeof railAction === "string")
45
+ referenced.add(railAction);
46
+ }
47
+ }
48
+ }
49
+ return referenced;
50
+ }
51
+ export function checkActionDeclarations(manifest) {
52
+ const issues = [];
53
+ const referenced = referencedActions(manifest.contributions);
54
+ const declared = manifest.actions ?? [];
55
+ const declaredIds = new Set(declared.map((entry) => entry.id));
56
+ const seenExact = new Set();
57
+ const seenLower = new Map();
58
+ declared.forEach((entry, index) => {
59
+ const path = ["actions", index, "id"];
60
+ if (!isPluginActionFor(entry.id, manifest.id)) {
61
+ issues.push({ path, message: `declared action "${entry.id}" must be prefixed with this plugin's id "${manifest.id}."` });
62
+ }
63
+ if (!referenced.has(entry.id)) {
64
+ issues.push({ path, message: `declared action "${entry.id}" is not named by any contribution; a permission with no surface would be granted for nothing` });
65
+ }
66
+ if (seenExact.has(entry.id)) {
67
+ issues.push({ path, message: `declared action "${entry.id}" is declared more than once` });
68
+ }
69
+ else {
70
+ const earlier = seenLower.get(entry.id.toLowerCase());
71
+ if (earlier !== undefined) {
72
+ issues.push({ path, message: `declared actions "${earlier}" and "${entry.id}" differ only in case; MySQL's default collation would collide them in the primary key` });
73
+ }
74
+ seenExact.add(entry.id);
75
+ if (!seenLower.has(entry.id.toLowerCase()))
76
+ seenLower.set(entry.id.toLowerCase(), entry.id);
77
+ }
78
+ });
79
+ for (const action of referenced) {
80
+ if (!declaredIds.has(action)) {
81
+ issues.push({ path: ["actions"], message: `action "${action}" is named by a contribution but not declared in "actions"; declare it with a label so the install screen can show it` });
82
+ }
83
+ }
84
+ const offerIds = new Set();
85
+ (manifest.roles ?? []).forEach((offer, index) => {
86
+ if (offerIds.has(offer.id)) {
87
+ issues.push({ path: ["roles", index, "id"], message: `role offer "${offer.id}" is declared more than once` });
88
+ }
89
+ offerIds.add(offer.id);
90
+ offer.actions.forEach((action, actionIndex) => {
91
+ if (!declaredIds.has(action) && !OFFERABLE.has(action)) {
92
+ issues.push({
93
+ path: ["roles", index, "actions", actionIndex],
94
+ message: `role offer "${offer.id}" grants "${action}", which this plugin does not declare; beside its own actions an offer may grant only ${OFFERABLE_LIST}`,
95
+ });
96
+ }
97
+ });
98
+ });
99
+ return issues;
100
+ }
@@ -0,0 +1,44 @@
1
+ /** The methods an apiRoute may declare: the one list the SDK's manifest schema
2
+ * enforces (and the manual's enum test reads, through the SDK's re-export)
3
+ * and the only methods this rule compares. */
4
+ export declare const API_ROUTE_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
5
+ /** S297: a route's `schema.response` declares success statuses only, "200" to "299", at most this many. */
6
+ export declare const API_ROUTE_RESPONSE_STATUSES_MAX = 4;
7
+ /** True for a success status code written canonically as a string: "200" to "299". Linear, no pattern. */
8
+ export declare function isApiRouteResponseStatus(key: string): boolean;
9
+ /** The longest declared path, checked before the path is split. */
10
+ export declare const API_ROUTE_PATH_MAX = 200;
11
+ /** The most apiRoutes one manifest declares, which bounds the pairwise check. */
12
+ export declare const API_ROUTES_MAX = 200;
13
+ export interface ApiRouteDeclarationIssue {
14
+ path: (string | number)[];
15
+ message: string;
16
+ }
17
+ /** Why `path` cannot be a declared apiRoute path, or null when it can be. */
18
+ export declare function apiRoutePathProblem(path: string): string | null;
19
+ /** A manifest's apiRoutes, checked as the router will read them, with every
20
+ * issue rooted at the manifest: each path by apiRoutePathProblem; then, among
21
+ * the declarations whose path passed, a GET or PUT the host's storage route
22
+ * answers first, and the first earlier declaration of the same method that
23
+ * the router reads as the same route (a duplicate, reported in preference)
24
+ * or that one request can match too (ambiguous). An entry whose method is
25
+ * not one of API_ROUTE_METHODS, or whose path is not a string, is the
26
+ * schema's to report and is skipped here: the marketplace door runs this on
27
+ * a manifest.json its own schema leaves unvalidated, and a method that is
28
+ * any string must cost no comparison and appear in no message. */
29
+ export declare function checkApiRouteDeclarations(manifest: {
30
+ contributions?: unknown;
31
+ }): ApiRouteDeclarationIssue[];
32
+ /** S299 (2026-10-15-s299-tokens-that-carry-actions-design.md D15): every apiRoute
33
+ * that needs a credential names the action its caller must hold: a session's
34
+ * role on the admin tier (the default, and the tier of any value this code does
35
+ * not recognise, as effectiveAccess reads it) and an API key on the "apiKey"
36
+ * tier. Only a "public" route, which needs no credential, may omit it. One
37
+ * function, so the SDK's manifest schema (and through it install, upload, the
38
+ * boot loader and `kardalum plugin validate`) and the marketplace door cannot
39
+ * disagree. An entry that is not an object is the schema's to report and is
40
+ * skipped; the pairwise comparison checkApiRouteDeclarations runs is not
41
+ * needed, so a manifest past API_ROUTES_MAX is that function's to report. */
42
+ export declare function checkApiRouteActions(manifest: {
43
+ contributions?: unknown;
44
+ }): ApiRouteDeclarationIssue[];