mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-08 14:58:12 +03:00
rename SYMBOL_TachiAPIData to TachiAPIAuth
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import crypto from "crypto";
|
||||
import { CONF_INFO } from "../lib/setup/config";
|
||||
import { Game, Playtypes } from "tachi-common";
|
||||
import { validPlaytypes } from "tachi-common/js/config";
|
||||
|
||||
// https://github.com/sindresorhus/escape-string-regexp/blob/main/index.js
|
||||
// the developer of this has migrated everything to Force ES6 style modules,
|
||||
@@ -58,3 +61,11 @@ export function SplitAuthorizationHeader(authHeader: string) {
|
||||
export function HasOwnProperty<T>(obj: T, key: string | number | symbol): key is keyof T {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
export function IsValidGame(str: string): str is Game {
|
||||
return !!CONF_INFO.SUPPORTED_GAMES.includes(str as Game);
|
||||
}
|
||||
|
||||
export function IsValidPlaytype(game: Game, str: string): str is Playtypes[Game] {
|
||||
return validPlaytypes[game].includes(str as Playtypes[Game]);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { integer, ChartDocument } from "tachi-common";
|
||||
import { integer, ChartDocument, PublicUserDocument, UserGameStats } from "tachi-common";
|
||||
|
||||
declare module "express-session" {
|
||||
// Inject additional properties on express-session
|
||||
@@ -36,4 +36,7 @@ export interface TachiRequestData {
|
||||
uscChartDoc?: ChartDocument<"usc:Single">;
|
||||
|
||||
beatorajaChartDoc?: ChartDocument<"bms:7K" | "bms:14K">;
|
||||
|
||||
requestedUser?: PublicUserDocument;
|
||||
requestedUserGameStats?: UserGameStats;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user