Skip to content

/api/notebook

closeNotebook

  • 🔥 关闭笔记本
  • /api/notebook/closeNotebook

请求

ts
/**
 * Close a notebook
 */
export interface IPayload {
    /**
     * notebook ID
     */
    readonly notebook: string;
}
json5
/**
 * schemas/kernel/api/notebook/closeNotebook/payload.schema.json5
 * 关闭笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#close-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L206-L220
 * @pathname: /api/notebook/closeNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/closeNotebook/payload.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Close a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/closeNotebook/payload.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Close a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                }
            }
        }
    }
}

响应

ts
/**
 * Close a notebook
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: null;
    /**
     * status message
     */
    readonly msg: string;
}
json5
/**
 * schemas/siyuan/api/notebook/closeNotebook/response.schema.json5
 * 关闭笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#close-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L206-L220
 * @pathname: /api/notebook/closeNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/closeNotebook/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Close a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    type: 'null',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/closeNotebook/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Close a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "type": "null"
                }
            }
        }
    }
}

createNotebook

  • 🔥 创建笔记本
  • /api/notebook/createNotebook

请求

ts
/**
 * Create a notebook
 */
export interface IPayload {
    /**
     * notebook name
     */
    readonly name: string;
}
json5
/**
 * schemas/kernel/api/notebook/createNotebook/payload.schema.json5
 * 创建笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#create-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L129-L163
 * @pathname: /api/notebook/createNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/createNotebook/payload.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Create a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'name',
            ],
            properties: {
                name: {
                    type: 'string',
                    description: 'notebook name',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/createNotebook/payload.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Create a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "notebook name"
                }
            }
        }
    }
}

响应

ts
/**
 * Create a notebook
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * response data
 */
export interface IData {
    readonly notebook: INotebook;
}

/**
 * notebook object
 */
export interface INotebook {
    /**
     * notebook open state
     */
    readonly closed: boolean;
    /**
     * the count of due flash card
     */
    readonly dueFlashcardCount: number;
    /**
     * the count of flash card
     */
    readonly flashcardCount: number;
    /**
     * notebook icon
     */
    readonly icon: string;
    /**
     * notebook ID
     */
    readonly id: string;
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * the count of new flash card
     */
    readonly newFlashcardCount: number;
    /**
     * sequence number
     */
    readonly sort: number;
    /**
     * document sorting mode
     */
    readonly sortMode: number;
}
json5
/**
 * schemas/kernel/api/notebook/createNotebook/response.schema.json5
 * 创建笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#create-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L129-L163
 * @pathname: /api/notebook/createNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/createNotebook/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Create a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'response data',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
            ],
            properties: {
                notebook: {
                    $ref: '#/$defs/notebook',
                },
            },
        },
        notebook: {
            title: 'INotebook',
            description: 'notebook object',

            type: 'object',
            additionalProperties: false,
            required: [
                'id',
                'name',
                'icon',
                'sort',
                'sortMode',
                'closed',
                'newFlashcardCount',
                'dueFlashcardCount',
                'flashcardCount',
            ],
            properties: {
                id: {
                    // 笔记本 ID
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
                name: {
                    // 名称
                    type: 'string',
                    description: 'notebook name',
                },
                icon: {
                    // 图标
                    type: 'string',
                    description: 'notebook icon',
                    examples: [
                        '1f4d1',
                        'material/folder-project.svg',
                    ],
                },
                sort: {
                    // 排序序号
                    type: 'integer',
                    description: 'sequence number',
                    minimum: 0,
                },
                sortMode: {
                    // 文档排序模式
                    type: 'integer',
                    description: 'document sorting mode',
                    minimum: 0,
                },
                closed: {
                    // 是否关闭
                    type: 'boolean',
                    description: 'notebook open state',
                },
                newFlashcardCount: {
                    // 新闪卡的数量
                    type: 'integer',
                    description: 'the count of new flash card',
                    minimum: 0,
                },
                dueFlashcardCount: {
                    // 到期的闪卡数量
                    type: 'integer',
                    description: 'the count of due flash card',
                    minimum: 0,
                },
                flashcardCount: {
                    // 闪卡数量
                    type: 'integer',
                    description: 'the count of flash card',
                    minimum: 0,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/createNotebook/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Create a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "response data",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook"
            ],
            "properties": {
                "notebook": {
                    "$ref": "#/$defs/notebook"
                }
            }
        },
        "notebook": {
            "title": "INotebook",
            "description": "notebook object",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "icon",
                "sort",
                "sortMode",
                "closed",
                "newFlashcardCount",
                "dueFlashcardCount",
                "flashcardCount"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                },
                "icon": {
                    "type": "string",
                    "description": "notebook icon",
                    "examples": [
                        "1f4d1",
                        "material/folder-project.svg"
                    ]
                },
                "sort": {
                    "type": "integer",
                    "description": "sequence number",
                    "minimum": 0
                },
                "sortMode": {
                    "type": "integer",
                    "description": "document sorting mode",
                    "minimum": 0
                },
                "closed": {
                    "type": "boolean",
                    "description": "notebook open state"
                },
                "newFlashcardCount": {
                    "type": "integer",
                    "description": "the count of new flash card",
                    "minimum": 0
                },
                "dueFlashcardCount": {
                    "type": "integer",
                    "description": "the count of due flash card",
                    "minimum": 0
                },
                "flashcardCount": {
                    "type": "integer",
                    "description": "the count of flash card",
                    "minimum": 0
                }
            }
        }
    }
}

getNotebookConf

  • 🔥 获取笔记本配置
  • /api/notebook/getNotebookConf

请求

ts
/**
 * Get notebook configuration
 */
