n8n/packages/nodes-base/credentials/ClockifyApi.credentials.ts

41 lines
703 B
TypeScript
Raw Normal View History

import {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class ClockifyApi implements ICredentialType {
name = 'clockifyApi';
displayName = 'Clockify API';
documentationUrl = 'clockify';
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-Api-Key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.clockify.me/api/v1',
url: '/workspaces',
},
};
}