diff --git a/packages/nodes-base/nodes/Schedule/CronInterface.ts b/packages/nodes-base/nodes/Schedule/CronInterface.ts deleted file mode 100644 index 5e1521d6da..0000000000 --- a/packages/nodes-base/nodes/Schedule/CronInterface.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ICronExpression = [ - string | Date, - string | Date, - string | Date, - string | Date, - string | Date, -]; diff --git a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts index 9334b9600b..20b5b73ef3 100644 --- a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts +++ b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts @@ -8,7 +8,6 @@ import { } from 'n8n-workflow'; import { CronJob } from 'cron'; -import { ICronExpression } from './CronInterface'; import moment from 'moment'; export class ScheduleTrigger implements INodeType { @@ -463,7 +462,7 @@ export class ScheduleTrigger implements INodeType { if (interval[i].field === 'hours') { const hour = interval[i].hoursInterval?.toString() as string; const minute = interval[i].triggerAtMinute?.toString() as string; - const cronTimes: ICronExpression = [minute, `*/${hour}`, '*', '*', '*']; + const cronTimes: string[] = [minute, `*/${hour}`, '*', '*', '*']; const cronExpression: string = cronTimes.join(' '); const cronJob = new CronJob(cronExpression, executeTrigger, undefined, true, timezone); cronJobs.push(cronJob); @@ -473,7 +472,7 @@ export class ScheduleTrigger implements INodeType { const day = interval[i].daysInterval?.toString() as string; const hour = interval[i].triggerAtHour?.toString() as string; const minute = interval[i].triggerAtMinute?.toString() as string; - const cronTimes: ICronExpression = [minute, hour, `*/${day}`, '*', '*']; + const cronTimes: string[] = [minute, hour, `*/${day}`, '*', '*']; const cronExpression: string = cronTimes.join(' '); const cronJob = new CronJob(cronExpression, executeTrigger, undefined, true, timezone); cronJobs.push(cronJob); @@ -485,7 +484,7 @@ export class ScheduleTrigger implements INodeType { const week = interval[i].weeksInterval as number; const days = interval[i].triggerAtDay as IDataObject[]; const day = days.length === 0 ? '*' : (days.join(',') as string); - const cronTimes: ICronExpression = [minute, hour, `*/${week * 7}`, '*', day]; + const cronTimes: string[] = [minute, hour, `*/${week * 7}`, '*', day]; const cronExpression = cronTimes.join(' '); const cronJob = new CronJob(cronExpression, executeTrigger, undefined, true, timezone); cronJobs.push(cronJob); @@ -496,7 +495,7 @@ export class ScheduleTrigger implements INodeType { const day = interval[i].triggerAtDayOfMonth?.toString() as string; const hour = interval[i].triggerAtHour?.toString() as string; const minute = interval[i].triggerAtMinute?.toString() as string; - const cronTimes: ICronExpression = [minute, hour, day, `*/${month}`, '*']; + const cronTimes: string[] = [minute, hour, day, `*/${month}`, '*']; const cronExpression: string = cronTimes.join(' '); const cronJob = new CronJob(cronExpression, executeTrigger, undefined, true, timezone); cronJobs.push(cronJob);