export interface IPayload {
    /**
     * notebook ID
     */
    readonly notebook: string;
}
json5
/**
 * schemas/kernel/api/notebook/getNotebookConf/payload.schema.json5
 * 获取笔记本配置信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#get-notebook-configuration
 * REF: https://github.com/siyuan-note/siyuan/blob/v3.0.12/kernel/api/notebook.go#L236-L262
 * @pathname: /api/notebook/getNotebookConf
 * @version: 3.0.12
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/getNotebookConf/payload.schema.json5',
    $comment: 'v3.0.12',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Get notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/getNotebookConf/payload.schema.json",
    "$comment": "v3.0.12",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Get notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                }
            }
        }
    }
}

响应

ts
/**
 * Get notebook configuration
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * notebook info
 */
export interface IData {
    /**
     * notebook ID
     */
    readonly box: string;
    readonly conf: IConf;
    /**
     * notebook name
     */
    readonly name: string;
}

/**
 * notebook configuration
 */
export interface IConf {
    /**
     * notebook open state
     */
    readonly closed: boolean;
    /**
     * the path of new daily note
     */
    readonly dailyNoteSavePath: string;
    /**
     * the template file path of new daily note
     */
    readonly dailyNoteTemplatePath: string;
    /**
     * New document save notebook
     */
    readonly docCreateSaveBox: string;
    /**
     * New document save location
     */
    readonly docCreateSavePath: string;
    /**
     * notebook icon
     */
    readonly icon: string;
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * The notebook that was stored when a new document was created using block references
     */
    readonly refCreateSaveBox: string;
    /**
     * The document path that was stored when a new document was created using block references
     */
    readonly refCreateSavePath: string;
    /**
     * sequence number
     */
    readonly sort: number;
    /**
     * document sorting mode
     */
    readonly sortMode: number;
}
json5
/**
 * schemas/kernel/api/notebook/getNotebookConf/response.schema.json5
 * 获取笔记本配置信息
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#get-notebook-configuration
 * REF: https://github.com/siyuan-note/siyuan/blob/v3.0.12/kernel/api/notebook.go#L236-L262
 * @pathname: /api/notebook/getNotebookConf
 * @version: 3.0.12
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/getNotebookConf/response.schema.json5',
    $comment: 'v3.0.12',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Get notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'notebook info',

            type: 'object',
            additionalProperties: false,
            required: [
                'box',
                'conf',
                'name',
            ],
            properties: {
                box: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
                conf: {
                    $ref: '#/$defs/conf',
                },
                name: {
                    type: 'string',
                    description: 'notebook name',
                },
            },
        },
        conf: {
            title: 'IConf',
            description: 'notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'closed',
                'dailyNoteSavePath',
                'dailyNoteTemplatePath',
                'docCreateSaveBox',
                'docCreateSavePath',
                'icon',
                'name',
                'refCreateSaveBox',
                'refCreateSavePath',
                'sort',
                'sortMode',
            ],
            properties: {
                closed: {
                    // 笔记本是否关闭
                    type: 'boolean',
                    description: 'notebook open state',
                },
                dailyNoteSavePath: {
                    // 新建日记时的存放路径
                    type: 'string',
                    description: 'the path of new daily note',
                },
                dailyNoteTemplatePath: {
                    // 新建日记的模板位置
                    type: 'string',
                    description: 'the template file path of new daily note',
                },
                docCreateSaveBox: {
                    // 新建文档存放笔记本
                    type: 'string',
                    description: 'New document save notebook',
                },
                docCreateSavePath: {
                    // 新建文档存放位置
                    type: 'string',
                    description: 'New document save location',
                },
                icon: {
                    // 笔记本图标
                    type: 'string',
                    description: 'notebook icon',
                },
                name: {
                    // 笔记本名称
                    type: 'string',
                    description: 'notebook name',
                },
                refCreateSaveBox: {
                    // 块引用新建文档时存放的笔记本
                    type: 'string',
                    description: 'The notebook that was stored when a new document was created using block references',
                },
                refCreateSavePath: {
                    // 块引用新建文档时存放的位置
                    type: 'string',
                    description: 'The document path that was stored when a new document was created using block references',
                },
                sort: {
                    // 排序序号
                    type: 'integer',
                    description: 'sequence number',
                    minimum: 0,
                },
                sortMode: {
                    // 文档排序模式
                    type: 'integer',
                    description: 'document sorting mode',
                    minimum: 0,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/getNotebookConf/response.schema.json",
    "$comment": "v3.0.12",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Get notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "notebook info",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "box",
                "conf",
                "name"
            ],
            "properties": {
                "box": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                },
                "conf": {
                    "$ref": "#/$defs/conf"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                }
            }
        },
        "conf": {
            "title": "IConf",
            "description": "notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "closed",
                "dailyNoteSavePath",
                "dailyNoteTemplatePath",
                "docCreateSaveBox",
                "docCreateSavePath",
                "icon",
                "name",
                "refCreateSaveBox",
                "refCreateSavePath",
                "sort",
                "sortMode"
            ],
            "properties": {
                "closed": {
                    "type": "boolean",
                    "description": "notebook open state"
                },
                "dailyNoteSavePath": {
                    "type": "string",
                    "description": "the path of new daily note"
                },
                "dailyNoteTemplatePath": {
                    "type": "string",
                    "description": "the template file path of new daily note"
                },
                "docCreateSaveBox": {
                    "type": "string",
                    "description": "New document save notebook"
                },
                "docCreateSavePath": {
                    "type": "string",
                    "description": "New document save location"
                },
                "icon": {
                    "type": "string",
                    "description": "notebook icon"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                },
                "refCreateSaveBox": {
                    "type": "string",
                    "description": "The notebook that was stored when a new document was created using block references"
                },
                "refCreateSavePath": {
                    "type": "string",
                    "description": "The document path that was stored when a new document was created using block references"
                },
                "sort": {
                    "type": "integer",
                    "description": "sequence number",
                    "minimum": 0
                },
                "sortMode": {
                    "type": "integer",
                    "description": "document sorting mode",
                    "minimum": 0
                }
            }
        }
    }
}

lsNotebooks

  • 🔥 列出所有笔记本
  • /api/notebook/lsNotebooks

请求

ts
/**
 * List notebooks
 */
export interface IPayload {
    /**
     * Whether to return information about the flash card
     */
    readonly flashcard?: boolean;
}
json5
/**
 * schemas/kernel/api/notebook/lsNotebooks/response.schema.json5
 * 列出所有笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#list-notebooks
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L316-L344
 * @pathname: /api/notebook/lsNotebooks
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/lsNotebooks/payload.schema.json5',
    $comment: 'v',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'List notebooks',

            type: 'object',
            additionalProperties: false,
            required: [],
            properties: {
                flashcard: {
                    // 是否返回闪卡相关信息
                    type: 'boolean',
                    description: 'Whether to return information about the flash card',
                    default: false,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/lsNotebooks/payload.schema.json",
    "$comment": "v",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "List notebooks",
            "type": "object",
            "additionalProperties": false,
            "required": [],
            "properties": {
                "flashcard": {
                    "type": "boolean",
                    "description": "Whether to return information about the flash card",
                    "default": false
                }
            }
        }
    }
}

响应

ts
/**
 * List notebooks
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * response data
 */
export interface IData {
    readonly notebooks: INotebook[];
}

/**
 * notebook list
 *
 * notebook object
 */
export interface INotebook {
    /**
     * notebook open state
     */
    readonly closed: boolean;
    /**
     * the count of due flash card
     */
    readonly dueFlashcardCount: number;
    /**
     * the count of flash card
     */
    readonly flashcardCount: number;
    /**
     * notebook icon
     */
    readonly icon: string;
    /**
     * notebook ID
     */
    readonly id: string;
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * the count of new flash card
     */
    readonly newFlashcardCount: number;
    /**
     * sequence number
     */
    readonly sort: number;
    /**
     * document sorting mode
     */
    readonly sortMode: number;
}
json5
/**
 * schemas/kernel/api/notebook/lsNotebooks/response.schema.json5
 * 列出所有笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#list-notebooks
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L316-L344
 * @pathname: /api/notebook/lsNotebooks
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/lsNotebooks/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'List notebooks',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'response data',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebooks',
            ],
            properties: {
                notebooks: {
                    $ref: '#/$defs/notebooks',
                },
            },
        },
        notebooks: {
            title: 'INotebooks',
            description: 'notebook list',

            type: 'array',
            items: {
                $ref: '#/$defs/notebook',
            },
        },
        notebook: {
            title: 'INotebook',
            description: 'notebook object',

            type: 'object',
            additionalProperties: false,
            required: [
                'id',
                'name',
                'icon',
                'sort',
                'sortMode',
                'closed',
                'newFlashcardCount',
                'dueFlashcardCount',
                'flashcardCount',
            ],
            properties: {
                id: {
                    // 笔记本 ID
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
                name: {
                    // 名称
                    type: 'string',
                    description: 'notebook name',
                },
                icon: {
                    // 图标
                    type: 'string',
                    description: 'notebook icon',
                    examples: [
                        '1f4d1',
                        'material/folder-project.svg',
                    ],
                },
                sort: {
                    // 排序序号
                    type: 'integer',
                    description: 'sequence number',
                    minimum: 0,
                },
                sortMode: {
                    // 文档排序模式
                    type: 'integer',
                    description: 'document sorting mode',
                    minimum: 0,
                },
                closed: {
                    // 是否关闭
                    type: 'boolean',
                    description: 'notebook open state',
                },
                newFlashcardCount: {
                    // 新闪卡的数量
                    type: 'integer',
                    description: 'the count of new flash card',
                    minimum: 0,
                },
                dueFlashcardCount: {
                    // 到期的闪卡数量
                    type: 'integer',
                    description: 'the count of due flash card',
                    minimum: 0,
                },
                flashcardCount: {
                    // 闪卡数量
                    type: 'integer',
                    description: 'the count of flash card',
                    minimum: 0,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/lsNotebooks/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "List notebooks",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "response data",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebooks"
            ],
            "properties": {
                "notebooks": {
                    "$ref": "#/$defs/notebooks"
                }
            }
        },
        "notebooks": {
            "title": "INotebooks",
            "description": "notebook list",
            "type": "array",
            "items": {
                "$ref": "#/$defs/notebook"
            }
        },
        "notebook": {
            "title": "INotebook",
            "description": "notebook object",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "id",
                "name",
                "icon",
                "sort",
                "sortMode",
                "closed",
                "newFlashcardCount",
                "dueFlashcardCount",
                "flashcardCount"
            ],
            "properties": {
                "id": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                },
                "icon": {
                    "type": "string",
                    "description": "notebook icon",
                    "examples": [
                        "1f4d1",
                        "material/folder-project.svg"
                    ]
                },
                "sort": {
                    "type": "integer",
                    "description": "sequence number",
                    "minimum": 0
                },
                "sortMode": {
                    "type": "integer",
                    "description": "document sorting mode",
                    "minimum": 0
                },
                "closed": {
                    "type": "boolean",
                    "description": "notebook open state"
                },
                "newFlashcardCount": {
                    "type": "integer",
                    "description": "the count of new flash card",
                    "minimum": 0
                },
                "dueFlashcardCount": {
                    "type": "integer",
                    "description": "the count of due flash card",
                    "minimum": 0
                },
                "flashcardCount": {
                    "type": "integer",
                    "description": "the count of flash card",
                    "minimum": 0
                }
            }
        }
    }
}

openNotebook

  • 🔥 打开笔记本
  • /api/notebook/openNotebook

请求

ts
/**
 * Open a notebook
 */
