@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_.
85 lines (84 loc) • 5.52 kB
TypeScript
import { ServerStateType } from '../../models/StateType';
import { SchemaValues } from '../../schemas/types/schemaValues';
import { Require } from '../../types/utilities';
export declare const automationActionTypes: readonly ["cancel-flow-run", "suspend-flow-run", "resume-flow-run", "change-flow-run-state", "run-deployment", "pause-deployment", "resume-deployment", "pause-work-queue", "resume-work-queue", "pause-work-pool", "resume-work-pool", "pause-automation", "resume-automation", "send-notification", "call-webhook", "do-nothing"], isAutomationActionType: (value: unknown) => value is "cancel-flow-run" | "suspend-flow-run" | "resume-flow-run" | "change-flow-run-state" | "run-deployment" | "pause-deployment" | "resume-deployment" | "pause-work-queue" | "resume-work-queue" | "pause-work-pool" | "resume-work-pool" | "pause-automation" | "resume-automation" | "send-notification" | "call-webhook" | "do-nothing";
export type AutomationActionType = typeof automationActionTypes[number];
export declare const automationActionTypeLabels: {
readonly 'cancel-flow-run': "Cancel a flow run";
readonly 'suspend-flow-run': "Suspend a flow run";
readonly 'resume-flow-run': "Resume a flow run";
readonly 'change-flow-run-state': "Change flow run's state";
readonly 'run-deployment': "Run a deployment";
readonly 'pause-deployment': "Pause a deployment";
readonly 'resume-deployment': "Resume a deployment";
readonly 'pause-work-queue': "Pause a work queue";
readonly 'resume-work-queue': "Resume a work queue";
readonly 'pause-work-pool': "Pause a work pool";
readonly 'resume-work-pool': "Resume a work pool";
readonly 'pause-automation': "Pause an automation";
readonly 'resume-automation': "Resume an automation";
readonly 'send-notification': "Send a notification";
readonly 'call-webhook': "Call a webhook";
readonly 'do-nothing': "Do nothing";
};
/**
* Utility type for creating individual automation action types.
* Enforces `type` is of type `AutomationActionType`.
*/
export type AutomationActionWithType<TType extends AutomationActionType, TRest extends Record<string, unknown> = Record<never, never>> = {
type: TType;
} & TRest;
export type AutomationActionCancelFlowRun = AutomationActionWithType<'cancel-flow-run'>;
export type AutomationActionSuspendFlowRun = AutomationActionWithType<'suspend-flow-run'>;
export type AutomationActionResumeFlowRun = AutomationActionWithType<'resume-flow-run'>;
export type AutomationActionChangeFlowRunState = AutomationActionWithType<'change-flow-run-state', {
name?: string | null;
state: ServerStateType;
message?: string | null;
}>;
export declare function isAutomationActionChangeFlowRunState(value: unknown): value is AutomationActionChangeFlowRunState;
export type AutomationActionRunDeployment = AutomationActionWithType<'run-deployment', {
deploymentId?: string | null;
parameters: SchemaValues | null;
jobVariables?: Record<string, unknown>;
}>;
export declare function isAutomationActionRunDeployment(value: unknown): value is AutomationActionRunDeployment;
export type AutomationActionPauseDeployment = AutomationActionWithType<'pause-deployment', {
deploymentId?: string | null;
}>;
export declare function isAutomationActionPauseDeployment(value: unknown): value is AutomationActionPauseDeployment;
export type AutomationActionResumeDeployment = AutomationActionWithType<'resume-deployment', {
deploymentId?: string | null;
}>;
export declare function isAutomationActionResumeDeployment(value: unknown): value is AutomationActionResumeDeployment;
export type AutomationActionPauseWorkQueue = AutomationActionWithType<'pause-work-queue', {
workQueueId?: string | null;
}>;
export type AutomationActionResumeWorkQueue = AutomationActionWithType<'resume-work-queue', {
workQueueId?: string | null;
}>;
export type AutomationActionPauseWorkPool = AutomationActionWithType<'pause-work-pool', {
workPoolId?: string | null;
}>;
export type AutomationActionResumeWorkPool = AutomationActionWithType<'resume-work-pool', {
workPoolId?: string | null;
}>;
export type AutomationActionPauseAutomation = AutomationActionWithType<'pause-automation', {
automationId?: string | null;
}>;
export type AutomationActionResumeAutomation = AutomationActionWithType<'resume-automation', {
automationId?: string | null;
}>;
export type AutomationActionSendNotification = AutomationActionWithType<'send-notification', {
blockDocumentId: string;
subject: string;
body: string;
}>;
export type AutomationActionCallWebhook = AutomationActionWithType<'call-webhook', {
blockDocumentId: string;
payload: string;
}>;
export type AutomationActionDoNothing = AutomationActionWithType<'do-nothing'>;
export type AutomationAction = AutomationActionCancelFlowRun | AutomationActionSuspendFlowRun | AutomationActionChangeFlowRunState | AutomationActionResumeFlowRun | AutomationActionRunDeployment | AutomationActionPauseDeployment | AutomationActionResumeDeployment | AutomationActionPauseWorkQueue | AutomationActionResumeWorkQueue | AutomationActionPauseWorkPool | AutomationActionResumeWorkPool | AutomationActionPauseAutomation | AutomationActionResumeAutomation | AutomationActionSendNotification | AutomationActionCallWebhook | AutomationActionDoNothing;
export type AutomationActionFields<T extends AutomationAction> = Require<Partial<T>, 'type'>;
export declare function isAutomationAction(value: unknown): value is AutomationAction;