@servicelabsco/nestjs-utility-services 1.2.92 → 1.2.94
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/dist/app.controller.js +3 -1
- package/dist/app.controller.js.map +1 -1
- package/dist/migrations/1717761722433-AddTrackColumnsSysMailRecipientsTable.d.ts +5 -0
- package/dist/migrations/1717761722433-AddTrackColumnsSysMailRecipientsTable.js +17 -0
- package/dist/migrations/1717761722433-AddTrackColumnsSysMailRecipientsTable.js.map +1 -0
- package/dist/platformUtility/dtos/mail.options.dto.d.ts +1 -0
- package/dist/platformUtility/dtos/mail.options.dto.js +5 -0
- package/dist/platformUtility/dtos/mail.options.dto.js.map +1 -1
- package/dist/platformUtility/es6.classes.d.ts +1 -1
- package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js +4 -1
- package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js.map +1 -1
- package/dist/platformUtility/jobs/process.tracking.webhook.job.js +8 -18
- package/dist/platformUtility/jobs/process.tracking.webhook.job.js.map +1 -1
- package/dist/platformUtility/libraries/process.ses.mail.d.ts +3 -3
- package/dist/platformUtility/libraries/process.ses.mail.js +22 -17
- package/dist/platformUtility/libraries/process.ses.mail.js.map +1 -1
- package/dist/platformUtility/libraries/process.ses.raw.mail.d.ts +8 -5
- package/dist/platformUtility/libraries/process.ses.raw.mail.js +64 -59
- package/dist/platformUtility/libraries/process.ses.raw.mail.js.map +1 -1
- package/dist/platformUtility/libraries/process.smtp.mail.d.ts +7 -4
- package/dist/platformUtility/libraries/process.smtp.mail.js +58 -29
- package/dist/platformUtility/libraries/process.smtp.mail.js.map +1 -1
- package/dist/platformUtility/services/mail.service.js +15 -13
- package/dist/platformUtility/services/mail.service.js.map +1 -1
- package/dist/platformUtility/services/ses.mail.notification.service.js +2 -0
- package/dist/platformUtility/services/ses.mail.notification.service.js.map +1 -1
- package/dist/system/entities/mail.recipient.entity.d.ts +3 -0
- package/dist/system/entities/mail.recipient.entity.js +12 -0
- package/dist/system/entities/mail.recipient.entity.js.map +1 -1
- package/dist/system/jobs/set.scheduled.event.job.d.ts +2 -1
- package/dist/system/jobs/set.scheduled.event.job.js +2 -1
- package/dist/system/jobs/set.scheduled.event.job.js.map +1 -1
- package/dist/system/services/scheduled.event.service.d.ts +5 -2
- package/dist/system/services/scheduled.event.service.js +18 -11
- package/dist/system/services/scheduled.event.service.js.map +1 -1
- package/package.json +1 -1
package/dist/app.controller.js
CHANGED
@@ -46,7 +46,9 @@ let AppController = class AppController {
|
|
46
46
|
async queue(id) {
|
47
47
|
return this.queueService.getJobDetails(id);
|
48
48
|
}
|
49
|
-
async set(req) {
|
49
|
+
async set(req) {
|
50
|
+
return this.setScheduledEventJob.dispatch();
|
51
|
+
}
|
50
52
|
};
|
51
53
|
exports.AppController = AppController;
|
52
54
|
__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0E;AAE1E,kDAA+C;AAC/C,8DAA0D;AAC1D,0EAAsE;AACtE,4EAAwE;AACxE,wEAAoE;AACpE,mFAA6E;AAC7E,yEAAqE;AAG9D,IAAM,aAAa,GAAnB,MAAM,aAAa;IACtB,YACqB,YAA0B,EACxB,OAAgB,EAChB,oBAA0C,EAC1C,WAAwB,EACxB,eAAgC,EAChC,UAAsB;QALxB,iBAAY,GAAZ,YAAY,CAAc;QACxB,YAAO,GAAP,OAAO,CAAS;QAChB,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,gBAAW,GAAX,WAAW,CAAa;QACxB,oBAAe,GAAf,eAAe,CAAiB;QAChC,eAAU,GAAV,UAAU,CAAY;IAC1C,CAAC;IAGE,AAAN,KAAK,CAAC,GAAG;QACL,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;IACvC,CAAC;IAQK,AAAN,KAAK,CAAC,iBAAiB;QACnB,OAAO,WAA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B,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAU,KAAU,IAAiB,CAAC;IAG3C,AAAN,KAAK,CAAC,gBAAgB;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;IAClC,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAc,EAAU;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAGK,AAAN,KAAK,CAAC,GAAG,CAAQ,GAAY;QACzB,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC;IAChD,CAAC;CACJ,CAAA;AA/CY,sCAAa;AAWhB;IADL,IAAA,YAAG,GAAE;;;;wCAGL;AAQK;IADL,IAAA,YAAG,EAAC,UAAU,CAAC;;;;sDAGf;AAGK;IADL,IAAA,YAAG,EAAC,UAAU,CAAC;;;;4CAGf;AAGK;IADL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACD,WAAA,IAAA,cAAK,GAAE,CAAA;;;;0CAA6B;AAG3C;IADL,IAAA,YAAG,EAAC,OAAO,CAAC;;;;qDAGZ;AAGK;IADL,IAAA,YAAG,EAAC,WAAW,CAAC;IACJ,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;0CAEvB;AAGK;IADL,IAAA,aAAI,EAAC,MAAM,CAAC;IACF,WAAA,IAAA,YAAG,GAAE,CAAA;;;;wCAEf;wBA9CQ,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAG0B,4BAAY;QACf,kBAAO;QACM,8CAAoB;QAC7B,0BAAW;QACP,kCAAe;QACpB,wBAAU;GAPpC,aAAa,CA+CzB"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AddTrackColumnsSysMailRecipientsTable1717761722433 = void 0;
|
4
|
+
const migration_utility_1 = require("../common/libraries/migration.utility");
|
5
|
+
class AddTrackColumnsSysMailRecipientsTable1717761722433 extends migration_utility_1.MigrationUtility {
|
6
|
+
constructor() {
|
7
|
+
super('sys_mail_recipients');
|
8
|
+
this.process();
|
9
|
+
}
|
10
|
+
process() {
|
11
|
+
this.string('tracking_identifier');
|
12
|
+
this.string('tracking_pixel_id');
|
13
|
+
this.json('tracking_attributes');
|
14
|
+
}
|
15
|
+
}
|
16
|
+
exports.AddTrackColumnsSysMailRecipientsTable1717761722433 = AddTrackColumnsSysMailRecipientsTable1717761722433;
|
17
|
+
//# sourceMappingURL=1717761722433-AddTrackColumnsSysMailRecipientsTable.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"1717761722433-AddTrackColumnsSysMailRecipientsTable.js","sourceRoot":"","sources":["../../src/migrations/1717761722433-AddTrackColumnsSysMailRecipientsTable.ts"],"names":[],"mappings":";;;AAAA,6EAAyE;AAEzE,MAAa,kDAAmD,SAAQ,oCAAgB;IACpF;QACI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAED,OAAO;QACH,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QAEjC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACrC,CAAC;CACJ;AAZD,gHAYC"}
|
@@ -66,4 +66,9 @@ __decorate([
|
|
66
66
|
(0, class_transformer_1.Expose)(),
|
67
67
|
__metadata("design:type", String)
|
68
68
|
], MailOptionsDto.prototype, "gateway", void 0);
|
69
|
+
__decorate([
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
71
|
+
(0, class_transformer_1.Expose)(),
|
72
|
+
__metadata("design:type", Boolean)
|
73
|
+
], MailOptionsDto.prototype, "tracking_enabled", void 0);
|
69
74
|
//# 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;
|
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;CA6C1B;AA7CD,wCA6CC;AA1CG;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;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAM,GAAE;;wDACkB"}
|
@@ -71,7 +71,7 @@ declare const es6Classes: {
|
|
71
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)[];
|
72
72
|
entities: (typeof FailedBullJobEntity | typeof PendingBullJobEntity)[];
|
73
73
|
jobs: (typeof TestJob | typeof LoadFailedBullJob | typeof ProcessSesDeliveryWebhookJob | typeof ProcessTrackingWebhookJob | typeof RecordWatcherJob | typeof ReloadPendingBullJob)[];
|
74
|
-
libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof
|
74
|
+
libraries: (typeof ProcessCommonMail | typeof ProcessSesMail | typeof ProcessSesRawMail | typeof ProcessSmtpMail | typeof CommonSqsPolling | typeof ProcessAuditLogData | typeof FileSystemUtility | typeof CreateEs6ClassesFile | typeof CreateEs6JobsFile | typeof CreateEntityConstantsFile | typeof CreateEs6ServiceFile | typeof CreateIndexFile | typeof ProcessKaleyraCallbackResponse | typeof ProcessKaleyraSms | typeof SetSmsMessage)[];
|
75
75
|
middlewares: (typeof MaintenanceMiddleware | typeof TrimPipe)[];
|
76
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)[];
|
77
77
|
subscribers: (typeof BaseSubscriber)[];
|
@@ -21,7 +21,10 @@ let ProcessSesDeliveryWebhookJob = class ProcessSesDeliveryWebhookJob extends co
|
|
21
21
|
this.sesMailNotificationService = sesMailNotificationService;
|
22
22
|
}
|
23
23
|
async handle(payload) {
|
24
|
-
const
|
24
|
+
const data = await this.sesMailNotificationService.getNotificationPayload(payload);
|
25
|
+
if (!data)
|
26
|
+
return;
|
27
|
+
const { notificationPayload, mailLogEntity } = data;
|
25
28
|
const eventType = notificationPayload.eventType;
|
26
29
|
if (!eventType)
|
27
30
|
return;
|
@@ -1 +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,
|
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,IAAI,GAAG,MAAM,IAAI,CAAC,0BAA0B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;QACnF,IAAI,CAAC,IAAI;YAAE,OAAO;QAElB,MAAM,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;QAEpD,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;AAxBY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,mBAAU,GAAE;qCAG4B,4BAAY;QACE,0DAA0B;GAHpE,4BAA4B,CAwBxC"}
|
@@ -13,7 +13,7 @@ exports.ProcessTrackingWebhookJob = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
14
14
|
const common_job_1 = require("../../common/libraries/common.job");
|
15
15
|
const queue_service_1 = require("../services/queue.service");
|
16
|
-
const
|
16
|
+
const mail_recipient_entity_1 = require("../../system/entities/mail.recipient.entity");
|
17
17
|
let ProcessTrackingWebhookJob = class ProcessTrackingWebhookJob extends common_job_1.CommonJob {
|
18
18
|
constructor(queueService) {
|
19
19
|
super('fd9a3406400161c9dae9f327f10eaa49');
|
@@ -23,24 +23,14 @@ let ProcessTrackingWebhookJob = class ProcessTrackingWebhookJob extends common_j
|
|
23
23
|
await this.processTrackData(query);
|
24
24
|
return;
|
25
25
|
}
|
26
|
-
async processTrackData(
|
27
|
-
let
|
28
|
-
|
29
|
-
return;
|
30
|
-
const track_pairs = mailLogEntity.tracking_attributes?.track_pairs;
|
26
|
+
async processTrackData(data) {
|
27
|
+
let mailRecepient = await mail_recipient_entity_1.MailRecipientEntity.findOne({ where: { tracking_identifier: data.query.t, tracking_pixel_id: data.query.px } });
|
28
|
+
const opens = mailRecepient?.tracking_attributes?.opens || [];
|
31
29
|
const last_opened_at = new Date();
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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();
|
30
|
+
const openData = { opened_at: last_opened_at.toISOString(), peer: data.peer, user_agent: data.user_agent };
|
31
|
+
opens.push(openData);
|
32
|
+
mailRecepient.tracking_attributes = { ...mailRecepient.tracking_attributes, opens };
|
33
|
+
await mailRecepient.save();
|
44
34
|
}
|
45
35
|
};
|
46
36
|
exports.ProcessTrackingWebhookJob = ProcessTrackingWebhookJob;
|
@@ -1 +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;
|
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;AAEzD,uFAAkF;AAG3E,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,IAAS;QACpC,IAAI,aAAa,GAAG,MAAM,2CAAmB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAE1I,MAAM,KAAK,GAAU,aAAa,EAAE,mBAAmB,EAAE,KAAK,IAAI,EAAE,CAAC;QAErE,MAAM,cAAc,GAAG,IAAI,IAAI,EAAE,CAAC;QAElC,MAAM,QAAQ,GAAG,EAAE,SAAS,EAAE,cAAc,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC;QAE3G,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAErB,aAAa,CAAC,mBAAmB,GAAG,EAAE,GAAG,aAAa,CAAC,mBAAmB,EAAE,KAAK,EAAE,CAAC;QAEpF,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;CACJ,CAAA;AA1BY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEoC,4BAAY;GADhD,yBAAyB,CA0BrC"}
|
@@ -15,9 +15,9 @@ export declare class ProcessSesMail extends ProcessCommonSesMail {
|
|
15
15
|
attributes: {
|
16
16
|
ses: any;
|
17
17
|
};
|
18
|
-
|
19
|
-
track_pairs: any;
|
20
|
-
};
|
18
|
+
track_pairs: any;
|
21
19
|
}>;
|
22
20
|
sendSesEmail(): Promise<any>;
|
21
|
+
private setTracking;
|
22
|
+
private setTrackingPixel;
|
23
23
|
}
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessSesMail = void 0;
|
4
4
|
const client_ses_1 = require("@aws-sdk/client-ses");
|
5
5
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
6
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
7
6
|
const process_common_ses_mail_1 = require("./process.common.ses.mail");
|
8
7
|
class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
9
8
|
constructor(propertyService, options, awsConfigService, mailService) {
|
@@ -15,32 +14,23 @@ class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
15
14
|
}
|
16
15
|
async process() {
|
17
16
|
const response = await this.sendSesEmail();
|
18
|
-
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain');
|
19
|
-
if (!referenceBaseDomain)
|
20
|
-
throw new operation_exception_1.OperationException('referenceBaseDomain for ses mail not set');
|
21
17
|
const identifier = this.stripUnwantedChars(response.MessageId);
|
22
18
|
return {
|
23
19
|
identifier,
|
24
|
-
trackingId: response
|
20
|
+
trackingId: response?.trackingId,
|
25
21
|
attributes: { ses: response },
|
26
|
-
|
22
|
+
track_pairs: response?.track_pairs,
|
27
23
|
};
|
28
24
|
}
|
29
25
|
async sendSesEmail() {
|
30
26
|
const sesClient = await this.getClient();
|
31
|
-
const configurationSet = await this.propertyService.get('ses.mail.config.set');
|
32
|
-
if (!configurationSet)
|
33
|
-
throw new operation_exception_1.OperationException('ses mail config not set');
|
27
|
+
const configurationSet = await this.propertyService.get('ses.mail.config.set', 'track3');
|
34
28
|
const ToAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
|
35
29
|
const ccAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
|
36
30
|
const bccAddresses = Array.isArray(this.options.bcc) ? this.options.bcc : this.options.bcc ? [this.options.bcc] : [];
|
37
|
-
const
|
38
|
-
if (
|
39
|
-
|
40
|
-
const trackingId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
41
|
-
const trackingPixelId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
42
|
-
const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingPixelId);
|
43
|
-
const htmlWithPixel = `${this.options.html}${trackingPixel}`;
|
31
|
+
const { trackingId, trackingPixelId } = await this.setTracking();
|
32
|
+
if (this.options.tracking_enabled)
|
33
|
+
await this.setTrackingPixel(trackingId, trackingPixelId);
|
44
34
|
const attachments = await this.setAttachments();
|
45
35
|
attachments.forEach((attachment) => {
|
46
36
|
this.options.html += `<p>Attachment: ${attachment.filename}</p>`;
|
@@ -57,7 +47,7 @@ class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
57
47
|
Body: {
|
58
48
|
Html: {
|
59
49
|
Charset: 'UTF-8',
|
60
|
-
Data:
|
50
|
+
Data: this.options.html,
|
61
51
|
},
|
62
52
|
},
|
63
53
|
Subject: {
|
@@ -70,6 +60,8 @@ class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
70
60
|
const command = new client_ses_1.SendEmailCommand(input);
|
71
61
|
try {
|
72
62
|
const response = await sesClient.send(command);
|
63
|
+
if (!this.options.tracking_enabled)
|
64
|
+
return response;
|
73
65
|
response['trackingId'] = trackingId;
|
74
66
|
const track_pairs = {};
|
75
67
|
track_pairs[trackingPixelId] = { email: null };
|
@@ -81,6 +73,19 @@ class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
81
73
|
return err;
|
82
74
|
}
|
83
75
|
}
|
76
|
+
async setTracking() {
|
77
|
+
const now = new Date().getTime();
|
78
|
+
const random = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
79
|
+
const trackingId = `${now}.${random}`;
|
80
|
+
const trackingPixelId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
81
|
+
return { trackingId, trackingPixelId };
|
82
|
+
}
|
83
|
+
async setTrackingPixel(trackingId, trackingPixelId) {
|
84
|
+
const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingPixelId);
|
85
|
+
if (!trackingPixel)
|
86
|
+
return;
|
87
|
+
this.options.html = `${this.options.html}${trackingPixel}`;
|
88
|
+
}
|
84
89
|
}
|
85
90
|
exports.ProcessSesMail = ProcessSesMail;
|
86
91
|
//# sourceMappingURL=process.ses.mail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process.ses.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.mail.ts"],"names":[],"mappings":";;;AAKA,oDAAuD;AACvD,8EAAwE;
|
1
|
+
{"version":3,"file":"process.ses.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.mail.ts"],"names":[],"mappings":";;;AAKA,oDAAuD;AACvD,8EAAwE;AAExE,uEAAiE;AAQjE,MAAa,cAAe,SAAQ,8CAAoB;IAOpD,YACuB,eAAgC,EACzC,OAAuB,EACd,gBAAkC,EAClC,WAAwB;QAE3C,KAAK,EAAE,CAAC;QALW,oBAAe,GAAf,eAAe,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAgB;QACd,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,gBAAW,GAAX,WAAW,CAAa;IAG/C,CAAC;IAOD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAEhD,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE/D,OAAO;YACH,UAAU;YACV,UAAU,EAAE,QAAQ,EAAE,UAAU;YAChC,UAAU,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE;YAC7B,WAAW,EAAE,QAAQ,EAAE,WAAW;SACrC,CAAC;IACN,CAAC;IAED,KAAK,CAAC,YAAY;QACd,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;QAEzC,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;QAEzF,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzF,MAAM,WAAW,GA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WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QAC3F,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,aAAa,EAAE,CAAC;IAC/D,CAAC;CACJ;AAlHD,wCAkHC"}
|
@@ -10,14 +10,12 @@ export declare class ProcessSesRawMail extends ProcessCommonSesMail {
|
|
10
10
|
protected readonly mailService: MailService;
|
11
11
|
constructor(propertyService: PropertyService, options: MailOptionsDto, awsConfigService: AwsConfigService, mailService: MailService);
|
12
12
|
process(): Promise<{
|
13
|
-
identifier:
|
13
|
+
identifier: string;
|
14
14
|
trackingId: any;
|
15
15
|
attributes: {
|
16
16
|
ses: any;
|
17
17
|
};
|
18
|
-
|
19
|
-
track_pairs: any;
|
20
|
-
};
|
18
|
+
track_pairs: any;
|
21
19
|
}>;
|
22
20
|
sendSesRawEmail(): Promise<{
|
23
21
|
track_pairs: {};
|
@@ -25,6 +23,11 @@ export declare class ProcessSesRawMail extends ProcessCommonSesMail {
|
|
25
23
|
attributes: any[];
|
26
24
|
trackingId: string;
|
27
25
|
}>;
|
26
|
+
private setTracking;
|
27
|
+
private sendMail;
|
28
28
|
private getAllEmails;
|
29
|
-
|
29
|
+
private getEmails;
|
30
|
+
createRawMessage(references: string, trackingId: string, trackingpixelId: string): Promise<string>;
|
31
|
+
private stripOffUnwantedChars;
|
32
|
+
private setTrackingPixel;
|
30
33
|
}
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessSesRawMail = void 0;
|
4
4
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
5
5
|
const client_ses_1 = require("@aws-sdk/client-ses");
|
6
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
7
6
|
const process_common_ses_mail_1 = require("./process.common.ses.mail");
|
8
7
|
class ProcessSesRawMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
9
8
|
constructor(propertyService, options, awsConfigService, mailService) {
|
@@ -15,84 +14,81 @@ class ProcessSesRawMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
15
14
|
}
|
16
15
|
async process() {
|
17
16
|
const response = await this.sendSesRawEmail();
|
18
|
-
const identifier = response
|
17
|
+
const identifier = this.stripOffUnwantedChars(response?.identifier);
|
19
18
|
return {
|
20
19
|
identifier,
|
21
|
-
trackingId: response
|
22
|
-
attributes: { ses: response
|
23
|
-
|
20
|
+
trackingId: response?.trackingId,
|
21
|
+
attributes: { ses: response?.attributes },
|
22
|
+
track_pairs: response?.track_pairs,
|
24
23
|
};
|
25
24
|
}
|
26
25
|
async sendSesRawEmail() {
|
27
|
-
const sesClient = await this.getClient();
|
28
26
|
const destinations = await this.getAllEmails();
|
29
|
-
const trackingId =
|
30
|
-
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain');
|
31
|
-
if (!referenceBaseDomain)
|
32
|
-
throw new operation_exception_1.OperationException('referenceBaseDomain for ses mail not set');
|
33
|
-
let reference = `<${trackingId}@${referenceBaseDomain}>`;
|
27
|
+
const { trackingId, reference } = await this.setTracking();
|
34
28
|
let trackPairs = {};
|
35
29
|
let sesResponse = [];
|
36
|
-
const configurationSet = await this.propertyService.get('ses.mail.config.set');
|
37
|
-
if (!configurationSet)
|
38
|
-
throw new operation_exception_1.OperationException('ses mail config not set');
|
30
|
+
const configurationSet = await this.propertyService.get('ses.mail.config.set', 'track3');
|
39
31
|
for (const email of destinations) {
|
40
|
-
const
|
41
|
-
trackPairs[
|
42
|
-
const
|
43
|
-
const
|
44
|
-
|
45
|
-
ConfigurationSetName: configurationSet,
|
46
|
-
RawMessage: {
|
47
|
-
Data: Buffer.from(rawMail),
|
48
|
-
},
|
49
|
-
};
|
50
|
-
try {
|
51
|
-
const command = new client_ses_1.SendRawEmailCommand(msg);
|
52
|
-
const response = await sesClient.send(command);
|
32
|
+
const trackingPixelId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
33
|
+
trackPairs[email] = trackingPixelId;
|
34
|
+
const rawMessage = await this.createRawMessage(reference, trackingId, trackingPixelId);
|
35
|
+
const response = await this.sendMail(email, configurationSet, rawMessage);
|
36
|
+
if (response)
|
53
37
|
sesResponse.push(response);
|
54
|
-
}
|
55
|
-
catch (error) {
|
56
|
-
console.error('Error sending raw email:', error);
|
57
|
-
throw error;
|
58
|
-
}
|
59
38
|
}
|
60
39
|
return { track_pairs: trackPairs, identifier: reference, attributes: sesResponse, trackingId };
|
61
40
|
}
|
62
|
-
async
|
63
|
-
const
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
41
|
+
async setTracking() {
|
42
|
+
const now = new Date().getTime();
|
43
|
+
const random = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
44
|
+
const trackingId = `${now}.${random}`;
|
45
|
+
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain', 'finnoto.dev');
|
46
|
+
let reference = `<${trackingId}@${referenceBaseDomain}>`;
|
47
|
+
return { trackingId, reference };
|
48
|
+
}
|
49
|
+
async sendMail(email, configurationSet, rawMessage) {
|
50
|
+
const sesClient = await this.getClient();
|
51
|
+
const msg = {
|
52
|
+
Destinations: [email],
|
53
|
+
ConfigurationSetName: configurationSet,
|
54
|
+
RawMessage: {
|
55
|
+
Data: Buffer.from(rawMessage),
|
56
|
+
},
|
57
|
+
};
|
58
|
+
try {
|
59
|
+
const command = new client_ses_1.SendRawEmailCommand(msg);
|
60
|
+
return sesClient.send(command);
|
71
61
|
}
|
72
|
-
|
73
|
-
|
74
|
-
emails.push(...this.options.cc);
|
75
|
-
}
|
76
|
-
else {
|
77
|
-
emails.push(this.options.cc);
|
78
|
-
}
|
62
|
+
catch (error) {
|
63
|
+
throw error;
|
79
64
|
}
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
65
|
+
}
|
66
|
+
async getAllEmails() {
|
67
|
+
let emails = [];
|
68
|
+
if (this.options.to)
|
69
|
+
emails = this.getEmails(emails, this.options.to);
|
70
|
+
if (this.options.cc)
|
71
|
+
emails = this.getEmails(emails, this.options.cc);
|
72
|
+
if (this.options.bcc)
|
73
|
+
emails = this.getEmails(emails, this.options.bcc);
|
74
|
+
return emails;
|
75
|
+
}
|
76
|
+
getEmails(emails, data) {
|
77
|
+
if (Array.isArray(data)) {
|
78
|
+
emails.push(...data);
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
emails.push(data);
|
87
82
|
}
|
88
83
|
return emails;
|
89
84
|
}
|
90
|
-
async
|
85
|
+
async createRawMessage(references, trackingId, trackingpixelId) {
|
91
86
|
const toAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
|
92
87
|
const ccAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
|
93
88
|
const bccAddresses = Array.isArray(this.options.bcc) ? this.options.bcc : this.options.bcc ? [this.options.bcc] : [];
|
94
|
-
|
95
|
-
|
89
|
+
let html = this.options.html;
|
90
|
+
if (this.options.tracking_enabled)
|
91
|
+
html = await this.setTrackingPixel(trackingId, trackingpixelId);
|
96
92
|
let msg = `From: ${this.options.from}\n`;
|
97
93
|
msg += `To: ${toAddresses}\n`;
|
98
94
|
msg += `CC: ${ccAddresses}\n`;
|
@@ -106,7 +102,7 @@ class ProcessSesRawMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
106
102
|
msg += `--AltPart\n`;
|
107
103
|
msg += `Content-Type: text/html; charset="UTF-8"\n`;
|
108
104
|
msg += `Content-Transfer-Encoding: 7bit\n\n`;
|
109
|
-
msg += `${
|
105
|
+
msg += `${html}\n\n`;
|
110
106
|
msg += `--AltPart--\n\n`;
|
111
107
|
const attachments = await this.setAttachments();
|
112
108
|
for (let attachment of attachments) {
|
@@ -119,6 +115,15 @@ class ProcessSesRawMail extends process_common_ses_mail_1.ProcessCommonSesMail {
|
|
119
115
|
msg += `--NextPart--`;
|
120
116
|
return msg;
|
121
117
|
}
|
118
|
+
stripOffUnwantedChars(identifier) {
|
119
|
+
return identifier.replace('<', '').replace('>', '');
|
120
|
+
}
|
121
|
+
async setTrackingPixel(trackingId, trackingPixelId) {
|
122
|
+
const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingPixelId);
|
123
|
+
if (!trackingPixel)
|
124
|
+
return this.options.html;
|
125
|
+
return `${this.options.html}${trackingPixel}`;
|
126
|
+
}
|
122
127
|
}
|
123
128
|
exports.ProcessSesRawMail = ProcessSesRawMail;
|
124
129
|
//# sourceMappingURL=process.ses.raw.mail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process.ses.raw.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.raw.mail.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"process.ses.raw.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.raw.mail.ts"],"names":[],"mappings":";;;AAIA,8EAAwE;AACxE,oDAA0D;AAC1D,uEAAiE;AAQjE,MAAa,iBAAkB,SAAQ,8CAAoB;IAOvD,YACuB,eAAgC,EACzC,OAAuB,EACd,gBAAkC,EAClC,WAAwB;QAE3C,KAAK,EAAE,CAAC;QALW,oBAAe,GAAf,eAAe,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAgB;QACd,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,gBAAW,GAAX,WAAW,CAAa;IAG/C,CAAC;IAOD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEpE,OAAO;YACH,UAAU;YACV,UAAU,EAAE,QAAQ,EAAE,UAAU;YAChC,UAAU,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,UAA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AAC;IACxD,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,eAAuB;QACtE,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QAC3F,IAAI,CAAC,aAAa;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;QAE7C,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,aAAa,EAAE,CAAC;IAClD,CAAC;CACJ;AAxKD,8CAwKC"}
|
@@ -8,14 +8,17 @@ export declare class ProcessSmtpMail extends ProcessCommonSmtpMail {
|
|
8
8
|
protected mailService: MailService;
|
9
9
|
constructor(propertyService: PropertyService, options: MailOptionsDto, mailService: MailService);
|
10
10
|
process(): Promise<{
|
11
|
-
identifier:
|
11
|
+
identifier: any;
|
12
12
|
trackingId: any;
|
13
13
|
attributes: {
|
14
14
|
smtp: any;
|
15
15
|
};
|
16
|
-
|
17
|
-
track_pairs: any;
|
18
|
-
};
|
16
|
+
track_pairs: any;
|
19
17
|
}>;
|
20
18
|
protected send(): Promise<unknown>;
|
19
|
+
private setTracking;
|
20
|
+
private setTrackingPixel;
|
21
|
+
private getTrackPairs;
|
22
|
+
private getAllEmails;
|
23
|
+
private getEmails;
|
21
24
|
}
|
@@ -4,7 +4,6 @@ exports.ProcessSmtpMail = void 0;
|
|
4
4
|
const platform_utility_1 = require("../../common/libraries/platform.utility");
|
5
5
|
const process_common_smtp_mail_1 = require("./process.common.smtp.mail");
|
6
6
|
const nodemailer = require("nodemailer");
|
7
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
8
7
|
class ProcessSmtpMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
|
9
8
|
constructor(propertyService, options, mailService) {
|
10
9
|
super();
|
@@ -14,19 +13,11 @@ class ProcessSmtpMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
|
|
14
13
|
}
|
15
14
|
async process() {
|
16
15
|
const response = await this.send();
|
17
|
-
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain');
|
18
|
-
if (!referenceBaseDomain)
|
19
|
-
throw new operation_exception_1.OperationException('referenceBaseDomain for ses mail not set');
|
20
|
-
const rawMessageId = response?.response.replace('250 Ok ', '');
|
21
|
-
const smtpBaseHost = await this.propertyService.get('smtp.base.host');
|
22
|
-
if (!smtpBaseHost)
|
23
|
-
throw new operation_exception_1.OperationException('Smtp base host not set');
|
24
|
-
const identifier = `${rawMessageId}${smtpBaseHost}`;
|
25
16
|
return {
|
26
|
-
identifier,
|
27
|
-
trackingId: response
|
17
|
+
identifier: response?.identifier,
|
18
|
+
trackingId: response?.trackingId,
|
28
19
|
attributes: { smtp: response },
|
29
|
-
|
20
|
+
track_pairs: response?.track_pairs,
|
30
21
|
};
|
31
22
|
}
|
32
23
|
async send() {
|
@@ -45,19 +36,14 @@ class ProcessSmtpMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
|
|
45
36
|
});
|
46
37
|
const attachments = await this.setAttachments();
|
47
38
|
const to = Array.isArray(this.options.to) ? this.options.to.join(',') : this.options.to;
|
48
|
-
const
|
49
|
-
const trackingPixelId =
|
50
|
-
|
51
|
-
const htmlWithPixel = this.options.html + trackingPixel;
|
52
|
-
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain');
|
53
|
-
if (!referenceBaseDomain)
|
54
|
-
throw new operation_exception_1.OperationException('referenceBaseDomain for ses mail not set');
|
55
|
-
let reference = `<${trackingId}@${referenceBaseDomain}`;
|
39
|
+
const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain', 'finnoto.dev');
|
40
|
+
const { trackingId, trackingPixelId } = await this.setTracking();
|
41
|
+
let reference = `${trackingId}@${referenceBaseDomain}`;
|
56
42
|
const message = {
|
57
43
|
from: this.options.from || this.config.from,
|
58
44
|
to,
|
59
45
|
subject: this.options.subject,
|
60
|
-
html:
|
46
|
+
html: this.options.html,
|
61
47
|
attachments,
|
62
48
|
cc: this.options?.cc || [],
|
63
49
|
bcc: this.options?.bcc || [],
|
@@ -65,19 +51,62 @@ class ProcessSmtpMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
|
|
65
51
|
};
|
66
52
|
return new Promise((resolve, reject) => {
|
67
53
|
return transporter.sendMail(message, (err, info) => {
|
68
|
-
if (err)
|
54
|
+
if (err)
|
69
55
|
return reject(err);
|
70
|
-
}
|
71
|
-
|
72
|
-
|
73
|
-
const track_pairs = {};
|
74
|
-
track_pairs[trackingPixelId] = { email: null };
|
75
|
-
info['track_pairs'] = track_pairs;
|
56
|
+
let identifier = `${trackingId}@${referenceBaseDomain}`;
|
57
|
+
info['identifier'] = identifier;
|
58
|
+
if (!this.options.tracking_enabled)
|
76
59
|
return resolve(info);
|
77
|
-
|
60
|
+
info['tracking_id'] = trackingId;
|
61
|
+
const track_pairs = this.getTrackPairs(trackingPixelId);
|
62
|
+
track_pairs[trackingPixelId] = { email: null };
|
63
|
+
info['track_pairs'] = track_pairs;
|
64
|
+
return resolve(info);
|
78
65
|
});
|
79
66
|
});
|
80
67
|
}
|
68
|
+
async setTracking() {
|
69
|
+
const now = new Date().getTime();
|
70
|
+
const random = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
71
|
+
const trackingId = `${now}.${random}`;
|
72
|
+
const trackingPixelId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
|
73
|
+
if (!this.options.tracking_enabled)
|
74
|
+
return { trackingId, trackingPixelId };
|
75
|
+
await this.setTrackingPixel(trackingId, trackingPixelId);
|
76
|
+
}
|
77
|
+
async setTrackingPixel(trackingId, trackingPixelId) {
|
78
|
+
const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingPixelId);
|
79
|
+
if (!trackingPixel)
|
80
|
+
return;
|
81
|
+
this.options.html = this.options.html + trackingPixel;
|
82
|
+
}
|
83
|
+
getTrackPairs(trackingPixelId) {
|
84
|
+
const emails = this.getAllEmails();
|
85
|
+
const track_pairs = {};
|
86
|
+
for (const email in emails) {
|
87
|
+
track_pairs[email] = trackingPixelId;
|
88
|
+
}
|
89
|
+
return track_pairs;
|
90
|
+
}
|
91
|
+
getAllEmails() {
|
92
|
+
let emails = [];
|
93
|
+
if (this.options.to)
|
94
|
+
emails = this.getEmails(emails, this.options.to);
|
95
|
+
if (this.options.cc)
|
96
|
+
emails = this.getEmails(emails, this.options.cc);
|
97
|
+
if (this.options.bcc)
|
98
|
+
emails = this.getEmails(emails, this.options.bcc);
|
99
|
+
return emails;
|
100
|
+
}
|
101
|
+
getEmails(emails, data) {
|
102
|
+
if (Array.isArray(data)) {
|
103
|
+
emails.push(...data);
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
emails.push(data);
|
107
|
+
}
|
108
|
+
return emails;
|
109
|
+
}
|
81
110
|
}
|
82
111
|
exports.ProcessSmtpMail = ProcessSmtpMail;
|
83
112
|
//# sourceMappingURL=process.smtp.mail.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"process.smtp.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.smtp.mail.ts"],"names":[],"mappings":";;;AAAA,8EAAwE;AAIxE,yEAAmE;AACnE,yCAAyC;
|
1
|
+
{"version":3,"file":"process.smtp.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.smtp.mail.ts"],"names":[],"mappings":";;;AAAA,8EAAwE;AAIxE,yEAAmE;AACnE,yCAAyC;AAQzC,MAAa,eAAgB,SAAQ,gDAAqB;IAMtD,YACuB,eAAgC,EACzC,OAAuB,EACvB,WAAwB;QAElC,KAAK,EAAE,CAAC;QAJW,oBAAe,GAAf,eAAe,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAgB;QACvB,gBAAW,GAAX,WAAW,CAAa;IAGtC,CAAC;IAOD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAExC,OAAO;YACH,UAAU,EAA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AAC,GAAG;YAAE,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAExE,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,SAAS,CAAC,MAAgB,EAAE,IAAS;QACzC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAnJD,0CAmJC"}
|
@@ -18,11 +18,10 @@ const mail_recipient_entity_1 = require("../../system/entities/mail.recipient.en
|
|
18
18
|
const property_service_1 = require("../../system/services/property.service");
|
19
19
|
const upload_service_1 = require("../../system/services/upload.service");
|
20
20
|
const process_ses_mail_1 = require("../libraries/process.ses.mail");
|
21
|
+
const process_ses_raw_mail_1 = require("../libraries/process.ses.raw.mail");
|
21
22
|
const process_smtp_mail_1 = require("../libraries/process.smtp.mail");
|
22
23
|
const mail_log_entity_1 = require("./../../system/entities/mail.log.entity");
|
23
24
|
const aws_config_service_1 = require("./aws.config.service");
|
24
|
-
const operation_exception_1 = require("../../common/exceptions/operation.exception");
|
25
|
-
const process_ses_raw_mail_1 = require("../libraries/process.ses.raw.mail");
|
26
25
|
let MailService = class MailService {
|
27
26
|
constructor(propertyService, uploadService, awsConfigService) {
|
28
27
|
this.propertyService = propertyService;
|
@@ -32,7 +31,7 @@ let MailService = class MailService {
|
|
32
31
|
this.gateway = null;
|
33
32
|
}
|
34
33
|
async send(options, metadata) {
|
35
|
-
const { identifier, trackingId, attributes,
|
34
|
+
const { identifier, trackingId, attributes, track_pairs } = await this.processMail(options);
|
36
35
|
const gateway = options.gateway || this.gateway;
|
37
36
|
const body = { gateway, identifier };
|
38
37
|
const log = (0, class_transformer_1.plainToClass)(mail_log_entity_1.MailLogEntity, { ...body, ...metadata });
|
@@ -41,9 +40,8 @@ let MailService = class MailService {
|
|
41
40
|
log.body = await this.getBody(options);
|
42
41
|
log.subject = options.subject;
|
43
42
|
log.tracking_identifier = trackingId;
|
44
|
-
log.tracking_attributes = { ...tracking_attributes };
|
45
43
|
await log.save();
|
46
|
-
await this.setRecipients(log, options);
|
44
|
+
await this.setRecipients(log, options, trackingId, track_pairs);
|
47
45
|
return log;
|
48
46
|
}
|
49
47
|
async getBody(options) {
|
@@ -51,17 +49,21 @@ let MailService = class MailService {
|
|
51
49
|
const buffer = Buffer.from(str, 'utf-8');
|
52
50
|
return this.uploadService.upload({ buffer, originalname: `mail.body.${platform_utility_1.PlatformUtility.generateRandomAlpha(16)}.html` });
|
53
51
|
}
|
54
|
-
async setRecipients(mail, options) {
|
52
|
+
async setRecipients(mail, options, trackingId, track_pairs) {
|
55
53
|
const nodes = ['cc', 'bcc', 'to'];
|
56
54
|
for (const node of nodes) {
|
57
55
|
if (options[node])
|
58
|
-
await this.setRecipient(mail, node, options[node]);
|
56
|
+
await this.setRecipient(mail, node, options[node], trackingId, track_pairs);
|
59
57
|
}
|
60
58
|
}
|
61
|
-
async setRecipient(mail, type, email) {
|
59
|
+
async setRecipient(mail, type, email, trackingId, track_pairs) {
|
62
60
|
const emails = Array.isArray(email) ? email : [email];
|
63
61
|
for (const email of emails) {
|
64
62
|
const r = mail_recipient_entity_1.MailRecipientEntity.create({ mail_id: mail.id, type, email });
|
63
|
+
if (!(track_pairs && track_pairs[email]))
|
64
|
+
return r.save();
|
65
|
+
r.tracking_identifier = trackingId;
|
66
|
+
r.tracking_pixel_id = track_pairs[email];
|
65
67
|
await r.save();
|
66
68
|
}
|
67
69
|
}
|
@@ -85,11 +87,11 @@ let MailService = class MailService {
|
|
85
87
|
return this.gateway;
|
86
88
|
}
|
87
89
|
async getTrackingPixel(trackingId, trackingPixel) {
|
88
|
-
let
|
89
|
-
if (!
|
90
|
-
|
91
|
-
const
|
92
|
-
return `<img width="0" height="0" alt="" style="display:flex" src="${
|
90
|
+
let trackBackBase = await this.propertyService.get('email.track.webhook', 'https://ddebug.finnoto.dev/email-track');
|
91
|
+
if (!trackBackBase)
|
92
|
+
return;
|
93
|
+
const trackBackUrl = `${trackBackBase}?t=${encodeURIComponent(trackingId)}&px=${trackingPixel}`;
|
94
|
+
return `<img width="0" height="0" alt="" style="display:flex" src="${trackBackUrl}">`;
|
93
95
|
}
|
94
96
|
};
|
95
97
|
exports.MailService = MailService;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mail.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/mail.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAAiD;AACjD,uCAAsC;AACtC,8EAA0E;AAC1E,uFAAkF;AAClF,6EAAyE;AACzE,yEAAqE;AACrE,oEAA+D;AAC/D,sEAAiE;AACjE,6EAAwE;AAExE,6DAAwD;
|
1
|
+
{"version":3,"file":"mail.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/mail.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAAiD;AACjD,uCAAsC;AACtC,8EAA0E;AAC1E,uFAAkF;AAClF,6EAAyE;AACzE,yEAAqE;AACrE,oEAA+D;AAC/D,4EAAsE;AACtE,sEAAiE;AACjE,6EAAwE;AAExE,6DAAwD;AAQjD,IAAM,WAAW,GAAjB,MAAM,WAAW;IAqBpB,YACqB,eAAgC,EAChC,aAA4B,EAC5B,gBAAkC;QAFlC,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;QAC5B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAlB/C,gBAAW,GAA2C,EAAE,CAAC;QAOzD,YAAO,GAAG,IAAI,CAAC;IAYpB,CAAC;IASJ,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,QAAc;QAC9C,MAAM,EAAE,UAAU,EAAE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CAAC;QAEhG,OAAO,8DAA8D,YAAY,IAAI,CAAC;IAC1F,CAAC;CACJ,CAAA;AA1HY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;qCAuB6B,kCAAe;QACjB,8BAAa;QACV,qCAAgB;GAxB9C,WAAW,CA0HvB"}
|
@@ -18,6 +18,8 @@ let SesMailNotificationService = class SesMailNotificationService {
|
|
18
18
|
if (payload.Type !== 'Notification')
|
19
19
|
return;
|
20
20
|
const notificationPayload = JSON.parse(payload.Message);
|
21
|
+
if (!notificationPayload)
|
22
|
+
return;
|
21
23
|
let identifier = notificationPayload.mail.headers.find((header) => header.name === 'References')?.value;
|
22
24
|
if (!identifier)
|
23
25
|
identifier = notificationPayload.mail.messageId;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ses.mail.notification.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/ses.mail.notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,2EAAsE;AAQ/D,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACnC,gBAAe,CAAC;IAEhB,KAAK,CAAC,sBAAsB,CAAC,OAAY;QACrC,IAAI,OAAO,CAAC,IAAI,KAAK,cAAc;YAAE,OAAO;QAE5C,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,EAAE,KAAK,CAAC;QAExG,IAAI,CAAC,UAAU;YAAE,UAAU,GAAG,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC;QAEjE,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,IAAI,aAAa,GAAG,MAAM,+BAAa,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;QAEvF,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,mBAAwB,EAAE,aAA4B;QAC/E,MAAM,UAAU,GAAU,aAAa,CAAC,mBAAmB,EAAE,UAAU,IAAI,EAAE,CAAC;QAE9E,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,mBAAmB,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QAEvH,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtB,aAAa,CAAC,mBAAmB,GAAG,EAAE,GAAG,aAAa,CAAC,mBAAmB,EAAE,UAAU,EAAE,CAAC;QAEzF,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,mBAAwB,EAAE,aAA4B;QAC7E,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAExH,MAAM,OAAO,GAAU,aAAa,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,CAAC;QAExE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,aAAa,CAAC,mBAAmB,GAAG,EAAE,GAAG,aAAa,CAAC,mBAAmB,EAAE,OAAO,EAAE,CAAC;QAEtF,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CACJ,CAAA;
|
1
|
+
{"version":3,"file":"ses.mail.notification.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/ses.mail.notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,2EAAsE;AAQ/D,IAAM,0BAA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K,CAAC,oBAAoB,CAAC,mBAAwB,EAAE,aAA4B;QAC7E,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,iBAAiB,EAAE,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAExH,MAAM,OAAO,GAAU,aAAa,CAAC,mBAAmB,EAAE,OAAO,IAAI,EAAE,CAAC;QAExE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnB,aAAa,CAAC,mBAAmB,GAAG,EAAE,GAAG,aAAa,CAAC,mBAAmB,EAAE,OAAO,EAAE,CAAC;QAEtF,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;IAChC,CAAC;CACJ,CAAA;AA9CY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;;GACA,0BAA0B,CA8CtC"}
|
@@ -5,6 +5,9 @@ export declare class MailRecipientEntity extends CommonEntity {
|
|
5
5
|
mail_id: number;
|
6
6
|
type: string;
|
7
7
|
email: string;
|
8
|
+
tracking_identifier: string;
|
9
|
+
tracking_pixel_id: string;
|
10
|
+
tracking_attributes: any;
|
8
11
|
attributes: MailRecipientAttributesDto;
|
9
12
|
mail: MailLogEntity;
|
10
13
|
}
|
@@ -29,6 +29,18 @@ __decorate([
|
|
29
29
|
(0, typeorm_1.Column)(),
|
30
30
|
__metadata("design:type", String)
|
31
31
|
], MailRecipientEntity.prototype, "email", void 0);
|
32
|
+
__decorate([
|
33
|
+
(0, typeorm_1.Column)(),
|
34
|
+
__metadata("design:type", String)
|
35
|
+
], MailRecipientEntity.prototype, "tracking_identifier", void 0);
|
36
|
+
__decorate([
|
37
|
+
(0, typeorm_1.Column)(),
|
38
|
+
__metadata("design:type", String)
|
39
|
+
], MailRecipientEntity.prototype, "tracking_pixel_id", void 0);
|
40
|
+
__decorate([
|
41
|
+
(0, typeorm_1.Column)('json'),
|
42
|
+
__metadata("design:type", Object)
|
43
|
+
], MailRecipientEntity.prototype, "tracking_attributes", void 0);
|
32
44
|
__decorate([
|
33
45
|
(0, typeorm_1.Column)('json'),
|
34
46
|
__metadata("design:type", mail_recipient_attributes_dto_1.MailRecipientAttributesDto)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mail.recipient.entity.js","sourceRoot":"","sources":["../../../src/system/entities/mail.recipient.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgE;AAChE,wEAAoE;AACpE,yFAAmF;AACnF,uDAAkD;AAS3C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;
|
1
|
+
{"version":3,"file":"mail.recipient.entity.js","sourceRoot":"","sources":["../../../src/system/entities/mail.recipient.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgE;AAChE,wEAAoE;AACpE,yFAAmF;AACnF,uDAAkD;AAS3C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,4BAAY;CAwBpD,CAAA;AAxBY,kDAAmB;AAE5B;IADC,IAAA,gBAAM,GAAE;;oDACO;AAGhB;IADC,IAAA,gBAAM,GAAE;;iDACI;AAGb;IADC,IAAA,gBAAM,GAAE;;kDACK;AAGd;IADC,IAAA,gBAAM,GAAE;;gEACmB;AAG5B;IADC,IAAA,gBAAM,GAAE;;8DACiB;AAG1B;IADC,IAAA,gBAAM,EAAC,MAAM,CAAC;;gEACU;AAGzB;IADC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACH,0DAA0B;uDAAC;AAG0B;IAAhE,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,+BAAa,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BAAO,+BAAa;iDAAC;8BAvB5E,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,qBAAqB,CAAC;GACjB,mBAAmB,CAwB/B"}
|
@@ -4,7 +4,8 @@ import { ScheduledEventService } from '../services/scheduled.event.service';
|
|
4
4
|
export declare class SetScheduledEventJob extends CommonJob {
|
5
5
|
protected readonly queueService: QueueService;
|
6
6
|
private readonly scheduledEventService;
|
7
|
+
protected timeout: number;
|
7
8
|
constructor(queueService: QueueService, scheduledEventService: ScheduledEventService);
|
8
|
-
handle(
|
9
|
+
handle(): Promise<void>;
|
9
10
|
private handleAllActiveJobs;
|
10
11
|
}
|
@@ -19,8 +19,9 @@ let SetScheduledEventJob = class SetScheduledEventJob extends common_job_1.Commo
|
|
19
19
|
super('40d4fd2c9c09856b54d90643c5f03171');
|
20
20
|
this.queueService = queueService;
|
21
21
|
this.scheduledEventService = scheduledEventService;
|
22
|
+
this.timeout = 300000;
|
22
23
|
}
|
23
|
-
async handle(
|
24
|
+
async handle() {
|
24
25
|
return this.handleAllActiveJobs();
|
25
26
|
}
|
26
27
|
async handleAllActiveJobs() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"set.scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,gFAA4E;AAC5E,iFAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAS;
|
1
|
+
{"version":3,"file":"set.scheduled.event.job.js","sourceRoot":"","sources":["../../../src/system/jobs/set.scheduled.event.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kEAA8D;AAC9D,gFAA4E;AAC5E,iFAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAS;IAG/C,YACuB,YAA0B,EAC5B,qBAA4C;QAE7D,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,0BAAqB,GAArB,qBAAqB,CAAuB;QAJvD,YAAO,GAAW,MAAM,CAAC;IAOnC,CAAC;IACD,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACtC,CAAC;IAEO,KAAK,CAAC,mBAAmB;QAC7B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,EAAE,CAAC;QAE5E,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;YACvC,MAAM,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACtE,CAAC;IACL,CAAC;CACJ,CAAA;AApBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAK4B,4BAAY;QACL,+CAAqB;GALxD,oBAAoB,CAoBhC"}
|
@@ -1,16 +1,19 @@
|
|
1
|
+
import { SqlService } from '../../platformUtility/services/sql.service';
|
1
2
|
import { EventQueueEntity } from '../entities/event.queue.entity';
|
2
3
|
import { ScheduledEventEntity } from '../entities/scheduled.event.entity';
|
3
4
|
import { PropertyService } from './property.service';
|
4
5
|
export declare class ScheduledEventService {
|
5
6
|
private readonly propertyService;
|
6
|
-
|
7
|
+
protected readonly sqlService: SqlService;
|
8
|
+
constructor(propertyService: PropertyService, sqlService: SqlService);
|
7
9
|
getActiveEvents(id: number): Promise<EventQueueEntity[]>;
|
10
|
+
getActiveEventsSummary(id: number): Promise<any>;
|
8
11
|
getCompletedEvents(id: number): Promise<EventQueueEntity[]>;
|
9
12
|
deleteActiveEvents(id: number): Promise<EventQueueEntity[]>;
|
10
13
|
setNewEvent(job: ScheduledEventEntity, scheduledTime: Date): Promise<EventQueueEntity>;
|
11
14
|
createEventsForJob(job: ScheduledEventEntity): Promise<ScheduledEventEntity>;
|
12
15
|
getActiveSchedules(): Promise<ScheduledEventEntity[]>;
|
13
|
-
private
|
16
|
+
private getScheduleStartTime;
|
14
17
|
private withTimezoneOffset;
|
15
18
|
private reverseTimezoneOffset;
|
16
19
|
}
|
@@ -15,13 +15,15 @@ const parser = require("cron-parser");
|
|
15
15
|
const date_fns_1 = require("date-fns");
|
16
16
|
const typeorm_1 = require("typeorm");
|
17
17
|
const date_util_1 = require("../../common/libraries/date.util");
|
18
|
+
const sql_service_1 = require("../../platformUtility/services/sql.service");
|
18
19
|
const event_queue_entity_1 = require("../entities/event.queue.entity");
|
19
20
|
const scheduled_event_entity_1 = require("../entities/scheduled.event.entity");
|
20
21
|
const property_service_1 = require("./property.service");
|
21
22
|
const SourceHash = require("../../config/source.hash");
|
22
23
|
let ScheduledEventService = class ScheduledEventService {
|
23
|
-
constructor(propertyService) {
|
24
|
+
constructor(propertyService, sqlService) {
|
24
25
|
this.propertyService = propertyService;
|
26
|
+
this.sqlService = sqlService;
|
25
27
|
}
|
26
28
|
async getActiveEvents(id) {
|
27
29
|
return event_queue_entity_1.EventQueueEntity.find({
|
@@ -35,6 +37,10 @@ let ScheduledEventService = class ScheduledEventService {
|
|
35
37
|
},
|
36
38
|
});
|
37
39
|
}
|
40
|
+
async getActiveEventsSummary(id) {
|
41
|
+
const sql = `select count(1) count, max(a.scheduled_start_time) scheduled_start_time from sys_event_queues a where a.deleted_at is null and a.start_time is null and a.source_type = '${SourceHash.scheduledEvent}' and a.source_id = ${id}`;
|
42
|
+
return this.sqlService.readFirst(sql);
|
43
|
+
}
|
38
44
|
async getCompletedEvents(id) {
|
39
45
|
return event_queue_entity_1.EventQueueEntity.find({
|
40
46
|
where: {
|
@@ -70,11 +76,11 @@ let ScheduledEventService = class ScheduledEventService {
|
|
70
76
|
const now = new Date();
|
71
77
|
if (!(job && job.event))
|
72
78
|
return job;
|
73
|
-
const
|
74
|
-
let inQueueCount =
|
75
|
-
if (inQueueCount >
|
79
|
+
const summary = await this.getActiveEventsSummary(job.id);
|
80
|
+
let inQueueCount = summary.count;
|
81
|
+
if (inQueueCount > 100)
|
76
82
|
return job;
|
77
|
-
let lastRunTime = await this.
|
83
|
+
let lastRunTime = await this.getScheduleStartTime(summary);
|
78
84
|
lastRunTime = lastRunTime < job.start_time ? job.start_time : lastRunTime;
|
79
85
|
if (lastRunTime > job.end_time)
|
80
86
|
return;
|
@@ -82,7 +88,7 @@ let ScheduledEventService = class ScheduledEventService {
|
|
82
88
|
currentDate: lastRunTime,
|
83
89
|
endDate: job.end_time,
|
84
90
|
});
|
85
|
-
while (inQueueCount <=
|
91
|
+
while (inQueueCount <= 1000) {
|
86
92
|
if (!nextTime.hasNext())
|
87
93
|
return;
|
88
94
|
const next = nextTime.next().toDate();
|
@@ -105,11 +111,11 @@ let ScheduledEventService = class ScheduledEventService {
|
|
105
111
|
},
|
106
112
|
});
|
107
113
|
}
|
108
|
-
async
|
109
|
-
if (!
|
114
|
+
async getScheduleStartTime(summary) {
|
115
|
+
if (!summary?.scheduled_start_time)
|
110
116
|
return new Date();
|
111
|
-
const
|
112
|
-
return this.reverseTimezoneOffset(
|
117
|
+
const latestDate = new Date(summary.scheduled_start_time);
|
118
|
+
return this.reverseTimezoneOffset(latestDate);
|
113
119
|
}
|
114
120
|
async withTimezoneOffset(date) {
|
115
121
|
const offset = await this.propertyService.get(`scheduled.job.timezone.offset`, 0);
|
@@ -127,6 +133,7 @@ let ScheduledEventService = class ScheduledEventService {
|
|
127
133
|
exports.ScheduledEventService = ScheduledEventService;
|
128
134
|
exports.ScheduledEventService = ScheduledEventService = __decorate([
|
129
135
|
(0, common_1.Injectable)(),
|
130
|
-
__metadata("design:paramtypes", [property_service_1.PropertyService
|
136
|
+
__metadata("design:paramtypes", [property_service_1.PropertyService,
|
137
|
+
sql_service_1.SqlService])
|
131
138
|
], ScheduledEventService);
|
132
139
|
//# sourceMappingURL=scheduled.event.service.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scheduled.event.service.js","sourceRoot":"","sources":["../../../src/system/services/scheduled.event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,sCAAsC;AACtC,uCAAkD;AAClD,qCAAgD;AAChD,gEAA4D;AAC5D,uEAAkE;AAClE,+EAA0E;AAC1E,yDAAqD;AACrD,uDAAwD;AAQjD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAM9B,
|
1
|
+
{"version":3,"file":"scheduled.event.service.js","sourceRoot":"","sources":["../../../src/system/services/scheduled.event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,sCAAsC;AACtC,uCAAkD;AAClD,qCAAgD;AAChD,gEAA4D;AAC5D,4EAAwE;AACxE,uEAAkE;AAClE,+EAA0E;AAC1E,yDAAqD;AACrD,uDAAwD;AAQjD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAM9B,YACqB,eAAgC,EAC9B,UAAsB;QADxB,oBAAe,GAAf,eAAe,CAAiB;QAC9B,eAAU,GAAV,UAAU,CAAY;IAC1C,CAAC;IAOJ,KAAK,CAAC,eAAe,CAAC,EAAU;QAC5B,OAAO,qCAAgB,CAAC,IAAI,CAAC;YACzB,KAAK,EAAE;gBACH,WAAW,EAAE,UAAU,CAAC,cAAc;gBACtC,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,IAAA,gBAAM,GAAE;aACvB;YACD,KAAK,EAAE;gBACH,oBAAoB,EAAE,KAAK;aAC9B;SACJ,CAAC,CAAC;IACP,CAAC;IAQD,KAAK,CAAC,sBAAsB,CAAC,EAAU;QACnC,MAAM,GAAG,GAAG,4KAA4K,UAAU,CAAC,cAAc,uBAAuB,EAAE,EAAE,CAAC;QAC7O,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAQD,KAAK,CAAC,kBAAkB,CAAC,EAAU;QAC/B,OAAO,qCAAgB,CAAC,IAAI,CAAC;YACzB,KAAK,EAAE;gBACH,WAAW,EAAE,UAAU,CAAC,cAAc;gBACtC,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,IAAA,aAAG,EAAC,IAAA,gBAAM,GAAE,CAAC;aAC5B;YACD,IAAI,EAAE,EAAE;YACR,KAAK,EAAE;gBACH,oBAAoB,EAAE,MAAM;aAC/B;SACJ,CAAC,CAAC;IAC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