n8n 2.8.3 → 2.9.1
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/abstract-server.js +1 -1
- package/dist/abstract-server.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/commands/export/workflow.d.ts +7 -0
- package/dist/commands/export/workflow.js +87 -14
- package/dist/commands/export/workflow.js.map +1 -1
- package/dist/commands/import/workflow.js +12 -2
- package/dist/commands/import/workflow.js.map +1 -1
- package/dist/controllers/ai.controller.js +5 -2
- package/dist/controllers/ai.controller.js.map +1 -1
- package/dist/controllers/e2e.controller.js +1 -0
- package/dist/controllers/e2e.controller.js.map +1 -1
- package/dist/controllers/security-settings.controller.js +2 -0
- package/dist/controllers/security-settings.controller.js.map +1 -1
- package/dist/credentials/credentials.controller.js +2 -2
- package/dist/credentials/credentials.controller.js.map +1 -1
- package/dist/credentials/credentials.service.d.ts +9 -2
- package/dist/credentials/credentials.service.js +44 -5
- package/dist/credentials/credentials.service.js.map +1 -1
- package/dist/credentials/validation.d.ts +5 -1
- package/dist/credentials/validation.js +78 -0
- package/dist/credentials/validation.js.map +1 -1
- package/dist/eventbus/event-message-classes/abstract-event-message.js +1 -1
- package/dist/eventbus/event-message-classes/abstract-event-message.js.map +1 -1
- package/dist/eventbus/event-message-classes/index.d.ts +2 -2
- package/dist/eventbus/event-message-classes/index.js +5 -0
- package/dist/eventbus/event-message-classes/index.js.map +1 -1
- package/dist/events/maps/relay.event-map.d.ts +36 -0
- package/dist/events/relays/log-streaming.event-relay.d.ts +5 -0
- package/dist/events/relays/log-streaming.event-relay.js +35 -0
- package/dist/events/relays/log-streaming.event-relay.js.map +1 -1
- package/dist/executions/pre-execution-checks/credentials-permission-checker.d.ts +4 -1
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js +29 -4
- package/dist/executions/pre-execution-checks/credentials-permission-checker.js.map +1 -1
- package/dist/interfaces.d.ts +9 -2
- package/dist/load-nodes-and-credentials.d.ts +1 -0
- package/dist/load-nodes-and-credentials.js +14 -0
- package/dist/load-nodes-and-credentials.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.entity.d.ts +3 -3
- package/dist/modules/chat-hub/chat-hub-agent.entity.js +7 -2
- package/dist/modules/chat-hub/chat-hub-agent.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.repository.d.ts +1 -0
- package/dist/modules/chat-hub/chat-hub-agent.repository.js +8 -0
- package/dist/modules/chat-hub/chat-hub-agent.repository.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-agent.service.d.ts +9 -4
- package/dist/modules/chat-hub/chat-hub-agent.service.js +39 -7
- package/dist/modules/chat-hub/chat-hub-agent.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-session.entity.d.ts +2 -3
- package/dist/modules/chat-hub/chat-hub-session.entity.js +7 -2
- package/dist/modules/chat-hub/chat-hub-session.entity.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub-tool.entity.d.ts +23 -0
- package/dist/modules/chat-hub/chat-hub-tool.entity.js +54 -0
- package/dist/modules/chat-hub/chat-hub-tool.entity.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-tool.repository.d.ts +18 -0
- package/dist/modules/chat-hub/chat-hub-tool.repository.js +134 -0
- package/dist/modules/chat-hub/chat-hub-tool.repository.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-tool.service.d.ts +24 -0
- package/dist/modules/chat-hub/chat-hub-tool.service.js +119 -0
- package/dist/modules/chat-hub/chat-hub-tool.service.js.map +1 -0
- package/dist/modules/chat-hub/chat-hub-workflow.service.d.ts +3 -1
- package/dist/modules/chat-hub/chat-hub-workflow.service.js +6 -3
- package/dist/modules/chat-hub/chat-hub-workflow.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.controller.d.ts +13 -6
- package/dist/modules/chat-hub/chat-hub.controller.js +67 -3
- package/dist/modules/chat-hub/chat-hub.controller.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.module.d.ts +1 -1
- package/dist/modules/chat-hub/chat-hub.module.js +2 -1
- package/dist/modules/chat-hub/chat-hub.module.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.service.d.ts +3 -1
- package/dist/modules/chat-hub/chat-hub.service.js +30 -14
- package/dist/modules/chat-hub/chat-hub.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.settings.service.d.ts +3 -2
- package/dist/modules/chat-hub/chat-hub.settings.service.js +4 -4
- package/dist/modules/chat-hub/chat-hub.settings.service.js.map +1 -1
- package/dist/modules/chat-hub/chat-hub.types.d.ts +2 -3
- package/dist/modules/chat-hub/chat-hub.types.js.map +1 -1
- package/dist/modules/data-table/data-table.controller.d.ts +2 -2
- package/dist/modules/data-table/data-table.controller.js +4 -3
- package/dist/modules/data-table/data-table.controller.js.map +1 -1
- package/dist/modules/data-table/data-table.service.d.ts +1 -1
- package/dist/modules/data-table/data-table.service.js +13 -7
- package/dist/modules/data-table/data-table.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.d.ts +2 -1
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js +22 -7
- package/dist/modules/external-secrets.ee/external-secrets-manager.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.js +13 -5
- package/dist/modules/external-secrets.ee/providers/gcp-secrets-manager/gcp-secrets-manager.js.map +1 -1
- package/dist/modules/external-secrets.ee/secret-provider-access-check.service.ee.d.ts +6 -0
- package/dist/modules/external-secrets.ee/secret-provider-access-check.service.ee.js +28 -0
- package/dist/modules/external-secrets.ee/secret-provider-access-check.service.ee.js.map +1 -0
- package/dist/modules/external-secrets.ee/secrets-cache.service.d.ts +2 -1
- package/dist/modules/external-secrets.ee/secrets-cache.service.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.d.ts +5 -5
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js +10 -10
- package/dist/modules/external-secrets.ee/secrets-providers-connections.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.d.ts +14 -6
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js +128 -14
- package/dist/modules/external-secrets.ee/secrets-providers-connections.service.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.d.ts +8 -1
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js +93 -1
- package/dist/modules/external-secrets.ee/secrets-providers-project.controller.ee.js.map +1 -1
- package/dist/modules/external-secrets.ee/secrets-providers.responses.ee.d.ts +2 -2
- package/dist/modules/mcp/mcp.event-relay.js +2 -0
- package/dist/modules/mcp/mcp.event-relay.js.map +1 -1
- package/dist/modules/quick-connect/handlers/firecrawl.handler.d.ts +8 -0
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js +37 -0
- package/dist/modules/quick-connect/handlers/firecrawl.handler.js.map +1 -0
- package/dist/modules/quick-connect/handlers/quick-connect.handler.d.ts +3 -2
- package/dist/modules/quick-connect/handlers/quick-connect.handler.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.config.d.ts +36 -0
- package/dist/modules/quick-connect/quick-connect.config.js +3 -0
- package/dist/modules/quick-connect/quick-connect.config.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.module.js +2 -2
- package/dist/modules/quick-connect/quick-connect.module.js.map +1 -1
- package/dist/modules/quick-connect/quick-connect.service.d.ts +29 -0
- package/dist/modules/quick-connect/quick-connect.service.js +7 -3
- package/dist/modules/quick-connect/quick-connect.service.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-export.service.ee.d.ts +1 -2
- package/dist/modules/source-control.ee/source-control-export.service.ee.js +4 -29
- package/dist/modules/source-control.ee/source-control-export.service.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-helper.ee.d.ts +9 -5
- package/dist/modules/source-control.ee/source-control-helper.ee.js +78 -3
- package/dist/modules/source-control.ee/source-control-helper.ee.js.map +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.d.ts +1 -1
- package/dist/modules/source-control.ee/source-control-import.service.ee.js +42 -28
- package/dist/modules/source-control.ee/source-control-import.service.ee.js.map +1 -1
- package/dist/modules/workflow-index/workflow-index.service.js +3 -0
- package/dist/modules/workflow-index/workflow-index.service.js.map +1 -1
- package/dist/public-api/types.d.ts +8 -0
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.middleware.js +2 -2
- package/dist/public-api/v1/handlers/credentials/credentials.middleware.js.map +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.d.ts +1 -1
- package/dist/public-api/v1/handlers/credentials/credentials.service.js +17 -5
- package/dist/public-api/v1/handlers/credentials/credentials.service.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.handler.d.ts +2 -0
- package/dist/public-api/v1/handlers/executions/executions.handler.js +44 -0
- package/dist/public-api/v1/handlers/executions/executions.handler.js.map +1 -1
- package/dist/public-api/v1/handlers/executions/executions.service.d.ts +14 -0
- package/dist/public-api/v1/handlers/executions/executions.service.js +49 -0
- package/dist/public-api/v1/handlers/executions/executions.service.js.map +1 -0
- package/dist/public-api/v1/openapi.yml +65 -11
- package/dist/scaling/worker-server.js +1 -1
- package/dist/scaling/worker-server.js.map +1 -1
- package/dist/server.js +17 -10
- package/dist/server.js.map +1 -1
- package/dist/services/ai-workflow-builder.service.d.ts +4 -3
- package/dist/services/ai-workflow-builder.service.js +60 -10
- package/dist/services/ai-workflow-builder.service.js.map +1 -1
- package/dist/services/frontend.service.js +20 -13
- package/dist/services/frontend.service.js.map +1 -1
- package/dist/services/import.service.d.ts +2 -2
- package/dist/services/import.service.js +3 -0
- package/dist/services/import.service.js.map +1 -1
- package/dist/task-runners/task-broker/task-broker-server.js +1 -1
- package/dist/task-runners/task-broker/task-broker-server.js.map +1 -1
- package/dist/workflows/workflow-execution.service.js +3 -1
- package/dist/workflows/workflow-execution.service.js.map +1 -1
- package/dist/workflows/workflow.service.d.ts +3 -2
- package/dist/workflows/workflow.service.js +10 -3
- package/dist/workflows/workflow.service.js.map +1 -1
- package/package.json +25 -24
- package/dist/modules/quick-connect/handlers/sample.handler.d.ts +0 -7
- package/dist/modules/quick-connect/handlers/sample.handler.js +0 -27
- package/dist/modules/quick-connect/handlers/sample.handler.js.map +0 -1
|
@@ -35,22 +35,22 @@ let SecretProvidersConnectionsController = class SecretProvidersConnectionsContr
|
|
|
35
35
|
}
|
|
36
36
|
next();
|
|
37
37
|
}
|
|
38
|
-
async createConnection(
|
|
38
|
+
async createConnection(req, _res, body) {
|
|
39
39
|
this.logger.debug('Creating new connection', {
|
|
40
40
|
providerKey: body.providerKey,
|
|
41
41
|
type: body.type,
|
|
42
42
|
});
|
|
43
|
-
const savedConnection = await this.connectionsService.createConnection(body);
|
|
43
|
+
const savedConnection = await this.connectionsService.createConnection(body, req.user.id);
|
|
44
44
|
return this.connectionsService.toPublicConnection(savedConnection);
|
|
45
45
|
}
|
|
46
|
-
async updateConnection(
|
|
46
|
+
async updateConnection(req, _res, providerKey, body) {
|
|
47
47
|
this.logger.debug('Updating connection', { providerKey });
|
|
48
|
-
const connection = await this.connectionsService.updateConnection(providerKey, body);
|
|
48
|
+
const connection = await this.connectionsService.updateConnection(providerKey, body, req.user.id);
|
|
49
49
|
return this.connectionsService.toPublicConnection(connection);
|
|
50
50
|
}
|
|
51
|
-
async deleteConnection(
|
|
51
|
+
async deleteConnection(req, _res, providerKey) {
|
|
52
52
|
this.logger.debug('Deleting connection', { providerKey });
|
|
53
|
-
const connection = await this.connectionsService.deleteConnection(providerKey);
|
|
53
|
+
const connection = await this.connectionsService.deleteConnection(providerKey, req.user.id);
|
|
54
54
|
return this.connectionsService.toPublicConnection(connection);
|
|
55
55
|
}
|
|
56
56
|
async listConnections() {
|
|
@@ -63,13 +63,13 @@ let SecretProvidersConnectionsController = class SecretProvidersConnectionsContr
|
|
|
63
63
|
const connection = await this.connectionsService.getConnection(providerKey);
|
|
64
64
|
return this.connectionsService.toPublicConnection(connection);
|
|
65
65
|
}
|
|
66
|
-
async testConnection(
|
|
66
|
+
async testConnection(req, _res, providerKey) {
|
|
67
67
|
this.logger.debug('Testing provider connection', { providerKey });
|
|
68
|
-
return await this.connectionsService.testConnection(providerKey);
|
|
68
|
+
return await this.connectionsService.testConnection(providerKey, req.user.id);
|
|
69
69
|
}
|
|
70
|
-
async reloadConnectionSecrets(
|
|
70
|
+
async reloadConnectionSecrets(req, _res, providerKey) {
|
|
71
71
|
this.logger.debug('Reloading secrets for secret provider connection', { providerKey });
|
|
72
|
-
return await this.connectionsService.reloadConnectionSecrets(providerKey);
|
|
72
|
+
return await this.connectionsService.reloadConnectionSecrets(providerKey, req.user.id);
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
exports.SecretProvidersConnectionsController = SecretProvidersConnectionsController;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-providers-connections.controller.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets.ee/secrets-providers-connections.controller.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAKwB;AACxB,wDAA6C;AAE7C,gDAUyB;AAGzB,uEAAkE;AAClE,yGAAgG;AAEhG,8EAA0E;AAE1E,uDAAsD;AAG/C,IAAM,oCAAoC,GAA1C,MAAM,oCAAoC;IAChD,YACkB,MAA6B,EAC7B,MAAc,EACd,kBAAsD;QAFtD,WAAM,GAAN,MAAM,CAAuB;QAC7B,WAAM,GAAN,MAAM,CAAQ;QACd,uBAAkB,GAAlB,kBAAkB,CAAoC;QAEvE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACtD,CAAC;IAGD,gBAAgB,CAAC,IAAa,EAAE,GAAa,EAAE,IAAkB;QAChE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;YACzE,IAAA,mCAAiB,EAChB,GAAG,EACH,IAAI,gCAAc,CAAC,sDAAsD,CAAC,CAC1E,CAAC;YACF,OAAO;QACR,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACrB,
|
|
1
|
+
{"version":3,"file":"secrets-providers-connections.controller.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets.ee/secrets-providers-connections.controller.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8CAKwB;AACxB,wDAA6C;AAE7C,gDAUyB;AAGzB,uEAAkE;AAClE,yGAAgG;AAEhG,8EAA0E;AAE1E,uDAAsD;AAG/C,IAAM,oCAAoC,GAA1C,MAAM,oCAAoC;IAChD,YACkB,MAA6B,EAC7B,MAAc,EACd,kBAAsD;QAFtD,WAAM,GAAN,MAAM,CAAuB;QAC7B,WAAM,GAAN,MAAM,CAAQ;QACd,uBAAkB,GAAlB,kBAAkB,CAAoC;QAEvE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACtD,CAAC;IAGD,gBAAgB,CAAC,IAAa,EAAE,GAAa,EAAE,IAAkB;QAChE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,0BAA0B,EAAE,CAAC;YAC7C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;YACzE,IAAA,mCAAiB,EAChB,GAAG,EACH,IAAI,gCAAc,CAAC,sDAAsD,CAAC,CAC1E,CAAC;YACF,OAAO;QACR,CAAC;QACD,IAAI,EAAE,CAAC;IACR,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACrB,GAAyB,EACzB,IAAc,EACR,IAAwC;QAE9C,IAAI,CAAC,MAAM,CAAC,KAAK,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A;;qDAAO,8CAAkC;;4EAQ9C;AAIK;IAFL,IAAA,kBAAK,EAAC,eAAe,CAAC;IACtB,IAAA,wBAAW,EAAC,gCAAgC,CAAC;IAI5C,WAAA,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAA;IACpB,WAAA,iBAAI,CAAA;;6DAAO,8CAAkC;;4EAS9C;AAIK;IAFL,IAAA,mBAAM,EAAC,eAAe,CAAC;IACvB,IAAA,wBAAW,EAAC,gCAAgC,CAAC;IAI5C,WAAA,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAA;;;;4EAKrB;AAIK;IAFL,IAAA,gBAAG,EAAC,GAAG,CAAC;IACR,IAAA,wBAAW,EAAC,8BAA8B,CAAC;;;;2EAO3C;AAIK;IAFL,IAAA,gBAAG,EAAC,eAAe,CAAC;IACpB,IAAA,wBAAW,EAAC,8BAA8B,CAAC;IAI1C,WAAA,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAA;;;;yEAKrB;AAIK;IAFL,IAAA,iBAAI,EAAC,oBAAoB,CAAC;IAC1B,IAAA,wBAAW,EAAC,gCAAgC,CAAC;IAI5C,WAAA,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAA;;;;0EAIrB;AAIK;IAFL,IAAA,iBAAI,EAAC,sBAAsB,CAAC;IAC5B,IAAA,wBAAW,EAAC,8BAA8B,CAAC;IAI1C,WAAA,IAAA,kBAAK,EAAC,aAAa,CAAC,CAAA;;;;mFAIrB;+CA5GW,oCAAoC;IADhD,IAAA,2BAAc,EAAC,+BAA+B,CAAC;qCAGrB,+CAAqB;QACrB,uBAAM;QACM,6EAAkC;GAJ5D,oCAAoC,CA6GhD"}
|
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import type { SecretCompletionsResponse } from '@n8n/api-types';
|
|
2
2
|
import { CreateSecretsProviderConnectionDto, TestSecretProviderConnectionResponse, ReloadSecretProviderConnectionResponse } from '@n8n/api-types';
|
|
3
|
+
import { Logger } from '@n8n/backend-common';
|
|
3
4
|
import type { SecretsProviderConnection } from '@n8n/db';
|
|
4
5
|
import { ProjectSecretsProviderAccessRepository, SecretsProviderConnectionRepository } from '@n8n/db';
|
|
5
6
|
import { Cipher } from 'n8n-core';
|
|
6
7
|
import type { IDataObject } from 'n8n-workflow';
|
|
8
|
+
import { EventService } from '../../events/event.service';
|
|
7
9
|
import { ExternalSecretsManager } from '../../modules/external-secrets.ee/external-secrets-manager.ee';
|
|
8
10
|
import { RedactionService } from '../../modules/external-secrets.ee/redaction.service.ee';
|
|
9
11
|
import { SecretsProvidersResponses } from '../../modules/external-secrets.ee/secrets-providers.responses.ee';
|
|
10
12
|
export declare class SecretsProvidersConnectionsService {
|
|
13
|
+
private readonly logger;
|
|
11
14
|
private readonly repository;
|
|
12
15
|
private readonly projectAccessRepository;
|
|
13
16
|
private readonly cipher;
|
|
14
17
|
private readonly externalSecretsManager;
|
|
15
18
|
private readonly redactionService;
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
private readonly eventService;
|
|
20
|
+
constructor(logger: Logger, repository: SecretsProviderConnectionRepository, projectAccessRepository: ProjectSecretsProviderAccessRepository, cipher: Cipher, externalSecretsManager: ExternalSecretsManager, redactionService: RedactionService, eventService: EventService);
|
|
21
|
+
createConnection(proposedConnection: CreateSecretsProviderConnectionDto, userId: string): Promise<SecretsProviderConnection>;
|
|
18
22
|
updateConnection(providerKey: string, updates: {
|
|
19
23
|
type?: string;
|
|
20
24
|
projectIds?: string[];
|
|
21
25
|
settings?: IDataObject;
|
|
22
|
-
}): Promise<SecretsProviderConnection>;
|
|
23
|
-
deleteConnection(providerKey: string): Promise<SecretsProviderConnection>;
|
|
26
|
+
}, userId: string): Promise<SecretsProviderConnection>;
|
|
27
|
+
deleteConnection(providerKey: string, userId: string): Promise<SecretsProviderConnection>;
|
|
24
28
|
getConnection(providerKey: string): Promise<SecretsProviderConnection>;
|
|
25
29
|
listConnections(): Promise<SecretsProviderConnection[]>;
|
|
26
30
|
getGlobalCompletions(): Promise<SecretsProviderConnection[]>;
|
|
@@ -29,8 +33,12 @@ export declare class SecretsProvidersConnectionsService {
|
|
|
29
33
|
toSecretCompletionsResponse(connections: SecretsProviderConnection[]): SecretCompletionsResponse;
|
|
30
34
|
toPublicConnectionListItem(connection: SecretsProviderConnection): SecretsProvidersResponses.ConnectionListItem;
|
|
31
35
|
toPublicConnection(connection: SecretsProviderConnection): SecretsProvidersResponses.Connection;
|
|
32
|
-
testConnection(providerKey: string): Promise<TestSecretProviderConnectionResponse>;
|
|
33
|
-
reloadConnectionSecrets(providerKey: string): Promise<ReloadSecretProviderConnectionResponse>;
|
|
36
|
+
testConnection(providerKey: string, userId: string): Promise<TestSecretProviderConnectionResponse>;
|
|
37
|
+
reloadConnectionSecrets(providerKey: string, userId: string): Promise<ReloadSecretProviderConnectionResponse>;
|
|
38
|
+
private extractProjectInfo;
|
|
39
|
+
reloadProjectConnectionSecrets(projectId: string, userId: string): Promise<ReloadSecretProviderConnectionResponse>;
|
|
34
40
|
private encryptConnectionSettings;
|
|
41
|
+
getConnectionForProject(providerKey: string, projectId: string): Promise<SecretsProviderConnection>;
|
|
42
|
+
deleteConnectionForProject(providerKey: string, projectId: string): Promise<SecretsProviderConnection>;
|
|
35
43
|
private decryptConnectionSettings;
|
|
36
44
|
}
|
|
@@ -11,23 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SecretsProvidersConnectionsService = void 0;
|
|
13
13
|
const api_types_1 = require("@n8n/api-types");
|
|
14
|
+
const backend_common_1 = require("@n8n/backend-common");
|
|
14
15
|
const db_1 = require("@n8n/db");
|
|
15
16
|
const di_1 = require("@n8n/di");
|
|
16
17
|
const n8n_core_1 = require("n8n-core");
|
|
17
18
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
18
19
|
const bad_request_error_1 = require("../../errors/response-errors/bad-request.error");
|
|
19
20
|
const not_found_error_1 = require("../../errors/response-errors/not-found.error");
|
|
21
|
+
const event_service_1 = require("../../events/event.service");
|
|
20
22
|
const external_secrets_manager_ee_1 = require("../../modules/external-secrets.ee/external-secrets-manager.ee");
|
|
21
23
|
const redaction_service_ee_1 = require("../../modules/external-secrets.ee/redaction.service.ee");
|
|
22
24
|
let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsService {
|
|
23
|
-
constructor(repository, projectAccessRepository, cipher, externalSecretsManager, redactionService) {
|
|
25
|
+
constructor(logger, repository, projectAccessRepository, cipher, externalSecretsManager, redactionService, eventService) {
|
|
26
|
+
this.logger = logger;
|
|
24
27
|
this.repository = repository;
|
|
25
28
|
this.projectAccessRepository = projectAccessRepository;
|
|
26
29
|
this.cipher = cipher;
|
|
27
30
|
this.externalSecretsManager = externalSecretsManager;
|
|
28
31
|
this.redactionService = redactionService;
|
|
32
|
+
this.eventService = eventService;
|
|
33
|
+
this.logger = this.logger.scoped('external-secrets');
|
|
29
34
|
}
|
|
30
|
-
async createConnection(proposedConnection) {
|
|
35
|
+
async createConnection(proposedConnection, userId) {
|
|
31
36
|
const existing = await this.repository.findOne({
|
|
32
37
|
where: { providerKey: proposedConnection.providerKey },
|
|
33
38
|
});
|
|
@@ -48,11 +53,19 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
48
53
|
}));
|
|
49
54
|
await this.projectAccessRepository.save(entries);
|
|
50
55
|
}
|
|
51
|
-
|
|
56
|
+
const result = (await this.repository.findOne({
|
|
52
57
|
where: { providerKey: proposedConnection.providerKey },
|
|
53
58
|
}));
|
|
59
|
+
await this.externalSecretsManager.syncProviderConnection(proposedConnection.providerKey);
|
|
60
|
+
this.eventService.emit('external-secrets-connection-created', {
|
|
61
|
+
userId,
|
|
62
|
+
providerKey: result.providerKey,
|
|
63
|
+
vaultType: result.type,
|
|
64
|
+
...this.extractProjectInfo(result),
|
|
65
|
+
});
|
|
66
|
+
return result;
|
|
54
67
|
}
|
|
55
|
-
async updateConnection(providerKey, updates) {
|
|
68
|
+
async updateConnection(providerKey, updates, userId) {
|
|
56
69
|
const connection = await this.repository.findOne({ where: { providerKey } });
|
|
57
70
|
if (!connection) {
|
|
58
71
|
throw new not_found_error_1.NotFoundError(`Connection with key "${providerKey}" not found`);
|
|
@@ -72,15 +85,33 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
72
85
|
if (updates.projectIds !== undefined) {
|
|
73
86
|
await this.projectAccessRepository.setProjectAccess(connection.id, updates.projectIds);
|
|
74
87
|
}
|
|
75
|
-
|
|
88
|
+
await this.externalSecretsManager.syncProviderConnection(providerKey);
|
|
89
|
+
const result = (await this.repository.findOne({
|
|
90
|
+
where: { providerKey },
|
|
91
|
+
}));
|
|
92
|
+
this.eventService.emit('external-secrets-connection-updated', {
|
|
93
|
+
userId,
|
|
94
|
+
providerKey: result.providerKey,
|
|
95
|
+
vaultType: result.type,
|
|
96
|
+
...this.extractProjectInfo(result),
|
|
97
|
+
});
|
|
98
|
+
return result;
|
|
76
99
|
}
|
|
77
|
-
async deleteConnection(providerKey) {
|
|
100
|
+
async deleteConnection(providerKey, userId) {
|
|
78
101
|
const connection = await this.repository.findOne({ where: { providerKey } });
|
|
79
102
|
if (!connection) {
|
|
80
103
|
throw new not_found_error_1.NotFoundError(`Connection with key "${providerKey}" not found`);
|
|
81
104
|
}
|
|
105
|
+
const projectInfo = this.extractProjectInfo(connection);
|
|
82
106
|
await this.projectAccessRepository.deleteByConnectionId(connection.id);
|
|
83
107
|
await this.repository.remove(connection);
|
|
108
|
+
await this.externalSecretsManager.syncProviderConnection(providerKey);
|
|
109
|
+
this.eventService.emit('external-secrets-connection-deleted', {
|
|
110
|
+
userId,
|
|
111
|
+
providerKey: connection.providerKey,
|
|
112
|
+
vaultType: connection.type,
|
|
113
|
+
...projectInfo,
|
|
114
|
+
});
|
|
84
115
|
return connection;
|
|
85
116
|
}
|
|
86
117
|
async getConnection(providerKey) {
|
|
@@ -109,10 +140,12 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
109
140
|
]));
|
|
110
141
|
}
|
|
111
142
|
toPublicConnectionListItem(connection) {
|
|
143
|
+
const secretNames = this.externalSecretsManager.getSecretNames(connection.providerKey);
|
|
112
144
|
return {
|
|
113
145
|
id: String(connection.id),
|
|
114
146
|
name: connection.providerKey,
|
|
115
147
|
type: connection.type,
|
|
148
|
+
secretsCount: secretNames.length,
|
|
116
149
|
projects: connection.projectAccess.map((access) => ({
|
|
117
150
|
id: access.project.id,
|
|
118
151
|
name: access.project.name,
|
|
@@ -125,10 +158,13 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
125
158
|
const decryptedSettings = this.decryptConnectionSettings(connection.encryptedSettings);
|
|
126
159
|
const { provider } = this.externalSecretsManager.getProviderWithSettings(connection.type);
|
|
127
160
|
const redactedSettings = this.redactionService.redact(decryptedSettings, provider.properties);
|
|
161
|
+
const secretNames = this.externalSecretsManager.getSecretNames(connection.providerKey);
|
|
128
162
|
return {
|
|
129
163
|
id: String(connection.id),
|
|
130
164
|
name: connection.providerKey,
|
|
131
165
|
type: connection.type,
|
|
166
|
+
secretsCount: secretNames.length,
|
|
167
|
+
secrets: secretNames.map((name) => ({ name })),
|
|
132
168
|
projects: connection.projectAccess.map((access) => ({
|
|
133
169
|
id: access.project.id,
|
|
134
170
|
name: access.project.name,
|
|
@@ -138,20 +174,96 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
138
174
|
updatedAt: connection.updatedAt.toISOString(),
|
|
139
175
|
};
|
|
140
176
|
}
|
|
141
|
-
async testConnection(providerKey) {
|
|
177
|
+
async testConnection(providerKey, userId) {
|
|
142
178
|
const connection = await this.getConnection(providerKey);
|
|
143
179
|
const decryptedSettings = this.decryptConnectionSettings(connection.encryptedSettings);
|
|
144
180
|
const result = await this.externalSecretsManager.testProviderSettings(connection.type, decryptedSettings);
|
|
145
|
-
|
|
181
|
+
const response = api_types_1.testSecretProviderConnectionResponseSchema.parse(result);
|
|
182
|
+
this.eventService.emit('external-secrets-connection-tested', {
|
|
183
|
+
userId,
|
|
184
|
+
providerKey: connection.providerKey,
|
|
185
|
+
vaultType: connection.type,
|
|
186
|
+
...this.extractProjectInfo(connection),
|
|
187
|
+
isValid: response.success,
|
|
188
|
+
...(response.error && { errorMessage: response.error }),
|
|
189
|
+
});
|
|
190
|
+
return response;
|
|
191
|
+
}
|
|
192
|
+
async reloadConnectionSecrets(providerKey, userId) {
|
|
193
|
+
try {
|
|
194
|
+
const connection = await this.getConnection(providerKey);
|
|
195
|
+
await this.externalSecretsManager.updateProvider(providerKey);
|
|
196
|
+
this.eventService.emit('external-secrets-connection-reloaded', {
|
|
197
|
+
userId,
|
|
198
|
+
providerKey: connection.providerKey,
|
|
199
|
+
vaultType: connection.type,
|
|
200
|
+
...this.extractProjectInfo(connection),
|
|
201
|
+
});
|
|
202
|
+
return api_types_1.reloadSecretProviderConnectionResponseSchema.parse({ success: true });
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
if (error instanceof not_found_error_1.NotFoundError) {
|
|
206
|
+
throw error;
|
|
207
|
+
}
|
|
208
|
+
this.logger.warn(`Failed to reload provider ${providerKey}`, { providerKey });
|
|
209
|
+
return api_types_1.reloadSecretProviderConnectionResponseSchema.parse({ success: false });
|
|
210
|
+
}
|
|
146
211
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
212
|
+
extractProjectInfo(connection) {
|
|
213
|
+
return {
|
|
214
|
+
projects: connection.projectAccess.map((access) => ({
|
|
215
|
+
id: access.project.id,
|
|
216
|
+
name: access.project.name,
|
|
217
|
+
})),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
async reloadProjectConnectionSecrets(projectId, userId) {
|
|
221
|
+
const projectConnections = await this.repository.findByProjectId(projectId);
|
|
222
|
+
const providers = {};
|
|
223
|
+
await Promise.allSettled(projectConnections.map(async (c) => {
|
|
224
|
+
try {
|
|
225
|
+
await this.externalSecretsManager.updateProvider(c.providerKey);
|
|
226
|
+
providers[c.providerKey] = { success: true };
|
|
227
|
+
this.eventService.emit('external-secrets-connection-reloaded', {
|
|
228
|
+
userId,
|
|
229
|
+
providerKey: c.providerKey,
|
|
230
|
+
vaultType: c.type,
|
|
231
|
+
...this.extractProjectInfo(c),
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
catch (error) {
|
|
235
|
+
providers[c.providerKey] = { success: false };
|
|
236
|
+
this.logger.warn(`Failed to reload provider ${c.providerKey}`, {
|
|
237
|
+
projectId,
|
|
238
|
+
providerKey: c.providerKey,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}));
|
|
242
|
+
const allSucceeded = Object.values(providers).every((p) => p.success);
|
|
243
|
+
return api_types_1.reloadSecretProviderConnectionResponseSchema.parse({
|
|
244
|
+
success: allSucceeded,
|
|
245
|
+
providers,
|
|
246
|
+
});
|
|
151
247
|
}
|
|
152
248
|
encryptConnectionSettings(settings) {
|
|
153
249
|
return this.cipher.encrypt(settings);
|
|
154
250
|
}
|
|
251
|
+
async getConnectionForProject(providerKey, projectId) {
|
|
252
|
+
const connection = await this.repository.findByProviderKeyAndProjectId(providerKey, projectId);
|
|
253
|
+
if (!connection) {
|
|
254
|
+
throw new not_found_error_1.NotFoundError(`Connection with key "${providerKey}" not found`);
|
|
255
|
+
}
|
|
256
|
+
return connection;
|
|
257
|
+
}
|
|
258
|
+
async deleteConnectionForProject(providerKey, projectId) {
|
|
259
|
+
const connection = await this.repository.removeByProviderKeyAndProjectId(providerKey, projectId);
|
|
260
|
+
if (!connection) {
|
|
261
|
+
throw new not_found_error_1.NotFoundError(`Connection with key "${providerKey}" not found`);
|
|
262
|
+
}
|
|
263
|
+
await this.projectAccessRepository.deleteByConnectionId(connection.id);
|
|
264
|
+
await this.externalSecretsManager.syncProviderConnection(providerKey);
|
|
265
|
+
return connection;
|
|
266
|
+
}
|
|
155
267
|
decryptConnectionSettings(encryptedSettings) {
|
|
156
268
|
return (0, n8n_workflow_1.jsonParse)(this.cipher.decrypt(encryptedSettings));
|
|
157
269
|
}
|
|
@@ -159,10 +271,12 @@ let SecretsProvidersConnectionsService = class SecretsProvidersConnectionsServic
|
|
|
159
271
|
exports.SecretsProvidersConnectionsService = SecretsProvidersConnectionsService;
|
|
160
272
|
exports.SecretsProvidersConnectionsService = SecretsProvidersConnectionsService = __decorate([
|
|
161
273
|
(0, di_1.Service)(),
|
|
162
|
-
__metadata("design:paramtypes", [
|
|
274
|
+
__metadata("design:paramtypes", [backend_common_1.Logger,
|
|
275
|
+
db_1.SecretsProviderConnectionRepository,
|
|
163
276
|
db_1.ProjectSecretsProviderAccessRepository,
|
|
164
277
|
n8n_core_1.Cipher,
|
|
165
278
|
external_secrets_manager_ee_1.ExternalSecretsManager,
|
|
166
|
-
redaction_service_ee_1.RedactionService
|
|
279
|
+
redaction_service_ee_1.RedactionService,
|
|
280
|
+
event_service_1.EventService])
|
|
167
281
|
], SecretsProvidersConnectionsService);
|
|
168
282
|
//# sourceMappingURL=secrets-providers-connections.service.ee.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-providers-connections.service.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets.ee/secrets-providers-connections.service.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8CAMwB;
|
|
1
|
+
{"version":3,"file":"secrets-providers-connections.service.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets.ee/secrets-providers-connections.service.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,8CAMwB;AACxB,wDAA6C;AAE7C,gCAGiB;AACjB,gCAAkC;AAClC,uCAAkC;AAGlC,+CAAyC;AACzC,kFAA6E;AAC7E,8EAAyE;AACzE,0DAAsD;AAEtD,2GAAmG;AACnG,6FAAsF;AAI/E,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC9C,YACkB,MAAc,EACd,UAA+C,EAC/C,uBAA+D,EAC/D,MAAc,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A,YAAO,GAAE;qCAGiB,uBAAM;QACF,wCAAmC;QACtB,2CAAsC;QACvD,iBAAM;QACU,oDAAsB;QAC5B,uCAAgB;QACpB,4BAAY;GARhC,kCAAkC,CA6V9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CreateSecretsProviderConnectionDto, UpdateSecretsProviderConnectionDto, type ReloadSecretProviderConnectionResponse, type TestSecretProviderConnectionResponse } from '@n8n/api-types';
|
|
1
2
|
import { Logger } from '@n8n/backend-common';
|
|
2
3
|
import type { AuthenticatedRequest } from '@n8n/db';
|
|
3
4
|
import type { NextFunction, Request, Response } from 'express';
|
|
@@ -10,5 +11,11 @@ export declare class SecretProvidersProjectController {
|
|
|
10
11
|
private readonly connectionsService;
|
|
11
12
|
constructor(config: ExternalSecretsConfig, logger: Logger, connectionsService: SecretsProvidersConnectionsService);
|
|
12
13
|
checkFeatureFlag(_req: Request, res: Response, next: NextFunction): void;
|
|
13
|
-
|
|
14
|
+
createConnection(req: AuthenticatedRequest, _res: Response, projectId: string, body: CreateSecretsProviderConnectionDto): Promise<SecretsProvidersResponses.PublicConnection>;
|
|
15
|
+
listConnectionsForAProject(_req: AuthenticatedRequest, _res: Response, projectId: string): Promise<SecretsProvidersResponses.ConnectionListItem[]>;
|
|
16
|
+
getConnection(_req: AuthenticatedRequest, _res: Response, projectId: string, providerKey: string): Promise<SecretsProvidersResponses.PublicConnection>;
|
|
17
|
+
updateConnection(req: AuthenticatedRequest, _res: Response, projectId: string, providerKey: string, body: UpdateSecretsProviderConnectionDto): Promise<SecretsProvidersResponses.PublicConnection>;
|
|
18
|
+
deleteConnection(_req: AuthenticatedRequest, _res: Response, projectId: string, providerKey: string): Promise<SecretsProvidersResponses.PublicConnection>;
|
|
19
|
+
testConnection(req: AuthenticatedRequest, _res: Response, projectId: string, providerKey: string): Promise<TestSecretProviderConnectionResponse>;
|
|
20
|
+
reloadConnectionSecrets(req: AuthenticatedRequest, _res: Response, projectId: string): Promise<ReloadSecretProviderConnectionResponse>;
|
|
14
21
|
}
|
|
@@ -13,6 +13,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SecretProvidersProjectController = void 0;
|
|
16
|
+
const api_types_1 = require("@n8n/api-types");
|
|
16
17
|
const backend_common_1 = require("@n8n/backend-common");
|
|
17
18
|
const decorators_1 = require("@n8n/decorators");
|
|
18
19
|
const external_secrets_config_1 = require("./external-secrets.config");
|
|
@@ -34,10 +35,47 @@ let SecretProvidersProjectController = class SecretProvidersProjectController {
|
|
|
34
35
|
}
|
|
35
36
|
next();
|
|
36
37
|
}
|
|
38
|
+
async createConnection(req, _res, projectId, body) {
|
|
39
|
+
this.logger.debug('Creating connection for project', {
|
|
40
|
+
projectId,
|
|
41
|
+
providerKey: body.providerKey,
|
|
42
|
+
});
|
|
43
|
+
const savedConnection = await this.connectionsService.createConnection({
|
|
44
|
+
...body,
|
|
45
|
+
projectIds: [projectId],
|
|
46
|
+
}, req.user.id);
|
|
47
|
+
return this.connectionsService.toPublicConnection(savedConnection);
|
|
48
|
+
}
|
|
37
49
|
async listConnectionsForAProject(_req, _res, projectId) {
|
|
38
50
|
this.logger.debug('List all connections within a project', { projectId });
|
|
39
51
|
const connections = await this.connectionsService.listConnectionsForProject(projectId);
|
|
40
|
-
return connections.map((c) => this.connectionsService.
|
|
52
|
+
return connections.map((c) => this.connectionsService.toPublicConnectionListItem(c));
|
|
53
|
+
}
|
|
54
|
+
async getConnection(_req, _res, projectId, providerKey) {
|
|
55
|
+
this.logger.debug('Getting connection for project', { projectId, providerKey });
|
|
56
|
+
const connection = await this.connectionsService.getConnectionForProject(providerKey, projectId);
|
|
57
|
+
return this.connectionsService.toPublicConnection(connection);
|
|
58
|
+
}
|
|
59
|
+
async updateConnection(req, _res, projectId, providerKey, body) {
|
|
60
|
+
this.logger.debug('Updating connection for project', { projectId, providerKey });
|
|
61
|
+
await this.connectionsService.getConnectionForProject(providerKey, projectId);
|
|
62
|
+
const { projectIds: _, ...updates } = body;
|
|
63
|
+
const connection = await this.connectionsService.updateConnection(providerKey, updates, req.user.id);
|
|
64
|
+
return this.connectionsService.toPublicConnection(connection);
|
|
65
|
+
}
|
|
66
|
+
async deleteConnection(_req, _res, projectId, providerKey) {
|
|
67
|
+
this.logger.debug('Deleting connection for project', { projectId, providerKey });
|
|
68
|
+
const connection = await this.connectionsService.deleteConnectionForProject(providerKey, projectId);
|
|
69
|
+
return this.connectionsService.toPublicConnection(connection);
|
|
70
|
+
}
|
|
71
|
+
async testConnection(req, _res, projectId, providerKey) {
|
|
72
|
+
this.logger.debug('Testing connection for project', { projectId, providerKey });
|
|
73
|
+
await this.connectionsService.getConnectionForProject(providerKey, projectId);
|
|
74
|
+
return await this.connectionsService.testConnection(providerKey, req.user.id);
|
|
75
|
+
}
|
|
76
|
+
async reloadConnectionSecrets(req, _res, projectId) {
|
|
77
|
+
this.logger.debug('Reloading all secrets for project', { projectId });
|
|
78
|
+
return await this.connectionsService.reloadProjectConnectionSecrets(projectId, req.user.id);
|
|
41
79
|
}
|
|
42
80
|
};
|
|
43
81
|
exports.SecretProvidersProjectController = SecretProvidersProjectController;
|
|
@@ -47,6 +85,15 @@ __decorate([
|
|
|
47
85
|
__metadata("design:paramtypes", [Object, Object, Function]),
|
|
48
86
|
__metadata("design:returntype", void 0)
|
|
49
87
|
], SecretProvidersProjectController.prototype, "checkFeatureFlag", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, decorators_1.Post)('/:projectId/connections'),
|
|
90
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:create'),
|
|
91
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
92
|
+
__param(3, decorators_1.Body),
|
|
93
|
+
__metadata("design:type", Function),
|
|
94
|
+
__metadata("design:paramtypes", [Object, Object, String, api_types_1.CreateSecretsProviderConnectionDto]),
|
|
95
|
+
__metadata("design:returntype", Promise)
|
|
96
|
+
], SecretProvidersProjectController.prototype, "createConnection", null);
|
|
50
97
|
__decorate([
|
|
51
98
|
(0, decorators_1.Get)('/:projectId/connections'),
|
|
52
99
|
(0, decorators_1.ProjectScope)('externalSecretsProvider:list'),
|
|
@@ -55,6 +102,51 @@ __decorate([
|
|
|
55
102
|
__metadata("design:paramtypes", [Object, Object, String]),
|
|
56
103
|
__metadata("design:returntype", Promise)
|
|
57
104
|
], SecretProvidersProjectController.prototype, "listConnectionsForAProject", null);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, decorators_1.Get)('/:projectId/connections/:providerKey'),
|
|
107
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:read'),
|
|
108
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
109
|
+
__param(3, (0, decorators_1.Param)('providerKey')),
|
|
110
|
+
__metadata("design:type", Function),
|
|
111
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
112
|
+
__metadata("design:returntype", Promise)
|
|
113
|
+
], SecretProvidersProjectController.prototype, "getConnection", null);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, decorators_1.Patch)('/:projectId/connections/:providerKey'),
|
|
116
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:update'),
|
|
117
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
118
|
+
__param(3, (0, decorators_1.Param)('providerKey')),
|
|
119
|
+
__param(4, decorators_1.Body),
|
|
120
|
+
__metadata("design:type", Function),
|
|
121
|
+
__metadata("design:paramtypes", [Object, Object, String, String, api_types_1.UpdateSecretsProviderConnectionDto]),
|
|
122
|
+
__metadata("design:returntype", Promise)
|
|
123
|
+
], SecretProvidersProjectController.prototype, "updateConnection", null);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, decorators_1.Delete)('/:projectId/connections/:providerKey'),
|
|
126
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:delete'),
|
|
127
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
128
|
+
__param(3, (0, decorators_1.Param)('providerKey')),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
131
|
+
__metadata("design:returntype", Promise)
|
|
132
|
+
], SecretProvidersProjectController.prototype, "deleteConnection", null);
|
|
133
|
+
__decorate([
|
|
134
|
+
(0, decorators_1.Post)('/:projectId/connections/:providerKey/test'),
|
|
135
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:update'),
|
|
136
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
137
|
+
__param(3, (0, decorators_1.Param)('providerKey')),
|
|
138
|
+
__metadata("design:type", Function),
|
|
139
|
+
__metadata("design:paramtypes", [Object, Object, String, String]),
|
|
140
|
+
__metadata("design:returntype", Promise)
|
|
141
|
+
], SecretProvidersProjectController.prototype, "testConnection", null);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, decorators_1.Post)('/:projectId/reload'),
|
|
144
|
+
(0, decorators_1.ProjectScope)('externalSecretsProvider:sync'),
|
|
145
|
+
__param(2, (0, decorators_1.Param)('projectId')),
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", [Object, Object, String]),
|
|
148
|
+
__metadata("design:returntype", Promise)
|
|
149
|
+
], SecretProvidersProjectController.prototype, "reloadConnectionSecrets", null);
|
|
58
150
|
exports.SecretProvidersProjectController = SecretProvidersProjectController = __decorate([
|
|
59
151
|
(0, decorators_1.RestController)('/secret-providers/projects'),
|
|
60
152
|
__metadata("design:paramtypes", [external_secrets_config_1.ExternalSecretsConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets-providers-project.controller.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets.ee/secrets-providers-project.controller.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAA6C;AAE7C,
|
|
1
|
+
{"version":3,"file":"secrets-providers-project.controller.ee.js","sourceRoot":"","sources":["../../../src/modules/external-secrets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;IAI3C,WAAA,IAAA,kBAAK,EAAC,WAAW,CAAC,CAAA;;;;+EAInB;2CAlIW,gCAAgC;IAD5C,IAAA,2BAAc,EAAC,4BAA4B,CAAC;qCAGlB,+CAAqB;QACrB,uBAAM;QACM,6EAAkC;GAJ5D,gCAAgC,CAmI5C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SecretProviderConnection } from '@n8n/api-types';
|
|
2
2
|
export declare namespace SecretsProvidersResponses {
|
|
3
|
-
type ConnectionListItem = Omit<SecretProviderConnection, 'settings' | '
|
|
4
|
-
type Connection = Omit<SecretProviderConnection, '
|
|
3
|
+
type ConnectionListItem = Omit<SecretProviderConnection, 'settings' | 'state' | 'isEnabled' | 'secrets'>;
|
|
4
|
+
type Connection = Omit<SecretProviderConnection, 'state' | 'isEnabled'>;
|
|
5
5
|
type StrippedConnection = ConnectionListItem;
|
|
6
6
|
type PublicConnection = Promise<Connection>;
|
|
7
7
|
type PublicConnectionList = Promise<ConnectionListItem[]>;
|
|
@@ -28,6 +28,8 @@ let McpEventRelay = class McpEventRelay extends event_relay_1.EventRelay {
|
|
|
28
28
|
}
|
|
29
29
|
async onWorkflowDeactivated(event) {
|
|
30
30
|
const { workflow, workflowId } = event;
|
|
31
|
+
if (workflow.activeVersionId !== null)
|
|
32
|
+
return;
|
|
31
33
|
if (workflow.settings?.availableInMCP === true) {
|
|
32
34
|
try {
|
|
33
35
|
const updatedSettings = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.event-relay.js","sourceRoot":"","sources":["../../../src/modules/mcp/mcp.event-relay.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wDAA6C;AAC7C,gCAA6C;AAC7C,gCAAkC;AAElC,0DAAsD;AACtD,6DAAyD;AAOlD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,wBAAU;IAC5C,YACC,YAA0B,EACT,kBAAsC,EACtC,MAAc;QAE/B,KAAK,CAAC,YAAY,CAAC,CAA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AAE;oBAChD,QAAQ,EAAE,eAAe;iBACzB,CAAC,CAAC;gBAEH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,8CAA8C,EAAE;oBAChE,UAAU;oBACV,YAAY,EAAE,QAAQ,CAAC,IAAI;iBAC3B,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uDAAuD,EAAE;oBAC1E,UAAU;oBACV,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC7D,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;CACD,CAAA;AAvDY,sCAAa;wBAAb,aAAa;IADzB,IAAA,YAAO,GAAE;qCAGM,4BAAY;QACW,uBAAkB;QAC9B,uBAAM;GAJpB,aAAa,CAuDzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { User } from '@n8n/db';
|
|
2
|
+
import type { ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
3
|
+
import type { QuickConnectBackendOption } from '../quick-connect.config';
|
|
4
|
+
import type { IQuickConnectHandler } from './quick-connect.handler';
|
|
5
|
+
export declare class FirecrawlHandler implements IQuickConnectHandler {
|
|
6
|
+
readonly credentialType = "firecrawlApi";
|
|
7
|
+
getCredentialData(config: QuickConnectBackendOption, user: User): Promise<ICredentialDataDecryptedObject>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FirecrawlHandler = void 0;
|
|
13
|
+
const di_1 = require("@n8n/di");
|
|
14
|
+
const axios_1 = __importDefault(require("axios"));
|
|
15
|
+
const FIRECRAWL_API_BASE_URL = 'https://api.firecrawl.dev';
|
|
16
|
+
let FirecrawlHandler = class FirecrawlHandler {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.credentialType = 'firecrawlApi';
|
|
19
|
+
}
|
|
20
|
+
async getCredentialData(config, user) {
|
|
21
|
+
const secret = config.backendFlowConfig.secret;
|
|
22
|
+
const response = await axios_1.default.post(`${FIRECRAWL_API_BASE_URL}/admin/integration/create-user`, { email: user.email }, {
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${secret}`,
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
apiKey: response.data.apiKey,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.FirecrawlHandler = FirecrawlHandler;
|
|
34
|
+
exports.FirecrawlHandler = FirecrawlHandler = __decorate([
|
|
35
|
+
(0, di_1.Service)()
|
|
36
|
+
], FirecrawlHandler);
|
|
37
|
+
//# sourceMappingURL=firecrawl.handler.js.map
|