@trainheroic-unofficial/js 3.5.2 → 3.7.1
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 +16 -4
- package/dist/index.d.mts +211 -186
- package/dist/index.mjs +428 -156
- package/dist/node.d.mts +3 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ So a write is the same call with a body:
|
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
72
|
const created = await client.request("POST", "/2.0/coach/exercise/create", {
|
|
73
|
-
body: { title: "Sled Push" },
|
|
73
|
+
body: { title: "Sled Push", points_of_performance: "" },
|
|
74
74
|
});
|
|
75
75
|
```
|
|
76
76
|
|
|
@@ -117,11 +117,22 @@ failures without coupling the SDK to a telemetry vendor:
|
|
|
117
117
|
const client = new TrainHeroicClient(email, password, savedSession, {
|
|
118
118
|
onSession: saveSession,
|
|
119
119
|
onHttpError: (error) => telemetry.captureException(error),
|
|
120
|
+
transport: (url, init) => fetch(url, init), // optional host-specific HTTP transport
|
|
120
121
|
});
|
|
121
122
|
```
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
The client keeps at most four API operations in flight. A custom `transport` receives the same
|
|
125
|
+
URL and `RequestInit` that the default global `fetch` would receive; hosted runtimes can use this
|
|
126
|
+
seam to add coordination without changing SDK authentication or response parsing.
|
|
127
|
+
|
|
128
|
+
`onHttpError` receives a `TrainHeroicHttpError` containing the method, status, host, a bounded
|
|
129
|
+
request-body summary, and sanitized provider response diagnostics. The request summary records
|
|
130
|
+
field names, array lengths, a derived date-span count, and a small allowlist of non-sensitive enum
|
|
131
|
+
values; arbitrary request values are never included. Response diagnostics retain bounded
|
|
132
|
+
provider error strings, status fields, and boolean success flags. Credential values, email
|
|
133
|
+
addresses, IPv4 addresses, and SSNs are scrubbed from diagnostic strings, and unknown response
|
|
134
|
+
fields are omitted. Paths, query strings, session tokens, and login request and response data
|
|
135
|
+
remain excluded. A transient 401/403
|
|
125
136
|
that succeeds after automatic re-login does not call the hook, and synchronous or asynchronous
|
|
126
137
|
hook failures never change the request result.
|
|
127
138
|
|
|
@@ -157,7 +168,8 @@ The `.` entry imports no `node:*` modules. Anything that touches the filesystem
|
|
|
157
168
|
scheduled and completed workouts, per-exercise history, personal records, and working maxes.
|
|
158
169
|
- **Analytics.** Coach analytics reports via `queryAnalytics`, with `analyticsMetricCatalog`
|
|
159
170
|
and `ANALYTICS_METRIC_KEYS` for discovery. `teamVolume` rolls up per-athlete training
|
|
160
|
-
summary rows into a team total.
|
|
171
|
+
summary rows into a team total. Large training summaries are read as sequential five-athlete,
|
|
172
|
+
90-day batches and merged into one report.
|
|
161
173
|
- **Messaging.** Tools for conversation streams: listing them, reading a stream, and
|
|
162
174
|
building or sending or deleting a comment.
|
|
163
175
|
|