sdoc-editor-cli 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +625 -0
- package/bin/sdoc.js +2 -0
- package/dist/examples/operations/delete-block.json +17 -0
- package/dist/examples/operations/delete-section.json +12 -0
- package/dist/examples/operations/insert-block.json +19 -0
- package/dist/examples/operations/insert-section.json +21 -0
- package/dist/examples/operations/move-block.json +21 -0
- package/dist/examples/operations/move-section.json +16 -0
- package/dist/examples/operations/rename-block-id.json +13 -0
- package/dist/examples/operations/rename-heading.json +13 -0
- package/dist/examples/operations/replace-block.json +21 -0
- package/dist/examples/operations/set-document-title.json +17 -0
- package/dist/examples/operations/set-heading-level.json +13 -0
- package/dist/examples/operations/update-block-attrs.json +13 -0
- package/dist/examples/operations/update-document-metadata.json +15 -0
- package/dist/examples/operations/update-document-settings.json +16 -0
- package/dist/schemas/sdoc.cli.response.schema.json +436 -0
- package/dist/schemas/sdoc.operations.schema.json +390 -0
- package/dist/schemas/sdoc.read.schema.json +142 -0
- package/dist/schemas/sdoc.schema.json +559 -0
- package/dist/sdoc.js +8637 -0
- package/package.json +30 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "deleteSection",
|
|
9
|
+
"target": { "kind": "id", "id": "section-heading-id-from-inspect" }
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "insertBlock",
|
|
9
|
+
"destination": {
|
|
10
|
+
"position": "section-end",
|
|
11
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect" }
|
|
12
|
+
},
|
|
13
|
+
"block": {
|
|
14
|
+
"type": "paragraph",
|
|
15
|
+
"content": [{ "type": "text", "text": "Inserted paragraph" }]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "insertSection",
|
|
9
|
+
"target": { "kind": "id", "id": "sibling-heading-id-from-inspect" },
|
|
10
|
+
"position": "after",
|
|
11
|
+
"title": "New sibling section",
|
|
12
|
+
"id": "new-section-id",
|
|
13
|
+
"blocks": [
|
|
14
|
+
{
|
|
15
|
+
"type": "paragraph",
|
|
16
|
+
"content": [{ "type": "text", "text": "Section body" }]
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "moveBlock",
|
|
9
|
+
"target": {
|
|
10
|
+
"kind": "snapshot",
|
|
11
|
+
"path": [1],
|
|
12
|
+
"nodeType": "paragraph",
|
|
13
|
+
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
+
},
|
|
15
|
+
"destination": {
|
|
16
|
+
"position": "after",
|
|
17
|
+
"target": { "kind": "id", "id": "image-id-from-inspect" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "moveSection",
|
|
9
|
+
"target": { "kind": "id", "id": "section-heading-id-from-inspect" },
|
|
10
|
+
"destination": {
|
|
11
|
+
"position": "before",
|
|
12
|
+
"target": { "kind": "id", "id": "destination-heading-id-from-inspect" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "renameBlockId",
|
|
9
|
+
"target": { "kind": "id", "id": "old-id-from-inspect", "expectedType": "heading" },
|
|
10
|
+
"newId": "meaningful-section-id"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "renameHeading",
|
|
9
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect" },
|
|
10
|
+
"title": "Updated heading"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "replaceBlock",
|
|
9
|
+
"target": {
|
|
10
|
+
"kind": "snapshot",
|
|
11
|
+
"path": [1],
|
|
12
|
+
"nodeType": "paragraph",
|
|
13
|
+
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
+
},
|
|
15
|
+
"block": {
|
|
16
|
+
"type": "paragraph",
|
|
17
|
+
"content": [{ "type": "text", "text": "Replacement paragraph" }]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "setDocumentTitle",
|
|
9
|
+
"title": "Updated document title",
|
|
10
|
+
"headingTarget": {
|
|
11
|
+
"kind": "id",
|
|
12
|
+
"id": "document-title-from-inspect",
|
|
13
|
+
"expectedType": "heading"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "setHeadingLevel",
|
|
9
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect", "expectedType": "heading" },
|
|
10
|
+
"level": 1
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateBlockAttrs",
|
|
9
|
+
"target": { "kind": "id", "id": "image-id-from-inspect", "expectedType": "image" },
|
|
10
|
+
"attrs": { "alt": "Updated alternative text", "width": 640 }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateDocumentMetadata",
|
|
9
|
+
"patch": {
|
|
10
|
+
"author": "SDOC Agent",
|
|
11
|
+
"version": "1.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateDocumentSettings",
|
|
9
|
+
"patch": {
|
|
10
|
+
"headingNumbering": true,
|
|
11
|
+
"captionStyle": "modern",
|
|
12
|
+
"showTitleSlide": null
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "sdoc.cli.response.schema.json",
|
|
4
|
+
"title": "SDOC CLI JSON response",
|
|
5
|
+
"description": "Versioned, additive JSON response contract emitted by the SDOC CLI.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{ "$ref": "#/definitions/failure" },
|
|
8
|
+
{ "$ref": "#/definitions/inspectSuccess" },
|
|
9
|
+
{ "$ref": "#/definitions/projectedInspectSuccess" },
|
|
10
|
+
{ "$ref": "#/definitions/validateSuccess" },
|
|
11
|
+
{ "$ref": "#/definitions/mutationSuccess" },
|
|
12
|
+
{ "$ref": "#/definitions/createSuccess" },
|
|
13
|
+
{ "$ref": "#/definitions/capabilitiesSuccess" }
|
|
14
|
+
],
|
|
15
|
+
"definitions": {
|
|
16
|
+
"sha256": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^sha256:[0-9a-f]{64}$"
|
|
19
|
+
},
|
|
20
|
+
"diagnostic": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": ["code", "message"],
|
|
23
|
+
"properties": {
|
|
24
|
+
"code": { "type": "string", "minLength": 1 },
|
|
25
|
+
"message": { "type": "string" },
|
|
26
|
+
"path": {
|
|
27
|
+
"oneOf": [
|
|
28
|
+
{ "type": "string" },
|
|
29
|
+
{
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": {
|
|
32
|
+
"oneOf": [
|
|
33
|
+
{ "type": "string" },
|
|
34
|
+
{ "type": "number" }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"operationIndex": { "type": "integer", "minimum": 0 },
|
|
41
|
+
"severity": { "enum": ["error", "warning"] },
|
|
42
|
+
"requiredBytes": { "type": "integer", "minimum": 0 },
|
|
43
|
+
"requiredNodes": { "type": "integer", "minimum": 0 }
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": true
|
|
46
|
+
},
|
|
47
|
+
"diagnostics": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"minItems": 1,
|
|
50
|
+
"items": { "$ref": "#/definitions/diagnostic" }
|
|
51
|
+
},
|
|
52
|
+
"warnings": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "$ref": "#/definitions/diagnostic" }
|
|
55
|
+
},
|
|
56
|
+
"failure": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["contract", "ok", "category", "diagnostics"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
61
|
+
"ok": { "const": false },
|
|
62
|
+
"category": { "enum": ["argument", "document", "conflict", "io", "internal"] },
|
|
63
|
+
"diagnostics": { "$ref": "#/definitions/diagnostics" }
|
|
64
|
+
},
|
|
65
|
+
"additionalProperties": true
|
|
66
|
+
},
|
|
67
|
+
"inspectSuccess": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"not": {
|
|
70
|
+
"required": ["projection"],
|
|
71
|
+
"properties": { "projection": {} }
|
|
72
|
+
},
|
|
73
|
+
"required": [
|
|
74
|
+
"contract",
|
|
75
|
+
"ok",
|
|
76
|
+
"command",
|
|
77
|
+
"path",
|
|
78
|
+
"revision",
|
|
79
|
+
"legacy",
|
|
80
|
+
"needsIdNormalization",
|
|
81
|
+
"metadata",
|
|
82
|
+
"outline",
|
|
83
|
+
"references",
|
|
84
|
+
"referenceables",
|
|
85
|
+
"blocks",
|
|
86
|
+
"blockCount",
|
|
87
|
+
"blocksTruncated",
|
|
88
|
+
"warnings"
|
|
89
|
+
],
|
|
90
|
+
"properties": {
|
|
91
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
92
|
+
"ok": { "const": true },
|
|
93
|
+
"command": { "const": "inspect" },
|
|
94
|
+
"path": { "type": "string", "minLength": 1 },
|
|
95
|
+
"revision": { "$ref": "#/definitions/sha256" },
|
|
96
|
+
"legacy": { "type": "boolean" },
|
|
97
|
+
"needsIdNormalization": { "type": "boolean" },
|
|
98
|
+
"metadata": { "type": "object" },
|
|
99
|
+
"outline": { "type": "array" },
|
|
100
|
+
"references": { "type": "array" },
|
|
101
|
+
"referenceables": { "type": "array" },
|
|
102
|
+
"blocks": { "type": "array" },
|
|
103
|
+
"blockCount": { "type": "integer", "minimum": 0 },
|
|
104
|
+
"blocksTruncated": { "type": "boolean" },
|
|
105
|
+
"warnings": { "$ref": "#/definitions/warnings" }
|
|
106
|
+
},
|
|
107
|
+
"additionalProperties": true
|
|
108
|
+
},
|
|
109
|
+
"readPage": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"required": ["returned", "complete"],
|
|
112
|
+
"properties": {
|
|
113
|
+
"returned": { "type": "integer", "minimum": 0 },
|
|
114
|
+
"complete": { "type": "boolean" },
|
|
115
|
+
"nextCursor": { "type": "string", "minLength": 1, "maxLength": 4096 },
|
|
116
|
+
"truncatedBy": { "enum": ["limit", "maxBytes", "maxNodes"] }
|
|
117
|
+
},
|
|
118
|
+
"additionalProperties": true
|
|
119
|
+
},
|
|
120
|
+
"readBudgetAmount": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"required": ["used", "max"],
|
|
123
|
+
"properties": {
|
|
124
|
+
"used": { "type": "integer", "minimum": 0 },
|
|
125
|
+
"max": { "type": "integer", "minimum": 1 }
|
|
126
|
+
},
|
|
127
|
+
"additionalProperties": true
|
|
128
|
+
},
|
|
129
|
+
"readBudget": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["bytes"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"bytes": { "$ref": "#/definitions/readBudgetAmount" },
|
|
134
|
+
"nodes": { "$ref": "#/definitions/readBudgetAmount" }
|
|
135
|
+
},
|
|
136
|
+
"additionalProperties": true
|
|
137
|
+
},
|
|
138
|
+
"catalogReadData": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"required": ["kind", "items"],
|
|
141
|
+
"properties": {
|
|
142
|
+
"kind": { "enum": ["blocks", "outline", "references", "referenceables"] },
|
|
143
|
+
"items": { "type": "array", "items": { "type": "object" } }
|
|
144
|
+
},
|
|
145
|
+
"additionalProperties": true
|
|
146
|
+
},
|
|
147
|
+
"targetReadData": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["path", "node", "digest", "operationTarget"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"path": { "type": "array", "items": { "type": "integer", "minimum": 0 } },
|
|
152
|
+
"node": { "type": "object" },
|
|
153
|
+
"digest": { "$ref": "#/definitions/sha256" },
|
|
154
|
+
"operationTarget": { "type": "object" }
|
|
155
|
+
},
|
|
156
|
+
"additionalProperties": true
|
|
157
|
+
},
|
|
158
|
+
"sectionReadData": {
|
|
159
|
+
"type": "object",
|
|
160
|
+
"required": ["path", "content"],
|
|
161
|
+
"properties": {
|
|
162
|
+
"path": { "type": "array", "items": { "type": "integer", "minimum": 0 } },
|
|
163
|
+
"content": { "type": "array", "items": { "type": "object" } }
|
|
164
|
+
},
|
|
165
|
+
"additionalProperties": true
|
|
166
|
+
},
|
|
167
|
+
"documentReadData": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"required": ["content"],
|
|
170
|
+
"properties": {
|
|
171
|
+
"content": { "type": "array", "items": { "type": "object" } }
|
|
172
|
+
},
|
|
173
|
+
"additionalProperties": true
|
|
174
|
+
},
|
|
175
|
+
"projectedInspectSuccess": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"oneOf": [
|
|
178
|
+
{
|
|
179
|
+
"properties": {
|
|
180
|
+
"projection": { "const": "catalog" },
|
|
181
|
+
"data": { "$ref": "#/definitions/catalogReadData" }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"properties": {
|
|
186
|
+
"projection": { "const": "target" },
|
|
187
|
+
"data": { "$ref": "#/definitions/targetReadData" }
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"properties": {
|
|
192
|
+
"projection": { "const": "section" },
|
|
193
|
+
"data": { "$ref": "#/definitions/sectionReadData" }
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"properties": {
|
|
198
|
+
"projection": { "const": "document" },
|
|
199
|
+
"data": { "$ref": "#/definitions/documentReadData" }
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"required": [
|
|
204
|
+
"contract",
|
|
205
|
+
"readContract",
|
|
206
|
+
"ok",
|
|
207
|
+
"command",
|
|
208
|
+
"path",
|
|
209
|
+
"projection",
|
|
210
|
+
"revision",
|
|
211
|
+
"legacy",
|
|
212
|
+
"needsIdNormalization",
|
|
213
|
+
"data",
|
|
214
|
+
"page",
|
|
215
|
+
"budget",
|
|
216
|
+
"warnings"
|
|
217
|
+
],
|
|
218
|
+
"properties": {
|
|
219
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
220
|
+
"readContract": { "const": "sdoc.read/1" },
|
|
221
|
+
"ok": { "const": true },
|
|
222
|
+
"command": { "const": "inspect" },
|
|
223
|
+
"path": { "type": "string", "minLength": 1 },
|
|
224
|
+
"projection": { "enum": ["catalog", "target", "section", "document"] },
|
|
225
|
+
"revision": { "$ref": "#/definitions/sha256" },
|
|
226
|
+
"legacy": { "type": "boolean" },
|
|
227
|
+
"documentId": { "type": "string" },
|
|
228
|
+
"needsIdNormalization": { "type": "boolean" },
|
|
229
|
+
"data": { "type": "object" },
|
|
230
|
+
"page": { "$ref": "#/definitions/readPage" },
|
|
231
|
+
"budget": { "$ref": "#/definitions/readBudget" },
|
|
232
|
+
"warnings": { "$ref": "#/definitions/warnings" }
|
|
233
|
+
},
|
|
234
|
+
"additionalProperties": true
|
|
235
|
+
},
|
|
236
|
+
"validateSuccess": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"required": [
|
|
239
|
+
"contract",
|
|
240
|
+
"ok",
|
|
241
|
+
"command",
|
|
242
|
+
"path",
|
|
243
|
+
"revision",
|
|
244
|
+
"legacy",
|
|
245
|
+
"needsIdNormalization",
|
|
246
|
+
"warnings"
|
|
247
|
+
],
|
|
248
|
+
"properties": {
|
|
249
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
250
|
+
"ok": { "const": true },
|
|
251
|
+
"command": { "const": "validate" },
|
|
252
|
+
"path": { "type": "string", "minLength": 1 },
|
|
253
|
+
"revision": { "$ref": "#/definitions/sha256" },
|
|
254
|
+
"legacy": { "type": "boolean" },
|
|
255
|
+
"needsIdNormalization": { "type": "boolean" },
|
|
256
|
+
"warnings": { "$ref": "#/definitions/warnings" }
|
|
257
|
+
},
|
|
258
|
+
"additionalProperties": true
|
|
259
|
+
},
|
|
260
|
+
"mutationSuccess": {
|
|
261
|
+
"type": "object",
|
|
262
|
+
"required": [
|
|
263
|
+
"contract",
|
|
264
|
+
"ok",
|
|
265
|
+
"command",
|
|
266
|
+
"path",
|
|
267
|
+
"revision",
|
|
268
|
+
"outputRevision",
|
|
269
|
+
"changed",
|
|
270
|
+
"legacy",
|
|
271
|
+
"diff",
|
|
272
|
+
"normalizationPolicy",
|
|
273
|
+
"warnings",
|
|
274
|
+
"preview",
|
|
275
|
+
"written"
|
|
276
|
+
],
|
|
277
|
+
"properties": {
|
|
278
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
279
|
+
"ok": { "const": true },
|
|
280
|
+
"command": {
|
|
281
|
+
"enum": ["apply", "rename-heading", "set-document-title"]
|
|
282
|
+
},
|
|
283
|
+
"path": { "type": "string", "minLength": 1 },
|
|
284
|
+
"revision": { "$ref": "#/definitions/sha256" },
|
|
285
|
+
"outputRevision": { "$ref": "#/definitions/sha256" },
|
|
286
|
+
"changed": { "type": "boolean" },
|
|
287
|
+
"legacy": { "type": "boolean" },
|
|
288
|
+
"diff": { "type": "array" },
|
|
289
|
+
"normalizationPolicy": { "type": "object" },
|
|
290
|
+
"warnings": { "$ref": "#/definitions/warnings" },
|
|
291
|
+
"preview": { "type": "boolean" },
|
|
292
|
+
"written": { "type": "boolean" }
|
|
293
|
+
},
|
|
294
|
+
"additionalProperties": true
|
|
295
|
+
},
|
|
296
|
+
"templateSelection": {
|
|
297
|
+
"oneOf": [
|
|
298
|
+
{
|
|
299
|
+
"type": "object",
|
|
300
|
+
"required": ["kind", "id"],
|
|
301
|
+
"properties": {
|
|
302
|
+
"kind": { "const": "builtin" },
|
|
303
|
+
"id": { "type": "string", "pattern": "^builtin:" }
|
|
304
|
+
},
|
|
305
|
+
"additionalProperties": true
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"type": "object",
|
|
309
|
+
"required": ["kind", "path"],
|
|
310
|
+
"properties": {
|
|
311
|
+
"kind": { "const": "file" },
|
|
312
|
+
"path": { "type": "string", "minLength": 1 }
|
|
313
|
+
},
|
|
314
|
+
"additionalProperties": true
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
"createSuccess": {
|
|
319
|
+
"type": "object",
|
|
320
|
+
"required": [
|
|
321
|
+
"contract",
|
|
322
|
+
"ok",
|
|
323
|
+
"command",
|
|
324
|
+
"path",
|
|
325
|
+
"title",
|
|
326
|
+
"template",
|
|
327
|
+
"templateLabel",
|
|
328
|
+
"revision",
|
|
329
|
+
"preview",
|
|
330
|
+
"written"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
334
|
+
"ok": { "const": true },
|
|
335
|
+
"command": { "const": "create" },
|
|
336
|
+
"path": { "type": "string", "minLength": 1 },
|
|
337
|
+
"title": { "type": "string", "minLength": 1 },
|
|
338
|
+
"template": { "$ref": "#/definitions/templateSelection" },
|
|
339
|
+
"templateLabel": { "type": "string", "minLength": 1 },
|
|
340
|
+
"revision": { "$ref": "#/definitions/sha256" },
|
|
341
|
+
"preview": { "type": "boolean" },
|
|
342
|
+
"written": { "type": "boolean" },
|
|
343
|
+
"warnings": { "$ref": "#/definitions/warnings" }
|
|
344
|
+
},
|
|
345
|
+
"additionalProperties": true
|
|
346
|
+
},
|
|
347
|
+
"capabilitiesSuccess": {
|
|
348
|
+
"type": "object",
|
|
349
|
+
"required": [
|
|
350
|
+
"contract",
|
|
351
|
+
"ok",
|
|
352
|
+
"command",
|
|
353
|
+
"cliVersion",
|
|
354
|
+
"contracts",
|
|
355
|
+
"commands",
|
|
356
|
+
"semanticOperations",
|
|
357
|
+
"limits",
|
|
358
|
+
"projections",
|
|
359
|
+
"catalogKinds",
|
|
360
|
+
"builtInTemplateIds"
|
|
361
|
+
],
|
|
362
|
+
"properties": {
|
|
363
|
+
"contract": { "const": "sdoc.cli.response/1" },
|
|
364
|
+
"ok": { "const": true },
|
|
365
|
+
"command": { "const": "capabilities" },
|
|
366
|
+
"cliVersion": { "type": "string", "minLength": 1 },
|
|
367
|
+
"contracts": {
|
|
368
|
+
"type": "object",
|
|
369
|
+
"required": ["document", "operations", "read", "response"],
|
|
370
|
+
"properties": {
|
|
371
|
+
"document": { "const": "sdoc/1.0" },
|
|
372
|
+
"operations": { "const": "sdoc.operations/1" },
|
|
373
|
+
"read": { "const": "sdoc.read/1" },
|
|
374
|
+
"response": { "const": "sdoc.cli.response/1" }
|
|
375
|
+
},
|
|
376
|
+
"additionalProperties": true
|
|
377
|
+
},
|
|
378
|
+
"commands": {
|
|
379
|
+
"type": "array",
|
|
380
|
+
"minItems": 1,
|
|
381
|
+
"uniqueItems": true,
|
|
382
|
+
"items": { "type": "string", "minLength": 1 }
|
|
383
|
+
},
|
|
384
|
+
"semanticOperations": {
|
|
385
|
+
"type": "array",
|
|
386
|
+
"minItems": 1,
|
|
387
|
+
"uniqueItems": true,
|
|
388
|
+
"items": { "type": "string", "minLength": 1 }
|
|
389
|
+
},
|
|
390
|
+
"limits": {
|
|
391
|
+
"type": "object",
|
|
392
|
+
"required": [
|
|
393
|
+
"documentBytes",
|
|
394
|
+
"operationInputBytes",
|
|
395
|
+
"operationCount",
|
|
396
|
+
"documentNodes",
|
|
397
|
+
"inspectLegacyMaxBlocks",
|
|
398
|
+
"readCatalogLimit",
|
|
399
|
+
"readMaxBytes",
|
|
400
|
+
"readMaxNodes"
|
|
401
|
+
],
|
|
402
|
+
"properties": {
|
|
403
|
+
"documentBytes": { "const": 33554432 },
|
|
404
|
+
"operationInputBytes": { "const": 4194304 },
|
|
405
|
+
"operationCount": { "const": 100 },
|
|
406
|
+
"documentNodes": { "const": 100000 },
|
|
407
|
+
"inspectLegacyMaxBlocks": { "const": 10000 },
|
|
408
|
+
"readCatalogLimit": { "const": 10000 },
|
|
409
|
+
"readMaxBytes": { "const": 33554432 },
|
|
410
|
+
"readMaxNodes": { "const": 100000 }
|
|
411
|
+
},
|
|
412
|
+
"additionalProperties": true
|
|
413
|
+
},
|
|
414
|
+
"projections": {
|
|
415
|
+
"type": "array",
|
|
416
|
+
"minItems": 1,
|
|
417
|
+
"uniqueItems": true,
|
|
418
|
+
"items": { "enum": ["catalog", "target", "section", "document"] }
|
|
419
|
+
},
|
|
420
|
+
"catalogKinds": {
|
|
421
|
+
"type": "array",
|
|
422
|
+
"minItems": 1,
|
|
423
|
+
"uniqueItems": true,
|
|
424
|
+
"items": { "enum": ["blocks", "outline", "references", "referenceables"] }
|
|
425
|
+
},
|
|
426
|
+
"builtInTemplateIds": {
|
|
427
|
+
"type": "array",
|
|
428
|
+
"minItems": 1,
|
|
429
|
+
"uniqueItems": true,
|
|
430
|
+
"items": { "type": "string", "pattern": "^builtin:" }
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
"additionalProperties": true
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|