rez_core 2.2.154 → 2.2.156
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 -0
- package/dist/app.module.js.map +1 -1
- package/dist/constant/global.constant.d.ts +1 -1
- package/dist/constant/global.constant.js +1 -1
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/module/auth/strategies/google.strategy.js +1 -1
- package/dist/module/auth/strategies/google.strategy.js.map +1 -1
- package/dist/module/communication/communication.module.d.ts +2 -0
- package/dist/module/communication/communication.module.js +69 -0
- package/dist/module/communication/communication.module.js.map +1 -0
- package/dist/module/communication/controller/communication.controller.d.ts +54 -0
- package/dist/module/communication/controller/communication.controller.js +148 -0
- package/dist/module/communication/controller/communication.controller.js.map +1 -0
- package/dist/module/communication/dto/create-config.dto.d.ts +91 -0
- package/dist/module/communication/dto/create-config.dto.js +243 -0
- package/dist/module/communication/dto/create-config.dto.js.map +1 -0
- package/dist/module/communication/entity/communication-config.entity.d.ts +44 -0
- package/dist/module/communication/entity/communication-config.entity.js +45 -0
- package/dist/module/communication/entity/communication-config.entity.js.map +1 -0
- package/dist/module/communication/entity/communication-hub.entity.d.ts +20 -0
- package/dist/module/communication/entity/communication-hub.entity.js +105 -0
- package/dist/module/communication/entity/communication-hub.entity.js.map +1 -0
- package/dist/module/communication/examples/usage.example.d.ts +11 -0
- package/dist/module/communication/examples/usage.example.js +89 -0
- package/dist/module/communication/examples/usage.example.js.map +1 -0
- package/dist/module/communication/factories/base.factory.d.ts +9 -0
- package/dist/module/communication/factories/base.factory.js +3 -0
- package/dist/module/communication/factories/base.factory.js.map +1 -0
- package/dist/module/communication/factories/communication.factory.d.ts +33 -0
- package/dist/module/communication/factories/communication.factory.js +104 -0
- package/dist/module/communication/factories/communication.factory.js.map +1 -0
- package/dist/module/communication/factories/email.factory.d.ts +19 -0
- package/dist/module/communication/factories/email.factory.js +61 -0
- package/dist/module/communication/factories/email.factory.js.map +1 -0
- package/dist/module/communication/factories/sms.factory.d.ts +15 -0
- package/dist/module/communication/factories/sms.factory.js +49 -0
- package/dist/module/communication/factories/sms.factory.js.map +1 -0
- package/dist/module/communication/factories/telephone.factory.d.ts +13 -0
- package/dist/module/communication/factories/telephone.factory.js +43 -0
- package/dist/module/communication/factories/telephone.factory.js.map +1 -0
- package/dist/module/communication/factories/whatsapp.factory.d.ts +13 -0
- package/dist/module/communication/factories/whatsapp.factory.js +43 -0
- package/dist/module/communication/factories/whatsapp.factory.js.map +1 -0
- package/dist/module/communication/service/communication.service.d.ts +111 -0
- package/dist/module/communication/service/communication.service.js +726 -0
- package/dist/module/communication/service/communication.service.js.map +1 -0
- package/dist/module/communication/service/oauth.service.d.ts +18 -0
- package/dist/module/communication/service/oauth.service.js +185 -0
- package/dist/module/communication/service/oauth.service.js.map +1 -0
- package/dist/module/communication/strategies/communication.strategy.d.ts +17 -0
- package/dist/module/communication/strategies/communication.strategy.js +3 -0
- package/dist/module/communication/strategies/communication.strategy.js.map +1 -0
- package/dist/module/communication/strategies/email/gmail-api.strategy.d.ts +7 -0
- package/dist/module/communication/strategies/email/gmail-api.strategy.js +135 -0
- package/dist/module/communication/strategies/email/gmail-api.strategy.js.map +1 -0
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.js +49 -0
- package/dist/module/communication/strategies/email/gmail-smtp.strategy.js.map +1 -0
- package/dist/module/communication/strategies/email/outlook-api.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/email/outlook-api.strategy.js +44 -0
- package/dist/module/communication/strategies/email/outlook-api.strategy.js.map +1 -0
- package/dist/module/communication/strategies/gmail-smtp.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/gmail-smtp.strategy.js +61 -0
- package/dist/module/communication/strategies/gmail-smtp.strategy.js.map +1 -0
- package/dist/module/communication/strategies/gmail.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/gmail.strategy.js +71 -0
- package/dist/module/communication/strategies/gmail.strategy.js.map +1 -0
- package/dist/module/communication/strategies/knowlarity.strategy.d.ts +6 -0
- package/dist/module/communication/strategies/knowlarity.strategy.js +115 -0
- package/dist/module/communication/strategies/knowlarity.strategy.js.map +1 -0
- package/dist/module/communication/strategies/outlook-smtp.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/outlook-smtp.strategy.js +66 -0
- package/dist/module/communication/strategies/outlook-smtp.strategy.js.map +1 -0
- package/dist/module/communication/strategies/outlook.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/outlook.strategy.js +64 -0
- package/dist/module/communication/strategies/outlook.strategy.js.map +1 -0
- package/dist/module/communication/strategies/sms/knowlarity.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/sms/knowlarity.strategy.js +44 -0
- package/dist/module/communication/strategies/sms/knowlarity.strategy.js.map +1 -0
- package/dist/module/communication/strategies/sms/twilio.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/sms/twilio.strategy.js +44 -0
- package/dist/module/communication/strategies/sms/twilio.strategy.js.map +1 -0
- package/dist/module/communication/strategies/sms.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/sms.strategy.js +50 -0
- package/dist/module/communication/strategies/sms.strategy.js.map +1 -0
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js +44 -0
- package/dist/module/communication/strategies/telephone/knowlarity-voice.strategy.js.map +1 -0
- package/dist/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.js +47 -0
- package/dist/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.js.map +1 -0
- package/dist/module/communication/strategies/whatsapp.strategy.d.ts +5 -0
- package/dist/module/communication/strategies/whatsapp.strategy.js +58 -0
- package/dist/module/communication/strategies/whatsapp.strategy.js.map +1 -0
- package/dist/module/meta/entity.module.js +2 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/user/controller/login.controller.d.ts +4 -2
- package/dist/module/user/controller/login.controller.js +26 -4
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/workflow/service/populate-workflow.service.js +2 -2
- package/dist/module/workflow/service/populate-workflow.service.js.map +1 -1
- package/dist/module/workflow/service/stage.service.js +1 -1
- package/dist/module/workflow/service/stage.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -1
- package/src/app.module.ts +2 -0
- package/src/constant/global.constant.ts +1 -1
- package/src/module/auth/strategies/google.strategy.ts +1 -1
- package/src/module/communication/communication.module.ts +77 -0
- package/src/module/communication/controller/communication.controller.ts +122 -0
- package/src/module/communication/dto/create-config.dto.ts +234 -0
- package/src/module/communication/entity/communication-config.entity.ts +80 -0
- package/src/module/communication/entity/communication-hub.entity.ts +77 -0
- package/src/module/communication/examples/usage.example.ts +169 -0
- package/src/module/communication/factories/base.factory.ts +7 -0
- package/src/module/communication/factories/communication.factory.ts +103 -0
- package/src/module/communication/factories/email.factory.ts +51 -0
- package/src/module/communication/factories/sms.factory.ts +41 -0
- package/src/module/communication/factories/telephone.factory.ts +34 -0
- package/src/module/communication/factories/whatsapp.factory.ts +34 -0
- package/src/module/communication/service/communication.service.ts +1118 -0
- package/src/module/communication/service/oauth.service.ts +203 -0
- package/src/module/communication/strategies/communication.strategy.ts +23 -0
- package/src/module/communication/strategies/email/gmail-api.strategy.ts +161 -0
- package/src/module/communication/strategies/email/gmail-smtp.strategy.ts +51 -0
- package/src/module/communication/strategies/email/outlook-api.strategy.ts +44 -0
- package/src/module/communication/strategies/gmail-smtp.strategy.ts +64 -0
- package/src/module/communication/strategies/gmail.strategy.ts +68 -0
- package/src/module/communication/strategies/knowlarity.strategy.ts +124 -0
- package/src/module/communication/strategies/outlook-smtp.strategy.ts +69 -0
- package/src/module/communication/strategies/outlook.strategy.ts +57 -0
- package/src/module/communication/strategies/sms/knowlarity.strategy.ts +44 -0
- package/src/module/communication/strategies/sms/twilio.strategy.ts +44 -0
- package/src/module/communication/strategies/sms.strategy.ts +44 -0
- package/src/module/communication/strategies/telephone/knowlarity-voice.strategy.ts +44 -0
- package/src/module/communication/strategies/whatsapp/whatsapp-cloud.strategy.ts +49 -0
- package/src/module/communication/strategies/whatsapp.strategy.ts +53 -0
- package/src/module/meta/entity.module.ts +2 -1
- package/src/module/user/controller/login.controller.ts +34 -3
- package/src/module/workflow/service/populate-workflow.service.ts +3 -3
- package/src/module/workflow/service/stage.service.ts +1 -1
- package/src/resources/dev.properties.yaml +1 -0
|
@@ -0,0 +1,243 @@
|
|
|
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.OutlookOAuthInitDto = exports.OAuthCallbackDto = exports.GmailOAuthInitDto = exports.BulkMessageDto = exports.GenericSendMessageDto = exports.UpdateConfigStatusDto = exports.CreateConfigDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const communication_hub_entity_1 = require("../entity/communication-hub.entity");
|
|
15
|
+
class CreateConfigDto {
|
|
16
|
+
}
|
|
17
|
+
exports.CreateConfigDto = CreateConfigDto;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
(0, class_validator_1.IsNumber)(),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], CreateConfigDto.prototype, "levelId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], CreateConfigDto.prototype, "levelType", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
(0, class_validator_1.IsEnum)(communication_hub_entity_1.CommunicationConfigType),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateConfigDto.prototype, "configType", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.IsIn)(['API', 'THIRD_PARTY', 'SMTP']),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], CreateConfigDto.prototype, "service", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
41
|
+
(0, class_validator_1.IsString)(),
|
|
42
|
+
(0, class_validator_1.IsIn)(['gmail', 'outlook', 'whatsapp', 'twilio', 'aws-ses', 'sendgrid', 'custom', 'generic', 'knowlarity']),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], CreateConfigDto.prototype, "provider", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
47
|
+
(0, class_validator_1.IsObject)(),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], CreateConfigDto.prototype, "config", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, class_validator_1.IsOptional)(),
|
|
52
|
+
(0, class_validator_1.IsNumber)(),
|
|
53
|
+
__metadata("design:type", Number)
|
|
54
|
+
], CreateConfigDto.prototype, "priority", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, class_validator_1.IsOptional)(),
|
|
57
|
+
(0, class_validator_1.IsBoolean)(),
|
|
58
|
+
__metadata("design:type", Boolean)
|
|
59
|
+
], CreateConfigDto.prototype, "is_default", void 0);
|
|
60
|
+
class UpdateConfigStatusDto {
|
|
61
|
+
}
|
|
62
|
+
exports.UpdateConfigStatusDto = UpdateConfigStatusDto;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
+
(0, class_validator_1.IsNumber)(),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], UpdateConfigStatusDto.prototype, "status", void 0);
|
|
68
|
+
class GenericSendMessageDto {
|
|
69
|
+
}
|
|
70
|
+
exports.GenericSendMessageDto = GenericSendMessageDto;
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
73
|
+
(0, class_validator_1.IsNumber)(),
|
|
74
|
+
__metadata("design:type", Number)
|
|
75
|
+
], GenericSendMessageDto.prototype, "levelId", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
78
|
+
(0, class_validator_1.IsString)(),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], GenericSendMessageDto.prototype, "levelType", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], GenericSendMessageDto.prototype, "to", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
87
|
+
(0, class_validator_1.IsString)(),
|
|
88
|
+
__metadata("design:type", String)
|
|
89
|
+
], GenericSendMessageDto.prototype, "message", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, class_validator_1.IsOptional)(),
|
|
92
|
+
(0, class_validator_1.IsString)(),
|
|
93
|
+
__metadata("design:type", String)
|
|
94
|
+
], GenericSendMessageDto.prototype, "subject", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, class_validator_1.IsOptional)(),
|
|
97
|
+
(0, class_validator_1.IsIn)(['EMAIL', 'SMS', 'WA', 'TELEPHONE']),
|
|
98
|
+
__metadata("design:type", String)
|
|
99
|
+
], GenericSendMessageDto.prototype, "type", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, class_validator_1.IsOptional)(),
|
|
102
|
+
(0, class_validator_1.IsIn)(['high', 'medium', 'low']),
|
|
103
|
+
__metadata("design:type", String)
|
|
104
|
+
], GenericSendMessageDto.prototype, "priority", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, class_validator_1.IsOptional)(),
|
|
107
|
+
__metadata("design:type", Object)
|
|
108
|
+
], GenericSendMessageDto.prototype, "cc", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, class_validator_1.IsOptional)(),
|
|
111
|
+
__metadata("design:type", Object)
|
|
112
|
+
], GenericSendMessageDto.prototype, "bcc", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, class_validator_1.IsOptional)(),
|
|
115
|
+
(0, class_validator_1.IsString)(),
|
|
116
|
+
__metadata("design:type", String)
|
|
117
|
+
], GenericSendMessageDto.prototype, "html", void 0);
|
|
118
|
+
__decorate([
|
|
119
|
+
(0, class_validator_1.IsOptional)(),
|
|
120
|
+
__metadata("design:type", Array)
|
|
121
|
+
], GenericSendMessageDto.prototype, "attachments", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, class_validator_1.IsOptional)(),
|
|
124
|
+
(0, class_validator_1.IsString)(),
|
|
125
|
+
__metadata("design:type", String)
|
|
126
|
+
], GenericSendMessageDto.prototype, "mediaUrl", void 0);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, class_validator_1.IsOptional)(),
|
|
129
|
+
(0, class_validator_1.IsString)(),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], GenericSendMessageDto.prototype, "templateId", void 0);
|
|
132
|
+
__decorate([
|
|
133
|
+
(0, class_validator_1.IsOptional)(),
|
|
134
|
+
(0, class_validator_1.IsObject)(),
|
|
135
|
+
__metadata("design:type", Object)
|
|
136
|
+
], GenericSendMessageDto.prototype, "variables", void 0);
|
|
137
|
+
class BulkMessageDto {
|
|
138
|
+
}
|
|
139
|
+
exports.BulkMessageDto = BulkMessageDto;
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
142
|
+
(0, class_validator_1.IsNumber)(),
|
|
143
|
+
__metadata("design:type", Number)
|
|
144
|
+
], BulkMessageDto.prototype, "levelId", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
147
|
+
(0, class_validator_1.IsString)(),
|
|
148
|
+
__metadata("design:type", String)
|
|
149
|
+
], BulkMessageDto.prototype, "levelType", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
152
|
+
__metadata("design:type", Array)
|
|
153
|
+
], BulkMessageDto.prototype, "recipients", void 0);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
156
|
+
(0, class_validator_1.IsString)(),
|
|
157
|
+
__metadata("design:type", String)
|
|
158
|
+
], BulkMessageDto.prototype, "message", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
(0, class_validator_1.IsOptional)(),
|
|
161
|
+
(0, class_validator_1.IsString)(),
|
|
162
|
+
__metadata("design:type", String)
|
|
163
|
+
], BulkMessageDto.prototype, "subject", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, class_validator_1.IsOptional)(),
|
|
166
|
+
(0, class_validator_1.IsIn)(['EMAIL', 'SMS', 'WA', 'TELEPHONE']),
|
|
167
|
+
__metadata("design:type", String)
|
|
168
|
+
], BulkMessageDto.prototype, "type", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, class_validator_1.IsOptional)(),
|
|
171
|
+
(0, class_validator_1.IsIn)(['high', 'medium', 'low']),
|
|
172
|
+
__metadata("design:type", String)
|
|
173
|
+
], BulkMessageDto.prototype, "priority", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, class_validator_1.IsOptional)(),
|
|
176
|
+
(0, class_validator_1.IsString)(),
|
|
177
|
+
__metadata("design:type", String)
|
|
178
|
+
], BulkMessageDto.prototype, "html", void 0);
|
|
179
|
+
__decorate([
|
|
180
|
+
(0, class_validator_1.IsOptional)(),
|
|
181
|
+
(0, class_validator_1.IsString)(),
|
|
182
|
+
__metadata("design:type", String)
|
|
183
|
+
], BulkMessageDto.prototype, "templateId", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
(0, class_validator_1.IsOptional)(),
|
|
186
|
+
(0, class_validator_1.IsObject)(),
|
|
187
|
+
__metadata("design:type", Object)
|
|
188
|
+
], BulkMessageDto.prototype, "variables", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
(0, class_validator_1.IsOptional)(),
|
|
191
|
+
(0, class_validator_1.IsNumber)(),
|
|
192
|
+
__metadata("design:type", Number)
|
|
193
|
+
], BulkMessageDto.prototype, "batchSize", void 0);
|
|
194
|
+
class GmailOAuthInitDto {
|
|
195
|
+
}
|
|
196
|
+
exports.GmailOAuthInitDto = GmailOAuthInitDto;
|
|
197
|
+
__decorate([
|
|
198
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
199
|
+
(0, class_validator_1.IsNumber)(),
|
|
200
|
+
__metadata("design:type", Number)
|
|
201
|
+
], GmailOAuthInitDto.prototype, "levelId", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
204
|
+
(0, class_validator_1.IsString)(),
|
|
205
|
+
__metadata("design:type", String)
|
|
206
|
+
], GmailOAuthInitDto.prototype, "levelType", void 0);
|
|
207
|
+
__decorate([
|
|
208
|
+
(0, class_validator_1.IsOptional)(),
|
|
209
|
+
(0, class_validator_1.IsString)(),
|
|
210
|
+
__metadata("design:type", String)
|
|
211
|
+
], GmailOAuthInitDto.prototype, "email", void 0);
|
|
212
|
+
class OAuthCallbackDto {
|
|
213
|
+
}
|
|
214
|
+
exports.OAuthCallbackDto = OAuthCallbackDto;
|
|
215
|
+
__decorate([
|
|
216
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
217
|
+
(0, class_validator_1.IsString)(),
|
|
218
|
+
__metadata("design:type", String)
|
|
219
|
+
], OAuthCallbackDto.prototype, "code", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
222
|
+
(0, class_validator_1.IsString)(),
|
|
223
|
+
__metadata("design:type", String)
|
|
224
|
+
], OAuthCallbackDto.prototype, "state", void 0);
|
|
225
|
+
class OutlookOAuthInitDto {
|
|
226
|
+
}
|
|
227
|
+
exports.OutlookOAuthInitDto = OutlookOAuthInitDto;
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
230
|
+
(0, class_validator_1.IsNumber)(),
|
|
231
|
+
__metadata("design:type", Number)
|
|
232
|
+
], OutlookOAuthInitDto.prototype, "levelId", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
235
|
+
(0, class_validator_1.IsString)(),
|
|
236
|
+
__metadata("design:type", String)
|
|
237
|
+
], OutlookOAuthInitDto.prototype, "levelType", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
(0, class_validator_1.IsOptional)(),
|
|
240
|
+
(0, class_validator_1.IsString)(),
|
|
241
|
+
__metadata("design:type", String)
|
|
242
|
+
], OutlookOAuthInitDto.prototype, "email", void 0);
|
|
243
|
+
//# sourceMappingURL=create-config.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-config.dto.js","sourceRoot":"","sources":["../../../../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;IACZ,IAAA,sBAAI,EAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;;gDACK;AAIrC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;4CACG;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACS;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACqB;AAIhC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACQ;AAGrB,MAAa,iBAAiB;CAY7B;AAZD,8CAYC;AATC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;kDACK;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;oDACO;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;gDACI;AAGjB,MAAa,gBAAgB;CAQ5B;AARD,4CAQC;AALC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8CACE;AAIb;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;+CACG;AAGhB,MAAa,mBAAmB;CAY/B;AAZD,kDAYC;AATC;IAFC,IAAA,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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare class CommunicationConfig {
|
|
2
|
+
id: number;
|
|
3
|
+
config_json: {
|
|
4
|
+
clientId?: string;
|
|
5
|
+
clientSecret?: string;
|
|
6
|
+
refreshToken?: string;
|
|
7
|
+
accessToken?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
phoneNumberId?: string;
|
|
11
|
+
apiVersion?: string;
|
|
12
|
+
accountSid?: string;
|
|
13
|
+
authToken?: string;
|
|
14
|
+
fromNumber?: string;
|
|
15
|
+
accessKeyId?: string;
|
|
16
|
+
secretAccessKey?: string;
|
|
17
|
+
region?: string;
|
|
18
|
+
fromEmail?: string;
|
|
19
|
+
password?: string;
|
|
20
|
+
host?: string;
|
|
21
|
+
port?: number;
|
|
22
|
+
secure?: boolean;
|
|
23
|
+
user?: string;
|
|
24
|
+
from?: string;
|
|
25
|
+
tls?: any;
|
|
26
|
+
apiKey?: string;
|
|
27
|
+
templateId?: string;
|
|
28
|
+
dynamicTemplateData?: any;
|
|
29
|
+
callerNumber?: string;
|
|
30
|
+
apiSecret?: string;
|
|
31
|
+
baseUrl?: string;
|
|
32
|
+
callType?: 'voice' | 'sms';
|
|
33
|
+
voiceMessage?: string;
|
|
34
|
+
language?: string;
|
|
35
|
+
subject?: string;
|
|
36
|
+
html?: string;
|
|
37
|
+
attachments?: any[];
|
|
38
|
+
cc?: string | string[];
|
|
39
|
+
bcc?: string | string[];
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
};
|
|
42
|
+
created_at: Date;
|
|
43
|
+
updated_at: Date;
|
|
44
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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.CommunicationConfig = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
let CommunicationConfig = class CommunicationConfig {
|
|
16
|
+
};
|
|
17
|
+
exports.CommunicationConfig = CommunicationConfig;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'id', type: 'int' }),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], CommunicationConfig.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ name: 'config_json', type: 'json' }),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
(0, class_validator_1.IsObject)(),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], CommunicationConfig.prototype, "config_json", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
30
|
+
name: 'created_at',
|
|
31
|
+
type: 'datetime',
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", Date)
|
|
34
|
+
], CommunicationConfig.prototype, "created_at", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.UpdateDateColumn)({
|
|
37
|
+
name: 'updated_at',
|
|
38
|
+
type: 'datetime',
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], CommunicationConfig.prototype, "updated_at", void 0);
|
|
42
|
+
exports.CommunicationConfig = CommunicationConfig = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)({ name: 'communication_config' })
|
|
44
|
+
], CommunicationConfig);
|
|
45
|
+
//# sourceMappingURL=communication-config.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication-config.entity.js","sourceRoot":"","sources":["../../../../src/module/communication/entity/communication-config.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAqG;AACrG,qDAAuD;AAGhD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CA2E/B,CAAA;AA3EY,kDAAmB;AAE9B;IADC,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;+CACzC;AAKX;IAHC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC7C,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;wDAwDT;AAMF;IAJC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;KACjB,CAAC;8BACU,IAAI;uDAAC;AAMjB;IAJC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;KACjB,CAAC;8BACU,IAAI;uDAAC;8BA1EN,mBAAmB;IAD/B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC;GAC5B,mBAAmB,CA2E/B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum CommunicationConfigType {
|
|
2
|
+
WA = "WA",
|
|
3
|
+
SMS = "SMS",
|
|
4
|
+
EMAIL = "EMAIL",
|
|
5
|
+
TELEPHONE = "TELEPHONE"
|
|
6
|
+
}
|
|
7
|
+
export declare class CommunicationHub {
|
|
8
|
+
id: number;
|
|
9
|
+
level_id: number;
|
|
10
|
+
level_type: string;
|
|
11
|
+
status: number;
|
|
12
|
+
config_id: number;
|
|
13
|
+
communication_config_type: CommunicationConfigType;
|
|
14
|
+
service: 'API' | 'THIRD_PARTY' | 'SMTP';
|
|
15
|
+
provider: 'gmail' | 'outlook' | 'whatsapp' | 'twilio' | 'aws-ses' | 'sendgrid' | 'custom' | 'generic' | 'knowlarity';
|
|
16
|
+
priority: number;
|
|
17
|
+
is_default: boolean;
|
|
18
|
+
created_at: Date;
|
|
19
|
+
updated_at: Date;
|
|
20
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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.CommunicationHub = exports.CommunicationConfigType = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
var CommunicationConfigType;
|
|
16
|
+
(function (CommunicationConfigType) {
|
|
17
|
+
CommunicationConfigType["WA"] = "WA";
|
|
18
|
+
CommunicationConfigType["SMS"] = "SMS";
|
|
19
|
+
CommunicationConfigType["EMAIL"] = "EMAIL";
|
|
20
|
+
CommunicationConfigType["TELEPHONE"] = "TELEPHONE";
|
|
21
|
+
})(CommunicationConfigType || (exports.CommunicationConfigType = CommunicationConfigType = {}));
|
|
22
|
+
let CommunicationHub = class CommunicationHub {
|
|
23
|
+
};
|
|
24
|
+
exports.CommunicationHub = CommunicationHub;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'id', type: 'int' }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], CommunicationHub.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'level_id', type: 'int' }),
|
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
32
|
+
(0, class_validator_1.IsInt)(),
|
|
33
|
+
__metadata("design:type", Number)
|
|
34
|
+
], CommunicationHub.prototype, "level_id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ name: 'level_type', type: 'varchar', length: 100 }),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], CommunicationHub.prototype, "level_type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ name: 'status', type: 'tinyint', default: 1 }),
|
|
42
|
+
(0, class_validator_1.IsInt)(),
|
|
43
|
+
(0, class_validator_1.Min)(0),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], CommunicationHub.prototype, "status", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ name: 'config_id', type: 'int' }),
|
|
48
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
49
|
+
(0, class_validator_1.IsInt)(),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], CommunicationHub.prototype, "config_id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({
|
|
54
|
+
name: 'communication_config_type',
|
|
55
|
+
type: 'enum',
|
|
56
|
+
enum: CommunicationConfigType,
|
|
57
|
+
}),
|
|
58
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
59
|
+
(0, class_validator_1.IsIn)(['WA', 'SMS', 'EMAIL', 'TELEPHONE']),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], CommunicationHub.prototype, "communication_config_type", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ name: 'service', type: 'varchar', length: 100 }),
|
|
64
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
65
|
+
(0, class_validator_1.IsIn)(['API', 'THIRD_PARTY', 'SMTP']),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], CommunicationHub.prototype, "service", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.Column)({ name: 'provider', type: 'varchar', length: 100 }),
|
|
70
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
71
|
+
(0, class_validator_1.IsIn)(['gmail', 'outlook', 'whatsapp', 'twilio', 'aws-ses', 'sendgrid', 'custom', 'generic', 'knowlarity']),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], CommunicationHub.prototype, "provider", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({ name: 'priority', type: 'int', default: 1 }),
|
|
76
|
+
(0, class_validator_1.IsInt)(),
|
|
77
|
+
(0, class_validator_1.Min)(1),
|
|
78
|
+
__metadata("design:type", Number)
|
|
79
|
+
], CommunicationHub.prototype, "priority", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.Column)({ name: 'is_default', type: 'boolean', default: false }),
|
|
82
|
+
(0, class_validator_1.IsBoolean)(),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], CommunicationHub.prototype, "is_default", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.CreateDateColumn)({
|
|
87
|
+
name: 'created_at',
|
|
88
|
+
type: 'datetime',
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", Date)
|
|
91
|
+
], CommunicationHub.prototype, "created_at", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.UpdateDateColumn)({
|
|
94
|
+
name: 'updated_at',
|
|
95
|
+
type: 'datetime',
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Date)
|
|
98
|
+
], CommunicationHub.prototype, "updated_at", void 0);
|
|
99
|
+
exports.CommunicationHub = CommunicationHub = __decorate([
|
|
100
|
+
(0, typeorm_1.Entity)({ name: 'communication_hub' }),
|
|
101
|
+
(0, typeorm_1.Index)('idx_level_status', ['level_id', 'level_type', 'status']),
|
|
102
|
+
(0, typeorm_1.Index)('idx_config_type', ['communication_config_type']),
|
|
103
|
+
(0, typeorm_1.Index)('idx_service_provider', ['service', 'provider'])
|
|
104
|
+
], CommunicationHub);
|
|
105
|
+
//# sourceMappingURL=communication-hub.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication-hub.entity.js","sourceRoot":"","sources":["../../../../src/module/communication/entity/communication-hub.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4G;AAC5G,qDAA0E;AAE1E,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,oCAAS,CAAA;IACT,sCAAW,CAAA;IACX,0CAAe,CAAA;IACf,kDAAuB,CAAA;AACzB,CAAC,EALW,uBAAuB,uCAAvB,uBAAuB,QAKlC;AAMM,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CA8D5B,CAAA;AA9DY,4CAAgB;AAE3B;IADC,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;4CACzC;AAKX;IAHC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzC,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;kDACS;AAIjB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;IAC5D,IAAA,4BAAU,GAAE;;oDACM;AAKnB;IAHC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,Q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IjB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC/D,IAAA,2BAAS,GAAE;;oDACQ;AAMpB;IAJC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;KACjB,CAAC;8BACU,IAAI;oDAAC;AAMjB;IAJC,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,UAAU;KACjB,CAAC;8BACU,IAAI;oDAAC;2BA7DN,gBAAgB;IAJ5B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,CAAC;IACrC,IAAA,eAAK,EAAC,kBAAkB,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC/D,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,2BAA2B,CAAC,CAAC;IACvD,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;GAC1C,gBAAgB,CA8D5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommunicationService } from '../service/communication.service';
|
|
2
|
+
export declare class CommunicationUsageExamples {
|
|
3
|
+
private readonly communicationService;
|
|
4
|
+
constructor(communicationService: CommunicationService);
|
|
5
|
+
sendEmailViaGmailApi(): Promise<void>;
|
|
6
|
+
sendSmsViaTwilio(): Promise<void>;
|
|
7
|
+
sendWhatsAppMessage(): Promise<void>;
|
|
8
|
+
makeVoiceCall(): Promise<void>;
|
|
9
|
+
getSupportedCombinations(): Promise<void>;
|
|
10
|
+
sendMessageAutoMode(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommunicationUsageExamples = void 0;
|
|
4
|
+
const communication_hub_entity_1 = require("../entity/communication-hub.entity");
|
|
5
|
+
class CommunicationUsageExamples {
|
|
6
|
+
constructor(communicationService) {
|
|
7
|
+
this.communicationService = communicationService;
|
|
8
|
+
}
|
|
9
|
+
async sendEmailViaGmailApi() {
|
|
10
|
+
const emailConfig = {
|
|
11
|
+
clientId: 'your-gmail-client-id',
|
|
12
|
+
clientSecret: 'your-gmail-client-secret',
|
|
13
|
+
refreshToken: 'your-refresh-token'
|
|
14
|
+
};
|
|
15
|
+
const hub = await this.communicationService.createCommunicationConfig(1, 'organization', communication_hub_entity_1.CommunicationConfigType.EMAIL, 'API', 'gmail', emailConfig);
|
|
16
|
+
console.log('Created email config:', hub);
|
|
17
|
+
const result = await this.communicationService.sendMessage({
|
|
18
|
+
levelId: 1,
|
|
19
|
+
levelType: 'organization',
|
|
20
|
+
to: 'recipient@example.com',
|
|
21
|
+
message: 'Hello from Gmail API!',
|
|
22
|
+
mode: communication_hub_entity_1.CommunicationConfigType.EMAIL
|
|
23
|
+
});
|
|
24
|
+
console.log('Email sent:', result);
|
|
25
|
+
}
|
|
26
|
+
async sendSmsViaTwilio() {
|
|
27
|
+
const smsConfig = {
|
|
28
|
+
accountSid: 'your-twilio-account-sid',
|
|
29
|
+
authToken: 'your-twilio-auth-token',
|
|
30
|
+
fromNumber: '+1234567890'
|
|
31
|
+
};
|
|
32
|
+
await this.communicationService.createCommunicationConfig(1, 'organization', communication_hub_entity_1.CommunicationConfigType.SMS, 'THIRD_PARTY', 'twilio', smsConfig);
|
|
33
|
+
const result = await this.communicationService.sendMessage({
|
|
34
|
+
levelId: 1,
|
|
35
|
+
levelType: 'organization',
|
|
36
|
+
to: '+9876543210',
|
|
37
|
+
message: 'Hello from Twilio SMS!',
|
|
38
|
+
mode: communication_hub_entity_1.CommunicationConfigType.SMS
|
|
39
|
+
});
|
|
40
|
+
console.log('SMS sent:', result);
|
|
41
|
+
}
|
|
42
|
+
async sendWhatsAppMessage() {
|
|
43
|
+
const whatsappConfig = {
|
|
44
|
+
accessToken: 'your-whatsapp-access-token',
|
|
45
|
+
phoneNumberId: 'your-phone-number-id',
|
|
46
|
+
businessAccountId: 'your-business-account-id'
|
|
47
|
+
};
|
|
48
|
+
await this.communicationService.createCommunicationConfig(1, 'organization', communication_hub_entity_1.CommunicationConfigType.WA, 'API', 'whatsapp', whatsappConfig);
|
|
49
|
+
const result = await this.communicationService.sendMessage({
|
|
50
|
+
levelId: 1,
|
|
51
|
+
levelType: 'organization',
|
|
52
|
+
to: '+9876543210',
|
|
53
|
+
message: 'Hello from WhatsApp!',
|
|
54
|
+
mode: communication_hub_entity_1.CommunicationConfigType.WA
|
|
55
|
+
});
|
|
56
|
+
console.log('WhatsApp sent:', result);
|
|
57
|
+
}
|
|
58
|
+
async makeVoiceCall() {
|
|
59
|
+
const voiceConfig = {
|
|
60
|
+
apiKey: 'your-knowlarity-api-key',
|
|
61
|
+
callerId: '+1234567890',
|
|
62
|
+
voiceUrl: 'https://your-voice-script-url.com'
|
|
63
|
+
};
|
|
64
|
+
await this.communicationService.createCommunicationConfig(1, 'organization', communication_hub_entity_1.CommunicationConfigType.TELEPHONE, 'THIRD_PARTY', 'knowlarity', voiceConfig);
|
|
65
|
+
const result = await this.communicationService.sendMessage({
|
|
66
|
+
levelId: 1,
|
|
67
|
+
levelType: 'organization',
|
|
68
|
+
to: '+9876543210',
|
|
69
|
+
message: 'Voice message content',
|
|
70
|
+
mode: communication_hub_entity_1.CommunicationConfigType.TELEPHONE
|
|
71
|
+
});
|
|
72
|
+
console.log('Voice call initiated:', result);
|
|
73
|
+
}
|
|
74
|
+
async getSupportedCombinations() {
|
|
75
|
+
const combinations = await this.communicationService.getSupportedCombinations();
|
|
76
|
+
console.log('Supported combinations:', combinations);
|
|
77
|
+
}
|
|
78
|
+
async sendMessageAutoMode() {
|
|
79
|
+
const result = await this.communicationService.sendMessage({
|
|
80
|
+
levelId: 1,
|
|
81
|
+
levelType: 'organization',
|
|
82
|
+
to: 'recipient@example.com',
|
|
83
|
+
message: 'Hello! This will use the first available communication method.'
|
|
84
|
+
});
|
|
85
|
+
console.log('Message sent via auto-selected provider:', result);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.CommunicationUsageExamples = CommunicationUsageExamples;
|
|
89
|
+
//# sourceMappingURL=usage.example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.example.js","sourceRoot":"","sources":["../../../../src/module/communication/examples/usage.example.ts"],"names":[],"mappings":";;;AAOA,iFAA6E;AAE7E,MAAa,0BAA0B;IACrC,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;IAAG,CAAC;IAK3E,KAAK,CAAC,oBAAoB;QAExB,MAAM,WAAW,GAAG;YAClB,QAAQ,EAAE,sBAAsB;YAChC,YAAY,EAAE,0BAA0B;YACxC,YAAY,EAAE,oBAAoB;SACnC,CAAC;QAEF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,yBAAyB,CACnE,CAAC,EACD,cAAc,EACd,kDAAuB,CAAC,KAAK,EAC7B,KAAK,EACL,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;QAG1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC;YACzD,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,cAAc;YACzB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,uBAAuB;YAChC,IAAI,EAAE,kDAAuB,CAAC,KAAK;SACpC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAKD,KAAK,CAAC,gBAAgB;QACpB,MAAM,SAAS,GAAG;YAChB,UAAU,EAAE,yBAAyB;YACrC,SAAS,EAAE,wBAAwB;YACnC,UAAU,EAAE,aAAa;SAC1B,CAAC;QAEF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kDAAuB,CAAC,SAAS,EACjC,aAAa,EACb,YAAY,EACZ,WAAW,CACZ,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC;YACzD,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,cAAc;YACzB,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE,uBAAuB;YAChC,IAAI,EAAE,kDAAuB,CAAC,SAAS;SACxC,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAKD,KAAK,CAAC,wBAAwB;QAC5B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,YAAY,CAAC,CAAC;IAYvD,CAAC;IAKD,KAAK,CAAC,mBAAmB;QACvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,WAAW,CAAC;YACzD,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,cAAc;YACzB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,gEAAgE;SAC1E,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF;AA/JD,gEA+JC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CommunicationStrategy } from '../strategies/communication.strategy';
|
|
2
|
+
export interface BaseFactory {
|
|
3
|
+
createProvider(service: string, provider: string): CommunicationStrategy;
|
|
4
|
+
getSupportedCombinations(): Array<{
|
|
5
|
+
service: string;
|
|
6
|
+
provider: string;
|
|
7
|
+
}>;
|
|
8
|
+
validateCombination(service: string, provider: string): boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.factory.js","sourceRoot":"","sources":["../../../../src/module/communication/factories/base.factory.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CommunicationStrategy } from '../strategies/communication.strategy';
|
|
2
|
+
import { EmailFactory } from './email.factory';
|
|
3
|
+
import { SmsFactory } from './sms.factory';
|
|
4
|
+
import { WhatsAppFactory } from './whatsapp.factory';
|
|
5
|
+
import { TelephoneFactory } from './telephone.factory';
|
|
6
|
+
export declare enum CommunicationMode {
|
|
7
|
+
EMAIL = "EMAIL",
|
|
8
|
+
SMS = "SMS",
|
|
9
|
+
WA = "WA",
|
|
10
|
+
TELEPHONE = "TELEPHONE"
|
|
11
|
+
}
|
|
12
|
+
export declare class CommunicationFactory {
|
|
13
|
+
private emailFactory;
|
|
14
|
+
private smsFactory;
|
|
15
|
+
private whatsappFactory;
|
|
16
|
+
private telephoneFactory;
|
|
17
|
+
private readonly modeFactoryMap;
|
|
18
|
+
constructor(emailFactory: EmailFactory, smsFactory: SmsFactory, whatsappFactory: WhatsAppFactory, telephoneFactory: TelephoneFactory);
|
|
19
|
+
private initializeFactoryMap;
|
|
20
|
+
create(mode: string, service: string, provider: string): CommunicationStrategy;
|
|
21
|
+
getAllSupportedCombinations(): Array<{
|
|
22
|
+
mode: string;
|
|
23
|
+
service: string;
|
|
24
|
+
provider: string;
|
|
25
|
+
}>;
|
|
26
|
+
getSupportedCombinationsForMode(mode: string): Array<{
|
|
27
|
+
service: string;
|
|
28
|
+
provider: string;
|
|
29
|
+
}>;
|
|
30
|
+
validateCombination(mode: string, service: string, provider: string): boolean;
|
|
31
|
+
getAvailableModes(): string[];
|
|
32
|
+
getProvidersByModeAndService(mode: string, service: string): string[];
|
|
33
|
+
}
|