feat: migrating achievements to level

This commit is contained in:
Chubby Granny Chaser
2025-01-16 02:30:09 +00:00
parent 2c881a6100
commit a23106b0b1
34 changed files with 388 additions and 475 deletions

View File

@@ -0,0 +1,11 @@
import type { GameAchievement } from "@types";
import { db } from "../level";
import { levelKeys } from "./keys";
export const gameAchievementsSublevel = db.sublevel<string, GameAchievement>(
levelKeys.gameAchievements,
{
valueEncoding: "json",
}
);

View File

@@ -0,0 +1,11 @@
import type { ShopDetails } from "@types";
import { db } from "../level";
import { levelKeys } from "./keys";
export const gamesShopCacheSublevel = db.sublevel<string, ShopDetails>(
levelKeys.gameShopCache,
{
valueEncoding: "json",
}
);

View File

@@ -1,4 +1,5 @@
import { Game } from "@types";
import type { Game } from "@types";
import { db } from "../level";
import { levelKeys } from "./keys";

View File

@@ -1 +1,5 @@
export * from "./games";
export * from "./game-shop-cache";
export * from "./game-achievements";
export * from "./keys";

View File

@@ -5,4 +5,8 @@ export const levelKeys = {
game: (shop: GameShop, objectId: string) => `${shop}:${objectId}`,
user: "user",
auth: "auth",
gameShopCache: "gameShopCache",
gameShopCacheItem: (shop: GameShop, objectId: string, language: string) =>
`${shop}:${objectId}:${language}`,
gameAchievements: "gameAchievements",
};