@kardalum/plugin-sdk 0.18.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 (435) hide show
  1. package/CHANGELOG.md +253 -0
  2. package/README.md +20 -1
  3. package/dist/admin-section-registry.d.ts +16 -1
  4. package/dist/admin-section-registry.js +23 -0
  5. package/dist/assets/asset-picker.js +3 -3
  6. package/dist/built-in-editor-ids.d.ts +1 -1
  7. package/dist/built-in-editor-ids.js +2 -20
  8. package/dist/built-in-serializers.js +1 -1
  9. package/dist/built-in-settings-schemas.d.ts +10 -0
  10. package/dist/built-in-settings-schemas.js +90 -4
  11. package/dist/built-in-value-schemas.js +35 -0
  12. package/dist/built-ins.js +48 -17
  13. package/dist/capabilities.d.ts +11 -1
  14. package/dist/capabilities.js +55 -3
  15. package/dist/cli.d.ts +66 -0
  16. package/dist/cli.js +22 -0
  17. package/dist/content-library.d.ts +85 -0
  18. package/dist/content-library.js +15 -0
  19. package/dist/content-picker/page-picker-sheet.d.ts +13 -0
  20. package/dist/content-picker/page-picker-sheet.js +105 -0
  21. package/dist/content-picker/page-tree.d.ts +25 -0
  22. package/dist/content-picker/page-tree.js +132 -0
  23. package/dist/data-type-plugin.d.ts +9 -3
  24. package/dist/datatype-validation.d.ts +6 -11
  25. package/dist/datatype-validation.js +141 -3
  26. package/dist/define-plugin.d.ts +4 -4
  27. package/dist/define-plugin.js +5 -5
  28. package/dist/entitlement-entry.d.ts +1 -1
  29. package/dist/entitlement-entry.js +1 -1
  30. package/dist/entitlement-gate.d.ts +14 -0
  31. package/dist/entitlement-gate.js +64 -7
  32. package/dist/entitlement-plan.d.ts +6 -0
  33. package/dist/entitlement-plan.js +10 -0
  34. package/dist/entitlement-types.d.ts +36 -12
  35. package/dist/entitlement.d.ts +31 -4
  36. package/dist/entitlement.js +58 -17
  37. package/dist/hook-entry.d.ts +5 -0
  38. package/dist/hook-entry.js +30 -0
  39. package/dist/host-entry.d.ts +1 -1
  40. package/dist/host-entry.js +1 -1
  41. package/dist/index.d.ts +38 -4
  42. package/dist/index.js +54 -3
  43. package/dist/mail.d.ts +30 -0
  44. package/dist/mail.js +1 -0
  45. package/dist/manifest-entry.d.ts +29 -4
  46. package/dist/manifest-entry.js +39 -2
  47. package/dist/manifest-schema.d.ts +443 -29
  48. package/dist/manifest-schema.js +292 -24
  49. package/dist/manifest.d.ts +450 -51
  50. package/dist/manifest.js +1 -1
  51. package/dist/media/media-picker.js +33 -20
  52. package/dist/media/upload-error.d.ts +5 -1
  53. package/dist/media/upload-error.js +14 -2
  54. package/dist/media-library.d.ts +32 -0
  55. package/dist/media-library.js +15 -0
  56. package/dist/nested-field-host.d.ts +76 -0
  57. package/dist/nested-field-host.js +90 -0
  58. package/dist/notify.d.ts +12 -4
  59. package/dist/notify.js +1 -1
  60. package/dist/outbound.d.ts +47 -0
  61. package/dist/outbound.js +1 -0
  62. package/dist/plugin-context.d.ts +5 -0
  63. package/dist/plugin-context.js +3 -3
  64. package/dist/plugin-screen-context.d.ts +112 -0
  65. package/dist/plugin-screen-context.js +26 -0
  66. package/dist/providers.d.ts +268 -0
  67. package/dist/providers.js +74 -0
  68. package/dist/read-all-pages.d.ts +5 -0
  69. package/dist/read-all-pages.js +3 -2
  70. package/dist/register-built-ins.js +6 -6
  71. package/dist/registry.js +1 -1
  72. package/dist/richtext/block-panel.js +12 -7
  73. package/dist/richtext/extensions.js +7 -7
  74. package/dist/richtext/insert-menu.js +12 -9
  75. package/dist/richtext/style-listbox.js +7 -5
  76. package/dist/richtext/text-style-class.js +1 -1
  77. package/dist/sdk-strings.d.ts +285 -0
  78. package/dist/sdk-strings.js +347 -0
  79. package/dist/sealing.d.ts +14 -0
  80. package/dist/sealing.js +1 -0
  81. package/dist/simple-storage-value-provider.js +27 -27
  82. package/dist/structured-storage-types.d.ts +309 -9
  83. package/dist/structured-storage-types.js +2 -2
  84. package/dist/text-entry.d.ts +1 -0
  85. package/dist/text-entry.js +6 -0
  86. package/dist/tokens/tailwind-theme.css +5 -0
  87. package/dist/tokens/tokens.css +15 -3
  88. package/dist/tokens/tokens.json +8 -3
  89. package/dist/ui-entry.js +3 -3
  90. package/dist/views/asset-view.js +6 -3
  91. package/dist/views/content-list-preview.js +3 -1
  92. package/dist/views/content-list-settings-view.js +11 -7
  93. package/dist/views/content-list-view.d.ts +5 -3
  94. package/dist/views/content-list-view.js +38 -34
  95. package/dist/views/content-picker-view.d.ts +3 -0
  96. package/dist/views/content-picker-view.js +143 -0
  97. package/dist/views/crop-view.d.ts +4 -6
  98. package/dist/views/crop-view.js +22 -13
  99. package/dist/views/date-range-view.js +9 -6
  100. package/dist/views/file-upload-view.d.ts +5 -7
  101. package/dist/views/file-upload-view.js +16 -7
  102. package/dist/views/group-view.d.ts +8 -0
  103. package/dist/views/group-view.js +123 -0
  104. package/dist/views/html-code-editor.js +2 -2
  105. package/dist/views/html-view.js +12 -11
  106. package/dist/views/image-view.js +40 -22
  107. package/dist/views/link-view.d.ts +3 -0
  108. package/dist/views/link-view.js +150 -0
  109. package/dist/views/options-list-view.d.ts +3 -0
  110. package/dist/views/options-list-view.js +104 -0
  111. package/dist/views/repeatable-list-view.d.ts +3 -0
  112. package/dist/views/repeatable-list-view.js +113 -0
  113. package/dist/views/rich-text-view.js +32 -16
  114. package/dist/views/suggest-key.d.ts +17 -0
  115. package/dist/views/suggest-key.js +55 -0
  116. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
  117. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
  118. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  119. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  120. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  122. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  123. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +1 -1
  124. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
  125. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  126. package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
  127. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
  128. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
  129. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  130. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
  131. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +116 -3
  132. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +71 -18
  133. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
  134. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
  135. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  136. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  137. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  138. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  139. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  140. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  141. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
  142. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
  143. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  144. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  145. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  146. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  147. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  148. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  149. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
  150. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
  151. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  152. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +9 -1
  153. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +4 -4
  154. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  155. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  156. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +267 -12
  157. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +54 -8
  158. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  159. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +98 -13
  160. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  161. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  162. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  163. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  164. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  165. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  166. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +122 -43
  167. package/node_modules/@kardalum/api-schemas/dist/index.js +92 -27
  168. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  169. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  170. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  171. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  172. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  173. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  174. package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
  175. package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
  176. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
  177. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
  178. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  179. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  180. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  181. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  182. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +359 -8
  183. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +85 -11
  184. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  185. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  186. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  187. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  188. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  189. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  190. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  191. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  192. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  193. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  194. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  195. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  196. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  197. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  198. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
  199. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +22 -10
  200. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  201. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  202. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  203. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  204. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  205. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
  206. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +9 -5
  207. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  208. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  209. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
  210. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
  211. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  212. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  213. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  214. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  215. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  216. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  217. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  218. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  219. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  220. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  221. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  223. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  226. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  227. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  228. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  229. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  230. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
  231. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
  232. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  233. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  234. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
  235. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
  236. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
  237. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
  238. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  239. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  240. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
  241. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
  242. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
  243. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
  244. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  245. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  246. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  247. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  248. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
  249. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
  250. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  251. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  252. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  253. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  254. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
  255. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
  256. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
  257. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
  258. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  259. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  260. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  261. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  262. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +357 -4
  263. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +279 -0
  264. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
  265. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
  266. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  267. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  268. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
  269. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
  270. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  271. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  272. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  273. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  274. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  275. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  276. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
  277. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
  278. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  279. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  280. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
  281. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  282. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  283. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  284. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  285. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
  286. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
  287. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
  288. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
  289. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  290. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +50 -7
  291. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  292. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  293. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  294. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  295. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  296. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  297. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  298. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  299. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  300. package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
  301. package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
  302. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  303. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
  304. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
  305. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  306. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
  307. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  308. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  309. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  310. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  311. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
  312. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +289 -0
  313. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +205 -0
  314. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +121 -0
  315. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +51 -10
  316. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
  317. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
  318. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  319. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  320. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
  321. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  322. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  323. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
  324. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
  325. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +1 -1
  326. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  327. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  328. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
  329. package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
  330. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  331. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  332. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  333. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  334. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
  335. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +35 -4
  336. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  337. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  338. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  339. package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
  340. package/node_modules/@kardalum/design-tokens/dist/build-css.js +8 -2
  341. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
  342. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  343. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
  344. package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
  345. package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
  346. package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
  347. package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
  348. package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
  349. package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
  350. package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
  351. package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
  352. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +4 -4
  353. package/node_modules/@kardalum/design-tokens/dist/tokens.js +17 -8
  354. package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
  355. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -2
  356. package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
  357. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
  358. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
  359. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  360. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
  361. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  362. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
  363. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  364. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  365. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  366. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  367. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  368. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  369. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  370. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
  371. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  372. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  373. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
  374. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  375. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  376. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
  377. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
  378. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
  379. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  380. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
  381. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  382. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  383. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  384. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
  385. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
  386. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +27 -5
  387. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  388. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  389. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
  390. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  391. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
  392. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  393. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  394. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
  395. package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
  396. package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
  397. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
  398. package/node_modules/@kardalum/plugin-package/dist/extract.js +9 -9
  399. package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
  400. package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
  401. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  402. package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
  403. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  404. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  405. package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
  406. package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
  407. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
  408. package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
  409. package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
  410. package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
  411. package/node_modules/@kardalum/ui/dist/components/button.js +1 -1
  412. package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
  413. package/node_modules/@kardalum/ui/dist/components/dialog.js +49 -4
  414. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
  415. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +18 -5
  416. package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
  417. package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
  418. package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
  419. package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
  420. package/node_modules/@kardalum/ui/dist/components/sheet.js +12 -7
  421. package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
  422. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  423. package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
  424. package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
  425. package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
  426. package/node_modules/@kardalum/ui/dist/components/tooltip.js +81 -0
  427. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +16 -0
  428. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +95 -0
  429. package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
  430. package/node_modules/@kardalum/ui/dist/index.d.ts +3 -1
  431. package/node_modules/@kardalum/ui/dist/index.js +3 -1
  432. package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
  433. package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
  434. package/node_modules/@kardalum/ui/package.json +8 -6
  435. package/package.json +18 -7
