-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06b7303
commit 757d0af
Showing
17 changed files
with
360 additions
and
363 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
ui-v2/src/components/automations/automations-wizard/action-type-schemas.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; |
27 changes: 0 additions & 27 deletions
27
...ations/automations-wizard/automations-action-select/automations-action-select.stories.tsx
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
...tomations/automations-wizard/automations-action-select/automations-action-select.test.tsx
This file was deleted.
Oops, something went wrong.
114 changes: 0 additions & 114 deletions
114
...ts/automations/automations-wizard/automations-action-select/automations-action-select.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...tions-action-select/change-flow-run-state-fields/change-flow-run-state-fields.stories.tsx
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
...omations-action-select/change-flow-run-state-fields/change-flow-run-state-fields.test.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.