mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Convert all enums to const object types in nodes-base (no-changelog) (#14131)
This commit is contained in:
@@ -43,14 +43,16 @@ export interface Command {
|
||||
};
|
||||
}
|
||||
|
||||
export const enum CommandType {
|
||||
ITEM_MOVE = 'item_move',
|
||||
ITEM_ADD = 'item_add',
|
||||
ITEM_UPDATE = 'item_update',
|
||||
ITEM_REORDER = 'item_reorder',
|
||||
ITEM_DELETE = 'item_delete',
|
||||
ITEM_COMPLETE = 'item_complete',
|
||||
}
|
||||
export const CommandTypes = {
|
||||
ITEM_MOVE: 'item_move',
|
||||
ITEM_ADD: 'item_add',
|
||||
ITEM_UPDATE: 'item_update',
|
||||
ITEM_REORDER: 'item_reorder',
|
||||
ITEM_DELETE: 'item_delete',
|
||||
ITEM_COMPLETE: 'item_complete',
|
||||
} as const;
|
||||
|
||||
export type CommandType = (typeof CommandTypes)[keyof typeof CommandTypes];
|
||||
|
||||
async function getLabelNameFromId(ctx: Context, labelIds: number[]): Promise<string[]> {
|
||||
const labelList = [];
|
||||
@@ -263,7 +265,7 @@ export class MoveHandler implements OperationHandler {
|
||||
const body: SyncRequest = {
|
||||
commands: [
|
||||
{
|
||||
type: CommandType.ITEM_MOVE,
|
||||
type: CommandTypes.ITEM_MOVE,
|
||||
uuid: uuid(),
|
||||
args: {
|
||||
id: taskId,
|
||||
@@ -339,7 +341,7 @@ export class SyncHandler implements OperationHandler {
|
||||
}
|
||||
|
||||
private requiresProjectId(command: Command) {
|
||||
return command.type === CommandType.ITEM_ADD;
|
||||
return command.type === CommandTypes.ITEM_ADD;
|
||||
}
|
||||
|
||||
private enrichTempId(command: Command, tempIdMapping: Map<string, string>, projectId: number) {
|
||||
@@ -350,6 +352,6 @@ export class SyncHandler implements OperationHandler {
|
||||
}
|
||||
|
||||
private requiresTempId(command: Command) {
|
||||
return command.type === CommandType.ITEM_ADD;
|
||||
return command.type === CommandTypes.ITEM_ADD;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user