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

72 lines (71 loc) 2.96 kB
import { SchemaPropertyComponentWithProps } from '../services/schemas/utilities'; import { Require } from '../types/utilities'; import { ValidationMethod } from '../utilities/validation'; export type SchemaValue = unknown; export type SchemaValues = Record<string, SchemaValue | undefined>; export declare const SchemaStringFormats: readonly ["date", "regex", "date-time", "time-delta", "email", "json-string", "password"]; export declare const SchemaTypes: readonly ["block", "null", "string", "boolean", "integer", "number", "array", "object"]; export declare const BaseDefinitionRefString: "#/definitions/"; export type SchemaType = typeof SchemaTypes[number]; export type SchemaStringFormat = typeof SchemaStringFormats[number]; export type SchemaEnum<T> = T[]; export type SchemaReference = `${typeof BaseDefinitionRefString}${string}`; export type SchemaDefinitions = Record<string, Schema | undefined>; export type BlockSchemaReference = { blockSchemaChecksum: string; blockTypeSlug: string; }; export type BlockSchemaReferences = Record<string, BlockSchemaReference | undefined>; export type SchemaPropertyAnyOf = Require<SchemaProperty, 'anyOf'>; export type SchemaPropertyAllOf = Require<SchemaProperty, 'allOf'>; export type SchemaProperties = Record<string, SchemaProperty | undefined>; export type SchemaPropertyInputAttrs = Record<string, unknown>; export type SchemaPropertyMetaOptions = { attrs?: SchemaPropertyInputAttrs; validators?: ValidationMethod | ValidationMethod[]; required?: boolean; }; export type SchemaPropertyMeta = Partial<SchemaPropertyComponentWithProps> & SchemaPropertyMetaOptions; export type SchemaProperty = { blockTypeSlug?: string; meta?: SchemaPropertyMeta; position?: number; $ref?: SchemaReference; anyOf?: Schema[]; allOf?: Schema[]; example?: string; examples?: string[]; alias?: string; default?: unknown; description?: string; enum?: SchemaEnum<unknown>; exclusiveMaximum?: number; exclusiveMinimum?: number; format?: SchemaStringFormat; items?: SchemaProperty; maximum?: number; maxItems?: number; maxLength?: number; minimum?: number; minItems?: number; minLength?: number; multipleOf?: number; pattern?: string; properties?: SchemaProperties; additionalProperties?: SchemaProperty | boolean; required?: string[]; title?: string; type?: SchemaType; uniqueItems?: boolean; }; export type Schema = SchemaProperty & { blockSchemaReferences?: BlockSchemaReferences; secretFields?: string[]; definitions?: SchemaDefinitions; }; export type WorkerBaseJobTemplate = { job_configuration?: Record<string, string>; variables?: Schema; }; export declare function isSchemaValues(input: unknown): input is SchemaValues; export declare function schemaHas<T extends Schema | SchemaProperty, P extends keyof T>(schema: T, property: P): schema is T & Require<T, P>;