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.
@@ -0,0 +1,390 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "sdoc.operations.schema.json",
4
+ "title": "SDOC semantic operation request",
5
+ "description": "Public request contract for an atomic sdoc.operations/1 batch.",
6
+ "type": "object",
7
+ "required": ["contract", "expected", "operations"],
8
+ "properties": {
9
+ "contract": { "const": "sdoc.operations/1" },
10
+ "expected": { "$ref": "#/definitions/expected" },
11
+ "operations": {
12
+ "type": "array",
13
+ "maxItems": 100,
14
+ "items": { "$ref": "#/definitions/operation" }
15
+ }
16
+ },
17
+ "additionalProperties": false,
18
+ "definitions": {
19
+ "sha256": {
20
+ "type": "string",
21
+ "pattern": "^sha256:[0-9a-f]{64}$"
22
+ },
23
+ "expected": {
24
+ "type": "object",
25
+ "required": ["revision"],
26
+ "properties": {
27
+ "revision": { "$ref": "#/definitions/sha256" },
28
+ "documentId": { "type": "string" }
29
+ },
30
+ "additionalProperties": false
31
+ },
32
+ "idTarget": {
33
+ "type": "object",
34
+ "required": ["kind", "id"],
35
+ "properties": {
36
+ "kind": { "const": "id" },
37
+ "id": { "type": "string" },
38
+ "expectedType": { "type": "string" }
39
+ },
40
+ "additionalProperties": false
41
+ },
42
+ "snapshotTarget": {
43
+ "type": "object",
44
+ "required": ["kind", "path", "nodeType", "digest"],
45
+ "properties": {
46
+ "kind": { "const": "snapshot" },
47
+ "path": {
48
+ "type": "array",
49
+ "maxItems": 128,
50
+ "items": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
51
+ },
52
+ "nodeType": { "type": "string" },
53
+ "digest": { "$ref": "#/definitions/sha256" }
54
+ },
55
+ "additionalProperties": false
56
+ },
57
+ "target": {
58
+ "oneOf": [
59
+ { "$ref": "#/definitions/idTarget" },
60
+ { "$ref": "#/definitions/snapshotTarget" }
61
+ ]
62
+ },
63
+ "destination": {
64
+ "oneOf": [
65
+ {
66
+ "type": "object",
67
+ "required": ["position", "target"],
68
+ "properties": {
69
+ "position": { "enum": ["before", "after"] },
70
+ "target": { "$ref": "#/definitions/target" }
71
+ },
72
+ "additionalProperties": false
73
+ },
74
+ {
75
+ "type": "object",
76
+ "required": ["position", "target"],
77
+ "properties": {
78
+ "position": { "const": "section-end" },
79
+ "target": { "$ref": "#/definitions/target" }
80
+ },
81
+ "additionalProperties": false
82
+ }
83
+ ]
84
+ },
85
+ "operation": {
86
+ "oneOf": [
87
+ { "$ref": "#/definitions/renameHeading" },
88
+ { "$ref": "#/definitions/insertBlock" },
89
+ { "$ref": "#/definitions/insertSection" },
90
+ { "$ref": "#/definitions/replaceBlock" },
91
+ { "$ref": "#/definitions/updateBlockAttrs" },
92
+ { "$ref": "#/definitions/moveBlock" },
93
+ { "$ref": "#/definitions/deleteBlock" },
94
+ { "$ref": "#/definitions/moveSection" },
95
+ { "$ref": "#/definitions/deleteSection" },
96
+ { "$ref": "#/definitions/setHeadingLevel" },
97
+ { "$ref": "#/definitions/setDocumentTitle" },
98
+ { "$ref": "#/definitions/renameBlockId" },
99
+ { "$ref": "#/definitions/updateDocumentMetadata" },
100
+ { "$ref": "#/definitions/updateDocumentSettings" }
101
+ ]
102
+ },
103
+ "renameHeading": {
104
+ "type": "object",
105
+ "required": ["op", "target", "title"],
106
+ "properties": {
107
+ "op": { "const": "renameHeading" },
108
+ "target": { "$ref": "#/definitions/target" },
109
+ "title": { "type": "string" },
110
+ "discardFormatting": { "type": "boolean" }
111
+ },
112
+ "additionalProperties": false
113
+ },
114
+ "insertBlock": {
115
+ "type": "object",
116
+ "required": ["op", "destination", "block"],
117
+ "properties": {
118
+ "op": { "const": "insertBlock" },
119
+ "destination": { "$ref": "#/definitions/destination" },
120
+ "block": { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/anyNode" }
121
+ },
122
+ "additionalProperties": false
123
+ },
124
+ "insertSection": {
125
+ "type": "object",
126
+ "required": ["op", "target", "title"],
127
+ "properties": {
128
+ "op": { "const": "insertSection" },
129
+ "target": { "$ref": "#/definitions/target" },
130
+ "title": { "type": "string" },
131
+ "id": { "type": "string" },
132
+ "position": { "enum": ["child", "before", "after"] },
133
+ "blocks": {
134
+ "type": "array",
135
+ "items": { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/anyNode" }
136
+ }
137
+ },
138
+ "additionalProperties": false
139
+ },
140
+ "replaceBlock": {
141
+ "type": "object",
142
+ "required": ["op", "target", "block"],
143
+ "properties": {
144
+ "op": { "const": "replaceBlock" },
145
+ "target": { "$ref": "#/definitions/target" },
146
+ "block": { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/anyNode" }
147
+ },
148
+ "additionalProperties": false
149
+ },
150
+ "updateBlockAttrs": {
151
+ "type": "object",
152
+ "required": ["op", "target", "attrs"],
153
+ "properties": {
154
+ "op": { "const": "updateBlockAttrs" },
155
+ "target": { "$ref": "#/definitions/target" },
156
+ "attrs": { "type": "object" }
157
+ },
158
+ "additionalProperties": false
159
+ },
160
+ "moveBlock": {
161
+ "type": "object",
162
+ "required": ["op", "target", "destination"],
163
+ "properties": {
164
+ "op": { "const": "moveBlock" },
165
+ "target": { "$ref": "#/definitions/target" },
166
+ "destination": { "$ref": "#/definitions/destination" }
167
+ },
168
+ "additionalProperties": false
169
+ },
170
+ "deleteBlock": {
171
+ "type": "object",
172
+ "required": ["op", "target"],
173
+ "properties": {
174
+ "op": { "const": "deleteBlock" },
175
+ "target": { "$ref": "#/definitions/target" }
176
+ },
177
+ "additionalProperties": false
178
+ },
179
+ "moveSection": {
180
+ "type": "object",
181
+ "required": ["op", "target", "destination"],
182
+ "properties": {
183
+ "op": { "const": "moveSection" },
184
+ "target": { "$ref": "#/definitions/target" },
185
+ "destination": { "$ref": "#/definitions/destination" }
186
+ },
187
+ "additionalProperties": false
188
+ },
189
+ "deleteSection": {
190
+ "type": "object",
191
+ "required": ["op", "target"],
192
+ "properties": {
193
+ "op": { "const": "deleteSection" },
194
+ "target": { "$ref": "#/definitions/target" }
195
+ },
196
+ "additionalProperties": false
197
+ },
198
+ "renameBlockId": {
199
+ "type": "object",
200
+ "required": ["op", "target", "newId"],
201
+ "properties": {
202
+ "op": { "const": "renameBlockId" },
203
+ "target": { "$ref": "#/definitions/target" },
204
+ "newId": {
205
+ "type": "string",
206
+ "minLength": 1,
207
+ "maxLength": 128,
208
+ "not": { "pattern": "^provisional:" }
209
+ }
210
+ },
211
+ "additionalProperties": false
212
+ },
213
+ "setHeadingLevel": {
214
+ "type": "object",
215
+ "required": ["op", "target", "level"],
216
+ "properties": {
217
+ "op": { "const": "setHeadingLevel" },
218
+ "target": { "$ref": "#/definitions/target" },
219
+ "level": { "type": "integer", "minimum": 1, "maximum": 6 }
220
+ },
221
+ "additionalProperties": false
222
+ },
223
+ "setDocumentTitle": {
224
+ "type": "object",
225
+ "required": ["op", "title"],
226
+ "properties": {
227
+ "op": { "const": "setDocumentTitle" },
228
+ "title": {
229
+ "type": "string",
230
+ "maxLength": 200,
231
+ "pattern": "\\S"
232
+ },
233
+ "headingTarget": { "$ref": "#/definitions/target" },
234
+ "discardFormatting": { "type": "boolean" }
235
+ },
236
+ "additionalProperties": false
237
+ },
238
+ "updateDocumentMetadata": {
239
+ "type": "object",
240
+ "required": ["op", "patch"],
241
+ "properties": {
242
+ "op": { "const": "updateDocumentMetadata" },
243
+ "patch": {
244
+ "type": "object",
245
+ "minProperties": 1,
246
+ "properties": {
247
+ "author": {
248
+ "oneOf": [
249
+ { "type": "string", "maxLength": 200 },
250
+ { "type": "null" }
251
+ ]
252
+ },
253
+ "version": {
254
+ "oneOf": [
255
+ { "type": "string", "maxLength": 200 },
256
+ { "type": "null" }
257
+ ]
258
+ }
259
+ },
260
+ "additionalProperties": false
261
+ }
262
+ },
263
+ "additionalProperties": false
264
+ },
265
+ "updateDocumentSettings": {
266
+ "type": "object",
267
+ "required": ["op", "patch"],
268
+ "properties": {
269
+ "op": { "const": "updateDocumentSettings" },
270
+ "patch": { "$ref": "#/definitions/portableSettingsPatch" }
271
+ },
272
+ "additionalProperties": false
273
+ },
274
+ "portableSettingsPatch": {
275
+ "type": "object",
276
+ "minProperties": 1,
277
+ "properties": {
278
+ "headingNumbering": {
279
+ "oneOf": [
280
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingNumbering" },
281
+ { "type": "null" }
282
+ ]
283
+ },
284
+ "headingStartNumber": {
285
+ "oneOf": [
286
+ { "type": "integer", "minimum": 0 },
287
+ { "type": "null" }
288
+ ]
289
+ },
290
+ "headingDecoration": {
291
+ "oneOf": [
292
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingDecoration" },
293
+ { "type": "null" }
294
+ ]
295
+ },
296
+ "headingH1Color": {
297
+ "oneOf": [
298
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH1Color" },
299
+ { "type": "null" }
300
+ ]
301
+ },
302
+ "headingH2Color": {
303
+ "oneOf": [
304
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH2Color" },
305
+ { "type": "null" }
306
+ ]
307
+ },
308
+ "headingH3Color": {
309
+ "oneOf": [
310
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH3Color" },
311
+ { "type": "null" }
312
+ ]
313
+ },
314
+ "headingH4Color": {
315
+ "oneOf": [
316
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH4Color" },
317
+ { "type": "null" }
318
+ ]
319
+ },
320
+ "headingH5Color": {
321
+ "oneOf": [
322
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH5Color" },
323
+ { "type": "null" }
324
+ ]
325
+ },
326
+ "headingH6Color": {
327
+ "oneOf": [
328
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/headingH6Color" },
329
+ { "type": "null" }
330
+ ]
331
+ },
332
+ "captionStyle": {
333
+ "oneOf": [
334
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/captionStyle" },
335
+ { "type": "null" }
336
+ ]
337
+ },
338
+ "captionNumbering": {
339
+ "oneOf": [
340
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/captionNumbering" },
341
+ { "type": "null" }
342
+ ]
343
+ },
344
+ "equationNumbering": {
345
+ "oneOf": [
346
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/equationNumbering" },
347
+ { "type": "null" }
348
+ ]
349
+ },
350
+ "crossRefIncludeCaption": {
351
+ "oneOf": [
352
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/crossRefIncludeCaption" },
353
+ { "type": "null" }
354
+ ]
355
+ },
356
+ "pdfScale": {
357
+ "oneOf": [
358
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/pdfScale" },
359
+ { "type": "null" }
360
+ ]
361
+ },
362
+ "selfContained": {
363
+ "oneOf": [
364
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/selfContained" },
365
+ { "type": "null" }
366
+ ]
367
+ },
368
+ "slideBreakLevel": {
369
+ "oneOf": [
370
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/slideBreakLevel" },
371
+ { "type": "null" }
372
+ ]
373
+ },
374
+ "slideTransition": {
375
+ "oneOf": [
376
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/slideTransition" },
377
+ { "type": "null" }
378
+ ]
379
+ },
380
+ "showTitleSlide": {
381
+ "oneOf": [
382
+ { "$ref": "https://sdoc.dev/schema/v1.0.json#/definitions/documentSettings/properties/showTitleSlide" },
383
+ { "type": "null" }
384
+ ]
385
+ }
386
+ },
387
+ "additionalProperties": false
388
+ }
389
+ }
390
+ }
@@ -0,0 +1,142 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "sdoc.read.schema.json",
4
+ "title": "SDOC bounded semantic read request",
5
+ "description": "Strict request union for the additive sdoc.read/1 projection contract.",
6
+ "oneOf": [
7
+ { "$ref": "#/definitions/catalogRequest" },
8
+ { "$ref": "#/definitions/targetRequest" },
9
+ { "$ref": "#/definitions/sectionRequest" },
10
+ { "$ref": "#/definitions/documentRequest" }
11
+ ],
12
+ "definitions": {
13
+ "sha256": {
14
+ "type": "string",
15
+ "pattern": "^sha256:[0-9a-f]{64}$"
16
+ },
17
+ "cursor": {
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "maxLength": 4096
21
+ },
22
+ "targetPath": {
23
+ "type": "array",
24
+ "maxItems": 128,
25
+ "items": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
26
+ },
27
+ "nodeTarget": {
28
+ "oneOf": [
29
+ {
30
+ "type": "object",
31
+ "required": ["kind", "id"],
32
+ "properties": {
33
+ "kind": { "const": "id" },
34
+ "id": { "type": "string" },
35
+ "expectedType": { "type": "string" }
36
+ },
37
+ "additionalProperties": false
38
+ },
39
+ {
40
+ "type": "object",
41
+ "required": ["kind", "path", "nodeType", "digest"],
42
+ "properties": {
43
+ "kind": { "const": "snapshot" },
44
+ "path": { "$ref": "#/definitions/targetPath" },
45
+ "nodeType": { "type": "string" },
46
+ "digest": { "$ref": "#/definitions/sha256" }
47
+ },
48
+ "additionalProperties": false
49
+ }
50
+ ]
51
+ },
52
+ "catalogRequest": {
53
+ "type": "object",
54
+ "required": ["contract", "projection"],
55
+ "properties": {
56
+ "contract": { "const": "sdoc.read/1" },
57
+ "projection": { "const": "catalog" },
58
+ "kind": { "enum": ["blocks", "outline", "references", "referenceables"] },
59
+ "limit": { "type": "integer", "minimum": 1, "maximum": 10000 },
60
+ "cursor": { "$ref": "#/definitions/cursor" },
61
+ "maxBytes": { "type": "integer", "minimum": 1, "maximum": 33554432 },
62
+ "maxSummaryLength": { "type": "integer", "minimum": 20, "maximum": 500 },
63
+ "expectedRevision": { "$ref": "#/definitions/sha256" }
64
+ },
65
+ "additionalProperties": false
66
+ },
67
+ "targetRequest": {
68
+ "type": "object",
69
+ "required": ["contract", "projection"],
70
+ "oneOf": [
71
+ {
72
+ "required": ["target"],
73
+ "properties": {
74
+ "target": {},
75
+ "targetPath": false
76
+ }
77
+ },
78
+ {
79
+ "required": ["targetPath"],
80
+ "properties": {
81
+ "target": false,
82
+ "targetPath": {}
83
+ }
84
+ }
85
+ ],
86
+ "properties": {
87
+ "contract": { "const": "sdoc.read/1" },
88
+ "projection": { "const": "target" },
89
+ "target": { "$ref": "#/definitions/nodeTarget" },
90
+ "targetPath": { "$ref": "#/definitions/targetPath" },
91
+ "maxBytes": { "type": "integer", "minimum": 1, "maximum": 33554432 },
92
+ "maxNodes": { "type": "integer", "minimum": 1, "maximum": 100000 },
93
+ "expectedRevision": { "$ref": "#/definitions/sha256" }
94
+ },
95
+ "additionalProperties": false
96
+ },
97
+ "sectionRequest": {
98
+ "type": "object",
99
+ "required": ["contract", "projection"],
100
+ "oneOf": [
101
+ {
102
+ "required": ["target"],
103
+ "properties": {
104
+ "target": {},
105
+ "targetPath": false
106
+ }
107
+ },
108
+ {
109
+ "required": ["targetPath"],
110
+ "properties": {
111
+ "target": false,
112
+ "targetPath": {}
113
+ }
114
+ }
115
+ ],
116
+ "properties": {
117
+ "contract": { "const": "sdoc.read/1" },
118
+ "projection": { "const": "section" },
119
+ "target": { "$ref": "#/definitions/nodeTarget" },
120
+ "targetPath": { "$ref": "#/definitions/targetPath" },
121
+ "cursor": { "$ref": "#/definitions/cursor" },
122
+ "maxBytes": { "type": "integer", "minimum": 1, "maximum": 33554432 },
123
+ "maxNodes": { "type": "integer", "minimum": 1, "maximum": 100000 },
124
+ "expectedRevision": { "$ref": "#/definitions/sha256" }
125
+ },
126
+ "additionalProperties": false
127
+ },
128
+ "documentRequest": {
129
+ "type": "object",
130
+ "required": ["contract", "projection"],
131
+ "properties": {
132
+ "contract": { "const": "sdoc.read/1" },
133
+ "projection": { "const": "document" },
134
+ "cursor": { "$ref": "#/definitions/cursor" },
135
+ "maxBytes": { "type": "integer", "minimum": 1, "maximum": 33554432 },
136
+ "maxNodes": { "type": "integer", "minimum": 1, "maximum": 100000 },
137
+ "expectedRevision": { "$ref": "#/definitions/sha256" }
138
+ },
139
+ "additionalProperties": false
140
+ }
141
+ }
142
+ }