summaryrefslogtreecommitdiffstats
path: root/src/schemas/releases.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/schemas/releases.ts')
-rw-r--r--src/schemas/releases.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/schemas/releases.ts b/src/schemas/releases.ts
new file mode 100644
index 0000000..0ccb6a6
--- /dev/null
+++ b/src/schemas/releases.ts
@@ -0,0 +1,18 @@
1import { type } from "arktype";
2
3import { nodeSchema } from "../deps/strapi.tsx";
4import { strapiLoader } from "../deps/strapi.tsx";
5
6export const releaseStrapiSchema = type({
7 "version": "string",
8 "date": "string.date.parse",
9 "notes?": nodeSchema.array().or("null"),
10 "files": strapiLoader.resolvedFileAttributeSchema,
11});
12
13export const releaseSchema = releaseStrapiSchema.merge({
14 type: "'release'",
15 title: "string",
16});
17
18export type Release = typeof releaseSchema.infer;