@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
package/CHANGELOG.md CHANGED
@@ -9,6 +9,169 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [15.0.0] — 2026-11-06
13
+
14
+ ### Added
15
+
16
+ - **App collections: structured records an app stores in the cloud.** A
17
+ developer describes them in one document, `collectionsDocument`
18
+ (`COLLECTIONS_FORMAT_VERSION` 1): up to 50 collections of up to 100 fields,
19
+ each field a `collectionFieldType` with its own bounds, a `display` template,
20
+ and an `access` rule per collection saying who may read and write.
21
+ `collectionsDocumentIssues` judges a document and `collectionsAccessWarnings`
22
+ names what its access rules allow; `checkCollectionValue` and
23
+ `normalizeCollectionValue` judge and normalise one value the same way on
24
+ every side, and `parseCollectionFilter` and `parseCollectionSort` read the
25
+ filter and sort of a list request and report every problem with a JSON
26
+ Pointer path. Four JSON templates (`pose2d`, `point2d`, `polygon2d`,
27
+ `range1d`) are built in, and a field may carry an inline JSON Schema.
28
+ `collections:` with nothing under it (YAML null) reads as no collections,
29
+ the form of a template for a new app. A `json` value may nest arrays and
30
+ objects 32 levels deep, and a `text` pattern is at most 1,000 characters;
31
+ the cloud may also refuse a pattern as too complex.
32
+ - **Records.** A record travels as an envelope, `collectionRecord`: its system
33
+ fields (id, robot, who and when, revision), the rendered display text and the
34
+ required fields it is missing, with its own values under `values`. Writes
35
+ send `values`, an optional robot and an optional expected revision, and a
36
+ stale revision is answered `record_changed`. Lists take a filter, a search, a
37
+ sort, `expand`, a page of 1 to 500 and a cursor, and reading one record
38
+ takes the same `expand` (`collectionRecordGetQuery`); a page ends at 4 MiB
39
+ of stored values, so only a `null` cursor says a list is at its end. The
40
+ list of deleted records marks each record with `deleted_at` and
41
+ `deleted_by`. Every change keeps a revision, `collectionRevision`, which the
42
+ history route lists (in pages that end at 4 MiB as well) and the restore
43
+ route can bring back. An actor is labelled by display name; an email
44
+ address is shown only to a developer or a server key and to the person
45
+ themselves.
46
+ - **Schema lifecycle.** Saving a draft, previewing it, publishing it, listing
47
+ and restoring versions, and purging old history are separate steps. A change
48
+ that would alter or remove data is previewed first: the preview lists its
49
+ effects (ten kinds) and a token that stands for exactly that list, and the
50
+ confirming request sends the token back as `confirm`; the preview also
51
+ carries `source_sha256`, the hash of the draft it is for, which a publish can
52
+ send back so that a draft saved again in between is not published unseen,
53
+ also when there are no effects and so no token. A version can be restored
54
+ together with its data for 90 days, and a version that a restore published
55
+ says whether it put records back (`with_data`) and how many
56
+ (`reverted_totals`).
57
+ - **Import and export.** An import is all or nothing and takes two requests, a
58
+ preview that lists at most 1,000 errors with row, column, value and reason,
59
+ and a confirmation with the preview's token; without a token the import
60
+ route answers the preview, and a token that no longer holds is `409
61
+ confirmation_required`. Modes are `upsert` and `mirror`, and a mirror's
62
+ `scope` names a filter or a robot. The export query takes the filter, search
63
+ and sort of a record list.
64
+ - **Realtime.** `collection_subscribe` and `collection_unsubscribe` open and
65
+ close a subscription on the client socket, `collection_event` carries
66
+ `created`, `updated`, `deleted`, `removed` and `entered` with the whole
67
+ record, and `collection_subscribe_error` and `collections_schema_published`
68
+ tell a client its subscription failed or its definitions changed. The cloud
69
+ answers an accepted subscription with `collection_subscribed`
70
+ (`collectionSubscribed`, carrying the `request_id`) once it is registered,
71
+ also after a reconnect and a new subscribe, and every change from that frame
72
+ on is delivered as an event: subscribe, wait for it, then list. There is no
73
+ first snapshot. A developer connection names the app in `app_id`; a socket
74
+ holds 50 subscriptions at most, and one that falls too far behind is closed
75
+ with 1013.
76
+ - **Limits.** `COLLECTION_LIMITS` names every bound in one place: record size
77
+ (1 MiB), text lengths, select options, filter depth and conditions, page
78
+ sizes, import size (10 MB, 50,000 rows), pattern length, `json` nesting
79
+ depth, the longest text an import error repeats and the write rates (600 a
80
+ minute for an app, 120 for one acting user or key).
81
+ - **Routes and codes.** A new route section, App collections, with the
82
+ developer routes under `/api/apps/:id/collections` and the same records,
83
+ import and export for app users and server keys under
84
+ `/api/client/collections`; only the two history purge routes need the Owner
85
+ tier. New error codes `record_referenced`, `record_changed`,
86
+ `collection_not_found`, `collection_removed`, `reference_invalid`,
87
+ `required_missing` and `robot_not_attached`, with their details, and the
88
+ audit actions listed as `COLLECTION_AUDIT_ACTIONS`. `confirmation_required`,
89
+ which organization roles have used since 14.0.0, now also answers a
90
+ publish, restore, purge or import that would change data. Its `details` is
91
+ `{ preview }` here (`confirmationRequiredDetails`, the token in
92
+ `details.preview.token`) and the rename preview itself for a role rename
93
+ (the token in `details.confirm`), so a client that handles both looks for
94
+ `details.preview` first.
95
+ - **Plan limits for collections.** `planLimitKey` gains `collection_records`
96
+ and `collection_bytes`, counted per organization across its apps over
97
+ current records only: 25,000 records and 1 GB on Basic, 250,000 and 10 GB on
98
+ Plus, 1,000,000 and 50 GB on Pro, by contract on Enterprise. No add-on
99
+ raises them. `GET /api/org/quotas` carries both as limits (`orgQuotas`,
100
+ `null` when by contract) and as usage, with `collection_history_bytes`
101
+ beside them for information (`orgQuotaUsageCounts`); a write or an import
102
+ that adds data past a limit is `409 plan_limit` naming the key.
103
+ - **Collection rights of a role.** `roleCollectionRights` says per collection
104
+ what a role may do: read, create, and update and delete on every record, on
105
+ the role's own only (`own`), or not at all. The effective-rights answer
106
+ (`GET /api/apps/:id/effective-rights`) lists one row per collection of the
107
+ published schema in `collections`, an empty list without one.
108
+
109
+ ### Changed
110
+
111
+ - **A role key can be written in an app's collections schema.** `referencePlace`
112
+ gains the kind `collection_schema`: the `access` of a collection in the
113
+ published schema or the draft of an app, with the app's id in `app_id`, the
114
+ place in `path` (such as `collections.notes.access.update.own[1]`), `document`
115
+ and, for the published schema, the `new_version` a rename with
116
+ `update_references` would give it. It appears in the role list's `dangling`
117
+ places and in the rename preview. The version such a rename appends is
118
+ audited as `collection_schema.published` with `role_rename` in its details.
119
+ **Breaking (major):** the enum of `kind`
120
+ widens, so an exhaustive `switch` over it needs the new case and a validator
121
+ built from the old artifacts refuses the new places.
122
+ - **A role rename can answer `429 rate_limited`.** `PATCH /api/org/roles/:key`
123
+ lists `rate_limited` among its errors: a rename with `update_references` that
124
+ has to rewrite the schema of an app whose collections are busy waits up to
125
+ two seconds, then answers `429` with `retry_after_ms` and changes nothing.
126
+ A schema text it cannot rewrite without losing it (an access rule that is an
127
+ alias, say) refuses the rename with `400 validation_error` naming
128
+ `update_references`, and changes nothing.
129
+ - **Deletion summaries count collections.** `appDeletionSummary` gains
130
+ `collection_count` and `record_count`, and `robotDeletionSummary` gains
131
+ `collection_records`, the records that go with the robot per app. All three
132
+ are required fields of responses the server sends, like the other counts.
133
+ A consumer that builds these objects itself (a test double, say) adds them.
134
+ - **Quota and effective-rights answers have new required fields.**
135
+ `orgQuotas` gains `collection_records` and `collection_bytes`, and
136
+ `effectiveRightsResponse` gains `collections`. A consumer that builds these
137
+ answers itself adds them, as above; one that only reads them is unaffected.
138
+ - **Breaking (major):** `planLimits` requires `collection_records` and
139
+ `collection_bytes`, like its other keys. That is the `limits` of `orgPlan`
140
+ (`GET /api/org/plan`), of every plan catalogue entry and of
141
+ `planChangeDecisionStatusResponse`, and the constant `PLANS`. A consumer
142
+ that builds plan limits itself, or keeps a `Record<PlanLimitKey, ...>`,
143
+ adds both keys, and a validator built from the old artifacts refuses the new
144
+ answers. A consumer that embeds `orgPlan` or `planLimits` in a schema of its
145
+ own (an admin or operator API, say) inherits the two required keys: its
146
+ parsed type changes, every fixture or stored sample of a plan needs
147
+ `collection_records` and `collection_bytes` (`null` is by contract), and a
148
+ plan written before this release, without them, no longer parses. A list of
149
+ limit keys written out by hand (an enum, or a table keyed by limit) does not
150
+ widen with `planLimitKey` and gets the two keys added by hand. The enums that
151
+ do follow it widen as well: `addonCatalogueEntry.raises`,
152
+ `assetPlanLimitDetails.limit` and `planLimitDetails.limit` accept the two new
153
+ keys. The last one is the `details.limit` of `409 plan_limit` for a
154
+ collection write; no add-on raises the keys and an asset refusal never names
155
+ them. An exhaustive `switch` over any of the three needs the two cases.
156
+ `planOverrides` and the `overrides` of an admin plan change accept the two
157
+ keys too, and a validator built from the older artifacts refuses a request
158
+ that names them.
159
+
160
+ ### Removed
161
+
162
+ - **Breaking (major):** The `robot_details` built-in. `robotDetailsDoc`,
163
+ `putRobotDetailsRequest` and `putRobotDetailsResponse` (with their types and
164
+ the three JSON Schema artifacts), the route `PUT /api/robots/:id/details`,
165
+ and the reserved slug are gone: `RESERVED_SLUGS` is now `bridge_state`,
166
+ `history`, `assets` and `job_history`, so `robot_details` is an ordinary slug
167
+ that a configuration may use. The descriptions of `datapointDescriptor`,
168
+ `datapointListResponse` and the configuration sections name `bridge_state`
169
+ as the only built-in datapoint. Nothing was deprecated first. To move over,
170
+ keep what a robot's details held in a collection with one record per robot
171
+ (`binding: one_per_robot`) in the app's collections document, and read and
172
+ write it with the collection routes; delete the calls of the removed route
173
+ and the code that parsed the removed schemas.
174
+
12
175
  ## [14.0.0] — 2026-11-05
13
176
 
14
177
  Per-app roles are replaced by organization roles. What follows is one major