mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 13:39:44 -08:00
1c229a7b52
* ⬆️ Upgrade linter * 📦 Update `package-lock.json` * 👕 Enable rule * 👕 Apply rule * 📦 Re-update `package-lock.json`
43 lines
856 B
TypeScript
43 lines
856 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',
|
|
typeOptions: { password: true },
|
|
default: '',
|
|
},
|
|
];
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
'Private-Token': '={{$credentials.accessToken}}',
|
|
},
|
|
},
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: '={{$credentials.server.replace(new RegExp("/$"), "") + "/api/v4" }}',
|
|
url: '/users',
|
|
},
|
|
};
|
|
}
|