Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
devinvillarosa committed Jan 4, 2025
1 parent 06b7303 commit 757d0af
Show file tree
Hide file tree
Showing 17 changed files with 360 additions and 363 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { z } from "zod";

const FlowRunSchema = z.object({
type: z.enum(["cancel-flow-run", "suspend-flow-run", "resume-flow-run"]),
});

const ChangeFlowRunStateSchema = z
.object({
type: z.literal("change-flow-run-state"),
state: z.enum([
"COMPLETED",
"RUNNING",
"SCHEDULED",
"PENDING",
"FAILED",
"CANCELLED",
"CANCELLING",
"CRASHED",
"PAUSED",
]),
name: z.string().optional(),
message: z.string().optional(),
})
.strict();

// TODO
const DeploymentsSchema = z
.object({
type: z.enum(["run-deployment", "pause-deployment", "resume-deployment"]),
})
.strict();

// TODO
const WorkQueueSchema = z
.object({
type: z.enum(["pause-work-queue", "resume-work-queue"]),
})
.strict();

// TODO
const WorkPoolSchema = z
.object({
type: z.enum(["pause-work-pool", "resume-work-pool"]),
})
.strict();

// TODO
const AutomationSchema = z
.object({
type: z.enum(["pause-automation", "resume-automation"]),
})
.strict();

// TODO
const SendNotificationSchema = z
.object({ type: z.literal("send-notification") })
.strict();

export const ActionsSchema = z.union([
ChangeFlowRunStateSchema,
DeploymentsSchema,
WorkPoolSchema,
WorkQueueSchema,
AutomationSchema,
SendNotificationSchema,
FlowRunSchema,
]);

export type ActionsSchema = z.infer<typeof ActionsSchema>;

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 757d0af

Please sign in to comment.