mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 00:24:07 -08:00
57afd480ab
* Apply Prettier to all credentials * Fix quotes for lint * 👕 Remove `quotemark` rule * 👕 Run Prettier to take over quotes * ⬆️ Upgrade `eslint-plugin-n8n-nodes-base` * 📦 Update `package-lock.json` Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
42 lines
820 B
TypeScript
42 lines
820 B
TypeScript
import {
|
|
IAuthenticateGeneric,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class GitlabApi implements ICredentialType {
|
|
name = 'gitlabApi';
|
|
displayName = 'GitLab API';
|
|
documentationUrl = 'gitlab';
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Gitlab Server',
|
|
name: 'server',
|
|
type: 'string',
|
|
default: 'https://gitlab.com',
|
|
},
|
|
{
|
|
displayName: 'Access Token',
|
|
name: 'accessToken',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
];
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
'Private-Token': '={{$credentials.accessToken}}',
|
|
},
|
|
},
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: '={{$credentials.server.replace(new RegExp("/$"), "") + "/api/v4" }}',
|
|
url: '/users',
|
|
},
|
|
};
|
|
}
|