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 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,7 @@
1
+ export type SkinDTO = {
2
+ id: string;
3
+ imageUrl: string;
4
+ accountsUsed: number;
5
+ firstSeenUsing: string;
6
+ accountsSeenUsing: string[];
7
+ };
@@ -1,5 +1,6 @@
1
- import { Page } from "../pagination/pagination";
1
+ import { Page } from "../../pagination/pagination";
2
2
  export type SkinsResponse = {
3
+ id: string;
3
4
  imageUrl: string;
4
5
  accountsUsed: number;
5
6
  };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcutils-js-api",
3
- "version": "2.0.41",
3
+ "version": "2.0.43",
4
4
  "module": "dist/index.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",