@bikefinder/sdk 0.29.0 → 0.30.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,5 +1,10 @@
1
1
  # @bikefinder/sdk
2
2
 
3
+ Version 0.30 adds `trackers.getDetails` and `trackers.watchDetails`. They return
4
+ the authorized account ID and active-member count without the roster. Deploy
5
+ these API routes before switching clients. Existing `get` and `watch` retain
6
+ their previous response shape for installed clients.
7
+
3
8
  Version 0.29.0 returns the canonical bike, including its new revision, from
4
9
  `client.api.trackers.bike.edit`. Bind the edit to the tracker resource with `trackerCreatedAt: tracker.createdAt`. Supply `expected` values for exactly the fields in `changes`;
5
10
  the API compares them atomically and preserves unrelated edits. Repeating an
@@ -27,9 +32,9 @@ const client = createBikeFinderClient({
27
32
  onReconnect: () => restartActiveViews(),
28
33
  });
29
34
 
30
- const tracker = await client.api.trackers.get({ deviceId });
35
+ const tracker = await client.api.trackers.getDetails({ deviceId });
31
36
  const controller = new AbortController();
32
- const changes = await client.api.trackers.watch(
37
+ const changes = await client.api.trackers.watchDetails(
33
38
  { deviceId },
34
39
  { signal: controller.signal },
35
40
  );
@@ -296,6 +296,12 @@ var tracker = z4.object({
296
296
  factoryResetReports: z4.boolean()
297
297
  })
298
298
  });
299
+ var customerTrackerDetails = tracker.omit({ members: true }).extend({
300
+ membership: z4.object({
301
+ accountId: z4.string(),
302
+ activeMemberCount: z4.int().nonnegative()
303
+ })
304
+ });
299
305
 
300
306
  // ../common-contracts/src/accounts.ts
301
307
  import { oc as oc3, eventIterator } from "@orpc/contract";
@@ -805,6 +811,8 @@ var trackerContract = {
805
811
  claim: oc15.errors(apiErrors).input(trackerClaimInput).output(z18.void()),
806
812
  list: oc15.meta({ operation: "read" }).errors(apiErrors).input(pageInput).output(trackerPage),
807
813
  watchPage: oc15.meta({ operation: "read" }).errors(apiErrors).input(pageInput).output(eventIterator3(trackerPage)),
814
+ getDetails: procedure.meta({ operation: "read" }).output(customerTrackerDetails),
815
+ watchDetails: procedure.meta({ operation: "read" }).output(eventIterator3(customerTrackerDetails)),
808
816
  get: procedure.meta({ operation: "read" }).output(tracker),
809
817
  watch: procedure.meta({ operation: "read" }).output(eventIterator3(tracker))
810
818
  };
@@ -843,6 +851,7 @@ export {
843
851
  trackerSummary,
844
852
  trackerPage,
845
853
  tracker,
854
+ customerTrackerDetails,
846
855
  directoryProfile,
847
856
  accountPreferences,
848
857
  defaultAccountPreferences,