summaryrefslogtreecommitdiffstats
path: root/src/schemas/releases.ts
blob: 0ccb6a667dfa5a379dc1297f53451a6931039276 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { type } from "arktype";

import { nodeSchema } from "../deps/strapi.tsx";
import { strapiLoader } from "../deps/strapi.tsx";

export const releaseStrapiSchema = type({
	"version": "string",
	"date": "string.date.parse",
	"notes?": nodeSchema.array().or("null"),
	"files": strapiLoader.resolvedFileAttributeSchema,
});

export const releaseSchema = releaseStrapiSchema.merge({
	type: "'release'",
	title: "string",
});

export type Release = typeof releaseSchema.infer;