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:
@@ -1,16 +1,22 @@
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
export const enum AlertStatus {
|
||||
NEW = 'New',
|
||||
UPDATED = 'Updated',
|
||||
IGNORED = 'Ignored',
|
||||
IMPORTED = 'Imported',
|
||||
}
|
||||
export const enum TLP {
|
||||
white,
|
||||
green,
|
||||
amber,
|
||||
red,
|
||||
}
|
||||
|
||||
export const AlertStatuses = {
|
||||
NEW: 'New',
|
||||
UPDATED: 'Updated',
|
||||
IGNORED: 'Ignored',
|
||||
IMPORTED: 'Imported',
|
||||
} as const;
|
||||
|
||||
export type AlertStatus = (typeof AlertStatuses)[keyof typeof AlertStatuses];
|
||||
|
||||
export const TLPs = {
|
||||
white: 0,
|
||||
green: 1,
|
||||
amber: 2,
|
||||
red: 3,
|
||||
} as const;
|
||||
|
||||
export type TLP = (typeof TLPs)[keyof typeof TLPs];
|
||||
|
||||
export interface IAlert {
|
||||
// Required attributes
|
||||
|
||||
@@ -32,22 +32,29 @@ export interface ICase {
|
||||
upadtedAt?: Date;
|
||||
}
|
||||
|
||||
export const enum CaseStatus {
|
||||
OPEN = 'Open',
|
||||
RESOLVED = 'Resolved',
|
||||
DELETED = 'Deleted',
|
||||
}
|
||||
export const CaseStatuses = {
|
||||
OPEN: 'Open',
|
||||
RESOLVED: 'Resolved',
|
||||
DELETED: 'Deleted',
|
||||
} as const;
|
||||
|
||||
export const enum CaseResolutionStatus {
|
||||
INDETERMINATE = 'Indeterminate',
|
||||
FALSEPOSITIVE = 'FalsePositive',
|
||||
TRUEPOSITIVE = 'TruePositive',
|
||||
OTHER = 'Other',
|
||||
DUPLICATED = 'Duplicated',
|
||||
}
|
||||
export type CaseStatus = (typeof CaseStatuses)[keyof typeof CaseStatuses];
|
||||
|
||||
export const enum CaseImpactStatus {
|
||||
NOIMPACT = 'NoImpact',
|
||||
WITHIMPACT = 'WithImpact',
|
||||
NOTAPPLICABLE = 'NotApplicable',
|
||||
}
|
||||
export const CaseResolutionStatuses = {
|
||||
INDETERMINATE: 'Indeterminate',
|
||||
FALSEPOSITIVE: 'FalsePositive',
|
||||
TRUEPOSITIVE: 'TruePositive',
|
||||
OTHER: 'Other',
|
||||
DUPLICATED: 'Duplicated',
|
||||
} as const;
|
||||
|
||||
export type CaseResolutionStatus =
|
||||
(typeof CaseResolutionStatuses)[keyof typeof CaseResolutionStatuses];
|
||||
|
||||
export const CaseImpactStatuses = {
|
||||
NOIMPACT: 'NoImpact',
|
||||
WITHIMPACT: 'WithImpact',
|
||||
NOTAPPLICABLE: 'NotApplicable',
|
||||
} as const;
|
||||
|
||||
export type CaseImpactStatus = (typeof CaseImpactStatuses)[keyof typeof CaseImpactStatuses];
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import type { IAttachment } from './ObservableInterface';
|
||||
export const enum LogStatus {
|
||||
OK = 'Ok',
|
||||
DELETED = 'Deleted',
|
||||
}
|
||||
|
||||
export const LogStatuses = {
|
||||
OK: 'Ok',
|
||||
DELETED: 'Deleted',
|
||||
} as const;
|
||||
|
||||
export type LogStatus = (typeof LogStatuses)[keyof typeof LogStatuses];
|
||||
|
||||
export interface ILog {
|
||||
// Required attributes
|
||||
id?: string;
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
import type { TLP } from './AlertInterface';
|
||||
|
||||
export const enum ObservableStatus {
|
||||
OK = 'Ok',
|
||||
DELETED = 'Deleted',
|
||||
}
|
||||
export const enum ObservableDataType {
|
||||
domain = 'domain',
|
||||
file = 'file',
|
||||
filename = 'filename',
|
||||
fqdn = 'fqdn',
|
||||
hash = 'hash',
|
||||
ip = 'ip',
|
||||
mail = 'mail',
|
||||
mail_subject = 'mail_subject',
|
||||
other = 'other',
|
||||
regexp = 'regexp',
|
||||
registry = 'registry',
|
||||
uri_path = 'uri_path',
|
||||
url = 'url',
|
||||
'user-agent' = 'user-agent',
|
||||
}
|
||||
export const ObservableStatuses = {
|
||||
OK: 'Ok',
|
||||
DELETED: 'Deleted',
|
||||
} as const;
|
||||
|
||||
export type ObservableStatus = (typeof ObservableStatuses)[keyof typeof ObservableStatuses];
|
||||
|
||||
export const ObservableDataTypes = {
|
||||
domain: 'domain',
|
||||
file: 'file',
|
||||
filename: 'filename',
|
||||
fqdn: 'fqdn',
|
||||
hash: 'hash',
|
||||
ip: 'ip',
|
||||
mail: 'mail',
|
||||
mail_subject: 'mail_subject',
|
||||
other: 'other',
|
||||
regexp: 'regexp',
|
||||
registry: 'registry',
|
||||
uri_path: 'uri_path',
|
||||
url: 'url',
|
||||
'user-agent': 'user-agent',
|
||||
} as const;
|
||||
|
||||
export type ObservableDataType = (typeof ObservableDataTypes)[keyof typeof ObservableDataTypes];
|
||||
|
||||
export interface IAttachment {
|
||||
name?: string;
|
||||
|
||||
@@ -17,9 +17,11 @@ export interface ITask {
|
||||
upadtedAt?: Date;
|
||||
}
|
||||
|
||||
export const enum TaskStatus {
|
||||
WAITING = 'Waiting',
|
||||
INPROGRESS = 'InProgress',
|
||||
COMPLETED = 'Completed',
|
||||
CANCEL = 'Cancel',
|
||||
}
|
||||
export const TaskStatuses = {
|
||||
WAITING: 'Waiting',
|
||||
INPROGRESS: 'InProgress',
|
||||
COMPLETED: 'Completed',
|
||||
CANCEL: 'Cancel',
|
||||
} as const;
|
||||
|
||||
export type TaskStatus = (typeof TaskStatuses)[keyof typeof TaskStatuses];
|
||||
|
||||
Reference in New Issue
Block a user