2024-08-21 02:43:48 -07:00
|
|
|
import type {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2019-12-21 18:44:56 -08:00
|
|
|
|
|
|
|
export class TogglApi implements ICredentialType {
|
|
|
|
name = 'togglApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2019-12-21 18:44:56 -08:00
|
|
|
displayName = 'Toggl API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'toggl';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2019-12-21 18:44:56 -08:00
|
|
|
{
|
2024-08-21 02:43:48 -07:00
|
|
|
displayName: 'Email Address',
|
2019-12-21 18:44:56 -08:00
|
|
|
name: 'username',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-12-21 18:44:56 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2022-11-01 09:41:45 -07:00
|
|
|
typeOptions: { password: true },
|
2019-12-21 18:44:56 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2024-08-21 02:43:48 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
auth: {
|
|
|
|
username: '={{$credentials.username}}',
|
|
|
|
password: '={{$credentials.password}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://api.track.toggl.com/api/v9',
|
|
|
|
url: '/me',
|
|
|
|
},
|
|
|
|
};
|
2019-12-21 18:44:56 -08:00
|
|
|
}
|