diff --git a/modules/atomxBidAdapter.js b/modules/atomxBidAdapter.js
deleted file mode 100644
index e9f15218c4c..00000000000
--- a/modules/atomxBidAdapter.js
+++ /dev/null
@@ -1,107 +0,0 @@
-import * as utils from '../src/utils.js';
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-
-const BIDDER_CODE = 'atomx';
-
-function getDomain() {
- var domain = '';
-
- try {
- if ((domain === '') && (window.top == window)) {
- domain = window.location.href;
- }
-
- if ((domain === '') && (window.top == window.parent)) {
- domain = document.referrer;
- }
-
- if (domain == '') {
- var atomxt = 'atomxtest';
-
- // It should be impossible to change the window.location.ancestorOrigins.
- window.location.ancestorOrigins[0] = atomxt;
- if (window.location.ancestorOrigins[0] != atomxt) {
- var ancestorOrigins = window.location.ancestorOrigins;
-
- // If the length is 0 we are a javascript tag running in the main domain.
- // But window.top != window or window.location.hostname is empty.
- if (ancestorOrigins.length == 0) {
- // This browser is so fucked up, just return an empty string.
- return '';
- }
-
- // ancestorOrigins is an array where [0] is our own window.location
- // and [length-1] is the top window.location.
- domain = ancestorOrigins[ancestorOrigins.length - 1];
- }
- }
- } catch (unused) {
- }
-
- if (domain === '') {
- domain = document.referrer;
- }
-
- if (domain === '') {
- domain = window.location.href;
- }
-
- return domain.substr(0, 512);
-}
-
-export const spec = {
- code: BIDDER_CODE,
-
- isBidRequestValid: function(bid) {
- return bid.params && (!!bid.params.id);
- },
-
- buildRequests: function(validBidRequests) {
- return validBidRequests.map(bidRequest => {
- return {
- method: 'GET',
- url: 'https://p.ato.mx/placement',
- data: {
- v: 12,
- id: bidRequest.params.id,
- size: utils.parseSizesInput(bidRequest.sizes)[0],
- prebid: bidRequest.bidId,
- b: 0,
- h: '7t3y9',
- type: 'javascript',
- screen: window.screen.width + 'x' + window.screen.height + 'x' + window.screen.colorDepth,
- timezone: new Date().getTimezoneOffset(),
- domain: getDomain(),
- r: document.referrer.substr(0, 512),
- },
- };
- });
- },
-
- interpretResponse: function (serverResponse, bidRequest) {
- const body = serverResponse.body;
- const res = {
- requestId: body.code,
- cpm: body.cpm * 1000,
- width: body.width,
- height: body.height,
- creativeId: body.creative_id,
- currency: 'USD',
- netRevenue: true,
- ttl: 60,
- };
-
- if (body.adm) {
- res.ad = body.adm;
- } else {
- res.adUrl = body.url;
- }
-
- return [res];
- },
-
- getUserSyncs: function(syncOptions, serverResponses) {
- return [];
- },
-};
-registerBidder(spec);
diff --git a/modules/avocetBidAdapter.js b/modules/avocetBidAdapter.js
deleted file mode 100644
index 1283bb865d4..00000000000
--- a/modules/avocetBidAdapter.js
+++ /dev/null
@@ -1,141 +0,0 @@
-import { config } from '../src/config.js';
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { BANNER, VIDEO } from '../src/mediaTypes.js';
-
-const BIDDER_CODE = 'avct';
-const DEFAULT_BASE_URL = 'https://ads.avct.cloud';
-const DEFAULT_PREBID_PATH = '/prebid';
-
-function getPrebidURL() {
- let host = config.getConfig('avct.baseUrl');
- if (host && typeof host === 'string') {
- return `${host}${getPrebidPath()}`;
- }
- return `${DEFAULT_BASE_URL}${getPrebidPath()}`;
-}
-
-function getPrebidPath() {
- let prebidPath = config.getConfig('avct.prebidPath');
- if (prebidPath && typeof prebidPath === 'string') {
- return prebidPath;
- }
- return DEFAULT_PREBID_PATH;
-}
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO],
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {BidRequest} bid The bid with params to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: function (bid) {
- return (
- !!bid.params &&
- !!bid.params.placement &&
- typeof bid.params.placement === 'string' &&
- bid.params.placement.length === 24
- );
- },
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {validBidRequests[]} - an array of bids
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: function (bidRequests, bidderRequest) {
- // Get currency from config
- const currency = config.getConfig('currency.adServerCurrency');
-
- // Publisher domain from config
- const publisherDomain = config.getConfig('publisherDomain');
-
- // First-party data from config
- const fpd = config.getLegacyFpd(config.getConfig('ortb2'));
-
- // GDPR status and TCF consent string
- let tcfConsentString;
- let gdprApplies = false;
- if (bidderRequest.gdprConsent) {
- tcfConsentString = bidderRequest.gdprConsent.consentString;
- gdprApplies = !!bidderRequest.gdprConsent.gdprApplies;
- }
-
- // US privacy string
- let usPrivacyString;
- if (bidderRequest.uspConsent) {
- usPrivacyString = bidderRequest.uspConsent;
- }
-
- // Supply chain
- let schain;
- if (bidderRequest.schain) {
- schain = bidderRequest.schain;
- }
-
- // ID5 identifier
- let id5id;
- if (bidRequests[0].userId && bidRequests[0].userId.id5id && bidRequests[0].userId.id5id.uid) {
- id5id = bidRequests[0].userId.id5id.uid;
- }
-
- // Build the avocet ext object
- const ext = {
- currency,
- tcfConsentString,
- gdprApplies,
- usPrivacyString,
- schain,
- publisherDomain,
- fpd,
- id5id,
- };
-
- // Extract properties from bidderRequest
- const {
- auctionId,
- auctionStart,
- bidderCode,
- bidderRequestId,
- refererInfo,
- timeout,
- } = bidderRequest;
-
- // Construct payload
- const payload = JSON.stringify({
- auctionId,
- auctionStart,
- bidderCode,
- bidderRequestId,
- refererInfo,
- timeout,
- bids: bidRequests,
- ext,
- });
-
- return {
- method: 'POST',
- url: getPrebidURL(),
- data: payload,
- };
- },
- interpretResponse: function (serverResponse, bidRequest) {
- if (
- !serverResponse ||
- !serverResponse.body ||
- typeof serverResponse.body !== 'object'
- ) {
- return [];
- }
- if (Array.isArray(serverResponse.body)) {
- return serverResponse.body;
- }
- if (Array.isArray(serverResponse.body.responses)) {
- return serverResponse.body.responses;
- }
- return [];
- },
-};
-registerBidder(spec);
diff --git a/modules/bidlabBidAdapter.js b/modules/bidlabBidAdapter.js
deleted file mode 100644
index 8f501505a6d..00000000000
--- a/modules/bidlabBidAdapter.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
-import * as utils from '../src/utils.js';
-
-const BIDDER_CODE = 'bidlab';
-const AD_URL = 'https://service.bidlab.ai/?c=o&m=multi';
-const URL_SYNC = 'https://service.bidlab.ai/?c=o&m=sync';
-const NO_SYNC = true;
-
-function isBidResponseValid(bid) {
- if (!bid.requestId || !bid.cpm || !bid.creativeId ||
- !bid.ttl || !bid.currency) {
- return false;
- }
- switch (bid.mediaType) {
- case BANNER:
- return Boolean(bid.width && bid.height && bid.ad);
- case VIDEO:
- return Boolean(bid.vastUrl);
- case NATIVE:
- return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
- default:
- return false;
- }
-}
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
- noSync: NO_SYNC,
-
- isBidRequestValid: (bid) => {
- return Boolean(bid.bidId && bid.params && !isNaN(parseInt(bid.params.placementId)));
- },
-
- buildRequests: (validBidRequests = [], bidderRequest) => {
- let winTop = window;
- let location;
- try {
- location = new URL(bidderRequest.refererInfo.referer)
- winTop = window.top;
- } catch (e) {
- location = winTop.location;
- utils.logMessage(e);
- };
- let placements = [];
- let request = {
- 'deviceWidth': winTop.screen.width,
- 'deviceHeight': winTop.screen.height,
- 'language': (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
- 'secure': 1,
- 'host': location.host,
- 'page': location.pathname,
- 'placements': placements
- };
- request.language.indexOf('-') != -1 && (request.language = request.language.split('-')[0])
- if (bidderRequest) {
- if (bidderRequest.uspConsent) {
- request.ccpa = bidderRequest.uspConsent;
- }
- if (bidderRequest.gdprConsent) {
- request.gdpr = bidderRequest.gdprConsent
- }
- }
- const len = validBidRequests.length;
-
- for (let i = 0; i < len; i++) {
- let bid = validBidRequests[i];
- let traff = bid.params.traffic || BANNER
-
- placements.push({
- placementId: bid.params.placementId,
- bidId: bid.bidId,
- sizes: bid.mediaTypes && bid.mediaTypes[traff] && bid.mediaTypes[traff].sizes ? bid.mediaTypes[traff].sizes : [],
- traffic: traff
- });
- if (bid.schain) {
- placements.schain = bid.schain;
- }
- }
- return {
- method: 'POST',
- url: AD_URL,
- data: request
- };
- },
-
- interpretResponse: (serverResponse) => {
- let response = [];
- for (let i = 0; i < serverResponse.body.length; i++) {
- let resItem = serverResponse.body[i];
- if (isBidResponseValid(resItem)) {
- response.push(resItem);
- }
- }
- return response;
- },
-
- getUserSyncs: (syncOptions, serverResponses) => {
- if (NO_SYNC) {
- return false
- } else {
- return [{
- type: 'image',
- url: URL_SYNC
- }];
- }
- }
-
-};
-
-registerBidder(spec);
diff --git a/modules/bidphysicsBidAdapter.js b/modules/bidphysicsBidAdapter.js
deleted file mode 100644
index b6b5690ede5..00000000000
--- a/modules/bidphysicsBidAdapter.js
+++ /dev/null
@@ -1,134 +0,0 @@
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import * as utils from '../src/utils.js';
-import {BANNER} from '../src/mediaTypes.js';
-
-const ENDPOINT_URL = 'https://exchange.bidphysics.com/auction';
-
-const DEFAULT_BID_TTL = 30;
-const DEFAULT_CURRENCY = 'USD';
-const DEFAULT_NET_REVENUE = true;
-
-export const spec = {
- code: 'bidphysics',
- aliases: ['yieldlift'],
- supportedMediaTypes: [BANNER],
-
- isBidRequestValid: function (bid) {
- return (!!bid.params.unitId && typeof bid.params.unitId === 'string') ||
- (!!bid.params.networkId && typeof bid.params.networkId === 'string') ||
- (!!bid.params.publisherId && typeof bid.params.publisherId === 'string');
- },
-
- buildRequests: function (validBidRequests, bidderRequest) {
- if (!validBidRequests || !bidderRequest) {
- return;
- }
- const publisherId = validBidRequests[0].params.publisherId;
- const networkId = validBidRequests[0].params.networkId;
- const impressions = validBidRequests.map(bidRequest => ({
- id: bidRequest.bidId,
- banner: {
- format: bidRequest.sizes.map(sizeArr => ({
- w: sizeArr[0],
- h: sizeArr[1]
- }))
- },
- ext: {
- bidphysics: {
- unitId: bidRequest.params.unitId
- }
- }
- }));
-
- const openrtbRequest = {
- id: bidderRequest.auctionId,
- imp: impressions,
- site: {
- domain: window.location.hostname,
- page: window.location.href,
- ref: bidderRequest.refererInfo ? bidderRequest.refererInfo.referer || null : null
- },
- ext: {
- bidphysics: {
- publisherId: publisherId,
- networkId: networkId,
- }
- }
- };
-
- // apply gdpr
- if (bidderRequest.gdprConsent) {
- openrtbRequest.regs = {ext: {gdpr: bidderRequest.gdprConsent.gdprApplies ? 1 : 0}};
- openrtbRequest.user = {ext: {consent: bidderRequest.gdprConsent.consentString}};
- }
-
- const payloadString = JSON.stringify(openrtbRequest);
- return {
- method: 'POST',
- url: ENDPOINT_URL,
- data: payloadString,
- };
- },
-
- interpretResponse: function (serverResponse, request) {
- const bidResponses = [];
- const response = (serverResponse || {}).body;
- // response is always one seat (bidphysics) with (optional) bids for each impression
- if (response && response.seatbid && response.seatbid.length === 1 && response.seatbid[0].bid && response.seatbid[0].bid.length) {
- response.seatbid[0].bid.forEach(bid => {
- bidResponses.push({
- requestId: bid.impid,
- cpm: bid.price,
- width: bid.w,
- height: bid.h,
- ad: bid.adm,
- ttl: DEFAULT_BID_TTL,
- creativeId: bid.crid,
- netRevenue: DEFAULT_NET_REVENUE,
- currency: DEFAULT_CURRENCY,
- })
- })
- } else {
- utils.logInfo('bidphysics.interpretResponse :: no valid responses to interpret');
- }
- return bidResponses;
- },
- getUserSyncs: function (syncOptions, serverResponses) {
- utils.logInfo('bidphysics.getUserSyncs', 'syncOptions', syncOptions, 'serverResponses', serverResponses);
- let syncs = [];
-
- if (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled) {
- return syncs;
- }
-
- serverResponses.forEach(resp => {
- const userSync = utils.deepAccess(resp, 'body.ext.usersync');
- if (userSync) {
- let syncDetails = [];
- Object.keys(userSync).forEach(key => {
- const value = userSync[key];
- if (value.syncs && value.syncs.length) {
- syncDetails = syncDetails.concat(value.syncs);
- }
- });
- syncDetails.forEach(syncDetails => {
- syncs.push({
- type: syncDetails.type === 'iframe' ? 'iframe' : 'image',
- url: syncDetails.url
- });
- });
-
- if (!syncOptions.iframeEnabled) {
- syncs = syncs.filter(s => s.type !== 'iframe')
- }
- if (!syncOptions.pixelEnabled) {
- syncs = syncs.filter(s => s.type !== 'image')
- }
- }
- });
- utils.logInfo('bidphysics.getUserSyncs result=%o', syncs);
- return syncs;
- },
-
-};
-registerBidder(spec);
diff --git a/modules/bizzclickBidAdapter.js b/modules/bizzclickBidAdapter.js
deleted file mode 100644
index 2af9a7afed2..00000000000
--- a/modules/bizzclickBidAdapter.js
+++ /dev/null
@@ -1,326 +0,0 @@
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
-import * as utils from '../src/utils.js';
-import {config} from '../src/config.js';
-
-const BIDDER_CODE = 'bizzclick';
-const ACCOUNTID_MACROS = '[account_id]';
-const URL_ENDPOINT = `https://us-e-node1.bizzclick.com/bid?rtb_seat_id=prebidjs&secret_key=${ACCOUNTID_MACROS}`;
-const NATIVE_ASSET_IDS = { 0: 'title', 2: 'icon', 3: 'image', 5: 'sponsoredBy', 4: 'body', 1: 'cta' };
-const NATIVE_PARAMS = {
- title: {
- id: 0,
- name: 'title'
- },
- icon: {
- id: 2,
- type: 1,
- name: 'img'
- },
- image: {
- id: 3,
- type: 3,
- name: 'img'
- },
- sponsoredBy: {
- id: 5,
- name: 'data',
- type: 1
- },
- body: {
- id: 4,
- name: 'data',
- type: 2
- },
- cta: {
- id: 1,
- type: 12,
- name: 'data'
- }
-};
-const NATIVE_VERSION = '1.2';
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
-
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {object} bid The bid to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: (bid) => {
- return Boolean(bid.params.accountId) && Boolean(bid.params.placementId)
- },
-
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {BidRequest[]} validBidRequests A non-empty list of valid bid requests that should be sent to the Server.
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: (validBidRequests, bidderRequest) => {
- if (validBidRequests && validBidRequests.length === 0) return []
- let accuontId = validBidRequests[0].params.accountId;
- const endpointURL = URL_ENDPOINT.replace(ACCOUNTID_MACROS, accuontId);
-
- let winTop = window;
- let location;
- try {
- location = new URL(bidderRequest.refererInfo.referer)
- winTop = window.top;
- } catch (e) {
- location = winTop.location;
- utils.logMessage(e);
- };
-
- let bids = [];
- for (let bidRequest of validBidRequests) {
- let impObject = prepareImpObject(bidRequest);
- let data = {
- id: bidRequest.bidId,
- test: config.getConfig('debug') ? 1 : 0,
- at: 1,
- cur: ['USD'],
- device: {
- w: winTop.screen.width,
- h: winTop.screen.height,
- dnt: utils.getDNT() ? 1 : 0,
- language: (navigator && navigator.language) ? navigator.language.indexOf('-') != -1 ? navigator.language.split('-')[0] : navigator.language : '',
- },
- site: {
- page: location.pathname,
- host: location.host
- },
- source: {
- tid: bidRequest.transactionId
- },
- regs: {
- coppa: config.getConfig('coppa') === true ? 1 : 0,
- ext: {}
- },
- user: {
- ext: {}
- },
- tmax: bidRequest.timeout,
- imp: [impObject],
- };
- if (bidRequest) {
- if (bidRequest.gdprConsent && bidRequest.gdprConsent.gdprApplies) {
- utils.deepSetValue(data, 'regs.ext.gdpr', bidRequest.gdprConsent.gdprApplies ? 1 : 0);
- utils.deepSetValue(data, 'user.ext.consent', bidRequest.gdprConsent.consentString);
- }
-
- if (bidRequest.uspConsent !== undefined) {
- utils.deepSetValue(data, 'regs.ext.us_privacy', bidRequest.uspConsent);
- }
- }
- bids.push(data)
- }
- return {
- method: 'POST',
- url: endpointURL,
- data: bids
- };
- },
-
- /**
- * Unpack the response from the server into a list of bids.
- *
- * @param {*} serverResponse A successful response from the server.
- * @return {Bid[]} An array of bids which were nested inside the server.
- */
- interpretResponse: (serverResponse) => {
- if (!serverResponse || !serverResponse.body) return []
- let bizzclickResponse = serverResponse.body;
-
- let bids = [];
- for (let response of bizzclickResponse) {
- let mediaType = response.seatbid[0].bid[0].ext && response.seatbid[0].bid[0].ext.mediaType ? response.seatbid[0].bid[0].ext.mediaType : BANNER;
-
- let bid = {
- requestId: response.id,
- cpm: response.seatbid[0].bid[0].price,
- width: response.seatbid[0].bid[0].w,
- height: response.seatbid[0].bid[0].h,
- ttl: response.ttl || 1200,
- currency: response.cur || 'USD',
- netRevenue: true,
- creativeId: response.seatbid[0].bid[0].crid,
- dealId: response.seatbid[0].bid[0].dealid,
- mediaType: mediaType
- };
-
- switch (mediaType) {
- case VIDEO:
- bid.vastXml = response.seatbid[0].bid[0].adm
- bid.vastUrl = response.seatbid[0].bid[0].ext.vastUrl
- break
- case NATIVE:
- bid.native = parseNative(response.seatbid[0].bid[0].adm)
- break
- default:
- bid.ad = response.seatbid[0].bid[0].adm
- }
-
- bids.push(bid);
- }
-
- return bids;
- },
-};
-
-/**
- * Determine type of request
- *
- * @param bidRequest
- * @param type
- * @returns {boolean}
- */
-const checkRequestType = (bidRequest, type) => {
- return (typeof utils.deepAccess(bidRequest, `mediaTypes.${type}`) !== 'undefined');
-}
-
-const parseNative = admObject => {
- const { assets, link, imptrackers, jstracker } = admObject.native;
- const result = {
- clickUrl: link.url,
- clickTrackers: link.clicktrackers || undefined,
- impressionTrackers: imptrackers || undefined,
- javascriptTrackers: jstracker ? [ jstracker ] : undefined
- };
- assets.forEach(asset => {
- const kind = NATIVE_ASSET_IDS[asset.id];
- const content = kind && asset[NATIVE_PARAMS[kind].name];
- if (content) {
- result[kind] = content.text || content.value || { url: content.url, width: content.w, height: content.h };
- }
- });
-
- return result;
-}
-
-const prepareImpObject = (bidRequest) => {
- let impObject = {
- id: bidRequest.transactionId,
- secure: 1,
- ext: {
- placementId: bidRequest.params.placementId
- }
- };
- if (checkRequestType(bidRequest, BANNER)) {
- impObject.banner = addBannerParameters(bidRequest);
- }
- if (checkRequestType(bidRequest, VIDEO)) {
- impObject.video = addVideoParameters(bidRequest);
- }
- if (checkRequestType(bidRequest, NATIVE)) {
- impObject.native = {
- ver: NATIVE_VERSION,
- request: addNativeParameters(bidRequest)
- };
- }
- return impObject
-};
-
-const addNativeParameters = bidRequest => {
- let impObject = {
- id: bidRequest.transactionId,
- ver: NATIVE_VERSION,
- };
-
- const assets = utils._map(bidRequest.mediaTypes.native, (bidParams, key) => {
- const props = NATIVE_PARAMS[key];
- const asset = {
- required: bidParams.required & 1,
- };
- if (props) {
- asset.id = props.id;
- let wmin, hmin;
- let aRatios = bidParams.aspect_ratios;
-
- if (aRatios && aRatios[0]) {
- aRatios = aRatios[0];
- wmin = aRatios.min_width || 0;
- hmin = aRatios.ratio_height * wmin / aRatios.ratio_width | 0;
- }
-
- if (bidParams.sizes) {
- const sizes = flatten(bidParams.sizes);
- wmin = sizes[0];
- hmin = sizes[1];
- }
-
- asset[props.name] = {}
-
- if (bidParams.len) asset[props.name]['len'] = bidParams.len;
- if (props.type) asset[props.name]['type'] = props.type;
- if (wmin) asset[props.name]['wmin'] = wmin;
- if (hmin) asset[props.name]['hmin'] = hmin;
-
- return asset;
- }
- }).filter(Boolean);
-
- impObject.assets = assets;
- return impObject
-}
-
-const addBannerParameters = (bidRequest) => {
- let bannerObject = {};
- const size = parseSizes(bidRequest, 'banner');
- bannerObject.w = size[0];
- bannerObject.h = size[1];
- return bannerObject;
-};
-
-const parseSizes = (bid, mediaType) => {
- let mediaTypes = bid.mediaTypes;
- if (mediaType === 'video') {
- let size = [];
- if (mediaTypes.video && mediaTypes.video.w && mediaTypes.video.h) {
- size = [
- mediaTypes.video.w,
- mediaTypes.video.h
- ];
- } else if (Array.isArray(utils.deepAccess(bid, 'mediaTypes.video.playerSize')) && bid.mediaTypes.video.playerSize.length === 1) {
- size = bid.mediaTypes.video.playerSize[0];
- } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0 && Array.isArray(bid.sizes[0]) && bid.sizes[0].length > 1) {
- size = bid.sizes[0];
- }
- return size;
- }
- let sizes = [];
- if (Array.isArray(mediaTypes.banner.sizes)) {
- sizes = mediaTypes.banner.sizes[0];
- } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) {
- sizes = bid.sizes
- } else {
- utils.logWarn('no sizes are setup or found');
- }
-
- return sizes
-}
-
-const addVideoParameters = (bidRequest) => {
- let videoObj = {};
- let supportParamsList = ['mimes', 'minduration', 'maxduration', 'protocols', 'startdelay', 'placement', 'skip', 'skipafter', 'minbitrate', 'maxbitrate', 'delivery', 'playbackmethod', 'api', 'linearity']
-
- for (let param of supportParamsList) {
- if (bidRequest.mediaTypes.video[param] !== undefined) {
- videoObj[param] = bidRequest.mediaTypes.video[param];
- }
- }
-
- const size = parseSizes(bidRequest, 'video');
- videoObj.w = size[0];
- videoObj.h = size[1];
- return videoObj;
-}
-
-const flatten = arr => {
- return [].concat(...arr);
-}
-
-registerBidder(spec);
diff --git a/modules/boldwinBidAdapter.js b/modules/boldwinBidAdapter.js
deleted file mode 100644
index 04f4085ba24..00000000000
--- a/modules/boldwinBidAdapter.js
+++ /dev/null
@@ -1,110 +0,0 @@
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
-import * as utils from '../src/utils.js';
-
-const BIDDER_CODE = 'boldwin';
-const AD_URL = 'https://ssp.videowalldirect.com/?c=o&m=multi';
-const SYNC_URL = 'https://cs.videowalldirect.com/?c=o&m=cookie'
-
-function isBidResponseValid(bid) {
- if (!bid.requestId || !bid.cpm || !bid.creativeId ||
- !bid.ttl || !bid.currency) {
- return false;
- }
- switch (bid.mediaType) {
- case BANNER:
- return Boolean(bid.width && bid.height && bid.ad);
- case VIDEO:
- return Boolean(bid.vastUrl);
- case NATIVE:
- return Boolean(bid.native && bid.native.title && bid.native.image && bid.native.impressionTrackers);
- default:
- return false;
- }
-}
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
-
- isBidRequestValid: (bid) => {
- return Boolean(bid.bidId && bid.params && !isNaN(parseInt(bid.params.placementId)));
- },
-
- buildRequests: (validBidRequests = [], bidderRequest) => {
- let winTop = window;
- let location;
- try {
- location = new URL(bidderRequest.refererInfo.referer)
- winTop = window.top;
- } catch (e) {
- location = winTop.location;
- utils.logMessage(e);
- };
- let placements = [];
- let request = {
- 'deviceWidth': winTop.screen.width,
- 'deviceHeight': winTop.screen.height,
- 'language': (navigator && navigator.language) ? navigator.language.split('-')[0] : '',
- 'secure': 1,
- 'host': location.host,
- 'page': location.pathname,
- 'placements': placements
- };
- if (bidderRequest) {
- if (bidderRequest.uspConsent) {
- request.ccpa = bidderRequest.uspConsent;
- }
- if (bidderRequest.gdprConsent) {
- request.gdpr = bidderRequest.gdprConsent
- }
- }
- const len = validBidRequests.length;
-
- for (let i = 0; i < len; i++) {
- let bid = validBidRequests[i];
- let sizes
- if (bid.mediaTypes) {
- if (bid.mediaTypes[BANNER] && bid.mediaTypes[BANNER].sizes) {
- sizes = bid.mediaTypes[BANNER].sizes
- } else if (bid.mediaTypes[VIDEO] && bid.mediaTypes[VIDEO].playerSize) {
- sizes = bid.mediaTypes[VIDEO].playerSize
- }
- }
- placements.push({
- placementId: bid.params.placementId,
- bidId: bid.bidId,
- sizes: sizes || [],
- wPlayer: sizes ? sizes[0] : 0,
- hPlayer: sizes ? sizes[1] : 0,
- traffic: bid.params.traffic || BANNER,
- schain: bid.schain || {}
- });
- }
- return {
- method: 'POST',
- url: AD_URL,
- data: request
- };
- },
-
- interpretResponse: (serverResponse) => {
- let response = [];
- for (let i = 0; i < serverResponse.body.length; i++) {
- let resItem = serverResponse.body[i];
- if (isBidResponseValid(resItem)) {
- response.push(resItem);
- }
- }
- return response;
- },
-
- getUserSyncs: () => {
- return [{
- type: 'image',
- url: SYNC_URL
- }];
- }
-};
-
-registerBidder(spec);
diff --git a/modules/byplayBidAdapter.js b/modules/byplayBidAdapter.js
deleted file mode 100644
index 6133cdfa647..00000000000
--- a/modules/byplayBidAdapter.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import { config } from '../src/config.js';
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { Renderer } from '../src/Renderer.js';
-import { VIDEO } from '../src/mediaTypes.js';
-
-const BIDDER_CODE = 'byplay';
-const ENDPOINT_URL = 'https://prebid.byplay.net/bidder';
-const VIDEO_PLAYER_URL = 'https://cdn.byplay.net/prebid-byplay-v2.js';
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [VIDEO],
- isBidRequestValid: (bid) => {
- return !!bid.params.sectionId;
- },
- buildRequests: function(validBidRequests) {
- return validBidRequests.map(req => {
- const payload = {
- requestId: req.bidId,
- sectionId: req.params.sectionId,
- ...(req.params.env ? { env: req.params.env } : {})
- };
-
- return {
- method: 'POST',
- url: ENDPOINT_URL,
- data: JSON.stringify(payload),
- options: {
- withCredentials: false
- }
- };
- });
- },
- interpretResponse: (serverResponse, bidderRequest) => {
- const response = serverResponse.body;
- const data = JSON.parse(bidderRequest.data);
- const bidResponse = {
- requestId: data.requestId,
- cpm: response.cpm,
- width: response.width,
- height: response.height,
- creativeId: response.creativeId || '0',
- ttl: config.getConfig('_bidderTimeout'),
- currency: 'JPY',
- netRevenue: response.netRevenue,
- mediaType: VIDEO,
- vastXml: response.vastXml,
- renderer: createRenderer()
- };
-
- return [bidResponse];
- }
-};
-
-function createRenderer() {
- const renderer = Renderer.install({ url: VIDEO_PLAYER_URL });
-
- renderer.setRender(bid => {
- bid.renderer.push(() => {
- window.adtagRender(bid);
- });
- });
-
- return renderer;
-}
-
-registerBidder(spec);
diff --git a/modules/cedatoBidAdapter.js b/modules/cedatoBidAdapter.js
deleted file mode 100644
index ab381698f01..00000000000
--- a/modules/cedatoBidAdapter.js
+++ /dev/null
@@ -1,229 +0,0 @@
-import * as utils from '../src/utils.js';
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { BANNER, VIDEO } from '../src/mediaTypes.js';
-import { getStorageManager } from '../src/storageManager.js';
-
-const storage = getStorageManager();
-
-const BIDDER_CODE = 'cedato';
-const BID_URL = 'https://h.cedatoplayer.com/hb';
-const SYNC_URL = 'https://h.cedatoplayer.com/hb_usync';
-const TTL = 10000;
-const CURRENCY = 'USD';
-const NET_REVENUE = true;
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO],
-
- isBidRequestValid: function(bid) {
- return !!(
- bid &&
- bid.params &&
- bid.params.player_id &&
- utils.checkCookieSupport() &&
- storage.cookiesAreEnabled()
- );
- },
-
- buildRequests: function(bidRequests, bidderRequest) {
- const site = { domain: document.domain };
- const device = { ua: navigator.userAgent, w: screen.width, h: screen.height };
- const currency = CURRENCY;
- const tmax = bidderRequest.timeout;
- const auctionId = bidderRequest.auctionId;
- const auctionStart = bidderRequest.auctionStart;
- const bidderRequestId = bidderRequest.bidderRequestId;
-
- const imp = bidRequests.map(req => {
- const banner = getMediaType(req, 'banner');
- const video = getMediaType(req, 'video');
- const params = req.params;
- const bidId = req.bidId;
- const adUnitCode = req.adUnitCode;
- const bidRequestsCount = req.bidRequestsCount;
- const bidderWinsCount = req.bidderWinsCount;
- const transactionId = req.transactionId;
-
- return {
- bidId,
- banner,
- video,
- adUnitCode,
- bidRequestsCount,
- bidderWinsCount,
- transactionId,
- params
- };
- });
-
- const payload = {
- version: '$prebid.version$',
- site,
- device,
- imp,
- currency,
- tmax,
- auctionId,
- auctionStart,
- bidderRequestId
- };
-
- if (bidderRequest) {
- payload.referer_info = bidderRequest.refererInfo;
- payload.us_privacy = bidderRequest.uspConsent;
-
- if (bidderRequest.gdprConsent) {
- payload.gdpr_consent = {
- consent_string: bidderRequest.gdprConsent.consentString,
- consent_required: bidderRequest.gdprConsent.gdprApplies
- };
- }
- }
-
- return formatRequest(payload, bidderRequest);
- },
-
- interpretResponse: function(resp, {bidderRequest}) {
- resp = resp.body;
- const bids = [];
-
- if (!resp) {
- return bids;
- }
-
- resp.seatbid[0].bid.map(serverBid => {
- const bid = newBid(serverBid, bidderRequest);
- bid.currency = resp.cur;
- bids.push(bid);
- });
-
- return bids;
- },
-
- getUserSyncs: function(syncOptions, resps, gdprConsent, uspConsent) {
- const syncs = [];
- if (syncOptions.iframeEnabled) {
- syncs.push(getSync('iframe', gdprConsent, uspConsent));
- } else if (syncOptions.pixelEnabled) {
- syncs.push(getSync('image', gdprConsent, uspConsent));
- }
- return syncs;
- }
-}
-
-function getMediaType(req, type) {
- const { mediaTypes } = req;
-
- if (!mediaTypes) {
- return;
- }
-
- switch (type) {
- case 'banner':
- if (mediaTypes.banner) {
- const { sizes } = mediaTypes.banner;
- return {
- format: getFormats(sizes)
- };
- }
- break;
-
- case 'video':
- if (mediaTypes.video) {
- const { playerSize, context } = mediaTypes.video;
- return {
- context: context,
- format: getFormats(playerSize)
- };
- }
- }
-}
-
-function newBid(serverBid, bidderRequest) {
- const bidRequest = utils.getBidRequest(serverBid.uuid, [bidderRequest]);
-
- const cpm = serverBid.price;
- const requestId = serverBid.uuid;
- const width = serverBid.w;
- const height = serverBid.h;
- const creativeId = serverBid.crid;
- const dealId = serverBid.dealid;
- const mediaType = serverBid.media_type;
- const netRevenue = NET_REVENUE;
- const ttl = TTL;
-
- const bid = {
- cpm,
- requestId,
- width,
- height,
- mediaType,
- creativeId,
- dealId,
- netRevenue,
- ttl,
- };
-
- if (mediaType == 'video') {
- const videoContext = utils.deepAccess(bidRequest, 'mediaTypes.video.context');
-
- if (videoContext == 'instream') {
- bid.vastUrl = serverBid.vast_url;
- bid.vastImpUrl = serverBid.notify_url;
- }
- } else {
- bid.ad = serverBid.adm;
- }
-
- return bid;
-}
-
-function formatRequest(payload, bidderRequest) {
- const payloadByUrl = {};
- const requests = [];
-
- payload.imp.forEach(imp => {
- const url = imp.params.bid_url || BID_URL;
- if (!payloadByUrl[url]) {
- payloadByUrl[url] = {
- ...payload,
- imp: []
- };
- }
- payloadByUrl[url].imp.push(imp);
- });
-
- for (const url in payloadByUrl) {
- requests.push({
- url,
- method: 'POST',
- data: JSON.stringify(payloadByUrl[url]),
- bidderRequest
- });
- }
-
- return requests;
-}
-
-const getSync = (type, gdprConsent, uspConsent = '') => {
- const syncUrl = SYNC_URL;
- let params = '?type=' + type + '&us_privacy=' + uspConsent;
- if (gdprConsent && typeof gdprConsent.consentString === 'string') {
- if (typeof gdprConsent.gdprApplies === 'boolean') {
- params += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
- } else {
- params += `&gdpr_consent=${gdprConsent.consentString}`;
- }
- }
- return {
- type: type,
- url: syncUrl + params,
- };
-}
-
-const getFormats = arr => arr.map((s) => {
- return { w: s[0], h: s[1] };
-});
-
-registerBidder(spec);
diff --git a/modules/clickforceBidAdapter.js b/modules/clickforceBidAdapter.js
deleted file mode 100644
index 20408fe9177..00000000000
--- a/modules/clickforceBidAdapter.js
+++ /dev/null
@@ -1,126 +0,0 @@
-import * as utils from '../src/utils.js';
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import {BANNER, NATIVE} from '../src/mediaTypes.js';
-const BIDDER_CODE = 'clickforce';
-const ENDPOINT_URL = 'https://ad.holmesmind.com/adserver/prebid.json?cb=' + new Date().getTime() + '&hb=1&ver=1.21';
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, NATIVE],
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {BidRequest} bid The bid params to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: function(bid) {
- return bid && bid.params && !!bid.params.zone;
- },
-
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {BidRequest[]} validBidRequests - an array of bids
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: function(validBidRequests) {
- const bidParams = [];
- utils._each(validBidRequests, function(bid) {
- bidParams.push({
- z: bid.params.zone,
- bidId: bid.bidId
- });
- });
- return {
- method: 'POST',
- url: ENDPOINT_URL,
- data: bidParams,
- validBidRequests: validBidRequests
- };
- },
-
- /**
- * Unpack the response from the server into a list of bids.
- *
- * @param {*} serverResponse A successful response from the server.
- * @param {*} bidRequest
- * @return {Bid[]} An array of bids which were nested inside the server.
- */
- interpretResponse: function(serverResponse, bidRequest) {
- const cfResponses = [];
- const bidRequestList = [];
-
- if (typeof bidRequest != 'undefined') {
- utils._each(bidRequest.validBidRequests, function(req) {
- bidRequestList[req.bidId] = req;
- });
- }
-
- utils._each(serverResponse.body, function(response) {
- if (response.requestId != null) {
- // native ad size
- if (response.width == 3) {
- cfResponses.push({
- requestId: response.requestId,
- cpm: response.cpm,
- width: response.width,
- height: response.height,
- creativeId: response.creativeId,
- currency: response.currency,
- netRevenue: response.netRevenue,
- ttl: response.ttl,
- native: {
- title: response.tag.content.title,
- body: response.tag.content.content,
- image: {
- url: response.tag.content.image,
- height: 900,
- width: 1600
- },
- icon: {
- url: response.tag.content.icon,
- height: 900,
- width: 900
- },
- clickUrl: response.tag.cu,
- cta: response.tag.content.button_text,
- sponsoredBy: response.tag.content.advertiser,
- impressionTrackers: response.tag.iu,
- },
- mediaType: 'native',
- });
- } else {
- // display ad
- cfResponses.push({
- requestId: response.requestId,
- cpm: response.cpm,
- width: response.width,
- height: response.height,
- creativeId: response.creativeId,
- currency: response.currency,
- netRevenue: response.netRevenue,
- ttl: response.ttl,
- ad: response.tag,
- mediaType: 'banner',
- });
- }
- }
- });
- return cfResponses;
- },
- getUserSyncs: function(syncOptions, serverResponses) {
- if (syncOptions.iframeEnabled) {
- return [{
- type: 'iframe',
- url: 'https://cdn.holmesmind.com/js/capmapping.htm'
- }]
- } else if (syncOptions.pixelEnabled) {
- return [{
- type: 'image',
- url: 'https://c.holmesmind.com/cm'
- }]
- }
- }
-};
-
-registerBidder(spec);
diff --git a/modules/clicktripzBidAdapter.js b/modules/clicktripzBidAdapter.js
deleted file mode 100644
index 2149cbe4527..00000000000
--- a/modules/clicktripzBidAdapter.js
+++ /dev/null
@@ -1,67 +0,0 @@
-import {logError, _each} from '../src/utils.js';
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-
-const BIDDER_CODE = 'clicktripz';
-const ENDPOINT_URL = 'https://www.clicktripz.com/x/prebid/v1';
-
-export const spec = {
- code: BIDDER_CODE,
- aliases: ['ctz'], // short code
-
- isBidRequestValid: function (bid) {
- if (bid && bid.params && bid.params.placementId && bid.params.siteId) {
- return true;
- }
-
- return false;
- },
-
- buildRequests: function (validBidRequests) {
- let bidRequests = [];
-
- _each(validBidRequests, function (bid) {
- bidRequests.push({
- bidId: bid.bidId,
- placementId: bid.params.placementId,
- siteId: bid.params.siteId,
- sizes: bid.sizes.map(function (size) {
- return size.join('x')
- })
- });
- });
- return {
- method: 'POST',
- url: ENDPOINT_URL,
- data: bidRequests
- };
- },
-
- interpretResponse: function (serverResponse) {
- let bidResponses = [];
-
- if (serverResponse && serverResponse.body) {
- _each(serverResponse.body, function (bid) {
- if (bid.errors) {
- logError(bid.errors);
- return;
- }
-
- const size = bid.size.split('x');
- bidResponses.push({
- requestId: bid.bidId,
- cpm: bid.cpm,
- width: size[0],
- height: size[1],
- creativeId: bid.creativeId,
- currency: bid.currency,
- netRevenue: bid.netRevenue,
- ttl: bid.ttl,
- adUrl: bid.adUrl
- });
- });
- }
- return bidResponses;
- }
-};
-
-registerBidder(spec);
diff --git a/modules/collectcentBidAdapter.js b/modules/collectcentBidAdapter.js
deleted file mode 100644
index add3e06430d..00000000000
--- a/modules/collectcentBidAdapter.js
+++ /dev/null
@@ -1,93 +0,0 @@
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
-import * as utils from '../src/utils.js';
-
-const BIDDER_CODE = 'collectcent';
-const URL_MULTI = 'https://publishers.motionspots.com/?c=o&m=multi';
-const URL_SYNC = 'https://publishers.motionspots.com/?c=o&m=cookie';
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
-
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {object} bid The bid to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: (bid) => {
- return Boolean(bid.bidId &&
- bid.params &&
- !isNaN(bid.params.placementId) &&
- spec.supportedMediaTypes.indexOf(bid.params.traffic) !== -1
- );
- },
-
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {BidRequest[]} validBidRequests A non-empty list of valid bid requests that should be sent to the Server.
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: (validBidRequests, bidderRequest) => {
- let winTop;
- try {
- winTop = window.top;
- } catch (e) {
- utils.logMessage(e);
- winTop = window;
- };
-
- const placements = [];
- const location = bidderRequest ? new URL(bidderRequest.refererInfo.referer) : winTop.location;
- const request = {
- 'secure': (location.protocol === 'https:') ? 1 : 0,
- 'deviceWidth': winTop.screen.width,
- 'deviceHeight': winTop.screen.height,
- 'host': location.host,
- 'page': location.pathname,
- 'placements': placements
- };
-
- for (let i = 0; i < validBidRequests.length; i++) {
- const bid = validBidRequests[i];
- const params = bid.params;
- placements.push({
- placementId: params.placementId,
- bidId: bid.bidId,
- sizes: bid.sizes,
- traffic: params.traffic
- });
- }
- return {
- method: 'POST',
- url: URL_MULTI,
- data: request
- };
- },
-
- /**
- * Unpack the response from the server into a list of bids.
- *
- * @param {*} serverResponse A successful response from the server.
- * @return {Bid[]} An array of bids which were nested inside the server.
- */
- interpretResponse: (serverResponse) => {
- try {
- serverResponse = serverResponse.body;
- } catch (e) {
- utils.logMessage(e);
- };
- return serverResponse;
- },
-
- getUserSyncs: () => {
- return [{
- type: 'image',
- url: URL_SYNC
- }];
- }
-};
-
-registerBidder(spec);
diff --git a/modules/colombiaBidAdapter.js b/modules/colombiaBidAdapter.js
deleted file mode 100644
index 55109dbaab2..00000000000
--- a/modules/colombiaBidAdapter.js
+++ /dev/null
@@ -1,82 +0,0 @@
-import * as utils from '../src/utils.js';
-import {config} from '../src/config.js';
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import { BANNER } from '../src/mediaTypes.js';
-const BIDDER_CODE = 'colombia';
-const ENDPOINT_URL = 'https://ade.clmbtech.com/cde/prebid.htm';
-const HOST_NAME = document.location.protocol + '//' + window.location.host;
-
-export const spec = {
- code: BIDDER_CODE,
- aliases: ['clmb'],
- supportedMediaTypes: [BANNER],
- isBidRequestValid: function(bid) {
- return !!(bid.params.placementId);
- },
- buildRequests: function(validBidRequests, bidderRequest) {
- return validBidRequests.map(bidRequest => {
- const params = bidRequest.params;
- const sizes = utils.parseSizesInput(bidRequest.sizes)[0];
- const width = sizes.split('x')[0];
- const height = sizes.split('x')[1];
- const placementId = params.placementId;
- const cb = Math.floor(Math.random() * 99999999999);
- const bidId = bidRequest.bidId;
- const referrer = (bidderRequest && bidderRequest.refererInfo) ? bidderRequest.refererInfo.referer : '';
- const payload = {
- v: 'hb1',
- p: placementId,
- w: width,
- h: height,
- cb: cb,
- r: referrer,
- uid: bidId,
- t: 'i',
- d: HOST_NAME,
- };
- return {
- method: 'POST',
- url: ENDPOINT_URL,
- data: payload,
- }
- });
- },
- interpretResponse: function(serverResponse, bidRequest) {
- const bidResponses = [];
- const response = serverResponse.body;
- const crid = response.creativeId || 0;
- const width = response.width || 0;
- const height = response.height || 0;
- let cpm = response.cpm || 0;
- if (width == 300 && height == 250) {
- cpm = cpm * 0.2;
- }
- if (width == 320 && height == 50) {
- cpm = cpm * 0.55;
- }
- if (cpm <= 0) {
- return bidResponses;
- }
- if (width !== 0 && height !== 0 && cpm !== 0 && crid !== 0) {
- const dealId = response.dealid || '';
- const currency = response.currency || 'USD';
- const netRevenue = (response.netRevenue === undefined) ? true : response.netRevenue;
- const bidResponse = {
- requestId: bidRequest.data.uid,
- cpm: cpm,
- width: response.width,
- height: response.height,
- creativeId: crid,
- dealId: dealId,
- currency: currency,
- netRevenue: netRevenue,
- ttl: config.getConfig('_bidderTimeout'),
- referrer: bidRequest.data.r,
- ad: response.ad
- };
- bidResponses.push(bidResponse);
- }
- return bidResponses;
- }
-}
-registerBidder(spec);
diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js
deleted file mode 100644
index 1afb343566d..00000000000
--- a/modules/colossussspBidAdapter.js
+++ /dev/null
@@ -1,156 +0,0 @@
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
-import * as utils from '../src/utils.js';
-
-const BIDDER_CODE = 'colossusssp';
-const G_URL = 'https://colossusssp.com/?c=o&m=multi';
-const G_URL_SYNC = 'https://colossusssp.com/?c=o&m=cookie';
-
-function isBidResponseValid(bid) {
- if (!bid.requestId || !bid.cpm || !bid.creativeId || !bid.ttl || !bid.currency) {
- return false;
- }
-
- switch (bid.mediaType) {
- case BANNER:
- return Boolean(bid.width && bid.height && bid.ad);
- case VIDEO:
- return Boolean(bid.vastUrl);
- case NATIVE:
- return Boolean(bid.native);
- default:
- return false;
- }
-}
-
-function getUserId(eids, id, source, uidExt) {
- if (id) {
- var uid = { id };
- if (uidExt) {
- uid.ext = uidExt;
- }
- eids.push({
- source,
- uids: [ uid ]
- });
- }
-}
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO, NATIVE],
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {object} bid The bid to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: (bid) => {
- return Boolean(bid.bidId && bid.params && !isNaN(bid.params.placement_id));
- },
-
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {BidRequest[]} validBidRequests A non-empty list of valid bid requests that should be sent to the Server.
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: (validBidRequests, bidderRequest) => {
- const winTop = utils.getWindowTop();
- const location = winTop.location;
- let placements = [];
- let request = {
- 'deviceWidth': winTop.screen.width,
- 'deviceHeight': winTop.screen.height,
- 'language': (navigator && navigator.language) ? navigator.language : '',
- 'secure': location.protocol === 'https:' ? 1 : 0,
- 'host': location.host,
- 'page': location.pathname,
- 'placements': placements,
- };
-
- if (bidderRequest) {
- if (bidderRequest.uspConsent) {
- request.ccpa = bidderRequest.uspConsent;
- }
- if (bidderRequest.gdprConsent) {
- request.gdpr_consent = bidderRequest.gdprConsent.consentString || 'ALL'
- request.gdpr_require = bidderRequest.gdprConsent.gdprApplies ? 1 : 0
- }
- }
-
- for (let i = 0; i < validBidRequests.length; i++) {
- let bid = validBidRequests[i];
- let traff = bid.params.traffic || BANNER
- let placement = {
- placementId: bid.params.placement_id,
- bidId: bid.bidId,
- sizes: bid.mediaTypes[traff].sizes,
- traffic: traff,
- eids: [],
- floor: {}
- };
- if (typeof bid.getFloor === 'function') {
- let tmpFloor = {};
- for (let size of placement.sizes) {
- tmpFloor = bid.getFloor({
- currency: 'USD',
- mediaType: traff,
- size: size
- });
- if (tmpFloor) {
- placement.floor[`${size[0]}x${size[1]}`] = tmpFloor.floor;
- }
- }
- }
- if (bid.schain) {
- placement.schain = bid.schain;
- }
- if (bid.userId) {
- getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com');
- getUserId(placement.eids, bid.userId.idl_env, 'identityLink');
- getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com')
- getUserId(placement.eids, bid.userId.tdid, 'adserver.org', {
- rtiPartner: 'TDID'
- });
- }
- placements.push(placement);
- }
- return {
- method: 'POST',
- url: G_URL,
- data: request
- };
- },
-
- /**
- * Unpack the response from the server into a list of bids.
- *
- * @param {*} serverResponse A successful response from the server.
- * @return {Bid[]} An array of bids which were nested inside the server.
- */
- interpretResponse: (serverResponse) => {
- let response = [];
- try {
- serverResponse = serverResponse.body;
- for (let i = 0; i < serverResponse.length; i++) {
- let resItem = serverResponse[i];
- if (isBidResponseValid(resItem)) {
- response.push(resItem);
- }
- }
- } catch (e) {
- utils.logMessage(e);
- };
- return response;
- },
-
- getUserSyncs: () => {
- return [{
- type: 'image',
- url: G_URL_SYNC
- }];
- }
-};
-
-registerBidder(spec);
diff --git a/modules/convergeBidAdapter.js b/modules/convergeBidAdapter.js
deleted file mode 100644
index bea3b6cb1ab..00000000000
--- a/modules/convergeBidAdapter.js
+++ /dev/null
@@ -1,313 +0,0 @@
-import * as utils from '../src/utils.js';
-import {registerBidder} from '../src/adapters/bidderFactory.js';
-import { Renderer } from '../src/Renderer.js';
-import { VIDEO, BANNER } from '../src/mediaTypes.js';
-
-const BIDDER_CODE = 'converge';
-const ENDPOINT_URL = 'https://tech.convergd.com/hb';
-const TIME_TO_LIVE = 360;
-const SYNC_URL = 'https://tech.convergd.com/push_sync';
-const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js';
-
-let hasSynced = false;
-
-const LOG_ERROR_MESS = {
- noAuid: 'Bid from response has no auid parameter - ',
- noAdm: 'Bid from response has no adm parameter - ',
- noBid: 'Array of bid objects is empty',
- noPlacementCode: "Can't find in requested bids the bid with auid - ",
- emptyUids: 'Uids should be not empty',
- emptySeatbid: 'Seatbid array from response has empty item',
- emptyResponse: 'Response is empty',
- hasEmptySeatbidArray: 'Response has empty seatbid array',
- hasNoArrayOfBids: 'Seatbid from response has no array of bid objects - '
-};
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [ BANNER, VIDEO ],
- /**
- * Determines whether or not the given bid request is valid.
- *
- * @param {BidRequest} bid The bid params to validate.
- * @return boolean True if this is a valid bid, and false otherwise.
- */
- isBidRequestValid: function(bid) {
- return !!bid.params.uid;
- },
- /**
- * Make a server request from the list of BidRequests.
- *
- * @param {BidRequest[]} validBidRequests - an array of bids
- * @param {bidderRequest} bidderRequest - bidder request object
- * @return ServerRequest Info describing the request to the server.
- */
- buildRequests: function(validBidRequests, bidderRequest) {
- const auids = [];
- const bidsMap = {};
- const slotsMapByUid = {};
- const sizeMap = {};
- const bids = validBidRequests || [];
- let priceType = 'net';
- let pageKeywords;
- let reqId;
-
- bids.forEach(bid => {
- if (bid.params.priceType === 'gross') {
- priceType = 'gross';
- }
- reqId = bid.bidderRequestId;
- const {params: {uid}, adUnitCode} = bid;
- auids.push(uid);
- const sizesId = utils.parseSizesInput(bid.sizes);
-
- if (!pageKeywords && !utils.isEmpty(bid.params.keywords)) {
- const keywords = utils.transformBidderParamKeywords(bid.params.keywords);
-
- if (keywords.length > 0) {
- keywords.forEach(deleteValues);
- }
- pageKeywords = keywords;
- }
-
- if (!slotsMapByUid[uid]) {
- slotsMapByUid[uid] = {};
- }
- const slotsMap = slotsMapByUid[uid];
- if (!slotsMap[adUnitCode]) {
- slotsMap[adUnitCode] = {adUnitCode, bids: [bid], parents: []};
- } else {
- slotsMap[adUnitCode].bids.push(bid);
- }
- const slot = slotsMap[adUnitCode];
-
- sizesId.forEach((sizeId) => {
- sizeMap[sizeId] = true;
- if (!bidsMap[uid]) {
- bidsMap[uid] = {};
- }
-
- if (!bidsMap[uid][sizeId]) {
- bidsMap[uid][sizeId] = [slot];
- } else {
- bidsMap[uid][sizeId].push(slot);
- }
- slot.parents.push({parent: bidsMap[uid], key: sizeId, uid});
- });
- });
-
- const payload = {
- pt: priceType,
- auids: auids.join(','),
- sizes: utils.getKeys(sizeMap).join(','),
- r: reqId,
- wrapperType: 'Prebid_js',
- wrapperVersion: '$prebid.version$'
- };
-
- if (pageKeywords) {
- payload.keywords = JSON.stringify(pageKeywords);
- }
-
- if (bidderRequest) {
- if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
- payload.u = bidderRequest.refererInfo.referer;
- }
- if (bidderRequest.timeout) {
- payload.wtimeout = bidderRequest.timeout;
- }
- if (bidderRequest.gdprConsent) {
- if (bidderRequest.gdprConsent.consentString) {
- payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
- }
- payload.gdpr_applies =
- (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean')
- ? Number(bidderRequest.gdprConsent.gdprApplies) : 1;
- }
- if (bidderRequest.uspConsent) {
- payload.us_privacy = bidderRequest.uspConsent;
- }
- }
-
- return {
- method: 'GET',
- url: ENDPOINT_URL,
- data: utils.parseQueryStringParameters(payload).replace(/\&$/, ''),
- bidsMap: bidsMap,
- };
- },
- /**
- * Unpack the response from the server into a list of bids.
- *
- * @param {*} serverResponse A successful response from the server.
- * @param {*} bidRequest
- * @param {Renderer} RendererConst
- * @return {Bid[]} An array of bids which were nested inside the server.
- */
- interpretResponse: function(serverResponse, bidRequest, RendererConst = Renderer) {
- serverResponse = serverResponse && serverResponse.body;
- const bidResponses = [];
- const bidsMap = bidRequest.bidsMap;
- const priceType = bidRequest.data.pt;
-
- let errorMessage;
-
- if (!serverResponse) errorMessage = LOG_ERROR_MESS.emptyResponse;
- else if (serverResponse.seatbid && !serverResponse.seatbid.length) {
- errorMessage = LOG_ERROR_MESS.hasEmptySeatbidArray;
- }
-
- if (!errorMessage && serverResponse.seatbid) {
- serverResponse.seatbid.forEach(respItem => {
- _addBidResponse(_getBidFromResponse(respItem), bidsMap, priceType, bidResponses, RendererConst);
- });
- }
- if (errorMessage) utils.logError(errorMessage);
- return bidResponses;
- },
- getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
- if (!hasSynced && syncOptions.pixelEnabled) {
- let params = '';
-
- if (gdprConsent && typeof gdprConsent.consentString === 'string') {
- if (typeof gdprConsent.gdprApplies === 'boolean') {
- params += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`;
- } else {
- params += `&gdpr_consent=${gdprConsent.consentString}`;
- }
- }
- if (uspConsent) {
- params += `&us_privacy=${uspConsent}`;
- }
-
- hasSynced = true;
- return {
- type: 'image',
- url: SYNC_URL + params
- };
- }
- }
-};
-
-function isPopulatedArray(arr) {
- return !!(utils.isArray(arr) && arr.length > 0);
-}
-
-function deleteValues(keyPairObj) {
- if (isPopulatedArray(keyPairObj.value) && keyPairObj.value[0] === '') {
- delete keyPairObj.value;
- }
-}
-
-function _getBidFromResponse(respItem) {
- if (!respItem) {
- utils.logError(LOG_ERROR_MESS.emptySeatbid);
- } else if (!respItem.bid) {
- utils.logError(LOG_ERROR_MESS.hasNoArrayOfBids + JSON.stringify(respItem));
- } else if (!respItem.bid[0]) {
- utils.logError(LOG_ERROR_MESS.noBid);
- }
- return respItem && respItem.bid && respItem.bid[0];
-}
-
-function _addBidResponse(serverBid, bidsMap, priceType, bidResponses, RendererConst) {
- if (!serverBid) return;
- let errorMessage;
- if (!serverBid.auid) errorMessage = LOG_ERROR_MESS.noAuid + JSON.stringify(serverBid);
- if (!serverBid.adm) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid);
- else {
- const awaitingBids = bidsMap[serverBid.auid];
- if (awaitingBids) {
- const sizeId = `${serverBid.w}x${serverBid.h}`;
- if (awaitingBids[sizeId]) {
- const slot = awaitingBids[sizeId][0];
-
- const bid = slot.bids.shift();
- const bidResponse = {
- requestId: bid.bidId, // bid.bidderRequestId,
- bidderCode: spec.code,
- cpm: serverBid.price,
- width: serverBid.w,
- height: serverBid.h,
- creativeId: serverBid.auid, // bid.bidId,
- currency: 'EUR',
- netRevenue: priceType !== 'gross',
- ttl: TIME_TO_LIVE,
- dealId: serverBid.dealid
- };
- if (serverBid.content_type === 'video' || (!serverBid.content_type && bid.mediaTypes && bid.mediaTypes.video)) {
- bidResponse.vastXml = serverBid.adm;
- bidResponse.mediaType = VIDEO;
- bidResponse.adResponse = {
- content: bidResponse.vastXml
- };
- if (!bid.renderer && (!bid.mediaTypes || !bid.mediaTypes.video || bid.mediaTypes.video.context === 'outstream')) {
- bidResponse.renderer = createRenderer(bidResponse, {
- id: bid.bidId,
- url: RENDERER_URL
- }, RendererConst);
- }
- } else {
- bidResponse.ad = serverBid.adm;
- bidResponse.mediaType = BANNER;
- }
-
- bidResponses.push(bidResponse);
-
- if (!slot.bids.length) {
- slot.parents.forEach(({parent, key, uid}) => {
- const index = parent[key].indexOf(slot);
- if (index > -1) {
- parent[key].splice(index, 1);
- }
- if (!parent[key].length) {
- delete parent[key];
- if (!utils.getKeys(parent).length) {
- delete bidsMap[uid];
- }
- }
- });
- }
- }
- } else {
- errorMessage = LOG_ERROR_MESS.noPlacementCode + serverBid.auid;
- }
- }
- if (errorMessage) {
- utils.logError(errorMessage);
- }
-}
-
-function outstreamRender (bid) {
- bid.renderer.push(() => {
- window.ANOutstreamVideo.renderAd({
- targetId: bid.adUnitCode,
- adResponse: bid.adResponse
- });
- });
-}
-
-function createRenderer (bid, rendererParams, RendererConst) {
- const rendererInst = RendererConst.install({
- id: rendererParams.id,
- url: rendererParams.url,
- loaded: false
- });
-
- try {
- rendererInst.setRender(outstreamRender);
- } catch (err) {
- utils.logWarn('Prebid Error calling setRender on renderer', err);
- }
-
- return rendererInst;
-}
-
-export function resetUserSync() {
- hasSynced = false;
-}
-
-export function getSyncUrl() {
- return SYNC_URL;
-}
-
-registerBidder(spec);
diff --git a/modules/cpmstarBidAdapter.js b/modules/cpmstarBidAdapter.js
deleted file mode 100644
index 61ccc0e786b..00000000000
--- a/modules/cpmstarBidAdapter.js
+++ /dev/null
@@ -1,180 +0,0 @@
-
-import * as utils from '../src/utils.js';
-import { registerBidder } from '../src/adapters/bidderFactory.js';
-import { VIDEO, BANNER } from '../src/mediaTypes.js';
-import { config } from '../src/config.js';
-
-const BIDDER_CODE = 'cpmstar';
-
-const ENDPOINT_DEV = 'https://dev.server.cpmstar.com/view.aspx';
-const ENDPOINT_STAGING = 'https://staging.server.cpmstar.com/view.aspx';
-const ENDPOINT_PRODUCTION = 'https://server.cpmstar.com/view.aspx';
-
-const DEFAULT_TTL = 300;
-const DEFAULT_CURRENCY = 'USD';
-
-function fixedEncodeURIComponent(str) {
- return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
- return '%' + c.charCodeAt(0).toString(16);
- });
-}
-
-export const spec = {
- code: BIDDER_CODE,
- supportedMediaTypes: [BANNER, VIDEO],
- pageID: Math.floor(Math.random() * 10e6),
-
- getMediaType: function (bidRequest) {
- if (bidRequest == null) return BANNER;
- return !utils.deepAccess(bidRequest, 'mediaTypes.video') ? BANNER : VIDEO;
- },
-
- getPlayerSize: function (bidRequest) {
- var playerSize = utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize');
- if (playerSize == null) return [640, 440];
- if (playerSize[0] != null) playerSize = playerSize[0];
- if (playerSize == null || playerSize[0] == null || playerSize[1] == null) return [640, 440];
- return playerSize;
- },
-
- isBidRequestValid: function (bid) {
- return ((typeof bid.params.placementId === 'string') && !!bid.params.placementId.length) || (typeof bid.params.placementId === 'number');
- },
-
- buildRequests: function (validBidRequests, bidderRequest) {
- var requests = [];
- // This reference to window.top can cause issues when loaded in an iframe if not protected with a try/catch.
-
- for (var i = 0; i < validBidRequests.length; i++) {
- var bidRequest = validBidRequests[i];
- var referer = encodeURIComponent(bidderRequest.refererInfo.referer);
- var e = utils.getBidIdParameter('endpoint', bidRequest.params);
- var ENDPOINT = e == 'dev' ? ENDPOINT_DEV : e == 'staging' ? ENDPOINT_STAGING : ENDPOINT_PRODUCTION;
- var mediaType = spec.getMediaType(bidRequest);
- var playerSize = spec.getPlayerSize(bidRequest);
- var videoArgs = '&fv=0' + (playerSize ? ('&w=' + playerSize[0] + '&h=' + playerSize[1]) : '');
- var url = ENDPOINT + '?media=' + mediaType + (mediaType == VIDEO ? videoArgs : '') +
- '&json=c_b&mv=1&poolid=' + utils.getBidIdParameter('placementId', bidRequest.params) +
- '&reachedTop=' + encodeURIComponent(bidderRequest.refererInfo.reachedTop) +
- '&requestid=' + bidRequest.bidId +
- '&referer=' + encodeURIComponent(referer);
-
- if (bidRequest.schain && bidRequest.schain.nodes) {
- var schain = bidRequest.schain;
- var schainString = '';
- schainString += schain.ver + ',' + schain.complete;
- for (var i2 = 0; i2 < schain.nodes.length; i2++) {
- var node = schain.nodes[i2];
- schainString += '!' +
- fixedEncodeURIComponent(node.asi || '') + ',' +
- fixedEncodeURIComponent(node.sid || '') + ',' +
- fixedEncodeURIComponent(node.hp || '') + ',' +
- fixedEncodeURIComponent(node.rid || '') + ',' +
- fixedEncodeURIComponent(node.name || '') + ',' +
- fixedEncodeURIComponent(node.domain || '');
- }
- url += '&schain=' + schainString
- }
-
- if (bidderRequest.gdprConsent) {
- if (bidderRequest.gdprConsent.consentString != null) {
- url += '&gdpr_consent=' + bidderRequest.gdprConsent.consentString;
- }
- if (bidderRequest.gdprConsent.gdprApplies != null) {
- url += '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? 1 : 0);
- }
- }
-
- if (bidderRequest.uspConsent != null) {
- url += '&us_privacy=' + bidderRequest.uspConsent;
- }
-
- if (config.getConfig('coppa')) {
- url += '&tfcd=' + (config.getConfig('coppa') ? 1 : 0);
- }
-
- requests.push({
- method: 'GET',
- url: url,
- bidRequest: bidRequest,
- });
- }
-
- return requests;
- },
-
- interpretResponse: function (serverResponse, request) {
- var bidRequest = request.bidRequest;
- var mediaType = spec.getMediaType(bidRequest);
-
- var bidResponses = [];
-
- if (!Array.isArray(serverResponse.body)) {
- serverResponse.body = [serverResponse.body];
- }
-
- for (var i = 0; i < serverResponse.body.length; i++) {
- var raw = serverResponse.body[i];
- var rawBid = raw.creatives[0];
- if (!rawBid) {
- utils.logWarn('cpmstarBidAdapter: server response failed check');
- return;
- }
- var cpm = (parseFloat(rawBid.cpm) || 0);
-
- if (!cpm) {
- utils.logWarn('cpmstarBidAdapter: server response failed check. Missing cpm')
- return;
- }
-
- var bidResponse = {
- requestId: rawBid.requestid,
- cpm: cpm,
- width: rawBid.width || 0,
- height: rawBid.height || 0,
- currency: rawBid.currency ? rawBid.currency : DEFAULT_CURRENCY,
- netRevenue: rawBid.netRevenue ? rawBid.netRevenue : true,
- ttl: rawBid.ttl ? rawBid.ttl : DEFAULT_TTL,
- creativeId: rawBid.creativeid || 0,
- };
-
- if (rawBid.hasOwnProperty('dealId')) {
- bidResponse.dealId = rawBid.dealId
- }
-
- if (mediaType == BANNER && rawBid.code) {
- bidResponse.ad = rawBid.code + (rawBid.px_cr ? "\n" : '');
- } else if (mediaType == VIDEO && rawBid.creativemacros && rawBid.creativemacros.HTML5VID_VASTSTRING) {
- var playerSize = spec.getPlayerSize(bidRequest);
- if (playerSize != null) {
- bidResponse.width = playerSize[0];
- bidResponse.height = playerSize[1];
- }
- bidResponse.mediaType = VIDEO;
- bidResponse.vastXml = rawBid.creativemacros.HTML5VID_VASTSTRING;
- } else {
- return utils.logError('bad response', rawBid);
- }
-
- bidResponses.push(bidResponse);
- }
-
- return bidResponses;
- },
-
- getUserSyncs: function (syncOptions, serverResponses) {
- const syncs = [];
- if (serverResponses.length == 0 || !serverResponses[0].body) return syncs;
- var usersyncs = serverResponses[0].body[0].syncs;
- if (!usersyncs || usersyncs.length < 0) return syncs;
- for (var i = 0; i < usersyncs.length; i++) {
- var us = usersyncs[i];
- if ((us.type === 'image' && syncOptions.pixelEnabled) || (us.type == 'iframe' && syncOptions.iframeEnabled)) {
- syncs.push(us);
- }
- }
- return syncs;
- }
-
-};
-registerBidder(spec);
diff --git a/test/spec/modules/atomxBidAdapter_spec.js b/test/spec/modules/atomxBidAdapter_spec.js
deleted file mode 100644
index d798bd6308c..00000000000
--- a/test/spec/modules/atomxBidAdapter_spec.js
+++ /dev/null
@@ -1,119 +0,0 @@
-import { expect } from 'chai';
-import { spec } from 'modules/atomxBidAdapter.js';
-
-describe('atomxAdapterTest', function () {
- describe('bidRequestValidity', function () {
- it('bidRequest with id param', function () {
- expect(spec.isBidRequestValid({
- bidder: 'atomx',
- params: {
- id: 1234,
- },
- })).to.equal(true);
- });
-
- it('bidRequest with no id param', function () {
- expect(spec.isBidRequestValid({
- bidder: 'atomx',
- params: {
- },
- })).to.equal(false);
- });
- });
-
- describe('bidRequest', function () {
- const bidRequests = [{
- 'bidder': 'atomx',
- 'params': {
- 'id': '123'
- },
- 'adUnitCode': 'aaa',
- 'transactionId': '1b8389fe-615c-482d-9f1a-177fb8f7d5b0',
- 'sizes': [300, 250],
- 'bidId': '1abgs362e0x48a8',
- 'bidderRequestId': '70deaff71c281d',
- 'auctionId': '5c66da22-426a-4bac-b153-77360bef5337'
- },
- {
- 'bidder': 'atomx',
- 'params': {
- 'id': '456',
- },
- 'adUnitCode': 'bbb',
- 'transactionId': '193995b4-7122-4739-959b-2463282a138b',
- 'sizes': [[800, 600]],
- 'bidId': '22aidtbx5eabd9',
- 'bidderRequestId': '70deaff71c281d',
- 'auctionId': 'e97cafd0-ebfc-4f5c-b7c9-baa0fd335a4a'
- }];
-
- it('bidRequest HTTP method', function () {
- const requests = spec.buildRequests(bidRequests);
- requests.forEach(function(requestItem) {
- expect(requestItem.method).to.equal('GET');
- });
- });
-
- it('bidRequest url', function () {
- const requests = spec.buildRequests(bidRequests);
- requests.forEach(function(requestItem) {
- expect(requestItem.url).to.match(new RegExp('p\\.ato\\.mx/placement'));
- });
- });
-
- it('bidRequest data', function () {
- const requests = spec.buildRequests(bidRequests);
- expect(requests[0].data.id).to.equal('123');
- expect(requests[0].data.size).to.equal('300x250');
- expect(requests[0].data.prebid).to.equal('1abgs362e0x48a8');
- expect(requests[1].data.id).to.equal('456');
- expect(requests[1].data.size).to.equal('800x600');
- expect(requests[1].data.prebid).to.equal('22aidtbx5eabd9');
- });
- });
-
- describe('interpretResponse', function () {
- const bidRequest = {
- 'method': 'GET',
- 'url': 'https://p.ato.mx/placement',
- 'data': {
- 'v': 12,
- 'id': '123',
- 'size': '300x250',
- 'prebid': '22aidtbx5eabd9',
- 'b': 0,
- 'h': '7t3y9',
- 'type': 'javascript',
- 'screen': '800x600x32',
- 'timezone': 0,
- 'domain': 'https://example.com',
- 'r': '',
- }
- };
-
- const bidResponse = {
- body: {
- 'cpm': 0.00009,
- 'width': 300,
- 'height': 250,
- 'url': 'https://atomx.com',
- 'creative_id': 456,
- 'code': '22aidtbx5eabd9',
- },
- headers: {}
- };
-
- it('result is correct', function () {
- const result = spec.interpretResponse(bidResponse, bidRequest);
-
- expect(result[0].requestId).to.equal('22aidtbx5eabd9');
- expect(result[0].cpm).to.equal(0.00009 * 1000);
- expect(result[0].width).to.equal(300);
- expect(result[0].height).to.equal(250);
- expect(result[0].creativeId).to.equal(456);
- expect(result[0].currency).to.equal('USD');
- expect(result[0].ttl).to.equal(60);
- expect(result[0].adUrl).to.equal('https://atomx.com');
- });
- });
-});
diff --git a/test/spec/modules/avocetBidAdapter_spec.js b/test/spec/modules/avocetBidAdapter_spec.js
deleted file mode 100644
index 2a2f29e48d2..00000000000
--- a/test/spec/modules/avocetBidAdapter_spec.js
+++ /dev/null
@@ -1,167 +0,0 @@
-import { expect } from 'chai';
-import { spec } from 'modules/avocetBidAdapter';
-import { newBidder } from 'src/adapters/bidderFactory';
-import { config } from 'src/config';
-
-describe('Avocet adapter', function () {
- beforeEach(function () {
- config.setConfig({
- currency: {
- adServerCurrency: 'USD',
- },
- publisherDomain: 'test.com',
- fpd: {
- some: 'data',
- },
- });
- });
-
- afterEach(function () {
- config.resetConfig();
- });
-
- describe('inherited functions', function () {
- it('exists and is a function', function () {
- const adapter = newBidder(spec);
- expect(adapter.callBids).to.exist.and.to.be.a('function');
- });
- });
-
- describe('isBidRequestValid', function () {
- it('should return false for bid request missing params', () => {
- const invalidBidRequest = {
- bid: {},
- };
- expect(spec.isBidRequestValid(invalidBidRequest)).to.equal(false);
- });
- it('should return false for an invalid type placement param', () => {
- const invalidBidRequest = {
- params: {
- placement: 123,
- },
- };
- expect(spec.isBidRequestValid(invalidBidRequest)).to.equal(false);
- });
- it('should return false for an invalid length placement param', () => {
- const invalidBidRequest = {
- params: {
- placement: '123',
- },
- };
- expect(spec.isBidRequestValid(invalidBidRequest)).to.equal(false);
- });
- it('should return true for a valid length placement param', () => {
- const validBidRequest = {
- params: {
- placement: '012345678901234567890123',
- },
- };
- expect(spec.isBidRequestValid(validBidRequest)).to.equal(true);
- });
- });
- describe('buildRequests', function () {
- it('constructs a valid POST request', function () {
- const request = spec.buildRequests(
- [
- {
- bidder: 'avct',
- params: {
- placement: '012345678901234567890123',
- },
- userId: {
- id5id: {
- uid: 'test'
- }
- }
- },
- {
- bidder: 'avct',
- params: {
- placement: '012345678901234567890123',
- },
- },
- ],
- exampleBidderRequest
- );
- expect(request.method).to.equal('POST');
- expect(request.url).to.equal('https://ads.avct.cloud/prebid');
-
- const requestData = JSON.parse(request.data);
- expect(requestData.ext).to.be.an('object');
- expect(requestData.ext.currency).to.equal('USD');
- expect(requestData.ext.publisherDomain).to.equal('test.com');
- expect(requestData.ext.fpd).to.deep.equal({ some: 'data' });
- expect(requestData.ext.schain).to.deep.equal({
- validation: 'strict',
- config: {
- ver: '1.0',
- complete: 1,
- nodes: [
- {
- asi: 'indirectseller.com',
- sid: '00001',
- hp: 1,
- },
- ],
- },
- });
- expect(requestData.ext.id5id).to.equal('test');
- expect(requestData.bids).to.be.an('array');
- expect(requestData.bids.length).to.equal(2);
- });
- });
- describe('interpretResponse', function () {
- it('no response', function () {
- const response = spec.interpretResponse();
- expect(response).to.be.an('array');
- expect(response.length).to.equal(0);
- });
- it('no body', function () {
- const response = spec.interpretResponse({});
- expect(response).to.be.an('array');
- expect(response.length).to.equal(0);
- });
- it('null body', function () {
- const response = spec.interpretResponse({ body: null });
- expect(response).to.be.an('array');
- expect(response.length).to.equal(0);
- });
- it('empty body', function () {
- const response = spec.interpretResponse({ body: {} });
- expect(response).to.be.an('array');
- expect(response.length).to.equal(0);
- });
- it('null body.responses', function () {
- const response = spec.interpretResponse({ body: { responses: null } });
- expect(response).to.be.an('array');
- expect(response.length).to.equal(0);
- });
- it('array body', function () {
- const response = spec.interpretResponse({ body: [{}] });
- expect(response).to.be.an('array');
- expect(response.length).to.equal(1);
- });
- it('array body.responses', function () {
- const response = spec.interpretResponse({ body: { responses: [{}] } });
- expect(response).to.be.an('array');
- expect(response.length).to.equal(1);
- });
- });
-});
-
-const exampleBidderRequest = {
- schain: {
- validation: 'strict',
- config: {
- ver: '1.0',
- complete: 1,
- nodes: [
- {
- asi: 'indirectseller.com',
- sid: '00001',
- hp: 1,
- },
- ],
- },
- },
-};
diff --git a/test/spec/modules/bidlabBidAdapter_spec.js b/test/spec/modules/bidlabBidAdapter_spec.js
deleted file mode 100644
index cffd43ae6ca..00000000000
--- a/test/spec/modules/bidlabBidAdapter_spec.js
+++ /dev/null
@@ -1,235 +0,0 @@
-import {expect} from 'chai';
-import {spec} from '../../../modules/bidlabBidAdapter.js';
-
-describe('BidlabBidAdapter', function () {
- let bid = {
- bidId: '23fhj33i987f',
- bidder: 'bidlab',
- params: {
- placementId: 0,
- traffic: 'banner'
- }
- };
-
- describe('isBidRequestValid', function () {
- it('Should return true if there are bidId, params and placementId parameters present', function () {
- expect(spec.isBidRequestValid(bid)).to.be.true;
- });
- it('Should return false if at least one of parameters is not present', function () {
- delete bid.params.placementId;
- expect(spec.isBidRequestValid(bid)).to.be.false;
- });
- });
-
- describe('buildRequests', function () {
- let serverRequest = spec.buildRequests([bid]);
- it('Creates a ServerRequest object with method, URL and data', function () {
- expect(serverRequest).to.exist;
- expect(serverRequest.method).to.exist;
- expect(serverRequest.url).to.exist;
- expect(serverRequest.data).to.exist;
- });
- it('Returns POST method', function () {
- expect(serverRequest.method).to.equal('POST');
- });
- it('Returns valid URL', function () {
- expect(serverRequest.url).to.equal('https://service.bidlab.ai/?c=o&m=multi');
- });
- it('Returns valid data if array of bids is valid', function () {
- let data = serverRequest.data;
- expect(data).to.be.an('object');
- expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements');
- expect(data.deviceWidth).to.be.a('number');
- expect(data.deviceHeight).to.be.a('number');
- expect(data.language).to.be.a('string');
- expect(data.secure).to.be.within(0, 1);
- expect(data.host).to.be.a('string');
- expect(data.page).to.be.a('string');
- let placement = data['placements'][0];
- expect(placement).to.have.keys('placementId', 'bidId', 'traffic', 'sizes');
- expect(placement.placementId).to.equal(0);
- expect(placement.bidId).to.equal('23fhj33i987f');
- expect(placement.traffic).to.equal('banner');
- });
- it('Returns empty data if no valid requests are passed', function () {
- serverRequest = spec.buildRequests([]);
- let data = serverRequest.data;
- expect(data.placements).to.be.an('array').that.is.empty;
- });
- });
- describe('interpretResponse', function () {
- it('Should interpret banner response', function () {
- const banner = {
- body: [{
- mediaType: 'banner',
- width: 300,
- height: 250,
- cpm: 0.4,
- ad: 'Test',
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let bannerResponses = spec.interpretResponse(banner);
- expect(bannerResponses).to.be.an('array').that.is.not.empty;
- let dataItem = bannerResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.4);
- expect(dataItem.width).to.equal(300);
- expect(dataItem.height).to.equal(250);
- expect(dataItem.ad).to.equal('Test');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should interpret video response', function () {
- const video = {
- body: [{
- vastUrl: 'test.com',
- mediaType: 'video',
- cpm: 0.5,
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let videoResponses = spec.interpretResponse(video);
- expect(videoResponses).to.be.an('array').that.is.not.empty;
-
- let dataItem = videoResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.5);
- expect(dataItem.vastUrl).to.equal('test.com');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should interpret native response', function () {
- const native = {
- body: [{
- mediaType: 'native',
- native: {
- clickUrl: 'test.com',
- title: 'Test',
- image: 'test.com',
- impressionTrackers: ['test.com'],
- },
- ttl: 120,
- cpm: 0.4,
- requestId: '23fhj33i987f',
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- }]
- };
- let nativeResponses = spec.interpretResponse(native);
- expect(nativeResponses).to.be.an('array').that.is.not.empty;
-
- let dataItem = nativeResponses[0];
- expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native');
- expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image')
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.4);
- expect(dataItem.native.clickUrl).to.equal('test.com');
- expect(dataItem.native.title).to.equal('Test');
- expect(dataItem.native.image).to.equal('test.com');
- expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty;
- expect(dataItem.native.impressionTrackers[0]).to.equal('test.com');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should return an empty array if invalid banner response is passed', function () {
- const invBanner = {
- body: [{
- width: 300,
- cpm: 0.4,
- ad: 'Test',
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
-
- let serverResponses = spec.interpretResponse(invBanner);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid video response is passed', function () {
- const invVideo = {
- body: [{
- mediaType: 'video',
- cpm: 0.5,
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let serverResponses = spec.interpretResponse(invVideo);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid native response is passed', function () {
- const invNative = {
- body: [{
- mediaType: 'native',
- clickUrl: 'test.com',
- title: 'Test',
- impressionTrackers: ['test.com'],
- ttl: 120,
- requestId: '23fhj33i987f',
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- }]
- };
- let serverResponses = spec.interpretResponse(invNative);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid response is passed', function () {
- const invalid = {
- body: [{
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let serverResponses = spec.interpretResponse(invalid);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- });
- describe('getUserSyncs', function () {
- let userSync = spec.getUserSyncs();
- it('Returns valid URL and type', function () {
- if (spec.noSync) {
- expect(userSync).to.be.equal(false);
- } else {
- expect(userSync).to.be.an('array').with.lengthOf(1);
- expect(userSync[0].type).to.exist;
- expect(userSync[0].url).to.exist;
- expect(userSync[0].type).to.be.equal('image');
- expect(userSync[0].url).to.be.equal('https://service.bidlab.ai/?c=o&m=sync');
- }
- });
- });
-});
diff --git a/test/spec/modules/bidphysicsBidAdapter_spec.js b/test/spec/modules/bidphysicsBidAdapter_spec.js
deleted file mode 100644
index fc15c39cf81..00000000000
--- a/test/spec/modules/bidphysicsBidAdapter_spec.js
+++ /dev/null
@@ -1,261 +0,0 @@
-import {expect} from 'chai';
-import {spec} from 'modules/bidphysicsBidAdapter.js';
-
-const REQUEST = {
- 'bidderCode': 'bidphysics',
- 'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708',
- 'bidderRequestId': 'requestId',
- 'bidRequest': [{
- 'bidder': 'bidphysics',
- 'params': {
- 'unitId': 123456,
- },
- 'placementCode': 'div-gpt-dummy-placement-code',
- 'sizes': [
- [300, 250]
- ],
- 'bidId': 'bidId1',
- 'bidderRequestId': 'bidderRequestId',
- 'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708'
- },
- {
- 'bidder': 'bidphysics',
- 'params': {
- 'unitId': 123456,
- },
- 'placementCode': 'div-gpt-dummy-placement-code',
- 'sizes': [
- [300, 250]
- ],
- 'bidId': 'bidId2',
- 'bidderRequestId': 'bidderRequestId',
- 'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708'
- }],
- 'start': 1487883186070,
- 'auctionStart': 1487883186069,
- 'timeout': 3000
-};
-
-const RESPONSE = {
- 'headers': null,
- 'body': {
- 'id': 'responseId',
- 'seatbid': [
- {
- 'bid': [
- {
- 'id': 'bidId1',
- 'impid': 'bidId1',
- 'price': 0.18,
- 'adm': '',
- 'adid': '144762342',
- 'adomain': [
- 'https://dummydomain.com'
- ],
- 'iurl': 'iurl',
- 'cid': '109',
- 'crid': 'creativeId',
- 'cat': [],
- 'w': 300,
- 'h': 250,
- 'ext': {
- 'prebid': {
- 'type': 'banner'
- },
- 'bidder': {
- 'appnexus': {
- 'brand_id': 334553,
- 'auction_id': 514667951122925701,
- 'bidder_id': 2,
- 'bid_ad_type': 0
- }
- }
- }
- },
- {
- 'id': 'bidId2',
- 'impid': 'bidId2',
- 'price': 0.1,
- 'adm': '',
- 'adid': '144762342',
- 'adomain': [
- 'https://dummydomain.com'
- ],
- 'iurl': 'iurl',
- 'cid': '109',
- 'crid': 'creativeId',
- 'cat': [],
- 'w': 300,
- 'h': 250,
- 'ext': {
- 'prebid': {
- 'type': 'banner'
- },
- 'bidder': {
- 'appnexus': {
- 'brand_id': 386046,
- 'auction_id': 517067951122925501,
- 'bidder_id': 2,
- 'bid_ad_type': 0
- }
- }
- }
- }
- ],
- 'seat': 'bidphysics'
- }
- ],
- 'ext': {
- 'usersync': {
- 'sovrn': {
- 'status': 'none',
- 'syncs': [
- {
- 'url': 'urlsovrn',
- 'type': 'iframe'
- }
- ]
- },
- 'appnexus': {
- 'status': 'none',
- 'syncs': [
- {
- 'url': 'urlappnexus',
- 'type': 'pixel'
- }
- ]
- }
- },
- 'responsetimemillis': {
- 'appnexus': 127
- }
- }
- }
-};
-
-describe('BidPhysics bid adapter', function () {
- describe('isBidRequestValid', function () {
- it('should accept request if only unitId is passed', function () {
- let bid = {
- bidder: 'bidphysics',
- params: {
- unitId: 'unitId',
- }
- };
- expect(spec.isBidRequestValid(bid)).to.equal(true);
- });
- it('should accept request if only networkId is passed', function () {
- let bid = {
- bidder: 'bidphysics',
- params: {
- networkId: 'networkId',
- }
- };
- expect(spec.isBidRequestValid(bid)).to.equal(true);
- });
- it('should accept request if only publisherId is passed', function () {
- let bid = {
- bidder: 'bidphysics',
- params: {
- publisherId: 'publisherId',
- }
- };
- expect(spec.isBidRequestValid(bid)).to.equal(true);
- });
-
- it('reject requests without params', function () {
- let bid = {
- bidder: 'bidphysics',
- params: {}
- };
- expect(spec.isBidRequestValid(bid)).to.equal(false);
- });
- });
-
- describe('buildRequests', function () {
- it('creates request data', function () {
- let request = spec.buildRequests(REQUEST.bidRequest, REQUEST);
-
- expect(request).to.exist.and.to.be.a('object');
- const payload = JSON.parse(request.data);
- expect(payload.imp[0]).to.have.property('id', REQUEST.bidRequest[0].bidId);
- expect(payload.imp[1]).to.have.property('id', REQUEST.bidRequest[1].bidId);
- });
-
- it('has gdpr data if applicable', function () {
- const req = Object.assign({}, REQUEST, {
- gdprConsent: {
- consentString: 'consentString',
- gdprApplies: true,
- }
- });
- let request = spec.buildRequests(REQUEST.bidRequest, req);
-
- const payload = JSON.parse(request.data);
- expect(payload.user.ext).to.have.property('consent', req.gdprConsent.consentString);
- expect(payload.regs.ext).to.have.property('gdpr', 1);
- });
- });
-
- describe('interpretResponse', function () {
- it('have bids', function () {
- let bids = spec.interpretResponse(RESPONSE, REQUEST);
- expect(bids).to.be.an('array').that.is.not.empty;
- validateBidOnIndex(0);
- validateBidOnIndex(1);
-
- function validateBidOnIndex(index) {
- expect(bids[index]).to.have.property('currency', 'USD');
- expect(bids[index]).to.have.property('requestId', RESPONSE.body.seatbid[0].bid[index].impid);
- expect(bids[index]).to.have.property('cpm', RESPONSE.body.seatbid[0].bid[index].price);
- expect(bids[index]).to.have.property('width', RESPONSE.body.seatbid[0].bid[index].w);
- expect(bids[index]).to.have.property('height', RESPONSE.body.seatbid[0].bid[index].h);
- expect(bids[index]).to.have.property('ad', RESPONSE.body.seatbid[0].bid[index].adm);
- expect(bids[index]).to.have.property('creativeId', RESPONSE.body.seatbid[0].bid[index].crid);
- expect(bids[index]).to.have.property('ttl', 30);
- expect(bids[index]).to.have.property('netRevenue', true);
- }
- });
-
- it('handles empty response', function () {
- const EMPTY_RESP = Object.assign({}, RESPONSE, {'body': {}});
- const bids = spec.interpretResponse(EMPTY_RESP, REQUEST);
-
- expect(bids).to.be.empty;
- });
- });
-
- describe('getUserSyncs', function () {
- it('handles no parameters', function () {
- let opts = spec.getUserSyncs({});
- expect(opts).to.be.an('array').that.is.empty;
- });
- it('returns non if sync is not allowed', function () {
- let opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: false});
-
- expect(opts).to.be.an('array').that.is.empty;
- });
-
- it('iframe sync enabled should return results', function () {
- let opts = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: false}, [RESPONSE]);
-
- expect(opts.length).to.equal(1);
- expect(opts[0].type).to.equal('iframe');
- expect(opts[0].url).to.equal(RESPONSE.body.ext.usersync['sovrn'].syncs[0].url);
- });
-
- it('pixel sync enabled should return results', function () {
- let opts = spec.getUserSyncs({iframeEnabled: false, pixelEnabled: true}, [RESPONSE]);
-
- expect(opts.length).to.equal(1);
- expect(opts[0].type).to.equal('image');
- expect(opts[0].url).to.equal(RESPONSE.body.ext.usersync['appnexus'].syncs[0].url);
- });
-
- it('all sync enabled should return all results', function () {
- let opts = spec.getUserSyncs({iframeEnabled: true, pixelEnabled: true}, [RESPONSE]);
-
- expect(opts.length).to.equal(2);
- });
- });
-});
diff --git a/test/spec/modules/bizzclickBidAdapter_spec.js b/test/spec/modules/bizzclickBidAdapter_spec.js
deleted file mode 100644
index e0698c9eda8..00000000000
--- a/test/spec/modules/bizzclickBidAdapter_spec.js
+++ /dev/null
@@ -1,396 +0,0 @@
-import { expect } from 'chai';
-import { spec } from 'modules/bizzclickBidAdapter.js';
-import {config} from 'src/config.js';
-
-const NATIVE_BID_REQUEST = {
- code: 'native_example',
- mediaTypes: {
- native: {
- title: {
- required: true,
- len: 800
- },
- image: {
- required: true,
- len: 80
- },
- sponsoredBy: {
- required: true
- },
- clickUrl: {
- required: true
- },
- privacyLink: {
- required: false
- },
- body: {
- required: true
- },
- icon: {
- required: true,
- sizes: [50, 50]
- }
- }
- },
- bidder: 'bizzclick',
- params: {
- placementId: 'hash',
- accountId: 'accountId'
- },
- timeout: 1000
-
-};
-
-const BANNER_BID_REQUEST = {
- code: 'banner_example',
- mediaTypes: {
- banner: {
- sizes: [[300, 250], [300, 600]]
- }
- },
- bidder: 'bizzclick',
- params: {
- placementId: 'hash',
- accountId: 'accountId'
- },
- timeout: 1000,
- gdprConsent: {
- consentString: 'BOEFEAyOEFEAyAHABDENAI4AAAB9vABAASA',
- gdprApplies: 1,
- },
- uspConsent: 'uspConsent'
-}
-
-const bidRequest = {
- refererInfo: {
- referer: 'test.com'
- }
-}
-
-const VIDEO_BID_REQUEST = {
- code: 'video1',
- sizes: [640, 480],
- mediaTypes: { video: {
- minduration: 0,
- maxduration: 999,
- boxingallowed: 1,
- skip: 0,
- mimes: [
- 'application/javascript',
- 'video/mp4'
- ],
- w: 1920,
- h: 1080,
- protocols: [
- 2
- ],
- linearity: 1,
- api: [
- 1,
- 2
- ]
- }
- },
-
- bidder: 'bizzclick',
- params: {
- placementId: 'hash',
- accountId: 'accountId'
- },
- timeout: 1000
-
-}
-
-const BANNER_BID_RESPONSE = {
- id: 'request_id',
- bidid: 'request_imp_id',
- seatbid: [{
- bid: [{
- id: 'bid_id',
- impid: 'request_imp_id',
- price: 5,
- adomain: ['example.com'],
- adm: 'admcode',
- crid: 'crid',
- ext: {
- mediaType: 'banner'
- }
- }],
- }],
-};
-
-const VIDEO_BID_RESPONSE = {
- id: 'request_id',
- bidid: 'request_imp_id',
- seatbid: [{
- bid: [{
- id: 'bid_id',
- impid: 'request_imp_id',
- price: 5,
- adomain: ['example.com'],
- adm: 'admcode',
- crid: 'crid',
- ext: {
- mediaType: 'video',
- vastUrl: 'http://example.vast',
- }
- }],
- }],
-};
-
-let imgData = {
- url: `https://example.com/image`,
- w: 1200,
- h: 627
-};
-
-const NATIVE_BID_RESPONSE = {
- id: 'request_id',
- bidid: 'request_imp_id',
- seatbid: [{
- bid: [{
- id: 'bid_id',
- impid: 'request_imp_id',
- price: 5,
- adomain: ['example.com'],
- adm: { native:
- {
- assets: [
- {id: 0, title: 'dummyText'},
- {id: 3, image: imgData},
- {
- id: 5,
- data: {value: 'organization.name'}
- }
- ],
- link: {url: 'example.com'},
- imptrackers: ['tracker1.com', 'tracker2.com', 'tracker3.com'],
- jstracker: 'tracker1.com'
- }
- },
- crid: 'crid',
- ext: {
- mediaType: 'native'
- }
- }],
- }],
-};
-
-describe('BizzclickAdapter', function() {
- describe('with COPPA', function() {
- beforeEach(function() {
- sinon.stub(config, 'getConfig')
- .withArgs('coppa')
- .returns(true);
- });
- afterEach(function() {
- config.getConfig.restore();
- });
-
- it('should send the Coppa "required" flag set to "1" in the request', function () {
- let serverRequest = spec.buildRequests([BANNER_BID_REQUEST]);
- expect(serverRequest.data[0].regs.coppa).to.equal(1);
- });
- });
-
- describe('isBidRequestValid', function() {
- it('should return true when required params found', function () {
- expect(spec.isBidRequestValid(NATIVE_BID_REQUEST)).to.equal(true);
- });
-
- it('should return false when required params are not passed', function () {
- let bid = Object.assign({}, NATIVE_BID_REQUEST);
- delete bid.params;
- bid.params = {
- 'IncorrectParam': 0
- };
- expect(spec.isBidRequestValid(bid)).to.equal(false);
- });
- });
-
- describe('build Native Request', function () {
- const request = spec.buildRequests([NATIVE_BID_REQUEST], bidRequest);
-
- it('Creates a ServerRequest object with method, URL and data', function () {
- expect(request).to.exist;
- expect(request.method).to.exist;
- expect(request.url).to.exist;
- expect(request.data).to.exist;
- });
-
- it('sends bid request to our endpoint via POST', function () {
- expect(request.method).to.equal('POST');
- });
-
- it('Returns valid URL', function () {
- expect(request.url).to.equal('https://us-e-node1.bizzclick.com/bid?rtb_seat_id=prebidjs&secret_key=accountId');
- });
-
- it('Returns empty data if no valid requests are passed', function () {
- let serverRequest = spec.buildRequests([]);
- expect(serverRequest).to.be.an('array').that.is.empty;
- });
- });
-
- describe('build Banner Request', function () {
- const request = spec.buildRequests([BANNER_BID_REQUEST]);
-
- it('Creates a ServerRequest object with method, URL and data', function () {
- expect(request).to.exist;
- expect(request.method).to.exist;
- expect(request.url).to.exist;
- expect(request.data).to.exist;
- });
-
- it('sends bid request to our endpoint via POST', function () {
- expect(request.method).to.equal('POST');
- });
-
- it('check consent and ccpa string is set properly', function() {
- expect(request.data[0].regs.ext.gdpr).to.equal(1);
- expect(request.data[0].user.ext.consent).to.equal(BANNER_BID_REQUEST.gdprConsent.consentString);
- expect(request.data[0].regs.ext.us_privacy).to.equal(BANNER_BID_REQUEST.uspConsent);
- })
-
- it('Returns valid URL', function () {
- expect(request.url).to.equal('https://us-e-node1.bizzclick.com/bid?rtb_seat_id=prebidjs&secret_key=accountId');
- });
- });
-
- describe('build Video Request', function () {
- const request = spec.buildRequests([VIDEO_BID_REQUEST]);
-
- it('Creates a ServerRequest object with method, URL and data', function () {
- expect(request).to.exist;
- expect(request.method).to.exist;
- expect(request.url).to.exist;
- expect(request.data).to.exist;
- });
-
- it('sends bid request to our endpoint via POST', function () {
- expect(request.method).to.equal('POST');
- });
-
- it('Returns valid URL', function () {
- expect(request.url).to.equal('https://us-e-node1.bizzclick.com/bid?rtb_seat_id=prebidjs&secret_key=accountId');
- });
- });
-
- describe('interpretResponse', function () {
- it('Empty response must return empty array', function() {
- const emptyResponse = null;
- let response = spec.interpretResponse(emptyResponse);
-
- expect(response).to.be.an('array').that.is.empty;
- })
-
- it('Should interpret banner response', function () {
- const bannerResponse = {
- body: [BANNER_BID_RESPONSE]
- }
-
- const expectedBidResponse = {
- requestId: BANNER_BID_RESPONSE.id,
- cpm: BANNER_BID_RESPONSE.seatbid[0].bid[0].price,
- width: BANNER_BID_RESPONSE.seatbid[0].bid[0].w,
- height: BANNER_BID_RESPONSE.seatbid[0].bid[0].h,
- ttl: BANNER_BID_RESPONSE.ttl || 1200,
- currency: BANNER_BID_RESPONSE.cur || 'USD',
- netRevenue: true,
- creativeId: BANNER_BID_RESPONSE.seatbid[0].bid[0].crid,
- dealId: BANNER_BID_RESPONSE.seatbid[0].bid[0].dealid,
- mediaType: 'banner',
- ad: BANNER_BID_RESPONSE.seatbid[0].bid[0].adm
- }
-
- let bannerResponses = spec.interpretResponse(bannerResponse);
-
- expect(bannerResponses).to.be.an('array').that.is.not.empty;
- let dataItem = bannerResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal(expectedBidResponse.requestId);
- expect(dataItem.cpm).to.equal(expectedBidResponse.cpm);
- expect(dataItem.ad).to.equal(expectedBidResponse.ad);
- expect(dataItem.ttl).to.equal(expectedBidResponse.ttl);
- expect(dataItem.creativeId).to.equal(expectedBidResponse.creativeId);
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal(expectedBidResponse.currency);
- expect(dataItem.width).to.equal(expectedBidResponse.width);
- expect(dataItem.height).to.equal(expectedBidResponse.height);
- });
-
- it('Should interpret video response', function () {
- const videoResponse = {
- body: [VIDEO_BID_RESPONSE]
- }
-
- const expectedBidResponse = {
- requestId: VIDEO_BID_RESPONSE.id,
- cpm: VIDEO_BID_RESPONSE.seatbid[0].bid[0].price,
- width: VIDEO_BID_RESPONSE.seatbid[0].bid[0].w,
- height: VIDEO_BID_RESPONSE.seatbid[0].bid[0].h,
- ttl: VIDEO_BID_RESPONSE.ttl || 1200,
- currency: VIDEO_BID_RESPONSE.cur || 'USD',
- netRevenue: true,
- creativeId: VIDEO_BID_RESPONSE.seatbid[0].bid[0].crid,
- dealId: VIDEO_BID_RESPONSE.seatbid[0].bid[0].dealid,
- mediaType: 'video',
- vastXml: VIDEO_BID_RESPONSE.seatbid[0].bid[0].adm,
- vastUrl: VIDEO_BID_RESPONSE.seatbid[0].bid[0].ext.vastUrl
- }
-
- let videoResponses = spec.interpretResponse(videoResponse);
-
- expect(videoResponses).to.be.an('array').that.is.not.empty;
- let dataItem = videoResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'vastXml', 'vastUrl', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal(expectedBidResponse.requestId);
- expect(dataItem.cpm).to.equal(expectedBidResponse.cpm);
- expect(dataItem.vastXml).to.equal(expectedBidResponse.vastXml)
- expect(dataItem.ttl).to.equal(expectedBidResponse.ttl);
- expect(dataItem.creativeId).to.equal(expectedBidResponse.creativeId);
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal(expectedBidResponse.currency);
- expect(dataItem.width).to.equal(expectedBidResponse.width);
- expect(dataItem.height).to.equal(expectedBidResponse.height);
- });
-
- it('Should interpret native response', function () {
- const nativeResponse = {
- body: [NATIVE_BID_RESPONSE]
- }
-
- const expectedBidResponse = {
- requestId: NATIVE_BID_RESPONSE.id,
- cpm: NATIVE_BID_RESPONSE.seatbid[0].bid[0].price,
- width: NATIVE_BID_RESPONSE.seatbid[0].bid[0].w,
- height: NATIVE_BID_RESPONSE.seatbid[0].bid[0].h,
- ttl: NATIVE_BID_RESPONSE.ttl || 1200,
- currency: NATIVE_BID_RESPONSE.cur || 'USD',
- netRevenue: true,
- creativeId: NATIVE_BID_RESPONSE.seatbid[0].bid[0].crid,
- dealId: NATIVE_BID_RESPONSE.seatbid[0].bid[0].dealid,
- mediaType: 'native',
- native: {clickUrl: NATIVE_BID_RESPONSE.seatbid[0].bid[0].adm.native.link.url}
- }
-
- let nativeResponses = spec.interpretResponse(nativeResponse);
-
- expect(nativeResponses).to.be.an('array').that.is.not.empty;
- let dataItem = nativeResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'native', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal(expectedBidResponse.requestId);
- expect(dataItem.cpm).to.equal(expectedBidResponse.cpm);
- expect(dataItem.native.clickUrl).to.equal(expectedBidResponse.native.clickUrl)
- expect(dataItem.ttl).to.equal(expectedBidResponse.ttl);
- expect(dataItem.creativeId).to.equal(expectedBidResponse.creativeId);
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal(expectedBidResponse.currency);
- expect(dataItem.width).to.equal(expectedBidResponse.width);
- expect(dataItem.height).to.equal(expectedBidResponse.height);
- });
- });
-})
diff --git a/test/spec/modules/boldwinBidAdapter_spec.js b/test/spec/modules/boldwinBidAdapter_spec.js
deleted file mode 100644
index a353665ec33..00000000000
--- a/test/spec/modules/boldwinBidAdapter_spec.js
+++ /dev/null
@@ -1,281 +0,0 @@
-import {expect} from 'chai';
-import {spec} from '../../../modules/boldwinBidAdapter.js';
-import { BANNER, VIDEO } from '../../../src/mediaTypes.js';
-
-describe('BoldwinBidAdapter', function () {
- const bid = {
- bidId: '23fhj33i987f',
- bidder: 'boldwin',
- params: {
- placementId: 0,
- traffic: BANNER
- }
- };
-
- const bidderRequest = {
- refererInfo: {
- referer: 'test.com'
- }
- };
-
- describe('isBidRequestValid', function () {
- it('Should return true if there are bidId, params and placementId parameters present', function () {
- expect(spec.isBidRequestValid(bid)).to.be.true;
- });
- it('Should return false if at least one of parameters is not present', function () {
- delete bid.params.placementId;
- expect(spec.isBidRequestValid(bid)).to.be.false;
- });
- });
-
- describe('buildRequests', function () {
- let serverRequest = spec.buildRequests([bid], bidderRequest);
- it('Creates a ServerRequest object with method, URL and data', function () {
- expect(serverRequest).to.exist;
- expect(serverRequest.method).to.exist;
- expect(serverRequest.url).to.exist;
- expect(serverRequest.data).to.exist;
- });
- it('Returns POST method', function () {
- expect(serverRequest.method).to.equal('POST');
- });
- it('Returns valid URL', function () {
- expect(serverRequest.url).to.equal('https://ssp.videowalldirect.com/?c=o&m=multi');
- });
- it('Returns valid data if array of bids is valid', function () {
- let data = serverRequest.data;
- expect(data).to.be.an('object');
- expect(data).to.have.all.keys('deviceWidth', 'deviceHeight', 'language', 'secure', 'host', 'page', 'placements');
- expect(data.deviceWidth).to.be.a('number');
- expect(data.deviceHeight).to.be.a('number');
- expect(data.language).to.be.a('string');
- expect(data.secure).to.be.within(0, 1);
- expect(data.host).to.be.a('string');
- expect(data.page).to.be.a('string');
- expect(data.gdpr).to.not.exist;
- expect(data.ccpa).to.not.exist;
- let placement = data['placements'][0];
- expect(placement).to.have.keys('placementId', 'bidId', 'traffic', 'sizes', 'hPlayer', 'wPlayer', 'schain');
- expect(placement.placementId).to.equal(0);
- expect(placement.bidId).to.equal('23fhj33i987f');
- expect(placement.traffic).to.equal(BANNER);
- expect(placement.schain).to.be.an('object');
- });
-
- it('Returns valid data for mediatype video', function () {
- const playerSize = [300, 300];
- bid.mediaTypes = {};
- bid.params.traffic = VIDEO;
- bid.mediaTypes[VIDEO] = {
- playerSize
- };
- serverRequest = spec.buildRequests([bid], bidderRequest);
- let data = serverRequest.data;
- expect(data).to.be.an('object');
- let placement = data['placements'][0];
- expect(placement).to.be.an('object');
- expect(placement.traffic).to.equal(VIDEO);
- expect(placement.wPlayer).to.equal(playerSize[0]);
- expect(placement.hPlayer).to.equal(playerSize[1]);
- });
-
- it('Returns data with gdprConsent and without uspConsent', function () {
- bidderRequest.gdprConsent = 'test';
- serverRequest = spec.buildRequests([bid], bidderRequest);
- let data = serverRequest.data;
- expect(data.gdpr).to.exist;
- expect(data.gdpr).to.be.a('string');
- expect(data.gdpr).to.equal(bidderRequest.gdprConsent);
- expect(data.ccpa).to.not.exist;
- delete bidderRequest.gdprConsent;
- });
-
- it('Returns data with uspConsent and without gdprConsent', function () {
- bidderRequest.uspConsent = 'test';
- serverRequest = spec.buildRequests([bid], bidderRequest);
- let data = serverRequest.data;
- expect(data.ccpa).to.exist;
- expect(data.ccpa).to.be.a('string');
- expect(data.ccpa).to.equal(bidderRequest.uspConsent);
- expect(data.gdpr).to.not.exist;
- });
-
- it('Returns empty data if no valid requests are passed', function () {
- serverRequest = spec.buildRequests([]);
- let data = serverRequest.data;
- expect(data.placements).to.be.an('array').that.is.empty;
- });
- });
- describe('interpretResponse', function () {
- it('Should interpret banner response', function () {
- const banner = {
- body: [{
- mediaType: 'banner',
- width: 300,
- height: 250,
- cpm: 0.4,
- ad: 'Test',
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let bannerResponses = spec.interpretResponse(banner);
- expect(bannerResponses).to.be.an('array').that.is.not.empty;
- let dataItem = bannerResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.4);
- expect(dataItem.width).to.equal(300);
- expect(dataItem.height).to.equal(250);
- expect(dataItem.ad).to.equal('Test');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should interpret video response', function () {
- const video = {
- body: [{
- vastUrl: 'test.com',
- mediaType: 'video',
- cpm: 0.5,
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let videoResponses = spec.interpretResponse(video);
- expect(videoResponses).to.be.an('array').that.is.not.empty;
-
- let dataItem = videoResponses[0];
- expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId',
- 'netRevenue', 'currency', 'dealId', 'mediaType');
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.5);
- expect(dataItem.vastUrl).to.equal('test.com');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should interpret native response', function () {
- const native = {
- body: [{
- mediaType: 'native',
- native: {
- clickUrl: 'test.com',
- title: 'Test',
- image: 'test.com',
- impressionTrackers: ['test.com'],
- },
- ttl: 120,
- cpm: 0.4,
- requestId: '23fhj33i987f',
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- }]
- };
- let nativeResponses = spec.interpretResponse(native);
- expect(nativeResponses).to.be.an('array').that.is.not.empty;
-
- let dataItem = nativeResponses[0];
- expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native');
- expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image')
- expect(dataItem.requestId).to.equal('23fhj33i987f');
- expect(dataItem.cpm).to.equal(0.4);
- expect(dataItem.native.clickUrl).to.equal('test.com');
- expect(dataItem.native.title).to.equal('Test');
- expect(dataItem.native.image).to.equal('test.com');
- expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty;
- expect(dataItem.native.impressionTrackers[0]).to.equal('test.com');
- expect(dataItem.ttl).to.equal(120);
- expect(dataItem.creativeId).to.equal('2');
- expect(dataItem.netRevenue).to.be.true;
- expect(dataItem.currency).to.equal('USD');
- });
- it('Should return an empty array if invalid banner response is passed', function () {
- const invBanner = {
- body: [{
- width: 300,
- cpm: 0.4,
- ad: 'Test',
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
-
- let serverResponses = spec.interpretResponse(invBanner);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid video response is passed', function () {
- const invVideo = {
- body: [{
- mediaType: 'video',
- cpm: 0.5,
- requestId: '23fhj33i987f',
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let serverResponses = spec.interpretResponse(invVideo);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid native response is passed', function () {
- const invNative = {
- body: [{
- mediaType: 'native',
- clickUrl: 'test.com',
- title: 'Test',
- impressionTrackers: ['test.com'],
- ttl: 120,
- requestId: '23fhj33i987f',
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- }]
- };
- let serverResponses = spec.interpretResponse(invNative);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- it('Should return an empty array if invalid response is passed', function () {
- const invalid = {
- body: [{
- ttl: 120,
- creativeId: '2',
- netRevenue: true,
- currency: 'USD',
- dealId: '1'
- }]
- };
- let serverResponses = spec.interpretResponse(invalid);
- expect(serverResponses).to.be.an('array').that.is.empty;
- });
- });
-
- describe('getUserSyncs', function () {
- let userSync = spec.getUserSyncs();
- it('Returns valid URL and type', function () {
- expect(userSync).to.be.an('array').with.lengthOf(1);
- expect(userSync[0].type).to.exist;
- expect(userSync[0].url).to.exist;
- expect(userSync[0].type).to.be.equal('image');
- expect(userSync[0].url).to.be.equal('https://cs.videowalldirect.com/?c=o&m=cookie');
- });
- });
-});
diff --git a/test/spec/modules/byplayBidAdapter_spec.js b/test/spec/modules/byplayBidAdapter_spec.js
deleted file mode 100644
index 57aad403c4e..00000000000
--- a/test/spec/modules/byplayBidAdapter_spec.js
+++ /dev/null
@@ -1,93 +0,0 @@
-import { expect } from 'chai';
-import { spec } from 'modules/byplayBidAdapter.js';
-import { newBidder } from 'src/adapters/bidderFactory.js';
-import * as bidderFactory from 'src/adapters/bidderFactory.js';
-
-describe('byplayBidAdapter', () => {
- describe('isBidRequestValid', () => {
- describe('exist sectionId', () => {
- const bid = {
- 'bidder': 'byplay',
- 'params': {
- 'sectionId': '11111'
- },
- };
-
- it('should equal true', () => {
- expect(spec.isBidRequestValid(bid)).to.equal(true);
- });
- });
-
- describe('not exist sectionId', () => {
- const bid = {
- 'bidder': 'byplay',
- 'params': {
- },
- };
-
- it('should equal false', () => {
- expect(spec.isBidRequestValid(bid)).to.equal(false);
- });
- });
- });
-
- describe('buildRequests', () => {
- const bids = [
- {
- 'bidder': 'byplay',
- 'bidId': '1234',
- 'params': {
- 'sectionId': '1111'
- },
- }
- ];
-
- const request = spec.buildRequests(bids);
-
- it('should return POST', () => {
- expect(request[0].method).to.equal('POST');
- });
-
- it('should return data', () => {
- expect(request[0].data).to.equal('{"requestId":"1234","sectionId":"1111"}');
- });
- });
-
- describe('interpretResponse', () => {
- const serverResponse = {
- body: {
- 'cpm': 1500,
- 'width': 320,
- 'height': 180,
- 'netRevenue': true,
- 'creativeId': '1',
- 'requestId': '209c1fb5ad88f5',
- 'vastXml': '