@bikefinder/sdk 0.36.0 → 0.38.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
@@ -13,7 +13,7 @@ for native realtime tickets. Other clients default to the platform WebSocket.
13
13
  The SDK still obtains a fresh ticket each time it connects.
14
14
 
15
15
  Version 0.31 adds optional `firmwareVersion: string | null` to each
16
- `battery.inventory` member. New tracker firmware captures it during discovery;
16
+ `battery.snapshot` member. New tracker firmware captures it during discovery;
17
17
  `null` means the target version is hidden by a legacy relay. Historical members
18
18
  can omit it. Deploy compatible backend readers before installing the new firmware.
19
19
 
@@ -121,6 +121,10 @@ Runtime schemas are available from `@bikefinder/sdk/schemas`.
121
121
  Version 0.27 makes responses tolerant of added fields while preserving validation
122
122
  of known fields and strict request inputs. Reading summaries use
123
123
  `state: 'available' | 'unavailable'`; account preferences contain effective values.
124
+
125
+ `account.watch()` subscribes before reading the initial account. Change notices
126
+ prompt authenticated reads of the current account. The watch ends if that account
127
+ is deleted or recreated.
124
128
  Recoverable presentation-data problems appear in `readIssues`. Declared error
125
129
  data includes a trace ID and typed `recovery` instructions. Keep the original
126
130
  request ID when following `retry_same_request` or `read_operation` guidance.
@@ -258,6 +258,7 @@ var trackerMember = z4.object({
258
258
  });
259
259
  var trackerSummaryFields = {
260
260
  ...documentFields,
261
+ lastSeenAt: z4.iso.datetime().nullable(),
261
262
  generation: z4.int().positive().nullable(),
262
263
  bike: trackerBike,
263
264
  battery: z4.discriminatedUnion("state", [
@@ -341,6 +342,12 @@ var account = z5.object({
341
342
  preferences: accountPreferences,
342
343
  readIssues: z5.array(readIssue)
343
344
  });
345
+ var accountChange = z5.literal("account.changed");
346
+ var accountWatchSnapshot = z5.object({
347
+ account,
348
+ lifetime: z5.string().regex(/^[a-f0-9]{64}$/),
349
+ credentialExpiresAt: z5.int().positive()
350
+ });
344
351
  var language = z5.string().min(2).max(64).refine((value) => {
345
352
  try {
346
353
  return Intl.getCanonicalLocales(value).length === 1;
@@ -365,6 +372,8 @@ var accountContract = {
365
372
  profile: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(directoryProfile),
366
373
  get: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(account),
367
374
  watch: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(eventIterator(account)),
375
+ changes: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(eventIterator(accountChange)),
376
+ watchSnapshot: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(accountWatchSnapshot),
368
377
  initialize: oc3.errors(directoryErrors).input(z5.void()).output(z5.void()),
369
378
  preferences: {
370
379
  update: oc3.errors(directoryErrors).input(accountPreferencePatch).output(z5.void())
@@ -921,6 +930,8 @@ export {
921
930
  accountPreferences,
922
931
  defaultAccountPreferences,
923
932
  account,
933
+ accountChange,
934
+ accountWatchSnapshot,
924
935
  accountPreferencePatch,
925
936
  photoInput,
926
937
  photoPageInput,