From 2e122896a0fccb3945bb2ee79aea785e8e1a95be Mon Sep 17 00:00:00 2001 From: zkldi Date: Wed, 31 Mar 2021 12:59:00 +0100 Subject: [PATCH] Add BetaKeyDocument --- common/js/types.d.ts | 6 ++++++ common/src/config.ts | 2 +- common/src/types.ts | 13 ++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/common/js/types.d.ts b/common/js/types.d.ts index f431c3944..1f6c8dc86 100644 --- a/common/js/types.d.ts +++ b/common/js/types.d.ts @@ -371,6 +371,12 @@ export interface PublicAPIKeyDocument extends MongoDBDocument { apiKey: string; permissions: PublicAPIPermissions; } +export interface BetaKeyDocument extends MongoDBDocument { + createdBy: integer; + betakey: string; + createdOn: integer; + consumed: boolean; +} export interface PublicAPIRequestDocument extends MongoDBDocument { key: PublicAPIKeyDocument; location: string; diff --git a/common/src/config.ts b/common/src/config.ts index d4665d31c..10a4eddcb 100644 --- a/common/src/config.ts +++ b/common/src/config.ts @@ -712,7 +712,7 @@ const defaultDifficulty: Record = { usc: "EXH", }; -function humaniseGame(game: T, pt?: Playtypes[T]) { +function humaniseGame(game: T, pt?: Playtypes[T]): string { if (!pt) { return gameHuman[game]; } diff --git a/common/src/types.ts b/common/src/types.ts index 42477851e..c15435554 100644 --- a/common/src/types.ts +++ b/common/src/types.ts @@ -450,13 +450,13 @@ export interface UserGameStats extends MongoDBDocument { } */ -type UserClasses = Partial>; +// type UserClasses = Partial>; -type PlaytypeClasses = Partial>; +// type PlaytypeClasses = Partial>; // this one is just flat out wrong btw, there are very strict requirements // on what strings can go in here. -type ClassInfo = Partial>; +// type ClassInfo = Partial>; /** * PrivateUserDocument is the document indicating that we've returned everything about the user @@ -479,6 +479,13 @@ export interface PublicAPIKeyDocument extends MongoDBDocument { permissions: PublicAPIPermissions; } +export interface BetaKeyDocument extends MongoDBDocument { + createdBy: integer; + betakey: string; + createdOn: integer; + consumed: boolean; +} + export interface PublicAPIRequestDocument extends MongoDBDocument { key: PublicAPIKeyDocument; location: string;