add api endpoints for database items

This commit is contained in:
Justin Edmund 2025-09-17 05:33:10 -07:00
parent 9ff7ad080f
commit 7538b5ae04
3 changed files with 48 additions and 2 deletions

View file

@ -0,0 +1,16 @@
import type { FetchLike } from '../core'
import { get } from '../core'
export interface CharacterEntity {
id: string
granblue_id: number | string
name: { en?: string; ja?: string } | string
element?: number
rarity?: number
uncap?: { flb?: boolean; ulb?: boolean }
}
export const characters = {
show: (f: FetchLike, id: string, init?: RequestInit) =>
get<CharacterEntity>(f, `/characters/${encodeURIComponent(id)}`, undefined, init)
}

View file

@ -0,0 +1,16 @@
import type { FetchLike } from '../core'
import { get } from '../core'
export interface SummonEntity {
id: string
granblue_id: number
name: { en?: string; ja?: string } | string
element?: number
rarity?: number
uncap?: { flb?: boolean; ulb?: boolean; transcendence?: boolean }
}
export const summons = {
show: (f: FetchLike, id: string, init?: RequestInit) =>
get<SummonEntity>(f, `/summons/${encodeURIComponent(id)}`, undefined, init)
}

View file

@ -1,2 +1,16 @@
import type { FetchLike, Dict } from '../core'
import { get, post, put, del } from '../core'
import type { FetchLike } from '../core'
import { get } from '../core'
export interface WeaponEntity {
id: string
granblue_id: number
name: { en?: string; ja?: string } | string
element?: number
rarity?: number
uncap?: { flb?: boolean; ulb?: boolean; transcendence?: boolean }
}
export const weapons = {
show: (f: FetchLike, id: string, init?: RequestInit) =>
get<WeaponEntity>(f, `/weapons/${encodeURIComponent(id)}`, undefined, init)
}