@servicelabsco/slabs-access-manager 0.1.198 → 0.1.199
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SendWebhookRequest = void 0;
|
|
4
|
-
const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
|
|
5
4
|
const business_webhook_entity_1 = require("../entities/business.webhook.entity");
|
|
6
5
|
const webhook_event_entity_1 = require("../entities/webhook.event.entity");
|
|
7
6
|
const webhook_log_entity_1 = require("../entities/webhook.log.entity");
|
|
@@ -18,13 +17,13 @@ class SendWebhookRequest {
|
|
|
18
17
|
async validate() {
|
|
19
18
|
const webhook = await business_webhook_entity_1.BusinessWebhookEntity.findOne({ where: { business_id: this.business.id } });
|
|
20
19
|
if (!webhook?.active)
|
|
21
|
-
|
|
20
|
+
return;
|
|
22
21
|
const event = await webhook_event_entity_1.WebhookEventEntity.findOne({ where: { identifier: this.payload.event_identifier } });
|
|
23
22
|
if (!event?.active)
|
|
24
|
-
|
|
23
|
+
return;
|
|
25
24
|
const hasEventEnabled = webhook.event_type.includes(event?.identifier);
|
|
26
25
|
if (!hasEventEnabled)
|
|
27
|
-
|
|
26
|
+
return;
|
|
28
27
|
this.event = event;
|
|
29
28
|
this.webhook = webhook;
|
|
30
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.webhook.request.js","sourceRoot":"","sources":["../../../src/access/libraries/send.webhook.request.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"send.webhook.request.js","sourceRoot":"","sources":["../../../src/access/libraries/send.webhook.request.ts"],"names":[],"mappings":";;;AAGA,iFAA4E;AAC5E,2EAAsE;AACtE,uEAAkE;AAMlE,MAAa,kBAAkB;IAM3B,YACqB,QAA8B,EAC9B,oBAA0C;QAD1C,aAAQ,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