@broberg/mail-templates 0.1.0 → 0.2.2

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/index.d.cts CHANGED
@@ -9,61 +9,25 @@ declare function escapeAttr(s: string): string;
9
9
  * vn-leker, reviewing their own v1: a body field that takes `<p class style>`
10
10
  * works while one person writes both halves — a foreign filler either loses all
11
11
  * formatting (plain text) or breaks the layout (HTML). */
12
- declare const MailBlock: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
12
+ declare const MailBlock: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
13
  type: z.ZodLiteral<"paragraph">;
14
14
  text: z.ZodString;
15
- }, "strip", z.ZodTypeAny, {
16
- type: "paragraph";
17
- text: string;
18
- }, {
19
- type: "paragraph";
20
- text: string;
21
- }>, z.ZodObject<{
15
+ }, z.core.$strip>, z.ZodObject<{
22
16
  type: z.ZodLiteral<"heading">;
23
17
  text: z.ZodString;
24
- }, "strip", z.ZodTypeAny, {
25
- type: "heading";
26
- text: string;
27
- }, {
28
- type: "heading";
29
- text: string;
30
- }>, z.ZodObject<{
18
+ }, z.core.$strip>, z.ZodObject<{
31
19
  type: z.ZodLiteral<"note">;
32
20
  text: z.ZodString;
33
- }, "strip", z.ZodTypeAny, {
34
- type: "note";
35
- text: string;
36
- }, {
37
- type: "note";
38
- text: string;
39
- }>, z.ZodObject<{
21
+ }, z.core.$strip>, z.ZodObject<{
40
22
  type: z.ZodLiteral<"button">;
41
23
  text: z.ZodString;
42
24
  url: z.ZodString;
43
- }, "strip", z.ZodTypeAny, {
44
- type: "button";
45
- text: string;
46
- url: string;
47
- }, {
48
- type: "button";
49
- text: string;
50
- url: string;
51
- }>, z.ZodObject<{
25
+ }, z.core.$strip>, z.ZodObject<{
52
26
  type: z.ZodLiteral<"divider">;
53
- }, "strip", z.ZodTypeAny, {
54
- type: "divider";
55
- }, {
56
- type: "divider";
57
- }>, z.ZodObject<{
27
+ }, z.core.$strip>, z.ZodObject<{
58
28
  type: z.ZodLiteral<"html">;
59
29
  text: z.ZodString;
60
- }, "strip", z.ZodTypeAny, {
61
- type: "html";
62
- text: string;
63
- }, {
64
- type: "html";
65
- text: string;
66
- }>]>;
30
+ }, z.core.$strip>], "type">;
67
31
  type MailBlock = z.infer<typeof MailBlock>;
68
32
  /** A brand COLOUR — REFUSED, not escaped, when it is not one.
69
33
  *
@@ -75,6 +39,11 @@ type MailBlock = z.infer<typeof MailBlock>;
75
39
  declare function isBrandColor(v: string): boolean;
76
40
  /** A font STACK may hold quotes and commas, never a tag delimiter or a quote that closes its attribute. */
77
41
  declare function isFontStack(v: string): boolean;
42
+ /** Ceilings on what a stored override may hold — far above any real template, low
43
+ * enough that a hostile body costs one issue, not one per element. */
44
+ declare const MAX_BLOCKS = 100;
45
+ declare const MAX_FOOTER_LINES = 20;
46
+ declare const MAX_COPY_KEYS = 200;
78
47
  /** Brand values, ALL optional — and EMPTY is a value, not an absence (fd-sundhed
79
48
  * renders different, correct copy for an empty partner name). */
