Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:recycle: Migrate sync API contracts https://github.com/siyuan-note/siyuan/issues/19378

Daniel8a193b2febdb
diff --git a/app/src/config/tabs/syncRuntime.ts b/app/src/config/tabs/syncRuntime.ts
index d64b3b96d6..0d93500f24 100644
--- a/app/src/config/tabs/syncRuntime.ts
+++ b/app/src/config/tabs/syncRuntime.ts
@@ -37,7 +37,7 @@ const setSyncAssetDownloadMode = async (mode: Config.ISync["assetDownloadMode"])
}, 300);
try {
const response = await fetchSyncPost("/api/sync/setSyncAssetDownloadMode", {mode});
- if (response.code === 0) {
+ if (response.code === 0 && (response.data.assetDownloadMode === 0 || response.data.assetDownloadMode === 1)) {
window.siyuan.config.sync.assetDownloadMode = response.data.assetDownloadMode;
}
} catch (error) {
diff --git a/app/src/config/tabs/syncUi.ts b/app/src/config/tabs/syncUi.ts
index 69bebd16e5..63f2a1a5f3 100644
--- a/app/src/config/tabs/syncUi.ts
+++ b/app/src/config/tabs/syncUi.ts
@@ -1,5 +1,7 @@
import {showMessage} from "../../dialog/message";
import {fetchPost, fetchSyncPost} from "../../util/fetch";
+import {ContractFormData} from "../../util/contractFormData";
+import type {APICallbackResponse, APIPOSTRoutes} from "../../types/api";
import {confirmDialog} from "../../dialog/confirmDialog";
import {isInIOS, saveExportFile} from "../../protyle/util/compatibility";
import {isPaidUser, needSubscribe} from "../../util/needSubscribe";
@@ -362,11 +364,10 @@ const bindProviderConfigEvent = (configElement: Element, root: Element) => {
if (!getHostCapabilities().importExport) {
return;
}
- const formData = new FormData();
- formData.append("file", importElement.files[0]);
+ const formData = new ContractFormData({file: importElement.files[0]});
const isS3 = importElement.getAttribute("data-type") === "s3";
- fetchPost(isS3 ? "/api/sync/importSyncProviderS3" : "/api/sync/importSyncProviderWebDAV", formData, (response) => {
- if (isS3) {
+ fetchPost(isS3 ? "/api/sync/importSyncProviderS3" : "/api/sync/importSyncProviderWebDAV", formData, (response: APICallbackResponse<APIPOSTRoutes["/api/sync/importSyncProviderS3" | "/api/sync/importSyncProviderWebDAV"]["response"]>) => {
+ if ("s3" in response.data) {
window.siyuan.config.sync.s3 = response.data.s3;
} else {
window.siyuan.config.sync.webdav = response.data.webdav;
diff --git a/app/src/menus/dataMigration.ts b/app/src/menus/dataMigration.ts
index 7ffd04d4ac..6a7bf61026 100644
--- a/app/src/menus/dataMigration.ts
+++ b/app/src/menus/dataMigration.ts
@@ -2,6 +2,8 @@ import {Dialog} from "../dialog";
import {Constants} from "../constants";
import {escapeHtml} from "../util/escape";
import {fetchPost} from "../util/fetch";
+import {ContractFormData} from "../util/contractFormData";
+import type {APICallbackResponse, APIPOSTRoutes} from "../types/api";
import {confirmDialog} from "../dialog/confirmDialog";
import {showMessage} from "../dialog/message";
import {importObsidianVault} from "./importObsidian";
@@ -281,8 +283,8 @@ export const openDataMigration = (options: IDataMigrationOptions = {}) => {
bindFileInput(provider, (file, input) => {
input.value = "";
const isS3 = provider === "s3";
- postFile(isS3 ? "/api/sync/importSyncProviderS3" : "/api/sync/importSyncProviderWebDAV", file, {}, (response) => {
- if (isS3) {
+ fetchPost(isS3 ? "/api/sync/importSyncProviderS3" : "/api/sync/importSyncProviderWebDAV", new ContractFormData({file}), (response: APICallbackResponse<APIPOSTRoutes["/api/sync/importSyncProviderS3" | "/api/sync/importSyncProviderWebDAV"]["response"]>) => {
+ if ("s3" in response.data) {
window.siyuan.config.sync.s3 = response.data.s3;
} else {
window.siyuan.config.sync.webdav = response.data.webdav;
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index a81bcc5e1d..cc1078310a 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -220,6 +220,10 @@ export type CloudSpaceData = { "backup": CloudBackup | null; "hAssetSize": strin
export type CloudSync = { "cloudName": string; "hSize": string; "saveDir": string; "size": number; "updated": string; };
+export type CloudSyncDir = { "cloudName": string; "hSize": string; "saveDir": string; "size": number; "updated": string; };
+
+export type CloudSyncDirsData = { "checkedSyncDir": string; "hSize": string; "syncDirs": Array<CloudSyncDir | null> | null; };
+
export type ContentWordCountRequestInput = { "content": string; "reqId"?: JSONValue | null; };
export type ContinueImportSYRequestInput = { "notebook": string; "token": string; };
@@ -578,6 +582,8 @@ export type PandocData = { "path": string; };
export type PandocRequestInput = { "args": Array<string>; "dir"?: string | null; };
+export type PerformSyncRequestInput = { "mobileSwitch"?: boolean | null; "upload"?: boolean; };
+
export type Petal = { "css": string; "disabledInPublish": boolean; "disallowInstall": boolean; "displayName": string; "enabled": boolean; "i18n": { [key: string]: JSONValue } | null; "incompatible": boolean; "js": string; "kernel": KernelPetal; "name": string; "userDisabledInPublish": boolean; "version": string; };
export type PinnedDoc = { "childrenSortMode": number | null; "icon": string; "id": string; "name": string; "notebook": string; "path": string; "subFileCount": number; "unavailable": boolean; };
@@ -746,6 +752,12 @@ export type SetSnapshotMemoRequestInput = { "id": string; "memo": string; };
export type SetSnippetRequestInput = { "snippets": Array<SnippetInput>; };
+export type SetSyncLocalRequestInput = { "local": SyncLocalInput; };
+
+export type SetSyncS3RequestInput = { "s3": SyncS3Input; };
+
+export type SetSyncWebDAVRequestInput = { "webdav": SyncWebDAVInput; };
+
export type Shorthand = { "hCreated": string; "oId": string; "shorthandContent": string; "shorthandDesc": string; "shorthandFrom": number; "shorthandMd": string; "shorthandTitle": string; "shorthandURL": string; };
export type ShorthandPage = { "pagination": ShorthandPagination; "shorthands": Array<Shorthand | null>; };
@@ -776,6 +788,48 @@ export type StorageSetRequestInput = { "app"?: string | null; "key": string; "va
export type SwapBlockRefRequestInput = { "defID": string; "includeChildren": boolean; "refID": string; };
+export type SyncAssetDownloadModeData = { "assetDownloadMode": number; };
+
+export type SyncEnabledRequestInput = { "enabled": boolean; };
+
+export type SyncInfoData = { "kernel": string; "kernels": Array<SyncOnlineKernel | null> | null; "stat": string; "synced": number; };
+
+export type SyncIntervalRequestInput = { "interval": number; };
+
+export type SyncLANRequestInput = { "enabled": boolean; "maxConcurrentReqs"?: number | null; };
+
+export type SyncLANStatus = { "active": boolean; "connectedPeers": number; "discoveredPeers": number; "enabled": boolean; "maxConcurrentReqs": number; };
+
+export type SyncLocal = { "concurrentReqs": number; "endpoint": string; "timeout": number; };
+
+export type SyncLocalData = { "local": SyncLocal | null; };
+
+export type SyncLocalInput = { "concurrentReqs"?: number | null; "endpoint"?: string | null; "timeout"?: number | null; };
+
+export type SyncModeRequestInput = { "mode": number; };
+
+export type SyncNameRequestInput = { "name": string; };
+
+export type SyncOnlineKernel = { "hostname": string; "id": string; "os": string; "ver": string; };
+
+export type SyncProviderExportData = { "name": string; "zip": string; };
+
+export type SyncProviderImportRequestInput = { "file"?: Blob; };
+
+export type SyncProviderRequestInput = { "provider": number; };
+
+export type SyncS3 = { "accessKey": string; "bucket": string; "concurrentReqs": number; "endpoint": string; "pathStyle": boolean; "region": string; "secretKey": string; "skipTlsVerify": boolean; "timeout": number; };
+
+export type SyncS3Data = { "s3": SyncS3 | null; };
+
+export type SyncS3Input = { "accessKey"?: string | null; "bucket"?: string | null; "concurrentReqs"?: number | null; "endpoint"?: string | null; "pathStyle"?: boolean | null; "region"?: string | null; "secretKey"?: string | null; "skipTlsVerify"?: boolean | null; "timeout"?: number | null; };
+
+export type SyncWebDAV = { "concurrentReqs": number; "endpoint": string; "password": string; "skipTlsVerify": boolean; "timeout": number; "username": string; };
+
+export type SyncWebDAVData = { "webdav": SyncWebDAV | null; };
+
+export type SyncWebDAVInput = { "concurrentReqs"?: number | null; "endpoint"?: string | null; "password"?: string | null; "skipTlsVerify"?: boolean | null; "timeout"?: number | null; "username"?: string | null; };
+
export type TagData = { "children": Array<TagData | null> | null; "count": number; "depth": number; "label": string; "name": string; "type": string; };
export type TailChildBlocksRequestInput = { "id": string; "ids"?: Array<string> | null; "n"?: number | null; "notebook"?: string | null; };
@@ -1152,30 +1206,6 @@ export type APILegacyPOSTPath =
"/api/setting/setSnippet" |
"/api/setting/setTheme" |
"/api/setting/setVariables" |
- "/api/sync/createCloudSyncDir" |
- "/api/sync/exportSyncProviderS3" |
- "/api/sync/exportSyncProviderWebDAV" |
- "/api/sync/getBootSync" |
- "/api/sync/getSyncInfo" |
- "/api/sync/getSyncLANStatus" |
- "/api/sync/importSyncProviderS3" |
- "/api/sync/importSyncProviderWebDAV" |
- "/api/sync/listCloudSyncDir" |
- "/api/sync/performBootSync" |
- "/api/sync/performSync" |
- "/api/sync/removeCloudSyncDir" |
- "/api/sync/setCloudSyncDir" |
- "/api/sync/setSyncAssetDownloadMode" |
- "/api/sync/setSyncEnable" |
- "/api/sync/setSyncGenerateConflictDoc" |
- "/api/sync/setSyncInterval" |
- "/api/sync/setSyncLAN" |
- "/api/sync/setSyncMode" |
- "/api/sync/setSyncPerception" |
- "/api/sync/setSyncProvider" |
- "/api/sync/setSyncProviderLocal" |
- "/api/sync/setSyncProviderS3" |
- "/api/sync/setSyncProviderWebDAV" |
"/api/system/addCustomEmoji" |
"/api/system/checkUpdate" |
"/api/system/checkWorkspaceDir" |
@@ -2559,6 +2589,126 @@ export interface APIPOSTRoutes {
response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
body: "json";
};
+ "/api/sync/createCloudSyncDir": {
+ request: SyncNameRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/exportSyncProviderS3": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": SyncProviderExportData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/exportSyncProviderWebDAV": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": SyncProviderExportData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/getBootSync": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/getSyncInfo": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": SyncInfoData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/getSyncLANStatus": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": SyncLANStatus; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/importSyncProviderS3": {
+ request: SyncProviderImportRequestInput;
+ response: { "code": 0; "data": SyncS3Data; "msg": string; } | { "code": -1; "data": ({ "closeTimeout": number; } & { "s3"?: never; }) | null | (SyncS3Data & { "closeTimeout"?: never; }); "msg": string; };
+ body: "multipart";
+ };
+ "/api/sync/importSyncProviderWebDAV": {
+ request: SyncProviderImportRequestInput;
+ response: { "code": 0; "data": SyncWebDAVData; "msg": string; } | { "code": -1; "data": ({ "closeTimeout": number; } & { "webdav"?: never; }) | null | (SyncWebDAVData & { "closeTimeout"?: never; }); "msg": string; };
+ body: "multipart";
+ };
+ "/api/sync/listCloudSyncDir": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": CloudSyncDirsData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/performBootSync": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/sync/performSync": {
+ request: PerformSyncRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/removeCloudSyncDir": {
+ request: SyncNameRequestInput;
+ response: { "code": 0; "data": string; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setCloudSyncDir": {
+ request: SyncNameRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncAssetDownloadMode": {
+ request: SyncModeRequestInput;
+ response: { "code": 0; "data": SyncAssetDownloadModeData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncEnable": {
+ request: SyncEnabledRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncGenerateConflictDoc": {
+ request: SyncEnabledRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncInterval": {
+ request: SyncIntervalRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncLAN": {
+ request: SyncLANRequestInput;
+ response: { "code": 0; "data": SyncLANStatus; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncMode": {
+ request: SyncModeRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncPerception": {
+ request: SyncEnabledRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncProvider": {
+ request: SyncProviderRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncProviderLocal": {
+ request: SetSyncLocalRequestInput;
+ response: { "code": 0; "data": SyncLocalData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncProviderS3": {
+ request: SetSyncS3RequestInput;
+ response: { "code": 0; "data": SyncS3Data; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/sync/setSyncProviderWebDAV": {
+ request: SetSyncWebDAVRequestInput;
+ response: { "code": 0; "data": SyncWebDAVData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
"/api/system/addMicrosoftDefenderExclusion": {
request: EmptyRequestInput;
response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
diff --git a/app/tests/api-contract.types.ts b/app/tests/api-contract.types.ts
index 3c98682bb6..c5dd2deb21 100644
--- a/app/tests/api-contract.types.ts
+++ b/app/tests/api-contract.types.ts
@@ -6,6 +6,17 @@ declare const fetchGet: FetchGet;
declare const fetchSyncPost: FetchSyncPost;
declare const dynamicURL: string;
+fetchPost("/api/sync/setSyncLAN", {enabled: true, maxConcurrentReqs: 2.5}, response => {
+ const peers: number = response.data.connectedPeers;
+ void peers;
+});
+fetchPost("/api/sync/setSyncProviderS3", {s3: {endpoint: "https://example.invalid", pathStyle: true}});
+// @ts-expect-error 同步开关只接受布尔值。
+fetchPost("/api/sync/setSyncEnable", {enabled: "true"});
+// @ts-expect-error 同步配置中的超时不是字符串。
+fetchPost("/api/sync/setSyncProviderS3", {s3: {timeout: "30"}});
+fetchPost("/api/sync/importSyncProviderWebDAV", new ContractFormData({file: new Blob()}));
+
fetchPost("/api/bazaar/getBazaarPackageRating", {packageType: "plugin", packageName: "example"}, response => {
if (response.data && "rating" in response.data && response.data.rating) {
const distribution: [number, number, number, number, number] = response.data.rating.distribution;
diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.md
index c6c0710604..05a9681262 100644
--- a/docs/API-CONTRACTS.md
+++ b/docs/API-CONTRACTS.md
@@ -24,6 +24,8 @@ Encrypted notebook lifecycle endpoints use typed requests and responses while re
## Compatibility requirements
+Sync contracts retain numeric truncation, conditional direction validation in manual mode, configuration field matching and JSON numeric normalization, and message display durations. Provider imports require exactly one file and preserve encrypted package contents and recovery paths. Authorization and read-only checks still precede body decoding; synchronization and notebook encryption remain in the model layer.
+
Marketplace contracts retain required-field ordering, whitespace handling, theme mode dependencies, rating availability and rate-limit payloads, and local-package upload errors. Package and appearance responses declare their complete nested structures, including the fixed five-element rating distribution. Upload requests keep first-file selection and overwrite parsing. Installation, removal, authentication, and publish restrictions remain in the existing business handlers and middleware.
Plugin information queries retain path, query-string, and JSON-body name precedence, including whitespace and business error codes 1 through 4. URL parameters bypass body decoding, and list queries ignore the body. Plugin and RPC-method lists retain nullable arrays and entries. HTTP JSON-RPC has a separate contract for single and batch requests, success and error replies, and notification-only HTTP 204 responses. Plugin admission occurs before body reads, batch errors retain their order, and arbitrary JSON is limited to RPC parameters, results, and error details. RPC WebSocket routes declare HTTP 101 upgrades, HTTP 404 plugin admission errors, HTTP 400 text rejections, and separate incoming calls and outgoing replies or notifications. Origin authorization and connection cleanup remain in the existing upgrade lifecycle. Plugin HTTP services remain a separate protocol migration.
diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.md
index 4d36e4b57b..781f962f72 100644
--- a/docs/API-CONTRACTS.zh-CN.md
+++ b/docs/API-CONTRACTS.zh-CN.md
@@ -24,6 +24,8 @@
## 兼容要求
+同步契约保留数值截断、手动模式下的条件方向校验、配置字段匹配与 JSON 数字归一化,以及消息显示时长。同步配置导入要求恰好一个文件,并保留加密包内容与恢复路径。鉴权及只读检查仍先于请求体解码,同步和笔记本加密继续由模型层处理。
+
集市契约保留必填字段的校验顺序、空白处理、主题模式联动、评分可用性和限流载荷,以及本地包上传错误。包和外观响应声明完整嵌套结构,包括固定五项的评分分布。上传请求保留首文件选择及覆盖参数解析。安装、卸载、鉴权和发布限制仍由既有业务处理函数及中间件执行。
插件信息查询保留路径参数、查询参数和 JSON 请求体中名称的优先级,包括空白及业务错误码 1 至 4。命中 URL 参数时不解析请求体,列表查询忽略请求体。插件列表与 RPC 方法列表保留数组及数组元素的空值语义。HTTP JSON-RPC 使用独立契约描述单次与批量请求、成功与错误回复,以及纯通知请求的 HTTP 204 响应。插件准入先于请求体读取,批量错误保留原有顺序,任意 JSON 仅用于 RPC 参数、返回值和错误详情。RPC WebSocket 路由声明 HTTP 101 升级、HTTP 404 插件准入错误、HTTP 400 文本拒绝,以及独立的入站调用和出站回复或通知。Origin 授权与连接清理保留在既有升级生命周期中。插件 HTTP 服务仍需单独迁移。
diff --git a/kernel/api/contract_sync_test.go b/kernel/api/contract_sync_test.go
new file mode 100644
index 0000000000..ef749d84ec
--- /dev/null
+++ b/kernel/api/contract_sync_test.go
@@ -0,0 +1,334 @@
+package api
+
+import (
+ archivezip "archive/zip"
+ "bytes"
+ "encoding/hex"
+ "encoding/json"
+ "io"
+ "mime/multipart"
+ "net/http/httptest"
+ "os"
+ "path/filepath"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/88250/gulu"
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/conf"
+ "github.com/siyuan-note/siyuan/kernel/model"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func syncTestConfiguration(t *testing.T) {
+ t.Helper()
+ previous, previousReadonly, previousTemp := model.Conf, util.ReadOnly, util.TempDir
+ model.Conf = model.NewAppConf()
+ model.Conf.Sync = conf.NewSync()
+ model.Conf.Sync.S3 = &conf.S3{}
+ model.Conf.Sync.WebDAV = &conf.WebDAV{}
+ util.ReadOnly = true
+ util.TempDir = t.TempDir()
+ t.Cleanup(func() { model.Conf, util.ReadOnly, util.TempDir = previous, previousReadonly, previousTemp })
+}
+
+func TestAPIContractSyncScalarDecodeCompatibility(t *testing.T) {
+ compareSyncDecode(t, apicontract.SetSyncEnable, "enabled", true, false, []string{`{}`, `null`, `[]`, `1`, `"text"`, ``, `{`, `{"enabled":null}`, `{"enabled":0}`, `{"enabled":true}`, `{"enabled":false}`, `{"enabled":true,"unused":1e1000}`, `{"enabled":true} {`}, func(r apicontract.SyncEnabledRequest) bool { return r.Enabled })
+ compareSyncDecode(t, apicontract.SetSyncInterval, "interval", true, false, []string{`{}`, `{"interval":null}`, `{"interval":"1"}`, `{"interval":31.9}`, `{"interval":-1}`, `{"interval":1.0}`, `{"interval":1,"interval":32}`, `{"interval":1e1000}`}, func(r apicontract.SyncIntervalRequest) float64 { return r.Interval })
+ compareSyncDecode(t, apicontract.SetCloudSyncDir, "name", true, true, []string{`{}`, `{"name":null}`, `{"name":1}`, `{"name":" "}`, `{"name":" cloud "}`, `{"name":""}`}, func(r apicontract.SyncNameRequest) string { return r.Name })
+}
+
+func compareSyncDecode[Request, Data, Value any](t *testing.T, endpoint apicontract.Endpoint[Request, Data], key string, required, rejectEmpty bool, bodies []string, extract func(Request) Value) {
+ t.Helper()
+ for _, body := range bodies {
+ recorder := httptest.NewRecorder()
+ context, _ := gin.CreateTestContext(recorder)
+ context.Request = httptest.NewRequest("POST", endpoint.Definition().Path, strings.NewReader(body))
+ expected := gulu.Ret.NewResult()
+ var value Value
+ if args, ok := util.JsonArg(context, expected); ok {
+ util.ParseJsonArgs(args, expected, util.BindJsonArg(key, &value, required, rejectEmpty))
+ }
+ request, err := endpoint.Decode(strings.NewReader(body))
+ if expected.Code != 0 {
+ if err == nil || err.Error() != expected.Msg {
+ t.Fatalf("%s %s: error changed: %v != %s", endpoint.Definition().Path, body, err, expected.Msg)
+ }
+ } else if err != nil || !reflect.DeepEqual(extract(request), value) {
+ t.Fatalf("%s %s: value changed: %+v != %+v (%v)", endpoint.Definition().Path, body, extract(request), value, err)
+ }
+ }
+}
+
+func TestAPIContractSyncProviderConfigCompatibility(t *testing.T) {
+ for _, raw := range []string{`{}`, `{"ENDPOINT":" example ","timeout":1.0,"concurrentReqs":9007199254740993}`, `{"endpoint":false}`, `{"timeout":1.5}`, `{"pathStyle":null}`, `{"endpoint":"first","endpoint":"second"}`} {
+ var object map[string]interface{}
+ if err := json.Unmarshal([]byte(raw), &object); err != nil {
+ t.Fatal(err)
+ }
+ encoded, _ := gulu.JSON.MarshalJSON(object)
+ expected := &conf.S3{}
+ expectedErr := gulu.JSON.UnmarshalJSON(encoded, expected)
+ request, err := apicontract.SetSyncProviderS3.Decode(strings.NewReader(`{"s3":` + raw + `}`))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if expectedErr != nil {
+ if request.ConfigError() == nil || request.ConfigError().Error() != expectedErr.Error() {
+ t.Fatalf("config error changed: %v != %v", request.ConfigError(), expectedErr)
+ }
+ } else if request.ConfigError() != nil || !reflect.DeepEqual((*conf.S3)(&request.S3), expected) {
+ t.Fatalf("config changed: %+v != %+v (%v)", request.S3, expected, request.ConfigError())
+ }
+ }
+}
+
+func TestAPIContractSyncHTTPResponses(t *testing.T) {
+ syncTestConfiguration(t)
+ model.Conf.Sync.Mode = 3
+ engine := gin.New()
+ for path, handler := range map[string]gin.HandlerFunc{
+ "getBootSync": getBootSync, "getSyncInfo": getSyncInfo, "getSyncLANStatus": getSyncLANStatus,
+ "performSync": performSync, "setSyncMode": setSyncMode, "setSyncInterval": setSyncInterval,
+ "setSyncAssetDownloadMode": setSyncAssetDownloadMode, "setSyncProviderS3": setSyncProviderS3,
+ "setSyncProviderWebDAV": setSyncProviderWebDAV, "setSyncProviderLocal": setSyncProviderLocal,
+ } {
+ engine.POST("/api/sync/"+path, handler)
+ }
+ for _, entry := range []struct {
+ path, body string
+ code int
+ timeout int
+ }{
+ {"getBootSync", "ignored invalid body", 0, 0}, {"getSyncInfo", "ignored invalid body", 0, 0},
+ {"getSyncLANStatus", "ignored invalid body", 0, 0},
+ {"performSync", `{"mobileSwitch":true,"upload":"ignored"}`, 0, 0},
+ {"performSync", `{}`, -1, 0}, {"performSync", `{"upload":null}`, -1, 0},
+ {"setSyncMode", `{"mode":3.9}`, 0, 0}, {"setSyncInterval", `{"interval":31.9}`, 0, 0},
+ {"setSyncAssetDownloadMode", `{"mode":0.9}`, -1, 0},
+ {"setSyncProviderS3", `{"s3":null}`, -1, 0},
+ {"setSyncProviderS3", `{"s3":{"timeout":1.5}}`, -1, 5000},
+ {"setSyncProviderWebDAV", `{"webdav":{"username":false}}`, -1, 5000},
+ {"setSyncProviderLocal", `{"local":{"timeout":1.5}}`, -1, 5000},
+ {"setSyncProviderS3", `{"s3":{"bucket":"","endpoint":" example "}}`, 0, 0},
+ {"setSyncProviderWebDAV", `{"webdav":{"endpoint":" example ","username":" user "}}`, 0, 0},
+ } {
+ recorder := httptest.NewRecorder()
+ path := "/api/sync/" + entry.path
+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", path, strings.NewReader(entry.body)))
+ requireAPIContract(t, "POST", path, recorder)
+ var response struct {
+ Code int `json:"code"`
+ Data struct {
+ CloseTimeout int `json:"closeTimeout"`
+ } `json:"data"`
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != entry.code || response.Data.CloseTimeout != entry.timeout {
+ t.Fatalf("response changed for %s: %s (%v)", path, recorder.Body.String(), err)
+ }
+ }
+ if model.Conf.Sync.Mode != 3 || model.Conf.Sync.Interval != 31 {
+ t.Fatalf("numeric truncation changed: %+v", model.Conf.Sync)
+ }
+}
+
+func TestAPIContractSyncBootRole(t *testing.T) {
+ syncTestConfiguration(t)
+ previous := model.BootSyncSucc
+ model.BootSyncSucc = 1
+ t.Cleanup(func() { model.BootSyncSucc = previous })
+ model.Conf.Sync.Enabled = true
+ for _, role := range []model.Role{model.RoleAdministrator, model.RoleReader} {
+ engine := gin.New()
+ engine.Use(func(c *gin.Context) { c.Set(model.RoleContextKey, role) })
+ engine.POST("/api/sync/getBootSync", getBootSync)
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", "/api/sync/getBootSync", strings.NewReader("malformed")))
+ requireAPIContract(t, "POST", "/api/sync/getBootSync", recorder)
+ var response struct {
+ Code int `json:"code"`
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil {
+ t.Fatal(err)
+ }
+ expected := 0
+ if role == model.RoleAdministrator {
+ expected = 1
+ }
+ if response.Code != expected {
+ t.Fatalf("boot status role changed: %s", recorder.Body.String())
+ }
+ }
+}
+
+func TestAPIContractSyncPermissionBeforeBody(t *testing.T) {
+ syncTestConfiguration(t)
+ for _, role := range []model.Role{model.RoleAdministrator, model.RoleReader} {
+ engine := gin.New()
+ engine.Use(func(c *gin.Context) { c.Set(model.RoleContextKey, role) })
+ engine.POST("/api/sync/setSyncProviderS3", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setSyncProviderS3)
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", "/api/sync/setSyncProviderS3", strings.NewReader("malformed body")))
+ if role == model.RoleReader {
+ if recorder.Code != 403 || recorder.Body.Len() != 0 {
+ t.Fatalf("administrator gate changed: %d %s", recorder.Code, recorder.Body.String())
+ }
+ continue
+ }
+ requireAPIContract(t, "POST", "/api/sync/setSyncProviderS3", recorder)
+ var response struct {
+ Code int `json:"code"`
+ Msg string `json:"msg"`
+ Data struct {
+ CloseTimeout int `json:"closeTimeout"`
+ } `json:"data"`
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != -1 || response.Msg != model.Conf.Language(34) || response.Data.CloseTimeout != 5000 {
+ t.Fatalf("readonly gate changed: %s (%v)", recorder.Body.String(), err)
+ }
+ }
+}
+
+func TestAPIContractSyncProviderMultipart(t *testing.T) {
+ syncTestConfiguration(t)
+ for _, entry := range []struct {
+ name string
+ handler gin.HandlerFunc
+ }{{"importSyncProviderS3", importSyncProviderS3}, {"importSyncProviderWebDAV", importSyncProviderWebDAV}} {
+ engine := gin.New()
+ path := "/api/sync/" + entry.name
+ engine.POST(path, entry.handler)
+ for _, count := range []int{0, 1, 2} {
+ var body bytes.Buffer
+ writer := multipart.NewWriter(&body)
+ for i := 0; i < count; i++ {
+ part, err := writer.CreateFormFile("file", "config.txt")
+ if err != nil {
+ t.Fatal(err)
+ }
+ _, _ = part.Write([]byte("content"))
+ }
+ if err := writer.Close(); err != nil {
+ t.Fatal(err)
+ }
+ request := httptest.NewRequest("POST", path, &body)
+ request.Header.Set("Content-Type", writer.FormDataContentType())
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, request)
+ requireAPIContract(t, "POST", path, recorder)
+ var response struct {
+ Code int `json:"code"`
+ Msg string `json:"msg"`
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != -1 {
+ t.Fatalf("invalid multipart accepted: %s %v", recorder.Body.String(), err)
+ }
+ if count != 1 && response.Msg != "invalid upload file" {
+ t.Fatalf("upload cardinality changed: %s", recorder.Body.String())
+ }
+ if count == 1 && !strings.HasPrefix(response.Msg, "invalid ") {
+ t.Fatalf("package extension error changed: %s", recorder.Body.String())
+ }
+ }
+ }
+}
+
+func TestAPIContractSyncProviderExportContents(t *testing.T) {
+ syncTestConfiguration(t)
+ model.Conf.Sync.S3 = &conf.S3{Endpoint: " endpoint ", SecretKey: " secret ", Bucket: "bucket", Timeout: 35}
+ model.Conf.Sync.WebDAV = &conf.WebDAV{Endpoint: " endpoint ", Password: " password ", Timeout: 36}
+ for _, entry := range []struct {
+ name string
+ handler gin.HandlerFunc
+ expected []byte
+ }{
+ {"exportSyncProviderS3", exportSyncProviderS3, syncMarshal(t, model.Conf.Sync.S3)},
+ {"exportSyncProviderWebDAV", exportSyncProviderWebDAV, syncMarshal(t, model.Conf.Sync.WebDAV)},
+ } {
+ engine := gin.New()
+ path := "/api/sync/" + entry.name
+ engine.POST(path, entry.handler)
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", path, strings.NewReader("ignored")))
+ requireAPIContract(t, "POST", path, recorder)
+ var response struct {
+ Code int `json:"code"`
+ Data apicontract.SyncProviderExportData `json:"data"`
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != 0 {
+ t.Fatalf("export failed: %s %v", recorder.Body.String(), err)
+ }
+ archive, err := archivezip.OpenReader(filepath.Join(util.TempDir, filepath.FromSlash(strings.TrimPrefix(response.Data.Zip, "/"))))
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(archive.File) != 1 || archive.File[0].Name != response.Data.Name {
+ archive.Close()
+ t.Fatal("export archive layout changed")
+ }
+ reader, err := archive.File[0].Open()
+ if err != nil {
+ archive.Close()
+ t.Fatal(err)
+ }
+ encrypted, err := io.ReadAll(reader)
+ reader.Close()
+ archive.Close()
+ if err != nil {
+ t.Fatal(err)
+ }
+ plain, err := hex.DecodeString(string(util.AESDecrypt(string(encrypted))))
+ if err != nil || !bytes.Equal(plain, entry.expected) {
+ t.Fatalf("export encryption or JSON changed: %s != %s (%v)", plain, entry.expected, err)
+ }
+ archiveData, err := os.ReadFile(filepath.Join(util.TempDir, filepath.FromSlash(strings.TrimPrefix(response.Data.Zip, "/"))))
+ if err != nil {
+ t.Fatal(err)
+ }
+ importPath := strings.Replace(path, "exportSyncProvider", "importSyncProvider", 1)
+ importHandler := importSyncProviderS3
+ if entry.name == "exportSyncProviderWebDAV" {
+ importHandler = importSyncProviderWebDAV
+ }
+ engine.POST(importPath, importHandler)
+ for _, file := range []struct {
+ name string
+ content []byte
+ }{{response.Data.Name, encrypted}, {response.Data.Name + ".zip", archiveData}} {
+ var body bytes.Buffer
+ writer := multipart.NewWriter(&body)
+ part, err := writer.CreateFormFile("file", file.name)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = part.Write(file.content); err != nil {
+ t.Fatal(err)
+ }
+ if err = writer.Close(); err != nil {
+ t.Fatal(err)
+ }
+ request := httptest.NewRequest("POST", importPath, &body)
+ request.Header.Set("Content-Type", writer.FormDataContentType())
+ importRecorder := httptest.NewRecorder()
+ engine.ServeHTTP(importRecorder, request)
+ requireAPIContract(t, "POST", importPath, importRecorder)
+ var imported struct {
+ Code int `json:"code"`
+ }
+ if err = json.Unmarshal(importRecorder.Body.Bytes(), &imported); err != nil || imported.Code != 0 {
+ t.Fatalf("provider package import changed: %s (%v)", importRecorder.Body.String(), err)
+ }
+ }
+ }
+}
+
+func syncMarshal[T any](t *testing.T, value T) []byte {
+ t.Helper()
+ data, err := json.Marshal(value)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return data
+}
diff --git a/kernel/api/sync.go b/kernel/api/sync.go
index 45db71e55b..544f17b4ec 100644
--- a/kernel/api/sync.go
+++ b/kernel/api/sync.go
@@ -19,7 +19,6 @@ package api
import (
"encoding/hex"
"io"
- "net/http"
"os"
"path/filepath"
"strings"
@@ -30,36 +29,35 @@ import (
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
"github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/model"
"github.com/siyuan-note/siyuan/kernel/util"
)
-func importSyncProviderWebDAV(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(200, ret)
+var importSyncProviderWebDAV = contractHandler(apicontract.ImportSyncProviderWebDAV, importSyncProviderWebDAVContract, prepareSyncProviderImport[apicontract.SyncWebDAVData])
+func prepareSyncProviderImport[Data any](c *gin.Context) *apicontract.Response[Data] {
form, err := c.MultipartForm()
if err != nil {
logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
- return
+ response := apicontract.Failure[Data](-1, err.Error())
+ return &response
}
-
- files := form.File["file"]
- if 1 != len(files) {
- ret.Code = -1
- ret.Msg = "invalid upload file"
- return
+ if len(form.File["file"]) != 1 {
+ response := apicontract.Failure[Data](-1, "invalid upload file")
+ return &response
}
+ return nil
+}
- f := files[0]
+func importSyncProviderWebDAVContract(c *gin.Context, request apicontract.SyncProviderImportRequest) (ret apicontract.Response[apicontract.SyncWebDAVData]) {
+
+ f := request.File
fh, err := f.Open()
if err != nil {
logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
@@ -67,68 +65,60 @@ func importSyncProviderWebDAV(c *gin.Context) {
fh.Close()
if err != nil {
logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
importDir := filepath.Join(util.TempDir, "import")
if err = os.MkdirAll(importDir, 0755); err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
writePath := filepath.Join(importDir, f.Filename)
if !gulu.File.IsSubPath(importDir, writePath) {
logging.LogErrorf("import path [%s] is not sub path of import dir [%s]", writePath, importDir)
- ret.Code = -1
- ret.Msg = "import path is not sub path of import dir"
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, "import path is not sub path of import dir")
return
}
if err = os.WriteFile(writePath, data, 0644); err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
tmpDir := filepath.Join(importDir, "webdav")
os.RemoveAll(tmpDir)
+ var copyError error
if strings.HasSuffix(strings.ToLower(writePath), ".zip") {
if err = gulu.Zip.Unzip(writePath, tmpDir); err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
} else if strings.HasSuffix(strings.ToLower(writePath), ".json") {
if err = gulu.File.CopyFile(writePath, filepath.Join(tmpDir, f.Filename)); err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ copyError = err
}
} else {
logging.LogErrorf("invalid WebDAV provider package")
- ret.Code = -1
- ret.Msg = "invalid WebDAV provider package"
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, "invalid WebDAV provider package")
return
}
entries, err := os.ReadDir(tmpDir)
if err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
if 1 != len(entries) {
logging.LogErrorf("invalid WebDAV provider package")
- ret.Code = -1
- ret.Msg = "invalid WebDAV provider package"
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, "invalid WebDAV provider package")
return
}
@@ -136,8 +126,7 @@ func importSyncProviderWebDAV(c *gin.Context) {
data, err = os.ReadFile(writePath)
if err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
@@ -146,34 +135,34 @@ func importSyncProviderWebDAV(c *gin.Context) {
webdav := &conf.WebDAV{}
if err = gulu.JSON.UnmarshalJSON(data, webdav); err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
err = model.SetSyncProviderWebDAV(webdav)
if err != nil {
logging.LogErrorf("import WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncWebDAVData](-1, err.Error())
return
}
- ret.Data = map[string]any{
- "webdav": model.Conf.Sync.WebDAV,
+ result := apicontract.SyncWebDAVData{WebDAV: (*apicontract.SyncWebDAV)(model.Conf.Sync.WebDAV)}
+ if copyError != nil {
+ return apicontract.ImportSyncProviderWebDAV.FailureWithData(-1, copyError.Error(), result)
}
+ ret = apicontract.Success(result)
+ return
}
-func exportSyncProviderWebDAV(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var exportSyncProviderWebDAV = contractHandler(apicontract.ExportSyncProviderWebDAV, exportSyncProviderWebDAVContract)
+
+func exportSyncProviderWebDAVContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.SyncProviderExportData]) {
name := "siyuan-webdav-" + time.Now().Format("20060102150405") + ".json"
tmpDir := filepath.Join(util.TempDir, "export")
if err := os.MkdirAll(tmpDir, 0755); err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
@@ -185,8 +174,7 @@ func exportSyncProviderWebDAV(c *gin.Context) {
data, err := gulu.JSON.MarshalJSON(model.Conf.Sync.WebDAV)
if err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
@@ -194,65 +182,43 @@ func exportSyncProviderWebDAV(c *gin.Context) {
tmp := filepath.Join(tmpDir, name)
if err = os.WriteFile(tmp, []byte(dataStr), 0644); err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
zipFile, err := gulu.Zip.Create(tmp + ".zip")
if err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
if err = zipFile.AddEntry(name, tmp); err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
if err = zipFile.Close(); err != nil {
logging.LogErrorf("export WebDAV provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
zipPath := "/export/" + name + ".zip"
- ret.Data = map[string]any{
- "name": name,
- "zip": zipPath,
- }
+ ret = apicontract.Success(apicontract.SyncProviderExportData{Name: name, Zip: zipPath})
+ return
}
-func importSyncProviderS3(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(200, ret)
+var importSyncProviderS3 = contractHandler(apicontract.ImportSyncProviderS3, importSyncProviderS3Contract, prepareSyncProviderImport[apicontract.SyncS3Data])
- form, err := c.MultipartForm()
- if err != nil {
- logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
- return
- }
-
- files := form.File["file"]
- if 1 != len(files) {
- ret.Code = -1
- ret.Msg = "invalid upload file"
- return
- }
+func importSyncProviderS3Contract(c *gin.Context, request apicontract.SyncProviderImportRequest) (ret apicontract.Response[apicontract.SyncS3Data]) {
- f := files[0]
+ f := request.File
fh, err := f.Open()
if err != nil {
logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
@@ -260,68 +226,60 @@ func importSyncProviderS3(c *gin.Context) {
fh.Close()
if err != nil {
logging.LogErrorf("read upload file failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
importDir := filepath.Join(util.TempDir, "import")
if err = os.MkdirAll(importDir, 0755); err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
writePath := filepath.Join(importDir, f.Filename)
if !gulu.File.IsSubPath(importDir, writePath) {
logging.LogErrorf("import path [%s] is not sub path of import dir [%s]", writePath, importDir)
- ret.Code = -1
- ret.Msg = "import path is not sub path of import dir"
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, "import path is not sub path of import dir")
return
}
if err = os.WriteFile(writePath, data, 0644); err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
tmpDir := filepath.Join(importDir, "s3")
os.RemoveAll(tmpDir)
+ var copyError error
if strings.HasSuffix(strings.ToLower(writePath), ".zip") {
if err = gulu.Zip.Unzip(writePath, tmpDir); err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
} else if strings.HasSuffix(strings.ToLower(writePath), ".json") {
if err = gulu.File.CopyFile(writePath, filepath.Join(tmpDir, f.Filename)); err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ copyError = err
}
} else {
logging.LogErrorf("invalid S3 provider package")
- ret.Code = -1
- ret.Msg = "invalid S3 provider package"
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, "invalid S3 provider package")
return
}
entries, err := os.ReadDir(tmpDir)
if err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
if 1 != len(entries) {
logging.LogErrorf("invalid S3 provider package")
- ret.Code = -1
- ret.Msg = "invalid S3 provider package"
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, "invalid S3 provider package")
return
}
@@ -329,8 +287,7 @@ func importSyncProviderS3(c *gin.Context) {
data, err = os.ReadFile(writePath)
if err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
@@ -339,34 +296,34 @@ func importSyncProviderS3(c *gin.Context) {
s3 := &conf.S3{}
if err = gulu.JSON.UnmarshalJSON(data, s3); err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
err = model.SetSyncProviderS3(s3)
if err != nil {
logging.LogErrorf("import S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncS3Data](-1, err.Error())
return
}
- ret.Data = map[string]any{
- "s3": model.Conf.Sync.S3,
+ result := apicontract.SyncS3Data{S3: (*apicontract.SyncS3)(model.Conf.Sync.S3)}
+ if copyError != nil {
+ return apicontract.ImportSyncProviderS3.FailureWithData(-1, copyError.Error(), result)
}
+ ret = apicontract.Success(result)
+ return
}
-func exportSyncProviderS3(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var exportSyncProviderS3 = contractHandler(apicontract.ExportSyncProviderS3, exportSyncProviderS3Contract)
+
+func exportSyncProviderS3Contract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.SyncProviderExportData]) {
name := "siyuan-s3-" + time.Now().Format("20060102150405") + ".json"
tmpDir := filepath.Join(util.TempDir, "export")
if err := os.MkdirAll(tmpDir, 0755); err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
@@ -378,8 +335,7 @@ func exportSyncProviderS3(c *gin.Context) {
data, err := gulu.JSON.MarshalJSON(model.Conf.Sync.S3)
if err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
@@ -387,86 +343,75 @@ func exportSyncProviderS3(c *gin.Context) {
tmp := filepath.Join(tmpDir, name)
if err = os.WriteFile(tmp, []byte(dataStr), 0644); err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
zipFile, err := gulu.Zip.Create(tmp + ".zip")
if err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
if err = zipFile.AddEntry(name, tmp); err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
if err = zipFile.Close(); err != nil {
logging.LogErrorf("export S3 provider failed: %s", err)
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.SyncProviderExportData](-1, err.Error())
return
}
zipPath := "/export/" + name + ".zip"
- ret.Data = map[string]any{
- "name": name,
- "zip": zipPath,
- }
+ ret = apicontract.Success(apicontract.SyncProviderExportData{Name: name, Zip: zipPath})
+ return
}
-func getSyncInfo(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getSyncInfo = contractHandler(apicontract.GetSyncInfo, getSyncInfoContract)
+
+func getSyncInfoContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.SyncInfoData]) {
stat := model.Conf.Sync.Stat
if !model.Conf.Sync.Enabled {
stat = model.Conf.Language(53)
}
- ret.Data = map[string]any{
- "synced": model.Conf.Sync.Synced,
- "stat": stat,
- "kernels": model.GetOnlineKernels(),
- "kernel": model.KernelID,
+ kernels := model.GetOnlineKernels()
+ items := make([]*apicontract.SyncOnlineKernel, len(kernels))
+ for i, item := range kernels {
+ items[i] = (*apicontract.SyncOnlineKernel)(item)
}
+ ret = apicontract.Success(apicontract.SyncInfoData{Synced: model.Conf.Sync.Synced, Stat: stat, Kernels: items, Kernel: model.KernelID})
+ return
}
-func getBootSync(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getBootSync = contractHandler(apicontract.GetBootSync, getBootSyncContract)
+
+func getBootSyncContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
if !model.IsAdminRoleContext(c) {
return
}
if model.Conf.Sync.Enabled && 1 == model.BootSyncSucc {
- ret.Code = 1
- ret.Msg = model.Conf.Language(17)
+ ret = apicontract.Failure[apicontract.Null](1, model.Conf.Language(17))
return
}
+ return
}
-func performSync(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var performSync = contractHandler(apicontract.PerformSync, performSyncContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func performSyncContract(c *gin.Context, request apicontract.PerformSyncRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
// Android 端前后台切换时自动触发同步 https://github.com/siyuan-note/siyuan/issues/7122
- var mobileSwitch bool
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("mobileSwitch", &mobileSwitch, false, false)) {
- return
- }
+ mobileSwitch := request.MobileSwitch
if mobileSwitch {
if !util.IsBooted() {
return
@@ -482,33 +427,36 @@ func performSync(c *gin.Context) {
}
// 云端同步模式支持 `完全手动同步` 模式 https://github.com/siyuan-note/siyuan/issues/7295
- var upload bool
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("upload", &upload, true, false)) {
- return
+ upload, err := request.UploadDirection()
+ if err != nil {
+ return apicontract.Failure[apicontract.Null](-1, err.Error())
}
if upload {
model.SyncDataUpload()
} else {
model.SyncDataDownload()
}
+ return
}
-func performBootSync(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var performBootSync = contractHandler(apicontract.PerformBootSync, performBootSyncContract)
+
+func performBootSyncContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
model.BootSyncData()
- ret.Code = model.BootSyncSucc
+ if model.BootSyncSucc != 0 {
+ ret = apicontract.Failure[apicontract.Null](model.BootSyncSucc, "")
+ }
+ return
}
-func listCloudSyncDir(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var listCloudSyncDir = contractHandler(apicontract.ListCloudSyncDir, listCloudSyncDirContract)
+
+func listCloudSyncDirContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.CloudSyncDirsData]) {
syncDirs, hSize, err := model.ListCloudSyncDir()
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.CloudSyncDirsData](1, err.Error(), 5000)
return
}
@@ -516,360 +464,214 @@ func listCloudSyncDir(c *gin.Context) {
if conf.ProviderS3 == model.Conf.Sync.Provider {
checkedSyncDir = ""
}
- ret.Data = map[string]any{
- "syncDirs": syncDirs,
- "hSize": hSize,
- "checkedSyncDir": checkedSyncDir,
+ var items []*apicontract.CloudSyncDir
+ if syncDirs != nil {
+ items = make([]*apicontract.CloudSyncDir, len(syncDirs))
+ for i, item := range syncDirs {
+ items[i] = (*apicontract.CloudSyncDir)(item)
+ }
}
+ ret = apicontract.Success(apicontract.CloudSyncDirsData{SyncDirs: items, HSize: hSize, CheckedSyncDir: checkedSyncDir})
+ return
}
-func removeCloudSyncDir(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var removeCloudSyncDir = contractHandler(apicontract.RemoveCloudSyncDir, removeCloudSyncDirContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func removeCloudSyncDirContract(c *gin.Context, request apicontract.SyncNameRequest) (ret apicontract.Response[string]) {
- var name string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("name", &name, true, true)) {
- return
- }
+ name := request.Name
err := model.RemoveCloudSyncDir(name)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[string](-1, err.Error(), 5000)
return
}
- ret.Data = model.Conf.Sync.CloudName
+ ret = apicontract.Success(model.Conf.Sync.CloudName)
+ return
}
-func createCloudSyncDir(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var createCloudSyncDir = contractHandler(apicontract.CreateCloudSyncDir, createCloudSyncDirContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func createCloudSyncDirContract(c *gin.Context, request apicontract.SyncNameRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var name string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("name", &name, true, true)) {
- return
- }
+ name := request.Name
err := model.CreateCloudSyncDir(name)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.Null](-1, err.Error(), 5000)
return
}
+ return
}
-func setSyncGenerateConflictDoc(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncGenerateConflictDoc = contractHandler(apicontract.SetSyncGenerateConflictDoc, setSyncGenerateConflictDocContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncGenerateConflictDocContract(c *gin.Context, request apicontract.SyncEnabledRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var enabled bool
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("enabled", &enabled, true, false)) {
- return
- }
+ enabled := request.Enabled
model.SetSyncGenerateConflictDoc(enabled)
+ return
}
-func setSyncEnable(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncEnable = contractHandler(apicontract.SetSyncEnable, setSyncEnableContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncEnableContract(c *gin.Context, request apicontract.SyncEnabledRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var enabled bool
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("enabled", &enabled, true, false)) {
- return
- }
+ enabled := request.Enabled
model.SetSyncEnable(enabled)
+ return
}
-func setSyncInterval(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
- var interval float64
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("interval", &interval, true, false)) {
- return
- }
+var setSyncInterval = contractHandler(apicontract.SetSyncInterval, setSyncIntervalContract)
+
+func setSyncIntervalContract(c *gin.Context, request apicontract.SyncIntervalRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
+ interval := request.Interval
model.SetSyncInterval(int(interval))
+ return
}
-func setSyncPerception(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncPerception = contractHandler(apicontract.SetSyncPerception, setSyncPerceptionContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncPerceptionContract(c *gin.Context, request apicontract.SyncEnabledRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var enabled bool
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("enabled", &enabled, true, false)) {
- return
- }
+ enabled := request.Enabled
model.SetSyncPerception(enabled)
+ return
}
-func setSyncLAN(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncLAN = contractHandler(apicontract.SetSyncLAN, setSyncLANContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncLANContract(c *gin.Context, request apicontract.SyncLANRequest) (ret apicontract.Response[apicontract.SyncLANStatus]) {
- var enabled bool
- var maxConcurrentReqs float64
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("enabled", &enabled, true, false),
- util.BindJsonArg("maxConcurrentReqs", &maxConcurrentReqs, false, false)) {
- return
- }
+ enabled, maxConcurrentReqs := request.Enabled, request.MaxConcurrentReqs
model.SetSyncLAN(enabled, int(maxConcurrentReqs))
- ret.Data = model.GetSyncLANStatus()
+ ret = apicontract.Success(apicontract.SyncLANStatus(model.GetSyncLANStatus()))
+ return
}
-func getSyncLANStatus(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
- ret.Data = model.GetSyncLANStatus()
+var getSyncLANStatus = contractHandler(apicontract.GetSyncLANStatus, getSyncLANStatusContract)
+
+func getSyncLANStatusContract(c *gin.Context, request apicontract.EmptyRequest) (ret apicontract.Response[apicontract.SyncLANStatus]) {
+ ret = apicontract.Success(apicontract.SyncLANStatus(model.GetSyncLANStatus()))
+ return
}
-func setSyncAssetDownloadMode(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
- var mode float64
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("mode", &mode, true, false)) {
- return
- }
+var setSyncAssetDownloadMode = contractHandler(apicontract.SetSyncAssetDownloadMode, setSyncAssetDownloadModeContract)
+
+func setSyncAssetDownloadModeContract(c *gin.Context, request apicontract.SyncModeRequest) (ret apicontract.Response[apicontract.SyncAssetDownloadModeData]) {
+ mode := request.Mode
if mode != 0 && mode != 1 {
- ret.Code = -1
- ret.Msg = "invalid asset download mode"
+ ret = apicontract.Failure[apicontract.SyncAssetDownloadModeData](-1, "invalid asset download mode")
return
}
if err := model.SetSyncAssetDownloadMode(int(mode)); err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 7000}
+ ret = apicontract.FailureWithTimeout[apicontract.SyncAssetDownloadModeData](-1, err.Error(), 7000)
return
}
- ret.Data = map[string]any{"assetDownloadMode": int(mode)}
+ ret = apicontract.Success(apicontract.SyncAssetDownloadModeData{AssetDownloadMode: int(mode)})
+ return
}
-func setSyncMode(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncMode = contractHandler(apicontract.SetSyncMode, setSyncModeContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncModeContract(c *gin.Context, request apicontract.SyncModeRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var mode float64
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("mode", &mode, true, false)) {
- return
- }
+ mode := request.Mode
model.SetSyncMode(int(mode))
+ return
}
-func setSyncProvider(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncProvider = contractHandler(apicontract.SetSyncProvider, setSyncProviderContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setSyncProviderContract(c *gin.Context, request apicontract.SyncProviderRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var provider float64
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("provider", &provider, true, false)) {
- return
- }
+ provider := request.Provider
err := model.SetSyncProvider(int(provider))
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.Null](-1, err.Error(), 5000)
return
}
+ return
}
-func setSyncProviderS3(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncProviderS3 = contractHandler(apicontract.SetSyncProviderS3, setSyncProviderS3Contract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var s3Arg map[string]any
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("s3", &s3Arg, true, false)) {
- return
- }
- data, err := gulu.JSON.MarshalJSON(s3Arg)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
- }
+func setSyncProviderS3Contract(c *gin.Context, request apicontract.SetSyncS3Request) (ret apicontract.Response[apicontract.SyncS3Data]) {
- s3 := &conf.S3{}
- if err = gulu.JSON.UnmarshalJSON(data, s3); err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
+ if err := request.ConfigError(); err != nil {
+ return apicontract.FailureWithTimeout[apicontract.SyncS3Data](-1, err.Error(), 5000)
}
+ s3 := (*conf.S3)(&request.S3)
newBucket := strings.TrimSpace(s3.Bucket)
prevBucket := strings.TrimSpace(model.Conf.Sync.S3.Bucket)
if newBucket != prevBucket && !cloud.IsValidCloudDirName(newBucket) {
- ret.Code = -1
- ret.Msg = model.Conf.Language(37)
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.SyncS3Data](-1, model.Conf.Language(37), 5000)
return
}
- err = model.SetSyncProviderS3(s3)
+ err := model.SetSyncProviderS3(s3)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.SyncS3Data](-1, err.Error(), 5000)
return
}
- ret.Data = map[string]any{
- "s3": model.Conf.Sync.S3,
- }
+ ret = apicontract.Success(apicontract.SyncS3Data{S3: (*apicontract.SyncS3)(model.Conf.Sync.S3)})
+ return
}
-func setSyncProviderWebDAV(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+var setSyncProviderWebDAV = contractHandler(apicontract.SetSyncProviderWebDAV, setSyncProviderWebDAVContract)
- var webdavArg map[string]any
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("webdav", &webdavArg, true, false)) {
- return
- }
- data, err := gulu.JSON.MarshalJSON(webdavArg)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
- }
+func setSyncProviderWebDAVContract(c *gin.Context, request apicontract.SetSyncWebDAVRequest) (ret apicontract.Response[apicontract.SyncWebDAVData]) {
- webdav := &conf.WebDAV{}
- if err = gulu.JSON.UnmarshalJSON(data, webdav); err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
+ if err := request.ConfigError(); err != nil {
+ return apicontract.FailureWithTimeout[apicontract.SyncWebDAVData](-1, err.Error(), 5000)
}
+ webdav := (*conf.WebDAV)(&request.WebDAV)
- err = model.SetSyncProviderWebDAV(webdav)
+ err := model.SetSyncProviderWebDAV(webdav)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.SyncWebDAVData](-1, err.Error(), 5000)
return
}
- ret.Data = map[string]any{
- "webdav": model.Conf.Sync.WebDAV,
- }
+ ret = apicontract.Success(apicontract.SyncWebDAVData{WebDAV: (*apicontract.SyncWebDAV)(model.Conf.Sync.WebDAV)})
+ return
}
-func setSyncProviderLocal(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setSyncProviderLocal = contractHandler(apicontract.SetSyncProviderLocal, setSyncProviderLocalContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var localArg map[string]any
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("local", &localArg, true, false)) {
- return
- }
- data, err := gulu.JSON.MarshalJSON(localArg)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
- }
+func setSyncProviderLocalContract(c *gin.Context, request apicontract.SetSyncLocalRequest) (ret apicontract.Response[apicontract.SyncLocalData]) {
- local := &conf.Local{}
- if err = gulu.JSON.UnmarshalJSON(data, local); err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
- return
+ if err := request.ConfigError(); err != nil {
+ return apicontract.FailureWithTimeout[apicontract.SyncLocalData](-1, err.Error(), 5000)
}
+ local := (*conf.Local)(&request.Local)
- err = model.SetSyncProviderLocal(local)
+ err := model.SetSyncProviderLocal(local)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- ret.Data = map[string]any{"closeTimeout": 5000}
+ ret = apicontract.FailureWithTimeout[apicontract.SyncLocalData](-1, err.Error(), 5000)
return
}
- ret.Data = map[string]any{
- "local": model.Conf.Sync.Local,
- }
+ ret = apicontract.Success(apicontract.SyncLocalData{Local: (*apicontract.SyncLocal)(model.Conf.Sync.Local)})
+ return
}
-func setCloudSyncDir(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var setCloudSyncDir = contractHandler(apicontract.SetCloudSyncDir, setCloudSyncDirContract)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+func setCloudSyncDirContract(c *gin.Context, request apicontract.SyncNameRequest) (ret apicontract.Response[apicontract.Null]) {
+ ret = apicontract.Success(apicontract.Null{})
- var name string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("name", &name, true, true)) {
- return
- }
+ name := request.Name
if err := model.SetCloudSyncDir(name); err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
+ ret = apicontract.Failure[apicontract.Null](-1, err.Error())
}
+ return
}
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index 349521042f..fad45ba94d 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -603,3 +603,28 @@ var GetBazaarTheme = define[GetBazaarThemeRequest, BazaarPackagesData]("getBazaa
var GetInstalledTheme = define[GetInstalledThemeRequest, BazaarPackagesData]("getInstalledTheme", "/api/bazaar/getInstalledTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
var InstallBazaarTheme = define[InstallBazaarThemeRequest, BazaarAppearancePackagesData]("installBazaarTheme", "/api/bazaar/installBazaarTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
var UninstallBazaarTheme = define[UninstallBazaarThemeRequest, BazaarAppearancePackagesData]("uninstallBazaarTheme", "/api/bazaar/uninstallBazaarTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+
+var SetSyncEnable = define[SyncEnabledRequest, Null]("setSyncEnable", "/api/sync/setSyncEnable", JSONBody, ResponseOptions{}, "POST")
+var SetSyncInterval = define[SyncIntervalRequest, Null]("setSyncInterval", "/api/sync/setSyncInterval", JSONBody, ResponseOptions{}, "POST")
+var SetSyncPerception = define[SyncEnabledRequest, Null]("setSyncPerception", "/api/sync/setSyncPerception", JSONBody, ResponseOptions{}, "POST")
+var SetSyncLAN = define[SyncLANRequest, SyncLANStatus]("setSyncLAN", "/api/sync/setSyncLAN", JSONBody, ResponseOptions{}, "POST")
+var GetSyncLANStatus = define[EmptyRequest, SyncLANStatus]("getSyncLANStatus", "/api/sync/getSyncLANStatus", NoBody, ResponseOptions{}, "POST")
+var SetSyncGenerateConflictDoc = define[SyncEnabledRequest, Null]("setSyncGenerateConflictDoc", "/api/sync/setSyncGenerateConflictDoc", JSONBody, ResponseOptions{}, "POST")
+var SetSyncMode = define[SyncModeRequest, Null]("setSyncMode", "/api/sync/setSyncMode", JSONBody, ResponseOptions{}, "POST")
+var SetSyncProvider = define[SyncProviderRequest, Null]("setSyncProvider", "/api/sync/setSyncProvider", JSONBody, ResponseOptions{}, "POST")
+var SetSyncProviderS3 = define[SetSyncS3Request, SyncS3Data]("setSyncProviderS3", "/api/sync/setSyncProviderS3", JSONBody, ResponseOptions{}, "POST")
+var SetSyncProviderWebDAV = define[SetSyncWebDAVRequest, SyncWebDAVData]("setSyncProviderWebDAV", "/api/sync/setSyncProviderWebDAV", JSONBody, ResponseOptions{}, "POST")
+var SetSyncProviderLocal = define[SetSyncLocalRequest, SyncLocalData]("setSyncProviderLocal", "/api/sync/setSyncProviderLocal", JSONBody, ResponseOptions{}, "POST")
+var SetCloudSyncDir = define[SyncNameRequest, Null]("setCloudSyncDir", "/api/sync/setCloudSyncDir", JSONBody, ResponseOptions{}, "POST")
+var SetSyncAssetDownloadMode = define[SyncModeRequest, SyncAssetDownloadModeData]("setSyncAssetDownloadMode", "/api/sync/setSyncAssetDownloadMode", JSONBody, ResponseOptions{}, "POST")
+var CreateCloudSyncDir = define[SyncNameRequest, Null]("createCloudSyncDir", "/api/sync/createCloudSyncDir", JSONBody, ResponseOptions{}, "POST")
+var RemoveCloudSyncDir = define[SyncNameRequest, string]("removeCloudSyncDir", "/api/sync/removeCloudSyncDir", JSONBody, ResponseOptions{}, "POST")
+var ListCloudSyncDir = define[EmptyRequest, CloudSyncDirsData]("listCloudSyncDir", "/api/sync/listCloudSyncDir", NoBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var PerformSync = define[PerformSyncRequest, Null]("performSync", "/api/sync/performSync", JSONBody, ResponseOptions{}, "POST")
+var PerformBootSync = define[EmptyRequest, Null]("performBootSync", "/api/sync/performBootSync", NoBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBootSync = define[EmptyRequest, Null]("getBootSync", "/api/sync/getBootSync", NoBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetSyncInfo = define[EmptyRequest, SyncInfoData]("getSyncInfo", "/api/sync/getSyncInfo", NoBody, ResponseOptions{}, "POST")
+var ExportSyncProviderS3 = define[EmptyRequest, SyncProviderExportData]("exportSyncProviderS3", "/api/sync/exportSyncProviderS3", NoBody, ResponseOptions{}, "POST")
+var ImportSyncProviderS3 = define[SyncProviderImportRequest, SyncS3Data]("importSyncProviderS3", "/api/sync/importSyncProviderS3", MultipartBody, ResponseOptions{DataOnError: true}, "POST")
+var ExportSyncProviderWebDAV = define[EmptyRequest, SyncProviderExportData]("exportSyncProviderWebDAV", "/api/sync/exportSyncProviderWebDAV", NoBody, ResponseOptions{}, "POST")
+var ImportSyncProviderWebDAV = define[SyncProviderImportRequest, SyncWebDAVData]("importSyncProviderWebDAV", "/api/sync/importSyncProviderWebDAV", MultipartBody, ResponseOptions{DataOnError: true}, "POST")
diff --git a/kernel/apicontract/legacy_routes.json b/kernel/apicontract/legacy_routes.json
index 74efd33838..c8571e75c4 100644
--- a/kernel/apicontract/legacy_routes.json
+++ b/kernel/apicontract/legacy_routes.json
@@ -253,30 +253,6 @@
{"method":"POST","path":"/api/setting/setSnippet","handler":"setConfSnippet"},
{"method":"POST","path":"/api/setting/setTheme","handler":"setTheme"},
{"method":"POST","path":"/api/setting/setVariables","handler":"setVariables"},
- {"method":"POST","path":"/api/sync/createCloudSyncDir","handler":"createCloudSyncDir"},
- {"method":"POST","path":"/api/sync/exportSyncProviderS3","handler":"exportSyncProviderS3"},
- {"method":"POST","path":"/api/sync/exportSyncProviderWebDAV","handler":"exportSyncProviderWebDAV"},
- {"method":"POST","path":"/api/sync/getBootSync","handler":"getBootSync"},
- {"method":"POST","path":"/api/sync/getSyncInfo","handler":"getSyncInfo"},
- {"method":"POST","path":"/api/sync/getSyncLANStatus","handler":"getSyncLANStatus"},
- {"method":"POST","path":"/api/sync/importSyncProviderS3","handler":"importSyncProviderS3"},
- {"method":"POST","path":"/api/sync/importSyncProviderWebDAV","handler":"importSyncProviderWebDAV"},
- {"method":"POST","path":"/api/sync/listCloudSyncDir","handler":"listCloudSyncDir"},
- {"method":"POST","path":"/api/sync/performBootSync","handler":"performBootSync"},
- {"method":"POST","path":"/api/sync/performSync","handler":"performSync"},
- {"method":"POST","path":"/api/sync/removeCloudSyncDir","handler":"removeCloudSyncDir"},
- {"method":"POST","path":"/api/sync/setCloudSyncDir","handler":"setCloudSyncDir"},
- {"method":"POST","path":"/api/sync/setSyncAssetDownloadMode","handler":"setSyncAssetDownloadMode"},
- {"method":"POST","path":"/api/sync/setSyncEnable","handler":"setSyncEnable"},
- {"method":"POST","path":"/api/sync/setSyncGenerateConflictDoc","handler":"setSyncGenerateConflictDoc"},
- {"method":"POST","path":"/api/sync/setSyncInterval","handler":"setSyncInterval"},
- {"method":"POST","path":"/api/sync/setSyncLAN","handler":"setSyncLAN"},
- {"method":"POST","path":"/api/sync/setSyncMode","handler":"setSyncMode"},
- {"method":"POST","path":"/api/sync/setSyncPerception","handler":"setSyncPerception"},
- {"method":"POST","path":"/api/sync/setSyncProvider","handler":"setSyncProvider"},
- {"method":"POST","path":"/api/sync/setSyncProviderLocal","handler":"setSyncProviderLocal"},
- {"method":"POST","path":"/api/sync/setSyncProviderS3","handler":"setSyncProviderS3"},
- {"method":"POST","path":"/api/sync/setSyncProviderWebDAV","handler":"setSyncProviderWebDAV"},
{"method":"POST","path":"/api/system/addCustomEmoji","handler":"addCustomEmoji"},
{"method":"POST","path":"/api/system/checkUpdate","handler":"checkUpdate"},
{"method":"POST","path":"/api/system/checkWorkspaceDir","handler":"checkWorkspaceDir"},
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 9a4d36367a..c4a4ccc0f1 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -3927,6 +3927,71 @@
],
"additionalProperties": false
},
+ "CloudSyncDir": {
+ "type": "object",
+ "properties": {
+ "cloudName": {
+ "type": "string"
+ },
+ "hSize": {
+ "type": "string"
+ },
+ "saveDir": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "updated": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "cloudName",
+ "hSize",
+ "saveDir",
+ "size",
+ "updated"
+ ],
+ "additionalProperties": false
+ },
+ "CloudSyncDirsData": {
+ "type": "object",
+ "properties": {
+ "checkedSyncDir": {
+ "type": "string"
+ },
+ "hSize": {
+ "type": "string"
+ },
+ "syncDirs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/CloudSyncDir"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "checkedSyncDir",
+ "hSize",
+ "syncDirs"
+ ],
+ "additionalProperties": false
+ },
"ContentWordCountRequestInput": {
"type": "object",
"properties": {
@@ -10380,6 +10445,25 @@
],
"additionalProperties": false
},
+ "PerformSyncRequestInput": {
+ "type": "object",
+ "properties": {
+ "mobileSwitch": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "upload": {
+ "type": "boolean"
+ }
+ },
+ "additionalProperties": false
+ },
"Petal": {
"type": "object",
"properties": {
@@ -12961,6 +13045,42 @@
],
"additionalProperties": false
},
+ "SetSyncLocalRequestInput": {
+ "type": "object",
+ "properties": {
+ "local": {
+ "$ref": "#/$defs/SyncLocalInput"
+ }
+ },
+ "required": [
+ "local"
+ ],
+ "additionalProperties": false
+ },
+ "SetSyncS3RequestInput": {
+ "type": "object",
+ "properties": {
+ "s3": {
+ "$ref": "#/$defs/SyncS3Input"
+ }
+ },
+ "required": [
+ "s3"
+ ],
+ "additionalProperties": false
+ },
+ "SetSyncWebDAVRequestInput": {
+ "type": "object",
+ "properties": {
+ "webdav": {
+ "$ref": "#/$defs/SyncWebDAVInput"
+ }
+ },
+ "required": [
+ "webdav"
+ ],
+ "additionalProperties": false
+ },
"Shorthand": {
"type": "object",
"properties": {
@@ -13332,17 +13452,44 @@
],
"additionalProperties": false
},
- "TagData": {
+ "SyncAssetDownloadModeData": {
"type": "object",
"properties": {
- "children": {
+ "assetDownloadMode": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "assetDownloadMode"
+ ],
+ "additionalProperties": false
+ },
+ "SyncEnabledRequestInput": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "enabled"
+ ],
+ "additionalProperties": false
+ },
+ "SyncInfoData": {
+ "type": "object",
+ "properties": {
+ "kernel": {
+ "type": "string"
+ },
+ "kernels": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/TagData"
+ "$ref": "#/$defs/SyncOnlineKernel"
},
{
"type": "null"
@@ -13355,62 +13502,136 @@
}
]
},
- "count": {
+ "stat": {
+ "type": "string"
+ },
+ "synced": {
"type": "integer"
+ }
+ },
+ "required": [
+ "kernel",
+ "kernels",
+ "stat",
+ "synced"
+ ],
+ "additionalProperties": false
+ },
+ "SyncIntervalRequestInput": {
+ "type": "object",
+ "properties": {
+ "interval": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "interval"
+ ],
+ "additionalProperties": false
+ },
+ "SyncLANRequestInput": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
},
- "depth": {
+ "maxConcurrentReqs": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "enabled"
+ ],
+ "additionalProperties": false
+ },
+ "SyncLANStatus": {
+ "type": "object",
+ "properties": {
+ "active": {
+ "type": "boolean"
+ },
+ "connectedPeers": {
"type": "integer"
},
- "label": {
- "type": "string"
+ "discoveredPeers": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "enabled": {
+ "type": "boolean"
},
- "type": {
- "type": "string"
+ "maxConcurrentReqs": {
+ "type": "integer"
}
},
"required": [
- "children",
- "count",
- "depth",
- "label",
- "name",
- "type"
+ "active",
+ "connectedPeers",
+ "discoveredPeers",
+ "enabled",
+ "maxConcurrentReqs"
],
"additionalProperties": false
},
- "TailChildBlocksRequestInput": {
+ "SyncLocal": {
"type": "object",
"properties": {
- "id": {
+ "concurrentReqs": {
+ "type": "integer"
+ },
+ "endpoint": {
"type": "string"
},
- "ids": {
+ "timeout": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "concurrentReqs",
+ "endpoint",
+ "timeout"
+ ],
+ "additionalProperties": false
+ },
+ "SyncLocalData": {
+ "type": "object",
+ "properties": {
+ "local": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/SyncLocal"
},
{
"type": "null"
}
]
- },
- "n": {
+ }
+ },
+ "required": [
+ "local"
+ ],
+ "additionalProperties": false
+ },
+ "SyncLocalInput": {
+ "type": "object",
+ "properties": {
+ "concurrentReqs": {
"anyOf": [
{
- "type": "number"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "endpoint": {
"anyOf": [
{
"type": "string"
@@ -13419,155 +13640,157 @@
"type": "null"
}
]
+ },
+ "timeout": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "id"
- ],
"additionalProperties": false
},
- "TaskListMarkerRequestInput": {
+ "SyncModeRequestInput": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "marker": {
- "type": "string"
+ "mode": {
+ "type": "number"
}
},
"required": [
- "id",
- "marker"
+ "mode"
],
"additionalProperties": false
},
- "TemplateDocumentInfo": {
+ "SyncNameRequestInput": {
"type": "object",
"properties": {
- "directory": {
- "type": "string"
- },
- "hasDatabase": {
- "type": "boolean"
- },
"name": {
"type": "string"
}
},
"required": [
- "directory",
- "hasDatabase",
"name"
],
"additionalProperties": false
},
- "TemplateDocumentRequestInput": {
+ "SyncOnlineKernel": {
"type": "object",
"properties": {
+ "hostname": {
+ "type": "string"
+ },
"id": {
"type": "string"
+ },
+ "os": {
+ "type": "string"
+ },
+ "ver": {
+ "type": "string"
}
},
"required": [
- "id"
+ "hostname",
+ "id",
+ "os",
+ "ver"
],
"additionalProperties": false
},
- "TemplateFileEntry": {
+ "SyncProviderExportData": {
"type": "object",
"properties": {
- "isDir": {
- "type": "boolean"
- },
- "isPackage": {
- "type": "boolean"
+ "name": {
+ "type": "string"
},
- "path": {
+ "zip": {
"type": "string"
}
},
"required": [
- "isDir",
- "path"
+ "name",
+ "zip"
],
"additionalProperties": false
},
- "TemplateFileRequestInput": {
+ "SyncProviderImportRequestInput": {
"type": "object",
"properties": {
- "action": {
- "type": "string"
- },
- "content": {
- "type": "string"
- },
- "path": {
- "type": "string"
- },
- "revision": {
- "type": "string"
- },
- "target": {
- "type": "string"
+ "file": {
+ "type": "string",
+ "format": "binary"
}
},
"additionalProperties": false
},
- "TemplateFileRevision": {
+ "SyncProviderRequestInput": {
"type": "object",
"properties": {
- "revision": {
- "type": "string"
+ "provider": {
+ "type": "number"
}
},
"required": [
- "revision"
+ "provider"
],
"additionalProperties": false
},
- "TemplateFileSource": {
+ "SyncS3": {
"type": "object",
"properties": {
- "content": {
+ "accessKey": {
"type": "string"
},
- "path": {
+ "bucket": {
"type": "string"
},
- "revision": {
+ "concurrentReqs": {
+ "type": "integer"
+ },
+ "endpoint": {
"type": "string"
+ },
+ "pathStyle": {
+ "type": "boolean"
+ },
+ "region": {
+ "type": "string"
+ },
+ "secretKey": {
+ "type": "string"
+ },
+ "skipTlsVerify": {
+ "type": "boolean"
+ },
+ "timeout": {
+ "type": "integer"
}
},
"required": [
- "content",
- "revision"
+ "accessKey",
+ "bucket",
+ "concurrentReqs",
+ "endpoint",
+ "pathStyle",
+ "region",
+ "secretKey",
+ "skipTlsVerify",
+ "timeout"
],
"additionalProperties": false
},
- "TemplatePlan": {
+ "SyncS3Data": {
"type": "object",
"properties": {
- "count": {
- "type": "integer"
- },
- "id": {
- "type": "string"
- },
- "nodes": {
+ "s3": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/TemplatePlanNode"
- },
- {
- "type": "null"
- }
- ]
- }
+ "$ref": "#/$defs/SyncS3"
},
{
"type": "null"
@@ -13576,168 +13799,97 @@
}
},
"required": [
- "count",
- "id",
- "nodes"
- ],
- "additionalProperties": false
- },
- "TemplatePlanNode": {
- "type": "object",
- "properties": {
- "depth": {
- "type": "integer"
- },
- "hPath": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "parentID": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- },
- "required": [
- "depth",
- "hPath",
- "id",
- "parentID",
- "title"
+ "s3"
],
"additionalProperties": false
},
- "TransferBlockRefRequestInput": {
+ "SyncS3Input": {
"type": "object",
"properties": {
- "fromID": {
- "type": "string"
- },
- "refIDs": {
+ "accessKey": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "reloadUI": {
+ "bucket": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "toID": {
- "type": "string"
- }
- },
- "required": [
- "fromID",
- "toID"
- ],
- "additionalProperties": false
- },
- "TreeStatData": {
- "type": "object",
- "properties": {
- "containsEmbed": {
- "type": "boolean"
- },
- "embedStat": {
+ "concurrentReqs": {
"anyOf": [
{
- "$ref": "#/$defs/EmbedStat"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "reqId": {
- "$ref": "#/$defs/JSONValue"
- },
- "stat": {
+ "endpoint": {
"anyOf": [
{
- "$ref": "#/$defs/BlockStat"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "statWithEmbed": {
+ "pathStyle": {
"anyOf": [
{
- "$ref": "#/$defs/BlockStat"
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "reqId",
- "stat"
- ],
- "additionalProperties": false
- },
- "TreeStatRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
},
- "ids": {
+ "region": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "includeEmbed": {
+ "secretKey": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "skipTlsVerify": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "reqId": {
+ "timeout": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "integer"
},
{
"type": "null"
@@ -13745,71 +13897,73 @@
]
}
},
- "required": [
- "id"
- ],
"additionalProperties": false
},
- "TrimmedIDRequestInput": {
+ "SyncWebDAV": {
"type": "object",
"properties": {
- "id": {
+ "concurrentReqs": {
+ "type": "integer"
+ },
+ "endpoint": {
"type": "string"
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "UnfoldedParentData": {
- "type": "object",
- "properties": {
- "parentID": {
+ },
+ "password": {
+ "type": "string"
+ },
+ "skipTlsVerify": {
+ "type": "boolean"
+ },
+ "timeout": {
+ "type": "integer"
+ },
+ "username": {
"type": "string"
}
},
"required": [
- "parentID"
+ "concurrentReqs",
+ "endpoint",
+ "password",
+ "skipTlsVerify",
+ "timeout",
+ "username"
],
"additionalProperties": false
},
- "UninstallBazaarIconRequestInput": {
+ "SyncWebDAVData": {
"type": "object",
"properties": {
- "keyword": {
+ "webdav": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/SyncWebDAV"
},
{
"type": "null"
}
]
- },
- "packageName": {
- "type": "string"
}
},
"required": [
- "packageName"
+ "webdav"
],
"additionalProperties": false
},
- "UninstallBazaarPluginRequestInput": {
+ "SyncWebDAVInput": {
"type": "object",
"properties": {
- "frontend": {
+ "concurrentReqs": {
"anyOf": [
{
- "type": "string"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "keyword": {
+ "endpoint": {
"anyOf": [
{
"type": "string"
@@ -13819,19 +13973,7 @@
}
]
},
- "packageName": {
- "type": "string"
- }
- },
- "required": [
- "packageName"
- ],
- "additionalProperties": false
- },
- "UninstallBazaarTemplateRequestInput": {
- "type": "object",
- "properties": {
- "keyword": {
+ "password": {
"anyOf": [
{
"type": "string"
@@ -13841,305 +13983,372 @@
}
]
},
- "packageName": {
- "type": "string"
- }
- },
- "required": [
- "packageName"
- ],
- "additionalProperties": false
- },
- "UninstallBazaarThemeRequestInput": {
- "type": "object",
- "properties": {
- "frontend": {
+ "skipTlsVerify": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "keyword": {
+ "timeout": {
"anyOf": [
{
- "type": "string"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "packageName": {
- "type": "string"
+ "username": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "packageName"
- ],
"additionalProperties": false
},
- "UninstallBazaarWidgetRequestInput": {
+ "TagData": {
"type": "object",
"properties": {
- "keyword": {
+ "children": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/TagData"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "packageName": {
+ "count": {
+ "type": "integer"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "label": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
"type": "string"
}
},
"required": [
- "packageName"
+ "children",
+ "count",
+ "depth",
+ "label",
+ "name",
+ "type"
],
"additionalProperties": false
},
- "UnlockNotebookRequestInput": {
+ "TailChildBlocksRequestInput": {
"type": "object",
"properties": {
- "notebook": {
+ "id": {
"type": "string"
},
- "password": {
- "type": "string"
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "n": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "notebook",
- "password"
+ "id"
],
"additionalProperties": false
},
- "UnzipRequestInput": {
+ "TaskListMarkerRequestInput": {
"type": "object",
"properties": {
- "path": {
+ "id": {
"type": "string"
},
- "zipPath": {
+ "marker": {
"type": "string"
}
},
"required": [
- "path",
- "zipPath"
+ "id",
+ "marker"
],
"additionalProperties": false
},
- "UpdateBazaarPackageRequestInput": {
+ "TemplateDocumentInfo": {
"type": "object",
"properties": {
- "frontend": {
+ "directory": {
"type": "string"
},
- "keyword": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "packageName": {
- "type": "string"
+ "hasDatabase": {
+ "type": "boolean"
},
- "packageType": {
+ "name": {
"type": "string"
}
},
"required": [
- "frontend",
- "packageName",
- "packageType"
+ "directory",
+ "hasDatabase",
+ "name"
],
"additionalProperties": false
},
- "UpdateBlockRequestInput": {
+ "TemplateDocumentRequestInput": {
"type": "object",
"properties": {
- "data": {
- "type": "string"
- },
- "dataType": {
- "type": "string"
- },
"id": {
"type": "string"
- },
- "lockType": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
}
},
"required": [
- "data",
- "dataType",
"id"
],
"additionalProperties": false
},
- "UpdateChannelRequestInput": {
+ "TemplateFileEntry": {
"type": "object",
"properties": {
- "updateChannel": {
+ "isDir": {
+ "type": "boolean"
+ },
+ "isPackage": {
+ "type": "boolean"
+ },
+ "path": {
"type": "string"
}
},
"required": [
- "updateChannel"
+ "isDir",
+ "path"
],
"additionalProperties": false
},
- "UpdateEmbedBlockRequestInput": {
+ "TemplateFileRequestInput": {
"type": "object",
"properties": {
+ "action": {
+ "type": "string"
+ },
"content": {
"type": "string"
},
- "id": {
+ "path": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "TemplateFileRevision": {
+ "type": "object",
+ "properties": {
+ "revision": {
"type": "string"
}
},
"required": [
- "content",
- "id"
+ "revision"
],
"additionalProperties": false
},
- "UpdatePinnedDocsRequestInput": {
+ "TemplateFileSource": {
"type": "object",
"properties": {
- "action": {
+ "content": {
"type": "string"
},
- "after": {
- "type": "boolean"
- },
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "path": {
+ "type": "string"
},
- "targetID": {
+ "revision": {
"type": "string"
}
},
"required": [
- "action",
- "ids"
+ "content",
+ "revision"
],
"additionalProperties": false
},
- "ViewStatePatchRequestInput": {
+ "TemplatePlan": {
"type": "object",
"properties": {
- "key": {
+ "count": {
+ "type": "integer"
+ },
+ "id": {
"type": "string"
},
- "removeKeys": {
+ "nodes": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/TemplatePlanNode"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
"type": "null"
}
]
- },
- "values": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- }
- },
- "required": [
- "key"
- ],
- "additionalProperties": false
- },
- "VirtualBlockRefRequestInput": {
- "type": "object",
- "properties": {
- "keywords": {
- "type": "array",
- "items": {
- "type": "string"
- }
}
},
"required": [
- "keywords"
+ "count",
+ "id",
+ "nodes"
],
"additionalProperties": false
},
- "WPSPresentationData": {
+ "TemplatePlanNode": {
"type": "object",
"properties": {
- "converted": {
- "type": "boolean"
+ "depth": {
+ "type": "integer"
},
- "dom": {
+ "hPath": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "parentID": {
+ "type": "string"
+ },
+ "title": {
"type": "string"
}
},
"required": [
- "converted",
- "dom"
+ "depth",
+ "hPath",
+ "id",
+ "parentID",
+ "title"
],
"additionalProperties": false
},
- "WPSPresentationRequestInput": {
+ "TransferBlockRefRequestInput": {
"type": "object",
"properties": {
- "data": {
+ "fromID": {
"type": "string"
},
- "text": {
+ "refIDs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "type": {
+ "reloadUI": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "toID": {
"type": "string"
}
},
"required": [
- "data",
- "type"
+ "fromID",
+ "toID"
],
"additionalProperties": false
},
- "WordCountData": {
+ "TreeStatData": {
"type": "object",
"properties": {
+ "containsEmbed": {
+ "type": "boolean"
+ },
+ "embedStat": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/EmbedStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"reqId": {
"$ref": "#/$defs/JSONValue"
},
@@ -14152,6 +14361,16 @@
"type": "null"
}
]
+ },
+ "statWithEmbed": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
@@ -14160,10 +14379,26 @@
],
"additionalProperties": false
},
- "WorkspaceAVBuiltinColorUpdateInput": {
+ "TreeStatRequestInput": {
"type": "object",
"properties": {
- "customized": {
+ "id": {
+ "type": "string"
+ },
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "includeEmbed": {
"anyOf": [
{
"type": "boolean"
@@ -14173,53 +14408,114 @@
}
]
},
- "dark": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "hidden": {
+ "reqId": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/JSONValue"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "TrimmedIDRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UnfoldedParentData": {
+ "type": "object",
+ "properties": {
+ "parentID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "parentID"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarIconRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
"type": "null"
}
]
},
- "index": {
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarPluginRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
"anyOf": [
{
- "type": "integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "light": {
+ "keyword": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "packageName": {
+ "type": "string"
}
},
+ "required": [
+ "packageName"
+ ],
"additionalProperties": false
},
- "WorkspaceAVPaletteRequestInput": {
+ "UninstallBazaarTemplateRequestInput": {
"type": "object",
"properties": {
- "app": {
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -14229,87 +14525,475 @@
}
]
},
- "builtinColors": {
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarThemeRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/WorkspaceAVBuiltinColorUpdateInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "colors": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AttributeViewCustomColorInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "order": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "packageName": {
+ "type": "string"
}
},
"required": [
- "colors",
- "order"
+ "packageName"
],
"additionalProperties": false
},
- "WorkspaceInfoData": {
+ "UninstallBazaarWidgetRequestInput": {
"type": "object",
"properties": {
- "siyuanVer": {
- "type": "string"
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "workspaceDir": {
+ "packageName": {
"type": "string"
}
},
"required": [
- "siyuanVer",
- "workspaceDir"
+ "packageName"
],
"additionalProperties": false
},
- "ZipRequestInput": {
+ "UnlockNotebookRequestInput": {
"type": "object",
"properties": {
- "path": {
+ "notebook": {
"type": "string"
},
- "zipPath": {
+ "password": {
"type": "string"
}
},
"required": [
- "path",
- "zipPath"
+ "notebook",
+ "password"
],
"additionalProperties": false
- }
- },
- "endpoints": [
- {
+ },
+ "UnzipRequestInput": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "zipPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path",
+ "zipPath"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateBazaarPackageRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
+ "type": "string"
+ },
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ },
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "frontend",
+ "packageName",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ },
+ "dataType": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "lockType": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "dataType",
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateChannelRequestInput": {
+ "type": "object",
+ "properties": {
+ "updateChannel": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "updateChannel"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateEmbedBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UpdatePinnedDocsRequestInput": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string"
+ },
+ "after": {
+ "type": "boolean"
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "targetID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "action",
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "ViewStatePatchRequestInput": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "removeKeys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "values": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ }
+ },
+ "required": [
+ "key"
+ ],
+ "additionalProperties": false
+ },
+ "VirtualBlockRefRequestInput": {
+ "type": "object",
+ "properties": {
+ "keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "keywords"
+ ],
+ "additionalProperties": false
+ },
+ "WPSPresentationData": {
+ "type": "object",
+ "properties": {
+ "converted": {
+ "type": "boolean"
+ },
+ "dom": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "converted",
+ "dom"
+ ],
+ "additionalProperties": false
+ },
+ "WPSPresentationRequestInput": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ },
+ "text": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "data",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "WordCountData": {
+ "type": "object",
+ "properties": {
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
+ },
+ "stat": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "reqId",
+ "stat"
+ ],
+ "additionalProperties": false
+ },
+ "WorkspaceAVBuiltinColorUpdateInput": {
+ "type": "object",
+ "properties": {
+ "customized": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "dark": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleThemeInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "hidden": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "index": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "light": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleThemeInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "WorkspaceAVPaletteRequestInput": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "builtinColors": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/WorkspaceAVBuiltinColorUpdateInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "colors": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AttributeViewCustomColorInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "colors",
+ "order"
+ ],
+ "additionalProperties": false
+ },
+ "WorkspaceInfoData": {
+ "type": "object",
+ "properties": {
+ "siyuanVer": {
+ "type": "string"
+ },
+ "workspaceDir": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "siyuanVer",
+ "workspaceDir"
+ ],
+ "additionalProperties": false
+ },
+ "ZipRequestInput": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "zipPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path",
+ "zipPath"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "endpoints": [
+ {
"method": "GET",
"path": "/api/plugin",
"handler": "listLoadedPluginsGET",
@@ -14574,12 +15258,2227 @@
}
},
{
- "method": "GET",
- "path": "/api/system/bootProgress",
- "handler": "bootProgress",
- "body": "none",
+ "method": "GET",
+ "path": "/api/system/bootProgress",
+ "handler": "bootProgress",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BootProgressData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/api/system/version",
+ "handler": "version",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "string"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/ws/plugin/rpc",
+ "handler": "pluginJsonRpcWebSocket",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "websocket",
+ "websocket": {
+ "incoming": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "outgoing": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
+ },
+ {
+ "$ref": "#/$defs/PluginRPCNotification"
+ }
+ ]
+ },
+ "failureStatus": 404
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/ws/plugin/rpc/:name",
+ "handler": "pluginJsonRpcWebSocketByName",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "websocket",
+ "websocket": {
+ "incoming": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "outgoing": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
+ },
+ {
+ "$ref": "#/$defs/PluginRPCNotification"
+ }
+ ]
+ },
+ "failureStatus": 404
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/checkActivationcode",
+ "handler": "checkActivationcode",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/CheckActivationCodeRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/deactivate",
+ "handler": "deactivateUser",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/login",
+ "handler": "login",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/AccountLoginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AccountLoginData"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1,
+ 10
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AccountLoginData"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/startFreeTrial",
+ "handler": "startFreeTrial",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/useActivationcode",
+ "handler": "useActivationcode",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ActivationCodeRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/archive/unzip",
+ "handler": "unzip",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/UnzipRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/archive/zip",
+ "handler": "zip",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ZipRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/batchGetBlockAttrs",
+ "handler": "batchGetBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BlockIDsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/batchSetBlockAttrs",
+ "handler": "batchSetBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/getBlockAttrs",
+ "handler": "getBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BlockIDRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/getBookmarkLabels",
+ "handler": "getBookmarkLabels",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/resetBlockAttrs",
+ "handler": "resetBlockAttrs",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/setBlockAttrs",
+ "handler": "setBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/SetBlockAttrsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/searchAttributeViewNonRelationKey",
+ "handler": "searchAttributeViewNonRelationKey",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/batchUpdatePackage",
+ "handler": "batchUpdatePackage",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BatchUpdatePackageRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarIcon",
+ "handler": "getBazaarIcon",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarIconRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackage",
+ "handler": "getBazaarPackage",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageREADME",
+ "handler": "getBazaarPackageREADME",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageREADMERequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarREADMEData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageRating",
+ "handler": "getBazaarPackageRating",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRatingRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarRatingResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageRatings",
+ "handler": "getBazaarPackageRatings",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRatingsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarRatingsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageUserRatings",
+ "handler": "getBazaarPackageUserRatings",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageUserRatingsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarUserRatingsResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarUserRatingsResult"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPlugin",
+ "handler": "getBazaarPlugin",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPluginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarTemplate",
+ "handler": "getBazaarTemplate",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarTemplateRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarTheme",
+ "handler": "getBazaarTheme",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarThemeRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarWidget",
+ "handler": "getBazaarWidget",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -14593,7 +17492,7 @@
]
},
"data": {
- "$ref": "#/$defs/BootProgressData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -14612,7 +17511,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -14649,12 +17549,12 @@
}
},
{
- "method": "GET",
- "path": "/api/system/version",
- "handler": "version",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledIcon",
+ "handler": "getInstalledIcon",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledIconRequestInput"
},
"response": {
"anyOf": [
@@ -14668,7 +17568,7 @@
]
},
"data": {
- "type": "string"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -14687,7 +17587,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -14724,45 +17625,26 @@
}
},
{
- "method": "GET",
- "path": "/ws/plugin/rpc",
- "handler": "pluginJsonRpcWebSocket",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledPackageSize",
+ "handler": "getInstalledPackageSize",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledPackageSizeRequestInput"
},
"response": {
"anyOf": [
- {
- "$ref": "#/$defs/PluginRPCFailure"
- },
{
"type": "object",
"properties": {
"code": {
"type": "integer",
"enum": [
- -1
+ 0
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackageSizeData"
},
"msg": {
"type": "string"
@@ -14773,68 +17655,7 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- },
- "output": "websocket",
- "websocket": {
- "incoming": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- "minItems": 1
- }
- ]
- },
- "outgoing": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
- ]
- },
- "minItems": 1
- },
- {
- "$ref": "#/$defs/PluginRPCNotification"
- }
- ]
- },
- "failureStatus": 404
- }
- },
- {
- "method": "GET",
- "path": "/ws/plugin/rpc/:name",
- "handler": "pluginJsonRpcWebSocketByName",
- "body": "none",
- "request": {
- "$ref": "#/$defs/EmptyRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCFailure"
+ "additionalProperties": false
},
{
"type": "object",
@@ -14842,7 +17663,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -14876,60 +17698,15 @@
"additionalProperties": true
}
]
- },
- "output": "websocket",
- "websocket": {
- "incoming": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- "minItems": 1
- }
- ]
- },
- "outgoing": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
- ]
- },
- "minItems": 1
- },
- {
- "$ref": "#/$defs/PluginRPCNotification"
- }
- ]
- },
- "failureStatus": 404
}
},
{
"method": "POST",
- "path": "/api/account/checkActivationcode",
- "handler": "checkActivationcode",
+ "path": "/api/bazaar/getInstalledPlugin",
+ "handler": "getInstalledPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/CheckActivationCodeRequestInput"
+ "$ref": "#/$defs/GetInstalledPluginRequestInput"
},
"response": {
"anyOf": [
@@ -14943,7 +17720,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -14980,9 +17757,6 @@
],
"additionalProperties": false
},
- {
- "type": "null"
- },
{
"type": "null"
}
@@ -15004,11 +17778,11 @@
},
{
"method": "POST",
- "path": "/api/account/deactivate",
- "handler": "deactivateUser",
- "body": "none",
+ "path": "/api/bazaar/getInstalledTemplate",
+ "handler": "getInstalledTemplate",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -15022,7 +17796,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15041,7 +17815,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15079,11 +17854,11 @@
},
{
"method": "POST",
- "path": "/api/account/login",
- "handler": "login",
+ "path": "/api/bazaar/getInstalledTheme",
+ "handler": "getInstalledTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/AccountLoginRequestInput"
+ "$ref": "#/$defs/GetInstalledThemeRequestInput"
},
"response": {
"anyOf": [
@@ -15097,14 +17872,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/AccountLoginData"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15124,8 +17892,7 @@
"type": "integer",
"enum": [
-1,
- 1,
- 10
+ 1
]
},
"data": {
@@ -15144,16 +17911,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/AccountLoginData"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -15173,11 +17930,11 @@
},
{
"method": "POST",
- "path": "/api/account/startFreeTrial",
- "handler": "startFreeTrial",
- "body": "none",
+ "path": "/api/bazaar/getInstalledWidget",
+ "handler": "getInstalledWidget",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -15191,7 +17948,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15210,7 +17967,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15248,11 +18006,11 @@
},
{
"method": "POST",
- "path": "/api/account/useActivationcode",
- "handler": "useActivationcode",
+ "path": "/api/bazaar/getUpdatedPackage",
+ "handler": "getUpdatedPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/ActivationCodeRequestInput"
+ "$ref": "#/$defs/GetUpdatedPackageRequestInput"
},
"response": {
"anyOf": [
@@ -15266,7 +18024,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarUpdatedData"
},
"msg": {
"type": "string"
@@ -15285,7 +18043,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15323,11 +18082,11 @@
},
{
"method": "POST",
- "path": "/api/archive/unzip",
- "handler": "unzip",
+ "path": "/api/bazaar/installBazaarIcon",
+ "handler": "installBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/UnzipRequestInput"
+ "$ref": "#/$defs/InstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -15341,7 +18100,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -15360,7 +18119,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15398,11 +18158,11 @@
},
{
"method": "POST",
- "path": "/api/archive/zip",
- "handler": "zip",
+ "path": "/api/bazaar/installBazaarPlugin",
+ "handler": "installBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/ZipRequestInput"
+ "$ref": "#/$defs/InstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -15416,7 +18176,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15435,7 +18195,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15473,11 +18234,11 @@
},
{
"method": "POST",
- "path": "/api/attr/batchGetBlockAttrs",
- "handler": "batchGetBlockAttrs",
+ "path": "/api/bazaar/installBazaarTemplate",
+ "handler": "installBazaarTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDsRequestInput"
+ "$ref": "#/$defs/InstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -15491,20 +18252,7 @@
]
},
"data": {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- }
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15523,7 +18271,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15561,11 +18310,11 @@
},
{
"method": "POST",
- "path": "/api/attr/batchSetBlockAttrs",
- "handler": "batchSetBlockAttrs",
+ "path": "/api/bazaar/installBazaarTheme",
+ "handler": "installBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"
+ "$ref": "#/$defs/InstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -15579,7 +18328,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -15598,7 +18347,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15636,11 +18386,11 @@
},
{
"method": "POST",
- "path": "/api/attr/getBlockAttrs",
- "handler": "getBlockAttrs",
+ "path": "/api/bazaar/installBazaarWidget",
+ "handler": "installBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/InstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -15654,10 +18404,7 @@
]
},
"data": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15676,7 +18423,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15714,11 +18462,11 @@
},
{
"method": "POST",
- "path": "/api/attr/getBookmarkLabels",
- "handler": "getBookmarkLabels",
- "body": "none",
+ "path": "/api/bazaar/installLocalBazaarPackage",
+ "handler": "installLocalBazaarPackage",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/InstallLocalBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -15732,17 +18480,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarLocalInstallResult"
},
"msg": {
"type": "string"
@@ -15761,7 +18499,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15780,6 +18519,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarLocalInstallResult"
}
]
},
@@ -15799,11 +18541,11 @@
},
{
"method": "POST",
- "path": "/api/attr/resetBlockAttrs",
- "handler": "resetBlockAttrs",
- "body": "none",
+ "path": "/api/bazaar/setBazaarPackageRating",
+ "handler": "setBazaarPackageRating",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SetBazaarPackageRatingRequestInput"
},
"response": {
"anyOf": [
@@ -15817,7 +18559,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarRatingResult"
},
"msg": {
"type": "string"
@@ -15836,7 +18578,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15855,6 +18598,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -15874,11 +18620,11 @@
},
{
"method": "POST",
- "path": "/api/attr/setBlockAttrs",
- "handler": "setBlockAttrs",
+ "path": "/api/bazaar/uninstallBazaarIcon",
+ "handler": "uninstallBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/SetBlockAttrsRequestInput"
+ "$ref": "#/$defs/UninstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -15892,7 +18638,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -15911,7 +18657,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -15949,11 +18696,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeViewNonRelationKey",
- "handler": "searchAttributeViewNonRelationKey",
- "body": "none",
+ "path": "/api/bazaar/uninstallBazaarPlugin",
+ "handler": "uninstallBazaarPlugin",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/UninstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -15967,7 +18714,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -15986,7 +18733,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -16024,11 +18772,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/batchUpdatePackage",
- "handler": "batchUpdatePackage",
+ "path": "/api/bazaar/uninstallBazaarTemplate",
+ "handler": "uninstallBazaarTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchUpdatePackageRequestInput"
+ "$ref": "#/$defs/UninstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -16042,7 +18790,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -16100,11 +18848,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarIcon",
- "handler": "getBazaarIcon",
+ "path": "/api/bazaar/uninstallBazaarTheme",
+ "handler": "uninstallBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarIconRequestInput"
+ "$ref": "#/$defs/UninstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -16118,7 +18866,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -16176,11 +18924,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackage",
- "handler": "getBazaarPackage",
+ "path": "/api/bazaar/uninstallBazaarWidget",
+ "handler": "uninstallBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRequestInput"
+ "$ref": "#/$defs/UninstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -16194,7 +18942,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackageDetail"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -16252,11 +19000,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageREADME",
- "handler": "getBazaarPackageREADME",
+ "path": "/api/bazaar/updateBazaarPackage",
+ "handler": "updateBazaarPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageREADMERequestInput"
+ "$ref": "#/$defs/UpdateBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -16270,7 +19018,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarREADMEData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -16328,11 +19076,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageRating",
- "handler": "getBazaarPackageRating",
+ "path": "/api/block/appendBlock",
+ "handler": "appendBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRatingRequestInput"
+ "$ref": "#/$defs/AppendBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16346,7 +19094,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarRatingResult"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16365,8 +19130,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16385,9 +19149,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -16407,11 +19168,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageRatings",
- "handler": "getBazaarPackageRatings",
+ "path": "/api/block/appendDailyNoteBlock",
+ "handler": "appendDailyNoteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRatingsRequestInput"
+ "$ref": "#/$defs/DailyNoteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16425,7 +19186,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarRatingsData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16444,8 +19222,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16483,11 +19260,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageUserRatings",
- "handler": "getBazaarPackageUserRatings",
+ "path": "/api/block/appendHeadingChildren",
+ "handler": "appendHeadingChildren",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageUserRatingsRequestInput"
+ "$ref": "#/$defs/AppendHeadingChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -16501,7 +19278,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarUserRatingsResult"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -16520,8 +19297,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16540,9 +19316,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarUserRatingsResult"
}
]
},
@@ -16562,11 +19335,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPlugin",
- "handler": "getBazaarPlugin",
+ "path": "/api/block/batchAppendBlock",
+ "handler": "batchAppendBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPluginRequestInput"
+ "$ref": "#/$defs/BatchParentBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16580,7 +19353,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16599,8 +19389,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16638,11 +19427,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarTemplate",
- "handler": "getBazaarTemplate",
+ "path": "/api/block/batchInsertBlock",
+ "handler": "batchInsertBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarTemplateRequestInput"
+ "$ref": "#/$defs/BatchInsertBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16656,7 +19445,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16675,8 +19481,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16714,11 +19519,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarTheme",
- "handler": "getBazaarTheme",
+ "path": "/api/block/batchPrependBlock",
+ "handler": "batchPrependBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarThemeRequestInput"
+ "$ref": "#/$defs/BatchParentBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16732,7 +19537,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16751,8 +19573,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16790,11 +19611,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarWidget",
- "handler": "getBazaarWidget",
+ "path": "/api/block/batchUpdateBlock",
+ "handler": "batchUpdateBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarWidgetRequestInput"
+ "$ref": "#/$defs/BatchUpdateBlockRequestInput"
},
"response": {
"anyOf": [
@@ -16808,7 +19629,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16827,8 +19665,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16866,11 +19703,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledIcon",
- "handler": "getInstalledIcon",
+ "path": "/api/block/batchUpdateTaskListItemMarker",
+ "handler": "batchUpdateTaskListItemMarker",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledIconRequestInput"
+ "$ref": "#/$defs/BatchTaskListMarkerRequestInput"
},
"response": {
"anyOf": [
@@ -16884,7 +19721,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -16903,8 +19757,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -16942,11 +19795,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledPackageSize",
- "handler": "getInstalledPackageSize",
+ "path": "/api/block/checkBlockExist",
+ "handler": "checkBlockExist",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledPackageSizeRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -16960,7 +19813,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackageSizeData"
+ "type": "boolean"
},
"msg": {
"type": "string"
@@ -16979,8 +19832,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17018,11 +19870,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledPlugin",
- "handler": "getInstalledPlugin",
+ "path": "/api/block/checkBlockFold",
+ "handler": "checkBlockFold",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledPluginRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -17036,7 +19888,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BlockFoldData"
},
"msg": {
"type": "string"
@@ -17055,8 +19907,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17094,11 +19945,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledTemplate",
- "handler": "getInstalledTemplate",
+ "path": "/api/block/checkBlockRef",
+ "handler": "checkBlockRef",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledTemplateRequestInput"
+ "$ref": "#/$defs/CheckBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -17112,7 +19963,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "type": "boolean"
},
"msg": {
"type": "string"
@@ -17131,8 +19982,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17151,6 +20001,9 @@
},
{
"type": "null"
+ },
+ {
+ "type": "boolean"
}
]
},
@@ -17170,11 +20023,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledTheme",
- "handler": "getInstalledTheme",
+ "path": "/api/block/checkBlocksExist",
+ "handler": "checkBlocksExist",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledThemeRequestInput"
+ "$ref": "#/$defs/CheckBlocksExistRequestInput"
},
"response": {
"anyOf": [
@@ -17187,43 +20040,13 @@
0
]
},
- "data": {
- "$ref": "#/$defs/BazaarPackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
"data": {
"anyOf": [
{
"type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "additionalProperties": {
+ "type": "boolean"
+ }
},
{
"type": "null"
@@ -17239,42 +20062,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/bazaar/getInstalledWidget",
- "handler": "getInstalledWidget",
- "body": "json",
- "request": {
- "$ref": "#/$defs/GetInstalledWidgetRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/BazaarPackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -17283,8 +20070,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17322,11 +20108,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getUpdatedPackage",
- "handler": "getUpdatedPackage",
+ "path": "/api/block/deleteBlock",
+ "handler": "deleteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/GetUpdatedPackageRequestInput"
+ "$ref": "#/$defs/DeleteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -17340,7 +20126,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarUpdatedData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -17359,8 +20162,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17398,11 +20200,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarIcon",
- "handler": "installBazaarIcon",
+ "path": "/api/block/foldBlock",
+ "handler": "foldBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarIconRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -17416,7 +20218,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -17435,8 +20237,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17474,11 +20275,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarPlugin",
- "handler": "installBazaarPlugin",
+ "path": "/api/block/getBlockBreadcrumb",
+ "handler": "getBlockBreadcrumb",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarPluginRequestInput"
+ "$ref": "#/$defs/BlockBreadcrumbRequestInput"
},
"response": {
"anyOf": [
@@ -17492,7 +20293,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -17511,8 +20329,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17550,11 +20367,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarTemplate",
- "handler": "installBazaarTemplate",
+ "path": "/api/block/getBlockBreadcrumbChildren",
+ "handler": "getBlockBreadcrumbChildren",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarTemplateRequestInput"
+ "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -17568,7 +20385,14 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockBreadcrumbChildren"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -17587,8 +20411,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17626,11 +20449,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarTheme",
- "handler": "installBazaarTheme",
+ "path": "/api/block/getBlockDOM",
+ "handler": "getBlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarThemeRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -17644,7 +20467,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "$ref": "#/$defs/BlockDOMData"
},
"msg": {
"type": "string"
@@ -17663,8 +20486,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17702,11 +20524,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarWidget",
- "handler": "installBazaarWidget",
+ "path": "/api/block/getBlockDOMWithEmbed",
+ "handler": "getBlockDOMWithEmbed",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarWidgetRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -17720,7 +20542,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BlockDOMData"
},
"msg": {
"type": "string"
@@ -17739,8 +20561,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17778,11 +20599,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installLocalBazaarPackage",
- "handler": "installLocalBazaarPackage",
- "body": "multipart",
+ "path": "/api/block/getBlockDOMs",
+ "handler": "getBlockDOMs",
+ "body": "json",
"request": {
- "$ref": "#/$defs/InstallLocalBazaarPackageRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -17795,49 +20616,16 @@
0
]
},
- "data": {
- "$ref": "#/$defs/BazaarLocalInstallResult"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
"data": {
"anyOf": [
{
"type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "additionalProperties": {
+ "type": "string"
+ }
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarLocalInstallResult"
}
]
},
@@ -17850,42 +20638,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/bazaar/setBazaarPackageRating",
- "handler": "setBazaarPackageRating",
- "body": "json",
- "request": {
- "$ref": "#/$defs/SetBazaarPackageRatingRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/BazaarRatingResult"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -17894,8 +20646,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -17914,9 +20665,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -17936,11 +20684,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarIcon",
- "handler": "uninstallBazaarIcon",
+ "path": "/api/block/getBlockDOMsWithEmbed",
+ "handler": "getBlockDOMsWithEmbed",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarIconRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -17953,43 +20701,13 @@
0
]
},
- "data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
"data": {
"anyOf": [
{
"type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "additionalProperties": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -18005,42 +20723,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/bazaar/uninstallBazaarPlugin",
- "handler": "uninstallBazaarPlugin",
- "body": "json",
- "request": {
- "$ref": "#/$defs/UninstallBazaarPluginRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/BazaarPackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -18049,8 +20731,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -18088,11 +20769,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarTemplate",
- "handler": "uninstallBazaarTemplate",
+ "path": "/api/block/getBlockDefIDsByRefText",
+ "handler": "getBlockDefIDsByRefText",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarTemplateRequestInput"
+ "$ref": "#/$defs/RefTextQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18106,7 +20787,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/RefDefsData"
},
"msg": {
"type": "string"
@@ -18125,8 +20806,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -18164,11 +20844,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarTheme",
- "handler": "uninstallBazaarTheme",
+ "path": "/api/block/getBlockIndex",
+ "handler": "getBlockIndex",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarThemeRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18182,7 +20862,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "type": "integer"
},
"msg": {
"type": "string"
@@ -18201,8 +20881,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -18240,11 +20919,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarWidget",
- "handler": "uninstallBazaarWidget",
+ "path": "/api/block/getBlockInfo",
+ "handler": "getBlockInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarWidgetRequestInput"
+ "$ref": "#/$defs/BlockInfoRequestInput"
},
"response": {
"anyOf": [
@@ -18258,7 +20937,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BlockInfoData"
},
"msg": {
"type": "string"
@@ -18278,7 +20957,7 @@
"type": "integer",
"enum": [
-1,
- 1
+ 3
]
},
"data": {
@@ -18297,6 +20976,9 @@
},
{
"type": "null"
+ },
+ {
+ "type": "string"
}
]
},
@@ -18316,11 +20998,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/updateBazaarPackage",
- "handler": "updateBazaarPackage",
+ "path": "/api/block/getBlockKramdown",
+ "handler": "getBlockKramdown",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdateBazaarPackageRequestInput"
+ "$ref": "#/$defs/BlockKramdownRequestInput"
},
"response": {
"anyOf": [
@@ -18334,7 +21016,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BlockKramdownData"
},
"msg": {
"type": "string"
@@ -18353,8 +21035,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -18392,11 +21073,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendBlock",
- "handler": "appendBlock",
+ "path": "/api/block/getBlockKramdowns",
+ "handler": "getBlockKramdowns",
"body": "json",
"request": {
- "$ref": "#/$defs/AppendBlockRequestInput"
+ "$ref": "#/$defs/BlocksKramdownRequestInput"
},
"response": {
"anyOf": [
@@ -18412,16 +21093,9 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
{
@@ -18484,11 +21158,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendDailyNoteBlock",
- "handler": "appendDailyNoteBlock",
+ "path": "/api/block/getBlockRelevantIDs",
+ "handler": "getBlockRelevantIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/DailyNoteBlockRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18502,24 +21176,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BlockRelevantData"
},
"msg": {
"type": "string"
@@ -18576,11 +21233,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendHeadingChildren",
- "handler": "appendHeadingChildren",
+ "path": "/api/block/getBlockSiblingID",
+ "handler": "getBlockSiblingID",
"body": "json",
"request": {
- "$ref": "#/$defs/AppendHeadingChildrenRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18594,7 +21251,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BlockSiblingData"
},
"msg": {
"type": "string"
@@ -18651,11 +21308,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchAppendBlock",
- "handler": "batchAppendBlock",
+ "path": "/api/block/getBlockTreeInfos",
+ "handler": "getBlockTreeInfos",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchParentBlockRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18671,11 +21328,11 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
+ "type": "object",
+ "additionalProperties": {
"anyOf": [
{
- "$ref": "#/$defs/BlockTransaction"
+ "$ref": "#/$defs/BlockTreeInfo"
},
{
"type": "null"
@@ -18743,11 +21400,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchInsertBlock",
- "handler": "batchInsertBlock",
+ "path": "/api/block/getBlocksIndexes",
+ "handler": "getBlocksIndexes",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchInsertBlockRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18763,16 +21420,9 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
}
},
{
@@ -18835,11 +21485,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchPrependBlock",
- "handler": "batchPrependBlock",
+ "path": "/api/block/getBlocksWordCount",
+ "handler": "getBlocksWordCount",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchParentBlockRequestInput"
+ "$ref": "#/$defs/BlocksWordCountRequestInput"
},
"response": {
"anyOf": [
@@ -18853,24 +21503,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/WordCountData"
},
"msg": {
"type": "string"
@@ -18927,11 +21560,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchUpdateBlock",
- "handler": "batchUpdateBlock",
+ "path": "/api/block/getChildBlocks",
+ "handler": "getChildBlocks",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchUpdateBlockRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -18945,24 +21578,17 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ChildBlock"
+ },
+ {
+ "type": "null"
}
- },
- {
- "type": "null"
- }
- ]
+ ]
+ }
},
"msg": {
"type": "string"
@@ -19019,11 +21645,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchUpdateTaskListItemMarker",
- "handler": "batchUpdateTaskListItemMarker",
+ "path": "/api/block/getContentWordCount",
+ "handler": "getContentWordCount",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchTaskListMarkerRequestInput"
+ "$ref": "#/$defs/ContentWordCountRequestInput"
},
"response": {
"anyOf": [
@@ -19037,24 +21663,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/WordCountData"
},
"msg": {
"type": "string"
@@ -19111,11 +21720,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockExist",
- "handler": "checkBlockExist",
+ "path": "/api/block/getDOMText",
+ "handler": "getDOMText",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/DOMTextRequestInput"
},
"response": {
"anyOf": [
@@ -19129,7 +21738,7 @@
]
},
"data": {
- "type": "boolean"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -19186,11 +21795,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockFold",
- "handler": "checkBlockFold",
+ "path": "/api/block/getDocBlocksOrders",
+ "handler": "getDocBlocksOrders",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/DocOrdersRequestInput"
},
"response": {
"anyOf": [
@@ -19204,7 +21813,17 @@
]
},
"data": {
- "$ref": "#/$defs/BlockFoldData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -19261,11 +21880,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockRef",
- "handler": "checkBlockRef",
- "body": "json",
+ "path": "/api/block/getDocHeadingLevelTransaction",
+ "handler": "getDocHeadingLevelTransaction",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/CheckBlockRefRequestInput"
+ "$ref": "#/$defs/DocHeadingLevelRequestInput"
},
"response": {
"anyOf": [
@@ -19279,7 +21898,14 @@
]
},
"data": {
- "type": "boolean"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DocHeadingLevelData"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -19317,9 +21943,6 @@
},
{
"type": "null"
- },
- {
- "type": "boolean"
}
]
},
@@ -19339,11 +21962,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlocksExist",
- "handler": "checkBlocksExist",
+ "path": "/api/block/getDocInfo",
+ "handler": "getDocInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/CheckBlocksExistRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -19359,10 +21982,7 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
+ "$ref": "#/$defs/DocInfo"
},
{
"type": "null"
@@ -19424,11 +22044,11 @@
},
{
"method": "POST",
- "path": "/api/block/deleteBlock",
- "handler": "deleteBlock",
+ "path": "/api/block/getDocsInfo",
+ "handler": "getDocsInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/DeleteBlockRequestInput"
+ "$ref": "#/$defs/DocsInfoRequestInput"
},
"response": {
"anyOf": [
@@ -19448,7 +22068,7 @@
"items": {
"anyOf": [
{
- "$ref": "#/$defs/BlockTransaction"
+ "$ref": "#/$defs/DocInfo"
},
{
"type": "null"
@@ -19516,11 +22136,11 @@
},
{
"method": "POST",
- "path": "/api/block/foldBlock",
- "handler": "foldBlock",
+ "path": "/api/block/getHeadingChildrenDOM",
+ "handler": "getHeadingChildrenDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/HeadingChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -19534,7 +22154,7 @@
]
},
"data": {
- "type": "null"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -19591,11 +22211,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockBreadcrumb",
- "handler": "getBlockBreadcrumb",
+ "path": "/api/block/getHeadingChildrenIDs",
+ "handler": "getHeadingChildrenIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockBreadcrumbRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -19613,14 +22233,7 @@
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockPath"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -19683,11 +22296,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockBreadcrumbChildren",
- "handler": "getBlockBreadcrumbChildren",
+ "path": "/api/block/getHeadingDeleteTransaction",
+ "handler": "getHeadingDeleteTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -19703,7 +22316,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/BlockBreadcrumbChildren"
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -19765,11 +22378,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOM",
- "handler": "getBlockDOM",
+ "path": "/api/block/getHeadingFoldTransaction",
+ "handler": "getHeadingFoldTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/HeadingFoldRequestInput"
},
"response": {
"anyOf": [
@@ -19783,7 +22396,14 @@
]
},
"data": {
- "$ref": "#/$defs/BlockDOMData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -19840,11 +22460,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMWithEmbed",
- "handler": "getBlockDOMWithEmbed",
+ "path": "/api/block/getHeadingInsertTransaction",
+ "handler": "getHeadingInsertTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -19858,7 +22478,14 @@
]
},
"data": {
- "$ref": "#/$defs/BlockDOMData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -19915,11 +22542,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMs",
- "handler": "getBlockDOMs",
+ "path": "/api/block/getHeadingLevelTransaction",
+ "handler": "getHeadingLevelTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/HeadingLevelRequestInput"
},
"response": {
"anyOf": [
@@ -19935,10 +22562,7 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -20000,11 +22624,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMsWithEmbed",
- "handler": "getBlockDOMsWithEmbed",
+ "path": "/api/block/getOrderedListContinueStart",
+ "handler": "getOrderedListContinueStart",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -20017,12 +22641,94 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/OrderedListStartData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
"type": "object",
- "additionalProperties": {
- "type": "string"
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/block/getRecentUpdatedBlocks",
+ "handler": "getRecentUpdatedBlocks",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -20085,11 +22791,86 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDefIDsByRefText",
- "handler": "getBlockDefIDsByRefText",
+ "path": "/api/block/getRefIDs",
+ "handler": "getRefIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/RefTextQueryRequestInput"
+ "$ref": "#/$defs/RefIDsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/RefIDsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/block/getRefIDsByFileAnnotationID",
+ "handler": "getRefIDsByFileAnnotationID",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/FileAnnotationRefRequestInput"
},
"response": {
"anyOf": [
@@ -20160,8 +22941,8 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockIndex",
- "handler": "getBlockIndex",
+ "path": "/api/block/getRefText",
+ "handler": "getRefText",
"body": "json",
"request": {
"$ref": "#/$defs/BlockQueryRequestInput"
@@ -20178,7 +22959,7 @@
]
},
"data": {
- "type": "integer"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -20235,11 +23016,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockInfo",
- "handler": "getBlockInfo",
+ "path": "/api/block/getTailChildBlocks",
+ "handler": "getTailChildBlocks",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockInfoRequestInput"
+ "$ref": "#/$defs/TailChildBlocksRequestInput"
},
"response": {
"anyOf": [
@@ -20253,7 +23034,17 @@
]
},
"data": {
- "$ref": "#/$defs/BlockInfoData"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ChildBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
"msg": {
"type": "string"
@@ -20272,8 +23063,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 3
+ -1
]
},
"data": {
@@ -20292,9 +23082,6 @@
},
{
"type": "null"
- },
- {
- "type": "string"
}
]
},
@@ -20314,11 +23101,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockKramdown",
- "handler": "getBlockKramdown",
+ "path": "/api/block/getTreeStat",
+ "handler": "getTreeStat",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockKramdownRequestInput"
+ "$ref": "#/$defs/TreeStatRequestInput"
},
"response": {
"anyOf": [
@@ -20332,7 +23119,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockKramdownData"
+ "$ref": "#/$defs/TreeStatData"
},
"msg": {
"type": "string"
@@ -20389,11 +23176,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockKramdowns",
- "handler": "getBlockKramdowns",
+ "path": "/api/block/getUnfoldedParentID",
+ "handler": "getUnfoldedParentID",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksKramdownRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -20407,17 +23194,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/UnfoldedParentData"
},
"msg": {
"type": "string"
@@ -20474,11 +23251,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockRelevantIDs",
- "handler": "getBlockRelevantIDs",
+ "path": "/api/block/insertBlock",
+ "handler": "insertBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/InsertBlockRequestInput"
},
"response": {
"anyOf": [
@@ -20492,7 +23269,24 @@
]
},
"data": {
- "$ref": "#/$defs/BlockRelevantData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -20549,11 +23343,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockSiblingID",
- "handler": "getBlockSiblingID",
+ "path": "/api/block/moveBlock",
+ "handler": "moveBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/MoveBlockRequestInput"
},
"response": {
"anyOf": [
@@ -20567,7 +23361,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockSiblingData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -20624,11 +23418,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockTreeInfos",
- "handler": "getBlockTreeInfos",
+ "path": "/api/block/moveOutlineHeading",
+ "handler": "moveOutlineHeading",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/MoveBlockRequestInput"
},
"response": {
"anyOf": [
@@ -20644,11 +23438,11 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
+ "type": "array",
+ "items": {
"anyOf": [
{
- "$ref": "#/$defs/BlockTreeInfo"
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -20716,11 +23510,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlocksIndexes",
- "handler": "getBlocksIndexes",
+ "path": "/api/block/prependBlock",
+ "handler": "prependBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/PrependBlockRequestInput"
},
"response": {
"anyOf": [
@@ -20736,9 +23530,16 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "integer"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -20801,11 +23602,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlocksWordCount",
- "handler": "getBlocksWordCount",
+ "path": "/api/block/prependDailyNoteBlock",
+ "handler": "prependDailyNoteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksWordCountRequestInput"
+ "$ref": "#/$defs/DailyNoteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -20818,42 +23619,20 @@
0
]
},
- "data": {
- "$ref": "#/$defs/WordCountData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -20869,52 +23648,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/block/getChildBlocks",
- "handler": "getChildBlocks",
- "body": "json",
- "request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/ChildBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -20961,11 +23694,11 @@
},
{
"method": "POST",
- "path": "/api/block/getContentWordCount",
- "handler": "getContentWordCount",
+ "path": "/api/block/setBlockReminder",
+ "handler": "setBlockReminder",
"body": "json",
"request": {
- "$ref": "#/$defs/ContentWordCountRequestInput"
+ "$ref": "#/$defs/BlockReminderRequestInput"
},
"response": {
"anyOf": [
@@ -20979,7 +23712,7 @@
]
},
"data": {
- "$ref": "#/$defs/WordCountData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21036,11 +23769,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDOMText",
- "handler": "getDOMText",
+ "path": "/api/block/swapBlockRef",
+ "handler": "swapBlockRef",
"body": "json",
"request": {
- "$ref": "#/$defs/DOMTextRequestInput"
+ "$ref": "#/$defs/SwapBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -21054,7 +23787,7 @@
]
},
"data": {
- "type": "string"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21111,11 +23844,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocBlocksOrders",
- "handler": "getDocBlocksOrders",
+ "path": "/api/block/transferBlockRef",
+ "handler": "transferBlockRef",
"body": "json",
"request": {
- "$ref": "#/$defs/DocOrdersRequestInput"
+ "$ref": "#/$defs/TransferBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -21129,17 +23862,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21196,11 +23919,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocHeadingLevelTransaction",
- "handler": "getDocHeadingLevelTransaction",
- "body": "structJSON",
+ "path": "/api/block/unfoldBlock",
+ "handler": "unfoldBlock",
+ "body": "json",
"request": {
- "$ref": "#/$defs/DocHeadingLevelRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -21214,14 +23937,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/DocHeadingLevelData"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21278,11 +23994,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocInfo",
- "handler": "getDocInfo",
+ "path": "/api/block/updateBlock",
+ "handler": "updateBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/UpdateBlockRequestInput"
},
"response": {
"anyOf": [
@@ -21298,7 +24014,17 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/DocInfo"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -21360,11 +24086,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocsInfo",
- "handler": "getDocsInfo",
+ "path": "/api/block/updateTaskListItemMarker",
+ "handler": "updateTaskListItemMarker",
"body": "json",
"request": {
- "$ref": "#/$defs/DocsInfoRequestInput"
+ "$ref": "#/$defs/TaskListMarkerRequestInput"
},
"response": {
"anyOf": [
@@ -21384,7 +24110,7 @@
"items": {
"anyOf": [
{
- "$ref": "#/$defs/DocInfo"
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -21452,86 +24178,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingChildrenDOM",
- "handler": "getHeadingChildrenDOM",
- "body": "json",
- "request": {
- "$ref": "#/$defs/HeadingChildrenRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "string"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/block/getHeadingChildrenIDs",
- "handler": "getHeadingChildrenIDs",
- "body": "json",
+ "path": "/api/bookmark/getBookmark",
+ "handler": "getBookmark",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -21549,7 +24200,14 @@
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Bookmark"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -21612,11 +24270,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingDeleteTransaction",
- "handler": "getHeadingDeleteTransaction",
+ "path": "/api/bookmark/removeBookmark",
+ "handler": "removeBookmark",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/RemoveBookmarkRequestInput"
},
"response": {
"anyOf": [
@@ -21630,14 +24288,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21694,11 +24345,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingFoldTransaction",
- "handler": "getHeadingFoldTransaction",
+ "path": "/api/bookmark/renameBookmark",
+ "handler": "renameBookmark",
"body": "json",
"request": {
- "$ref": "#/$defs/HeadingFoldRequestInput"
+ "$ref": "#/$defs/RenameBookmarkRequestInput"
},
"response": {
"anyOf": [
@@ -21712,14 +24363,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -21776,11 +24420,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingInsertTransaction",
- "handler": "getHeadingInsertTransaction",
+ "path": "/api/broadcast/getChannelInfo",
+ "handler": "getChannelInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/BroadcastChannelRequestInput"
},
"response": {
"anyOf": [
@@ -21794,14 +24438,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BroadcastChannelData"
},
"msg": {
"type": "string"
@@ -21858,11 +24495,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingLevelTransaction",
- "handler": "getHeadingLevelTransaction",
- "body": "json",
+ "path": "/api/broadcast/getChannels",
+ "handler": "getChannels",
+ "body": "none",
"request": {
- "$ref": "#/$defs/HeadingLevelRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -21876,14 +24513,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BroadcastChannelsData"
},
"msg": {
"type": "string"
@@ -21940,11 +24570,11 @@
},
{
"method": "POST",
- "path": "/api/block/getOrderedListContinueStart",
- "handler": "getOrderedListContinueStart",
+ "path": "/api/broadcast/postMessage",
+ "handler": "postMessage",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/BroadcastMessageRequestInput"
},
"response": {
"anyOf": [
@@ -21958,7 +24588,7 @@
]
},
"data": {
- "$ref": "#/$defs/OrderedListStartData"
+ "$ref": "#/$defs/BroadcastChannelData"
},
"msg": {
"type": "string"
@@ -21977,7 +24607,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -22015,11 +24646,25 @@
},
{
"method": "POST",
- "path": "/api/block/getRecentUpdatedBlocks",
- "handler": "getRecentUpdatedBlocks",
- "body": "none",
+ "path": "/api/broadcast/publish",
+ "handler": "broadcastPublish",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "format": "binary"
+ }
+ ]
+ }
+ }
},
"response": {
"anyOf": [
@@ -22033,24 +24678,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BroadcastPublishData"
},
"msg": {
"type": "string"
@@ -22069,7 +24697,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -22107,11 +24736,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRefIDs",
- "handler": "getRefIDs",
+ "path": "/api/clipboard/cleanupRichText",
+ "handler": "cleanupRichText",
"body": "json",
"request": {
- "$ref": "#/$defs/RefIDsRequestInput"
+ "$ref": "#/$defs/CleanupRichTextRequestInput"
},
"response": {
"anyOf": [
@@ -22125,7 +24754,7 @@
]
},
"data": {
- "$ref": "#/$defs/RefIDsData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -22182,11 +24811,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRefIDsByFileAnnotationID",
- "handler": "getRefIDsByFileAnnotationID",
+ "path": "/api/clipboard/prepareRichText",
+ "handler": "prepareRichText",
"body": "json",
"request": {
- "$ref": "#/$defs/FileAnnotationRefRequestInput"
+ "$ref": "#/$defs/PrepareRichTextRequestInput"
},
"response": {
"anyOf": [
@@ -22200,7 +24829,14 @@
]
},
"data": {
- "$ref": "#/$defs/RefDefsData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/RichClipboardPrepared"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -22257,11 +24893,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRefText",
- "handler": "getRefText",
- "body": "json",
+ "path": "/api/clipboard/readFilePaths",
+ "handler": "readFilePaths",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -22275,7 +24911,10 @@
]
},
"data": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/ClipboardFile"
+ }
},
"msg": {
"type": "string"
@@ -22332,11 +24971,11 @@
},
{
"method": "POST",
- "path": "/api/block/getTailChildBlocks",
- "handler": "getTailChildBlocks",
+ "path": "/api/clipboard/writeFilePath",
+ "handler": "writeFilePath",
"body": "json",
"request": {
- "$ref": "#/$defs/TailChildBlocksRequestInput"
+ "$ref": "#/$defs/ClipboardPathRequestInput"
},
"response": {
"anyOf": [
@@ -22350,17 +24989,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/ChildBlock"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "null"
},
"msg": {
"type": "string"
@@ -22417,11 +25046,11 @@
},
{
"method": "POST",
- "path": "/api/block/getTreeStat",
- "handler": "getTreeStat",
- "body": "json",
+ "path": "/api/cloud/getCloudSpace",
+ "handler": "getCloudSpace",
+ "body": "none",
"request": {
- "$ref": "#/$defs/TreeStatRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -22435,7 +25064,7 @@
]
},
"data": {
- "$ref": "#/$defs/TreeStatData"
+ "$ref": "#/$defs/CloudSpaceData"
},
"msg": {
"type": "string"
@@ -22454,7 +25083,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -22492,11 +25122,11 @@
},
{
"method": "POST",
- "path": "/api/block/getUnfoldedParentID",
- "handler": "getUnfoldedParentID",
+ "path": "/api/cloud/setCloudReminder",
+ "handler": "setCloudReminder",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/CloudReminderRequestInput"
},
"response": {
"anyOf": [
@@ -22510,7 +25140,7 @@
]
},
"data": {
- "$ref": "#/$defs/UnfoldedParentData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -22567,11 +25197,11 @@
},
{
"method": "POST",
- "path": "/api/block/insertBlock",
- "handler": "insertBlock",
+ "path": "/api/convert/pandoc",
+ "handler": "pandoc",
"body": "json",
"request": {
- "$ref": "#/$defs/InsertBlockRequestInput"
+ "$ref": "#/$defs/PandocRequestInput"
},
"response": {
"anyOf": [
@@ -22585,24 +25215,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/PandocData"
},
"msg": {
"type": "string"
@@ -22659,11 +25272,11 @@
},
{
"method": "POST",
- "path": "/api/block/moveBlock",
- "handler": "moveBlock",
+ "path": "/api/file/copyFile",
+ "handler": "copyFile",
"body": "json",
"request": {
- "$ref": "#/$defs/MoveBlockRequestInput"
+ "$ref": "#/$defs/CopyFileRequestInput"
},
"response": {
"anyOf": [
@@ -22696,7 +25309,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -2
]
},
"data": {
@@ -22734,53 +25348,17 @@
},
{
"method": "POST",
- "path": "/api/block/moveOutlineHeading",
- "handler": "moveOutlineHeading",
+ "path": "/api/file/getFile",
+ "handler": "getFile",
"body": "json",
"request": {
- "$ref": "#/$defs/MoveBlockRequestInput"
+ "$ref": "#/$defs/FilePathRequestInput"
},
"response": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
+ "type": "string",
+ "format": "binary"
},
{
"type": "object",
@@ -22788,7 +25366,13 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 403,
+ 404,
+ 409,
+ 500,
+ 503
]
},
"data": {
@@ -22822,15 +25406,17 @@
"additionalProperties": true
}
]
- }
+ },
+ "output": "binary",
+ "errorStatus": 202
},
{
"method": "POST",
- "path": "/api/block/prependBlock",
- "handler": "prependBlock",
+ "path": "/api/file/getUniqueFilename",
+ "handler": "getUniqueFilename",
"body": "json",
"request": {
- "$ref": "#/$defs/PrependBlockRequestInput"
+ "$ref": "#/$defs/FilePathRequestInput"
},
"response": {
"anyOf": [
@@ -22844,24 +25430,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/FilePathData"
},
"msg": {
"type": "string"
@@ -22880,7 +25449,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3
]
},
"data": {
@@ -22918,11 +25488,11 @@
},
{
"method": "POST",
- "path": "/api/block/prependDailyNoteBlock",
- "handler": "prependDailyNoteBlock",
+ "path": "/api/file/globalCopyFiles",
+ "handler": "globalCopyFiles",
"body": "json",
"request": {
- "$ref": "#/$defs/DailyNoteBlockRequestInput"
+ "$ref": "#/$defs/CopyFilesRequestInput"
},
"response": {
"anyOf": [
@@ -22936,24 +25506,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -22972,7 +25525,10 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -2,
+ -3,
+ 403
]
},
"data": {
@@ -23010,11 +25566,11 @@
},
{
"method": "POST",
- "path": "/api/block/setBlockReminder",
- "handler": "setBlockReminder",
- "body": "json",
+ "path": "/api/file/putFile",
+ "handler": "putFile",
+ "body": "form",
"request": {
- "$ref": "#/$defs/BlockReminderRequestInput"
+ "$ref": "#/$defs/PutFileRequestInput"
},
"response": {
"anyOf": [
@@ -23047,7 +25603,11 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 400,
+ 403,
+ 500
]
},
"data": {
@@ -23085,11 +25645,11 @@
},
{
"method": "POST",
- "path": "/api/block/swapBlockRef",
- "handler": "swapBlockRef",
+ "path": "/api/file/readDir",
+ "handler": "readDir",
"body": "json",
"request": {
- "$ref": "#/$defs/SwapBlockRefRequestInput"
+ "$ref": "#/$defs/ReadDirectoryRequestInput"
},
"response": {
"anyOf": [
@@ -23103,7 +25663,10 @@
]
},
"data": {
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/DirectoryEntry"
+ }
},
"msg": {
"type": "string"
@@ -23122,7 +25685,12 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 403,
+ 404,
+ 409,
+ 500
]
},
"data": {
@@ -23160,11 +25728,11 @@
},
{
"method": "POST",
- "path": "/api/block/transferBlockRef",
- "handler": "transferBlockRef",
+ "path": "/api/file/removeFile",
+ "handler": "removeFile",
"body": "json",
"request": {
- "$ref": "#/$defs/TransferBlockRefRequestInput"
+ "$ref": "#/$defs/RemoveFileRequestInput"
},
"response": {
"anyOf": [
@@ -23197,7 +25765,11 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 403,
+ 404,
+ 500
]
},
"data": {
@@ -23235,11 +25807,11 @@
},
{
"method": "POST",
- "path": "/api/block/unfoldBlock",
- "handler": "unfoldBlock",
+ "path": "/api/file/renameFile",
+ "handler": "renameFile",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/RenameFileRequestInput"
},
"response": {
"anyOf": [
@@ -23272,7 +25844,12 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 403,
+ 404,
+ 409,
+ 500
]
},
"data": {
@@ -23310,11 +25887,11 @@
},
{
"method": "POST",
- "path": "/api/block/updateBlock",
- "handler": "updateBlock",
+ "path": "/api/file/workspaceCopyFiles",
+ "handler": "workspaceCopyFiles",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdateBlockRequestInput"
+ "$ref": "#/$defs/CopyFilesRequestInput"
},
"response": {
"anyOf": [
@@ -23328,24 +25905,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -23364,7 +25924,10 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -2,
+ -3,
+ 403
]
},
"data": {
@@ -23402,11 +25965,11 @@
},
{
"method": "POST",
- "path": "/api/block/updateTaskListItemMarker",
- "handler": "updateTaskListItemMarker",
- "body": "json",
+ "path": "/api/filetree/getPinnedDocs",
+ "handler": "getPinnedDocs",
+ "body": "none",
"request": {
- "$ref": "#/$defs/TaskListMarkerRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -23420,24 +25983,10 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PinnedDoc"
+ }
},
"msg": {
"type": "string"
@@ -23494,11 +26043,11 @@
},
{
"method": "POST",
- "path": "/api/bookmark/getBookmark",
- "handler": "getBookmark",
- "body": "none",
+ "path": "/api/filetree/updatePinnedDocs",
+ "handler": "updatePinnedDocs",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/UpdatePinnedDocsRequestInput"
},
"response": {
"anyOf": [
@@ -23512,24 +26061,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Bookmark"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -23586,11 +26118,11 @@
},
{
"method": "POST",
- "path": "/api/bookmark/removeBookmark",
- "handler": "removeBookmark",
+ "path": "/api/format/autoSpace",
+ "handler": "autoSpace",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveBookmarkRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -23661,11 +26193,11 @@
},
{
"method": "POST",
- "path": "/api/bookmark/renameBookmark",
- "handler": "renameBookmark",
+ "path": "/api/format/netAssets2LocalAssets",
+ "handler": "netAssets2LocalAssets",
"body": "json",
"request": {
- "$ref": "#/$defs/RenameBookmarkRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -23736,11 +26268,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/getChannelInfo",
- "handler": "getChannelInfo",
+ "path": "/api/format/netImg2LocalAssets",
+ "handler": "netImg2LocalAssets",
"body": "json",
"request": {
- "$ref": "#/$defs/BroadcastChannelRequestInput"
+ "$ref": "#/$defs/NetImageAssetsRequestInput"
},
"response": {
"anyOf": [
@@ -23754,7 +26286,7 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -23811,11 +26343,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/getChannels",
- "handler": "getChannels",
- "body": "none",
+ "path": "/api/graph/getGraph",
+ "handler": "getGraph",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GlobalGraphRequestInput"
},
"response": {
"anyOf": [
@@ -23829,7 +26361,14 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelsData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GlobalGraphResult"
+ },
+ {
+ "$ref": "#/$defs/GraphCorrelation"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -23867,6 +26406,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GlobalGraphResult"
+ },
+ {
+ "$ref": "#/$defs/GraphCorrelation"
+ }
+ ]
}
]
},
@@ -23886,11 +26435,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/postMessage",
- "handler": "postMessage",
+ "path": "/api/graph/getLocalGraph",
+ "handler": "getLocalGraph",
"body": "json",
"request": {
- "$ref": "#/$defs/BroadcastMessageRequestInput"
+ "$ref": "#/$defs/LocalGraphRequestInput"
},
"response": {
"anyOf": [
@@ -23904,7 +26453,14 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LocalGraphResult"
+ },
+ {
+ "$ref": "#/$defs/GraphCorrelation"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -23923,8 +26479,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -23943,6 +26498,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LocalGraphResult"
+ },
+ {
+ "$ref": "#/$defs/GraphCorrelation"
+ }
+ ]
}
]
},
@@ -23962,25 +26527,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/publish",
- "handler": "broadcastPublish",
- "body": "multipart",
+ "path": "/api/graph/resetGraph",
+ "handler": "resetGraph",
+ "body": "none",
"request": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "format": "binary"
- }
- ]
- }
- }
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -23994,7 +26545,7 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastPublishData"
+ "$ref": "#/$defs/ResetGraphData"
},
"msg": {
"type": "string"
@@ -24013,8 +26564,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -24052,11 +26602,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/cleanupRichText",
- "handler": "cleanupRichText",
- "body": "json",
+ "path": "/api/graph/resetLocalGraph",
+ "handler": "resetLocalGraph",
+ "body": "none",
"request": {
- "$ref": "#/$defs/CleanupRichTextRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -24070,7 +26620,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ResetLocalGraphData"
},
"msg": {
"type": "string"
@@ -24127,11 +26677,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/prepareRichText",
- "handler": "prepareRichText",
+ "path": "/api/graph/setGraphConf",
+ "handler": "setGraphConf",
"body": "json",
"request": {
- "$ref": "#/$defs/PrepareRichTextRequestInput"
+ "$ref": "#/$defs/SetGraphConfRequestInput"
},
"response": {
"anyOf": [
@@ -24147,10 +26697,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/RichClipboardPrepared"
+ "$ref": "#/$defs/GlobalGraphConf"
},
{
- "type": "null"
+ "$ref": "#/$defs/LocalGraphConf"
}
]
},
@@ -24209,8 +26759,8 @@
},
{
"method": "POST",
- "path": "/api/clipboard/readFilePaths",
- "handler": "readFilePaths",
+ "path": "/api/history/clearWorkspaceHistory",
+ "handler": "clearWorkspaceHistory",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -24227,10 +26777,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/ClipboardFile"
- }
+ "type": "null"
},
"msg": {
"type": "string"
@@ -24287,11 +26834,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/writeFilePath",
- "handler": "writeFilePath",
+ "path": "/api/history/createAssetHistory",
+ "handler": "createAssetHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/ClipboardPathRequestInput"
+ "$ref": "#/$defs/CreateAssetHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -24362,11 +26909,11 @@
},
{
"method": "POST",
- "path": "/api/cloud/getCloudSpace",
- "handler": "getCloudSpace",
- "body": "none",
+ "path": "/api/history/createDocHistory",
+ "handler": "createDocHistory",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/CreateDocHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -24380,7 +26927,7 @@
]
},
"data": {
- "$ref": "#/$defs/CloudSpaceData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -24399,8 +26946,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -24438,11 +26984,11 @@
},
{
"method": "POST",
- "path": "/api/cloud/setCloudReminder",
- "handler": "setCloudReminder",
+ "path": "/api/history/diffDocVersions",
+ "handler": "diffDocVersions",
"body": "json",
"request": {
- "$ref": "#/$defs/CloudReminderRequestInput"
+ "$ref": "#/$defs/DiffDocVersionsRequestInput"
},
"response": {
"anyOf": [
@@ -24456,7 +27002,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DocVersionDiffResult"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -24513,11 +27066,11 @@
},
{
"method": "POST",
- "path": "/api/convert/pandoc",
- "handler": "pandoc",
+ "path": "/api/history/getDocHistoryContent",
+ "handler": "getDocHistoryContent",
"body": "json",
"request": {
- "$ref": "#/$defs/PandocRequestInput"
+ "$ref": "#/$defs/DocHistoryContentRequestInput"
},
"response": {
"anyOf": [
@@ -24531,7 +27084,7 @@
]
},
"data": {
- "$ref": "#/$defs/PandocData"
+ "$ref": "#/$defs/DocHistoryContentData"
},
"msg": {
"type": "string"
@@ -24588,11 +27141,11 @@
},
{
"method": "POST",
- "path": "/api/file/copyFile",
- "handler": "copyFile",
+ "path": "/api/history/getHistoryItems",
+ "handler": "getHistoryItems",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyFileRequestInput"
+ "$ref": "#/$defs/HistoryItemsRequestInput"
},
"response": {
"anyOf": [
@@ -24606,7 +27159,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/HistoryItemsData"
},
"msg": {
"type": "string"
@@ -24625,8 +27178,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -2
+ -1
]
},
"data": {
@@ -24664,75 +27216,11 @@
},
{
"method": "POST",
- "path": "/api/file/getFile",
- "handler": "getFile",
- "body": "json",
- "request": {
- "$ref": "#/$defs/FilePathRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "string",
- "format": "binary"
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- -3,
- 403,
- 404,
- 409,
- 500,
- 503
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- },
- "output": "binary",
- "errorStatus": 202
- },
- {
- "method": "POST",
- "path": "/api/file/getUniqueFilename",
- "handler": "getUniqueFilename",
- "body": "json",
+ "path": "/api/history/getNotebookHistory",
+ "handler": "getNotebookHistory",
+ "body": "none",
"request": {
- "$ref": "#/$defs/FilePathRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -24746,7 +27234,7 @@
]
},
"data": {
- "$ref": "#/$defs/FilePathData"
+ "$ref": "#/$defs/NotebookHistoryData"
},
"msg": {
"type": "string"
@@ -24765,8 +27253,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3
+ -1
]
},
"data": {
@@ -24804,11 +27291,11 @@
},
{
"method": "POST",
- "path": "/api/file/globalCopyFiles",
- "handler": "globalCopyFiles",
- "body": "json",
+ "path": "/api/history/reindexHistory",
+ "handler": "reindexHistory",
+ "body": "none",
"request": {
- "$ref": "#/$defs/CopyFilesRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -24841,10 +27328,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -2,
- -3,
- 403
+ -1
]
},
"data": {
@@ -24882,11 +27366,11 @@
},
{
"method": "POST",
- "path": "/api/file/putFile",
- "handler": "putFile",
- "body": "form",
+ "path": "/api/history/rollbackAssetsHistory",
+ "handler": "rollbackAssetsHistory",
+ "body": "json",
"request": {
- "$ref": "#/$defs/PutFileRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -24919,11 +27403,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 400,
- 403,
- 500
+ -1
]
},
"data": {
@@ -24961,11 +27441,11 @@
},
{
"method": "POST",
- "path": "/api/file/readDir",
- "handler": "readDir",
+ "path": "/api/history/rollbackAttributeViewHistory",
+ "handler": "rollbackAttributeViewHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/ReadDirectoryRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -24979,10 +27459,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/DirectoryEntry"
- }
+ "type": "null"
},
"msg": {
"type": "string"
@@ -25001,12 +27478,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 403,
- 404,
- 409,
- 500
+ -1
]
},
"data": {
@@ -25044,11 +27516,11 @@
},
{
"method": "POST",
- "path": "/api/file/removeFile",
- "handler": "removeFile",
+ "path": "/api/history/rollbackDocHistory",
+ "handler": "rollbackDocHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveFileRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -25081,11 +27553,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 403,
- 404,
- 500
+ -1
]
},
"data": {
@@ -25123,11 +27591,11 @@
},
{
"method": "POST",
- "path": "/api/file/renameFile",
- "handler": "renameFile",
+ "path": "/api/history/rollbackNotebookHistory",
+ "handler": "rollbackNotebookHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/RenameFileRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -25160,12 +27628,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 403,
- 404,
- 409,
- 500
+ -1
]
},
"data": {
@@ -25203,11 +27666,11 @@
},
{
"method": "POST",
- "path": "/api/file/workspaceCopyFiles",
- "handler": "workspaceCopyFiles",
+ "path": "/api/history/searchHistory",
+ "handler": "searchHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyFilesRequestInput"
+ "$ref": "#/$defs/SearchHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -25221,7 +27684,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SearchHistoryData"
},
"msg": {
"type": "string"
@@ -25240,10 +27703,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -2,
- -3,
- 403
+ -1
]
},
"data": {
@@ -25281,11 +27741,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getPinnedDocs",
- "handler": "getPinnedDocs",
- "body": "none",
+ "path": "/api/import/cancelImportSY",
+ "handler": "cancelImportSY",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ImportTokenRequestInput"
},
"response": {
"anyOf": [
@@ -25299,10 +27759,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PinnedDoc"
- }
+ "type": "null"
},
"msg": {
"type": "string"
@@ -25359,11 +27816,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/updatePinnedDocs",
- "handler": "updatePinnedDocs",
+ "path": "/api/import/cancelObsidianVaultTask",
+ "handler": "cancelObsidianVaultTask",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdatePinnedDocsRequestInput"
+ "$ref": "#/$defs/ObsidianTaskRequestInput"
},
"response": {
"anyOf": [
@@ -25377,7 +27834,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -25415,6 +27879,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -25434,11 +27908,11 @@
},
{
"method": "POST",
- "path": "/api/format/autoSpace",
- "handler": "autoSpace",
+ "path": "/api/import/continueImportSY",
+ "handler": "continueImportSY",
"body": "json",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/ContinueImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -25452,7 +27926,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ImportDocumentData"
},
"msg": {
"type": "string"
@@ -25509,11 +27983,11 @@
},
{
"method": "POST",
- "path": "/api/format/netAssets2LocalAssets",
- "handler": "netAssets2LocalAssets",
+ "path": "/api/import/getObsidianVaultTask",
+ "handler": "getObsidianVaultTask",
"body": "json",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/ObsidianTaskRequestInput"
},
"response": {
"anyOf": [
@@ -25527,7 +28001,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -25584,11 +28065,11 @@
},
{
"method": "POST",
- "path": "/api/format/netImg2LocalAssets",
- "handler": "netImg2LocalAssets",
- "body": "json",
+ "path": "/api/import/importData",
+ "handler": "importData",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/NetImageAssetsRequestInput"
+ "$ref": "#/$defs/ImportDataRequestInput"
},
"response": {
"anyOf": [
@@ -25659,11 +28140,11 @@
},
{
"method": "POST",
- "path": "/api/graph/getGraph",
- "handler": "getGraph",
- "body": "json",
+ "path": "/api/import/importSY",
+ "handler": "importSY",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/GlobalGraphRequestInput"
+ "$ref": "#/$defs/ImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -25677,14 +28158,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -25722,16 +28196,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
}
]
},
@@ -25751,11 +28215,11 @@
},
{
"method": "POST",
- "path": "/api/graph/getLocalGraph",
- "handler": "getLocalGraph",
- "body": "json",
+ "path": "/api/import/importSYAuto",
+ "handler": "importSYAuto",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/LocalGraphRequestInput"
+ "$ref": "#/$defs/ImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -25771,10 +28235,13 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/LocalGraphResult"
+ "$ref": "#/$defs/ImportAutoDocument"
},
{
- "$ref": "#/$defs/GraphCorrelation"
+ "$ref": "#/$defs/ImportAutoNotebook"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebooks"
}
]
},
@@ -25818,10 +28285,13 @@
{
"anyOf": [
{
- "$ref": "#/$defs/LocalGraphResult"
+ "$ref": "#/$defs/ImportAutoDocument"
},
{
- "$ref": "#/$defs/GraphCorrelation"
+ "$ref": "#/$defs/ImportAutoNotebook"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebooks"
}
]
}
@@ -25843,11 +28313,11 @@
},
{
"method": "POST",
- "path": "/api/graph/resetGraph",
- "handler": "resetGraph",
- "body": "none",
+ "path": "/api/import/importSYNotebook",
+ "handler": "importSYNotebook",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ImportDataRequestInput"
},
"response": {
"anyOf": [
@@ -25861,7 +28331,14 @@
]
},
"data": {
- "$ref": "#/$defs/ResetGraphData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ImportedNotebook"
+ },
+ {
+ "$ref": "#/$defs/ImportedNotebooks"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -25918,11 +28395,11 @@
},
{
"method": "POST",
- "path": "/api/graph/resetLocalGraph",
- "handler": "resetLocalGraph",
- "body": "none",
+ "path": "/api/import/importStdMd",
+ "handler": "importStdMd",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ImportMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -25936,7 +28413,7 @@
]
},
"data": {
- "$ref": "#/$defs/ResetLocalGraphData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -25993,11 +28470,11 @@
},
{
"method": "POST",
- "path": "/api/graph/setGraphConf",
- "handler": "setGraphConf",
- "body": "json",
+ "path": "/api/import/importZipMd",
+ "handler": "importZipMd",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/SetGraphConfRequestInput"
+ "$ref": "#/$defs/ImportZipMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -26011,14 +28488,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphConf"
- },
- {
- "$ref": "#/$defs/LocalGraphConf"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -26075,11 +28545,11 @@
},
{
"method": "POST",
- "path": "/api/history/clearWorkspaceHistory",
- "handler": "clearWorkspaceHistory",
- "body": "none",
+ "path": "/api/import/startObsidianVaultAnalysis",
+ "handler": "startObsidianVaultAnalysis",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ObsidianAnalysisRequestInput"
},
"response": {
"anyOf": [
@@ -26093,7 +28563,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -26150,11 +28627,11 @@
},
{
"method": "POST",
- "path": "/api/history/createAssetHistory",
- "handler": "createAssetHistory",
+ "path": "/api/import/startObsidianVaultImport",
+ "handler": "startObsidianVaultImport",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateAssetHistoryRequestInput"
+ "$ref": "#/$defs/ObsidianImportRequestInput"
},
"response": {
"anyOf": [
@@ -26168,7 +28645,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -26225,11 +28709,11 @@
},
{
"method": "POST",
- "path": "/api/history/createDocHistory",
- "handler": "createDocHistory",
+ "path": "/api/inbox/getShorthand",
+ "handler": "getShorthand",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateDocHistoryRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -26243,7 +28727,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Shorthand"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -26262,7 +28753,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -26300,11 +28792,11 @@
},
{
"method": "POST",
- "path": "/api/history/diffDocVersions",
- "handler": "diffDocVersions",
+ "path": "/api/inbox/getShorthands",
+ "handler": "getShorthands",
"body": "json",
"request": {
- "$ref": "#/$defs/DiffDocVersionsRequestInput"
+ "$ref": "#/$defs/ShorthandsRequestInput"
},
"response": {
"anyOf": [
@@ -26320,7 +28812,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/DocVersionDiffResult"
+ "$ref": "#/$defs/ShorthandsData"
},
{
"type": "null"
@@ -26344,7 +28836,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -26382,11 +28875,11 @@
},
{
"method": "POST",
- "path": "/api/history/getDocHistoryContent",
- "handler": "getDocHistoryContent",
+ "path": "/api/inbox/removeShorthands",
+ "handler": "removeShorthands",
"body": "json",
"request": {
- "$ref": "#/$defs/DocHistoryContentRequestInput"
+ "$ref": "#/$defs/RemoveShorthandsRequestInput"
},
"response": {
"anyOf": [
@@ -26400,7 +28893,7 @@
]
},
"data": {
- "$ref": "#/$defs/DocHistoryContentData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -26419,7 +28912,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -26457,11 +28951,11 @@
},
{
"method": "POST",
- "path": "/api/history/getHistoryItems",
- "handler": "getHistoryItems",
+ "path": "/api/lute/copyStdMarkdown",
+ "handler": "copyStdMarkdown",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryItemsRequestInput"
+ "$ref": "#/$defs/CopyStdMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -26475,7 +28969,7 @@
]
},
"data": {
- "$ref": "#/$defs/HistoryItemsData"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -26532,11 +29026,11 @@
},
{
"method": "POST",
- "path": "/api/history/getNotebookHistory",
- "handler": "getNotebookHistory",
- "body": "none",
+ "path": "/api/lute/html2BlockDOM",
+ "handler": "html2BlockDOM",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/HTMLClipboardRequestInput"
},
"response": {
"anyOf": [
@@ -26550,7 +29044,14 @@
]
},
"data": {
- "$ref": "#/$defs/NotebookHistoryData"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/$defs/HTMLClipboardPreflight"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -26607,11 +29108,11 @@
},
{
"method": "POST",
- "path": "/api/history/reindexHistory",
- "handler": "reindexHistory",
- "body": "none",
+ "path": "/api/lute/md2html",
+ "handler": "md2HTML",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/MarkdownHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -26625,7 +29126,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/HTMLData"
},
"msg": {
"type": "string"
@@ -26682,11 +29183,87 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackAssetsHistory",
- "handler": "rollbackAssetsHistory",
+ "path": "/api/lute/spinBlockDOM",
+ "handler": "spinBlockDOM",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/DOMTextRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/DOMData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 413
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/lute/wpsPresentation2BlockDOM",
+ "handler": "wpsPresentation2BlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/WPSPresentationRequestInput"
},
"response": {
"anyOf": [
@@ -26700,7 +29277,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/WPSPresentationData"
},
"msg": {
"type": "string"
@@ -26738,6 +29315,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/WPSPresentationData"
}
]
},
@@ -26757,11 +29337,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackAttributeViewHistory",
- "handler": "rollbackAttributeViewHistory",
+ "path": "/api/notebook/changeMasterPassword",
+ "handler": "changeMasterPassword",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ChangeMasterPasswordRequestInput"
},
"response": {
"anyOf": [
@@ -26832,11 +29412,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackDocHistory",
- "handler": "rollbackDocHistory",
+ "path": "/api/notebook/changeSortNotebook",
+ "handler": "changeSortNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ChangeSortNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -26907,11 +29487,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackNotebookHistory",
- "handler": "rollbackNotebookHistory",
+ "path": "/api/notebook/closeNotebook",
+ "handler": "closeNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/CloseNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -26982,11 +29562,11 @@
},
{
"method": "POST",
- "path": "/api/history/searchHistory",
- "handler": "searchHistory",
+ "path": "/api/notebook/createEncryptedNotebook",
+ "handler": "createEncryptedNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchHistoryRequestInput"
+ "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -27000,7 +29580,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchHistoryData"
+ "$ref": "#/$defs/CreateNotebookData"
},
"msg": {
"type": "string"
@@ -27057,11 +29637,11 @@
},
{
"method": "POST",
- "path": "/api/import/cancelImportSY",
- "handler": "cancelImportSY",
+ "path": "/api/notebook/createNotebook",
+ "handler": "createNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/ImportTokenRequestInput"
+ "$ref": "#/$defs/CreateNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -27075,7 +29655,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/CreateNotebookData"
},
"msg": {
"type": "string"
@@ -27132,11 +29712,11 @@
},
{
"method": "POST",
- "path": "/api/import/cancelObsidianVaultTask",
- "handler": "cancelObsidianVaultTask",
- "body": "json",
+ "path": "/api/notebook/disableEncryptedNotebooks",
+ "handler": "disableEncryptedNotebooks",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ObsidianTaskRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -27149,10 +29729,42 @@
0
]
},
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ObsidianVaultTask"
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -27168,6 +29780,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/notebook/enableEncryptedNotebooks",
+ "handler": "enableEncryptedNotebooks",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/NotebookPasswordRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -27195,16 +29843,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -27224,11 +29862,11 @@
},
{
"method": "POST",
- "path": "/api/import/continueImportSY",
- "handler": "continueImportSY",
- "body": "json",
+ "path": "/api/notebook/exportNotebookCryptoBackup",
+ "handler": "exportNotebookCryptoBackup",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ContinueImportSYRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -27242,7 +29880,7 @@
]
},
"data": {
- "$ref": "#/$defs/ImportDocumentData"
+ "$ref": "#/$defs/NotebookCryptoBackupData"
},
"msg": {
"type": "string"
@@ -27299,11 +29937,11 @@
},
{
"method": "POST",
- "path": "/api/import/getObsidianVaultTask",
- "handler": "getObsidianVaultTask",
- "body": "json",
+ "path": "/api/notebook/getEncryptedNotebookStatus",
+ "handler": "getEncryptedNotebookStatus",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ObsidianTaskRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -27316,10 +29954,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/EncryptedNotebookStatusData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ObsidianVaultTask"
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -27335,6 +30005,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/notebook/getNotebookConf",
+ "handler": "getNotebookConf",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/CloseNotebookRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/NotebookConfData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -27381,11 +30087,11 @@
},
{
"method": "POST",
- "path": "/api/import/importData",
- "handler": "importData",
- "body": "multipart",
+ "path": "/api/notebook/getNotebookInfo",
+ "handler": "getNotebookInfo",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportDataRequestInput"
+ "$ref": "#/$defs/NotebookIDRequestInput"
},
"response": {
"anyOf": [
@@ -27399,7 +30105,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/NotebookInfoData"
},
"msg": {
"type": "string"
@@ -27456,11 +30162,11 @@
},
{
"method": "POST",
- "path": "/api/import/importSY",
- "handler": "importSY",
+ "path": "/api/notebook/importNotebookCryptoBackup",
+ "handler": "importNotebookCryptoBackup",
"body": "multipart",
"request": {
- "$ref": "#/$defs/ImportSYRequestInput"
+ "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"
},
"response": {
"anyOf": [
@@ -27531,11 +30237,11 @@
},
{
"method": "POST",
- "path": "/api/import/importSYAuto",
- "handler": "importSYAuto",
- "body": "multipart",
+ "path": "/api/notebook/lockNotebook",
+ "handler": "lockNotebook",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportSYRequestInput"
+ "$ref": "#/$defs/NotebookIDRequestInput"
},
"response": {
"anyOf": [
@@ -27549,17 +30255,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ImportAutoDocument"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebook"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebooks"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -27597,19 +30293,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ImportAutoDocument"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebook"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebooks"
- }
- ]
}
]
},
@@ -27629,11 +30312,11 @@
},
{
"method": "POST",
- "path": "/api/import/importSYNotebook",
- "handler": "importSYNotebook",
- "body": "multipart",
+ "path": "/api/notebook/lsNotebooks",
+ "handler": "lsNotebooks",
+ "body": "legacyOptional",
"request": {
- "$ref": "#/$defs/ImportDataRequestInput"
+ "$ref": "#/$defs/ListNotebooksRequestInput"
},
"response": {
"anyOf": [
@@ -27649,10 +30332,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ImportedNotebook"
+ "$ref": "#/$defs/ListNotebooksData"
},
{
- "$ref": "#/$defs/ImportedNotebooks"
+ "type": "null"
}
]
},
@@ -27711,11 +30394,11 @@
},
{
"method": "POST",
- "path": "/api/import/importStdMd",
- "handler": "importStdMd",
+ "path": "/api/notebook/openNotebook",
+ "handler": "openNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/ImportMarkdownRequestInput"
+ "$ref": "#/$defs/OpenNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -27786,11 +30469,11 @@
},
{
"method": "POST",
- "path": "/api/import/importZipMd",
- "handler": "importZipMd",
- "body": "multipart",
+ "path": "/api/notebook/removeNotebook",
+ "handler": "removeNotebook",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportZipMarkdownRequestInput"
+ "$ref": "#/$defs/NotebookIDRequestInput"
},
"response": {
"anyOf": [
@@ -27861,11 +30544,11 @@
},
{
"method": "POST",
- "path": "/api/import/startObsidianVaultAnalysis",
- "handler": "startObsidianVaultAnalysis",
+ "path": "/api/notebook/renameNotebook",
+ "handler": "renameNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/ObsidianAnalysisRequestInput"
+ "$ref": "#/$defs/RenameNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -27879,14 +30562,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -27943,11 +30619,11 @@
},
{
"method": "POST",
- "path": "/api/import/startObsidianVaultImport",
- "handler": "startObsidianVaultImport",
- "body": "json",
+ "path": "/api/notebook/reorder",
+ "handler": "reorderNotebooks",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/ObsidianImportRequestInput"
+ "$ref": "#/$defs/ReorderNotebooksRequestInput"
},
"response": {
"anyOf": [
@@ -27963,7 +30639,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ObsidianVaultTask"
+ "$ref": "#/$defs/ReorderData"
},
{
"type": "null"
@@ -28006,89 +30682,16 @@
},
{
"type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/inbox/getShorthand",
- "handler": "getShorthand",
- "body": "json",
- "request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "anyOf": [
- {
- "$ref": "#/$defs/Shorthand"
},
{
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ReorderData"
+ },
+ {
+ "type": "null"
}
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
+ ]
}
]
},
@@ -28108,11 +30711,11 @@
},
{
"method": "POST",
- "path": "/api/inbox/getShorthands",
- "handler": "getShorthands",
+ "path": "/api/notebook/setNotebookConf",
+ "handler": "setNotebookConf",
"body": "json",
"request": {
- "$ref": "#/$defs/ShorthandsRequestInput"
+ "$ref": "#/$defs/SetNotebookConfRequestInput"
},
"response": {
"anyOf": [
@@ -28128,7 +30731,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ShorthandsData"
+ "$ref": "#/$defs/NotebookConf"
},
{
"type": "null"
@@ -28152,8 +30755,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -28191,11 +30793,11 @@
},
{
"method": "POST",
- "path": "/api/inbox/removeShorthands",
- "handler": "removeShorthands",
+ "path": "/api/notebook/setNotebookCryptoAutoLock",
+ "handler": "setNotebookCryptoAutoLock",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveShorthandsRequestInput"
+ "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"
},
"response": {
"anyOf": [
@@ -28222,82 +30824,6 @@
],
"additionalProperties": false
},
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/lute/copyStdMarkdown",
- "handler": "copyStdMarkdown",
- "body": "json",
- "request": {
- "$ref": "#/$defs/CopyStdMarkdownRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "string"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
{
"type": "object",
"properties": {
@@ -28342,11 +30868,11 @@
},
{
"method": "POST",
- "path": "/api/lute/html2BlockDOM",
- "handler": "html2BlockDOM",
+ "path": "/api/notebook/setNotebookIcon",
+ "handler": "setNotebookIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/HTMLClipboardRequestInput"
+ "$ref": "#/$defs/SetNotebookIconRequestInput"
},
"response": {
"anyOf": [
@@ -28360,14 +30886,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/$defs/HTMLClipboardPreflight"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -28424,11 +30943,11 @@
},
{
"method": "POST",
- "path": "/api/lute/md2html",
- "handler": "md2HTML",
- "body": "json",
+ "path": "/api/notebook/touchEncryptedNotebooks",
+ "handler": "touchEncryptedNotebooks",
+ "body": "none",
"request": {
- "$ref": "#/$defs/MarkdownHTMLRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -28442,7 +30961,7 @@
]
},
"data": {
- "$ref": "#/$defs/HTMLData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -28499,11 +31018,11 @@
},
{
"method": "POST",
- "path": "/api/lute/spinBlockDOM",
- "handler": "spinBlockDOM",
+ "path": "/api/notebook/unlockAndOpenNotebook",
+ "handler": "unlockAndOpenNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/DOMTextRequestInput"
+ "$ref": "#/$defs/UnlockNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -28517,7 +31036,7 @@
]
},
"data": {
- "$ref": "#/$defs/DOMData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -28536,8 +31055,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 413
+ -1
]
},
"data": {
@@ -28575,11 +31093,11 @@
},
{
"method": "POST",
- "path": "/api/lute/wpsPresentation2BlockDOM",
- "handler": "wpsPresentation2BlockDOM",
+ "path": "/api/notebook/unlockNotebook",
+ "handler": "unlockNotebook",
"body": "json",
"request": {
- "$ref": "#/$defs/WPSPresentationRequestInput"
+ "$ref": "#/$defs/UnlockNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -28593,7 +31111,7 @@
]
},
"data": {
- "$ref": "#/$defs/WPSPresentationData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -28631,9 +31149,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/WPSPresentationData"
}
]
},
@@ -28653,11 +31168,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/changeMasterPassword",
- "handler": "changeMasterPassword",
+ "path": "/api/notification/pushErrMsg",
+ "handler": "pushErrMsg",
"body": "json",
"request": {
- "$ref": "#/$defs/ChangeMasterPasswordRequestInput"
+ "$ref": "#/$defs/NotificationRequestInput"
},
"response": {
"anyOf": [
@@ -28671,7 +31186,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/NotificationData"
},
"msg": {
"type": "string"
@@ -28728,11 +31243,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/changeSortNotebook",
- "handler": "changeSortNotebook",
+ "path": "/api/notification/pushMsg",
+ "handler": "pushMsg",
"body": "json",
"request": {
- "$ref": "#/$defs/ChangeSortNotebookRequestInput"
+ "$ref": "#/$defs/NotificationRequestInput"
},
"response": {
"anyOf": [
@@ -28746,7 +31261,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/NotificationData"
},
"msg": {
"type": "string"
@@ -28803,11 +31318,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/closeNotebook",
- "handler": "closeNotebook",
+ "path": "/api/outline/getDocHeadingNumbers",
+ "handler": "getDocHeadingNumbers",
"body": "json",
"request": {
- "$ref": "#/$defs/CloseNotebookRequestInput"
+ "$ref": "#/$defs/HeadingNumbersRequestInput"
},
"response": {
"anyOf": [
@@ -28821,7 +31336,17 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -28840,7 +31365,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -28878,11 +31404,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/createEncryptedNotebook",
- "handler": "createEncryptedNotebook",
+ "path": "/api/outline/getDocOutline",
+ "handler": "getDocOutline",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"
+ "$ref": "#/$defs/OutlineRequestInput"
},
"response": {
"anyOf": [
@@ -28896,7 +31422,24 @@
]
},
"data": {
- "$ref": "#/$defs/CreateNotebookData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -28915,7 +31458,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -28953,11 +31497,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/createNotebook",
- "handler": "createNotebook",
+ "path": "/api/petal/loadPetals",
+ "handler": "loadPetals",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateNotebookRequestInput"
+ "$ref": "#/$defs/LoadPetalsRequestInput"
},
"response": {
"anyOf": [
@@ -28971,7 +31515,24 @@
]
},
"data": {
- "$ref": "#/$defs/CreateNotebookData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Petal"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -29028,11 +31589,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/disableEncryptedNotebooks",
- "handler": "disableEncryptedNotebooks",
- "body": "none",
+ "path": "/api/petal/setPetalEnabled",
+ "handler": "setPetalEnabled",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SetPetalEnabledRequestInput"
},
"response": {
"anyOf": [
@@ -29046,7 +31607,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Petal"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -29103,11 +31671,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/enableEncryptedNotebooks",
- "handler": "enableEncryptedNotebooks",
+ "path": "/api/petal/setPetalPublishEnabled",
+ "handler": "setPetalPublishEnabled",
"body": "json",
"request": {
- "$ref": "#/$defs/NotebookPasswordRequestInput"
+ "$ref": "#/$defs/SetPetalPublishEnabledRequestInput"
},
"response": {
"anyOf": [
@@ -29121,7 +31689,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Petal"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -29178,11 +31753,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/exportNotebookCryptoBackup",
- "handler": "exportNotebookCryptoBackup",
- "body": "none",
+ "path": "/api/plugin/getLoadedPlugin",
+ "handler": "getLoadedPlugin",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/LoadedPluginRequestInput"
},
"response": {
"anyOf": [
@@ -29196,7 +31771,14 @@
]
},
"data": {
- "$ref": "#/$defs/NotebookCryptoBackupData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LoadedPlugin"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -29215,7 +31797,11 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1,
+ 2,
+ 3,
+ 4
]
},
"data": {
@@ -29253,8 +31839,8 @@
},
{
"method": "POST",
- "path": "/api/notebook/getEncryptedNotebookStatus",
- "handler": "getEncryptedNotebookStatus",
+ "path": "/api/plugin/listLoadedPlugins",
+ "handler": "listLoadedPlugins",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -29270,42 +31856,20 @@
0
]
},
- "data": {
- "$ref": "#/$defs/EncryptedNotebookStatusData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LoadedPlugin"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -29321,42 +31885,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/notebook/getNotebookConf",
- "handler": "getNotebookConf",
- "body": "json",
- "request": {
- "$ref": "#/$defs/CloseNotebookRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/NotebookConfData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -29403,36 +31931,52 @@
},
{
"method": "POST",
- "path": "/api/notebook/getNotebookInfo",
- "handler": "getNotebookInfo",
+ "path": "/api/plugin/rpc",
+ "handler": "pluginJsonRpcHttp",
"body": "json",
"request": {
- "$ref": "#/$defs/NotebookIDRequestInput"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
},
"response": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
]
},
- "data": {
- "$ref": "#/$defs/NotebookInfoData"
- },
- "msg": {
- "type": "string"
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
}
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
+ ]
},
{
"type": "object",
@@ -29474,40 +32018,58 @@
"additionalProperties": true
}
]
- }
+ },
+ "output": "directJSON",
+ "noContent": true
},
{
"method": "POST",
- "path": "/api/notebook/importNotebookCryptoBackup",
- "handler": "importNotebookCryptoBackup",
- "body": "multipart",
+ "path": "/api/plugin/rpc/:name",
+ "handler": "pluginJsonRpcHttpByName",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
},
"response": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
]
},
- "data": {
- "type": "null"
- },
- "msg": {
- "type": "string"
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
}
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
+ ]
},
{
"type": "object",
@@ -29549,15 +32111,17 @@
"additionalProperties": true
}
]
- }
+ },
+ "output": "directJSON",
+ "noContent": true
},
{
"method": "POST",
- "path": "/api/notebook/lockNotebook",
- "handler": "lockNotebook",
+ "path": "/api/query/sql",
+ "handler": "SQL",
"body": "json",
"request": {
- "$ref": "#/$defs/NotebookIDRequestInput"
+ "$ref": "#/$defs/SQLQueryRequestInput"
},
"response": {
"anyOf": [
@@ -29571,16 +32135,50 @@
]
},
"data": {
- "type": "null"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "type": "string"
+ },
+ {
+ "type": "number"
+ },
+ {
+ "type": "boolean"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "limit": {
+ "type": "integer"
},
"msg": {
"type": "string"
+ },
+ "truncated": {
+ "type": "boolean"
}
},
"required": [
"code",
"msg",
- "data"
+ "data",
+ "limit",
+ "truncated"
],
"additionalProperties": false
},
@@ -29590,7 +32188,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -29628,11 +32227,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/lsNotebooks",
- "handler": "lsNotebooks",
- "body": "legacyOptional",
+ "path": "/api/ref/getBacklink2",
+ "handler": "getBacklink2",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ListNotebooksRequestInput"
+ "$ref": "#/$defs/BacklinkListRequestInput"
},
"response": {
"anyOf": [
@@ -29648,7 +32247,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ListNotebooksData"
+ "$ref": "#/$defs/BacklinkList"
+ },
+ {
+ "$ref": "#/$defs/BacklinkRefDefs"
},
{
"type": "null"
@@ -29672,7 +32274,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -29691,6 +32294,19 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BacklinkList"
+ },
+ {
+ "$ref": "#/$defs/BacklinkRefDefs"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -29710,11 +32326,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/openNotebook",
- "handler": "openNotebook",
+ "path": "/api/ref/getBacklinkDoc",
+ "handler": "getBacklinkDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/OpenNotebookRequestInput"
+ "$ref": "#/$defs/BacklinkDocumentRequestInput"
},
"response": {
"anyOf": [
@@ -29728,7 +32344,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BacklinkContextData"
},
"msg": {
"type": "string"
@@ -29747,7 +32363,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -29785,11 +32402,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/removeNotebook",
- "handler": "removeNotebook",
+ "path": "/api/ref/getBackmentionDoc",
+ "handler": "getBackmentionDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/NotebookIDRequestInput"
+ "$ref": "#/$defs/BackmentionDocumentRequestInput"
},
"response": {
"anyOf": [
@@ -29803,7 +32420,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BacklinkContextData"
},
"msg": {
"type": "string"
@@ -29822,7 +32439,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -29860,11 +32478,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/renameNotebook",
- "handler": "renameNotebook",
+ "path": "/api/ref/refreshBacklink",
+ "handler": "refreshBacklink",
"body": "json",
"request": {
- "$ref": "#/$defs/RenameNotebookRequestInput"
+ "$ref": "#/$defs/RefreshBacklinkRequestInput"
},
"response": {
"anyOf": [
@@ -29935,11 +32553,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/reorder",
- "handler": "reorderNotebooks",
- "body": "structJSON",
+ "path": "/api/repo/checkSnapshot",
+ "handler": "checkSnapshot",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ReorderNotebooksRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -29953,14 +32571,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ReorderData"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/CheckSnapshotData"
},
"msg": {
"type": "string"
@@ -29998,16 +32609,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ReorderData"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -30027,11 +32628,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/setNotebookConf",
- "handler": "setNotebookConf",
+ "path": "/api/repo/createSnapshot",
+ "handler": "createSnapshot",
"body": "json",
"request": {
- "$ref": "#/$defs/SetNotebookConfRequestInput"
+ "$ref": "#/$defs/CreateSnapshotRequestInput"
},
"response": {
"anyOf": [
@@ -30045,14 +32646,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/NotebookConf"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/CreateSnapshotData"
},
"msg": {
"type": "string"
@@ -30109,11 +32703,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/setNotebookCryptoAutoLock",
- "handler": "setNotebookCryptoAutoLock",
+ "path": "/api/repo/setSnapshotMemo",
+ "handler": "setSnapshotMemo",
"body": "json",
"request": {
- "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"
+ "$ref": "#/$defs/SetSnapshotMemoRequestInput"
},
"response": {
"anyOf": [
@@ -30184,11 +32778,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/setNotebookIcon",
- "handler": "setNotebookIcon",
+ "path": "/api/search/findReplace",
+ "handler": "findReplace",
"body": "json",
"request": {
- "$ref": "#/$defs/SetNotebookIconRequestInput"
+ "$ref": "#/$defs/FindReplaceRequestInput"
},
"response": {
"anyOf": [
@@ -30221,7 +32815,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -30259,11 +32854,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/touchEncryptedNotebooks",
- "handler": "touchEncryptedNotebooks",
- "body": "none",
+ "path": "/api/search/fullTextSearchAssetContent",
+ "handler": "fullTextSearchAssetContent",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SearchAssetContentRequestInput"
},
"response": {
"anyOf": [
@@ -30277,7 +32872,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SearchAssetContentData"
},
"msg": {
"type": "string"
@@ -30334,11 +32929,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/unlockAndOpenNotebook",
- "handler": "unlockAndOpenNotebook",
+ "path": "/api/search/fullTextSearchBlock",
+ "handler": "fullTextSearchBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/UnlockNotebookRequestInput"
+ "$ref": "#/$defs/FullTextSearchBlockRequestInput"
},
"response": {
"anyOf": [
@@ -30352,7 +32947,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FullTextSearchBlockData"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -30409,11 +33011,11 @@
},
{
"method": "POST",
- "path": "/api/notebook/unlockNotebook",
- "handler": "unlockNotebook",
+ "path": "/api/search/getAssetContent",
+ "handler": "getAssetContent",
"body": "json",
"request": {
- "$ref": "#/$defs/UnlockNotebookRequestInput"
+ "$ref": "#/$defs/AssetContentRequestInput"
},
"response": {
"anyOf": [
@@ -30427,7 +33029,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/AssetContentData"
},
"msg": {
"type": "string"
@@ -30484,11 +33086,11 @@
},
{
"method": "POST",
- "path": "/api/notification/pushErrMsg",
- "handler": "pushErrMsg",
+ "path": "/api/search/getAssetContentByPath",
+ "handler": "getAssetContentByPath",
"body": "json",
"request": {
- "$ref": "#/$defs/NotificationRequestInput"
+ "$ref": "#/$defs/SearchPathRequestInput"
},
"response": {
"anyOf": [
@@ -30502,7 +33104,7 @@
]
},
"data": {
- "$ref": "#/$defs/NotificationData"
+ "$ref": "#/$defs/AssetContentData"
},
"msg": {
"type": "string"
@@ -30559,11 +33161,11 @@
},
{
"method": "POST",
- "path": "/api/notification/pushMsg",
- "handler": "pushMsg",
+ "path": "/api/search/getEmbedBlock",
+ "handler": "getEmbedBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/NotificationRequestInput"
+ "$ref": "#/$defs/GetEmbedBlockRequestInput"
},
"response": {
"anyOf": [
@@ -30577,7 +33179,7 @@
]
},
"data": {
- "$ref": "#/$defs/NotificationData"
+ "$ref": "#/$defs/EmbedBlocksData"
},
"msg": {
"type": "string"
@@ -30634,11 +33236,11 @@
},
{
"method": "POST",
- "path": "/api/outline/getDocHeadingNumbers",
- "handler": "getDocHeadingNumbers",
+ "path": "/api/search/listInvalidBlockRefs",
+ "handler": "listInvalidBlockRefs",
"body": "json",
"request": {
- "$ref": "#/$defs/HeadingNumbersRequestInput"
+ "$ref": "#/$defs/SearchPageRequestInput"
},
"response": {
"anyOf": [
@@ -30651,13 +33253,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/SearchBlocksData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
"type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -30673,6 +33304,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/search/removeTemplate",
+ "handler": "removeTemplate",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/SearchPathRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -30681,8 +33348,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -30720,11 +33386,11 @@
},
{
"method": "POST",
- "path": "/api/outline/getDocOutline",
- "handler": "getDocOutline",
+ "path": "/api/search/searchAsset",
+ "handler": "searchAsset",
"body": "json",
"request": {
- "$ref": "#/$defs/OutlineRequestInput"
+ "$ref": "#/$defs/SearchAssetRequestInput"
},
"response": {
"anyOf": [
@@ -30744,7 +33410,7 @@
"items": {
"anyOf": [
{
- "$ref": "#/$defs/SearchPath"
+ "$ref": "#/$defs/SearchAsset"
},
{
"type": "null"
@@ -30774,8 +33440,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -30813,11 +33478,11 @@
},
{
"method": "POST",
- "path": "/api/petal/loadPetals",
- "handler": "loadPetals",
+ "path": "/api/search/searchEmbedBlock",
+ "handler": "searchEmbedBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/LoadPetalsRequestInput"
+ "$ref": "#/$defs/SearchEmbedBlockRequestInput"
},
"response": {
"anyOf": [
@@ -30831,24 +33496,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Petal"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/EmbedBlocksData"
},
"msg": {
"type": "string"
@@ -30905,11 +33553,11 @@
},
{
"method": "POST",
- "path": "/api/petal/setPetalEnabled",
- "handler": "setPetalEnabled",
+ "path": "/api/search/searchRefBlock",
+ "handler": "searchRefBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/SetPetalEnabledRequestInput"
+ "$ref": "#/$defs/SearchRefBlockRequestInput"
},
"response": {
"anyOf": [
@@ -30925,10 +33573,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/Petal"
+ "$ref": "#/$defs/SearchRefResult"
},
{
- "type": "null"
+ "$ref": "#/$defs/SearchRefCorrelation"
}
]
},
@@ -30968,6 +33616,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchRefResult"
+ },
+ {
+ "$ref": "#/$defs/SearchRefCorrelation"
+ }
+ ]
}
]
},
@@ -30987,11 +33645,11 @@
},
{
"method": "POST",
- "path": "/api/petal/setPetalPublishEnabled",
- "handler": "setPetalPublishEnabled",
+ "path": "/api/search/searchTag",
+ "handler": "searchTag",
"body": "json",
"request": {
- "$ref": "#/$defs/SetPetalPublishEnabledRequestInput"
+ "$ref": "#/$defs/SearchTagRequestInput"
},
"response": {
"anyOf": [
@@ -31005,14 +33663,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/Petal"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SearchTagData"
},
"msg": {
"type": "string"
@@ -31069,11 +33720,11 @@
},
{
"method": "POST",
- "path": "/api/plugin/getLoadedPlugin",
- "handler": "getLoadedPlugin",
+ "path": "/api/search/searchTemplate",
+ "handler": "searchTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/LoadedPluginRequestInput"
+ "$ref": "#/$defs/SearchKeywordRequestInput"
},
"response": {
"anyOf": [
@@ -31087,14 +33738,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/LoadedPlugin"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SearchTemplateData"
},
"msg": {
"type": "string"
@@ -31113,11 +33757,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1,
- 2,
- 3,
- 4
+ -1
]
},
"data": {
@@ -31155,11 +33795,11 @@
},
{
"method": "POST",
- "path": "/api/plugin/listLoadedPlugins",
- "handler": "listLoadedPlugins",
- "body": "none",
+ "path": "/api/search/searchWidget",
+ "handler": "searchWidget",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SearchKeywordRequestInput"
},
"response": {
"anyOf": [
@@ -31173,24 +33813,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/LoadedPlugin"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SearchWidgetData"
},
"msg": {
"type": "string"
@@ -31247,52 +33870,36 @@
},
{
"method": "POST",
- "path": "/api/plugin/rpc",
- "handler": "pluginJsonRpcHttp",
+ "path": "/api/search/semanticSearchBlock",
+ "handler": "semanticSearchBlock",
"body": "json",
"request": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- "minItems": 1
- }
- ]
+ "$ref": "#/$defs/SearchBlockRequestInput"
},
"response": {
"anyOf": [
{
- "anyOf": [
- {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
]
},
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
- ]
- },
- "minItems": 1
+ "data": {
+ "$ref": "#/$defs/SearchBlocksData"
+ },
+ "msg": {
+ "type": "string"
}
- ]
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
},
{
"type": "object",
@@ -31334,58 +33941,40 @@
"additionalProperties": true
}
]
- },
- "output": "directJSON",
- "noContent": true
+ }
},
{
"method": "POST",
- "path": "/api/plugin/rpc/:name",
- "handler": "pluginJsonRpcHttpByName",
+ "path": "/api/search/updateEmbedBlock",
+ "handler": "updateEmbedBlock",
"body": "json",
"request": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- "minItems": 1
- }
- ]
+ "$ref": "#/$defs/UpdateEmbedBlockRequestInput"
},
"response": {
"anyOf": [
{
- "anyOf": [
- {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
]
},
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
- ]
- },
- "minItems": 1
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
}
- ]
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
},
{
"type": "object",
@@ -31427,17 +34016,15 @@
"additionalProperties": true
}
]
- },
- "output": "directJSON",
- "noContent": true
+ }
},
{
"method": "POST",
- "path": "/api/query/sql",
- "handler": "SQL",
+ "path": "/api/setting/addVirtualBlockRefExclude",
+ "handler": "addVirtualBlockRefExclude",
"body": "json",
"request": {
- "$ref": "#/$defs/SQLQueryRequestInput"
+ "$ref": "#/$defs/VirtualBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -31451,50 +34038,16 @@
]
},
"data": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- {
- "type": "null"
- },
- {
- "type": "string"
- },
- {
- "type": "number"
- },
- {
- "type": "boolean"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "limit": {
- "type": "integer"
+ "type": "null"
},
"msg": {
"type": "string"
- },
- "truncated": {
- "type": "boolean"
}
},
"required": [
"code",
"msg",
- "data",
- "limit",
- "truncated"
+ "data"
],
"additionalProperties": false
},
@@ -31504,8 +34057,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -31543,11 +34095,11 @@
},
{
"method": "POST",
- "path": "/api/ref/getBacklink2",
- "handler": "getBacklink2",
+ "path": "/api/setting/addVirtualBlockRefInclude",
+ "handler": "addVirtualBlockRefInclude",
"body": "json",
"request": {
- "$ref": "#/$defs/BacklinkListRequestInput"
+ "$ref": "#/$defs/VirtualBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -31561,17 +34113,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BacklinkList"
- },
- {
- "$ref": "#/$defs/BacklinkRefDefs"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -31590,8 +34132,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -31610,19 +34151,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/BacklinkList"
- },
- {
- "$ref": "#/$defs/BacklinkRefDefs"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -31642,11 +34170,11 @@
},
{
"method": "POST",
- "path": "/api/ref/getBacklinkDoc",
- "handler": "getBacklinkDoc",
- "body": "json",
+ "path": "/api/setting/getPandocBin",
+ "handler": "getPandocBin",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BacklinkDocumentRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -31660,7 +34188,7 @@
]
},
"data": {
- "$ref": "#/$defs/BacklinkContextData"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -31679,8 +34207,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -31718,11 +34245,11 @@
},
{
"method": "POST",
- "path": "/api/ref/getBackmentionDoc",
- "handler": "getBackmentionDoc",
- "body": "json",
+ "path": "/api/setting/refreshVirtualBlockRef",
+ "handler": "refreshVirtualBlockRef",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BackmentionDocumentRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -31736,7 +34263,7 @@
]
},
"data": {
- "$ref": "#/$defs/BacklinkContextData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -31755,8 +34282,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -31794,11 +34320,11 @@
},
{
"method": "POST",
- "path": "/api/ref/refreshBacklink",
- "handler": "refreshBacklink",
+ "path": "/api/setting/setEditorReadOnly",
+ "handler": "setEditorReadOnly",
"body": "json",
"request": {
- "$ref": "#/$defs/RefreshBacklinkRequestInput"
+ "$ref": "#/$defs/EditorReadOnlyRequestInput"
},
"response": {
"anyOf": [
@@ -31869,11 +34395,11 @@
},
{
"method": "POST",
- "path": "/api/repo/checkSnapshot",
- "handler": "checkSnapshot",
- "body": "none",
+ "path": "/api/snippet/getSnippet",
+ "handler": "getSnippet",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetSnippetRequestInput"
},
"response": {
"anyOf": [
@@ -31887,7 +34413,7 @@
]
},
"data": {
- "$ref": "#/$defs/CheckSnapshotData"
+ "$ref": "#/$defs/SnippetsData"
},
"msg": {
"type": "string"
@@ -31944,11 +34470,11 @@
},
{
"method": "POST",
- "path": "/api/repo/createSnapshot",
- "handler": "createSnapshot",
+ "path": "/api/snippet/removeSnippet",
+ "handler": "removeSnippet",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateSnapshotRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -31962,7 +34488,14 @@
]
},
"data": {
- "$ref": "#/$defs/CreateSnapshotData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Snippet"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32019,11 +34552,11 @@
},
{
"method": "POST",
- "path": "/api/repo/setSnapshotMemo",
- "handler": "setSnapshotMemo",
+ "path": "/api/snippet/setSnippet",
+ "handler": "setSnippet",
"body": "json",
"request": {
- "$ref": "#/$defs/SetSnapshotMemoRequestInput"
+ "$ref": "#/$defs/SetSnippetRequestInput"
},
"response": {
"anyOf": [
@@ -32094,11 +34627,11 @@
},
{
"method": "POST",
- "path": "/api/search/findReplace",
- "handler": "findReplace",
- "body": "json",
+ "path": "/api/sqlite/flushTransaction",
+ "handler": "flushTransaction",
+ "body": "none",
"request": {
- "$ref": "#/$defs/FindReplaceRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -32131,8 +34664,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -32170,11 +34702,11 @@
},
{
"method": "POST",
- "path": "/api/search/fullTextSearchAssetContent",
- "handler": "fullTextSearchAssetContent",
+ "path": "/api/storage/batchUpdateRecentDocCloseTime",
+ "handler": "batchUpdateRecentDocCloseTime",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchAssetContentRequestInput"
+ "$ref": "#/$defs/RecentDocsUpdateRequestInput"
},
"response": {
"anyOf": [
@@ -32188,7 +34720,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchAssetContentData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -32245,11 +34777,11 @@
},
{
"method": "POST",
- "path": "/api/search/fullTextSearchBlock",
- "handler": "fullTextSearchBlock",
- "body": "json",
+ "path": "/api/storage/getCriteria",
+ "handler": "getCriteria",
+ "body": "none",
"request": {
- "$ref": "#/$defs/FullTextSearchBlockRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -32265,7 +34797,17 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/FullTextSearchBlockData"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Criterion"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -32327,11 +34869,11 @@
},
{
"method": "POST",
- "path": "/api/search/getAssetContent",
- "handler": "getAssetContent",
- "body": "json",
+ "path": "/api/storage/getInlineStyles",
+ "handler": "getInlineStyles",
+ "body": "none",
"request": {
- "$ref": "#/$defs/AssetContentRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -32345,7 +34887,14 @@
]
},
"data": {
- "$ref": "#/$defs/AssetContentData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyles"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32402,11 +34951,11 @@
},
{
"method": "POST",
- "path": "/api/search/getAssetContentByPath",
- "handler": "getAssetContentByPath",
- "body": "json",
+ "path": "/api/storage/getLocalStorage",
+ "handler": "getLocalStorage",
+ "body": "none",
"request": {
- "$ref": "#/$defs/SearchPathRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -32420,7 +34969,17 @@
]
},
"data": {
- "$ref": "#/$defs/AssetContentData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32477,11 +35036,11 @@
},
{
"method": "POST",
- "path": "/api/search/getEmbedBlock",
- "handler": "getEmbedBlock",
+ "path": "/api/storage/getLocalStorageVal",
+ "handler": "getLocalStorageVal",
"body": "json",
"request": {
- "$ref": "#/$defs/GetEmbedBlockRequestInput"
+ "$ref": "#/$defs/StorageKeyRequestInput"
},
"response": {
"anyOf": [
@@ -32495,7 +35054,7 @@
]
},
"data": {
- "$ref": "#/$defs/EmbedBlocksData"
+ "$ref": "#/$defs/JSONValue"
},
"msg": {
"type": "string"
@@ -32552,11 +35111,11 @@
},
{
"method": "POST",
- "path": "/api/search/listInvalidBlockRefs",
- "handler": "listInvalidBlockRefs",
+ "path": "/api/storage/getLocalStorageVals",
+ "handler": "getLocalStorageVals",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchPageRequestInput"
+ "$ref": "#/$defs/StorageKeysRequestInput"
},
"response": {
"anyOf": [
@@ -32570,7 +35129,17 @@
]
},
"data": {
- "$ref": "#/$defs/SearchBlocksData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32627,11 +35196,11 @@
},
{
"method": "POST",
- "path": "/api/search/removeTemplate",
- "handler": "removeTemplate",
+ "path": "/api/storage/getOutlineStorage",
+ "handler": "getOutlineStorage",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchPathRequestInput"
+ "$ref": "#/$defs/OutlineStorageRequestInput"
},
"response": {
"anyOf": [
@@ -32645,7 +35214,17 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32702,11 +35281,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchAsset",
- "handler": "searchAsset",
- "body": "json",
+ "path": "/api/storage/getRecentDocs",
+ "handler": "getRecentDocs",
+ "body": "legacyOptional",
"request": {
- "$ref": "#/$defs/SearchAssetRequestInput"
+ "$ref": "#/$defs/RecentDocsRequestInput"
},
"response": {
"anyOf": [
@@ -32726,7 +35305,7 @@
"items": {
"anyOf": [
{
- "$ref": "#/$defs/SearchAsset"
+ "$ref": "#/$defs/RecentDoc"
},
{
"type": "null"
@@ -32794,11 +35373,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchEmbedBlock",
- "handler": "searchEmbedBlock",
+ "path": "/api/storage/getViewState",
+ "handler": "getViewState",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchEmbedBlockRequestInput"
+ "$ref": "#/$defs/StorageKeyRequestInput"
},
"response": {
"anyOf": [
@@ -32812,7 +35391,17 @@
]
},
"data": {
- "$ref": "#/$defs/EmbedBlocksData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -32869,11 +35458,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchRefBlock",
- "handler": "searchRefBlock",
+ "path": "/api/storage/patchViewState",
+ "handler": "patchViewState",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchRefBlockRequestInput"
+ "$ref": "#/$defs/ViewStatePatchRequestInput"
},
"response": {
"anyOf": [
@@ -32889,10 +35478,13 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/SearchRefResult"
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
},
{
- "$ref": "#/$defs/SearchRefCorrelation"
+ "type": "null"
}
]
},
@@ -32932,16 +35524,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchRefResult"
- },
- {
- "$ref": "#/$defs/SearchRefCorrelation"
- }
- ]
}
]
},
@@ -32961,11 +35543,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchTag",
- "handler": "searchTag",
+ "path": "/api/storage/removeCriterion",
+ "handler": "removeCriterion",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchTagRequestInput"
+ "$ref": "#/$defs/RemoveCriterionRequestInput"
},
"response": {
"anyOf": [
@@ -32979,7 +35561,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchTagData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33036,11 +35618,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchTemplate",
- "handler": "searchTemplate",
+ "path": "/api/storage/removeLocalStorageVal",
+ "handler": "removeLocalStorageVal",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchKeywordRequestInput"
+ "$ref": "#/$defs/StorageRemoveRequestInput"
},
"response": {
"anyOf": [
@@ -33054,7 +35636,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchTemplateData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33111,11 +35693,11 @@
},
{
"method": "POST",
- "path": "/api/search/searchWidget",
- "handler": "searchWidget",
+ "path": "/api/storage/removeLocalStorageVals",
+ "handler": "removeLocalStorageVals",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchKeywordRequestInput"
+ "$ref": "#/$defs/StorageRemoveKeysRequestInput"
},
"response": {
"anyOf": [
@@ -33129,7 +35711,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchWidgetData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33186,11 +35768,11 @@
},
{
"method": "POST",
- "path": "/api/search/semanticSearchBlock",
- "handler": "semanticSearchBlock",
+ "path": "/api/storage/removeOutlineStorage",
+ "handler": "removeOutlineStorage",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchBlockRequestInput"
+ "$ref": "#/$defs/OutlineStorageRequestInput"
},
"response": {
"anyOf": [
@@ -33204,7 +35786,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchBlocksData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33261,11 +35843,11 @@
},
{
"method": "POST",
- "path": "/api/search/updateEmbedBlock",
- "handler": "updateEmbedBlock",
+ "path": "/api/storage/removeViewState",
+ "handler": "removeViewState",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdateEmbedBlockRequestInput"
+ "$ref": "#/$defs/StorageKeyRequestInput"
},
"response": {
"anyOf": [
@@ -33336,11 +35918,11 @@
},
{
"method": "POST",
- "path": "/api/setting/addVirtualBlockRefExclude",
- "handler": "addVirtualBlockRefExclude",
+ "path": "/api/storage/setCriterion",
+ "handler": "setCriterion",
"body": "json",
"request": {
- "$ref": "#/$defs/VirtualBlockRefRequestInput"
+ "$ref": "#/$defs/SetCriterionRequestInput"
},
"response": {
"anyOf": [
@@ -33411,11 +35993,11 @@
},
{
"method": "POST",
- "path": "/api/setting/addVirtualBlockRefInclude",
- "handler": "addVirtualBlockRefInclude",
+ "path": "/api/storage/setInlineStyles",
+ "handler": "setInlineStyles",
"body": "json",
"request": {
- "$ref": "#/$defs/VirtualBlockRefRequestInput"
+ "$ref": "#/$defs/SetInlineStylesRequestInput"
},
"response": {
"anyOf": [
@@ -33429,7 +36011,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyles"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -33486,8 +36075,8 @@
},
{
"method": "POST",
- "path": "/api/setting/getPandocBin",
- "handler": "getPandocBin",
+ "path": "/api/storage/setLocalStorage",
+ "handler": "setLocalStorage",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -33504,7 +36093,7 @@
]
},
"data": {
- "type": "string"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33561,11 +36150,11 @@
},
{
"method": "POST",
- "path": "/api/setting/refreshVirtualBlockRef",
- "handler": "refreshVirtualBlockRef",
- "body": "none",
+ "path": "/api/storage/setLocalStorageVal",
+ "handler": "setLocalStorageVal",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/StorageSetRequestInput"
},
"response": {
"anyOf": [
@@ -33636,11 +36225,11 @@
},
{
"method": "POST",
- "path": "/api/setting/setEditorReadOnly",
- "handler": "setEditorReadOnly",
+ "path": "/api/storage/setLocalStorageVals",
+ "handler": "setLocalStorageVals",
"body": "json",
"request": {
- "$ref": "#/$defs/EditorReadOnlyRequestInput"
+ "$ref": "#/$defs/StorageSetKeysRequestInput"
},
"response": {
"anyOf": [
@@ -33711,11 +36300,11 @@
},
{
"method": "POST",
- "path": "/api/snippet/getSnippet",
- "handler": "getSnippet",
+ "path": "/api/storage/setOutlineStorage",
+ "handler": "setOutlineStorage",
"body": "json",
"request": {
- "$ref": "#/$defs/GetSnippetRequestInput"
+ "$ref": "#/$defs/OutlineStorageSetRequestInput"
},
"response": {
"anyOf": [
@@ -33729,7 +36318,7 @@
]
},
"data": {
- "$ref": "#/$defs/SnippetsData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -33786,11 +36375,11 @@
},
{
"method": "POST",
- "path": "/api/snippet/removeSnippet",
- "handler": "removeSnippet",
+ "path": "/api/storage/setWorkspaceAVPalette",
+ "handler": "setWorkspaceAVPalette",
"body": "json",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/WorkspaceAVPaletteRequestInput"
},
"response": {
"anyOf": [
@@ -33806,7 +36395,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/Snippet"
+ "$ref": "#/$defs/InlineStyles"
},
{
"type": "null"
@@ -33868,11 +36457,11 @@
},
{
"method": "POST",
- "path": "/api/snippet/setSnippet",
- "handler": "setSnippet",
+ "path": "/api/storage/updateRecentDocCloseTime",
+ "handler": "updateRecentDocCloseTime",
"body": "json",
"request": {
- "$ref": "#/$defs/SetSnippetRequestInput"
+ "$ref": "#/$defs/RecentDocUpdateRequestInput"
},
"response": {
"anyOf": [
@@ -33943,11 +36532,11 @@
},
{
"method": "POST",
- "path": "/api/sqlite/flushTransaction",
- "handler": "flushTransaction",
- "body": "none",
+ "path": "/api/storage/updateRecentDocOpenTime",
+ "handler": "updateRecentDocOpenTime",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/RecentDocUpdateRequestInput"
},
"response": {
"anyOf": [
@@ -34018,11 +36607,11 @@
},
{
"method": "POST",
- "path": "/api/storage/batchUpdateRecentDocCloseTime",
- "handler": "batchUpdateRecentDocCloseTime",
+ "path": "/api/storage/updateRecentDocViewTime",
+ "handler": "updateRecentDocViewTime",
"body": "json",
"request": {
- "$ref": "#/$defs/RecentDocsUpdateRequestInput"
+ "$ref": "#/$defs/RecentDocUpdateRequestInput"
},
"response": {
"anyOf": [
@@ -34093,11 +36682,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getCriteria",
- "handler": "getCriteria",
- "body": "none",
+ "path": "/api/sync/createCloudSyncDir",
+ "handler": "createCloudSyncDir",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SyncNameRequestInput"
},
"response": {
"anyOf": [
@@ -34111,24 +36700,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Criterion"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -34185,8 +36757,8 @@
},
{
"method": "POST",
- "path": "/api/storage/getInlineStyles",
- "handler": "getInlineStyles",
+ "path": "/api/sync/exportSyncProviderS3",
+ "handler": "exportSyncProviderS3",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -34203,14 +36775,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyles"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncProviderExportData"
},
"msg": {
"type": "string"
@@ -34267,8 +36832,8 @@
},
{
"method": "POST",
- "path": "/api/storage/getLocalStorage",
- "handler": "getLocalStorage",
+ "path": "/api/sync/exportSyncProviderWebDAV",
+ "handler": "exportSyncProviderWebDAV",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -34285,17 +36850,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncProviderExportData"
},
"msg": {
"type": "string"
@@ -34352,11 +36907,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getLocalStorageVal",
- "handler": "getLocalStorageVal",
- "body": "json",
+ "path": "/api/sync/getBootSync",
+ "handler": "getBootSync",
+ "body": "none",
"request": {
- "$ref": "#/$defs/StorageKeyRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -34370,7 +36925,7 @@
]
},
"data": {
- "$ref": "#/$defs/JSONValue"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -34389,7 +36944,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -34427,11 +36983,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getLocalStorageVals",
- "handler": "getLocalStorageVals",
- "body": "json",
+ "path": "/api/sync/getSyncInfo",
+ "handler": "getSyncInfo",
+ "body": "none",
"request": {
- "$ref": "#/$defs/StorageKeysRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -34445,17 +37001,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncInfoData"
},
"msg": {
"type": "string"
@@ -34512,11 +37058,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getOutlineStorage",
- "handler": "getOutlineStorage",
- "body": "json",
+ "path": "/api/sync/getSyncLANStatus",
+ "handler": "getSyncLANStatus",
+ "body": "none",
"request": {
- "$ref": "#/$defs/OutlineStorageRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -34530,17 +37076,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncLANStatus"
},
"msg": {
"type": "string"
@@ -34597,11 +37133,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getRecentDocs",
- "handler": "getRecentDocs",
- "body": "legacyOptional",
+ "path": "/api/sync/importSyncProviderS3",
+ "handler": "importSyncProviderS3",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/RecentDocsRequestInput"
+ "$ref": "#/$defs/SyncProviderImportRequestInput"
},
"response": {
"anyOf": [
@@ -34615,24 +37151,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/RecentDoc"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncS3Data"
},
"msg": {
"type": "string"
@@ -34670,6 +37189,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/SyncS3Data"
}
]
},
@@ -34689,11 +37211,11 @@
},
{
"method": "POST",
- "path": "/api/storage/getViewState",
- "handler": "getViewState",
- "body": "json",
+ "path": "/api/sync/importSyncProviderWebDAV",
+ "handler": "importSyncProviderWebDAV",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/StorageKeyRequestInput"
+ "$ref": "#/$defs/SyncProviderImportRequestInput"
},
"response": {
"anyOf": [
@@ -34707,17 +37229,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/SyncWebDAVData"
},
"msg": {
"type": "string"
@@ -34755,6 +37267,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/SyncWebDAVData"
}
]
},
@@ -34774,11 +37289,11 @@
},
{
"method": "POST",
- "path": "/api/storage/patchViewState",
- "handler": "patchViewState",
- "body": "json",
+ "path": "/api/sync/listCloudSyncDir",
+ "handler": "listCloudSyncDir",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ViewStatePatchRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -34792,17 +37307,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/CloudSyncDirsData"
},
"msg": {
"type": "string"
@@ -34821,7 +37326,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -34859,11 +37365,11 @@
},
{
"method": "POST",
- "path": "/api/storage/removeCriterion",
- "handler": "removeCriterion",
- "body": "json",
+ "path": "/api/sync/performBootSync",
+ "handler": "performBootSync",
+ "body": "none",
"request": {
- "$ref": "#/$defs/RemoveCriterionRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -34896,7 +37402,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -34934,11 +37441,11 @@
},
{
"method": "POST",
- "path": "/api/storage/removeLocalStorageVal",
- "handler": "removeLocalStorageVal",
+ "path": "/api/sync/performSync",
+ "handler": "performSync",
"body": "json",
"request": {
- "$ref": "#/$defs/StorageRemoveRequestInput"
+ "$ref": "#/$defs/PerformSyncRequestInput"
},
"response": {
"anyOf": [
@@ -35009,11 +37516,11 @@
},
{
"method": "POST",
- "path": "/api/storage/removeLocalStorageVals",
- "handler": "removeLocalStorageVals",
+ "path": "/api/sync/removeCloudSyncDir",
+ "handler": "removeCloudSyncDir",
"body": "json",
"request": {
- "$ref": "#/$defs/StorageRemoveKeysRequestInput"
+ "$ref": "#/$defs/SyncNameRequestInput"
},
"response": {
"anyOf": [
@@ -35027,7 +37534,7 @@
]
},
"data": {
- "type": "null"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -35084,11 +37591,11 @@
},
{
"method": "POST",
- "path": "/api/storage/removeOutlineStorage",
- "handler": "removeOutlineStorage",
+ "path": "/api/sync/setCloudSyncDir",
+ "handler": "setCloudSyncDir",
"body": "json",
"request": {
- "$ref": "#/$defs/OutlineStorageRequestInput"
+ "$ref": "#/$defs/SyncNameRequestInput"
},
"response": {
"anyOf": [
@@ -35159,11 +37666,11 @@
},
{
"method": "POST",
- "path": "/api/storage/removeViewState",
- "handler": "removeViewState",
+ "path": "/api/sync/setSyncAssetDownloadMode",
+ "handler": "setSyncAssetDownloadMode",
"body": "json",
"request": {
- "$ref": "#/$defs/StorageKeyRequestInput"
+ "$ref": "#/$defs/SyncModeRequestInput"
},
"response": {
"anyOf": [
@@ -35177,7 +37684,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SyncAssetDownloadModeData"
},
"msg": {
"type": "string"
@@ -35234,11 +37741,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setCriterion",
- "handler": "setCriterion",
+ "path": "/api/sync/setSyncEnable",
+ "handler": "setSyncEnable",
"body": "json",
"request": {
- "$ref": "#/$defs/SetCriterionRequestInput"
+ "$ref": "#/$defs/SyncEnabledRequestInput"
},
"response": {
"anyOf": [
@@ -35309,11 +37816,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setInlineStyles",
- "handler": "setInlineStyles",
+ "path": "/api/sync/setSyncGenerateConflictDoc",
+ "handler": "setSyncGenerateConflictDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/SetInlineStylesRequestInput"
+ "$ref": "#/$defs/SyncEnabledRequestInput"
},
"response": {
"anyOf": [
@@ -35327,14 +37834,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyles"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -35391,11 +37891,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setLocalStorage",
- "handler": "setLocalStorage",
- "body": "none",
+ "path": "/api/sync/setSyncInterval",
+ "handler": "setSyncInterval",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SyncIntervalRequestInput"
},
"response": {
"anyOf": [
@@ -35466,11 +37966,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setLocalStorageVal",
- "handler": "setLocalStorageVal",
+ "path": "/api/sync/setSyncLAN",
+ "handler": "setSyncLAN",
"body": "json",
"request": {
- "$ref": "#/$defs/StorageSetRequestInput"
+ "$ref": "#/$defs/SyncLANRequestInput"
},
"response": {
"anyOf": [
@@ -35484,7 +37984,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SyncLANStatus"
},
"msg": {
"type": "string"
@@ -35541,11 +38041,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setLocalStorageVals",
- "handler": "setLocalStorageVals",
+ "path": "/api/sync/setSyncMode",
+ "handler": "setSyncMode",
"body": "json",
"request": {
- "$ref": "#/$defs/StorageSetKeysRequestInput"
+ "$ref": "#/$defs/SyncModeRequestInput"
},
"response": {
"anyOf": [
@@ -35616,11 +38116,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setOutlineStorage",
- "handler": "setOutlineStorage",
+ "path": "/api/sync/setSyncPerception",
+ "handler": "setSyncPerception",
"body": "json",
"request": {
- "$ref": "#/$defs/OutlineStorageSetRequestInput"
+ "$ref": "#/$defs/SyncEnabledRequestInput"
},
"response": {
"anyOf": [
@@ -35691,11 +38191,11 @@
},
{
"method": "POST",
- "path": "/api/storage/setWorkspaceAVPalette",
- "handler": "setWorkspaceAVPalette",
+ "path": "/api/sync/setSyncProvider",
+ "handler": "setSyncProvider",
"body": "json",
"request": {
- "$ref": "#/$defs/WorkspaceAVPaletteRequestInput"
+ "$ref": "#/$defs/SyncProviderRequestInput"
},
"response": {
"anyOf": [
@@ -35709,14 +38209,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyles"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -35773,11 +38266,11 @@
},
{
"method": "POST",
- "path": "/api/storage/updateRecentDocCloseTime",
- "handler": "updateRecentDocCloseTime",
+ "path": "/api/sync/setSyncProviderLocal",
+ "handler": "setSyncProviderLocal",
"body": "json",
"request": {
- "$ref": "#/$defs/RecentDocUpdateRequestInput"
+ "$ref": "#/$defs/SetSyncLocalRequestInput"
},
"response": {
"anyOf": [
@@ -35791,7 +38284,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SyncLocalData"
},
"msg": {
"type": "string"
@@ -35848,11 +38341,11 @@
},
{
"method": "POST",
- "path": "/api/storage/updateRecentDocOpenTime",
- "handler": "updateRecentDocOpenTime",
+ "path": "/api/sync/setSyncProviderS3",
+ "handler": "setSyncProviderS3",
"body": "json",
"request": {
- "$ref": "#/$defs/RecentDocUpdateRequestInput"
+ "$ref": "#/$defs/SetSyncS3RequestInput"
},
"response": {
"anyOf": [
@@ -35866,7 +38359,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SyncS3Data"
},
"msg": {
"type": "string"
@@ -35923,11 +38416,11 @@
},
{
"method": "POST",
- "path": "/api/storage/updateRecentDocViewTime",
- "handler": "updateRecentDocViewTime",
+ "path": "/api/sync/setSyncProviderWebDAV",
+ "handler": "setSyncProviderWebDAV",
"body": "json",
"request": {
- "$ref": "#/$defs/RecentDocUpdateRequestInput"
+ "$ref": "#/$defs/SetSyncWebDAVRequestInput"
},
"response": {
"anyOf": [
@@ -35941,7 +38434,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/SyncWebDAVData"
},
"msg": {
"type": "string"
diff --git a/kernel/apicontract/sync.go b/kernel/apicontract/sync.go
new file mode 100644
index 0000000000..95b5fe1476
--- /dev/null
+++ b/kernel/apicontract/sync.go
@@ -0,0 +1,267 @@
+package apicontract
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "mime/multipart"
+ "strings"
+)
+
+type SyncEnabledRequest struct {
+ Enabled bool `json:"enabled"`
+}
+type SyncIntervalRequest struct {
+ Interval float64 `json:"interval"`
+}
+type SyncModeRequest struct {
+ Mode float64 `json:"mode"`
+}
+type SyncProviderRequest struct {
+ Provider float64 `json:"provider"`
+}
+type SyncNameRequest struct {
+ Name string `json:"name" api:"trim"`
+}
+type SyncLANRequest struct {
+ Enabled bool `json:"enabled"`
+ MaxConcurrentReqs float64 `json:"maxConcurrentReqs" api:"optional,nullable"`
+}
+type PerformSyncRequest struct {
+ MobileSwitch bool `json:"mobileSwitch" api:"optional,nullable"`
+ Upload bool `json:"upload" api:"optional"`
+ uploadFields map[string]json.RawMessage
+}
+
+// UploadDirection 在完全手动模式下校验同步方向,其他模式不读取此字段。
+func (r PerformSyncRequest) UploadDirection() (bool, error) {
+ return legacyField[bool](r.uploadFields, "upload", "Boolean", true)
+}
+
+type SyncProviderImportRequest struct {
+ File *multipart.FileHeader `json:"file" api:"optional"`
+}
+type SyncProviderExportData struct {
+ Name string `json:"name"`
+ Zip string `json:"zip"`
+}
+type SyncS3 struct {
+ Endpoint string `json:"endpoint" api:"optional,nullable"`
+ AccessKey string `json:"accessKey" api:"optional,nullable"`
+ SecretKey string `json:"secretKey" api:"optional,nullable"`
+ Bucket string `json:"bucket" api:"optional,nullable"`
+ Region string `json:"region" api:"optional,nullable"`
+ PathStyle bool `json:"pathStyle" api:"optional,nullable"`
+ SkipTlsVerify bool `json:"skipTlsVerify" api:"optional,nullable"`
+ Timeout int `json:"timeout" api:"optional,nullable"`
+ ConcurrentReqs int `json:"concurrentReqs" api:"optional,nullable"`
+}
+type SyncWebDAV struct {
+ Endpoint string `json:"endpoint" api:"optional,nullable"`
+ Username string `json:"username" api:"optional,nullable"`
+ Password string `json:"password" api:"optional,nullable"`
+ SkipTlsVerify bool `json:"skipTlsVerify" api:"optional,nullable"`
+ Timeout int `json:"timeout" api:"optional,nullable"`
+ ConcurrentReqs int `json:"concurrentReqs" api:"optional,nullable"`
+}
+type SyncLocal struct {
+ Endpoint string `json:"endpoint" api:"optional,nullable"`
+ Timeout int `json:"timeout" api:"optional,nullable"`
+ ConcurrentReqs int `json:"concurrentReqs" api:"optional,nullable"`
+}
+type SyncS3Data struct {
+ S3 *SyncS3 `json:"s3"`
+}
+type SyncWebDAVData struct {
+ WebDAV *SyncWebDAV `json:"webdav"`
+}
+type SyncLocalData struct {
+ Local *SyncLocal `json:"local"`
+}
+type SetSyncS3Request struct {
+ S3 SyncS3 `json:"s3"`
+ configError error
+}
+type SetSyncWebDAVRequest struct {
+ WebDAV SyncWebDAV `json:"webdav"`
+ configError error
+}
+type SetSyncLocalRequest struct {
+ Local SyncLocal `json:"local"`
+ configError error
+}
+
+func (r SetSyncS3Request) ConfigError() error { return r.configError }
+func (r SetSyncWebDAVRequest) ConfigError() error { return r.configError }
+func (r SetSyncLocalRequest) ConfigError() error { return r.configError }
+
+type SyncLANStatus struct {
+ Enabled bool `json:"enabled"`
+ Active bool `json:"active"`
+ DiscoveredPeers int `json:"discoveredPeers"`
+ ConnectedPeers int `json:"connectedPeers"`
+ MaxConcurrentReqs int `json:"maxConcurrentReqs"`
+}
+type SyncOnlineKernel struct {
+ ID string `json:"id"`
+ Hostname string `json:"hostname"`
+ OS string `json:"os"`
+ Ver string `json:"ver"`
+}
+type SyncInfoData struct {
+ Synced int64 `json:"synced"`
+ Stat string `json:"stat"`
+ Kernels []*SyncOnlineKernel `json:"kernels"`
+ Kernel string `json:"kernel"`
+}
+type CloudSyncDir struct {
+ Size int64 `json:"size"`
+ HSize string `json:"hSize"`
+ Updated string `json:"updated"`
+ CloudName string `json:"cloudName"`
+ SaveDir string `json:"saveDir"`
+}
+type CloudSyncDirsData struct {
+ SyncDirs []*CloudSyncDir `json:"syncDirs"`
+ HSize string `json:"hSize"`
+ CheckedSyncDir string `json:"checkedSyncDir"`
+}
+type SyncAssetDownloadModeData struct {
+ AssetDownloadMode int `json:"assetDownloadMode"`
+}
+
+func syncConfigError(err error, name string) error {
+ if err == nil {
+ return nil
+ }
+ detail := strings.ReplaceAll(err.Error(), "apicontract.Sync"+name, "conf."+name)
+ return errors.New(strings.ReplaceAll(detail, "struct field Sync"+name+".", "struct field "+name+"."))
+}
+
+// syncRequestFields 保留整份请求的 JSON 数字解析、重复字段和首个对象读取语义。
+func syncRequestFields(reader io.Reader, path string) (fields map[string]json.RawMessage, err error) {
+ var raw json.RawMessage
+ err = json.NewDecoder(reader).Decode(&raw)
+ if err == nil {
+ fields, err = legacyJSONValue[map[string]json.RawMessage](raw)
+ }
+ if err != nil {
+ if errors.Is(err, io.EOF) {
+ err = errors.New("the request body is empty or truncated (EOF)")
+ }
+ detail := strings.ReplaceAll(err.Error(), "map[string]json.RawMessage", "map[string]interface {}")
+ err = fmt.Errorf("Parses request [%s] failed: %s", path, detail)
+ }
+ return
+}
+
+func init() {
+ for _, endpoint := range []*Endpoint[SyncEnabledRequest, Null]{&SetSyncEnable, &SetSyncPerception, &SetSyncGenerateConflictDoc} {
+ path := endpoint.definition.Path
+ endpoint.decodeRequest = func(reader io.Reader) (r SyncEnabledRequest, err error) {
+ fields, err := syncRequestFields(reader, path)
+ if err == nil {
+ r.Enabled, err = legacyField[bool](fields, "enabled", "Boolean", true)
+ }
+ return r, err
+ }
+ }
+ SetSyncInterval.decodeRequest = func(reader io.Reader) (r SyncIntervalRequest, err error) {
+ fields, err := syncRequestFields(reader, SetSyncInterval.definition.Path)
+ if err == nil {
+ r.Interval, err = legacyField[float64](fields, "interval", "Number", true)
+ }
+ return r, err
+ }
+ decodeMode := func(path string) func(io.Reader) (SyncModeRequest, error) {
+ return func(reader io.Reader) (r SyncModeRequest, err error) {
+ fields, err := syncRequestFields(reader, path)
+ if err == nil {
+ r.Mode, err = legacyField[float64](fields, "mode", "Number", true)
+ }
+ return r, err
+ }
+ }
+ SetSyncMode.decodeRequest = decodeMode(SetSyncMode.definition.Path)
+ SetSyncAssetDownloadMode.decodeRequest = decodeMode(SetSyncAssetDownloadMode.definition.Path)
+ SetSyncProvider.decodeRequest = func(reader io.Reader) (r SyncProviderRequest, err error) {
+ fields, err := syncRequestFields(reader, SetSyncProvider.definition.Path)
+ if err == nil {
+ r.Provider, err = legacyField[float64](fields, "provider", "Number", true)
+ }
+ return r, err
+ }
+ decodeName := func(path string) func(io.Reader) (SyncNameRequest, error) {
+ return func(reader io.Reader) (r SyncNameRequest, err error) {
+ fields, err := syncRequestFields(reader, path)
+ if err == nil {
+ r.Name, err = legacyField[string](fields, "name", "String", true)
+ }
+ if err == nil {
+ r.Name = strings.TrimSpace(r.Name)
+ if r.Name == "" {
+ err = errors.New("Field [name] must not be empty")
+ }
+ }
+ return r, err
+ }
+ }
+ SetCloudSyncDir.decodeRequest = decodeName(SetCloudSyncDir.definition.Path)
+ CreateCloudSyncDir.decodeRequest = decodeName(CreateCloudSyncDir.definition.Path)
+ RemoveCloudSyncDir.decodeRequest = decodeName(RemoveCloudSyncDir.definition.Path)
+ SetSyncLAN.decodeRequest = func(reader io.Reader) (r SyncLANRequest, err error) {
+ fields, err := syncRequestFields(reader, SetSyncLAN.definition.Path)
+ if err != nil {
+ return r, err
+ }
+ if r.Enabled, err = legacyField[bool](fields, "enabled", "Boolean", true); err != nil {
+ return r, err
+ }
+ r.MaxConcurrentReqs, err = legacyField[float64](fields, "maxConcurrentReqs", "Number", false)
+ return r, err
+ }
+ PerformSync.decodeRequest = func(reader io.Reader) (r PerformSyncRequest, err error) {
+ r.uploadFields, err = syncRequestFields(reader, PerformSync.definition.Path)
+ if err == nil {
+ r.MobileSwitch, err = legacyField[bool](r.uploadFields, "mobileSwitch", "Boolean", false)
+ }
+ return r, err
+ }
+ SetSyncProviderS3.decodeRequest = func(reader io.Reader) (r SetSyncS3Request, err error) {
+ fields, err := syncRequestFields(reader, SetSyncProviderS3.definition.Path)
+ if err != nil {
+ return r, err
+ }
+ if _, err = legacyField[map[string]json.RawMessage](fields, "s3", "Object", true); err != nil {
+ return r, err
+ }
+ r.S3, r.configError = legacyJSONValue[SyncS3](fields["s3"])
+ r.configError = syncConfigError(r.configError, "S3")
+ return r, nil
+ }
+ SetSyncProviderWebDAV.decodeRequest = func(reader io.Reader) (r SetSyncWebDAVRequest, err error) {
+ fields, err := syncRequestFields(reader, SetSyncProviderWebDAV.definition.Path)
+ if err != nil {
+ return r, err
+ }
+ if _, err = legacyField[map[string]json.RawMessage](fields, "webdav", "Object", true); err != nil {
+ return r, err
+ }
+ r.WebDAV, r.configError = legacyJSONValue[SyncWebDAV](fields["webdav"])
+ r.configError = syncConfigError(r.configError, "WebDAV")
+ return r, nil
+ }
+ SetSyncProviderLocal.decodeRequest = func(reader io.Reader) (r SetSyncLocalRequest, err error) {
+ fields, err := syncRequestFields(reader, SetSyncProviderLocal.definition.Path)
+ if err != nil {
+ return r, err
+ }
+ if _, err = legacyField[map[string]json.RawMessage](fields, "local", "Object", true); err != nil {
+ return r, err
+ }
+ r.Local, r.configError = legacyJSONValue[SyncLocal](fields["local"])
+ r.configError = syncConfigError(r.configError, "Local")
+ return r, nil
+ }
+}
diff --git a/kernel/apicontract/sync_test.go b/kernel/apicontract/sync_test.go
new file mode 100644
index 0000000000..72a6a0b131
--- /dev/null
+++ b/kernel/apicontract/sync_test.go
@@ -0,0 +1,81 @@
+package apicontract
+
+import (
+ "encoding/json"
+ "strings"
+ "testing"
+)
+
+func TestSyncConditionalDirection(t *testing.T) {
+ for _, body := range []string{`{}`, `null`, `{"upload":null}`, `{"upload":"wrong"}`, `{"upload":[]}`} {
+ request, err := PerformSync.Decode(strings.NewReader(body))
+ if err != nil {
+ t.Fatalf("direction validated before mode selection: %s: %v", body, err)
+ }
+ if _, err = request.UploadDirection(); err == nil {
+ t.Fatalf("manual direction accepted: %s", body)
+ }
+ }
+ for _, upload := range []bool{false, true} {
+ body, _ := json.Marshal(struct {
+ Upload bool `json:"upload"`
+ }{upload})
+ request, err := PerformSync.Decode(strings.NewReader(string(body)))
+ if err != nil {
+ t.Fatal(err)
+ }
+ value, err := request.UploadDirection()
+ if err != nil || value != upload {
+ t.Fatalf("direction changed: %v %v", value, err)
+ }
+ }
+ for _, body := range []string{`{"mobileSwitch":"wrong","upload":true}`, `{"mobileSwitch":0}`} {
+ if _, err := PerformSync.Decode(strings.NewReader(body)); err == nil {
+ t.Fatalf("invalid mobile switch accepted: %s", body)
+ }
+ }
+}
+
+func TestSyncProviderDecodeCompatibility(t *testing.T) {
+ request, err := SetSyncProviderS3.Decode(strings.NewReader(`{"s3":{"ENDPOINT":" endpoint ","timeout":1.0,"concurrentReqs":9007199254740993,"pathStyle":null,"unknown":1}}`))
+ if err != nil || request.ConfigError() != nil {
+ t.Fatalf("config decode failed: %v %v", err, request.ConfigError())
+ }
+ if request.S3.Endpoint != " endpoint " || request.S3.Timeout != 1 || request.S3.ConcurrentReqs != 9007199254740992 || request.S3.PathStyle {
+ t.Fatalf("configuration binding changed: %+v", request.S3)
+ }
+ for _, body := range []string{`{"s3":{"timeout":1.5}}`, `{"s3":{"endpoint":false}}`} {
+ request, err := SetSyncProviderS3.Decode(strings.NewReader(body))
+ if err != nil || request.ConfigError() == nil || !strings.Contains(request.ConfigError().Error(), "S3.") {
+ t.Fatalf("nested error lost deferred timeout behavior: %v %v", err, request.ConfigError())
+ }
+ }
+ for _, body := range []string{`{}`, `{"s3":null}`, `{"s3":[]}`} {
+ if _, err := SetSyncProviderS3.Decode(strings.NewReader(body)); err == nil {
+ t.Fatalf("missing or invalid object accepted: %s", body)
+ }
+ }
+}
+
+func TestSyncNameAndNumericCompatibility(t *testing.T) {
+ request, err := SetCloudSyncDir.Decode(strings.NewReader(`{"name":" cloud "}`))
+ if err != nil || request.Name != "cloud" {
+ t.Fatalf("name trimming changed: %+v %v", request, err)
+ }
+ for _, body := range []string{`{}`, `{"name":null}`, `{"name":" \t"}`, `{"name":1}`} {
+ if _, err := SetCloudSyncDir.Decode(strings.NewReader(body)); err == nil {
+ t.Fatalf("invalid name accepted: %s", body)
+ }
+ }
+ interval, err := SetSyncInterval.Decode(strings.NewReader(`{"interval":31.9}`))
+ if err != nil || int(interval.Interval) != 31 {
+ t.Fatalf("fractional interval changed: %+v %v", interval, err)
+ }
+ lan, err := SetSyncLAN.Decode(strings.NewReader(`{"enabled":false,"maxConcurrentReqs":null}`))
+ if err != nil || lan.MaxConcurrentReqs != 0 {
+ t.Fatalf("optional concurrency changed: %+v %v", lan, err)
+ }
+ if _, err := SetSyncMode.Decode(strings.NewReader(`{"mode":1,"unused":1e1000}`)); err == nil {
+ t.Fatal("overflow in body was ignored")
+ }
+}
diff --git a/kernel/model/lan_sync.go b/kernel/model/lan_sync.go
index 524341bbe4..5efba22645 100644
--- a/kernel/model/lan_sync.go
+++ b/kernel/model/lan_sync.go
@@ -350,7 +350,15 @@ func SetSyncLAN(enabled bool, maxConcurrentReqs int) {
refreshLANSyncManager()
}
-func GetSyncLANStatus() map[string]interface{} {
+type SyncLANStatus struct {
+ Enabled bool `json:"enabled"`
+ Active bool `json:"active"`
+ DiscoveredPeers int `json:"discoveredPeers"`
+ ConnectedPeers int `json:"connectedPeers"`
+ MaxConcurrentReqs int `json:"maxConcurrentReqs"`
+}
+
+func GetSyncLANStatus() SyncLANStatus {
lanSyncManagerMu.RLock()
manager := lanSyncManager
lanSyncManagerMu.RUnlock()
@@ -370,11 +378,11 @@ func GetSyncLANStatus() map[string]interface{} {
enabled = Conf.Sync.LAN.Enabled
maxConcurrentReqs = Conf.Sync.LAN.MaxConcurrentReqs
}
- return map[string]interface{}{
- "enabled": enabled,
- "active": nil != manager,
- "discoveredPeers": discoveredCount,
- "connectedPeers": connectedCount,
- "maxConcurrentReqs": maxConcurrentReqs,
+ return SyncLANStatus{
+ Enabled: enabled,
+ Active: nil != manager,
+ DiscoveredPeers: discoveredCount,
+ ConnectedPeers: connectedCount,
+ MaxConcurrentReqs: maxConcurrentReqs,
}
}