@bernierllc/email-manager 0.1.1 → 0.1.4
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 +6 -0
- package/dist/config/loadConfiguration.d.ts +60 -0
- package/dist/config/loadConfiguration.d.ts.map +1 -0
- package/dist/config/loadConfiguration.js +468 -0
- package/dist/config/loadConfiguration.js.map +1 -0
- package/dist/config/schema.d.ts +867 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +301 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/types.d.ts +826 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +9 -0
- package/dist/config/types.js.map +1 -0
- package/dist/email-manager.d.ts.map +1 -1
- package/dist/email-manager.js +9 -13
- package/dist/email-manager.js.map +1 -1
- package/dist/enhanced-email-manager.d.ts +173 -0
- package/dist/enhanced-email-manager.d.ts.map +1 -0
- package/dist/enhanced-email-manager.js +866 -0
- package/dist/enhanced-email-manager.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +356 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +46 -18
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime configuration interface for email manager suite
|
|
3
|
+
* Suite package that orchestrates complete email management functionality
|
|
4
|
+
*/
|
|
5
|
+
export interface EmailManagerRuntimeConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Suite-level configuration
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Enable/disable the email manager suite
|
|
11
|
+
* @default true
|
|
12
|
+
* Environment: EMAIL_MANAGER_ENABLED
|
|
13
|
+
*/
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Default email provider to use
|
|
17
|
+
* @default undefined
|
|
18
|
+
* Environment: EMAIL_MANAGER_DEFAULT_PROVIDER
|
|
19
|
+
*/
|
|
20
|
+
defaultProvider?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Email provider configurations
|
|
23
|
+
*/
|
|
24
|
+
providers?: {
|
|
25
|
+
/**
|
|
26
|
+
* Provider definitions directory
|
|
27
|
+
* @default './providers'
|
|
28
|
+
* Environment: EMAIL_MANAGER_PROVIDERS_DIR
|
|
29
|
+
*/
|
|
30
|
+
configDir?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Provider failover configuration
|
|
33
|
+
*/
|
|
34
|
+
failover?: {
|
|
35
|
+
/**
|
|
36
|
+
* Enable automatic failover
|
|
37
|
+
* @default true
|
|
38
|
+
* Environment: EMAIL_MANAGER_FAILOVER_ENABLED
|
|
39
|
+
*/
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Maximum failover attempts
|
|
43
|
+
* @default 3
|
|
44
|
+
* Environment: EMAIL_MANAGER_FAILOVER_MAX_ATTEMPTS
|
|
45
|
+
*/
|
|
46
|
+
maxAttempts?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Failover delay between attempts (milliseconds)
|
|
49
|
+
* @default 5000
|
|
50
|
+
* Environment: EMAIL_MANAGER_FAILOVER_DELAY_MS
|
|
51
|
+
*/
|
|
52
|
+
delayMs?: number;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Provider health checking
|
|
56
|
+
*/
|
|
57
|
+
healthCheck?: {
|
|
58
|
+
/**
|
|
59
|
+
* Enable provider health checks
|
|
60
|
+
* @default true
|
|
61
|
+
* Environment: EMAIL_MANAGER_HEALTH_CHECK_ENABLED
|
|
62
|
+
*/
|
|
63
|
+
enabled?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Health check interval (milliseconds)
|
|
66
|
+
* @default 300000 (5 minutes)
|
|
67
|
+
* Environment: EMAIL_MANAGER_HEALTH_CHECK_INTERVAL_MS
|
|
68
|
+
*/
|
|
69
|
+
intervalMs?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Health check timeout (milliseconds)
|
|
72
|
+
* @default 10000
|
|
73
|
+
* Environment: EMAIL_MANAGER_HEALTH_CHECK_TIMEOUT_MS
|
|
74
|
+
*/
|
|
75
|
+
timeoutMs?: number;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Template management configuration
|
|
80
|
+
*/
|
|
81
|
+
templates?: {
|
|
82
|
+
/**
|
|
83
|
+
* Template storage directory
|
|
84
|
+
* @default './templates'
|
|
85
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_DIR
|
|
86
|
+
*/
|
|
87
|
+
storageDir?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Maximum templates per category
|
|
90
|
+
* @default 100
|
|
91
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_MAX_PER_CATEGORY
|
|
92
|
+
*/
|
|
93
|
+
maxPerCategory?: number;
|
|
94
|
+
/**
|
|
95
|
+
* Template cache TTL (milliseconds)
|
|
96
|
+
* @default 3600000 (1 hour)
|
|
97
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_CACHE_TTL_MS
|
|
98
|
+
*/
|
|
99
|
+
cacheTtlMs?: number;
|
|
100
|
+
/**
|
|
101
|
+
* Enable template versioning
|
|
102
|
+
* @default true
|
|
103
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_VERSIONING_ENABLED
|
|
104
|
+
*/
|
|
105
|
+
versioningEnabled?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Enable template validation
|
|
108
|
+
* @default true
|
|
109
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_VALIDATION_ENABLED
|
|
110
|
+
*/
|
|
111
|
+
validationEnabled?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Template compilation settings
|
|
114
|
+
*/
|
|
115
|
+
compilation?: {
|
|
116
|
+
/**
|
|
117
|
+
* Enable template precompilation
|
|
118
|
+
* @default true
|
|
119
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_PRECOMPILE
|
|
120
|
+
*/
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Template engine to use
|
|
124
|
+
* @default 'handlebars'
|
|
125
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_ENGINE
|
|
126
|
+
*/
|
|
127
|
+
engine?: 'handlebars' | 'mustache' | 'pug' | 'ejs';
|
|
128
|
+
/**
|
|
129
|
+
* Compilation cache size
|
|
130
|
+
* @default 1000
|
|
131
|
+
* Environment: EMAIL_MANAGER_TEMPLATES_COMPILE_CACHE_SIZE
|
|
132
|
+
*/
|
|
133
|
+
cacheSize?: number;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Email scheduling configuration
|
|
138
|
+
*/
|
|
139
|
+
scheduling?: {
|
|
140
|
+
/**
|
|
141
|
+
* Enable email scheduling
|
|
142
|
+
* @default true
|
|
143
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_ENABLED
|
|
144
|
+
*/
|
|
145
|
+
enabled?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Maximum scheduled emails in queue
|
|
148
|
+
* @default 10000
|
|
149
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_MAX_QUEUE_SIZE
|
|
150
|
+
*/
|
|
151
|
+
maxQueueSize?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Scheduler polling interval (milliseconds)
|
|
154
|
+
* @default 60000 (1 minute)
|
|
155
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_POLL_INTERVAL_MS
|
|
156
|
+
*/
|
|
157
|
+
pollIntervalMs?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Maximum scheduling time ahead (milliseconds)
|
|
160
|
+
* @default 2592000000 (30 days)
|
|
161
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_MAX_AHEAD_MS
|
|
162
|
+
*/
|
|
163
|
+
maxAheadMs?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Job persistence configuration
|
|
166
|
+
*/
|
|
167
|
+
persistence?: {
|
|
168
|
+
/**
|
|
169
|
+
* Enable job persistence
|
|
170
|
+
* @default true
|
|
171
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_PERSISTENCE_ENABLED
|
|
172
|
+
*/
|
|
173
|
+
enabled?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Persistence provider
|
|
176
|
+
* @default 'file'
|
|
177
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_PERSISTENCE_PROVIDER
|
|
178
|
+
*/
|
|
179
|
+
provider?: 'file' | 'database' | 'redis';
|
|
180
|
+
/**
|
|
181
|
+
* Persistence storage path/connection
|
|
182
|
+
* Environment: EMAIL_MANAGER_SCHEDULING_PERSISTENCE_PATH
|
|
183
|
+
*/
|
|
184
|
+
path?: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Email analytics configuration
|
|
189
|
+
*/
|
|
190
|
+
analytics?: {
|
|
191
|
+
/**
|
|
192
|
+
* Enable email analytics
|
|
193
|
+
* @default true
|
|
194
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_ENABLED
|
|
195
|
+
*/
|
|
196
|
+
enabled?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Analytics data retention (days)
|
|
199
|
+
* @default 90
|
|
200
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_RETENTION_DAYS
|
|
201
|
+
*/
|
|
202
|
+
retentionDays?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Metrics aggregation interval (milliseconds)
|
|
205
|
+
* @default 300000 (5 minutes)
|
|
206
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_AGGREGATION_INTERVAL_MS
|
|
207
|
+
*/
|
|
208
|
+
aggregationIntervalMs?: number;
|
|
209
|
+
/**
|
|
210
|
+
* Enable detailed tracking
|
|
211
|
+
* @default true
|
|
212
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_DETAILED_TRACKING
|
|
213
|
+
*/
|
|
214
|
+
detailedTracking?: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Webhook tracking configuration
|
|
217
|
+
*/
|
|
218
|
+
webhooks?: {
|
|
219
|
+
/**
|
|
220
|
+
* Enable webhook event tracking
|
|
221
|
+
* @default true
|
|
222
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_WEBHOOKS_ENABLED
|
|
223
|
+
*/
|
|
224
|
+
enabled?: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Webhook endpoint URL
|
|
227
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_WEBHOOK_URL
|
|
228
|
+
*/
|
|
229
|
+
url?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Webhook secret for verification
|
|
232
|
+
* Environment: EMAIL_MANAGER_ANALYTICS_WEBHOOK_SECRET
|
|
233
|
+
*/
|
|
234
|
+
secret?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Events to track
|
|
237
|
+
* @default ['sent', 'delivered', 'opened', 'clicked', 'bounced', 'complained']
|
|
238
|
+
*/
|
|
239
|
+
events?: string[];
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
/**
|
|
243
|
+
* Rate limiting and throttling
|
|
244
|
+
*/
|
|
245
|
+
rateLimiting?: {
|
|
246
|
+
/**
|
|
247
|
+
* Enable global rate limiting
|
|
248
|
+
* @default true
|
|
249
|
+
* Environment: EMAIL_MANAGER_RATE_LIMITING_ENABLED
|
|
250
|
+
*/
|
|
251
|
+
enabled?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Global rate limit (emails per minute)
|
|
254
|
+
* @default 1000
|
|
255
|
+
* Environment: EMAIL_MANAGER_RATE_LIMIT_EMAILS_PER_MINUTE
|
|
256
|
+
*/
|
|
257
|
+
emailsPerMinute?: number;
|
|
258
|
+
/**
|
|
259
|
+
* Rate limit window (milliseconds)
|
|
260
|
+
* @default 60000
|
|
261
|
+
* Environment: EMAIL_MANAGER_RATE_LIMIT_WINDOW_MS
|
|
262
|
+
*/
|
|
263
|
+
windowMs?: number;
|
|
264
|
+
/**
|
|
265
|
+
* Per-recipient rate limiting
|
|
266
|
+
*/
|
|
267
|
+
perRecipient?: {
|
|
268
|
+
/**
|
|
269
|
+
* Enable per-recipient rate limiting
|
|
270
|
+
* @default true
|
|
271
|
+
* Environment: EMAIL_MANAGER_PER_RECIPIENT_RATE_LIMITING
|
|
272
|
+
*/
|
|
273
|
+
enabled?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Emails per recipient per hour
|
|
276
|
+
* @default 10
|
|
277
|
+
* Environment: EMAIL_MANAGER_PER_RECIPIENT_EMAILS_PER_HOUR
|
|
278
|
+
*/
|
|
279
|
+
emailsPerHour?: number;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Per-template rate limiting
|
|
283
|
+
*/
|
|
284
|
+
perTemplate?: {
|
|
285
|
+
/**
|
|
286
|
+
* Enable per-template rate limiting
|
|
287
|
+
* @default false
|
|
288
|
+
* Environment: EMAIL_MANAGER_PER_TEMPLATE_RATE_LIMITING
|
|
289
|
+
*/
|
|
290
|
+
enabled?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Template-specific limits (templateId -> limit per hour)
|
|
293
|
+
*/
|
|
294
|
+
limits?: Record<string, number>;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Security and compliance
|
|
299
|
+
*/
|
|
300
|
+
security?: {
|
|
301
|
+
/**
|
|
302
|
+
* Enable DKIM signing
|
|
303
|
+
* @default false
|
|
304
|
+
* Environment: EMAIL_MANAGER_SECURITY_DKIM_ENABLED
|
|
305
|
+
*/
|
|
306
|
+
dkimEnabled?: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* DKIM private key path
|
|
309
|
+
* Environment: EMAIL_MANAGER_SECURITY_DKIM_PRIVATE_KEY_PATH
|
|
310
|
+
*/
|
|
311
|
+
dkimPrivateKeyPath?: string;
|
|
312
|
+
/**
|
|
313
|
+
* DKIM selector
|
|
314
|
+
* Environment: EMAIL_MANAGER_SECURITY_DKIM_SELECTOR
|
|
315
|
+
*/
|
|
316
|
+
dkimSelector?: string;
|
|
317
|
+
/**
|
|
318
|
+
* Enable SPF checking
|
|
319
|
+
* @default false
|
|
320
|
+
* Environment: EMAIL_MANAGER_SECURITY_SPF_CHECK_ENABLED
|
|
321
|
+
*/
|
|
322
|
+
spfCheckEnabled?: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Content filtering configuration
|
|
325
|
+
*/
|
|
326
|
+
contentFiltering?: {
|
|
327
|
+
/**
|
|
328
|
+
* Enable content filtering
|
|
329
|
+
* @default true
|
|
330
|
+
* Environment: EMAIL_MANAGER_CONTENT_FILTERING_ENABLED
|
|
331
|
+
*/
|
|
332
|
+
enabled?: boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Block suspicious content
|
|
335
|
+
* @default true
|
|
336
|
+
* Environment: EMAIL_MANAGER_CONTENT_FILTERING_BLOCK_SUSPICIOUS
|
|
337
|
+
*/
|
|
338
|
+
blockSuspicious?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Custom content filters directory
|
|
341
|
+
* Environment: EMAIL_MANAGER_CONTENT_FILTERING_CUSTOM_FILTERS_DIR
|
|
342
|
+
*/
|
|
343
|
+
customFiltersDir?: string;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Data retention and privacy
|
|
347
|
+
*/
|
|
348
|
+
privacy?: {
|
|
349
|
+
/**
|
|
350
|
+
* Enable PII detection
|
|
351
|
+
* @default true
|
|
352
|
+
* Environment: EMAIL_MANAGER_PRIVACY_PII_DETECTION
|
|
353
|
+
*/
|
|
354
|
+
piiDetection?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Auto-redact sensitive data in logs
|
|
357
|
+
* @default true
|
|
358
|
+
* Environment: EMAIL_MANAGER_PRIVACY_AUTO_REDACT_LOGS
|
|
359
|
+
*/
|
|
360
|
+
autoRedactLogs?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* Email data retention (days)
|
|
363
|
+
* @default 30
|
|
364
|
+
* Environment: EMAIL_MANAGER_PRIVACY_DATA_RETENTION_DAYS
|
|
365
|
+
*/
|
|
366
|
+
dataRetentionDays?: number;
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Delivery optimization
|
|
371
|
+
*/
|
|
372
|
+
delivery?: {
|
|
373
|
+
/**
|
|
374
|
+
* Enable delivery optimization
|
|
375
|
+
* @default true
|
|
376
|
+
* Environment: EMAIL_MANAGER_DELIVERY_OPTIMIZATION_ENABLED
|
|
377
|
+
*/
|
|
378
|
+
optimizationEnabled?: boolean;
|
|
379
|
+
/**
|
|
380
|
+
* Batch processing configuration
|
|
381
|
+
*/
|
|
382
|
+
batching?: {
|
|
383
|
+
/**
|
|
384
|
+
* Enable batch processing
|
|
385
|
+
* @default true
|
|
386
|
+
* Environment: EMAIL_MANAGER_DELIVERY_BATCHING_ENABLED
|
|
387
|
+
*/
|
|
388
|
+
enabled?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* Batch size
|
|
391
|
+
* @default 100
|
|
392
|
+
* Environment: EMAIL_MANAGER_DELIVERY_BATCH_SIZE
|
|
393
|
+
*/
|
|
394
|
+
size?: number;
|
|
395
|
+
/**
|
|
396
|
+
* Batch processing interval (milliseconds)
|
|
397
|
+
* @default 10000
|
|
398
|
+
* Environment: EMAIL_MANAGER_DELIVERY_BATCH_INTERVAL_MS
|
|
399
|
+
*/
|
|
400
|
+
intervalMs?: number;
|
|
401
|
+
};
|
|
402
|
+
/**
|
|
403
|
+
* Retry configuration
|
|
404
|
+
*/
|
|
405
|
+
retry?: {
|
|
406
|
+
/**
|
|
407
|
+
* Enable delivery retries
|
|
408
|
+
* @default true
|
|
409
|
+
* Environment: EMAIL_MANAGER_DELIVERY_RETRY_ENABLED
|
|
410
|
+
*/
|
|
411
|
+
enabled?: boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Maximum retry attempts
|
|
414
|
+
* @default 5
|
|
415
|
+
* Environment: EMAIL_MANAGER_DELIVERY_RETRY_MAX_ATTEMPTS
|
|
416
|
+
*/
|
|
417
|
+
maxAttempts?: number;
|
|
418
|
+
/**
|
|
419
|
+
* Initial retry delay (milliseconds)
|
|
420
|
+
* @default 30000
|
|
421
|
+
* Environment: EMAIL_MANAGER_DELIVERY_RETRY_INITIAL_DELAY_MS
|
|
422
|
+
*/
|
|
423
|
+
initialDelayMs?: number;
|
|
424
|
+
/**
|
|
425
|
+
* Maximum retry delay (milliseconds)
|
|
426
|
+
* @default 3600000
|
|
427
|
+
* Environment: EMAIL_MANAGER_DELIVERY_RETRY_MAX_DELAY_MS
|
|
428
|
+
*/
|
|
429
|
+
maxDelayMs?: number;
|
|
430
|
+
/**
|
|
431
|
+
* Retry backoff factor
|
|
432
|
+
* @default 2
|
|
433
|
+
* Environment: EMAIL_MANAGER_DELIVERY_RETRY_BACKOFF_FACTOR
|
|
434
|
+
*/
|
|
435
|
+
backoffFactor?: number;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Cache configuration
|
|
440
|
+
*/
|
|
441
|
+
cache?: {
|
|
442
|
+
/**
|
|
443
|
+
* Enable caching
|
|
444
|
+
* @default true
|
|
445
|
+
* Environment: EMAIL_MANAGER_CACHE_ENABLED
|
|
446
|
+
*/
|
|
447
|
+
enabled?: boolean;
|
|
448
|
+
/**
|
|
449
|
+
* Cache provider
|
|
450
|
+
* @default 'memory'
|
|
451
|
+
* Environment: EMAIL_MANAGER_CACHE_PROVIDER
|
|
452
|
+
*/
|
|
453
|
+
provider?: 'memory' | 'redis' | 'memcached';
|
|
454
|
+
/**
|
|
455
|
+
* Template cache TTL (milliseconds)
|
|
456
|
+
* @default 3600000
|
|
457
|
+
* Environment: EMAIL_MANAGER_CACHE_TEMPLATES_TTL_MS
|
|
458
|
+
*/
|
|
459
|
+
templatesTtlMs?: number;
|
|
460
|
+
/**
|
|
461
|
+
* Provider status cache TTL (milliseconds)
|
|
462
|
+
* @default 300000
|
|
463
|
+
* Environment: EMAIL_MANAGER_CACHE_PROVIDER_STATUS_TTL_MS
|
|
464
|
+
*/
|
|
465
|
+
providerStatusTtlMs?: number;
|
|
466
|
+
/**
|
|
467
|
+
* Analytics cache TTL (milliseconds)
|
|
468
|
+
* @default 900000
|
|
469
|
+
* Environment: EMAIL_MANAGER_CACHE_ANALYTICS_TTL_MS
|
|
470
|
+
*/
|
|
471
|
+
analyticsTtlMs?: number;
|
|
472
|
+
/**
|
|
473
|
+
* Cache connection URL (for Redis/Memcached)
|
|
474
|
+
* Environment: EMAIL_MANAGER_CACHE_URL
|
|
475
|
+
*/
|
|
476
|
+
url?: string;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Database configuration
|
|
480
|
+
*/
|
|
481
|
+
database?: {
|
|
482
|
+
/**
|
|
483
|
+
* Database provider
|
|
484
|
+
* @default 'sqlite'
|
|
485
|
+
* Environment: EMAIL_MANAGER_DATABASE_PROVIDER
|
|
486
|
+
*/
|
|
487
|
+
provider?: 'sqlite' | 'postgresql' | 'mysql' | 'mongodb';
|
|
488
|
+
/**
|
|
489
|
+
* Database connection URL
|
|
490
|
+
* Environment: EMAIL_MANAGER_DATABASE_URL
|
|
491
|
+
*/
|
|
492
|
+
url?: string;
|
|
493
|
+
/**
|
|
494
|
+
* Connection pool configuration
|
|
495
|
+
*/
|
|
496
|
+
pool?: {
|
|
497
|
+
/**
|
|
498
|
+
* Minimum pool size
|
|
499
|
+
* @default 2
|
|
500
|
+
* Environment: EMAIL_MANAGER_DATABASE_POOL_MIN
|
|
501
|
+
*/
|
|
502
|
+
min?: number;
|
|
503
|
+
/**
|
|
504
|
+
* Maximum pool size
|
|
505
|
+
* @default 20
|
|
506
|
+
* Environment: EMAIL_MANAGER_DATABASE_POOL_MAX
|
|
507
|
+
*/
|
|
508
|
+
max?: number;
|
|
509
|
+
/**
|
|
510
|
+
* Connection timeout (milliseconds)
|
|
511
|
+
* @default 30000
|
|
512
|
+
* Environment: EMAIL_MANAGER_DATABASE_POOL_TIMEOUT_MS
|
|
513
|
+
*/
|
|
514
|
+
timeoutMs?: number;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Enable query logging
|
|
518
|
+
* @default false
|
|
519
|
+
* Environment: EMAIL_MANAGER_DATABASE_LOG_QUERIES
|
|
520
|
+
*/
|
|
521
|
+
logQueries?: boolean;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* Logger configuration (integration with @bernierllc/logger)
|
|
525
|
+
*/
|
|
526
|
+
logger?: {
|
|
527
|
+
/**
|
|
528
|
+
* Log level for email manager
|
|
529
|
+
* @default 'info'
|
|
530
|
+
* Environment: EMAIL_MANAGER_LOG_LEVEL
|
|
531
|
+
*/
|
|
532
|
+
level?: 'debug' | 'info' | 'warn' | 'error';
|
|
533
|
+
/**
|
|
534
|
+
* Enable logging
|
|
535
|
+
* @default true
|
|
536
|
+
* Environment: EMAIL_MANAGER_LOG_ENABLED
|
|
537
|
+
*/
|
|
538
|
+
enabled?: boolean;
|
|
539
|
+
/**
|
|
540
|
+
* Include email addresses in logs (privacy consideration)
|
|
541
|
+
* @default false
|
|
542
|
+
* Environment: EMAIL_MANAGER_LOG_INCLUDE_EMAILS
|
|
543
|
+
*/
|
|
544
|
+
includeEmails?: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Include email content in logs (security consideration)
|
|
547
|
+
* @default false
|
|
548
|
+
* Environment: EMAIL_MANAGER_LOG_INCLUDE_CONTENT
|
|
549
|
+
*/
|
|
550
|
+
includeContent?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* Log email delivery events
|
|
553
|
+
* @default true
|
|
554
|
+
* Environment: EMAIL_MANAGER_LOG_DELIVERY_EVENTS
|
|
555
|
+
*/
|
|
556
|
+
logDeliveryEvents?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Log template operations
|
|
559
|
+
* @default true
|
|
560
|
+
* Environment: EMAIL_MANAGER_LOG_TEMPLATE_OPERATIONS
|
|
561
|
+
*/
|
|
562
|
+
logTemplateOperations?: boolean;
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* Monitoring and metrics
|
|
566
|
+
*/
|
|
567
|
+
monitoring?: {
|
|
568
|
+
/**
|
|
569
|
+
* Enable monitoring
|
|
570
|
+
* @default true
|
|
571
|
+
* Environment: EMAIL_MANAGER_MONITORING_ENABLED
|
|
572
|
+
*/
|
|
573
|
+
enabled?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Metrics collection interval (milliseconds)
|
|
576
|
+
* @default 60000
|
|
577
|
+
* Environment: EMAIL_MANAGER_MONITORING_METRICS_INTERVAL_MS
|
|
578
|
+
*/
|
|
579
|
+
metricsIntervalMs?: number;
|
|
580
|
+
/**
|
|
581
|
+
* Enable performance monitoring
|
|
582
|
+
* @default true
|
|
583
|
+
* Environment: EMAIL_MANAGER_MONITORING_PERFORMANCE_ENABLED
|
|
584
|
+
*/
|
|
585
|
+
performanceEnabled?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* Enable alerting
|
|
588
|
+
* @default true
|
|
589
|
+
* Environment: EMAIL_MANAGER_MONITORING_ALERTING_ENABLED
|
|
590
|
+
*/
|
|
591
|
+
alertingEnabled?: boolean;
|
|
592
|
+
/**
|
|
593
|
+
* Alert thresholds
|
|
594
|
+
*/
|
|
595
|
+
alertThresholds?: {
|
|
596
|
+
/**
|
|
597
|
+
* Delivery failure rate threshold (percentage)
|
|
598
|
+
* @default 10
|
|
599
|
+
* Environment: EMAIL_MANAGER_MONITORING_ALERT_FAILURE_RATE
|
|
600
|
+
*/
|
|
601
|
+
deliveryFailureRate?: number;
|
|
602
|
+
/**
|
|
603
|
+
* Queue size threshold
|
|
604
|
+
* @default 5000
|
|
605
|
+
* Environment: EMAIL_MANAGER_MONITORING_ALERT_QUEUE_SIZE
|
|
606
|
+
*/
|
|
607
|
+
queueSize?: number;
|
|
608
|
+
/**
|
|
609
|
+
* Processing delay threshold (milliseconds)
|
|
610
|
+
* @default 300000
|
|
611
|
+
* Environment: EMAIL_MANAGER_MONITORING_ALERT_PROCESSING_DELAY_MS
|
|
612
|
+
*/
|
|
613
|
+
processingDelayMs?: number;
|
|
614
|
+
};
|
|
615
|
+
};
|
|
616
|
+
/**
|
|
617
|
+
* Core package dependency configurations
|
|
618
|
+
* Suite packages can override core package configurations
|
|
619
|
+
*/
|
|
620
|
+
corePackages?: {
|
|
621
|
+
/**
|
|
622
|
+
* Email Sender configuration overrides
|
|
623
|
+
*/
|
|
624
|
+
emailSender?: {
|
|
625
|
+
/**
|
|
626
|
+
* Default timeout (milliseconds)
|
|
627
|
+
* @default 30000
|
|
628
|
+
* Environment: EMAIL_MANAGER_EMAIL_SENDER_TIMEOUT_MS
|
|
629
|
+
*/
|
|
630
|
+
timeoutMs?: number;
|
|
631
|
+
/**
|
|
632
|
+
* Enable delivery confirmation
|
|
633
|
+
* @default true
|
|
634
|
+
* Environment: EMAIL_MANAGER_EMAIL_SENDER_DELIVERY_CONFIRMATION
|
|
635
|
+
*/
|
|
636
|
+
deliveryConfirmation?: boolean;
|
|
637
|
+
};
|
|
638
|
+
/**
|
|
639
|
+
* Template Engine configuration overrides
|
|
640
|
+
*/
|
|
641
|
+
templateEngine?: {
|
|
642
|
+
/**
|
|
643
|
+
* Enable strict mode
|
|
644
|
+
* @default true
|
|
645
|
+
* Environment: EMAIL_MANAGER_TEMPLATE_ENGINE_STRICT_MODE
|
|
646
|
+
*/
|
|
647
|
+
strictMode?: boolean;
|
|
648
|
+
/**
|
|
649
|
+
* Template cache size
|
|
650
|
+
* @default 1000
|
|
651
|
+
* Environment: EMAIL_MANAGER_TEMPLATE_ENGINE_CACHE_SIZE
|
|
652
|
+
*/
|
|
653
|
+
cacheSize?: number;
|
|
654
|
+
};
|
|
655
|
+
/**
|
|
656
|
+
* Crypto Utils configuration overrides
|
|
657
|
+
*/
|
|
658
|
+
cryptoUtils?: {
|
|
659
|
+
/**
|
|
660
|
+
* Default algorithm
|
|
661
|
+
* @default 'aes-256-gcm'
|
|
662
|
+
* Environment: EMAIL_MANAGER_CRYPTO_UTILS_ALGORITHM
|
|
663
|
+
*/
|
|
664
|
+
algorithm?: string;
|
|
665
|
+
};
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Resolved configuration after merging defaults, config file, and environment variables
|
|
670
|
+
*/
|
|
671
|
+
export interface ResolvedEmailManagerConfig {
|
|
672
|
+
enabled: boolean;
|
|
673
|
+
defaultProvider?: string;
|
|
674
|
+
providers: {
|
|
675
|
+
configDir: string;
|
|
676
|
+
failover: {
|
|
677
|
+
enabled: boolean;
|
|
678
|
+
maxAttempts: number;
|
|
679
|
+
delayMs: number;
|
|
680
|
+
};
|
|
681
|
+
healthCheck: {
|
|
682
|
+
enabled: boolean;
|
|
683
|
+
intervalMs: number;
|
|
684
|
+
timeoutMs: number;
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
templates: {
|
|
688
|
+
storageDir: string;
|
|
689
|
+
maxPerCategory: number;
|
|
690
|
+
cacheTtlMs: number;
|
|
691
|
+
versioningEnabled: boolean;
|
|
692
|
+
validationEnabled: boolean;
|
|
693
|
+
compilation: {
|
|
694
|
+
enabled: boolean;
|
|
695
|
+
engine: 'handlebars' | 'mustache' | 'pug' | 'ejs';
|
|
696
|
+
cacheSize: number;
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
scheduling: {
|
|
700
|
+
enabled: boolean;
|
|
701
|
+
maxQueueSize: number;
|
|
702
|
+
pollIntervalMs: number;
|
|
703
|
+
maxAheadMs: number;
|
|
704
|
+
persistence: {
|
|
705
|
+
enabled: boolean;
|
|
706
|
+
provider: 'file' | 'database' | 'redis';
|
|
707
|
+
path?: string;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
analytics: {
|
|
711
|
+
enabled: boolean;
|
|
712
|
+
retentionDays: number;
|
|
713
|
+
aggregationIntervalMs: number;
|
|
714
|
+
detailedTracking: boolean;
|
|
715
|
+
webhooks: {
|
|
716
|
+
enabled: boolean;
|
|
717
|
+
url?: string;
|
|
718
|
+
secret?: string;
|
|
719
|
+
events: string[];
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
rateLimiting: {
|
|
723
|
+
enabled: boolean;
|
|
724
|
+
emailsPerMinute: number;
|
|
725
|
+
windowMs: number;
|
|
726
|
+
perRecipient: {
|
|
727
|
+
enabled: boolean;
|
|
728
|
+
emailsPerHour: number;
|
|
729
|
+
};
|
|
730
|
+
perTemplate: {
|
|
731
|
+
enabled: boolean;
|
|
732
|
+
limits: Record<string, number>;
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
security: {
|
|
736
|
+
dkimEnabled: boolean;
|
|
737
|
+
dkimPrivateKeyPath?: string;
|
|
738
|
+
dkimSelector?: string;
|
|
739
|
+
spfCheckEnabled: boolean;
|
|
740
|
+
contentFiltering: {
|
|
741
|
+
enabled: boolean;
|
|
742
|
+
blockSuspicious: boolean;
|
|
743
|
+
customFiltersDir?: string;
|
|
744
|
+
};
|
|
745
|
+
privacy: {
|
|
746
|
+
piiDetection: boolean;
|
|
747
|
+
autoRedactLogs: boolean;
|
|
748
|
+
dataRetentionDays: number;
|
|
749
|
+
};
|
|
750
|
+
};
|
|
751
|
+
delivery: {
|
|
752
|
+
optimizationEnabled: boolean;
|
|
753
|
+
batching: {
|
|
754
|
+
enabled: boolean;
|
|
755
|
+
size: number;
|
|
756
|
+
intervalMs: number;
|
|
757
|
+
};
|
|
758
|
+
retry: {
|
|
759
|
+
enabled: boolean;
|
|
760
|
+
maxAttempts: number;
|
|
761
|
+
initialDelayMs: number;
|
|
762
|
+
maxDelayMs: number;
|
|
763
|
+
backoffFactor: number;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
cache: {
|
|
767
|
+
enabled: boolean;
|
|
768
|
+
provider: 'memory' | 'redis' | 'memcached';
|
|
769
|
+
templatesTtlMs: number;
|
|
770
|
+
providerStatusTtlMs: number;
|
|
771
|
+
analyticsTtlMs: number;
|
|
772
|
+
url?: string;
|
|
773
|
+
};
|
|
774
|
+
database: {
|
|
775
|
+
provider: 'sqlite' | 'postgresql' | 'mysql' | 'mongodb';
|
|
776
|
+
url?: string;
|
|
777
|
+
pool: {
|
|
778
|
+
min: number;
|
|
779
|
+
max: number;
|
|
780
|
+
timeoutMs: number;
|
|
781
|
+
};
|
|
782
|
+
logQueries: boolean;
|
|
783
|
+
};
|
|
784
|
+
logger: {
|
|
785
|
+
level: 'debug' | 'info' | 'warn' | 'error';
|
|
786
|
+
enabled: boolean;
|
|
787
|
+
includeEmails: boolean;
|
|
788
|
+
includeContent: boolean;
|
|
789
|
+
logDeliveryEvents: boolean;
|
|
790
|
+
logTemplateOperations: boolean;
|
|
791
|
+
};
|
|
792
|
+
monitoring: {
|
|
793
|
+
enabled: boolean;
|
|
794
|
+
metricsIntervalMs: number;
|
|
795
|
+
performanceEnabled: boolean;
|
|
796
|
+
alertingEnabled: boolean;
|
|
797
|
+
alertThresholds: {
|
|
798
|
+
deliveryFailureRate: number;
|
|
799
|
+
queueSize: number;
|
|
800
|
+
processingDelayMs: number;
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
corePackages: {
|
|
804
|
+
emailSender: {
|
|
805
|
+
timeoutMs: number;
|
|
806
|
+
deliveryConfirmation: boolean;
|
|
807
|
+
};
|
|
808
|
+
templateEngine: {
|
|
809
|
+
strictMode: boolean;
|
|
810
|
+
cacheSize: number;
|
|
811
|
+
};
|
|
812
|
+
cryptoUtils: {
|
|
813
|
+
algorithm: string;
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Configuration source tracking for transparency
|
|
819
|
+
*/
|
|
820
|
+
export interface ConfigurationSource {
|
|
821
|
+
key: string;
|
|
822
|
+
value: any;
|
|
823
|
+
source: 'default' | 'file' | 'environment' | 'core-override';
|
|
824
|
+
description: string;
|
|
825
|
+
}
|
|
826
|
+
//# sourceMappingURL=types.d.ts.map
|