feat: wire public posts api
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
export type PostLocaleCode = "zh" | "en" | "ja" | "ko" | "vi" | "id" | "ms";
|
||||
|
||||
export type PostType =
|
||||
| "image"
|
||||
| "video"
|
||||
| "music"
|
||||
| "ppt"
|
||||
| "pdf"
|
||||
| "link"
|
||||
| "text"
|
||||
| "archive";
|
||||
|
||||
export type PostTypeFilter = PostType | "all";
|
||||
export type AttachmentKind = "image" | "video" | "document";
|
||||
|
||||
export type PostLocaleTexts = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type PostLocalizations = Record<PostLocaleCode, PostLocaleTexts>;
|
||||
|
||||
export type Attachment = {
|
||||
id: string;
|
||||
kind: AttachmentKind;
|
||||
@@ -16,14 +35,19 @@ export type Attachment = {
|
||||
|
||||
export type Post = {
|
||||
id: string;
|
||||
postType?: PostType | string;
|
||||
categoryId: number;
|
||||
categorySlug: string;
|
||||
language: string;
|
||||
sourceLanguage?: string;
|
||||
text?: string;
|
||||
localizations?: Partial<PostLocalizations>;
|
||||
attachments: Attachment[];
|
||||
isRecommended: boolean;
|
||||
publishedAt: string;
|
||||
updatedAt: string;
|
||||
updatedAt?: string;
|
||||
createdAt?: string;
|
||||
tags?: string[];
|
||||
};
|
||||
|
||||
export type PostListResponse = {
|
||||
@@ -31,4 +55,8 @@ export type PostListResponse = {
|
||||
nextCursor?: string;
|
||||
};
|
||||
|
||||
export type PostDownloadResponse = {
|
||||
ok: true;
|
||||
};
|
||||
|
||||
export type PostScope = { kind: "all" } | { kind: "category"; slug: string };
|
||||
|
||||
Reference in New Issue
Block a user