export interface IPayload {
    /**
     * notebook ID
     */
    readonly notebook: string;
}
json5
/**
 * schemas/kernel/api/notebook/openNotebook/payload.schema.json5
 * 打开笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#open-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L165-L204
 * @pathname: /api/notebook/openNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/payload.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Open a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/payload.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Open a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                }
            }
        }
    }
}

响应

ts
/**
 * Open a notebook
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: null;
    /**
     * status message
     */
    readonly msg: string;
}
json5
/**
 * schemas/siyuan/api/notebook/openNotebook/response.schema.json5
 * 打开笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#open-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L165-L204
 * @pathname: /api/notebook/openNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Open a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    type: 'null',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Open a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "type": "null"
                }
            }
        }
    }
}

removeNotebook

  • 🔥 删除笔记本
  • /api/notebook/removeNotebook

请求

ts
/**
 * Remove a notebook
 */
export interface IPayload {
    /**
     * notebook ID
     */
    readonly notebook: string;
}
json5
/**
 * schemas/kernel/api/notebook/openNotebook/payload.schema.json5
 * 删除笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#remove-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L91-L127
 * @pathname: /api/notebook/removeNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/payload.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Remove a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/openNotebook/payload.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Remove a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                }
            }
        }
    }
}

响应

ts
/**
 * Remove a notebook
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: null;
    /**
     * status message
     */
    readonly msg: string;
}
json5
/**
 * schemas/siyuan/api/notebook/removeNotebook/response.schema.json5
 * 删除笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#remove-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L91-L127
 * @pathname: /api/notebook/removeNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/removeNotebook/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Remove a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    type: 'null',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/removeNotebook/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Remove a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "type": "null"
                }
            }
        }
    }
}

renameNotebook

  • 🔥 重命名笔记本
  • /api/notebook/renameNotebook

请求

ts
/**
 * Open a notebook
 */
