@bikefinder/staff-sdk 0.4.0 → 0.9.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/README.md CHANGED
@@ -1,24 +1,25 @@
1
1
  # @bikefinder/staff-sdk
2
2
 
3
- Typed staff HTTP and WebSocket client for the [API](../../README.md). Version 0.4
3
+ Typed staff HTTP and WebSocket client for the [API](../../README.md). Version 0.5
4
4
  uses native oRPC contracts, Zod validation and async iterators. Customer apps use
5
5
  [@bikefinder/sdk](../sdk/README.md). MCP invokes application workflows directly.
6
6
 
7
7
  ```ts
8
- import { createBikeFinderStaffClient, ORPCError } from '@bikefinder/staff-sdk';
8
+ import { createBikeFinderStaffClient, ORPCError } from "@bikefinder/staff-sdk";
9
9
 
10
10
  const client = createBikeFinderStaffClient({
11
- baseUrl: 'https://api.prod.bikefinder.com',
11
+ baseUrl: "https://api.prod.bikefinder.com",
12
12
  accessToken: () => session.getAccessToken(),
13
13
  onReconnect: () => restartActiveViews(),
14
14
  });
15
- const diagnostics = await client.api.trackers.diagnostics.get({ id: trackerId });
15
+ const diagnostics = await client.api.gcp.diagnostics.get({ deviceId });
16
16
  const controller = new AbortController();
17
- for await (const reading of await client.api.trackers.observations.events(
18
- { id: inventoryId },
17
+ for await (const reading of await client.api.aws.observations.events(
18
+ { serialNumber },
19
19
  { signal: controller.signal },
20
20
  )) {
21
- if (reading.type === 'battery.displayedLevel') updateBattery(reading.value.percent);
21
+ if (reading.type === "battery.displayedLevel")
22
+ updateBattery(reading.value.percent);
22
23
  }
23
24
  controller.abort();
24
25
  client.dispose();
@@ -35,6 +36,8 @@ reconnects end existing subscriptions: explicitly resubscribe in `onReconnect`.
35
36
  Events are not replayed, and writes are never automatically retried. Keep a
36
37
  command's original `idempotencyKey` when retrying an uncertain submission.
37
38
  `dispose()` cancels pending work and closes the shared socket.
39
+ Disposal is idempotent and emits one `closed` state; its intentional cancellation
40
+ does not call `onConnectionError`.
38
41
 
39
42
  Overview and diagnostics are separate typed resources. Observations retain their
40
43
  original `id`, measurement and receipt timestamps. Current selections use
@@ -47,7 +50,26 @@ exported from `@bikefinder/staff-sdk/schemas`; no schema bootstrap request is
47
50
  required. Staff tools must still obtain the tracker's command catalog to check
48
51
  its authoritative identity and availability before enabling writes.
49
52
 
50
- Photo and support-attachment procedures return typed, short-lived download
53
+ Photo procedures return typed, short-lived download
51
54
  references with storage URLs. Download file bytes over HTTP. WebSockets carry
52
55
  metadata and events. Customer photo uploads use the customer SDK's staged-upload
53
56
  helper; staff battery firmware uses its typed file procedure.
57
+
58
+ Version 0.9 adds `api.firmware.list`, `get`, `publish` and `enable` for the staff
59
+ release catalog. `publish` takes the explicit release metadata plus a browser or
60
+ Node `File` with `application/octet-stream` content type; native oRPC sends it as
61
+ multipart HTTP. `enable` approves an exact LTE descriptor revision for subsequent
62
+ tracker update selection. Neither operation starts a tracker update. See the
63
+ [firmware release workflow](../../../../docs/firmware.md).
64
+
65
+ Version 0.8 accepts added response fields while validating known fields and
66
+ keeping request inputs strict. Tracker reading summaries use explicit availability
67
+ states, and presentation-data problems appear in `readIssues`. Declared error
68
+ data includes typed recovery instructions and references to existing operation
69
+ journals. Preserve the original operation identifier when recovering uncertain
70
+ writes. Realtime frames are limited to 32 KiB after encoding; use smaller
71
+ selections/pages or HTTP for larger resources.
72
+
73
+ Version 0.8.2 uses the canonical API contracts directly for HTTP and WebSocket
74
+ responses. Deploy the API's availability-state contract before updating Hub;
75
+ retired nullable response formats are rejected rather than translated.