2023-01-27 14:22:44 +03:00
|
|
|
import type {
|
2022-06-29 10:04:36 +03:00
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
2020-02-04 01:11:35 +03:00
|
|
|
ICredentialType,
|
2021-06-12 19:39:55 +03:00
|
|
|
INodeProperties,
|
2020-02-04 01:11:35 +03:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class ClockifyApi implements ICredentialType {
|
|
|
|
name = 'clockifyApi';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2020-02-04 01:11:35 +03:00
|
|
|
displayName = 'Clockify API';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2020-08-17 15:42:09 +03:00
|
|
|
documentationUrl = 'clockify';
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2021-06-12 19:39:55 +03:00
|
|
|
properties: INodeProperties[] = [
|
2020-02-04 01:11:35 +03:00
|
|
|
{
|
|
|
|
displayName: 'API Key',
|
|
|
|
name: 'apiKey',
|
2021-06-12 19:39:55 +03:00
|
|
|
type: 'string',
|
2022-11-01 19:41:45 +03:00
|
|
|
typeOptions: { password: true },
|
2020-02-04 01:11:35 +03:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2022-06-29 10:04:36 +03:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'X-Api-Key': '={{$credentials.apiKey}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-12-02 23:54:28 +03:00
|
|
|
|
2022-06-29 10:04:36 +03:00
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.clockify.me/api/v1',
|
|
|
|
url: '/workspaces',
|
|
|
|
},
|
|
|
|
};
|
2020-02-04 01:11:35 +03:00
|
|
|
}
|