Skip to content

Commit 3314a9c

Browse files
authored
Merge pull request #73 from takker99/page-list
fix(api): Keep up with the schema of `/api/pages/:projectname`
2 parents 8d8e0eb + 39f7908 commit 3314a9c

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

api/pages/project.ts

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { BasePage } from "../../base.ts";
1+
import type { CommitId, PageId, UnixTime, UserId } from "../../base.ts";
22

33
/** the response type of https://scrpabox.io/api/pages/:projectname */
44
export interface PageList {
@@ -15,5 +15,70 @@ export interface PageList {
1515
count: number;
1616

1717
/** 取得できたページ情報 */
18-
pages: BasePage[];
18+
pages: PageSummery[];
19+
}
20+
21+
/** a page summery included in {@linkcode PageList} */
22+
export interface PageSummery {
23+
/** page id */
24+
id: PageId;
25+
26+
/** 最新の編集コミットid */
27+
commitId: CommitId;
28+
29+
/** the title of a page */
30+
title: string;
31+
32+
/** the thumbnail URL of a page if exists
33+
*
34+
* set to `null` if not exists
35+
*/
36+
image: string | null;
37+
38+
/** the thumbnail text of a page.
39+
*
40+
* the maximum number of lines is 5.
41+
*/
42+
descriptions: string[];
43+
44+
/** the user who created the page (maybe) */
45+
user: {
46+
id: UserId;
47+
};
48+
49+
/** the user who last updated the page (maybe) */
50+
lastUpdateUser: {
51+
id: UserId;
52+
};
53+
54+
/** ピン留めの状態を表す数値
55+
*
56+
* - 0: ピンされてない
57+
* - 0以外: ピンされている
58+
*/
59+
pin: number;
60+
61+
/** ページの作成日時 */
62+
created: UnixTime;
63+
64+
/** ページの最終更新日時 */
65+
updated: UnixTime;
66+
67+
/** Date last visitedに使われる最終アクセス日時 */
68+
accessed: UnixTime;
69+
70+
/** ページの閲覧回数 */
71+
views: number;
72+
73+
/** 被リンク数 */
74+
linked: number;
75+
76+
/** The total number of lines in the page */
77+
linesCount: number;
78+
79+
/** The total number of characters in the page */
80+
charsCount: number;
81+
82+
/** The list of helpfeel notations in the page */
83+
helpfeels: string[];
1984
}

0 commit comments

Comments
 (0)