@bikefinder/sdk 0.1.5 → 0.1.6

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 return response JSON unchanged with generated static types. The API validates and converts stored data before responding; `readIssues` identifies unusable stored fields. Response validation is opt-in for both REST and SignalR: import `zTrackerDocument` from `@bikefinder/sdk/schemas` and call `.parse(value)` when the caller requires a runtime boundary check. 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. Optional 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,13 @@ 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.6` is the supported baseline for the 2026-11-07 minimum-rest
121
+ and optional response-validation release. Earlier SDKs have closed workflow-state
122
+ validators and should upgrade for the extensible diagnostic response contract.
123
+ The preceding prelaunch cutover retired experimental `@bikefinder/api-client`
124
+ releases and their older AWS contracts. The `/v1` route version is unchanged.
125
+ Future breaking changes still require an explicit retirement decision or a
126
+ separate API version.
126
127
 
127
128
  The tolerant response policy remains in place. Mode availability is an ID list,
128
129
  and selected mode IDs are open strings validated against each tracker's cloud
@@ -143,7 +144,7 @@ version for breaking changes and retain the supported v1 routes. Raising the
143
144
  oldest supported SDK version is an explicit retirement decision, not a routine
144
145
  way to pass CI. Dev deployment and production promotion both require this job.
145
146
 
146
- Runtime validation still rejects malformed known data. Applications should retain
147
- last valid stream messages and isolate failures per resource. When patching
147
+ Explicit runtime validation still rejects malformed known data. Callers choosing
148
+ it should retain last valid stream messages and isolate failures per resource. When patching
148
149
  settings, send only changed supported fields; preserve unfamiliar response fields
149
150
  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,9 +5428,7 @@ 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";
@@ -6116,11 +6112,9 @@ export declare const settingsValueSchema: {
6116
6112
  readonly description: "Advertising interval in 0.625 millisecond units. Applied by the peripheral owner independently of LTE connection work.";
6117
6113
  };
6118
6114
  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.";
6115
+ readonly type: "string";
6116
+ readonly title: "Tracking mode";
6117
+ readonly description: "Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles.";
6124
6118
  };
6125
6119
  readonly poweredReportIntervalSeconds: {
6126
6120
  readonly type: "integer";
@@ -6129,47 +6123,47 @@ export declare const settingsValueSchema: {
6129
6123
  readonly title: "Powered report interval";
6130
6124
  readonly description: "Period between tracking reports on confirmed external power.";
6131
6125
  };
6132
- readonly mode0IdleSeconds: {
6126
+ readonly standardIdleSeconds: {
6133
6127
  readonly type: "integer";
6134
6128
  readonly minimum: 60;
6135
6129
  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.";
6130
+ readonly title: "Standard idle duration";
6131
+ readonly description: "Maximum battery idle duration after a standard cycle.";
6138
6132
  };
6139
- readonly mode1IdleSeconds: {
6133
+ readonly securityIdleSeconds: {
6140
6134
  readonly type: "integer";
6141
6135
  readonly minimum: 60;
6142
6136
  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.";
6137
+ readonly title: "Security idle duration";
6138
+ readonly description: "Maximum battery idle duration after a security cycle.";
6145
6139
  };
6146
- readonly mode2IdleSeconds: {
6140
+ readonly trackingIdleSeconds: {
6147
6141
  readonly type: "integer";
6148
6142
  readonly minimum: 10;
6149
6143
  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.";
6144
+ readonly title: "Tracking idle duration";
6145
+ readonly description: "Maximum battery idle duration after a tracking cycle.";
6152
6146
  };
6153
- readonly mode0MinimumRestSeconds: {
6147
+ readonly standardMinimumRestSeconds: {
6154
6148
  readonly type: "integer";
6155
6149
  readonly minimum: 0;
6156
6150
  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.";
6151
+ readonly title: "Standard movement rest";
6152
+ readonly description: "Minimum rest before movement starts another standard cycle.";
6159
6153
  };
6160
- readonly mode1MinimumRestSeconds: {
6154
+ readonly securityMinimumRestSeconds: {
6161
6155
  readonly type: "integer";
6162
6156
  readonly minimum: 0;
6163
6157
  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.";
6158
+ readonly title: "Security movement rest";
6159
+ readonly description: "Minimum rest before movement starts another security cycle.";
6166
6160
  };
6167
- readonly mode2MinimumRestSeconds: {
6161
+ readonly trackingMinimumRestSeconds: {
6168
6162
  readonly type: "integer";
6169
6163
  readonly minimum: 0;
6170
6164
  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.";
6165
+ readonly title: "Tracking movement rest";
6166
+ readonly description: "Minimum rest before movement starts another tracking cycle.";
6173
6167
  };
6174
6168
  readonly psmResidenceSeconds: {
6175
6169
  readonly type: "integer";
@@ -6369,7 +6363,7 @@ export declare const settingsValueSchema: {
6369
6363
  readonly "x-bf": {
6370
6364
  readonly domain: "settings";
6371
6365
  readonly version: 1;
6372
- readonly settingsSchemaVersion: 29;
6366
+ readonly settingsSchemaVersion: 28;
6373
6367
  };
6374
6368
  };
6375
6369
  export declare const observationDefinitions: readonly [{
@@ -9696,7 +9690,7 @@ export interface WorkCompleted {
9696
9690
  activityEntries: ActivityEntries;
9697
9691
  recoveries: RecoveryCounts;
9698
9692
  saturated: boolean;
9699
- mode: number;
9693
+ mode: string;
9700
9694
  }
9701
9695
  export interface ActivityDurations {
9702
9696
  rrc: number;
@@ -9729,7 +9723,7 @@ export interface RecoveryCounts {
9729
9723
  */
9730
9724
  export interface WorkflowExecution {
9731
9725
  workflowVersion: number;
9732
- mode: number;
9726
+ mode: string;
9733
9727
  state: "idle" | "battery" | "connect" | "cell" | "wifi" | "publish" | "listen" | "gps" | "gpsPublish" | "rest";
9734
9728
  owner: "workflow" | "command" | "update" | "recovery" | "shutdown" | "fault" | "settings" | "charging" | "ble" | "network";
9735
9729
  phase: "entered" | "completed" | "cancelled" | "ownerChanged" | "snapshot";
@@ -9947,37 +9941,37 @@ export type BLEAdvertisingRequiresExternalPower = boolean;
9947
9941
  */
9948
9942
  export type BLEAdvertisingInterval = number;
9949
9943
  /**
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.
9944
+ * Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles.
9951
9945
  */
9952
- export type FirmwareModeID = number;
9946
+ export type TrackingMode = string;
9953
9947
  /**
9954
9948
  * Period between tracking reports on confirmed external power.
9955
9949
  */
9956
9950
  export type PoweredReportInterval = number;
9957
9951
  /**
9958
- * Maximum battery idle duration after a mode 0 cycle, measured from the end of work.
9952
+ * Maximum battery idle duration after a standard cycle.
9959
9953
  */
9960
- export type Mode0IdleDuration = number;
9954
+ export type StandardIdleDuration = number;
9961
9955
  /**
9962
- * Maximum battery idle duration after a mode 1 cycle, measured from the end of work.
9956
+ * Maximum battery idle duration after a security cycle.
9963
9957
  */
9964
- export type Mode1IdleDuration = number;
9958
+ export type SecurityIdleDuration = number;
9965
9959
  /**
9966
- * Maximum battery idle duration after a mode 2 cycle, measured from the end of work.
9960
+ * Maximum battery idle duration after a tracking cycle.
9967
9961
  */
9968
- export type Mode2IdleDuration = number;
9962
+ export type TrackingIdleDuration = number;
9969
9963
  /**
9970
- * Duration after a mode 0 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9964
+ * Minimum rest before movement starts another standard cycle.
9971
9965
  */
9972
- export type Mode0MinimumRest = number;
9966
+ export type StandardMovementRest = number;
9973
9967
  /**
9974
- * Duration after a mode 1 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9968
+ * Minimum rest before movement starts another security cycle.
9975
9969
  */
9976
- export type Mode1MinimumRest = number;
9970
+ export type SecurityMovementRest = number;
9977
9971
  /**
9978
- * Duration after a mode 2 cycle with the accelerometer and its wake interrupt disabled. Firmware re-enables motion detection when this period ends.
9972
+ * Minimum rest before movement starts another tracking cycle.
9979
9973
  */
9980
- export type Mode2MinimumRest = number;
9974
+ export type TrackingMovementRest = number;
9981
9975
  /**
9982
9976
  * Maximum idle time in PSM before setting the modem offline; capped by the existing idle deadline.
9983
9977
  */
@@ -10122,14 +10116,14 @@ export interface DeviceSettings {
10122
10116
  bleAdvertisingEnabled?: BLEAdvertising;
10123
10117
  bleAdvertisingRequiresExternalPower?: BLEAdvertisingRequiresExternalPower;
10124
10118
  bleAdvertisingIntervalUnits?: BLEAdvertisingInterval;
10125
- mode?: FirmwareModeID;
10119
+ mode?: TrackingMode;
10126
10120
  poweredReportIntervalSeconds?: PoweredReportInterval;
10127
- mode0IdleSeconds?: Mode0IdleDuration;
10128
- mode1IdleSeconds?: Mode1IdleDuration;
10129
- mode2IdleSeconds?: Mode2IdleDuration;
10130
- mode0MinimumRestSeconds?: Mode0MinimumRest;
10131
- mode1MinimumRestSeconds?: Mode1MinimumRest;
10132
- mode2MinimumRestSeconds?: Mode2MinimumRest;
10121
+ standardIdleSeconds?: StandardIdleDuration;
10122
+ securityIdleSeconds?: SecurityIdleDuration;
10123
+ trackingIdleSeconds?: TrackingIdleDuration;
10124
+ standardMinimumRestSeconds?: StandardMovementRest;
10125
+ securityMinimumRestSeconds?: SecurityMovementRest;
10126
+ trackingMinimumRestSeconds?: TrackingMovementRest;
10133
10127
  psmResidenceSeconds?: PSMResidence;
10134
10128
  commandListenSeconds?: TrackingCommandWindow;
10135
10129
  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,9 +6498,7 @@ 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
6504
  "type": "string",
@@ -7391,11 +7387,9 @@ export const settingsValueSchema = {
7391
7387
  "description": "Advertising interval in 0.625 millisecond units. Applied by the peripheral owner independently of LTE connection work."
7392
7388
  },
7393
7389
  "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."
7390
+ "type": "string",
7391
+ "title": "Tracking mode",
7392
+ "description": "Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles."
7399
7393
  },
7400
7394
  "poweredReportIntervalSeconds": {
7401
7395
  "type": "integer",
@@ -7404,47 +7398,47 @@ export const settingsValueSchema = {
7404
7398
  "title": "Powered report interval",
7405
7399
  "description": "Period between tracking reports on confirmed external power."
7406
7400
  },
7407
- "mode0IdleSeconds": {
7401
+ "standardIdleSeconds": {
7408
7402
  "type": "integer",
7409
7403
  "minimum": 60,
7410
7404
  "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."
7405
+ "title": "Standard idle duration",
7406
+ "description": "Maximum battery idle duration after a standard cycle."
7413
7407
  },
7414
- "mode1IdleSeconds": {
7408
+ "securityIdleSeconds": {
7415
7409
  "type": "integer",
7416
7410
  "minimum": 60,
7417
7411
  "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."
7412
+ "title": "Security idle duration",
7413
+ "description": "Maximum battery idle duration after a security cycle."
7420
7414
  },
7421
- "mode2IdleSeconds": {
7415
+ "trackingIdleSeconds": {
7422
7416
  "type": "integer",
7423
7417
  "minimum": 10,
7424
7418
  "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."
7419
+ "title": "Tracking idle duration",
7420
+ "description": "Maximum battery idle duration after a tracking cycle."
7427
7421
  },
7428
- "mode0MinimumRestSeconds": {
7422
+ "standardMinimumRestSeconds": {
7429
7423
  "type": "integer",
7430
7424
  "minimum": 0,
7431
7425
  "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."
7426
+ "title": "Standard movement rest",
7427
+ "description": "Minimum rest before movement starts another standard cycle."
7434
7428
  },
7435
- "mode1MinimumRestSeconds": {
7429
+ "securityMinimumRestSeconds": {
7436
7430
  "type": "integer",
7437
7431
  "minimum": 0,
7438
7432
  "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."
7433
+ "title": "Security movement rest",
7434
+ "description": "Minimum rest before movement starts another security cycle."
7441
7435
  },
7442
- "mode2MinimumRestSeconds": {
7436
+ "trackingMinimumRestSeconds": {
7443
7437
  "type": "integer",
7444
7438
  "minimum": 0,
7445
7439
  "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."
7440
+ "title": "Tracking movement rest",
7441
+ "description": "Minimum rest before movement starts another tracking cycle."
7448
7442
  },
7449
7443
  "psmResidenceSeconds": {
7450
7444
  "type": "integer",
@@ -7664,7 +7658,7 @@ export const settingsValueSchema = {
7664
7658
  "x-bf": {
7665
7659
  "domain": "settings",
7666
7660
  "version": 1,
7667
- "settingsSchemaVersion": 29
7661
+ "settingsSchemaVersion": 28
7668
7662
  }
7669
7663
  };
7670
7664
  export const observationDefinitions = [