diff --git a/src/lib/api/adapters/entity.adapter.ts b/src/lib/api/adapters/entity.adapter.ts index befcf6a6..44911b44 100644 --- a/src/lib/api/adapters/entity.adapter.ts +++ b/src/lib/api/adapters/entity.adapter.ts @@ -402,6 +402,15 @@ export interface WeaponDownloadStatus { updatedAt?: string } +/** + * Raw data response from /raw endpoint + */ +export interface EntityRawData { + wikiRaw: string | null + gameRawEn: Record | null + gameRawJp: Record | null +} + /** * Entity adapter for accessing canonical game data */ @@ -813,6 +822,52 @@ export class EntityAdapter extends BaseAdapter { updatedAt: response.updated_at } } + + // ============================================ + // Raw Data Methods (for database viewing) + // ============================================ + + /** + * Gets raw wiki and game data for a character + * This data is fetched separately to avoid bloating regular entity responses + * Note: BaseAdapter.request() automatically transforms snake_case to camelCase + */ + async getCharacterRawData(id: string): Promise { + // Response keys are already camelCase after BaseAdapter.transformResponse() + const response = await this.request(`/characters/${id}/raw`, { + method: 'GET' + }) + + return response + } + + /** + * Gets raw wiki and game data for a weapon + * This data is fetched separately to avoid bloating regular entity responses + * Note: BaseAdapter.request() automatically transforms snake_case to camelCase + */ + async getWeaponRawData(id: string): Promise { + // Response keys are already camelCase after BaseAdapter.transformResponse() + const response = await this.request(`/weapons/${id}/raw`, { + method: 'GET' + }) + + return response + } + + /** + * Gets raw wiki and game data for a summon + * This data is fetched separately to avoid bloating regular entity responses + * Note: BaseAdapter.request() automatically transforms snake_case to camelCase + */ + async getSummonRawData(id: string): Promise { + // Response keys are already camelCase after BaseAdapter.transformResponse() + const response = await this.request(`/summons/${id}/raw`, { + method: 'GET' + }) + + return response + } } /** diff --git a/src/lib/types/api/entities.ts b/src/lib/types/api/entities.ts index bb6548a2..b8956e48 100644 --- a/src/lib/types/api/entities.ts +++ b/src/lib/types/api/entities.ts @@ -105,6 +105,13 @@ export interface Summon { } } +// Raw data response from separate /raw endpoint +export interface EntityRawData { + wikiRaw: string | null + gameRawEn: Record | null + gameRawJp: Record | null +} + // Job entity from JobBlueprint export interface Job { id: string