@servicelabsco/nestjs-utility-services 1.2.90 → 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 (61) hide show
  1. package/dist/app.controller.d.ts +3 -1
  2. package/dist/app.controller.js +5 -2
  3. package/dist/app.controller.js.map +1 -1
  4. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.d.ts +5 -0
  5. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.js +17 -0
  6. package/dist/migrations/1710834052315-AddTrackingIdentifierSysMailLogsTable.js.map +1 -0
  7. package/dist/platformUtility/dtos/mail.options.dto.d.ts +1 -0
  8. package/dist/platformUtility/dtos/mail.options.dto.js +5 -0
  9. package/dist/platformUtility/dtos/mail.options.dto.js.map +1 -1
  10. package/dist/platformUtility/es6.classes.d.ts +7 -3
  11. package/dist/platformUtility/es6.classes.js +9 -1
  12. package/dist/platformUtility/es6.classes.js.map +1 -1
  13. package/dist/platformUtility/jobs/index.d.ts +2 -0
  14. package/dist/platformUtility/jobs/index.js +2 -0
  15. package/dist/platformUtility/jobs/index.js.map +1 -1
  16. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.d.ts +9 -0
  17. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js +41 -0
  18. package/dist/platformUtility/jobs/process.ses.delivery.webhook.job.js.map +1 -0
  19. package/dist/platformUtility/jobs/process.tracking.webhook.job.d.ts +8 -0
  20. package/dist/platformUtility/jobs/process.tracking.webhook.job.js +51 -0
  21. package/dist/platformUtility/jobs/process.tracking.webhook.job.js.map +1 -0
  22. package/dist/platformUtility/libraries/index.d.ts +2 -0
  23. package/dist/platformUtility/libraries/index.js +2 -0
  24. package/dist/platformUtility/libraries/index.js.map +1 -1
  25. package/dist/platformUtility/libraries/process.common.mail.d.ts +1 -0
  26. package/dist/platformUtility/libraries/process.common.mail.js +9 -0
  27. package/dist/platformUtility/libraries/process.common.mail.js.map +1 -1
  28. package/dist/platformUtility/libraries/process.common.ses.mail.d.ts +15 -0
  29. package/dist/platformUtility/libraries/process.common.ses.mail.js +40 -0
  30. package/dist/platformUtility/libraries/process.common.ses.mail.js.map +1 -0
  31. package/dist/platformUtility/libraries/process.common.smtp.mail.d.ts +6 -3
  32. package/dist/platformUtility/libraries/process.common.smtp.mail.js +0 -38
  33. package/dist/platformUtility/libraries/process.common.smtp.mail.js.map +1 -1
  34. package/dist/platformUtility/libraries/process.ses.mail.d.ts +13 -4
  35. package/dist/platformUtility/libraries/process.ses.mail.js +74 -6
  36. package/dist/platformUtility/libraries/process.ses.mail.js.map +1 -1
  37. package/dist/platformUtility/libraries/process.ses.raw.mail.d.ts +30 -0
  38. package/dist/platformUtility/libraries/process.ses.raw.mail.js +124 -0
  39. package/dist/platformUtility/libraries/process.ses.raw.mail.js.map +1 -0
  40. package/dist/platformUtility/libraries/process.smtp.mail.d.ts +9 -2
  41. package/dist/platformUtility/libraries/process.smtp.mail.js +68 -5
  42. package/dist/platformUtility/libraries/process.smtp.mail.js.map +1 -1
  43. package/dist/platformUtility/services/es6.jobs.service.d.ts +5 -1
  44. package/dist/platformUtility/services/es6.jobs.service.js +9 -1
  45. package/dist/platformUtility/services/es6.jobs.service.js.map +1 -1
  46. package/dist/platformUtility/services/index.d.ts +1 -0
  47. package/dist/platformUtility/services/index.js +1 -0
  48. package/dist/platformUtility/services/index.js.map +1 -1
  49. package/dist/platformUtility/services/mail.service.d.ts +4 -1
  50. package/dist/platformUtility/services/mail.service.js +24 -10
  51. package/dist/platformUtility/services/mail.service.js.map +1 -1
  52. package/dist/platformUtility/services/ses.mail.notification.service.d.ts +10 -0
  53. package/dist/platformUtility/services/ses.mail.notification.service.js +51 -0
  54. package/dist/platformUtility/services/ses.mail.notification.service.js.map +1 -0
  55. package/dist/platformUtility/services/sql.service.d.ts +2 -2
  56. package/dist/platformUtility/services/sql.service.js +11 -5
  57. package/dist/platformUtility/services/sql.service.js.map +1 -1
  58. package/dist/system/entities/mail.log.entity.d.ts +3 -0
  59. package/dist/system/entities/mail.log.entity.js +12 -0
  60. package/dist/system/entities/mail.log.entity.js.map +1 -1
  61. package/package.json +4 -2
