@fleetless/sdk 4.6.1 → 5.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.
- package/CHANGELOG.md +28 -0
- package/dist/index.cjs +6452 -4875
- package/dist/index.d.cts +49 -29
- package/dist/index.d.ts +49 -29
- package/dist/index.js +6452 -4875
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; th
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [5.0.0] — 2026-11-06
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Breaking: `ClientIdentity.role_id` is replaced by `role: { key, name } | null`.** It is what `auth.me()` resolves and what the realtime channel holds after authentication. `key` is the organization role's key, the one `fleetless.yaml` and the organization's role list write; `name` is its display name. `role` is `null` where there is no role to name: for a developer, for a server key, and for an app user whose role has since been deleted, who can still sign in and reaches nothing. Code that read `role_id` reads `role?.key` now.
|
|
12
|
+
- **Breaking: the datasheet's capabilities say `job_history` where they said `action_history`,** without an alias. `robots.describe()` resolves `capabilities: { job_history, assets }`; `job_history` is what `jobs.history()` needs, and a `capability_required` refusal names it. The doc comments say which roles hold a capability: the robot's `access` section, otherwise the organization's defaults, less what the app locks.
|
|
13
|
+
- **Breaking: `FleetlessErrorCode` loses `role_name_taken`, `role_in_use` and `last_role` and gains `role_cycle`, `role_key_taken` and `confirmation_required`** through `ErrorCode`. The six belong to the role management of the console; only `capability_required` reaches an app through this SDK. An exhaustive `switch` over `ErrorCode` changes its cases.
|
|
14
|
+
- Built against `@fleetless/contracts` 14.0.0.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **A short outage on the cloud's side no longer ends the realtime channel.** An `auth_error` of `internal_error` (the cloud could not check the credential) used to end the channel for good and was reported to every subscription through `onError`. It is now retried with backoff like a dropped connection, as is a close with code 1011 (the cloud could not re-check the connection's rights and asks for a new authentication). The wait grows from one failed attempt to the next and a retry never comes at once.
|
|
19
|
+
- **A connection the cloud ends with close code 4003 stops and says so.** The code means the credential behind an authenticated connection is no longer valid: the account was removed or blocked, the key was rotated, the session was ended. The channel used to reconnect with that credential first and end only when the cloud refused it. It now reports `token_revoked` to the subscriptions' `onError` at once and does not reconnect; the next `subscribe` or command opens a new connection with whatever credential the client holds by then. A command already sent when the connection ends fails with `command_outcome_unknown`, not `token_revoked`: its reply is lost with the connection and it may or may not have run, so read the job by slug (for example `actions.subscribe`) rather than retrying. A command still waiting for the connection to authenticate was never sent and fails with the authentication error itself.
|
|
20
|
+
|
|
21
|
+
### Also from contracts 12.0.0 to 14.0.0
|
|
22
|
+
|
|
23
|
+
4.6.1 was built against `@fleetless/contracts` 12.0.0; the jump also brought the changes of the 12.1 and 13.x releases. For code using this SDK:
|
|
24
|
+
|
|
25
|
+
- **`AssetSyncStatus`**, as `assets.syncStatus()` resolves it, gains an optional `file_limit` on a `refused` failure: the per-file limit that was exceeded and the file's size where known. It is exclusive with the store-full `details`; the failure kinds are unchanged.
|
|
26
|
+
- **`FleetlessErrorCode` gains `legal_offer_unavailable`** through `ErrorCode`. It refuses an organization's Terms offer in the console; an app user's session or a server key does not receive it.
|
|
27
|
+
- Doc comments of the datapoint, camera and invoke responses say what a role "may read" or "may use" where they said it "grants". No shape changed.
|
|
28
|
+
|
|
29
|
+
Nothing else this SDK re-exports or parses at runtime changed.
|
|
30
|
+
|
|
31
|
+
### Compatibility
|
|
32
|
+
|
|
33
|
+
- Against a cloud older than this release, `identity.role` and `capabilities.job_history` read `undefined`, and the old `role_id` and `action_history` are no longer typed.
|
|
34
|
+
|
|
7
35
|
## [4.6.1] — 2026-11-03
|
|
8
36
|
|
|
9
37
|
### Fixed
|