From c9097dc2d0749fa63fd731423bc87a5452f0444d Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Thu, 27 May 2021 16:56:50 -0500 Subject: Profile customization (#45) * add basic discord auth * add uuid dependency * add lastUpdated to sessions * add route to get session from id * add accounts collection * update build * add gm rank * add `customization` url parameter * add customization parameter to /player/:user * add route to get info from discord id * remove a console.log * Update database.js * Update package.json * fix tests --- src/cleaners/rank.ts | 2 +- src/cleaners/skyblock/member.ts | 2 ++ src/cleaners/skyblock/slayers.ts | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/cleaners') diff --git a/src/cleaners/rank.ts b/src/cleaners/rank.ts index 997888c..2d80e31 100644 --- a/src/cleaners/rank.ts +++ b/src/cleaners/rank.ts @@ -46,8 +46,8 @@ export function cleanRank({ name = newPackageRank?.replace('_PLUS', '+') ?? packageRank?.replace('_PLUS', '+') - // MVP++ is called Superstar for some reason switch (name) { + // MVP++ is called Superstar for some reason case 'SUPERSTAR': name = 'MVP++' break diff --git a/src/cleaners/skyblock/member.ts b/src/cleaners/skyblock/member.ts index 7a57975..0ec2c0a 100644 --- a/src/cleaners/skyblock/member.ts +++ b/src/cleaners/skyblock/member.ts @@ -5,6 +5,7 @@ import { cleanObjectives, Objective } from './objectives' import { CleanFullProfileBasicMembers } from './profile' import { cleanProfileStats, StatItem } from './stats' import { CleanMinion, cleanMinions } from './minions' +import { AccountCustomization } from '../../database' import { cleanSlayers, SlayerData } from './slayers' import { cleanVisitedZones, Zone } from './zones' import { cleanSkills, Skill } from './skills' @@ -108,4 +109,5 @@ export interface CleanMemberProfilePlayer extends CleanPlayer { export interface CleanMemberProfile { member: CleanMemberProfilePlayer profile: CleanFullProfileBasicMembers + customization: AccountCustomization } diff --git a/src/cleaners/skyblock/slayers.ts b/src/cleaners/skyblock/slayers.ts index e9c5cb6..7892eaf 100644 --- a/src/cleaners/skyblock/slayers.ts +++ b/src/cleaners/skyblock/slayers.ts @@ -6,8 +6,7 @@ const SLAYER_NAMES = { wolf: 'sven' } as const -type ApiSlayerName = keyof typeof SLAYER_NAMES -type SlayerName = (typeof SLAYER_NAMES)[ApiSlayerName] +type SlayerName = (typeof SLAYER_NAMES)[keyof typeof SLAYER_NAMES] interface SlayerTier { tier: number, -- cgit