n8n/packages/nodes-base/credentials/AlienVaultApi.credentials.ts
Elias Meire 600013a1ab
feat: Add support for dark mode node icons and colors (#9412)
Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
2024-06-06 13:34:30 +02:00

51 lines
945 B
TypeScript

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
Icon,
} from 'n8n-workflow';
export class AlienVaultApi implements ICredentialType {
name = 'alienVaultApi';
displayName = 'AlienVault API';
documentationUrl = 'alienvault';
icon: Icon = 'file:icons/AlienVault.png';
httpRequestNode = {
name: 'AlienVault',
docsUrl: 'https://otx.alienvault.com/api',
apiBaseUrl: 'https://otx.alienvault.com/api/v1/',
};
properties: INodeProperties[] = [
{
displayName: 'OTX Key',
name: 'accessToken',
type: 'string',
typeOptions: { password: true },
required: true,
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-OTX-API-KEY': '={{$credentials.accessToken}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://otx.alienvault.com',
url: '/api/v1/user/me',
},
};
}