32 lines
652 B
TypeScript
32 lines
652 B
TypeScript
import { literal, pipe, strictObject, string, union, uuid } from "valibot";
|
|
|
|
export const processingListValidator = strictObject({
|
|
Type: literal("list"),
|
|
|
|
Name: string(),
|
|
ListID: pipe(string(), uuid()),
|
|
|
|
Status: union([
|
|
literal("not-started"),
|
|
literal("in-progress"),
|
|
literal("complete"),
|
|
]),
|
|
});
|
|
|
|
export const processingImagesValidator = strictObject({
|
|
Type: literal("image"),
|
|
|
|
ImageID: pipe(string(), uuid()),
|
|
ImageName: string(),
|
|
Status: union([
|
|
literal("not-started"),
|
|
literal("in-progress"),
|
|
literal("complete"),
|
|
]),
|
|
});
|
|
|
|
export const notificationValidator = union([
|
|
processingListValidator,
|
|
processingImagesValidator,
|
|
]);
|