2024-06-03 20:39:37 +00:00
|
|
|
import type { DownloadSourceStatus, Downloader } from "@shared";
|
2024-09-13 22:56:27 +00:00
|
|
|
import type { SteamAppDetails } from "./steam.types";
|
2024-04-29 18:50:10 +00:00
|
|
|
|
2024-06-27 13:55:50 +00:00
|
|
|
export type GameStatus =
|
|
|
|
| "active"
|
|
|
|
| "waiting"
|
|
|
|
| "paused"
|
|
|
|
| "error"
|
|
|
|
| "complete"
|
|
|
|
| "removed";
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export type GameShop = "steam" | "epic";
|
|
|
|
|
2024-07-10 22:52:57 +00:00
|
|
|
export type FriendRequestAction = "ACCEPTED" | "REFUSED" | "CANCEL";
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export interface GameRepack {
|
|
|
|
id: number;
|
|
|
|
title: string;
|
2024-08-18 00:39:50 +00:00
|
|
|
/**
|
|
|
|
* @deprecated Use uris instead
|
|
|
|
*/
|
2024-04-18 07:46:06 +00:00
|
|
|
magnet: string;
|
2024-08-18 00:39:50 +00:00
|
|
|
uris: string[];
|
2024-04-18 07:46:06 +00:00
|
|
|
repacker: string;
|
|
|
|
fileSize: string | null;
|
|
|
|
uploadDate: Date | string | null;
|
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-04-28 18:21:14 +00:00
|
|
|
export type ShopDetails = SteamAppDetails & {
|
|
|
|
objectID: string;
|
|
|
|
};
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export interface TorrentFile {
|
|
|
|
path: string;
|
|
|
|
length: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Used by the catalogue */
|
|
|
|
export interface CatalogueEntry {
|
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
|
|
|
title: string;
|
|
|
|
/* Epic Games covers cannot be guessed with objectID */
|
|
|
|
cover: string;
|
|
|
|
repacks: GameRepack[];
|
|
|
|
}
|
|
|
|
|
2024-06-16 21:39:28 +00:00
|
|
|
export interface UserGame {
|
2024-09-11 23:53:16 +00:00
|
|
|
objectId: string;
|
2024-06-13 03:39:11 +00:00
|
|
|
shop: GameShop;
|
|
|
|
title: string;
|
2024-06-14 18:08:35 +00:00
|
|
|
iconUrl: string | null;
|
|
|
|
cover: string;
|
2024-06-14 17:46:30 +00:00
|
|
|
playTimeInSeconds: number;
|
|
|
|
lastTimePlayed: Date | null;
|
2024-06-13 03:39:11 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 14:33:47 +00:00
|
|
|
export interface DownloadQueue {
|
|
|
|
id: number;
|
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
/* Used by the library */
|
2024-06-03 15:43:49 +00:00
|
|
|
export interface Game {
|
2024-04-18 07:46:06 +00:00
|
|
|
id: number;
|
|
|
|
title: string;
|
|
|
|
iconUrl: string;
|
2024-06-27 13:55:50 +00:00
|
|
|
status: GameStatus | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
folderName: string;
|
|
|
|
downloadPath: string | null;
|
|
|
|
repacks: GameRepack[];
|
|
|
|
progress: number;
|
|
|
|
bytesDownloaded: number;
|
|
|
|
playTimeInMilliseconds: number;
|
2024-05-05 18:18:48 +00:00
|
|
|
downloader: Downloader;
|
2024-04-18 07:46:06 +00:00
|
|
|
executablePath: string | null;
|
|
|
|
lastTimePlayed: Date | null;
|
2024-06-08 18:18:24 +00:00
|
|
|
uri: string | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
fileSize: number;
|
2024-06-03 15:43:49 +00:00
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
2024-06-04 14:33:47 +00:00
|
|
|
downloadQueue: DownloadQueue | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-06-03 15:43:49 +00:00
|
|
|
export type LibraryGame = Omit<Game, "repacks">;
|
|
|
|
|
2024-06-20 21:09:49 +00:00
|
|
|
export interface GameRunning {
|
2024-08-19 23:02:41 +00:00
|
|
|
id?: number;
|
2024-06-19 22:07:36 +00:00
|
|
|
title: string;
|
2024-08-19 22:56:20 +00:00
|
|
|
iconUrl: string | null;
|
2024-06-19 22:07:36 +00:00
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
2024-06-20 14:27:09 +00:00
|
|
|
sessionDurationInMillis: number;
|
2024-06-19 22:07:36 +00:00
|
|
|
}
|
|
|
|
|
2024-05-20 01:21:11 +00:00
|
|
|
export interface DownloadProgress {
|
2024-04-18 07:46:06 +00:00
|
|
|
downloadSpeed: number;
|
|
|
|
timeRemaining: number;
|
|
|
|
numPeers: number;
|
|
|
|
numSeeds: number;
|
2024-05-28 13:01:28 +00:00
|
|
|
isDownloadingMetadata: boolean;
|
2024-06-27 16:18:48 +00:00
|
|
|
isCheckingFiles: boolean;
|
|
|
|
progress: number;
|
|
|
|
gameId: number;
|
2024-06-03 15:43:49 +00:00
|
|
|
game: LibraryGame;
|
2024-04-18 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserPreferences {
|
|
|
|
downloadsPath: string | null;
|
|
|
|
language: string;
|
|
|
|
downloadNotificationsEnabled: boolean;
|
|
|
|
repackUpdatesNotificationsEnabled: boolean;
|
2024-04-29 18:52:53 +00:00
|
|
|
realDebridApiToken: string | null;
|
2024-05-03 17:58:45 +00:00
|
|
|
preferQuitInsteadOfHiding: boolean;
|
2024-05-05 23:11:12 +00:00
|
|
|
runAtStartup: boolean;
|
2024-04-18 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface HowLongToBeatCategory {
|
|
|
|
title: string;
|
|
|
|
duration: string;
|
|
|
|
accuracy: string;
|
|
|
|
}
|
2024-05-13 08:35:29 +00:00
|
|
|
|
|
|
|
export interface Steam250Game {
|
|
|
|
title: string;
|
|
|
|
objectID: string;
|
|
|
|
}
|
2024-05-18 20:55:12 +00:00
|
|
|
|
|
|
|
export interface SteamGame {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
clientIcon: string | null;
|
|
|
|
}
|
2024-05-19 04:39:50 +00:00
|
|
|
|
2024-05-23 23:26:21 +00:00
|
|
|
export type AppUpdaterEvent =
|
2024-06-02 05:21:03 +00:00
|
|
|
| { type: "update-available"; info: { version: string } }
|
|
|
|
| { type: "update-downloaded" };
|
2024-05-23 23:26:21 +00:00
|
|
|
|
|
|
|
/* Events */
|
|
|
|
export interface StartGameDownloadPayload {
|
|
|
|
repackId: number;
|
|
|
|
objectID: string;
|
|
|
|
title: string;
|
|
|
|
shop: GameShop;
|
2024-08-18 00:39:50 +00:00
|
|
|
uri: string;
|
2024-05-23 23:26:21 +00:00
|
|
|
downloadPath: string;
|
|
|
|
downloader: Downloader;
|
|
|
|
}
|
2024-05-28 13:01:28 +00:00
|
|
|
|
2024-07-09 01:07:14 +00:00
|
|
|
export interface UserFriend {
|
|
|
|
id: string;
|
|
|
|
displayName: string;
|
|
|
|
profileImageUrl: string | null;
|
2024-09-11 23:53:16 +00:00
|
|
|
createdAt: string;
|
|
|
|
updatedAt: string;
|
2024-07-09 01:07:14 +00:00
|
|
|
}
|
|
|
|
|
2024-07-21 19:35:02 +00:00
|
|
|
export interface UserFriends {
|
|
|
|
totalFriends: number;
|
|
|
|
friends: UserFriend[];
|
|
|
|
}
|
|
|
|
|
2024-08-14 22:45:48 +00:00
|
|
|
export interface UserBlocks {
|
|
|
|
totalBlocks: number;
|
|
|
|
blocks: UserFriend[];
|
|
|
|
}
|
|
|
|
|
2024-07-10 22:52:57 +00:00
|
|
|
export interface FriendRequest {
|
2024-07-11 00:04:45 +00:00
|
|
|
id: string;
|
2024-07-10 17:29:04 +00:00
|
|
|
displayName: string;
|
|
|
|
profileImageUrl: string | null;
|
|
|
|
type: "SENT" | "RECEIVED";
|
2024-07-09 01:07:14 +00:00
|
|
|
}
|
|
|
|
|
2024-07-25 22:27:03 +00:00
|
|
|
export interface UserRelation {
|
|
|
|
AId: string;
|
|
|
|
BId: string;
|
|
|
|
status: "ACCEPTED" | "PENDING";
|
|
|
|
createdAt: string;
|
|
|
|
updatedAt: string;
|
|
|
|
}
|
|
|
|
|
2024-09-12 23:03:58 +00:00
|
|
|
export interface UserProfileCurrentGame extends Omit<GameRunning, "objectID"> {
|
|
|
|
objectId: string;
|
2024-09-11 23:53:16 +00:00
|
|
|
sessionDurationInSeconds: number;
|
|
|
|
}
|
|
|
|
|
2024-06-12 01:09:24 +00:00
|
|
|
export interface UserProfile {
|
2024-06-15 22:52:37 +00:00
|
|
|
id: string;
|
2024-06-13 23:02:41 +00:00
|
|
|
displayName: string;
|
2024-06-14 21:23:57 +00:00
|
|
|
profileImageUrl: string | null;
|
2024-07-30 19:42:48 +00:00
|
|
|
profileVisibility: "PUBLIC" | "PRIVATE" | "FRIENDS";
|
2024-06-22 04:47:20 +00:00
|
|
|
totalPlayTimeInSeconds: number;
|
2024-07-17 22:03:32 +00:00
|
|
|
libraryGames: UserGame[];
|
|
|
|
recentGames: UserGame[];
|
2024-07-29 22:10:53 +00:00
|
|
|
friends: UserFriend[];
|
|
|
|
totalFriends: number;
|
2024-07-25 22:27:03 +00:00
|
|
|
relation: UserRelation | null;
|
2024-09-11 23:53:16 +00:00
|
|
|
currentGame: UserProfileCurrentGame | null;
|
2024-06-12 01:09:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 23:53:16 +00:00
|
|
|
export interface UpdateProfileRequest {
|
2024-08-07 02:17:12 +00:00
|
|
|
displayName?: string;
|
|
|
|
profileVisibility?: "PUBLIC" | "PRIVATE" | "FRIENDS";
|
|
|
|
profileImageUrl?: string | null;
|
|
|
|
bio?: string;
|
|
|
|
}
|
|
|
|
|
2024-06-03 01:12:05 +00:00
|
|
|
export interface DownloadSource {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
repackCount: number;
|
2024-06-03 20:39:37 +00:00
|
|
|
status: DownloadSourceStatus;
|
2024-06-05 13:18:40 +00:00
|
|
|
downloadCount: number;
|
2024-06-03 20:39:37 +00:00
|
|
|
etag: string | null;
|
2024-06-03 01:12:05 +00:00
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
2024-09-12 23:03:58 +00:00
|
|
|
|
|
|
|
export interface GameStats {
|
|
|
|
downloadCount: number;
|
|
|
|
playerCount: number;
|
|
|
|
}
|
2024-09-13 00:04:38 +00:00
|
|
|
|
2024-09-12 23:39:49 +00:00
|
|
|
export interface TrendingGame {
|
|
|
|
uri: string;
|
|
|
|
description: string;
|
|
|
|
background: string;
|
2024-09-14 16:16:31 +00:00
|
|
|
logo: string | null;
|
2024-09-12 23:39:49 +00:00
|
|
|
}
|
2024-09-13 22:56:27 +00:00
|
|
|
|
2024-09-14 19:55:00 +00:00
|
|
|
export interface UserStats {
|
|
|
|
libraryCount: number;
|
|
|
|
friendsCount: number;
|
|
|
|
}
|
|
|
|
|
2024-09-13 22:56:27 +00:00
|
|
|
export * from "./steam.types";
|
|
|
|
export * from "./real-debrid.types";
|