/api/search
fullTextSearchBlock
- 🛠 全文搜索
/api/search/fullTextSearchBlock
请求
ts
/**
* Full text search
*/
export interface IPayload {
/**
* Search results grouping scheme
* - `0`: No grouping (default)
* - `1`: Group by document
* @defaultValue 0
*/
readonly groupBy?: number;
/**
* Search scheme
* - `0`: Keyword (default)
* - `1`: Query syntax
* - `2`: SQL
* - `3`: Regular expression
* @defaultValue 0
*/
readonly method?: number;
/**
* Search result sorting scheme
* - `0`: Block type (default)
* - `1`: Ascending by creation time
* - `2`: Descending by creation time
* - `3`: Ascending by update time
* - `4`: Descending by update time
* - `5`: By content order (only valid when grouping by document)
* - `6`: Ascending by relevance
* - `7`: Descending by relevance
* @defaultValue 0
*/
readonly orderBy?: number;
/**
* Current page number
* Starts from `1`
* @defaultValue 1
*/
readonly page?: number;
/**
* Number of search results per page
* minimum: 32
* @defaultValue 32
*/
readonly pageSize?: number;
/**
* Search range (document path list)
* @defaultValue []
*/
readonly paths?: string[];
/**
* Query statement
*/
readonly query?: string;
/**
* The type of block that the search results contain
*/
readonly types?: ITypes;
}
/**
* The type of block that the search results contain
*
* Block type filter
*/
export interface ITypes {
/**
* Search results contain blockquote blocks
* @defaultValue false
*/
readonly blockquote?: boolean;
/**
* Search results contain code blocks
* @defaultValue false
*/
readonly codeBlock?: boolean;
/**
* Search results contain database blocks
* @defaultValue false
*/
readonly databaseBlock?: boolean;
/**
* Search results contain document blocks
* @defaultValue false
*/
readonly document?: boolean;
/**
* Search results contain embed blocks
* @defaultValue false
*/
readonly embedBlock?: boolean;
/**
* Search results contain heading blocks
* @defaultValue false
*/
readonly heading?: boolean;
/**
* Search results contain html blocks
* @defaultValue false
*/
readonly htmlBlock?: boolean;
/**
* Search results contain list blocks
* @defaultValue false
*/
readonly list?: boolean;
/**
* Search results contain list item blocks
* @defaultValue false
*/
readonly listItem?: boolean;
/**
* Search results contain math blocks
* @defaultValue false
*/
readonly mathBlock?: boolean;
/**
* Search results contain paragraph blocks
* @defaultValue false
*/
readonly paragraph?: boolean;
/**
* Search results contain super blocks
* @defaultValue false
*/
readonly superBlock?: boolean;
/**
* Search results contain table blocks
* @defaultValue false
*/
readonly table?: boolean;
}
json5
/**
* schemas/kernel/api/search/fullTextSearchBlock/payload.schema.json5
* 全文搜索
* REF:
* @pathname: /api/search/fullTextSearchBlock
* @version: 2.10.5
*/
{
$schema: 'https://json-schema.org/draft/2020-12/schema',
$id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/search/fullTextSearchBlock/payload.schema.json5',
$comment: 'v2.10.5',
$ref: '#/$defs/root',
$defs: {
root: {
title: 'payload body',
description: 'Full text search',
type: 'object',
additionalProperties: false,
required: [],
properties: {
method: {
// 搜索方案
type: 'integer',
description: 'Search scheme\n- `0`: Keyword (default)\n- `1`: Query syntax\n- `2`: SQL\n- `3`: Regular expression\n@defaultValue 0',
enum: [
0, // 关键字
1, // 查询语法
2, // SQL
3, // 正则表达式
],
default: 0,
},
groupBy: {
// 搜索结果分组方案
type: 'integer',
description: 'Search results grouping scheme\n- `0`: No grouping (default)\n- `1`: Group by document\n@defaultValue 0',
enum: [
0, // 不分组
1, // 按文档分组
],
default: 0,
},
orderBy: {
// 搜索结果排序方案
type: 'integer',
description: 'Search result sorting scheme\n- `0`: Block type (default)\n- `1`: Ascending by creation time\n- `2`: Descending by creation time\n- `3`: Ascending by update time\n- `4`: Descending by update time\n- `5`: By content order (only valid when grouping by document)\n- `6`: Ascending by relevance\n- `7`: Descending by relevance\n@defaultValue 0',
enum: [
0, // 按块类型
1, // 按创建时间升序
2, // 按创建时间降序
3, // 按更新时间升序
4, // 按更新时间降序
5, // 按内容顺序 (仅按文档分组时有效)
6, // 按相关度升序
7, // 按相关度降序
],
default: 0,
},
page: {
// 当前分页页码
type: 'integer',
description: 'Current page number\nStarts from `1`\n@defaultValue 1',
minimum: 1,
default: 1,
},
pageSize: {
// 每页搜索结果数量
type: 'integer',
description: 'Number of search results per page\nminimum: 32\n@defaultValue 32',
minimum: 32,
default: 32,
},
paths: {
// 指定搜索范围
type: 'array',
description: 'Search range (document path list)\n@defaultValue []',
items: {
type: 'string',
description: 'Document path',
pattern: '^(\\d{14}-[0-9a-z]{7})((/\\d{14}-[0-9a-z]{7})+(?:\\.sy)?)?$',
examples: [
'20210808180117-czj9bvb', // 笔记本
'20210808180117-czj9bvb/20200812220555-lj3enxa', // 包含下级文档
'20210808180117-czj9bvb/20200812220555-lj3enxa.sy', // 不包含下级文档
],
},
default: [],
},
query: {
// 查询语句
type: 'string',
description: 'Query statement',
default: '',
},
types: {
// 搜索结果包含的块类型
description: 'The type of block that the search results contain',
$ref: '#/$defs/types',
},
},
},
types: {
// 块类型过滤
title: 'ITypes',
description: 'Block type filter',
type: 'object',
additionalProperties: false,
required: [],
properties: {
blockquote: {
type: 'boolean',
description: 'Search results contain blockquote blocks\n@defaultValue false',
default: false,
},
codeBlock: {
type: 'boolean',
description: 'Search results contain code blocks\n@defaultValue false',
default: false,
},
databaseBlock: {
type: 'boolean',
description: 'Search results contain database blocks\n@defaultValue false',
default: false,
},
document: {
type: 'boolean',
description: 'Search results contain document blocks\n@defaultValue false',
default: false,
},
embedBlock: {
type: 'boolean',
description: 'Search results contain embed blocks\n@defaultValue false',
default: false,
},
heading: {
type: 'boolean',
description: 'Search results contain heading blocks\n@defaultValue false',
default: false,
},
htmlBlock: {
type: 'boolean',
description: 'Search results contain html blocks\n@defaultValue false',
default: false,
},
list: {
type: 'boolean',
description: 'Search results contain list blocks\n@defaultValue false',
default: false,
},
listItem: {
type: 'boolean',
description: 'Search results contain list item blocks\n@defaultValue false',
default: false,
},
mathBlock: {
type: 'boolean',
description: 'Search results contain math blocks\n@defaultValue false',
default: false,
},
paragraph: {
type: 'boolean',
description: 'Search results contain paragraph blocks\n@defaultValue false',
default: false,
},
superBlock: {
type: 'boolean',
description: 'Search results contain super blocks\n@defaultValue false',
default: false,
},
table: {
type: 'boolean',
description: 'Search results contain table blocks\n@defaultValue false',
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/search/fullTextSearchBlock/payload.schema.json",
"$comment": "v2.10.5",
"$ref": "#/$defs/root",
"$defs": {
"root": {
"title": "payload body",
"description": "Full text search",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"method": {
"type": "integer",
"description": "Search scheme\n- `0`: Keyword (default)\n- `1`: Query syntax\n- `2`: SQL\n- `3`: Regular expression\n@defaultValue 0",
"enum": [
0,
1,
2,
3
],
"default": 0
},
"groupBy": {
"type": "integer",
"description": "Search results grouping scheme\n- `0`: No grouping (default)\n- `1`: Group by document\n@defaultValue 0",
"enum": [
0,
1
],
"default": 0
},
"orderBy": {
"type": "integer",
"description": "Search result sorting scheme\n- `0`: Block type (default)\n- `1`: Ascending by creation time\n- `2`: Descending by creation time\n- `3`: Ascending by update time\n- `4`: Descending by update time\n- `5`: By content order (only valid when grouping by document)\n- `6`: Ascending by relevance\n- `7`: Descending by relevance\n@defaultValue 0",
"enum": [
0,
1,
2,
3,
4,
5,
6,
7
],
"default": 0
},
"page": {
"type": "integer",
"description": "Current page number\nStarts from `1`\n@defaultValue 1",
"minimum": 1,
"default": 1
},
"pageSize": {
"type": "integer",
"description": "Number of search results per page\nminimum: 32\n@defaultValue 32",
"minimum": 32,
"default": 32
},
"paths": {
"type": "array",
"description": "Search range (document path list)\n@defaultValue []",
"items": {
"type": "string",
"description": "Document path",
"pattern": "^(\\d{14}-[0-9a-z]{7})((/\\d{14}-[0-9a-z]{7})+(?:\\.sy)?)?$",
"examples": [
"20210808180117-czj9bvb",
"20210808180117-czj9bvb/20200812220555-lj3enxa",
"20210808180117-czj9bvb/20200812220555-lj3enxa.sy"
]
},
"default": []
},
"query": {
"type": "string",
"description": "Query statement",
"default": ""
},
"types": {
"description": "The type of block that the search results contain",
"$ref": "#/$defs/types"
}
}
},
"types": {
"title": "ITypes",
"description": "Block type filter",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"blockquote": {
"type": "boolean",
"description": "Search results contain blockquote blocks\n@defaultValue false",
"default": false
},
"codeBlock": {
"type": "boolean",
"description": "Search results contain code blocks\n@defaultValue false",
"default": false
},
"databaseBlock": {
"type": "boolean",
"description": "Search results contain database blocks\n@defaultValue false",
"default": false
},
"document": {
"type": "boolean",
"description": "Search results contain document blocks\n@defaultValue false",
"default": false
},
"embedBlock": {
"type": "boolean",
"description": "Search results contain embed blocks\n@defaultValue false",
"default": false
},
"heading": {
"type": "boolean",
"description": "Search results contain heading blocks\n@defaultValue false",
"default": false
},
"htmlBlock": {
"type": "boolean",
"description": "Search results contain html blocks\n@defaultValue false",
"default": false
},
"list": {
"type": "boolean",
"description": "Search results contain list blocks\n@defaultValue false",
"default": false
},
"listItem": {
"type": "boolean",
"description": "Search results contain list item blocks\n@defaultValue false",
"default": false
},
"mathBlock": {
"type": "boolean",
"description": "Search results contain math blocks\n@defaultValue false",
"default": false
},
"paragraph": {
"type": "boolean",
"description": "Search results contain paragraph blocks\n@defaultValue false",
"default": false
},
"superBlock": {
"type": "boolean",
"description": "Search results contain super blocks\n@defaultValue false",
"default": false
},
"table": {
"type": "boolean",
"description": "Search results contain table blocks\n@defaultValue false",
"default": false
}
}
}
}
}
响应
ts
/**
* Full text search
*/
export interface IResponse {
/**
* status code
*/
readonly code: number;
readonly data: IData;
/**
* status message
*/
readonly msg: string;
}
/**
* Response information
*/
export interface IData {
/**
* Search results
*/
readonly blocks: IBlock[];
/**
* The number of blocks in the full search results
*/
readonly matchedBlockCount: number;
/**
* The number of documents in the full search results
*/
readonly matchedRootCount: number;
/**
* Current page number
*/
readonly pageCount: number;
}
/**
* Search result item
*/
export interface IBlock {
/**
* Block alias
*/
readonly alias: string;
/**
* notebook ID
*/
readonly box: string;
/**
* Grouped search results
*/
readonly children: IBlock[] | null;
/**
* Block content
*/
readonly content: string;
readonly count: number;
/**
* Creation time
*/
readonly created: string;
readonly defID: string;
readonly defPath: string;
readonly depth: number;
/**
* The first block content in the container block
*/
readonly fcontent: string;
/**
* Whether to fold
*/
readonly folded: boolean;
/**
* The readable path of the document where it is located
*/
readonly hPath: string;
/**
* Inline Attribute List (IAL) of block
*/
readonly ial: Ial;
/**
* Block ID
*/
readonly id: string;
/**
* Block Markdown content
*/
readonly markdown: string;
/**
* Block memo
*/
readonly memo: string;
/**
* Block name
*/
readonly name: string;
/**
* Parent block ID
*/
readonly parentID: string;
/**
* The path of the document where it is located
*/
readonly path: string;
/**
* The block ID list of the block reference (the current block is referenced by these blocks)
*/
readonly refs: string[] | null;
/**
* Block reference text
*/
readonly refText: string;
/**
* Flash card ID
*/
readonly riffCardID: string;
/**
* Flash card review count
*/
readonly riffCardReps: number;
/**
* Document block ID
*/
readonly rootID: string;
/**
* Block sort priority
*/
readonly sort: number;
/**
* Block subtype
*/
readonly subType: SubTypeEnum;
/**
* Block tags
*/
readonly tag: string;
/**
* Block type
*/
readonly type: TypeEnum;
/**
* Update time
*/
readonly updated: string;
}
/**
* Inline Attribute List (IAL) of block
*/
export interface Ial {
/**
* document block ID
*/
readonly id: string;
/**
* document title
*/
readonly title?: string;
/**
* The last time the block was updated
*/
readonly updated: string;
[property: string]: string;
}
export type SubTypeEnum = "" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "o" | "t" | "u";
export type TypeEnum = "NodeAttributeView" | "NodeAudio" | "NodeBlockQueryEmbed" | "NodeBlockquote" | "NodeCodeBlock" | "NodeDocument" | "NodeHeading" | "NodeHTMLBlock" | "NodeIFrame" | "NodeList" | "NodeListItem" | "NodeParagraph" | "NodeSuperBlock" | "NodeTable" | "NodeThematicBreak" | "NodeVideo" | "NodeWidget";
json5
/**
* schemas/kernel/api/search/fullTextSearchBlock/response.schema.json5
* 全文搜索
* REF:
* @pathname: /api/search/fullTextSearchBlock
* @version: 2.10.5
*/
{
$schema: 'https://json-schema.org/draft/2020-12/schema',
$id: 'https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/search/fullTextSearchBlock/response.schema.json5',
$comment: 'v2.10.5',
$ref: '#/$defs/root',
$defs: {
root: {
title: 'response body',
description: 'Full text search',
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 information',
type: 'object',
additionalProperties: false,
required: [
'blocks',
'matchedBlockCount',
'matchedRootCount',
'pageCount',
],
properties: {
blocks: {
// 搜索结果列表
type: 'array',
description: 'Search results',
items: {
$ref: '#/$defs/block',
},
},
matchedBlockCount: {
// 完整搜索结果中命中的块数量
type: 'integer',
description: 'The number of blocks in the full search results',
minimum: 0,
},
matchedRootCount: {
// 完整搜索结果中命中的文档数
type: 'integer',
description: 'The number of documents in the full search results',
minimum: 0,
},
pageCount: {
// 当前分页页码
type: 'integer',
description: 'Current page number',
minimum: 0,
},
},
},
block: {
title: 'IBlock',
description: 'Search result item',
type: 'object',
additionalProperties: false,
required: [
'box',
'path',
'hPath',
'id',
'rootID',
'parentID',
'name',
'alias',
'memo',
'tag',
'content',
'fcontent',
'markdown',
'folded',
'type',
'subType',
'refText',
'refs',
'defID',
'defPath',
'ial',
'children',
'depth',
'count',
'sort',
'created',
'updated',
'riffCardID',
'riffCardReps',
],
properties: {
box: {
// 笔记本 ID
type: 'string',
description: 'notebook ID',
pattern: '^\\d{14}-[0-9a-z]{7}$',
},
path: {
// 所在文档路径
type: 'string',
description: 'The path of the document where it is located',
pattern: '^(/\\d{14}-[0-9a-z]{7})+\\.sy$',
examples: [
'/20200812220555-lj3enxa.sy',
'/20200812220555-lj3enxa/20210808180320-fqgskfj.sy',
],
},
hPath: {
// 所在文档的可读路径
type: 'string',
description: 'The readable path of the document where it is located',
pattern: '^(/[^/]+)+$',
},
id: {
// 块 ID
type: 'string',
description: 'Block ID',
pattern: '^\\d{14}-[0-9a-z]{7}$',
},
rootID: {
// 文档块 ID
type: 'string',
description: 'Document block ID',
pattern: '^\\d{14}-[0-9a-z]{7}$',
},
parentID: {
// 上级块 ID
type: 'string',
description: 'Parent block ID',
pattern: '^\\d{14}-[0-9a-z]{7}$',
},
name: {
// 块名称
type: 'string',
description: 'Block name',
},
alias: {
// 块别名
type: 'string',
description: 'Block alias',
},
memo: {
// 块备注
type: 'string',
description: 'Block memo',
},
tag: {
// 块标签
type: 'string',
description: 'Block tags',
examples: [
'',
'#tag#',
'#tag1# #tag2#',
'#tag1# #tag2# #tag3/tag4/tag5#',
],
},
content: {
// 块内容
type: 'string',
description: 'Block content',
},
fcontent: {
// 容器块下级第一个块的块内容
type: 'string',
description: 'The first block content in the container block',
},
markdown: {
// 块 Markdown 内容
type: 'string',
description: 'Block Markdown content',
},
folded: {
// 是否折叠
type: 'boolean',
description: 'Whether to fold',
},
type: {
// 块类型
title: 'TBlockType',
type: 'string',
description: 'Block type',
},
subType: {
// 块次级类型
title: 'TBlockSubType',
type: 'string',
description: 'Block subtype',
},
refText: {
// 块引用文本
type: 'string',
description: 'Block reference text',
},
refs: {
// 块引用列表 (当前块被这些块引用)
type: [
'array',
'null',
],
description: 'The block ID list of the block reference (the current block is referenced by these blocks)',
items: {
type: 'string',
pattern: '^\\d{14}-[0-9a-z]{7}$',
},
},
defID: {
type: 'string',
},
defPath: {
type: 'string',
},
ial: {
// 块内联属性表
description: 'Inline Attribute List (IAL) of block',
$ref: '#/$defs/ial',
},
children: {
// 分组后的搜索结果列表
type: [
'array',
'null',
],
description: 'Grouped search results',
items: {
$ref: '#/$defs/block',
},
},
depth: {
type: 'integer',
},
count: {
type: 'integer',
},
sort: {
// 块排序优先级
type: 'integer',
description: 'Block sort priority',
enum: [
0, // 文档块
5, // 标题块
10, // 段落块 / 代码块 / 数学公式块 / 表格块 / HTML 块
20, // 列表块 / 列表项 / 引述块
30, // 超级块
],
},
created: {
// 创建时间
type: 'string',
description: 'Creation time',
},
updated: {
// 更新时间
type: 'string',
description: 'Update time',
},
riffCardID: {
// 闪卡 ID
type: 'string',
description: 'Flash card ID',
},
riffCardReps: {
// 闪卡复习次数
type: 'integer',
description: 'Flash card review count',
minimum: 0,
},
},
oneOf: [
{
properties: {
type: {
// 块类型
enum: [
'NodeDocument', // 文档块
'NodeSuperBlock', // 超级块
'NodeBlockquote', // 引述块
'NodeHeading', // 标题块
'NodeParagraph', // 段落块
'NodeTable', // 表格块
'NodeCodeBlock', // 代码块
'NodeHTMLBlock', // HTML 块
'NodeThematicBreak', // 分割线
'NodeAudio', // 音频快
'NodeVideo', // 视频块
'NodeIFrame', // iframe 块
'NodeWidget', // 挂件块
'NodeBlockQueryEmbed', // 嵌入块
'NodeAttributeView', // 属性表
],
},
subType: {
// 块子类型
enum: [
'', // 其他块
],
},
},
},
{
properties: {
type: {
// 块类型
enum: [
'NodeList', // 列表块
'NodeListItem', // 列表项
],
},
subType: {
// 块子类型
enum: [
'u', // 列表块/列表项
'o', // 列表块/列表项
't', // 列表块/列表项
],
},
},
},
{
properties: {
type: {
// 块类型
enum: [
'NodeHeading', // 标题块
],
},
subType: {
// 块子类型
enum: [
'h1', // 标题块
'h2', // 标题块
'h3', // 标题块
'h4', // 标题块
'h5', // 标题块
'h6', // 标题块
],
},
},
},
],
},
ial: {
// 块内联属性表
title: 'IAL',
description: 'Inline Attribute List (IAL) of block',
type: 'object',
propertyNames: {
type: 'string',
minLength: 1,
pattern: '^[_a-zA-Z][_.\\-0-9a-zA-Z]*$',
},
patternProperties: {
'^((?!id|title|update)[_a-zA-Z][_.\\-0-9a-zA-Z]*)': {
type: 'string',
minLength: 1,
},
},
additionalProperties: {
type: 'string',
},
required: [
'id',
'updated',
],
properties: {
id: {
// 文档块 ID
type: 'string',
description: 'document block ID',
pattern: '^\\d{14}-[0-9a-z]{7}$',
examples: [
'20200812220555-lj3enxa',
],
},
updated: {
// 块上次更新时间 YYYYMMDDhhmmss
type: 'string',
description: 'The last time the block was updated',
pattern: '^((?:19|20)\\d{2})(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])([01]\\d|2[0-3])([0-5]\\d)([0-5]\\d)$',
examples: [
'20210714092948',
],
},
title: {
// 文档标题
type: 'string',
description: 'document title',
pattern: '^[^/]+$',
},
},
},
},
}
json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/siyuan-community/siyuan-sdk/raw/main/schemas/kernel/api/search/fullTextSearchBlock/response.schema.json",
"$comment": "v2.10.5",
"$ref": "#/$defs/root",
"$defs": {
"root": {
"title": "response body",
"description": "Full text search",
"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 information",
"type": "object",
"additionalProperties": false,
"required": [
"blocks",
"matchedBlockCount",
"matchedRootCount",
"pageCount"
],
"properties": {
"blocks": {
"type": "array",
"description": "Search results",
"items": {
"$ref": "#/$defs/block"
}
},
"matchedBlockCount": {
"type": "integer",
"description": "The number of blocks in the full search results",
"minimum": 0
},
"matchedRootCount": {
"type": "integer",
"description": "The number of documents in the full search results",
"minimum": 0
},
"pageCount": {
"type": "integer",
"description": "Current page number",
"minimum": 0
}
}
},
"block": {
"title": "IBlock",
"description": "Search result item",
"type": "object",
"additionalProperties": false,
"required": [
"box",
"path",
"hPath",
"id",
"rootID",
"parentID",
"name",
"alias",
"memo",
"tag",
"content",
"fcontent",
"markdown",
"folded",
"type",
"subType",
"refText",
"refs",
"defID",
"defPath",
"ial",
"children",
"depth",
"count",
"sort",
"created",
"updated",
"riffCardID",
"riffCardReps"
],
"properties": {
"box": {
"type": "string",
"description": "notebook ID",
"pattern": "^\\d{14}-[0-9a-z]{7}$"
},
"path": {
"type": "string",
"description": "The path of the document where it is located",
"pattern": "^(/\\d{14}-[0-9a-z]{7})+\\.sy$",
"examples": [
"/20200812220555-lj3enxa.sy",
"/20200812220555-lj3enxa/20210808180320-fqgskfj.sy"
]
},
"hPath": {
"type": "string",
"description": "The readable path of the document where it is located",
"pattern": "^(/[^/]+)+$"
},
"id": {
"type": "string",
"description": "Block ID",
"pattern": "^\\d{14}-[0-9a-z]{7}$"
},
"rootID": {
"type": "string",
"description": "Document block ID",
"pattern": "^\\d{14}-[0-9a-z]{7}$"
},
"parentID": {
"type": "string",
"description": "Parent block ID",
"pattern": "^\\d{14}-[0-9a-z]{7}$"
},
"name": {
"type": "string",
"description": "Block name"
},
"alias": {
"type": "string",
"description": "Block alias"
},
"memo": {
"type": "string",
"description": "Block memo"
},
"tag": {
"type": "string",
"description": "Block tags",
"examples": [
"",
"#tag#",
"#tag1# #tag2#",
"#tag1# #tag2# #tag3/tag4/tag5#"
]
},
"content": {
"type": "string",
"description": "Block content"
},
"fcontent": {
"type": "string",
"description": "The first block content in the container block"
},
"markdown": {
"type": "string",
"description": "Block Markdown content"
},
"folded": {
"type": "boolean",
"description": "Whether to fold"
},
"type": {
"title": "TBlockType",
"type": "string",
"description": "Block type"
},
"subType": {
"title": "TBlockSubType",
"type": "string",
"description": "Block subtype"
},
"refText": {
"type": "string",
"description": "Block reference text"
},
"refs": {
"type": [
"array",
"null"
],
"description": "The block ID list of the block reference (the current block is referenced by these blocks)",
"items": {
"type": "string",
"pattern": "^\\d{14}-[0-9a-z]{7}$"
}
},
"defID": {
"type": "string"
},
"defPath": {
"type": "string"
},
"ial": {
"description": "Inline Attribute List (IAL) of block",
"$ref": "#/$defs/ial"
},
"children": {
"type": [
"array",
"null"
],
"description": "Grouped search results",
"items": {
"$ref": "#/$defs/block"
}
},
"depth": {
"type": "integer"
},
"count": {
"type": "integer"
},
"sort": {
"type": "integer",
"description": "Block sort priority",
"enum": [
0,
5,
10,
20,
30
]
},
"created": {
"type": "string",
"description": "Creation time"
},
"updated": {
"type": "string",
"description": "Update time"
},
"riffCardID": {
"type": "string",
"description": "Flash card ID"
},
"riffCardReps": {
"type": "integer",
"description": "Flash card review count",
"minimum": 0
}
},
"oneOf": [
{
"properties": {
"type": {
"enum": [
"NodeDocument",
"NodeSuperBlock",
"NodeBlockquote",
"NodeHeading",
"NodeParagraph",
"NodeTable",
"NodeCodeBlock",
"NodeHTMLBlock",
"NodeThematicBreak",
"NodeAudio",
"NodeVideo",
"NodeIFrame",
"NodeWidget",
"NodeBlockQueryEmbed",
"NodeAttributeView"
]
},
"subType": {
"enum": [
""
]
}
}
},
{
"properties": {
"type": {
"enum": [
"NodeList",
"NodeListItem"
]
},
"subType": {
"enum": [
"u",
"o",
"t"
]
}
}
},
{
"properties": {
"type": {
"enum": [
"NodeHeading"
]
},
"subType": {
"enum": [
"h1",
"h2",
"h3",
"h4",
"h5",
"h6"
]
}
}
}
]
},
"ial": {
"title": "IAL",
"description": "Inline Attribute List (IAL) of block",
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"pattern": "^[_a-zA-Z][_.\\-0-9a-zA-Z]*$"
},
"patternProperties": {
"^((?!id|title|update)[_a-zA-Z][_.\\-0-9a-zA-Z]*)": {
"type": "string",
"minLength": 1
}
},
"additionalProperties": {
"type": "string"
},
"required": [
"id",
"updated"
],
"properties": {
"id": {
"type": "string",
"description": "document block ID",
"pattern": "^\\d{14}-[0-9a-z]{7}$",
"examples": [
"20200812220555-lj3enxa"
]
},
"updated": {
"type": "string",
"description": "The last time the block was updated",
"pattern": "^((?:19|20)\\d{2})(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])([01]\\d|2[0-3])([0-5]\\d)([0-5]\\d)$",
"examples": [
"20210714092948"
]
},
"title": {
"type": "string",
"description": "document title",
"pattern": "^[^/]+$"
}
}
}
}
}