feat: Complete export flow rest API endpoint

This commit is contained in:
Faruk AYDIN
2025-01-10 17:21:43 +03:00
parent 169c86a748
commit c180b98460
10 changed files with 362 additions and 19 deletions

View File

@@ -0,0 +1,32 @@
import { expect } from 'vitest';
const duplicateFlowMock = async (flow, steps = []) => {
const data = {
id: expect.any(String),
name: flow.name,
};
if (steps.length) {
data.steps = steps.map((step) => {
const computedStep = {
id: expect.any(String),
key: step.key,
name: step.name,
appKey: step.appKey,
type: step.type,
parameters: expect.any(Object),
position: step.position,
};
if (step.type === 'trigger') {
computedStep.webhookPath = expect.stringContaining('/webhooks/flows/');
}
return computedStep;
});
}
return data;
};
export default duplicateFlowMock;