@bikefinder/sdk 0.35.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 +5 -1
- package/dist/{chunk-ZSNSOMTF.js → chunk-T3ARGNHA.js} +11 -6
- package/dist/index.d.ts +1964 -24
- package/dist/index.js +112 -4
- package/dist/schemas.d.ts +1964 -24
- package/dist/schemas.js +1 -1
- package/package.json +1 -1
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.
|
|
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())
|
|
@@ -544,12 +552,7 @@ var trackerChangeContract = {
|
|
|
544
552
|
// ../customer-contracts/src/discovery.ts
|
|
545
553
|
import { oc as oc8 } from "@orpc/contract";
|
|
546
554
|
import { z as z10 } from "zod";
|
|
547
|
-
var trackerLookupInput = z10.
|
|
548
|
-
z10.strictObject({ deviceId: documentId }),
|
|
549
|
-
z10.strictObject({
|
|
550
|
-
serialNumber: z10.string().min(1).max(128).regex(/^[^\p{Cc}]+$/u).refine((value) => value.trim().length > 0)
|
|
551
|
-
})
|
|
552
|
-
]);
|
|
555
|
+
var trackerLookupInput = z10.strictObject({ deviceId: documentId });
|
|
553
556
|
var trackerAdmission = z10.object({
|
|
554
557
|
id: documentId,
|
|
555
558
|
isMember: z10.boolean(),
|
|
@@ -926,6 +929,8 @@ export {
|
|
|
926
929
|
accountPreferences,
|
|
927
930
|
defaultAccountPreferences,
|
|
928
931
|
account,
|
|
932
|
+
accountChange,
|
|
933
|
+
accountWatchSnapshot,
|
|
929
934
|
accountPreferencePatch,
|
|
930
935
|
photoInput,
|
|
931
936
|
photoPageInput,
|