@servicelabsco/nestjs-utility-services 1.2.91 → 1.2.92

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 (55) hide show
  1. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.d.ts +5 -0
  2. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.js +17 -0
  3. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.js.map +1 -0
  4. package/dist/platformUtility/dtos/mail.options.dto.d.ts +1 -0
  5. package/dist/platformUtility/dtos/mail.options.dto.js +5 -0
  6. package/dist/platformUtility/dtos/mail.options.dto.js.map +1 -1
  7. package/dist/platformUtility/es6.classes.d.ts +7 -3
  8. package/dist/platformUtility/es6.classes.js +9 -1
  9. package/dist/platformUtility/es6.classes.js.map +1 -1
  10. package/dist/platformUtility/jobs/index.d.ts +2 -0
  11. package/dist/platformUtility/jobs/index.js +2 -0
  12. package/dist/platformUtility/jobs/index.js.map +1 -1
  13. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.d.ts +9 -0
  14. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js +41 -0
  15. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js.map +1 -0
  16. package/dist/platformUtility/jobs/process.tracking.webhook.job.d.ts +8 -0
  17. package/dist/platformUtility/jobs/process.tracking.webhook.job.js +51 -0
  18. package/dist/platformUtility/jobs/process.tracking.webhook.job.js.map +1 -0
  19. package/dist/platformUtility/libraries/index.d.ts +2 -0
  20. package/dist/platformUtility/libraries/index.js +2 -0
  21. package/dist/platformUtility/libraries/index.js.map +1 -1
  22. package/dist/platformUtility/libraries/process.common.mail.d.ts +1 -0
  23. package/dist/platformUtility/libraries/process.common.mail.js +9 -0
  24. package/dist/platformUtility/libraries/process.common.mail.js.map +1 -1
  25. package/dist/platformUtility/libraries/process.common.ses.mail.d.ts +15 -0
  26. package/dist/platformUtility/libraries/process.common.ses.mail.js +40 -0
  27. package/dist/platformUtility/libraries/process.common.ses.mail.js.map +1 -0
  28. package/dist/platformUtility/libraries/process.common.smtp.mail.d.ts +6 -3
  29. package/dist/platformUtility/libraries/process.common.smtp.mail.js +0 -38
  30. package/dist/platformUtility/libraries/process.common.smtp.mail.js.map +1 -1
  31. package/dist/platformUtility/libraries/process.ses.mail.d.ts +13 -4
  32. package/dist/platformUtility/libraries/process.ses.mail.js +74 -6
  33. package/dist/platformUtility/libraries/process.ses.mail.js.map +1 -1
  34. package/dist/platformUtility/libraries/process.ses.raw.mail.d.ts +30 -0
  35. package/dist/platformUtility/libraries/process.ses.raw.mail.js +124 -0
  36. package/dist/platformUtility/libraries/process.ses.raw.mail.js.map +1 -0
  37. package/dist/platformUtility/libraries/process.smtp.mail.d.ts +9 -2
  38. package/dist/platformUtility/libraries/process.smtp.mail.js +68 -5
  39. package/dist/platformUtility/libraries/process.smtp.mail.js.map +1 -1
  40. package/dist/platformUtility/services/es6.jobs.service.d.ts +5 -1
  41. package/dist/platformUtility/services/es6.jobs.service.js +9 -1
  42. package/dist/platformUtility/services/es6.jobs.service.js.map +1 -1
  43. package/dist/platformUtility/services/index.d.ts +1 -0
  44. package/dist/platformUtility/services/index.js +1 -0
  45. package/dist/platformUtility/services/index.js.map +1 -1
  46. package/dist/platformUtility/services/mail.service.d.ts +4 -1
  47. package/dist/platformUtility/services/mail.service.js +24 -10
  48. package/dist/platformUtility/services/mail.service.js.map +1 -1
  49. package/dist/platformUtility/services/ses.mail.notification.service.d.ts +10 -0
  50. package/dist/platformUtility/services/ses.mail.notification.service.js +51 -0
  51. package/dist/platformUtility/services/ses.mail.notification.service.js.map +1 -0
  52. package/dist/system/entities/mail.log.entity.d.ts +3 -0
  53. package/dist/system/entities/mail.log.entity.js +12 -0
  54. package/dist/system/entities/mail.log.entity.js.map +1 -1
  55. package/package.json +4 -2
