mailery 0.3.2 → 0.5.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/dist/admin/spa/index-Dmsla2eL.js +41 -0
- package/dist/admin/spa/index-Dmsla2eL.js.map +1 -0
- package/dist/admin/spa/index.html +1 -1
- package/dist/admin/spa/template-editor-Bn28OPMU.js +502 -0
- package/dist/admin/spa/{template-editor-dMzrGcva.js.map → template-editor-Bn28OPMU.js.map} +1 -1
- package/dist/cli.cjs +231 -56
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +231 -56
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +2733 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -2
- package/dist/index.d.ts +38 -2
- package/dist/index.js +2729 -222
- package/dist/index.js.map +1 -1
- package/dist/{null-CGaNDDlQ.d.cts → null-BYB6v4Iv.d.cts} +324 -2
- package/dist/{null-CGaNDDlQ.d.ts → null-BYB6v4Iv.d.ts} +324 -2
- package/dist/testing.cjs +894 -94
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +891 -94
- package/dist/testing.js.map +1 -1
- package/package.json +8 -1
- package/dist/admin/spa/index-B1Mp8lSz.js +0 -41
- package/dist/admin/spa/index-B1Mp8lSz.js.map +0 -1
- package/dist/admin/spa/template-editor-dMzrGcva.js +0 -502
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RunnerContext, N as NormalizedEvent, C as ContactAdapter, a as Contact, A as AdapterFilter, M as MailProvider, S as SendArgs, b as SendResult, c as Mailer, T as TemplateDoc,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RunnerContext, N as NormalizedEvent, C as ContactAdapter, a as Contact, A as AdapterFilter, M as MailProvider, S as SendArgs, b as SendResult, c as MailTesterFeedback, d as Mailer, T as TemplateDoc, e as SuppressionScope, F as FlowStep, f as SegmentFilter, P as Predicate } from './null-BYB6v4Iv.cjs';
|
|
2
|
+
export { g as AuditLogDoc, B as BroadcastDoc, h as BroadcastStatus, i as CircuitBreakerThresholds, j as Collections, k as ContactTagDoc, E as EventDoc, l as FlowDoc, m as FlowGoal, n as FlowRunDoc, o as FlowRunStatus, p as FlowVersionDoc, H as HealthDoc, q as HealthStatus, L as LeadDoc, r as MailerConfig, s as NullProvider, O as OutboxDoc, t as RedisOptions, u as SegmentDefinition, v as SendDoc, w as SendStatus, x as SenderDomainConfig, y as SenderDomainRegistry, z as SenderDomainValidation, D as SubscriptionDoc, G as SubscriptionStatus, I as SuppressionDoc, J as SuppressionReason, K as TemplateKind, Q as TemplateVersionDoc, W as WebhookEventDoc, U as ensureIndexes, V as getCollections, X as validateSenderDomain } from './null-BYB6v4Iv.cjs';
|
|
3
3
|
import { ObjectId, Db, Filter } from 'mongodb';
|
|
4
4
|
import { Request, Router } from 'express';
|
|
5
5
|
import Handlebars from 'handlebars';
|
|
@@ -140,6 +140,37 @@ declare class SendGridProvider implements MailProvider {
|
|
|
140
140
|
parseWebhookEvents(payload: unknown): NormalizedEvent[];
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Mail-Tester deliverability check.
|
|
145
|
+
*
|
|
146
|
+
* 1. Operator clicks "Run deliverability check" in the template editor.
|
|
147
|
+
* 2. Mailery provisions a check (gets a unique test address from Mail-Tester).
|
|
148
|
+
* 3. Mailery sends the rendered draft to that address via the operator's
|
|
149
|
+
* default provider.
|
|
150
|
+
* 4. Mailery polls Mail-Tester for the score (typically arrives 10-30s after
|
|
151
|
+
* receipt) and caches it keyed on a content fingerprint.
|
|
152
|
+
* 5. If the score is below `minScore` the publish endpoint refuses unless
|
|
153
|
+
* the operator passes `bypassMailTester: true` in the publish request.
|
|
154
|
+
*
|
|
155
|
+
* The client interface is pluggable so tests inject a stub. Real
|
|
156
|
+
* implementation hits https://mail-tester.com/api/.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
interface ProvisionedCheck {
|
|
160
|
+
checkId: string;
|
|
161
|
+
emailAddress: string;
|
|
162
|
+
}
|
|
163
|
+
interface MailTesterResult {
|
|
164
|
+
ready: boolean;
|
|
165
|
+
score: number;
|
|
166
|
+
feedback: MailTesterFeedback[];
|
|
167
|
+
rawSummary: string | null;
|
|
168
|
+
}
|
|
169
|
+
interface MailTesterClient {
|
|
170
|
+
provisionCheck(): Promise<ProvisionedCheck>;
|
|
171
|
+
fetchResult(checkId: string): Promise<MailTesterResult>;
|
|
172
|
+
}
|
|
173
|
+
|
|
143
174
|
/**
|
|
144
175
|
* Admin router — serves the prebuilt React SPA + REST endpoints the SPA
|
|
145
176
|
* consumes. Mount inside a host Express app, gated by host auth.
|
|
@@ -154,6 +185,11 @@ interface AdminRouterOptions {
|
|
|
154
185
|
spaDir?: string;
|
|
155
186
|
/** Resolve actor metadata from a Request. Defaults to `human:${req.user?.email || 'anonymous'}`. */
|
|
156
187
|
getActor?: (req: Request) => string;
|
|
188
|
+
/**
|
|
189
|
+
* Inject a Mail-Tester client (tests use a stub). When omitted, a real
|
|
190
|
+
* client is created from `mailer.config.mailTester`.
|
|
191
|
+
*/
|
|
192
|
+
mailTesterClient?: MailTesterClient;
|
|
157
193
|
}
|
|
158
194
|
declare function createAdminRouter(mailer: Mailer, opts?: AdminRouterOptions): Router;
|
|
159
195
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RunnerContext, N as NormalizedEvent, C as ContactAdapter, a as Contact, A as AdapterFilter, M as MailProvider, S as SendArgs, b as SendResult, c as Mailer, T as TemplateDoc,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RunnerContext, N as NormalizedEvent, C as ContactAdapter, a as Contact, A as AdapterFilter, M as MailProvider, S as SendArgs, b as SendResult, c as MailTesterFeedback, d as Mailer, T as TemplateDoc, e as SuppressionScope, F as FlowStep, f as SegmentFilter, P as Predicate } from './null-BYB6v4Iv.js';
|
|
2
|
+
export { g as AuditLogDoc, B as BroadcastDoc, h as BroadcastStatus, i as CircuitBreakerThresholds, j as Collections, k as ContactTagDoc, E as EventDoc, l as FlowDoc, m as FlowGoal, n as FlowRunDoc, o as FlowRunStatus, p as FlowVersionDoc, H as HealthDoc, q as HealthStatus, L as LeadDoc, r as MailerConfig, s as NullProvider, O as OutboxDoc, t as RedisOptions, u as SegmentDefinition, v as SendDoc, w as SendStatus, x as SenderDomainConfig, y as SenderDomainRegistry, z as SenderDomainValidation, D as SubscriptionDoc, G as SubscriptionStatus, I as SuppressionDoc, J as SuppressionReason, K as TemplateKind, Q as TemplateVersionDoc, W as WebhookEventDoc, U as ensureIndexes, V as getCollections, X as validateSenderDomain } from './null-BYB6v4Iv.js';
|
|
3
3
|
import { ObjectId, Db, Filter } from 'mongodb';
|
|
4
4
|
import { Request, Router } from 'express';
|
|
5
5
|
import Handlebars from 'handlebars';
|
|
@@ -140,6 +140,37 @@ declare class SendGridProvider implements MailProvider {
|
|
|
140
140
|
parseWebhookEvents(payload: unknown): NormalizedEvent[];
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Mail-Tester deliverability check.
|
|
145
|
+
*
|
|
146
|
+
* 1. Operator clicks "Run deliverability check" in the template editor.
|
|
147
|
+
* 2. Mailery provisions a check (gets a unique test address from Mail-Tester).
|
|
148
|
+
* 3. Mailery sends the rendered draft to that address via the operator's
|
|
149
|
+
* default provider.
|
|
150
|
+
* 4. Mailery polls Mail-Tester for the score (typically arrives 10-30s after
|
|
151
|
+
* receipt) and caches it keyed on a content fingerprint.
|
|
152
|
+
* 5. If the score is below `minScore` the publish endpoint refuses unless
|
|
153
|
+
* the operator passes `bypassMailTester: true` in the publish request.
|
|
154
|
+
*
|
|
155
|
+
* The client interface is pluggable so tests inject a stub. Real
|
|
156
|
+
* implementation hits https://mail-tester.com/api/.
|
|
157
|
+
*/
|
|
158
|
+
|
|
159
|
+
interface ProvisionedCheck {
|
|
160
|
+
checkId: string;
|
|
161
|
+
emailAddress: string;
|
|
162
|
+
}
|
|
163
|
+
interface MailTesterResult {
|
|
164
|
+
ready: boolean;
|
|
165
|
+
score: number;
|
|
166
|
+
feedback: MailTesterFeedback[];
|
|
167
|
+
rawSummary: string | null;
|
|
168
|
+
}
|
|
169
|
+
interface MailTesterClient {
|
|
170
|
+
provisionCheck(): Promise<ProvisionedCheck>;
|
|
171
|
+
fetchResult(checkId: string): Promise<MailTesterResult>;
|
|
172
|
+
}
|
|
173
|
+
|
|
143
174
|
/**
|
|
144
175
|
* Admin router — serves the prebuilt React SPA + REST endpoints the SPA
|
|
145
176
|
* consumes. Mount inside a host Express app, gated by host auth.
|
|
@@ -154,6 +185,11 @@ interface AdminRouterOptions {
|
|
|
154
185
|
spaDir?: string;
|
|
155
186
|
/** Resolve actor metadata from a Request. Defaults to `human:${req.user?.email || 'anonymous'}`. */
|
|
156
187
|
getActor?: (req: Request) => string;
|
|
188
|
+
/**
|
|
189
|
+
* Inject a Mail-Tester client (tests use a stub). When omitted, a real
|
|
190
|
+
* client is created from `mailer.config.mailTester`.
|
|
191
|
+
*/
|
|
192
|
+
mailTesterClient?: MailTesterClient;
|
|
157
193
|
}
|
|
158
194
|
declare function createAdminRouter(mailer: Mailer, opts?: AdminRouterOptions): Router;
|
|
159
195
|
|