feat: meta section

This commit is contained in:
TrèsAbhi committed 2025-12-26 14:14:29 -06:00
1 parent 1d3cb95b89
commit 40a1eb861d
14 files changed
+141 -18

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
import type { TankCatalogComponent } from "@protos/blitz_static_tank_component";
import type { Tank } from "../../protos/tank";
import type { Tanks } from "../../protos/tanks";
export abstract class AbstractAPI {
@@ -9,5 +9,5 @@ export abstract class AbstractAPI {
prefix?: string
): Promise<Record<string, string>>;
abstract tank(id: string): Promise<TankCatalogComponent>;
abstract tank(id: string): Promise<Tank>;
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { TankCatalogComponent } from "@protos/blitz_static_tank_component";
import { Tank } from "../../protos/tank";
import { AbstractAPI } from "./abstract";
export class ClientAPI extends AbstractAPI {
@@ -7,6 +7,6 @@ export class ClientAPI extends AbstractAPI {
const buffer = await response.arrayBuffer();
const array = new Uint8Array(buffer);
return TankCatalogComponent.decode(array);
return Tank.decode(array);
}
}
+4 -2
View File
@@ -2,6 +2,7 @@ import type { MetadataAccessor } from "@blitzkit/closed";
import { sluggify } from "@blitzkit/core";
import type { RemoteStorageComponent } from "@protos/blitz_static_remote_storage_component";
import { parse } from "yaml";
import type { Tank } from "../../protos/tank";
import type { TanksEntry } from "../../protos/tanks";
import { AbstractAPI } from "./abstract";
@@ -115,8 +116,9 @@ export class ServerAPI extends AbstractAPI {
async tank(id: string) {
const item = this.metadata.item(`TankEntity.${id}`);
const tankCatalog = item.TankCatalog();
const tank = item.TankCatalog();
const compensation = item.Compensation();
return tankCatalog;
return { tank, compensation } satisfies Tank;
}
}