mcutils-js-api 2.0.39 → 2.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,8 @@ import { ServerRegistryEntry } from "./types/server-registry/server-registry-ent
|
|
|
8
8
|
import { Player } from "./types/player/player";
|
|
9
9
|
import { CachedPlayerName } from "./types/cache/cached-player-name";
|
|
10
10
|
import { StatisticsResponse } from "./types/response/statistics-response";
|
|
11
|
-
import { Skin } from "./types/player/skin/skin";
|
|
12
|
-
import { Page } from "./types/pagination/pagination";
|
|
13
11
|
import { PlayerSearchEntry } from "./types/player/player-search-entry";
|
|
12
|
+
import { SkinsResponsePage } from "./types/response/skins-response";
|
|
14
13
|
export declare class McUtilsAPI {
|
|
15
14
|
private readonly endpoint;
|
|
16
15
|
private readonly fetchOptions?;
|
|
@@ -203,7 +202,7 @@ export declare class McUtilsAPI {
|
|
|
203
202
|
* @returns the list of skins or the error (if one occurred)
|
|
204
203
|
*/
|
|
205
204
|
fetchSkins(page?: number): Promise<{
|
|
206
|
-
skins?:
|
|
205
|
+
skins?: SkinsResponsePage;
|
|
207
206
|
error?: ErrorResponse;
|
|
208
207
|
}>;
|
|
209
208
|
/**
|
|
@@ -213,7 +212,7 @@ export declare class McUtilsAPI {
|
|
|
213
212
|
* @returns the player search entry or the error (if one occurred)
|
|
214
213
|
*/
|
|
215
214
|
searchPlayers(query: string): Promise<{
|
|
216
|
-
|
|
215
|
+
entries?: PlayerSearchEntry[];
|
|
217
216
|
error?: ErrorResponse;
|
|
218
217
|
}>;
|
|
219
218
|
}
|
package/dist/index.js
CHANGED
|
@@ -214,8 +214,8 @@ export class McUtilsAPI {
|
|
|
214
214
|
* @returns the player search entry or the error (if one occurred)
|
|
215
215
|
*/
|
|
216
216
|
async searchPlayers(query) {
|
|
217
|
-
const { data, error } = await this.request(`/players
|
|
218
|
-
return error ? { error } : {
|
|
217
|
+
const { data, error } = await this.request(`/players${this.buildParams({ query: query })}`);
|
|
218
|
+
return error ? { error } : { entries: data };
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
export default McUtilsAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|