mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-14 13:55:20 +01:00
[Refactor] Consolidate typings/ into @types/, and API types (#6823)
This commit is contained in:
parent
fd92bcd2a4
commit
7456c11be1
@ -20,6 +20,7 @@ module.exports = {
|
|||||||
comment: "Files in 'enums/' and '@types/' must only use type imports.",
|
comment: "Files in 'enums/' and '@types/' must only use type imports.",
|
||||||
from: {
|
from: {
|
||||||
path: ["(^|/)src/@types", "(^|/)src/enums"],
|
path: ["(^|/)src/@types", "(^|/)src/enums"],
|
||||||
|
pathNot: ["(^|/)src/@types/phaser[.]d[.]ts"],
|
||||||
},
|
},
|
||||||
to: {
|
to: {
|
||||||
dependencyTypesNot: ["type-only"],
|
dependencyTypesNot: ["type-only"],
|
||||||
|
|||||||
147
src/@types/api.ts
Normal file
147
src/@types/api.ts
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
||||||
|
|
||||||
|
export interface UserInfo {
|
||||||
|
username: string;
|
||||||
|
lastSessionSlot: number;
|
||||||
|
discordId: string;
|
||||||
|
googleId: string;
|
||||||
|
hasAdminRole: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TitleStatsResponse {
|
||||||
|
playerCount: number;
|
||||||
|
battleCount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #region Account API
|
||||||
|
|
||||||
|
export interface AccountInfoResponse extends UserInfo {}
|
||||||
|
|
||||||
|
export interface AccountLoginRequest {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccountLoginResponse {
|
||||||
|
token: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccountRegisterRequest {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AccountChangePwRequest {
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
export interface AccountChangePwResponse {
|
||||||
|
success: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
// #region Admin API
|
||||||
|
|
||||||
|
export interface SearchAccountRequest {
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DiscordRequest extends SearchAccountRequest {
|
||||||
|
discordId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GoogleRequest extends SearchAccountRequest {
|
||||||
|
googleId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SearchAccountResponse {
|
||||||
|
username: string;
|
||||||
|
discordId: string;
|
||||||
|
googleId: string;
|
||||||
|
lastLoggedIn: string;
|
||||||
|
registered: string;
|
||||||
|
systemData?: SystemSaveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Third party login services */
|
||||||
|
export type AdminUiHandlerService = "discord" | "google";
|
||||||
|
/** Mode for the admin UI handler */
|
||||||
|
export type AdminUiHandlerServiceMode = "Link" | "Unlink";
|
||||||
|
|
||||||
|
export interface PokerogueAdminApiParams extends Record<AdminUiHandlerService, SearchAccountRequest> {
|
||||||
|
discord: DiscordRequest;
|
||||||
|
google: GoogleRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
|
||||||
|
export interface UpdateAllSavedataRequest {
|
||||||
|
system: SystemSaveData;
|
||||||
|
session: SessionSaveData;
|
||||||
|
sessionSlotId: number;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #region Session Save API
|
||||||
|
|
||||||
|
export interface UpdateSessionSavedataRequest {
|
||||||
|
slot: number;
|
||||||
|
trainerId: number;
|
||||||
|
secretId: number;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** This is **NOT** related to {@linkcode ClearSessionSavedataRequest} */
|
||||||
|
export interface NewClearSessionSavedataRequest {
|
||||||
|
slot: number;
|
||||||
|
isVictory: boolean;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetSessionSavedataRequest {
|
||||||
|
slot: number;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DeleteSessionSavedataRequest {
|
||||||
|
slot: number;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** This is **NOT** related to {@linkcode NewClearSessionSavedataRequest} */
|
||||||
|
export interface ClearSessionSavedataRequest {
|
||||||
|
slot: number;
|
||||||
|
trainerId: number;
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Pokerogue API response for path: `/savedata/session/clear` */
|
||||||
|
export interface ClearSessionSavedataResponse {
|
||||||
|
/** Contains the error message if any occured */
|
||||||
|
error?: string;
|
||||||
|
/** Is `true` if the request was successfully processed */
|
||||||
|
success?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
|
// #region System Save API
|
||||||
|
|
||||||
|
export interface GetSystemSavedataRequest {
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateSystemSavedataRequest {
|
||||||
|
clientSessionId: string;
|
||||||
|
trainerId?: number;
|
||||||
|
secretId?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VerifySystemSavedataRequest {
|
||||||
|
clientSessionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VerifySystemSavedataResponse {
|
||||||
|
valid: boolean;
|
||||||
|
systemData: SystemSaveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
// #endregion
|
||||||
@ -1,24 +0,0 @@
|
|||||||
import type { UserInfo } from "#types/user-info";
|
|
||||||
|
|
||||||
export interface AccountInfoResponse extends UserInfo {}
|
|
||||||
|
|
||||||
export interface AccountLoginRequest {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AccountLoginResponse {
|
|
||||||
token: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AccountRegisterRequest {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AccountChangePwRequest {
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
export interface AccountChangePwResponse {
|
|
||||||
success: boolean;
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
import type { SystemSaveData } from "#types/save-data";
|
|
||||||
|
|
||||||
export interface SearchAccountRequest {
|
|
||||||
username: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DiscordRequest extends SearchAccountRequest {
|
|
||||||
discordId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GoogleRequest extends SearchAccountRequest {
|
|
||||||
googleId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SearchAccountResponse {
|
|
||||||
username: string;
|
|
||||||
discordId: string;
|
|
||||||
googleId: string;
|
|
||||||
lastLoggedIn: string;
|
|
||||||
registered: string;
|
|
||||||
systemData?: SystemSaveData;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Third party login services */
|
|
||||||
export type AdminUiHandlerService = "discord" | "google";
|
|
||||||
/** Mode for the admin UI handler */
|
|
||||||
export type AdminUiHandlerServiceMode = "Link" | "Unlink";
|
|
||||||
|
|
||||||
export interface PokerogueAdminApiParams extends Record<AdminUiHandlerService, SearchAccountRequest> {
|
|
||||||
discord: DiscordRequest;
|
|
||||||
google: GoogleRequest;
|
|
||||||
}
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
export interface TitleStatsResponse {
|
|
||||||
playerCount: number;
|
|
||||||
battleCount: number;
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
|
||||||
|
|
||||||
export interface UpdateAllSavedataRequest {
|
|
||||||
system: SystemSaveData;
|
|
||||||
session: SessionSaveData;
|
|
||||||
sessionSlotId: number;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
export interface UpdateSessionSavedataRequest {
|
|
||||||
slot: number;
|
|
||||||
trainerId: number;
|
|
||||||
secretId: number;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** This is **NOT** similar to {@linkcode ClearSessionSavedataRequest} */
|
|
||||||
export interface NewClearSessionSavedataRequest {
|
|
||||||
slot: number;
|
|
||||||
isVictory: boolean;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GetSessionSavedataRequest {
|
|
||||||
slot: number;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeleteSessionSavedataRequest {
|
|
||||||
slot: number;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** This is **NOT** similar to {@linkcode NewClearSessionSavedataRequest} */
|
|
||||||
export interface ClearSessionSavedataRequest {
|
|
||||||
slot: number;
|
|
||||||
trainerId: number;
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pokerogue API response for path: `/savedata/session/clear`
|
|
||||||
*/
|
|
||||||
export interface ClearSessionSavedataResponse {
|
|
||||||
/** Contains the error message if any occured */
|
|
||||||
error?: string;
|
|
||||||
/** Is `true` if the request was successfully processed */
|
|
||||||
success?: boolean;
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import type { SystemSaveData } from "#types/save-data";
|
|
||||||
|
|
||||||
export interface GetSystemSavedataRequest {
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UpdateSystemSavedataRequest {
|
|
||||||
clientSessionId: string;
|
|
||||||
trainerId?: number;
|
|
||||||
secretId?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface VerifySystemSavedataRequest {
|
|
||||||
clientSessionId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface VerifySystemSavedataResponse {
|
|
||||||
valid: boolean;
|
|
||||||
systemData: SystemSaveData;
|
|
||||||
}
|
|
||||||
@ -1,10 +1,12 @@
|
|||||||
import type { ScoreboardCategory } from "#ui/daily-run-scoreboard";
|
import type { ScoreboardCategory } from "#ui/daily-run-scoreboard";
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
export interface GetDailyRankingsRequest {
|
export interface GetDailyRankingsRequest {
|
||||||
category: ScoreboardCategory;
|
category: ScoreboardCategory;
|
||||||
page?: number;
|
page?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
export interface GetDailyRankingsPageCountRequest {
|
export interface GetDailyRankingsPageCountRequest {
|
||||||
category: ScoreboardCategory;
|
category: ScoreboardCategory;
|
||||||
}
|
}
|
||||||
@ -131,7 +131,7 @@ export type RunHistoryData = Record<number, RunEntry>;
|
|||||||
export interface RunEntry {
|
export interface RunEntry {
|
||||||
entry: SessionSaveData;
|
entry: SessionSaveData;
|
||||||
isVictory: boolean;
|
isVictory: boolean;
|
||||||
/*Automatically set to false at the moment - implementation TBD*/
|
/** Automatically set to false at the moment - implementation TBD */
|
||||||
isFavorite: boolean;
|
isFavorite: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
16
src/@types/save-migrators.ts
Normal file
16
src/@types/save-migrators.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
||||||
|
|
||||||
|
export interface SessionSaveMigrator {
|
||||||
|
version: string;
|
||||||
|
migrate: (data: SessionSaveData) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SettingsSaveMigrator {
|
||||||
|
version: string;
|
||||||
|
migrate: (data: object) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SystemSaveMigrator {
|
||||||
|
version: string;
|
||||||
|
migrate: (data: SystemSaveData) => void;
|
||||||
|
}
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import type { SessionSaveData } from "./save-data";
|
|
||||||
|
|
||||||
export interface SessionSaveMigrator {
|
|
||||||
version: string;
|
|
||||||
migrate: (data: SessionSaveData) => void;
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
export interface SettingsSaveMigrator {
|
|
||||||
version: string;
|
|
||||||
// biome-ignore lint/complexity/noBannedTypes: TODO - refactor settings
|
|
||||||
migrate: (data: Object) => void;
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
import type { SystemSaveData } from "./save-data";
|
|
||||||
|
|
||||||
export interface SystemSaveMigrator {
|
|
||||||
version: string;
|
|
||||||
migrate: (data: SystemSaveData) => void;
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
export interface UserInfo {
|
|
||||||
username: string;
|
|
||||||
lastSessionSlot: number;
|
|
||||||
discordId: string;
|
|
||||||
googleId: string;
|
|
||||||
hasAdminRole: boolean;
|
|
||||||
}
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { pokerogueApi } from "#api/pokerogue-api";
|
import { pokerogueApi } from "#api/pokerogue-api";
|
||||||
import { bypassLogin } from "#constants/app-constants";
|
import { bypassLogin } from "#constants/app-constants";
|
||||||
import type { UserInfo } from "#types/user-info";
|
import type { UserInfo } from "#types/api";
|
||||||
import { randomString } from "#utils/common";
|
import { randomString } from "#utils/common";
|
||||||
|
|
||||||
export let loggedInUser: UserInfo | null = null;
|
export let loggedInUser: UserInfo | null = null;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import type {
|
|||||||
AccountLoginRequest,
|
AccountLoginRequest,
|
||||||
AccountLoginResponse,
|
AccountLoginResponse,
|
||||||
AccountRegisterRequest,
|
AccountRegisterRequest,
|
||||||
} from "#types/api/pokerogue-account-api";
|
} from "#types/api";
|
||||||
import { removeCookie, setCookie } from "#utils/cookies";
|
import { removeCookie, setCookie } from "#utils/cookies";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import type {
|
|||||||
PokerogueAdminApiParams,
|
PokerogueAdminApiParams,
|
||||||
SearchAccountRequest,
|
SearchAccountRequest,
|
||||||
SearchAccountResponse,
|
SearchAccountResponse,
|
||||||
} from "#types/api/pokerogue-admin-api";
|
} from "#types/api";
|
||||||
|
|
||||||
export class PokerogueAdminApi extends ApiBase {
|
export class PokerogueAdminApi extends ApiBase {
|
||||||
public readonly ERR_USERNAME_NOT_FOUND: string = "Username not found!";
|
public readonly ERR_USERNAME_NOT_FOUND: string = "Username not found!";
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { PokerogueAccountApi } from "#api/pokerogue-account-api";
|
|||||||
import { PokerogueAdminApi } from "#api/pokerogue-admin-api";
|
import { PokerogueAdminApi } from "#api/pokerogue-admin-api";
|
||||||
import { PokerogueDailyApi } from "#api/pokerogue-daily-api";
|
import { PokerogueDailyApi } from "#api/pokerogue-daily-api";
|
||||||
import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api";
|
import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api";
|
||||||
import type { TitleStatsResponse } from "#types/api/pokerogue-api-types";
|
import type { TitleStatsResponse } from "#types/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for PokéRogue API requests.
|
* A wrapper for PokéRogue API requests.
|
||||||
|
|||||||
@ -1,13 +1,11 @@
|
|||||||
import { ApiBase } from "#api/api-base";
|
import { ApiBase } from "#api/api-base";
|
||||||
import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/api/pokerogue-daily-api";
|
import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/pokerogue-daily-api";
|
||||||
import type { RankingEntry } from "#ui/daily-run-scoreboard";
|
import type { RankingEntry } from "#ui/daily-run-scoreboard";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for daily-run PokéRogue API requests.
|
* A wrapper for daily-run PokéRogue API requests.
|
||||||
*/
|
*/
|
||||||
export class PokerogueDailyApi extends ApiBase {
|
export class PokerogueDailyApi extends ApiBase {
|
||||||
//#region Public
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Request the daily-run seed.
|
* Request the daily-run seed.
|
||||||
* @returns The active daily-run seed as `string`.
|
* @returns The active daily-run seed as `string`.
|
||||||
@ -25,6 +23,7 @@ export class PokerogueDailyApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Get the daily rankings for a {@linkcode ScoreboardCategory}.
|
* Get the daily rankings for a {@linkcode ScoreboardCategory}.
|
||||||
* @param params The {@linkcode GetDailyRankingsRequest} to send
|
* @param params The {@linkcode GetDailyRankingsRequest} to send
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public async getRankings(params: GetDailyRankingsRequest) {
|
public async getRankings(params: GetDailyRankingsRequest) {
|
||||||
try {
|
try {
|
||||||
@ -41,6 +40,7 @@ export class PokerogueDailyApi extends ApiBase {
|
|||||||
/**
|
/**
|
||||||
* Get the page count of the daily rankings for a {@linkcode ScoreboardCategory}.
|
* Get the page count of the daily rankings for a {@linkcode ScoreboardCategory}.
|
||||||
* @param params The {@linkcode GetDailyRankingsPageCountRequest} to send.
|
* @param params The {@linkcode GetDailyRankingsPageCountRequest} to send.
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public async getRankingsPageCount(params: GetDailyRankingsPageCountRequest) {
|
public async getRankingsPageCount(params: GetDailyRankingsPageCountRequest) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { ApiBase } from "#api/api-base";
|
|||||||
import { PokerogueSessionSavedataApi } from "#api/pokerogue-session-savedata-api";
|
import { PokerogueSessionSavedataApi } from "#api/pokerogue-session-savedata-api";
|
||||||
import { PokerogueSystemSavedataApi } from "#api/pokerogue-system-savedata-api";
|
import { PokerogueSystemSavedataApi } from "#api/pokerogue-system-savedata-api";
|
||||||
import { MAX_INT_ATTR_VALUE } from "#app/constants";
|
import { MAX_INT_ATTR_VALUE } from "#app/constants";
|
||||||
import type { UpdateAllSavedataRequest } from "#types/api/pokerogue-save-data-api";
|
import type { UpdateAllSavedataRequest } from "#types/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for PokéRogue savedata API requests.
|
* A wrapper for PokéRogue savedata API requests.
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import type {
|
|||||||
GetSessionSavedataRequest,
|
GetSessionSavedataRequest,
|
||||||
NewClearSessionSavedataRequest,
|
NewClearSessionSavedataRequest,
|
||||||
UpdateSessionSavedataRequest,
|
UpdateSessionSavedataRequest,
|
||||||
} from "#types/api/pokerogue-session-save-data-api";
|
} from "#types/api";
|
||||||
import type { SessionSaveData } from "#types/save-data";
|
import type { SessionSaveData } from "#types/save-data";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import type {
|
|||||||
UpdateSystemSavedataRequest,
|
UpdateSystemSavedataRequest,
|
||||||
VerifySystemSavedataRequest,
|
VerifySystemSavedataRequest,
|
||||||
VerifySystemSavedataResponse,
|
VerifySystemSavedataResponse,
|
||||||
} from "#types/api/pokerogue-system-save-data-api";
|
} from "#types/api";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A wrapper for PokéRogue system savedata API requests.
|
* A wrapper for PokéRogue system savedata API requests.
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
|
|
||||||
import { version } from "#package.json";
|
import { version } from "#package.json";
|
||||||
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
||||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
import type { SessionSaveMigrator, SettingsSaveMigrator, SystemSaveMigrator } from "#types/save-migrators";
|
||||||
import type { SettingsSaveMigrator } from "#types/settings-save-migrator";
|
|
||||||
import type { SystemSaveMigrator } from "#types/system-save-migrator";
|
|
||||||
import { compareVersions } from "compare-versions";
|
import { compareVersions } from "compare-versions";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -5,9 +5,7 @@ import { AbilityAttr } from "#enums/ability-attr";
|
|||||||
import { DexAttr } from "#enums/dex-attr";
|
import { DexAttr } from "#enums/dex-attr";
|
||||||
import { SettingKeys } from "#system/settings";
|
import { SettingKeys } from "#system/settings";
|
||||||
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
||||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
import type { SessionSaveMigrator, SettingsSaveMigrator, SystemSaveMigrator } from "#types/save-migrators";
|
||||||
import type { SettingsSaveMigrator } from "#types/settings-save-migrator";
|
|
||||||
import type { SystemSaveMigrator } from "#types/system-save-migrator";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate ability starter data if empty for caught species.
|
* Migrate ability starter data if empty for caught species.
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import type { MoveId } from "#enums/move-id";
|
|||||||
import type { MoveResult } from "#enums/move-result";
|
import type { MoveResult } from "#enums/move-result";
|
||||||
import { MoveUseMode } from "#enums/move-use-mode";
|
import { MoveUseMode } from "#enums/move-use-mode";
|
||||||
import type { SessionSaveData } from "#types/save-data";
|
import type { SessionSaveData } from "#types/save-data";
|
||||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
import type { SessionSaveMigrator } from "#types/save-migrators";
|
||||||
import type { TurnMove } from "#types/turn-move";
|
import type { TurnMove } from "#types/turn-move";
|
||||||
|
|
||||||
/** Prior signature of `TurnMove`; used to ensure parity */
|
/** Prior signature of `TurnMove`; used to ensure parity */
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { DexAttr } from "#enums/dex-attr";
|
import { DexAttr } from "#enums/dex-attr";
|
||||||
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
import type { SessionSaveData, SystemSaveData } from "#types/save-data";
|
||||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
import type { SessionSaveMigrator, SystemSaveMigrator } from "#types/save-migrators";
|
||||||
import type { SystemSaveMigrator } from "#types/system-save-migrator";
|
|
||||||
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
import { getPokemonSpecies, getPokemonSpeciesForm } from "#utils/pokemon-utils";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { DexAttr } from "#enums/dex-attr";
|
import { DexAttr } from "#enums/dex-attr";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import type { SystemSaveData } from "#types/save-data";
|
import type { SystemSaveData } from "#types/save-data";
|
||||||
import type { SystemSaveMigrator } from "#types/system-save-migrator";
|
import type { SystemSaveMigrator } from "#types/save-migrators";
|
||||||
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
import { getPokemonSpecies } from "#utils/pokemon-utils";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { MoveId } from "#enums/move-id";
|
|||||||
import { PokemonMove } from "#moves/pokemon-move";
|
import { PokemonMove } from "#moves/pokemon-move";
|
||||||
import type { PokemonData } from "#system/pokemon-data";
|
import type { PokemonData } from "#system/pokemon-data";
|
||||||
import type { SessionSaveData } from "#types/save-data";
|
import type { SessionSaveData } from "#types/save-data";
|
||||||
import type { SessionSaveMigrator } from "#types/session-save-migrator";
|
import type { SessionSaveMigrator } from "#types/save-migrators";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate all lingering rage fist data inside `CustomPokemonData`,
|
* Migrate all lingering rage fist data inside `CustomPokemonData`,
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import { executeIf } from "#utils/common";
|
|||||||
import { getEnumKeys } from "#utils/enums";
|
import { getEnumKeys } from "#utils/enums";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
export interface RankingEntry {
|
export interface RankingEntry {
|
||||||
rank: number;
|
rank: number;
|
||||||
username: string;
|
username: string;
|
||||||
@ -15,11 +16,13 @@ export interface RankingEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Don't forget to update translations when adding a new category
|
// Don't forget to update translations when adding a new category
|
||||||
|
/** @deprecated */
|
||||||
export enum ScoreboardCategory {
|
export enum ScoreboardCategory {
|
||||||
DAILY,
|
DAILY,
|
||||||
WEEKLY,
|
WEEKLY,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||||
private loadingLabel: Phaser.GameObjects.Text;
|
private loadingLabel: Phaser.GameObjects.Text;
|
||||||
private titleLabel: Phaser.GameObjects.Text;
|
private titleLabel: Phaser.GameObjects.Text;
|
||||||
|
|||||||
@ -6,11 +6,7 @@ import { Button } from "#enums/buttons";
|
|||||||
import { TextStyle } from "#enums/text-style";
|
import { TextStyle } from "#enums/text-style";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import { GameData } from "#system/game-data";
|
import { GameData } from "#system/game-data";
|
||||||
import type {
|
import type { AdminUiHandlerService, AdminUiHandlerServiceMode, SearchAccountResponse } from "#types/api";
|
||||||
AdminUiHandlerService,
|
|
||||||
AdminUiHandlerServiceMode,
|
|
||||||
SearchAccountResponse,
|
|
||||||
} from "#types/api/pokerogue-admin-api";
|
|
||||||
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
|
import type { InputFieldConfig } from "#ui/form-modal-ui-handler";
|
||||||
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
|
import { FormModalUiHandler } from "#ui/form-modal-ui-handler";
|
||||||
import type { ModalConfig } from "#ui/modal-ui-handler";
|
import type { ModalConfig } from "#ui/modal-ui-handler";
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { PokerogueAccountApi } from "#api/pokerogue-account-api";
|
|||||||
import { SESSION_ID_COOKIE_NAME } from "#app/constants";
|
import { SESSION_ID_COOKIE_NAME } from "#app/constants";
|
||||||
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
||||||
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
||||||
import type { AccountInfoResponse } from "#types/api/pokerogue-account-api";
|
import type { AccountInfoResponse } from "#types/api";
|
||||||
import * as CookieUtils from "#utils/cookies";
|
import * as CookieUtils from "#utils/cookies";
|
||||||
import * as cookies from "#utils/cookies";
|
import * as cookies from "#utils/cookies";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
|
|||||||
@ -1,12 +1,7 @@
|
|||||||
import { PokerogueAdminApi } from "#api/pokerogue-admin-api";
|
import { PokerogueAdminApi } from "#api/pokerogue-admin-api";
|
||||||
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
||||||
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
||||||
import type {
|
import type { DiscordRequest, GoogleRequest, SearchAccountRequest, SearchAccountResponse } from "#types/api";
|
||||||
DiscordRequest,
|
|
||||||
GoogleRequest,
|
|
||||||
SearchAccountRequest,
|
|
||||||
SearchAccountResponse,
|
|
||||||
} from "#types/api/pokerogue-admin-api";
|
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { pokerogueApi } from "#api/pokerogue-api";
|
import { pokerogueApi } from "#api/pokerogue-api";
|
||||||
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
||||||
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
||||||
import type { TitleStatsResponse } from "#types/api/pokerogue-api-types";
|
import type { TitleStatsResponse } from "#types/api";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { PokerogueDailyApi } from "#api/pokerogue-daily-api";
|
import { PokerogueDailyApi } from "#api/pokerogue-daily-api";
|
||||||
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
||||||
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
||||||
import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/api/pokerogue-daily-api";
|
import type { GetDailyRankingsPageCountRequest, GetDailyRankingsRequest } from "#types/pokerogue-daily-api";
|
||||||
import { type RankingEntry, ScoreboardCategory } from "#ui/daily-run-scoreboard";
|
import { type RankingEntry, ScoreboardCategory } from "#ui/daily-run-scoreboard";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api";
|
import { PokerogueSavedataApi } from "#api/pokerogue-savedata-api";
|
||||||
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
import { initServerForApiTests } from "#test/test-utils/test-file-initialization";
|
||||||
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
import { getApiBaseUrl } from "#test/test-utils/test-utils";
|
||||||
import type { UpdateAllSavedataRequest } from "#types/api/pokerogue-save-data-api";
|
import type { UpdateAllSavedataRequest } from "#types/api";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import type {
|
|||||||
GetSessionSavedataRequest,
|
GetSessionSavedataRequest,
|
||||||
NewClearSessionSavedataRequest,
|
NewClearSessionSavedataRequest,
|
||||||
UpdateSessionSavedataRequest,
|
UpdateSessionSavedataRequest,
|
||||||
} from "#types/api/pokerogue-session-save-data-api";
|
} from "#types/api";
|
||||||
import type { SessionSaveData } from "#types/save-data";
|
import type { SessionSaveData } from "#types/save-data";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import type {
|
|||||||
UpdateSystemSavedataRequest,
|
UpdateSystemSavedataRequest,
|
||||||
VerifySystemSavedataRequest,
|
VerifySystemSavedataRequest,
|
||||||
VerifySystemSavedataResponse,
|
VerifySystemSavedataResponse,
|
||||||
} from "#types/api/pokerogue-system-save-data-api";
|
} from "#types/api";
|
||||||
import type { SystemSaveData } from "#types/save-data";
|
import type { SystemSaveData } from "#types/save-data";
|
||||||
import { HttpResponse, http } from "msw";
|
import { HttpResponse, http } from "msw";
|
||||||
import type { SetupServerApi } from "msw/node";
|
import type { SetupServerApi } from "msw/node";
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
"./src/system/*.ts"
|
"./src/system/*.ts"
|
||||||
],
|
],
|
||||||
"#trainers/*": ["./src/data/trainers/*.ts"],
|
"#trainers/*": ["./src/data/trainers/*.ts"],
|
||||||
"#types/*": ["./src/@types/helpers/*.ts", "./src/@types/*.ts", "./src/typings/phaser/*.ts"],
|
"#types/*": ["./src/@types/*.ts"],
|
||||||
"#ui/*": [
|
"#ui/*": [
|
||||||
"./src/ui/battle-info/*.ts",
|
"./src/ui/battle-info/*.ts",
|
||||||
"./src/ui/containers/*.ts",
|
"./src/ui/containers/*.ts",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user