mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 11:53:25 +01:00
fix: self core imports
This commit is contained in:
1 parent
1790443698
commit
03a51c47bb
31 files changed
+143
-136
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { Region, assertSecret, idToRegion } from '@blitzkit/core';
|
||||
import { assertSecret } from "../blitzkit";
|
||||
import { idToRegion } from "./idToRegion";
|
||||
import { Region } from "./regions";
|
||||
|
||||
export async function isValidBlitzId(id: number, token?: string) {
|
||||
let region: Region;
|
||||
@@ -11,20 +13,20 @@ export async function isValidBlitzId(id: number, token?: string) {
|
||||
|
||||
const json = await fetch(
|
||||
`https://api.wotblitz.${region}/wotb/account/info/?account_id=${id}&application_id=${assertSecret(
|
||||
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID,
|
||||
import.meta.env.PUBLIC_WARGAMING_APPLICATION_ID
|
||||
)}${
|
||||
token === undefined ? '' : `&access_token=${token}`
|
||||
}&fields=account_id%2C-account_id`,
|
||||
token === undefined ? "" : `&access_token=${token}`
|
||||
}&fields=account_id%2C-account_id`
|
||||
).then(
|
||||
(response) =>
|
||||
response.json() as Promise<
|
||||
| {
|
||||
status: 'ok';
|
||||
status: "ok";
|
||||
data: Record<number, {} | null>;
|
||||
}
|
||||
| { status: 'error' }
|
||||
>,
|
||||
| { status: "error" }
|
||||
>
|
||||
);
|
||||
|
||||
return json.status === 'ok' && json.data[id] !== null;
|
||||
return json.status === "ok" && json.data[id] !== null;
|
||||
}
|
||||
Reference in new issue
Block a user