Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 45x 45x 49x 45x | import { baseUrl } from "./environment";
import { generateHMACSHA256Token } from "./hmacToken";
export enum GeneratedImageAPI {
TopTracksCover = "/api/top-tracks-cover",
ConcertCover = "/api/concert-cover",
RadioCover = "/api/radio-cover",
}
export const getGeneratedImageUrl = async (
api: GeneratedImageAPI,
params: Record<string, string>
): Promise<string> => {
const url = new URL(`${baseUrl}${api}`);
const token = await generateHMACSHA256Token(params);
url.search = new URLSearchParams({ ...params, token }).toString();
return url.toString();
};
|