@@ -1,10 +1,10 @@
1
1
  // Settings schemas for built-in editors that have real, validated settings
2
- // (Session 69) — keyed by the SAME id built-ins.tsx registers under
2
+ // (Session 69), keyed by the SAME id built-ins.tsx registers under
3
3
  // (com.kardalum.<name>). Editors with no entry here have no server-side
4
4
  // settings validation: either they have no settings at all (empty
5
5
  // settingsSchema, e.g. number/boolean/date), or they're a third-party/
6
6
  // remote plugin the server has no way to load code for (Module Federation
7
- // remotes only ever run in the browser — see manifest-entry.ts). This is a
7
+ // remotes only ever run in the browser, see manifest-entry.ts). This is a
8
8
  // deliberate, documented scope boundary, not an oversight.
9
9
  //
10
10
  // Zero React import: this file (and the @kardalum/plugin-sdk/datatypes
@@ -17,7 +17,7 @@ export const TEXT_SETTINGS_SCHEMA = {
17
17
  },
18
18
  additionalProperties: false,
19
19
  };
20
- // Deliberately {} — resolve-data-type.ts falls back to editor.defaultSettings
20
+ // Deliberately {}: resolve-data-type.ts falls back to editor.defaultSettings
21
21
  // for any config with empty settings (all six seeded built-ins today), so a
22
22
  // non-empty default here would silently change every existing Text field's
23
23
  // behavior the moment this ships.
@@ -72,7 +72,7 @@ export const IMAGE_SETTINGS_SCHEMA = {
72
72
  };
73
73
  export const IMAGE_DEFAULT_SETTINGS = {};
74
74
  // S197 Task 8 (spec §7, D7): the raw-HTML datatype's one setting is an
75
- // honest trust boundary, not a UX preference — default OFF, and the
75
+ // honest trust boundary, not a UX preference. It is default OFF, and the
76
76
  // input view's settings screen states the trade-off inline (verbatim
77
77
  // copy lives in html-view.tsx's HtmlSettingsView, not duplicated here).
