mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Move push message types to a new shared package (no-changelog) (#10742)
This commit is contained in:
committed by
GitHub
parent
7f1c131b72
commit
2f8c8448d3
@@ -1,3 +1,4 @@
|
||||
import type { RunningJobSummary } from '@n8n/api-types';
|
||||
import { WorkflowExecute } from 'n8n-core';
|
||||
import { BINARY_ENCODING, ApplicationError, Workflow } from 'n8n-workflow';
|
||||
import type { ExecutionStatus, IExecuteResponsePromiseData, IRun } from 'n8n-workflow';
|
||||
@@ -11,7 +12,7 @@ import { Logger } from '@/logger';
|
||||
import { NodeTypes } from '@/node-types';
|
||||
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';
|
||||
|
||||
import type { Job, JobId, JobResult, RunningJob, RunningJobSummary } from './scaling.types';
|
||||
import type { Job, JobId, JobResult, RunningJob } from './scaling.types';
|
||||
|
||||
/**
|
||||
* Responsible for processing jobs from the queue, i.e. running enqueued executions.
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
import type { RunningJobSummary } from '@n8n/api-types';
|
||||
import type Bull from 'bull';
|
||||
import type {
|
||||
ExecutionError,
|
||||
ExecutionStatus,
|
||||
IExecuteResponsePromiseData,
|
||||
IRun,
|
||||
WorkflowExecuteMode as WorkflowExecutionMode,
|
||||
} from 'n8n-workflow';
|
||||
import type { ExecutionError, IExecuteResponsePromiseData, IRun } from 'n8n-workflow';
|
||||
import type PCancelable from 'p-cancelable';
|
||||
|
||||
export type JobQueue = Bull.Queue<JobData>;
|
||||
@@ -30,11 +25,11 @@ export type JobOptions = Bull.JobOptions;
|
||||
|
||||
export type PubSubMessage = MessageToMain | MessageToWorker;
|
||||
|
||||
type MessageToMain = RepondToWebhookMessage;
|
||||
type MessageToMain = RespondToWebhookMessage;
|
||||
|
||||
type MessageToWorker = AbortJobMessage;
|
||||
|
||||
type RepondToWebhookMessage = {
|
||||
type RespondToWebhookMessage = {
|
||||
kind: 'respond-to-webhook';
|
||||
executionId: string;
|
||||
response: IExecuteResponsePromiseData;
|
||||
@@ -44,19 +39,10 @@ type AbortJobMessage = {
|
||||
kind: 'abort-job';
|
||||
};
|
||||
|
||||
export type RunningJob = {
|
||||
executionId: string;
|
||||
workflowId: string;
|
||||
workflowName: string;
|
||||
mode: WorkflowExecutionMode;
|
||||
startedAt: Date;
|
||||
retryOf: string;
|
||||
status: ExecutionStatus;
|
||||
export type RunningJob = RunningJobSummary & {
|
||||
run: PCancelable<IRun>;
|
||||
};
|
||||
|
||||
export type RunningJobSummary = Omit<RunningJob, 'run'>;
|
||||
|
||||
export type QueueRecoveryContext = {
|
||||
/** ID of timeout for next scheduled recovery cycle. */
|
||||
timeout?: NodeJS.Timeout;
|
||||
|
||||
Reference in New Issue
Block a user