@emailens/engine 0.6.0 → 0.7.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.
@@ -174,6 +174,8 @@ interface SpamReport {
174
174
  interface SpamAnalysisOptions {
175
175
  /** Value of the List-Unsubscribe header, if present */
176
176
  listUnsubscribeHeader?: string;
177
+ /** Value of the List-Unsubscribe-Post header (RFC 8058 one-click unsubscribe) */
178
+ listUnsubscribePostHeader?: string;
177
179
  /** Type of email — transactional emails are exempt from unsubscribe requirements */
178
180
  emailType?: "marketing" | "transactional";
179
181
  }
@@ -230,6 +232,51 @@ interface ImageReport {
230
232
  issues: ImageIssue[];
231
233
  images: ImageInfo[];
232
234
  }
235
+ interface InboxPreviewIssue {
236
+ rule: string;
237
+ severity: "error" | "warning" | "info";
238
+ message: string;
239
+ }
240
+ interface ClientTruncation {
241
+ client: string;
242
+ subjectLimit: number;
243
+ preheaderLimit: number;
244
+ truncatedSubject: string | null;
245
+ truncatedPreheader: string | null;
246
+ subjectTruncated: boolean;
247
+ preheaderTruncated: boolean;
248
+ }
249
+ interface InboxPreview {
250
+ subject: string | null;
251
+ preheader: string | null;
252
+ subjectLength: number;
253
+ preheaderLength: number;
254
+ truncation: ClientTruncation[];
255
+ issues: InboxPreviewIssue[];
256
+ }
257
+ interface SizeIssue {
258
+ rule: string;
259
+ severity: "error" | "warning" | "info";
260
+ message: string;
261
+ detail?: string;
262
+ }
263
+ interface SizeReport {
264
+ htmlBytes: number;
265
+ humanSize: string;
266
+ clipped: boolean;
267
+ issues: SizeIssue[];
268
+ }
269
+ interface TemplateIssue {
270
+ rule: string;
271
+ severity: "error" | "warning" | "info";
272
+ message: string;
273
+ variable: string;
274
+ location: "text" | "attribute";
275
+ }
276
+ interface TemplateReport {
277
+ unresolvedCount: number;
278
+ issues: TemplateIssue[];
279
+ }
233
280
 
234
281
  /**
235
282
  * Unified error class for all email compilation failures.
@@ -286,4 +333,4 @@ interface CompileReactEmailOptions {
286
333
  */
287
334
  declare function compileReactEmail(source: string, options?: CompileReactEmailOptions): Promise<string>;
288
335
 
289
- export { type AiProvider as A, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, type ImageReport as I, type LinkReport as L, type PreviewResult as P, type SpamAnalysisOptions as S, type TransformResult as T, type CodeFix as a, type ExportPromptOptions as b, type AiFixResult as c, type SpamReport as d, type AccessibilityReport as e, type AccessibilityIssue as f, CompileError as g, type CompileReactEmailOptions as h, type EstimateOptions as i, type ExportScope as j, type FixType as k, type ImageInfo as l, type ImageIssue as m, type InputFormat as n, type LinkIssue as o, type SandboxStrategy as p, type SpamIssue as q, type SupportLevel as r, type TokenEstimate as s, type TokenEstimateWithWarnings as t, estimateAiFixTokens as u, generateFixPrompt as v, heuristicTokenCount as w, compileReactEmail as x };
336
+ export { type AiProvider as A, type TokenEstimateWithWarnings as B, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, estimateAiFixTokens as G, generateFixPrompt as H, type ImageReport as I, heuristicTokenCount as J, compileReactEmail as K, type LinkReport as L, type PreviewResult as P, type SpamAnalysisOptions as S, type TransformResult as T, type CodeFix as a, type ExportPromptOptions as b, type AiFixResult as c, type SpamReport as d, type AccessibilityReport as e, type InboxPreview as f, type SizeReport as g, type TemplateReport as h, type AccessibilityIssue as i, type ClientTruncation as j, CompileError as k, type CompileReactEmailOptions as l, type EstimateOptions as m, type ExportScope as n, type FixType as o, type ImageInfo as p, type ImageIssue as q, type InboxPreviewIssue as r, type InputFormat as s, type LinkIssue as t, type SandboxStrategy as u, type SizeIssue as v, type SpamIssue as w, type SupportLevel as x, type TemplateIssue as y, type TokenEstimate as z };
@@ -174,6 +174,8 @@ interface SpamReport {
174
174
  interface SpamAnalysisOptions {
175
175
  /** Value of the List-Unsubscribe header, if present */
176
176
  listUnsubscribeHeader?: string;
177
+ /** Value of the List-Unsubscribe-Post header (RFC 8058 one-click unsubscribe) */
178
+ listUnsubscribePostHeader?: string;
177
179
  /** Type of email — transactional emails are exempt from unsubscribe requirements */
178
180
  emailType?: "marketing" | "transactional";
179
181
  }
@@ -230,6 +232,51 @@ interface ImageReport {
230
232
  issues: ImageIssue[];
231
233
  images: ImageInfo[];
232
234
  }
235
+ interface InboxPreviewIssue {
236
+ rule: string;
237
+ severity: "error" | "warning" | "info";
238
+ message: string;
239
+ }
240
+ interface ClientTruncation {
241
+ client: string;
242
+ subjectLimit: number;
243
+ preheaderLimit: number;
244
+ truncatedSubject: string | null;
245
+ truncatedPreheader: string | null;
246
+ subjectTruncated: boolean;
247
+ preheaderTruncated: boolean;
248
+ }
249
+ interface InboxPreview {
250
+ subject: string | null;
251
+ preheader: string | null;
252
+ subjectLength: number;
253
+ preheaderLength: number;
254
+ truncation: ClientTruncation[];
255
+ issues: InboxPreviewIssue[];
256
+ }
257
+ interface SizeIssue {
258
+ rule: string;
259
+ severity: "error" | "warning" | "info";
260
+ message: string;
261
+ detail?: string;
262
+ }
263
+ interface SizeReport {
264
+ htmlBytes: number;
265
+ humanSize: string;
266
+ clipped: boolean;
267
+ issues: SizeIssue[];
268
+ }
269
+ interface TemplateIssue {
270
+ rule: string;
271
+ severity: "error" | "warning" | "info";
272
+ message: string;
273
+ variable: string;
274
+ location: "text" | "attribute";
275
+ }
276
+ interface TemplateReport {
277
+ unresolvedCount: number;
278
+ issues: TemplateIssue[];
279
+ }
233
280
 
234
281
  /**
235
282
  * Unified error class for all email compilation failures.
@@ -286,4 +333,4 @@ interface CompileReactEmailOptions {
286
333
  */
287
334
  declare function compileReactEmail(source: string, options?: CompileReactEmailOptions): Promise<string>;
288
335
 
289
- export { type AiProvider as A, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, type ImageReport as I, type LinkReport as L, type PreviewResult as P, type SpamAnalysisOptions as S, type TransformResult as T, type CodeFix as a, type ExportPromptOptions as b, type AiFixResult as c, type SpamReport as d, type AccessibilityReport as e, type AccessibilityIssue as f, CompileError as g, type CompileReactEmailOptions as h, type EstimateOptions as i, type ExportScope as j, type FixType as k, type ImageInfo as l, type ImageIssue as m, type InputFormat as n, type LinkIssue as o, type SandboxStrategy as p, type SpamIssue as q, type SupportLevel as r, type TokenEstimate as s, type TokenEstimateWithWarnings as t, estimateAiFixTokens as u, generateFixPrompt as v, heuristicTokenCount as w, compileReactEmail as x };
336
+ export { type AiProvider as A, type TokenEstimateWithWarnings as B, type CSSWarning as C, type DiffResult as D, type EmailClient as E, type Framework as F, estimateAiFixTokens as G, generateFixPrompt as H, type ImageReport as I, heuristicTokenCount as J, compileReactEmail as K, type LinkReport as L, type PreviewResult as P, type SpamAnalysisOptions as S, type TransformResult as T, type CodeFix as a, type ExportPromptOptions as b, type AiFixResult as c, type SpamReport as d, type AccessibilityReport as e, type InboxPreview as f, type SizeReport as g, type TemplateReport as h, type AccessibilityIssue as i, type ClientTruncation as j, CompileError as k, type CompileReactEmailOptions as l, type EstimateOptions as m, type ExportScope as n, type FixType as o, type ImageInfo as p, type ImageIssue as q, type InboxPreviewIssue as r, type InputFormat as s, type LinkIssue as t, type SandboxStrategy as u, type SizeIssue as v, type SpamIssue as w, type SupportLevel as x, type TemplateIssue as y, type TokenEstimate as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailens/engine",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Email compatibility engine — transforms CSS per email client, scores compatibility, simulates dark mode, suggests fixes, and runs spam, accessibility, link, and image quality analysis.",
5
5
  "type": "module",
6
6
  "exports": {