export interface IPayload {
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * notebook ID
     */
    readonly notebook: string;
}
json5
/**
 * schemas/kernel/api/notebook/renameNotebook/payload.schema.json5
 * 重命名笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#rename-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L60-L89
 * @pathname: /api/notebook/renameNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/renameNotebook/payload.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Open a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
                'name',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
                name: {
                    type: 'string',
                    description: 'notebook name',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/renameNotebook/payload.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Open a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook",
                "name"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                }
            }
        }
    }
}

响应

ts
/**
 * Open a notebook
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: null;
    /**
     * status message
     */
    readonly msg: string;
}
json5
/**
 * schemas/siyuan/api/notebook/openNotebook/response.schema.json5
 * 重命名笔记本
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#rename-a-notebook
 * REF: https://github.com/siyuan-note/siyuan/blob/v2.9.3/kernel/api/notebook.go#L60-L89
 * @pathname: /api/notebook/renameNotebook
 * @version: 2.9.3
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/renameNotebook/response.schema.json5',
    $comment: 'v2.9.3',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Open a notebook',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    type: 'null',
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/renameNotebook/response.schema.json",
    "$comment": "v2.9.3",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Open a notebook",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "type": "null"
                }
            }
        }
    }
}

setNotebookConf

  • 🔥 设置笔记本配置
  • /api/notebook/setNotebookConf

请求

ts
/**
 * Set notebook configuration
 */
