- Add missing tsconfig strictness flags (noUncheckedIndexedAccess, exactOptionalPropertyTypes, noImplicitOverride, noPropertyAccessFromIndexSignature) and fix all resulting type errors - Replace ESLint/Prettier with oxlint 1.48.0 and oxfmt 0.33.0 - Pin all frontend and backend dependencies to exact versions - Pin GitHub Actions to SHA hashes with persist-credentials: false - Fix CI Python version mismatch (3.12 -> 3.14) and ruff target-version - Add vitest 4.0.18 with jsdom environment for frontend testing - Add ty 0.0.17 for Python type checking (non-blocking in CI) - Add actionlint and zizmor CI job for workflow linting and security audit - Add Dependabot config for npm, pip, and github-actions - Update CLAUDE.md and pre-commit hooks to reflect new tooling - Ignore Claude Code sandbox artifacts in gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { api } from './client'
|
|
import type {
|
|
Genlocke,
|
|
GenlockeListItem,
|
|
GenlockeDetail,
|
|
GenlockeGraveyard,
|
|
GenlockeLineage,
|
|
CreateGenlockeInput,
|
|
Region,
|
|
SurvivorEncounter,
|
|
AdvanceLegInput,
|
|
} from '../types/game'
|
|
|
|
export function getGenlockes(): Promise<GenlockeListItem[]> {
|
|
return api.get('/genlockes')
|
|
}
|
|
|
|
export function getGenlocke(id: number): Promise<GenlockeDetail> {
|
|
return api.get(`/genlockes/${id}`)
|
|
}
|
|
|
|
export function createGenlocke(data: CreateGenlockeInput): Promise<Genlocke> {
|
|
return api.post('/genlockes', data)
|
|
}
|
|
|
|
export function getGamesByRegion(): Promise<Region[]> {
|
|
return api.get('/games/by-region')
|
|
}
|
|
|
|
export function getGenlockeGraveyard(id: number): Promise<GenlockeGraveyard> {
|
|
return api.get(`/genlockes/${id}/graveyard`)
|
|
}
|
|
|
|
export function getGenlockeLineages(id: number): Promise<GenlockeLineage> {
|
|
return api.get(`/genlockes/${id}/lineages`)
|
|
}
|
|
|
|
export function getLegSurvivors(
|
|
genlockeId: number,
|
|
legOrder: number
|
|
): Promise<SurvivorEncounter[]> {
|
|
return api.get(`/genlockes/${genlockeId}/legs/${legOrder}/survivors`)
|
|
}
|
|
|
|
export function advanceLeg(
|
|
genlockeId: number,
|
|
legOrder: number,
|
|
data?: AdvanceLegInput
|
|
): Promise<Genlocke> {
|
|
return api.post(`/genlockes/${genlockeId}/legs/${legOrder}/advance`, data ?? {})
|
|
}
|