Skip to content

Commit f5f51e0

Browse files
authored
Merge pull request #60 from takker99:export-data
fix: Catch up with the response type from `https://scrapbox.io/api/page-data/export/:projectname.json`
2 parents f3536af + 5ea7094 commit f5f51e0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

response.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,16 @@ export interface SearchedTitle
301301

302302
/** exportしたときのページデータ */
303303
export interface ExportedPage<hasMetadata extends true | false = false>
304-
extends Pick<Page, "title" | "updated" | "created" | "id"> {
304+
extends Pick<Page, "title" | "updated" | "created" | "id" | "views"> {
305305
/** ページ本文
306306
*
307307
* `hasMetadata === true`のときは行のmetadataが入る
308308
* それ以外の場合は行のテキストが入る
309309
*/
310-
lines: hasMetadata extends true ? Omit<BaseLine, "id" | "userId">[]
311-
: string[];
310+
lines: hasMetadata extends true ? Omit<BaseLine, "id">[] : string[];
312311
}
313312

313+
/** JSON data exported from https://scrapbox.io/api/page-data/export/:projectname.json */
314314
export interface ExportedData<hasMetadata extends true | false = false> {
315315
/** project's name */
316316
name: string;
@@ -321,10 +321,17 @@ export interface ExportedData<hasMetadata extends true | false = false> {
321321
/** このデータを生成した日時 (UNIX時刻) */
322322
exported: UnixTime;
323323

324+
/** project members */
325+
users: UserForExport[];
326+
324327
/** exported pages */
325328
pages: ExportedPage<hasMetadata>[];
326329
}
327330

331+
/** user infomation included in exported data */
332+
export interface UserForExport
333+
extends Pick<UserInfo, "id" | "name" | "displayName" | "email"> {}
334+
328335
/** backupされるページデータ */
329336
export interface BackupedPage
330337
extends Pick<Page, "title" | "updated" | "created" | "id"> {

0 commit comments

Comments
 (0)