mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
DLC: Next Puzzle button & Search functionality, other stuff
This commit is contained in:
@@ -143,6 +143,20 @@ export class ClientAPI {
|
||||
return this._request("/v1/puzzles/list/" + category, {});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ searchTerm: string; difficulty: string; duration: string }} searchOptions
|
||||
* @returns {Promise<import("../savegame/savegame_typedefs").PuzzleMetadata[]>}
|
||||
*/
|
||||
apiSearchPuzzles(searchOptions) {
|
||||
if (!this.isLoggedIn()) {
|
||||
return Promise.reject("not-logged-in");
|
||||
}
|
||||
return this._request("/v1/puzzles/search", {
|
||||
method: "POST",
|
||||
body: searchOptions,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} puzzleId
|
||||
* @returns {Promise<import("../savegame/savegame_typedefs").PuzzleFullData>}
|
||||
@@ -169,7 +183,7 @@ export class ClientAPI {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} shortKey
|
||||
* @param {string} shortKey
|
||||
* @returns {Promise<import("../savegame/savegame_typedefs").PuzzleFullData>}
|
||||
*/
|
||||
apiDownloadPuzzleByKey(shortKey) {
|
||||
|
||||
Reference in New Issue
Block a user