An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:recycle: Migrate search API contracts https://github.com/siyuan-note/siyuan/issues/19378
Daniel8c50f6e90742
diff --git a/app/src/mobile/menu/search.ts b/app/src/mobile/menu/search.tsindex 3661e08519..f6ee20a9ac 100644--- a/app/src/mobile/menu/search.ts+++ b/app/src/mobile/menu/search.ts@@ -1,4 +1,5 @@import {closePanel} from "../util/closePanel";+import type {APICallbackResponse, APIPOSTRoutes, FullTextSearchBlockRequestInput} from "../../types/api";import {getCurrentEditor, openMobileFileById} from "../editor";import {Constants} from "../../constants";import {fetchPost} from "../../util/fetch";@@ -61,10 +62,10 @@ const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAlk: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,r: replaceInputElement.value,ids: isAll ? [] : [currentId],- types: config.types,+ types: {...config.types},subTypes: config.subTypes,method: config.method,- replaceTypes: config.replaceTypes,+ replaceTypes: {...config.replaceTypes},paths: config.idPath || [],groupBy: config.group,orderBy: config.sort,@@ -315,10 +316,10 @@ export const updateSearchResult = (config: Config.IUILayoutTabSearchConfig, elempreviousElement.setAttribute("disabled", "disabled");}const endpoint = requestConfig.method === 4 ? "/api/search/semanticSearchBlock" : "/api/search/fullTextSearchBlock";- const searchParam: Record<string, any> = {+ const searchParam: FullTextSearchBlockRequestInput = {query: requestConfig.query,method: requestConfig.method,- types: requestConfig.types,+ types: {...requestConfig.types},subTypes: requestConfig.subTypes,paths: requestConfig.idPath || [],groupBy: requestConfig.group,@@ -338,7 +339,7 @@ export const updateSearchResult = (config: Config.IUILayoutTabSearchConfig, elemmethod: requestConfig.method,version,run(signal: AbortSignal, isCurrent: () => boolean) {- return fetchPost(endpoint, searchParam, (response) => {+ return fetchPost(endpoint, searchParam, (response: APICallbackResponse<APIPOSTRoutes[typeof endpoint]["response"]>) => {if (!isCurrent()) {return;}diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.tsindex 5d5e318886..4ac89c9029 100644--- a/app/src/protyle/hint/extend.ts+++ b/app/src/protyle/hint/extend.ts@@ -549,7 +549,7 @@ export const hintRef = (key: string, protyle: IProtyle, source: THintSource): IHconst nodeElement = hasClosestBlock(getEditorRange(protyle.wysiwyg.element).startContainer);const createTarget = protyle.hint.prepareCreateTarget(protyle, "ref");protyle.hint.genLoading(protyle);- let refParam: IObject;+ let refParam: import("../../types/api").SearchRefBlockRequestInput;if (protyle.lite) {refParam = {k: key, id: "", rootID: "", beforeLen: 48, isDatabase: false, isSquareBrackets: true};} else {@@ -633,7 +633,7 @@ export const hintEmbed = (key: string, protyle: IProtyle): IHintData[] => {}protyle.hint.genLoading(protyle);const nodeElement = hasClosestBlock(getEditorRange(protyle.wysiwyg.element).startContainer);- const embedParam: IObject = {+ const embedParam: import("../../types/api").SearchRefBlockRequestInput = {k: key,isDatabase: false,beforeLen: Math.floor((Math.max(protyle.element.clientWidth / 2, 320) - 58) / 28.8),diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.tsindex 843585cd08..039cf90a99 100644--- a/app/src/protyle/hint/index.ts+++ b/app/src/protyle/hint/index.ts@@ -612,7 +612,7 @@ export class Hint {private genSearchHTML(protyle: IProtyle, searchElement: HTMLInputElement, nodeElement: false | HTMLElement, oldValue: string, source: THintSource) {const createTarget = this.prepareCreateTarget(protyle, "ref");this.element.lastElementChild.innerHTML = '<div class="ft__center"><img style="height:32px;width:32px;" src="/stage/loading-pure.svg"></div>';- const searchParam: IObject = {+ const searchParam: import("../../types/api").SearchRefBlockRequestInput = {k: searchElement.value,id: nodeElement ? nodeElement.getAttribute("data-node-id") : protyle.block.parentID,beforeLen: Math.floor((Math.max(protyle.element.clientWidth / 2, 320) - 58) / 28.8),diff --git a/app/src/protyle/render/blockRender.ts b/app/src/protyle/render/blockRender.tsindex f049227d87..377417d480 100644--- a/app/src/protyle/render/blockRender.ts+++ b/app/src/protyle/render/blockRender.ts@@ -48,12 +48,8 @@ export const blockRender = (protyle: IProtyle, element: Element, top?: number, o}}}- let breadcrumb: boolean | string = item.getAttribute("breadcrumb");- if (breadcrumb) {- breadcrumb = breadcrumb === "true";- } else {- breadcrumb = window.siyuan.config.editor.embedBlockBreadcrumb;- }+ const breadcrumbAttribute = item.getAttribute("breadcrumb");+ const breadcrumb = breadcrumbAttribute ? breadcrumbAttribute === "true" : window.siyuan.config.editor.embedBlockBreadcrumb;if (content.startsWith("//!js")) {// 安全模式下禁用 JS 查询嵌入块,与代码片段(CSS/JS snippet)的处理保持一致diff --git a/app/src/search/util.ts b/app/src/search/util.tsindex 52fc13eac0..4aba089650 100644--- a/app/src/search/util.ts+++ b/app/src/search/util.ts@@ -1,4 +1,4 @@-import type {BlockQueryRequestInput} from "../types/api";+import type {APICallbackResponse, APIPOSTRoutes, BlockQueryRequestInput, FullTextSearchBlockRequestInput} from "../types/api";import {getAllModels} from "../layout/getAll";/// #if !BROWSERimport * as path from "path";@@ -1381,14 +1381,14 @@ export const replace = (element: Element, config: Config.IUILayoutTabSearchConfik: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentList) : searchInputElement.value,r: replaceInputElement.value,method: config.method,- types: config.types,+ types: {...config.types},subTypes: config.subTypes,paths: config.idPath || [],groupBy: config.group,orderBy: config.sort,page: config.page,ids: isAll ? [] : [currentId],- replaceTypes: config.replaceTypes+ replaceTypes: {...config.replaceTypes}}, (response) => {loadElement.classList.add("fn__none");if (response.code === 1) {@@ -1507,10 +1507,10 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCopreviousElement.setAttribute("disabled", "disabled");}const endpoint = requestConfig.method === 4 ? "/api/search/semanticSearchBlock" : "/api/search/fullTextSearchBlock";- const searchParam: Record<string, any> = {+ const searchParam: FullTextSearchBlockRequestInput = {query: requestConfig.query,method: requestConfig.method,- types: requestConfig.types,+ types: {...requestConfig.types},subTypes: requestConfig.subTypes,paths: requestConfig.idPath || [],groupBy: requestConfig.group,@@ -1531,7 +1531,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchComethod: requestConfig.method,version,run(signal: AbortSignal, isCurrent: () => boolean) {- return fetchPost(endpoint, searchParam, (response) => {+ return fetchPost(endpoint, searchParam, (response: APICallbackResponse<APIPOSTRoutes[typeof endpoint]["response"]>) => {if (!isCurrent()) {return;}@@ -1544,7 +1544,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCoonSearch(blocks, edit, element, requestConfig, requestFocusId);if (response.data.matchedBlockCount > 0) {let text = window.siyuan.languages.findInDoc.replace("${x}", response.data.matchedRootCount).replace("${y}", response.data.matchedBlockCount);- if (response.data.docMode) {+ if ("docMode" in response.data && response.data.docMode) {text = window.siyuan.languages.matchDoc.replace("${x}", response.data.matchedRootCount);}searchResultElement.innerHTML = `${requestConfig.page}/${response.data.pageCount || 1}<span class="fn__space"></span>@@ -1552,7 +1552,7 @@ export const inputEvent = (element: Element, config: Config.IUILayoutTabSearchCo} else {searchResultElement.innerHTML = "";}- searchResultElement.setAttribute("data-pagecount", response.data.pageCount || 1);+ searchResultElement.setAttribute("data-pagecount", String(response.data.pageCount || 1));}, undefined, undefined, signal);}};diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex fe6794eacc..39e0199f66 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -10,6 +10,12 @@ export type AppendBlockRequestInput = { "data": string; "dataType": string; "parexport type AppendHeadingChildrenRequestInput = { "childrenDOM": string; "id": string; };+export type AssetContent = { "content": string; "ext": string; "hSize": string; "id": string; "name": string; "path": string; "size": number; "updated": number; };++export type AssetContentData = { "assetContent": AssetContent | null; };++export type AssetContentRequestInput = { "id": string; "query": string; "queryMethod": number; };+export type AttributeViewColorTheme = { "backgroundColor": string; "color": string; };export type AttributeViewColorThemeInput = { "backgroundColor"?: string | null; "color"?: string | null; };@@ -230,6 +236,10 @@ export type DownloadInstallPkgRequestInput = { "downloadInstallPkg": boolean; };export type EditorReadOnlyRequestInput = { "readonly": boolean; };+export type EmbedBlock = { "allowChildOperation": boolean; "block": SearchBlock | null; "blockPaths": Array<BlockPath | null> | null; };++export type EmbedBlocksData = { "blocks": Array<EmbedBlock | null> | null; };+export type EmbedStat = { "complete": boolean; "cycleCount": number; "depthLimitCount": number; "failedQueryCount": number; "failedResultCount": number; "jsEmbedCount": number; "queryEmbedCount": number; "resultCount": number; "truncatedQueryCount": number; };export type EmptyRequestInput = Record<string, never>;@@ -244,8 +254,16 @@ export type FilePathData = { "path": string; };export type FilePathRequestInput = { "path": string; };+export type FindReplaceRequestInput = { "groupBy"?: number | null; "ids": Array<string>; "k": string; "method"?: number | null; "orderBy"?: number | null; "page"?: number | null; "pageSize"?: number | null; "paths"?: Array<string> | null; "query"?: string | null; "r": string; "replaceTypes"?: Record<string, boolean> | null; "subTypes"?: SearchSubtypeFilterInput | null; "types"?: Record<string, boolean> | null; };+export type FullBlockInfo = { "box": string; "path": string; "rootChildID": string; "rootID": string; "rootIcon": string; "rootTitle": string; "rootTitleEmpty": boolean; };+export type FullTextSearchBlockData = { "blocks": Array<SearchBlock | null> | null; "docMode": boolean; "matchedBlockCount": number; "matchedRootCount": number; "pageCount": number; };++export type FullTextSearchBlockRequestInput = { "groupBy"?: number | null; "method"?: number | null; "notebook"?: string | null; "orderBy"?: number | null; "page"?: number | null; "pageSize"?: number | null; "paths"?: Array<string> | null; "query"?: string | null; "searchHPath"?: boolean | null; "subTypes"?: SearchSubtypeFilterInput | null; "types"?: Record<string, boolean> | null; };++export type GetEmbedBlockRequestInput = { "breadcrumb"?: boolean | null; "embedBlockID": string; "headingMode"?: number | null; "includeIDs": Array<string>; "notebook"?: string | null; };+export type GetSnippetRequestInput = { "enabled": number; "keyword"?: string | null; "type": string; };export type GetTagRequestInput = { "app"?: string | null; "ignoreMaxListHint"?: boolean | null; "sort"?: number | null; };@@ -526,24 +544,64 @@ export type SQLQueryRequestInput = { "mode"?: string | null; "stmt": string; };export type SaveTemplateRequestInput = { "databaseMode"?: string; "directory"?: string; "id": string; "name": string; "overwrite": boolean; };+export type SearchAsset = { "hName": string; "path": string; "updated": number; };++export type SearchAssetContentData = { "assetContents": Array<AssetContent | null> | null; "matchedAssetCount": number; "pageCount": number; };++export type SearchAssetContentRequestInput = { "method"?: number | null; "orderBy"?: number | null; "page"?: number | null; "pageSize"?: number | null; "query"?: string | null; "types"?: Record<string, boolean> | null; };++export type SearchAssetRequestInput = { "exts"?: Array<string> | null; "k": string; };+export type SearchBlock = { "alias": string; "box": string; "children": Array<SearchBlock | null> | null; "content": string; "count": number; "created": string; "defID": string; "defPath": string; "depth": number; "fcontent": string; "folded": boolean; "hPath": string; "ial": Record<string, string> | null; "id": string; "markdown": string; "memo": string; "name": string; "number"?: string; "parentID": string; "path": string; "refCount": number; "refText": string; "refs": Array<SearchBlock | null> | null; "riffCard": SearchBlockCard | null; "riffCardID": string; "rootID": string; "sort": number; "subType": string; "tag": string; "type": string; "updated": string; };export type SearchBlockCard = { "due": string; "lapses": number; "lastReview": string; "reps": number; "state": number; };+export type SearchBlockRequestInput = { "groupBy"?: number | null; "method"?: number | null; "orderBy"?: number | null; "page"?: number | null; "pageSize"?: number | null; "paths"?: Array<string> | null; "query"?: string | null; "subTypes"?: SearchSubtypeFilterInput | null; "types"?: Record<string, boolean> | null; };++export type SearchBlocksData = { "blocks": Array<SearchBlock | null> | null; "matchedBlockCount": number; "matchedRootCount": number; "pageCount": number; };++export type SearchEmbedBlockRequestInput = { "breadcrumb"?: boolean | null; "embedBlockID": string; "excludeIDs": Array<string | null>; "headingMode"?: number | null; "notebook"?: string | null; "stmt": string; };++export type SearchHeadingFilterInput = { "h1"?: boolean | null; "h2"?: boolean | null; "h3"?: boolean | null; "h4"?: boolean | null; "h5"?: boolean | null; "h6"?: boolean | null; };+export type SearchHistoryData = { "histories": Array<string> | null; "pageCount": number; "totalCount": number; };export type SearchHistoryRequestInput = { "notebook"?: string | null; "op"?: string | null; "page"?: number | null; "query"?: string | null; "type"?: number | null; };+export type SearchKeywordRequestInput = { "k": string; };++export type SearchListFilterInput = { "o"?: boolean | null; "t"?: boolean | null; "u"?: boolean | null; };++export type SearchPageRequestInput = { "page"?: number | null; "pageSize"?: number | null; };+export type SearchPath = { "blocks"?: Array<SearchBlock | null>; "box": string; "children"?: Array<SearchPath | null>; "count": number; "created": string; "depth": number; "folded": boolean; "hPath": string; "id": string; "name": string; "nodeType": string; "number"?: string; "subType": string; "type": string; "updated": string; };+export type SearchPathRequestInput = { "path": string; };++export type SearchRefBlockRequestInput = { "beforeLen"?: number; "id"?: string | null; "isDatabase"?: boolean | null; "isSquareBrackets"?: boolean | null; "k"?: string; "notebook"?: string | null; "reqId"?: JSONValue | null; "rootID"?: string; };++export type SearchRefCorrelation = { "reqId": JSONValue; };++export type SearchRefResult = { "blocks": Array<SearchBlock | null> | null; "k": string; "newDoc": boolean; "reqId": JSONValue; };+export type SearchSubTypes = { "heading": Record<string, boolean> | null; "list": Record<string, boolean> | null; "listItem": Record<string, boolean> | null; };export type SearchSubTypesInput = { "heading"?: Record<string, boolean> | null; "list"?: Record<string, boolean> | null; "listItem"?: Record<string, boolean> | null; };+export type SearchSubtypeFilterInput = { "heading"?: SearchHeadingFilterInput | null; "list"?: SearchListFilterInput | null; "listItem"?: SearchListFilterInput | null; };+export type SearchTagData = { "k": string; "tags": Array<string>; };export type SearchTagRequestInput = { "k": string; };+export type SearchTemplateData = { "k": string; "templates": Array<SearchTemplateResult | null> | null; };++export type SearchTemplateResult = { "content": string; "path": string; "relativePath": string; };++export type SearchWidgetData = { "k": string; "widgets": Array<SearchWidgetResult | null> | null; };++export type SearchWidgetResult = { "content": string; "name": string; };+export type SetBlockAttrsRequestInput = { "attrs": Record<string, string | null>; "id": string; };export type SetCriterionRequestInput = { "criterion": CriterionInput | null; };@@ -634,6 +692,8 @@ export type UpdateBlockRequestInput = { "data": string; "dataType": string; "id"export type UpdateChannelRequestInput = { "updateChannel": string; };+export type UpdateEmbedBlockRequestInput = { "content": string; "id": string; };+export type UpdatePinnedDocsRequestInput = { "action": string; "after"?: boolean; "ids": Array<string>; "targetID"?: string; };export type ViewStatePatchRequestInput = { "key": string; "removeKeys"?: Array<string> | null; "values"?: { [key: string]: JSONValue }; };@@ -943,21 +1003,6 @@ export type APILegacyPOSTPath ="/api/riff/resetRiffCards" |"/api/riff/reviewRiffCard" |"/api/riff/skipReviewRiffCard" |- "/api/search/findReplace" |- "/api/search/fullTextSearchAssetContent" |- "/api/search/fullTextSearchBlock" |- "/api/search/getAssetContent" |- "/api/search/getAssetContentByPath" |- "/api/search/getEmbedBlock" |- "/api/search/listInvalidBlockRefs" |- "/api/search/removeTemplate" |- "/api/search/searchAsset" |- "/api/search/searchEmbedBlock" |- "/api/search/searchRefBlock" |- "/api/search/searchTemplate" |- "/api/search/searchWidget" |- "/api/search/semanticSearchBlock" |- "/api/search/updateEmbedBlock" |"/api/setting/getBootAppearances" |"/api/setting/getCloudUser" |"/api/setting/getPublish" |@@ -1960,11 +2005,86 @@ export interface APIPOSTRoutes {response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };body: "json";};+ "/api/search/findReplace": {+ request: FindReplaceRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/fullTextSearchAssetContent": {+ request: SearchAssetContentRequestInput;+ response: { "code": 0; "data": SearchAssetContentData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/fullTextSearchBlock": {+ request: FullTextSearchBlockRequestInput;+ response: { "code": 0; "data": FullTextSearchBlockData | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/getAssetContent": {+ request: AssetContentRequestInput;+ response: { "code": 0; "data": AssetContentData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/getAssetContentByPath": {+ request: SearchPathRequestInput;+ response: { "code": 0; "data": AssetContentData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/getEmbedBlock": {+ request: GetEmbedBlockRequestInput;+ response: { "code": 0; "data": EmbedBlocksData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/listInvalidBlockRefs": {+ request: SearchPageRequestInput;+ response: { "code": 0; "data": SearchBlocksData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/removeTemplate": {+ request: SearchPathRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/searchAsset": {+ request: SearchAssetRequestInput;+ response: { "code": 0; "data": Array<SearchAsset | null> | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/searchEmbedBlock": {+ request: SearchEmbedBlockRequestInput;+ response: { "code": 0; "data": EmbedBlocksData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/searchRefBlock": {+ request: SearchRefBlockRequestInput;+ response: { "code": 0; "data": SearchRefResult | (SearchRefCorrelation & { "blocks"?: never; "k"?: never; "newDoc"?: never; }); "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null | SearchRefResult | (SearchRefCorrelation & { "blocks"?: never; "k"?: never; "newDoc"?: never; }); "msg": string; };+ body: "json";+ };"/api/search/searchTag": {request: SearchTagRequestInput;response: { "code": 0; "data": SearchTagData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };body: "json";};+ "/api/search/searchTemplate": {+ request: SearchKeywordRequestInput;+ response: { "code": 0; "data": SearchTemplateData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/searchWidget": {+ request: SearchKeywordRequestInput;+ response: { "code": 0; "data": SearchWidgetData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/semanticSearchBlock": {+ request: SearchBlockRequestInput;+ response: { "code": 0; "data": SearchBlocksData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/search/updateEmbedBlock": {+ request: UpdateEmbedBlockRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };"/api/setting/addVirtualBlockRefExclude": {request: VirtualBlockRefRequestInput;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.tsindex ae0ea1bfa5..f5478c49a0 100644--- a/app/tests/api-contract.types.ts+++ b/app/tests/api-contract.types.ts@@ -6,6 +6,29 @@ declare const fetchGet: FetchGet;declare const fetchSyncPost: FetchSyncPost;declare const dynamicURL: string;+fetchPost("/api/search/fullTextSearchBlock", {query: "text", subTypes: {heading: {h1: true}}}, response => {+ if (response.data) {+ const count: number = response.data.matchedBlockCount;+ const docMode: boolean = response.data.docMode;+ void [count, docMode];+ }+});+fetchPost("/api/search/searchRefBlock", {reqId: [1]}, response => {+ const reqId: JSONValue = response.data.reqId;+ // @ts-expect-error 仅回传请求标识的结果没有块数组。+ const blocks: unknown[] = response.data.blocks;+ void [reqId, blocks];+});+fetchPost("/api/search/searchEmbedBlock", {embedBlockID: "id", stmt: "select * from blocks", excludeIDs: [null, "id"]});+// @ts-expect-error 普通嵌入查询不接受空值块 ID。+fetchPost("/api/search/getEmbedBlock", {embedBlockID: "id", includeIDs: [null]});+// @ts-expect-error 子类型筛选使用布尔值。+fetchPost("/api/search/fullTextSearchBlock", {subTypes: {heading: {h1: "true"}}});+// @ts-expect-error 替换操作必须提供待替换文本。+fetchPost("/api/search/findReplace", {k: "text", ids: []});+// @ts-expect-error 搜索分页参数使用数字。+fetchPost("/api/search/fullTextSearchAssetContent", {page: "1"});+fetchPost("/api/query/sql", {stmt: "SELECT 1", mode: "readonly"}, response => {if (response.code === 0) {const limit: number = response.limit;diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.mdindex b1878531b3..0ead182e0f 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+Search contracts retain pagination defaults and numeric truncation, path validation and deduplication, ignored historical subtype filters, and null versus empty arrays. Reference search distinguishes correlation-only responses from block results and retains notebook admission before deferred parameter validation. SQL search authorization, publish filtering, encrypted notebook leases, cancellation responses, and read-only embed-update no-ops remain in their original order. Desktop and mobile callers share generated request types.+History contracts retain path trimming, optional highlight defaults, fractional history-type truncation, and null versus empty result arrays. Version comparison checks both reference objects before their fields and acquires notebook leases in sorted order. Content reads and document, asset, and attribute-view rollbacks retain their history-path lease checks; notebook rollback keeps its existing model-level recovery behavior.Import contracts preserve archive cleanup, first-upload selection, untrimmed Markdown paths, and staged-token trimming and lifetime. Automatic SiYuan imports declare document, token, notebook, and notebook-collection results; mount failures retain the document payload. Obsidian task cancellation retains its task snapshot on failure. Notebook mounting, encrypted import handling, and creation notifications remain in the existing business operations.diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.mdindex 445ba2a6de..33b9e437c6 100644--- a/docs/API-CONTRACTS.zh-CN.md+++ b/docs/API-CONTRACTS.zh-CN.md@@ -24,6 +24,8 @@## 兼容要求+搜索契约保留分页默认值与小数截断、路径校验与去重、历史子类型筛选的忽略规则,以及空值与空数组的区别。引用搜索区分仅回传请求标识和完整块结果,保留笔记本准入先于延迟参数校验的顺序。SQL 搜索权限、发布过滤、加密笔记本租约、取消请求的响应和只读嵌入块更新的空操作保持原有顺序。桌面端与移动端调用使用生成的请求类型。+历史契约保留路径去空白、可选高亮默认值、历史类型的小数截断,以及空值与空数组的区别。版本对比先检查两个引用对象,再检查对象字段,并按排序后的笔记本 ID 获取租约。内容读取及文档、资源和数据库回滚保留历史路径租约检查,笔记本回滚沿用模型层的恢复行为。导入契约保留压缩包清理、首个上传文件选择、Markdown 路径空白,以及暂存令牌去空白和有效期。思源自动导入声明文档、令牌、笔记本和笔记本集合结果,挂载失败时保留文档载荷。Obsidian 任务取消失败时保留任务快照。笔记本挂载、加密导入处理和创建通知仍由既有业务操作负责。diff --git a/kernel/api/contract_search_test.go b/kernel/api/contract_search_test.gonew file mode 100644index 0000000000..e5eaa8d9b5--- /dev/null+++ b/kernel/api/contract_search_test.go@@ -0,0 +1,134 @@+package api++import (+ "encoding/json"+ "net/http/httptest"+ "reflect"+ "strings"+ "testing"++ "github.com/gin-gonic/gin"+ "github.com/siyuan-note/siyuan/kernel/apicontract"+ "github.com/siyuan-note/siyuan/kernel/model"+ "github.com/siyuan-note/siyuan/kernel/util"+)++func TestAPIContractSearchPermissions(t *testing.T) {+ previousConf, previousReadOnly := model.Conf, util.ReadOnly+ model.Conf = model.NewAppConf()+ t.Cleanup(func() { model.Conf, util.ReadOnly = previousConf, previousReadOnly })+ for _, entry := range []struct {+ path, body string+ role model.Role+ readOnly bool+ code int+ data string+ }{+ {"fullTextSearchBlock", `{"method":2}`, model.RoleEditor, false, -1, `null`},+ {"fullTextSearchAssetContent", `{"method":2}`, model.RoleReader, false, -1, `null`},+ {"fullTextSearchBlock", `{"method":2}`, model.RoleAdministrator, true, -1, `{"closeTimeout":5000}`},+ {"updateEmbedBlock", `invalid JSON`, model.RoleReader, false, 0, `null`},+ {"searchRefBlock", `{"reqId":{"sequence":12},"rootID":false}`, model.RoleEditor, false, 0, `{"reqId":{"sequence":12}}`},+ } {+ util.ReadOnly = entry.readOnly+ engine := gin.New()+ engine.Use(func(c *gin.Context) { c.Set(model.RoleContextKey, entry.role) })+ engine.POST("/api/search/fullTextSearchBlock", fullTextSearchBlock)+ engine.POST("/api/search/fullTextSearchAssetContent", fullTextSearchAssetContent)+ engine.POST("/api/search/updateEmbedBlock", updateEmbedBlock)+ engine.POST("/api/search/searchRefBlock", searchRefBlock)+ path := "/api/search/" + entry.path+ recorder := httptest.NewRecorder()+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", path, strings.NewReader(entry.body)))+ requireAPIContract(t, "POST", path, recorder)+ var response struct {+ Code int `json:"code"`+ Data json.RawMessage `json:"data"`+ }+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != entry.code || string(response.Data) != entry.data {+ t.Fatalf("search permission response changed: %s: %s, %v", path, recorder.Body.String(), err)+ }+ }+}++func TestAPIContractSearchLockedNotebook(t *testing.T) {+ _, boxID := setupArchiveWorkspace(t)+ previous := model.Conf+ model.Conf = model.NewAppConf()+ t.Cleanup(func() { model.Conf = previous })+ engine := gin.New()+ engine.Use(func(c *gin.Context) { c.Set(model.RoleContextKey, model.RoleAdministrator) })+ engine.POST("/api/search/searchRefBlock", searchRefBlock)+ recorder := httptest.NewRecorder()+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", "/api/search/searchRefBlock", strings.NewReader(`{"id":false,"notebook":"`+boxID+`","reqId":7}`)))+ requireAPIContract(t, "POST", "/api/search/searchRefBlock", recorder)+ var response struct {+ Code int `json:"code"`+ Msg string `json:"msg"`+ Data json.RawMessage `json:"data"`+ }+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != -1 || response.Msg != "encrypted notebook is locked, please unlock it first" || string(response.Data) != `{"reqId":7}` {+ t.Fatalf("locked ref search order changed: %s, %v", recorder.Body.String(), err)+ }+}++func TestAPIContractSearchEmbedConversion(t *testing.T) {+ for _, blocks := range [][]*model.EmbedBlock{nil, {}, {nil, {}, {Block: &model.Block{ID: "block", Children: []*model.Block{}}, BlockPaths: []*model.BlockPath{}, AllowChildOperation: true}}} {+ expected, err := json.Marshal(blocks)+ if err != nil {+ t.Fatal(err)+ }+ actual, err := json.Marshal(embedBlockContracts(blocks))+ if err != nil || string(actual) != string(expected) {+ t.Fatalf("embed serialization changed: %s != %s, %v", actual, expected, err)+ }+ }+}++func TestAPIContractSearchPathAndSubtypeCompatibility(t *testing.T) {+ body := `{"paths":["20260101000000-abcdefg/20260101000000-hijklmn.sy","20260101000000-abcdefg/20260101000000-hijklmn.sy","bad'box/doc.sy"],"subTypes":{"heading":{"h1":true,"h2":"true"},"list":{"t":true}}}`+ request, err := apicontract.SemanticSearchBlock.Decode(strings.NewReader(body))+ if err != nil {+ t.Fatal(err)+ }+ _, _, _, paths, boxes, _, subtypes, _, _, _ := parseSearchBlockRequest(request)+ if !reflect.DeepEqual(paths, []string{"/20260101000000-hijklmn.sy"}) || !reflect.DeepEqual(boxes, []string{"20260101000000-abcdefg"}) || !reflect.DeepEqual(subtypes, map[string]bool{"h1": true, "list:t": true}) {+ t.Fatalf("search path filtering changed: %v, %v, %v", paths, boxes, subtypes)+ }+}++// 搜索查询在契约测试的独立进程内访问临时数据库。+func testSearchQueryContracts(t *testing.T, docID string) {+ t.Helper()+ for _, entry := range []struct {+ path, body string+ handler gin.HandlerFunc+ }{+ {"searchAsset", `{"k":"missing","exts":[]}`, searchAsset},+ {"searchWidget", `{"k":" missing "}`, searchWidget},+ {"searchTemplate", `{"k":" missing "}`, searchTemplate},+ {"getAssetContent", `{"id":"missing","query":"","queryMethod":0}`, getAssetContent},+ {"getAssetContentByPath", `{"path":"assets/missing"}`, getAssetContentByPath},+ {"fullTextSearchAssetContent", `{"query":"missing","page":2}`, fullTextSearchAssetContent},+ {"listInvalidBlockRefs", `{}`, listInvalidBlockRefs},+ {"fullTextSearchBlock", `{"query":"missing"}`, fullTextSearchBlock},+ {"getEmbedBlock", `{"embedBlockID":"` + docID + `","includeIDs":[]}`, getEmbedBlock},+ {"searchEmbedBlock", `{"embedBlockID":"` + docID + `","stmt":"select * from blocks where id = 'missing'","excludeIDs":[null]}`, searchEmbedBlock},+ {"searchRefBlock", `{"id":"` + docID + `","rootID":"` + docID + `","k":"missing","beforeLen":32,"reqId":12}`, searchRefBlock},+ } {+ engine := gin.New()+ engine.Use(boxLeaseMiddleware, func(c *gin.Context) { c.Set(model.RoleContextKey, model.RoleAdministrator) })+ path := "/api/search/" + entry.path+ engine.POST(path, entry.handler)+ recorder := httptest.NewRecorder()+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", path, strings.NewReader(entry.body)))+ requireAPIContract(t, "POST", path, recorder)+ var response struct {+ Code int `json:"code"`+ Data json.RawMessage `json:"data"`+ }+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil || response.Code != 0 {+ t.Fatalf("search query failed: %s: %s, %v", path, recorder.Body.String(), err)+ }+ }+}diff --git a/kernel/api/contract_test.go b/kernel/api/contract_test.goindex 6e813116f9..09b665fb4c 100644--- a/kernel/api/contract_test.go+++ b/kernel/api/contract_test.go@@ -161,6 +161,7 @@ func TestAPIContractHandlers(t *testing.T) {testSQLContractQueries(t)testGraphResetContracts(t)testGraphQueryContracts(t, docID)+ testSearchQueryContracts(t, docID)blockQueries := []struct {path stringhandler gin.HandlerFuncdiff --git a/kernel/api/search.go b/kernel/api/search.goindex e2334e2d0f..d929b16b86 100644--- a/kernel/api/search.go+++ b/kernel/api/search.go@@ -18,7 +18,6 @@ package apiimport ("fmt"- "net/http""strings""github.com/88250/gulu"@@ -29,31 +28,8 @@ import ("github.com/siyuan-note/siyuan/kernel/util")-func listInvalidBlockRefs(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- page := 1- if nil != arg["page"] {- page = int(arg["page"].(float64))- }- if 0 >= page {- page = 1- }-- pageSize := 32- if nil != arg["pageSize"] {- pageSize = int(arg["pageSize"].(float64))- }- if 0 >= pageSize {- pageSize = 32- }-+var listInvalidBlockRefs = contractHandler(apicontract.ListInvalidBlockRefs, func(c *gin.Context, request apicontract.SearchPageRequest) apicontract.Response[apicontract.SearchBlocksData] {+ page, pageSize := request.Pagination()var blocks []*model.Blockvar matchedBlockCount, matchedRootCount, pageCount intif model.IsReadOnlyRoleContext(c) {@@ -69,82 +45,41 @@ func listInvalidBlockRefs(c *gin.Context) {} else {blocks, matchedBlockCount, matchedRootCount, pageCount = model.ListInvalidBlockRefs(page, pageSize, nil, nil)}- ret.Data = map[string]any{- "blocks": blocks,- "matchedBlockCount": matchedBlockCount,- "matchedRootCount": matchedRootCount,- "pageCount": pageCount,- }-}--func getAssetContent(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- id := arg["id"].(string)- query := arg["query"].(string)- queryMethod := int(arg["queryMethod"].(float64))- assetContent := model.GetAssetContent(id, query, queryMethod)+ return apicontract.Success(apicontract.SearchBlocksData{Blocks: searchBlockContracts(blocks), MatchedBlockCount: matchedBlockCount, MatchedRootCount: matchedRootCount, PageCount: pageCount})+})+var getAssetContent = contractHandler(apicontract.GetAssetContent, func(c *gin.Context, request apicontract.AssetContentRequest) apicontract.Response[apicontract.AssetContentData] {+ assetContent := model.GetAssetContent(request.ID, request.Query, int(request.QueryMethod))if model.IsReadOnlyRoleContext(c) && assetContent != nil {publishAccess := model.GetPublishAccess()- filteredAssetContents := model.FilterAssetContentByPublishAccess(c, publishAccess, []*model.AssetContent{assetContent})- if len(filteredAssetContents) > 0 {- assetContent = filteredAssetContents[0]+ filtered := model.FilterAssetContentByPublishAccess(c, publishAccess, []*model.AssetContent{assetContent})+ if len(filtered) > 0 {+ assetContent = filtered[0]} else {assetContent = nil}}- ret.Data = map[string]any{- "assetContent": assetContent,- }- return-}--func getAssetContentByPath(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return apicontract.Success(apicontract.AssetContentData{AssetContent: (*apicontract.AssetContent)(assetContent)})+})- path := arg["path"].(string)- assetContent := model.GetAssetContentByPath(path)+var getAssetContentByPath = contractHandler(apicontract.GetAssetContentByPath, func(c *gin.Context, request apicontract.SearchPathRequest) apicontract.Response[apicontract.AssetContentData] {+ assetContent := model.GetAssetContentByPath(request.Path)if model.IsReadOnlyRoleContext(c) && assetContent != nil {publishAccess := model.GetPublishAccess()- filteredAssetContents := model.FilterAssetContentByPublishAccess(c, publishAccess, []*model.AssetContent{assetContent})- if len(filteredAssetContents) > 0 {- assetContent = filteredAssetContents[0]+ filtered := model.FilterAssetContentByPublishAccess(c, publishAccess, []*model.AssetContent{assetContent})+ if len(filtered) > 0 {+ assetContent = filtered[0]} else {assetContent = nil}}- ret.Data = map[string]any{- "assetContent": assetContent,- }- return-}--func fullTextSearchAssetContent(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return apicontract.Success(apicontract.AssetContentData{AssetContent: (*apicontract.AssetContent)(assetContent)})+})- page, pageSize, query, types, method, orderBy := parseSearchAssetContentArgs(arg)+var fullTextSearchAssetContent = contractHandler(apicontract.FullTextSearchAssetContent, func(c *gin.Context, request apicontract.SearchAssetContentRequest) apicontract.Response[apicontract.SearchAssetContentData] {+ page, pageSize := request.Pagination()+ query, types, method, orderBy := request.Query, request.Types, int(request.Method), int(request.OrderBy)if method == 2 && !model.IsAdminRoleContext(c) {- ret.Code = -1- ret.Msg = "SQL search requires administrator privileges"- return+ return apicontract.Failure[apicontract.SearchAssetContentData](-1, "SQL search requires administrator privileges")}isReadOnlyRole := model.IsReadOnlyRoleContext(c)@@ -155,9 +90,7 @@ func fullTextSearchAssetContent(c *gin.Context) {}assetContents, matchedAssetCount, pageCount, err := model.FullTextSearchAssetContent(query, types, method, orderBy, searchPage, searchPageSize)if err != nil {- ret.Code = -1- ret.Msg = err.Error()- return+ return apicontract.Failure[apicontract.SearchAssetContentData](-1, err.Error())}if isReadOnlyRole {publishAccess := model.GetPublishAccess()@@ -172,83 +105,54 @@ func fullTextSearchAssetContent(c *gin.Context) {assetContents = assetContents[from:to]}}- ret.Data = map[string]any{- "assetContents": assetContents,- "matchedAssetCount": matchedAssetCount,- "pageCount": pageCount,- }-}--func findReplace(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return+ var result []*apicontract.AssetContent+ if assetContents != nil {+ result = make([]*apicontract.AssetContent, len(assetContents))+ for i, value := range assetContents {+ result[i] = (*apicontract.AssetContent)(value)+ }}+ return apicontract.Success(apicontract.SearchAssetContentData{AssetContents: result, MatchedAssetCount: matchedAssetCount, PageCount: pageCount})+})- _, _, _, paths, boxes, types, subTypes, method, _, _ := parseSearchBlockArgs(arg)+var findReplace = contractHandler(apicontract.FindReplace, func(c *gin.Context, request apicontract.FindReplaceRequest) apicontract.Response[apicontract.Null] {+ _, _, _, paths, boxes, types, subTypes, method, _, _ := parseSearchBlockRequest(request.SearchBlockRequest)- k := arg["k"].(string)- r := arg["r"].(string)- idsArg := arg["ids"].([]any)- var ids []string- for _, id := range idsArg {- ids = append(ids, id.(string))- }-- replaceTypes := map[string]bool{}- // text, imgText, imgTitle, imgSrc, aText, aTitle, aHref, code, em, strong, inlineMath, inlineMemo, blockRef, fileAnnotationRef kbd, mark, s, sub, sup, tag, u- // docTitle, codeBlock, mathBlock, htmlBlock- if nil != arg["replaceTypes"] {- replaceTypesArg := arg["replaceTypes"].(map[string]any)- for t, b := range replaceTypesArg {- replaceTypes[t] = b.(bool)- }+ k, r := request.K, request.R+ ids := append([]string(nil), request.IDs...)+ replaceTypes := request.ReplaceTypes+ if replaceTypes == nil {+ replaceTypes = map[string]bool{}}boxID := ""if 1 == len(boxes) && model.IsEncryptedBox(boxes[0]) {boxID = boxes[0]if err := holdEncryptedBoxRequest(c, boxID); err != nil {- ret.Code = 1- ret.Msg = err.Error()- return+ return apicontract.Failure[apicontract.Null](1, err.Error())}}err := model.FindReplaceInBox(k, r, replaceTypes, ids, paths, boxes, types, subTypes, method, boxID)if err != nil {- ret.Code = 1- ret.Msg = err.Error()- ret.Data = map[string]any{"closeTimeout": 5000}- return- }- return-}--func searchAsset(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return+ return apicontract.FailureWithTimeout[apicontract.Null](1, err.Error(), 5000)}+ return apicontract.Success(apicontract.Null{})+})- k := arg["k"].(string)-+var searchAsset = contractHandler(apicontract.SearchAssetByName, func(c *gin.Context, request apicontract.SearchAssetRequest) apicontract.Response[[]*apicontract.SearchAsset] {var exts []string- if extsArg := arg["exts"]; nil != extsArg {- for _, ext := range extsArg.([]any) {- exts = append(exts, ext.(string))+ exts = append(exts, request.Exts...)+ assets := model.SearchAssetsByName(request.K, exts)+ var result []*apicontract.SearchAsset+ if assets != nil {+ result = make([]*apicontract.SearchAsset, len(assets))+ for i, asset := range assets {+ result[i] = (*apicontract.SearchAsset)(asset)}}-- ret.Data = model.SearchAssetsByName(k, exts)- return-}+ return apicontract.Success(result)+})var searchTag = contractHandler(apicontract.SearchTag, func(c *gin.Context, request apicontract.SearchTagRequest) apicontract.Response[apicontract.SearchTagData] {@@ -260,97 +164,50 @@ var searchTag = contractHandler(apicontract.SearchTag, func(c *gin.Context, requreturn apicontract.Success(apicontract.SearchTagData{Tags: tags, K: k})})-func searchWidget(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- keyword := arg["k"].(string)- widgets := model.SearchWidget(keyword)- ret.Data = map[string]any{- "widgets": widgets,- "k": keyword,- }-}--func removeTemplate(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- path := arg["path"].(string)- err := model.RemoveTemplate(path)- if err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }-}--func searchTemplate(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return+var searchWidget = contractHandler(apicontract.SearchWidget, func(c *gin.Context, request apicontract.SearchKeywordRequest) apicontract.Response[apicontract.SearchWidgetData] {+ values := model.SearchWidget(request.K)+ var result []*apicontract.SearchWidgetResult+ if values != nil {+ result = make([]*apicontract.SearchWidgetResult, len(values))+ for i, value := range values {+ result[i] = (*apicontract.SearchWidgetResult)(value)+ }}+ return apicontract.Success(apicontract.SearchWidgetData{Widgets: result, K: request.K})+})- keyword := arg["k"].(string)- templates := model.SearchTemplate(keyword)- ret.Data = map[string]any{- "templates": templates,- "k": keyword,+var removeTemplate = contractHandler(apicontract.RemoveSearchTemplate, func(c *gin.Context, request apicontract.SearchPathRequest) apicontract.Response[apicontract.Null] {+ if err := model.RemoveTemplate(request.Path); err != nil {+ return apicontract.Failure[apicontract.Null](-1, err.Error())}-}--func getEmbedBlock(c *gin.Context) {- // Query embed block supports executing JavaScript https://github.com/siyuan-note/siyuan/issues/9648- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)+ return apicontract.Success(apicontract.Null{})+})- arg, ok := util.JsonArg(c, ret)- if !ok {- return+var searchTemplate = contractHandler(apicontract.SearchTemplate, func(c *gin.Context, request apicontract.SearchKeywordRequest) apicontract.Response[apicontract.SearchTemplateData] {+ values := model.SearchTemplate(request.K)+ var result []*apicontract.SearchTemplateResult+ if values != nil {+ result = make([]*apicontract.SearchTemplateResult, len(values))+ for i, value := range values {+ result[i] = (*apicontract.SearchTemplateResult)(value)+ }}+ return apicontract.Success(apicontract.SearchTemplateData{Templates: result, K: request.K})+})- embedBlockID := arg["embedBlockID"].(string)- includeIDsArg := arg["includeIDs"].([]any)- var includeIDs []string- for _, includeID := range includeIDsArg {- includeIDs = append(includeIDs, includeID.(string))- }- headingMode := 0 // 0:显示标题与下方的块,1:仅显示标题,2:仅显示标题下方的块- headingModeArg := arg["headingMode"]- if nil != headingModeArg {- headingMode = int(headingModeArg.(float64))- }- breadcrumb := false- breadcrumbArg := arg["breadcrumb"]- if nil != breadcrumbArg {- breadcrumb = breadcrumbArg.(bool)- }+var getEmbedBlock = contractHandler(apicontract.GetEmbedBlock, func(c *gin.Context, request apicontract.GetEmbedBlockRequest) apicontract.Response[apicontract.EmbedBlocksData] {+ embedBlockID, headingMode, breadcrumb := request.EmbedBlockID, int(request.HeadingMode), request.Breadcrumb+ includeIDs := append([]string(nil), request.IncludeIDs...)notebook := ""- if notebookArg, ok := arg["notebook"].(string); ok && model.IsEncryptedBox(notebookArg) {- notebook = notebookArg+ if model.IsEncryptedBox(request.Notebook) {+ notebook = request.Notebook}-isReadOnlyRole := model.IsReadOnlyRoleContext(c)var blocks []*model.EmbedBlockif isReadOnlyRole {publishAccess := model.GetPublishAccess()if !model.CheckBlockIdAccessableByPublishAccess(c, publishAccess, embedBlockID) {- ret.Code = -1- ret.Msg = fmt.Sprintf(model.Conf.Language(15), embedBlockID)- return+ return apicontract.Failure[apicontract.EmbedBlocksData](-1, fmt.Sprintf(model.Conf.Language(15), embedBlockID))}blocks = model.GetEmbedBlockForPublish(embedBlockID, includeIDs, headingMode, breadcrumb)blocks = model.FilterEmbedBlocksByPublishAccess(c, publishAccess, blocks)@@ -361,93 +218,50 @@ func getEmbedBlock(c *gin.Context) {blocks = model.GetEmbedBlockInBox(embedBlockID, includeIDs, headingMode, breadcrumb, notebook)}}- ret.Data = map[string]any{- "blocks": blocks,- }-}--func updateEmbedBlock(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- if model.IsReadOnlyRoleContext(c) {- return- }-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- id := arg["id"].(string)- content := arg["content"].(string)+ return apicontract.Success(apicontract.EmbedBlocksData{Blocks: embedBlockContracts(blocks)})+})- err := model.UpdateEmbedBlock(id, content)- if err != nil {- ret.Code = -1- ret.Msg = err.Error()- return+var updateEmbedBlock = contractHandler(apicontract.UpdateEmbedBlock, func(c *gin.Context, request apicontract.UpdateEmbedBlockRequest) apicontract.Response[apicontract.Null] {+ if err := model.UpdateEmbedBlock(request.ID, request.Content); err != nil {+ return apicontract.Failure[apicontract.Null](-1, err.Error())}-}--func searchEmbedBlock(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return+ return apicontract.Success(apicontract.Null{})+}, func(c *gin.Context) *apicontract.Response[apicontract.Null] {+ if model.IsReadOnlyRoleContext(c) {+ response := apicontract.Success(apicontract.Null{})+ return &response}+ return nil+})- embedBlockID := arg["embedBlockID"].(string)- stmt := arg["stmt"].(string)- boxID, _ := arg["notebook"].(string)- excludeIDsArg := arg["excludeIDs"].([]any)+var searchEmbedBlock = contractHandler(apicontract.SearchEmbedBlock, func(c *gin.Context, request apicontract.SearchEmbedBlockRequest) apicontract.Response[apicontract.EmbedBlocksData] {+ embedBlockID, headingMode, breadcrumb := request.EmbedBlockID, int(request.HeadingMode), request.Breadcrumb+ stmt, boxID := request.Stmt, request.Notebookvar excludeIDs []string- for _, excludeID := range excludeIDsArg {- if nil == excludeID {- continue+ for _, id := range request.ExcludeIDs {+ if id != nil {+ excludeIDs = append(excludeIDs, *id)}- excludeIDs = append(excludeIDs, excludeID.(string))- }- headingMode := 0 // 0:显示标题与下方的块,1:仅显示标题,2:仅显示标题下方的块- headingModeArg := arg["headingMode"]- if nil != headingModeArg {- headingMode = int(headingModeArg.(float64))- }- breadcrumb := false- breadcrumbArg := arg["breadcrumb"]- if nil != breadcrumbArg {- breadcrumb = breadcrumbArg.(bool)}-isReadOnlyRole := model.IsReadOnlyRoleContext(c)var publishAccess model.PublishAccessif isReadOnlyRole {publishAccess = model.GetPublishAccess()if !model.CheckBlockIdAccessableByPublishAccess(c, publishAccess, embedBlockID) {- ret.Code = -1- ret.Msg = fmt.Sprintf(model.Conf.Language(15), embedBlockID)- return+ return apicontract.Failure[apicontract.EmbedBlocksData](-1, fmt.Sprintf(model.Conf.Language(15), embedBlockID))}var err errorstmt, boxID, err = model.GetQueryEmbedStatement(embedBlockID)if nil != err {- ret.Code = -1- ret.Msg = err.Error()- return+ return apicontract.Failure[apicontract.EmbedBlocksData](-1, err.Error())}}if err := sql.CheckSingleStatement(stmt); nil != err {- ret.Code = -1- ret.Msg = err.Error()- return+ return apicontract.Failure[apicontract.EmbedBlocksData](-1, err.Error())}if err := sql.CheckReadonlyStatementInBox(stmt, boxID); nil != err {- ret.Code = -1- ret.Msg = err.Error()- return+ return apicontract.Failure[apicontract.EmbedBlocksData](-1, err.Error())}var blocks []*model.EmbedBlock@@ -457,56 +271,31 @@ func searchEmbedBlock(c *gin.Context) {} else {blocks = model.SearchEmbedBlockInBox(embedBlockID, stmt, excludeIDs, headingMode, breadcrumb, boxID)}- ret.Data = map[string]any{- "blocks": blocks,- }-}--func searchRefBlock(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return apicontract.Success(apicontract.EmbedBlocksData{Blocks: embedBlockContracts(blocks)})+})- reqId := arg["reqId"]- ret.Data = map[string]any{"reqId": reqId}- if nil == arg["id"] {- return+var searchRefBlock = contractHandler(apicontract.SearchRefBlock, func(c *gin.Context, request apicontract.SearchRefBlockRequest) apicontract.Response[apicontract.SearchRefData] {+ echo := apicontract.SearchRefEcho(request.ReqID)+ if request.ID == nil {+ return apicontract.Success(echo)}-- notebook, _ := arg["notebook"].(string)+ notebook := request.Notebookif isEncryptedNotebookDeniedForPublish(c, notebook) {- ret.Data = map[string]any{- "blocks": []*model.Block{},- "newDoc": false,- "k": util.EscapeHTML(arg["k"].(string)),- "reqId": reqId,+ keyword, err := request.Keyword()+ if err != nil {+ return apicontract.SearchRefBlock.FailureWithData(-1, err.Error(), echo)}- return+ return apicontract.Success(apicontract.SearchRefBlocks(apicontract.SearchRefResult{SearchRefCorrelation: apicontract.SearchRefCorrelation{ReqID: request.ReqID}, Blocks: []*apicontract.SearchBlock{}, K: util.EscapeHTML(keyword)}))}if err := holdEncryptedBoxRequest(c, notebook); err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }-- isSquareBrackets := false- if isSquareBracketsArg := arg["isSquareBrackets"]; nil != isSquareBracketsArg {- isSquareBrackets = isSquareBracketsArg.(bool)+ return apicontract.SearchRefBlock.FailureWithData(-1, err.Error(), echo)}-- isDatabase := false- if isDatabaseArg := arg["isDatabase"]; nil != isDatabaseArg {- isDatabase = isDatabaseArg.(bool)+ params, err := request.Parameters()+ if err != nil {+ return apicontract.SearchRefBlock.FailureWithData(-1, err.Error(), echo)}-- rootID := arg["rootID"].(string)- id := arg["id"].(string)- keyword := arg["k"].(string)- beforeLen := int(arg["beforeLen"].(float64))+ rootID, id, keyword, beforeLen := params.RootID, params.ID, params.K, int(params.BeforeLen)+ isSquareBrackets, isDatabase := params.IsSquareBrackets, params.IsDatabase// 加密笔记本内的块引搜索走 InBox 版(只搜该 box 自己的加密 db,阻止跨加密边界引用)var blocks []*model.Blockvar newDoc bool@@ -519,127 +308,69 @@ func searchRefBlock(c *gin.Context) {publishAccess := model.GetPublishAccess()blocks = model.FilterBlocksByPublishAccess(c, publishAccess, blocks)}- ret.Data = map[string]any{- "blocks": blocks,- "newDoc": newDoc,- "k": util.EscapeHTML(keyword),- "reqId": arg["reqId"],- }-}--func fullTextSearchBlock(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return apicontract.Success(apicontract.SearchRefBlocks(apicontract.SearchRefResult{SearchRefCorrelation: apicontract.SearchRefCorrelation{ReqID: request.ReqID}, Blocks: searchBlockContracts(blocks), NewDoc: newDoc, K: util.EscapeHTML(keyword)}))+})- page, pageSize, query, paths, boxes, types, subTypes, method, orderBy, groupBy := parseSearchBlockArgs(arg)+var fullTextSearchBlock = contractHandler(apicontract.FullTextSearchBlock, func(c *gin.Context, request apicontract.FullTextSearchBlockRequest) apicontract.Response[*apicontract.FullTextSearchBlockData] {+ page, pageSize, query, paths, boxes, types, subTypes, method, orderBy, groupBy := parseSearchBlockRequest(request.SearchBlockRequest)// SQL mode requires admin privileges, consistent with /api/query/sqlif method == 2 && !model.IsAdminRoleContext(c) {- ret.Code = -1- ret.Msg = "SQL search requires administrator privileges"- return+ return apicontract.Failure[*apicontract.FullTextSearchBlockData](-1, "SQL search requires administrator privileges")}// SQL mode is blocked in read-only mode, consistent with /api/query/sqlif method == 2 && util.ReadOnly {- ret.Code = -1- ret.Msg = model.Conf.Language(34)- ret.Data = map[string]any{"closeTimeout": 5000}- return+ return apicontract.FailureWithTimeout[*apicontract.FullTextSearchBlockData](-1, model.Conf.Language(34), 5000)}- notebook, _ := arg["notebook"].(string)+ notebook := request.Notebookif isEncryptedNotebookDeniedForPublish(c, notebook) {- ret.Data = map[string]any{- "blocks": []*model.Block{},- "matchedBlockCount": 0,- "matchedRootCount": 0,- "pageCount": 0,- "docMode": false,- }- return+ return apicontract.Success(&apicontract.FullTextSearchBlockData{SearchBlocksData: apicontract.SearchBlocksData{Blocks: []*apicontract.SearchBlock{}}})}var blocks []*model.Blockvar matchedBlockCount, matchedRootCount, pageCount intvar docMode boolsearchHPath := true- if value, ok := arg["searchHPath"].(bool); ok {- searchHPath = value+ if request.SearchHPath != nil {+ searchHPath = *request.SearchHPath}// 加密笔记本的全文搜索走 InBox 版(查加密 content db + blocks_fts)var excludeBoxIDs, excludeDocIDs []stringif model.IsReadOnlyRoleContext(c) {denyAll, deniedBoxIDs, deniedDocIDs := model.GetPublishAccessSearchExclusion(c)if denyAll {- ret.Data = map[string]any{- "blocks": []*model.Block{},- "matchedBlockCount": 0,- "matchedRootCount": 0,- "pageCount": 0,- "docMode": false,- }- return+ return apicontract.Success(&apicontract.FullTextSearchBlockData{SearchBlocksData: apicontract.SearchBlocksData{Blocks: []*apicontract.SearchBlock{}}})}excludeBoxIDs, excludeDocIDs = deniedBoxIDs, deniedDocIDs}if notebook != "" && model.IsEncryptedBox(notebook) {if err := holdEncryptedBoxRequest(c, notebook); err != nil {- ret.Code = -1- ret.Msg = err.Error()- return+ return apicontract.Failure[*apicontract.FullTextSearchBlockData](-1, err.Error())}blocks, matchedBlockCount, matchedRootCount, pageCount, docMode = model.FullTextSearchBlockInBoxWithHPathContext(c.Request.Context(), query, boxes, paths, types, subTypes, method, orderBy, groupBy, page, pageSize, notebook, searchHPath, excludeBoxIDs, excludeDocIDs)} else {blocks, matchedBlockCount, matchedRootCount, pageCount, docMode = model.FullTextSearchBlockInBoxWithHPathContext(c.Request.Context(), query, boxes, paths, types, subTypes, method, orderBy, groupBy, page, pageSize, "", searchHPath, excludeBoxIDs, excludeDocIDs)}if c.Request.Context().Err() != nil {- return+ return apicontract.Success[*apicontract.FullTextSearchBlockData](nil)}if model.IsReadOnlyRoleContext(c) {publishAccess := model.GetPublishAccess()blocks = model.FilterBlocksByPublishAccess(c, publishAccess, blocks)}- ret.Data = map[string]any{- "blocks": blocks,- "matchedBlockCount": matchedBlockCount,- "matchedRootCount": matchedRootCount,- "pageCount": pageCount,- "docMode": docMode,- }-}--func parseSearchBlockArgs(arg map[string]any) (page, pageSize int, query string, paths, boxes []string, types, subTypes map[string]bool, method, orderBy, groupBy int) {- page = 1- if nil != arg["page"] {- page = int(arg["page"].(float64))- }- if 0 >= page {- page = 1- }-- pageSize = 32- if nil != arg["pageSize"] {- pageSize = int(arg["pageSize"].(float64))- }- if 0 >= pageSize {- pageSize = 32- }-- queryArg := arg["query"]- if nil != queryArg {- query = queryArg.(string)- }+ return apicontract.Success(&apicontract.FullTextSearchBlockData{SearchBlocksData: apicontract.SearchBlocksData{Blocks: searchBlockContracts(blocks), MatchedBlockCount: matchedBlockCount, MatchedRootCount: matchedRootCount, PageCount: pageCount}, DocMode: docMode})+})- pathsArg := arg["paths"]+func parseSearchBlockRequest(request apicontract.SearchBlockRequest) (page, pageSize int, query string, paths, boxes []string, types, subTypes map[string]bool, method, orderBy, groupBy int) {+ page, pageSize = request.Pagination()+ query, types, subTypes = request.Query, request.Types, request.SubTypes.Selected()+ method, orderBy, groupBy = int(request.Method), int(request.OrderBy), int(request.GroupBy)+ pathsArg := request.Pathsif nil != pathsArg {- for _, p := range pathsArg.([]any) {- path := p.(string)+ for _, p := range pathsArg {+ path := pbox := strings.TrimSpace(strings.Split(path, "/")[0])path = strings.TrimSpace(strings.TrimPrefix(path, box))// 入口校验:拒绝带 SQL 元字符的非法笔记本 ID 与文档路径,阻止 SQL 注入。@@ -658,102 +389,17 @@ func parseSearchBlockArgs(arg map[string]any) (page, pageSize int, query string,boxes = gulu.Str.RemoveDuplicatedElem(boxes)}- if nil != arg["types"] {- typesArg := arg["types"].(map[string]any)- types = map[string]bool{}- for t, b := range typesArg {- types[t] = b.(bool)- }- }-- subTypes = parseSearchSubTypes(arg["subTypes"])-- // method:0:关键字,1:查询语法,2:SQL,3:正则表达式- methodArg := arg["method"]- if nil != methodArg {- method = int(methodArg.(float64))- }-- // orderBy:0:按块类型(默认),1:按创建时间升序,2:按创建时间降序,3:按更新时间升序,4:按更新时间降序,5:按内容顺序(仅在按文档分组时),6:按相关度升序,7:按相关度降序- orderByArg := arg["orderBy"]- if nil != orderByArg {- orderBy = int(orderByArg.(float64))- }-- // groupBy: 0:不分组,1:按文档分组- groupByArg := arg["groupBy"]- if nil != groupByArg {- groupBy = int(groupByArg.(float64))- }return}-func parseSearchAssetContentArgs(arg map[string]any) (page, pageSize int, query string, types map[string]bool, method, orderBy int) {- page = 1- if nil != arg["page"] {- page = int(arg["page"].(float64))- }- if 0 >= page {- page = 1- }-- pageSize = 32- if nil != arg["pageSize"] {- pageSize = int(arg["pageSize"].(float64))- }- if 0 >= pageSize {- pageSize = 32- }-- queryArg := arg["query"]- if nil != queryArg {- query = queryArg.(string)- }-- if nil != arg["types"] {- typesArg := arg["types"].(map[string]any)- types = map[string]bool{}- for t, b := range typesArg {- types[t] = b.(bool)- }- }-- // method:0:关键字,1:查询语法,2:SQL,3:正则表达式- methodArg := arg["method"]- if nil != methodArg {- method = int(methodArg.(float64))- }-- // orderBy:0:按相关度降序,1:按相关度升序,2:按更新时间升序,3:按更新时间降序- orderByArg := arg["orderBy"]- if nil != orderByArg {- orderBy = int(orderByArg.(float64))- }- return-}--func semanticSearchBlock(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- page, pageSize, query, paths, boxes, types, subTypes, _, _, _ := parseSearchBlockArgs(arg)+var semanticSearchBlock = contractHandler(apicontract.SemanticSearchBlock, func(c *gin.Context, request apicontract.SearchBlockRequest) apicontract.Response[apicontract.SearchBlocksData] {+ page, pageSize, query, paths, boxes, types, subTypes, _, _, _ := parseSearchBlockRequest(request)var excludeBoxIDs, excludeDocIDs []stringif model.IsReadOnlyRoleContext(c) {denyAll, deniedBoxIDs, deniedDocIDs := model.GetPublishAccessSearchExclusion(c)if denyAll {- ret.Data = map[string]any{- "blocks": []*model.Block{},- "matchedBlockCount": 0,- "matchedRootCount": 0,- "pageCount": 0,- }- return+ return apicontract.Success(apicontract.SearchBlocksData{Blocks: []*apicontract.SearchBlock{}})}excludeBoxIDs, excludeDocIDs = deniedBoxIDs, deniedDocIDs}@@ -763,10 +409,18 @@ func semanticSearchBlock(c *gin.Context) {publishAccess := model.GetPublishAccess()blocks = model.FilterBlocksByPublishAccess(c, publishAccess, blocks)}- ret.Data = map[string]any{- "blocks": blocks,- "matchedBlockCount": matchedBlockCount,- "matchedRootCount": matchedRootCount,- "pageCount": pageCount,+ return apicontract.Success(apicontract.SearchBlocksData{Blocks: searchBlockContracts(blocks), MatchedBlockCount: matchedBlockCount, MatchedRootCount: matchedRootCount, PageCount: pageCount})+})++func embedBlockContracts(values []*model.EmbedBlock) []*apicontract.EmbedBlock {+ if values == nil {+ return nil+ }+ result := make([]*apicontract.EmbedBlock, len(values))+ for i, value := range values {+ if value != nil {+ result[i] = &apicontract.EmbedBlock{Block: searchBlockContracts([]*model.Block{value.Block})[0], BlockPaths: blockPathContracts(value.BlockPaths), AllowChildOperation: value.AllowChildOperation}+ }}+ return result}diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.goindex 11e9594dfd..2f24e854ee 100644--- a/kernel/apicontract/contracts.go+++ b/kernel/apicontract/contracts.go@@ -529,3 +529,19 @@ var RollbackAssetsHistory = define[HistoryPathRequest, Null]("rollbackAssetsHistvar RollbackNotebookHistory = define[HistoryPathRequest, Null]("rollbackNotebookHistory", "/api/history/rollbackNotebookHistory", JSONBody, ResponseOptions{}, "POST")var RollbackAttributeViewHistory = define[HistoryPathRequest, Null]("rollbackAttributeViewHistory", "/api/history/rollbackAttributeViewHistory", JSONBody, ResponseOptions{}, "POST")var DiffDocVersions = define[DiffDocVersionsRequest, *DocVersionDiffResult]("diffDocVersions", "/api/history/diffDocVersions", JSONBody, ResponseOptions{}, "POST")++var SearchAssetByName = define[SearchAssetRequest, []*SearchAsset]("searchAsset", "/api/search/searchAsset", JSONBody, ResponseOptions{}, "POST")+var SearchWidget = define[SearchKeywordRequest, SearchWidgetData]("searchWidget", "/api/search/searchWidget", JSONBody, ResponseOptions{}, "POST")+var SearchTemplate = define[SearchKeywordRequest, SearchTemplateData]("searchTemplate", "/api/search/searchTemplate", JSONBody, ResponseOptions{}, "POST")+var RemoveSearchTemplate = define[SearchPathRequest, Null]("removeTemplate", "/api/search/removeTemplate", JSONBody, ResponseOptions{}, "POST")+var GetAssetContent = define[AssetContentRequest, AssetContentData]("getAssetContent", "/api/search/getAssetContent", JSONBody, ResponseOptions{}, "POST")+var GetAssetContentByPath = define[SearchPathRequest, AssetContentData]("getAssetContentByPath", "/api/search/getAssetContentByPath", JSONBody, ResponseOptions{}, "POST")+var ListInvalidBlockRefs = define[SearchPageRequest, SearchBlocksData]("listInvalidBlockRefs", "/api/search/listInvalidBlockRefs", JSONBody, ResponseOptions{}, "POST")+var UpdateEmbedBlock = define[UpdateEmbedBlockRequest, Null]("updateEmbedBlock", "/api/search/updateEmbedBlock", JSONBody, ResponseOptions{}, "POST")+var FullTextSearchAssetContent = define[SearchAssetContentRequest, SearchAssetContentData]("fullTextSearchAssetContent", "/api/search/fullTextSearchAssetContent", JSONBody, ResponseOptions{}, "POST")+var GetEmbedBlock = define[GetEmbedBlockRequest, EmbedBlocksData]("getEmbedBlock", "/api/search/getEmbedBlock", JSONBody, ResponseOptions{}, "POST")+var SearchEmbedBlock = define[SearchEmbedBlockRequest, EmbedBlocksData]("searchEmbedBlock", "/api/search/searchEmbedBlock", JSONBody, ResponseOptions{}, "POST")+var FindReplace = define[FindReplaceRequest, Null]("findReplace", "/api/search/findReplace", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")+var SemanticSearchBlock = define[SearchBlockRequest, SearchBlocksData]("semanticSearchBlock", "/api/search/semanticSearchBlock", JSONBody, ResponseOptions{}, "POST")+var FullTextSearchBlock = define[FullTextSearchBlockRequest, *FullTextSearchBlockData]("fullTextSearchBlock", "/api/search/fullTextSearchBlock", JSONBody, ResponseOptions{}, "POST")+var SearchRefBlock = define[SearchRefBlockRequest, SearchRefData]("searchRefBlock", "/api/search/searchRefBlock", JSONBody, ResponseOptions{DataOnError: true}, "POST")diff --git a/kernel/apicontract/legacy_routes.json b/kernel/apicontract/legacy_routes.jsonindex d616fa7cea..849c2ece4b 100644--- a/kernel/apicontract/legacy_routes.json+++ b/kernel/apicontract/legacy_routes.json@@ -269,21 +269,6 @@{"method":"POST","path":"/api/riff/resetRiffCards","handler":"resetRiffCards"},{"method":"POST","path":"/api/riff/reviewRiffCard","handler":"reviewRiffCard"},{"method":"POST","path":"/api/riff/skipReviewRiffCard","handler":"skipReviewRiffCard"},- {"method":"POST","path":"/api/search/findReplace","handler":"findReplace"},- {"method":"POST","path":"/api/search/fullTextSearchAssetContent","handler":"fullTextSearchAssetContent"},- {"method":"POST","path":"/api/search/fullTextSearchBlock","handler":"fullTextSearchBlock"},- {"method":"POST","path":"/api/search/getAssetContent","handler":"getAssetContent"},- {"method":"POST","path":"/api/search/getAssetContentByPath","handler":"getAssetContentByPath"},- {"method":"POST","path":"/api/search/getEmbedBlock","handler":"getEmbedBlock"},- {"method":"POST","path":"/api/search/listInvalidBlockRefs","handler":"listInvalidBlockRefs"},- {"method":"POST","path":"/api/search/removeTemplate","handler":"removeTemplate"},- {"method":"POST","path":"/api/search/searchAsset","handler":"searchAsset"},- {"method":"POST","path":"/api/search/searchEmbedBlock","handler":"searchEmbedBlock"},- {"method":"POST","path":"/api/search/searchRefBlock","handler":"searchRefBlock"},- {"method":"POST","path":"/api/search/searchTemplate","handler":"searchTemplate"},- {"method":"POST","path":"/api/search/searchWidget","handler":"searchWidget"},- {"method":"POST","path":"/api/search/semanticSearchBlock","handler":"semanticSearchBlock"},- {"method":"POST","path":"/api/search/updateEmbedBlock","handler":"updateEmbedBlock"},{"method":"POST","path":"/api/setting/getBootAppearances","handler":"getBootAppearances"},{"method":"POST","path":"/api/setting/getCloudUser","handler":"getCloudUser"},{"method":"POST","path":"/api/setting/getPublish","handler":"getPublish"},diff --git a/kernel/apicontract/schema.go b/kernel/apicontract/schema.goindex cefbd6de77..3ef38208f9 100644--- a/kernel/apicontract/schema.go+++ b/kernel/apicontract/schema.go@@ -108,6 +108,17 @@ func (b *schemaBuilder) schema(t reflect.Type, input bool) (*Schema, error) {}return &Schema{AnyOf: []*Schema{list, definitions, {Type: "null"}}}, nil}+ if t == reflect.TypeFor[SearchRefData]() {+ result, err := b.schema(reflect.TypeFor[SearchRefResult](), false)+ if err != nil {+ return nil, err+ }+ correlation, err := b.schema(reflect.TypeFor[SearchRefCorrelation](), false)+ if err != nil {+ return nil, err+ }+ return &Schema{AnyOf: []*Schema{result, correlation}}, nil+ }if t == reflect.TypeFor[GlobalGraphData]() || t == reflect.TypeFor[LocalGraphData]() {resultType := reflect.TypeFor[GlobalGraphResult]()if t == reflect.TypeFor[LocalGraphData]() {diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex 9a06fa2517..9813bb1f7a 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -114,6 +114,85 @@],"additionalProperties": false},+ "AssetContent": {+ "type": "object",+ "properties": {+ "content": {+ "type": "string"+ },+ "ext": {+ "type": "string"+ },+ "hSize": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "size": {+ "type": "integer"+ },+ "updated": {+ "type": "integer"+ }+ },+ "required": [+ "content",+ "ext",+ "hSize",+ "id",+ "name",+ "path",+ "size",+ "updated"+ ],+ "additionalProperties": false+ },+ "AssetContentData": {+ "type": "object",+ "properties": {+ "assetContent": {+ "anyOf": [+ {+ "$ref": "#/$defs/AssetContent"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "assetContent"+ ],+ "additionalProperties": false+ },+ "AssetContentRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "query": {+ "type": "string"+ },+ "queryMethod": {+ "type": "number"+ }+ },+ "required": [+ "id",+ "query",+ "queryMethod"+ ],+ "additionalProperties": false+ },"AttributeViewColorTheme": {"type": "object","properties": {@@ -4208,6 +4287,79 @@],"additionalProperties": false},+ "EmbedBlock": {+ "type": "object",+ "properties": {+ "allowChildOperation": {+ "type": "boolean"+ },+ "block": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ },+ "blockPaths": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockPath"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "allowChildOperation",+ "block",+ "blockPaths"+ ],+ "additionalProperties": false+ },+ "EmbedBlocksData": {+ "type": "object",+ "properties": {+ "blocks": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/EmbedBlock"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "blocks"+ ],+ "additionalProperties": false+ },"EmbedStat": {"type": "object","properties": {@@ -4387,92 +4539,49 @@],"additionalProperties": false},- "FullBlockInfo": {- "type": "object",- "properties": {- "box": {- "type": "string"- },- "path": {- "type": "string"- },- "rootChildID": {- "type": "string"- },- "rootID": {- "type": "string"- },- "rootIcon": {- "type": "string"- },- "rootTitle": {- "type": "string"- },- "rootTitleEmpty": {- "type": "boolean"- }- },- "required": [- "box",- "path",- "rootChildID",- "rootID",- "rootIcon",- "rootTitle",- "rootTitleEmpty"- ],- "additionalProperties": false- },- "GetSnippetRequestInput": {+ "FindReplaceRequestInput": {"type": "object","properties": {- "enabled": {- "type": "number"- },- "keyword": {+ "groupBy": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"}]},- "type": {+ "ids": {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ "k": {"type": "string"- }- },- "required": [- "enabled",- "type"- ],- "additionalProperties": false- },- "GetTagRequestInput": {- "type": "object",- "properties": {- "app": {+ },+ "method": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"}]},- "ignoreMaxListHint": {+ "orderBy": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "sort": {+ "page": {"anyOf": [{"type": "number"@@ -4481,55 +4590,31 @@"type": "null"}]- }- },- "additionalProperties": false- },- "GlobalGraphConf": {- "type": "object",- "properties": {- "d3": {+ },+ "pageSize": {"anyOf": [{- "$ref": "#/$defs/GraphD3"+ "type": "number"},{"type": "null"}]},- "dailyNote": {- "type": "boolean"- },- "minRefs": {- "type": "integer"- },- "type": {+ "paths": {"anyOf": [{- "$ref": "#/$defs/GraphTypeFilter"+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]- }- },- "required": [- "d3",- "dailyNote",- "minRefs",- "type"- ],- "additionalProperties": false- },- "GlobalGraphRequestInput": {- "type": "object",- "properties": {- "conf": {- "$ref": "#/$defs/GraphConfigurationFieldsInput"},- "k": {+ "query": {"anyOf": [{"type": "string"@@ -4539,227 +4624,178 @@}]},- "reqId": {+ "r": {+ "type": "string"+ },+ "replaceTypes": {"anyOf": [{- "$ref": "#/$defs/JSONValue"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"}]- }- },- "required": [- "conf"- ],- "additionalProperties": false- },- "GlobalGraphResult": {- "type": "object",- "properties": {- "box": {- "type": "string"- },- "conf": {- "$ref": "#/$defs/GlobalGraphConf"},- "links": {+ "subTypes": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/GraphLink"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/SearchSubtypeFilterInput"},{"type": "null"}]},- "nodes": {+ "types": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/GraphNode"- },- {- "type": "null"- }- ]+ "type": "object",+ "additionalProperties": {+ "type": "boolean"}},{"type": "null"}]+ }+ },+ "required": [+ "ids",+ "k",+ "r"+ ],+ "additionalProperties": false+ },+ "FullBlockInfo": {+ "type": "object",+ "properties": {+ "box": {+ "type": "string"},- "reqId": {- "$ref": "#/$defs/JSONValue"+ "path": {+ "type": "string"+ },+ "rootChildID": {+ "type": "string"+ },+ "rootID": {+ "type": "string"+ },+ "rootIcon": {+ "type": "string"+ },+ "rootTitle": {+ "type": "string"+ },+ "rootTitleEmpty": {+ "type": "boolean"}},"required": ["box",- "conf",- "links",- "nodes",- "reqId"+ "path",+ "rootChildID",+ "rootID",+ "rootIcon",+ "rootTitle",+ "rootTitleEmpty"],"additionalProperties": false},- "GraphArrows": {+ "FullTextSearchBlockData": {"type": "object","properties": {- "to": {+ "blocks": {"anyOf": [{- "$ref": "#/$defs/GraphArrowsTo"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]- }- },- "required": [- "to"- ],- "additionalProperties": false- },- "GraphArrowsTo": {- "type": "object",- "properties": {- "enabled": {+ },+ "docMode": {"type": "boolean"+ },+ "matchedBlockCount": {+ "type": "integer"+ },+ "matchedRootCount": {+ "type": "integer"+ },+ "pageCount": {+ "type": "integer"}},"required": [- "enabled"+ "blocks",+ "docMode",+ "matchedBlockCount",+ "matchedRootCount",+ "pageCount"],"additionalProperties": false},- "GraphConfigurationFieldsInput": {+ "FullTextSearchBlockRequestInput": {"type": "object","properties": {- "d3": {- "anyOf": [- {- "$ref": "#/$defs/GraphD3Input"- },- {- "type": "null"- }- ]- },- "dailyNote": {+ "groupBy": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "minRefs": {+ "method": {"anyOf": [{- "type": "integer"+ "type": "number"},{"type": "null"}]},- "type": {+ "notebook": {"anyOf": [{- "$ref": "#/$defs/GraphTypeFilterInput"+ "type": "string"},{"type": "null"}]- }- },- "additionalProperties": false- },- "GraphCorrelation": {- "type": "object",- "properties": {- "reqId": {- "$ref": "#/$defs/JSONValue"- }- },- "required": [- "reqId"- ],- "additionalProperties": false- },- "GraphD3": {- "type": "object",- "properties": {- "arrow": {- "type": "boolean"- },- "centerStrength": {- "type": "number"- },- "collideRadius": {- "type": "number"- },- "collideStrength": {- "type": "number"- },- "lineOpacity": {- "type": "number"- },- "linkDistance": {- "type": "integer"- },- "linkWidth": {- "type": "number"},- "nodeSize": {- "type": "number"- }- },- "required": [- "arrow",- "centerStrength",- "collideRadius",- "collideStrength",- "lineOpacity",- "linkDistance",- "linkWidth",- "nodeSize"- ],- "additionalProperties": false- },- "GraphD3Input": {- "type": "object",- "properties": {- "arrow": {+ "orderBy": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "centerStrength": {+ "page": {"anyOf": [{"type": "number"@@ -4769,7 +4805,7 @@}]},- "collideRadius": {+ "pageSize": {"anyOf": [{"type": "number"@@ -4779,50 +4815,56 @@}]},- "collideStrength": {+ "paths": {"anyOf": [{- "type": "number"+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]},- "lineOpacity": {+ "query": {"anyOf": [{- "type": "number"+ "type": "string"},{"type": "null"}]},- "linkDistance": {+ "searchHPath": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]},- "linkWidth": {+ "subTypes": {"anyOf": [{- "type": "number"+ "$ref": "#/$defs/SearchSubtypeFilterInput"},{"type": "null"}]},- "nodeSize": {+ "types": {"anyOf": [{- "type": "number"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"@@ -4832,146 +4874,95 @@},"additionalProperties": false},- "GraphLink": {+ "GetEmbedBlockRequestInput": {"type": "object","properties": {- "arrows": {+ "breadcrumb": {"anyOf": [{- "$ref": "#/$defs/GraphArrows"+ "type": "boolean"},{"type": "null"}]},- "from": {+ "embedBlockID": {"type": "string"},- "ref": {- "type": "boolean"+ "headingMode": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]},- "to": {- "type": "string"- }- },- "required": [- "arrows",- "from",- "ref",- "to"- ],- "additionalProperties": false- },- "GraphNode": {- "type": "object",- "properties": {- "box": {- "type": "string"- },- "defs": {- "type": "integer"- },- "id": {- "type": "string"- },- "label": {- "type": "string"- },- "path": {- "type": "string"- },- "refs": {- "type": "integer"- },- "size": {- "type": "number"- },- "title": {- "type": "string"+ "includeIDs": {+ "type": "array",+ "items": {+ "type": "string"+ }},- "type": {- "type": "string"+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]}},"required": [- "box",- "defs",- "id",- "label",- "path",- "refs",- "size",- "type"+ "embedBlockID",+ "includeIDs"],"additionalProperties": false},- "GraphTypeFilter": {+ "GetSnippetRequestInput": {"type": "object","properties": {- "blockquote": {- "type": "boolean"- },- "callout": {- "type": "boolean"- },- "code": {- "type": "boolean"- },- "heading": {- "type": "boolean"- },- "list": {- "type": "boolean"- },- "listItem": {- "type": "boolean"- },- "math": {- "type": "boolean"- },- "paragraph": {- "type": "boolean"- },- "super": {- "type": "boolean"+ "enabled": {+ "type": "number"},- "table": {- "type": "boolean"+ "keyword": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "tag": {- "type": "boolean"+ "type": {+ "type": "string"}},"required": [- "blockquote",- "callout",- "code",- "heading",- "list",- "listItem",- "math",- "paragraph",- "super",- "table",- "tag"+ "enabled",+ "type"],"additionalProperties": false},- "GraphTypeFilterInput": {+ "GetTagRequestInput": {"type": "object","properties": {- "blockquote": {+ "app": {"anyOf": [{- "type": "boolean"+ "type": "string"},{"type": "null"}]},- "callout": {+ "ignoreMaxListHint": {"anyOf": [{"type": "boolean"@@ -4981,90 +4972,158 @@}]},- "code": {+ "sort": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]- },- "heading": {+ }+ },+ "additionalProperties": false+ },+ "GlobalGraphConf": {+ "type": "object",+ "properties": {+ "d3": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/GraphD3"},{"type": "null"}]},- "list": {- "anyOf": [- {- "type": "boolean"- },- {- "type": "null"- }- ]+ "dailyNote": {+ "type": "boolean"},- "listItem": {+ "minRefs": {+ "type": "integer"+ },+ "type": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/GraphTypeFilter"},{"type": "null"}]+ }+ },+ "required": [+ "d3",+ "dailyNote",+ "minRefs",+ "type"+ ],+ "additionalProperties": false+ },+ "GlobalGraphRequestInput": {+ "type": "object",+ "properties": {+ "conf": {+ "$ref": "#/$defs/GraphConfigurationFieldsInput"},- "math": {+ "k": {"anyOf": [{- "type": "boolean"+ "type": "string"},{"type": "null"}]},- "paragraph": {+ "reqId": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/JSONValue"},{"type": "null"}]+ }+ },+ "required": [+ "conf"+ ],+ "additionalProperties": false+ },+ "GlobalGraphResult": {+ "type": "object",+ "properties": {+ "box": {+ "type": "string"},- "super": {+ "conf": {+ "$ref": "#/$defs/GlobalGraphConf"+ },+ "links": {"anyOf": [{- "type": "boolean"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/GraphLink"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]},- "table": {+ "nodes": {"anyOf": [{- "type": "boolean"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/GraphNode"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]},- "tag": {+ "reqId": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ "required": [+ "box",+ "conf",+ "links",+ "nodes",+ "reqId"+ ],+ "additionalProperties": false+ },+ "GraphArrows": {+ "type": "object",+ "properties": {+ "to": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/GraphArrowsTo"},{"type": "null"@@ -5072,77 +5131,125 @@]}},+ "required": [+ "to"+ ],"additionalProperties": false},- "HTMLClipboardPreflight": {+ "GraphArrowsTo": {"type": "object","properties": {- "converted": {- "type": "boolean"- },- "dom": {- "type": "string"- },- "normalizedHTML": {- "type": "string"- },- "useHTML": {+ "enabled": {"type": "boolean"}},"required": [- "converted",- "useHTML"+ "enabled"],"additionalProperties": false},- "HTMLClipboardRequestInput": {+ "GraphConfigurationFieldsInput": {"type": "object","properties": {- "dom": {- "type": "string"- },- "mathML": {+ "d3": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/GraphD3Input"},{"type": "null"}]},- "notebook": {+ "dailyNote": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "office": {+ "minRefs": {"anyOf": [{- "type": "string"+ "type": "integer"},{"type": "null"}]},- "officeMathHTML": {+ "type": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/GraphTypeFilterInput"},{"type": "null"}]+ }+ },+ "additionalProperties": false+ },+ "GraphCorrelation": {+ "type": "object",+ "properties": {+ "reqId": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ "required": [+ "reqId"+ ],+ "additionalProperties": false+ },+ "GraphD3": {+ "type": "object",+ "properties": {+ "arrow": {+ "type": "boolean"},- "preflight": {+ "centerStrength": {+ "type": "number"+ },+ "collideRadius": {+ "type": "number"+ },+ "collideStrength": {+ "type": "number"+ },+ "lineOpacity": {+ "type": "number"+ },+ "linkDistance": {+ "type": "integer"+ },+ "linkWidth": {+ "type": "number"+ },+ "nodeSize": {+ "type": "number"+ }+ },+ "required": [+ "arrow",+ "centerStrength",+ "collideRadius",+ "collideStrength",+ "lineOpacity",+ "linkDistance",+ "linkWidth",+ "nodeSize"+ ],+ "additionalProperties": false+ },+ "GraphD3Input": {+ "type": "object",+ "properties": {+ "arrow": {"anyOf": [{"type": "boolean"@@ -5152,70 +5259,70 @@}]},- "preparedHTML": {+ "centerStrength": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "preserveSourceFormat": {+ "collideRadius": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "skipBase64Assets": {+ "collideStrength": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "skipInlineSVGAssets": {+ "lineOpacity": {"anyOf": [{- "type": "boolean"+ "type": "number"},{"type": "null"}]},- "skipLocalAssets": {+ "linkDistance": {"anyOf": [{- "type": "boolean"+ "type": "integer"},{"type": "null"}]},- "text": {+ "linkWidth": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"}]},- "wps": {+ "nodeSize": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"@@ -5223,238 +5330,241 @@]}},- "required": [- "dom"- ],- "additionalProperties": false- },- "HTMLData": {- "type": "object",- "properties": {- "html": {- "type": "string"- }- },- "required": [- "html"- ],"additionalProperties": false},- "HeadingChildrenRequestInput": {+ "GraphLink": {"type": "object","properties": {- "id": {- "type": "string"- },- "removeFoldAttr": {+ "arrows": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/GraphArrows"},{"type": "null"}]+ },+ "from": {+ "type": "string"+ },+ "ref": {+ "type": "boolean"+ },+ "to": {+ "type": "string"}},"required": [- "id"+ "arrows",+ "from",+ "ref",+ "to"],"additionalProperties": false},- "HeadingFoldRequestInput": {+ "GraphNode": {"type": "object","properties": {+ "box": {+ "type": "string"+ },+ "defs": {+ "type": "integer"+ },"id": {"type": "string"},- "scope": {+ "label": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "refs": {+ "type": "integer"+ },+ "size": {+ "type": "number"+ },+ "title": {+ "type": "string"+ },+ "type": {"type": "string"}},"required": [+ "box",+ "defs","id",- "scope"+ "label",+ "path",+ "refs",+ "size",+ "type"],"additionalProperties": false},- "HeadingLevelRequestInput": {+ "GraphTypeFilter": {"type": "object","properties": {- "id": {- "type": "string"+ "blockquote": {+ "type": "boolean"},- "ids": {- "type": "array",- "items": {- "type": "string"- }+ "callout": {+ "type": "boolean"},- "level": {- "type": "number"+ "code": {+ "type": "boolean"+ },+ "heading": {+ "type": "boolean"+ },+ "list": {+ "type": "boolean"+ },+ "listItem": {+ "type": "boolean"+ },+ "math": {+ "type": "boolean"+ },+ "paragraph": {+ "type": "boolean"+ },+ "super": {+ "type": "boolean"+ },+ "table": {+ "type": "boolean"+ },+ "tag": {+ "type": "boolean"}},"required": [- "level"+ "blockquote",+ "callout",+ "code",+ "heading",+ "list",+ "listItem",+ "math",+ "paragraph",+ "super",+ "table",+ "tag"],"additionalProperties": false},- "HeadingNumbersRequestInput": {+ "GraphTypeFilterInput": {"type": "object","properties": {- "id": {+ "blockquote": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "notebook": {+ "callout": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "additionalProperties": false- },- "History": {- "type": "object",- "properties": {- "hCreated": {- "type": "string"},- "items": {+ "code": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/HistoryItem"- },- {- "type": "null"- }- ]- }+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "hCreated",- "items"- ],- "additionalProperties": false- },- "HistoryItem": {- "type": "object",- "properties": {- "id": {- "type": "string"},- "notebook": {- "type": "string"+ "heading": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "op": {- "type": "string"+ "list": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "path": {- "type": "string"+ "listItem": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "title": {- "type": "string"- }- },- "required": [- "id",- "notebook",- "op",- "path",- "title"- ],- "additionalProperties": false- },- "HistoryItemsData": {- "type": "object",- "properties": {- "items": {+ "math": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/HistoryItem"- },- {- "type": "null"- }- ]- }+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "items"- ],- "additionalProperties": false- },- "HistoryItemsRequestInput": {- "type": "object",- "properties": {- "created": {- "type": "string"},- "notebook": {+ "paragraph": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "op": {+ "super": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "query": {+ "table": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "type": {+ "tag": {"anyOf": [{- "type": "number"+ "type": "boolean"},{"type": "null"@@ -5462,138 +5572,87 @@]}},- "required": [- "created"- ],"additionalProperties": false},- "HistoryPathRequestInput": {+ "HTMLClipboardPreflight": {"type": "object","properties": {- "historyPath": {+ "converted": {+ "type": "boolean"+ },+ "dom": {+ "type": "string"+ },+ "normalizedHTML": {"type": "string"+ },+ "useHTML": {+ "type": "boolean"}},"required": [- "historyPath"+ "converted",+ "useHTML"],"additionalProperties": false},- "ImportAutoDocument": {+ "HTMLClipboardRequestInput": {"type": "object","properties": {- "token": {+ "dom": {"type": "string"},- "type": {- "type": "string",- "enum": [- "document"+ "mathML": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }]- }- },- "required": [- "type"- ],- "additionalProperties": false- },- "ImportAutoNotebook": {- "type": "object",- "properties": {+ },"notebook": {"anyOf": [{- "$ref": "#/$defs/Notebook"+ "type": "string"},{"type": "null"}]},- "type": {- "type": "string",- "enum": [- "notebook"- ]- }- },- "required": [- "notebook",- "type"- ],- "additionalProperties": false- },- "ImportAutoNotebooks": {- "type": "object",- "properties": {- "notebooks": {+ "office": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Notebook"- },- {- "type": "null"- }- ]- }+ "type": "string"},{"type": "null"}]},- "type": {- "type": "string",- "enum": [- "notebooks"- ]- }- },- "required": [- "notebooks",- "type"- ],- "additionalProperties": false- },- "ImportDataRequestInput": {- "type": "object",- "properties": {- "file": {- "type": "string",- "format": "binary"- }- },- "additionalProperties": false- },- "ImportDocumentData": {- "type": "object",- "properties": {- "type": {- "type": "string",- "enum": [- "document"+ "officeMathHTML": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }]- }- },- "required": [- "type"- ],- "additionalProperties": false- },- "ImportMarkdownRequestInput": {- "type": "object",- "properties": {- "localPath": {- "type": "string"},- "notebook": {- "type": "string"+ "preflight": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "skipRoot": {+ "preparedHTML": {"anyOf": [{"type": "boolean"@@ -5603,87 +5662,160 @@}]},- "toPath": {- "type": "string"+ "preserveSourceFormat": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "skipBase64Assets": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "skipInlineSVGAssets": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "skipLocalAssets": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "text": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "wps": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]}},"required": [- "localPath",- "notebook",- "toPath"+ "dom"],"additionalProperties": false},- "ImportNotebookCryptoBackupRequestInput": {+ "HTMLData": {"type": "object","properties": {- "file": {- "type": "string",- "format": "binary"- },- "password": {+ "html": {"type": "string"}},"required": [- "file"+ "html"],"additionalProperties": false},- "ImportSYRequestInput": {+ "HeadingChildrenRequestInput": {"type": "object","properties": {- "file": {- "type": "string",- "format": "binary"- },- "notebook": {+ "id": {"type": "string"},- "toPath": {- "type": "string"+ "removeFoldAttr": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]}},+ "required": [+ "id"+ ],"additionalProperties": false},- "ImportTokenRequestInput": {+ "HeadingFoldRequestInput": {"type": "object","properties": {- "token": {+ "id": {+ "type": "string"+ },+ "scope": {"type": "string"}},"required": [- "token"+ "id",+ "scope"],"additionalProperties": false},- "ImportZipMarkdownRequestInput": {+ "HeadingLevelRequestInput": {"type": "object","properties": {- "file": {- "type": "string",- "format": "binary"- },- "notebook": {+ "id": {"type": "string"},- "skipRoot": {- "type": "string"+ "ids": {+ "type": "array",+ "items": {+ "type": "string"+ }},- "toPath": {- "type": "string"+ "level": {+ "type": "number"}},+ "required": [+ "level"+ ],"additionalProperties": false},- "ImportedNotebook": {+ "HeadingNumbersRequestInput": {"type": "object","properties": {+ "id": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },"notebook": {"anyOf": [{- "$ref": "#/$defs/Notebook"+ "type": "string"},{"type": "null"@@ -5691,22 +5823,22 @@]}},- "required": [- "notebook"- ],"additionalProperties": false},- "ImportedNotebooks": {+ "History": {"type": "object","properties": {- "notebooks": {+ "hCreated": {+ "type": "string"+ },+ "items": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/Notebook"+ "$ref": "#/$defs/HistoryItem"},{"type": "null"@@ -5721,62 +5853,50 @@}},"required": [- "notebooks"+ "hCreated",+ "items"],"additionalProperties": false},- "InlineStyle": {+ "HistoryItem": {"type": "object","properties": {- "dark": {- "anyOf": [- {- "$ref": "#/$defs/InlineStyleTheme"- },- {- "type": "null"- }- ]+ "id": {+ "type": "string"},- "hidden": {- "type": "boolean"+ "notebook": {+ "type": "string"},- "id": {+ "op": {"type": "string"},- "light": {- "anyOf": [- {- "$ref": "#/$defs/InlineStyleTheme"- },- {- "type": "null"- }- ]+ "path": {+ "type": "string"},- "name": {+ "title": {"type": "string"}},"required": [- "dark","id",- "light",- "name"+ "notebook",+ "op",+ "path",+ "title"],"additionalProperties": false},- "InlineStyleAV": {+ "HistoryItemsData": {"type": "object","properties": {- "colors": {+ "items": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/AttributeViewCustomColor"+ "$ref": "#/$defs/HistoryItem"},{"type": "null"@@ -5788,107 +5908,132 @@"type": "null"}]- },- "order": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"- }- },- {- "type": "null"- }- ]}},"required": [- "colors",- "order"+ "items"],"additionalProperties": false},- "InlineStyleAVInput": {+ "HistoryItemsRequestInput": {"type": "object","properties": {- "colors": {+ "created": {+ "type": "string"+ },+ "notebook": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/AttributeViewCustomColorInput"- },- {- "type": "null"- }- ]- }+ "type": "string"},{"type": "null"}]},- "order": {+ "op": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "type": "string"},{"type": "null"}]- }- },- "additionalProperties": false- },- "InlineStyleBuiltin": {- "type": "object",- "properties": {- "colors": {+ },+ "query": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/InlineStyleBuiltinColor"- },- {- "type": "null"- }- ]- }+ "type": "string"},{"type": "null"}]},- "hidden": {+ "type": {"anyOf": [{- "$ref": "#/$defs/InlineStyleBuiltinHidden"+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "created"+ ],+ "additionalProperties": false+ },+ "HistoryPathRequestInput": {+ "type": "object",+ "properties": {+ "historyPath": {+ "type": "string"+ }+ },+ "required": [+ "historyPath"+ ],+ "additionalProperties": false+ },+ "ImportAutoDocument": {+ "type": "object",+ "properties": {+ "token": {+ "type": "string"+ },+ "type": {+ "type": "string",+ "enum": [+ "document"+ ]+ }+ },+ "required": [+ "type"+ ],+ "additionalProperties": false+ },+ "ImportAutoNotebook": {+ "type": "object",+ "properties": {+ "notebook": {+ "anyOf": [+ {+ "$ref": "#/$defs/Notebook"},{"type": "null"}]},- "styles": {+ "type": {+ "type": "string",+ "enum": [+ "notebook"+ ]+ }+ },+ "required": [+ "notebook",+ "type"+ ],+ "additionalProperties": false+ },+ "ImportAutoNotebooks": {+ "type": "object",+ "properties": {+ "notebooks": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/InlineStyleBuiltinStyle"+ "$ref": "#/$defs/Notebook"},{"type": "null"@@ -5900,35 +6045,145 @@"type": "null"}]+ },+ "type": {+ "type": "string",+ "enum": [+ "notebooks"+ ]}},"required": [- "colors",- "hidden",- "styles"+ "notebooks",+ "type"],"additionalProperties": false},- "InlineStyleBuiltinColor": {+ "ImportDataRequestInput": {"type": "object","properties": {- "dark": {+ "file": {+ "type": "string",+ "format": "binary"+ }+ },+ "additionalProperties": false+ },+ "ImportDocumentData": {+ "type": "object",+ "properties": {+ "type": {+ "type": "string",+ "enum": [+ "document"+ ]+ }+ },+ "required": [+ "type"+ ],+ "additionalProperties": false+ },+ "ImportMarkdownRequestInput": {+ "type": "object",+ "properties": {+ "localPath": {+ "type": "string"+ },+ "notebook": {+ "type": "string"+ },+ "skipRoot": {"anyOf": [{- "$ref": "#/$defs/InlineStyleTheme"+ "type": "boolean"},{"type": "null"}]},- "index": {- "type": "integer"+ "toPath": {+ "type": "string"+ }+ },+ "required": [+ "localPath",+ "notebook",+ "toPath"+ ],+ "additionalProperties": false+ },+ "ImportNotebookCryptoBackupRequestInput": {+ "type": "object",+ "properties": {+ "file": {+ "type": "string",+ "format": "binary"},- "light": {+ "password": {+ "type": "string"+ }+ },+ "required": [+ "file"+ ],+ "additionalProperties": false+ },+ "ImportSYRequestInput": {+ "type": "object",+ "properties": {+ "file": {+ "type": "string",+ "format": "binary"+ },+ "notebook": {+ "type": "string"+ },+ "toPath": {+ "type": "string"+ }+ },+ "additionalProperties": false+ },+ "ImportTokenRequestInput": {+ "type": "object",+ "properties": {+ "token": {+ "type": "string"+ }+ },+ "required": [+ "token"+ ],+ "additionalProperties": false+ },+ "ImportZipMarkdownRequestInput": {+ "type": "object",+ "properties": {+ "file": {+ "type": "string",+ "format": "binary"+ },+ "notebook": {+ "type": "string"+ },+ "skipRoot": {+ "type": "string"+ },+ "toPath": {+ "type": "string"+ }+ },+ "additionalProperties": false+ },+ "ImportedNotebook": {+ "type": "object",+ "properties": {+ "notebook": {"anyOf": [{- "$ref": "#/$defs/InlineStyleTheme"+ "$ref": "#/$defs/Notebook"},{"type": "null"@@ -5937,45 +6192,290 @@}},"required": [- "dark",- "index",- "light"+ "notebook"],"additionalProperties": false},- "InlineStyleBuiltinColorInput": {+ "ImportedNotebooks": {"type": "object","properties": {- "dark": {+ "notebooks": {"anyOf": [{- "$ref": "#/$defs/InlineStyleThemeInput"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Notebook"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]- },- "index": {+ }+ },+ "required": [+ "notebooks"+ ],+ "additionalProperties": false+ },+ "InlineStyle": {+ "type": "object",+ "properties": {+ "dark": {"anyOf": [{- "type": "integer"+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]},+ "hidden": {+ "type": "boolean"+ },+ "id": {+ "type": "string"+ },"light": {"anyOf": [{- "$ref": "#/$defs/InlineStyleThemeInput"+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]- }+ },+ "name": {+ "type": "string"+ }+ },+ "required": [+ "dark",+ "id",+ "light",+ "name"+ ],+ "additionalProperties": false+ },+ "InlineStyleAV": {+ "type": "object",+ "properties": {+ "colors": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/AttributeViewCustomColor"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "order": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "colors",+ "order"+ ],+ "additionalProperties": false+ },+ "InlineStyleAVInput": {+ "type": "object",+ "properties": {+ "colors": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/AttributeViewCustomColorInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "order": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "InlineStyleBuiltin": {+ "type": "object",+ "properties": {+ "colors": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinColor"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "hidden": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinHidden"+ },+ {+ "type": "null"+ }+ ]+ },+ "styles": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinStyle"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "colors",+ "hidden",+ "styles"+ ],+ "additionalProperties": false+ },+ "InlineStyleBuiltinColor": {+ "type": "object",+ "properties": {+ "dark": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleTheme"+ },+ {+ "type": "null"+ }+ ]+ },+ "index": {+ "type": "integer"+ },+ "light": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleTheme"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "dark",+ "index",+ "light"+ ],+ "additionalProperties": false+ },+ "InlineStyleBuiltinColorInput": {+ "type": "object",+ "properties": {+ "dark": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleThemeInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "index": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "light": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleThemeInput"+ },+ {+ "type": "null"+ }+ ]+ }},"additionalProperties": false},@@ -8842,23 +9342,37 @@],"additionalProperties": false},- "SearchBlock": {+ "SearchAsset": {"type": "object","properties": {- "alias": {+ "hName": {"type": "string"},- "box": {+ "path": {"type": "string"},- "children": {+ "updated": {+ "type": "integer"+ }+ },+ "required": [+ "hName",+ "path",+ "updated"+ ],+ "additionalProperties": false+ },+ "SearchAssetContentData": {+ "type": "object",+ "properties": {+ "assetContents": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/SearchBlock"+ "$ref": "#/$defs/AssetContent"},{"type": "null"@@ -8871,22 +9385,159 @@}]},- "content": {- "type": "string"- },- "count": {+ "matchedAssetCount": {"type": "integer"},- "created": {- "type": "string"- },- "defID": {- "type": "string"- },- "defPath": {- "type": "string"- },- "depth": {+ "pageCount": {+ "type": "integer"+ }+ },+ "required": [+ "assetContents",+ "matchedAssetCount",+ "pageCount"+ ],+ "additionalProperties": false+ },+ "SearchAssetContentRequestInput": {+ "type": "object",+ "properties": {+ "method": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "orderBy": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "page": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "pageSize": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "query": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "types": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "SearchAssetRequestInput": {+ "type": "object",+ "properties": {+ "exts": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "k": {+ "type": "string"+ }+ },+ "required": [+ "k"+ ],+ "additionalProperties": false+ },+ "SearchBlock": {+ "type": "object",+ "properties": {+ "alias": {+ "type": "string"+ },+ "box": {+ "type": "string"+ },+ "children": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "content": {+ "type": "string"+ },+ "count": {+ "type": "integer"+ },+ "created": {+ "type": "string"+ },+ "defID": {+ "type": "string"+ },+ "defPath": {+ "type": "string"+ },+ "depth": {"type": "integer"},"fcontent": {@@ -9052,53 +9703,33 @@],"additionalProperties": false},- "SearchHistoryData": {+ "SearchBlockRequestInput": {"type": "object","properties": {- "histories": {+ "groupBy": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "type": "number"},{"type": "null"}]},- "pageCount": {- "type": "integer"- },- "totalCount": {- "type": "integer"- }- },- "required": [- "histories",- "pageCount",- "totalCount"- ],- "additionalProperties": false- },- "SearchHistoryRequestInput": {- "type": "object",- "properties": {- "notebook": {+ "method": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"}]},- "op": {+ "orderBy": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"@@ -9115,6 +9746,29 @@}]},+ "pageSize": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "paths": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },"query": {"anyOf": [{@@ -9125,10 +9779,23 @@}]},- "type": {+ "subTypes": {"anyOf": [{- "type": "number"+ "$ref": "#/$defs/SearchSubtypeFilterInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "types": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"@@ -9138,282 +9805,217 @@},"additionalProperties": false},- "SearchPath": {+ "SearchBlocksData": {"type": "object","properties": {"blocks": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchBlock"- },- {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]}- ]- }- },- "box": {- "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "children": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchPath"- },- {- "type": "null"- }- ]- }+ "matchedBlockCount": {+ "type": "integer"},- "count": {+ "matchedRootCount": {"type": "integer"},- "created": {- "type": "string"- },- "depth": {+ "pageCount": {"type": "integer"- },- "folded": {- "type": "boolean"- },- "hPath": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "nodeType": {- "type": "string"- },- "number": {- "type": "string"- },- "subType": {- "type": "string"- },- "type": {- "type": "string"- },- "updated": {- "type": "string"}},"required": [- "box",- "count",- "created",- "depth",- "folded",- "hPath",- "id",- "name",- "nodeType",- "subType",- "type",- "updated"+ "blocks",+ "matchedBlockCount",+ "matchedRootCount",+ "pageCount"],"additionalProperties": false},- "SearchSubTypes": {+ "SearchEmbedBlockRequestInput": {"type": "object","properties": {- "heading": {+ "breadcrumb": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "boolean"},{"type": "null"}]},- "list": {+ "embedBlockID": {+ "type": "string"+ },+ "excludeIDs": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "headingMode": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "number"},{"type": "null"}]},- "listItem": {+ "notebook": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "string"},{"type": "null"}]+ },+ "stmt": {+ "type": "string"}},"required": [- "heading",- "list",- "listItem"+ "embedBlockID",+ "excludeIDs",+ "stmt"],"additionalProperties": false},- "SearchSubTypesInput": {+ "SearchHeadingFilterInput": {"type": "object","properties": {- "heading": {+ "h1": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "boolean"},{"type": "null"}]},- "list": {+ "h2": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "boolean"},{"type": "null"}]},- "listItem": {+ "h3": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "type": "boolean"},{"type": "null"}]- }- },- "additionalProperties": false- },- "SearchTagData": {- "type": "object",- "properties": {- "k": {- "type": "string"},- "tags": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "k",- "tags"- ],- "additionalProperties": false- },- "SearchTagRequestInput": {- "type": "object",- "properties": {- "k": {- "type": "string"+ "h4": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "h5": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "h6": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "k"- ],"additionalProperties": false},- "SetBlockAttrsRequestInput": {+ "SearchHistoryData": {"type": "object","properties": {- "attrs": {- "type": "object",- "additionalProperties": {- "anyOf": [- {+ "histories": {+ "anyOf": [+ {+ "type": "array",+ "items": {"type": "string"- },- {- "type": "null"}- ]- }+ },+ {+ "type": "null"+ }+ ]},- "id": {- "type": "string"+ "pageCount": {+ "type": "integer"+ },+ "totalCount": {+ "type": "integer"}},"required": [- "attrs",- "id"+ "histories",+ "pageCount",+ "totalCount"],"additionalProperties": false},- "SetCriterionRequestInput": {+ "SearchHistoryRequestInput": {"type": "object","properties": {- "criterion": {+ "notebook": {"anyOf": [{- "$ref": "#/$defs/CriterionInput"+ "type": "string"},{"type": "null"}]- }- },- "required": [- "criterion"- ],- "additionalProperties": false- },- "SetGraphConfRequestInput": {- "type": "object",- "properties": {- "conf": {- "$ref": "#/$defs/GraphConfigurationFieldsInput"},- "type": {- "type": "string"- }- },- "required": [- "conf",- "type"- ],- "additionalProperties": false- },- "SetInlineStylesRequestInput": {- "type": "object",- "properties": {- "app": {+ "op": {"anyOf": [{"type": "string"@@ -9423,337 +10025,237 @@}]},- "av": {+ "page": {"anyOf": [{- "$ref": "#/$defs/InlineStyleAVInput"+ "type": "number"},{"type": "null"}]},- "builtin": {+ "query": {"anyOf": [{- "$ref": "#/$defs/InlineStyleBuiltinInput"+ "type": "string"},{"type": "null"}]},- "order": {+ "type": {"anyOf": [{- "$ref": "#/$defs/InlineStyleOrderInput"+ "type": "number"},{"type": "null"}]- },- "styles": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/InlineStyleInput"- },- {- "type": "null"- }- ]- }- },- "version": {- "type": "number"}},- "required": [- "styles",- "version"- ],- "additionalProperties": false- },- "SetNotebookConfRequestInput": {- "type": "object",- "properties": {- "conf": {- "anyOf": [- {- "$ref": "#/$defs/NotebookConfPatchInput"- },- {- "type": "null"- }- ]- },- "notebook": {- "type": "string"- }- },- "required": [- "notebook"- ],"additionalProperties": false},- "SetNotebookIconRequestInput": {+ "SearchKeywordRequestInput": {"type": "object","properties": {- "icon": {- "type": "string"- },- "notebook": {+ "k": {"type": "string"}},"required": [- "icon",- "notebook"+ "k"],"additionalProperties": false},- "SetPetalEnabledRequestInput": {+ "SearchListFilterInput": {"type": "object","properties": {- "app": {+ "o": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "enabled": {- "type": "boolean"+ "t": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "packageName": {- "type": "string"+ "u": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "enabled",- "packageName"- ],"additionalProperties": false},- "SetPetalPublishEnabledRequestInput": {+ "SearchPageRequestInput": {"type": "object","properties": {- "enabled": {- "type": "boolean"+ "page": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]},- "packageName": {- "type": "string"+ "pageSize": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "enabled",- "packageName"- ],"additionalProperties": false},- "SetSnapshotMemoRequestInput": {+ "SearchPath": {"type": "object","properties": {- "id": {- "type": "string"+ "blocks": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }},- "memo": {+ "box": {"type": "string"- }- },- "required": [- "id",- "memo"- ],- "additionalProperties": false- },- "SetSnippetRequestInput": {- "type": "object",- "properties": {- "snippets": {+ },+ "children": {"type": "array","items": {- "$ref": "#/$defs/SnippetInput"+ "anyOf": [+ {+ "$ref": "#/$defs/SearchPath"+ },+ {+ "type": "null"+ }+ ]}- }- },- "required": [- "snippets"- ],- "additionalProperties": false- },- "Shorthand": {- "type": "object",- "properties": {- "hCreated": {+ },+ "count": {+ "type": "integer"+ },+ "created": {"type": "string"},- "oId": {+ "depth": {+ "type": "integer"+ },+ "folded": {+ "type": "boolean"+ },+ "hPath": {"type": "string"},- "shorthandContent": {+ "id": {"type": "string"},- "shorthandDesc": {+ "name": {"type": "string"},- "shorthandFrom": {- "type": "integer"+ "nodeType": {+ "type": "string"},- "shorthandMd": {+ "number": {"type": "string"},- "shorthandTitle": {+ "subType": {"type": "string"},- "shorthandURL": {+ "type": {+ "type": "string"+ },+ "updated": {"type": "string"}},"required": [- "hCreated",- "oId",- "shorthandContent",- "shorthandDesc",- "shorthandFrom",- "shorthandMd",- "shorthandTitle",- "shorthandURL"+ "box",+ "count",+ "created",+ "depth",+ "folded",+ "hPath",+ "id",+ "name",+ "nodeType",+ "subType",+ "type",+ "updated"],"additionalProperties": false},- "ShorthandPage": {+ "SearchPathRequestInput": {"type": "object","properties": {- "pagination": {- "$ref": "#/$defs/ShorthandPagination"- },- "shorthands": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Shorthand"- },- {- "type": "null"- }- ]- }+ "path": {+ "type": "string"}},"required": [- "pagination",- "shorthands"+ "path"],"additionalProperties": false},- "ShorthandPagination": {+ "SearchRefBlockRequestInput": {"type": "object","properties": {- "paginationPageCount": {- "type": "integer"+ "beforeLen": {+ "type": "number"},- "paginationPageNums": {+ "id": {"anyOf": [{- "type": "array",- "items": {- "type": "integer"- }+ "type": "string"},{"type": "null"}]},- "paginationRecordCount": {- "type": "integer"- }- },- "required": [- "paginationPageCount",- "paginationPageNums",- "paginationRecordCount"- ],- "additionalProperties": false- },- "ShorthandsData": {- "type": "object",- "properties": {- "code": {- "type": "integer"- },- "data": {- "$ref": "#/$defs/ShorthandPage"+ "isDatabase": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "msg": {- "type": "string"- }- },- "required": [- "code",- "data",- "msg"- ],- "additionalProperties": false- },- "ShorthandsRequestInput": {- "type": "object",- "properties": {- "page": {- "type": "number"- }- },- "required": [- "page"- ],- "additionalProperties": false- },- "Snippet": {- "type": "object",- "properties": {- "content": {- "type": "string"- },- "disabledInPublish": {- "type": "boolean"- },- "enabled": {- "type": "boolean"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- }- },- "required": [- "content",- "disabledInPublish",- "enabled",- "id",- "name",- "type"- ],- "additionalProperties": false- },- "SnippetInput": {- "type": "object",- "properties": {- "content": {- "type": "string"- },- "disabledInPublish": {+ "isSquareBrackets": {"anyOf": [{"type": "boolean"@@ -9763,169 +10265,174 @@}]},- "enabled": {- "type": "boolean"- },- "id": {+ "k": {"type": "string"},- "name": {- "type": "string"+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "type": {- "type": "string"- }- },- "required": [- "content",- "enabled",- "id",- "name",- "type"- ],- "additionalProperties": false- },- "SnippetsData": {- "type": "object",- "properties": {- "snippets": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Snippet"- },- {- "type": "null"- }- ]- }- }- },- "required": [- "snippets"- ],- "additionalProperties": false- },- "StorageKeyRequestInput": {- "type": "object",- "properties": {- "key": {+ "reqId": {+ "anyOf": [+ {+ "$ref": "#/$defs/JSONValue"+ },+ {+ "type": "null"+ }+ ]+ },+ "rootID": {"type": "string"}},- "required": [- "key"- ],"additionalProperties": false},- "StorageKeysRequestInput": {+ "SearchRefCorrelation": {"type": "object","properties": {- "keys": {- "type": "array",- "items": {- "type": "string"- }+ "reqId": {+ "$ref": "#/$defs/JSONValue"}},"required": [- "keys"+ "reqId"],"additionalProperties": false},- "StorageRemoveKeysRequestInput": {+ "SearchRefResult": {"type": "object","properties": {- "app": {+ "blocks": {"anyOf": [{- "type": "string"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]},- "keys": {- "type": "array",- "items": {- "type": "string"- }+ "k": {+ "type": "string"+ },+ "newDoc": {+ "type": "boolean"+ },+ "reqId": {+ "$ref": "#/$defs/JSONValue"}},"required": [- "keys"+ "blocks",+ "k",+ "newDoc",+ "reqId"],"additionalProperties": false},- "StorageRemoveRequestInput": {+ "SearchSubTypes": {"type": "object","properties": {- "app": {+ "heading": {"anyOf": [{- "type": "string"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"}]},- "key": {- "type": "string"- }- },- "required": [- "key"- ],- "additionalProperties": false- },- "StorageSetKeysRequestInput": {- "type": "object",- "properties": {- "app": {+ "list": {"anyOf": [{- "type": "string"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"}]},- "keyVals": {- "type": "object",- "additionalProperties": {- "$ref": "#/$defs/JSONValue"- }+ "listItem": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]}},"required": [- "keyVals"+ "heading",+ "list",+ "listItem"],"additionalProperties": false},- "StorageSetRequestInput": {+ "SearchSubTypesInput": {"type": "object","properties": {- "app": {+ "heading": {"anyOf": [{- "type": "string"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"}]},- "key": {- "type": "string"+ "list": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]},- "val": {+ "listItem": {"anyOf": [{- "$ref": "#/$defs/JSONValue"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }},{"type": "null"@@ -9933,113 +10440,35 @@]}},- "required": [- "key"- ],"additionalProperties": false},- "SwapBlockRefRequestInput": {+ "SearchSubtypeFilterInput": {"type": "object","properties": {- "defID": {- "type": "string"- },- "includeChildren": {- "type": "boolean"- },- "refID": {- "type": "string"- }- },- "required": [- "defID",- "includeChildren",- "refID"- ],- "additionalProperties": false- },- "TagData": {- "type": "object",- "properties": {- "children": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/TagData"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]- },- "count": {- "type": "integer"- },- "depth": {- "type": "integer"- },- "label": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- }- },- "required": [- "children",- "count",- "depth",- "label",- "name",- "type"- ],- "additionalProperties": false- },- "TailChildBlocksRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "ids": {+ "heading": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "$ref": "#/$defs/SearchHeadingFilterInput"},{"type": "null"}]},- "n": {+ "list": {"anyOf": [{- "type": "number"+ "$ref": "#/$defs/SearchListFilterInput"},{"type": "null"}]},- "notebook": {+ "listItem": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/SearchListFilterInput"},{"type": "null"@@ -10047,112 +10476,73 @@]}},- "required": [- "id"- ],- "additionalProperties": false- },- "TaskListMarkerRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "marker": {- "type": "string"- }- },- "required": [- "id",- "marker"- ],"additionalProperties": false},- "TemplateDocumentInfo": {+ "SearchTagData": {"type": "object","properties": {- "directory": {+ "k": {"type": "string"},- "hasDatabase": {- "type": "boolean"- },- "name": {- "type": "string"- }- },- "required": [- "directory",- "hasDatabase",- "name"- ],- "additionalProperties": false- },- "TemplateDocumentRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"+ "tags": {+ "type": "array",+ "items": {+ "type": "string"+ }}},"required": [- "id"+ "k",+ "tags"],"additionalProperties": false},- "TemplateFileEntry": {+ "SearchTagRequestInput": {"type": "object","properties": {- "isDir": {- "type": "boolean"- },- "isPackage": {- "type": "boolean"- },- "path": {+ "k": {"type": "string"}},"required": [- "isDir",- "path"+ "k"],"additionalProperties": false},- "TemplateFileRequestInput": {+ "SearchTemplateData": {"type": "object","properties": {- "action": {- "type": "string"- },- "content": {- "type": "string"- },- "path": {- "type": "string"- },- "revision": {+ "k": {"type": "string"},- "target": {- "type": "string"- }- },- "additionalProperties": false- },- "TemplateFileRevision": {- "type": "object",- "properties": {- "revision": {- "type": "string"+ "templates": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchTemplateResult"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]}},"required": [- "revision"+ "k",+ "templates"],"additionalProperties": false},- "TemplateFileSource": {+ "SearchTemplateResult": {"type": "object","properties": {"content": {@@ -10161,33 +10551,31 @@"path": {"type": "string"},- "revision": {+ "relativePath": {"type": "string"}},"required": ["content",- "revision"+ "path",+ "relativePath"],"additionalProperties": false},- "TemplatePlan": {+ "SearchWidgetData": {"type": "object","properties": {- "count": {- "type": "integer"- },- "id": {+ "k": {"type": "string"},- "nodes": {+ "widgets": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/TemplatePlanNode"+ "$ref": "#/$defs/SearchWidgetResult"},{"type": "null"@@ -10202,461 +10590,604 @@}},"required": [- "count",- "id",- "nodes"+ "k",+ "widgets"],"additionalProperties": false},- "TemplatePlanNode": {+ "SearchWidgetResult": {"type": "object","properties": {- "depth": {- "type": "integer"- },- "hPath": {- "type": "string"- },- "id": {+ "content": {"type": "string"},- "parentID": {+ "name": {"type": "string"+ }+ },+ "required": [+ "content",+ "name"+ ],+ "additionalProperties": false+ },+ "SetBlockAttrsRequestInput": {+ "type": "object",+ "properties": {+ "attrs": {+ "type": "object",+ "additionalProperties": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }},- "title": {+ "id": {"type": "string"}},"required": [- "depth",- "hPath",- "id",- "parentID",- "title"+ "attrs",+ "id"],"additionalProperties": false},- "TransferBlockRefRequestInput": {+ "SetCriterionRequestInput": {"type": "object","properties": {- "fromID": {- "type": "string"- },- "refIDs": {+ "criterion": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "$ref": "#/$defs/CriterionInput"},{"type": "null"}]- },- "reloadUI": {- "anyOf": [- {- "type": "boolean"- },- {- "type": "null"- }- ]- },- "toID": {- "type": "string"}},"required": [- "fromID",- "toID"+ "criterion"],"additionalProperties": false},- "TreeStatData": {+ "SetGraphConfRequestInput": {"type": "object","properties": {- "containsEmbed": {- "type": "boolean"- },- "embedStat": {- "anyOf": [- {- "$ref": "#/$defs/EmbedStat"- },- {- "type": "null"- }- ]- },- "reqId": {- "$ref": "#/$defs/JSONValue"- },- "stat": {- "anyOf": [- {- "$ref": "#/$defs/BlockStat"- },- {- "type": "null"- }- ]+ "conf": {+ "$ref": "#/$defs/GraphConfigurationFieldsInput"},- "statWithEmbed": {- "anyOf": [- {- "$ref": "#/$defs/BlockStat"- },- {- "type": "null"- }- ]+ "type": {+ "type": "string"}},"required": [- "reqId",- "stat"+ "conf",+ "type"],"additionalProperties": false},- "TreeStatRequestInput": {+ "SetInlineStylesRequestInput": {"type": "object","properties": {- "id": {- "type": "string"- },- "ids": {+ "app": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "type": "string"},{"type": "null"}]},- "includeEmbed": {+ "av": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/InlineStyleAVInput"},{"type": "null"}]},- "notebook": {+ "builtin": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/InlineStyleBuiltinInput"},{"type": "null"}]},- "reqId": {+ "order": {"anyOf": [{- "$ref": "#/$defs/JSONValue"+ "$ref": "#/$defs/InlineStyleOrderInput"},{"type": "null"}]+ },+ "styles": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "version": {+ "type": "number"}},"required": [- "id"+ "styles",+ "version"],"additionalProperties": false},- "TrimmedIDRequestInput": {+ "SetNotebookConfRequestInput": {"type": "object","properties": {- "id": {+ "conf": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookConfPatchInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {"type": "string"}},"required": [- "id"+ "notebook"],"additionalProperties": false},- "UnfoldedParentData": {+ "SetNotebookIconRequestInput": {"type": "object","properties": {- "parentID": {+ "icon": {+ "type": "string"+ },+ "notebook": {"type": "string"}},"required": [- "parentID"+ "icon",+ "notebook"],"additionalProperties": false},- "UnlockNotebookRequestInput": {+ "SetPetalEnabledRequestInput": {"type": "object","properties": {- "notebook": {- "type": "string"+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "password": {+ "enabled": {+ "type": "boolean"+ },+ "packageName": {"type": "string"}},"required": [- "notebook",- "password"+ "enabled",+ "packageName"],"additionalProperties": false},- "UnzipRequestInput": {+ "SetPetalPublishEnabledRequestInput": {"type": "object","properties": {- "path": {- "type": "string"+ "enabled": {+ "type": "boolean"},- "zipPath": {+ "packageName": {"type": "string"}},"required": [- "path",- "zipPath"+ "enabled",+ "packageName"],"additionalProperties": false},- "UpdateBlockRequestInput": {+ "SetSnapshotMemoRequestInput": {"type": "object","properties": {- "data": {- "type": "string"- },- "dataType": {- "type": "string"- },"id": {"type": "string"},- "lockType": {- "anyOf": [- {- "type": "boolean"- },- {- "type": "null"- }- ]+ "memo": {+ "type": "string"}},"required": [- "data",- "dataType",- "id"+ "id",+ "memo"],"additionalProperties": false},- "UpdateChannelRequestInput": {+ "SetSnippetRequestInput": {"type": "object","properties": {- "updateChannel": {- "type": "string"+ "snippets": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/SnippetInput"+ }}},"required": [- "updateChannel"+ "snippets"],"additionalProperties": false},- "UpdatePinnedDocsRequestInput": {+ "Shorthand": {"type": "object","properties": {- "action": {+ "hCreated": {"type": "string"},- "after": {- "type": "boolean"+ "oId": {+ "type": "string"},- "ids": {- "type": "array",- "items": {- "type": "string"- }+ "shorthandContent": {+ "type": "string"},- "targetID": {+ "shorthandDesc": {+ "type": "string"+ },+ "shorthandFrom": {+ "type": "integer"+ },+ "shorthandMd": {+ "type": "string"+ },+ "shorthandTitle": {+ "type": "string"+ },+ "shorthandURL": {"type": "string"}},"required": [- "action",- "ids"+ "hCreated",+ "oId",+ "shorthandContent",+ "shorthandDesc",+ "shorthandFrom",+ "shorthandMd",+ "shorthandTitle",+ "shorthandURL"],"additionalProperties": false},- "ViewStatePatchRequestInput": {+ "ShorthandPage": {"type": "object","properties": {- "key": {- "type": "string"+ "pagination": {+ "$ref": "#/$defs/ShorthandPagination"},- "removeKeys": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"+ "shorthands": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Shorthand"+ },+ {+ "type": "null"}- },+ ]+ }+ }+ },+ "required": [+ "pagination",+ "shorthands"+ ],+ "additionalProperties": false+ },+ "ShorthandPagination": {+ "type": "object",+ "properties": {+ "paginationPageCount": {+ "type": "integer"+ },+ "paginationPageNums": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },{"type": "null"}]},- "values": {- "type": "object",- "additionalProperties": {- "$ref": "#/$defs/JSONValue"- }+ "paginationRecordCount": {+ "type": "integer"}},"required": [- "key"+ "paginationPageCount",+ "paginationPageNums",+ "paginationRecordCount"],"additionalProperties": false},- "VirtualBlockRefRequestInput": {+ "ShorthandsData": {"type": "object","properties": {- "keywords": {- "type": "array",- "items": {- "type": "string"- }+ "code": {+ "type": "integer"+ },+ "data": {+ "$ref": "#/$defs/ShorthandPage"+ },+ "msg": {+ "type": "string"}},"required": [- "keywords"+ "code",+ "data",+ "msg"],"additionalProperties": false},- "WPSPresentationData": {+ "ShorthandsRequestInput": {"type": "object","properties": {- "converted": {+ "page": {+ "type": "number"+ }+ },+ "required": [+ "page"+ ],+ "additionalProperties": false+ },+ "Snippet": {+ "type": "object",+ "properties": {+ "content": {+ "type": "string"+ },+ "disabledInPublish": {"type": "boolean"},- "dom": {+ "enabled": {+ "type": "boolean"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "type": {"type": "string"}},"required": [- "converted",- "dom"+ "content",+ "disabledInPublish",+ "enabled",+ "id",+ "name",+ "type"],"additionalProperties": false},- "WPSPresentationRequestInput": {+ "SnippetInput": {"type": "object","properties": {- "data": {+ "content": {"type": "string"},- "text": {+ "disabledInPublish": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},+ "enabled": {+ "type": "boolean"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },"type": {"type": "string"}},"required": [- "data",+ "content",+ "enabled",+ "id",+ "name","type"],"additionalProperties": false},- "WordCountData": {+ "SnippetsData": {"type": "object","properties": {- "reqId": {- "$ref": "#/$defs/JSONValue"- },- "stat": {- "anyOf": [- {- "$ref": "#/$defs/BlockStat"- },- {- "type": "null"- }- ]+ "snippets": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Snippet"+ },+ {+ "type": "null"+ }+ ]+ }}},"required": [- "reqId",- "stat"+ "snippets"],"additionalProperties": false},- "WorkspaceAVBuiltinColorUpdateInput": {+ "StorageKeyRequestInput": {"type": "object","properties": {- "customized": {+ "key": {+ "type": "string"+ }+ },+ "required": [+ "key"+ ],+ "additionalProperties": false+ },+ "StorageKeysRequestInput": {+ "type": "object",+ "properties": {+ "keys": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "required": [+ "keys"+ ],+ "additionalProperties": false+ },+ "StorageRemoveKeysRequestInput": {+ "type": "object",+ "properties": {+ "app": {"anyOf": [{- "type": "boolean"+ "type": "string"},{"type": "null"}]},- "dark": {+ "keys": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "required": [+ "keys"+ ],+ "additionalProperties": false+ },+ "StorageRemoveRequestInput": {+ "type": "object",+ "properties": {+ "app": {"anyOf": [{- "$ref": "#/$defs/InlineStyleThemeInput"+ "type": "string"},{"type": "null"}]},- "hidden": {+ "key": {+ "type": "string"+ }+ },+ "required": [+ "key"+ ],+ "additionalProperties": false+ },+ "StorageSetKeysRequestInput": {+ "type": "object",+ "properties": {+ "app": {"anyOf": [{- "type": "boolean"+ "type": "string"},{"type": "null"}]},- "index": {+ "keyVals": {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ }+ },+ "required": [+ "keyVals"+ ],+ "additionalProperties": false+ },+ "StorageSetRequestInput": {+ "type": "object",+ "properties": {+ "app": {"anyOf": [{- "type": "integer"+ "type": "string"},{"type": "null"}]},- "light": {+ "key": {+ "type": "string"+ },+ "val": {"anyOf": [{- "$ref": "#/$defs/InlineStyleThemeInput"+ "$ref": "#/$defs/JSONValue"},{"type": "null"@@ -10664,29 +11195,42 @@]}},+ "required": [+ "key"+ ],"additionalProperties": false},- "WorkspaceAVPaletteRequestInput": {+ "SwapBlockRefRequestInput": {"type": "object","properties": {- "app": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"- }- ]+ "defID": {+ "type": "string"},- "builtinColors": {- "anyOf": [- {+ "includeChildren": {+ "type": "boolean"+ },+ "refID": {+ "type": "string"+ }+ },+ "required": [+ "defID",+ "includeChildren",+ "refID"+ ],+ "additionalProperties": false+ },+ "TagData": {+ "type": "object",+ "properties": {+ "children": {+ "anyOf": [+ {"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/WorkspaceAVBuiltinColorUpdateInput"+ "$ref": "#/$defs/TagData"},{"type": "null"@@ -10699,70 +11243,1978 @@}]},- "colors": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/AttributeViewCustomColorInput"- },- {- "type": "null"+ "count": {+ "type": "integer"+ },+ "depth": {+ "type": "integer"+ },+ "label": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "type": {+ "type": "string"+ }+ },+ "required": [+ "children",+ "count",+ "depth",+ "label",+ "name",+ "type"+ ],+ "additionalProperties": false+ },+ "TailChildBlocksRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "ids": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"}- ]- }+ },+ {+ "type": "null"+ }+ ]},- "order": {- "type": "array",- "items": {- "type": "string"- }+ "n": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]}},"required": [- "colors",- "order"+ "id"],"additionalProperties": false},- "WorkspaceInfoData": {+ "TaskListMarkerRequestInput": {"type": "object","properties": {- "siyuanVer": {+ "id": {"type": "string"},- "workspaceDir": {+ "marker": {"type": "string"}},"required": [- "siyuanVer",- "workspaceDir"+ "id",+ "marker"+ ],+ "additionalProperties": false+ },+ "TemplateDocumentInfo": {+ "type": "object",+ "properties": {+ "directory": {+ "type": "string"+ },+ "hasDatabase": {+ "type": "boolean"+ },+ "name": {+ "type": "string"+ }+ },+ "required": [+ "directory",+ "hasDatabase",+ "name"+ ],+ "additionalProperties": false+ },+ "TemplateDocumentRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ },+ "TemplateFileEntry": {+ "type": "object",+ "properties": {+ "isDir": {+ "type": "boolean"+ },+ "isPackage": {+ "type": "boolean"+ },+ "path": {+ "type": "string"+ }+ },+ "required": [+ "isDir",+ "path"+ ],+ "additionalProperties": false+ },+ "TemplateFileRequestInput": {+ "type": "object",+ "properties": {+ "action": {+ "type": "string"+ },+ "content": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "revision": {+ "type": "string"+ },+ "target": {+ "type": "string"+ }+ },+ "additionalProperties": false+ },+ "TemplateFileRevision": {+ "type": "object",+ "properties": {+ "revision": {+ "type": "string"+ }+ },+ "required": [+ "revision"+ ],+ "additionalProperties": false+ },+ "TemplateFileSource": {+ "type": "object",+ "properties": {+ "content": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "revision": {+ "type": "string"+ }+ },+ "required": [+ "content",+ "revision"+ ],+ "additionalProperties": false+ },+ "TemplatePlan": {+ "type": "object",+ "properties": {+ "count": {+ "type": "integer"+ },+ "id": {+ "type": "string"+ },+ "nodes": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/TemplatePlanNode"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "count",+ "id",+ "nodes"],"additionalProperties": false},- "ZipRequestInput": {- "type": "object",- "properties": {- "path": {- "type": "string"- },- "zipPath": {- "type": "string"- }- },- "required": [- "path",- "zipPath"- ],- "additionalProperties": false- }- },- "endpoints": [+ "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"+ ],+ "additionalProperties": false+ },+ "TransferBlockRefRequestInput": {+ "type": "object",+ "properties": {+ "fromID": {+ "type": "string"+ },+ "refIDs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "reloadUI": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "toID": {+ "type": "string"+ }+ },+ "required": [+ "fromID",+ "toID"+ ],+ "additionalProperties": false+ },+ "TreeStatData": {+ "type": "object",+ "properties": {+ "containsEmbed": {+ "type": "boolean"+ },+ "embedStat": {+ "anyOf": [+ {+ "$ref": "#/$defs/EmbedStat"+ },+ {+ "type": "null"+ }+ ]+ },+ "reqId": {+ "$ref": "#/$defs/JSONValue"+ },+ "stat": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockStat"+ },+ {+ "type": "null"+ }+ ]+ },+ "statWithEmbed": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockStat"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "reqId",+ "stat"+ ],+ "additionalProperties": false+ },+ "TreeStatRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "ids": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "includeEmbed": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "reqId": {+ "anyOf": [+ {+ "$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+ },+ "UnlockNotebookRequestInput": {+ "type": "object",+ "properties": {+ "notebook": {+ "type": "string"+ },+ "password": {+ "type": "string"+ }+ },+ "required": [+ "notebook",+ "password"+ ],+ "additionalProperties": false+ },+ "UnzipRequestInput": {+ "type": "object",+ "properties": {+ "path": {+ "type": "string"+ },+ "zipPath": {+ "type": "string"+ }+ },+ "required": [+ "path",+ "zipPath"+ ],+ "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/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": "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": "GET",- "path": "/api/system/bootProgress",- "handler": "bootProgress",+ "method": "POST",+ "path": "/api/av/searchAttributeViewNonRelationKey",+ "handler": "searchAttributeViewNonRelationKey","body": "none","request": {"$ref": "#/$defs/EmptyRequestInput"@@ -10779,7 +13231,7 @@]},"data": {- "$ref": "#/$defs/BootProgressData"+ "type": "null"},"msg": {"type": "string"@@ -10835,12 +13287,12 @@}},{- "method": "GET",- "path": "/api/system/version",- "handler": "version",- "body": "none",+ "method": "POST",+ "path": "/api/block/appendBlock",+ "handler": "appendBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/AppendBlockRequestInput"},"response": {"anyOf": [@@ -10854,7 +13306,24 @@]},"data": {- "type": "string"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -10911,11 +13380,11 @@},{"method": "POST",- "path": "/api/account/checkActivationcode",- "handler": "checkActivationcode",+ "path": "/api/block/appendDailyNoteBlock",+ "handler": "appendDailyNoteBlock","body": "json","request": {- "$ref": "#/$defs/CheckActivationCodeRequestInput"+ "$ref": "#/$defs/DailyNoteBlockRequestInput"},"response": {"anyOf": [@@ -10929,7 +13398,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -10948,8 +13434,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -10966,9 +13451,6 @@],"additionalProperties": false},- {- "type": "null"- },{"type": "null"}@@ -10990,11 +13472,11 @@},{"method": "POST",- "path": "/api/account/deactivate",- "handler": "deactivateUser",- "body": "none",+ "path": "/api/block/appendHeadingChildren",+ "handler": "appendHeadingChildren",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/AppendHeadingChildrenRequestInput"},"response": {"anyOf": [@@ -11065,11 +13547,11 @@},{"method": "POST",- "path": "/api/account/login",- "handler": "login",+ "path": "/api/block/batchAppendBlock",+ "handler": "batchAppendBlock","body": "json","request": {- "$ref": "#/$defs/AccountLoginRequestInput"+ "$ref": "#/$defs/BatchParentBlockRequestInput"},"response": {"anyOf": [@@ -11085,7 +13567,17 @@"data": {"anyOf": [{- "$ref": "#/$defs/AccountLoginData"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -11109,9 +13601,7 @@"code": {"type": "integer","enum": [- -1,- 1,- 10+ -1]},"data": {@@ -11130,16 +13620,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/AccountLoginData"- },- {- "type": "null"- }- ]}]},@@ -11159,11 +13639,11 @@},{"method": "POST",- "path": "/api/account/startFreeTrial",- "handler": "startFreeTrial",- "body": "none",+ "path": "/api/block/batchInsertBlock",+ "handler": "batchInsertBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BatchInsertBlockRequestInput"},"response": {"anyOf": [@@ -11177,7 +13657,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -11234,11 +13731,11 @@},{"method": "POST",- "path": "/api/account/useActivationcode",- "handler": "useActivationcode",+ "path": "/api/block/batchPrependBlock",+ "handler": "batchPrependBlock","body": "json","request": {- "$ref": "#/$defs/ActivationCodeRequestInput"+ "$ref": "#/$defs/BatchParentBlockRequestInput"},"response": {"anyOf": [@@ -11252,7 +13749,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -11309,11 +13823,11 @@},{"method": "POST",- "path": "/api/archive/unzip",- "handler": "unzip",+ "path": "/api/block/batchUpdateBlock",+ "handler": "batchUpdateBlock","body": "json","request": {- "$ref": "#/$defs/UnzipRequestInput"+ "$ref": "#/$defs/BatchUpdateBlockRequestInput"},"response": {"anyOf": [@@ -11327,7 +13841,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -11384,11 +13915,11 @@},{"method": "POST",- "path": "/api/archive/zip",- "handler": "zip",+ "path": "/api/block/batchUpdateTaskListItemMarker",+ "handler": "batchUpdateTaskListItemMarker","body": "json","request": {- "$ref": "#/$defs/ZipRequestInput"+ "$ref": "#/$defs/BatchTaskListMarkerRequestInput"},"response": {"anyOf": [@@ -11402,7 +13933,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -11459,11 +14007,11 @@},{"method": "POST",- "path": "/api/attr/batchGetBlockAttrs",- "handler": "batchGetBlockAttrs",+ "path": "/api/block/checkBlockExist",+ "handler": "checkBlockExist","body": "json","request": {- "$ref": "#/$defs/BlockIDsRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -11477,20 +14025,7 @@]},"data": {- "type": "object",- "additionalProperties": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "string"- }- },- {- "type": "null"- }- ]- }+ "type": "boolean"},"msg": {"type": "string"@@ -11547,11 +14082,11 @@},{"method": "POST",- "path": "/api/attr/batchSetBlockAttrs",- "handler": "batchSetBlockAttrs",+ "path": "/api/block/checkBlockFold",+ "handler": "checkBlockFold","body": "json","request": {- "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -11565,7 +14100,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockFoldData"},"msg": {"type": "string"@@ -11622,11 +14157,11 @@},{"method": "POST",- "path": "/api/attr/getBlockAttrs",- "handler": "getBlockAttrs",+ "path": "/api/block/checkBlockRef",+ "handler": "checkBlockRef","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/CheckBlockRefRequestInput"},"response": {"anyOf": [@@ -11640,10 +14175,7 @@]},"data": {- "type": "object",- "additionalProperties": {- "type": "string"- }+ "type": "boolean"},"msg": {"type": "string"@@ -11681,6 +14213,9 @@},{"type": "null"+ },+ {+ "type": "boolean"}]},@@ -11700,11 +14235,11 @@},{"method": "POST",- "path": "/api/attr/getBookmarkLabels",- "handler": "getBookmarkLabels",- "body": "none",+ "path": "/api/block/checkBlocksExist",+ "handler": "checkBlocksExist",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/CheckBlocksExistRequestInput"},"response": {"anyOf": [@@ -11720,9 +14255,9 @@"data": {"anyOf": [{- "type": "array",- "items": {- "type": "string"+ "type": "object",+ "additionalProperties": {+ "type": "boolean"}},{@@ -11785,11 +14320,11 @@},{"method": "POST",- "path": "/api/attr/resetBlockAttrs",- "handler": "resetBlockAttrs",- "body": "none",+ "path": "/api/block/deleteBlock",+ "handler": "deleteBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/DeleteBlockRequestInput"},"response": {"anyOf": [@@ -11803,7 +14338,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -11860,11 +14412,11 @@},{"method": "POST",- "path": "/api/attr/setBlockAttrs",- "handler": "setBlockAttrs",+ "path": "/api/block/foldBlock",+ "handler": "foldBlock","body": "json","request": {- "$ref": "#/$defs/SetBlockAttrsRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -11935,11 +14487,11 @@},{"method": "POST",- "path": "/api/av/searchAttributeViewNonRelationKey",- "handler": "searchAttributeViewNonRelationKey",- "body": "none",+ "path": "/api/block/getBlockBreadcrumb",+ "handler": "getBlockBreadcrumb",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BlockBreadcrumbRequestInput"},"response": {"anyOf": [@@ -11953,7 +14505,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockPath"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12010,11 +14579,11 @@},{"method": "POST",- "path": "/api/block/appendBlock",- "handler": "appendBlock",+ "path": "/api/block/getBlockBreadcrumbChildren",+ "handler": "getBlockBreadcrumbChildren","body": "json","request": {- "$ref": "#/$defs/AppendBlockRequestInput"+ "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"},"response": {"anyOf": [@@ -12030,17 +14599,7 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/BlockBreadcrumbChildren"},{"type": "null"@@ -12102,11 +14661,11 @@},{"method": "POST",- "path": "/api/block/appendDailyNoteBlock",- "handler": "appendDailyNoteBlock",+ "path": "/api/block/getBlockDOM",+ "handler": "getBlockDOM","body": "json","request": {- "$ref": "#/$defs/DailyNoteBlockRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -12120,24 +14679,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/BlockDOMData"},"msg": {"type": "string"@@ -12194,11 +14736,11 @@},{"method": "POST",- "path": "/api/block/appendHeadingChildren",- "handler": "appendHeadingChildren",+ "path": "/api/block/getBlockDOMWithEmbed",+ "handler": "getBlockDOMWithEmbed","body": "json","request": {- "$ref": "#/$defs/AppendHeadingChildrenRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -12212,7 +14754,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockDOMData"},"msg": {"type": "string"@@ -12269,11 +14811,11 @@},{"method": "POST",- "path": "/api/block/batchAppendBlock",- "handler": "batchAppendBlock",+ "path": "/api/block/getBlockDOMs",+ "handler": "getBlockDOMs","body": "json","request": {- "$ref": "#/$defs/BatchParentBlockRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -12289,16 +14831,9 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "object",+ "additionalProperties": {+ "type": "string"}},{@@ -12361,11 +14896,11 @@},{"method": "POST",- "path": "/api/block/batchInsertBlock",- "handler": "batchInsertBlock",+ "path": "/api/block/getBlockDOMsWithEmbed",+ "handler": "getBlockDOMsWithEmbed","body": "json","request": {- "$ref": "#/$defs/BatchInsertBlockRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -12381,16 +14916,9 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "object",+ "additionalProperties": {+ "type": "string"}},{@@ -12453,11 +14981,11 @@},{"method": "POST",- "path": "/api/block/batchPrependBlock",- "handler": "batchPrependBlock",+ "path": "/api/block/getBlockDefIDsByRefText",+ "handler": "getBlockDefIDsByRefText","body": "json","request": {- "$ref": "#/$defs/BatchParentBlockRequestInput"+ "$ref": "#/$defs/RefTextQueryRequestInput"},"response": {"anyOf": [@@ -12471,24 +14999,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/RefDefsData"},"msg": {"type": "string"@@ -12545,11 +15056,11 @@},{"method": "POST",- "path": "/api/block/batchUpdateBlock",- "handler": "batchUpdateBlock",+ "path": "/api/block/getBlockIndex",+ "handler": "getBlockIndex","body": "json","request": {- "$ref": "#/$defs/BatchUpdateBlockRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -12563,24 +15074,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "integer"},"msg": {"type": "string"@@ -12637,11 +15131,11 @@},{"method": "POST",- "path": "/api/block/batchUpdateTaskListItemMarker",- "handler": "batchUpdateTaskListItemMarker",+ "path": "/api/block/getBlockInfo",+ "handler": "getBlockInfo","body": "json","request": {- "$ref": "#/$defs/BatchTaskListMarkerRequestInput"+ "$ref": "#/$defs/BlockInfoRequestInput"},"response": {"anyOf": [@@ -12654,25 +15148,8 @@0]},- "data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "data": {+ "$ref": "#/$defs/BlockInfoData"},"msg": {"type": "string"@@ -12691,7 +15168,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 3]},"data": {@@ -12710,6 +15188,9 @@},{"type": "null"+ },+ {+ "type": "string"}]},@@ -12729,11 +15210,11 @@},{"method": "POST",- "path": "/api/block/checkBlockExist",- "handler": "checkBlockExist",+ "path": "/api/block/getBlockKramdown",+ "handler": "getBlockKramdown","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BlockKramdownRequestInput"},"response": {"anyOf": [@@ -12747,7 +15228,7 @@]},"data": {- "type": "boolean"+ "$ref": "#/$defs/BlockKramdownData"},"msg": {"type": "string"@@ -12804,11 +15285,11 @@},{"method": "POST",- "path": "/api/block/checkBlockFold",- "handler": "checkBlockFold",+ "path": "/api/block/getBlockKramdowns",+ "handler": "getBlockKramdowns","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BlocksKramdownRequestInput"},"response": {"anyOf": [@@ -12822,7 +15303,17 @@]},"data": {- "$ref": "#/$defs/BlockFoldData"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12879,11 +15370,11 @@},{"method": "POST",- "path": "/api/block/checkBlockRef",- "handler": "checkBlockRef",+ "path": "/api/block/getBlockRelevantIDs",+ "handler": "getBlockRelevantIDs","body": "json","request": {- "$ref": "#/$defs/CheckBlockRefRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -12897,7 +15388,7 @@]},"data": {- "type": "boolean"+ "$ref": "#/$defs/BlockRelevantData"},"msg": {"type": "string"@@ -12935,9 +15426,6 @@},{"type": "null"- },- {- "type": "boolean"}]},@@ -12957,11 +15445,11 @@},{"method": "POST",- "path": "/api/block/checkBlocksExist",- "handler": "checkBlocksExist",+ "path": "/api/block/getBlockSiblingID",+ "handler": "getBlockSiblingID","body": "json","request": {- "$ref": "#/$defs/CheckBlocksExistRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -12975,17 +15463,7 @@]},"data": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "boolean"- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/BlockSiblingData"},"msg": {"type": "string"@@ -13042,11 +15520,11 @@},{"method": "POST",- "path": "/api/block/deleteBlock",- "handler": "deleteBlock",+ "path": "/api/block/getBlockTreeInfos",+ "handler": "getBlockTreeInfos","body": "json","request": {- "$ref": "#/$defs/DeleteBlockRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -13062,11 +15540,11 @@"data": {"anyOf": [{- "type": "array",- "items": {+ "type": "object",+ "additionalProperties": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "$ref": "#/$defs/BlockTreeInfo"},{"type": "null"@@ -13134,11 +15612,11 @@},{"method": "POST",- "path": "/api/block/foldBlock",- "handler": "foldBlock",+ "path": "/api/block/getBlocksIndexes",+ "handler": "getBlocksIndexes","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -13152,7 +15630,17 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -13209,11 +15697,11 @@},{"method": "POST",- "path": "/api/block/getBlockBreadcrumb",- "handler": "getBlockBreadcrumb",+ "path": "/api/block/getBlocksWordCount",+ "handler": "getBlocksWordCount","body": "json","request": {- "$ref": "#/$defs/BlockBreadcrumbRequestInput"+ "$ref": "#/$defs/BlocksWordCountRequestInput"},"response": {"anyOf": [@@ -13227,24 +15715,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockPath"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/WordCountData"},"msg": {"type": "string"@@ -13301,11 +15772,11 @@},{"method": "POST",- "path": "/api/block/getBlockBreadcrumbChildren",- "handler": "getBlockBreadcrumbChildren",+ "path": "/api/block/getChildBlocks",+ "handler": "getChildBlocks","body": "json","request": {- "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -13319,14 +15790,17 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockBreadcrumbChildren"- },- {- "type": "null"- }- ]+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/ChildBlock"+ },+ {+ "type": "null"+ }+ ]+ }},"msg": {"type": "string"@@ -13383,11 +15857,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOM",- "handler": "getBlockDOM",+ "path": "/api/block/getContentWordCount",+ "handler": "getContentWordCount","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/ContentWordCountRequestInput"},"response": {"anyOf": [@@ -13401,7 +15875,7 @@]},"data": {- "$ref": "#/$defs/BlockDOMData"+ "$ref": "#/$defs/WordCountData"},"msg": {"type": "string"@@ -13458,11 +15932,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMWithEmbed",- "handler": "getBlockDOMWithEmbed",+ "path": "/api/block/getDOMText",+ "handler": "getDOMText","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/DOMTextRequestInput"},"response": {"anyOf": [@@ -13476,7 +15950,7 @@]},"data": {- "$ref": "#/$defs/BlockDOMData"+ "type": "string"},"msg": {"type": "string"@@ -13533,11 +16007,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMs",- "handler": "getBlockDOMs",+ "path": "/api/block/getDocBlocksOrders",+ "handler": "getDocBlocksOrders","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/DocOrdersRequestInput"},"response": {"anyOf": [@@ -13553,8 +16027,8 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {+ "type": "array",+ "items": {"type": "string"}},@@ -13618,11 +16092,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMsWithEmbed",- "handler": "getBlockDOMsWithEmbed",- "body": "json",+ "path": "/api/block/getDocHeadingLevelTransaction",+ "handler": "getDocHeadingLevelTransaction",+ "body": "structJSON","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/DocHeadingLevelRequestInput"},"response": {"anyOf": [@@ -13638,10 +16112,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "$ref": "#/$defs/DocHeadingLevelData"},{"type": "null"@@ -13703,11 +16174,11 @@},{"method": "POST",- "path": "/api/block/getBlockDefIDsByRefText",- "handler": "getBlockDefIDsByRefText",+ "path": "/api/block/getDocInfo",+ "handler": "getDocInfo","body": "json","request": {- "$ref": "#/$defs/RefTextQueryRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -13721,7 +16192,14 @@]},"data": {- "$ref": "#/$defs/RefDefsData"+ "anyOf": [+ {+ "$ref": "#/$defs/DocInfo"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -13778,11 +16256,11 @@},{"method": "POST",- "path": "/api/block/getBlockIndex",- "handler": "getBlockIndex",+ "path": "/api/block/getDocsInfo",+ "handler": "getDocsInfo","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/DocsInfoRequestInput"},"response": {"anyOf": [@@ -13796,7 +16274,24 @@]},"data": {- "type": "integer"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/DocInfo"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -13853,11 +16348,11 @@},{"method": "POST",- "path": "/api/block/getBlockInfo",- "handler": "getBlockInfo",+ "path": "/api/block/getHeadingChildrenDOM",+ "handler": "getHeadingChildrenDOM","body": "json","request": {- "$ref": "#/$defs/BlockInfoRequestInput"+ "$ref": "#/$defs/HeadingChildrenRequestInput"},"response": {"anyOf": [@@ -13871,7 +16366,7 @@]},"data": {- "$ref": "#/$defs/BlockInfoData"+ "type": "string"},"msg": {"type": "string"@@ -13890,8 +16385,7 @@"code": {"type": "integer","enum": [- -1,- 3+ -1]},"data": {@@ -13910,9 +16404,6 @@},{"type": "null"- },- {- "type": "string"}]},@@ -13932,11 +16423,11 @@},{"method": "POST",- "path": "/api/block/getBlockKramdown",- "handler": "getBlockKramdown",+ "path": "/api/block/getHeadingChildrenIDs",+ "handler": "getHeadingChildrenIDs","body": "json","request": {- "$ref": "#/$defs/BlockKramdownRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -13950,7 +16441,17 @@]},"data": {- "$ref": "#/$defs/BlockKramdownData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -14007,11 +16508,11 @@},{"method": "POST",- "path": "/api/block/getBlockKramdowns",- "handler": "getBlockKramdowns",+ "path": "/api/block/getHeadingDeleteTransaction",+ "handler": "getHeadingDeleteTransaction","body": "json","request": {- "$ref": "#/$defs/BlocksKramdownRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -14027,10 +16528,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -14092,11 +16590,11 @@},{"method": "POST",- "path": "/api/block/getBlockRelevantIDs",- "handler": "getBlockRelevantIDs",+ "path": "/api/block/getHeadingFoldTransaction",+ "handler": "getHeadingFoldTransaction","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/HeadingFoldRequestInput"},"response": {"anyOf": [@@ -14110,7 +16608,14 @@]},"data": {- "$ref": "#/$defs/BlockRelevantData"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -14167,11 +16672,11 @@},{"method": "POST",- "path": "/api/block/getBlockSiblingID",- "handler": "getBlockSiblingID",+ "path": "/api/block/getHeadingInsertTransaction",+ "handler": "getHeadingInsertTransaction","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -14185,7 +16690,14 @@]},"data": {- "$ref": "#/$defs/BlockSiblingData"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -14242,11 +16754,11 @@},{"method": "POST",- "path": "/api/block/getBlockTreeInfos",- "handler": "getBlockTreeInfos",+ "path": "/api/block/getHeadingLevelTransaction",+ "handler": "getHeadingLevelTransaction","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/HeadingLevelRequestInput"},"response": {"anyOf": [@@ -14262,17 +16774,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "anyOf": [- {- "$ref": "#/$defs/BlockTreeInfo"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -14334,11 +16836,11 @@},{"method": "POST",- "path": "/api/block/getBlocksIndexes",- "handler": "getBlocksIndexes",+ "path": "/api/block/getOrderedListContinueStart",+ "handler": "getOrderedListContinueStart","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -14352,17 +16854,7 @@]},"data": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "integer"- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/OrderedListStartData"},"msg": {"type": "string"@@ -14419,11 +16911,11 @@},{"method": "POST",- "path": "/api/block/getBlocksWordCount",- "handler": "getBlocksWordCount",- "body": "json",+ "path": "/api/block/getRecentUpdatedBlocks",+ "handler": "getRecentUpdatedBlocks",+ "body": "none","request": {- "$ref": "#/$defs/BlocksWordCountRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -14437,7 +16929,24 @@]},"data": {- "$ref": "#/$defs/WordCountData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -14494,11 +17003,11 @@},{"method": "POST",- "path": "/api/block/getChildBlocks",- "handler": "getChildBlocks",+ "path": "/api/block/getRefIDs",+ "handler": "getRefIDs","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/RefIDsRequestInput"},"response": {"anyOf": [@@ -14512,17 +17021,7 @@]},"data": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/ChildBlock"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/RefIDsData"},"msg": {"type": "string"@@ -14579,11 +17078,11 @@},{"method": "POST",- "path": "/api/block/getContentWordCount",- "handler": "getContentWordCount",+ "path": "/api/block/getRefIDsByFileAnnotationID",+ "handler": "getRefIDsByFileAnnotationID","body": "json","request": {- "$ref": "#/$defs/ContentWordCountRequestInput"+ "$ref": "#/$defs/FileAnnotationRefRequestInput"},"response": {"anyOf": [@@ -14597,7 +17096,7 @@]},"data": {- "$ref": "#/$defs/WordCountData"+ "$ref": "#/$defs/RefDefsData"},"msg": {"type": "string"@@ -14654,11 +17153,11 @@},{"method": "POST",- "path": "/api/block/getDOMText",- "handler": "getDOMText",+ "path": "/api/block/getRefText",+ "handler": "getRefText","body": "json","request": {- "$ref": "#/$defs/DOMTextRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -14729,11 +17228,11 @@},{"method": "POST",- "path": "/api/block/getDocBlocksOrders",- "handler": "getDocBlocksOrders",+ "path": "/api/block/getTailChildBlocks",+ "handler": "getTailChildBlocks","body": "json","request": {- "$ref": "#/$defs/DocOrdersRequestInput"+ "$ref": "#/$defs/TailChildBlocksRequestInput"},"response": {"anyOf": [@@ -14747,17 +17246,17 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/ChildBlock"+ },+ {+ "type": "null"}- },- {- "type": "null"- }- ]+ ]+ }},"msg": {"type": "string"@@ -14814,11 +17313,11 @@},{"method": "POST",- "path": "/api/block/getDocHeadingLevelTransaction",- "handler": "getDocHeadingLevelTransaction",- "body": "structJSON",+ "path": "/api/block/getTreeStat",+ "handler": "getTreeStat",+ "body": "json","request": {- "$ref": "#/$defs/DocHeadingLevelRequestInput"+ "$ref": "#/$defs/TreeStatRequestInput"},"response": {"anyOf": [@@ -14832,14 +17331,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/DocHeadingLevelData"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/TreeStatData"},"msg": {"type": "string"@@ -14896,8 +17388,8 @@},{"method": "POST",- "path": "/api/block/getDocInfo",- "handler": "getDocInfo",+ "path": "/api/block/getUnfoldedParentID",+ "handler": "getUnfoldedParentID","body": "json","request": {"$ref": "#/$defs/BlockQueryRequestInput"@@ -14914,14 +17406,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/DocInfo"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/UnfoldedParentData"},"msg": {"type": "string"@@ -14978,11 +17463,11 @@},{"method": "POST",- "path": "/api/block/getDocsInfo",- "handler": "getDocsInfo",+ "path": "/api/block/insertBlock",+ "handler": "insertBlock","body": "json","request": {- "$ref": "#/$defs/DocsInfoRequestInput"+ "$ref": "#/$defs/InsertBlockRequestInput"},"response": {"anyOf": [@@ -15002,7 +17487,7 @@"items": {"anyOf": [{- "$ref": "#/$defs/DocInfo"+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -15070,11 +17555,11 @@},{"method": "POST",- "path": "/api/block/getHeadingChildrenDOM",- "handler": "getHeadingChildrenDOM",+ "path": "/api/block/moveBlock",+ "handler": "moveBlock","body": "json","request": {- "$ref": "#/$defs/HeadingChildrenRequestInput"+ "$ref": "#/$defs/MoveBlockRequestInput"},"response": {"anyOf": [@@ -15088,7 +17573,7 @@]},"data": {- "type": "string"+ "type": "null"},"msg": {"type": "string"@@ -15145,11 +17630,11 @@},{"method": "POST",- "path": "/api/block/getHeadingChildrenIDs",- "handler": "getHeadingChildrenIDs",+ "path": "/api/block/moveOutlineHeading",+ "handler": "moveOutlineHeading","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/MoveBlockRequestInput"},"response": {"anyOf": [@@ -15167,7 +17652,14 @@{"type": "array","items": {- "type": "string"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]}},{@@ -15230,11 +17722,11 @@},{"method": "POST",- "path": "/api/block/getHeadingDeleteTransaction",- "handler": "getHeadingDeleteTransaction",+ "path": "/api/block/prependBlock",+ "handler": "prependBlock","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/PrependBlockRequestInput"},"response": {"anyOf": [@@ -15250,7 +17742,17 @@"data": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -15312,11 +17814,11 @@},{"method": "POST",- "path": "/api/block/getHeadingFoldTransaction",- "handler": "getHeadingFoldTransaction",+ "path": "/api/block/prependDailyNoteBlock",+ "handler": "prependDailyNoteBlock","body": "json","request": {- "$ref": "#/$defs/HeadingFoldRequestInput"+ "$ref": "#/$defs/DailyNoteBlockRequestInput"},"response": {"anyOf": [@@ -15332,7 +17834,17 @@"data": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -15394,11 +17906,11 @@},{"method": "POST",- "path": "/api/block/getHeadingInsertTransaction",- "handler": "getHeadingInsertTransaction",+ "path": "/api/block/setBlockReminder",+ "handler": "setBlockReminder","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/BlockReminderRequestInput"},"response": {"anyOf": [@@ -15412,14 +17924,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -15476,11 +17981,11 @@},{"method": "POST",- "path": "/api/block/getHeadingLevelTransaction",- "handler": "getHeadingLevelTransaction",+ "path": "/api/block/swapBlockRef",+ "handler": "swapBlockRef","body": "json","request": {- "$ref": "#/$defs/HeadingLevelRequestInput"+ "$ref": "#/$defs/SwapBlockRefRequestInput"},"response": {"anyOf": [@@ -15494,14 +17999,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -15558,11 +18056,11 @@},{"method": "POST",- "path": "/api/block/getOrderedListContinueStart",- "handler": "getOrderedListContinueStart",+ "path": "/api/block/transferBlockRef",+ "handler": "transferBlockRef","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/TransferBlockRefRequestInput"},"response": {"anyOf": [@@ -15576,7 +18074,7 @@]},"data": {- "$ref": "#/$defs/OrderedListStartData"+ "type": "null"},"msg": {"type": "string"@@ -15633,11 +18131,11 @@},{"method": "POST",- "path": "/api/block/getRecentUpdatedBlocks",- "handler": "getRecentUpdatedBlocks",- "body": "none",+ "path": "/api/block/unfoldBlock",+ "handler": "unfoldBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -15651,24 +18149,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchBlock"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -15725,11 +18206,11 @@},{"method": "POST",- "path": "/api/block/getRefIDs",- "handler": "getRefIDs",+ "path": "/api/block/updateBlock",+ "handler": "updateBlock","body": "json","request": {- "$ref": "#/$defs/RefIDsRequestInput"+ "$ref": "#/$defs/UpdateBlockRequestInput"},"response": {"anyOf": [@@ -15743,7 +18224,24 @@]},"data": {- "$ref": "#/$defs/RefIDsData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -15800,11 +18298,11 @@},{"method": "POST",- "path": "/api/block/getRefIDsByFileAnnotationID",- "handler": "getRefIDsByFileAnnotationID",+ "path": "/api/block/updateTaskListItemMarker",+ "handler": "updateTaskListItemMarker","body": "json","request": {- "$ref": "#/$defs/FileAnnotationRefRequestInput"+ "$ref": "#/$defs/TaskListMarkerRequestInput"},"response": {"anyOf": [@@ -15818,7 +18316,24 @@]},"data": {- "$ref": "#/$defs/RefDefsData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -15875,11 +18390,11 @@},{"method": "POST",- "path": "/api/block/getRefText",- "handler": "getRefText",- "body": "json",+ "path": "/api/bookmark/getBookmark",+ "handler": "getBookmark",+ "body": "none","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -15893,7 +18408,24 @@]},"data": {- "type": "string"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Bookmark"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -15950,11 +18482,11 @@},{"method": "POST",- "path": "/api/block/getTailChildBlocks",- "handler": "getTailChildBlocks",+ "path": "/api/bookmark/removeBookmark",+ "handler": "removeBookmark","body": "json","request": {- "$ref": "#/$defs/TailChildBlocksRequestInput"+ "$ref": "#/$defs/RemoveBookmarkRequestInput"},"response": {"anyOf": [@@ -15968,17 +18500,7 @@]},"data": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/ChildBlock"- },- {- "type": "null"- }- ]- }+ "type": "null"},"msg": {"type": "string"@@ -16035,11 +18557,11 @@},{"method": "POST",- "path": "/api/block/getTreeStat",- "handler": "getTreeStat",+ "path": "/api/bookmark/renameBookmark",+ "handler": "renameBookmark","body": "json","request": {- "$ref": "#/$defs/TreeStatRequestInput"+ "$ref": "#/$defs/RenameBookmarkRequestInput"},"response": {"anyOf": [@@ -16053,7 +18575,7 @@]},"data": {- "$ref": "#/$defs/TreeStatData"+ "type": "null"},"msg": {"type": "string"@@ -16110,11 +18632,11 @@},{"method": "POST",- "path": "/api/block/getUnfoldedParentID",- "handler": "getUnfoldedParentID",+ "path": "/api/broadcast/getChannelInfo",+ "handler": "getChannelInfo","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BroadcastChannelRequestInput"},"response": {"anyOf": [@@ -16128,7 +18650,7 @@]},"data": {- "$ref": "#/$defs/UnfoldedParentData"+ "$ref": "#/$defs/BroadcastChannelData"},"msg": {"type": "string"@@ -16185,11 +18707,11 @@},{"method": "POST",- "path": "/api/block/insertBlock",- "handler": "insertBlock",- "body": "json",+ "path": "/api/broadcast/getChannels",+ "handler": "getChannels",+ "body": "none","request": {- "$ref": "#/$defs/InsertBlockRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -16203,24 +18725,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/BroadcastChannelsData"},"msg": {"type": "string"@@ -16277,11 +18782,11 @@},{"method": "POST",- "path": "/api/block/moveBlock",- "handler": "moveBlock",+ "path": "/api/broadcast/postMessage",+ "handler": "postMessage","body": "json","request": {- "$ref": "#/$defs/MoveBlockRequestInput"+ "$ref": "#/$defs/BroadcastMessageRequestInput"},"response": {"anyOf": [@@ -16295,7 +18800,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BroadcastChannelData"},"msg": {"type": "string"@@ -16314,7 +18819,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -16352,11 +18858,25 @@},{"method": "POST",- "path": "/api/block/moveOutlineHeading",- "handler": "moveOutlineHeading",- "body": "json",+ "path": "/api/broadcast/publish",+ "handler": "broadcastPublish",+ "body": "multipart","request": {- "$ref": "#/$defs/MoveBlockRequestInput"+ "type": "object",+ "additionalProperties": {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "string",+ "format": "binary"+ }+ ]+ }+ }},"response": {"anyOf": [@@ -16369,25 +18889,8 @@0]},- "data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "data": {+ "$ref": "#/$defs/BroadcastPublishData"},"msg": {"type": "string"@@ -16406,7 +18909,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -16444,11 +18948,11 @@},{"method": "POST",- "path": "/api/block/prependBlock",- "handler": "prependBlock",+ "path": "/api/clipboard/cleanupRichText",+ "handler": "cleanupRichText","body": "json","request": {- "$ref": "#/$defs/PrependBlockRequestInput"+ "$ref": "#/$defs/CleanupRichTextRequestInput"},"response": {"anyOf": [@@ -16462,24 +18966,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -16536,11 +19023,11 @@},{"method": "POST",- "path": "/api/block/prependDailyNoteBlock",- "handler": "prependDailyNoteBlock",+ "path": "/api/clipboard/prepareRichText",+ "handler": "prepareRichText","body": "json","request": {- "$ref": "#/$defs/DailyNoteBlockRequestInput"+ "$ref": "#/$defs/PrepareRichTextRequestInput"},"response": {"anyOf": [@@ -16556,17 +19043,7 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/RichClipboardPrepared"},{"type": "null"@@ -16628,11 +19105,11 @@},{"method": "POST",- "path": "/api/block/setBlockReminder",- "handler": "setBlockReminder",- "body": "json",+ "path": "/api/clipboard/readFilePaths",+ "handler": "readFilePaths",+ "body": "none","request": {- "$ref": "#/$defs/BlockReminderRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -16646,7 +19123,10 @@]},"data": {- "type": "null"+ "type": "array",+ "items": {+ "$ref": "#/$defs/ClipboardFile"+ }},"msg": {"type": "string"@@ -16703,11 +19183,11 @@},{"method": "POST",- "path": "/api/block/swapBlockRef",- "handler": "swapBlockRef",+ "path": "/api/clipboard/writeFilePath",+ "handler": "writeFilePath","body": "json","request": {- "$ref": "#/$defs/SwapBlockRefRequestInput"+ "$ref": "#/$defs/ClipboardPathRequestInput"},"response": {"anyOf": [@@ -16778,11 +19258,11 @@},{"method": "POST",- "path": "/api/block/transferBlockRef",- "handler": "transferBlockRef",- "body": "json",+ "path": "/api/cloud/getCloudSpace",+ "handler": "getCloudSpace",+ "body": "none","request": {- "$ref": "#/$defs/TransferBlockRefRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -16796,7 +19276,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CloudSpaceData"},"msg": {"type": "string"@@ -16815,7 +19295,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -16853,11 +19334,11 @@},{"method": "POST",- "path": "/api/block/unfoldBlock",- "handler": "unfoldBlock",+ "path": "/api/cloud/setCloudReminder",+ "handler": "setCloudReminder","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/CloudReminderRequestInput"},"response": {"anyOf": [@@ -16928,11 +19409,11 @@},{"method": "POST",- "path": "/api/block/updateBlock",- "handler": "updateBlock",+ "path": "/api/convert/pandoc",+ "handler": "pandoc","body": "json","request": {- "$ref": "#/$defs/UpdateBlockRequestInput"+ "$ref": "#/$defs/PandocRequestInput"},"response": {"anyOf": [@@ -16946,24 +19427,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/PandocData"},"msg": {"type": "string"@@ -17020,11 +19484,11 @@},{"method": "POST",- "path": "/api/block/updateTaskListItemMarker",- "handler": "updateTaskListItemMarker",+ "path": "/api/file/copyFile",+ "handler": "copyFile","body": "json","request": {- "$ref": "#/$defs/TaskListMarkerRequestInput"+ "$ref": "#/$defs/CopyFileRequestInput"},"response": {"anyOf": [@@ -17038,24 +19502,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -17074,7 +19521,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ -2]},"data": {@@ -17112,53 +19560,17 @@},{"method": "POST",- "path": "/api/bookmark/getBookmark",- "handler": "getBookmark",- "body": "none",+ "path": "/api/file/getFile",+ "handler": "getFile",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/FilePathRequestInput"},"response": {"anyOf": [{- "type": "object",- "properties": {- "code": {- "type": "integer",- "enum": [- 0- ]- },- "data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Bookmark"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]- },- "msg": {- "type": "string"- }- },- "required": [- "code",- "msg",- "data"- ],- "additionalProperties": false+ "type": "string",+ "format": "binary"},{"type": "object",@@ -17166,7 +19578,13 @@"code": {"type": "integer","enum": [- -1+ -1,+ -3,+ 403,+ 404,+ 409,+ 500,+ 503]},"data": {@@ -17200,15 +19618,17 @@"additionalProperties": true}]- }+ },+ "output": "binary",+ "errorStatus": 202},{"method": "POST",- "path": "/api/bookmark/removeBookmark",- "handler": "removeBookmark",+ "path": "/api/file/getUniqueFilename",+ "handler": "getUniqueFilename","body": "json","request": {- "$ref": "#/$defs/RemoveBookmarkRequestInput"+ "$ref": "#/$defs/FilePathRequestInput"},"response": {"anyOf": [@@ -17222,7 +19642,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/FilePathData"},"msg": {"type": "string"@@ -17241,7 +19661,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ -3]},"data": {@@ -17279,11 +19700,11 @@},{"method": "POST",- "path": "/api/bookmark/renameBookmark",- "handler": "renameBookmark",+ "path": "/api/file/globalCopyFiles",+ "handler": "globalCopyFiles","body": "json","request": {- "$ref": "#/$defs/RenameBookmarkRequestInput"+ "$ref": "#/$defs/CopyFilesRequestInput"},"response": {"anyOf": [@@ -17316,7 +19737,10 @@"code": {"type": "integer","enum": [- -1+ -1,+ -2,+ -3,+ 403]},"data": {@@ -17354,11 +19778,11 @@},{"method": "POST",- "path": "/api/broadcast/getChannelInfo",- "handler": "getChannelInfo",- "body": "json",+ "path": "/api/file/putFile",+ "handler": "putFile",+ "body": "form","request": {- "$ref": "#/$defs/BroadcastChannelRequestInput"+ "$ref": "#/$defs/PutFileRequestInput"},"response": {"anyOf": [@@ -17372,7 +19796,7 @@]},"data": {- "$ref": "#/$defs/BroadcastChannelData"+ "type": "null"},"msg": {"type": "string"@@ -17391,7 +19815,11 @@"code": {"type": "integer","enum": [- -1+ -1,+ -3,+ 400,+ 403,+ 500]},"data": {@@ -17429,11 +19857,11 @@},{"method": "POST",- "path": "/api/broadcast/getChannels",- "handler": "getChannels",- "body": "none",+ "path": "/api/file/readDir",+ "handler": "readDir",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ReadDirectoryRequestInput"},"response": {"anyOf": [@@ -17447,7 +19875,10 @@]},"data": {- "$ref": "#/$defs/BroadcastChannelsData"+ "type": "array",+ "items": {+ "$ref": "#/$defs/DirectoryEntry"+ }},"msg": {"type": "string"@@ -17466,7 +19897,12 @@"code": {"type": "integer","enum": [- -1+ -1,+ -3,+ 403,+ 404,+ 409,+ 500]},"data": {@@ -17504,11 +19940,11 @@},{"method": "POST",- "path": "/api/broadcast/postMessage",- "handler": "postMessage",+ "path": "/api/file/removeFile",+ "handler": "removeFile","body": "json","request": {- "$ref": "#/$defs/BroadcastMessageRequestInput"+ "$ref": "#/$defs/RemoveFileRequestInput"},"response": {"anyOf": [@@ -17522,7 +19958,7 @@]},"data": {- "$ref": "#/$defs/BroadcastChannelData"+ "type": "null"},"msg": {"type": "string"@@ -17542,7 +19978,10 @@"type": "integer","enum": [-1,- 1+ -3,+ 403,+ 404,+ 500]},"data": {@@ -17580,25 +20019,11 @@},{"method": "POST",- "path": "/api/broadcast/publish",- "handler": "broadcastPublish",- "body": "multipart",+ "path": "/api/file/renameFile",+ "handler": "renameFile",+ "body": "json","request": {- "type": "object",- "additionalProperties": {- "type": "array",- "items": {- "anyOf": [- {- "type": "string"- },- {- "type": "string",- "format": "binary"- }- ]- }- }+ "$ref": "#/$defs/RenameFileRequestInput"},"response": {"anyOf": [@@ -17612,7 +20037,7 @@]},"data": {- "$ref": "#/$defs/BroadcastPublishData"+ "type": "null"},"msg": {"type": "string"@@ -17632,7 +20057,11 @@"type": "integer","enum": [-1,- 1+ -3,+ 403,+ 404,+ 409,+ 500]},"data": {@@ -17670,11 +20099,11 @@},{"method": "POST",- "path": "/api/clipboard/cleanupRichText",- "handler": "cleanupRichText",+ "path": "/api/file/workspaceCopyFiles",+ "handler": "workspaceCopyFiles","body": "json","request": {- "$ref": "#/$defs/CleanupRichTextRequestInput"+ "$ref": "#/$defs/CopyFilesRequestInput"},"response": {"anyOf": [@@ -17707,7 +20136,10 @@"code": {"type": "integer","enum": [- -1+ -1,+ -2,+ -3,+ 403]},"data": {@@ -17745,11 +20177,11 @@},{"method": "POST",- "path": "/api/clipboard/prepareRichText",- "handler": "prepareRichText",- "body": "json",+ "path": "/api/filetree/getPinnedDocs",+ "handler": "getPinnedDocs",+ "body": "none","request": {- "$ref": "#/$defs/PrepareRichTextRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -17763,14 +20195,10 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/RichClipboardPrepared"- },- {- "type": "null"- }- ]+ "type": "array",+ "items": {+ "$ref": "#/$defs/PinnedDoc"+ }},"msg": {"type": "string"@@ -17827,11 +20255,11 @@},{"method": "POST",- "path": "/api/clipboard/readFilePaths",- "handler": "readFilePaths",- "body": "none",+ "path": "/api/filetree/updatePinnedDocs",+ "handler": "updatePinnedDocs",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/UpdatePinnedDocsRequestInput"},"response": {"anyOf": [@@ -17845,10 +20273,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/$defs/ClipboardFile"- }+ "type": "null"},"msg": {"type": "string"@@ -17905,11 +20330,11 @@},{"method": "POST",- "path": "/api/clipboard/writeFilePath",- "handler": "writeFilePath",+ "path": "/api/format/autoSpace",+ "handler": "autoSpace","body": "json","request": {- "$ref": "#/$defs/ClipboardPathRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {"anyOf": [@@ -17980,11 +20405,11 @@},{"method": "POST",- "path": "/api/cloud/getCloudSpace",- "handler": "getCloudSpace",- "body": "none",+ "path": "/api/format/netAssets2LocalAssets",+ "handler": "netAssets2LocalAssets",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {"anyOf": [@@ -17998,7 +20423,7 @@]},"data": {- "$ref": "#/$defs/CloudSpaceData"+ "type": "null"},"msg": {"type": "string"@@ -18017,8 +20442,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -18056,11 +20480,11 @@},{"method": "POST",- "path": "/api/cloud/setCloudReminder",- "handler": "setCloudReminder",+ "path": "/api/format/netImg2LocalAssets",+ "handler": "netImg2LocalAssets","body": "json","request": {- "$ref": "#/$defs/CloudReminderRequestInput"+ "$ref": "#/$defs/NetImageAssetsRequestInput"},"response": {"anyOf": [@@ -18131,11 +20555,11 @@},{"method": "POST",- "path": "/api/convert/pandoc",- "handler": "pandoc",+ "path": "/api/graph/getGraph",+ "handler": "getGraph","body": "json","request": {- "$ref": "#/$defs/PandocRequestInput"+ "$ref": "#/$defs/GlobalGraphRequestInput"},"response": {"anyOf": [@@ -18149,7 +20573,14 @@]},"data": {- "$ref": "#/$defs/PandocData"+ "anyOf": [+ {+ "$ref": "#/$defs/GlobalGraphResult"+ },+ {+ "$ref": "#/$defs/GraphCorrelation"+ }+ ]},"msg": {"type": "string"@@ -18187,6 +20618,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/GlobalGraphResult"+ },+ {+ "$ref": "#/$defs/GraphCorrelation"+ }+ ]}]},@@ -18206,11 +20647,11 @@},{"method": "POST",- "path": "/api/file/copyFile",- "handler": "copyFile",+ "path": "/api/graph/getLocalGraph",+ "handler": "getLocalGraph","body": "json","request": {- "$ref": "#/$defs/CopyFileRequestInput"+ "$ref": "#/$defs/LocalGraphRequestInput"},"response": {"anyOf": [@@ -18224,7 +20665,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/LocalGraphResult"+ },+ {+ "$ref": "#/$defs/GraphCorrelation"+ }+ ]},"msg": {"type": "string"@@ -18243,8 +20691,7 @@"code": {"type": "integer","enum": [- -1,- -2+ -1]},"data": {@@ -18263,6 +20710,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/LocalGraphResult"+ },+ {+ "$ref": "#/$defs/GraphCorrelation"+ }+ ]}]},@@ -18282,17 +20739,36 @@},{"method": "POST",- "path": "/api/file/getFile",- "handler": "getFile",- "body": "json",+ "path": "/api/graph/resetGraph",+ "handler": "resetGraph",+ "body": "none","request": {- "$ref": "#/$defs/FilePathRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [{- "type": "string",- "format": "binary"+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "$ref": "#/$defs/ResetGraphData"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false},{"type": "object",@@ -18300,13 +20776,7 @@"code": {"type": "integer","enum": [- -1,- -3,- 403,- 404,- 409,- 500,- 503+ -1]},"data": {@@ -18340,17 +20810,15 @@"additionalProperties": true}]- },- "output": "binary",- "errorStatus": 202+ }},{"method": "POST",- "path": "/api/file/getUniqueFilename",- "handler": "getUniqueFilename",- "body": "json",+ "path": "/api/graph/resetLocalGraph",+ "handler": "resetLocalGraph",+ "body": "none","request": {- "$ref": "#/$defs/FilePathRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -18364,7 +20832,7 @@]},"data": {- "$ref": "#/$defs/FilePathData"+ "$ref": "#/$defs/ResetLocalGraphData"},"msg": {"type": "string"@@ -18383,8 +20851,7 @@"code": {"type": "integer","enum": [- -1,- -3+ -1]},"data": {@@ -18422,11 +20889,11 @@},{"method": "POST",- "path": "/api/file/globalCopyFiles",- "handler": "globalCopyFiles",+ "path": "/api/graph/setGraphConf",+ "handler": "setGraphConf","body": "json","request": {- "$ref": "#/$defs/CopyFilesRequestInput"+ "$ref": "#/$defs/SetGraphConfRequestInput"},"response": {"anyOf": [@@ -18440,7 +20907,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/GlobalGraphConf"+ },+ {+ "$ref": "#/$defs/LocalGraphConf"+ }+ ]},"msg": {"type": "string"@@ -18459,10 +20933,7 @@"code": {"type": "integer","enum": [- -1,- -2,- -3,- 403+ -1]},"data": {@@ -18500,11 +20971,11 @@},{"method": "POST",- "path": "/api/file/putFile",- "handler": "putFile",- "body": "form",+ "path": "/api/history/clearWorkspaceHistory",+ "handler": "clearWorkspaceHistory",+ "body": "none","request": {- "$ref": "#/$defs/PutFileRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -18536,12 +21007,8 @@"properties": {"code": {"type": "integer",- "enum": [- -1,- -3,- 400,- 403,- 500+ "enum": [+ -1]},"data": {@@ -18579,11 +21046,11 @@},{"method": "POST",- "path": "/api/file/readDir",- "handler": "readDir",+ "path": "/api/history/createAssetHistory",+ "handler": "createAssetHistory","body": "json","request": {- "$ref": "#/$defs/ReadDirectoryRequestInput"+ "$ref": "#/$defs/CreateAssetHistoryRequestInput"},"response": {"anyOf": [@@ -18597,10 +21064,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/$defs/DirectoryEntry"- }+ "type": "null"},"msg": {"type": "string"@@ -18619,12 +21083,7 @@"code": {"type": "integer","enum": [- -1,- -3,- 403,- 404,- 409,- 500+ -1]},"data": {@@ -18662,11 +21121,11 @@},{"method": "POST",- "path": "/api/file/removeFile",- "handler": "removeFile",+ "path": "/api/history/createDocHistory",+ "handler": "createDocHistory","body": "json","request": {- "$ref": "#/$defs/RemoveFileRequestInput"+ "$ref": "#/$defs/CreateDocHistoryRequestInput"},"response": {"anyOf": [@@ -18699,11 +21158,7 @@"code": {"type": "integer","enum": [- -1,- -3,- 403,- 404,- 500+ -1]},"data": {@@ -18741,11 +21196,11 @@},{"method": "POST",- "path": "/api/file/renameFile",- "handler": "renameFile",+ "path": "/api/history/diffDocVersions",+ "handler": "diffDocVersions","body": "json","request": {- "$ref": "#/$defs/RenameFileRequestInput"+ "$ref": "#/$defs/DiffDocVersionsRequestInput"},"response": {"anyOf": [@@ -18759,7 +21214,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/DocVersionDiffResult"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -18778,12 +21240,7 @@"code": {"type": "integer","enum": [- -1,- -3,- 403,- 404,- 409,- 500+ -1]},"data": {@@ -18821,11 +21278,11 @@},{"method": "POST",- "path": "/api/file/workspaceCopyFiles",- "handler": "workspaceCopyFiles",+ "path": "/api/history/getDocHistoryContent",+ "handler": "getDocHistoryContent","body": "json","request": {- "$ref": "#/$defs/CopyFilesRequestInput"+ "$ref": "#/$defs/DocHistoryContentRequestInput"},"response": {"anyOf": [@@ -18839,7 +21296,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/DocHistoryContentData"},"msg": {"type": "string"@@ -18858,10 +21315,7 @@"code": {"type": "integer","enum": [- -1,- -2,- -3,- 403+ -1]},"data": {@@ -18899,11 +21353,11 @@},{"method": "POST",- "path": "/api/filetree/getPinnedDocs",- "handler": "getPinnedDocs",- "body": "none",+ "path": "/api/history/getHistoryItems",+ "handler": "getHistoryItems",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/HistoryItemsRequestInput"},"response": {"anyOf": [@@ -18917,10 +21371,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/$defs/PinnedDoc"- }+ "$ref": "#/$defs/HistoryItemsData"},"msg": {"type": "string"@@ -18977,11 +21428,11 @@},{"method": "POST",- "path": "/api/filetree/updatePinnedDocs",- "handler": "updatePinnedDocs",- "body": "json",+ "path": "/api/history/getNotebookHistory",+ "handler": "getNotebookHistory",+ "body": "none","request": {- "$ref": "#/$defs/UpdatePinnedDocsRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -18995,7 +21446,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotebookHistoryData"},"msg": {"type": "string"@@ -19052,11 +21503,11 @@},{"method": "POST",- "path": "/api/format/autoSpace",- "handler": "autoSpace",- "body": "json",+ "path": "/api/history/reindexHistory",+ "handler": "reindexHistory",+ "body": "none","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -19127,11 +21578,11 @@},{"method": "POST",- "path": "/api/format/netAssets2LocalAssets",- "handler": "netAssets2LocalAssets",+ "path": "/api/history/rollbackAssetsHistory",+ "handler": "rollbackAssetsHistory","body": "json","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/HistoryPathRequestInput"},"response": {"anyOf": [@@ -19202,11 +21653,11 @@},{"method": "POST",- "path": "/api/format/netImg2LocalAssets",- "handler": "netImg2LocalAssets",+ "path": "/api/history/rollbackAttributeViewHistory",+ "handler": "rollbackAttributeViewHistory","body": "json","request": {- "$ref": "#/$defs/NetImageAssetsRequestInput"+ "$ref": "#/$defs/HistoryPathRequestInput"},"response": {"anyOf": [@@ -19277,11 +21728,11 @@},{"method": "POST",- "path": "/api/graph/getGraph",- "handler": "getGraph",+ "path": "/api/history/rollbackDocHistory",+ "handler": "rollbackDocHistory","body": "json","request": {- "$ref": "#/$defs/GlobalGraphRequestInput"+ "$ref": "#/$defs/HistoryPathRequestInput"},"response": {"anyOf": [@@ -19295,14 +21746,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/GlobalGraphResult"- },- {- "$ref": "#/$defs/GraphCorrelation"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -19340,16 +21784,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/GlobalGraphResult"- },- {- "$ref": "#/$defs/GraphCorrelation"- }- ]}]},@@ -19369,11 +21803,11 @@},{"method": "POST",- "path": "/api/graph/getLocalGraph",- "handler": "getLocalGraph",+ "path": "/api/history/rollbackNotebookHistory",+ "handler": "rollbackNotebookHistory","body": "json","request": {- "$ref": "#/$defs/LocalGraphRequestInput"+ "$ref": "#/$defs/HistoryPathRequestInput"},"response": {"anyOf": [@@ -19387,14 +21821,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/LocalGraphResult"- },- {- "$ref": "#/$defs/GraphCorrelation"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -19432,16 +21859,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/LocalGraphResult"- },- {- "$ref": "#/$defs/GraphCorrelation"- }- ]}]},@@ -19461,11 +21878,11 @@},{"method": "POST",- "path": "/api/graph/resetGraph",- "handler": "resetGraph",- "body": "none",+ "path": "/api/history/searchHistory",+ "handler": "searchHistory",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/SearchHistoryRequestInput"},"response": {"anyOf": [@@ -19479,7 +21896,7 @@]},"data": {- "$ref": "#/$defs/ResetGraphData"+ "$ref": "#/$defs/SearchHistoryData"},"msg": {"type": "string"@@ -19536,11 +21953,11 @@},{"method": "POST",- "path": "/api/graph/resetLocalGraph",- "handler": "resetLocalGraph",- "body": "none",+ "path": "/api/import/cancelImportSY",+ "handler": "cancelImportSY",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ImportTokenRequestInput"},"response": {"anyOf": [@@ -19554,7 +21971,7 @@]},"data": {- "$ref": "#/$defs/ResetLocalGraphData"+ "type": "null"},"msg": {"type": "string"@@ -19611,11 +22028,11 @@},{"method": "POST",- "path": "/api/graph/setGraphConf",- "handler": "setGraphConf",+ "path": "/api/import/cancelObsidianVaultTask",+ "handler": "cancelObsidianVaultTask","body": "json","request": {- "$ref": "#/$defs/SetGraphConfRequestInput"+ "$ref": "#/$defs/ObsidianTaskRequestInput"},"response": {"anyOf": [@@ -19631,10 +22048,10 @@"data": {"anyOf": [{- "$ref": "#/$defs/GlobalGraphConf"+ "$ref": "#/$defs/ObsidianVaultTask"},{- "$ref": "#/$defs/LocalGraphConf"+ "type": "null"}]},@@ -19674,6 +22091,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/ObsidianVaultTask"+ },+ {+ "type": "null"+ }+ ]}]},@@ -19693,11 +22120,11 @@},{"method": "POST",- "path": "/api/history/clearWorkspaceHistory",- "handler": "clearWorkspaceHistory",- "body": "none",+ "path": "/api/import/continueImportSY",+ "handler": "continueImportSY",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ContinueImportSYRequestInput"},"response": {"anyOf": [@@ -19711,7 +22138,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/ImportDocumentData"},"msg": {"type": "string"@@ -19768,11 +22195,11 @@},{"method": "POST",- "path": "/api/history/createAssetHistory",- "handler": "createAssetHistory",+ "path": "/api/import/getObsidianVaultTask",+ "handler": "getObsidianVaultTask","body": "json","request": {- "$ref": "#/$defs/CreateAssetHistoryRequestInput"+ "$ref": "#/$defs/ObsidianTaskRequestInput"},"response": {"anyOf": [@@ -19786,7 +22213,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ObsidianVaultTask"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -19843,11 +22277,11 @@},{"method": "POST",- "path": "/api/history/createDocHistory",- "handler": "createDocHistory",- "body": "json",+ "path": "/api/import/importData",+ "handler": "importData",+ "body": "multipart","request": {- "$ref": "#/$defs/CreateDocHistoryRequestInput"+ "$ref": "#/$defs/ImportDataRequestInput"},"response": {"anyOf": [@@ -19918,33 +22352,26 @@},{"method": "POST",- "path": "/api/history/diffDocVersions",- "handler": "diffDocVersions",- "body": "json",+ "path": "/api/import/importSY",+ "handler": "importSY",+ "body": "multipart","request": {- "$ref": "#/$defs/DiffDocVersionsRequestInput"+ "$ref": "#/$defs/ImportSYRequestInput"},"response": {"anyOf": [{"type": "object",- "properties": {- "code": {- "type": "integer",- "enum": [- 0- ]- },- "data": {- "anyOf": [- {- "$ref": "#/$defs/DocVersionDiffResult"- },- {- "type": "null"- }+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0]},+ "data": {+ "type": "null"+ },"msg": {"type": "string"}@@ -20000,11 +22427,11 @@},{"method": "POST",- "path": "/api/history/getDocHistoryContent",- "handler": "getDocHistoryContent",- "body": "json",+ "path": "/api/import/importSYAuto",+ "handler": "importSYAuto",+ "body": "multipart","request": {- "$ref": "#/$defs/DocHistoryContentRequestInput"+ "$ref": "#/$defs/ImportSYRequestInput"},"response": {"anyOf": [@@ -20018,7 +22445,17 @@]},"data": {- "$ref": "#/$defs/DocHistoryContentData"+ "anyOf": [+ {+ "$ref": "#/$defs/ImportAutoDocument"+ },+ {+ "$ref": "#/$defs/ImportAutoNotebook"+ },+ {+ "$ref": "#/$defs/ImportAutoNotebooks"+ }+ ]},"msg": {"type": "string"@@ -20056,6 +22493,19 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/ImportAutoDocument"+ },+ {+ "$ref": "#/$defs/ImportAutoNotebook"+ },+ {+ "$ref": "#/$defs/ImportAutoNotebooks"+ }+ ]}]},@@ -20075,11 +22525,11 @@},{"method": "POST",- "path": "/api/history/getHistoryItems",- "handler": "getHistoryItems",- "body": "json",+ "path": "/api/import/importSYNotebook",+ "handler": "importSYNotebook",+ "body": "multipart","request": {- "$ref": "#/$defs/HistoryItemsRequestInput"+ "$ref": "#/$defs/ImportDataRequestInput"},"response": {"anyOf": [@@ -20093,7 +22543,14 @@]},"data": {- "$ref": "#/$defs/HistoryItemsData"+ "anyOf": [+ {+ "$ref": "#/$defs/ImportedNotebook"+ },+ {+ "$ref": "#/$defs/ImportedNotebooks"+ }+ ]},"msg": {"type": "string"@@ -20150,11 +22607,11 @@},{"method": "POST",- "path": "/api/history/getNotebookHistory",- "handler": "getNotebookHistory",- "body": "none",+ "path": "/api/import/importStdMd",+ "handler": "importStdMd",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ImportMarkdownRequestInput"},"response": {"anyOf": [@@ -20168,7 +22625,7 @@]},"data": {- "$ref": "#/$defs/NotebookHistoryData"+ "type": "null"},"msg": {"type": "string"@@ -20225,11 +22682,11 @@},{"method": "POST",- "path": "/api/history/reindexHistory",- "handler": "reindexHistory",- "body": "none",+ "path": "/api/import/importZipMd",+ "handler": "importZipMd",+ "body": "multipart","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ImportZipMarkdownRequestInput"},"response": {"anyOf": [@@ -20300,11 +22757,11 @@},{"method": "POST",- "path": "/api/history/rollbackAssetsHistory",- "handler": "rollbackAssetsHistory",+ "path": "/api/import/startObsidianVaultAnalysis",+ "handler": "startObsidianVaultAnalysis","body": "json","request": {- "$ref": "#/$defs/HistoryPathRequestInput"+ "$ref": "#/$defs/ObsidianAnalysisRequestInput"},"response": {"anyOf": [@@ -20318,7 +22775,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ObsidianVaultTask"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -20375,11 +22839,11 @@},{"method": "POST",- "path": "/api/history/rollbackAttributeViewHistory",- "handler": "rollbackAttributeViewHistory",+ "path": "/api/import/startObsidianVaultImport",+ "handler": "startObsidianVaultImport","body": "json","request": {- "$ref": "#/$defs/HistoryPathRequestInput"+ "$ref": "#/$defs/ObsidianImportRequestInput"},"response": {"anyOf": [@@ -20393,7 +22857,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ObsidianVaultTask"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -20450,11 +22921,11 @@},{"method": "POST",- "path": "/api/history/rollbackDocHistory",- "handler": "rollbackDocHistory",+ "path": "/api/inbox/getShorthand",+ "handler": "getShorthand","body": "json","request": {- "$ref": "#/$defs/HistoryPathRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {"anyOf": [@@ -20468,7 +22939,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/Shorthand"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -20487,7 +22965,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -20525,11 +23004,11 @@},{"method": "POST",- "path": "/api/history/rollbackNotebookHistory",- "handler": "rollbackNotebookHistory",+ "path": "/api/inbox/getShorthands",+ "handler": "getShorthands","body": "json","request": {- "$ref": "#/$defs/HistoryPathRequestInput"+ "$ref": "#/$defs/ShorthandsRequestInput"},"response": {"anyOf": [@@ -20543,7 +23022,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ShorthandsData"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -20562,7 +23048,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -20600,11 +23087,11 @@},{"method": "POST",- "path": "/api/history/searchHistory",- "handler": "searchHistory",+ "path": "/api/inbox/removeShorthands",+ "handler": "removeShorthands","body": "json","request": {- "$ref": "#/$defs/SearchHistoryRequestInput"+ "$ref": "#/$defs/RemoveShorthandsRequestInput"},"response": {"anyOf": [@@ -20618,7 +23105,7 @@]},"data": {- "$ref": "#/$defs/SearchHistoryData"+ "type": "null"},"msg": {"type": "string"@@ -20637,7 +23124,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -20675,11 +23163,11 @@},{"method": "POST",- "path": "/api/import/cancelImportSY",- "handler": "cancelImportSY",+ "path": "/api/lute/copyStdMarkdown",+ "handler": "copyStdMarkdown","body": "json","request": {- "$ref": "#/$defs/ImportTokenRequestInput"+ "$ref": "#/$defs/CopyStdMarkdownRequestInput"},"response": {"anyOf": [@@ -20693,7 +23181,7 @@]},"data": {- "type": "null"+ "type": "string"},"msg": {"type": "string"@@ -20750,11 +23238,11 @@},{"method": "POST",- "path": "/api/import/cancelObsidianVaultTask",- "handler": "cancelObsidianVaultTask",+ "path": "/api/lute/html2BlockDOM",+ "handler": "html2BlockDOM","body": "json","request": {- "$ref": "#/$defs/ObsidianTaskRequestInput"+ "$ref": "#/$defs/HTMLClipboardRequestInput"},"response": {"anyOf": [@@ -20770,10 +23258,10 @@"data": {"anyOf": [{- "$ref": "#/$defs/ObsidianVaultTask"+ "type": "string"},{- "type": "null"+ "$ref": "#/$defs/HTMLClipboardPreflight"}]},@@ -20813,16 +23301,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/ObsidianVaultTask"- },- {- "type": "null"- }- ]}]},@@ -20842,11 +23320,11 @@},{"method": "POST",- "path": "/api/import/continueImportSY",- "handler": "continueImportSY",+ "path": "/api/lute/md2html",+ "handler": "md2HTML","body": "json","request": {- "$ref": "#/$defs/ContinueImportSYRequestInput"+ "$ref": "#/$defs/MarkdownHTMLRequestInput"},"response": {"anyOf": [@@ -20860,7 +23338,7 @@]},"data": {- "$ref": "#/$defs/ImportDocumentData"+ "$ref": "#/$defs/HTMLData"},"msg": {"type": "string"@@ -20917,11 +23395,11 @@},{"method": "POST",- "path": "/api/import/getObsidianVaultTask",- "handler": "getObsidianVaultTask",+ "path": "/api/lute/spinBlockDOM",+ "handler": "spinBlockDOM","body": "json","request": {- "$ref": "#/$defs/ObsidianTaskRequestInput"+ "$ref": "#/$defs/DOMTextRequestInput"},"response": {"anyOf": [@@ -20935,14 +23413,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ObsidianVaultTask"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/DOMData"},"msg": {"type": "string"@@ -20961,7 +23432,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 413]},"data": {@@ -20999,11 +23471,11 @@},{"method": "POST",- "path": "/api/import/importData",- "handler": "importData",- "body": "multipart",+ "path": "/api/lute/wpsPresentation2BlockDOM",+ "handler": "wpsPresentation2BlockDOM",+ "body": "json","request": {- "$ref": "#/$defs/ImportDataRequestInput"+ "$ref": "#/$defs/WPSPresentationRequestInput"},"response": {"anyOf": [@@ -21017,7 +23489,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/WPSPresentationData"},"msg": {"type": "string"@@ -21055,6 +23527,9 @@},{"type": "null"+ },+ {+ "$ref": "#/$defs/WPSPresentationData"}]},@@ -21074,11 +23549,11 @@},{"method": "POST",- "path": "/api/import/importSY",- "handler": "importSY",- "body": "multipart",+ "path": "/api/notebook/changeMasterPassword",+ "handler": "changeMasterPassword",+ "body": "json","request": {- "$ref": "#/$defs/ImportSYRequestInput"+ "$ref": "#/$defs/ChangeMasterPasswordRequestInput"},"response": {"anyOf": [@@ -21149,36 +23624,26 @@},{"method": "POST",- "path": "/api/import/importSYAuto",- "handler": "importSYAuto",- "body": "multipart",+ "path": "/api/notebook/changeSortNotebook",+ "handler": "changeSortNotebook",+ "body": "json","request": {- "$ref": "#/$defs/ImportSYRequestInput"+ "$ref": "#/$defs/ChangeSortNotebookRequestInput"},"response": {"anyOf": [- {- "type": "object",- "properties": {- "code": {- "type": "integer",- "enum": [- 0- ]- },- "data": {- "anyOf": [- {- "$ref": "#/$defs/ImportAutoDocument"- },- {- "$ref": "#/$defs/ImportAutoNotebook"- },- {- "$ref": "#/$defs/ImportAutoNotebooks"- }+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0]},+ "data": {+ "type": "null"+ },"msg": {"type": "string"}@@ -21215,19 +23680,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/ImportAutoDocument"- },- {- "$ref": "#/$defs/ImportAutoNotebook"- },- {- "$ref": "#/$defs/ImportAutoNotebooks"- }- ]}]},@@ -21247,11 +23699,11 @@},{"method": "POST",- "path": "/api/import/importSYNotebook",- "handler": "importSYNotebook",- "body": "multipart",+ "path": "/api/notebook/closeNotebook",+ "handler": "closeNotebook",+ "body": "json","request": {- "$ref": "#/$defs/ImportDataRequestInput"+ "$ref": "#/$defs/CloseNotebookRequestInput"},"response": {"anyOf": [@@ -21265,14 +23717,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ImportedNotebook"- },- {- "$ref": "#/$defs/ImportedNotebooks"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -21329,11 +23774,11 @@},{"method": "POST",- "path": "/api/import/importStdMd",- "handler": "importStdMd",+ "path": "/api/notebook/createEncryptedNotebook",+ "handler": "createEncryptedNotebook","body": "json","request": {- "$ref": "#/$defs/ImportMarkdownRequestInput"+ "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"},"response": {"anyOf": [@@ -21347,7 +23792,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CreateNotebookData"},"msg": {"type": "string"@@ -21404,11 +23849,11 @@},{"method": "POST",- "path": "/api/import/importZipMd",- "handler": "importZipMd",- "body": "multipart",+ "path": "/api/notebook/createNotebook",+ "handler": "createNotebook",+ "body": "json","request": {- "$ref": "#/$defs/ImportZipMarkdownRequestInput"+ "$ref": "#/$defs/CreateNotebookRequestInput"},"response": {"anyOf": [@@ -21422,7 +23867,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CreateNotebookData"},"msg": {"type": "string"@@ -21479,11 +23924,11 @@},{"method": "POST",- "path": "/api/import/startObsidianVaultAnalysis",- "handler": "startObsidianVaultAnalysis",- "body": "json",+ "path": "/api/notebook/disableEncryptedNotebooks",+ "handler": "disableEncryptedNotebooks",+ "body": "none","request": {- "$ref": "#/$defs/ObsidianAnalysisRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -21497,14 +23942,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ObsidianVaultTask"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -21561,11 +23999,11 @@},{"method": "POST",- "path": "/api/import/startObsidianVaultImport",- "handler": "startObsidianVaultImport",+ "path": "/api/notebook/enableEncryptedNotebooks",+ "handler": "enableEncryptedNotebooks","body": "json","request": {- "$ref": "#/$defs/ObsidianImportRequestInput"+ "$ref": "#/$defs/NotebookPasswordRequestInput"},"response": {"anyOf": [@@ -21579,14 +24017,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ObsidianVaultTask"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -21643,11 +24074,11 @@},{"method": "POST",- "path": "/api/inbox/getShorthand",- "handler": "getShorthand",- "body": "json",+ "path": "/api/notebook/exportNotebookCryptoBackup",+ "handler": "exportNotebookCryptoBackup",+ "body": "none","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -21661,14 +24092,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/Shorthand"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/NotebookCryptoBackupData"},"msg": {"type": "string"@@ -21687,8 +24111,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -21726,11 +24149,11 @@},{"method": "POST",- "path": "/api/inbox/getShorthands",- "handler": "getShorthands",- "body": "json",+ "path": "/api/notebook/getEncryptedNotebookStatus",+ "handler": "getEncryptedNotebookStatus",+ "body": "none","request": {- "$ref": "#/$defs/ShorthandsRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -21744,14 +24167,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ShorthandsData"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/EncryptedNotebookStatusData"},"msg": {"type": "string"@@ -21770,8 +24186,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -21809,11 +24224,11 @@},{"method": "POST",- "path": "/api/inbox/removeShorthands",- "handler": "removeShorthands",+ "path": "/api/notebook/getNotebookConf",+ "handler": "getNotebookConf","body": "json","request": {- "$ref": "#/$defs/RemoveShorthandsRequestInput"+ "$ref": "#/$defs/CloseNotebookRequestInput"},"response": {"anyOf": [@@ -21827,7 +24242,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotebookConfData"},"msg": {"type": "string"@@ -21846,8 +24261,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -21885,11 +24299,11 @@},{"method": "POST",- "path": "/api/lute/copyStdMarkdown",- "handler": "copyStdMarkdown",+ "path": "/api/notebook/getNotebookInfo",+ "handler": "getNotebookInfo","body": "json","request": {- "$ref": "#/$defs/CopyStdMarkdownRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -21903,7 +24317,7 @@]},"data": {- "type": "string"+ "$ref": "#/$defs/NotebookInfoData"},"msg": {"type": "string"@@ -21960,11 +24374,11 @@},{"method": "POST",- "path": "/api/lute/html2BlockDOM",- "handler": "html2BlockDOM",- "body": "json",+ "path": "/api/notebook/importNotebookCryptoBackup",+ "handler": "importNotebookCryptoBackup",+ "body": "multipart","request": {- "$ref": "#/$defs/HTMLClipboardRequestInput"+ "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"},"response": {"anyOf": [@@ -21978,14 +24392,7 @@]},"data": {- "anyOf": [- {- "type": "string"- },- {- "$ref": "#/$defs/HTMLClipboardPreflight"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -22042,11 +24449,11 @@},{"method": "POST",- "path": "/api/lute/md2html",- "handler": "md2HTML",+ "path": "/api/notebook/lockNotebook",+ "handler": "lockNotebook","body": "json","request": {- "$ref": "#/$defs/MarkdownHTMLRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -22060,7 +24467,7 @@]},"data": {- "$ref": "#/$defs/HTMLData"+ "type": "null"},"msg": {"type": "string"@@ -22117,11 +24524,11 @@},{"method": "POST",- "path": "/api/lute/spinBlockDOM",- "handler": "spinBlockDOM",- "body": "json",+ "path": "/api/notebook/lsNotebooks",+ "handler": "lsNotebooks",+ "body": "legacyOptional","request": {- "$ref": "#/$defs/DOMTextRequestInput"+ "$ref": "#/$defs/ListNotebooksRequestInput"},"response": {"anyOf": [@@ -22135,7 +24542,14 @@]},"data": {- "$ref": "#/$defs/DOMData"+ "anyOf": [+ {+ "$ref": "#/$defs/ListNotebooksData"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -22154,8 +24568,7 @@"code": {"type": "integer","enum": [- -1,- 413+ -1]},"data": {@@ -22193,11 +24606,11 @@},{"method": "POST",- "path": "/api/lute/wpsPresentation2BlockDOM",- "handler": "wpsPresentation2BlockDOM",+ "path": "/api/notebook/openNotebook",+ "handler": "openNotebook","body": "json","request": {- "$ref": "#/$defs/WPSPresentationRequestInput"+ "$ref": "#/$defs/OpenNotebookRequestInput"},"response": {"anyOf": [@@ -22211,7 +24624,7 @@]},"data": {- "$ref": "#/$defs/WPSPresentationData"+ "type": "null"},"msg": {"type": "string"@@ -22249,9 +24662,6 @@},{"type": "null"- },- {- "$ref": "#/$defs/WPSPresentationData"}]},@@ -22271,11 +24681,11 @@},{"method": "POST",- "path": "/api/notebook/changeMasterPassword",- "handler": "changeMasterPassword",+ "path": "/api/notebook/removeNotebook",+ "handler": "removeNotebook","body": "json","request": {- "$ref": "#/$defs/ChangeMasterPasswordRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -22346,11 +24756,11 @@},{"method": "POST",- "path": "/api/notebook/changeSortNotebook",- "handler": "changeSortNotebook",+ "path": "/api/notebook/renameNotebook",+ "handler": "renameNotebook","body": "json","request": {- "$ref": "#/$defs/ChangeSortNotebookRequestInput"+ "$ref": "#/$defs/RenameNotebookRequestInput"},"response": {"anyOf": [@@ -22421,11 +24831,11 @@},{"method": "POST",- "path": "/api/notebook/closeNotebook",- "handler": "closeNotebook",- "body": "json",+ "path": "/api/notebook/reorder",+ "handler": "reorderNotebooks",+ "body": "structJSON","request": {- "$ref": "#/$defs/CloseNotebookRequestInput"+ "$ref": "#/$defs/ReorderNotebooksRequestInput"},"response": {"anyOf": [@@ -22439,7 +24849,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ReorderData"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -22477,6 +24894,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/ReorderData"+ },+ {+ "type": "null"+ }+ ]}]},@@ -22496,11 +24923,11 @@},{"method": "POST",- "path": "/api/notebook/createEncryptedNotebook",- "handler": "createEncryptedNotebook",+ "path": "/api/notebook/setNotebookConf",+ "handler": "setNotebookConf","body": "json","request": {- "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"+ "$ref": "#/$defs/SetNotebookConfRequestInput"},"response": {"anyOf": [@@ -22513,9 +24940,16 @@0]},- "data": {- "$ref": "#/$defs/CreateNotebookData"- },+ "data": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookConf"+ },+ {+ "type": "null"+ }+ ]+ },"msg": {"type": "string"}@@ -22571,11 +25005,11 @@},{"method": "POST",- "path": "/api/notebook/createNotebook",- "handler": "createNotebook",+ "path": "/api/notebook/setNotebookCryptoAutoLock",+ "handler": "setNotebookCryptoAutoLock","body": "json","request": {- "$ref": "#/$defs/CreateNotebookRequestInput"+ "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"},"response": {"anyOf": [@@ -22589,7 +25023,7 @@]},"data": {- "$ref": "#/$defs/CreateNotebookData"+ "type": "null"},"msg": {"type": "string"@@ -22646,11 +25080,11 @@},{"method": "POST",- "path": "/api/notebook/disableEncryptedNotebooks",- "handler": "disableEncryptedNotebooks",- "body": "none",+ "path": "/api/notebook/setNotebookIcon",+ "handler": "setNotebookIcon",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/SetNotebookIconRequestInput"},"response": {"anyOf": [@@ -22721,11 +25155,11 @@},{"method": "POST",- "path": "/api/notebook/enableEncryptedNotebooks",- "handler": "enableEncryptedNotebooks",- "body": "json",+ "path": "/api/notebook/touchEncryptedNotebooks",+ "handler": "touchEncryptedNotebooks",+ "body": "none","request": {- "$ref": "#/$defs/NotebookPasswordRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -22796,11 +25230,11 @@},{"method": "POST",- "path": "/api/notebook/exportNotebookCryptoBackup",- "handler": "exportNotebookCryptoBackup",- "body": "none",+ "path": "/api/notebook/unlockAndOpenNotebook",+ "handler": "unlockAndOpenNotebook",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/UnlockNotebookRequestInput"},"response": {"anyOf": [@@ -22814,7 +25248,7 @@]},"data": {- "$ref": "#/$defs/NotebookCryptoBackupData"+ "type": "null"},"msg": {"type": "string"@@ -22871,11 +25305,11 @@},{"method": "POST",- "path": "/api/notebook/getEncryptedNotebookStatus",- "handler": "getEncryptedNotebookStatus",- "body": "none",+ "path": "/api/notebook/unlockNotebook",+ "handler": "unlockNotebook",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/UnlockNotebookRequestInput"},"response": {"anyOf": [@@ -22889,7 +25323,7 @@]},"data": {- "$ref": "#/$defs/EncryptedNotebookStatusData"+ "type": "null"},"msg": {"type": "string"@@ -22946,11 +25380,11 @@},{"method": "POST",- "path": "/api/notebook/getNotebookConf",- "handler": "getNotebookConf",+ "path": "/api/notification/pushErrMsg",+ "handler": "pushErrMsg","body": "json","request": {- "$ref": "#/$defs/CloseNotebookRequestInput"+ "$ref": "#/$defs/NotificationRequestInput"},"response": {"anyOf": [@@ -22964,7 +25398,7 @@]},"data": {- "$ref": "#/$defs/NotebookConfData"+ "$ref": "#/$defs/NotificationData"},"msg": {"type": "string"@@ -23021,11 +25455,11 @@},{"method": "POST",- "path": "/api/notebook/getNotebookInfo",- "handler": "getNotebookInfo",+ "path": "/api/notification/pushMsg",+ "handler": "pushMsg","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/NotificationRequestInput"},"response": {"anyOf": [@@ -23039,7 +25473,7 @@]},"data": {- "$ref": "#/$defs/NotebookInfoData"+ "$ref": "#/$defs/NotificationData"},"msg": {"type": "string"@@ -23096,11 +25530,11 @@},{"method": "POST",- "path": "/api/notebook/importNotebookCryptoBackup",- "handler": "importNotebookCryptoBackup",- "body": "multipart",+ "path": "/api/outline/getDocHeadingNumbers",+ "handler": "getDocHeadingNumbers",+ "body": "json","request": {- "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"+ "$ref": "#/$defs/HeadingNumbersRequestInput"},"response": {"anyOf": [@@ -23114,7 +25548,17 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -23133,7 +25577,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23171,11 +25616,11 @@},{"method": "POST",- "path": "/api/notebook/lockNotebook",- "handler": "lockNotebook",+ "path": "/api/outline/getDocOutline",+ "handler": "getDocOutline","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/OutlineRequestInput"},"response": {"anyOf": [@@ -23189,7 +25634,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchPath"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -23208,7 +25670,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23246,11 +25709,11 @@},{"method": "POST",- "path": "/api/notebook/lsNotebooks",- "handler": "lsNotebooks",- "body": "legacyOptional",+ "path": "/api/petal/loadPetals",+ "handler": "loadPetals",+ "body": "json","request": {- "$ref": "#/$defs/ListNotebooksRequestInput"+ "$ref": "#/$defs/LoadPetalsRequestInput"},"response": {"anyOf": [@@ -23266,7 +25729,17 @@"data": {"anyOf": [{- "$ref": "#/$defs/ListNotebooksData"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Petal"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -23328,11 +25801,11 @@},{"method": "POST",- "path": "/api/notebook/openNotebook",- "handler": "openNotebook",+ "path": "/api/petal/setPetalEnabled",+ "handler": "setPetalEnabled","body": "json","request": {- "$ref": "#/$defs/OpenNotebookRequestInput"+ "$ref": "#/$defs/SetPetalEnabledRequestInput"},"response": {"anyOf": [@@ -23346,7 +25819,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/Petal"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -23403,11 +25883,11 @@},{"method": "POST",- "path": "/api/notebook/removeNotebook",- "handler": "removeNotebook",+ "path": "/api/petal/setPetalPublishEnabled",+ "handler": "setPetalPublishEnabled","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/SetPetalPublishEnabledRequestInput"},"response": {"anyOf": [@@ -23421,7 +25901,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/Petal"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -23478,11 +25965,11 @@},{"method": "POST",- "path": "/api/notebook/renameNotebook",- "handler": "renameNotebook",+ "path": "/api/query/sql",+ "handler": "SQL","body": "json","request": {- "$ref": "#/$defs/RenameNotebookRequestInput"+ "$ref": "#/$defs/SQLQueryRequestInput"},"response": {"anyOf": [@@ -23496,16 +25983,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},@@ -23515,7 +26036,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23553,11 +26075,11 @@},{"method": "POST",- "path": "/api/notebook/reorder",- "handler": "reorderNotebooks",- "body": "structJSON",+ "path": "/api/ref/getBacklink2",+ "handler": "getBacklink2",+ "body": "json","request": {- "$ref": "#/$defs/ReorderNotebooksRequestInput"+ "$ref": "#/$defs/BacklinkListRequestInput"},"response": {"anyOf": [@@ -23573,7 +26095,10 @@"data": {"anyOf": [{- "$ref": "#/$defs/ReorderData"+ "$ref": "#/$defs/BacklinkList"+ },+ {+ "$ref": "#/$defs/BacklinkRefDefs"},{"type": "null"@@ -23597,7 +26122,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23620,7 +26146,10 @@{"anyOf": [{- "$ref": "#/$defs/ReorderData"+ "$ref": "#/$defs/BacklinkList"+ },+ {+ "$ref": "#/$defs/BacklinkRefDefs"},{"type": "null"@@ -23645,11 +26174,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookConf",- "handler": "setNotebookConf",+ "path": "/api/ref/getBacklinkDoc",+ "handler": "getBacklinkDoc","body": "json","request": {- "$ref": "#/$defs/SetNotebookConfRequestInput"+ "$ref": "#/$defs/BacklinkDocumentRequestInput"},"response": {"anyOf": [@@ -23663,14 +26192,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/NotebookConf"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/BacklinkContextData"},"msg": {"type": "string"@@ -23689,7 +26211,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23727,11 +26250,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookCryptoAutoLock",- "handler": "setNotebookCryptoAutoLock",+ "path": "/api/ref/getBackmentionDoc",+ "handler": "getBackmentionDoc","body": "json","request": {- "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"+ "$ref": "#/$defs/BackmentionDocumentRequestInput"},"response": {"anyOf": [@@ -23745,7 +26268,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BacklinkContextData"},"msg": {"type": "string"@@ -23764,7 +26287,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -23802,11 +26326,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookIcon",- "handler": "setNotebookIcon",+ "path": "/api/ref/refreshBacklink",+ "handler": "refreshBacklink","body": "json","request": {- "$ref": "#/$defs/SetNotebookIconRequestInput"+ "$ref": "#/$defs/RefreshBacklinkRequestInput"},"response": {"anyOf": [@@ -23877,8 +26401,8 @@},{"method": "POST",- "path": "/api/notebook/touchEncryptedNotebooks",- "handler": "touchEncryptedNotebooks",+ "path": "/api/repo/checkSnapshot",+ "handler": "checkSnapshot","body": "none","request": {"$ref": "#/$defs/EmptyRequestInput"@@ -23895,7 +26419,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CheckSnapshotData"},"msg": {"type": "string"@@ -23952,11 +26476,11 @@},{"method": "POST",- "path": "/api/notebook/unlockAndOpenNotebook",- "handler": "unlockAndOpenNotebook",+ "path": "/api/repo/createSnapshot",+ "handler": "createSnapshot","body": "json","request": {- "$ref": "#/$defs/UnlockNotebookRequestInput"+ "$ref": "#/$defs/CreateSnapshotRequestInput"},"response": {"anyOf": [@@ -23970,7 +26494,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CreateSnapshotData"},"msg": {"type": "string"@@ -24027,11 +26551,11 @@},{"method": "POST",- "path": "/api/notebook/unlockNotebook",- "handler": "unlockNotebook",+ "path": "/api/repo/setSnapshotMemo",+ "handler": "setSnapshotMemo","body": "json","request": {- "$ref": "#/$defs/UnlockNotebookRequestInput"+ "$ref": "#/$defs/SetSnapshotMemoRequestInput"},"response": {"anyOf": [@@ -24102,11 +26626,11 @@},{"method": "POST",- "path": "/api/notification/pushErrMsg",- "handler": "pushErrMsg",+ "path": "/api/search/findReplace",+ "handler": "findReplace","body": "json","request": {- "$ref": "#/$defs/NotificationRequestInput"+ "$ref": "#/$defs/FindReplaceRequestInput"},"response": {"anyOf": [@@ -24120,7 +26644,7 @@]},"data": {- "$ref": "#/$defs/NotificationData"+ "type": "null"},"msg": {"type": "string"@@ -24139,7 +26663,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 1]},"data": {@@ -24177,11 +26702,11 @@},{"method": "POST",- "path": "/api/notification/pushMsg",- "handler": "pushMsg",+ "path": "/api/search/fullTextSearchAssetContent",+ "handler": "fullTextSearchAssetContent","body": "json","request": {- "$ref": "#/$defs/NotificationRequestInput"+ "$ref": "#/$defs/SearchAssetContentRequestInput"},"response": {"anyOf": [@@ -24195,7 +26720,7 @@]},"data": {- "$ref": "#/$defs/NotificationData"+ "$ref": "#/$defs/SearchAssetContentData"},"msg": {"type": "string"@@ -24252,11 +26777,11 @@},{"method": "POST",- "path": "/api/outline/getDocHeadingNumbers",- "handler": "getDocHeadingNumbers",+ "path": "/api/search/fullTextSearchBlock",+ "handler": "fullTextSearchBlock","body": "json","request": {- "$ref": "#/$defs/HeadingNumbersRequestInput"+ "$ref": "#/$defs/FullTextSearchBlockRequestInput"},"response": {"anyOf": [@@ -24272,10 +26797,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "$ref": "#/$defs/FullTextSearchBlockData"},{"type": "null"@@ -24299,8 +26821,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -24338,11 +26859,11 @@},{"method": "POST",- "path": "/api/outline/getDocOutline",- "handler": "getDocOutline",+ "path": "/api/search/getAssetContent",+ "handler": "getAssetContent","body": "json","request": {- "$ref": "#/$defs/OutlineRequestInput"+ "$ref": "#/$defs/AssetContentRequestInput"},"response": {"anyOf": [@@ -24356,24 +26877,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchPath"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/AssetContentData"},"msg": {"type": "string"@@ -24392,8 +26896,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -24431,11 +26934,11 @@},{"method": "POST",- "path": "/api/petal/loadPetals",- "handler": "loadPetals",+ "path": "/api/search/getAssetContentByPath",+ "handler": "getAssetContentByPath","body": "json","request": {- "$ref": "#/$defs/LoadPetalsRequestInput"+ "$ref": "#/$defs/SearchPathRequestInput"},"response": {"anyOf": [@@ -24449,24 +26952,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Petal"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/AssetContentData"},"msg": {"type": "string"@@ -24523,11 +27009,11 @@},{"method": "POST",- "path": "/api/petal/setPetalEnabled",- "handler": "setPetalEnabled",+ "path": "/api/search/getEmbedBlock",+ "handler": "getEmbedBlock","body": "json","request": {- "$ref": "#/$defs/SetPetalEnabledRequestInput"+ "$ref": "#/$defs/GetEmbedBlockRequestInput"},"response": {"anyOf": [@@ -24541,14 +27027,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/Petal"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/EmbedBlocksData"},"msg": {"type": "string"@@ -24605,11 +27084,11 @@},{"method": "POST",- "path": "/api/petal/setPetalPublishEnabled",- "handler": "setPetalPublishEnabled",+ "path": "/api/search/listInvalidBlockRefs",+ "handler": "listInvalidBlockRefs","body": "json","request": {- "$ref": "#/$defs/SetPetalPublishEnabledRequestInput"+ "$ref": "#/$defs/SearchPageRequestInput"},"response": {"anyOf": [@@ -24623,14 +27102,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/Petal"- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/SearchBlocksData"},"msg": {"type": "string"@@ -24687,11 +27159,11 @@},{"method": "POST",- "path": "/api/query/sql",- "handler": "SQL",+ "path": "/api/search/removeTemplate",+ "handler": "removeTemplate","body": "json","request": {- "$ref": "#/$defs/SQLQueryRequestInput"+ "$ref": "#/$defs/SearchPathRequestInput"},"response": {"anyOf": [@@ -24705,50 +27177,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},@@ -24758,8 +27196,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -24797,11 +27234,11 @@},{"method": "POST",- "path": "/api/ref/getBacklink2",- "handler": "getBacklink2",+ "path": "/api/search/searchAsset",+ "handler": "searchAsset","body": "json","request": {- "$ref": "#/$defs/BacklinkListRequestInput"+ "$ref": "#/$defs/SearchAssetRequestInput"},"response": {"anyOf": [@@ -24817,10 +27254,17 @@"data": {"anyOf": [{- "$ref": "#/$defs/BacklinkList"- },- {- "$ref": "#/$defs/BacklinkRefDefs"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchAsset"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -24844,8 +27288,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -24864,19 +27307,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/BacklinkList"- },- {- "$ref": "#/$defs/BacklinkRefDefs"- },- {- "type": "null"- }- ]}]},@@ -24896,11 +27326,11 @@},{"method": "POST",- "path": "/api/ref/getBacklinkDoc",- "handler": "getBacklinkDoc",+ "path": "/api/search/searchEmbedBlock",+ "handler": "searchEmbedBlock","body": "json","request": {- "$ref": "#/$defs/BacklinkDocumentRequestInput"+ "$ref": "#/$defs/SearchEmbedBlockRequestInput"},"response": {"anyOf": [@@ -24914,7 +27344,7 @@]},"data": {- "$ref": "#/$defs/BacklinkContextData"+ "$ref": "#/$defs/EmbedBlocksData"},"msg": {"type": "string"@@ -24933,8 +27363,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -24972,11 +27401,11 @@},{"method": "POST",- "path": "/api/ref/getBackmentionDoc",- "handler": "getBackmentionDoc",+ "path": "/api/search/searchRefBlock",+ "handler": "searchRefBlock","body": "json","request": {- "$ref": "#/$defs/BackmentionDocumentRequestInput"+ "$ref": "#/$defs/SearchRefBlockRequestInput"},"response": {"anyOf": [@@ -24990,7 +27419,14 @@]},"data": {- "$ref": "#/$defs/BacklinkContextData"+ "anyOf": [+ {+ "$ref": "#/$defs/SearchRefResult"+ },+ {+ "$ref": "#/$defs/SearchRefCorrelation"+ }+ ]},"msg": {"type": "string"@@ -25009,8 +27445,7 @@"code": {"type": "integer","enum": [- -1,- 1+ -1]},"data": {@@ -25029,6 +27464,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchRefResult"+ },+ {+ "$ref": "#/$defs/SearchRefCorrelation"+ }+ ]}]},@@ -25048,11 +27493,11 @@},{"method": "POST",- "path": "/api/ref/refreshBacklink",- "handler": "refreshBacklink",+ "path": "/api/search/searchTag",+ "handler": "searchTag","body": "json","request": {- "$ref": "#/$defs/RefreshBacklinkRequestInput"+ "$ref": "#/$defs/SearchTagRequestInput"},"response": {"anyOf": [@@ -25066,7 +27511,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/SearchTagData"},"msg": {"type": "string"@@ -25123,11 +27568,11 @@},{"method": "POST",- "path": "/api/repo/checkSnapshot",- "handler": "checkSnapshot",- "body": "none",+ "path": "/api/search/searchTemplate",+ "handler": "searchTemplate",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/SearchKeywordRequestInput"},"response": {"anyOf": [@@ -25141,7 +27586,7 @@]},"data": {- "$ref": "#/$defs/CheckSnapshotData"+ "$ref": "#/$defs/SearchTemplateData"},"msg": {"type": "string"@@ -25198,11 +27643,11 @@},{"method": "POST",- "path": "/api/repo/createSnapshot",- "handler": "createSnapshot",+ "path": "/api/search/searchWidget",+ "handler": "searchWidget","body": "json","request": {- "$ref": "#/$defs/CreateSnapshotRequestInput"+ "$ref": "#/$defs/SearchKeywordRequestInput"},"response": {"anyOf": [@@ -25216,7 +27661,7 @@]},"data": {- "$ref": "#/$defs/CreateSnapshotData"+ "$ref": "#/$defs/SearchWidgetData"},"msg": {"type": "string"@@ -25273,11 +27718,11 @@},{"method": "POST",- "path": "/api/repo/setSnapshotMemo",- "handler": "setSnapshotMemo",+ "path": "/api/search/semanticSearchBlock",+ "handler": "semanticSearchBlock","body": "json","request": {- "$ref": "#/$defs/SetSnapshotMemoRequestInput"+ "$ref": "#/$defs/SearchBlockRequestInput"},"response": {"anyOf": [@@ -25291,7 +27736,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/SearchBlocksData"},"msg": {"type": "string"@@ -25348,11 +27793,11 @@},{"method": "POST",- "path": "/api/search/searchTag",- "handler": "searchTag",+ "path": "/api/search/updateEmbedBlock",+ "handler": "updateEmbedBlock","body": "json","request": {- "$ref": "#/$defs/SearchTagRequestInput"+ "$ref": "#/$defs/UpdateEmbedBlockRequestInput"},"response": {"anyOf": [@@ -25366,7 +27811,7 @@]},"data": {- "$ref": "#/$defs/SearchTagData"+ "type": "null"},"msg": {"type": "string"diff --git a/kernel/apicontract/search.go b/kernel/apicontract/search.gonew file mode 100644index 0000000000..efe49119b0--- /dev/null+++ b/kernel/apicontract/search.go@@ -0,0 +1,132 @@+package apicontract++type SearchPageRequest struct {+ Page *float64 `json:"page" api:"optional"`+ PageSize *float64 `json:"pageSize" api:"optional"`+}++func (r SearchPageRequest) Pagination() (page, pageSize int) {+ page, pageSize = 1, 32+ if r.Page != nil && int(*r.Page) > 0 {+ page = int(*r.Page)+ }+ if r.PageSize != nil && int(*r.PageSize) > 0 {+ pageSize = int(*r.PageSize)+ }+ return+}++type SearchBlocksData struct {+ Blocks []*SearchBlock `json:"blocks"`+ MatchedBlockCount int `json:"matchedBlockCount"`+ MatchedRootCount int `json:"matchedRootCount"`+ PageCount int `json:"pageCount"`+}++type UpdateEmbedBlockRequest struct {+ ID string `json:"id"`+ Content string `json:"content"`+}++type SearchKeywordRequest struct {+ K string `json:"k"`+}++type SearchPathRequest struct {+ Path string `json:"path"`+}++type SearchAssetRequest struct {+ K string `json:"k"`+ Exts []string `json:"exts" api:"optional,nullable"`+}++type SearchAsset struct {+ HName string `json:"hName"`+ Path string `json:"path"`+ Updated int64 `json:"updated"`+}++type SearchWidgetResult struct {+ Name string `json:"name"`+ Content string `json:"content"`+}++type SearchWidgetData struct {+ Widgets []*SearchWidgetResult `json:"widgets"`+ K string `json:"k"`+}++type SearchTemplateResult struct {+ Path string `json:"path"`+ RelativePath string `json:"relativePath"`+ Content string `json:"content"`+}++type SearchTemplateData struct {+ Templates []*SearchTemplateResult `json:"templates"`+ K string `json:"k"`+}++type AssetContent struct {+ ID string `json:"id"`+ Name string `json:"name"`+ Ext string `json:"ext"`+ Path string `json:"path"`+ Size int64 `json:"size"`+ HSize string `json:"hSize"`+ Updated int64 `json:"updated"`+ Content string `json:"content"`+}++type AssetContentRequest struct {+ ID string `json:"id"`+ Query string `json:"query"`+ QueryMethod float64 `json:"queryMethod"`+}++type AssetContentData struct {+ AssetContent *AssetContent `json:"assetContent"`+}++type SearchAssetContentRequest struct {+ SearchPageRequest+ Query string `json:"query" api:"optional,nullable"`+ Types map[string]bool `json:"types" api:"optional,nullable"`+ Method float64 `json:"method" api:"optional,nullable"`+ OrderBy float64 `json:"orderBy" api:"optional,nullable"`+}++type SearchAssetContentData struct {+ AssetContents []*AssetContent `json:"assetContents"`+ MatchedAssetCount int `json:"matchedAssetCount"`+ PageCount int `json:"pageCount"`+}++type EmbedBlockOptions struct {+ EmbedBlockID string `json:"embedBlockID"`+ HeadingMode float64 `json:"headingMode" api:"optional,nullable"`+ Breadcrumb bool `json:"breadcrumb" api:"optional,nullable"`+ Notebook string `json:"notebook" api:"optional,nullable,ignoretype"`+}++type GetEmbedBlockRequest struct {+ EmbedBlockOptions+ IncludeIDs []string `json:"includeIDs"`+}++type SearchEmbedBlockRequest struct {+ EmbedBlockOptions+ Stmt string `json:"stmt"`+ ExcludeIDs []*string `json:"excludeIDs"`+}++type EmbedBlock struct {+ Block *SearchBlock `json:"block"`+ BlockPaths []*BlockPath `json:"blockPaths"`+ AllowChildOperation bool `json:"allowChildOperation"`+}++type EmbedBlocksData struct {+ Blocks []*EmbedBlock `json:"blocks"`+}diff --git a/kernel/apicontract/search_query.go b/kernel/apicontract/search_query.gonew file mode 100644index 0000000000..c57ce571a9--- /dev/null+++ b/kernel/apicontract/search_query.go@@ -0,0 +1,133 @@+package apicontract++import (+ "encoding/json"+ "io"+ "reflect"+)++type SearchHeadingFilter struct {+ H1 bool `json:"h1" api:"optional,nullable"`+ H2 bool `json:"h2" api:"optional,nullable"`+ H3 bool `json:"h3" api:"optional,nullable"`+ H4 bool `json:"h4" api:"optional,nullable"`+ H5 bool `json:"h5" api:"optional,nullable"`+ H6 bool `json:"h6" api:"optional,nullable"`+}++type SearchListFilter struct {+ Ordered bool `json:"o" api:"optional,nullable"`+ Unordered bool `json:"u" api:"optional,nullable"`+ Task bool `json:"t" api:"optional,nullable"`+}++type SearchSubtypeFilter struct {+ Heading SearchHeadingFilter `json:"heading" api:"optional,nullable"`+ List SearchListFilter `json:"list" api:"optional,nullable"`+ ListItem SearchListFilter `json:"listItem" api:"optional,nullable"`+}++func (s *SearchSubtypeFilter) Selected() map[string]bool {+ if s == nil {+ return nil+ }+ result := map[string]bool{}+ for key, selected := range map[string]bool{+ "h1": s.Heading.H1, "h2": s.Heading.H2, "h3": s.Heading.H3,+ "h4": s.Heading.H4, "h5": s.Heading.H5, "h6": s.Heading.H6,+ "list:o": s.List.Ordered, "list:u": s.List.Unordered, "list:t": s.List.Task,+ "listItem:o": s.ListItem.Ordered, "listItem:u": s.ListItem.Unordered, "listItem:t": s.ListItem.Task,+ } {+ if selected {+ result[key] = true+ }+ }+ return result+}++type SearchBlockRequest struct {+ SearchAssetContentRequest+ Paths []string `json:"paths" api:"optional,nullable"`+ SubTypes *SearchSubtypeFilter `json:"subTypes" api:"optional"`+ GroupBy float64 `json:"groupBy" api:"optional,nullable"`+}++type FullTextSearchBlockRequest struct {+ SearchBlockRequest+ Notebook string `json:"notebook" api:"optional,nullable,ignoretype"`+ SearchHPath *bool `json:"searchHPath" api:"optional"`+}++type FullTextSearchBlockData struct {+ SearchBlocksData+ DocMode bool `json:"docMode"`+}++type FindReplaceRequest struct {+ SearchBlockRequest+ K string `json:"k"`+ R string `json:"r"`+ IDs []string `json:"ids"`+ ReplaceTypes map[string]bool `json:"replaceTypes" api:"optional,nullable"`+}++// 搜索子类型忽略非对象输入;路径和普通筛选参数仍按声明校验。+func searchQueryFields(reader io.Reader, path string) (map[string]json.RawMessage, error) {+ fields, err := blockRequestFields(reader, path)+ if err != nil {+ return nil, err+ }+ var groups map[string]json.RawMessage+ if json.Unmarshal(fields["subTypes"], &groups) != nil {+ delete(fields, "subTypes")+ } else if groups != nil {+ for _, name := range []string{"heading", "list", "listItem"} {+ var entries map[string]json.RawMessage+ if json.Unmarshal(groups[name], &entries) != nil {+ delete(groups, name)+ continue+ }+ for key, raw := range entries {+ var selected *bool+ if json.Unmarshal(raw, &selected) != nil {+ delete(entries, key)+ }+ }+ groups[name], err = json.Marshal(entries)+ if err != nil {+ return nil, err+ }+ }+ fields["subTypes"], err = json.Marshal(groups)+ }+ return fields, err+}++func init() {+ SemanticSearchBlock.decodeRequest = func(reader io.Reader) (request SearchBlockRequest, err error) {+ fields, err := searchQueryFields(reader, "/api/search/semanticSearchBlock")+ if err == nil {+ err = decodeRequestFields(reflect.ValueOf(&request).Elem(), fields)+ }+ return+ }+ FindReplace.decodeRequest = func(reader io.Reader) (request FindReplaceRequest, err error) {+ fields, err := searchQueryFields(reader, "/api/search/findReplace")+ if err == nil {+ err = decodeRequestFields(reflect.ValueOf(&request).Elem(), fields)+ }+ return+ }+ FullTextSearchBlock.decodeRequest = func(reader io.Reader) (request FullTextSearchBlockRequest, err error) {+ fields, err := searchQueryFields(reader, "/api/search/fullTextSearchBlock")+ if err != nil {+ return request, err+ }+ var hpath *bool+ if json.Unmarshal(fields["searchHPath"], &hpath) != nil {+ delete(fields, "searchHPath")+ }+ err = decodeRequestFields(reflect.ValueOf(&request).Elem(), fields)+ return+ }+}diff --git a/kernel/apicontract/search_ref.go b/kernel/apicontract/search_ref.gonew file mode 100644index 0000000000..380b6e5cc8--- /dev/null+++ b/kernel/apicontract/search_ref.go@@ -0,0 +1,89 @@+package apicontract++import (+ "bytes"+ "encoding/json"+ "io"+ "reflect"+)++type SearchRefBlockRequest struct {+ ID *string `json:"id" api:"optional"`+ RootID string `json:"rootID" api:"optional"`+ K string `json:"k" api:"optional"`+ BeforeLen float64 `json:"beforeLen" api:"optional"`+ IsSquareBrackets bool `json:"isSquareBrackets" api:"optional,nullable"`+ IsDatabase bool `json:"isDatabase" api:"optional,nullable"`+ Notebook string `json:"notebook" api:"optional,nullable,ignoretype"`+ ReqID JSONValue `json:"reqId" api:"optional,nullable"`+ fields map[string]json.RawMessage+}++type SearchRefParameters struct {+ IsSquareBrackets bool `json:"isSquareBrackets" api:"optional,nullable"`+ IsDatabase bool `json:"isDatabase" api:"optional,nullable"`+ RootID string `json:"rootID"`+ ID string `json:"id"`+ K string `json:"k"`+ BeforeLen float64 `json:"beforeLen"`+}++func (r SearchRefBlockRequest) Keyword() (string, error) {+ return legacyField[string](r.fields, "k", "String", true)+}++// 引用搜索先检查请求标识、发布权限和笔记本租约,再校验实际使用的搜索参数。+func (r SearchRefBlockRequest) Parameters() (params SearchRefParameters, err error) {+ err = decodeRequestFields(reflect.ValueOf(¶ms).Elem(), r.fields)+ return+}++type SearchRefCorrelation struct {+ ReqID JSONValue `json:"reqId"`+}++type SearchRefResult struct {+ SearchRefCorrelation+ Blocks []*SearchBlock `json:"blocks"`+ NewDoc bool `json:"newDoc"`+ K string `json:"k"`+}++type SearchRefData struct {+ result *SearchRefResult+ correlation SearchRefCorrelation+}++func SearchRefEcho(reqID JSONValue) SearchRefData {+ return SearchRefData{correlation: SearchRefCorrelation{ReqID: reqID}}+}++func SearchRefBlocks(result SearchRefResult) SearchRefData { return SearchRefData{result: &result} }++func (d SearchRefData) MarshalJSON() ([]byte, error) {+ if d.result != nil {+ return json.Marshal(d.result)+ }+ return json.Marshal(d.correlation)+}++func init() {+ SearchRefBlock.decodeRequest = func(reader io.Reader) (request SearchRefBlockRequest, err error) {+ fields, err := blockRequestFields(reader, "/api/search/searchRefBlock")+ if err != nil {+ return request, err+ }+ request.fields = fields+ if raw, exists := fields["reqId"]; exists {+ if err = json.Unmarshal(raw, &request.ReqID); err != nil {+ return request, err+ }+ }+ if raw := fields["id"]; len(raw) == 0 || bytes.Equal(bytes.TrimSpace(raw), []byte("null")) {+ return request, nil+ }+ request.ID = new(string)+ _ = json.Unmarshal(fields["notebook"], &request.Notebook)+ return request, nil+ }+}diff --git a/kernel/apicontract/search_test.go b/kernel/apicontract/search_test.gonew file mode 100644index 0000000000..784a6d3634--- /dev/null+++ b/kernel/apicontract/search_test.go@@ -0,0 +1,90 @@+package apicontract++import (+ "reflect"+ "strings"+ "testing"+)++func TestSearchQueryCompatibility(t *testing.T) {+ for _, body := range []string{`{}`, `null`, `{"page":null,"pageSize":null}`, `{"page":0.9,"pageSize":-2}`} {+ request, err := SemanticSearchBlock.Decode(strings.NewReader(body))+ page, size := request.Pagination()+ if err != nil || page != 1 || size != 32 || request.Types != nil || request.SubTypes.Selected() != nil {+ t.Fatalf("search defaults changed: %s: %+v, %v", body, request, err)+ }+ }+ request, err := FullTextSearchBlock.Decode(strings.NewReader(`{"page":2.9,"pageSize":5.8,"query":" query ","types":{},"paths":[],"method":3.9,"orderBy":2.1,"groupBy":1.8,"notebook":false,"searchHPath":false}`))+ page, size := request.Pagination()+ if err != nil || page != 2 || size != 5 || request.Query != " query " || request.Types == nil || request.Paths == nil || int(request.Method) != 3 || request.Notebook != "" || request.SearchHPath == nil || *request.SearchHPath {+ t.Fatalf("search input changed: %+v, %v", request, err)+ }+ for _, body := range []string{`{"searchHPath":"false"}`, `{"searchHPath":{}}`, `{"searchHPath":null}`} {+ request, err := FullTextSearchBlock.Decode(strings.NewReader(body))+ if err != nil || request.SearchHPath != nil {+ t.Fatalf("ignored path flag changed: %s, %v", body, err)+ }+ }+ for _, body := range []string{`{"page":"1"}`, `{"types":{"p":null}}`, `{"types":{"p":1}}`, `{"paths":[null]}`, `{"query":false}`} {+ if _, err := SemanticSearchBlock.Decode(strings.NewReader(body)); err == nil {+ t.Fatalf("invalid search input accepted: %s", body)+ }+ }+}++func TestSearchSubtypeCompatibility(t *testing.T) {+ for _, entry := range []struct {+ raw string+ want map[string]bool+ }{+ {`null`, nil}, {`false`, nil}, {`[]`, nil}, {`"heading"`, nil},+ {`{}`, map[string]bool{}},+ {`{"h1":true,"unknown":{"x":true}}`, map[string]bool{}},+ {`{"heading":false,"list":[true],"listItem":"t"}`, map[string]bool{}},+ {`{"heading":{"h1":true,"h2":"true","h3":null,"h4":false,"h5":[]},"list":{"t":true,"o":1},"listItem":{"u":true}}`, map[string]bool{"h1": true, "list:t": true, "listItem:u": true}},+ } {+ request, err := SemanticSearchBlock.Decode(strings.NewReader(`{"subTypes":` + entry.raw + `}`))+ if err != nil || !reflect.DeepEqual(request.SubTypes.Selected(), entry.want) {+ t.Fatalf("subtype compatibility changed: %s: %+v, %v", entry.raw, request.SubTypes.Selected(), err)+ }+ }+}++func TestSearchEmbedCompatibility(t *testing.T) {+ request, err := SearchEmbedBlock.Decode(strings.NewReader(`{"embedBlockID":" id ","stmt":" sql ","excludeIDs":[null," block "],"headingMode":2.9,"breadcrumb":null,"notebook":123}`))+ if err != nil || request.EmbedBlockID != " id " || request.Stmt != " sql " || int(request.HeadingMode) != 2 || request.Breadcrumb || request.Notebook != "" || len(request.ExcludeIDs) != 2 || request.ExcludeIDs[0] != nil || *request.ExcludeIDs[1] != " block " {+ t.Fatalf("embed input changed: %+v, %v", request, err)+ }+ for _, body := range []string{`{"embedBlockID":"id"}`, `{"embedBlockID":"id","includeIDs":null}`, `{"embedBlockID":"id","includeIDs":[null]}`} {+ if _, err := GetEmbedBlock.Decode(strings.NewReader(body)); err == nil {+ t.Fatalf("invalid embed IDs accepted: %s", body)+ }+ }+ if _, err := SearchEmbedBlock.Decode(strings.NewReader(`{"embedBlockID":"id","stmt":"sql","excludeIDs":[1]}`)); err == nil {+ t.Fatal("non-string exclusion accepted")+ }+}++func TestSearchRefDeferredParameters(t *testing.T) {+ for _, body := range []string{`{"reqId":[1],"rootID":false}`, `{"id":null,"k":false}`} {+ request, err := SearchRefBlock.Decode(strings.NewReader(body))+ if err != nil || request.ID != nil {+ t.Fatalf("correlation-only request changed: %+v, %v", request, err)+ }+ }+ request, err := SearchRefBlock.Decode(strings.NewReader(`{"id":false,"notebook":" locked ","k":" keyword "}`))+ if err != nil || request.ID == nil || request.Notebook != " locked " {+ t.Fatalf("deferred validation changed: %+v, %v", request, err)+ }+ if keyword, err := request.Keyword(); err != nil || keyword != " keyword " {+ t.Fatalf("keyword changed: %q, %v", keyword, err)+ }+ if _, err := request.Parameters(); err == nil {+ t.Fatal("invalid deferred parameters accepted")+ }+ request, err = SearchRefBlock.Decode(strings.NewReader(`{"id":" id ","rootID":" root ","k":" k ","beforeLen":4.9,"isDatabase":null}`))+ params, decodeErr := request.Parameters()+ if err != nil || decodeErr != nil || params.ID != " id " || params.RootID != " root " || int(params.BeforeLen) != 4 || params.IsDatabase {+ t.Fatalf("ref input changed: %+v, %v, %v", params, err, decodeErr)+ }+}