@hed-hog/core 0.0.322 → 0.0.326
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/auth/guards/auth.guard.d.ts.map +1 -1
- package/dist/auth/guards/auth.guard.js +0 -1
- package/dist/auth/guards/auth.guard.js.map +1 -1
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +3 -0
- package/dist/core.module.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/integration/services/outbox.processor.d.ts.map +1 -1
- package/dist/integration/services/outbox.processor.js +1 -0
- package/dist/integration/services/outbox.processor.js.map +1 -1
- package/dist/integration/types/event.types.d.ts +1 -0
- package/dist/integration/types/event.types.d.ts.map +1 -1
- package/dist/mail/mail.controller.d.ts +2 -0
- package/dist/mail/mail.controller.d.ts.map +1 -1
- package/dist/mail/mail.module.d.ts.map +1 -1
- package/dist/mail/mail.module.js +33 -53
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +5 -1
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +64 -84
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/role/role.service.d.ts +3 -1
- package/dist/role/role.service.d.ts.map +1 -1
- package/dist/role/role.service.js +33 -5
- package/dist/role/role.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +1 -0
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/user/user.service.d.ts +3 -1
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +31 -4
- package/dist/user/user.service.js.map +1 -1
- package/dist/webhook-integration/event-webhook.controller.d.ts +29 -0
- package/dist/webhook-integration/event-webhook.controller.d.ts.map +1 -0
- package/dist/webhook-integration/event-webhook.controller.js +93 -0
- package/dist/webhook-integration/event-webhook.controller.js.map +1 -0
- package/dist/webhook-integration/event-webhook.service.d.ts +54 -0
- package/dist/webhook-integration/event-webhook.service.d.ts.map +1 -0
- package/dist/webhook-integration/event-webhook.service.js +334 -0
- package/dist/webhook-integration/event-webhook.service.js.map +1 -0
- package/dist/webhook-integration/integration-event-catalog.controller.d.ts +21 -0
- package/dist/webhook-integration/integration-event-catalog.controller.d.ts.map +1 -0
- package/dist/webhook-integration/integration-event-catalog.controller.js +91 -0
- package/dist/webhook-integration/integration-event-catalog.controller.js.map +1 -0
- package/dist/webhook-integration/integration-event-catalog.service.d.ts +26 -0
- package/dist/webhook-integration/integration-event-catalog.service.d.ts.map +1 -0
- package/dist/webhook-integration/integration-event-catalog.service.js +112 -0
- package/dist/webhook-integration/integration-event-catalog.service.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts +44 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -0
- package/dist/webhook-integration/webhook-integration.controller.js +181 -0
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.module.d.ts +3 -0
- package/dist/webhook-integration/webhook-integration.module.d.ts.map +1 -0
- package/dist/webhook-integration/webhook-integration.module.js +54 -0
- package/dist/webhook-integration/webhook-integration.module.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.service.d.ts +73 -0
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -0
- package/dist/webhook-integration/webhook-integration.service.js +569 -0
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -0
- package/dist/webhook-integration/webhook-utils.d.ts +7 -0
- package/dist/webhook-integration/webhook-utils.d.ts.map +1 -0
- package/dist/webhook-integration/webhook-utils.js +104 -0
- package/dist/webhook-integration/webhook-utils.js.map +1 -0
- package/hedhog/data/integration_event_catalog.yaml +118 -0
- package/hedhog/data/mail_profile.yaml +18 -0
- package/hedhog/data/menu.yaml +26 -12
- package/hedhog/data/route.yaml +154 -10
- package/hedhog/data/setting_group.yaml +7 -156
- package/hedhog/data/setting_subgroup.yaml +0 -32
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +205 -0
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +1835 -0
- package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +4 -7
- package/hedhog/frontend/messages/en.json +2 -1
- package/hedhog/frontend/messages/pt.json +2 -1
- package/hedhog/table/event_webhook.yaml +55 -0
- package/hedhog/table/event_webhook_delivery_log.yaml +66 -0
- package/hedhog/table/event_webhook_event.yaml +26 -0
- package/hedhog/table/integration_event_catalog.yaml +41 -0
- package/hedhog/table/setting.yaml +1 -0
- package/hedhog/table/webhook_action.yaml +85 -0
- package/hedhog/table/webhook_call_log.yaml +46 -0
- package/hedhog/table/webhook_integration.yaml +43 -0
- package/package.json +3 -3
- package/src/auth/guards/auth.guard.ts +0 -2
- package/src/core.module.ts +10 -7
- package/src/index.ts +10 -5
- package/src/integration/services/outbox.processor.ts +5 -4
- package/src/integration/types/event.types.ts +4 -3
- package/src/mail/mail.module.ts +36 -59
- package/src/mail/mail.service.ts +84 -89
- package/src/role/role.service.ts +41 -8
- package/src/setting/setting.service.ts +7 -6
- package/src/user/user.service.ts +34 -3
- package/src/webhook-integration/event-webhook.controller.ts +50 -0
- package/src/webhook-integration/event-webhook.service.ts +384 -0
- package/src/webhook-integration/integration-event-catalog.controller.ts +50 -0
- package/src/webhook-integration/integration-event-catalog.service.ts +117 -0
- package/src/webhook-integration/webhook-integration.controller.ts +103 -0
- package/src/webhook-integration/webhook-integration.module.ts +45 -0
- package/src/webhook-integration/webhook-integration.service.ts +735 -0
- package/src/webhook-integration/webhook-utils.ts +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event-catalog.controller.js","sourceRoot":"","sources":["../../src/webhook-integration/integration-event-catalog.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAA+C;AAC/C,4DAAqD;AACrD,2CASwB;AACxB,2FAAqF;AAI9E,IAAM,iCAAi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GAAE;IACD,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,eAAS;;+DAE7B;4CA/BU,iCAAiC;IAF7C,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,2BAA2B,CAAC;qCAEA,kEAA8B;GADzD,iCAAiC,CAgC7C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
+
import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
|
|
3
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
4
|
+
export declare class IntegrationEventCatalogService {
|
|
5
|
+
private readonly prisma;
|
|
6
|
+
private readonly pagination;
|
|
7
|
+
constructor(prisma: PrismaService, pagination: PaginationService);
|
|
8
|
+
private get delegate();
|
|
9
|
+
list(paginationParams: PaginationDTO): Promise<{
|
|
10
|
+
total: any;
|
|
11
|
+
lastPage: number;
|
|
12
|
+
page: number;
|
|
13
|
+
pageSize: number;
|
|
14
|
+
prev: number;
|
|
15
|
+
next: number;
|
|
16
|
+
data: any[];
|
|
17
|
+
}>;
|
|
18
|
+
options(): Promise<any>;
|
|
19
|
+
get(id: number): Promise<any>;
|
|
20
|
+
create(data: any): Promise<any>;
|
|
21
|
+
update(id: number, data: any): Promise<any>;
|
|
22
|
+
delete(data: DeleteDTO): Promise<any>;
|
|
23
|
+
private ensureSlugAvailable;
|
|
24
|
+
private normalize;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=integration-event-catalog.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event-catalog.service.d.ts","sourceRoot":"","sources":["../../src/webhook-integration/integration-event-catalog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAOpD,qBACa,8BAA8B;IAEvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,iBAAiB;IAGhD,OAAO,KAAK,QAAQ,GAEnB;IAEK,IAAI,CAAC,gBAAgB,EAAE,aAAa;;;;;;;;;IAUpC,OAAO;IAcP,GAAG,CAAC,EAAE,EAAE,MAAM;IAQd,MAAM,CAAC,IAAI,EAAE,GAAG;IAOhB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;IAY5B,MAAM,CAAC,IAAI,EAAE,SAAS;YAUd,mBAAmB;IAWjC,OAAO,CAAC,SAAS;CAuBlB"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IntegrationEventCatalogService = void 0;
|
|
13
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
14
|
+
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
let IntegrationEventCatalogService = class IntegrationEventCatalogService {
|
|
17
|
+
constructor(prisma, pagination) {
|
|
18
|
+
this.prisma = prisma;
|
|
19
|
+
this.pagination = pagination;
|
|
20
|
+
}
|
|
21
|
+
get delegate() {
|
|
22
|
+
return this.prisma.integration_event_catalog;
|
|
23
|
+
}
|
|
24
|
+
async list(paginationParams) {
|
|
25
|
+
const fields = ['slug', 'name', 'module', 'description', 'status'];
|
|
26
|
+
const OR = this.prisma.createInsensitiveSearch(fields, paginationParams);
|
|
27
|
+
return this.pagination.paginate(this.delegate, paginationParams, {
|
|
28
|
+
where: OR.length > 0 ? { OR } : {},
|
|
29
|
+
orderBy: [{ module: 'asc' }, { slug: 'asc' }],
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async options() {
|
|
33
|
+
return this.delegate.findMany({
|
|
34
|
+
where: { status: 'active' },
|
|
35
|
+
orderBy: [{ module: 'asc' }, { slug: 'asc' }],
|
|
36
|
+
select: {
|
|
37
|
+
id: true,
|
|
38
|
+
slug: true,
|
|
39
|
+
name: true,
|
|
40
|
+
module: true,
|
|
41
|
+
description: true,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async get(id) {
|
|
46
|
+
const record = await this.delegate.findUnique({ where: { id } });
|
|
47
|
+
if (!record) {
|
|
48
|
+
throw new common_1.NotFoundException(`Event catalog item with id ${id} not found.`);
|
|
49
|
+
}
|
|
50
|
+
return record;
|
|
51
|
+
}
|
|
52
|
+
async create(data) {
|
|
53
|
+
await this.ensureSlugAvailable(data.slug);
|
|
54
|
+
return this.delegate.create({
|
|
55
|
+
data: this.normalize(data),
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async update(id, data) {
|
|
59
|
+
const existing = await this.get(id);
|
|
60
|
+
if (data.slug && data.slug !== existing.slug) {
|
|
61
|
+
await this.ensureSlugAvailable(data.slug);
|
|
62
|
+
}
|
|
63
|
+
return this.delegate.update({
|
|
64
|
+
where: { id },
|
|
65
|
+
data: this.normalize(data, true),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async delete(data) {
|
|
69
|
+
var _a;
|
|
70
|
+
if (!((_a = data.ids) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
71
|
+
throw new common_1.BadRequestException('You must select at least one item to delete.');
|
|
72
|
+
}
|
|
73
|
+
return this.delegate.deleteMany({
|
|
74
|
+
where: { id: { in: data.ids } },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
async ensureSlugAvailable(slug) {
|
|
78
|
+
const existing = await this.delegate.findUnique({
|
|
79
|
+
where: { slug: String(slug || '').trim() },
|
|
80
|
+
select: { id: true },
|
|
81
|
+
});
|
|
82
|
+
if (existing) {
|
|
83
|
+
throw new common_1.BadRequestException(`Event "${slug}" already exists.`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
normalize(data, partial = false) {
|
|
87
|
+
var _a, _b, _c;
|
|
88
|
+
const normalized = {};
|
|
89
|
+
const assign = (key, value) => {
|
|
90
|
+
if (!partial || value !== undefined) {
|
|
91
|
+
normalized[key] = value;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
assign('slug', String((_a = data.slug) !== null && _a !== void 0 ? _a : '').trim());
|
|
95
|
+
assign('name', String((_b = data.name) !== null && _b !== void 0 ? _b : '').trim());
|
|
96
|
+
assign('module', String((_c = data.module) !== null && _c !== void 0 ? _c : '').trim());
|
|
97
|
+
assign('description', data.description === undefined || data.description === null
|
|
98
|
+
? partial
|
|
99
|
+
? undefined
|
|
100
|
+
: null
|
|
101
|
+
: String(data.description).trim() || null);
|
|
102
|
+
assign('status', data.status === 'inactive' ? 'inactive' : 'active');
|
|
103
|
+
return normalized;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
exports.IntegrationEventCatalogService = IntegrationEventCatalogService;
|
|
107
|
+
exports.IntegrationEventCatalogService = IntegrationEventCatalogService = __decorate([
|
|
108
|
+
(0, common_1.Injectable)(),
|
|
109
|
+
__metadata("design:paramtypes", [api_prisma_1.PrismaService,
|
|
110
|
+
api_pagination_1.PaginationService])
|
|
111
|
+
], IntegrationEventCatalogService);
|
|
112
|
+
//# sourceMappingURL=integration-event-catalog.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-event-catalog.service.js","sourceRoot":"","sources":["../../src/webhook-integration/integration-event-catalog.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4DAA2E;AAC3E,oDAAoD;AACpD,2CAIwB;AAGjB,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACmB,MAAqB,EACrB,UAA6B;QAD7B,WAAM,GAAN,MAAM,CAAe;QACrB,eAAU,GAAV,UAAU,CAAmB;IAC7C,CAAC;IAEJ,IAAY,QAAQ;QAClB,OAAQ,IAAI,CAAC,MAAc,CAAC,yBAAyB,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,gBAA+B;QACxC,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;QACnE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QAEzE,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE;YAC/D,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;YAClC,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAC5B,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;YAC3B,OAAO,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A,IAAI,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACnD,MAAM,CACJ,aAAa,EACb,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI;YACzD,CAAC,CAAC,OAAO;gBACP,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI;YACR,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,CAC5C,CAAC;QACF,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QAErE,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAzGY,wEAA8B;yCAA9B,8BAA8B;IAD1C,IAAA,mBAAU,GAAE;qCAGgB,0BAAa;QACT,kCAAiB;GAHrC,8BAA8B,CAyG1C"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
+
import { Request } from 'express';
|
|
3
|
+
import { WebhookIntegrationService } from './webhook-integration.service';
|
|
4
|
+
export declare class WebhookIntegrationController {
|
|
5
|
+
private readonly service;
|
|
6
|
+
constructor(service: WebhookIntegrationService);
|
|
7
|
+
list(paginationParams: any): Promise<{
|
|
8
|
+
data: any[];
|
|
9
|
+
total: any;
|
|
10
|
+
lastPage: number;
|
|
11
|
+
page: number;
|
|
12
|
+
pageSize: number;
|
|
13
|
+
prev: number;
|
|
14
|
+
next: number;
|
|
15
|
+
}>;
|
|
16
|
+
get(id: number): Promise<any>;
|
|
17
|
+
create(data: any): Promise<any>;
|
|
18
|
+
update(id: number, data: any): Promise<any>;
|
|
19
|
+
delete(data: DeleteDTO): Promise<any>;
|
|
20
|
+
regenerateUuid(id: number): Promise<any>;
|
|
21
|
+
regenerateToken(id: number): Promise<any>;
|
|
22
|
+
listActions(id: number): Promise<any>;
|
|
23
|
+
createAction(id: number, data: any): Promise<any>;
|
|
24
|
+
updateAction(id: number, actionId: number, data: any): Promise<any>;
|
|
25
|
+
deleteActions(id: number, data: DeleteDTO): Promise<any>;
|
|
26
|
+
listLogs(id: number, paginationParams: any): Promise<{
|
|
27
|
+
total: any;
|
|
28
|
+
lastPage: number;
|
|
29
|
+
page: number;
|
|
30
|
+
pageSize: number;
|
|
31
|
+
prev: number;
|
|
32
|
+
next: number;
|
|
33
|
+
data: any[];
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export declare class PublicWebhookController {
|
|
37
|
+
private readonly service;
|
|
38
|
+
constructor(service: WebhookIntegrationService);
|
|
39
|
+
execute(uuid: string, body: any, headers: any, req: Request): Promise<{
|
|
40
|
+
success: boolean;
|
|
41
|
+
actions: any[];
|
|
42
|
+
}>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=webhook-integration.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-integration.controller.d.ts","sourceRoot":"","sources":["../../src/webhook-integration/webhook-integration.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AAcvD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,qBAEa,4BAA4B;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,yBAAyB;IAG/D,IAAI,CAAe,gBAAgB,KAAA;;;;;;;;;IAKnC,GAAG,CAA4B,EAAE,EAAE,MAAM;IAKzC,MAAM,CAAS,IAAI,EAAE,GAAG;IAKxB,MAAM,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,GAAG;IAK/D,MAAM,CAAS,IAAI,EAAE,SAAS;IAK9B,cAAc,CAA4B,EAAE,EAAE,MAAM;IAKpD,eAAe,CAA4B,EAAE,EAAE,MAAM;IAKrD,WAAW,CAA4B,EAAE,EAAE,MAAM;IAKjD,YAAY,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,GAAG;IAKrE,YAAY,CACiB,EAAE,EAAE,MAAM,EACJ,QAAQ,EAAE,MAAM,EACzC,IAAI,EAAE,GAAG;IAMnB,aAAa,CAA4B,EAAE,EAAE,MAAM,EAAU,IAAI,EAAE,SAAS;IAK5E,QAAQ,CAA4B,EAAE,EAAE,MAAM,EAAgB,gBAAgB,KAAA;;;;;;;;;CAG/E;AAED,qBAEa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,yBAAyB;IAG/D,OAAO,CACU,IAAI,EAAE,MAAM,EACnB,IAAI,EAAE,GAAG,EACN,OAAO,EAAE,GAAG,EAChB,GAAG,EAAE,OAAO;;;;CAItB"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.PublicWebhookController = exports.WebhookIntegrationController = void 0;
|
|
16
|
+
const api_1 = require("@hed-hog/api");
|
|
17
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const webhook_integration_service_1 = require("./webhook-integration.service");
|
|
20
|
+
let WebhookIntegrationController = class WebhookIntegrationController {
|
|
21
|
+
constructor(service) {
|
|
22
|
+
this.service = service;
|
|
23
|
+
}
|
|
24
|
+
list(paginationParams) {
|
|
25
|
+
return this.service.list(paginationParams);
|
|
26
|
+
}
|
|
27
|
+
get(id) {
|
|
28
|
+
return this.service.get(id);
|
|
29
|
+
}
|
|
30
|
+
create(data) {
|
|
31
|
+
return this.service.create(data);
|
|
32
|
+
}
|
|
33
|
+
update(id, data) {
|
|
34
|
+
return this.service.update(id, data);
|
|
35
|
+
}
|
|
36
|
+
delete(data) {
|
|
37
|
+
return this.service.delete(data);
|
|
38
|
+
}
|
|
39
|
+
regenerateUuid(id) {
|
|
40
|
+
return this.service.regenerateUuid(id);
|
|
41
|
+
}
|
|
42
|
+
regenerateToken(id) {
|
|
43
|
+
return this.service.regenerateToken(id);
|
|
44
|
+
}
|
|
45
|
+
listActions(id) {
|
|
46
|
+
return this.service.listActions(id);
|
|
47
|
+
}
|
|
48
|
+
createAction(id, data) {
|
|
49
|
+
return this.service.createAction(id, data);
|
|
50
|
+
}
|
|
51
|
+
updateAction(id, actionId, data) {
|
|
52
|
+
return this.service.updateAction(id, actionId, data);
|
|
53
|
+
}
|
|
54
|
+
deleteActions(id, data) {
|
|
55
|
+
return this.service.deleteActions(id, data);
|
|
56
|
+
}
|
|
57
|
+
listLogs(id, paginationParams) {
|
|
58
|
+
return this.service.listLogs(id, paginationParams);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.WebhookIntegrationController = WebhookIntegrationController;
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, common_1.Get)(),
|
|
64
|
+
__param(0, (0, api_pagination_1.Pagination)()),
|
|
65
|
+
__metadata("design:type", Function),
|
|
66
|
+
__metadata("design:paramtypes", [Object]),
|
|
67
|
+
__metadata("design:returntype", void 0)
|
|
68
|
+
], WebhookIntegrationController.prototype, "list", null);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, common_1.Get)(':id'),
|
|
71
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
72
|
+
__metadata("design:type", Function),
|
|
73
|
+
__metadata("design:paramtypes", [Number]),
|
|
74
|
+
__metadata("design:returntype", void 0)
|
|
75
|
+
], WebhookIntegrationController.prototype, "get", null);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, common_1.Post)(),
|
|
78
|
+
__param(0, (0, common_1.Body)()),
|
|
79
|
+
__metadata("design:type", Function),
|
|
80
|
+
__metadata("design:paramtypes", [Object]),
|
|
81
|
+
__metadata("design:returntype", void 0)
|
|
82
|
+
], WebhookIntegrationController.prototype, "create", null);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, common_1.Patch)(':id'),
|
|
85
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
86
|
+
__param(1, (0, common_1.Body)()),
|
|
87
|
+
__metadata("design:type", Function),
|
|
88
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
89
|
+
__metadata("design:returntype", void 0)
|
|
90
|
+
], WebhookIntegrationController.prototype, "update", null);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, common_1.Delete)(),
|
|
93
|
+
__param(0, (0, common_1.Body)()),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", [api_1.DeleteDTO]),
|
|
96
|
+
__metadata("design:returntype", void 0)
|
|
97
|
+
], WebhookIntegrationController.prototype, "delete", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, common_1.Post)(':id/regenerate-uuid'),
|
|
100
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
101
|
+
__metadata("design:type", Function),
|
|
102
|
+
__metadata("design:paramtypes", [Number]),
|
|
103
|
+
__metadata("design:returntype", void 0)
|
|
104
|
+
], WebhookIntegrationController.prototype, "regenerateUuid", null);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, common_1.Post)(':id/regenerate-token'),
|
|
107
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
108
|
+
__metadata("design:type", Function),
|
|
109
|
+
__metadata("design:paramtypes", [Number]),
|
|
110
|
+
__metadata("design:returntype", void 0)
|
|
111
|
+
], WebhookIntegrationController.prototype, "regenerateToken", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
(0, common_1.Get)(':id/action'),
|
|
114
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
115
|
+
__metadata("design:type", Function),
|
|
116
|
+
__metadata("design:paramtypes", [Number]),
|
|
117
|
+
__metadata("design:returntype", void 0)
|
|
118
|
+
], WebhookIntegrationController.prototype, "listActions", null);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, common_1.Post)(':id/action'),
|
|
121
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
122
|
+
__param(1, (0, common_1.Body)()),
|
|
123
|
+
__metadata("design:type", Function),
|
|
124
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
125
|
+
__metadata("design:returntype", void 0)
|
|
126
|
+
], WebhookIntegrationController.prototype, "createAction", null);
|
|
127
|
+
__decorate([
|
|
128
|
+
(0, common_1.Patch)(':id/action/:actionId'),
|
|
129
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
130
|
+
__param(1, (0, common_1.Param)('actionId', common_1.ParseIntPipe)),
|
|
131
|
+
__param(2, (0, common_1.Body)()),
|
|
132
|
+
__metadata("design:type", Function),
|
|
133
|
+
__metadata("design:paramtypes", [Number, Number, Object]),
|
|
134
|
+
__metadata("design:returntype", void 0)
|
|
135
|
+
], WebhookIntegrationController.prototype, "updateAction", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, common_1.Delete)(':id/action'),
|
|
138
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
139
|
+
__param(1, (0, common_1.Body)()),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [Number, api_1.DeleteDTO]),
|
|
142
|
+
__metadata("design:returntype", void 0)
|
|
143
|
+
], WebhookIntegrationController.prototype, "deleteActions", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, common_1.Get)(':id/log'),
|
|
146
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
147
|
+
__param(1, (0, api_pagination_1.Pagination)()),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", [Number, Object]),
|
|
150
|
+
__metadata("design:returntype", void 0)
|
|
151
|
+
], WebhookIntegrationController.prototype, "listLogs", null);
|
|
152
|
+
exports.WebhookIntegrationController = WebhookIntegrationController = __decorate([
|
|
153
|
+
(0, api_1.Role)(),
|
|
154
|
+
(0, common_1.Controller)('webhook-integration'),
|
|
155
|
+
__metadata("design:paramtypes", [webhook_integration_service_1.WebhookIntegrationService])
|
|
156
|
+
], WebhookIntegrationController);
|
|
157
|
+
let PublicWebhookController = class PublicWebhookController {
|
|
158
|
+
constructor(service) {
|
|
159
|
+
this.service = service;
|
|
160
|
+
}
|
|
161
|
+
execute(uuid, body, headers, req) {
|
|
162
|
+
return this.service.executePublic(uuid, body, headers, req);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
exports.PublicWebhookController = PublicWebhookController;
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, common_1.Post)(':uuid'),
|
|
168
|
+
__param(0, (0, common_1.Param)('uuid')),
|
|
169
|
+
__param(1, (0, common_1.Body)()),
|
|
170
|
+
__param(2, (0, common_1.Headers)()),
|
|
171
|
+
__param(3, (0, common_1.Req)()),
|
|
172
|
+
__metadata("design:type", Function),
|
|
173
|
+
__metadata("design:paramtypes", [String, Object, Object, Object]),
|
|
174
|
+
__metadata("design:returntype", void 0)
|
|
175
|
+
], PublicWebhookController.prototype, "execute", null);
|
|
176
|
+
exports.PublicWebhookController = PublicWebhookController = __decorate([
|
|
177
|
+
(0, api_1.Public)(),
|
|
178
|
+
(0, common_1.Controller)('webhook'),
|
|
179
|
+
__metadata("design:paramtypes", [webhook_integration_service_1.WebhookIntegrationService])
|
|
180
|
+
], PublicWebhookController);
|
|
181
|
+
//# sourceMappingURL=webhook-integration.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-integration.controller.js","sourceRoot":"","sources":["../../src/webhook-integration/webhook-integration.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sCAAuD;AACvD,4DAAqD;AACrD,2CAWwB;AAExB,+EAA0E;AAInE,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IACvC,YAA6B,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAGnE,IAAI,CAAe,gBAAgB;QACjC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAGD,GAAG,CAA4B,EAAU;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC9B,CAAC;IAGD,MAAM,CAAS,IAAS;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGD,MAAM,CAA4B,EAAU,EAAU,IAAS;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACvC,CAAC;IAGD,MAAM,CAAS,IAAe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AAU,GAAE,CAAA;;;;4DAE5D;uCAjEU,4BAA4B;IAFxC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,qBAAqB,CAAC;qCAEM,uDAAyB;GADpD,4BAA4B,CAkExC;AAIM,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAClC,YAA6B,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAGnE,OAAO,CACU,IAAY,EACnB,IAAS,EACN,OAAY,EAChB,GAAY;QAEnB,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AAZY,0DAAuB;AAIlC;IADC,IAAA,aAAI,EAAC,OAAO,CAAC;IAEX,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;IACT,WAAA,IAAA,YAAG,GAAE,CAAA;;;;sDAGP;kCAXU,uBAAuB;IAFnC,IAAA,YAAM,GAAE;IACR,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAEkB,uDAAyB;GADpD,uBAAuB,CAYnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-integration.module.d.ts","sourceRoot":"","sources":["../../src/webhook-integration/webhook-integration.module.ts"],"names":[],"mappings":"AAiBA,qBA0Ba,wBAAwB;CAAG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.WebhookIntegrationModule = void 0;
|
|
10
|
+
const api_mail_1 = require("@hed-hog/api-mail");
|
|
11
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
12
|
+
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
13
|
+
const axios_1 = require("@nestjs/axios");
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const integration_module_1 = require("../integration/integration.module");
|
|
16
|
+
const mail_module_1 = require("../mail/mail.module");
|
|
17
|
+
const event_webhook_controller_1 = require("./event-webhook.controller");
|
|
18
|
+
const event_webhook_service_1 = require("./event-webhook.service");
|
|
19
|
+
const integration_event_catalog_controller_1 = require("./integration-event-catalog.controller");
|
|
20
|
+
const integration_event_catalog_service_1 = require("./integration-event-catalog.service");
|
|
21
|
+
const webhook_integration_controller_1 = require("./webhook-integration.controller");
|
|
22
|
+
const webhook_integration_service_1 = require("./webhook-integration.service");
|
|
23
|
+
let WebhookIntegrationModule = class WebhookIntegrationModule {
|
|
24
|
+
};
|
|
25
|
+
exports.WebhookIntegrationModule = WebhookIntegrationModule;
|
|
26
|
+
exports.WebhookIntegrationModule = WebhookIntegrationModule = __decorate([
|
|
27
|
+
(0, common_1.Module)({
|
|
28
|
+
imports: [
|
|
29
|
+
axios_1.HttpModule,
|
|
30
|
+
(0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
|
|
31
|
+
(0, common_1.forwardRef)(() => api_pagination_1.PaginationModule),
|
|
32
|
+
(0, common_1.forwardRef)(() => integration_module_1.IntegrationModule),
|
|
33
|
+
(0, common_1.forwardRef)(() => mail_module_1.MailModule),
|
|
34
|
+
(0, common_1.forwardRef)(() => api_mail_1.MailModule),
|
|
35
|
+
],
|
|
36
|
+
controllers: [
|
|
37
|
+
integration_event_catalog_controller_1.IntegrationEventCatalogController,
|
|
38
|
+
webhook_integration_controller_1.WebhookIntegrationController,
|
|
39
|
+
webhook_integration_controller_1.PublicWebhookController,
|
|
40
|
+
event_webhook_controller_1.EventWebhookController,
|
|
41
|
+
],
|
|
42
|
+
providers: [
|
|
43
|
+
integration_event_catalog_service_1.IntegrationEventCatalogService,
|
|
44
|
+
webhook_integration_service_1.WebhookIntegrationService,
|
|
45
|
+
event_webhook_service_1.EventWebhookService,
|
|
46
|
+
],
|
|
47
|
+
exports: [
|
|
48
|
+
integration_event_catalog_service_1.IntegrationEventCatalogService,
|
|
49
|
+
webhook_integration_service_1.WebhookIntegrationService,
|
|
50
|
+
event_webhook_service_1.EventWebhookService,
|
|
51
|
+
],
|
|
52
|
+
})
|
|
53
|
+
], WebhookIntegrationModule);
|
|
54
|
+
//# sourceMappingURL=webhook-integration.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-integration.module.js","sourceRoot":"","sources":["../../src/webhook-integration/webhook-integration.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,gDAAiE;AACjE,4DAA2D;AAC3D,oDAAmD;AACnD,yCAA2C;AAC3C,2CAAoD;AACpD,0EAAsE;AACtE,qDAAiD;AACjD,yEAAoE;AACpE,mEAA8D;AAC9D,iGAA2F;AAC3F,2FAAqF;AACrF,qFAG0C;AAC1C,+EAA0E;AA4BnE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,4DAAwB;mCAAxB,wBAAwB;IA1BpC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,kBAAU;YACV,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;YAClC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,sCAAiB,CAAC;YACnC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;YAC5B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,qBAAc,CAAC;SACjC;QACD,WAAW,EAAE;YACX,wEAAiC;YACjC,6DAA4B;YAC5B,wDAAuB;YACvB,iDAAsB;SACvB;QACD,SAAS,EAAE;YACT,kEAA8B;YAC9B,uDAAyB;YACzB,2CAAmB;SACpB;QACD,OAAO,EAAE;YACP,kEAA8B;YAC9B,uDAAyB;YACzB,2CAAmB;SACpB;KACF,CAAC;GACW,wBAAwB,CAAG"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
+
import { MailService as MailMainService } from '@hed-hog/api-mail';
|
|
3
|
+
import { PaginationDTO, PaginationService } from '@hed-hog/api-pagination';
|
|
4
|
+
import { PrismaService } from '@hed-hog/api-prisma';
|
|
5
|
+
import { HttpService } from '@nestjs/axios';
|
|
6
|
+
import { Request } from 'express';
|
|
7
|
+
import { MailService } from '../mail/mail.service';
|
|
8
|
+
import { SettingService } from '../setting/setting.service';
|
|
9
|
+
export declare class WebhookIntegrationService {
|
|
10
|
+
private readonly prisma;
|
|
11
|
+
private readonly pagination;
|
|
12
|
+
private readonly http;
|
|
13
|
+
private readonly mailMainService;
|
|
14
|
+
private readonly coreMailService;
|
|
15
|
+
private readonly settingService;
|
|
16
|
+
constructor(prisma: PrismaService, pagination: PaginationService, http: HttpService, mailMainService: MailMainService, coreMailService: MailService, settingService: SettingService);
|
|
17
|
+
private get integrations();
|
|
18
|
+
private get actions();
|
|
19
|
+
private get logs();
|
|
20
|
+
list(paginationParams: PaginationDTO): Promise<{
|
|
21
|
+
data: any[];
|
|
22
|
+
total: any;
|
|
23
|
+
lastPage: number;
|
|
24
|
+
page: number;
|
|
25
|
+
pageSize: number;
|
|
26
|
+
prev: number;
|
|
27
|
+
next: number;
|
|
28
|
+
}>;
|
|
29
|
+
get(id: number): Promise<any>;
|
|
30
|
+
create(data: any): Promise<any>;
|
|
31
|
+
update(id: number, data: any): Promise<any>;
|
|
32
|
+
delete(data: DeleteDTO): Promise<any>;
|
|
33
|
+
regenerateUuid(id: number): Promise<any>;
|
|
34
|
+
regenerateToken(id: number): Promise<any>;
|
|
35
|
+
private getApplicationBaseUrl;
|
|
36
|
+
private withPublicUrl;
|
|
37
|
+
private withPublicUrls;
|
|
38
|
+
listActions(integrationId: number): Promise<any>;
|
|
39
|
+
createAction(integrationId: number, data: any): Promise<any>;
|
|
40
|
+
updateAction(integrationId: number, actionId: number, data: any): Promise<any>;
|
|
41
|
+
deleteActions(integrationId: number, data: DeleteDTO): Promise<any>;
|
|
42
|
+
listLogs(integrationId: number, paginationParams: PaginationDTO): Promise<{
|
|
43
|
+
total: any;
|
|
44
|
+
lastPage: number;
|
|
45
|
+
page: number;
|
|
46
|
+
pageSize: number;
|
|
47
|
+
prev: number;
|
|
48
|
+
next: number;
|
|
49
|
+
data: any[];
|
|
50
|
+
}>;
|
|
51
|
+
executePublic(uuid: string, body: any, headers: any, req: Request): Promise<{
|
|
52
|
+
success: boolean;
|
|
53
|
+
actions: any[];
|
|
54
|
+
}>;
|
|
55
|
+
private executeAction;
|
|
56
|
+
private executeEmailAction;
|
|
57
|
+
private executeWhatsappAction;
|
|
58
|
+
private validateToken;
|
|
59
|
+
private validateIp;
|
|
60
|
+
private validateBodySchema;
|
|
61
|
+
private validateJsonSchema;
|
|
62
|
+
private matchesJsonSchemaType;
|
|
63
|
+
private createCallLog;
|
|
64
|
+
private getRemoteIp;
|
|
65
|
+
private ensureAction;
|
|
66
|
+
private ensureSlugAvailable;
|
|
67
|
+
private normalizeIntegration;
|
|
68
|
+
private normalizeAction;
|
|
69
|
+
private nullableString;
|
|
70
|
+
private nullableNumber;
|
|
71
|
+
private buildMailConfig;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=webhook-integration.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-integration.service.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