@kardalum/plugin-sdk 0.15.0 → 0.17.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 (204) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +10 -0
  3. package/dist/admin-section-registry.d.ts +14 -5
  4. package/dist/admin-section-registry.js +14 -4
  5. package/dist/built-in-value-schemas.js +1 -1
  6. package/dist/built-ins.js +2 -2
  7. package/dist/capabilities.d.ts +8 -78
  8. package/dist/capabilities.js +23 -322
  9. package/dist/host-entry.d.ts +1 -1
  10. package/dist/host-entry.js +1 -1
  11. package/dist/index.d.ts +5 -5
  12. package/dist/index.js +13 -12
  13. package/dist/license-verdict-keys.d.ts +4 -3
  14. package/dist/license-verdict-keys.js +6 -5
  15. package/dist/manifest-entry.d.ts +3 -3
  16. package/dist/manifest-entry.js +2 -2
  17. package/dist/manifest-schema.d.ts +113 -56
  18. package/dist/manifest-schema.js +192 -295
  19. package/dist/manifest.d.ts +145 -112
  20. package/dist/manifest.js +13 -36
  21. package/dist/media/media-picker.js +21 -12
  22. package/dist/media/upload-error.d.ts +1 -1
  23. package/dist/media/upload-error.js +1 -1
  24. package/dist/plugin-context.d.ts +7 -0
  25. package/dist/plugin-context.js +7 -0
  26. package/dist/plugin-screen-context.d.ts +44 -3
  27. package/dist/plugin-screen-context.js +27 -2
  28. package/dist/read-all-pages.d.ts +23 -0
  29. package/dist/read-all-pages.js +30 -0
  30. package/dist/richtext/block-panel.js +6 -6
  31. package/dist/richtext/insert-menu.js +4 -4
  32. package/dist/richtext/style-listbox.js +4 -4
  33. package/dist/tokens/tokens.css +1 -0
  34. package/dist/tokens/tokens.json +2 -1
  35. package/dist/type-equality.d.ts +2 -0
  36. package/dist/type-equality.js +1 -0
  37. package/dist/views/content-list-view.js +2 -2
  38. package/dist/views/html-view.js +1 -1
  39. package/dist/views/image-view.js +24 -39
  40. package/dist/views/rich-text-view.js +3 -3
  41. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +12 -0
  42. package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +19 -0
  43. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +43 -25
  44. package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +60 -8
  45. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +90 -0
  46. package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +33 -2
  47. package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +22 -1
  48. package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +50 -15
  49. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.d.ts +204 -0
  50. package/node_modules/@kardalum/api-schemas/dist/audit-api.schema.js +134 -0
  51. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +5 -0
  52. package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +18 -13
  53. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +2 -2
  54. package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +1 -1
  55. package/node_modules/@kardalum/api-schemas/dist/content-path.js +11 -7
  56. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +4 -0
  57. package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -0
  58. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +1 -0
  59. package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +2 -1
  60. package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +143 -57
  61. package/node_modules/@kardalum/api-schemas/dist/core-actions.js +110 -60
  62. package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +1 -0
  63. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +2 -0
  64. package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +1 -1
  65. package/node_modules/@kardalum/api-schemas/dist/index.d.ts +67 -40
  66. package/node_modules/@kardalum/api-schemas/dist/index.js +35 -19
  67. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.d.ts +4 -0
  68. package/node_modules/@kardalum/api-schemas/dist/install-warnings.schema.js +8 -0
  69. package/node_modules/@kardalum/api-schemas/dist/issue-list.d.ts +6 -0
  70. package/node_modules/@kardalum/api-schemas/dist/issue-list.js +6 -0
  71. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.d.ts +73 -0
  72. package/node_modules/@kardalum/api-schemas/dist/management-multipart.schema.js +104 -0
  73. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +356 -16
  74. package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +93 -10
  75. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +10 -0
  76. package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +38 -30
  77. package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +2 -2
  78. package/node_modules/@kardalum/api-schemas/dist/media.schema.js +1 -1
  79. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +6 -2
  80. package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +8 -6
  81. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +69 -4
  82. package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +4 -0
  83. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +76 -9
  84. package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +84 -24
  85. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +17 -7
  86. package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +18 -8
  87. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.d.ts +69 -0
  88. package/node_modules/@kardalum/api-schemas/dist/plugin-install-record.schema.js +59 -0
  89. package/node_modules/@kardalum/api-schemas/dist/plugin-install.d.ts +597 -0
  90. package/node_modules/@kardalum/api-schemas/dist/plugin-install.js +503 -0
  91. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.d.ts +60 -0
  92. package/node_modules/@kardalum/api-schemas/dist/plugin-labels.js +116 -0
  93. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.d.ts +82 -0
  94. package/node_modules/@kardalum/api-schemas/dist/plugin-locales.js +228 -0
  95. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +33 -4
  96. package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +28 -2
  97. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +11 -3
  98. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +17 -4
  99. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.d.ts +58 -0
  100. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-api-routes.js +198 -0
  101. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.d.ts +64 -0
  102. package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-fields.js +134 -0
  103. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +2 -0
  104. package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +4 -0
  105. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +74 -0
  106. package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +132 -0
  107. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.d.ts +13 -0
  108. package/node_modules/@kardalum/api-schemas/dist/plugin-vocabulary.js +15 -0
  109. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +8 -0
  110. package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -4
  111. package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +4 -4
  112. package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +17 -0
  113. package/node_modules/@kardalum/api-schemas/dist/role.schema.js +13 -0
  114. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.d.ts +44 -0
  115. package/node_modules/@kardalum/api-schemas/dist/sample-content.schema.js +97 -0
  116. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.d.ts +126 -0
  117. package/node_modules/@kardalum/api-schemas/dist/sandbox-attach.schema.js +70 -0
  118. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +36 -6
  119. package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -5
  120. package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +52 -33
  121. package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +195 -56
  122. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +19 -3
  123. package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +16 -0
  124. package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
  125. package/node_modules/@kardalum/api-schemas/dist/strict-url.d.ts +12 -0
  126. package/node_modules/@kardalum/api-schemas/dist/strict-url.js +31 -0
  127. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +105 -1
  128. package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +47 -7
  129. package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +30 -2
  130. package/node_modules/@kardalum/api-schemas/dist/template.schema.js +19 -5
  131. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.d.ts +4 -0
  132. package/node_modules/@kardalum/api-schemas/dist/trash-cursor.schema.js +29 -0
  133. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +15 -3
  134. package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +8 -0
  135. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +19 -0
  136. package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +22 -0
  137. package/node_modules/@kardalum/api-schemas/package.json +2 -2
  138. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -0
  139. package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +2 -0
  140. package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
  141. package/node_modules/@kardalum/design-tokens/dist/tokens.js +3 -0
  142. package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
  143. package/node_modules/@kardalum/design-tokens/dist/types.d.ts +1 -0
  144. package/node_modules/@kardalum/plugin-package/README.md +4 -1
  145. package/node_modules/@kardalum/plugin-package/dist/build-reference.d.ts +96 -0
  146. package/node_modules/@kardalum/plugin-package/dist/build-reference.js +66 -0
  147. package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +103 -0
  148. package/node_modules/@kardalum/plugin-package/dist/capabilities.js +346 -0
  149. package/node_modules/@kardalum/plugin-package/dist/client-bundle.d.ts +4 -0
  150. package/node_modules/@kardalum/plugin-package/dist/client-bundle.js +25 -0
  151. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.d.ts +25 -0
  152. package/node_modules/@kardalum/plugin-package/dist/delivery/archive-names.js +203 -0
  153. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.d.ts +3 -0
  154. package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +73 -0
  155. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +5 -0
  156. package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +60 -0
  157. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.d.ts +1 -0
  158. package/node_modules/@kardalum/plugin-package/dist/delivery/icon-names.generated.js +2052 -0
  159. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.d.ts +2 -0
  160. package/node_modules/@kardalum/plugin-package/dist/delivery/icons.js +51 -0
  161. package/node_modules/@kardalum/plugin-package/dist/delivery/index.d.ts +8 -0
  162. package/node_modules/@kardalum/plugin-package/dist/delivery/index.js +7 -0
  163. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.d.ts +17 -0
  164. package/node_modules/@kardalum/plugin-package/dist/delivery/label-languages.js +119 -0
  165. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +14 -0
  166. package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +21 -0
  167. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.d.ts +5 -0
  168. package/node_modules/@kardalum/plugin-package/dist/delivery/locales.js +148 -0
  169. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.d.ts +5 -0
  170. package/node_modules/@kardalum/plugin-package/dist/delivery/package-files.js +76 -0
  171. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.d.ts +22 -0
  172. package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +133 -0
  173. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.d.ts +3 -0
  174. package/node_modules/@kardalum/plugin-package/dist/delivery/sample-content.js +90 -0
  175. package/node_modules/@kardalum/plugin-package/dist/delivery/support.d.ts +24 -0
  176. package/node_modules/@kardalum/plugin-package/dist/delivery/support.js +55 -0
  177. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +6 -0
  178. package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +158 -0
  179. package/node_modules/@kardalum/plugin-package/dist/delivery/types.d.ts +53 -0
  180. package/node_modules/@kardalum/plugin-package/dist/delivery/types.js +1 -0
  181. package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +3 -2
  182. package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +4 -2
  183. package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +92 -3
  184. package/node_modules/@kardalum/plugin-package/dist/extract.js +251 -41
  185. package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -2
  186. package/node_modules/@kardalum/plugin-package/dist/index.js +8 -2
  187. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.d.ts +5 -0
  188. package/node_modules/@kardalum/plugin-package/dist/manifest-entry.js +20 -0
  189. package/node_modules/@kardalum/plugin-package/dist/reference-entry.d.ts +3 -0
  190. package/node_modules/@kardalum/plugin-package/dist/reference-entry.js +7 -0
  191. package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +38 -1
  192. package/node_modules/@kardalum/plugin-package/dist/sample-content.js +84 -16
  193. package/node_modules/@kardalum/plugin-package/dist/shipped-files.d.ts +39 -0
  194. package/node_modules/@kardalum/plugin-package/dist/shipped-files.js +133 -0
  195. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.d.ts +7 -0
  196. package/node_modules/@kardalum/plugin-package/dist/shipped-locales.js +27 -0
  197. package/node_modules/@kardalum/plugin-package/dist/types.d.ts +4 -6
  198. package/node_modules/@kardalum/plugin-package/dist/types.js +15 -1
  199. package/node_modules/@kardalum/plugin-package/package.json +9 -2
  200. package/node_modules/@kardalum/ui/dist/components/checkbox.js +2 -2
  201. package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +2 -2
  202. package/node_modules/@kardalum/ui/dist/components/property-field.js +4 -1
  203. package/node_modules/@kardalum/ui/package.json +1 -1
  204. package/package.json +6 -6