80
49
  declare const MailBrand: z.ZodObject<{
@@ -82,452 +51,102 @@ declare const MailBrand: z.ZodObject<{
82
51
  senderName: z.ZodOptional<z.ZodString>;
83
52
  senderTitle: z.ZodOptional<z.ZodString>;
84
53
  senderEmail: z.ZodOptional<z.ZodString>;
85
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
86
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
87
- logoUrl: z.ZodOptional<z.ZodString>;
88
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
89
- logoWidth: z.ZodOptional<z.ZodNumber>;
90
- logoCid: z.ZodOptional<z.ZodString>;
91
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
92
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
93
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
94
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
95
- webfontHref: z.ZodOptional<z.ZodString>;
96
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
97
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
98
- partner: z.ZodOptional<z.ZodString>;
99
- senderName: z.ZodOptional<z.ZodString>;
100
- senderTitle: z.ZodOptional<z.ZodString>;
101
- senderEmail: z.ZodOptional<z.ZodString>;
102
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
103
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
104
54
  logoUrl: z.ZodOptional<z.ZodString>;
105
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
106
55
  logoWidth: z.ZodOptional<z.ZodNumber>;
107
56
  logoCid: z.ZodOptional<z.ZodString>;
108
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
109
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
110
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
111
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
57
+ colorAccent: z.ZodOptional<z.ZodString>;
58
+ colorInk: z.ZodOptional<z.ZodString>;
59
+ fontSans: z.ZodOptional<z.ZodString>;
60
+ fontSerif: z.ZodOptional<z.ZodString>;
112
61
  webfontHref: z.ZodOptional<z.ZodString>;
113
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
114
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
115
- partner: z.ZodOptional<z.ZodString>;
116
- senderName: z.ZodOptional<z.ZodString>;
117
- senderTitle: z.ZodOptional<z.ZodString>;
118
- senderEmail: z.ZodOptional<z.ZodString>;
119
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
120
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
121
- logoUrl: z.ZodOptional<z.ZodString>;
122
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
123
- logoWidth: z.ZodOptional<z.ZodNumber>;
124
- logoCid: z.ZodOptional<z.ZodString>;
125
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
126
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
127
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
128
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
129
- webfontHref: z.ZodOptional<z.ZodString>;
130
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
131
- }, z.ZodTypeAny, "passthrough">>;
62
+ footerLines: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
+ }, z.core.$loose>;
132
64
  type MailBrand = z.infer<typeof MailBrand>;
133
65
  /** Greeting, sign-off and other fixed phrases are DATA, per language (vn-leker runs da/no/sv). */
134
- declare const MailCopy: z.ZodRecord<z.ZodString, z.ZodString>;
66
+ declare const MailCopy: z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodString>>;
135
67
  type MailCopy = z.infer<typeof MailCopy>;
136
68
  /** One template, keyed on its PURPOSE (fd-sport's model: a project has a set, not one file). */
137
69
  declare const MailTemplate: z.ZodObject<{
138
70
  purpose: z.ZodString;
139
71
  subject: z.ZodString;
140
- blocks: z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
72
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
141
73
  type: z.ZodLiteral<"paragraph">;
142
74
  text: z.ZodString;
143
- }, "strip", z.ZodTypeAny, {
144
- type: "paragraph";
145
- text: string;
146
- }, {
147
- type: "paragraph";
148
- text: string;
149
- }>, z.ZodObject<{
75
+ }, z.core.$strip>, z.ZodObject<{
150
76
  type: z.ZodLiteral<"heading">;
151
77
  text: z.ZodString;
152
- }, "strip", z.ZodTypeAny, {
153
- type: "heading";
154
- text: string;
155
- }, {
156
- type: "heading";
157
- text: string;
158
- }>, z.ZodObject<{
78
+ }, z.core.$strip>, z.ZodObject<{
159
79
  type: z.ZodLiteral<"note">;
160
80
  text: z.ZodString;
161
- }, "strip", z.ZodTypeAny, {
162
- type: "note";
163
- text: string;
164
- }, {
165
- type: "note";
166
- text: string;
167
- }>, z.ZodObject<{
81
+ }, z.core.$strip>, z.ZodObject<{
168
82
  type: z.ZodLiteral<"button">;
169
83
  text: z.ZodString;
170
84
  url: z.ZodString;
171
- }, "strip", z.ZodTypeAny, {
172
- type: "button";
173
- text: string;
174
- url: string;
175
- }, {
176
- type: "button";
177
- text: string;
178
- url: string;
179
- }>, z.ZodObject<{
85
+ }, z.core.$strip>, z.ZodObject<{
180
86
  type: z.ZodLiteral<"divider">;
181
- }, "strip", z.ZodTypeAny, {
182
- type: "divider";
183
- }, {
184
- type: "divider";
185
- }>, z.ZodObject<{
87
+ }, z.core.$strip>, z.ZodObject<{
186
88
  type: z.ZodLiteral<"html">;
187
89
  text: z.ZodString;
188
- }, "strip", z.ZodTypeAny, {
189
- type: "html";
190
- text: string;
191
- }, {
192
- type: "html";
193
- text: string;
194
- }>]>, "many">;
195
- /** Required-or-derived, never silently empty — see derivePreheader. */
90
+ }, z.core.$strip>], "type">>;
196
91
  preheader: z.ZodOptional<z.ZodString>;
