mcutils-js-api 2.0.37 → 2.0.38
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
|
@@ -10,6 +10,7 @@ import { CachedPlayerName } from "./types/cache/cached-player-name";
|
|
|
10
10
|
import { StatisticsResponse } from "./types/response/statistics-response";
|
|
11
11
|
import { Skin } from "./types/player/skin/skin";
|
|
12
12
|
import { Page } from "./types/pagination/pagination";
|
|
13
|
+
import { PlayerSearchEntry } from "./types/player/player-search-entry";
|
|
13
14
|
export declare class McUtilsAPI {
|
|
14
15
|
private readonly endpoint;
|
|
15
16
|
private readonly fetchOptions?;
|
|
@@ -205,5 +206,15 @@ export declare class McUtilsAPI {
|
|
|
205
206
|
skins?: Page<Skin>;
|
|
206
207
|
error?: ErrorResponse;
|
|
207
208
|
}>;
|
|
209
|
+
/**
|
|
210
|
+
* Search for players by username.
|
|
211
|
+
*
|
|
212
|
+
* @param query the query to search for (eg: aetheria)
|
|
213
|
+
* @returns the player search entry or the error (if one occurred)
|
|
214
|
+
*/
|
|
215
|
+
searchPlayers(query: string): Promise<{
|
|
216
|
+
entry?: PlayerSearchEntry;
|
|
217
|
+
error?: ErrorResponse;
|
|
218
|
+
}>;
|
|
208
219
|
}
|
|
209
220
|
export default McUtilsAPI;
|
package/dist/index.js
CHANGED
|
@@ -207,5 +207,15 @@ export class McUtilsAPI {
|
|
|
207
207
|
const { data, error } = await this.request(`/skins${this.buildParams({ page: String(page) })}`);
|
|
208
208
|
return error ? { error } : { skins: data };
|
|
209
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Search for players by username.
|
|
212
|
+
*
|
|
213
|
+
* @param query the query to search for (eg: aetheria)
|
|
214
|
+
* @returns the player search entry or the error (if one occurred)
|
|
215
|
+
*/
|
|
216
|
+
async searchPlayers(query) {
|
|
217
|
+
const { data, error } = await this.request(`/players/search/${query}`);
|
|
218
|
+
return error ? { error } : { entry: data };
|
|
219
|
+
}
|
|
210
220
|
}
|
|
211
221
|
export default McUtilsAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|