2022-09-02 07:51:05 -07:00
|
|
|
import {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2021-01-12 03:40:49 -08:00
|
|
|
|
|
|
|
export class BeeminderApi implements ICredentialType {
|
|
|
|
name = 'beeminderApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-01-12 03:40:49 -08:00
|
|
|
displayName = 'Beeminder API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-18 14:46:21 -07:00
|
|
|
documentationUrl = 'beeminder';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2021-01-12 03:40:49 -08:00
|
|
|
{
|
|
|
|
displayName: 'User',
|
|
|
|
name: 'user',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-01-12 03:40:49 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Auth Token',
|
|
|
|
name: 'authToken',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-01-12 03:40:49 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-09-02 07:51:05 -07:00
|
|
|
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
body: {
|
|
|
|
auth_token: '={{$credentials.authToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: 'https://www.beeminder.com/api/v1',
|
|
|
|
url: `=/users/{{$credentials.user}}.json`,
|
|
|
|
},
|
|
|
|
};
|
2021-01-12 03:40:49 -08:00
|
|
|
}
|