From 39f7908285094bafa7f1bb5237873ad751f943a2 Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Sun, 3 Aug 2025 17:51:22 +0900 Subject: [PATCH] fix(api): Keep up with the schema of `/api/pages/:projectname` --- api/pages/project.ts | 69 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/api/pages/project.ts b/api/pages/project.ts index cf850b1..4ee9d5c 100644 --- a/api/pages/project.ts +++ b/api/pages/project.ts @@ -1,4 +1,4 @@ -import type { BasePage } from "../../base.ts"; +import type { CommitId, PageId, UnixTime, UserId } from "../../base.ts"; /** the response type of https://scrpabox.io/api/pages/:projectname */ export interface PageList { @@ -15,5 +15,70 @@ export interface PageList { count: number; /** 取得できたページ情報 */ - pages: BasePage[]; + pages: PageSummery[]; +} + +/** a page summery included in {@linkcode PageList} */ +export interface PageSummery { + /** page id */ + id: PageId; + + /** 最新の編集コミットid */ + commitId: CommitId; + + /** the title of a page */ + title: string; + + /** the thumbnail URL of a page if exists + * + * set to `null` if not exists + */ + image: string | null; + + /** the thumbnail text of a page. + * + * the maximum number of lines is 5. + */ + descriptions: string[]; + + /** the user who created the page (maybe) */ + user: { + id: UserId; + }; + + /** the user who last updated the page (maybe) */ + lastUpdateUser: { + id: UserId; + }; + + /** ピン留めの状態を表す数値 + * + * - 0: ピンされてない + * - 0以外: ピンされている + */ + pin: number; + + /** ページの作成日時 */ + created: UnixTime; + + /** ページの最終更新日時 */ + updated: UnixTime; + + /** Date last visitedに使われる最終アクセス日時 */ + accessed: UnixTime; + + /** ページの閲覧回数 */ + views: number; + + /** 被リンク数 */ + linked: number; + + /** The total number of lines in the page */ + linesCount: number; + + /** The total number of characters in the page */ + charsCount: number; + + /** The list of helpfeel notations in the page */ + helpfeels: string[]; }