File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed
Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " mcutils-js-api" ,
3- "version" : " 2.0.42 " ,
3+ "version" : " 2.0.43 " ,
44 "module" : " dist/index.js" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import { StatisticsResponse } from "./types/response/statistics-response";
1212import { Skin } from "./types/player/skin/skin" ;
1313import { Page } from "./types/pagination/pagination" ;
1414import { PlayerSearchEntry } from "./types/player/player-search-entry" ;
15- import { SkinsResponsePage } from "./types/response/skins-response" ;
15+ import { SkinsResponsePage } from "./types/response/skin/skins-response" ;
16+ import { SkinDTO } from "./types/response/skin/skin-dto" ;
1617
1718type RequestOptions = RequestInit & { responseType ?: "json" | "arrayBuffer" } ;
1819
@@ -333,6 +334,17 @@ export class McUtilsAPI {
333334 const { data, error } = await this . request < PlayerSearchEntry [ ] > ( `/players${ this . buildParams ( { query : query } ) } ` ) ;
334335 return error ? { error } : { entries : data } ;
335336 }
337+
338+ /**
339+ * Fetch the details of a specific skin.
340+ *
341+ * @param id the ID of the skin (UUID)
342+ * @returns the skin details or the error (if one occurred)
343+ */
344+ async fetchSkin ( id : string ) : Promise < { skin ?: SkinDTO ; error ?: ErrorResponse } > {
345+ const { data, error } = await this . request < SkinDTO > ( `/skins/${ id } ` ) ;
346+ return error ? { error } : { skin : data } ;
347+ }
336348}
337349
338350export default McUtilsAPI ;
Original file line number Diff line number Diff line change 1+ export type SkinDTO = {
2+ id : string ;
3+ imageUrl : string ;
4+ accountsUsed : number ;
5+ firstSeenUsing : string ;
6+ accountsSeenUsing : string [ ] ;
7+ } ;
Original file line number Diff line number Diff line change 1- import { Page } from "../pagination/pagination" ;
1+ import { Page } from "../../ pagination/pagination" ;
22
33export type SkinsResponse = {
44 id : string ;
You can’t perform that action at this time.
0 commit comments