An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
♻️ Complete storage API contract migration https://github.com/siyuan-note/siyuan/issues/19378
Danieldebc9a74cbc3
diff --git a/app/src/business/openRecentDocs.ts b/app/src/business/openRecentDocs.tsindex 6408166f2b..13f60e8439 100644--- a/app/src/business/openRecentDocs.ts+++ b/app/src/business/openRecentDocs.ts@@ -13,8 +13,8 @@ import {hideElements} from "../protyle/ui/hideElements";const renderRecentDocsContent = async (data: {rootID: string,- icon: string,- title: string,+ icon?: string,+ title?: string,viewedAt?: number,closedAt?: number,openAt?: number,@@ -22,10 +22,10 @@ const renderRecentDocsContent = async (data: {let tabHtml = "";let index = 0;data.forEach((item) => {- if (!key || item.title.toLowerCase().includes(key.toLowerCase())) {+ if (!key || (item.title || "").toLowerCase().includes(key.toLowerCase())) {tabHtml += `<li data-index="${index}" data-node-id="${item.rootID}" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}">${getFileTreeIconHTML(item.icon, "file", "b3-list-item__graphic", true)}- <span class="b3-list-item__text">${escapeHtml(item.title)}</span>+ <span class="b3-list-item__text">${escapeHtml(item.title || "")}</span></li>`;index++;}diff --git a/app/src/protyle/util/compatibility.ts b/app/src/protyle/util/compatibility.tsindex cc8ac98f6e..028c0d8582 100644--- a/app/src/protyle/util/compatibility.ts+++ b/app/src/protyle/util/compatibility.ts@@ -813,9 +813,10 @@ export const getLocalStorage = (cb: () => void) => {Constants.LOCAL_OUTLINE, Constants.LOCAL_FILEPOSITION, Constants.LOCAL_FILESPATHS, Constants.LOCAL_IMAGES,Constants.LOCAL_PLUGIN_DOCKS, Constants.LOCAL_EMOJIS, Constants.LOCAL_MOVE_PATH, Constants.LOCAL_RECENT_DOCS,Constants.LOCAL_CLOSED_TABS].forEach((key) => {- if (typeof response.data[key] === "string") {+ const value = response.data[key];+ if (typeof value === "string") {try {- const parseData = JSON.parse(response.data[key]);+ const parseData = JSON.parse(value);if (typeof parseData === "number") {// https://github.com/siyuan-note/siyuan/issues/8852 Object.assign 会导致 number to Numberwindow.siyuan.storage[key] = parseData;diff --git a/app/src/search/menu.ts b/app/src/search/menu.tsindex fe0ca4b6ff..ba11a3ba4e 100644--- a/app/src/search/menu.ts+++ b/app/src/search/menu.ts@@ -700,7 +700,19 @@ const configIsSame = (config: Config.IUILayoutTabSearchConfig, config2: Config.Iexport const initCriteriaMenu = (element: HTMLElement, data: Config.IUILayoutTabSearchConfig[], config: Config.IUILayoutTabSearchConfig) => {fetchPost("/api/storage/getCriteria", {}, (response) => {let html = "";- response.data.forEach((item: Config.IUILayoutTabSearchConfig) => {+ response.data?.forEach((criterion) => {+ if (!criterion) {+ return;+ }+ const defaults = getDefaultSubType();+ const item: Config.IUILayoutTabSearchConfig = {+ ...criterion,+ subTypes: {+ heading: {...defaults.heading, ...criterion.subTypes?.heading},+ list: {...defaults.list, ...criterion.subTypes?.list},+ listItem: {...defaults.listItem, ...criterion.subTypes?.listItem},+ },+ };data.push(item);let isSame = false;if (configIsSame(item, config)) {diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.tsindex b5fb697d3f..fcfa898815 100644--- a/app/src/types/api/index.d.ts+++ b/app/src/types/api/index.d.ts@@ -4,6 +4,14 @@ export type AppendBlockRequestInput = { "data": string; "dataType": string; "parexport type AppendHeadingChildrenRequestInput = { "childrenDOM": string; "id": string; };+export type AttributeViewColorTheme = { "backgroundColor": string; "color": string; };++export type AttributeViewColorThemeInput = { "backgroundColor"?: string | null; "color"?: string | null; };++export type AttributeViewCustomColor = { "dark": AttributeViewColorTheme; "hidden"?: boolean; "index": number; "light": AttributeViewColorTheme; };++export type AttributeViewCustomColorInput = { "dark"?: AttributeViewColorThemeInput | null; "hidden"?: boolean | null; "index"?: number | null; "light"?: AttributeViewColorThemeInput | null; };+export type AutoLaunchRequestInput = { "autoLaunch": number; };export type BatchInsertBlockRequestInput = { "blocks": Array<BlockInsertInputInput>; };@@ -96,6 +104,18 @@ export type CreateSnapshotData = { "created": boolean; "id": string; };export type CreateSnapshotRequestInput = { "memo"?: string; };+export type Criterion = { "group": number; "hPath": string; "hasReplace": boolean; "idPath": Array<string> | null; "k": string; "method": number; "name": string; "r": string; "replaceTypes": CriterionReplaceTypes | null; "sort": number; "subTypes": SearchSubTypes; "types": CriterionTypes | null; };++export type CriterionInput = { "group"?: number | null; "hPath"?: string | null; "hasReplace"?: boolean | null; "idPath"?: Array<string> | null; "k"?: string | null; "method"?: number | null; "name"?: string | null; "r"?: string | null; "replaceTypes"?: CriterionReplaceTypesInput | null; "sort"?: number | null; "subTypes"?: SearchSubTypesInput | null; "types"?: CriterionTypesInput | null; };++export type CriterionReplaceTypes = { "aHref": boolean; "aText": boolean; "aTitle": boolean; "blockRef": boolean; "code": boolean; "codeBlock": boolean; "docTitle": boolean; "em": boolean; "fileAnnotationRef": boolean; "htmlBlock": boolean; "imgSrc": boolean; "imgText": boolean; "imgTitle": boolean; "inlineMath": boolean; "inlineMemo": boolean; "kbd": boolean; "mark": boolean; "mathBlock": boolean; "s": boolean; "strong": boolean; "sub": boolean; "sup": boolean; "tag": boolean; "text": boolean; "u": boolean; };++export type CriterionReplaceTypesInput = { "aHref"?: boolean | null; "aText"?: boolean | null; "aTitle"?: boolean | null; "blockRef"?: boolean | null; "code"?: boolean | null; "codeBlock"?: boolean | null; "docTitle"?: boolean | null; "em"?: boolean | null; "fileAnnotationRef"?: boolean | null; "htmlBlock"?: boolean | null; "imgSrc"?: boolean | null; "imgText"?: boolean | null; "imgTitle"?: boolean | null; "inlineMath"?: boolean | null; "inlineMemo"?: boolean | null; "kbd"?: boolean | null; "mark"?: boolean | null; "mathBlock"?: boolean | null; "s"?: boolean | null; "strong"?: boolean | null; "sub"?: boolean | null; "sup"?: boolean | null; "tag"?: boolean | null; "text"?: boolean | null; "u"?: boolean | null; };++export type CriterionTypes = { "audioBlock": boolean; "blockquote": boolean; "callout": boolean; "codeBlock": boolean; "databaseBlock": boolean; "document": boolean; "embedBlock": boolean; "heading": boolean; "htmlBlock": boolean; "iframeBlock": boolean; "list": boolean; "listItem": boolean; "mathBlock": boolean; "paragraph": boolean; "superBlock": boolean; "table": boolean; "videoBlock": boolean; "widgetBlock": boolean; };++export type CriterionTypesInput = { "audioBlock"?: boolean | null; "blockquote"?: boolean | null; "callout"?: boolean | null; "codeBlock"?: boolean | null; "databaseBlock"?: boolean | null; "document"?: boolean | null; "embedBlock"?: boolean | null; "heading"?: boolean | null; "htmlBlock"?: boolean | null; "iframeBlock"?: boolean | null; "list"?: boolean | null; "listItem"?: boolean | null; "mathBlock"?: boolean | null; "paragraph"?: boolean | null; "superBlock"?: boolean | null; "table"?: boolean | null; "videoBlock"?: boolean | null; "widgetBlock"?: boolean | null; };+export type DOMTextRequestInput = { "dom": string; };export type DailyNoteBlockRequestInput = { "data": string; "dataType": string; "notebook": string; };@@ -142,6 +162,40 @@ export type HeadingLevelRequestInput = { "id"?: string; "ids"?: Array<string>; "export type ImportNotebookCryptoBackupRequestInput = { "file": Blob; "password"?: string; };+export type InlineStyle = { "dark": InlineStyleTheme | null; "hidden"?: boolean; "id": string; "light": InlineStyleTheme | null; "name": string; };++export type InlineStyleAV = { "colors": Array<AttributeViewCustomColor | null> | null; "order": Array<string> | null; };++export type InlineStyleAVInput = { "colors"?: Array<AttributeViewCustomColorInput | null> | null; "order"?: Array<string> | null; };++export type InlineStyleBuiltin = { "colors": Array<InlineStyleBuiltinColor | null> | null; "hidden": InlineStyleBuiltinHidden | null; "styles": Array<InlineStyleBuiltinStyle | null> | null; };++export type InlineStyleBuiltinColor = { "dark": InlineStyleTheme | null; "index": number; "light": InlineStyleTheme | null; };++export type InlineStyleBuiltinColorInput = { "dark"?: InlineStyleThemeInput | null; "index"?: number | null; "light"?: InlineStyleThemeInput | null; };++export type InlineStyleBuiltinHidden = { "av": Array<number> | null; "backgroundColor": Array<number> | null; "color": Array<number> | null; "style1": Array<string> | null; };++export type InlineStyleBuiltinHiddenInput = { "av"?: Array<number> | null; "backgroundColor"?: Array<number> | null; "color"?: Array<number> | null; "style1"?: Array<string> | null; };++export type InlineStyleBuiltinInput = { "colors"?: Array<InlineStyleBuiltinColorInput | null> | null; "hidden"?: InlineStyleBuiltinHiddenInput | null; "styles"?: Array<InlineStyleBuiltinStyleInput | null> | null; };++export type InlineStyleBuiltinStyle = { "dark": InlineStyleTheme | null; "id": string; "light": InlineStyleTheme | null; };++export type InlineStyleBuiltinStyleInput = { "dark"?: InlineStyleThemeInput | null; "id"?: string | null; "light"?: InlineStyleThemeInput | null; };++export type InlineStyleInput = { "dark"?: InlineStyleThemeInput | null; "hidden"?: boolean | null; "id"?: string | null; "light"?: InlineStyleThemeInput | null; "name"?: string | null; };++export type InlineStyleOrder = { "backgroundColor": Array<string> | null; "color": Array<string> | null; "style1": Array<string> | null; };++export type InlineStyleOrderInput = { "backgroundColor"?: Array<string> | null; "color"?: Array<string> | null; "style1"?: Array<string> | null; };++export type InlineStyleTheme = { "backgroundColor"?: string; "color"?: string; };++export type InlineStyleThemeInput = { "backgroundColor"?: string | null; "color"?: string | null; };++export type InlineStyles = { "av": InlineStyleAV | null; "builtin": InlineStyleBuiltin | null; "order": InlineStyleOrder | null; "styles": Array<InlineStyle | null> | null; "version": number; };+export type InsertBlockRequestInput = { "data": string; "dataType": string; "nextID"?: string | null; "parentID"?: string | null; "previousID"?: string | null; };export type JSONValue = null | boolean | number | string | Array<JSONValue> | { [key: string]: JSONValue };@@ -198,12 +252,24 @@ export type OpenNotebookRequestInput = { "app"?: string | null; "notebook": striexport type OrderedListStartData = { "found": boolean; "start": number; };+export type OutlineStorageRequestInput = { "docID": string; };++export type OutlineStorageSetRequestInput = { "docID": string; "val": { [key: string]: JSONValue }; };+export type PinnedDoc = { "childrenSortMode": number | null; "icon": string; "id": string; "name": string; "notebook": string; "path": string; "subFileCount": number; "unavailable": boolean; };export type PrependBlockRequestInput = { "data": string; "dataType": string; "parentID": string; };export type PublishedBlockInfo = { "publishAccessRequired": true; "rootID": string; "rootIcon": string; "rootTitle": string; "rootTitleEmpty": boolean; };+export type RecentDoc = { "closedAt"?: number; "icon"?: string; "openAt"?: number; "rootID": string; "title"?: string; "viewedAt"?: number; };++export type RecentDocUpdateRequestInput = { "rootID"?: string | null; };++export type RecentDocsRequestInput = { "sortBy"?: string | null; };++export type RecentDocsUpdateRequestInput = { "rootIDs"?: Array<string> | null; };+export type RefDefs = { "defIDs": Array<string> | null; "refID": string; };export type RefDefsData = { "refDefs": Array<RefDefs>; };@@ -216,6 +282,8 @@ export type RefTextQueryRequestInput = { "anchor": string; "notebook"?: string |export type RemoveBookmarkRequestInput = { "bookmark": string; };+export type RemoveCriterionRequestInput = { "name": string; };+export type RemoveTagRequestInput = { "label": string; };export type RenameBookmarkRequestInput = { "newBookmark": string; "oldBookmark": string; };@@ -236,12 +304,20 @@ export type SearchHistoryData = { "histories": Array<string> | null; "pageCount"export type SearchHistoryRequestInput = { "notebook"?: string | null; "op"?: string | null; "page"?: number | null; "query"?: string | null; "type"?: number | null; };+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 SearchTagData = { "k": string; "tags": Array<string>; };export type SearchTagRequestInput = { "k": string; };export type SetBlockAttrsRequestInput = { "attrs": Record<string, string | null>; "id": string; };+export type SetCriterionRequestInput = { "criterion": CriterionInput | null; };++export type SetInlineStylesRequestInput = { "app"?: string | null; "av"?: InlineStyleAVInput | null; "builtin"?: InlineStyleBuiltinInput | null; "order"?: InlineStyleOrderInput | null; "styles": Array<InlineStyleInput | null>; "version": number; };+export type SetNotebookConfRequestInput = { "conf"?: NotebookConfPatchInput | null; "notebook": string; };export type SetNotebookIconRequestInput = { "icon": string; "notebook": string; };@@ -256,6 +332,18 @@ export type SnippetInput = { "content": string; "disabledInPublish"?: boolean |export type SnippetsData = { "snippets": Array<Snippet | null>; };+export type StorageKeyRequestInput = { "key": string; };++export type StorageKeysRequestInput = { "keys": Array<string>; };++export type StorageRemoveKeysRequestInput = { "app"?: string | null; "keys": Array<string>; };++export type StorageRemoveRequestInput = { "app"?: string | null; "key": string; };++export type StorageSetKeysRequestInput = { "app"?: string | null; "keyVals": { [key: string]: JSONValue }; };++export type StorageSetRequestInput = { "app"?: string | null; "key": string; "val"?: JSONValue | null; };+export type SwapBlockRefRequestInput = { "defID": string; "includeChildren": boolean; "refID": string; };export type TagData = { "children": Array<TagData | null> | null; "count": number; "depth": number; "label": string; "name": string; "type": string; };@@ -284,10 +372,16 @@ export type UpdateChannelRequestInput = { "updateChannel": 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 }; };+export type VirtualBlockRefRequestInput = { "keywords": Array<string>; };export type WordCountData = { "reqId": JSONValue; "stat": BlockStat | null; };+export type WorkspaceAVBuiltinColorUpdateInput = { "customized"?: boolean | null; "dark"?: InlineStyleThemeInput | null; "hidden"?: boolean | null; "index"?: number | null; "light"?: InlineStyleThemeInput | null; };++export type WorkspaceAVPaletteRequestInput = { "app"?: string | null; "builtinColors"?: Array<WorkspaceAVBuiltinColorUpdateInput | null> | null; "colors": Array<AttributeViewCustomColorInput | null>; "order": Array<string>; };+export type WorkspaceInfoData = { "siyuanVer": string; "workspaceDir": string; };export type ZipRequestInput = { "path": string; "zipPath": string; };@@ -690,30 +784,6 @@ export type APILegacyPOSTPath ="/api/setting/setSnippet" |"/api/setting/setTheme" |"/api/setting/setVariables" |- "/api/storage/batchUpdateRecentDocCloseTime" |- "/api/storage/getCriteria" |- "/api/storage/getInlineStyles" |- "/api/storage/getLocalStorage" |- "/api/storage/getLocalStorageVal" |- "/api/storage/getLocalStorageVals" |- "/api/storage/getOutlineStorage" |- "/api/storage/getRecentDocs" |- "/api/storage/getViewState" |- "/api/storage/patchViewState" |- "/api/storage/removeCriterion" |- "/api/storage/removeLocalStorageVal" |- "/api/storage/removeLocalStorageVals" |- "/api/storage/removeOutlineStorage" |- "/api/storage/removeViewState" |- "/api/storage/setCriterion" |- "/api/storage/setInlineStyles" |- "/api/storage/setLocalStorageVal" |- "/api/storage/setLocalStorageVals" |- "/api/storage/setOutlineStorage" |- "/api/storage/setWorkspaceAVPalette" |- "/api/storage/updateRecentDocCloseTime" |- "/api/storage/updateRecentDocOpenTime" |- "/api/storage/updateRecentDocViewTime" |"/api/sync/createCloudSyncDir" |"/api/sync/exportSyncProviderS3" |"/api/sync/exportSyncProviderWebDAV" |@@ -1396,11 +1466,131 @@ export interface APIPOSTRoutes {response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };body: "none";};+ "/api/storage/batchUpdateRecentDocCloseTime": {+ request: RecentDocsUpdateRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/getCriteria": {+ request: EmptyRequestInput;+ response: { "code": 0; "data": Array<Criterion | null> | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "none";+ };+ "/api/storage/getInlineStyles": {+ request: EmptyRequestInput;+ response: { "code": 0; "data": InlineStyles | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "none";+ };+ "/api/storage/getLocalStorage": {+ request: EmptyRequestInput;+ response: { "code": 0; "data": { [key: string]: JSONValue } | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "none";+ };+ "/api/storage/getLocalStorageVal": {+ request: StorageKeyRequestInput;+ response: { "code": 0; "data": JSONValue; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/getLocalStorageVals": {+ request: StorageKeysRequestInput;+ response: { "code": 0; "data": { [key: string]: JSONValue } | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/getOutlineStorage": {+ request: OutlineStorageRequestInput;+ response: { "code": 0; "data": { [key: string]: JSONValue } | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/getRecentDocs": {+ request: RecentDocsRequestInput;+ response: { "code": 0; "data": Array<RecentDoc | null> | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "legacyOptional";+ };+ "/api/storage/getViewState": {+ request: StorageKeyRequestInput;+ response: { "code": 0; "data": { [key: string]: JSONValue } | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/patchViewState": {+ request: ViewStatePatchRequestInput;+ response: { "code": 0; "data": { [key: string]: JSONValue } | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/removeCriterion": {+ request: RemoveCriterionRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/removeLocalStorageVal": {+ request: StorageRemoveRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/removeLocalStorageVals": {+ request: StorageRemoveKeysRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/removeOutlineStorage": {+ request: OutlineStorageRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/removeViewState": {+ request: StorageKeyRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/setCriterion": {+ request: SetCriterionRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/setInlineStyles": {+ request: SetInlineStylesRequestInput;+ response: { "code": 0; "data": InlineStyles | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };"/api/storage/setLocalStorage": {request: EmptyRequestInput;response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };body: "none";};+ "/api/storage/setLocalStorageVal": {+ request: StorageSetRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/setLocalStorageVals": {+ request: StorageSetKeysRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/setOutlineStorage": {+ request: OutlineStorageSetRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/setWorkspaceAVPalette": {+ request: WorkspaceAVPaletteRequestInput;+ response: { "code": 0; "data": InlineStyles | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/updateRecentDocCloseTime": {+ request: RecentDocUpdateRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/updateRecentDocOpenTime": {+ request: RecentDocUpdateRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };+ "/api/storage/updateRecentDocViewTime": {+ request: RecentDocUpdateRequestInput;+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };+ body: "json";+ };"/api/system/addMicrosoftDefenderExclusion": {request: EmptyRequestInput;response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.mdindex ad959d4ec7..bbea2c6fbb 100644--- a/docs/API-CONTRACTS.md+++ b/docs/API-CONTRACTS.md@@ -50,6 +50,8 @@ Heading transaction queries return `BlockTransaction` with typed operations andAll `/api/block/` routes use contracts. Heading-level queries retain batch-ID precedence, deduplication, fractional-level truncation, document struct binding, and message display durations. Document conversion results include the six heading counts and typed transactions. Reference checks validate only the fields used by the selected scope, preserve ignored fields and notebook trimming rules, and retain boolean error payloads, publish filtering, and notebook leases through response serialization. These exceptional input rules use private, endpoint-specific typed decoders; ordinary endpoints continue to use field declarations. Recent-update results use a recursive `SearchBlock` payload, including nullable references, children, and card metadata.+Storage contracts keep arbitrary JSON limited to storage values; keys, recent documents, search criteria, inline styles, and attribute-view palettes have structured types. Recent-document mutations retain their read-only no-op before parsing the body. An optional typed `beforeDecode` callback on `contractHandler` preserves this ordering and may return a response before decoding; route checks still require an explicit endpoint binding. Inline-style version 1 updates preserve existing built-in configuration, while version 2 and palette requests retain their struct-decoding compatibility.+## Multipart requestsUse `MultipartBody` for file uploads. Request structs declare string fields and `*multipart.FileHeader` fields using their wire names; file schemas use `type: string` and `format: binary`, generating `Blob` declarations. The adapter retains Gin multipart parsing and binds the first value for repeated fields. File contents remain available through `Open`, so handlers preserve their read and recovery logic. Unsupported field types and binding options fail generation.diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.mdindex b1f4d2361e..f857687f51 100644--- a/docs/API-CONTRACTS.zh-CN.md+++ b/docs/API-CONTRACTS.zh-CN.md@@ -50,6 +50,8 @@全部 `/api/block/` 路由已使用契约。标题级别查询保留批量 ID 优先、去重、小数级别截断、文档结构体绑定和消息展示时长。文档转换结果包含六级标题计数和有类型的事务。引用检查仅校验所选范围使用的字段,保留忽略字段及笔记本参数去空白规则,并保留布尔错误载荷、发布过滤和持续到响应序列化完成的笔记本租约。这些特殊输入规则使用私有的入口专用类型解码函数,普通接口继续通过字段声明解码。最近更新结果使用递归的 `SearchBlock` 载荷,包含可为空的引用、子块和卡片元数据。+存储契约仅在存储值中允许任意 JSON,键、最近文档、搜索条件、行内样式和属性视图调色板均使用结构化类型。最近文档写入接口保留只读角色在解析请求体前直接返回成功的行为。`contractHandler` 可选的类型化 `beforeDecode` 回调用于保留这一执行顺序,允许在解码前返回响应;路由检查仍要求显式绑定端点。行内样式版本 1 的更新保留已有内置配置,版本 2 和调色板请求保留结构体解码的兼容行为。+## 文件上传请求文件上传使用 `MultipartBody`。请求结构体以线协议字段名声明字符串和 `*multipart.FileHeader` 字段;文件 schema 使用 `type: string` 与 `format: binary`,生成 `Blob` 类型。适配器保留 Gin 的表单解析方式,重复字段取首值;文件内容继续通过 `Open` 读取,处理函数保留读取及恢复逻辑。未支持的字段类型和绑定选项会使生成失败。diff --git a/kernel/api/contract.go b/kernel/api/contract.goindex b76b7962c7..69f7eb8e69 100644--- a/kernel/api/contract.go+++ b/kernel/api/contract.go@@ -39,8 +39,15 @@ func notebookConfContract(value *conf.BoxConf) *apicontract.NotebookConf {// contractHandler 将请求绑定和响应类型与注册契约关联,业务入口继续使用现有中间件。func contractHandler[Request, Data any](endpoint apicontract.Endpoint[Request, Data],- handler func(*gin.Context, Request) apicontract.Response[Data]) gin.HandlerFunc {+ handler func(*gin.Context, Request) apicontract.Response[Data], beforeDecode ...func(*gin.Context) *apicontract.Response[Data]) gin.HandlerFunc {return func(c *gin.Context) {+ // 保留在读取请求体前完成的角色判断或大小限制,提前响应也使用相同的载荷类型。+ for _, before := range beforeDecode {+ if response := before(c); response != nil {+ c.JSON(http.StatusOK, response)+ return+ }+ }var request Requestvar err errorif endpoint.Definition().Body == apicontract.MultipartBody {diff --git a/kernel/api/contract_inline_style.go b/kernel/api/contract_inline_style.gonew file mode 100644index 0000000000..de78173a36--- /dev/null+++ b/kernel/api/contract_inline_style.go@@ -0,0 +1,381 @@+package api++import (+ "github.com/siyuan-note/siyuan/kernel/apicontract"+ "github.com/siyuan-note/siyuan/kernel/av"+ "github.com/siyuan-note/siyuan/kernel/model"+)++func inlineStyleThemeContract(value *model.InlineStyleTheme) *apicontract.InlineStyleTheme {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleTheme{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ return result+}++func inlineStyleContract(value *model.InlineStyle) *apicontract.InlineStyle {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyle{}+ result.ID = value.ID+ result.Name = value.Name+ result.Hidden = value.Hidden+ result.Light = inlineStyleThemeContract(value.Light)+ result.Dark = inlineStyleThemeContract(value.Dark)+ return result+}++func inlineStyleBuiltinColorContract(value *model.InlineStyleBuiltinColor) *apicontract.InlineStyleBuiltinColor {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleBuiltinColor{}+ result.Index = value.Index+ result.Light = inlineStyleThemeContract(value.Light)+ result.Dark = inlineStyleThemeContract(value.Dark)+ return result+}++func inlineStyleBuiltinStyleContract(value *model.InlineStyleBuiltinStyle) *apicontract.InlineStyleBuiltinStyle {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleBuiltinStyle{}+ result.ID = value.ID+ result.Light = inlineStyleThemeContract(value.Light)+ result.Dark = inlineStyleThemeContract(value.Dark)+ return result+}++func inlineStyleBuiltinHiddenContract(value *model.InlineStyleBuiltinHidden) *apicontract.InlineStyleBuiltinHidden {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleBuiltinHidden{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ result.Style1 = value.Style1+ result.AV = value.AV+ return result+}++func inlineStyleBuiltinContract(value *model.InlineStyleBuiltin) *apicontract.InlineStyleBuiltin {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleBuiltin{}+ if value.Colors != nil {+ result.Colors = make([]*apicontract.InlineStyleBuiltinColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = inlineStyleBuiltinColorContract(entry)+ }+ }+ if value.Styles != nil {+ result.Styles = make([]*apicontract.InlineStyleBuiltinStyle, len(value.Styles))+ for i, entry := range value.Styles {+ result.Styles[i] = inlineStyleBuiltinStyleContract(entry)+ }+ }+ result.Hidden = inlineStyleBuiltinHiddenContract(value.Hidden)+ return result+}++func inlineStyleOrderContract(value *model.InlineStyleOrder) *apicontract.InlineStyleOrder {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleOrder{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ result.Style1 = value.Style1+ return result+}++func inlineStyleAVContract(value *model.InlineStyleAV) *apicontract.InlineStyleAV {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyleAV{}+ if value.Colors != nil {+ result.Colors = make([]*apicontract.AttributeViewCustomColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = attributeViewCustomColorContract(entry)+ }+ }+ result.Order = value.Order+ return result+}++func workspaceAVBuiltinColorUpdateContract(value *model.WorkspaceAVBuiltinColorUpdate) *apicontract.WorkspaceAVBuiltinColorUpdate {+ if value == nil {+ return nil+ }+ result := &apicontract.WorkspaceAVBuiltinColorUpdate{}+ result.Index = value.Index+ result.Customized = value.Customized+ result.Light = inlineStyleThemeContract(value.Light)+ result.Dark = inlineStyleThemeContract(value.Dark)+ result.Hidden = value.Hidden+ return result+}++func workspaceAVPaletteUpdateContract(value *model.WorkspaceAVPaletteUpdate) *apicontract.WorkspaceAVPaletteUpdate {+ if value == nil {+ return nil+ }+ result := &apicontract.WorkspaceAVPaletteUpdate{}+ if value.Colors != nil {+ result.Colors = make([]*apicontract.AttributeViewCustomColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = attributeViewCustomColorContract(entry)+ }+ }+ result.Order = value.Order+ if value.BuiltinColors != nil {+ result.BuiltinColors = make([]*apicontract.WorkspaceAVBuiltinColorUpdate, len(value.BuiltinColors))+ for i, entry := range value.BuiltinColors {+ result.BuiltinColors[i] = workspaceAVBuiltinColorUpdateContract(entry)+ }+ }+ return result+}++func inlineStylesContract(value *model.InlineStyles) *apicontract.InlineStyles {+ if value == nil {+ return nil+ }+ result := &apicontract.InlineStyles{}+ result.Version = value.Version+ if value.Styles != nil {+ result.Styles = make([]*apicontract.InlineStyle, len(value.Styles))+ for i, entry := range value.Styles {+ result.Styles[i] = inlineStyleContract(entry)+ }+ }+ result.Builtin = inlineStyleBuiltinContract(value.Builtin)+ result.Order = inlineStyleOrderContract(value.Order)+ result.AV = inlineStyleAVContract(value.AV)+ return result+}++func attributeViewColorThemeContract(value *av.AttributeViewColorTheme) *apicontract.AttributeViewColorTheme {+ if value == nil {+ return nil+ }+ result := &apicontract.AttributeViewColorTheme{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ return result+}++func attributeViewColorContract(value *av.AttributeViewColor) *apicontract.AttributeViewColor {+ if value == nil {+ return nil+ }+ result := &apicontract.AttributeViewColor{}+ result.Light = *attributeViewColorThemeContract(&value.Light)+ result.Dark = *attributeViewColorThemeContract(&value.Dark)+ return result+}++func attributeViewCustomColorContract(value *av.AttributeViewCustomColor) *apicontract.AttributeViewCustomColor {+ if value == nil {+ return nil+ }+ result := &apicontract.AttributeViewCustomColor{}+ result.Index = value.Index+ result.Hidden = value.Hidden+ result.AttributeViewColor = *attributeViewColorContract(&value.AttributeViewColor)+ return result+}++func inlineStyleThemeModel(value *apicontract.InlineStyleTheme) *model.InlineStyleTheme {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleTheme{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ return result+}++func inlineStyleModel(value *apicontract.InlineStyle) *model.InlineStyle {+ if value == nil {+ return nil+ }+ result := &model.InlineStyle{}+ result.ID = value.ID+ result.Name = value.Name+ result.Hidden = value.Hidden+ result.Light = inlineStyleThemeModel(value.Light)+ result.Dark = inlineStyleThemeModel(value.Dark)+ return result+}++func inlineStyleBuiltinColorModel(value *apicontract.InlineStyleBuiltinColor) *model.InlineStyleBuiltinColor {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleBuiltinColor{}+ result.Index = value.Index+ result.Light = inlineStyleThemeModel(value.Light)+ result.Dark = inlineStyleThemeModel(value.Dark)+ return result+}++func inlineStyleBuiltinStyleModel(value *apicontract.InlineStyleBuiltinStyle) *model.InlineStyleBuiltinStyle {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleBuiltinStyle{}+ result.ID = value.ID+ result.Light = inlineStyleThemeModel(value.Light)+ result.Dark = inlineStyleThemeModel(value.Dark)+ return result+}++func inlineStyleBuiltinHiddenModel(value *apicontract.InlineStyleBuiltinHidden) *model.InlineStyleBuiltinHidden {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleBuiltinHidden{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ result.Style1 = value.Style1+ result.AV = value.AV+ return result+}++func inlineStyleBuiltinModel(value *apicontract.InlineStyleBuiltin) *model.InlineStyleBuiltin {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleBuiltin{}+ if value.Colors != nil {+ result.Colors = make([]*model.InlineStyleBuiltinColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = inlineStyleBuiltinColorModel(entry)+ }+ }+ if value.Styles != nil {+ result.Styles = make([]*model.InlineStyleBuiltinStyle, len(value.Styles))+ for i, entry := range value.Styles {+ result.Styles[i] = inlineStyleBuiltinStyleModel(entry)+ }+ }+ result.Hidden = inlineStyleBuiltinHiddenModel(value.Hidden)+ return result+}++func inlineStyleOrderModel(value *apicontract.InlineStyleOrder) *model.InlineStyleOrder {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleOrder{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ result.Style1 = value.Style1+ return result+}++func inlineStyleAVModel(value *apicontract.InlineStyleAV) *model.InlineStyleAV {+ if value == nil {+ return nil+ }+ result := &model.InlineStyleAV{}+ if value.Colors != nil {+ result.Colors = make([]*av.AttributeViewCustomColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = attributeViewCustomColorModel(entry)+ }+ }+ result.Order = value.Order+ return result+}++func workspaceAVBuiltinColorUpdateModel(value *apicontract.WorkspaceAVBuiltinColorUpdate) *model.WorkspaceAVBuiltinColorUpdate {+ if value == nil {+ return nil+ }+ result := &model.WorkspaceAVBuiltinColorUpdate{}+ result.Index = value.Index+ result.Customized = value.Customized+ result.Light = inlineStyleThemeModel(value.Light)+ result.Dark = inlineStyleThemeModel(value.Dark)+ result.Hidden = value.Hidden+ return result+}++func workspaceAVPaletteUpdateModel(value *apicontract.WorkspaceAVPaletteUpdate) *model.WorkspaceAVPaletteUpdate {+ if value == nil {+ return nil+ }+ result := &model.WorkspaceAVPaletteUpdate{}+ if value.Colors != nil {+ result.Colors = make([]*av.AttributeViewCustomColor, len(value.Colors))+ for i, entry := range value.Colors {+ result.Colors[i] = attributeViewCustomColorModel(entry)+ }+ }+ result.Order = value.Order+ if value.BuiltinColors != nil {+ result.BuiltinColors = make([]*model.WorkspaceAVBuiltinColorUpdate, len(value.BuiltinColors))+ for i, entry := range value.BuiltinColors {+ result.BuiltinColors[i] = workspaceAVBuiltinColorUpdateModel(entry)+ }+ }+ return result+}++func inlineStylesModel(value *apicontract.InlineStyles) *model.InlineStyles {+ if value == nil {+ return nil+ }+ result := &model.InlineStyles{}+ result.Version = value.Version+ if value.Styles != nil {+ result.Styles = make([]*model.InlineStyle, len(value.Styles))+ for i, entry := range value.Styles {+ result.Styles[i] = inlineStyleModel(entry)+ }+ }+ result.Builtin = inlineStyleBuiltinModel(value.Builtin)+ result.Order = inlineStyleOrderModel(value.Order)+ result.AV = inlineStyleAVModel(value.AV)+ return result+}++func attributeViewColorThemeModel(value *apicontract.AttributeViewColorTheme) *av.AttributeViewColorTheme {+ if value == nil {+ return nil+ }+ result := &av.AttributeViewColorTheme{}+ result.Color = value.Color+ result.BackgroundColor = value.BackgroundColor+ return result+}++func attributeViewColorModel(value *apicontract.AttributeViewColor) *av.AttributeViewColor {+ if value == nil {+ return nil+ }+ result := &av.AttributeViewColor{}+ result.Light = *attributeViewColorThemeModel(&value.Light)+ result.Dark = *attributeViewColorThemeModel(&value.Dark)+ return result+}++func attributeViewCustomColorModel(value *apicontract.AttributeViewCustomColor) *av.AttributeViewCustomColor {+ if value == nil {+ return nil+ }+ result := &av.AttributeViewCustomColor{}+ result.Index = value.Index+ result.Hidden = value.Hidden+ result.AttributeViewColor = *attributeViewColorModel(&value.AttributeViewColor)+ return result+}diff --git a/kernel/api/contract_storage.go b/kernel/api/contract_storage.gonew file mode 100644index 0000000000..bc691c24d3--- /dev/null+++ b/kernel/api/contract_storage.go@@ -0,0 +1,70 @@+package api++import (+ "encoding/json"+ "github.com/gin-gonic/gin"++ "github.com/siyuan-note/siyuan/kernel/apicontract"+ "github.com/siyuan-note/siyuan/kernel/model"+)++func skipReadonlyStorageMutation(c *gin.Context) *apicontract.Response[apicontract.Null] {+ if model.IsReadOnlyRoleContext(c) {+ response := apicontract.Success(apicontract.Null{})+ return &response+ }+ return nil+}++// 存储接口的值由调用方定义,可包含任意 JSON;键集合及外围参数仍使用独立的结构化契约。+func storageContract(values map[string]any) apicontract.Response[map[string]apicontract.JSONValue] {+ data, err := json.Marshal(values)+ if err != nil {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, err.Error())+ }+ var result map[string]apicontract.JSONValue+ if err = json.Unmarshal(data, &result); err != nil {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, err.Error())+ }+ return apicontract.Success(result)+}++func storageModelValues(values map[string]apicontract.JSONValue) (result map[string]any, err error) {+ data, err := json.Marshal(values)+ if err == nil {+ err = json.Unmarshal(data, &result)+ }+ return+}++func recentDocContracts(values []*model.RecentDoc) []*apicontract.RecentDoc {+ if values == nil {+ return nil+ }+ result := make([]*apicontract.RecentDoc, len(values))+ for i, value := range values {+ if value != nil {+ result[i] = &apicontract.RecentDoc{RootID: value.RootID, Icon: value.Icon, Title: value.Title, ViewedAt: value.ViewedAt, ClosedAt: value.ClosedAt, OpenAt: value.OpenAt}+ }+ }+ return result+}++func criterionContracts(values []*model.Criterion) []*apicontract.Criterion {+ if values == nil {+ return nil+ }+ result := make([]*apicontract.Criterion, len(values))+ for i, value := range values {+ if value != nil {+ result[i] = &apicontract.Criterion{Name: value.Name, Sort: value.Sort, Group: value.Group, HasReplace: value.HasReplace, Method: value.Method, HPath: value.HPath, IDPath: value.IDPath, K: value.K, R: value.R,+ Types: (*apicontract.CriterionTypes)(value.Types), SubTypes: apicontract.SearchSubTypes(value.SubTypes), ReplaceTypes: (*apicontract.CriterionReplaceTypes)(value.ReplaceTypes)}+ }+ }+ return result+}++func criterionModel(value apicontract.Criterion) *model.Criterion {+ return &model.Criterion{Name: value.Name, Sort: value.Sort, Group: value.Group, HasReplace: value.HasReplace, Method: value.Method, HPath: value.HPath, IDPath: value.IDPath, K: value.K, R: value.R,+ Types: (*model.CriterionTypes)(value.Types), SubTypes: model.SearchSubTypes(value.SubTypes), ReplaceTypes: (*model.CriterionReplaceTypes)(value.ReplaceTypes)}+}diff --git a/kernel/api/contract_storage_test.go b/kernel/api/contract_storage_test.gonew file mode 100644index 0000000000..1052bd88f1--- /dev/null+++ b/kernel/api/contract_storage_test.go@@ -0,0 +1,29 @@+package api++import (+ "net/http/httptest"+ "strings"+ "testing"++ "github.com/gin-gonic/gin"+ "github.com/siyuan-note/siyuan/kernel/model"+)++func TestAPIContractReadonlyRecentDocsIgnoreBody(t *testing.T) {+ engine := gin.New()+ engine.Use(func(c *gin.Context) { c.Set(model.RoleContextKey, model.RoleReader) })+ engine.POST("/api/storage/updateRecentDocOpenTime", updateRecentDocOpenTime)+ engine.POST("/api/storage/updateRecentDocViewTime", updateRecentDocViewTime)+ engine.POST("/api/storage/updateRecentDocCloseTime", updateRecentDocCloseTime)+ engine.POST("/api/storage/batchUpdateRecentDocCloseTime", batchUpdateRecentDocCloseTime)+ for _, path := range []string{"/api/storage/updateRecentDocOpenTime", "/api/storage/updateRecentDocViewTime", "/api/storage/updateRecentDocCloseTime", "/api/storage/batchUpdateRecentDocCloseTime"} {+ for _, body := range []string{"", "{", "null", `{"rootID":42,"rootIDs":42}`} {+ recorder := httptest.NewRecorder()+ engine.ServeHTTP(recorder, httptest.NewRequest("POST", path, strings.NewReader(body)))+ requireAPIContract(t, "POST", path, recorder)+ if recorder.Code != 200 || !strings.Contains(recorder.Body.String(), `"code":0`) {+ t.Fatalf("readonly mutation should ignore body: %s %s: %s", path, body, recorder.Body.String())+ }+ }+ }+}diff --git a/kernel/api/inline_style.go b/kernel/api/inline_style.goindex 7290c0d540..ce49d4f2f2 100644--- a/kernel/api/inline_style.go+++ b/kernel/api/inline_style.go@@ -17,7 +17,7 @@package apiimport (- "net/http"+ "github.com/siyuan-note/siyuan/kernel/apicontract""github.com/88250/gulu""github.com/gin-gonic/gin"@@ -25,118 +25,63 @@ import ("github.com/siyuan-note/siyuan/kernel/util")-func getInlineStyles(c *gin.Context) {+var getInlineStyles = contractHandler(apicontract.GetInlineStyles, func(c *gin.Context, request apicontract.EmptyRequest) apicontract.Response[*apicontract.InlineStyles] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)styles, err := model.GetInlineStyles()if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[*apicontract.InlineStyles](ret)}- ret.Data = styles-}+ return apicontract.Success(inlineStylesContract(styles))+})-func setInlineStyles(c *gin.Context) {+var setInlineStyles = contractHandler(apicontract.SetInlineStyles, func(c *gin.Context, request apicontract.SetInlineStylesRequest) apicontract.Response[*apicontract.InlineStyles] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }- var stylesArg []any- var version float64- var app string- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("version", &version, true, false),- util.BindJsonArg("styles", &stylesArg, true, false),- util.BindJsonArg("app", &app, false, false),- ) {- return- }- if version != 1 && version != model.InlineStylesVersion {- ret.Code = -1- ret.Msg = "unsupported inline styles version"- return- }+ app := request.App+ input := inlineStylesModel(&apicontract.InlineStyles{Version: int(request.Version), Styles: request.Styles, Builtin: request.Builtin, Order: request.Order, AV: request.AV})var saved *model.InlineStylesvar changed boolvar err error- if version == 1 {- var data []byte- if data, err = gulu.JSON.MarshalJSON(stylesArg); err == nil {- styles := []*model.InlineStyle{}- if err = gulu.JSON.UnmarshalJSON(data, &styles); err == nil {- saved, changed, err = model.SetInlineStyles(styles)- }- }+ if request.Version == 1 {+ saved, changed, err = model.SetInlineStyles(input.Styles)} else {- var data []byte- if data, err = gulu.JSON.MarshalJSON(arg); err == nil {- styles := &model.InlineStyles{}- if err = gulu.JSON.UnmarshalJSON(data, styles); err == nil {- saved, changed, err = model.SetInlineStylesData(styles)- }- }+ saved, changed, err = model.SetInlineStylesData(input)}if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[*apicontract.InlineStyles](ret)}- ret.Data = savedif changed {evt := util.NewCmdResult("reloadInlineStyles", 0, util.PushModeBroadcastMainExcludeSelfApp)evt.AppId = apputil.PushEvent(evt)util.ReloadPublishServiceSessions()}-}-func setWorkspaceAVPalette(c *gin.Context) {+ return apicontract.Success(inlineStylesContract(saved))+})++var setWorkspaceAVPalette = contractHandler(apicontract.SetWorkspaceAVPalette, func(c *gin.Context, request apicontract.WorkspaceAVPaletteRequest) apicontract.Response[*apicontract.InlineStyles] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }- var app string- var colors, order, builtinColors []any- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("colors", &colors, true, false),- util.BindJsonArg("order", &order, true, false),- util.BindJsonArg("builtinColors", &builtinColors, false, false),- util.BindJsonArg("app", &app, false, false),- ) {- return- }- data, err := gulu.JSON.MarshalJSON(arg)- if err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }- update := &model.WorkspaceAVPaletteUpdate{}- if err = gulu.JSON.UnmarshalJSON(data, update); err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }+ app := request.App+ update := workspaceAVPaletteUpdateModel(&apicontract.WorkspaceAVPaletteUpdate{Colors: request.Colors, Order: request.Order, BuiltinColors: request.BuiltinColors})saved, changed, err := model.SetWorkspaceAVPalette(update)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[*apicontract.InlineStyles](ret)}- ret.Data = savedif changed {evt := util.NewCmdResult("reloadInlineStyles", 0, util.PushModeBroadcastMainExcludeSelfApp)evt.AppId = apputil.PushEvent(evt)util.ReloadPublishServiceSessions()}-}++ return apicontract.Success(inlineStylesContract(saved))+})diff --git a/kernel/api/storage.go b/kernel/api/storage.goindex ad78c8723d..096000a1c1 100644--- a/kernel/api/storage.go+++ b/kernel/api/storage.go@@ -17,7 +17,8 @@package apiimport (- "net/http"+ "encoding/json"+ "github.com/siyuan-note/siyuan/kernel/apicontract""strings""github.com/88250/gulu"@@ -26,68 +27,44 @@ import ("github.com/siyuan-note/siyuan/kernel/util")-func getLocalStorage(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)+var getLocalStorage = contractHandler(apicontract.GetLocalStorage, func(c *gin.Context, request apicontract.EmptyRequest) apicontract.Response[map[string]apicontract.JSONValue] {data := model.GetLocalStorage()if model.IsReadOnlyRoleContext(c) {data = model.FilterLocalStorageByPublishAccess(data)}- ret.Data = data-}--func getLocalStorageVal(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return storageContract(data)+})- var key string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("key", &key, true, true)) {- return- }+var getLocalStorageVal = contractHandler(apicontract.GetLocalStorageVal, func(c *gin.Context, request apicontract.StorageKeyRequest) apicontract.Response[apicontract.JSONValue] {+ key := request.Keydata := model.GetLocalStorage()if model.IsReadOnlyRoleContext(c) {data = model.FilterLocalStorageByPublishAccess(data)}- ret.Data = data[key]-}--func getLocalStorageVals(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return+ serialized, err := json.Marshal(data[key])+ if err != nil {+ return apicontract.Failure[apicontract.JSONValue](-1, err.Error())}-- var keysArg []any- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keys", &keysArg, true, true)) {- return+ var value apicontract.JSONValue+ if err = json.Unmarshal(serialized, &value); err != nil {+ return apicontract.Failure[apicontract.JSONValue](-1, err.Error())}+ return apicontract.Success(value)+})- var keys []string- for _, key := range keysArg {- ks, elemOk := key.(string)- if !elemOk {- ret.Code = -1- ret.Msg = "Field [keys]: each element should be of type [String]"- return- }- if ks == "" {- ret.Code = -1- ret.Msg = "Field [keys]: each element must not be empty"- return+var getLocalStorageVals = contractHandler(apicontract.GetLocalStorageVals, func(c *gin.Context, request apicontract.StorageKeysRequest) apicontract.Response[map[string]apicontract.JSONValue] {++ keys := request.Keys+ if len(keys) == 0 {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, "Field [keys] must not be empty")+ }+ for _, key := range keys {+ if key == "" {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, "Field [keys]: each element must not be empty")}- keys = append(keys, ks)}-data := model.GetLocalStorage()if model.IsReadOnlyRoleContext(c) {data = model.FilterLocalStorageByPublishAccess(data)@@ -96,523 +73,329 @@ func getLocalStorageVals(c *gin.Context) {for _, k := range keys {out[k] = data[k]}- ret.Data = out-}+ return storageContract(out)+})-func setLocalStorageVal(c *gin.Context) {+var setLocalStorageVal = contractHandler(apicontract.SetLocalStorageVal, func(c *gin.Context, request apicontract.StorageSetRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var key string- var app string- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("key", &key, true, true),- util.BindJsonArg("app", &app, false, false),- ) {- return+ key, app := request.Key, request.App+ input, err := storageModelValues(map[string]apicontract.JSONValue{key: request.Val})+ if err != nil {+ return apicontract.Failure[apicontract.Null](-1, err.Error())}- val := arg["val"]-+ val := input[key]setKeyVals, err := model.SetLocalStorageVals(map[string]any{key: val})if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}evt := util.NewCmdResult("setLocalStorageVal", 0, util.PushModeBroadcastMainExcludeSelfApp)evt.AppId = appevt.Data = map[string]any{"key": key, "val": setKeyVals[key]}util.PushEvent(evt)-}-func setLocalStorageVals(c *gin.Context) {+ return apicontract.Success(apicontract.Null{})+})++var setLocalStorageVals = contractHandler(apicontract.SetLocalStorageVals, func(c *gin.Context, request apicontract.StorageSetKeysRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return+ app := request.App+ if len(request.KeyVals) == 0 {+ return apicontract.Failure[apicontract.Null](-1, "Field [keyVals] must not be empty")}-- var keyVals map[string]any- var app string- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("keyVals", &keyVals, true, true),- util.BindJsonArg("app", &app, false, false),- ) {- return+ keyVals, err := storageModelValues(request.KeyVals)+ if err != nil {+ return apicontract.Failure[apicontract.Null](-1, err.Error())}-setKeyVals, err := model.SetLocalStorageVals(keyVals)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}evtSet := util.NewCmdResult("setLocalStorageVals", 0, util.PushModeBroadcastMainExcludeSelfApp)evtSet.AppId = appevtSet.Data = map[string]any{"keyVals": setKeyVals}util.PushEvent(evtSet)-}-func removeLocalStorageVal(c *gin.Context) {- 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 key string- var app string- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("key", &key, true, true),- util.BindJsonArg("app", &app, false, false),- ) {- return- }+var removeLocalStorageVal = contractHandler(apicontract.RemoveLocalStorageVal, func(c *gin.Context, request apicontract.StorageRemoveRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()+ key, app := request.Key, request.Apperr := model.RemoveLocalStorageVals([]string{key})if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}evt := util.NewCmdResult("removeLocalStorageVal", 0, util.PushModeBroadcastMainExcludeSelfApp)evt.AppId = appevt.Data = map[string]any{"key": key}util.PushEvent(evt)-}-func removeLocalStorageVals(c *gin.Context) {- 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 removeLocalStorageVals = contractHandler(apicontract.RemoveLocalStorageVals, func(c *gin.Context, request apicontract.StorageRemoveKeysRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()- var keysArg []any- var app string- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("keys", &keysArg, true, true),- util.BindJsonArg("app", &app, false, false),- ) {- return+ keys := request.Keys+ if len(keys) == 0 {+ return apicontract.Failure[apicontract.Null](-1, "Field [keys] must not be empty")}-- var keys []string- for _, key := range keysArg {- ks, elemOk := key.(string)- if !elemOk {- ret.Code = -1- ret.Msg = "Field [keys]: each element should be of type [String]"- return- }- if ks == "" {- ret.Code = -1- ret.Msg = "Field [keys]: each element must not be empty"- return+ for _, key := range keys {+ if key == "" {+ return apicontract.Failure[apicontract.Null](-1, "Field [keys]: each element must not be empty")}- keys = append(keys, ks)}-+ app := request.Apperr := model.RemoveLocalStorageVals(keys)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}evt := util.NewCmdResult("removeLocalStorageVals", 0, util.PushModeBroadcastMainExcludeSelfApp)evt.AppId = appevt.Data = map[string]any{"keys": keys}util.PushEvent(evt)-}-func getCriteria(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)+ return apicontract.Success(apicontract.Null{})+})++var getCriteria = contractHandler(apicontract.GetCriteria, func(c *gin.Context, request apicontract.EmptyRequest) apicontract.Response[[]*apicontract.Criterion] {data := model.GetCriteria()if model.IsReadOnlyRoleContext(c) {publishAccess := model.GetPublishAccess()data = model.FilterCriteriaByPublishAccess(c, publishAccess, data)}- ret.Data = data-}+ return apicontract.Success(criterionContracts(data))+})-func setCriterion(c *gin.Context) {+var setCriterion = contractHandler(apicontract.SetCriterion, func(c *gin.Context, request apicontract.SetCriterionRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }- var criterionRaw any- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("criterion", &criterionRaw, true, false)) {- return+ if request.Criterion == nil {+ return apicontract.Failure[apicontract.Null](-1, "Field [criterion] is required")}-- param, err := gulu.JSON.MarshalJSON(criterionRaw)+ criterion := criterionModel(*request.Criterion)+ err := model.SetCriterion(criterion)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}- criterion := &model.Criterion{}- if err = gulu.JSON.UnmarshalJSON(param, criterion); err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }+ return apicontract.Success(apicontract.Null{})+})- err = model.SetCriterion(criterion)- if err != nil {- ret.Code = -1- ret.Msg = err.Error()- return- }-}--func removeCriterion(c *gin.Context) {+var removeCriterion = contractHandler(apicontract.RemoveCriterion, func(c *gin.Context, request apicontract.RemoveCriterionRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var name string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("name", &name, true, true)) {- return- }+ name := request.Nameerr := model.RemoveCriterion(name)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}-func getRecentDocs(c *gin.Context) {+ return apicontract.Success(apicontract.Null{})+})++var getRecentDocs = contractHandler(apicontract.GetRecentDocs, func(c *gin.Context, request apicontract.RecentDocsRequest) apicontract.Response[[]*apicontract.RecentDoc] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- var sortBy string- arg := map[string]any{}- // 兼容旧版接口,不能直接使用 util.JsonArg()- if err := c.ShouldBindJSON(&arg); err == nil {- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("sortBy", &sortBy, false, false)) {- return- }- }+ sortBy := request.SortBydata, err := model.GetRecentDocs(sortBy)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[[]*apicontract.RecentDoc](ret)}if model.IsReadOnlyRoleContext(c) {publishAccess := model.GetPublishAccess()data = model.FilterRecentDocsByPublishAccess(c, publishAccess, data)}- ret.Data = data-}+ return apicontract.Success(recentDocContracts(data))+})-func updateRecentDocOpenTime(c *gin.Context) {+var updateRecentDocOpenTime = contractHandler(apicontract.UpdateRecentDocOpenTime, func(c *gin.Context, request apicontract.RecentDocUpdateRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- if model.IsReadOnlyRoleContext(c) {- return- }-- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var rootID string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("rootID", &rootID, false, false)) {- return- }+ rootID := request.RootIDif "" == rootID {- return+ return contractFailure[apicontract.Null](ret)}err := model.UpdateRecentDocOpenTime(rootID)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}--func updateRecentDocViewTime(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- if model.IsReadOnlyRoleContext(c) {- return- }+ return apicontract.Success(apicontract.Null{})+}, skipReadonlyStorageMutation)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+var updateRecentDocViewTime = contractHandler(apicontract.UpdateRecentDocViewTime, func(c *gin.Context, request apicontract.RecentDocUpdateRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()- var rootID string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("rootID", &rootID, false, false)) {- return- }+ rootID := request.RootIDif "" == rootID {- return+ return contractFailure[apicontract.Null](ret)}err := model.UpdateRecentDocViewTime(rootID)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}-func updateRecentDocCloseTime(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- if model.IsReadOnlyRoleContext(c) {- return- }+ return apicontract.Success(apicontract.Null{})+}, skipReadonlyStorageMutation)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+var updateRecentDocCloseTime = contractHandler(apicontract.UpdateRecentDocCloseTime, func(c *gin.Context, request apicontract.RecentDocUpdateRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()- var rootID string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("rootID", &rootID, false, false)) {- return- }+ rootID := request.RootIDif "" == rootID {- return+ return contractFailure[apicontract.Null](ret)}err := model.UpdateRecentDocCloseTime(rootID)if err != nil {ret.Code = -1ret.Msg = err.Error()- return- }-}--func batchUpdateRecentDocCloseTime(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)-- if model.IsReadOnlyRoleContext(c) {- return+ return contractFailure[apicontract.Null](ret)}- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+ return apicontract.Success(apicontract.Null{})+}, skipReadonlyStorageMutation)- var rootIDsArg []any- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("rootIDs", &rootIDsArg, false, false)) {- return- }+var batchUpdateRecentDocCloseTime = contractHandler(apicontract.BatchUpdateRecentDocCloseTime, func(c *gin.Context, request apicontract.RecentDocsUpdateRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()- var rootIDs []string- for _, id := range rootIDsArg {- str, elemOk := id.(string)- if !elemOk {- continue- }- if "" == str {- continue- }- rootIDs = append(rootIDs, str)- }+ rootIDs := request.RootIDsif 0 == len(rootIDs) {- return+ return contractFailure[apicontract.Null](ret)}err := model.BatchUpdateRecentDocCloseTime(rootIDs)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}-func getOutlineStorage(c *gin.Context) {- ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)+ return apicontract.Success(apicontract.Null{})+}, skipReadonlyStorageMutation)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }+var getOutlineStorage = contractHandler(apicontract.GetOutlineStorage, func(c *gin.Context, request apicontract.OutlineStorageRequest) apicontract.Response[map[string]apicontract.JSONValue] {+ ret := gulu.Ret.NewResult()- var docID string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("docID", &docID, true, true)) {- return- }+ docID := request.DocIDdata, err := model.GetOutlineStorage(docID)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[map[string]apicontract.JSONValue](ret)}- ret.Data = data-}+ return storageContract(data)+})-func setOutlineStorage(c *gin.Context) {+var setOutlineStorage = contractHandler(apicontract.SetOutlineStorage, func(c *gin.Context, request apicontract.OutlineStorageSetRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var docID string- var val map[string]any- if !util.ParseJsonArgs(arg, ret,- util.BindJsonArg("docID", &docID, true, true),- util.BindJsonArg("val", &val, true, false),- ) {- return+ docID := request.DocID+ val, err := storageModelValues(request.Val)+ if err != nil {+ return apicontract.Failure[apicontract.Null](-1, err.Error())}-- err := model.SetOutlineStorage(docID, val)+ err = model.SetOutlineStorage(docID, val)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}-func removeOutlineStorage(c *gin.Context) {- 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 removeOutlineStorage = contractHandler(apicontract.RemoveOutlineStorage, func(c *gin.Context, request apicontract.OutlineStorageRequest) apicontract.Response[apicontract.Null] {+ ret := gulu.Ret.NewResult()- var docID string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("docID", &docID, true, true)) {- return- }+ docID := request.DocIDerr := model.RemoveOutlineStorage(docID)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[apicontract.Null](ret)}-}-func getViewState(c *gin.Context) {- 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 getViewState = contractHandler(apicontract.GetViewState, func(c *gin.Context, request apicontract.StorageKeyRequest) apicontract.Response[map[string]apicontract.JSONValue] {+ ret := gulu.Ret.NewResult()- var key string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("key", &key, true, true)) {- return- }+ key := request.Keydata, err := model.GetViewState(key)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[map[string]apicontract.JSONValue](ret)}- ret.Data = data-}+ return storageContract(data)+})-func patchViewState(c *gin.Context) {+var patchViewState = contractHandler(apicontract.PatchViewState, func(c *gin.Context, request apicontract.ViewStatePatchRequest) apicontract.Response[map[string]apicontract.JSONValue] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var key string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("key", &key, true, true)) {- return- }- values := map[string]any{}- if value, exists := arg["values"]; exists {- var valid bool- values, valid = value.(map[string]any)- if !valid {- ret.Code = -1- ret.Msg = "Field [values]: should be of type [Object]"- return+ key, removeKeys := request.Key, request.RemoveKeys+ for _, key := range removeKeys {+ if strings.TrimSpace(key) == "" {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, "Field [removeKeys]: each element should be a non-empty String")}}- removeKeys, valid := parseViewStateRemoveKeys(arg["removeKeys"])- if !valid {- ret.Code = -1- ret.Msg = "Field [removeKeys]: each element should be a non-empty String"- return+ values, err := storageModelValues(request.Values)+ if err != nil {+ return apicontract.Failure[map[string]apicontract.JSONValue](-1, err.Error())}data, err := model.PatchViewState(key, values, removeKeys)if err != nil {ret.Code = -1ret.Msg = err.Error()- return+ return contractFailure[map[string]apicontract.JSONValue](ret)}- ret.Data = data-}+ return storageContract(data)+})-func removeViewState(c *gin.Context) {+var removeViewState = contractHandler(apicontract.RemoveViewState, func(c *gin.Context, request apicontract.StorageKeyRequest) apicontract.Response[apicontract.Null] {ret := gulu.Ret.NewResult()- defer c.JSON(http.StatusOK, ret)- arg, ok := util.JsonArg(c, ret)- if !ok {- return- }-- var key string- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("key", &key, true, true)) {- return- }+ key := request.Keyif err := model.RemoveViewState(key); err != nil {ret.Code = -1ret.Msg = err.Error()}-}++ return contractFailure[apicontract.Null](ret)+})func parseViewStateRemoveKeys(value any) (ret []string, valid bool) {if nil == value {diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.goindex 3dd8fd2d78..609b5ae287 100644--- a/kernel/apicontract/contracts.go+++ b/kernel/apicontract/contracts.go@@ -385,3 +385,28 @@ var ResetBlockAttrs = define[EmptyRequest, Null]("resetBlockAttrs", "/api/attr/rvar SearchAttributeViewNonRelationKey = define[EmptyRequest, Null]("searchAttributeViewNonRelationKey", "/api/av/searchAttributeViewNonRelationKey", NoBody, ResponseOptions{}, "POST")var SetLocalStorage = define[EmptyRequest, Null]("setLocalStorage", "/api/storage/setLocalStorage", NoBody, ResponseOptions{}, "POST")var DeprecatedReloadUI = define[EmptyRequest, Null]("deprecatedReloadUI", "/api/system/reloadUI", NoBody, ResponseOptions{}, "POST")++var GetLocalStorage = define[EmptyRequest, map[string]JSONValue]("getLocalStorage", "/api/storage/getLocalStorage", NoBody, ResponseOptions{}, "POST")+var GetLocalStorageVal = define[StorageKeyRequest, JSONValue]("getLocalStorageVal", "/api/storage/getLocalStorageVal", JSONBody, ResponseOptions{}, "POST")+var GetLocalStorageVals = define[StorageKeysRequest, map[string]JSONValue]("getLocalStorageVals", "/api/storage/getLocalStorageVals", JSONBody, ResponseOptions{}, "POST")+var SetLocalStorageVal = define[StorageSetRequest, Null]("setLocalStorageVal", "/api/storage/setLocalStorageVal", JSONBody, ResponseOptions{}, "POST")+var SetLocalStorageVals = define[StorageSetKeysRequest, Null]("setLocalStorageVals", "/api/storage/setLocalStorageVals", JSONBody, ResponseOptions{}, "POST")+var RemoveLocalStorageVal = define[StorageRemoveRequest, Null]("removeLocalStorageVal", "/api/storage/removeLocalStorageVal", JSONBody, ResponseOptions{}, "POST")+var RemoveLocalStorageVals = define[StorageRemoveKeysRequest, Null]("removeLocalStorageVals", "/api/storage/removeLocalStorageVals", JSONBody, ResponseOptions{}, "POST")+var GetOutlineStorage = define[OutlineStorageRequest, map[string]JSONValue]("getOutlineStorage", "/api/storage/getOutlineStorage", JSONBody, ResponseOptions{}, "POST")+var SetOutlineStorage = define[OutlineStorageSetRequest, Null]("setOutlineStorage", "/api/storage/setOutlineStorage", JSONBody, ResponseOptions{}, "POST")+var RemoveOutlineStorage = define[OutlineStorageRequest, Null]("removeOutlineStorage", "/api/storage/removeOutlineStorage", JSONBody, ResponseOptions{}, "POST")+var GetViewState = define[StorageKeyRequest, map[string]JSONValue]("getViewState", "/api/storage/getViewState", JSONBody, ResponseOptions{}, "POST")+var PatchViewState = define[ViewStatePatchRequest, map[string]JSONValue]("patchViewState", "/api/storage/patchViewState", JSONBody, ResponseOptions{}, "POST")+var RemoveViewState = define[StorageKeyRequest, Null]("removeViewState", "/api/storage/removeViewState", JSONBody, ResponseOptions{}, "POST")+var GetRecentDocs = define[RecentDocsRequest, []*RecentDoc]("getRecentDocs", "/api/storage/getRecentDocs", LegacyOptionalBody, ResponseOptions{}, "POST")+var GetCriteria = define[EmptyRequest, []*Criterion]("getCriteria", "/api/storage/getCriteria", NoBody, ResponseOptions{}, "POST")+var SetCriterion = define[SetCriterionRequest, Null]("setCriterion", "/api/storage/setCriterion", JSONBody, ResponseOptions{}, "POST")+var RemoveCriterion = define[RemoveCriterionRequest, Null]("removeCriterion", "/api/storage/removeCriterion", JSONBody, ResponseOptions{}, "POST")+var UpdateRecentDocOpenTime = define[RecentDocUpdateRequest, Null]("updateRecentDocOpenTime", "/api/storage/updateRecentDocOpenTime", JSONBody, ResponseOptions{}, "POST")+var UpdateRecentDocViewTime = define[RecentDocUpdateRequest, Null]("updateRecentDocViewTime", "/api/storage/updateRecentDocViewTime", JSONBody, ResponseOptions{}, "POST")+var UpdateRecentDocCloseTime = define[RecentDocUpdateRequest, Null]("updateRecentDocCloseTime", "/api/storage/updateRecentDocCloseTime", JSONBody, ResponseOptions{}, "POST")+var BatchUpdateRecentDocCloseTime = define[RecentDocsUpdateRequest, Null]("batchUpdateRecentDocCloseTime", "/api/storage/batchUpdateRecentDocCloseTime", JSONBody, ResponseOptions{}, "POST")+var GetInlineStyles = define[EmptyRequest, *InlineStyles]("getInlineStyles", "/api/storage/getInlineStyles", NoBody, ResponseOptions{}, "POST")+var SetInlineStyles = define[SetInlineStylesRequest, *InlineStyles]("setInlineStyles", "/api/storage/setInlineStyles", JSONBody, ResponseOptions{}, "POST")+var SetWorkspaceAVPalette = define[WorkspaceAVPaletteRequest, *InlineStyles]("setWorkspaceAVPalette", "/api/storage/setWorkspaceAVPalette", JSONBody, ResponseOptions{}, "POST")diff --git a/kernel/apicontract/criterion.go b/kernel/apicontract/criterion.gonew file mode 100644index 0000000000..2856303381--- /dev/null+++ b/kernel/apicontract/criterion.go@@ -0,0 +1,81 @@+package apicontract++type Criterion struct {+ Name string `json:"name" api:"optional,nullable"`+ // 排序方式:0 按块类型(默认),1 按创建时间升序,2 按创建时间降序,3 按更新时间升序,4 按更新时间降序,+ // 5 按内容顺序,6 按相关度升序,7 按相关度降序+ Sort int `json:"sort" api:"optional,nullable"`+ Group int `json:"group" api:"optional,nullable"` // 0:不分组,1:按文档分组+ HasReplace bool `json:"hasReplace" api:"optional,nullable"` // 是否有替换+ Method int `json:"method" api:"optional,nullable"` // 0:文本,1:查询语法,2:SQL,3:正则表达式,4:语义搜索+ HPath string `json:"hPath" api:"optional,nullable"`+ IDPath []string `json:"idPath" api:"optional,nullable"`+ K string `json:"k" api:"optional,nullable"` // 搜索关键字+ R string `json:"r" api:"optional,nullable"` // 替换关键字+ Types *CriterionTypes `json:"types" api:"optional,nullable"` // 类型过滤选项+ SubTypes SearchSubTypes `json:"subTypes" api:"optional,nullable"` // 子类型过滤选项+ ReplaceTypes *CriterionReplaceTypes `json:"replaceTypes" api:"optional,nullable"` // 替换类型过滤选项+}++type CriterionTypes struct {+ MathBlock bool `json:"mathBlock" api:"optional,nullable"`+ Table bool `json:"table" api:"optional,nullable"`+ Blockquote bool `json:"blockquote" api:"optional,nullable"`+ SuperBlock bool `json:"superBlock" api:"optional,nullable"`+ Paragraph bool `json:"paragraph" api:"optional,nullable"`+ Document bool `json:"document" api:"optional,nullable"`+ Heading bool `json:"heading" api:"optional,nullable"`+ List bool `json:"list" api:"optional,nullable"`+ ListItem bool `json:"listItem" api:"optional,nullable"`+ CodeBlock bool `json:"codeBlock" api:"optional,nullable"`+ HtmlBlock bool `json:"htmlBlock" api:"optional,nullable"`+ EmbedBlock bool `json:"embedBlock" api:"optional,nullable"`+ DatabaseBlock bool `json:"databaseBlock" api:"optional,nullable"`+ AudioBlock bool `json:"audioBlock" api:"optional,nullable"`+ VideoBlock bool `json:"videoBlock" api:"optional,nullable"`+ IFrameBlock bool `json:"iframeBlock" api:"optional,nullable"`+ WidgetBlock bool `json:"widgetBlock" api:"optional,nullable"`+ Callout bool `json:"callout" api:"optional,nullable"`+}++type CriterionReplaceTypes struct {+ Text bool `json:"text" api:"optional,nullable"`+ ImgText bool `json:"imgText" api:"optional,nullable"`+ ImgTitle bool `json:"imgTitle" api:"optional,nullable"`+ ImgSrc bool `json:"imgSrc" api:"optional,nullable"`+ AText bool `json:"aText" api:"optional,nullable"`+ ATitle bool `json:"aTitle" api:"optional,nullable"`+ AHref bool `json:"aHref" api:"optional,nullable"`+ Code bool `json:"code" api:"optional,nullable"`+ Em bool `json:"em" api:"optional,nullable"`+ Strong bool `json:"strong" api:"optional,nullable"`+ InlineMath bool `json:"inlineMath" api:"optional,nullable"`+ InlineMemo bool `json:"inlineMemo" api:"optional,nullable"`+ BlockRef bool `json:"blockRef" api:"optional,nullable"`+ FileAnnotationRef bool `json:"fileAnnotationRef" api:"optional,nullable"`+ Kbd bool `json:"kbd" api:"optional,nullable"`+ Mark bool `json:"mark" api:"optional,nullable"`+ S bool `json:"s" api:"optional,nullable"`+ Sub bool `json:"sub" api:"optional,nullable"`+ Sup bool `json:"sup" api:"optional,nullable"`+ Tag bool `json:"tag" api:"optional,nullable"`+ U bool `json:"u" api:"optional,nullable"`+ DocTitle bool `json:"docTitle" api:"optional,nullable"`+ CodeBlock bool `json:"codeBlock" api:"optional,nullable"`+ MathBlock bool `json:"mathBlock" api:"optional,nullable"`+ HtmlBlock bool `json:"htmlBlock" api:"optional,nullable"`+}++type SearchSubTypes struct {+ Heading map[string]bool `json:"heading" api:"optional,nullable"`+ List map[string]bool `json:"list" api:"optional,nullable"`+ ListItem map[string]bool `json:"listItem" api:"optional,nullable"`+}++type SetCriterionRequest struct {+ Criterion *Criterion `json:"criterion" api:"legacyobject"`+}++type RemoveCriterionRequest struct {+ Name string `json:"name" api:"trim"`+}diff --git a/kernel/apicontract/inline_style.go b/kernel/apicontract/inline_style.gonew file mode 100644index 0000000000..57621fea72--- /dev/null+++ b/kernel/apicontract/inline_style.go@@ -0,0 +1,88 @@+package apicontract++type InlineStyleTheme struct {+ Color string `json:"color,omitempty" api:"optional,nullable"`+ BackgroundColor string `json:"backgroundColor,omitempty" api:"optional,nullable"`+}++type InlineStyle struct {+ ID string `json:"id" api:"optional,nullable"`+ Name string `json:"name" api:"optional,nullable"`+ Hidden bool `json:"hidden,omitempty" api:"optional,nullable"`+ Light *InlineStyleTheme `json:"light" api:"optional,nullable"`+ Dark *InlineStyleTheme `json:"dark" api:"optional,nullable"`+}++type InlineStyleBuiltinColor struct {+ Index int `json:"index" api:"optional,nullable"`+ Light *InlineStyleTheme `json:"light" api:"optional,nullable"`+ Dark *InlineStyleTheme `json:"dark" api:"optional,nullable"`+}++type InlineStyleBuiltinStyle struct {+ ID string `json:"id" api:"optional,nullable"`+ Light *InlineStyleTheme `json:"light" api:"optional,nullable"`+ Dark *InlineStyleTheme `json:"dark" api:"optional,nullable"`+}++type InlineStyleBuiltinHidden struct {+ Color []int `json:"color" api:"optional,nullable"`+ BackgroundColor []int `json:"backgroundColor" api:"optional,nullable"`+ Style1 []string `json:"style1" api:"optional,nullable"`+ AV []int `json:"av" api:"optional,nullable"`+}++type InlineStyleBuiltin struct {+ Colors []*InlineStyleBuiltinColor `json:"colors" api:"optional,nullable"`+ Styles []*InlineStyleBuiltinStyle `json:"styles" api:"optional,nullable"`+ Hidden *InlineStyleBuiltinHidden `json:"hidden" api:"optional,nullable"`+}++type InlineStyleOrder struct {+ Color []string `json:"color" api:"optional,nullable"`+ BackgroundColor []string `json:"backgroundColor" api:"optional,nullable"`+ Style1 []string `json:"style1" api:"optional,nullable"`+}++type InlineStyleAV struct {+ Colors []*AttributeViewCustomColor `json:"colors" api:"optional,nullable"`+ Order []string `json:"order" api:"optional,nullable"`+}++type WorkspaceAVBuiltinColorUpdate struct {+ Index int `json:"index" api:"optional,nullable"`+ Customized bool `json:"customized" api:"optional,nullable"`+ Light *InlineStyleTheme `json:"light" api:"optional,nullable"`+ Dark *InlineStyleTheme `json:"dark" api:"optional,nullable"`+ Hidden bool `json:"hidden" api:"optional,nullable"`+}++type WorkspaceAVPaletteUpdate struct {+ Colors []*AttributeViewCustomColor `json:"colors" api:"optional,nullable"`+ Order []string `json:"order" api:"optional,nullable"`+ BuiltinColors []*WorkspaceAVBuiltinColorUpdate `json:"builtinColors" api:"optional,nullable"`+}++type InlineStyles struct {+ Version int `json:"version" api:"optional,nullable"`+ Styles []*InlineStyle `json:"styles" api:"optional,nullable"`+ Builtin *InlineStyleBuiltin `json:"builtin" api:"optional,nullable"`+ Order *InlineStyleOrder `json:"order" api:"optional,nullable"`+ AV *InlineStyleAV `json:"av" api:"optional,nullable"`+}++type AttributeViewColorTheme struct {+ Color string `json:"color" api:"optional,nullable"`+ BackgroundColor string `json:"backgroundColor" api:"optional,nullable"`+}++type AttributeViewColor struct {+ Light AttributeViewColorTheme `json:"light" api:"optional,nullable"`+ Dark AttributeViewColorTheme `json:"dark" api:"optional,nullable"`+}++type AttributeViewCustomColor struct {+ Index int `json:"index" api:"optional,nullable"`+ Hidden bool `json:"hidden,omitempty" api:"optional,nullable"`+ AttributeViewColor+}diff --git a/kernel/apicontract/inline_style_input.go b/kernel/apicontract/inline_style_input.gonew file mode 100644index 0000000000..db86fe9423--- /dev/null+++ b/kernel/apicontract/inline_style_input.go@@ -0,0 +1,108 @@+package apicontract++import (+ "bytes"+ "encoding/json"+ "errors"+ "fmt"+ "io"+)++type SetInlineStylesRequest struct {+ Version float64 `json:"version"`+ Styles []*InlineStyle `json:"styles"`+ Builtin *InlineStyleBuiltin `json:"builtin" api:"optional"`+ Order *InlineStyleOrder `json:"order" api:"optional"`+ AV *InlineStyleAV `json:"av" api:"optional"`+ App string `json:"app" api:"optional,nullable"`+}++type WorkspaceAVPaletteRequest struct {+ Colors []*AttributeViewCustomColor `json:"colors"`+ Order []string `json:"order"`+ BuiltinColors []*WorkspaceAVBuiltinColorUpdate `json:"builtinColors" api:"optional,nullable"`+ App string `json:"app" api:"optional,nullable"`+}++// legacyJSONValue 保留先解析通用 JSON 再绑定结构体时的数字归一化和大小写匹配。+func legacyJSONValue[T any](raw []byte) (value T, err error) {+ var normalized any+ if err = json.Unmarshal(raw, &normalized); err != nil {+ return+ }+ data, err := json.Marshal(normalized)+ if err == nil {+ err = json.Unmarshal(data, &value)+ }+ return+}++func legacyField[T any](fields map[string]json.RawMessage, key, kind string, required bool) (value T, err error) {+ raw := fields[key]+ if len(raw) == 0 || bytes.Equal(raw, []byte("null")) {+ if required {+ err = fmt.Errorf("Field [%s] is required", key)+ }+ return+ }+ if json.Unmarshal(raw, &value) != nil {+ err = fmt.Errorf("Field [%s] should be of type [%s]", key, kind)+ }+ return+}++func init() {+ SetInlineStyles.decodeRequest = func(reader io.Reader) (request SetInlineStylesRequest, err error) {+ fields, err := blockRequestFields(reader, "/api/storage/setInlineStyles")+ if err != nil {+ return request, err+ }+ version, err := legacyField[float64](fields, "version", "Number", true)+ if err != nil {+ return request, err+ }+ if _, err = legacyField[[]json.RawMessage](fields, "styles", "Array", true); err != nil {+ return request, err+ }+ app, err := legacyField[string](fields, "app", "String", false)+ if err != nil {+ return request, err+ }+ if version != 1 && version != 2 {+ return request, errors.New("unsupported inline styles version")+ }+ if version == 1 {+ request.Styles, err = legacyJSONValue[[]*InlineStyle](fields["styles"])+ } else {+ data, marshalErr := json.Marshal(fields)+ if marshalErr != nil {+ return request, marshalErr+ }+ request, err = legacyJSONValue[SetInlineStylesRequest](data)+ }+ request.Version, request.App = version, app+ return+ }+ SetWorkspaceAVPalette.decodeRequest = func(reader io.Reader) (request WorkspaceAVPaletteRequest, err error) {+ fields, err := blockRequestFields(reader, "/api/storage/setWorkspaceAVPalette")+ if err != nil {+ return request, err+ }+ for _, key := range []string{"colors", "order", "builtinColors"} {+ if _, err = legacyField[[]json.RawMessage](fields, key, "Array", key != "builtinColors"); err != nil {+ return request, err+ }+ }+ app, err := legacyField[string](fields, "app", "String", false)+ if err != nil {+ return request, err+ }+ data, err := json.Marshal(fields)+ if err != nil {+ return request, err+ }+ request, err = legacyJSONValue[WorkspaceAVPaletteRequest](data)+ request.App = app+ return+ }+}diff --git a/kernel/apicontract/legacy_routes.json b/kernel/apicontract/legacy_routes.jsonindex 30d5b09f31..8ce91ec0f3 100644--- a/kernel/apicontract/legacy_routes.json+++ b/kernel/apicontract/legacy_routes.json@@ -378,30 +378,6 @@{"method":"POST","path":"/api/setting/setSnippet","handler":"setConfSnippet"},{"method":"POST","path":"/api/setting/setTheme","handler":"setTheme"},{"method":"POST","path":"/api/setting/setVariables","handler":"setVariables"},- {"method":"POST","path":"/api/storage/batchUpdateRecentDocCloseTime","handler":"batchUpdateRecentDocCloseTime"},- {"method":"POST","path":"/api/storage/getCriteria","handler":"getCriteria"},- {"method":"POST","path":"/api/storage/getInlineStyles","handler":"getInlineStyles"},- {"method":"POST","path":"/api/storage/getLocalStorage","handler":"getLocalStorage"},- {"method":"POST","path":"/api/storage/getLocalStorageVal","handler":"getLocalStorageVal"},- {"method":"POST","path":"/api/storage/getLocalStorageVals","handler":"getLocalStorageVals"},- {"method":"POST","path":"/api/storage/getOutlineStorage","handler":"getOutlineStorage"},- {"method":"POST","path":"/api/storage/getRecentDocs","handler":"getRecentDocs"},- {"method":"POST","path":"/api/storage/getViewState","handler":"getViewState"},- {"method":"POST","path":"/api/storage/patchViewState","handler":"patchViewState"},- {"method":"POST","path":"/api/storage/removeCriterion","handler":"removeCriterion"},- {"method":"POST","path":"/api/storage/removeLocalStorageVal","handler":"removeLocalStorageVal"},- {"method":"POST","path":"/api/storage/removeLocalStorageVals","handler":"removeLocalStorageVals"},- {"method":"POST","path":"/api/storage/removeOutlineStorage","handler":"removeOutlineStorage"},- {"method":"POST","path":"/api/storage/removeViewState","handler":"removeViewState"},- {"method":"POST","path":"/api/storage/setCriterion","handler":"setCriterion"},- {"method":"POST","path":"/api/storage/setInlineStyles","handler":"setInlineStyles"},- {"method":"POST","path":"/api/storage/setLocalStorageVal","handler":"setLocalStorageVal"},- {"method":"POST","path":"/api/storage/setLocalStorageVals","handler":"setLocalStorageVals"},- {"method":"POST","path":"/api/storage/setOutlineStorage","handler":"setOutlineStorage"},- {"method":"POST","path":"/api/storage/setWorkspaceAVPalette","handler":"setWorkspaceAVPalette"},- {"method":"POST","path":"/api/storage/updateRecentDocCloseTime","handler":"updateRecentDocCloseTime"},- {"method":"POST","path":"/api/storage/updateRecentDocOpenTime","handler":"updateRecentDocOpenTime"},- {"method":"POST","path":"/api/storage/updateRecentDocViewTime","handler":"updateRecentDocViewTime"},{"method":"POST","path":"/api/sync/createCloudSyncDir","handler":"createCloudSyncDir"},{"method":"POST","path":"/api/sync/exportSyncProviderS3","handler":"exportSyncProviderS3"},{"method":"POST","path":"/api/sync/exportSyncProviderWebDAV","handler":"exportSyncProviderWebDAV"},diff --git a/kernel/apicontract/routes.go b/kernel/apicontract/routes.goindex c3a189705f..219088c408 100644--- a/kernel/apicontract/routes.go+++ b/kernel/apicontract/routes.go@@ -42,7 +42,7 @@ func ReadRoutes(apiDir string) ([]Route, map[string]string, error) {}ast.Inspect(file, func(node ast.Node) bool {if spec, ok := node.(*ast.ValueSpec); ok && len(spec.Names) == 1 && len(spec.Values) == 1 {- if call, ok := spec.Values[0].(*ast.CallExpr); ok && len(call.Args) == 2 {+ if call, ok := spec.Values[0].(*ast.CallExpr); ok && len(call.Args) >= 2 {if fun, ok := call.Fun.(*ast.Ident); ok && fun.Name == "contractHandler" {if endpoint, ok := call.Args[0].(*ast.SelectorExpr); ok {bindings[spec.Names[0].Name] = endpointNames[endpoint.Sel.Name]diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.jsonindex e6cf5e6ae8..de15060088 100644--- a/kernel/apicontract/schema.json+++ b/kernel/apicontract/schema.json@@ -37,6 +37,117 @@],"additionalProperties": false},+ "AttributeViewColorTheme": {+ "type": "object",+ "properties": {+ "backgroundColor": {+ "type": "string"+ },+ "color": {+ "type": "string"+ }+ },+ "required": [+ "backgroundColor",+ "color"+ ],+ "additionalProperties": false+ },+ "AttributeViewColorThemeInput": {+ "type": "object",+ "properties": {+ "backgroundColor": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "color": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "AttributeViewCustomColor": {+ "type": "object",+ "properties": {+ "dark": {+ "$ref": "#/$defs/AttributeViewColorTheme"+ },+ "hidden": {+ "type": "boolean"+ },+ "index": {+ "type": "integer"+ },+ "light": {+ "$ref": "#/$defs/AttributeViewColorTheme"+ }+ },+ "required": [+ "dark",+ "index",+ "light"+ ],+ "additionalProperties": false+ },+ "AttributeViewCustomColorInput": {+ "type": "object",+ "properties": {+ "dark": {+ "anyOf": [+ {+ "$ref": "#/$defs/AttributeViewColorThemeInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "hidden": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "index": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "light": {+ "anyOf": [+ {+ "$ref": "#/$defs/AttributeViewColorThemeInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },"AutoLaunchRequestInput": {"type": "object","properties": {@@ -1409,117 +1520,100 @@},"additionalProperties": false},- "DOMTextRequestInput": {- "type": "object",- "properties": {- "dom": {- "type": "string"- }- },- "required": [- "dom"- ],- "additionalProperties": false- },- "DailyNoteBlockRequestInput": {+ "Criterion": {"type": "object","properties": {- "data": {- "type": "string"+ "group": {+ "type": "integer"},- "dataType": {+ "hPath": {"type": "string"},- "notebook": {- "type": "string"- }- },- "required": [- "data",- "dataType",- "notebook"- ],- "additionalProperties": false- },- "DeleteBlockRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "DocAttrView": {- "type": "object",- "properties": {- "id": {+ "hasReplace": {+ "type": "boolean"+ },+ "idPath": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "k": {"type": "string"},+ "method": {+ "type": "integer"+ },"name": {"type": "string"- }- },- "required": [- "id",- "name"- ],- "additionalProperties": false- },- "DocHeadingLevelData": {- "type": "object",- "properties": {- "counts": {- "type": "array",- "items": {- "type": "integer"- }},- "title": {+ "r": {"type": "string"},- "transaction": {+ "replaceTypes": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "$ref": "#/$defs/CriterionReplaceTypes"},{"type": "null"}]},- "withSubheadingCounts": {- "type": "array",- "items": {- "type": "integer"- }+ "sort": {+ "type": "integer"+ },+ "subTypes": {+ "$ref": "#/$defs/SearchSubTypes"+ },+ "types": {+ "anyOf": [+ {+ "$ref": "#/$defs/CriterionTypes"+ },+ {+ "type": "null"+ }+ ]}},"required": [- "counts",- "title",- "transaction",- "withSubheadingCounts"+ "group",+ "hPath",+ "hasReplace",+ "idPath",+ "k",+ "method",+ "name",+ "r",+ "replaceTypes",+ "sort",+ "subTypes",+ "types"],"additionalProperties": false},- "DocHeadingLevelRequestInput": {+ "CriterionInput": {"type": "object","properties": {- "id": {+ "group": {"anyOf": [{- "type": "string"+ "type": "integer"},{"type": "null"}]},- "notebook": {+ "hPath": {"anyOf": [{"type": "string"@@ -1529,410 +1623,264 @@}]},- "source": {+ "hasReplace": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]},- "target": {+ "idPath": {"anyOf": [{- "type": "integer"+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]},- "withSubheadings": {+ "k": {"anyOf": [{- "type": "boolean"+ "type": "string"},{"type": "null"}]- }- },- "additionalProperties": false- },- "DocInfo": {- "type": "object",- "properties": {- "attrViews": {+ },+ "method": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/DocAttrView"- },- {- "type": "null"- }- ]- }+ "type": "integer"},{"type": "null"}]},- "ial": {+ "name": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "type": "string"},{"type": "null"}]},- "icon": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "refCount": {- "type": "integer"- },- "refIDs": {+ "r": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "type": "string"},{"type": "null"}]},- "rootID": {- "type": "string"+ "replaceTypes": {+ "anyOf": [+ {+ "$ref": "#/$defs/CriterionReplaceTypesInput"+ },+ {+ "type": "null"+ }+ ]},- "subFileCount": {- "type": "integer"- }- },- "required": [- "attrViews",- "ial",- "icon",- "id",- "name",- "refCount",- "refIDs",- "rootID",- "subFileCount"- ],- "additionalProperties": false- },- "DocOrdersRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"+ "sort": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "subTypes": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchSubTypesInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "types": {+ "anyOf": [+ {+ "$ref": "#/$defs/CriterionTypesInput"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "id"- ],"additionalProperties": false},- "DocsInfoRequestInput": {+ "CriterionReplaceTypes": {"type": "object","properties": {- "av": {+ "aHref": {"type": "boolean"},- "ids": {- "type": "array",- "items": {- "type": "string"- }+ "aText": {+ "type": "boolean"},- "refCount": {+ "aTitle": {"type": "boolean"- }- },- "required": [- "av",- "ids",- "refCount"- ],- "additionalProperties": false- },- "DownloadInstallPkgRequestInput": {- "type": "object",- "properties": {- "downloadInstallPkg": {+ },+ "blockRef": {"type": "boolean"- }- },- "required": [- "downloadInstallPkg"- ],- "additionalProperties": false- },- "EditorReadOnlyRequestInput": {- "type": "object",- "properties": {- "readonly": {+ },+ "code": {"type": "boolean"- }- },- "required": [- "readonly"- ],- "additionalProperties": false- },- "EmbedStat": {- "type": "object",- "properties": {- "complete": {+ },+ "codeBlock": {"type": "boolean"},- "cycleCount": {- "type": "integer"+ "docTitle": {+ "type": "boolean"},- "depthLimitCount": {- "type": "integer"+ "em": {+ "type": "boolean"},- "failedQueryCount": {- "type": "integer"+ "fileAnnotationRef": {+ "type": "boolean"},- "failedResultCount": {- "type": "integer"+ "htmlBlock": {+ "type": "boolean"},- "jsEmbedCount": {- "type": "integer"+ "imgSrc": {+ "type": "boolean"},- "queryEmbedCount": {- "type": "integer"+ "imgText": {+ "type": "boolean"},- "resultCount": {- "type": "integer"+ "imgTitle": {+ "type": "boolean"},- "truncatedQueryCount": {- "type": "integer"- }- },- "required": [- "complete",- "cycleCount",- "depthLimitCount",- "failedQueryCount",- "failedResultCount",- "jsEmbedCount",- "queryEmbedCount",- "resultCount",- "truncatedQueryCount"- ],- "additionalProperties": false- },- "EmptyRequestInput": {- "type": "object",- "additionalProperties": false- },- "EncryptedNotebookStatus": {- "type": "object",- "properties": {- "id": {- "type": "string"+ "inlineMath": {+ "type": "boolean"},- "name": {- "type": "string"+ "inlineMemo": {+ "type": "boolean"},- "state": {- "type": "string",- "enum": [- "Locked",- "Unlocking",- "Unlocked",- "Locking",- "Error"- ]+ "kbd": {+ "type": "boolean"},- "unlocked": {+ "mark": {"type": "boolean"- }- },- "required": [- "id",- "name",- "state",- "unlocked"- ],- "additionalProperties": false- },- "EncryptedNotebookStatusData": {- "type": "object",- "properties": {- "boxes": {- "type": "array",- "items": {- "$ref": "#/$defs/EncryptedNotebookStatus"- }},- "count": {- "type": "integer"+ "mathBlock": {+ "type": "boolean"},- "enabled": {+ "s": {"type": "boolean"},- "hasHistoryDependency": {+ "strong": {"type": "boolean"},- "migrationBoxes": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"- }- },- {- "type": "null"- }- ]+ "sub": {+ "type": "boolean"},- "migrationPending": {+ "sup": {"type": "boolean"},- "state": {- "type": "string",- "enum": [- "Disabled",- "Enabled",- "RecoveryRequired"- ]+ "tag": {+ "type": "boolean"+ },+ "text": {+ "type": "boolean"+ },+ "u": {+ "type": "boolean"}},"required": [- "boxes",- "count",- "enabled",- "hasHistoryDependency",- "migrationBoxes",- "migrationPending",- "state"+ "aHref",+ "aText",+ "aTitle",+ "blockRef",+ "code",+ "codeBlock",+ "docTitle",+ "em",+ "fileAnnotationRef",+ "htmlBlock",+ "imgSrc",+ "imgText",+ "imgTitle",+ "inlineMath",+ "inlineMemo",+ "kbd",+ "mark",+ "mathBlock",+ "s",+ "strong",+ "sub",+ "sup",+ "tag",+ "text",+ "u"],"additionalProperties": false},- "FileAnnotationRefRequestInput": {+ "CriterionReplaceTypesInput": {"type": "object","properties": {- "id": {- "type": "string"- },- "notebook": {+ "aHref": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "FullBlockInfo": {- "type": "object",- "properties": {- "box": {- "type": "string"},- "path": {- "type": "string"+ "aText": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "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": {- "type": "object",- "properties": {- "enabled": {- "type": "number"- },- "keyword": {+ "aTitle": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "type": {- "type": "string"- }- },- "required": [- "enabled",- "type"- ],- "additionalProperties": false- },- "GetTagRequestInput": {- "type": "object",- "properties": {- "app": {+ "blockRef": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "ignoreMaxListHint": {+ "code": {"anyOf": [{"type": "boolean"@@ -1942,26 +1890,17 @@}]},- "sort": {+ "codeBlock": {"anyOf": [{- "type": "number"+ "type": "boolean"},{"type": "null"}]- }- },- "additionalProperties": false- },- "HeadingChildrenRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"},- "removeFoldAttr": {+ "docTitle": {"anyOf": [{"type": "boolean"@@ -1970,177 +1909,48 @@"type": "null"}]- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "HeadingFoldRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "scope": {- "type": "string"- }- },- "required": [- "id",- "scope"- ],- "additionalProperties": false- },- "HeadingLevelRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "ids": {- "type": "array",- "items": {- "type": "string"- }- },- "level": {- "type": "number"- }- },- "required": [- "level"- ],- "additionalProperties": false- },- "ImportNotebookCryptoBackupRequestInput": {- "type": "object",- "properties": {- "file": {- "type": "string",- "format": "binary"- },- "password": {- "type": "string"- }- },- "required": [- "file"- ],- "additionalProperties": false- },- "InsertBlockRequestInput": {- "type": "object",- "properties": {- "data": {- "type": "string"- },- "dataType": {- "type": "string"},- "nextID": {+ "em": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "parentID": {+ "fileAnnotationRef": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "previousID": {+ "htmlBlock": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "data",- "dataType"- ],- "additionalProperties": false- },- "JSONValue": {- "anyOf": [- {- "type": "null"- },- {- "type": "boolean"- },- {- "type": "number"},- {- "type": "string"- },- {- "type": "array",- "items": {- "$ref": "#/$defs/JSONValue"- }- },- {- "type": "object",- "additionalProperties": {- "$ref": "#/$defs/JSONValue"- }- }- ]- },- "ListNotebooksData": {- "type": "object",- "properties": {- "boxDocEnabled": {- "type": "boolean"- },- "notebooks": {+ "imgSrc": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Notebook"- },- {- "type": "null"- }- ]- }+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "boxDocEnabled",- "notebooks"- ],- "additionalProperties": false- },- "ListNotebooksRequestInput": {- "type": "object",- "properties": {- "flashcard": {+ },+ "imgText": {"anyOf": [{"type": "boolean"@@ -2149,337 +1959,78 @@"type": "null"}]- }- },- "additionalProperties": false- },- "LockScreenRequestInput": {- "type": "object",- "properties": {- "lockScreenMode": {- "type": "number"- }- },- "required": [- "lockScreenMode"- ],- "additionalProperties": false- },- "MoveBlockRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"},- "parentID": {+ "imgTitle": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "previousID": {+ "inlineMath": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "NetImageAssetsRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"},- "url": {+ "inlineMemo": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "NetworkData": {- "type": "object",- "properties": {- "proxy": {+ },+ "kbd": {"anyOf": [{- "$ref": "#/$defs/NetworkProxy"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "proxy"- ],- "additionalProperties": false- },- "NetworkProxy": {- "type": "object",- "properties": {- "host": {- "type": "string"- },- "port": {- "type": "string"- },- "scheme": {- "type": "string"- }- },- "required": [- "host",- "port",- "scheme"- ],- "additionalProperties": false- },- "NetworkProxyInput": {- "type": "object",- "properties": {- "host": {- "type": "string"- },- "port": {- "type": "string"- },- "scheme": {- "type": "string"- }- },- "required": [- "host",- "port",- "scheme"- ],- "additionalProperties": false- },- "NetworkServeRequestInput": {- "type": "object",- "properties": {- "networkServe": {- "type": "boolean"- }- },- "required": [- "networkServe"- ],- "additionalProperties": false- },- "NetworkServeTLSRequestInput": {- "type": "object",- "properties": {- "networkServeTLS": {- "type": "boolean"- }- },- "required": [- "networkServeTLS"- ],- "additionalProperties": false- },- "Notebook": {- "type": "object",- "properties": {- "closed": {- "type": "boolean"- },- "dueFlashcardCount": {- "type": "integer"- },- "encrypted": {- "type": "boolean"- },- "flashcardCount": {- "type": "integer"- },- "icon": {- "type": "string"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "newFlashcardCount": {- "type": "integer"- },- "sort": {- "type": "integer"- },- "sortMode": {- "type": "integer"- },- "state": {- "type": "string",- "enum": [- "Locked",- "Unlocking",- "Unlocked",- "Locking",- "Error"- ]- },- "subFileCount": {- "type": "integer"},- "unlocked": {- "type": "boolean"- }- },- "required": [- "closed",- "dueFlashcardCount",- "encrypted",- "flashcardCount",- "icon",- "id",- "name",- "newFlashcardCount",- "sort",- "sortMode",- "subFileCount",- "unlocked"- ],- "additionalProperties": false- },- "NotebookConf": {- "type": "object",- "properties": {- "boxCrypt": {+ "mark": {"anyOf": [{- "$ref": "#/$defs/NotebookEncryption"+ "type": "boolean"},{"type": "null"}]},- "closed": {- "type": "boolean"- },- "dailyNoteSavePath": {- "type": "string"- },- "dailyNoteTemplatePath": {- "type": "string"- },- "docCreateSaveBox": {- "type": "string"- },- "docCreateSavePath": {- "type": "string"- },- "docCreateTemplatePath": {- "type": "string"- },- "encrypted": {- "type": "boolean"- },- "icon": {- "type": "string"- },- "name": {- "type": "string"- },- "refCreateSaveBox": {- "type": "string"- },- "refCreateSavePath": {- "type": "string"- },- "sort": {- "type": "integer"- },- "sortMode": {- "type": "integer"- }- },- "required": [- "boxCrypt",- "closed",- "dailyNoteSavePath",- "dailyNoteTemplatePath",- "docCreateSaveBox",- "docCreateSavePath",- "docCreateTemplatePath",- "encrypted",- "icon",- "name",- "refCreateSaveBox",- "refCreateSavePath",- "sort",- "sortMode"- ],- "additionalProperties": false- },- "NotebookConfData": {- "type": "object",- "properties": {- "box": {- "type": "string"- },- "conf": {+ "mathBlock": {"anyOf": [{- "$ref": "#/$defs/NotebookConf"+ "type": "boolean"},{"type": "null"}]},- "name": {- "type": "string"- }- },- "required": [- "box",- "conf",- "name"- ],- "additionalProperties": false- },- "NotebookConfPatchInput": {- "type": "object",- "properties": {- "boxCrypt": {+ "s": {"anyOf": [{- "$ref": "#/$defs/NotebookEncryptionPatchInput"+ "type": "boolean"},{"type": "null"}]},- "closed": {+ "strong": {"anyOf": [{"type": "boolean"@@ -2489,59 +2040,145 @@}]},- "dailyNoteSavePath": {+ "sub": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "dailyNoteTemplatePath": {+ "sup": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "docCreateSaveBox": {+ "tag": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "docCreateSavePath": {+ "text": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "docCreateTemplatePath": {+ "u": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- },- "encrypted": {- "anyOf": [- {+ }+ },+ "additionalProperties": false+ },+ "CriterionTypes": {+ "type": "object",+ "properties": {+ "audioBlock": {+ "type": "boolean"+ },+ "blockquote": {+ "type": "boolean"+ },+ "callout": {+ "type": "boolean"+ },+ "codeBlock": {+ "type": "boolean"+ },+ "databaseBlock": {+ "type": "boolean"+ },+ "document": {+ "type": "boolean"+ },+ "embedBlock": {+ "type": "boolean"+ },+ "heading": {+ "type": "boolean"+ },+ "htmlBlock": {+ "type": "boolean"+ },+ "iframeBlock": {+ "type": "boolean"+ },+ "list": {+ "type": "boolean"+ },+ "listItem": {+ "type": "boolean"+ },+ "mathBlock": {+ "type": "boolean"+ },+ "paragraph": {+ "type": "boolean"+ },+ "superBlock": {+ "type": "boolean"+ },+ "table": {+ "type": "boolean"+ },+ "videoBlock": {+ "type": "boolean"+ },+ "widgetBlock": {+ "type": "boolean"+ }+ },+ "required": [+ "audioBlock",+ "blockquote",+ "callout",+ "codeBlock",+ "databaseBlock",+ "document",+ "embedBlock",+ "heading",+ "htmlBlock",+ "iframeBlock",+ "list",+ "listItem",+ "mathBlock",+ "paragraph",+ "superBlock",+ "table",+ "videoBlock",+ "widgetBlock"+ ],+ "additionalProperties": false+ },+ "CriterionTypesInput": {+ "type": "object",+ "properties": {+ "audioBlock": {+ "anyOf": [+ {"type": "boolean"},{@@ -2549,211 +2186,170 @@}]},- "icon": {+ "blockquote": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "name": {+ "callout": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "refCreateSaveBox": {+ "codeBlock": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "refCreateSavePath": {+ "databaseBlock": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "sort": {+ "document": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]},- "sortMode": {+ "embedBlock": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]- }- },- "additionalProperties": false- },- "NotebookCryptoAutoLockRequestInput": {- "type": "object",- "properties": {- "autoLockMinutes": {- "type": "number"- }- },- "required": [- "autoLockMinutes"- ],- "additionalProperties": false- },- "NotebookCryptoBackupData": {- "type": "object",- "properties": {- "file": {- "type": "string"- }- },- "required": [- "file"- ],- "additionalProperties": false- },- "NotebookEncryption": {- "type": "object",- "properties": {- "createdAt": {- "type": "integer"},- "metadata": {- "type": "string"+ "heading": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "spec": {- "type": "integer"+ "htmlBlock": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]},- "wrapNonce": {+ "iframeBlock": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]},- "wrappedDEK": {+ "list": {"anyOf": [{- "type": "string"+ "type": "boolean"},{"type": "null"}]- }- },- "required": [- "createdAt",- "spec",- "wrapNonce",- "wrappedDEK"- ],- "additionalProperties": false- },- "NotebookEncryptionPatchInput": {- "type": "object",- "properties": {- "createdAt": {+ },+ "listItem": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]},- "metadata": {+ "mathBlock": {"anyOf": [{- "anyOf": [- {- "type": "string"- },- {- "type": "array",- "items": {- "type": "integer"- }- }- ]+ "type": "boolean"},{"type": "null"}]},- "spec": {+ "paragraph": {"anyOf": [{- "type": "integer"+ "type": "boolean"},{"type": "null"}]},- "wrapNonce": {+ "superBlock": {"anyOf": [{- "anyOf": [- {- "type": "string"- },- {- "type": "array",- "items": {- "type": "integer"- }- }- ]+ "type": "boolean"},{"type": "null"}]},- "wrappedDEK": {+ "table": {"anyOf": [{- "anyOf": [- {- "type": "string"- },- {- "type": "array",- "items": {- "type": "integer"- }- }- ]+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "videoBlock": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "widgetBlock": {+ "anyOf": [+ {+ "type": "boolean"},{"type": "null"@@ -2763,131 +2359,107 @@},"additionalProperties": false},- "NotebookIDRequestInput": {+ "DOMTextRequestInput": {"type": "object","properties": {- "notebook": {+ "dom": {"type": "string"}},"required": [- "notebook"+ "dom"],"additionalProperties": false},- "NotebookInfo": {+ "DailyNoteBlockRequestInput": {"type": "object","properties": {- "ctime": {- "type": "integer"- },- "docCount": {- "type": "integer"- },- "hCtime": {- "type": "string"- },- "hMtime": {- "type": "string"- },- "hSize": {+ "data": {"type": "string"},- "id": {+ "dataType": {"type": "string"},- "mtime": {- "type": "integer"- },- "name": {+ "notebook": {"type": "string"- },- "size": {- "type": "integer"}},"required": [- "ctime",- "docCount",- "hCtime",- "hMtime",- "hSize",- "id",- "mtime",- "name",- "size"+ "data",+ "dataType",+ "notebook"],"additionalProperties": false},- "NotebookInfoData": {+ "DeleteBlockRequestInput": {"type": "object","properties": {- "boxInfo": {- "anyOf": [- {- "$ref": "#/$defs/NotebookInfo"- },- {- "type": "null"- }- ]- }- },- "required": [- "boxInfo"- ],- "additionalProperties": false- },- "NotebookPasswordRequestInput": {- "type": "object",- "properties": {- "password": {+ "id": {"type": "string"}},"required": [- "password"+ "id"],"additionalProperties": false},- "NotificationData": {+ "DocAttrView": {"type": "object","properties": {"id": {"type": "string"+ },+ "name": {+ "type": "string"}},"required": [- "id"+ "id",+ "name"],"additionalProperties": false},- "NotificationRequestInput": {+ "DocHeadingLevelData": {"type": "object","properties": {- "msg": {+ "counts": {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ "title": {"type": "string"},- "timeout": {+ "transaction": {"anyOf": [{- "type": "number"+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"}]+ },+ "withSubheadingCounts": {+ "type": "array",+ "items": {+ "type": "integer"+ }}},"required": [- "msg"+ "counts",+ "title",+ "transaction",+ "withSubheadingCounts"],"additionalProperties": false},- "OpenNotebookRequestInput": {+ "DocHeadingLevelRequestInput": {"type": "object","properties": {- "app": {+ "id": {"anyOf": [{"type": "string"@@ -2898,37 +2470,78 @@]},"notebook": {- "type": "string"- }- },- "required": [- "notebook"- ],- "additionalProperties": false- },- "OrderedListStartData": {- "type": "object",- "properties": {- "found": {- "type": "boolean"+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "start": {- "type": "integer"+ "source": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "target": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "withSubheadings": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "found",- "start"- ],"additionalProperties": false},- "PinnedDoc": {+ "DocInfo": {"type": "object","properties": {- "childrenSortMode": {+ "attrViews": {"anyOf": [{- "type": "integer"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/DocAttrView"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "ial": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }},{"type": "null"@@ -2944,180 +2557,199 @@"name": {"type": "string"},- "notebook": {- "type": "string"+ "refCount": {+ "type": "integer"},- "path": {+ "refIDs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "rootID": {"type": "string"},"subFileCount": {"type": "integer"- },- "unavailable": {- "type": "boolean"}},"required": [- "childrenSortMode",+ "attrViews",+ "ial","icon","id","name",- "notebook",- "path",- "subFileCount",- "unavailable"+ "refCount",+ "refIDs",+ "rootID",+ "subFileCount"],"additionalProperties": false},- "PrependBlockRequestInput": {+ "DocOrdersRequestInput": {"type": "object","properties": {- "data": {- "type": "string"- },- "dataType": {- "type": "string"- },- "parentID": {+ "id": {"type": "string"}},"required": [- "data",- "dataType",- "parentID"+ "id"],"additionalProperties": false},- "PublishedBlockInfo": {+ "DocsInfoRequestInput": {"type": "object","properties": {- "publishAccessRequired": {- "type": "boolean",- "enum": [- true- ]- },- "rootID": {- "type": "string"- },- "rootIcon": {- "type": "string"+ "av": {+ "type": "boolean"},- "rootTitle": {- "type": "string"+ "ids": {+ "type": "array",+ "items": {+ "type": "string"+ }},- "rootTitleEmpty": {+ "refCount": {"type": "boolean"}},"required": [- "publishAccessRequired",- "rootID",- "rootIcon",- "rootTitle",- "rootTitleEmpty"+ "av",+ "ids",+ "refCount"],"additionalProperties": false},- "RefDefs": {+ "DownloadInstallPkgRequestInput": {"type": "object","properties": {- "defIDs": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"- }- },- {- "type": "null"- }- ]- },- "refID": {- "type": "string"+ "downloadInstallPkg": {+ "type": "boolean"}},"required": [- "defIDs",- "refID"+ "downloadInstallPkg"],"additionalProperties": false},- "RefDefsData": {+ "EditorReadOnlyRequestInput": {"type": "object","properties": {- "refDefs": {- "type": "array",- "items": {- "$ref": "#/$defs/RefDefs"- }+ "readonly": {+ "type": "boolean"}},"required": [- "refDefs"+ "readonly"],"additionalProperties": false},- "RefIDsData": {+ "EmbedStat": {"type": "object","properties": {- "originalRefBlockIDs": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "string"- }- },- {- "type": "null"- }- ]+ "complete": {+ "type": "boolean"},- "refDefs": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/RefDefs"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "cycleCount": {+ "type": "integer"+ },+ "depthLimitCount": {+ "type": "integer"+ },+ "failedQueryCount": {+ "type": "integer"+ },+ "failedResultCount": {+ "type": "integer"+ },+ "jsEmbedCount": {+ "type": "integer"+ },+ "queryEmbedCount": {+ "type": "integer"+ },+ "resultCount": {+ "type": "integer"+ },+ "truncatedQueryCount": {+ "type": "integer"}},"required": [- "originalRefBlockIDs",- "refDefs"+ "complete",+ "cycleCount",+ "depthLimitCount",+ "failedQueryCount",+ "failedResultCount",+ "jsEmbedCount",+ "queryEmbedCount",+ "resultCount",+ "truncatedQueryCount"],"additionalProperties": false},- "RefIDsRequestInput": {+ "EmptyRequestInput": {+ "type": "object",+ "additionalProperties": false+ },+ "EncryptedNotebookStatus": {"type": "object","properties": {"id": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"- }+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "state": {+ "type": "string",+ "enum": [+ "Locked",+ "Unlocking",+ "Unlocked",+ "Locking",+ "Error"]},- "ids": {+ "unlocked": {+ "type": "boolean"+ }+ },+ "required": [+ "id",+ "name",+ "state",+ "unlocked"+ ],+ "additionalProperties": false+ },+ "EncryptedNotebookStatusData": {+ "type": "object",+ "properties": {+ "boxes": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/EncryptedNotebookStatus"+ }+ },+ "count": {+ "type": "integer"+ },+ "enabled": {+ "type": "boolean"+ },+ "hasHistoryDependency": {+ "type": "boolean"+ },+ "migrationBoxes": {"anyOf": [{"type": "array",@@ -3130,23 +2762,33 @@}]},- "notebook": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"- }+ "migrationPending": {+ "type": "boolean"+ },+ "state": {+ "type": "string",+ "enum": [+ "Disabled",+ "Enabled",+ "RecoveryRequired"]}},+ "required": [+ "boxes",+ "count",+ "enabled",+ "hasHistoryDependency",+ "migrationBoxes",+ "migrationPending",+ "state"+ ],"additionalProperties": false},- "RefTextQueryRequestInput": {+ "FileAnnotationRefRequestInput": {"type": "object","properties": {- "anchor": {+ "id": {"type": "string"},"notebook": {@@ -3161,104 +2803,76 @@}},"required": [- "anchor"- ],- "additionalProperties": false- },- "RemoveBookmarkRequestInput": {- "type": "object",- "properties": {- "bookmark": {- "type": "string"- }- },- "required": [- "bookmark"- ],- "additionalProperties": false- },- "RemoveTagRequestInput": {- "type": "object",- "properties": {- "label": {- "type": "string"- }- },- "required": [- "label"+ "id"],"additionalProperties": false},- "RenameBookmarkRequestInput": {+ "FullBlockInfo": {"type": "object","properties": {- "newBookmark": {+ "box": {"type": "string"},- "oldBookmark": {+ "path": {"type": "string"- }- },- "required": [- "newBookmark",- "oldBookmark"- ],- "additionalProperties": false- },- "RenameNotebookRequestInput": {- "type": "object",- "properties": {- "name": {+ },+ "rootChildID": {"type": "string"},- "notebook": {+ "rootID": {"type": "string"- }- },- "required": [- "name",- "notebook"- ],- "additionalProperties": false- },- "RenameTagRequestInput": {- "type": "object",- "properties": {- "newLabel": {+ },+ "rootIcon": {"type": "string"},- "oldLabel": {+ "rootTitle": {"type": "string"+ },+ "rootTitleEmpty": {+ "type": "boolean"}},"required": [- "newLabel",- "oldLabel"+ "box",+ "path",+ "rootChildID",+ "rootID",+ "rootIcon",+ "rootTitle",+ "rootTitleEmpty"],"additionalProperties": false},- "ReorderData": {+ "GetSnippetRequestInput": {"type": "object","properties": {- "changed": {- "type": "boolean"+ "enabled": {+ "type": "number"},- "notebook": {- "type": "string"+ "keyword": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "parentPath": {+ "type": {"type": "string"}},"required": [- "changed"+ "enabled",+ "type"],"additionalProperties": false},- "ReorderNotebooksRequestInput": {+ "GetTagRequestInput": {"type": "object","properties": {- "position": {+ "app": {"anyOf": [{"type": "string"@@ -3268,23 +2882,20 @@}]},- "sourceIDs": {+ "ignoreMaxListHint": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "type": "boolean"},{"type": "null"}]},- "targetID": {+ "sort": {"anyOf": [{- "type": "string"+ "type": "number"},{"type": "null"@@ -3294,110 +2905,133 @@},"additionalProperties": false},- "SearchBlock": {+ "HeadingChildrenRequestInput": {"type": "object","properties": {- "alias": {- "type": "string"- },- "box": {+ "id": {"type": "string"},- "children": {+ "removeFoldAttr": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchBlock"- },- {- "type": "null"- }- ]- }+ "type": "boolean"},{"type": "null"}]- },- "content": {+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ },+ "HeadingFoldRequestInput": {+ "type": "object",+ "properties": {+ "id": {"type": "string"},- "count": {- "type": "integer"- },- "created": {+ "scope": {"type": "string"- },- "defID": {+ }+ },+ "required": [+ "id",+ "scope"+ ],+ "additionalProperties": false+ },+ "HeadingLevelRequestInput": {+ "type": "object",+ "properties": {+ "id": {"type": "string"},- "defPath": {- "type": "string"+ "ids": {+ "type": "array",+ "items": {+ "type": "string"+ }},- "depth": {- "type": "integer"+ "level": {+ "type": "number"+ }+ },+ "required": [+ "level"+ ],+ "additionalProperties": false+ },+ "ImportNotebookCryptoBackupRequestInput": {+ "type": "object",+ "properties": {+ "file": {+ "type": "string",+ "format": "binary"},- "fcontent": {+ "password": {"type": "string"+ }+ },+ "required": [+ "file"+ ],+ "additionalProperties": false+ },+ "InlineStyle": {+ "type": "object",+ "properties": {+ "dark": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleTheme"+ },+ {+ "type": "null"+ }+ ]},- "folded": {+ "hidden": {"type": "boolean"},- "hPath": {+ "id": {"type": "string"},- "ial": {+ "light": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]},- "id": {- "type": "string"- },- "markdown": {- "type": "string"- },- "memo": {- "type": "string"- },"name": {"type": "string"- },- "number": {- "type": "string"- },- "parentID": {- "type": "string"- },- "path": {- "type": "string"- },- "refCount": {- "type": "integer"- },- "refText": {- "type": "string"- },- "refs": {+ }+ },+ "required": [+ "dark",+ "id",+ "light",+ "name"+ ],+ "additionalProperties": false+ },+ "InlineStyleAV": {+ "type": "object",+ "properties": {+ "colors": {"anyOf": [{"type": "array","items": {"anyOf": [{- "$ref": "#/$defs/SearchBlock"+ "$ref": "#/$defs/AttributeViewCustomColor"},{"type": "null"@@ -3410,104 +3044,50 @@}]},- "riffCard": {+ "order": {"anyOf": [{- "$ref": "#/$defs/SearchBlockCard"+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]- },- "riffCardID": {- "type": "string"- },- "rootID": {- "type": "string"- },- "sort": {- "type": "integer"- },- "subType": {- "type": "string"- },- "tag": {- "type": "string"- },- "type": {- "type": "string"- },- "updated": {- "type": "string"}},"required": [- "alias",- "box",- "children",- "content",- "count",- "created",- "defID",- "defPath",- "depth",- "fcontent",- "folded",- "hPath",- "ial",- "id",- "markdown",- "memo",- "name",- "parentID",- "path",- "refCount",- "refText",- "refs",- "riffCard",- "riffCardID",- "rootID",- "sort",- "subType",- "tag",- "type",- "updated"+ "colors",+ "order"],"additionalProperties": false},- "SearchBlockCard": {+ "InlineStyleAVInput": {"type": "object","properties": {- "due": {- "type": "string"- },- "lapses": {- "type": "integer"- },- "lastReview": {- "type": "string"- },- "reps": {- "type": "integer"+ "colors": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/AttributeViewCustomColorInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},- "state": {- "type": "integer"- }- },- "required": [- "due",- "lapses",- "lastReview",- "reps",- "state"- ],- "additionalProperties": false- },- "SearchHistoryData": {- "type": "object",- "properties": {- "histories": {+ "order": {"anyOf": [{"type": "array",@@ -3519,68 +3099,91 @@"type": "null"}]- },- "pageCount": {- "type": "integer"- },- "totalCount": {- "type": "integer"}},- "required": [- "histories",- "pageCount",- "totalCount"- ],"additionalProperties": false},- "SearchHistoryRequestInput": {+ "InlineStyleBuiltin": {"type": "object","properties": {- "notebook": {+ "colors": {"anyOf": [{- "type": "string"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinColor"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]},- "op": {+ "hidden": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/InlineStyleBuiltinHidden"},{"type": "null"}]},- "page": {+ "styles": {"anyOf": [{- "type": "number"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinStyle"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]- },- "query": {+ }+ },+ "required": [+ "colors",+ "hidden",+ "styles"+ ],+ "additionalProperties": false+ },+ "InlineStyleBuiltinColor": {+ "type": "object",+ "properties": {+ "dark": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]},- "type": {+ "index": {+ "type": "integer"+ },+ "light": {"anyOf": [{- "type": "number"+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"@@ -3588,328 +3191,288 @@]}},+ "required": [+ "dark",+ "index",+ "light"+ ],"additionalProperties": false},- "SearchTagData": {+ "InlineStyleBuiltinColorInput": {"type": "object","properties": {- "k": {- "type": "string"+ "dark": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleThemeInput"+ },+ {+ "type": "null"+ }+ ]},- "tags": {- "type": "array",- "items": {- "type": "string"- }+ "index": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "light": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleThemeInput"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "k",- "tags"- ],"additionalProperties": false},- "SearchTagRequestInput": {+ "InlineStyleBuiltinHidden": {"type": "object","properties": {- "k": {- "type": "string"+ "av": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "backgroundColor": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "color": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "style1": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]}},"required": [- "k"+ "av",+ "backgroundColor",+ "color",+ "style1"],"additionalProperties": false},- "SetBlockAttrsRequestInput": {+ "InlineStyleBuiltinHiddenInput": {"type": "object","properties": {- "attrs": {- "type": "object",- "additionalProperties": {- "anyOf": [- {- "type": "string"- },- {- "type": "null"+ "av": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"}- ]- }+ },+ {+ "type": "null"+ }+ ]},- "id": {- "type": "string"+ "backgroundColor": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "color": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "style1": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "attrs",- "id"- ],"additionalProperties": false},- "SetNotebookConfRequestInput": {+ "InlineStyleBuiltinInput": {"type": "object","properties": {- "conf": {+ "colors": {"anyOf": [{- "$ref": "#/$defs/NotebookConfPatchInput"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinColorInput"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"}]},- "notebook": {- "type": "string"+ "hidden": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinHiddenInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "styles": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinStyleInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "notebook"- ],"additionalProperties": false},- "SetNotebookIconRequestInput": {+ "InlineStyleBuiltinStyle": {"type": "object","properties": {- "icon": {- "type": "string"- },- "notebook": {- "type": "string"- }- },- "required": [- "icon",- "notebook"- ],- "additionalProperties": false- },- "SetSnapshotMemoRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "memo": {- "type": "string"- }- },- "required": [- "id",- "memo"- ],- "additionalProperties": false- },- "SetSnippetRequestInput": {- "type": "object",- "properties": {- "snippets": {- "type": "array",- "items": {- "$ref": "#/$defs/SnippetInput"- }- }- },- "required": [- "snippets"- ],- "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": {+ "dark": {"anyOf": [{- "type": "boolean"+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]},- "enabled": {- "type": "boolean"- },"id": {"type": "string"},- "name": {- "type": "string"- },- "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- },- "SwapBlockRefRequestInput": {- "type": "object",- "properties": {- "defID": {- "type": "string"- },- "includeChildren": {- "type": "boolean"- },- "refID": {- "type": "string"- }- },- "required": [- "defID",- "includeChildren",- "refID"- ],- "additionalProperties": false- },- "TagData": {- "type": "object",- "properties": {- "children": {+ "light": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/TagData"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/InlineStyleTheme"},{"type": "null"}]- },- "count": {- "type": "integer"- },- "depth": {- "type": "integer"- },- "label": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"}},"required": [- "children",- "count",- "depth",- "label",- "name",- "type"+ "dark",+ "id",+ "light"],"additionalProperties": false},- "TailChildBlocksRequestInput": {+ "InlineStyleBuiltinStyleInput": {"type": "object","properties": {- "id": {- "type": "string"- },- "ids": {+ "dark": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "$ref": "#/$defs/InlineStyleThemeInput"},{"type": "null"}]},- "n": {+ "id": {"anyOf": [{- "type": "number"+ "type": "string"},{"type": "null"}]},- "notebook": {+ "light": {"anyOf": [{- "type": "string"+ "$ref": "#/$defs/InlineStyleThemeInput"},{"type": "null"@@ -3917,47 +3480,22 @@]}},- "required": [- "id"- ],- "additionalProperties": false- },- "TaskListMarkerRequestInput": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "marker": {- "type": "string"- }- },- "required": [- "id",- "marker"- ],"additionalProperties": false},- "TransferBlockRefRequestInput": {+ "InlineStyleInput": {"type": "object","properties": {- "fromID": {- "type": "string"- },- "refIDs": {+ "dark": {"anyOf": [{- "type": "array",- "items": {- "type": "string"- }+ "$ref": "#/$defs/InlineStyleThemeInput"},{"type": "null"}]},- "reloadUI": {+ "hidden": {"anyOf": [{"type": "boolean"@@ -3967,49 +3505,30 @@}]},- "toID": {- "type": "string"- }- },- "required": [- "fromID",- "toID"- ],- "additionalProperties": false- },- "TreeStatData": {- "type": "object",- "properties": {- "containsEmbed": {- "type": "boolean"- },- "embedStat": {+ "id": {"anyOf": [{- "$ref": "#/$defs/EmbedStat"+ "type": "string"},{"type": "null"}]},- "reqId": {- "$ref": "#/$defs/JSONValue"- },- "stat": {+ "light": {"anyOf": [{- "$ref": "#/$defs/BlockStat"+ "$ref": "#/$defs/InlineStyleThemeInput"},{"type": "null"}]},- "statWithEmbed": {+ "name": {"anyOf": [{- "$ref": "#/$defs/BlockStat"+ "type": "string"},{"type": "null"@@ -4017,19 +3536,12 @@]}},- "required": [- "reqId",- "stat"- ],"additionalProperties": false},- "TreeStatRequestInput": {+ "InlineStyleOrder": {"type": "object","properties": {- "id": {- "type": "string"- },- "ids": {+ "backgroundColor": {"anyOf": [{"type": "array",@@ -4042,30 +3554,76 @@}]},- "includeEmbed": {+ "color": {"anyOf": [{- "type": "boolean"+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]},- "notebook": {+ "style1": {"anyOf": [{- "type": "string"+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "backgroundColor",+ "color",+ "style1"+ ],+ "additionalProperties": false+ },+ "InlineStyleOrderInput": {+ "type": "object",+ "properties": {+ "backgroundColor": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"}]},- "reqId": {+ "color": {"anyOf": [{- "$ref": "#/$defs/JSONValue"+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "style1": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }},{"type": "null"@@ -4073,68 +3631,113 @@]}},- "required": [- "id"- ],"additionalProperties": false},- "TrimmedIDRequestInput": {+ "InlineStyleTheme": {"type": "object","properties": {- "id": {+ "backgroundColor": {"type": "string"- }- },- "required": [- "id"- ],- "additionalProperties": false- },- "UnfoldedParentData": {- "type": "object",- "properties": {- "parentID": {+ },+ "color": {"type": "string"}},- "required": [- "parentID"- ],"additionalProperties": false},- "UnlockNotebookRequestInput": {+ "InlineStyleThemeInput": {"type": "object","properties": {- "notebook": {- "type": "string"+ "backgroundColor": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "password": {- "type": "string"+ "color": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]}},- "required": [- "notebook",- "password"- ],"additionalProperties": false},- "UnzipRequestInput": {+ "InlineStyles": {"type": "object","properties": {- "path": {- "type": "string"+ "av": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleAV"+ },+ {+ "type": "null"+ }+ ]},- "zipPath": {- "type": "string"+ "builtin": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltin"+ },+ {+ "type": "null"+ }+ ]+ },+ "order": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleOrder"+ },+ {+ "type": "null"+ }+ ]+ },+ "styles": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyle"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "version": {+ "type": "integer"}},"required": [- "path",- "zipPath"+ "av",+ "builtin",+ "order",+ "styles",+ "version"],"additionalProperties": false},- "UpdateBlockRequestInput": {+ "InsertBlockRequestInput": {"type": "object","properties": {"data": {@@ -4143,13 +3746,30 @@"dataType": {"type": "string"},- "id": {- "type": "string"+ "nextID": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]},- "lockType": {+ "parentID": {"anyOf": [{- "type": "boolean"+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "previousID": {+ "anyOf": [+ {+ "type": "string"},{"type": "null"@@ -4159,73 +3779,58 @@},"required": ["data",- "dataType",- "id"- ],- "additionalProperties": false- },- "UpdateChannelRequestInput": {- "type": "object",- "properties": {- "updateChannel": {- "type": "string"- }- },- "required": [- "updateChannel"+ "dataType"],"additionalProperties": false},- "UpdatePinnedDocsRequestInput": {- "type": "object",- "properties": {- "action": {- "type": "string"+ "JSONValue": {+ "anyOf": [+ {+ "type": "null"},- "after": {+ {"type": "boolean"},- "ids": {- "type": "array",- "items": {- "type": "string"- }+ {+ "type": "number"},- "targetID": {+ {"type": "string"- }- },- "required": [- "action",- "ids"- ],- "additionalProperties": false- },- "VirtualBlockRefRequestInput": {- "type": "object",- "properties": {- "keywords": {+ },+ {"type": "array","items": {- "type": "string"+ "$ref": "#/$defs/JSONValue"+ }+ },+ {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"}}- },- "required": [- "keywords"- ],- "additionalProperties": false+ ]},- "WordCountData": {+ "ListNotebooksData": {"type": "object","properties": {- "reqId": {- "$ref": "#/$defs/JSONValue"+ "boxDocEnabled": {+ "type": "boolean"},- "stat": {+ "notebooks": {"anyOf": [{- "$ref": "#/$defs/BlockStat"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Notebook"+ },+ {+ "type": "null"+ }+ ]+ }},{"type": "null"@@ -4234,52 +3839,4615 @@}},"required": [- "reqId",- "stat"+ "boxDocEnabled",+ "notebooks"],"additionalProperties": false},- "WorkspaceInfoData": {+ "ListNotebooksRequestInput": {"type": "object","properties": {- "siyuanVer": {+ "flashcard": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "LockScreenRequestInput": {+ "type": "object",+ "properties": {+ "lockScreenMode": {+ "type": "number"+ }+ },+ "required": [+ "lockScreenMode"+ ],+ "additionalProperties": false+ },+ "MoveBlockRequestInput": {+ "type": "object",+ "properties": {+ "id": {"type": "string"},- "workspaceDir": {+ "parentID": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "previousID": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ },+ "NetImageAssetsRequestInput": {+ "type": "object",+ "properties": {+ "id": {"type": "string"+ },+ "url": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]}},"required": [- "siyuanVer",- "workspaceDir"+ "id"+ ],+ "additionalProperties": false+ },+ "NetworkData": {+ "type": "object",+ "properties": {+ "proxy": {+ "anyOf": [+ {+ "$ref": "#/$defs/NetworkProxy"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "proxy"+ ],+ "additionalProperties": false+ },+ "NetworkProxy": {+ "type": "object",+ "properties": {+ "host": {+ "type": "string"+ },+ "port": {+ "type": "string"+ },+ "scheme": {+ "type": "string"+ }+ },+ "required": [+ "host",+ "port",+ "scheme"+ ],+ "additionalProperties": false+ },+ "NetworkProxyInput": {+ "type": "object",+ "properties": {+ "host": {+ "type": "string"+ },+ "port": {+ "type": "string"+ },+ "scheme": {+ "type": "string"+ }+ },+ "required": [+ "host",+ "port",+ "scheme"+ ],+ "additionalProperties": false+ },+ "NetworkServeRequestInput": {+ "type": "object",+ "properties": {+ "networkServe": {+ "type": "boolean"+ }+ },+ "required": [+ "networkServe"+ ],+ "additionalProperties": false+ },+ "NetworkServeTLSRequestInput": {+ "type": "object",+ "properties": {+ "networkServeTLS": {+ "type": "boolean"+ }+ },+ "required": [+ "networkServeTLS"+ ],+ "additionalProperties": false+ },+ "Notebook": {+ "type": "object",+ "properties": {+ "closed": {+ "type": "boolean"+ },+ "dueFlashcardCount": {+ "type": "integer"+ },+ "encrypted": {+ "type": "boolean"+ },+ "flashcardCount": {+ "type": "integer"+ },+ "icon": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "newFlashcardCount": {+ "type": "integer"+ },+ "sort": {+ "type": "integer"+ },+ "sortMode": {+ "type": "integer"+ },+ "state": {+ "type": "string",+ "enum": [+ "Locked",+ "Unlocking",+ "Unlocked",+ "Locking",+ "Error"+ ]+ },+ "subFileCount": {+ "type": "integer"+ },+ "unlocked": {+ "type": "boolean"+ }+ },+ "required": [+ "closed",+ "dueFlashcardCount",+ "encrypted",+ "flashcardCount",+ "icon",+ "id",+ "name",+ "newFlashcardCount",+ "sort",+ "sortMode",+ "subFileCount",+ "unlocked"],"additionalProperties": false},- "ZipRequestInput": {- "type": "object",- "properties": {- "path": {- "type": "string"- },- "zipPath": {- "type": "string"- }- },- "required": [- "path",- "zipPath"- ],- "additionalProperties": false- }- },- "endpoints": [+ "NotebookConf": {+ "type": "object",+ "properties": {+ "boxCrypt": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookEncryption"+ },+ {+ "type": "null"+ }+ ]+ },+ "closed": {+ "type": "boolean"+ },+ "dailyNoteSavePath": {+ "type": "string"+ },+ "dailyNoteTemplatePath": {+ "type": "string"+ },+ "docCreateSaveBox": {+ "type": "string"+ },+ "docCreateSavePath": {+ "type": "string"+ },+ "docCreateTemplatePath": {+ "type": "string"+ },+ "encrypted": {+ "type": "boolean"+ },+ "icon": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "refCreateSaveBox": {+ "type": "string"+ },+ "refCreateSavePath": {+ "type": "string"+ },+ "sort": {+ "type": "integer"+ },+ "sortMode": {+ "type": "integer"+ }+ },+ "required": [+ "boxCrypt",+ "closed",+ "dailyNoteSavePath",+ "dailyNoteTemplatePath",+ "docCreateSaveBox",+ "docCreateSavePath",+ "docCreateTemplatePath",+ "encrypted",+ "icon",+ "name",+ "refCreateSaveBox",+ "refCreateSavePath",+ "sort",+ "sortMode"+ ],+ "additionalProperties": false+ },+ "NotebookConfData": {+ "type": "object",+ "properties": {+ "box": {+ "type": "string"+ },+ "conf": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookConf"+ },+ {+ "type": "null"+ }+ ]+ },+ "name": {+ "type": "string"+ }+ },+ "required": [+ "box",+ "conf",+ "name"+ ],+ "additionalProperties": false+ },+ "NotebookConfPatchInput": {+ "type": "object",+ "properties": {+ "boxCrypt": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookEncryptionPatchInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "closed": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "dailyNoteSavePath": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "dailyNoteTemplatePath": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "docCreateSaveBox": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "docCreateSavePath": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "docCreateTemplatePath": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "encrypted": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "icon": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "name": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "refCreateSaveBox": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "refCreateSavePath": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "sort": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "sortMode": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "NotebookCryptoAutoLockRequestInput": {+ "type": "object",+ "properties": {+ "autoLockMinutes": {+ "type": "number"+ }+ },+ "required": [+ "autoLockMinutes"+ ],+ "additionalProperties": false+ },+ "NotebookCryptoBackupData": {+ "type": "object",+ "properties": {+ "file": {+ "type": "string"+ }+ },+ "required": [+ "file"+ ],+ "additionalProperties": false+ },+ "NotebookEncryption": {+ "type": "object",+ "properties": {+ "createdAt": {+ "type": "integer"+ },+ "metadata": {+ "type": "string"+ },+ "spec": {+ "type": "integer"+ },+ "wrapNonce": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "wrappedDEK": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "createdAt",+ "spec",+ "wrapNonce",+ "wrappedDEK"+ ],+ "additionalProperties": false+ },+ "NotebookEncryptionPatchInput": {+ "type": "object",+ "properties": {+ "createdAt": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "metadata": {+ "anyOf": [+ {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ }+ ]+ },+ {+ "type": "null"+ }+ ]+ },+ "spec": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "wrapNonce": {+ "anyOf": [+ {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ }+ ]+ },+ {+ "type": "null"+ }+ ]+ },+ "wrappedDEK": {+ "anyOf": [+ {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "array",+ "items": {+ "type": "integer"+ }+ }+ ]+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "NotebookIDRequestInput": {+ "type": "object",+ "properties": {+ "notebook": {+ "type": "string"+ }+ },+ "required": [+ "notebook"+ ],+ "additionalProperties": false+ },+ "NotebookInfo": {+ "type": "object",+ "properties": {+ "ctime": {+ "type": "integer"+ },+ "docCount": {+ "type": "integer"+ },+ "hCtime": {+ "type": "string"+ },+ "hMtime": {+ "type": "string"+ },+ "hSize": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "mtime": {+ "type": "integer"+ },+ "name": {+ "type": "string"+ },+ "size": {+ "type": "integer"+ }+ },+ "required": [+ "ctime",+ "docCount",+ "hCtime",+ "hMtime",+ "hSize",+ "id",+ "mtime",+ "name",+ "size"+ ],+ "additionalProperties": false+ },+ "NotebookInfoData": {+ "type": "object",+ "properties": {+ "boxInfo": {+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookInfo"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "boxInfo"+ ],+ "additionalProperties": false+ },+ "NotebookPasswordRequestInput": {+ "type": "object",+ "properties": {+ "password": {+ "type": "string"+ }+ },+ "required": [+ "password"+ ],+ "additionalProperties": false+ },+ "NotificationData": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ },+ "NotificationRequestInput": {+ "type": "object",+ "properties": {+ "msg": {+ "type": "string"+ },+ "timeout": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "msg"+ ],+ "additionalProperties": false+ },+ "OpenNotebookRequestInput": {+ "type": "object",+ "properties": {+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {+ "type": "string"+ }+ },+ "required": [+ "notebook"+ ],+ "additionalProperties": false+ },+ "OrderedListStartData": {+ "type": "object",+ "properties": {+ "found": {+ "type": "boolean"+ },+ "start": {+ "type": "integer"+ }+ },+ "required": [+ "found",+ "start"+ ],+ "additionalProperties": false+ },+ "OutlineStorageRequestInput": {+ "type": "object",+ "properties": {+ "docID": {+ "type": "string"+ }+ },+ "required": [+ "docID"+ ],+ "additionalProperties": false+ },+ "OutlineStorageSetRequestInput": {+ "type": "object",+ "properties": {+ "docID": {+ "type": "string"+ },+ "val": {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ }+ },+ "required": [+ "docID",+ "val"+ ],+ "additionalProperties": false+ },+ "PinnedDoc": {+ "type": "object",+ "properties": {+ "childrenSortMode": {+ "anyOf": [+ {+ "type": "integer"+ },+ {+ "type": "null"+ }+ ]+ },+ "icon": {+ "type": "string"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "notebook": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "subFileCount": {+ "type": "integer"+ },+ "unavailable": {+ "type": "boolean"+ }+ },+ "required": [+ "childrenSortMode",+ "icon",+ "id",+ "name",+ "notebook",+ "path",+ "subFileCount",+ "unavailable"+ ],+ "additionalProperties": false+ },+ "PrependBlockRequestInput": {+ "type": "object",+ "properties": {+ "data": {+ "type": "string"+ },+ "dataType": {+ "type": "string"+ },+ "parentID": {+ "type": "string"+ }+ },+ "required": [+ "data",+ "dataType",+ "parentID"+ ],+ "additionalProperties": false+ },+ "PublishedBlockInfo": {+ "type": "object",+ "properties": {+ "publishAccessRequired": {+ "type": "boolean",+ "enum": [+ true+ ]+ },+ "rootID": {+ "type": "string"+ },+ "rootIcon": {+ "type": "string"+ },+ "rootTitle": {+ "type": "string"+ },+ "rootTitleEmpty": {+ "type": "boolean"+ }+ },+ "required": [+ "publishAccessRequired",+ "rootID",+ "rootIcon",+ "rootTitle",+ "rootTitleEmpty"+ ],+ "additionalProperties": false+ },+ "RecentDoc": {+ "type": "object",+ "properties": {+ "closedAt": {+ "type": "integer"+ },+ "icon": {+ "type": "string"+ },+ "openAt": {+ "type": "integer"+ },+ "rootID": {+ "type": "string"+ },+ "title": {+ "type": "string"+ },+ "viewedAt": {+ "type": "integer"+ }+ },+ "required": [+ "rootID"+ ],+ "additionalProperties": false+ },+ "RecentDocUpdateRequestInput": {+ "type": "object",+ "properties": {+ "rootID": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "RecentDocsRequestInput": {+ "type": "object",+ "properties": {+ "sortBy": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "RecentDocsUpdateRequestInput": {+ "type": "object",+ "properties": {+ "rootIDs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "RefDefs": {+ "type": "object",+ "properties": {+ "defIDs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "refID": {+ "type": "string"+ }+ },+ "required": [+ "defIDs",+ "refID"+ ],+ "additionalProperties": false+ },+ "RefDefsData": {+ "type": "object",+ "properties": {+ "refDefs": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/RefDefs"+ }+ }+ },+ "required": [+ "refDefs"+ ],+ "additionalProperties": false+ },+ "RefIDsData": {+ "type": "object",+ "properties": {+ "originalRefBlockIDs": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "refDefs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/RefDefs"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "originalRefBlockIDs",+ "refDefs"+ ],+ "additionalProperties": false+ },+ "RefIDsRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "ids": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "RefTextQueryRequestInput": {+ "type": "object",+ "properties": {+ "anchor": {+ "type": "string"+ },+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "anchor"+ ],+ "additionalProperties": false+ },+ "RemoveBookmarkRequestInput": {+ "type": "object",+ "properties": {+ "bookmark": {+ "type": "string"+ }+ },+ "required": [+ "bookmark"+ ],+ "additionalProperties": false+ },+ "RemoveCriterionRequestInput": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ }+ },+ "required": [+ "name"+ ],+ "additionalProperties": false+ },+ "RemoveTagRequestInput": {+ "type": "object",+ "properties": {+ "label": {+ "type": "string"+ }+ },+ "required": [+ "label"+ ],+ "additionalProperties": false+ },+ "RenameBookmarkRequestInput": {+ "type": "object",+ "properties": {+ "newBookmark": {+ "type": "string"+ },+ "oldBookmark": {+ "type": "string"+ }+ },+ "required": [+ "newBookmark",+ "oldBookmark"+ ],+ "additionalProperties": false+ },+ "RenameNotebookRequestInput": {+ "type": "object",+ "properties": {+ "name": {+ "type": "string"+ },+ "notebook": {+ "type": "string"+ }+ },+ "required": [+ "name",+ "notebook"+ ],+ "additionalProperties": false+ },+ "RenameTagRequestInput": {+ "type": "object",+ "properties": {+ "newLabel": {+ "type": "string"+ },+ "oldLabel": {+ "type": "string"+ }+ },+ "required": [+ "newLabel",+ "oldLabel"+ ],+ "additionalProperties": false+ },+ "ReorderData": {+ "type": "object",+ "properties": {+ "changed": {+ "type": "boolean"+ },+ "notebook": {+ "type": "string"+ },+ "parentPath": {+ "type": "string"+ }+ },+ "required": [+ "changed"+ ],+ "additionalProperties": false+ },+ "ReorderNotebooksRequestInput": {+ "type": "object",+ "properties": {+ "position": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "sourceIDs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "targetID": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "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": {+ "type": "string"+ },+ "folded": {+ "type": "boolean"+ },+ "hPath": {+ "type": "string"+ },+ "ial": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "id": {+ "type": "string"+ },+ "markdown": {+ "type": "string"+ },+ "memo": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "number": {+ "type": "string"+ },+ "parentID": {+ "type": "string"+ },+ "path": {+ "type": "string"+ },+ "refCount": {+ "type": "integer"+ },+ "refText": {+ "type": "string"+ },+ "refs": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "riffCard": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlockCard"+ },+ {+ "type": "null"+ }+ ]+ },+ "riffCardID": {+ "type": "string"+ },+ "rootID": {+ "type": "string"+ },+ "sort": {+ "type": "integer"+ },+ "subType": {+ "type": "string"+ },+ "tag": {+ "type": "string"+ },+ "type": {+ "type": "string"+ },+ "updated": {+ "type": "string"+ }+ },+ "required": [+ "alias",+ "box",+ "children",+ "content",+ "count",+ "created",+ "defID",+ "defPath",+ "depth",+ "fcontent",+ "folded",+ "hPath",+ "ial",+ "id",+ "markdown",+ "memo",+ "name",+ "parentID",+ "path",+ "refCount",+ "refText",+ "refs",+ "riffCard",+ "riffCardID",+ "rootID",+ "sort",+ "subType",+ "tag",+ "type",+ "updated"+ ],+ "additionalProperties": false+ },+ "SearchBlockCard": {+ "type": "object",+ "properties": {+ "due": {+ "type": "string"+ },+ "lapses": {+ "type": "integer"+ },+ "lastReview": {+ "type": "string"+ },+ "reps": {+ "type": "integer"+ },+ "state": {+ "type": "integer"+ }+ },+ "required": [+ "due",+ "lapses",+ "lastReview",+ "reps",+ "state"+ ],+ "additionalProperties": false+ },+ "SearchHistoryData": {+ "type": "object",+ "properties": {+ "histories": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "pageCount": {+ "type": "integer"+ },+ "totalCount": {+ "type": "integer"+ }+ },+ "required": [+ "histories",+ "pageCount",+ "totalCount"+ ],+ "additionalProperties": false+ },+ "SearchHistoryRequestInput": {+ "type": "object",+ "properties": {+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "op": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "page": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "query": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "type": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "additionalProperties": false+ },+ "SearchSubTypes": {+ "type": "object",+ "properties": {+ "heading": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "list": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "listItem": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "heading",+ "list",+ "listItem"+ ],+ "additionalProperties": false+ },+ "SearchSubTypesInput": {+ "type": "object",+ "properties": {+ "heading": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "list": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "listItem": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "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"+ }+ },+ "required": [+ "k"+ ],+ "additionalProperties": false+ },+ "SetBlockAttrsRequestInput": {+ "type": "object",+ "properties": {+ "attrs": {+ "type": "object",+ "additionalProperties": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "id": {+ "type": "string"+ }+ },+ "required": [+ "attrs",+ "id"+ ],+ "additionalProperties": false+ },+ "SetCriterionRequestInput": {+ "type": "object",+ "properties": {+ "criterion": {+ "anyOf": [+ {+ "$ref": "#/$defs/CriterionInput"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "criterion"+ ],+ "additionalProperties": false+ },+ "SetInlineStylesRequestInput": {+ "type": "object",+ "properties": {+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "av": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleAVInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "builtin": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleBuiltinInput"+ },+ {+ "type": "null"+ }+ ]+ },+ "order": {+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyleOrderInput"+ },+ {+ "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": {+ "type": "object",+ "properties": {+ "icon": {+ "type": "string"+ },+ "notebook": {+ "type": "string"+ }+ },+ "required": [+ "icon",+ "notebook"+ ],+ "additionalProperties": false+ },+ "SetSnapshotMemoRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "memo": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "memo"+ ],+ "additionalProperties": false+ },+ "SetSnippetRequestInput": {+ "type": "object",+ "properties": {+ "snippets": {+ "type": "array",+ "items": {+ "$ref": "#/$defs/SnippetInput"+ }+ }+ },+ "required": [+ "snippets"+ ],+ "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": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ]+ },+ "enabled": {+ "type": "boolean"+ },+ "id": {+ "type": "string"+ },+ "name": {+ "type": "string"+ },+ "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": {+ "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": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "keys": {+ "type": "array",+ "items": {+ "type": "string"+ }+ }+ },+ "required": [+ "keys"+ ],+ "additionalProperties": false+ },+ "StorageRemoveRequestInput": {+ "type": "object",+ "properties": {+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "key": {+ "type": "string"+ }+ },+ "required": [+ "key"+ ],+ "additionalProperties": false+ },+ "StorageSetKeysRequestInput": {+ "type": "object",+ "properties": {+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "keyVals": {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ }+ },+ "required": [+ "keyVals"+ ],+ "additionalProperties": false+ },+ "StorageSetRequestInput": {+ "type": "object",+ "properties": {+ "app": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ },+ "key": {+ "type": "string"+ },+ "val": {+ "anyOf": [+ {+ "$ref": "#/$defs/JSONValue"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "key"+ ],+ "additionalProperties": false+ },+ "SwapBlockRefRequestInput": {+ "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": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "n": {+ "anyOf": [+ {+ "type": "number"+ },+ {+ "type": "null"+ }+ ]+ },+ "notebook": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "required": [+ "id"+ ],+ "additionalProperties": false+ },+ "TaskListMarkerRequestInput": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string"+ },+ "marker": {+ "type": "string"+ }+ },+ "required": [+ "id",+ "marker"+ ],+ "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+ },+ "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+ },+ "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/archive/unzip",+ "handler": "unzip",+ "body": "json",+ "request": {+ "$ref": "#/$defs/UnzipRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/archive/zip",+ "handler": "zip",+ "body": "json",+ "request": {+ "$ref": "#/$defs/ZipRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/batchGetBlockAttrs",+ "handler": "batchGetBlockAttrs",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BlockIDsRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "object",+ "additionalProperties": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ }+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/batchSetBlockAttrs",+ "handler": "batchSetBlockAttrs",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/getBlockAttrs",+ "handler": "getBlockAttrs",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BlockIDRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/getBookmarkLabels",+ "handler": "getBookmarkLabels",+ "body": "none",+ "request": {+ "$ref": "#/$defs/EmptyRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/resetBlockAttrs",+ "handler": "resetBlockAttrs",+ "body": "none",+ "request": {+ "$ref": "#/$defs/EmptyRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/attr/setBlockAttrs",+ "handler": "setBlockAttrs",+ "body": "json",+ "request": {+ "$ref": "#/$defs/SetBlockAttrsRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/av/searchAttributeViewNonRelationKey",+ "handler": "searchAttributeViewNonRelationKey",+ "body": "none",+ "request": {+ "$ref": "#/$defs/EmptyRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "null"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/appendBlock",+ "handler": "appendBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/AppendBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/appendDailyNoteBlock",+ "handler": "appendDailyNoteBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/DailyNoteBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/appendHeadingChildren",+ "handler": "appendHeadingChildren",+ "body": "json",+ "request": {+ "$ref": "#/$defs/AppendHeadingChildrenRequestInput"+ },+ "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/block/batchAppendBlock",+ "handler": "batchAppendBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchParentBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/batchInsertBlock",+ "handler": "batchInsertBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchInsertBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/batchPrependBlock",+ "handler": "batchPrependBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchParentBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/batchUpdateBlock",+ "handler": "batchUpdateBlock",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchUpdateBlockRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/batchUpdateTaskListItemMarker",+ "handler": "batchUpdateTaskListItemMarker",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BatchTaskListMarkerRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/checkBlockExist",+ "handler": "checkBlockExist",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BlockQueryRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "boolean"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/checkBlockFold",+ "handler": "checkBlockFold",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BlockQueryRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "$ref": "#/$defs/BlockFoldData"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/checkBlockRef",+ "handler": "checkBlockRef",+ "body": "json",+ "request": {+ "$ref": "#/$defs/CheckBlockRefRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "boolean"+ },+ "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"+ },+ {+ "type": "boolean"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/checkBlocksExist",+ "handler": "checkBlocksExist",+ "body": "json",+ "request": {+ "$ref": "#/$defs/CheckBlocksExistRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "boolean"+ }+ },+ {+ "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",- "body": "none",+ "method": "POST",+ "path": "/api/block/deleteBlock",+ "handler": "deleteBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/DeleteBlockRequestInput"},"response": {"anyOf": [@@ -4293,7 +8461,24 @@]},"data": {- "$ref": "#/$defs/BootProgressData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -4349,12 +8534,12 @@}},{- "method": "GET",- "path": "/api/system/version",- "handler": "version",- "body": "none",+ "method": "POST",+ "path": "/api/block/foldBlock",+ "handler": "foldBlock",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -4368,7 +8553,7 @@]},"data": {- "type": "string"+ "type": "null"},"msg": {"type": "string"@@ -4425,11 +8610,11 @@},{"method": "POST",- "path": "/api/archive/unzip",- "handler": "unzip",+ "path": "/api/block/getBlockBreadcrumb",+ "handler": "getBlockBreadcrumb","body": "json","request": {- "$ref": "#/$defs/UnzipRequestInput"+ "$ref": "#/$defs/BlockBreadcrumbRequestInput"},"response": {"anyOf": [@@ -4443,7 +8628,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockPath"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -4500,11 +8702,11 @@},{"method": "POST",- "path": "/api/archive/zip",- "handler": "zip",+ "path": "/api/block/getBlockBreadcrumbChildren",+ "handler": "getBlockBreadcrumbChildren","body": "json","request": {- "$ref": "#/$defs/ZipRequestInput"+ "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"},"response": {"anyOf": [@@ -4518,7 +8720,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockBreadcrumbChildren"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -4575,11 +8784,11 @@},{"method": "POST",- "path": "/api/attr/batchGetBlockAttrs",- "handler": "batchGetBlockAttrs",+ "path": "/api/block/getBlockDOM",+ "handler": "getBlockDOM","body": "json","request": {- "$ref": "#/$defs/BlockIDsRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -4593,20 +8802,7 @@]},"data": {- "type": "object",- "additionalProperties": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "string"- }- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/BlockDOMData"},"msg": {"type": "string"@@ -4663,11 +8859,11 @@},{"method": "POST",- "path": "/api/attr/batchSetBlockAttrs",- "handler": "batchSetBlockAttrs",+ "path": "/api/block/getBlockDOMWithEmbed",+ "handler": "getBlockDOMWithEmbed","body": "json","request": {- "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -4681,7 +8877,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockDOMData"},"msg": {"type": "string"@@ -4738,11 +8934,11 @@},{"method": "POST",- "path": "/api/attr/getBlockAttrs",- "handler": "getBlockAttrs",+ "path": "/api/block/getBlockDOMs",+ "handler": "getBlockDOMs","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -4756,10 +8952,17 @@]},"data": {- "type": "object",- "additionalProperties": {- "type": "string"- }+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -4816,11 +9019,11 @@},{"method": "POST",- "path": "/api/attr/getBookmarkLabels",- "handler": "getBookmarkLabels",- "body": "none",+ "path": "/api/block/getBlockDOMsWithEmbed",+ "handler": "getBlockDOMsWithEmbed",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -4836,8 +9039,8 @@"data": {"anyOf": [{- "type": "array",- "items": {+ "type": "object",+ "additionalProperties": {"type": "string"}},@@ -4901,11 +9104,11 @@},{"method": "POST",- "path": "/api/attr/resetBlockAttrs",- "handler": "resetBlockAttrs",- "body": "none",+ "path": "/api/block/getBlockDefIDsByRefText",+ "handler": "getBlockDefIDsByRefText",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/RefTextQueryRequestInput"},"response": {"anyOf": [@@ -4919,7 +9122,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/RefDefsData"},"msg": {"type": "string"@@ -4976,11 +9179,86 @@},{"method": "POST",- "path": "/api/attr/setBlockAttrs",- "handler": "setBlockAttrs",+ "path": "/api/block/getBlockIndex",+ "handler": "getBlockIndex",+ "body": "json",+ "request": {+ "$ref": "#/$defs/BlockQueryRequestInput"+ },+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0+ ]+ },+ "data": {+ "type": "integer"+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": false+ },+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ -1+ ]+ },+ "data": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "closeTimeout": {+ "type": "number"+ }+ },+ "required": [+ "closeTimeout"+ ],+ "additionalProperties": false+ },+ {+ "type": "null"+ }+ ]+ },+ "msg": {+ "type": "string"+ }+ },+ "required": [+ "code",+ "msg",+ "data"+ ],+ "additionalProperties": true+ }+ ]+ }+ },+ {+ "method": "POST",+ "path": "/api/block/getBlockInfo",+ "handler": "getBlockInfo","body": "json","request": {- "$ref": "#/$defs/SetBlockAttrsRequestInput"+ "$ref": "#/$defs/BlockInfoRequestInput"},"response": {"anyOf": [@@ -4994,7 +9272,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockInfoData"},"msg": {"type": "string"@@ -5013,7 +9291,8 @@"code": {"type": "integer","enum": [- -1+ -1,+ 3]},"data": {@@ -5032,6 +9311,9 @@},{"type": "null"+ },+ {+ "type": "string"}]},@@ -5051,11 +9333,11 @@},{"method": "POST",- "path": "/api/av/searchAttributeViewNonRelationKey",- "handler": "searchAttributeViewNonRelationKey",- "body": "none",+ "path": "/api/block/getBlockKramdown",+ "handler": "getBlockKramdown",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/BlockKramdownRequestInput"},"response": {"anyOf": [@@ -5069,7 +9351,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockKramdownData"},"msg": {"type": "string"@@ -5126,11 +9408,11 @@},{"method": "POST",- "path": "/api/block/appendBlock",- "handler": "appendBlock",+ "path": "/api/block/getBlockKramdowns",+ "handler": "getBlockKramdowns","body": "json","request": {- "$ref": "#/$defs/AppendBlockRequestInput"+ "$ref": "#/$defs/BlocksKramdownRequestInput"},"response": {"anyOf": [@@ -5146,16 +9428,9 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "object",+ "additionalProperties": {+ "type": "string"}},{@@ -5218,11 +9493,11 @@},{"method": "POST",- "path": "/api/block/appendDailyNoteBlock",- "handler": "appendDailyNoteBlock",+ "path": "/api/block/getBlockRelevantIDs",+ "handler": "getBlockRelevantIDs","body": "json","request": {- "$ref": "#/$defs/DailyNoteBlockRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -5236,24 +9511,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/BlockRelevantData"},"msg": {"type": "string"@@ -5310,11 +9568,11 @@},{"method": "POST",- "path": "/api/block/appendHeadingChildren",- "handler": "appendHeadingChildren",+ "path": "/api/block/getBlockSiblingID",+ "handler": "getBlockSiblingID","body": "json","request": {- "$ref": "#/$defs/AppendHeadingChildrenRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -5328,7 +9586,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/BlockSiblingData"},"msg": {"type": "string"@@ -5385,11 +9643,11 @@},{"method": "POST",- "path": "/api/block/batchAppendBlock",- "handler": "batchAppendBlock",+ "path": "/api/block/getBlockTreeInfos",+ "handler": "getBlockTreeInfos","body": "json","request": {- "$ref": "#/$defs/BatchParentBlockRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -5405,11 +9663,11 @@"data": {"anyOf": [{- "type": "array",- "items": {+ "type": "object",+ "additionalProperties": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "$ref": "#/$defs/BlockTreeInfo"},{"type": "null"@@ -5477,11 +9735,11 @@},{"method": "POST",- "path": "/api/block/batchInsertBlock",- "handler": "batchInsertBlock",+ "path": "/api/block/getBlocksIndexes",+ "handler": "getBlocksIndexes","body": "json","request": {- "$ref": "#/$defs/BatchInsertBlockRequestInput"+ "$ref": "#/$defs/BlocksQueryRequestInput"},"response": {"anyOf": [@@ -5497,16 +9755,9 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "object",+ "additionalProperties": {+ "type": "integer"}},{@@ -5569,11 +9820,11 @@},{"method": "POST",- "path": "/api/block/batchPrependBlock",- "handler": "batchPrependBlock",+ "path": "/api/block/getBlocksWordCount",+ "handler": "getBlocksWordCount","body": "json","request": {- "$ref": "#/$defs/BatchParentBlockRequestInput"+ "$ref": "#/$defs/BlocksWordCountRequestInput"},"response": {"anyOf": [@@ -5587,24 +9838,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/WordCountData"},"msg": {"type": "string"@@ -5661,11 +9895,11 @@},{"method": "POST",- "path": "/api/block/batchUpdateBlock",- "handler": "batchUpdateBlock",+ "path": "/api/block/getChildBlocks",+ "handler": "getChildBlocks","body": "json","request": {- "$ref": "#/$defs/BatchUpdateBlockRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -5679,24 +9913,17 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/ChildBlock"+ },+ {+ "type": "null"}- },- {- "type": "null"- }- ]+ ]+ }},"msg": {"type": "string"@@ -5753,11 +9980,11 @@},{"method": "POST",- "path": "/api/block/batchUpdateTaskListItemMarker",- "handler": "batchUpdateTaskListItemMarker",+ "path": "/api/block/getContentWordCount",+ "handler": "getContentWordCount","body": "json","request": {- "$ref": "#/$defs/BatchTaskListMarkerRequestInput"+ "$ref": "#/$defs/ContentWordCountRequestInput"},"response": {"anyOf": [@@ -5771,24 +9998,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/WordCountData"},"msg": {"type": "string"@@ -5845,11 +10055,11 @@},{"method": "POST",- "path": "/api/block/checkBlockExist",- "handler": "checkBlockExist",+ "path": "/api/block/getDOMText",+ "handler": "getDOMText","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/DOMTextRequestInput"},"response": {"anyOf": [@@ -5863,7 +10073,7 @@]},"data": {- "type": "boolean"+ "type": "string"},"msg": {"type": "string"@@ -5920,11 +10130,11 @@},{"method": "POST",- "path": "/api/block/checkBlockFold",- "handler": "checkBlockFold",+ "path": "/api/block/getDocBlocksOrders",+ "handler": "getDocBlocksOrders","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/DocOrdersRequestInput"},"response": {"anyOf": [@@ -5938,7 +10148,17 @@]},"data": {- "$ref": "#/$defs/BlockFoldData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "type": "string"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -5995,11 +10215,11 @@},{"method": "POST",- "path": "/api/block/checkBlockRef",- "handler": "checkBlockRef",- "body": "json",+ "path": "/api/block/getDocHeadingLevelTransaction",+ "handler": "getDocHeadingLevelTransaction",+ "body": "structJSON","request": {- "$ref": "#/$defs/CheckBlockRefRequestInput"+ "$ref": "#/$defs/DocHeadingLevelRequestInput"},"response": {"anyOf": [@@ -6013,7 +10233,14 @@]},"data": {- "type": "boolean"+ "anyOf": [+ {+ "$ref": "#/$defs/DocHeadingLevelData"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -6051,9 +10278,6 @@},{"type": "null"- },- {- "type": "boolean"}]},@@ -6073,11 +10297,11 @@},{"method": "POST",- "path": "/api/block/checkBlocksExist",- "handler": "checkBlocksExist",+ "path": "/api/block/getDocInfo",+ "handler": "getDocInfo","body": "json","request": {- "$ref": "#/$defs/CheckBlocksExistRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -6093,10 +10317,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "boolean"- }+ "$ref": "#/$defs/DocInfo"},{"type": "null"@@ -6158,11 +10379,11 @@},{"method": "POST",- "path": "/api/block/deleteBlock",- "handler": "deleteBlock",+ "path": "/api/block/getDocsInfo",+ "handler": "getDocsInfo","body": "json","request": {- "$ref": "#/$defs/DeleteBlockRequestInput"+ "$ref": "#/$defs/DocsInfoRequestInput"},"response": {"anyOf": [@@ -6182,7 +10403,7 @@"items": {"anyOf": [{- "$ref": "#/$defs/BlockTransaction"+ "$ref": "#/$defs/DocInfo"},{"type": "null"@@ -6250,11 +10471,11 @@},{"method": "POST",- "path": "/api/block/foldBlock",- "handler": "foldBlock",+ "path": "/api/block/getHeadingChildrenDOM",+ "handler": "getHeadingChildrenDOM","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/HeadingChildrenRequestInput"},"response": {"anyOf": [@@ -6268,7 +10489,7 @@]},"data": {- "type": "null"+ "type": "string"},"msg": {"type": "string"@@ -6325,11 +10546,11 @@},{"method": "POST",- "path": "/api/block/getBlockBreadcrumb",- "handler": "getBlockBreadcrumb",+ "path": "/api/block/getHeadingChildrenIDs",+ "handler": "getHeadingChildrenIDs","body": "json","request": {- "$ref": "#/$defs/BlockBreadcrumbRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -6347,14 +10568,7 @@{"type": "array","items": {- "anyOf": [- {- "$ref": "#/$defs/BlockPath"- },- {- "type": "null"- }- ]+ "type": "string"}},{@@ -6417,11 +10631,11 @@},{"method": "POST",- "path": "/api/block/getBlockBreadcrumbChildren",- "handler": "getBlockBreadcrumbChildren",+ "path": "/api/block/getHeadingDeleteTransaction",+ "handler": "getHeadingDeleteTransaction","body": "json","request": {- "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -6437,7 +10651,7 @@"data": {"anyOf": [{- "$ref": "#/$defs/BlockBreadcrumbChildren"+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -6499,11 +10713,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOM",- "handler": "getBlockDOM",+ "path": "/api/block/getHeadingFoldTransaction",+ "handler": "getHeadingFoldTransaction","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/HeadingFoldRequestInput"},"response": {"anyOf": [@@ -6517,7 +10731,14 @@]},"data": {- "$ref": "#/$defs/BlockDOMData"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -6574,11 +10795,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMWithEmbed",- "handler": "getBlockDOMWithEmbed",+ "path": "/api/block/getHeadingInsertTransaction",+ "handler": "getHeadingInsertTransaction","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -6592,7 +10813,14 @@]},"data": {- "$ref": "#/$defs/BlockDOMData"+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -6649,11 +10877,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMs",- "handler": "getBlockDOMs",+ "path": "/api/block/getHeadingLevelTransaction",+ "handler": "getHeadingLevelTransaction","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/HeadingLevelRequestInput"},"response": {"anyOf": [@@ -6669,10 +10897,7 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {- "type": "string"- }+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -6734,11 +10959,11 @@},{"method": "POST",- "path": "/api/block/getBlockDOMsWithEmbed",- "handler": "getBlockDOMsWithEmbed",+ "path": "/api/block/getOrderedListContinueStart",+ "handler": "getOrderedListContinueStart","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -6752,17 +10977,7 @@]},"data": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "string"- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/OrderedListStartData"},"msg": {"type": "string"@@ -6819,11 +11034,11 @@},{"method": "POST",- "path": "/api/block/getBlockDefIDsByRefText",- "handler": "getBlockDefIDsByRefText",- "body": "json",+ "path": "/api/block/getRecentUpdatedBlocks",+ "handler": "getRecentUpdatedBlocks",+ "body": "none","request": {- "$ref": "#/$defs/RefTextQueryRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -6837,7 +11052,24 @@]},"data": {- "$ref": "#/$defs/RefDefsData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/SearchBlock"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -6894,11 +11126,11 @@},{"method": "POST",- "path": "/api/block/getBlockIndex",- "handler": "getBlockIndex",+ "path": "/api/block/getRefIDs",+ "handler": "getRefIDs","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/RefIDsRequestInput"},"response": {"anyOf": [@@ -6912,7 +11144,7 @@]},"data": {- "type": "integer"+ "$ref": "#/$defs/RefIDsData"},"msg": {"type": "string"@@ -6969,11 +11201,11 @@},{"method": "POST",- "path": "/api/block/getBlockInfo",- "handler": "getBlockInfo",+ "path": "/api/block/getRefIDsByFileAnnotationID",+ "handler": "getRefIDsByFileAnnotationID","body": "json","request": {- "$ref": "#/$defs/BlockInfoRequestInput"+ "$ref": "#/$defs/FileAnnotationRefRequestInput"},"response": {"anyOf": [@@ -6987,7 +11219,7 @@]},"data": {- "$ref": "#/$defs/BlockInfoData"+ "$ref": "#/$defs/RefDefsData"},"msg": {"type": "string"@@ -7006,8 +11238,7 @@"code": {"type": "integer","enum": [- -1,- 3+ -1]},"data": {@@ -7026,9 +11257,6 @@},{"type": "null"- },- {- "type": "string"}]},@@ -7048,11 +11276,11 @@},{"method": "POST",- "path": "/api/block/getBlockKramdown",- "handler": "getBlockKramdown",+ "path": "/api/block/getRefText",+ "handler": "getRefText","body": "json","request": {- "$ref": "#/$defs/BlockKramdownRequestInput"+ "$ref": "#/$defs/BlockQueryRequestInput"},"response": {"anyOf": [@@ -7066,7 +11294,7 @@]},"data": {- "$ref": "#/$defs/BlockKramdownData"+ "type": "string"},"msg": {"type": "string"@@ -7123,11 +11351,11 @@},{"method": "POST",- "path": "/api/block/getBlockKramdowns",- "handler": "getBlockKramdowns",+ "path": "/api/block/getTailChildBlocks",+ "handler": "getTailChildBlocks","body": "json","request": {- "$ref": "#/$defs/BlocksKramdownRequestInput"+ "$ref": "#/$defs/TailChildBlocksRequestInput"},"response": {"anyOf": [@@ -7141,17 +11369,17 @@]},"data": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "string"+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/ChildBlock"+ },+ {+ "type": "null"}- },- {- "type": "null"- }- ]+ ]+ }},"msg": {"type": "string"@@ -7208,11 +11436,11 @@},{"method": "POST",- "path": "/api/block/getBlockRelevantIDs",- "handler": "getBlockRelevantIDs",+ "path": "/api/block/getTreeStat",+ "handler": "getTreeStat","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/TreeStatRequestInput"},"response": {"anyOf": [@@ -7226,7 +11454,7 @@]},"data": {- "$ref": "#/$defs/BlockRelevantData"+ "$ref": "#/$defs/TreeStatData"},"msg": {"type": "string"@@ -7283,8 +11511,8 @@},{"method": "POST",- "path": "/api/block/getBlockSiblingID",- "handler": "getBlockSiblingID",+ "path": "/api/block/getUnfoldedParentID",+ "handler": "getUnfoldedParentID","body": "json","request": {"$ref": "#/$defs/BlockQueryRequestInput"@@ -7301,7 +11529,7 @@]},"data": {- "$ref": "#/$defs/BlockSiblingData"+ "$ref": "#/$defs/UnfoldedParentData"},"msg": {"type": "string"@@ -7358,11 +11586,11 @@},{"method": "POST",- "path": "/api/block/getBlockTreeInfos",- "handler": "getBlockTreeInfos",+ "path": "/api/block/insertBlock",+ "handler": "insertBlock","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/InsertBlockRequestInput"},"response": {"anyOf": [@@ -7378,11 +11606,11 @@"data": {"anyOf": [{- "type": "object",- "additionalProperties": {+ "type": "array",+ "items": {"anyOf": [{- "$ref": "#/$defs/BlockTreeInfo"+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -7450,11 +11678,11 @@},{"method": "POST",- "path": "/api/block/getBlocksIndexes",- "handler": "getBlocksIndexes",+ "path": "/api/block/moveBlock",+ "handler": "moveBlock","body": "json","request": {- "$ref": "#/$defs/BlocksQueryRequestInput"+ "$ref": "#/$defs/MoveBlockRequestInput"},"response": {"anyOf": [@@ -7468,17 +11696,7 @@]},"data": {- "anyOf": [- {- "type": "object",- "additionalProperties": {- "type": "integer"- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -7535,11 +11753,11 @@},{"method": "POST",- "path": "/api/block/getBlocksWordCount",- "handler": "getBlocksWordCount",+ "path": "/api/block/moveOutlineHeading",+ "handler": "moveOutlineHeading","body": "json","request": {- "$ref": "#/$defs/BlocksWordCountRequestInput"+ "$ref": "#/$defs/MoveBlockRequestInput"},"response": {"anyOf": [@@ -7553,7 +11771,24 @@]},"data": {- "$ref": "#/$defs/WordCountData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -7610,11 +11845,11 @@},{"method": "POST",- "path": "/api/block/getChildBlocks",- "handler": "getChildBlocks",+ "path": "/api/block/prependBlock",+ "handler": "prependBlock","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/PrependBlockRequestInput"},"response": {"anyOf": [@@ -7628,17 +11863,24 @@]},"data": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/ChildBlock"- },- {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]}- ]- }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -7695,11 +11937,11 @@},{"method": "POST",- "path": "/api/block/getContentWordCount",- "handler": "getContentWordCount",+ "path": "/api/block/prependDailyNoteBlock",+ "handler": "prependDailyNoteBlock","body": "json","request": {- "$ref": "#/$defs/ContentWordCountRequestInput"+ "$ref": "#/$defs/DailyNoteBlockRequestInput"},"response": {"anyOf": [@@ -7713,7 +11955,24 @@]},"data": {- "$ref": "#/$defs/WordCountData"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -7770,11 +12029,11 @@},{"method": "POST",- "path": "/api/block/getDOMText",- "handler": "getDOMText",+ "path": "/api/block/setBlockReminder",+ "handler": "setBlockReminder","body": "json","request": {- "$ref": "#/$defs/DOMTextRequestInput"+ "$ref": "#/$defs/BlockReminderRequestInput"},"response": {"anyOf": [@@ -7788,7 +12047,7 @@]},"data": {- "type": "string"+ "type": "null"},"msg": {"type": "string"@@ -7845,11 +12104,11 @@},{"method": "POST",- "path": "/api/block/getDocBlocksOrders",- "handler": "getDocBlocksOrders",+ "path": "/api/block/swapBlockRef",+ "handler": "swapBlockRef","body": "json","request": {- "$ref": "#/$defs/DocOrdersRequestInput"+ "$ref": "#/$defs/SwapBlockRefRequestInput"},"response": {"anyOf": [@@ -7863,17 +12122,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "type": "string"- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -7930,11 +12179,11 @@},{"method": "POST",- "path": "/api/block/getDocHeadingLevelTransaction",- "handler": "getDocHeadingLevelTransaction",- "body": "structJSON",+ "path": "/api/block/transferBlockRef",+ "handler": "transferBlockRef",+ "body": "json","request": {- "$ref": "#/$defs/DocHeadingLevelRequestInput"+ "$ref": "#/$defs/TransferBlockRefRequestInput"},"response": {"anyOf": [@@ -7948,14 +12197,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/DocHeadingLevelData"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -8012,11 +12254,11 @@},{"method": "POST",- "path": "/api/block/getDocInfo",- "handler": "getDocInfo",+ "path": "/api/block/unfoldBlock",+ "handler": "unfoldBlock","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/BlockIDRequestInput"},"response": {"anyOf": [@@ -8030,14 +12272,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/DocInfo"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -8094,11 +12329,11 @@},{"method": "POST",- "path": "/api/block/getDocsInfo",- "handler": "getDocsInfo",+ "path": "/api/block/updateBlock",+ "handler": "updateBlock","body": "json","request": {- "$ref": "#/$defs/DocsInfoRequestInput"+ "$ref": "#/$defs/UpdateBlockRequestInput"},"response": {"anyOf": [@@ -8118,7 +12353,7 @@"items": {"anyOf": [{- "$ref": "#/$defs/DocInfo"+ "$ref": "#/$defs/BlockTransaction"},{"type": "null"@@ -8186,11 +12421,11 @@},{"method": "POST",- "path": "/api/block/getHeadingChildrenDOM",- "handler": "getHeadingChildrenDOM",+ "path": "/api/block/updateTaskListItemMarker",+ "handler": "updateTaskListItemMarker","body": "json","request": {- "$ref": "#/$defs/HeadingChildrenRequestInput"+ "$ref": "#/$defs/TaskListMarkerRequestInput"},"response": {"anyOf": [@@ -8204,7 +12439,24 @@]},"data": {- "type": "string"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/BlockTransaction"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -8261,11 +12513,11 @@},{"method": "POST",- "path": "/api/block/getHeadingChildrenIDs",- "handler": "getHeadingChildrenIDs",- "body": "json",+ "path": "/api/bookmark/getBookmark",+ "handler": "getBookmark",+ "body": "none","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -8283,7 +12535,14 @@{"type": "array","items": {- "type": "string"+ "anyOf": [+ {+ "$ref": "#/$defs/Bookmark"+ },+ {+ "type": "null"+ }+ ]}},{@@ -8346,11 +12605,11 @@},{"method": "POST",- "path": "/api/block/getHeadingDeleteTransaction",- "handler": "getHeadingDeleteTransaction",+ "path": "/api/bookmark/removeBookmark",+ "handler": "removeBookmark","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/RemoveBookmarkRequestInput"},"response": {"anyOf": [@@ -8364,14 +12623,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -8428,11 +12680,11 @@},{"method": "POST",- "path": "/api/block/getHeadingFoldTransaction",- "handler": "getHeadingFoldTransaction",+ "path": "/api/bookmark/renameBookmark",+ "handler": "renameBookmark","body": "json","request": {- "$ref": "#/$defs/HeadingFoldRequestInput"+ "$ref": "#/$defs/RenameBookmarkRequestInput"},"response": {"anyOf": [@@ -8446,14 +12698,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -8510,11 +12755,11 @@},{"method": "POST",- "path": "/api/block/getHeadingInsertTransaction",- "handler": "getHeadingInsertTransaction",- "body": "json",+ "path": "/api/filetree/getPinnedDocs",+ "handler": "getPinnedDocs",+ "body": "none","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -8528,14 +12773,10 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "array",+ "items": {+ "$ref": "#/$defs/PinnedDoc"+ }},"msg": {"type": "string"@@ -8592,11 +12833,11 @@},{"method": "POST",- "path": "/api/block/getHeadingLevelTransaction",- "handler": "getHeadingLevelTransaction",+ "path": "/api/filetree/updatePinnedDocs",+ "handler": "updatePinnedDocs","body": "json","request": {- "$ref": "#/$defs/HeadingLevelRequestInput"+ "$ref": "#/$defs/UpdatePinnedDocsRequestInput"},"response": {"anyOf": [@@ -8610,14 +12851,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -8674,11 +12908,11 @@},{"method": "POST",- "path": "/api/block/getOrderedListContinueStart",- "handler": "getOrderedListContinueStart",+ "path": "/api/format/autoSpace",+ "handler": "autoSpace","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {"anyOf": [@@ -8692,7 +12926,7 @@]},"data": {- "$ref": "#/$defs/OrderedListStartData"+ "type": "null"},"msg": {"type": "string"@@ -8749,43 +12983,26 @@},{"method": "POST",- "path": "/api/block/getRecentUpdatedBlocks",- "handler": "getRecentUpdatedBlocks",- "body": "none",+ "path": "/api/format/netAssets2LocalAssets",+ "handler": "netAssets2LocalAssets",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {- "anyOf": [- {- "type": "object",- "properties": {- "code": {- "type": "integer",- "enum": [- 0- ]- },- "data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/SearchBlock"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0]},+ "data": {+ "type": "null"+ },"msg": {"type": "string"}@@ -8841,11 +13058,11 @@},{"method": "POST",- "path": "/api/block/getRefIDs",- "handler": "getRefIDs",+ "path": "/api/format/netImg2LocalAssets",+ "handler": "netImg2LocalAssets","body": "json","request": {- "$ref": "#/$defs/RefIDsRequestInput"+ "$ref": "#/$defs/NetImageAssetsRequestInput"},"response": {"anyOf": [@@ -8859,7 +13076,7 @@]},"data": {- "$ref": "#/$defs/RefIDsData"+ "type": "null"},"msg": {"type": "string"@@ -8916,11 +13133,11 @@},{"method": "POST",- "path": "/api/block/getRefIDsByFileAnnotationID",- "handler": "getRefIDsByFileAnnotationID",- "body": "json",+ "path": "/api/history/clearWorkspaceHistory",+ "handler": "clearWorkspaceHistory",+ "body": "none","request": {- "$ref": "#/$defs/FileAnnotationRefRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -8934,7 +13151,7 @@]},"data": {- "$ref": "#/$defs/RefDefsData"+ "type": "null"},"msg": {"type": "string"@@ -8991,11 +13208,11 @@},{"method": "POST",- "path": "/api/block/getRefText",- "handler": "getRefText",- "body": "json",+ "path": "/api/history/reindexHistory",+ "handler": "reindexHistory",+ "body": "none","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -9009,7 +13226,7 @@]},"data": {- "type": "string"+ "type": "null"},"msg": {"type": "string"@@ -9066,11 +13283,11 @@},{"method": "POST",- "path": "/api/block/getTailChildBlocks",- "handler": "getTailChildBlocks",+ "path": "/api/history/searchHistory",+ "handler": "searchHistory","body": "json","request": {- "$ref": "#/$defs/TailChildBlocksRequestInput"+ "$ref": "#/$defs/SearchHistoryRequestInput"},"response": {"anyOf": [@@ -9084,17 +13301,7 @@]},"data": {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/ChildBlock"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/SearchHistoryData"},"msg": {"type": "string"@@ -9151,11 +13358,11 @@},{"method": "POST",- "path": "/api/block/getTreeStat",- "handler": "getTreeStat",+ "path": "/api/notebook/changeMasterPassword",+ "handler": "changeMasterPassword","body": "json","request": {- "$ref": "#/$defs/TreeStatRequestInput"+ "$ref": "#/$defs/ChangeMasterPasswordRequestInput"},"response": {"anyOf": [@@ -9169,7 +13376,7 @@]},"data": {- "$ref": "#/$defs/TreeStatData"+ "type": "null"},"msg": {"type": "string"@@ -9226,11 +13433,11 @@},{"method": "POST",- "path": "/api/block/getUnfoldedParentID",- "handler": "getUnfoldedParentID",+ "path": "/api/notebook/changeSortNotebook",+ "handler": "changeSortNotebook","body": "json","request": {- "$ref": "#/$defs/BlockQueryRequestInput"+ "$ref": "#/$defs/ChangeSortNotebookRequestInput"},"response": {"anyOf": [@@ -9244,7 +13451,7 @@]},"data": {- "$ref": "#/$defs/UnfoldedParentData"+ "type": "null"},"msg": {"type": "string"@@ -9301,11 +13508,11 @@},{"method": "POST",- "path": "/api/block/insertBlock",- "handler": "insertBlock",+ "path": "/api/notebook/closeNotebook",+ "handler": "closeNotebook","body": "json","request": {- "$ref": "#/$defs/InsertBlockRequestInput"+ "$ref": "#/$defs/CloseNotebookRequestInput"},"response": {"anyOf": [@@ -9319,24 +13526,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -9393,11 +13583,11 @@},{"method": "POST",- "path": "/api/block/moveBlock",- "handler": "moveBlock",+ "path": "/api/notebook/createEncryptedNotebook",+ "handler": "createEncryptedNotebook","body": "json","request": {- "$ref": "#/$defs/MoveBlockRequestInput"+ "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"},"response": {"anyOf": [@@ -9411,7 +13601,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CreateNotebookData"},"msg": {"type": "string"@@ -9468,11 +13658,11 @@},{"method": "POST",- "path": "/api/block/moveOutlineHeading",- "handler": "moveOutlineHeading",+ "path": "/api/notebook/createNotebook",+ "handler": "createNotebook","body": "json","request": {- "$ref": "#/$defs/MoveBlockRequestInput"+ "$ref": "#/$defs/CreateNotebookRequestInput"},"response": {"anyOf": [@@ -9486,24 +13676,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "$ref": "#/$defs/CreateNotebookData"},"msg": {"type": "string"@@ -9560,11 +13733,11 @@},{"method": "POST",- "path": "/api/block/prependBlock",- "handler": "prependBlock",- "body": "json",+ "path": "/api/notebook/disableEncryptedNotebooks",+ "handler": "disableEncryptedNotebooks",+ "body": "none","request": {- "$ref": "#/$defs/PrependBlockRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -9578,24 +13751,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -9652,11 +13808,11 @@},{"method": "POST",- "path": "/api/block/prependDailyNoteBlock",- "handler": "prependDailyNoteBlock",+ "path": "/api/notebook/enableEncryptedNotebooks",+ "handler": "enableEncryptedNotebooks","body": "json","request": {- "$ref": "#/$defs/DailyNoteBlockRequestInput"+ "$ref": "#/$defs/NotebookPasswordRequestInput"},"response": {"anyOf": [@@ -9670,24 +13826,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -9744,11 +13883,11 @@},{"method": "POST",- "path": "/api/block/setBlockReminder",- "handler": "setBlockReminder",- "body": "json",+ "path": "/api/notebook/exportNotebookCryptoBackup",+ "handler": "exportNotebookCryptoBackup",+ "body": "none","request": {- "$ref": "#/$defs/BlockReminderRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -9762,7 +13901,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotebookCryptoBackupData"},"msg": {"type": "string"@@ -9819,11 +13958,11 @@},{"method": "POST",- "path": "/api/block/swapBlockRef",- "handler": "swapBlockRef",- "body": "json",+ "path": "/api/notebook/getEncryptedNotebookStatus",+ "handler": "getEncryptedNotebookStatus",+ "body": "none","request": {- "$ref": "#/$defs/SwapBlockRefRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -9837,7 +13976,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/EncryptedNotebookStatusData"},"msg": {"type": "string"@@ -9894,11 +14033,11 @@},{"method": "POST",- "path": "/api/block/transferBlockRef",- "handler": "transferBlockRef",+ "path": "/api/notebook/getNotebookConf",+ "handler": "getNotebookConf","body": "json","request": {- "$ref": "#/$defs/TransferBlockRefRequestInput"+ "$ref": "#/$defs/CloseNotebookRequestInput"},"response": {"anyOf": [@@ -9912,7 +14051,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotebookConfData"},"msg": {"type": "string"@@ -9969,11 +14108,11 @@},{"method": "POST",- "path": "/api/block/unfoldBlock",- "handler": "unfoldBlock",+ "path": "/api/notebook/getNotebookInfo",+ "handler": "getNotebookInfo","body": "json","request": {- "$ref": "#/$defs/BlockIDRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -9987,7 +14126,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotebookInfoData"},"msg": {"type": "string"@@ -10044,43 +14183,26 @@},{"method": "POST",- "path": "/api/block/updateBlock",- "handler": "updateBlock",- "body": "json",+ "path": "/api/notebook/importNotebookCryptoBackup",+ "handler": "importNotebookCryptoBackup",+ "body": "multipart","request": {- "$ref": "#/$defs/UpdateBlockRequestInput"+ "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"},- "response": {- "anyOf": [- {- "type": "object",- "properties": {- "code": {- "type": "integer",- "enum": [- 0- ]- },- "data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }+ "response": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "code": {+ "type": "integer",+ "enum": [+ 0]},+ "data": {+ "type": "null"+ },"msg": {"type": "string"}@@ -10136,11 +14258,11 @@},{"method": "POST",- "path": "/api/block/updateTaskListItemMarker",- "handler": "updateTaskListItemMarker",+ "path": "/api/notebook/lockNotebook",+ "handler": "lockNotebook","body": "json","request": {- "$ref": "#/$defs/TaskListMarkerRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -10154,24 +14276,7 @@]},"data": {- "anyOf": [- {- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/BlockTransaction"- },- {- "type": "null"- }- ]- }- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -10228,11 +14333,11 @@},{"method": "POST",- "path": "/api/bookmark/getBookmark",- "handler": "getBookmark",- "body": "none",+ "path": "/api/notebook/lsNotebooks",+ "handler": "lsNotebooks",+ "body": "legacyOptional","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/ListNotebooksRequestInput"},"response": {"anyOf": [@@ -10248,17 +14353,7 @@"data": {"anyOf": [{- "type": "array",- "items": {- "anyOf": [- {- "$ref": "#/$defs/Bookmark"- },- {- "type": "null"- }- ]- }+ "$ref": "#/$defs/ListNotebooksData"},{"type": "null"@@ -10320,11 +14415,11 @@},{"method": "POST",- "path": "/api/bookmark/removeBookmark",- "handler": "removeBookmark",+ "path": "/api/notebook/openNotebook",+ "handler": "openNotebook","body": "json","request": {- "$ref": "#/$defs/RemoveBookmarkRequestInput"+ "$ref": "#/$defs/OpenNotebookRequestInput"},"response": {"anyOf": [@@ -10395,11 +14490,11 @@},{"method": "POST",- "path": "/api/bookmark/renameBookmark",- "handler": "renameBookmark",+ "path": "/api/notebook/removeNotebook",+ "handler": "removeNotebook","body": "json","request": {- "$ref": "#/$defs/RenameBookmarkRequestInput"+ "$ref": "#/$defs/NotebookIDRequestInput"},"response": {"anyOf": [@@ -10470,11 +14565,11 @@},{"method": "POST",- "path": "/api/filetree/getPinnedDocs",- "handler": "getPinnedDocs",- "body": "none",+ "path": "/api/notebook/renameNotebook",+ "handler": "renameNotebook",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/RenameNotebookRequestInput"},"response": {"anyOf": [@@ -10488,10 +14583,7 @@]},"data": {- "type": "array",- "items": {- "$ref": "#/$defs/PinnedDoc"- }+ "type": "null"},"msg": {"type": "string"@@ -10548,11 +14640,11 @@},{"method": "POST",- "path": "/api/filetree/updatePinnedDocs",- "handler": "updatePinnedDocs",- "body": "json",+ "path": "/api/notebook/reorder",+ "handler": "reorderNotebooks",+ "body": "structJSON","request": {- "$ref": "#/$defs/UpdatePinnedDocsRequestInput"+ "$ref": "#/$defs/ReorderNotebooksRequestInput"},"response": {"anyOf": [@@ -10566,7 +14658,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/ReorderData"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -10604,6 +14703,16 @@},{"type": "null"+ },+ {+ "anyOf": [+ {+ "$ref": "#/$defs/ReorderData"+ },+ {+ "type": "null"+ }+ ]}]},@@ -10623,11 +14732,11 @@},{"method": "POST",- "path": "/api/format/autoSpace",- "handler": "autoSpace",+ "path": "/api/notebook/setNotebookConf",+ "handler": "setNotebookConf","body": "json","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/SetNotebookConfRequestInput"},"response": {"anyOf": [@@ -10641,7 +14750,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/NotebookConf"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -10698,11 +14814,11 @@},{"method": "POST",- "path": "/api/format/netAssets2LocalAssets",- "handler": "netAssets2LocalAssets",+ "path": "/api/notebook/setNotebookCryptoAutoLock",+ "handler": "setNotebookCryptoAutoLock","body": "json","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"},"response": {"anyOf": [@@ -10773,11 +14889,11 @@},{"method": "POST",- "path": "/api/format/netImg2LocalAssets",- "handler": "netImg2LocalAssets",+ "path": "/api/notebook/setNotebookIcon",+ "handler": "setNotebookIcon","body": "json","request": {- "$ref": "#/$defs/NetImageAssetsRequestInput"+ "$ref": "#/$defs/SetNotebookIconRequestInput"},"response": {"anyOf": [@@ -10848,8 +14964,8 @@},{"method": "POST",- "path": "/api/history/clearWorkspaceHistory",- "handler": "clearWorkspaceHistory",+ "path": "/api/notebook/touchEncryptedNotebooks",+ "handler": "touchEncryptedNotebooks","body": "none","request": {"$ref": "#/$defs/EmptyRequestInput"@@ -10923,11 +15039,11 @@},{"method": "POST",- "path": "/api/history/reindexHistory",- "handler": "reindexHistory",- "body": "none",+ "path": "/api/notebook/unlockAndOpenNotebook",+ "handler": "unlockAndOpenNotebook",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/UnlockNotebookRequestInput"},"response": {"anyOf": [@@ -10998,11 +15114,11 @@},{"method": "POST",- "path": "/api/history/searchHistory",- "handler": "searchHistory",+ "path": "/api/notebook/unlockNotebook",+ "handler": "unlockNotebook","body": "json","request": {- "$ref": "#/$defs/SearchHistoryRequestInput"+ "$ref": "#/$defs/UnlockNotebookRequestInput"},"response": {"anyOf": [@@ -11016,7 +15132,7 @@]},"data": {- "$ref": "#/$defs/SearchHistoryData"+ "type": "null"},"msg": {"type": "string"@@ -11073,11 +15189,11 @@},{"method": "POST",- "path": "/api/notebook/changeMasterPassword",- "handler": "changeMasterPassword",+ "path": "/api/notification/pushErrMsg",+ "handler": "pushErrMsg","body": "json","request": {- "$ref": "#/$defs/ChangeMasterPasswordRequestInput"+ "$ref": "#/$defs/NotificationRequestInput"},"response": {"anyOf": [@@ -11091,7 +15207,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotificationData"},"msg": {"type": "string"@@ -11148,11 +15264,11 @@},{"method": "POST",- "path": "/api/notebook/changeSortNotebook",- "handler": "changeSortNotebook",+ "path": "/api/notification/pushMsg",+ "handler": "pushMsg","body": "json","request": {- "$ref": "#/$defs/ChangeSortNotebookRequestInput"+ "$ref": "#/$defs/NotificationRequestInput"},"response": {"anyOf": [@@ -11166,7 +15282,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/NotificationData"},"msg": {"type": "string"@@ -11223,11 +15339,11 @@},{"method": "POST",- "path": "/api/notebook/closeNotebook",- "handler": "closeNotebook",- "body": "json",+ "path": "/api/repo/checkSnapshot",+ "handler": "checkSnapshot",+ "body": "none","request": {- "$ref": "#/$defs/CloseNotebookRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -11241,7 +15357,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/CheckSnapshotData"},"msg": {"type": "string"@@ -11298,11 +15414,11 @@},{"method": "POST",- "path": "/api/notebook/createEncryptedNotebook",- "handler": "createEncryptedNotebook",+ "path": "/api/repo/createSnapshot",+ "handler": "createSnapshot","body": "json","request": {- "$ref": "#/$defs/CreateEncryptedNotebookRequestInput"+ "$ref": "#/$defs/CreateSnapshotRequestInput"},"response": {"anyOf": [@@ -11316,7 +15432,7 @@]},"data": {- "$ref": "#/$defs/CreateNotebookData"+ "$ref": "#/$defs/CreateSnapshotData"},"msg": {"type": "string"@@ -11373,11 +15489,11 @@},{"method": "POST",- "path": "/api/notebook/createNotebook",- "handler": "createNotebook",+ "path": "/api/repo/setSnapshotMemo",+ "handler": "setSnapshotMemo","body": "json","request": {- "$ref": "#/$defs/CreateNotebookRequestInput"+ "$ref": "#/$defs/SetSnapshotMemoRequestInput"},"response": {"anyOf": [@@ -11391,7 +15507,7 @@]},"data": {- "$ref": "#/$defs/CreateNotebookData"+ "type": "null"},"msg": {"type": "string"@@ -11448,11 +15564,11 @@},{"method": "POST",- "path": "/api/notebook/disableEncryptedNotebooks",- "handler": "disableEncryptedNotebooks",- "body": "none",+ "path": "/api/search/searchTag",+ "handler": "searchTag",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/SearchTagRequestInput"},"response": {"anyOf": [@@ -11466,7 +15582,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/SearchTagData"},"msg": {"type": "string"@@ -11523,11 +15639,11 @@},{"method": "POST",- "path": "/api/notebook/enableEncryptedNotebooks",- "handler": "enableEncryptedNotebooks",+ "path": "/api/setting/addVirtualBlockRefExclude",+ "handler": "addVirtualBlockRefExclude","body": "json","request": {- "$ref": "#/$defs/NotebookPasswordRequestInput"+ "$ref": "#/$defs/VirtualBlockRefRequestInput"},"response": {"anyOf": [@@ -11598,11 +15714,11 @@},{"method": "POST",- "path": "/api/notebook/exportNotebookCryptoBackup",- "handler": "exportNotebookCryptoBackup",- "body": "none",+ "path": "/api/setting/addVirtualBlockRefInclude",+ "handler": "addVirtualBlockRefInclude",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/VirtualBlockRefRequestInput"},"response": {"anyOf": [@@ -11616,7 +15732,7 @@]},"data": {- "$ref": "#/$defs/NotebookCryptoBackupData"+ "type": "null"},"msg": {"type": "string"@@ -11673,8 +15789,8 @@},{"method": "POST",- "path": "/api/notebook/getEncryptedNotebookStatus",- "handler": "getEncryptedNotebookStatus",+ "path": "/api/setting/getPandocBin",+ "handler": "getPandocBin","body": "none","request": {"$ref": "#/$defs/EmptyRequestInput"@@ -11691,7 +15807,7 @@]},"data": {- "$ref": "#/$defs/EncryptedNotebookStatusData"+ "type": "string"},"msg": {"type": "string"@@ -11748,11 +15864,11 @@},{"method": "POST",- "path": "/api/notebook/getNotebookConf",- "handler": "getNotebookConf",- "body": "json",+ "path": "/api/setting/refreshVirtualBlockRef",+ "handler": "refreshVirtualBlockRef",+ "body": "none","request": {- "$ref": "#/$defs/CloseNotebookRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -11766,7 +15882,7 @@]},"data": {- "$ref": "#/$defs/NotebookConfData"+ "type": "null"},"msg": {"type": "string"@@ -11823,11 +15939,11 @@},{"method": "POST",- "path": "/api/notebook/getNotebookInfo",- "handler": "getNotebookInfo",+ "path": "/api/setting/setEditorReadOnly",+ "handler": "setEditorReadOnly","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/EditorReadOnlyRequestInput"},"response": {"anyOf": [@@ -11841,7 +15957,7 @@]},"data": {- "$ref": "#/$defs/NotebookInfoData"+ "type": "null"},"msg": {"type": "string"@@ -11898,11 +16014,11 @@},{"method": "POST",- "path": "/api/notebook/importNotebookCryptoBackup",- "handler": "importNotebookCryptoBackup",- "body": "multipart",+ "path": "/api/snippet/getSnippet",+ "handler": "getSnippet",+ "body": "json","request": {- "$ref": "#/$defs/ImportNotebookCryptoBackupRequestInput"+ "$ref": "#/$defs/GetSnippetRequestInput"},"response": {"anyOf": [@@ -11916,7 +16032,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/SnippetsData"},"msg": {"type": "string"@@ -11973,11 +16089,11 @@},{"method": "POST",- "path": "/api/notebook/lockNotebook",- "handler": "lockNotebook",+ "path": "/api/snippet/removeSnippet",+ "handler": "removeSnippet","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/TrimmedIDRequestInput"},"response": {"anyOf": [@@ -11991,7 +16107,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/Snippet"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12048,11 +16171,11 @@},{"method": "POST",- "path": "/api/notebook/lsNotebooks",- "handler": "lsNotebooks",- "body": "legacyOptional",+ "path": "/api/snippet/setSnippet",+ "handler": "setSnippet",+ "body": "json","request": {- "$ref": "#/$defs/ListNotebooksRequestInput"+ "$ref": "#/$defs/SetSnippetRequestInput"},"response": {"anyOf": [@@ -12066,14 +16189,7 @@]},"data": {- "anyOf": [- {- "$ref": "#/$defs/ListNotebooksData"- },- {- "type": "null"- }- ]+ "type": "null"},"msg": {"type": "string"@@ -12130,11 +16246,11 @@},{"method": "POST",- "path": "/api/notebook/openNotebook",- "handler": "openNotebook",- "body": "json",+ "path": "/api/sqlite/flushTransaction",+ "handler": "flushTransaction",+ "body": "none","request": {- "$ref": "#/$defs/OpenNotebookRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -12205,11 +16321,11 @@},{"method": "POST",- "path": "/api/notebook/removeNotebook",- "handler": "removeNotebook",+ "path": "/api/storage/batchUpdateRecentDocCloseTime",+ "handler": "batchUpdateRecentDocCloseTime","body": "json","request": {- "$ref": "#/$defs/NotebookIDRequestInput"+ "$ref": "#/$defs/RecentDocsUpdateRequestInput"},"response": {"anyOf": [@@ -12280,11 +16396,11 @@},{"method": "POST",- "path": "/api/notebook/renameNotebook",- "handler": "renameNotebook",- "body": "json",+ "path": "/api/storage/getCriteria",+ "handler": "getCriteria",+ "body": "none","request": {- "$ref": "#/$defs/RenameNotebookRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -12298,7 +16414,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/Criterion"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12355,11 +16488,11 @@},{"method": "POST",- "path": "/api/notebook/reorder",- "handler": "reorderNotebooks",- "body": "structJSON",+ "path": "/api/storage/getInlineStyles",+ "handler": "getInlineStyles",+ "body": "none","request": {- "$ref": "#/$defs/ReorderNotebooksRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -12375,7 +16508,7 @@"data": {"anyOf": [{- "$ref": "#/$defs/ReorderData"+ "$ref": "#/$defs/InlineStyles"},{"type": "null"@@ -12418,16 +16551,6 @@},{"type": "null"- },- {- "anyOf": [- {- "$ref": "#/$defs/ReorderData"- },- {- "type": "null"- }- ]}]},@@ -12447,11 +16570,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookConf",- "handler": "setNotebookConf",- "body": "json",+ "path": "/api/storage/getLocalStorage",+ "handler": "getLocalStorage",+ "body": "none","request": {- "$ref": "#/$defs/SetNotebookConfRequestInput"+ "$ref": "#/$defs/EmptyRequestInput"},"response": {"anyOf": [@@ -12467,7 +16590,10 @@"data": {"anyOf": [{- "$ref": "#/$defs/NotebookConf"+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }},{"type": "null"@@ -12529,11 +16655,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookCryptoAutoLock",- "handler": "setNotebookCryptoAutoLock",+ "path": "/api/storage/getLocalStorageVal",+ "handler": "getLocalStorageVal","body": "json","request": {- "$ref": "#/$defs/NotebookCryptoAutoLockRequestInput"+ "$ref": "#/$defs/StorageKeyRequestInput"},"response": {"anyOf": [@@ -12547,7 +16673,7 @@]},"data": {- "type": "null"+ "$ref": "#/$defs/JSONValue"},"msg": {"type": "string"@@ -12604,11 +16730,11 @@},{"method": "POST",- "path": "/api/notebook/setNotebookIcon",- "handler": "setNotebookIcon",+ "path": "/api/storage/getLocalStorageVals",+ "handler": "getLocalStorageVals","body": "json","request": {- "$ref": "#/$defs/SetNotebookIconRequestInput"+ "$ref": "#/$defs/StorageKeysRequestInput"},"response": {"anyOf": [@@ -12622,7 +16748,17 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12679,11 +16815,11 @@},{"method": "POST",- "path": "/api/notebook/touchEncryptedNotebooks",- "handler": "touchEncryptedNotebooks",- "body": "none",+ "path": "/api/storage/getOutlineStorage",+ "handler": "getOutlineStorage",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/OutlineStorageRequestInput"},"response": {"anyOf": [@@ -12697,7 +16833,17 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12754,11 +16900,11 @@},{"method": "POST",- "path": "/api/notebook/unlockAndOpenNotebook",- "handler": "unlockAndOpenNotebook",- "body": "json",+ "path": "/api/storage/getRecentDocs",+ "handler": "getRecentDocs",+ "body": "legacyOptional","request": {- "$ref": "#/$defs/UnlockNotebookRequestInput"+ "$ref": "#/$defs/RecentDocsRequestInput"},"response": {"anyOf": [@@ -12772,7 +16918,24 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "array",+ "items": {+ "anyOf": [+ {+ "$ref": "#/$defs/RecentDoc"+ },+ {+ "type": "null"+ }+ ]+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12829,11 +16992,11 @@},{"method": "POST",- "path": "/api/notebook/unlockNotebook",- "handler": "unlockNotebook",+ "path": "/api/storage/getViewState",+ "handler": "getViewState","body": "json","request": {- "$ref": "#/$defs/UnlockNotebookRequestInput"+ "$ref": "#/$defs/StorageKeyRequestInput"},"response": {"anyOf": [@@ -12847,7 +17010,17 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12904,11 +17077,11 @@},{"method": "POST",- "path": "/api/notification/pushErrMsg",- "handler": "pushErrMsg",+ "path": "/api/storage/patchViewState",+ "handler": "patchViewState","body": "json","request": {- "$ref": "#/$defs/NotificationRequestInput"+ "$ref": "#/$defs/ViewStatePatchRequestInput"},"response": {"anyOf": [@@ -12922,7 +17095,17 @@]},"data": {- "$ref": "#/$defs/NotificationData"+ "anyOf": [+ {+ "type": "object",+ "additionalProperties": {+ "$ref": "#/$defs/JSONValue"+ }+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -12979,11 +17162,11 @@},{"method": "POST",- "path": "/api/notification/pushMsg",- "handler": "pushMsg",+ "path": "/api/storage/removeCriterion",+ "handler": "removeCriterion","body": "json","request": {- "$ref": "#/$defs/NotificationRequestInput"+ "$ref": "#/$defs/RemoveCriterionRequestInput"},"response": {"anyOf": [@@ -12997,7 +17180,7 @@]},"data": {- "$ref": "#/$defs/NotificationData"+ "type": "null"},"msg": {"type": "string"@@ -13054,11 +17237,11 @@},{"method": "POST",- "path": "/api/repo/checkSnapshot",- "handler": "checkSnapshot",- "body": "none",+ "path": "/api/storage/removeLocalStorageVal",+ "handler": "removeLocalStorageVal",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/StorageRemoveRequestInput"},"response": {"anyOf": [@@ -13072,7 +17255,7 @@]},"data": {- "$ref": "#/$defs/CheckSnapshotData"+ "type": "null"},"msg": {"type": "string"@@ -13129,11 +17312,11 @@},{"method": "POST",- "path": "/api/repo/createSnapshot",- "handler": "createSnapshot",+ "path": "/api/storage/removeLocalStorageVals",+ "handler": "removeLocalStorageVals","body": "json","request": {- "$ref": "#/$defs/CreateSnapshotRequestInput"+ "$ref": "#/$defs/StorageRemoveKeysRequestInput"},"response": {"anyOf": [@@ -13147,7 +17330,7 @@]},"data": {- "$ref": "#/$defs/CreateSnapshotData"+ "type": "null"},"msg": {"type": "string"@@ -13204,11 +17387,11 @@},{"method": "POST",- "path": "/api/repo/setSnapshotMemo",- "handler": "setSnapshotMemo",+ "path": "/api/storage/removeOutlineStorage",+ "handler": "removeOutlineStorage","body": "json","request": {- "$ref": "#/$defs/SetSnapshotMemoRequestInput"+ "$ref": "#/$defs/OutlineStorageRequestInput"},"response": {"anyOf": [@@ -13279,11 +17462,11 @@},{"method": "POST",- "path": "/api/search/searchTag",- "handler": "searchTag",+ "path": "/api/storage/removeViewState",+ "handler": "removeViewState","body": "json","request": {- "$ref": "#/$defs/SearchTagRequestInput"+ "$ref": "#/$defs/StorageKeyRequestInput"},"response": {"anyOf": [@@ -13297,7 +17480,7 @@]},"data": {- "$ref": "#/$defs/SearchTagData"+ "type": "null"},"msg": {"type": "string"@@ -13354,11 +17537,11 @@},{"method": "POST",- "path": "/api/setting/addVirtualBlockRefExclude",- "handler": "addVirtualBlockRefExclude",+ "path": "/api/storage/setCriterion",+ "handler": "setCriterion","body": "json","request": {- "$ref": "#/$defs/VirtualBlockRefRequestInput"+ "$ref": "#/$defs/SetCriterionRequestInput"},"response": {"anyOf": [@@ -13429,11 +17612,11 @@},{"method": "POST",- "path": "/api/setting/addVirtualBlockRefInclude",- "handler": "addVirtualBlockRefInclude",+ "path": "/api/storage/setInlineStyles",+ "handler": "setInlineStyles","body": "json","request": {- "$ref": "#/$defs/VirtualBlockRefRequestInput"+ "$ref": "#/$defs/SetInlineStylesRequestInput"},"response": {"anyOf": [@@ -13447,7 +17630,14 @@]},"data": {- "type": "null"+ "anyOf": [+ {+ "$ref": "#/$defs/InlineStyles"+ },+ {+ "type": "null"+ }+ ]},"msg": {"type": "string"@@ -13504,8 +17694,8 @@},{"method": "POST",- "path": "/api/setting/getPandocBin",- "handler": "getPandocBin",+ "path": "/api/storage/setLocalStorage",+ "handler": "setLocalStorage","body": "none","request": {"$ref": "#/$defs/EmptyRequestInput"@@ -13522,7 +17712,7 @@]},"data": {- "type": "string"+ "type": "null"},"msg": {"type": "string"@@ -13579,11 +17769,11 @@},{"method": "POST",- "path": "/api/setting/refreshVirtualBlockRef",- "handler": "refreshVirtualBlockRef",- "body": "none",+ "path": "/api/storage/setLocalStorageVal",+ "handler": "setLocalStorageVal",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/StorageSetRequestInput"},"response": {"anyOf": [@@ -13654,11 +17844,11 @@},{"method": "POST",- "path": "/api/setting/setEditorReadOnly",- "handler": "setEditorReadOnly",+ "path": "/api/storage/setLocalStorageVals",+ "handler": "setLocalStorageVals","body": "json","request": {- "$ref": "#/$defs/EditorReadOnlyRequestInput"+ "$ref": "#/$defs/StorageSetKeysRequestInput"},"response": {"anyOf": [@@ -13729,11 +17919,11 @@},{"method": "POST",- "path": "/api/snippet/getSnippet",- "handler": "getSnippet",+ "path": "/api/storage/setOutlineStorage",+ "handler": "setOutlineStorage","body": "json","request": {- "$ref": "#/$defs/GetSnippetRequestInput"+ "$ref": "#/$defs/OutlineStorageSetRequestInput"},"response": {"anyOf": [@@ -13747,7 +17937,7 @@]},"data": {- "$ref": "#/$defs/SnippetsData"+ "type": "null"},"msg": {"type": "string"@@ -13804,11 +17994,11 @@},{"method": "POST",- "path": "/api/snippet/removeSnippet",- "handler": "removeSnippet",+ "path": "/api/storage/setWorkspaceAVPalette",+ "handler": "setWorkspaceAVPalette","body": "json","request": {- "$ref": "#/$defs/TrimmedIDRequestInput"+ "$ref": "#/$defs/WorkspaceAVPaletteRequestInput"},"response": {"anyOf": [@@ -13824,7 +18014,7 @@"data": {"anyOf": [{- "$ref": "#/$defs/Snippet"+ "$ref": "#/$defs/InlineStyles"},{"type": "null"@@ -13886,11 +18076,11 @@},{"method": "POST",- "path": "/api/snippet/setSnippet",- "handler": "setSnippet",+ "path": "/api/storage/updateRecentDocCloseTime",+ "handler": "updateRecentDocCloseTime","body": "json","request": {- "$ref": "#/$defs/SetSnippetRequestInput"+ "$ref": "#/$defs/RecentDocUpdateRequestInput"},"response": {"anyOf": [@@ -13961,11 +18151,11 @@},{"method": "POST",- "path": "/api/sqlite/flushTransaction",- "handler": "flushTransaction",- "body": "none",+ "path": "/api/storage/updateRecentDocOpenTime",+ "handler": "updateRecentDocOpenTime",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/RecentDocUpdateRequestInput"},"response": {"anyOf": [@@ -14036,11 +18226,11 @@},{"method": "POST",- "path": "/api/storage/setLocalStorage",- "handler": "setLocalStorage",- "body": "none",+ "path": "/api/storage/updateRecentDocViewTime",+ "handler": "updateRecentDocViewTime",+ "body": "json","request": {- "$ref": "#/$defs/EmptyRequestInput"+ "$ref": "#/$defs/RecentDocUpdateRequestInput"},"response": {"anyOf": [diff --git a/kernel/apicontract/storage.go b/kernel/apicontract/storage.gonew file mode 100644index 0000000000..ae8170bc72--- /dev/null+++ b/kernel/apicontract/storage.go@@ -0,0 +1,100 @@+package apicontract++import (+ "bytes"+ "encoding/json"+ "errors"+ "io"+ "strings"+)++func init() {+ BatchUpdateRecentDocCloseTime.decodeRequest = func(reader io.Reader) (request RecentDocsUpdateRequest, err error) {+ fields, err := blockRequestFields(reader, "/api/storage/batchUpdateRecentDocCloseTime")+ if err != nil {+ return request, err+ }+ raw := fields["rootIDs"]+ if len(raw) == 0 || bytes.Equal(raw, []byte("null")) {+ return request, nil+ }+ var entries []json.RawMessage+ if json.Unmarshal(raw, &entries) != nil {+ return request, errors.New("Field [rootIDs] should be of type [Array]")+ }+ for _, entry := range entries {+ var id string+ if json.Unmarshal(entry, &id) == nil && id != "" {+ request.RootIDs = append(request.RootIDs, id)+ }+ }+ return+ }+ plain := PatchViewState+ PatchViewState.decodeRequest = func(reader io.Reader) (ViewStatePatchRequest, error) {+ request, err := plain.Decode(reader)+ if err != nil {+ switch {+ case strings.HasPrefix(err.Error(), "Field [values]"):+ err = errors.New("Field [values]: should be of type [Object]")+ case strings.HasPrefix(err.Error(), "Field [removeKeys]"):+ err = errors.New("Field [removeKeys]: each element should be a non-empty String")+ }+ }+ return request, err+ }+}++type RecentDocUpdateRequest struct {+ RootID string `json:"rootID" api:"optional,nullable"`+}+type RecentDocsUpdateRequest struct {+ RootIDs []string `json:"rootIDs" api:"optional,nullable"`+}++type StorageKeyRequest struct {+ Key string `json:"key" api:"trim"`+}+type StorageKeysRequest struct {+ Keys []string `json:"keys"`+}+type StorageRemoveRequest struct {+ Key string `json:"key" api:"trim"`+ App string `json:"app" api:"optional,nullable"`+}+type StorageRemoveKeysRequest struct {+ Keys []string `json:"keys"`+ App string `json:"app" api:"optional,nullable"`+}+type StorageSetRequest struct {+ Key string `json:"key" api:"trim"`+ App string `json:"app" api:"optional,nullable"`+ Val JSONValue `json:"val" api:"optional,nullable"`+}+type StorageSetKeysRequest struct {+ KeyVals map[string]JSONValue `json:"keyVals"`+ App string `json:"app" api:"optional,nullable"`+}+type OutlineStorageRequest struct {+ DocID string `json:"docID" api:"trim"`+}+type OutlineStorageSetRequest struct {+ DocID string `json:"docID" api:"trim"`+ Val map[string]JSONValue `json:"val"`+}+type ViewStatePatchRequest struct {+ Key string `json:"key" api:"trim"`+ Values map[string]JSONValue `json:"values" api:"optional"`+ RemoveKeys []string `json:"removeKeys" api:"optional,nullable"`+}+type RecentDocsRequest struct {+ SortBy string `json:"sortBy" api:"optional,nullable"`+}+type RecentDoc struct {+ RootID string `json:"rootID"`+ Icon string `json:"icon,omitempty"`+ Title string `json:"title,omitempty"`+ ViewedAt int64 `json:"viewedAt,omitempty"`+ ClosedAt int64 `json:"closedAt,omitempty"`+ OpenAt int64 `json:"openAt,omitempty"`+}