@bernierllc/email-sender 3.0.3 → 3.1.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/README.md +138 -0
- package/dist/core/email-safety-manager.d.ts +30 -0
- package/dist/core/email-safety-manager.d.ts.map +1 -0
- package/dist/core/email-safety-manager.js +106 -0
- package/dist/core/email-safety-manager.js.map +1 -0
- package/dist/core/email-sender.d.ts +23 -5
- package/dist/core/email-sender.d.ts.map +1 -1
- package/dist/core/email-sender.js +55 -2
- package/dist/core/email-sender.js.map +1 -1
- package/dist/errors.d.ts +112 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +176 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/dist/providers/sendgrid/client.d.ts.map +1 -1
- package/dist/providers/sendgrid/client.js +9 -3
- package/dist/providers/sendgrid/client.js.map +1 -1
- package/dist/providers/sendgrid/errors.d.ts +58 -15
- package/dist/providers/sendgrid/errors.d.ts.map +1 -1
- package/dist/providers/sendgrid/errors.js +130 -23
- package/dist/providers/sendgrid/errors.js.map +1 -1
- package/dist/providers/sendgrid/sender-manager.d.ts.map +1 -1
- package/dist/providers/sendgrid/sender-manager.js +4 -1
- package/dist/providers/sendgrid/sender-manager.js.map +1 -1
- package/dist/providers/sendgrid/template-manager.d.ts.map +1 -1
- package/dist/providers/sendgrid/template-manager.js +24 -6
- package/dist/providers/sendgrid/template-manager.js.map +1 -1
- package/dist/providers/sendgrid.d.ts +4 -0
- package/dist/providers/sendgrid.d.ts.map +1 -1
- package/dist/providers/sendgrid.js +157 -98
- package/dist/providers/sendgrid.js.map +1 -1
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ A core utility for basic email sending with provider-agnostic interface.
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Provider-Agnostic**: Support for multiple email providers (SMTP, SendGrid, SES, Mailgun, Postmark)
|
|
8
|
+
- **Staging Email Safety**: Prevent accidental email sends in non-production environments
|
|
8
9
|
- **TypeScript**: Full TypeScript support with strict typing
|
|
9
10
|
- **Validation**: Comprehensive email and configuration validation
|
|
10
11
|
- **Attachments**: Support for file attachments
|
|
@@ -280,6 +281,143 @@ interface EmailProviderConfig {
|
|
|
280
281
|
}
|
|
281
282
|
```
|
|
282
283
|
|
|
284
|
+
## Staging Email Safety
|
|
285
|
+
|
|
286
|
+
Prevent accidental email sends in non-production environments by using the staging safety feature.
|
|
287
|
+
|
|
288
|
+
### Staging with Whitelist (Block Non-Whitelisted)
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
import { EmailSender } from '@bernierllc/email-sender';
|
|
292
|
+
|
|
293
|
+
const emailSender = new EmailSender({
|
|
294
|
+
provider: 'smtp' as const,
|
|
295
|
+
host: 'smtp.example.com',
|
|
296
|
+
port: 587,
|
|
297
|
+
username: 'user',
|
|
298
|
+
password: 'pass',
|
|
299
|
+
fromEmail: 'sender@example.com',
|
|
300
|
+
stagingSafety: {
|
|
301
|
+
enabled: true,
|
|
302
|
+
environment: 'staging',
|
|
303
|
+
whitelist: ['test@example.com', 'admin@example.com', 'qa@example.com'],
|
|
304
|
+
blockNonWhitelisted: true,
|
|
305
|
+
logBlocked: true,
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// This will send (whitelisted)
|
|
310
|
+
await emailSender.sendEmail({
|
|
311
|
+
toEmail: 'test@example.com',
|
|
312
|
+
subject: 'Test Email',
|
|
313
|
+
htmlContent: '<p>This email will be sent</p>',
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// This will be blocked (not whitelisted)
|
|
317
|
+
const result = await emailSender.sendEmail({
|
|
318
|
+
toEmail: 'customer@example.com',
|
|
319
|
+
subject: 'Test Email',
|
|
320
|
+
htmlContent: '<p>This email will be blocked</p>',
|
|
321
|
+
});
|
|
322
|
+
console.log(result.success); // false
|
|
323
|
+
console.log(result.errorMessage); // "Email blocked by safety manager: ..."
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Staging with Rewrite (Redirect to Test Email)
|
|
327
|
+
|
|
328
|
+
```typescript
|
|
329
|
+
const emailSender = new EmailSender({
|
|
330
|
+
provider: 'smtp' as const,
|
|
331
|
+
host: 'smtp.example.com',
|
|
332
|
+
port: 587,
|
|
333
|
+
username: 'user',
|
|
334
|
+
password: 'pass',
|
|
335
|
+
fromEmail: 'sender@example.com',
|
|
336
|
+
stagingSafety: {
|
|
337
|
+
enabled: true,
|
|
338
|
+
environment: 'staging',
|
|
339
|
+
whitelist: ['admin@example.com'], // Admin emails go through normally
|
|
340
|
+
rewriteTo: 'staging-test@example.com', // All other emails redirected here
|
|
341
|
+
blockNonWhitelisted: false,
|
|
342
|
+
logBlocked: true,
|
|
343
|
+
},
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// This will be sent to staging-test@example.com instead
|
|
347
|
+
await emailSender.sendEmail({
|
|
348
|
+
toEmail: 'customer@example.com',
|
|
349
|
+
subject: 'Test Email',
|
|
350
|
+
htmlContent: '<p>This will be sent to staging-test@example.com</p>',
|
|
351
|
+
});
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Production (All Emails Allowed)
|
|
355
|
+
|
|
356
|
+
```typescript
|
|
357
|
+
const emailSender = new EmailSender({
|
|
358
|
+
provider: 'smtp' as const,
|
|
359
|
+
host: 'smtp.example.com',
|
|
360
|
+
port: 587,
|
|
361
|
+
username: 'user',
|
|
362
|
+
password: 'pass',
|
|
363
|
+
fromEmail: 'sender@example.com',
|
|
364
|
+
stagingSafety: {
|
|
365
|
+
enabled: true,
|
|
366
|
+
environment: 'production',
|
|
367
|
+
whitelist: [], // Not used in production
|
|
368
|
+
blockNonWhitelisted: false,
|
|
369
|
+
logBlocked: false,
|
|
370
|
+
},
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
// All emails are allowed in production
|
|
374
|
+
await emailSender.sendEmail({
|
|
375
|
+
toEmail: 'customer@example.com',
|
|
376
|
+
subject: 'Production Email',
|
|
377
|
+
htmlContent: '<p>This email will be sent</p>',
|
|
378
|
+
});
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Check Recipient Safety Before Sending
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
const safetyResult = emailSender.checkRecipientSafety('test@example.com');
|
|
385
|
+
console.log('Safety check result:', safetyResult);
|
|
386
|
+
|
|
387
|
+
if (safetyResult && !safetyResult.allowed) {
|
|
388
|
+
console.log('Email would be blocked:', safetyResult.reason);
|
|
389
|
+
}
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### Dynamic Configuration Based on Environment
|
|
393
|
+
|
|
394
|
+
```typescript
|
|
395
|
+
const environment = process.env.NODE_ENV || 'development';
|
|
396
|
+
|
|
397
|
+
const emailSender = new EmailSender({
|
|
398
|
+
provider: 'smtp' as const,
|
|
399
|
+
host: 'smtp.example.com',
|
|
400
|
+
port: 587,
|
|
401
|
+
username: 'user',
|
|
402
|
+
password: 'pass',
|
|
403
|
+
fromEmail: 'sender@example.com',
|
|
404
|
+
stagingSafety: {
|
|
405
|
+
enabled: environment !== 'production',
|
|
406
|
+
environment: environment as 'development' | 'staging' | 'production',
|
|
407
|
+
whitelist: environment === 'staging'
|
|
408
|
+
? ['qa@example.com', 'test@example.com']
|
|
409
|
+
: [],
|
|
410
|
+
rewriteTo: environment === 'development' ? 'dev@example.com' : undefined,
|
|
411
|
+
blockNonWhitelisted: environment === 'staging',
|
|
412
|
+
logBlocked: true,
|
|
413
|
+
},
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
console.log('Current environment:', environment);
|
|
417
|
+
console.log('Safety enabled:', emailSender.isSafetyEnabled());
|
|
418
|
+
console.log('Safety config:', emailSender.getSafetyConfig());
|
|
419
|
+
```
|
|
420
|
+
|
|
283
421
|
## Examples
|
|
284
422
|
|
|
285
423
|
### Send Email with Attachment
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email Safety Manager - Staging Email Safety
|
|
3
|
+
* Prevents accidental email sends in non-production environments
|
|
4
|
+
*/
|
|
5
|
+
import { StagingSafetyConfig, EmailSafetyResult } from '../types';
|
|
6
|
+
export declare class EmailSafetyManager {
|
|
7
|
+
private config;
|
|
8
|
+
constructor(config: StagingSafetyConfig);
|
|
9
|
+
/**
|
|
10
|
+
* Check if a recipient is allowed to receive emails
|
|
11
|
+
*/
|
|
12
|
+
checkRecipient(email: string): EmailSafetyResult;
|
|
13
|
+
/**
|
|
14
|
+
* Check if an email address is whitelisted
|
|
15
|
+
*/
|
|
16
|
+
isWhitelisted(email: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Rewrite a recipient email address
|
|
19
|
+
*/
|
|
20
|
+
rewriteRecipient(email: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Update the safety configuration
|
|
23
|
+
*/
|
|
24
|
+
updateConfig(config: Partial<StagingSafetyConfig>): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the current configuration
|
|
27
|
+
*/
|
|
28
|
+
getConfig(): StagingSafetyConfig;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=email-safety-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-safety-manager.d.ts","sourceRoot":"","sources":["../../src/core/email-safety-manager.ts"],"names":[],"mappings":"AAQA;;;GAGG;AAEH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElE,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,EAAE,mBAAmB;IAIvC;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB;IAkEhD;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAOrC;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAOvC;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI;IAIxD;;OAEG;IACH,SAAS,IAAI,mBAAmB;CAGjC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.EmailSafetyManager = void 0;
|
|
11
|
+
class EmailSafetyManager {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Check if a recipient is allowed to receive emails
|
|
17
|
+
*/
|
|
18
|
+
checkRecipient(email) {
|
|
19
|
+
// If safety is disabled, allow all emails
|
|
20
|
+
if (!this.config.enabled) {
|
|
21
|
+
return {
|
|
22
|
+
allowed: true,
|
|
23
|
+
originalRecipient: email,
|
|
24
|
+
finalRecipient: email,
|
|
25
|
+
action: 'sent',
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const normalizedEmail = email.toLowerCase().trim();
|
|
29
|
+
// In production, all emails are allowed
|
|
30
|
+
if (this.config.environment === 'production') {
|
|
31
|
+
return {
|
|
32
|
+
allowed: true,
|
|
33
|
+
originalRecipient: email,
|
|
34
|
+
finalRecipient: email,
|
|
35
|
+
action: 'sent',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
// Check if email is whitelisted
|
|
39
|
+
const isWhitelisted = this.isWhitelisted(normalizedEmail);
|
|
40
|
+
if (isWhitelisted) {
|
|
41
|
+
return {
|
|
42
|
+
allowed: true,
|
|
43
|
+
originalRecipient: email,
|
|
44
|
+
finalRecipient: email,
|
|
45
|
+
action: 'sent',
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// If rewrite is configured, rewrite the recipient
|
|
49
|
+
if (this.config.rewriteTo) {
|
|
50
|
+
return {
|
|
51
|
+
allowed: true,
|
|
52
|
+
originalRecipient: email,
|
|
53
|
+
finalRecipient: this.config.rewriteTo,
|
|
54
|
+
action: 'rewritten',
|
|
55
|
+
reason: 'Non-production environment with rewrite enabled',
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// If blocking is enabled, block the email
|
|
59
|
+
if (this.config.blockNonWhitelisted) {
|
|
60
|
+
return {
|
|
61
|
+
allowed: false,
|
|
62
|
+
originalRecipient: email,
|
|
63
|
+
finalRecipient: email,
|
|
64
|
+
action: 'blocked',
|
|
65
|
+
reason: 'Non-whitelisted recipient in staging environment',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// Default: allow but log
|
|
69
|
+
return {
|
|
70
|
+
allowed: true,
|
|
71
|
+
originalRecipient: email,
|
|
72
|
+
finalRecipient: email,
|
|
73
|
+
action: 'sent',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check if an email address is whitelisted
|
|
78
|
+
*/
|
|
79
|
+
isWhitelisted(email) {
|
|
80
|
+
const normalizedEmail = email.toLowerCase().trim();
|
|
81
|
+
return this.config.whitelist.some((whitelisted) => whitelisted.toLowerCase().trim() === normalizedEmail);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Rewrite a recipient email address
|
|
85
|
+
*/
|
|
86
|
+
rewriteRecipient(email) {
|
|
87
|
+
if (!this.config.rewriteTo) {
|
|
88
|
+
return email;
|
|
89
|
+
}
|
|
90
|
+
return this.config.rewriteTo;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Update the safety configuration
|
|
94
|
+
*/
|
|
95
|
+
updateConfig(config) {
|
|
96
|
+
this.config = { ...this.config, ...config };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get the current configuration
|
|
100
|
+
*/
|
|
101
|
+
getConfig() {
|
|
102
|
+
return { ...this.config };
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.EmailSafetyManager = EmailSafetyManager;
|
|
106
|
+
//# sourceMappingURL=email-safety-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email-safety-manager.js","sourceRoot":"","sources":["../../src/core/email-safety-manager.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AASF,MAAa,kBAAkB;IAG7B,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,KAAa;QAC1B,0CAA0C;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,iBAAiB,EAAE,KAAK;gBACxB,cAAc,EAAE,KAAK;gBACrB,MAAM,EAAE,MAAM;aACf,CAAC;QACJ,CAAC;QAED,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;QAEnD,wCAAwC;QACxC,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,KAAK,YAAY,EAAE,CAAC;YAC7C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,iBAAiB,EAAE,KAAK;gBACxB,cAAc,EAAE,KAAK;gBACrB,MAAM,EAAE,MAAM;aACf,CAAC;QACJ,CAAC;QAED,gCAAgC;QAChC,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;QAE1D,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,iBAAiB,EAAE,KAAK;gBACxB,cAA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AM,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF;AA7GD,gDA6GC"}
|
|
@@ -2,18 +2,24 @@
|
|
|
2
2
|
* Main EmailSender class for managing email providers
|
|
3
3
|
*/
|
|
4
4
|
import { EmailProvider, EmailProviderConfig } from '../providers/base';
|
|
5
|
-
import { EmailMessage, SendResult, DeliveryStatus, WebhookEvent, EmailProviderCapabilities, EmailValidationResult } from '../types';
|
|
5
|
+
import { EmailMessage, SendResult, DeliveryStatus, WebhookEvent, EmailProviderCapabilities, EmailValidationResult, StagingSafetyConfig, EmailSafetyResult } from '../types';
|
|
6
|
+
export interface EmailSenderConfig extends EmailProviderConfig {
|
|
7
|
+
stagingSafety?: StagingSafetyConfig;
|
|
8
|
+
}
|
|
6
9
|
export declare class EmailSender {
|
|
7
10
|
private provider;
|
|
8
|
-
|
|
11
|
+
private safetyManager?;
|
|
12
|
+
constructor(config: EmailSenderConfig);
|
|
9
13
|
/**
|
|
10
14
|
* Create the appropriate provider based on configuration
|
|
11
15
|
*/
|
|
12
16
|
private createProvider;
|
|
13
17
|
/**
|
|
14
|
-
* Send a single email
|
|
18
|
+
* Send a single email with optional safety checks
|
|
15
19
|
*/
|
|
16
|
-
sendEmail(email: EmailMessage
|
|
20
|
+
sendEmail(email: EmailMessage, options?: {
|
|
21
|
+
bypassSafety?: boolean;
|
|
22
|
+
}): Promise<SendResult>;
|
|
17
23
|
/**
|
|
18
24
|
* Send multiple emails
|
|
19
25
|
*/
|
|
@@ -66,6 +72,18 @@ export declare class EmailSender {
|
|
|
66
72
|
/**
|
|
67
73
|
* Update provider configuration
|
|
68
74
|
*/
|
|
69
|
-
updateConfig(config:
|
|
75
|
+
updateConfig(config: EmailSenderConfig): void;
|
|
76
|
+
/**
|
|
77
|
+
* Check if a recipient would be allowed by the safety manager
|
|
78
|
+
*/
|
|
79
|
+
checkRecipientSafety(email: string): EmailSafetyResult | null;
|
|
80
|
+
/**
|
|
81
|
+
* Get the current safety configuration
|
|
82
|
+
*/
|
|
83
|
+
getSafetyConfig(): StagingSafetyConfig | null;
|
|
84
|
+
/**
|
|
85
|
+
* Check if staging safety is enabled
|
|
86
|
+
*/
|
|
87
|
+
isSafetyEnabled(): boolean;
|
|
70
88
|
}
|
|
71
89
|
//# sourceMappingURL=email-sender.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-sender.d.ts","sourceRoot":"","sources":["../../src/core/email-sender.ts"],"names":[],"mappings":"AAQA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"email-sender.d.ts","sourceRoot":"","sources":["../../src/core/email-sender.ts"],"names":[],"mappings":"AAQA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOvE,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,EACZ,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,iBAAkB,SAAQ,mBAAmB;IAC5D,aAAa,CAAC,EAAE,mBAAmB,CAAC;CACrC;AAED,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,aAAa,CAAC,CAAqB;gBAE/B,MAAM,EAAE,iBAAiB;IASrC;;OAEG;IACH,OAAO,CAAC,cAAc;IAiBtB;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAsB/F;;OAEG;IACG,SAAS,CAAC,MAAM,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|
const ses_1 = require("../providers/ses");
|
|
14
14
|
const mailgun_1 = require("../providers/mailgun");
|
|
15
15
|
const postmark_1 = require("../providers/postmark");
|
|
16
|
+
const email_safety_manager_1 = require("./email-safety-manager");
|
|
16
17
|
class EmailSender {
|
|
17
18
|
constructor(config) {
|
|
18
19
|
this.provider = this.createProvider(config);
|
|
20
|
+
// Initialize safety manager if configured
|
|
21
|
+
if (config.stagingSafety) {
|
|
22
|
+
this.safetyManager = new email_safety_manager_1.EmailSafetyManager(config.stagingSafety);
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
/**
|
|
21
26
|
* Create the appropriate provider based on configuration
|
|
@@ -37,9 +42,24 @@ class EmailSender {
|
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
/**
|
|
40
|
-
* Send a single email
|
|
45
|
+
* Send a single email with optional safety checks
|
|
41
46
|
*/
|
|
42
|
-
async sendEmail(email) {
|
|
47
|
+
async sendEmail(email, options) {
|
|
48
|
+
// Apply staging safety if enabled
|
|
49
|
+
if (this.safetyManager && !options?.bypassSafety) {
|
|
50
|
+
const safetyResult = this.safetyManager.checkRecipient(email.toEmail);
|
|
51
|
+
if (!safetyResult.allowed) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
errorMessage: `Email blocked by safety manager: ${safetyResult.reason}`,
|
|
55
|
+
metadata: { safetyResult },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
// Rewrite recipient if needed
|
|
59
|
+
if (safetyResult.action === 'rewritten') {
|
|
60
|
+
email = { ...email, toEmail: safetyResult.finalRecipient };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
43
63
|
return this.provider.sendEmail(email);
|
|
44
64
|
}
|
|
45
65
|
/**
|
|
@@ -119,6 +139,39 @@ class EmailSender {
|
|
|
119
139
|
*/
|
|
120
140
|
updateConfig(config) {
|
|
121
141
|
this.provider = this.createProvider(config);
|
|
142
|
+
// Update or initialize safety manager
|
|
143
|
+
if (config.stagingSafety) {
|
|
144
|
+
if (this.safetyManager) {
|
|
145
|
+
this.safetyManager.updateConfig(config.stagingSafety);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.safetyManager = new email_safety_manager_1.EmailSafetyManager(config.stagingSafety);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Check if a recipient would be allowed by the safety manager
|
|
154
|
+
*/
|
|
155
|
+
checkRecipientSafety(email) {
|
|
156
|
+
if (!this.safetyManager) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return this.safetyManager.checkRecipient(email);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get the current safety configuration
|
|
163
|
+
*/
|
|
164
|
+
getSafetyConfig() {
|
|
165
|
+
if (!this.safetyManager) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
return this.safetyManager.getConfig();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Check if staging safety is enabled
|
|
172
|
+
*/
|
|
173
|
+
isSafetyEnabled() {
|
|
174
|
+
return this.safetyManager !== undefined;
|
|
122
175
|
}
|
|
123
176
|
}
|
|
124
177
|
exports.EmailSender = EmailSender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-sender.js","sourceRoot":"","sources":["../../src/core/email-sender.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAOF,4CAAiD;AACjD,oDAAyD;AACzD,0CAA+C;AAC/C,kDAAuD;AACvD,oDAAyD;
|
|
1
|
+
{"version":3,"file":"email-sender.js","sourceRoot":"","sources":["../../src/core/email-sender.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAOF,4CAAiD;AACjD,oDAAyD;AACzD,0CAA+C;AAC/C,kDAAuD;AACvD,oDAAyD;AACzD,iEAA4D;AAgB5D,MAAa,WAAW;IAItB,YAAY,MAAyB;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CA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ACd,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,aAAa,KAAK,SAAS,CAAC;IAC1C,CAAC;CACF;AAjMD,kCAiMC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Email sender error classes with ES2022 Error.cause support
|
|
3
|
+
*
|
|
4
|
+
* These errors follow the error propagation standard defined in:
|
|
5
|
+
* plans/standards/error-propagation-standard.md
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Error codes for programmatic error handling
|
|
9
|
+
*/
|
|
10
|
+
export declare const EmailSenderErrorCode: {
|
|
11
|
+
readonly PROVIDER_ERROR: "PROVIDER_ERROR";
|
|
12
|
+
readonly PROVIDER_AUTH_ERROR: "PROVIDER_AUTH_ERROR";
|
|
13
|
+
readonly PROVIDER_RATE_LIMITED: "PROVIDER_RATE_LIMITED";
|
|
14
|
+
readonly PROVIDER_UNAVAILABLE: "PROVIDER_UNAVAILABLE";
|
|
15
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
16
|
+
readonly INVALID_EMAIL: "INVALID_EMAIL";
|
|
17
|
+
readonly INVALID_TEMPLATE: "INVALID_TEMPLATE";
|
|
18
|
+
readonly TEMPLATE_NOT_FOUND: "TEMPLATE_NOT_FOUND";
|
|
19
|
+
readonly TEMPLATE_UNAUTHORIZED: "TEMPLATE_UNAUTHORIZED";
|
|
20
|
+
readonly TEMPLATE_CONFLICT: "TEMPLATE_CONFLICT";
|
|
21
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
22
|
+
readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
|
|
23
|
+
readonly SEND_ERROR: "SEND_ERROR";
|
|
24
|
+
readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
|
|
25
|
+
};
|
|
26
|
+
export type EmailSenderErrorCodeType = typeof EmailSenderErrorCode[keyof typeof EmailSenderErrorCode];
|
|
27
|
+
/**
|
|
28
|
+
* Options for creating an EmailSenderError
|
|
29
|
+
*/
|
|
30
|
+
export interface EmailSenderErrorOptions {
|
|
31
|
+
/** The underlying error that caused this error */
|
|
32
|
+
cause?: Error;
|
|
33
|
+
/** Machine-readable error code for programmatic handling */
|
|
34
|
+
code?: EmailSenderErrorCodeType;
|
|
35
|
+
/** Additional context about the error */
|
|
36
|
+
context?: Record<string, unknown>;
|
|
37
|
+
/** Whether this error is retryable */
|
|
38
|
+
retryable?: boolean;
|
|
39
|
+
/** Suggested retry delay in milliseconds */
|
|
40
|
+
retryAfter?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Base error class for all email sender errors
|
|
44
|
+
*
|
|
45
|
+
* Supports ES2022 Error.cause for error chaining.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* try {
|
|
50
|
+
* await sendGridClient.send(email);
|
|
51
|
+
* } catch (error) {
|
|
52
|
+
* throw new EmailSenderError('Failed to send email via SendGrid', {
|
|
53
|
+
* cause: error,
|
|
54
|
+
* code: 'PROVIDER_ERROR',
|
|
55
|
+
* context: { provider: 'sendgrid', to: email.to }
|
|
56
|
+
* });
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare class EmailSenderError extends Error {
|
|
61
|
+
readonly code: EmailSenderErrorCodeType;
|
|
62
|
+
readonly context: Record<string, unknown> | undefined;
|
|
63
|
+
readonly retryable: boolean;
|
|
64
|
+
readonly retryAfter: number | undefined;
|
|
65
|
+
constructor(message: string, options?: EmailSenderErrorOptions);
|
|
66
|
+
/**
|
|
67
|
+
* Check if the error or any error in its cause chain is retryable
|
|
68
|
+
*/
|
|
69
|
+
isRetryable(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Get retry timing from this error or its cause chain
|
|
72
|
+
*/
|
|
73
|
+
getRetryAfter(): number | undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Error thrown when email validation fails
|
|
77
|
+
*/
|
|
78
|
+
export declare class EmailValidationError extends EmailSenderError {
|
|
79
|
+
constructor(message: string, options?: Omit<EmailSenderErrorOptions, 'code'>);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Error thrown when a provider operation fails
|
|
83
|
+
*/
|
|
84
|
+
export declare class ProviderError extends EmailSenderError {
|
|
85
|
+
readonly statusCode: number | undefined;
|
|
86
|
+
readonly providerResponse: unknown;
|
|
87
|
+
constructor(message: string, options?: EmailSenderErrorOptions & {
|
|
88
|
+
statusCode?: number;
|
|
89
|
+
providerResponse?: unknown;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Error thrown when rate limited by a provider
|
|
94
|
+
*/
|
|
95
|
+
export declare class RateLimitError extends EmailSenderError {
|
|
96
|
+
constructor(message: string, options?: Omit<EmailSenderErrorOptions, 'code' | 'retryable'> & {
|
|
97
|
+
retryAfter?: number;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Error thrown when network communication fails
|
|
102
|
+
*/
|
|
103
|
+
export declare class NetworkError extends EmailSenderError {
|
|
104
|
+
constructor(message: string, options?: Omit<EmailSenderErrorOptions, 'code'>);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Error thrown when a request times out
|
|
108
|
+
*/
|
|
109
|
+
export declare class TimeoutError extends EmailSenderError {
|
|
110
|
+
constructor(message: string, options?: Omit<EmailSenderErrorOptions, 'code'>);
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAQA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;C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