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

50 lines (49 loc) 2.18 kB
export declare const prefectEventPrefixes: readonly ["prefect.block-document", "prefect.deployment", "prefect.flow-run", "prefect.flow", "prefect.task-run", "prefect.work-queue", "prefect.work-pool", "prefect.tag", "prefect.concurrency-limit", "prefect.artifact-collection", "prefect.automation", "prefect.creator", "prefect-cloud.actor", "prefect-cloud.automation", "prefect-cloud.workspace", "prefect-cloud.webhook"]; export type PrefectEventPrefixes = typeof prefectEventPrefixes[number]; export declare const prefectResourceRoles: string[]; export type PrefectResourceRole = PrefectEventPrefixes extends `${string}.${infer T}` ? T : never; export declare function isPrefectResourceRole(value: unknown): value is PrefectResourceRole; export type WorkspaceEventResource = { 'prefect.resource.id': string; 'prefect.resource.role'?: string; 'prefect.resource.name'?: string; 'prefect.name'?: string; 'prefect-cloud.name'?: string; } & Record<string, string | undefined>; export type WorkspaceEventRelatedResource = WorkspaceEventResource & { 'prefect.resource.role': string; }; export type IWorkspaceEvent = { id: string; account: string; event: string; occurred: Date; payload: unknown; received: Date; related: WorkspaceEventRelatedResource[]; resource: WorkspaceEventResource; workspace: string | null; }; export declare class WorkspaceEvent implements IWorkspaceEvent { id: string; account: string; event: string; occurred: Date; payload: unknown; received: Date; related: WorkspaceEventRelatedResource[]; resource: WorkspaceEventResource; workspace: string | null; constructor(event: IWorkspaceEvent); getRelatedByRole(role: PrefectResourceRole): WorkspaceEventRelatedResource | null; get email(): string; get actorName(): string | null; get workspaceHandle(): string; get occurredFormatted(): string; get eventPrefectWithoutPrefix(): string; get eventLabel(): string; get occurredDate(): string; get occurredTime(): string; get resourceId(): string; } export declare function isWorkspaceEvent(value: unknown): value is WorkspaceEvent;