@hed-hog/core 0.0.354 → 0.0.356
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/ai/ai.service.d.ts +3 -12
- package/dist/ai/ai.service.d.ts.map +1 -1
- package/dist/ai/ai.service.js +34 -125
- package/dist/ai/ai.service.js.map +1 -1
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +3 -3
- package/dist/core.module.js.map +1 -1
- package/dist/file/file.service.d.ts +1 -1
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +50 -64
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/provider/provider.enum.d.ts +2 -1
- package/dist/file/provider/provider.enum.d.ts.map +1 -1
- package/dist/file/provider/provider.enum.js +1 -0
- package/dist/file/provider/provider.enum.js.map +1 -1
- package/dist/file/provider/provider.factory.d.ts.map +1 -1
- package/dist/file/provider/provider.factory.js +3 -0
- package/dist/file/provider/provider.factory.js.map +1 -1
- package/dist/file/provider/spaces.provider.d.ts +27 -0
- package/dist/file/provider/spaces.provider.d.ts.map +1 -0
- package/dist/file/provider/spaces.provider.js +218 -0
- package/dist/file/provider/spaces.provider.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/integration-profile/dto/create.dto.d.ts +9 -0
- package/dist/integration-profile/dto/create.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/create.dto.js +54 -0
- package/dist/integration-profile/dto/create.dto.js.map +1 -0
- package/dist/integration-profile/dto/export.dto.d.ts +5 -0
- package/dist/integration-profile/dto/export.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/export.dto.js +29 -0
- package/dist/integration-profile/dto/export.dto.js.map +1 -0
- package/dist/integration-profile/dto/import-confirm.dto.d.ts +17 -0
- package/dist/integration-profile/dto/import-confirm.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/import-confirm.dto.js +77 -0
- package/dist/integration-profile/dto/import-confirm.dto.js.map +1 -0
- package/dist/integration-profile/dto/update.dto.d.ts +6 -0
- package/dist/integration-profile/dto/update.dto.d.ts.map +1 -0
- package/dist/integration-profile/dto/update.dto.js +9 -0
- package/dist/integration-profile/dto/update.dto.js.map +1 -0
- package/dist/integration-profile/integration-profile.controller.d.ts +142 -0
- package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.controller.js +165 -0
- package/dist/integration-profile/integration-profile.controller.js.map +1 -0
- package/dist/integration-profile/integration-profile.module.d.ts +3 -0
- package/dist/integration-profile/integration-profile.module.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.module.js +29 -0
- package/dist/integration-profile/integration-profile.module.js.map +1 -0
- package/dist/integration-profile/integration-profile.service.d.ts +160 -0
- package/dist/integration-profile/integration-profile.service.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.service.js +606 -0
- package/dist/integration-profile/integration-profile.service.js.map +1 -0
- package/dist/integration-profile/integration-profile.utils.d.ts +24 -0
- package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.utils.js +147 -0
- package/dist/integration-profile/integration-profile.utils.js.map +1 -0
- package/dist/mail/mail.module.d.ts.map +1 -1
- package/dist/mail/mail.module.js +27 -19
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +3 -2
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +25 -47
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/mcp/mcp.module.js +2 -2
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts +3 -15
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts.map +1 -1
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js +12 -94
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.js +17 -16
- package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +0 -2
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/webhook-integration/event-webhook.controller.d.ts +1 -0
- package/dist/webhook-integration/event-webhook.controller.d.ts.map +1 -1
- package/dist/webhook-integration/event-webhook.controller.js +10 -0
- package/dist/webhook-integration/event-webhook.controller.js.map +1 -1
- package/dist/webhook-integration/event-webhook.service.d.ts +2 -0
- package/dist/webhook-integration/event-webhook.service.d.ts.map +1 -1
- package/dist/webhook-integration/event-webhook.service.js +30 -0
- package/dist/webhook-integration/event-webhook.service.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.d.ts +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.js +10 -0
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +2 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +62 -44
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/dist/whatsapp-profile/dto/create.dto.d.ts +11 -0
- package/dist/whatsapp-profile/dto/create.dto.d.ts.map +1 -0
- package/dist/whatsapp-profile/dto/create.dto.js +55 -0
- package/dist/whatsapp-profile/dto/create.dto.js.map +1 -0
- package/dist/whatsapp-profile/dto/update.dto.d.ts +6 -0
- package/dist/whatsapp-profile/dto/update.dto.d.ts.map +1 -0
- package/dist/whatsapp-profile/dto/update.dto.js +9 -0
- package/dist/whatsapp-profile/dto/update.dto.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts +54 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.js +85 -0
- package/dist/whatsapp-profile/whatsapp-profile.controller.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts +3 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.js +26 -0
- package/dist/whatsapp-profile/whatsapp-profile.module.js.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts +63 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.d.ts.map +1 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.js +138 -0
- package/dist/whatsapp-profile/whatsapp-profile.service.js.map +1 -0
- package/hedhog/data/file_provider.yaml +9 -1
- package/hedhog/data/integration_provider.yaml +132 -0
- package/hedhog/data/integration_type.yaml +29 -0
- package/hedhog/data/menu.yaml +15 -14
- package/hedhog/data/role.yaml +8 -0
- package/hedhog/data/route.yaml +66 -15
- package/hedhog/data/setting_group.yaml +30 -191
- package/hedhog/data/setting_subgroup.yaml +5 -13
- package/hedhog/data/whatsapp_profile.yaml +6 -0
- package/hedhog/frontend/app/account/components/connected-accounts.tsx.ejs +25 -20
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +579 -204
- package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +1662 -0
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +233 -108
- package/hedhog/frontend/app/mail/profiles/page.tsx.ejs +3 -822
- package/hedhog/frontend/app/users/permissions.tsx.ejs +79 -2
- package/hedhog/frontend/app/users/user-sheet.tsx.ejs +7 -2
- package/hedhog/frontend/messages/en.json +172 -0
- package/hedhog/frontend/messages/pt.json +172 -0
- package/hedhog/table/integration_profile.yaml +34 -0
- package/hedhog/table/integration_provider.yaml +23 -0
- package/hedhog/table/integration_type.yaml +19 -0
- package/hedhog/table/webhook_action.yaml +85 -85
- package/hedhog/table/whatsapp_profile.yaml +26 -0
- package/package.json +2 -2
- package/src/ai/ai.service.ts +35 -153
- package/src/core.module.ts +3 -3
- package/src/file/file.service.ts +60 -76
- package/src/file/provider/provider.enum.ts +1 -0
- package/src/file/provider/provider.factory.ts +3 -0
- package/src/file/provider/spaces.provider.ts +261 -0
- package/src/index.ts +6 -3
- package/src/integration-profile/dto/create.dto.ts +44 -0
- package/src/integration-profile/dto/export.dto.ts +15 -0
- package/src/integration-profile/dto/import-confirm.dto.ts +61 -0
- package/src/integration-profile/dto/update.dto.ts +4 -0
- package/src/integration-profile/integration-profile.controller.ts +129 -0
- package/src/integration-profile/integration-profile.module.ts +16 -0
- package/src/integration-profile/integration-profile.service.ts +788 -0
- package/src/integration-profile/integration-profile.utils.ts +156 -0
- package/src/mail/mail.module.ts +27 -18
- package/src/mail/mail.service.ts +31 -60
- package/src/mcp/mcp.module.ts +2 -2
- package/src/mcp/tools/core-mail-profile.mcp-tools.ts +10 -69
- package/src/mcp-chat/mcp-chat.service.ts +23 -20
- package/src/setting/setting.service.ts +0 -2
- package/src/webhook-integration/event-webhook.controller.ts +55 -50
- package/src/webhook-integration/event-webhook.service.ts +422 -384
- package/src/webhook-integration/webhook-integration.controller.ts +5 -0
- package/src/webhook-integration/webhook-integration.service.ts +74 -46
- package/src/whatsapp-profile/dto/create.dto.ts +36 -0
- package/src/whatsapp-profile/dto/update.dto.ts +4 -0
- package/src/whatsapp-profile/whatsapp-profile.controller.ts +51 -0
- package/src/whatsapp-profile/whatsapp-profile.module.ts +13 -0
- package/src/whatsapp-profile/whatsapp-profile.service.ts +160 -0
|
@@ -0,0 +1,77 @@
|
|
|
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.ImportConfirmDTO = exports.ConflictResolutionDTO = exports.ImportProfileItemDTO = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class ImportProfileItemDTO {
|
|
16
|
+
}
|
|
17
|
+
exports.ImportProfileItemDTO = ImportProfileItemDTO;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
(0, class_validator_1.MaxLength)(255),
|
|
21
|
+
__metadata("design:type", String)
|
|
22
|
+
], ImportProfileItemDTO.prototype, "slug", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.MaxLength)(127),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], ImportProfileItemDTO.prototype, "name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, class_validator_1.IsString)(),
|
|
30
|
+
(0, class_validator_1.MaxLength)(255),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], ImportProfileItemDTO.prototype, "type_slug", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsString)(),
|
|
35
|
+
(0, class_validator_1.MaxLength)(255),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], ImportProfileItemDTO.prototype, "provider_slug", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, class_validator_1.IsOptional)(),
|
|
40
|
+
(0, class_validator_1.IsObject)(),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], ImportProfileItemDTO.prototype, "config", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, class_validator_1.IsOptional)(),
|
|
45
|
+
(0, class_validator_1.IsBoolean)(),
|
|
46
|
+
__metadata("design:type", Boolean)
|
|
47
|
+
], ImportProfileItemDTO.prototype, "is_active", void 0);
|
|
48
|
+
class ConflictResolutionDTO {
|
|
49
|
+
}
|
|
50
|
+
exports.ConflictResolutionDTO = ConflictResolutionDTO;
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, class_validator_1.IsString)(),
|
|
53
|
+
(0, class_validator_1.MaxLength)(255),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ConflictResolutionDTO.prototype, "slug", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, class_validator_1.IsIn)(['ignore', 'replace', 'rename_auto']),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], ConflictResolutionDTO.prototype, "action", void 0);
|
|
60
|
+
class ImportConfirmDTO {
|
|
61
|
+
}
|
|
62
|
+
exports.ImportConfirmDTO = ImportConfirmDTO;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, class_validator_1.IsArray)(),
|
|
65
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
66
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
67
|
+
(0, class_transformer_1.Type)(() => ImportProfileItemDTO),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], ImportConfirmDTO.prototype, "profiles", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, class_validator_1.IsOptional)(),
|
|
72
|
+
(0, class_validator_1.IsArray)(),
|
|
73
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
74
|
+
(0, class_transformer_1.Type)(() => ConflictResolutionDTO),
|
|
75
|
+
__metadata("design:type", Array)
|
|
76
|
+
], ImportConfirmDTO.prototype, "conflict_resolutions", void 0);
|
|
77
|
+
//# sourceMappingURL=import-confirm.dto.js.map
|
|
@@ -0,0 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,CAAC;;8DACa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.dto.d.ts","sourceRoot":"","sources":["../../../src/integration-profile/dto/update.dto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;;AAEzC,qBAAa,SAAU,SAAQ,cAAsB;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateDTO = void 0;
|
|
4
|
+
const mapped_types_1 = require("@nestjs/mapped-types");
|
|
5
|
+
const create_dto_1 = require("./create.dto");
|
|
6
|
+
class UpdateDTO extends (0, mapped_types_1.PartialType)(create_dto_1.CreateDTO) {
|
|
7
|
+
}
|
|
8
|
+
exports.UpdateDTO = UpdateDTO;
|
|
9
|
+
//# sourceMappingURL=update.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.dto.js","sourceRoot":"","sources":["../../../src/integration-profile/dto/update.dto.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,IAAA,0BAAW,EAAC,sBAAS,CAAC;CAAG;AAAxD,8BAAwD"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { DeleteDTO } from '@hed-hog/api';
|
|
2
|
+
import { Response } from 'express';
|
|
3
|
+
import { CreateDTO } from './dto/create.dto';
|
|
4
|
+
import { ExportDTO } from './dto/export.dto';
|
|
5
|
+
import { ImportConfirmDTO } from './dto/import-confirm.dto';
|
|
6
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
7
|
+
import { IntegrationProfileService } from './integration-profile.service';
|
|
8
|
+
export declare class IntegrationProfileController {
|
|
9
|
+
private readonly integrationProfileService;
|
|
10
|
+
constructor(integrationProfileService: IntegrationProfileService);
|
|
11
|
+
listTypes(): Promise<{
|
|
12
|
+
id: number;
|
|
13
|
+
icon: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
integration_type_locale: {
|
|
16
|
+
name: string;
|
|
17
|
+
locale: {
|
|
18
|
+
code: string;
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
}[]>;
|
|
22
|
+
listProviders(typeId?: string, typeSlug?: string): Promise<{
|
|
23
|
+
id: number;
|
|
24
|
+
slug: string;
|
|
25
|
+
type_id: number;
|
|
26
|
+
integration_provider_locale: {
|
|
27
|
+
name: string;
|
|
28
|
+
locale: {
|
|
29
|
+
code: string;
|
|
30
|
+
};
|
|
31
|
+
}[];
|
|
32
|
+
}[]>;
|
|
33
|
+
list(paginationParams: any, typeId?: string, typeSlug?: string): Promise<{
|
|
34
|
+
total: any;
|
|
35
|
+
lastPage: number;
|
|
36
|
+
page: number;
|
|
37
|
+
pageSize: number;
|
|
38
|
+
prev: number;
|
|
39
|
+
next: number;
|
|
40
|
+
data: any[];
|
|
41
|
+
}>;
|
|
42
|
+
export({ ids, include_secrets }: ExportDTO, res: Response): Promise<void>;
|
|
43
|
+
get(id: number): Promise<{
|
|
44
|
+
integration_provider: {
|
|
45
|
+
slug: string;
|
|
46
|
+
integration_provider_locale: {
|
|
47
|
+
name: string;
|
|
48
|
+
locale: {
|
|
49
|
+
code: string;
|
|
50
|
+
};
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
integration_type: {
|
|
54
|
+
icon: string;
|
|
55
|
+
slug: string;
|
|
56
|
+
integration_type_locale: {
|
|
57
|
+
name: string;
|
|
58
|
+
locale: {
|
|
59
|
+
code: string;
|
|
60
|
+
};
|
|
61
|
+
}[];
|
|
62
|
+
};
|
|
63
|
+
} & {
|
|
64
|
+
name: string;
|
|
65
|
+
id: number;
|
|
66
|
+
created_at: Date;
|
|
67
|
+
updated_at: Date;
|
|
68
|
+
slug: string;
|
|
69
|
+
is_active: boolean;
|
|
70
|
+
provider_id: number;
|
|
71
|
+
type_id: number;
|
|
72
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
73
|
+
}>;
|
|
74
|
+
create(data: CreateDTO): Promise<{
|
|
75
|
+
name: string;
|
|
76
|
+
id: number;
|
|
77
|
+
created_at: Date;
|
|
78
|
+
updated_at: Date;
|
|
79
|
+
slug: string;
|
|
80
|
+
is_active: boolean;
|
|
81
|
+
provider_id: number;
|
|
82
|
+
type_id: number;
|
|
83
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
84
|
+
}>;
|
|
85
|
+
test(data: CreateDTO): Promise<{
|
|
86
|
+
success: boolean;
|
|
87
|
+
destination: string;
|
|
88
|
+
}>;
|
|
89
|
+
update(id: number, data: UpdateDTO): Promise<{
|
|
90
|
+
name: string;
|
|
91
|
+
id: number;
|
|
92
|
+
created_at: Date;
|
|
93
|
+
updated_at: Date;
|
|
94
|
+
slug: string;
|
|
95
|
+
is_active: boolean;
|
|
96
|
+
provider_id: number;
|
|
97
|
+
type_id: number;
|
|
98
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
99
|
+
}>;
|
|
100
|
+
delete(data: DeleteDTO): Promise<{
|
|
101
|
+
count: number;
|
|
102
|
+
}>;
|
|
103
|
+
validateImport(file: MulterFile): Promise<{
|
|
104
|
+
format: {
|
|
105
|
+
type: "integration-profile";
|
|
106
|
+
version: 1;
|
|
107
|
+
generated_at: string;
|
|
108
|
+
include_secrets: boolean;
|
|
109
|
+
};
|
|
110
|
+
total_profiles: number;
|
|
111
|
+
valid_profiles: number;
|
|
112
|
+
invalid_profiles: number;
|
|
113
|
+
conflict_profiles: number;
|
|
114
|
+
importable_profiles: number;
|
|
115
|
+
conflict_slugs: string[];
|
|
116
|
+
profiles: {
|
|
117
|
+
index: number;
|
|
118
|
+
slug: string;
|
|
119
|
+
name: string;
|
|
120
|
+
type_slug: string;
|
|
121
|
+
provider_slug: string;
|
|
122
|
+
config: Record<string, unknown> | null;
|
|
123
|
+
is_active: boolean;
|
|
124
|
+
has_conflict: boolean;
|
|
125
|
+
}[];
|
|
126
|
+
invalid_items: {
|
|
127
|
+
index: number;
|
|
128
|
+
slug?: string;
|
|
129
|
+
errors: string[];
|
|
130
|
+
}[];
|
|
131
|
+
}>;
|
|
132
|
+
confirmImport(data: ImportConfirmDTO): Promise<{
|
|
133
|
+
success: boolean;
|
|
134
|
+
total_received: number;
|
|
135
|
+
created: number;
|
|
136
|
+
replaced: number;
|
|
137
|
+
renamed: number;
|
|
138
|
+
ignored: number;
|
|
139
|
+
imported: number;
|
|
140
|
+
}>;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=integration-profile.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-profile.controller.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,MAAM,cAAc,CAAC;AAoB/C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAE1E,qBAEa,4BAA4B;IAGrC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBAAzB,yBAAyB,EAAE,yBAAyB;IAIjE,SAAS;;;;;;;;;;;IAKT,aAAa,CACA,MAAM,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM;;;;;;;;;;;IAShC,IAAI,CACM,gBAAgB,KAAA,EACb,MAAM,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM;;;;;;;;;IAehC,MAAM,CACD,EAAE,GAAG,EAAE,eAAuB,EAAE,EAAE,SAAS,EAC7C,GAAG,EAAE,QAAQ;IAgBhB,GAAG,CAA4B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKzC,MAAM,CAAS,IAAI,EAAE,SAAS;;;;;;;;;;;IAK9B,IAAI,CAAS,IAAI,EAAE,SAAS;;;;IAK5B,MAAM,CACiB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE,SAAS;;;;;;;;;;;IAMnB,MAAM,CAAS,IAAI,EAAE,SAAS;;;IAM9B,cAAc,CAAiB,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAK/C,aAAa,CAAS,IAAI,EAAE,gBAAgB;;;;;;;;;CAMnD"}
|
|
@@ -0,0 +1,165 @@
|
|
|
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.IntegrationProfileController = 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 platform_express_1 = require("@nestjs/platform-express");
|
|
20
|
+
const create_dto_1 = require("./dto/create.dto");
|
|
21
|
+
const export_dto_1 = require("./dto/export.dto");
|
|
22
|
+
const import_confirm_dto_1 = require("./dto/import-confirm.dto");
|
|
23
|
+
const update_dto_1 = require("./dto/update.dto");
|
|
24
|
+
const integration_profile_service_1 = require("./integration-profile.service");
|
|
25
|
+
let IntegrationProfileController = class IntegrationProfileController {
|
|
26
|
+
constructor(integrationProfileService) {
|
|
27
|
+
this.integrationProfileService = integrationProfileService;
|
|
28
|
+
}
|
|
29
|
+
async listTypes() {
|
|
30
|
+
return this.integrationProfileService.listTypes();
|
|
31
|
+
}
|
|
32
|
+
async listProviders(typeId, typeSlug) {
|
|
33
|
+
return this.integrationProfileService.listProviders(typeId ? parseInt(typeId, 10) : undefined, typeSlug);
|
|
34
|
+
}
|
|
35
|
+
async list(paginationParams, typeId, typeSlug) {
|
|
36
|
+
return this.integrationProfileService.list(paginationParams, typeId ? parseInt(typeId, 10) : undefined, typeSlug);
|
|
37
|
+
}
|
|
38
|
+
async export({ ids, include_secrets = false }, res) {
|
|
39
|
+
const parsedIds = String(ids !== null && ids !== void 0 ? ids : '')
|
|
40
|
+
.split(',')
|
|
41
|
+
.map((value) => Number(value.trim()))
|
|
42
|
+
.filter((value) => Number.isInteger(value) && value > 0);
|
|
43
|
+
const file = await this.integrationProfileService.exportProfiles({
|
|
44
|
+
ids: parsedIds.length > 0 ? parsedIds : undefined,
|
|
45
|
+
includeSecrets: include_secrets,
|
|
46
|
+
});
|
|
47
|
+
res.send(file);
|
|
48
|
+
}
|
|
49
|
+
async get(id) {
|
|
50
|
+
return this.integrationProfileService.get(id);
|
|
51
|
+
}
|
|
52
|
+
async create(data) {
|
|
53
|
+
return this.integrationProfileService.create(data);
|
|
54
|
+
}
|
|
55
|
+
async test(data) {
|
|
56
|
+
return this.integrationProfileService.test(data);
|
|
57
|
+
}
|
|
58
|
+
async update(id, data) {
|
|
59
|
+
return this.integrationProfileService.update({ id, data });
|
|
60
|
+
}
|
|
61
|
+
async delete(data) {
|
|
62
|
+
return this.integrationProfileService.delete(data);
|
|
63
|
+
}
|
|
64
|
+
async validateImport(file) {
|
|
65
|
+
return this.integrationProfileService.validateImportFile(file);
|
|
66
|
+
}
|
|
67
|
+
async confirmImport(data) {
|
|
68
|
+
return this.integrationProfileService.confirmImport({
|
|
69
|
+
profiles: data.profiles,
|
|
70
|
+
conflictResolutions: data.conflict_resolutions,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
exports.IntegrationProfileController = IntegrationProfileController;
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, common_1.Get)('types'),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", []),
|
|
79
|
+
__metadata("design:returntype", Promise)
|
|
80
|
+
], IntegrationProfileController.prototype, "listTypes", null);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, common_1.Get)('providers'),
|
|
83
|
+
__param(0, (0, common_1.Query)('typeId')),
|
|
84
|
+
__param(1, (0, common_1.Query)('typeSlug')),
|
|
85
|
+
__metadata("design:type", Function),
|
|
86
|
+
__metadata("design:paramtypes", [String, String]),
|
|
87
|
+
__metadata("design:returntype", Promise)
|
|
88
|
+
], IntegrationProfileController.prototype, "listProviders", null);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, common_1.Get)(),
|
|
91
|
+
__param(0, (0, api_pagination_1.Pagination)()),
|
|
92
|
+
__param(1, (0, common_1.Query)('typeId')),
|
|
93
|
+
__param(2, (0, common_1.Query)('typeSlug')),
|
|
94
|
+
__metadata("design:type", Function),
|
|
95
|
+
__metadata("design:paramtypes", [Object, String, String]),
|
|
96
|
+
__metadata("design:returntype", Promise)
|
|
97
|
+
], IntegrationProfileController.prototype, "list", null);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, common_1.Get)('export'),
|
|
100
|
+
(0, common_1.Header)('Content-Type', 'application/octet-stream'),
|
|
101
|
+
(0, common_1.Header)('Content-Disposition', 'attachment; filename="integration-profiles.hedhog"'),
|
|
102
|
+
__param(0, (0, common_1.Query)()),
|
|
103
|
+
__param(1, (0, common_1.Res)()),
|
|
104
|
+
__metadata("design:type", Function),
|
|
105
|
+
__metadata("design:paramtypes", [export_dto_1.ExportDTO, Object]),
|
|
106
|
+
__metadata("design:returntype", Promise)
|
|
107
|
+
], IntegrationProfileController.prototype, "export", null);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, common_1.Get)(':id'),
|
|
110
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
111
|
+
__metadata("design:type", Function),
|
|
112
|
+
__metadata("design:paramtypes", [Number]),
|
|
113
|
+
__metadata("design:returntype", Promise)
|
|
114
|
+
], IntegrationProfileController.prototype, "get", null);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, common_1.Post)(),
|
|
117
|
+
__param(0, (0, common_1.Body)()),
|
|
118
|
+
__metadata("design:type", Function),
|
|
119
|
+
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
|
120
|
+
__metadata("design:returntype", Promise)
|
|
121
|
+
], IntegrationProfileController.prototype, "create", null);
|
|
122
|
+
__decorate([
|
|
123
|
+
(0, common_1.Post)('test'),
|
|
124
|
+
__param(0, (0, common_1.Body)()),
|
|
125
|
+
__metadata("design:type", Function),
|
|
126
|
+
__metadata("design:paramtypes", [create_dto_1.CreateDTO]),
|
|
127
|
+
__metadata("design:returntype", Promise)
|
|
128
|
+
], IntegrationProfileController.prototype, "test", null);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, common_1.Patch)(':id'),
|
|
131
|
+
__param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
|
|
132
|
+
__param(1, (0, common_1.Body)()),
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [Number, update_dto_1.UpdateDTO]),
|
|
135
|
+
__metadata("design:returntype", Promise)
|
|
136
|
+
], IntegrationProfileController.prototype, "update", null);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, common_1.Delete)(),
|
|
139
|
+
__param(0, (0, common_1.Body)()),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [api_1.DeleteDTO]),
|
|
142
|
+
__metadata("design:returntype", Promise)
|
|
143
|
+
], IntegrationProfileController.prototype, "delete", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
146
|
+
(0, common_1.Post)('import/validate'),
|
|
147
|
+
__param(0, (0, common_1.UploadedFile)()),
|
|
148
|
+
__metadata("design:type", Function),
|
|
149
|
+
__metadata("design:paramtypes", [Object]),
|
|
150
|
+
__metadata("design:returntype", Promise)
|
|
151
|
+
], IntegrationProfileController.prototype, "validateImport", null);
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, common_1.Post)('import/confirm'),
|
|
154
|
+
__param(0, (0, common_1.Body)()),
|
|
155
|
+
__metadata("design:type", Function),
|
|
156
|
+
__metadata("design:paramtypes", [import_confirm_dto_1.ImportConfirmDTO]),
|
|
157
|
+
__metadata("design:returntype", Promise)
|
|
158
|
+
], IntegrationProfileController.prototype, "confirmImport", null);
|
|
159
|
+
exports.IntegrationProfileController = IntegrationProfileController = __decorate([
|
|
160
|
+
(0, api_1.Role)(),
|
|
161
|
+
(0, common_1.Controller)('integration-profile'),
|
|
162
|
+
__param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => integration_profile_service_1.IntegrationProfileService))),
|
|
163
|
+
__metadata("design:paramtypes", [integration_profile_service_1.IntegrationProfileService])
|
|
164
|
+
], IntegrationProfileController);
|
|
165
|
+
//# sourceMappingURL=integration-profile.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-profile.controller.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;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0DAEnC;AAIK;IAFL,IAAA,wBAAe,EAAC,IAAA,kCAAe,EAAC,MAAM,CAAC,CAAC;IACxC,IAAA,aAAI,EAAC,iBAAiB,CAAC;IACF,WAAA,IAAA,qBAAY,GAAE,CAAA;;;;kEAEnC;AAGK;IADL,IAAA,aAAI,EAAC,gBAAgB,CAAC;IACF,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,qCAAgB;;iEAKjD;uCAlGU,4BAA4B;IAFxC,IAAA,UAAI,GAAE;IACN,IAAA,mBAAU,EAAC,qBAAqB,CAAC;IAG7B,WAAA,IAAA,eAAM,EAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,uDAAyB,CAAC,CAAC,CAAA;qCACR,uDAAyB;GAH5D,4BAA4B,CAmGxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-profile.module.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":"AAMA,qBASa,wBAAwB;CAAG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.IntegrationProfileModule = void 0;
|
|
10
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
11
|
+
const api_prisma_1 = require("@hed-hog/api-prisma");
|
|
12
|
+
const common_1 = require("@nestjs/common");
|
|
13
|
+
const integration_profile_controller_1 = require("./integration-profile.controller");
|
|
14
|
+
const integration_profile_service_1 = require("./integration-profile.service");
|
|
15
|
+
let IntegrationProfileModule = class IntegrationProfileModule {
|
|
16
|
+
};
|
|
17
|
+
exports.IntegrationProfileModule = IntegrationProfileModule;
|
|
18
|
+
exports.IntegrationProfileModule = IntegrationProfileModule = __decorate([
|
|
19
|
+
(0, common_1.Module)({
|
|
20
|
+
imports: [
|
|
21
|
+
(0, common_1.forwardRef)(() => api_prisma_1.PrismaModule),
|
|
22
|
+
(0, common_1.forwardRef)(() => api_pagination_1.PaginationModule),
|
|
23
|
+
],
|
|
24
|
+
controllers: [integration_profile_controller_1.IntegrationProfileController],
|
|
25
|
+
providers: [integration_profile_service_1.IntegrationProfileService],
|
|
26
|
+
exports: [integration_profile_service_1.IntegrationProfileService],
|
|
27
|
+
})
|
|
28
|
+
], IntegrationProfileModule);
|
|
29
|
+
//# sourceMappingURL=integration-profile.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-profile.module.js","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,4DAA2D;AAC3D,oDAAmD;AACnD,2CAAoD;AACpD,qFAAgF;AAChF,+EAA0E;AAWnE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAAG,CAAA;AAA3B,4DAAwB;mCAAxB,wBAAwB;IATpC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,yBAAY,CAAC;YAC9B,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,iCAAgB,CAAC;SACnC;QACD,WAAW,EAAE,CAAC,6DAA4B,CAAC;QAC3C,SAAS,EAAE,CAAC,uDAAyB,CAAC;QACtC,OAAO,EAAE,CAAC,uDAAyB,CAAC;KACrC,CAAC;GACW,wBAAwB,CAAG"}
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
import { CreateDTO } from './dto/create.dto';
|
|
5
|
+
import { ConflictResolutionDTO, ImportProfileItemDTO } from './dto/import-confirm.dto';
|
|
6
|
+
import { UpdateDTO } from './dto/update.dto';
|
|
7
|
+
type ValidatedImportItem = {
|
|
8
|
+
index: number;
|
|
9
|
+
slug: string;
|
|
10
|
+
name: string;
|
|
11
|
+
type_slug: string;
|
|
12
|
+
provider_slug: string;
|
|
13
|
+
config: Record<string, unknown> | null;
|
|
14
|
+
is_active: boolean;
|
|
15
|
+
has_conflict: boolean;
|
|
16
|
+
};
|
|
17
|
+
type InvalidImportItem = {
|
|
18
|
+
index: number;
|
|
19
|
+
slug?: string;
|
|
20
|
+
errors: string[];
|
|
21
|
+
};
|
|
22
|
+
export declare class IntegrationProfileService {
|
|
23
|
+
private readonly prismaService;
|
|
24
|
+
private readonly paginationService;
|
|
25
|
+
constructor(prismaService: PrismaService, paginationService: PaginationService);
|
|
26
|
+
listTypes(): Promise<{
|
|
27
|
+
id: number;
|
|
28
|
+
icon: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
integration_type_locale: {
|
|
31
|
+
name: string;
|
|
32
|
+
locale: {
|
|
33
|
+
code: string;
|
|
34
|
+
};
|
|
35
|
+
}[];
|
|
36
|
+
}[]>;
|
|
37
|
+
listProviders(typeId?: number, typeSlug?: string): Promise<{
|
|
38
|
+
id: number;
|
|
39
|
+
slug: string;
|
|
40
|
+
type_id: number;
|
|
41
|
+
integration_provider_locale: {
|
|
42
|
+
name: string;
|
|
43
|
+
locale: {
|
|
44
|
+
code: string;
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
}[]>;
|
|
48
|
+
list(paginationParams: PaginationDTO, typeId?: number, typeSlug?: string): Promise<{
|
|
49
|
+
total: any;
|
|
50
|
+
lastPage: number;
|
|
51
|
+
page: number;
|
|
52
|
+
pageSize: number;
|
|
53
|
+
prev: number;
|
|
54
|
+
next: number;
|
|
55
|
+
data: any[];
|
|
56
|
+
}>;
|
|
57
|
+
get(id: number): Promise<{
|
|
58
|
+
integration_provider: {
|
|
59
|
+
slug: string;
|
|
60
|
+
integration_provider_locale: {
|
|
61
|
+
name: string;
|
|
62
|
+
locale: {
|
|
63
|
+
code: string;
|
|
64
|
+
};
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
integration_type: {
|
|
68
|
+
icon: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
integration_type_locale: {
|
|
71
|
+
name: string;
|
|
72
|
+
locale: {
|
|
73
|
+
code: string;
|
|
74
|
+
};
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
} & {
|
|
78
|
+
name: string;
|
|
79
|
+
id: number;
|
|
80
|
+
created_at: Date;
|
|
81
|
+
updated_at: Date;
|
|
82
|
+
slug: string;
|
|
83
|
+
is_active: boolean;
|
|
84
|
+
provider_id: number;
|
|
85
|
+
type_id: number;
|
|
86
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
87
|
+
}>;
|
|
88
|
+
create(data: CreateDTO): Promise<{
|
|
89
|
+
name: string;
|
|
90
|
+
id: number;
|
|
91
|
+
created_at: Date;
|
|
92
|
+
updated_at: Date;
|
|
93
|
+
slug: string;
|
|
94
|
+
is_active: boolean;
|
|
95
|
+
provider_id: number;
|
|
96
|
+
type_id: number;
|
|
97
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
98
|
+
}>;
|
|
99
|
+
update({ id, data }: {
|
|
100
|
+
id: number;
|
|
101
|
+
data: UpdateDTO;
|
|
102
|
+
}): Promise<{
|
|
103
|
+
name: string;
|
|
104
|
+
id: number;
|
|
105
|
+
created_at: Date;
|
|
106
|
+
updated_at: Date;
|
|
107
|
+
slug: string;
|
|
108
|
+
is_active: boolean;
|
|
109
|
+
provider_id: number;
|
|
110
|
+
type_id: number;
|
|
111
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
112
|
+
}>;
|
|
113
|
+
delete({ ids }: DeleteDTO): Promise<{
|
|
114
|
+
count: number;
|
|
115
|
+
}>;
|
|
116
|
+
test(data: CreateDTO): Promise<{
|
|
117
|
+
success: boolean;
|
|
118
|
+
destination: string;
|
|
119
|
+
}>;
|
|
120
|
+
exportProfiles({ ids, includeSecrets, }: {
|
|
121
|
+
ids?: number[];
|
|
122
|
+
includeSecrets?: boolean;
|
|
123
|
+
}): Promise<Buffer>;
|
|
124
|
+
validateImportFile(file: MulterFile): Promise<{
|
|
125
|
+
format: {
|
|
126
|
+
type: "integration-profile";
|
|
127
|
+
version: 1;
|
|
128
|
+
generated_at: string;
|
|
129
|
+
include_secrets: boolean;
|
|
130
|
+
};
|
|
131
|
+
total_profiles: number;
|
|
132
|
+
valid_profiles: number;
|
|
133
|
+
invalid_profiles: number;
|
|
134
|
+
conflict_profiles: number;
|
|
135
|
+
importable_profiles: number;
|
|
136
|
+
conflict_slugs: string[];
|
|
137
|
+
profiles: ValidatedImportItem[];
|
|
138
|
+
invalid_items: InvalidImportItem[];
|
|
139
|
+
}>;
|
|
140
|
+
confirmImport({ profiles, conflictResolutions, }: {
|
|
141
|
+
profiles: ImportProfileItemDTO[];
|
|
142
|
+
conflictResolutions?: ConflictResolutionDTO[];
|
|
143
|
+
}): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
total_received: number;
|
|
146
|
+
created: number;
|
|
147
|
+
replaced: number;
|
|
148
|
+
renamed: number;
|
|
149
|
+
ignored: number;
|
|
150
|
+
imported: number;
|
|
151
|
+
}>;
|
|
152
|
+
private ensureSlugIsAvailable;
|
|
153
|
+
private validateTypeAndProvider;
|
|
154
|
+
private parseImportEnvelope;
|
|
155
|
+
private sanitizeConfigForExport;
|
|
156
|
+
private getSensitiveConfigKeys;
|
|
157
|
+
private generateUniqueSlug;
|
|
158
|
+
}
|
|
159
|
+
export {};
|
|
160
|
+
//# sourceMappingURL=integration-profile.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-profile.service.d.ts","sourceRoot":"","sources":["../../src/integration-profile/integration-profile.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;AAUpD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAmB7C,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAFjB,aAAa,EAAE,aAAa,EAE5B,iBAAiB,EAAE,iBAAiB;IAGjD,SAAS;;;;;;;;;;;IAcT,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM;;;;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