@fleetless/contracts 14.0.0 → 15.0.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +163 -0
  2. package/artifacts/openapi.json +19842 -11398
  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/cloud-config.schema.json +5 -5
  9. package/artifacts/schema/collection-actor.schema.json +35 -0
  10. package/artifacts/schema/collection-definitions-response.schema.json +612 -0
  11. package/artifacts/schema/collection-event.schema.json +216 -0
  12. package/artifacts/schema/collection-export-query.schema.json +56 -0
  13. package/artifacts/schema/collection-filter.schema.json +9 -0
  14. package/artifacts/schema/collection-import-preview.schema.json +143 -0
  15. package/artifacts/schema/collection-import-request.schema.json +105 -0
  16. package/artifacts/schema/collection-import-result.schema.json +38 -0
  17. package/artifacts/schema/collection-list-response.schema.json +119 -0
  18. package/artifacts/schema/collection-record-get-query.schema.json +12 -0
  19. package/artifacts/schema/collection-record-history-query.schema.json +35 -0
  20. package/artifacts/schema/collection-record-history-response.schema.json +389 -0
  21. package/artifacts/schema/collection-record-list-query.schema.json +67 -0
  22. package/artifacts/schema/collection-record-list-response.schema.json +212 -0
  23. package/artifacts/schema/collection-record-restore-request.schema.json +14 -0
  24. package/artifacts/schema/collection-record-write.schema.json +31 -0
  25. package/artifacts/schema/collection-record.schema.json +180 -0
  26. package/artifacts/schema/collection-revision.schema.json +295 -0
  27. package/artifacts/schema/collection-subscribe-error.schema.json +31 -0
  28. package/artifacts/schema/collection-subscribe.schema.json +48 -0
  29. package/artifacts/schema/collection-subscribed.schema.json +22 -0
  30. package/artifacts/schema/collection-summary.schema.json +92 -0
  31. package/artifacts/schema/collection-unsubscribe.schema.json +22 -0
  32. package/artifacts/schema/collections-access-change.schema.json +34 -0
  33. package/artifacts/schema/collections-document.schema.json +732 -0
  34. package/artifacts/schema/collections-draft-response.schema.json +845 -0
  35. package/artifacts/schema/collections-effect.schema.json +384 -0
  36. package/artifacts/schema/collections-issue.schema.json +36 -0
  37. package/artifacts/schema/collections-publish-request.schema.json +18 -0
  38. package/artifacts/schema/collections-publish-response.schema.json +450 -0
  39. package/artifacts/schema/collections-purge-preview.schema.json +60 -0
  40. package/artifacts/schema/collections-purge-request.schema.json +27 -0
  41. package/artifacts/schema/collections-purge-response.schema.json +30 -0
  42. package/artifacts/schema/collections-restore-preview-query.schema.json +20 -0
  43. package/artifacts/schema/collections-restore-preview.schema.json +581 -0
  44. package/artifacts/schema/collections-restore-request.schema.json +27 -0
  45. package/artifacts/schema/collections-restore-response.schema.json +455 -0
  46. package/artifacts/schema/collections-schema-preview.schema.json +519 -0
  47. package/artifacts/schema/collections-schema-published.schema.json +22 -0
  48. package/artifacts/schema/collections-version-response.schema.json +869 -0
  49. package/artifacts/schema/collections-version-summary.schema.json +139 -0
  50. package/artifacts/schema/collections-versions-response.schema.json +167 -0
  51. package/artifacts/schema/config-draft-response.schema.json +5 -5
  52. package/artifacts/schema/config-version-response.schema.json +5 -5
  53. package/artifacts/schema/confirmation-required-details.schema.json +13 -0
  54. package/artifacts/schema/dangling-reference.schema.json +7 -6
  55. package/artifacts/schema/datapoint-list-response.schema.json +2 -2
  56. package/artifacts/schema/effective-rights-response.schema.json +87 -1
  57. package/artifacts/schema/org-plan.schema.json +29 -1
  58. package/artifacts/schema/org-quota-usage-counts.schema.json +18 -0
  59. package/artifacts/schema/org-quota-usage.schema.json +47 -1
  60. package/artifacts/schema/org-quotas.schema.json +29 -1
  61. package/artifacts/schema/org-role-list-response.schema.json +8 -7
  62. package/artifacts/schema/org-role.schema.json +1 -1
  63. package/artifacts/schema/plan-catalogue-entry.schema.json +29 -1
  64. package/artifacts/schema/plan-change-decision-status-response.schema.json +29 -1
  65. package/artifacts/schema/plan-limit-details.schema.json +3 -1
  66. package/artifacts/schema/plan-limits.schema.json +29 -1
  67. package/artifacts/schema/plan-overrides.schema.json +26 -0
  68. package/artifacts/schema/put-collections-draft-request.schema.json +16 -0
  69. package/artifacts/schema/record-changed-details.schema.json +16 -0
  70. package/artifacts/schema/record-referenced-details.schema.json +35 -0
  71. package/artifacts/schema/reference-invalid-details.schema.json +25 -0
  72. package/artifacts/schema/reference-place.schema.json +7 -6
  73. package/artifacts/schema/required-missing-details.schema.json +19 -0
  74. package/artifacts/schema/robot-config-doc.schema.json +5 -5
  75. package/artifacts/schema/robot-deletion-summary.schema.json +33 -1
  76. package/artifacts/schema/role-collection-rights.schema.json +82 -0
  77. package/artifacts/schema/role-rename-preview.schema.json +7 -6
  78. package/dist/apps.d.ts +18 -2
  79. package/dist/apps.js +12 -2
  80. package/dist/audit.d.ts +32 -2
  81. package/dist/audit.js +40 -2
  82. package/dist/collections-issues.d.ts +67 -0
  83. package/dist/collections-issues.js +340 -0
  84. package/dist/collections-records.d.ts +562 -0
  85. package/dist/collections-records.js +525 -0
  86. package/dist/collections-rights.d.ts +17 -0
  87. package/dist/collections-rights.js +41 -0
  88. package/dist/collections-schema.d.ts +1064 -0
  89. package/dist/collections-schema.js +386 -0
  90. package/dist/collections-templates.d.ts +55 -0
  91. package/dist/collections-templates.js +137 -0
  92. package/dist/collections-transfer.d.ts +101 -0
  93. package/dist/collections-transfer.js +206 -0
  94. package/dist/collections-values.d.ts +67 -0
  95. package/dist/collections-values.js +284 -0
  96. package/dist/collections.d.ts +568 -0
  97. package/dist/collections.js +332 -0
  98. package/dist/config.d.ts +8 -8
  99. package/dist/config.js +13 -13
  100. package/dist/errors.d.ts +50 -1
  101. package/dist/errors.js +115 -0
  102. package/dist/index.d.ts +24 -8
  103. package/dist/index.js +13 -3
  104. package/dist/org-roles.d.ts +4 -0
  105. package/dist/org-roles.js +10 -9
  106. package/dist/plans.d.ts +19 -1
  107. package/dist/plans.js +21 -1
  108. package/dist/realtime.d.ts +166 -0
  109. package/dist/realtime.js +163 -0
  110. package/dist/rest.d.ts +28 -28
  111. package/dist/rest.js +39 -27
  112. package/dist/rights.d.ts +2 -2
  113. package/dist/rights.js +1 -1
  114. package/dist/routes.d.ts +1 -1
  115. package/dist/routes.js +495 -21
  116. package/package.json +1 -1
  117. package/artifacts/schema/put-robot-details-request.schema.json +0 -41
  118. package/artifacts/schema/put-robot-details-response.schema.json +0 -43
  119. package/artifacts/schema/robot-details-doc.schema.json +0 -33
