@servicelabsco/slabs-access-manager 1.0.18 → 1.0.20
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/CLAUDE.md +101 -0
- package/dist/access/controllers/business.email.controller.d.ts +4 -0
- package/dist/access/controllers/business.email.controller.js +20 -0
- package/dist/access/controllers/business.email.controller.js.map +1 -1
- package/dist/access/entities/business.email.entity.d.ts +1 -0
- package/dist/access/entities/business.email.entity.js +4 -0
- package/dist/access/entities/business.email.entity.js.map +1 -1
- package/dist/access/es6.classes.d.ts +4 -4
- package/dist/access/es6.classes.js +3 -1
- package/dist/access/es6.classes.js.map +1 -1
- package/dist/access/jobs/email.attachment.job.d.ts +3 -1
- package/dist/access/jobs/email.attachment.job.js +6 -8
- package/dist/access/jobs/email.attachment.job.js.map +1 -1
- package/dist/access/jobs/email.message.job.d.ts +5 -4
- package/dist/access/jobs/email.message.job.js +10 -15
- package/dist/access/jobs/email.message.job.js.map +1 -1
- package/dist/access/jobs/email.recipient.job.d.ts +3 -1
- package/dist/access/jobs/email.recipient.job.js +6 -8
- package/dist/access/jobs/email.recipient.job.js.map +1 -1
- package/dist/access/jobs/evaluate.email.rule.job.d.ts +1 -0
- package/dist/access/jobs/evaluate.email.rule.job.js +1 -0
- package/dist/access/jobs/evaluate.email.rule.job.js.map +1 -1
- package/dist/access/jobs/gmail.integration.fetch.messages.job.d.ts +4 -1
- package/dist/access/jobs/gmail.integration.fetch.messages.job.js +7 -3
- package/dist/access/jobs/gmail.integration.fetch.messages.job.js.map +1 -1
- package/dist/access/jobs/index.d.ts +1 -0
- package/dist/access/jobs/index.js +1 -0
- package/dist/access/jobs/index.js.map +1 -1
- package/dist/access/jobs/process.server.email.job.d.ts +4 -1
- package/dist/access/jobs/process.server.email.job.js +24 -8
- package/dist/access/jobs/process.server.email.job.js.map +1 -1
- package/dist/access/jobs/sync.email.message.metrics.job.d.ts +9 -0
- package/dist/access/jobs/sync.email.message.metrics.job.js +64 -0
- package/dist/access/jobs/sync.email.message.metrics.job.js.map +1 -0
- package/dist/access/libraries/process.gmail.message.d.ts +6 -3
- package/dist/access/libraries/process.gmail.message.js +31 -29
- package/dist/access/libraries/process.gmail.message.js.map +1 -1
- package/dist/access/services/es6.jobs.service.d.ts +3 -1
- package/dist/access/services/es6.jobs.service.js +5 -1
- package/dist/access/services/es6.jobs.service.js.map +1 -1
- package/dist/migrations/1778580999080-AddNameBzBusinessEmailsTable.ts.d.ts +5 -0
- package/dist/migrations/1778580999080-AddNameBzBusinessEmailsTable.ts.js +15 -0
- package/dist/migrations/1778580999080-AddNameBzBusinessEmailsTable.ts.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ export declare class EvaluateEmailRuleJob extends CommonJob {
|
|
|
3
3
|
protected readonly queueService: QueueService;
|
|
4
4
|
private readonly awsS3Service;
|
|
5
5
|
protected readonly uploadService: UploadService;
|
|
6
|
+
protected noDuplicate: boolean;
|
|
6
7
|
constructor(queueService: QueueService, awsS3Service: AwsS3Service, uploadService: UploadService);
|
|
7
8
|
handle(id: number): Promise<void>;
|
|
8
9
|
}
|
|
@@ -19,6 +19,7 @@ let EvaluateEmailRuleJob = class EvaluateEmailRuleJob extends nestjs_utility_ser
|
|
|
19
19
|
this.queueService = queueService;
|
|
20
20
|
this.awsS3Service = awsS3Service;
|
|
21
21
|
this.uploadService = uploadService;
|
|
22
|
+
this.noDuplicate = true;
|
|
22
23
|
}
|
|
23
24
|
async handle(id) {
|
|
24
25
|
await new evaluate_email_rule_1.EvaluateEmailRule(this.awsS3Service, this.uploadService).process(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.email.rule.job.js","sourceRoot":"","sources":["../../../src/access/jobs/evaluate.email.rule.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAA8G;AAC9G,0EAAqE;AAQ9D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mCAAS;
|
|
1
|
+
{"version":3,"file":"evaluate.email.rule.job.js","sourceRoot":"","sources":["../../../src/access/jobs/evaluate.email.rule.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAA8G;AAC9G,0EAAqE;AAQ9D,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mCAAS;IAG/C,YACuB,YAA0B,EAC5B,YAA0B,EACxB,aAA4B;QAE/C,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAJvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,iBAAY,GAAZ,YAAY,CAAc;QACxB,kBAAa,GAAb,aAAa,CAAe;QALzC,gBAAW,GAAG,IAAI,CAAC;IAQ7B,CAAC;IAOD,KAAK,CAAC,MAAM,CAAC,EAAU;QACnB,MAAM,IAAI,uCAAiB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACnF,CAAC;CACJ,CAAA;AAnBY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAK4B,sCAAY;QACd,sCAAY;QACT,uCAAa;GAN1C,oBAAoB,CAmBhC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CommonJob, QueueService, UploadService } from '@servicelabsco/nestjs-utility-services';
|
|
2
2
|
import { GmailIntegrationService } from '../services/gmail.integration.service';
|
|
3
|
+
import { SyncEmailMessageMetricsJob } from './sync.email.message.metrics.job';
|
|
3
4
|
export declare class GmailIntegrationFetchMessagesJob extends CommonJob {
|
|
4
5
|
protected readonly queueService: QueueService;
|
|
5
6
|
private readonly gmailIntegrationService;
|
|
6
7
|
private readonly uploadService;
|
|
7
|
-
|
|
8
|
+
private readonly syncEmailMessageMetricsJob;
|
|
9
|
+
protected noDuplicate: boolean;
|
|
10
|
+
constructor(queueService: QueueService, gmailIntegrationService: GmailIntegrationService, uploadService: UploadService, syncEmailMessageMetricsJob: SyncEmailMessageMetricsJob);
|
|
8
11
|
handle({ email_id, maxResults }: {
|
|
9
12
|
email_id: number;
|
|
10
13
|
maxResults?: number;
|
|
@@ -14,18 +14,21 @@ const common_1 = require("@nestjs/common");
|
|
|
14
14
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
15
15
|
const process_gmail_message_1 = require("../libraries/process.gmail.message");
|
|
16
16
|
const gmail_integration_service_1 = require("../services/gmail.integration.service");
|
|
17
|
+
const sync_email_message_metrics_job_1 = require("./sync.email.message.metrics.job");
|
|
17
18
|
let GmailIntegrationFetchMessagesJob = class GmailIntegrationFetchMessagesJob extends nestjs_utility_services_1.CommonJob {
|
|
18
|
-
constructor(queueService, gmailIntegrationService, uploadService) {
|
|
19
|
+
constructor(queueService, gmailIntegrationService, uploadService, syncEmailMessageMetricsJob) {
|
|
19
20
|
super('47ce83818c57b4f6c949b535f04fae02');
|
|
20
21
|
this.queueService = queueService;
|
|
21
22
|
this.gmailIntegrationService = gmailIntegrationService;
|
|
22
23
|
this.uploadService = uploadService;
|
|
24
|
+
this.syncEmailMessageMetricsJob = syncEmailMessageMetricsJob;
|
|
25
|
+
this.noDuplicate = true;
|
|
23
26
|
}
|
|
24
27
|
async handle({ email_id, maxResults = 10 }) {
|
|
25
28
|
const data = await this.gmailIntegrationService.getEmailsList(email_id, maxResults);
|
|
26
29
|
for (const item of data.messages) {
|
|
27
30
|
const message = await this.gmailIntegrationService.getEmailMessageDetails(email_id, item.id);
|
|
28
|
-
await new process_gmail_message_1.ProcessGmailMessage(this.gmailIntegrationService, this.uploadService).process(message, email_id);
|
|
31
|
+
await new process_gmail_message_1.ProcessGmailMessage(this.gmailIntegrationService, this.uploadService, this.syncEmailMessageMetricsJob).process(message, email_id);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
};
|
|
@@ -34,6 +37,7 @@ exports.GmailIntegrationFetchMessagesJob = GmailIntegrationFetchMessagesJob = __
|
|
|
34
37
|
(0, common_1.Injectable)(),
|
|
35
38
|
__metadata("design:paramtypes", [nestjs_utility_services_1.QueueService,
|
|
36
39
|
gmail_integration_service_1.GmailIntegrationService,
|
|
37
|
-
nestjs_utility_services_1.UploadService
|
|
40
|
+
nestjs_utility_services_1.UploadService,
|
|
41
|
+
sync_email_message_metrics_job_1.SyncEmailMessageMetricsJob])
|
|
38
42
|
], GmailIntegrationFetchMessagesJob);
|
|
39
43
|
//# sourceMappingURL=gmail.integration.fetch.messages.job.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.integration.fetch.messages.job.js","sourceRoot":"","sources":["../../../src/access/jobs/gmail.integration.fetch.messages.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAgG;AAChG,8EAAyE;AACzE,qFAAgF;
|
|
1
|
+
{"version":3,"file":"gmail.integration.fetch.messages.job.js","sourceRoot":"","sources":["../../../src/access/jobs/gmail.integration.fetch.messages.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAgG;AAChG,8EAAyE;AACzE,qFAAgF;AAChF,qFAA8E;AAGvE,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,mCAAS;IAG3D,YACuB,YAA0B,EAC5B,uBAAgD,EAChD,aAA4B,EAC5B,0BAAsD;QAEvE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QALvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,kBAAa,GAAb,aAAa,CAAe;QAC5B,+BAA0B,GAA1B,0BAA0B,CAA4B;QANjE,gBAAW,GAAG,IAAI,CAAC;IAS7B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAA6C;QACjF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEpF,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YAC7F,MAAM,IAAI,2CAAmB,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC,OAAO,CACpH,OAAO,EACP,QAAQ,CACX,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AAvBY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,mBAAU,GAAE;qCAK4B,sCAAY;QACH,mDAAuB;QACjC,uCAAa;QACA,2DAA0B;GAPlE,gCAAgC,CAuB5C"}
|
|
@@ -90,6 +90,7 @@ export * from './slack.user.job';
|
|
|
90
90
|
export * from './slack.webhook.job';
|
|
91
91
|
export * from './slack.webhook.message.job';
|
|
92
92
|
export * from './sync.b.u.role.job';
|
|
93
|
+
export * from './sync.email.message.metrics.job';
|
|
93
94
|
export * from './sync.email.messages.job';
|
|
94
95
|
export * from './sync.menu.job';
|
|
95
96
|
export * from './ui.action.job';
|
|
@@ -106,6 +106,7 @@ __exportStar(require("./slack.user.job"), exports);
|
|
|
106
106
|
__exportStar(require("./slack.webhook.job"), exports);
|
|
107
107
|
__exportStar(require("./slack.webhook.message.job"), exports);
|
|
108
108
|
__exportStar(require("./sync.b.u.role.job"), exports);
|
|
109
|
+
__exportStar(require("./sync.email.message.metrics.job"), exports);
|
|
109
110
|
__exportStar(require("./sync.email.messages.job"), exports);
|
|
110
111
|
__exportStar(require("./sync.menu.job"), exports);
|
|
111
112
|
__exportStar(require("./ui.action.job"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAAA,oDAAk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AuD;AAAA,qDAAmC;AAAA,mDAAiC;AAAA,oDAAkC;AAAA,wDAAsC;AAAA,uDAAqC;AAAA,qDAAmC;AAAA,2DAAyC;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,6CAA2B;AAAA,kDAAgC;AAAA,+CAA6B;AAAA,oDAAkC;AAAA,wDAAsC;AAAA,0DAAwC;AAAA,8DAA4C;AAAA,yDAAuC;AAAA,6DAA2C;AAAA,gDAA8B;AAAA,mDAAiC;AAAA,oDAAkC;AAAA,mDAAiC;AAAA,+DAA6C;AAAA,8DAA4C;AAAA,yDAAuC;AAAA,0EAAwD;AAAA,qEAAmD;AAAA,+DAA6C;AAAA,+DAA6C;AAAA,0DAAwC;AAAA,sDAAoC;AAAA,uDAAqC;AAAA,mDAAiC;AAAA,sDAAoC;AAAA,8DAA4C;AAAA,sDAAoC;AAAA,mEAAiD;AAAA,4DAA0C;AAAA,kDAAgC;AAAA,kDAAgC;AAAA,uDAAqC;AAAA,6DAA2C;AAAA,0DAAwC;AAAA,wDAAsC;AAAA,kDAAgC;AAAA,6DAA2C;AAAA,sDAAoC;AAAA,oDAAkC;AAAA,qDAAmC;AAAA,qDAAmC;AAAA,kEAAgD;AAAA,yDAAuC;AAAA,iEAA+C;AAAA,0DAAwC;AAAA,oEAAiD"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CommonJob, InternalServerConnectService, QueueService, UploadService } from '@servicelabsco/nestjs-utility-services';
|
|
2
2
|
import { EmailMessageEntity } from '../entities/email.message.entity';
|
|
3
|
+
import { SyncEmailMessageMetricsJob } from './sync.email.message.metrics.job';
|
|
3
4
|
export declare class ProcessServerEmailJob extends CommonJob {
|
|
4
5
|
protected readonly queueService: QueueService;
|
|
5
6
|
private readonly uploadService;
|
|
6
7
|
protected readonly internalServerConnectService: InternalServerConnectService;
|
|
7
|
-
|
|
8
|
+
private readonly syncEmailMessageMetricsJob;
|
|
9
|
+
protected noDuplicate: boolean;
|
|
10
|
+
constructor(queueService: QueueService, uploadService: UploadService, internalServerConnectService: InternalServerConnectService, syncEmailMessageMetricsJob: SyncEmailMessageMetricsJob);
|
|
8
11
|
handle(id: number): Promise<EmailMessageEntity>;
|
|
9
12
|
private setMessage;
|
|
10
13
|
private setAttachments;
|
|
@@ -12,16 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ProcessServerEmailJob = void 0;
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
15
16
|
const business_email_entity_1 = require("../entities/business.email.entity");
|
|
16
17
|
const email_attachment_entity_1 = require("../entities/email.attachment.entity");
|
|
17
18
|
const email_message_entity_1 = require("../entities/email.message.entity");
|
|
18
19
|
const email_recipient_entity_1 = require("../entities/email.recipient.entity");
|
|
20
|
+
const sync_email_message_metrics_job_1 = require("./sync.email.message.metrics.job");
|
|
21
|
+
const PG_UNIQUE_VIOLATION = '23505';
|
|
19
22
|
let ProcessServerEmailJob = class ProcessServerEmailJob extends nestjs_utility_services_1.CommonJob {
|
|
20
|
-
constructor(queueService, uploadService, internalServerConnectService) {
|
|
23
|
+
constructor(queueService, uploadService, internalServerConnectService, syncEmailMessageMetricsJob) {
|
|
21
24
|
super('6dc279beaec1891635dab7b1c7e76be3');
|
|
22
25
|
this.queueService = queueService;
|
|
23
26
|
this.uploadService = uploadService;
|
|
24
27
|
this.internalServerConnectService = internalServerConnectService;
|
|
28
|
+
this.syncEmailMessageMetricsJob = syncEmailMessageMetricsJob;
|
|
29
|
+
this.noDuplicate = true;
|
|
25
30
|
}
|
|
26
31
|
async handle(id) {
|
|
27
32
|
const response = await this.internalServerConnectService.get('meta', `email-message/${id}`);
|
|
@@ -44,9 +49,22 @@ let ProcessServerEmailJob = class ProcessServerEmailJob extends nestjs_utility_s
|
|
|
44
49
|
message.emailed_at = payload.attributes?.date || null;
|
|
45
50
|
const parent = await this.getParentDetails(message);
|
|
46
51
|
message.parent_id = parent?.parent_id || parent?.id || null;
|
|
47
|
-
|
|
52
|
+
try {
|
|
53
|
+
await message.save();
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
if (e instanceof typeorm_1.QueryFailedError && e.driverError?.code === PG_UNIQUE_VIOLATION) {
|
|
57
|
+
const existing = await email_message_entity_1.EmailMessageEntity.findOne({
|
|
58
|
+
where: { email_id: email.id, identifier: payload.identifier, deleted_at: (0, typeorm_1.IsNull)() },
|
|
59
|
+
});
|
|
60
|
+
if (existing)
|
|
61
|
+
return existing;
|
|
62
|
+
}
|
|
63
|
+
throw e;
|
|
64
|
+
}
|
|
48
65
|
await this.setAttachments(email, message, payload.attachments);
|
|
49
66
|
await this.setRecipients(message, payload.recipients);
|
|
67
|
+
await this.syncEmailMessageMetricsJob.delayedDispatch(message.id);
|
|
50
68
|
return message;
|
|
51
69
|
}
|
|
52
70
|
async setAttachments(email, message, attachments) {
|
|
@@ -109,11 +127,8 @@ let ProcessServerEmailJob = class ProcessServerEmailJob extends nestjs_utility_s
|
|
|
109
127
|
return;
|
|
110
128
|
for (const identifier of identifiers) {
|
|
111
129
|
const parent = await email_message_entity_1.EmailMessageEntity.findOne({ where: { email_id: message.email_id, tracking_identifier: identifier } });
|
|
112
|
-
if (parent)
|
|
113
|
-
parent
|
|
114
|
-
parent.emailed_at = message.emailed_at;
|
|
115
|
-
return parent.save();
|
|
116
|
-
}
|
|
130
|
+
if (parent)
|
|
131
|
+
return parent;
|
|
117
132
|
}
|
|
118
133
|
}
|
|
119
134
|
getMessageIdentifier(payload) {
|
|
@@ -128,6 +143,7 @@ exports.ProcessServerEmailJob = ProcessServerEmailJob = __decorate([
|
|
|
128
143
|
(0, common_1.Injectable)(),
|
|
129
144
|
__metadata("design:paramtypes", [nestjs_utility_services_1.QueueService,
|
|
130
145
|
nestjs_utility_services_1.UploadService,
|
|
131
|
-
nestjs_utility_services_1.InternalServerConnectService
|
|
146
|
+
nestjs_utility_services_1.InternalServerConnectService,
|
|
147
|
+
sync_email_message_metrics_job_1.SyncEmailMessageMetricsJob])
|
|
132
148
|
], ProcessServerEmailJob);
|
|
133
149
|
//# sourceMappingURL=process.server.email.job.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.server.email.job.js","sourceRoot":"","sources":["../../../src/access/jobs/process.server.email.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAQgD;
|
|
1
|
+
{"version":3,"file":"process.server.email.job.js","sourceRoot":"","sources":["../../../src/access/jobs/process.server.email.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAQgD;AAChD,qCAAmD;AAInD,6EAAwE;AACxE,iFAA4E;AAC5E,2EAAsE;AACtE,+EAA0E;AAC1E,qFAA8E;AAE9E,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAO7B,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,mCAAS;IAGhD,YACuB,YAA0B,EAC5B,aAA4B,EAC1B,4BAA0D,EAC5D,0BAAsD;QAEvE,KAAK,CAAC,kCAAkC,CAAC,CAAC;QALvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,kBAAa,GAAb,aAAa,CAAe;QAC1B,iCAA4B,GAA5B,4BAA4B,CAA8B;QAC5D,+BAA0B,GAA1B,0BAA0B,CAA4B;QANjE,gBAAW,GAAG,IAAI,CAAC;IAS7B,CAAC;IAOD,KAAK,CAAC,MAAM,CAAC,EAAU;QACnB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAE5F,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,QAAQ;YAAE,OAAO,IAAI,CAAC;QAEjC,MAAM,KAAK,GAAG,MAAM,2CAAmB,CAAC,O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,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;YACtC,OAAO,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC;QAChC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,CAAC,MAAM;YAAE,OAAO;QAEhC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,yCAAkB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;YAE5H,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAC;QAC9B,CAAC;IACL,CAAC;IAQO,oBAAoB,CAAC,OAA8B;QACvD,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC;QAC1E,IAAI,CAAC,WAAW,IAAI,UAAU,EAAE,MAAM,KAAK,CAAC;YAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;QAEnE,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAA;AAjNY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAK4B,sCAAY;QACb,uCAAa;QACI,sDAA4B;QAChC,2DAA0B;GAPlE,qBAAqB,CAiNjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommonJob, QueueService, SqlService } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
export declare class SyncEmailMessageMetricsJob extends CommonJob {
|
|
3
|
+
protected readonly queueService: QueueService;
|
|
4
|
+
private readonly sqlService;
|
|
5
|
+
protected noDuplicate: boolean;
|
|
6
|
+
protected priority: number;
|
|
7
|
+
constructor(queueService: QueueService, sqlService: SqlService);
|
|
8
|
+
handle(messageId: number): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SyncEmailMessageMetricsJob = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
15
|
+
const email_message_entity_1 = require("../entities/email.message.entity");
|
|
16
|
+
let SyncEmailMessageMetricsJob = class SyncEmailMessageMetricsJob extends nestjs_utility_services_1.CommonJob {
|
|
17
|
+
constructor(queueService, sqlService) {
|
|
18
|
+
super('c3e4f62852e680385209f29408ded443');
|
|
19
|
+
this.queueService = queueService;
|
|
20
|
+
this.sqlService = sqlService;
|
|
21
|
+
this.noDuplicate = true;
|
|
22
|
+
this.priority = 10;
|
|
23
|
+
}
|
|
24
|
+
async handle(messageId) {
|
|
25
|
+
if (!messageId)
|
|
26
|
+
return;
|
|
27
|
+
const id = +messageId;
|
|
28
|
+
const stats = await this.sqlService.readFirst(`select
|
|
29
|
+
(select count(1) from bz_email_messages where parent_id = ${id} and deleted_at is null) as threads_count,
|
|
30
|
+
(select max(emailed_at) from bz_email_messages where parent_id = ${id} and deleted_at is null) as last_thread_at,
|
|
31
|
+
(select count(1) from bz_email_attachments where message_id = ${id} and deleted_at is null) as attachments_count,
|
|
32
|
+
(select count(1) from bz_email_recipients where message_id = ${id} and deleted_at is null) as recipients_count`);
|
|
33
|
+
const message = await email_message_entity_1.EmailMessageEntity.first(id);
|
|
34
|
+
if (!message)
|
|
35
|
+
return;
|
|
36
|
+
const threadsCount = +stats.threads_count;
|
|
37
|
+
const lastThreadAt = stats.last_thread_at ?? null;
|
|
38
|
+
const isVisible = threadsCount > 0 ? true : message.is_visible;
|
|
39
|
+
const attachmentsCount = +stats.attachments_count;
|
|
40
|
+
const recipientsCount = +stats.recipients_count;
|
|
41
|
+
const prevAttachmentsCount = message.attributes?.attachments_count ?? null;
|
|
42
|
+
const prevRecipientsCount = message.attributes?.recipients_count ?? null;
|
|
43
|
+
const lastChanged = (message.last_thread_at?.getTime?.() ?? null) !== (lastThreadAt?.getTime?.() ?? null);
|
|
44
|
+
const dirty = threadsCount !== message.threads_count ||
|
|
45
|
+
lastChanged ||
|
|
46
|
+
isVisible !== message.is_visible ||
|
|
47
|
+
attachmentsCount !== prevAttachmentsCount ||
|
|
48
|
+
recipientsCount !== prevRecipientsCount;
|
|
49
|
+
if (!dirty)
|
|
50
|
+
return;
|
|
51
|
+
message.threads_count = threadsCount;
|
|
52
|
+
message.last_thread_at = lastThreadAt;
|
|
53
|
+
message.is_visible = isVisible;
|
|
54
|
+
message.attributes = { ...message.attributes, attachments_count: attachmentsCount, recipients_count: recipientsCount };
|
|
55
|
+
await message.save();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.SyncEmailMessageMetricsJob = SyncEmailMessageMetricsJob;
|
|
59
|
+
exports.SyncEmailMessageMetricsJob = SyncEmailMessageMetricsJob = __decorate([
|
|
60
|
+
(0, common_1.Injectable)(),
|
|
61
|
+
__metadata("design:paramtypes", [nestjs_utility_services_1.QueueService,
|
|
62
|
+
nestjs_utility_services_1.SqlService])
|
|
63
|
+
], SyncEmailMessageMetricsJob);
|
|
64
|
+
//# sourceMappingURL=sync.email.message.metrics.job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.email.message.metrics.job.js","sourceRoot":"","sources":["../../../src/access/jobs/sync.email.message.metrics.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAA6F;AAC7F,2EAAsE;AAoB/D,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,mCAAS;IAIrD,YACuB,YAA0B,EAC5B,UAAsB;QAEvC,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAHvB,iBAAY,GAAZ,YAAY,CAAc;QAC5B,eAAU,GAAV,UAAU,CAAY;QALjC,gBAAW,GAAG,IAAI,CAAC;QACnB,aAAQ,GAAG,EAAE,CAAC;IAOxB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC1B,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC;QAEtB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CACzC;4EACgE,EAAE;mFACK,EAAE;gFACL,EAAE;+EACH,EAAE,8CAA8C,CACtH,CAAC;QAEF,MAAM,OAAO,GAAG,MAAM,yCAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC;QAC1C,MAAM,YAAY,GAAgB,KAAK,CAAC,cAAc,IAAI,IAAI,CAAC;QAC/D,MAAM,SAAS,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC/D,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAClD,MAAM,eAAe,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC;QAEhD,MAAM,oBAAoB,GAAG,OAAO,CAAC,UAAU,EAAE,iBAAiB,IAAI,IAAI,CAAC;QAC3E,MAAM,mBAAmB,GAAG,OAAO,CAAC,UAAU,EAAE,gBAAgB,IAAI,IAAI,CAAC;QACzE,MAAM,WAAW,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,IAAI,IAAI,CAAC,CAAC;QAE1G,MAAM,KAAK,GACP,YAAY,KAAK,OAAO,CAAC,aAAa;YACtC,WAAW;YACX,SAAS,KAAK,OAAO,CAAC,UAAU;YAChC,gBAAgB,KAAK,oBAAoB;YACzC,eAAe,KAAK,mBAAmB,CAAC;QAE5C,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,OAAO,CAAC,aAAa,GAAG,YAAY,CAAC;QACrC,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC;QACtC,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;QAC/B,OAAO,CAAC,UAAU,GAAG,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;QAEvH,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACJ,CAAA;AArDY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;qCAM4B,sCAAY;QAChB,oCAAU;GANlC,0BAA0B,CAqDtC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { UploadService } from '@servicelabsco/nestjs-utility-services';
|
|
2
2
|
import { EmailMessageEntity } from '../entities/email.message.entity';
|
|
3
|
+
import { SyncEmailMessageMetricsJob } from '../jobs/sync.email.message.metrics.job';
|
|
3
4
|
import { GmailIntegrationService } from '../services/gmail.integration.service';
|
|
4
5
|
export declare class ProcessGmailMessage {
|
|
5
6
|
private readonly gmailIntegrationService;
|
|
6
7
|
private readonly uploadService;
|
|
7
|
-
|
|
8
|
+
private readonly syncEmailMessageMetricsJob;
|
|
9
|
+
constructor(gmailIntegrationService: GmailIntegrationService, uploadService: UploadService, syncEmailMessageMetricsJob: SyncEmailMessageMetricsJob);
|
|
8
10
|
process(payload: any, email_id: number): Promise<EmailMessageEntity>;
|
|
9
11
|
private parseHeaders;
|
|
10
12
|
private extractEmail;
|
|
@@ -12,10 +14,11 @@ export declare class ProcessGmailMessage {
|
|
|
12
14
|
private extractBody;
|
|
13
15
|
private decodeBase64;
|
|
14
16
|
private uploadBody;
|
|
15
|
-
private
|
|
17
|
+
private saveAttachments;
|
|
16
18
|
private extractAttachments;
|
|
17
19
|
private saveAttachment;
|
|
18
|
-
private
|
|
20
|
+
private collectRecipients;
|
|
21
|
+
private saveRecipients;
|
|
19
22
|
private parseRecipients;
|
|
20
23
|
private getSenderId;
|
|
21
24
|
private getParentDetails;
|
|
@@ -2,20 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProcessGmailMessage = void 0;
|
|
4
4
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
5
6
|
const business_email_entity_1 = require("../entities/business.email.entity");
|
|
6
7
|
const email_attachment_entity_1 = require("../entities/email.attachment.entity");
|
|
7
8
|
const email_message_entity_1 = require("../entities/email.message.entity");
|
|
8
9
|
const email_recipient_entity_1 = require("../entities/email.recipient.entity");
|
|
10
|
+
const PG_UNIQUE_VIOLATION = '23505';
|
|
9
11
|
class ProcessGmailMessage {
|
|
10
|
-
constructor(gmailIntegrationService, uploadService) {
|
|
12
|
+
constructor(gmailIntegrationService, uploadService, syncEmailMessageMetricsJob) {
|
|
11
13
|
this.gmailIntegrationService = gmailIntegrationService;
|
|
12
14
|
this.uploadService = uploadService;
|
|
15
|
+
this.syncEmailMessageMetricsJob = syncEmailMessageMetricsJob;
|
|
13
16
|
}
|
|
14
17
|
async process(payload, email_id) {
|
|
15
18
|
const email = await business_email_entity_1.BusinessEmailEntity.findOne({ where: { id: email_id }, relations: ['business'] });
|
|
16
19
|
if (!email)
|
|
17
20
|
throw new Error('Business email not found');
|
|
18
21
|
const headers = this.parseHeaders(payload.payload.headers);
|
|
22
|
+
const attachmentInputs = this.extractAttachments(payload.payload);
|
|
23
|
+
const recipientInputs = this.collectRecipients(headers);
|
|
19
24
|
const message = await email_message_entity_1.EmailMessageEntity.firstOrNew({ email_id: email.id, identifier: payload.id });
|
|
20
25
|
message.subject = headers.subject;
|
|
21
26
|
message.from_email = this.extractEmail(headers.from);
|
|
@@ -34,15 +39,26 @@ class ProcessGmailMessage {
|
|
|
34
39
|
references: headers.references ? headers.references.split(' ').filter((r) => r) : [],
|
|
35
40
|
date: headers.date,
|
|
36
41
|
from_name: this.extractName(headers.from),
|
|
37
|
-
attachments_count: 0,
|
|
38
|
-
recipients_count: 0,
|
|
39
42
|
};
|
|
40
43
|
message.attributes = { ...message.attributes, ...attributes };
|
|
41
44
|
const parent = await this.getParentDetails(message);
|
|
42
45
|
message.parent_id = parent?.parent_id || parent?.id || null;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
await message.save();
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
if (e instanceof typeorm_1.QueryFailedError && e.driverError?.code === PG_UNIQUE_VIOLATION) {
|
|
51
|
+
const existing = await email_message_entity_1.EmailMessageEntity.findOne({
|
|
52
|
+
where: { email_id: email.id, identifier: payload.id, deleted_at: (0, typeorm_1.IsNull)() },
|
|
53
|
+
});
|
|
54
|
+
if (existing)
|
|
55
|
+
return existing;
|
|
56
|
+
}
|
|
57
|
+
throw e;
|
|
58
|
+
}
|
|
59
|
+
await this.saveAttachments(email, message, payload.id, attachmentInputs);
|
|
60
|
+
await this.saveRecipients(message, recipientInputs);
|
|
61
|
+
await this.syncEmailMessageMetricsJob.delayedDispatch(message.id);
|
|
46
62
|
return message;
|
|
47
63
|
}
|
|
48
64
|
parseHeaders(headers) {
|
|
@@ -103,16 +119,9 @@ class ProcessGmailMessage {
|
|
|
103
119
|
};
|
|
104
120
|
return this.uploadService.upload({ buffer, originalname }, params);
|
|
105
121
|
}
|
|
106
|
-
async
|
|
107
|
-
const attachments = this.extractAttachments(payload.payload);
|
|
108
|
-
let count = 0;
|
|
122
|
+
async saveAttachments(email, message, gmailMessageId, attachments) {
|
|
109
123
|
for (const attachment of attachments) {
|
|
110
|
-
await this.saveAttachment(email, message,
|
|
111
|
-
count++;
|
|
112
|
-
}
|
|
113
|
-
if (count > 0) {
|
|
114
|
-
message.attributes = { ...message.attributes, attachments_count: count };
|
|
115
|
-
await message.save();
|
|
124
|
+
await this.saveAttachment(email, message, gmailMessageId, attachment);
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
extractAttachments(payload) {
|
|
@@ -154,16 +163,17 @@ class ProcessGmailMessage {
|
|
|
154
163
|
attachmentEntity.attributes = { ...attachmentEntity.attributes, size: attachment.size };
|
|
155
164
|
await attachmentEntity.save();
|
|
156
165
|
}
|
|
157
|
-
|
|
166
|
+
collectRecipients(headers) {
|
|
158
167
|
const recipients = [];
|
|
159
168
|
if (headers.to) {
|
|
160
|
-
|
|
161
|
-
recipients.push(...toRecipients.map((r) => ({ ...r, type: 'to' })));
|
|
169
|
+
recipients.push(...this.parseRecipients(headers.to).map((r) => ({ ...r, type: 'to' })));
|
|
162
170
|
}
|
|
163
171
|
if (headers.cc) {
|
|
164
|
-
|
|
165
|
-
recipients.push(...ccRecipients.map((r) => ({ ...r, type: 'cc' })));
|
|
172
|
+
recipients.push(...this.parseRecipients(headers.cc).map((r) => ({ ...r, type: 'cc' })));
|
|
166
173
|
}
|
|
174
|
+
return recipients;
|
|
175
|
+
}
|
|
176
|
+
async saveRecipients(message, recipients) {
|
|
167
177
|
for (const recipient of recipients) {
|
|
168
178
|
const recipientEntity = await email_recipient_entity_1.EmailRecipientEntity.firstOrNew({
|
|
169
179
|
message_id: message.id,
|
|
@@ -173,10 +183,6 @@ class ProcessGmailMessage {
|
|
|
173
183
|
recipientEntity.attributes = { ...recipientEntity.attributes, name: recipient.name };
|
|
174
184
|
await recipientEntity.save();
|
|
175
185
|
}
|
|
176
|
-
if (recipients.length > 0) {
|
|
177
|
-
message.attributes = { ...message.attributes, recipients_count: recipients.length };
|
|
178
|
-
await message.save();
|
|
179
|
-
}
|
|
180
186
|
}
|
|
181
187
|
parseRecipients(recipientHeader) {
|
|
182
188
|
if (!recipientHeader)
|
|
@@ -212,12 +218,8 @@ class ProcessGmailMessage {
|
|
|
212
218
|
const parent = await email_message_entity_1.EmailMessageEntity.findOne({
|
|
213
219
|
where: { email_id: message.email_id, tracking_identifier: identifier },
|
|
214
220
|
});
|
|
215
|
-
if (parent)
|
|
216
|
-
parent.is_visible = true;
|
|
217
|
-
parent.emailed_at = message.emailed_at;
|
|
218
|
-
await parent.save();
|
|
221
|
+
if (parent)
|
|
219
222
|
return parent;
|
|
220
|
-
}
|
|
221
223
|
}
|
|
222
224
|
return null;
|
|
223
225
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.gmail.message.js","sourceRoot":"","sources":["../../../src/access/libraries/process.gmail.message.ts"],"names":[],"mappings":";;;AAAA,oFAAwH;
|
|
1
|
+
{"version":3,"file":"process.gmail.message.js","sourceRoot":"","sources":["../../../src/access/libraries/process.gmail.message.ts"],"names":[],"mappings":";;;AAAA,oFAAwH;AACxH,qCAAmD;AAEnD,6EAAwE;AACxE,iFAA4E;AAC5E,2EAAsE;AACtE,+EAA0E;AAI1E,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,MAAa,mBAAmB;IAC5B,YACqB,uBAAgD,EAChD,aAA4B,EAC5B,0BAAsD;QAFtD,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,kBAAa,GAAb,aAAa,CAAe;QAC5B,+BAA0B,GAA1B,0BAA0B,CAA4B;IACxE,CAAC;IAOJ,KAAK,CAAC,OA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E,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/C,IAAI,UAAU,EAAE,MAAM;YAAE,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAErE,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,WAAW,CAAC,MAAM;YAAE,OAAO,IAAI,CAAC;QAErC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,MAAM,MAAM,GAAG,MAAM,yCAAkB,CAAC,OAAO,CAAC;gBAC5C,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,UAAU,EAAE;aACzE,CAAC,CAAC;YAEH,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAC;QAC9B,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAxTD,kDAwTC"}
|
|
@@ -90,6 +90,7 @@ import { SlackUserJob } from '../jobs/slack.user.job';
|
|
|
90
90
|
import { SlackWebhookJob } from '../jobs/slack.webhook.job';
|
|
91
91
|
import { SlackWebhookMessageJob } from '../jobs/slack.webhook.message.job';
|
|
92
92
|
import { SyncBURoleJob } from '../jobs/sync.b.u.role.job';
|
|
93
|
+
import { SyncEmailMessageMetricsJob } from '../jobs/sync.email.message.metrics.job';
|
|
93
94
|
import { SyncEmailMessagesJob } from '../jobs/sync.email.messages.job';
|
|
94
95
|
import { SyncMenuJob } from '../jobs/sync.menu.job';
|
|
95
96
|
import { UiActionJob } from '../jobs/ui.action.job';
|
|
@@ -201,6 +202,7 @@ export declare class Es6JobsService {
|
|
|
201
202
|
private readonly slackWebhookJob;
|
|
202
203
|
private readonly slackWebhookMessageJob;
|
|
203
204
|
private readonly syncBURoleJob;
|
|
205
|
+
private readonly syncEmailMessageMetricsJob;
|
|
204
206
|
private readonly syncEmailMessagesJob;
|
|
205
207
|
private readonly syncMenuJob;
|
|
206
208
|
private readonly uiActionJob;
|
|
@@ -220,7 +222,7 @@ export declare class Es6JobsService {
|
|
|
220
222
|
private readonly whatsappTemplateJob;
|
|
221
223
|
private readonly whitelistedWhatsappNumberJob;
|
|
222
224
|
private jobs;
|
|
223
|
-
constructor(accessTestJob: AccessTestJob, apiAccountJob: ApiAccountJob, appIntegrationJob: AppIntegrationJob, businessAppIntegrationCredentialJob: BusinessAppIntegrationCredentialJob, businessAppIntegrationJob: BusinessAppIntegrationJob, businessAppIntegrationMessagesJob: BusinessAppIntegrationMessagesJob, businessCurrencyJob: BusinessCurrencyJob, businessDownloadableReportJob: BusinessDownloadableReportJob, businessEmailJob: BusinessEmailJob, businessFeatureJob: BusinessFeatureJob, businessGroupRoleJob: BusinessGroupRoleJob, businessMenuJob: BusinessMenuJob, businessPreferenceJob: BusinessPreferenceJob, businessPropertyJob: BusinessPropertyJob, businessReportJob: BusinessReportJob, businessScriptJob: BusinessScriptJob, businessUserGroupJob: BusinessUserGroupJob, businessUserJob: BusinessUserJob, businessUserNotificationPreferenceJob: BusinessUserNotificationPreferenceJob, businessUserRoleJob: BusinessUserRoleJob, businessWebhookJob: BusinessWebhookJob, bzNotificationChannelPreferenceJob: BzNotificationChannelPreferenceJob, childMenuJob: ChildMenuJob, choiceListJob: ChoiceListJob, choiceTypeJob: ChoiceTypeJob, conversationJob: ConversationJob, currencyRateJob: CurrencyRateJob, customFieldJob: CustomFieldJob, customReportJob: CustomReportJob, dashboardComponentJob: DashboardComponentJob, dashboardJob: DashboardJob, downloadLogJob: DownloadLogJob, emailAttachmentJob: EmailAttachmentJob, emailMessageJob: EmailMessageJob, emailRecipientJob: EmailRecipientJob, emailRuleJob: EmailRuleJob, emailStyleJob: EmailStyleJob, emailTemplateLogJob: EmailTemplateLogJob, emailTemplateRecipientJob: EmailTemplateRecipientJob, evaluateEmailRuleJob: EvaluateEmailRuleJob, executeBusinessScriptJob: ExecuteBusinessScriptJob, executionLogJob: ExecutionLogJob, fcmMessageJob: FcmMessageJob, fcmNotificationJob: FcmNotificationJob, fcmTemplateJob: FcmTemplateJob, fcmTokenJob: FcmTokenJob, featureJob: FeatureJob, featureMenuJob: FeatureMenuJob, gchatIncomingWebhookJob: GchatIncomingWebhookJob, gchatMessageJob: GchatMessageJob, gchatTemplateJob: GchatTemplateJob, gchatUserJob: GchatUserJob, gchatWebhookJob: GchatWebhookJob, gchatWebhookMessageJob: GchatWebhookMessageJob, generateBusinessReportJob: GenerateBusinessReportJob, gmailIntegrationFetchMessagesJob: GmailIntegrationFetchMessagesJob, groupMemberJob: GroupMemberJob, groupRoleJob: GroupRoleJob, gstMappingJob: GstMappingJob, listPreferenceJob: ListPreferenceJob, listingColumnJob: ListingColumnJob, listingPageJob: ListingPageJob, listingPreferenceJob: ListingPreferenceJob, lockScriptJob: LockScriptJob, menuActionJob: MenuActionJob, menuJob: MenuJob, menuRoleJob: MenuRoleJob, moduleJob: ModuleJob, moduleMenuJob: ModuleMenuJob, onholdDocumentJob: OnholdDocumentJob, overridingScriptJob: OverridingScriptJob, preferenceUserGroupJob: PreferenceUserGroupJob, preferenceUsersJob: PreferenceUsersJob, processServerEmailJob: ProcessServerEmailJob, productJob: ProductJob, reportLogJob: ReportLogJob, requestLogJob: RequestLogJob, roleGroupJob: RoleGroupJob, scheduledReportEmailJob: ScheduledReportEmailJob, scheduledReportItemJob: ScheduledReportItemJob, scheduledReportJob: ScheduledReportJob, sendBusinessReportNotificationJob: SendBusinessReportNotificationJob, setBusinessScriptScheduleJob: SetBusinessScriptScheduleJob, setEmailUnreadCountJob: SetEmailUnreadCountJob, slackIncomingWebhookJob: SlackIncomingWebhookJob, slackIntegrationJob: SlackIntegrationJob, slackMessageJob: SlackMessageJob, slackTemplateJob: SlackTemplateJob, slackUserJob: SlackUserJob, slackWebhookJob: SlackWebhookJob, slackWebhookMessageJob: SlackWebhookMessageJob, syncBURoleJob: SyncBURoleJob, syncEmailMessagesJob: SyncEmailMessagesJob, syncMenuJob: SyncMenuJob, uiActionJob: UiActionJob, uiActionRoleJob: UiActionRoleJob, userBusinessSecretJob: UserBusinessSecretJob, userNotificationJob: UserNotificationJob, userPreferenceJob: UserPreferenceJob, userRoleJob: UserRoleJob, watchlistAssignmentJob: WatchlistAssignmentJob, webhookEventJob: WebhookEventJob, webhookLogJob: WebhookLogJob, webhookSlugJob: WebhookSlugJob, webhookTypeJob: WebhookTypeJob, whatsappIncomingWebhookJob: WhatsappIncomingWebhookJob, whatsappMessageJob: WhatsappMessageJob, whatsappMessagePayloadDto: WhatsappMessagePayloadDto, whatsappTemplateJob: WhatsappTemplateJob, whitelistedWhatsappNumberJob: WhitelistedWhatsappNumberJob);
|
|
225
|
+
constructor(accessTestJob: AccessTestJob, apiAccountJob: ApiAccountJob, appIntegrationJob: AppIntegrationJob, businessAppIntegrationCredentialJob: BusinessAppIntegrationCredentialJob, businessAppIntegrationJob: BusinessAppIntegrationJob, businessAppIntegrationMessagesJob: BusinessAppIntegrationMessagesJob, businessCurrencyJob: BusinessCurrencyJob, businessDownloadableReportJob: BusinessDownloadableReportJob, businessEmailJob: BusinessEmailJob, businessFeatureJob: BusinessFeatureJob, businessGroupRoleJob: BusinessGroupRoleJob, businessMenuJob: BusinessMenuJob, businessPreferenceJob: BusinessPreferenceJob, businessPropertyJob: BusinessPropertyJob, businessReportJob: BusinessReportJob, businessScriptJob: BusinessScriptJob, businessUserGroupJob: BusinessUserGroupJob, businessUserJob: BusinessUserJob, businessUserNotificationPreferenceJob: BusinessUserNotificationPreferenceJob, businessUserRoleJob: BusinessUserRoleJob, businessWebhookJob: BusinessWebhookJob, bzNotificationChannelPreferenceJob: BzNotificationChannelPreferenceJob, childMenuJob: ChildMenuJob, choiceListJob: ChoiceListJob, choiceTypeJob: ChoiceTypeJob, conversationJob: ConversationJob, currencyRateJob: CurrencyRateJob, customFieldJob: CustomFieldJob, customReportJob: CustomReportJob, dashboardComponentJob: DashboardComponentJob, dashboardJob: DashboardJob, downloadLogJob: DownloadLogJob, emailAttachmentJob: EmailAttachmentJob, emailMessageJob: EmailMessageJob, emailRecipientJob: EmailRecipientJob, emailRuleJob: EmailRuleJob, emailStyleJob: EmailStyleJob, emailTemplateLogJob: EmailTemplateLogJob, emailTemplateRecipientJob: EmailTemplateRecipientJob, evaluateEmailRuleJob: EvaluateEmailRuleJob, executeBusinessScriptJob: ExecuteBusinessScriptJob, executionLogJob: ExecutionLogJob, fcmMessageJob: FcmMessageJob, fcmNotificationJob: FcmNotificationJob, fcmTemplateJob: FcmTemplateJob, fcmTokenJob: FcmTokenJob, featureJob: FeatureJob, featureMenuJob: FeatureMenuJob, gchatIncomingWebhookJob: GchatIncomingWebhookJob, gchatMessageJob: GchatMessageJob, gchatTemplateJob: GchatTemplateJob, gchatUserJob: GchatUserJob, gchatWebhookJob: GchatWebhookJob, gchatWebhookMessageJob: GchatWebhookMessageJob, generateBusinessReportJob: GenerateBusinessReportJob, gmailIntegrationFetchMessagesJob: GmailIntegrationFetchMessagesJob, groupMemberJob: GroupMemberJob, groupRoleJob: GroupRoleJob, gstMappingJob: GstMappingJob, listPreferenceJob: ListPreferenceJob, listingColumnJob: ListingColumnJob, listingPageJob: ListingPageJob, listingPreferenceJob: ListingPreferenceJob, lockScriptJob: LockScriptJob, menuActionJob: MenuActionJob, menuJob: MenuJob, menuRoleJob: MenuRoleJob, moduleJob: ModuleJob, moduleMenuJob: ModuleMenuJob, onholdDocumentJob: OnholdDocumentJob, overridingScriptJob: OverridingScriptJob, preferenceUserGroupJob: PreferenceUserGroupJob, preferenceUsersJob: PreferenceUsersJob, processServerEmailJob: ProcessServerEmailJob, productJob: ProductJob, reportLogJob: ReportLogJob, requestLogJob: RequestLogJob, roleGroupJob: RoleGroupJob, scheduledReportEmailJob: ScheduledReportEmailJob, scheduledReportItemJob: ScheduledReportItemJob, scheduledReportJob: ScheduledReportJob, sendBusinessReportNotificationJob: SendBusinessReportNotificationJob, setBusinessScriptScheduleJob: SetBusinessScriptScheduleJob, setEmailUnreadCountJob: SetEmailUnreadCountJob, slackIncomingWebhookJob: SlackIncomingWebhookJob, slackIntegrationJob: SlackIntegrationJob, slackMessageJob: SlackMessageJob, slackTemplateJob: SlackTemplateJob, slackUserJob: SlackUserJob, slackWebhookJob: SlackWebhookJob, slackWebhookMessageJob: SlackWebhookMessageJob, syncBURoleJob: SyncBURoleJob, syncEmailMessageMetricsJob: SyncEmailMessageMetricsJob, syncEmailMessagesJob: SyncEmailMessagesJob, syncMenuJob: SyncMenuJob, uiActionJob: UiActionJob, uiActionRoleJob: UiActionRoleJob, userBusinessSecretJob: UserBusinessSecretJob, userNotificationJob: UserNotificationJob, userPreferenceJob: UserPreferenceJob, userRoleJob: UserRoleJob, watchlistAssignmentJob: WatchlistAssignmentJob, webhookEventJob: WebhookEventJob, webhookLogJob: WebhookLogJob, webhookSlugJob: WebhookSlugJob, webhookTypeJob: WebhookTypeJob, whatsappIncomingWebhookJob: WhatsappIncomingWebhookJob, whatsappMessageJob: WhatsappMessageJob, whatsappMessagePayloadDto: WhatsappMessagePayloadDto, whatsappTemplateJob: WhatsappTemplateJob, whitelistedWhatsappNumberJob: WhitelistedWhatsappNumberJob);
|
|
224
226
|
alignJobs(): void;
|
|
225
227
|
setJobs(): void;
|
|
226
228
|
}
|
|
@@ -103,6 +103,7 @@ const slack_user_job_1 = require("../jobs/slack.user.job");
|
|
|
103
103
|
const slack_webhook_job_1 = require("../jobs/slack.webhook.job");
|
|
104
104
|
const slack_webhook_message_job_1 = require("../jobs/slack.webhook.message.job");
|
|
105
105
|
const sync_b_u_role_job_1 = require("../jobs/sync.b.u.role.job");
|
|
106
|
+
const sync_email_message_metrics_job_1 = require("../jobs/sync.email.message.metrics.job");
|
|
106
107
|
const sync_email_messages_job_1 = require("../jobs/sync.email.messages.job");
|
|
107
108
|
const sync_menu_job_1 = require("../jobs/sync.menu.job");
|
|
108
109
|
const ui_action_job_1 = require("../jobs/ui.action.job");
|
|
@@ -123,7 +124,7 @@ const whatsapp_template_job_1 = require("../jobs/whatsapp.template.job");
|
|
|
123
124
|
const whitelisted_whatsapp_number_job_1 = require("../jobs/whitelisted.whatsapp.number.job");
|
|
124
125
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
125
126
|
let Es6JobsService = class Es6JobsService {
|
|
126
|
-
constructor(accessTestJob, apiAccountJob, appIntegrationJob, businessAppIntegrationCredentialJob, businessAppIntegrationJob, businessAppIntegrationMessagesJob, businessCurrencyJob, businessDownloadableReportJob, businessEmailJob, businessFeatureJob, businessGroupRoleJob, businessMenuJob, businessPreferenceJob, businessPropertyJob, businessReportJob, businessScriptJob, businessUserGroupJob, businessUserJob, businessUserNotificationPreferenceJob, businessUserRoleJob, businessWebhookJob, bzNotificationChannelPreferenceJob, childMenuJob, choiceListJob, choiceTypeJob, conversationJob, currencyRateJob, customFieldJob, customReportJob, dashboardComponentJob, dashboardJob, downloadLogJob, emailAttachmentJob, emailMessageJob, emailRecipientJob, emailRuleJob, emailStyleJob, emailTemplateLogJob, emailTemplateRecipientJob, evaluateEmailRuleJob, executeBusinessScriptJob, executionLogJob, fcmMessageJob, fcmNotificationJob, fcmTemplateJob, fcmTokenJob, featureJob, featureMenuJob, gchatIncomingWebhookJob, gchatMessageJob, gchatTemplateJob, gchatUserJob, gchatWebhookJob, gchatWebhookMessageJob, generateBusinessReportJob, gmailIntegrationFetchMessagesJob, groupMemberJob, groupRoleJob, gstMappingJob, listPreferenceJob, listingColumnJob, listingPageJob, listingPreferenceJob, lockScriptJob, menuActionJob, menuJob, menuRoleJob, moduleJob, moduleMenuJob, onholdDocumentJob, overridingScriptJob, preferenceUserGroupJob, preferenceUsersJob, processServerEmailJob, productJob, reportLogJob, requestLogJob, roleGroupJob, scheduledReportEmailJob, scheduledReportItemJob, scheduledReportJob, sendBusinessReportNotificationJob, setBusinessScriptScheduleJob, setEmailUnreadCountJob, slackIncomingWebhookJob, slackIntegrationJob, slackMessageJob, slackTemplateJob, slackUserJob, slackWebhookJob, slackWebhookMessageJob, syncBURoleJob, syncEmailMessagesJob, syncMenuJob, uiActionJob, uiActionRoleJob, userBusinessSecretJob, userNotificationJob, userPreferenceJob, userRoleJob, watchlistAssignmentJob, webhookEventJob, webhookLogJob, webhookSlugJob, webhookTypeJob, whatsappIncomingWebhookJob, whatsappMessageJob, whatsappMessagePayloadDto, whatsappTemplateJob, whitelistedWhatsappNumberJob) {
|
|
127
|
+
constructor(accessTestJob, apiAccountJob, appIntegrationJob, businessAppIntegrationCredentialJob, businessAppIntegrationJob, businessAppIntegrationMessagesJob, businessCurrencyJob, businessDownloadableReportJob, businessEmailJob, businessFeatureJob, businessGroupRoleJob, businessMenuJob, businessPreferenceJob, businessPropertyJob, businessReportJob, businessScriptJob, businessUserGroupJob, businessUserJob, businessUserNotificationPreferenceJob, businessUserRoleJob, businessWebhookJob, bzNotificationChannelPreferenceJob, childMenuJob, choiceListJob, choiceTypeJob, conversationJob, currencyRateJob, customFieldJob, customReportJob, dashboardComponentJob, dashboardJob, downloadLogJob, emailAttachmentJob, emailMessageJob, emailRecipientJob, emailRuleJob, emailStyleJob, emailTemplateLogJob, emailTemplateRecipientJob, evaluateEmailRuleJob, executeBusinessScriptJob, executionLogJob, fcmMessageJob, fcmNotificationJob, fcmTemplateJob, fcmTokenJob, featureJob, featureMenuJob, gchatIncomingWebhookJob, gchatMessageJob, gchatTemplateJob, gchatUserJob, gchatWebhookJob, gchatWebhookMessageJob, generateBusinessReportJob, gmailIntegrationFetchMessagesJob, groupMemberJob, groupRoleJob, gstMappingJob, listPreferenceJob, listingColumnJob, listingPageJob, listingPreferenceJob, lockScriptJob, menuActionJob, menuJob, menuRoleJob, moduleJob, moduleMenuJob, onholdDocumentJob, overridingScriptJob, preferenceUserGroupJob, preferenceUsersJob, processServerEmailJob, productJob, reportLogJob, requestLogJob, roleGroupJob, scheduledReportEmailJob, scheduledReportItemJob, scheduledReportJob, sendBusinessReportNotificationJob, setBusinessScriptScheduleJob, setEmailUnreadCountJob, slackIncomingWebhookJob, slackIntegrationJob, slackMessageJob, slackTemplateJob, slackUserJob, slackWebhookJob, slackWebhookMessageJob, syncBURoleJob, syncEmailMessageMetricsJob, syncEmailMessagesJob, syncMenuJob, uiActionJob, uiActionRoleJob, userBusinessSecretJob, userNotificationJob, userPreferenceJob, userRoleJob, watchlistAssignmentJob, webhookEventJob, webhookLogJob, webhookSlugJob, webhookTypeJob, whatsappIncomingWebhookJob, whatsappMessageJob, whatsappMessagePayloadDto, whatsappTemplateJob, whitelistedWhatsappNumberJob) {
|
|
127
128
|
this.accessTestJob = accessTestJob;
|
|
128
129
|
this.apiAccountJob = apiAccountJob;
|
|
129
130
|
this.appIntegrationJob = appIntegrationJob;
|
|
@@ -216,6 +217,7 @@ let Es6JobsService = class Es6JobsService {
|
|
|
216
217
|
this.slackWebhookJob = slackWebhookJob;
|
|
217
218
|
this.slackWebhookMessageJob = slackWebhookMessageJob;
|
|
218
219
|
this.syncBURoleJob = syncBURoleJob;
|
|
220
|
+
this.syncEmailMessageMetricsJob = syncEmailMessageMetricsJob;
|
|
219
221
|
this.syncEmailMessagesJob = syncEmailMessagesJob;
|
|
220
222
|
this.syncMenuJob = syncMenuJob;
|
|
221
223
|
this.uiActionJob = uiActionJob;
|
|
@@ -332,6 +334,7 @@ let Es6JobsService = class Es6JobsService {
|
|
|
332
334
|
'9b4a1d87433737a541fd898238ba774f': this.slackWebhookJob,
|
|
333
335
|
'7f625c23ff1f3476c786c6567b6bf377': this.slackWebhookMessageJob,
|
|
334
336
|
'6bcfa2c351f27fb43727695788e994b1': this.syncBURoleJob,
|
|
337
|
+
c3e4f62852e680385209f29408ded443: this.syncEmailMessageMetricsJob,
|
|
335
338
|
f1c1038ff7ef22243f7ae35089e2e7b8: this.syncEmailMessagesJob,
|
|
336
339
|
'84854ee50710d5df991971cd82ed0422': this.syncMenuJob,
|
|
337
340
|
'7e7d83369da7953ef5749c629446db5e': this.uiActionJob,
|
|
@@ -451,6 +454,7 @@ exports.Es6JobsService = Es6JobsService = __decorate([
|
|
|
451
454
|
slack_webhook_job_1.SlackWebhookJob,
|
|
452
455
|
slack_webhook_message_job_1.SlackWebhookMessageJob,
|
|
453
456
|
sync_b_u_role_job_1.SyncBURoleJob,
|
|
457
|
+
sync_email_message_metrics_job_1.SyncEmailMessageMetricsJob,
|
|
454
458
|
sync_email_messages_job_1.SyncEmailMessagesJob,
|
|
455
459
|
sync_menu_job_1.SyncMenuJob,
|
|
456
460
|
ui_action_job_1.UiActionJob,
|