@fleetless/sdk 4.5.0 → 4.6.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.
- package/CHANGELOG.md +23 -0
- package/README.md +10 -0
- package/dist/index.cjs +2410 -553
- package/dist/index.d.cts +24 -5
- package/dist/index.d.ts +24 -5
- package/dist/index.js +2410 -553
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,29 @@ All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; th
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [4.6.1] — 2026-11-03
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`auth.signInMethods()` checks `twoFactor` instead of passing the wire value through.** A cloud that predates the policy field sends none, and a value outside `off | optional | required` was handed on unchecked under a type that promised one of the three. Both now come back as `twoFactor: null`, and the type is `'off' | 'optional' | 'required' | null`; the SDK never substitutes a default. Treat `null` as a failed policy read — offer no two-factor action and let the person retry, never read it as `'off'`; the cloud still enforces its own policy at sign-in. `password` and `emailCode` are mapped as before, so a login screen keeps working against an older cloud, and `listProviders()` is unchanged. Code that assigns `twoFactor` to the three-value union now has to handle `null`.
|
|
12
|
+
|
|
13
|
+
### Also in 4.6.0
|
|
14
|
+
|
|
15
|
+
4.6.0 moved the bundled `@fleetless/contracts` from 6.2.0 to 12.0.0 and named only `twoFactor`. For code using this SDK, the jump also brought:
|
|
16
|
+
|
|
17
|
+
- **`FleetlessErrorCode` gains eight codes through `ErrorCode`:** `operator_verified_stopped`, `job_state_conflict`, `billing_unavailable`, `payment_provider_unavailable`, `history_migrating`, `billing_documents_unavailable`, `support_read_only` and `support_forbidden`. Only `operator_verified_stopped` reaches an app through this SDK: it is the `error.code` of a final `lost` job that an org Owner released after verifying that the robot is physically stopped. The other seven refuse org billing, slug renames, held-job recovery and console support sessions; an app user's session or a server key does not receive them. An exhaustive `switch` over `ErrorCode` gains the cases.
|
|
18
|
+
- **`ClientRobotListItem.bridge_state`**, as `robots.list()` resolves it, gains an optional, nullable `health_reason`; its one value, `'job_query_unanswered'`, means the cloud saw the bridge leave a job query unanswered. Older clouds omit it.
|
|
19
|
+
- **`job_lost` is defined more precisely:** a final `lost` job whose terminal goal result could not be recovered within the bounded wait, or a loss with no more specific cause; `error.message` says which. `action_server_lost` and `job_unknown_to_bridge` keep their meaning. No code or shape changed.
|
|
20
|
+
- Doc comments name the MCP actions `robots.list` and `robots.describe` instead of the former tool names. No shape changed.
|
|
21
|
+
|
|
22
|
+
Nothing else this SDK re-exports or parses at runtime changed.
|
|
23
|
+
|
|
24
|
+
## [4.6.0] — 2026-11-03
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `auth.signInMethods()` now returns required `twoFactor: 'off' | 'optional' | 'required'` beside `password` and `emailCode`. It reads the app policy from the public providers response; `listProviders()` still returns provider buttons only. Built against `@fleetless/contracts` 12.0.0.
|
|
29
|
+
|
|
7
30
|
## [4.5.0] — 2026-10-09
|
|
8
31
|
|
|
9
32
|
### Changed
|
package/README.md
CHANGED
|
@@ -91,6 +91,16 @@ Node 22 and newer, or server-side with a server key instead of a user session.
|
|
|
91
91
|
Node 20 does REST fine but ships no global `WebSocket`, so realtime there needs
|
|
92
92
|
one passed in through the `WebSocket` option.
|
|
93
93
|
|
|
94
|
+
Before drawing your app's sign-in screen, read its public policy:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const { password, emailCode, twoFactor } = await client.auth.signInMethods()
|
|
98
|
+
// twoFactor is 'off', 'optional' or 'required'; it is app policy, not enrollment.
|
|
99
|
+
// It is null when the cloud sends no policy the SDK recognises (an older cloud):
|
|
100
|
+
// treat that as a failed read and offer no two-factor action, never as 'off'.
|
|
101
|
+
// listProviders() separately returns only federated sign-in buttons.
|
|
102
|
+
```
|
|
103
|
+
|
|
94
104
|
## 📚 Documentation
|
|
95
105
|
|
|
96
106
|
Everything past this point lives at **[docs.fleetless.dev](https://docs.fleetless.dev)**.
|