@@ -1,18 +1,31 @@
1
1
  import { z } from "zod";
2
2
  import { firstSegment, publicPath } from "./content-path.js";
3
3
  // S277d: a site (a top-level node) can have its own domains. Everything
4
- // here is the shape of that record and the rule for one hostname.
5
- /** The longest a hostname may be (RFC 1035), without a trailing dot. */
4
+ // here is the shape of that record and the rule for one domain.
5
+ //
6
+ // S314i: a domain is a host with an optional port and an optional scheme,
7
+ // stored as one string `[scheme://]host[:port]`. The admin's field, the
8
+ // route that writes the record, the server's match and the public lookup
9
+ // by address all read it through `parseSiteDomain`, so one rule decides.
10
+ /** The longest a host name may be (RFC 1035), without a trailing dot. */
6
11
  const MAX_HOSTNAME_LENGTH = 253;
7
- /** The longest one label of a hostname may be. */
12
+ /** The longest one label of a host name may be. */
8
13
  const MAX_LABEL_LENGTH = 63;
9
14
  /**
10
- * The longest input that is looked at at all. Twice the longest hostname
11
- * leaves room for surrounding whitespace and the trailing dot; anything
12
- * longer is refused before a single character is read, so a hostile input
13
- * costs the same whatever its length.
15
+ * The longest input that is looked at at all. Twice the longest host name
16
+ * leaves room for a scheme, a port, surrounding whitespace, a trailing dot
17
+ * and a trailing slash; anything longer is refused before a single
18
+ * character is read, so a hostile input costs the same whatever its length.
14
19
  */