78
78
  export const HTML_SETTINGS_SCHEMA = {
@@ -234,6 +234,87 @@ export const ASSET_SETTINGS_SCHEMA = {
234
234
  };
235
235
  // The settings migration 0033 seeds (ASSET_DATA_TYPE_CONFIG in @kardalum/api-schemas).
236
236
  export const ASSET_DEFAULT_SETTINGS = { accepts: "images", startFolder: null };
237
+ // M32 C: hand-kept mirror of ContentPickerSettingsSchema, input mode.
238
+ const UUID_PATTERN = "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$";
239
+ export const CONTENT_PICKER_SETTINGS_SCHEMA = {
240
+ type: "object",
241
+ properties: {
242
+ startNode: { anyOf: [{ type: "string", format: "uuid", pattern: UUID_PATTERN }, { type: "null" }] },
243
+ documentTypes: { maxItems: 500, type: "array", items: { type: "string", format: "uuid", pattern: UUID_PATTERN } },
244
+ multiple: { default: false, type: "boolean" },
245
+ max: { default: null, anyOf: [{ type: "integer", minimum: 1, maximum: 50 }, { type: "null" }] },
246
+ },
247
+ additionalProperties: false,
248
+ };
249
+ export const CONTENT_PICKER_DEFAULT_SETTINGS = { startNode: null, documentTypes: [], multiple: false, max: null };
250
+ // M32 C: hand-kept mirror of OptionsListSettingsSchema, input mode. It cannot say "distinct values";
251
+ // the server checks that with the Zod schema after ajv.
252
+ export const OPTIONS_SETTINGS_SCHEMA = {
253
+ type: "object",
254
+ properties: {
255
+ options: {
256
+ minItems: 1,
257
+ maxItems: 200,
258
+ type: "array",
259
+ items: {
260
+ type: "object",
261
+ properties: {
262
+ label: { type: "string", minLength: 1, maxLength: 200 },
263
+ value: { type: "string", minLength: 1, maxLength: 200 },
264
+ },
265
+ required: ["label", "value"],
266
+ additionalProperties: false,
267
+ },
268
+ },
269
+ multiple: { default: false, type: "boolean" },
270
+ },
271
+ required: ["options"],
272
+ additionalProperties: false,
273
+ };
274
+ // The editor's empty start; a save asks for one option ("Add at least one option.").
275
+ export const OPTIONS_DEFAULT_SETTINGS = { options: [], multiple: false };
276
+ // M32 C: hand-kept mirror of LinkSettingsSchema, input mode.
277
+ export const LINK_SETTINGS_SCHEMA = {
278
+ type: "object",
279
+ properties: { allow: { default: "both", type: "string", enum: ["internal", "external", "both"] } },
280
+ additionalProperties: false,
281
+ };
282
+ export const LINK_DEFAULT_SETTINGS = { allow: "both" };
283
+ // M32 D: hand-kept mirrors of GroupSettingsSchema and RepeatableListSettingsSchema, input mode.
284
+ // They cannot say "distinct aliases" or "min not above max"; the server checks those with the Zod
285
+ // schemas before ajv.
286
+ export const GROUP_SETTINGS_SCHEMA = {
287
+ type: "object",
288
+ properties: {
289
+ fields: {
290
+ maxItems: 20,
291
+ type: "array",
292
+ items: {
293
+ type: "object",
294
+ properties: {
295
+ alias: { type: "string", maxLength: 64, pattern: "^[a-zA-Z][a-zA-Z0-9_]*$" },
296
+ name: { type: "string", minLength: 1, maxLength: 200 },
297
+ dataTypeId: { type: "string", format: "uuid", pattern: UUID_PATTERN },
298
+ required: { default: false, type: "boolean" },
299
+ },
300
+ required: ["alias", "name", "dataTypeId"],
301
+ additionalProperties: false,
302
+ },
303
+ },
304
+ },
305
+ additionalProperties: false,
306
+ };
307
+ export const GROUP_DEFAULT_SETTINGS = { fields: [] };
308
+ export const REPEATABLE_LIST_SETTINGS_SCHEMA = {
309
+ type: "object",
310
+ properties: {
311
+ itemDataTypeId: { anyOf: [{ type: "string", format: "uuid", pattern: UUID_PATTERN }, { type: "null" }] },
312
+ min: { default: null, anyOf: [{ type: "integer", minimum: 0, maximum: 100 }, { type: "null" }] },
313
+ max: { default: null, anyOf: [{ type: "integer", minimum: 1, maximum: 100 }, { type: "null" }] },
314
+ },
315
+ additionalProperties: false,
316
+ };
317
+ export const REPEATABLE_LIST_DEFAULT_SETTINGS = { itemDataTypeId: null, min: null, max: null };
237
318
  // com.kardalum.contentlist is the first entry whose schema has a REQUIRED
238
319
  // member (`columns`), so unlike the three above it cannot fall back to the
239
320
  // "stored settings are {} until a webmaster edits them" convention: its
@@ -249,4 +330,9 @@ export const BUILT_IN_SETTINGS_SCHEMAS = {
249
330
  "com.kardalum.crop": CROP_SETTINGS_SCHEMA,
250
331
  "com.kardalum.thumbnail": THUMBNAIL_SETTINGS_SCHEMA,
251
332
  "com.kardalum.asset": ASSET_SETTINGS_SCHEMA,
333
+ "com.kardalum.contentpicker": CONTENT_PICKER_SETTINGS_SCHEMA,
334
+ "com.kardalum.options": OPTIONS_SETTINGS_SCHEMA,
335
+ "com.kardalum.link": LINK_SETTINGS_SCHEMA,
336
+ "com.kardalum.group": GROUP_SETTINGS_SCHEMA,
337
+ "com.kardalum.list": REPEATABLE_LIST_SETTINGS_SCHEMA,
252
338
  };
@@ -47,4 +47,39 @@ export const BUILT_IN_VALUE_SCHEMAS = {
47
47
  // S314p (D3). A path under public/, as Settings, Assets names the file; the address a template
48
48
  // prints is worked out at render.
49
49
  "com.kardalum.asset": { type: "string" },
50
+ // M32 C (D2, D10): one page id, or a list of distinct page ids (at most 50); null when empty.
51
+ "com.kardalum.contentpicker": {
52
+ anyOf: [
53
+ { type: "string", format: "uuid" },
54
+ { type: "array", items: { type: "string", format: "uuid" }, maxItems: 50, uniqueItems: true },
55
+ { type: "null" },
56
+ ],
57
+ },
58
+ // M32 C (D3): one option's value, or a list of distinct values; null when empty.
59
+ "com.kardalum.options": {
60
+ anyOf: [{ type: "string" }, { type: "array", items: { type: "string" }, uniqueItems: true }, { type: "null" }],
61
+ },
62
+ // M32 C (D4): a page on this site or an outside address, with a label and a new-tab flag.
63
+ "com.kardalum.link": {
64
+ anyOf: [
65
+ {
66
+ type: "object",
67
+ properties: { page: { type: "string", format: "uuid" }, label: { type: "string", maxLength: 200 }, newTab: { type: "boolean" } },
68
+ required: ["page"],
69
+ additionalProperties: false,
70
+ },
71
+ {
72
+ type: "object",
73
+ properties: { url: { type: "string", maxLength: 2048 }, label: { type: "string", maxLength: 200 }, newTab: { type: "boolean" } },
74
+ required: ["url"],
75
+ additionalProperties: false,
76
+ },
77
+ { type: "null" },
78
+ ],
79
+ },
80
+ // M32 D (D1): a Group stores an object keyed by its sub-fields' aliases; a Repeatable list an array
81
+ // of at most 100 items. The per-field schema built from the data type tree replaces these on the
82
+ // delivery API.
83
+ "com.kardalum.group": { anyOf: [{ type: "object" }, { type: "null" }] },
84
+ "com.kardalum.list": { anyOf: [{ type: "array", maxItems: 100 }, { type: "null" }] },
50
85
  };
package/dist/built-ins.js CHANGED
@@ -1,14 +1,20 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CONTENT_LIST_DEFAULT_SETTINGS } from "@kardalum/api-schemas";
3
3
  import { Checkbox, Input, PropertyField, usePropertyFieldControl } from "@kardalum/ui";
