@endora-commerce/contracts 0.106.0 → 0.108.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 (216) hide show
  1. package/dist/admin-contributions.d.ts +11 -6
  2. package/dist/admin-contributions.d.ts.map +1 -1
  3. package/dist/admin-contributions.js +9 -6
  4. package/dist/admin-contributions.js.map +1 -1
  5. package/dist/admin-feedback.d.ts +61 -0
  6. package/dist/admin-feedback.d.ts.map +1 -0
  7. package/dist/admin-feedback.js +71 -0
  8. package/dist/admin-feedback.js.map +1 -0
  9. package/dist/admin-name.d.ts +21 -0
  10. package/dist/admin-name.d.ts.map +1 -0
  11. package/dist/admin-name.js +30 -0
  12. package/dist/admin-name.js.map +1 -0
  13. package/dist/admin-roles.d.ts +32 -2
  14. package/dist/admin-roles.d.ts.map +1 -1
  15. package/dist/admin-roles.js +21 -1
  16. package/dist/admin-roles.js.map +1 -1
  17. package/dist/admin-search.d.ts +655 -0
  18. package/dist/admin-search.d.ts.map +1 -0
  19. package/dist/admin-search.js +179 -0
  20. package/dist/admin-search.js.map +1 -0
  21. package/dist/analytics.d.ts +5 -0
  22. package/dist/analytics.d.ts.map +1 -1
  23. package/dist/analytics.js +8 -0
  24. package/dist/analytics.js.map +1 -1
  25. package/dist/api-keys.d.ts +6 -0
  26. package/dist/api-keys.d.ts.map +1 -1
  27. package/dist/api-keys.js +5 -0
  28. package/dist/api-keys.js.map +1 -1
  29. package/dist/assets-library.d.ts +102 -0
  30. package/dist/assets-library.d.ts.map +1 -1
  31. package/dist/assets-library.js +89 -0
  32. package/dist/assets-library.js.map +1 -1
  33. package/dist/auth.d.ts +20 -0
  34. package/dist/auth.d.ts.map +1 -1
  35. package/dist/auth.js +20 -0
  36. package/dist/auth.js.map +1 -1
  37. package/dist/blog.d.ts +1 -1
  38. package/dist/carts.d.ts +218 -7
  39. package/dist/carts.d.ts.map +1 -1
  40. package/dist/carts.js +29 -0
  41. package/dist/carts.js.map +1 -1
  42. package/dist/catalog.d.ts +299 -14
  43. package/dist/catalog.d.ts.map +1 -1
  44. package/dist/catalog.js +136 -2
  45. package/dist/catalog.js.map +1 -1
  46. package/dist/cms.d.ts +183 -3
  47. package/dist/cms.d.ts.map +1 -1
  48. package/dist/cms.js +132 -1
  49. package/dist/cms.js.map +1 -1
  50. package/dist/common.d.ts +4 -0
  51. package/dist/common.d.ts.map +1 -1
  52. package/dist/common.js +14 -0
  53. package/dist/common.js.map +1 -1
  54. package/dist/comparisons.d.ts +80 -0
  55. package/dist/comparisons.d.ts.map +1 -1
  56. package/dist/comparisons.js +24 -0
  57. package/dist/comparisons.js.map +1 -1
  58. package/dist/credentials.d.ts +23 -0
  59. package/dist/credentials.d.ts.map +1 -1
  60. package/dist/credentials.js +24 -0
  61. package/dist/credentials.js.map +1 -1
  62. package/dist/credit-limits.d.ts.map +1 -1
  63. package/dist/credit-limits.js +3 -2
  64. package/dist/credit-limits.js.map +1 -1
  65. package/dist/crm-rich-text.d.ts +64 -0
  66. package/dist/crm-rich-text.d.ts.map +1 -0
  67. package/dist/crm-rich-text.js +303 -0
  68. package/dist/crm-rich-text.js.map +1 -0
  69. package/dist/crm.d.ts +92 -2
  70. package/dist/crm.d.ts.map +1 -1
  71. package/dist/crm.js +49 -34
  72. package/dist/crm.js.map +1 -1
  73. package/dist/custom-fields.d.ts +417 -4
  74. package/dist/custom-fields.d.ts.map +1 -1
  75. package/dist/custom-fields.js +319 -10
  76. package/dist/custom-fields.js.map +1 -1
  77. package/dist/customer-accounts.d.ts +92 -2
  78. package/dist/customer-accounts.d.ts.map +1 -1
  79. package/dist/document-templates.d.ts +1368 -0
  80. package/dist/document-templates.d.ts.map +1 -0
  81. package/dist/document-templates.js +569 -0
  82. package/dist/document-templates.js.map +1 -0
  83. package/dist/document-values.d.ts +159 -0
  84. package/dist/document-values.d.ts.map +1 -0
  85. package/dist/document-values.js +220 -0
  86. package/dist/document-values.js.map +1 -0
  87. package/dist/errors.d.ts +122 -0
  88. package/dist/errors.d.ts.map +1 -1
  89. package/dist/errors.js +172 -0
  90. package/dist/errors.js.map +1 -1
  91. package/dist/import-export.d.ts +11 -0
  92. package/dist/import-export.d.ts.map +1 -1
  93. package/dist/import-export.js +9 -0
  94. package/dist/import-export.js.map +1 -1
  95. package/dist/index.d.ts +15 -1
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +28 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/invoice-ledger.d.ts +6 -6
  100. package/dist/invoices.d.ts +88 -0
  101. package/dist/invoices.d.ts.map +1 -1
  102. package/dist/invoices.js +19 -4
  103. package/dist/invoices.js.map +1 -1
  104. package/dist/line-groups.d.ts +80 -0
  105. package/dist/line-groups.d.ts.map +1 -0
  106. package/dist/line-groups.js +130 -0
  107. package/dist/line-groups.js.map +1 -0
  108. package/dist/localized-name.d.ts +20 -0
  109. package/dist/localized-name.d.ts.map +1 -0
  110. package/dist/localized-name.js +45 -0
  111. package/dist/localized-name.js.map +1 -0
  112. package/dist/mfa.d.ts +20 -0
  113. package/dist/mfa.d.ts.map +1 -1
  114. package/dist/modules.d.ts +20 -10
  115. package/dist/modules.d.ts.map +1 -1
  116. package/dist/money-decimal.d.ts +162 -0
  117. package/dist/money-decimal.d.ts.map +1 -0
  118. package/dist/money-decimal.js +365 -0
  119. package/dist/money-decimal.js.map +1 -0
  120. package/dist/money-input.d.ts +64 -0
  121. package/dist/money-input.d.ts.map +1 -0
  122. package/dist/money-input.js +111 -0
  123. package/dist/money-input.js.map +1 -0
  124. package/dist/newsletter.d.ts +2 -0
  125. package/dist/newsletter.d.ts.map +1 -1
  126. package/dist/newsletter.js +4 -0
  127. package/dist/newsletter.js.map +1 -1
  128. package/dist/order-minimums.d.ts +111 -0
  129. package/dist/order-minimums.d.ts.map +1 -0
  130. package/dist/order-minimums.js +196 -0
  131. package/dist/order-minimums.js.map +1 -0
  132. package/dist/orders.d.ts +212 -2
  133. package/dist/orders.d.ts.map +1 -1
  134. package/dist/orders.js +124 -21
  135. package/dist/orders.js.map +1 -1
  136. package/dist/organizations.d.ts +78 -0
  137. package/dist/organizations.d.ts.map +1 -1
  138. package/dist/organizations.js +54 -0
  139. package/dist/organizations.js.map +1 -1
  140. package/dist/payment-methods.d.ts +2 -2
  141. package/dist/payment-methods.d.ts.map +1 -1
  142. package/dist/payment-methods.js +2 -1
  143. package/dist/payment-methods.js.map +1 -1
  144. package/dist/price-book-decimal.d.ts +84 -0
  145. package/dist/price-book-decimal.d.ts.map +1 -0
  146. package/dist/price-book-decimal.js +175 -0
  147. package/dist/price-book-decimal.js.map +1 -0
  148. package/dist/price-books.d.ts +2206 -0
  149. package/dist/price-books.d.ts.map +1 -0
  150. package/dist/price-books.js +777 -0
  151. package/dist/price-books.js.map +1 -0
  152. package/dist/price-lists.d.ts +398 -248
  153. package/dist/price-lists.d.ts.map +1 -1
  154. package/dist/price-lists.js +136 -244
  155. package/dist/price-lists.js.map +1 -1
  156. package/dist/product-feeds.d.ts +102 -21
  157. package/dist/product-feeds.d.ts.map +1 -1
  158. package/dist/product-feeds.js +18 -1
  159. package/dist/product-feeds.js.map +1 -1
  160. package/dist/product-value-resolver.d.ts +6 -0
  161. package/dist/product-value-resolver.d.ts.map +1 -1
  162. package/dist/product-value-resolver.js +6 -1
  163. package/dist/product-value-resolver.js.map +1 -1
  164. package/dist/promotions.d.ts +2 -2
  165. package/dist/promotions.d.ts.map +1 -1
  166. package/dist/promotions.js +8 -2
  167. package/dist/promotions.js.map +1 -1
  168. package/dist/prompt-actions.d.ts +25 -6
  169. package/dist/prompt-actions.d.ts.map +1 -1
  170. package/dist/prompt-actions.js +17 -1
  171. package/dist/prompt-actions.js.map +1 -1
  172. package/dist/pwa.d.ts +25 -0
  173. package/dist/pwa.d.ts.map +1 -1
  174. package/dist/pwa.js +38 -0
  175. package/dist/pwa.js.map +1 -1
  176. package/dist/quick-order.d.ts +39 -0
  177. package/dist/quick-order.d.ts.map +1 -1
  178. package/dist/quick-order.js +43 -0
  179. package/dist/quick-order.js.map +1 -1
  180. package/dist/quote-requests.d.ts +903 -9
  181. package/dist/quote-requests.d.ts.map +1 -1
  182. package/dist/quote-requests.js +515 -8
  183. package/dist/quote-requests.js.map +1 -1
  184. package/dist/returns.d.ts +55 -2
  185. package/dist/returns.d.ts.map +1 -1
  186. package/dist/returns.js +39 -4
  187. package/dist/returns.js.map +1 -1
  188. package/dist/sales-channels.d.ts +48 -0
  189. package/dist/sales-channels.d.ts.map +1 -1
  190. package/dist/sales-channels.js +42 -0
  191. package/dist/sales-channels.js.map +1 -1
  192. package/dist/saved-list-views.d.ts +140 -0
  193. package/dist/saved-list-views.d.ts.map +1 -0
  194. package/dist/saved-list-views.js +108 -0
  195. package/dist/saved-list-views.js.map +1 -0
  196. package/dist/search.d.ts +66 -0
  197. package/dist/search.d.ts.map +1 -1
  198. package/dist/search.js +4 -0
  199. package/dist/search.js.map +1 -1
  200. package/dist/seo.d.ts +2 -0
  201. package/dist/seo.d.ts.map +1 -1
  202. package/dist/seo.js +11 -0
  203. package/dist/seo.js.map +1 -1
  204. package/dist/shipping-methods.d.ts +2 -2
  205. package/dist/shipping-methods.d.ts.map +1 -1
  206. package/dist/shipping-methods.js +2 -1
  207. package/dist/shipping-methods.js.map +1 -1
  208. package/dist/shopping-lists.d.ts +24 -0
  209. package/dist/shopping-lists.d.ts.map +1 -1
  210. package/dist/shopping-lists.js +20 -1
  211. package/dist/shopping-lists.js.map +1 -1
  212. package/dist/storefront-value-overrides.d.ts +67 -0
  213. package/dist/storefront-value-overrides.d.ts.map +1 -0
  214. package/dist/storefront-value-overrides.js +93 -0
  215. package/dist/storefront-value-overrides.js.map +1 -0
  216. package/package.json +1 -1
