's'
This commit is contained in:
50
dto/app.dto.ts
Normal file
50
dto/app.dto.ts
Normal 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
15
dto/order.dto.ts
Normal 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>;
|
||||
Reference in New Issue
Block a user