mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
d8870ecbff
* adds support for trello board member operations: inviteMemberByEmail, addMember, removeMember, getMembers * lintfix * format fixes * remove unnecessary variable and assign to qs on same line * fix description * Moved Board Members to their own resource * Removed members from board resource... * Added return all limits to get members * adds info about Trello premium feature in description * Improvements from internal review * ⚡ Improvements * Changed credentials to use new system and implemented test * ⚡ Improvements * fix(core): Fix issue with fixedCollection having all default values * 👕 Fix lint issue Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com> Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
51 lines
1 KiB
TypeScript
51 lines
1 KiB
TypeScript
import {
|
|
ICredentialDataDecryptedObject,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
IHttpRequestOptions,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class TrelloApi implements ICredentialType {
|
|
name = 'trelloApi';
|
|
displayName = 'Trello API';
|
|
documentationUrl = 'trello';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'API Key',
|
|
name: 'apiKey',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'API Token',
|
|
name: 'apiToken',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'OAuth Secret',
|
|
name: 'oauthSecret',
|
|
type: 'hidden',
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
async authenticate(credentials: ICredentialDataDecryptedObject, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions> {
|
|
requestOptions.qs = {
|
|
...requestOptions.qs,
|
|
'key': credentials.apiKey,
|
|
'token': credentials.apiToken,
|
|
};
|
|
return requestOptions;
|
|
}
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: 'https://api.trello.com',
|
|
url: '=/1/tokens/{{$credentials.apiToken}}/member',
|
|
},
|
|
};
|
|
}
|