@fleetless/contracts 14.0.0 → 15.0.1

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/artifacts/openapi.json +20210 -11764
  3. package/artifacts/routes.json +1160 -39
  4. package/artifacts/schema/addon-catalogue-entry.schema.json +3 -1
  5. package/artifacts/schema/admin-plan-change-request.schema.json +26 -0
  6. package/artifacts/schema/app-deletion-summary.schema.json +15 -1
  7. package/artifacts/schema/asset-plan-limit-details.schema.json +3 -1
  8. package/artifacts/schema/billing-change-response.schema.json +9 -8
  9. package/artifacts/schema/checkout-response.schema.json +6 -6
  10. package/artifacts/schema/cloud-config.schema.json +5 -5
  11. package/artifacts/schema/collection-actor.schema.json +35 -0
  12. package/artifacts/schema/collection-definitions-response.schema.json +612 -0
  13. package/artifacts/schema/collection-event.schema.json +216 -0
  14. package/artifacts/schema/collection-export-query.schema.json +56 -0
  15. package/artifacts/schema/collection-filter.schema.json +9 -0
  16. package/artifacts/schema/collection-import-preview.schema.json +143 -0
  17. package/artifacts/schema/collection-import-request.schema.json +105 -0
  18. package/artifacts/schema/collection-import-result.schema.json +38 -0
  19. package/artifacts/schema/collection-list-response.schema.json +119 -0
  20. package/artifacts/schema/collection-record-get-query.schema.json +12 -0
  21. package/artifacts/schema/collection-record-history-query.schema.json +35 -0
  22. package/artifacts/schema/collection-record-history-response.schema.json +389 -0
  23. package/artifacts/schema/collection-record-list-query.schema.json +67 -0
  24. package/artifacts/schema/collection-record-list-response.schema.json +212 -0
  25. package/artifacts/schema/collection-record-restore-request.schema.json +14 -0
  26. package/artifacts/schema/collection-record-write.schema.json +31 -0
  27. package/artifacts/schema/collection-record.schema.json +180 -0
  28. package/artifacts/schema/collection-revision.schema.json +295 -0
  29. package/artifacts/schema/collection-subscribe-error.schema.json +31 -0
  30. package/artifacts/schema/collection-subscribe.schema.json +48 -0
  31. package/artifacts/schema/collection-subscribed.schema.json +22 -0
  32. package/artifacts/schema/collection-summary.schema.json +92 -0
  33. package/artifacts/schema/collection-unsubscribe.schema.json +22 -0
  34. package/artifacts/schema/collections-access-change.schema.json +34 -0
  35. package/artifacts/schema/collections-document.schema.json +732 -0
  36. package/artifacts/schema/collections-draft-response.schema.json +845 -0
  37. package/artifacts/schema/collections-effect.schema.json +384 -0
  38. package/artifacts/schema/collections-issue.schema.json +36 -0
  39. package/artifacts/schema/collections-publish-request.schema.json +18 -0
  40. package/artifacts/schema/collections-publish-response.schema.json +450 -0
  41. package/artifacts/schema/collections-purge-preview.schema.json +60 -0
  42. package/artifacts/schema/collections-purge-request.schema.json +27 -0
  43. package/artifacts/schema/collections-purge-response.schema.json +30 -0
  44. package/artifacts/schema/collections-restore-preview-query.schema.json +20 -0
  45. package/artifacts/schema/collections-restore-preview.schema.json +581 -0
  46. package/artifacts/schema/collections-restore-request.schema.json +27 -0
  47. package/artifacts/schema/collections-restore-response.schema.json +455 -0
  48. package/artifacts/schema/collections-schema-preview.schema.json +519 -0
  49. package/artifacts/schema/collections-schema-published.schema.json +22 -0
  50. package/artifacts/schema/collections-version-response.schema.json +869 -0
  51. package/artifacts/schema/collections-version-summary.schema.json +139 -0
  52. package/artifacts/schema/collections-versions-response.schema.json +167 -0
  53. package/artifacts/schema/config-draft-response.schema.json +5 -5
  54. package/artifacts/schema/config-version-response.schema.json +5 -5
  55. package/artifacts/schema/confirmation-required-details.schema.json +13 -0
  56. package/artifacts/schema/dangling-reference.schema.json +7 -6
  57. package/artifacts/schema/datapoint-list-response.schema.json +2 -2
  58. package/artifacts/schema/effective-rights-response.schema.json +87 -1
  59. package/artifacts/schema/org-plan.schema.json +29 -1
  60. package/artifacts/schema/org-quota-usage-counts.schema.json +18 -0
  61. package/artifacts/schema/org-quota-usage.schema.json +47 -1
  62. package/artifacts/schema/org-quotas.schema.json +29 -1
  63. package/artifacts/schema/org-role-list-response.schema.json +8 -7
  64. package/artifacts/schema/org-role.schema.json +1 -1
  65. package/artifacts/schema/plan-catalogue-entry.schema.json +29 -1
  66. package/artifacts/schema/plan-change-decision-status-response.schema.json +29 -1
  67. package/artifacts/schema/plan-limit-details.schema.json +3 -1
  68. package/artifacts/schema/plan-limits.schema.json +29 -1
  69. package/artifacts/schema/plan-overrides.schema.json +26 -0
  70. package/artifacts/schema/purchase-conflict-details.schema.json +6 -6
  71. package/artifacts/schema/purchase-intent-draft.schema.json +5 -5
  72. package/artifacts/schema/purchase-intent-payment-started.schema.json +1 -1
  73. package/artifacts/schema/purchase-intent-response.schema.json +10 -9
  74. package/artifacts/schema/put-collections-draft-request.schema.json +16 -0
  75. package/artifacts/schema/record-changed-details.schema.json +16 -0
  76. package/artifacts/schema/record-referenced-details.schema.json +35 -0
  77. package/artifacts/schema/reference-invalid-details.schema.json +25 -0
  78. package/artifacts/schema/reference-place.schema.json +7 -6
  79. package/artifacts/schema/required-missing-details.schema.json +19 -0
  80. package/artifacts/schema/robot-config-doc.schema.json +5 -5
  81. package/artifacts/schema/robot-deletion-summary.schema.json +33 -1
  82. package/artifacts/schema/role-collection-rights.schema.json +82 -0
  83. package/artifacts/schema/role-rename-preview.schema.json +7 -6
  84. package/dist/apps.d.ts +18 -2
  85. package/dist/apps.js +12 -2
  86. package/dist/audit.d.ts +32 -2
  87. package/dist/audit.js +40 -2
  88. package/dist/billing.js +12 -3
  89. package/dist/collections-issues.d.ts +67 -0
  90. package/dist/collections-issues.js +340 -0
  91. package/dist/collections-records.d.ts +562 -0
  92. package/dist/collections-records.js +525 -0
  93. package/dist/collections-rights.d.ts +17 -0
  94. package/dist/collections-rights.js +41 -0
  95. package/dist/collections-schema.d.ts +1064 -0
  96. package/dist/collections-schema.js +386 -0
  97. package/dist/collections-templates.d.ts +55 -0
  98. package/dist/collections-templates.js +137 -0
  99. package/dist/collections-transfer.d.ts +101 -0
  100. package/dist/collections-transfer.js +206 -0
  101. package/dist/collections-values.d.ts +67 -0
  102. package/dist/collections-values.js +284 -0
  103. package/dist/collections.d.ts +568 -0
  104. package/dist/collections.js +332 -0
  105. package/dist/config.d.ts +8 -8
  106. package/dist/config.js +13 -13
  107. package/dist/errors.d.ts +50 -1
  108. package/dist/errors.js +117 -2
  109. package/dist/index.d.ts +24 -8
  110. package/dist/index.js +13 -3
  111. package/dist/org-roles.d.ts +4 -0
  112. package/dist/org-roles.js +10 -9
  113. package/dist/plans.d.ts +22 -2
  114. package/dist/plans.js +26 -4
  115. package/dist/realtime.d.ts +166 -0
  116. package/dist/realtime.js +163 -0
  117. package/dist/rest.d.ts +28 -28
  118. package/dist/rest.js +39 -27
  119. package/dist/rights.d.ts +2 -2
  120. package/dist/rights.js +1 -1
  121. package/dist/routes.d.ts +1 -1
  122. package/dist/routes.js +495 -21
  123. package/package.json +1 -1
  124. package/artifacts/schema/put-robot-details-request.schema.json +0 -41
  125. package/artifacts/schema/put-robot-details-response.schema.json +0 -43
  126. package/artifacts/schema/robot-details-doc.schema.json +0 -33
