@moredrive/cli 0.0.0-stage → 1.3.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,388 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://moredrive.local/schemas/moredrive-cli-v1.json",
4
+ "title": "MoreDrive CLI output",
5
+ "$defs": {
6
+ "fileOperation": {
7
+ "additionalProperties": false,
8
+ "type": "object",
9
+ "required": [
10
+ "operationId",
11
+ "scope",
12
+ "operation",
13
+ "status",
14
+ "progress",
15
+ "total",
16
+ "items",
17
+ "createdAt",
18
+ "updatedAt"
19
+ ],
20
+ "properties": {
21
+ "operationId": {
22
+ "minLength": 1,
23
+ "type": "string"
24
+ },
25
+ "scope": {
26
+ "anyOf": [
27
+ {
28
+ "const": "drive",
29
+ "type": "string"
30
+ },
31
+ {
32
+ "const": "share_space",
33
+ "type": "string"
34
+ }
35
+ ]
36
+ },
37
+ "spaceId": {
38
+ "minLength": 1,
39
+ "type": "string"
40
+ },
41
+ "operation": {
42
+ "anyOf": [
43
+ {
44
+ "const": "copy",
45
+ "type": "string"
46
+ },
47
+ {
48
+ "const": "move",
49
+ "type": "string"
50
+ },
51
+ {
52
+ "const": "rename",
53
+ "type": "string"
54
+ },
55
+ {
56
+ "const": "delete",
57
+ "type": "string"
58
+ }
59
+ ]
60
+ },
61
+ "status": {
62
+ "anyOf": [
63
+ {
64
+ "const": "accepted",
65
+ "type": "string"
66
+ },
67
+ {
68
+ "const": "running",
69
+ "type": "string"
70
+ },
71
+ {
72
+ "const": "completed",
73
+ "type": "string"
74
+ },
75
+ {
76
+ "const": "partial",
77
+ "type": "string"
78
+ },
79
+ {
80
+ "const": "failed",
81
+ "type": "string"
82
+ },
83
+ {
84
+ "const": "unknown",
85
+ "type": "string"
86
+ }
87
+ ]
88
+ },
89
+ "progress": {
90
+ "anyOf": [
91
+ {
92
+ "minimum": 0,
93
+ "type": "integer"
94
+ },
95
+ {
96
+ "type": "null"
97
+ }
98
+ ]
99
+ },
100
+ "total": {
101
+ "anyOf": [
102
+ {
103
+ "minimum": 0,
104
+ "type": "integer"
105
+ },
106
+ {
107
+ "type": "null"
108
+ }
109
+ ]
110
+ },
111
+ "items": {
112
+ "type": "array",
113
+ "items": {
114
+ "additionalProperties": false,
115
+ "type": "object",
116
+ "required": [
117
+ "index",
118
+ "source",
119
+ "status"
120
+ ],
121
+ "properties": {
122
+ "index": {
123
+ "minimum": 0,
124
+ "type": "integer"
125
+ },
126
+ "source": {
127
+ "minLength": 1,
128
+ "type": "string"
129
+ },
130
+ "target": {
131
+ "minLength": 1,
132
+ "type": "string"
133
+ },
134
+ "status": {
135
+ "anyOf": [
136
+ {
137
+ "const": "accepted",
138
+ "type": "string"
139
+ },
140
+ {
141
+ "const": "running",
142
+ "type": "string"
143
+ },
144
+ {
145
+ "const": "completed",
146
+ "type": "string"
147
+ },
148
+ {
149
+ "const": "partial",
150
+ "type": "string"
151
+ },
152
+ {
153
+ "const": "failed",
154
+ "type": "string"
155
+ },
156
+ {
157
+ "const": "unknown",
158
+ "type": "string"
159
+ }
160
+ ]
161
+ },
162
+ "fsId": {
163
+ "pattern": "^[0-9]+$",
164
+ "type": "string"
165
+ },
166
+ "errorCode": {
167
+ "type": "string"
168
+ },
169
+ "errorMessage": {
170
+ "type": "string"
171
+ }
172
+ }
173
+ }
174
+ },
175
+ "errorCode": {
176
+ "type": "string"
177
+ },
178
+ "errorMessage": {
179
+ "type": "string"
180
+ },
181
+ "createdAt": {
182
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$",
183
+ "type": "string"
184
+ },
185
+ "updatedAt": {
186
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$",
187
+ "type": "string"
188
+ },
189
+ "finishedAt": {
190
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$",
191
+ "type": "string"
192
+ }
193
+ }
194
+ },
195
+ "dryRunDelete": {
196
+ "type": "object",
197
+ "required": [
198
+ "dryRun",
199
+ "path",
200
+ "recursive",
201
+ "wouldDelete"
202
+ ],
203
+ "properties": {
204
+ "dryRun": {
205
+ "const": true
206
+ },
207
+ "path": {
208
+ "type": "string"
209
+ },
210
+ "recursive": {
211
+ "type": "boolean"
212
+ },
213
+ "wouldDelete": {
214
+ "type": "array",
215
+ "items": {
216
+ "type": "string"
217
+ }
218
+ }
219
+ },
220
+ "additionalProperties": false
221
+ }
222
+ },
223
+ "oneOf": [
224
+ {
225
+ "type": "object",
226
+ "required": [
227
+ "schemaVersion",
228
+ "ok",
229
+ "command",
230
+ "data",
231
+ "warnings",
232
+ "meta"
233
+ ],
234
+ "properties": {
235
+ "schemaVersion": {
236
+ "const": "moredrive.cli.v1"
237
+ },
238
+ "ok": {
239
+ "const": true
240
+ },
241
+ "command": {
242
+ "type": "string"
243
+ },
244
+ "data": {},
245
+ "warnings": {
246
+ "type": "array"
247
+ },
248
+ "meta": {
249
+ "type": "object",
250
+ "required": [
251
+ "durationMs",
252
+ "baseUrl"
253
+ ],
254
+ "properties": {
255
+ "durationMs": {
256
+ "type": "number"
257
+ },
258
+ "baseUrl": {
259
+ "type": "string"
260
+ },
261
+ "requestId": {
262
+ "type": "string"
263
+ }
264
+ }
265
+ }
266
+ },
267
+ "allOf": [
268
+ {
269
+ "if": {
270
+ "properties": {
271
+ "command": {
272
+ "enum": [
273
+ "drive.rename",
274
+ "drive.mv",
275
+ "drive.cp",
276
+ "operation.status"
277
+ ]
278
+ }
279
+ },
280
+ "required": [
281
+ "command"
282
+ ]
283
+ },
284
+ "then": {
285
+ "properties": {
286
+ "data": {
287
+ "$ref": "#/$defs/fileOperation"
288
+ }
289
+ }
290
+ }
291
+ },
292
+ {
293
+ "if": {
294
+ "properties": {
295
+ "command": {
296
+ "const": "drive.rm"
297
+ }
298
+ },
299
+ "required": [
300
+ "command"
301
+ ]
302
+ },
303
+ "then": {
304
+ "properties": {
305
+ "data": {
306
+ "oneOf": [
307
+ {
308
+ "$ref": "#/$defs/fileOperation"
309
+ },
310
+ {
311
+ "$ref": "#/$defs/dryRunDelete"
312
+ }
313
+ ]
314
+ }
315
+ }
316
+ }
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ "type": "object",
322
+ "required": [
323
+ "schemaVersion",
324
+ "ok",
325
+ "command",
326
+ "error",
327
+ "warnings",
328
+ "meta"
329
+ ],
330
+ "properties": {
331
+ "schemaVersion": {
332
+ "const": "moredrive.cli.v1"
333
+ },
334
+ "ok": {
335
+ "const": false
336
+ },
337
+ "command": {
338
+ "type": "string"
339
+ },
340
+ "error": {
341
+ "type": "object",
342
+ "required": [
343
+ "code",
344
+ "message",
345
+ "retriable"
346
+ ],
347
+ "properties": {
348
+ "code": {
349
+ "type": "string"
350
+ },
351
+ "message": {
352
+ "type": "string"
353
+ },
354
+ "status": {
355
+ "type": "number"
356
+ },
357
+ "errno": {
358
+ "type": "number"
359
+ },
360
+ "retriable": {
361
+ "type": "boolean"
362
+ },
363
+ "details": {
364
+ "type": "object"
365
+ }
366
+ }
367
+ },
368
+ "warnings": {
369
+ "type": "array"
370
+ },
371
+ "meta": {
372
+ "type": "object",
373
+ "required": [
374
+ "durationMs"
375
+ ],
376
+ "properties": {
377
+ "durationMs": {
378
+ "type": "number"
379
+ },
380
+ "baseUrl": {
381
+ "type": "string"
382
+ }
383
+ }
384
+ }
385
+ }
386
+ }
387
+ ]
388
+ }