@endora-commerce/contracts 0.106.0 → 0.107.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.
- package/dist/admin-contributions.d.ts +11 -6
- package/dist/admin-contributions.d.ts.map +1 -1
- package/dist/admin-contributions.js +9 -6
- package/dist/admin-contributions.js.map +1 -1
- package/dist/admin-roles.d.ts +32 -2
- package/dist/admin-roles.d.ts.map +1 -1
- package/dist/admin-roles.js +21 -1
- package/dist/admin-roles.js.map +1 -1
- package/dist/admin-search.d.ts +655 -0
- package/dist/admin-search.d.ts.map +1 -0
- package/dist/admin-search.js +179 -0
- package/dist/admin-search.js.map +1 -0
- package/dist/analytics.d.ts +5 -0
- package/dist/analytics.d.ts.map +1 -1
- package/dist/analytics.js +8 -0
- package/dist/analytics.js.map +1 -1
- package/dist/api-keys.d.ts +6 -0
- package/dist/api-keys.d.ts.map +1 -1
- package/dist/api-keys.js +5 -0
- package/dist/api-keys.js.map +1 -1
- package/dist/assets-library.d.ts +102 -0
- package/dist/assets-library.d.ts.map +1 -1
- package/dist/assets-library.js +89 -0
- package/dist/assets-library.js.map +1 -1
- package/dist/auth.d.ts +20 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +20 -0
- package/dist/auth.js.map +1 -1
- package/dist/blog.d.ts +1 -1
- package/dist/carts.d.ts +21 -6
- package/dist/carts.d.ts.map +1 -1
- package/dist/catalog.d.ts +58 -6
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +31 -0
- package/dist/catalog.js.map +1 -1
- package/dist/cms.d.ts +183 -3
- package/dist/cms.d.ts.map +1 -1
- package/dist/cms.js +132 -1
- package/dist/cms.js.map +1 -1
- package/dist/comparisons.d.ts +73 -0
- package/dist/comparisons.d.ts.map +1 -1
- package/dist/comparisons.js +22 -0
- package/dist/comparisons.js.map +1 -1
- package/dist/credentials.d.ts +23 -0
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +24 -0
- package/dist/credentials.js.map +1 -1
- package/dist/crm.d.ts +1 -1
- package/dist/custom-fields.d.ts +3 -3
- package/dist/customer-accounts.d.ts +92 -2
- package/dist/customer-accounts.d.ts.map +1 -1
- package/dist/document-templates.d.ts +1192 -0
- package/dist/document-templates.d.ts.map +1 -0
- package/dist/document-templates.js +472 -0
- package/dist/document-templates.js.map +1 -0
- package/dist/document-values.d.ts +156 -0
- package/dist/document-values.d.ts.map +1 -0
- package/dist/document-values.js +208 -0
- package/dist/document-values.js.map +1 -0
- package/dist/errors.d.ts +93 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +114 -0
- package/dist/errors.js.map +1 -1
- package/dist/import-export.d.ts +11 -0
- package/dist/import-export.d.ts.map +1 -1
- package/dist/import-export.js +9 -0
- package/dist/import-export.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/invoice-ledger.d.ts +6 -6
- package/dist/invoices.d.ts +88 -0
- package/dist/invoices.d.ts.map +1 -1
- package/dist/invoices.js +12 -0
- package/dist/invoices.js.map +1 -1
- package/dist/mfa.d.ts +20 -0
- package/dist/mfa.d.ts.map +1 -1
- package/dist/modules.d.ts +20 -10
- package/dist/modules.d.ts.map +1 -1
- package/dist/newsletter.d.ts +2 -0
- package/dist/newsletter.d.ts.map +1 -1
- package/dist/newsletter.js +4 -0
- package/dist/newsletter.js.map +1 -1
- package/dist/orders.d.ts +32 -1
- package/dist/orders.d.ts.map +1 -1
- package/dist/orders.js +33 -17
- package/dist/orders.js.map +1 -1
- package/dist/organizations.d.ts +78 -0
- package/dist/organizations.d.ts.map +1 -1
- package/dist/organizations.js +54 -0
- package/dist/organizations.js.map +1 -1
- package/dist/payment-methods.d.ts +2 -2
- package/dist/price-lists.d.ts +491 -2
- package/dist/price-lists.d.ts.map +1 -1
- package/dist/price-lists.js +255 -0
- package/dist/price-lists.js.map +1 -1
- package/dist/product-feeds.d.ts +13 -13
- package/dist/prompt-actions.d.ts +25 -6
- package/dist/prompt-actions.d.ts.map +1 -1
- package/dist/prompt-actions.js +17 -1
- package/dist/prompt-actions.js.map +1 -1
- package/dist/pwa.d.ts +25 -0
- package/dist/pwa.d.ts.map +1 -1
- package/dist/pwa.js +38 -0
- package/dist/pwa.js.map +1 -1
- package/dist/quote-requests.d.ts +633 -8
- package/dist/quote-requests.d.ts.map +1 -1
- package/dist/quote-requests.js +365 -2
- package/dist/quote-requests.js.map +1 -1
- package/dist/sales-channels.d.ts +46 -0
- package/dist/sales-channels.d.ts.map +1 -1
- package/dist/sales-channels.js +40 -0
- package/dist/sales-channels.js.map +1 -1
- package/dist/saved-list-views.d.ts +140 -0
- package/dist/saved-list-views.d.ts.map +1 -0
- package/dist/saved-list-views.js +108 -0
- package/dist/saved-list-views.js.map +1 -0
- package/dist/search.d.ts +6 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/seo.d.ts +2 -0
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +11 -0
- package/dist/seo.js.map +1 -1
- package/dist/shipping-methods.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,1192 @@
|
|
|
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
|
+
money: "money";
|
|
213
|
+
percent: "percent";
|
|
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
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
250
|
+
kind: z.ZodLiteral<"percent">;
|
|
251
|
+
value: z.ZodNumber;
|
|
252
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
253
|
+
kind: z.ZodLiteral<"date">;
|
|
254
|
+
value: z.ZodString;
|
|
255
|
+
}, z.core.$strip>], "kind">>>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
/**
|
|
258
|
+
* The lines of a document a Line items table can print, declared by the
|
|
259
|
+
* document type (contract §1). `fields` is async and per language because part
|
|
260
|
+
* of a catalogue is data (a shop's product attributes); `items` is synchronous
|
|
261
|
+
* and pure over the host's own data, so the facility never queries anything.
|
|
262
|
+
*/
|
|
263
|
+
export interface DocumentCollectionDeclaration<TData = unknown> {
|
|
264
|
+
readonly key: string;
|
|
265
|
+
/** Module-relative i18n key. */
|
|
266
|
+
readonly labelKey: string;
|
|
267
|
+
fields(language: string): Promise<readonly DocumentFieldDefinition[]>;
|
|
268
|
+
items(data: TData): readonly DocumentItem[];
|
|
269
|
+
summaryFields?(language: string): Promise<readonly DocumentFieldDefinition[]>;
|
|
270
|
+
summary?(data: TData): Readonly<Record<string, DocumentValue>>;
|
|
271
|
+
}
|
|
272
|
+
/** Columns may print *always*, *only if any line has a value*, or *never* (D2). */
|
|
273
|
+
export declare const itemsTableColumnConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
274
|
+
op: z.ZodLiteral<"always">;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
op: z.ZodLiteral<"never">;
|
|
277
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
278
|
+
op: z.ZodLiteral<"any_has_value">;
|
|
279
|
+
field: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, z.core.$strip>], "op">;
|
|
281
|
+
/** Detail entries and totals rows: *always*, *only if it has a value*, *never*. */
|
|
282
|
+
export declare const itemsTableEntryConditionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
283
|
+
op: z.ZodLiteral<"always">;
|
|
284
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
285
|
+
op: z.ZodLiteral<"never">;
|
|
286
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
287
|
+
op: z.ZodLiteral<"has_value">;
|
|
288
|
+
field: z.ZodOptional<z.ZodString>;
|
|
289
|
+
}, z.core.$strip>], "op">;
|
|
290
|
+
export declare const itemsTableColumnSchema: z.ZodObject<{
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
field: z.ZodString;
|
|
293
|
+
label: z.ZodDefault<z.ZodString>;
|
|
294
|
+
width: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>]>>;
|
|
295
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
296
|
+
auto: "auto";
|
|
297
|
+
left: "left";
|
|
298
|
+
center: "center";
|
|
299
|
+
right: "right";
|
|
300
|
+
}>>;
|
|
301
|
+
format: z.ZodDefault<z.ZodObject<{
|
|
302
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
304
|
+
symbol: "symbol";
|
|
305
|
+
code: "code";
|
|
306
|
+
none: "none";
|
|
307
|
+
}>>;
|
|
308
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
309
|
+
medium: "medium";
|
|
310
|
+
short: "short";
|
|
311
|
+
long: "long";
|
|
312
|
+
}>>;
|
|
313
|
+
}, z.core.$strip>>;
|
|
314
|
+
emptyText: z.ZodDefault<z.ZodString>;
|
|
315
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
316
|
+
op: z.ZodLiteral<"always">;
|
|
317
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
318
|
+
op: z.ZodLiteral<"never">;
|
|
319
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
320
|
+
op: z.ZodLiteral<"any_has_value">;
|
|
321
|
+
field: z.ZodOptional<z.ZodString>;
|
|
322
|
+
}, z.core.$strip>], "op">>;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
export type ItemsTableColumn = z.infer<typeof itemsTableColumnSchema>;
|
|
325
|
+
export declare const itemsTableDetailEntrySchema: z.ZodObject<{
|
|
326
|
+
field: z.ZodString;
|
|
327
|
+
label: z.ZodDefault<z.ZodString>;
|
|
328
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
329
|
+
op: z.ZodLiteral<"always">;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
op: z.ZodLiteral<"never">;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
op: z.ZodLiteral<"has_value">;
|
|
334
|
+
field: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$strip>], "op">>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
export type ItemsTableDetailEntry = z.infer<typeof itemsTableDetailEntrySchema>;
|
|
338
|
+
export declare const itemsTableDetailRowSchema: z.ZodObject<{
|
|
339
|
+
enabled: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
340
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
341
|
+
field: z.ZodString;
|
|
342
|
+
label: z.ZodDefault<z.ZodString>;
|
|
343
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
344
|
+
op: z.ZodLiteral<"always">;
|
|
345
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
346
|
+
op: z.ZodLiteral<"never">;
|
|
347
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
348
|
+
op: z.ZodLiteral<"has_value">;
|
|
349
|
+
field: z.ZodOptional<z.ZodString>;
|
|
350
|
+
}, z.core.$strip>], "op">>;
|
|
351
|
+
}, z.core.$strip>>>;
|
|
352
|
+
separator: z.ZodDefault<z.ZodString>;
|
|
353
|
+
italics: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
354
|
+
fontSize: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export type ItemsTableDetailRow = z.infer<typeof itemsTableDetailRowSchema>;
|
|
357
|
+
export declare const itemsTableTotalSchema: z.ZodObject<{
|
|
358
|
+
field: z.ZodString;
|
|
359
|
+
label: z.ZodDefault<z.ZodString>;
|
|
360
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
361
|
+
op: z.ZodLiteral<"always">;
|
|
362
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
363
|
+
op: z.ZodLiteral<"never">;
|
|
364
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
365
|
+
op: z.ZodLiteral<"has_value">;
|
|
366
|
+
field: z.ZodOptional<z.ZodString>;
|
|
367
|
+
}, z.core.$strip>], "op">>;
|
|
368
|
+
emphasis: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
369
|
+
}, z.core.$strip>;
|
|
370
|
+
export type ItemsTableTotal = z.infer<typeof itemsTableTotalSchema>;
|
|
371
|
+
export declare const itemsTableGroupingSchema: z.ZodObject<{
|
|
372
|
+
field: z.ZodString;
|
|
373
|
+
emptyLabel: z.ZodDefault<z.ZodString>;
|
|
374
|
+
subtotalField: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
375
|
+
subtotalLabel: z.ZodDefault<z.ZodString>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
export type ItemsTableGrouping = z.infer<typeof itemsTableGroupingSchema>;
|
|
378
|
+
/**
|
|
379
|
+
* The stored props of one `document_templates.ItemsTable` node
|
|
380
|
+
* (`specs/153-quote-request-pdf-template/data-model.md` §2), validated when a
|
|
381
|
+
* template is saved (FR-043). Unknown keys are kept — Puck stores its own `id`.
|
|
382
|
+
* A field path the catalogue does not offer is accepted: the catalogue is data
|
|
383
|
+
* and changes, and such a column prints its empty text (FR-037).
|
|
384
|
+
*/
|
|
385
|
+
export declare const itemsTablePropsSchema: z.ZodObject<{
|
|
386
|
+
collection: z.ZodOptional<z.ZodString>;
|
|
387
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
388
|
+
id: z.ZodString;
|
|
389
|
+
field: z.ZodString;
|
|
390
|
+
label: z.ZodDefault<z.ZodString>;
|
|
391
|
+
width: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"fill">, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>]>>;
|
|
392
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
393
|
+
auto: "auto";
|
|
394
|
+
left: "left";
|
|
395
|
+
center: "center";
|
|
396
|
+
right: "right";
|
|
397
|
+
}>>;
|
|
398
|
+
format: z.ZodDefault<z.ZodObject<{
|
|
399
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
400
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
401
|
+
symbol: "symbol";
|
|
402
|
+
code: "code";
|
|
403
|
+
none: "none";
|
|
404
|
+
}>>;
|
|
405
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
406
|
+
medium: "medium";
|
|
407
|
+
short: "short";
|
|
408
|
+
long: "long";
|
|
409
|
+
}>>;
|
|
410
|
+
}, z.core.$strip>>;
|
|
411
|
+
emptyText: 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<"any_has_value">;
|
|
418
|
+
field: z.ZodOptional<z.ZodString>;
|
|
419
|
+
}, z.core.$strip>], "op">>;
|
|
420
|
+
}, z.core.$strip>>;
|
|
421
|
+
detailRow: z.ZodOptional<z.ZodObject<{
|
|
422
|
+
enabled: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
423
|
+
entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
424
|
+
field: z.ZodString;
|
|
425
|
+
label: z.ZodDefault<z.ZodString>;
|
|
426
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
427
|
+
op: z.ZodLiteral<"always">;
|
|
428
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
429
|
+
op: z.ZodLiteral<"never">;
|
|
430
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
431
|
+
op: z.ZodLiteral<"has_value">;
|
|
432
|
+
field: z.ZodOptional<z.ZodString>;
|
|
433
|
+
}, z.core.$strip>], "op">>;
|
|
434
|
+
}, z.core.$strip>>>;
|
|
435
|
+
separator: z.ZodDefault<z.ZodString>;
|
|
436
|
+
italics: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
437
|
+
fontSize: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
438
|
+
}, z.core.$strip>>;
|
|
439
|
+
totals: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
440
|
+
field: z.ZodString;
|
|
441
|
+
label: z.ZodDefault<z.ZodString>;
|
|
442
|
+
visibleWhen: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
443
|
+
op: z.ZodLiteral<"always">;
|
|
444
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
445
|
+
op: z.ZodLiteral<"never">;
|
|
446
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
447
|
+
op: z.ZodLiteral<"has_value">;
|
|
448
|
+
field: z.ZodOptional<z.ZodString>;
|
|
449
|
+
}, z.core.$strip>], "op">>;
|
|
450
|
+
emphasis: z.ZodDefault<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
451
|
+
}, z.core.$strip>>>;
|
|
452
|
+
grouping: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
453
|
+
field: z.ZodString;
|
|
454
|
+
emptyLabel: z.ZodDefault<z.ZodString>;
|
|
455
|
+
subtotalField: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
456
|
+
subtotalLabel: z.ZodDefault<z.ZodString>;
|
|
457
|
+
}, z.core.$strip>>>;
|
|
458
|
+
emptyText: z.ZodOptional<z.ZodString>;
|
|
459
|
+
headerBackground: z.ZodOptional<z.ZodString>;
|
|
460
|
+
borderColor: z.ZodOptional<z.ZodString>;
|
|
461
|
+
fontSize: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
462
|
+
stripedRows: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
463
|
+
stripeColor: z.ZodOptional<z.ZodString>;
|
|
464
|
+
marginBottom: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>>;
|
|
465
|
+
}, z.core.$loose>;
|
|
466
|
+
export type ItemsTableProps = z.infer<typeof itemsTablePropsSchema>;
|
|
467
|
+
/** Where a template is applied when a document is produced. */
|
|
468
|
+
export interface DocumentRenderContext {
|
|
469
|
+
readonly documentType: string;
|
|
470
|
+
/** The tree language actually used. */
|
|
471
|
+
readonly language: string;
|
|
472
|
+
readonly salesChannelId: string | null;
|
|
473
|
+
readonly preview: boolean;
|
|
474
|
+
/** Usable width in points after margins and orientation. */
|
|
475
|
+
readonly pageWidth: number;
|
|
476
|
+
}
|
|
477
|
+
/** One configurable field of a block, as the builder descriptor serves it. */
|
|
478
|
+
export declare const documentFieldDescriptorSchema: z.ZodObject<{
|
|
479
|
+
type: z.ZodEnum<{
|
|
480
|
+
number: "number";
|
|
481
|
+
object: "object";
|
|
482
|
+
array: "array";
|
|
483
|
+
uuid: "uuid";
|
|
484
|
+
text: "text";
|
|
485
|
+
textarea: "textarea";
|
|
486
|
+
select: "select";
|
|
487
|
+
radio: "radio";
|
|
488
|
+
external: "external";
|
|
489
|
+
richtext: "richtext";
|
|
490
|
+
color: "color";
|
|
491
|
+
}>;
|
|
492
|
+
label: z.ZodOptional<z.ZodString>;
|
|
493
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
494
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
495
|
+
label: z.ZodString;
|
|
496
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
497
|
+
}, z.core.$strip>>>;
|
|
498
|
+
refKind: z.ZodOptional<z.ZodString>;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
export type DocumentFieldDescriptor = z.infer<typeof documentFieldDescriptorSchema>;
|
|
501
|
+
/** A host block's renderer. */
|
|
502
|
+
export interface DocumentBlockRenderer<TData = unknown, TPrepared = unknown> {
|
|
503
|
+
/** `blockNameRe`; the owner segment is `moduleId`. */
|
|
504
|
+
readonly name: string;
|
|
505
|
+
/** Presence-filtered by this id on every call. */
|
|
506
|
+
readonly moduleId: string;
|
|
507
|
+
/** Label and fields when no present manifest declares the block's fields (contributed blocks). */
|
|
508
|
+
describe?(): {
|
|
509
|
+
readonly label: string;
|
|
510
|
+
readonly fields: Readonly<Record<string, DocumentFieldDescriptor>>;
|
|
511
|
+
};
|
|
512
|
+
/** One pdfmake content node. `props` are untrusted stored props over declared `defaultProps`. */
|
|
513
|
+
render(input: {
|
|
514
|
+
readonly props: Readonly<Record<string, unknown>>;
|
|
515
|
+
readonly data: TData;
|
|
516
|
+
readonly prepared: TPrepared;
|
|
517
|
+
readonly language: string;
|
|
518
|
+
readonly context: DocumentRenderContext;
|
|
519
|
+
readonly interpolate: (text: string) => string;
|
|
520
|
+
}): unknown;
|
|
521
|
+
}
|
|
522
|
+
/** Root-prop defaults merged under stored root props, plus non-editable pdfmake styles. */
|
|
523
|
+
export type DocumentPageDefaults = Partial<ResolvedDocumentRootProps> & {
|
|
524
|
+
readonly styles?: Readonly<Record<string, unknown>>;
|
|
525
|
+
};
|
|
526
|
+
export interface DocumentTypeRegistration<TData = unknown, TPrepared = unknown> {
|
|
527
|
+
readonly code: string;
|
|
528
|
+
readonly moduleId: string;
|
|
529
|
+
/** Module-relative i18n key. */
|
|
530
|
+
readonly labelKey: string;
|
|
531
|
+
readonly descriptionKey?: string;
|
|
532
|
+
/** The type's blocks at this moment — called per read and per render. */
|
|
533
|
+
blocks(): readonly DocumentBlockRenderer<TData, TPrepared>[];
|
|
534
|
+
readonly coreBlocks: DocumentCoreBlocks;
|
|
535
|
+
readonly selection: DocumentSelection;
|
|
536
|
+
/** Languages a template may hold; absent = every active content language. */
|
|
537
|
+
readonly languages?: readonly string[];
|
|
538
|
+
readonly variables?: readonly {
|
|
539
|
+
readonly key: string;
|
|
540
|
+
readonly labelKey: string;
|
|
541
|
+
}[];
|
|
542
|
+
resolveVariables?(data: TData, context: DocumentRenderContext): Readonly<Record<string, string | null>>;
|
|
543
|
+
/** The built-in layout, per language. A fresh object per call. */
|
|
544
|
+
defaultContent(): DocumentTemplateContent;
|
|
545
|
+
/** Code layout used when no candidate tree renders anything. */
|
|
546
|
+
renderBuiltIn?(data: TData, prepared: TPrepared, context: DocumentRenderContext): unknown[];
|
|
547
|
+
readonly pageDefaults?: DocumentPageDefaults;
|
|
548
|
+
suggestOrientation?(data: TData): 'portrait' | 'landscape';
|
|
549
|
+
/** Per-render precomputation handed to every block. */
|
|
550
|
+
prepareRender?(data: TData, input: {
|
|
551
|
+
readonly placedBlocks: ReadonlySet<string> | null;
|
|
552
|
+
readonly preview: boolean;
|
|
553
|
+
}): Promise<TPrepared>;
|
|
554
|
+
/** Fictitious, JSON-serialisable sample for the editor and the preview. */
|
|
555
|
+
sampleData(language: string): TData;
|
|
556
|
+
/**
|
|
557
|
+
* The line collections a Line items table can print (feature 153). A type
|
|
558
|
+
* declaring at least one is offered `document_templates.ItemsTable`.
|
|
559
|
+
*/
|
|
560
|
+
readonly collections?: readonly DocumentCollectionDeclaration<TData>[];
|
|
561
|
+
}
|
|
562
|
+
/** Container name: `documentTypeRegistry`. Owner: `document_templates`. Ungated. */
|
|
563
|
+
export interface DocumentTypeRegistryPort {
|
|
564
|
+
register(registration: DocumentTypeRegistration<any, any>): void;
|
|
565
|
+
}
|
|
566
|
+
export interface DocumentRenderInput<TData = unknown> {
|
|
567
|
+
readonly documentType: string;
|
|
568
|
+
/** The document's channel; `null` only for previews and channel-less documents. */
|
|
569
|
+
readonly salesChannelId: string | null;
|
|
570
|
+
readonly language: string;
|
|
571
|
+
readonly data: TData;
|
|
572
|
+
/** Only for `selection: 'per_document'` types. */
|
|
573
|
+
readonly templateId?: string;
|
|
574
|
+
/** An unsaved canvas (the admin preview). Facility-internal. */
|
|
575
|
+
readonly tree?: unknown;
|
|
576
|
+
/** Render as a preview (enrichments may be skipped by the type). */
|
|
577
|
+
readonly preview?: boolean;
|
|
578
|
+
}
|
|
579
|
+
export interface DocumentRenderResult {
|
|
580
|
+
readonly bytes: Uint8Array;
|
|
581
|
+
readonly source: 'explicit' | 'default' | 'built_in' | 'canvas';
|
|
582
|
+
readonly templateId: string | null;
|
|
583
|
+
readonly templateVersion: number | null;
|
|
584
|
+
readonly language: string;
|
|
585
|
+
readonly requestedTemplateMissing: boolean;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* The templates a person may pick for one document (153 contract §5): global
|
|
589
|
+
* ones and those of the document's channel — channel first, then global, each
|
|
590
|
+
* by name — the one a document without a choice would use (`null` = the
|
|
591
|
+
* built-in layout), and the built-in layout's languages.
|
|
592
|
+
*/
|
|
593
|
+
export declare const documentTemplateChoiceSchema: z.ZodObject<{
|
|
594
|
+
id: z.ZodString;
|
|
595
|
+
name: z.ZodString;
|
|
596
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
597
|
+
languages: z.ZodArray<z.ZodString>;
|
|
598
|
+
isDefault: z.ZodBoolean;
|
|
599
|
+
}, z.core.$strip>;
|
|
600
|
+
export type DocumentTemplateChoice = z.infer<typeof documentTemplateChoiceSchema>;
|
|
601
|
+
export declare const documentTemplateChoicesSchema: z.ZodObject<{
|
|
602
|
+
templates: z.ZodArray<z.ZodObject<{
|
|
603
|
+
id: z.ZodString;
|
|
604
|
+
name: z.ZodString;
|
|
605
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
606
|
+
languages: z.ZodArray<z.ZodString>;
|
|
607
|
+
isDefault: z.ZodBoolean;
|
|
608
|
+
}, z.core.$strip>>;
|
|
609
|
+
effectiveDefaultId: z.ZodNullable<z.ZodString>;
|
|
610
|
+
builtInLanguages: z.ZodArray<z.ZodString>;
|
|
611
|
+
}, z.core.$strip>;
|
|
612
|
+
export type DocumentTemplateChoices = z.infer<typeof documentTemplateChoicesSchema>;
|
|
613
|
+
/** Container name: `documentRenderPort`. Owner: `document_templates`. Gated. */
|
|
614
|
+
export interface DocumentRenderPort {
|
|
615
|
+
render<TData>(input: DocumentRenderInput<TData>): Promise<DocumentRenderResult>;
|
|
616
|
+
/**
|
|
617
|
+
* The selection list of a `per_document` type for a document's channel
|
|
618
|
+
* (feature 153) — so a host can offer a picker to people who may not manage
|
|
619
|
+
* templates. A `default_only` type answers `DOCUMENT_TEMPLATE_NOT_SELECTABLE`.
|
|
620
|
+
*/
|
|
621
|
+
listChoices(input: {
|
|
622
|
+
readonly documentType: string;
|
|
623
|
+
readonly salesChannelId: string | null;
|
|
624
|
+
}): Promise<DocumentTemplateChoices>;
|
|
625
|
+
}
|
|
626
|
+
export declare const documentTypeSummarySchema: z.ZodObject<{
|
|
627
|
+
code: z.ZodString;
|
|
628
|
+
moduleId: z.ZodString;
|
|
629
|
+
labelKey: z.ZodString;
|
|
630
|
+
descriptionKey: z.ZodOptional<z.ZodString>;
|
|
631
|
+
selection: z.ZodEnum<{
|
|
632
|
+
default_only: "default_only";
|
|
633
|
+
per_document: "per_document";
|
|
634
|
+
}>;
|
|
635
|
+
templateCount: z.ZodNumber;
|
|
636
|
+
}, z.core.$strip>;
|
|
637
|
+
export type DocumentTypeSummary = z.infer<typeof documentTypeSummarySchema>;
|
|
638
|
+
export declare const documentVariableSchema: z.ZodObject<{
|
|
639
|
+
key: z.ZodString;
|
|
640
|
+
labelKey: z.ZodString;
|
|
641
|
+
ownerModule: z.ZodString;
|
|
642
|
+
scope: z.ZodEnum<{
|
|
643
|
+
body: "body";
|
|
644
|
+
headerFooter: "headerFooter";
|
|
645
|
+
}>;
|
|
646
|
+
}, z.core.$strip>;
|
|
647
|
+
export type DocumentVariable = z.infer<typeof documentVariableSchema>;
|
|
648
|
+
/** One declared collection as the editor needs it (153 contract §4), labels in the requested language. */
|
|
649
|
+
export declare const documentCollectionDetailSchema: z.ZodObject<{
|
|
650
|
+
key: z.ZodString;
|
|
651
|
+
labelKey: z.ZodString;
|
|
652
|
+
ownerModule: z.ZodString;
|
|
653
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
654
|
+
path: z.ZodString;
|
|
655
|
+
label: z.ZodString;
|
|
656
|
+
valueKind: z.ZodEnum<{
|
|
657
|
+
number: "number";
|
|
658
|
+
date: "date";
|
|
659
|
+
text: "text";
|
|
660
|
+
money: "money";
|
|
661
|
+
percent: "percent";
|
|
662
|
+
}>;
|
|
663
|
+
group: z.ZodString;
|
|
664
|
+
audience: z.ZodEnum<{
|
|
665
|
+
customer: "customer";
|
|
666
|
+
internal: "internal";
|
|
667
|
+
}>;
|
|
668
|
+
defaultFormat: z.ZodOptional<z.ZodObject<{
|
|
669
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
670
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
671
|
+
symbol: "symbol";
|
|
672
|
+
code: "code";
|
|
673
|
+
none: "none";
|
|
674
|
+
}>>;
|
|
675
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
676
|
+
medium: "medium";
|
|
677
|
+
short: "short";
|
|
678
|
+
long: "long";
|
|
679
|
+
}>>;
|
|
680
|
+
}, z.core.$strip>>;
|
|
681
|
+
defaultAlign: z.ZodOptional<z.ZodEnum<{
|
|
682
|
+
left: "left";
|
|
683
|
+
center: "center";
|
|
684
|
+
right: "right";
|
|
685
|
+
}>>;
|
|
686
|
+
description: z.ZodOptional<z.ZodString>;
|
|
687
|
+
sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
688
|
+
kind: z.ZodLiteral<"text">;
|
|
689
|
+
value: z.ZodString;
|
|
690
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
691
|
+
kind: z.ZodLiteral<"number">;
|
|
692
|
+
value: z.ZodNumber;
|
|
693
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
694
|
+
kind: z.ZodLiteral<"money">;
|
|
695
|
+
amount: z.ZodNumber;
|
|
696
|
+
currency: z.ZodString;
|
|
697
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
698
|
+
kind: z.ZodLiteral<"percent">;
|
|
699
|
+
value: z.ZodNumber;
|
|
700
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
701
|
+
kind: z.ZodLiteral<"date">;
|
|
702
|
+
value: z.ZodString;
|
|
703
|
+
}, z.core.$strip>], "kind">>>;
|
|
704
|
+
}, z.core.$strip>>;
|
|
705
|
+
summaryFields: z.ZodArray<z.ZodObject<{
|
|
706
|
+
path: z.ZodString;
|
|
707
|
+
label: z.ZodString;
|
|
708
|
+
valueKind: z.ZodEnum<{
|
|
709
|
+
number: "number";
|
|
710
|
+
date: "date";
|
|
711
|
+
text: "text";
|
|
712
|
+
money: "money";
|
|
713
|
+
percent: "percent";
|
|
714
|
+
}>;
|
|
715
|
+
group: z.ZodString;
|
|
716
|
+
audience: z.ZodEnum<{
|
|
717
|
+
customer: "customer";
|
|
718
|
+
internal: "internal";
|
|
719
|
+
}>;
|
|
720
|
+
defaultFormat: z.ZodOptional<z.ZodObject<{
|
|
721
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
722
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
723
|
+
symbol: "symbol";
|
|
724
|
+
code: "code";
|
|
725
|
+
none: "none";
|
|
726
|
+
}>>;
|
|
727
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
728
|
+
medium: "medium";
|
|
729
|
+
short: "short";
|
|
730
|
+
long: "long";
|
|
731
|
+
}>>;
|
|
732
|
+
}, z.core.$strip>>;
|
|
733
|
+
defaultAlign: z.ZodOptional<z.ZodEnum<{
|
|
734
|
+
left: "left";
|
|
735
|
+
center: "center";
|
|
736
|
+
right: "right";
|
|
737
|
+
}>>;
|
|
738
|
+
description: z.ZodOptional<z.ZodString>;
|
|
739
|
+
sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
740
|
+
kind: z.ZodLiteral<"text">;
|
|
741
|
+
value: z.ZodString;
|
|
742
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
743
|
+
kind: z.ZodLiteral<"number">;
|
|
744
|
+
value: z.ZodNumber;
|
|
745
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
746
|
+
kind: z.ZodLiteral<"money">;
|
|
747
|
+
amount: z.ZodNumber;
|
|
748
|
+
currency: z.ZodString;
|
|
749
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
750
|
+
kind: z.ZodLiteral<"percent">;
|
|
751
|
+
value: z.ZodNumber;
|
|
752
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
753
|
+
kind: z.ZodLiteral<"date">;
|
|
754
|
+
value: z.ZodString;
|
|
755
|
+
}, z.core.$strip>], "kind">>>;
|
|
756
|
+
}, z.core.$strip>>;
|
|
757
|
+
sampleItems: z.ZodArray<z.ZodObject<{
|
|
758
|
+
values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
759
|
+
kind: z.ZodLiteral<"text">;
|
|
760
|
+
value: z.ZodString;
|
|
761
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
762
|
+
kind: z.ZodLiteral<"number">;
|
|
763
|
+
value: z.ZodNumber;
|
|
764
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
765
|
+
kind: z.ZodLiteral<"money">;
|
|
766
|
+
amount: z.ZodNumber;
|
|
767
|
+
currency: z.ZodString;
|
|
768
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
769
|
+
kind: z.ZodLiteral<"percent">;
|
|
770
|
+
value: z.ZodNumber;
|
|
771
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
772
|
+
kind: z.ZodLiteral<"date">;
|
|
773
|
+
value: z.ZodString;
|
|
774
|
+
}, z.core.$strip>], "kind">>>;
|
|
775
|
+
}, z.core.$strip>>;
|
|
776
|
+
sampleSummary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
777
|
+
kind: z.ZodLiteral<"text">;
|
|
778
|
+
value: z.ZodString;
|
|
779
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
780
|
+
kind: z.ZodLiteral<"number">;
|
|
781
|
+
value: z.ZodNumber;
|
|
782
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
783
|
+
kind: z.ZodLiteral<"money">;
|
|
784
|
+
amount: z.ZodNumber;
|
|
785
|
+
currency: z.ZodString;
|
|
786
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
787
|
+
kind: z.ZodLiteral<"percent">;
|
|
788
|
+
value: z.ZodNumber;
|
|
789
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
790
|
+
kind: z.ZodLiteral<"date">;
|
|
791
|
+
value: z.ZodString;
|
|
792
|
+
}, z.core.$strip>], "kind">>>;
|
|
793
|
+
}, z.core.$strip>;
|
|
794
|
+
export type DocumentCollectionDetail = z.infer<typeof documentCollectionDetailSchema>;
|
|
795
|
+
export declare const documentTypeDetailSchema: z.ZodObject<{
|
|
796
|
+
code: z.ZodString;
|
|
797
|
+
moduleId: z.ZodString;
|
|
798
|
+
labelKey: z.ZodString;
|
|
799
|
+
descriptionKey: z.ZodOptional<z.ZodString>;
|
|
800
|
+
selection: z.ZodEnum<{
|
|
801
|
+
default_only: "default_only";
|
|
802
|
+
per_document: "per_document";
|
|
803
|
+
}>;
|
|
804
|
+
templateCount: z.ZodNumber;
|
|
805
|
+
languages: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
806
|
+
variables: z.ZodArray<z.ZodObject<{
|
|
807
|
+
key: z.ZodString;
|
|
808
|
+
labelKey: z.ZodString;
|
|
809
|
+
ownerModule: z.ZodString;
|
|
810
|
+
scope: z.ZodEnum<{
|
|
811
|
+
body: "body";
|
|
812
|
+
headerFooter: "headerFooter";
|
|
813
|
+
}>;
|
|
814
|
+
}, z.core.$strip>>;
|
|
815
|
+
sample: z.ZodUnknown;
|
|
816
|
+
builtInContent: z.ZodObject<{
|
|
817
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
818
|
+
languages: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
819
|
+
root: z.ZodDefault<z.ZodObject<{
|
|
820
|
+
props: z.ZodDefault<z.ZodObject<{
|
|
821
|
+
pageSize: z.ZodOptional<z.ZodEnum<{
|
|
822
|
+
A4: "A4";
|
|
823
|
+
LETTER: "LETTER";
|
|
824
|
+
}>>;
|
|
825
|
+
orientation: z.ZodOptional<z.ZodEnum<{
|
|
826
|
+
auto: "auto";
|
|
827
|
+
portrait: "portrait";
|
|
828
|
+
landscape: "landscape";
|
|
829
|
+
}>>;
|
|
830
|
+
marginTop: z.ZodOptional<z.ZodNumber>;
|
|
831
|
+
marginRight: z.ZodOptional<z.ZodNumber>;
|
|
832
|
+
marginBottom: z.ZodOptional<z.ZodNumber>;
|
|
833
|
+
marginLeft: z.ZodOptional<z.ZodNumber>;
|
|
834
|
+
baseFontSize: z.ZodOptional<z.ZodNumber>;
|
|
835
|
+
headerText: z.ZodOptional<z.ZodString>;
|
|
836
|
+
footerText: z.ZodOptional<z.ZodString>;
|
|
837
|
+
showPageNumbers: z.ZodOptional<z.ZodBoolean>;
|
|
838
|
+
pageNumberFormat: z.ZodOptional<z.ZodString>;
|
|
839
|
+
}, z.core.$loose>>;
|
|
840
|
+
}, z.core.$loose>>;
|
|
841
|
+
content: z.ZodArray<z.ZodObject<{
|
|
842
|
+
type: z.ZodString;
|
|
843
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
844
|
+
}, z.core.$loose>>;
|
|
845
|
+
zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
846
|
+
}, z.core.$loose>>;
|
|
847
|
+
}, z.core.$strip>;
|
|
848
|
+
pageDefaults: z.ZodObject<{
|
|
849
|
+
pageSize: z.ZodOptional<z.ZodEnum<{
|
|
850
|
+
A4: "A4";
|
|
851
|
+
LETTER: "LETTER";
|
|
852
|
+
}>>;
|
|
853
|
+
orientation: z.ZodOptional<z.ZodEnum<{
|
|
854
|
+
auto: "auto";
|
|
855
|
+
portrait: "portrait";
|
|
856
|
+
landscape: "landscape";
|
|
857
|
+
}>>;
|
|
858
|
+
marginTop: z.ZodOptional<z.ZodNumber>;
|
|
859
|
+
marginRight: z.ZodOptional<z.ZodNumber>;
|
|
860
|
+
marginBottom: z.ZodOptional<z.ZodNumber>;
|
|
861
|
+
marginLeft: z.ZodOptional<z.ZodNumber>;
|
|
862
|
+
baseFontSize: z.ZodOptional<z.ZodNumber>;
|
|
863
|
+
headerText: z.ZodOptional<z.ZodString>;
|
|
864
|
+
footerText: z.ZodOptional<z.ZodString>;
|
|
865
|
+
showPageNumbers: z.ZodOptional<z.ZodBoolean>;
|
|
866
|
+
pageNumberFormat: z.ZodOptional<z.ZodString>;
|
|
867
|
+
}, z.core.$loose>;
|
|
868
|
+
collections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
869
|
+
key: z.ZodString;
|
|
870
|
+
labelKey: z.ZodString;
|
|
871
|
+
ownerModule: z.ZodString;
|
|
872
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
873
|
+
path: z.ZodString;
|
|
874
|
+
label: z.ZodString;
|
|
875
|
+
valueKind: z.ZodEnum<{
|
|
876
|
+
number: "number";
|
|
877
|
+
date: "date";
|
|
878
|
+
text: "text";
|
|
879
|
+
money: "money";
|
|
880
|
+
percent: "percent";
|
|
881
|
+
}>;
|
|
882
|
+
group: z.ZodString;
|
|
883
|
+
audience: z.ZodEnum<{
|
|
884
|
+
customer: "customer";
|
|
885
|
+
internal: "internal";
|
|
886
|
+
}>;
|
|
887
|
+
defaultFormat: z.ZodOptional<z.ZodObject<{
|
|
888
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
889
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
890
|
+
symbol: "symbol";
|
|
891
|
+
code: "code";
|
|
892
|
+
none: "none";
|
|
893
|
+
}>>;
|
|
894
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
895
|
+
medium: "medium";
|
|
896
|
+
short: "short";
|
|
897
|
+
long: "long";
|
|
898
|
+
}>>;
|
|
899
|
+
}, z.core.$strip>>;
|
|
900
|
+
defaultAlign: z.ZodOptional<z.ZodEnum<{
|
|
901
|
+
left: "left";
|
|
902
|
+
center: "center";
|
|
903
|
+
right: "right";
|
|
904
|
+
}>>;
|
|
905
|
+
description: z.ZodOptional<z.ZodString>;
|
|
906
|
+
sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
907
|
+
kind: z.ZodLiteral<"text">;
|
|
908
|
+
value: z.ZodString;
|
|
909
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
910
|
+
kind: z.ZodLiteral<"number">;
|
|
911
|
+
value: z.ZodNumber;
|
|
912
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
913
|
+
kind: z.ZodLiteral<"money">;
|
|
914
|
+
amount: z.ZodNumber;
|
|
915
|
+
currency: z.ZodString;
|
|
916
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
917
|
+
kind: z.ZodLiteral<"percent">;
|
|
918
|
+
value: z.ZodNumber;
|
|
919
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
920
|
+
kind: z.ZodLiteral<"date">;
|
|
921
|
+
value: z.ZodString;
|
|
922
|
+
}, z.core.$strip>], "kind">>>;
|
|
923
|
+
}, z.core.$strip>>;
|
|
924
|
+
summaryFields: z.ZodArray<z.ZodObject<{
|
|
925
|
+
path: z.ZodString;
|
|
926
|
+
label: z.ZodString;
|
|
927
|
+
valueKind: z.ZodEnum<{
|
|
928
|
+
number: "number";
|
|
929
|
+
date: "date";
|
|
930
|
+
text: "text";
|
|
931
|
+
money: "money";
|
|
932
|
+
percent: "percent";
|
|
933
|
+
}>;
|
|
934
|
+
group: z.ZodString;
|
|
935
|
+
audience: z.ZodEnum<{
|
|
936
|
+
customer: "customer";
|
|
937
|
+
internal: "internal";
|
|
938
|
+
}>;
|
|
939
|
+
defaultFormat: z.ZodOptional<z.ZodObject<{
|
|
940
|
+
decimals: z.ZodOptional<z.ZodNumber>;
|
|
941
|
+
currencyDisplay: z.ZodOptional<z.ZodEnum<{
|
|
942
|
+
symbol: "symbol";
|
|
943
|
+
code: "code";
|
|
944
|
+
none: "none";
|
|
945
|
+
}>>;
|
|
946
|
+
dateStyle: z.ZodOptional<z.ZodEnum<{
|
|
947
|
+
medium: "medium";
|
|
948
|
+
short: "short";
|
|
949
|
+
long: "long";
|
|
950
|
+
}>>;
|
|
951
|
+
}, z.core.$strip>>;
|
|
952
|
+
defaultAlign: z.ZodOptional<z.ZodEnum<{
|
|
953
|
+
left: "left";
|
|
954
|
+
center: "center";
|
|
955
|
+
right: "right";
|
|
956
|
+
}>>;
|
|
957
|
+
description: z.ZodOptional<z.ZodString>;
|
|
958
|
+
sampleValue: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
959
|
+
kind: z.ZodLiteral<"text">;
|
|
960
|
+
value: z.ZodString;
|
|
961
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
962
|
+
kind: z.ZodLiteral<"number">;
|
|
963
|
+
value: z.ZodNumber;
|
|
964
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
965
|
+
kind: z.ZodLiteral<"money">;
|
|
966
|
+
amount: z.ZodNumber;
|
|
967
|
+
currency: z.ZodString;
|
|
968
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
969
|
+
kind: z.ZodLiteral<"percent">;
|
|
970
|
+
value: z.ZodNumber;
|
|
971
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
972
|
+
kind: z.ZodLiteral<"date">;
|
|
973
|
+
value: z.ZodString;
|
|
974
|
+
}, z.core.$strip>], "kind">>>;
|
|
975
|
+
}, z.core.$strip>>;
|
|
976
|
+
sampleItems: z.ZodArray<z.ZodObject<{
|
|
977
|
+
values: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
978
|
+
kind: z.ZodLiteral<"text">;
|
|
979
|
+
value: z.ZodString;
|
|
980
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
981
|
+
kind: z.ZodLiteral<"number">;
|
|
982
|
+
value: z.ZodNumber;
|
|
983
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
984
|
+
kind: z.ZodLiteral<"money">;
|
|
985
|
+
amount: z.ZodNumber;
|
|
986
|
+
currency: z.ZodString;
|
|
987
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
988
|
+
kind: z.ZodLiteral<"percent">;
|
|
989
|
+
value: z.ZodNumber;
|
|
990
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
991
|
+
kind: z.ZodLiteral<"date">;
|
|
992
|
+
value: z.ZodString;
|
|
993
|
+
}, z.core.$strip>], "kind">>>;
|
|
994
|
+
}, z.core.$strip>>;
|
|
995
|
+
sampleSummary: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
996
|
+
kind: z.ZodLiteral<"text">;
|
|
997
|
+
value: z.ZodString;
|
|
998
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
999
|
+
kind: z.ZodLiteral<"number">;
|
|
1000
|
+
value: z.ZodNumber;
|
|
1001
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1002
|
+
kind: z.ZodLiteral<"money">;
|
|
1003
|
+
amount: z.ZodNumber;
|
|
1004
|
+
currency: z.ZodString;
|
|
1005
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1006
|
+
kind: z.ZodLiteral<"percent">;
|
|
1007
|
+
value: z.ZodNumber;
|
|
1008
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1009
|
+
kind: z.ZodLiteral<"date">;
|
|
1010
|
+
value: z.ZodString;
|
|
1011
|
+
}, z.core.$strip>], "kind">>>;
|
|
1012
|
+
}, z.core.$strip>>>;
|
|
1013
|
+
}, z.core.$strip>;
|
|
1014
|
+
export type DocumentTypeDetail = z.infer<typeof documentTypeDetailSchema>;
|
|
1015
|
+
export declare const documentBuilderComponentSchema: z.ZodObject<{
|
|
1016
|
+
name: z.ZodString;
|
|
1017
|
+
ownerModule: z.ZodString;
|
|
1018
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1019
|
+
labelKey: z.ZodOptional<z.ZodString>;
|
|
1020
|
+
descriptionKey: z.ZodOptional<z.ZodString>;
|
|
1021
|
+
category: z.ZodOptional<z.ZodString>;
|
|
1022
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1023
|
+
type: z.ZodEnum<{
|
|
1024
|
+
number: "number";
|
|
1025
|
+
object: "object";
|
|
1026
|
+
array: "array";
|
|
1027
|
+
uuid: "uuid";
|
|
1028
|
+
text: "text";
|
|
1029
|
+
textarea: "textarea";
|
|
1030
|
+
select: "select";
|
|
1031
|
+
radio: "radio";
|
|
1032
|
+
external: "external";
|
|
1033
|
+
richtext: "richtext";
|
|
1034
|
+
color: "color";
|
|
1035
|
+
}>;
|
|
1036
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1038
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1039
|
+
label: z.ZodString;
|
|
1040
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
1041
|
+
}, z.core.$strip>>>;
|
|
1042
|
+
refKind: z.ZodOptional<z.ZodString>;
|
|
1043
|
+
}, z.core.$strip>>;
|
|
1044
|
+
defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1045
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1046
|
+
}, z.core.$strip>;
|
|
1047
|
+
export type DocumentBuilderComponent = z.infer<typeof documentBuilderComponentSchema>;
|
|
1048
|
+
export declare const documentBuilderCategorySchema: z.ZodObject<{
|
|
1049
|
+
key: z.ZodString;
|
|
1050
|
+
titleKey: z.ZodString;
|
|
1051
|
+
ownerModule: z.ZodString;
|
|
1052
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1053
|
+
}, z.core.$strip>;
|
|
1054
|
+
export type DocumentBuilderCategory = z.infer<typeof documentBuilderCategorySchema>;
|
|
1055
|
+
/** Route 3 — the Page Builder descriptor of one document type: exactly its palette. */
|
|
1056
|
+
export declare const documentBuilderConfigSchema: z.ZodObject<{
|
|
1057
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
1058
|
+
components: z.ZodArray<z.ZodObject<{
|
|
1059
|
+
name: z.ZodString;
|
|
1060
|
+
ownerModule: z.ZodString;
|
|
1061
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1062
|
+
labelKey: z.ZodOptional<z.ZodString>;
|
|
1063
|
+
descriptionKey: z.ZodOptional<z.ZodString>;
|
|
1064
|
+
category: z.ZodOptional<z.ZodString>;
|
|
1065
|
+
fields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1066
|
+
type: z.ZodEnum<{
|
|
1067
|
+
number: "number";
|
|
1068
|
+
object: "object";
|
|
1069
|
+
array: "array";
|
|
1070
|
+
uuid: "uuid";
|
|
1071
|
+
text: "text";
|
|
1072
|
+
textarea: "textarea";
|
|
1073
|
+
select: "select";
|
|
1074
|
+
radio: "radio";
|
|
1075
|
+
external: "external";
|
|
1076
|
+
richtext: "richtext";
|
|
1077
|
+
color: "color";
|
|
1078
|
+
}>;
|
|
1079
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1080
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1081
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1082
|
+
label: z.ZodString;
|
|
1083
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
1084
|
+
}, z.core.$strip>>>;
|
|
1085
|
+
refKind: z.ZodOptional<z.ZodString>;
|
|
1086
|
+
}, z.core.$strip>>;
|
|
1087
|
+
defaultProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1088
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1089
|
+
}, z.core.$strip>>;
|
|
1090
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
1091
|
+
key: z.ZodString;
|
|
1092
|
+
titleKey: z.ZodString;
|
|
1093
|
+
ownerModule: z.ZodString;
|
|
1094
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
1095
|
+
}, z.core.$strip>>;
|
|
1096
|
+
rootFields: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1097
|
+
type: z.ZodEnum<{
|
|
1098
|
+
number: "number";
|
|
1099
|
+
object: "object";
|
|
1100
|
+
array: "array";
|
|
1101
|
+
uuid: "uuid";
|
|
1102
|
+
text: "text";
|
|
1103
|
+
textarea: "textarea";
|
|
1104
|
+
select: "select";
|
|
1105
|
+
radio: "radio";
|
|
1106
|
+
external: "external";
|
|
1107
|
+
richtext: "richtext";
|
|
1108
|
+
color: "color";
|
|
1109
|
+
}>;
|
|
1110
|
+
label: z.ZodOptional<z.ZodString>;
|
|
1111
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
1112
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1113
|
+
label: z.ZodString;
|
|
1114
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
1115
|
+
}, z.core.$strip>>>;
|
|
1116
|
+
refKind: z.ZodOptional<z.ZodString>;
|
|
1117
|
+
}, z.core.$strip>>;
|
|
1118
|
+
}, z.core.$strip>;
|
|
1119
|
+
export type DocumentBuilderConfig = z.infer<typeof documentBuilderConfigSchema>;
|
|
1120
|
+
export declare const documentTemplateSummarySchema: z.ZodObject<{
|
|
1121
|
+
id: z.ZodString;
|
|
1122
|
+
documentType: z.ZodString;
|
|
1123
|
+
name: z.ZodString;
|
|
1124
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1125
|
+
salesChannelName: z.ZodNullable<z.ZodString>;
|
|
1126
|
+
languages: z.ZodArray<z.ZodString>;
|
|
1127
|
+
isDefault: z.ZodBoolean;
|
|
1128
|
+
version: z.ZodNumber;
|
|
1129
|
+
updatedAt: z.ZodString;
|
|
1130
|
+
}, z.core.$strip>;
|
|
1131
|
+
export type DocumentTemplateSummary = z.infer<typeof documentTemplateSummarySchema>;
|
|
1132
|
+
export declare const documentTemplateDetailSchema: z.ZodObject<{
|
|
1133
|
+
id: z.ZodString;
|
|
1134
|
+
documentType: z.ZodString;
|
|
1135
|
+
name: z.ZodString;
|
|
1136
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1137
|
+
salesChannelName: z.ZodNullable<z.ZodString>;
|
|
1138
|
+
languages: z.ZodArray<z.ZodString>;
|
|
1139
|
+
isDefault: z.ZodBoolean;
|
|
1140
|
+
version: z.ZodNumber;
|
|
1141
|
+
updatedAt: z.ZodString;
|
|
1142
|
+
content: z.ZodObject<{
|
|
1143
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
1144
|
+
languages: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1145
|
+
}, z.core.$strip>;
|
|
1146
|
+
}, z.core.$strip>;
|
|
1147
|
+
export type DocumentTemplateDetail = z.infer<typeof documentTemplateDetailSchema>;
|
|
1148
|
+
export declare const documentTemplateListQuerySchema: z.ZodObject<{
|
|
1149
|
+
type: z.ZodString;
|
|
1150
|
+
salesChannelId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"global">]>>;
|
|
1151
|
+
applicableToChannel: z.ZodOptional<z.ZodString>;
|
|
1152
|
+
}, z.core.$strip>;
|
|
1153
|
+
export type DocumentTemplateListQuery = z.infer<typeof documentTemplateListQuerySchema>;
|
|
1154
|
+
export declare const createDocumentTemplateBodySchema: z.ZodObject<{
|
|
1155
|
+
documentType: z.ZodString;
|
|
1156
|
+
name: z.ZodString;
|
|
1157
|
+
salesChannelId: z.ZodNullable<z.ZodString>;
|
|
1158
|
+
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1159
|
+
kind: z.ZodLiteral<"built_in">;
|
|
1160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1161
|
+
kind: z.ZodLiteral<"template">;
|
|
1162
|
+
templateId: z.ZodString;
|
|
1163
|
+
}, z.core.$strip>], "kind">;
|
|
1164
|
+
setDefault: z.ZodDefault<z.ZodBoolean>;
|
|
1165
|
+
}, z.core.$strip>;
|
|
1166
|
+
export type CreateDocumentTemplateBody = z.infer<typeof createDocumentTemplateBodySchema>;
|
|
1167
|
+
export declare const renameDocumentTemplateBodySchema: z.ZodObject<{
|
|
1168
|
+
name: z.ZodString;
|
|
1169
|
+
expectedVersion: z.ZodNumber;
|
|
1170
|
+
}, z.core.$strip>;
|
|
1171
|
+
export type RenameDocumentTemplateBody = z.infer<typeof renameDocumentTemplateBodySchema>;
|
|
1172
|
+
export declare const saveDocumentTemplateContentBodySchema: z.ZodObject<{
|
|
1173
|
+
tree: z.ZodUnknown;
|
|
1174
|
+
expectedVersion: z.ZodNumber;
|
|
1175
|
+
}, z.core.$strip>;
|
|
1176
|
+
export type SaveDocumentTemplateContentBody = z.infer<typeof saveDocumentTemplateContentBodySchema>;
|
|
1177
|
+
export declare const versionedBodySchema: z.ZodObject<{
|
|
1178
|
+
expectedVersion: z.ZodNumber;
|
|
1179
|
+
}, z.core.$strip>;
|
|
1180
|
+
export type VersionedBody = z.infer<typeof versionedBodySchema>;
|
|
1181
|
+
export declare const deleteDocumentTemplateBodySchema: z.ZodObject<{
|
|
1182
|
+
expectedVersion: z.ZodNumber;
|
|
1183
|
+
confirmDefault: z.ZodDefault<z.ZodBoolean>;
|
|
1184
|
+
}, z.core.$strip>;
|
|
1185
|
+
export type DeleteDocumentTemplateBody = z.infer<typeof deleteDocumentTemplateBodySchema>;
|
|
1186
|
+
export declare const previewDocumentBodySchema: z.ZodObject<{
|
|
1187
|
+
documentType: z.ZodString;
|
|
1188
|
+
language: z.ZodString;
|
|
1189
|
+
tree: z.ZodUnknown;
|
|
1190
|
+
}, z.core.$strip>;
|
|
1191
|
+
export type PreviewDocumentBody = z.infer<typeof previewDocumentBodySchema>;
|
|
1192
|
+
//# sourceMappingURL=document-templates.d.ts.map
|