@@ -0,0 +1,5 @@
1
+ import { MigrationUtility } from './../common/libraries/migration.utility';
2
+ export declare class AddTrackingIdentifierSysMailLogsTable1710834052315 extends MigrationUtility {
3
+ constructor();
4
+ process(): void;
5
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddTrackingIdentifierSysMailLogsTable1710834052315 = void 0;
4
+ const migration_utility_1 = require("./../common/libraries/migration.utility");
5
+ class AddTrackingIdentifierSysMailLogsTable1710834052315 extends migration_utility_1.MigrationUtility {
6
+ constructor() {
7
+ super('sys_mail_logs');
8
+ this.process();
9
+ }
10
+ process() {
11
+ this.string('tracking_identifier');
12
+ this.dateTime('last_opened_at');
13
+ this.json('tracking_attributes');
14
+ }
15
+ }
16
+ exports.AddTrackingIdentifierSysMailLogsTable1710834052315 = AddTrackingIdentifierSysMailLogsTable1710834052315;
17
+ //# sourceMappingURL=1710834052315-AddTrackingIdentifierSysMailLogsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1710834052315-AddTrackingIdentifierSysMailLogsTable.js","sourceRoot":"","sources":["../../src/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.ts"],"names":[],"mappings":";;;AAAA,+EAA2E;AAE3E,MAAa,kDAAmD,SAAQ,oCAAgB;IACpF;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAEnC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;QAEhC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACrC,CAAC;CACJ;AAbD,gHAaC"}
@@ -12,4 +12,5 @@ export declare class MailOptionsDto {
12
12
  }[];
13
13
  bcc?: string | string[];
14
14
  cc?: string | string[];
15
+ gateway?: string;
15
16
  }
@@ -61,4 +61,9 @@ __decorate([
61
61
  (0, class_transformer_1.Expose)(),
62
62
  __metadata("design:type", Object)
63
63
  ], MailOptionsDto.prototype, "cc", void 0);
64
+ __decorate([
65
+ (0, class_validator_1.IsOptional)(),
66
+ (0, class_transformer_1.Expose)(),
67
+ __metadata("design:type", String)
68
+ ], MailOptionsDto.prototype, "gateway", void 0);
64
69
  //# sourceMappingURL=mail.options.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mail.options.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/mail.options.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAsD;AACtD,MAAa,cAAc;CAqC1B;AArCD,wCAqCC;AAlCG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACmB;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;IACR,IAAA,yBAAO,GAAE;;6CAC+C;AAIzD;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;2CACe;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACc"}
1
+ {"version":3,"file":"mail.options.dto.js","sourceRoot":"","sources":["../../../src/platformUtility/dtos/mail.options.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAAsD;AACtD,MAAa,cAAc;CAyC1B;AAzCD,wCAyCC;AAtCG;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACmB;AAI5B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;4CACK;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;IACR,IAAA,yBAAO,GAAE;;6CAC+C;AAIzD;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;2CACe;AAIxB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;0CACc;AAIvB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;+CACQ"}
@@ -23,6 +23,8 @@ import { StringSearchDto } from './dtos/string.search.dto';
23
23
  import { FailedBullJobEntity } from './entities/failed.bull.job.entity';
24
24
  import { PendingBullJobEntity } from './entities/pending.bull.job.entity';
25
25
  import { LoadFailedBullJob } from './jobs/load.failed.bull.job';
26
+ import { ProcessSesDeliveryWebhookJob } from './jobs/process.ses.delivery.webhook.job';
27
+ import { ProcessTrackingWebhookJob } from './jobs/process.tracking.webhook.job';
26
28
  import { RecordWatcherJob } from './jobs/record.watcher.job';
27
29
  import { ReloadPendingBullJob } from './jobs/reload.pending.bull.job';
28
30
  import { TestJob } from './jobs/test.job';
@@ -38,6 +40,7 @@ import { ProcessCommonMail } from './libraries/process.common.mail';
38
40
  import { ProcessKaleyraCallbackResponse } from './libraries/process.kaleyra.callback.response';
39
41
  import { ProcessKaleyraSms } from './libraries/process.kaleyra.sms';
40
42
  import { ProcessSesMail } from './libraries/process.ses.mail';
43
+ import { ProcessSesRawMail } from './libraries/process.ses.raw.mail';
41
44
  import { ProcessSmtpMail } from './libraries/process.smtp.mail';
42
45
  import { SetSmsMessage } from './libraries/set.sms.message';
43
46
  import { MaintenanceMiddleware } from './middlewares/maintenance.middleware';
@@ -54,6 +57,7 @@ import { MailService } from './services/mail.service';
54
57
  import { MaintenanceService } from './services/maintenance.service';
55
58
  import { QueueService } from './services/queue.service';
56
59
  import { RemoteRequestService } from './services/remote.request.service';
60
+ import { SesMailNotificationService } from './services/ses.mail.notification.service';
57
61
  import { ShutdownService } from './services/shutdown.service';
58
62
  import { SmsService } from './services/sms.service';
59
63
  import { SqlService } from './services/sql.service';
@@ -66,10 +70,10 @@ declare const es6Classes: {
66
70
  controllers: (typeof BullJobController | typeof QueueController)[];
67
71
  dtos: (typeof JobPayloadDto | typeof QueueOptionsDto | typeof SourceColumnDto | typeof CommonAttributesDto | typeof AwsConfigDto | typeof MailOptionsDto | typeof SmtpConfigDto | typeof RemoteRawResponseDto | typeof FcmResponseDto | typeof KaleyraCallbackPayloadDto | typeof PushNotificationResponseDto | typeof PushNotificationTemplateDto | typeof SetSmsPayloadDto | typeof SmsPayloadDto | typeof StringSearchDto)[];
68
72
  entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
69
- jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob)[];
70
- libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof ProcessSmtpMail | typeof CommonSqsPolling | typeof ProcessAuditLogData | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof SetSmsMessage)[];
73
+ jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof ProcessSesDeliveryWebhookJob | typeof ProcessTrackingWebhookJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob)[];
74
+ libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof ProcessSmtpMail | typeof ProcessSesRawMail | typeof CommonSqsPolling | typeof ProcessAuditLogData | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof SetSmsMessage)[];
71
75
  middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
