2023-01-27 03:22:44 -08:00
|
|
|
import type {
|
2022-07-04 02:43:37 -07:00
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
2019-11-26 12:38:38 -08:00
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2019-11-26 12:38:38 -08:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2019-11-27 22:10:41 -08:00
|
|
|
export class JiraSoftwareCloudApi implements ICredentialType {
|
|
|
|
name = 'jiraSoftwareCloudApi';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2019-12-02 13:40:24 -08:00
|
|
|
displayName = 'Jira SW Cloud API';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'jira';
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2019-11-26 12:38:38 -08:00
|
|
|
{
|
2019-11-27 14:42:28 -08:00
|
|
|
displayName: 'Email',
|
|
|
|
name: 'email',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2022-06-20 07:54:01 -07:00
|
|
|
placeholder: 'name@email.com',
|
2019-11-27 14:42:28 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'API Token',
|
|
|
|
name: 'apiToken',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2023-08-01 04:08:25 -07:00
|
|
|
typeOptions: { password: true },
|
2019-11-27 14:42:28 -08:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Domain',
|
|
|
|
name: 'domain',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2019-11-26 12:38:38 -08:00
|
|
|
default: '',
|
2020-02-06 19:03:29 -08:00
|
|
|
placeholder: 'https://example.atlassian.net',
|
2019-11-26 12:38:38 -08:00
|
|
|
},
|
|
|
|
];
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-07-04 02:43:37 -07:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
2022-07-24 08:36:17 -07:00
|
|
|
auth: {
|
2022-07-04 02:43:37 -07:00
|
|
|
username: '={{$credentials.email}}',
|
|
|
|
password: '={{$credentials.apiToken}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2022-12-02 12:54:28 -08:00
|
|
|
|
2022-07-04 02:43:37 -07:00
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: '={{$credentials?.domain}}',
|
|
|
|
url: '/rest/api/2/project',
|
|
|
|
},
|
|
|
|
};
|
2019-11-26 12:38:38 -08:00
|
|
|
}
|