export interface IPayload {
    readonly conf: IConf;
    /**
     * notebook ID
     */
    readonly notebook: string;
}

/**
 * notebook configuration
 */
export interface IConf {
    /**
     * notebook open state
     */
    readonly closed: boolean;
    /**
     * the path of new daily note
     */
    readonly dailyNoteSavePath: string;
    /**
     * the template file path of new daily note
     */
    readonly dailyNoteTemplatePath: string;
    /**
     * New document save notebook
     */
    readonly docCreateSaveBox: string;
    /**
     * New document save location
     */
    readonly docCreateSavePath: string;
    /**
     * notebook icon
     */
    readonly icon: string;
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * The notebook that was stored when a new document was created using block references
     */
    readonly refCreateSaveBox: string;
    /**
     * The document path that was stored when a new document was created using block references
     */
    readonly refCreateSavePath: string;
    /**
     * sequence number
     */
    readonly sort: number;
    /**
     * document sorting mode
     */
    readonly sortMode: number;
}
json5
/**
 * schemas/kernel/api/notebook/setNotebookConf/payload.schema.json5
 * 设置笔记本配置
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#save-notebook-configuration
 * REF: https://github.com/siyuan-note/siyuan/blob/v3.0.12/kernel/api/notebook.go#L264-L332
 * @pathname: /api/notebook/setNotebookConf
 * @version: 3.0.12
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/setNotebookConf/payload.schema.json5',
    $comment: 'v3.0.12',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'payload body',
            description: 'Set notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'notebook',
                'conf',
            ],
            properties: {
                notebook: {
                    type: 'string',
                    description: 'notebook ID',
                    pattern: '^\\d{14}-[0-9a-z]{7}$',
                },
                conf: {
                    $ref: '#/$defs/conf',
                },
            },
        },
        conf: {
            title: 'IConf',
            description: 'notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'closed',
                'dailyNoteSavePath',
                'dailyNoteTemplatePath',
                'docCreateSaveBox',
                'docCreateSavePath',
                'icon',
                'name',
                'refCreateSaveBox',
                'refCreateSavePath',
                'sort',
                'sortMode',
            ],
            properties: {
                closed: {
                    // 笔记本是否关闭
                    type: 'boolean',
                    description: 'notebook open state',
                },
                dailyNoteSavePath: {
                    // 新建日记时的存放路径
                    type: 'string',
                    description: 'the path of new daily note',
                },
                dailyNoteTemplatePath: {
                    // 新建日记的模板位置
                    type: 'string',
                    description: 'the template file path of new daily note',
                },
                docCreateSaveBox: {
                    // 新建文档存放笔记本
                    type: 'string',
                    description: 'New document save notebook',
                },
                docCreateSavePath: {
                    // 新建文档存放位置
                    type: 'string',
                    description: 'New document save location',
                },
                icon: {
                    // 笔记本图标
                    type: 'string',
                    description: 'notebook icon',
                },
                name: {
                    // 笔记本名称
                    type: 'string',
                    description: 'notebook name',
                },
                refCreateSaveBox: {
                    // 块引用新建文档时存放的笔记本
                    type: 'string',
                    description: 'The notebook that was stored when a new document was created using block references',
                },
                refCreateSavePath: {
                    // 块引用新建文档时存放的位置
                    type: 'string',
                    description: 'The document path that was stored when a new document was created using block references',
                },
                sort: {
                    // 排序序号
                    type: 'integer',
                    description: 'sequence number',
                    minimum: 0,
                },
                sortMode: {
                    // 文档排序模式
                    type: 'integer',
                    description: 'document sorting mode',
                    minimum: 0,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/setNotebookConf/payload.schema.json",
    "$comment": "v3.0.12",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "payload body",
            "description": "Set notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "notebook",
                "conf"
            ],
            "properties": {
                "notebook": {
                    "type": "string",
                    "description": "notebook ID",
                    "pattern": "^\\d{14}-[0-9a-z]{7}$"
                },
                "conf": {
                    "$ref": "#/$defs/conf"
                }
            }
        },
        "conf": {
            "title": "IConf",
            "description": "notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "closed",
                "dailyNoteSavePath",
                "dailyNoteTemplatePath",
                "docCreateSaveBox",
                "docCreateSavePath",
                "icon",
                "name",
                "refCreateSaveBox",
                "refCreateSavePath",
                "sort",
                "sortMode"
            ],
            "properties": {
                "closed": {
                    "type": "boolean",
                    "description": "notebook open state"
                },
                "dailyNoteSavePath": {
                    "type": "string",
                    "description": "the path of new daily note"
                },
                "dailyNoteTemplatePath": {
                    "type": "string",
                    "description": "the template file path of new daily note"
                },
                "docCreateSaveBox": {
                    "type": "string",
                    "description": "New document save notebook"
                },
                "docCreateSavePath": {
                    "type": "string",
                    "description": "New document save location"
                },
                "icon": {
                    "type": "string",
                    "description": "notebook icon"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                },
                "refCreateSaveBox": {
                    "type": "string",
                    "description": "The notebook that was stored when a new document was created using block references"
                },
                "refCreateSavePath": {
                    "type": "string",
                    "description": "The document path that was stored when a new document was created using block references"
                },
                "sort": {
                    "type": "integer",
                    "description": "sequence number",
                    "minimum": 0
                },
                "sortMode": {
                    "type": "integer",
                    "description": "document sorting mode",
                    "minimum": 0
                }
            }
        }
    }
}

响应

ts
/**
 * Set notebook configuration
 */