72
- services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof MailService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof AuditService | typeof RemoteRequestService | typeof AwsSecretService | typeof Es6JobsService | typeof FcmNotificationService | typeof ShutdownService | typeof SmsService | typeof StartupService)[];
76
+ services: (typeof CacheService | typeof LocalPropertyService | typeof AwsConfigService | typeof SqsService | typeof QueueService | typeof MailService | typeof SqlService | typeof DynamoService | typeof MaintenanceService | typeof AuditService | typeof RemoteRequestService | typeof SesMailNotificationService | typeof AwsSecretService | typeof Es6JobsService | typeof FcmNotificationService | typeof ShutdownService | typeof SmsService | typeof StartupService)[];
73
77
  subscribers: (typeof BaseSubscriber)[];
74
78
  };
75
79
  export default es6Classes;
@@ -27,6 +27,8 @@ const string_search_dto_1 = require("./dtos/string.search.dto");
27
27
  const failed_bull_job_entity_1 = require("./entities/failed.bull.job.entity");
28
28
  const pending_bull_job_entity_1 = require("./entities/pending.bull.job.entity");
29
29
  const load_failed_bull_job_1 = require("./jobs/load.failed.bull.job");
30
+ const process_ses_delivery_webhook_job_1 = require("./jobs/process.ses.delivery.webhook.job");
31
+ const process_tracking_webhook_job_1 = require("./jobs/process.tracking.webhook.job");
30
32
  const record_watcher_job_1 = require("./jobs/record.watcher.job");
31
33
  const reload_pending_bull_job_1 = require("./jobs/reload.pending.bull.job");
32
34
  const test_job_1 = require("./jobs/test.job");
@@ -39,10 +41,12 @@ const create_index_file_1 = require("./libraries/create.index.file");
39
41
  const file_system_utility_1 = require("./libraries/file.system.utility");
40
42
  const process_audit_log_data_1 = require("./libraries/process.audit.log.data");
41
43
  const process_common_mail_1 = require("./libraries/process.common.mail");
44
+ const process_common_ses_mail_1 = require("./libraries/process.common.ses.mail");
42
45
  const process_common_smtp_mail_1 = require("./libraries/process.common.smtp.mail");
43
46
  const process_kaleyra_callback_response_1 = require("./libraries/process.kaleyra.callback.response");
44
47
  const process_kaleyra_sms_1 = require("./libraries/process.kaleyra.sms");
45
48
  const process_ses_mail_1 = require("./libraries/process.ses.mail");
49
+ const process_ses_raw_mail_1 = require("./libraries/process.ses.raw.mail");
46
50
  const process_smtp_mail_1 = require("./libraries/process.smtp.mail");
47
51
  const set_sms_message_1 = require("./libraries/set.sms.message");
48
52
  const maintenance_middleware_1 = require("./middlewares/maintenance.middleware");
@@ -59,6 +63,7 @@ const mail_service_1 = require("./services/mail.service");
59
63
  const maintenance_service_1 = require("./services/maintenance.service");
60
64
  const queue_service_1 = require("./services/queue.service");
61
65
  const remote_request_service_1 = require("./services/remote.request.service");
66
+ const ses_mail_notification_service_1 = require("./services/ses.mail.notification.service");
62
67
  const shutdown_service_1 = require("./services/shutdown.service");
63
68
  const sms_service_1 = require("./services/sms.service");
64
69
  const sql_service_1 = require("./services/sql.service");
@@ -89,7 +94,7 @@ const es6Classes = {
89
94
  string_search_dto_1.StringSearchDto,
90
95
  ],
91
96
  entities: [failed_bull_job_entity_1.FailedBullJobEntity, pending_bull_job_entity_1.PendingBullJobEntity],
