Add BetaKeyDocument

This commit is contained in:
zkldi
2021-03-31 12:59:00 +01:00
parent 9cf7ae0e64
commit 2e122896a0
3 changed files with 17 additions and 4 deletions
+6
View File
@@ -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;
+1 -1
View File
@@ -712,7 +712,7 @@ const defaultDifficulty: Record<Game, string> = {
usc: "EXH",
};
function humaniseGame<T extends Game>(game: T, pt?: Playtypes[T]) {
function humaniseGame<T extends Game>(game: T, pt?: Playtypes[T]): string {
if (!pt) {
return gameHuman[game];
}
+10 -3
View File
@@ -450,13 +450,13 @@ export interface UserGameStats<T extends Game> extends MongoDBDocument {
}
*/
type UserClasses = Partial<Record<Game, PlaytypeClasses>>;
// type UserClasses = Partial<Record<Game, PlaytypeClasses>>;
type PlaytypeClasses = Partial<Record<Playtypes[Game], ClassInfo>>;
// type PlaytypeClasses = Partial<Record<Playtypes[Game], ClassInfo>>;
// this one is just flat out wrong btw, there are very strict requirements
// on what strings can go in here.
type ClassInfo = Partial<Record<string, string>>;
// type ClassInfo = Partial<Record<string, string>>;
/**
* 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;