-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
89 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { | ||
ensure, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { getLogger } from "https://deno.land/[email protected]/log/mod.ts"; | ||
import { Response, ResponseWithBody } from "./types.ts"; | ||
import { Stringer } from "./types.ts"; | ||
import { ensure, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import { getLogger } from "jsr:@std/[email protected]"; | ||
import type { Response, ResponseWithBody } from "./types.ts"; | ||
import type { Stringer } from "./types.ts"; | ||
|
||
const API_URL = "https://api.docbase.io"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { fromUint8Array } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { encodeBase64 } from "jsr:@std/[email protected]"; | ||
|
||
export async function encode_content(filename: string) { | ||
return fromUint8Array(await Deno.readFile(filename)); | ||
return encodeBase64(await Deno.readFile(filename)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
|
||
export interface UploadAttachmentParams { | ||
name: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { isUserSummary, UserSummary } from "./user_summary.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
import { isUserSummary, type UserSummary } from "./user_summary.ts"; | ||
|
||
export interface CreateCommentParams { | ||
body: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
|
||
export interface GroupSummary { | ||
id: number; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { isUserSummary, UserSummary } from "./user_summary.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import { isUserSummary, type UserSummary } from "./user_summary.ts"; | ||
import { isGroupSummary } from "./group_summary.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { Stringer } from "../types.ts"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
import type { Stringer } from "../types.ts"; | ||
|
||
export interface CreateGroupParams { | ||
name: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
|
||
import { isTagSummary, TagSummary } from "./tags.ts"; | ||
import { isUserSummary, UserSummary } from "./user_summary.ts"; | ||
import { Comment, isComment } from "./comments.ts"; | ||
import { GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
import { Attachment, isAttachment } from "./attachments.ts"; | ||
import { Stringer } from "../types.ts"; | ||
import { isTagSummary, type TagSummary } from "./tags.ts"; | ||
import { isUserSummary, type UserSummary } from "./user_summary.ts"; | ||
import { type Comment, isComment } from "./comments.ts"; | ||
import { type GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
import { type Attachment, isAttachment } from "./attachments.ts"; | ||
import type { Stringer } from "../types.ts"; | ||
|
||
export type Scope = "everyone" | "group" | "private"; | ||
export const isScope = is.UnionOf([ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
import { type GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
|
||
export interface Profile { | ||
id: number; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
|
||
export interface Tag { | ||
id: number; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
|
||
export interface UserSummary { | ||
id: number; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
import { | ||
is, | ||
Predicate as P, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { Fetcher } from "../fetcher.ts"; | ||
import { GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
import { Stringer } from "../types.ts"; | ||
import { is, type Predicate as P } from "jsr:@core/[email protected]"; | ||
import type { Fetcher } from "../fetcher.ts"; | ||
import { type GroupSummary, isGroupSummary } from "./group_summary.ts"; | ||
import type { Stringer } from "../types.ts"; | ||
|
||
export type SearchUsersParams = { | ||
q?: string | undefined; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { ensureDir } from "https://deno.land/std@0.224.0/fs/mod.ts"; | ||
import { join } from "https://deno.land/std@0.224.0/path/mod.ts"; | ||
import { ensureDir } from "jsr:@std/[email protected]"; | ||
import { join } from "jsr:@std/[email protected]"; | ||
|
||
async function getCacheDirectoryName() { | ||
const localAppData = Deno.env.get("LOCALAPPDATA"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
// New Post Buffer | ||
|
||
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { execute } from "https://deno.land/x/[email protected]/helper/execute.ts"; | ||
import * as option from "https://deno.land/x/[email protected]/option/mod.ts"; | ||
import * as buffer from "https://deno.land/x/[email protected]/buffer/mod.ts"; | ||
import { ensure, is } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts"; | ||
import { getLogger } from "https://deno.land/[email protected].0/log/mod.ts"; | ||
import type { Denops } from "jsr:@denops/[email protected]"; | ||
import { execute } from "jsr:@denops/[email protected]/helper"; | ||
import * as option from "jsr:@denops/[email protected]/option"; | ||
import * as buffer from "jsr:@denops/[email protected]/buffer"; | ||
import { ensure, is } from "jsr:@core/unknownutil@3.18.1"; | ||
import { getLogger } from "jsr:@std/log@0.224.5"; | ||
|
||
import type { Post } from "../types.ts"; | ||
import type { CreatePostParams } from "../types.ts"; | ||
import { Client } from "../api/client.ts"; | ||
import { Filetype } from "./filetype.ts"; | ||
import { parsePostBufferLines, saveGroupsIntoPostBuffer } from "./post.ts"; | ||
import type { | ||
Buffer, | ||
Router, | ||
} from "https://denopkg.com/kyoh86/denops-router@master/mod.ts"; | ||
import type { Buffer, Router } from "jsr:@kyoh86/[email protected]"; | ||
import type { StateMan } from "../state.ts"; | ||
import { getbufline } from "https://deno.land/x/[email protected]/function/mod.ts"; | ||
import { getbufline } from "jsr:@denops/[email protected]/function"; | ||
|
||
const isNewPostParams = is.ObjectOf({ | ||
domain: is.String, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
// Single Post Buffer | ||
|
||
import { extract } from "https://deno.land/std@0.224.0/front_matter/yaml.ts"; | ||
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import * as buffer from "https://deno.land/x/[email protected]/buffer/mod.ts"; | ||
import * as option from "https://deno.land/x/[email protected]/option/mod.ts"; | ||
import * as variable from "https://deno.land/x/[email protected]/variable/variable.ts"; | ||
import { getbufline } from "https://deno.land/x/[email protected]/function/buffer.ts"; | ||
import { ensure, is } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts"; | ||
import { getLogger } from "https://deno.land/[email protected].0/log/mod.ts"; | ||
import { extractYaml } from "jsr:@std/[email protected]"; | ||
import type { Denops } from "jsr:@denops/[email protected]"; | ||
import * as buffer from "jsr:@denops/[email protected]/buffer"; | ||
import * as option from "jsr:@denops/[email protected]/option"; | ||
import * as variable from "jsr:@denops/[email protected]/variable"; | ||
import { getbufline } from "jsr:@denops/[email protected]/function"; | ||
import { ensure, is } from "jsr:@core/unknownutil@3.18.1"; | ||
import { getLogger } from "jsr:@std/log@0.224.5"; | ||
|
||
import { Filetype } from "./filetype.ts"; | ||
import type { Post as PostData, UpdatePostParams } from "../types.ts"; | ||
import { isGroupSummary } from "../types.ts"; | ||
import { Client } from "../api/client.ts"; | ||
import type { Buffer } from "https://denopkg.com/kyoh86/denops-router@master/mod.ts"; | ||
import type { Buffer } from "jsr:@kyoh86/denops-router@0.0.1"; | ||
import type { StateMan } from "../state.ts"; | ||
import { getCacheFile } from "../cache.ts"; | ||
|
||
|
@@ -245,7 +245,7 @@ export async function parsePostBufferLines( | |
draft: is.OptionalOf(is.Boolean), | ||
tags: is.OptionalOf(is.ArrayOf(is.String)), | ||
}; | ||
const content = extract(lines.join("\n")); | ||
const content = extractYaml(lines.join("\n")); | ||
const attr = ensure( | ||
content.attrs, | ||
is.UnionOf([ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
// Post List Buffer | ||
|
||
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import * as buffer from "https://deno.land/x/[email protected]/buffer/mod.ts"; | ||
import * as variable from "https://deno.land/x/[email protected]/variable/variable.ts"; | ||
import * as option from "https://deno.land/x/[email protected]/option/mod.ts"; | ||
import { batch } from "https://deno.land/x/[email protected]/batch/mod.ts"; | ||
import { getLogger } from "https://deno.land/[email protected].0/log/mod.ts"; | ||
import { ensure, is } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts"; | ||
import type { Denops } from "jsr:@denops/[email protected]"; | ||
import * as buffer from "jsr:@denops/[email protected]/buffer"; | ||
import * as variable from "jsr:@denops/[email protected]/variable"; | ||
import * as option from "jsr:@denops/[email protected]/option"; | ||
import { batch } from "jsr:@denops/[email protected]/batch"; | ||
import { getLogger } from "jsr:@std/log@0.224.5"; | ||
import { ensure, is } from "jsr:@core/unknownutil@3.18.1"; | ||
|
||
import { Filetype } from "./filetype.ts"; | ||
import { Client } from "../api/client.ts"; | ||
import { StateMan } from "../state.ts"; | ||
import type { | ||
Buffer, | ||
Router, | ||
} from "https://denopkg.com/kyoh86/denops-router@master/mod.ts"; | ||
import type { StateMan } from "../state.ts"; | ||
import type { Buffer, Router } from "jsr:@kyoh86/[email protected]"; | ||
|
||
export async function loadPostsList( | ||
denops: Denops, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
// Team List Buffer | ||
|
||
import type { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { batch } from "https://deno.land/x/[email protected]/batch/mod.ts"; | ||
import * as buffer from "https://deno.land/x/[email protected]/buffer/mod.ts"; | ||
import * as variable from "https://deno.land/x/[email protected]/variable/variable.ts"; | ||
import * as option from "https://deno.land/x/[email protected]/option/mod.ts"; | ||
import type { Denops } from "jsr:@denops/[email protected]"; | ||
import { batch } from "jsr:@denops/[email protected]/batch"; | ||
import * as buffer from "jsr:@denops/[email protected]/buffer"; | ||
import * as variable from "jsr:@denops/[email protected]/variable"; | ||
import * as option from "jsr:@denops/[email protected]/option"; | ||
|
||
import { ensure, is } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import type { | ||
Buffer, | ||
Router, | ||
} from "https://denopkg.com/kyoh86/denops-router@master/mod.ts"; | ||
import { ensure, is } from "jsr:@core/[email protected]"; | ||
import type { Buffer, Router } from "jsr:@kyoh86/[email protected]"; | ||
import { Filetype } from "./filetype.ts"; | ||
import { StateMan } from "../state.ts"; | ||
import type { StateMan } from "../state.ts"; | ||
|
||
export async function loadTeamsList( | ||
denops: Denops, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
import { Denops } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { | ||
echo, | ||
input, | ||
} from "https://deno.land/x/[email protected]/helper/mod.ts"; | ||
import type { Denops } from "jsr:@denops/[email protected]"; | ||
import { echo, input } from "jsr:@denops/[email protected]/helper"; | ||
import xdg from "https://deno.land/x/[email protected]/src/mod.deno.ts"; | ||
import { join } from "https://deno.land/std@0.224.0/path/mod.ts"; | ||
import { ensureFile } from "https://deno.land/std@0.224.0/fs/mod.ts"; | ||
import { ensure, is } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts"; | ||
import { join } from "jsr:@std/[email protected]"; | ||
import { ensureFile } from "jsr:@std/[email protected]"; | ||
import { ensure, is } from "jsr:@core/unknownutil@3.18.1"; | ||
import { | ||
ConsoleHandler, | ||
getLogger, | ||
RotatingFileHandler, | ||
setup, | ||
} from "https://deno.land/[email protected].0/log/mod.ts"; | ||
} from "jsr:@std/log@0.224.5"; | ||
|
||
import { isSearchPostsParams } from "./types.ts"; | ||
import { Client } from "./api/client.ts"; | ||
import { Router } from "https://denopkg.com/kyoh86/denops-router@master/mod.ts"; | ||
import { Router } from "jsr:@kyoh86/denops-router@0.0.1"; | ||
import { XDGStateMan } from "./state.ts"; | ||
|
||
import { loadTeamsList, openPostsList } from "./handler/teams_list.ts"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import xdg from "https://deno.land/x/[email protected]/src/mod.deno.ts"; | ||
import { join } from "https://deno.land/std@0.224.0/path/mod.ts"; | ||
import { ensureFile } from "https://deno.land/std@0.224.0/fs/mod.ts"; | ||
import { exists, expandGlob } from "https://deno.land/std@0.224.0/fs/mod.ts"; | ||
import { parse, stringify } from "https://deno.land/std@0.224.0/toml/mod.ts"; | ||
import { is, maybe } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts"; | ||
import { join } from "jsr:@std/[email protected]"; | ||
import { ensureFile } from "jsr:@std/[email protected]"; | ||
import { exists, expandGlob } from "jsr:@std/[email protected]"; | ||
import { parse, stringify } from "jsr:@std/[email protected]"; | ||
import { is, maybe } from "jsr:@core/unknownutil@3.18.1"; | ||
|
||
export type Domain = string; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { test } from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; | ||
import { test } from "jsr:@denops/[email protected]"; | ||
import { assert } from "jsr:@std/[email protected]"; | ||
|
||
test({ | ||
mode: "all", | ||
|