@bernierllc/email-manager 0.12.0 → 0.12.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.
Files changed (93) hide show
  1. package/package.json +12 -12
  2. package/dist/capabilities/degradation-logger.d.ts +0 -59
  3. package/dist/capabilities/degradation-logger.d.ts.map +0 -1
  4. package/dist/capabilities/degradation-logger.js +0 -106
  5. package/dist/capabilities/degradation-logger.js.map +0 -1
  6. package/dist/capabilities/feature-router.d.ts +0 -55
  7. package/dist/capabilities/feature-router.d.ts.map +0 -1
  8. package/dist/capabilities/feature-router.js +0 -143
  9. package/dist/capabilities/feature-router.js.map +0 -1
  10. package/dist/capabilities/in-memory-resolver.d.ts +0 -27
  11. package/dist/capabilities/in-memory-resolver.d.ts.map +0 -1
  12. package/dist/capabilities/in-memory-resolver.js +0 -79
  13. package/dist/capabilities/in-memory-resolver.js.map +0 -1
  14. package/dist/capabilities/index.d.ts +0 -13
  15. package/dist/capabilities/index.d.ts.map +0 -1
  16. package/dist/capabilities/index.js +0 -21
  17. package/dist/capabilities/index.js.map +0 -1
  18. package/dist/capabilities/matrix.d.ts +0 -67
  19. package/dist/capabilities/matrix.d.ts.map +0 -1
  20. package/dist/capabilities/matrix.js +0 -312
  21. package/dist/capabilities/matrix.js.map +0 -1
  22. package/dist/capabilities/redis-resolver.d.ts +0 -95
  23. package/dist/capabilities/redis-resolver.d.ts.map +0 -1
  24. package/dist/capabilities/redis-resolver.js +0 -227
  25. package/dist/capabilities/redis-resolver.js.map +0 -1
  26. package/dist/capabilities/resolver-factory.d.ts +0 -30
  27. package/dist/capabilities/resolver-factory.d.ts.map +0 -1
  28. package/dist/capabilities/resolver-factory.js +0 -70
  29. package/dist/capabilities/resolver-factory.js.map +0 -1
  30. package/dist/capabilities/resolver.d.ts +0 -40
  31. package/dist/capabilities/resolver.d.ts.map +0 -1
  32. package/dist/capabilities/resolver.js +0 -18
  33. package/dist/capabilities/resolver.js.map +0 -1
  34. package/dist/capabilities/routing-metadata.d.ts +0 -16
  35. package/dist/capabilities/routing-metadata.d.ts.map +0 -1
  36. package/dist/capabilities/routing-metadata.js +0 -17
  37. package/dist/capabilities/routing-metadata.js.map +0 -1
  38. package/dist/capabilities/safe-resolver.d.ts +0 -24
  39. package/dist/capabilities/safe-resolver.d.ts.map +0 -1
  40. package/dist/capabilities/safe-resolver.js +0 -48
  41. package/dist/capabilities/safe-resolver.js.map +0 -1
  42. package/dist/config/loadConfiguration.d.ts +0 -60
  43. package/dist/config/loadConfiguration.d.ts.map +0 -1
  44. package/dist/config/loadConfiguration.js +0 -468
  45. package/dist/config/loadConfiguration.js.map +0 -1
  46. package/dist/config/schema.d.ts +0 -962
  47. package/dist/config/schema.d.ts.map +0 -1
  48. package/dist/config/schema.js +0 -318
  49. package/dist/config/schema.js.map +0 -1
  50. package/dist/config/types.d.ts +0 -826
  51. package/dist/config/types.d.ts.map +0 -1
  52. package/dist/config/types.js +0 -9
  53. package/dist/config/types.js.map +0 -1
  54. package/dist/email-manager.d.ts +0 -143
  55. package/dist/email-manager.d.ts.map +0 -1
  56. package/dist/email-manager.js +0 -365
  57. package/dist/email-manager.js.map +0 -1
  58. package/dist/enhanced-email-manager.d.ts +0 -349
  59. package/dist/enhanced-email-manager.d.ts.map +0 -1
  60. package/dist/enhanced-email-manager.js +0 -1396
  61. package/dist/enhanced-email-manager.js.map +0 -1
  62. package/dist/errors.d.ts +0 -154
  63. package/dist/errors.d.ts.map +0 -1
  64. package/dist/errors.js +0 -251
  65. package/dist/errors.js.map +0 -1
  66. package/dist/index.d.ts +0 -25
  67. package/dist/index.d.ts.map +0 -1
  68. package/dist/index.js +0 -30
  69. package/dist/index.js.map +0 -1
  70. package/dist/managers/email-analytics.d.ts +0 -92
  71. package/dist/managers/email-analytics.d.ts.map +0 -1
  72. package/dist/managers/email-analytics.js +0 -375
  73. package/dist/managers/email-analytics.js.map +0 -1
  74. package/dist/managers/email-scheduler.d.ts +0 -81
  75. package/dist/managers/email-scheduler.d.ts.map +0 -1
  76. package/dist/managers/email-scheduler.js +0 -288
  77. package/dist/managers/email-scheduler.js.map +0 -1
  78. package/dist/managers/provider-manager.d.ts +0 -152
  79. package/dist/managers/provider-manager.d.ts.map +0 -1
  80. package/dist/managers/provider-manager.js +0 -592
  81. package/dist/managers/provider-manager.js.map +0 -1
  82. package/dist/managers/template-manager.d.ts +0 -65
  83. package/dist/managers/template-manager.d.ts.map +0 -1
  84. package/dist/managers/template-manager.js +0 -314
  85. package/dist/managers/template-manager.js.map +0 -1
  86. package/dist/types.d.ts +0 -1029
  87. package/dist/types.d.ts.map +0 -1
  88. package/dist/types.js +0 -62
  89. package/dist/types.js.map +0 -1
  90. package/dist/utils/simple-template-engine.d.ts +0 -27
  91. package/dist/utils/simple-template-engine.d.ts.map +0 -1
  92. package/dist/utils/simple-template-engine.js +0 -61
  93. package/dist/utils/simple-template-engine.js.map +0 -1
