Spaces:
Sleeping
Sleeping
File size: 746 Bytes
097eaf0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | import { z } from "zod";
enum IntegrationEnum {
DIFY = "dify",
ZAPIER = "zapier",
PIPEDREAM = "pipedream",
RAYCAST = "raycast",
LANGCHAIN = "langchain",
CREWAI = "crewai",
LLAMAINDEX = "llamaindex",
N8N = "n8n",
CAMELAI = "camelai",
MAKE = "make",
FLOWISE = "flowise",
METAGPT = "metagpt",
RELEVANCEAI = "relevanceai",
VIASOCKET = "viasocket",
CLI = "cli",
HERMES = "hermes",
}
export const integrationSchema = z
.string()
.refine(
val =>
(typeof val === "string" && val.startsWith("_")) ||
Object.values(IntegrationEnum).includes(val as any),
{
message: `Invalid enum value. Expected ${Object.values(IntegrationEnum)
.map(v => `'${v}'`)
.join(" | ")}`,
},
);
|