refactor(core): Move push message types to a new shared package (no-changelog) (#10742)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-13 13:02:00 +02:00
committed by GitHub
parent 7f1c131b72
commit 2f8c8448d3
56 changed files with 477 additions and 660 deletions

View File

@@ -1,7 +1,6 @@
import type {
IExecutionPushResponse,
IExecutionResponse,
IPushDataExecutionFinished,
IStartRunData,
IWorkflowDb,
} from '@/Interface';
@@ -34,6 +33,7 @@ import { isEmpty } from '@/utils/typesUtils';
import { useI18n } from '@/composables/useI18n';
import { get } from 'lodash-es';
import { useExecutionsStore } from '@/stores/executions.store';
import type { PushPayload } from '@n8n/api-types';
export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof useRouter> }) {
const nodeHelpers = useNodeHelpers();
@@ -375,7 +375,7 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
// execution finished but was not saved (e.g. due to low connectivity)
workflowsStore.finishActiveExecution({
executionId,
data: { finished: true, stoppedAt: new Date() },
data: { finished: true, stoppedAt: new Date() } as IRun,
});
workflowsStore.executingNode.length = 0;
uiStore.removeActiveAction('workflowRunning');
@@ -395,11 +395,11 @@ export function useRunWorkflow(useRunWorkflowOpts: { router: ReturnType<typeof u
startedAt: execution.startedAt,
stoppedAt: execution.stoppedAt,
} as IRun;
const pushData = {
const pushData: PushPayload<'executionFinished'> = {
data: executedData,
executionId,
retryOf: execution.retryOf,
} as IPushDataExecutionFinished;
};
workflowsStore.finishActiveExecution(pushData);
titleSet(execution.workflowData.name, 'IDLE');
workflowsStore.executingNode.length = 0;