summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author日高 凌 <ryo.hi.19971219@gmail.com>2023-02-11 07:55:29 +0900
committerGitHub <noreply@github.com>2023-02-11 07:55:29 +0900
commit13a2d16eab8637b6250396548619cd2cdf80a3c3 (patch)
tree0ef341588bff6f7f2b728481d4a69f8fad229a30
parent0.0.15 (diff)
downloadsharkey-13a2d16eab8637b6250396548619cd2cdf80a3c3.tar.gz
sharkey-13a2d16eab8637b6250396548619cd2cdf80a3c3.tar.bz2
sharkey-13a2d16eab8637b6250396548619cd2cdf80a3c3.zip
feat: add type of gallery (#55)
* update GalleryPost type * update gallery/featured type * update gallery/popular type * update gallery/posts type * update gallery/posts/create type * update gallery/posts/like type * update gallery/posts/show type * update gallery/posts/unlike type * update gallery/posts/update type
-rw-r--r--etc/misskey-js.api.md68
-rw-r--r--src/api.types.ts16
-rw-r--r--src/entities.ts15
3 files changed, 73 insertions, 26 deletions
diff --git a/etc/misskey-js.api.md b/etc/misskey-js.api.md
index a2cbb0c2ec..ad5d1bc4be 100644
--- a/etc/misskey-js.api.md
+++ b/etc/misskey-js.api.md
@@ -1177,20 +1177,29 @@ export type Endpoints = {
res: null;
};
'gallery/featured': {
- req: TODO;
- res: TODO;
+ req: null;
+ res: GalleryPost[];
};
'gallery/popular': {
- req: TODO;
- res: TODO;
+ req: null;
+ res: GalleryPost[];
};
'gallery/posts': {
- req: TODO;
- res: TODO;
+ req: {
+ limit?: number;
+ sinceId?: GalleryPost['id'];
+ untilId?: GalleryPost['id'];
+ };
+ res: GalleryPost[];
};
'gallery/posts/create': {
- req: TODO;
- res: TODO;
+ req: {
+ title: GalleryPost['title'];
+ description?: GalleryPost['description'];
+ fileIds: GalleryPost['fileIds'];
+ isSensitive?: GalleryPost['isSensitive'];
+ };
+ res: GalleryPost;
};
'gallery/posts/delete': {
req: {
@@ -1199,20 +1208,32 @@ export type Endpoints = {
res: null;
};
'gallery/posts/like': {
- req: TODO;
- res: TODO;
+ req: {
+ postId: GalleryPost['id'];
+ };
+ res: null;
};
'gallery/posts/show': {
- req: TODO;
- res: TODO;
+ req: {
+ postId: GalleryPost['id'];
+ };
+ res: GalleryPost;
};
'gallery/posts/unlike': {
- req: TODO;
- res: TODO;
+ req: {
+ postId: GalleryPost['id'];
+ };
+ res: null;
};
'gallery/posts/update': {
- req: TODO;
- res: TODO;
+ req: {
+ postId: GalleryPost['id'];
+ title: GalleryPost['title'];
+ description?: GalleryPost['description'];
+ fileIds: GalleryPost['fileIds'];
+ isSensitive?: GalleryPost['isSensitive'];
+ };
+ res: GalleryPost;
};
'games/reversi/games': {
req: TODO;
@@ -2224,7 +2245,20 @@ type FollowRequest = {
};
// @public (undocumented)
-type GalleryPost = TODO_2;
+type GalleryPost = {
+ id: ID;
+ createdAt: DateString;
+ updatedAt: DateString;
+ userId: User['id'];
+ user: User;
+ title: string;
+ description: string | null;
+ fileIds: DriveFile['id'][];
+ files: DriveFile[];
+ isSensitive: boolean;
+ likedCount: number;
+ isLiked?: boolean;
+};
// @public (undocumented)
type ID = string;
diff --git a/src/api.types.ts b/src/api.types.ts
index 2a08af7d64..4fbf42f917 100644
--- a/src/api.types.ts
+++ b/src/api.types.ts
@@ -317,15 +317,15 @@ export type Endpoints = {
'following/requests/reject': { req: { userId: User['id'] }; res: null; };
// gallery
- 'gallery/featured': { req: TODO; res: TODO; };
- 'gallery/popular': { req: TODO; res: TODO; };
- 'gallery/posts': { req: TODO; res: TODO; };
- 'gallery/posts/create': { req: TODO; res: TODO; };
+ 'gallery/featured': { req: null; res: GalleryPost[]; };
+ 'gallery/popular': { req: null; res: GalleryPost[]; };
+ 'gallery/posts': { req: { limit?: number; sinceId?: GalleryPost['id']; untilId?: GalleryPost['id']; }; res: GalleryPost[]; };
+ 'gallery/posts/create': { req: { title: GalleryPost['title']; description?: GalleryPost['description']; fileIds: GalleryPost['fileIds']; isSensitive?: GalleryPost['isSensitive'] }; res: GalleryPost; };
'gallery/posts/delete': { req: { postId: GalleryPost['id'] }; res: null; };
- 'gallery/posts/like': { req: TODO; res: TODO; };
- 'gallery/posts/show': { req: TODO; res: TODO; };
- 'gallery/posts/unlike': { req: TODO; res: TODO; };
- 'gallery/posts/update': { req: TODO; res: TODO; };
+ 'gallery/posts/like': { req: { postId: GalleryPost['id'] }; res: null; };
+ 'gallery/posts/show': { req: { postId: GalleryPost['id'] }; res: GalleryPost; };
+ 'gallery/posts/unlike': { req: { postId: GalleryPost['id'] }; res: null; };
+ 'gallery/posts/update': { req: { postId: GalleryPost['id']; title: GalleryPost['title']; description?: GalleryPost['description']; fileIds: GalleryPost['fileIds']; isSensitive?: GalleryPost['isSensitive'] }; res: GalleryPost; };
// games
'games/reversi/games': { req: TODO; res: TODO; };
diff --git a/src/entities.ts b/src/entities.ts
index 7acffa32e7..37a8bc6184 100644
--- a/src/entities.ts
+++ b/src/entities.ts
@@ -123,7 +123,20 @@ export type DriveFile = {
export type DriveFolder = TODO;
-export type GalleryPost = TODO;
+export type GalleryPost = {
+ id: ID;
+ createdAt: DateString;
+ updatedAt: DateString;
+ userId: User['id'];
+ user: User;
+ title: string;
+ description: string | null;
+ fileIds: DriveFile['id'][];
+ files: DriveFile[];
+ isSensitive: boolean;
+ likedCount: number;
+ isLiked?: boolean;
+};
export type Note = {
id: ID;