@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_.
24 lines (21 loc) • 829 B
text/typescript
import { DeploymentSchedule } from '@/models/DeploymentSchedule'
import { MockFunction } from '@/services/Mocker'
import { random, uniform } from '@/utilities/math'
export const randomDeploymentSchedules: MockFunction<DeploymentSchedule[], [Partial<DeploymentSchedule>?]> = function(overrides = {}) {
const numDeploymentSchedules = uniform(0, 3)
const deploymentSchedules: DeploymentSchedule[] = []
for (let i = 0; i < numDeploymentSchedules; i++) {
deploymentSchedules[i] = {
id: this.create('id'),
created: this.create('date'),
updated: this.create('date'),
slug: random() > 0.25 ? this.create('string') : null,
active: random() > 0.25,
schedule: this.create('schedule'),
jobVariables: {},
parameters: {},
...overrides,
}
}
return deploymentSchedules
}