@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_.
58 lines (55 loc) • 1.28 kB
text/typescript
import { StateType } from '@/models/StateType'
// intentionally grouped by state type progression
// this order determines the other these show up in the ui
export const prefectStateNames = [
'Scheduled',
'Late',
'Resuming',
'AwaitingRetry',
'AwaitingConcurrencySlot',
'Pending',
'Paused',
'Suspended',
'Running',
'Retrying',
'Completed',
'Cached',
'Cancelled',
'Cancelling',
'Crashed',
'Failed',
'TimedOut',
] as const
export type PrefectStateNames = typeof prefectStateNames[number]
export const prefectStateNameTypes = {
'Scheduled': 'scheduled',
'Late': 'scheduled',
'Resuming': 'scheduled',
'AwaitingRetry': 'scheduled',
'AwaitingConcurrencySlot': 'scheduled',
'Pending': 'pending',
'Paused': 'paused',
'Suspended': 'paused',
'Running': 'running',
'Retrying': 'running',
'Completed': 'completed',
'Cached': 'completed',
'Cancelled': 'cancelled',
'Cancelling': 'cancelling',
'Crashed': 'crashed',
'Failed': 'failed',
'TimedOut': 'failed',
} as const satisfies Record<PrefectStateNames, StateType>
export const prefectStateNamesWithoutScheduled = [
'Pending',
'Paused',
'Suspended',
'Running',
'Retrying',
'Completed',
'Cancelled',
'Cancelling',
'Crashed',
'Failed',
'TimedOut',
] as const