diff --git a/browser/websocket/patch.ts b/browser/websocket/patch.ts index cde51c4..dcd47d3 100644 --- a/browser/websocket/patch.ts +++ b/browser/websocket/patch.ts @@ -3,7 +3,7 @@ import { connect, disconnect } from "./socket.ts"; import { getProjectId, getUserId } from "./id.ts"; import { makeChanges } from "./makeChanges.ts"; import { HeadData, pull } from "./pull.ts"; -import type { Line } from "../../deps/scrapbox.ts"; +import type { Line } from "../../deps/scrapbox-rest.ts"; import { pushCommit, pushWithRetry } from "./_fetch.ts"; export interface PatchOptions { diff --git a/browser/websocket/pull.ts b/browser/websocket/pull.ts index e974137..58d4182 100644 --- a/browser/websocket/pull.ts +++ b/browser/websocket/pull.ts @@ -1,4 +1,4 @@ -import type { Line } from "../../deps/scrapbox.ts"; +import type { Line } from "../../deps/scrapbox-rest.ts"; import { getPage } from "../../rest/pages.ts"; export interface HeadData { diff --git a/deps/scrapbox-rest.ts b/deps/scrapbox-rest.ts new file mode 100644 index 0000000..e5cfbd2 --- /dev/null +++ b/deps/scrapbox-rest.ts @@ -0,0 +1,24 @@ +export type { + BadRequestError, + BaseLine as Line, + ErrorLike, + ExportedData, + GuestUser, + ImportedData, + InvalidURLError, + MemberProject, + MemberUser, + NoQueryError, + NotFoundError, + NotLoggedInError, + NotMemberError, + NotMemberProject, + NotPrivilegeError, + Page, + PageList, + ProjectSearchResult, + SearchedTitle, + SearchResult, + SessionError, + TweetInfo, +} from "https://raw.githubusercontent.com/scrapbox-jp/types/0.3.3/rest.ts"; diff --git a/deps/scrapbox.ts b/deps/scrapbox.ts index 0860b32..fdd09be 100644 --- a/deps/scrapbox.ts +++ b/deps/scrapbox.ts @@ -1,28 +1,5 @@ export type { - BadRequestError, - BaseLine as Line, - ErrorLike, - ExportedData, - GuestUser, - ImportedData, - InvalidURLError, - MemberProject, - MemberUser, - NoQueryError, - NotFoundError, - NotLoggedInError, - NotMemberError, - NotMemberProject, - NotPrivilegeError, - Page, - PageList, - ProjectSearchResult, - SearchedTitle, - SearchResult, - SessionError, - TweetInfo, -} from "https://raw.githubusercontent.com/scrapbox-jp/types/0.3.3/rest.ts"; -export type { + Line, Scrapbox, } from "https://raw.githubusercontent.com/scrapbox-jp/types/0.3.3/userscript.ts"; export type { diff --git a/is.ts b/is.ts index d32b173..eacc3b5 100644 --- a/is.ts +++ b/is.ts @@ -1,4 +1,4 @@ -import type { ErrorLike } from "./deps/scrapbox.ts"; +import type { ErrorLike } from "./deps/scrapbox-rest.ts"; // These code are based on https://deno.land/x/unknownutil@v1.1.0/is.ts export const isNone = (value: unknown): value is undefined | null => diff --git a/rest/getGyazoToken.ts b/rest/getGyazoToken.ts index 7489c2f..c354336 100644 --- a/rest/getGyazoToken.ts +++ b/rest/getGyazoToken.ts @@ -1,4 +1,4 @@ -import type { NotLoggedInError } from "../deps/scrapbox.ts"; +import type { NotLoggedInError } from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/getTweetInfo.ts b/rest/getTweetInfo.ts index 32c3499..13ed3f2 100644 --- a/rest/getTweetInfo.ts +++ b/rest/getTweetInfo.ts @@ -3,7 +3,7 @@ import type { InvalidURLError, SessionError, TweetInfo, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie, getCSRFToken } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/getWebPageTitle.ts b/rest/getWebPageTitle.ts index 1203ae3..9685ab4 100644 --- a/rest/getWebPageTitle.ts +++ b/rest/getWebPageTitle.ts @@ -2,7 +2,7 @@ import type { BadRequestError, InvalidURLError, SessionError, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie, getCSRFToken } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/link.ts b/rest/link.ts index 34c4457..36c9fc8 100644 --- a/rest/link.ts +++ b/rest/link.ts @@ -3,7 +3,7 @@ import type { NotFoundError, NotLoggedInError, SearchedTitle, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/page-data.ts b/rest/page-data.ts index 76996ea..910222d 100644 --- a/rest/page-data.ts +++ b/rest/page-data.ts @@ -5,7 +5,7 @@ import type { NotFoundError, NotLoggedInError, NotPrivilegeError, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie, getCSRFToken } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/pages.ts b/rest/pages.ts index 361a17f..5955851 100644 --- a/rest/pages.ts +++ b/rest/pages.ts @@ -4,7 +4,7 @@ import type { NotMemberError, Page, PageList, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/profile.ts b/rest/profile.ts index 8bddc5d..b688006 100644 --- a/rest/profile.ts +++ b/rest/profile.ts @@ -1,4 +1,4 @@ -import type { GuestUser, MemberUser } from "../deps/scrapbox.ts"; +import type { GuestUser, MemberUser } from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { BaseOptions, setDefaults } from "./util.ts"; import { UnexpectedResponseError } from "./error.ts"; diff --git a/rest/project.ts b/rest/project.ts index c407c35..70cc96f 100644 --- a/rest/project.ts +++ b/rest/project.ts @@ -4,7 +4,7 @@ import type { NotLoggedInError, NotMemberError, NotMemberProject, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/replaceLinks.ts b/rest/replaceLinks.ts index 8fba580..0627987 100644 --- a/rest/replaceLinks.ts +++ b/rest/replaceLinks.ts @@ -2,7 +2,7 @@ import type { NotFoundError, NotLoggedInError, NotMemberError, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie, getCSRFToken } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts"; diff --git a/rest/search.ts b/rest/search.ts index 06f7fdb..d5a8d23 100644 --- a/rest/search.ts +++ b/rest/search.ts @@ -5,7 +5,7 @@ import type { NotMemberError, ProjectSearchResult, SearchResult, -} from "../deps/scrapbox.ts"; +} from "../deps/scrapbox-rest.ts"; import { cookie } from "./auth.ts"; import { UnexpectedResponseError } from "./error.ts"; import { tryToErrorLike } from "../is.ts";