export interface IResponse {
    /**
     * status code
     */
    readonly code: number;
    readonly data: IData;
    /**
     * status message
     */
    readonly msg: string;
}

/**
 * notebook configuration
 */
export interface IData {
    /**
     * notebook open state
     */
    readonly closed: boolean;
    /**
     * the path of new daily note
     */
    readonly dailyNoteSavePath: string;
    /**
     * the template file path of new daily note
     */
    readonly dailyNoteTemplatePath: string;
    /**
     * New document save notebook
     */
    readonly docCreateSaveBox: string;
    /**
     * New document save location
     */
    readonly docCreateSavePath: string;
    /**
     * notebook icon
     */
    readonly icon: string;
    /**
     * notebook name
     */
    readonly name: string;
    /**
     * The notebook that was stored when a new document was created using block references
     */
    readonly refCreateSaveBox: string;
    /**
     * The document path that was stored when a new document was created using block references
     */
    readonly refCreateSavePath: string;
    /**
     * sequence number
     */
    readonly sort: number;
    /**
     * document sorting mode
     */
    readonly sortMode: number;
}
json5
/**
 * schemas/kernel/api/notebook/setNotebookConf/response.schema.json5
 * 设置笔记本配置
 * REF: https://github.com/siyuan-note/siyuan/blob/master/API.md#save-notebook-configuration
 * REF: https://github.com/siyuan-note/siyuan/blob/v3.0.12/kernel/api/notebook.go#L264-L332
 * @pathname: /api/notebook/setNotebookConf
 * @version: 3.0.12
 */
{
    $schema: 'https://json-schema.org/draft/2020-12/schema',
    $id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/setNotebookConf/response.schema.json5',
    $comment: 'v3.0.12',
    $ref: '#/$defs/root',
    $defs: {
        root: {
            title: 'response body',
            description: 'Set notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'code',
                'msg',
                'data',
            ],
            properties: {
                code: {
                    type: 'integer',
                    description: 'status code',
                },
                msg: {
                    type: 'string',
                    description: 'status message',
                },
                data: {
                    $ref: '#/$defs/data',
                },
            },
        },
        data: {
            title: 'IData',
            description: 'notebook configuration',

            type: 'object',
            additionalProperties: false,
            required: [
                'closed',
                'dailyNoteSavePath',
                'dailyNoteTemplatePath',
                'docCreateSaveBox',
                'docCreateSavePath',
                'icon',
                'name',
                'refCreateSaveBox',
                'refCreateSavePath',
                'sort',
                'sortMode',
            ],
            properties: {
                closed: {
                    // 笔记本是否关闭
                    type: 'boolean',
                    description: 'notebook open state',
                },
                dailyNoteSavePath: {
                    // 新建日记时的存放路径
                    type: 'string',
                    description: 'the path of new daily note',
                },
                dailyNoteTemplatePath: {
                    // 新建日记的模板位置
                    type: 'string',
                    description: 'the template file path of new daily note',
                },
                docCreateSaveBox: {
                    // 新建文档存放笔记本
                    type: 'string',
                    description: 'New document save notebook',
                },
                docCreateSavePath: {
                    // 新建文档存放位置
                    type: 'string',
                    description: 'New document save location',
                },
                icon: {
                    // 笔记本图标
                    type: 'string',
                    description: 'notebook icon',
                },
                name: {
                    // 笔记本名称
                    type: 'string',
                    description: 'notebook name',
                },
                refCreateSaveBox: {
                    // 块引用新建文档时存放的笔记本
                    type: 'string',
                    description: 'The notebook that was stored when a new document was created using block references',
                },
                refCreateSavePath: {
                    // 块引用新建文档时存放的位置
                    type: 'string',
                    description: 'The document path that was stored when a new document was created using block references',
                },
                sort: {
                    // 排序序号
                    type: 'integer',
                    description: 'sequence number',
                    minimum: 0,
                },
                sortMode: {
                    // 文档排序模式
                    type: 'integer',
                    description: 'document sorting mode',
                    minimum: 0,
                },
            },
        },
    },
}
json
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/notebook/setNotebookConf/response.schema.json",
    "$comment": "v3.0.12",
    "$ref": "#/$defs/root",
    "$defs": {
        "root": {
            "title": "response body",
            "description": "Set notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "code",
                "msg",
                "data"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "description": "status code"
                },
                "msg": {
                    "type": "string",
                    "description": "status message"
                },
                "data": {
                    "$ref": "#/$defs/data"
                }
            }
        },
        "data": {
            "title": "IData",
            "description": "notebook configuration",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "closed",
                "dailyNoteSavePath",
                "dailyNoteTemplatePath",
                "docCreateSaveBox",
                "docCreateSavePath",
                "icon",
                "name",
                "refCreateSaveBox",
                "refCreateSavePath",
                "sort",
                "sortMode"
            ],
            "properties": {
                "closed": {
                    "type": "boolean",
                    "description": "notebook open state"
                },
                "dailyNoteSavePath": {
                    "type": "string",
                    "description": "the path of new daily note"
                },
                "dailyNoteTemplatePath": {
                    "type": "string",
                    "description": "the template file path of new daily note"
                },
                "docCreateSaveBox": {
                    "type": "string",
                    "description": "New document save notebook"
                },
                "docCreateSavePath": {
                    "type": "string",
                    "description": "New document save location"
                },
                "icon": {
                    "type": "string",
                    "description": "notebook icon"
                },
                "name": {
                    "type": "string",
                    "description": "notebook name"
                },
                "refCreateSaveBox": {
                    "type": "string",
                    "description": "The notebook that was stored when a new document was created using block references"
                },
                "refCreateSavePath": {
                    "type": "string",
                    "description": "The document path that was stored when a new document was created using block references"
                },
                "sort": {
                    "type": "integer",
                    "description": "sequence number",
                    "minimum": 0
                },
                "sortMode": {
                    "type": "integer",
                    "description": "document sorting mode",
                    "minimum": 0
                }
            }
        }
    }
}