UNPKG

@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_.

17 lines (14 loc) 671 B
import { State, StateResponse } from '@/models' import { mapper } from '@/services/Mapper' import { WorkspaceApi } from '@/services/WorkspaceApi' export class WorkspaceTaskRunStatesApi extends WorkspaceApi { protected override routePrefix = '/task_run_states' public async getTaskRunState(taskRunId: string): Promise<State> { const { data } = await this.get<StateResponse>(`/${taskRunId}`) return mapper.map('StateResponse', data, 'State') } public async getTaskRunStates(taskRunId: string): Promise<State[]> { const { data } = await this.get<StateResponse[]>(`?task_run_id=${taskRunId}`) return mapper.map('StateResponse', data, 'State') } }