import BaseAPI from "./BaseAPI" ; import Client from "../Client" ; export type GetAssetsThumbnailsOptions = { assetIds : number [ ] ; returnPolicy ? : "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated" ; size ? : "42x42" | "50x50" | "75x75" | "110x110" | "140x140" | "150x150" | "160x100" | "160x600" | "250x250" | "256x144" | "300x250" | "304x166" | "384x216" | "396x216" | "420x420" | "480x270" | "512x512" | "576x324" | "700x700" | "728x90" | "768x432" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetAssetsThumbnails = { data : { targetId : number ; state : "Error" | string ; imageUrl : string ; } [ ] ; } ; export type GetBadgesIconsOptions = { badgeIds : number [ ] ; size ? : "150x150" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetBadgesIcons = GetAssetsThumbnails ; export type GetBundlesThumbnailsOptions = { bundleIds : number [ ] ; size ? : "150x150" | "420x420" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetBundlesThumbnails = GetAssetsThumbnails ; export type GetDeveloperProductsIconsOptions = { developerProductIds : number [ ] ; size ? : "150x150" | "420x420" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetDeveloperProductsIcons = GetAssetsThumbnails ; export type GetGamePassesIconsOptions = { gamePassIds : number [ ] ; size ? : "150x150" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetGamePassesIcons = GetAssetsThumbnails ; export type GetUniverseThumbnailsOptions = { universeId : number ; thumbnailIds : number [ ] ; size ? : "768x432" | "576x324" | "480x270" | "384x216" | "256x144" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUniverseThumbnails = GetAssetsThumbnails ; export type GetUniversesRootPlaceThumbnailsOptions = { universeIds : number [ ] ; returnPolicy ? : "PlaceHolder" | "AutoGenerated" | "ForceAutoGenerated" ; size ? : "50x50" | "128x128" | "150x150" | "256x256" | "512x512" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUniversesRootPlaceThumbnails = GetAssetsThumbnails ; export type GetUniversesThumbnailsOptions = { universeIds : number [ ] ; countPerUniverse ? : number ; defaults ? : boolean ; size ? : "768x432" | "576x324" | "480x270" | "384x216" | "256x144" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUniversesThumbnails = { data : { universeId : number ; error ? : { code : number ; message : string ; userFacingMessage : string ; field : string ; fieldData : unknown ; } ; thumbnails : { targetId : number ; state : "Error" | string ; imageUrl : string ; } [ ] ; } [ ] ; } ; export type GetGroupsIconsOptions = { groupIds : number [ ] ; size ? : "150x150" | "420x420" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetGroupsIcons = GetAssetsThumbnails ; export type GetUsersFullBodyAvatarImagesOptions = { userIds : number [ ] ; size ? : "30x30" | "48x48" | "60x60" | "75x75" | "100x100" | "140x140" | "150x150" | "150x200" | "180x180" | "250x250" | "352x352" | "420x420" | "720x720" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUsersFullBodyAvatarImages = GetAssetsThumbnails ; export type GetUsersAvatarBustImagesOptions = { userIds : number [ ] ; size ? : "50x50" | "60x60" | "75x75" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUsersAvatarBustImages = GetAssetsThumbnails ; export type GetUsersAvatarHeadShotsImagesOptions = { userIds : number [ ] ; size ? : "48x48" | "50x50" | "60x60" | "75x75" | "110x110" | "150x150" | "180x180" | "352x352" | "420x420" | "720x720" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUsersAvatarHeadShotsImages = GetAssetsThumbnails ; export type GetUsersOutfitsImagesOptions = { userOutfitIds : number [ ] ; size ? : "150x150" | "420x420" ; format ? : "png" | "jpg" ; isCircular ? : boolean ; } ; export type GetUsersOutfitsImages = GetAssetsThumbnails ; export type GetBatchImagesOptions = { requestId : string ; targetId : number ; type : "Avatar" | "AvatarHeadShot" | "GameIcon" | "BadgeIcon" | "GameThumbnail" | "GamePass" | "Asset" | "BundleThumbnail" | "Outfit" | "GroupIcon" | "DeveloperProduct" | "AutoGeneratedAsset" ; size : string ; isCircular : boolean ; } ; export type GetBatchImages = { data : { requestId : string ; errorCode ? : number ; errorMessage ? : string ; targetId : number ; state : "Error" | string ; imageUrl : string ; } [ ] ; } ; export default class ThumbnailsAPI extends BaseAPI { constructor ( client ) { super ( { client , baseUrl : "https://thumbnails.roblox.com/" } ) ; } getAssetsThumbnails ( options ) { const assetIdsQueryString = `assetIds=${ options . assetIds . join ( "&assetIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/assets?${ assetIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getBadgesIcons ( options ) { const badgeIdsQueryString = `badgeIds=${ options . badgeIds . join ( "&badgeIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/badges/icons?${ badgeIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getBundlesThumbnails ( options ) { const bundleIdsQueryString = `bundleIds=${ options . bundleIds . join ( "&bundleIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/bundles/thumbnails?${ bundleIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getDeveloperProductIcons ( options ) { const developerProductIdsQueryString = `developerProductIds=${ options . developerProductIds . join ( "&developerProductIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/developer-products/icons?${ developerProductIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getGamePassesIcons ( options ) { const gamePassIdsQueryString = `gamePassIds=${ options . gamePassIds . join ( "&gamePassIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/assets?${ gamePassIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUniverseThumbnailIds ( options ) { return this . request ( { requiresAuth : false , request : { path : `v1/games/${ options . universeId }/thumbnails` , qs : options } , json : true } ) . then ( response => response . body ) ; } getUniversesRootPlaceThumbnail ( options ) { const universeIdsQueryString = `universeIds=${ options . universeIds . join ( "&universeIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/games/icons?${ universeIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUniversesThumbnailIds ( options ) { const universeIdsQueryString = `universeIds=${ options . universeIds . join ( "&universeIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/games/multiget/thumbnails?${ universeIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getGroupsIcons ( options ) { const groupIdsQueryString = `groupIds=${ options . groupIds . join ( "&groupIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/groups/icons?${ groupIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUsersFullBodyAvatarImages ( options ) { const userIdsQueryString = `userIds=${ options . userIds . join ( "&userIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/users/avatar?${ userIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUsersAvatarBustImages ( options ) { const userIdsQueryString = `userIds=${ options . userIds . join ( "&userIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/users/avatar-bust?${ userIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUsersAvatarHeadShotImages ( options ) { const userIdsQueryString = `userIds=${ options . userIds . join ( "&userIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/users/avatar-headshot?${ userIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getUsersOutfitsImages ( options ) { const outfitIdsQueryString = `userOutfitIds=${ options . userOutfitIds . join ( "&userOutfitIds=" ) }` ; return this . request ( { requiresAuth : false , request : { path : `v1/assets?${ outfitIdsQueryString }` , qs : { ... options } } , json : true } ) . then ( response => response . body ) ; } getBatchImages ( options ) { return this . request ( { requiresAuth : false , request : { path : `v1/batch` , method : "POST" , json : options } , json : true } ) . then ( response => response . body ) ; } }