import { BannerAdDimension } from "./src/modules/AdFormats/Banner/types"; import { getAdDimensions, getUniqueId } from "./src/utils"; export const getRequestBody = (dimensions?: BannerAdDimension) => { let rvnBannerWidth = 970; let rvnBannerHeight = 90; if ( dimensions && ["970x90", "300x250", "600x160", "321x101"].includes(dimensions) ) { const { width, height } = getAdDimensions(dimensions); rvnBannerWidth = parseInt(width); rvnBannerHeight = parseInt(height); } const json_body = { id: getUniqueId(), imp: [ { id: "1", banner: { w: rvnBannerWidth, h: rvnBannerHeight, }, }, ], cur: ["USD"], tmax: 120, device: { geo: {}, }, }; return json_body; };