all paths

This commit is contained in:
tresabhi committed 2026-05-18 15:33:38 -05:00
1 parent 47c87970cd
commit 416d061df1
26 files changed
+83 -29

No files matched your search

@@ -1,13 +1,15 @@
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { api } from "../../../api/dynamic";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const { avatars } = await api.avatars();
return avatars.map((avatar) => ({
params: { id: avatar.name },
}));
}) satisfies GetStaticPaths;
});
/**
* Returns data on an avatar based on its `id`. Do not use the `.webp` URLs
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* Identical to `avatars/[id].json`, but returns data on all avatars at once,
* mapped by `id`.
@@ -1,6 +1,8 @@
import { Avatars } from "@protos/avatars";
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
export async function GET() {
const avatars = await api.avatars();
return new Response(Avatars.encode(avatars).finish());
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* Returns a list of all avatars ids.
*
@@ -1,13 +1,15 @@
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { api } from "../../../api/dynamic";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const { backgrounds } = await api.backgrounds();
return backgrounds.map((background) => ({
params: { id: background.name },
}));
}) satisfies GetStaticPaths;
});
export async function GET({ params }: APIContext<never, { id: string }>) {
const background = await api.background(params.id);
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
export async function GET() {
const { backgrounds } = await api.backgrounds();
return Response.json(backgrounds);
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
export async function GET() {
const { backgrounds } = await api.backgrounds();
const list = backgrounds.map((background) => background.name);
@@ -1,11 +1,12 @@
import type { GetStaticPaths } from "astro";
import { api } from "../../../api/dynamic";
import { imageProxy } from "../../../api/imageProxy";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const group = api.metadata.group("CurrencyEntity");
return group.map(({ name }) => ({ params: { id: name } }));
}) satisfies GetStaticPaths;
});
export async function GET({ params }: { params: { id: string } }) {
const icon = await api.currencyIcon(params.id);
@@ -1,7 +1,12 @@
import { TankClass, TankType } from "@blitzkit/core";
import { Nation } from "@protos/blitz_static_tank_component";
import type { APIContext, GetStaticPaths } from "astro";
import {
Nation,
TankClass,
TankType,
} from "@protos/blitz_static_tank_component";
import type { APIContext } from "astro";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { GunType } from "../../../tankopedia/characteristics";
import { getStaticPaths as _getStaticPaths } from "../_index";
import { GET as _GET } from "./all.json";
export const ENUMS = {
@@ -11,9 +16,9 @@ export const ENUMS = {
"gun-type": GunType,
};
export const getStaticPaths = (() => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
return Object.keys(ENUMS).map((name) => ({ params: { enum: name } }));
}) satisfies GetStaticPaths;
});
export async function GET({
params,
@@ -1,5 +1,7 @@
import { ENUMS } from "./[enum].json";
export { getStaticPaths } from "../_index";
export function GET() {
const enums: Record<string, Record<number, string>> = {};
@@ -1,5 +1,7 @@
import { ENUMS } from "./[enum].json";
export { getStaticPaths } from "../_index";
export function GET() {
const list = Object.keys(ENUMS);
return Response.json(list);
@@ -1,6 +1,8 @@
import { Equipment } from "@protos/equipment";
import { api } from "../../api/dynamic";
export { getStaticPaths } from "./_index";
export async function GET() {
const equipment = await api.equipment();
return new Response(Equipment.encode(equipment).finish());
@@ -1,8 +1,10 @@
import locales from "@blitzkit/i18n/locales.json";
import type { GetStaticPaths, GetStaticPathsResult } from "astro";
import type { GetStaticPathsResult } from "astro";
import { api } from "../../../../api/dynamic";
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const paths: GetStaticPathsResult = [];
const groups = await api.gameStringGroups();
@@ -13,7 +15,7 @@ export const getStaticPaths = (async () => {
}
return paths;
}) satisfies GetStaticPaths;
});
export async function GET({
params,
@@ -1,14 +1,16 @@
import { Nation } from "@protos/blitz_static_tank_component";
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { clientUnmountedResponse } from "../../../../api/responses";
import { mixStaticPaths } from "../../../../astro/mixStaticPaths";
import { game } from "../../../../game/game";
import { clientUnmounted } from "../../../../game/unmounted";
import { getStaticPaths as _getStaticPaths } from "../../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
return Object.values(Nation)
.filter(Number.isInteger)
.map((id) => ({ params: { id } }));
}) satisfies GetStaticPaths;
});
/**
* Even Noah can't save these animals.
@@ -1,10 +1,12 @@
import locales from "@blitzkit/i18n/locales.json";
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { api } from "../../../api/dynamic";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = (() => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
return locales.supported.map(({ locale }) => ({ params: { locale } }));
}) satisfies GetStaticPaths;
});
/**
* BlitzKit strings.
@@ -1,10 +1,12 @@
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { api } from "../../../api/dynamic";
import { mixStaticPaths } from "../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
const { list } = await api.tankList();
return list.map(({ id }) => ({ params: { id } }));
}) satisfies GetStaticPaths;
});
/**
* Even Noah can't save these animals.
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* Literally all the tanks in one place lmao.
*/
@@ -1,6 +1,8 @@
import { Tanks } from "@protos/tanks";
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* Literally all the tanks in one place lmao.
*/
@@ -1,5 +1,7 @@
import { characteristicsOrder } from "../../../tankopedia/characteristicsOrder";
export { getStaticPaths } from "../_index";
/**
* The naked man fears no pickpocket.
*/
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* List!
*/
@@ -1,6 +1,8 @@
import { TankList } from "@protos/tank_list";
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
/**
* List!!
*/
@@ -1,5 +1,7 @@
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
export async function GET() {
const popular = await api.popularTanks();
return Response.json(popular);
@@ -1,6 +1,8 @@
import { PopularTanks } from "@protos/popular_tanks";
import { api } from "../../../api/dynamic";
export { getStaticPaths } from "../_index";
export async function GET() {
const popular = await api.popularTanks();
return new Response(PopularTanks.encode(popular).finish());
@@ -1,12 +1,14 @@
import { TankUpgradePricePresetComponent } from "@protos/blitz_static_tank_upgrade_price_preset_component";
import type { APIContext, GetStaticPaths } from "astro";
import type { APIContext } from "astro";
import { api } from "../../../../../api/dynamic";
import { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
import { getStaticPaths as _getStaticPaths } from "../../../_index";
export const getStaticPaths = (async () => {
export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
return api.metadata
.group("TankUpgradePricePresetEntity")
.map(({ name }) => ({ params: { id: name } }));
}) satisfies GetStaticPaths;
});
export async function GET({ params }: APIContext<never, { id: string }>) {
const preset = await api.tankUpgradePreset(params.id);
@@ -1,5 +1,7 @@
import { api } from "../../api/dynamic";
export { getStaticPaths } from "./_index";
/**
* Woah! test.
*/
@@ -1,6 +1,8 @@
import { Tiers } from "@protos/tiers";
import { api } from "../../api/dynamic";
export { getStaticPaths } from "./_index";
/**
* Woah!
*/