15
- const MAX_HOSTNAME_INPUT_LENGTH = MAX_HOSTNAME_LENGTH * 2;
20
+ const MAX_SITE_DOMAIN_INPUT_LENGTH = MAX_HOSTNAME_LENGTH * 2;
21
+ /** The highest port there is. */
22
+ const MAX_PORT = 65535;
23
+ /** "65535" has five digits. */
24
+ const MAX_PORT_DIGITS = 5;
25
+ /** The highest value of one part of an IPv4 address. */
26
+ const MAX_OCTET = 255;
27
+ /** The port a browser leaves out of the Host for each scheme. */
28
+ const DEFAULT_PORT = { http: 80, https: 443 };
16
29
  const CODE_0 = 48;
17
30
  const CODE_9 = 57;
18
31
  const CODE_UPPER_A = 65;
@@ -22,6 +35,8 @@ const CODE_LOWER_Z = 122;
22
35
  const CODE_DASH = 45;
23
36
  const CODE_UPPER_X = 88;
24
37
  const CODE_LOWER_X = 120;
38
+ /** Upper case to lower case, for A-Z. */
39
+ const ASCII_CASE_OFFSET = 32;
25
40
  function isDigit(code) {
26
41
  return code >= CODE_0 && code <= CODE_9;
27
42
  }
@@ -31,39 +46,71 @@ function isLabelCharacter(code) {
31
46
  isDigit(code) ||
32
47
  code === CODE_DASH);
33
48
  }
49
+ function isAllDigits(text) {
50
+ if (text.length === 0)
51
+ return false;
52
+ for (let i = 0; i < text.length; i += 1) {
53
+ if (!isDigit(text.charCodeAt(i)))
54
+ return false;
55
+ }
56
+ return true;
57
+ }
34
58
  /**
35
- * Lower-cases, trims, drops one trailing dot. Returns null when the result
36
- * is not a plain hostname (spec D3): one or more labels of a-z, 0-9 and
37
- * "-" joined by dots, no label empty, longer than 63, or starting or
38
- * ending with a dash, the whole name no longer than 253.
59
+ * Whether `text` begins with `prefix` (lower case ASCII) in any letter
60
+ * case. Character by character, so no character outside A-Z is ever
61
+ * folded into one of the prefix's.
62
+ */
63
+ function startsWithIgnoringAsciiCase(text, prefix) {
64
+ if (text.length < prefix.length)
65
+ return false;
66
+ for (let i = 0; i < prefix.length; i += 1) {
67
+ let code = text.charCodeAt(i);
68
+ if (code >= CODE_UPPER_A && code <= CODE_UPPER_Z)
69
+ code += ASCII_CASE_OFFSET;
70
+ if (code !== prefix.charCodeAt(i))
71
+ return false;
72
+ }
73
+ return true;
74
+ }
75
+ /** Four decimal parts, each 0 to 255, none written with a leading zero. */
76
+ function isIpv4(labels) {
77
+ if (labels.length !== 4)
78
+ return false;
79
+ for (const label of labels) {
80
+ if (!isAllDigits(label) || label.length > 3)
81
+ return false;
82
+ if (label.length > 1 && label.charCodeAt(0) === CODE_0)
83
+ return false;
84
+ if (Number(label) > MAX_OCTET)
85
+ return false;
86
+ }
87
+ return true;
88
+ }
89
+ /**
90
+ * Drops one trailing dot and lower-cases. Returns null when the result is
91
+ * neither a host name nor an IPv4 address.
39
92
  *
40
- * So no scheme, port, path, wildcard, user or space gets through: each of
41
- * them needs a character a label cannot hold.
93
+ * A host name is one or more labels of a-z, 0-9 and "-" joined by dots, no
94
+ * label empty, longer than 63, or starting or ending with a dash, the
95
+ * whole name no longer than 253. So no scheme, port, path, wildcard, user
96
+ * or space gets through: each needs a character a label cannot hold.
42
97
  *
43
98
  * An internationalised domain is entered in its ASCII form
44
99
  * ("xn--bcher-kva.example"); a name with a non-ASCII character is refused.
45
100
  * The characters are tested BEFORE lower-casing, because lower-casing can
46
- * turn a character that is not a letter of a hostname into one (U+212A,
101
+ * turn a character that is not a letter of a host name into one (U+212A,
47
102
  * the Kelvin sign, becomes "k"), and two entries would then mean one host.
48
103
  *
49
104
  * A single label such as "localhost" is accepted: a local setup needs it.
50
- * An IP address is refused: a site's domain is a name, and the server's IP
51
- * is an unclaimed address, which shows the default site. A name whose last
52
- * label is a number is how an IPv4 address reads to a browser and to some
53
- * resolvers (the WHATWG URL rule), and a number there is all digits or
54
- * begins with "0x". So a name is refused when its last label is all digits
55
- * or begins with "0x" or "0X", whatever follows: "0x7f000001" is
56
- * 127.0.0.1 to a browser. No registered top-level domain begins that way.
57
- *
58
- * Written with string functions only, behind a length cap, because the
59
- * input is whatever somebody typed or sent: no pattern is ever run over it.
105
+ * An IPv4 address (four parts, each 0 to 255, no leading zero) is accepted
106
+ * (S314i D1). Any other name whose last label is a number is refused: that
107
+ * is how an IPv4 address in another spelling reads to a browser and to
108
+ * some resolvers (the WHATWG URL rule), and a number there is all digits
109
+ * or begins with "0x". So "10.1" and "0x7f000001" are refused, and no
110
+ * registered top-level domain begins that way.
60
111
  */
