Add a command to download all battle results from SplatNet 3

This commit is contained in:
Samuel Elliott
2022-09-09 21:53:46 +01:00
parent 0821235a89
commit 203a54be44
4 changed files with 129 additions and 1 deletions

View File

@@ -655,6 +655,20 @@ interface HomeBanner {
jumpTo: string;
}
/** 994cf141e55213e6923426caf37a1934 VsHistoryDetailPagerRefetchQuery */
export interface VsHistoryDetailPagerRefetchQueryResult {
vsHistoryDetail: {
__typename: 'VsHistoryDetail';
nextHistoryDetail: {
id: string;
} | null;
previousHistoryDetail: {
id: string;
} | null;
id: string;
};
}
/** cd82f2ade8aca7687947c5f3210805a6 VsHistoryDetailQuery */
export interface VsHistoryDetailResult {
vsHistoryDetail: VsHistoryDetail;

View File

@@ -110,16 +110,30 @@ export default class SplatNet3Api {
return this.persistedQuery<RegularBattleHistoriesResult>(RequestId.RegularBattleHistoriesQuery, {});
}
async getBankaraBattleHistories() {
return this.persistedQuery<BankaraBattleHistoriesResult>(RequestId.BankaraBattleHistoriesQuery, {});
}
async getPrivateBattleHistories() {
return this.persistedQuery<PrivateBattleHistoriesResult>(RequestId.PrivateBattleHistoriesQuery, {});
}
async getVsHistoryDetail(id: string) {
async getBattleHistoryDetail(id: string) {
return this.persistedQuery<VsHistoryDetailResult>(RequestId.VsHistoryDetailQuery, {
vsResultId: id,
});
}
async getBattleHistoryDetailPagerRefetch(id: string) {
return this.persistedQuery<VsHistoryDetailResult>(RequestId.VsHistoryDetailPagerRefetchQuery, {
vsResultId: id,
});
}
async getCoopHistory() {
return this.persistedQuery<unknown>(RequestId.CoopHistoryQuery, {});
}
static async createWithCoral(nso: CoralApi, user: NintendoAccountUser) {
const data = await this.loginWithCoral(nso, user);
return {splatnet: this.createWithSavedToken(data), data};