@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_.
19 lines (17 loc) • 608 B
text/typescript
import { BlockType } from '@/models/BlockType'
import { MockFunction } from '@/services/Mocker'
export const randomBlockType: MockFunction<BlockType, [Partial<BlockType>?]> = function(overrides = {}) {
const nameAndSlug = this.create('noun')
return new BlockType({
id: this.create('string'),
created: this.create('date'),
updated: this.create('date'),
slug: nameAndSlug,
name: nameAndSlug,
logoUrl: this.create('image'),
documentationUrl: 'docs.prefect.io',
description: this.create('sentence'),
codeExample: this.create('blockTypeSnippet'),
...overrides,
})
}