4
- import { ASSET_DEFAULT_SETTINGS, ASSET_SETTINGS_SCHEMA, CONTENT_LIST_SETTINGS_SCHEMA, CROP_DEFAULT_SETTINGS, CROP_SETTINGS_SCHEMA, FILE_UPLOAD_SETTINGS_SCHEMA, HTML_DEFAULT_SETTINGS, HTML_SETTINGS_SCHEMA, IMAGE_DEFAULT_SETTINGS, IMAGE_SETTINGS_SCHEMA, TEXT_DEFAULT_SETTINGS, TEXT_SETTINGS_SCHEMA, THUMBNAIL_DEFAULT_SETTINGS, THUMBNAIL_SETTINGS_SCHEMA, } from "./built-in-settings-schemas.js";
4
+ import { ASSET_DEFAULT_SETTINGS, ASSET_SETTINGS_SCHEMA, CONTENT_LIST_SETTINGS_SCHEMA, CONTENT_PICKER_DEFAULT_SETTINGS, CONTENT_PICKER_SETTINGS_SCHEMA, CROP_DEFAULT_SETTINGS, CROP_SETTINGS_SCHEMA, FILE_UPLOAD_SETTINGS_SCHEMA, HTML_DEFAULT_SETTINGS, HTML_SETTINGS_SCHEMA, IMAGE_DEFAULT_SETTINGS, IMAGE_SETTINGS_SCHEMA, LINK_DEFAULT_SETTINGS, LINK_SETTINGS_SCHEMA, OPTIONS_DEFAULT_SETTINGS, OPTIONS_SETTINGS_SCHEMA, GROUP_DEFAULT_SETTINGS, GROUP_SETTINGS_SCHEMA, REPEATABLE_LIST_DEFAULT_SETTINGS, REPEATABLE_LIST_SETTINGS_SCHEMA, TEXT_DEFAULT_SETTINGS, TEXT_SETTINGS_SCHEMA, THUMBNAIL_DEFAULT_SETTINGS, THUMBNAIL_SETTINGS_SCHEMA, } from "./built-in-settings-schemas.js";
5
5
  import { BUILT_IN_VALUE_SCHEMAS } from "./built-in-value-schemas.js";
6
6
  import { BUILT_IN_SERIALIZERS, identitySerializer } from "./built-in-serializers.js";
7
7
  import { BUILT_IN_DATATYPE_VALIDATORS } from "./datatype-validation.js";
8
8
  import { definePlugin } from "./define-plugin.js";
9
9
  import { usePluginSettings, usePluginSettingsValue, usePluginValue } from "./plugin-context.js";
10
10
  import { registerDataType } from "./registry.js";
11
+ import { useSdkString } from "./sdk-strings.js";
11
12
  import { AssetInputView, AssetReadOnlyView, AssetSettingsView } from "./views/asset-view.js";
13
+ import { ContentPickerInputView, ContentPickerReadOnlyView, ContentPickerSettingsView } from "./views/content-picker-view.js";
14
+ import { GroupInputView, GroupReadOnlyView, GroupSettingsView } from "./views/group-view.js";
15
+ import { RepeatableListInputView, RepeatableListReadOnlyView, RepeatableListSettingsView } from "./views/repeatable-list-view.js";
16
+ import { LinkInputView, LinkReadOnlyView, LinkSettingsView } from "./views/link-view.js";
17
+ import { OptionsListInputView, OptionsListReadOnlyView, OptionsListSettingsView } from "./views/options-list-view.js";
12
18
  import { ContentListPreview } from "./views/content-list-preview.js";
13
19
  import { ContentListSettingsView } from "./views/content-list-settings-view.js";
14
20
  import { ContentListInputView, ContentListReadOnlyView } from "./views/content-list-view.js";
@@ -29,14 +35,14 @@ function NotImplementedView() {
29
35
  // Every built-in input view spreads usePropertyFieldControl(): the host
30
36
  // renders these inside a PropertyField whose <label> has no child element
31
37
  // to point at (the view is a component, not a DOM node), so without this
32
- // the control has no accessible name at all — WCAG 4.1.2, and exactly
38
+ // the control has no accessible name at all (WCAG 4.1.2), and exactly
33
39
  // what axe reports as `label` / `aria-input-field-name`.
34
40
  function TextInputView() {
35
41
  const { value, onChange } = usePluginValue();
36
42
  const settings = usePluginSettings();
37
43
  const field = usePropertyFieldControl();
38
44
  return (_jsx(Input, { ...field, value: value ?? "", placeholder: settings.placeholder,
39
- // Hard limit: the browser physically blocks keystrokes past this —
45
+ // Hard limit: the browser physically blocks keystrokes past this,
40
46
  // a different, config-level concept from FieldValidation.maxLength
41
47
  // (field-row.tsx), which is a soft, validated-on-blur field rule.
42
48
  maxLength: settings.maxLength, onChange: (e) => onChange(e.target.value) }));
@@ -45,16 +51,15 @@ function TextReadOnlyView() {
45
51
  const { value } = usePluginValue();
46
52
  return _jsx("p", { children: value ?? "" });
47
53
  }
48
- // Rendered by the Data Types editor only (data-type-editor.tsx) — a
54
+ // Rendered by the Data Types editor only (data-type-editor.tsx), a
49
55
  // settings-EDITING view, so it uses usePluginSettingsValue() (write path),
50
56
  // not usePluginSettings() (read-only, used by the input/readOnly views
51
- // above). Hardcoded English strings: this file has no access to
52
- // admin-ui's react-i18next instance: plugin-sdk views' i18n is a known,
53
- // deliberately deferred piece of SDK scope, not yet implemented,
54
- // matching ImageInputView's existing "Remove"/"Loading…" precedent.
57
+ // above). Its words come from useSdkString() (S366f D11), the host's
58
+ // language inside the admin and English anywhere else.
55
59
  function TextSettingsView() {
56
60
  const { value: settings, onChange } = usePluginSettingsValue();
57
- return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: "Placeholder text", htmlFor: "text-settings-placeholder", children: _jsx(Input, { id: "text-settings-placeholder", value: settings.placeholder ?? "", onChange: (e) => onChange({ ...settings, placeholder: e.target.value || undefined }) }) }), _jsx(PropertyField, { label: "Max length", htmlFor: "text-settings-max-length", helpText: "Blocks typing past this many characters. Leave blank for no limit.", children: _jsx(Input, { id: "text-settings-max-length", type: "number", min: 1, value: settings.maxLength ?? "", onChange: (e) => onChange({ ...settings, maxLength: e.target.value === "" ? undefined : Number(e.target.value) }) }) })] }));
61
+ const s = useSdkString();
62
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(PropertyField, { label: s("text.placeholderLabel"), htmlFor: "text-settings-placeholder", children: _jsx(Input, { id: "text-settings-placeholder", value: settings.placeholder ?? "", onChange: (e) => onChange({ ...settings, placeholder: e.target.value || undefined }) }) }), _jsx(PropertyField, { label: s("text.maxLengthLabel"), htmlFor: "text-settings-max-length", helpText: s("text.maxLengthHelp"), children: _jsx(Input, { id: "text-settings-max-length", type: "number", min: 1, value: settings.maxLength ?? "", onChange: (e) => onChange({ ...settings, maxLength: e.target.value === "" ? undefined : Number(e.target.value) }) }) })] }));
58
63
  }
59
64
  function NumberInputView() {
60
65
  const { value, onChange } = usePluginValue();
@@ -72,7 +77,8 @@ function BooleanInputView() {
72
77
  }
73
78
  function BooleanReadOnlyView() {
74
79
  const { value } = usePluginValue();
75
- return _jsx("p", { children: value ? "Yes" : "No" });
80
+ const s = useSdkString();
81
+ return _jsx("p", { children: value ? s("boolean.yes") : s("boolean.no") });
76
82
  }
77
83
  function DateInputView() {
78
84
  const { value, onChange } = usePluginValue();
@@ -91,7 +97,7 @@ const NOT_IMPLEMENTED_VIEWS = {
91
97
  const NO_SETTINGS = { type: "object", properties: {} };
92
98
  function builtIn(id, name, icon, schema, views = NOT_IMPLEMENTED_VIEWS, options = {}) {
93
99
  // Through definePlugin (Session 61) so built-ins take the exact
94
- // validation path external plugins do — a regression in any built-in
100
+ // validation path external plugins do, so a regression in any built-in
95
101
  // definition fails loudly at module load, not silently at render.
96
102
  return definePlugin({
97
103
  id: `com.kardalum.${id}`,
@@ -111,12 +117,12 @@ function builtIn(id, name, icon, schema, views = NOT_IMPLEMENTED_VIEWS, options
111
117
  isEmpty: BUILT_IN_DATATYPE_VALIDATORS[`com.kardalum.${id}`]?.isEmpty,
112
118
  });
113
119
  }
114
- // Real views (Session 35) — settings stays NotImplementedView for four
120
+ // Real views (Session 35): settings stays NotImplementedView for four
115
121
  // of six (number/boolean/date/richtext) since they have no configurable
116
122
  // settings yet (empty settingsSchema). text and image gained real
117
123
  // settings + settingsSchema in Session 69, proving the settings pipeline
118
124
  // before Google Maps uses the exact same path.
119
- // `preview` is aliased to the same `readOnly` view (Session 41) — used by
125
+ // `preview` is aliased to the same `readOnly` view (Session 41), used by
120
126
  // the document type builder's per-field live preview while designing a
121
127
  // field, deliberately not a `disabled`-attribute wrapper around `input`:
122
128
  // the rich text view is TipTap/contenteditable, which a native `disabled`
@@ -146,7 +152,7 @@ registerDataType(builtIn("date", "Date", "calendar", BUILT_IN_VALUE_SCHEMAS["com
146
152
  settings: NotImplementedView,
147
153
  preview: DateReadOnlyView,
148
154
  }));
149
- // Stores a media reference id — the Media Library item itself is
155
+ // Stores a media reference id; the Media Library item itself is
150
156
  // fetched separately (GET /api/manage/v1/media/:id), not embedded in the field
151
157
  // value. S234d gave the view a second way to fill that id: Choose opens
152
158
  // the shared media picker over the library, beside the upload it has had
@@ -188,10 +194,10 @@ registerDataType(builtIn("richtext", "Rich Text", "file-text", BUILT_IN_VALUE_SC
188
194
  preview: RichTextReadOnlyView,
189
195
  }));
190
196
  // S197 Task 8 (spec §7, D7): developer-authored raw HTML, distinct from
191
- // the rich (TipTap) editor above — a plain string value edited in
197
+ // the rich (TipTap) editor above: a plain string value edited in
192
198
  // CodeMirror. `trusted` (default false) is the datatype's one setting;
193
199
  // the render pipeline (apps/server/src/render/render-context.ts) is what
194
- // actually enforces the posture this settings flag configures — this
200
+ // actually enforces the posture this settings flag configures; this
195
201
  // registration only carries the flag, it doesn't interpret it.
196
202
  registerDataType(builtIn("html", "HTML", "code", BUILT_IN_VALUE_SCHEMAS["com.kardalum.html"], {
197
203
  input: HtmlInputView,
@@ -199,7 +205,7 @@ registerDataType(builtIn("html", "HTML", "code", BUILT_IN_VALUE_SCHEMAS["com.kar
199
205
  settings: HtmlSettingsView,
200
206
  preview: HtmlReadOnlyView,
201
207
  }, { settingsSchema: HTML_SETTINGS_SCHEMA, defaultSettings: HTML_DEFAULT_SETTINGS }));
202
- // S198 Task 3: the first composite built-in datatype — its value has two
208
+ // S198 Task 3: the first composite built-in datatype: its value has two
203
209
  // interdependent members ({ start, end }), which is exactly what forces
204
210
  // the validate hook's shape to be honest: `path` names which sub-input is
205
211
  // at fault, and `isEmpty` lets `required` mean "a range must be provided"
@@ -264,3 +270,28 @@ registerDataType(builtIn("asset", "Asset", "folder-open", BUILT_IN_VALUE_SCHEMAS
264
270
  settings: AssetSettingsView,
265
271
  preview: AssetReadOnlyView,
266
272
  }, { settingsSchema: ASSET_SETTINGS_SCHEMA, defaultSettings: ASSET_DEFAULT_SETTINGS }));
273
+ // M32 C (D1): the Content Picker, Options List and Link editors. Views arrive in their own tasks;
274
+ // until then the placeholders render nothing.
275
+ registerDataType(builtIn("contentpicker", "Content Picker", "file-search", BUILT_IN_VALUE_SCHEMAS["com.kardalum.contentpicker"], { input: ContentPickerInputView, readOnly: ContentPickerReadOnlyView, settings: ContentPickerSettingsView, preview: ContentPickerReadOnlyView }, {
276
+ settingsSchema: CONTENT_PICKER_SETTINGS_SCHEMA,
277
+ defaultSettings: CONTENT_PICKER_DEFAULT_SETTINGS,
278
+ }));
279
+ registerDataType(builtIn("options", "Options List", "list", BUILT_IN_VALUE_SCHEMAS["com.kardalum.options"], { input: OptionsListInputView, readOnly: OptionsListReadOnlyView, settings: OptionsListSettingsView, preview: OptionsListReadOnlyView }, {
280
+ settingsSchema: OPTIONS_SETTINGS_SCHEMA,
281
+ defaultSettings: OPTIONS_DEFAULT_SETTINGS,
282
+ }));
283
+ registerDataType(builtIn("link", "Link", "link", BUILT_IN_VALUE_SCHEMAS["com.kardalum.link"], { input: LinkInputView, readOnly: LinkReadOnlyView, settings: LinkSettingsView, preview: LinkReadOnlyView }, {
284
+ settingsSchema: LINK_SETTINGS_SCHEMA,
285
+ defaultSettings: LINK_DEFAULT_SETTINGS,
286
+ }));
287
+ // M32 D (D1): the Group and Repeatable List editors.
288
+ const GROUP_VIEWS = { input: GroupInputView, readOnly: GroupReadOnlyView, settings: GroupSettingsView, preview: GroupReadOnlyView };
289
+ const LIST_VIEWS = { input: RepeatableListInputView, readOnly: RepeatableListReadOnlyView, settings: RepeatableListSettingsView, preview: RepeatableListReadOnlyView };
290
+ registerDataType(builtIn("group", "Group", "layers", BUILT_IN_VALUE_SCHEMAS["com.kardalum.group"], GROUP_VIEWS, {
291
+ settingsSchema: GROUP_SETTINGS_SCHEMA,
292
+ defaultSettings: GROUP_DEFAULT_SETTINGS,
293
+ }));
294
+ registerDataType(builtIn("list", "Repeatable List", "list-ordered", BUILT_IN_VALUE_SCHEMAS["com.kardalum.list"], LIST_VIEWS, {
295
+ settingsSchema: REPEATABLE_LIST_SETTINGS_SCHEMA,
296
+ defaultSettings: REPEATABLE_LIST_DEFAULT_SETTINGS,
297
+ }));
@@ -1,4 +1,5 @@
1
- export { CAPABILITY_IDS, deriveCapabilities, isActionGated, type Capability, type CapabilityMediation, type CapabilityPayload, } from "@kardalum/plugin-package/reference";
1
+ import type { CapabilityNote } from "@kardalum/api-schemas";
2
+ export { CAPABILITY_IDS, deriveCapabilities, derivesCapability, isActionGated, type Capability, type CapabilityMediation, type CapabilityPayload, } from "@kardalum/plugin-package/reference";
2
3
  /**
3
4
  * S289 (S347): the one sentence every surface uses for what declaring a
4
5
  * promised capability means for review. Every submission that passes
@@ -18,6 +19,15 @@ export declare const PROMISED_CAPABILITY_SENTENCE = "is a promised capability, s
18
19
  export type CapabilityAudience = "operator" | "shopper";
19
20
  export type CapabilityLabels = Record<CapabilityAudience, string>;
20
21
  export declare const CAPABILITY_LABELS: Record<string, CapabilityLabels>;
22
+ /**
23
+ * M33 K2: the core's notes a capability's detail may carry beside the
24
+ * plugin's own words, in English. The admin's locales (`capabilityNotes`)
25
+ * and the marketplace's dictionaries hold the same words in every language
26
+ * they carry, the English held to this table by their label tests. A note's
27
+ * words may hold one `{{value}}`, where the detail's value is printed as
28
+ * written (formatCapabilityDetail in @kardalum/api-schemas).
29
+ */
30
+ export declare const CAPABILITY_NOTE_WORDS: Record<CapabilityNote, string>;
21
31
  /**
22
32
  * The heading a renderer puts in front of a capability's details.
23
33
  *
@@ -1,7 +1,7 @@
1
1
  // S289: the derivation moved to @kardalum/plugin-package/reference so the one
2
2
  // reference builder can call it (the SDK depends on plugin-package, never the
3
3
  // reverse). The SDK's public names are unchanged; the labels stay here.
4
- export { CAPABILITY_IDS, deriveCapabilities, isActionGated, } from "@kardalum/plugin-package/reference";
4
+ export { CAPABILITY_IDS, deriveCapabilities, derivesCapability, isActionGated, } from "@kardalum/plugin-package/reference";
5
5
  // A contribution or assertion added to the manifest and not classified in
6
6
  // the derivation is a compile error here, as it was before the move.
7
7
  const contributionKeysAreTotal = true;
@@ -35,14 +35,16 @@ export const CAPABILITY_LABELS = {
35
35
  "admin.section": { operator: "Admin sections", shopper: "Adds admin screens" },
36
36
  "admin.railEntry": { operator: "Admin rail entries", shopper: "Adds screens to built-in sections" },
37
37
  "admin.dashboardWidget": { operator: "Dashboard widgets", shopper: "Adds dashboard widgets" },
38
+ "admin.editorPanel": { operator: "Editor panels", shopper: "Adds panels to the page editor" },
39
+ "admin.treeAction": { operator: "Tree actions", shopper: "Adds actions to the content tree" },
38
40
  "admin.notifications": {
39
41
  operator: "Notifications",
40
- shopper: "Sends notifications to people in the admin, for example to everyone who may publish.",
42
+ shopper: "Sends notifications of the kinds it lists, each to the people the kind names.",
41
43
  },
42
44
  "render.template": { operator: "Render templates", shopper: "Ships render templates" },
43
45
  "render.asset": { operator: "Editable assets", shopper: "Ships editable assets" },
44
46
  "theme.tokens": { operator: "Theme tokens", shopper: "Restyles the admin" },
45
- "server.hook": { operator: "Lifecycle hooks", shopper: "Reacts to content changes" },
47
+ "server.hook": { operator: "Lifecycle hooks", shopper: "Reacts to events on your site: the ones listed" },
46
48
  "server.scheduledTask": { operator: "Scheduled tasks", shopper: "Runs work on a schedule" },
47
49
  "media.processor": { operator: "Media processors", shopper: "Processes uploaded media" },
48
50
  "api.serializer": { operator: "Response extensions", shopper: "Extends content API responses" },
@@ -51,11 +53,61 @@ export const CAPABILITY_LABELS = {
51
53
  "api.route.public": { operator: "Public API routes", shopper: "Adds routes anyone can call" },
52
54
  "service.exposed": { operator: "Services for other plugins", shopper: "Offers services to other plugins" },
53
55
  "bundle.plugin": { operator: "Bundled plugins", shopper: "Installs other plugins with it" },
56
+ "content.access": { operator: "Content access", shopper: "Reads, creates or changes content of the types it names" },
57
+ // M32 F4c (D10)
58
+ "media.access": { operator: "Media access", shopper: "Reads every media file, private ones included, or adds media files" },
59
+ "site.route": { operator: "Site addresses", shopper: "Answers at addresses of your site" },
60
+ "site.fallback": { operator: "Unclaimed addresses", shopper: "Answers addresses no page answers, for example with a redirect" },
61
+ "render.templateFilter": { operator: "Template filters", shopper: "Adds template filters" },
62
+ "render.templateTag": { operator: "Template tags", shopper: "Adds template tags" },
63
+ "render.pageHead": { operator: "Page head", shopper: "Adds tags to the head of every page, scripts only from the places it names" },
64
+ // M32 F4 (D8, D10)
65
+ "provider.formProtection": { operator: "Form protection provider", shopper: "Can check your site's forms" },
66
+ "provider.search": { operator: "Search provider", shopper: "Receives every published page to answer site search" },
67
+ "provider.mediaStore": { operator: "Media store", shopper: "Can store every uploaded file" },
68
+ // M32 H (H2, H19)
69
+ "provider.mail": { operator: "Mail sender", shopper: "Sends every email the site sends, password reset links included" },
70
+ // M33 K11
71
+ "mail.direct": { operator: "Plugin emails", shopper: "Sends emails of the kinds it lists, each to one person, such as an order confirmation to a buyer, when you switch each kind on" },
72
+ "mail.formReplies": { operator: "Form replies", shopper: "Can send one reply email to the address a visitor types into a form, when you switch it on" },
73
+ // M32 F4b (D48)
74
+ "provider.signIn": { operator: "Sign-in provider", shopper: "Can let people sign in to the admin, and vouches for who they are" },
75
+ secrets: { operator: "Secrets", shopper: "Keeps secret values you enter, encrypted" },
76
+ // M33 K42
77
+ "render.heldEmbed": { operator: "Content from other sites", shopper: "Shows content from the sites it names on your pages, only after a visitor clicks to show it" },
78
+ // M33 K17
79
+ "secrets.sealedValues": { operator: "Sealed values", shopper: "Keeps secrets it makes, encrypted with your server's key" },
80
+ // M33 K16
81
+ "network.outbound": {
82
+ operator: "Outbound requests",
83
+ shopper: "Calls web addresses through the server's checked connection, which refuses this server and private networks unless whoever runs the server allows a range",
84
+ },
54
85
  "bundle.template": { operator: "Bundled starter", shopper: "Comes with a frontend starter" },
55
86
  "network.external": { operator: "External network", shopper: "Reaches the network" },
56
87
  "network.vendorService": { operator: "Vendor service", shopper: "Serves its paid features from the author's server" },
57
88
  "filesystem.access": { operator: "Filesystem access", shopper: "Reads or writes files" },
58
89
  };
90
+ /**
91
+ * M33 K2: the core's notes a capability's detail may carry beside the
92
+ * plugin's own words, in English. The admin's locales (`capabilityNotes`)
93
+ * and the marketplace's dictionaries hold the same words in every language
94
+ * they carry, the English held to this table by their label tests. A note's
95
+ * words may hold one `{{value}}`, where the detail's value is printed as
96
+ * written (formatCapabilityDetail in @kardalum/api-schemas).
97
+ */
98
+ export const CAPABILITY_NOTE_WORDS = {
99
+ rawBody: "reads the request exactly as sent",
100
+ identifiesPeople: "identifies people",
101
+ durable: "kept across restarts",
102
+ methods: "may use: {{value}}",
103
+ leavesServer: "handed to visitors as a sealed token, readable only by this server",
104
+ setsTitle: "may set the page title",
105
+ embedFrom: "from {{value}}",
106
+ embedKindMap: "a map",
107
+ embedKindContent: "content",
108
+ privacyNoticeAt: "privacy notice: {{value}}",
109
+ addsScript: "adds its own script to pages with a protected form",
110
+ };
59
111
  /**
60
112
  * The heading a renderer puts in front of a capability's details.
61
113
  *
package/dist/cli.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ /** M32 I3 (B13): what a command may do with standard input, without `@types/node`. */
2
+ export interface CliReadableStream {
3
+ readonly isTTY?: boolean;
4
+ read(size?: number): string | Uint8Array | null;
5
+ setEncoding(encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "utf-16le" | "ucs2" | "ucs-2" | "base64" | "base64url" | "latin1" | "binary" | "hex"): this;
6
+ pause(): this;
7
+ resume(): this;
8
+ on(event: string, listener: (...args: any[]) => void): this;
9
+ once(event: string, listener: (...args: any[]) => void): this;
10
+ off(event: string, listener: (...args: any[]) => void): this;
11
+ pipe(destination: any, options?: {
12
+ end?: boolean;
13
+ }): any;
14
+ [Symbol.asyncIterator](): AsyncIterableIterator<string | Uint8Array>;
15
+ }
16
+ /** M32 I3 (B13): what a command may do with standard output or error, without `@types/node`. */
17
+ export interface CliWritableStream {
18
+ readonly isTTY?: boolean;
19
+ readonly columns?: number;
20
+ write(chunk: string | Uint8Array, callback?: (error?: Error | null) => void): boolean;
21
+ end(callback?: () => void): this;
22
+ on(event: string, listener: (...args: any[]) => void): this;
23
+ once(event: string, listener: (...args: any[]) => void): this;
24
+ off(event: string, listener: (...args: any[]) => void): this;
25
+ }
26
+ /** What a command receives. No environment copy, no profile record and no key. */
27
+ export interface PluginCliContext {
28
+ command: {
29
+ /** The plugin id's last segment (cut at 32): the first word of the command line. */
30
+ prefix: string;
31
+ /** The command's declared name: the second word. */
32
+ name: string;
33
+ packageName: string;
34
+ packageVersion: string;
35
+ };
36
+ /** The arguments after the command name, unchanged and frozen. */
37
+ argv: readonly string[];
38
+ cwd: string;
39
+ cliVersion: string;
40
+ stdin: CliReadableStream;
41
+ /** `stdout` and `stderr` are the raw streams: what is written to them is not redacted, unlike `out` and `err`. */
42
+ stdout: CliWritableStream;
43
+ stderr: CliWritableStream;
44
+ /** One line to stdout, through the CLI's redaction. */
45
+ out(line: string): void;
46
+ /** One line to stderr, through the CLI's redaction. */
47
+ err(line: string): void;
48
+ /**
49
+ * The developer's own management client (`KardalumManageClient` from `@kardalum/client`), made
50
+ * on first call: a command that never calls this never resolves a profile or reads a credential.
51
+ * The profile is resolved as for every command (the `KARDALUM_URL` and `KARDALUM_API_KEY` pair,
52
+ * then `options.profile`, `KARDALUM_PROFILE`, the default). A production profile is refused
53
+ * unless the command names it in `options.profile`, so forward the user's own `--profile`.
54
+ * Typed `unknown` here so the SDK carries no dependency on the client; cast it to
55
+ * `KardalumManageClient`.
56
+ */
57
+ client(options?: {
58
+ profile?: string;
59
+ }): Promise<unknown>;
60
+ }
61
+ /** A command answers nothing (exit 0) or an integer 0 to 255 (that exit code). */
62
+ export type PluginCliCommand = (context: PluginCliContext) => void | number | Promise<void | number>;
63
+ /** A commands module's `commands` export: a plain object, one function per declared name. */
64
+ export type PluginCliCommands = Record<string, PluginCliCommand>;
65
+ /** Returns `commands` unchanged; it only checks each command against `PluginCliCommand`. */
66
+ export declare function defineCliCommands<T extends PluginCliCommands>(commands: T): T;
package/dist/cli.js ADDED
@@ -0,0 +1,22 @@
1
+ // The `@kardalum/plugin-sdk/cli` subpath (M32 F3b, D7): the types of the commands a plugin package adds
2
+ // to the `kardalum` CLI, and `defineCliCommands`, an identity helper that checks a commands object
3
+ // against them. Types only, plus that one function: nothing here imports React or a Node module at
4
+ // run time, so the commands module of a package can import it cheaply.
5
+ //
6
+ // A package declares its commands in its own package.json (`kardalum.cli`: `plugin`, `module` and
7
+ // `commands`, each with a `name` and a `summary`) and the module exports them as `commands`:
8
+ //
9
+ // import { defineCliCommands } from "@kardalum/plugin-sdk/cli";
10
+ // export const commands = defineCliCommands({
11
+ // audit: async (context) => {
12
+ // const client = await context.client();
13
+ // context.out("checked");
14
+ // },
15
+ // });
16
+ //
17
+ // The CLI runs `kardalum <prefix> <name> [arguments]`, where the prefix is the last segment of the
18
+ // plugin id. A command is code the developer installed: it runs with their rights.
19
+ /** Returns `commands` unchanged; it only checks each command against `PluginCliCommand`. */
20
+ export function defineCliCommands(commands) {
21
+ return commands;
22
+ }
@@ -0,0 +1,85 @@
1
+ import type { FORM_REPLY_REASONS, ContentChildrenQuery, ContentChildrenResponse, ContentItemQuery, ContentItemResponse, ContentTrashBody, ContentTrashResult, CreateContentRequest, LatestVersionQuery, LatestVersionResponse, PublishContentRequest, PublishContentResponse, SaveContentRequest, SaveContentResponse, UnpublishContentRequest, UnpublishContentResponse, ProtectionTellWord } from "@kardalum/api-schemas";
2
+ /** A page of rows plus a way to walk every page. `all()` follows `nextCursor` for you. */
3
+ export interface PluginContentList<T> {
4
+ items: T[];
5
+ nextCursor: string | null;
6
+ all(): AsyncIterable<T>;
7
+ }
8
+ type ContentRow = ContentChildrenResponse["items"][number];
9
+ /**
10
+ * M32 F (D8): the content half of the management client, acting as this plugin within its
11
+ * `contributions.contentAccess`. A call outside the declaration throws ContentAccessRefusedError
12
+ * and sends nothing.
13
+ */
14
+ export interface PluginContentLibrary {
15
+ getById(id: string, opts?: Partial<Pick<ContentItemQuery, "locale">>): Promise<ContentItemResponse>;
16
+ getLatestVersion(id: string, opts?: Partial<Pick<LatestVersionQuery, "locale">>): Promise<LatestVersionResponse>;
17
+ getChildren(id: string, opts?: Partial<Pick<ContentChildrenQuery, "cursor" | "limit">>): Promise<PluginContentList<ContentRow>>;
18
+ create(body: CreateContentRequest): Promise<ContentItemResponse>;
19
+ save(id: string, body: SaveContentRequest): Promise<SaveContentResponse>;
20
+ publish(id: string, body?: PublishContentRequest): Promise<PublishContentResponse>;
21
+ unpublish(id: string, body?: UnpublishContentRequest): Promise<UnpublishContentResponse>;
22
+ delete(id: string, opts?: Partial<Pick<NonNullable<ContentTrashBody>, "confirm">>): Promise<ContentTrashResult>;
23
+ /** M32 F3 (D19, D20): the id of a document type this plugin's contentAccess names, or null when no type, or
24
+ * more than one, has that name. A name the declaration does not hold throws ContentAccessRefusedError.
25
+ * The plugin's own type of that name answers first; otherwise the one site type of that name, found
26
+ * among the first 2,000 types. The name matches exactly (case and spaces count) and is 1 to 200 characters,
27
+ * the contentAccess name limit. */
28
+ documentTypeId(name: string): Promise<string | null>;
29
+ }
30
+ /** M32 F (D9): thrown by context.content when a call falls outside the plugin's contentAccess. Nothing was sent. */
31
+ export declare class ContentAccessRefusedError extends Error {
32
+ readonly code: "content_access";
33
+ constructor(message: string);
34
+ }
35
+ /** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
36
+ export declare function isContentAccessRefusedError(value: unknown): value is ContentAccessRefusedError;
37
+ /** M32 H (H20): why a form reply was not queued. */
38
+ export type FormReplyReason = (typeof FORM_REPLY_REASONS)[number];
39
+ export type FormReplyResult = {
40
+ queued: true;
41
+ } | {
42
+ queued: false;
43
+ reason: FormReplyReason;
44
+ };
45
+ /** M32 H (H19): sends one reply to the address a visitor typed into the form, when the site owner switched it on. */
46
+ export type FormReply = (input: {
47
+ field: string;
48
+ subject: string;
49
+ text: string;
50
+ }) => Promise<FormReplyResult>;
51
+ export type ProtectionResult = {
52
+ ok: true;
53
+ reply?: FormReply;
54
+ } | {
55
+ ok: false;
56
+ check: "rate";
57
+ retryAfterSeconds: number;
58
+ } | {
59
+ ok: false;
60
+ check: "hiddenField" | "tooFast" | "token";
61
+ }
62
+ /**
63
+ * M32 F4 (D14, D15): the chosen protection provider refused the send (`provider_refused`) or did
64
+ * not answer usably (`provider_unavailable`: a throw, a timeout or a malformed answer). The
65
+ * provider's own reason is logged, never handed on; answer it as the other silent refusals.
66
+ */
67
+ | {
68
+ ok: false;
69
+ check: "provider";
70
+ reason: "provider_unavailable";
71
+ }
72
+ /** M33 K53: a refusal may carry `tell`, the one word the provider's `verify` answered from `PROTECTION_TELL_WORDS`
73
+ * (`"needsScript"`: the send came without the check's script; `"expired"`: the answer's challenge had run
74
+ * out; `"unavailable"`: the provider could not check). It is a plain word, never provider text; a caller
75
+ * that does not know it answers as it always did. A caller that tells its visitor answers `"expired"`,
76
+ * `"unavailable"` and `provider_unavailable` alike ("not sent, please send it again") and keeps every
77
+ * refusal without a word silent: a wrong or reused answer is never told. */
78
+ | {
79
+ ok: false;
80
+ check: "provider";
81
+ reason: "provider_refused";
82
+ tell?: ProtectionTellWord;
83
+ };
84
+ /** Defined once in `@kardalum/api-schemas`: the field names, a fresh token and the live minimum time. */
85
+ export type { ProtectionFields } from "@kardalum/api-schemas";
@@ -0,0 +1,15 @@
1
+ /** M32 F (D9): thrown by context.content when a call falls outside the plugin's contentAccess. Nothing was sent. */
2
+ export class ContentAccessRefusedError extends Error {
3
+ code = "content_access";
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = "ContentAccessRefusedError";
7
+ }
8
+ }
9
+ /** Structural, never instanceof: the plugin's bundle carries its own copy of this class. */
10
+ export function isContentAccessRefusedError(value) {
11
+ if (typeof value !== "object" || value === null)
12
+ return false;
13
+ const candidate = value;
14
+ return candidate.name === "ContentAccessRefusedError" && candidate.code === "content_access";
15
+ }