197
92
  brand: z.ZodOptional<z.ZodObject<{
198
93
  partner: z.ZodOptional<z.ZodString>;
199
94
  senderName: z.ZodOptional<z.ZodString>;
200
95
  senderTitle: z.ZodOptional<z.ZodString>;
201
96
  senderEmail: z.ZodOptional<z.ZodString>;
202
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
203
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
204
- logoUrl: z.ZodOptional<z.ZodString>;
205
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
206
- logoWidth: z.ZodOptional<z.ZodNumber>;
207
- logoCid: z.ZodOptional<z.ZodString>;
208
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
209
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
210
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
211
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
212
- webfontHref: z.ZodOptional<z.ZodString>;
213
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
214
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
215
- partner: z.ZodOptional<z.ZodString>;
216
- senderName: z.ZodOptional<z.ZodString>;
217
- senderTitle: z.ZodOptional<z.ZodString>;
218
- senderEmail: z.ZodOptional<z.ZodString>;
219
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
220
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
221
- logoUrl: z.ZodOptional<z.ZodString>;
222
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
223
- logoWidth: z.ZodOptional<z.ZodNumber>;
224
- logoCid: z.ZodOptional<z.ZodString>;
225
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
226
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
227
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
228
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
229
- webfontHref: z.ZodOptional<z.ZodString>;
230
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
231
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
232
- partner: z.ZodOptional<z.ZodString>;
233
- senderName: z.ZodOptional<z.ZodString>;
234
- senderTitle: z.ZodOptional<z.ZodString>;
235
- senderEmail: z.ZodOptional<z.ZodString>;
236
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
237
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
238
- logoUrl: z.ZodOptional<z.ZodString>;
239
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
240
- logoWidth: z.ZodOptional<z.ZodNumber>;
241
- logoCid: z.ZodOptional<z.ZodString>;
242
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
243
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
244
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
245
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
246
- webfontHref: z.ZodOptional<z.ZodString>;
247
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
248
- }, z.ZodTypeAny, "passthrough">>>;
249
- copy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
250
- }, "strip", z.ZodTypeAny, {
251
- purpose: string;
252
- subject: string;
253
- blocks: ({
254
- type: "paragraph";
255
- text: string;
256
- } | {
257
- type: "heading";
258
- text: string;
259
- } | {
260
- type: "note";
261
- text: string;
262
- } | {
263
- type: "button";
264
- text: string;
265
- url: string;
266
- } | {
267
- type: "divider";
268
- } | {
269
- type: "html";
270
- text: string;
271
- })[];
272
- preheader?: string | undefined;
273
- brand?: z.objectOutputType<{
274
- partner: z.ZodOptional<z.ZodString>;
275
- senderName: z.ZodOptional<z.ZodString>;
276
- senderTitle: z.ZodOptional<z.ZodString>;
277
- senderEmail: z.ZodOptional<z.ZodString>;
278
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
279
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
280
- logoUrl: z.ZodOptional<z.ZodString>;
281
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
282
- logoWidth: z.ZodOptional<z.ZodNumber>;
283
- logoCid: z.ZodOptional<z.ZodString>;
284
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
285
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
286
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
287
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
288
- webfontHref: z.ZodOptional<z.ZodString>;
289
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
290
- }, z.ZodTypeAny, "passthrough"> | undefined;
291
- copy?: Record<string, string> | undefined;
292
- }, {
293
- purpose: string;
294
- subject: string;
295
- blocks: ({
296
- type: "paragraph";
297
- text: string;
298
- } | {
299
- type: "heading";
300
- text: string;
301
- } | {
302
- type: "note";
303
- text: string;
304
- } | {
305
- type: "button";
306
- text: string;
307
- url: string;
308
- } | {
309
- type: "divider";
310
- } | {
311
- type: "html";
312
- text: string;
313
- })[];
314
- preheader?: string | undefined;
315
- brand?: z.objectInputType<{
316
- partner: z.ZodOptional<z.ZodString>;
317
- senderName: z.ZodOptional<z.ZodString>;
318
- senderTitle: z.ZodOptional<z.ZodString>;
319
- senderEmail: z.ZodOptional<z.ZodString>;
320
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
321
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
322
97
  logoUrl: z.ZodOptional<z.ZodString>;
323
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
324
98
  logoWidth: z.ZodOptional<z.ZodNumber>;
325
99
  logoCid: z.ZodOptional<z.ZodString>;
326
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
327
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
328
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
329
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
100
+ colorAccent: z.ZodOptional<z.ZodString>;
101
+ colorInk: z.ZodOptional<z.ZodString>;
102
+ fontSans: z.ZodOptional<z.ZodString>;
103
+ fontSerif: z.ZodOptional<z.ZodString>;
330
104
  webfontHref: z.ZodOptional<z.ZodString>;
331
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
332
- }, z.ZodTypeAny, "passthrough"> | undefined;
333
- copy?: Record<string, string> | undefined;
334
- }>;
105
+ footerLines: z.ZodOptional<z.ZodArray<z.ZodString>>;
106
+ }, z.core.$loose>>;
107
+ copy: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodString>>>;
108
+ }, z.core.$strip>;
335
109
  type MailTemplate = z.infer<typeof MailTemplate>;
