@bikefinder/sdk 0.1.5 → 0.1.7

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
@@ -50,9 +50,9 @@ The application owns subscription sharing, retained data and account scope. Subs
50
50
 
51
51
  The application's Auth0 SDK supplies tokens and handles refresh. Create a new client for a new account session. `dispose()` aborts HTTP requests and stops both connections. Requests use bearer authentication, omit cookies and reject redirects. Network/validation failures reject; HTTP Problem Details are available as `result.error` by default. Writes are never automatically retried; a `503 operation_unconfirmed` may already have committed.
52
52
 
53
- REST responses use generated Zod validation. Stream values have generated static types and use the native SignalR decoder; for runtime validation, import `zTrackerDocument` from `@bikefinder/sdk/schemas` and call `.parse(value)`. Both transports reference the same generated payload types. Firestore responses come from the actual C# DTOs in `Firestore/TrackerData.cs` and `Firestore/ResourceData.cs`. The API converts stored data before responding; `readIssues` identifies unusable stored fields. Additional metadata remains in explicit JSON extension fields. Server-serialized response fixtures are validated by both API and generated-client tests. IDs are exact Firestore IDs.
53
+ REST calls automatically validate response structure without transforming response JSON. The API validates and converts stored data before responding; `readIssues` identifies unusable stored fields. Stream values use the native SignalR decoder; import `zTrackerDocument` from `@bikefinder/sdk/schemas` and call `.parse(value)` for the same runtime boundary check on a stream message. Both transports reference the same generated payload types. Firestore responses come from the actual C# DTOs in `Firestore/TrackerData.cs` and `Firestore/ResourceData.cs`. Additional metadata remains in explicit JSON extension fields. Server-serialized response fixtures are validated by both API and generated-client tests. IDs are exact Firestore IDs.
54
54
 
55
- Other native resources expose their known fields through resource-specific document types. Their C# contracts expose only interpreted fields; unrelated stored fields stay inside the API. Tracker reports and statistics have concrete models, and access-code storage is omitted from responses. Observation values are generated unions: after `observation.definitionId === 5`, `observation.value.percent` is a number. Current readings expose the same discriminator; check `observationId !== null` before using a present reading. Device settings, the built-in workflow descriptor and command argument tuples are generated from the canonical protocol JSON contracts. Bike and preference patches expose supported properties and distinguish omission from explicit null. Response validators preserve additional API fields while checking known values, required properties and enums. Request models retain their declared constraints and closed objects reject unknown write fields. Shared payloads have generated read variants so a tolerant response never weakens a request schema.
55
+ Other native resources expose their known fields through resource-specific document types. Their C# contracts expose only interpreted fields; unrelated stored fields stay inside the API. Tracker reports and statistics have concrete models, and access-code storage is omitted from responses. Observation values are generated unions: after `observation.definitionId === 5`, `observation.value.percent` is a number. Current readings expose the same discriminator; check `observationId !== null` before using a present reading. Device settings, the built-in workflow descriptor and command argument tuples are generated from the canonical protocol JSON contracts. Bike and preference patches expose supported properties and distinguish omission from explicit null. Response validators preserve additional API fields while checking known values and required properties. Workflow diagnostic states are extensible strings, including `idle` and `rest`; display or preserve unfamiliar states. Request models retain their declared constraints and closed objects reject unknown write fields. Shared payloads have generated read variants so a tolerant response never weakens a request schema.
56
56
 
57
57
  The handwritten entry point only configures clients, authentication and disposal. Hub methods, wire names and streaming signatures are generated. A generated type-only bridge reuses OpenAPI payload definitions instead of publishing a second set of models. There is no RxJS or MQTT dependency.
58
58
 
@@ -117,12 +117,14 @@ Command reads validate stored identity, catalog arguments, artifacts, and execut
117
117
 
118
118
  ## Supported API consumers
119
119
 
