LETS GO BABY
Some checks failed
Deploy Website / deploy (push) Waiting to run
Deploy Backend / deploy (push) Has been cancelled

This commit is contained in:
Lee
2024-10-09 01:17:00 +01:00
parent e0fca1168a
commit e87d73bbdf
69 changed files with 583 additions and 458 deletions

View File

@ -0,0 +1,23 @@
import { Entity } from "dexie";
import Database from "../database";
import { BeatSaverMapToken } from "@ssr/common/types/token/beatsaver/beat-saver-map-token";
/**
* A beat saver map.
*/
export default class BeatSaverMap extends Entity<Database> {
/**
* The hash of the map.
*/
hash!: string;
/**
* The bsr code for the map.
*/
bsr!: string;
/**
* The full data for the map.
*/
fullData!: BeatSaverMapToken;
}

View File

@ -1,12 +0,0 @@
import * as mongoose from "mongoose";
/**
* Connects to the mongo database
*/
export async function connectMongo() {
const connectionUri = process.env.MONGO_URI;
if (!connectionUri) {
throw new Error("Missing MONGO_URI");
}
await mongoose.connect(connectionUri);
}

View File

@ -1,4 +1,4 @@
import { PlayerHistory } from "@/common/player/player-history";
import { PlayerHistory } from "@ssr/common/types/player/player-history";
/**
* Gets a value from an {@link PlayerHistory}

View File

@ -9,6 +9,15 @@ export function setPlayerIdCookie(playerId: string) {
Cookies.set("playerId", playerId, { path: "/" });
}
/**
* Gets the player id cookie
*
* @returns the player id cookie
*/
export function getPlayerIdCookie() {
return Cookies.get("playerId");
}
/**
* Gets if we're in production
*/

View File

@ -1,5 +1,5 @@
import * as Comlink from "comlink";
import { scoresaberService } from "@/common/service/impl/scoresaber";
import { scoresaberService } from "@ssr/common/service/impl/scoresaber";
export interface WorkerApi {
getPlayerExample: typeof getPlayerExample;