@hed-hog/core 0.0.370 → 0.0.373
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/LICENSE.md +21 -0
- package/README.md +2 -0
- package/dist/ai/ai.service.d.ts.map +1 -1
- package/dist/ai/ai.service.js +10 -7
- package/dist/ai/ai.service.js.map +1 -1
- package/dist/app-command/app-command.module.d.ts +3 -0
- package/dist/app-command/app-command.module.d.ts.map +1 -0
- package/dist/app-command/app-command.module.js +22 -0
- package/dist/app-command/app-command.module.js.map +1 -0
- package/dist/app-command/app-command.registry.d.ts +22 -0
- package/dist/app-command/app-command.registry.d.ts.map +1 -0
- package/dist/{webhook-integration/webhook-command.registry.js → app-command/app-command.registry.js} +6 -6
- package/dist/app-command/app-command.registry.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +2 -2
- package/dist/auth/auth.controller.d.ts.map +1 -1
- package/dist/auth/auth.controller.js +20 -7
- package/dist/auth/auth.controller.js.map +1 -1
- package/dist/auth/auth.service.d.ts +3 -3
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +10 -36
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/auth/dto/forget.dto.d.ts +1 -0
- package/dist/auth/dto/forget.dto.d.ts.map +1 -1
- package/dist/auth/dto/forget.dto.js +5 -0
- package/dist/auth/dto/forget.dto.js.map +1 -1
- package/dist/auth/guards/auth.guard.d.ts.map +1 -1
- package/dist/auth/guards/auth.guard.js +4 -1
- package/dist/auth/guards/auth.guard.js.map +1 -1
- package/dist/challenge/challenge.service.d.ts +8 -7
- package/dist/challenge/challenge.service.d.ts.map +1 -1
- package/dist/challenge/challenge.service.js +27 -19
- package/dist/challenge/challenge.service.js.map +1 -1
- package/dist/file/dto/upload.dto.d.ts +3 -0
- package/dist/file/dto/upload.dto.d.ts.map +1 -1
- package/dist/file/dto/upload.dto.js +22 -0
- package/dist/file/dto/upload.dto.js.map +1 -1
- package/dist/file/file.controller.d.ts +2 -1
- package/dist/file/file.controller.d.ts.map +1 -1
- package/dist/file/file.controller.js +29 -16
- package/dist/file/file.controller.js.map +1 -1
- package/dist/file/file.service.d.ts +51 -1
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +250 -18
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/image-optimization.service.d.ts +17 -4
- package/dist/file/image-optimization.service.d.ts.map +1 -1
- package/dist/file/image-optimization.service.js +101 -46
- package/dist/file/image-optimization.service.js.map +1 -1
- package/dist/file/provider/s3.provider.d.ts.map +1 -1
- package/dist/file/provider/s3.provider.js +15 -7
- package/dist/file/provider/s3.provider.js.map +1 -1
- package/dist/file/provider/spaces.provider.d.ts.map +1 -1
- package/dist/file/provider/spaces.provider.js +18 -8
- package/dist/file/provider/spaces.provider.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/integration/services/event-subscriber.registry.d.ts +5 -0
- package/dist/integration/services/event-subscriber.registry.d.ts.map +1 -1
- package/dist/integration/services/event-subscriber.registry.js +15 -0
- package/dist/integration/services/event-subscriber.registry.js.map +1 -1
- package/dist/integration/services/outbox.processor.d.ts.map +1 -1
- package/dist/integration/services/outbox.processor.js +2 -4
- package/dist/integration/services/outbox.processor.js.map +1 -1
- package/dist/integration/services/outbox.service.d.ts +4 -2
- package/dist/integration/services/outbox.service.d.ts.map +1 -1
- package/dist/integration/services/outbox.service.js +26 -15
- package/dist/integration/services/outbox.service.js.map +1 -1
- package/dist/integration-profile/integration-credential-crypto.service.d.ts +43 -0
- package/dist/integration-profile/integration-credential-crypto.service.d.ts.map +1 -0
- package/dist/integration-profile/integration-credential-crypto.service.js +142 -0
- package/dist/integration-profile/integration-credential-crypto.service.js.map +1 -0
- package/dist/integration-profile/integration-profile.controller.d.ts +6 -7
- package/dist/integration-profile/integration-profile.controller.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.controller.js +4 -3
- package/dist/integration-profile/integration-profile.controller.js.map +1 -1
- package/dist/integration-profile/integration-profile.module.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.module.js +5 -2
- package/dist/integration-profile/integration-profile.module.js.map +1 -1
- package/dist/integration-profile/integration-profile.secrets.d.ts +16 -0
- package/dist/integration-profile/integration-profile.secrets.d.ts.map +1 -0
- package/dist/integration-profile/integration-profile.secrets.js +56 -0
- package/dist/integration-profile/integration-profile.secrets.js.map +1 -0
- package/dist/integration-profile/integration-profile.service.d.ts +125 -8
- package/dist/integration-profile/integration-profile.service.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.service.js +257 -68
- package/dist/integration-profile/integration-profile.service.js.map +1 -1
- package/dist/integration-profile/integration-profile.utils.d.ts +17 -0
- package/dist/integration-profile/integration-profile.utils.d.ts.map +1 -1
- package/dist/integration-profile/integration-profile.utils.js +31 -0
- package/dist/integration-profile/integration-profile.utils.js.map +1 -1
- package/dist/language/en.json +178 -0
- package/dist/language/pt.json +178 -0
- package/dist/mail/mail.controller.d.ts.map +1 -1
- package/dist/mail/mail.controller.js +5 -28
- package/dist/mail/mail.controller.js.map +1 -1
- package/dist/mail/mail.module.js +18 -18
- package/dist/mail/mail.module.js.map +1 -1
- package/dist/mail/mail.service.d.ts +13 -2
- package/dist/mail/mail.service.d.ts.map +1 -1
- package/dist/mail/mail.service.js +25 -15
- package/dist/mail/mail.service.js.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.js +6 -5
- package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
- package/dist/oauth/providers/facebook.provider.js +5 -5
- package/dist/oauth/providers/facebook.provider.js.map +1 -1
- package/dist/oauth/providers/github.provider.js +5 -5
- package/dist/oauth/providers/github.provider.js.map +1 -1
- package/dist/oauth/providers/google.provider.js +5 -5
- package/dist/oauth/providers/google.provider.js.map +1 -1
- package/dist/oauth/providers/microsoft-entra-id.provider.js +5 -5
- package/dist/oauth/providers/microsoft-entra-id.provider.js.map +1 -1
- package/dist/oauth/providers/microsoft.provider.js +5 -5
- package/dist/oauth/providers/microsoft.provider.js.map +1 -1
- package/dist/pdf/pdf.service.d.ts +4 -0
- package/dist/pdf/pdf.service.d.ts.map +1 -1
- package/dist/pdf/pdf.service.js +16 -9
- package/dist/pdf/pdf.service.js.map +1 -1
- package/dist/profile/profile.controller.d.ts +7 -7
- package/dist/profile/profile.controller.d.ts.map +1 -1
- package/dist/profile/profile.controller.js +28 -21
- package/dist/profile/profile.controller.js.map +1 -1
- package/dist/profile/profile.service.d.ts +7 -7
- package/dist/profile/profile.service.d.ts.map +1 -1
- package/dist/profile/profile.service.js +21 -25
- package/dist/profile/profile.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts +1 -0
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +15 -2
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/token/token.service.d.ts.map +1 -1
- package/dist/token/token.service.js +2 -1
- package/dist/token/token.service.js.map +1 -1
- package/dist/user/user.controller.d.ts +9 -0
- package/dist/user/user.controller.d.ts.map +1 -1
- package/dist/user/user.controller.js +13 -0
- package/dist/user/user.controller.js.map +1 -1
- package/dist/user/user.service.d.ts +7 -0
- package/dist/user/user.service.d.ts.map +1 -1
- package/dist/user/user.service.js +19 -0
- package/dist/user/user.service.js.map +1 -1
- package/dist/utils/webauthn-origin.d.ts +11 -0
- package/dist/utils/webauthn-origin.d.ts.map +1 -0
- package/dist/utils/webauthn-origin.js +37 -0
- package/dist/utils/webauthn-origin.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts +13 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.js +29 -0
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.module.js +3 -3
- package/dist/webhook-integration/webhook-integration.module.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +18 -2
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +110 -6
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/hedhog/data/integration_provider.yaml +9 -0
- package/hedhog/data/integration_type.yaml +6 -0
- package/hedhog/data/menu.yaml +6 -0
- package/hedhog/data/role.yaml +7 -0
- package/hedhog/data/route.yaml +36 -0
- package/hedhog/data/setting_group.yaml +119 -13
- package/hedhog/frontend/app/access-log/page.tsx.ejs +35 -3
- package/hedhog/frontend/app/account/components/active-sessions.tsx.ejs +36 -3
- package/hedhog/frontend/app/account/components/mcp-tokens.tsx.ejs +39 -4
- package/hedhog/frontend/app/account/components/tokens.tsx.ejs +39 -4
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +35 -2
- package/hedhog/frontend/app/configurations/[slug]/components/byte-size-input.tsx.ejs +160 -0
- package/hedhog/frontend/app/configurations/[slug]/components/duration-input.tsx.ejs +157 -0
- package/hedhog/frontend/app/configurations/[slug]/components/setting-field.tsx.ejs +244 -63
- package/hedhog/frontend/app/dashboard/[slug]/dashboard-content.tsx.ejs +33 -1
- package/hedhog/frontend/app/dashboard/management/tabs/component-roles-tab.tsx.ejs +35 -3
- package/hedhog/frontend/app/dashboard/management/tabs/components-tab.tsx.ejs +36 -4
- package/hedhog/frontend/app/dashboard/management/tabs/dashboard-roles-tab.tsx.ejs +35 -3
- package/hedhog/frontend/app/dashboard/management/tabs/dashboards-tab.tsx.ejs +36 -4
- package/hedhog/frontend/app/dashboard/management/tabs/items-tab.tsx.ejs +35 -3
- package/hedhog/frontend/app/integration/profiles/page.tsx.ejs +156 -38
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +118 -11
- package/hedhog/frontend/app/mail/log/page.tsx.ejs +37 -4
- package/hedhog/frontend/app/menu/page.tsx.ejs +34 -2
- package/hedhog/frontend/app/preferences/page.tsx.ejs +77 -0
- package/hedhog/frontend/app/roles/menus.tsx.ejs +35 -3
- package/hedhog/frontend/app/roles/page.tsx.ejs +34 -2
- package/hedhog/frontend/app/roles/routes.tsx.ejs +36 -4
- package/hedhog/frontend/app/roles/users.tsx.ejs +36 -4
- package/hedhog/frontend/app/routes/page.tsx.ejs +34 -2
- package/hedhog/frontend/app/setting-list/page.tsx.ejs +34 -2
- package/hedhog/frontend/app/users/page.tsx.ejs +51 -21
- package/hedhog/frontend/messages/en.json +69 -4
- package/hedhog/frontend/messages/pt.json +69 -4
- package/hedhog/table/setting.yaml +2 -0
- package/hedhog/table/webhook_call_log.yaml +49 -46
- package/package.json +9 -4
- package/src/ai/ai.service.ts +9 -6
- package/src/app-command/app-command.module.ts +9 -0
- package/src/{webhook-integration/webhook-command.registry.ts → app-command/app-command.registry.ts} +9 -9
- package/src/auth/auth.controller.ts +20 -4
- package/src/auth/auth.service.ts +10 -36
- package/src/auth/dto/forget.dto.ts +5 -1
- package/src/auth/guards/auth.guard.ts +4 -1
- package/src/challenge/challenge.service.ts +30 -19
- package/src/file/dto/upload.dto.ts +25 -1
- package/src/file/file.controller.ts +31 -18
- package/src/file/file.service.ts +341 -16
- package/src/file/image-optimization.service.ts +111 -46
- package/src/file/provider/s3.provider.ts +16 -7
- package/src/file/provider/spaces.provider.ts +15 -5
- package/src/index.ts +4 -1
- package/src/integration/services/event-subscriber.registry.ts +15 -0
- package/src/integration/services/outbox.processor.ts +2 -5
- package/src/integration/services/outbox.service.ts +35 -17
- package/src/integration-profile/integration-credential-crypto.service.ts +146 -0
- package/src/integration-profile/integration-profile.controller.ts +2 -0
- package/src/integration-profile/integration-profile.module.ts +5 -2
- package/src/integration-profile/integration-profile.secrets.ts +51 -0
- package/src/integration-profile/integration-profile.service.ts +335 -54
- package/src/integration-profile/integration-profile.utils.ts +56 -0
- package/src/language/en.json +5 -1
- package/src/language/pt.json +5 -1
- package/src/mail/mail.controller.ts +5 -29
- package/src/mail/mail.module.ts +5 -5
- package/src/mail/mail.service.ts +37 -13
- package/src/mcp-chat/mcp-chat.service.ts +5 -5
- package/src/oauth/oauth-callback-coordinator.service.spec.ts +159 -0
- package/src/oauth/providers/facebook.provider.ts +3 -3
- package/src/oauth/providers/github.provider.ts +3 -3
- package/src/oauth/providers/google.provider.ts +3 -3
- package/src/oauth/providers/microsoft-entra-id.provider.ts +3 -3
- package/src/oauth/providers/microsoft.provider.ts +3 -3
- package/src/pdf/pdf.service.ts +19 -6
- package/src/profile/profile.controller.ts +21 -14
- package/src/profile/profile.service.ts +23 -20
- package/src/security/security.service.spec.ts +222 -0
- package/src/setting/setting.service.ts +15 -2
- package/src/token/token.service.ts +2 -1
- package/src/user/user.controller.ts +26 -16
- package/src/user/user.service.ts +25 -0
- package/src/utils/webauthn-origin.ts +38 -0
- package/src/webhook-integration/webhook-integration.controller.ts +23 -0
- package/src/webhook-integration/webhook-integration.module.ts +3 -3
- package/src/webhook-integration/webhook-integration.service.ts +115 -5
- package/dist/webhook-integration/webhook-command.registry.d.ts +0 -22
- package/dist/webhook-integration/webhook-command.registry.d.ts.map +0 -1
- package/dist/webhook-integration/webhook-command.registry.js.map +0 -1
- package/src/menu/menu.service.spec.ts +0 -247
- package/src/route/route.service.spec.ts +0 -300
- package/src/screen/screen.service.spec.ts +0 -298
- package/src/user/user.service.spec.ts +0 -294
|
@@ -4,6 +4,15 @@ import { PrismaService } from '@hed-hog/api-prisma';
|
|
|
4
4
|
import { CreateDTO } from './dto/create.dto';
|
|
5
5
|
import { ConflictResolutionDTO, ImportProfileItemDTO } from './dto/import-confirm.dto';
|
|
6
6
|
import { UpdateDTO } from './dto/update.dto';
|
|
7
|
+
import { IntegrationCredentialCryptoService } from './integration-credential-crypto.service';
|
|
8
|
+
type IntegrationProfileExportItem = {
|
|
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
|
+
};
|
|
7
16
|
type ValidatedImportItem = {
|
|
8
17
|
index: number;
|
|
9
18
|
slug: string;
|
|
@@ -22,17 +31,18 @@ type InvalidImportItem = {
|
|
|
22
31
|
export declare class IntegrationProfileService {
|
|
23
32
|
private readonly prismaService;
|
|
24
33
|
private readonly paginationService;
|
|
25
|
-
|
|
34
|
+
private readonly credentialCrypto;
|
|
35
|
+
constructor(prismaService: PrismaService, paginationService: PaginationService, credentialCrypto: IntegrationCredentialCryptoService);
|
|
26
36
|
listTypes(): Promise<{
|
|
27
37
|
id: number;
|
|
28
38
|
slug: string;
|
|
29
|
-
icon: string;
|
|
30
39
|
integration_type_locale: {
|
|
31
40
|
name: string;
|
|
32
41
|
locale: {
|
|
33
42
|
code: string;
|
|
34
43
|
};
|
|
35
44
|
}[];
|
|
45
|
+
icon: string;
|
|
36
46
|
}[]>;
|
|
37
47
|
listProviders(typeId?: number, typeSlug?: string): Promise<{
|
|
38
48
|
id: number;
|
|
@@ -45,7 +55,7 @@ export declare class IntegrationProfileService {
|
|
|
45
55
|
}[];
|
|
46
56
|
type_id: number;
|
|
47
57
|
}[]>;
|
|
48
|
-
list(paginationParams: PaginationDTO, typeId?: number, typeSlug?: string, providerSlug?: string): Promise<{
|
|
58
|
+
list(paginationParams: PaginationDTO, typeId?: number, typeSlug?: string, providerSlug?: string, slug?: string): Promise<{
|
|
49
59
|
total: any;
|
|
50
60
|
lastPage: number;
|
|
51
61
|
page: number;
|
|
@@ -54,7 +64,37 @@ export declare class IntegrationProfileService {
|
|
|
54
64
|
next: number;
|
|
55
65
|
data: any[];
|
|
56
66
|
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Resolve o config do perfil de integração ATIVO para um par tipo/provider — uso
|
|
69
|
+
* server-side por serviços que precisam das credenciais (ex.: InfraScaler do
|
|
70
|
+
* autoscaling). Opcionalmente fixa um slug específico (vindo de uma setting). É o ponto
|
|
71
|
+
* único de acesso às credenciais armazenadas no Perfil de Integração.
|
|
72
|
+
*/
|
|
73
|
+
getActiveProfileConfig(typeSlug: string, providerSlug: string, options?: {
|
|
74
|
+
profileSlug?: string;
|
|
75
|
+
profileId?: number;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
id: number;
|
|
78
|
+
slug: string;
|
|
79
|
+
config: Record<string, unknown>;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve um perfil ATIVO do tipo `infrastructure` (DigitalOcean, Kubernetes, …) por
|
|
83
|
+
* SLUG (vindo de uma setting) ou por ID (seleção direta na UI) — ou o mais recente se
|
|
84
|
+
* nada for dado. Retorna o slug do provider (para dispatch) e o config já decifrado
|
|
85
|
+
* pelo middleware. Uso interno do autoscaling.
|
|
86
|
+
*/
|
|
87
|
+
getActiveInfrastructureProfile(options?: {
|
|
88
|
+
profileSlug?: string;
|
|
89
|
+
profileId?: number;
|
|
90
|
+
}): Promise<{
|
|
91
|
+
id: number;
|
|
92
|
+
slug: string;
|
|
93
|
+
providerSlug: string;
|
|
94
|
+
config: Record<string, unknown>;
|
|
95
|
+
}>;
|
|
57
96
|
get(id: number): Promise<{
|
|
97
|
+
config: Record<string, unknown>;
|
|
58
98
|
integration_provider: {
|
|
59
99
|
slug: string;
|
|
60
100
|
integration_provider_locale: {
|
|
@@ -66,15 +106,48 @@ export declare class IntegrationProfileService {
|
|
|
66
106
|
};
|
|
67
107
|
integration_type: {
|
|
68
108
|
slug: string;
|
|
109
|
+
integration_type_locale: {
|
|
110
|
+
name: string;
|
|
111
|
+
locale: {
|
|
112
|
+
code: string;
|
|
113
|
+
};
|
|
114
|
+
}[];
|
|
69
115
|
icon: string;
|
|
116
|
+
};
|
|
117
|
+
id: number;
|
|
118
|
+
created_at: Date;
|
|
119
|
+
name: string;
|
|
120
|
+
updated_at: Date;
|
|
121
|
+
provider_id: number;
|
|
122
|
+
slug: string;
|
|
123
|
+
is_active: boolean;
|
|
124
|
+
type_id: number;
|
|
125
|
+
}>;
|
|
126
|
+
/**
|
|
127
|
+
* Igual a `get(id)`, porém resolvendo o perfil pelo SLUG (valor estável guardado em
|
|
128
|
+
* settings). Reusa `get()` para manter o mesmo include e o mascaramento de segredos.
|
|
129
|
+
*/
|
|
130
|
+
getBySlug(slug: string): Promise<{
|
|
131
|
+
config: Record<string, unknown>;
|
|
132
|
+
integration_provider: {
|
|
133
|
+
slug: string;
|
|
134
|
+
integration_provider_locale: {
|
|
135
|
+
name: string;
|
|
136
|
+
locale: {
|
|
137
|
+
code: string;
|
|
138
|
+
};
|
|
139
|
+
}[];
|
|
140
|
+
};
|
|
141
|
+
integration_type: {
|
|
142
|
+
slug: string;
|
|
70
143
|
integration_type_locale: {
|
|
71
144
|
name: string;
|
|
72
145
|
locale: {
|
|
73
146
|
code: string;
|
|
74
147
|
};
|
|
75
148
|
}[];
|
|
149
|
+
icon: string;
|
|
76
150
|
};
|
|
77
|
-
} & {
|
|
78
151
|
id: number;
|
|
79
152
|
created_at: Date;
|
|
80
153
|
name: string;
|
|
@@ -82,7 +155,6 @@ export declare class IntegrationProfileService {
|
|
|
82
155
|
provider_id: number;
|
|
83
156
|
slug: string;
|
|
84
157
|
is_active: boolean;
|
|
85
|
-
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
86
158
|
type_id: number;
|
|
87
159
|
}>;
|
|
88
160
|
create(data: CreateDTO): Promise<{
|
|
@@ -93,9 +165,11 @@ export declare class IntegrationProfileService {
|
|
|
93
165
|
provider_id: number;
|
|
94
166
|
slug: string;
|
|
95
167
|
is_active: boolean;
|
|
96
|
-
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
97
168
|
type_id: number;
|
|
169
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
98
170
|
}>;
|
|
171
|
+
/** Resolve o slug do provider a partir do id (para saber as chaves sensíveis). */
|
|
172
|
+
private getProviderSlug;
|
|
99
173
|
update({ id, data }: {
|
|
100
174
|
id: number;
|
|
101
175
|
data: UpdateDTO;
|
|
@@ -107,8 +181,8 @@ export declare class IntegrationProfileService {
|
|
|
107
181
|
provider_id: number;
|
|
108
182
|
slug: string;
|
|
109
183
|
is_active: boolean;
|
|
110
|
-
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
111
184
|
type_id: number;
|
|
185
|
+
config: import("@prisma/client/runtime/library").JsonValue | null;
|
|
112
186
|
}>;
|
|
113
187
|
delete({ ids }: DeleteDTO): Promise<{
|
|
114
188
|
count: number;
|
|
@@ -121,6 +195,27 @@ export declare class IntegrationProfileService {
|
|
|
121
195
|
ids?: number[];
|
|
122
196
|
includeSecrets?: boolean;
|
|
123
197
|
}): Promise<Buffer>;
|
|
198
|
+
/**
|
|
199
|
+
* Returns export-ready profile items (slug/name/type_slug/provider_slug/config/
|
|
200
|
+
* is_active) plus the source-environment `id`. Used by callers that must reference
|
|
201
|
+
* profiles by id — e.g. the agent workflow export, which remaps node
|
|
202
|
+
* `integrationProfileId` through id → slug → (destination) id. `config` is decrypted
|
|
203
|
+
* defensively and sanitized per `includeSecrets`.
|
|
204
|
+
*/
|
|
205
|
+
exportProfileItemsByIds(ids: number[] | undefined, includeSecrets: boolean): Promise<(IntegrationProfileExportItem & {
|
|
206
|
+
id: number;
|
|
207
|
+
})[]>;
|
|
208
|
+
/**
|
|
209
|
+
* Validates that each item's type_slug/provider_slug exist and that the provider
|
|
210
|
+
* belongs to the type. Returns a map of item slug → list of errors (empty = valid).
|
|
211
|
+
* Reused by external importers (e.g. the agent workflow import) to validate the
|
|
212
|
+
* credential profiles bundled inside a workflow file.
|
|
213
|
+
*/
|
|
214
|
+
validateImportItems(items: {
|
|
215
|
+
slug: string;
|
|
216
|
+
type_slug: string;
|
|
217
|
+
provider_slug: string;
|
|
218
|
+
}[]): Promise<Map<string, string[]>>;
|
|
124
219
|
validateImportFile(file: MulterFile): Promise<{
|
|
125
220
|
format: {
|
|
126
221
|
type: "integration-profile";
|
|
@@ -149,11 +244,33 @@ export declare class IntegrationProfileService {
|
|
|
149
244
|
ignored: number;
|
|
150
245
|
imported: number;
|
|
151
246
|
}>;
|
|
247
|
+
/**
|
|
248
|
+
* Creates/updates integration profiles from import items, applying per-slug
|
|
249
|
+
* conflict resolutions, and returns a map from each item's (original) slug to the
|
|
250
|
+
* resulting profile id + applied action — plus aggregate counts. Re-encrypts config
|
|
251
|
+
* with the destination system key. Used by `confirmImport` (counts) and by the agent
|
|
252
|
+
* workflow import (which needs the resulting ids to remap node integrationProfileId).
|
|
253
|
+
*
|
|
254
|
+
* For `ignore` on a conflicting slug, the existing profile is left untouched but its
|
|
255
|
+
* id is still returned so callers can relink references to the local profile.
|
|
256
|
+
*/
|
|
257
|
+
ensureProfilesBySlug(profiles: ImportProfileItemDTO[], conflictResolutions?: ConflictResolutionDTO[]): Promise<{
|
|
258
|
+
results: Map<string, {
|
|
259
|
+
id: number;
|
|
260
|
+
slug: string;
|
|
261
|
+
action: 'created' | 'replaced' | 'renamed' | 'ignored';
|
|
262
|
+
}>;
|
|
263
|
+
counts: {
|
|
264
|
+
created: number;
|
|
265
|
+
replaced: number;
|
|
266
|
+
renamed: number;
|
|
267
|
+
ignored: number;
|
|
268
|
+
};
|
|
269
|
+
}>;
|
|
152
270
|
private ensureSlugIsAvailable;
|
|
153
271
|
private validateTypeAndProvider;
|
|
154
272
|
private parseImportEnvelope;
|
|
155
273
|
private sanitizeConfigForExport;
|
|
156
|
-
private getSensitiveConfigKeys;
|
|
157
274
|
private generateUniqueSlug;
|
|
158
275
|
}
|
|
159
276
|
export {};
|
|
@@ -1 +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;
|
|
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;AAC7C,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAG7F,KAAK,4BAA4B,GAAG;IAClC,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;CACpB,CAAC;AAUF,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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