120
- `@bikefinder/sdk@0.1.4` is the supported baseline after the owner-approved prelaunch
121
- cutover on 2026-11-06. Earlier experimental `@bikefinder/api-client` releases and
122
- SDK 0.1.0–0.1.3 require a one-time consumer upgrade for current AWS commands,
123
- settings and observation variants. This explicitly retires the former 2.0.0
124
- baseline; the `/v1` route version is unchanged. Future breaking changes still
125
- require an explicit retirement decision or a separate API version.
120
+ `@bikefinder/sdk@0.1.7` is the supported baseline for the 2026-11-07 minimum-rest
121
+ release with automatic response validation and extensible diagnostic strings.
122
+ Older closed-state readers should upgrade for the extensible diagnostic contract.
123
+ SDK 0.1.6 disables automatic response validation; upgrade to 0.1.7 to retain it.
124
+ The preceding prelaunch cutover retired experimental `@bikefinder/api-client`
125
+ releases and their older AWS contracts. The `/v1` route version is unchanged.
126
+ Future breaking changes still require an explicit retirement decision or a
127
+ separate API version.
126
128
 
127
129
  The tolerant response policy remains in place. Mode availability is an ID list,
128
130
  and selected mode IDs are open strings validated against each tracker's cloud
@@ -143,7 +145,7 @@ version for breaking changes and retain the supported v1 routes. Raising the
143
145
  oldest supported SDK version is an explicit retirement decision, not a routine
144
146
  way to pass CI. Dev deployment and production promotion both require this job.
145
147
 
146
- Runtime validation still rejects malformed known data. Applications should retain
147
- last valid stream messages and isolate failures per resource. When patching
148
+ Runtime validation rejects malformed known data. Stream consumers should retain
149
+ last valid messages and isolate failures per resource. When patching
148
150
  settings, send only changed supported fields; preserve unfamiliar response fields
149
151
  and do not copy a full response into a write payload.
@@ -5384,9 +5384,7 @@ export declare const observationValueSchema: {
5384
5384
  readonly type: "boolean";
5385
5385
  };
5386
5386
  readonly mode: {
5387
- readonly type: "integer";
5388
- readonly minimum: 0;
5389
- readonly maximum: 2;
5387
+ readonly type: "string";
5390
5388
  };
5391
5389
  };
5392
5390
  readonly required: readonly ["completedCount", "trigger", "outcome", "elapsedMs", "activeMs", "activityMs", "activityEntries", "recoveries", "saturated", "mode"];
@@ -5430,13 +5428,10 @@ export declare const observationValueSchema: {
5430
5428
  readonly maximum: 65535;
5431
5429
  };
5432
5430
  readonly mode: {
5433
- readonly type: "integer";
5434
- readonly minimum: 0;
5435
- readonly maximum: 2;
5431
+ readonly type: "string";
5436
5432
  };
5437
5433
  readonly state: {
5438
5434
  readonly type: "string";
5439
- readonly enum: readonly ["idle", "battery", "connect", "cell", "wifi", "publish", "listen", "gps", "gpsPublish", "rest"];
5440
5435
  };
5441
5436
  readonly owner: {
5442
5437
  readonly type: "string";
@@ -5519,7 +5514,7 @@ export declare const observationValueSchema: {
5519
5514
  readonly label: "Duration";
5520
5515
  readonly format: "duration";
5521
5516
  }];
5522
- readonly extensibleEnumFields: readonly ["mode"];
5517
+ readonly extensibleEnumFields: readonly ["mode", "state"];
5523
5518
  };
5524
5519
  };
5525
5520
  };
@@ -6116,11 +6111,9 @@ export declare const settingsValueSchema: {
6116
6111
  readonly description: "Advertising interval in 0.625 millisecond units. Applied by the peripheral owner independently of LTE connection work.";
6117
6112
  };
6118
6113
  readonly mode: {
6119
- readonly type: "integer";
6120
- readonly minimum: 0;
6121
- readonly maximum: 2;
6122
- readonly title: "Firmware mode ID";
6123
- readonly description: "Stable integer firmware mode ID: 0, 1 or 2. Each mode’s stages are defined in firmware. Public mode names are mapped to these IDs by the assigned tracking mode catalog.";
6114
+ readonly type: "string";
6115
+ readonly title: "Tracking mode";
6116
+ readonly description: "Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles.";
6124
6117
  };
