Files
2026-04-02 07:15:42 -05:00

51 lines
1.2 KiB
TypeScript

import { z } from "zod";
export const downloadSourceSchema = z.object({
id: z.string(),
name: z.string(),
type: z.enum(["official", "pan", "mirror", "affiliate"]),
href: z.string(),
hint: z.string().optional(),
});
export const versionHistorySchema = z.object({
version: z.string(),
size: z.string(),
updatedAt: z.string(),
notes: z.string(),
downloadHref: z.string(),
});
export const changelogSchema = z.object({
date: z.string(),
title: z.string(),
description: z.string(),
});
export const appResourceSchema = z.object({
id: z.string(),
slug: z.string(),
name: z.string(),
subtitle: z.string(),
description: z.string(),
icon: z.string(),
category: z.string(),
tags: z.array(z.string()),
version: z.string(),
size: z.string(),
updatedAt: z.string(),
uploadedAt: z.string(),
downloads: z.number(),
featured: z.boolean().optional(),
safety: z.array(z.enum(["official", "verified", "clean"])),
screenshots: z.array(z.string()),
channels: z.array(downloadSourceSchema),
versionHistory: z.array(versionHistorySchema),
changelog: z.array(changelogSchema),
usage: z.array(z.string()),
});
export const appListSchema = z.array(appResourceSchema);
export type AppResourceDto = z.infer<typeof appResourceSchema>;