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

53 lines (47 loc) 1.58 kB
import { WorkPoolWorkerStatus } from '@/models/WorkPoolWorkerStatus' export type Integration = { name: string, version: string } export type Metadata = { integrations?: Integration[] } & Record<string, unknown> export interface IWorkPoolWorker { readonly id: string, created: Date, updated: Date, name: string, workPoolId: string, lastHeartbeatTime: Date, status: WorkPoolWorkerStatus, heartbeatIntervalSeconds: number, clientVersion: string | null, metadata: Metadata | null, } export class WorkPoolWorker implements IWorkPoolWorker { public readonly id: string public readonly kind = 'worker' public created: Date public updated: Date public name: string public workPoolId: string public lastHeartbeatTime: Date public status: WorkPoolWorkerStatus public heartbeatIntervalSeconds: number public clientVersion: string | null public metadata: Metadata | null public constructor(workPoolWorker: IWorkPoolWorker) { this.id = workPoolWorker.id this.created = workPoolWorker.created this.updated = workPoolWorker.updated this.name = workPoolWorker.name this.workPoolId = workPoolWorker.workPoolId this.lastHeartbeatTime = workPoolWorker.lastHeartbeatTime this.status = workPoolWorker.status this.heartbeatIntervalSeconds = workPoolWorker.heartbeatIntervalSeconds this.clientVersion = workPoolWorker.clientVersion this.metadata = workPoolWorker.metadata } } export type PaginatedWorkPoolWorkers = { workers: WorkPoolWorker[], count: number, limit: number, page: number, pages: number, }