@hussmartinez/image-sdk 0.3.0 → 0.5.0

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,311 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-command/v3.schema.json",
4
+ "title": "hm-image-command, version 3",
5
+ "description": "One user-level edit to an hm-image-plan (docs/formats/hm-image-plan.md, sdk-core ADR 0045). Version 2's commands are unchanged; this version adds the stroke commands, and drawings and arrows among the layers a command may carry. Beyond this schema, the reducer checks a crop against the plan's source, keys and indexes against the plan's lists, and each layer, stroke and redaction that results.",
6
+ "oneOf": [
7
+ {
8
+ "description": "Sets the crop, or removes it with null.",
9
+ "type": "object",
10
+ "required": ["type", "crop"],
11
+ "additionalProperties": false,
12
+ "properties": {
13
+ "type": {
14
+ "const": "image.setCrop"
15
+ },
16
+ "crop": {
17
+ "oneOf": [
18
+ {
19
+ "type": "null"
20
+ },
21
+ {
22
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/crop"
23
+ }
24
+ ]
25
+ }
26
+ }
27
+ },
28
+ {
29
+ "description": "Sets the rotation and flips.",
30
+ "type": "object",
31
+ "required": ["type", "orientation"],
32
+ "additionalProperties": false,
33
+ "properties": {
34
+ "type": {
35
+ "const": "image.setOrientation"
36
+ },
37
+ "orientation": {
38
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/orientation"
39
+ }
40
+ }
41
+ },
42
+ {
43
+ "description": "Sets the export's size.",
44
+ "type": "object",
45
+ "required": ["type", "output"],
46
+ "additionalProperties": false,
47
+ "properties": {
48
+ "type": {
49
+ "const": "image.setOutput"
50
+ },
51
+ "output": {
52
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/output"
53
+ }
54
+ }
55
+ },
56
+ {
57
+ "description": "Sets one kept metadata field.",
58
+ "type": "object",
59
+ "required": ["type", "field", "value"],
60
+ "additionalProperties": false,
61
+ "properties": {
62
+ "type": {
63
+ "const": "image.setMetadata"
64
+ },
65
+ "field": {
66
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/metadataField"
67
+ },
68
+ "value": {
69
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/metadataValue"
70
+ }
71
+ }
72
+ },
73
+ {
74
+ "description": "Sets some develop adjustments.",
75
+ "type": "object",
76
+ "required": ["type", "values"],
77
+ "additionalProperties": false,
78
+ "properties": {
79
+ "type": {
80
+ "const": "image.setDevelop"
81
+ },
82
+ "values": {
83
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/developValues"
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "description": "Sets the filter, or removes it with null.",
89
+ "type": "object",
90
+ "required": ["type", "filter"],
91
+ "additionalProperties": false,
92
+ "properties": {
93
+ "type": {
94
+ "const": "image.setFilter"
95
+ },
96
+ "filter": {
97
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/filter"
98
+ }
99
+ }
100
+ },
101
+ {
102
+ "description": "Inserts layers at an index: 0 is under every layer.",
103
+ "type": "object",
104
+ "required": ["type", "at", "layers"],
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "type": {
108
+ "const": "image.insertLayers"
109
+ },
110
+ "at": {
111
+ "type": "integer",
112
+ "minimum": 0
113
+ },
114
+ "layers": {
115
+ "type": "array",
116
+ "minItems": 1,
117
+ "items": {
118
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/layer"
119
+ }
120
+ }
121
+ }
122
+ },
123
+ {
124
+ "description": "Removes layers, by key.",
125
+ "type": "object",
126
+ "required": ["type", "keys"],
127
+ "additionalProperties": false,
128
+ "properties": {
129
+ "type": {
130
+ "const": "image.removeLayers"
131
+ },
132
+ "keys": {
133
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/keys"
134
+ }
135
+ }
136
+ },
137
+ {
138
+ "description": "Moves layers to an index of the list without them, keeping their order.",
139
+ "type": "object",
140
+ "required": ["type", "keys", "to"],
141
+ "additionalProperties": false,
142
+ "properties": {
143
+ "type": {
144
+ "const": "image.moveLayers"
145
+ },
146
+ "keys": {
147
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/keys"
148
+ },
149
+ "to": {
150
+ "type": "integer",
151
+ "minimum": 0
152
+ }
153
+ }
154
+ },
155
+ {
156
+ "description": "Sets some fields of some layers.",
157
+ "type": "object",
158
+ "required": ["type", "updates"],
159
+ "additionalProperties": false,
160
+ "properties": {
161
+ "type": {
162
+ "const": "image.updateLayers"
163
+ },
164
+ "updates": {
165
+ "type": "array",
166
+ "minItems": 1,
167
+ "items": {
168
+ "type": "object",
169
+ "required": ["key", "props"],
170
+ "additionalProperties": false,
171
+ "properties": {
172
+ "key": {
173
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/key"
174
+ },
175
+ "props": {
176
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/layerProps"
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ },
183
+ {
184
+ "description": "Appends strokes to a drawing layer: one stroke for each gesture.",
185
+ "type": "object",
186
+ "required": ["type", "key", "strokes"],
187
+ "additionalProperties": false,
188
+ "properties": {
189
+ "type": {
190
+ "const": "image.addStrokes"
191
+ },
192
+ "key": {
193
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/key"
194
+ },
195
+ "strokes": {
196
+ "type": "array",
197
+ "minItems": 1,
198
+ "maxItems": 1024,
199
+ "items": {
200
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/drawnStroke"
201
+ }
202
+ }
203
+ }
204
+ },
205
+ {
206
+ "description": "Removes strokes from a drawing layer, by index. A drawing keeps at least one.",
207
+ "type": "object",
208
+ "required": ["type", "key", "indexes"],
209
+ "additionalProperties": false,
210
+ "properties": {
211
+ "type": {
212
+ "const": "image.removeStrokes"
213
+ },
214
+ "key": {
215
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/key"
216
+ },
217
+ "indexes": {
218
+ "type": "array",
219
+ "minItems": 1,
220
+ "maxItems": 1024,
221
+ "items": {
222
+ "type": "integer",
223
+ "minimum": 0
224
+ }
225
+ }
226
+ }
227
+ },
228
+ {
229
+ "description": "Inserts redactions at an index.",
230
+ "type": "object",
231
+ "required": ["type", "at", "redactions"],
232
+ "additionalProperties": false,
233
+ "properties": {
234
+ "type": {
235
+ "const": "image.insertRedactions"
236
+ },
237
+ "at": {
238
+ "type": "integer",
239
+ "minimum": 0
240
+ },
241
+ "redactions": {
242
+ "type": "array",
243
+ "minItems": 1,
244
+ "items": {
245
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/redaction"
246
+ }
247
+ }
248
+ }
249
+ },
250
+ {
251
+ "description": "Removes redactions, by key.",
252
+ "type": "object",
253
+ "required": ["type", "keys"],
254
+ "additionalProperties": false,
255
+ "properties": {
256
+ "type": {
257
+ "const": "image.removeRedactions"
258
+ },
259
+ "keys": {
260
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/keys"
261
+ }
262
+ }
263
+ },
264
+ {
265
+ "description": "Moves redactions to an index of the list without them, keeping their order.",
266
+ "type": "object",
267
+ "required": ["type", "keys", "to"],
268
+ "additionalProperties": false,
269
+ "properties": {
270
+ "type": {
271
+ "const": "image.moveRedactions"
272
+ },
273
+ "keys": {
274
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/keys"
275
+ },
276
+ "to": {
277
+ "type": "integer",
278
+ "minimum": 0
279
+ }
280
+ }
281
+ },
282
+ {
283
+ "description": "Sets some fields of some redactions.",
284
+ "type": "object",
285
+ "required": ["type", "updates"],
286
+ "additionalProperties": false,
287
+ "properties": {
288
+ "type": {
289
+ "const": "image.updateRedactions"
290
+ },
291
+ "updates": {
292
+ "type": "array",
293
+ "minItems": 1,
294
+ "items": {
295
+ "type": "object",
296
+ "required": ["key", "props"],
297
+ "additionalProperties": false,
298
+ "properties": {
299
+ "key": {
300
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/key"
301
+ },
302
+ "props": {
303
+ "$ref": "https://github.com/ie-huss-martinez/image-sdk/blob/main/formats/hm-image-plan/v3.schema.json#/$defs/redactionProps"
304
+ }
305
+ }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ ]
311
+ }