mcutils-js-api 2.0.41 → 2.0.43
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 +12 -1
- package/dist/index.js +10 -0
- package/dist/types/response/skin/skin-dto.d.ts +7 -0
- package/dist/types/response/{skins-response.d.ts → skin/skins-response.d.ts} +2 -1
- package/dist/types/response/skin/skins-response.js +1 -0
- package/package.json +1 -1
- /package/dist/types/response/{skins-response.js → skin/skin-dto.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,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
11
|
import { PlayerSearchEntry } from "./types/player/player-search-entry";
|
|
12
|
-
import { SkinsResponsePage } from "./types/response/skins-response";
|
|
12
|
+
import { SkinsResponsePage } from "./types/response/skin/skins-response";
|
|
13
|
+
import { SkinDTO } from "./types/response/skin/skin-dto";
|
|
13
14
|
export declare class McUtilsAPI {
|
|
14
15
|
private readonly endpoint;
|
|
15
16
|
private readonly fetchOptions?;
|
|
@@ -215,5 +216,15 @@ export declare class McUtilsAPI {
|
|
|
215
216
|
entries?: PlayerSearchEntry[];
|
|
216
217
|
error?: ErrorResponse;
|
|
217
218
|
}>;
|
|
219
|
+
/**
|
|
220
|
+
* Fetch the details of a specific skin.
|
|
221
|
+
*
|
|
222
|
+
* @param id the ID of the skin (UUID)
|
|
223
|
+
* @returns the skin details or the error (if one occurred)
|
|
224
|
+
*/
|
|
225
|
+
fetchSkin(id: string): Promise<{
|
|
226
|
+
skin?: SkinDTO;
|
|
227
|
+
error?: ErrorResponse;
|
|
228
|
+
}>;
|
|
218
229
|
}
|
|
219
230
|
export default McUtilsAPI;
|
package/dist/index.js
CHANGED
|
@@ -217,5 +217,15 @@ export class McUtilsAPI {
|
|
|
217
217
|
const { data, error } = await this.request(`/players${this.buildParams({ query: query })}`);
|
|
218
218
|
return error ? { error } : { entries: data };
|
|
219
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Fetch the details of a specific skin.
|
|
222
|
+
*
|
|
223
|
+
* @param id the ID of the skin (UUID)
|
|
224
|
+
* @returns the skin details or the error (if one occurred)
|
|
225
|
+
*/
|
|
226
|
+
async fetchSkin(id) {
|
|
227
|
+
const { data, error } = await this.request(`/skins/${id}`);
|
|
228
|
+
return error ? { error } : { skin: data };
|
|
229
|
+
}
|
|
220
230
|
}
|
|
221
231
|
export default McUtilsAPI;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
File without changes
|