-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
152 lines (136 loc) · 2.57 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
type Template = {
id: string;
name: string;
price: number;
category: TemplateCategory;
slug: string;
description: string | null;
content: string;
coverImage: string;
pages: string[];
features: string[];
languages: string[];
previewUrl: string;
templateFile: string;
templateFileSize: number;
docsString: string;
docsOutline: string;
techstacks: Techstack[];
screenshots: Screenshot[];
changelogs: Changelog[];
createdAt: Date;
updatedAt: Date;
};
type User = {
id: string;
name: string;
email: string;
emailVerified: boolean | null;
isEmailVerified: boolean;
image: string;
password: string | null;
resetToken: string | null;
resetTokenExpiry: string | null;
verificationCode: string | null;
role: string;
createdAt: string;
updatedAt: string;
};
type UserTemplate = {
id: string;
userId: string;
templateId: string;
createdAt: string;
updatedAt: string;
user: User;
template: Template;
};
type TemplateCategory = {
id: string;
name: string;
image: string | null;
description: string | null;
createdAt: Date;
updatedAt: Date;
};
type Techstack = {
id: string;
name: string;
websiteUrl: string;
image: string | null;
description: string | null;
createdAt: Date;
updatedAt: Date;
};
type Screenshot = {
id: string;
image: string;
url: string;
createdAt: Date;
updatedAt: Date;
};
type Changelog = {
id: string;
version: String;
date: Date;
changes: string[];
createdAt: Date;
updatedAt: Date;
};
type Faq = {
id: string;
question: string;
answer: string;
createdAt: Date;
updatedAt: Date;
};
type Author = {
id: string;
name: string | null;
image: string | null;
};
type Post = {
id: string;
categoryId: string;
title: string;
slug: string;
coverImage: string;
tags: string[];
description: string;
content: string;
datePublished: Date;
showAuthor: boolean;
showTags: boolean;
showCommentCount: boolean;
showLikes: boolean;
showDescription: boolean;
createdAt: Date;
updatedAt: Date;
};
type Collection = {
id: string;
name: string;
displayType: string;
posts: TTPost[];
createdAt: Date;
updatedAt: Date;
};
type Category = {
id: string;
name: string;
_count: { posts: number };
};
type TCategory = {
name: string;
};
type TPost = Post & { category: TCategory };
type TTPost = Post & {
category: { id: string; name: string };
author: Author;
_count: { likes: number; comments: number };
};
type TCollection = Collection & { posts: Post[] };
type CollectionsPosts = {
collections: TCollection[];
posts: TPost[];
};