127 lines
2.0 KiB
TypeScript
127 lines
2.0 KiB
TypeScript
export interface Post {
|
|
id: string
|
|
slug: string
|
|
title: string
|
|
description: string
|
|
img?: string
|
|
views?: string
|
|
catSlug?: string
|
|
userEmail: string
|
|
comments?: Comment[]
|
|
Category?: Category
|
|
Like?: Like[]
|
|
url?: string
|
|
twitterShareCount?: number
|
|
whatsappShareCount?: number
|
|
createdAt?: string
|
|
updatedAt?: string
|
|
Favorite?: Favorite[]
|
|
// Tags?: Tag[]
|
|
}
|
|
|
|
export interface Category {
|
|
id: string
|
|
slug: string
|
|
title: string
|
|
img?: string
|
|
color?: string
|
|
Posts?: Post[]
|
|
Comment?: Comment
|
|
}
|
|
|
|
export interface Like {
|
|
id: string
|
|
postId: string
|
|
post: Post
|
|
userEmail: string
|
|
user: User
|
|
createdAt: string
|
|
updatedAt: string
|
|
}
|
|
|
|
export interface Favorite {
|
|
id: string
|
|
postId: string
|
|
post: Post
|
|
userEmail: string
|
|
user: User
|
|
createdAt: string
|
|
updatedAt: string
|
|
}
|
|
|
|
export interface Comment {
|
|
id: string
|
|
createdAt: string
|
|
description: string
|
|
userEmail: string
|
|
user: User
|
|
postSlug: string
|
|
post: Post
|
|
Category?: Category
|
|
categoryId?: string
|
|
}
|
|
|
|
export interface User {
|
|
id: string
|
|
name?: string
|
|
email: string
|
|
emailVerified?: string
|
|
image?: string
|
|
accounts?: Account[]
|
|
sessions?: Session[]
|
|
Post?: Post[]
|
|
Like?: Like[]
|
|
Comment?: Comment[]
|
|
isAdmin: boolean
|
|
Favorite?: Favorite[]
|
|
}
|
|
|
|
export interface Account {
|
|
id: string
|
|
userId: string
|
|
type: string
|
|
provider: string
|
|
providerAccountId: string
|
|
refresh_token?: string
|
|
access_token?: string
|
|
expires_at?: number
|
|
token_type?: string
|
|
scope?: string
|
|
id_token?: string
|
|
session_state?: string
|
|
user: User
|
|
}
|
|
|
|
export interface Session {
|
|
id: string
|
|
sessionToken: string
|
|
userId: string
|
|
expires: string
|
|
user: User
|
|
}
|
|
|
|
export interface VerificationToken {
|
|
identifier: string
|
|
token: string
|
|
expires: string
|
|
}
|
|
|
|
// export type Tag = {
|
|
// id: string
|
|
// name: string
|
|
// color: string
|
|
// slug: string
|
|
// }
|
|
|
|
export type Stats = {
|
|
totalPosts: number
|
|
totalUsers: number
|
|
totalViews: {
|
|
views: number
|
|
}
|
|
totalShares: {
|
|
twitterShareCount: number
|
|
whatsappShareCount: number
|
|
}
|
|
}
|