feat: mobile/app API enhancements

This commit is contained in:
acx10
2026-03-10 21:41:29 -06:00
committed by acx10
parent c336ace238
commit 185422810d
84 changed files with 1936 additions and 643 deletions
@@ -10,7 +10,7 @@ import { BookFileProgress } from '../../book/model/book.model';
providedIn: 'root'
})
export class AudiobookService {
private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/audiobook`;
private readonly baseUrl = `${API_CONFIG.BASE_URL}/api/v1/audiobooks`;
private readonly booksUrl = `${API_CONFIG.BASE_URL}/api/v1/books`;
private http = inject(HttpClient);
@@ -8,7 +8,7 @@ import {EmailProvider} from '../email-provider.model';
providedIn: 'root'
})
export class EmailV2ProviderService {
private readonly url = `${API_CONFIG.BASE_URL}/api/v2/email/providers`;
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/email/providers`;
private http = inject(HttpClient);
@@ -8,7 +8,7 @@ import {EmailRecipient} from '../email-recipient.model';
providedIn: 'root'
})
export class EmailV2RecipientService {
private readonly url = `${API_CONFIG.BASE_URL}/api/v2/email/recipients`;
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/email/recipients`;
private http = inject(HttpClient);
@@ -8,7 +8,7 @@ import {Observable} from 'rxjs';
})
export class EmailService {
private readonly apiUrl = `${API_CONFIG.BASE_URL}/api/v2/email`;
private readonly apiUrl = `${API_CONFIG.BASE_URL}/api/v1/email`;
private http = inject(HttpClient);
@@ -85,27 +85,27 @@ export class UserStatsService {
getHeatmapForYear(year: number): Observable<ReadingSessionHeatmapResponse[]> {
return this.http.get<ReadingSessionHeatmapResponse[]>(
`${this.readingSessionsUrl}/heatmap`,
`${this.readingSessionsUrl}/reading/heatmap`,
{params: {year: year.toString()}}
);
}
getTimelineForWeek(year: number, week: number): Observable<ReadingSessionTimelineResponse[]> {
return this.http.get<ReadingSessionTimelineResponse[]>(
`${this.readingSessionsUrl}/timeline`,
`${this.readingSessionsUrl}/reading/timeline`,
{params: {year: year.toString(), week: week.toString()}}
);
}
getGenreStats(): Observable<GenreStatsResponse[]> {
return this.http.get<GenreStatsResponse[]>(
`${this.readingSessionsUrl}/genres`
`${this.readingSessionsUrl}/reading/genres`
);
}
getCompletionTimelineForYear(year: number): Observable<CompletionTimelineResponse[]> {
return this.http.get<CompletionTimelineResponse[]>(
`${this.readingSessionsUrl}/completion-timeline`,
`${this.readingSessionsUrl}/reading/completion-timeline`,
{params: {year: year.toString()}}
);
}
@@ -120,7 +120,7 @@ export class UserStatsService {
}
return this.http.get<FavoriteDaysResponse[]>(
`${this.readingSessionsUrl}/favorite-days`,
`${this.readingSessionsUrl}/reading/favorite-days`,
{params}
);
}
@@ -135,33 +135,33 @@ export class UserStatsService {
}
return this.http.get<PeakHoursResponse[]>(
`${this.readingSessionsUrl}/peak-hours`,
`${this.readingSessionsUrl}/reading/peak-hours`,
{params}
);
}
getPageTurnerScores(): Observable<PageTurnerScoreResponse[]> {
return this.http.get<PageTurnerScoreResponse[]>(
`${this.readingSessionsUrl}/page-turner-scores`
`${this.readingSessionsUrl}/reading/page-turner-scores`
);
}
getCompletionRace(year: number): Observable<CompletionRaceResponse[]> {
return this.http.get<CompletionRaceResponse[]>(
`${this.readingSessionsUrl}/completion-race`,
`${this.readingSessionsUrl}/reading/completion-race`,
{params: {year: year.toString()}}
);
}
getReadingDates(): Observable<ReadingSessionHeatmapResponse[]> {
return this.http.get<ReadingSessionHeatmapResponse[]>(
`${this.readingSessionsUrl}/reading-dates`
`${this.readingSessionsUrl}/reading/dates`
);
}
getSessionScatter(year: number): Observable<SessionScatterResponse[]> {
return this.http.get<SessionScatterResponse[]>(
`${this.readingSessionsUrl}/session-scatter`,
`${this.readingSessionsUrl}/reading/session-scatter`,
{params: {year: year.toString()}}
);
}