rez_core 2.2.191 → 2.2.193
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/module/communication/controller/communication.controller.d.ts +19 -4
- package/dist/module/communication/controller/communication.controller.js +49 -6
- package/dist/module/communication/controller/communication.controller.js.map +1 -1
- package/dist/module/communication/dto/create-config.dto.d.ts +16 -1
- package/dist/module/communication/dto/create-config.dto.js +51 -2
- package/dist/module/communication/dto/create-config.dto.js.map +1 -1
- package/dist/module/communication/service/communication.service.d.ts +25 -1
- package/dist/module/communication/service/communication.service.js +127 -2
- package/dist/module/communication/service/communication.service.js.map +1 -1
- package/dist/module/communication/service/wrapper.service.d.ts +28 -0
- package/dist/module/communication/service/wrapper.service.js +151 -0
- package/dist/module/communication/service/wrapper.service.js.map +1 -0
- package/dist/module/communication/strategies/communication.strategy.d.ts +12 -1
- package/dist/module/communication/strategies/communication.strategy.js +37 -0
- package/dist/module/communication/strategies/communication.strategy.js.map +1 -1
- package/dist/module/communication/strategies/email/gmail-api.strategy.d.ts +2 -0
- package/dist/module/communication/strategies/email/gmail-api.strategy.js +64 -20
- package/dist/module/communication/strategies/email/gmail-api.strategy.js.map +1 -1
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.d.ts +10 -0
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.js +61 -1
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.js.map +1 -1
- package/dist/module/workflow/service/populate-workflow.service.js +1 -1
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
- package/dist/module/workflow/service/task.service.js +3 -0
- package/dist/module/workflow/service/task.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/communication/controller/communication.controller.ts +47 -3
- package/src/module/communication/dto/create-config.dto.ts +38 -1
- package/src/module/communication/service/communication.service.ts +216 -0
- package/src/module/communication/service/wrapper.service.ts +185 -0
- package/src/module/communication/strategies/communication.strategy.ts +63 -1
- package/src/module/communication/strategies/email/gmail-api.strategy.ts +121 -24
- package/src/module/communication/strategies/email/sendgrid-api.strategy.ts +82 -2
- package/src/module/workflow/service/populate-workflow.service.ts +1 -1
- package/src/module/workflow/service/task.service.ts +3 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { CommunicationService } from '../service/communication.service';
|
|
2
|
-
import {
|
|
3
|
-
import { BulkMessageDto, CreateConfigDto, GenericSendMessageDto, GmailOAuthInitDto, OutlookOAuthInitDto, SendGridVerifiedSendersDto, UpdateConfigDto, UpdateConfigStatusDto } from '../dto/create-config.dto';
|
|
2
|
+
import { BulkMessageDto, CreateConfigDto, GenericSendMessageDto, GmailOAuthInitDto, OutlookOAuthInitDto, SendGridVerifiedSendersDto, SendGridTemplatesDto, UpdateConfigDto, UpdateConfigStatusDto } from '../dto/create-config.dto';
|
|
4
3
|
export declare class ScheduledMessageDto extends GenericSendMessageDto {
|
|
5
4
|
scheduleFor: Date;
|
|
6
5
|
timezone?: string;
|
|
7
6
|
}
|
|
8
7
|
export declare class CommunicationController {
|
|
9
8
|
private readonly communicationService;
|
|
10
|
-
|
|
11
|
-
constructor(communicationService: CommunicationService, sendGridApiStrategy: SendGridApiStrategy);
|
|
9
|
+
constructor(communicationService: CommunicationService);
|
|
12
10
|
sendMessage(sendMessageDto: GenericSendMessageDto): Promise<import("../strategies/communication.strategy").CommunicationResult>;
|
|
13
11
|
sendBulkMessage(bulkMessageDto: BulkMessageDto): Promise<{
|
|
14
12
|
results: import("../strategies/communication.strategy").CommunicationResult[];
|
|
@@ -45,6 +43,14 @@ export declare class CommunicationController {
|
|
|
45
43
|
linkedSource?: string;
|
|
46
44
|
configDetails?: any;
|
|
47
45
|
})[]>;
|
|
46
|
+
getCommunicationConfigById(hubId: number): Promise<{
|
|
47
|
+
success: boolean;
|
|
48
|
+
data: import("../entity/communication-hub.entity").CommunicationHub & {
|
|
49
|
+
config: import("../entity/communication-config.entity").CommunicationConfig;
|
|
50
|
+
linkedSource?: string;
|
|
51
|
+
configDetails?: any;
|
|
52
|
+
};
|
|
53
|
+
}>;
|
|
48
54
|
updateConfigStatus(hubId: number, updateStatusDto: UpdateConfigStatusDto): Promise<{
|
|
49
55
|
message: string;
|
|
50
56
|
}>;
|
|
@@ -73,6 +79,15 @@ export declare class CommunicationController {
|
|
|
73
79
|
}>;
|
|
74
80
|
error?: string;
|
|
75
81
|
}>;
|
|
82
|
+
getSendGridTemplates(dto: SendGridTemplatesDto): Promise<{
|
|
83
|
+
success: boolean;
|
|
84
|
+
data?: Array<{
|
|
85
|
+
id: string;
|
|
86
|
+
name: string;
|
|
87
|
+
generation: string;
|
|
88
|
+
}>;
|
|
89
|
+
error?: string;
|
|
90
|
+
}>;
|
|
76
91
|
disconnectConfig(hubId: number): Promise<{
|
|
77
92
|
success: boolean;
|
|
78
93
|
message: string;
|
|
@@ -15,15 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.CommunicationController = exports.ScheduledMessageDto = void 0;
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const communication_service_1 = require("../service/communication.service");
|
|
18
|
-
const sendgrid_api_strategy_1 = require("../strategies/email/sendgrid-api.strategy");
|
|
19
18
|
const create_config_dto_1 = require("../dto/create-config.dto");
|
|
20
19
|
class ScheduledMessageDto extends create_config_dto_1.GenericSendMessageDto {
|
|
21
20
|
}
|
|
22
21
|
exports.ScheduledMessageDto = ScheduledMessageDto;
|
|
23
22
|
let CommunicationController = class CommunicationController {
|
|
24
|
-
constructor(communicationService
|
|
23
|
+
constructor(communicationService) {
|
|
25
24
|
this.communicationService = communicationService;
|
|
26
|
-
this.sendGridApiStrategy = sendGridApiStrategy;
|
|
27
25
|
}
|
|
28
26
|
async sendMessage(sendMessageDto) {
|
|
29
27
|
return this.communicationService.sendGenericMessage(sendMessageDto);
|
|
@@ -87,6 +85,34 @@ let CommunicationController = class CommunicationController {
|
|
|
87
85
|
provider,
|
|
88
86
|
});
|
|
89
87
|
}
|
|
88
|
+
async getCommunicationConfigById(hubId) {
|
|
89
|
+
try {
|
|
90
|
+
const config = await this.communicationService.getCommunicationConfigById(hubId);
|
|
91
|
+
if (!config) {
|
|
92
|
+
throw new common_1.BadRequestException({
|
|
93
|
+
success: false,
|
|
94
|
+
error: 'NOT_FOUND',
|
|
95
|
+
message: 'Communication configuration not found',
|
|
96
|
+
code: 'CONFIGURATION_NOT_FOUND',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
success: true,
|
|
101
|
+
data: config,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
if (error instanceof common_1.BadRequestException) {
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
throw new common_1.BadRequestException({
|
|
109
|
+
success: false,
|
|
110
|
+
error: 'FETCH_ERROR',
|
|
111
|
+
message: error.message || 'Failed to fetch communication configuration',
|
|
112
|
+
code: 'INTERNAL_ERROR',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
90
116
|
async updateConfigStatus(hubId, updateStatusDto) {
|
|
91
117
|
await this.communicationService.updateConfigStatus(hubId, updateStatusDto.status);
|
|
92
118
|
return { message: 'Status updated successfully' };
|
|
@@ -105,7 +131,10 @@ let CommunicationController = class CommunicationController {
|
|
|
105
131
|
return this.communicationService.initOutlookOAuth(initDto.levelId, initDto.levelType, initDto.email);
|
|
106
132
|
}
|
|
107
133
|
async getSendGridVerifiedSenders(dto) {
|
|
108
|
-
return this.
|
|
134
|
+
return this.communicationService.getSendGridVerifiedSenders(dto.levelId, dto.levelType);
|
|
135
|
+
}
|
|
136
|
+
async getSendGridTemplates(dto) {
|
|
137
|
+
return this.communicationService.getSendGridTemplates(dto.levelId, dto.levelType);
|
|
109
138
|
}
|
|
110
139
|
async disconnectConfig(hubId) {
|
|
111
140
|
try {
|
|
@@ -200,6 +229,13 @@ __decorate([
|
|
|
200
229
|
__metadata("design:paramtypes", [Number, String, String, String, String]),
|
|
201
230
|
__metadata("design:returntype", Promise)
|
|
202
231
|
], CommunicationController.prototype, "getLevelConfigs", null);
|
|
232
|
+
__decorate([
|
|
233
|
+
(0, common_1.Get)('config/:id'),
|
|
234
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
235
|
+
__metadata("design:type", Function),
|
|
236
|
+
__metadata("design:paramtypes", [Number]),
|
|
237
|
+
__metadata("design:returntype", Promise)
|
|
238
|
+
], CommunicationController.prototype, "getCommunicationConfigById", null);
|
|
203
239
|
__decorate([
|
|
204
240
|
(0, common_1.Put)('config/:id/status'),
|
|
205
241
|
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
@@ -246,6 +282,14 @@ __decorate([
|
|
|
246
282
|
__metadata("design:paramtypes", [create_config_dto_1.SendGridVerifiedSendersDto]),
|
|
247
283
|
__metadata("design:returntype", Promise)
|
|
248
284
|
], CommunicationController.prototype, "getSendGridVerifiedSenders", null);
|
|
285
|
+
__decorate([
|
|
286
|
+
(0, common_1.Post)('sendgrid/templates'),
|
|
287
|
+
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
288
|
+
__param(0, (0, common_1.Body)()),
|
|
289
|
+
__metadata("design:type", Function),
|
|
290
|
+
__metadata("design:paramtypes", [create_config_dto_1.SendGridTemplatesDto]),
|
|
291
|
+
__metadata("design:returntype", Promise)
|
|
292
|
+
], CommunicationController.prototype, "getSendGridTemplates", null);
|
|
249
293
|
__decorate([
|
|
250
294
|
(0, common_1.Post)('config/delete/:hubId'),
|
|
251
295
|
(0, common_1.HttpCode)(common_1.HttpStatus.OK),
|
|
@@ -265,7 +309,6 @@ __decorate([
|
|
|
265
309
|
], CommunicationController.prototype, "updateConfig", null);
|
|
266
310
|
exports.CommunicationController = CommunicationController = __decorate([
|
|
267
311
|
(0, common_1.Controller)('communication'),
|
|
268
|
-
__metadata("design:paramtypes", [communication_service_1.CommunicationService
|
|
269
|
-
sendgrid_api_strategy_1.SendGridApiStrategy])
|
|
312
|
+
__metadata("design:paramtypes", [communication_service_1.CommunicationService])
|
|
270
313
|
], CommunicationController);
|
|
271
314
|
//# sourceMappingURL=communication.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"communication.controller.js","sourceRoot":"","sources":["../../../../src/module/communication/controller/communication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,4EAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"communication.controller.js","sourceRoot":"","sources":["../../../../src/module/communication/controller/communication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,4EAAwE;AACxE,gEAUkC;AAElC,MAAa,mBAAoB,SAAQ,yCAAqB;CAG7D;AAHD,kDAGC;AAGM,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YACmB,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAC1D,CAAC;IAIE,AAAN,KAAK,CAAC,WAAW,CAAS,cAAqC;QAC7D,OAAO,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;IACtE,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CAAS,cAA8B;QAC1D,OAAO,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IACnE,CAAC;IAIK,AAAN,KAAK,CAAC,eAAe,CAAS,mBAAwC;QACpE,OAAO,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACxE,CAAC;IAIK,AAAN,KAAK,CAAC,mBAAmB,CAEvB,eAMC;QAED,OAAO,IAAI,CAAC,oBAAoB,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACxE,CAAC;IAGK,AAAN,KAAK,CAAC,YAAY,CAAS,eAAgC;QACzD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oB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
@@ -130,14 +130,29 @@ export declare class OutlookOAuthInitDto {
|
|
|
130
130
|
email?: string;
|
|
131
131
|
}
|
|
132
132
|
export declare class SendGridVerifiedSendersDto {
|
|
133
|
-
|
|
133
|
+
levelId: number;
|
|
134
|
+
levelType: string;
|
|
135
|
+
}
|
|
136
|
+
export declare class SendGridTemplatesDto {
|
|
137
|
+
levelId: number;
|
|
138
|
+
levelType: string;
|
|
134
139
|
}
|
|
135
140
|
export declare class VerifiedSenderDto {
|
|
136
141
|
label: string;
|
|
137
142
|
value: string;
|
|
138
143
|
}
|
|
144
|
+
export declare class TemplateDto {
|
|
145
|
+
id: string;
|
|
146
|
+
name: string;
|
|
147
|
+
generation: string;
|
|
148
|
+
}
|
|
139
149
|
export declare class VerifiedSendersResponseDto {
|
|
140
150
|
success: boolean;
|
|
141
151
|
data?: VerifiedSenderDto[];
|
|
142
152
|
error?: string;
|
|
143
153
|
}
|
|
154
|
+
export declare class TemplatesResponseDto {
|
|
155
|
+
success: boolean;
|
|
156
|
+
data?: TemplateDto[];
|
|
157
|
+
error?: string;
|
|
158
|
+
}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.VerifiedSendersResponseDto = exports.VerifiedSenderDto = exports.SendGridVerifiedSendersDto = exports.OutlookOAuthInitDto = exports.OAuthCallbackDto = exports.GmailOAuthInitDto = exports.BulkMessageDto = exports.GenericSendMessageDto = exports.UpdateConfigDto = exports.UpdateConfigStatusDto = exports.CreateConfigDto = void 0;
|
|
12
|
+
exports.TemplatesResponseDto = exports.VerifiedSendersResponseDto = exports.TemplateDto = exports.VerifiedSenderDto = exports.SendGridTemplatesDto = exports.SendGridVerifiedSendersDto = exports.OutlookOAuthInitDto = exports.OAuthCallbackDto = exports.GmailOAuthInitDto = exports.BulkMessageDto = exports.GenericSendMessageDto = exports.UpdateConfigDto = exports.UpdateConfigStatusDto = exports.CreateConfigDto = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
|
14
14
|
const communication_hub_entity_1 = require("../entity/communication-hub.entity");
|
|
15
15
|
class CreateConfigDto {
|
|
@@ -276,11 +276,29 @@ __decorate([
|
|
|
276
276
|
class SendGridVerifiedSendersDto {
|
|
277
277
|
}
|
|
278
278
|
exports.SendGridVerifiedSendersDto = SendGridVerifiedSendersDto;
|
|
279
|
+
__decorate([
|
|
280
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
281
|
+
(0, class_validator_1.IsNumber)(),
|
|
282
|
+
__metadata("design:type", Number)
|
|
283
|
+
], SendGridVerifiedSendersDto.prototype, "levelId", void 0);
|
|
279
284
|
__decorate([
|
|
280
285
|
(0, class_validator_1.IsNotEmpty)(),
|
|
281
286
|
(0, class_validator_1.IsString)(),
|
|
282
287
|
__metadata("design:type", String)
|
|
283
|
-
], SendGridVerifiedSendersDto.prototype, "
|
|
288
|
+
], SendGridVerifiedSendersDto.prototype, "levelType", void 0);
|
|
289
|
+
class SendGridTemplatesDto {
|
|
290
|
+
}
|
|
291
|
+
exports.SendGridTemplatesDto = SendGridTemplatesDto;
|
|
292
|
+
__decorate([
|
|
293
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
294
|
+
(0, class_validator_1.IsNumber)(),
|
|
295
|
+
__metadata("design:type", Number)
|
|
296
|
+
], SendGridTemplatesDto.prototype, "levelId", void 0);
|
|
297
|
+
__decorate([
|
|
298
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
299
|
+
(0, class_validator_1.IsString)(),
|
|
300
|
+
__metadata("design:type", String)
|
|
301
|
+
], SendGridTemplatesDto.prototype, "levelType", void 0);
|
|
284
302
|
class VerifiedSenderDto {
|
|
285
303
|
}
|
|
286
304
|
exports.VerifiedSenderDto = VerifiedSenderDto;
|
|
@@ -292,6 +310,21 @@ __decorate([
|
|
|
292
310
|
(0, class_validator_1.IsString)(),
|
|
293
311
|
__metadata("design:type", String)
|
|
294
312
|
], VerifiedSenderDto.prototype, "value", void 0);
|
|
313
|
+
class TemplateDto {
|
|
314
|
+
}
|
|
315
|
+
exports.TemplateDto = TemplateDto;
|
|
316
|
+
__decorate([
|
|
317
|
+
(0, class_validator_1.IsString)(),
|
|
318
|
+
__metadata("design:type", String)
|
|
319
|
+
], TemplateDto.prototype, "id", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
(0, class_validator_1.IsString)(),
|
|
322
|
+
__metadata("design:type", String)
|
|
323
|
+
], TemplateDto.prototype, "name", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
(0, class_validator_1.IsString)(),
|
|
326
|
+
__metadata("design:type", String)
|
|
327
|
+
], TemplateDto.prototype, "generation", void 0);
|
|
295
328
|
class VerifiedSendersResponseDto {
|
|
296
329
|
}
|
|
297
330
|
exports.VerifiedSendersResponseDto = VerifiedSendersResponseDto;
|
|
@@ -308,4 +341,20 @@ __decorate([
|
|
|
308
341
|
(0, class_validator_1.IsString)(),
|
|
309
342
|
__metadata("design:type", String)
|
|
310
343
|
], VerifiedSendersResponseDto.prototype, "error", void 0);
|
|
344
|
+
class TemplatesResponseDto {
|
|
345
|
+
}
|
|
346
|
+
exports.TemplatesResponseDto = TemplatesResponseDto;
|
|
347
|
+
__decorate([
|
|
348
|
+
(0, class_validator_1.IsBoolean)(),
|
|
349
|
+
__metadata("design:type", Boolean)
|
|
350
|
+
], TemplatesResponseDto.prototype, "success", void 0);
|
|
351
|
+
__decorate([
|
|
352
|
+
(0, class_validator_1.IsOptional)(),
|
|
353
|
+
__metadata("design:type", Array)
|
|
354
|
+
], TemplatesResponseDto.prototype, "data", void 0);
|
|
355
|
+
__decorate([
|
|
356
|
+
(0, class_validator_1.IsOptional)(),
|
|
357
|
+
(0, class_validator_1.IsString)(),
|
|
358
|
+
__metadata("design:type", String)
|
|
359
|
+
], TemplatesResponseDto.prototype, "error", void 0);
|
|
311
360
|
//# sourceMappingURL=create-config.dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-config.dto.js","sourceRoot":"","sources":["../../../../src/module/communication/dto/create-config.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AACzB,iFAA6E;AAE7E,MAAa,eAAe;CAiG3B;AAjGD,0CAiGC;AA9FC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,kDAAuB,CAAC;;mDACI;AAKpC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;;gDACrB;AAehB;IAbC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC;QACJ,OAAO;QACP,SAAS;QACT,UAAU;QACV,QAAQ;QACR,SAAS;QACT,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;KACb,CAAC;;iDACe;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CAsDT;AAIF;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACS;AAGvB,MAAa,qBAAqB;CAIjC;AAJD,sDAIC;AADC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;qDACI;AAGjB,MAAa,eAAe;CAqE3B;AArED,0CAqEC;AAlEC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CAsDT;AAIF;IAFC,IAA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A,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;sDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACI;AAGjB,MAAa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"create-config.dto.js","sourceRoot":"","sources":["../../../../src/module/communication/dto/create-config.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AACzB,iFAA6E;AAE7E,MAAa,eAAe;CAiG3B;AAjGD,0CAiGC;AA9FC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,kDAAuB,CAAC;;mDACI;AAKpC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC,CAAC,KAAK,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;;gDACrB;AAehB;IAbC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC;QACJ,OAAO;QACP,SAAS;QACT,UAAU;QACV,QAAQ;QACR,SAAS;QACT,UAAU;QACV,QAAQ;QACR,SAAS;QACT,YAAY;KACb,CAAC;;iDACe;AAIjB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CAsDT;AAIF;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;;mDACS;AAGvB,MAAa,qBAAqB;CAIjC;AAJD,sDAIC;AADC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;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B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACI"}
|
|
@@ -5,6 +5,7 @@ import { CommunicationConfig } from '../entity/communication-config.entity';
|
|
|
5
5
|
import { CommunicationFactory } from '../factories/communication.factory';
|
|
6
6
|
import { CommunicationResult } from '../strategies/communication.strategy';
|
|
7
7
|
import { GmailApiStrategy } from '../strategies/email/gmail-api.strategy';
|
|
8
|
+
import { SendGridApiStrategy } from '../strategies/email/sendgrid-api.strategy';
|
|
8
9
|
import { CommunicationQueueService } from './communication-queue.service';
|
|
9
10
|
export interface SendMessageDto {
|
|
10
11
|
levelId: number;
|
|
@@ -55,11 +56,12 @@ export declare class CommunicationService {
|
|
|
55
56
|
private readonly configRepository;
|
|
56
57
|
private readonly communicationFactory;
|
|
57
58
|
private readonly gmailApiStrategy;
|
|
59
|
+
private readonly sendGridApiStrategy;
|
|
58
60
|
private readonly configService;
|
|
59
61
|
private readonly queueService?;
|
|
60
62
|
private readonly logger;
|
|
61
63
|
private readonly gmailOAuthStates;
|
|
62
|
-
constructor(hubRepository: Repository<CommunicationHub>, configRepository: Repository<CommunicationConfig>, communicationFactory: CommunicationFactory, gmailApiStrategy: GmailApiStrategy, configService: ConfigService, queueService?: CommunicationQueueService | undefined);
|
|
64
|
+
constructor(hubRepository: Repository<CommunicationHub>, configRepository: Repository<CommunicationConfig>, communicationFactory: CommunicationFactory, gmailApiStrategy: GmailApiStrategy, sendGridApiStrategy: SendGridApiStrategy, configService: ConfigService, queueService?: CommunicationQueueService | undefined);
|
|
63
65
|
sendMessage({ levelId, levelType, to, message, mode, priority, }: SendMessageDto): Promise<CommunicationResult>;
|
|
64
66
|
getActiveHubs(levelId: number, levelType: string, mode?: CommunicationConfigType): Promise<CommunicationHubWithConfig[]>;
|
|
65
67
|
private sortHubsByPriority;
|
|
@@ -129,4 +131,26 @@ export declare class CommunicationService {
|
|
|
129
131
|
state: string;
|
|
130
132
|
}>;
|
|
131
133
|
handleOutlookOAuthCallback(code: string, state: string): Promise<GmailSSOResult>;
|
|
134
|
+
getCommunicationConfigById(hubId: number): Promise<(CommunicationHub & {
|
|
135
|
+
config: CommunicationConfig;
|
|
136
|
+
linkedSource?: string;
|
|
137
|
+
configDetails?: any;
|
|
138
|
+
}) | null>;
|
|
139
|
+
getSendGridTemplates(levelId: number, levelType: string): Promise<{
|
|
140
|
+
success: boolean;
|
|
141
|
+
data?: Array<{
|
|
142
|
+
id: string;
|
|
143
|
+
name: string;
|
|
144
|
+
generation: string;
|
|
145
|
+
}>;
|
|
146
|
+
error?: string;
|
|
147
|
+
}>;
|
|
148
|
+
getSendGridVerifiedSenders(levelId: number, levelType: string): Promise<{
|
|
149
|
+
success: boolean;
|
|
150
|
+
data?: Array<{
|
|
151
|
+
label: string;
|
|
152
|
+
value: string;
|
|
153
|
+
}>;
|
|
154
|
+
error?: string;
|
|
155
|
+
}>;
|
|
132
156
|
}
|
|
@@ -23,13 +23,15 @@ const communication_hub_entity_1 = require("../entity/communication-hub.entity")
|
|
|
23
23
|
const communication_config_entity_1 = require("../entity/communication-config.entity");
|
|
24
24
|
const communication_factory_1 = require("../factories/communication.factory");
|
|
25
25
|
const gmail_api_strategy_1 = require("../strategies/email/gmail-api.strategy");
|
|
26
|
+
const sendgrid_api_strategy_1 = require("../strategies/email/sendgrid-api.strategy");
|
|
26
27
|
const communication_queue_service_1 = require("./communication-queue.service");
|
|
27
28
|
let CommunicationService = CommunicationService_1 = class CommunicationService {
|
|
28
|
-
constructor(hubRepository, configRepository, communicationFactory, gmailApiStrategy, configService, queueService) {
|
|
29
|
+
constructor(hubRepository, configRepository, communicationFactory, gmailApiStrategy, sendGridApiStrategy, configService, queueService) {
|
|
29
30
|
this.hubRepository = hubRepository;
|
|
30
31
|
this.configRepository = configRepository;
|
|
31
32
|
this.communicationFactory = communicationFactory;
|
|
32
33
|
this.gmailApiStrategy = gmailApiStrategy;
|
|
34
|
+
this.sendGridApiStrategy = sendGridApiStrategy;
|
|
33
35
|
this.configService = configService;
|
|
34
36
|
this.queueService = queueService;
|
|
35
37
|
this.logger = new common_1.Logger(CommunicationService_1.name);
|
|
@@ -383,6 +385,26 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
|
|
|
383
385
|
}
|
|
384
386
|
}
|
|
385
387
|
async updateConfigStatus(hubId, status) {
|
|
388
|
+
if (status === 1) {
|
|
389
|
+
const hub = await this.hubRepository.findOne({
|
|
390
|
+
where: { id: hubId },
|
|
391
|
+
});
|
|
392
|
+
if (!hub) {
|
|
393
|
+
throw new Error('Communication configuration not found');
|
|
394
|
+
}
|
|
395
|
+
const existingActiveConfig = await this.hubRepository.findOne({
|
|
396
|
+
where: {
|
|
397
|
+
level_id: hub.level_id,
|
|
398
|
+
level_type: hub.level_type,
|
|
399
|
+
communication_config_type: hub.communication_config_type,
|
|
400
|
+
status: 1,
|
|
401
|
+
id: (0, typeorm_2.Not)(hubId),
|
|
402
|
+
},
|
|
403
|
+
});
|
|
404
|
+
if (existingActiveConfig) {
|
|
405
|
+
throw new Error(`An active ${hub.communication_config_type} configuration already exists for ${hub.level_type} ${hub.level_id}. Please deactivate the existing configuration first.`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
386
408
|
await this.hubRepository.update(hubId, { status });
|
|
387
409
|
}
|
|
388
410
|
async deleteConfiguration(hubId) {
|
|
@@ -418,6 +440,20 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
|
|
|
418
440
|
config_json: updatedConfigJson,
|
|
419
441
|
});
|
|
420
442
|
}
|
|
443
|
+
if (updateData.status === 1) {
|
|
444
|
+
const existingActiveConfig = await this.hubRepository.findOne({
|
|
445
|
+
where: {
|
|
446
|
+
level_id: hub.level_id,
|
|
447
|
+
level_type: hub.level_type,
|
|
448
|
+
communication_config_type: hub.communication_config_type,
|
|
449
|
+
status: 1,
|
|
450
|
+
id: (0, typeorm_2.Not)(hubId),
|
|
451
|
+
},
|
|
452
|
+
});
|
|
453
|
+
if (existingActiveConfig) {
|
|
454
|
+
throw new Error(`An active ${hub.communication_config_type} configuration already exists for ${hub.level_type} ${hub.level_id}. Please deactivate the existing configuration first.`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
421
457
|
if (updateData.is_default === true) {
|
|
422
458
|
await this.hubRepository.update({
|
|
423
459
|
level_id: hub.level_id,
|
|
@@ -1054,17 +1090,106 @@ let CommunicationService = CommunicationService_1 = class CommunicationService {
|
|
|
1054
1090
|
throw new Error(`Failed to complete Outlook OAuth: ${error.message}`);
|
|
1055
1091
|
}
|
|
1056
1092
|
}
|
|
1093
|
+
async getCommunicationConfigById(hubId) {
|
|
1094
|
+
try {
|
|
1095
|
+
const hub = await this.hubRepository.findOne({
|
|
1096
|
+
where: { id: hubId },
|
|
1097
|
+
});
|
|
1098
|
+
if (!hub) {
|
|
1099
|
+
return null;
|
|
1100
|
+
}
|
|
1101
|
+
const config = await this.configRepository.findOne({
|
|
1102
|
+
where: { id: hub.config_id },
|
|
1103
|
+
});
|
|
1104
|
+
if (!config) {
|
|
1105
|
+
this.logger.warn(`Configuration not found for hub ${hubId} with config_id ${hub.config_id}`);
|
|
1106
|
+
return {
|
|
1107
|
+
...hub,
|
|
1108
|
+
config: null,
|
|
1109
|
+
linkedSource: 'Configuration not found',
|
|
1110
|
+
configDetails: null,
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
const linkedSource = this.extractLinkedSource(hub.communication_config_type, hub.service, hub.provider, config.config_json);
|
|
1114
|
+
const configDetails = this.extractConfigDetails(hub.communication_config_type, hub.service, hub.provider, config.config_json);
|
|
1115
|
+
return {
|
|
1116
|
+
...hub,
|
|
1117
|
+
config,
|
|
1118
|
+
linkedSource,
|
|
1119
|
+
configDetails,
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
catch (error) {
|
|
1123
|
+
this.logger.error(`Error fetching communication config by ID ${hubId}:`, error.message);
|
|
1124
|
+
throw new Error(`Failed to fetch communication configuration: ${error.message}`);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
async getSendGridTemplates(levelId, levelType) {
|
|
1128
|
+
try {
|
|
1129
|
+
const hubs = await this.getActiveHubs(levelId, levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
|
|
1130
|
+
const sendGridHub = hubs.find(hub => hub.provider === 'sendgrid');
|
|
1131
|
+
if (!sendGridHub) {
|
|
1132
|
+
return {
|
|
1133
|
+
success: false,
|
|
1134
|
+
error: 'No active SendGrid configuration found for this level',
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
const apiKey = sendGridHub.config?.config_json?.apiKey;
|
|
1138
|
+
if (!apiKey) {
|
|
1139
|
+
return {
|
|
1140
|
+
success: false,
|
|
1141
|
+
error: 'SendGrid API key not found in configuration',
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
return this.sendGridApiStrategy.getTemplates(apiKey);
|
|
1145
|
+
}
|
|
1146
|
+
catch (error) {
|
|
1147
|
+
this.logger.error(`Error fetching SendGrid templates for level ${levelId}/${levelType}:`, error.message);
|
|
1148
|
+
return {
|
|
1149
|
+
success: false,
|
|
1150
|
+
error: `Failed to fetch SendGrid templates: ${error.message}`,
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
async getSendGridVerifiedSenders(levelId, levelType) {
|
|
1155
|
+
try {
|
|
1156
|
+
const hubs = await this.getActiveHubs(levelId, levelType, communication_hub_entity_1.CommunicationConfigType.EMAIL);
|
|
1157
|
+
const sendGridHub = hubs.find(hub => hub.provider === 'sendgrid');
|
|
1158
|
+
if (!sendGridHub) {
|
|
1159
|
+
return {
|
|
1160
|
+
success: false,
|
|
1161
|
+
error: 'No active SendGrid configuration found for this level',
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
const apiKey = sendGridHub.config?.config_json?.apiKey;
|
|
1165
|
+
if (!apiKey) {
|
|
1166
|
+
return {
|
|
1167
|
+
success: false,
|
|
1168
|
+
error: 'SendGrid API key not found in configuration',
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
return this.sendGridApiStrategy.getVerifiedSenders(apiKey);
|
|
1172
|
+
}
|
|
1173
|
+
catch (error) {
|
|
1174
|
+
this.logger.error(`Error fetching SendGrid verified senders for level ${levelId}/${levelType}:`, error.message);
|
|
1175
|
+
return {
|
|
1176
|
+
success: false,
|
|
1177
|
+
error: `Failed to fetch SendGrid verified senders: ${error.message}`,
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1057
1181
|
};
|
|
1058
1182
|
exports.CommunicationService = CommunicationService;
|
|
1059
1183
|
exports.CommunicationService = CommunicationService = CommunicationService_1 = __decorate([
|
|
1060
1184
|
(0, common_1.Injectable)(),
|
|
1061
1185
|
__param(0, (0, typeorm_1.InjectRepository)(communication_hub_entity_1.CommunicationHub)),
|
|
1062
1186
|
__param(1, (0, typeorm_1.InjectRepository)(communication_config_entity_1.CommunicationConfig)),
|
|
1063
|
-
__param(
|
|
1187
|
+
__param(6, (0, common_1.Inject)((0, common_1.forwardRef)(() => communication_queue_service_1.CommunicationQueueService))),
|
|
1064
1188
|
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
1065
1189
|
typeorm_2.Repository,
|
|
1066
1190
|
communication_factory_1.CommunicationFactory,
|
|
1067
1191
|
gmail_api_strategy_1.GmailApiStrategy,
|
|
1192
|
+
sendgrid_api_strategy_1.SendGridApiStrategy,
|
|
1068
1193
|
config_1.ConfigService,
|
|
1069
1194
|
communication_queue_service_1.CommunicationQueueService])
|
|
1070
1195
|
], CommunicationService);
|