@@ -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
  }
@@ -1,17 +1,85 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessSesMail = void 0;
4
- const process_common_smtp_mail_1 = require("./process.common.smtp.mail");
5
- class ProcessSesMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
6
- constructor(propertyService, options) {
4
+ const client_ses_1 = require("@aws-sdk/client-ses");
5
+ const platform_utility_1 = require("../../common/libraries/platform.utility");
6
+ const operation_exception_1 = require("../../common/exceptions/operation.exception");
7
+ const process_common_ses_mail_1 = require("./process.common.ses.mail");
8
+ class ProcessSesMail extends process_common_ses_mail_1.ProcessCommonSesMail {
9
+ constructor(propertyService, options, awsConfigService, mailService) {
7
10
  super();
8
11
  this.propertyService = propertyService;
9
12
  this.options = options;
13
+ this.awsConfigService = awsConfigService;
14
+ this.mailService = mailService;
10
15
  }
11
16
  async process() {
12
- const response = await this.send();
13
- const identifier = response.response.split(' ')[2];
14
- return { identifier, attributes: { ses: response } };
17
+ 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
+ const identifier = this.stripUnwantedChars(response.MessageId);
22
+ return {
23
+ identifier,
24
+ trackingId: response.trackingId,
25
+ attributes: { ses: response },
26
+ tracking_attributes: { track_pairs: response.track_pairs },
27
+ };
28
+ }
29
+ async sendSesEmail() {
30
+ 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');
34
+ const ToAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
35
+ const ccAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
36
+ const bccAddresses = Array.isArray(this.options.bcc) ? this.options.bcc : this.options.bcc ? [this.options.bcc] : [];
37
+ const referenceBaseDomain = await this.propertyService.get('ses.mail.reference.base.domain');
38
+ if (!referenceBaseDomain)
39
+ throw new operation_exception_1.OperationException('referenceBaseDomain for ses mail not set');
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}`;
44
+ const attachments = await this.setAttachments();
45
+ attachments.forEach((attachment) => {
46
+ this.options.html += `<p>Attachment: ${attachment.filename}</p>`;
47
+ this.options.html += `<p>${attachment.content}</p>`;
48
+ });
49
+ const input = {
50
+ ConfigurationSetName: configurationSet,
51
+ Destination: {
52
+ ToAddresses: ToAddresses,
53
+ CcAddresses: ccAddresses,
54
+ BccAddresses: bccAddresses,
55
+ },
56
+ Message: {
57
+ Body: {
58
+ Html: {
59
+ Charset: 'UTF-8',
60
+ Data: htmlWithPixel,
61
+ },
62
+ },
63
+ Subject: {
64
+ Charset: 'UTF-8',
65
+ Data: this.options.subject,
66
+ },
67
+ },
68
+ Source: this.options.from,
69
+ };
70
+ const command = new client_ses_1.SendEmailCommand(input);
71
+ try {
72
+ const response = await sesClient.send(command);
73
+ response['trackingId'] = trackingId;
74
+ const track_pairs = {};
75
+ track_pairs[trackingPixelId] = { email: null };
76
+ response['track_pairs'] = track_pairs;
77
+ return response;
78
+ }
79
+ catch (err) {
80
+ console.log(err);
81
+ return err;
82
+ }
15
83
  }
16
84
  }
17
85
  exports.ProcessSesMail = ProcessSesMail;
@@ -1 +1 @@
1
- {"version":3,"file":"process.ses.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.mail.ts"],"names":[],"mappings":";;;AAEA,yEAAmE;AAQnE,MAAa,cAAe,SAAQ,gDAAqB;IAOrD,YACuB,eAAgC,EACzC,OAAuB;QAEjC,KAAK,EAAE,CAAC;QAHW,oBAAe,GAAf,eAAe,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAgB;IAGrC,CAAC;IAOD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC;IACzD,CAAC;CACJ;AAzBD,wCAyBC"}
1
+ {"version":3,"file":"process.ses.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.mail.ts"],"names":[],"mappings":";;;AAKA,oDAAuD;AACvD,8E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AI,CAAC,OAAO,CAAC,IAAI,IAAI,MAAM,UAAU,CAAC,OAAO,MAAM,CAAC;QACxD,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG;YACV,oBAAoB,EAAE,gBAAgB;YACtC,WAAW,EAAE;gBACT,WAAW,EAAE,WAAW;gBACxB,WAAW,EAAE,WAAW;gBACxB,YAAY,EAAE,YAAY;aAC7B;YACD,OAAO,EAAE;gBACL,IAAI,EAAE;oBACF,IAAI,EAAE;wBACF,OAAO,EAAE,OAAO;wBAChB,IAAI,EAAE,aAAa;qBACtB;iBACJ;gBACD,OAAO,EAAE;oBACL,OAAO,EAAE,OAAO;oBAChB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;iBAC7B;aACJ;YACD,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;SAC5B,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,6BAAgB,CAAC,KAAK,CAAC,CAAC;QAE5C,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAE/C,QAAQ,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;YAEpC,MAAM,WAAW,GAAG,EAAE,CAAC;YAEvB,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAE/C,QAAQ,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YAEtC,OAAO,QAAQ,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,GAAG,CAAC;QACf,CAAC;IACL,CAAC;CACJ;AA1GD,wCA0GC"}
@@ -0,0 +1,30 @@
1
+ import { PropertyService } from '../../system/services/property.service';
2
+ import { MailOptionsDto } from './../dtos/mail.options.dto';
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 ProcessSesRawMail extends ProcessCommonSesMail {
7
+ protected readonly propertyService: PropertyService;
8
+ protected options: MailOptionsDto;
9
+ protected readonly awsConfigService: AwsConfigService;
10
+ protected readonly mailService: MailService;
11
+ constructor(propertyService: PropertyService, options: MailOptionsDto, awsConfigService: AwsConfigService, mailService: MailService);
12
+ process(): Promise<{
13
+ identifier: any;
14
+ trackingId: any;
15
+ attributes: {
16
+ ses: any;
17
+ };
18
+ tracking_attributes: {
19
+ track_pairs: any;
20
+ };
21
+ }>;
22
+ sendSesRawEmail(): Promise<{
23
+ track_pairs: {};
24
+ identifier: string;
25
+ attributes: any[];
26
+ trackingId: string;
27
+ }>;
28
+ private getAllEmails;
29
+ createRawEmail(references: string, trackingId: string, trackingpixel: string): Promise<string>;
30
+ }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessSesRawMail = void 0;
4
+ const platform_utility_1 = require("../../common/libraries/platform.utility");
5
+ const client_ses_1 = require("@aws-sdk/client-ses");
6
+ const operation_exception_1 = require("../../common/exceptions/operation.exception");
7
+ const process_common_ses_mail_1 = require("./process.common.ses.mail");
8
+ class ProcessSesRawMail extends process_common_ses_mail_1.ProcessCommonSesMail {
9
+ constructor(propertyService, options, awsConfigService, mailService) {
10
+ super();
11
+ this.propertyService = propertyService;
12
+ this.options = options;
13
+ this.awsConfigService = awsConfigService;
14
+ this.mailService = mailService;
15
+ }
16
+ async process() {
17
+ const response = await this.sendSesRawEmail();
18
+ const identifier = response.identifier;
19
+ return {
20
+ identifier,
21
+ trackingId: response.trackingId,
22
+ attributes: { ses: response.attributes },
23
+ tracking_attributes: { track_pairs: response.track_pairs },
24
+ };
25
+ }
26
+ async sendSesRawEmail() {
27
+ const sesClient = await this.getClient();
28
+ const destinations = await this.getAllEmails();
29
+ const trackingId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
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}>`;
34
+ let trackPairs = {};
35
+ 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');
39
+ for (const email of destinations) {
40
+ const trackingPixel = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
41
+ trackPairs[trackingPixel] = { email };
42
+ const rawMail = await this.createRawEmail(reference, trackingId, trackingPixel);
43
+ const msg = {
44
+ Destinations: [email],
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);
53
+ sesResponse.push(response);
54
+ }
55
+ catch (error) {
56
+ console.error('Error sending raw email:', error);
57
+ throw error;
58
+ }
59
+ }
60
+ return { track_pairs: trackPairs, identifier: reference, attributes: sesResponse, trackingId };
61
+ }
62
+ async getAllEmails() {
63
+ const emails = [];
64
+ if (this.options.to) {
65
+ if (Array.isArray(this.options.to)) {
66
+ emails.push(...this.options.to);
67
+ }
68
+ else {
69
+ emails.push(this.options.to);
70
+ }
71
+ }
72
+ if (this.options.cc) {
73
+ if (Array.isArray(this.options.cc)) {
74
+ emails.push(...this.options.cc);
75
+ }
76
+ else {
77
+ emails.push(this.options.cc);
78
+ }
79
+ }
80
+ if (this.options.bcc) {
81
+ if (Array.isArray(this.options.bcc)) {
82
+ emails.push(...this.options.bcc);
83
+ }
84
+ else {
85
+ emails.push(this.options.bcc);
86
+ }
87
+ }
88
+ return emails;
89
+ }
90
+ async createRawEmail(references, trackingId, trackingpixel) {
91
+ const toAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
92
+ const ccAddresses = Array.isArray(this.options.to) ? this.options.to : [this.options.to];
93
+ const bccAddresses = Array.isArray(this.options.bcc) ? this.options.bcc : this.options.bcc ? [this.options.bcc] : [];
94
+ const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingpixel);
95
+ const htmlWithPixel = `${this.options.html}${trackingPixel}`;
96
+ let msg = `From: ${this.options.from}\n`;
97
+ msg += `To: ${toAddresses}\n`;
98
+ msg += `CC: ${ccAddresses}\n`;
99
+ msg += `BCC: ${bccAddresses}\n`;
100
+ msg += `Subject: ${this.options.subject}\n`;
101
+ msg += `References: ${references}\n`;
102
+ msg += `MIME-Version: 1.0\n`;
103
+ msg += `Content-Type: multipart/mixed; boundary="NextPart"\n\n`;
104
+ msg += `--NextPart\n`;
105
+ msg += `Content-Type: multipart/alternative; boundary="AltPart"\n\n`;
106
+ msg += `--AltPart\n`;
107
+ msg += `Content-Type: text/html; charset="UTF-8"\n`;
108
+ msg += `Content-Transfer-Encoding: 7bit\n\n`;
109
+ msg += `${htmlWithPixel}\n\n`;
110
+ msg += `--AltPart--\n\n`;
111
+ const attachments = await this.setAttachments();
112
+ for (let attachment of attachments) {
113
+ msg += `--NextPart\n`;
114
+ msg += `Content-Type: ${attachment.contentType}; name="${attachment.filename}"\n`;
115
+ msg += `Content-Disposition: attachment; filename="${attachment.filename}"\n`;
116
+ msg += `Content-Transfer-Encoding: base64\n\n`;
117
+ msg += `${Buffer.from(attachment.content).toString('base64')}\n\n`;
118
+ }
119
+ msg += `--NextPart--`;
120
+ return msg;
121
+ }
122
+ }
123
+ exports.ProcessSesRawMail = ProcessSesRawMail;
124
+ //# sourceMappingURL=process.ses.raw.mail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process.ses.raw.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.ses.raw.mail.ts"],"names":[],"mappings":";;;AAKA,8EAAwE;AACxE,oDAA0D;AAC1D,qFAA+E;AAC/E,uEAAiE;AAQjE,MAAa,iBAAkB,SAAQ,8CAAoB;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K,IAAI,UAAU,IAAI,WAAW,EAAE,CAAC;YACjC,GAAG,IAAI,cAAc,CAAC;YACtB,GAAG,IAAI,iBAAiB,UAAU,CAAC,WAAW,WAAW,UAAU,CAAC,QAAQ,KAAK,CAAC;YAClF,GAAG,IAAI,8CAA8C,UAAU,CAAC,QAAQ,KAAK,CAAC;YAC9E,GAAG,IAAI,uCAAuC,CAAC;YAC/C,GAAG,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QACvE,CAAC;QAED,GAAG,IAAI,cAAc,CAAC;QAEtB,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA/JD,8CA+JC"}
@@ -1,14 +1,21 @@
1
1
  import { PropertyService } from '../../system/services/property.service';
