N8N-4126 credentials injection and testing on specific nodes (#3816)

* Add credential injection and testing to Lemlist, Uproc, Supabase, Segment, Phantombuster, Mailgun and Dropcontact
This commit is contained in:
agobrech
2022-08-24 10:26:48 +02:00
committed by GitHub
parent 5285fc1de6
commit 76f9ad8bae
15 changed files with 167 additions and 114 deletions

View File

@@ -12,7 +12,7 @@ import {
NodeApiError,
} from 'n8n-workflow';
import { dropcontactApiRequest, validateCredentials } from './GenericFunction';
import { dropcontactApiRequest } from './GenericFunction';
export class Dropcontact implements INodeType {
description: INodeTypeDescription = {
@@ -32,7 +32,6 @@ export class Dropcontact implements INodeType {
{
name: 'dropcontactApi',
required: true,
testedBy: 'dropcontactApiCredentialTest',
},
],
properties: [
@@ -244,30 +243,6 @@ export class Dropcontact implements INodeType {
},
],
};
methods = {
credentialTest: {
async dropcontactApiCredentialTest(
this: ICredentialTestFunctions,
credential: ICredentialsDecrypted,
): Promise<INodeCredentialTestResult> {
try {
await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject);
} catch (error) {
return {
status: 'Error',
message: 'The API Key included in the request is invalid',
};
}
return {
status: 'OK',
message: 'Connection successful!',
};
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const entryData = this.getInputData();
const resource = this.getNodeParameter('resource', 0) as string;