From d3fe3dea32207dfdb2a43db0def96466a31daa66 Mon Sep 17 00:00:00 2001 From: AdinaTotorean <64439268+adina-hub@users.noreply.github.com> Date: Wed, 26 Feb 2025 18:37:09 +0200 Subject: [PATCH] feat(n8n Vertica credentials only Node): New node (#12256) --- .../credentials/VerticaApi.credentials.ts | 88 +++++++++++++++++++ packages/nodes-base/package.json | 1 + 2 files changed, 89 insertions(+) create mode 100644 packages/nodes-base/credentials/VerticaApi.credentials.ts diff --git a/packages/nodes-base/credentials/VerticaApi.credentials.ts b/packages/nodes-base/credentials/VerticaApi.credentials.ts new file mode 100644 index 0000000000..38e5a516e6 --- /dev/null +++ b/packages/nodes-base/credentials/VerticaApi.credentials.ts @@ -0,0 +1,88 @@ +import type { + IAuthenticateGeneric, + ICredentialTestRequest, + ICredentialType, + INodeProperties, +} from 'n8n-workflow'; + +export class VerticaApi implements ICredentialType { + name = 'verticaApi'; + + displayName = 'Vertica API'; + + documentationUrl = 'vertica'; + + httpRequestNode = { + name: 'Vertica', + docsUrl: 'vertica', + apiBaseUrlPlaceholder: 'http://:/v1/', + }; + + properties: INodeProperties[] = [ + { + displayName: 'URL', + name: 'url', + required: true, + type: 'string', + default: 'https://localhost:8443', + placeholder: 'https://:', + }, + { + displayName: 'Username', + name: 'username', + type: 'string', + default: '', + description: 'The username for accessing the Vertica database.', + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + typeOptions: { password: true }, + default: '', + description: 'The password for accessing the Vertica database.', + }, + ]; + + authenticate: IAuthenticateGeneric = { + type: 'generic', + properties: { + auth: { + username: '={{$credentials.username}}', + password: '={{$credentials.password}}', + }, + }, + }; + + test: ICredentialTestRequest = { + request: { + baseURL: '={{$credentials.url}}'.replace(/\/$/, ''), + url: '/v1/health', + method: 'GET', + skipSslCertificateValidation: true, + }, + rules: [ + { + type: 'responseCode', + properties: { + value: 403, + message: 'Connection failed: Invalid credentials or insufficient permissions', + }, + }, + { + type: 'responseCode', + properties: { + value: 503, + message: 'Service unavailable: Server is overloaded or under maintenance', + }, + }, + { + type: 'responseCode', + properties: { + value: 504, + message: 'Gateway timeout: Upstream server took too long to respond', + }, + }, + ], + }; +} diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 06f9a1c434..fad1697e80 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -370,6 +370,7 @@ "dist/credentials/UptimeRobotApi.credentials.js", "dist/credentials/UrlScanIoApi.credentials.js", "dist/credentials/VeroApi.credentials.js", + "dist/credentials/VerticaApi.credentials.js", "dist/credentials/VirusTotalApi.credentials.js", "dist/credentials/VonageApi.credentials.js", "dist/credentials/VenafiTlsProtectCloudApi.credentials.js",