Files
dingtalk-workspace-cli/internal/helpers/doc/jsonml-schema-v2.json

1767 lines
35 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"_version": "2.0.0",
"_description": "钉钉文档 JSONML 严格校验 schema。校验器为通用递归解释器,不含业务逻辑。",
"tags": {
"root": {
"allowed_children": [
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"table",
"code",
"container",
"embed",
"onlineVideo",
"card",
"toc",
"refblock",
"cangjie-voidblock",
"cangjie-container"
],
"attrs": {
"uuid": {
"type": "string"
},
"sectPr": {
"type": "object"
},
"theme": {
"type": "object"
},
"userData": {
"type": "object"
},
"background": {
"type": "union",
"types": [
"string",
"object",
"null"
]
}
},
"description": "文档根节点,包含所有块级元素"
},
"p": {
"description": "段落元素,支持 jc(对齐)、list(列表属性)、spacing(间距) 等属性",
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object",
"fields": {
"left": {
"type": "number"
},
"start": {
"type": "number"
},
"leftChars": {
"type": "number"
},
"right": {
"type": "number"
},
"end": {
"type": "number"
},
"rightChars": {
"type": "number"
},
"hanging": {
"type": "number"
},
"hangingChars": {
"type": "number"
},
"firstLine": {
"type": "number"
},
"firstLineChars": {
"type": "number"
}
}
},
"list": {
"type": "object",
"fields": {
"listId": {
"type": "string"
},
"level": {
"type": "number",
"min": 0,
"max": 9,
"description": "0-indexed nesting depth; top-level items should use 0"
},
"isOrdered": {
"type": "boolean"
},
"isTaskList": {
"type": "boolean"
},
"isChecked": {
"type": "boolean"
},
"hideSymbol": {
"type": "boolean"
},
"listStyle": {
"type": "object"
},
"listStyleType": {
"type": "string"
},
"symbolStyle": {
"type": "object"
},
"start": {
"type": "number",
"min": 1
},
"extraData": {
"type": "object"
}
}
},
"spacing": {
"type": "object",
"fields": {
"line": {
"type": "number"
},
"before": {
"type": "union",
"types": [
"number",
"string",
"null"
]
},
"beforeLines": {
"type": "number"
},
"beforeAutospacing": {
"type": "boolean"
},
"after": {
"type": "union",
"types": [
"number",
"string",
"null"
]
},
"afterLines": {
"type": "number"
},
"afterAutospacing": {
"type": "boolean"
},
"lineRule": {
"type": "enum",
"values": [
"atLeast",
"auto",
"exact"
]
}
}
},
"bdr": {
"type": "object"
},
"widowControl": {
"type": "boolean"
},
"keepNext": {
"type": "boolean"
},
"keepLines": {
"type": "boolean"
},
"pageBreakBefore": {
"type": "boolean"
},
"framePr": {
"type": "object"
},
"shd": {
"type": "object",
"fields": {
"val": {
"type": "string"
},
"color": {
"type": "string"
},
"fill": {
"type": "string"
}
}
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
}
},
"h1": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"subjectPr": {
"type": "object"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "一级标题"
},
"h2": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "二级标题"
},
"h3": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "三级标题"
},
"h4": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "四级标题"
},
"h5": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "五级标题"
},
"h6": {
"allowed_children": [
"span",
"img",
"a",
"tag",
"inlineCode",
"br",
"cangjie-textinline",
"cangjie-voidinline"
],
"attrs": {
"uuid": {
"type": "string"
},
"jc": {
"type": "enum",
"values": [
"left",
"center",
"right",
"both",
"distribute",
"justify"
]
},
"blockquote": {
"type": "boolean"
},
"ind": {
"type": "object"
},
"list": {
"type": "object"
},
"spacing": {
"type": "object"
},
"fold": {
"type": "boolean"
},
"bdr": {
"type": "object"
},
"shd": {
"type": "object"
},
"tabs": {
"type": "array"
},
"calloutPr": {
"type": "object"
}
},
"aliases": {
"align": "jc",
"text-align": "jc"
},
"description": "六级标题"
},
"hr": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"id": {
"type": "string"
},
"width": {
"type": "union",
"types": [
"number",
"string"
]
},
"type": {
"type": "union",
"types": [
"string",
"null"
]
},
"sz": {
"type": "union",
"types": [
"number",
"null"
]
},
"color": {
"type": "union",
"types": [
"string",
"null"
]
},
"sticker": {
"type": "union",
"types": [
"object",
"string"
]
},
"showstk": {
"type": "boolean"
},
"fadeOut": {
"type": "boolean"
},
"compactMode": {
"type": "boolean"
},
"spacing": {
"type": "object"
}
},
"description": "分割线元素"
},
"table": {
"description": "表格元素,colsWidth 定义列宽数组",
"allowed_children": [
"tr"
],
"attrs": {
"uuid": {
"type": "string"
},
"colsWidth": {
"type": "array"
},
"sr": {
"type": "boolean"
},
"width": {
"type": "union",
"types": [
"number",
"null"
],
"warn_types": [
"object"
]
},
"jc": {
"type": "enum",
"values": [
"start",
"left",
"center",
"end",
"right"
]
},
"bdr": {
"type": "object"
},
"tblpPr": {
"type": "object"
},
"tblW": {
"type": "object"
},
"isColumnHeader": {
"type": "boolean"
},
"styleId": {
"type": "union",
"types": [
"string",
"null"
]
},
"tblLook": {
"type": "object",
"fields": {
"firstColumn": {
"type": "union",
"types": [
"number",
"boolean"
]
},
"firstRow": {
"type": "union",
"types": [
"number",
"boolean"
]
},
"lastColumn": {
"type": "union",
"types": [
"number",
"boolean"
]
},
"lastRow": {
"type": "union",
"types": [
"number",
"boolean"
]
},
"noHBand": {
"type": "union",
"types": [
"number",
"boolean"
]
},
"noVBand": {
"type": "union",
"types": [
"number",
"boolean"
]
}
}
},
"spacing": {
"type": "union",
"types": [
"number",
"null"
]
}
},
"aliases": {
"columns": "colsWidth"
}
},
"tr": {
"allowed_children": [
"tc"
],
"attrs": {
"uuid": {
"type": "string"
},
"h": {
"type": "union",
"types": [
"number",
"null"
]
},
"bdr": {
"type": "object"
},
"isTblHeader": {
"type": "boolean"
}
},
"description": "表格行元素"
},
"tc": {
"allowed_children": [
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"code",
"table",
"embed",
"card",
"container",
"refblock",
"onlineVideo",
"toc"
],
"attrs": {
"uuid": {
"type": "string"
},
"width": {
"type": "union",
"types": [
"number",
"null"
],
"warn_types": [
"object"
]
},
"colSpan": {
"type": "union",
"types": [
"number",
"null"
]
},
"rowSpan": {
"type": "union",
"types": [
"number",
"null"
]
},
"bdr": {
"type": "object"
},
"fill": {
"type": "union",
"types": [
"string",
"null"
]
},
"color": {
"type": "union",
"types": [
"string",
"null"
]
},
"border": {
"type": "union",
"types": [
"string",
"null"
]
},
"vAlign": {
"type": "enum",
"values": [
"top",
"middle",
"bottom"
]
},
"hidden": {
"type": "boolean"
},
"cellMar": {
"type": "object"
},
"shd": {
"type": "object"
},
"padding": {
"type": "object",
"fields": {
"top": {
"type": "union",
"types": [
"number",
"null"
]
},
"left": {
"type": "union",
"types": [
"number",
"null"
]
},
"bottom": {
"type": "union",
"types": [
"number",
"null"
]
},
"right": {
"type": "union",
"types": [
"number",
"null"
]
}
}
},
"borderRadius": {
"type": "union",
"types": [
"number",
"null"
]
}
},
"description": "表格单元格元素,支持 colSpan/rowSpan 合并"
},
"code": {
"description": "代码块元素,language 指定语言",
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"id": {
"type": "string"
},
"syntax": {
"type": "union",
"types": [
"string",
"null"
]
},
"theme": {
"type": "enum",
"values": [
"default",
"light",
"dracula",
"github",
"cobalt",
"atomOneDark",
"oneLightPro",
"nightOwl",
"githubDark",
"realDracula"
]
},
"height": {
"type": "union",
"types": [
"number",
"null"
]
},
"wrap": {
"type": "boolean"
},
"code": {
"type": "union",
"types": [
"string",
"null"
]
},
"fold": {
"type": "boolean"
},
"title": {
"type": "union",
"types": [
"string",
"null"
]
},
"hideHeader": {
"type": "boolean"
},
"codeFolding": {
"type": "boolean"
},
"showLineNumber": {
"type": "boolean"
},
"enableMacHeader": {
"type": "boolean"
},
"font": {
"type": "object",
"fields": {
"fontFamily": {
"type": "string"
},
"ligatures": {
"type": "boolean"
},
"fontSize": {
"type": "number"
}
}
},
"indentMode": {
"type": "enum",
"values": [
"space",
"tab"
]
},
"indentSize": {
"type": "union",
"types": [
"number",
"null"
]
}
}
},
"container": {
"description": "容器元素,subType 区分容器类型(callout 等)",
"allowed_children": [
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"code",
"table",
"embed",
"card",
"container",
"refblock",
"onlineVideo",
"toc"
],
"attrs": {
"uuid": {
"type": "string"
},
"subType": {
"type": "string",
"required": true
},
"metadata": {
"type": "object"
}
}
},
"embed": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"name": {
"type": "union",
"types": [
"string",
"null"
]
},
"type": {
"type": "union",
"types": [
"string",
"null"
]
},
"src": {
"type": "string",
"required": true
},
"size": {
"type": "union",
"types": [
"number",
"null"
]
},
"viewType": {
"type": "union",
"types": [
"string",
"null"
]
},
"previewSize": {
"type": "object"
}
},
"description": "嵌入元素,src 为嵌入资源地址"
},
"onlineVideo": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"src": {
"type": "string",
"required": true
},
"type": {
"type": "union",
"types": [
"string",
"null"
]
},
"poster": {
"type": "union",
"types": [
"string",
"null"
]
}
},
"description": "在线视频元素,src 为视频资源地址"
},
"card": {
"allowed_children": [
"a",
"span",
"table",
"tag"
],
"attrs": {
"uuid": {
"type": "string"
},
"cardType": {
"type": "string"
},
"height": {
"type": "union",
"types": [
"number",
"null"
]
},
"spacing": {
"type": "object"
},
"metadata": {
"type": "object"
},
"showSelector": {
"type": "boolean"
},
"urlType": {
"type": "string"
}
},
"description": "卡片元素,cardType 区分卡片类型"
},
"toc": {
"allowed_children": [
"span"
],
"description": "目录元素,mode 指定展示模式(outline/column),content 为目录项数组",
"attrs": {
"uuid": {
"type": "string"
},
"title": {
"type": "union",
"types": [
"string",
"null"
],
"required": true
},
"mode": {
"type": "enum",
"values": [
"outline",
"column"
],
"required": true
},
"styles": {
"type": "object",
"required": true
},
"content": {
"type": "array",
"required": true
}
}
},
"refblock": {
"allowed_children": [
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"code",
"table",
"embed",
"card",
"container",
"refblock",
"onlineVideo",
"toc"
],
"attrs": {
"uuid": {
"type": "string"
},
"docKey": {
"type": "string"
},
"refblockUUID": {
"type": "string"
}
},
"description": "引用块元素,引用其他文档的内容片段"
},
"cangjie-voidblock": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"subType": {
"type": "string",
"required": true
},
"data": {
"type": "any"
}
},
"description": "空块级扩展元素,subType 区分扩展类型"
},
"cangjie-container": {
"allowed_children": [
"p",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hr",
"code",
"table",
"embed",
"card",
"container",
"refblock",
"onlineVideo",
"toc"
],
"attrs": {
"uuid": {
"type": "string"
},
"subType": {
"type": "string",
"required": true
},
"data": {
"type": "any"
}
},
"description": "容器扩展元素,subType 区分容器类型"
},
"span": {
"description": "行内格式元素,data-type 区分文本/叶子/mention/emoji 等类型",
"allowed_children": [
"#text",
"span"
],
"attrs": {
"data-type": {
"type": "enum",
"required": true,
"values": [
"text",
"leaf",
"mention",
"emoji",
"refer",
"equation"
]
},
"uuid": {
"type": "string"
},
"id": {
"type": "string"
},
"bold": {
"type": "boolean"
},
"italic": {
"type": "boolean"
},
"strike": {
"type": "boolean"
},
"dstrike": {
"type": "boolean"
},
"underline": {
"type": "object",
"fields": {
"value": {
"type": "enum",
"values": [
"single",
"double",
"thick",
"dotted",
"dash",
"wave",
"none"
]
},
"color": {
"type": "string"
}
}
},
"highlight": {
"type": "union",
"types": [
"string",
"null"
]
},
"shd": {
"type": "object",
"fields": {
"val": {
"type": "string"
},
"color": {
"type": "string"
},
"fill": {
"type": "string"
}
}
},
"color": {
"type": "union",
"types": [
"string",
"null"
]
},
"sz": {
"type": "union",
"types": [
"number",
"null"
]
},
"szUnit": {
"type": "enum",
"values": [
"px",
"pt"
]
},
"em": {
"type": "any"
},
"fonts": {
"type": "object",
"fields": {
"ascii": {
"type": "string"
},
"hAnsi": {
"type": "string"
},
"cs": {
"type": "string"
},
"eastAsia": {
"type": "string"
}
}
},
"kern": {
"type": "any"
},
"vertAlign": {
"type": "enum",
"values": [
"superscript",
"subscript",
"baseline"
]
},
"spacing": {
"type": "union",
"types": [
"number",
"null"
]
},
"code": {
"type": "union",
"types": [
"string",
"null"
]
},
"newCode": {
"type": "union",
"types": [
"object",
"string"
]
},
"customCode": {
"type": "any"
},
"name": {
"type": "union",
"types": [
"string",
"null"
]
},
"login": {
"type": "union",
"types": [
"number",
"string"
]
},
"avatarUrl": {
"type": "union",
"types": [
"string",
"null"
]
},
"isPlaceholder": {
"type": "boolean"
},
"comment": {
"type": "object"
},
"metadata": {
"type": "object"
}
},
"aliases": {
"font-size": "sz",
"fontSize": "sz",
"font-weight": "bold",
"fontWeight": "bold",
"font-style": "italic",
"fontStyle": "italic",
"font-family": "fonts",
"fontFamily": "fonts",
"font-color": "color",
"background-color": "shd",
"backgroundColor": "shd",
"text-decoration": "underline"
}
},
"a": {
"description": "超链接元素,href 为必填链接地址",
"allowed_children": [
"img",
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"href": {
"type": "string",
"required": true
},
"cardInfo": {
"type": "object"
},
"metadata": {
"type": "object"
}
},
"aliases": {
"url": "href",
"link": "href"
}
},
"img": {
"description": "图片元素,src 为必填图片资源地址",
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"id": {
"type": "string"
},
"src": {
"type": "string",
"required": true
},
"width": {
"type": "union",
"types": [
"number",
"null"
]
},
"height": {
"type": "union",
"types": [
"number",
"null"
]
},
"name": {
"type": "union",
"types": [
"string",
"null"
]
},
"size": {
"type": "union",
"types": [
"number",
"null"
]
},
"outline": {
"type": "object",
"fields": {
"width": {
"type": "number"
},
"type": {
"type": "string"
},
"color": {
"type": "string"
}
}
},
"rectClip": {
"type": "object",
"fields": {
"right": {
"type": "number"
},
"left": {
"type": "number"
},
"top": {
"type": "number"
},
"bottom": {
"type": "number"
}
}
},
"rotation": {
"type": "union",
"types": [
"number",
"null"
]
},
"radius": {
"type": "union",
"types": [
"number",
"null"
]
},
"shadow": {
"type": "union",
"types": [
"string",
"null"
]
},
"opacity": {
"type": "union",
"types": [
"number",
"null"
]
},
"lockRatio": {
"type": "union",
"types": [
"number",
"null"
]
},
"extraData": {
"type": "object"
},
"caption": {
"type": "object",
"fields": {
"content": {
"type": "string"
},
"isShow": {
"type": "boolean"
}
}
},
"maxWidth": {
"type": "union",
"types": [
"string",
"null"
]
},
"wrap": {
"type": "object"
}
},
"aliases": {
"source": "src"
}
},
"tag": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"tagType": {
"type": "string",
"required": true
},
"height": {
"type": "union",
"types": [
"number",
"null"
]
},
"width": {
"type": "union",
"types": [
"number",
"null"
]
},
"metadata": {
"type": "object"
},
"enableCardView": {
"type": "boolean"
},
"urlType": {
"type": "string"
}
},
"description": "标签元素,tagType 指定标签类型"
},
"inlineCode": {
"allowed_children": [
"span",
"#text"
],
"attrs": {
"uuid": {
"type": "string"
},
"bgColor": {
"type": "union",
"types": [
"string",
"null"
]
}
},
"description": "行内代码元素"
},
"br": {
"allowed_children": [],
"attrs": {},
"description": "换行元素"
},
"cangjie-textinline": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"subType": {
"type": "string",
"required": true
},
"data": {
"type": "any"
}
},
"description": "行内文本扩展元素,subType 区分类型"
},
"cangjie-voidinline": {
"allowed_children": [
"span"
],
"attrs": {
"uuid": {
"type": "string"
},
"subType": {
"type": "string",
"required": true
},
"data": {
"type": "any"
}
},
"description": "行内空扩展元素,subType 区分类型"
}
}
}