1.1.1 • Published 6 months ago

yabsl v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

yabsl

Yet another Beat Saber library. A wrapper for all major Beat Saber services.

Installation

npm i yabsl
# or
yarn add yabsl

Usage

CommonJS import

const yabsl = require('yabsl');

const beatsaver = yabsl.BeatSaver

OR

const { BeatSaver } = require('yabsl');

ES6 import

import yabsl from 'yabsl';

const beatsaver = yabsl.BeatSaver

OR

import { BeatSaver } from 'yabsl';

Using the wrapper

import { BeatSaver } from 'yabsl';

async function someFunction() {
    const maps = await BeatSaver.maps.search("Latest", "Camellia", 0, {
        verified: true
    });

    // Returns an array of maps fitting the search criteria
}

The library is fully typed so all of the objects and functions will display what they need/have.

Yabsl is compatible with both JavaScript and TypeScript

Roadmap

  • BeatLeader support
  • Full AccSaber support

All yabsl functions

BeatSaver

Usable functions

Maps:

  • id - Get a map by it's id
  • hash - Get a map by it's hash
  • multiple - Get multiple maps by id (eg. '1', '2', '3')
  • uploader - Get maps by uploader
  • collaborations - Get maps by uploader including collaborations
  • latest - Get the latest maps
  • search - Search for the maps, more options explained later.

Playlists:

  • id - Get a playlist by id
  • user - Get playlists made by a user
  • latest - Get the latest playlists
  • search - Search for the playlists, more options explained later.

Users:

  • id - Get a user by their id
  • name - Get a user by their name

Votes:

  • get - Get all the votes from a specific date onward

Options

ALL OPTIONS ARE OPTIONAL!!!

Map search options:

OptionType
automapperboolean
chromaboolean
cinemaboolean
curatedboolean
fromstring (date)
fullSpreadboolean
maxBpmnumber
maxDurationnumber
maxNpsnumber
maxRatingnumber
minBpmnumber
minDurationnumber
minNpsnumber
minRatingnumber
noodleboolean
tagsstring[]
tostring (date)
verifiedboolean

Playlist search options:

OptionType
curatedboolean
fromstring (date)
includeEmptyboolean
maxNpsnumber
minNpsnumber
tostring (date)
verifiedboolean

BeatLeader

Usable functions

Leaderboards:

  • id - Get a leaderboard by it's id, more options explained later
  • clanRanking - Get the clean ranking on a leaderboard
  • clanRankingGlobal - Get the clan ranking on all leaderboards
  • hash - Get the leaderboard by hash
  • get - Get leaderboards by your query options, more options explained later
  • getGruoped - Same as above but grouped
  • ranking - Get the ranking of a certain map
  • statistic - Get the statistics of a certain leaderboard

Players:

  • id - Get the player by their id
  • discord - Get the player by their discord id
  • beatsaver - Get the player by their beatsaver id
  • get - Get multiple players by your query, more options explained later
  • event - Get the event by it's id, more options explained later

Scores:

  • get - Get the scores of a player, more options explained later
  • getCompact - Get the scores of a player but it's compact now, same options as get
  • getValue - Get the score value of a player on a certain map
  • histogram - Get the histogram of a player, options the same as get with the added batch property
  • accGraph - Get the accuracy graph of a player
  • history - Get the history of a player
  • getPinnedScores - Get the pinned scores of a player

Clans:

  • get - Get the clans according to your query, more options explained later
  • tag - Get the clan according to your tag, more options explained later

Playlists:

  • get - Get all the playlists
  • id - Get the playlist data according to it's id
  • image - Get the playlist image as a buffer or download it

Events:

  • get - Get the events according to your query, more options explained later
  • id - Get an event by it's id

Options

ALL OPTIONS ARE OPTIONAL!!!

Leaderboards id options:

OptionType
pagenumber
countnumber
sortBystring
ordernumber
scoreStatusnumber
leaderboardContextnumber
countriesstring
searchstring
modifiersstring