336
110
  /** What a tenant stores to change a coded default. Every field optional; `purpose` is the key, not a field. */
337
111
  declare const MailTemplateOverride: z.ZodObject<{
338
112
  subject: z.ZodOptional<z.ZodString>;
339
- blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
113
+ blocks: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
340
114
  type: z.ZodLiteral<"paragraph">;
341
115
  text: z.ZodString;
342
- }, "strip", z.ZodTypeAny, {
343
- type: "paragraph";
344
- text: string;
345
- }, {
346
- type: "paragraph";
347
- text: string;
348
- }>, z.ZodObject<{
116
+ }, z.core.$strip>, z.ZodObject<{
349
117
  type: z.ZodLiteral<"heading">;
350
118
  text: z.ZodString;
351
- }, "strip", z.ZodTypeAny, {
352
- type: "heading";
353
- text: string;
354
- }, {
355
- type: "heading";
356
- text: string;
357
- }>, z.ZodObject<{
119
+ }, z.core.$strip>, z.ZodObject<{
358
120
  type: z.ZodLiteral<"note">;
359
121
  text: z.ZodString;
360
- }, "strip", z.ZodTypeAny, {
361
- type: "note";
362
- text: string;
363
- }, {
364
- type: "note";
365
- text: string;
366
- }>, z.ZodObject<{
122
+ }, z.core.$strip>, z.ZodObject<{
367
123
  type: z.ZodLiteral<"button">;
368
124
  text: z.ZodString;
369
125
  url: z.ZodString;
370
- }, "strip", z.ZodTypeAny, {
371
- type: "button";
372
- text: string;
373
- url: string;
374
- }, {
375
- type: "button";
376
- text: string;
377
- url: string;
378
- }>, z.ZodObject<{
126
+ }, z.core.$strip>, z.ZodObject<{
379
127
  type: z.ZodLiteral<"divider">;
380
- }, "strip", z.ZodTypeAny, {
381
- type: "divider";
382
- }, {
383
- type: "divider";
384
- }>, z.ZodObject<{
128
+ }, z.core.$strip>, z.ZodObject<{
385
129
  type: z.ZodLiteral<"html">;
386
130
  text: z.ZodString;
387
- }, "strip", z.ZodTypeAny, {
388
- type: "html";
389
- text: string;
390
- }, {
391
- type: "html";
392
- text: string;
393
- }>]>, "many">>;
131
+ }, z.core.$strip>], "type">>>;
394
132
  preheader: z.ZodOptional<z.ZodString>;