92
- jobs: [load_failed_bull_job_1.LoadFailedBullJob, record_watcher_job_1.RecordWatcherJob, reload_pending_bull_job_1.ReloadPendingBullJob, test_job_1.TestJob],
97
+ jobs: [load_failed_bull_job_1.LoadFailedBullJob, process_ses_delivery_webhook_job_1.ProcessSesDeliveryWebhookJob, process_tracking_webhook_job_1.ProcessTrackingWebhookJob, record_watcher_job_1.RecordWatcherJob, reload_pending_bull_job_1.ReloadPendingBullJob, test_job_1.TestJob],
93
98
  libraries: [
94
99
  common_sqs_polling_1.CommonSqsPolling,
95
100
  create_entity_constants_file_1.CreateEntityConstantsFile,
@@ -100,10 +105,12 @@ const es6Classes = {
100
105
  file_system_utility_1.FileSystemUtility,
101
106
  process_audit_log_data_1.ProcessAuditLogData,
102
107
  process_common_mail_1.ProcessCommonMail,
108
+ process_common_ses_mail_1.ProcessCommonSesMail,
103
109
  process_common_smtp_mail_1.ProcessCommonSmtpMail,
104
110
  process_kaleyra_callback_response_1.ProcessKaleyraCallbackResponse,
105
111
  process_kaleyra_sms_1.ProcessKaleyraSms,
106
112
  process_ses_mail_1.ProcessSesMail,
113
+ process_ses_raw_mail_1.ProcessSesRawMail,
107
114
  process_smtp_mail_1.ProcessSmtpMail,
108
115
  set_sms_message_1.SetSmsMessage,
109
116
  ],
@@ -121,6 +128,7 @@ const es6Classes = {
121
128
  maintenance_service_1.MaintenanceService,
122
129
  queue_service_1.QueueService,
123
130
  remote_request_service_1.RemoteRequestService,
131
+ ses_mail_notification_service_1.SesMailNotificationService,
124
132
  shutdown_service_1.ShutdownService,
125
133
  sms_service_1.SmsService,
126
134
  sql_service_1.SqlService,
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,0DAAqD;AACrD,wEAAmE;AACnE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,sFAAgF;AAChF,8DAAyD;AACzD,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,oEAA8D;AAC9D,4DAAuD;AACvD,4DAAuD;AACvD,gEAA2D;AAC3D,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF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B,kEAA8B;QAC9B,uCAAiB;QACjB,iCAAc;QACd,mCAAe;QACf,+BAAa;KAChB;IACD,WAAW,EAAE,CAAC,8CAAqB,EAAE,oBAAQ,CAAC;IAC9C,QAAQ,EAAE;QACN,4BAAY;QACZ,qCAAgB;QAChB,qCAAgB;QAChB,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,kCAAe;QACf,wBAAU;QACV,wBAAU;QACV,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/platformUtility/es6.classes.ts"],"names":[],"mappings":";;AAAA,wEAAoE;AACpE,sEAAiE;AACjE,sEAAiE;AACjE,+DAA2D;AAC3D,2DAAuD;AACvD,2EAAsE;AACtE,qEAAiE;AACjE,0DAAqD;AACrD,wEAAmE;AACnE,0FAAmF;AACnF,8DAAyD;AACzD,4DAAuD;AACvD,sFAAgF;AAChF,8DAAyD;AACzD,4FAAqF;AACrF,0FAAoF;AACpF,0FAAoF;AACpF,gEAA2D;AAC3D,4EAAsE;AACtE,oEAA8D;AAC9D,4DAAuD;AACvD,4DAAuD;AACvD,gEAA2D;AAC3D,gEAA2D;AAC3D,8EAAwE;AACxE,gFAA0E;AAC1E,sEAAgE;AAChE,8FAAuF;AACvF,sFAAgF;AAChF,kEAA6D;AAC7D,4EAAsE;AACtE,8CAA0C;AAC1C,uEAAkE;AAClE,2FAAqF;AACrF,iFAA2E;AAC3E,2EAAqE;AACrE,iFAA2E;AAC3E,qEAAgE;AAChE,yEAAoE;AACpE,+EAAyE;AACzE,yEAAoE;AACpE,iFAA2E;AAC3E,mFAA6E;AAC7E,qGAA+F;AAC/F,yEAAoE;AACpE,mEAA8D;AAC9D,2EAAqE;AACrE,qEA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B,EAAE,oBAAQ,CAAC;IAC9C,QAAQ,EAAE;QACN,4BAAY;QACZ,qCAAgB;QAChB,qCAAgB;QAChB,4BAAY;QACZ,8BAAa;QACb,iCAAc;QACd,iDAAsB;QACtB,6CAAoB;QACpB,0BAAW;QACX,wCAAkB;QAClB,4BAAY;QACZ,6CAAoB;QACpB,0DAA0B;QAC1B,kCAAe;QACf,wBAAU;QACV,wBAAU;QACV,wBAAU;QACV,gCAAc;KACjB;IACD,WAAW,EAAE,CAAC,gCAAc,CAAC;CAChC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export * from './load.failed.bull.job';
2
+ export * from './process.ses.delivery.webhook.job';
3
+ export * from './process.tracking.webhook.job';
2
4
  export * from './record.watcher.job';
3
5
  export * from './reload.pending.bull.job';
4
6
  export * from './test.job';
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./load.failed.bull.job"), exports);
18
+ __exportStar(require("./process.ses.delivery.webhook.job"), exports);
19
+ __exportStar(require("./process.tracking.webhook.job"), exports);
18
20
  __exportStar(require("./record.watcher.job"), exports);
19
21
  __exportStar(require("./reload.pending.bull.job"), exports);
20
22
  __exportStar(require("./test.job"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AAAA,uDAAqC;AAAA,4DAA0C;AAAA,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AAAA,qEAAmD;AAAA,iEAA+C;AAAA,uDAAqC;AAAA,4DAA0C;AAAA,6CAA0B"}
@@ -0,0 +1,9 @@
1
+ import { CommonJob } from '../../common/libraries/common.job';
2
+ import { QueueService } from '../services/queue.service';
3
+ import { SesMailNotificationService } from '../services/ses.mail.notification.service';
4
+ export declare class ProcessSesDeliveryWebhookJob extends CommonJob {
5
+ protected readonly queueService: QueueService;
6
+ protected readonly sesMailNotificationService: SesMailNotificationService;
7
+ constructor(queueService: QueueService, sesMailNotificationService: SesMailNotificationService);
8
+ handle(payload: any): Promise<void>;
9
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProcessSesDeliveryWebhookJob = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const common_job_1 = require("../../common/libraries/common.job");
15
+ const queue_service_1 = require("../services/queue.service");
16
+ const ses_mail_notification_service_1 = require("../services/ses.mail.notification.service");
17
+ let ProcessSesDeliveryWebhookJob = class ProcessSesDeliveryWebhookJob extends common_job_1.CommonJob {
18
+ constructor(queueService, sesMailNotificationService) {
19
+ super('591ea88d3cccb55e60d5cf1178ccb42a');
20
+ this.queueService = queueService;
21
+ this.sesMailNotificationService = sesMailNotificationService;
22
+ }
23
+ async handle(payload) {
24
+ const { notificationPayload, mailLogEntity } = await this.sesMailNotificationService.getNotificationPayload(payload);
25
+ const eventType = notificationPayload.eventType;
26
+ if (!eventType)
27
+ return;
28
+ if (eventType === 'Delivery')
29
+ await this.sesMailNotificationService.processSesDeliveryData(notificationPayload, mailLogEntity);
30
+ if (eventType === 'Bounce')
31
+ await this.sesMailNotificationService.processSesBounceData(notificationPayload, mailLogEntity);
32
+ return;
33
+ }
34
+ };
35
+ exports.ProcessSesDeliveryWebhookJob = ProcessSesDeliveryWebhookJob;
36
+ exports.ProcessSesDeliveryWebhookJob = ProcessSesDeliveryWebhookJob = __decorate([
37
+ (0, common_1.Injectable)(),
38
+ __metadata("design:paramtypes", [queue_service_1.QueueService,
39
+ ses_mail_notification_service_1.SesMailNotificationService])
40
+ ], ProcessSesDeliveryWebhookJob);
41
+ //# sourceMappingURL=process.ses.delivery.webhook.job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.ses.delivery.webhook.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/process.ses.delivery.webhook.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,6DAAyD;AAMzD,6FAAuF;AAGhF,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,sBAAS;IACvD,YACuB,YAA0B,EAC1B,0BAAsD;QAEzE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHvB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,+BAA0B,GAA1B,0BAA0B,CAA4B;IAG7E,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAY;QACrB,MAAM,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAErH,MAAM,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;QAEhD,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,IAAI,SAAS,KAAK,UAAU;YAAE,MAAM,IAAI,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QAE/H,IAAI,SAAS,KAAK,QAAQ;YAAE,MAAM,IAAI,CAAC,0BAA0B,CAAC,oBAAoB,CAAC,mBAAmB,EAAE,aAAa,CAAC,CAAC;QAE3H,OAAO;IACX,CAAC;CACJ,CAAA;AArBY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;qCAG4B,4BAAY;QACE,0DAA0B;GAHpE,4BAA4B,CAqBxC"}
@@ -0,0 +1,8 @@
1
+ import { CommonJob } from '../../common/libraries/common.job';
2
+ import { QueueService } from '../services/queue.service';
3
+ export declare class ProcessTrackingWebhookJob extends CommonJob {
4
+ protected readonly queueService: QueueService;
5
+ constructor(queueService: QueueService);
6
+ handle(query: any): Promise<void>;
7
+ private processTrackData;
8
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProcessTrackingWebhookJob = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const common_job_1 = require("../../common/libraries/common.job");
15
+ const queue_service_1 = require("../services/queue.service");
16
+ const mail_log_entity_1 = require("../../system/entities/mail.log.entity");
17
+ let ProcessTrackingWebhookJob = class ProcessTrackingWebhookJob extends common_job_1.CommonJob {
18
+ constructor(queueService) {
19
+ super('fd9a3406400161c9dae9f327f10eaa49');
20
+ this.queueService = queueService;
21
+ }
22
+ async handle(query) {
23
+ await this.processTrackData(query);
24
+ return;
25
+ }
26
+ async processTrackData(query) {
27
+ let mailLogEntity = await mail_log_entity_1.MailLogEntity.findOne({ where: { tracking_identifier: query.t } });
28
+ if (!mailLogEntity)
29
+ return;
30
+ const track_pairs = mailLogEntity.tracking_attributes?.track_pairs;
31
+ const last_opened_at = new Date();
32
+ if (track_pairs) {
33
+ const trackedEmail = track_pairs[query.px];
34
+ if (!trackedEmail)
35
+ return;
36
+ const individualOpens = trackedEmail?.opens || [];
37
+ individualOpens.push(last_opened_at.toISOString());
38
+ trackedEmail['opens'] = individualOpens;
39
+ track_pairs[query.px] = trackedEmail;
40
+ }
41
+ mailLogEntity.last_opened_at = last_opened_at;
42
+ mailLogEntity.tracking_attributes = { ...mailLogEntity.tracking_attributes, track_pairs };
43
+ await mailLogEntity.save();
44
+ }
45
+ };
46
+ exports.ProcessTrackingWebhookJob = ProcessTrackingWebhookJob;
47
+ exports.ProcessTrackingWebhookJob = ProcessTrackingWebhookJob = __decorate([
48
+ (0, common_1.Injectable)(),
49
+ __metadata("design:paramtypes", [queue_service_1.QueueService])
50
+ ], ProcessTrackingWebhookJob);
51
+ //# sourceMappingURL=process.tracking.webhook.job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.tracking.webhook.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/process.tracking.webhook.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,6DAAyD;AACzD,2EAAoE;AAG7D,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,sBAAS;IACpD,YAA+B,YAA0B;QACrD,KAAK,CAAC,kCAAkC,CAAC,CAAC;QADf,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAU;QACnB,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEnC,OAAO;IACX,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,KAAU;QACrC,IAAI,aAAa,GAAG,MAAM,+BAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7F,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,MAAM,WAAW,GAAG,aAAa,CAAC,mBAAmB,EAAE,WAAW,CAAC;QAEnE,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;QAElC,IAAI,WAAW,EAAE,CAAC;YACd,MAAM,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAE3C,IAAI,CAAC,YAAY;gBAAE,OAAO;YAE1B,MAAM,eAAe,GAAU,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC;YAEzD,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;YAEnD,YAAY,CAAC,OAAO,CAAC,GAAG,eAAe,CAAC;YAExC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC;QACzC,CAAC;QAED,aAAa,CAAC,cAAc,GAAG,cAAc,CAAC;QAC9C,aAAa,CAAC,mBAAmB,GAAG,EAAE,GAAG,aAAa,CAAC,mBAAmB,EAAE,WAAW,EAAE,CAAC;QAE1F,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACJ,CAAA;AAvCY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEoC,4BAAY;GADhD,yBAAyB,CAuCrC"}
@@ -7,9 +7,11 @@ export * from './create.index.file';
7
7
  export * from './file.system.utility';
8
8
  export * from './process.audit.log.data';
9
9
  export * from './process.common.mail';
10
+ export * from './process.common.ses.mail';
10
11
  export * from './process.common.smtp.mail';
11
12
  export * from './process.kaleyra.callback.response';
12
13
  export * from './process.kaleyra.sms';
13
14
  export * from './process.ses.mail';
15
+ export * from './process.ses.raw.mail';
14
16
  export * from './process.smtp.mail';
15
17
  export * from './set.sms.message';
@@ -23,10 +23,12 @@ __exportStar(require("./create.index.file"), exports);
23
23
  __exportStar(require("./file.system.utility"), exports);
24
24
  __exportStar(require("./process.audit.log.data"), exports);
25
25
  __exportStar(require("./process.common.mail"), exports);
26
+ __exportStar(require("./process.common.ses.mail"), exports);
26
27
  __exportStar(require("./process.common.smtp.mail"), exports);
27
28
  __exportStar(require("./process.kaleyra.callback.response"), exports);
28
29
  __exportStar(require("./process.kaleyra.sms"), exports);
29
30
  __exportStar(require("./process.ses.mail"), exports);
31
+ __exportStar(require("./process.ses.raw.mail"), exports);
30
32
  __exportStar(require("./process.smtp.mail"), exports);
31
33
  __exportStar(require("./set.sms.message"), exports);
32
34
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AAAA,iEAA+C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,wDAAsC;AAAA,2DAAyC;AAAA,wDAAsC;AAAA,6DAA2C;AAAA,sEAAoD;AAAA,wDAAsC;AAAA,qDAAmC;AAAA,sDAAoC;AAAA,oDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AAAA,iEAA+C;AAAA,4DAA0C;AAAA,yDAAuC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,wDAAsC;AAAA,2DAAyC;AAAA,wDAAsC;AAAA,4DAA0C;AAAA,6DAA2C;AAAA,sEAAoD;AAAA,wDAAsC;AAAA,qDAAmC;AAAA,yDAAuC;AAAA,sDAAoC;AAAA,oDAAiC"}
@@ -6,4 +6,5 @@ export declare class ProcessCommonMail {
6
6
  private getFileBuffer;
7
7
  private getLocalFileBuffer;
8
8
  private getNetworkFileBuffer;
9
+ protected stripUnwantedChars(str: string): string;
9
10
  }
@@ -37,6 +37,15 @@ class ProcessCommonMail {
37
37
  });
38
38
  return Buffer.from(response.data, 'binary').toString('base64');
39
39
  }
40
+ stripUnwantedChars(str) {
41
+ if (!str)
42
+ return str;
43
+ const chars = ['<', '>'];
44
+ chars.forEach((char) => {
45
+ str = str.replaceAll(char, '');
46
+ });
47
+ return str;
48
+ }
40
49
  }
41
50
  exports.ProcessCommonMail = ProcessCommonMail;
42
51
  //# sourceMappingURL=process.common.mail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"process.common.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.common.mail.ts"],"names":[],"mappings":";;;AAAA,iCAA0B;AAC1B,qDAAwC;AACxC,2BAAkC;AAClC,MAAa,iBAAiB;IAQhB,KAAK,CAAC,cAAc,CAAC,KAAwC;QACnE,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QAEtB,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAEzD,WAAW,CAAC,IAAI,CAAC;gBACb,OAAO;gBACP,QAAQ;gBACR,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,YAAY;aAC5B,CAAC,CAAC;QACP,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IASO,KAAK,CAAC,aAAa,CAAC,IAAY;QACpC,IAAI,IAAA,uBAAK,EAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAExD,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IASO,KAAK,CAAC,kBAAkB,CAAC,IAAY;QACzC,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IASO,KAAK,CAAC,oBAAoB,CAAC,GAAW;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC;YACzB,GAAG;YACH,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,aAAa;SAC9B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;CACJ;AApED,8CAoEC"}
1
+ {"version":3,"file":"process.common.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.common.mail.ts"],"names":[],"mappings":";;;AAAA,iCAA0B;AAC1B,qDAAwC;AACxC,2BAAkC;AAClC,MAAa,iBAAiB;IAQhB,KAAK,CAAC,cAAc,CAAC,KAAwC;QACnE,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC;QAEtB,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAEzD,WAAW,CAAC,IAAI,CAAC;gBACb,OAAO;gBACP,QAAQ;gBACR,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,YAAY;aAC5B,CAAC,CAAC;QACP,CAAC;QAED,OAAO,WAAW,CAAC;IACvB,CAAC;IASO,KAAK,CAAC,aAAa,CAAC,IAAY;QACpC,IAAI,IAAA,uBAAK,EAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAExD,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IASO,KAAK,CAAC,kBAAkB,CAAC,IAAY;QACzC,OAAO,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;IASO,KAAK,CAAC,oBAAoB,CAAC,GAAW;QAC1C,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC;YACzB,GAAG;YACH,MAAM,EAAE,KAAK;YACb,YAAY,EAAE,aAAa;SAC9B,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;IASS,kBAAkB,CAAC,GAAW;QACpC,IAAI,CAAC,GAAG;YAAE,OAAO,GAAG,CAAC;QACrB,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AAtFD,8CAsFC"}
@@ -0,0 +1,15 @@
1
+ import { PropertyService } from '../../system/services/property.service';
2
+ import { MailOptionsDto } from '../dtos/mail.options.dto';
3
+ import { ProcessCommonMail } from './process.common.mail';
4
+ import { AwsConfigService } from '../services/aws.config.service';
5
+ import { MailService } from '../services/mail.service';
6
+ export declare class ProcessCommonSesMail extends ProcessCommonMail {
7
+ private client;
8
+ protected readonly propertyService: PropertyService;
9
+ protected options: MailOptionsDto;
10
+ protected readonly awsConfigService: AwsConfigService;
11
+ protected readonly mailService: MailService;
12
+ protected initClient(): Promise<void>;
13
+ protected getClient(): Promise<any>;
14
+ setAttachments(): Promise<any[]>;
15
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessCommonSesMail = void 0;
4
+ const process_common_mail_1 = require("./process.common.mail");
5
+ const client_ses_1 = require("@aws-sdk/client-ses");
6
+ const operation_exception_1 = require("../../common/exceptions/operation.exception");
7
+ class ProcessCommonSesMail extends process_common_mail_1.ProcessCommonMail {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.client = null;
11
+ }
12
+ async initClient() {
13
+ const config = await this.awsConfigService.getConfig();
14
+ this.client = new client_ses_1.SESClient({
15
+ credentials: { accessKeyId: config.key, secretAccessKey: config.secret },
16
+ region: config.region,
17
+ });
18
+ }
19
+ async getClient() {
20
+ if (!this.client)
21
+ await this.initClient();
22
+ if (!this.client)
23
+ throw new operation_exception_1.OperationException(`SES service is not working`);
24
+ return this.client;
25
+ }
26
+ async setAttachments() {
27
+ const files = await this.getAttachments(this.options.files);
28
+ const attachments = [];
29
+ files.forEach((file) => {
30
+ attachments.push({
31
+ filename: file.name,
32
+ path: file.file,
33
+ contentType: file.type,
34
+ });
35
+ });
36
+ return attachments;
37
+ }
38
+ }
39
+ exports.ProcessCommonSesMail = ProcessCommonSesMail;
40
+ //# sourceMappingURL=process.common.ses.mail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.common.ses.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.common.ses.mail.ts"],"names":[],"mappings":";;;AAIA,+DAA0D;AAC1D,oDAAgD;AAChD,qFAA+E;AAU/E,MAAa,oBAAqB,SAAQ,uCAAiB;IAA3D;;QACY,WAAM,GAAG,IAAI,CAAC;IAoC1B,CAAC;IA9Ba,KAAK,CAAC,UAAU;QACtB,MAAM,MAAM,GAAiB,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC;QAErE,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAS,CAAC;YACxB,WAAW,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE;YACxE,MAAM,EAAE,MAAM,CAAC,MAAM;SACxB,CAAC,CAAC;IACP,CAAC;IAES,KAAK,CAAC,SAAS;QACrB,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,wCAAkB,CAAC,4BAA4B,CAAC,CAAC;QAE7E,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,cAAc;QACvB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,EAAE,CAAC;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACnB,WAAW,CAAC,IAAI,CAAC;gBACb,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,IAAI;aACzB,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,OAAO,WAAW,CAAC;IACvB,CAAC;CACJ;AArCD,oDAqCC"}
@@ -2,12 +2,15 @@ import { PropertyService } from '../../system/services/property.service';
2
2
  import { SmtpConfigDto } from '../dtos/smtp.config.dto';
3
3
  import { MailOptionsDto } from './../dtos/mail.options.dto';
4
4
  import { ProcessCommonMail } from './process.common.mail';
5
+ import { AwsConfigService } from '../services/aws.config.service';
6
+ import { MailService } from '../services/mail.service';
5
7
  export declare class ProcessCommonSmtpMail extends ProcessCommonMail {
6
8
  protected refreshTime: Date;
7
9
  protected config: SmtpConfigDto;
8
10
  protected readonly propertyService: PropertyService;
9
11
  protected options: MailOptionsDto;
10
- protected send(): Promise<unknown>;
11
- private setAttachments;
12
- private getConfig;
12
+ protected readonly awsConfigService: AwsConfigService;
13
+ protected readonly mailService: MailService;
14
+ protected setAttachments(): Promise<any[]>;
15
+ protected getConfig(): Promise<SmtpConfigDto>;
13
16
  }
@@ -2,50 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessCommonSmtpMail = void 0;
4
4
  const date_fns_1 = require("date-fns");
5
- const nodemailer = require("nodemailer");
6
5
  const process_common_mail_1 = require("./process.common.mail");
7
6
  class ProcessCommonSmtpMail extends process_common_mail_1.ProcessCommonMail {
8
7
  constructor() {
9
8
  super(...arguments);
10
9
  this.config = null;
11
10
  }
12
- async send() {
13
- const config = await this.getConfig();
14
- if (!config) {
15
- global.console.log('configuration for smtp is missing');
16
- return;
17
- }
18
- const transporter = nodemailer.createTransport({
19
- host: config.host,
20
- port: +config.port,
21
- auth: {
22
- user: config.username,
23
- pass: config.password,
24
- },
25
- });
26
- const attachments = await this.setAttachments();
27
- const to = Array.isArray(this.options.to) ? this.options.to.join(',') : this.options.to;
28
- const message = {
29
- from: this.options.from || this.config.from,
30
- to,
31
- subject: this.options.subject,
32
- html: this.options.html,
33
- attachments,
34
- cc: this.options?.cc || [],
35
- bcc: this.options?.bcc || [],
36
- replyTo: this.options?.replyTo || [],
37
- };
38
- return new Promise((resolve, reject) => {
39
- return transporter.sendMail(message, (err, info) => {
40
- if (err) {
41
- return reject(err);
42
- }
43
- else {
44
- return resolve(info);
45
- }
46
- });
47
- });
48
- }
49
11
  async setAttachments() {
50
12
  const files = await this.getAttachments(this.options.files);
51
13
  const attachments = [];
@@ -1 +1 @@
1
- {"version":3,"file":"process.common.smtp.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.common.smtp.mail.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AACtC,yCAAyC;AAIzC,+DAA0D;AAQ1D,MAAa,qBAAsB,SAAQ,u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AAK,CAAC,SAAS;QACrB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,GAAG,GAAG;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QAEnE,IAAI,CAAC,WAAW,GAAG,IAAA,qBAAU,EAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAEvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAErE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;QAE7E,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;QAExE,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC;YAAE,OAAO;QAE5D,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;CACJ;AApED,sDAoEC"}
@@ -1,14 +1,23 @@
1
1
  import { PropertyService } from '../../system/services/property.service';
2
2
  import { MailOptionsDto } from './../dtos/mail.options.dto';
3
- import { ProcessCommonSmtpMail } from './process.common.smtp.mail';
4
- export declare class ProcessSesMail extends ProcessCommonSmtpMail {
3
+ import { AwsConfigService } from '../services/aws.config.service';
4
+ import { MailService } from '../services/mail.service';
5
+ import { ProcessCommonSesMail } from './process.common.ses.mail';
6
+ export declare class ProcessSesMail extends ProcessCommonSesMail {
5
7
  protected readonly propertyService: PropertyService;
6
8
  protected options: MailOptionsDto;
7
- constructor(propertyService: PropertyService, options: MailOptionsDto);
9
+ protected readonly awsConfigService: AwsConfigService;
10
+ protected readonly mailService: MailService;
11
+ constructor(propertyService: PropertyService, options: MailOptionsDto, awsConfigService: AwsConfigService, mailService: MailService);
8
12
  process(): Promise<{
9
- identifier: any;
13
+ identifier: string;
14
+ trackingId: any;
10
15
  attributes: {
11
16
  ses: any;
12
17
  };
18
+ tracking_attributes: {
19
+ track_pairs: any;
20
+ };
13
21
  }>;
22
+ sendSesEmail(): Promise<any>;
14
23
  }