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 @@
|
|
|
1
|
+
{"version":3,"file":"gmail-smtp.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/gmail-smtp.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,yCAAyC;AAIlC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,MAAW;QACxD,IAAI,CAAC;YACH,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,cAAc,EACxB,IAAI,EACJ,WAAW,EACX,EAAE,EACF,GAAG,EACJ,GAAG,MAAM,CAAC;YAEX,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;gBAC7C,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE;oBACJ,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,QAAQ;iBACf;aACF,CAAC,CAAC;YAEH,MAAM,WAAW,GAAG;gBAClB,IAAI,EAAE,KAAK;gBACX,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gBACzC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC5D,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;gBACjE,OAAO;gBACP,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,IAAI,IAAI,OAAO;gBACrB,WAAW,EAAE,WAAW,IAAI,EAAE;aAC/B,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAEvD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,MAAM;gBACf,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,CAAC,CAAC,CACP,MAAM,CAAC,KAAK;YACZ,MAAM,CAAC,QAAQ,CAChB,CAAC;IACJ,CAAC;CACF,CAAA;AA1DY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CA0D7B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from './communication.strategy';
|
|
2
|
+
export declare class GmailStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GmailStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const googleapis_1 = require("googleapis");
|
|
12
|
+
let GmailStrategy = class GmailStrategy {
|
|
13
|
+
async sendMessage(to, message, config) {
|
|
14
|
+
try {
|
|
15
|
+
const { clientId, clientSecret, refreshToken, accessToken, email } = config;
|
|
16
|
+
const oauth2Client = new googleapis_1.google.auth.OAuth2(clientId, clientSecret);
|
|
17
|
+
oauth2Client.setCredentials({
|
|
18
|
+
refresh_token: refreshToken,
|
|
19
|
+
access_token: accessToken,
|
|
20
|
+
});
|
|
21
|
+
const gmail = googleapis_1.google.gmail({ version: 'v1', auth: oauth2Client });
|
|
22
|
+
const subject = config.subject || 'Notification';
|
|
23
|
+
const emailContent = [
|
|
24
|
+
`From: ${email}`,
|
|
25
|
+
`To: ${to}`,
|
|
26
|
+
`Subject: ${subject}`,
|
|
27
|
+
'Content-Type: text/html; charset=utf-8',
|
|
28
|
+
'',
|
|
29
|
+
config.html || message,
|
|
30
|
+
].join('\n');
|
|
31
|
+
const encodedMessage = Buffer.from(emailContent)
|
|
32
|
+
.toString('base64')
|
|
33
|
+
.replace(/\+/g, '-')
|
|
34
|
+
.replace(/\//g, '_')
|
|
35
|
+
.replace(/=+$/, '');
|
|
36
|
+
const result = await gmail.users.messages.send({
|
|
37
|
+
userId: 'me',
|
|
38
|
+
requestBody: {
|
|
39
|
+
raw: encodedMessage,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
success: true,
|
|
44
|
+
provider: 'gmail',
|
|
45
|
+
service: 'API',
|
|
46
|
+
messageId: result.data.id || undefined,
|
|
47
|
+
timestamp: new Date(),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
return {
|
|
52
|
+
success: false,
|
|
53
|
+
provider: 'gmail',
|
|
54
|
+
service: 'API',
|
|
55
|
+
error: error.message,
|
|
56
|
+
timestamp: new Date(),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
validateConfig(config) {
|
|
61
|
+
return !!(config.clientId &&
|
|
62
|
+
config.clientSecret &&
|
|
63
|
+
config.refreshToken &&
|
|
64
|
+
config.email);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.GmailStrategy = GmailStrategy;
|
|
68
|
+
exports.GmailStrategy = GmailStrategy = __decorate([
|
|
69
|
+
(0, common_1.Injectable)()
|
|
70
|
+
], GmailStrategy);
|
|
71
|
+
//# sourceMappingURL=gmail.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gmail.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/gmail.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAoC;AAI7B,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,MAAW;QACxD,IAAI,CAAC;YACH,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;YAE5E,MAAM,YAAY,GAAG,IAAI,mBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YACpE,YAAY,CAAC,cAAc,CAAC;gBAC1B,aAAa,EAAE,YAAY;gBAC3B,YAAY,EAAE,WAAW;aAC1B,CAAC,CAAC;YAEH,MAAM,KAAK,GAAG,mBAAM,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;YAElE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,cAAc,CAAC;YACjD,MAAM,YAAY,GAAG;gBACnB,SAAS,KAAK,EAAE;gBAChB,OAAO,EAAE,EAAE;gBACX,YAAY,OAAO,EAAE;gBACrB,wCAAwC;gBACxC,EAAE;gBACF,MAAM,CAAC,IAAI,IAAI,OAAO;aACvB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEb,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;iBAC7C,QAAQ,CAAC,QAAQ,CAAC;iBAClB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;iBACnB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;iBACnB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAEtB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAC7C,MAAM,EAAE,IAAI;gBACZ,WAAW,EAAE;oBACX,GAAG,EAAE,cAAc;iBACpB;aACF,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,SAAS;gBACtC,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,CAAC,CAAC,CACP,MAAM,CAAC,QAAQ;YACf,MAAM,CAAC,YAAY;YACnB,MAAM,CAAC,YAAY;YACnB,MAAM,CAAC,KAAK,CACb,CAAC;IACJ,CAAC;CACF,CAAA;AA9DY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CA8DzB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from './communication.strategy';
|
|
2
|
+
export declare class KnowlarityStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
getCallStatus(callId: string, config: any): Promise<any>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.KnowlarityStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const axios_1 = require("axios");
|
|
12
|
+
let KnowlarityStrategy = class KnowlarityStrategy {
|
|
13
|
+
async sendMessage(to, message, config) {
|
|
14
|
+
try {
|
|
15
|
+
const { apiKey, apiSecret, callerNumber, baseUrl = 'https://kpi.knowlarity.com/Basic', callType = 'voice', language = 'en' } = config;
|
|
16
|
+
if (callType === 'voice') {
|
|
17
|
+
const callData = {
|
|
18
|
+
k_number: callerNumber,
|
|
19
|
+
agent_number: to,
|
|
20
|
+
caller_id: callerNumber,
|
|
21
|
+
voice_message: config.voiceMessage || message,
|
|
22
|
+
language: language,
|
|
23
|
+
api_key: apiKey,
|
|
24
|
+
api_secret: apiSecret,
|
|
25
|
+
format: 'json'
|
|
26
|
+
};
|
|
27
|
+
const response = await axios_1.default.post(`${baseUrl}/start_call.php`, callData, {
|
|
28
|
+
headers: {
|
|
29
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
30
|
+
},
|
|
31
|
+
transformRequest: [(data) => {
|
|
32
|
+
return Object.keys(data)
|
|
33
|
+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
|
|
34
|
+
.join('&');
|
|
35
|
+
}]
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
success: response.data.status === 'success',
|
|
39
|
+
provider: 'knowlarity',
|
|
40
|
+
service: 'THIRD_PARTY',
|
|
41
|
+
messageId: response.data.call_id,
|
|
42
|
+
timestamp: new Date(),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
if (callType === 'sms') {
|
|
46
|
+
const smsData = {
|
|
47
|
+
k_number: callerNumber,
|
|
48
|
+
agent_number: to,
|
|
49
|
+
sms_text: message,
|
|
50
|
+
api_key: apiKey,
|
|
51
|
+
api_secret: apiSecret,
|
|
52
|
+
format: 'json'
|
|
53
|
+
};
|
|
54
|
+
const response = await axios_1.default.post(`${baseUrl}/send_sms.php`, smsData, {
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
57
|
+
},
|
|
58
|
+
transformRequest: [(data) => {
|
|
59
|
+
return Object.keys(data)
|
|
60
|
+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
|
|
61
|
+
.join('&');
|
|
62
|
+
}]
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
success: response.data.status === 'success',
|
|
66
|
+
provider: 'knowlarity',
|
|
67
|
+
service: 'THIRD_PARTY',
|
|
68
|
+
messageId: response.data.message_id,
|
|
69
|
+
timestamp: new Date(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
throw new Error('Invalid call type. Must be "voice" or "sms"');
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
return {
|
|
76
|
+
success: false,
|
|
77
|
+
provider: 'knowlarity',
|
|
78
|
+
service: 'THIRD_PARTY',
|
|
79
|
+
error: error.message,
|
|
80
|
+
timestamp: new Date(),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
validateConfig(config) {
|
|
85
|
+
return !!(config.apiKey &&
|
|
86
|
+
config.apiSecret &&
|
|
87
|
+
config.callerNumber &&
|
|
88
|
+
['voice', 'sms'].includes(config.callType));
|
|
89
|
+
}
|
|
90
|
+
async getCallStatus(callId, config) {
|
|
91
|
+
const { apiKey, apiSecret, baseUrl = 'https://kpi.knowlarity.com/Basic' } = config;
|
|
92
|
+
const statusData = {
|
|
93
|
+
call_id: callId,
|
|
94
|
+
api_key: apiKey,
|
|
95
|
+
api_secret: apiSecret,
|
|
96
|
+
format: 'json'
|
|
97
|
+
};
|
|
98
|
+
const response = await axios_1.default.post(`${baseUrl}/call_details.php`, statusData, {
|
|
99
|
+
headers: {
|
|
100
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
101
|
+
},
|
|
102
|
+
transformRequest: [(data) => {
|
|
103
|
+
return Object.keys(data)
|
|
104
|
+
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(data[key])}`)
|
|
105
|
+
.join('&');
|
|
106
|
+
}]
|
|
107
|
+
});
|
|
108
|
+
return response.data;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
exports.KnowlarityStrategy = KnowlarityStrategy;
|
|
112
|
+
exports.KnowlarityStrategy = KnowlarityStrategy = __decorate([
|
|
113
|
+
(0, common_1.Injectable)()
|
|
114
|
+
], KnowlarityStrategy);
|
|
115
|
+
//# sourceMappingURL=knowlarity.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowlarity.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/knowlarity.strategy.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from './communication.strategy';
|
|
2
|
+
export declare class OutlookSMTPStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.OutlookSMTPStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const nodemailer = require("nodemailer");
|
|
12
|
+
let OutlookSMTPStrategy = class OutlookSMTPStrategy {
|
|
13
|
+
async sendMessage(to, message, config) {
|
|
14
|
+
try {
|
|
15
|
+
const { email, password, subject = 'Notification', html, attachments, cc, bcc } = config;
|
|
16
|
+
const transporter = nodemailer.createTransport({
|
|
17
|
+
host: 'smtp-mail.outlook.com',
|
|
18
|
+
port: 587,
|
|
19
|
+
secure: false,
|
|
20
|
+
auth: {
|
|
21
|
+
user: email,
|
|
22
|
+
pass: password,
|
|
23
|
+
},
|
|
24
|
+
tls: {
|
|
25
|
+
ciphers: 'SSLv3',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const mailOptions = {
|
|
29
|
+
from: email,
|
|
30
|
+
to: Array.isArray(to) ? to.join(',') : to,
|
|
31
|
+
cc: cc ? (Array.isArray(cc) ? cc.join(',') : cc) : undefined,
|
|
32
|
+
bcc: bcc ? (Array.isArray(bcc) ? bcc.join(',') : bcc) : undefined,
|
|
33
|
+
subject,
|
|
34
|
+
text: message,
|
|
35
|
+
html: html || message,
|
|
36
|
+
attachments: attachments || [],
|
|
37
|
+
};
|
|
38
|
+
const result = await transporter.sendMail(mailOptions);
|
|
39
|
+
return {
|
|
40
|
+
success: true,
|
|
41
|
+
provider: 'outlook',
|
|
42
|
+
service: 'SMTP',
|
|
43
|
+
messageId: result.messageId,
|
|
44
|
+
timestamp: new Date(),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return {
|
|
49
|
+
success: false,
|
|
50
|
+
provider: 'outlook',
|
|
51
|
+
service: 'SMTP',
|
|
52
|
+
error: error.message,
|
|
53
|
+
timestamp: new Date(),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
validateConfig(config) {
|
|
58
|
+
return !!(config.email &&
|
|
59
|
+
config.password);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.OutlookSMTPStrategy = OutlookSMTPStrategy;
|
|
63
|
+
exports.OutlookSMTPStrategy = OutlookSMTPStrategy = __decorate([
|
|
64
|
+
(0, common_1.Injectable)()
|
|
65
|
+
], OutlookSMTPStrategy);
|
|
66
|
+
//# sourceMappingURL=outlook-smtp.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlook-smtp.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/outlook-smtp.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,yCAAyC;AAIlC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,MAAW;QACxD,IAAI,CAAC;YACH,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,cAAc,EACxB,IAAI,EACJ,WAAW,EACX,EAAE,EACF,GAAG,EACJ,GAAG,MAAM,CAAC;YAEX,MAAM,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC;gBAC7C,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE;oBACJ,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,QAAQ;iBACf;gBACD,GAAG,EAAE;oBACH,OAAO,EAAE,OAAO;iBACjB;aACF,CAAC,CAAC;YAEH,MAAM,WAAW,GAAG;gBAClB,IAAI,EAAE,KAAK;gBACX,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gBACzC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC5D,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;gBACjE,OAAO;gBACP,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,IAAI,IAAI,OAAO;gBACrB,WAAW,EAAE,WAAW,IAAI,EAAE;aAC/B,CAAC;YAEF,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;YAEvD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,MAAM;gBACf,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,MAAM;gBACf,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,CAAC,CAAC,CACP,MAAM,CAAC,KAAK;YACZ,MAAM,CAAC,QAAQ,CAChB,CAAC;IACJ,CAAC;CACF,CAAA;AA/DY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;GACA,mBAAmB,CA+D/B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from './communication.strategy';
|
|
2
|
+
export declare class OutlookStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.OutlookStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
|
|
12
|
+
let OutlookStrategy = class OutlookStrategy {
|
|
13
|
+
async sendMessage(to, message, config) {
|
|
14
|
+
try {
|
|
15
|
+
const { accessToken } = config;
|
|
16
|
+
const graphClient = microsoft_graph_client_1.Client.init({
|
|
17
|
+
authProvider: {
|
|
18
|
+
getAccessToken: async () => accessToken,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const subject = config.subject || 'Notification';
|
|
22
|
+
const mail = {
|
|
23
|
+
message: {
|
|
24
|
+
subject,
|
|
25
|
+
body: {
|
|
26
|
+
contentType: config.html ? 'HTML' : 'Text',
|
|
27
|
+
content: config.html || message,
|
|
28
|
+
},
|
|
29
|
+
toRecipients: [
|
|
30
|
+
{
|
|
31
|
+
emailAddress: {
|
|
32
|
+
address: to,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
await graphClient.api('/me/sendMail').post(mail);
|
|
39
|
+
return {
|
|
40
|
+
success: true,
|
|
41
|
+
provider: 'outlook',
|
|
42
|
+
service: 'API',
|
|
43
|
+
timestamp: new Date(),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
provider: 'outlook',
|
|
50
|
+
service: 'API',
|
|
51
|
+
error: error.message,
|
|
52
|
+
timestamp: new Date(),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
validateConfig(config) {
|
|
57
|
+
return !!(config.accessToken);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
exports.OutlookStrategy = OutlookStrategy;
|
|
61
|
+
exports.OutlookStrategy = OutlookStrategy = __decorate([
|
|
62
|
+
(0, common_1.Injectable)()
|
|
63
|
+
], OutlookStrategy);
|
|
64
|
+
//# sourceMappingURL=outlook.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlook.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/outlook.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,8EAA2D;AAIpD,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,MAAW;QACxD,IAAI,CAAC;YACH,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;YAE/B,MAAM,WAAW,GAAG,+BAAM,CAAC,IAAI,CAAC;gBAC9B,YAAY,EAAE;oBACZ,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW;iBACjC;aACT,CAAC,CAAC;YAEH,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,cAAc,CAAC;YACjD,MAAM,IAAI,GAAG;gBACX,OAAO,EAAE;oBACP,OAAO;oBACP,IAAI,EAAE;wBACJ,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;wBAC1C,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,OAAO;qBAChC;oBACD,YAAY,EAAE;wBACZ;4BACE,YAAY,EAAE;gCACZ,OAAO,EAAE,EAAE;6BACZ;yBACF;qBACF;iBACF;aACF,CAAC;YAEF,MAAM,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEjD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,SAAS;gBACnB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;CACF,CAAA;AAnDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;GACA,eAAe,CAmD3B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from '../communication.strategy';
|
|
2
|
+
export declare class KnowlarityStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.KnowlarityStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let KnowlarityStrategy = class KnowlarityStrategy {
|
|
12
|
+
async sendMessage(to, message, config) {
|
|
13
|
+
try {
|
|
14
|
+
if (!this.validateConfig(config)) {
|
|
15
|
+
throw new Error('Invalid Knowlarity configuration');
|
|
16
|
+
}
|
|
17
|
+
console.log('Sending SMS via Knowlarity to:', to);
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
messageId: `knowlarity-${Date.now()}`,
|
|
21
|
+
provider: 'knowlarity',
|
|
22
|
+
service: 'THIRD_PARTY',
|
|
23
|
+
timestamp: new Date(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
provider: 'knowlarity',
|
|
30
|
+
service: 'THIRD_PARTY',
|
|
31
|
+
error: error.message,
|
|
32
|
+
timestamp: new Date(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
validateConfig(config) {
|
|
37
|
+
return config && config.apiKey && config.senderId;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.KnowlarityStrategy = KnowlarityStrategy;
|
|
41
|
+
exports.KnowlarityStrategy = KnowlarityStrategy = __decorate([
|
|
42
|
+
(0, common_1.Injectable)()
|
|
43
|
+
], KnowlarityStrategy);
|
|
44
|
+
//# sourceMappingURL=knowlarity.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowlarity.strategy.js","sourceRoot":"","sources":["../../../../../src/module/communication/strategies/sms/knowlarity.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAOrC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,KAAK,CAAC,WAAW,CACf,EAAU,EACV,OAAe,EACf,MAAW;QAEX,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACtD,CAAC;YAID,OAAO,CAAC,GAAG,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;YAElD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,cAAc,IAAI,CAAC,GAAG,EAAE,EAAE;gBACrC,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,aAAa;gBACtB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC;IACpD,CAAC;CACF,CAAA;AApCY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;GACA,kBAAkB,CAoC9B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from '../communication.strategy';
|
|
2
|
+
export declare class TwilioStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TwilioStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let TwilioStrategy = class TwilioStrategy {
|
|
12
|
+
async sendMessage(to, message, config) {
|
|
13
|
+
try {
|
|
14
|
+
if (!this.validateConfig(config)) {
|
|
15
|
+
throw new Error('Invalid Twilio configuration');
|
|
16
|
+
}
|
|
17
|
+
console.log('Sending SMS via Twilio to:', to);
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
messageId: `twilio-${Date.now()}`,
|
|
21
|
+
provider: 'twilio',
|
|
22
|
+
service: 'THIRD_PARTY',
|
|
23
|
+
timestamp: new Date(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
provider: 'twilio',
|
|
30
|
+
service: 'THIRD_PARTY',
|
|
31
|
+
error: error.message,
|
|
32
|
+
timestamp: new Date(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
validateConfig(config) {
|
|
37
|
+
return config && config.accountSid && config.authToken && config.fromNumber;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.TwilioStrategy = TwilioStrategy;
|
|
41
|
+
exports.TwilioStrategy = TwilioStrategy = __decorate([
|
|
42
|
+
(0, common_1.Injectable)()
|
|
43
|
+
], TwilioStrategy);
|
|
44
|
+
//# sourceMappingURL=twilio.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twilio.strategy.js","sourceRoot":"","sources":["../../../../../src/module/communication/strategies/sms/twilio.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAOrC,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,KAAK,CAAC,WAAW,CACf,EAAU,EACV,OAAe,EACf,MAAW;QAEX,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAID,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;YAE9C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,UAAU,IAAI,CAAC,GAAG,EAAE,EAAE;gBACjC,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,aAAa;gBACtB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC;IAC9E,CAAC;CACF,CAAA;AApCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;GACA,cAAc,CAoC1B"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from './communication.strategy';
|
|
2
|
+
export declare class SmsStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SmsStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const twilio_1 = require("twilio");
|
|
12
|
+
let SmsStrategy = class SmsStrategy {
|
|
13
|
+
async sendMessage(to, message, config) {
|
|
14
|
+
try {
|
|
15
|
+
const { accountSid, authToken, fromNumber } = config;
|
|
16
|
+
const client = new twilio_1.Twilio(accountSid, authToken);
|
|
17
|
+
const result = await client.messages.create({
|
|
18
|
+
body: message,
|
|
19
|
+
from: fromNumber,
|
|
20
|
+
to: to,
|
|
21
|
+
});
|
|
22
|
+
return {
|
|
23
|
+
success: true,
|
|
24
|
+
provider: 'twilio',
|
|
25
|
+
service: 'THIRD_PARTY',
|
|
26
|
+
messageId: result.sid,
|
|
27
|
+
timestamp: new Date(),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
return {
|
|
32
|
+
success: false,
|
|
33
|
+
provider: 'twilio',
|
|
34
|
+
service: 'THIRD_PARTY',
|
|
35
|
+
error: error.message,
|
|
36
|
+
timestamp: new Date(),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
validateConfig(config) {
|
|
41
|
+
return !!(config.accountSid &&
|
|
42
|
+
config.authToken &&
|
|
43
|
+
config.fromNumber);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.SmsStrategy = SmsStrategy;
|
|
47
|
+
exports.SmsStrategy = SmsStrategy = __decorate([
|
|
48
|
+
(0, common_1.Injectable)()
|
|
49
|
+
], SmsStrategy);
|
|
50
|
+
//# sourceMappingURL=sms.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sms.strategy.js","sourceRoot":"","sources":["../../../../src/module/communication/strategies/sms.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,mCAAgC;AAIzB,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,KAAK,CAAC,WAAW,CAAC,EAAU,EAAE,OAAe,EAAE,MAAW;QACxD,IAAI,CAAC;YACH,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC;YAErD,MAAM,MAAM,GAAG,IAAI,eAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;YAEjD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC1C,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,UAAU;gBAChB,EAAE,EAAE,EAAE;aACP,CAAC,CAAC;YAEH,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,aAAa;gBACtB,SAAS,EAAE,MAAM,CAAC,GAAG;gBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,QAAQ;gBAClB,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,CAAC,CAAC,CACP,MAAM,CAAC,UAAU;YACjB,MAAM,CAAC,SAAS;YAChB,MAAM,CAAC,UAAU,CAClB,CAAC;IACJ,CAAC;CACF,CAAA;AAtCY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;GACA,WAAW,CAsCvB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from '../communication.strategy';
|
|
2
|
+
export declare class KnowlarityVoiceStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.KnowlarityVoiceStrategy = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
let KnowlarityVoiceStrategy = class KnowlarityVoiceStrategy {
|
|
12
|
+
async sendMessage(to, message, config) {
|
|
13
|
+
try {
|
|
14
|
+
if (!this.validateConfig(config)) {
|
|
15
|
+
throw new Error('Invalid Knowlarity Voice configuration');
|
|
16
|
+
}
|
|
17
|
+
console.log('Initiating voice call via Knowlarity to:', to);
|
|
18
|
+
return {
|
|
19
|
+
success: true,
|
|
20
|
+
messageId: `knowlarity-voice-${Date.now()}`,
|
|
21
|
+
provider: 'knowlarity',
|
|
22
|
+
service: 'THIRD_PARTY',
|
|
23
|
+
timestamp: new Date(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
provider: 'knowlarity',
|
|
30
|
+
service: 'THIRD_PARTY',
|
|
31
|
+
error: error.message,
|
|
32
|
+
timestamp: new Date(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
validateConfig(config) {
|
|
37
|
+
return config && config.apiKey && config.callerId && config.voiceUrl;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.KnowlarityVoiceStrategy = KnowlarityVoiceStrategy;
|
|
41
|
+
exports.KnowlarityVoiceStrategy = KnowlarityVoiceStrategy = __decorate([
|
|
42
|
+
(0, common_1.Injectable)()
|
|
43
|
+
], KnowlarityVoiceStrategy);
|
|
44
|
+
//# sourceMappingURL=knowlarity-voice.strategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowlarity-voice.strategy.js","sourceRoot":"","sources":["../../../../../src/module/communication/strategies/telephone/knowlarity-voice.strategy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAOrC,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,KAAK,CAAC,WAAW,CACf,EAAU,EACV,OAAe,EACf,MAAW;QAEX,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBACjC,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;YAC5D,CAAC;YAID,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,CAAC,CAAC;YAE5D,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,oBAAoB,IAAI,CAAC,GAAG,EAAE,EAAE;gBAC3C,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,aAAa;gBACtB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,YAAY;gBACtB,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,CAAC,OAAO;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;aACtB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,cAAc,CAAC,MAAW;QACxB,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC;IACvE,CAAC;CACF,CAAA;AApCY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;GACA,uBAAuB,CAoCnC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CommunicationStrategy, CommunicationResult } from '../communication.strategy';
|
|
2
|
+
export declare class WhatsAppCloudStrategy implements CommunicationStrategy {
|
|
3
|
+
sendMessage(to: string, message: string, config: any): Promise<CommunicationResult>;
|
|
4
|
+
validateConfig(config: any): boolean;
|
|
5
|
+
}
|