@@ -0,0 +1,581 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "version": {
6
+ "type": "integer",
7
+ "minimum": 1,
8
+ "maximum": 9007199254740991,
9
+ "description": "The version that would be restored."
10
+ },
11
+ "with_data": {
12
+ "type": "boolean",
13
+ "description": "Whether this preview is for a restore that also puts records back."
14
+ },
15
+ "data_possible": {
16
+ "type": "boolean",
17
+ "description": "Whether records can be put back at all."
18
+ },
19
+ "data_reason": {
20
+ "type": "string",
21
+ "enum": [
22
+ "ok",
23
+ "expired",
24
+ "purged",
25
+ "current_version"
26
+ ],
27
+ "description": "`ok`: records can be put back. `expired`: the restore point is more than 90 days old. `purged`: an owner removed the history it needs. `current_version`: this version is already in force."
28
+ },
29
+ "touched": {
30
+ "type": "array",
31
+ "items": {
32
+ "type": "string",
33
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
34
+ "description": "The key of the collection."
35
+ },
36
+ "description": "The collections that differ between the current version and this one; only these can get records back."
37
+ },
38
+ "selected": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string",
42
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
43
+ "description": "The key of the collection."
44
+ },
45
+ "description": "The touched collections whose records would be put back. The caller may deselect some."
46
+ },
47
+ "reverted": {
48
+ "type": "array",
49
+ "items": {
50
+ "type": "object",
51
+ "properties": {
52
+ "collection": {
53
+ "type": "string",
54
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
55
+ "description": "The key of the collection."
56
+ },
57
+ "changes": {
58
+ "type": "integer",
59
+ "minimum": 0,
60
+ "maximum": 9007199254740991,
61
+ "description": "Changes made since the restore point that would be reverted."
62
+ },
63
+ "records_back": {
64
+ "type": "integer",
65
+ "minimum": 0,
66
+ "maximum": 9007199254740991,
67
+ "description": "Deleted records that would come back."
68
+ },
69
+ "records_deleted": {
70
+ "type": "integer",
71
+ "minimum": 0,
72
+ "maximum": 9007199254740991,
73
+ "description": "Records created since the restore point that would be deleted."
74
+ }
75
+ },
76
+ "required": [
77
+ "collection",
78
+ "changes",
79
+ "records_back",
80
+ "records_deleted"
81
+ ],
82
+ "additionalProperties": false
83
+ },
84
+ "description": "What putting the records back would do, per selected collection."
85
+ },
86
+ "robots_gone": {
87
+ "type": "integer",
88
+ "minimum": 0,
89
+ "maximum": 9007199254740991,
90
+ "description": "Records of robots that were deleted since cannot come back; this is how many."
91
+ },
92
+ "effects": {
93
+ "type": "array",
94
+ "items": {
95
+ "oneOf": [
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "kind": {
100
+ "type": "string",
101
+ "const": "collection_removed"
102
+ },
103
+ "collection": {
104
+ "type": "string",
105
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
106
+ "description": "The key of the collection."
107
+ },
108
+ "records": {
109
+ "type": "integer",
110
+ "minimum": 0,
111
+ "maximum": 9007199254740991,
112
+ "description": "Records deleted with the collection."
113
+ }
114
+ },
115
+ "required": [
116
+ "kind",
117
+ "collection",
118
+ "records"
119
+ ],
120
+ "additionalProperties": false,
121
+ "description": "The collection is gone from the document, so its records are deleted. Their history is deleted 90 days after the publish or restore that removed the collection, also when it held no records any more by then; until then a restore of an earlier version with its data can bring the records back."
122
+ },
123
+ {
124
+ "type": "object",
125
+ "properties": {
126
+ "kind": {
127
+ "type": "string",
128
+ "const": "collection_recreated"
129
+ },
130
+ "collection": {
131
+ "type": "string",
132
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
133
+ "description": "The key of the collection."
134
+ },
135
+ "records": {
136
+ "type": "integer",
137
+ "minimum": 0,
138
+ "maximum": 9007199254740991,
139
+ "description": "Records deleted by the re-creation."
140
+ },
141
+ "from": {
142
+ "type": "string",
143
+ "enum": [
144
+ "global",
145
+ "per_robot",
146
+ "one_per_robot"
147
+ ],
148
+ "description": "`global`: records belong to the app and no robot. `per_robot`: every record belongs to one robot (system field `robot_id`, fixed when the record is created). `one_per_robot`: every robot of the app has exactly one record, which Fleetless creates itself."
149
+ },
150
+ "to": {
151
+ "type": "string",
152
+ "enum": [
153
+ "global",
154
+ "per_robot",
155
+ "one_per_robot"
156
+ ],
157
+ "description": "`global`: records belong to the app and no robot. `per_robot`: every record belongs to one robot (system field `robot_id`, fixed when the record is created). `one_per_robot`: every robot of the app has exactly one record, which Fleetless creates itself."
158
+ }
159
+ },
160
+ "required": [
161
+ "kind",
162
+ "collection",
163
+ "records",
164
+ "from",
165
+ "to"
166
+ ],
167
+ "additionalProperties": false,
168
+ "description": "The binding of the collection changed, which deletes its records and starts the collection again. The history of the deleted records is kept 90 days after the publish or restore, as for a removed collection."
169
+ },
170
+ {
171
+ "type": "object",
172
+ "properties": {
173
+ "kind": {
174
+ "type": "string",
175
+ "const": "records_created"
176
+ },
177
+ "collection": {
178
+ "type": "string",
179
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
180
+ "description": "The key of the collection."
181
+ },
182
+ "count": {
183
+ "type": "integer",
184
+ "minimum": 0,
185
+ "maximum": 9007199254740991,
186
+ "description": "Records created, one for each robot attached to the app."
187
+ }
188
+ },
189
+ "required": [
190
+ "kind",
191
+ "collection",
192
+ "count"
193
+ ],
194
+ "additionalProperties": false,
195
+ "description": "A collection with one record per robot got the records of the robots that have none."
196
+ },
197
+ {
198
+ "type": "object",
199
+ "properties": {
200
+ "kind": {
201
+ "type": "string",
202
+ "const": "field_removed"
203
+ },
204
+ "collection": {
205
+ "type": "string",
206
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
207
+ "description": "The key of the collection."
208
+ },
209
+ "field": {
210
+ "type": "string",
211
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
212
+ "description": "The key of the field."
213
+ },
214
+ "values": {
215
+ "type": "integer",
216
+ "minimum": 0,
217
+ "maximum": 9007199254740991,
218
+ "description": "Values removed from records."
219
+ }
220
+ },
221
+ "required": [
222
+ "kind",
223
+ "collection",
224
+ "field",
225
+ "values"
226
+ ],
227
+ "additionalProperties": false,
228
+ "description": "The field is gone from the document, so its values are removed from the records."
229
+ },
230
+ {
231
+ "type": "object",
232
+ "properties": {
233
+ "kind": {
234
+ "type": "string",
235
+ "const": "defaults_filled"
236
+ },
237
+ "collection": {
238
+ "type": "string",
239
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
240
+ "description": "The key of the collection."
241
+ },
242
+ "field": {
243
+ "type": "string",
244
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
245
+ "description": "The key of the field."
246
+ },
247
+ "records": {
248
+ "type": "integer",
249
+ "minimum": 0,
250
+ "maximum": 9007199254740991,
251
+ "description": "Records that receive the default."
252
+ }
253
+ },
254
+ "required": [
255
+ "kind",
256
+ "collection",
257
+ "field",
258
+ "records"
259
+ ],
260
+ "additionalProperties": false,
261
+ "description": "Records without a value get the default of a new or newly required field."
262
+ },
263
+ {
264
+ "type": "object",
265
+ "properties": {
266
+ "kind": {
267
+ "type": "string",
268
+ "const": "values_converted"
269
+ },
270
+ "collection": {
271
+ "type": "string",
272
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
273
+ "description": "The key of the collection."
274
+ },
275
+ "field": {
276
+ "type": "string",
277
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
278
+ "description": "The key of the field."
279
+ },
280
+ "converted": {
281
+ "type": "integer",
282
+ "minimum": 0,
283
+ "maximum": 9007199254740991,
284
+ "description": "Values that became a value of the new type."
285
+ },
286
+ "discarded": {
287
+ "type": "integer",
288
+ "minimum": 0,
289
+ "maximum": 9007199254740991,
290
+ "description": "Values that could not be converted and were removed."
291
+ }
292
+ },
293
+ "required": [
294
+ "kind",
295
+ "collection",
296
+ "field",
297
+ "converted",
298
+ "discarded"
299
+ ],
300
+ "additionalProperties": false,
301
+ "description": "The type of the field changed: values are converted where the conversion rules allow it and removed where they do not."
302
+ },
303
+ {
304
+ "type": "object",
305
+ "properties": {
306
+ "kind": {
307
+ "type": "string",
308
+ "const": "values_discarded"
309
+ },
310
+ "collection": {
311
+ "type": "string",
312
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
313
+ "description": "The key of the collection."
314
+ },
315
+ "field": {
316
+ "type": "string",
317
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
318
+ "description": "The key of the field."
319
+ },
320
+ "reason": {
321
+ "type": "string",
322
+ "enum": [
323
+ "reference_target_changed",
324
+ "option_removed",
325
+ "constraint"
326
+ ],
327
+ "description": "`reference_target_changed`: the field points at another collection now. `option_removed`: a select option is gone. `constraint`: a limit such as `max_length`, `pattern`, `min`, `max`, `integer` or the JSON schema now excludes the value."
328
+ },
329
+ "values": {
330
+ "type": "integer",
331
+ "minimum": 0,
332
+ "maximum": 9007199254740991,
333
+ "description": "Values removed from records."
334
+ }
335
+ },
336
+ "required": [
337
+ "kind",
338
+ "collection",
339
+ "field",
340
+ "reason",
341
+ "values"
342
+ ],
343
+ "additionalProperties": false,
344
+ "description": "Values that the changed field no longer accepts are removed."
345
+ },
346
+ {
347
+ "type": "object",
348
+ "properties": {
349
+ "kind": {
350
+ "type": "string",
351
+ "const": "unique_discarded"
352
+ },
353
+ "collection": {
354
+ "type": "string",
355
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
356
+ "description": "The key of the collection."
357
+ },
358
+ "field": {
359
+ "type": "string",
360
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
361
+ "description": "The key of the field."
362
+ },
363
+ "total": {
364
+ "type": "integer",
365
+ "minimum": 0,
366
+ "maximum": 9007199254740991,
367
+ "description": "The exact number of values removed."
368
+ },
369
+ "records": {
370
+ "maxItems": 1000,
371
+ "type": "array",
372
+ "items": {
373
+ "type": "object",
374
+ "properties": {
375
+ "id": {
376
+ "type": "string",
377
+ "format": "uuid",
378
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
379
+ },
380
+ "display": {
381
+ "type": "string",
382
+ "description": "The record's display text."
383
+ },
384
+ "value": {
385
+ "description": "The value the record loses."
386
+ }
387
+ },
388
+ "required": [
389
+ "id",
390
+ "display",
391
+ "value"
392
+ ],
393
+ "additionalProperties": false
394
+ },
395
+ "description": "The records that lose their value, at most 1000; `total` is the exact number."
396
+ }
397
+ },
398
+ "required": [
399
+ "kind",
400
+ "collection",
401
+ "field",
402
+ "total",
403
+ "records"
404
+ ],
405
+ "additionalProperties": false,
406
+ "description": "The field became unique, or unique across a wider scope, and records share a value: the record created first keeps it and the others lose it."
407
+ },
408
+ {
409
+ "type": "object",
410
+ "properties": {
411
+ "kind": {
412
+ "type": "string",
413
+ "const": "required_left_empty"
414
+ },
415
+ "collection": {
416
+ "type": "string",
417
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
418
+ "description": "The key of the collection."
419
+ },
420
+ "field": {
421
+ "type": "string",
422
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
423
+ "description": "The key of the field."
424
+ },
425
+ "records": {
426
+ "type": "integer",
427
+ "minimum": 0,
428
+ "maximum": 9007199254740991,
429
+ "description": "Records left without a value."
430
+ }
431
+ },
432
+ "required": [
433
+ "kind",
434
+ "collection",
435
+ "field",
436
+ "records"
437
+ ],
438
+ "additionalProperties": false,
439
+ "description": "The field is required now and these records have no value and no default to fill in; they stay updatable in their other fields."
440
+ },
441
+ {
442
+ "type": "object",
443
+ "properties": {
444
+ "kind": {
445
+ "type": "string",
446
+ "const": "references_cleared"
447
+ },
448
+ "collection": {
449
+ "type": "string",
450
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
451
+ "description": "The key of the collection."
452
+ },
453
+ "field": {
454
+ "type": "string",
455
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
456
+ "description": "The key of the field."
457
+ },
458
+ "values": {
459
+ "type": "integer",
460
+ "minimum": 0,
461
+ "maximum": 9007199254740991,
462
+ "description": "References removed."
463
+ }
464
+ },
465
+ "required": [
466
+ "kind",
467
+ "collection",
468
+ "field",
469
+ "values"
470
+ ],
471
+ "additionalProperties": false,
472
+ "description": "References that pointed at records deleted by this change are cleared."
473
+ }
474
+ ],
475
+ "description": "One effect of a publish or restore on existing data. Effects that would change nothing are not listed."
476
+ },
477
+ "description": "The ordinary effects of publishing this version's document."
478
+ },
479
+ "access_changes": {
480
+ "type": "array",
481
+ "items": {
482
+ "type": "object",
483
+ "properties": {
484
+ "collection": {
485
+ "type": "string",
486
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
487
+ "description": "The key of the collection."
488
+ },
489
+ "action": {
490
+ "type": "string",
491
+ "enum": [
492
+ "read",
493
+ "create",
494
+ "update",
495
+ "delete"
496
+ ]
497
+ },
498
+ "from": {
499
+ "description": "The access before, as written in the document. `null` means nobody."
500
+ },
501
+ "to": {
502
+ "description": "The access after, as written in the document. `null` means nobody."
503
+ }
504
+ },
505
+ "required": [
506
+ "collection",
507
+ "action",
508
+ "from",
509
+ "to"
510
+ ],
511
+ "additionalProperties": false,
512
+ "description": "A change of the roles that may do one thing with the records of a collection. Information only; it does not need confirming."
513
+ }
514
+ },
515
+ "issues": {
516
+ "type": "array",
517
+ "items": {
518
+ "type": "object",
519
+ "properties": {
520
+ "path": {
521
+ "type": "string",
522
+ "minLength": 1,
523
+ "description": "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`."
524
+ },
525
+ "code": {
526
+ "type": "string",
527
+ "description": "A stable name for the kind of finding, for code to branch on."
528
+ },
529
+ "message": {
530
+ "type": "string",
531
+ "description": "What is wrong, in a sentence for a person."
532
+ },
533
+ "severity": {
534
+ "type": "string",
535
+ "enum": [
536
+ "error",
537
+ "warning",
538
+ "info"
539
+ ],
540
+ "description": "An error makes the document invalid and it cannot be saved or published. A warning and information leave it valid."
541
+ }
542
+ },
543
+ "required": [
544
+ "path",
545
+ "code",
546
+ "message",
547
+ "severity"
548
+ ],
549
+ "additionalProperties": false,
550
+ "description": "One finding about a collections document."
551
+ }
552
+ },
553
+ "token": {
554
+ "anyOf": [
555
+ {
556
+ "type": "string"
557
+ },
558
+ {
559
+ "type": "null"
560
+ }
561
+ ],
562
+ "description": "Stands for exactly what this restore would do: send it as `confirm`. Null when the restore changes no data and needs no confirmation."
563
+ }
564
+ },
565
+ "required": [
566
+ "version",
567
+ "with_data",
568
+ "data_possible",
569
+ "data_reason",
570
+ "touched",
571
+ "selected",
572
+ "reverted",
573
+ "robots_gone",
574
+ "effects",
575
+ "access_changes",
576
+ "issues",
577
+ "token"
578
+ ],
579
+ "additionalProperties": false,
580
+ "description": "The preview of restoring a version, with the token that confirms it."
581
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "data": {
6
+ "type": "boolean",
7
+ "description": "Also put records back to their state at the restore point, in the touched collections. Default `false`."
8
+ },
9
+ "collections": {
10
+ "maxItems": 50,
11
+ "type": "array",
12
+ "items": {
13
+ "type": "string",
14
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
15
+ "description": "A collection key or a field key: `^[a-z][a-z0-9_]{0,62}$`. Keys appear in URLs, filters and record bodies; `label` is the text people read."
16
+ },
17
+ "description": "Limits putting records back to these touched collections. Default: all of them."
18
+ },
19
+ "confirm": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "description": "The `token` of the preview of exactly this request. Needed when the preview lists effects; a missing or outdated token is answered with `confirmation_required` and the current preview."
23
+ }
24
+ },
25
+ "additionalProperties": false,
26
+ "description": "Restores a version. Send the `data` and `collections` of the preview together with its token as `confirm`."
27
+ }