@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 +11 -10
- package/dist/device-schema.d.ts +47 -53
- package/dist/device-schema.js +24 -30
- package/dist/generated/sdk.gen.js +1 -94
- package/dist/generated/types.gen.d.ts +48 -45
- package/dist/generated/zod.gen.d.ts +100 -210
- package/dist/generated/zod.gen.js +17 -28
- package/dist/index.d.ts +1 -1
- package/dist/workflow-schema.d.ts +3 -3
- package/dist/workflow-schema.js +4 -4
- package/openapi/api.json +26 -44
- package/package.json +1 -1
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
|
|
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.
|
|
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.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
require an explicit retirement decision or a
|
|
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
|
-
|
|
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.
|
package/dist/device-schema.d.ts
CHANGED
|
@@ -5384,9 +5384,7 @@ export declare const observationValueSchema: {
|
|
|
5384
5384
|
readonly type: "boolean";
|
|
5385
5385
|
};
|
|
5386
5386
|
readonly mode: {
|
|
5387
|
-
readonly type: "
|
|
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: "
|
|
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: "
|
|
6120
|
-
readonly
|
|
6121
|
-
readonly
|
|
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
|
|
6126
|
+
readonly standardIdleSeconds: {
|
|
6133
6127
|
readonly type: "integer";
|
|
6134
6128
|
readonly minimum: 60;
|
|
6135
6129
|
readonly maximum: 604800;
|
|
6136
|
-
readonly title: "
|
|
6137
|
-
readonly description: "Maximum battery idle duration after a
|
|
6130
|
+
readonly title: "Standard idle duration";
|
|
6131
|
+
readonly description: "Maximum battery idle duration after a standard cycle.";
|
|
6138
6132
|
};
|
|
6139
|
-
readonly
|
|
6133
|
+
readonly securityIdleSeconds: {
|
|
6140
6134
|
readonly type: "integer";
|
|
6141
6135
|
readonly minimum: 60;
|
|
6142
6136
|
readonly maximum: 604800;
|
|
6143
|
-
readonly title: "
|
|
6144
|
-
readonly description: "Maximum battery idle duration after a
|
|
6137
|
+
readonly title: "Security idle duration";
|
|
6138
|
+
readonly description: "Maximum battery idle duration after a security cycle.";
|
|
6145
6139
|
};
|
|
6146
|
-
readonly
|
|
6140
|
+
readonly trackingIdleSeconds: {
|
|
6147
6141
|
readonly type: "integer";
|
|
6148
6142
|
readonly minimum: 10;
|
|
6149
6143
|
readonly maximum: 86400;
|
|
6150
|
-
readonly title: "
|
|
6151
|
-
readonly description: "Maximum battery idle duration after a
|
|
6144
|
+
readonly title: "Tracking idle duration";
|
|
6145
|
+
readonly description: "Maximum battery idle duration after a tracking cycle.";
|
|
6152
6146
|
};
|
|
6153
|
-
readonly
|
|
6147
|
+
readonly standardMinimumRestSeconds: {
|
|
6154
6148
|
readonly type: "integer";
|
|
6155
6149
|
readonly minimum: 0;
|
|
6156
6150
|
readonly maximum: 86400;
|
|
6157
|
-
readonly title: "
|
|
6158
|
-
readonly description: "
|
|
6151
|
+
readonly title: "Standard movement rest";
|
|
6152
|
+
readonly description: "Minimum rest before movement starts another standard cycle.";
|
|
6159
6153
|
};
|
|
6160
|
-
readonly
|
|
6154
|
+
readonly securityMinimumRestSeconds: {
|
|
6161
6155
|
readonly type: "integer";
|
|
6162
6156
|
readonly minimum: 0;
|
|
6163
6157
|
readonly maximum: 86400;
|
|
6164
|
-
readonly title: "
|
|
6165
|
-
readonly description: "
|
|
6158
|
+
readonly title: "Security movement rest";
|
|
6159
|
+
readonly description: "Minimum rest before movement starts another security cycle.";
|
|
6166
6160
|
};
|
|
6167
|
-
readonly
|
|
6161
|
+
readonly trackingMinimumRestSeconds: {
|
|
6168
6162
|
readonly type: "integer";
|
|
6169
6163
|
readonly minimum: 0;
|
|
6170
6164
|
readonly maximum: 86400;
|
|
6171
|
-
readonly title: "
|
|
6172
|
-
readonly description: "
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
-
*
|
|
9944
|
+
* Underlying firmware behavior. Offered tracking modes are cloud-configurable profiles.
|
|
9951
9945
|
*/
|
|
9952
|
-
export type
|
|
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
|
|
9952
|
+
* Maximum battery idle duration after a standard cycle.
|
|
9959
9953
|
*/
|
|
9960
|
-
export type
|
|
9954
|
+
export type StandardIdleDuration = number;
|
|
9961
9955
|
/**
|
|
9962
|
-
* Maximum battery idle duration after a
|
|
9956
|
+
* Maximum battery idle duration after a security cycle.
|
|
9963
9957
|
*/
|
|
9964
|
-
export type
|
|
9958
|
+
export type SecurityIdleDuration = number;
|
|
9965
9959
|
/**
|
|
9966
|
-
* Maximum battery idle duration after a
|
|
9960
|
+
* Maximum battery idle duration after a tracking cycle.
|
|
9967
9961
|
*/
|
|
9968
|
-
export type
|
|
9962
|
+
export type TrackingIdleDuration = number;
|
|
9969
9963
|
/**
|
|
9970
|
-
*
|
|
9964
|
+
* Minimum rest before movement starts another standard cycle.
|
|
9971
9965
|
*/
|
|
9972
|
-
export type
|
|
9966
|
+
export type StandardMovementRest = number;
|
|
9973
9967
|
/**
|
|
9974
|
-
*
|
|
9968
|
+
* Minimum rest before movement starts another security cycle.
|
|
9975
9969
|
*/
|
|
9976
|
-
export type
|
|
9970
|
+
export type SecurityMovementRest = number;
|
|
9977
9971
|
/**
|
|
9978
|
-
*
|
|
9972
|
+
* Minimum rest before movement starts another tracking cycle.
|
|
9979
9973
|
*/
|
|
9980
|
-
export type
|
|
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?:
|
|
10119
|
+
mode?: TrackingMode;
|
|
10126
10120
|
poweredReportIntervalSeconds?: PoweredReportInterval;
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
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;
|
package/dist/device-schema.js
CHANGED
|
@@ -6437,9 +6437,7 @@ export const observationValueSchema = {
|
|
|
6437
6437
|
"type": "boolean"
|
|
6438
6438
|
},
|
|
6439
6439
|
"mode": {
|
|
6440
|
-
"type": "
|
|
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": "
|
|
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": "
|
|
7395
|
-
"
|
|
7396
|
-
"
|
|
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
|
-
"
|
|
7401
|
+
"standardIdleSeconds": {
|
|
7408
7402
|
"type": "integer",
|
|
7409
7403
|
"minimum": 60,
|
|
7410
7404
|
"maximum": 604800,
|
|
7411
|
-
"title": "
|
|
7412
|
-
"description": "Maximum battery idle duration after a
|
|
7405
|
+
"title": "Standard idle duration",
|
|
7406
|
+
"description": "Maximum battery idle duration after a standard cycle."
|
|
7413
7407
|
},
|
|
7414
|
-
"
|
|
7408
|
+
"securityIdleSeconds": {
|
|
7415
7409
|
"type": "integer",
|
|
7416
7410
|
"minimum": 60,
|
|
7417
7411
|
"maximum": 604800,
|
|
7418
|
-
"title": "
|
|
7419
|
-
"description": "Maximum battery idle duration after a
|
|
7412
|
+
"title": "Security idle duration",
|
|
7413
|
+
"description": "Maximum battery idle duration after a security cycle."
|
|
7420
7414
|
},
|
|
7421
|
-
"
|
|
7415
|
+
"trackingIdleSeconds": {
|
|
7422
7416
|
"type": "integer",
|
|
7423
7417
|
"minimum": 10,
|
|
7424
7418
|
"maximum": 86400,
|
|
7425
|
-
"title": "
|
|
7426
|
-
"description": "Maximum battery idle duration after a
|
|
7419
|
+
"title": "Tracking idle duration",
|
|
7420
|
+
"description": "Maximum battery idle duration after a tracking cycle."
|
|
7427
7421
|
},
|
|
7428
|
-
"
|
|
7422
|
+
"standardMinimumRestSeconds": {
|
|
7429
7423
|
"type": "integer",
|
|
7430
7424
|
"minimum": 0,
|
|
7431
7425
|
"maximum": 86400,
|
|
7432
|
-
"title": "
|
|
7433
|
-
"description": "
|
|
7426
|
+
"title": "Standard movement rest",
|
|
7427
|
+
"description": "Minimum rest before movement starts another standard cycle."
|
|
7434
7428
|
},
|
|
7435
|
-
"
|
|
7429
|
+
"securityMinimumRestSeconds": {
|
|
7436
7430
|
"type": "integer",
|
|
7437
7431
|
"minimum": 0,
|
|
7438
7432
|
"maximum": 86400,
|
|
7439
|
-
"title": "
|
|
7440
|
-
"description": "
|
|
7433
|
+
"title": "Security movement rest",
|
|
7434
|
+
"description": "Minimum rest before movement starts another security cycle."
|
|
7441
7435
|
},
|
|
7442
|
-
"
|
|
7436
|
+
"trackingMinimumRestSeconds": {
|
|
7443
7437
|
"type": "integer",
|
|
7444
7438
|
"minimum": 0,
|
|
7445
7439
|
"maximum": 86400,
|
|
7446
|
-
"title": "
|
|
7447
|
-
"description": "
|
|
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":
|
|
7661
|
+
"settingsSchemaVersion": 28
|
|
7668
7662
|
}
|
|
7669
7663
|
};
|
|
7670
7664
|
export const observationDefinitions = [
|