convertRecordingToFlow function exported
Last updated: 2026-03-05T10:53:28.863Z
Metrics
LOC: 27
Complexity: 3
Params: 3
Signature
convertRecordingToFlow(
session: RecordingSession,
options: ConvertOptions = {},
): : FlowScript
Summary
Convert a RecordingSession into a FlowScript. Filters out steps that cannot be mapped and computes timing deltas from the original timestamps.
Source Code
export function convertRecordingToFlow(
session: RecordingSession,
options: ConvertOptions = {},
): FlowScript {
_resetIdCounter();
const steps = convertSteps(session.steps);
const now = Date.now();
const metadata: FlowMetadata = {
name: options.name ?? "Recorded Flow",
description: options.description,
baseUrl: session.startUrl,
seed: options.seed ?? generateRandomSeed(),
createdAt: now,
updatedAt: now,
version: FLOW_SCRIPT_VERSION,
tags: options.tags,
};
return {
id: generateFlowId(),
metadata,
replayConfig: { ...DEFAULT_REPLAY_CONFIG },
steps,
};
}
Dependencies (Outgoing)
| Target | Type |
|---|---|
| _resetIdCounter | calls |
| convertSteps | calls |
| generateRandomSeed | calls |
| generateFlowId | calls |
Impact (Incoming)
| Source | Type |
|---|---|
| handle | uses |
| makeSession | uses |