395
133
  brand: z.ZodOptional<z.ZodObject<{
396
134
  partner: z.ZodOptional<z.ZodString>;
397
135
  senderName: z.ZodOptional<z.ZodString>;
398
136
  senderTitle: z.ZodOptional<z.ZodString>;
399
137
  senderEmail: z.ZodOptional<z.ZodString>;
400
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
401
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
402
- logoUrl: z.ZodOptional<z.ZodString>;
403
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
404
- logoWidth: z.ZodOptional<z.ZodNumber>;
405
- logoCid: z.ZodOptional<z.ZodString>;
406
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
407
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
408
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
409
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
410
- webfontHref: z.ZodOptional<z.ZodString>;
411
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
412
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
413
- partner: z.ZodOptional<z.ZodString>;
414
- senderName: z.ZodOptional<z.ZodString>;
415
- senderTitle: z.ZodOptional<z.ZodString>;
416
- senderEmail: z.ZodOptional<z.ZodString>;
417
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
418
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
419
- logoUrl: z.ZodOptional<z.ZodString>;
420
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
421
- logoWidth: z.ZodOptional<z.ZodNumber>;
422
- logoCid: z.ZodOptional<z.ZodString>;
423
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
424
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
425
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
426
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
427
- webfontHref: z.ZodOptional<z.ZodString>;
428
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
429
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
430
- partner: z.ZodOptional<z.ZodString>;
431
- senderName: z.ZodOptional<z.ZodString>;
432
- senderTitle: z.ZodOptional<z.ZodString>;
433
- senderEmail: z.ZodOptional<z.ZodString>;
434
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
435
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
436
- logoUrl: z.ZodOptional<z.ZodString>;
437
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
438
- logoWidth: z.ZodOptional<z.ZodNumber>;
439
- logoCid: z.ZodOptional<z.ZodString>;
440
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
441
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
442
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
443
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
444
- webfontHref: z.ZodOptional<z.ZodString>;
445
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
446
- }, z.ZodTypeAny, "passthrough">>>;
447
- copy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
448
- }, "strip", z.ZodTypeAny, {
449
- subject?: string | undefined;
450
- blocks?: ({
451
- type: "paragraph";
452
- text: string;
453
- } | {
454
- type: "heading";
455
- text: string;
456
- } | {
457
- type: "note";
458
- text: string;
459
- } | {
460
- type: "button";
461
- text: string;
462
- url: string;
463
- } | {
464
- type: "divider";
465
- } | {
466
- type: "html";
467
- text: string;
468
- })[] | undefined;
469
- preheader?: string | undefined;
470
- brand?: z.objectOutputType<{
471
- partner: z.ZodOptional<z.ZodString>;
472
- senderName: z.ZodOptional<z.ZodString>;
473
- senderTitle: z.ZodOptional<z.ZodString>;
474
- senderEmail: z.ZodOptional<z.ZodString>;
475
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
476
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
477
- logoUrl: z.ZodOptional<z.ZodString>;
478
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
479
- logoWidth: z.ZodOptional<z.ZodNumber>;
480
- logoCid: z.ZodOptional<z.ZodString>;
481
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
482
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
483
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
484
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
485
- webfontHref: z.ZodOptional<z.ZodString>;
486
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
487
- }, z.ZodTypeAny, "passthrough"> | undefined;
488
- copy?: Record<string, string> | undefined;
489
- }, {
490
- subject?: string | undefined;
491
- blocks?: ({
492
- type: "paragraph";
493
- text: string;
494
- } | {
495
- type: "heading";
496
- text: string;
497
- } | {
498
- type: "note";
499
- text: string;
500
- } | {
501
- type: "button";
502
- text: string;
503
- url: string;
504
- } | {
505
- type: "divider";
506
- } | {
507
- type: "html";
508
- text: string;
509
- })[] | undefined;
510
- preheader?: string | undefined;
511
- brand?: z.objectInputType<{
512
- partner: z.ZodOptional<z.ZodString>;
513
- senderName: z.ZodOptional<z.ZodString>;
514
- senderTitle: z.ZodOptional<z.ZodString>;
515
- senderEmail: z.ZodOptional<z.ZodString>;
516
- /** Both delivery forms: a hosted URL works from any sender; a CID only if the
517
- * sender attaches the bytes with that Content-ID (sanne shipped a broken logo twice). */
518
138
  logoUrl: z.ZodOptional<z.ZodString>;
519
- /** px. Outlook ignores CSS dimensions on an image; only the HTML attribute holds. */
520
139
  logoWidth: z.ZodOptional<z.ZodNumber>;
521
140
  logoCid: z.ZodOptional<z.ZodString>;
522
- colorAccent: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
523
- colorInk: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
524
- fontSans: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
525
- fontSerif: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
141
+ colorAccent: z.ZodOptional<z.ZodString>;
142
+ colorInk: z.ZodOptional<z.ZodString>;
143
+ fontSans: z.ZodOptional<z.ZodString>;
144
+ fontSerif: z.ZodOptional<z.ZodString>;
526
145
  webfontHref: z.ZodOptional<z.ZodString>;
527
- footerLines: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
528
- }, z.ZodTypeAny, "passthrough"> | undefined;
529
- copy?: Record<string, string> | undefined;
530
- }>;
146
+ footerLines: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
+ }, z.core.$loose>>;
148
+ copy: z.ZodOptional<z.ZodPipe<z.ZodUnknown, z.ZodRecord<z.ZodString, z.ZodString>>>;
149
+ }, z.core.$strip>;
531
150
  type MailTemplateOverride = z.infer<typeof MailTemplateOverride>;
