mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-10-28 06:02:25 -05:00
45 lines
991 B
TypeScript
45 lines
991 B
TypeScript
import type {
|
|
IAuthenticateGeneric,
|
|
Icon,
|
|
ICredentialTestRequest,
|
|
ICredentialType,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export class GithubIssuesApi implements ICredentialType {
|
|
name = 'githubIssuesApi';
|
|
|
|
displayName = 'GitHub Issues API';
|
|
|
|
icon: Icon = { light: 'file:../icons/github.svg', dark: 'file:../icons/github.dark.svg' };
|
|
|
|
documentationUrl =
|
|
'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#deleting-a-personal-access-token';
|
|
|
|
properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Access Token',
|
|
name: 'accessToken',
|
|
type: 'string',
|
|
typeOptions: { password: true },
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
type: 'generic',
|
|
properties: {
|
|
headers: {
|
|
Authorization: '=token {{$credentials?.accessToken}}',
|
|
},
|
|
},
|
|
};
|
|
|
|
test: ICredentialTestRequest = {
|
|
request: {
|
|
baseURL: 'https://api.github.com',
|
|
url: '/user',
|
|
method: 'GET',
|
|
},
|
|
};
|
|
}
|