prebid.js 7.27.0 → 7.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/issue_tracker.yml +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adhashBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/discoveryBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/liveIntentIdSystem.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediagoBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +118 -118
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/libraries/ortb2.5StrictTranslator/dsl.js +54 -0
- package/libraries/ortb2.5StrictTranslator/spec.js +81 -0
- package/libraries/ortb2.5StrictTranslator/translator.js +37 -0
- package/libraries/ortb2.5Translator/translator.js +82 -0
- package/modules/33acrossIdSystem.js +3 -0
- package/modules/adhashBidAdapter.js +115 -30
- package/modules/adhashBidAdapter.md +1 -3
- package/modules/discoveryBidAdapter.js +3 -0
- package/modules/kargoBidAdapter.js +1 -1
- package/modules/lassoBidAdapter.js +8 -4
- package/modules/liveIntentIdSystem.js +1 -2
- package/modules/mediagoBidAdapter.js +2 -1
- package/modules/openxBidAdapter.md +15 -14
- package/modules/taboolaBidAdapter.js +20 -7
- package/modules/vidazooBidAdapter.js +20 -7
- package/package.json +2 -2
- package/src/auction.js +11 -1
- package/src/constants.json +2 -1
- package/test/helpers/refererDetectionHelper.js +88 -0
- package/test/spec/auctionmanager_spec.js +33 -1
- package/test/spec/modules/33acrossIdSystem_spec.js +4 -1
- package/test/spec/modules/adhashBidAdapter_spec.js +65 -11
- package/test/spec/modules/taboolaBidAdapter_spec.js +39 -0
- package/test/spec/modules/ttdBidAdapter_spec.js +36 -9
- package/test/spec/modules/vidazooBidAdapter_spec.js +134 -3
- package/test/spec/ortb2.5StrictTranslator/dsl_spec.js +137 -0
- package/test/spec/ortb2.5StrictTranslator/spec_spec.js +358 -0
- package/test/spec/ortb2.5StrictTranslator/translator_spec.js +16 -0
- package/test/spec/ortb2.5Translator/translator_spec.js +64 -0
- package/test/spec/refererDetection_spec.js +1 -88
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {toOrtb25Strict} from '../../../libraries/ortb2.5StrictTranslator/translator.js';
|
|
2
|
+
|
|
3
|
+
describe('toOrtb25Strict', () => {
|
|
4
|
+
let translator;
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
translator = sinon.stub().callsFake((o) => o);
|
|
7
|
+
})
|
|
8
|
+
it('uses provided translator', () => {
|
|
9
|
+
translator.reset();
|
|
10
|
+
translator.callsFake(() => ({id: 'test'}));
|
|
11
|
+
expect(toOrtb25Strict(null, translator)).to.eql({id: 'test'});
|
|
12
|
+
});
|
|
13
|
+
it('removes fields out of spec', () => {
|
|
14
|
+
expect(toOrtb25Strict({unk: 'field', imp: ['err', {}]}, translator)).to.eql({imp: [{}]});
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {EXT_PROMOTIONS, moveRule, splitPath, toOrtb25} from '../../../libraries/ortb2.5Translator/translator.js';
|
|
2
|
+
import {deepAccess, deepClone, deepSetValue} from '../../../src/utils.js';
|
|
3
|
+
|
|
4
|
+
describe('ORTB 2.5 translation', () => {
|
|
5
|
+
describe('moveRule', () => {
|
|
6
|
+
const rule = moveRule('f1.f2.f3', (prefix, field) => `${prefix}.m1.m2.${field}`);
|
|
7
|
+
|
|
8
|
+
function applyRule(rule, obj, del = true) {
|
|
9
|
+
obj = deepClone(obj);
|
|
10
|
+
const deleter = rule(obj);
|
|
11
|
+
if (typeof deleter === 'function' && del) {
|
|
12
|
+
deleter();
|
|
13
|
+
}
|
|
14
|
+
return obj;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
it('returns undef when field is not present', () => {
|
|
18
|
+
expect(rule({})).to.eql(undefined);
|
|
19
|
+
});
|
|
20
|
+
it('can copy field', () => {
|
|
21
|
+
expect(applyRule(rule, {f1: {f2: {f3: 'value'}}}, false)).to.eql({
|
|
22
|
+
f1: {
|
|
23
|
+
f2: {
|
|
24
|
+
f3: 'value',
|
|
25
|
+
m1: {m2: {f3: 'value'}}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
it('can move field', () => {
|
|
31
|
+
expect(applyRule(rule, {f1: {f2: {f3: 'value'}}}, true)).to.eql({f1: {f2: {m1: {m2: {f3: 'value'}}}}});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe('toOrtb25', () => {
|
|
35
|
+
EXT_PROMOTIONS.forEach(path => {
|
|
36
|
+
const newPath = (() => {
|
|
37
|
+
const [prefix, field] = splitPath(path);
|
|
38
|
+
return `${prefix}.ext.${field}`;
|
|
39
|
+
})();
|
|
40
|
+
|
|
41
|
+
it(`moves ${path} to ${newPath}`, () => {
|
|
42
|
+
const obj = {};
|
|
43
|
+
deepSetValue(obj, path, 'val');
|
|
44
|
+
toOrtb25(obj);
|
|
45
|
+
expect(deepAccess(obj, path)).to.eql(undefined);
|
|
46
|
+
expect(deepAccess(obj, newPath)).to.eql('val');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it('moves kwarray into keywords', () => {
|
|
50
|
+
expect(toOrtb25({app: {keywords: 'k1,k2', kwarray: ['ka1', 'ka2']}})).to.eql({app: {keywords: 'k1,k2,ka1,ka2'}});
|
|
51
|
+
});
|
|
52
|
+
it('does not choke if kwarray is not an array', () => {
|
|
53
|
+
expect(toOrtb25({site: {keywords: 'k1,k2', kwarray: 'err'}})).to.eql({site: {keywords: 'k1,k2'}});
|
|
54
|
+
});
|
|
55
|
+
it('does not choke if keywords is not a string', () => {
|
|
56
|
+
expect(toOrtb25({user: {keywords: {}, kwarray: ['ka1', 'ka2']}})).to.eql({
|
|
57
|
+
user: {
|
|
58
|
+
keywords: {},
|
|
59
|
+
kwarray: ['ka1', 'ka2']
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
@@ -2,94 +2,7 @@ import {detectReferer, ensureProtocol, parseDomain} from 'src/refererDetection.j
|
|
|
2
2
|
import {config} from 'src/config.js';
|
|
3
3
|
import {expect} from 'chai';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
* Build a walkable linked list of window-like objects for testing.
|
|
7
|
-
*
|
|
8
|
-
* @param {Array} urls Array of URL strings starting from the top window.
|
|
9
|
-
* @param {string} [topReferrer]
|
|
10
|
-
* @param {string} [canonicalUrl]
|
|
11
|
-
* @param {boolean} [ancestorOrigins]
|
|
12
|
-
* @returns {Object}
|
|
13
|
-
*/
|
|
14
|
-
function buildWindowTree(urls, topReferrer = null, canonicalUrl = null, ancestorOrigins = false) {
|
|
15
|
-
/**
|
|
16
|
-
* Find the origin from a given fully-qualified URL.
|
|
17
|
-
*
|
|
18
|
-
* @param {string} url The fully qualified URL
|
|
19
|
-
* @returns {string|null}
|
|
20
|
-
*/
|
|
21
|
-
function getOrigin(url) {
|
|
22
|
-
const originRegex = new RegExp('^(https?://[^/]+/?)');
|
|
23
|
-
|
|
24
|
-
const result = originRegex.exec(url);
|
|
25
|
-
|
|
26
|
-
if (result && result[0]) {
|
|
27
|
-
return result[0];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const inaccessibles = [];
|
|
34
|
-
|
|
35
|
-
let previousWindow, topWindow;
|
|
36
|
-
const topOrigin = getOrigin(urls[0]);
|
|
37
|
-
|
|
38
|
-
const windowList = urls.map((url, index) => {
|
|
39
|
-
const thisOrigin = getOrigin(url),
|
|
40
|
-
sameOriginAsPrevious = index === 0 ? true : (getOrigin(urls[index - 1]) === thisOrigin),
|
|
41
|
-
sameOriginAsTop = thisOrigin === topOrigin;
|
|
42
|
-
|
|
43
|
-
const win = {
|
|
44
|
-
location: {
|
|
45
|
-
href: url,
|
|
46
|
-
},
|
|
47
|
-
document: {
|
|
48
|
-
referrer: index === 0 ? topReferrer : urls[index - 1]
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
if (topWindow == null) {
|
|
53
|
-
topWindow = win;
|
|
54
|
-
win.document.querySelector = function (selector) {
|
|
55
|
-
if (selector === 'link[rel=\'canonical\']') {
|
|
56
|
-
return {
|
|
57
|
-
href: canonicalUrl
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (sameOriginAsPrevious) {
|
|
65
|
-
win.parent = previousWindow;
|
|
66
|
-
} else {
|
|
67
|
-
win.parent = inaccessibles[inaccessibles.length - 1];
|
|
68
|
-
}
|
|
69
|
-
if (ancestorOrigins) {
|
|
70
|
-
win.location.ancestorOrigins = urls.slice(0, index).reverse().map(getOrigin);
|
|
71
|
-
}
|
|
72
|
-
win.top = sameOriginAsTop ? topWindow : inaccessibles[0];
|
|
73
|
-
|
|
74
|
-
const inWin = {parent: inaccessibles[inaccessibles.length - 1], top: inaccessibles[0]};
|
|
75
|
-
if (index === 0) {
|
|
76
|
-
inWin.top = inWin;
|
|
77
|
-
}
|
|
78
|
-
['document', 'location'].forEach((prop) => {
|
|
79
|
-
Object.defineProperty(inWin, prop, {
|
|
80
|
-
get: function () {
|
|
81
|
-
throw new Error('cross-origin access');
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
inaccessibles.push(inWin);
|
|
86
|
-
previousWindow = win;
|
|
87
|
-
|
|
88
|
-
return win;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
return windowList[windowList.length - 1];
|
|
92
|
-
}
|
|
5
|
+
import { buildWindowTree } from '../helpers/refererDetectionHelper';
|
|
93
6
|
|
|
94
7
|
describe('Referer detection', () => {
|
|
95
8
|
afterEach(function () {
|