diff --git a/server/package.json b/server/package.json index 94ed2ec05..b12fbea60 100644 --- a/server/package.json +++ b/server/package.json @@ -77,7 +77,7 @@ "redis": "3.1.2", "rimraf": "3.0.2", "safe-json-stringify": "1.2.0", - "tachi-common": "0.2.35", + "tachi-common": "0.2.36", "ts-node": "10.0.0", "typescript": "4.3.4", "winston": "3.3.3", diff --git a/server/pnpm-lock.yaml b/server/pnpm-lock.yaml index c2dc8e471..4d5f167d1 100644 --- a/server/pnpm-lock.yaml +++ b/server/pnpm-lock.yaml @@ -59,7 +59,7 @@ specifiers: rimraf: 3.0.2 safe-json-stringify: 1.2.0 supertest: 6.1.3 - tachi-common: 0.2.35 + tachi-common: 0.2.36 tap: 15.0.9 ts-node: 10.0.0 tsconfig-paths: 3.10.1 @@ -100,7 +100,7 @@ dependencies: redis: 3.1.2 rimraf: 3.0.2 safe-json-stringify: 1.2.0 - tachi-common: 0.2.35 + tachi-common: 0.2.36 ts-node: 10.0.0_83f53b0a0c5616d3fa00ed4e30b9ce1b typescript: 4.3.4 winston: 3.3.3 @@ -4189,8 +4189,8 @@ packages: strip-ansi: 6.0.0 dev: true - /tachi-common/0.2.35: - resolution: {integrity: sha512-AefVkriGKlpamGA+JTl67qpv4HiZ6sYxCVCZXXvnUXJZiGfsh7dhrqVqXngfxPQjg3mLD81MbZrTNv1HsgwGJQ==} + /tachi-common/0.2.36: + resolution: {integrity: sha512-4/enfkwE8HA4x4vrbNMrhLx2j/8JGnEMwAO5b0zSM150chDZiK30vXOmDW1IHSqxoIRZVuIyRqP7aEyUbf7FKA==} dependencies: monk: 7.3.4 transitivePeerDependencies: diff --git a/server/src/external/mongo/schemas.ts b/server/src/external/mongo/schemas.ts index 57716c3f0..564c873bf 100644 --- a/server/src/external/mongo/schemas.ts +++ b/server/src/external/mongo/schemas.ts @@ -559,6 +559,8 @@ export const DatabaseSchemas: Record = { importID: "string", scoreIDs: ["string"], game: p.isIn(games), + // @ts-expect-error We've asserted this is definitely a game. + playtypes: [(self) => p.isIn(GetGameConfig(self.game).validPlaytypes)(self)], errors: [ { type: "string", diff --git a/server/src/lib/score-import/framework/score-import-main.ts b/server/src/lib/score-import/framework/score-import-main.ts index 5e08eab95..0608995cf 100644 --- a/server/src/lib/score-import/framework/score-import-main.ts +++ b/server/src/lib/score-import/framework/score-import-main.ts @@ -188,6 +188,7 @@ export default async function ScoreImportMain( importType, idStrings: playtypes.map((e) => `${game}:${e}`) as IDStrings[], scoreIDs, + playtypes, game, errors, importID,