532
151
  /** The class vocabulary the shell styles — SMALL AND CLOSED. fd-sundhed's dark-mode
533
152
  * rules target classes IN the content, so the hooks have to be agreed names. */
@@ -659,4 +278,4 @@ declare function canonicalContent(t: MailTemplate & Record<string, unknown>): st
659
278
  /** SHA-256 hex over canonical content. Submission and sync check must call THIS — two hashers drift. */
660
279
  declare function hashContent(canonical: string): Promise<string>;
661
280
 
662
- export { type EffectiveTemplate, MAIL_CLASSES, MailBlock, MailBrand, MailCopy, type MailPrimitives, MailTemplate, MailTemplateOverride, type RenderedTemplate, canonicalContent, checkUrl, derivePreheader, escapeAttr, escapeHtml, fillPlaceholders, fillPlaceholdersRaw, hashContent, isBrandColor, isFontStack, listEffectiveTemplates, renderBlocks, renderTemplate, resolveTemplate };
281
+ export { type EffectiveTemplate, MAIL_CLASSES, MAX_BLOCKS, MAX_COPY_KEYS, MAX_FOOTER_LINES, MailBlock, MailBrand, MailCopy, type MailPrimitives, MailTemplate, MailTemplateOverride, type RenderedTemplate, canonicalContent, checkUrl, derivePreheader, escapeAttr, escapeHtml, fillPlaceholders, fillPlaceholdersRaw, hashContent, isBrandColor, isFontStack, listEffectiveTemplates, renderBlocks, renderTemplate, resolveTemplate };