@bikefinder/sdk 0.28.0 → 0.29.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,6 +1,13 @@
1
1
  # @bikefinder/sdk
2
2
 
3
- Version 0.28.0 adds live photo metadata pages through
3
+ Version 0.29.0 returns the canonical bike, including its new revision, from
4
+ `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
+ the API compares them atomically and preserves unrelated edits. Repeating an
6
+ already-applied edit succeeds. Use the result directly; saving needs no extra tracker reads. Deploy the matching API before updating consumers.
7
+ The public `@bikefinder/sdk/schemas` exports `errorData` and `errorRecovery` for
8
+ validating declared recovery instructions.
9
+
10
+ Version 0.28 adds live photo metadata pages through
4
11
  `client.api.trackers.photos.watchPage`. Deploy this API endpoint before updating
5
12
  consumers that subscribe to photos. The SDK uses the canonical API contracts directly for HTTP and WebSocket
6
13
  responses. Deploy the API's availability-state contract before updating consumers;
@@ -487,9 +487,15 @@ var bikeChanges = z9.strictObject({
487
487
  );
488
488
  var bikeEditInput = z9.strictObject({
489
489
  deviceId: documentId,
490
- expectedRevision: z9.string().regex(/^[a-f0-9]{64}$/),
490
+ trackerCreatedAt: z9.iso.datetime(),
491
+ expected: trackerBike.omit({ revision: true }).partial().strict(),
491
492
  changes: bikeChanges
492
- });
493
+ }).refine(({ expected, changes }) => {
494
+ const fields2 = Object.entries(changes).filter(([, value]) => value !== void 0).map(([key]) => key);
495
+ return fields2.length === Object.keys(expected).length && fields2.every(
496
+ (key) => expected[key] !== void 0
497
+ );
498
+ }, "Supply reviewed values for exactly the changed bike fields.");
493
499
  var membershipName = z9.string().min(1).max(100).regex(/^[^\p{Cc}]+$/u).refine((value) => value.trim().length > 0, "Supply a display name.");
494
500
  var trackerClaimInput = z9.strictObject({
495
501
  deviceId: documentId,
@@ -507,7 +513,7 @@ var trackerMovementAlertsInput = z9.strictObject({
507
513
  enabled: z9.boolean()
508
514
  });
509
515
  var trackerChangeContract = {
510
- bike: { edit: oc7.errors(apiErrors).input(bikeEditInput).output(z9.void()) },
516
+ bike: { edit: oc7.errors(apiErrors).input(bikeEditInput).output(trackerBike) },
511
517
  movementAlerts: {
512
518
  set: oc7.errors(apiErrors).input(trackerMovementAlertsInput).output(z9.void())
513
519
  },
@@ -813,6 +819,8 @@ var customerContract = {
813
819
  export {
814
820
  apiContractVersion,
815
821
  subscriptionInput,
822
+ errorRecovery,
823
+ errorData,
816
824
  pushToken,
817
825
  pushRegistrationInput,
818
826
  pushRemovalInput,
package/dist/index.d.ts CHANGED
@@ -30252,7 +30252,17 @@ export declare const bikeChanges: z.ZodObject<{
30252
30252
  }, z.core.$strict>;
30253
30253
  export declare const bikeEditInput: z.ZodObject<{
30254
30254
  deviceId: z.ZodString;
30255
- expectedRevision: z.ZodString;
30255
+ trackerCreatedAt: z.ZodISODateTime;
30256
+ expected: z.ZodObject<{
30257
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30258
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30259
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30260
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30261
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30262
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30263
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30264
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30265
+ }, z.core.$strict>;
30256
30266
  changes: z.ZodObject<{
30257
30267
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30258
30268
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -30296,7 +30306,17 @@ export declare const trackerChangeContract: {
30296
30306
  bike: {
30297
30307
  edit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
30298
30308
  deviceId: z.ZodString;
30299
- expectedRevision: z.ZodString;
30309
+ trackerCreatedAt: z.ZodISODateTime;
30310
+ expected: z.ZodObject<{
30311
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30312
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30313
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30314
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30315
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30316
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30317
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30318
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30319
+ }, z.core.$strict>;
30300
30320
  changes: z.ZodObject<{
30301
30321
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30302
30322
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -30317,7 +30337,17 @@ export declare const trackerChangeContract: {
30317
30337
  USD: "USD";
30318
30338
  }>>>;
30319
30339
  }, z.core.$strict>;
30320
- }, z.core.$strict>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
30340
+ }, z.core.$strict>, z.ZodObject<{
30341
+ revision: z.ZodString;
30342
+ name: z.ZodNullable<z.ZodString>;
30343
+ brand: z.ZodNullable<z.ZodString>;
30344
+ type: z.ZodNullable<z.ZodString>;
30345
+ model: z.ZodNullable<z.ZodString>;
30346
+ frameNumber: z.ZodNullable<z.ZodString>;
30347
+ url: z.ZodNullable<z.ZodString>;
30348
+ marketPrice: z.ZodNullable<z.ZodString>;
30349
+ marketPriceCurrency: z.ZodNullable<z.ZodString>;
30350
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
30321
30351
  readonly invalid: {
30322
30352
  readonly status: 400;
30323
30353
  readonly data: z.ZodType<{
@@ -54967,7 +54997,17 @@ declare const trackerContract: {
54967
54997
  bike: {
54968
54998
  edit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
54969
54999
  deviceId: z.ZodString;
54970
- expectedRevision: z.ZodString;
55000
+ trackerCreatedAt: z.ZodISODateTime;
55001
+ expected: z.ZodObject<{
55002
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55003
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55004
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55005
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55006
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55007
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55008
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55009
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55010
+ }, z.core.$strict>;
54971
55011
  changes: z.ZodObject<{
54972
55012
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54973
55013
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -54988,7 +55028,17 @@ declare const trackerContract: {
54988
55028
  USD: "USD";
54989
55029
  }>>>;
54990
55030
  }, z.core.$strict>;
54991
- }, z.core.$strict>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
55031
+ }, z.core.$strict>, z.ZodObject<{
55032
+ revision: z.ZodString;
55033
+ name: z.ZodNullable<z.ZodString>;
55034
+ brand: z.ZodNullable<z.ZodString>;
55035
+ type: z.ZodNullable<z.ZodString>;
55036
+ model: z.ZodNullable<z.ZodString>;
55037
+ frameNumber: z.ZodNullable<z.ZodString>;
55038
+ url: z.ZodNullable<z.ZodString>;
55039
+ marketPrice: z.ZodNullable<z.ZodString>;
55040
+ marketPriceCurrency: z.ZodNullable<z.ZodString>;
55041
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
54992
55042
  readonly invalid: {
54993
55043
  readonly status: 400;
54994
55044
  readonly data: z.ZodType<{
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ import {
76
76
  trackerMemberInput,
77
77
  trackerMovementAlertsInput,
78
78
  trackerPhotoContract
79
- } from "./chunk-2FP3HQAZ.js";
79
+ } from "./chunk-UVAQKPXY.js";
80
80
 
81
81
  // ../../src/client/client.ts
82
82
  import { createORPCClient, DynamicLink } from "@orpc/client";
package/dist/schemas.d.ts CHANGED
@@ -29847,6 +29847,7 @@ declare const recoverySchema: z.ZodDiscriminatedUnion<[
29847
29847
  }, z.core.$strip>
29848
29848
  ], "action">;
29849
29849
  export type ErrorRecovery = z.infer<typeof recoverySchema>;
29850
+ export declare const errorRecovery: z.ZodType<ErrorRecovery>;
29850
29851
  declare const errorDataSchema: z.ZodObject<{
29851
29852
  traceId: z.ZodString;
29852
29853
  recovery: z.ZodType<{
@@ -29913,7 +29914,7 @@ declare const errorDataSchema: z.ZodObject<{
29913
29914
  retryAfterSeconds: z.ZodOptional<z.ZodInt>;
29914
29915
  }, z.core.$strip>;
29915
29916
  export type ApiErrorData = z.infer<typeof errorDataSchema>;
29916
- declare const errorData: z.ZodType<ApiErrorData>;
29917
+ export declare const errorData: z.ZodType<ApiErrorData>;
29917
29918
  export type OperationReference = z.infer<typeof operationReference>;
29918
29919
  export type ApiErrorDetails = Omit<z.infer<typeof errorData>, "traceId" | "recovery"> & {
29919
29920
  recovery?: ErrorRecovery;
@@ -30481,7 +30482,17 @@ export declare const bikeChanges: z.ZodObject<{
30481
30482
  }, z.core.$strict>;
30482
30483
  export declare const bikeEditInput: z.ZodObject<{
30483
30484
  deviceId: z.ZodString;
30484
- expectedRevision: z.ZodString;
30485
+ trackerCreatedAt: z.ZodISODateTime;
30486
+ expected: z.ZodObject<{
30487
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30488
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30489
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30490
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30491
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30492
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30493
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30494
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30495
+ }, z.core.$strict>;
30485
30496
  changes: z.ZodObject<{
30486
30497
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30487
30498
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -30525,7 +30536,17 @@ export declare const trackerChangeContract: {
30525
30536
  bike: {
30526
30537
  edit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
30527
30538
  deviceId: z.ZodString;
30528
- expectedRevision: z.ZodString;
30539
+ trackerCreatedAt: z.ZodISODateTime;
30540
+ expected: z.ZodObject<{
30541
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30542
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30543
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30544
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30545
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30546
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30547
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30548
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30549
+ }, z.core.$strict>;
30529
30550
  changes: z.ZodObject<{
30530
30551
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30531
30552
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -30546,7 +30567,17 @@ export declare const trackerChangeContract: {
30546
30567
  USD: "USD";
30547
30568
  }>>>;
30548
30569
  }, z.core.$strict>;
30549
- }, z.core.$strict>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
30570
+ }, z.core.$strict>, z.ZodObject<{
30571
+ revision: z.ZodString;
30572
+ name: z.ZodNullable<z.ZodString>;
30573
+ brand: z.ZodNullable<z.ZodString>;
30574
+ type: z.ZodNullable<z.ZodString>;
30575
+ model: z.ZodNullable<z.ZodString>;
30576
+ frameNumber: z.ZodNullable<z.ZodString>;
30577
+ url: z.ZodNullable<z.ZodString>;
30578
+ marketPrice: z.ZodNullable<z.ZodString>;
30579
+ marketPriceCurrency: z.ZodNullable<z.ZodString>;
30580
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
30550
30581
  readonly invalid: {
30551
30582
  readonly status: 400;
30552
30583
  readonly data: z.ZodType<{
@@ -55196,7 +55227,17 @@ declare const trackerContract: {
55196
55227
  bike: {
55197
55228
  edit: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
55198
55229
  deviceId: z.ZodString;
55199
- expectedRevision: z.ZodString;
55230
+ trackerCreatedAt: z.ZodISODateTime;
55231
+ expected: z.ZodObject<{
55232
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55233
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55234
+ brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55235
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55236
+ frameNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55237
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55238
+ marketPrice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55239
+ marketPriceCurrency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55240
+ }, z.core.$strict>;
55200
55241
  changes: z.ZodObject<{
55201
55242
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55202
55243
  brand: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -55217,7 +55258,17 @@ declare const trackerContract: {
55217
55258
  USD: "USD";
55218
55259
  }>>>;
55219
55260
  }, z.core.$strict>;
55220
- }, z.core.$strict>, z.ZodVoid, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
55261
+ }, z.core.$strict>, z.ZodObject<{
55262
+ revision: z.ZodString;
55263
+ name: z.ZodNullable<z.ZodString>;
55264
+ brand: z.ZodNullable<z.ZodString>;
55265
+ type: z.ZodNullable<z.ZodString>;
55266
+ model: z.ZodNullable<z.ZodString>;
55267
+ frameNumber: z.ZodNullable<z.ZodString>;
55268
+ url: z.ZodNullable<z.ZodString>;
55269
+ marketPrice: z.ZodNullable<z.ZodString>;
55270
+ marketPriceCurrency: z.ZodNullable<z.ZodString>;
55271
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
55221
55272
  readonly invalid: {
55222
55273
  readonly status: 400;
55223
55274
  readonly data: z.ZodType<{
package/dist/schemas.js CHANGED
@@ -12,6 +12,8 @@ import {
12
12
  defaultAccountPreferences,
13
13
  directoryProfile,
14
14
  downloadReference,
15
+ errorData,
16
+ errorRecovery,
15
17
  factoryResetReport,
16
18
  firmwareAppInput,
17
19
  firmwareAvailability,
@@ -87,7 +89,7 @@ import {
87
89
  trackerSubscription,
88
90
  trackerSummary,
89
91
  trackerSummaryFields
90
- } from "./chunk-2FP3HQAZ.js";
92
+ } from "./chunk-UVAQKPXY.js";
91
93
  export {
92
94
  account,
93
95
  accountPreferencePatch,
@@ -102,6 +104,8 @@ export {
102
104
  defaultAccountPreferences,
103
105
  directoryProfile,
104
106
  downloadReference,
107
+ errorData,
108
+ errorRecovery,
105
109
  factoryResetReport,
106
110
  firmwareAppInput,
107
111
  firmwareAvailability,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bikefinder/sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Typed HTTP and WebSocket client for BikeFinder.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {