Skip to content

Commit

Permalink
[sspbc-5.7] update remote branch
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-bialy-wpm committed Aug 1, 2022
2 parents 9fd8390 + 82d74d2 commit a197738
Show file tree
Hide file tree
Showing 156 changed files with 5,527 additions and 1,135 deletions.
2 changes: 1 addition & 1 deletion babelConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function (options = {}) {
],
'plugins': [
[path.resolve(__dirname, './plugins/pbjsGlobals.js'), options],
useLocal('babel-plugin-transform-object-assign'),
[useLocal('@babel/plugin-transform-runtime')],
],
}
}
4 changes: 2 additions & 2 deletions integrationExamples/gpt/prebidServer_native_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
<script>
// GPT setup
googletag.cmd.push(function () {
// var slot1 = googletag.defineSlot('/19968336/prebid_native_example_1', [[360, 360]], 'div-1').addService(googletag.pubads());
// var slot2 = googletag.defineSlot('/19968336/prebid_native_example_2', 'fluid', 'div-2').addService(googletag.pubads());
googletag.defineSlot('/19968336/prebid_native_example_1', [[360, 360]], 'div-1').addService(googletag.pubads());
googletag.defineSlot('/19968336/prebid_native_example_2', 'fluid', 'div-2').addService(googletag.pubads());
googletag.pubads().disableInitialLoad();
googletag.pubads().enableSingleRequest();
googletag.enableServices();
Expand Down
3 changes: 2 additions & 1 deletion modules/.submodules.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
],
"fpdModule": [
"enrichmentFpdModule",
"validationFpdModule"
"validationFpdModule",
"topicsFpdModule"
]
},
"libraries": {
Expand Down
74 changes: 73 additions & 1 deletion modules/33acrossBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function _createServerRequest({ bidRequests, gdprConsent = {}, uspConsent, pageU
});

ttxRequest.site = { id: siteId };
ttxRequest.device = _buildDeviceORTB();

if (pageUrl) {
ttxRequest.site.page = pageUrl;
Expand Down Expand Up @@ -333,12 +334,15 @@ function setExtensions(obj = {}, extFields) {

// BUILD REQUESTS: IMP
function _buildImpORTB(bidRequest) {
const gpid = deepAccess(bidRequest, 'ortb2Imp.ext.gpid');

const imp = {
id: bidRequest.bidId,
ext: {
ttx: {
prod: deepAccess(bidRequest, 'params.productId')
}
},
...(gpid ? { gpid } : {})
}
};

Expand Down Expand Up @@ -734,6 +738,74 @@ function _createSync({ siteId = 'zzz000000000003zzz', gdprConsent = {}, uspConse
return sync;
}

// BUILD REQUESTS: DEVICE
function _buildDeviceORTB() {
const win = getWindowSelf();

return {
ext: {
ttx: {
...getScreenDimensions(),
pxr: win.devicePixelRatio,
vp: getViewportDimensions(),
ah: win.screen.availHeight,
mtp: win.navigator.maxTouchPoints
}
}
};
}

function getTopMostAccessibleWindow() {
let mostAccessibleWindow = getWindowSelf();

try {
while (mostAccessibleWindow.parent !== mostAccessibleWindow &&
mostAccessibleWindow.parent.document) {
mostAccessibleWindow = mostAccessibleWindow.parent;
}
} catch (err) {
// Do not throw an exception if we can't access the topmost frame.
}

return mostAccessibleWindow;
}

function getViewportDimensions() {
const topWin = getTopMostAccessibleWindow();
const documentElement = topWin.document.documentElement;

return {
w: documentElement.clientWidth,
h: documentElement.clientHeight,
};
}

function getScreenDimensions() {
const {
innerWidth: windowWidth,
innerHeight: windowHeight,
screen
} = getWindowSelf();

const [biggerDimension, smallerDimension] = [
Math.max(screen.width, screen.height),
Math.min(screen.width, screen.height),
];

if (windowHeight > windowWidth) { // Portrait mode
return {
w: smallerDimension,
h: biggerDimension,
};
}

// Landscape mode
return {
w: biggerDimension,
h: smallerDimension,
};
}

export const spec = {
NON_MEASURABLE,

Expand Down
4 changes: 4 additions & 0 deletions modules/ablidaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { triggerPixel } from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'ablida';
const ENDPOINT_URL = 'https://bidder.ablida.net/prebid';
Expand All @@ -28,6 +29,9 @@ export const spec = {
* @param bidderRequest
*/
buildRequests: function (validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

if (validBidRequests.length === 0) {
return [];
}
Expand Down
4 changes: 4 additions & 0 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {Renderer} from '../src/Renderer.js';
import {OUTSTREAM} from '../src/video.js';
import { getGlobal } from '../src/prebidGlobal.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adagio';
const LOG_PREFIX = 'Adagio:';
Expand Down Expand Up @@ -882,6 +883,9 @@ export const spec = {
},

buildRequests(validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

const secure = (location.protocol === 'https:') ? 1 : 0;
const device = internal.getDevice();
const site = internal.getSite(bidderRequest);
Expand Down
4 changes: 4 additions & 0 deletions modules/adbookpspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
uniques
} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

/**
* CONSTANTS
Expand Down Expand Up @@ -101,6 +102,9 @@ function isBidRequestValid(bidRequest) {
}

function buildRequests(validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

const requests = [];

if (validBidRequests.length > 0) {
Expand Down
4 changes: 4 additions & 0 deletions modules/adfBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {_map, deepAccess, deepSetValue, mergeDeep, parseSizesInput} from '../src/utils.js';
import {config} from '../src/config.js';
import {Renderer} from '../src/Renderer.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const { getConfig } = config;

Expand Down Expand Up @@ -60,6 +61,9 @@ export const spec = {
return !!(mid || (inv && mname));
},
buildRequests: (validBidRequests, bidderRequest) => {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

let app, site;

const commonFpd = bidderRequest.ortb2 || {};
Expand Down
3 changes: 3 additions & 0 deletions modules/adgenerationBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {tryAppendQueryString, getBidIdParameter} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const ADG_BIDDER_CODE = 'adgeneration';

Expand All @@ -25,6 +26,8 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function (validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const ADGENE_PREBID_VERSION = '1.4.0';
let serverRequests = [];
for (let i = 0, len = validBidRequests.length; i < len; i++) {
Expand Down
4 changes: 4 additions & 0 deletions modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {find, includes} from '../src/polyfill.js';
import {config} from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

/*
* In case you're AdKernel whitelable platform's client who needs branded adapter to
Expand Down Expand Up @@ -119,6 +120,9 @@ export const spec = {
* @returns {ServerRequest[]}
*/
buildRequests: function (bidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
bidRequests = convertOrtbRequestToProprietaryNative(bidRequests);

let impGroups = groupImpressionsByHostZone(bidRequests, bidderRequest.refererInfo);
let requests = [];
let schain = bidRequests[0].schain;
Expand Down
4 changes: 4 additions & 0 deletions modules/admanBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { isFn, deepAccess, logMessage } from '../src/utils.js';
import {config} from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adman';
const AD_URL = 'https://pub.admanmedia.com/?c=o&m=multi';
Expand Down Expand Up @@ -63,6 +64,9 @@ export const spec = {
},

buildRequests: (validBidRequests = [], bidderRequest) => {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

let winTop = window;
let location;
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
Expand Down
4 changes: 4 additions & 0 deletions modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { logError } from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {config} from '../src/config.js';
import {BANNER, VIDEO, NATIVE} from '../src/mediaTypes.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'admixer';
const ALIASES = ['go2net', 'adblender', 'adsyield', 'futureads'];
Expand All @@ -20,6 +21,9 @@ export const spec = {
* Make a server request from the list of BidRequests.
*/
buildRequests: function (validRequest, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validRequest = convertOrtbRequestToProprietaryNative(validRequest);

let w;
let docRef;
do {
Expand Down
4 changes: 4 additions & 0 deletions modules/adnowBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE} from '../src/mediaTypes.js';
import {deepAccess, parseQueryStringParameters, parseSizesInput} from '../src/utils.js';
import {includes} from '../src/polyfill.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adnow';
const ENDPOINT = 'https://n.ads3-adnow.com/a';
Expand Down Expand Up @@ -48,6 +49,9 @@ export const spec = {
* @return {ServerRequest}
*/
buildRequests(validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

return validBidRequests.map(req => {
const mediaType = this._isBannerRequest(req) ? BANNER : NATIVE;
const codeId = parseInt(req.params.codeId, 10);
Expand Down
3 changes: 3 additions & 0 deletions modules/adotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {isArray, isBoolean, isFn, isPlainObject, isStr, logError, replaceAuction
import {find} from '../src/polyfill.js';
import {config} from '../src/config.js';
import {OUTSTREAM} from '../src/video.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adot';
const ADAPTER_VERSION = 'v2.0.0';
Expand Down Expand Up @@ -373,6 +374,8 @@ function splitAdUnits(validBidRequests) {
* @returns {Array<AjaxRequest>}
*/
function buildRequests(validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const adUnits = splitAdUnits(validBidRequests);
const publisherPathConfig = config.getConfig('adot.publisherPath');
const publisherPath = publisherPathConfig === undefined ? '' : '/' + publisherPathConfig;
Expand Down
4 changes: 4 additions & 0 deletions modules/adprimeBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js';
import { isFn, deepAccess, logMessage } from '../src/utils.js';
import { config } from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adprime';
const AD_URL = 'https://delta.adprime.com/pbjs';
Expand Down Expand Up @@ -50,6 +51,9 @@ export const spec = {
},

buildRequests: (validBidRequests = [], bidderRequest) => {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

let winTop = window;
let location;
// TODO: this odd try-catch block was copied in several adapters; it doesn't seem to be correct for cross-origin
Expand Down
4 changes: 4 additions & 0 deletions modules/adrelevantisBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {find, includes} from '../src/polyfill.js';
import {INSTREAM, OUTSTREAM} from '../src/video.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adrelevantis';
const URL = 'https://ssp.adrelevantis.com/prebid';
Expand Down Expand Up @@ -71,6 +72,9 @@ export const spec = {
* @return ServerRequest Info describing the request to the server.
*/
buildRequests: function(bidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
bidRequests = convertOrtbRequestToProprietaryNative(bidRequests);

const tags = bidRequests.map(bidToTag);
const userObjBid = find(bidRequests, hasUserInfo);
let userObj;
Expand Down
3 changes: 3 additions & 0 deletions modules/adrinoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {triggerPixel} from '../src/utils.js';
import {NATIVE} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adrino';
const REQUEST_METHOD = 'POST';
Expand All @@ -28,6 +29,8 @@ export const spec = {
},

buildRequests: function (validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);
const bidRequests = [];

for (let i = 0; i < validBidRequests.length; i++) {
Expand Down
4 changes: 4 additions & 0 deletions modules/adtrueBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js';
import {config} from '../src/config.js';
import {getStorageManager} from '../src/storageManager.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

const BIDDER_CODE = 'adtrue';
const storage = getStorageManager({bidderCode: BIDDER_CODE});
Expand Down Expand Up @@ -450,6 +451,9 @@ export const spec = {
},

buildRequests: function (validBidRequests, bidderRequest) {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

let refererInfo;
if (bidderRequest && bidderRequest.refererInfo) {
refererInfo = bidderRequest.refererInfo;
Expand Down
4 changes: 4 additions & 0 deletions modules/aduptechBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {deepAccess, getAdUnitSizes} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, NATIVE} from '../src/mediaTypes.js';
import { convertOrtbRequestToProprietaryNative } from '../src/native.js';

export const BIDDER_CODE = 'aduptech';
export const ENDPOINT_URL_PUBLISHER_PLACEHOLDER = '{PUBLISHER}';
Expand Down Expand Up @@ -198,6 +199,9 @@ export const spec = {
* @returns {Object[]}
*/
buildRequests: (validBidRequests, bidderRequest) => {
// convert Native ORTB definition to old-style prebid native definition
validBidRequests = convertOrtbRequestToProprietaryNative(validBidRequests);

const requests = [];

// stop here on invalid or empty data
Expand Down
Loading

0 comments on commit a197738

Please sign in to comment.