Leaderboard get and getGroupped options:

OptionType
pagenumber
countnumber
sortBynumber
ordernumber
searchstring
typenumber
modestring
mapTypenumber
allTypesnumber
mapRequirementsnumber
allRequirementsnumber
myTypenumber
stars_fromstring
stars_tostring
accrating_fromnumber
accrating_tonumber
passrating_fromnumber
passrating_tonumber
techrating_fromnumber
techrating_tonumber
date_fromnumber
date_tonumber

Players get options:

OptionType
sortBystring
pagenumber
countnumber
searchstring
ordernumber
countriesstring
mapTypesstring
ppTypestring
leaderboardContextnumber
pp_rangestring
score_rangestring
platformstring
rolestring
hmdstring
clansstring
activityPeriodnumber
bannedboolean

Player events options:

OptionType
sortBystring
pagenumber
countnumber
searchstring
ordernumber
countriesstring

Scores get options:

OptionType
sortBystring
ordernumber
pagenumber
countnumber
searchstring
diffstring
modestring
requirementsnumber
scoreStatusnumber
leaderboardContextnumber
typestring
modifiersstring
stars_fromnumber
stars_tonumber
time_fromnumber
time_tonumber
eventIdnumber

Clans get options:

OptionType
pagenumber
countnumber
searchstring
sortstring
ordernumber
typestring
sortBystring

Clan tag options:

OptionType
pagenumber
countnumber
searchstring
sortstring
ordernumber
capturedLeaderboardsstring

Events get options:

OptionType
pagenumber
countnumber
sortBystring
searchstring
ordernumber

ScoreSaber

Usable functions

Leaderboards:

  • get - Get leaderboards by a text query, more options explained later
  • id - Get a leaderboard by it's id
  • infoByHash - Get a leaderboard by a song's hash and difficulty
  • scoresById - Get the scores on a leaderboard by it's id
  • scoresByHash - Get the scores by the songs's hash and difficulty, more options explained later
  • getDifficulties - Get the difficulties of a map by it's hash

Players:

  • get - Get the players by querying their name
  • count - Returns the amount of players by your query
  • basic - Get the basic info of a player with their ID
  • full - Get the full info of a player with their ID
  • scores - Get the player's scores by their id

Rankings:

  • id - Get a ranking request by it's ID
  • leaderboardId - Get a ranking request by it's leaderboard ID

Options

ALL OPTIONS ARE OPTIONAL!!!

Leadearboards get options:

OptionType
rankedboolean
qualifiedboolean
lovedboolean
minStarnumber
maxStarnumber
categorynumber
sortnumber
uniqueboolean
withMetadataboolean

Scores by hash options:

OptionType
countriesstring[]
searchstring
withMetadataboolean

Hitbloq

Usable functions

Ladders:

  • get - Get the ladder for a certain pool ID
  • near - Get the players near the player of the pool ID

Pools:

  • get - Get the pool names
  • detailed - Get the pools but with more information
  • popular - Get the names of all the popular pools

Ranked:

  • id - Get the pool information + the first 30 ranked maps
  • maps - Get the ranked maps from a pool

Users:

  • scores - Get a few scores from a user on a certain pool
  • allScores - Get all the scores from a user on a certain pool
  • badges - Get the list of badges that a user has

AccSaber

Leaderboards:

  • overallAcc - Get all the players on the leaderboard for overall accuracy
  • techAcc - Get all the players on the leaderboard for tech accuracy
  • trueAcc - Get all the players on the leaderboard for true accuracy
  • standardAcc - Get all the players on the leaderboard for standard accuracy

Players:

  • get - Get all the players on AccSaber
  • id - Get a certain player and choose which category to look up their stats for

Maps:

  • get - Get all ranked maps
  • id - Get the map with a certain leaderboard id
  • category - Get all ranked maps of a certain category
  • playlist - Get or download a playlist of all ranked maps
1.1.1

6 months ago

1.1.0

6 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago