features: support jira self-hosted server

This commit is contained in:
zou wendi
2020-05-05 12:07:19 +08:00
parent 2bed4a6246
commit e4cc3a4bc9
7 changed files with 117 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
import {
import {
OptionsWithUri,
} from 'request';
@@ -9,13 +9,19 @@ import {
ILoadOptionsFunctions,
} from 'n8n-core';
import {
import {
IDataObject,
ICredentialDataDecryptedObject,
} from 'n8n-workflow';
export async function jiraSoftwareCloudApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, endpoint: string, method: string, body: any = {}, query?: IDataObject, uri?: string): Promise<any> { // tslint:disable-line:no-any
let data; let domain;
const jiraCloudCredentials = this.getCredentials('jiraSoftwareCloudApi');
let jiraCloudCredentials: ICredentialDataDecryptedObject | undefined;
try {
jiraCloudCredentials = this.getCredentials('jiraSoftwareCloudApi');
} catch (error) {
}
const jiraServerCredentials = this.getCredentials('jiraSoftwareServerApi');
if (jiraCloudCredentials === undefined && jiraServerCredentials === undefined) {
throw new Error('No credentials got returned!');