@joelincc/mailroom 0.1.0 → 0.3.1
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/README.md +54 -8
- package/SECURITY.md +1 -1
- package/bin/mailroom.mjs +26 -0
- package/dist/broadcast/config.js +79 -0
- package/dist/broadcast/explain.js +50 -0
- package/dist/cli/args.js +29 -0
- package/dist/cli/errors.js +37 -0
- package/dist/cli/main.js +533 -0
- package/dist/compose/clicks.js +29 -0
- package/dist/compose/compose.js +275 -0
- package/dist/compose/index.js +8 -0
- package/dist/compose/markdown.js +1197 -0
- package/dist/compose/personalize.js +123 -0
- package/dist/compose/preflight.js +251 -0
- package/dist/compose/preview.js +41 -0
- package/dist/compose/render.js +141 -0
- package/dist/compose/template.js +118 -0
- package/docs/broadcast.md +199 -0
- package/docs/composing.md +156 -0
- package/docs/desk-commands.md +52 -0
- package/docs/export.md +52 -0
- package/docs/lists.md +68 -0
- package/docs/security-model.md +6 -4
- package/docs/ses.md +116 -0
- package/docs/tracking.md +102 -0
- package/docs/unsubscribe.md +124 -0
- package/docs/welcome.md +72 -0
- package/migrations/0004_last_error.sql +2 -0
- package/migrations/0005_lists.sql +41 -0
- package/migrations/0006_broadcast.sql +154 -0
- package/migrations/0007_unsubscribe.sql +12 -0
- package/migrations/0008_tracking.sql +5 -0
- package/migrations/0009_welcome.sql +17 -0
- package/package.json +21 -3
- package/src/alert.ts +123 -0
- package/src/aws-sigv4.ts +100 -0
- package/src/broadcast/audience.ts +96 -0
- package/src/broadcast/campaigns.ts +352 -0
- package/src/broadcast/config.ts +136 -0
- package/src/broadcast/dispatch.ts +779 -0
- package/src/broadcast/events.ts +110 -0
- package/src/broadcast/explain.ts +73 -0
- package/src/broadcast/freeze.ts +93 -0
- package/src/broadcast/index.ts +21 -0
- package/src/broadcast/postman.ts +229 -0
- package/src/broadcast/reconcile.ts +120 -0
- package/src/broadcast/routes.ts +181 -0
- package/src/broadcast/ses.ts +181 -0
- package/src/broadcast/stats.ts +59 -0
- package/src/broadcast/status.ts +60 -0
- package/src/broadcast/test-send.ts +88 -0
- package/src/broadcast/warmup.ts +150 -0
- package/src/broadcast/worker.ts +218 -0
- package/src/cf-events.ts +4 -3
- package/src/cli/args.ts +27 -0
- package/src/cli/errors.ts +39 -0
- package/src/cli/main.ts +515 -0
- package/src/compose/clicks.ts +45 -0
- package/src/compose/compose.ts +297 -0
- package/src/compose/index.ts +8 -0
- package/src/compose/markdown.ts +1173 -0
- package/src/compose/personalize.ts +130 -0
- package/src/compose/preflight.ts +250 -0
- package/src/compose/preview.ts +58 -0
- package/src/compose/render.ts +158 -0
- package/src/compose/template.ts +197 -0
- package/src/core.ts +45 -2
- package/src/export.ts +184 -0
- package/src/feedback.ts +128 -0
- package/src/http.ts +17 -0
- package/src/index.ts +146 -32
- package/src/list-routes.ts +55 -0
- package/src/lists.ts +381 -0
- package/src/ses-events.ts +426 -0
- package/src/track.ts +409 -0
- package/src/unsub-wiring.ts +64 -0
- package/src/unsub.ts +499 -0
- package/src/webhook.ts +5 -3
- package/src/welcome.ts +257 -0
- package/wrangler.example.jsonc +16 -2
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
// 產信:原稿(markdown)+樣板 → 一期信件的 HTML、純文字、連結表、標頭。
|
|
2
|
+
// 這一側只「產生」:轉址服務與事件記錄是別的零件。輸出裡帶著要在寄出時才填的佔位(見 personalize.ts):
|
|
3
|
+
// {{name}} {{email}} {{unsubscribe_url}} {{web_url}}、{{c:N}}(第 N 個連結的簽章)、{{o}}(開信圖的簽章)。
|
|
4
|
+
import { parseMarkdown, type Block, type Inline, type Problem } from './markdown.ts';
|
|
5
|
+
import { renderBodyHtml, renderBodyText } from './render.ts';
|
|
6
|
+
import type { EmailTemplate } from './template.ts';
|
|
7
|
+
|
|
8
|
+
export interface ComposeOptions {
|
|
9
|
+
/** 原稿(含 frontmatter 的 markdown)。 */
|
|
10
|
+
source: string;
|
|
11
|
+
template: EmailTemplate;
|
|
12
|
+
/** 期號:進 utm_campaign。只收英數、連字號、底線、點。 */
|
|
13
|
+
issue: string;
|
|
14
|
+
/** 主旨;沒給就用 frontmatter 的 title。 */
|
|
15
|
+
subject?: string;
|
|
16
|
+
/** 預覽文字;沒給就用 frontmatter 的 description。 */
|
|
17
|
+
preheader?: string;
|
|
18
|
+
/** 追蹤轉址的根網址(https,例 https://t.example.com)。沒給=不改寫連結、不放開信圖。 */
|
|
19
|
+
trackBase?: string;
|
|
20
|
+
/** 原稿裡的相對圖片網址(/x.png)用這個補成絕對網址。 */
|
|
21
|
+
assetBase?: string;
|
|
22
|
+
/** 原稿裡的相對連結用這個補成絕對網址。 */
|
|
23
|
+
siteBase?: string;
|
|
24
|
+
utmSource?: string;
|
|
25
|
+
utmMedium?: string;
|
|
26
|
+
/** 純文字版的連結是否也走追蹤轉址(預設是)。 */
|
|
27
|
+
trackInText?: boolean;
|
|
28
|
+
/** 退訂標頭要不要多帶 mailto(`<{{unsubscribe_url}}>, <{{unsubscribe_mailto}}>`)。開了之後,personalize 的收件人資料必須帶 unsubscribe_mailto。 */
|
|
29
|
+
unsubscribeMailto?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface LinkRecord {
|
|
33
|
+
/** 1 起算,對應 {{c:N}}。 */
|
|
34
|
+
index: number;
|
|
35
|
+
/** 補完 utm 之後、要轉去的最終網址。 */
|
|
36
|
+
url: string;
|
|
37
|
+
/** 原稿裡的網址(補成絕對之後、加 utm 之前)。 */
|
|
38
|
+
original: string;
|
|
39
|
+
text: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ImageRecord {
|
|
43
|
+
src: string;
|
|
44
|
+
alt: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ComposeResult {
|
|
48
|
+
subject: string;
|
|
49
|
+
preheader: string;
|
|
50
|
+
html: string;
|
|
51
|
+
text: string;
|
|
52
|
+
/** 兩個退訂標頭(含 {{unsubscribe_url}} 佔位,寄出時一起填)。 */
|
|
53
|
+
headers: Record<string, string>;
|
|
54
|
+
links: LinkRecord[];
|
|
55
|
+
images: ImageRecord[];
|
|
56
|
+
problems: Problem[];
|
|
57
|
+
/** 原稿 frontmatter 的單行欄位。 */
|
|
58
|
+
frontmatter: Record<string, string>;
|
|
59
|
+
/** html 的位元組數(UTF-8)。 */
|
|
60
|
+
htmlBytes: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const PLACEHOLDER_HREF = /^\{\{(web_url|unsubscribe_url)\}\}$/;
|
|
64
|
+
const ISSUE_RE = /^[A-Za-z0-9._-]{1,64}$/;
|
|
65
|
+
|
|
66
|
+
function absolutize(u: string, base: string | undefined): string | null {
|
|
67
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(u)) return u;
|
|
68
|
+
if (u.startsWith('//')) return `https:${u}`;
|
|
69
|
+
if (!base) return null;
|
|
70
|
+
try {
|
|
71
|
+
return new URL(u, base).toString();
|
|
72
|
+
} catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** 補 utm:直接接在原本網址後面,不重組查詢字串(帶簽章的網址、逗號、斜線都原樣保留);已有的 utm_* 不蓋。 */
|
|
78
|
+
function addUtm(u: string, p: { source: string; medium: string; campaign: string }): string {
|
|
79
|
+
const hashAt = u.indexOf('#');
|
|
80
|
+
const frag = hashAt >= 0 ? u.slice(hashAt) : '';
|
|
81
|
+
let base = hashAt >= 0 ? u.slice(0, hashAt) : u;
|
|
82
|
+
const add: string[] = [];
|
|
83
|
+
for (const [k, v] of [['utm_source', p.source], ['utm_medium', p.medium], ['utm_campaign', p.campaign]] as const) {
|
|
84
|
+
if (!new RegExp(`[?&]${k}=`).test(base)) add.push(`${k}=${encodeURIComponent(v)}`);
|
|
85
|
+
}
|
|
86
|
+
if (add.length === 0) return u;
|
|
87
|
+
base += base.includes('?') ? (/[?&]$/.test(base) ? '' : '&') : '?';
|
|
88
|
+
return base + add.join('&') + frag;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const plain = (ns: Inline[]): string =>
|
|
92
|
+
ns
|
|
93
|
+
.map((n) => (n.t === 'text' || n.t === 'code' ? n.v : n.t === 'strong' || n.t === 'em' || n.t === 'link' ? plain(n.c) : n.t === 'image' ? n.alt : ' '))
|
|
94
|
+
.join('')
|
|
95
|
+
.replace(/\s+/g, ' ')
|
|
96
|
+
.trim();
|
|
97
|
+
|
|
98
|
+
/** 走一遍所有區塊,處理連結(補絕對、加 utm、編號、改寫)與圖片(補絕對、記下來)。 */
|
|
99
|
+
function walk(blocks: Block[], visit: (n: Inline) => void): void {
|
|
100
|
+
const inl = (ns: Inline[]) => {
|
|
101
|
+
for (const n of ns) {
|
|
102
|
+
visit(n);
|
|
103
|
+
if (n.t === 'strong' || n.t === 'em') inl(n.c);
|
|
104
|
+
else if (n.t === 'link') inl(n.c);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
for (const b of blocks) {
|
|
108
|
+
if (b.t === 'p' || b.t === 'h') inl(b.c);
|
|
109
|
+
else if (b.t === 'quote') walk(b.c, visit);
|
|
110
|
+
else if (b.t === 'list') for (const it of b.items) walk(it, visit);
|
|
111
|
+
else if (b.t === 'table') {
|
|
112
|
+
for (const c of b.head) inl(c);
|
|
113
|
+
for (const r of b.rows) for (const c of r) inl(c);
|
|
114
|
+
} else if (b.t === 'image') {
|
|
115
|
+
if (b.link) {
|
|
116
|
+
visit(b.link);
|
|
117
|
+
inl(b.link.c);
|
|
118
|
+
} else visit({ t: 'image', src: b.src, alt: b.alt });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function compose(opts: ComposeOptions): ComposeResult {
|
|
124
|
+
const parsed = parseMarkdown(opts.source);
|
|
125
|
+
const problems: Problem[] = [...parsed.problems];
|
|
126
|
+
const fm = parsed.frontmatter;
|
|
127
|
+
if (!ISSUE_RE.test(opts.issue)) problems.push({ code: 'issue_invalid', severity: 'error', message: '期號只能用英數、連字號、底線、點(1–64 字)', where: opts.issue });
|
|
128
|
+
|
|
129
|
+
let trackBase: string | undefined;
|
|
130
|
+
if (opts.trackBase) {
|
|
131
|
+
try {
|
|
132
|
+
const u = new URL(opts.trackBase);
|
|
133
|
+
if (u.protocol !== 'https:') throw new Error('not https');
|
|
134
|
+
trackBase = `${u.origin}`;
|
|
135
|
+
} catch {
|
|
136
|
+
problems.push({ code: 'track_base_invalid', severity: 'error', message: '追蹤網址必須是 https 的根網址', where: opts.trackBase });
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const utm = { source: opts.utmSource ?? 'newsletter', medium: opts.utmMedium ?? 'email', campaign: opts.issue };
|
|
141
|
+
const links: LinkRecord[] = [];
|
|
142
|
+
const images: ImageRecord[] = [];
|
|
143
|
+
const trackInText = opts.trackInText ?? true;
|
|
144
|
+
|
|
145
|
+
// 圖片區塊與行內圖片都要補絕對網址:先就地改 src
|
|
146
|
+
const fixImage = (img: { src: string; alt: string }) => {
|
|
147
|
+
const abs = absolutize(img.src, opts.assetBase);
|
|
148
|
+
if (abs === null || !/^https?:\/\//i.test(abs)) {
|
|
149
|
+
problems.push({ code: 'image_not_absolute', severity: 'error', message: '圖片網址不是完整的 http(s) 網址(信裡的圖一定要用絕對網址)', where: img.src.slice(0, 80) });
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
img.src = abs;
|
|
153
|
+
};
|
|
154
|
+
const seenImg = new Set<object>();
|
|
155
|
+
const seenKey = new Set<string>();
|
|
156
|
+
const markImage = (img: { src: string; alt: string }) => {
|
|
157
|
+
if (seenImg.has(img)) return;
|
|
158
|
+
seenImg.add(img);
|
|
159
|
+
fixImage(img);
|
|
160
|
+
const key = `${img.src}\u0000${img.alt}`;
|
|
161
|
+
if (seenKey.has(key)) return;
|
|
162
|
+
seenKey.add(key);
|
|
163
|
+
images.push({ src: img.src, alt: img.alt });
|
|
164
|
+
};
|
|
165
|
+
for (const b of parsed.blocks) walkImageBlocks(b, markImage);
|
|
166
|
+
|
|
167
|
+
walk(parsed.blocks, (n) => {
|
|
168
|
+
if (n.t === 'image') {
|
|
169
|
+
if (!seenImg.has(n)) markImage(n);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (n.t !== 'link' || n.idx !== undefined || n.out !== undefined) return;
|
|
173
|
+
const href = n.href.trim();
|
|
174
|
+
if (PLACEHOLDER_HREF.test(href)) {
|
|
175
|
+
n.out = href;
|
|
176
|
+
n.tu = href;
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (/^(mailto:|tel:)/i.test(href)) {
|
|
180
|
+
n.out = href;
|
|
181
|
+
n.tu = href;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (href.startsWith('#')) {
|
|
185
|
+
n.out = '';
|
|
186
|
+
n.tu = '';
|
|
187
|
+
problems.push({ code: 'anchor_link', severity: 'warn', message: '頁內錨點連結在信裡沒有意義,已拿掉連結只留文字', where: href.slice(0, 60) });
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const abs = absolutize(href, opts.siteBase);
|
|
191
|
+
if (abs === null || !/^https?:\/\//i.test(abs)) {
|
|
192
|
+
n.out = '';
|
|
193
|
+
n.tu = '';
|
|
194
|
+
problems.push({
|
|
195
|
+
code: abs === null ? 'link_not_absolute' : 'unsafe_link',
|
|
196
|
+
severity: 'error',
|
|
197
|
+
message: abs === null ? '連結不是完整網址,也沒有 siteBase 可以補' : '連結用了不允許的網址協定(只收 http/https/mailto/tel)',
|
|
198
|
+
where: href.slice(0, 80),
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
const finalUrl = addUtm(abs, utm);
|
|
203
|
+
const index = links.length + 1;
|
|
204
|
+
links.push({ index, url: finalUrl, original: abs, text: plain(n.c).slice(0, 120) });
|
|
205
|
+
n.idx = index;
|
|
206
|
+
if (trackBase) {
|
|
207
|
+
n.out = `${trackBase}/c/{{c:${index}}}`;
|
|
208
|
+
n.tu = trackInText ? n.out : finalUrl;
|
|
209
|
+
} else {
|
|
210
|
+
n.out = finalUrl;
|
|
211
|
+
n.tu = finalUrl;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
for (const b of flatBlocks(parsed.blocks)) if (b.t === 'embed') problems.push({ code: 'embed_replaced', severity: 'info', message: '嵌入內容(影片、互動圖表)已換成「到網站看」的連結卡' });
|
|
215
|
+
|
|
216
|
+
const subject = (opts.subject ?? fm.title ?? '').trim();
|
|
217
|
+
const preheader = (opts.preheader ?? fm.description ?? '').trim();
|
|
218
|
+
const t = opts.template;
|
|
219
|
+
const bodyHtml = renderBodyHtml(parsed.blocks, t.theme, t.labels);
|
|
220
|
+
const bodyText = renderBodyText(parsed.blocks, t.labels);
|
|
221
|
+
const pixelUrl = trackBase ? `${trackBase}/o/{{o}}.gif` : undefined;
|
|
222
|
+
const parts = { subject, preheader, bodyHtml, bodyText, pixelUrl };
|
|
223
|
+
const html = t.renderHtml(parts);
|
|
224
|
+
const text = t.renderText(parts);
|
|
225
|
+
checkOutputForComments(parsed.blocks, parts, t, problems);
|
|
226
|
+
|
|
227
|
+
return {
|
|
228
|
+
subject,
|
|
229
|
+
preheader,
|
|
230
|
+
html,
|
|
231
|
+
text,
|
|
232
|
+
headers: {
|
|
233
|
+
'List-Unsubscribe': opts.unsubscribeMailto ? '<{{unsubscribe_url}}>, <{{unsubscribe_mailto}}>' : '<{{unsubscribe_url}}>',
|
|
234
|
+
'List-Unsubscribe-Post': 'List-Unsubscribe=One-Click',
|
|
235
|
+
},
|
|
236
|
+
links,
|
|
237
|
+
images,
|
|
238
|
+
problems,
|
|
239
|
+
frontmatter: fm,
|
|
240
|
+
htmlBytes: new TextEncoder().encode(html).length,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function walkImageBlocks(b: Block, f: (img: { src: string; alt: string }) => void): void {
|
|
245
|
+
if (b.t === 'image') f(b);
|
|
246
|
+
else if (b.t === 'quote') for (const x of b.c) walkImageBlocks(x, f);
|
|
247
|
+
else if (b.t === 'list') for (const it of b.items) for (const x of it) walkImageBlocks(x, f);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function flatBlocks(blocks: Block[]): Block[] {
|
|
251
|
+
const out: Block[] = [];
|
|
252
|
+
for (const b of blocks) {
|
|
253
|
+
out.push(b);
|
|
254
|
+
if (b.t === 'quote') out.push(...flatBlocks(b.c));
|
|
255
|
+
else if (b.t === 'list') for (const it of b.items) out.push(...flatBlocks(it));
|
|
256
|
+
}
|
|
257
|
+
return out;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/** 數 <!--(含跳脫成 <!-- 的)出現幾次。 */
|
|
261
|
+
const commentMarks = (s: string) => s.split('<!--').length - 1 + (s.split('<!--').length - 1);
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* 最後一道保險:看「最終」HTML 與純文字版(不是解析樹)。把程式碼的內容遮掉重排一次,跟「只有樣板、沒有正文」的版本比:
|
|
265
|
+
* 程式碼以外多出任何一個 <!--,就代表有註解字樣會寄到讀者眼前(解析或排版哪裡出了錯),記 error 擋下。
|
|
266
|
+
* 樣板自己的 Outlook 條件註解(<!--[if mso]>)在兩邊一樣多,所以不會誤報。
|
|
267
|
+
*/
|
|
268
|
+
function checkOutputForComments(blocks: Block[], parts: { subject: string; preheader: string; bodyHtml: string; bodyText: string; pixelUrl?: string }, t: EmailTemplate, problems: Problem[]): void {
|
|
269
|
+
if (problems.some((p) => p.code === 'comment_leaked' || p.code === 'unclosed_comment')) return; // 已經擋下,不重複報
|
|
270
|
+
const masked = structuredClone(blocks);
|
|
271
|
+
const mask = (bs: Block[]): void => {
|
|
272
|
+
const inl = (ns: Inline[]) => {
|
|
273
|
+
for (const n of ns) {
|
|
274
|
+
if (n.t === 'code') n.v = '';
|
|
275
|
+
else if (n.t === 'strong' || n.t === 'em' || n.t === 'link') inl(n.c);
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
for (const b of bs) {
|
|
279
|
+
if (b.t === 'code') b.v = '';
|
|
280
|
+
else if (b.t === 'p' || b.t === 'h') inl(b.c);
|
|
281
|
+
else if (b.t === 'quote') mask(b.c);
|
|
282
|
+
else if (b.t === 'list') for (const it of b.items) mask(it);
|
|
283
|
+
else if (b.t === 'table') {
|
|
284
|
+
for (const c of b.head) inl(c);
|
|
285
|
+
for (const r of b.rows) for (const c of r) inl(c);
|
|
286
|
+
} else if (b.t === 'image' && b.link) inl(b.link.c);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
mask(masked);
|
|
290
|
+
const withBody = { ...parts, bodyHtml: renderBodyHtml(masked, t.theme, t.labels), bodyText: renderBodyText(masked, t.labels) };
|
|
291
|
+
const empty = { ...parts, bodyHtml: '', bodyText: '' };
|
|
292
|
+
const extraHtml = commentMarks(t.renderHtml(withBody)) - commentMarks(t.renderHtml(empty));
|
|
293
|
+
const extraText = commentMarks(t.renderText(withBody)) - commentMarks(t.renderText(empty));
|
|
294
|
+
if (extraHtml > 0 || extraText > 0) {
|
|
295
|
+
problems.push({ code: 'comment_leaked', severity: 'error', message: `信件${extraHtml > 0 ? ' HTML' : ''}${extraText > 0 ? ' 純文字版' : ''}在程式碼以外含有 <!-- 字樣,會原樣寄到讀者眼前;請檢查原稿裡的註解寫法` });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// 產信模組的對外入口(package.json 的 "./compose")。不含 cloudflare:*,Node 與 Worker 都能載入。
|
|
2
|
+
export { compose, type ComposeOptions, type ComposeResult, type LinkRecord, type ImageRecord } from './compose.ts';
|
|
3
|
+
export { parseMarkdown, type Block, type Inline, type Parsed, type Problem, type Severity } from './markdown.ts';
|
|
4
|
+
export { createTemplate, escapeHtml, DEFAULT_THEME, DEFAULT_LABELS, type EmailTemplate, type TemplateConfig, type TemplateParts, type Theme, type Labels, type FooterLine } from './template.ts';
|
|
5
|
+
export { personalize, fill, checkVars, cleanName, scanPlaceholders, PersonalizeError, type RecipientVars, type PersonalizeOptions } from './personalize.ts';
|
|
6
|
+
export { preflight, TODO_MARKER, type PreflightOptions, type PreflightResult } from './preflight.ts';
|
|
7
|
+
export { buildPreview, SAMPLE_VARS, type PreviewFiles, type PreviewOptions } from './preview.ts';
|
|
8
|
+
export { detectScannerClicks, type ClickEvent, type ScannerRule } from './clicks.ts';
|