n8n/packages/cli/src/executions/executionHelpers.ts
Omar Ajoue 3d2f4406d7
feat(core): Debug in Editor flag (no-changelog) (#6888)
* feat(cli): Debug in Editor flag (no-changelog)

* fix: Lint issue

* chore: Use correct lock version

* fix: Remove dependency cycle
2023-08-09 16:38:17 +02:00

31 lines
908 B
TypeScript

import { Container } from 'typedi';
import type { ExecutionStatus } from 'n8n-workflow';
import { License } from '@/License';
import type { IExecutionFlattedDb, IExecutionResponse } from '@/Interfaces';
export function getStatusUsingPreviousExecutionStatusMethod(
execution: IExecutionFlattedDb | IExecutionResponse,
): ExecutionStatus {
if (execution.waitTill) {
return 'waiting';
} else if (execution.stoppedAt === undefined) {
return 'running';
} else if (execution.finished) {
return 'success';
} else if (execution.stoppedAt !== null) {
return 'failed';
} else {
return 'unknown';
}
}
export function isAdvancedExecutionFiltersEnabled(): boolean {
const license = Container.get(License);
return license.isAdvancedExecutionFiltersEnabled();
}
export function isDebugInEditorLicensed(): boolean {
const license = Container.get(License);
return license.isDebugInEditorLicensed();
}