This commit is contained in:
eric
2026-04-02 07:15:42 -05:00
parent 644a6ac3a9
commit d401a36b71
62 changed files with 13264 additions and 78 deletions

50
dto/app.dto.ts Normal file
View File

@@ -0,0 +1,50 @@
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>;

15
dto/order.dto.ts Normal file
View File

@@ -0,0 +1,15 @@
import { z } from "zod";
export const orderPlanSchema = z.enum(["free", "pro", "ultra"]);
export const orderStatusSchema = z.enum(["pending", "success", "failed"]);
export const orderSchema = z.object({
id: z.string(),
plan: orderPlanSchema,
slug: z.string(),
amount: z.number(),
status: orderStatusSchema,
createdAt: z.string(),
});
export type OrderDto = z.infer<typeof orderSchema>;