@bikefinder/sdk 0.1.4 → 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 +15 -11
- package/dist/device-schema.d.ts +13 -3
- package/dist/device-schema.js +8 -2
- package/dist/generated/sdk.gen.js +1 -94
- package/dist/generated/types.gen.d.ts +16 -1
- package/dist/generated/zod.gen.d.ts +30 -120
- package/dist/generated/zod.gen.js +3 -11
- package/dist/workflow-schema.d.ts +1 -1
- package/dist/workflow-schema.js +2 -1
- package/openapi/api.json +12 -14
- 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,13 +117,17 @@ Command reads validate stored identity, catalog arguments, artifacts, and execut
|
|
|
117
117
|
|
|
118
118
|
## Supported API consumers
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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.
|
|
127
|
+
|
|
128
|
+
The tolerant response policy remains in place. Mode availability is an ID list,
|
|
129
|
+
and selected mode IDs are open strings validated against each tracker's cloud
|
|
130
|
+
catalog. Adding or removing catalog choices does not require another SDK release.
|
|
127
131
|
|
|
128
132
|
API CI installs the oldest supported immutable npm release selected in
|
|
129
133
|
`tools/check-api-compatibility.mjs`. It validates freshly server-serialized
|
|
@@ -140,7 +144,7 @@ version for breaking changes and retain the supported v1 routes. Raising the
|
|
|
140
144
|
oldest supported SDK version is an explicit retirement decision, not a routine
|
|
141
145
|
way to pass CI. Dev deployment and production promotion both require this job.
|
|
142
146
|
|
|
143
|
-
|
|
144
|
-
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
|
|
145
149
|
settings, send only changed supported fields; preserve unfamiliar response fields
|
|
146
150
|
and do not copy a full response into a write payload.
|
package/dist/device-schema.d.ts
CHANGED
|
@@ -5432,7 +5432,7 @@ export declare const observationValueSchema: {
|
|
|
5432
5432
|
};
|
|
5433
5433
|
readonly state: {
|
|
5434
5434
|
readonly type: "string";
|
|
5435
|
-
readonly enum: readonly ["idle", "battery", "connect", "cell", "wifi", "publish", "listen", "gps", "gpsPublish"];
|
|
5435
|
+
readonly enum: readonly ["idle", "battery", "connect", "cell", "wifi", "publish", "listen", "gps", "gpsPublish", "rest"];
|
|
5436
5436
|
};
|
|
5437
5437
|
readonly owner: {
|
|
5438
5438
|
readonly type: "string";
|
|
@@ -6354,11 +6354,16 @@ export declare const settingsValueSchema: {
|
|
|
6354
6354
|
readonly title: "Charging status maximum age";
|
|
6355
6355
|
readonly description: "Maximum age of charger readback used for the reported charging status. Independent of charging-control safety deadlines; does not authorize charging or schedule extra hardware reads. Confirmed input loss still reports not charging immediately.";
|
|
6356
6356
|
};
|
|
6357
|
+
readonly workReportingEnabled: {
|
|
6358
|
+
readonly type: "boolean";
|
|
6359
|
+
readonly title: "Automatic work reporting";
|
|
6360
|
+
readonly description: "Upload work.completed cycle outcomes and interval accounting on existing connections. Off by default. automaticDiagnosticsPower controls eligible power sources. Cached on-demand observations remain available when off; workflowDebugEnabled independently controls detailed step traces.";
|
|
6361
|
+
};
|
|
6357
6362
|
};
|
|
6358
6363
|
readonly "x-bf": {
|
|
6359
6364
|
readonly domain: "settings";
|
|
6360
6365
|
readonly version: 1;
|
|
6361
|
-
readonly settingsSchemaVersion:
|
|
6366
|
+
readonly settingsSchemaVersion: 28;
|
|
6362
6367
|
};
|
|
6363
6368
|
};
|
|
6364
6369
|
export declare const observationDefinitions: readonly [{
|
|
@@ -9719,7 +9724,7 @@ export interface RecoveryCounts {
|
|
|
9719
9724
|
export interface WorkflowExecution {
|
|
9720
9725
|
workflowVersion: number;
|
|
9721
9726
|
mode: string;
|
|
9722
|
-
state: "idle" | "battery" | "connect" | "cell" | "wifi" | "publish" | "listen" | "gps" | "gpsPublish";
|
|
9727
|
+
state: "idle" | "battery" | "connect" | "cell" | "wifi" | "publish" | "listen" | "gps" | "gpsPublish" | "rest";
|
|
9723
9728
|
owner: "workflow" | "command" | "update" | "recovery" | "shutdown" | "fault" | "settings" | "charging" | "ble" | "network";
|
|
9724
9729
|
phase: "entered" | "completed" | "cancelled" | "ownerChanged" | "snapshot";
|
|
9725
9730
|
outcome: ("done" | "unavailable" | "failed" | "timeout" | "cancelled") | null;
|
|
@@ -10075,6 +10080,10 @@ export type WiFiScanType = "active" | "passive";
|
|
|
10075
10080
|
* Maximum age of charger readback used for the reported charging status. Independent of charging-control safety deadlines; does not authorize charging or schedule extra hardware reads. Confirmed input loss still reports not charging immediately.
|
|
10076
10081
|
*/
|
|
10077
10082
|
export type ChargingStatusMaximumAge = number;
|
|
10083
|
+
/**
|
|
10084
|
+
* Upload work.completed cycle outcomes and interval accounting on existing connections. Off by default. automaticDiagnosticsPower controls eligible power sources. Cached on-demand observations remain available when off; workflowDebugEnabled independently controls detailed step traces.
|
|
10085
|
+
*/
|
|
10086
|
+
export type AutomaticWorkReporting = boolean;
|
|
10078
10087
|
export interface DeviceSettings {
|
|
10079
10088
|
batteryIntervalSeconds?: BatteryMeasurementInterval;
|
|
10080
10089
|
accTapSensitivity?: AccelerometerTapSensitivity;
|
|
@@ -10142,6 +10151,7 @@ export interface DeviceSettings {
|
|
|
10142
10151
|
wifiScanBudgetMs?: WiFiScanBudget;
|
|
10143
10152
|
wifiScanType?: WiFiScanType;
|
|
10144
10153
|
chargingStatusMaxAgeSeconds?: ChargingStatusMaximumAge;
|
|
10154
|
+
workReportingEnabled?: AutomaticWorkReporting;
|
|
10145
10155
|
}
|
|
10146
10156
|
type Definition = (typeof observationDefinitions)[number];
|
|
10147
10157
|
export type MetricName = Definition["name"];
|
package/dist/device-schema.js
CHANGED
|
@@ -6511,7 +6511,8 @@ export const observationValueSchema = {
|
|
|
6511
6511
|
"publish",
|
|
6512
6512
|
"listen",
|
|
6513
6513
|
"gps",
|
|
6514
|
-
"gpsPublish"
|
|
6514
|
+
"gpsPublish",
|
|
6515
|
+
"rest"
|
|
6515
6516
|
]
|
|
6516
6517
|
},
|
|
6517
6518
|
"owner": {
|
|
@@ -7647,12 +7648,17 @@ export const settingsValueSchema = {
|
|
|
7647
7648
|
"maximum": 86400,
|
|
7648
7649
|
"title": "Charging status maximum age",
|
|
7649
7650
|
"description": "Maximum age of charger readback used for the reported charging status. Independent of charging-control safety deadlines; does not authorize charging or schedule extra hardware reads. Confirmed input loss still reports not charging immediately."
|
|
7651
|
+
},
|
|
7652
|
+
"workReportingEnabled": {
|
|
7653
|
+
"type": "boolean",
|
|
7654
|
+
"title": "Automatic work reporting",
|
|
7655
|
+
"description": "Upload work.completed cycle outcomes and interval accounting on existing connections. Off by default. automaticDiagnosticsPower controls eligible power sources. Cached on-demand observations remain available when off; workflowDebugEnabled independently controls detailed step traces."
|
|
7650
7656
|
}
|
|
7651
7657
|
},
|
|
7652
7658
|
"x-bf": {
|
|
7653
7659
|
"domain": "settings",
|
|
7654
7660
|
"version": 1,
|
|
7655
|
-
"settingsSchemaVersion":
|
|
7661
|
+
"settingsSchemaVersion": 28
|
|
7656
7662
|
}
|
|
7657
7663
|
};
|
|
7658
7664
|
export const observationDefinitions = [
|