From 219a0d256028fd755bdcd5cc651cb89eb26dd413 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 17 Sep 2020 23:20:27 +0200 Subject: [PATCH] :zap: Minor improvements to Taiga-Node --- packages/nodes-base/nodes/Taiga/GenericFunctions.ts | 8 ++++---- packages/nodes-base/nodes/Taiga/Taiga.node.ts | 12 ++++++------ packages/nodes-base/nodes/Taiga/TaigaTrigger.node.ts | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts index a73ee457b1..56f6357938 100644 --- a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts @@ -1,6 +1,6 @@ import { OptionsWithUri, - } from 'request'; +} from 'request'; import { IExecuteFunctions, @@ -13,9 +13,9 @@ import { import { ICredentialDataDecryptedObject, IDataObject, - } from 'n8n-workflow'; +} from 'n8n-workflow'; - import { +import { createHash, } from 'crypto'; @@ -101,7 +101,7 @@ export async function taigaApiRequest( } } -export async function taigaApiRequestAllItems(this: IHookFunctions | IExecuteFunctions| ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any +export async function taigaApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; diff --git a/packages/nodes-base/nodes/Taiga/Taiga.node.ts b/packages/nodes-base/nodes/Taiga/Taiga.node.ts index be16ed3572..dd888afc68 100644 --- a/packages/nodes-base/nodes/Taiga/Taiga.node.ts +++ b/packages/nodes-base/nodes/Taiga/Taiga.node.ts @@ -126,7 +126,7 @@ export class Taiga implements INodeType { const projectId = this.getCurrentNodeParameter('projectId') as string; - const statuses = await taigaApiRequest.call(this,'GET', '/issue-statuses', {}, { project: projectId }); + const statuses = await taigaApiRequest.call(this, 'GET', '/issue-statuses', {}, { project: projectId }); for (const status of statuses) { const statusName = status.name; const statusId = status.id; @@ -145,7 +145,7 @@ export class Taiga implements INodeType { const projectId = this.getCurrentNodeParameter('projectId') as string; - const users = await taigaApiRequest.call(this,'GET', '/users', {}, { project: projectId }); + const users = await taigaApiRequest.call(this, 'GET', '/users', {}, { project: projectId }); for (const user of users) { const userName = user.username; const userId = user.id; @@ -164,7 +164,7 @@ export class Taiga implements INodeType { const projectId = this.getCurrentNodeParameter('projectId') as string; - const priorities = await taigaApiRequest.call(this,'GET', '/priorities', {}, { project: projectId }); + const priorities = await taigaApiRequest.call(this, 'GET', '/priorities', {}, { project: projectId }); for (const priority of priorities) { const priorityName = priority.name; const priorityId = priority.id; @@ -183,7 +183,7 @@ export class Taiga implements INodeType { const projectId = this.getCurrentNodeParameter('projectId') as string; - const severities = await taigaApiRequest.call(this,'GET', '/severities', {}, { project: projectId }); + const severities = await taigaApiRequest.call(this, 'GET', '/severities', {}, { project: projectId }); for (const severity of severities) { const severityName = severity.name; const severityId = severity.id; @@ -202,7 +202,7 @@ export class Taiga implements INodeType { const projectId = this.getCurrentNodeParameter('projectId') as string; - const milestones = await taigaApiRequest.call(this,'GET', '/milestones', {}, { project: projectId }); + const milestones = await taigaApiRequest.call(this, 'GET', '/milestones', {}, { project: projectId }); for (const milestone of milestones) { const milestoneName = milestone.name; const milestoneId = milestone.id; @@ -221,7 +221,7 @@ export class Taiga implements INodeType { const { id } = await taigaApiRequest.call(this, 'GET', '/users/me'); - const projects = await taigaApiRequest.call(this,'GET', '/projects', {}, { member: id }); + const projects = await taigaApiRequest.call(this, 'GET', '/projects', {}, { member: id }); for (const project of projects) { const projectName = project.name; const projectId = project.id; diff --git a/packages/nodes-base/nodes/Taiga/TaigaTrigger.node.ts b/packages/nodes-base/nodes/Taiga/TaigaTrigger.node.ts index 952ca721a1..8dbdd6e2fe 100644 --- a/packages/nodes-base/nodes/Taiga/TaigaTrigger.node.ts +++ b/packages/nodes-base/nodes/Taiga/TaigaTrigger.node.ts @@ -109,7 +109,7 @@ export class TaigaTrigger implements INodeType { const { id } = await taigaApiRequest.call(this, 'GET', '/users/me'); - const projects = await taigaApiRequest.call(this,'GET', '/projects', {}, { member: id }); + const projects = await taigaApiRequest.call(this, 'GET', '/projects', {}, { member: id }); for (const project of projects) { const projectName = project.name; const projectId = project.id; @@ -181,7 +181,7 @@ export class TaigaTrigger implements INodeType { const webhookData = this.getWorkflowStaticData('node'); try { await taigaApiRequest.call(this, 'DELETE', `/webhooks/${webhookData.webhookId}`); - } catch(error) { + } catch (error) { return false; } delete webhookData.webhookId;