suunto-api-wrapper 1.1.2 → 1.2.2
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 +18 -2
- package/dist/index.d.mts +316 -61
- package/dist/index.d.ts +316 -61
- package/dist/index.js +198 -0
- package/dist/index.mjs +195 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
# suunto-api-wrapper
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/suunto-api-wrapper)
|
|
4
|
+
[](https://sonarcloud.io/summary/new_code?id=Marius-Ar_suunto-api-wrapper)
|
|
4
5
|
|
|
5
|
-
A small, typed TypeScript client for the **Suunto app API**
|
|
6
|
-
the Sports Tracker
|
|
6
|
+
A small, typed TypeScript client for the **Suunto mobile app API** the same
|
|
7
|
+
backend the Suunto phone app talks to (served by Sports Tracker at
|
|
8
|
+
`api.sports-tracker.com`).
|
|
9
|
+
|
|
10
|
+
**No Suunto apizone / developer account required.** This library does **not**
|
|
11
|
+
use Suunto's official partner API at `apizone.suunto.com`, so there are no
|
|
12
|
+
OAuth client IDs, no app registration, and no developer approval to deal with.
|
|
13
|
+
You authenticate with the same email + password you use in the Suunto app.
|
|
7
14
|
|
|
8
15
|
It handles the annoying parts and exposes the endpoints as
|
|
9
16
|
typed, resource‑grouped methods:
|
|
@@ -82,6 +89,9 @@ payload, typed to the real API response shape (an envelope of
|
|
|
82
89
|
| ------------------ | ------------------------------ | ----------------------------------------- |
|
|
83
90
|
| `suunto.workouts` | `.own(params?)` | your own workouts |
|
|
84
91
|
| | `.public(username, params?)` | a user's public workouts |
|
|
92
|
+
| | `.byKey(username, key, params?)` | a single workout (public, or your own when authed) |
|
|
93
|
+
| | `.stats(username)` | aggregated workout stats per activity |
|
|
94
|
+
| | `.within(box)` | public workouts inside a lat/lng bounding box |
|
|
85
95
|
| `suunto.users` | `.byName(username)` | a user's public profile |
|
|
86
96
|
| | `.search(terms)` | search for users |
|
|
87
97
|
| `suunto.gear` | `.latest(username, params?)` | a user's latest gear |
|
|
@@ -90,6 +100,11 @@ payload, typed to the real API response shape (an envelope of
|
|
|
90
100
|
// Workouts
|
|
91
101
|
const own = await suunto.workouts.own({ limit: 20, offset: 0, since: 0 });
|
|
92
102
|
const publicItems = await suunto.workouts.public("someuser", { limit: 40 });
|
|
103
|
+
const single = await suunto.workouts.byKey("someuser", "workoutKey123");
|
|
104
|
+
const stats = await suunto.workouts.stats("someuser");
|
|
105
|
+
const nearby = await suunto.workouts.within({
|
|
106
|
+
lowerLat: 45.70, lowerLng: 4.75, upperLat: 45.85, upperLng: 4.95, limit: 50,
|
|
107
|
+
});
|
|
93
108
|
|
|
94
109
|
// Users
|
|
95
110
|
const profile = await suunto.users.byName("someuser");
|
|
@@ -120,6 +135,7 @@ Some endpoints (like fetching a public profile) don't require login. Use the
|
|
|
120
135
|
```ts
|
|
121
136
|
const guest = SuuntoClient.unauthenticated();
|
|
122
137
|
const profile = await guest.users.byName("someuser");
|
|
138
|
+
const stats = await guest.workouts.stats("someuser");
|
|
123
139
|
```
|
|
124
140
|
|
|
125
141
|
### Escape hatch: the raw HTTP client
|
package/dist/index.d.mts
CHANGED
|
@@ -86,6 +86,68 @@ declare const DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15
|
|
|
86
86
|
declare function login(options: LoginOptions): Promise<LoginResponse>;
|
|
87
87
|
declare function sessionTokenFrom(response: LoginResponse): string | undefined;
|
|
88
88
|
|
|
89
|
+
interface UserProfile {
|
|
90
|
+
username: string;
|
|
91
|
+
createdDate: number;
|
|
92
|
+
lastModified: number;
|
|
93
|
+
lastLogin: number;
|
|
94
|
+
realName: string;
|
|
95
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
96
|
+
country: string;
|
|
97
|
+
gender: string;
|
|
98
|
+
uuid: string;
|
|
99
|
+
blocked: boolean;
|
|
100
|
+
showLocale: boolean;
|
|
101
|
+
followersCount: number;
|
|
102
|
+
followingCount: number;
|
|
103
|
+
currentBlobStorageLocation: string;
|
|
104
|
+
defaultBinaryStorageLocation: string;
|
|
105
|
+
}
|
|
106
|
+
interface UserProfileResponse {
|
|
107
|
+
error: string | null;
|
|
108
|
+
payload: UserProfile;
|
|
109
|
+
metadata: {
|
|
110
|
+
ts: string;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** User shape returned by the search endpoint (differs slightly from {@link UserProfile}). */
|
|
114
|
+
interface SearchUser {
|
|
115
|
+
username: string;
|
|
116
|
+
createdDate: number;
|
|
117
|
+
lastModified: number;
|
|
118
|
+
lastLogin: number;
|
|
119
|
+
/** Absent on some legacy accounts. */
|
|
120
|
+
realName?: string;
|
|
121
|
+
/** Free-form profile bio. */
|
|
122
|
+
description?: string;
|
|
123
|
+
/** ISO 3166-1 country code. Mostly alpha-2, but legacy records may use alpha-3 (e.g. "FRA"). */
|
|
124
|
+
country?: string;
|
|
125
|
+
city?: string;
|
|
126
|
+
gender: string;
|
|
127
|
+
uuid: string;
|
|
128
|
+
imageKey?: string;
|
|
129
|
+
profileImageUrl?: string;
|
|
130
|
+
coverImageKey?: string;
|
|
131
|
+
coverImageUrl?: string;
|
|
132
|
+
showLocale: boolean;
|
|
133
|
+
defaultBinaryStorageLocation: string;
|
|
134
|
+
currentBlobStorageLocation: string;
|
|
135
|
+
key: string;
|
|
136
|
+
}
|
|
137
|
+
interface UserSearchResult {
|
|
138
|
+
/** Relationship to the searching user, e.g. "STRANGER". */
|
|
139
|
+
connection: string;
|
|
140
|
+
user: SearchUser;
|
|
141
|
+
workout: unknown | null;
|
|
142
|
+
}
|
|
143
|
+
interface UserSearchResponse {
|
|
144
|
+
error: string | null;
|
|
145
|
+
payload: UserSearchResult[];
|
|
146
|
+
metadata: {
|
|
147
|
+
ts: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
89
151
|
interface GetWorkoutsParams {
|
|
90
152
|
limit?: number;
|
|
91
153
|
sortonst?: boolean;
|
|
@@ -95,6 +157,166 @@ interface GetOwnWorkoutsParams {
|
|
|
95
157
|
offset?: number;
|
|
96
158
|
limit?: number;
|
|
97
159
|
}
|
|
160
|
+
/** Bounding-box query for {@link getWorkoutsWithin}. All coords in decimal degrees. */
|
|
161
|
+
interface GetWorkoutsWithinParams {
|
|
162
|
+
/** South latitude of the bounding box. */
|
|
163
|
+
lowerLat: number;
|
|
164
|
+
/** West longitude of the bounding box. */
|
|
165
|
+
lowerLng: number;
|
|
166
|
+
/** North latitude of the bounding box. */
|
|
167
|
+
upperLat: number;
|
|
168
|
+
/** East longitude of the bounding box. */
|
|
169
|
+
upperLng: number;
|
|
170
|
+
/** Max results. Defaults to 50. */
|
|
171
|
+
limit?: number;
|
|
172
|
+
}
|
|
173
|
+
/** Suunto activity type IDs returned by the API as `activityId` / `_id`. */
|
|
174
|
+
declare enum SuuntoActivityType {
|
|
175
|
+
WALKING = 0,
|
|
176
|
+
RUNNING = 1,
|
|
177
|
+
CYCLING = 2,
|
|
178
|
+
CROSS_COUNTRY_SKIING = 3,
|
|
179
|
+
OTHER_1 = 4,
|
|
180
|
+
OTHER_2 = 5,
|
|
181
|
+
OTHER_3 = 6,
|
|
182
|
+
OTHER_4 = 7,
|
|
183
|
+
OTHER_5 = 8,
|
|
184
|
+
OTHER_6 = 9,
|
|
185
|
+
MOUNTAIN_BIKING = 10,
|
|
186
|
+
HIKING = 11,
|
|
187
|
+
ROLLER_SKATING = 12,
|
|
188
|
+
DOWNHILL_SKIING = 13,
|
|
189
|
+
PADDLING = 14,
|
|
190
|
+
ROWING = 15,
|
|
191
|
+
GOLF = 16,
|
|
192
|
+
INDOOR = 17,
|
|
193
|
+
PARKOUR = 18,
|
|
194
|
+
BALLGAMES = 19,
|
|
195
|
+
OUTDOOR_GYM = 20,
|
|
196
|
+
SWIMMING = 21,
|
|
197
|
+
TRAIL_RUNNING = 22,
|
|
198
|
+
GYM = 23,
|
|
199
|
+
NORDIC_WALKING = 24,
|
|
200
|
+
HORSEBACK_RIDING = 25,
|
|
201
|
+
MOTOR_SPORTS = 26,
|
|
202
|
+
SKATEBOARDING = 27,
|
|
203
|
+
WATER_SPORTS = 28,
|
|
204
|
+
CLIMBING = 29,
|
|
205
|
+
SNOWBOARDING = 30,
|
|
206
|
+
SKI_TOURING = 31,
|
|
207
|
+
FITNESS_CLASS = 32,
|
|
208
|
+
SOCCER = 33,
|
|
209
|
+
TENNIS = 34,
|
|
210
|
+
BASKETBALL = 35,
|
|
211
|
+
BADMINTON = 36,
|
|
212
|
+
BASEBALL = 37,
|
|
213
|
+
VOLLEYBALL = 38,
|
|
214
|
+
AMERICAN_FOOTBALL = 39,
|
|
215
|
+
TABLE_TENNIS = 40,
|
|
216
|
+
RACQUETBALL = 41,
|
|
217
|
+
SQUASH = 42,
|
|
218
|
+
FLOORBALL = 43,
|
|
219
|
+
HANDBALL = 44,
|
|
220
|
+
SOFTBALL = 45,
|
|
221
|
+
BOWLING = 46,
|
|
222
|
+
CRICKET = 47,
|
|
223
|
+
RUGBY = 48,
|
|
224
|
+
ICE_SKATING = 49,
|
|
225
|
+
ICE_HOCKEY = 50,
|
|
226
|
+
YOGA = 51,
|
|
227
|
+
INDOOR_CYCLING = 52,
|
|
228
|
+
TREADMILL = 53,
|
|
229
|
+
CROSSFIT = 54,
|
|
230
|
+
CROSSTRAINER = 55,
|
|
231
|
+
ROLLER_SKIING = 56,
|
|
232
|
+
INDOOR_ROWING = 57,
|
|
233
|
+
STRETCHING = 58,
|
|
234
|
+
TRACK_AND_FIELD = 59,
|
|
235
|
+
ORIENTEERING = 60,
|
|
236
|
+
SUP = 61,
|
|
237
|
+
COMBAT_SPORTS = 62,
|
|
238
|
+
KETTLEBELL = 63,
|
|
239
|
+
DANCING = 64,
|
|
240
|
+
SNOWSHOEING = 65,
|
|
241
|
+
FRISBEE_GOLF = 66,
|
|
242
|
+
FUTSAL = 67,
|
|
243
|
+
MULTISPORT = 68,
|
|
244
|
+
AEROBICS = 69,
|
|
245
|
+
TREKKING = 70,
|
|
246
|
+
SAILING = 71,
|
|
247
|
+
KAYAKING = 72,
|
|
248
|
+
CIRCUIT_TRAINING = 73,
|
|
249
|
+
TRIATHLON = 74,
|
|
250
|
+
PADEL = 75,
|
|
251
|
+
CHEERLEADING = 76,
|
|
252
|
+
BOXING = 77,
|
|
253
|
+
SCUBADIVING = 78,
|
|
254
|
+
FREEDIVING = 79,
|
|
255
|
+
ADVENTURE_RACING = 80,
|
|
256
|
+
GYMNASTICS = 81,
|
|
257
|
+
CANOEING = 82,
|
|
258
|
+
MOUNTAINEERING = 83,
|
|
259
|
+
TELEMARKSKIING = 84,
|
|
260
|
+
OPENWATER_SWIMMING = 85,
|
|
261
|
+
WINDSURFING = 86,
|
|
262
|
+
KITESURFING_KITING = 87,
|
|
263
|
+
PARAGLIDING = 88,
|
|
264
|
+
SNORKELING = 90,
|
|
265
|
+
SURFING = 91,
|
|
266
|
+
SWIMRUN = 92,
|
|
267
|
+
DUATHLON = 93,
|
|
268
|
+
AQUATHLON = 94,
|
|
269
|
+
OBSTACLE_RACING = 95,
|
|
270
|
+
FISHING = 96,
|
|
271
|
+
HUNTING = 97,
|
|
272
|
+
GRAVEL_CYCLING = 99,
|
|
273
|
+
MERMAIDING = 100,
|
|
274
|
+
SPEARFISHING = 101,
|
|
275
|
+
JUMP_ROPE = 102,
|
|
276
|
+
TRACK_RUNNING = 103,
|
|
277
|
+
CALISTHENICS = 104,
|
|
278
|
+
E_BIKING = 105,
|
|
279
|
+
E_MTB = 106,
|
|
280
|
+
BACKCOUNTRY_SKIING = 107,
|
|
281
|
+
WHEELCHAIR = 108,
|
|
282
|
+
HAND_CYCLING = 109,
|
|
283
|
+
SPLIT_BOARDING = 110,
|
|
284
|
+
BIATHLON = 111,
|
|
285
|
+
MEDITATION = 112,
|
|
286
|
+
FIELD_HOCKEY = 113,
|
|
287
|
+
CYCLOCROSS = 114,
|
|
288
|
+
VERTICAL_RUN = 115,
|
|
289
|
+
SKI_MOUNTAINEERING = 116,
|
|
290
|
+
SKATE_SKIING = 117,
|
|
291
|
+
CLASSIC_SKIING = 118,
|
|
292
|
+
CHORES = 119,
|
|
293
|
+
PILATES = 120,
|
|
294
|
+
NEW_YOGA = 121
|
|
295
|
+
}
|
|
296
|
+
/** Valid values for the `extensions` query param on the single-workout endpoint. */
|
|
297
|
+
declare enum WorkoutExtensionName {
|
|
298
|
+
Dive = "DiveExtension",
|
|
299
|
+
JumpRope = "JumpRopeExtension",
|
|
300
|
+
Summary = "SummaryExtension",
|
|
301
|
+
Swimming = "SwimmingExtension",
|
|
302
|
+
Weather = "WeatherExtension",
|
|
303
|
+
Workout = "WorkoutExtension",
|
|
304
|
+
CompetitionHeader = "CompetitionHeaderExtension"
|
|
305
|
+
}
|
|
306
|
+
/** Valid values for the `additionalData` query param on the single-workout endpoint. */
|
|
307
|
+
declare enum WorkoutAdditionalData {
|
|
308
|
+
Achievements = "achievements",
|
|
309
|
+
Photos = "photos",
|
|
310
|
+
Videos = "videos",
|
|
311
|
+
Comments = "comments",
|
|
312
|
+
UserReacted = "user_reacted"
|
|
313
|
+
}
|
|
314
|
+
interface GetWorkoutParams {
|
|
315
|
+
/** Extensions to include in the response. Defaults to `[Summary, CompetitionHeader]`. */
|
|
316
|
+
extensions?: WorkoutExtensionName[];
|
|
317
|
+
/** Extra data blocks to include. Defaults to all five values. */
|
|
318
|
+
additionalData?: WorkoutAdditionalData[];
|
|
319
|
+
}
|
|
98
320
|
/** GPS coordinate: x = longitude, y = latitude. */
|
|
99
321
|
interface Position {
|
|
100
322
|
x: number;
|
|
@@ -288,8 +510,7 @@ type WorkoutExtension = FitnessExtension | IntensityExtension | SummaryExtension
|
|
|
288
510
|
interface Workout {
|
|
289
511
|
username: string;
|
|
290
512
|
sharingFlags: number;
|
|
291
|
-
|
|
292
|
-
activityId: number;
|
|
513
|
+
activityId: SuuntoActivityType;
|
|
293
514
|
key: string;
|
|
294
515
|
startTime: number;
|
|
295
516
|
stopTime: number;
|
|
@@ -317,7 +538,8 @@ interface Workout {
|
|
|
317
538
|
tss: TssEntry;
|
|
318
539
|
tssList: TssEntry[];
|
|
319
540
|
suuntoTags: string[];
|
|
320
|
-
|
|
541
|
+
/** Absent on some workouts (e.g. when the user has no achievements yet). */
|
|
542
|
+
clientCalculatedAchievements?: ClientCalculatedAchievements;
|
|
321
543
|
workoutKey: string;
|
|
322
544
|
visibilityFacebook: boolean;
|
|
323
545
|
visibilityTwitter: boolean;
|
|
@@ -346,6 +568,16 @@ interface Workout {
|
|
|
346
568
|
comments?: WorkoutComment[];
|
|
347
569
|
/** Only present when reactionCount > 0. */
|
|
348
570
|
reactions?: WorkoutReaction[];
|
|
571
|
+
/** Owner's display name. Returned on feed-style endpoints (e.g. `within`). */
|
|
572
|
+
fullname?: string;
|
|
573
|
+
/** Owner's profile picture URL. Returned on feed-style endpoints. */
|
|
574
|
+
userPhoto?: string;
|
|
575
|
+
/** Owner's cover photo URL. Returned on feed-style endpoints. */
|
|
576
|
+
coverPhoto?: string;
|
|
577
|
+
/** Free-text achievement labels (e.g. "Fastest time on this route"). */
|
|
578
|
+
achievements?: string[];
|
|
579
|
+
/** Average power, watts. Mirrors `SummaryExtension.avgPower` on feed responses. */
|
|
580
|
+
avgPower?: number;
|
|
349
581
|
}
|
|
350
582
|
interface WorkoutsResponse {
|
|
351
583
|
error: string | null;
|
|
@@ -355,76 +587,99 @@ interface WorkoutsResponse {
|
|
|
355
587
|
until: string;
|
|
356
588
|
};
|
|
357
589
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
declare class WorkoutsResource {
|
|
363
|
-
private readonly client;
|
|
364
|
-
constructor(client: HttpClient);
|
|
365
|
-
/** The authenticated user's own workouts. */
|
|
366
|
-
own(params?: GetOwnWorkoutsParams): Promise<WorkoutsResponse>;
|
|
367
|
-
/** A given user's public workouts. */
|
|
368
|
-
public(username: string, params?: GetWorkoutsParams): Promise<WorkoutsResponse>;
|
|
590
|
+
interface WorkoutResponse {
|
|
591
|
+
error: string | null;
|
|
592
|
+
payload: Workout;
|
|
593
|
+
metadata: Record<string, unknown>;
|
|
369
594
|
}
|
|
370
|
-
|
|
371
|
-
interface
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
lastModified: number;
|
|
375
|
-
lastLogin: number;
|
|
376
|
-
realName: string;
|
|
377
|
-
/** ISO 3166-1 alpha-2 country code. */
|
|
378
|
-
country: string;
|
|
379
|
-
gender: string;
|
|
380
|
-
uuid: string;
|
|
381
|
-
blocked: boolean;
|
|
382
|
-
showLocale: boolean;
|
|
383
|
-
followersCount: number;
|
|
384
|
-
followingCount: number;
|
|
385
|
-
currentBlobStorageLocation: string;
|
|
386
|
-
defaultBinaryStorageLocation: string;
|
|
595
|
+
/** Single item from the {@link getWorkoutsWithin} feed: owner + workout. */
|
|
596
|
+
interface WorkoutsWithinItem {
|
|
597
|
+
user: SearchUser;
|
|
598
|
+
workout: Workout;
|
|
387
599
|
}
|
|
388
|
-
interface
|
|
600
|
+
interface WorkoutsWithinResponse {
|
|
389
601
|
error: string | null;
|
|
390
|
-
payload:
|
|
602
|
+
payload: WorkoutsWithinItem[];
|
|
391
603
|
metadata: {
|
|
392
|
-
|
|
604
|
+
workoutcount: string;
|
|
393
605
|
};
|
|
394
606
|
}
|
|
395
|
-
/**
|
|
396
|
-
interface
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
607
|
+
/** Aggregated totals for a single activity type. */
|
|
608
|
+
interface WorkoutStatsEntry {
|
|
609
|
+
/** Suunto activity type ID this entry aggregates. */
|
|
610
|
+
_id: SuuntoActivityType;
|
|
611
|
+
/** Metres. */
|
|
612
|
+
totalDistance: number;
|
|
613
|
+
/** Seconds. */
|
|
614
|
+
totalTime: number;
|
|
615
|
+
/** Kilocalories. */
|
|
616
|
+
energyConsumption: number;
|
|
617
|
+
/** Number of workouts of this activity. */
|
|
618
|
+
numberOfWorkouts: number;
|
|
619
|
+
/** Metres. Only meaningful for dives. */
|
|
620
|
+
maxDepth: number;
|
|
621
|
+
}
|
|
622
|
+
interface WorkoutStats {
|
|
623
|
+
/** Sum of distances across all activities, in metres. */
|
|
624
|
+
totalDistanceSum: number;
|
|
625
|
+
/** Sum of times across all activities, in seconds. */
|
|
626
|
+
totalTimeSum: number;
|
|
627
|
+
/** Sum of energy consumption across all activities, in kilocalories. */
|
|
628
|
+
totalEnergyConsumptionSum: number;
|
|
629
|
+
/** Total workout count across all activities. */
|
|
630
|
+
totalNumberOfWorkoutsSum: number;
|
|
631
|
+
/** Number of distinct days that have at least one workout. */
|
|
632
|
+
totalDays: number;
|
|
633
|
+
/**
|
|
634
|
+
* Per-activity aggregates, restricted to a curated set of activity types
|
|
635
|
+
* (the ones the official UI surfaces as headline cards).
|
|
636
|
+
*/
|
|
637
|
+
allStats: WorkoutStatsEntry[];
|
|
638
|
+
/** Per-activity aggregates covering every activity type the user has recorded. */
|
|
639
|
+
allActualStats: WorkoutStatsEntry[];
|
|
419
640
|
}
|
|
420
|
-
interface
|
|
641
|
+
interface WorkoutStatsResponse {
|
|
421
642
|
error: string | null;
|
|
422
|
-
payload:
|
|
643
|
+
payload: WorkoutStats;
|
|
423
644
|
metadata: {
|
|
424
645
|
ts: string;
|
|
425
646
|
};
|
|
426
647
|
}
|
|
427
648
|
|
|
649
|
+
declare function getWorkouts(client: HttpClient, username: string, params?: GetWorkoutsParams): Promise<WorkoutsResponse>;
|
|
650
|
+
declare function getOwnWorkouts(client: HttpClient, params?: GetOwnWorkoutsParams): Promise<WorkoutsResponse>;
|
|
651
|
+
/**
|
|
652
|
+
* Public workouts whose center position falls inside the given geographic
|
|
653
|
+
* bounding box. Used by the "explore nearby" map view. Unauthenticated.
|
|
654
|
+
*/
|
|
655
|
+
declare function getWorkoutsWithin(client: HttpClient, params: GetWorkoutsWithinParams): Promise<WorkoutsWithinResponse>;
|
|
656
|
+
/**
|
|
657
|
+
* Aggregated workout stats per activity for a user. Unauthenticated — no
|
|
658
|
+
* session required.
|
|
659
|
+
*/
|
|
660
|
+
declare function getWorkoutStats(client: HttpClient, username: string): Promise<WorkoutStatsResponse>;
|
|
661
|
+
/** Workout endpoints, bound to an {@link HttpClient}. Accessed via `suunto.workouts`. */
|
|
662
|
+
declare class WorkoutsResource {
|
|
663
|
+
private readonly client;
|
|
664
|
+
constructor(client: HttpClient);
|
|
665
|
+
/** The authenticated user's own workouts. */
|
|
666
|
+
own(params?: GetOwnWorkoutsParams): Promise<WorkoutsResponse>;
|
|
667
|
+
/** A given user's public workouts. */
|
|
668
|
+
public(username: string, params?: GetWorkoutsParams): Promise<WorkoutsResponse>;
|
|
669
|
+
/**
|
|
670
|
+
* A single workout by username and workout key. Works for any public workout
|
|
671
|
+
* and, when the client is authenticated as the owner, for private ones too.
|
|
672
|
+
*/
|
|
673
|
+
byKey(username: string, workoutKey: string, params?: GetWorkoutParams): Promise<WorkoutResponse>;
|
|
674
|
+
/**
|
|
675
|
+
* Aggregated workout stats per activity for the given user. Works
|
|
676
|
+
* unauthenticated.
|
|
677
|
+
*/
|
|
678
|
+
stats(username: string): Promise<WorkoutStatsResponse>;
|
|
679
|
+
/** Public workouts whose center falls inside a geographic bounding box. */
|
|
680
|
+
within(params: GetWorkoutsWithinParams): Promise<WorkoutsWithinResponse>;
|
|
681
|
+
}
|
|
682
|
+
|
|
428
683
|
/**
|
|
429
684
|
* Fetch a user's public profile by username. Unauthenticated — no session
|
|
430
685
|
* required.
|
|
@@ -508,4 +763,4 @@ declare class SuuntoClient {
|
|
|
508
763
|
static unauthenticated(options?: Omit<SuuntoClientOptions, "email" | "sessionKey">): SuuntoClient;
|
|
509
764
|
}
|
|
510
765
|
|
|
511
|
-
export { type ActivityCounts, type Cadence, type ClientCalculatedAchievements, type CumulativeAchievement, DEFAULT_USER_AGENT, type FitnessExtension, type Gear, GearResource, type GearResponse, type GearSummary, type GetLatestGearParams, type GetOwnWorkoutsParams, type GetWorkoutsParams, type HeartRateRecovery, type HrData, HttpClient, type HttpClientOptions, HttpError, type HttpResponse, type IntensityExtension, type IntensityZone, type IntensityZones, type LoginOptions, type LoginResponse, type PersonalBestAchievement, type Position, type Query, type Rankings, type RequestBody, type RequestContext, type RequestOptions, type RouteRanking, SPORTS_TRACKER_API, type SearchUser, type SummaryExtension, SuuntoClient, type SuuntoClientOptions, type SwimmingHeaderExtension, type TssEntry, type UserProfile, type UserProfileResponse, type UserSearchResponse, type UserSearchResult, UsersResource, type WeatherExtension, type Workout, type WorkoutComment, type WorkoutExtension, type WorkoutReaction, WorkoutsResource, type WorkoutsResponse, generateXtotp, getLatestGear, getOwnWorkouts, getUserByName, getWorkouts, login, searchUsers, secondsUntilRollover, sessionTokenFrom };
|
|
766
|
+
export { type ActivityCounts, type Cadence, type ClientCalculatedAchievements, type CumulativeAchievement, DEFAULT_USER_AGENT, type FitnessExtension, type Gear, GearResource, type GearResponse, type GearSummary, type GetLatestGearParams, type GetOwnWorkoutsParams, type GetWorkoutsParams, type GetWorkoutsWithinParams, type HeartRateRecovery, type HrData, HttpClient, type HttpClientOptions, HttpError, type HttpResponse, type IntensityExtension, type IntensityZone, type IntensityZones, type LoginOptions, type LoginResponse, type PersonalBestAchievement, type Position, type Query, type Rankings, type RequestBody, type RequestContext, type RequestOptions, type RouteRanking, SPORTS_TRACKER_API, type SearchUser, type SummaryExtension, SuuntoActivityType, SuuntoClient, type SuuntoClientOptions, type SwimmingHeaderExtension, type TssEntry, type UserProfile, type UserProfileResponse, type UserSearchResponse, type UserSearchResult, UsersResource, type WeatherExtension, type Workout, type WorkoutComment, type WorkoutExtension, type WorkoutReaction, type WorkoutStats, type WorkoutStatsEntry, type WorkoutStatsResponse, WorkoutsResource, type WorkoutsResponse, type WorkoutsWithinItem, type WorkoutsWithinResponse, generateXtotp, getLatestGear, getOwnWorkouts, getUserByName, getWorkoutStats, getWorkouts, getWorkoutsWithin, login, searchUsers, secondsUntilRollover, sessionTokenFrom };
|