Skip to content

Commit

Permalink
Merge branch 'patmmccann-patch-1' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Feb 22, 2022
2 parents 9c0975a + b0457ed commit bd2e9f1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 2 additions & 0 deletions modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js';
const BIDDER_CODE = '33across';
const END_POINT = 'https://ssc.33across.com/api/v1/hb';
const SYNC_ENDPOINT = 'https://ssc-cms.33across.com/ps/?m=xch&rt=html&ru=deb';
const GVLID = 58;

const CURRENCY = 'USD';
const GUID_PATTERN = /^[a-zA-Z0-9_-]{22}$/;
Expand Down Expand Up @@ -735,6 +736,7 @@ export const spec = {

code: BIDDER_CODE,
supportedMediaTypes: [ BANNER, VIDEO ],
gvlid: GVLID,
isBidRequestValid,
buildRequests,
interpretResponse,
Expand Down
40 changes: 39 additions & 1 deletion modules/smaatoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,45 @@ import {ADPOD, BANNER, VIDEO} from '../src/mediaTypes.js';

const BIDDER_CODE = 'smaato';
const SMAATO_ENDPOINT = 'https://prebid.ad.smaato.net/oapi/prebid';
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.6'
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.6';
const CURRENCY = 'USD';
const CLIENT = 'prebid_js_$prebid.version$_1.1';
const GVLID = 82;

/**
* Transform BidRequest to OpenRTB-formatted BidRequest Object
* @param {Array<BidRequest>} validBidRequests
* @param {any} bidderRequest
* @returns {string}
*/
const buildOpenRtbBidRequestPayload = (validBidRequests, bidderRequest) => {
/**
* Turn incoming prebid sizes into openRtb format mapping.
* @param {*} sizes in format [[10, 10], [20, 20]]
* @returns array of openRtb format mappings [{w: 10, h: 10}, {w: 20, h: 20}]
*/
const parseSizes = (sizes) => {
return sizes.map((size) => {
return {w: size[0], h: size[1]};
})
}

const imp = validBidRequests.map(br => {
const bannerMediaType = utils.deepAccess(br, 'mediaTypes.banner');
const videoMediaType = utils.deepAccess(br, 'mediaTypes.video');
let result = {
id: br.bidId,
tagid: utils.deepAccess(br, 'params.adspaceId')
}

if (bannerMediaType) {
const sizes = parseSizes(utils.getAdUnitSizes(br));
result.banner = {
w: sizes[0].w,
h: sizes[0].h,
format: sizes
}
}

const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
const requestTemplate = {
Expand Down Expand Up @@ -110,6 +147,7 @@ const buildServerRequest = (validBidRequest, data) => {
export const spec = {
code: BIDDER_CODE,
supportedMediaTypes: [BANNER, VIDEO],
gvlid: GVLID,

/**
* Determines whether or not the given bid request is valid.
Expand Down

0 comments on commit bd2e9f1

Please sign in to comment.