refactor: Convert all enums to const object types in nodes-base (no-changelog) (#14131)

This commit is contained in:
Alex Grozav
2025-03-24 14:40:19 +02:00
committed by GitHub
parent defeb2e817
commit b9608647ca
31 changed files with 422 additions and 345 deletions

View File

@@ -10,7 +10,8 @@ import type {
} from 'n8n-workflow';
import { NodeConnectionTypes } from 'n8n-workflow';
import { EntryTypeEnum } from './EntryTypeEnum';
import type { EntryType } from './EntryType';
import { EntryTypes } from './EntryType';
import { clockifyApiRequest } from './GenericFunctions';
import type { IUserDto } from './UserDtos';
import type { IWorkspaceDto } from './WorkpaceInterfaces';
@@ -56,11 +57,11 @@ export class ClockifyTrigger implements INodeType {
options: [
{
name: 'New Time Entry',
value: EntryTypeEnum.NEW_TIME_ENTRY,
value: EntryTypes.NEW_TIME_ENTRY,
},
],
required: true,
default: EntryTypeEnum.NEW_TIME_ENTRY,
default: EntryTypes.NEW_TIME_ENTRY,
},
],
};
@@ -89,7 +90,7 @@ export class ClockifyTrigger implements INodeType {
async poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null> {
const webhookData = this.getWorkflowStaticData('node');
const triggerField = this.getNodeParameter('watchField') as EntryTypeEnum;
const triggerField = this.getNodeParameter('watchField') as EntryType;
const workspaceId = this.getNodeParameter('workspaceId');
if (!webhookData.userId) {
@@ -103,7 +104,7 @@ export class ClockifyTrigger implements INodeType {
let result = null;
switch (triggerField) {
case EntryTypeEnum.NEW_TIME_ENTRY:
case EntryTypes.NEW_TIME_ENTRY:
default:
const workflowTimezone = this.getTimezone();
resource = `workspaces/${workspaceId}/user/${webhookData.userId}/time-entries`;