@retroachievements/api
Version:
A well-tested library that lets you get achievement, user, and game data from RetroAchievements.
55 lines (54 loc) • 1.57 kB
TypeScript
import type { AuthObject } from "../utils/public";
import type { RequestListType, UserSetRequests } from "./models";
/**
* A call to this function will retrieve a given user's set requests.
*
* @param authorization An object containing your username and webApiKey.
* This can be constructed with `buildAuthorization()`.
*
* @param payload.username The user for which to retrieve the set requests
* for.
*
* @param payload.requestListType An optional parameter to filter set requests
* by their current status. If omitted, the API will return only active
* requests.
*
* @example
* ```
* const userSetRequests = await getUserSetRequests(authorization, {
* username: "ExampleUser"
* });
* ```
*
* @returns An object containing a list of requested sets that the
* given user made.
* ```json
* {
* "requestedSets": [
* {
* "gameId": 8149,
* "title": "Example Set 1",
* "consoleId": 0,
* "consoleName": "Example Console",
* "imageIcon": "/Images/000001.png"
* },
* {
* "gameId": 9001,
* "title": "Example Set 2",
* "consoleId": 2,
* "consoleName": "Example Console 2",
* "imageIcon": "/Images/000002.png"
* }
* ],
* "totalRequests": 5,
* "pointsForNext": 5000
* }
* ```
*
* @throws If the API was given invalid parameters (422) or if the
* API is currently down (503).
*/
export declare const getUserSetRequests: (authorization: AuthObject, payload: {
username: string;
requestListType?: RequestListType;
}) => Promise<UserSetRequests>;