mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
48 lines
922 B
TypeScript
48 lines
922 B
TypeScript
|
import type {
|
||
|
IAuthenticateGeneric,
|
||
|
ICredentialTestRequest,
|
||
|
ICredentialType,
|
||
|
INodeProperties,
|
||
|
} from 'n8n-workflow';
|
||
|
|
||
|
export class JiraSoftwareServerPatApi implements ICredentialType {
|
||
|
name = 'jiraSoftwareServerPatApi';
|
||
|
|
||
|
displayName = 'Jira SW Server (PAT) API';
|
||
|
|
||
|
documentationUrl = 'jira';
|
||
|
|
||
|
properties: INodeProperties[] = [
|
||
|
{
|
||
|
displayName: 'Personal Access Token',
|
||
|
name: 'personalAccessToken',
|
||
|
typeOptions: { password: true },
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
},
|
||
|
{
|
||
|
displayName: 'Domain',
|
||
|
name: 'domain',
|
||
|
type: 'string',
|
||
|
default: '',
|
||
|
placeholder: 'https://example.com',
|
||
|
},
|
||
|
];
|
||
|
|
||
|
authenticate: IAuthenticateGeneric = {
|
||
|
type: 'generic',
|
||
|
properties: {
|
||
|
headers: {
|
||
|
Authorization: '=Bearer {{$credentials.personalAccessToken}}',
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
|
||
|
test: ICredentialTestRequest = {
|
||
|
request: {
|
||
|
baseURL: '={{$credentials?.domain}}',
|
||
|
url: '/rest/api/2/project',
|
||
|
},
|
||
|
};
|
||
|
}
|