@servicelabsco/slabs-access-manager 0.1.170 → 0.1.172
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/access/controllers/business.app.integration.controller.d.ts +2 -0
- package/dist/access/controllers/business.app.integration.controller.js +17 -0
- package/dist/access/controllers/business.app.integration.controller.js.map +1 -1
- package/dist/access/controllers/business.user.notification.preference.controller.js +3 -4
- package/dist/access/controllers/business.user.notification.preference.controller.js.map +1 -1
- package/dist/access/controllers/business.webhook.controller.d.ts +16 -0
- package/dist/access/controllers/business.webhook.controller.js +109 -0
- package/dist/access/controllers/business.webhook.controller.js.map +1 -0
- package/dist/access/controllers/index.d.ts +1 -0
- package/dist/access/controllers/index.js +1 -0
- package/dist/access/controllers/index.js.map +1 -1
- package/dist/access/dtos/add.business.user.notification.preference.dto.d.ts +1 -1
- package/dist/access/dtos/add.business.user.notification.preference.dto.js.map +1 -1
- package/dist/access/dtos/add.integration.preference.dto.d.ts +3 -0
- package/dist/access/dtos/add.integration.preference.dto.js +24 -0
- package/dist/access/dtos/add.integration.preference.dto.js.map +1 -0
- package/dist/access/dtos/add.notification.channel.preference.dto.d.ts +0 -1
- package/dist/access/dtos/add.notification.channel.preference.dto.js +0 -6
- package/dist/access/dtos/add.notification.channel.preference.dto.js.map +1 -1
- package/dist/access/dtos/add.webhook.dto.d.ts +5 -0
- package/dist/access/dtos/add.webhook.dto.js +36 -0
- package/dist/access/dtos/add.webhook.dto.js.map +1 -0
- package/dist/access/dtos/business.webhook.attributes.dto.d.ts +3 -0
- package/dist/access/dtos/business.webhook.attributes.dto.js +8 -0
- package/dist/access/dtos/business.webhook.attributes.dto.js.map +1 -0
- package/dist/access/dtos/index.d.ts +6 -0
- package/dist/access/dtos/index.js +6 -0
- package/dist/access/dtos/index.js.map +1 -1
- package/dist/access/dtos/send.webhook.request.payload.d.ts +4 -0
- package/dist/access/dtos/send.webhook.request.payload.js +7 -0
- package/dist/access/dtos/send.webhook.request.payload.js.map +1 -0
- package/dist/access/dtos/webhook.event.attributes.dto.d.ts +3 -0
- package/dist/access/dtos/webhook.event.attributes.dto.js +8 -0
- package/dist/access/dtos/webhook.event.attributes.dto.js.map +1 -0
- package/dist/access/dtos/webhook.log.attributes.dto.d.ts +3 -0
- package/dist/access/dtos/webhook.log.attributes.dto.js +8 -0
- package/dist/access/dtos/webhook.log.attributes.dto.js.map +1 -0
- package/dist/access/entities/app.integration.entity.d.ts +0 -1
- package/dist/access/entities/app.integration.entity.js +0 -4
- package/dist/access/entities/app.integration.entity.js.map +1 -1
- package/dist/access/entities/business.app.integration.entity.d.ts +2 -1
- package/dist/access/entities/business.app.integration.entity.js +6 -2
- package/dist/access/entities/business.app.integration.entity.js.map +1 -1
- package/dist/access/entities/business.webhook.entity.d.ts +12 -0
- package/dist/access/entities/business.webhook.entity.js +52 -0
- package/dist/access/entities/business.webhook.entity.js.map +1 -0
- package/dist/access/entities/index.d.ts +3 -0
- package/dist/access/entities/index.js +3 -0
- package/dist/access/entities/index.js.map +1 -1
- package/dist/access/entities/webhook.event.entity.d.ts +9 -0
- package/dist/access/entities/webhook.event.entity.js +42 -0
- package/dist/access/entities/webhook.event.entity.js.map +1 -0
- package/dist/access/entities/webhook.log.entity.d.ts +16 -0
- package/dist/access/entities/webhook.log.entity.js +66 -0
- package/dist/access/entities/webhook.log.entity.js.map +1 -0
- package/dist/access/es6.classes.d.ts +19 -7
- package/dist/access/es6.classes.js +32 -0
- package/dist/access/es6.classes.js.map +1 -1
- package/dist/access/jobs/business.webhook.job.d.ts +7 -0
- package/dist/access/jobs/business.webhook.job.js +29 -0
- package/dist/access/jobs/business.webhook.job.js.map +1 -0
- package/dist/access/jobs/email.message.job.js +2 -0
- package/dist/access/jobs/email.message.job.js.map +1 -1
- package/dist/access/jobs/index.d.ts +3 -0
- package/dist/access/jobs/index.js +3 -0
- package/dist/access/jobs/index.js.map +1 -1
- package/dist/access/jobs/webhook.event.job.d.ts +7 -0
- package/dist/access/jobs/webhook.event.job.js +29 -0
- package/dist/access/jobs/webhook.event.job.js.map +1 -0
- package/dist/access/jobs/webhook.log.job.d.ts +7 -0
- package/dist/access/jobs/webhook.log.job.js +29 -0
- package/dist/access/jobs/webhook.log.job.js.map +1 -0
- package/dist/access/libraries/business.notification.channel.preference.list.d.ts +0 -1
- package/dist/access/libraries/business.notification.channel.preference.list.js +0 -1
- package/dist/access/libraries/business.notification.channel.preference.list.js.map +1 -1
- package/dist/access/libraries/business.user.notification.preference.list.d.ts +0 -1
- package/dist/access/libraries/business.user.notification.preference.list.js +9 -3
- package/dist/access/libraries/business.user.notification.preference.list.js.map +1 -1
- package/dist/access/libraries/index.d.ts +1 -0
- package/dist/access/libraries/index.js +1 -0
- package/dist/access/libraries/index.js.map +1 -1
- package/dist/access/libraries/process.slack.integration.js +1 -0
- package/dist/access/libraries/process.slack.integration.js.map +1 -1
- package/dist/access/libraries/process.whatsapp.integration.js +1 -0
- package/dist/access/libraries/process.whatsapp.integration.js.map +1 -1
- package/dist/access/libraries/send.slack.message.notification.d.ts +3 -1
- package/dist/access/libraries/send.slack.message.notification.js +15 -3
- package/dist/access/libraries/send.slack.message.notification.js.map +1 -1
- package/dist/access/libraries/send.webhook.request.d.ts +20 -0
- package/dist/access/libraries/send.webhook.request.js +71 -0
- package/dist/access/libraries/send.webhook.request.js.map +1 -0
- package/dist/access/libraries/send.whatsapp.message.notification.js +9 -2
- package/dist/access/libraries/send.whatsapp.message.notification.js.map +1 -1
- package/dist/access/services/es6.jobs.service.d.ts +7 -1
- package/dist/access/services/es6.jobs.service.js +13 -1
- package/dist/access/services/es6.jobs.service.js.map +1 -1
- package/dist/access/services/index.d.ts +1 -0
- package/dist/access/services/index.js +1 -0
- package/dist/access/services/index.js.map +1 -1
- package/dist/access/services/notification.preference.service.d.ts +9 -0
- package/dist/access/services/notification.preference.service.js +50 -0
- package/dist/access/services/notification.preference.service.js.map +1 -0
- package/dist/access/services/notification.service.d.ts +6 -4
- package/dist/access/services/notification.service.js +7 -4
- package/dist/access/services/notification.service.js.map +1 -1
- package/dist/access/services/webhook.service.d.ts +5 -2
- package/dist/access/services/webhook.service.js +12 -2
- package/dist/access/services/webhook.service.js.map +1 -1
- package/dist/access/services/whatsapp.service.d.ts +8 -1
- package/dist/access/services/whatsapp.service.js +40 -2
- package/dist/access/services/whatsapp.service.js.map +1 -1
- package/dist/access/subscribers/business.webhook.subscriber.d.ts +10 -0
- package/dist/access/subscribers/business.webhook.subscriber.js +34 -0
- package/dist/access/subscribers/business.webhook.subscriber.js.map +1 -0
- package/dist/access/subscribers/index.d.ts +3 -0
- package/dist/access/subscribers/index.js +3 -0
- package/dist/access/subscribers/index.js.map +1 -1
- package/dist/access/subscribers/webhook.event.subscriber.d.ts +10 -0
- package/dist/access/subscribers/webhook.event.subscriber.js +34 -0
- package/dist/access/subscribers/webhook.event.subscriber.js.map +1 -0
- package/dist/access/subscribers/webhook.log.subscriber.d.ts +10 -0
- package/dist/access/subscribers/webhook.log.subscriber.js +34 -0
- package/dist/access/subscribers/webhook.log.subscriber.js.map +1 -0
- package/dist/accessUtility/es6.classes.d.ts +3 -3
- package/dist/config/entity.constants.d.ts +6 -0
- package/dist/config/entity.constants.js +6 -0
- package/dist/config/entity.constants.js.map +1 -1
- package/dist/migrations/1725422481585-CreateBusinessWebhookTable.d.ts +5 -0
- package/dist/migrations/1725422481585-CreateBusinessWebhookTable.js +22 -0
- package/dist/migrations/1725422481585-CreateBusinessWebhookTable.js.map +1 -0
- package/dist/migrations/1725428002811-CreateWebhookEventTable.d.ts +5 -0
- package/dist/migrations/1725428002811-CreateWebhookEventTable.js +21 -0
- package/dist/migrations/1725428002811-CreateWebhookEventTable.js.map +1 -0
- package/dist/migrations/1725428278040-CreateWebhookLogTable.d.ts +5 -0
- package/dist/migrations/1725428278040-CreateWebhookLogTable.js +24 -0
- package/dist/migrations/1725428278040-CreateWebhookLogTable.js.map +1 -0
- package/dist/migrations/1725439900529-AddVisibleColumnUtlNotificationDetailsTable.d.ts +5 -0
- package/dist/migrations/1725439900529-AddVisibleColumnUtlNotificationDetailsTable.js +15 -0
- package/dist/migrations/1725439900529-AddVisibleColumnUtlNotificationDetailsTable.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { SlackNotificationEntity } from '../../accessUtility/entities/slack.notification.entity';
|
|
2
2
|
import { NotificationPayloadDto } from '../dtos/notification.payload.dto';
|
|
3
3
|
import { SlackIntegrationEntity } from '../entities/slack.integration.entity';
|
|
4
|
+
import { NotificationPreferenceService } from '../services/notification.preference.service';
|
|
4
5
|
import { SlackService } from '../services/slack.service';
|
|
5
6
|
export declare class SendSlackMessageNotification {
|
|
6
7
|
protected readonly notification: SlackNotificationEntity;
|
|
7
8
|
protected readonly slackService: SlackService;
|
|
9
|
+
protected readonly notificationPreferenceService: NotificationPreferenceService;
|
|
8
10
|
private payload;
|
|
9
11
|
protected base_url: string;
|
|
10
12
|
protected token: string;
|
|
11
13
|
protected slackIntegration: SlackIntegrationEntity;
|
|
12
|
-
constructor(notification: SlackNotificationEntity, slackService: SlackService);
|
|
14
|
+
constructor(notification: SlackNotificationEntity, slackService: SlackService, notificationPreferenceService: NotificationPreferenceService);
|
|
13
15
|
process(payload: NotificationPayloadDto): Promise<void>;
|
|
14
16
|
private sendMessage;
|
|
15
17
|
private getContent;
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SendSlackMessageNotification = void 0;
|
|
4
4
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
+
const integration_type_constant_1 = require("../../config/integration.type.constant");
|
|
5
6
|
const slack_message_entity_1 = require("../entities/slack.message.entity");
|
|
7
|
+
const notification_channel_type_enum_1 = require("../enums/notification.channel.type.enum");
|
|
6
8
|
const notification_type_enum_1 = require("../enums/notification.type.enum");
|
|
7
9
|
class SendSlackMessageNotification {
|
|
8
|
-
constructor(notification, slackService) {
|
|
10
|
+
constructor(notification, slackService, notificationPreferenceService) {
|
|
9
11
|
this.notification = notification;
|
|
10
12
|
this.slackService = slackService;
|
|
13
|
+
this.notificationPreferenceService = notificationPreferenceService;
|
|
11
14
|
this.base_url = 'https://slack.com/api';
|
|
12
15
|
}
|
|
13
16
|
async process(payload) {
|
|
@@ -15,8 +18,17 @@ class SendSlackMessageNotification {
|
|
|
15
18
|
this.token = await this.slackService.getBusinessToken(this.payload.business.id);
|
|
16
19
|
if (!this.token)
|
|
17
20
|
return;
|
|
18
|
-
for (const user of this.payload.user_ids)
|
|
19
|
-
await this.
|
|
21
|
+
for (const user of this.payload.user_ids) {
|
|
22
|
+
const send = await this.notificationPreferenceService.isAllowedChannels({
|
|
23
|
+
business_id: this.slackIntegration.business_id,
|
|
24
|
+
channel_id: notification_channel_type_enum_1.NotificationChannelTypeEnum.SLACK,
|
|
25
|
+
notification_id: this.notification.id,
|
|
26
|
+
integration_identifier: integration_type_constant_1.IntegrationIdentifierConstants.slack,
|
|
27
|
+
user_id: user,
|
|
28
|
+
});
|
|
29
|
+
if (send)
|
|
30
|
+
await this.sendMessage(this.notification, user);
|
|
31
|
+
}
|
|
20
32
|
}
|
|
21
33
|
async sendMessage(notification, userId) {
|
|
22
34
|
const channel = await this.slackService.getUserChannel(this.payload.business.id, userId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.slack.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.slack.message.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAqF;
|
|
1
|
+
{"version":3,"file":"send.slack.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.slack.message.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAqF;AAErF,sFAAwF;AAIxF,2EAAsE;AAEtE,4FAAsF;AACtF,4EAAuE;AAIvE,MAAa,4BAA4B;IAQrC,YACuB,YAAqC,EACrC,YAA0B,EAC1B,6BAA4D;QAF5D,iBAAY,GAAZ,YAAY,C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C,UAAU,CAAC,OAAe,EAAE,OAAY,EAAE,QAAa;QACjE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAC1C,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE1C,MAAM,EAAE,GAAG,yCAAkB,CAAC,MAAM,CAAC;YACjC,WAAW,EAAE,QAAQ,CAAC,EAAE;YACxB,OAAO;YACP,qBAAqB,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE;YAC3C,OAAO,EAAE,6CAAoB,CAAC,OAAO;YACrC,OAAO;YACP,SAAS;YACT,WAAW;YACX,kBAAkB,EAAE,QAAQ,EAAE,EAAE;YAChC,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU;SACvC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACJ;AA5FD,oEA4FC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RemoteRequestService } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
import { SendWebhookRequestPayload } from '../dtos/send.webhook.request.payload';
|
|
3
|
+
import { AccessBusinessEntity } from '../entities/access.business.entity';
|
|
4
|
+
import { BusinessWebhookEntity } from '../entities/business.webhook.entity';
|
|
5
|
+
import { WebhookEventEntity } from '../entities/webhook.event.entity';
|
|
6
|
+
import { WebhookLogEntity } from '../entities/webhook.log.entity';
|
|
7
|
+
export declare class SendWebhookRequest {
|
|
8
|
+
private readonly business;
|
|
9
|
+
private readonly remoteRequestService;
|
|
10
|
+
protected webhook: BusinessWebhookEntity;
|
|
11
|
+
protected event: WebhookEventEntity;
|
|
12
|
+
protected payload: SendWebhookRequestPayload;
|
|
13
|
+
constructor(business: AccessBusinessEntity, remoteRequestService: RemoteRequestService);
|
|
14
|
+
process(payload: SendWebhookRequestPayload): Promise<BusinessWebhookEntity | WebhookLogEntity>;
|
|
15
|
+
private validate;
|
|
16
|
+
private sendRequest;
|
|
17
|
+
private disableWebhook;
|
|
18
|
+
private sleep;
|
|
19
|
+
private saveLog;
|
|
20
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendWebhookRequest = void 0;
|
|
4
|
+
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
|
+
const business_webhook_entity_1 = require("../entities/business.webhook.entity");
|
|
6
|
+
const webhook_event_entity_1 = require("../entities/webhook.event.entity");
|
|
7
|
+
const webhook_log_entity_1 = require("../entities/webhook.log.entity");
|
|
8
|
+
class SendWebhookRequest {
|
|
9
|
+
constructor(business, remoteRequestService) {
|
|
10
|
+
this.business = business;
|
|
11
|
+
this.remoteRequestService = remoteRequestService;
|
|
12
|
+
}
|
|
13
|
+
async process(payload) {
|
|
14
|
+
this.payload = payload;
|
|
15
|
+
await this.validate();
|
|
16
|
+
return this.sendRequest();
|
|
17
|
+
}
|
|
18
|
+
async validate() {
|
|
19
|
+
const webhook = await business_webhook_entity_1.BusinessWebhookEntity.findOne({ where: { business_id: this.business.id } });
|
|
20
|
+
if (!webhook?.active)
|
|
21
|
+
throw new nestjs_utility_services_1.OperationException('Webhook is not setup properly');
|
|
22
|
+
const event = await webhook_event_entity_1.WebhookEventEntity.findOne({ where: { identifier: this.payload.event_identifier } });
|
|
23
|
+
if (!event?.active)
|
|
24
|
+
throw new nestjs_utility_services_1.OperationException('Event is not setup properly');
|
|
25
|
+
this.webhook = webhook;
|
|
26
|
+
}
|
|
27
|
+
async sendRequest() {
|
|
28
|
+
const dataPayload = {
|
|
29
|
+
url: this.webhook.url,
|
|
30
|
+
methods: 'POST',
|
|
31
|
+
headers: {
|
|
32
|
+
'Content-Type': 'application/json',
|
|
33
|
+
},
|
|
34
|
+
data: this.payload?.payload,
|
|
35
|
+
};
|
|
36
|
+
let attempts = 0;
|
|
37
|
+
const maxAttempts = 3;
|
|
38
|
+
const delay = 30000;
|
|
39
|
+
while (attempts < maxAttempts) {
|
|
40
|
+
let data = await this.remoteRequestService.getRawResponse(dataPayload);
|
|
41
|
+
if (data?.status === 200)
|
|
42
|
+
return this.saveLog(data);
|
|
43
|
+
attempts++;
|
|
44
|
+
if (attempts < maxAttempts) {
|
|
45
|
+
await this.sleep(delay);
|
|
46
|
+
this.saveLog(data);
|
|
47
|
+
}
|
|
48
|
+
if (attempts === maxAttempts)
|
|
49
|
+
return this.disableWebhook();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async disableWebhook() {
|
|
53
|
+
this.webhook.active = false;
|
|
54
|
+
return this.webhook.save();
|
|
55
|
+
}
|
|
56
|
+
sleep(ms) {
|
|
57
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
58
|
+
}
|
|
59
|
+
async saveLog(request) {
|
|
60
|
+
const log = webhook_log_entity_1.WebhookLogEntity.create({ webhook_id: this.webhook.id });
|
|
61
|
+
log.event_id = this.event.id;
|
|
62
|
+
log.response_code = request.status;
|
|
63
|
+
log.attempted_at = new Date();
|
|
64
|
+
log.is_success = request.success;
|
|
65
|
+
log.payload = this.payload?.payload;
|
|
66
|
+
log.response_body = request.data;
|
|
67
|
+
return log.save();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.SendWebhookRequest = SendWebhookRequest;
|
|
71
|
+
//# sourceMappingURL=send.webhook.request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.webhook.request.js","sourceRoot":"","sources":["../../../src/access/libraries/send.webhook.request.ts"],"names":[],"mappings":";;;AAAA,oFAAwH;AAGxH,iFAA4E;AAC5E,2EAAsE;AACtE,uEAAkE;AAMlE,MAAa,kBAAkB;IAM3B,YACqB,QAA8B,EAC9B,oBAA0C;QAD1C,aAAQ,GAAR,QAAQ,CAAsB;QAC9B,yBAAoB,GAApB,oBAAoB,CAAsB;IAC5D,CAAC;IAEJ,KAAK,CAAC,OAAO,CA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15 @@ class SendWhatsappMessageNotification {
|
|
|
15
15
|
if (!this.token)
|
|
16
16
|
return;
|
|
17
17
|
this.payload = payload;
|
|
18
|
-
for (const user of this.payload.user_ids)
|
|
19
|
-
await this.
|
|
18
|
+
for (const user of this.payload.user_ids) {
|
|
19
|
+
const isAllowed = await this.whatsappService.isAllowedOnWhatsapp({
|
|
20
|
+
business_id: this.payload.business.id,
|
|
21
|
+
user_id: user,
|
|
22
|
+
notification_id: this.notification.id,
|
|
23
|
+
});
|
|
24
|
+
if (isAllowed)
|
|
25
|
+
await this.sendMessage(this.notification, user);
|
|
26
|
+
}
|
|
20
27
|
}
|
|
21
28
|
async sendMessage(notification, userId) {
|
|
22
29
|
const enabled = await this.whatsappService.hasWhatsappEnabled(this.payload.business.id, userId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.whatsapp.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.whatsapp.message.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAsG;AAKtG,iFAA4E;AAC5E,4EAAuE;AAOvE,MAAa,+BAA+B;IAIxC,YACqB,YAAwC,EACxC,eAAgC,EAChC,eAAgC;QAFhC,iBAAY,GAAZ,YAAY,CAA4B;QACxC,oBAAe,GAAf,eAAe,CAAiB;QAChC,oBAAe,GAAf,eAAe,CAAiB;IAClD,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAA+B;QACzC,IAAI,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,qBAAqB,EAAE,CAAC;QAChE,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QAExB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"send.whatsapp.message.notification.js","sourceRoot":"","sources":["../../../src/access/libraries/send.whatsapp.message.notification.ts"],"names":[],"mappings":";;;AAAA,oFAAsG;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,6CAAoB,CAAC,OAAO;YACrC,OAAO;YACP,QAAQ;YACR,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS;YACxC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW;YAC5C,kBAAkB,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc;YAC1D,UAAU,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU;SACvC,CAAC,CAAC;QAEH,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;CACJ;AA5HD,0EA4HC"}
|
|
@@ -12,6 +12,7 @@ import { BusinessUserGroupJob } from '../jobs/business.user.group.job';
|
|
|
12
12
|
import { BusinessUserJob } from '../jobs/business.user.job';
|
|
13
13
|
import { BusinessUserNotificationPreferenceJob } from '../jobs/business.user.notification.preference.job';
|
|
14
14
|
import { BusinessUserRoleJob } from '../jobs/business.user.role.job';
|
|
15
|
+
import { BusinessWebhookJob } from '../jobs/business.webhook.job';
|
|
15
16
|
import { BzNotificationChannelPreferenceJob } from '../jobs/bz.notification.channel.preference.job';
|
|
16
17
|
import { ChildMenuJob } from '../jobs/child.menu.job';
|
|
17
18
|
import { ChoiceListJob } from '../jobs/choice.list.job';
|
|
@@ -68,6 +69,8 @@ import { UserNotificationJob } from '../jobs/user.notification.job';
|
|
|
68
69
|
import { UserPreferenceJob } from '../jobs/user.preference.job';
|
|
69
70
|
import { UserRoleJob } from '../jobs/user.role.job';
|
|
70
71
|
import { WatchlistAssignmentJob } from '../jobs/watchlist.assignment.job';
|
|
72
|
+
import { WebhookEventJob } from '../jobs/webhook.event.job';
|
|
73
|
+
import { WebhookLogJob } from '../jobs/webhook.log.job';
|
|
71
74
|
import { WebhookSlugJob } from '../jobs/webhook.slug.job';
|
|
72
75
|
import { WebhookTypeJob } from '../jobs/webhook.type.job';
|
|
73
76
|
import { WhatsappIncomingWebhookJob } from '../jobs/whatsapp.incoming.webhook.job';
|
|
@@ -88,6 +91,7 @@ export declare class Es6JobsService {
|
|
|
88
91
|
private readonly businessUserJob;
|
|
89
92
|
private readonly businessUserNotificationPreferenceJob;
|
|
90
93
|
private readonly businessUserRoleJob;
|
|
94
|
+
private readonly businessWebhookJob;
|
|
91
95
|
private readonly bzNotificationChannelPreferenceJob;
|
|
92
96
|
private readonly childMenuJob;
|
|
93
97
|
private readonly choiceListJob;
|
|
@@ -144,13 +148,15 @@ export declare class Es6JobsService {
|
|
|
144
148
|
private readonly userPreferenceJob;
|
|
145
149
|
private readonly userRoleJob;
|
|
146
150
|
private readonly watchlistAssignmentJob;
|
|
151
|
+
private readonly webhookEventJob;
|
|
152
|
+
private readonly webhookLogJob;
|
|
147
153
|
private readonly webhookSlugJob;
|
|
148
154
|
private readonly webhookTypeJob;
|
|
149
155
|
private readonly whatsappIncomingWebhookJob;
|
|
150
156
|
private readonly whatsappMessageJob;
|
|
151
157
|
private readonly whatsappTemplateJob;
|
|
152
158
|
private jobs;
|
|
153
|
-
constructor(accessTestJob: AccessTestJob, apiAccountJob: ApiAccountJob, appIntegrationJob: AppIntegrationJob, businessAppIntegrationCredentialJob: BusinessAppIntegrationCredentialJob, businessAppIntegrationJob: BusinessAppIntegrationJob, businessAppIntegrationMessagesJob: BusinessAppIntegrationMessagesJob, businessEmailJob: BusinessEmailJob, businessGroupRoleJob: BusinessGroupRoleJob, businessMenuJob: BusinessMenuJob, businessPreferenceJob: BusinessPreferenceJob, businessUserGroupJob: BusinessUserGroupJob, businessUserJob: BusinessUserJob, businessUserNotificationPreferenceJob: BusinessUserNotificationPreferenceJob, businessUserRoleJob: BusinessUserRoleJob, bzNotificationChannelPreferenceJob: BzNotificationChannelPreferenceJob, childMenuJob: ChildMenuJob, choiceListJob: ChoiceListJob, choiceTypeJob: ChoiceTypeJob, conversationJob: ConversationJob, customFieldJob: CustomFieldJob, customReportJob: CustomReportJob, dashboardComponentJob: DashboardComponentJob, dashboardJob: DashboardJob, downloadLogJob: DownloadLogJob, emailAttachmentJob: EmailAttachmentJob, emailMessageJob: EmailMessageJob, emailRecipientJob: EmailRecipientJob, fcmMessageJob: FcmMessageJob, fcmNotificationJob: FcmNotificationJob, fcmTemplateJob: FcmTemplateJob, fcmTokenJob: FcmTokenJob, gchatIncomingWebhookJob: GchatIncomingWebhookJob, gchatMessageJob: GchatMessageJob, gchatTemplateJob: GchatTemplateJob, gchatUserJob: GchatUserJob, gchatWebhookJob: GchatWebhookJob, gchatWebhookMessageJob: GchatWebhookMessageJob, groupMemberJob: GroupMemberJob, groupRoleJob: GroupRoleJob, listPreferenceJob: ListPreferenceJob, listingColumnJob: ListingColumnJob, listingPageJob: ListingPageJob, listingPreferenceJob: ListingPreferenceJob, menuActionJob: MenuActionJob, menuJob: MenuJob, menuRoleJob: MenuRoleJob, moduleJob: ModuleJob, moduleMenuJob: ModuleMenuJob, preferenceUserGroupJob: PreferenceUserGroupJob, preferenceUsersJob: PreferenceUsersJob, processServerEmailJob: ProcessServerEmailJob, productJob: ProductJob, roleGroupJob: RoleGroupJob, scheduledReportEmailJob: ScheduledReportEmailJob, scheduledReportItemJob: ScheduledReportItemJob, scheduledReportJob: ScheduledReportJob, slackIncomingWebhookJob: SlackIncomingWebhookJob, slackIntegrationJob: SlackIntegrationJob, slackMessageJob: SlackMessageJob, slackTemplateJob: SlackTemplateJob, slackUserJob: SlackUserJob, slackWebhookJob: SlackWebhookJob, slackWebhookMessageJob: SlackWebhookMessageJob, syncBURoleJob: SyncBURoleJob, uiActionJob: UiActionJob, uiActionRoleJob: UiActionRoleJob, userNotificationJob: UserNotificationJob, userPreferenceJob: UserPreferenceJob, userRoleJob: UserRoleJob, watchlistAssignmentJob: WatchlistAssignmentJob, webhookSlugJob: WebhookSlugJob, webhookTypeJob: WebhookTypeJob, whatsappIncomingWebhookJob: WhatsappIncomingWebhookJob, whatsappMessageJob: WhatsappMessageJob, whatsappTemplateJob: WhatsappTemplateJob);
|
|
159
|
+
constructor(accessTestJob: AccessTestJob, apiAccountJob: ApiAccountJob, appIntegrationJob: AppIntegrationJob, businessAppIntegrationCredentialJob: BusinessAppIntegrationCredentialJob, businessAppIntegrationJob: BusinessAppIntegrationJob, businessAppIntegrationMessagesJob: BusinessAppIntegrationMessagesJob, businessEmailJob: BusinessEmailJob, businessGroupRoleJob: BusinessGroupRoleJob, businessMenuJob: BusinessMenuJob, businessPreferenceJob: BusinessPreferenceJob, businessUserGroupJob: BusinessUserGroupJob, businessUserJob: BusinessUserJob, businessUserNotificationPreferenceJob: BusinessUserNotificationPreferenceJob, businessUserRoleJob: BusinessUserRoleJob, businessWebhookJob: BusinessWebhookJob, bzNotificationChannelPreferenceJob: BzNotificationChannelPreferenceJob, childMenuJob: ChildMenuJob, choiceListJob: ChoiceListJob, choiceTypeJob: ChoiceTypeJob, conversationJob: ConversationJob, customFieldJob: CustomFieldJob, customReportJob: CustomReportJob, dashboardComponentJob: DashboardComponentJob, dashboardJob: DashboardJob, downloadLogJob: DownloadLogJob, emailAttachmentJob: EmailAttachmentJob, emailMessageJob: EmailMessageJob, emailRecipientJob: EmailRecipientJob, fcmMessageJob: FcmMessageJob, fcmNotificationJob: FcmNotificationJob, fcmTemplateJob: FcmTemplateJob, fcmTokenJob: FcmTokenJob, gchatIncomingWebhookJob: GchatIncomingWebhookJob, gchatMessageJob: GchatMessageJob, gchatTemplateJob: GchatTemplateJob, gchatUserJob: GchatUserJob, gchatWebhookJob: GchatWebhookJob, gchatWebhookMessageJob: GchatWebhookMessageJob, groupMemberJob: GroupMemberJob, groupRoleJob: GroupRoleJob, listPreferenceJob: ListPreferenceJob, listingColumnJob: ListingColumnJob, listingPageJob: ListingPageJob, listingPreferenceJob: ListingPreferenceJob, menuActionJob: MenuActionJob, menuJob: MenuJob, menuRoleJob: MenuRoleJob, moduleJob: ModuleJob, moduleMenuJob: ModuleMenuJob, preferenceUserGroupJob: PreferenceUserGroupJob, preferenceUsersJob: PreferenceUsersJob, processServerEmailJob: ProcessServerEmailJob, productJob: ProductJob, roleGroupJob: RoleGroupJob, scheduledReportEmailJob: ScheduledReportEmailJob, scheduledReportItemJob: ScheduledReportItemJob, scheduledReportJob: ScheduledReportJob, slackIncomingWebhookJob: SlackIncomingWebhookJob, slackIntegrationJob: SlackIntegrationJob, slackMessageJob: SlackMessageJob, slackTemplateJob: SlackTemplateJob, slackUserJob: SlackUserJob, slackWebhookJob: SlackWebhookJob, slackWebhookMessageJob: SlackWebhookMessageJob, syncBURoleJob: SyncBURoleJob, uiActionJob: UiActionJob, uiActionRoleJob: UiActionRoleJob, userNotificationJob: UserNotificationJob, userPreferenceJob: UserPreferenceJob, userRoleJob: UserRoleJob, watchlistAssignmentJob: WatchlistAssignmentJob, webhookEventJob: WebhookEventJob, webhookLogJob: WebhookLogJob, webhookSlugJob: WebhookSlugJob, webhookTypeJob: WebhookTypeJob, whatsappIncomingWebhookJob: WhatsappIncomingWebhookJob, whatsappMessageJob: WhatsappMessageJob, whatsappTemplateJob: WhatsappTemplateJob);
|
|
154
160
|
alignJobs(): void;
|
|
155
161
|
setJobs(): void;
|
|
156
162
|
}
|
|
@@ -25,6 +25,7 @@ const business_user_group_job_1 = require("../jobs/business.user.group.job");
|
|
|
25
25
|
const business_user_job_1 = require("../jobs/business.user.job");
|
|
26
26
|
const business_user_notification_preference_job_1 = require("../jobs/business.user.notification.preference.job");
|
|
27
27
|
const business_user_role_job_1 = require("../jobs/business.user.role.job");
|
|
28
|
+
const business_webhook_job_1 = require("../jobs/business.webhook.job");
|
|
28
29
|
const bz_notification_channel_preference_job_1 = require("../jobs/bz.notification.channel.preference.job");
|
|
29
30
|
const child_menu_job_1 = require("../jobs/child.menu.job");
|
|
30
31
|
const choice_list_job_1 = require("../jobs/choice.list.job");
|
|
@@ -81,6 +82,8 @@ const user_notification_job_1 = require("../jobs/user.notification.job");
|
|
|
81
82
|
const user_preference_job_1 = require("../jobs/user.preference.job");
|
|
82
83
|
const user_role_job_1 = require("../jobs/user.role.job");
|
|
83
84
|
const watchlist_assignment_job_1 = require("../jobs/watchlist.assignment.job");
|
|
85
|
+
const webhook_event_job_1 = require("../jobs/webhook.event.job");
|
|
86
|
+
const webhook_log_job_1 = require("../jobs/webhook.log.job");
|
|
84
87
|
const webhook_slug_job_1 = require("../jobs/webhook.slug.job");
|
|
85
88
|
const webhook_type_job_1 = require("../jobs/webhook.type.job");
|
|
86
89
|
const whatsapp_incoming_webhook_job_1 = require("../jobs/whatsapp.incoming.webhook.job");
|
|
@@ -88,7 +91,7 @@ const whatsapp_message_job_1 = require("../jobs/whatsapp.message.job");
|
|
|
88
91
|
const whatsapp_template_job_1 = require("../jobs/whatsapp.template.job");
|
|
89
92
|
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
90
93
|
let Es6JobsService = class Es6JobsService {
|
|
91
|
-
constructor(accessTestJob, apiAccountJob, appIntegrationJob, businessAppIntegrationCredentialJob, businessAppIntegrationJob, businessAppIntegrationMessagesJob, businessEmailJob, businessGroupRoleJob, businessMenuJob, businessPreferenceJob, businessUserGroupJob, businessUserJob, businessUserNotificationPreferenceJob, businessUserRoleJob, bzNotificationChannelPreferenceJob, childMenuJob, choiceListJob, choiceTypeJob, conversationJob, customFieldJob, customReportJob, dashboardComponentJob, dashboardJob, downloadLogJob, emailAttachmentJob, emailMessageJob, emailRecipientJob, fcmMessageJob, fcmNotificationJob, fcmTemplateJob, fcmTokenJob, gchatIncomingWebhookJob, gchatMessageJob, gchatTemplateJob, gchatUserJob, gchatWebhookJob, gchatWebhookMessageJob, groupMemberJob, groupRoleJob, listPreferenceJob, listingColumnJob, listingPageJob, listingPreferenceJob, menuActionJob, menuJob, menuRoleJob, moduleJob, moduleMenuJob, preferenceUserGroupJob, preferenceUsersJob, processServerEmailJob, productJob, roleGroupJob, scheduledReportEmailJob, scheduledReportItemJob, scheduledReportJob, slackIncomingWebhookJob, slackIntegrationJob, slackMessageJob, slackTemplateJob, slackUserJob, slackWebhookJob, slackWebhookMessageJob, syncBURoleJob, uiActionJob, uiActionRoleJob, userNotificationJob, userPreferenceJob, userRoleJob, watchlistAssignmentJob, webhookSlugJob, webhookTypeJob, whatsappIncomingWebhookJob, whatsappMessageJob, whatsappTemplateJob) {
|
|
94
|
+
constructor(accessTestJob, apiAccountJob, appIntegrationJob, businessAppIntegrationCredentialJob, businessAppIntegrationJob, businessAppIntegrationMessagesJob, businessEmailJob, businessGroupRoleJob, businessMenuJob, businessPreferenceJob, businessUserGroupJob, businessUserJob, businessUserNotificationPreferenceJob, businessUserRoleJob, businessWebhookJob, bzNotificationChannelPreferenceJob, childMenuJob, choiceListJob, choiceTypeJob, conversationJob, customFieldJob, customReportJob, dashboardComponentJob, dashboardJob, downloadLogJob, emailAttachmentJob, emailMessageJob, emailRecipientJob, fcmMessageJob, fcmNotificationJob, fcmTemplateJob, fcmTokenJob, gchatIncomingWebhookJob, gchatMessageJob, gchatTemplateJob, gchatUserJob, gchatWebhookJob, gchatWebhookMessageJob, groupMemberJob, groupRoleJob, listPreferenceJob, listingColumnJob, listingPageJob, listingPreferenceJob, menuActionJob, menuJob, menuRoleJob, moduleJob, moduleMenuJob, preferenceUserGroupJob, preferenceUsersJob, processServerEmailJob, productJob, roleGroupJob, scheduledReportEmailJob, scheduledReportItemJob, scheduledReportJob, slackIncomingWebhookJob, slackIntegrationJob, slackMessageJob, slackTemplateJob, slackUserJob, slackWebhookJob, slackWebhookMessageJob, syncBURoleJob, uiActionJob, uiActionRoleJob, userNotificationJob, userPreferenceJob, userRoleJob, watchlistAssignmentJob, webhookEventJob, webhookLogJob, webhookSlugJob, webhookTypeJob, whatsappIncomingWebhookJob, whatsappMessageJob, whatsappTemplateJob) {
|
|
92
95
|
this.accessTestJob = accessTestJob;
|
|
93
96
|
this.apiAccountJob = apiAccountJob;
|
|
94
97
|
this.appIntegrationJob = appIntegrationJob;
|
|
@@ -103,6 +106,7 @@ let Es6JobsService = class Es6JobsService {
|
|
|
103
106
|
this.businessUserJob = businessUserJob;
|
|
104
107
|
this.businessUserNotificationPreferenceJob = businessUserNotificationPreferenceJob;
|
|
105
108
|
this.businessUserRoleJob = businessUserRoleJob;
|
|
109
|
+
this.businessWebhookJob = businessWebhookJob;
|
|
106
110
|
this.bzNotificationChannelPreferenceJob = bzNotificationChannelPreferenceJob;
|
|
107
111
|
this.childMenuJob = childMenuJob;
|
|
108
112
|
this.choiceListJob = choiceListJob;
|
|
@@ -159,6 +163,8 @@ let Es6JobsService = class Es6JobsService {
|
|
|
159
163
|
this.userPreferenceJob = userPreferenceJob;
|
|
160
164
|
this.userRoleJob = userRoleJob;
|
|
161
165
|
this.watchlistAssignmentJob = watchlistAssignmentJob;
|
|
166
|
+
this.webhookEventJob = webhookEventJob;
|
|
167
|
+
this.webhookLogJob = webhookLogJob;
|
|
162
168
|
this.webhookSlugJob = webhookSlugJob;
|
|
163
169
|
this.webhookTypeJob = webhookTypeJob;
|
|
164
170
|
this.whatsappIncomingWebhookJob = whatsappIncomingWebhookJob;
|
|
@@ -184,6 +190,7 @@ let Es6JobsService = class Es6JobsService {
|
|
|
184
190
|
'1df027a19ec3d416b60ffd7024e39e5c': this.businessUserJob,
|
|
185
191
|
bef296dfcb922abc58344ca1934086c1: this.businessUserNotificationPreferenceJob,
|
|
186
192
|
'4a7a00b3a8090e793aeabb9277e2d725': this.businessUserRoleJob,
|
|
193
|
+
'8ea4526f7a5a487483b9e0e4501f6e52': this.businessWebhookJob,
|
|
187
194
|
'46618f9a228f03defd50fa0b6e120225': this.bzNotificationChannelPreferenceJob,
|
|
188
195
|
'589559e61985b6f208ec30499776da52': this.childMenuJob,
|
|
189
196
|
'9d8c018247752b52610a6835efb38a47': this.choiceListJob,
|
|
@@ -240,6 +247,8 @@ let Es6JobsService = class Es6JobsService {
|
|
|
240
247
|
cde37d522acab091e506685644fa3a97: this.userPreferenceJob,
|
|
241
248
|
'98f60308658ff30626fe84c0b0b55165': this.userRoleJob,
|
|
242
249
|
b94cb401a0d650c3f10517b174d3001d: this.watchlistAssignmentJob,
|
|
250
|
+
d6398176da2ef9abab52f8974d249942: this.webhookEventJob,
|
|
251
|
+
'4147e479deae8d2de827bb0a1b9a8c2d': this.webhookLogJob,
|
|
243
252
|
e3aab928b4498843a7c7190423b970e5: this.webhookSlugJob,
|
|
244
253
|
f4371a5f19fff6452debabc49b4a30b1: this.webhookTypeJob,
|
|
245
254
|
d3a34304ad77ca3c3cd075b42fb50a0a: this.whatsappIncomingWebhookJob,
|
|
@@ -268,6 +277,7 @@ exports.Es6JobsService = Es6JobsService = __decorate([
|
|
|
268
277
|
business_user_job_1.BusinessUserJob,
|
|
269
278
|
business_user_notification_preference_job_1.BusinessUserNotificationPreferenceJob,
|
|
270
279
|
business_user_role_job_1.BusinessUserRoleJob,
|
|
280
|
+
business_webhook_job_1.BusinessWebhookJob,
|
|
271
281
|
bz_notification_channel_preference_job_1.BzNotificationChannelPreferenceJob,
|
|
272
282
|
child_menu_job_1.ChildMenuJob,
|
|
273
283
|
choice_list_job_1.ChoiceListJob,
|
|
@@ -324,6 +334,8 @@ exports.Es6JobsService = Es6JobsService = __decorate([
|
|
|
324
334
|
user_preference_job_1.UserPreferenceJob,
|
|
325
335
|
user_role_job_1.UserRoleJob,
|
|
326
336
|
watchlist_assignment_job_1.WatchlistAssignmentJob,
|
|
337
|
+
webhook_event_job_1.WebhookEventJob,
|
|
338
|
+
webhook_log_job_1.WebhookLogJob,
|
|
327
339
|
webhook_slug_job_1.WebhookSlugJob,
|
|
328
340
|
webhook_type_job_1.WebhookTypeJob,
|
|
329
341
|
whatsapp_incoming_webhook_job_1.WhatsappIncomingWebhookJob,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/access/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAwD;AACxD,6DAAwD;AACxD,qEAAgE;AAChE,6GAAsG;AACtG,uFAAiF;AACjF,yGAAkG;AAClG,mEAA8D;AAC9D,6EAAuE;AACvE,iEAA4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,qCAA4E,EAC5E,mBAAwC,EACxC,kCAAsE,EACtE,YAA0B,EAC1B,aAA4B,EAC5B,aAA4B,EAC5B,eAAgC,EAChC,cAA8B,EAC9B,eAAgC,EAChC,qBAA4C,EAC5C,YAA0B,EAC1B,cAA8B,EAC9B,kBAAsC,EACtC,eAAgC,EAChC,iBAAoC,EACpC,aAA4B,EAC5B,kBAAsC,EACtC,cAA8B,EAC9B,WAAwB,EACxB,uBAAgD,EAChD,eAAgC,EAChC,gBAAkC,EAClC,YAA0B,EAC1B,eAAgC,EAChC,sBAA8C,EAC9C,cAA8B,EAC9B,YAA0B,EAC1B,iBAAoC,EACpC,gBAAkC,EAClC,cAA8B,EAC9B,oBAA0C,EAC1C,aAA4B,EAC5B,OAAgB,EAChB,WAAwB,EACxB,SAAoB,EACpB,aAA4B,EAC5B,sBAA8C,EAC9C,kBAAsC,EACtC,qBAA4C,EAC5C,UAAsB,EACtB,YAA0B,EAC1B,uBAAgD,EAChD,sBAA8C,EAC9C,kBAAsC,EACtC,uBAAgD,EAChD,mBAAwC,EACxC,eAAgC,EAChC,gBAAkC,EAClC,YAA0B,EAC1B,eAAgC,EAChC,sBAA8C,EAC9C,aAA4B,EAC5B,WAAwB,EACxB,eAAgC,EAChC,mBAAwC,EACxC,iBAAoC,EACpC,WAAwB,EACxB,sBAA8C,EAC9C,cAA8B,EAC9B,cAA8B,EAC9B,0BAAsD,EACtD,kBAAsC,EACtC,mBAAwC;
|
|
1
|
+
{"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/access/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAwD;AACxD,6DAAwD;AACxD,qEAAgE;AAChE,6GAAsG;AACtG,uFAAiF;AACjF,yGAAkG;AAClG,mEAA8D;AAC9D,6EAAuE;AACvE,iEAA4D;AAC5D,6EAAwE;AACxE,6EAAuE;AACvE,iEAA4D;AAC5D,iHAA0G;AAC1G,2EAAqE;AACrE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CAAqB;QAC9B,4BAAY;QACV,iCAAc;QACV,yCAAkB;QACrB,mCAAe;QACb,uCAAiB;QACrB,+BAAa;QACR,yCAAkB;QACtB,iCAAc;QACjB,2BAAW;QACC,oDAAuB;QAC/B,mCAAe;QACd,qCAAgB;QACpB,6BAAY;QACT,mCAAe;QACR,kDAAsB;QAC9B,iCAAc;QAChB,6BAAY;QACP,uCAAiB;QAClB,qCAAgB;QAClB,iCAAc;QACR,6CAAoB;QAC3B,+BAAa;QACnB,kBAAO;QACH,2BAAW;QACb,sBAAS;QACL,+BAAa;QACJ,kDAAsB;QAC1B,yCAAkB;QACf,gDAAqB;QAChC,wBAAU;QACR,6BAAY;QACD,oDAAuB;QACxB,kDAAsB;QAC1B,yCAAkB;QACb,oDAAuB;QAC3B,2CAAmB;QACvB,mCAAe;QACd,qCAAgB;QACpB,6BAAY;QACT,mCAAe;QACR,kDAAsB;QAC/B,iCAAa;QACf,2BAAW;QACP,oCAAe;QACX,2CAAmB;QACrB,uCAAiB;QACvB,2BAAW;QACA,iDAAsB;QAC7B,mCAAe;QACjB,+BAAa;QACZ,iCAAc;QACd,iCAAc;QACF,0DAA0B;QAClC,yCAAkB;QACjB,2CAAmB;GAjFpD,cAAc,CAqL1B"}
|
|
@@ -11,6 +11,7 @@ export * from './gpt.service';
|
|
|
11
11
|
export * from './listing.preference.service';
|
|
12
12
|
export * from './listing.service';
|
|
13
13
|
export * from './load.entity.service';
|
|
14
|
+
export * from './notification.preference.service';
|
|
14
15
|
export * from './notification.service';
|
|
15
16
|
export * from './platform.service';
|
|
16
17
|
export * from './scheduled.report.service';
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./gpt.service"), exports);
|
|
|
27
27
|
__exportStar(require("./listing.preference.service"), exports);
|
|
28
28
|
__exportStar(require("./listing.service"), exports);
|
|
29
29
|
__exportStar(require("./load.entity.service"), exports);
|
|
30
|
+
__exportStar(require("./notification.preference.service"), exports);
|
|
30
31
|
__exportStar(require("./notification.service"), exports);
|
|
31
32
|
__exportStar(require("./platform.service"), exports);
|
|
32
33
|
__exportStar(require("./scheduled.report.service"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAAA,0DAAwC;AAAA,wDAAsC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,gEAA8C;AAAA,+DAA6C;AAAA,yDAAuC;AAAA,kDAAgC;AAAA,gDAA8B;AAAA,+DAA6C;AAAA,oDAAkC;AAAA,wDAAsC;AAAA,yDAAuC;AAAA,qDAAmC;AAAA,6DAA2C;AAAA,uDAAqC;AAAA,kDAAgC;AAAA,kDAAgC;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,qDAAkC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/access/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAAA,0DAAwC;AAAA,wDAAsC;AAAA,4DAA0C;AAAA,sDAAoC;AAAA,gEAA8C;AAAA,+DAA6C;AAAA,yDAAuC;AAAA,kDAAgC;AAAA,gDAA8B;AAAA,+DAA6C;AAAA,oDAAkC;AAAA,wDAAsC;AAAA,oEAAkD;AAAA,yDAAuC;AAAA,qDAAmC;AAAA,6DAA2C;AAAA,uDAAqC;AAAA,kDAAgC;AAAA,kDAAgC;AAAA,8DAA4C;AAAA,4DAA0C;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,qDAAkC"}
|
|
@@ -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.NotificationPreferenceService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const app_integration_entity_1 = require("../entities/app.integration.entity");
|
|
12
|
+
const business_app_integration_entity_1 = require("../entities/business.app.integration.entity");
|
|
13
|
+
const business_user_notification_preference_entity_1 = require("../entities/business.user.notification.preference.entity");
|
|
14
|
+
const bz_notification_channel_preference_entity_1 = require("../entities/bz.notification.channel.preference.entity");
|
|
15
|
+
let NotificationPreferenceService = class NotificationPreferenceService {
|
|
16
|
+
async isAllowedChannels(payload) {
|
|
17
|
+
const integration = await app_integration_entity_1.AppIntegrationEntity.findOne({ where: { integration_identifier: payload.integration_identifier } });
|
|
18
|
+
if (!integration)
|
|
19
|
+
return false;
|
|
20
|
+
const businessIntegration = await business_app_integration_entity_1.BusinessAppIntegrationEntity.findOne({
|
|
21
|
+
where: { business_id: payload.business_id, integration_id: integration?.id, active: true },
|
|
22
|
+
relations: ['integration'],
|
|
23
|
+
});
|
|
24
|
+
if (!businessIntegration)
|
|
25
|
+
return false;
|
|
26
|
+
if (businessIntegration.enabled_globally)
|
|
27
|
+
return true;
|
|
28
|
+
const notificationUserPreference = await business_user_notification_preference_entity_1.BusinessUserNotificationPreferenceEntity.findOne({
|
|
29
|
+
where: {
|
|
30
|
+
notification_id: payload.notification_id,
|
|
31
|
+
user_id: payload.user_id,
|
|
32
|
+
business_id: payload.business_id,
|
|
33
|
+
channel_id: payload.channel_id,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (!notificationUserPreference?.active)
|
|
37
|
+
return false;
|
|
38
|
+
const notificationChannelPreference = await bz_notification_channel_preference_entity_1.BzNotificationChannelPreferenceEntity.findOne({
|
|
39
|
+
where: { business_id: payload.business_id, user_id: payload.user_id, channel_id: payload.channel_id },
|
|
40
|
+
});
|
|
41
|
+
if (!notificationChannelPreference?.active)
|
|
42
|
+
return false;
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.NotificationPreferenceService = NotificationPreferenceService;
|
|
47
|
+
exports.NotificationPreferenceService = NotificationPreferenceService = __decorate([
|
|
48
|
+
(0, common_1.Injectable)()
|
|
49
|
+
], NotificationPreferenceService);
|
|
50
|
+
//# sourceMappingURL=notification.preference.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.preference.service.js","sourceRoot":"","sources":["../../../src/access/services/notification.preference.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,+EAA0E;AAC1E,iGAA2F;AAC3F,2HAAoH;AACpH,qHAA8G;AAGvG,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACtC,KAAK,CAAC,iBAAiB,CAAC,OAMvB;QACG,MAAM,WAAW,GAAG,MAAM,6CAAoB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;QAC9H,IAAI,CAAC,WAAW;YAAE,OAAO,KAAK,CAAC;QAE/B,MAAM,mBAAmB,GAAG,MAAM,8DAA4B,CAAC,OAAO,CAAC;YACnE,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1F,SAAS,EAAE,CAAC,aAAa,CAAC;SAC7B,CAAC,CAAC;QACH,IAAI,CAAC,mBAAmB;YAAE,OAAO,KAAK,CAAC;QACvC,IAAI,mBAAmB,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC;QAEtD,MAAM,0BAA0B,GAAG,MAAM,uFAAwC,CAAC,OAAO,CAAC;YACtF,KAAK,EAAE;gBACH,eAAe,EAAE,OAAO,CAAC,eAAe;gBACxC,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,WAAW,EAAE,OAAO,CAAC,WAAW;gBAChC,UAAU,EAAE,OAAO,CAAC,UAAU;aACjC;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,0BAA0B,EAAE,MAAM;YAAE,OAAO,KAAK,CAAC;QAEtD,MAAM,6BAA6B,GAAG,MAAM,iFAAqC,CAAC,OAAO,CAAC;YACtF,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;SACxG,CAAC,CAAC;QACH,IAAI,CAAC,6BAA6B,EAAE,MAAM;YAAE,OAAO,KAAK,CAAC;QAEzD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ,CAAA;AAnCY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,mBAAU,GAAE;GACA,6BAA6B,CAmCzC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { CacheService, PropertyService, RemoteRequestService, SmsService } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
import { EmailNotificationEntity } from '../../accessUtility/entities/email.notification.entity';
|
|
3
|
+
import { FcmNotificationEntity } from '../../accessUtility/entities/fcm.notification.entity';
|
|
2
4
|
import { GchatNotificationEntity } from '../../accessUtility/entities/gchat.notification.entity';
|
|
3
5
|
import { SlackNotificationEntity } from '../../accessUtility/entities/slack.notification.entity';
|
|
6
|
+
import { SmsNotificationEntity } from '../../accessUtility/entities/sms.notification.entity';
|
|
4
7
|
import { WhatsappNotificationEntity } from '../../accessUtility/entities/whatsapp.notification.entity';
|
|
5
8
|
import { NotificationPayloadDto } from '../dtos/notification.payload.dto';
|
|
6
9
|
import { GchatWebhookEntity } from '../entities/gchat.webhook.entity';
|
|
7
10
|
import { GchatService } from './gchat.service';
|
|
11
|
+
import { NotificationPreferenceService } from './notification.preference.service';
|
|
8
12
|
import { SendEmailService } from './send.email.service';
|
|
9
13
|
import { SlackService } from './slack.service';
|
|
10
14
|
import { WhatsappService } from './whatsapp.service';
|
|
11
|
-
import { EmailNotificationEntity } from '../../accessUtility/entities/email.notification.entity';
|
|
12
|
-
import { SmsNotificationEntity } from '../../accessUtility/entities/sms.notification.entity';
|
|
13
|
-
import { FcmNotificationEntity } from '../../accessUtility/entities/fcm.notification.entity';
|
|
14
15
|
export declare class NotificationService {
|
|
15
16
|
protected readonly remoteRequestService: RemoteRequestService;
|
|
16
17
|
protected readonly cacheService: CacheService;
|
|
@@ -20,7 +21,8 @@ export declare class NotificationService {
|
|
|
20
21
|
protected readonly gchatService: GchatService;
|
|
21
22
|
protected readonly sendEmailService: SendEmailService;
|
|
22
23
|
protected readonly smsService: SmsService;
|
|
23
|
-
|
|
24
|
+
protected readonly notificationPreferenceService: NotificationPreferenceService;
|
|
25
|
+
constructor(remoteRequestService: RemoteRequestService, cacheService: CacheService, slackService: SlackService, propertyService: PropertyService, whatsappService: WhatsappService, gchatService: GchatService, sendEmailService: SendEmailService, smsService: SmsService, notificationPreferenceService: NotificationPreferenceService);
|
|
24
26
|
sendSlackMessage(notification: SlackNotificationEntity, payload: NotificationPayloadDto): Promise<void>;
|
|
25
27
|
sendSlackWebhook(notification: SlackNotificationEntity, payload: NotificationPayloadDto): Promise<void>;
|
|
26
28
|
sendWhatsappMessage(notification: WhatsappNotificationEntity, payload: NotificationPayloadDto): Promise<void>;
|
|
@@ -15,18 +15,19 @@ const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-service
|
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
16
|
const slack_webhook_entity_1 = require("../entities/slack.webhook.entity");
|
|
17
17
|
const send_email_notification_1 = require("../libraries/send.email.notification");
|
|
18
|
+
const send_fcm_notification_1 = require("../libraries/send.fcm.notification");
|
|
18
19
|
const send_gchat_message_notification_1 = require("../libraries/send.gchat.message.notification");
|
|
19
20
|
const send_gchat_webhook_notification_1 = require("../libraries/send.gchat.webhook.notification");
|
|
20
21
|
const send_slack_message_notification_1 = require("../libraries/send.slack.message.notification");
|
|
21
22
|
const send_slack_webhook_notification_1 = require("../libraries/send.slack.webhook.notification.");
|
|
22
23
|
const send_whatsapp_message_notification_1 = require("../libraries/send.whatsapp.message.notification");
|
|
23
24
|
const gchat_service_1 = require("./gchat.service");
|
|
25
|
+
const notification_preference_service_1 = require("./notification.preference.service");
|
|
24
26
|
const send_email_service_1 = require("./send.email.service");
|
|
25
27
|
const slack_service_1 = require("./slack.service");
|
|
26
28
|
const whatsapp_service_1 = require("./whatsapp.service");
|
|
27
|
-
const send_fcm_notification_1 = require("../libraries/send.fcm.notification");
|
|
28
29
|
let NotificationService = class NotificationService {
|
|
29
|
-
constructor(remoteRequestService, cacheService, slackService, propertyService, whatsappService, gchatService, sendEmailService, smsService) {
|
|
30
|
+
constructor(remoteRequestService, cacheService, slackService, propertyService, whatsappService, gchatService, sendEmailService, smsService, notificationPreferenceService) {
|
|
30
31
|
this.remoteRequestService = remoteRequestService;
|
|
31
32
|
this.cacheService = cacheService;
|
|
32
33
|
this.slackService = slackService;
|
|
@@ -35,9 +36,10 @@ let NotificationService = class NotificationService {
|
|
|
35
36
|
this.gchatService = gchatService;
|
|
36
37
|
this.sendEmailService = sendEmailService;
|
|
37
38
|
this.smsService = smsService;
|
|
39
|
+
this.notificationPreferenceService = notificationPreferenceService;
|
|
38
40
|
}
|
|
39
41
|
async sendSlackMessage(notification, payload) {
|
|
40
|
-
return new send_slack_message_notification_1.SendSlackMessageNotification(notification, this.slackService).process(payload);
|
|
42
|
+
return new send_slack_message_notification_1.SendSlackMessageNotification(notification, this.slackService, this.notificationPreferenceService).process(payload);
|
|
41
43
|
}
|
|
42
44
|
async sendSlackWebhook(notification, payload) {
|
|
43
45
|
const records = await slack_webhook_entity_1.SlackWebhookEntity.find({
|
|
@@ -91,6 +93,7 @@ exports.NotificationService = NotificationService = __decorate([
|
|
|
91
93
|
whatsapp_service_1.WhatsappService,
|
|
92
94
|
gchat_service_1.GchatService,
|
|
93
95
|
send_email_service_1.SendEmailService,
|
|
94
|
-
nestjs_utility_services_1.SmsService
|
|
96
|
+
nestjs_utility_services_1.SmsService,
|
|
97
|
+
notification_preference_service_1.NotificationPreferenceService])
|
|
95
98
|
], NotificationService);
|
|
96
99
|
//# sourceMappingURL=notification.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../src/access/services/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAQgD;AAChD,qCAA0C;
|
|
1
|
+
{"version":3,"file":"notification.service.js","sourceRoot":"","sources":["../../../src/access/services/notification.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAQgD;AAChD,qCAA0C;AAS1C,2EAAsE;AACtE,kFAA6E;AAC7E,8EAAyE;AACzE,kGAA4F;AAC5F,kGAA4F;AAC5F,kGAA4F;AAC5F,mGAA6F;AAC7F,wGAAkG;AAClG,mDAA+C;AAC/C,uFAAkF;AAClF,6DAAwD;AACxD,mDAA+C;AAC/C,yDAAqD;AAG9C,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC5B,YACuB,oBAA0C,EAC1C,YAA0B,EAC1B,YAA0B,EAC1B,eAAgC,EAChC,eAAgC,EAChC,YAA0B,EAC1B,gBAAkC,EAClC,UAAsB,EACtB,6BAA4D;QAR5D,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,oBAAe,GAAf,eAAe,CAAiB;QAChC,oBAAe,GAAf,eAAe,CAAiB;QAChC,iBAAY,GAAZ,YAAY,CAAc;QAC1B,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC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BACnC,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,QAAQ,EAAE,UAAU;aACvB,CAAC;YACF,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACrD,CAAC;IACL,CAAC;CACJ,CAAA;AAlEY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAGoC,8CAAoB;QAC5B,sCAAY;QACZ,4BAAY;QACT,yCAAe;QACf,kCAAe;QAClB,4BAAY;QACR,qCAAgB;QACtB,oCAAU;QACS,+DAA6B;GAV1E,mBAAmB,CAkE/B"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { CacheService } from '@servicelabsco/nestjs-utility-services';
|
|
1
|
+
import { CacheService, RemoteRequestService } from '@servicelabsco/nestjs-utility-services';
|
|
2
|
+
import { SendWebhookRequestPayload } from '../dtos/send.webhook.request.payload';
|
|
2
3
|
export declare class WebhookService {
|
|
3
4
|
protected readonly cacheService: CacheService;
|
|
4
|
-
|
|
5
|
+
private readonly remoteRequestService;
|
|
6
|
+
constructor(cacheService: CacheService, remoteRequestService: RemoteRequestService);
|
|
5
7
|
getJob(type: string): Promise<any>;
|
|
6
8
|
setJobFromDb(name: string): Promise<string>;
|
|
7
9
|
getSlugBusiness(slug: string): Promise<any>;
|
|
10
|
+
triggerEvent(business_id: number, payload: SendWebhookRequestPayload): Promise<import("..").BusinessWebhookEntity | import("..").WebhookLogEntity>;
|
|
8
11
|
}
|