@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
15 lines (13 loc) • 575 B
text/typescript
import { NextFlowRunResponse } from '@/models/api/NextFlowRunResponse'
import { NextFlowRun } from '@/models/NextFlowRun'
import { MapFunction } from '@/services/Mapper'
export const mapNextFlowRunResponseToNextFlowRun: MapFunction<NextFlowRunResponse, NextFlowRun> = function(source) {
return {
id: source.id,
flowId: source.flow_id,
name: source.name,
stateName: source.state_name,
stateType: this.map('ServerStateType', source.state_type, 'StateType'),
nextScheduledStartTime: this.map('string', source.next_scheduled_start_time, 'Date'),
}
}