19 lines
534 B
TypeScript
19 lines
534 B
TypeScript
|
|
import { WApiV3ItemDatabase } from "#/lib/types";
|
|
import { WApi } from "#/lib/wapi";
|
|
import { ArkError, ArkErrors } from "arktype";
|
|
|
|
export async function update_wynn_items() {
|
|
const api = new WApi()
|
|
const ans = await api.get('/v3/item/database', {fullResult: ''})
|
|
if(ans.status !== 200){
|
|
throw new Error('Failed to get wynn items')
|
|
}
|
|
const parsed = WApiV3ItemDatabase(ans.data)
|
|
if(parsed instanceof ArkErrors){
|
|
console.log(parsed[0].problem)
|
|
console.log(parsed[0].path)
|
|
console.log(parsed[0].data)
|
|
}
|
|
}
|