import { z } from "zod";
const PostSchema = z.object({
id: z.string(),
slug: z.string(),
title: z.string(),
content: z.string(),
featured: z.boolean(),
description: z.string(),
coverImage: z.string().url(),
publishedAt: z.coerce.date(),
updatedAt: z.coerce.date(),
authors: z.array(
z.object({
id: z.string(),
name: z.string(),
slug: z.string(),
image: z.string().nullable(),
bio: z.string().nullable(),
role: z.string().nullable(),
socials: z.array(SocialSchema),
})
),
category: z.object({
id: z.string(),
slug: z.string(),
name: z.string(),
description: z.string().nullable(),
}),
tags: z.array(
z.object({
id: z.string(),
slug: z.string(),
name: z.string(),
description: z.string().nullable(),
})
),
attribution: z
.object({
author: z.string(),
url: z.string().url(),
})
.nullable(),
});
const PaginationSchema = z.object({
limit: z.number(),
currentPage: z.number(),
nextPage: z.number().nullable(),
previousPage: z.number().nullable(),
totalItems: z.number(),
totalPages: z.number(),
});
export const SocialSchema = z.object({
url: z.string(),
platform: SocialPlatformSchema,
});
export const SocialPlatformSchema = z.enum([
"x",
"github",
"facebook",
"instagram",
"youtube",
"tiktok",
"linkedin",
"website",
"onlyfans",
"discord",
"bluesky",
]);