6125
6118
  readonly poweredReportIntervalSeconds: {
6126
6119
  readonly type: "integer";
@@ -6129,47 +6122,47 @@ export declare const settingsValueSchema: {
6129
6122
  readonly title: "Powered report interval";
6130
6123
  readonly description: "Period between tracking reports on confirmed external power.";
6131
6124
  };
6132
- readonly mode0IdleSeconds: {
6125
+ readonly standardIdleSeconds: {
6133
6126
  readonly type: "integer";
6134
6127
  readonly minimum: 60;
6135
6128
  readonly maximum: 604800;
6136
- readonly title: "Mode 0 idle duration";
6137
- readonly description: "Maximum battery idle duration after a mode 0 cycle, measured from the end of work.";
6129
+ readonly title: "Standard idle duration";
6130
+ readonly description: "Maximum battery idle duration after a standard cycle.";
6138
6131
  };
6139
- readonly mode1IdleSeconds: {
6132
+ readonly securityIdleSeconds: {
6140
6133
  readonly type: "integer";
6141
6134
  readonly minimum: 60;
6142
6135
  readonly maximum: 604800;
6143
- readonly title: "Mode 1 idle duration";
6144
- readonly description: "Maximum battery idle duration after a mode 1 cycle, measured from the end of work.";
6136
+ readonly title: "Security idle duration";
6137
+ readonly description: "Maximum battery idle duration after a security cycle.";
6145
6138
  };
6146
- readonly mode2IdleSeconds: {
6139
+ readonly trackingIdleSeconds: {
6147
6140
  readonly type: "integer";
6148
6141
  readonly minimum: 10;
6149
6142
  readonly maximum: 86400;
6150
- readonly title: "Mode 2 idle duration";
6151
- readonly description: "Maximum battery idle duration after a mode 2 cycle, measured from the end of work.";
6143
+ readonly title: "Tracking idle duration";
6144
+ readonly description: "Maximum battery idle duration after a tracking cycle.";
6152
6145
  };
6153
- readonly mode0MinimumRestSeconds: {
6146
+ readonly standardMinimumRestSeconds: {
6154
6147
  readonly type: "integer";
6155
6148
  readonly minimum: 0;
6156
6149
  readonly maximum: 86400;
6157
- readonly title: "Mode 0 minimum rest";
6158
- readonly description: "Duration after a mode 0 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.";
6150
+ readonly title: "Standard movement rest";
6151
+ readonly description: "Minimum rest before movement starts another standard cycle.";
6159
6152
  };
6160
- readonly mode1MinimumRestSeconds: {
6153
+ readonly securityMinimumRestSeconds: {
6161
6154
  readonly type: "integer";
6162
6155
  readonly minimum: 0;
6163
6156
  readonly maximum: 86400;
6164
- readonly title: "Mode 1 minimum rest";
6165
- readonly description: "Duration after a mode 1 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.";
6157
+ readonly title: "Security movement rest";
6158
+ readonly description: "Minimum rest before movement starts another security cycle.";
6166
6159
  };
6167
- readonly mode2MinimumRestSeconds: {
6160
+ readonly trackingMinimumRestSeconds: {
6168
6161
  readonly type: "integer";
6169
6162
  readonly minimum: 0;
6170
6163
  readonly maximum: 86400;
6171
- readonly title: "Mode 2 minimum rest";
6172
- readonly description: "Duration after a mode 2 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.";
6164
+ readonly title: "Tracking movement rest";
6165
+ readonly description: "Minimum rest before movement starts another tracking cycle.";
6173
6166
  };
6174
6167
  readonly psmResidenceSeconds: {
6175
6168
  readonly type: "integer";
@@ -6369,7 +6362,7 @@ export declare const settingsValueSchema: {
6369
6362
  readonly "x-bf": {
6370
6363
  readonly domain: "settings";
6371
6364
  readonly version: 1;
6372
- readonly settingsSchemaVersion: 29;
6365
+ readonly settingsSchemaVersion: 28;
6373
6366
  };
6374
6367
  };
6375
6368
  export declare const observationDefinitions: readonly [{
@@ -8392,7 +8385,7 @@ export declare const observationDefinitions: readonly [{
8392
8385
  readonly label: "Duration";
8393
8386
  readonly format: "duration";
8394
8387
  }];
8395
- readonly extensibleEnumFields: readonly ["mode"];
8388
+ readonly extensibleEnumFields: readonly ["mode", "state"];
8396
8389
  };
8397
8390
  }, {
8398
8391
  readonly id: 159;
@@ -9696,7 +9689,7 @@ export interface WorkCompleted {
9696
9689
  activityEntries: ActivityEntries;
9697
9690
  recoveries: RecoveryCounts;
9698
9691
  saturated: boolean;
9699
- mode: number;
9692
+ mode: string;
9700
9693
  }
9701
9694
  export interface ActivityDurations {
9702
9695
  rrc: number;
@@ -9729,8 +9722,8 @@ export interface RecoveryCounts {
9729
9722
  */
9730
9723
  export interface WorkflowExecution {
9731
9724
  workflowVersion: number;
9732
- mode: number;
9733
- state: "idle" | "battery" | "connect" | "cell" | "wifi" | "publish" | "listen" | "gps" | "gpsPublish" | "rest";
9725
+ mode: string;
9726
+ state: string;
9734
9727
  owner: "workflow" | "command" | "update" | "recovery" | "shutdown" | "fault" | "settings" | "charging" | "ble" | "network";
9735
9728
  phase: "entered" | "completed" | "cancelled" | "ownerChanged" | "snapshot";
9736
9729
  outcome: ("done" | "unavailable" | "failed" | "timeout" | "cancelled") | null;
@@ -9947,37 +9940,37 @@ export type BLEAdvertisingRequiresExternalPower = boolean;
9947
9940
  */
9948
9941
  export type BLEAdvertisingInterval = number;
9949
9942
  /**
9950
- * Stable integer firmware mode ID: 0, 1 or 2. Each mode’s stages are defined in firmware. Public mode names are mapped to these IDs by the assigned tracking mode catalog.
9943
+ * Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles.
9951
9944
  */
9952
- export type FirmwareModeID = number;
9945
+ export type TrackingMode = string;
9953
9946
  /**
9954
9947
  * Period between tracking reports on confirmed external power.
9955
9948
  */
9956
9949
  export type PoweredReportInterval = number;
9957
9950
  /**
9958
- * Maximum battery idle duration after a mode 0 cycle, measured from the end of work.
9951
+ * Maximum battery idle duration after a standard cycle.
9959
9952
  */
9960
- export type Mode0IdleDuration = number;
9953
+ export type StandardIdleDuration = number;
9961
9954
  /**
9962
- * Maximum battery idle duration after a mode 1 cycle, measured from the end of work.
9955
+ * Maximum battery idle duration after a security cycle.
9963
9956
  */
9964
- export type Mode1IdleDuration = number;
9957
+ export type SecurityIdleDuration = number;
9965
9958
  /**
9966
- * Maximum battery idle duration after a mode 2 cycle, measured from the end of work.
9959
+ * Maximum battery idle duration after a tracking cycle.
9967
9960
  */
9968
- export type Mode2IdleDuration = number;
9961
+ export type TrackingIdleDuration = number;
9969
9962
  /**
9970
- * Duration after a mode 0 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9963
+ * Minimum rest before movement starts another standard cycle.
9971
9964
  */
9972
- export type Mode0MinimumRest = number;
9965
+ export type StandardMovementRest = number;
9973
9966
  /**
9974
- * Duration after a mode 1 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9967
+ * Minimum rest before movement starts another security cycle.
9975
9968
  */
9976
- export type Mode1MinimumRest = number;
9969
+ export type SecurityMovementRest = number;
9977
9970
  /**
9978
- * Duration after a mode 2 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9971
+ * Minimum rest before movement starts another tracking cycle.
9979
9972
  */
9980
- export type Mode2MinimumRest = number;
9973
+ export type TrackingMovementRest = number;
9981
9974
  /**
9982
9975
  * Maximum idle time in PSM before setting the modem offline; capped by the existing idle deadline.
9983
9976
  */
@@ -10122,14 +10115,14 @@ export interface DeviceSettings {
10122
10115
  bleAdvertisingEnabled?: BLEAdvertising;
10123
10116
  bleAdvertisingRequiresExternalPower?: BLEAdvertisingRequiresExternalPower;
10124
10117
  bleAdvertisingIntervalUnits?: BLEAdvertisingInterval;
10125
- mode?: FirmwareModeID;
10118
+ mode?: TrackingMode;
10126
10119
  poweredReportIntervalSeconds?: PoweredReportInterval;
10127
- mode0IdleSeconds?: Mode0IdleDuration;
10128
- mode1IdleSeconds?: Mode1IdleDuration;
10129
- mode2IdleSeconds?: Mode2IdleDuration;
10130
- mode0MinimumRestSeconds?: Mode0MinimumRest;
10131
- mode1MinimumRestSeconds?: Mode1MinimumRest;
10132
- mode2MinimumRestSeconds?: Mode2MinimumRest;
10120
+ standardIdleSeconds?: StandardIdleDuration;
10121
+ securityIdleSeconds?: SecurityIdleDuration;
10122
+ trackingIdleSeconds?: TrackingIdleDuration;
10123
+ standardMinimumRestSeconds?: StandardMovementRest;
10124
+ securityMinimumRestSeconds?: SecurityMovementRest;
10125
+ trackingMinimumRestSeconds?: TrackingMovementRest;
10133
10126
  psmResidenceSeconds?: PSMResidence;
10134
10127
  commandListenSeconds?: TrackingCommandWindow;
10135
10128
  gnssSearchTimeoutSeconds?: GNSSSearchTimeout;
@@ -6437,9 +6437,7 @@ export const observationValueSchema = {
6437
6437
  "type": "boolean"
6438
6438
  },
6439
6439
  "mode": {
6440
- "type": "integer",
6441
- "minimum": 0,
6442
- "maximum": 2
6440
+ "type": "string"
6443
6441
  }
6444
6442
  },
6445
6443
  "required": [
@@ -6500,24 +6498,10 @@ export const observationValueSchema = {
6500
6498
  "maximum": 65535
6501
6499
  },
6502
6500
  "mode": {
6503
- "type": "integer",
6504
- "minimum": 0,
6505
- "maximum": 2
6501
+ "type": "string"
6506
6502
  },
6507
6503
  "state": {
6508
- "type": "string",
6509
- "enum": [
6510
- "idle",
6511
- "battery",
6512
- "connect",
6513
- "cell",
6514
- "wifi",
6515
- "publish",
6516
- "listen",
6517
- "gps",
6518
- "gpsPublish",
6519
- "rest"
6520
- ]
6504
+ "type": "string"
6521
6505
  },
6522
6506
  "owner": {
6523
6507
  "type": "string",
@@ -6674,7 +6658,8 @@ export const observationValueSchema = {
6674
6658
  }
6675
6659
  ],
6676
6660
  "extensibleEnumFields": [
6677
- "mode"
6661
+ "mode",
6662
+ "state"
6678
6663
  ]
6679
6664
  }
6680
6665
  }
@@ -7391,11 +7376,9 @@ export const settingsValueSchema = {
7391
7376
  "description": "Advertising interval in 0.625 millisecond units. Applied by the peripheral owner independently of LTE connection work."
7392
7377
  },
7393
7378
  "mode": {
7394
- "type": "integer",
7395
- "minimum": 0,
7396
- "maximum": 2,
7397
- "title": "Firmware mode ID",
7398
- "description": "Stable integer firmware mode ID: 0, 1 or 2. Each mode’s stages are defined in firmware. Public mode names are mapped to these IDs by the assigned tracking mode catalog."
7379
+ "type": "string",
7380
+ "title": "Tracking mode",
7381
+ "description": "Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles."
7399
7382
  },
7400
7383
  "poweredReportIntervalSeconds": {
7401
7384
  "type": "integer",
@@ -7404,47 +7387,47 @@ export const settingsValueSchema = {
7404
7387
  "title": "Powered report interval",
7405
7388
  "description": "Period between tracking reports on confirmed external power."
7406
7389
  },
7407
- "mode0IdleSeconds": {
7390
+ "standardIdleSeconds": {
7408
7391
  "type": "integer",
7409
7392
  "minimum": 60,
7410
7393
  "maximum": 604800,
7411
- "title": "Mode 0 idle duration",
7412
- "description": "Maximum battery idle duration after a mode 0 cycle, measured from the end of work."
7394
+ "title": "Standard idle duration",
7395
+ "description": "Maximum battery idle duration after a standard cycle."
7413
7396
  },
7414
- "mode1IdleSeconds": {
7397
+ "securityIdleSeconds": {
7415
7398
  "type": "integer",
7416
7399
  "minimum": 60,
7417
7400
  "maximum": 604800,
7418
- "title": "Mode 1 idle duration",
7419
- "description": "Maximum battery idle duration after a mode 1 cycle, measured from the end of work."
7401
+ "title": "Security idle duration",
7402
+ "description": "Maximum battery idle duration after a security cycle."
7420
7403
  },
7421
- "mode2IdleSeconds": {
7404
+ "trackingIdleSeconds": {
7422
7405
  "type": "integer",
7423
7406
  "minimum": 10,
7424
7407
  "maximum": 86400,
7425
- "title": "Mode 2 idle duration",
7426
- "description": "Maximum battery idle duration after a mode 2 cycle, measured from the end of work."
7408
+ "title": "Tracking idle duration",
7409
+ "description": "Maximum battery idle duration after a tracking cycle."
7427
7410
  },
7428
- "mode0MinimumRestSeconds": {
7411
+ "standardMinimumRestSeconds": {
7429
7412
  "type": "integer",
7430
7413
  "minimum": 0,
7431
7414
  "maximum": 86400,
7432
- "title": "Mode 0 minimum rest",
7433
- "description": "Duration after a mode 0 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends."
7415
+ "title": "Standard movement rest",
7416
+ "description": "Minimum rest before movement starts another standard cycle."
7434
7417
  },
7435
- "mode1MinimumRestSeconds": {
7418
+ "securityMinimumRestSeconds": {
7436
7419
  "type": "integer",
7437
7420
  "minimum": 0,
7438
7421
  "maximum": 86400,
7439
- "title": "Mode 1 minimum rest",
7440
- "description": "Duration after a mode 1 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends."
7422
+ "title": "Security movement rest",
7423
+ "description": "Minimum rest before movement starts another security cycle."
7441
7424
  },
7442
- "mode2MinimumRestSeconds": {
7425
+ "trackingMinimumRestSeconds": {
7443
7426
  "type": "integer",
7444
7427
  "minimum": 0,
7445
7428
  "maximum": 86400,
7446
- "title": "Mode 2 minimum rest",
7447
- "description": "Duration after a mode 2 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends."
7429
+ "title": "Tracking movement rest",
7430
+ "description": "Minimum rest before movement starts another tracking cycle."
7448
7431
  },
7449
7432
  "psmResidenceSeconds": {
7450
7433
  "type": "integer",
@@ -7664,7 +7647,7 @@ export const settingsValueSchema = {
7664
7647
  "x-bf": {
7665
7648
  "domain": "settings",
7666
7649
  "version": 1,
7667
- "settingsSchemaVersion": 29
7650
+ "settingsSchemaVersion": 28
7668
7651
  }
7669
7652
  };
7670
7653
  export const observationDefinitions = [
@@ -9949,7 +9932,8 @@ export const observationDefinitions = [
9949
9932
  }
9950
9933
  ],
9951
9934
  "extensibleEnumFields": [
9952
- "mode"
9935
+ "mode",
9936
+ "state"
9953
9937
  ]
9954
9938
  }
9955
9939
  },