Files
n8n-nodes-wizpixel-flow/credentials/WizPixelFlowApi.credentials.ts

48 lines
1.0 KiB
TypeScript

import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class WizPixelFlowApi implements ICredentialType {
name = 'wizPixelFlowApi';
displayName = 'WizPixel Flow API';
documentationUrl = 'https://flow.wizpixel.com/docs/api';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
required: true,
description: 'Your WizPixel Flow API key. Generate one in your account settings.',
},
{
displayName: 'API Base URL',
name: 'baseUrl',
type: 'string',
default: 'https://api.wizpixel.com/v1',
required: true,
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-WPF-API-Key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/account',
},
};
}