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

import { resolvedFileAttributeSchema } from "$/schemas/common.ts";

import { nodeSchema } from "../deps/strapi.ts";

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

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

export type Release = typeof releaseSchema.infer;