diff --git a/packages/nodes-base/nodes/Clockify/Clockify.node.ts b/packages/nodes-base/nodes/Clockify/Clockify.node.ts index 5dab674fa4..c7d67c116b 100644 --- a/packages/nodes-base/nodes/Clockify/Clockify.node.ts +++ b/packages/nodes-base/nodes/Clockify/Clockify.node.ts @@ -3,12 +3,12 @@ import { } from 'n8n-core'; import { + IDataObject, ILoadOptionsFunctions, INodeExecutionData, INodePropertyOptions, INodeType, INodeTypeDescription, - IDataObject, } from 'n8n-workflow'; import { @@ -30,13 +30,13 @@ import { } from './ProjectInterfaces'; import { - projectOperations, projectFields, + projectOperations, } from './ProjectDescription'; import { - tagOperations, tagFields, + tagOperations, } from './TagDescription'; import { @@ -45,7 +45,6 @@ import { } from './TimeEntryDescription'; import * as moment from 'moment-timezone'; -import { boardColumnFields } from '../MondayCom/BoardColumnDescription'; export class Clockify implements INodeType { description: INodeTypeDescription = { @@ -359,14 +358,12 @@ export class Clockify implements INodeType { body, qs ); - - responseData = { success: true }; } } if (resource === 'tag') { - if (operation === 'add') { + if (operation === 'create') { const workspaceId = this.getNodeParameter('workspaceId', i) as string; @@ -456,8 +453,6 @@ export class Clockify implements INodeType { body, qs ); - - responseData = { success: true }; } } @@ -573,8 +568,6 @@ export class Clockify implements INodeType { body, qs ); - - responseData = { success: true }; } } } diff --git a/packages/nodes-base/nodes/Clockify/ClockifyTrigger.node.ts b/packages/nodes-base/nodes/Clockify/ClockifyTrigger.node.ts index 6ff55a26de..997fb5cdb8 100644 --- a/packages/nodes-base/nodes/Clockify/ClockifyTrigger.node.ts +++ b/packages/nodes-base/nodes/Clockify/ClockifyTrigger.node.ts @@ -1,6 +1,6 @@ import * as moment from 'moment-timezone'; -import {IPollFunctions} from 'n8n-core'; +import { IPollFunctions } from 'n8n-core'; import { IDataObject, ILoadOptionsFunctions, @@ -69,16 +69,16 @@ export class ClockifyTrigger implements INodeType { methods = { loadOptions: { - async listWorkspaces(this: ILoadOptionsFunctions) : Promise { - const rtv : INodePropertyOptions[] = []; - const workspaces: IWorkspaceDto[] = await clockifyApiRequest.call(this,'GET', 'workspaces'); - if(undefined !== workspaces) { + async listWorkspaces(this: ILoadOptionsFunctions): Promise { + const rtv: INodePropertyOptions[] = []; + const workspaces: IWorkspaceDto[] = await clockifyApiRequest.call(this, 'GET', 'workspaces'); + if (undefined !== workspaces) { workspaces.forEach(value => { rtv.push( - { - name: value.name, - value: value.id, - }); + { + name: value.name, + value: value.id, + }); }); } return rtv; @@ -89,7 +89,7 @@ export class ClockifyTrigger implements INodeType { async poll(this: IPollFunctions): Promise { const webhookData = this.getWorkflowStaticData('node'); const triggerField = this.getNodeParameter('watchField') as EntryTypeEnum; - const workspaceId = this.getNodeParameter('workspaceId'); + const workspaceId = this.getNodeParameter('workspaceId'); if (!webhookData.userId) { // Cache the user-id that we do not have to request it every time @@ -97,12 +97,12 @@ export class ClockifyTrigger implements INodeType { webhookData.userId = userInfo.id; } - const qs : IDataObject = {}; + const qs: IDataObject = {}; let resource: string; let result = null; switch (triggerField) { - case EntryTypeEnum.NEW_TIME_ENTRY : + case EntryTypeEnum.NEW_TIME_ENTRY: default: const workflowTimezone = this.getTimezone(); resource = `workspaces/${workspaceId}/user/${webhookData.userId}/time-entries`; @@ -110,10 +110,10 @@ export class ClockifyTrigger implements INodeType { qs.end = moment().tz(workflowTimezone).format('YYYY-MM-DDTHH:mm:ss') + 'Z'; qs.hydrated = true; qs['in-progress'] = false; - break; + break; } - result = await clockifyApiRequest.call(this, 'GET', resource, {}, qs ); + result = await clockifyApiRequest.call(this, 'GET', resource, {}, qs); webhookData.lastTimeChecked = qs.end; if (Array.isArray(result) && result.length !== 0) { diff --git a/packages/nodes-base/nodes/Clockify/CommonDtos.ts b/packages/nodes-base/nodes/Clockify/CommonDtos.ts index 629cede9a2..f31a272507 100644 --- a/packages/nodes-base/nodes/Clockify/CommonDtos.ts +++ b/packages/nodes-base/nodes/Clockify/CommonDtos.ts @@ -20,7 +20,7 @@ export interface IMembershipDto { export interface ITagDto { id: string; - name: any; + name: any; // tslint:disable-line:no-any workspaceId: string; archived: boolean; } diff --git a/packages/nodes-base/nodes/Clockify/ProjectInterfaces.ts b/packages/nodes-base/nodes/Clockify/ProjectInterfaces.ts index 1bb6db6bae..adda95c8af 100644 --- a/packages/nodes-base/nodes/Clockify/ProjectInterfaces.ts +++ b/packages/nodes-base/nodes/Clockify/ProjectInterfaces.ts @@ -1,5 +1,4 @@ -import {IHourlyRateDto, IMembershipDto} from "./CommonDtos"; -import { INodeExecutionData } from "n8n-workflow"; +import { IHourlyRateDto, IMembershipDto } from './CommonDtos'; enum EstimateEnum { AUTO = "AUTO", @@ -11,7 +10,7 @@ interface IEstimateDto { type: EstimateEnum; } -export interface IProjectDto{ +export interface IProjectDto { archived: boolean; billable: boolean; clientId: string; diff --git a/packages/nodes-base/nodes/Clockify/TagDescription.ts b/packages/nodes-base/nodes/Clockify/TagDescription.ts index f3f0b212a7..fa06e832c2 100644 --- a/packages/nodes-base/nodes/Clockify/TagDescription.ts +++ b/packages/nodes-base/nodes/Clockify/TagDescription.ts @@ -16,9 +16,9 @@ export const tagOperations = [ }, options: [ { - name: 'Add', - value: 'add', - description: 'Add a tag', + name: 'Create', + value: 'create', + description: 'Create a tag', }, { name: 'Delete', @@ -59,7 +59,7 @@ export const tagFields = [ 'tag', ], operation: [ - 'add', + 'create', ], }, }, diff --git a/packages/nodes-base/nodes/Clockify/TimeEntryInterfaces.ts b/packages/nodes-base/nodes/Clockify/TimeEntryInterfaces.ts index 9d1f39ce63..d370b21726 100644 --- a/packages/nodes-base/nodes/Clockify/TimeEntryInterfaces.ts +++ b/packages/nodes-base/nodes/Clockify/TimeEntryInterfaces.ts @@ -1,4 +1,4 @@ -import {ITimeIntervalDto} from "./CommonDtos"; +import { ITimeIntervalDto } from './CommonDtos'; interface ITimeEntriesDurationRequest { start: string; @@ -18,7 +18,7 @@ export interface ITimeEntryRequest { timeInterval: ITimeEntriesDurationRequest; workspaceId: string; isLocked: boolean; -}; +} export interface ITimeEntryDto { billable: boolean; @@ -32,4 +32,3 @@ export interface ITimeEntryDto { userId: string; workspaceId: string; } - diff --git a/packages/nodes-base/nodes/Clockify/UserDtos.ts b/packages/nodes-base/nodes/Clockify/UserDtos.ts index 8665089aa1..3c3d1d208c 100644 --- a/packages/nodes-base/nodes/Clockify/UserDtos.ts +++ b/packages/nodes-base/nodes/Clockify/UserDtos.ts @@ -12,7 +12,7 @@ export interface IUserDto { defaultWorkspace: string; email: string; id: string; - memberships: IMembershipDto []; + memberships: IMembershipDto[]; name: string; profilePicture: string; settings: IUserSettingsDto; diff --git a/packages/nodes-base/nodes/Clockify/WorkpaceInterfaces.ts b/packages/nodes-base/nodes/Clockify/WorkpaceInterfaces.ts index d7f1f0ba3c..bce0e4112e 100644 --- a/packages/nodes-base/nodes/Clockify/WorkpaceInterfaces.ts +++ b/packages/nodes-base/nodes/Clockify/WorkpaceInterfaces.ts @@ -1,7 +1,7 @@ import { IHourlyRateDto, IMembershipDto } from './CommonDtos'; enum AdminOnlyPagesEnum { - PROJECT ='PROJECT', + PROJECT = 'PROJECT', TEAM = 'TEAM', REPORTS = 'REPORTS', } @@ -70,7 +70,7 @@ export interface IWorkspaceDto { hourlyRate: IHourlyRateDto; id: string; imageUrl: string; - memberships: IMembershipDto[]; + memberships: IMembershipDto[]; name: string; workspaceSettings: IWorkspaceSettingsDto; }