@bikefinder/sdk 0.36.0 → 0.37.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.
@@ -341,6 +341,12 @@ var account = z5.object({
341
341
  preferences: accountPreferences,
342
342
  readIssues: z5.array(readIssue)
343
343
  });
344
+ var accountChange = z5.literal("account.changed");
345
+ var accountWatchSnapshot = z5.object({
346
+ account,
347
+ lifetime: z5.string().regex(/^[a-f0-9]{64}$/),
348
+ credentialExpiresAt: z5.int().positive()
349
+ });
344
350
  var language = z5.string().min(2).max(64).refine((value) => {
345
351
  try {
346
352
  return Intl.getCanonicalLocales(value).length === 1;
@@ -365,6 +371,8 @@ var accountContract = {
365
371
  profile: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(directoryProfile),
366
372
  get: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(account),
367
373
  watch: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(eventIterator(account)),
374
+ changes: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(eventIterator(accountChange)),
375
+ watchSnapshot: oc3.meta({ operation: "read" }).errors(directoryErrors).input(z5.void()).output(accountWatchSnapshot),
368
376
  initialize: oc3.errors(directoryErrors).input(z5.void()).output(z5.void()),
369
377
  preferences: {
370
378
  update: oc3.errors(directoryErrors).input(accountPreferencePatch).output(z5.void())
@@ -921,6 +929,8 @@ export {
921
929
  accountPreferences,
922
930
  defaultAccountPreferences,
923
931
  account,
932
+ accountChange,
933
+ accountWatchSnapshot,
924
934
  accountPreferencePatch,
925
935
  photoInput,
926
936
  photoPageInput,