From 491bf6ecd289f462f8be36587557dddb4ed97be7 Mon Sep 17 00:00:00 2001 From: zkldi Date: Fri, 30 Apr 2021 01:38:38 +0100 Subject: [PATCH] Move a lot of stuff --- server/src/internal-api/import/import.ts | 2 +- .../{core => }/calculated-data/calculated-data.test.ts | 8 ++++---- .../{core => }/calculated-data/calculated-data.ts | 2 +- .../calculated-data/game-specific-stats.test.ts | 8 ++++---- .../{core => }/calculated-data/game-specific-stats.ts | 4 ++-- .../{core => }/calculated-data/game-specific.test.ts | 8 ++++---- .../{core => }/calculated-data/game-specific.ts | 4 ++-- .../framework/{core => common}/import-logger.ts | 0 .../framework/{core => common}/string-asserts.test.ts | 2 +- .../framework/{core => common}/string-asserts.ts | 2 +- .../{core => importing}/converter-failures.ts | 0 .../framework/{core => importing}/hydrate-score.ts | 2 +- .../framework/{core => importing}/insert-score.test.ts | 2 +- .../framework/{core => importing}/insert-score.ts | 0 .../framework/{core => importing}/score-id.test.ts | 0 .../framework/{core => importing}/score-id.ts | 0 .../{core => importing}/score-import-error.test.ts | 0 .../{core => importing}/score-import-error.ts | 0 .../framework/importing/score-importing.ts | 8 ++++---- .../framework/{core => importing}/score-utils.ts | 0 .../framework/{core => }/pb/create-pb-doc.test.ts | 10 +++++----- .../framework/{core => }/pb/create-pb-doc.ts | 4 ++-- .../framework/{core => }/pb/game-specific-merge.ts | 4 ++-- .../framework/{core => }/pb/process-pbs.test.ts | 8 ++++---- .../framework/{core => }/pb/process-pbs.ts | 4 ++-- server/src/score-import/framework/score-import-main.ts | 8 ++++---- .../framework/{core => }/sessions/name-generation.ts | 2 +- .../framework/{core => }/sessions/performance-calc.ts | 0 .../framework/{core => }/sessions/sessions.ts | 8 ++++---- .../file/csv-eamusement-iidx/converter.test.ts | 2 +- .../import-types/file/csv-eamusement-iidx/converter.ts | 8 ++++---- .../file/csv-eamusement-iidx/parser.test.ts | 2 +- .../import-types/file/csv-eamusement-iidx/parser.ts | 2 +- server/src/types.ts | 2 +- 34 files changed, 58 insertions(+), 58 deletions(-) rename server/src/score-import/framework/{core => }/calculated-data/calculated-data.test.ts (82%) rename server/src/score-import/framework/{core => }/calculated-data/calculated-data.ts (94%) rename server/src/score-import/framework/{core => }/calculated-data/game-specific-stats.test.ts (94%) rename server/src/score-import/framework/{core => }/calculated-data/game-specific-stats.ts (95%) rename server/src/score-import/framework/{core => }/calculated-data/game-specific.test.ts (89%) rename server/src/score-import/framework/{core => }/calculated-data/game-specific.ts (92%) rename server/src/score-import/framework/{core => common}/import-logger.ts (100%) rename server/src/score-import/framework/{core => common}/string-asserts.test.ts (98%) rename server/src/score-import/framework/{core => common}/string-asserts.ts (93%) rename server/src/score-import/framework/{core => importing}/converter-failures.ts (100%) rename server/src/score-import/framework/{core => importing}/hydrate-score.ts (92%) rename server/src/score-import/framework/{core => importing}/insert-score.test.ts (94%) rename server/src/score-import/framework/{core => importing}/insert-score.ts (100%) rename server/src/score-import/framework/{core => importing}/score-id.test.ts (100%) rename server/src/score-import/framework/{core => importing}/score-id.ts (100%) rename server/src/score-import/framework/{core => importing}/score-import-error.test.ts (100%) rename server/src/score-import/framework/{core => importing}/score-import-error.ts (100%) rename server/src/score-import/framework/{core => importing}/score-utils.ts (100%) rename server/src/score-import/framework/{core => }/pb/create-pb-doc.test.ts (96%) rename server/src/score-import/framework/{core => }/pb/create-pb-doc.ts (98%) rename server/src/score-import/framework/{core => }/pb/game-specific-merge.ts (95%) rename server/src/score-import/framework/{core => }/pb/process-pbs.test.ts (88%) rename server/src/score-import/framework/{core => }/pb/process-pbs.ts (93%) rename server/src/score-import/framework/{core => }/sessions/name-generation.ts (71%) rename server/src/score-import/framework/{core => }/sessions/performance-calc.ts (100%) rename server/src/score-import/framework/{core => }/sessions/sessions.ts (97%) diff --git a/server/src/internal-api/import/import.ts b/server/src/internal-api/import/import.ts index 855274e95..f4722ee05 100644 --- a/server/src/internal-api/import/import.ts +++ b/server/src/internal-api/import/import.ts @@ -8,7 +8,7 @@ import { GetUserWithID } from "../../core/user-core"; import CreateLogCtx from "../../logger"; import prValidate from "../../middleware/prudence-validate"; import { RequireLoggedIn } from "../../middleware/require-logged-in"; -import ScoreImportFatalError from "../../score-import/framework/core/score-import-error"; +import ScoreImportFatalError from "../../score-import/framework/common/score-import-error"; import ScoreImportMain from "../../score-import/framework/score-import-main"; import ParseEamusementCSV from "../../score-import/import-types/file/csv-eamusement-iidx/parser"; diff --git a/server/src/score-import/framework/core/calculated-data/calculated-data.test.ts b/server/src/score-import/framework/calculated-data/calculated-data.test.ts similarity index 82% rename from server/src/score-import/framework/core/calculated-data/calculated-data.test.ts rename to server/src/score-import/framework/calculated-data/calculated-data.test.ts index 8a31a5982..86d7be582 100644 --- a/server/src/score-import/framework/core/calculated-data/calculated-data.test.ts +++ b/server/src/score-import/framework/calculated-data/calculated-data.test.ts @@ -1,14 +1,14 @@ import Pr from "prudence"; import t from "tap"; -import { CloseMongoConnection } from "../../../../db/db"; -import CreateLogCtx from "../../../../logger"; -import { prAssert } from "../../../../test-utils/asserts"; +import { CloseMongoConnection } from "../../../db/db"; +import CreateLogCtx from "../../../logger"; +import { prAssert } from "../../../test-utils/asserts"; import { Testing511SPA, TestingDoraChart, TestingGITADORADoraDryScore, TestingIIDXSPDryScore, -} from "../../../../test-utils/test-data"; +} from "../../../test-utils/test-data"; import { CreateCalculatedData } from "./calculated-data"; const mockLogger = CreateLogCtx("calculated-data.test.ts"); diff --git a/server/src/score-import/framework/core/calculated-data/calculated-data.ts b/server/src/score-import/framework/calculated-data/calculated-data.ts similarity index 94% rename from server/src/score-import/framework/core/calculated-data/calculated-data.ts rename to server/src/score-import/framework/calculated-data/calculated-data.ts index 914c5c1bc..c4b45556e 100644 --- a/server/src/score-import/framework/core/calculated-data/calculated-data.ts +++ b/server/src/score-import/framework/calculated-data/calculated-data.ts @@ -8,7 +8,7 @@ import { TierlistDataDocument, } from "kamaitachi-common"; import { Logger } from "winston"; -import { DryScore } from "../../../../types"; +import { DryScore } from "../../../types"; import { CreateGameSpecific } from "./game-specific"; import { CalculateCHUNITHMRating, CalculateGITADORARating } from "./game-specific-stats"; diff --git a/server/src/score-import/framework/core/calculated-data/game-specific-stats.test.ts b/server/src/score-import/framework/calculated-data/game-specific-stats.test.ts similarity index 94% rename from server/src/score-import/framework/core/calculated-data/game-specific-stats.test.ts rename to server/src/score-import/framework/calculated-data/game-specific-stats.test.ts index 5601700f6..61e6c8eab 100644 --- a/server/src/score-import/framework/core/calculated-data/game-specific-stats.test.ts +++ b/server/src/score-import/framework/calculated-data/game-specific-stats.test.ts @@ -1,6 +1,6 @@ import t from "tap"; -import { CloseMongoConnection } from "../../../../db/db"; -import { DryScore } from "../../../../types"; +import { CloseMongoConnection } from "../../../db/db"; +import { DryScore } from "../../../types"; import { AnyChartDocument, Difficulties, Lamps, ScoreDocument } from "kamaitachi-common"; import { CalculateBPI, @@ -12,8 +12,8 @@ import { CalculateVF5, KaidenPercentile, } from "./game-specific-stats"; -import CreateLogCtx from "../../../../logger"; -import { isApproximately } from "../../../../test-utils/asserts"; +import CreateLogCtx from "../../../logger"; +import { isApproximately } from "../../../test-utils/asserts"; t.test("#CalculateBPI", (t) => { t.test("AA BPI tests", (t) => { diff --git a/server/src/score-import/framework/core/calculated-data/game-specific-stats.ts b/server/src/score-import/framework/calculated-data/game-specific-stats.ts similarity index 95% rename from server/src/score-import/framework/core/calculated-data/game-specific-stats.ts rename to server/src/score-import/framework/calculated-data/game-specific-stats.ts index 28d9b4603..b8bcc6deb 100644 --- a/server/src/score-import/framework/core/calculated-data/game-specific-stats.ts +++ b/server/src/score-import/framework/calculated-data/game-specific-stats.ts @@ -1,7 +1,7 @@ import { AnyChartDocument, ChartDocument, ESDCore, integer } from "kamaitachi-common"; import { Logger } from "winston"; -import db from "../../../../db/db"; -import { DryScore } from "../../../../types"; +import db from "../../../db/db"; +import { DryScore } from "../../../types"; /** * Calculates the in-game CHUNITHM rating for a score. diff --git a/server/src/score-import/framework/core/calculated-data/game-specific.test.ts b/server/src/score-import/framework/calculated-data/game-specific.test.ts similarity index 89% rename from server/src/score-import/framework/core/calculated-data/game-specific.test.ts rename to server/src/score-import/framework/calculated-data/game-specific.test.ts index af2cc5f39..f31e4331b 100644 --- a/server/src/score-import/framework/core/calculated-data/game-specific.test.ts +++ b/server/src/score-import/framework/calculated-data/game-specific.test.ts @@ -1,13 +1,13 @@ import Pr from "prudence"; import t from "tap"; -import { CloseMongoConnection } from "../../../../db/db"; -import CreateLogCtx from "../../../../logger"; -import { prAssert } from "../../../../test-utils/asserts"; +import { CloseMongoConnection } from "../../../db/db"; +import CreateLogCtx from "../../../logger"; +import { prAssert } from "../../../test-utils/asserts"; import { Testing511SPA, TestingIIDXSPDryScore, TestingSDVXSingleDryScore, -} from "../../../../test-utils/test-data"; +} from "../../../test-utils/test-data"; import { CreateGameSpecific } from "./game-specific"; const logger = CreateLogCtx("fake-testing-context"); diff --git a/server/src/score-import/framework/core/calculated-data/game-specific.ts b/server/src/score-import/framework/calculated-data/game-specific.ts similarity index 92% rename from server/src/score-import/framework/core/calculated-data/game-specific.ts rename to server/src/score-import/framework/calculated-data/game-specific.ts index f7b3b55b6..66b1231d8 100644 --- a/server/src/score-import/framework/core/calculated-data/game-specific.ts +++ b/server/src/score-import/framework/calculated-data/game-specific.ts @@ -1,7 +1,7 @@ import { AnyChartDocument, ChartDocument, Game, Playtypes } from "kamaitachi-common"; import { Logger } from "winston"; -import db from "../../../../db/db"; -import { DryScore } from "../../../../types"; +import db from "../../../db/db"; +import { DryScore } from "../../../types"; import { CalculateBPI, CalculateKESDC, diff --git a/server/src/score-import/framework/core/import-logger.ts b/server/src/score-import/framework/common/import-logger.ts similarity index 100% rename from server/src/score-import/framework/core/import-logger.ts rename to server/src/score-import/framework/common/import-logger.ts diff --git a/server/src/score-import/framework/core/string-asserts.test.ts b/server/src/score-import/framework/common/string-asserts.test.ts similarity index 98% rename from server/src/score-import/framework/core/string-asserts.test.ts rename to server/src/score-import/framework/common/string-asserts.test.ts index db75d5fc4..e4e0d600e 100644 --- a/server/src/score-import/framework/core/string-asserts.test.ts +++ b/server/src/score-import/framework/common/string-asserts.test.ts @@ -1,5 +1,5 @@ import t from "tap"; -import { InvalidScoreFailure } from "./converter-failures"; +import { InvalidScoreFailure } from "../importing/converter-failures"; import { AssertStrAsPositiveInt, AssertStrAsPositiveNonZeroInt } from "./string-asserts"; function astr(v: string) { diff --git a/server/src/score-import/framework/core/string-asserts.ts b/server/src/score-import/framework/common/string-asserts.ts similarity index 93% rename from server/src/score-import/framework/core/string-asserts.ts rename to server/src/score-import/framework/common/string-asserts.ts index fa9f3a8a1..984973815 100644 --- a/server/src/score-import/framework/core/string-asserts.ts +++ b/server/src/score-import/framework/common/string-asserts.ts @@ -1,4 +1,4 @@ -import { InvalidScoreFailure } from "./converter-failures"; +import { InvalidScoreFailure } from "../importing/converter-failures"; const isIntegerRegex = /^-?\d+$/; diff --git a/server/src/score-import/framework/core/converter-failures.ts b/server/src/score-import/framework/importing/converter-failures.ts similarity index 100% rename from server/src/score-import/framework/core/converter-failures.ts rename to server/src/score-import/framework/importing/converter-failures.ts diff --git a/server/src/score-import/framework/core/hydrate-score.ts b/server/src/score-import/framework/importing/hydrate-score.ts similarity index 92% rename from server/src/score-import/framework/core/hydrate-score.ts rename to server/src/score-import/framework/importing/hydrate-score.ts index 9f2d4a7cb..a82a4c1a0 100644 --- a/server/src/score-import/framework/core/hydrate-score.ts +++ b/server/src/score-import/framework/importing/hydrate-score.ts @@ -7,7 +7,7 @@ import { } from "kamaitachi-common"; import { Logger } from "winston"; import { DryScore } from "../../../types"; -import { CreateCalculatedData } from "./calculated-data/calculated-data"; +import { CreateCalculatedData } from "../calculated-data/calculated-data"; /** * Takes an "intermediate" score and appends the rest of the data it needs. diff --git a/server/src/score-import/framework/core/insert-score.test.ts b/server/src/score-import/framework/importing/insert-score.test.ts similarity index 94% rename from server/src/score-import/framework/core/insert-score.test.ts rename to server/src/score-import/framework/importing/insert-score.test.ts index ae5b00e16..66d135141 100644 --- a/server/src/score-import/framework/core/insert-score.test.ts +++ b/server/src/score-import/framework/importing/insert-score.test.ts @@ -2,7 +2,7 @@ import { ScoreDocument } from "kamaitachi-common"; import t from "tap"; import db, { CloseMongoConnection } from "../../../db/db"; import ResetDBState from "../../../test-utils/reset-db-state"; -import { InsertQueue, QueueScoreInsert } from "./insert-score"; +import { InsertQueue, QueueScoreInsert } from "../common/insert-score"; // these two get the same tests, because they're too closely linked t.test("#QueueScoreInsert, #InsertQueue", async (t) => { diff --git a/server/src/score-import/framework/core/insert-score.ts b/server/src/score-import/framework/importing/insert-score.ts similarity index 100% rename from server/src/score-import/framework/core/insert-score.ts rename to server/src/score-import/framework/importing/insert-score.ts diff --git a/server/src/score-import/framework/core/score-id.test.ts b/server/src/score-import/framework/importing/score-id.test.ts similarity index 100% rename from server/src/score-import/framework/core/score-id.test.ts rename to server/src/score-import/framework/importing/score-id.test.ts diff --git a/server/src/score-import/framework/core/score-id.ts b/server/src/score-import/framework/importing/score-id.ts similarity index 100% rename from server/src/score-import/framework/core/score-id.ts rename to server/src/score-import/framework/importing/score-id.ts diff --git a/server/src/score-import/framework/core/score-import-error.test.ts b/server/src/score-import/framework/importing/score-import-error.test.ts similarity index 100% rename from server/src/score-import/framework/core/score-import-error.test.ts rename to server/src/score-import/framework/importing/score-import-error.test.ts diff --git a/server/src/score-import/framework/core/score-import-error.ts b/server/src/score-import/framework/importing/score-import-error.ts similarity index 100% rename from server/src/score-import/framework/core/score-import-error.ts rename to server/src/score-import/framework/importing/score-import-error.ts diff --git a/server/src/score-import/framework/importing/score-importing.ts b/server/src/score-import/framework/importing/score-importing.ts index 0523c03d8..73f8e055c 100644 --- a/server/src/score-import/framework/importing/score-importing.ts +++ b/server/src/score-import/framework/importing/score-importing.ts @@ -6,15 +6,15 @@ import { AnySongDocument, } from "kamaitachi-common"; import { DryScore, ConverterFunction, ConverterFnReturn, KtLogger } from "../../../types"; -import HydrateScore from "../core/hydrate-score"; -import { QueueScoreInsert, ScoreIDs } from "../core/insert-score"; +import HydrateScore from "./hydrate-score"; +import { QueueScoreInsert, ScoreIDs } from "../common/insert-score"; import { ConverterFailure, InternalFailure, InvalidScoreFailure, KTDataNotFoundFailure, -} from "../core/converter-failures"; -import { CreateScoreID } from "../core/score-id"; +} from "./converter-failures"; +import { CreateScoreID } from "../common/score-id"; import db from "../../../db/db"; import { AppendLogCtx } from "../../../logger"; diff --git a/server/src/score-import/framework/core/score-utils.ts b/server/src/score-import/framework/importing/score-utils.ts similarity index 100% rename from server/src/score-import/framework/core/score-utils.ts rename to server/src/score-import/framework/importing/score-utils.ts diff --git a/server/src/score-import/framework/core/pb/create-pb-doc.test.ts b/server/src/score-import/framework/pb/create-pb-doc.test.ts similarity index 96% rename from server/src/score-import/framework/core/pb/create-pb-doc.test.ts rename to server/src/score-import/framework/pb/create-pb-doc.test.ts index 3cbaa8537..4122bbfd3 100644 --- a/server/src/score-import/framework/core/pb/create-pb-doc.test.ts +++ b/server/src/score-import/framework/pb/create-pb-doc.test.ts @@ -1,16 +1,16 @@ import t from "tap"; -import db, { CloseMongoConnection } from "../../../../db/db"; -import ResetDBState from "../../../../test-utils/reset-db-state"; +import db, { CloseMongoConnection } from "../../../db/db"; +import ResetDBState from "../../../test-utils/reset-db-state"; import { GetKTDataJSON, Testing511SPA, TestingIIDXSPScore, TestingIIDXSPScorePB, -} from "../../../../test-utils/test-data"; +} from "../../../test-utils/test-data"; import { CreatePBDoc, GetRankingInfo } from "./create-pb-doc"; import deepmerge from "deepmerge"; -import CreateLogCtx from "../../../../logger"; -import { KtLogger } from "../../../../types"; +import CreateLogCtx from "../../../logger"; +import { KtLogger } from "../../../types"; import { lamps } from "kamaitachi-common/js/config"; let IIDXScore = TestingIIDXSPScore; diff --git a/server/src/score-import/framework/core/pb/create-pb-doc.ts b/server/src/score-import/framework/pb/create-pb-doc.ts similarity index 98% rename from server/src/score-import/framework/core/pb/create-pb-doc.ts rename to server/src/score-import/framework/pb/create-pb-doc.ts index 0af391968..3fe7ef78c 100644 --- a/server/src/score-import/framework/core/pb/create-pb-doc.ts +++ b/server/src/score-import/framework/pb/create-pb-doc.ts @@ -1,7 +1,7 @@ -import db from "../../../../db/db"; +import db from "../../../db/db"; import { integer, ScoreDocument, PBScoreDocument } from "kamaitachi-common"; -import { KtLogger } from "../../../../types"; +import { KtLogger } from "../../../types"; import { IIDXMergeFn } from "./game-specific-merge"; export async function CreatePBDoc(userID: integer, chartID: string, logger: KtLogger) { diff --git a/server/src/score-import/framework/core/pb/game-specific-merge.ts b/server/src/score-import/framework/pb/game-specific-merge.ts similarity index 95% rename from server/src/score-import/framework/core/pb/game-specific-merge.ts rename to server/src/score-import/framework/pb/game-specific-merge.ts index 863087b90..7e69db701 100644 --- a/server/src/score-import/framework/core/pb/game-specific-merge.ts +++ b/server/src/score-import/framework/pb/game-specific-merge.ts @@ -1,6 +1,6 @@ import { PBScoreDocument, ScoreDocument } from "kamaitachi-common"; -import db from "../../../../db/db"; -import { KtLogger } from "../../../../types"; +import db from "../../../db/db"; +import { KtLogger } from "../../../types"; export async function IIDXMergeFn( pbDoc: PBScoreDocument<"iidx:SP" | "iidx:DP">, diff --git a/server/src/score-import/framework/core/pb/process-pbs.test.ts b/server/src/score-import/framework/pb/process-pbs.test.ts similarity index 88% rename from server/src/score-import/framework/core/pb/process-pbs.test.ts rename to server/src/score-import/framework/pb/process-pbs.test.ts index d627950a9..90fbb441b 100644 --- a/server/src/score-import/framework/core/pb/process-pbs.test.ts +++ b/server/src/score-import/framework/pb/process-pbs.test.ts @@ -1,8 +1,8 @@ import t from "tap"; -import db, { CloseMongoConnection } from "../../../../db/db"; -import CreateLogCtx from "../../../../logger"; -import ResetDBState from "../../../../test-utils/reset-db-state"; -import { Testing511SPA, TestingIIDXSPScore } from "../../../../test-utils/test-data"; +import db, { CloseMongoConnection } from "../../../db/db"; +import CreateLogCtx from "../../../logger"; +import ResetDBState from "../../../test-utils/reset-db-state"; +import { Testing511SPA, TestingIIDXSPScore } from "../../../test-utils/test-data"; import { ProcessPBs } from "./process-pbs"; import deepmerge from "deepmerge"; import crypto from "crypto"; diff --git a/server/src/score-import/framework/core/pb/process-pbs.ts b/server/src/score-import/framework/pb/process-pbs.ts similarity index 93% rename from server/src/score-import/framework/core/pb/process-pbs.ts rename to server/src/score-import/framework/pb/process-pbs.ts index ccffea3f7..2591ef192 100644 --- a/server/src/score-import/framework/core/pb/process-pbs.ts +++ b/server/src/score-import/framework/pb/process-pbs.ts @@ -1,6 +1,6 @@ import { integer, PBScoreDocument } from "kamaitachi-common"; -import db from "../../../../db/db"; -import { KtLogger } from "../../../../types"; +import db from "../../../db/db"; +import { KtLogger } from "../../../types"; import { CreatePBDoc } from "./create-pb-doc"; export async function ProcessPBs( diff --git a/server/src/score-import/framework/score-import-main.ts b/server/src/score-import/framework/score-import-main.ts index b52184fd1..1a91e614a 100644 --- a/server/src/score-import/framework/score-import-main.ts +++ b/server/src/score-import/framework/score-import-main.ts @@ -5,12 +5,12 @@ import { PublicUserDocument, } from "kamaitachi-common"; import { ImportInputParser, ScorePlaytypeMap } from "../../types"; -import { InsertQueue } from "./core/insert-score"; +import { InsertQueue } from "./common/insert-score"; import { ImportAllIterableData } from "./importing/score-importing"; -import { CreateImportLoggerAndID } from "./core/import-logger"; -import { CreateSessions } from "./core/sessions/sessions"; +import { CreateImportLoggerAndID } from "./common/import-logger"; +import { CreateSessions } from "./sessions/sessions"; import { GetMilisecondsSince } from "../../core/hrtime-core"; -import { ProcessPBs } from "./core/pb/process-pbs"; +import { ProcessPBs } from "./pb/process-pbs"; export default async function ScoreImportMain( user: PublicUserDocument, diff --git a/server/src/score-import/framework/core/sessions/name-generation.ts b/server/src/score-import/framework/sessions/name-generation.ts similarity index 71% rename from server/src/score-import/framework/core/sessions/name-generation.ts rename to server/src/score-import/framework/sessions/name-generation.ts index 68fee0e43..58f5f9d0b 100644 --- a/server/src/score-import/framework/core/sessions/name-generation.ts +++ b/server/src/score-import/framework/sessions/name-generation.ts @@ -1,4 +1,4 @@ -import { GetRandomAdjective, GetRandomNoun } from "../../../../data/words"; +import { GetRandomAdjective, GetRandomNoun } from "../../../data/words"; export function GenerateRandomSessionName() { let adj1 = GetRandomAdjective(); diff --git a/server/src/score-import/framework/core/sessions/performance-calc.ts b/server/src/score-import/framework/sessions/performance-calc.ts similarity index 100% rename from server/src/score-import/framework/core/sessions/performance-calc.ts rename to server/src/score-import/framework/sessions/performance-calc.ts diff --git a/server/src/score-import/framework/core/sessions/sessions.ts b/server/src/score-import/framework/sessions/sessions.ts similarity index 97% rename from server/src/score-import/framework/core/sessions/sessions.ts rename to server/src/score-import/framework/sessions/sessions.ts index 15054df6f..fe1cba7f9 100644 --- a/server/src/score-import/framework/core/sessions/sessions.ts +++ b/server/src/score-import/framework/sessions/sessions.ts @@ -9,13 +9,13 @@ import { SessionInfoReturn, Game, } from "kamaitachi-common"; -import db from "../../../../db/db"; -import { AppendLogCtx } from "../../../../logger"; +import db from "../../../db/db"; +import { AppendLogCtx } from "../../../logger"; import { GenerateRandomSessionName } from "./name-generation"; import crypto from "crypto"; import { CreateSessionCalcData } from "./performance-calc"; -import { GetScoresFromSession } from "../../../../core/session-core"; -import { KtLogger, ScorePlaytypeMap } from "../../../../types"; +import { GetScoresFromSession } from "../../../core/session-core"; +import { KtLogger, ScorePlaytypeMap } from "../../../types"; const TWO_HOURS = 1000 * 60 * 60 * 2; diff --git a/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.test.ts b/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.test.ts index 7fe71b959..ea91acdf3 100644 --- a/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.test.ts +++ b/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.test.ts @@ -11,7 +11,7 @@ import { ConverterFailure, InvalidScoreFailure, KTDataNotFoundFailure, -} from "../../../framework/core/converter-failures"; +} from "../../../framework/importing/converter-failures"; const logger = CreateLogCtx("converter.test.ts"); diff --git a/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.ts b/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.ts index fcc5e782b..e9f8ad1aa 100644 --- a/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.ts +++ b/server/src/score-import/import-types/file/csv-eamusement-iidx/converter.ts @@ -7,10 +7,10 @@ import { KTDataNotFoundFailure, InternalFailure, InvalidScoreFailure, -} from "../../../framework/core/converter-failures"; -import ScoreImportFatalError from "../../../framework/core/score-import-error"; -import { GetGradeFromPercent } from "../../../framework/core/score-utils"; -import { AssertStrAsPositiveInt } from "../../../framework/core/string-asserts"; +} from "../../../framework/importing/converter-failures"; +import ScoreImportFatalError from "../../../framework/common/score-import-error"; +import { GetGradeFromPercent } from "../../../framework/common/score-utils"; +import { AssertStrAsPositiveInt } from "../../../framework/common/string-asserts"; import { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types"; const EAMUSEMENT_LAMP_RESOLVER: Map = new Map([ diff --git a/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.test.ts b/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.test.ts index afdcf935c..15fc5acb6 100644 --- a/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.test.ts +++ b/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.test.ts @@ -1,6 +1,6 @@ import t from "tap"; import CreateLogCtx from "../../../../logger"; -import ScoreImportFatalError from "../../../framework/core/score-import-error"; +import ScoreImportFatalError from "../../../framework/common/score-import-error"; import ParseEamusementCSV, { NaiveCSVParse, ResolveHeaders } from "./parser"; import { CloseMongoConnection } from "../../../../db/db"; import { diff --git a/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.ts b/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.ts index d2550e2b3..a6882f8de 100644 --- a/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.ts +++ b/server/src/score-import/import-types/file/csv-eamusement-iidx/parser.ts @@ -1,7 +1,7 @@ import { Difficulties } from "kamaitachi-common"; import { Logger } from "winston"; import { ParserFunctionReturnsSync } from "../../../../types"; -import ScoreImportFatalError from "../../../framework/core/score-import-error"; +import ScoreImportFatalError from "../../../framework/common/score-import-error"; import ConverterFn from "./converter"; import { EamusementScoreData, IIDXEamusementCSVContext, IIDXEamusementCSVData } from "./types"; diff --git a/server/src/types.ts b/server/src/types.ts index fb9dc2344..559b148bf 100644 --- a/server/src/types.ts +++ b/server/src/types.ts @@ -10,7 +10,7 @@ import { Playtypes, } from "kamaitachi-common"; import { Logger, LeveledLogMethod } from "winston"; -import { ConverterFailure } from "./score-import/framework/core/converter-failures"; +import { ConverterFailure } from "./score-import/framework/importing/converter-failures"; import { Converters } from "./score-import/import-types/import-types"; declare module "express-session" {