export type GetApiV1AssetsArgs = {assetIds: Array, 'Roblox-Place-Id'?: number | undefined, returnPolicy?: ('PlaceHolder' | 'ForcePlaceHolder' | 'AutoGenerated' | 'ForceAutoGenerated') | undefined, size?: ('30x30' | '42x42' | '50x50' | '60x62' | '75x75' | '110x110' | '140x140' | '150x150' | '160x100' | '160x600' | '250x250' | '256x144' | '300x250' | '304x166' | '384x216' | '396x216' | '420x420' | '480x270' | '512x512' | '576x324' | '700x700' | '728x90' | '768x432' | '1200x80' | '330x110' | '660x220' | '1320x440' | '720x228' | '1440x456' | '930x480') | undefined, format?: ('Png' | 'Jpeg' | 'Webp') | undefined, isCircular?: boolean | undefined}; export type GetApiV1AssetsOptions = {baseUrl?: string | undefined, robloxLegacyCookie?: string | undefined, fetch?: typeof fetch | undefined}; /** * Thumbnails assets. * * GET /v1/assets */ export const getApiV1Assets = async (args: GetApiV1AssetsArgs, options?: GetApiV1AssetsOptions) => { const {baseUrl = "https://thumbnails.roblox.com", fetch: fetchFn = fetch, robloxLegacyCookie} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.assetIds != null) query.append("assetIds", args.assetIds.join(',')) if (args['Roblox-Place-Id'] != null) headers.set("Roblox-Place-Id", String(args['Roblox-Place-Id'])) if (args.returnPolicy != null) query.append("returnPolicy", String(args.returnPolicy)) if (args.size != null) query.append("size", String(args.size)) if (args.format != null) query.append("format", String(args.format)) if (args.isCircular != null) query.append("isCircular", String(args.isCircular)) if (robloxLegacyCookie !== undefined) cookies.push(".ROBLOSECURITY=" + encodeURIComponent(robloxLegacyCookie)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };