@kardalum/plugin-sdk 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/README.md +19 -0
  3. package/dist/admin-section-registry.d.ts +16 -1
  4. package/dist/admin-section-registry.js +23 -0
  5. package/dist/built-in-editor-ids.d.ts +1 -1
  6. package/dist/built-in-editor-ids.js +2 -20
  7. package/dist/built-in-settings-schemas.d.ts +10 -0
  8. package/dist/built-in-settings-schemas.js +86 -0
  9. package/dist/built-in-value-schemas.js +35 -0
  10. package/dist/built-ins.js +38 -7
  11. package/dist/capabilities.d.ts +11 -1
  12. package/dist/capabilities.js +55 -3
  13. package/dist/cli.d.ts +66 -0
  14. package/dist/cli.js +22 -0
  15. package/dist/content-library.d.ts +85 -0
  16. package/dist/content-library.js +15 -0
  17. package/dist/content-picker/page-picker-sheet.d.ts +13 -0
  18. package/dist/content-picker/page-picker-sheet.js +105 -0
  19. package/dist/content-picker/page-tree.d.ts +25 -0
  20. package/dist/content-picker/page-tree.js +132 -0
  21. package/dist/data-type-plugin.d.ts +7 -1
  22. package/dist/datatype-validation.d.ts +4 -9
  23. package/dist/datatype-validation.js +139 -1
  24. package/dist/entitlement-entry.d.ts +1 -1
  25. package/dist/entitlement-entry.js +1 -1
  26. package/dist/entitlement-gate.d.ts +14 -0
  27. package/dist/entitlement-gate.js +64 -7
  28. package/dist/entitlement-plan.d.ts +6 -0
  29. package/dist/entitlement-plan.js +10 -0
  30. package/dist/entitlement-types.d.ts +36 -12
  31. package/dist/entitlement.d.ts +31 -4
  32. package/dist/entitlement.js +58 -17
  33. package/dist/hook-entry.d.ts +5 -0
  34. package/dist/hook-entry.js +30 -0
  35. package/dist/host-entry.d.ts +1 -1
  36. package/dist/host-entry.js +1 -1
  37. package/dist/index.d.ts +36 -4
  38. package/dist/index.js +50 -3
  39. package/dist/mail.d.ts +30 -0
  40. package/dist/mail.js +1 -0
  41. package/dist/manifest-entry.d.ts +29 -4
  42. package/dist/manifest-entry.js +39 -2
  43. package/dist/manifest-schema.d.ts +443 -29
  44. package/dist/manifest-schema.js +285 -23
  45. package/dist/manifest.d.ts +450 -51
  46. package/dist/manifest.js +1 -1
  47. package/dist/media/media-picker.js +31 -18
  48. package/dist/media/upload-error.d.ts +5 -1
  49. package/dist/media/upload-error.js +14 -2
  50. package/dist/media-library.d.ts +32 -0
  51. package/dist/media-library.js +15 -0
  52. package/dist/nested-field-host.d.ts +76 -0
  53. package/dist/nested-field-host.js +90 -0
  54. package/dist/notify.d.ts +12 -4
  55. package/dist/notify.js +1 -1
  56. package/dist/outbound.d.ts +47 -0
  57. package/dist/outbound.js +1 -0
  58. package/dist/plugin-context.d.ts +5 -0
  59. package/dist/plugin-screen-context.d.ts +112 -0
  60. package/dist/plugin-screen-context.js +26 -0
  61. package/dist/providers.d.ts +268 -0
  62. package/dist/providers.js +74 -0
  63. package/dist/read-all-pages.d.ts +5 -0
  64. package/dist/read-all-pages.js +3 -2
  65. package/dist/richtext/block-panel.js +11 -6
  66. package/dist/richtext/insert-menu.js +9 -6
  67. package/dist/richtext/style-listbox.js +6 -4
  68. package/dist/sdk-strings.d.ts +285 -0
  69. package/dist/sdk-strings.js +347 -0
  70. package/dist/sealing.d.ts +14 -0
  71. package/dist/sealing.js +1 -0
  72. package/dist/simple-storage-value-provider.js +24 -24
  73. package/dist/structured-storage-types.d.ts +309 -9
  74. package/dist/text-entry.d.ts +1 -0
  75. package/dist/text-entry.js +6 -0
  76. package/dist/tokens/tailwind-theme.css +5 -0
  77. package/dist/tokens/tokens.css +15 -3
  78. package/dist/tokens/tokens.json +8 -3
  79. package/dist/views/asset-view.js +4 -1
  80. package/dist/views/content-list-preview.js +3 -1
  81. package/dist/views/content-list-settings-view.js +11 -7
  82. package/dist/views/content-list-view.d.ts +5 -3
  83. package/dist/views/content-list-view.js +38 -34
  84. package/dist/views/content-picker-view.d.ts +3 -0
  85. package/dist/views/content-picker-view.js +143 -0
  86. package/dist/views/crop-view.d.ts +4 -6
  87. package/dist/views/crop-view.js +22 -13
  88. package/dist/views/date-range-view.js +4 -1
  89. package/dist/views/file-upload-view.d.ts +5 -7
  90. package/dist/views/file-upload-view.js +16 -7
  91. package/dist/views/group-view.d.ts +8 -0
  92. package/dist/views/group-view.js +123 -0
  93. package/dist/views/html-view.js +7 -6
  94. package/dist/views/image-view.js +37 -19
  95. package/dist/views/link-view.d.ts +3 -0
  96. package/dist/views/link-view.js +150 -0
  97. package/dist/views/options-list-view.d.ts +3 -0
  98. package/dist/views/options-list-view.js +104 -0
  99. package/dist/views/repeatable-list-view.d.ts +3 -0
  100. package/dist/views/repeatable-list-view.js +113 -0
  101. package/dist/views/rich-text-view.js +28 -13
  102. package/dist/views/suggest-key.d.ts +17 -0
  103. package/dist/views/suggest-key.js +55 -0
  104. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.d.ts +215 -0
  105. package/node_modules/@kardalum/api-schemas/dist/ai-connections.schema.js +179 -0
  106. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.d.ts +12 -0
  107. package/node_modules/@kardalum/api-schemas/dist/ai-context.schema.js +10 -0
  108. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +10 -0
  109. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +5 -0
  110. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +7 -1
  111. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +4 -2
  112. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.d.ts +1 -0
  113. package/node_modules/@kardalum/api-schemas/dist/built-in-editor-ids.js +27 -0
  114. package/node_modules/@kardalum/api-schemas/dist/capability-detail.d.ts +65 -0
  115. package/node_modules/@kardalum/api-schemas/dist/capability-detail.js +126 -0
  116. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +115 -3
  117. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +58 -11
  118. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +57 -2
  119. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +137 -0
  120. package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +1 -1
  121. package/node_modules/@kardalum/api-schemas/dist/content-path.js +1 -1
  122. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.d.ts +50 -0
  123. package/node_modules/@kardalum/api-schemas/dist/content-search.schema.js +42 -0
  124. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.d.ts +37 -0
  125. package/node_modules/@kardalum/api-schemas/dist/content-summary.schema.js +19 -0
  126. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.d.ts +23 -0
  127. package/node_modules/@kardalum/api-schemas/dist/content-unpublish.schema.js +13 -0
  128. package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +3 -0
  129. package/node_modules/@kardalum/api-schemas/dist/content.schema.js +10 -0
  130. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.d.ts +41 -0
  131. package/node_modules/@kardalum/api-schemas/dist/contract-cancel.schema.js +86 -0
  132. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +10 -5
  133. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +7 -4
  134. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +25 -0
  135. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +8 -0
  136. package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +1 -1
  137. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.d.ts +35 -0
  138. package/node_modules/@kardalum/api-schemas/dist/data-type-issue.js +60 -0
  139. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +180 -15
  140. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +41 -5
  141. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +24 -6
  142. package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +90 -5
  143. package/node_modules/@kardalum/api-schemas/dist/form-protection.d.ts +23 -0
  144. package/node_modules/@kardalum/api-schemas/dist/form-protection.js +12 -0
  145. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.d.ts +12 -0
  146. package/node_modules/@kardalum/api-schemas/dist/graphql-limits.js +14 -0
  147. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.d.ts +23 -0
  148. package/node_modules/@kardalum/api-schemas/dist/held-embed-words.js +70 -0
  149. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +117 -41
  150. package/node_modules/@kardalum/api-schemas/dist/index.js +89 -26
  151. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.d.ts +9 -0
  152. package/node_modules/@kardalum/api-schemas/dist/install-sign-in-switched-off.schema.js +9 -0
  153. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.d.ts +8 -0
  154. package/node_modules/@kardalum/api-schemas/dist/legal-anchors.js +9 -0
  155. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +63 -0
  156. package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +54 -0
  157. package/node_modules/@kardalum/api-schemas/dist/mail-rules.d.ts +224 -0
  158. package/node_modules/@kardalum/api-schemas/dist/mail-rules.js +404 -0
  159. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +8 -0
  160. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +4 -0
  161. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.d.ts +145 -0
  162. package/node_modules/@kardalum/api-schemas/dist/marketplace-leaks.schema.js +154 -0
  163. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +312 -8
  164. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +43 -3
  165. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +15 -0
  166. package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +14 -0
  167. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.d.ts +131 -0
  168. package/node_modules/@kardalum/api-schemas/dist/marketplace-payouts.schema.js +272 -0
  169. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.d.ts +84 -0
  170. package/node_modules/@kardalum/api-schemas/dist/marketplace-profile.schema.js +138 -0
  171. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.d.ts +20 -0
  172. package/node_modules/@kardalum/api-schemas/dist/marketplace-revocation.schema.js +49 -0
  173. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.d.ts +211 -0
  174. package/node_modules/@kardalum/api-schemas/dist/marketplace-sites.schema.js +424 -0
  175. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.d.ts +78 -0
  176. package/node_modules/@kardalum/api-schemas/dist/mcp-plugins.schema.js +27 -0
  177. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.d.ts +70 -0
  178. package/node_modules/@kardalum/api-schemas/dist/mcp-tool-inputs.schema.js +43 -0
  179. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +22 -0
  180. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +13 -1
  181. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.d.ts +75 -0
  182. package/node_modules/@kardalum/api-schemas/dist/media-move.schema.js +53 -0
  183. package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +2 -2
  184. package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +2 -0
  185. package/node_modules/@kardalum/api-schemas/dist/media-reference.js +55 -0
  186. package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +1 -0
  187. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +4 -0
  188. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.d.ts +204 -0
  189. package/node_modules/@kardalum/api-schemas/dist/nested-fields.schema.js +370 -0
  190. package/node_modules/@kardalum/api-schemas/dist/nested-validation.d.ts +53 -0
  191. package/node_modules/@kardalum/api-schemas/dist/nested-validation.js +284 -0
  192. package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +5 -5
  193. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +1 -2
  194. package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +1 -2
  195. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.d.ts +145 -0
  196. package/node_modules/@kardalum/api-schemas/dist/notification-kinds.js +177 -0
  197. package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +258 -7
  198. package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +96 -5
  199. package/node_modules/@kardalum/api-schemas/dist/page-address.d.ts +10 -0
  200. package/node_modules/@kardalum/api-schemas/dist/page-address.js +7 -0
  201. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.d.ts +34 -0
  202. package/node_modules/@kardalum/api-schemas/dist/password-reset.schema.js +60 -0
  203. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +28 -3
  204. package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +55 -8
  205. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +12 -0
  206. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +13 -0
  207. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.d.ts +23 -0
  208. package/node_modules/@kardalum/api-schemas/dist/plugin-caller.js +16 -0
  209. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.d.ts +76 -0
  210. package/node_modules/@kardalum/api-schemas/dist/plugin-cli-commands.js +316 -0
  211. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.d.ts +42 -0
  212. package/node_modules/@kardalum/api-schemas/dist/plugin-content-access.js +74 -0
  213. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.d.ts +31 -0
  214. package/node_modules/@kardalum/api-schemas/dist/plugin-data-type-configs.js +131 -0
  215. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +26 -2
  216. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +26 -2
  217. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +13 -5
  218. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.d.ts +228 -0
  219. package/node_modules/@kardalum/api-schemas/dist/plugin-document-types.js +41 -0
  220. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.d.ts +26 -0
  221. package/node_modules/@kardalum/api-schemas/dist/plugin-durable-hooks.js +55 -0
  222. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.d.ts +40 -0
  223. package/node_modules/@kardalum/api-schemas/dist/plugin-editor-extensions.js +124 -0
  224. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.d.ts +41 -0
  225. package/node_modules/@kardalum/api-schemas/dist/plugin-field-info.js +51 -0
  226. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.d.ts +32 -0
  227. package/node_modules/@kardalum/api-schemas/dist/plugin-graphql-fields.js +102 -0
  228. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.d.ts +107 -0
  229. package/node_modules/@kardalum/api-schemas/dist/plugin-held-embeds.js +213 -0
  230. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.d.ts +5 -0
  231. package/node_modules/@kardalum/api-schemas/dist/plugin-https-origin.js +21 -0
  232. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +4 -0
  233. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +3 -0
  234. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +44 -0
  235. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +38 -1
  236. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +237 -2
  237. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +205 -6
  238. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +26 -0
  239. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +29 -1
  240. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +32 -8
  241. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +120 -14
  242. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +335 -6
  243. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +242 -2
  244. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +16 -1
  245. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +34 -1
  246. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.d.ts +40 -0
  247. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-ai.js +139 -0
  248. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +22 -1
  249. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +31 -1
  250. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.d.ts +25 -0
  251. package/node_modules/@kardalum/api-schemas/dist/plugin-media-access.js +43 -0
  252. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.d.ts +107 -0
  253. package/node_modules/@kardalum/api-schemas/dist/plugin-outbound.js +150 -0
  254. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.d.ts +5 -0
  255. package/node_modules/@kardalum/api-schemas/dist/plugin-package-build.schema.js +7 -0
  256. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.d.ts +310 -0
  257. package/node_modules/@kardalum/api-schemas/dist/plugin-providers.js +430 -0
  258. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +4 -0
  259. package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +2 -0
  260. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.d.ts +45 -0
  261. package/node_modules/@kardalum/api-schemas/dist/plugin-sealed-values.js +99 -0
  262. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.d.ts +68 -0
  263. package/node_modules/@kardalum/api-schemas/dist/plugin-secrets.js +114 -0
  264. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.d.ts +342 -0
  265. package/node_modules/@kardalum/api-schemas/dist/plugin-settings.js +400 -0
  266. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.d.ts +180 -0
  267. package/node_modules/@kardalum/api-schemas/dist/plugin-site-extensions.js +612 -0
  268. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +7 -0
  269. package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +47 -4
  270. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.d.ts +45 -0
  271. package/node_modules/@kardalum/api-schemas/dist/plugin-tasks.js +197 -0
  272. package/node_modules/@kardalum/api-schemas/dist/plural-rules.d.ts +9 -0
  273. package/node_modules/@kardalum/api-schemas/dist/plural-rules.js +41 -0
  274. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +41 -0
  275. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +100 -12
  276. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.d.ts +189 -0
  277. package/node_modules/@kardalum/api-schemas/dist/refund-request.schema.js +164 -0
  278. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  279. package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +7 -3
  280. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.d.ts +6 -0
  281. package/node_modules/@kardalum/api-schemas/dist/rich-text-shape.js +82 -0
  282. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.d.ts +66 -0
  283. package/node_modules/@kardalum/api-schemas/dist/rich-text-text.js +497 -0
  284. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.d.ts +82 -0
  285. package/node_modules/@kardalum/api-schemas/dist/sale-conditions.schema.js +99 -0
  286. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +13 -0
  287. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +28 -0
  288. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +91 -1
  289. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +90 -8
  290. package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +59 -1
  291. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +110 -0
  292. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +34 -2
  293. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.d.ts +384 -0
  294. package/node_modules/@kardalum/api-schemas/dist/sign-in.schema.js +616 -0
  295. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
  296. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  297. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.d.ts +13 -0
  298. package/node_modules/@kardalum/api-schemas/dist/structured-duplicate-key.js +26 -0
  299. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.d.ts +66 -0
  300. package/node_modules/@kardalum/api-schemas/dist/structured-fields.schema.js +160 -0
  301. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +1 -0
  302. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +3 -0
  303. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.d.ts +13 -0
  304. package/node_modules/@kardalum/api-schemas/dist/transaction-rolled-back.js +29 -0
  305. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.d.ts +13 -0
  306. package/node_modules/@kardalum/api-schemas/dist/trash-purge.schema.js +6 -0
  307. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +58 -1
  308. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +34 -3
  309. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +5 -1
  310. package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +4 -3
  311. package/node_modules/@kardalum/api-schemas/package.json +1 -0
  312. package/node_modules/@kardalum/design-tokens/dist/build-css.js +6 -0
  313. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +5 -0
  314. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
  315. package/node_modules/@kardalum/design-tokens/dist/tokens.css +15 -3
  316. package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +1 -1
  317. package/node_modules/@kardalum/design-tokens/dist/tokens.js +12 -3
  318. package/node_modules/@kardalum/design-tokens/dist/tokens.json +8 -3
  319. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -1
  320. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +21 -2
  321. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +8 -2
  322. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +17 -10
  323. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +355 -22
  324. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +1 -1
  325. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +2 -0
  326. package/node_modules/@kardalum/plugin-package/dist/cms-range.d.ts +17 -0
  327. package/node_modules/@kardalum/plugin-package/dist/cms-range.js +353 -0
  328. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.d.ts +2 -0
  329. package/node_modules/@kardalum/plugin-package/dist/delivery/ai-declarations.js +26 -0
  330. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +1 -1
  331. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +3 -2
  332. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.d.ts +2 -0
  333. package/node_modules/@kardalum/plugin-package/dist/delivery/content-access.js +34 -0
  334. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +2 -2
  335. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.d.ts +2 -0
  336. package/node_modules/@kardalum/plugin-package/dist/delivery/editor-extensions.js +27 -0
  337. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.d.ts +2 -0
  338. package/node_modules/@kardalum/plugin-package/dist/delivery/graphql-fields.js +22 -0
  339. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +1 -0
  340. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +1 -0
  341. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +47 -5
  342. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.d.ts +27 -0
  343. package/node_modules/@kardalum/plugin-package/dist/delivery/licence-check.js +95 -0
  344. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +9 -4
  345. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.d.ts +3 -0
  346. package/node_modules/@kardalum/plugin-package/dist/delivery/plugin-settings.js +68 -0
  347. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.d.ts +3 -0
  348. package/node_modules/@kardalum/plugin-package/dist/delivery/providers.js +298 -0
  349. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +25 -4
  350. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +91 -2
  351. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.d.ts +6 -0
  352. package/node_modules/@kardalum/plugin-package/dist/delivery/server-powers.js +140 -0
  353. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.d.ts +2 -0
  354. package/node_modules/@kardalum/plugin-package/dist/delivery/site-extensions.js +36 -0
  355. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
  356. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +21 -1
  357. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +10 -0
  358. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
  359. package/node_modules/@kardalum/plugin-package/dist/index.js +2 -1
  360. package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +75 -0
  361. package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +123 -0
  362. package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
  363. package/node_modules/@kardalum/ui/dist/components/tooltip.js +1 -2
  364. package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +6 -1
  365. package/node_modules/@kardalum/ui/dist/components/truncated-text.js +5 -4
  366. package/package.json +12 -2
@@ -1,9 +1,10 @@
1
1
  import { z } from "zod";
2
- import { DocumentTypeDefinitionSchema, FieldDefinitionSchema, TabDefinitionSchema, TreeRulesSchema, } from "./document-type.schema.js";
2
+ import { DocumentTypeDefinitionSchema, FieldDefinitionSchema, HelpForAiSchema, TabDefinitionSchema, TreeRulesSchema, } from "./document-type.schema.js";
3
3
  // Shared by create AND update: duplicate field keys within one document
4
4
  // type would silently collide in ContentVersion.data later, and a tabId
5
5
  // must reference a tab declared in the same payload.
6
- function validateFieldsAndTabs(value, ctx) {
6
+ /** Field ids unique and every field's tab declared: the core's rule, and a plugin's manifest's (plugin-document-types.ts). */
7
+ export function validateFieldsAndTabs(value, ctx) {
7
8
  const seen = new Set();
8
9
  for (const [index, field] of value.fields.entries()) {
9
10
  if (seen.has(field.id)) {
@@ -43,6 +44,7 @@ export const CreateDocumentTypeRequestSchema = z
43
44
  fields: z.array(FieldDefinitionSchema),
44
45
  treeRules: TreeRulesSchema,
45
46
  tabs: z.array(TabDefinitionSchema).default([]),
47
+ help: HelpForAiSchema.optional(),
46
48
  // S230c: refuse publishing a language whose required varying
47
49
  // fields are unfilled. Page types only.
48
50
  translationMandatory: z.boolean().optional(),
@@ -61,6 +63,7 @@ export const CreateDocumentTypeRequestSchema = z
61
63
  kind: z.literal("element"),
62
64
  fields: z.array(FieldDefinitionSchema),
63
65
  tabs: z.array(TabDefinitionSchema).default([]),
66
+ help: HelpForAiSchema.optional(),
64
67
  })
65
68
  .strict(),
66
69
  // S234a: the third kind. No treeRules, no translationMandatory and no
@@ -76,6 +79,7 @@ export const CreateDocumentTypeRequestSchema = z
76
79
  kind: z.literal("media"),
77
80
  fields: z.array(FieldDefinitionSchema),
78
81
  tabs: z.array(TabDefinitionSchema).default([]),
82
+ help: HelpForAiSchema.optional(),
79
83
  // Which type claims an uploaded file when more than one accepts
80
84
  // its extension: lower sorts first, and a type with no number at
81
85
  // all sorts after every type that has one.
@@ -106,10 +110,21 @@ export const CreateDocumentTypeRequestSchema = z
106
110
  varies: true,
107
111
  }
108
112
  ],
109
- treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
113
+ treeRules: { allowedAtRoot: true, allowedParents: "any", allowedChildren: "any" },
110
114
  tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
111
115
  },
112
116
  });
117
+ // M33 core (M14 callers): a document type's row version. Every write of the type moves it on.
118
+ // The list answers it beside each type; a client that read a type sends it back on the PUT, which
119
+ // is refused with 409 and DOCUMENT_TYPE_VERSION_CONFLICT_CODE once the type changed since.
120
+ export const DocumentTypeVersionSchema = z.number().int().positive();
121
+ export const DOCUMENT_TYPE_VERSION_CONFLICT_CODE = "document_type_version_conflict";
122
+ export const DocumentTypeVersionConflictSchema = z.object({
123
+ code: z.literal(DOCUMENT_TYPE_VERSION_CONFLICT_CODE),
124
+ message: z.string(),
125
+ /** The version the row holds now. */
126
+ currentVersion: DocumentTypeVersionSchema,
127
+ });
113
128
  // PUT /api/manage/v1/document-types/:id: the mutable subset only. `kind` is
114
129
  // immutable after creation (a payload carrying it fails .strict(), the
115
130
  // intended behavior, not an accident) and `defaultTemplateId` stays with
@@ -140,6 +155,19 @@ export const UpdateDocumentTypeRequestSchema = z
140
155
  // owns the singleton rule for catchAll.
141
156
  sortOrder: z.number().int().nonnegative().optional(),
142
157
  catchAll: z.boolean().optional(),
158
+ // M31.5 B (D9): optional here, and the route treats omission as "keep" (the adapter
159
+ // writes it verbatim, as it does translationMandatory); an empty note is stored empty.
160
+ help: HelpForAiSchema.optional(),
161
+ // M32 J (fix wave 2): the field keys this save may serve although the type once held a private
162
+ // field under them (its retiredPrivateFieldIds, or a field the stored type marks private). The
163
+ // stored versions still hold the private values, so serving such a key publishes them; without
164
+ // the key here the save is refused with 409 naming the field.
165
+ confirmPublicFieldIds: z.array(FieldDefinitionSchema.shape.id).max(500).optional(),
166
+ // M33 core (M14 callers): the version the caller read (the list's `version`). With it the save
167
+ // is refused with 409 (DOCUMENT_TYPE_VERSION_CONFLICT_CODE) when the type changed since, so
168
+ // nothing written in between is overwritten. Without it the save is written whatever the type
169
+ // holds now, as before: for a caller that never read the type.
170
+ version: DocumentTypeVersionSchema.optional(),
143
171
  })
144
172
  .strict()
145
173
  .superRefine(validateFieldsAndTabs)
@@ -159,12 +187,16 @@ export const UpdateDocumentTypeRequestSchema = z
159
187
  }
160
188
  ],
161
189
  tabs: [{ id: "f47ac10b-58cc-4372-a567-0e02b2c3d479", name: "Content" }],
162
- treeRules: { allowedAtRoot: true, allowedParentTypes: [], allowedChildTypes: [] },
190
+ treeRules: { allowedAtRoot: true, allowedParents: "any", allowedChildren: "any" },
163
191
  },
164
192
  });
165
193
  export const CreateDocumentTypeResponseSchema = z.object({
166
194
  documentType: DocumentTypeDefinitionSchema,
167
195
  });
196
+ // M33 core (M14 callers): the POST and the PUT answer the version they wrote, for the next save.
197
+ export const VersionedDocumentTypeResponseSchema = CreateDocumentTypeResponseSchema.extend({
198
+ version: DocumentTypeVersionSchema,
199
+ });
168
200
  export const DocumentTypeListQuerySchema = z.object({
169
201
  cursor: z.string().uuid().optional(),
170
202
  limit: z.coerce.number().int().min(1).max(100).default(50),
@@ -172,7 +204,11 @@ export const DocumentTypeListQuerySchema = z.object({
172
204
  /** S366 (spec D8): a listed document type and the plugin that provided it
173
205
  * (its plugin_document_types row), null for the operator's own, so the admin
174
206
  * can say which plugin a type came from before it is deleted. */
175
- const OWNED_BY = { ownedBy: z.string().min(1).nullable() };
207
+ const OWNED_BY = {
208
+ ownedBy: z.string().min(1).nullable(),
209
+ // M33 core (M14 callers): the row version read with the type, sent back on the PUT.
210
+ version: DocumentTypeVersionSchema,
211
+ };
176
212
  const [PAGE_TYPE, ELEMENT_TYPE, MEDIA_TYPE] = DocumentTypeDefinitionSchema.options;
177
213
  export const DocumentTypeListItemSchema = z.discriminatedUnion("kind", [
178
214
  PAGE_TYPE.extend(OWNED_BY),
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ export declare const HelpForAiSchema: z.ZodString;
2
3
  export declare const FieldValidationSchema: z.ZodObject<{
3
4
  required: z.ZodOptional<z.ZodBoolean>;
4
5
  minLength: z.ZodOptional<z.ZodNumber>;
@@ -27,13 +28,20 @@ export declare const FieldDefinitionSchema: z.ZodObject<{
27
28
  }, z.core.$strict>>;
28
29
  tabId: z.ZodOptional<z.ZodString>;
29
30
  varies: z.ZodOptional<z.ZodBoolean>;
31
+ help: z.ZodOptional<z.ZodString>;
32
+ private: z.ZodOptional<z.ZodBoolean>;
30
33
  }, z.core.$strict>;
31
34
  export type FieldDefinition = z.infer<typeof FieldDefinitionSchema>;
35
+ export declare function privateFieldIds(fields: readonly FieldDefinition[]): Set<string>;
36
+ export declare function publicFieldData<T>(fields: readonly FieldDefinition[], data: Record<string, T>): Record<string, T>;
37
+ export declare const TreeTypeRuleSchema: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
38
+ export type TreeTypeRule = z.infer<typeof TreeTypeRuleSchema>;
32
39
  export declare const TreeRulesSchema: z.ZodObject<{
33
40
  allowedAtRoot: z.ZodBoolean;
34
- allowedParentTypes: z.ZodArray<z.ZodString>;
35
- allowedChildTypes: z.ZodArray<z.ZodString>;
36
- }, z.core.$strip>;
41
+ allowedParents: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
42
+ allowedChildren: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
43
+ }, z.core.$strict>;
44
+ export declare function treeTypeRuleAllows(rule: TreeTypeRule, documentTypeId: string): boolean;
37
45
  export type TreeRules = z.infer<typeof TreeRulesSchema>;
38
46
  export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
39
47
  id: z.ZodString;
@@ -54,19 +62,23 @@ export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.Zo
54
62
  }, z.core.$strict>>;
55
63
  tabId: z.ZodOptional<z.ZodString>;
56
64
  varies: z.ZodOptional<z.ZodBoolean>;
65
+ help: z.ZodOptional<z.ZodString>;
66
+ private: z.ZodOptional<z.ZodBoolean>;
57
67
  }, z.core.$strict>>;
58
68
  treeRules: z.ZodObject<{
59
69
  allowedAtRoot: z.ZodBoolean;
60
- allowedParentTypes: z.ZodArray<z.ZodString>;
61
- allowedChildTypes: z.ZodArray<z.ZodString>;
62
- }, z.core.$strip>;
70
+ allowedParents: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
71
+ allowedChildren: z.ZodUnion<readonly [z.ZodLiteral<"any">, z.ZodArray<z.ZodString>]>;
72
+ }, z.core.$strict>;
63
73
  tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
64
74
  id: z.ZodString;
65
75
  name: z.ZodString;
66
76
  }, z.core.$strict>>>;
77
+ help: z.ZodOptional<z.ZodString>;
67
78
  defaultTemplateId: z.ZodOptional<z.ZodString>;
68
79
  translationMandatory: z.ZodOptional<z.ZodBoolean>;
69
80
  collection: z.ZodOptional<z.ZodBoolean>;
81
+ retiredPrivateFieldIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
82
  }, z.core.$strict>, z.ZodObject<{
71
83
  id: z.ZodString;
72
84
  name: z.ZodString;
@@ -86,11 +98,14 @@ export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.Zo
86
98
  }, z.core.$strict>>;
87
99
  tabId: z.ZodOptional<z.ZodString>;
88
100
  varies: z.ZodOptional<z.ZodBoolean>;
101
+ help: z.ZodOptional<z.ZodString>;
102
+ private: z.ZodOptional<z.ZodBoolean>;
89
103
  }, z.core.$strict>>;
90
104
  tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
91
105
  id: z.ZodString;
92
106
  name: z.ZodString;
93
107
  }, z.core.$strict>>>;
108
+ help: z.ZodOptional<z.ZodString>;
94
109
  }, z.core.$strict>, z.ZodObject<{
95
110
  id: z.ZodString;
96
111
  name: z.ZodString;
@@ -110,11 +125,14 @@ export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.Zo
110
125
  }, z.core.$strict>>;
111
126
  tabId: z.ZodOptional<z.ZodString>;
112
127
  varies: z.ZodOptional<z.ZodBoolean>;
128
+ help: z.ZodOptional<z.ZodString>;
129
+ private: z.ZodOptional<z.ZodBoolean>;
113
130
  }, z.core.$strict>>;
114
131
  tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
115
132
  id: z.ZodString;
116
133
  name: z.ZodString;
117
134
  }, z.core.$strict>>>;
135
+ help: z.ZodOptional<z.ZodString>;
118
136
  sortOrder: z.ZodOptional<z.ZodNumber>;
119
137
  catchAll: z.ZodOptional<z.ZodBoolean>;
120
138
  }, z.core.$strict>], "kind">;
@@ -1,4 +1,11 @@
1
1
  import { z } from "zod";
2
+ import { CONTENT_LIST_FIELD_ID_MAX } from "./content-list.schema.js";
3
+ import { CONTENT_NAME_KEY } from "./content-path.js";
4
+ import { MCP_HELP_MAX_CHARS } from "./mcp-tool-inputs.schema.js";
5
+ // M31.5 B (D9): the owner's short note to an AI assistant on a type or a field, read by
6
+ // list_page_types and kardalum://types. The management API and the admin carry it; the
7
+ // delivery API and GraphQL never do (it is an instruction to the AI, not site content).
8
+ export const HelpForAiSchema = z.string().max(MCP_HELP_MAX_CHARS);
2
9
  // Basic, generic validation rules (Session 34): required applies to any
3
10
  // datatype; minLength/maxLength are meaningful for text-like datatypes,
4
11
  // min/max for numeric ones. Not cross-checked against datatypeId here
@@ -42,7 +49,10 @@ export const TabDefinitionSchema = z
42
49
  // renaming a field's display name later never orphans existing content.
43
50
  export const FieldDefinitionSchema = z
44
51
  .object({
45
- id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
52
+ // M32 L3: at most CONTENT_LIST_FIELD_ID_MAX, so every field can be named in a content list's `fields`
53
+ // (before version 1: no stored id is longer, no backfill). The length is checked first and aborts, so the
54
+ // pattern never runs over a long value.
55
+ id: z.string().max(CONTENT_LIST_FIELD_ID_MAX, { abort: true }).regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
46
56
  name: z.string().min(1),
47
57
  // References a DataTypeConfig.id (a named, configured Data Type,
48
58
  // see data-type-config.schema.ts), NOT a registry editor id, as of
@@ -66,14 +76,76 @@ export const FieldDefinitionSchema = z
66
76
  // invariant, so every existing value stays in content_versions.data
67
77
  // and culture_data stays null until someone ticks this box.
68
78
  varies: z.boolean().optional(),
79
+ // M31.5 B (D9): stored inside the fields JSON column, so no migration.
80
+ help: HelpForAiSchema.optional(),
81
+ // M32 J (J7): never served outside the management API: the delivery API, GraphQL, templates,
82
+ // the search feed and a plugin's published reads leave it out. Stored inside the fields JSON
83
+ // column, so no migration.
84
+ private: z.boolean().optional(),
69
85
  })
70
86
  .strict();
71
- export const TreeRulesSchema = z.object({
87
+ // M32 J (J7): the ids of the fields an administrator marked private.
88
+ export function privateFieldIds(fields) {
89
+ const ids = new Set();
90
+ for (const field of fields)
91
+ if (field.private === true)
92
+ ids.add(field.id);
93
+ return ids;
94
+ }
95
+ // M32 J (J7, fix wave): the values a public read may serve: the reserved name key and the keys of
96
+ // the fields the type declares now, less its private ones. A key the type no longer declares (a field
97
+ // removed, or a field whose key was renamed) is never served: content is never rewritten, so every
98
+ // stored version still holds the old key's value, and a private field removed or renamed would
99
+ // otherwise be published by its removal. The same object when nothing is left out, so a public read
100
+ // of a type with nothing to leave out costs nothing.
101
+ export function publicFieldData(fields, data) {
102
+ const served = new Set([CONTENT_NAME_KEY]);
103
+ for (const field of fields)
104
+ if (field.private !== true)
105
+ served.add(field.id);
106
+ let dropped = false;
107
+ for (const key of Object.keys(data)) {
108
+ if (!served.has(key)) {
109
+ dropped = true;
110
+ break;
111
+ }
112
+ }
113
+ if (!dropped)
114
+ return data;
115
+ const kept = {};
116
+ for (const [key, value] of Object.entries(data))
117
+ if (served.has(key))
118
+ kept[key] = value;
119
+ return kept;
120
+ }
121
+ // What a page type may sit under, or hold, spelled one way per choice:
122
+ // "any" any page type
123
+ // [] none (no page type at all)
124
+ // ["<id>", ...] only these page types
125
+ // "any" is spelled out because an empty list means none: an empty list that
126
+ // meant "any" would make "none" impossible to say. In a plugin manifest the
127
+ // list holds type names, which become ids once the types are installed.
128
+ export const TreeTypeRuleSchema = z.union([z.literal("any"), z.array(z.string().min(1))]);
129
+ export const TreeRulesSchema = z
130
+ .object({
72
131
  allowedAtRoot: z.boolean(),
73
- // Empty array = any page type allowed, per the Document Types section.
74
- allowedParentTypes: z.array(z.string()),
75
- allowedChildTypes: z.array(z.string()),
132
+ allowedParents: TreeTypeRuleSchema,
133
+ allowedChildren: TreeTypeRuleSchema,
134
+ })
135
+ .strict()
136
+ .superRefine((rules, ctx) => {
137
+ // Allowed at no top level and under no parent: could never hold content.
138
+ if (!rules.allowedAtRoot && Array.isArray(rules.allowedParents) && rules.allowedParents.length === 0) {
139
+ ctx.addIssue({
140
+ code: z.ZodIssueCode.custom,
141
+ message: "A page type must be allowed at the top level or under at least one parent type",
142
+ path: ["allowedParents"],
143
+ });
144
+ }
76
145
  });
146
+ export function treeTypeRuleAllows(rule, documentTypeId) {
147
+ return rule === "any" || rule.includes(documentTypeId);
148
+ }
77
149
  // .strict() on every branch: an 'element' payload carrying treeRules is
78
150
  // a clear validation error, not silently stripped: treeRules genuinely
79
151
  // doesn't apply to element kind, not just hidden in the UI. `tabs` is
@@ -93,6 +165,8 @@ export const DocumentTypeDefinitionSchema = z.discriminatedUnion("kind", [
93
165
  fields: z.array(FieldDefinitionSchema),
94
166
  treeRules: TreeRulesSchema,
95
167
  tabs: z.array(TabDefinitionSchema).default([]),
168
+ // M31.5 B (D9): document_types.help (migration 0034).
169
+ help: HelpForAiSchema.optional(),
96
170
  // Set via a dedicated pointer-update endpoint, never at create time,
97
171
  // a template can't exist before its document type does. Presence/
98
172
  // absence only gates future rendering, never tree placement.
@@ -105,6 +179,13 @@ export const DocumentTypeDefinitionSchema = z.discriminatedUnion("kind", [
105
179
  // Children tab in the editor instead. 'element' kind has no tree
106
180
  // presence at all, so this is page-only, same reasoning as treeRules.
107
181
  collection: z.boolean().optional(),
182
+ // M32 J (fix wave 2): the keys of fields this type once marked private
183
+ // (document_types.retired_private_field_ids, migration 0038). Written by
184
+ // the server only: no create or update request carries it. A save that
185
+ // serves one of these keys again is refused until the request confirms
186
+ // it (UpdateDocumentTypeRequest.confirmPublicFieldIds), because every
187
+ // stored version still holds what the private field held.
188
+ retiredPrivateFieldIds: z.array(z.string().min(1)).optional(),
108
189
  })
109
190
  .strict(),
110
191
  z
@@ -117,6 +198,8 @@ export const DocumentTypeDefinitionSchema = z.discriminatedUnion("kind", [
117
198
  kind: z.literal("element"),
118
199
  fields: z.array(FieldDefinitionSchema),
119
200
  tabs: z.array(TabDefinitionSchema).default([]),
201
+ // M31.5 B (D9): document_types.help (migration 0034).
202
+ help: HelpForAiSchema.optional(),
120
203
  })
121
204
  .strict(),
122
205
  // S234a: a media document type. Media items reuse fields, data types,
@@ -134,6 +217,8 @@ export const DocumentTypeDefinitionSchema = z.discriminatedUnion("kind", [
134
217
  kind: z.literal("media"),
135
218
  fields: z.array(FieldDefinitionSchema),
136
219
  tabs: z.array(TabDefinitionSchema).default([]),
220
+ // M31.5 B (D9): document_types.help (migration 0034).
221
+ help: HelpForAiSchema.optional(),
137
222
  // S234a: which type claims an uploaded file when more than one
138
223
  // accepts its extension. Lower sorts first; the catch-all is forced
139
224
  // last whatever its number says.
@@ -0,0 +1,23 @@
1
+ export declare const FORM_PROTECTION_HIDDEN_FIELD = "kp_website";
2
+ export declare const FORM_PROTECTION_TOKEN_FIELD = "kp_token";
3
+ export declare const FORM_PROTECTION_MIN_SECONDS = 3;
4
+ export declare const FORM_PROTECTION_TOKEN_MAX_AGE_SECONDS = 86400;
5
+ export declare const FORM_PROTECTION_TOKEN_FUTURE_SECONDS = 60;
6
+ export declare const FORM_PROTECTION_TOKEN_MAX = 256;
7
+ export declare const FORM_PROTECTION_WINDOW_SECONDS = 600;
8
+ export declare const FORM_PROTECTION_MAX_PER_WINDOW = 5;
9
+ export declare const FORM_PROTECTION_MAX_KEYS = 10000;
10
+ export declare const FORM_PROTECTION_SWEEP_THRESHOLD = 1000;
11
+ /**
12
+ * What `context.protectionFields()` answers a front end the site builds itself (M32 F, D21): the
13
+ * hidden field's and the time token's names, a fresh token, and `minSeconds`, the built-in check's
14
+ * live minimum time from Server settings (`FORM_PROTECTION_MIN_SECONDS` by default): a send carrying
15
+ * the token sooner than that is refused as too fast, silently, so a front end waits at least so long
16
+ * after reading it (M33 Forms review).
17
+ */
18
+ export interface ProtectionFields {
19
+ hiddenField: string;
20
+ tokenField: string;
21
+ token: string;
22
+ minSeconds: number;
23
+ }
@@ -0,0 +1,12 @@
1
+ // M32 F (D19 to D23): the built-in form protection's fixed values, read by the server's
2
+ // protection point, the {% form_protection %} tag and the docs. Not settings in F.
3
+ export const FORM_PROTECTION_HIDDEN_FIELD = "kp_website";
4
+ export const FORM_PROTECTION_TOKEN_FIELD = "kp_token";
5
+ export const FORM_PROTECTION_MIN_SECONDS = 3;
6
+ export const FORM_PROTECTION_TOKEN_MAX_AGE_SECONDS = 86_400;
7
+ export const FORM_PROTECTION_TOKEN_FUTURE_SECONDS = 60;
8
+ export const FORM_PROTECTION_TOKEN_MAX = 256;
9
+ export const FORM_PROTECTION_WINDOW_SECONDS = 600;
10
+ export const FORM_PROTECTION_MAX_PER_WINDOW = 5;
11
+ export const FORM_PROTECTION_MAX_KEYS = 10_000;
12
+ export const FORM_PROTECTION_SWEEP_THRESHOLD = 1_000;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The deepest an introspection subtree (below a root `__schema` or `__type`) may reach, counted
3
+ * through fragment spreads, when the configured query depth is lower. GraphiQL's standard
4
+ * introspection query reaches 15.
5
+ */
6
+ export declare const GRAPHQL_INTROSPECTION_DEPTH_MAX = 16;
7
+ /**
8
+ * The most lexical tokens a GraphQL document may hold; the parser stops past it. The standard
9
+ * introspection query is 163 tokens (184 with every option), and the largest query the server's
10
+ * own tests send is 843.
11
+ */
12
+ export declare const GRAPHQL_DOCUMENT_TOKENS_MAX = 10000;
@@ -0,0 +1,14 @@
1
+ // M32 I3 (B12 fix): limits of the delivery API's GraphQL endpoint that hold whatever the operator
2
+ // sets for depth and complexity.
3
+ /**
4
+ * The deepest an introspection subtree (below a root `__schema` or `__type`) may reach, counted
5
+ * through fragment spreads, when the configured query depth is lower. GraphiQL's standard
6
+ * introspection query reaches 15.
7
+ */
8
+ export const GRAPHQL_INTROSPECTION_DEPTH_MAX = 16;
9
+ /**
10
+ * The most lexical tokens a GraphQL document may hold; the parser stops past it. The standard
11
+ * introspection query is 163 tokens (184 with every option), and the largest query the server's
12
+ * own tests send is 843.
13
+ */
14
+ export const GRAPHQL_DOCUMENT_TOKENS_MAX = 10_000;
@@ -0,0 +1,23 @@
1
+ import type { HeldEmbedKind } from "./plugin-held-embeds.js";
2
+ /** The mark the core replaces with the provider's name. */
3
+ export declare const HELD_EMBED_PROVIDER_MARK = "{provider}";
4
+ /** The languages the words exist in; a page in any other language shows the English words. */
5
+ export declare const HELD_EMBED_WORDS_LANGUAGES: readonly ["en", "de", "ar"];
6
+ export type HeldEmbedWordsLanguage = (typeof HELD_EMBED_WORDS_LANGUAGES)[number];
7
+ /** The words of one placeholder: the notice, the button and the privacy link's text. */
8
+ export interface HeldEmbedWordSet {
9
+ notice: string;
10
+ show: string;
11
+ privacy: string;
12
+ }
13
+ type WordsVersion = Readonly<Record<HeldEmbedKind, Readonly<Record<HeldEmbedWordsLanguage, HeldEmbedWordSet>>>>;
14
+ /** The version the core writes today. */
15
+ export declare const HELD_EMBED_WORDS_VERSION = 1;
16
+ /** Every version ever written, by number. Never edit a version: add the next one. */
17
+ export declare const HELD_EMBED_WORDS: Readonly<Record<number, WordsVersion>>;
18
+ /** The current words for a kind in a render's culture, with the version and the language they are in. */
19
+ export declare function heldEmbedWords(kind: HeldEmbedKind, culture: string | null | undefined): HeldEmbedWordSet & {
20
+ version: number;
21
+ language: HeldEmbedWordsLanguage;
22
+ };
23
+ export {};
@@ -0,0 +1,70 @@
1
+ // M33 K42 (Google Maps 2.10 C1 item 7, 3.5 A): the words the core writes in a held content
2
+ // placeholder, shown to every visitor of a site that uses held content before anything is
3
+ // fetched from the other site. They are a notice with privacy effect, so they are versioned like
4
+ // a consent text: every version is kept, a rewording adds a version and never edits one, and the
5
+ // placeholder carries the version it shows (`data-kardalum-embed-words`). German is written first
6
+ // (the legal-drafting rule), then English and Arabic; all three are drafts the operator approves
7
+ // with the other strings before release. The lawyer's questions are in the month's review file,
8
+ // never here.
9
+ //
10
+ // `{provider}` stands for the declared provider's name in the page's language; the core writes it
11
+ // escaped, inside `<bdi>`, so a Latin name reads correctly in an Arabic sentence. The words hold
12
+ // no markup.
13
+ /** The mark the core replaces with the provider's name. */
14
+ export const HELD_EMBED_PROVIDER_MARK = "{provider}";
15
+ /** The languages the words exist in; a page in any other language shows the English words. */
16
+ export const HELD_EMBED_WORDS_LANGUAGES = ["en", "de", "ar"];
17
+ /** The version the core writes today. */
18
+ export const HELD_EMBED_WORDS_VERSION = 1;
19
+ /** Every version ever written, by number. Never edit a version: add the next one. */
20
+ export const HELD_EMBED_WORDS = {
21
+ 1: {
22
+ map: {
23
+ de: {
24
+ notice: "Diese Karte stammt von {provider}. Wenn Sie sie anzeigen, erhält {provider} Ihre IP-Adresse und die Adresse dieser Website und kann Informationen auf Ihrem Gerät speichern oder auslesen.",
25
+ show: "Karte anzeigen",
26
+ privacy: "Datenschutzhinweise von {provider}",
27
+ },
28
+ en: {
29
+ notice: "This map comes from {provider}. If you show it, {provider} receives your IP address and the address of this website, and may store or read information on your device.",
30
+ show: "Show the map",
31
+ privacy: "Privacy notice of {provider}",
32
+ },
33
+ ar: {
34
+ notice: "تأتي هذه الخريطة من {provider}. إذا عرضتها، يتلقى {provider} عنوان IP الخاص بك وعنوان هذا الموقع، وقد يخزّن معلومات على جهازك أو يقرؤها.",
35
+ show: "عرض الخريطة",
36
+ privacy: "إشعار الخصوصية لدى {provider}",
37
+ },
38
+ },
39
+ content: {
40
+ de: {
41
+ notice: "Dieser Inhalt stammt von {provider}. Wenn Sie ihn anzeigen, erhält {provider} Ihre IP-Adresse und die Adresse dieser Website und kann Informationen auf Ihrem Gerät speichern oder auslesen.",
42
+ show: "Inhalt anzeigen",
43
+ privacy: "Datenschutzhinweise von {provider}",
44
+ },
45
+ en: {
46
+ notice: "This content comes from {provider}. If you show it, {provider} receives your IP address and the address of this website, and may store or read information on your device.",
47
+ show: "Show the content",
48
+ privacy: "Privacy notice of {provider}",
49
+ },
50
+ ar: {
51
+ notice: "يأتي هذا المحتوى من {provider}. إذا عرضته، يتلقى {provider} عنوان IP الخاص بك وعنوان هذا الموقع، وقد يخزّن معلومات على جهازك أو يقرؤها.",
52
+ show: "عرض المحتوى",
53
+ privacy: "إشعار الخصوصية لدى {provider}",
54
+ },
55
+ },
56
+ },
57
+ };
58
+ /** The language part of a culture ("de" of "de-AT"), lower case, when the words exist in it; else English. */
59
+ function wordsLanguageOf(culture) {
60
+ if (typeof culture !== "string")
61
+ return "en";
62
+ const dash = culture.indexOf("-");
63
+ const part = (dash === -1 ? culture : culture.slice(0, dash)).toLowerCase();
64
+ return HELD_EMBED_WORDS_LANGUAGES.includes(part) ? part : "en";
65
+ }
66
+ /** The current words for a kind in a render's culture, with the version and the language they are in. */
67
+ export function heldEmbedWords(kind, culture) {
68
+ const language = wordsLanguageOf(culture);
69
+ return { ...HELD_EMBED_WORDS[HELD_EMBED_WORDS_VERSION][kind][language], version: HELD_EMBED_WORDS_VERSION, language };
70
+ }