diff options
Diffstat (limited to 'src/cleaners')
-rw-r--r-- | src/cleaners/player.ts | 2 | ||||
-rw-r--r-- | src/cleaners/skyblock/collections.ts | 4 | ||||
-rw-r--r-- | src/cleaners/skyblock/election.ts | 4 | ||||
-rw-r--r-- | src/cleaners/skyblock/inventory.ts | 8 | ||||
-rw-r--r-- | src/cleaners/skyblock/member.ts | 47 | ||||
-rw-r--r-- | src/cleaners/skyblock/profile.ts | 6 | ||||
-rw-r--r-- | src/cleaners/skyblock/slayers.ts | 4 |
7 files changed, 36 insertions, 39 deletions
diff --git a/src/cleaners/player.ts b/src/cleaners/player.ts index 802cdd5..1fd6f85 100644 --- a/src/cleaners/player.ts +++ b/src/cleaners/player.ts @@ -14,7 +14,6 @@ export interface CleanPlayer extends CleanBasicPlayer { rank: CleanRank socials: CleanSocialMedia profiles?: CleanBasicProfile[] - // first_join?: number } export async function cleanPlayerResponse(data: HypixelPlayer): Promise<CleanPlayer | null> { @@ -26,7 +25,6 @@ export async function cleanPlayerResponse(data: HypixelPlayer): Promise<CleanPla username: data.displayname, rank: cleanRank(data), socials: cleanSocialMedia(data), - // first_join: data.firstLogin / 1000, profiles: cleanPlayerSkyblockProfiles(data.stats?.SkyBlock?.profiles) } } diff --git a/src/cleaners/skyblock/collections.ts b/src/cleaners/skyblock/collections.ts index 363a6e0..7be5a9d 100644 --- a/src/cleaners/skyblock/collections.ts +++ b/src/cleaners/skyblock/collections.ts @@ -81,7 +81,7 @@ type CollectionCategory = keyof typeof COLLECTIONS export interface Collection { name: string - xp: number + amount: number level: number category: CollectionCategory } @@ -127,7 +127,7 @@ export function cleanCollections(data: any): Collection[] { if (collectionLevel !== undefined) playerCollections.push({ name: collectionName, - xp: collectionXp, + amount: collectionXp, level: collectionLevel, category: collectionCategory }) diff --git a/src/cleaners/skyblock/election.ts b/src/cleaners/skyblock/election.ts index 127fe96..a773f4a 100644 --- a/src/cleaners/skyblock/election.ts +++ b/src/cleaners/skyblock/election.ts @@ -15,7 +15,7 @@ export interface Candidate { } export interface ElectionData { - last_updated: number + lastUpdated: number previous: { year: number winner: string @@ -42,7 +42,7 @@ function cleanCandidate(data: any, index: number): Candidate { export function cleanElectionResponse(data: any): ElectionData { const previousCandidates = data.mayor.election.candidates.map(cleanCandidate) return { - last_updated: data.lastUpdated / 1000, + lastUpdated: data.lastUpdated, previous: { year: data.mayor.election.year, winner: data.mayor.name, diff --git a/src/cleaners/skyblock/inventory.ts b/src/cleaners/skyblock/inventory.ts index 5ad6617..16c74fa 100644 --- a/src/cleaners/skyblock/inventory.ts +++ b/src/cleaners/skyblock/inventory.ts @@ -17,11 +17,11 @@ interface Item { } reforge?: string - anvil_uses?: number + anvilUses?: number timestamp?: string enchantments?: { [ name: string ]: number } - head_texture?: string + headTexture?: string } export type Inventory = Item[] @@ -63,10 +63,10 @@ function cleanItem(rawItem): Item | null { reforge: extraAttributes?.modifier, enchantments: extraAttributes?.enchantments, - anvil_uses: extraAttributes?.anvil_uses, + anvilUses: extraAttributes?.anvil_uses, timestamp: extraAttributes?.timestamp, - head_texture: headId, + headTexture: headId, } } diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts index 8d1fdf1..b90d0c4 100644 --- a/src/cleaners/skyblock/member.ts +++ b/src/cleaners/skyblock/member.ts @@ -19,21 +19,21 @@ import { Bank } from './bank.js' export interface CleanBasicMember { uuid: string username: string - last_save: number - first_join: number + lastSave: number + firstJoin: number rank: CleanRank } export interface CleanMember extends CleanBasicMember { purse: number stats: StatItem[] - rawHypixelStats?: { [key: string]: number } + rawHypixelStats: { [key: string]: number } minions: CleanMinion[] - fairy_souls: FairySouls + fairySouls: FairySouls inventories?: Inventories objectives: Objective[] skills: Skill[] - visited_zones: Zone[] + zones: Zone[] collections: Collection[] slayers: SlayerData } @@ -44,8 +44,8 @@ export async function cleanSkyBlockProfileMemberResponseBasic(member: any): Prom return { uuid: member.uuid, username: player.username, - last_save: member.last_save / 1000, - first_join: member.first_join / 1000, + lastSave: member.last_save, + firstJoin: member.first_join, rank: player.rank } } @@ -65,8 +65,8 @@ export async function cleanSkyBlockProfileMemberResponse(member, included: Inclu return { uuid: member.uuid, username: player.username, - last_save: member.last_save / 1000, - first_join: member.first_join / 1000, + lastSave: member.last_save, + firstJoin: member.first_join, rank: player.rank, purse: member.coin_purse, @@ -77,11 +77,11 @@ export async function cleanSkyBlockProfileMemberResponse(member, included: Inclu rawHypixelStats: member.stats ?? {}, minions: await cleanMinions(member), - fairy_souls: fairySouls, + fairySouls: fairySouls, inventories: inventoriesIncluded ? await cleanInventories(member) : undefined, objectives: cleanObjectives(member), skills: await cleanSkills(member), - visited_zones: await cleanVisitedZones(member), + zones: await cleanVisitedZones(member), collections: cleanCollections(member), slayers: cleanSlayers(member) } @@ -91,20 +91,19 @@ export async function cleanSkyBlockProfileMemberResponse(member, included: Inclu export interface CleanMemberProfilePlayer extends CleanPlayer { // The profile name may be different for each player, so we put it here profileName: string - first_join: number - last_save: number - bank?: Bank - purse?: number - stats?: StatItem[] - rawHypixelStats?: { [key: string]: number } - minions?: CleanMinion[] - fairy_souls?: FairySouls + firstJoin: number + lastSave: number + purse: number + stats: StatItem[] + rawHypixelStats: { [key: string]: number } + minions: CleanMinion[] + fairySouls: FairySouls inventories?: Inventories - objectives?: Objective[] - skills?: Skill[] - visited_zones?: Zone[] - collections?: Collection[] - slayers?: SlayerData + objectives: Objective[] + skills: Skill[] + zones: Zone[] + collections: Collection[] + slayers: SlayerData } export interface CleanMemberProfile { diff --git a/src/cleaners/skyblock/profile.ts b/src/cleaners/skyblock/profile.ts index d5ddc61..a510563 100644 --- a/src/cleaners/skyblock/profile.ts +++ b/src/cleaners/skyblock/profile.ts @@ -12,7 +12,7 @@ export interface CleanFullProfile extends CleanProfile { members: CleanMember[] bank: Bank minions: CleanMinion[] - minion_count: number + minionCount: number maxUniqueMinions: number } @@ -20,7 +20,7 @@ export interface CleanFullProfileBasicMembers extends CleanProfile { members: CleanBasicMember[] bank: Bank minions: CleanMinion[] - minion_count: number + minionCount: number maxUniqueMinions: number } @@ -94,7 +94,7 @@ export async function cleanSkyblockProfileResponse(data: any, options?: ApiOptio members: cleanedMembers, bank: cleanBank(data), minions: minions, - minion_count: uniqueMinions, + minionCount: uniqueMinions, maxUniqueMinions: maxUniqueMinions ?? 0, } } diff --git a/src/cleaners/skyblock/slayers.ts b/src/cleaners/skyblock/slayers.ts index 4852160..f4d203e 100644 --- a/src/cleaners/skyblock/slayers.ts +++ b/src/cleaners/skyblock/slayers.ts @@ -16,7 +16,7 @@ interface SlayerTier { export interface Slayer { name?: SlayerName - raw_name: string + rawName: string xp: number level: number kills: number @@ -81,7 +81,7 @@ export function cleanSlayers(data: any): SlayerData { const slayer: Slayer = { name: slayerName, - raw_name: slayerNameRaw, + rawName: slayerNameRaw, tiers: slayerTiers, xp: slayerXp ?? 0, level: slayerLevel, |