2
+ import { MailService } from '../services/mail.service';
2
3
  import { MailOptionsDto } from './../dtos/mail.options.dto';
3
4
  import { ProcessCommonSmtpMail } from './process.common.smtp.mail';
4
5
  export declare class ProcessSmtpMail extends ProcessCommonSmtpMail {
5
6
  protected readonly propertyService: PropertyService;
6
7
  protected options: MailOptionsDto;
7
- constructor(propertyService: PropertyService, options: MailOptionsDto);
8
+ protected mailService: MailService;
9
+ constructor(propertyService: PropertyService, options: MailOptionsDto, mailService: MailService);
8
10
  process(): Promise<{
9
- identifier: any;
11
+ identifier: string;
12
+ trackingId: any;
10
13
  attributes: {
11
14
  smtp: any;
12
15
  };
16
+ tracking_attributes: {
17
+ track_pairs: any;
18
+ };
13
19
  }>;
20
+ protected send(): Promise<unknown>;
14
21
  }
@@ -1,19 +1,82 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessSmtpMail = void 0;
4
+ const platform_utility_1 = require("../../common/libraries/platform.utility");
4
5
  const process_common_smtp_mail_1 = require("./process.common.smtp.mail");
6
+ const nodemailer = require("nodemailer");
7
+ const operation_exception_1 = require("../../common/exceptions/operation.exception");
5
8
  class ProcessSmtpMail extends process_common_smtp_mail_1.ProcessCommonSmtpMail {
6
- constructor(propertyService, options) {
9
+ constructor(propertyService, options, mailService) {
7
10
  super();
8
11
  this.propertyService = propertyService;
9
12
  this.options = options;
13
+ this.mailService = mailService;
10
14
  }
11
15
  async process() {
12
16
  const response = await this.send();
13
- global.console.log('response original', response);
14
- const identifier = response?.messageId || null;
15
- global.console.log('identifier', identifier);
16
- return { identifier, attributes: { smtp: response } };
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
+ return {
26
+ identifier,
27
+ trackingId: response.trackingId,
28
+ attributes: { smtp: response },
29
+ tracking_attributes: { track_pairs: response.track_pairs },
30
+ };
31
+ }
32
+ async send() {
33
+ const config = await this.getConfig();
34
+ if (!config) {
35
+ global.console.log('configuration for smtp is missing');
36
+ return;
37
+ }
38
+ const transporter = nodemailer.createTransport({
39
+ host: config.host,
40
+ port: +config.port,
41
+ auth: {
42
+ user: config.username,
43
+ pass: config.password,
44
+ },
45
+ });
46
+ const attachments = await this.setAttachments();
47
+ const to = Array.isArray(this.options.to) ? this.options.to.join(',') : this.options.to;
48
+ const trackingId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
49
+ const trackingPixelId = platform_utility_1.PlatformUtility.generateRandomAlphaNumeric(32);
50
+ const trackingPixel = await this.mailService.getTrackingPixel(trackingId, trackingPixelId);
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}`;
56
+ const message = {
57
+ from: this.options.from || this.config.from,
58
+ to,
59
+ subject: this.options.subject,
60
+ html: htmlWithPixel,
61
+ attachments,
62
+ cc: this.options?.cc || [],
63
+ bcc: this.options?.bcc || [],
64
+ references: reference,
65
+ };
66
+ return new Promise((resolve, reject) => {
67
+ return transporter.sendMail(message, (err, info) => {
68
+ if (err) {
69
+ return reject(err);
70
+ }
71
+ else {
72
+ info['trackingId'] = trackingId;
73
+ const track_pairs = {};
74
+ track_pairs[trackingPixelId] = { email: null };
75
+ info['track_pairs'] = track_pairs;
76
+ return resolve(info);
77
+ }
78
+ });
79
+ });
17
80
  }
18
81
  }
19
82
  exports.ProcessSmtpMail = ProcessSmtpMail;
@@ -1 +1 @@
1
- {"version":3,"file":"process.smtp.mail.js","sourceRoot":"","sources":["../../../src/platformUtility/libraries/process.smtp.mail.ts"],"names":[],"mappings":";;;AAEA,yEAAmE;AAQnE,MAAa,eAAgB,SAAQ,gDAAqB;IAMtD,YACuB,eAAgC,EACzC,OAAuB;QAEjC,KAAK,EAAE,CAAC;QAHW,oBAAe,GAAf,eAAe,CAAiB;QACzC,YAAO,GAAP,OAAO,CAAgB;IAGrC,CAAC;IAOD,KAAK,CAAC,OAAO;QACT,MAAM,QAAQ,GAAQ,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;QAElD,MAAM,UAAU,GAAG,QAAQ,EAAE,SAAS,IAAI,IAAI,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAE7C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC;IAC1D,CAAC;CACJ;AA3BD,0CA2BC"}
1
+ {"version":3,"file":"process.smtp.mail.js","sourceRo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AI,CAAC,MAAM,CAAC,IAAI;YAC3C,EAAE;YACF,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,IAAI,EAAE,aAAa;YACnB,WAAW;YACX,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE;YAC1B,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE;YAC5B,UAAU,EAAE,SAAS;SACxB,CAAC;QAEF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,OAAO,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;gBAC/C,IAAI,GAAG,EAAE,CAAC;oBACN,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBACvB,CAAC;qBAAM,CAAC;oBACJ,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;oBAEhC,MAAM,WAAW,GAAG,EAAE,CAAC;oBAEvB,WAAW,CAAC,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;oBAC/C,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;oBAElC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;gBACzB,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA7GD,0CA6GC"}
@@ -1,14 +1,18 @@
1
1
  import { LoadFailedBullJob } from '../jobs/load.failed.bull.job';
2
+ import { ProcessSesDeliveryWebhookJob } from '../jobs/process.ses.delivery.webhook.job';
3
+ import { ProcessTrackingWebhookJob } from '../jobs/process.tracking.webhook.job';
2
4
  import { RecordWatcherJob } from '../jobs/record.watcher.job';
3
5
  import { ReloadPendingBullJob } from '../jobs/reload.pending.bull.job';
4
6
  import { TestJob } from '../jobs/test.job';
5
7
  export declare class Es6JobsService {
6
8
  private readonly loadFailedBullJob;
9
+ private readonly processSesDeliveryWebhookJob;
10
+ private readonly processTrackingWebhookJob;
7
11
  private readonly recordWatcherJob;
8
12
  private readonly reloadPendingBullJob;
9
13
  private readonly testJob;
10
14
  private jobs;
11
- constructor(loadFailedBullJob: LoadFailedBullJob, recordWatcherJob: RecordWatcherJob, reloadPendingBullJob: ReloadPendingBullJob, testJob: TestJob);
15
+ constructor(loadFailedBullJob: LoadFailedBullJob, processSesDeliveryWebhookJob: ProcessSesDeliveryWebhookJob, processTrackingWebhookJob: ProcessTrackingWebhookJob, recordWatcherJob: RecordWatcherJob, reloadPendingBullJob: ReloadPendingBullJob, testJob: TestJob);
12
16
  alignJobs(): void;
13
17
  setJobs(): void;
14
18
  }
@@ -12,13 +12,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Es6JobsService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const load_failed_bull_job_1 = require("../jobs/load.failed.bull.job");
15
+ const process_ses_delivery_webhook_job_1 = require("../jobs/process.ses.delivery.webhook.job");
16
+ const process_tracking_webhook_job_1 = require("../jobs/process.tracking.webhook.job");
15
17
  const record_watcher_job_1 = require("../jobs/record.watcher.job");
16
18
  const reload_pending_bull_job_1 = require("../jobs/reload.pending.bull.job");
17
19
  const test_job_1 = require("../jobs/test.job");
18
20
  const platform_utility_1 = require("../../common/libraries/platform.utility");
19
21
  let Es6JobsService = class Es6JobsService {
20
- constructor(loadFailedBullJob, recordWatcherJob, reloadPendingBullJob, testJob) {
22
+ constructor(loadFailedBullJob, processSesDeliveryWebhookJob, processTrackingWebhookJob, recordWatcherJob, reloadPendingBullJob, testJob) {
21
23
  this.loadFailedBullJob = loadFailedBullJob;
24
+ this.processSesDeliveryWebhookJob = processSesDeliveryWebhookJob;
25
+ this.processTrackingWebhookJob = processTrackingWebhookJob;
22
26
  this.recordWatcherJob = recordWatcherJob;
23
27
  this.reloadPendingBullJob = reloadPendingBullJob;
24
28
  this.testJob = testJob;
@@ -29,6 +33,8 @@ let Es6JobsService = class Es6JobsService {
29
33
  alignJobs() {
30
34
  this.jobs = {
31
35
  f04947e1c8234dd7e98e3629147266f8: this.loadFailedBullJob,
36
+ '591ea88d3cccb55e60d5cf1178ccb42a': this.processSesDeliveryWebhookJob,
37
+ fd9a3406400161c9dae9f327f10eaa49: this.processTrackingWebhookJob,
32
38
  '2d5219897af8f7809c63c7ad538795f2': this.recordWatcherJob,
33
39
  '2585362654581cff4f70fffe0249af26': this.reloadPendingBullJob,
34
40
  ba4c3857dfa9feac842416d9c39d0edd: this.testJob,
@@ -42,6 +48,8 @@ exports.Es6JobsService = Es6JobsService;
42
48
  exports.Es6JobsService = Es6JobsService = __decorate([
43
49
  (0, common_1.Injectable)(),
44
50
  __metadata("design:paramtypes", [load_failed_bull_job_1.LoadFailedBullJob,
51
+ process_ses_delivery_webhook_job_1.ProcessSesDeliveryWebhookJob,
52
+ process_tracking_webhook_job_1.ProcessTrackingWebhookJob,
45
53
  record_watcher_job_1.RecordWatcherJob,
46
54
  reload_pending_bull_job_1.ReloadPendingBullJob,
47
55
  test_job_1.TestJob])
@@ -1 +1 @@
1
- {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAiE;AACjE,mEAA8D;AAC9D,6EAAuE;AACvE,+CAA2C;AAC3C,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,iBAAoC,EACpC,gBAAkC,EAClC,oBAA0C,EAC1C,OAAgB;QAHhB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,YAAO,GAAP,OAAO,CAAS;QAN7B,SAAI,GAAG,EAAE,CAAC;QAQd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,gCAAgC,EAAE,IAAI,CAAC,iBAAiB;YACxD,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;YACzD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,gCAAgC,EAAE,IAAI,CAAC,OAAO;SACjD,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAjCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK+B,wCAAiB;QAClB,qCAAgB;QACZ,8CAAoB;QACjC,kBAAO;GAP5B,cAAc,CAiC1B"}
1
+ {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/platformUtility/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uEAAiE;AACjE,+FAAwF;AACxF,uFAAiF;AACjF,mEAA8D;AAC9D,6EAAuE;AACvE,+CAA2C;AAC3C,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YACqB,iBAAoC,EACpC,4BAA0D,EAC1D,yBAAoD,EACpD,gBAAkC,EAClC,oBAA0C,EAC1C,OAAgB;QALhB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC1D,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,YAAO,GAAP,OAAO,CAAS;QAR7B,SAAI,GAAG,EAAE,CAAC;QAUd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,gCAAgC,EAAE,IAAI,CAAC,iBAAiB;YACxD,kCAAkC,EAAE,IAAI,CAAC,4BAA4B;YACrE,gCAAgC,EAAE,IAAI,CAAC,yBAAyB;YAChE,kCAAkC,EAAE,IAAI,CAAC,gBAAgB;YACzD,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;YAC7D,gCAAgC,EAAE,IAAI,CAAC,OAAO;SACjD,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AArCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAK+B,wCAAiB;QACN,+DAA4B;QAC/B,wDAAyB;QAClC,qCAAgB;QACZ,8CAAoB;QACjC,kBAAO;GAT5B,cAAc,CAqC1B"}
@@ -9,6 +9,7 @@ export * from './mail.service';
9
9
  export * from './maintenance.service';
10
10
  export * from './queue.service';
11
11
  export * from './remote.request.service';
12
+ export * from './ses.mail.notification.service';
12
13
  export * from './shutdown.service';
13
14
  export * from './sms.service';
14
15
  export * from './sql.service';
@@ -25,6 +25,7 @@ __exportStar(require("./mail.service"), exports);
25
25
  __exportStar(require("./maintenance.service"), exports);
26
26
  __exportStar(require("./queue.service"), exports);
27
27
  __exportStar(require("./remote.request.service"), exports);
28
+ __exportStar(require("./ses.mail.notification.service"), exports);
28
29
  __exportStar(require("./shutdown.service"), exports);
29
30
  __exportStar(require("./sms.service"), exports);
30
31
  __exportStar(require("./sql.service"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAAA,uDAAqC;AAAA,uDAAqC;AAAA,kDAAgC;AAAA,mDAAiC;AAAA,6DAA2C;AAAA,2DAAyC;AAAA,iDAA+B;AAAA,wDAAsC;AAAA,kDAAgC;AAAA,2DAAyC;AAAA,qDAAmC;AAAA,gDAA8B;AAAA,gDAA8B;AAAA,gDAA8B;AAAA,oDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platformUtility/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAAA,uDAAqC;AAAA,uDAAqC;AAAA,kDAAgC;AAAA,mDAAiC;AAAA,6DAA2C;AAAA,2DAAyC;AAAA,iDAA+B;AAAA,wDAAsC;AAAA,kDAAgC;AAAA,2DAAyC;AAAA,kEAAgD;AAAA,qDAAmC;AAAA,gDAA8B;AAAA,gDAA8B;AAAA,gDAA8B;AAAA,oDAAiC"}
@@ -2,16 +2,19 @@ import { PropertyService } from '../../system/services/property.service';
2
2
  import { UploadService } from '../../system/services/upload.service';
3
3
  import { MailLogEntity } from './../../system/entities/mail.log.entity';
4
4
  import { MailOptionsDto } from './../dtos/mail.options.dto';
5
+ import { AwsConfigService } from './aws.config.service';
5
6
  export declare class MailService {
6
7
  private readonly propertyService;
7
8
  private readonly uploadService;
9
+ private readonly awsConfigService;
8
10
  private refreshTime;
9
11
  private gateway;
10
- constructor(propertyService: PropertyService, uploadService: UploadService);
12
+ constructor(propertyService: PropertyService, uploadService: UploadService, awsConfigService: AwsConfigService);
11
13
  send(options: MailOptionsDto, metadata?: any): Promise<MailLogEntity>;
12
14
  private getBody;
13
15
  private setRecipients;
14
16
  private setRecipient;
15
17
  private processMail;
16
18
  private getDefaultGateway;
19
+ getTrackingPixel(trackingId: string, trackingPixel: string): Promise<string>;
17
20
  }
@@ -20,24 +20,28 @@ const upload_service_1 = require("../../system/services/upload.service");
20
20
  const process_ses_mail_1 = require("../libraries/process.ses.mail");
21
21
  const process_smtp_mail_1 = require("../libraries/process.smtp.mail");
22
22
  const mail_log_entity_1 = require("./../../system/entities/mail.log.entity");
23
+ 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");
23
26
  let MailService = class MailService {
24
- constructor(propertyService, uploadService) {
27
+ constructor(propertyService, uploadService, awsConfigService) {
25
28
  this.propertyService = propertyService;
26
29
  this.uploadService = uploadService;
30
+ this.awsConfigService = awsConfigService;
27
31
  this.refreshTime = {};
28
32
  this.gateway = null;
29
33
  }
30
34
  async send(options, metadata) {
31
- const response = await this.processMail(options);
32
- global.console.log('response', response);
33
- const { identifier, attributes } = response;
34
- const gateway = this.gateway;
35
+ const { identifier, trackingId, attributes, tracking_attributes } = await this.processMail(options);
36
+ const gateway = options.gateway || this.gateway;
35
37
  const body = { gateway, identifier };
36
38
  const log = (0, class_transformer_1.plainToClass)(mail_log_entity_1.MailLogEntity, { ...body, ...metadata });
37
39
  log.attributes = { ...attributes, attachments: options.files || {} };
38
40
  log.processed_on = new Date();
39
41
  log.body = await this.getBody(options);
40
42
  log.subject = options.subject;
43
+ log.tracking_identifier = trackingId;
44
+ log.tracking_attributes = { ...tracking_attributes };
41
45
  await log.save();
42
46
  await this.setRecipients(log, options);
43
47
  return log;
@@ -62,12 +66,14 @@ let MailService = class MailService {
62
66
  }
63
67
  }
64
68
  async processMail(options) {
65
- const gateway = await this.getDefaultGateway();
66
- global.console.log('gateway', gateway);
69
+ const gateway = options.gateway || (await this.getDefaultGateway());
70
+ this.gateway = gateway;
67
71
  if (gateway === 'smtp')
68
- return new process_smtp_mail_1.ProcessSmtpMail(this.propertyService, options).process();
72
+ return new process_smtp_mail_1.ProcessSmtpMail(this.propertyService, options, this).process();
69
73
  if (gateway === 'ses')
70
- return new process_ses_mail_1.ProcessSesMail(this.propertyService, options).process();
74
+ return new process_ses_mail_1.ProcessSesMail(this.propertyService, options, this.awsConfigService, this).process();
75
+ if (gateway === 'sesRaw')
76
+ return new process_ses_raw_mail_1.ProcessSesRawMail(this.propertyService, options, this.awsConfigService, this).process();
71
77
  global.console.log('No mail gateway defined in the system');
72
78
  }
73
79
  async getDefaultGateway() {
@@ -78,11 +84,19 @@ let MailService = class MailService {
78
84
  this.gateway = await this.propertyService.get('mail.outbound.gateway', false);
79
85
  return this.gateway;
80
86
  }
87
+ async getTrackingPixel(trackingId, trackingPixel) {
88
+ let trackbackBase = await this.propertyService.get('email.track.webhook');
89
+ if (!trackbackBase)
90
+ throw new operation_exception_1.OperationException(`Email track webhook is not set.`);
91
+ const trackbackUrl = `${trackbackBase}?t=${encodeURIComponent(trackingId)}&px=${trackingPixel}`;
92
+ return `<img width="0" height="0" alt="" style="display:flex" src="${trackbackUrl}">`;
93
+ }
81
94
  };
82
95
  exports.MailService = MailService;
83
96
  exports.MailService = MailService = __decorate([
84
97
  (0, common_1.Injectable)(),
85
98
  __metadata("design:paramtypes", [property_service_1.PropertyService,
86
- upload_service_1.UploadService])
99
+ upload_service_1.UploadService,
100
+ aws_config_service_1.AwsConfigService])
87
101
  ], MailService);
88
102
  //# sourceMappingURL=mail.service.js.map
@@ -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;AAUjE,IAAM,WAAW,GAAjB,MAAM,WAAW;IAqBpB,YACqB,eAAgC,EAChC,aAA4B;QAD5B,oBAAe,GAAf,eAAe,CAAiB;QAChC,kBAAa,GAAb,aAAa,CAAe;QAjBzC,gBAAW,GAA2C,EAAE,CAAC;QAOzD,YAAO,GAAG,IAAI,CAAC;IAWpB,CAAC;IASJ,KAAK,CAAC,IAAI,CAAC,OAAuB,EAAE,QAAc;QAC9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAEzC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;Q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