@@ -0,0 +1,1368 @@
1
+ import { z } from 'zod';
2
+ import { type DocumentAlign, type DocumentItem, type DocumentValue, type DocumentValueFormat, type DocumentValueKind } from './document-values.js';
3
+ export * from './document-values.js';
4
+ /**
5
+ * Document templates — operator-designed Page Builder layouts for the PDF
6
+ * documents the platform produces (`specs/152-compare-pdf-template/`).
7
+ *
8
+ * The facility is owned by the `document_templates` module. A **document type**
9
+ * is contributed by the module that owns the document's data — `comparisons`
10
+ * (the storefront comparison PDF) and `invoices` (the invoice PDF) in feature
11
+ * 152 — through the `documentTypeRegistry` contribution registry, and a host
12
+ * produces a document through the gated `documentRenderPort`, handing over its
13
+ * own data. The facility stores templates opaquely and never interprets a
14
+ * host's data (Constitution XIV).
15
+ *
16
+ * Normative: `specs/152-compare-pdf-template/contracts/document-type-registry.md`
17
+ * (registry, port, hooks) and `contracts/document-templates-api.md` (admin HTTP).
18
+ */
19
+ /** `<moduleId>.<snake_name>` — permanent, persisted in `document_templates.document_type`. */
20
+ export declare const documentTypeCodeRe: RegExp;
21
+ export declare const documentTypeCodeSchema: z.ZodString;
22
+ /** A language key of a template's content: `pl`, `pl-PL`, `en-US`. */
23
+ export declare const documentLanguageRe: RegExp;
24
+ /** A merge-field key, written `{{key}}` in a text. */
25
+ export declare const mergeFieldKeyRe: RegExp;
26
+ /** The general-purpose blocks the facility owns; a document type opts into them. */
27
+ export declare const CORE_BLOCK_NAMES: readonly ["document_templates.Heading", "document_templates.Text", "document_templates.Image", "document_templates.Spacer", "document_templates.Divider", "document_templates.PageBreak"];
28
+ export type CoreBlockName = (typeof CORE_BLOCK_NAMES)[number];
29
+ /**
30
+ * The blocks the facility owns that bind to a **line collection** a document
31
+ * type declares (`specs/153-quote-request-pdf-template/contracts/document-collections.md`
32
+ * §2). Offered to a type if and only if it declares a collection.
33
+ */
34
+ export declare const COLLECTION_BLOCK_NAMES: readonly ["document_templates.ItemsTable"];
35
+ export type CollectionBlockName = (typeof COLLECTION_BLOCK_NAMES)[number];
36
+ export declare const ITEMS_TABLE_BLOCK_NAME: CollectionBlockName;
37
+ /** Limits a saved template is held to (research R-20). */
38
+ export declare const DOCUMENT_TEMPLATE_LIMITS: {
39
+ readonly maxNodesPerLanguage: 200;
40
+ readonly maxLanguages: 10;
41
+ readonly maxStringLength: 5000;
42
+ readonly maxCoreImagesPerLanguage: 20;
43
+ readonly maxContentBytes: number;
44
+ };
45
+ /** Whether a person may pick a template for an individual document (owner Q2). */
46
+ export declare const documentSelectionSchema: z.ZodEnum<{
47
+ default_only: "default_only";
48
+ per_document: "per_document";
49
+ }>;
50
+ export type DocumentSelection = z.infer<typeof documentSelectionSchema>;
51
+ /** Which core blocks a document type offers. */
52
+ export declare const documentCoreBlocksSchema: z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"none">, z.ZodArray<z.ZodEnum<{
53
+ "document_templates.Heading": "document_templates.Heading";
54
+ "document_templates.Text": "document_templates.Text";
55
+ "document_templates.Image": "document_templates.Image";
56
+ "document_templates.Spacer": "document_templates.Spacer";
57
+ "document_templates.Divider": "document_templates.Divider";
58
+ "document_templates.PageBreak": "document_templates.PageBreak";
59
+ }>>]>;
60
+ export type DocumentCoreBlocks = 'all' | 'none' | readonly CoreBlockName[];
61
+ /**
62
+ * Root props of one language's tree. Every key optional: the type's
63
+ * `pageDefaults` fill what is absent. Unknown keys are kept (Puck may store
64
+ * its own root props), the documented ones are range-checked.
65
+ */
66
+ export declare const documentRootPropsSchema: z.ZodObject<{
67
+ pageSize: z.ZodOptional<z.ZodEnum<{
68
+ A4: "A4";
69
+ LETTER: "LETTER";
70
+ }>>;
71
+ orientation: z.ZodOptional<z.ZodEnum<{
72
+ auto: "auto";
73
+ portrait: "portrait";
74
+ landscape: "landscape";
75
+ }>>;
76
+ marginTop: z.ZodOptional<z.ZodNumber>;
77
+ marginRight: z.ZodOptional<z.ZodNumber>;
78
+ marginBottom: z.ZodOptional<z.ZodNumber>;
79
+ marginLeft: z.ZodOptional<z.ZodNumber>;
80
+ baseFontSize: z.ZodOptional<z.ZodNumber>;
81
+ headerText: z.ZodOptional<z.ZodString>;
82
+ footerText: z.ZodOptional<z.ZodString>;
83
+ showPageNumbers: z.ZodOptional<z.ZodBoolean>;
84
+ pageNumberFormat: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$loose>;
86
+ export type DocumentRootProps = z.infer<typeof documentRootPropsSchema>;
87
+ /** The complete root props a render uses after `pageDefaults` were applied. */
88
+ export interface ResolvedDocumentRootProps {
89
+ readonly pageSize: 'A4' | 'LETTER';
90
+ readonly orientation: 'auto' | 'portrait' | 'landscape';
91
+ readonly marginTop: number;
92
+ readonly marginRight: number;
93
+ readonly marginBottom: number;
94
+ readonly marginLeft: number;
95
+ readonly baseFontSize: number;
96
+ readonly headerText: string;
97
+ readonly footerText: string;
98
+ readonly showPageNumbers: boolean;
99
+ readonly pageNumberFormat: string;
100
+ }
101
+ /** The generic page defaults (data-model.md §3.1). */
102
+ export declare const GENERIC_DOCUMENT_PAGE_DEFAULTS: ResolvedDocumentRootProps;
103
+ /** One placed block. Props are kept as entered; the facility never interprets them. */
104
+ export declare const documentTemplateNodeSchema: z.ZodObject<{
105
+ type: z.ZodString;
106
+ props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
107
+ }, z.core.$loose>;
108
+ export type DocumentTemplateNode = z.infer<typeof documentTemplateNodeSchema>;
109
+ /** One language's Puck tree. */
110
+ export declare const documentTemplateTreeSchema: z.ZodObject<{
111
+ root: z.ZodDefault<z.ZodObject<{
112
+ props: z.ZodDefault<z.ZodObject<{
113
+ pageSize: z.ZodOptional<z.ZodEnum<{
114
+ A4: "A4";
115
+ LETTER: "LETTER";
116
+ }>>;
117
+ orientation: z.ZodOptional<z.ZodEnum<{
118
+ auto: "auto";
119
+ portrait: "portrait";
120
+ landscape: "landscape";
121
+ }>>;
122
+ marginTop: z.ZodOptional<z.ZodNumber>;
123
+ marginRight: z.ZodOptional<z.ZodNumber>;
124
+ marginBottom: z.ZodOptional<z.ZodNumber>;
125
+ marginLeft: z.ZodOptional<z.ZodNumber>;
126
+ baseFontSize: z.ZodOptional<z.ZodNumber>;
127
+ headerText: z.ZodOptional<z.ZodString>;
128
+ footerText: z.ZodOptional<z.ZodString>;
129
+ showPageNumbers: z.ZodOptional<z.ZodBoolean>;
130
+ pageNumberFormat: z.ZodOptional<z.ZodString>;
131
+ }, z.core.$loose>>;
132
+ }, z.core.$loose>>;
133
+ content: z.ZodArray<z.ZodObject<{
134
+ type: z.ZodString;
135
+ props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
+ }, z.core.$loose>>;
137
+ zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
138
+ }, z.core.$loose>;
139
+ export type DocumentTemplateTree = z.infer<typeof documentTemplateTreeSchema>;
140
+ /** `{ schemaVersion: 1, languages: { <lang>: <tree> } }`. */
141
+ export declare const documentTemplateContentSchema: z.ZodObject<{
142
+ schemaVersion: z.ZodLiteral<1>;
143
+ languages: z.ZodRecord<z.ZodString, z.ZodObject<{
144
+ root: z.ZodDefault<z.ZodObject<{
145
+ props: z.ZodDefault<z.ZodObject<{
146
+ pageSize: z.ZodOptional<z.ZodEnum<{
147
+ A4: "A4";
148
+ LETTER: "LETTER";
149
+ }>>;
150
+ orientation: z.ZodOptional<z.ZodEnum<{
151
+ auto: "auto";
152
+ portrait: "portrait";
153
+ landscape: "landscape";
154
+ }>>;
155
+ marginTop: z.ZodOptional<z.ZodNumber>;
156
+ marginRight: z.ZodOptional<z.ZodNumber>;
157
+ marginBottom: z.ZodOptional<z.ZodNumber>;
158
+ marginLeft: z.ZodOptional<z.ZodNumber>;
159
+ baseFontSize: z.ZodOptional<z.ZodNumber>;
160
+ headerText: z.ZodOptional<z.ZodString>;
161
+ footerText: z.ZodOptional<z.ZodString>;
162
+ showPageNumbers: z.ZodOptional<z.ZodBoolean>;
163
+ pageNumberFormat: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$loose>>;
165
+ }, z.core.$loose>>;
166
+ content: z.ZodArray<z.ZodObject<{
167
+ type: z.ZodString;
168
+ props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
169
+ }, z.core.$loose>>;
170
+ zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
171
+ }, z.core.$loose>>;
172
+ }, z.core.$strip>;
173
+ export type DocumentTemplateContent = z.infer<typeof documentTemplateContentSchema>;
174
+ /** Serialized UTF-8 size of a content envelope, the measure of the 512 KiB limit. */
175
+ export declare function documentContentByteSize(content: unknown): number;
176
+ /** A collection key a document type declares: `lines`. */
177
+ export declare const documentCollectionKeyRe: RegExp;
178
+ /** Limits of one Line items table (153 research R-21). */
179
+ export declare const ITEMS_TABLE_LIMITS: {
180
+ readonly maxColumns: 16;
181
+ readonly maxDetailEntries: 8;
182
+ readonly maxTotals: 10;
183
+ readonly maxLabelLength: 200;
184
+ readonly maxEmptyTextLength: 50;
185
+ readonly maxTableEmptyTextLength: 200;
186
+ readonly maxGroupEmptyLabelLength: 100;
187
+ readonly maxSeparatorLength: 10;
188
+ };
189
+ /** One field a collection offers (research R-4). */
190
+ export interface DocumentFieldDefinition {
191
+ readonly path: string;
192
+ /** In the requested language. */
193
+ readonly label: string;
194
+ readonly valueKind: DocumentValueKind;
195
+ /** `line` | `pricing` | `product` | a host's own group key. */
196
+ readonly group: string;
197
+ /** `internal`: a value the customer does not otherwise see (153 Q7) — the editor warns. */
198
+ readonly audience: 'customer' | 'internal';
199
+ readonly defaultFormat?: DocumentValueFormat;
200
+ readonly defaultAlign?: DocumentAlign;
201
+ readonly description?: string;
202
+ /** What the editor's canvas and the preview show when the sample has no value. */
203
+ readonly sampleValue?: DocumentValue;
204
+ }
205
+ export declare const documentFieldDefinitionSchema: z.ZodObject<{
206
+ path: z.ZodString;
207
+ label: z.ZodString;
208
+ valueKind: z.ZodEnum<{
209
+ number: "number";
210
+ date: "date";
211
+ text: "text";
212
+ percent: "percent";
213
+ money: "money";
214
+ }>;
215
+ group: z.ZodString;
216
+ audience: z.ZodEnum<{
217
+ customer: "customer";
218
+ internal: "internal";
219
+ }>;
220
+ defaultFormat: z.ZodOptional<z.ZodObject<{
221
+ decimals: z.ZodOptional<z.ZodNumber>;
222
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
223
+ symbol: "symbol";
224
+ code: "code";
225
+ none: "none";
226
+ }>>;
227
+ dateStyle: z.ZodOptional<z.ZodEnum<{
228
+ medium: "medium";
229
+ short: "short";
230
+ long: "long";
231
+ }>>;
232
+ }, z.core.$strip>>;
233
+ defaultAlign: z.ZodOptional<z.ZodEnum<{
234
+ left: "left";
235
+ center: "center";
236
+ right: "right";
237
+ }>>;
238
+ description: z.ZodOptional<z.ZodString>;
239
+ sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
240
+ kind: z.ZodLiteral<"text">;
241
+ value: z.ZodString;
242
+ }, z.core.$strip>, z.ZodObject<{
243
+ kind: z.ZodLiteral<"number">;
244
+ value: z.ZodNumber;
245
+ }, z.core.$strip>, z.ZodObject<{
246
+ kind: z.ZodLiteral<"money">;
247
+ amount: z.ZodNumber;
248
+ currency: z.ZodString;
249
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ kind: z.ZodLiteral<"percent">;
252
+ value: z.ZodNumber;
253
+ }, z.core.$strip>, z.ZodObject<{
254
+ kind: z.ZodLiteral<"date">;
255
+ value: z.ZodString;
256
+ }, z.core.$strip>], "kind">>>;
257
+ }, z.core.$strip>;
258
+ /**
259
+ * The lines of a document a Line items table can print, declared by the
260
+ * document type (contract §1). `fields` is async and per language because part
261
+ * of a catalogue is data (a shop's product attributes); `items` is synchronous
262
+ * and pure over the host's own data, so the facility never queries anything.
263
+ */
264
+ export interface DocumentCollectionDeclaration<TData = unknown> {
265
+ readonly key: string;
266
+ /** Module-relative i18n key. */
267
+ readonly labelKey: string;
268
+ fields(language: string): Promise<readonly DocumentFieldDefinition[]>;
269
+ items(data: TData): readonly DocumentItem[];
270
+ summaryFields?(language: string): Promise<readonly DocumentFieldDefinition[]>;
271
+ summary?(data: TData): Readonly<Record<string, DocumentValue>>;
272
+ /**
273
+ * Feature 159 — the document's groups as sections of `items(data)`
274
+ * (`specs/159-quote-request-item-groups/contracts/document-sections.md` §1).
275
+ * Absent = the collection has no sections. Only non-empty sections, groups
276
+ * first in order, the ungrouped lines last; each section a contiguous
277
+ * ascending run of indexes. A partition the facility cannot use prints the
278
+ * table flat — the document never fails for it.
279
+ */
280
+ sections?(data: TData): readonly DocumentItemSection[];
281
+ }
282
+ /** Feature 159 — one section of a collection: a group's lines, or the lines in no group. */
283
+ export interface DocumentItemSection {
284
+ /** The group's id, or the literal `'ungrouped'`. Unique within one render. */
285
+ readonly key: string;
286
+ readonly kind: 'group' | 'ungrouped';
287
+ /** The group's name as an administrator wrote it; `null` for `ungrouped`. Never translated. */
288
+ readonly label: string | null;
289
+ /** Indexes into `items(data)`; ascending; the sections together cover every index exactly once. */
290
+ readonly itemIndexes: readonly number[];
291
+ /** The section's totals, keyed like `summary(data)`, computed by the host over the section's lines. */
292
+ readonly summary: Readonly<Record<string, DocumentValue>>;
293
+ }
294
+ export declare const DOCUMENT_UNGROUPED_SECTION_KEY = "ungrouped";
295
+ export declare const documentItemSectionSchema: z.ZodObject<{
296
+ key: z.ZodString;
297
+ kind: z.ZodEnum<{
298
+ group: "group";
299
+ ungrouped: "ungrouped";
300
+ }>;
301
+ label: z.ZodNullable<z.ZodString>;
302
+ itemIndexes: z.ZodArray<z.ZodNumber>;
303
+ summary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
304
+ kind: z.ZodLiteral<"text">;
305
+ value: z.ZodString;
306
+ }, z.core.$strip>, z.ZodObject<{
307
+ kind: z.ZodLiteral<"number">;
308
+ value: z.ZodNumber;
309
+ }, z.core.$strip>, z.ZodObject<{
310
+ kind: z.ZodLiteral<"money">;
311
+ amount: z.ZodNumber;
312
+ currency: z.ZodString;
313
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
314
+ }, z.core.$strip>, z.ZodObject<{
315
+ kind: z.ZodLiteral<"percent">;
316
+ value: z.ZodNumber;
317
+ }, z.core.$strip>, z.ZodObject<{
318
+ kind: z.ZodLiteral<"date">;
319
+ value: z.ZodString;
320
+ }, z.core.$strip>], "kind">>>;
321
+ }, z.core.$strip>;
322
+ /**
323
+ * Whether `sections` is a partition of `itemCount` items the Line items table
324
+ * can print (contract §1): read in order, the sections' indexes are exactly
325
+ * `0…itemCount-1`; no section is empty; keys are unique; the ungrouped section,
326
+ * if any, is last. Pure — the renderer and the canvas both call it.
327
+ */
328
+ export declare function isValidSectionPartition(sections: readonly DocumentItemSection[], itemCount: number): boolean;
329
+ /**
330
+ * The facility's own texts around sections — the default *Other items* heading
331
+ * and the item count — in the document's language (contract §3). Here rather
332
+ * than in the facility's backend so the editor canvas prints what the PDF
333
+ * prints (153 FR-036). Polish and English ship; any other language reads
334
+ * English. The count's form is chosen by `Intl.PluralRules`.
335
+ */
336
+ export interface DocumentSectionTexts {
337
+ readonly otherItems: string;
338
+ itemCount(count: number): string;
339
+ }
340
+ export declare function documentSectionTexts(language: string): DocumentSectionTexts;
341
+ /** Columns may print *always*, *only if any line has a value*, or *never* (D2). */
342
+ export declare const itemsTableColumnConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
343
+ op: z.ZodLiteral<"always">;
344
+ }, z.core.$strip>, z.ZodObject<{
345
+ op: z.ZodLiteral<"never">;
346
+ }, z.core.$strip>, z.ZodObject<{
347
+ op: z.ZodLiteral<"any_has_value">;
348
+ field: z.ZodOptional<z.ZodString>;
349
+ }, z.core.$strip>], "op">;
350
+ /** Detail entries and totals rows: *always*, *only if it has a value*, *never*. */
351
+ export declare const itemsTableEntryConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
352
+ op: z.ZodLiteral<"always">;
353
+ }, z.core.$strip>, z.ZodObject<{
354
+ op: z.ZodLiteral<"never">;
355
+ }, z.core.$strip>, z.ZodObject<{
356
+ op: z.ZodLiteral<"has_value">;
357
+ field: z.ZodOptional<z.ZodString>;
358
+ }, z.core.$strip>], "op">;
359
+ export declare const itemsTableColumnSchema: z.ZodObject<{
360
+ id: z.ZodString;
361
+ field: z.ZodString;
362
+ label: z.ZodDefault<z.ZodString>;
363
+ width: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>]>>;
364
+ align: z.ZodDefault<z.ZodEnum<{
365
+ auto: "auto";
366
+ left: "left";
367
+ center: "center";
368
+ right: "right";
369
+ }>>;
370
+ format: z.ZodDefault<z.ZodObject<{
371
+ decimals: z.ZodOptional<z.ZodNumber>;
372
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
373
+ symbol: "symbol";
374
+ code: "code";
375
+ none: "none";
376
+ }>>;
377
+ dateStyle: z.ZodOptional<z.ZodEnum<{
378
+ medium: "medium";
379
+ short: "short";
380
+ long: "long";
381
+ }>>;
382
+ }, z.core.$strip>>;
383
+ emptyText: z.ZodDefault<z.ZodString>;
384
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
385
+ op: z.ZodLiteral<"always">;
386
+ }, z.core.$strip>, z.ZodObject<{
387
+ op: z.ZodLiteral<"never">;
388
+ }, z.core.$strip>, z.ZodObject<{
389
+ op: z.ZodLiteral<"any_has_value">;
390
+ field: z.ZodOptional<z.ZodString>;
391
+ }, z.core.$strip>], "op">>;
392
+ }, z.core.$strip>;
393
+ export type ItemsTableColumn = z.infer<typeof itemsTableColumnSchema>;
394
+ export declare const itemsTableDetailEntrySchema: z.ZodObject<{
395
+ field: z.ZodString;
396
+ label: z.ZodDefault<z.ZodString>;
397
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
398
+ op: z.ZodLiteral<"always">;
399
+ }, z.core.$strip>, z.ZodObject<{
400
+ op: z.ZodLiteral<"never">;
401
+ }, z.core.$strip>, z.ZodObject<{
402
+ op: z.ZodLiteral<"has_value">;
403
+ field: z.ZodOptional<z.ZodString>;
404
+ }, z.core.$strip>], "op">>;
405
+ }, z.core.$strip>;
406
+ export type ItemsTableDetailEntry = z.infer<typeof itemsTableDetailEntrySchema>;
407
+ export declare const itemsTableDetailRowSchema: z.ZodObject<{
408
+ enabled: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
409
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
410
+ field: z.ZodString;
411
+ label: z.ZodDefault<z.ZodString>;
412
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
413
+ op: z.ZodLiteral<"always">;
414
+ }, z.core.$strip>, z.ZodObject<{
415
+ op: z.ZodLiteral<"never">;
416
+ }, z.core.$strip>, z.ZodObject<{
417
+ op: z.ZodLiteral<"has_value">;
418
+ field: z.ZodOptional<z.ZodString>;
419
+ }, z.core.$strip>], "op">>;
420
+ }, z.core.$strip>>>;
421
+ separator: z.ZodDefault<z.ZodString>;
422
+ italics: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
423
+ fontSize: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
424
+ }, z.core.$strip>;
425
+ export type ItemsTableDetailRow = z.infer<typeof itemsTableDetailRowSchema>;
426
+ export declare const itemsTableTotalSchema: z.ZodObject<{
427
+ field: z.ZodString;
428
+ label: z.ZodDefault<z.ZodString>;
429
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
430
+ op: z.ZodLiteral<"always">;
431
+ }, z.core.$strip>, z.ZodObject<{
432
+ op: z.ZodLiteral<"never">;
433
+ }, z.core.$strip>, z.ZodObject<{
434
+ op: z.ZodLiteral<"has_value">;
435
+ field: z.ZodOptional<z.ZodString>;
436
+ }, z.core.$strip>], "op">>;
437
+ emphasis: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
438
+ }, z.core.$strip>;
439
+ export type ItemsTableTotal = z.infer<typeof itemsTableTotalSchema>;
440
+ /** 153's grouping by a field's value; templates saved before feature 159 carry no `by`. */
441
+ export declare const itemsTableFieldGroupingSchema: z.ZodObject<{
442
+ by: z.ZodOptional<z.ZodLiteral<"field">>;
443
+ field: z.ZodString;
444
+ emptyLabel: z.ZodDefault<z.ZodString>;
445
+ subtotalField: z.ZodDefault<z.ZodNullable<z.ZodString>>;
446
+ subtotalLabel: z.ZodDefault<z.ZodString>;
447
+ }, z.core.$strip>;
448
+ /** Feature 159 — the document's own groups (`DocumentCollectionDeclaration.sections`). */
449
+ export declare const itemsTableSectionsGroupingSchema: z.ZodObject<{
450
+ by: z.ZodLiteral<"sections">;
451
+ otherItemsLabel: z.ZodDefault<z.ZodString>;
452
+ showItemCount: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
453
+ }, z.core.$strip>;
454
+ export declare const itemsTableNoGroupingSchema: z.ZodObject<{
455
+ by: z.ZodLiteral<"none">;
456
+ }, z.core.$strip>;
457
+ /**
458
+ * The table's *Grouping* setting (159 contract §2). The props' `grouping` is
459
+ * `null` or absent on a table whose grouping was never configured, which means
460
+ * **the document's groups** with the defaults — so every template saved before
461
+ * feature 159 prints a grouped document's groups without being edited, and an
462
+ * ungrouped document exactly as before.
463
+ */
464
+ export declare const itemsTableGroupingSchema: z.ZodUnion<readonly [z.ZodObject<{
465
+ by: z.ZodLiteral<"sections">;
466
+ otherItemsLabel: z.ZodDefault<z.ZodString>;
467
+ showItemCount: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
468
+ }, z.core.$strip>, z.ZodObject<{
469
+ by: z.ZodLiteral<"none">;
470
+ }, z.core.$strip>, z.ZodObject<{
471
+ by: z.ZodOptional<z.ZodLiteral<"field">>;
472
+ field: z.ZodString;
473
+ emptyLabel: z.ZodDefault<z.ZodString>;
474
+ subtotalField: z.ZodDefault<z.ZodNullable<z.ZodString>>;
475
+ subtotalLabel: z.ZodDefault<z.ZodString>;
476
+ }, z.core.$strip>]>;
477
+ export type ItemsTableGrouping = z.infer<typeof itemsTableGroupingSchema>;
478
+ export type ItemsTableGroupingMode = 'sections' | 'none' | 'field';
479
+ /**
480
+ * The mode a stored `grouping` means, read tolerantly as the renderer reads
481
+ * every prop: `null`, absent, an unreadable value or an unknown `by` is
482
+ * *sections*; a record without `by` is 153's field grouping.
483
+ */
484
+ export declare function itemsTableGroupingMode(raw: unknown): ItemsTableGroupingMode;
485
+ /**
486
+ * The stored props of one `document_templates.ItemsTable` node
487
+ * (`specs/153-quote-request-pdf-template/data-model.md` §2), validated when a
488
+ * template is saved (FR-043). Unknown keys are kept — Puck stores its own `id`.
489
+ * A field path the catalogue does not offer is accepted: the catalogue is data
490
+ * and changes, and such a column prints its empty text (FR-037).
491
+ */
492
+ export declare const itemsTablePropsSchema: z.ZodObject<{
493
+ collection: z.ZodOptional<z.ZodString>;
494
+ columns: z.ZodArray<z.ZodObject<{
495
+ id: z.ZodString;
496
+ field: z.ZodString;
497
+ label: z.ZodDefault<z.ZodString>;
498
+ width: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>]>>;
499
+ align: z.ZodDefault<z.ZodEnum<{
500
+ auto: "auto";
501
+ left: "left";
502
+ center: "center";
503
+ right: "right";
504
+ }>>;
505
+ format: z.ZodDefault<z.ZodObject<{
506
+ decimals: z.ZodOptional<z.ZodNumber>;
507
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
508
+ symbol: "symbol";
509
+ code: "code";
510
+ none: "none";
511
+ }>>;
512
+ dateStyle: z.ZodOptional<z.ZodEnum<{
513
+ medium: "medium";
514
+ short: "short";
515
+ long: "long";
516
+ }>>;
517
+ }, z.core.$strip>>;
518
+ emptyText: z.ZodDefault<z.ZodString>;
519
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
520
+ op: z.ZodLiteral<"always">;
521
+ }, z.core.$strip>, z.ZodObject<{
522
+ op: z.ZodLiteral<"never">;
523
+ }, z.core.$strip>, z.ZodObject<{
524
+ op: z.ZodLiteral<"any_has_value">;
525
+ field: z.ZodOptional<z.ZodString>;
526
+ }, z.core.$strip>], "op">>;
527
+ }, z.core.$strip>>;
528
+ detailRow: z.ZodOptional<z.ZodObject<{
529
+ enabled: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
530
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
531
+ field: z.ZodString;
532
+ label: z.ZodDefault<z.ZodString>;
533
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
534
+ op: z.ZodLiteral<"always">;
535
+ }, z.core.$strip>, z.ZodObject<{
536
+ op: z.ZodLiteral<"never">;
537
+ }, z.core.$strip>, z.ZodObject<{
538
+ op: z.ZodLiteral<"has_value">;
539
+ field: z.ZodOptional<z.ZodString>;
540
+ }, z.core.$strip>], "op">>;
541
+ }, z.core.$strip>>>;
542
+ separator: z.ZodDefault<z.ZodString>;
543
+ italics: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
544
+ fontSize: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
545
+ }, z.core.$strip>>;
546
+ totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
547
+ field: z.ZodString;
548
+ label: z.ZodDefault<z.ZodString>;
549
+ visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
550
+ op: z.ZodLiteral<"always">;
551
+ }, z.core.$strip>, z.ZodObject<{
552
+ op: z.ZodLiteral<"never">;
553
+ }, z.core.$strip>, z.ZodObject<{
554
+ op: z.ZodLiteral<"has_value">;
555
+ field: z.ZodOptional<z.ZodString>;
556
+ }, z.core.$strip>], "op">>;
557
+ emphasis: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
558
+ }, z.core.$strip>>>;
559
+ grouping: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
560
+ by: z.ZodLiteral<"sections">;
561
+ otherItemsLabel: z.ZodDefault<z.ZodString>;
562
+ showItemCount: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
563
+ }, z.core.$strip>, z.ZodObject<{
564
+ by: z.ZodLiteral<"none">;
565
+ }, z.core.$strip>, z.ZodObject<{
566
+ by: z.ZodOptional<z.ZodLiteral<"field">>;
567
+ field: z.ZodString;
568
+ emptyLabel: z.ZodDefault<z.ZodString>;
569
+ subtotalField: z.ZodDefault<z.ZodNullable<z.ZodString>>;
570
+ subtotalLabel: z.ZodDefault<z.ZodString>;
571
+ }, z.core.$strip>]>>>;
572
+ emptyText: z.ZodOptional<z.ZodString>;
573
+ headerBackground: z.ZodOptional<z.ZodString>;
574
+ borderColor: z.ZodOptional<z.ZodString>;
575
+ fontSize: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
576
+ stripedRows: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
577
+ stripeColor: z.ZodOptional<z.ZodString>;
578
+ marginBottom: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
579
+ }, z.core.$loose>;
580
+ export type ItemsTableProps = z.infer<typeof itemsTablePropsSchema>;
581
+ /** Where a template is applied when a document is produced. */
582
+ export interface DocumentRenderContext {
583
+ readonly documentType: string;
584
+ /** The tree language actually used. */
585
+ readonly language: string;
586
+ readonly salesChannelId: string | null;
587
+ readonly preview: boolean;
588
+ /** Usable width in points after margins and orientation. */
589
+ readonly pageWidth: number;
590
+ }
591
+ /** One configurable field of a block, as the builder descriptor serves it. */
592
+ export declare const documentFieldDescriptorSchema: z.ZodObject<{
593
+ type: z.ZodEnum<{
594
+ number: "number";
595
+ object: "object";
596
+ array: "array";
597
+ uuid: "uuid";
598
+ text: "text";
599
+ textarea: "textarea";
600
+ select: "select";
601
+ radio: "radio";
602
+ external: "external";
603
+ richtext: "richtext";
604
+ color: "color";
605
+ }>;
606
+ label: z.ZodOptional<z.ZodString>;
607
+ required: z.ZodOptional<z.ZodBoolean>;
608
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
609
+ label: z.ZodString;
610
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
611
+ }, z.core.$strip>>>;
612
+ refKind: z.ZodOptional<z.ZodString>;
613
+ }, z.core.$strip>;
614
+ export type DocumentFieldDescriptor = z.infer<typeof documentFieldDescriptorSchema>;
615
+ /** A host block's renderer. */
616
+ export interface DocumentBlockRenderer<TData = unknown, TPrepared = unknown> {
617
+ /** `blockNameRe`; the owner segment is `moduleId`. */
618
+ readonly name: string;
619
+ /** Presence-filtered by this id on every call. */
620
+ readonly moduleId: string;
621
+ /** Label and fields when no present manifest declares the block's fields (contributed blocks). */
622
+ describe?(): {
623
+ readonly label: string;
624
+ readonly fields: Readonly<Record<string, DocumentFieldDescriptor>>;
625
+ };
626
+ /** One pdfmake content node. `props` are untrusted stored props over declared `defaultProps`. */
627
+ render(input: {
628
+ readonly props: Readonly<Record<string, unknown>>;
629
+ readonly data: TData;
630
+ readonly prepared: TPrepared;
631
+ readonly language: string;
632
+ readonly context: DocumentRenderContext;
633
+ readonly interpolate: (text: string) => string;
634
+ }): unknown;
635
+ }
636
+ /** Root-prop defaults merged under stored root props, plus non-editable pdfmake styles. */
637
+ export type DocumentPageDefaults = Partial<ResolvedDocumentRootProps> & {
638
+ readonly styles?: Readonly<Record<string, unknown>>;
639
+ };
640
+ export interface DocumentTypeRegistration<TData = unknown, TPrepared = unknown> {
641
+ readonly code: string;
642
+ readonly moduleId: string;
643
+ /** Module-relative i18n key. */
644
+ readonly labelKey: string;
645
+ readonly descriptionKey?: string;
646
+ /** The type's blocks at this moment — called per read and per render. */
647
+ blocks(): readonly DocumentBlockRenderer<TData, TPrepared>[];
648
+ readonly coreBlocks: DocumentCoreBlocks;
649
+ readonly selection: DocumentSelection;
650
+ /** Languages a template may hold; absent = every active content language. */
651
+ readonly languages?: readonly string[];
652
+ readonly variables?: readonly {
653
+ readonly key: string;
654
+ readonly labelKey: string;
655
+ }[];
656
+ resolveVariables?(data: TData, context: DocumentRenderContext): Readonly<Record<string, string | null>>;
657
+ /** The built-in layout, per language. A fresh object per call. */
658
+ defaultContent(): DocumentTemplateContent;
659
+ /** Code layout used when no candidate tree renders anything. */
660
+ renderBuiltIn?(data: TData, prepared: TPrepared, context: DocumentRenderContext): unknown[];
661
+ readonly pageDefaults?: DocumentPageDefaults;
662
+ suggestOrientation?(data: TData): 'portrait' | 'landscape';
663
+ /** Per-render precomputation handed to every block. */
664
+ prepareRender?(data: TData, input: {
665
+ readonly placedBlocks: ReadonlySet<string> | null;
666
+ readonly preview: boolean;
667
+ }): Promise<TPrepared>;
668
+ /** Fictitious, JSON-serialisable sample for the editor and the preview. */
669
+ sampleData(language: string): TData;
670
+ /**
671
+ * The line collections a Line items table can print (feature 153). A type
672
+ * declaring at least one is offered `document_templates.ItemsTable`.
673
+ */
674
+ readonly collections?: readonly DocumentCollectionDeclaration<TData>[];
675
+ }
676
+ /** Container name: `documentTypeRegistry`. Owner: `document_templates`. Ungated. */
677
+ export interface DocumentTypeRegistryPort {
678
+ register(registration: DocumentTypeRegistration<any, any>): void;
679
+ }
680
+ export interface DocumentRenderInput<TData = unknown> {
681
+ readonly documentType: string;
682
+ /** The document's channel; `null` only for previews and channel-less documents. */
683
+ readonly salesChannelId: string | null;
684
+ readonly language: string;
685
+ readonly data: TData;
686
+ /** Only for `selection: 'per_document'` types. */
687
+ readonly templateId?: string;
688
+ /** An unsaved canvas (the admin preview). Facility-internal. */
689
+ readonly tree?: unknown;
690
+ /** Render as a preview (enrichments may be skipped by the type). */
691
+ readonly preview?: boolean;
692
+ }
693
+ export interface DocumentRenderResult {
694
+ readonly bytes: Uint8Array;
695
+ readonly source: 'explicit' | 'default' | 'built_in' | 'canvas';
696
+ readonly templateId: string | null;
697
+ readonly templateVersion: number | null;
698
+ readonly language: string;
699
+ readonly requestedTemplateMissing: boolean;
700
+ }
701
+ /**
702
+ * The templates a person may pick for one document (153 contract §5): global
703
+ * ones and those of the document's channel — channel first, then global, each
704
+ * by name — the one a document without a choice would use (`null` = the
705
+ * built-in layout), and the built-in layout's languages.
706
+ */
707
+ export declare const documentTemplateChoiceSchema: z.ZodObject<{
708
+ id: z.ZodString;
709
+ name: z.ZodString;
710
+ salesChannelId: z.ZodNullable<z.ZodString>;
711
+ languages: z.ZodArray<z.ZodString>;
712
+ isDefault: z.ZodBoolean;
713
+ }, z.core.$strip>;
714
+ export type DocumentTemplateChoice = z.infer<typeof documentTemplateChoiceSchema>;
715
+ export declare const documentTemplateChoicesSchema: z.ZodObject<{
716
+ templates: z.ZodArray<z.ZodObject<{
717
+ id: z.ZodString;
718
+ name: z.ZodString;
719
+ salesChannelId: z.ZodNullable<z.ZodString>;
720
+ languages: z.ZodArray<z.ZodString>;
721
+ isDefault: z.ZodBoolean;
722
+ }, z.core.$strip>>;
723
+ effectiveDefaultId: z.ZodNullable<z.ZodString>;
724
+ builtInLanguages: z.ZodArray<z.ZodString>;
725
+ }, z.core.$strip>;
726
+ export type DocumentTemplateChoices = z.infer<typeof documentTemplateChoicesSchema>;
727
+ /** Container name: `documentRenderPort`. Owner: `document_templates`. Gated. */
728
+ export interface DocumentRenderPort {
729
+ render<TData>(input: DocumentRenderInput<TData>): Promise<DocumentRenderResult>;
730
+ /**
731
+ * The selection list of a `per_document` type for a document's channel
732
+ * (feature 153) — so a host can offer a picker to people who may not manage
733
+ * templates. A `default_only` type answers `DOCUMENT_TEMPLATE_NOT_SELECTABLE`.
734
+ */
735
+ listChoices(input: {
736
+ readonly documentType: string;
737
+ readonly salesChannelId: string | null;
738
+ }): Promise<DocumentTemplateChoices>;
739
+ }
740
+ export declare const documentTypeSummarySchema: z.ZodObject<{
741
+ code: z.ZodString;
742
+ moduleId: z.ZodString;
743
+ labelKey: z.ZodString;
744
+ descriptionKey: z.ZodOptional<z.ZodString>;
745
+ selection: z.ZodEnum<{
746
+ default_only: "default_only";
747
+ per_document: "per_document";
748
+ }>;
749
+ templateCount: z.ZodNumber;
750
+ }, z.core.$strip>;
751
+ export type DocumentTypeSummary = z.infer<typeof documentTypeSummarySchema>;
752
+ export declare const documentVariableSchema: z.ZodObject<{
753
+ key: z.ZodString;
754
+ labelKey: z.ZodString;
755
+ ownerModule: z.ZodString;
756
+ scope: z.ZodEnum<{
757
+ body: "body";
758
+ headerFooter: "headerFooter";
759
+ }>;
760
+ }, z.core.$strip>;
761
+ export type DocumentVariable = z.infer<typeof documentVariableSchema>;
762
+ /** One declared collection as the editor needs it (153 contract §4), labels in the requested language. */
763
+ export declare const documentCollectionDetailSchema: z.ZodObject<{
764
+ key: z.ZodString;
765
+ labelKey: z.ZodString;
766
+ ownerModule: z.ZodString;
767
+ fields: z.ZodArray<z.ZodObject<{
768
+ path: z.ZodString;
769
+ label: z.ZodString;
770
+ valueKind: z.ZodEnum<{
771
+ number: "number";
772
+ date: "date";
773
+ text: "text";
774
+ percent: "percent";
775
+ money: "money";
776
+ }>;
777
+ group: z.ZodString;
778
+ audience: z.ZodEnum<{
779
+ customer: "customer";
780
+ internal: "internal";
781
+ }>;
782
+ defaultFormat: z.ZodOptional<z.ZodObject<{
783
+ decimals: z.ZodOptional<z.ZodNumber>;
784
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
785
+ symbol: "symbol";
786
+ code: "code";
787
+ none: "none";
788
+ }>>;
789
+ dateStyle: z.ZodOptional<z.ZodEnum<{
790
+ medium: "medium";
791
+ short: "short";
792
+ long: "long";
793
+ }>>;
794
+ }, z.core.$strip>>;
795
+ defaultAlign: z.ZodOptional<z.ZodEnum<{
796
+ left: "left";
797
+ center: "center";
798
+ right: "right";
799
+ }>>;
800
+ description: z.ZodOptional<z.ZodString>;
801
+ sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
802
+ kind: z.ZodLiteral<"text">;
803
+ value: z.ZodString;
804
+ }, z.core.$strip>, z.ZodObject<{
805
+ kind: z.ZodLiteral<"number">;
806
+ value: z.ZodNumber;
807
+ }, z.core.$strip>, z.ZodObject<{
808
+ kind: z.ZodLiteral<"money">;
809
+ amount: z.ZodNumber;
810
+ currency: z.ZodString;
811
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
812
+ }, z.core.$strip>, z.ZodObject<{
813
+ kind: z.ZodLiteral<"percent">;
814
+ value: z.ZodNumber;
815
+ }, z.core.$strip>, z.ZodObject<{
816
+ kind: z.ZodLiteral<"date">;
817
+ value: z.ZodString;
818
+ }, z.core.$strip>], "kind">>>;
819
+ }, z.core.$strip>>;
820
+ summaryFields: z.ZodArray<z.ZodObject<{
821
+ path: z.ZodString;
822
+ label: z.ZodString;
823
+ valueKind: z.ZodEnum<{
824
+ number: "number";
825
+ date: "date";
826
+ text: "text";
827
+ percent: "percent";
828
+ money: "money";
829
+ }>;
830
+ group: z.ZodString;
831
+ audience: z.ZodEnum<{
832
+ customer: "customer";
833
+ internal: "internal";
834
+ }>;
835
+ defaultFormat: z.ZodOptional<z.ZodObject<{
836
+ decimals: z.ZodOptional<z.ZodNumber>;
837
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
838
+ symbol: "symbol";
839
+ code: "code";
840
+ none: "none";
841
+ }>>;
842
+ dateStyle: z.ZodOptional<z.ZodEnum<{
843
+ medium: "medium";
844
+ short: "short";
845
+ long: "long";
846
+ }>>;
847
+ }, z.core.$strip>>;
848
+ defaultAlign: z.ZodOptional<z.ZodEnum<{
849
+ left: "left";
850
+ center: "center";
851
+ right: "right";
852
+ }>>;
853
+ description: z.ZodOptional<z.ZodString>;
854
+ sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
855
+ kind: z.ZodLiteral<"text">;
856
+ value: z.ZodString;
857
+ }, z.core.$strip>, z.ZodObject<{
858
+ kind: z.ZodLiteral<"number">;
859
+ value: z.ZodNumber;
860
+ }, z.core.$strip>, z.ZodObject<{
861
+ kind: z.ZodLiteral<"money">;
862
+ amount: z.ZodNumber;
863
+ currency: z.ZodString;
864
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
865
+ }, z.core.$strip>, z.ZodObject<{
866
+ kind: z.ZodLiteral<"percent">;
867
+ value: z.ZodNumber;
868
+ }, z.core.$strip>, z.ZodObject<{
869
+ kind: z.ZodLiteral<"date">;
870
+ value: z.ZodString;
871
+ }, z.core.$strip>], "kind">>>;
872
+ }, z.core.$strip>>;
873
+ sampleItems: z.ZodArray<z.ZodObject<{
874
+ values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
875
+ kind: z.ZodLiteral<"text">;
876
+ value: z.ZodString;
877
+ }, z.core.$strip>, z.ZodObject<{
878
+ kind: z.ZodLiteral<"number">;
879
+ value: z.ZodNumber;
880
+ }, z.core.$strip>, z.ZodObject<{
881
+ kind: z.ZodLiteral<"money">;
882
+ amount: z.ZodNumber;
883
+ currency: z.ZodString;
884
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
885
+ }, z.core.$strip>, z.ZodObject<{
886
+ kind: z.ZodLiteral<"percent">;
887
+ value: z.ZodNumber;
888
+ }, z.core.$strip>, z.ZodObject<{
889
+ kind: z.ZodLiteral<"date">;
890
+ value: z.ZodString;
891
+ }, z.core.$strip>], "kind">>>;
892
+ }, z.core.$strip>>;
893
+ sampleSummary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
894
+ kind: z.ZodLiteral<"text">;
895
+ value: z.ZodString;
896
+ }, z.core.$strip>, z.ZodObject<{
897
+ kind: z.ZodLiteral<"number">;
898
+ value: z.ZodNumber;
899
+ }, z.core.$strip>, z.ZodObject<{
900
+ kind: z.ZodLiteral<"money">;
901
+ amount: z.ZodNumber;
902
+ currency: z.ZodString;
903
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
904
+ }, z.core.$strip>, z.ZodObject<{
905
+ kind: z.ZodLiteral<"percent">;
906
+ value: z.ZodNumber;
907
+ }, z.core.$strip>, z.ZodObject<{
908
+ kind: z.ZodLiteral<"date">;
909
+ value: z.ZodString;
910
+ }, z.core.$strip>], "kind">>>;
911
+ sampleSections: z.ZodDefault<z.ZodArray<z.ZodObject<{
912
+ key: z.ZodString;
913
+ kind: z.ZodEnum<{
914
+ group: "group";
915
+ ungrouped: "ungrouped";
916
+ }>;
917
+ label: z.ZodNullable<z.ZodString>;
918
+ itemIndexes: z.ZodArray<z.ZodNumber>;
919
+ summary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
920
+ kind: z.ZodLiteral<"text">;
921
+ value: z.ZodString;
922
+ }, z.core.$strip>, z.ZodObject<{
923
+ kind: z.ZodLiteral<"number">;
924
+ value: z.ZodNumber;
925
+ }, z.core.$strip>, z.ZodObject<{
926
+ kind: z.ZodLiteral<"money">;
927
+ amount: z.ZodNumber;
928
+ currency: z.ZodString;
929
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
930
+ }, z.core.$strip>, z.ZodObject<{
931
+ kind: z.ZodLiteral<"percent">;
932
+ value: z.ZodNumber;
933
+ }, z.core.$strip>, z.ZodObject<{
934
+ kind: z.ZodLiteral<"date">;
935
+ value: z.ZodString;
936
+ }, z.core.$strip>], "kind">>>;
937
+ }, z.core.$strip>>>;
938
+ }, z.core.$strip>;
939
+ export type DocumentCollectionDetail = z.infer<typeof documentCollectionDetailSchema>;
940
+ export declare const documentTypeDetailSchema: z.ZodObject<{
941
+ code: z.ZodString;
942
+ moduleId: z.ZodString;
943
+ labelKey: z.ZodString;
944
+ descriptionKey: z.ZodOptional<z.ZodString>;
945
+ selection: z.ZodEnum<{
946
+ default_only: "default_only";
947
+ per_document: "per_document";
948
+ }>;
949
+ templateCount: z.ZodNumber;
950
+ languages: z.ZodNullable<z.ZodArray<z.ZodString>>;
951
+ variables: z.ZodArray<z.ZodObject<{
952
+ key: z.ZodString;
953
+ labelKey: z.ZodString;
954
+ ownerModule: z.ZodString;
955
+ scope: z.ZodEnum<{
956
+ body: "body";
957
+ headerFooter: "headerFooter";
958
+ }>;
959
+ }, z.core.$strip>>;
960
+ sample: z.ZodUnknown;
961
+ builtInContent: z.ZodObject<{
962
+ schemaVersion: z.ZodLiteral<1>;
963
+ languages: z.ZodRecord<z.ZodString, z.ZodObject<{
964
+ root: z.ZodDefault<z.ZodObject<{
965
+ props: z.ZodDefault<z.ZodObject<{
966
+ pageSize: z.ZodOptional<z.ZodEnum<{
967
+ A4: "A4";
968
+ LETTER: "LETTER";
969
+ }>>;
970
+ orientation: z.ZodOptional<z.ZodEnum<{
971
+ auto: "auto";
972
+ portrait: "portrait";
973
+ landscape: "landscape";
974
+ }>>;
975
+ marginTop: z.ZodOptional<z.ZodNumber>;
976
+ marginRight: z.ZodOptional<z.ZodNumber>;
977
+ marginBottom: z.ZodOptional<z.ZodNumber>;
978
+ marginLeft: z.ZodOptional<z.ZodNumber>;
979
+ baseFontSize: z.ZodOptional<z.ZodNumber>;
980
+ headerText: z.ZodOptional<z.ZodString>;
981
+ footerText: z.ZodOptional<z.ZodString>;
982
+ showPageNumbers: z.ZodOptional<z.ZodBoolean>;
983
+ pageNumberFormat: z.ZodOptional<z.ZodString>;
984
+ }, z.core.$loose>>;
985
+ }, z.core.$loose>>;
986
+ content: z.ZodArray<z.ZodObject<{
987
+ type: z.ZodString;
988
+ props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
989
+ }, z.core.$loose>>;
990
+ zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
991
+ }, z.core.$loose>>;
992
+ }, z.core.$strip>;
993
+ pageDefaults: z.ZodObject<{
994
+ pageSize: z.ZodOptional<z.ZodEnum<{
995
+ A4: "A4";
996
+ LETTER: "LETTER";
997
+ }>>;
998
+ orientation: z.ZodOptional<z.ZodEnum<{
999
+ auto: "auto";
1000
+ portrait: "portrait";
1001
+ landscape: "landscape";
1002
+ }>>;
1003
+ marginTop: z.ZodOptional<z.ZodNumber>;
1004
+ marginRight: z.ZodOptional<z.ZodNumber>;
1005
+ marginBottom: z.ZodOptional<z.ZodNumber>;
1006
+ marginLeft: z.ZodOptional<z.ZodNumber>;
1007
+ baseFontSize: z.ZodOptional<z.ZodNumber>;
1008
+ headerText: z.ZodOptional<z.ZodString>;
1009
+ footerText: z.ZodOptional<z.ZodString>;
1010
+ showPageNumbers: z.ZodOptional<z.ZodBoolean>;
1011
+ pageNumberFormat: z.ZodOptional<z.ZodString>;
1012
+ }, z.core.$loose>;
1013
+ collections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1014
+ key: z.ZodString;
1015
+ labelKey: z.ZodString;
1016
+ ownerModule: z.ZodString;
1017
+ fields: z.ZodArray<z.ZodObject<{
1018
+ path: z.ZodString;
1019
+ label: z.ZodString;
1020
+ valueKind: z.ZodEnum<{
1021
+ number: "number";
1022
+ date: "date";
1023
+ text: "text";
1024
+ percent: "percent";
1025
+ money: "money";
1026
+ }>;
1027
+ group: z.ZodString;
1028
+ audience: z.ZodEnum<{
1029
+ customer: "customer";
1030
+ internal: "internal";
1031
+ }>;
1032
+ defaultFormat: z.ZodOptional<z.ZodObject<{
1033
+ decimals: z.ZodOptional<z.ZodNumber>;
1034
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
1035
+ symbol: "symbol";
1036
+ code: "code";
1037
+ none: "none";
1038
+ }>>;
1039
+ dateStyle: z.ZodOptional<z.ZodEnum<{
1040
+ medium: "medium";
1041
+ short: "short";
1042
+ long: "long";
1043
+ }>>;
1044
+ }, z.core.$strip>>;
1045
+ defaultAlign: z.ZodOptional<z.ZodEnum<{
1046
+ left: "left";
1047
+ center: "center";
1048
+ right: "right";
1049
+ }>>;
1050
+ description: z.ZodOptional<z.ZodString>;
1051
+ sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1052
+ kind: z.ZodLiteral<"text">;
1053
+ value: z.ZodString;
1054
+ }, z.core.$strip>, z.ZodObject<{
1055
+ kind: z.ZodLiteral<"number">;
1056
+ value: z.ZodNumber;
1057
+ }, z.core.$strip>, z.ZodObject<{
1058
+ kind: z.ZodLiteral<"money">;
1059
+ amount: z.ZodNumber;
1060
+ currency: z.ZodString;
1061
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
1062
+ }, z.core.$strip>, z.ZodObject<{
1063
+ kind: z.ZodLiteral<"percent">;
1064
+ value: z.ZodNumber;
1065
+ }, z.core.$strip>, z.ZodObject<{
1066
+ kind: z.ZodLiteral<"date">;
1067
+ value: z.ZodString;
1068
+ }, z.core.$strip>], "kind">>>;
1069
+ }, z.core.$strip>>;
1070
+ summaryFields: z.ZodArray<z.ZodObject<{
1071
+ path: z.ZodString;
1072
+ label: z.ZodString;
1073
+ valueKind: z.ZodEnum<{
1074
+ number: "number";
1075
+ date: "date";
1076
+ text: "text";
1077
+ percent: "percent";
1078
+ money: "money";
1079
+ }>;
1080
+ group: z.ZodString;
1081
+ audience: z.ZodEnum<{
1082
+ customer: "customer";
1083
+ internal: "internal";
1084
+ }>;
1085
+ defaultFormat: z.ZodOptional<z.ZodObject<{
1086
+ decimals: z.ZodOptional<z.ZodNumber>;
1087
+ currencyDisplay: z.ZodOptional<z.ZodEnum<{
1088
+ symbol: "symbol";
1089
+ code: "code";
1090
+ none: "none";
1091
+ }>>;
1092
+ dateStyle: z.ZodOptional<z.ZodEnum<{
1093
+ medium: "medium";
1094
+ short: "short";
1095
+ long: "long";
1096
+ }>>;
1097
+ }, z.core.$strip>>;
1098
+ defaultAlign: z.ZodOptional<z.ZodEnum<{
1099
+ left: "left";
1100
+ center: "center";
1101
+ right: "right";
1102
+ }>>;
1103
+ description: z.ZodOptional<z.ZodString>;
1104
+ sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1105
+ kind: z.ZodLiteral<"text">;
1106
+ value: z.ZodString;
1107
+ }, z.core.$strip>, z.ZodObject<{
1108
+ kind: z.ZodLiteral<"number">;
1109
+ value: z.ZodNumber;
1110
+ }, z.core.$strip>, z.ZodObject<{
1111
+ kind: z.ZodLiteral<"money">;
1112
+ amount: z.ZodNumber;
1113
+ currency: z.ZodString;
1114
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
1115
+ }, z.core.$strip>, z.ZodObject<{
1116
+ kind: z.ZodLiteral<"percent">;
1117
+ value: z.ZodNumber;
1118
+ }, z.core.$strip>, z.ZodObject<{
1119
+ kind: z.ZodLiteral<"date">;
1120
+ value: z.ZodString;
1121
+ }, z.core.$strip>], "kind">>>;
1122
+ }, z.core.$strip>>;
1123
+ sampleItems: z.ZodArray<z.ZodObject<{
1124
+ values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1125
+ kind: z.ZodLiteral<"text">;
1126
+ value: z.ZodString;
1127
+ }, z.core.$strip>, z.ZodObject<{
1128
+ kind: z.ZodLiteral<"number">;
1129
+ value: z.ZodNumber;
1130
+ }, z.core.$strip>, z.ZodObject<{
1131
+ kind: z.ZodLiteral<"money">;
1132
+ amount: z.ZodNumber;
1133
+ currency: z.ZodString;
1134
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
1135
+ }, z.core.$strip>, z.ZodObject<{
1136
+ kind: z.ZodLiteral<"percent">;
1137
+ value: z.ZodNumber;
1138
+ }, z.core.$strip>, z.ZodObject<{
1139
+ kind: z.ZodLiteral<"date">;
1140
+ value: z.ZodString;
1141
+ }, z.core.$strip>], "kind">>>;
1142
+ }, z.core.$strip>>;
1143
+ sampleSummary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1144
+ kind: z.ZodLiteral<"text">;
1145
+ value: z.ZodString;
1146
+ }, z.core.$strip>, z.ZodObject<{
1147
+ kind: z.ZodLiteral<"number">;
1148
+ value: z.ZodNumber;
1149
+ }, z.core.$strip>, z.ZodObject<{
1150
+ kind: z.ZodLiteral<"money">;
1151
+ amount: z.ZodNumber;
1152
+ currency: z.ZodString;
1153
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
1154
+ }, z.core.$strip>, z.ZodObject<{
1155
+ kind: z.ZodLiteral<"percent">;
1156
+ value: z.ZodNumber;
1157
+ }, z.core.$strip>, z.ZodObject<{
1158
+ kind: z.ZodLiteral<"date">;
1159
+ value: z.ZodString;
1160
+ }, z.core.$strip>], "kind">>>;
1161
+ sampleSections: z.ZodDefault<z.ZodArray<z.ZodObject<{
1162
+ key: z.ZodString;
1163
+ kind: z.ZodEnum<{
1164
+ group: "group";
1165
+ ungrouped: "ungrouped";
1166
+ }>;
1167
+ label: z.ZodNullable<z.ZodString>;
1168
+ itemIndexes: z.ZodArray<z.ZodNumber>;
1169
+ summary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
1170
+ kind: z.ZodLiteral<"text">;
1171
+ value: z.ZodString;
1172
+ }, z.core.$strip>, z.ZodObject<{
1173
+ kind: z.ZodLiteral<"number">;
1174
+ value: z.ZodNumber;
1175
+ }, z.core.$strip>, z.ZodObject<{
1176
+ kind: z.ZodLiteral<"money">;
1177
+ amount: z.ZodNumber;
1178
+ currency: z.ZodString;
1179
+ unitPrice: z.ZodOptional<z.ZodBoolean>;
1180
+ }, z.core.$strip>, z.ZodObject<{
1181
+ kind: z.ZodLiteral<"percent">;
1182
+ value: z.ZodNumber;
1183
+ }, z.core.$strip>, z.ZodObject<{
1184
+ kind: z.ZodLiteral<"date">;
1185
+ value: z.ZodString;
1186
+ }, z.core.$strip>], "kind">>>;
1187
+ }, z.core.$strip>>>;
1188
+ }, z.core.$strip>>>;
1189
+ }, z.core.$strip>;
1190
+ export type DocumentTypeDetail = z.infer<typeof documentTypeDetailSchema>;
1191
+ export declare const documentBuilderComponentSchema: z.ZodObject<{
1192
+ name: z.ZodString;
1193
+ ownerModule: z.ZodString;
1194
+ label: z.ZodOptional<z.ZodString>;
1195
+ labelKey: z.ZodOptional<z.ZodString>;
1196
+ descriptionKey: z.ZodOptional<z.ZodString>;
1197
+ category: z.ZodOptional<z.ZodString>;
1198
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
1199
+ type: z.ZodEnum<{
1200
+ number: "number";
1201
+ object: "object";
1202
+ array: "array";
1203
+ uuid: "uuid";
1204
+ text: "text";
1205
+ textarea: "textarea";
1206
+ select: "select";
1207
+ radio: "radio";
1208
+ external: "external";
1209
+ richtext: "richtext";
1210
+ color: "color";
1211
+ }>;
1212
+ label: z.ZodOptional<z.ZodString>;
1213
+ required: z.ZodOptional<z.ZodBoolean>;
1214
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1215
+ label: z.ZodString;
1216
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
1217
+ }, z.core.$strip>>>;
1218
+ refKind: z.ZodOptional<z.ZodString>;
1219
+ }, z.core.$strip>>;
1220
+ defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1221
+ weight: z.ZodOptional<z.ZodNumber>;
1222
+ }, z.core.$strip>;
1223
+ export type DocumentBuilderComponent = z.infer<typeof documentBuilderComponentSchema>;
1224
+ export declare const documentBuilderCategorySchema: z.ZodObject<{
1225
+ key: z.ZodString;
1226
+ titleKey: z.ZodString;
1227
+ ownerModule: z.ZodString;
1228
+ weight: z.ZodOptional<z.ZodNumber>;
1229
+ }, z.core.$strip>;
1230
+ export type DocumentBuilderCategory = z.infer<typeof documentBuilderCategorySchema>;
1231
+ /** Route 3 — the Page Builder descriptor of one document type: exactly its palette. */
1232
+ export declare const documentBuilderConfigSchema: z.ZodObject<{
1233
+ schemaVersion: z.ZodLiteral<1>;
1234
+ components: z.ZodArray<z.ZodObject<{
1235
+ name: z.ZodString;
1236
+ ownerModule: z.ZodString;
1237
+ label: z.ZodOptional<z.ZodString>;
1238
+ labelKey: z.ZodOptional<z.ZodString>;
1239
+ descriptionKey: z.ZodOptional<z.ZodString>;
1240
+ category: z.ZodOptional<z.ZodString>;
1241
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
1242
+ type: z.ZodEnum<{
1243
+ number: "number";
1244
+ object: "object";
1245
+ array: "array";
1246
+ uuid: "uuid";
1247
+ text: "text";
1248
+ textarea: "textarea";
1249
+ select: "select";
1250
+ radio: "radio";
1251
+ external: "external";
1252
+ richtext: "richtext";
1253
+ color: "color";
1254
+ }>;
1255
+ label: z.ZodOptional<z.ZodString>;
1256
+ required: z.ZodOptional<z.ZodBoolean>;
1257
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1258
+ label: z.ZodString;
1259
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
1260
+ }, z.core.$strip>>>;
1261
+ refKind: z.ZodOptional<z.ZodString>;
1262
+ }, z.core.$strip>>;
1263
+ defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1264
+ weight: z.ZodOptional<z.ZodNumber>;
1265
+ }, z.core.$strip>>;
1266
+ categories: z.ZodArray<z.ZodObject<{
1267
+ key: z.ZodString;
1268
+ titleKey: z.ZodString;
1269
+ ownerModule: z.ZodString;
1270
+ weight: z.ZodOptional<z.ZodNumber>;
1271
+ }, z.core.$strip>>;
1272
+ rootFields: z.ZodRecord<z.ZodString, z.ZodObject<{
1273
+ type: z.ZodEnum<{
1274
+ number: "number";
1275
+ object: "object";
1276
+ array: "array";
1277
+ uuid: "uuid";
1278
+ text: "text";
1279
+ textarea: "textarea";
1280
+ select: "select";
1281
+ radio: "radio";
1282
+ external: "external";
1283
+ richtext: "richtext";
1284
+ color: "color";
1285
+ }>;
1286
+ label: z.ZodOptional<z.ZodString>;
1287
+ required: z.ZodOptional<z.ZodBoolean>;
1288
+ options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1289
+ label: z.ZodString;
1290
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
1291
+ }, z.core.$strip>>>;
1292
+ refKind: z.ZodOptional<z.ZodString>;
1293
+ }, z.core.$strip>>;
1294
+ }, z.core.$strip>;
1295
+ export type DocumentBuilderConfig = z.infer<typeof documentBuilderConfigSchema>;
1296
+ export declare const documentTemplateSummarySchema: z.ZodObject<{
1297
+ id: z.ZodString;
1298
+ documentType: z.ZodString;
1299
+ name: z.ZodString;
1300
+ salesChannelId: z.ZodNullable<z.ZodString>;
1301
+ salesChannelName: z.ZodNullable<z.ZodString>;
1302
+ languages: z.ZodArray<z.ZodString>;
1303
+ isDefault: z.ZodBoolean;
1304
+ version: z.ZodNumber;
1305
+ updatedAt: z.ZodString;
1306
+ }, z.core.$strip>;
1307
+ export type DocumentTemplateSummary = z.infer<typeof documentTemplateSummarySchema>;
1308
+ export declare const documentTemplateDetailSchema: z.ZodObject<{
1309
+ id: z.ZodString;
1310
+ documentType: z.ZodString;
1311
+ name: z.ZodString;
1312
+ salesChannelId: z.ZodNullable<z.ZodString>;
1313
+ salesChannelName: z.ZodNullable<z.ZodString>;
1314
+ languages: z.ZodArray<z.ZodString>;
1315
+ isDefault: z.ZodBoolean;
1316
+ version: z.ZodNumber;
1317
+ updatedAt: z.ZodString;
1318
+ content: z.ZodObject<{
1319
+ schemaVersion: z.ZodLiteral<1>;
1320
+ languages: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1321
+ }, z.core.$strip>;
1322
+ }, z.core.$strip>;
1323
+ export type DocumentTemplateDetail = z.infer<typeof documentTemplateDetailSchema>;
1324
+ export declare const documentTemplateListQuerySchema: z.ZodObject<{
1325
+ type: z.ZodString;
1326
+ salesChannelId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"global">]>>;
1327
+ applicableToChannel: z.ZodOptional<z.ZodString>;
1328
+ }, z.core.$strip>;
1329
+ export type DocumentTemplateListQuery = z.infer<typeof documentTemplateListQuerySchema>;
1330
+ export declare const createDocumentTemplateBodySchema: z.ZodObject<{
1331
+ documentType: z.ZodString;
1332
+ name: z.ZodString;
1333
+ salesChannelId: z.ZodNullable<z.ZodString>;
1334
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1335
+ kind: z.ZodLiteral<"built_in">;
1336
+ }, z.core.$strip>, z.ZodObject<{
1337
+ kind: z.ZodLiteral<"template">;
1338
+ templateId: z.ZodString;
1339
+ }, z.core.$strip>], "kind">;
1340
+ setDefault: z.ZodDefault<z.ZodBoolean>;
1341
+ }, z.core.$strip>;
1342
+ export type CreateDocumentTemplateBody = z.infer<typeof createDocumentTemplateBodySchema>;
1343
+ export declare const renameDocumentTemplateBodySchema: z.ZodObject<{
1344
+ name: z.ZodString;
1345
+ expectedVersion: z.ZodNumber;
1346
+ }, z.core.$strip>;
1347
+ export type RenameDocumentTemplateBody = z.infer<typeof renameDocumentTemplateBodySchema>;
1348
+ export declare const saveDocumentTemplateContentBodySchema: z.ZodObject<{
1349
+ tree: z.ZodUnknown;
1350
+ expectedVersion: z.ZodNumber;
1351
+ }, z.core.$strip>;
1352
+ export type SaveDocumentTemplateContentBody = z.infer<typeof saveDocumentTemplateContentBodySchema>;
1353
+ export declare const versionedBodySchema: z.ZodObject<{
1354
+ expectedVersion: z.ZodNumber;
1355
+ }, z.core.$strip>;
1356
+ export type VersionedBody = z.infer<typeof versionedBodySchema>;
1357
+ export declare const deleteDocumentTemplateBodySchema: z.ZodObject<{
1358
+ expectedVersion: z.ZodNumber;
1359
+ confirmDefault: z.ZodDefault<z.ZodBoolean>;
1360
+ }, z.core.$strip>;
1361
+ export type DeleteDocumentTemplateBody = z.infer<typeof deleteDocumentTemplateBodySchema>;
1362
+ export declare const previewDocumentBodySchema: z.ZodObject<{
1363
+ documentType: z.ZodString;
1364
+ language: z.ZodString;
1365
+ tree: z.ZodUnknown;
1366
+ }, z.core.$strip>;
1367
+ export type PreviewDocumentBody = z.infer<typeof previewDocumentBodySchema>;
1368
+ //# sourceMappingURL=document-templates.d.ts.map