61
- export function normalizeHostname(input) {
62
- if (typeof input !== "string")
63
- return null;
64
- if (input.length > MAX_HOSTNAME_INPUT_LENGTH)
65
- return null;
66
- let name = input.trim();
112
+ function normalizeHost(input) {
113
+ let name = input;
67
114
  if (name.endsWith("."))
68
115
  name = name.slice(0, -1);
69
116
  if (name.length === 0 || name.length > MAX_HOSTNAME_LENGTH)
@@ -79,15 +126,11 @@ export function normalizeHostname(input) {
79
126
  return null;
80
127
  }
81
128
  }
129
+ // Digits and dots only: nothing to lower-case.
130
+ if (isIpv4(labels))
131
+ return name;
82
132
  const last = labels[labels.length - 1];
83
- let allDigits = true;
84
- for (let i = 0; i < last.length; i += 1) {
85
- if (!isDigit(last.charCodeAt(i))) {
86
- allDigits = false;
87
- break;
88
- }
89
- }
90
- if (allDigits)
133
+ if (isAllDigits(last))
91
134
  return null;
92
135
  // "0x" or "0X" first: a hexadecimal number to the same readers.
93
136
  if (last.charCodeAt(0) === CODE_0 && (last.charCodeAt(1) === CODE_LOWER_X || last.charCodeAt(1) === CODE_UPPER_X)) {
@@ -96,20 +139,116 @@ export function normalizeHostname(input) {
96
139
  // Every character is ASCII by now, so this changes A-Z and nothing else.
97
140
  return name.toLowerCase();
98
141
  }
142
+ /** 1 to 65535, written in digits without a leading zero; null otherwise. */
143
+ function parsePort(text) {
144
+ if (text.length === 0 || text.length > MAX_PORT_DIGITS)
145
+ return null;
146
+ if (!isAllDigits(text) || text.charCodeAt(0) === CODE_0)
147
+ return null;
148
+ const port = Number(text);
149
+ return port >= 1 && port <= MAX_PORT ? port : null;
150
+ }
151
+ /**
152
+ * Reads what a person pastes into a site's domain field (S314i D1):
153
+ * `example.com`, `www.example.com`, `http://example.com`,
154
+ * `https://www.example.com:2136`, `localhost`, `localhost:3000`,
155
+ * `127.0.0.1:3100`, a one-word host, with or without a trailing slash.
156
+ * Trims, takes an `http://` or `https://` in any letter case, drops one
157
+ * trailing slash, then reads `host[:port]`. Returns null for anything else:
158
+ * a path, a query, a fragment, a user, a wildcard, an IPv6 address, another
159
+ * scheme, a port outside 1 to 65535 or written with a leading zero.
160
+ *
161
+ * `www.` is kept as typed: a domain is matched as written. A port equal to
162
+ * the scheme's own (80 for http, 443 for https) is dropped, because a
163
+ * browser never sends it and the domain would otherwise match nothing.
164
+ * Without a scheme, 80 and 443 are both dropped for the same reason, so
165
+ * "example.com:443" is "example.com" and cannot sit beside
166
+ * "https://example.com" on another site. A port that is not the given
167
+ * scheme's own ("http://example.com:443") is kept: a browser sends it.
168
+ *
169
+ * Written with string functions only, behind a length cap, because the
170
+ * input is whatever somebody typed or sent: no pattern is ever run over it.
171
+ */
172
+ export function parseSiteDomain(input) {
173
+ if (typeof input !== "string")
174
+ return null;
175
+ if (input.length > MAX_SITE_DOMAIN_INPUT_LENGTH)
176
+ return null;
177
+ let rest = input.trim();
178
+ let scheme;
179
+ if (startsWithIgnoringAsciiCase(rest, "https://")) {
180
+ scheme = "https";
181
+ rest = rest.slice("https://".length);
182
+ }
183
+ else if (startsWithIgnoringAsciiCase(rest, "http://")) {
184
+ scheme = "http";
185
+ rest = rest.slice("http://".length);
186
+ }
187
+ if (rest.endsWith("/"))
188
+ rest = rest.slice(0, -1);
189
+ let hostText = rest;
190
+ let port;
191
+ const colon = rest.indexOf(":");
192
+ if (colon !== -1) {
193
+ hostText = rest.slice(0, colon);
194
+ const parsed = parsePort(rest.slice(colon + 1));
195
+ if (parsed === null)
196
+ return null;
197
+ port = parsed;
198
+ }
199
+ const host = normalizeHost(hostText);
200
+ if (host === null)
201
+ return null;
202
+ // With a scheme, its own port goes; without one, either goes (S314i C3).
203
+ const isDefaultPort = scheme === undefined ? port === DEFAULT_PORT.http || port === DEFAULT_PORT.https : port === DEFAULT_PORT[scheme];
204
+ if (isDefaultPort)
205
+ port = undefined;
206
+ return { ...(scheme !== undefined ? { scheme } : {}), host, ...(port !== undefined ? { port } : {}) };
207
+ }
208
+ /** The stored string of a domain: `[scheme://]host[:port]`. */
209
+ export function formatSiteDomain(domain) {
210
+ const scheme = domain.scheme === undefined ? "" : `${domain.scheme}://`;
211
+ const port = domain.port === undefined ? "" : `:${domain.port}`;
212
+ return `${scheme}${domain.host}${port}`;
213
+ }
214
+ /**
215
+ * A stored domain without its scheme: `host[:port]`. This is what a domain
216
+ * is matched by and counted by (S314i D2, D3): `http://a.test` and
217
+ * `https://a.test` are one domain. A value with no scheme (the host of
218
+ * KARDALUM_PUBLIC_URL) comes back as it is.
219
+ */
220
+ export function siteDomainAuthority(domain) {
221
+ if (domain.startsWith("https://"))
222
+ return domain.slice("https://".length);
223
+ if (domain.startsWith("http://"))
224
+ return domain.slice("http://".length);
225
+ return domain;
226
+ }
227
+ /**
228
+ * The origin a link or a redirect to a stored domain is written with
229
+ * (S314i D4): the domain as stored when it carries a scheme, otherwise
230
+ * `scheme` (the request's, or KARDALUM_PUBLIC_URL's) in front of it. The
231
+ * port is the stored one, or none.
232
+ */
233
+ export function siteDomainOrigin(domain, scheme) {
234
+ if (domain.startsWith("https://") || domain.startsWith("http://"))
235
+ return domain;
236
+ return `${scheme}://${domain}`;
237
+ }
99
238
  /**
100
- * One domain of a site. Parses through `normalizeHostname`, so the output
101
- * is the stored form: lower-case, no trailing dot.
239
+ * One domain of a site. Parses through `parseSiteDomain`, so the output is
240
+ * the stored form, and a stored domain parses to itself.
102
241
  */
103
- export const HostnameSchema = z.string().transform((value, ctx) => {
104
- const hostname = normalizeHostname(value);
105
- if (hostname === null) {
242
+ export const SiteDomainSchema = z.string().transform((value, ctx) => {
243
+ const domain = parseSiteDomain(value);
244
+ if (domain === null) {
106
245
  ctx.addIssue({
107
246
  code: "custom",
108
- message: 'A domain is a plain host name such as "example.com": no scheme, port, path or wildcard.',
247
+ message: 'A domain is a host name or an IPv4 address, with an optional port and an optional http:// or https:// in front, such as "example.com", "localhost:3000", "127.0.0.1:3100" or "https://www.example.com:2136". A path, a query, a wildcard and an IPv6 address are refused.',
109
248
  });
110
249
  return z.NEVER;
111
250
  }
112
- return hostname;
251
+ return formatSiteDomain(domain);
113
252
  });
114
253
  export const MAX_HOSTNAMES_PER_SITE = 20;
115
254
  /**
@@ -118,7 +257,7 @@ export const MAX_HOSTNAMES_PER_SITE = 20;
118
257
  */
119
258
  export const SiteHostnamesSchema = z.object({
120
259
  siteId: z.string().min(1),
121
- hostnames: z.array(HostnameSchema).max(MAX_HOSTNAMES_PER_SITE),
260
+ hostnames: z.array(SiteDomainSchema).max(MAX_HOSTNAMES_PER_SITE),
122
261
  });
123
262
  /**
124
263
  * The install's sites setting (the `sites` settings row): which top-level
@@ -135,14 +274,14 @@ export const SitesSettingsSchema = z.object({
135
274
  defaultSiteId: z.string().min(1).nullable(),
136
275
  sites: z.array(SiteHostnamesSchema).default([]),
137
276
  });
138
- /** The body of PUT /api/settings/sites/default. Null clears the pin. */
277
+ /** The body of PUT /api/manage/v1/settings/sites/default. Null clears the pin. */
139
278
  export const SetDefaultSiteRequestSchema = z.object({ defaultSiteId: z.string().min(1).nullable() });
140
279
  /**
141
- * The body of PUT /api/settings/sites/:siteId/hostnames: the site's whole
280
+ * The body of PUT /api/manage/v1/settings/sites/:siteId/hostnames: the site's whole
142
281
  * list, in order. An empty list takes every domain off the site.
143
282
  */
144
283
  export const SetSiteHostnamesRequestSchema = z.object({
145
- hostnames: z.array(HostnameSchema).max(MAX_HOSTNAMES_PER_SITE),
284
+ hostnames: z.array(SiteDomainSchema).max(MAX_HOSTNAMES_PER_SITE),
146
285
  });
147
286
  /**
148
287
  * The default site as a visitor meets it: the top-level node whose own
@@ -159,7 +298,7 @@ export const SiteSummarySchema = z.object({
159
298
  isDefault: z.boolean(),
160
299
  });
161
300
  /**
162
- * What GET /api/settings/sites and the two writes answer: the stored pin,
301
+ * What GET /api/manage/v1/settings/sites and the two writes answer: the stored pin,
163
302
  * and beside it the default site that pin (or, with nothing pinned, tree
164
303
  * order) gives a visitor right now. Null when there is none: a pin whose
165
304
  * node is in the trash or not published, or a tree with nothing published.
@@ -169,7 +308,7 @@ export const SiteSummarySchema = z.object({
169
308
  * `sites` is every site that has at least one domain, plus the default
170
309
  * site even when it has none: the stored record, which is what an address
171
310
  * is worked out from. It is bounded by that record and is not a list of
172
- * every top-level page; GET /api/sites is that list. `requestHost` is the
311
+ * every top-level page; GET /api/manage/v1/sites is that list. `requestHost` is the
173
312
  * host the server sees for this very request (spec D10): behind a proxy
174
313
  * that does not pass the domain on it differs from the browser's, and
175
314
  * that is the one place it shows.
@@ -190,9 +329,9 @@ export const SitesSettingsResponseSchema = z.object({
190
329
  defaultAddressHost: z.string().nullable(),
191
330
  });
192
331
  /**
193
- * The query of GET /api/sites. The cursor is the id of the previous page's
332
+ * The query of GET /api/manage/v1/sites. The cursor is the id of the previous page's
194
333
  * last row, the convention of the content tree's own lists
195
- * (GET /api/content/roots).
334
+ * (GET /api/manage/v1/content/roots).
196
335
  */
197
336
  export const SiteListQuerySchema = z.object({
198
337
  cursor: z.string().uuid().optional(),
@@ -213,7 +352,7 @@ export const SiteListRowSchema = z.object({
213
352
  isDefault: z.boolean(),
214
353
  published: z.boolean(),
215
354
  });
216
- /** What GET /api/sites answers: one page of top-level pages in tree order. */
355
+ /** What GET /api/manage/v1/sites answers: one page of top-level pages in tree order. */
217
356
  export const SiteListResponseSchema = z.object({
218
357
  items: z.array(SiteListRowSchema),
219
358
  // null = no more pages.
@@ -261,7 +400,7 @@ export function siteAddress(site, defaultHost, storedPath, options = {}) {
261
400
  return placeOnSite(site, defaultHost, storedPath, options.shortPathTaken === true);
262
401
  }
263
402
  /**
264
- * The address of a stored path, worked out from what GET /api/settings/sites
403
+ * The address of a stored path, worked out from what GET /api/manage/v1/settings/sites
265
404
  * answers, for a page the server cannot be asked about because nothing is
266
405
  * stored at it yet (a page being created, a name being typed).
267
406
  *
@@ -8,8 +8,8 @@ export declare const SnapshotResponseSchema: z.ZodObject<{
8
8
  snapshot: z.ZodObject<{
9
9
  id: z.ZodString;
10
10
  createdAt: z.ZodString;
11
- label: z.ZodString;
12
11
  createdBy: z.ZodString;
12
+ label: z.ZodString;
13
13
  description: z.ZodNullable<z.ZodString>;
14
14
  }, z.core.$strip>;
15
15
  }, z.core.$strip>;
@@ -23,8 +23,8 @@ export declare const SnapshotListResponseSchema: z.ZodObject<{
23
23
  items: z.ZodArray<z.ZodObject<{
24
24
  id: z.ZodString;
25
25
  createdAt: z.ZodString;
26
- label: z.ZodString;
27
26
  createdBy: z.ZodString;
27
+ label: z.ZodString;
28
28
  description: z.ZodNullable<z.ZodString>;
29
29
  }, z.core.$strip>>;
30
30
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -34,10 +34,26 @@ export declare const RestoreSnapshotResponseSchema: z.ZodObject<{
34
34
  snapshot: z.ZodObject<{
35
35
  id: z.ZodString;
36
36
  createdAt: z.ZodString;
37
- label: z.ZodString;
38
37
  createdBy: z.ZodString;
38
+ label: z.ZodString;
39
39
  description: z.ZodNullable<z.ZodString>;
40
40
  }, z.core.$strip>;
41
41
  restoredItems: z.ZodNumber;
42
42
  }, z.core.$strip>;
43
43
  export type RestoreSnapshotResponse = z.infer<typeof RestoreSnapshotResponseSchema>;
44
+ export declare const RestoreSnapshotRequestSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
45
+ confirm: z.ZodOptional<z.ZodBoolean>;
46
+ }, z.core.$strip>>>;
47
+ export type RestoreSnapshotRequest = NonNullable<z.infer<typeof RestoreSnapshotRequestSchema>>;
48
+ export declare const RestoreSnapshotConfirmationSchema: z.ZodObject<{
49
+ requiresConfirmation: z.ZodLiteral<true>;
50
+ label: z.ZodString;
51
+ itemCount: z.ZodNumber;
52
+ nodeCount: z.ZodNumber;
53
+ message: z.ZodString;
54
+ }, z.core.$strip>;
55
+ export type RestoreSnapshotConfirmation = z.infer<typeof RestoreSnapshotConfirmationSchema>;
56
+ export declare const SnapshotParamsSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ }, z.core.$strip>;
59
+ export type SnapshotParams = z.infer<typeof SnapshotParamsSchema>;
@@ -23,3 +23,19 @@ export const RestoreSnapshotResponseSchema = z.object({
23
23
  // How many content nodes had their pointers repointed.
24
24
  restoredItems: z.number().int().nonnegative(),
25
25
  });
26
+ // S308: restoring a snapshot repoints every captured page at once, so the route
27
+ // asks first. Nullish because Fastify hands a missing body to the validator as
28
+ // null (the note RestoreBodySchema carries); an empty or `confirm: false` body is
29
+ // the unconfirmed call and answers the plan, never the restore.
30
+ export const RestoreSnapshotRequestSchema = z.object({ confirm: z.boolean().optional() }).nullish();
31
+ // The 409 plan. itemCount is the node and culture pairs the restore writes (what
32
+ // restoredItems reports afterwards); nodeCount is the distinct pages among them.
33
+ export const RestoreSnapshotConfirmationSchema = z.object({
34
+ requiresConfirmation: z.literal(true),
35
+ label: z.string(),
36
+ itemCount: z.number().int().nonnegative(),
37
+ nodeCount: z.number().int().nonnegative(),
38
+ message: z.string(),
39
+ });
40
+ // S301: the params of POST /snapshots/:id/restore, moved here from the route file.
41
+ export const SnapshotParamsSchema = z.object({ id: z.string().uuid() });
@@ -23,8 +23,8 @@ export type Snapshot = z.infer<typeof SnapshotSchema>;
23
23
  export declare const SnapshotMetaSchema: z.ZodObject<{
24
24
  id: z.ZodString;
25
25
  createdAt: z.ZodString;
26
- label: z.ZodString;
27
26
  createdBy: z.ZodString;
27
+ label: z.ZodString;
28
28
  description: z.ZodNullable<z.ZodString>;
29
29
  }, z.core.$strip>;
30
30
  export type SnapshotMeta = z.infer<typeof SnapshotMetaSchema>;
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ /** True when the value holds no C0 control character and no DEL. */
3
+ export declare function hasNoControlCharacter(value: string): boolean;
4
+ export interface StrictUrlOptions {
5
+ /** The protocols the URL may name, as zod's URL check takes them (`/^https?$/`). */
6
+ protocol?: RegExp;
7
+ /** The message for a control character and for a value the URL check refuses. */
8
+ error?: string;
9
+ /** The longest value accepted, in characters. */
10
+ max?: number;
11
+ }
12
+ export declare function strictUrl(options?: StrictUrlOptions): z.ZodPipe<z.ZodString, z.ZodURL>;
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ // S314e (spec C6): one strict URL field for every URL the schemas take.
3
+ // Zod's own URL check (zod 4.6) strips a tab or a line break from a value
4
+ // before it parses it, and the WHATWG URL parser does the same, so a value
5
+ // with an embedded or trailing line feed or tab passed the check and reached
6
+ // the caller unchanged. This helper refuses every C0 control character
7
+ // (U+0000 to U+001F) and DEL (U+007F) on the raw string first, then hands the
8
+ // string to zod's URL check. The `format: uri` the URL check would have given
9
+ // the generated document is restated on the input side, where the document
10
+ // generator reads a request body from, and the output side keeps it from the
11
+ // URL check itself.
12
+ /** True when the value holds no C0 control character and no DEL. */
13
+ export function hasNoControlCharacter(value) {
14
+ for (let index = 0; index < value.length; index += 1) {
15
+ const code = value.charCodeAt(index);
16
+ if (code < 0x20 || code === 0x7f)
17
+ return false;
18
+ }
19
+ return true;
20
+ }
21
+ const CONTROL_CHARACTER_MESSAGE = "A URL must not contain control characters";
22
+ export function strictUrl(options = {}) {
23
+ const raw = options.max === undefined ? z.string() : z.string().max(options.max);
24
+ return raw
25
+ .meta({ format: "uri" })
26
+ .refine(hasNoControlCharacter, options.error ?? CONTROL_CHARACTER_MESSAGE)
27
+ .pipe(z.url({
28
+ ...(options.protocol ? { protocol: options.protocol } : {}),
29
+ ...(options.error ? { error: options.error } : {}),
30
+ }));
31
+ }
@@ -79,6 +79,20 @@ export declare const TemplateListQuerySchema: z.ZodObject<{
79
79
  documentTypeId: z.ZodOptional<z.ZodString>;
80
80
  }, z.core.$strip>;
81
81
  export type TemplateListQuery = z.infer<typeof TemplateListQuerySchema>;
82
+ export declare const TemplateListItemSchema: z.ZodObject<{
83
+ id: z.ZodString;
84
+ name: z.ZodString;
85
+ alias: z.ZodString;
86
+ kind: z.ZodEnum<{
87
+ page: "page";
88
+ layout: "layout";
89
+ partial: "partial";
90
+ }>;
91
+ documentTypeId: z.ZodNullable<z.ZodString>;
92
+ currentVersion: z.ZodNumber;
93
+ ownedBy: z.ZodNullable<z.ZodString>;
94
+ }, z.core.$strict>;
95
+ export type TemplateListItem = z.infer<typeof TemplateListItemSchema>;
82
96
  export declare const TemplateListResponseSchema: z.ZodObject<{
83
97
  items: z.ZodArray<z.ZodObject<{
84
98
  id: z.ZodString;
@@ -91,6 +105,7 @@ export declare const TemplateListResponseSchema: z.ZodObject<{
91
105
  }>;
92
106
  documentTypeId: z.ZodNullable<z.ZodString>;
93
107
  currentVersion: z.ZodNumber;
108
+ ownedBy: z.ZodNullable<z.ZodString>;
94
109
  }, z.core.$strict>>;
95
110
  nextCursor: z.ZodNullable<z.ZodString>;
96
111
  }, z.core.$strip>;
@@ -107,6 +122,95 @@ export declare const TemplateSyncReportSchema: z.ZodObject<{
107
122
  version: z.ZodNumber;
108
123
  }, z.core.$strip>>;
109
124
  healed: z.ZodArray<z.ZodString>;
110
- unmatched: z.ZodArray<z.ZodString>;
125
+ adopted: z.ZodArray<z.ZodObject<{
126
+ id: z.ZodString;
127
+ file: z.ZodString;
128
+ alias: z.ZodString;
129
+ kind: z.ZodEnum<{
130
+ page: "page";
131
+ layout: "layout";
132
+ partial: "partial";
133
+ }>;
134
+ }, z.core.$strip>>;
135
+ skipped: z.ZodArray<z.ZodObject<{
136
+ file: z.ZodString;
137
+ reason: z.ZodString;
138
+ }, z.core.$strip>>;
111
139
  }, z.core.$strip>;
112
140
  export type TemplateSyncReport = z.infer<typeof TemplateSyncReportSchema>;
141
+ export declare const TemplateVersionParamsSchema: z.ZodObject<{
142
+ id: z.ZodString;
143
+ version: z.ZodCoercedNumber<unknown>;
144
+ }, z.core.$strip>;
145
+ export type TemplateVersionParams = z.infer<typeof TemplateVersionParamsSchema>;
146
+ export declare const TemplateVersionListResponseSchema: z.ZodObject<{
147
+ items: z.ZodArray<z.ZodObject<{
148
+ id: z.ZodString;
149
+ createdAt: z.ZodString;
150
+ source: z.ZodEnum<{
151
+ admin: "admin";
152
+ "plugin-install": "plugin-install";
153
+ "file-sync": "file-sync";
154
+ }>;
155
+ templateId: z.ZodString;
156
+ version: z.ZodNumber;
157
+ hash: z.ZodString;
158
+ }, z.core.$strict>>;
159
+ nextCursor: z.ZodNullable<z.ZodNumber>;
160
+ }, z.core.$strip>;
161
+ export type TemplateVersionListResponse = z.infer<typeof TemplateVersionListResponseSchema>;
162
+ export declare const TemplateVersionResponseSchema: z.ZodObject<{
163
+ version: z.ZodObject<{
164
+ id: z.ZodString;
165
+ templateId: z.ZodString;
166
+ version: z.ZodNumber;
167
+ content: z.ZodString;
168
+ hash: z.ZodString;
169
+ source: z.ZodEnum<{
170
+ admin: "admin";
171
+ "plugin-install": "plugin-install";
172
+ "file-sync": "file-sync";
173
+ }>;
174
+ createdAt: z.ZodString;
175
+ }, z.core.$strict>;
176
+ }, z.core.$strip>;
177
+ export type TemplateVersionResponse = z.infer<typeof TemplateVersionResponseSchema>;
178
+ export declare const TemplateTrashListQuerySchema: z.ZodObject<{
179
+ cursor: z.ZodOptional<z.ZodString>;
180
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
181
+ }, z.core.$strip>;
182
+ export type TemplateTrashListQuery = z.infer<typeof TemplateTrashListQuerySchema>;
183
+ export declare const TemplateTrashListResponseSchema: z.ZodObject<{
184
+ items: z.ZodArray<z.ZodObject<{
185
+ id: z.ZodString;
186
+ name: z.ZodString;
187
+ alias: z.ZodString;
188
+ kind: z.ZodEnum<{
189
+ page: "page";
190
+ layout: "layout";
191
+ partial: "partial";
192
+ }>;
193
+ documentTypeId: z.ZodNullable<z.ZodString>;
194
+ currentVersion: z.ZodNumber;
195
+ deletedAt: z.ZodString;
196
+ }, z.core.$strict>>;
197
+ nextCursor: z.ZodNullable<z.ZodString>;
198
+ }, z.core.$strip>;
199
+ export type TemplateTrashListResponse = z.infer<typeof TemplateTrashListResponseSchema>;
200
+ export declare const RestoreTemplateResponseSchema: z.ZodObject<{
201
+ template: z.ZodObject<{
202
+ id: z.ZodString;
203
+ name: z.ZodString;
204
+ alias: z.ZodString;
205
+ kind: z.ZodEnum<{
206
+ page: "page";
207
+ layout: "layout";
208
+ partial: "partial";
209
+ }>;
210
+ documentTypeId: z.ZodNullable<z.ZodString>;
211
+ currentVersion: z.ZodNumber;
212
+ }, z.core.$strict>;
213
+ content: z.ZodString;
214
+ foldedFile: z.ZodBoolean;
215
+ }, z.core.$strip>;
216
+ export type RestoreTemplateResponse = z.infer<typeof RestoreTemplateResponseSchema>;