@@ -1,67 +0,0 @@
1
- import type { CapabilityEntry } from '@bernierllc/email-sender';
2
- export declare const FEATURE_DEFINITIONS: {
3
- readonly sendEmail: "Send a single email through a provider";
4
- readonly batchSend: "Send multiple emails in a single operation";
5
- readonly providerTemplates: "Use templates stored on the provider (server-side)";
6
- readonly localTemplates: "Render templates locally before sending";
7
- readonly calendarInvites: "Attach iCalendar (.ics) invites to outgoing emails";
8
- readonly calendarEventMgmt: "Create, update, and cancel calendar events programmatically";
9
- readonly webhooksReceive: "Receive webhook callbacks from the provider for email events";
10
- readonly webhookNormalization: "Normalize provider-specific webhook payloads into a common format";
11
- readonly deliveryTracking: "Track delivery status of sent emails (delivered, bounced, etc.)";
12
- readonly inboundEmailParsing: "Parse inbound emails forwarded by the provider";
13
- /**
14
- * subscriptionMgmt -- Manage subscriber lists, preference centres, and
15
- * opt-in / opt-out lifecycle. This is distinct from suppressionLists which
16
- * deals with bounce/complaint suppression at the provider level.
17
- */
18
- readonly subscriptionMgmt: "Manage subscriber lists, preferences, and opt-in/opt-out lifecycle";
19
- /**
20
- * suppressionLists -- Provider-level bounce and complaint suppression.
21
- * Automatically maintained by the provider to prevent sending to addresses
22
- * that have bounced or filed complaints. Distinct from subscriptionMgmt
23
- * which handles user-facing subscription preferences.
24
- */
25
- readonly suppressionLists: "Provider-level bounce and complaint suppression lists";
26
- readonly unsubscribeUrlGeneration: "Generate one-click unsubscribe URLs for email headers";
27
- readonly scheduledSend: "Schedule emails for future delivery";
28
- readonly openClickTracking: "Track email opens and link clicks";
29
- readonly utmTracking: "Per-message control of provider-appended analytics (UTM) tags";
30
- readonly emailContentParsing: "Parse and transform email content (HTML/text)";
31
- readonly emailHeaderMgmt: "Set and manage custom email headers";
32
- readonly attachments: "Attach files to outgoing emails";
33
- readonly advancedAttachmentProcessing: "Process, validate, and transform attachments (resize, compress, etc.)";
34
- readonly dkimSpf: "Programmatic DKIM/SPF authentication configuration";
35
- readonly linkBranding: "Custom branded tracking domains for links";
36
- readonly retryResilience: "Automatic retry with backoff on transient failures";
37
- readonly multiProviderFailover: "Automatic failover to alternate providers on failure";
38
- };
39
- /**
40
- * Union of every recognised feature name, derived from FEATURE_DEFINITIONS.
41
- */
42
- export type FeatureName = keyof typeof FEATURE_DEFINITIONS;
43
- /**
44
- * Ordered array of every feature name (derived from FEATURE_DEFINITIONS keys).
45
- */
46
- export declare const FEATURE_NAMES: readonly FeatureName[];
47
- export type ProviderName = 'sendgrid' | 'mailgun' | 'postmark' | 'ses' | 'smtp' | 'mandrill' | 'smtp2go';
48
- export declare const PROVIDER_NAMES: readonly ProviderName[];
49
- /**
50
- * A complete capability map for a single provider -- one entry per feature.
51
- */
52
- export type ProviderCapabilityMap = Record<FeatureName, CapabilityEntry>;
53
- /**
54
- * Top-level structure for the capability matrix.
55
- */
56
- export interface CapabilityMatrixData {
57
- version: string;
58
- lastUpdated: string;
59
- providers: Record<ProviderName, ProviderCapabilityMap>;
60
- }
61
- export declare const CAPABILITY_MATRIX: CapabilityMatrixData;
62
- /**
63
- * Returns a deep clone of the capability matrix to prevent mutation of the
64
- * canonical data.
65
- */
66
- export declare function getCapabilityMatrix(): CapabilityMatrixData;
67
- //# sourceMappingURL=matrix.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../src/capabilities/matrix.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAUhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;IAW9B;;;;OAIG;;IAEH;;;;;OAKG;;;;;;;;;;;;;;CAcK,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAE3D;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAE9B,CAAC;AAMnB,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAEzG,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAQxC,CAAC;AAMX;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC;CACxD;AA8RD,eAAO,MAAM,iBAAiB,EAAE,oBAY/B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,oBAAoB,CAE1D"}
@@ -1,312 +0,0 @@
1
- /*
2
- Copyright (c) 2025 Bernier LLC
3
-
4
- This file is licensed to the client under a limited-use license.
5
- The client may use and modify this code *only within the scope of the project it was delivered for*.
6
- Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
7
- */
8
- // ---------------------------------------------------------------------------
9
- // Feature Definitions -- SINGLE SOURCE OF TRUTH
10
- // ---------------------------------------------------------------------------
11
- // Every feature the platform recognises is declared here. Types, arrays, and
12
- // the capability matrix itself are all derived from this object so that adding
13
- // a feature in one place is enough.
14
- // ---------------------------------------------------------------------------
15
- export const FEATURE_DEFINITIONS = {
16
- sendEmail: 'Send a single email through a provider',
17
- batchSend: 'Send multiple emails in a single operation',
18
- providerTemplates: 'Use templates stored on the provider (server-side)',
19
- localTemplates: 'Render templates locally before sending',
20
- calendarInvites: 'Attach iCalendar (.ics) invites to outgoing emails',
21
- calendarEventMgmt: 'Create, update, and cancel calendar events programmatically',
22
- webhooksReceive: 'Receive webhook callbacks from the provider for email events',
23
- webhookNormalization: 'Normalize provider-specific webhook payloads into a common format',
24
- deliveryTracking: 'Track delivery status of sent emails (delivered, bounced, etc.)',
25
- inboundEmailParsing: 'Parse inbound emails forwarded by the provider',
26
- /**
27
- * subscriptionMgmt -- Manage subscriber lists, preference centres, and
28
- * opt-in / opt-out lifecycle. This is distinct from suppressionLists which
29
- * deals with bounce/complaint suppression at the provider level.
30
- */
31
- subscriptionMgmt: 'Manage subscriber lists, preferences, and opt-in/opt-out lifecycle',
32
- /**
33
- * suppressionLists -- Provider-level bounce and complaint suppression.
34
- * Automatically maintained by the provider to prevent sending to addresses
35
- * that have bounced or filed complaints. Distinct from subscriptionMgmt
36
- * which handles user-facing subscription preferences.
37
- */
38
- suppressionLists: 'Provider-level bounce and complaint suppression lists',
39
- unsubscribeUrlGeneration: 'Generate one-click unsubscribe URLs for email headers',
40
- scheduledSend: 'Schedule emails for future delivery',
41
- openClickTracking: 'Track email opens and link clicks',
42
- utmTracking: 'Per-message control of provider-appended analytics (UTM) tags',
43
- emailContentParsing: 'Parse and transform email content (HTML/text)',
44
- emailHeaderMgmt: 'Set and manage custom email headers',
45
- attachments: 'Attach files to outgoing emails',
46
- advancedAttachmentProcessing: 'Process, validate, and transform attachments (resize, compress, etc.)',
47
- dkimSpf: 'Programmatic DKIM/SPF authentication configuration',
48
- linkBranding: 'Custom branded tracking domains for links',
49
- retryResilience: 'Automatic retry with backoff on transient failures',
50
- multiProviderFailover: 'Automatic failover to alternate providers on failure',
51
- };
52
- /**
53
- * Ordered array of every feature name (derived from FEATURE_DEFINITIONS keys).
54
- */
55
- export const FEATURE_NAMES = Object.keys(FEATURE_DEFINITIONS);
56
- export const PROVIDER_NAMES = [
57
- 'sendgrid',
58
- 'mailgun',
59
- 'postmark',
60
- 'ses',
61
- 'smtp',
62
- 'mandrill',
63
- 'smtp2go',
64
- ];
65
- // ---------------------------------------------------------------------------
66
- // Helper builders -- keep individual entries concise
67
- // ---------------------------------------------------------------------------
68
- function provider(description, opts) {
69
- return {
70
- source: 'provider',
71
- description,
72
- ...(opts?.limitations ? { limitations: opts.limitations } : {}),
73
- degradation: null,
74
- overridable: opts?.overridable ?? false,
75
- };
76
- }
77
- function platform(description, degradation, opts) {
78
- return {
79
- source: 'platform',
80
- description,
81
- degradation: degradation ?? null,
82
- overridable: opts?.overridable ?? true,
83
- };
84
- }
85
- function enhanced(description, opts) {
86
- return {
87
- source: 'enhanced',
88
- description,
89
- degradation: null,
90
- overridable: opts?.overridable ?? true,
91
- };
92
- }
93
- function unsupported(description) {
94
- return {
95
- source: 'unsupported',
96
- description,
97
- degradation: null,
98
- overridable: false,
99
- };
100
- }
101
- // ---------------------------------------------------------------------------
102
- // CAPABILITY MATRIX
103
- // ---------------------------------------------------------------------------
104
- const sendgridCapabilities = {
105
- sendEmail: provider('Send email via SendGrid v3 API'),
106
- batchSend: provider('Batch send via SendGrid personalizations', { overridable: true }),
107
- providerTemplates: provider('SendGrid dynamic templates (Handlebars)', { overridable: true }),
108
- localTemplates: platform('Render templates locally before sending via SendGrid'),
109
- calendarInvites: platform('Attach iCalendar invites to SendGrid emails'),
110
- calendarEventMgmt: platform('Manage calendar events locally, send via SendGrid'),
111
- webhooksReceive: provider('SendGrid Event Webhook for delivery events', { overridable: true }),
112
- webhookNormalization: enhanced('Normalize SendGrid webhook payloads to common format'),
113
- deliveryTracking: provider('Track delivery via SendGrid Event Webhook', { overridable: true }),
114
- inboundEmailParsing: enhanced('Parse inbound emails from SendGrid Inbound Parse'),
115
- subscriptionMgmt: enhanced('Manage subscriber lists and preferences with SendGrid contacts'),
116
- suppressionLists: provider('SendGrid global and group suppression management', { overridable: true }),
117
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for SendGrid emails'),
118
- scheduledSend: provider('SendGrid scheduled send via send_at parameter', { limitations: '72hr max scheduling window', overridable: true }),
119
- openClickTracking: provider('SendGrid open and click tracking via tracking settings', { overridable: true }),
120
- utmTracking: provider('SendGrid analytics tags via tracking_settings.ganalytics', { overridable: true }),
121
- emailContentParsing: platform('Parse and transform email content for SendGrid'),
122
- emailHeaderMgmt: platform('Set custom headers on SendGrid emails'),
123
- attachments: provider('File attachments via SendGrid API'),
124
- advancedAttachmentProcessing: platform('Process and validate attachments before SendGrid send'),
125
- dkimSpf: provider('SendGrid domain authentication (DKIM/SPF)', { overridable: true }),
126
- linkBranding: provider('SendGrid branded link tracking domains', { overridable: true }),
127
- retryResilience: platform('Automatic retry with backoff for SendGrid API calls'),
128
- multiProviderFailover: platform('Failover from SendGrid to alternate providers'),
129
- };
130
- const mailgunCapabilities = {
131
- sendEmail: provider('Send email via Mailgun API'),
132
- batchSend: provider('Batch send via Mailgun recipient variables', { overridable: true }),
133
- providerTemplates: provider('Mailgun stored templates', { overridable: true }),
134
- localTemplates: platform('Render templates locally before sending via Mailgun'),
135
- calendarInvites: platform('Attach iCalendar invites to Mailgun emails'),
136
- calendarEventMgmt: platform('Manage calendar events locally, send via Mailgun'),
137
- webhooksReceive: provider('Mailgun webhooks for delivery events', { overridable: true }),
138
- webhookNormalization: enhanced('Normalize Mailgun webhook payloads to common format'),
139
- deliveryTracking: provider('Track delivery via Mailgun webhooks', { overridable: true }),
140
- inboundEmailParsing: enhanced('Parse inbound emails from Mailgun Routes'),
141
- subscriptionMgmt: enhanced('Manage subscriber lists and preferences with Mailgun mailing lists'),
142
- suppressionLists: provider('Mailgun bounce, complaint, and unsubscribe suppression', { overridable: true }),
143
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for Mailgun emails'),
144
- scheduledSend: provider('Mailgun scheduled delivery via o:deliverytime', { limitations: '3-day max scheduling window', overridable: true }),
145
- openClickTracking: provider('Mailgun open and click tracking', { overridable: true }),
146
- utmTracking: unsupported('Mailgun has no per-message UTM option; tracking.utm is ignored'),
147
- emailContentParsing: platform('Parse and transform email content for Mailgun'),
148
- emailHeaderMgmt: platform('Set custom headers on Mailgun emails'),
149
- attachments: provider('File attachments via Mailgun API'),
150
- advancedAttachmentProcessing: platform('Process and validate attachments before Mailgun send'),
151
- dkimSpf: provider('Mailgun domain verification (DKIM/SPF)', { overridable: true }),
152
- linkBranding: provider('Mailgun custom tracking domains', { overridable: true }),
153
- retryResilience: platform('Automatic retry with backoff for Mailgun API calls'),
154
- multiProviderFailover: platform('Failover from Mailgun to alternate providers'),
155
- };
156
- const postmarkCapabilities = {
157
- sendEmail: provider('Send email via Postmark API'),
158
- batchSend: provider('Batch send via Postmark batch API endpoint', { overridable: true }),
159
- providerTemplates: provider('Postmark server-side templates', { overridable: true }),
160
- localTemplates: platform('Render templates locally before sending via Postmark'),
161
- calendarInvites: platform('Attach iCalendar invites to Postmark emails'),
162
- calendarEventMgmt: platform('Manage calendar events locally, send via Postmark'),
163
- webhooksReceive: provider('Postmark webhooks for delivery, bounce, and spam events', { overridable: true }),
164
- webhookNormalization: enhanced('Normalize Postmark webhook payloads to common format'),
165
- deliveryTracking: provider('Track delivery via Postmark webhooks and message streams', { overridable: true }),
166
- inboundEmailParsing: enhanced('Parse inbound emails from Postmark Inbound'),
167
- subscriptionMgmt: platform('Platform-managed subscription preferences (Postmark lacks native list management)', { strategy: 'platform-managed', description: 'Subscription management handled entirely by platform since Postmark has no native list management', docUrl: '/degradation/subscription-mgmt' }),
168
- suppressionLists: provider('Postmark suppression stream management', { overridable: true }),
169
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for Postmark emails'),
170
- scheduledSend: platform('Platform-managed scheduled send (Postmark has no native scheduling)', { strategy: 'platform-scheduled', description: 'Emails are queued locally and sent at the scheduled time', docUrl: '/degradation/scheduled-send' }),
171
- openClickTracking: provider('Postmark open and link tracking (TrackOpens, TrackLinks)', { limitations: 'TrackOpens: false is ignored while open tracking is on at the server level', overridable: true }),
172
- utmTracking: unsupported('Postmark has no per-message UTM option; tracking.utm is ignored'),
173
- emailContentParsing: platform('Parse and transform email content for Postmark'),
174
- emailHeaderMgmt: platform('Set custom headers on Postmark emails'),
175
- attachments: provider('File attachments via Postmark API'),
176
- advancedAttachmentProcessing: platform('Process and validate attachments before Postmark send'),
177
- dkimSpf: provider('Postmark domain authentication (DKIM/SPF)', { overridable: true }),
178
- linkBranding: unsupported('Postmark does not support custom branded tracking domains'),
179
- retryResilience: platform('Automatic retry with backoff for Postmark API calls'),
180
- multiProviderFailover: platform('Failover from Postmark to alternate providers'),
181
- };
182
- const sesCapabilities = {
183
- sendEmail: provider('Send email via AWS SES v2 API'),
184
- batchSend: provider('Batch send via SES SendBulkEmail', { overridable: true }),
185
- providerTemplates: provider('SES email templates', { overridable: true }),
186
- localTemplates: platform('Render templates locally before sending via SES'),
187
- calendarInvites: platform('Attach iCalendar invites to SES emails'),
188
- calendarEventMgmt: platform('Manage calendar events locally, send via SES'),
189
- webhooksReceive: provider('SES event notifications via SNS', { limitations: 'Requires SNS topic configuration', overridable: true }),
190
- webhookNormalization: enhanced('Normalize SES/SNS notification payloads to common format'),
191
- deliveryTracking: provider('Track delivery via SES SNS notifications', { limitations: 'Requires SNS topic configuration', overridable: true }),
192
- inboundEmailParsing: enhanced('Parse inbound emails from SES receiving rules'),
193
- subscriptionMgmt: platform('Platform-managed subscription preferences (SES has no native list management)', { strategy: 'platform-managed', description: 'Subscription management handled entirely by platform since SES has no native list management', docUrl: '/degradation/subscription-mgmt' }),
194
- suppressionLists: provider('SES account-level suppression list', { overridable: true }),
195
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for SES emails'),
196
- scheduledSend: platform('Platform-managed scheduled send (SES has no native scheduling)', { strategy: 'platform-scheduled', description: 'Emails are queued locally and sent at the scheduled time', docUrl: '/degradation/scheduled-send' }),
197
- openClickTracking: unsupported('SES does not provide native open/click tracking'),
198
- utmTracking: unsupported('SES has no per-message UTM option; tracking.utm is ignored'),
199
- emailContentParsing: platform('Parse and transform email content for SES'),
200
- emailHeaderMgmt: platform('Set custom headers on SES emails'),
201
- attachments: provider('File attachments via SES raw email'),
202
- advancedAttachmentProcessing: platform('Process and validate attachments before SES send'),
203
- dkimSpf: provider('SES DKIM signing and domain verification', { overridable: true }),
204
- linkBranding: unsupported('SES does not support custom branded tracking domains'),
205
- retryResilience: platform('Automatic retry with backoff for SES API calls'),
206
- multiProviderFailover: platform('Failover from SES to alternate providers'),
207
- };
208
- const smtpCapabilities = {
209
- sendEmail: provider('Send email via SMTP transport'),
210
- batchSend: platform('Sequential batch sending over SMTP (no native batch support)', { strategy: 'sequential-batch', description: 'Emails are sent sequentially over the SMTP connection', docUrl: '/degradation/batch-send' }),
211
- providerTemplates: unsupported('SMTP does not support server-side templates'),
212
- localTemplates: platform('Render templates locally before sending via SMTP'),
213
- calendarInvites: platform('Attach iCalendar invites to SMTP emails'),
214
- calendarEventMgmt: platform('Manage calendar events locally, send via SMTP'),
215
- webhooksReceive: unsupported('SMTP does not provide webhook callbacks'),
216
- webhookNormalization: unsupported('SMTP does not provide webhooks to normalize'),
217
- deliveryTracking: unsupported('SMTP does not provide delivery tracking callbacks'),
218
- inboundEmailParsing: unsupported('SMTP does not provide inbound email parsing'),
219
- subscriptionMgmt: platform('Platform-managed subscription preferences (SMTP has no native list management)', { strategy: 'platform-managed', description: 'Subscription management handled entirely by platform since SMTP has no native capabilities', docUrl: '/degradation/subscription-mgmt' }),
220
- suppressionLists: platform('Platform-managed suppression lists (SMTP has no native suppression)', { strategy: 'platform-managed', description: 'Suppression list maintained locally since SMTP has no provider-level suppression', docUrl: '/degradation/suppression-lists' }),
221
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for SMTP emails'),
222
- scheduledSend: platform('Platform-managed scheduled send (SMTP has no native scheduling)', { strategy: 'platform-scheduled', description: 'Emails are queued locally and sent at the scheduled time', docUrl: '/degradation/scheduled-send' }),
223
- openClickTracking: unsupported('SMTP does not support open/click tracking'),
224
- utmTracking: unsupported('SMTP has no per-message UTM option; tracking.utm is ignored'),
225
- emailContentParsing: platform('Parse and transform email content for SMTP'),
226
- emailHeaderMgmt: platform('Set custom headers on SMTP emails'),
227
- attachments: provider('File attachments via SMTP MIME'),
228
- advancedAttachmentProcessing: platform('Process and validate attachments before SMTP send'),
229
- dkimSpf: unsupported('SMTP DKIM/SPF requires manual server configuration, not programmatic'),
230
- linkBranding: unsupported('SMTP does not support custom branded tracking domains'),
231
- retryResilience: platform('Automatic retry with backoff for SMTP connections'),
232
- multiProviderFailover: platform('Failover from SMTP to alternate providers'),
233
- };
234
- const mandrillCapabilities = {
235
- sendEmail: provider('Send email via Mandrill API'),
236
- batchSend: provider('Sequential batch send via Mandrill messages/send', { overridable: true }),
237
- providerTemplates: provider('Mandrill templates with merge variables', { overridable: true }),
238
- localTemplates: platform('Render templates locally before sending via Mandrill'),
239
- calendarInvites: platform('Attach iCalendar invites to Mandrill emails'),
240
- calendarEventMgmt: platform('Manage calendar events locally, send via Mandrill'),
241
- webhooksReceive: provider('Mandrill webhooks for delivery and engagement events', { overridable: true }),
242
- webhookNormalization: enhanced('Normalize Mandrill webhook payloads to common format'),
243
- deliveryTracking: provider('Track delivery via Mandrill webhooks and message info API', { overridable: true }),
244
- inboundEmailParsing: enhanced('Parse inbound emails from Mandrill inbound routes'),
245
- subscriptionMgmt: platform('Platform-managed subscription preferences (Mandrill has no native list management)', { strategy: 'platform-managed', description: 'Subscription management handled entirely by platform since Mandrill has no native list management', docUrl: '/degradation/subscription-mgmt' }),
246
- suppressionLists: provider('Mandrill rejection and blacklist API', { overridable: true }),
247
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for Mandrill emails'),
248
- scheduledSend: provider('Mandrill scheduled send via send_at parameter', { limitations: '30-day max scheduling window', overridable: true }),
249
- openClickTracking: provider('Mandrill open and click tracking', { overridable: true }),
250
- utmTracking: unsupported('Mandrill per-message UTM override is unverified; tracking.utm is ignored'),
251
- emailContentParsing: platform('Parse and transform email content for Mandrill'),
252
- emailHeaderMgmt: platform('Set custom headers on Mandrill emails'),
253
- attachments: provider('File attachments via Mandrill API (base64)'),
254
- advancedAttachmentProcessing: platform('Process and validate attachments before Mandrill send'),
255
- dkimSpf: provider('Mandrill domain verification (DKIM/SPF)', { overridable: true }),
256
- linkBranding: provider('Mandrill custom tracking domains', { overridable: true }),
257
- retryResilience: platform('Automatic retry with backoff for Mandrill API calls'),
258
- multiProviderFailover: platform('Failover from Mandrill to alternate providers'),
259
- };
260
- const smtp2goCapabilities = {
261
- sendEmail: provider('Send email via SMTP2GO API'),
262
- batchSend: provider('Batch send via SMTP2GO multiple recipients per call', { overridable: true }),
263
- providerTemplates: unsupported('SMTP2GO does not support server-side templates'),
264
- localTemplates: platform('Render templates locally before sending via SMTP2GO'),
265
- calendarInvites: platform('Attach iCalendar invites to SMTP2GO emails'),
266
- calendarEventMgmt: platform('Manage calendar events locally, send via SMTP2GO'),
267
- webhooksReceive: provider('SMTP2GO webhooks for delivery events', { overridable: true }),
268
- webhookNormalization: enhanced('Normalize SMTP2GO webhook payloads to common format'),
269
- deliveryTracking: provider('Track delivery via SMTP2GO webhooks', { overridable: true }),
270
- inboundEmailParsing: unsupported('SMTP2GO does not provide inbound email parsing'),
271
- subscriptionMgmt: platform('Platform-managed subscription preferences (SMTP2GO has no native list management)', { strategy: 'platform-managed', description: 'Subscription management handled entirely by platform since SMTP2GO has no native list management', docUrl: '/degradation/subscription-mgmt' }),
272
- suppressionLists: provider('SMTP2GO suppression API', { overridable: true }),
273
- unsubscribeUrlGeneration: platform('Generate unsubscribe URLs for SMTP2GO emails'),
274
- scheduledSend: platform('Platform-managed scheduled send (SMTP2GO has no native scheduling)', { strategy: 'platform-scheduled', description: 'Emails are queued locally and sent at the scheduled time', docUrl: '/degradation/scheduled-send' }),
275
- openClickTracking: provider('SMTP2GO open and click tracking', {
276
- limitations: 'Set per API key; the per-message tracking override is ignored',
277
- overridable: true,
278
- }),
279
- utmTracking: unsupported('SMTP2GO has no per-message UTM option; tracking.utm is ignored'),
280
- emailContentParsing: platform('Parse and transform email content for SMTP2GO'),
281
- emailHeaderMgmt: platform('Set custom headers on SMTP2GO emails'),
282
- attachments: provider('File attachments via SMTP2GO API (base64)'),
283
- advancedAttachmentProcessing: platform('Process and validate attachments before SMTP2GO send'),
284
- dkimSpf: provider('SMTP2GO DKIM signing and SPF', { overridable: true }),
285
- linkBranding: provider('SMTP2GO custom tracking domains', { overridable: true }),
286
- retryResilience: platform('Automatic retry with backoff for SMTP2GO API calls'),
287
- multiProviderFailover: platform('Failover from SMTP2GO to alternate providers'),
288
- };
289
- // ---------------------------------------------------------------------------
290
- // Exported Matrix
291
- // ---------------------------------------------------------------------------
292
- export const CAPABILITY_MATRIX = {
293
- version: '1.1.0',
294
- lastUpdated: '2026-03-07',
295
- providers: {
296
- sendgrid: sendgridCapabilities,
297
- mailgun: mailgunCapabilities,
298
- postmark: postmarkCapabilities,
299
- ses: sesCapabilities,
300
- smtp: smtpCapabilities,
301
- mandrill: mandrillCapabilities,
302
- smtp2go: smtp2goCapabilities,
303
- },
304
- };
305
- /**
306
- * Returns a deep clone of the capability matrix to prevent mutation of the
307
- * canonical data.
308
- */
309
- export function getCapabilityMatrix() {
310
- return structuredClone(CAPABILITY_MATRIX);
311
- }
312
- //# sourceMappingURL=matrix.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"matrix.js","sourceRoot":"","sources":["../../src/capabilities/matrix.ts"],"names":[],"mappings":"AAAA;;;;;;EAME;AAIF,8EAA8E;AAC9E,gDAAgD;AAChD,8EAA8E;AAC9E,6EAA6E;AAC7E,+EAA+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C5C,CAAC"}
@@ -1,95 +0,0 @@
1
- import type { CapabilityEntry } from '@bernierllc/email-sender';
2
- import type { CapabilityResolverAdmin } from './resolver.js';
3
- /**
4
- * Minimal Redis client interface. Compatible with ioredis instances.
5
- * Users provide their own Redis client so we don't bundle ioredis.
6
- */
7
- export interface RedisLike {
8
- get(key: string): Promise<string | null>;
9
- set(key: string, value: string, ...args: unknown[]): Promise<string | null>;
10
- del(...keys: string[]): Promise<number>;
11
- keys(pattern: string): Promise<string[]>;
12
- pipeline(): RedisPipelineLike;
13
- }
14
- export interface RedisPipelineLike {
15
- get(key: string): RedisPipelineLike;
16
- set(key: string, value: string, ...args: unknown[]): RedisPipelineLike;
17
- exec(): Promise<Array<[Error | null, unknown]>>;
18
- }
19
- export interface RedisCapabilityResolverOptions {
20
- /** User-provided Redis client (ioredis instance or compatible). */
21
- redis: RedisLike;
22
- /** Key prefix. Default: 'ecap'. */
23
- keyPrefix?: string;
24
- /** Agnostic scoping namespace (e.g., org_id). */
25
- namespace?: string;
26
- /** Cache TTL in seconds. 0 = no expiry. Default: 0. */
27
- ttl?: number;
28
- /** Optional logger for diagnostics. */
29
- logger?: {
30
- warn: (...args: unknown[]) => void;
31
- };
32
- }
33
- /**
34
- * Redis-backed {@link CapabilityResolverAdmin}.
35
- *
36
- * Stores per-provider, per-feature capability overrides in Redis. When a key
37
- * is not present in Redis the resolver falls back to the static
38
- * {@link CAPABILITY_MATRIX}.
39
- *
40
- * Entries read from Redis are validated against `capabilityEntrySchema`; if
41
- * validation fails the static matrix entry is returned instead.
42
- */
43
- export declare class RedisCapabilityResolver implements CapabilityResolverAdmin {
44
- private readonly redis;
45
- private readonly prefix;
46
- private readonly namespace;
47
- private readonly ttl;
48
- private readonly logger;
49
- constructor(options: RedisCapabilityResolverOptions);
50
- /**
51
- * Builds the Redis key for a specific provider + feature pair.
52
- *
53
- * Without namespace: `ecap:sendgrid:batchSend`
54
- * With namespace `org_123`: `ecap:org_123:sendgrid:batchSend`
55
- */
56
- buildKey(provider: string, feature: string): string;
57
- /**
58
- * Builds the key pattern for listing all features of a provider.
59
- */
60
- private buildProviderPattern;
61
- /**
62
- * Extracts the feature name from a full Redis key.
63
- */
64
- private extractFeature;
65
- getCapability(provider: string, feature: string): Promise<CapabilityEntry>;
66
- getProviderCapabilities(provider: string): Promise<Record<string, CapabilityEntry>>;
67
- setCapability(provider: string, feature: string, entry: CapabilityEntry): Promise<void>;
68
- setProviderCapabilities(provider: string, capabilities: Record<string, CapabilityEntry>): Promise<void>;
69
- /**
70
- * Parses a JSON string from Redis and validates it against the schema.
71
- * Falls back to the static matrix entry on any error.
72
- */
73
- private parseAndValidate;
74
- /**
75
- * Parses and validates silently, returning null on failure (used in batch operations).
76
- */
77
- private parseAndValidateQuiet;
78
- /**
79
- * Gets a capability entry from the static CAPABILITY_MATRIX.
80
- * Throws CapabilityResolverError if provider or feature is unknown.
81
- */
82
- private getMatrixEntry;
83
- /**
84
- * Gets all capabilities for a provider from the static matrix.
85
- * Returns an empty object for unknown providers (Redis may have entries for providers
86
- * not in the static matrix).
87
- */
88
- private getMatrixProviderCaps;
89
- /**
90
- * Validates a capability entry against the Zod schema, throwing a
91
- * {@link CapabilityResolverError} with code `INVALID_ENTRY` on failure.
92
- */
93
- private validateEntry;
94
- }
95
- //# sourceMappingURL=redis-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-resolver.d.ts","sourceRoot":"","sources":["../../src/capabilities/redis-resolver.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAIhE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAM7D;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,G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