[feature] can now login to Steam with QRCode + ipc management optimization

This commit is contained in:
MathieuG-P
2023-08-02 02:36:36 +02:00
parent 82bca18f3f
commit 922aad7867
35 changed files with 950 additions and 643 deletions
@@ -0,0 +1,72 @@
export enum DepotDownloaderEventType {
Error = "Error",
Warning = "Warning",
Info = "Info",
}
export interface DepotDownloaderEvent<T = unknown> {
type: DepotDownloaderEventType;
subType: DepotDownloaderEventTypes;
data?: T;
}
export type DepotDownloaderEventTypes = DepotDownloaderErrorEvent | DepotDownloaderWarningEvent | DepotDownloaderInfoEvent;
export enum DepotDownloaderInfoEvent {
Start = "Start",
Password = "Password",
Guard = "Guard",
TwoFA = "2FA",
Progress = "Progress",
Validated = "Validated",
Finished = "Finished",
SteamID = "SteamID",
QRCode = "QRCode",
MobileApp = "MobileApp",
}
export enum DepotDownloaderErrorEvent {
Password = "Password",
InvalidCredentials = "InvalidCredentials",
NoManifest = "NoManifest",
DirectoryCreate = "DirectoryCreate",
NotAvailableApp = "NotAvailableApp",
DepotNotFound = "DepotNotFound",
NotCompleted = "NotCompleted",
InvalidManifest = "InvalidManifest",
NoValidKeys = "NoValidKeys",
NoManifestCode = "NoManifestCode",
_401 = "401",
_404 = "404",
NoServer = "NoServer",
SteamLib = "SteamLib",
NotAllowed = "NotAllowed",
ConnectionTimeout = "ConnectionTimeout",
ConnectionError = "ConnectionError",
TokenRejected = "TokenRejected",
LicenceError = "LicenceError",
Unknown = "Unknown",
}
export enum DepotDownloaderWarningEvent {
ManifestChecksum = "ManifestChecksum",
}
export const DepotDownloaderSubTypeOfEventType = {
[DepotDownloaderEventType.Error]: DepotDownloaderErrorEvent,
[DepotDownloaderEventType.Warning]: DepotDownloaderWarningEvent,
[DepotDownloaderEventType.Info]: DepotDownloaderInfoEvent,
}
export interface DepotDownloaderArgsOptions {
app: number|string,
depot: number|string,
manifest: number|string,
username?: string,
password?: string,
"remember-password"?: boolean,
dir: string,
validate?: boolean,
qr?: boolean,
}
@@ -6,5 +6,6 @@ export interface IpcResponse<T> {
success: boolean;
}
export type IpcErrorChannel = string & `${string}_error`;
export type IpcCompleteChannel = string & `${string}_complete`;
export type IpcErrorChannel = `${string}_error`;
export type IpcCompleteChannel = `${string}_complete`;
export type IpcTearDownChannel = `${string}_teardown`;