Skip to content

v0.2.0

Compare
Choose a tag to compare
@Pixelicc Pixelicc released this 21 Jun 14:27
· 74 commits to main since this release

Major Changes

The Library is now based on Client Class to interact with the Mowojang API.

Creating a new Client would be done the following way:

import { Client as MowojangClient } from "mowojang"

const Mowojang = new MowojangClient()

const UUID = await Mowojang.getUUID("Pixelic")
const username = await Mowojang.getUsername("14727fae-fbdc-4aff-848c-d2713eb9939e")

Other Exports such as the Utilities and Validator Functions now need to be imported the following way:

import { utils, validate } from "mowojang"

const isValid = validate.UUID("14727fae-fbdc-4aff-848c-d2713eb9939e")
const undashed = utils.undashUUID("14727fae-fbdc-4aff-848c-d2713eb9939e")

There were also major changes to the now exported classes and their naming schemes.
The following methods to interact with the Mowojang API are implemented:

  • getProfiles(): Retrieve full Player Data of multiple Players by UUID or Username
  • getProfile(): Retrieve full Player Data by UUID or Username
  • getSessions(): Retrieve Player Session Data of multiple Players by UUID or Username
  • getSession(): Retrieve Player Session Data by UUID or Username
  • getUUID(): Converts Username to UUID
  • getUsername(): Converts UUID to Username
  • getSkin(): Returns the Skin the specified Player is currently wearing
  • getSkinBuffer(): Skin-Data fetched via getSkin() as a Buffer
  • getCape(): Returns the Cape the specified Player is currently wearing
  • getCapeBuffer(): Cape-Data fetched via getCape() as a Buffer

Furthermore the Library this way supports full control over your caching behaviour through exposing the internally used axios-cache-interceptor library config. More details about this can be found here.