@@ -0,0 +1,450 @@
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
+ },
10
+ "published_at": {
11
+ "type": "string",
12
+ "format": "date-time",
13
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
14
+ },
15
+ "effects": {
16
+ "type": "array",
17
+ "items": {
18
+ "oneOf": [
19
+ {
20
+ "type": "object",
21
+ "properties": {
22
+ "kind": {
23
+ "type": "string",
24
+ "const": "collection_removed"
25
+ },
26
+ "collection": {
27
+ "type": "string",
28
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
29
+ "description": "The key of the collection."
30
+ },
31
+ "records": {
32
+ "type": "integer",
33
+ "minimum": 0,
34
+ "maximum": 9007199254740991,
35
+ "description": "Records deleted with the collection."
36
+ }
37
+ },
38
+ "required": [
39
+ "kind",
40
+ "collection",
41
+ "records"
42
+ ],
43
+ "additionalProperties": false,
44
+ "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."
45
+ },
46
+ {
47
+ "type": "object",
48
+ "properties": {
49
+ "kind": {
50
+ "type": "string",
51
+ "const": "collection_recreated"
52
+ },
53
+ "collection": {
54
+ "type": "string",
55
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
56
+ "description": "The key of the collection."
57
+ },
58
+ "records": {
59
+ "type": "integer",
60
+ "minimum": 0,
61
+ "maximum": 9007199254740991,
62
+ "description": "Records deleted by the re-creation."
63
+ },
64
+ "from": {
65
+ "type": "string",
66
+ "enum": [
67
+ "global",
68
+ "per_robot",
69
+ "one_per_robot"
70
+ ],
71
+ "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."
72
+ },
73
+ "to": {
74
+ "type": "string",
75
+ "enum": [
76
+ "global",
77
+ "per_robot",
78
+ "one_per_robot"
79
+ ],
80
+ "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."
81
+ }
82
+ },
83
+ "required": [
84
+ "kind",
85
+ "collection",
86
+ "records",
87
+ "from",
88
+ "to"
89
+ ],
90
+ "additionalProperties": false,
91
+ "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."
92
+ },
93
+ {
94
+ "type": "object",
95
+ "properties": {
96
+ "kind": {
97
+ "type": "string",
98
+ "const": "records_created"
99
+ },
100
+ "collection": {
101
+ "type": "string",
102
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
103
+ "description": "The key of the collection."
104
+ },
105
+ "count": {
106
+ "type": "integer",
107
+ "minimum": 0,
108
+ "maximum": 9007199254740991,
109
+ "description": "Records created, one for each robot attached to the app."
110
+ }
111
+ },
112
+ "required": [
113
+ "kind",
114
+ "collection",
115
+ "count"
116
+ ],
117
+ "additionalProperties": false,
118
+ "description": "A collection with one record per robot got the records of the robots that have none."
119
+ },
120
+ {
121
+ "type": "object",
122
+ "properties": {
123
+ "kind": {
124
+ "type": "string",
125
+ "const": "field_removed"
126
+ },
127
+ "collection": {
128
+ "type": "string",
129
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
130
+ "description": "The key of the collection."
131
+ },
132
+ "field": {
133
+ "type": "string",
134
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
135
+ "description": "The key of the field."
136
+ },
137
+ "values": {
138
+ "type": "integer",
139
+ "minimum": 0,
140
+ "maximum": 9007199254740991,
141
+ "description": "Values removed from records."
142
+ }
143
+ },
144
+ "required": [
145
+ "kind",
146
+ "collection",
147
+ "field",
148
+ "values"
149
+ ],
150
+ "additionalProperties": false,
151
+ "description": "The field is gone from the document, so its values are removed from the records."
152
+ },
153
+ {
154
+ "type": "object",
155
+ "properties": {
156
+ "kind": {
157
+ "type": "string",
158
+ "const": "defaults_filled"
159
+ },
160
+ "collection": {
161
+ "type": "string",
162
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
163
+ "description": "The key of the collection."
164
+ },
165
+ "field": {
166
+ "type": "string",
167
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
168
+ "description": "The key of the field."
169
+ },
170
+ "records": {
171
+ "type": "integer",
172
+ "minimum": 0,
173
+ "maximum": 9007199254740991,
174
+ "description": "Records that receive the default."
175
+ }
176
+ },
177
+ "required": [
178
+ "kind",
179
+ "collection",
180
+ "field",
181
+ "records"
182
+ ],
183
+ "additionalProperties": false,
184
+ "description": "Records without a value get the default of a new or newly required field."
185
+ },
186
+ {
187
+ "type": "object",
188
+ "properties": {
189
+ "kind": {
190
+ "type": "string",
191
+ "const": "values_converted"
192
+ },
193
+ "collection": {
194
+ "type": "string",
195
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
196
+ "description": "The key of the collection."
197
+ },
198
+ "field": {
199
+ "type": "string",
200
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
201
+ "description": "The key of the field."
202
+ },
203
+ "converted": {
204
+ "type": "integer",
205
+ "minimum": 0,
206
+ "maximum": 9007199254740991,
207
+ "description": "Values that became a value of the new type."
208
+ },
209
+ "discarded": {
210
+ "type": "integer",
211
+ "minimum": 0,
212
+ "maximum": 9007199254740991,
213
+ "description": "Values that could not be converted and were removed."
214
+ }
215
+ },
216
+ "required": [
217
+ "kind",
218
+ "collection",
219
+ "field",
220
+ "converted",
221
+ "discarded"
222
+ ],
223
+ "additionalProperties": false,
224
+ "description": "The type of the field changed: values are converted where the conversion rules allow it and removed where they do not."
225
+ },
226
+ {
227
+ "type": "object",
228
+ "properties": {
229
+ "kind": {
230
+ "type": "string",
231
+ "const": "values_discarded"
232
+ },
233
+ "collection": {
234
+ "type": "string",
235
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
236
+ "description": "The key of the collection."
237
+ },
238
+ "field": {
239
+ "type": "string",
240
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
241
+ "description": "The key of the field."
242
+ },
243
+ "reason": {
244
+ "type": "string",
245
+ "enum": [
246
+ "reference_target_changed",
247
+ "option_removed",
248
+ "constraint"
249
+ ],
250
+ "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."
251
+ },
252
+ "values": {
253
+ "type": "integer",
254
+ "minimum": 0,
255
+ "maximum": 9007199254740991,
256
+ "description": "Values removed from records."
257
+ }
258
+ },
259
+ "required": [
260
+ "kind",
261
+ "collection",
262
+ "field",
263
+ "reason",
264
+ "values"
265
+ ],
266
+ "additionalProperties": false,
267
+ "description": "Values that the changed field no longer accepts are removed."
268
+ },
269
+ {
270
+ "type": "object",
271
+ "properties": {
272
+ "kind": {
273
+ "type": "string",
274
+ "const": "unique_discarded"
275
+ },
276
+ "collection": {
277
+ "type": "string",
278
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
279
+ "description": "The key of the collection."
280
+ },
281
+ "field": {
282
+ "type": "string",
283
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
284
+ "description": "The key of the field."
285
+ },
286
+ "total": {
287
+ "type": "integer",
288
+ "minimum": 0,
289
+ "maximum": 9007199254740991,
290
+ "description": "The exact number of values removed."
291
+ },
292
+ "records": {
293
+ "maxItems": 1000,
294
+ "type": "array",
295
+ "items": {
296
+ "type": "object",
297
+ "properties": {
298
+ "id": {
299
+ "type": "string",
300
+ "format": "uuid",
301
+ "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)$"
302
+ },
303
+ "display": {
304
+ "type": "string",
305
+ "description": "The record's display text."
306
+ },
307
+ "value": {
308
+ "description": "The value the record loses."
309
+ }
310
+ },
311
+ "required": [
312
+ "id",
313
+ "display",
314
+ "value"
315
+ ],
316
+ "additionalProperties": false
317
+ },
318
+ "description": "The records that lose their value, at most 1000; `total` is the exact number."
319
+ }
320
+ },
321
+ "required": [
322
+ "kind",
323
+ "collection",
324
+ "field",
325
+ "total",
326
+ "records"
327
+ ],
328
+ "additionalProperties": false,
329
+ "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."
330
+ },
331
+ {
332
+ "type": "object",
333
+ "properties": {
334
+ "kind": {
335
+ "type": "string",
336
+ "const": "required_left_empty"
337
+ },
338
+ "collection": {
339
+ "type": "string",
340
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
341
+ "description": "The key of the collection."
342
+ },
343
+ "field": {
344
+ "type": "string",
345
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
346
+ "description": "The key of the field."
347
+ },
348
+ "records": {
349
+ "type": "integer",
350
+ "minimum": 0,
351
+ "maximum": 9007199254740991,
352
+ "description": "Records left without a value."
353
+ }
354
+ },
355
+ "required": [
356
+ "kind",
357
+ "collection",
358
+ "field",
359
+ "records"
360
+ ],
361
+ "additionalProperties": false,
362
+ "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."
363
+ },
364
+ {
365
+ "type": "object",
366
+ "properties": {
367
+ "kind": {
368
+ "type": "string",
369
+ "const": "references_cleared"
370
+ },
371
+ "collection": {
372
+ "type": "string",
373
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
374
+ "description": "The key of the collection."
375
+ },
376
+ "field": {
377
+ "type": "string",
378
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
379
+ "description": "The key of the field."
380
+ },
381
+ "values": {
382
+ "type": "integer",
383
+ "minimum": 0,
384
+ "maximum": 9007199254740991,
385
+ "description": "References removed."
386
+ }
387
+ },
388
+ "required": [
389
+ "kind",
390
+ "collection",
391
+ "field",
392
+ "values"
393
+ ],
394
+ "additionalProperties": false,
395
+ "description": "References that pointed at records deleted by this change are cleared."
396
+ }
397
+ ],
398
+ "description": "One effect of a publish or restore on existing data. Effects that would change nothing are not listed."
399
+ },
400
+ "description": "What the publish did to existing data."
401
+ },
402
+ "issues": {
403
+ "type": "array",
404
+ "items": {
405
+ "type": "object",
406
+ "properties": {
407
+ "path": {
408
+ "type": "string",
409
+ "minLength": 1,
410
+ "description": "Where in the document, with dots between the keys: `collections.chargers.fields.location.to`."
411
+ },
412
+ "code": {
413
+ "type": "string",
414
+ "description": "A stable name for the kind of finding, for code to branch on."
415
+ },
416
+ "message": {
417
+ "type": "string",
418
+ "description": "What is wrong, in a sentence for a person."
419
+ },
420
+ "severity": {
421
+ "type": "string",
422
+ "enum": [
423
+ "error",
424
+ "warning",
425
+ "info"
426
+ ],
427
+ "description": "An error makes the document invalid and it cannot be saved or published. A warning and information leave it valid."
428
+ }
429
+ },
430
+ "required": [
431
+ "path",
432
+ "code",
433
+ "message",
434
+ "severity"
435
+ ],
436
+ "additionalProperties": false,
437
+ "description": "One finding about a collections document."
438
+ },
439
+ "description": "Warnings and information about the published document."
440
+ }
441
+ },
442
+ "required": [
443
+ "version",
444
+ "published_at",
445
+ "effects",
446
+ "issues"
447
+ ],
448
+ "additionalProperties": false,
449
+ "description": "The version that was published and the effects it had."
450
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "before": {
6
+ "type": "string",
7
+ "format": "date-time",
8
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
9
+ },
10
+ "collection": {
11
+ "anyOf": [
12
+ {
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
+ {
18
+ "type": "null"
19
+ }
20
+ ],
21
+ "description": "The collection the purge is limited to. Null for the whole app."
22
+ },
23
+ "revisions": {
24
+ "type": "integer",
25
+ "minimum": 0,
26
+ "maximum": 9007199254740991,
27
+ "description": "Revisions that would be removed."
28
+ },
29
+ "bytes": {
30
+ "type": "integer",
31
+ "minimum": 0,
32
+ "maximum": 9007199254740991,
33
+ "description": "Their size in bytes."
34
+ },
35
+ "restore_points_lost": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "integer",
39
+ "minimum": 1,
40
+ "maximum": 9007199254740991
41
+ },
42
+ "description": "Versions whose records could be put back today and could not once the history is gone, judged the way `restore_with_data` of the version list is. For the purge of one collection only the versions whose restore touches that collection are named."
43
+ },
44
+ "token": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "description": "Stands for exactly this purge: send it as `confirm` to carry it out."
48
+ }
49
+ },
50
+ "required": [
51
+ "before",
52
+ "collection",
53
+ "revisions",
54
+ "bytes",
55
+ "restore_points_lost",
56
+ "token"
57
+ ],
58
+ "additionalProperties": false,
59
+ "description": "What a purge would remove, with the token that confirms it."
60
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "before": {
6
+ "type": "string",
7
+ "format": "date-time",
8
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$",
9
+ "description": "Revisions older than this UTC time are removed. The current values of records stay. It must lie in the past (`400 validation_error`, field `before`, rule `not_in_past`), and a date older than every revision is refused as well (rule `nothing_to_purge`)."
10
+ },
11
+ "collection": {
12
+ "type": "string",
13
+ "pattern": "^[a-z][a-z0-9_]{0,62}$",
14
+ "description": "Purge only this collection. Default: the whole app."
15
+ },
16
+ "confirm": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "description": "The `token` of the preview of exactly this purge. A purge is always confirmed: without a token, or with one that no longer holds, the answer is `confirmation_required` with the current preview."
20
+ }
21
+ },
22
+ "required": [
23
+ "before"
24
+ ],
25
+ "additionalProperties": false,
26
+ "description": "Removes the history older than a date. The preview answers with a token; send it as `confirm` to purge."
27
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "revisions": {
6
+ "type": "integer",
7
+ "minimum": 0,
8
+ "maximum": 9007199254740991,
9
+ "description": "Revisions removed."
10
+ },
11
+ "bytes": {
12
+ "type": "integer",
13
+ "minimum": 0,
14
+ "maximum": 9007199254740991,
15
+ "description": "Their size in bytes."
16
+ },
17
+ "purged_at": {
18
+ "type": "string",
19
+ "format": "date-time",
20
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
21
+ }
22
+ },
23
+ "required": [
24
+ "revisions",
25
+ "bytes",
26
+ "purged_at"
27
+ ],
28
+ "additionalProperties": false,
29
+ "description": "What a purge removed."
30
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "data": {
6
+ "type": "string",
7
+ "enum": [
8
+ "true",
9
+ "false"
10
+ ],
11
+ "description": "`true` also puts records back to their state at the version's restore point. Default `false`."
12
+ },
13
+ "collections": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "description": "The touched collections to put records back in, separated by commas. Default: all of them."
17
+ }
18
+ },
19
+ "additionalProperties": false
20
+ }