Skip to content

Commit

Permalink
Merge branch 'master' of github.com:prebid/Prebid.js
Browse files Browse the repository at this point in the history
  • Loading branch information
uditalias committed Apr 12, 2020
2 parents 8c23b90 + 67a1cb1 commit 84df14e
Show file tree
Hide file tree
Showing 252 changed files with 20,042 additions and 1,993 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
// override the regular exclusion from above (for being inside node_modules).
{
test: /.js$/,
include: new RegExp(`\\${path.sep}prebid\.js`),
include: new RegExp(`\\${path.sep}prebid\\.js`),
use: {
loader: 'babel-loader',
// presets and plugins for Prebid.js must be manually specified separate from your other babel rule.
Expand Down
15 changes: 8 additions & 7 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const sharedWhiteList = [
"core-js/library/fn/array/find", // no ie11
"core-js/library/fn/array/includes", // no ie11
"core-js/library/fn/set", // ie11 supports Set but not Set#values
"core-js/library/fn/string/includes", // no ie11
"core-js/library/fn/number/is-integer", // no ie11,
"core-js/library/fn/array/from" // no ie11
'core-js/library/fn/array/find', // no ie11
'core-js/library/fn/array/includes', // no ie11
'core-js/library/fn/set', // ie11 supports Set but not Set#values
'core-js/library/fn/string/includes', // no ie11
'core-js/library/fn/number/is-integer', // no ie11,
'core-js/library/fn/array/from' // no ie11
];

module.exports = {
Expand All @@ -21,6 +21,7 @@ module.exports = {
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset'
'dset',
'deep-equal'
]
};
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ function test(done) {

execa(wdioCmd, wdioOpts, { stdio: 'inherit' })
.then(stdout => {
//kill mock server
// kill mock server
mockServer.kill('SIGINT');
done();
process.exit(0);
})
.catch(err => {
//kill mock server
// kill mock server
mockServer.kill('SIGINT');
done(new Error(`Tests failed with error: ${err}`));
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/digitrust_Full.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}());
var t = document.createElement('script');
t.async = false;
t.src = 'http://acdn.adnxs.com/cmp/cmp.bundle.js';
t.src = 'https://acdn.adnxs.com/cmp/cmp.bundle.js';
var tag = document.getElementsByTagName('head')[0];
tag.appendChild(t);
}
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/digitrust_Simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}());
var t = document.createElement('script');
t.async = false;
t.src = 'http://acdn.adnxs.com/cmp/cmp.bundle.js';
t.src = 'https://acdn.adnxs.com/cmp/cmp.bundle.js';
var tag = document.getElementsByTagName('head')[0];
tag.appendChild(t);
}
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/digitrust_cmp_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@ <h2>DigiTrust Prebid Sample - No Framework</h2>
googletag.cmd.push(function () { googletag.display('test-div'); });
</script>
</div>
<script src="http://cmp-origin-release.digitru.st/1/cmp.bundle.js"></script>
<script src="https://cmp-origin-release.digitru.st/1/cmp.bundle.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion integrationExamples/gpt/hello_world.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ <h5>Div-1</h5>
</script>
</div>
</body>
</html>
</html>
1 change: 1 addition & 0 deletions modules/aardvarkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function resetUserSync() {

export const spec = {
code: BIDDER_CODE,
gvlid: 52,
aliases: ['adsparc', 'safereach'],

isBidRequestValid: function(bid) {
Expand Down
24 changes: 19 additions & 5 deletions modules/adagioBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
import { loadExternalScript } from '../src/adloader.js'
import JSEncrypt from 'jsencrypt/bin/jsencrypt.js';
import sha256 from 'crypto-js/sha256.js';
import { getStorageManager } from '../src/storageManager.js';

const BIDDER_CODE = 'adagio';
const VERSION = '2.1.0';
const VERSION = '2.2.0';
const FEATURES_VERSION = '1';
const ENDPOINT = 'https://mp.4dex.io/prebid';
const SUPPORTED_MEDIA_TYPES = ['banner'];
const ADAGIO_TAG_URL = 'https://script.4dex.io/localstore.js';
const ADAGIO_LOCALSTORAGE_KEY = 'adagioScript';
const GVLID = 617;
const storage = getStorageManager(GVLID);

export const ADAGIO_PUBKEY = `-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9el0+OEn6fvEh1RdVHQu4cnT0
Expand All @@ -22,7 +25,7 @@ pV6EP3MTLosuUEpLaQIDAQAB

export function getAdagioScript() {
try {
const ls = utils.getDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);
const ls = storage.getDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);

if (!ls) {
utils.logWarn('Adagio Script not found');
Expand All @@ -33,7 +36,7 @@ export function getAdagioScript() {

if (!hashRgx.test(ls)) {
utils.logWarn('No hash found in Adagio script');
utils.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);
storage.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);
} else {
const r = ls.match(hashRgx);
const hash = r[2];
Expand All @@ -47,7 +50,7 @@ export function getAdagioScript() {
Function(ls)(); // eslint-disable-line no-new-func
} else {
utils.logWarn('Invalid Adagio script found');
utils.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);
storage.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY);
}
}
} catch (err) {
Expand Down Expand Up @@ -335,13 +338,22 @@ function _getGdprConsent(bidderRequest) {
if (bidderRequest.gdprConsent.allowAuctionWithoutConsent !== undefined) {
consent.allowAuctionWithoutConsent = bidderRequest.gdprConsent.allowAuctionWithoutConsent ? 1 : 0;
}
if (bidderRequest.gdprConsent.apiVersion !== undefined) {
consent.apiVersion = bidderRequest.gdprConsent.apiVersion;
}
}
return consent;
}

function _getSchain(bidRequest) {
if (utils.deepAccess(bidRequest, 'schain')) {
return bidRequest.schain;
}
}

export const spec = {
code: BIDDER_CODE,

gvlid: GVLID,
supportedMediaType: SUPPORTED_MEDIA_TYPES,

isBidRequestValid: function (bid) {
Expand Down Expand Up @@ -391,6 +403,7 @@ export const spec = {
const site = _getSite();
const pageviewId = _getPageviewId();
const gdprConsent = _getGdprConsent(bidderRequest);
const schain = _getSchain(validBidRequests[0]);
const adUnits = utils._map(validBidRequests, (bidRequest) => {
bidRequest.features = _getFeatures(bidRequest);
return bidRequest;
Expand Down Expand Up @@ -419,6 +432,7 @@ export const spec = {
pageviewId: pageviewId,
adUnits: groupedAdUnits[organizationId],
gdpr: gdprConsent,
schain: schain,
prebidVersion: '$prebid.version$',
adapterVersion: VERSION,
featuresVersion: FEATURES_VERSION
Expand Down
7 changes: 7 additions & 0 deletions modules/adfinityBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export const spec = {
'placements': placements
};

if (bidderRequest) {
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
Expand Down
86 changes: 45 additions & 41 deletions modules/adgenerationBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,61 @@ AdGeneration bid adapter supports Banner and Native.
# Test Parameters
```
var adUnits = [
// Banner adUnit
{
code: 'banner-div', // banner
sizes: [[300, 250]],
bids: [
{
bidder: 'adg',
params: {
id: '58278', // banner
}
},
]
},
// Native adUnit
{
code: 'native-div',
sizes: [[1,1]],
mediaTypes: {
native: {
image: {
// Banner adUnit
{
code: 'banner-div', // banner
mediaTypes: {
banner: {
sizes: [[300, 250]],
}
},
bids: [
{
bidder: 'adg',
params: {
id: '58278', // banner
}
},
]
},
// Native adUnit
{
code: 'native-div',
sizes: [[1,1]],
mediaTypes: {
native: {
image: {
required: true
},
title: {
},
title: {
required: true,
len: 80
},
sponsoredBy: {
},
sponsoredBy: {
required: true
},
clickUrl: {
},
clickUrl: {
required: true
},
body: {
},
body: {
required: true
},
icon: {
},
icon: {
required: true
},
privacyLink: {
},
privacyLink: {
required: true
},
},
},
bids: [
{
bidder: 'adg',
params: {
},
},
bids: [
{
bidder: 'adg',
params: {
id: '58279', //native
}
},
]
}
},
]
},
];
```
13 changes: 7 additions & 6 deletions modules/adkernelAdnAnalyticsAdapter.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import adapter from '../src/AnalyticsAdapter.js';
import CONSTANTS from '../src/constants.json';
import adapterManager from '../src/adapterManager.js';
import {parse} from '../src/url.js';
import * as utils from '../src/utils.js';
import {ajax} from '../src/ajax.js';
import { getStorageManager } from '../src/storageManager.js';

const ANALYTICS_VERSION = '1.0.1';
const DEFAULT_QUEUE_TIMEOUT = 4000;
const DEFAULT_HOST = 'tag.adkernel.com';
const storageObj = getStorageManager();

const ADK_HB_EVENTS = {
AUCTION_INIT: 'auctionInit',
Expand Down Expand Up @@ -175,10 +176,10 @@ const ORGANIC = '(organic)';

export let storage = {
getItem: (name) => {
return utils.getDataFromLocalStorage(name);
return storageObj.getDataFromLocalStorage(name);
},
setItem: (name, value) => {
utils.setDataInLocalStorage(name, value);
storageObj.setDataInLocalStorage(name, value);
}
};

Expand Down Expand Up @@ -209,7 +210,7 @@ export function getUmtSource(pageUrl, referrer) {
if (se) {
return asUtm(se, ORGANIC, ORGANIC);
}
let parsedUrl = parse(pageUrl);
let parsedUrl = utils.parseUrl(pageUrl);
let [refHost, refPath] = getReferrer(referrer);
if (refHost && refHost !== parsedUrl.hostname) {
return asUtm(refHost, REFERRAL, REFERRAL, '', refPath);
Expand All @@ -236,12 +237,12 @@ export function getUmtSource(pageUrl, referrer) {
}

function getReferrer(referrer) {
let ref = parse(referrer);
let ref = utils.parseUrl(referrer);
return [ref.hostname, ref.pathname];
}

function getUTM(pageUrl) {
let urlParameters = parse(pageUrl).search;
let urlParameters = utils.parseUrl(pageUrl).search;
if (!urlParameters['utm_campaign'] || !urlParameters['utm_source']) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions modules/adkernelAdnBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as utils from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';
import {parse as parseUrl} from '../src/url.js';

const DEFAULT_ADKERNEL_DSP_DOMAIN = 'tag.adkernel.com';
const DEFAULT_MIMES = ['video/mp4', 'video/webm', 'application/x-shockwave-flash', 'application/javascript'];
Expand Down Expand Up @@ -71,7 +70,7 @@ function buildRequestParams(tags, auctionId, transactionId, gdprConsent, uspCons
}

function buildSite(refInfo) {
let loc = parseUrl(refInfo.referer);
let loc = utils.parseUrl(refInfo.referer);
let result = {
page: `${loc.protocol}://${loc.hostname}${loc.pathname}`,
secure: ~~(loc.protocol === 'https')
Expand Down
Loading

0 comments on commit 84df14e

Please sign in to comment.