feat: Implement import flow API endpoint

This commit is contained in:
Faruk AYDIN
2025-01-17 13:15:54 +01:00
parent 24cc2278fb
commit 28a74f0cb2
7 changed files with 459 additions and 2 deletions

View File

@@ -0,0 +1,35 @@
import { expect } from 'vitest';
const importFlowMock = async (flow, steps = []) => {
const data = {
name: flow.name,
status: flow.active ? 'published' : 'draft',
active: flow.active,
};
if (steps.length) {
data.steps = steps.map((step) => ({
appKey: step.appKey,
iconUrl: step.iconUrl,
key: step.key,
name: step.name,
parameters: expect.any(Object),
position: step.position,
status: 'incomplete',
type: step.type,
}));
}
return {
data: data,
meta: {
count: 1,
currentPage: null,
isArray: false,
totalPages: null,
type: 'Flow',
},
};
};
export default importFlowMock;