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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
833 B
TypeScript
Raw Permalink Normal View History

import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
2019-12-21 18:44:56 -08:00
export class TogglApi implements ICredentialType {
name = 'togglApi';
2019-12-21 18:44:56 -08:00
displayName = 'Toggl API';
documentationUrl = 'toggl';
properties: INodeProperties[] = [
2019-12-21 18:44:56 -08:00
{
displayName: 'Email Address',
2019-12-21 18:44:56 -08:00
name: 'username',
type: 'string',
2019-12-21 18:44:56 -08:00
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: { password: true },
2019-12-21 18:44:56 -08:00
default: '',
},
];
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
}