rez_core 2.2.258 → 2.2.259
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.module.js +2 -2
- package/dist/app.module.js.map +1 -1
- package/dist/module/integration/controller/calender-event.controller.js.map +1 -0
- package/dist/module/integration/controller/integration.controller.d.ts +113 -0
- package/dist/module/{communication/controller/communication.controller.js → integration/controller/integration.controller.js} +197 -75
- package/dist/module/integration/controller/integration.controller.js.map +1 -0
- package/dist/module/{communication → integration}/controller/wrapper.controller.d.ts +1 -1
- package/dist/module/integration/controller/wrapper.controller.js.map +1 -0
- package/dist/module/{communication → integration}/dto/create-config.dto.d.ts +48 -4
- package/dist/module/{communication → integration}/dto/create-config.dto.js +96 -18
- package/dist/module/integration/dto/create-config.dto.js.map +1 -0
- package/dist/module/{communication/entity/communication-config.entity.d.ts → integration/entity/integration-config.entity.d.ts} +11 -1
- package/dist/module/integration/entity/integration-config.entity.js +78 -0
- package/dist/module/integration/entity/integration-config.entity.js.map +1 -0
- package/dist/module/{communication → integration}/entity/integration-source.entity.d.ts +1 -1
- package/dist/module/{communication → integration}/entity/integration-source.entity.js +8 -8
- package/dist/module/integration/entity/integration-source.entity.js.map +1 -0
- package/dist/module/integration/entity/user-integration.entity.d.ts +23 -0
- package/dist/module/integration/entity/user-integration.entity.js +70 -0
- package/dist/module/integration/entity/user-integration.entity.js.map +1 -0
- package/dist/module/integration/examples/usage.example.d.ts +16 -0
- package/dist/module/integration/examples/usage.example.js +217 -0
- package/dist/module/integration/examples/usage.example.js.map +1 -0
- package/dist/module/{communication → integration}/factories/base.factory.d.ts +2 -2
- package/dist/module/integration/factories/base.factory.js.map +1 -0
- package/dist/module/{communication → integration}/factories/email.factory.d.ts +3 -7
- package/dist/module/{communication → integration}/factories/email.factory.js +1 -13
- package/dist/module/integration/factories/email.factory.js.map +1 -0
- package/dist/module/{communication/factories/communication.factory.d.ts → integration/factories/integration.factory.d.ts} +4 -4
- package/dist/module/{communication/factories/communication.factory.js → integration/factories/integration.factory.js} +26 -26
- package/dist/module/integration/factories/integration.factory.js.map +1 -0
- package/dist/module/integration/factories/sms.factory.d.ts +9 -0
- package/dist/module/integration/factories/sms.factory.js +26 -0
- package/dist/module/integration/factories/sms.factory.js.map +1 -0
- package/dist/module/{communication → integration}/factories/telephone.factory.d.ts +3 -5
- package/dist/module/{communication → integration}/factories/telephone.factory.js +11 -17
- package/dist/module/integration/factories/telephone.factory.js.map +1 -0
- package/dist/module/{communication → integration}/factories/whatsapp.factory.d.ts +2 -2
- package/dist/module/integration/factories/whatsapp.factory.js.map +1 -0
- package/dist/module/integration/integration.module.d.ts +2 -0
- package/dist/module/{communication/communication.module.js → integration/integration.module.js} +22 -42
- package/dist/module/integration/integration.module.js.map +1 -0
- package/dist/module/integration/service/calendar-event.service.js.map +1 -0
- package/dist/module/{communication/service/communication-queue.service.d.ts → integration/service/integration-queue.service.d.ts} +1 -1
- package/dist/module/{communication/service/communication-queue.service.js → integration/service/integration-queue.service.js} +8 -8
- package/dist/module/integration/service/integration-queue.service.js.map +1 -0
- package/dist/module/integration/service/integration.service.d.ts +155 -0
- package/dist/module/{communication/service/communication.service.js → integration/service/integration.service.js} +391 -307
- package/dist/module/integration/service/integration.service.js.map +1 -0
- package/dist/module/{communication → integration}/service/oauth.service.js +1 -1
- package/dist/module/integration/service/oauth.service.js.map +1 -0
- package/dist/module/{communication → integration}/service/wrapper.service.d.ts +4 -4
- package/dist/module/{communication → integration}/service/wrapper.service.js +25 -26
- package/dist/module/integration/service/wrapper.service.js.map +1 -0
- package/dist/module/{communication → integration}/strategies/email/gmail-api.strategy.d.ts +3 -3
- package/dist/module/{communication → integration}/strategies/email/gmail-api.strategy.js +2 -6
- package/dist/module/integration/strategies/email/gmail-api.strategy.js.map +1 -0
- package/dist/module/integration/strategies/email/outlook-api.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/email/outlook-api.strategy.js.map +1 -0
- package/dist/module/integration/strategies/email/outlook.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/email/outlook.strategy.js.map +1 -0
- package/dist/module/{communication → integration}/strategies/email/sendgrid-api.strategy.d.ts +3 -3
- package/dist/module/integration/strategies/email/sendgrid-api.strategy.js.map +1 -0
- package/dist/module/{communication/strategies/communication.strategy.d.ts → integration/strategies/integration.strategy.d.ts} +4 -3
- package/dist/module/{communication/strategies/communication.strategy.js → integration/strategies/integration.strategy.js} +1 -1
- package/dist/module/integration/strategies/integration.strategy.js.map +1 -0
- package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.d.ts +17 -0
- package/dist/module/{communication → integration}/strategies/telephone/ozonetel-voice.strategy.js +13 -5
- package/dist/module/integration/strategies/telephone/ozonetel-voice.strategy.js.map +1 -0
- package/dist/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.d.ts +6 -4
- package/dist/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.js +3 -7
- package/dist/module/integration/strategies/telephone/tubelight-voice.strategy.js.map +1 -0
- package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.d.ts +3 -3
- package/dist/module/integration/strategies/whatsapp/whatsapp-cloud.strategy.js.map +1 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.d.ts +5 -0
- package/dist/module/integration/strategies/whatsapp/whatsapp.strategy.js.map +1 -0
- package/dist/module/meta/entity/entity-master.entity.d.ts +1 -1
- package/dist/module/meta/entity/entity-master.entity.js +2 -2
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/service/entity-dynamic.service.js +47 -27
- package/dist/module/meta/service/entity-dynamic.service.js.map +1 -1
- package/dist/module/user/controller/login.controller.d.ts +3 -3
- package/dist/module/user/controller/login.controller.js +5 -5
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/user/user.module.js +2 -2
- package/dist/module/user/user.module.js.map +1 -1
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.d.ts +1 -0
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js +4 -0
- package/dist/module/workflow-automation/entity/workflow-automation-action.entity.js.map +1 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.d.ts +2 -1
- package/dist/module/workflow-automation/service/workflow-automation.service.js +8 -4
- package/dist/module/workflow-automation/service/workflow-automation.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/docs/modules/event-driven-integration-design.md +92 -0
- package/docs/modules/integration.md +197 -0
- package/package.json +1 -1
- package/src/app.module.ts +2 -2
- package/src/module/integration/controller/integration.controller.ts +411 -0
- package/src/module/{communication → integration}/dto/create-config.dto.ts +110 -18
- package/src/module/{communication/entity/communication-config.entity.ts → integration/entity/integration-config.entity.ts} +33 -6
- package/src/module/{communication → integration}/entity/integration-source.entity.ts +1 -1
- package/src/module/integration/entity/user-integration.entity.ts +71 -0
- package/src/module/integration/examples/usage.example.ts +338 -0
- package/src/module/{communication → integration}/factories/base.factory.ts +2 -2
- package/src/module/{communication → integration}/factories/email.factory.ts +2 -12
- package/src/module/{communication/factories/communication.factory.ts → integration/factories/integration.factory.ts} +18 -18
- package/src/module/integration/factories/sms.factory.ts +19 -0
- package/src/module/integration/factories/telephone.factory.ts +41 -0
- package/src/module/{communication → integration}/factories/whatsapp.factory.ts +2 -2
- package/src/module/integration/integration.module.ts +86 -0
- package/src/module/{communication/service/communication-queue.service.ts → integration/service/integration-queue.service.ts} +2 -2
- package/src/module/{communication/service/communication.service.ts → integration/service/integration.service.ts} +598 -448
- package/src/module/{communication → integration}/service/oauth.service.ts +1 -1
- package/src/module/{communication → integration}/service/wrapper.service.ts +24 -25
- package/src/module/{communication → integration}/strategies/email/gmail-api.strategy.ts +6 -18
- package/src/module/{communication → integration}/strategies/email/outlook-api.strategy.ts +5 -5
- package/src/module/{communication → integration}/strategies/email/outlook.strategy.ts +5 -5
- package/src/module/{communication → integration}/strategies/email/sendgrid-api.strategy.ts +5 -5
- package/src/module/{communication/strategies/communication.strategy.ts → integration/strategies/integration.strategy.ts} +7 -3
- package/src/module/{communication → integration}/strategies/telephone/ozonetel-voice.strategy.ts +40 -12
- package/src/module/{communication → integration}/strategies/telephone/tubelight-voice.strategy.ts +24 -17
- package/src/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.ts +5 -5
- package/src/module/{communication → integration}/strategies/whatsapp/whatsapp.strategy.ts +5 -5
- package/src/module/meta/entity/entity-master.entity.ts +2 -2
- package/src/module/meta/service/entity-dynamic.service.ts +55 -28
- package/src/module/user/controller/login.controller.ts +3 -3
- package/src/module/user/user.module.ts +2 -2
- package/src/module/workflow-automation/entity/workflow-automation-action.entity.ts +3 -0
- package/src/module/workflow-automation/service/workflow-automation.service.ts +8 -4
- package/src/resources/dev.properties.yaml +3 -3
- package/.vscode/extensions.json +0 -5
- package/dist/module/communication/communication.module.d.ts +0 -2
- package/dist/module/communication/communication.module.js.map +0 -1
- package/dist/module/communication/controller/calender-event.controller.js.map +0 -1
- package/dist/module/communication/controller/communication.controller.d.ts +0 -99
- package/dist/module/communication/controller/communication.controller.js.map +0 -1
- package/dist/module/communication/controller/wrapper.controller.js.map +0 -1
- package/dist/module/communication/dto/create-config.dto.js.map +0 -1
- package/dist/module/communication/entity/communication-config.entity.js +0 -45
- package/dist/module/communication/entity/communication-config.entity.js.map +0 -1
- package/dist/module/communication/entity/communication-hub.entity.d.ts +0 -20
- package/dist/module/communication/entity/communication-hub.entity.js +0 -115
- package/dist/module/communication/entity/communication-hub.entity.js.map +0 -1
- package/dist/module/communication/entity/integration-source.entity.js.map +0 -1
- package/dist/module/communication/examples/usage.example.d.ts +0 -11
- package/dist/module/communication/examples/usage.example.js +0 -89
- package/dist/module/communication/examples/usage.example.js.map +0 -1
- package/dist/module/communication/factories/base.factory.js.map +0 -1
- package/dist/module/communication/factories/communication.factory.js.map +0 -1
- package/dist/module/communication/factories/email.factory.js.map +0 -1
- package/dist/module/communication/factories/sms.factory.d.ts +0 -15
- package/dist/module/communication/factories/sms.factory.js +0 -49
- package/dist/module/communication/factories/sms.factory.js.map +0 -1
- package/dist/module/communication/factories/telephone.factory.js.map +0 -1
- package/dist/module/communication/factories/whatsapp.factory.js.map +0 -1
- package/dist/module/communication/service/calendar-event.service.js.map +0 -1
- package/dist/module/communication/service/communication-queue.service.js.map +0 -1
- package/dist/module/communication/service/communication.service.d.ts +0 -155
- package/dist/module/communication/service/communication.service.js.map +0 -1
- package/dist/module/communication/service/oauth.service.js.map +0 -1
- package/dist/module/communication/service/wrapper.service.js.map +0 -1
- package/dist/module/communication/strategies/communication.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/gmail-api.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.js +0 -60
- package/dist/module/communication/strategies/email/gmail-smtp-v2.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.js +0 -49
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/outlook-api.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/email/outlook-api.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/outlook-smtp.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/email/outlook-smtp.strategy.js +0 -65
- package/dist/module/communication/strategies/email/outlook-smtp.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/outlook.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/email/outlook.strategy.js.map +0 -1
- package/dist/module/communication/strategies/email/sendgrid-api.strategy.js.map +0 -1
- package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.d.ts +0 -6
- package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.js +0 -121
- package/dist/module/communication/strategies/sms/knowlarity-multi.strategy.js.map +0 -1
- package/dist/module/communication/strategies/sms/knowlarity.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/sms/knowlarity.strategy.js +0 -44
- package/dist/module/communication/strategies/sms/knowlarity.strategy.js.map +0 -1
- package/dist/module/communication/strategies/sms/twilio-v2.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/sms/twilio-v2.strategy.js +0 -48
- package/dist/module/communication/strategies/sms/twilio-v2.strategy.js.map +0 -1
- package/dist/module/communication/strategies/sms/twilio.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/sms/twilio.strategy.js +0 -44
- package/dist/module/communication/strategies/sms/twilio.strategy.js.map +0 -1
- package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.d.ts +0 -6
- package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.js +0 -121
- package/dist/module/communication/strategies/telephone/knowlarity-multi.strategy.js.map +0 -1
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js +0 -44
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js.map +0 -1
- package/dist/module/communication/strategies/telephone/ozonetel-voice.strategy.d.ts +0 -15
- package/dist/module/communication/strategies/telephone/ozonetel-voice.strategy.js.map +0 -1
- package/dist/module/communication/strategies/telephone/tubelight-voice.strategy.js.map +0 -1
- package/dist/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.js.map +0 -1
- package/dist/module/communication/strategies/whatsapp/whatsapp.strategy.d.ts +0 -5
- package/dist/module/communication/strategies/whatsapp/whatsapp.strategy.js.map +0 -1
- package/docs/modules/communication.md +0 -177
- package/src/module/communication/communication.module.ts +0 -106
- package/src/module/communication/controller/communication.controller.ts +0 -293
- package/src/module/communication/entity/communication-hub.entity.ts +0 -103
- package/src/module/communication/examples/usage.example.ts +0 -170
- package/src/module/communication/factories/sms.factory.ts +0 -44
- package/src/module/communication/factories/telephone.factory.ts +0 -49
- package/src/module/communication/strategies/email/gmail-smtp-v2.strategy.ts +0 -68
- package/src/module/communication/strategies/email/gmail-smtp.strategy.ts +0 -51
- package/src/module/communication/strategies/email/outlook-smtp.strategy.ts +0 -73
- package/src/module/communication/strategies/sms/knowlarity-multi.strategy.ts +0 -158
- package/src/module/communication/strategies/sms/knowlarity.strategy.ts +0 -44
- package/src/module/communication/strategies/sms/twilio-v2.strategy.ts +0 -47
- package/src/module/communication/strategies/sms/twilio.strategy.ts +0 -44
- package/src/module/communication/strategies/telephone/knowlarity-multi.strategy.ts +0 -158
- package/src/module/communication/strategies/telephone/knowlarity-voice.strategy.ts +0 -44
- /package/dist/module/{communication → integration}/controller/calender-event.controller.d.ts +0 -0
- /package/dist/module/{communication → integration}/controller/calender-event.controller.js +0 -0
- /package/dist/module/{communication → integration}/controller/wrapper.controller.js +0 -0
- /package/dist/module/{communication → integration}/factories/base.factory.js +0 -0
- /package/dist/module/{communication → integration}/factories/whatsapp.factory.js +0 -0
- /package/dist/module/{communication → integration}/service/calendar-event.service.d.ts +0 -0
- /package/dist/module/{communication → integration}/service/calendar-event.service.js +0 -0
- /package/dist/module/{communication → integration}/service/oauth.service.d.ts +0 -0
- /package/dist/module/{communication → integration}/strategies/email/outlook-api.strategy.js +0 -0
- /package/dist/module/{communication → integration}/strategies/email/outlook.strategy.js +0 -0
- /package/dist/module/{communication → integration}/strategies/email/sendgrid-api.strategy.js +0 -0
- /package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp-cloud.strategy.js +0 -0
- /package/dist/module/{communication → integration}/strategies/whatsapp/whatsapp.strategy.js +0 -0
- /package/src/module/{communication → integration}/controller/calender-event.controller.ts +0 -0
- /package/src/module/{communication → integration}/controller/wrapper.controller.ts +0 -0
- /package/src/module/{communication → integration}/service/calendar-event.service.ts +0 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BadRequestException,
|
|
3
|
+
Body,
|
|
4
|
+
Controller,
|
|
5
|
+
Get,
|
|
6
|
+
HttpCode,
|
|
7
|
+
HttpStatus,
|
|
8
|
+
Param,
|
|
9
|
+
ParseIntPipe,
|
|
10
|
+
Post,
|
|
11
|
+
Query,
|
|
12
|
+
} from '@nestjs/common';
|
|
13
|
+
import { IntegrationService } from '../service/integration.service';
|
|
14
|
+
import {
|
|
15
|
+
BulkMessageDto,
|
|
16
|
+
CreateConfigDto,
|
|
17
|
+
CreateUserIntegrationDto,
|
|
18
|
+
GenericSendMessageDto,
|
|
19
|
+
SendGridTemplatesDto,
|
|
20
|
+
SendGridVerifiedSendersDto,
|
|
21
|
+
UpdateConfigDto,
|
|
22
|
+
UpdateUserIntegrationDto,
|
|
23
|
+
} from '../dto/create-config.dto';
|
|
24
|
+
|
|
25
|
+
export class ScheduledMessageDto extends GenericSendMessageDto {
|
|
26
|
+
scheduleFor: Date;
|
|
27
|
+
timezone?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Controller('integration')
|
|
31
|
+
export class IntegrationController {
|
|
32
|
+
constructor(private readonly integrationService: IntegrationService) {}
|
|
33
|
+
|
|
34
|
+
@Post('send')
|
|
35
|
+
@HttpCode(HttpStatus.OK)
|
|
36
|
+
async sendMessage(@Body() sendMessageDto: GenericSendMessageDto) {
|
|
37
|
+
return this.integrationService.sendGenericMessage(sendMessageDto);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Post('send/bulk')
|
|
41
|
+
@HttpCode(HttpStatus.OK)
|
|
42
|
+
async sendBulkMessage(@Body() bulkMessageDto: BulkMessageDto) {
|
|
43
|
+
return this.integrationService.sendBulkMessage(bulkMessageDto);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Post('send/scheduled')
|
|
47
|
+
@HttpCode(HttpStatus.OK)
|
|
48
|
+
async scheduleMessage(@Body() scheduledMessageDto: ScheduledMessageDto) {
|
|
49
|
+
return this.integrationService.scheduleMessage(scheduledMessageDto);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@Post('send/template')
|
|
53
|
+
@HttpCode(HttpStatus.OK)
|
|
54
|
+
async sendTemplateMessage(
|
|
55
|
+
@Body()
|
|
56
|
+
templateMessage: {
|
|
57
|
+
levelId: number;
|
|
58
|
+
levelType: string;
|
|
59
|
+
app_code: string;
|
|
60
|
+
to: string | string[];
|
|
61
|
+
templateId: string;
|
|
62
|
+
variables: Record<string, any>;
|
|
63
|
+
type?: 'EMAIL' | 'SMS' | 'WA' | 'TELEPHONE';
|
|
64
|
+
},
|
|
65
|
+
) {
|
|
66
|
+
return this.integrationService.sendTemplateMessage(templateMessage);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Post('config')
|
|
70
|
+
@HttpCode(HttpStatus.OK)
|
|
71
|
+
async createConfig(@Body() createConfigDto: CreateConfigDto) {
|
|
72
|
+
try {
|
|
73
|
+
const result = await this.integrationService.createIntegrationConfig(
|
|
74
|
+
createConfigDto.levelId,
|
|
75
|
+
createConfigDto.levelType,
|
|
76
|
+
createConfigDto.app_code,
|
|
77
|
+
createConfigDto.integration_type as
|
|
78
|
+
| 'EMAIL'
|
|
79
|
+
| 'SMS'
|
|
80
|
+
| 'WA'
|
|
81
|
+
| 'TELEPHONE',
|
|
82
|
+
createConfigDto.integration_provider,
|
|
83
|
+
createConfigDto.integration_source_id,
|
|
84
|
+
createConfigDto.config,
|
|
85
|
+
createConfigDto.priority,
|
|
86
|
+
createConfigDto.is_default,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
return result;
|
|
90
|
+
} catch (error) {
|
|
91
|
+
// Handle validation errors with BadRequest status
|
|
92
|
+
if (
|
|
93
|
+
error.message?.includes('active') &&
|
|
94
|
+
error.message?.includes('configuration already exists')
|
|
95
|
+
) {
|
|
96
|
+
throw new BadRequestException({
|
|
97
|
+
success: false,
|
|
98
|
+
error: 'DUPLICATE_CONFIGURATION',
|
|
99
|
+
message: error.message,
|
|
100
|
+
code: 'VALIDATION_ERROR',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Handle unsupported combination errors
|
|
105
|
+
if (error.message?.includes('Unsupported combination')) {
|
|
106
|
+
throw new BadRequestException({
|
|
107
|
+
success: false,
|
|
108
|
+
error: 'UNSUPPORTED_COMBINATION',
|
|
109
|
+
message: error.message,
|
|
110
|
+
code: 'VALIDATION_ERROR',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Handle OAuth redirect responses (return as success with OAuth info)
|
|
115
|
+
if (error.authUrl && error.state) {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
requiresOAuth: true,
|
|
119
|
+
authUrl: error.authUrl,
|
|
120
|
+
state: error.state,
|
|
121
|
+
message: error.message || 'OAuth authorization required',
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Handle other errors as BadRequest
|
|
126
|
+
throw new BadRequestException({
|
|
127
|
+
success: false,
|
|
128
|
+
error: 'CONFIGURATION_ERROR',
|
|
129
|
+
message:
|
|
130
|
+
error.message || 'Failed to create communication configuration',
|
|
131
|
+
code: 'INTERNAL_ERROR',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@Get('supported-combinations')
|
|
137
|
+
async getSupportedCombinations() {
|
|
138
|
+
return this.integrationService.getSupportedCombinations();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@Get('level/:id/:type/configs')
|
|
142
|
+
async getLevelConfigs(
|
|
143
|
+
@Param('id', ParseIntPipe) levelId: number,
|
|
144
|
+
@Param('type') levelType: string,
|
|
145
|
+
@Query('app_code') app_code?: string,
|
|
146
|
+
@Query('communication_config_type')
|
|
147
|
+
configType?: 'WA' | 'SMS' | 'EMAIL' | 'TELEPHONE',
|
|
148
|
+
@Query('provider') provider?: string,
|
|
149
|
+
) {
|
|
150
|
+
return this.integrationService.getLevelConfigs(levelId, levelType, {
|
|
151
|
+
app_code,
|
|
152
|
+
integration_type: configType,
|
|
153
|
+
integration_provider: provider,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@Get('config/:id')
|
|
158
|
+
async getIntegrationConfigById(@Param('id', ParseIntPipe) hubId: number) {
|
|
159
|
+
try {
|
|
160
|
+
const config =
|
|
161
|
+
await this.integrationService.getIntegrationConfigById(hubId);
|
|
162
|
+
|
|
163
|
+
if (!config) {
|
|
164
|
+
throw new BadRequestException({
|
|
165
|
+
success: false,
|
|
166
|
+
error: 'NOT_FOUND',
|
|
167
|
+
message: 'Communication configuration not found',
|
|
168
|
+
code: 'CONFIGURATION_NOT_FOUND',
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
success: true,
|
|
174
|
+
data: config,
|
|
175
|
+
};
|
|
176
|
+
} catch (error) {
|
|
177
|
+
if (error instanceof BadRequestException) {
|
|
178
|
+
throw error;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
throw new BadRequestException({
|
|
182
|
+
success: false,
|
|
183
|
+
error: 'FETCH_ERROR',
|
|
184
|
+
message: error.message || 'Failed to fetch communication configuration',
|
|
185
|
+
code: 'INTERNAL_ERROR',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@Post('config/:id/update')
|
|
191
|
+
@HttpCode(HttpStatus.OK)
|
|
192
|
+
async activateConfig(
|
|
193
|
+
@Param('id', ParseIntPipe) hubId: number,
|
|
194
|
+
@Query('status') status: string,
|
|
195
|
+
) {
|
|
196
|
+
try {
|
|
197
|
+
const statusNumber = parseInt(status, 10);
|
|
198
|
+
if (isNaN(statusNumber) || (statusNumber !== 0 && statusNumber !== 1)) {
|
|
199
|
+
throw new BadRequestException('Status must be 0 or 1');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
await this.integrationService.updateConfigStatus(hubId, statusNumber);
|
|
203
|
+
return {
|
|
204
|
+
success: true,
|
|
205
|
+
message: 'Configuration updated successfully',
|
|
206
|
+
};
|
|
207
|
+
} catch (error) {
|
|
208
|
+
throw new BadRequestException({
|
|
209
|
+
success: false,
|
|
210
|
+
error: 'UPDATE_STATUS_ERROR',
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
@Post('sendgrid/verified-senders')
|
|
216
|
+
@HttpCode(HttpStatus.OK)
|
|
217
|
+
async getSendGridVerifiedSenders(@Body() dto: SendGridVerifiedSendersDto) {
|
|
218
|
+
return this.integrationService.getSendGridVerifiedSenders(dto.apiKey);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@Post('sendgrid/templates')
|
|
222
|
+
@HttpCode(HttpStatus.OK)
|
|
223
|
+
async getSendGridTemplates(@Body() dto: SendGridTemplatesDto) {
|
|
224
|
+
return this.integrationService.getSendGridTemplates(
|
|
225
|
+
dto.levelId,
|
|
226
|
+
dto.levelType,
|
|
227
|
+
dto.app_code,
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@Post('config/delete/:configId')
|
|
232
|
+
@HttpCode(HttpStatus.OK)
|
|
233
|
+
async disconnectConfig(@Param('configId', ParseIntPipe) configId: number) {
|
|
234
|
+
try {
|
|
235
|
+
await this.integrationService.deleteConfiguration(configId);
|
|
236
|
+
|
|
237
|
+
return {
|
|
238
|
+
success: true,
|
|
239
|
+
message: 'Communication configuration deleted successfully',
|
|
240
|
+
};
|
|
241
|
+
} catch (error) {
|
|
242
|
+
throw new BadRequestException({
|
|
243
|
+
success: false,
|
|
244
|
+
error: 'DELETE_ERROR',
|
|
245
|
+
message:
|
|
246
|
+
error.message || 'Failed to delete communication configuration',
|
|
247
|
+
code: 'CONFIGURATION_ERROR',
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@Post('config/update/:hubId')
|
|
253
|
+
@HttpCode(HttpStatus.OK)
|
|
254
|
+
async updateConfig(
|
|
255
|
+
@Param('hubId', ParseIntPipe) hubId: number,
|
|
256
|
+
@Body() updateDto: UpdateConfigDto,
|
|
257
|
+
) {
|
|
258
|
+
try {
|
|
259
|
+
const result = await this.integrationService.updateConfiguration(
|
|
260
|
+
hubId,
|
|
261
|
+
updateDto,
|
|
262
|
+
);
|
|
263
|
+
|
|
264
|
+
return {
|
|
265
|
+
success: true,
|
|
266
|
+
message: 'Communication configuration updated successfully',
|
|
267
|
+
data: result,
|
|
268
|
+
};
|
|
269
|
+
} catch (error) {
|
|
270
|
+
throw new BadRequestException({
|
|
271
|
+
success: false,
|
|
272
|
+
error: 'UPDATE_ERROR',
|
|
273
|
+
message:
|
|
274
|
+
error.message || 'Failed to update communication configuration',
|
|
275
|
+
code: 'CONFIGURATION_ERROR',
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// UserIntegration Management Endpoints
|
|
281
|
+
|
|
282
|
+
@Post('user-integration')
|
|
283
|
+
@HttpCode(HttpStatus.OK)
|
|
284
|
+
async createUserIntegration(@Body() createDto: CreateUserIntegrationDto) {
|
|
285
|
+
try {
|
|
286
|
+
const result =
|
|
287
|
+
await this.integrationService.createUserIntegration(createDto);
|
|
288
|
+
return {
|
|
289
|
+
success: true,
|
|
290
|
+
message: 'User integration mapping created successfully',
|
|
291
|
+
data: result,
|
|
292
|
+
};
|
|
293
|
+
} catch (error) {
|
|
294
|
+
throw new BadRequestException({
|
|
295
|
+
success: false,
|
|
296
|
+
error: 'CREATE_USER_INTEGRATION_ERROR',
|
|
297
|
+
message: error.message || 'Failed to create user integration mapping',
|
|
298
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@Get('user-integration/user/:userId')
|
|
304
|
+
async getUserIntegrations(@Param('userId', ParseIntPipe) userId: number) {
|
|
305
|
+
try {
|
|
306
|
+
const result = await this.integrationService.getUserIntegrations(userId);
|
|
307
|
+
return {
|
|
308
|
+
success: true,
|
|
309
|
+
data: result,
|
|
310
|
+
};
|
|
311
|
+
} catch (error) {
|
|
312
|
+
throw new BadRequestException({
|
|
313
|
+
success: false,
|
|
314
|
+
error: 'GET_USER_INTEGRATIONS_ERROR',
|
|
315
|
+
message: error.message || 'Failed to fetch user integrations',
|
|
316
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
@Get('user-integration/config/:configId')
|
|
322
|
+
async getConfigUserIntegrations(
|
|
323
|
+
@Param('configId', ParseIntPipe) configId: number,
|
|
324
|
+
) {
|
|
325
|
+
try {
|
|
326
|
+
const result =
|
|
327
|
+
await this.integrationService.getConfigUserIntegrations(configId);
|
|
328
|
+
return {
|
|
329
|
+
success: true,
|
|
330
|
+
data: result,
|
|
331
|
+
};
|
|
332
|
+
} catch (error) {
|
|
333
|
+
throw new BadRequestException({
|
|
334
|
+
success: false,
|
|
335
|
+
error: 'GET_CONFIG_USER_INTEGRATIONS_ERROR',
|
|
336
|
+
message: error.message || 'Failed to fetch config user integrations',
|
|
337
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
@Post('user-integration/:id')
|
|
343
|
+
@HttpCode(HttpStatus.OK)
|
|
344
|
+
async updateUserIntegration(
|
|
345
|
+
@Param('id', ParseIntPipe) id: number,
|
|
346
|
+
@Body() updateDto: UpdateUserIntegrationDto,
|
|
347
|
+
) {
|
|
348
|
+
try {
|
|
349
|
+
const result = await this.integrationService.updateUserIntegration(
|
|
350
|
+
id,
|
|
351
|
+
updateDto,
|
|
352
|
+
);
|
|
353
|
+
return {
|
|
354
|
+
success: true,
|
|
355
|
+
message: 'User integration mapping updated successfully',
|
|
356
|
+
data: result,
|
|
357
|
+
};
|
|
358
|
+
} catch (error) {
|
|
359
|
+
throw new BadRequestException({
|
|
360
|
+
success: false,
|
|
361
|
+
error: 'UPDATE_USER_INTEGRATION_ERROR',
|
|
362
|
+
message: error.message || 'Failed to update user integration mapping',
|
|
363
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
@Post('user-integration/:id')
|
|
369
|
+
@HttpCode(HttpStatus.OK)
|
|
370
|
+
async deleteUserIntegration(@Param('id', ParseIntPipe) id: number) {
|
|
371
|
+
try {
|
|
372
|
+
await this.integrationService.deleteUserIntegration(id);
|
|
373
|
+
return {
|
|
374
|
+
success: true,
|
|
375
|
+
message: 'User integration mapping deleted successfully',
|
|
376
|
+
};
|
|
377
|
+
} catch (error) {
|
|
378
|
+
throw new BadRequestException({
|
|
379
|
+
success: false,
|
|
380
|
+
error: 'DELETE_USER_INTEGRATION_ERROR',
|
|
381
|
+
message: error.message || 'Failed to delete user integration mapping',
|
|
382
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
@Get('user-integration/:userId/:configId')
|
|
388
|
+
async getUserIntegrationByUserAndConfig(
|
|
389
|
+
@Param('userId', ParseIntPipe) userId: number,
|
|
390
|
+
@Param('configId', ParseIntPipe) configId: number,
|
|
391
|
+
) {
|
|
392
|
+
try {
|
|
393
|
+
const result =
|
|
394
|
+
await this.integrationService.getUserIntegrationByUserAndConfig(
|
|
395
|
+
userId,
|
|
396
|
+
configId,
|
|
397
|
+
);
|
|
398
|
+
return {
|
|
399
|
+
success: true,
|
|
400
|
+
data: result,
|
|
401
|
+
};
|
|
402
|
+
} catch (error) {
|
|
403
|
+
throw new BadRequestException({
|
|
404
|
+
success: false,
|
|
405
|
+
error: 'GET_USER_INTEGRATION_ERROR',
|
|
406
|
+
message: error.message || 'Failed to fetch user integration mapping',
|
|
407
|
+
code: 'USER_INTEGRATION_ERROR',
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
@@ -4,11 +4,9 @@ import {
|
|
|
4
4
|
IsString,
|
|
5
5
|
IsObject,
|
|
6
6
|
IsOptional,
|
|
7
|
-
IsEnum,
|
|
8
7
|
IsIn,
|
|
9
8
|
IsBoolean,
|
|
10
9
|
} from 'class-validator';
|
|
11
|
-
import { CommunicationConfigType } from '../entity/communication-hub.entity';
|
|
12
10
|
|
|
13
11
|
export class CreateConfigDto {
|
|
14
12
|
@IsNotEmpty()
|
|
@@ -20,28 +18,20 @@ export class CreateConfigDto {
|
|
|
20
18
|
levelType: string;
|
|
21
19
|
|
|
22
20
|
@IsNotEmpty()
|
|
23
|
-
@
|
|
24
|
-
|
|
21
|
+
@IsString()
|
|
22
|
+
app_code: string;
|
|
25
23
|
|
|
26
24
|
@IsNotEmpty()
|
|
27
25
|
@IsString()
|
|
28
|
-
|
|
29
|
-
service: string;
|
|
26
|
+
integration_type: string;
|
|
30
27
|
|
|
31
28
|
@IsNotEmpty()
|
|
32
29
|
@IsString()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'aws-ses',
|
|
39
|
-
'sendgrid',
|
|
40
|
-
'custom',
|
|
41
|
-
'generic',
|
|
42
|
-
'knowlarity',
|
|
43
|
-
])
|
|
44
|
-
provider: string;
|
|
30
|
+
integration_provider: string;
|
|
31
|
+
|
|
32
|
+
@IsNotEmpty()
|
|
33
|
+
@IsNumber()
|
|
34
|
+
integration_source_id: number;
|
|
45
35
|
|
|
46
36
|
@IsNotEmpty()
|
|
47
37
|
@IsObject()
|
|
@@ -195,6 +185,10 @@ export class GenericSendMessageDto {
|
|
|
195
185
|
@IsString()
|
|
196
186
|
levelType: string;
|
|
197
187
|
|
|
188
|
+
@IsNotEmpty()
|
|
189
|
+
@IsString()
|
|
190
|
+
app_code: string;
|
|
191
|
+
|
|
198
192
|
@IsNotEmpty()
|
|
199
193
|
to: string | string[];
|
|
200
194
|
|
|
@@ -202,6 +196,10 @@ export class GenericSendMessageDto {
|
|
|
202
196
|
@IsString()
|
|
203
197
|
message: string;
|
|
204
198
|
|
|
199
|
+
@IsOptional()
|
|
200
|
+
@IsNumber()
|
|
201
|
+
user_id?: number;
|
|
202
|
+
|
|
205
203
|
@IsOptional()
|
|
206
204
|
@IsString()
|
|
207
205
|
subject?: string;
|
|
@@ -249,6 +247,10 @@ export class BulkMessageDto {
|
|
|
249
247
|
@IsString()
|
|
250
248
|
levelType: string;
|
|
251
249
|
|
|
250
|
+
@IsNotEmpty()
|
|
251
|
+
@IsString()
|
|
252
|
+
app_code: string;
|
|
253
|
+
|
|
252
254
|
@IsNotEmpty()
|
|
253
255
|
recipients: string[];
|
|
254
256
|
|
|
@@ -256,6 +258,10 @@ export class BulkMessageDto {
|
|
|
256
258
|
@IsString()
|
|
257
259
|
message: string;
|
|
258
260
|
|
|
261
|
+
@IsOptional()
|
|
262
|
+
@IsNumber()
|
|
263
|
+
user_id?: number;
|
|
264
|
+
|
|
259
265
|
@IsOptional()
|
|
260
266
|
@IsString()
|
|
261
267
|
subject?: string;
|
|
@@ -294,6 +300,10 @@ export class GmailOAuthInitDto {
|
|
|
294
300
|
@IsString()
|
|
295
301
|
levelType: string;
|
|
296
302
|
|
|
303
|
+
@IsNotEmpty()
|
|
304
|
+
@IsString()
|
|
305
|
+
app_code: string;
|
|
306
|
+
|
|
297
307
|
@IsOptional()
|
|
298
308
|
@IsString()
|
|
299
309
|
email?: string;
|
|
@@ -318,6 +328,10 @@ export class OutlookOAuthInitDto {
|
|
|
318
328
|
@IsString()
|
|
319
329
|
levelType: string;
|
|
320
330
|
|
|
331
|
+
@IsNotEmpty()
|
|
332
|
+
@IsString()
|
|
333
|
+
app_code: string;
|
|
334
|
+
|
|
321
335
|
@IsOptional()
|
|
322
336
|
@IsString()
|
|
323
337
|
email?: string;
|
|
@@ -337,6 +351,10 @@ export class SendGridTemplatesDto {
|
|
|
337
351
|
@IsNotEmpty()
|
|
338
352
|
@IsString()
|
|
339
353
|
levelType: string;
|
|
354
|
+
|
|
355
|
+
@IsNotEmpty()
|
|
356
|
+
@IsString()
|
|
357
|
+
app_code: string;
|
|
340
358
|
}
|
|
341
359
|
|
|
342
360
|
export class VerifiedSenderDto {
|
|
@@ -381,3 +399,77 @@ export class TemplatesResponseDto {
|
|
|
381
399
|
@IsString()
|
|
382
400
|
error?: string;
|
|
383
401
|
}
|
|
402
|
+
|
|
403
|
+
export class CreateUserIntegrationDto {
|
|
404
|
+
@IsNotEmpty()
|
|
405
|
+
@IsNumber()
|
|
406
|
+
user_id: number;
|
|
407
|
+
|
|
408
|
+
@IsNotEmpty()
|
|
409
|
+
@IsNumber()
|
|
410
|
+
integration_config_id: number;
|
|
411
|
+
|
|
412
|
+
@IsOptional()
|
|
413
|
+
@IsString()
|
|
414
|
+
external_user_id?: string;
|
|
415
|
+
|
|
416
|
+
@IsOptional()
|
|
417
|
+
@IsObject()
|
|
418
|
+
external_user_data?: {
|
|
419
|
+
// Ozonetel agent mapping (admin creds like userName, campaignName stay in config)
|
|
420
|
+
agentId?: string;
|
|
421
|
+
agentEmail?: string;
|
|
422
|
+
agentPhone?: string;
|
|
423
|
+
|
|
424
|
+
// Tubelight agent mapping (admin creds like userName/password stay in config)
|
|
425
|
+
agentNumber?: string;
|
|
426
|
+
extension?: string;
|
|
427
|
+
department?: string;
|
|
428
|
+
|
|
429
|
+
// Common agent fields (no admin credentials stored here)
|
|
430
|
+
displayName?: string;
|
|
431
|
+
role?: string;
|
|
432
|
+
skillLevel?: string;
|
|
433
|
+
metadata?: any;
|
|
434
|
+
[key: string]: any;
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
@IsOptional()
|
|
438
|
+
@IsBoolean()
|
|
439
|
+
is_active?: boolean;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export class UpdateUserIntegrationDto {
|
|
443
|
+
@IsOptional()
|
|
444
|
+
@IsString()
|
|
445
|
+
external_user_id?: string;
|
|
446
|
+
|
|
447
|
+
@IsOptional()
|
|
448
|
+
@IsObject()
|
|
449
|
+
external_user_data?: {
|
|
450
|
+
// Ozonetel agent mapping (admin creds like userName, campaignName stay in config)
|
|
451
|
+
agentId?: string;
|
|
452
|
+
agentEmail?: string;
|
|
453
|
+
agentPhone?: string;
|
|
454
|
+
|
|
455
|
+
// Tubelight agent mapping (admin creds like userName/password stay in config)
|
|
456
|
+
agentNumber?: string;
|
|
457
|
+
extension?: string;
|
|
458
|
+
department?: string;
|
|
459
|
+
|
|
460
|
+
// Common agent fields (no admin credentials stored here)
|
|
461
|
+
displayName?: string;
|
|
462
|
+
role?: string;
|
|
463
|
+
skillLevel?: string;
|
|
464
|
+
metadata?: any;
|
|
465
|
+
[key: string]: any;
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
@IsOptional()
|
|
469
|
+
@IsNumber()
|
|
470
|
+
status?: number;
|
|
471
|
+
|
|
472
|
+
@IsOptional()
|
|
473
|
+
@IsBoolean()
|
|
474
|
+
is_active?: boolean;
|
|
475
|
+
}
|
|
@@ -5,16 +5,40 @@ import {
|
|
|
5
5
|
CreateDateColumn,
|
|
6
6
|
UpdateDateColumn,
|
|
7
7
|
} from 'typeorm';
|
|
8
|
-
import { IsNotEmpty, IsObject } from 'class-validator';
|
|
9
8
|
|
|
10
|
-
@Entity({ name: '
|
|
11
|
-
export class
|
|
9
|
+
@Entity({ name: 'cr_integration_config' })
|
|
10
|
+
export class IntegrationConfig {
|
|
12
11
|
@PrimaryGeneratedColumn({ name: 'id', type: 'int' })
|
|
13
12
|
id: number;
|
|
14
13
|
|
|
14
|
+
@Column({ name: 'app_code', type: 'varchar', length: 100 })
|
|
15
|
+
app_code: string;
|
|
16
|
+
|
|
17
|
+
@Column({ name: 'integration_type', type: 'varchar', length: 20 })
|
|
18
|
+
integration_type: string;
|
|
19
|
+
|
|
20
|
+
@Column({ name: 'integration_provider', type: 'varchar', length: 100 })
|
|
21
|
+
integration_provider: string;
|
|
22
|
+
|
|
23
|
+
@Column({ name: 'integration_source_id', type: 'int' })
|
|
24
|
+
integration_source_id: number;
|
|
25
|
+
|
|
26
|
+
@Column({ name: 'level_id', type: 'int' })
|
|
27
|
+
level_id: number;
|
|
28
|
+
|
|
29
|
+
@Column({ name: 'level_type', type: 'varchar', length: 100 })
|
|
30
|
+
level_type: string;
|
|
31
|
+
|
|
32
|
+
@Column({ name: 'status', type: 'tinyint', default: 1 })
|
|
33
|
+
status: number;
|
|
34
|
+
|
|
35
|
+
@Column({ name: 'priority', type: 'int', default: 1 })
|
|
36
|
+
priority: number;
|
|
37
|
+
|
|
38
|
+
@Column({ name: 'is_default', type: 'boolean', default: false })
|
|
39
|
+
is_default: boolean;
|
|
40
|
+
|
|
15
41
|
@Column({ name: 'config_json', type: 'json' })
|
|
16
|
-
@IsNotEmpty()
|
|
17
|
-
@IsObject()
|
|
18
42
|
config_json: {
|
|
19
43
|
// Gmail Config
|
|
20
44
|
clientId?: string;
|
|
@@ -63,6 +87,9 @@ export class CommunicationConfig {
|
|
|
63
87
|
voiceMessage?: string;
|
|
64
88
|
language?: string;
|
|
65
89
|
|
|
90
|
+
// User Integration
|
|
91
|
+
external_user_id?: string;
|
|
92
|
+
|
|
66
93
|
// Common fields
|
|
67
94
|
subject?: string;
|
|
68
95
|
html?: string;
|
|
@@ -83,4 +110,4 @@ export class CommunicationConfig {
|
|
|
83
110
|
type: 'datetime',
|
|
84
111
|
})
|
|
85
112
|
updated_at: Date;
|
|
86
|
-
}
|
|
113
|
+
}
|
|
@@ -2,7 +2,7 @@ import { BaseEntity } from 'src/module/meta/entity/base-entity.entity';
|
|
|
2
2
|
import { Column, Entity } from 'typeorm';
|
|
3
3
|
|
|
4
4
|
@Entity({ name: 'cr_integration_master' })
|
|
5
|
-
export class
|
|
5
|
+
export class IntegrationSource extends BaseEntity {
|
|
6
6
|
@Column({ name: 'logo', type: 'varchar', length: 100 })
|
|
7
7
|
logo: string;
|
|
8
8
|
|