Skip to content

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

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

Daniel7eb7a725c36f
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index c1f70aa440..5a0f3fcad5 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -1,5 +1,7 @@
import {showMessage} from "../dialog/message";
import {fetchPost} from "../util/fetch";
+import {ContractFormData} from "../util/contractFormData";
+import type {APIPOSTRoutes} from "../types/api";
import {confirmDialog} from "../dialog/confirmDialog";
import {highlightRender} from "../protyle/render/highlightRender";
import {Constants} from "../constants";
@@ -33,6 +35,7 @@ import {BAZAAR_README_SANITIZE_OPTIONS} from "./bazaarReadmeSanitize";
import {
BAZAAR_PACKAGE_CONFIG,
BAZAAR_PACKAGE_TYPES,
+ isBazaarPackageType,
} from "./bazaar/packageConfig";
import {genBazaarPackagePanelHTML} from "./bazaar/html";
import {bindBazaarEvents} from "./bazaar/events";
@@ -439,7 +442,7 @@ export const bazaar = {
callback(bazaar._getPackageDetail(bazaarType, packageName) || {});
return;
}
- const detail = response.data as IBazaarPackageDetail;
+ const detail = response.data;
bazaar._setPackageDetail(bazaarType, packageName, detail);
callback(detail);
});
@@ -1513,25 +1516,20 @@ type="checkbox">
return;
}
bazaar._setLocalPackageUploading(true, mount);
- const formData = new FormData();
- formData.append("file", file);
- formData.append("frontend", getFrontend());
- formData.append("overwrite", overwrite.toString());
+ const formData = new ContractFormData<APIPOSTRoutes["/api/bazaar/installLocalBazaarPackage"]["request"]>({
+ file,
+ frontend: getFrontend(),
+ overwrite: overwrite.toString(),
+ });
fetchPost("/api/bazaar/installLocalBazaarPackage", formData, (response) => {
- const data = response.data as {
- reason?: string;
- packageType?: TBazaarType;
- packageName?: string;
- minAppVersion?: string;
- updated?: boolean;
- };
+ const data = response.data;
if (response.code !== 0) {
- if (data?.reason === "package-exists" && data.packageName) {
+ if (data && "reason" in data && data.reason === "package-exists" && data.packageName) {
confirmDialog("⚠️ " + window.siyuan.languages.update,
window.siyuan.languages.confirmOverwriteLocalBazaarPackage.replace("${name}", escapeHtml(data.packageName)), () => {
bazaar._installLocalPackage(file, app, mount, true);
});
- } else if (data?.reason === "package-incompatible") {
+ } else if (data && "reason" in data && data.reason === "package-incompatible") {
showMessage(data.minAppVersion ?
window.siyuan.languages.bazaarNeedVersion.replace("${x}", data.minAppVersion) :
window.siyuan.languages.incompatible);
@@ -1540,7 +1538,7 @@ type="checkbox">
}
return;
}
- if (!data?.packageType || !data.packageName) {
+ if (!data || !("updated" in data) || !isBazaarPackageType(data.packageType) || !data.packageName) {
showMessage(window.siyuan.languages.uploadError);
return;
}
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 0dac140e7c..a81bcc5e1d 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -60,6 +60,66 @@ export type BatchTaskListMarkerRequestInput = { "items": Array<TaskListMarkerReq
export type BatchUpdateBlockRequestInput = { "blocks": Array<UpdateBlockRequestInput>; };
+export type BatchUpdatePackageRequestInput = { "frontend": string; };
+
+export type BazaarAppearance = { "bodyGradient": BazaarBodyGradient | null; "closeButtonBehavior": number; "codeBlockThemeDark": string; "codeBlockThemeLight": string; "darkThemes": Array<BazaarAppearanceTheme | null> | null; "entryVisibility": BazaarEntryVisibility | null; "globalFontFamilies": Array<BazaarEditorFont | null> | null; "hideStatusBar": boolean; "hideToolbar": boolean; "icon": string; "iconVer": string; "icons": Array<BazaarAppearanceIcon | null> | null; "lang": string; "lightThemes": Array<BazaarAppearanceTheme | null> | null; "mode": number; "modeOS": boolean; "notifications": BazaarNotifications | null; "statusBar": BazaarStatusBar | null; "themeDark": string; "themeJS": boolean; "themeLight": string; "themeVer": string; };
+
+export type BazaarAppearanceIcon = { "label": string; "name": string; };
+
+export type BazaarAppearancePackagesData = { "appearance": BazaarAppearance | null; "packages": Array<BazaarPackage | null> | null; };
+
+export type BazaarAppearanceTheme = { "frontends"?: Array<string>; "label": string; "name": string; };
+
+export type BazaarBodyGradient = { "dark": BazaarBodyGradientColor; "light": BazaarBodyGradientColor; "mode": string; };
+
+export type BazaarBodyGradientColor = { "color": string; "opacity": number; };
+
+export type BazaarEditorFont = { "displayName": string; "family": string; "weight": number; };
+
+export type BazaarEntryVisibility = { "active": string; "profiles": Array<BazaarEntryVisibilityProfile | null> | null; "version": number; };
+
+export type BazaarEntryVisibilityProfile = { "entries": Record<string, boolean> | null; "id": string; "name": string; "orders": Record<string, Array<string> | null> | null; };
+
+export type BazaarFunding = { "custom": Array<string> | null; "github": string; "links"?: Array<BazaarFundingLink>; "openCollective": string; "patreon": string; };
+
+export type BazaarFundingLink = { "label": string; "url": string; };
+
+export type BazaarLocalInstallData = { "minAppVersion"?: string; "packageName": string; "packageType": string; "updated": boolean; };
+
+export type BazaarLocalInstallError = { "minAppVersion": string; "packageName": string; "packageType": string; "reason": "install-failed" | "package-exists" | "package-incompatible"; };
+
+export type BazaarLocalInstallResult = (BazaarLocalInstallData & { "reason"?: never; }) | (BazaarLocalInstallError & { "updated"?: never; });
+
+export type BazaarNotifications = { "browserCompatibility": boolean; "docTreeMaxList": boolean; "formatPainterTip"?: boolean; "selectAllTip"?: boolean; "tagMaxList": boolean; "workspaceNotSSD": boolean; };
+
+export type BazaarPackage = { "alternatives"?: Array<string>; "author": string; "backends": Array<string> | null; "bazaarIncompatible"?: boolean; "bootAppearances"?: Array<string>; "current": boolean; "deprecated"?: boolean; "deprecatedReason"?: Record<string, string>; "description": Record<string, string> | null; "disabledInPublish": boolean; "disallowInstall": boolean; "disallowUpdate": boolean; "displayName": Record<string, string> | null; "downloads": number; "enabled"?: boolean; "frontends": Array<string> | null; "funding": BazaarFunding | null; "hInstallDate": string; "hInstallSize": string; "hSize": string; "hUpdated": string; "hasStorageData"?: boolean; "icon"?: string; "iconURL": string; "installSize": number; "installTime": number; "installed": boolean; "installedIncompatible"?: boolean; "invalidReason"?: "missing-manifest" | "invalid-manifest" | "name-mismatch"; "kernels": Array<string> | null; "keywords": Array<string> | null; "minAppVersion": string; "modes"?: Array<string> | null; "name": string; "openIssues": number; "outdated": boolean; "preferredDeprecatedReason"?: string; "preferredDesc": string; "preferredFunding": string; "preferredName": string; "preferredReadme": string; "preview"?: string; "previewURL": string; "rating"?: BazaarPackageRating; "ratingAvailable": boolean; "readme": Record<string, string> | null; "repoHash": string; "repoRef"?: string; "repoURL": string; "size": number; "stars": number; "updateRequiredMinAppVer"?: string; "updateTime": number; "updated": string; "url": string; "userDisabledInPublish"?: boolean; "version": string; };
+
+export type BazaarPackageDetail = { "available": BazaarPackage | null; "installed": BazaarPackage | null; };
+
+export type BazaarPackageRating = { "average": number; "count": number; "distribution": [number, number, number, number, number]; };
+
+export type BazaarPackageSizeData = { "hInstallSize": string; "installSize": number; };
+
+export type BazaarPackagesData = { "packages": Array<BazaarPackage | null> | null; };
+
+export type BazaarREADMEData = { "html": string; };
+
+export type BazaarRatingData = { "rating"?: BazaarPackageRating; "ratingAvailable": boolean; "userRating": number; };
+
+export type BazaarRatingError = { "errorCode": "bazaarRatingRateLimited" | "bazaarPackagePending"; };
+
+export type BazaarRatingResult = (BazaarRatingData & { "errorCode"?: never; }) | (BazaarRatingError & { "rating"?: never; "ratingAvailable"?: never; "userRating"?: never; });
+
+export type BazaarRatingsData = { "eligiblePackageNames": Array<string> | null; "ratings": Record<string, BazaarPackageRating | null> | null; };
+
+export type BazaarStatusBar = { "msgDataSyncDisabled": boolean; "msgTaskAssetDatabaseIndexCommitDisabled": boolean; "msgTaskDatabaseIndexCommitDisabled": boolean; "msgTaskHistoryDatabaseIndexCommitDisabled": boolean; "msgTaskHistoryGenerateFileDisabled": boolean; "version": number; };
+
+export type BazaarUpdatedData = { "icons": Array<BazaarPackageDetail | null> | null; "plugins": Array<BazaarPackageDetail | null> | null; "templates": Array<BazaarPackageDetail | null> | null; "themes": Array<BazaarPackageDetail | null> | null; "widgets": Array<BazaarPackageDetail | null> | null; };
+
+export type BazaarUserRatingsData = { "eligiblePackageNames": Array<string> | null; "userRatings": Record<string, number> | null; };
+
+export type BazaarUserRatingsResult = (BazaarUserRatingsData & { "errorCode"?: never; }) | (BazaarRatingError & { "eligiblePackageNames"?: never; "userRatings"?: never; });
+
export type BlockBreadcrumbChildren = { "hasMore": boolean; "items": Array<BlockPath | null> | null; };
export type BlockBreadcrumbChildrenRequestInput = { "excludeTypes"?: Array<string> | null; "id": string; "ids"?: Array<string> | null; "limit"?: number | null; "notebook"?: string | null; "offset"?: number | null; };
@@ -262,12 +322,46 @@ export type FullTextSearchBlockData = { "blocks": Array<SearchBlock | null> | nu
export type FullTextSearchBlockRequestInput = { "groupBy"?: number | null; "method"?: number | null; "notebook"?: string | null; "orderBy"?: number | null; "page"?: number | null; "pageSize"?: number | null; "paths"?: Array<string> | null; "query"?: string | null; "searchHPath"?: boolean | null; "subTypes"?: SearchSubtypeFilterInput | null; "types"?: Record<string, boolean> | null; };
+export type GetBazaarIconRequestInput = { "keyword"?: string | null; };
+
+export type GetBazaarPackageREADMERequestInput = { "packageType": string; "repoHash": string; "repoURL": string; };
+
+export type GetBazaarPackageRatingRequestInput = { "packageName": string; "packageType": string; };
+
+export type GetBazaarPackageRatingsRequestInput = { "packageNames": Array<string>; "packageType": string; };
+
+export type GetBazaarPackageRequestInput = { "frontend"?: string | null; "packageName": string; "packageType": string; };
+
+export type GetBazaarPackageUserRatingsRequestInput = { "packageNames": Array<string>; "packageType": string; };
+
+export type GetBazaarPluginRequestInput = { "frontend": string; "keyword"?: string | null; };
+
+export type GetBazaarTemplateRequestInput = { "keyword"?: string | null; };
+
+export type GetBazaarThemeRequestInput = { "frontend"?: string | null; "keyword"?: string | null; };
+
+export type GetBazaarWidgetRequestInput = { "keyword"?: string | null; };
+
export type GetEmbedBlockRequestInput = { "breadcrumb"?: boolean | null; "embedBlockID": string; "headingMode"?: number | null; "includeIDs": Array<string>; "notebook"?: string | null; };
+export type GetInstalledIconRequestInput = { "keyword"?: string | null; };
+
+export type GetInstalledPackageSizeRequestInput = { "packageName": string; "packageType": string; };
+
+export type GetInstalledPluginRequestInput = { "frontend": string; "keyword"?: string | null; };
+
+export type GetInstalledTemplateRequestInput = { "keyword"?: string | null; };
+
+export type GetInstalledThemeRequestInput = { "frontend"?: string | null; "keyword"?: string | null; };
+
+export type GetInstalledWidgetRequestInput = { "keyword"?: string | null; };
+
export type GetSnippetRequestInput = { "enabled": number; "keyword"?: string | null; "type": string; };
export type GetTagRequestInput = { "app"?: string | null; "ignoreMaxListHint"?: boolean | null; "sort"?: number | null; };
+export type GetUpdatedPackageRequestInput = { "frontend": string; };
+
export type GlobalGraphConf = { "d3": GraphD3 | null; "dailyNote": boolean; "minRefs": number; "type": GraphTypeFilter | null; };
export type GlobalGraphRequestInput = { "conf": GraphConfigurationFieldsInput; "k"?: string | null; "reqId"?: JSONValue | null; };
@@ -378,6 +472,18 @@ export type InlineStyles = { "av": InlineStyleAV | null; "builtin": InlineStyleB
export type InsertBlockRequestInput = { "data": string; "dataType": string; "nextID"?: string | null; "parentID"?: string | null; "previousID"?: string | null; };
+export type InstallBazaarIconRequestInput = { "keyword"?: string | null; "packageName": string; "repoHash": string; "repoRef"?: string | null; "repoURL": string; };
+
+export type InstallBazaarPluginRequestInput = { "frontend": string; "keyword"?: string | null; "packageName": string; "repoHash": string; "repoRef"?: string | null; "repoURL": string; };
+
+export type InstallBazaarTemplateRequestInput = { "keyword"?: string | null; "packageName": string; "repoHash": string; "repoRef"?: string | null; "repoURL": string; };
+
+export type InstallBazaarThemeRequestInput = { "frontend"?: string | null; "keyword"?: string | null; "mode"?: number; "modeOS"?: boolean; "packageName": string; "repoHash": string; "repoRef"?: string | null; "repoURL": string; };
+
+export type InstallBazaarWidgetRequestInput = { "keyword"?: string | null; "packageName": string; "repoHash": string; "repoRef"?: string | null; "repoURL": string; };
+
+export type InstallLocalBazaarPackageRequestInput = { "file"?: Blob; "frontend"?: string; "overwrite"?: string; };
+
export type JSONValue = null | boolean | number | string | Array<JSONValue> | { [key: string]: JSONValue };
export type KernelPetal = { "existed": boolean; "incompatible": boolean; "js": string; };
@@ -618,6 +724,8 @@ export type SearchWidgetData = { "k": string; "widgets": Array<SearchWidgetResul
export type SearchWidgetResult = { "content": string; "name": string; };
+export type SetBazaarPackageRatingRequestInput = { "packageName": string; "packageType": string; "rating": number; };
+
export type SetBlockAttrsRequestInput = { "attrs": Record<string, string | null>; "id": string; };
export type SetCriterionRequestInput = { "criterion": CriterionInput | null; };
@@ -700,10 +808,22 @@ export type TrimmedIDRequestInput = { "id": string; };
export type UnfoldedParentData = { "parentID": string; };
+export type UninstallBazaarIconRequestInput = { "keyword"?: string | null; "packageName": string; };
+
+export type UninstallBazaarPluginRequestInput = { "frontend"?: string | null; "keyword"?: string | null; "packageName": string; };
+
+export type UninstallBazaarTemplateRequestInput = { "keyword"?: string | null; "packageName": string; };
+
+export type UninstallBazaarThemeRequestInput = { "frontend"?: string | null; "keyword"?: string | null; "packageName": string; };
+
+export type UninstallBazaarWidgetRequestInput = { "keyword"?: string | null; "packageName": string; };
+
export type UnlockNotebookRequestInput = { "notebook": string; "password": string; };
export type UnzipRequestInput = { "path": string; "zipPath": string; };
+export type UpdateBazaarPackageRequestInput = { "frontend": string; "keyword"?: string | null; "packageName": string; "packageType": string; };
+
export type UpdateBlockRequestInput = { "data": string; "dataType": string; "id": string; "lockType"?: boolean | null; };
export type UpdateChannelRequestInput = { "updateChannel": string; };
@@ -890,37 +1010,6 @@ export type APILegacyPOSTPath =
"/api/av/setDatabaseBlockView" |
"/api/av/sortAttributeViewKey" |
"/api/av/sortAttributeViewViewKey" |
- "/api/bazaar/batchUpdatePackage" |
- "/api/bazaar/getBazaarIcon" |
- "/api/bazaar/getBazaarPackage" |
- "/api/bazaar/getBazaarPackageREADME" |
- "/api/bazaar/getBazaarPackageRating" |
- "/api/bazaar/getBazaarPackageRatings" |
- "/api/bazaar/getBazaarPackageUserRatings" |
- "/api/bazaar/getBazaarPlugin" |
- "/api/bazaar/getBazaarTemplate" |
- "/api/bazaar/getBazaarTheme" |
- "/api/bazaar/getBazaarWidget" |
- "/api/bazaar/getInstalledIcon" |
- "/api/bazaar/getInstalledPackageSize" |
- "/api/bazaar/getInstalledPlugin" |
- "/api/bazaar/getInstalledTemplate" |
- "/api/bazaar/getInstalledTheme" |
- "/api/bazaar/getInstalledWidget" |
- "/api/bazaar/getUpdatedPackage" |
- "/api/bazaar/installBazaarIcon" |
- "/api/bazaar/installBazaarPlugin" |
- "/api/bazaar/installBazaarTemplate" |
- "/api/bazaar/installBazaarTheme" |
- "/api/bazaar/installBazaarWidget" |
- "/api/bazaar/installLocalBazaarPackage" |
- "/api/bazaar/setBazaarPackageRating" |
- "/api/bazaar/uninstallBazaarIcon" |
- "/api/bazaar/uninstallBazaarPlugin" |
- "/api/bazaar/uninstallBazaarTemplate" |
- "/api/bazaar/uninstallBazaarTheme" |
- "/api/bazaar/uninstallBazaarWidget" |
- "/api/bazaar/updateBazaarPackage" |
"/api/export/copyExportFile" |
"/api/export/export2Liandi" |
"/api/export/exportAsFile" |
@@ -1205,6 +1294,161 @@ export interface APIPOSTRoutes {
response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
body: "none";
};
+ "/api/bazaar/batchUpdatePackage": {
+ request: BatchUpdatePackageRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarIcon": {
+ request: GetBazaarIconRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPackage": {
+ request: GetBazaarPackageRequestInput;
+ response: { "code": 0; "data": BazaarPackageDetail; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPackageREADME": {
+ request: GetBazaarPackageREADMERequestInput;
+ response: { "code": 0; "data": BazaarREADMEData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPackageRating": {
+ request: GetBazaarPackageRatingRequestInput;
+ response: { "code": 0; "data": BazaarRatingResult; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null | BazaarRatingResult; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPackageRatings": {
+ request: GetBazaarPackageRatingsRequestInput;
+ response: { "code": 0; "data": BazaarRatingsData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPackageUserRatings": {
+ request: GetBazaarPackageUserRatingsRequestInput;
+ response: { "code": 0; "data": BazaarUserRatingsResult; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null | BazaarUserRatingsResult; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarPlugin": {
+ request: GetBazaarPluginRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarTemplate": {
+ request: GetBazaarTemplateRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarTheme": {
+ request: GetBazaarThemeRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getBazaarWidget": {
+ request: GetBazaarWidgetRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledIcon": {
+ request: GetInstalledIconRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledPackageSize": {
+ request: GetInstalledPackageSizeRequestInput;
+ response: { "code": 0; "data": BazaarPackageSizeData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledPlugin": {
+ request: GetInstalledPluginRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledTemplate": {
+ request: GetInstalledTemplateRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledTheme": {
+ request: GetInstalledThemeRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getInstalledWidget": {
+ request: GetInstalledWidgetRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/getUpdatedPackage": {
+ request: GetUpdatedPackageRequestInput;
+ response: { "code": 0; "data": BazaarUpdatedData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installBazaarIcon": {
+ request: InstallBazaarIconRequestInput;
+ response: { "code": 0; "data": BazaarAppearancePackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installBazaarPlugin": {
+ request: InstallBazaarPluginRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installBazaarTemplate": {
+ request: InstallBazaarTemplateRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installBazaarTheme": {
+ request: InstallBazaarThemeRequestInput;
+ response: { "code": 0; "data": BazaarAppearancePackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installBazaarWidget": {
+ request: InstallBazaarWidgetRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/installLocalBazaarPackage": {
+ request: InstallLocalBazaarPackageRequestInput;
+ response: { "code": 0; "data": BazaarLocalInstallResult; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null | BazaarLocalInstallResult; "msg": string; };
+ body: "multipart";
+ };
+ "/api/bazaar/setBazaarPackageRating": {
+ request: SetBazaarPackageRatingRequestInput;
+ response: { "code": 0; "data": BazaarRatingResult; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null | BazaarRatingResult; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/uninstallBazaarIcon": {
+ request: UninstallBazaarIconRequestInput;
+ response: { "code": 0; "data": BazaarAppearancePackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/uninstallBazaarPlugin": {
+ request: UninstallBazaarPluginRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/uninstallBazaarTemplate": {
+ request: UninstallBazaarTemplateRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/uninstallBazaarTheme": {
+ request: UninstallBazaarThemeRequestInput;
+ response: { "code": 0; "data": BazaarAppearancePackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/uninstallBazaarWidget": {
+ request: UninstallBazaarWidgetRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/bazaar/updateBazaarPackage": {
+ request: UpdateBazaarPackageRequestInput;
+ response: { "code": 0; "data": BazaarPackagesData; "msg": string; } | { "code": -1 | 1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
"/api/block/appendBlock": {
request: AppendBlockRequestInput;
response: { "code": 0; "data": Array<BlockTransaction | null> | null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
diff --git a/app/tests/api-contract.types.ts b/app/tests/api-contract.types.ts
index 46b8562c28..3c98682bb6 100644
--- a/app/tests/api-contract.types.ts
+++ b/app/tests/api-contract.types.ts
@@ -6,6 +6,18 @@ declare const fetchGet: FetchGet;
declare const fetchSyncPost: FetchSyncPost;
declare const dynamicURL: string;
+fetchPost("/api/bazaar/getBazaarPackageRating", {packageType: "plugin", packageName: "example"}, response => {
+ if (response.data && "rating" in response.data && response.data.rating) {
+ const distribution: [number, number, number, number, number] = response.data.rating.distribution;
+ void distribution;
+ }
+});
+// @ts-expect-error 集市评分参数必须为数值。
+fetchPost("/api/bazaar/setBazaarPackageRating", {packageType: "plugin", packageName: "example", rating: "5"});
+// @ts-expect-error 集市包名列表只能包含字符串。
+fetchPost("/api/bazaar/getBazaarPackageRatings", {packageType: "plugin", packageNames: [1]});
+fetchPost("/api/bazaar/installLocalBazaarPackage", new ContractFormData({file: new Blob(), overwrite: "true"}));
+
type RPCWebSocket = APIGETRoutes["/ws/plugin/rpc"]["websocket"];
const rpcCall: RPCWebSocket["incoming"] = {jsonrpc: "2.0", method: "call", id: 1};
const rpcNotice: RPCWebSocket["outgoing"] = {jsonrpc: "2.0", method: "event", params: null};
diff --git a/docs/API-CONTRACTS.md b/docs/API-CONTRACTS.md
index f3446b8364..c6c0710604 100644
--- a/docs/API-CONTRACTS.md
+++ b/docs/API-CONTRACTS.md
@@ -24,6 +24,8 @@ Encrypted notebook lifecycle endpoints use typed requests and responses while re
## Compatibility requirements
+Marketplace contracts retain required-field ordering, whitespace handling, theme mode dependencies, rating availability and rate-limit payloads, and local-package upload errors. Package and appearance responses declare their complete nested structures, including the fixed five-element rating distribution. Upload requests keep first-file selection and overwrite parsing. Installation, removal, authentication, and publish restrictions remain in the existing business handlers and middleware.
+
Plugin information queries retain path, query-string, and JSON-body name precedence, including whitespace and business error codes 1 through 4. URL parameters bypass body decoding, and list queries ignore the body. Plugin and RPC-method lists retain nullable arrays and entries. HTTP JSON-RPC has a separate contract for single and batch requests, success and error replies, and notification-only HTTP 204 responses. Plugin admission occurs before body reads, batch errors retain their order, and arbitrary JSON is limited to RPC parameters, results, and error details. RPC WebSocket routes declare HTTP 101 upgrades, HTTP 404 plugin admission errors, HTTP 400 text rejections, and separate incoming calls and outgoing replies or notifications. Origin authorization and connection cleanup remain in the existing upgrade lifecycle. Plugin HTTP services remain a separate protocol migration.
Search contracts retain pagination defaults and numeric truncation, path validation and deduplication, ignored historical subtype filters, and null versus empty arrays. Reference search distinguishes correlation-only responses from block results and retains notebook admission before deferred parameter validation. SQL search authorization, publish filtering, encrypted notebook leases, cancellation responses, and read-only embed-update no-ops remain in their original order. Desktop and mobile callers share generated request types.
diff --git a/docs/API-CONTRACTS.zh-CN.md b/docs/API-CONTRACTS.zh-CN.md
index a74526e9b9..4d36e4b57b 100644
--- a/docs/API-CONTRACTS.zh-CN.md
+++ b/docs/API-CONTRACTS.zh-CN.md
@@ -24,6 +24,8 @@
## 兼容要求
+集市契约保留必填字段的校验顺序、空白处理、主题模式联动、评分可用性和限流载荷,以及本地包上传错误。包和外观响应声明完整嵌套结构,包括固定五项的评分分布。上传请求保留首文件选择及覆盖参数解析。安装、卸载、鉴权和发布限制仍由既有业务处理函数及中间件执行。
+
插件信息查询保留路径参数、查询参数和 JSON 请求体中名称的优先级,包括空白及业务错误码 1 至 4。命中 URL 参数时不解析请求体,列表查询忽略请求体。插件列表与 RPC 方法列表保留数组及数组元素的空值语义。HTTP JSON-RPC 使用独立契约描述单次与批量请求、成功与错误回复,以及纯通知请求的 HTTP 204 响应。插件准入先于请求体读取,批量错误保留原有顺序,任意 JSON 仅用于 RPC 参数、返回值和错误详情。RPC WebSocket 路由声明 HTTP 101 升级、HTTP 404 插件准入错误、HTTP 400 文本拒绝,以及独立的入站调用和出站回复或通知。Origin 授权与连接清理保留在既有升级生命周期中。插件 HTTP 服务仍需单独迁移。
搜索契约保留分页默认值与小数截断、路径校验与去重、历史子类型筛选的忽略规则,以及空值与空数组的区别。引用搜索区分仅回传请求标识和完整块结果,保留笔记本准入先于延迟参数校验的顺序。SQL 搜索权限、发布过滤、加密笔记本租约、取消请求的响应和只读嵌入块更新的空操作保持原有顺序。桌面端与移动端调用使用生成的请求类型。
diff --git a/kernel/api/bazaar.go b/kernel/api/bazaar.go
index e565336489..f6eda61cca 100644
--- a/kernel/api/bazaar.go
+++ b/kernel/api/bazaar.go
@@ -26,7 +26,9 @@ import (
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
"github.com/siyuan-note/siyuan/kernel/bazaar"
+ "github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/model"
"github.com/siyuan-note/siyuan/kernel/util"
)
@@ -44,66 +46,46 @@ var (
setBazaarPackageRatingModel = model.SetBazaarPackageRating
)
-func installLocalBazaarPackage(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, bazaar.MaxLocalPackageArchiveSize+1024*1024)
- fileHeader, err := c.FormFile("file")
- if err != nil {
- ret.Code = 1
- ret.Msg = "Marketplace package file is required"
- return
+var installLocalBazaarPackage = contractHandler(apicontract.InstallLocalBazaarPackage, func(c *gin.Context, request apicontract.InstallLocalBazaarPackageRequest) apicontract.Response[apicontract.BazaarLocalInstallResult] {
+ fileHeader := request.File
+ if fileHeader == nil {
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, "Marketplace package file is required")
}
+ var err error
+
if fileHeader.Size > bazaar.MaxLocalPackageArchiveSize {
- ret.Code = 1
- ret.Msg = "Marketplace package file is too large"
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, "Marketplace package file is too large")
}
tempDir := filepath.Join(util.TempDir, "bazaar", "upload", gulu.Rand.String(7))
if err = os.MkdirAll(tempDir, 0755); err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, err.Error())
}
defer os.RemoveAll(tempDir)
archivePath := filepath.Join(tempDir, "package.zip")
uploaded, err := fileHeader.Open()
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, err.Error())
}
defer uploaded.Close()
target, err := os.OpenFile(archivePath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, err.Error())
}
written, copyErr := io.Copy(target, io.LimitReader(uploaded, bazaar.MaxLocalPackageArchiveSize+1))
closeErr := target.Close()
if copyErr != nil {
- ret.Code = 1
- ret.Msg = copyErr.Error()
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, copyErr.Error())
}
if closeErr != nil {
- ret.Code = 1
- ret.Msg = closeErr.Error()
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, closeErr.Error())
}
if written > bazaar.MaxLocalPackageArchiveSize {
- ret.Code = 1
- ret.Msg = "Marketplace package file is too large"
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, "Marketplace package file is too large")
}
- result, installErr := model.InstallLocalBazaarPackage(archivePath, c.PostForm("frontend"), c.PostForm("overwrite") == "true")
+ result, installErr := model.InstallLocalBazaarPackage(archivePath, request.Frontend, request.Overwrite == "true")
if installErr != nil {
- ret.Code = 1
- ret.Msg = installErr.Error()
if result != nil {
reason := "install-failed"
if errors.Is(installErr, model.ErrLocalBazaarPackageExists) {
@@ -111,923 +93,619 @@ func installLocalBazaarPackage(c *gin.Context) {
} else if errors.Is(installErr, model.ErrLocalBazaarPackageIncompatible) {
reason = "package-incompatible"
}
- ret.Data = map[string]any{
- "reason": reason,
- "packageType": result.PackageType,
- "packageName": result.PackageName,
- "minAppVersion": result.MinAppVersion,
- }
+ return apicontract.InstallLocalBazaarPackage.FailureWithData(1, installErr.Error(), apicontract.NewBazaarLocalInstallResultError(apicontract.BazaarLocalInstallError{Reason: reason, PackageType: result.PackageType, PackageName: result.PackageName, MinAppVersion: result.MinAppVersion}))
}
- return
+ return apicontract.Failure[apicontract.BazaarLocalInstallResult](1, installErr.Error())
}
- ret.Data = result
-}
+ return apicontract.Success(apicontract.NewBazaarLocalInstallResult(apicontract.BazaarLocalInstallData{PackageType: result.PackageType, PackageName: result.PackageName, MinAppVersion: result.MinAppVersion, Updated: result.Updated}))
+}, prepareLocalBazaarUpload)
-func batchUpdatePackage(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+var batchUpdatePackage = contractHandler(apicontract.BatchUpdatePackage, func(c *gin.Context, request apicontract.BatchUpdatePackageRequest) apicontract.Response[apicontract.Null] {
+ if err := model.BatchUpdatePackages(request.Frontend); err != nil {
+ return apicontract.Failure[apicontract.Null](1, err.Error())
}
- var frontend string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("frontend", &frontend, true, true)) {
- return
- }
+ return apicontract.Success(apicontract.Null{})
+})
- if err := model.BatchUpdatePackages(frontend); err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- }
-}
-
-func getUpdatedPackage(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var frontend string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("frontend", &frontend, true, true)) {
- return
- }
-
- plugins, widgets, icons, themes, templates, err := model.GetUpdatedPackages(frontend)
+var getUpdatedPackage = contractHandler(apicontract.GetUpdatedPackage, func(c *gin.Context, request apicontract.GetUpdatedPackageRequest) apicontract.Response[apicontract.BazaarUpdatedData] {
+ plugins, widgets, icons, themes, templates, err := model.GetUpdatedPackages(request.Frontend)
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
- }
- ret.Data = map[string]any{
- "plugins": plugins,
- "widgets": widgets,
- "icons": icons,
- "themes": themes,
- "templates": templates,
+ return apicontract.Failure[apicontract.BazaarUpdatedData](1, err.Error())
}
-}
+ data := apicontract.BazaarUpdatedData{Plugins: bazaarUpdatedPackages(plugins), Widgets: bazaarUpdatedPackages(widgets), Icons: bazaarUpdatedPackages(icons), Themes: bazaarUpdatedPackages(themes), Templates: bazaarUpdatedPackages(templates)}
-func updateBazaarPackage(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ return apicontract.Success(data)
+})
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+var updateBazaarPackage = contractHandler(apicontract.UpdateBazaarPackage, func(c *gin.Context, request apicontract.UpdateBazaarPackageRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarPackagesData](1, "Invalid package type")
}
-
- var pkgType, packageName, frontend, keyword string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageName", &packageName, true, true),
- util.BindJsonArg("frontend", &frontend, true, true),
- util.BindJsonArg("keyword", &keyword, false, false),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
- }
- if err := model.UpdateBazaarPackage(pkgType, packageName, frontend); err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ if err := model.UpdateBazaarPackage(request.PackageType, request.PackageName, request.Frontend); err != nil {
+ return apicontract.Failure[apicontract.BazaarPackagesData](1, err.Error())
}
util.PushMsg(model.Conf.Language(69), 3000)
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages(pkgType, frontend, keyword),
- }
-}
-
-func getInstalledPackageSize(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages(request.PackageType, request.Frontend, request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var pkgType, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
+var getInstalledPackageSize = contractHandler(apicontract.GetInstalledPackageSize, func(c *gin.Context, request apicontract.GetInstalledPackageSizeRequest) apicontract.Response[apicontract.BazaarPackageSizeData] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarPackageSizeData](1, "Invalid package type")
}
- size, hSize, err := model.GetInstalledPackageSize(pkgType, packageName)
+ size, hSize, err := model.GetInstalledPackageSize(request.PackageType, request.PackageName)
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarPackageSizeData](1, err.Error())
}
- ret.Data = map[string]any{
- "installSize": size,
- "hInstallSize": hSize,
- }
-}
+ data := apicontract.BazaarPackageSizeData{InstallSize: size, HInstallSize: hSize}
-func getBazaarPackage(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ return apicontract.Success(data)
+})
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+var getBazaarPackage = contractHandler(apicontract.GetBazaarPackage, func(c *gin.Context, request apicontract.GetBazaarPackageRequest) apicontract.Response[apicontract.BazaarPackageDetail] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarPackageDetail](1, "Invalid package type")
}
+ installed, available := model.GetBazaarPackageDetail(request.PackageType, request.PackageName, request.Frontend)
+ data := apicontract.BazaarPackageDetail{Installed: bazaarPackage(installed), Available: bazaarPackage(available)}
- var pkgType, packageName, frontend string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageName", &packageName, true, true),
- util.BindJsonArg("frontend", &frontend, false, true),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
- }
- installed, available := model.GetBazaarPackageDetail(pkgType, packageName, frontend)
- ret.Data = map[string]any{
- "installed": installed,
- "available": available,
- }
-}
-
-func getBazaarPackageRatings(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ return apicontract.Success(data)
+})
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var pkgType string
- var packageNamesArg []any
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageNames", &packageNamesArg, true, false),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
+var getBazaarPackageRatings = contractHandler(apicontract.GetBazaarPackageRatings, func(c *gin.Context, request apicontract.GetBazaarPackageRatingsRequest) apicontract.Response[apicontract.BazaarRatingsData] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarRatingsData](1, "Invalid package type")
}
- packageNames := make([]string, 0, len(packageNamesArg))
- for _, item := range packageNamesArg {
- packageName, elemOK := item.(string)
- if !elemOK {
- ret.Code = -1
- ret.Msg = "Field [packageNames]: each element should be of type [String]"
- return
- }
- packageNames = append(packageNames, packageName)
+ if request.NamesError != nil {
+ return apicontract.Failure[apicontract.BazaarRatingsData](-1, request.NamesError.Error())
}
- ratings, eligiblePackageNames, err := model.GetInstalledBazaarPackageRatings(c.Request.Context(), pkgType, packageNames)
+ ratings, eligiblePackageNames, err := model.GetInstalledBazaarPackageRatings(c.Request.Context(), request.PackageType, request.PackageNames)
if nil != err {
- ret.Code = 1
- ret.Msg = err.Error()
- return
- }
- ret.Data = bazaarPackageRatingsResponseData(ratings, eligiblePackageNames)
-}
-
-func bazaarPackageRatingsResponseData(ratings map[string]*bazaar.PackageRating,
- eligiblePackageNames []string) map[string]any {
- return map[string]any{
- "ratings": ratings,
- "eligiblePackageNames": eligiblePackageNames,
- }
-}
-
-func getBazaarPackageUserRatings(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+ return apicontract.Failure[apicontract.BazaarRatingsData](1, err.Error())
}
+ return apicontract.Success(apicontract.BazaarRatingsData{Ratings: bazaarRatings(ratings), EligiblePackageNames: eligiblePackageNames})
+})
- var pkgType string
- var packageNamesArg []any
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageNames", &packageNamesArg, true, false),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
+var getBazaarPackageUserRatings = contractHandler(apicontract.GetBazaarPackageUserRatings, func(c *gin.Context, request apicontract.GetBazaarPackageUserRatingsRequest) apicontract.Response[apicontract.BazaarUserRatingsResult] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarUserRatingsResult](1, "Invalid package type")
}
- packageNames := make([]string, 0, len(packageNamesArg))
- for _, item := range packageNamesArg {
- packageName, elemOK := item.(string)
- if !elemOK {
- ret.Code = -1
- ret.Msg = "Field [packageNames]: each element should be of type [String]"
- return
- }
- packageNames = append(packageNames, packageName)
+ if request.NamesError != nil {
+ return apicontract.Failure[apicontract.BazaarUserRatingsResult](-1, request.NamesError.Error())
}
userRatings, eligiblePackageNames, err := getBazaarPackageUserRatingsModel(
- c.Request.Context(), pkgType, packageNames)
+ c.Request.Context(), request.PackageType, request.PackageNames)
if nil != err {
- setBazaarPackageRatingError(ret, err)
- return
- }
- ret.Data = bazaarPackageUserRatingsResponseData(userRatings, eligiblePackageNames)
-}
-
-func bazaarPackageUserRatingsResponseData(userRatings map[string]int, eligiblePackageNames []string) map[string]any {
- return map[string]any{
- "userRatings": userRatings,
- "eligiblePackageNames": eligiblePackageNames,
- }
-}
-
-func getBazaarPackageRating(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+ if data := bazaarRatingError(err); data != nil {
+ return apicontract.GetBazaarPackageUserRatings.FailureWithData(1, err.Error(), apicontract.NewBazaarUserRatingsResultError(*data))
+ }
+ return apicontract.Failure[apicontract.BazaarUserRatingsResult](1, err.Error())
}
+ return apicontract.Success(apicontract.NewBazaarUserRatingsResult(apicontract.BazaarUserRatingsData{UserRatings: userRatings, EligiblePackageNames: eligiblePackageNames}))
+})
- var pkgType, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
+var getBazaarPackageRating = contractHandler(apicontract.GetBazaarPackageRating, func(c *gin.Context, request apicontract.GetBazaarPackageRatingRequest) apicontract.Response[apicontract.BazaarRatingResult] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarRatingResult](1, "Invalid package type")
}
- rating, ratingAvailable, userRating, err := model.GetBazaarPackageRating(c.Request.Context(), pkgType, packageName)
+ rating, ratingAvailable, userRating, err := model.GetBazaarPackageRating(c.Request.Context(), request.PackageType, request.PackageName)
if nil != err {
- setBazaarPackageRatingError(ret, err)
- return
- }
- ret.Data = bazaarPackageRatingResponseData(rating, ratingAvailable, userRating)
-}
-
-func setBazaarPackageRating(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+ if data := bazaarRatingError(err); data != nil {
+ return apicontract.GetBazaarPackageRating.FailureWithData(1, err.Error(), apicontract.NewBazaarRatingResultError(*data))
+ }
+ return apicontract.Failure[apicontract.BazaarRatingResult](1, err.Error())
}
+ return apicontract.Success(apicontract.NewBazaarRatingResult(apicontract.BazaarRatingData{Rating: bazaarRating(rating), RatingAvailable: ratingAvailable, UserRating: userRating}))
+})
- var pkgType, packageName string
- var ratingArg float64
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("packageType", &pkgType, true, true),
- util.BindJsonArg("packageName", &packageName, true, true),
- util.BindJsonArg("rating", &ratingArg, true, false),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = 1
- ret.Msg = "Invalid package type"
- return
+var setBazaarPackageRating = contractHandler(apicontract.SetBazaarPackageRating, func(c *gin.Context, request apicontract.SetBazaarPackageRatingRequest) apicontract.Response[apicontract.BazaarRatingResult] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarRatingResult](1, "Invalid package type")
}
- if ratingArg < 0 || 5 < ratingArg || ratingArg != math.Trunc(ratingArg) {
- ret.Code = 1
- ret.Msg = "Rating must be an integer from 0 to 5"
- return
+ if request.Rating < 0 || 5 < request.Rating || request.Rating != math.Trunc(request.Rating) {
+ return apicontract.Failure[apicontract.BazaarRatingResult](1, "Rating must be an integer from 0 to 5")
}
rating, ratingAvailable, userRating, err := setBazaarPackageRatingModel(
- c.Request.Context(), pkgType, packageName, int(ratingArg))
+ c.Request.Context(), request.PackageType, request.PackageName, int(request.Rating))
if nil != err {
- setBazaarPackageRatingError(ret, err)
- return
- }
- ret.Data = bazaarPackageRatingResponseData(rating, ratingAvailable, userRating)
-}
-
-func setBazaarPackageRatingError(ret *gulu.Result, err error) {
- ret.Code = 1
- ret.Msg = err.Error()
- if errors.Is(err, model.ErrBazaarRatingRateLimited) {
- ret.Data = map[string]any{"errorCode": "bazaarRatingRateLimited"}
- }
- if errors.Is(err, model.ErrBazaarPackagePending) {
- ret.Data = map[string]any{"errorCode": "bazaarPackagePending"}
+ if data := bazaarRatingError(err); data != nil {
+ return apicontract.SetBazaarPackageRating.FailureWithData(1, err.Error(), apicontract.NewBazaarRatingResultError(*data))
+ }
+ return apicontract.Failure[apicontract.BazaarRatingResult](1, err.Error())
}
-}
+ return apicontract.Success(apicontract.NewBazaarRatingResult(apicontract.BazaarRatingData{Rating: bazaarRating(rating), RatingAvailable: ratingAvailable, UserRating: userRating}))
+})
-func bazaarPackageRatingResponseData(rating *bazaar.PackageRating, ratingAvailable bool, userRating int) map[string]any {
- ret := map[string]any{
- "ratingAvailable": ratingAvailable,
- "userRating": userRating,
- }
- if nil != rating {
- ret["rating"] = rating
+var getBazaarPackageREADME = contractHandler(apicontract.GetBazaarPackageREADME, func(c *gin.Context, request apicontract.GetBazaarPackageREADMERequest) apicontract.Response[apicontract.BazaarREADMEData] {
+ if !validPackageTypes[request.PackageType] {
+ return apicontract.Failure[apicontract.BazaarREADMEData](-1, "Invalid package type")
}
- return ret
-}
-
-func getBazaarPackageREADME(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarREADMEData{HTML: model.GetBazaarPackageREADME(c.Request.Context(), request.RepoURL, request.RepoHash, request.PackageType)}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var repoURL, repoHash, pkgType string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("packageType", &pkgType, true, true),
- ) {
- return
- }
- if !validPackageTypes[pkgType] {
- ret.Code = -1
- ret.Msg = "Invalid package type"
- return
- }
- ret.Data = map[string]any{
- "html": model.GetBazaarPackageREADME(c.Request.Context(), repoURL, repoHash, pkgType),
- }
-}
+var getBazaarPlugin = contractHandler(apicontract.GetBazaarPlugin, func(c *gin.Context, request apicontract.GetBazaarPluginRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("plugins", request.Frontend, request.Keyword))}
-func getBazaarPlugin(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ return apicontract.Success(data)
+})
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+var getInstalledPlugin = contractHandler(apicontract.GetInstalledPlugin, func(c *gin.Context, request apicontract.GetInstalledPluginRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetInstalledPackages("plugins", request.Frontend, request.Keyword))}
- var frontend, keyword string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, true, true),
- util.BindJsonArg("keyword", &keyword, false, false),
- ) {
- return
- }
+ return apicontract.Success(data)
+})
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("plugins", frontend, keyword),
+var installBazaarPlugin = contractHandler(apicontract.InstallBazaarPlugin, func(c *gin.Context, request apicontract.InstallBazaarPluginRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.InstallBazaarPackage("plugins", request.RepoURL, request.RepoHash, request.RepoRef, request.PackageName, nil)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarPackagesData](1, err.Error())
}
-}
-func getInstalledPlugin(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ util.PushMsg(model.Conf.Language(69), 3000)
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("plugins", request.Frontend, request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var frontend, keyword string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, true, true),
- util.BindJsonArg("keyword", &keyword, false, false),
- ) {
- return
+var uninstallBazaarPlugin = contractHandler(apicontract.UninstallBazaarPlugin, func(c *gin.Context, request apicontract.UninstallBazaarPluginRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.UninstallPackage("plugins", request.PackageName)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarPackagesData](-1, err.Error())
}
- ret.Data = map[string]any{
- "packages": model.GetInstalledPackages("plugins", frontend, keyword),
+ packages := []*apicontract.BazaarPackage{}
+ if request.Frontend != "" {
+ packages = bazaarPackages(model.GetBazaarPackages("plugins", request.Frontend, request.Keyword))
}
-}
-func installBazaarPlugin(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarPackagesData{Packages: packages}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var frontend, keyword, repoURL, repoHash, repoRef, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, true, true),
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("repoRef", &repoRef, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.InstallBazaarPackage("plugins", repoURL, repoHash, repoRef, packageName, nil)
- if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
- }
+var getBazaarWidget = contractHandler(apicontract.GetBazaarWidget, func(c *gin.Context, request apicontract.GetBazaarWidgetRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("widgets", "", request.Keyword))}
- util.PushMsg(model.Conf.Language(69), 3000)
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("plugins", frontend, keyword),
- }
-}
+ return apicontract.Success(data)
+})
-func uninstallBazaarPlugin(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getInstalledWidget = contractHandler(apicontract.GetInstalledWidget, func(c *gin.Context, request apicontract.GetInstalledWidgetRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetInstalledPackages("widgets", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var frontend, keyword, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, false, false),
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.UninstallPackage("plugins", packageName)
+var installBazaarWidget = contractHandler(apicontract.InstallBazaarWidget, func(c *gin.Context, request apicontract.InstallBazaarWidgetRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.InstallBazaarPackage("widgets", request.RepoURL, request.RepoHash, request.RepoRef, request.PackageName, nil)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- return
- }
-
- // 兼容旧行为:如果不指定 frontend,则卸载插件但不返回插件列表
- var packages any
- if "" == frontend {
- packages = []any{}
- } else {
- packages = model.GetBazaarPackages("plugins", frontend, keyword)
- }
-
- ret.Data = map[string]any{
- "packages": packages,
+ return apicontract.Failure[apicontract.BazaarPackagesData](1, err.Error())
}
-}
-func getBazaarWidget(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ util.PushMsg(model.Conf.Language(69), 3000)
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("widgets", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
- }
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("widgets", "", keyword),
+var uninstallBazaarWidget = contractHandler(apicontract.UninstallBazaarWidget, func(c *gin.Context, request apicontract.UninstallBazaarWidgetRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.UninstallPackage("widgets", request.PackageName)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarPackagesData](-1, err.Error())
}
-}
-func getInstalledWidget(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("widgets", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
- }
+var getBazaarIcon = contractHandler(apicontract.GetBazaarIcon, func(c *gin.Context, request apicontract.GetBazaarIconRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("icons", "", request.Keyword))}
- ret.Data = map[string]any{
- "packages": model.GetInstalledPackages("widgets", "", keyword),
- }
-}
+ return apicontract.Success(data)
+})
-func installBazaarWidget(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getInstalledIcon = contractHandler(apicontract.GetInstalledIcon, func(c *gin.Context, request apicontract.GetInstalledIconRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetInstalledPackages("icons", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword, repoURL, repoHash, repoRef, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("repoRef", &repoRef, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.InstallBazaarPackage("widgets", repoURL, repoHash, repoRef, packageName, nil)
+var installBazaarIcon = contractHandler(apicontract.InstallBazaarIcon, func(c *gin.Context, request apicontract.InstallBazaarIconRequest) apicontract.Response[apicontract.BazaarAppearancePackagesData] {
+ err := model.InstallBazaarPackage("icons", request.RepoURL, request.RepoHash, request.RepoRef, request.PackageName, nil)
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarAppearancePackagesData](1, err.Error())
}
-
util.PushMsg(model.Conf.Language(69), 3000)
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("widgets", "", keyword),
- }
-}
-func uninstallBazaarWidget(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarAppearancePackagesData{Packages: bazaarPackages(model.GetBazaarPackages("icons", "", request.Keyword)), Appearance: bazaarAppearance(model.Conf.Appearance)}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.UninstallPackage("widgets", packageName)
+var uninstallBazaarIcon = contractHandler(apicontract.UninstallBazaarIcon, func(c *gin.Context, request apicontract.UninstallBazaarIconRequest) apicontract.Response[apicontract.BazaarAppearancePackagesData] {
+ err := model.UninstallPackage("icons", request.PackageName)
if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- return
+ return apicontract.Failure[apicontract.BazaarAppearancePackagesData](-1, err.Error())
}
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("widgets", "", keyword),
- }
-}
-
-func getBazaarIcon(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarAppearancePackagesData{Packages: bazaarPackages(model.GetBazaarPackages("icons", "", request.Keyword)), Appearance: bazaarAppearance(model.Conf.Appearance)}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
- }
+var getBazaarTemplate = contractHandler(apicontract.GetBazaarTemplate, func(c *gin.Context, request apicontract.GetBazaarTemplateRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("templates", "", request.Keyword))}
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("icons", "", keyword),
- }
-}
+ return apicontract.Success(data)
+})
-func getInstalledIcon(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getInstalledTemplate = contractHandler(apicontract.GetInstalledTemplate, func(c *gin.Context, request apicontract.GetInstalledTemplateRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetInstalledPackages("templates", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
+var installBazaarTemplate = contractHandler(apicontract.InstallBazaarTemplate, func(c *gin.Context, request apicontract.InstallBazaarTemplateRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.InstallBazaarPackage("templates", request.RepoURL, request.RepoHash, request.RepoRef, request.PackageName, nil)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarPackagesData](1, err.Error())
}
- ret.Data = map[string]any{
- "packages": model.GetInstalledPackages("icons", "", keyword),
- }
-}
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("templates", "", request.Keyword))}
-func installBazaarIcon(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ util.PushMsg(model.Conf.Language(69), 3000)
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword, repoURL, repoHash, repoRef, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("repoRef", &repoRef, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.InstallBazaarPackage("icons", repoURL, repoHash, repoRef, packageName, nil)
+var uninstallBazaarTemplate = contractHandler(apicontract.UninstallBazaarTemplate, func(c *gin.Context, request apicontract.UninstallBazaarTemplateRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ err := model.UninstallPackage("templates", request.PackageName)
if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
- }
- util.PushMsg(model.Conf.Language(69), 3000)
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("icons", "", keyword),
- "appearance": model.Conf.Appearance,
+ return apicontract.Failure[apicontract.BazaarPackagesData](-1, err.Error())
}
-}
-func uninstallBazaarIcon(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("templates", "", request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
- }
- err := model.UninstallPackage("icons", packageName)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- return
- }
+var getBazaarTheme = contractHandler(apicontract.GetBazaarTheme, func(c *gin.Context, request apicontract.GetBazaarThemeRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetBazaarPackages("themes", request.Frontend, request.Keyword))}
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("icons", "", keyword),
- "appearance": model.Conf.Appearance,
- }
-}
+ return apicontract.Success(data)
+})
-func getBazaarTemplate(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+var getInstalledTheme = contractHandler(apicontract.GetInstalledTheme, func(c *gin.Context, request apicontract.GetInstalledThemeRequest) apicontract.Response[apicontract.BazaarPackagesData] {
+ data := apicontract.BazaarPackagesData{Packages: bazaarPackages(model.GetInstalledPackages("themes", request.Frontend, request.Keyword))}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
+var installBazaarTheme = contractHandler(apicontract.InstallBazaarTheme, func(c *gin.Context, request apicontract.InstallBazaarThemeRequest) apicontract.Response[apicontract.BazaarAppearancePackagesData] {
+ var themeOptions *model.ThemeInstallOptions
+ if request.Mode != nil {
+ themeOptions = &model.ThemeInstallOptions{Mode: int(*request.Mode), ModeOS: *request.ModeOS}
}
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("templates", "", keyword),
+ err := model.InstallBazaarPackage("themes", request.RepoURL, request.RepoHash, request.RepoRef, request.PackageName, themeOptions)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarAppearancePackagesData](1, err.Error())
}
-}
-func getInstalledTemplate(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ util.PushMsg(model.Conf.Language(69), 3000)
+ data := apicontract.BazaarAppearancePackagesData{Packages: bazaarPackages(model.GetBazaarPackages("themes", request.Frontend, request.Keyword)), Appearance: bazaarAppearance(model.Conf.Appearance)}
- var keyword string
- if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
- return
- }
+ return apicontract.Success(data)
+})
- ret.Data = map[string]any{
- "packages": model.GetInstalledPackages("templates", "", keyword),
+var uninstallBazaarTheme = contractHandler(apicontract.UninstallBazaarTheme, func(c *gin.Context, request apicontract.UninstallBazaarThemeRequest) apicontract.Response[apicontract.BazaarAppearancePackagesData] {
+ err := model.UninstallPackage("themes", request.PackageName)
+ if err != nil {
+ return apicontract.Failure[apicontract.BazaarAppearancePackagesData](-1, err.Error())
}
-}
-func installBazaarTemplate(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
+ data := apicontract.BazaarAppearancePackagesData{Packages: bazaarPackages(model.GetBazaarPackages("themes", request.Frontend, request.Keyword)), Appearance: bazaarAppearance(model.Conf.Appearance)}
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
+ return apicontract.Success(data)
+})
- var keyword, repoURL, repoHash, repoRef, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("repoRef", &repoRef, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
+func prepareLocalBazaarUpload(c *gin.Context) *apicontract.Response[apicontract.BazaarLocalInstallResult] {
+ c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, bazaar.MaxLocalPackageArchiveSize+1024*1024)
+ return nil
+}
+func bazaarRatingError(err error) *apicontract.BazaarRatingError {
+ if errors.Is(err, model.ErrBazaarRatingRateLimited) {
+ return &apicontract.BazaarRatingError{ErrorCode: "bazaarRatingRateLimited"}
}
- err := model.InstallBazaarPackage("templates", repoURL, repoHash, repoRef, packageName, nil)
- if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ if errors.Is(err, model.ErrBazaarPackagePending) {
+ return &apicontract.BazaarRatingError{ErrorCode: "bazaarPackagePending"}
}
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("templates", "", keyword),
+ return nil
+}
+func bazaarRating(value *bazaar.PackageRating) *apicontract.BazaarPackageRating {
+ if value == nil {
+ return nil
}
-
- util.PushMsg(model.Conf.Language(69), 3000)
+ return &apicontract.BazaarPackageRating{Average: value.Average, Count: value.Count, Distribution: value.Distribution}
}
-
-func uninstallBazaarTemplate(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+func bazaarRatings(values map[string]*bazaar.PackageRating) map[string]*apicontract.BazaarPackageRating {
+ if values == nil {
+ return nil
}
-
- var keyword, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
+ ret := make(map[string]*apicontract.BazaarPackageRating, len(values))
+ for key, value := range values {
+ ret[key] = bazaarRating(value)
}
- err := model.UninstallPackage("templates", packageName)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- return
+ return ret
+}
+func bazaarPackages(values []*bazaar.Package) []*apicontract.BazaarPackage {
+ if values == nil {
+ return nil
}
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("templates", "", keyword),
+ ret := make([]*apicontract.BazaarPackage, len(values))
+ for i, value := range values {
+ ret[i] = bazaarPackage(value)
}
+ return ret
}
-
-func getBazaarTheme(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var frontend, keyword string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, false, false),
- util.BindJsonArg("keyword", &keyword, false, false),
- ) {
- return
+func bazaarUpdatedPackages(values []*model.UpdatedPackage) []*apicontract.BazaarPackageDetail {
+ if values == nil {
+ return nil
}
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("themes", frontend, keyword),
+ ret := make([]*apicontract.BazaarPackageDetail, len(values))
+ for i, value := range values {
+ if value != nil {
+ ret[i] = &apicontract.BazaarPackageDetail{Installed: bazaarPackage(value.Installed), Available: bazaarPackage(value.Available)}
+ }
}
+ return ret
}
-
-func getInstalledTheme(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
- }
-
- var frontend, keyword string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, false, false),
- util.BindJsonArg("keyword", &keyword, false, false),
- ) {
- return
+func bazaarFunding(value *bazaar.Funding) *apicontract.BazaarFunding {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarFunding{}
+ ret.OpenCollective = value.OpenCollective
+ ret.Patreon = value.Patreon
+ ret.GitHub = value.GitHub
+ ret.Custom = value.Custom
+ if value.Links != nil {
+ ret.Links = make([]apicontract.BazaarFundingLink, len(value.Links))
+ for i, item := range value.Links {
+ ret.Links[i] = *bazaarFundingLink(&item)
+ }
}
-
- ret.Data = map[string]any{
- "packages": model.GetInstalledPackages("themes", frontend, keyword),
+ return ret
+}
+func bazaarFundingLink(value *bazaar.FundingLink) *apicontract.BazaarFundingLink {
+ if value == nil {
+ return nil
}
+ ret := &apicontract.BazaarFundingLink{}
+ ret.Label = value.Label
+ ret.URL = value.URL
+ return ret
}
-
-func installBazaarTheme(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+func bazaarPackage(value *bazaar.Package) *apicontract.BazaarPackage {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarPackage{}
+ ret.Author = value.Author
+ ret.URL = value.URL
+ ret.Version = value.Version
+ ret.MinAppVersion = value.MinAppVersion
+ ret.DisabledInPublish = value.DisabledInPublish
+ ret.Kernels = value.Kernels
+ ret.Backends = value.Backends
+ ret.Frontends = value.Frontends
+ ret.BootAppearances = value.BootAppearances
+ ret.DisplayName = apicontract.BazaarLocaleStrings(value.DisplayName)
+ ret.Description = apicontract.BazaarLocaleStrings(value.Description)
+ ret.Readme = apicontract.BazaarLocaleStrings(value.Readme)
+ ret.Icon = value.Icon
+ ret.Preview = value.Preview
+ ret.Funding = bazaarFunding(value.Funding)
+ ret.Keywords = value.Keywords
+ ret.Deprecated = value.Deprecated
+ ret.DeprecatedReason = apicontract.BazaarLocaleStrings(value.DeprecatedReason)
+ ret.Alternatives = value.Alternatives
+ ret.PreferredFunding = value.PreferredFunding
+ ret.PreferredName = value.PreferredName
+ ret.PreferredDesc = value.PreferredDesc
+ ret.PreferredReadme = value.PreferredReadme
+ ret.PreferredDeprecatedReason = value.PreferredDeprecatedReason
+ ret.Name = value.Name
+ ret.RepoURL = value.RepoURL
+ ret.RepoHash = value.RepoHash
+ ret.RepoRef = value.RepoRef
+ ret.PreviewURL = value.PreviewURL
+ ret.IconURL = value.IconURL
+ ret.Installed = value.Installed
+ ret.HasStorageData = value.HasStorageData
+ ret.Outdated = value.Outdated
+ ret.Current = value.Current
+ ret.Updated = value.Updated
+ ret.Stars = value.Stars
+ ret.OpenIssues = value.OpenIssues
+ ret.Size = value.Size
+ ret.HSize = value.HSize
+ ret.InstallSize = value.InstallSize
+ ret.HInstallSize = value.HInstallSize
+ ret.InstallTime = value.InstallTime
+ ret.UpdateTime = value.UpdateTime
+ ret.HInstallDate = value.HInstallDate
+ ret.HUpdated = value.HUpdated
+ ret.Downloads = value.Downloads
+ ret.DisallowInstall = value.DisallowInstall
+ ret.DisallowUpdate = value.DisallowUpdate
+ ret.UpdateRequiredMinAppVer = value.UpdateRequiredMinAppVer
+ ret.InvalidReason = value.InvalidReason
+ ret.RatingAvailable = value.RatingAvailable
+ ret.Rating = bazaarRating(value.Rating)
+ ret.InstalledIncompatible = value.InstalledIncompatible
+ ret.BazaarIncompatible = value.BazaarIncompatible
+ ret.Enabled = value.Enabled
+ ret.UserDisabledInPublish = value.UserDisabledInPublish
+ ret.Modes = value.Modes
+ return ret
+}
+func bazaarAppearance(value *conf.Appearance) *apicontract.BazaarAppearance {
+ if value == nil {
+ return nil
}
-
- var frontend, keyword, repoURL, repoHash, repoRef, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, false, false),
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("repoURL", &repoURL, true, true),
- util.BindJsonArg("repoHash", &repoHash, true, true),
- util.BindJsonArg("repoRef", &repoRef, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
+ ret := &apicontract.BazaarAppearance{}
+ ret.BodyGradient = bazaarBodyGradient(value.BodyGradient)
+ if value.GlobalFontFamilies != nil {
+ ret.GlobalFontFamilies = make([]*apicontract.BazaarEditorFont, len(value.GlobalFontFamilies))
+ for i, item := range value.GlobalFontFamilies {
+ ret.GlobalFontFamilies[i] = bazaarEditorFont(item)
+ }
}
-
- _, hasMode := arg["mode"]
- _, hasModeOS := arg["modeOS"]
- if hasMode != hasModeOS {
- ret.Code = -1
- ret.Msg = "Fields [mode] and [modeOS] must be provided together"
- return
+ ret.Mode = value.Mode
+ ret.ModeOS = value.ModeOS
+ if value.DarkThemes != nil {
+ ret.DarkThemes = make([]*apicontract.BazaarAppearanceTheme, len(value.DarkThemes))
+ for i, item := range value.DarkThemes {
+ ret.DarkThemes[i] = bazaarAppearanceTheme(item)
+ }
}
-
- var themeOptions *model.ThemeInstallOptions
- if hasMode {
- var mode float64
- var modeOS bool
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("mode", &mode, true, false),
- util.BindJsonArg("modeOS", &modeOS, true, false),
- ) {
- return
+ if value.LightThemes != nil {
+ ret.LightThemes = make([]*apicontract.BazaarAppearanceTheme, len(value.LightThemes))
+ for i, item := range value.LightThemes {
+ ret.LightThemes[i] = bazaarAppearanceTheme(item)
}
- if 0 != mode && 1 != mode {
- ret.Code = -1
- ret.Msg = "Field [mode] must be 0 or 1"
- return
+ }
+ ret.ThemeDark = value.ThemeDark
+ ret.ThemeLight = value.ThemeLight
+ ret.ThemeVer = value.ThemeVer
+ if value.Icons != nil {
+ ret.Icons = make([]*apicontract.BazaarAppearanceIcon, len(value.Icons))
+ for i, item := range value.Icons {
+ ret.Icons[i] = bazaarAppearanceIcon(item)
}
- themeOptions = &model.ThemeInstallOptions{Mode: int(mode), ModeOS: modeOS}
}
-
- err := model.InstallBazaarPackage("themes", repoURL, repoHash, repoRef, packageName, themeOptions)
- if err != nil {
- ret.Code = 1
- ret.Msg = err.Error()
- return
+ ret.Icon = value.Icon
+ ret.IconVer = value.IconVer
+ ret.CodeBlockThemeLight = value.CodeBlockThemeLight
+ ret.CodeBlockThemeDark = value.CodeBlockThemeDark
+ ret.Lang = value.Lang
+ ret.ThemeJS = value.ThemeJS
+ ret.CloseButtonBehavior = value.CloseButtonBehavior
+ ret.HideToolbar = value.HideToolbar
+ ret.HideStatusBar = value.HideStatusBar
+ ret.StatusBar = bazaarStatusBar(value.StatusBar)
+ ret.Notifications = bazaarNotifications(value.Notifications)
+ ret.EntryVisibility = bazaarEntryVisibility(value.EntryVisibility)
+ return ret
+}
+func bazaarBodyGradient(value *conf.BodyGradient) *apicontract.BazaarBodyGradient {
+ if value == nil {
+ return nil
}
-
- util.PushMsg(model.Conf.Language(69), 3000)
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("themes", frontend, keyword),
- "appearance": model.Conf.Appearance,
+ ret := &apicontract.BazaarBodyGradient{}
+ ret.Mode = value.Mode
+ ret.Light = *bazaarBodyGradientColor(&value.Light)
+ ret.Dark = *bazaarBodyGradientColor(&value.Dark)
+ return ret
+}
+func bazaarBodyGradientColor(value *conf.BodyGradientColor) *apicontract.BazaarBodyGradientColor {
+ if value == nil {
+ return nil
}
+ ret := &apicontract.BazaarBodyGradientColor{}
+ ret.Color = value.Color
+ ret.Opacity = value.Opacity
+ return ret
}
-
-func uninstallBazaarTheme(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- arg, ok := util.JsonArg(c, ret)
- if !ok {
- return
+func bazaarAppearanceTheme(value *conf.AppearanceTheme) *apicontract.BazaarAppearanceTheme {
+ if value == nil {
+ return nil
}
-
- var frontend, keyword, packageName string
- if !util.ParseJsonArgs(arg, ret,
- util.BindJsonArg("frontend", &frontend, false, false),
- util.BindJsonArg("keyword", &keyword, false, false),
- util.BindJsonArg("packageName", &packageName, true, true),
- ) {
- return
+ ret := &apicontract.BazaarAppearanceTheme{}
+ ret.Name = value.Name
+ ret.Label = value.Label
+ ret.Frontends = value.Frontends
+ return ret
+}
+func bazaarAppearanceIcon(value *conf.AppearanceIcon) *apicontract.BazaarAppearanceIcon {
+ if value == nil {
+ return nil
}
- err := model.UninstallPackage("themes", packageName)
- if err != nil {
- ret.Code = -1
- ret.Msg = err.Error()
- return
+ ret := &apicontract.BazaarAppearanceIcon{}
+ ret.Name = value.Name
+ ret.Label = value.Label
+ return ret
+}
+func bazaarEntryVisibility(value *conf.EntryVisibility) *apicontract.BazaarEntryVisibility {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarEntryVisibility{}
+ ret.Version = value.Version
+ ret.Active = value.Active
+ if value.Profiles != nil {
+ ret.Profiles = make([]*apicontract.BazaarEntryVisibilityProfile, len(value.Profiles))
+ for i, item := range value.Profiles {
+ ret.Profiles[i] = bazaarEntryVisibilityProfile(item)
+ }
}
-
- ret.Data = map[string]any{
- "packages": model.GetBazaarPackages("themes", frontend, keyword),
- "appearance": model.Conf.Appearance,
+ return ret
+}
+func bazaarEntryVisibilityProfile(value *conf.EntryVisibilityProfile) *apicontract.BazaarEntryVisibilityProfile {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarEntryVisibilityProfile{}
+ ret.ID = value.ID
+ ret.Name = value.Name
+ ret.Entries = value.Entries
+ ret.Orders = value.Orders
+ return ret
+}
+func bazaarEditorFont(value *conf.EditorFont) *apicontract.BazaarEditorFont {
+ if value == nil {
+ return nil
}
+ ret := &apicontract.BazaarEditorFont{}
+ ret.Family = value.Family
+ ret.Weight = value.Weight
+ ret.DisplayName = value.DisplayName
+ return ret
+}
+func bazaarStatusBar(value *util.StatusBar) *apicontract.BazaarStatusBar {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarStatusBar{}
+ ret.Version = value.Version
+ ret.MsgTaskDatabaseIndexCommitDisabled = value.MsgTaskDatabaseIndexCommitDisabled
+ ret.MsgTaskHistoryDatabaseIndexCommitDisabled = value.MsgTaskHistoryDatabaseIndexCommitDisabled
+ ret.MsgTaskAssetDatabaseIndexCommitDisabled = value.MsgTaskAssetDatabaseIndexCommitDisabled
+ ret.MsgTaskHistoryGenerateFileDisabled = value.MsgTaskHistoryGenerateFileDisabled
+ ret.MsgDataSyncDisabled = value.MsgDataSyncDisabled
+ return ret
+}
+func bazaarNotifications(value *util.Notifications) *apicontract.BazaarNotifications {
+ if value == nil {
+ return nil
+ }
+ ret := &apicontract.BazaarNotifications{}
+ ret.DocTreeMaxList = value.DocTreeMaxList
+ ret.TagMaxList = value.TagMaxList
+ ret.WorkspaceNotSSD = value.WorkspaceNotSSD
+ ret.BrowserCompatibility = value.BrowserCompatibility
+ ret.SelectAllTip = value.SelectAllTip
+ ret.FormatPainterTip = value.FormatPainterTip
+ return ret
}
diff --git a/kernel/api/contract_bazaar_reference_test.go b/kernel/api/contract_bazaar_reference_test.go
new file mode 100644
index 0000000000..ccd1e76021
--- /dev/null
+++ b/kernel/api/contract_bazaar_reference_test.go
@@ -0,0 +1,42 @@
+package api
+
+import (
+ "errors"
+ "github.com/88250/gulu"
+ "github.com/siyuan-note/siyuan/kernel/bazaar"
+ "github.com/siyuan-note/siyuan/kernel/model"
+)
+
+func bazaarPackageRatingsResponseData(ratings map[string]*bazaar.PackageRating,
+ eligiblePackageNames []string) map[string]any {
+ return map[string]any{
+ "ratings": ratings,
+ "eligiblePackageNames": eligiblePackageNames,
+ }
+}
+func bazaarPackageUserRatingsResponseData(userRatings map[string]int, eligiblePackageNames []string) map[string]any {
+ return map[string]any{
+ "userRatings": userRatings,
+ "eligiblePackageNames": eligiblePackageNames,
+ }
+}
+func bazaarPackageRatingResponseData(rating *bazaar.PackageRating, ratingAvailable bool, userRating int) map[string]any {
+ ret := map[string]any{
+ "ratingAvailable": ratingAvailable,
+ "userRating": userRating,
+ }
+ if nil != rating {
+ ret["rating"] = rating
+ }
+ return ret
+}
+func setBazaarPackageRatingError(ret *gulu.Result, err error) {
+ ret.Code = 1
+ ret.Msg = err.Error()
+ if errors.Is(err, model.ErrBazaarRatingRateLimited) {
+ ret.Data = map[string]any{"errorCode": "bazaarRatingRateLimited"}
+ }
+ if errors.Is(err, model.ErrBazaarPackagePending) {
+ ret.Data = map[string]any{"errorCode": "bazaarPackagePending"}
+ }
+}
diff --git a/kernel/api/contract_bazaar_test.go b/kernel/api/contract_bazaar_test.go
new file mode 100644
index 0000000000..af7af72644
--- /dev/null
+++ b/kernel/api/contract_bazaar_test.go
@@ -0,0 +1,1827 @@
+package api
+
+import (
+ "bytes"
+ "encoding/json"
+ "fmt"
+ "github.com/88250/gulu"
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/bazaar"
+ "github.com/siyuan-note/siyuan/kernel/conf"
+ "github.com/siyuan-note/siyuan/kernel/util"
+ "mime/multipart"
+ "net/http"
+ "net/http/httptest"
+ "reflect"
+ "testing"
+)
+
+func TestBazaarContractInputCompatibility(t *testing.T) {
+ t.Run("batchUpdatePackage", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("frontend", &frontend, true, true)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/batchUpdatePackage", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.BatchUpdatePackage.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getUpdatedPackage", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("frontend", &frontend, true, true)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getUpdatedPackage", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetUpdatedPackage.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("updateBazaarPackage", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType, packageName, frontend, keyword string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ util.BindJsonArg("frontend", &frontend, true, true),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageName":" valid ","frontend":" valid ","keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageName":" valid ","frontend":" valid ","keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/updateBazaarPackage", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UpdateBazaarPackage.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledPackageSize", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledPackageSize", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledPackageSize.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPackage", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType, packageName, frontend string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ util.BindJsonArg("frontend", &frontend, false, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageName":" valid ","frontend":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageName":" valid ","frontend":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPackage", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPackage.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPackageRatings", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType string
+ var packageNamesArg []any
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageNames", &packageNamesArg, true, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageNames":[]}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageNames":[]}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPackageRatings", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPackageRatings.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPackageUserRatings", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType string
+ var packageNamesArg []any
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageNames", &packageNamesArg, true, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageNames":[]}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageNames":[]}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPackageUserRatings", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPackageUserRatings.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPackageRating", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPackageRating", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPackageRating.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("setBazaarPackageRating", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var pkgType, packageName string
+ var ratingArg float64
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ util.BindJsonArg("rating", &ratingArg, true, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"packageType":"plugins","packageName":" valid ","rating":3}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"packageType":"plugins","packageName":" valid ","rating":3}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/setBazaarPackageRating", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.SetBazaarPackageRating.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPackageREADME", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var repoURL, repoHash, pkgType string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("packageType", &pkgType, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"repoURL":" valid ","repoHash":" valid ","packageType":"plugins"}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"repoURL":" valid ","repoHash":" valid ","packageType":"plugins"}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPackageREADME", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPackageREADME.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarPlugin", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, true, true),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarPlugin", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarPlugin.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledPlugin", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, true, true),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledPlugin", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledPlugin.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("installBazaarPlugin", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword, repoURL, repoHash, repoRef, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, true, true),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("repoRef", &repoRef, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/installBazaarPlugin", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.InstallBazaarPlugin.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("uninstallBazaarPlugin", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, false, false),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/uninstallBazaarPlugin", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UninstallBazaarPlugin.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarWidget", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarWidget", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarWidget.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledWidget", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledWidget", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledWidget.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("installBazaarWidget", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, repoURL, repoHash, repoRef, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("repoRef", &repoRef, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/installBazaarWidget", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.InstallBazaarWidget.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("uninstallBazaarWidget", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/uninstallBazaarWidget", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UninstallBazaarWidget.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarIcon", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarIcon", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarIcon.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledIcon", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledIcon", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledIcon.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("installBazaarIcon", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, repoURL, repoHash, repoRef, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("repoRef", &repoRef, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/installBazaarIcon", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.InstallBazaarIcon.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("uninstallBazaarIcon", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/uninstallBazaarIcon", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UninstallBazaarIcon.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarTemplate", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarTemplate", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarTemplate.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledTemplate", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword string
+ if !util.ParseJsonArgs(arg, ret, util.BindJsonArg("keyword", &keyword, false, false)) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledTemplate", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledTemplate.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("installBazaarTemplate", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, repoURL, repoHash, repoRef, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("repoRef", &repoRef, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/installBazaarTemplate", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.InstallBazaarTemplate.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("uninstallBazaarTemplate", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var keyword, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"keyword":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"keyword":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/uninstallBazaarTemplate", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UninstallBazaarTemplate.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getBazaarTheme", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, false, false),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getBazaarTheme", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetBazaarTheme.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("getInstalledTheme", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, false, false),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/getInstalledTheme", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.GetInstalledTheme.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("installBazaarTheme", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword, repoURL, repoHash, repoRef, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, false, false),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("repoURL", &repoURL, true, true),
+ util.BindJsonArg("repoHash", &repoHash, true, true),
+ util.BindJsonArg("repoRef", &repoRef, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid ","repoURL":" valid ","repoHash":" valid ","repoRef":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/installBazaarTheme", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.InstallBazaarTheme.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+ t.Run("uninstallBazaarTheme", func(t *testing.T) {
+ legacy := func(c *gin.Context) (result *gulu.Result) {
+ ret := gulu.Ret.NewResult()
+ defer func() { result = ret }()
+
+ arg, ok := util.JsonArg(c, ret)
+ if !ok {
+ return
+ }
+
+ var frontend, keyword, packageName string
+ if !util.ParseJsonArgs(arg, ret,
+ util.BindJsonArg("frontend", &frontend, false, false),
+ util.BindJsonArg("keyword", &keyword, false, false),
+ util.BindJsonArg("packageName", &packageName, true, true),
+ ) {
+ return
+ }
+ return
+ }
+ base := map[string]json.RawMessage{}
+ if err := json.Unmarshal([]byte(`{"frontend":" valid ","keyword":" valid ","packageName":" valid "}`), &base); err != nil {
+ t.Fatal(err)
+ }
+ bodies := [][]byte{[]byte(`{"frontend":" valid ","keyword":" valid ","packageName":" valid "}`), []byte(`{}`), []byte(`null`), []byte(``), []byte(`[`), []byte(`[]`), []byte(`1`)}
+ for key := range base {
+ for _, value := range []string{"null", "false", "1", "[]", "{}", `""`, `" "`} {
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ changed[k] = v
+ }
+ changed[key] = json.RawMessage(value)
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ changed := map[string]json.RawMessage{}
+ for k, v := range base {
+ if k != key {
+ changed[k] = v
+ }
+ }
+ data, _ := json.Marshal(changed)
+ bodies = append(bodies, data)
+ }
+ for _, body := range bodies {
+ c, _ := gin.CreateTestContext(httptest.NewRecorder())
+ c.Request = httptest.NewRequest(http.MethodPost, "/api/bazaar/uninstallBazaarTheme", bytes.NewReader(body))
+ expected := legacy(c)
+ _, err := apicontract.UninstallBazaarTheme.Decode(bytes.NewReader(body))
+ message := ""
+ if err != nil {
+ message = err.Error()
+ }
+ if message != expected.Msg {
+ t.Errorf("body %s: got %q, want %q", body, message, expected.Msg)
+ }
+ }
+ })
+}
+
+func TestBazaarContractTransportCompatibility(t *testing.T) {
+ icon := ""
+ enabled := false
+ modes := []string{}
+ pkg := &bazaar.Package{Author: "a", DisplayName: bazaar.LocaleStrings{"en_US": "name"}, Icon: &icon, Enabled: &enabled, Modes: &modes, Funding: &bazaar.Funding{Custom: []string{}, Links: []bazaar.FundingLink{{Label: "label", URL: "url"}}}, Rating: &bazaar.PackageRating{Average: 3.5, Count: 2, Distribution: [5]int64{0, 0, 1, 1, 0}}}
+ appearance := conf.NewAppearance()
+ appearance.DarkThemes = []*conf.AppearanceTheme{nil, {Name: "dark", Frontends: []string{"desktop"}}}
+ appearance.Icons = []*conf.AppearanceIcon{{Name: "icon"}}
+ appearance.BodyGradient = &conf.BodyGradient{Mode: "custom", Light: conf.BodyGradientColor{Color: "#000000", Opacity: 50}}
+ appearance.EntryVisibility.Profiles = []*conf.EntryVisibilityProfile{nil, {ID: "custom", Orders: map[string][]string{"menu": {"item"}}}}
+ appearance.GlobalFontFamilies = []*conf.EditorFont{nil, {Family: "serif", Weight: 500}}
+ cases := [][2]interface{}{{pkg, bazaarPackage(pkg)}, {&bazaar.Package{}, bazaarPackage(&bazaar.Package{})}, {appearance, bazaarAppearance(appearance)}, {(*conf.Appearance)(nil), bazaarAppearance(nil)}, {[]*bazaar.Package{nil, pkg}, bazaarPackages([]*bazaar.Package{nil, pkg})}, {([]*bazaar.Package)(nil), bazaarPackages(nil)}, {[]*bazaar.Package{}, bazaarPackages([]*bazaar.Package{})}}
+ for _, pair := range cases {
+ left, _ := json.Marshal(pair[0])
+ right, _ := json.Marshal(pair[1])
+ if !bytes.Equal(left, right) {
+ t.Fatalf("transport mismatch:\n%s\n%s", left, right)
+ }
+ }
+}
+func TestBazaarContractHTTPFailures(t *testing.T) {
+ document, err := apicontract.BuildBundle()
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, test := range []struct {
+ name, body string
+ handler gin.HandlerFunc
+ code int
+ msg string
+ }{
+ {"getBazaarPackageRatings", `{"packageType":"bad","packageNames":[null]}`, getBazaarPackageRatings, 1, "Invalid package type"},
+ {"getBazaarPackageRatings", `{"packageType":"plugins","packageNames":[null]}`, getBazaarPackageRatings, -1, "Field [packageNames]: each element should be of type [String]"},
+ {"setBazaarPackageRating", `{"packageType":"plugins","packageName":"valid","rating":2.5}`, setBazaarPackageRating, 1, "Rating must be an integer from 0 to 5"},
+ {"installBazaarTheme", `{"repoURL":"url","repoHash":"hash","packageName":"name","mode":null}`, installBazaarTheme, -1, "Fields [mode] and [modeOS] must be provided together"},
+ {"installBazaarTheme", `{"repoURL":"url","repoHash":"hash","packageName":"name","mode":null,"modeOS":false}`, installBazaarTheme, -1, "Field [mode] is required"},
+ {"installBazaarTheme", `{"repoURL":"url","repoHash":"hash","packageName":"name","mode":2,"modeOS":false}`, installBazaarTheme, -1, "Field [mode] must be 0 or 1"},
+ } {
+ t.Run(test.name+test.body, func(t *testing.T) {
+ engine := gin.New()
+ path := "/api/bazaar/" + test.name
+ engine.POST(path, test.handler)
+ recorder := httptest.NewRecorder()
+ engine.ServeHTTP(recorder, httptest.NewRequest(http.MethodPost, path, bytes.NewBufferString(test.body)))
+ var response struct {
+ Code int
+ Msg string
+ Data json.RawMessage
+ }
+ if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil {
+ t.Fatal(err)
+ }
+ if response.Code != test.code || response.Msg != test.msg || string(response.Data) != "null" {
+ t.Fatal(recorder.Body.String())
+ }
+ if err := document.ValidateHTTPResponse(http.MethodPost, path, recorder.Code, recorder.Header().Get("Content-Type"), recorder.Body.Bytes()); err != nil {
+ t.Fatal(err)
+ }
+ })
+ }
+}
+func TestBazaarContractLocalUploadMissingFile(t *testing.T) {
+ for _, multipartBody := range []bool{false, true} {
+ t.Run(fmt.Sprint(multipartBody), func(t *testing.T) {
+ var body bytes.Buffer
+ contentType := "application/json"
+ if multipartBody {
+ writer := multipart.NewWriter(&body)
+ writer.WriteField("frontend", "desktop")
+ writer.Close()
+ contentType = writer.FormDataContentType()
+ }
+ engine := gin.New()
+ engine.POST("/upload", installLocalBazaarPackage)
+ recorder := httptest.NewRecorder()
+ request := httptest.NewRequest(http.MethodPost, "/upload", &body)
+ request.Header.Set("Content-Type", contentType)
+ engine.ServeHTTP(recorder, request)
+ var result struct {
+ Code int
+ Msg string
+ }
+ json.Unmarshal(recorder.Body.Bytes(), &result)
+ if !reflect.DeepEqual(result, struct {
+ Code int
+ Msg string
+ }{1, "Marketplace package file is required"}) {
+ t.Fatal(recorder.Body.String())
+ }
+ })
+ }
+}
diff --git a/kernel/apicontract/bazaar.go b/kernel/apicontract/bazaar.go
new file mode 100644
index 0000000000..551ab8da28
--- /dev/null
+++ b/kernel/apicontract/bazaar.go
@@ -0,0 +1,958 @@
+package apicontract
+
+import (
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "mime/multipart"
+ "reflect"
+ "strings"
+)
+
+type InstallLocalBazaarPackageRequest struct {
+ File *multipart.FileHeader `json:"file" api:"optional"`
+ Frontend string `json:"frontend" api:"optional"`
+ Overwrite string `json:"overwrite" api:"optional"`
+}
+type BatchUpdatePackageRequest struct {
+ Frontend string `json:"frontend" api:"trim"`
+}
+type GetUpdatedPackageRequest struct {
+ Frontend string `json:"frontend" api:"trim"`
+}
+type UpdateBazaarPackageRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageName string `json:"packageName" api:"trim"`
+ Frontend string `json:"frontend" api:"trim"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledPackageSizeRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type GetBazaarPackageRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageName string `json:"packageName" api:"trim"`
+ Frontend string `json:"frontend" api:"optional,nullable,trim"`
+}
+type GetBazaarPackageRatingsRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageNames []string `json:"packageNames"`
+ NamesError error `json:"-"`
+}
+type GetBazaarPackageUserRatingsRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageNames []string `json:"packageNames"`
+ NamesError error `json:"-"`
+}
+type GetBazaarPackageRatingRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type SetBazaarPackageRatingRequest struct {
+ PackageType string `json:"packageType" api:"trim"`
+ PackageName string `json:"packageName" api:"trim"`
+ Rating float64 `json:"rating"`
+}
+type GetBazaarPackageREADMERequest struct {
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ PackageType string `json:"packageType" api:"trim"`
+}
+type GetBazaarPluginRequest struct {
+ Frontend string `json:"frontend" api:"trim"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledPluginRequest struct {
+ Frontend string `json:"frontend" api:"trim"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type InstallBazaarPluginRequest struct {
+ Frontend string `json:"frontend" api:"trim"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ RepoRef string `json:"repoRef" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type UninstallBazaarPluginRequest struct {
+ Frontend string `json:"frontend" api:"optional,nullable"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type GetBazaarWidgetRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledWidgetRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type InstallBazaarWidgetRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ RepoRef string `json:"repoRef" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type UninstallBazaarWidgetRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type GetBazaarIconRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledIconRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type InstallBazaarIconRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ RepoRef string `json:"repoRef" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type UninstallBazaarIconRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type GetBazaarTemplateRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledTemplateRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type InstallBazaarTemplateRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ RepoRef string `json:"repoRef" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type UninstallBazaarTemplateRequest struct {
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+type GetBazaarThemeRequest struct {
+ Frontend string `json:"frontend" api:"optional,nullable"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type GetInstalledThemeRequest struct {
+ Frontend string `json:"frontend" api:"optional,nullable"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+}
+type InstallBazaarThemeRequest struct {
+ Frontend string `json:"frontend" api:"optional,nullable"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ RepoURL string `json:"repoURL" api:"trim"`
+ RepoHash string `json:"repoHash" api:"trim"`
+ RepoRef string `json:"repoRef" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+ Mode *float64 `json:"mode" api:"optional,nonnullable"`
+ ModeOS *bool `json:"modeOS" api:"optional,nonnullable"`
+}
+type UninstallBazaarThemeRequest struct {
+ Frontend string `json:"frontend" api:"optional,nullable"`
+ Keyword string `json:"keyword" api:"optional,nullable"`
+ PackageName string `json:"packageName" api:"trim"`
+}
+
+type BazaarPackagesData struct {
+ Packages []*BazaarPackage `json:"packages"`
+}
+type BazaarAppearancePackagesData struct {
+ Packages []*BazaarPackage `json:"packages"`
+ Appearance *BazaarAppearance `json:"appearance"`
+}
+type BazaarUpdatedData struct {
+ Plugins []*BazaarPackageDetail `json:"plugins"`
+ Widgets []*BazaarPackageDetail `json:"widgets"`
+ Icons []*BazaarPackageDetail `json:"icons"`
+ Themes []*BazaarPackageDetail `json:"themes"`
+ Templates []*BazaarPackageDetail `json:"templates"`
+}
+type BazaarPackageDetail struct {
+ Installed *BazaarPackage `json:"installed"`
+ Available *BazaarPackage `json:"available"`
+}
+type BazaarPackageSizeData struct {
+ InstallSize int64 `json:"installSize"`
+ HInstallSize string `json:"hInstallSize"`
+}
+type BazaarREADMEData struct {
+ HTML string `json:"html"`
+}
+type BazaarRatingsData struct {
+ Ratings map[string]*BazaarPackageRating `json:"ratings"`
+ EligiblePackageNames []string `json:"eligiblePackageNames"`
+}
+type BazaarUserRatingsData struct {
+ UserRatings map[string]int `json:"userRatings"`
+ EligiblePackageNames []string `json:"eligiblePackageNames"`
+}
+type BazaarRatingData struct {
+ Rating *BazaarPackageRating `json:"rating,omitempty"`
+ RatingAvailable bool `json:"ratingAvailable"`
+ UserRating int `json:"userRating"`
+}
+type BazaarRatingError struct {
+ ErrorCode string `json:"errorCode" api:"enum=bazaarRatingRateLimited|bazaarPackagePending"`
+}
+type BazaarLocalInstallData struct {
+ PackageType string `json:"packageType"`
+ PackageName string `json:"packageName"`
+ MinAppVersion string `json:"minAppVersion,omitempty"`
+ Updated bool `json:"updated"`
+}
+type BazaarLocalInstallError struct {
+ Reason string `json:"reason" api:"enum=install-failed|package-exists|package-incompatible"`
+ PackageType string `json:"packageType"`
+ PackageName string `json:"packageName"`
+ MinAppVersion string `json:"minAppVersion"`
+}
+type BazaarLocaleStrings map[string]string
+type BazaarFunding struct {
+ OpenCollective string `json:"openCollective"`
+ Patreon string `json:"patreon"`
+ GitHub string `json:"github"`
+ Custom []string `json:"custom"`
+ Links []BazaarFundingLink `json:"links,omitempty"`
+}
+type BazaarFundingLink struct {
+ Label string `json:"label"`
+ URL string `json:"url"`
+}
+type BazaarPackageRating struct {
+ Average float64 `json:"average"`
+ Count int64 `json:"count"`
+ Distribution [5]int64 `json:"distribution"`
+}
+type BazaarPackage struct {
+ Author string `json:"author"`
+ URL string `json:"url"`
+ Version string `json:"version"`
+ MinAppVersion string `json:"minAppVersion"`
+ DisabledInPublish bool `json:"disabledInPublish"`
+ Kernels []string `json:"kernels"`
+ Backends []string `json:"backends"`
+ Frontends []string `json:"frontends"`
+ BootAppearances []string `json:"bootAppearances,omitempty"`
+ DisplayName BazaarLocaleStrings `json:"displayName"`
+ Description BazaarLocaleStrings `json:"description"`
+ Readme BazaarLocaleStrings `json:"readme"`
+ Icon *string `json:"icon,omitempty"`
+ Preview *string `json:"preview,omitempty"`
+ Funding *BazaarFunding `json:"funding"`
+ Keywords []string `json:"keywords"`
+ Deprecated bool `json:"deprecated,omitempty"`
+ DeprecatedReason BazaarLocaleStrings `json:"deprecatedReason,omitempty"`
+ Alternatives []string `json:"alternatives,omitempty"`
+
+ PreferredFunding string `json:"preferredFunding"`
+ PreferredName string `json:"preferredName"`
+ PreferredDesc string `json:"preferredDesc"`
+ PreferredReadme string `json:"preferredReadme"`
+ PreferredDeprecatedReason string `json:"preferredDeprecatedReason,omitempty"`
+
+ Name string `json:"name"` // 包名,不一定是仓库名
+ RepoURL string `json:"repoURL"` // 形式为 https://github.com/owner/repo
+ RepoHash string `json:"repoHash"`
+ RepoRef string `json:"repoRef,omitempty"`
+ PreviewURL string `json:"previewURL"`
+ IconURL string `json:"iconURL"`
+
+ Installed bool `json:"installed"`
+ HasStorageData bool `json:"hasStorageData,omitempty"`
+ Outdated bool `json:"outdated"`
+ Current bool `json:"current"`
+ Updated string `json:"updated"`
+ Stars int `json:"stars"`
+ OpenIssues int `json:"openIssues"`
+ Size int64 `json:"size"`
+ HSize string `json:"hSize"`
+ InstallSize int64 `json:"installSize"`
+ HInstallSize string `json:"hInstallSize"`
+ InstallTime int64 `json:"installTime"`
+ UpdateTime int64 `json:"updateTime"`
+ HInstallDate string `json:"hInstallDate"`
+ HUpdated string `json:"hUpdated"`
+ Downloads int `json:"downloads"`
+ DisallowInstall bool `json:"disallowInstall"`
+ DisallowUpdate bool `json:"disallowUpdate"`
+ UpdateRequiredMinAppVer string `json:"updateRequiredMinAppVer,omitempty"` // 升级目标要求的最小应用版本
+ InvalidReason string `json:"invalidReason,omitempty" api:"enum=missing-manifest|invalid-manifest|name-mismatch"` // 本地安装包异常原因
+
+ RatingAvailable bool `json:"ratingAvailable"` // 在线集市公开评分是否可用
+ Rating *BazaarPackageRating `json:"rating,omitempty"` // 在线集市公开评分
+
+ // 专用字段,nil 时不序列化
+ InstalledIncompatible *bool `json:"installedIncompatible,omitempty"` // 插件/主题:本地已安装版本是否不兼容
+ BazaarIncompatible *bool `json:"bazaarIncompatible,omitempty"` // 插件/主题:在线集市版本是否不兼容
+ Enabled *bool `json:"enabled,omitempty"` // 插件:是否启用
+ UserDisabledInPublish *bool `json:"userDisabledInPublish,omitempty"` // 插件:是否由用户在发布服务中禁用
+ Modes *[]string `json:"modes,omitempty"` // 主题:支持的模式列表
+}
+type BazaarAppearance struct {
+ BodyGradient *BazaarBodyGradient `json:"bodyGradient"` // 背景渐变,空值表示自动配色
+ GlobalFontFamilies []*BazaarEditorFont `json:"globalFontFamilies"` // 按优先级排列的全局默认字体
+ Mode int `json:"mode"` // 模式:0:明亮,1:暗黑
+ ModeOS bool `json:"modeOS"` // 模式是否跟随系统
+ DarkThemes []*BazaarAppearanceTheme `json:"darkThemes"` // 暗黑模式外观主题列表
+ LightThemes []*BazaarAppearanceTheme `json:"lightThemes"` // 明亮模式外观主题列表
+ ThemeDark string `json:"themeDark"` // 选择的暗黑模式外观主题
+ ThemeLight string `json:"themeLight"` // 选择的明亮模式外观主题
+ ThemeVer string `json:"themeVer"` // 选择的主题版本
+ Icons []*BazaarAppearanceIcon `json:"icons"` // 图标列表
+ Icon string `json:"icon"` // 选择的图标
+ IconVer string `json:"iconVer"` // 选择的图标版本
+ CodeBlockThemeLight string `json:"codeBlockThemeLight"` // 明亮模式下代码块主题
+ CodeBlockThemeDark string `json:"codeBlockThemeDark"` // 暗黑模式下代码块主题
+ Lang string `json:"lang"` // 选择的界面语言,同 AppConf.Lang
+ ThemeJS bool `json:"themeJS"` // 是否启用了主题 JavaScript
+ CloseButtonBehavior int `json:"closeButtonBehavior"` // 关闭按钮行为,0:退出,1:最小化到托盘
+ HideToolbar bool `json:"hideToolbar"` // 是否隐藏顶栏工具栏
+ HideStatusBar bool `json:"hideStatusBar"` // 是否隐藏底部状态栏
+ StatusBar *BazaarStatusBar `json:"statusBar"` // 底部状态栏配置
+ Notifications *BazaarNotifications `json:"notifications"` // 外观通知开关配置
+ EntryVisibility *BazaarEntryVisibility `json:"entryVisibility"` // 桌面端入口可见性配置
+}
+type BazaarBodyGradient struct {
+ Mode string `json:"mode"` // auto:自动,custom:自定义,off:关闭
+ Light BazaarBodyGradientColor `json:"light"`
+ Dark BazaarBodyGradientColor `json:"dark"`
+}
+type BazaarBodyGradientColor struct {
+ Color string `json:"color"` // 十六进制 RGB 颜色
+ Opacity float64 `json:"opacity"` // 渐变起点的不透明度,范围为 0 至 100
+}
+type BazaarAppearanceTheme struct {
+ Name string `json:"name"` // 主题名称
+ Label string `json:"label"` // 显示名称
+ Frontends []string `json:"frontends,omitempty"` // 支持的前端
+}
+type BazaarAppearanceIcon struct {
+ Name string `json:"name"` // 图标名称
+ Label string `json:"label"` // 显示名称
+}
+type BazaarEntryVisibility struct {
+ Version int `json:"version"`
+ Active string `json:"active"`
+ Profiles []*BazaarEntryVisibilityProfile `json:"profiles"`
+}
+type BazaarEntryVisibilityProfile struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Entries map[string]bool `json:"entries"`
+ Orders map[string][]string `json:"orders"`
+}
+type BazaarEditorFont struct {
+ Family string `json:"family"`
+ Weight int `json:"weight"`
+ DisplayName string `json:"displayName"`
+}
+type BazaarStatusBar struct {
+ Version int `json:"version"`
+ MsgTaskDatabaseIndexCommitDisabled bool `json:"msgTaskDatabaseIndexCommitDisabled"`
+ MsgTaskHistoryDatabaseIndexCommitDisabled bool `json:"msgTaskHistoryDatabaseIndexCommitDisabled"`
+ MsgTaskAssetDatabaseIndexCommitDisabled bool `json:"msgTaskAssetDatabaseIndexCommitDisabled"`
+ MsgTaskHistoryGenerateFileDisabled bool `json:"msgTaskHistoryGenerateFileDisabled"`
+ MsgDataSyncDisabled bool `json:"msgDataSyncDisabled"`
+}
+type BazaarNotifications struct {
+ DocTreeMaxList bool `json:"docTreeMaxList"` // 文档面板展开上限提示,默认启用
+ TagMaxList bool `json:"tagMaxList"` // 标签面板展开上限提示,默认启用
+ WorkspaceNotSSD bool `json:"workspaceNotSSD"` // 工作空间未放置在固态硬盘警告,默认启用
+ BrowserCompatibility bool `json:"browserCompatibility"` // 浏览器兼容性提示,默认启用
+ SelectAllTip *bool `json:"selectAllTip,omitempty"` // 编辑器全选提示,nil 时默认启用
+ FormatPainterTip *bool `json:"formatPainterTip,omitempty"` // 格式刷启用和退出提示,nil 时默认启用
+}
+type BazaarRatingResult struct {
+ success *BazaarRatingData
+ failure *BazaarRatingError
+}
+
+func NewBazaarRatingResult(data BazaarRatingData) BazaarRatingResult {
+ return BazaarRatingResult{success: &data}
+}
+func NewBazaarRatingResultError(data BazaarRatingError) BazaarRatingResult {
+ return BazaarRatingResult{failure: &data}
+}
+func (data BazaarRatingResult) MarshalJSON() ([]byte, error) {
+ if data.success != nil {
+ return json.Marshal(data.success)
+ }
+ if data.failure != nil {
+ return json.Marshal(data.failure)
+ }
+ return nil, errors.New("bazaar response variant is not set")
+}
+
+type BazaarUserRatingsResult struct {
+ success *BazaarUserRatingsData
+ failure *BazaarRatingError
+}
+
+func NewBazaarUserRatingsResult(data BazaarUserRatingsData) BazaarUserRatingsResult {
+ return BazaarUserRatingsResult{success: &data}
+}
+func NewBazaarUserRatingsResultError(data BazaarRatingError) BazaarUserRatingsResult {
+ return BazaarUserRatingsResult{failure: &data}
+}
+func (data BazaarUserRatingsResult) MarshalJSON() ([]byte, error) {
+ if data.success != nil {
+ return json.Marshal(data.success)
+ }
+ if data.failure != nil {
+ return json.Marshal(data.failure)
+ }
+ return nil, errors.New("bazaar response variant is not set")
+}
+
+type BazaarLocalInstallResult struct {
+ success *BazaarLocalInstallData
+ failure *BazaarLocalInstallError
+}
+
+func NewBazaarLocalInstallResult(data BazaarLocalInstallData) BazaarLocalInstallResult {
+ return BazaarLocalInstallResult{success: &data}
+}
+func NewBazaarLocalInstallResultError(data BazaarLocalInstallError) BazaarLocalInstallResult {
+ return BazaarLocalInstallResult{failure: &data}
+}
+func (data BazaarLocalInstallResult) MarshalJSON() ([]byte, error) {
+ if data.success != nil {
+ return json.Marshal(data.success)
+ }
+ if data.failure != nil {
+ return json.Marshal(data.failure)
+ }
+ return nil, errors.New("bazaar response variant is not set")
+}
+
+func bazaarPayloadSchema(b *schemaBuilder, t reflect.Type, input bool) (*Schema, error) {
+ var members []reflect.Type
+ switch t {
+ case reflect.TypeFor[BazaarRatingResult]():
+ members = []reflect.Type{reflect.TypeFor[BazaarRatingData](), reflect.TypeFor[BazaarRatingError]()}
+ case reflect.TypeFor[BazaarUserRatingsResult]():
+ members = []reflect.Type{reflect.TypeFor[BazaarUserRatingsData](), reflect.TypeFor[BazaarRatingError]()}
+ case reflect.TypeFor[BazaarLocalInstallResult]():
+ members = []reflect.Type{reflect.TypeFor[BazaarLocalInstallData](), reflect.TypeFor[BazaarLocalInstallError]()}
+ default:
+ return nil, nil
+ }
+ var variants []*Schema
+ for _, member := range members {
+ s, err := b.schema(member, input)
+ if err != nil {
+ return nil, err
+ }
+ variants = append(variants, s)
+ }
+ b.definitions[t.Name()] = &Schema{AnyOf: variants}
+ return &Schema{Ref: "#/$defs/" + t.Name()}, nil
+}
+
+func bazaarString(fields map[string]json.RawMessage, key string, required, trim bool) (string, error) {
+ value, err := legacyField[string](fields, key, "String", required)
+ if err != nil {
+ return "", err
+ }
+ if trim && len(fields[key]) > 0 && string(fields[key]) != "null" {
+ value = strings.TrimSpace(value)
+ if value == "" {
+ return "", fmt.Errorf("Field [%s] must not be empty", key)
+ }
+ }
+ return value, nil
+}
+func init() {
+ InstallLocalBazaarPackage.decodeFailure = func(err error) Response[BazaarLocalInstallResult] {
+ return Failure[BazaarLocalInstallResult](1, "Marketplace package file is required")
+ }
+ BatchUpdatePackage.decodeRequest = func(reader io.Reader) (request BatchUpdatePackageRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/batchUpdatePackage")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetUpdatedPackage.decodeRequest = func(reader io.Reader) (request GetUpdatedPackageRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getUpdatedPackage")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ UpdateBazaarPackage.decodeRequest = func(reader io.Reader) (request UpdateBazaarPackageRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/updateBazaarPackage")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledPackageSize.decodeRequest = func(reader io.Reader) (request GetInstalledPackageSizeRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledPackageSize")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarPackage.decodeRequest = func(reader io.Reader) (request GetBazaarPackageRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPackage")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarPackageRatings.decodeRequest = func(reader io.Reader) (request GetBazaarPackageRatingsRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPackageRatings")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ items, parseErr := legacyField[[]json.RawMessage](fields, "packageNames", "Array", true)
+ if parseErr != nil {
+ return request, parseErr
+ }
+ request.PackageNames = make([]string, 0, len(items))
+ for _, item := range items {
+ var value string
+ if string(item) == "null" || json.Unmarshal(item, &value) != nil {
+ request.NamesError = errors.New("Field [packageNames]: each element should be of type [String]")
+ break
+ }
+ request.PackageNames = append(request.PackageNames, value)
+ }
+ return request, nil
+ }
+ GetBazaarPackageUserRatings.decodeRequest = func(reader io.Reader) (request GetBazaarPackageUserRatingsRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPackageUserRatings")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ items, parseErr := legacyField[[]json.RawMessage](fields, "packageNames", "Array", true)
+ if parseErr != nil {
+ return request, parseErr
+ }
+ request.PackageNames = make([]string, 0, len(items))
+ for _, item := range items {
+ var value string
+ if string(item) == "null" || json.Unmarshal(item, &value) != nil {
+ request.NamesError = errors.New("Field [packageNames]: each element should be of type [String]")
+ break
+ }
+ request.PackageNames = append(request.PackageNames, value)
+ }
+ return request, nil
+ }
+ GetBazaarPackageRating.decodeRequest = func(reader io.Reader) (request GetBazaarPackageRatingRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPackageRating")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ SetBazaarPackageRating.decodeRequest = func(reader io.Reader) (request SetBazaarPackageRatingRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/setBazaarPackageRating")
+ if err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ if request.Rating, err = legacyField[float64](fields, "rating", "Number", true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarPackageREADME.decodeRequest = func(reader io.Reader) (request GetBazaarPackageREADMERequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPackageREADME")
+ if err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.PackageType, err = bazaarString(fields, "packageType", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarPlugin.decodeRequest = func(reader io.Reader) (request GetBazaarPluginRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarPlugin")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledPlugin.decodeRequest = func(reader io.Reader) (request GetInstalledPluginRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledPlugin")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ InstallBazaarPlugin.decodeRequest = func(reader io.Reader) (request InstallBazaarPluginRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/installBazaarPlugin")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", true, true); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoRef, err = bazaarString(fields, "repoRef", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ UninstallBazaarPlugin.decodeRequest = func(reader io.Reader) (request UninstallBazaarPluginRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/uninstallBazaarPlugin")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, false); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarWidget.decodeRequest = func(reader io.Reader) (request GetBazaarWidgetRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarWidget")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledWidget.decodeRequest = func(reader io.Reader) (request GetInstalledWidgetRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledWidget")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ InstallBazaarWidget.decodeRequest = func(reader io.Reader) (request InstallBazaarWidgetRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/installBazaarWidget")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoRef, err = bazaarString(fields, "repoRef", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ UninstallBazaarWidget.decodeRequest = func(reader io.Reader) (request UninstallBazaarWidgetRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/uninstallBazaarWidget")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarIcon.decodeRequest = func(reader io.Reader) (request GetBazaarIconRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarIcon")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledIcon.decodeRequest = func(reader io.Reader) (request GetInstalledIconRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledIcon")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ InstallBazaarIcon.decodeRequest = func(reader io.Reader) (request InstallBazaarIconRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/installBazaarIcon")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoRef, err = bazaarString(fields, "repoRef", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ UninstallBazaarIcon.decodeRequest = func(reader io.Reader) (request UninstallBazaarIconRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/uninstallBazaarIcon")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarTemplate.decodeRequest = func(reader io.Reader) (request GetBazaarTemplateRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarTemplate")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledTemplate.decodeRequest = func(reader io.Reader) (request GetInstalledTemplateRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledTemplate")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ InstallBazaarTemplate.decodeRequest = func(reader io.Reader) (request InstallBazaarTemplateRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/installBazaarTemplate")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoRef, err = bazaarString(fields, "repoRef", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ UninstallBazaarTemplate.decodeRequest = func(reader io.Reader) (request UninstallBazaarTemplateRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/uninstallBazaarTemplate")
+ if err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetBazaarTheme.decodeRequest = func(reader io.Reader) (request GetBazaarThemeRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getBazaarTheme")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, false); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ GetInstalledTheme.decodeRequest = func(reader io.Reader) (request GetInstalledThemeRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/getInstalledTheme")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, false); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+ InstallBazaarTheme.decodeRequest = func(reader io.Reader) (request InstallBazaarThemeRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/installBazaarTheme")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, false); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.RepoURL, err = bazaarString(fields, "repoURL", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoHash, err = bazaarString(fields, "repoHash", true, true); err != nil {
+ return request, err
+ }
+ if request.RepoRef, err = bazaarString(fields, "repoRef", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ _, hasMode := fields["mode"]
+ _, hasModeOS := fields["modeOS"]
+ if hasMode != hasModeOS {
+ return request, errors.New("Fields [mode] and [modeOS] must be provided together")
+ }
+ if hasMode {
+ mode, parseErr := legacyField[float64](fields, "mode", "Number", true)
+ if parseErr != nil {
+ return request, parseErr
+ }
+ modeOS, parseErr := legacyField[bool](fields, "modeOS", "Boolean", true)
+ if parseErr != nil {
+ return request, parseErr
+ }
+ if mode != 0 && mode != 1 {
+ return request, errors.New("Field [mode] must be 0 or 1")
+ }
+ request.Mode = &mode
+ request.ModeOS = &modeOS
+ }
+ return request, nil
+ }
+ UninstallBazaarTheme.decodeRequest = func(reader io.Reader) (request UninstallBazaarThemeRequest, err error) {
+ fields, err := bazaarRequestFields(reader, "/api/bazaar/uninstallBazaarTheme")
+ if err != nil {
+ return request, err
+ }
+ if request.Frontend, err = bazaarString(fields, "frontend", false, false); err != nil {
+ return request, err
+ }
+ if request.Keyword, err = bazaarString(fields, "keyword", false, false); err != nil {
+ return request, err
+ }
+ if request.PackageName, err = bazaarString(fields, "packageName", true, true); err != nil {
+ return request, err
+ }
+ return request, nil
+ }
+}
+
+func bazaarRequestFields(reader io.Reader, path string) (map[string]json.RawMessage, error) {
+ fields, err := blockRequestFields(reader, path)
+ if err != nil {
+ return nil, errors.New(strings.ReplaceAll(err.Error(), "map[string]json.RawMessage", "map[string]interface {}"))
+ }
+ return fields, nil
+}
diff --git a/kernel/apicontract/bazaar_test.go b/kernel/apicontract/bazaar_test.go
new file mode 100644
index 0000000000..1e37b833ab
--- /dev/null
+++ b/kernel/apicontract/bazaar_test.go
@@ -0,0 +1,42 @@
+package apicontract
+
+import (
+ "encoding/json"
+ "testing"
+)
+
+func TestBazaarResponseVariants(t *testing.T) {
+ bundle, err := BuildBundle()
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, test := range []struct {
+ path string
+ body string
+ }{
+ {"getBazaarPackageRating", `{"code":0,"msg":"","data":{"ratingAvailable":false,"userRating":0}}`},
+ {"getBazaarPackageRating", `{"code":0,"msg":"","data":{"ratingAvailable":true,"userRating":4,"rating":{"average":4,"count":1,"distribution":[0,0,0,1,0]}}}`},
+ {"getBazaarPackageRating", `{"code":1,"msg":"limited","data":{"errorCode":"bazaarRatingRateLimited"}}`},
+ {"getBazaarPackageUserRatings", `{"code":1,"msg":"pending","data":{"errorCode":"bazaarPackagePending"}}`},
+ {"getBazaarPackageUserRatings", `{"code":0,"msg":"","data":{"userRatings":null,"eligiblePackageNames":[]}}`},
+ {"installLocalBazaarPackage", `{"code":0,"msg":"","data":{"packageType":"plugins","packageName":"name","updated":false}}`},
+ {"installLocalBazaarPackage", `{"code":1,"msg":"exists","data":{"reason":"package-exists","packageType":"plugins","packageName":"name","minAppVersion":""}}`},
+ } {
+ if err := bundle.ValidateResponse("POST", "/api/bazaar/"+test.path, []byte(test.body)); err != nil {
+ t.Errorf("%s: %v", test.body, err)
+ }
+ }
+ for _, body := range []string{
+ `{"code":0,"msg":"","data":null}`,
+ `{"code":0,"msg":"","data":{"ratingAvailable":true,"userRating":1,"rating":{"average":1,"count":1,"distribution":[1]}}}`,
+ `{"code":0,"msg":"","data":{"ratingAvailable":true,"userRating":1,"rating":{"average":1,"count":1,"distribution":null}}}`,
+ `{"code":1,"msg":"","data":{"errorCode":"unknown"}}`,
+ } {
+ if err := bundle.ValidateResponse("POST", "/api/bazaar/getBazaarPackageRating", []byte(body)); err == nil {
+ t.Errorf("unexpected accepted response %s", body)
+ }
+ }
+ if _, err := json.Marshal(BazaarRatingResult{}); err == nil {
+ t.Fatal("unset rating response variant accepted")
+ }
+}
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index c67463f36c..349521042f 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -571,3 +571,35 @@ var PluginRPCHTTPByName = define[PluginRPCBatchRequest, PluginRPCResponse]("plug
var PluginRPCWebSocket = define[EmptyRequest, PluginRPCFailure]("pluginJsonRpcWebSocket", "/ws/plugin/rpc", NoBody, WebSocketOptions[PluginRPCBatchRequest, PluginRPCMessage](404), "GET")
var PluginRPCWebSocketByName = define[EmptyRequest, PluginRPCFailure]("pluginJsonRpcWebSocketByName", "/ws/plugin/rpc/:name", NoBody, WebSocketOptions[PluginRPCBatchRequest, PluginRPCMessage](404), "GET")
+
+var InstallLocalBazaarPackage = define[InstallLocalBazaarPackageRequest, BazaarLocalInstallResult]("installLocalBazaarPackage", "/api/bazaar/installLocalBazaarPackage", MultipartBody, ResponseOptions{AdditionalCodes: []int{1}, DataOnError: true}, "POST")
+var BatchUpdatePackage = define[BatchUpdatePackageRequest, Null]("batchUpdatePackage", "/api/bazaar/batchUpdatePackage", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetUpdatedPackage = define[GetUpdatedPackageRequest, BazaarUpdatedData]("getUpdatedPackage", "/api/bazaar/getUpdatedPackage", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UpdateBazaarPackage = define[UpdateBazaarPackageRequest, BazaarPackagesData]("updateBazaarPackage", "/api/bazaar/updateBazaarPackage", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledPackageSize = define[GetInstalledPackageSizeRequest, BazaarPackageSizeData]("getInstalledPackageSize", "/api/bazaar/getInstalledPackageSize", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarPackage = define[GetBazaarPackageRequest, BazaarPackageDetail]("getBazaarPackage", "/api/bazaar/getBazaarPackage", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarPackageRatings = define[GetBazaarPackageRatingsRequest, BazaarRatingsData]("getBazaarPackageRatings", "/api/bazaar/getBazaarPackageRatings", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarPackageUserRatings = define[GetBazaarPackageUserRatingsRequest, BazaarUserRatingsResult]("getBazaarPackageUserRatings", "/api/bazaar/getBazaarPackageUserRatings", JSONBody, ResponseOptions{AdditionalCodes: []int{1}, DataOnError: true}, "POST")
+var GetBazaarPackageRating = define[GetBazaarPackageRatingRequest, BazaarRatingResult]("getBazaarPackageRating", "/api/bazaar/getBazaarPackageRating", JSONBody, ResponseOptions{AdditionalCodes: []int{1}, DataOnError: true}, "POST")
+var SetBazaarPackageRating = define[SetBazaarPackageRatingRequest, BazaarRatingResult]("setBazaarPackageRating", "/api/bazaar/setBazaarPackageRating", JSONBody, ResponseOptions{AdditionalCodes: []int{1}, DataOnError: true}, "POST")
+var GetBazaarPackageREADME = define[GetBazaarPackageREADMERequest, BazaarREADMEData]("getBazaarPackageREADME", "/api/bazaar/getBazaarPackageREADME", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarPlugin = define[GetBazaarPluginRequest, BazaarPackagesData]("getBazaarPlugin", "/api/bazaar/getBazaarPlugin", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledPlugin = define[GetInstalledPluginRequest, BazaarPackagesData]("getInstalledPlugin", "/api/bazaar/getInstalledPlugin", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var InstallBazaarPlugin = define[InstallBazaarPluginRequest, BazaarPackagesData]("installBazaarPlugin", "/api/bazaar/installBazaarPlugin", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UninstallBazaarPlugin = define[UninstallBazaarPluginRequest, BazaarPackagesData]("uninstallBazaarPlugin", "/api/bazaar/uninstallBazaarPlugin", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarWidget = define[GetBazaarWidgetRequest, BazaarPackagesData]("getBazaarWidget", "/api/bazaar/getBazaarWidget", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledWidget = define[GetInstalledWidgetRequest, BazaarPackagesData]("getInstalledWidget", "/api/bazaar/getInstalledWidget", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var InstallBazaarWidget = define[InstallBazaarWidgetRequest, BazaarPackagesData]("installBazaarWidget", "/api/bazaar/installBazaarWidget", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UninstallBazaarWidget = define[UninstallBazaarWidgetRequest, BazaarPackagesData]("uninstallBazaarWidget", "/api/bazaar/uninstallBazaarWidget", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarIcon = define[GetBazaarIconRequest, BazaarPackagesData]("getBazaarIcon", "/api/bazaar/getBazaarIcon", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledIcon = define[GetInstalledIconRequest, BazaarPackagesData]("getInstalledIcon", "/api/bazaar/getInstalledIcon", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var InstallBazaarIcon = define[InstallBazaarIconRequest, BazaarAppearancePackagesData]("installBazaarIcon", "/api/bazaar/installBazaarIcon", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UninstallBazaarIcon = define[UninstallBazaarIconRequest, BazaarAppearancePackagesData]("uninstallBazaarIcon", "/api/bazaar/uninstallBazaarIcon", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarTemplate = define[GetBazaarTemplateRequest, BazaarPackagesData]("getBazaarTemplate", "/api/bazaar/getBazaarTemplate", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledTemplate = define[GetInstalledTemplateRequest, BazaarPackagesData]("getInstalledTemplate", "/api/bazaar/getInstalledTemplate", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var InstallBazaarTemplate = define[InstallBazaarTemplateRequest, BazaarPackagesData]("installBazaarTemplate", "/api/bazaar/installBazaarTemplate", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UninstallBazaarTemplate = define[UninstallBazaarTemplateRequest, BazaarPackagesData]("uninstallBazaarTemplate", "/api/bazaar/uninstallBazaarTemplate", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetBazaarTheme = define[GetBazaarThemeRequest, BazaarPackagesData]("getBazaarTheme", "/api/bazaar/getBazaarTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var GetInstalledTheme = define[GetInstalledThemeRequest, BazaarPackagesData]("getInstalledTheme", "/api/bazaar/getInstalledTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var InstallBazaarTheme = define[InstallBazaarThemeRequest, BazaarAppearancePackagesData]("installBazaarTheme", "/api/bazaar/installBazaarTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
+var UninstallBazaarTheme = define[UninstallBazaarThemeRequest, BazaarAppearancePackagesData]("uninstallBazaarTheme", "/api/bazaar/uninstallBazaarTheme", JSONBody, ResponseOptions{AdditionalCodes: []int{1}}, "POST")
diff --git a/kernel/apicontract/fixed_array_test.go b/kernel/apicontract/fixed_array_test.go
new file mode 100644
index 0000000000..d4f54b492b
--- /dev/null
+++ b/kernel/apicontract/fixed_array_test.go
@@ -0,0 +1,33 @@
+package apicontract
+
+import (
+ "encoding/json"
+ "reflect"
+ "testing"
+)
+
+func TestFixedArrayOutput(t *testing.T) {
+ builder := &schemaBuilder{definitions: map[string]*Schema{}, owners: map[string]reflect.Type{}}
+ schema, err := builder.schema(reflect.TypeFor[[5]int64](), false)
+ if err != nil {
+ t.Fatal(err)
+ }
+ bundle := &Bundle{Definitions: builder.definitions}
+ if actual := bundle.typeScript(schema); actual != "[number, number, number, number, number]" {
+ t.Fatal(actual)
+ }
+ for _, entry := range []struct {
+ body string
+ valid bool
+ }{
+ {`[0,1,2,3,4]`, true}, {`[0,1,2,3]`, false}, {`[0,1,2,3,4,5]`, false}, {`null`, false}, {`[0,1,2,3,"4"]`, false},
+ } {
+ var value any
+ if err := json.Unmarshal([]byte(entry.body), &value); err != nil {
+ t.Fatal(err)
+ }
+ if err := bundle.validate(schema, value, "$"); (err == nil) != entry.valid {
+ t.Fatalf("fixed array mismatch: %+v, %v", entry, err)
+ }
+ }
+}
diff --git a/kernel/apicontract/legacy_routes.json b/kernel/apicontract/legacy_routes.json
index baca6d62cd..74efd33838 100644
--- a/kernel/apicontract/legacy_routes.json
+++ b/kernel/apicontract/legacy_routes.json
@@ -114,37 +114,6 @@
{"method":"POST","path":"/api/av/setDatabaseBlockView","handler":"setDatabaseBlockView"},
{"method":"POST","path":"/api/av/sortAttributeViewKey","handler":"sortAttributeViewKey"},
{"method":"POST","path":"/api/av/sortAttributeViewViewKey","handler":"sortAttributeViewViewKey"},
- {"method":"POST","path":"/api/bazaar/batchUpdatePackage","handler":"batchUpdatePackage"},
- {"method":"POST","path":"/api/bazaar/getBazaarIcon","handler":"getBazaarIcon"},
- {"method":"POST","path":"/api/bazaar/getBazaarPackage","handler":"getBazaarPackage"},
- {"method":"POST","path":"/api/bazaar/getBazaarPackageREADME","handler":"getBazaarPackageREADME"},
- {"method":"POST","path":"/api/bazaar/getBazaarPackageRating","handler":"getBazaarPackageRating"},
- {"method":"POST","path":"/api/bazaar/getBazaarPackageRatings","handler":"getBazaarPackageRatings"},
- {"method":"POST","path":"/api/bazaar/getBazaarPackageUserRatings","handler":"getBazaarPackageUserRatings"},
- {"method":"POST","path":"/api/bazaar/getBazaarPlugin","handler":"getBazaarPlugin"},
- {"method":"POST","path":"/api/bazaar/getBazaarTemplate","handler":"getBazaarTemplate"},
- {"method":"POST","path":"/api/bazaar/getBazaarTheme","handler":"getBazaarTheme"},
- {"method":"POST","path":"/api/bazaar/getBazaarWidget","handler":"getBazaarWidget"},
- {"method":"POST","path":"/api/bazaar/getInstalledIcon","handler":"getInstalledIcon"},
- {"method":"POST","path":"/api/bazaar/getInstalledPackageSize","handler":"getInstalledPackageSize"},
- {"method":"POST","path":"/api/bazaar/getInstalledPlugin","handler":"getInstalledPlugin"},
- {"method":"POST","path":"/api/bazaar/getInstalledTemplate","handler":"getInstalledTemplate"},
- {"method":"POST","path":"/api/bazaar/getInstalledTheme","handler":"getInstalledTheme"},
- {"method":"POST","path":"/api/bazaar/getInstalledWidget","handler":"getInstalledWidget"},
- {"method":"POST","path":"/api/bazaar/getUpdatedPackage","handler":"getUpdatedPackage"},
- {"method":"POST","path":"/api/bazaar/installBazaarIcon","handler":"installBazaarIcon"},
- {"method":"POST","path":"/api/bazaar/installBazaarPlugin","handler":"installBazaarPlugin"},
- {"method":"POST","path":"/api/bazaar/installBazaarTemplate","handler":"installBazaarTemplate"},
- {"method":"POST","path":"/api/bazaar/installBazaarTheme","handler":"installBazaarTheme"},
- {"method":"POST","path":"/api/bazaar/installBazaarWidget","handler":"installBazaarWidget"},
- {"method":"POST","path":"/api/bazaar/installLocalBazaarPackage","handler":"installLocalBazaarPackage"},
- {"method":"POST","path":"/api/bazaar/setBazaarPackageRating","handler":"setBazaarPackageRating"},
- {"method":"POST","path":"/api/bazaar/uninstallBazaarIcon","handler":"uninstallBazaarIcon"},
- {"method":"POST","path":"/api/bazaar/uninstallBazaarPlugin","handler":"uninstallBazaarPlugin"},
- {"method":"POST","path":"/api/bazaar/uninstallBazaarTemplate","handler":"uninstallBazaarTemplate"},
- {"method":"POST","path":"/api/bazaar/uninstallBazaarTheme","handler":"uninstallBazaarTheme"},
- {"method":"POST","path":"/api/bazaar/uninstallBazaarWidget","handler":"uninstallBazaarWidget"},
- {"method":"POST","path":"/api/bazaar/updateBazaarPackage","handler":"updateBazaarPackage"},
{"method":"POST","path":"/api/export/copyExportFile","handler":"copyExportFile"},
{"method":"POST","path":"/api/export/export2Liandi","handler":"export2Liandi"},
{"method":"POST","path":"/api/export/exportAsFile","handler":"exportAsFile"},
diff --git a/kernel/apicontract/schema.go b/kernel/apicontract/schema.go
index 79448cf380..98359037da 100644
--- a/kernel/apicontract/schema.go
+++ b/kernel/apicontract/schema.go
@@ -22,6 +22,7 @@ type Schema struct {
Required []string `json:"required,omitempty"`
Items *Schema `json:"items,omitempty"`
MinItems int `json:"minItems,omitempty"`
+ MaxItems *int `json:"maxItems,omitempty"`
AdditionalProperties any `json:"additionalProperties,omitempty"`
}
@@ -84,6 +85,9 @@ func nonnullable(schema *Schema) *Schema {
}
func (b *schemaBuilder) schema(t reflect.Type, input bool) (*Schema, error) {
+ if schema, err := bazaarPayloadSchema(b, t, input); schema != nil || err != nil {
+ return schema, err
+ }
if t == reflect.TypeFor[PluginRPCMessage]() {
response, err := b.schema(reflect.TypeFor[PluginRPCResponse](), false)
if err != nil {
@@ -316,6 +320,16 @@ func (b *schemaBuilder) schema(t reflect.Type, input bool) (*Schema, error) {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
return &Schema{Type: "integer"}, nil
+ case reflect.Array:
+ if input {
+ return nil, fmt.Errorf("fixed array request binding requires an explicit decoder: %s", t)
+ }
+ child, err := b.schema(t.Elem(), input)
+ if err != nil {
+ return nil, err
+ }
+ length := t.Len()
+ return &Schema{Type: "array", Items: child, MinItems: length, MaxItems: &length}, nil
case reflect.Slice:
if t.Elem().Kind() == reflect.Uint8 {
return nil, fmt.Errorf("byte encoding requires an explicit schema: %s", t)
@@ -694,6 +708,9 @@ func (b *Bundle) validate(schema *Schema, value any, path string) error {
if len(array) < schema.MinItems {
return fmt.Errorf("%s has too few array items", path)
}
+ if schema.MaxItems != nil && len(array) > *schema.MaxItems {
+ return fmt.Errorf("%s has too many array items", path)
+ }
for i, element := range array {
if err := b.validate(schema.Items, element, fmt.Sprintf("%s[%d]", path, i)); err != nil {
return err
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index d9cf2e9231..9a4d36367a 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -1088,20 +1088,48 @@
],
"additionalProperties": false
},
- "BlockBreadcrumbChildren": {
+ "BatchUpdatePackageRequestInput": {
"type": "object",
"properties": {
- "hasMore": {
- "type": "boolean"
+ "frontend": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "frontend"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarAppearance": {
+ "type": "object",
+ "properties": {
+ "bodyGradient": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarBodyGradient"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "items": {
+ "closeButtonBehavior": {
+ "type": "integer"
+ },
+ "codeBlockThemeDark": {
+ "type": "string"
+ },
+ "codeBlockThemeLight": {
+ "type": "string"
+ },
+ "darkThemes": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/BlockPath"
+ "$ref": "#/$defs/BazaarAppearanceTheme"
},
{
"type": "null"
@@ -1113,23 +1141,30 @@
"type": "null"
}
]
- }
- },
- "required": [
- "hasMore",
- "items"
- ],
- "additionalProperties": false
- },
- "BlockBreadcrumbChildrenRequestInput": {
- "type": "object",
- "properties": {
- "excludeTypes": {
+ },
+ "entryVisibility": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarEntryVisibility"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "globalFontFamilies": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarEditorFont"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -1137,15 +1172,31 @@
}
]
},
- "id": {
+ "hideStatusBar": {
+ "type": "boolean"
+ },
+ "hideToolbar": {
+ "type": "boolean"
+ },
+ "icon": {
"type": "string"
},
- "ids": {
+ "iconVer": {
+ "type": "string"
+ },
+ "icons": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarAppearanceIcon"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -1153,183 +1204,247 @@
}
]
},
- "limit": {
+ "lang": {
+ "type": "string"
+ },
+ "lightThemes": {
"anyOf": [
{
- "type": "number"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarAppearanceTheme"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "notebook": {
+ "mode": {
+ "type": "integer"
+ },
+ "modeOS": {
+ "type": "boolean"
+ },
+ "notifications": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/BazaarNotifications"
},
{
"type": "null"
}
]
},
- "offset": {
+ "statusBar": {
"anyOf": [
{
- "type": "number"
+ "$ref": "#/$defs/BazaarStatusBar"
},
{
"type": "null"
}
]
+ },
+ "themeDark": {
+ "type": "string"
+ },
+ "themeJS": {
+ "type": "boolean"
+ },
+ "themeLight": {
+ "type": "string"
+ },
+ "themeVer": {
+ "type": "string"
}
},
"required": [
- "id"
+ "bodyGradient",
+ "closeButtonBehavior",
+ "codeBlockThemeDark",
+ "codeBlockThemeLight",
+ "darkThemes",
+ "entryVisibility",
+ "globalFontFamilies",
+ "hideStatusBar",
+ "hideToolbar",
+ "icon",
+ "iconVer",
+ "icons",
+ "lang",
+ "lightThemes",
+ "mode",
+ "modeOS",
+ "notifications",
+ "statusBar",
+ "themeDark",
+ "themeJS",
+ "themeLight",
+ "themeVer"
],
"additionalProperties": false
},
- "BlockBreadcrumbRequestInput": {
+ "BazaarAppearanceIcon": {
"type": "object",
"properties": {
- "excludeTypes": {
+ "label": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "label",
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarAppearancePackagesData": {
+ "type": "object",
+ "properties": {
+ "appearance": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/BazaarAppearance"
},
{
"type": "null"
}
]
},
- "id": {
- "type": "string"
- },
- "ids": {
+ "packages": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackage"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
"type": "null"
}
]
- },
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
}
},
"required": [
- "id"
+ "appearance",
+ "packages"
],
"additionalProperties": false
},
- "BlockDOMData": {
+ "BazaarAppearanceTheme": {
"type": "object",
"properties": {
- "dom": {
+ "frontends": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "label": {
"type": "string"
},
- "id": {
+ "name": {
"type": "string"
}
},
"required": [
- "dom",
- "id"
- ],
- "additionalProperties": false
- },
- "BlockDeleteData": {
- "type": "object",
- "properties": {
- "createEmptyParagraph": {
- "type": "boolean"
- }
- },
- "required": [
- "createEmptyParagraph"
+ "label",
+ "name"
],
"additionalProperties": false
},
- "BlockFoldData": {
+ "BazaarBodyGradient": {
"type": "object",
"properties": {
- "isFolded": {
- "type": "boolean"
+ "dark": {
+ "$ref": "#/$defs/BazaarBodyGradientColor"
},
- "isRoot": {
- "type": "boolean"
+ "light": {
+ "$ref": "#/$defs/BazaarBodyGradientColor"
+ },
+ "mode": {
+ "type": "string"
}
},
"required": [
- "isFolded",
- "isRoot"
+ "dark",
+ "light",
+ "mode"
],
"additionalProperties": false
},
- "BlockIDRequestInput": {
+ "BazaarBodyGradientColor": {
"type": "object",
"properties": {
- "id": {
+ "color": {
"type": "string"
+ },
+ "opacity": {
+ "type": "number"
}
},
"required": [
- "id"
+ "color",
+ "opacity"
],
"additionalProperties": false
},
- "BlockIDsRequestInput": {
+ "BazaarEditorFont": {
"type": "object",
"properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "displayName": {
+ "type": "string"
+ },
+ "family": {
+ "type": "string"
+ },
+ "weight": {
+ "type": "integer"
}
},
"required": [
- "ids"
+ "displayName",
+ "family",
+ "weight"
],
"additionalProperties": false
},
- "BlockInfoData": {
- "anyOf": [
- {
- "$ref": "#/$defs/FullBlockInfo"
- },
- {
- "$ref": "#/$defs/PublishedBlockInfo"
- }
- ]
- },
- "BlockInfoRequestInput": {
+ "BazaarEntryVisibility": {
"type": "object",
"properties": {
- "id": {
+ "active": {
"type": "string"
},
- "ids": {
+ "profiles": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarEntryVisibilityProfile"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -1337,156 +1452,232 @@
}
]
},
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "version": {
+ "type": "integer"
}
},
"required": [
- "id"
+ "active",
+ "profiles",
+ "version"
],
"additionalProperties": false
},
- "BlockInsertInputInput": {
+ "BazaarEntryVisibilityProfile": {
"type": "object",
"properties": {
- "data": {
- "type": "string"
- },
- "dataType": {
- "type": "string"
- },
- "nextID": {
+ "entries": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
},
{
"type": "null"
}
]
},
- "parentID": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "orders": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "previousID": {
+ }
+ },
+ "required": [
+ "entries",
+ "id",
+ "name",
+ "orders"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarFunding": {
+ "type": "object",
+ "properties": {
+ "custom": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
+ },
+ "github": {
+ "type": "string"
+ },
+ "links": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/BazaarFundingLink"
+ }
+ },
+ "openCollective": {
+ "type": "string"
+ },
+ "patreon": {
+ "type": "string"
}
},
"required": [
- "data",
- "dataType"
+ "custom",
+ "github",
+ "openCollective",
+ "patreon"
],
"additionalProperties": false
},
- "BlockKramdownData": {
+ "BazaarFundingLink": {
"type": "object",
"properties": {
- "id": {
+ "label": {
"type": "string"
},
- "kramdown": {
+ "url": {
"type": "string"
}
},
"required": [
- "id",
- "kramdown"
+ "label",
+ "url"
],
"additionalProperties": false
},
- "BlockKramdownRequestInput": {
+ "BazaarLocalInstallData": {
"type": "object",
"properties": {
- "id": {
+ "minAppVersion": {
"type": "string"
},
- "ids": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "packageName": {
+ "type": "string"
},
- "mode": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "packageType": {
+ "type": "string"
},
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "updated": {
+ "type": "boolean"
}
},
"required": [
- "id"
+ "packageName",
+ "packageType",
+ "updated"
],
"additionalProperties": false
},
- "BlockOperation": {
+ "BazaarLocalInstallError": {
"type": "object",
"properties": {
- "action": {
+ "minAppVersion": {
+ "type": "string"
+ },
+ "packageName": {
+ "type": "string"
+ },
+ "packageType": {
+ "type": "string"
+ },
+ "reason": {
"type": "string",
"enum": [
- "delete",
- "insert",
- "update",
- "foldHeading",
- "unfoldHeading",
- "setAttrs",
- "moveOutlineHeading",
- "appendInsert",
- "prependInsert"
+ "install-failed",
+ "package-exists",
+ "package-incompatible"
]
+ }
+ },
+ "required": [
+ "minAppVersion",
+ "packageName",
+ "packageType",
+ "reason"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarLocalInstallResult": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarLocalInstallData"
},
- "avID": {
- "type": "string"
+ {
+ "$ref": "#/$defs/BazaarLocalInstallError"
+ }
+ ]
+ },
+ "BazaarNotifications": {
+ "type": "object",
+ "properties": {
+ "browserCompatibility": {
+ "type": "boolean"
},
- "backRelationKeyID": {
- "type": "string"
+ "docTreeMaxList": {
+ "type": "boolean"
},
- "blockID": {
+ "formatPainterTip": {
+ "type": "boolean"
+ },
+ "selectAllTip": {
+ "type": "boolean"
+ },
+ "tagMaxList": {
+ "type": "boolean"
+ },
+ "workspaceNotSSD": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "browserCompatibility",
+ "docTreeMaxList",
+ "tagMaxList",
+ "workspaceNotSSD"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarPackage": {
+ "type": "object",
+ "properties": {
+ "alternatives": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "author": {
"type": "string"
},
- "blockIDs": {
+ "backends": {
"anyOf": [
{
"type": "array",
@@ -1499,7 +1690,28 @@
}
]
},
- "context": {
+ "bazaarIncompatible": {
+ "type": "boolean"
+ },
+ "bootAppearances": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "current": {
+ "type": "boolean"
+ },
+ "deprecated": {
+ "type": "boolean"
+ },
+ "deprecatedReason": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "description": {
"anyOf": [
{
"type": "object",
@@ -1512,84 +1724,128 @@
}
]
},
- "data": {
+ "disabledInPublish": {
+ "type": "boolean"
+ },
+ "disallowInstall": {
+ "type": "boolean"
+ },
+ "disallowUpdate": {
+ "type": "boolean"
+ },
+ "displayName": {
"anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
{
"type": "null"
+ }
+ ]
+ },
+ "downloads": {
+ "type": "integer"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "frontends": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
- "type": "string"
+ "type": "null"
+ }
+ ]
+ },
+ "funding": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarFunding"
},
{
- "$ref": "#/$defs/BlockDeleteData"
+ "type": "null"
}
]
},
- "deckID": {
+ "hInstallDate": {
"type": "string"
},
- "format": {
+ "hInstallSize": {
"type": "string"
},
- "groupID": {
+ "hSize": {
"type": "string"
},
- "id": {
+ "hUpdated": {
"type": "string"
},
- "ignoreDefaultFill": {
- "type": "boolean"
- },
- "isDetached": {
+ "hasStorageData": {
"type": "boolean"
},
- "isTwoWay": {
- "type": "boolean"
- },
- "keyID": {
- "type": "string"
- },
- "layout": {
+ "icon": {
"type": "string"
},
- "name": {
+ "iconURL": {
"type": "string"
},
- "nextID": {
- "type": "string"
+ "installSize": {
+ "type": "integer"
},
- "parentID": {
- "type": "string"
+ "installTime": {
+ "type": "integer"
},
- "previousID": {
- "type": "string"
+ "installed": {
+ "type": "boolean"
},
- "removeDest": {
+ "installedIncompatible": {
"type": "boolean"
},
- "retData": {
+ "invalidReason": {
+ "type": "string",
+ "enum": [
+ "missing-manifest",
+ "invalid-manifest",
+ "name-mismatch"
+ ]
+ },
+ "kernels": {
"anyOf": [
{
- "type": "null"
- },
- {
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "keywords": {
+ "anyOf": [
{
"type": "array",
"items": {
"type": "string"
}
+ },
+ {
+ "type": "null"
}
]
},
- "rootID": {
- "type": "string"
- },
- "rowID": {
+ "minAppVersion": {
"type": "string"
},
- "srcIDs": {
+ "modes": {
"anyOf": [
{
"type": "array",
@@ -1602,77 +1858,48 @@
}
]
},
- "srcs": {
- "type": "null"
+ "name": {
+ "type": "string"
},
- "targetGroupID": {
+ "openIssues": {
+ "type": "integer"
+ },
+ "outdated": {
+ "type": "boolean"
+ },
+ "preferredDeprecatedReason": {
"type": "string"
},
- "type": {
- "type": "string",
- "enum": [
- ""
- ]
+ "preferredDesc": {
+ "type": "string"
},
- "viewID": {
+ "preferredFunding": {
"type": "string"
},
- "viewIDs": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "action",
- "avID",
- "backRelationKeyID",
- "blockID",
- "blockIDs",
- "context",
- "data",
- "deckID",
- "format",
- "groupID",
- "id",
- "ignoreDefaultFill",
- "isDetached",
- "isTwoWay",
- "keyID",
- "layout",
- "name",
- "nextID",
- "parentID",
- "previousID",
- "removeDest",
- "retData",
- "rootID",
- "rowID",
- "srcIDs",
- "srcs",
- "targetGroupID",
- "type",
- "viewID"
- ],
- "additionalProperties": false
- },
- "BlockPath": {
- "type": "object",
- "properties": {
- "children": {
+ "preferredName": {
+ "type": "string"
+ },
+ "preferredReadme": {
+ "type": "string"
+ },
+ "preview": {
+ "type": "string"
+ },
+ "previewURL": {
+ "type": "string"
+ },
+ "rating": {
+ "$ref": "#/$defs/BazaarPackageRating"
+ },
+ "ratingAvailable": {
+ "type": "boolean"
+ },
+ "readme": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockPath"
- },
- {
- "type": "null"
- }
- ]
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
{
@@ -1680,54 +1907,101 @@
}
]
},
- "hasChildren": {
- "type": "boolean"
+ "repoHash": {
+ "type": "string"
},
- "id": {
+ "repoRef": {
"type": "string"
},
- "name": {
+ "repoURL": {
"type": "string"
},
- "subType": {
+ "size": {
+ "type": "integer"
+ },
+ "stars": {
+ "type": "integer"
+ },
+ "updateRequiredMinAppVer": {
"type": "string"
},
- "type": {
+ "updateTime": {
+ "type": "integer"
+ },
+ "updated": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ },
+ "userDisabledInPublish": {
+ "type": "boolean"
+ },
+ "version": {
"type": "string"
}
},
"required": [
- "children",
- "id",
+ "author",
+ "backends",
+ "current",
+ "description",
+ "disabledInPublish",
+ "disallowInstall",
+ "disallowUpdate",
+ "displayName",
+ "downloads",
+ "frontends",
+ "funding",
+ "hInstallDate",
+ "hInstallSize",
+ "hSize",
+ "hUpdated",
+ "iconURL",
+ "installSize",
+ "installTime",
+ "installed",
+ "kernels",
+ "keywords",
+ "minAppVersion",
"name",
- "subType",
- "type"
+ "openIssues",
+ "outdated",
+ "preferredDesc",
+ "preferredFunding",
+ "preferredName",
+ "preferredReadme",
+ "previewURL",
+ "ratingAvailable",
+ "readme",
+ "repoHash",
+ "repoURL",
+ "size",
+ "stars",
+ "updateTime",
+ "updated",
+ "url",
+ "version"
],
"additionalProperties": false
},
- "BlockQueryRequestInput": {
+ "BazaarPackageDetail": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "ids": {
+ "available": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/BazaarPackage"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "installed": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/BazaarPackage"
},
{
"type": "null"
@@ -1736,114 +2010,147 @@
}
},
"required": [
- "id"
+ "available",
+ "installed"
],
"additionalProperties": false
},
- "BlockRelevantData": {
+ "BazaarPackageRating": {
"type": "object",
"properties": {
- "nextID": {
- "type": "string"
+ "average": {
+ "type": "number"
},
- "parentID": {
- "type": "string"
+ "count": {
+ "type": "integer"
},
- "previousID": {
- "type": "string"
+ "distribution": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "minItems": 5,
+ "maxItems": 5
}
},
"required": [
- "nextID",
- "parentID",
- "previousID"
+ "average",
+ "count",
+ "distribution"
],
"additionalProperties": false
},
- "BlockReminderRequestInput": {
+ "BazaarPackageSizeData": {
"type": "object",
"properties": {
- "id": {
+ "hInstallSize": {
"type": "string"
},
- "timed": {
- "type": "string"
+ "installSize": {
+ "type": "integer"
}
},
"required": [
- "id",
- "timed"
+ "hInstallSize",
+ "installSize"
],
"additionalProperties": false
},
- "BlockSiblingData": {
+ "BazaarPackagesData": {
"type": "object",
"properties": {
- "next": {
- "type": "string"
- },
- "parent": {
- "type": "string"
- },
- "previous": {
+ "packages": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackage"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "packages"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarREADMEData": {
+ "type": "object",
+ "properties": {
+ "html": {
"type": "string"
}
},
"required": [
- "next",
- "parent",
- "previous"
+ "html"
],
"additionalProperties": false
},
- "BlockStat": {
+ "BazaarRatingData": {
"type": "object",
"properties": {
- "blockCount": {
- "type": "integer"
- },
- "imageCount": {
- "type": "integer"
- },
- "linkCount": {
- "type": "integer"
- },
- "refCount": {
- "type": "integer"
+ "rating": {
+ "$ref": "#/$defs/BazaarPackageRating"
},
- "runeCount": {
- "type": "integer"
+ "ratingAvailable": {
+ "type": "boolean"
},
- "wordCount": {
+ "userRating": {
"type": "integer"
}
},
"required": [
- "blockCount",
- "imageCount",
- "linkCount",
- "refCount",
- "runeCount",
- "wordCount"
+ "ratingAvailable",
+ "userRating"
],
"additionalProperties": false
},
- "BlockTransaction": {
+ "BazaarRatingError": {
"type": "object",
"properties": {
- "doOperations": {
+ "errorCode": {
+ "type": "string",
+ "enum": [
+ "bazaarRatingRateLimited",
+ "bazaarPackagePending"
+ ]
+ }
+ },
+ "required": [
+ "errorCode"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarRatingResult": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarRatingData"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingError"
+ }
+ ]
+ },
+ "BazaarRatingsData": {
+ "type": "object",
+ "properties": {
+ "eligiblePackageNames": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockOperation"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -1851,20 +2158,14 @@
}
]
},
- "templateDocTreePlanID": {
- "type": "string"
- },
- "timestamp": {
- "type": "integer"
- },
- "undoOperations": {
+ "ratings": {
"anyOf": [
{
- "type": "array",
- "items": {
+ "type": "object",
+ "additionalProperties": {
"anyOf": [
{
- "$ref": "#/$defs/BlockOperation"
+ "$ref": "#/$defs/BazaarPackageRating"
},
{
"type": "null"
@@ -1879,85 +2180,140 @@
}
},
"required": [
- "doOperations",
- "timestamp",
- "undoOperations"
+ "eligiblePackageNames",
+ "ratings"
],
"additionalProperties": false
},
- "BlockTreeInfo": {
+ "BazaarStatusBar": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "nextID": {
- "type": "string"
- },
- "nextType": {
- "type": "string"
+ "msgDataSyncDisabled": {
+ "type": "boolean"
},
- "parentID": {
- "type": "string"
+ "msgTaskAssetDatabaseIndexCommitDisabled": {
+ "type": "boolean"
},
- "parentType": {
- "type": "string"
+ "msgTaskDatabaseIndexCommitDisabled": {
+ "type": "boolean"
},
- "previousID": {
- "type": "string"
+ "msgTaskHistoryDatabaseIndexCommitDisabled": {
+ "type": "boolean"
},
- "previousType": {
- "type": "string"
+ "msgTaskHistoryGenerateFileDisabled": {
+ "type": "boolean"
},
- "type": {
- "type": "string"
+ "version": {
+ "type": "integer"
}
},
"required": [
- "id",
- "nextID",
- "nextType",
- "parentID",
- "parentType",
- "previousID",
- "previousType",
- "type"
+ "msgDataSyncDisabled",
+ "msgTaskAssetDatabaseIndexCommitDisabled",
+ "msgTaskDatabaseIndexCommitDisabled",
+ "msgTaskHistoryDatabaseIndexCommitDisabled",
+ "msgTaskHistoryGenerateFileDisabled",
+ "version"
],
"additionalProperties": false
},
- "BlocksKramdownRequestInput": {
+ "BazaarUpdatedData": {
"type": "object",
"properties": {
- "id": {
+ "icons": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "plugins": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "mode": {
+ "templates": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "notebook": {
+ "themes": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "widgets": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -1966,33 +2322,80 @@
}
},
"required": [
- "ids"
+ "icons",
+ "plugins",
+ "templates",
+ "themes",
+ "widgets"
],
"additionalProperties": false
},
- "BlocksQueryRequestInput": {
+ "BazaarUserRatingsData": {
"type": "object",
"properties": {
- "id": {
+ "eligiblePackageNames": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "userRatings": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "eligiblePackageNames",
+ "userRatings"
+ ],
+ "additionalProperties": false
+ },
+ "BazaarUserRatingsResult": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BazaarUserRatingsData"
},
- "notebook": {
+ {
+ "$ref": "#/$defs/BazaarRatingError"
+ }
+ ]
+ },
+ "BlockBreadcrumbChildren": {
+ "type": "object",
+ "properties": {
+ "hasMore": {
+ "type": "boolean"
+ },
+ "items": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -2001,28 +2404,52 @@
}
},
"required": [
- "ids"
+ "hasMore",
+ "items"
],
"additionalProperties": false
},
- "BlocksWordCountRequestInput": {
+ "BlockBreadcrumbChildrenRequestInput": {
"type": "object",
"properties": {
- "id": {
+ "excludeTypes": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
+ "id": {
+ "type": "string"
+ },
"ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "limit": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"notebook": {
"anyOf": [
@@ -2034,10 +2461,10 @@
}
]
},
- "reqId": {
+ "offset": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "number"
},
{
"type": "null"
@@ -2046,26 +2473,19 @@
}
},
"required": [
- "ids"
+ "id"
],
"additionalProperties": false
},
- "Bookmark": {
+ "BlockBreadcrumbRequestInput": {
"type": "object",
"properties": {
- "blocks": {
+ "excludeTypes": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -2073,258 +2493,236 @@
}
]
},
- "count": {
- "type": "integer"
- },
- "depth": {
- "type": "integer"
- },
- "name": {
+ "id": {
"type": "string"
},
- "type": {
- "type": "string"
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "blocks",
- "count",
- "depth",
- "name",
- "type"
+ "id"
],
"additionalProperties": false
},
- "BootProgressData": {
+ "BlockDOMData": {
"type": "object",
"properties": {
- "details": {
+ "dom": {
"type": "string"
},
- "progress": {
- "type": "integer"
+ "id": {
+ "type": "string"
}
},
"required": [
- "details",
- "progress"
+ "dom",
+ "id"
],
"additionalProperties": false
},
- "BroadcastChannel": {
+ "BlockDeleteData": {
"type": "object",
"properties": {
- "count": {
- "type": "integer"
- },
- "name": {
- "type": "string"
+ "createEmptyParagraph": {
+ "type": "boolean"
}
},
"required": [
- "count",
- "name"
+ "createEmptyParagraph"
],
"additionalProperties": false
},
- "BroadcastChannelData": {
+ "BlockFoldData": {
"type": "object",
"properties": {
- "channel": {
- "anyOf": [
- {
- "$ref": "#/$defs/BroadcastChannel"
- },
- {
- "type": "null"
- }
- ]
+ "isFolded": {
+ "type": "boolean"
+ },
+ "isRoot": {
+ "type": "boolean"
}
},
"required": [
- "channel"
+ "isFolded",
+ "isRoot"
],
"additionalProperties": false
},
- "BroadcastChannelRequestInput": {
+ "BlockIDRequestInput": {
"type": "object",
"properties": {
- "name": {
+ "id": {
"type": "string"
}
},
"required": [
- "name"
+ "id"
],
"additionalProperties": false
},
- "BroadcastChannelsData": {
+ "BlockIDsRequestInput": {
"type": "object",
"properties": {
- "channels": {
+ "ids": {
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BroadcastChannel"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
}
},
"required": [
- "channels"
+ "ids"
],
"additionalProperties": false
},
- "BroadcastMessageRequestInput": {
- "type": "object",
- "properties": {
- "channel": {
- "type": "string"
+ "BlockInfoData": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FullBlockInfo"
},
- "message": {
- "type": "string"
- }
- },
- "required": [
- "channel",
- "message"
- ],
- "additionalProperties": false
- },
- "BroadcastPublishData": {
- "type": "object",
- "properties": {
- "results": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BroadcastPublishResult"
- },
- {
- "type": "null"
- }
- ]
- }
+ {
+ "$ref": "#/$defs/PublishedBlockInfo"
}
- },
- "required": [
- "results"
- ],
- "additionalProperties": false
+ ]
},
- "BroadcastPublishMessage": {
+ "BlockInfoRequestInput": {
"type": "object",
"properties": {
- "filename": {
+ "id": {
"type": "string"
},
- "size": {
- "type": "integer"
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "type": {
- "type": "string",
- "enum": [
- "string",
- "binary"
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
]
}
},
"required": [
- "filename",
- "size",
- "type"
+ "id"
],
"additionalProperties": false
},
- "BroadcastPublishResult": {
+ "BlockInsertInputInput": {
"type": "object",
"properties": {
- "channel": {
- "$ref": "#/$defs/BroadcastChannel"
+ "data": {
+ "type": "string"
},
- "code": {
- "type": "integer"
+ "dataType": {
+ "type": "string"
},
- "message": {
- "$ref": "#/$defs/BroadcastPublishMessage"
+ "nextID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "msg": {
- "type": "string"
+ "parentID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "previousID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "channel",
- "code",
- "message",
- "msg"
+ "data",
+ "dataType"
],
"additionalProperties": false
},
- "ChangeMasterPasswordRequestInput": {
+ "BlockKramdownData": {
"type": "object",
"properties": {
- "newPassword": {
+ "id": {
"type": "string"
},
- "oldPassword": {
+ "kramdown": {
"type": "string"
}
},
"required": [
- "newPassword",
- "oldPassword"
- ],
- "additionalProperties": false
- },
- "ChangeSortNotebookRequestInput": {
- "type": "object",
- "properties": {
- "notebooks": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "notebooks"
+ "id",
+ "kramdown"
],
"additionalProperties": false
},
- "CheckActivationCodeRequestInput": {
+ "BlockKramdownRequestInput": {
"type": "object",
"properties": {
- "data": {
+ "id": {
"type": "string"
- }
- },
- "required": [
- "data"
- ],
- "additionalProperties": false
- },
- "CheckBlockRefRequestInput": {
- "type": "object",
- "properties": {
- "deletedIDs": {
- "type": "array",
- "items": {
- "type": "string"
- }
},
- "exactIDs": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "id": {
+ "mode": {
"anyOf": [
{
"type": "string"
@@ -2334,12 +2732,6 @@
}
]
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
"notebook": {
"anyOf": [
{
@@ -2349,306 +2741,281 @@
"type": "null"
}
]
- },
- "paths": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "scope": {
- "type": "string"
}
},
+ "required": [
+ "id"
+ ],
"additionalProperties": false
},
- "CheckBlocksExistRequestInput": {
+ "BlockOperation": {
"type": "object",
"properties": {
- "id": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "delete",
+ "insert",
+ "update",
+ "foldHeading",
+ "unfoldHeading",
+ "setAttrs",
+ "moveOutlineHeading",
+ "appendInsert",
+ "prependInsert"
+ ]
+ },
+ "avID": {
+ "type": "string"
+ },
+ "backRelationKeyID": {
+ "type": "string"
+ },
+ "blockID": {
+ "type": "string"
+ },
+ "blockIDs": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "ids": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/JSONValue"
- }
+ "context": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "notebook": {
+ "data": {
"anyOf": [
+ {
+ "type": "null"
+ },
{
"type": "string"
},
{
- "type": "null"
+ "$ref": "#/$defs/BlockDeleteData"
}
]
- }
- },
- "required": [
- "ids"
- ],
- "additionalProperties": false
- },
- "CheckSnapshotData": {
- "type": "object",
- "properties": {
- "changed": {
- "type": "boolean"
- }
- },
- "required": [
- "changed"
- ],
- "additionalProperties": false
- },
- "ChildBlock": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string"
},
- "id": {
+ "deckID": {
"type": "string"
},
- "markdown": {
+ "format": {
"type": "string"
},
- "subType": {
+ "groupID": {
"type": "string"
},
- "type": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "type"
- ],
- "additionalProperties": false
- },
- "CleanupRichTextRequestInput": {
- "type": "object",
- "properties": {
- "batch": {
+ "id": {
"type": "string"
},
- "groups": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "batch",
- "groups"
- ],
- "additionalProperties": false
- },
- "ClipboardFile": {
- "type": "object",
- "properties": {
- "isDir": {
+ "ignoreDefaultFill": {
"type": "boolean"
},
- "name": {
- "type": "string"
- },
- "path": {
- "type": "string"
+ "isDetached": {
+ "type": "boolean"
},
- "size": {
- "type": "integer"
+ "isTwoWay": {
+ "type": "boolean"
},
- "updated": {
- "type": "integer"
- }
- },
- "required": [
- "isDir",
- "name",
- "path",
- "size",
- "updated"
- ],
- "additionalProperties": false
- },
- "ClipboardPathRequestInput": {
- "type": "object",
- "properties": {
- "path": {
- "type": "string"
- }
- },
- "required": [
- "path"
- ],
- "additionalProperties": false
- },
- "CloseNotebookRequestInput": {
- "type": "object",
- "properties": {
- "notebook": {
- "type": "string"
- }
- },
- "required": [
- "notebook"
- ],
- "additionalProperties": false
- },
- "CloudBackup": {
- "type": "object",
- "properties": {
- "hSize": {
+ "keyID": {
"type": "string"
},
- "saveDir": {
+ "layout": {
"type": "string"
},
- "size": {
- "type": "integer"
- },
- "updated": {
+ "name": {
"type": "string"
- }
- },
- "required": [
- "hSize",
- "saveDir",
- "size",
- "updated"
- ],
- "additionalProperties": false
- },
- "CloudReminderRequestInput": {
- "type": "object",
- "properties": {
- "content": {
+ },
+ "nextID": {
"type": "string"
},
- "id": {
+ "parentID": {
"type": "string"
},
- "timed": {
+ "previousID": {
"type": "string"
- }
- },
- "required": [
- "content",
- "id",
- "timed"
- ],
- "additionalProperties": false
- },
- "CloudSpaceData": {
- "type": "object",
- "properties": {
- "backup": {
+ },
+ "removeDest": {
+ "type": "boolean"
+ },
+ "retData": {
"anyOf": [
{
- "$ref": "#/$defs/CloudBackup"
+ "type": "null"
},
{
- "type": "null"
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
]
},
- "hAssetSize": {
- "type": "string"
- },
- "hExchangeSize": {
- "type": "string"
- },
- "hSize": {
- "type": "string"
- },
- "hTotalSize": {
- "type": "string"
- },
- "hTrafficAPIGet": {
- "type": "string"
- },
- "hTrafficAPIPut": {
- "type": "string"
- },
- "hTrafficDownloadSize": {
+ "rootID": {
"type": "string"
},
- "hTrafficUploadSize": {
+ "rowID": {
"type": "string"
},
- "sync": {
+ "srcIDs": {
"anyOf": [
{
- "$ref": "#/$defs/CloudSync"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
+ },
+ "srcs": {
+ "type": "null"
+ },
+ "targetGroupID": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ ""
+ ]
+ },
+ "viewID": {
+ "type": "string"
+ },
+ "viewIDs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
"required": [
- "backup",
- "hAssetSize",
- "hExchangeSize",
- "hSize",
- "hTotalSize",
- "hTrafficAPIGet",
- "hTrafficAPIPut",
- "hTrafficDownloadSize",
- "hTrafficUploadSize",
- "sync"
+ "action",
+ "avID",
+ "backRelationKeyID",
+ "blockID",
+ "blockIDs",
+ "context",
+ "data",
+ "deckID",
+ "format",
+ "groupID",
+ "id",
+ "ignoreDefaultFill",
+ "isDetached",
+ "isTwoWay",
+ "keyID",
+ "layout",
+ "name",
+ "nextID",
+ "parentID",
+ "previousID",
+ "removeDest",
+ "retData",
+ "rootID",
+ "rowID",
+ "srcIDs",
+ "srcs",
+ "targetGroupID",
+ "type",
+ "viewID"
],
"additionalProperties": false
},
- "CloudSync": {
+ "BlockPath": {
"type": "object",
"properties": {
- "cloudName": {
- "type": "string"
+ "children": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "hSize": {
+ "hasChildren": {
+ "type": "boolean"
+ },
+ "id": {
"type": "string"
},
- "saveDir": {
+ "name": {
"type": "string"
},
- "size": {
- "type": "integer"
+ "subType": {
+ "type": "string"
},
- "updated": {
+ "type": {
"type": "string"
}
},
"required": [
- "cloudName",
- "hSize",
- "saveDir",
- "size",
- "updated"
+ "children",
+ "id",
+ "name",
+ "subType",
+ "type"
],
"additionalProperties": false
},
- "ContentWordCountRequestInput": {
+ "BlockQueryRequestInput": {
"type": "object",
"properties": {
- "content": {
+ "id": {
"type": "string"
},
- "reqId": {
+ "ids": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
"type": "null"
@@ -2657,160 +3024,141 @@
}
},
"required": [
- "content"
+ "id"
],
"additionalProperties": false
},
- "ContinueImportSYRequestInput": {
+ "BlockRelevantData": {
"type": "object",
"properties": {
- "notebook": {
+ "nextID": {
"type": "string"
},
- "token": {
+ "parentID": {
+ "type": "string"
+ },
+ "previousID": {
"type": "string"
}
},
"required": [
- "notebook",
- "token"
+ "nextID",
+ "parentID",
+ "previousID"
],
"additionalProperties": false
},
- "CopyFileRequestInput": {
+ "BlockReminderRequestInput": {
"type": "object",
"properties": {
- "dest": {
+ "id": {
"type": "string"
},
- "src": {
+ "timed": {
"type": "string"
}
},
"required": [
- "dest",
- "src"
+ "id",
+ "timed"
],
"additionalProperties": false
},
- "CopyFilesRequestInput": {
+ "BlockSiblingData": {
"type": "object",
"properties": {
- "destDir": {
+ "next": {
"type": "string"
},
- "srcs": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "parent": {
+ "type": "string"
+ },
+ "previous": {
+ "type": "string"
}
},
"required": [
- "destDir",
- "srcs"
+ "next",
+ "parent",
+ "previous"
],
"additionalProperties": false
},
- "CopyStdMarkdownRequestInput": {
+ "BlockStat": {
"type": "object",
"properties": {
- "adjustHeadingLevel": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "assetsDestSpace2Underscore": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "blockCount": {
+ "type": "integer"
},
- "fillCSSVar": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "imageCount": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "linkCount": {
+ "type": "integer"
},
- "imgTag": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "CreateAssetHistoryRequestInput": {
- "type": "object",
- "properties": {
- "path": {
- "type": "string"
- }
- },
- "required": [
- "path"
- ],
- "additionalProperties": false
- },
- "CreateDocHistoryRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
+ "refCount": {
+ "type": "integer"
+ },
+ "runeCount": {
+ "type": "integer"
+ },
+ "wordCount": {
+ "type": "integer"
}
},
"required": [
- "id"
+ "blockCount",
+ "imageCount",
+ "linkCount",
+ "refCount",
+ "runeCount",
+ "wordCount"
],
"additionalProperties": false
},
- "CreateEncryptedNotebookRequestInput": {
+ "BlockTransaction": {
"type": "object",
"properties": {
- "name": {
- "type": "string"
+ "doOperations": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockOperation"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "password": {
+ "templateDocTreePlanID": {
"type": "string"
- }
- },
- "required": [
- "name",
- "password"
- ],
- "additionalProperties": false
- },
- "CreateNotebookData": {
- "type": "object",
- "properties": {
- "notebook": {
+ },
+ "timestamp": {
+ "type": "integer"
+ },
+ "undoOperations": {
"anyOf": [
{
- "$ref": "#/$defs/Notebook"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockOperation"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -2819,104 +3167,85 @@
}
},
"required": [
- "notebook"
+ "doOperations",
+ "timestamp",
+ "undoOperations"
],
"additionalProperties": false
},
- "CreateNotebookRequestInput": {
+ "BlockTreeInfo": {
"type": "object",
"properties": {
- "name": {
+ "id": {
"type": "string"
- }
- },
- "required": [
- "name"
- ],
- "additionalProperties": false
- },
- "CreateSnapshotData": {
- "type": "object",
- "properties": {
- "created": {
- "type": "boolean"
},
- "id": {
+ "nextID": {
+ "type": "string"
+ },
+ "nextType": {
+ "type": "string"
+ },
+ "parentID": {
+ "type": "string"
+ },
+ "parentType": {
+ "type": "string"
+ },
+ "previousID": {
+ "type": "string"
+ },
+ "previousType": {
+ "type": "string"
+ },
+ "type": {
"type": "string"
}
},
"required": [
- "created",
- "id"
+ "id",
+ "nextID",
+ "nextType",
+ "parentID",
+ "parentType",
+ "previousID",
+ "previousType",
+ "type"
],
"additionalProperties": false
},
- "CreateSnapshotRequestInput": {
- "type": "object",
- "properties": {
- "memo": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "Criterion": {
+ "BlocksKramdownRequestInput": {
"type": "object",
"properties": {
- "group": {
- "type": "integer"
- },
- "hPath": {
- "type": "string"
- },
- "hasReplace": {
- "type": "boolean"
- },
- "idPath": {
+ "id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "k": {
- "type": "string"
- },
- "method": {
- "type": "integer"
- },
- "name": {
- "type": "string"
- },
- "r": {
- "type": "string"
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "replaceTypes": {
+ "mode": {
"anyOf": [
{
- "$ref": "#/$defs/CriterionReplaceTypes"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "sort": {
- "type": "integer"
- },
- "subTypes": {
- "$ref": "#/$defs/SearchSubTypes"
- },
- "types": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/CriterionTypes"
+ "type": "string"
},
{
"type": "null"
@@ -2925,35 +3254,30 @@
}
},
"required": [
- "group",
- "hPath",
- "hasReplace",
- "idPath",
- "k",
- "method",
- "name",
- "r",
- "replaceTypes",
- "sort",
- "subTypes",
- "types"
+ "ids"
],
"additionalProperties": false
},
- "CriterionInput": {
+ "BlocksQueryRequestInput": {
"type": "object",
"properties": {
- "group": {
+ "id": {
"anyOf": [
{
- "type": "integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "hPath": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "notebook": {
"anyOf": [
{
"type": "string"
@@ -2962,31 +3286,33 @@
"type": "null"
}
]
- },
- "hasReplace": {
+ }
+ },
+ "required": [
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "BlocksWordCountRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "idPath": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "k": {
+ "notebook": {
"anyOf": [
{
"type": "string"
@@ -2996,341 +3322,688 @@
}
]
},
- "method": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ]
- },
- "name": {
+ "reqId": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/JSONValue"
},
{
"type": "null"
}
]
- },
- "r": {
+ }
+ },
+ "required": [
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "Bookmark": {
+ "type": "object",
+ "properties": {
+ "blocks": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "replaceTypes": {
- "anyOf": [
- {
- "$ref": "#/$defs/CriterionReplaceTypesInput"
- },
- {
- "type": "null"
- }
- ]
+ "count": {
+ "type": "integer"
},
- "sort": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ]
+ "depth": {
+ "type": "integer"
},
- "subTypes": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchSubTypesInput"
- },
- {
- "type": "null"
- }
- ]
+ "name": {
+ "type": "string"
},
- "types": {
- "anyOf": [
- {
- "$ref": "#/$defs/CriterionTypesInput"
- },
- {
- "type": "null"
- }
- ]
+ "type": {
+ "type": "string"
}
},
+ "required": [
+ "blocks",
+ "count",
+ "depth",
+ "name",
+ "type"
+ ],
"additionalProperties": false
},
- "CriterionReplaceTypes": {
+ "BootProgressData": {
"type": "object",
"properties": {
- "aHref": {
- "type": "boolean"
- },
- "aText": {
- "type": "boolean"
- },
- "aTitle": {
- "type": "boolean"
- },
- "blockRef": {
- "type": "boolean"
- },
- "code": {
- "type": "boolean"
- },
- "codeBlock": {
- "type": "boolean"
- },
- "docTitle": {
- "type": "boolean"
- },
- "em": {
- "type": "boolean"
- },
- "fileAnnotationRef": {
- "type": "boolean"
- },
- "htmlBlock": {
- "type": "boolean"
- },
- "imgSrc": {
- "type": "boolean"
- },
- "imgText": {
- "type": "boolean"
- },
- "imgTitle": {
- "type": "boolean"
- },
- "inlineMath": {
- "type": "boolean"
- },
- "inlineMemo": {
- "type": "boolean"
- },
- "kbd": {
- "type": "boolean"
- },
- "mark": {
- "type": "boolean"
- },
- "mathBlock": {
- "type": "boolean"
- },
- "s": {
- "type": "boolean"
- },
- "strong": {
- "type": "boolean"
- },
- "sub": {
- "type": "boolean"
- },
- "sup": {
- "type": "boolean"
- },
- "tag": {
- "type": "boolean"
- },
- "text": {
- "type": "boolean"
+ "details": {
+ "type": "string"
},
- "u": {
- "type": "boolean"
+ "progress": {
+ "type": "integer"
}
},
"required": [
- "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"
+ "details",
+ "progress"
],
"additionalProperties": false
},
- "CriterionReplaceTypesInput": {
+ "BroadcastChannel": {
"type": "object",
"properties": {
- "aHref": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "aText": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "count": {
+ "type": "integer"
},
- "aTitle": {
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "count",
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastChannelData": {
+ "type": "object",
+ "properties": {
+ "channel": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/BroadcastChannel"
},
{
"type": "null"
}
]
- },
- "blockRef": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
+ }
+ },
+ "required": [
+ "channel"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastChannelRequestInput": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastChannelsData": {
+ "type": "object",
+ "properties": {
+ "channels": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BroadcastChannel"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "channels"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastMessageRequestInput": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "channel",
+ "message"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastPublishData": {
+ "type": "object",
+ "properties": {
+ "results": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BroadcastPublishResult"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "results"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastPublishMessage": {
+ "type": "object",
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "string",
+ "binary"
]
+ }
+ },
+ "required": [
+ "filename",
+ "size",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "BroadcastPublishResult": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "$ref": "#/$defs/BroadcastChannel"
},
"code": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "type": "integer"
},
- "codeBlock": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "message": {
+ "$ref": "#/$defs/BroadcastPublishMessage"
},
- "docTitle": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "channel",
+ "code",
+ "message",
+ "msg"
+ ],
+ "additionalProperties": false
+ },
+ "ChangeMasterPasswordRequestInput": {
+ "type": "object",
+ "properties": {
+ "newPassword": {
+ "type": "string"
},
- "em": {
+ "oldPassword": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "newPassword",
+ "oldPassword"
+ ],
+ "additionalProperties": false
+ },
+ "ChangeSortNotebookRequestInput": {
+ "type": "object",
+ "properties": {
+ "notebooks": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "notebooks"
+ ],
+ "additionalProperties": false
+ },
+ "CheckActivationCodeRequestInput": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ "CheckBlockRefRequestInput": {
+ "type": "object",
+ "properties": {
+ "deletedIDs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "exactIDs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "fileAnnotationRef": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "notebook": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "htmlBlock": {
+ "paths": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "scope": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "CheckBlocksExistRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "imgSrc": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ "notebook": {
"anyOf": [
{
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "imgText": {
- "anyOf": [
- {
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "CheckSnapshotData": {
+ "type": "object",
+ "properties": {
+ "changed": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "changed"
+ ],
+ "additionalProperties": false
+ },
+ "ChildBlock": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
},
- "imgTitle": {
+ "id": {
+ "type": "string"
+ },
+ "markdown": {
+ "type": "string"
+ },
+ "subType": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "CleanupRichTextRequestInput": {
+ "type": "object",
+ "properties": {
+ "batch": {
+ "type": "string"
+ },
+ "groups": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "batch",
+ "groups"
+ ],
+ "additionalProperties": false
+ },
+ "ClipboardFile": {
+ "type": "object",
+ "properties": {
+ "isDir": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "updated": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "isDir",
+ "name",
+ "path",
+ "size",
+ "updated"
+ ],
+ "additionalProperties": false
+ },
+ "ClipboardPathRequestInput": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ "CloseNotebookRequestInput": {
+ "type": "object",
+ "properties": {
+ "notebook": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "notebook"
+ ],
+ "additionalProperties": false
+ },
+ "CloudBackup": {
+ "type": "object",
+ "properties": {
+ "hSize": {
+ "type": "string"
+ },
+ "saveDir": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "updated": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "hSize",
+ "saveDir",
+ "size",
+ "updated"
+ ],
+ "additionalProperties": false
+ },
+ "CloudReminderRequestInput": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "timed": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "id",
+ "timed"
+ ],
+ "additionalProperties": false
+ },
+ "CloudSpaceData": {
+ "type": "object",
+ "properties": {
+ "backup": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/CloudBackup"
},
{
"type": "null"
}
]
},
- "inlineMath": {
+ "hAssetSize": {
+ "type": "string"
+ },
+ "hExchangeSize": {
+ "type": "string"
+ },
+ "hSize": {
+ "type": "string"
+ },
+ "hTotalSize": {
+ "type": "string"
+ },
+ "hTrafficAPIGet": {
+ "type": "string"
+ },
+ "hTrafficAPIPut": {
+ "type": "string"
+ },
+ "hTrafficDownloadSize": {
+ "type": "string"
+ },
+ "hTrafficUploadSize": {
+ "type": "string"
+ },
+ "sync": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/CloudSync"
},
{
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "backup",
+ "hAssetSize",
+ "hExchangeSize",
+ "hSize",
+ "hTotalSize",
+ "hTrafficAPIGet",
+ "hTrafficAPIPut",
+ "hTrafficDownloadSize",
+ "hTrafficUploadSize",
+ "sync"
+ ],
+ "additionalProperties": false
+ },
+ "CloudSync": {
+ "type": "object",
+ "properties": {
+ "cloudName": {
+ "type": "string"
},
- "inlineMemo": {
+ "hSize": {
+ "type": "string"
+ },
+ "saveDir": {
+ "type": "string"
+ },
+ "size": {
+ "type": "integer"
+ },
+ "updated": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "cloudName",
+ "hSize",
+ "saveDir",
+ "size",
+ "updated"
+ ],
+ "additionalProperties": false
+ },
+ "ContentWordCountRequestInput": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "reqId": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/JSONValue"
},
{
"type": "null"
}
]
- },
- "kbd": {
+ }
+ },
+ "required": [
+ "content"
+ ],
+ "additionalProperties": false
+ },
+ "ContinueImportSYRequestInput": {
+ "type": "object",
+ "properties": {
+ "notebook": {
+ "type": "string"
+ },
+ "token": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "notebook",
+ "token"
+ ],
+ "additionalProperties": false
+ },
+ "CopyFileRequestInput": {
+ "type": "object",
+ "properties": {
+ "dest": {
+ "type": "string"
+ },
+ "src": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "dest",
+ "src"
+ ],
+ "additionalProperties": false
+ },
+ "CopyFilesRequestInput": {
+ "type": "object",
+ "properties": {
+ "destDir": {
+ "type": "string"
+ },
+ "srcs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "destDir",
+ "srcs"
+ ],
+ "additionalProperties": false
+ },
+ "CopyStdMarkdownRequestInput": {
+ "type": "object",
+ "properties": {
+ "adjustHeadingLevel": {
"anyOf": [
{
"type": "boolean"
@@ -3340,7 +4013,7 @@
}
]
},
- "mark": {
+ "assetsDestSpace2Underscore": {
"anyOf": [
{
"type": "boolean"
@@ -3350,7 +4023,7 @@
}
]
},
- "mathBlock": {
+ "fillCSSVar": {
"anyOf": [
{
"type": "boolean"
@@ -3360,7 +4033,10 @@
}
]
},
- "s": {
+ "id": {
+ "type": "string"
+ },
+ "imgTag": {
"anyOf": [
{
"type": "boolean"
@@ -3369,58 +4045,213 @@
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "CreateAssetHistoryRequestInput": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ "CreateDocHistoryRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "CreateEncryptedNotebookRequestInput": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
},
- "strong": {
+ "password": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "password"
+ ],
+ "additionalProperties": false
+ },
+ "CreateNotebookData": {
+ "type": "object",
+ "properties": {
+ "notebook": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/Notebook"
},
{
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "notebook"
+ ],
+ "additionalProperties": false
+ },
+ "CreateNotebookRequestInput": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "CreateSnapshotData": {
+ "type": "object",
+ "properties": {
+ "created": {
+ "type": "boolean"
},
- "sub": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "created",
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "CreateSnapshotRequestInput": {
+ "type": "object",
+ "properties": {
+ "memo": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "Criterion": {
+ "type": "object",
+ "properties": {
+ "group": {
+ "type": "integer"
+ },
+ "hPath": {
+ "type": "string"
+ },
+ "hasReplace": {
+ "type": "boolean"
+ },
+ "idPath": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "sup": {
+ "k": {
+ "type": "string"
+ },
+ "method": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ },
+ "r": {
+ "type": "string"
+ },
+ "replaceTypes": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/CriterionReplaceTypes"
},
{
"type": "null"
}
]
},
- "tag": {
+ "sort": {
+ "type": "integer"
+ },
+ "subTypes": {
+ "$ref": "#/$defs/SearchSubTypes"
+ },
+ "types": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/CriterionTypes"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "group",
+ "hPath",
+ "hasReplace",
+ "idPath",
+ "k",
+ "method",
+ "name",
+ "r",
+ "replaceTypes",
+ "sort",
+ "subTypes",
+ "types"
+ ],
+ "additionalProperties": false
+ },
+ "CriterionInput": {
+ "type": "object",
+ "properties": {
+ "group": {
+ "anyOf": [
+ {
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "text": {
+ "hPath": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "u": {
+ "hasReplace": {
"anyOf": [
{
"type": "boolean"
@@ -3429,102 +4260,215 @@
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "CriterionTypes": {
- "type": "object",
- "properties": {
- "audioBlock": {
+ },
+ "idPath": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "k": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "method": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "name": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "r": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "replaceTypes": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/CriterionReplaceTypesInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "sort": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "subTypes": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchSubTypesInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "types": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/CriterionTypesInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "CriterionReplaceTypes": {
+ "type": "object",
+ "properties": {
+ "aHref": {
"type": "boolean"
},
- "blockquote": {
+ "aText": {
"type": "boolean"
},
- "callout": {
+ "aTitle": {
"type": "boolean"
},
- "codeBlock": {
+ "blockRef": {
"type": "boolean"
},
- "databaseBlock": {
+ "code": {
"type": "boolean"
},
- "document": {
+ "codeBlock": {
"type": "boolean"
},
- "embedBlock": {
+ "docTitle": {
"type": "boolean"
},
- "heading": {
+ "em": {
+ "type": "boolean"
+ },
+ "fileAnnotationRef": {
"type": "boolean"
},
"htmlBlock": {
"type": "boolean"
},
- "iframeBlock": {
+ "imgSrc": {
"type": "boolean"
},
- "list": {
+ "imgText": {
"type": "boolean"
},
- "listItem": {
+ "imgTitle": {
+ "type": "boolean"
+ },
+ "inlineMath": {
+ "type": "boolean"
+ },
+ "inlineMemo": {
+ "type": "boolean"
+ },
+ "kbd": {
+ "type": "boolean"
+ },
+ "mark": {
"type": "boolean"
},
"mathBlock": {
"type": "boolean"
},
- "paragraph": {
+ "s": {
"type": "boolean"
},
- "superBlock": {
+ "strong": {
"type": "boolean"
},
- "tabItem": {
+ "sub": {
"type": "boolean"
},
- "table": {
+ "sup": {
"type": "boolean"
},
- "tabs": {
+ "tag": {
"type": "boolean"
},
- "videoBlock": {
+ "text": {
"type": "boolean"
},
- "widgetBlock": {
+ "u": {
"type": "boolean"
}
},
"required": [
- "audioBlock",
- "blockquote",
- "callout",
+ "aHref",
+ "aText",
+ "aTitle",
+ "blockRef",
+ "code",
"codeBlock",
- "databaseBlock",
- "document",
- "embedBlock",
- "heading",
+ "docTitle",
+ "em",
+ "fileAnnotationRef",
"htmlBlock",
- "iframeBlock",
- "list",
- "listItem",
+ "imgSrc",
+ "imgText",
+ "imgTitle",
+ "inlineMath",
+ "inlineMemo",
+ "kbd",
+ "mark",
"mathBlock",
- "paragraph",
- "superBlock",
- "tabItem",
- "table",
- "tabs",
- "videoBlock",
- "widgetBlock"
+ "s",
+ "strong",
+ "sub",
+ "sup",
+ "tag",
+ "text",
+ "u"
],
"additionalProperties": false
},
- "CriterionTypesInput": {
+ "CriterionReplaceTypesInput": {
"type": "object",
"properties": {
- "audioBlock": {
+ "aHref": {
"anyOf": [
{
"type": "boolean"
@@ -3534,7 +4478,7 @@
}
]
},
- "blockquote": {
+ "aText": {
"anyOf": [
{
"type": "boolean"
@@ -3544,7 +4488,7 @@
}
]
},
- "callout": {
+ "aTitle": {
"anyOf": [
{
"type": "boolean"
@@ -3554,7 +4498,7 @@
}
]
},
- "codeBlock": {
+ "blockRef": {
"anyOf": [
{
"type": "boolean"
@@ -3564,7 +4508,7 @@
}
]
},
- "databaseBlock": {
+ "code": {
"anyOf": [
{
"type": "boolean"
@@ -3574,7 +4518,7 @@
}
]
},
- "document": {
+ "codeBlock": {
"anyOf": [
{
"type": "boolean"
@@ -3584,7 +4528,7 @@
}
]
},
- "embedBlock": {
+ "docTitle": {
"anyOf": [
{
"type": "boolean"
@@ -3594,7 +4538,17 @@
}
]
},
- "heading": {
+ "em": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "fileAnnotationRef": {
"anyOf": [
{
"type": "boolean"
@@ -3614,7 +4568,7 @@
}
]
},
- "iframeBlock": {
+ "imgSrc": {
"anyOf": [
{
"type": "boolean"
@@ -3624,7 +4578,7 @@
}
]
},
- "list": {
+ "imgText": {
"anyOf": [
{
"type": "boolean"
@@ -3634,7 +4588,7 @@
}
]
},
- "listItem": {
+ "imgTitle": {
"anyOf": [
{
"type": "boolean"
@@ -3644,7 +4598,7 @@
}
]
},
- "mathBlock": {
+ "inlineMath": {
"anyOf": [
{
"type": "boolean"
@@ -3654,7 +4608,7 @@
}
]
},
- "paragraph": {
+ "inlineMemo": {
"anyOf": [
{
"type": "boolean"
@@ -3664,7 +4618,7 @@
}
]
},
- "superBlock": {
+ "kbd": {
"anyOf": [
{
"type": "boolean"
@@ -3674,7 +4628,7 @@
}
]
},
- "tabItem": {
+ "mark": {
"anyOf": [
{
"type": "boolean"
@@ -3684,7 +4638,7 @@
}
]
},
- "table": {
+ "mathBlock": {
"anyOf": [
{
"type": "boolean"
@@ -3694,7 +4648,7 @@
}
]
},
- "tabs": {
+ "s": {
"anyOf": [
{
"type": "boolean"
@@ -3704,7 +4658,7 @@
}
]
},
- "videoBlock": {
+ "strong": {
"anyOf": [
{
"type": "boolean"
@@ -3714,7 +4668,7 @@
}
]
},
- "widgetBlock": {
+ "sub": {
"anyOf": [
{
"type": "boolean"
@@ -3723,203 +4677,192 @@
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "DOMData": {
- "type": "object",
- "properties": {
- "dom": {
- "type": "string"
- }
- },
- "required": [
- "dom"
- ],
- "additionalProperties": false
- },
- "DOMTextRequestInput": {
- "type": "object",
- "properties": {
- "dom": {
- "type": "string"
- }
- },
- "required": [
- "dom"
- ],
- "additionalProperties": false
- },
- "DailyNoteBlockRequestInput": {
- "type": "object",
- "properties": {
- "data": {
- "type": "string"
},
- "dataType": {
- "type": "string"
+ "sup": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "notebook": {
- "type": "string"
- }
- },
- "required": [
- "data",
- "dataType",
- "notebook"
- ],
- "additionalProperties": false
- },
- "DeleteBlockRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "DiffDocVersionsRequestInput": {
- "type": "object",
- "properties": {
- "left": {
- "$ref": "#/$defs/DocVersionRefInput"
+ "tag": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "right": {
- "$ref": "#/$defs/DocVersionRefInput"
+ "text": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "u": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "left",
- "right"
- ],
"additionalProperties": false
},
- "DirectoryEntry": {
+ "CriterionTypes": {
"type": "object",
"properties": {
- "isDir": {
+ "audioBlock": {
"type": "boolean"
},
- "isSymlink": {
+ "blockquote": {
"type": "boolean"
},
- "name": {
- "type": "string"
+ "callout": {
+ "type": "boolean"
},
- "updated": {
- "type": "integer"
- }
- },
- "required": [
- "isDir",
- "isSymlink",
- "name",
- "updated"
- ],
- "additionalProperties": false
- },
- "DocAttrView": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
+ "codeBlock": {
+ "type": "boolean"
},
- "name": {
- "type": "string"
+ "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"
+ },
+ "tabItem": {
+ "type": "boolean"
+ },
+ "table": {
+ "type": "boolean"
+ },
+ "tabs": {
+ "type": "boolean"
+ },
+ "videoBlock": {
+ "type": "boolean"
+ },
+ "widgetBlock": {
+ "type": "boolean"
}
},
"required": [
- "id",
- "name"
+ "audioBlock",
+ "blockquote",
+ "callout",
+ "codeBlock",
+ "databaseBlock",
+ "document",
+ "embedBlock",
+ "heading",
+ "htmlBlock",
+ "iframeBlock",
+ "list",
+ "listItem",
+ "mathBlock",
+ "paragraph",
+ "superBlock",
+ "tabItem",
+ "table",
+ "tabs",
+ "videoBlock",
+ "widgetBlock"
],
"additionalProperties": false
},
- "DocHeadingLevelData": {
+ "CriterionTypesInput": {
"type": "object",
"properties": {
- "counts": {
- "type": "array",
- "items": {
- "type": "integer"
- }
- },
- "title": {
- "type": "string"
- },
- "transaction": {
+ "audioBlock": {
"anyOf": [
{
- "$ref": "#/$defs/BlockTransaction"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "withSubheadingCounts": {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- },
- "required": [
- "counts",
- "title",
- "transaction",
- "withSubheadingCounts"
- ],
- "additionalProperties": false
- },
- "DocHeadingLevelRequestInput": {
- "type": "object",
- "properties": {
- "id": {
+ "blockquote": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "callout": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "source": {
+ "codeBlock": {
"anyOf": [
{
- "type": "integer"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "target": {
+ "databaseBlock": {
"anyOf": [
{
- "type": "integer"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "withSubheadings": {
+ "document": {
"anyOf": [
{
"type": "boolean"
@@ -3928,38 +4871,8 @@
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "DocHistoryContentData": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "isLargeDoc": {
- "type": "boolean"
},
- "rootID": {
- "type": "string"
- }
- },
- "required": [
- "content",
- "id",
- "isLargeDoc",
- "rootID"
- ],
- "additionalProperties": false
- },
- "DocHistoryContentRequestInput": {
- "type": "object",
- "properties": {
- "highlight": {
+ "embedBlock": {
"anyOf": [
{
"type": "boolean"
@@ -3969,446 +4882,236 @@
}
]
},
- "historyPath": {
- "type": "string"
- },
- "k": {
+ "heading": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "historyPath"
- ],
- "additionalProperties": false
- },
- "DocInfo": {
- "type": "object",
- "properties": {
- "attrViews": {
+ },
+ "htmlBlock": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/DocAttrView"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "ial": {
+ "iframeBlock": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "icon": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "refCount": {
- "type": "integer"
- },
- "refIDs": {
+ "list": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "rootID": {
- "type": "string"
- },
- "subFileCount": {
- "type": "integer"
- }
- },
- "required": [
- "attrViews",
- "ial",
- "icon",
- "id",
- "name",
- "refCount",
- "refIDs",
- "rootID",
- "subFileCount"
- ],
- "additionalProperties": false
- },
- "DocOrdersRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "DocVersionDiffContent": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "rootID": {
- "type": "string"
- },
- "title": {
- "type": "string"
- }
- },
- "required": [
- "content",
- "id",
- "rootID",
- "title"
- ],
- "additionalProperties": false
- },
- "DocVersionDiffResult": {
- "type": "object",
- "properties": {
- "differences": {
+ "listItem": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/DocVersionDifference"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "fallback": {
- "type": "boolean"
- },
- "large": {
- "type": "boolean"
- },
- "left": {
+ "mathBlock": {
"anyOf": [
{
- "$ref": "#/$defs/DocVersionDiffContent"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "message": {
- "type": "string"
- },
- "right": {
+ "paragraph": {
"anyOf": [
{
- "$ref": "#/$defs/DocVersionDiffContent"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "titleModified": {
- "type": "boolean"
- }
- },
- "required": [
- "differences",
- "fallback",
- "large",
- "left",
- "message",
- "right",
- "titleModified"
- ],
- "additionalProperties": false
- },
- "DocVersionDifference": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
+ "superBlock": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "statuses": {
+ "tabItem": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "id",
- "statuses"
- ],
- "additionalProperties": false
- },
- "DocVersionRefInput": {
- "type": "object",
- "properties": {
- "id": {
+ },
+ "table": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "path": {
+ "tabs": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "snapshot": {
+ "videoBlock": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "type": {
- "type": "string"
+ "widgetBlock": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "type"
- ],
"additionalProperties": false
},
- "DocsInfoRequestInput": {
+ "DOMData": {
"type": "object",
"properties": {
- "av": {
- "type": "boolean"
- },
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "refCount": {
- "type": "boolean"
+ "dom": {
+ "type": "string"
}
},
"required": [
- "av",
- "ids",
- "refCount"
+ "dom"
],
"additionalProperties": false
},
- "DownloadInstallPkgRequestInput": {
+ "DOMTextRequestInput": {
"type": "object",
"properties": {
- "downloadInstallPkg": {
- "type": "boolean"
+ "dom": {
+ "type": "string"
}
},
"required": [
- "downloadInstallPkg"
+ "dom"
],
"additionalProperties": false
},
- "EditorReadOnlyRequestInput": {
+ "DailyNoteBlockRequestInput": {
"type": "object",
"properties": {
- "readonly": {
- "type": "boolean"
+ "data": {
+ "type": "string"
+ },
+ "dataType": {
+ "type": "string"
+ },
+ "notebook": {
+ "type": "string"
}
},
"required": [
- "readonly"
+ "data",
+ "dataType",
+ "notebook"
],
"additionalProperties": false
},
- "EmbedBlock": {
+ "DeleteBlockRequestInput": {
"type": "object",
"properties": {
- "allowChildOperation": {
- "type": "boolean"
- },
- "block": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
- },
- "blockPaths": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockPath"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string"
}
},
"required": [
- "allowChildOperation",
- "block",
- "blockPaths"
+ "id"
],
"additionalProperties": false
},
- "EmbedBlocksData": {
+ "DiffDocVersionsRequestInput": {
"type": "object",
"properties": {
- "blocks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/EmbedBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "left": {
+ "$ref": "#/$defs/DocVersionRefInput"
+ },
+ "right": {
+ "$ref": "#/$defs/DocVersionRefInput"
}
},
"required": [
- "blocks"
+ "left",
+ "right"
],
"additionalProperties": false
},
- "EmbedStat": {
+ "DirectoryEntry": {
"type": "object",
"properties": {
- "complete": {
+ "isDir": {
"type": "boolean"
},
- "cycleCount": {
- "type": "integer"
- },
- "depthLimitCount": {
- "type": "integer"
- },
- "failedQueryCount": {
- "type": "integer"
- },
- "failedResultCount": {
- "type": "integer"
- },
- "jsEmbedCount": {
- "type": "integer"
- },
- "queryEmbedCount": {
- "type": "integer"
+ "isSymlink": {
+ "type": "boolean"
},
- "resultCount": {
- "type": "integer"
+ "name": {
+ "type": "string"
},
- "truncatedQueryCount": {
+ "updated": {
"type": "integer"
}
},
"required": [
- "complete",
- "cycleCount",
- "depthLimitCount",
- "failedQueryCount",
- "failedResultCount",
- "jsEmbedCount",
- "queryEmbedCount",
- "resultCount",
- "truncatedQueryCount"
+ "isDir",
+ "isSymlink",
+ "name",
+ "updated"
],
"additionalProperties": false
},
- "EmptyRequestInput": {
- "type": "object",
- "additionalProperties": false
- },
- "EncryptedNotebookStatus": {
+ "DocAttrView": {
"type": "object",
"properties": {
"id": {
@@ -4416,90 +5119,55 @@
},
"name": {
"type": "string"
- },
- "state": {
- "type": "string",
- "enum": [
- "Locked",
- "Unlocking",
- "Unlocked",
- "Locking",
- "Error"
- ]
- },
- "unlocked": {
- "type": "boolean"
}
},
"required": [
"id",
- "name",
- "state",
- "unlocked"
+ "name"
],
"additionalProperties": false
},
- "EncryptedNotebookStatusData": {
+ "DocHeadingLevelData": {
"type": "object",
"properties": {
- "boxes": {
+ "counts": {
"type": "array",
"items": {
- "$ref": "#/$defs/EncryptedNotebookStatus"
+ "type": "integer"
}
},
- "count": {
- "type": "integer"
- },
- "enabled": {
- "type": "boolean"
- },
- "hasHistoryDependency": {
- "type": "boolean"
+ "title": {
+ "type": "string"
},
- "migrationBoxes": {
+ "transaction": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
}
]
},
- "migrationPending": {
- "type": "boolean"
- },
- "state": {
- "type": "string",
- "enum": [
- "Disabled",
- "Enabled",
- "RecoveryRequired"
- ]
+ "withSubheadingCounts": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
}
},
"required": [
- "boxes",
- "count",
- "enabled",
- "hasHistoryDependency",
- "migrationBoxes",
- "migrationPending",
- "state"
+ "counts",
+ "title",
+ "transaction",
+ "withSubheadingCounts"
],
"additionalProperties": false
},
- "FileAnnotationRefRequestInput": {
+ "DocHeadingLevelRequestInput": {
"type": "object",
"properties": {
"id": {
- "type": "string"
- },
- "notebook": {
"anyOf": [
{
"type": "string"
@@ -4508,131 +5176,135 @@
"type": "null"
}
]
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "FilePathData": {
- "type": "object",
- "properties": {
- "path": {
- "type": "string"
- }
- },
- "required": [
- "path"
- ],
- "additionalProperties": false
- },
- "FilePathRequestInput": {
- "type": "object",
- "properties": {
- "path": {
- "type": "string"
- }
- },
- "required": [
- "path"
- ],
- "additionalProperties": false
- },
- "FindReplaceRequestInput": {
- "type": "object",
- "properties": {
- "groupBy": {
+ },
+ "notebook": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "k": {
- "type": "string"
- },
- "method": {
+ "source": {
"anyOf": [
{
- "type": "number"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "orderBy": {
+ "target": {
"anyOf": [
{
- "type": "number"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "page": {
+ "withSubheadings": {
"anyOf": [
{
- "type": "number"
+ "type": "boolean"
},
{
"type": "null"
}
]
+ }
+ },
+ "additionalProperties": false
+ },
+ "DocHistoryContentData": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
},
- "pageSize": {
+ "id": {
+ "type": "string"
+ },
+ "isLargeDoc": {
+ "type": "boolean"
+ },
+ "rootID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "id",
+ "isLargeDoc",
+ "rootID"
+ ],
+ "additionalProperties": false
+ },
+ "DocHistoryContentRequestInput": {
+ "type": "object",
+ "properties": {
+ "highlight": {
"anyOf": [
{
- "type": "number"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "paths": {
+ "historyPath": {
+ "type": "string"
+ },
+ "k": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "query": {
+ }
+ },
+ "required": [
+ "historyPath"
+ ],
+ "additionalProperties": false
+ },
+ "DocInfo": {
+ "type": "object",
+ "properties": {
+ "attrViews": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DocAttrView"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "r": {
- "type": "string"
- },
- "replaceTypes": {
+ "ial": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
- "type": "boolean"
+ "type": "string"
}
},
{
@@ -4640,84 +5312,98 @@
}
]
},
- "subTypes": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchSubtypeFilterInput"
- },
- {
- "type": "null"
- }
- ]
+ "icon": {
+ "type": "string"
},
- "types": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "refCount": {
+ "type": "integer"
+ },
+ "refIDs": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
{
"type": "null"
}
]
+ },
+ "rootID": {
+ "type": "string"
+ },
+ "subFileCount": {
+ "type": "integer"
}
},
"required": [
- "ids",
- "k",
- "r"
+ "attrViews",
+ "ial",
+ "icon",
+ "id",
+ "name",
+ "refCount",
+ "refIDs",
+ "rootID",
+ "subFileCount"
],
"additionalProperties": false
},
- "FullBlockInfo": {
+ "DocOrdersRequestInput": {
"type": "object",
"properties": {
- "box": {
+ "id": {
"type": "string"
- },
- "path": {
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "DocVersionDiffContent": {
+ "type": "object",
+ "properties": {
+ "content": {
"type": "string"
},
- "rootChildID": {
+ "id": {
"type": "string"
},
"rootID": {
"type": "string"
},
- "rootIcon": {
- "type": "string"
- },
- "rootTitle": {
+ "title": {
"type": "string"
- },
- "rootTitleEmpty": {
- "type": "boolean"
}
},
"required": [
- "box",
- "path",
- "rootChildID",
+ "content",
+ "id",
"rootID",
- "rootIcon",
- "rootTitle",
- "rootTitleEmpty"
+ "title"
],
"additionalProperties": false
},
- "FullTextSearchBlockData": {
+ "DocVersionDiffResult": {
"type": "object",
"properties": {
- "blocks": {
+ "differences": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/SearchBlock"
+ "$ref": "#/$defs/DocVersionDifference"
},
{
"type": "null"
@@ -4730,141 +5416,63 @@
}
]
},
- "docMode": {
+ "fallback": {
"type": "boolean"
},
- "matchedBlockCount": {
- "type": "integer"
- },
- "matchedRootCount": {
- "type": "integer"
+ "large": {
+ "type": "boolean"
},
- "pageCount": {
- "type": "integer"
- }
- },
- "required": [
- "blocks",
- "docMode",
- "matchedBlockCount",
- "matchedRootCount",
- "pageCount"
- ],
- "additionalProperties": false
- },
- "FullTextSearchBlockRequestInput": {
- "type": "object",
- "properties": {
- "groupBy": {
+ "left": {
"anyOf": [
{
- "type": "number"
+ "$ref": "#/$defs/DocVersionDiffContent"
},
{
"type": "null"
}
]
},
- "method": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
+ "message": {
+ "type": "string"
},
- "notebook": {
+ "right": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/DocVersionDiffContent"
},
{
"type": "null"
}
]
},
- "orderBy": {
+ "titleModified": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "differences",
+ "fallback",
+ "large",
+ "left",
+ "message",
+ "right",
+ "titleModified"
+ ],
+ "additionalProperties": false
+ },
+ "DocVersionDifference": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "statuses": {
"anyOf": [
{
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "page": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "pageSize": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "paths": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "query": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "searchHPath": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "subTypes": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchSubtypeFilterInput"
- },
- {
- "type": "null"
- }
- ]
- },
- "types": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -4872,41 +5480,36 @@
]
}
},
+ "required": [
+ "id",
+ "statuses"
+ ],
"additionalProperties": false
},
- "GetEmbedBlockRequestInput": {
+ "DocVersionRefInput": {
"type": "object",
"properties": {
- "breadcrumb": {
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "embedBlockID": {
- "type": "string"
- },
- "headingMode": {
+ "path": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "includeIDs": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "notebook": {
+ "snapshot": {
"anyOf": [
{
"type": "string"
@@ -4915,134 +5518,93 @@
"type": "null"
}
]
+ },
+ "type": {
+ "type": "string"
}
},
"required": [
- "embedBlockID",
- "includeIDs"
+ "type"
],
"additionalProperties": false
},
- "GetSnippetRequestInput": {
+ "DocsInfoRequestInput": {
"type": "object",
"properties": {
- "enabled": {
- "type": "number"
+ "av": {
+ "type": "boolean"
},
- "keyword": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
- "type": {
- "type": "string"
+ "refCount": {
+ "type": "boolean"
}
},
"required": [
- "enabled",
- "type"
+ "av",
+ "ids",
+ "refCount"
],
"additionalProperties": false
},
- "GetTagRequestInput": {
+ "DownloadInstallPkgRequestInput": {
"type": "object",
"properties": {
- "app": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "ignoreMaxListHint": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "sort": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
+ "downloadInstallPkg": {
+ "type": "boolean"
}
},
+ "required": [
+ "downloadInstallPkg"
+ ],
"additionalProperties": false
},
- "GlobalGraphConf": {
+ "EditorReadOnlyRequestInput": {
"type": "object",
"properties": {
- "d3": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphD3"
- },
- {
- "type": "null"
- }
- ]
- },
- "dailyNote": {
+ "readonly": {
"type": "boolean"
- },
- "minRefs": {
- "type": "integer"
- },
- "type": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphTypeFilter"
- },
- {
- "type": "null"
- }
- ]
}
},
"required": [
- "d3",
- "dailyNote",
- "minRefs",
- "type"
+ "readonly"
],
"additionalProperties": false
},
- "GlobalGraphRequestInput": {
+ "EmbedBlock": {
"type": "object",
"properties": {
- "conf": {
- "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ "allowChildOperation": {
+ "type": "boolean"
},
- "k": {
+ "block": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/SearchBlock"
},
{
"type": "null"
}
]
},
- "reqId": {
+ "blockPaths": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -5051,27 +5613,23 @@
}
},
"required": [
- "conf"
+ "allowChildOperation",
+ "block",
+ "blockPaths"
],
"additionalProperties": false
},
- "GlobalGraphResult": {
+ "EmbedBlocksData": {
"type": "object",
"properties": {
- "box": {
- "type": "string"
- },
- "conf": {
- "$ref": "#/$defs/GlobalGraphConf"
- },
- "links": {
+ "blocks": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/GraphLink"
+ "$ref": "#/$defs/EmbedBlock"
},
{
"type": "null"
@@ -5083,108 +5641,156 @@
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "blocks"
+ ],
+ "additionalProperties": false
+ },
+ "EmbedStat": {
+ "type": "object",
+ "properties": {
+ "complete": {
+ "type": "boolean"
},
- "nodes": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphNode"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "cycleCount": {
+ "type": "integer"
},
- "reqId": {
- "$ref": "#/$defs/JSONValue"
+ "depthLimitCount": {
+ "type": "integer"
+ },
+ "failedQueryCount": {
+ "type": "integer"
+ },
+ "failedResultCount": {
+ "type": "integer"
+ },
+ "jsEmbedCount": {
+ "type": "integer"
+ },
+ "queryEmbedCount": {
+ "type": "integer"
+ },
+ "resultCount": {
+ "type": "integer"
+ },
+ "truncatedQueryCount": {
+ "type": "integer"
}
},
"required": [
- "box",
- "conf",
- "links",
- "nodes",
- "reqId"
+ "complete",
+ "cycleCount",
+ "depthLimitCount",
+ "failedQueryCount",
+ "failedResultCount",
+ "jsEmbedCount",
+ "queryEmbedCount",
+ "resultCount",
+ "truncatedQueryCount"
],
"additionalProperties": false
},
- "GraphArrows": {
+ "EmptyRequestInput": {
"type": "object",
- "properties": {
- "to": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphArrowsTo"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "to"
- ],
"additionalProperties": false
},
- "GraphArrowsTo": {
+ "EncryptedNotebookStatus": {
"type": "object",
"properties": {
- "enabled": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "state": {
+ "type": "string",
+ "enum": [
+ "Locked",
+ "Unlocking",
+ "Unlocked",
+ "Locking",
+ "Error"
+ ]
+ },
+ "unlocked": {
"type": "boolean"
}
},
"required": [
- "enabled"
+ "id",
+ "name",
+ "state",
+ "unlocked"
],
"additionalProperties": false
},
- "GraphConfigurationFieldsInput": {
+ "EncryptedNotebookStatusData": {
"type": "object",
"properties": {
- "d3": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphD3Input"
- },
- {
- "type": "null"
- }
- ]
+ "boxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/EncryptedNotebookStatus"
+ }
},
- "dailyNote": {
+ "count": {
+ "type": "integer"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "hasHistoryDependency": {
+ "type": "boolean"
+ },
+ "migrationBoxes": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "minRefs": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
+ "migrationPending": {
+ "type": "boolean"
+ },
+ "state": {
+ "type": "string",
+ "enum": [
+ "Disabled",
+ "Enabled",
+ "RecoveryRequired"
]
+ }
+ },
+ "required": [
+ "boxes",
+ "count",
+ "enabled",
+ "hasHistoryDependency",
+ "migrationBoxes",
+ "migrationPending",
+ "state"
+ ],
+ "additionalProperties": false
+ },
+ "FileAnnotationRefRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
},
- "type": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/GraphTypeFilterInput"
+ "type": "string"
},
{
"type": "null"
@@ -5192,74 +5798,58 @@
]
}
},
+ "required": [
+ "id"
+ ],
"additionalProperties": false
},
- "GraphCorrelation": {
+ "FilePathData": {
"type": "object",
"properties": {
- "reqId": {
- "$ref": "#/$defs/JSONValue"
+ "path": {
+ "type": "string"
}
},
"required": [
- "reqId"
+ "path"
],
"additionalProperties": false
},
- "GraphD3": {
+ "FilePathRequestInput": {
"type": "object",
"properties": {
- "arrow": {
- "type": "boolean"
- },
- "centerStrength": {
- "type": "number"
- },
- "collideRadius": {
- "type": "number"
- },
- "collideStrength": {
- "type": "number"
- },
- "lineOpacity": {
- "type": "number"
- },
- "linkDistance": {
- "type": "integer"
- },
- "linkWidth": {
- "type": "number"
- },
- "nodeSize": {
- "type": "number"
+ "path": {
+ "type": "string"
}
},
"required": [
- "arrow",
- "centerStrength",
- "collideRadius",
- "collideStrength",
- "lineOpacity",
- "linkDistance",
- "linkWidth",
- "nodeSize"
+ "path"
],
"additionalProperties": false
},
- "GraphD3Input": {
+ "FindReplaceRequestInput": {
"type": "object",
"properties": {
- "arrow": {
+ "groupBy": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "centerStrength": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "k": {
+ "type": "string"
+ },
+ "method": {
"anyOf": [
{
"type": "number"
@@ -5269,7 +5859,7 @@
}
]
},
- "collideRadius": {
+ "orderBy": {
"anyOf": [
{
"type": "number"
@@ -5279,7 +5869,7 @@
}
]
},
- "collideStrength": {
+ "page": {
"anyOf": [
{
"type": "number"
@@ -5289,7 +5879,7 @@
}
]
},
- "lineOpacity": {
+ "pageSize": {
"anyOf": [
{
"type": "number"
@@ -5299,249 +5889,244 @@
}
]
},
- "linkDistance": {
+ "paths": {
"anyOf": [
{
- "type": "integer"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "linkWidth": {
+ "query": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "nodeSize": {
+ "r": {
+ "type": "string"
+ },
+ "replaceTypes": {
"anyOf": [
{
- "type": "number"
- },
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
+ },
{
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "GraphLink": {
- "type": "object",
- "properties": {
- "arrows": {
+ },
+ "subTypes": {
"anyOf": [
{
- "$ref": "#/$defs/GraphArrows"
+ "$ref": "#/$defs/SearchSubtypeFilterInput"
},
{
"type": "null"
}
]
},
- "from": {
- "type": "string"
- },
- "ref": {
- "type": "boolean"
- },
- "to": {
- "type": "string"
+ "types": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "arrows",
- "from",
- "ref",
- "to"
+ "ids",
+ "k",
+ "r"
],
"additionalProperties": false
},
- "GraphNode": {
+ "FullBlockInfo": {
"type": "object",
"properties": {
"box": {
"type": "string"
},
- "defs": {
- "type": "integer"
- },
- "id": {
+ "path": {
"type": "string"
},
- "label": {
+ "rootChildID": {
"type": "string"
},
- "path": {
+ "rootID": {
"type": "string"
},
- "refs": {
- "type": "integer"
- },
- "size": {
- "type": "number"
- },
- "title": {
+ "rootIcon": {
"type": "string"
},
- "type": {
+ "rootTitle": {
"type": "string"
+ },
+ "rootTitleEmpty": {
+ "type": "boolean"
}
},
"required": [
"box",
- "defs",
- "id",
- "label",
"path",
- "refs",
- "size",
- "type"
+ "rootChildID",
+ "rootID",
+ "rootIcon",
+ "rootTitle",
+ "rootTitleEmpty"
],
"additionalProperties": false
},
- "GraphTypeFilter": {
+ "FullTextSearchBlockData": {
"type": "object",
"properties": {
- "blockquote": {
- "type": "boolean"
- },
- "callout": {
- "type": "boolean"
- },
- "code": {
- "type": "boolean"
- },
- "heading": {
- "type": "boolean"
- },
- "list": {
- "type": "boolean"
- },
- "listItem": {
- "type": "boolean"
- },
- "math": {
- "type": "boolean"
+ "blocks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "paragraph": {
+ "docMode": {
"type": "boolean"
},
- "super": {
- "type": "boolean"
+ "matchedBlockCount": {
+ "type": "integer"
},
- "table": {
- "type": "boolean"
+ "matchedRootCount": {
+ "type": "integer"
},
- "tag": {
- "type": "boolean"
+ "pageCount": {
+ "type": "integer"
}
},
"required": [
- "blockquote",
- "callout",
- "code",
- "heading",
- "list",
- "listItem",
- "math",
- "paragraph",
- "super",
- "table",
- "tag"
+ "blocks",
+ "docMode",
+ "matchedBlockCount",
+ "matchedRootCount",
+ "pageCount"
],
"additionalProperties": false
},
- "GraphTypeFilterInput": {
+ "FullTextSearchBlockRequestInput": {
"type": "object",
"properties": {
- "blockquote": {
+ "groupBy": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "callout": {
+ "method": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "code": {
+ "notebook": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "heading": {
+ "orderBy": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "list": {
+ "page": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "listItem": {
+ "pageSize": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "math": {
+ "paths": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
},
- "paragraph": {
+ "query": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "super": {
+ "searchHPath": {
"anyOf": [
{
"type": "boolean"
@@ -5551,20 +6136,23 @@
}
]
},
- "table": {
+ "subTypes": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/SearchSubtypeFilterInput"
},
{
"type": "null"
}
]
},
- "tag": {
+ "types": {
"anyOf": [
{
- "type": "boolean"
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
},
{
"type": "null"
@@ -5574,35 +6162,81 @@
},
"additionalProperties": false
},
- "HTMLClipboardPreflight": {
+ "GetBazaarIconRequestInput": {
"type": "object",
"properties": {
- "converted": {
- "type": "boolean"
- },
- "dom": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "GetBazaarPackageREADMERequestInput": {
+ "type": "object",
+ "properties": {
+ "packageType": {
"type": "string"
},
- "normalizedHTML": {
+ "repoHash": {
"type": "string"
},
- "useHTML": {
- "type": "boolean"
+ "repoURL": {
+ "type": "string"
}
},
"required": [
- "converted",
- "useHTML"
+ "packageType",
+ "repoHash",
+ "repoURL"
],
"additionalProperties": false
},
- "HTMLClipboardRequestInput": {
+ "GetBazaarPackageRatingRequestInput": {
"type": "object",
"properties": {
- "dom": {
+ "packageName": {
"type": "string"
},
- "mathML": {
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "GetBazaarPackageRatingsRequestInput": {
+ "type": "object",
+ "properties": {
+ "packageNames": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageNames",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "GetBazaarPackageRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
"anyOf": [
{
"type": "string"
@@ -5612,17 +6246,45 @@
}
]
},
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "packageName": {
+ "type": "string"
},
- "office": {
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "GetBazaarPackageUserRatingsRequestInput": {
+ "type": "object",
+ "properties": {
+ "packageNames": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageNames",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "GetBazaarPluginRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
+ "type": "string"
+ },
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -5631,8 +6293,17 @@
"type": "null"
}
]
- },
- "officeMathHTML": {
+ }
+ },
+ "required": [
+ "frontend"
+ ],
+ "additionalProperties": false
+ },
+ "GetBazaarTemplateRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -5641,38 +6312,56 @@
"type": "null"
}
]
- },
- "preflight": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "GetBazaarThemeRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "preparedHTML": {
+ "keyword": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "preserveSourceFormat": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "GetBazaarWidgetRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "skipBase64Assets": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "GetEmbedBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "breadcrumb": {
"anyOf": [
{
"type": "boolean"
@@ -5682,27 +6371,26 @@
}
]
},
- "skipInlineSVGAssets": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "embedBlockID": {
+ "type": "string"
},
- "skipLocalAssets": {
+ "headingMode": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "text": {
+ "includeIDs": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "notebook": {
"anyOf": [
{
"type": "string"
@@ -5711,8 +6399,18 @@
"type": "null"
}
]
- },
- "wps": {
+ }
+ },
+ "required": [
+ "embedBlockID",
+ "includeIDs"
+ ],
+ "additionalProperties": false
+ },
+ "GetInstalledIconRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -5723,33 +6421,34 @@
]
}
},
- "required": [
- "dom"
- ],
"additionalProperties": false
},
- "HTMLData": {
+ "GetInstalledPackageSizeRequestInput": {
"type": "object",
"properties": {
- "html": {
+ "packageName": {
+ "type": "string"
+ },
+ "packageType": {
"type": "string"
}
},
"required": [
- "html"
+ "packageName",
+ "packageType"
],
"additionalProperties": false
},
- "HeadingChildrenRequestInput": {
+ "GetInstalledPluginRequestInput": {
"type": "object",
"properties": {
- "id": {
+ "frontend": {
"type": "string"
},
- "removeFoldAttr": {
+ "keyword": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
@@ -5758,51 +6457,30 @@
}
},
"required": [
- "id"
- ],
- "additionalProperties": false
- },
- "HeadingFoldRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- },
- "scope": {
- "type": "string"
- }
- },
- "required": [
- "id",
- "scope"
+ "frontend"
],
"additionalProperties": false
},
- "HeadingLevelRequestInput": {
+ "GetInstalledTemplateRequestInput": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "level": {
- "type": "number"
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "level"
- ],
"additionalProperties": false
},
- "HeadingNumbersRequestInput": {
+ "GetInstalledThemeRequestInput": {
"type": "object",
"properties": {
- "id": {
+ "frontend": {
"anyOf": [
{
"type": "string"
@@ -5812,7 +6490,7 @@
}
]
},
- "notebook": {
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -5825,26 +6503,13 @@
},
"additionalProperties": false
},
- "History": {
+ "GetInstalledWidgetRequestInput": {
"type": "object",
"properties": {
- "hCreated": {
- "type": "string"
- },
- "items": {
+ "keyword": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/HistoryItem"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "string"
},
{
"type": "null"
@@ -5852,106 +6517,58 @@
]
}
},
- "required": [
- "hCreated",
- "items"
- ],
"additionalProperties": false
},
- "HistoryItem": {
+ "GetSnippetRequestInput": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "notebook": {
- "type": "string"
- },
- "op": {
- "type": "string"
+ "enabled": {
+ "type": "number"
},
- "path": {
- "type": "string"
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "title": {
+ "type": {
"type": "string"
}
},
"required": [
- "id",
- "notebook",
- "op",
- "path",
- "title"
+ "enabled",
+ "type"
],
"additionalProperties": false
},
- "HistoryItemsData": {
+ "GetTagRequestInput": {
"type": "object",
"properties": {
- "items": {
+ "app": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/HistoryItem"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "items"
- ],
- "additionalProperties": false
- },
- "HistoryItemsRequestInput": {
- "type": "object",
- "properties": {
- "created": {
- "type": "string"
- },
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "op": {
- "anyOf": [
- {
- "type": "string"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "query": {
+ "ignoreMaxListHint": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "type": {
+ "sort": {
"anyOf": [
{
"type": "number"
@@ -5962,78 +6579,107 @@
]
}
},
- "required": [
- "created"
- ],
"additionalProperties": false
},
- "HistoryPathRequestInput": {
+ "GetUpdatedPackageRequestInput": {
"type": "object",
"properties": {
- "historyPath": {
+ "frontend": {
"type": "string"
}
},
"required": [
- "historyPath"
+ "frontend"
],
"additionalProperties": false
},
- "ImportAutoDocument": {
+ "GlobalGraphConf": {
"type": "object",
"properties": {
- "token": {
- "type": "string"
+ "d3": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphD3"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "dailyNote": {
+ "type": "boolean"
+ },
+ "minRefs": {
+ "type": "integer"
},
"type": {
- "type": "string",
- "enum": [
- "document"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphTypeFilter"
+ },
+ {
+ "type": "null"
+ }
]
}
},
"required": [
+ "d3",
+ "dailyNote",
+ "minRefs",
"type"
],
"additionalProperties": false
},
- "ImportAutoNotebook": {
+ "GlobalGraphRequestInput": {
"type": "object",
"properties": {
- "notebook": {
+ "conf": {
+ "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ },
+ "k": {
"anyOf": [
{
- "$ref": "#/$defs/Notebook"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "type": {
- "type": "string",
- "enum": [
- "notebook"
+ "reqId": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/JSONValue"
+ },
+ {
+ "type": "null"
+ }
]
}
},
"required": [
- "notebook",
- "type"
+ "conf"
],
"additionalProperties": false
},
- "ImportAutoNotebooks": {
+ "GlobalGraphResult": {
"type": "object",
"properties": {
- "notebooks": {
+ "box": {
+ "type": "string"
+ },
+ "conf": {
+ "$ref": "#/$defs/GlobalGraphConf"
+ },
+ "links": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/Notebook"
+ "$ref": "#/$defs/GraphLink"
},
{
"type": "null"
@@ -6046,54 +6692,84 @@
}
]
},
- "type": {
- "type": "string",
- "enum": [
- "notebooks"
+ "nodes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphNode"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
]
+ },
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
}
},
"required": [
- "notebooks",
- "type"
+ "box",
+ "conf",
+ "links",
+ "nodes",
+ "reqId"
],
"additionalProperties": false
},
- "ImportDataRequestInput": {
+ "GraphArrows": {
"type": "object",
"properties": {
- "file": {
- "type": "string",
- "format": "binary"
+ "to": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphArrowsTo"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
+ "required": [
+ "to"
+ ],
"additionalProperties": false
},
- "ImportDocumentData": {
+ "GraphArrowsTo": {
"type": "object",
"properties": {
- "type": {
- "type": "string",
- "enum": [
- "document"
- ]
+ "enabled": {
+ "type": "boolean"
}
},
"required": [
- "type"
+ "enabled"
],
"additionalProperties": false
},
- "ImportMarkdownRequestInput": {
+ "GraphConfigurationFieldsInput": {
"type": "object",
"properties": {
- "localPath": {
- "type": "string"
- },
- "notebook": {
- "type": "string"
+ "d3": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphD3Input"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "skipRoot": {
+ "dailyNote": {
"anyOf": [
{
"type": "boolean"
@@ -6103,298 +6779,158 @@
}
]
},
- "toPath": {
- "type": "string"
+ "minRefs": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphTypeFilterInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "localPath",
- "notebook",
- "toPath"
- ],
"additionalProperties": false
},
- "ImportNotebookCryptoBackupRequestInput": {
+ "GraphCorrelation": {
"type": "object",
"properties": {
- "file": {
- "type": "string",
- "format": "binary"
- },
- "password": {
- "type": "string"
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
}
},
"required": [
- "file"
+ "reqId"
],
"additionalProperties": false
},
- "ImportSYRequestInput": {
+ "GraphD3": {
"type": "object",
"properties": {
- "file": {
- "type": "string",
- "format": "binary"
+ "arrow": {
+ "type": "boolean"
},
- "notebook": {
- "type": "string"
+ "centerStrength": {
+ "type": "number"
},
- "toPath": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "ImportTokenRequestInput": {
- "type": "object",
- "properties": {
- "token": {
- "type": "string"
- }
- },
- "required": [
- "token"
- ],
- "additionalProperties": false
- },
- "ImportZipMarkdownRequestInput": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string",
- "format": "binary"
+ "collideRadius": {
+ "type": "number"
},
- "notebook": {
- "type": "string"
+ "collideStrength": {
+ "type": "number"
},
- "skipRoot": {
- "type": "string"
+ "lineOpacity": {
+ "type": "number"
},
- "toPath": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "ImportedNotebook": {
- "type": "object",
- "properties": {
- "notebook": {
- "anyOf": [
- {
- "$ref": "#/$defs/Notebook"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "notebook"
- ],
- "additionalProperties": false
- },
- "ImportedNotebooks": {
- "type": "object",
- "properties": {
- "notebooks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Notebook"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "linkDistance": {
+ "type": "integer"
+ },
+ "linkWidth": {
+ "type": "number"
+ },
+ "nodeSize": {
+ "type": "number"
}
},
"required": [
- "notebooks"
+ "arrow",
+ "centerStrength",
+ "collideRadius",
+ "collideStrength",
+ "lineOpacity",
+ "linkDistance",
+ "linkWidth",
+ "nodeSize"
],
"additionalProperties": false
},
- "InlineStyle": {
+ "GraphD3Input": {
"type": "object",
"properties": {
- "dark": {
+ "arrow": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleTheme"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "hidden": {
- "type": "boolean"
- },
- "id": {
- "type": "string"
- },
- "light": {
+ "centerStrength": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleTheme"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "name": {
- "type": "string"
- }
- },
- "required": [
- "dark",
- "id",
- "light",
- "name"
- ],
- "additionalProperties": false
- },
- "InlineStyleAV": {
- "type": "object",
- "properties": {
- "colors": {
+ "collideRadius": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AttributeViewCustomColor"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "number"
},
{
"type": "null"
}
]
},
- "order": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "required": [
- "colors",
- "order"
- ],
- "additionalProperties": false
- },
- "InlineStyleAVInput": {
- "type": "object",
- "properties": {
- "colors": {
+ "collideStrength": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AttributeViewCustomColorInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "number"
},
{
"type": "null"
}
]
},
- "order": {
+ "lineOpacity": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "number"
},
{
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "InlineStyleBuiltin": {
- "type": "object",
- "properties": {
- "colors": {
+ },
+ "linkDistance": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleBuiltinColor"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "hidden": {
+ "linkWidth": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleBuiltinHidden"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "styles": {
+ "nodeSize": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleBuiltinStyle"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "number"
},
{
"type": "null"
@@ -6402,252 +6938,241 @@
]
}
},
- "required": [
- "colors",
- "hidden",
- "styles"
- ],
"additionalProperties": false
},
- "InlineStyleBuiltinColor": {
+ "GraphLink": {
"type": "object",
"properties": {
- "dark": {
+ "arrows": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleTheme"
+ "$ref": "#/$defs/GraphArrows"
},
{
"type": "null"
}
]
},
- "index": {
- "type": "integer"
+ "from": {
+ "type": "string"
},
- "light": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleTheme"
- },
- {
- "type": "null"
- }
- ]
+ "ref": {
+ "type": "boolean"
+ },
+ "to": {
+ "type": "string"
}
},
"required": [
- "dark",
- "index",
- "light"
+ "arrows",
+ "from",
+ "ref",
+ "to"
],
"additionalProperties": false
},
- "InlineStyleBuiltinColorInput": {
+ "GraphNode": {
"type": "object",
"properties": {
- "dark": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleThemeInput"
- },
- {
- "type": "null"
- }
- ]
+ "box": {
+ "type": "string"
},
- "index": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ]
+ "defs": {
+ "type": "integer"
},
- "light": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleThemeInput"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string"
+ },
+ "label": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "refs": {
+ "type": "integer"
+ },
+ "size": {
+ "type": "number"
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
}
},
+ "required": [
+ "box",
+ "defs",
+ "id",
+ "label",
+ "path",
+ "refs",
+ "size",
+ "type"
+ ],
"additionalProperties": false
},
- "InlineStyleBuiltinHidden": {
+ "GraphTypeFilter": {
"type": "object",
"properties": {
- "av": {
+ "blockquote": {
+ "type": "boolean"
+ },
+ "callout": {
+ "type": "boolean"
+ },
+ "code": {
+ "type": "boolean"
+ },
+ "heading": {
+ "type": "boolean"
+ },
+ "list": {
+ "type": "boolean"
+ },
+ "listItem": {
+ "type": "boolean"
+ },
+ "math": {
+ "type": "boolean"
+ },
+ "paragraph": {
+ "type": "boolean"
+ },
+ "super": {
+ "type": "boolean"
+ },
+ "table": {
+ "type": "boolean"
+ },
+ "tag": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "blockquote",
+ "callout",
+ "code",
+ "heading",
+ "list",
+ "listItem",
+ "math",
+ "paragraph",
+ "super",
+ "table",
+ "tag"
+ ],
+ "additionalProperties": false
+ },
+ "GraphTypeFilterInput": {
+ "type": "object",
+ "properties": {
+ "blockquote": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "backgroundColor": {
+ "callout": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "color": {
+ "code": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "style1": {
+ "heading": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "av",
- "backgroundColor",
- "color",
- "style1"
- ],
- "additionalProperties": false
- },
- "InlineStyleBuiltinHiddenInput": {
- "type": "object",
- "properties": {
- "av": {
+ },
+ "list": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "backgroundColor": {
+ "listItem": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "color": {
+ "math": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "integer"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "style1": {
+ "paragraph": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "InlineStyleBuiltinInput": {
- "type": "object",
- "properties": {
- "colors": {
+ },
+ "super": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleBuiltinColorInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "hidden": {
+ "table": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleBuiltinHiddenInput"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "styles": {
+ "tag": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleBuiltinStyleInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
@@ -6657,54 +7182,65 @@
},
"additionalProperties": false
},
- "InlineStyleBuiltinStyle": {
+ "HTMLClipboardPreflight": {
"type": "object",
"properties": {
- "dark": {
+ "converted": {
+ "type": "boolean"
+ },
+ "dom": {
+ "type": "string"
+ },
+ "normalizedHTML": {
+ "type": "string"
+ },
+ "useHTML": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "converted",
+ "useHTML"
+ ],
+ "additionalProperties": false
+ },
+ "HTMLClipboardRequestInput": {
+ "type": "object",
+ "properties": {
+ "dom": {
+ "type": "string"
+ },
+ "mathML": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleTheme"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "id": {
- "type": "string"
- },
- "light": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleTheme"
+ "type": "string"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "dark",
- "id",
- "light"
- ],
- "additionalProperties": false
- },
- "InlineStyleBuiltinStyleInput": {
- "type": "object",
- "properties": {
- "dark": {
+ },
+ "office": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "id": {
+ "officeMathHTML": {
"anyOf": [
{
"type": "string"
@@ -6714,33 +7250,27 @@
}
]
},
- "light": {
+ "preflight": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "InlineStyleInput": {
- "type": "object",
- "properties": {
- "dark": {
+ },
+ "preparedHTML": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "hidden": {
+ "preserveSourceFormat": {
"anyOf": [
{
"type": "boolean"
@@ -6750,75 +7280,84 @@
}
]
},
- "id": {
+ "skipBase64Assets": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "light": {
+ "skipInlineSVGAssets": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "name": {
+ "skipLocalAssets": {
"anyOf": [
{
- "type": "string"
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "InlineStyleOrder": {
- "type": "object",
- "properties": {
- "backgroundColor": {
+ },
+ "text": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "color": {
+ "wps": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "dom"
+ ],
+ "additionalProperties": false
+ },
+ "HTMLData": {
+ "type": "object",
+ "properties": {
+ "html": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "html"
+ ],
+ "additionalProperties": false
+ },
+ "HeadingChildrenRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
},
- "style1": {
+ "removeFoldAttr": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "boolean"
},
{
"type": "null"
@@ -6827,47 +7366,92 @@
}
},
"required": [
- "backgroundColor",
- "color",
- "style1"
+ "id"
],
"additionalProperties": false
},
- "InlineStyleOrderInput": {
+ "HeadingFoldRequestInput": {
"type": "object",
"properties": {
- "backgroundColor": {
+ "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
+ },
+ "HeadingNumbersRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "color": {
+ "notebook": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ }
+ },
+ "additionalProperties": false
+ },
+ "History": {
+ "type": "object",
+ "properties": {
+ "hCreated": {
+ "type": "string"
},
- "style1": {
+ "items": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/HistoryItem"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -6876,37 +7460,57 @@
]
}
},
+ "required": [
+ "hCreated",
+ "items"
+ ],
"additionalProperties": false
},
- "InlineStyleTheme": {
+ "HistoryItem": {
"type": "object",
"properties": {
- "backgroundColor": {
+ "id": {
"type": "string"
},
- "color": {
+ "notebook": {
+ "type": "string"
+ },
+ "op": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "title": {
"type": "string"
}
},
+ "required": [
+ "id",
+ "notebook",
+ "op",
+ "path",
+ "title"
+ ],
"additionalProperties": false
},
- "InlineStyleThemeInput": {
+ "HistoryItemsData": {
"type": "object",
"properties": {
- "backgroundColor": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "color": {
+ "items": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/HistoryItem"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -6914,174 +7518,122 @@
]
}
},
+ "required": [
+ "items"
+ ],
"additionalProperties": false
},
- "InlineStyles": {
+ "HistoryItemsRequestInput": {
"type": "object",
"properties": {
- "av": {
+ "created": {
+ "type": "string"
+ },
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleAV"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "builtin": {
+ "op": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleBuiltin"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "order": {
+ "query": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleOrder"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "styles": {
+ "type": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyle"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "number"
},
{
"type": "null"
}
]
- },
- "version": {
- "type": "integer"
}
},
"required": [
- "av",
- "builtin",
- "order",
- "styles",
- "version"
+ "created"
],
"additionalProperties": false
},
- "InsertBlockRequestInput": {
+ "HistoryPathRequestInput": {
"type": "object",
"properties": {
- "data": {
- "type": "string"
- },
- "dataType": {
+ "historyPath": {
"type": "string"
- },
- "nextID": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "parentID": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "previousID": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
}
},
"required": [
- "data",
- "dataType"
+ "historyPath"
],
"additionalProperties": false
},
- "JSONValue": {
- "anyOf": [
- {
- "type": "null"
- },
- {
- "type": "boolean"
- },
- {
- "type": "number"
- },
- {
+ "ImportAutoDocument": {
+ "type": "object",
+ "properties": {
+ "token": {
"type": "string"
},
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
+ "type": {
+ "type": "string",
+ "enum": [
+ "document"
+ ]
}
- ]
+ },
+ "required": [
+ "type"
+ ],
+ "additionalProperties": false
},
- "KernelPetal": {
+ "ImportAutoNotebook": {
"type": "object",
"properties": {
- "existed": {
- "type": "boolean"
- },
- "incompatible": {
- "type": "boolean"
+ "notebook": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Notebook"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "js": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "notebook"
+ ]
}
},
"required": [
- "existed",
- "incompatible",
- "js"
+ "notebook",
+ "type"
],
"additionalProperties": false
},
- "ListNotebooksData": {
+ "ImportAutoNotebooks": {
"type": "object",
"properties": {
- "boxDocEnabled": {
- "type": "boolean"
- },
"notebooks": {
"anyOf": [
{
@@ -7101,208 +7653,238 @@
"type": "null"
}
]
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "notebooks"
+ ]
}
},
"required": [
- "boxDocEnabled",
- "notebooks"
+ "notebooks",
+ "type"
],
"additionalProperties": false
},
- "ListNotebooksRequestInput": {
+ "ImportDataRequestInput": {
"type": "object",
"properties": {
- "flashcard": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "file": {
+ "type": "string",
+ "format": "binary"
}
},
"additionalProperties": false
},
- "LoadPetalsRequestInput": {
+ "ImportDocumentData": {
"type": "object",
"properties": {
- "frontend": {
- "type": "string"
+ "type": {
+ "type": "string",
+ "enum": [
+ "document"
+ ]
}
},
"required": [
- "frontend"
+ "type"
],
"additionalProperties": false
},
- "LoadedPlugin": {
+ "ImportMarkdownRequestInput": {
"type": "object",
"properties": {
- "methods": {
+ "localPath": {
+ "type": "string"
+ },
+ "notebook": {
+ "type": "string"
+ },
+ "skipRoot": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCMethod"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "name": {
- "type": "string"
- },
- "state": {
+ "toPath": {
"type": "string"
- },
- "stateCode": {
- "type": "integer"
}
},
"required": [
- "methods",
- "name",
- "state",
- "stateCode"
+ "localPath",
+ "notebook",
+ "toPath"
],
"additionalProperties": false
},
- "LoadedPluginRequestInput": {
+ "ImportNotebookCryptoBackupRequestInput": {
"type": "object",
"properties": {
- "name": {
+ "file": {
+ "type": "string",
+ "format": "binary"
+ },
+ "password": {
"type": "string"
}
},
"required": [
- "name"
+ "file"
],
"additionalProperties": false
},
- "LocalGraphConf": {
+ "ImportSYRequestInput": {
"type": "object",
"properties": {
- "d3": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphD3"
- },
- {
- "type": "null"
- }
- ]
+ "file": {
+ "type": "string",
+ "format": "binary"
},
- "dailyNote": {
- "type": "boolean"
+ "notebook": {
+ "type": "string"
},
- "type": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphTypeFilter"
- },
- {
- "type": "null"
- }
- ]
+ "toPath": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ImportTokenRequestInput": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string"
}
},
"required": [
- "d3",
- "dailyNote",
- "type"
+ "token"
],
"additionalProperties": false
},
- "LocalGraphRequestInput": {
+ "ImportZipMarkdownRequestInput": {
"type": "object",
"properties": {
- "conf": {
- "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ "file": {
+ "type": "string",
+ "format": "binary"
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "notebook": {
+ "type": "string"
},
- "k": {
+ "skipRoot": {
+ "type": "string"
+ },
+ "toPath": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "ImportedNotebook": {
+ "type": "object",
+ "properties": {
+ "notebook": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/Notebook"
},
{
"type": "null"
}
]
- },
- "notebook": {
+ }
+ },
+ "required": [
+ "notebook"
+ ],
+ "additionalProperties": false
+ },
+ "ImportedNotebooks": {
+ "type": "object",
+ "properties": {
+ "notebooks": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Notebook"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "reqId": {
+ }
+ },
+ "required": [
+ "notebooks"
+ ],
+ "additionalProperties": false
+ },
+ "InlineStyle": {
+ "type": "object",
+ "properties": {
+ "dark": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "$ref": "#/$defs/InlineStyleTheme"
},
{
"type": "null"
}
]
},
- "type": {
+ "hidden": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "light": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleTheme"
},
{
"type": "null"
}
]
+ },
+ "name": {
+ "type": "string"
}
},
+ "required": [
+ "dark",
+ "id",
+ "light",
+ "name"
+ ],
"additionalProperties": false
},
- "LocalGraphResult": {
+ "InlineStyleAV": {
"type": "object",
"properties": {
- "box": {
- "type": "string"
- },
- "conf": {
- "$ref": "#/$defs/LocalGraphConf"
- },
- "id": {
- "type": "string"
- },
- "links": {
+ "colors": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/GraphLink"
+ "$ref": "#/$defs/AttributeViewCustomColor"
},
{
"type": "null"
@@ -7315,62 +7897,56 @@
}
]
},
- "nodes": {
+ "order": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/GraphNode"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
"type": "null"
}
]
- },
- "reqId": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- "required": [
- "box",
- "conf",
- "id",
- "links",
- "nodes",
- "reqId"
- ],
- "additionalProperties": false
- },
- "LockScreenRequestInput": {
- "type": "object",
- "properties": {
- "lockScreenMode": {
- "type": "number"
}
},
"required": [
- "lockScreenMode"
+ "colors",
+ "order"
],
"additionalProperties": false
},
- "MarkdownHTMLRequestInput": {
+ "InlineStyleAVInput": {
"type": "object",
"properties": {
- "markdown": {
- "type": "string"
+ "colors": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AttributeViewCustomColorInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "mode": {
+ "order": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -7378,31 +7954,55 @@
]
}
},
- "required": [
- "markdown"
- ],
"additionalProperties": false
},
- "MoveBlockRequestInput": {
+ "InlineStyleBuiltin": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
+ "colors": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleBuiltinColor"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "parentID": {
+ "hidden": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleBuiltinHidden"
},
{
"type": "null"
}
]
},
- "previousID": {
+ "styles": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleBuiltinStyle"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -7411,20 +8011,32 @@
}
},
"required": [
- "id"
+ "colors",
+ "hidden",
+ "styles"
],
"additionalProperties": false
},
- "NetImageAssetsRequestInput": {
+ "InlineStyleBuiltinColor": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
+ "dark": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleTheme"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "url": {
+ "index": {
+ "type": "integer"
+ },
+ "light": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleTheme"
},
{
"type": "null"
@@ -7433,394 +8045,246 @@
}
},
"required": [
- "id"
+ "dark",
+ "index",
+ "light"
],
"additionalProperties": false
},
- "NetworkData": {
+ "InlineStyleBuiltinColorInput": {
"type": "object",
"properties": {
- "proxy": {
+ "dark": {
"anyOf": [
{
- "$ref": "#/$defs/NetworkProxy"
+ "$ref": "#/$defs/InlineStyleThemeInput"
},
{
"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": {
+ "index": {
"anyOf": [
{
- "$ref": "#/$defs/NotebookEncryption"
+ "type": "integer"
},
{
"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": {
+ "light": {
"anyOf": [
{
- "$ref": "#/$defs/NotebookConf"
+ "$ref": "#/$defs/InlineStyleThemeInput"
},
{
"type": "null"
}
]
- },
- "name": {
- "type": "string"
}
},
- "required": [
- "box",
- "conf",
- "name"
- ],
"additionalProperties": false
},
- "NotebookConfPatchInput": {
+ "InlineStyleBuiltinHidden": {
"type": "object",
"properties": {
- "boxCrypt": {
+ "av": {
"anyOf": [
{
- "$ref": "#/$defs/NotebookEncryptionPatchInput"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "closed": {
+ "backgroundColor": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "dailyNoteSavePath": {
+ "color": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "dailyNoteTemplatePath": {
+ "style1": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
- },
- "docCreateSaveBox": {
+ }
+ },
+ "required": [
+ "av",
+ "backgroundColor",
+ "color",
+ "style1"
+ ],
+ "additionalProperties": false
+ },
+ "InlineStyleBuiltinHiddenInput": {
+ "type": "object",
+ "properties": {
+ "av": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "docCreateSavePath": {
+ "backgroundColor": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "docCreateTemplatePath": {
+ "color": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
},
{
"type": "null"
}
]
},
- "encrypted": {
+ "style1": {
"anyOf": [
{
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
}
]
- },
- "icon": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "InlineStyleBuiltinInput": {
+ "type": "object",
+ "properties": {
+ "colors": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleBuiltinColorInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "name": {
+ "hidden": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleBuiltinHiddenInput"
},
{
"type": "null"
}
]
},
- "refCreateSaveBox": {
+ "styles": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleBuiltinStyleInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
- },
- "refCreateSavePath": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "InlineStyleBuiltinStyle": {
+ "type": "object",
+ "properties": {
+ "dark": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleTheme"
},
{
"type": "null"
}
]
},
- "sort": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string"
},
- "sortMode": {
+ "light": {
"anyOf": [
{
- "type": "integer"
+ "$ref": "#/$defs/InlineStyleTheme"
},
{
"type": "null"
@@ -7828,45 +8292,27 @@
]
}
},
- "additionalProperties": false
- },
- "NotebookCryptoAutoLockRequestInput": {
- "type": "object",
- "properties": {
- "autoLockMinutes": {
- "type": "number"
- }
- },
- "required": [
- "autoLockMinutes"
- ],
- "additionalProperties": false
- },
- "NotebookCryptoBackupData": {
- "type": "object",
- "properties": {
- "file": {
- "type": "string"
- }
- },
"required": [
- "file"
+ "dark",
+ "id",
+ "light"
],
"additionalProperties": false
},
- "NotebookEncryption": {
+ "InlineStyleBuiltinStyleInput": {
"type": "object",
"properties": {
- "createdAt": {
- "type": "integer"
- },
- "metadata": {
- "type": "string"
- },
- "spec": {
- "type": "integer"
+ "dark": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleThemeInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "wrapNonce": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -7876,10 +8322,10 @@
}
]
},
- "wrappedDEK": {
+ "light": {
"anyOf": [
{
- "type": "string"
+ "$ref": "#/$defs/InlineStyleThemeInput"
},
{
"type": "null"
@@ -7887,91 +8333,55 @@
]
}
},
- "required": [
- "createdAt",
- "spec",
- "wrapNonce",
- "wrappedDEK"
- ],
"additionalProperties": false
},
- "NotebookEncryptionPatchInput": {
+ "InlineStyleInput": {
"type": "object",
"properties": {
- "createdAt": {
+ "dark": {
"anyOf": [
{
- "type": "integer"
+ "$ref": "#/$defs/InlineStyleThemeInput"
},
{
"type": "null"
}
]
},
- "metadata": {
+ "hidden": {
"anyOf": [
{
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- ]
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "spec": {
+ "id": {
"anyOf": [
{
- "type": "integer"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "wrapNonce": {
+ "light": {
"anyOf": [
{
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- ]
+ "$ref": "#/$defs/InlineStyleThemeInput"
},
{
"type": "null"
}
]
},
- "wrappedDEK": {
+ "name": {
"anyOf": [
{
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "type": "integer"
- }
- }
- ]
+ "type": "string"
},
{
"type": "null"
@@ -7981,22 +8391,41 @@
},
"additionalProperties": false
},
- "NotebookHistoryData": {
+ "InlineStyleOrder": {
"type": "object",
"properties": {
- "histories": {
+ "backgroundColor": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/History"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "color": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "style1": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
{
@@ -8006,73 +8435,48 @@
}
},
"required": [
- "histories"
+ "backgroundColor",
+ "color",
+ "style1"
],
"additionalProperties": false
},
- "NotebookIDRequestInput": {
+ "InlineStyleOrderInput": {
"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"
+ "backgroundColor": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "name": {
- "type": "string"
+ "color": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "size": {
- "type": "integer"
- }
- },
- "required": [
- "ctime",
- "docCount",
- "hCtime",
- "hMtime",
- "hSize",
- "id",
- "mtime",
- "name",
- "size"
- ],
- "additionalProperties": false
- },
- "NotebookInfoData": {
- "type": "object",
- "properties": {
- "boxInfo": {
+ "style1": {
"anyOf": [
{
- "$ref": "#/$defs/NotebookInfo"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -8080,45 +8484,37 @@
]
}
},
- "required": [
- "boxInfo"
- ],
"additionalProperties": false
},
- "NotebookPasswordRequestInput": {
+ "InlineStyleTheme": {
"type": "object",
"properties": {
- "password": {
+ "backgroundColor": {
"type": "string"
- }
- },
- "required": [
- "password"
- ],
- "additionalProperties": false
- },
- "NotificationData": {
- "type": "object",
- "properties": {
- "id": {
+ },
+ "color": {
"type": "string"
}
},
- "required": [
- "id"
- ],
"additionalProperties": false
},
- "NotificationRequestInput": {
+ "InlineStyleThemeInput": {
"type": "object",
"properties": {
- "msg": {
- "type": "string"
+ "backgroundColor": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "timeout": {
+ "color": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
@@ -8126,278 +8522,280 @@
]
}
},
- "required": [
- "msg"
- ],
"additionalProperties": false
},
- "ObsidianAnalysisRequestInput": {
+ "InlineStyles": {
"type": "object",
"properties": {
- "localPath": {
- "type": "string"
+ "av": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleAV"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "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": [
- "localPath"
+ "av",
+ "builtin",
+ "order",
+ "styles",
+ "version"
],
"additionalProperties": false
},
- "ObsidianImportRequestInput": {
+ "InsertBlockRequestInput": {
"type": "object",
"properties": {
- "notebookName": {
+ "data": {
"type": "string"
},
- "taskID": {
+ "dataType": {
"type": "string"
+ },
+ "nextID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "parentID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "previousID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "notebookName",
- "taskID"
+ "data",
+ "dataType"
],
"additionalProperties": false
},
- "ObsidianTaskRequestInput": {
+ "InstallBazaarIconRequestInput": {
"type": "object",
"properties": {
- "taskID": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ },
+ "repoHash": {
+ "type": "string"
+ },
+ "repoRef": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "repoURL": {
"type": "string"
}
},
"required": [
- "taskID"
+ "packageName",
+ "repoHash",
+ "repoURL"
],
"additionalProperties": false
},
- "ObsidianVaultAnalysis": {
+ "InstallBazaarPluginRequestInput": {
"type": "object",
"properties": {
- "ambiguousCount": {
- "type": "integer"
- },
- "blockIDCount": {
- "type": "integer"
+ "frontend": {
+ "type": "string"
},
- "blockingErrors": {
+ "keyword": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "commentCount": {
- "type": "integer"
- },
- "embedCount": {
- "type": "integer"
- },
- "footnoteCount": {
- "type": "integer"
- },
- "importableAssetCount": {
- "type": "integer"
- },
- "importableAssetSize": {
- "type": "integer"
- },
- "markdownCount": {
- "type": "integer"
- },
- "missingCount": {
- "type": "integer"
- },
- "nameAdjustmentCount": {
- "type": "integer"
- },
- "notebookName": {
- "type": "string"
- },
- "skippedHiddenCount": {
- "type": "integer"
- },
- "skippedLinkCount": {
- "type": "integer"
- },
- "skippedNestedVaultCount": {
- "type": "integer"
- },
- "skippedSpecialCount": {
- "type": "integer"
- },
- "syntheticParentCount": {
- "type": "integer"
- },
- "unreferencedFileCount": {
- "type": "integer"
- },
- "unsupportedCount": {
- "type": "integer"
- },
- "vaultName": {
+ "packageName": {
"type": "string"
},
- "vaultPath": {
+ "repoHash": {
"type": "string"
},
- "warnings": {
+ "repoRef": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "wikiLinkCount": {
- "type": "integer"
+ "repoURL": {
+ "type": "string"
}
},
"required": [
- "ambiguousCount",
- "blockIDCount",
- "blockingErrors",
- "commentCount",
- "embedCount",
- "footnoteCount",
- "importableAssetCount",
- "importableAssetSize",
- "markdownCount",
- "missingCount",
- "nameAdjustmentCount",
- "notebookName",
- "skippedHiddenCount",
- "skippedLinkCount",
- "skippedNestedVaultCount",
- "skippedSpecialCount",
- "syntheticParentCount",
- "unreferencedFileCount",
- "unsupportedCount",
- "vaultName",
- "vaultPath",
- "warnings",
- "wikiLinkCount"
+ "frontend",
+ "packageName",
+ "repoHash",
+ "repoURL"
],
"additionalProperties": false
},
- "ObsidianVaultImportResult": {
+ "InstallBazaarTemplateRequestInput": {
"type": "object",
"properties": {
- "convertedEmbedCount": {
- "type": "integer"
- },
- "convertedFootnoteCount": {
- "type": "integer"
- },
- "convertedLinkCount": {
- "type": "integer"
- },
- "failedStage": {
- "type": "string"
- },
- "importedAttachmentCount": {
- "type": "integer"
- },
- "incomplete": {
- "type": "boolean"
- },
- "markdownCount": {
- "type": "integer"
- },
- "nameAdjustmentCount": {
- "type": "integer"
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "notebookID": {
+ "packageName": {
"type": "string"
},
- "notebookName": {
+ "repoHash": {
"type": "string"
},
- "preservedCommentCount": {
- "type": "integer"
- },
- "preservedUnresolvedCount": {
- "type": "integer"
- },
- "skippedPathCount": {
- "type": "integer"
- },
- "syntheticParentCount": {
- "type": "integer"
+ "repoRef": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "unreferencedFileCount": {
- "type": "integer"
+ "repoURL": {
+ "type": "string"
}
},
"required": [
- "convertedEmbedCount",
- "convertedFootnoteCount",
- "convertedLinkCount",
- "importedAttachmentCount",
- "incomplete",
- "markdownCount",
- "nameAdjustmentCount",
- "notebookID",
- "notebookName",
- "preservedCommentCount",
- "preservedUnresolvedCount",
- "skippedPathCount",
- "syntheticParentCount",
- "unreferencedFileCount"
+ "packageName",
+ "repoHash",
+ "repoURL"
],
"additionalProperties": false
},
- "ObsidianVaultTask": {
+ "InstallBazaarThemeRequestInput": {
"type": "object",
"properties": {
- "analysis": {
- "$ref": "#/$defs/ObsidianVaultAnalysis"
- },
- "detail": {
- "type": "string"
- },
- "error": {
- "type": "string"
+ "frontend": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "message": {
- "type": "string"
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "progress": {
- "type": "integer"
+ "mode": {
+ "type": "number"
},
- "result": {
- "$ref": "#/$defs/ObsidianVaultImportResult"
+ "modeOS": {
+ "type": "boolean"
},
- "state": {
+ "packageName": {
"type": "string"
},
- "taskID": {
+ "repoHash": {
"type": "string"
- }
- },
- "required": [
- "message",
- "progress",
- "state",
- "taskID"
- ],
- "additionalProperties": false
- },
- "OpenNotebookRequestInput": {
- "type": "object",
- "properties": {
- "app": {
+ },
+ "repoRef": {
"anyOf": [
{
"type": "string"
@@ -8407,35 +8805,21 @@
}
]
},
- "notebook": {
+ "repoURL": {
"type": "string"
}
},
"required": [
- "notebook"
- ],
- "additionalProperties": false
- },
- "OrderedListStartData": {
- "type": "object",
- "properties": {
- "found": {
- "type": "boolean"
- },
- "start": {
- "type": "integer"
- }
- },
- "required": [
- "found",
- "start"
+ "packageName",
+ "repoHash",
+ "repoURL"
],
"additionalProperties": false
},
- "OutlineRequestInput": {
+ "InstallBazaarWidgetRequestInput": {
"type": "object",
"properties": {
- "id": {
+ "keyword": {
"anyOf": [
{
"type": "string"
@@ -8445,7 +8829,13 @@
}
]
},
- "notebook": {
+ "packageName": {
+ "type": "string"
+ },
+ "repoHash": {
+ "type": "string"
+ },
+ "repoRef": {
"anyOf": [
{
"type": "string"
@@ -8455,75 +8845,101 @@
}
]
},
- "preview": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "repoURL": {
+ "type": "string"
}
},
+ "required": [
+ "packageName",
+ "repoHash",
+ "repoURL"
+ ],
"additionalProperties": false
},
- "OutlineStorageRequestInput": {
+ "InstallLocalBazaarPackageRequestInput": {
"type": "object",
"properties": {
- "docID": {
- "type": "string"
+ "file": {
+ "type": "string",
+ "format": "binary"
+ },
+ "frontend": {
+ "type": "string"
+ },
+ "overwrite": {
+ "type": "string"
}
},
- "required": [
- "docID"
- ],
"additionalProperties": false
},
- "OutlineStorageSetRequestInput": {
- "type": "object",
- "properties": {
- "docID": {
+ "JSONValue": {
+ "anyOf": [
+ {
+ "type": "null"
+ },
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "number"
+ },
+ {
"type": "string"
},
- "val": {
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/JSONValue"
}
}
- },
- "required": [
- "docID",
- "val"
- ],
- "additionalProperties": false
+ ]
},
- "PandocData": {
+ "KernelPetal": {
"type": "object",
"properties": {
- "path": {
+ "existed": {
+ "type": "boolean"
+ },
+ "incompatible": {
+ "type": "boolean"
+ },
+ "js": {
"type": "string"
}
},
"required": [
- "path"
+ "existed",
+ "incompatible",
+ "js"
],
"additionalProperties": false
},
- "PandocRequestInput": {
+ "ListNotebooksData": {
"type": "object",
"properties": {
- "args": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "boxDocEnabled": {
+ "type": "boolean"
},
- "dir": {
+ "notebooks": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Notebook"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -8532,272 +8948,176 @@
}
},
"required": [
- "args"
+ "boxDocEnabled",
+ "notebooks"
],
"additionalProperties": false
},
- "Petal": {
+ "ListNotebooksRequestInput": {
"type": "object",
"properties": {
- "css": {
- "type": "string"
- },
- "disabledInPublish": {
- "type": "boolean"
- },
- "disallowInstall": {
- "type": "boolean"
- },
- "displayName": {
- "type": "string"
- },
- "enabled": {
- "type": "boolean"
- },
- "i18n": {
+ "flashcard": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
- },
- "incompatible": {
- "type": "boolean"
- },
- "js": {
- "type": "string"
- },
- "kernel": {
- "$ref": "#/$defs/KernelPetal"
- },
- "name": {
- "type": "string"
- },
- "userDisabledInPublish": {
- "type": "boolean"
- },
- "version": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "LoadPetalsRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
"type": "string"
}
},
"required": [
- "css",
- "disabledInPublish",
- "disallowInstall",
- "displayName",
- "enabled",
- "i18n",
- "incompatible",
- "js",
- "kernel",
- "name",
- "userDisabledInPublish",
- "version"
+ "frontend"
],
"additionalProperties": false
},
- "PinnedDoc": {
+ "LoadedPlugin": {
"type": "object",
"properties": {
- "childrenSortMode": {
+ "methods": {
"anyOf": [
{
- "type": "integer"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCMethod"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "icon": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
"name": {
"type": "string"
},
- "notebook": {
- "type": "string"
- },
- "path": {
+ "state": {
"type": "string"
},
- "subFileCount": {
+ "stateCode": {
"type": "integer"
- },
- "unavailable": {
- "type": "boolean"
}
},
"required": [
- "childrenSortMode",
- "icon",
- "id",
+ "methods",
"name",
- "notebook",
- "path",
- "subFileCount",
- "unavailable"
+ "state",
+ "stateCode"
],
"additionalProperties": false
},
- "PluginRPCError": {
+ "LoadedPluginRequestInput": {
"type": "object",
"properties": {
- "code": {
- "type": "integer"
- },
- "data": {
- "$ref": "#/$defs/JSONValue"
- },
- "message": {
+ "name": {
"type": "string"
}
},
"required": [
- "code",
- "message"
+ "name"
],
"additionalProperties": false
},
- "PluginRPCFailure": {
+ "LocalGraphConf": {
"type": "object",
"properties": {
- "error": {
+ "d3": {
"anyOf": [
{
- "$ref": "#/$defs/PluginRPCError"
+ "$ref": "#/$defs/GraphD3"
},
{
"type": "null"
}
]
},
- "id": {
+ "dailyNote": {
+ "type": "boolean"
+ },
+ "type": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "number"
+ "$ref": "#/$defs/GraphTypeFilter"
},
{
"type": "null"
}
]
- },
- "jsonrpc": {
- "type": "string",
- "enum": [
- "2.0"
- ]
}
},
"required": [
- "error",
- "id",
- "jsonrpc"
+ "d3",
+ "dailyNote",
+ "type"
],
"additionalProperties": false
},
- "PluginRPCMethod": {
+ "LocalGraphRequestInput": {
"type": "object",
"properties": {
- "descriptions": {
+ "conf": {
+ "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ },
+ "id": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "name": {
- "type": "string"
- }
- },
- "required": [
- "descriptions",
- "name"
- ],
- "additionalProperties": false
- },
- "PluginRPCNotification": {
- "type": "object",
- "properties": {
- "jsonrpc": {
- "type": "string",
- "enum": [
- "2.0"
- ]
- },
- "method": {
- "type": "string"
- },
- "params": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- "required": [
- "jsonrpc",
- "method"
- ],
- "additionalProperties": false
- },
- "PluginRPCRequestFieldsInput": {
- "type": "object",
- "properties": {
- "id": {
+ "k": {
"anyOf": [
{
"type": "string"
},
{
- "type": "number"
+ "type": "null"
+ }
+ ]
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
},
{
"type": "null"
}
]
},
- "jsonrpc": {
- "type": "string",
- "enum": [
- "2.0"
+ "reqId": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/JSONValue"
+ },
+ {
+ "type": "null"
+ }
]
},
- "method": {
- "type": "string"
- },
- "params": {
+ "type": {
"anyOf": [
{
- "anyOf": [
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/JSONValue"
- }
- },
- {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- }
- ]
+ "type": "string"
},
{
"type": "null"
@@ -8805,311 +9125,433 @@
]
}
},
- "required": [
- "jsonrpc",
- "method"
- ],
"additionalProperties": false
},
- "PluginRPCSuccess": {
+ "LocalGraphResult": {
"type": "object",
"properties": {
+ "box": {
+ "type": "string"
+ },
+ "conf": {
+ "$ref": "#/$defs/LocalGraphConf"
+ },
"id": {
+ "type": "string"
+ },
+ "links": {
"anyOf": [
{
- "type": "string"
- },
- {
- "type": "number"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphLink"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "jsonrpc": {
- "type": "string",
- "enum": [
- "2.0"
+ "nodes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GraphNode"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
]
},
- "result": {
+ "reqId": {
"$ref": "#/$defs/JSONValue"
}
},
"required": [
+ "box",
+ "conf",
"id",
- "jsonrpc",
- "result"
+ "links",
+ "nodes",
+ "reqId"
],
"additionalProperties": false
},
- "PrepareRichTextRequestInput": {
+ "LockScreenRequestInput": {
"type": "object",
"properties": {
- "assets": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/RichClipboardAssetInput"
- }
+ "lockScreenMode": {
+ "type": "number"
}
},
"required": [
- "assets"
+ "lockScreenMode"
],
"additionalProperties": false
},
- "PrependBlockRequestInput": {
+ "MarkdownHTMLRequestInput": {
"type": "object",
"properties": {
- "data": {
- "type": "string"
- },
- "dataType": {
+ "markdown": {
"type": "string"
},
- "parentID": {
- "type": "string"
+ "mode": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "data",
- "dataType",
- "parentID"
+ "markdown"
],
"additionalProperties": false
},
- "PublishedBlockInfo": {
+ "MoveBlockRequestInput": {
"type": "object",
"properties": {
- "publishAccessRequired": {
- "type": "boolean",
- "enum": [
- true
- ]
- },
- "rootID": {
- "type": "string"
- },
- "rootIcon": {
+ "id": {
"type": "string"
},
- "rootTitle": {
- "type": "string"
+ "parentID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "rootTitleEmpty": {
- "type": "boolean"
+ "previousID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "publishAccessRequired",
- "rootID",
- "rootIcon",
- "rootTitle",
- "rootTitleEmpty"
+ "id"
],
"additionalProperties": false
},
- "PutFileRequestInput": {
+ "NetImageAssetsRequestInput": {
"type": "object",
"properties": {
- "app": {
- "type": "string"
- },
- "file": {
- "type": "string",
- "format": "binary"
- },
- "isDir": {
- "type": "string"
- },
- "modTime": {
+ "id": {
"type": "string"
},
- "path": {
- "type": "string"
+ "url": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
+ "required": [
+ "id"
+ ],
"additionalProperties": false
},
- "ReadDirectoryRequestInput": {
+ "NetworkData": {
"type": "object",
"properties": {
- "path": {
- "type": "string"
+ "proxy": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/NetworkProxy"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "path"
+ "proxy"
],
"additionalProperties": false
},
- "RecentDoc": {
+ "NetworkProxy": {
"type": "object",
"properties": {
- "closedAt": {
- "type": "integer"
- },
- "icon": {
+ "host": {
"type": "string"
},
- "openAt": {
- "type": "integer"
- },
- "rootID": {
+ "port": {
"type": "string"
},
- "title": {
+ "scheme": {
"type": "string"
- },
- "viewedAt": {
- "type": "integer"
}
},
"required": [
- "rootID"
+ "host",
+ "port",
+ "scheme"
],
"additionalProperties": false
},
- "RecentDocUpdateRequestInput": {
+ "NetworkProxyInput": {
"type": "object",
"properties": {
- "rootID": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "host": {
+ "type": "string"
+ },
+ "port": {
+ "type": "string"
+ },
+ "scheme": {
+ "type": "string"
}
},
+ "required": [
+ "host",
+ "port",
+ "scheme"
+ ],
"additionalProperties": false
},
- "RecentDocsRequestInput": {
+ "NetworkServeRequestInput": {
"type": "object",
"properties": {
- "sortBy": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "networkServe": {
+ "type": "boolean"
}
},
+ "required": [
+ "networkServe"
+ ],
"additionalProperties": false
},
- "RecentDocsUpdateRequestInput": {
+ "NetworkServeTLSRequestInput": {
"type": "object",
"properties": {
- "rootIDs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
+ "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
},
- "RefDefs": {
+ "NotebookConf": {
"type": "object",
"properties": {
- "defIDs": {
+ "boxCrypt": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/NotebookEncryption"
},
{
"type": "null"
}
]
},
- "refID": {
+ "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": [
- "defIDs",
- "refID"
+ "boxCrypt",
+ "closed",
+ "dailyNoteSavePath",
+ "dailyNoteTemplatePath",
+ "docCreateSaveBox",
+ "docCreateSavePath",
+ "docCreateTemplatePath",
+ "encrypted",
+ "icon",
+ "name",
+ "refCreateSaveBox",
+ "refCreateSavePath",
+ "sort",
+ "sortMode"
],
"additionalProperties": false
},
- "RefDefsData": {
+ "NotebookConfData": {
"type": "object",
"properties": {
- "refDefs": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/RefDefs"
- }
+ "box": {
+ "type": "string"
+ },
+ "conf": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/NotebookConf"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "name": {
+ "type": "string"
}
},
"required": [
- "refDefs"
+ "box",
+ "conf",
+ "name"
],
"additionalProperties": false
},
- "RefIDsData": {
+ "NotebookConfPatchInput": {
"type": "object",
"properties": {
- "originalRefBlockIDs": {
+ "boxCrypt": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/$defs/NotebookEncryptionPatchInput"
},
{
"type": "null"
}
]
},
- "refDefs": {
+ "closed": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/RefDefs"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "boolean"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "originalRefBlockIDs",
- "refDefs"
- ],
- "additionalProperties": false
- },
- "RefIDsRequestInput": {
- "type": "object",
- "properties": {
- "id": {
+ },
+ "dailyNoteSavePath": {
"anyOf": [
{
"type": "string"
@@ -9119,20 +9561,17 @@
}
]
},
- "ids": {
+ "dailyNoteTemplatePath": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "docCreateSaveBox": {
"anyOf": [
{
"type": "string"
@@ -9141,17 +9580,8 @@
"type": "null"
}
]
- }
- },
- "additionalProperties": false
- },
- "RefTextQueryRequestInput": {
- "type": "object",
- "properties": {
- "anchor": {
- "type": "string"
},
- "notebook": {
+ "docCreateSavePath": {
"anyOf": [
{
"type": "string"
@@ -9160,53 +9590,8 @@
"type": "null"
}
]
- }
- },
- "required": [
- "anchor"
- ],
- "additionalProperties": false
- },
- "RefreshBacklinkRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "RemoveBookmarkRequestInput": {
- "type": "object",
- "properties": {
- "bookmark": {
- "type": "string"
- }
- },
- "required": [
- "bookmark"
- ],
- "additionalProperties": false
- },
- "RemoveCriterionRequestInput": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string"
- }
- },
- "required": [
- "name"
- ],
- "additionalProperties": false
- },
- "RemoveFileRequestInput": {
- "type": "object",
- "properties": {
- "app": {
+ },
+ "docCreateTemplatePath": {
"anyOf": [
{
"type": "string"
@@ -9216,147 +9601,116 @@
}
]
},
- "path": {
- "type": "string"
- }
- },
- "required": [
- "path"
- ],
- "additionalProperties": false
- },
- "RemoveShorthandsRequestInput": {
- "type": "object",
- "properties": {
- "ids": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "ids"
- ],
- "additionalProperties": false
- },
- "RemoveTagRequestInput": {
- "type": "object",
- "properties": {
- "label": {
- "type": "string"
- }
- },
- "required": [
- "label"
- ],
- "additionalProperties": false
- },
- "RenameBookmarkRequestInput": {
- "type": "object",
- "properties": {
- "newBookmark": {
- "type": "string"
+ "encrypted": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "oldBookmark": {
- "type": "string"
- }
- },
- "required": [
- "newBookmark",
- "oldBookmark"
- ],
- "additionalProperties": false
- },
- "RenameFileRequestInput": {
- "type": "object",
- "properties": {
- "newPath": {
- "type": "string"
+ "icon": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "path": {
- "type": "string"
- }
- },
- "required": [
- "newPath",
- "path"
- ],
- "additionalProperties": false
- },
- "RenameNotebookRequestInput": {
- "type": "object",
- "properties": {
"name": {
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "notebook": {
- "type": "string"
- }
- },
- "required": [
- "name",
- "notebook"
- ],
- "additionalProperties": false
- },
- "RenameTagRequestInput": {
- "type": "object",
- "properties": {
- "newLabel": {
- "type": "string"
+ "refCreateSaveBox": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "oldLabel": {
- "type": "string"
+ "refCreateSavePath": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "sort": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "sortMode": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "newLabel",
- "oldLabel"
- ],
"additionalProperties": false
},
- "RenderSprigRequestInput": {
+ "NotebookCryptoAutoLockRequestInput": {
"type": "object",
"properties": {
- "template": {
- "type": "string"
+ "autoLockMinutes": {
+ "type": "number"
}
},
"required": [
- "template"
+ "autoLockMinutes"
],
"additionalProperties": false
},
- "RenderTemplateData": {
+ "NotebookCryptoBackupData": {
"type": "object",
"properties": {
- "content": {
- "type": "string"
- },
- "docTreePlan": {
- "$ref": "#/$defs/TemplatePlan"
- },
- "path": {
+ "file": {
"type": "string"
}
},
"required": [
- "content",
- "path"
+ "file"
],
"additionalProperties": false
},
- "RenderTemplateRequestInput": {
+ "NotebookEncryption": {
"type": "object",
"properties": {
- "content": {
- "type": "string"
+ "createdAt": {
+ "type": "integer"
},
- "id": {
+ "metadata": {
"type": "string"
},
- "mode": {
+ "spec": {
+ "type": "integer"
+ },
+ "wrapNonce": {
"anyOf": [
{
"type": "string"
@@ -9366,13 +9720,10 @@
}
]
},
- "path": {
- "type": "string"
- },
- "preview": {
+ "wrappedDEK": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
@@ -9381,59 +9732,90 @@
}
},
"required": [
- "id",
- "path"
+ "createdAt",
+ "spec",
+ "wrapNonce",
+ "wrappedDEK"
],
"additionalProperties": false
},
- "ReorderData": {
+ "NotebookEncryptionPatchInput": {
"type": "object",
"properties": {
- "changed": {
- "type": "boolean"
+ "createdAt": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "notebook": {
- "type": "string"
+ "metadata": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ ]
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "parentPath": {
- "type": "string"
- }
- },
- "required": [
- "changed"
- ],
- "additionalProperties": false
- },
- "ReorderNotebooksRequestInput": {
- "type": "object",
- "properties": {
- "position": {
+ "spec": {
"anyOf": [
{
- "type": "string"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "sourceIDs": {
+ "wrapNonce": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ ]
},
{
"type": "null"
}
]
},
- "targetID": {
+ "wrappedDEK": {
"anyOf": [
{
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ ]
},
{
"type": "null"
@@ -9443,326 +9825,211 @@
},
"additionalProperties": false
},
- "ResetGraphData": {
+ "NotebookHistoryData": {
"type": "object",
"properties": {
- "conf": {
- "$ref": "#/$defs/GlobalGraphConf"
+ "histories": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/History"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
"required": [
- "conf"
+ "histories"
],
"additionalProperties": false
},
- "ResetLocalGraphData": {
+ "NotebookIDRequestInput": {
"type": "object",
"properties": {
- "conf": {
- "$ref": "#/$defs/LocalGraphConf"
+ "notebook": {
+ "type": "string"
}
},
"required": [
- "conf"
+ "notebook"
],
"additionalProperties": false
},
- "RichClipboardAssetInput": {
+ "NotebookInfo": {
"type": "object",
"properties": {
- "box": {
+ "ctime": {
+ "type": "integer"
+ },
+ "docCount": {
+ "type": "integer"
+ },
+ "hCtime": {
"type": "string"
},
- "index": {
+ "hMtime": {
+ "type": "string"
+ },
+ "hSize": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "mtime": {
"type": "integer"
},
- "path": {
+ "name": {
"type": "string"
+ },
+ "size": {
+ "type": "integer"
}
},
"required": [
- "index",
- "path"
+ "ctime",
+ "docCount",
+ "hCtime",
+ "hMtime",
+ "hSize",
+ "id",
+ "mtime",
+ "name",
+ "size"
],
"additionalProperties": false
},
- "RichClipboardPrepared": {
+ "NotebookInfoData": {
"type": "object",
"properties": {
- "assets": {
+ "boxInfo": {
"anyOf": [
{
- "type": "array",
- "items": {
- "$ref": "#/$defs/RichClipboardPreparedAsset"
- }
+ "$ref": "#/$defs/NotebookInfo"
},
{
"type": "null"
}
]
- },
- "batch": {
+ }
+ },
+ "required": [
+ "boxInfo"
+ ],
+ "additionalProperties": false
+ },
+ "NotebookPasswordRequestInput": {
+ "type": "object",
+ "properties": {
+ "password": {
"type": "string"
- },
- "groups": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
}
},
"required": [
- "assets",
- "batch",
- "groups"
+ "password"
],
"additionalProperties": false
},
- "RichClipboardPreparedAsset": {
+ "NotificationData": {
"type": "object",
"properties": {
- "index": {
- "type": "integer"
- },
- "path": {
+ "id": {
"type": "string"
}
},
"required": [
- "index",
- "path"
+ "id"
],
"additionalProperties": false
},
- "SQLQueryRequestInput": {
+ "NotificationRequestInput": {
"type": "object",
"properties": {
- "mode": {
+ "msg": {
+ "type": "string"
+ },
+ "timeout": {
"anyOf": [
{
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
]
- },
- "stmt": {
- "type": "string"
}
},
"required": [
- "stmt"
+ "msg"
],
"additionalProperties": false
},
- "SaveTemplateRequestInput": {
+ "ObsidianAnalysisRequestInput": {
"type": "object",
"properties": {
- "databaseMode": {
- "type": "string"
- },
- "directory": {
- "type": "string"
- },
- "id": {
- "type": "string"
- },
- "name": {
+ "localPath": {
"type": "string"
- },
- "overwrite": {
- "type": "boolean"
}
},
"required": [
- "id",
- "name",
- "overwrite"
+ "localPath"
],
"additionalProperties": false
},
- "SearchAsset": {
+ "ObsidianImportRequestInput": {
"type": "object",
"properties": {
- "hName": {
+ "notebookName": {
"type": "string"
},
- "path": {
+ "taskID": {
"type": "string"
- },
- "updated": {
- "type": "integer"
}
},
"required": [
- "hName",
- "path",
- "updated"
- ],
- "additionalProperties": false
- },
- "SearchAssetContentData": {
- "type": "object",
- "properties": {
- "assetContents": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AssetContent"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "matchedAssetCount": {
- "type": "integer"
- },
- "pageCount": {
- "type": "integer"
- }
- },
- "required": [
- "assetContents",
- "matchedAssetCount",
- "pageCount"
+ "notebookName",
+ "taskID"
],
"additionalProperties": false
},
- "SearchAssetContentRequestInput": {
- "type": "object",
- "properties": {
- "method": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "orderBy": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "page": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "pageSize": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "query": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- },
- "types": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "additionalProperties": false
- },
- "SearchAssetRequestInput": {
+ "ObsidianTaskRequestInput": {
"type": "object",
"properties": {
- "exts": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "k": {
+ "taskID": {
"type": "string"
}
},
"required": [
- "k"
+ "taskID"
],
"additionalProperties": false
},
- "SearchBlock": {
+ "ObsidianVaultAnalysis": {
"type": "object",
"properties": {
- "alias": {
- "type": "string"
+ "ambiguousCount": {
+ "type": "integer"
},
- "box": {
- "type": "string"
+ "blockIDCount": {
+ "type": "integer"
},
- "children": {
+ "blockingErrors": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -9770,86 +10037,66 @@
}
]
},
- "content": {
- "type": "string"
+ "commentCount": {
+ "type": "integer"
},
- "count": {
+ "embedCount": {
"type": "integer"
},
- "created": {
- "type": "string"
+ "footnoteCount": {
+ "type": "integer"
},
- "defID": {
- "type": "string"
+ "importableAssetCount": {
+ "type": "integer"
},
- "defPath": {
- "type": "string"
+ "importableAssetSize": {
+ "type": "integer"
},
- "depth": {
+ "markdownCount": {
"type": "integer"
},
- "fcontent": {
- "type": "string"
+ "missingCount": {
+ "type": "integer"
},
- "folded": {
- "type": "boolean"
+ "nameAdjustmentCount": {
+ "type": "integer"
},
- "hPath": {
+ "notebookName": {
"type": "string"
},
- "ial": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "skippedHiddenCount": {
+ "type": "integer"
},
- "id": {
- "type": "string"
+ "skippedLinkCount": {
+ "type": "integer"
},
- "markdown": {
- "type": "string"
+ "skippedNestedVaultCount": {
+ "type": "integer"
},
- "memo": {
- "type": "string"
+ "skippedSpecialCount": {
+ "type": "integer"
},
- "name": {
- "type": "string"
+ "syntheticParentCount": {
+ "type": "integer"
},
- "number": {
- "type": "string"
+ "unreferencedFileCount": {
+ "type": "integer"
},
- "parentID": {
- "type": "string"
+ "unsupportedCount": {
+ "type": "integer"
},
- "path": {
+ "vaultName": {
"type": "string"
},
- "refCount": {
- "type": "integer"
- },
- "refText": {
+ "vaultPath": {
"type": "string"
},
- "refs": {
+ "warnings": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -9857,167 +10104,182 @@
}
]
},
- "riffCard": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlockCard"
- },
- {
- "type": "null"
- }
- ]
- },
- "riffCardID": {
- "type": "string"
- },
- "rootID": {
- "type": "string"
- },
- "sort": {
+ "wikiLinkCount": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "ambiguousCount",
+ "blockIDCount",
+ "blockingErrors",
+ "commentCount",
+ "embedCount",
+ "footnoteCount",
+ "importableAssetCount",
+ "importableAssetSize",
+ "markdownCount",
+ "missingCount",
+ "nameAdjustmentCount",
+ "notebookName",
+ "skippedHiddenCount",
+ "skippedLinkCount",
+ "skippedNestedVaultCount",
+ "skippedSpecialCount",
+ "syntheticParentCount",
+ "unreferencedFileCount",
+ "unsupportedCount",
+ "vaultName",
+ "vaultPath",
+ "warnings",
+ "wikiLinkCount"
+ ],
+ "additionalProperties": false
+ },
+ "ObsidianVaultImportResult": {
+ "type": "object",
+ "properties": {
+ "convertedEmbedCount": {
"type": "integer"
},
- "subType": {
- "type": "string"
- },
- "tag": {
+ "convertedFootnoteCount": {
+ "type": "integer"
+ },
+ "convertedLinkCount": {
+ "type": "integer"
+ },
+ "failedStage": {
"type": "string"
},
- "type": {
+ "importedAttachmentCount": {
+ "type": "integer"
+ },
+ "incomplete": {
+ "type": "boolean"
+ },
+ "markdownCount": {
+ "type": "integer"
+ },
+ "nameAdjustmentCount": {
+ "type": "integer"
+ },
+ "notebookID": {
"type": "string"
},
- "updated": {
+ "notebookName": {
"type": "string"
+ },
+ "preservedCommentCount": {
+ "type": "integer"
+ },
+ "preservedUnresolvedCount": {
+ "type": "integer"
+ },
+ "skippedPathCount": {
+ "type": "integer"
+ },
+ "syntheticParentCount": {
+ "type": "integer"
+ },
+ "unreferencedFileCount": {
+ "type": "integer"
}
},
"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"
+ "convertedEmbedCount",
+ "convertedFootnoteCount",
+ "convertedLinkCount",
+ "importedAttachmentCount",
+ "incomplete",
+ "markdownCount",
+ "nameAdjustmentCount",
+ "notebookID",
+ "notebookName",
+ "preservedCommentCount",
+ "preservedUnresolvedCount",
+ "skippedPathCount",
+ "syntheticParentCount",
+ "unreferencedFileCount"
],
"additionalProperties": false
},
- "SearchBlockCard": {
+ "ObsidianVaultTask": {
"type": "object",
"properties": {
- "due": {
+ "analysis": {
+ "$ref": "#/$defs/ObsidianVaultAnalysis"
+ },
+ "detail": {
"type": "string"
},
- "lapses": {
- "type": "integer"
+ "error": {
+ "type": "string"
},
- "lastReview": {
+ "message": {
"type": "string"
},
- "reps": {
+ "progress": {
"type": "integer"
},
+ "result": {
+ "$ref": "#/$defs/ObsidianVaultImportResult"
+ },
"state": {
- "type": "integer"
+ "type": "string"
+ },
+ "taskID": {
+ "type": "string"
}
},
"required": [
- "due",
- "lapses",
- "lastReview",
- "reps",
- "state"
+ "message",
+ "progress",
+ "state",
+ "taskID"
],
"additionalProperties": false
},
- "SearchBlockRequestInput": {
+ "OpenNotebookRequestInput": {
"type": "object",
"properties": {
- "groupBy": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "method": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "orderBy": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "page": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "pageSize": {
+ "app": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "paths": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "notebook": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "notebook"
+ ],
+ "additionalProperties": false
+ },
+ "OrderedListStartData": {
+ "type": "object",
+ "properties": {
+ "found": {
+ "type": "boolean"
},
- "query": {
+ "start": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "found",
+ "start"
+ ],
+ "additionalProperties": false
+ },
+ "OutlineRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
"anyOf": [
{
"type": "string"
@@ -10027,23 +10289,20 @@
}
]
},
- "subTypes": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/SearchSubtypeFilterInput"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "types": {
+ "preview": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
+ "type": "boolean"
},
{
"type": "null"
@@ -10053,177 +10312,250 @@
},
"additionalProperties": false
},
- "SearchBlocksData": {
+ "OutlineStorageRequestInput": {
"type": "object",
"properties": {
- "blocks": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "matchedBlockCount": {
- "type": "integer"
- },
- "matchedRootCount": {
- "type": "integer"
- },
- "pageCount": {
- "type": "integer"
+ "docID": {
+ "type": "string"
}
},
"required": [
- "blocks",
- "matchedBlockCount",
- "matchedRootCount",
- "pageCount"
+ "docID"
],
"additionalProperties": false
},
- "SearchEmbedBlockRequestInput": {
+ "OutlineStorageSetRequestInput": {
"type": "object",
"properties": {
- "breadcrumb": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "embedBlockID": {
+ "docID": {
"type": "string"
},
- "excludeIDs": {
+ "val": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ }
+ },
+ "required": [
+ "docID",
+ "val"
+ ],
+ "additionalProperties": false
+ },
+ "PandocData": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ "PandocRequestInput": {
+ "type": "object",
+ "properties": {
+ "args": {
"type": "array",
"items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
- "headingMode": {
+ "dir": {
"anyOf": [
{
- "type": "number"
+ "type": "string"
},
{
"type": "null"
}
]
+ }
+ },
+ "required": [
+ "args"
+ ],
+ "additionalProperties": false
+ },
+ "Petal": {
+ "type": "object",
+ "properties": {
+ "css": {
+ "type": "string"
},
- "notebook": {
+ "disabledInPublish": {
+ "type": "boolean"
+ },
+ "disallowInstall": {
+ "type": "boolean"
+ },
+ "displayName": {
+ "type": "string"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "i18n": {
"anyOf": [
{
- "type": "string"
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
},
{
"type": "null"
}
]
},
- "stmt": {
+ "incompatible": {
+ "type": "boolean"
+ },
+ "js": {
+ "type": "string"
+ },
+ "kernel": {
+ "$ref": "#/$defs/KernelPetal"
+ },
+ "name": {
+ "type": "string"
+ },
+ "userDisabledInPublish": {
+ "type": "boolean"
+ },
+ "version": {
"type": "string"
}
},
"required": [
- "embedBlockID",
- "excludeIDs",
- "stmt"
+ "css",
+ "disabledInPublish",
+ "disallowInstall",
+ "displayName",
+ "enabled",
+ "i18n",
+ "incompatible",
+ "js",
+ "kernel",
+ "name",
+ "userDisabledInPublish",
+ "version"
],
"additionalProperties": false
},
- "SearchHeadingFilterInput": {
+ "PinnedDoc": {
"type": "object",
"properties": {
- "h1": {
+ "childrenSortMode": {
"anyOf": [
{
- "type": "boolean"
+ "type": "integer"
},
{
"type": "null"
}
]
},
- "h2": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "icon": {
+ "type": "string"
},
- "h3": {
+ "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
+ },
+ "PluginRPCError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "$ref": "#/$defs/JSONValue"
+ },
+ "message": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "message"
+ ],
+ "additionalProperties": false
+ },
+ "PluginRPCFailure": {
+ "type": "object",
+ "properties": {
+ "error": {
"anyOf": [
{
- "type": "boolean"
+ "$ref": "#/$defs/PluginRPCError"
},
{
"type": "null"
}
]
},
- "h4": {
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
- "type": "null"
- }
- ]
- },
- "h5": {
- "anyOf": [
- {
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "h6": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
+ "jsonrpc": {
+ "type": "string",
+ "enum": [
+ "2.0"
]
}
},
+ "required": [
+ "error",
+ "id",
+ "jsonrpc"
+ ],
"additionalProperties": false
},
- "SearchHistoryData": {
+ "PluginRPCMethod": {
"type": "object",
"properties": {
- "histories": {
+ "descriptions": {
"anyOf": [
{
"type": "array",
@@ -10236,45 +10568,46 @@
}
]
},
- "pageCount": {
- "type": "integer"
- },
- "totalCount": {
- "type": "integer"
+ "name": {
+ "type": "string"
}
},
"required": [
- "histories",
- "pageCount",
- "totalCount"
+ "descriptions",
+ "name"
],
"additionalProperties": false
},
- "SearchHistoryRequestInput": {
+ "PluginRPCNotification": {
"type": "object",
"properties": {
- "notebook": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
+ "jsonrpc": {
+ "type": "string",
+ "enum": [
+ "2.0"
]
},
- "op": {
+ "method": {
+ "type": "string"
+ },
+ "params": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ "required": [
+ "jsonrpc",
+ "method"
+ ],
+ "additionalProperties": false
+ },
+ "PluginRPCRequestFieldsInput": {
+ "type": "object",
+ "properties": {
+ "id": {
"anyOf": [
{
"type": "string"
},
- {
- "type": "null"
- }
- ]
- },
- "page": {
- "anyOf": [
{
"type": "number"
},
@@ -10283,20 +10616,32 @@
}
]
},
- "query": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
+ "jsonrpc": {
+ "type": "string",
+ "enum": [
+ "2.0"
]
},
- "type": {
+ "method": {
+ "type": "string"
+ },
+ "params": {
"anyOf": [
{
- "type": "number"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
+ {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ }
+ ]
},
{
"type": "null"
@@ -10304,168 +10649,134 @@
]
}
},
- "additionalProperties": false
- },
- "SearchKeywordRequestInput": {
- "type": "object",
- "properties": {
- "k": {
- "type": "string"
- }
- },
"required": [
- "k"
+ "jsonrpc",
+ "method"
],
"additionalProperties": false
},
- "SearchListFilterInput": {
+ "PluginRPCSuccess": {
"type": "object",
"properties": {
- "o": {
+ "id": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
- "type": "null"
- }
- ]
- },
- "t": {
- "anyOf": [
- {
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "u": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
+ "jsonrpc": {
+ "type": "string",
+ "enum": [
+ "2.0"
]
+ },
+ "result": {
+ "$ref": "#/$defs/JSONValue"
}
},
+ "required": [
+ "id",
+ "jsonrpc",
+ "result"
+ ],
"additionalProperties": false
},
- "SearchPageRequestInput": {
+ "PrepareRichTextRequestInput": {
"type": "object",
"properties": {
- "page": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
- },
- "pageSize": {
- "anyOf": [
- {
- "type": "number"
- },
- {
- "type": "null"
- }
- ]
+ "assets": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/RichClipboardAssetInput"
+ }
}
},
+ "required": [
+ "assets"
+ ],
"additionalProperties": false
},
- "SearchPath": {
+ "PrependBlockRequestInput": {
"type": "object",
"properties": {
- "blocks": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "box": {
+ "data": {
"type": "string"
},
- "children": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchPath"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "count": {
- "type": "integer"
- },
- "created": {
+ "dataType": {
"type": "string"
},
- "depth": {
- "type": "integer"
- },
- "folded": {
- "type": "boolean"
- },
- "hPath": {
+ "parentID": {
"type": "string"
+ }
+ },
+ "required": [
+ "data",
+ "dataType",
+ "parentID"
+ ],
+ "additionalProperties": false
+ },
+ "PublishedBlockInfo": {
+ "type": "object",
+ "properties": {
+ "publishAccessRequired": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
},
- "id": {
+ "rootID": {
"type": "string"
},
- "name": {
+ "rootIcon": {
"type": "string"
},
- "nodeType": {
+ "rootTitle": {
"type": "string"
},
- "number": {
+ "rootTitleEmpty": {
+ "type": "boolean"
+ }
+ },
+ "required": [
+ "publishAccessRequired",
+ "rootID",
+ "rootIcon",
+ "rootTitle",
+ "rootTitleEmpty"
+ ],
+ "additionalProperties": false
+ },
+ "PutFileRequestInput": {
+ "type": "object",
+ "properties": {
+ "app": {
"type": "string"
},
- "subType": {
+ "file": {
+ "type": "string",
+ "format": "binary"
+ },
+ "isDir": {
"type": "string"
},
- "type": {
+ "modTime": {
"type": "string"
},
- "updated": {
+ "path": {
"type": "string"
}
},
- "required": [
- "box",
- "count",
- "created",
- "depth",
- "folded",
- "hPath",
- "id",
- "name",
- "nodeType",
- "subType",
- "type",
- "updated"
- ],
"additionalProperties": false
},
- "SearchPathRequestInput": {
+ "ReadDirectoryRequestInput": {
"type": "object",
"properties": {
"path": {
@@ -10477,46 +10788,37 @@
],
"additionalProperties": false
},
- "SearchRefBlockRequestInput": {
+ "RecentDoc": {
"type": "object",
"properties": {
- "beforeLen": {
- "type": "number"
+ "closedAt": {
+ "type": "integer"
},
- "id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "icon": {
+ "type": "string"
},
- "isDatabase": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "openAt": {
+ "type": "integer"
},
- "isSquareBrackets": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "rootID": {
+ "type": "string"
},
- "k": {
+ "title": {
"type": "string"
},
- "notebook": {
+ "viewedAt": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "rootID"
+ ],
+ "additionalProperties": false
+ },
+ "RecentDocUpdateRequestInput": {
+ "type": "object",
+ "properties": {
+ "rootID": {
"anyOf": [
{
"type": "string"
@@ -10525,51 +10827,54 @@
"type": "null"
}
]
- },
- "reqId": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "RecentDocsRequestInput": {
+ "type": "object",
+ "properties": {
+ "sortBy": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "string"
},
{
"type": "null"
}
]
- },
- "rootID": {
- "type": "string"
}
},
"additionalProperties": false
},
- "SearchRefCorrelation": {
+ "RecentDocsUpdateRequestInput": {
"type": "object",
"properties": {
- "reqId": {
- "$ref": "#/$defs/JSONValue"
+ "rootIDs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "reqId"
- ],
"additionalProperties": false
},
- "SearchRefResult": {
+ "RefDefs": {
"type": "object",
"properties": {
- "blocks": {
+ "defIDs": {
"anyOf": [
{
"type": "array",
"items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
}
},
{
@@ -10577,46 +10882,40 @@
}
]
},
- "k": {
+ "refID": {
"type": "string"
- },
- "newDoc": {
- "type": "boolean"
- },
- "reqId": {
- "$ref": "#/$defs/JSONValue"
}
},
"required": [
- "blocks",
- "k",
- "newDoc",
- "reqId"
+ "defIDs",
+ "refID"
],
"additionalProperties": false
},
- "SearchSubTypes": {
+ "RefDefsData": {
"type": "object",
"properties": {
- "heading": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "list": {
+ "refDefs": {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/RefDefs"
+ }
+ }
+ },
+ "required": [
+ "refDefs"
+ ],
+ "additionalProperties": false
+ },
+ "RefIDsData": {
+ "type": "object",
+ "properties": {
+ "originalRefBlockIDs": {
"anyOf": [
{
"type": "object",
"additionalProperties": {
- "type": "boolean"
+ "type": "string"
}
},
{
@@ -10624,12 +10923,19 @@
}
]
},
- "listItem": {
+ "refDefs": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/RefDefs"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -10639,34 +10945,30 @@
}
},
"required": [
- "heading",
- "list",
- "listItem"
+ "originalRefBlockIDs",
+ "refDefs"
],
"additionalProperties": false
},
- "SearchSubTypesInput": {
+ "RefIDsRequestInput": {
"type": "object",
"properties": {
- "heading": {
+ "id": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "list": {
+ "ids": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
{
@@ -10674,13 +10976,10 @@
}
]
},
- "listItem": {
+ "notebook": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
+ "type": "string"
},
{
"type": "null"
@@ -10690,33 +10989,16 @@
},
"additionalProperties": false
},
- "SearchSubtypeFilterInput": {
+ "RefTextQueryRequestInput": {
"type": "object",
"properties": {
- "heading": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchHeadingFilterInput"
- },
- {
- "type": "null"
- }
- ]
- },
- "list": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchListFilterInput"
- },
- {
- "type": "null"
- }
- ]
+ "anchor": {
+ "type": "string"
},
- "listItem": {
+ "notebook": {
"anyOf": [
{
- "$ref": "#/$defs/SearchListFilterInput"
+ "type": "string"
},
{
"type": "null"
@@ -10724,310 +11006,252 @@
]
}
},
+ "required": [
+ "anchor"
+ ],
"additionalProperties": false
},
- "SearchTagData": {
+ "RefreshBacklinkRequestInput": {
"type": "object",
"properties": {
- "k": {
+ "id": {
"type": "string"
- },
- "tags": {
- "type": "array",
- "items": {
- "type": "string"
- }
}
},
"required": [
- "k",
- "tags"
+ "id"
],
"additionalProperties": false
},
- "SearchTagRequestInput": {
+ "RemoveBookmarkRequestInput": {
"type": "object",
"properties": {
- "k": {
+ "bookmark": {
"type": "string"
}
},
"required": [
- "k"
+ "bookmark"
],
"additionalProperties": false
},
- "SearchTemplateData": {
+ "RemoveCriterionRequestInput": {
"type": "object",
"properties": {
- "k": {
+ "name": {
"type": "string"
- },
- "templates": {
+ }
+ },
+ "required": [
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "RemoveFileRequestInput": {
+ "type": "object",
+ "properties": {
+ "app": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchTemplateResult"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "string"
},
{
"type": "null"
}
]
+ },
+ "path": {
+ "type": "string"
}
},
"required": [
- "k",
- "templates"
+ "path"
],
"additionalProperties": false
},
- "SearchTemplateResult": {
+ "RemoveShorthandsRequestInput": {
"type": "object",
"properties": {
- "content": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "RemoveTagRequestInput": {
+ "type": "object",
+ "properties": {
+ "label": {
"type": "string"
- },
- "path": {
+ }
+ },
+ "required": [
+ "label"
+ ],
+ "additionalProperties": false
+ },
+ "RenameBookmarkRequestInput": {
+ "type": "object",
+ "properties": {
+ "newBookmark": {
"type": "string"
},
- "relativePath": {
+ "oldBookmark": {
"type": "string"
}
},
"required": [
- "content",
- "path",
- "relativePath"
+ "newBookmark",
+ "oldBookmark"
],
"additionalProperties": false
},
- "SearchWidgetData": {
+ "RenameFileRequestInput": {
"type": "object",
"properties": {
- "k": {
+ "newPath": {
"type": "string"
},
- "widgets": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchWidgetResult"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "path": {
+ "type": "string"
}
},
"required": [
- "k",
- "widgets"
+ "newPath",
+ "path"
],
"additionalProperties": false
},
- "SearchWidgetResult": {
+ "RenameNotebookRequestInput": {
"type": "object",
"properties": {
- "content": {
+ "name": {
"type": "string"
},
- "name": {
+ "notebook": {
"type": "string"
}
},
"required": [
- "content",
- "name"
+ "name",
+ "notebook"
],
"additionalProperties": false
},
- "SetBlockAttrsRequestInput": {
+ "RenameTagRequestInput": {
"type": "object",
"properties": {
- "attrs": {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
- }
+ "newLabel": {
+ "type": "string"
},
- "id": {
+ "oldLabel": {
"type": "string"
}
},
"required": [
- "attrs",
- "id"
+ "newLabel",
+ "oldLabel"
],
"additionalProperties": false
},
- "SetCriterionRequestInput": {
+ "RenderSprigRequestInput": {
"type": "object",
"properties": {
- "criterion": {
- "anyOf": [
- {
- "$ref": "#/$defs/CriterionInput"
- },
- {
- "type": "null"
- }
- ]
+ "template": {
+ "type": "string"
}
},
"required": [
- "criterion"
+ "template"
],
"additionalProperties": false
},
- "SetGraphConfRequestInput": {
+ "RenderTemplateData": {
"type": "object",
"properties": {
- "conf": {
- "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ "content": {
+ "type": "string"
},
- "type": {
+ "docTreePlan": {
+ "$ref": "#/$defs/TemplatePlan"
+ },
+ "path": {
"type": "string"
}
},
"required": [
- "conf",
- "type"
+ "content",
+ "path"
],
"additionalProperties": false
},
- "SetInlineStylesRequestInput": {
+ "RenderTemplateRequestInput": {
"type": "object",
"properties": {
- "app": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ]
+ "content": {
+ "type": "string"
},
- "av": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleAVInput"
- },
- {
- "type": "null"
- }
- ]
+ "id": {
+ "type": "string"
},
- "builtin": {
+ "mode": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleBuiltinInput"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "order": {
+ "path": {
+ "type": "string"
+ },
+ "preview": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleOrderInput"
+ "type": "boolean"
},
{
"type": "null"
}
]
- },
- "styles": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/InlineStyleInput"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "version": {
- "type": "number"
}
},
"required": [
- "styles",
- "version"
+ "id",
+ "path"
],
"additionalProperties": false
},
- "SetNotebookConfRequestInput": {
+ "ReorderData": {
"type": "object",
"properties": {
- "conf": {
- "anyOf": [
- {
- "$ref": "#/$defs/NotebookConfPatchInput"
- },
- {
- "type": "null"
- }
- ]
+ "changed": {
+ "type": "boolean"
},
"notebook": {
"type": "string"
- }
- },
- "required": [
- "notebook"
- ],
- "additionalProperties": false
- },
- "SetNotebookIconRequestInput": {
- "type": "object",
- "properties": {
- "icon": {
- "type": "string"
},
- "notebook": {
+ "parentPath": {
"type": "string"
}
},
"required": [
- "icon",
- "notebook"
+ "changed"
],
"additionalProperties": false
},
- "SetPetalEnabledRequestInput": {
+ "ReorderNotebooksRequestInput": {
"type": "object",
"properties": {
- "app": {
+ "position": {
"anyOf": [
{
"type": "string"
@@ -11037,205 +11261,161 @@
}
]
},
- "enabled": {
- "type": "boolean"
- },
- "packageName": {
- "type": "string"
- }
- },
- "required": [
- "enabled",
- "packageName"
- ],
- "additionalProperties": false
- },
- "SetPetalPublishEnabledRequestInput": {
- "type": "object",
- "properties": {
- "enabled": {
- "type": "boolean"
+ "sourceIDs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "packageName": {
- "type": "string"
+ "targetID": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
- "required": [
- "enabled",
- "packageName"
- ],
"additionalProperties": false
},
- "SetSnapshotMemoRequestInput": {
+ "ResetGraphData": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
- },
- "memo": {
- "type": "string"
+ "conf": {
+ "$ref": "#/$defs/GlobalGraphConf"
}
},
"required": [
- "id",
- "memo"
+ "conf"
],
"additionalProperties": false
},
- "SetSnippetRequestInput": {
+ "ResetLocalGraphData": {
"type": "object",
"properties": {
- "snippets": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/SnippetInput"
- }
+ "conf": {
+ "$ref": "#/$defs/LocalGraphConf"
}
},
"required": [
- "snippets"
+ "conf"
],
"additionalProperties": false
},
- "Shorthand": {
+ "RichClipboardAssetInput": {
"type": "object",
"properties": {
- "hCreated": {
- "type": "string"
- },
- "oId": {
- "type": "string"
- },
- "shorthandContent": {
- "type": "string"
- },
- "shorthandDesc": {
+ "box": {
"type": "string"
},
- "shorthandFrom": {
+ "index": {
"type": "integer"
},
- "shorthandMd": {
- "type": "string"
- },
- "shorthandTitle": {
- "type": "string"
- },
- "shorthandURL": {
+ "path": {
"type": "string"
}
},
"required": [
- "hCreated",
- "oId",
- "shorthandContent",
- "shorthandDesc",
- "shorthandFrom",
- "shorthandMd",
- "shorthandTitle",
- "shorthandURL"
+ "index",
+ "path"
],
"additionalProperties": false
},
- "ShorthandPage": {
+ "RichClipboardPrepared": {
"type": "object",
"properties": {
- "pagination": {
- "$ref": "#/$defs/ShorthandPagination"
- },
- "shorthands": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Shorthand"
- },
- {
- "type": "null"
+ "assets": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/RichClipboardPreparedAsset"
}
- ]
- }
- }
- },
- "required": [
- "pagination",
- "shorthands"
- ],
- "additionalProperties": false
- },
- "ShorthandPagination": {
- "type": "object",
- "properties": {
- "paginationPageCount": {
- "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "paginationPageNums": {
+ "batch": {
+ "type": "string"
+ },
+ "groups": {
"anyOf": [
{
"type": "array",
"items": {
- "type": "integer"
+ "type": "string"
}
},
{
"type": "null"
}
]
- },
- "paginationRecordCount": {
- "type": "integer"
}
},
"required": [
- "paginationPageCount",
- "paginationPageNums",
- "paginationRecordCount"
+ "assets",
+ "batch",
+ "groups"
],
"additionalProperties": false
},
- "ShorthandsData": {
+ "RichClipboardPreparedAsset": {
"type": "object",
"properties": {
- "code": {
+ "index": {
"type": "integer"
},
- "data": {
- "$ref": "#/$defs/ShorthandPage"
- },
- "msg": {
+ "path": {
"type": "string"
}
},
"required": [
- "code",
- "data",
- "msg"
+ "index",
+ "path"
],
"additionalProperties": false
},
- "ShorthandsRequestInput": {
+ "SQLQueryRequestInput": {
"type": "object",
"properties": {
- "page": {
- "type": "number"
+ "mode": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "stmt": {
+ "type": "string"
}
},
"required": [
- "page"
+ "stmt"
],
"additionalProperties": false
},
- "Snippet": {
+ "SaveTemplateRequestInput": {
"type": "object",
"properties": {
- "content": {
+ "databaseMode": {
"type": "string"
},
- "disabledInPublish": {
- "type": "boolean"
- },
- "enabled": {
- "type": "boolean"
+ "directory": {
+ "type": "string"
},
"id": {
"type": "string"
@@ -11243,199 +11423,134 @@
"name": {
"type": "string"
},
- "type": {
- "type": "string"
+ "overwrite": {
+ "type": "boolean"
}
},
"required": [
- "content",
- "disabledInPublish",
- "enabled",
"id",
"name",
- "type"
+ "overwrite"
],
"additionalProperties": false
},
- "SnippetInput": {
+ "SearchAsset": {
"type": "object",
"properties": {
- "content": {
- "type": "string"
- },
- "disabledInPublish": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
- },
- "enabled": {
- "type": "boolean"
- },
- "id": {
+ "hName": {
"type": "string"
},
- "name": {
+ "path": {
"type": "string"
},
- "type": {
- "type": "string"
+ "updated": {
+ "type": "integer"
}
},
"required": [
- "content",
- "enabled",
- "id",
- "name",
- "type"
+ "hName",
+ "path",
+ "updated"
],
"additionalProperties": false
},
- "SnippetsData": {
+ "SearchAssetContentData": {
"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": {
+ "assetContents": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetContent"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
}
]
},
- "keys": {
- "type": "array",
- "items": {
- "type": "string"
- }
+ "matchedAssetCount": {
+ "type": "integer"
+ },
+ "pageCount": {
+ "type": "integer"
}
},
"required": [
- "keys"
+ "assetContents",
+ "matchedAssetCount",
+ "pageCount"
],
"additionalProperties": false
},
- "StorageRemoveRequestInput": {
+ "SearchAssetContentRequestInput": {
"type": "object",
"properties": {
- "app": {
+ "method": {
"anyOf": [
{
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "key": {
- "type": "string"
- }
- },
- "required": [
- "key"
- ],
- "additionalProperties": false
- },
- "StorageSetKeysRequestInput": {
- "type": "object",
- "properties": {
- "app": {
+ "orderBy": {
"anyOf": [
{
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "keyVals": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- }
- },
- "required": [
- "keyVals"
- ],
- "additionalProperties": false
- },
- "StorageSetRequestInput": {
- "type": "object",
- "properties": {
- "app": {
+ "page": {
"anyOf": [
{
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "key": {
- "type": "string"
+ "pageSize": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "val": {
+ "query": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "types": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
},
{
"type": "null"
@@ -11443,34 +11558,42 @@
]
}
},
- "required": [
- "key"
- ],
"additionalProperties": false
},
- "SwapBlockRefRequestInput": {
+ "SearchAssetRequestInput": {
"type": "object",
"properties": {
- "defID": {
- "type": "string"
- },
- "includeChildren": {
- "type": "boolean"
+ "exts": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "refID": {
+ "k": {
"type": "string"
}
},
"required": [
- "defID",
- "includeChildren",
- "refID"
+ "k"
],
"additionalProperties": false
},
- "TagData": {
+ "SearchBlock": {
"type": "object",
"properties": {
+ "alias": {
+ "type": "string"
+ },
+ "box": {
+ "type": "string"
+ },
"children": {
"anyOf": [
{
@@ -11478,7 +11601,7 @@
"items": {
"anyOf": [
{
- "$ref": "#/$defs/TagData"
+ "$ref": "#/$defs/SearchBlock"
},
{
"type": "null"
@@ -11491,43 +11614,38 @@
}
]
},
+ "content": {
+ "type": "string"
+ },
"count": {
"type": "integer"
},
- "depth": {
- "type": "integer"
+ "created": {
+ "type": "string"
},
- "label": {
+ "defID": {
"type": "string"
},
- "name": {
+ "defPath": {
"type": "string"
},
- "type": {
+ "depth": {
+ "type": "integer"
+ },
+ "fcontent": {
"type": "string"
- }
- },
- "required": [
- "children",
- "count",
- "depth",
- "label",
- "name",
- "type"
- ],
- "additionalProperties": false
- },
- "TailChildBlocksRequestInput": {
- "type": "object",
- "properties": {
- "id": {
+ },
+ "folded": {
+ "type": "boolean"
+ },
+ "hPath": {
"type": "string"
},
- "ids": {
+ "ial": {
"anyOf": [
{
- "type": "array",
- "items": {
+ "type": "object",
+ "additionalProperties": {
"type": "string"
}
},
@@ -11536,168 +11654,41 @@
}
]
},
- "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
- },
- "TemplateDocumentInfo": {
- "type": "object",
- "properties": {
- "directory": {
- "type": "string"
- },
- "hasDatabase": {
- "type": "boolean"
- },
- "name": {
- "type": "string"
- }
- },
- "required": [
- "directory",
- "hasDatabase",
- "name"
- ],
- "additionalProperties": false
- },
- "TemplateDocumentRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
- }
- },
- "required": [
- "id"
- ],
- "additionalProperties": false
- },
- "TemplateFileEntry": {
- "type": "object",
- "properties": {
- "isDir": {
- "type": "boolean"
- },
- "isPackage": {
- "type": "boolean"
- },
- "path": {
- "type": "string"
- }
- },
- "required": [
- "isDir",
- "path"
- ],
- "additionalProperties": false
- },
- "TemplateFileRequestInput": {
- "type": "object",
- "properties": {
- "action": {
+ "markdown": {
"type": "string"
},
- "content": {
+ "memo": {
"type": "string"
},
- "path": {
+ "name": {
"type": "string"
},
- "revision": {
+ "number": {
"type": "string"
},
- "target": {
- "type": "string"
- }
- },
- "additionalProperties": false
- },
- "TemplateFileRevision": {
- "type": "object",
- "properties": {
- "revision": {
- "type": "string"
- }
- },
- "required": [
- "revision"
- ],
- "additionalProperties": false
- },
- "TemplateFileSource": {
- "type": "object",
- "properties": {
- "content": {
+ "parentID": {
"type": "string"
},
"path": {
"type": "string"
},
- "revision": {
- "type": "string"
- }
- },
- "required": [
- "content",
- "revision"
- ],
- "additionalProperties": false
- },
- "TemplatePlan": {
- "type": "object",
- "properties": {
- "count": {
+ "refCount": {
"type": "integer"
},
- "id": {
+ "refText": {
"type": "string"
},
- "nodes": {
+ "refs": {
"anyOf": [
{
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/TemplatePlanNode"
+ "$ref": "#/$defs/SearchBlock"
},
{
"type": "null"
@@ -11709,158 +11700,168 @@
"type": "null"
}
]
- }
- },
- "required": [
- "count",
- "id",
- "nodes"
- ],
- "additionalProperties": false
- },
- "TemplatePlanNode": {
- "type": "object",
- "properties": {
- "depth": {
+ },
+ "riffCard": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlockCard"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "riffCardID": {
+ "type": "string"
+ },
+ "rootID": {
+ "type": "string"
+ },
+ "sort": {
"type": "integer"
},
- "hPath": {
+ "subType": {
"type": "string"
},
- "id": {
+ "tag": {
"type": "string"
},
- "parentID": {
+ "type": {
"type": "string"
},
- "title": {
+ "updated": {
"type": "string"
}
},
"required": [
+ "alias",
+ "box",
+ "children",
+ "content",
+ "count",
+ "created",
+ "defID",
+ "defPath",
"depth",
+ "fcontent",
+ "folded",
"hPath",
+ "ial",
"id",
+ "markdown",
+ "memo",
+ "name",
"parentID",
- "title"
+ "path",
+ "refCount",
+ "refText",
+ "refs",
+ "riffCard",
+ "riffCardID",
+ "rootID",
+ "sort",
+ "subType",
+ "tag",
+ "type",
+ "updated"
],
"additionalProperties": false
},
- "TransferBlockRefRequestInput": {
+ "SearchBlockCard": {
"type": "object",
"properties": {
- "fromID": {
+ "due": {
"type": "string"
},
- "refIDs": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- },
- "reloadUI": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "type": "null"
- }
- ]
+ "lapses": {
+ "type": "integer"
},
- "toID": {
+ "lastReview": {
"type": "string"
+ },
+ "reps": {
+ "type": "integer"
+ },
+ "state": {
+ "type": "integer"
}
},
"required": [
- "fromID",
- "toID"
+ "due",
+ "lapses",
+ "lastReview",
+ "reps",
+ "state"
],
"additionalProperties": false
},
- "TreeStatData": {
+ "SearchBlockRequestInput": {
"type": "object",
"properties": {
- "containsEmbed": {
- "type": "boolean"
- },
- "embedStat": {
+ "groupBy": {
"anyOf": [
{
- "$ref": "#/$defs/EmbedStat"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "reqId": {
- "$ref": "#/$defs/JSONValue"
- },
- "stat": {
+ "method": {
"anyOf": [
{
- "$ref": "#/$defs/BlockStat"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "statWithEmbed": {
+ "orderBy": {
"anyOf": [
{
- "$ref": "#/$defs/BlockStat"
+ "type": "number"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "reqId",
- "stat"
- ],
- "additionalProperties": false
- },
- "TreeStatRequestInput": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string"
},
- "ids": {
+ "page": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "number"
},
{
"type": "null"
}
]
},
- "includeEmbed": {
+ "pageSize": {
"anyOf": [
{
- "type": "boolean"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "notebook": {
+ "paths": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "query": {
"anyOf": [
{
"type": "string"
@@ -11870,10 +11871,23 @@
}
]
},
- "reqId": {
+ "subTypes": {
"anyOf": [
{
- "$ref": "#/$defs/JSONValue"
+ "$ref": "#/$defs/SearchSubtypeFilterInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "types": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
+ }
},
{
"type": "null"
@@ -11881,80 +11895,163 @@
]
}
},
- "required": [
- "id"
- ],
"additionalProperties": false
},
- "TrimmedIDRequestInput": {
+ "SearchBlocksData": {
"type": "object",
"properties": {
- "id": {
- "type": "string"
+ "blocks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "matchedBlockCount": {
+ "type": "integer"
+ },
+ "matchedRootCount": {
+ "type": "integer"
+ },
+ "pageCount": {
+ "type": "integer"
}
},
"required": [
- "id"
+ "blocks",
+ "matchedBlockCount",
+ "matchedRootCount",
+ "pageCount"
],
"additionalProperties": false
},
- "UnfoldedParentData": {
+ "SearchEmbedBlockRequestInput": {
"type": "object",
"properties": {
- "parentID": {
+ "breadcrumb": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "embedBlockID": {
"type": "string"
- }
- },
- "required": [
- "parentID"
- ],
- "additionalProperties": false
- },
- "UnlockNotebookRequestInput": {
- "type": "object",
- "properties": {
+ },
+ "excludeIDs": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "headingMode": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
"notebook": {
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "password": {
+ "stmt": {
"type": "string"
}
},
"required": [
- "notebook",
- "password"
+ "embedBlockID",
+ "excludeIDs",
+ "stmt"
],
"additionalProperties": false
},
- "UnzipRequestInput": {
+ "SearchHeadingFilterInput": {
"type": "object",
"properties": {
- "path": {
- "type": "string"
+ "h1": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "zipPath": {
- "type": "string"
- }
- },
- "required": [
- "path",
- "zipPath"
- ],
- "additionalProperties": false
- },
- "UpdateBlockRequestInput": {
- "type": "object",
- "properties": {
- "data": {
- "type": "string"
+ "h2": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "dataType": {
- "type": "string"
+ "h3": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "id": {
- "type": "string"
+ "h4": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "lockType": {
+ "h5": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "h6": {
"anyOf": [
{
"type": "boolean"
@@ -11965,135 +12062,52 @@
]
}
},
- "required": [
- "data",
- "dataType",
- "id"
- ],
- "additionalProperties": false
- },
- "UpdateChannelRequestInput": {
- "type": "object",
- "properties": {
- "updateChannel": {
- "type": "string"
- }
- },
- "required": [
- "updateChannel"
- ],
"additionalProperties": false
},
- "UpdateEmbedBlockRequestInput": {
+ "SearchHistoryData": {
"type": "object",
"properties": {
- "content": {
- "type": "string"
+ "histories": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "id": {
- "type": "string"
+ "pageCount": {
+ "type": "integer"
+ },
+ "totalCount": {
+ "type": "integer"
}
},
"required": [
- "content",
- "id"
+ "histories",
+ "pageCount",
+ "totalCount"
],
"additionalProperties": false
},
- "UpdatePinnedDocsRequestInput": {
+ "SearchHistoryRequestInput": {
"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": {
+ "notebook": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "string"
},
{
"type": "null"
}
]
},
- "values": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/$defs/JSONValue"
- }
- }
- },
- "required": [
- "key"
- ],
- "additionalProperties": false
- },
- "VirtualBlockRefRequestInput": {
- "type": "object",
- "properties": {
- "keywords": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- },
- "required": [
- "keywords"
- ],
- "additionalProperties": false
- },
- "WPSPresentationData": {
- "type": "object",
- "properties": {
- "converted": {
- "type": "boolean"
- },
- "dom": {
- "type": "string"
- }
- },
- "required": [
- "converted",
- "dom"
- ],
- "additionalProperties": false
- },
- "WPSPresentationRequestInput": {
- "type": "object",
- "properties": {
- "data": {
- "type": "string"
- },
- "text": {
+ "op": {
"anyOf": [
{
"type": "string"
@@ -12103,63 +12117,55 @@
}
]
},
- "type": {
- "type": "string"
- }
- },
- "required": [
- "data",
- "type"
- ],
- "additionalProperties": false
- },
- "WordCountData": {
- "type": "object",
- "properties": {
- "reqId": {
- "$ref": "#/$defs/JSONValue"
- },
- "stat": {
+ "page": {
"anyOf": [
{
- "$ref": "#/$defs/BlockStat"
+ "type": "number"
},
{
"type": "null"
}
]
- }
- },
- "required": [
- "reqId",
- "stat"
- ],
- "additionalProperties": false
- },
- "WorkspaceAVBuiltinColorUpdateInput": {
- "type": "object",
- "properties": {
- "customized": {
+ },
+ "query": {
"anyOf": [
{
- "type": "boolean"
+ "type": "string"
},
{
"type": "null"
}
]
},
- "dark": {
+ "type": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "number"
},
{
"type": "null"
}
]
- },
- "hidden": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "SearchKeywordRequestInput": {
+ "type": "object",
+ "properties": {
+ "k": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "k"
+ ],
+ "additionalProperties": false
+ },
+ "SearchListFilterInput": {
+ "type": "object",
+ "properties": {
+ "o": {
"anyOf": [
{
"type": "boolean"
@@ -12169,20 +12175,20 @@
}
]
},
- "index": {
+ "t": {
"anyOf": [
{
- "type": "integer"
+ "type": "boolean"
},
{
"type": "null"
}
]
},
- "light": {
+ "u": {
"anyOf": [
{
- "$ref": "#/$defs/InlineStyleThemeInput"
+ "type": "boolean"
},
{
"type": "null"
@@ -12192,45 +12198,41 @@
},
"additionalProperties": false
},
- "WorkspaceAVPaletteRequestInput": {
+ "SearchPageRequestInput": {
"type": "object",
"properties": {
- "app": {
+ "page": {
"anyOf": [
{
- "type": "string"
+ "type": "number"
},
{
"type": "null"
}
]
},
- "builtinColors": {
+ "pageSize": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/WorkspaceAVBuiltinColorUpdateInput"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "number"
},
{
"type": "null"
}
]
- },
- "colors": {
+ }
+ },
+ "additionalProperties": false
+ },
+ "SearchPath": {
+ "type": "object",
+ "properties": {
+ "blocks": {
"type": "array",
"items": {
"anyOf": [
{
- "$ref": "#/$defs/AttributeViewCustomColorInput"
+ "$ref": "#/$defs/SearchBlock"
},
{
"type": "null"
@@ -12238,60 +12240,4409 @@
]
}
},
- "order": {
+ "box": {
+ "type": "string"
+ },
+ "children": {
"type": "array",
"items": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
+ },
+ "count": {
+ "type": "integer"
+ },
+ "created": {
+ "type": "string"
+ },
+ "depth": {
+ "type": "integer"
+ },
+ "folded": {
+ "type": "boolean"
+ },
+ "hPath": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nodeType": {
+ "type": "string"
+ },
+ "number": {
+ "type": "string"
+ },
+ "subType": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ },
+ "updated": {
+ "type": "string"
}
},
"required": [
- "colors",
- "order"
+ "box",
+ "count",
+ "created",
+ "depth",
+ "folded",
+ "hPath",
+ "id",
+ "name",
+ "nodeType",
+ "subType",
+ "type",
+ "updated"
],
"additionalProperties": false
},
- "WorkspaceInfoData": {
+ "SearchPathRequestInput": {
"type": "object",
"properties": {
- "siyuanVer": {
+ "path": {
"type": "string"
+ }
+ },
+ "required": [
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ "SearchRefBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "beforeLen": {
+ "type": "number"
},
- "workspaceDir": {
+ "id": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "isDatabase": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "isSquareBrackets": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "k": {
+ "type": "string"
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "reqId": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/JSONValue"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "rootID": {
"type": "string"
}
},
+ "additionalProperties": false
+ },
+ "SearchRefCorrelation": {
+ "type": "object",
+ "properties": {
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ },
"required": [
- "siyuanVer",
- "workspaceDir"
+ "reqId"
],
"additionalProperties": false
},
- "ZipRequestInput": {
+ "SearchRefResult": {
"type": "object",
"properties": {
- "path": {
- "type": "string"
+ "blocks": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
- "zipPath": {
+ "k": {
"type": "string"
+ },
+ "newDoc": {
+ "type": "boolean"
+ },
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
}
},
"required": [
- "path",
- "zipPath"
+ "blocks",
+ "k",
+ "newDoc",
+ "reqId"
],
"additionalProperties": false
- }
- },
- "endpoints": [
+ },
+ "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
+ },
+ "SearchSubtypeFilterInput": {
+ "type": "object",
+ "properties": {
+ "heading": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchHeadingFilterInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "list": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchListFilterInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "listItem": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchListFilterInput"
+ },
+ {
+ "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
+ },
+ "SearchTemplateData": {
+ "type": "object",
+ "properties": {
+ "k": {
+ "type": "string"
+ },
+ "templates": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchTemplateResult"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "k",
+ "templates"
+ ],
+ "additionalProperties": false
+ },
+ "SearchTemplateResult": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "relativePath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "path",
+ "relativePath"
+ ],
+ "additionalProperties": false
+ },
+ "SearchWidgetData": {
+ "type": "object",
+ "properties": {
+ "k": {
+ "type": "string"
+ },
+ "widgets": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchWidgetResult"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "k",
+ "widgets"
+ ],
+ "additionalProperties": false
+ },
+ "SearchWidgetResult": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "SetBazaarPackageRatingRequestInput": {
+ "type": "object",
+ "properties": {
+ "packageName": {
+ "type": "string"
+ },
+ "packageType": {
+ "type": "string"
+ },
+ "rating": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "packageName",
+ "packageType",
+ "rating"
+ ],
+ "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
+ },
+ "SetGraphConfRequestInput": {
+ "type": "object",
+ "properties": {
+ "conf": {
+ "$ref": "#/$defs/GraphConfigurationFieldsInput"
+ },
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "conf",
+ "type"
+ ],
+ "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
+ },
+ "SetPetalEnabledRequestInput": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "enabled",
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "SetPetalPublishEnabledRequestInput": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "enabled",
+ "packageName"
+ ],
+ "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
+ },
+ "Shorthand": {
+ "type": "object",
+ "properties": {
+ "hCreated": {
+ "type": "string"
+ },
+ "oId": {
+ "type": "string"
+ },
+ "shorthandContent": {
+ "type": "string"
+ },
+ "shorthandDesc": {
+ "type": "string"
+ },
+ "shorthandFrom": {
+ "type": "integer"
+ },
+ "shorthandMd": {
+ "type": "string"
+ },
+ "shorthandTitle": {
+ "type": "string"
+ },
+ "shorthandURL": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "hCreated",
+ "oId",
+ "shorthandContent",
+ "shorthandDesc",
+ "shorthandFrom",
+ "shorthandMd",
+ "shorthandTitle",
+ "shorthandURL"
+ ],
+ "additionalProperties": false
+ },
+ "ShorthandPage": {
+ "type": "object",
+ "properties": {
+ "pagination": {
+ "$ref": "#/$defs/ShorthandPagination"
+ },
+ "shorthands": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Shorthand"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ }
+ },
+ "required": [
+ "pagination",
+ "shorthands"
+ ],
+ "additionalProperties": false
+ },
+ "ShorthandPagination": {
+ "type": "object",
+ "properties": {
+ "paginationPageCount": {
+ "type": "integer"
+ },
+ "paginationPageNums": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "paginationRecordCount": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "paginationPageCount",
+ "paginationPageNums",
+ "paginationRecordCount"
+ ],
+ "additionalProperties": false
+ },
+ "ShorthandsData": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "$ref": "#/$defs/ShorthandPage"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "data",
+ "msg"
+ ],
+ "additionalProperties": false
+ },
+ "ShorthandsRequestInput": {
+ "type": "object",
+ "properties": {
+ "page": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "page"
+ ],
+ "additionalProperties": false
+ },
+ "Snippet": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "disabledInPublish": {
+ "type": "boolean"
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "disabledInPublish",
+ "enabled",
+ "id",
+ "name",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "SnippetInput": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "disabledInPublish": {
+ "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
+ },
+ "TemplateDocumentInfo": {
+ "type": "object",
+ "properties": {
+ "directory": {
+ "type": "string"
+ },
+ "hasDatabase": {
+ "type": "boolean"
+ },
+ "name": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "directory",
+ "hasDatabase",
+ "name"
+ ],
+ "additionalProperties": false
+ },
+ "TemplateDocumentRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "TemplateFileEntry": {
+ "type": "object",
+ "properties": {
+ "isDir": {
+ "type": "boolean"
+ },
+ "isPackage": {
+ "type": "boolean"
+ },
+ "path": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "isDir",
+ "path"
+ ],
+ "additionalProperties": false
+ },
+ "TemplateFileRequestInput": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "string"
+ },
+ "target": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "TemplateFileRevision": {
+ "type": "object",
+ "properties": {
+ "revision": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "revision"
+ ],
+ "additionalProperties": false
+ },
+ "TemplateFileSource": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "revision"
+ ],
+ "additionalProperties": false
+ },
+ "TemplatePlan": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "nodes": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/TemplatePlanNode"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "count",
+ "id",
+ "nodes"
+ ],
+ "additionalProperties": false
+ },
+ "TemplatePlanNode": {
+ "type": "object",
+ "properties": {
+ "depth": {
+ "type": "integer"
+ },
+ "hPath": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "parentID": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "depth",
+ "hPath",
+ "id",
+ "parentID",
+ "title"
+ ],
+ "additionalProperties": false
+ },
+ "TransferBlockRefRequestInput": {
+ "type": "object",
+ "properties": {
+ "fromID": {
+ "type": "string"
+ },
+ "refIDs": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "reloadUI": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "toID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "fromID",
+ "toID"
+ ],
+ "additionalProperties": false
+ },
+ "TreeStatData": {
+ "type": "object",
+ "properties": {
+ "containsEmbed": {
+ "type": "boolean"
+ },
+ "embedStat": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/EmbedStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
+ },
+ "stat": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "statWithEmbed": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "reqId",
+ "stat"
+ ],
+ "additionalProperties": false
+ },
+ "TreeStatRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "ids": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "includeEmbed": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "notebook": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "reqId": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/JSONValue"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "TrimmedIDRequestInput": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UnfoldedParentData": {
+ "type": "object",
+ "properties": {
+ "parentID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "parentID"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarIconRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarPluginRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarTemplateRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarThemeRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "additionalProperties": false
+ },
+ "UninstallBazaarWidgetRequestInput": {
+ "type": "object",
+ "properties": {
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "packageName"
+ ],
+ "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
+ },
+ "UpdateBazaarPackageRequestInput": {
+ "type": "object",
+ "properties": {
+ "frontend": {
+ "type": "string"
+ },
+ "keyword": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "packageName": {
+ "type": "string"
+ },
+ "packageType": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "frontend",
+ "packageName",
+ "packageType"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ },
+ "dataType": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "lockType": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "data",
+ "dataType",
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateChannelRequestInput": {
+ "type": "object",
+ "properties": {
+ "updateChannel": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "updateChannel"
+ ],
+ "additionalProperties": false
+ },
+ "UpdateEmbedBlockRequestInput": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "content",
+ "id"
+ ],
+ "additionalProperties": false
+ },
+ "UpdatePinnedDocsRequestInput": {
+ "type": "object",
+ "properties": {
+ "action": {
+ "type": "string"
+ },
+ "after": {
+ "type": "boolean"
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "targetID": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "action",
+ "ids"
+ ],
+ "additionalProperties": false
+ },
+ "ViewStatePatchRequestInput": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ },
+ "removeKeys": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "values": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/$defs/JSONValue"
+ }
+ }
+ },
+ "required": [
+ "key"
+ ],
+ "additionalProperties": false
+ },
+ "VirtualBlockRefRequestInput": {
+ "type": "object",
+ "properties": {
+ "keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "keywords"
+ ],
+ "additionalProperties": false
+ },
+ "WPSPresentationData": {
+ "type": "object",
+ "properties": {
+ "converted": {
+ "type": "boolean"
+ },
+ "dom": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "converted",
+ "dom"
+ ],
+ "additionalProperties": false
+ },
+ "WPSPresentationRequestInput": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ },
+ "text": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "type": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "data",
+ "type"
+ ],
+ "additionalProperties": false
+ },
+ "WordCountData": {
+ "type": "object",
+ "properties": {
+ "reqId": {
+ "$ref": "#/$defs/JSONValue"
+ },
+ "stat": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockStat"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "required": [
+ "reqId",
+ "stat"
+ ],
+ "additionalProperties": false
+ },
+ "WorkspaceAVBuiltinColorUpdateInput": {
+ "type": "object",
+ "properties": {
+ "customized": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "dark": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleThemeInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "hidden": {
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "index": {
+ "anyOf": [
+ {
+ "type": "integer"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "light": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/InlineStyleThemeInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "additionalProperties": false
+ },
+ "WorkspaceAVPaletteRequestInput": {
+ "type": "object",
+ "properties": {
+ "app": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "builtinColors": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/WorkspaceAVBuiltinColorUpdateInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "colors": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AttributeViewCustomColorInput"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required": [
+ "colors",
+ "order"
+ ],
+ "additionalProperties": false
+ },
+ "WorkspaceInfoData": {
+ "type": "object",
+ "properties": {
+ "siyuanVer": {
+ "type": "string"
+ },
+ "workspaceDir": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "siyuanVer",
+ "workspaceDir"
+ ],
+ "additionalProperties": false
+ },
+ "ZipRequestInput": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string"
+ },
+ "zipPath": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "path",
+ "zipPath"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "endpoints": [
+ {
+ "method": "GET",
+ "path": "/api/plugin",
+ "handler": "listLoadedPluginsGET",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LoadedPlugin"
+ },
+ {
+ "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": "GET",
+ "path": "/api/plugin/rpc",
+ "handler": "getLoadedPluginRPC",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/LoadedPluginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LoadedPlugin"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1,
+ 2,
+ 3,
+ 4
+ ]
+ },
+ "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/plugin/rpc/:name",
+ "handler": "getLoadedPluginRPCByName",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/LoadedPluginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/LoadedPlugin"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1,
+ 2,
+ 3,
+ 4
+ ]
+ },
+ "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",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BootProgressData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/api/system/version",
+ "handler": "version",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "string"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/ws/plugin/rpc",
+ "handler": "pluginJsonRpcWebSocket",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "websocket",
+ "websocket": {
+ "incoming": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "outgoing": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
+ },
+ {
+ "$ref": "#/$defs/PluginRPCNotification"
+ }
+ ]
+ },
+ "failureStatus": 404
+ }
+ },
+ {
+ "method": "GET",
+ "path": "/ws/plugin/rpc/:name",
+ "handler": "pluginJsonRpcWebSocketByName",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "websocket",
+ "websocket": {
+ "incoming": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ },
+ "minItems": 1
+ }
+ ]
+ },
+ "outgoing": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/PluginRPCSuccess"
+ },
+ {
+ "$ref": "#/$defs/PluginRPCFailure"
+ }
+ ]
+ },
+ "minItems": 1
+ },
+ {
+ "$ref": "#/$defs/PluginRPCNotification"
+ }
+ ]
+ },
+ "failureStatus": 404
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/checkActivationcode",
+ "handler": "checkActivationcode",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/CheckActivationCodeRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/deactivate",
+ "handler": "deactivateUser",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/login",
+ "handler": "login",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/AccountLoginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AccountLoginData"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1,
+ 10
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AccountLoginData"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/startFreeTrial",
+ "handler": "startFreeTrial",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/account/useActivationcode",
+ "handler": "useActivationcode",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ActivationCodeRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/archive/unzip",
+ "handler": "unzip",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/UnzipRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/archive/zip",
+ "handler": "zip",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ZipRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/batchGetBlockAttrs",
+ "handler": "batchGetBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BlockIDsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/batchSetBlockAttrs",
+ "handler": "batchSetBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/getBlockAttrs",
+ "handler": "getBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BlockIDRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/getBookmarkLabels",
+ "handler": "getBookmarkLabels",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/resetBlockAttrs",
+ "handler": "resetBlockAttrs",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/attr/setBlockAttrs",
+ "handler": "setBlockAttrs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/SetBlockAttrsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/searchAttributeViewNonRelationKey",
+ "handler": "searchAttributeViewNonRelationKey",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/batchUpdatePackage",
+ "handler": "batchUpdatePackage",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BatchUpdatePackageRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarIcon",
+ "handler": "getBazaarIcon",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarIconRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackage",
+ "handler": "getBazaarPackage",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackageDetail"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageREADME",
+ "handler": "getBazaarPackageREADME",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageREADMERequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarREADMEData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageRating",
+ "handler": "getBazaarPackageRating",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRatingRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarRatingResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageRatings",
+ "handler": "getBazaarPackageRatings",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageRatingsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarRatingsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPackageUserRatings",
+ "handler": "getBazaarPackageUserRatings",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPackageUserRatingsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarUserRatingsResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarUserRatingsResult"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarPlugin",
+ "handler": "getBazaarPlugin",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetBazaarPluginRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
{
- "method": "GET",
- "path": "/api/plugin",
- "handler": "listLoadedPluginsGET",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarTemplate",
+ "handler": "getBazaarTemplate",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -12305,24 +16656,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/LoadedPlugin"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -12341,7 +16675,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -12378,12 +16713,12 @@
}
},
{
- "method": "GET",
- "path": "/api/plugin/rpc",
- "handler": "getLoadedPluginRPC",
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarTheme",
+ "handler": "getBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/LoadedPluginRequestInput"
+ "$ref": "#/$defs/GetBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -12397,14 +16732,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/LoadedPlugin"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -12424,10 +16752,7 @@
"type": "integer",
"enum": [
-1,
- 1,
- 2,
- 3,
- 4
+ 1
]
},
"data": {
@@ -12464,12 +16789,12 @@
}
},
{
- "method": "GET",
- "path": "/api/plugin/rpc/:name",
- "handler": "getLoadedPluginRPCByName",
+ "method": "POST",
+ "path": "/api/bazaar/getBazaarWidget",
+ "handler": "getBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/LoadedPluginRequestInput"
+ "$ref": "#/$defs/GetBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -12482,10 +16807,43 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
"data": {
"anyOf": [
{
- "$ref": "#/$defs/LoadedPlugin"
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -12501,6 +16859,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledIcon",
+ "handler": "getInstalledIcon",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetInstalledIconRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -12510,10 +16904,7 @@
"type": "integer",
"enum": [
-1,
- 1,
- 2,
- 3,
- 4
+ 1
]
},
"data": {
@@ -12550,12 +16941,12 @@
}
},
{
- "method": "GET",
- "path": "/api/system/bootProgress",
- "handler": "bootProgress",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledPackageSize",
+ "handler": "getInstalledPackageSize",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledPackageSizeRequestInput"
},
"response": {
"anyOf": [
@@ -12569,7 +16960,7 @@
]
},
"data": {
- "$ref": "#/$defs/BootProgressData"
+ "$ref": "#/$defs/BazaarPackageSizeData"
},
"msg": {
"type": "string"
@@ -12588,7 +16979,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -12625,12 +17017,12 @@
}
},
{
- "method": "GET",
- "path": "/api/system/version",
- "handler": "version",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledPlugin",
+ "handler": "getInstalledPlugin",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledPluginRequestInput"
},
"response": {
"anyOf": [
@@ -12644,7 +17036,7 @@
]
},
"data": {
- "type": "string"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -12663,7 +17055,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -12700,17 +17093,37 @@
}
},
{
- "method": "GET",
- "path": "/ws/plugin/rpc",
- "handler": "pluginJsonRpcWebSocket",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledTemplate",
+ "handler": "getInstalledTemplate",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledTemplateRequestInput"
},
"response": {
"anyOf": [
{
- "$ref": "#/$defs/PluginRPCFailure"
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
},
{
"type": "object",
@@ -12718,7 +17131,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -12752,65 +17166,116 @@
"additionalProperties": true
}
]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledTheme",
+ "handler": "getInstalledTheme",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetInstalledThemeRequestInput"
},
- "output": "websocket",
- "websocket": {
- "incoming": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
},
- "minItems": 1
- }
- ]
- },
- "outgoing": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
},
- {
- "type": "array",
- "items": {
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
"anyOf": [
{
- "$ref": "#/$defs/PluginRPCSuccess"
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
- "$ref": "#/$defs/PluginRPCFailure"
+ "type": "null"
}
]
},
- "minItems": 1
+ "msg": {
+ "type": "string"
+ }
},
- {
- "$ref": "#/$defs/PluginRPCNotification"
- }
- ]
- },
- "failureStatus": 404
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
}
},
{
- "method": "GET",
- "path": "/ws/plugin/rpc/:name",
- "handler": "pluginJsonRpcWebSocketByName",
- "body": "none",
+ "method": "POST",
+ "path": "/api/bazaar/getInstalledWidget",
+ "handler": "getInstalledWidget",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/GetInstalledWidgetRequestInput"
},
"response": {
"anyOf": [
{
- "$ref": "#/$defs/PluginRPCFailure"
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/BazaarPackagesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
},
{
"type": "object",
@@ -12818,7 +17283,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -12852,60 +17318,15 @@
"additionalProperties": true
}
]
- },
- "output": "websocket",
- "websocket": {
- "incoming": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PluginRPCRequestFieldsInput"
- },
- "minItems": 1
- }
- ]
- },
- "outgoing": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/PluginRPCSuccess"
- },
- {
- "$ref": "#/$defs/PluginRPCFailure"
- }
- ]
- },
- "minItems": 1
- },
- {
- "$ref": "#/$defs/PluginRPCNotification"
- }
- ]
- },
- "failureStatus": 404
}
},
{
"method": "POST",
- "path": "/api/account/checkActivationcode",
- "handler": "checkActivationcode",
+ "path": "/api/bazaar/getUpdatedPackage",
+ "handler": "getUpdatedPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/CheckActivationCodeRequestInput"
+ "$ref": "#/$defs/GetUpdatedPackageRequestInput"
},
"response": {
"anyOf": [
@@ -12919,7 +17340,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarUpdatedData"
},
"msg": {
"type": "string"
@@ -12956,9 +17377,6 @@
],
"additionalProperties": false
},
- {
- "type": "null"
- },
{
"type": "null"
}
@@ -12980,11 +17398,11 @@
},
{
"method": "POST",
- "path": "/api/account/deactivate",
- "handler": "deactivateUser",
- "body": "none",
+ "path": "/api/bazaar/installBazaarIcon",
+ "handler": "installBazaarIcon",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/InstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -12998,7 +17416,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -13017,7 +17435,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13055,11 +17474,11 @@
},
{
"method": "POST",
- "path": "/api/account/login",
- "handler": "login",
+ "path": "/api/bazaar/installBazaarPlugin",
+ "handler": "installBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/AccountLoginRequestInput"
+ "$ref": "#/$defs/InstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -13073,14 +17492,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/AccountLoginData"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13100,8 +17512,7 @@
"type": "integer",
"enum": [
-1,
- 1,
- 10
+ 1
]
},
"data": {
@@ -13120,16 +17531,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/AccountLoginData"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -13149,11 +17550,11 @@
},
{
"method": "POST",
- "path": "/api/account/startFreeTrial",
- "handler": "startFreeTrial",
- "body": "none",
+ "path": "/api/bazaar/installBazaarTemplate",
+ "handler": "installBazaarTemplate",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/InstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -13167,7 +17568,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13186,7 +17587,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13224,11 +17626,11 @@
},
{
"method": "POST",
- "path": "/api/account/useActivationcode",
- "handler": "useActivationcode",
+ "path": "/api/bazaar/installBazaarTheme",
+ "handler": "installBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/ActivationCodeRequestInput"
+ "$ref": "#/$defs/InstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -13242,7 +17644,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -13261,7 +17663,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13299,11 +17702,11 @@
},
{
"method": "POST",
- "path": "/api/archive/unzip",
- "handler": "unzip",
+ "path": "/api/bazaar/installBazaarWidget",
+ "handler": "installBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/UnzipRequestInput"
+ "$ref": "#/$defs/InstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -13317,7 +17720,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13336,7 +17739,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13374,11 +17778,11 @@
},
{
"method": "POST",
- "path": "/api/archive/zip",
- "handler": "zip",
- "body": "json",
+ "path": "/api/bazaar/installLocalBazaarPackage",
+ "handler": "installLocalBazaarPackage",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/ZipRequestInput"
+ "$ref": "#/$defs/InstallLocalBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -13392,7 +17796,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarLocalInstallResult"
},
"msg": {
"type": "string"
@@ -13411,7 +17815,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13430,6 +17835,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarLocalInstallResult"
}
]
},
@@ -13449,11 +17857,11 @@
},
{
"method": "POST",
- "path": "/api/attr/batchGetBlockAttrs",
- "handler": "batchGetBlockAttrs",
+ "path": "/api/bazaar/setBazaarPackageRating",
+ "handler": "setBazaarPackageRating",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDsRequestInput"
+ "$ref": "#/$defs/SetBazaarPackageRatingRequestInput"
},
"response": {
"anyOf": [
@@ -13467,20 +17875,7 @@
]
},
"data": {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
- }
+ "$ref": "#/$defs/BazaarRatingResult"
},
"msg": {
"type": "string"
@@ -13499,7 +17894,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13518,6 +17914,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -13537,11 +17936,11 @@
},
{
"method": "POST",
- "path": "/api/attr/batchSetBlockAttrs",
- "handler": "batchSetBlockAttrs",
+ "path": "/api/bazaar/uninstallBazaarIcon",
+ "handler": "uninstallBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchSetBlockAttrsRequestInput"
+ "$ref": "#/$defs/UninstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -13555,7 +17954,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -13574,7 +17973,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13612,11 +18012,11 @@
},
{
"method": "POST",
- "path": "/api/attr/getBlockAttrs",
- "handler": "getBlockAttrs",
+ "path": "/api/bazaar/uninstallBazaarPlugin",
+ "handler": "uninstallBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/UninstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -13630,10 +18030,7 @@
]
},
"data": {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13652,7 +18049,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13690,11 +18088,11 @@
},
{
"method": "POST",
- "path": "/api/attr/getBookmarkLabels",
- "handler": "getBookmarkLabels",
- "body": "none",
+ "path": "/api/bazaar/uninstallBazaarTemplate",
+ "handler": "uninstallBazaarTemplate",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/UninstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -13708,17 +18106,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13737,7 +18125,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13775,11 +18164,11 @@
},
{
"method": "POST",
- "path": "/api/attr/resetBlockAttrs",
- "handler": "resetBlockAttrs",
- "body": "none",
+ "path": "/api/bazaar/uninstallBazaarTheme",
+ "handler": "uninstallBazaarTheme",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/UninstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -13793,7 +18182,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -13812,7 +18201,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13850,11 +18240,11 @@
},
{
"method": "POST",
- "path": "/api/attr/setBlockAttrs",
- "handler": "setBlockAttrs",
+ "path": "/api/bazaar/uninstallBazaarWidget",
+ "handler": "uninstallBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/SetBlockAttrsRequestInput"
+ "$ref": "#/$defs/UninstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -13868,7 +18258,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13887,7 +18277,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -13925,11 +18316,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeViewNonRelationKey",
- "handler": "searchAttributeViewNonRelationKey",
- "body": "none",
+ "path": "/api/bazaar/updateBazaarPackage",
+ "handler": "updateBazaarPackage",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/UpdateBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -13943,7 +18334,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -13962,7 +18353,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
diff --git a/kernel/apicontract/typescript.go b/kernel/apicontract/typescript.go
index ff1f64add1..919079a14c 100644
--- a/kernel/apicontract/typescript.go
+++ b/kernel/apicontract/typescript.go
@@ -74,6 +74,13 @@ func (b *Bundle) typeScript(schema *Schema) string {
case "null", "string", "boolean":
return schema.Type
case "array":
+ if schema.MaxItems != nil && schema.MinItems == *schema.MaxItems {
+ items := make([]string, schema.MinItems)
+ for i := range items {
+ items[i] = b.typeScript(schema.Items)
+ }
+ return "[" + strings.Join(items, ", ") + "]"
+ }
if schema.MinItems == 1 {
item := b.typeScript(schema.Items)
return "[" + item + ", ...Array<" + item + ">]"