mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-03 20:38:17 +03:00
move KtLogger type to lib/logger/logger
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import winston, { format, transports } from "winston";
|
||||
import { KtLogger } from "../../utils/types";
|
||||
import winston, { format, transports, Logger, LeveledLogMethod } from "winston";
|
||||
|
||||
export type KtLogger = Logger & { severe: LeveledLogMethod };
|
||||
|
||||
const level = process.env.LOG_LEVEL ?? "info";
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
GetDefaultTierlist,
|
||||
GetOneTierlistData,
|
||||
} from "../../../../utils/tierlist";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { DryScore } from "../common/types";
|
||||
import { CreateGameSpecific } from "./game-specific";
|
||||
import { CalculateCHUNITHMRating, CalculateGITADORARating } from "./game-specific-stats";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AnyChartDocument, ESDCore, integer, Grades, Lamps } from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { DryScore } from "../common/types";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AnyChartDocument, ChartDocument, Game, Playtypes, Grades, Lamps } from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { DryScore } from "../common/types";
|
||||
import {
|
||||
CalculateBPI,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { ImportTypes, PublicUserDocument } from "kamaitachi-common";
|
||||
import crypto from "crypto";
|
||||
import { FormatUserDoc } from "../../../../utils/user";
|
||||
import { rootLogger } from "../../../logger/logger";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { rootLogger, KtLogger } from "../../../logger/logger";
|
||||
|
||||
export function CreateImportLoggerAndID(userDoc: PublicUserDocument, importType: ImportTypes) {
|
||||
const importID = crypto.randomBytes(20).toString("hex");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { integer, Game, GoalDocument, UserGoalDocument } from "kamaitachi-common";
|
||||
import { EvaluateGoalForUser } from "../../../../utils/goal";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
|
||||
/**
|
||||
* Update a user's progress on all of their set goals.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import {
|
||||
integer,
|
||||
Game,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { GetKTDataJSON, Testing511SPA, TestingIIDXSPScore } from "../../../../te
|
||||
import { CreatePBDoc } from "./create-pb-doc";
|
||||
import deepmerge from "deepmerge";
|
||||
import CreateLogCtx from "../../../logger/logger";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { lamps } from "kamaitachi-common/js/config";
|
||||
|
||||
let IIDXScore = TestingIIDXSPScore;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { integer, PBScoreDocument, ScoreDocument } from "kamaitachi-common";
|
||||
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { IIDXMergeFn, SDVXMergeFn } from "./game-specific-merge";
|
||||
import { BulkWriteUpdateOneOperation } from "mongodb";
|
||||
export type PBScoreDocumentNoRank = Omit<PBScoreDocument, "rankingData">;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PBScoreDocument, ScoreDocument } from "kamaitachi-common";
|
||||
import { FindChartWithChartID } from "../../../../utils/queries/charts";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { CalculateVF4, CalculateVF5 } from "../calculated-data/game-specific-stats";
|
||||
import { InternalFailure } from "../common/converter-failures";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { integer, PBScoreDocument } from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { CreatePBDoc, UpdateChartRanking, PBScoreDocumentNoRank } from "./create-pb-doc";
|
||||
|
||||
export async function ProcessPBs(
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
integer,
|
||||
IDStrings,
|
||||
} from "kamaitachi-common";
|
||||
import { KtLogger } from "../../../utils/types";
|
||||
import { KtLogger } from "../../../lib/logger/logger";
|
||||
import { ImportAllIterableData } from "./score-importing/score-importing";
|
||||
import { CreateImportLoggerAndID } from "./common/import-logger";
|
||||
import { CreateSessions } from "./sessions/sessions";
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ScoreDocument,
|
||||
AnySongDocument,
|
||||
} from "kamaitachi-common";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { CreateCalculatedData } from "../calculated-data/calculated-data";
|
||||
import { CalculateESDForGame } from "../common/score-utils";
|
||||
import { DryScore } from "../common/types";
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
import { CreateScoreID } from "./score-id";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { AppendLogCtx } from "../../../logger/logger";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import {
|
||||
ConverterFunctionReturns,
|
||||
ConverterFnReturn,
|
||||
|
||||
@@ -10,12 +10,12 @@ import {
|
||||
Game,
|
||||
} from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { AppendLogCtx } from "../../../logger/logger";
|
||||
import { AppendLogCtx, KtLogger } from "../../../logger/logger";
|
||||
import { GenerateRandomSessionName } from "./name-generation";
|
||||
import crypto from "crypto";
|
||||
import { CreateSessionCalcData } from "./performance-calc";
|
||||
import { GetScoresFromSession } from "../../../../utils/session";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
|
||||
import { ScorePlaytypeMap } from "../common/types";
|
||||
|
||||
const TWO_HOURS = 1000 * 60 * 60 * 2;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Game, Playtypes, integer, UserGameStats, ClassDelta } from "kamaitachi-common";
|
||||
import { gameClassValues } from "kamaitachi-common/js/game-classes";
|
||||
import deepmerge from "deepmerge";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { CalculateGitadoraColour, CalculateJubeatColour } from "./builtin-class-handlers";
|
||||
import { ReturnClassIfGreater } from "../../../../utils/class";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Game, Playtypes, integer, GameSpecificCalcLookup, IDStrings } from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
|
||||
export async function CalculateRatings(
|
||||
game: Game,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import { Game, Playtypes, integer, UserGameStats, ClassDelta } from "kamaitachi-common";
|
||||
import db from "../../../../external/mongo/db";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { CalculateClassDeltas, UpdateUGSClasses, ClassHandler } from "./classes";
|
||||
import { CalculateRatings, CalculateCustomRatings } from "./rating";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { ParseKaiIIDX } from "../../common/api-kai/iidx/parser";
|
||||
import { KaiAuthDocument } from "kamaitachi-common";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { KaiAuthDocument } from "kamaitachi-common";
|
||||
import { ParseKaiSDVX } from "../../common/api-kai/sdvx/parser";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { ParseKaiIIDX } from "../../common/api-kai/iidx/parser";
|
||||
import { KaiAuthDocument } from "kamaitachi-common";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { KaiAuthDocument } from "kamaitachi-common";
|
||||
import { ParseKaiSDVX } from "../../common/api-kai/sdvx/parser";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import nodeFetch from "../../../../../utils/fetch";
|
||||
import { KaiAuthDocument } from "kamaitachi-common";
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
AssertStrAsPositiveInt,
|
||||
} from "../../../framework/common/string-asserts";
|
||||
import { GenericGetGradeAndPercent } from "../../../framework/common/score-utils";
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { DryScore } from "../../../framework/common/types";
|
||||
import { ConverterFunction, ConverterFnReturn } from "../types";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import { BatchManual, BatchManualContext, BatchManualScore } from "./types";
|
||||
import p, { PrudenceSchema, ValidSchemaValue } from "prudence";
|
||||
|
||||
@@ -10,7 +10,7 @@ import ScoreImportFatalError from "../../../framework/score-importing/score-impo
|
||||
import { GetGradeFromPercent } from "../../../framework/common/score-utils";
|
||||
import { AssertStrAsPositiveInt } from "../../../framework/common/string-asserts";
|
||||
import { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types";
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { DryScore } from "../../../framework/common/types";
|
||||
import { ConverterFunction, ConverterFnReturn } from "../types";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Difficulties } from "kamaitachi-common";
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import { ParserFunctionReturnsSync } from "../types";
|
||||
import ConverterFn from "./converter";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import { ParseBatchManualFromObject } from "../../common/batch-manual/parser";
|
||||
import { BatchManualContext, BatchManualScore } from "../../common/batch-manual/types";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import GenericParseEamIIDXCSV from "../../common/eamusement-iidx-csv/parser";
|
||||
import {
|
||||
IIDXEamusementCSVContext,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import GenericParseEamIIDXCSV from "../../common/eamusement-iidx-csv/parser";
|
||||
import {
|
||||
IIDXEamusementCSVContext,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { ParseBatchManualFromObject } from "../../common/batch-manual/parser";
|
||||
import { BatchManualContext, BatchManualScore } from "../../common/batch-manual/types";
|
||||
import { ParserFunctionReturnsSync } from "../../common/types";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import p, { PrudenceSchema } from "prudence";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import { FormatPrError } from "../../../../../utils/prudence";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import p, { PrudenceSchema, ValidSchemaValue } from "prudence";
|
||||
import ScoreImportFatalError from "../../../framework/score-importing/score-import-error";
|
||||
import { FormatPrError, optNull } from "../../../../../utils/prudence";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { USCClientScore } from "../../../../../server/router/ir/usc/usc";
|
||||
import { FindSongOnID } from "../../../../../utils/queries/songs";
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { InternalFailure, InvalidScoreFailure } from "../../../framework/common/converter-failures";
|
||||
import { GenericGetGradeAndPercent } from "../../../framework/common/score-utils";
|
||||
import { IRUSCContext } from "./types";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { KtLogger } from "../../../../../utils/types";
|
||||
import { KtLogger } from "../../../../../lib/logger/logger";
|
||||
import { ChartDocument } from "kamaitachi-common";
|
||||
import p, { PrudenceSchema } from "prudence";
|
||||
import { InvalidScoreFailure } from "../../../framework/common/converter-failures";
|
||||
|
||||
@@ -7,7 +7,7 @@ import CreateLogCtx from "../../../../lib/logger/logger";
|
||||
import prValidate from "../../../middleware/prudence-validate";
|
||||
import { RequireLoggedIn } from "../../../middleware/require-logged-in";
|
||||
import ScoreImportFatalError from "../../../../lib/score-import/framework/score-importing/score-import-error";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { ExpressWrappedScoreImportMain } from "../../../../lib/score-import/framework/express-wrapper";
|
||||
import { CreateMulterSingleUploadMiddleware } from "../../../middleware/multer-upload";
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import CreateLogCtx from "../../../../lib/logger/logger";
|
||||
import { CreatePOSTScoresResponseBody, KtchiScoreToServerScore } from "./usc";
|
||||
import { ExpressWrappedScoreImportMain } from "../../../../lib/score-import/framework/express-wrapper";
|
||||
import { GetUserWithID } from "../../../../utils/user";
|
||||
import { KtLogger } from "../../../../utils/types";
|
||||
import { KtLogger } from "../../../../lib/logger/logger";
|
||||
import { ParseIRUSC } from "../../../../lib/score-import/import-types/ir/usc/parser";
|
||||
import { USCIR_MAX_LEADERBOARD_N } from "../../../../lib/constants/usc-ir";
|
||||
import { CreateMulterSingleUploadMiddleware } from "../../../middleware/multer-upload";
|
||||
|
||||
@@ -26,8 +26,6 @@ export interface KTSuccessResponse {
|
||||
|
||||
export type KTReponse = KTFailResponse | KTSuccessResponse;
|
||||
|
||||
export type KtLogger = Logger & { severe: LeveledLogMethod };
|
||||
|
||||
/**
|
||||
* Clarity type for empty objects - such as in context.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user