@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_.
28 lines (25 loc) • 1.01 kB
text/typescript
import { createObjectLevelCan, WorkPool } from '@/models'
import { MockFunction } from '@/services'
export const randomWorkPool: MockFunction<WorkPool, [Partial<WorkPool>?]> =
function(overrides = {}) {
const name = this.create('noun')
return new WorkPool({
// Setting the id to the name allows us to reference the work pool by name
// in the demo application key data stores without throwing errors.
id: name,
created: this.create('date'),
updated: this.create('date'),
name: name,
description: this.create('paragraph'),
type: this.create('noun'),
isPaused: this.create('boolean'),
isPushPool: this.create('boolean'),
isMexPool: this.create('boolean'),
concurrencyLimit: this.create('number'),
defaultQueueId: this.create('id'),
baseJobTemplate: this.create('parameters', [{}, this.create('schema')]),
status: this.create('workPoolStatus'),
can: createObjectLevelCan(),
...overrides,
})
}