n8n/packages/nodes-base/credentials/FilescanApi.credentials.ts
Bram Kn 26f1af397b
feat: Add new credentials for the HTTP Request node (#9833)
Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
2024-08-23 18:19:05 +01:00

51 lines
1,013 B
TypeScript

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class FilescanApi implements ICredentialType {
name = 'filescanApi';
displayName = 'Filescan API';
documentationUrl = 'filescan';
icon = { light: 'file:icons/Filescan.svg', dark: 'file:icons/Filescan.svg' } as const;
httpRequestNode = {
name: 'Filescan',
docsUrl: 'https://www.filescan.io/api/docs',
apiBaseUrlPlaceholder: 'https://www.filescan.io/api/system/do-healthcheck',
};
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-Api-Key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://www.filescan.io/api',
url: '/system/do-healthcheck',
method: 'GET',
},
};
}