@bernierllc/email-template-service 3.0.9 → 3.0.10

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.
@@ -1,580 +0,0 @@
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.EmailTemplateService = void 0;
11
- const errors_1 = require("./errors");
12
- /**
13
- * Email Template Service
14
- *
15
- * Orchestrates email template management with provider synchronization,
16
- * variable context validation, and base template support.
17
- */
18
- class EmailTemplateService {
19
- database;
20
- templateEngine;
21
- variableRegistry;
22
- providers;
23
- syncConfig;
24
- logger;
25
- constructor(config) {
26
- this.database = config.database;
27
- this.templateEngine = config.templateEngine;
28
- this.variableRegistry = config.variableRegistry;
29
- this.syncConfig = config.syncConfig;
30
- this.logger = config.logger;
31
- // Initialize provider map
32
- this.providers = new Map();
33
- for (const provider of config.providers) {
34
- this.providers.set(provider.providerId, provider);
35
- }
36
- this.log('info', 'Email template service initialized', {
37
- providerCount: this.providers.size,
38
- syncEnabled: this.syncConfig.enabled
39
- });
40
- }
41
- // ========================================
42
- // Template CRUD Operations
43
- // ========================================
44
- /**
45
- * Create a new template
46
- */
47
- async createTemplate(definition) {
48
- this.log('info', 'Creating template', { name: definition.name });
49
- // Build template object
50
- const template = {
51
- id: this.generateId(),
52
- name: definition.name,
53
- description: definition.description,
54
- subject: definition.subject,
55
- htmlContent: definition.htmlContent,
56
- textContent: definition.textContent,
57
- category: definition.category,
58
- tags: definition.tags || [],
59
- version: '1.0.0',
60
- isActive: true,
61
- context: definition.context,
62
- variables: [],
63
- requiredVariables: [],
64
- baseTemplateId: definition.baseTemplateId,
65
- contentOnly: definition.contentOnly,
66
- providerTemplateIds: {},
67
- lastSyncedAt: {},
68
- syncStatus: {},
69
- senderId: definition.senderId,
70
- senderOverride: definition.senderOverride,
71
- createdAt: new Date(),
72
- updatedAt: new Date(),
73
- createdBy: definition.createdBy,
74
- lastModifiedBy: definition.createdBy
75
- };
76
- // Validate template structure
77
- const validation = await this.validateTemplateStructure(template);
78
- if (!validation.isValid) {
79
- throw new errors_1.TemplateValidationError(validation.errors);
80
- }
81
- // Extract variables
82
- template.variables = await this.templateEngine.extractVariables(template.htmlContent);
83
- template.requiredVariables = template.variables
84
- .filter(v => v.required)
85
- .map(v => v.name);
86
- // Save to database
87
- const savedTemplate = await this.database.createTemplate(template);
88
- // Sync to providers if enabled
89
- if (this.syncConfig.enabled && this.syncConfig.defaultStrategy === 'auto') {
90
- await this.syncToAllProviders(savedTemplate.id);
91
- }
92
- this.log('info', 'Template created', { id: savedTemplate.id, name: savedTemplate.name });
93
- return savedTemplate;
94
- }
95
- /**
96
- * Update an existing template
97
- */
98
- async updateTemplate(id, updates) {
99
- this.log('info', 'Updating template', { id, updates: Object.keys(updates) });
100
- const existing = await this.database.getTemplate(id);
101
- if (!existing) {
102
- throw new errors_1.TemplateNotFoundError(id);
103
- }
104
- // Check for conflicts with provider versions
105
- if (this.syncConfig.enabled) {
106
- const conflicts = await this.detectSyncConflicts(id);
107
- if (conflicts.length > 0) {
108
- throw new errors_1.SyncConflictError(conflicts);
109
- }
110
- }
111
- // Apply updates
112
- const updatedData = {
113
- ...updates,
114
- updatedAt: new Date()
115
- };
116
- // Re-extract variables if content changed
117
- if (updates.htmlContent) {
118
- updatedData.variables = await this.templateEngine.extractVariables(updates.htmlContent);
119
- updatedData.requiredVariables = updatedData.variables
120
- .filter(v => v.required)
121
- .map(v => v.name);
122
- }
123
- // Validate if content changed
124
- if (updates.htmlContent || updates.subject) {
125
- const mergedTemplate = { ...existing, ...updatedData };
126
- const validation = await this.validateTemplateStructure(mergedTemplate);
127
- if (!validation.isValid) {
128
- throw new errors_1.TemplateValidationError(validation.errors);
129
- }
130
- }
131
- // Save to database
132
- const savedTemplate = await this.database.updateTemplate(id, updatedData);
133
- // Sync to providers if enabled
134
- if (this.syncConfig.enabled && this.syncConfig.defaultStrategy === 'auto') {
135
- await this.syncToAllProviders(id);
136
- }
137
- this.log('info', 'Template updated', { id });
138
- return savedTemplate;
139
- }
140
- /**
141
- * Delete a template
142
- */
143
- async deleteTemplate(id) {
144
- this.log('info', 'Deleting template', { id });
145
- const template = await this.database.getTemplate(id);
146
- if (!template) {
147
- throw new errors_1.TemplateNotFoundError(id);
148
- }
149
- // Delete from providers first
150
- if (this.syncConfig.enabled) {
151
- for (const [providerId, providerTemplateId] of Object.entries(template.providerTemplateIds)) {
152
- const plugin = this.providers.get(providerId);
153
- if (plugin) {
154
- try {
155
- await plugin.deleteTemplate(providerTemplateId);
156
- }
157
- catch (error) {
158
- this.log('warn', 'Failed to delete template from provider', {
159
- providerId,
160
- error: error instanceof Error ? error.message : 'Unknown error'
161
- });
162
- }
163
- }
164
- }
165
- }
166
- // Delete from database
167
- await this.database.deleteTemplate(id);
168
- this.log('info', 'Template deleted', { id });
169
- }
170
- /**
171
- * Get a template by ID
172
- */
173
- async getTemplate(id) {
174
- return this.database.getTemplate(id);
175
- }
176
- /**
177
- * List templates with filtering and pagination
178
- */
179
- async listTemplates(options = {}) {
180
- return this.database.listTemplates(options);
181
- }
182
- // ========================================
183
- // Provider Synchronization
184
- // ========================================
185
- /**
186
- * Sync template to a specific provider
187
- */
188
- async syncToProvider(templateId, providerId) {
189
- this.log('info', 'Syncing template to provider', { templateId, providerId });
190
- const template = await this.database.getTemplate(templateId);
191
- if (!template) {
192
- throw new errors_1.TemplateNotFoundError(templateId);
193
- }
194
- const plugin = this.providers.get(providerId);
195
- if (!plugin) {
196
- throw new errors_1.ProviderNotFoundError(providerId);
197
- }
198
- try {
199
- const providerTemplateId = template.providerTemplateIds[providerId];
200
- let result;
201
- if (providerTemplateId) {
202
- // Update existing
203
- await plugin.updateTemplate(providerTemplateId, template);
204
- result = {
205
- success: true,
206
- action: 'updated',
207
- providerTemplateId,
208
- localTemplateId: templateId
209
- };
210
- }
211
- else {
212
- // Create new
213
- const newProviderTemplateId = await plugin.createTemplate(template);
214
- result = {
215
- success: true,
216
- action: 'created',
217
- providerTemplateId: newProviderTemplateId,
218
- localTemplateId: templateId
219
- };
220
- // Update local template with provider ID
221
- await this.database.updateTemplate(templateId, {
222
- providerTemplateIds: {
223
- ...template.providerTemplateIds,
224
- [providerId]: newProviderTemplateId
225
- },
226
- lastSyncedAt: {
227
- ...template.lastSyncedAt,
228
- [providerId]: new Date()
229
- },
230
- syncStatus: {
231
- ...template.syncStatus,
232
- [providerId]: 'success'
233
- }
234
- });
235
- }
236
- this.log('info', 'Template synced to provider', {
237
- templateId,
238
- providerId,
239
- action: result.action
240
- });
241
- return result;
242
- }
243
- catch (error) {
244
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
245
- await this.updateSyncStatus(templateId, providerId, 'error');
246
- this.log('error', 'Failed to sync template to provider', {
247
- templateId,
248
- providerId,
249
- error: errorMessage
250
- });
251
- throw new errors_1.SyncError(`Failed to sync template ${templateId} to ${providerId}: ${errorMessage}`);
252
- }
253
- }
254
- /**
255
- * Sync template from a provider
256
- */
257
- async syncFromProvider(providerTemplateId, providerId) {
258
- this.log('info', 'Syncing template from provider', { providerTemplateId, providerId });
259
- const plugin = this.providers.get(providerId);
260
- if (!plugin) {
261
- throw new errors_1.ProviderNotFoundError(providerId);
262
- }
263
- // Get template from provider
264
- const providerTemplate = await plugin.getTemplate(providerTemplateId);
265
- // Check if we have this template locally
266
- const localTemplate = await this.database.findTemplateByProviderId(providerId, providerTemplateId);
267
- if (localTemplate) {
268
- // Update existing
269
- const updates = {
270
- name: providerTemplate.name,
271
- subject: providerTemplate.subject || localTemplate.subject,
272
- htmlContent: providerTemplate.htmlContent || localTemplate.htmlContent,
273
- textContent: providerTemplate.textContent,
274
- lastModifiedBy: 'sync'
275
- };
276
- return this.updateTemplate(localTemplate.id, updates);
277
- }
278
- else {
279
- // Create new
280
- const definition = {
281
- name: providerTemplate.name,
282
- subject: providerTemplate.subject || 'No subject',
283
- htmlContent: providerTemplate.htmlContent || '',
284
- textContent: providerTemplate.textContent,
285
- tags: [],
286
- createdBy: 'sync'
287
- };
288
- const newTemplate = await this.createTemplate(definition);
289
- // Update with provider ID
290
- await this.database.updateTemplate(newTemplate.id, {
291
- providerTemplateIds: { [providerId]: providerTemplateId },
292
- lastSyncedAt: { [providerId]: new Date() },
293
- syncStatus: { [providerId]: 'success' }
294
- });
295
- this.log('info', 'Template created from provider', {
296
- templateId: newTemplate.id,
297
- providerId
298
- });
299
- // Fetch and return the updated template
300
- const updatedTemplate = await this.database.getTemplate(newTemplate.id);
301
- if (!updatedTemplate) {
302
- throw new Error(`Failed to retrieve updated template: ${newTemplate.id}`);
303
- }
304
- return updatedTemplate;
305
- }
306
- }
307
- /**
308
- * Sync all templates to a provider
309
- */
310
- async syncAllTemplates(providerId) {
311
- this.log('info', 'Syncing all templates to provider', { providerId });
312
- const allTemplates = await this.database.listTemplates({ limit: 1000 });
313
- const results = [];
314
- const errors = [];
315
- for (const template of allTemplates.items) {
316
- try {
317
- const result = await this.syncToProvider(template.id, providerId);
318
- results.push(result);
319
- }
320
- catch (error) {
321
- errors.push({
322
- templateId: template.id,
323
- error: error instanceof Error ? error.message : 'Unknown error'
324
- });
325
- }
326
- }
327
- const batchResult = {
328
- total: allTemplates.items.length,
329
- successful: results.filter(r => r.success).length,
330
- failed: errors.length,
331
- results,
332
- errors
333
- };
334
- this.log('info', 'Batch sync completed', {
335
- providerId,
336
- total: batchResult.total,
337
- successful: batchResult.successful,
338
- failed: batchResult.failed
339
- });
340
- return batchResult;
341
- }
342
- // ========================================
343
- // Base Template Management
344
- // ========================================
345
- /**
346
- * Create a base template
347
- */
348
- async createBaseTemplate(definition) {
349
- this.log('info', 'Creating base template', { name: definition.name });
350
- const baseTemplate = {
351
- id: this.generateId(),
352
- name: definition.name,
353
- description: definition.description,
354
- headerHtml: definition.headerHtml,
355
- footerHtml: definition.footerHtml,
356
- headerCss: definition.headerCss,
357
- footerCss: definition.footerCss,
358
- theme: definition.theme || 'default',
359
- brandingElements: definition.brandingElements || [],
360
- defaultSenderId: definition.defaultSenderId,
361
- createdAt: new Date(),
362
- updatedAt: new Date(),
363
- version: '1.0.0'
364
- };
365
- // Validate base template
366
- const validation = await this.validateBaseTemplate(baseTemplate);
367
- if (!validation.isValid) {
368
- throw new errors_1.BaseTemplateValidationError(validation.errors);
369
- }
370
- const saved = await this.database.createBaseTemplate(baseTemplate);
371
- this.log('info', 'Base template created', { id: saved.id });
372
- return saved;
373
- }
374
- /**
375
- * Build complete template from base template and content
376
- */
377
- async buildTemplate(baseTemplateId, content, variables) {
378
- this.log('info', 'Building template from base', { baseTemplateId });
379
- const baseTemplate = await this.database.getBaseTemplate(baseTemplateId);
380
- if (!baseTemplate) {
381
- throw new errors_1.BaseTemplateNotFoundError(baseTemplateId);
382
- }
383
- const builtHtml = await this.templateEngine.buildCompleteTemplate({
384
- headerHtml: baseTemplate.headerHtml,
385
- footerHtml: baseTemplate.footerHtml,
386
- headerCss: baseTemplate.headerCss,
387
- footerCss: baseTemplate.footerCss
388
- }, content, variables);
389
- const builtText = await this.templateEngine.generateTextVersion(builtHtml);
390
- const templateVariables = await this.templateEngine.extractVariables(builtHtml);
391
- return {
392
- html: builtHtml,
393
- text: builtText,
394
- variables: templateVariables,
395
- baseTemplateId,
396
- contentHtml: content,
397
- metadata: {
398
- buildTime: Date.now(),
399
- variableCount: templateVariables.length,
400
- contentLength: content.length
401
- }
402
- };
403
- }
404
- // ========================================
405
- // Variable Context Integration
406
- // ========================================
407
- /**
408
- * Register a variable context
409
- */
410
- async registerContext(name, context) {
411
- this.log('info', 'Registering variable context', { name });
412
- await this.variableRegistry.registerContext(name, context);
413
- await this.database.createOrUpdateVariableContext({
414
- name,
415
- description: context.description,
416
- variables: context.variables,
417
- extends: context.extends,
418
- createdAt: new Date(),
419
- updatedAt: new Date()
420
- });
421
- // Revalidate templates using this context
422
- const templates = await this.database.getTemplatesByContext(name);
423
- for (const template of templates) {
424
- await this.revalidateTemplate(template.id);
425
- }
426
- this.log('info', 'Variable context registered', { name, templateCount: templates.length });
427
- }
428
- /**
429
- * Validate a template against its variable context
430
- */
431
- async validateTemplate(templateId, contextOverride) {
432
- const template = await this.database.getTemplate(templateId);
433
- if (!template) {
434
- throw new errors_1.TemplateNotFoundError(templateId);
435
- }
436
- const context = contextOverride || template.context;
437
- if (!context) {
438
- return { isValid: true, errors: [], warnings: [] };
439
- }
440
- const htmlValidation = await this.variableRegistry.validateTemplate(context, template.htmlContent);
441
- let textValidation = { isValid: true, errors: [], warnings: [] };
442
- if (template.textContent) {
443
- textValidation = await this.variableRegistry.validateTemplate(context, template.textContent);
444
- }
445
- const subjectValidation = await this.variableRegistry.validateTemplate(context, template.subject);
446
- return {
447
- isValid: htmlValidation.isValid && textValidation.isValid && subjectValidation.isValid,
448
- errors: [...htmlValidation.errors, ...textValidation.errors, ...subjectValidation.errors],
449
- warnings: [...htmlValidation.warnings, ...textValidation.warnings, ...subjectValidation.warnings],
450
- unusedVariables: this.deduplicateArray([
451
- ...(htmlValidation.unusedVariables || []),
452
- ...(textValidation.unusedVariables || []),
453
- ...(subjectValidation.unusedVariables || [])
454
- ]),
455
- undefinedVariables: [
456
- ...(htmlValidation.undefinedVariables || []),
457
- ...(textValidation.undefinedVariables || []),
458
- ...(subjectValidation.undefinedVariables || [])
459
- ]
460
- };
461
- }
462
- /**
463
- * Get variable suggestions for a context
464
- */
465
- async getVariableSuggestions(context, prefix) {
466
- return this.variableRegistry.getSuggestions(context, prefix);
467
- }
468
- // ========================================
469
- // Private Helper Methods
470
- // ========================================
471
- async validateTemplateStructure(template) {
472
- const errors = [];
473
- if (!template.name || template.name.trim() === '') {
474
- errors.push('Template name is required');
475
- }
476
- if (!template.subject || template.subject.trim() === '') {
477
- errors.push('Template subject is required');
478
- }
479
- if (!template.htmlContent || template.htmlContent.trim() === '') {
480
- errors.push('Template HTML content is required');
481
- }
482
- // Validate HTML content
483
- const htmlValidation = await this.templateEngine.validateTemplate(template.htmlContent);
484
- errors.push(...htmlValidation.errors);
485
- return {
486
- isValid: errors.length === 0,
487
- errors,
488
- warnings: []
489
- };
490
- }
491
- async validateBaseTemplate(baseTemplate) {
492
- const errors = [];
493
- if (!baseTemplate.name || baseTemplate.name.trim() === '') {
494
- errors.push('Base template name is required');
495
- }
496
- if (!baseTemplate.headerHtml || baseTemplate.headerHtml.trim() === '') {
497
- errors.push('Base template header HTML is required');
498
- }
499
- if (!baseTemplate.footerHtml || baseTemplate.footerHtml.trim() === '') {
500
- errors.push('Base template footer HTML is required');
501
- }
502
- return {
503
- isValid: errors.length === 0,
504
- errors,
505
- warnings: []
506
- };
507
- }
508
- async syncToAllProviders(templateId) {
509
- const enabledProviders = Object.entries(this.syncConfig.providers)
510
- .filter(([_, config]) => config.enabled)
511
- .map(([providerId]) => providerId);
512
- for (const providerId of enabledProviders) {
513
- try {
514
- await this.syncToProvider(templateId, providerId);
515
- }
516
- catch (error) {
517
- this.log('error', 'Failed to sync to provider', {
518
- templateId,
519
- providerId,
520
- error: error instanceof Error ? error.message : 'Unknown error'
521
- });
522
- }
523
- }
524
- }
525
- async detectSyncConflicts(_templateId) {
526
- // Simplified implementation - would check if provider versions differ from local
527
- return [];
528
- }
529
- async updateSyncStatus(_templateId, _providerId, _status) {
530
- const template = await this.database.getTemplate(_templateId);
531
- if (!template)
532
- return;
533
- await this.database.updateTemplate(_templateId, {
534
- syncStatus: {
535
- ...template.syncStatus,
536
- [_providerId]: _status
537
- },
538
- lastSyncedAt: {
539
- ...template.lastSyncedAt,
540
- [_providerId]: new Date()
541
- }
542
- });
543
- }
544
- async revalidateTemplate(_templateId) {
545
- try {
546
- await this.validateTemplate(_templateId);
547
- }
548
- catch (error) {
549
- this.log('warn', 'Template revalidation failed', {
550
- templateId: _templateId,
551
- error: error instanceof Error ? error.message : 'Unknown error'
552
- });
553
- }
554
- }
555
- generateId() {
556
- return `tpl_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
557
- }
558
- deduplicateArray(arr) {
559
- return Array.from(new Set(arr));
560
- }
561
- log(level, message, meta) {
562
- if (this.logger) {
563
- this.logger[level](message, meta);
564
- }
565
- }
566
- /**
567
- * Get plugin by provider ID
568
- */
569
- getPlugin(providerId) {
570
- return this.providers.get(providerId);
571
- }
572
- /**
573
- * Find template by provider ID and template ID
574
- */
575
- async findTemplateByProviderId(providerId, providerTemplateId) {
576
- return this.database.findTemplateByProviderId(providerId, providerTemplateId);
577
- }
578
- }
579
- exports.EmailTemplateService = EmailTemplateService;
580
- //# sourceMappingURL=email-template-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"email-template-service.js","sourceRoot":"","sources":["../src/email-template-service.ts"],"names":[],"mappings":";AAAA;;;;;;EAME;;;AAyBF,qCAQkB;AAqDlB;;;;;GAKG;AACH,MAAa,oBAAoB;IACd,QAAQ,CAAkB;IAC1B,cAAc,CAAiB;IAC/B,gBAAgB,CAAmB;IACnC,SAAS,CAAsC;IAC/C,UAAU,CAAoB;IAC9B,MAAM,CAAU;IAEjC,YAAY,MAAkC;QAC5C,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAChD,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAE5B,0BAA0B;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACpD,CA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