details
This commit is contained in:
@@ -6,6 +6,7 @@ import { firstValueFrom } from 'rxjs';
|
||||
import { StravaRateLimitError } from './strava-rate-limit.error';
|
||||
import {
|
||||
StravaActivityPayload,
|
||||
StravaLapPayload,
|
||||
StravaStreamPayload,
|
||||
StravaStreamsResponse,
|
||||
StravaTokenPayload,
|
||||
@@ -61,12 +62,17 @@ export class StravaClientService {
|
||||
accessToken: string,
|
||||
page: number,
|
||||
perPage = 100,
|
||||
after?: number,
|
||||
): Promise<StravaActivityPayload[]> {
|
||||
return this.request<StravaActivityPayload[]>({
|
||||
method: 'GET',
|
||||
url: 'https://www.strava.com/api/v3/athlete/activities',
|
||||
headers: this.authHeaders(accessToken),
|
||||
params: { page, per_page: perPage },
|
||||
params: {
|
||||
page,
|
||||
per_page: perPage,
|
||||
...(after ? { after } : {}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -98,6 +104,17 @@ export class StravaClientService {
|
||||
return this.normalizeStreamsResponse(streams);
|
||||
}
|
||||
|
||||
async getActivityLaps(
|
||||
accessToken: string,
|
||||
stravaActivityId: string,
|
||||
): Promise<StravaLapPayload[]> {
|
||||
return this.request<StravaLapPayload[]>({
|
||||
method: 'GET',
|
||||
url: `https://www.strava.com/api/v3/activities/${stravaActivityId}/laps`,
|
||||
headers: this.authHeaders(accessToken),
|
||||
});
|
||||
}
|
||||
|
||||
private async postToken(
|
||||
body: Record<string, string>,
|
||||
): Promise<StravaTokenPayload> {
|
||||
|
||||
Reference in New Issue
Block a user