n8n/packages/nodes-base/credentials/ClockifyApi.credentials.ts
agobrech 447d19024c
feat(Clockify Node): Add more resources and improvements (#3411)
*  Add more Clockify resources

* Moved headers in credentials file and added testing

* add address to additional fields

* Add pagination to workflow

* 🎨 Rename additional fields to filter

* Remove non-required fields to additional fields

* 🔥 Remove loading of client id

*  Improvements

*  Small change

Co-authored-by: pemontto <pemontto@gmail.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
2022-06-29 09:04:36 +02:00

36 lines
663 B
TypeScript

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',
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-Api-Key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.clockify.me/api/v1',
url: '/workspaces',
},
};
}