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