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.
Files changed (147) hide show
  1. package/.github/workflows/issue_tracker.yml +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/adagioBidAdapter.js +1 -1
  5. package/dist/adbookpspBidAdapter.js +1 -1
  6. package/dist/adgenerationBidAdapter.js +1 -1
  7. package/dist/adhashBidAdapter.js +1 -1
  8. package/dist/adrelevantisBidAdapter.js +1 -1
  9. package/dist/adtrgtmeBidAdapter.js +1 -1
  10. package/dist/adxcgBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/appierAnalyticsAdapter.js +1 -1
  15. package/dist/appnexusBidAdapter.js +1 -1
  16. package/dist/asoBidAdapter.js +1 -1
  17. package/dist/axonixBidAdapter.js +1 -1
  18. package/dist/bidglassBidAdapter.js +1 -1
  19. package/dist/big-richmediaBidAdapter.js +1 -1
  20. package/dist/bridgewellBidAdapter.js +1 -1
  21. package/dist/brightMountainMediaBidAdapter.js +1 -1
  22. package/dist/carodaBidAdapter.js +1 -1
  23. package/dist/chtnwBidAdapter.js +1 -1
  24. package/dist/concertBidAdapter.js +1 -1
  25. package/dist/connectadBidAdapter.js +1 -1
  26. package/dist/consumableBidAdapter.js +1 -1
  27. package/dist/conversantBidAdapter.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/discoveryBidAdapter.js +1 -1
  31. package/dist/dspxBidAdapter.js +1 -1
  32. package/dist/eplanningBidAdapter.js +1 -1
  33. package/dist/finativeBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gridBidAdapter.js +1 -1
  38. package/dist/gridNMBidAdapter.js +1 -1
  39. package/dist/gumgumBidAdapter.js +1 -1
  40. package/dist/h12mediaBidAdapter.js +1 -1
  41. package/dist/id5IdSystem.js +1 -1
  42. package/dist/improvedigitalBidAdapter.js +1 -1
  43. package/dist/inmarBidAdapter.js +1 -1
  44. package/dist/insticatorBidAdapter.js +1 -1
  45. package/dist/ixBidAdapter.js +1 -1
  46. package/dist/justpremiumBidAdapter.js +1 -1
  47. package/dist/kargoBidAdapter.js +1 -1
  48. package/dist/konduitAnalyticsAdapter.js +1 -1
  49. package/dist/kueezBidAdapter.js +1 -1
  50. package/dist/kueezRtbBidAdapter.js +1 -1
  51. package/dist/lassoBidAdapter.js +1 -1
  52. package/dist/lifestreetBidAdapter.js +1 -1
  53. package/dist/liveIntentIdSystem.js +1 -1
  54. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  55. package/dist/logicadBidAdapter.js +1 -1
  56. package/dist/loglyliftBidAdapter.js +1 -1
  57. package/dist/magniteAnalyticsAdapter.js +1 -1
  58. package/dist/malltvAnalyticsAdapter.js +1 -1
  59. package/dist/marsmediaBidAdapter.js +1 -1
  60. package/dist/mediafuseBidAdapter.js +1 -1
  61. package/dist/mediagoBidAdapter.js +1 -1
  62. package/dist/mediasquareBidAdapter.js +1 -1
  63. package/dist/mgidBidAdapter.js +1 -1
  64. package/dist/minutemediaBidAdapter.js +1 -1
  65. package/dist/nexx360BidAdapter.js +1 -1
  66. package/dist/not-for-prod/prebid.js +118 -118
  67. package/dist/oguryBidAdapter.js +1 -1
  68. package/dist/onetagBidAdapter.js +1 -1
  69. package/dist/ooloAnalyticsAdapter.js +1 -1
  70. package/dist/outbrainBidAdapter.js +1 -1
  71. package/dist/parrableIdSystem.js +1 -1
  72. package/dist/pixfutureBidAdapter.js +1 -1
  73. package/dist/prebid-core.js +2 -2
  74. package/dist/publinkIdSystem.js +1 -1
  75. package/dist/pubmaticBidAdapter.js +1 -1
  76. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  77. package/dist/pxyzBidAdapter.js +1 -1
  78. package/dist/quantcastBidAdapter.js +1 -1
  79. package/dist/readpeakBidAdapter.js +1 -1
  80. package/dist/relaidoBidAdapter.js +1 -1
  81. package/dist/rhythmoneBidAdapter.js +1 -1
  82. package/dist/riseBidAdapter.js +1 -1
  83. package/dist/rubiconAnalyticsAdapter.js +1 -1
  84. package/dist/rubiconBidAdapter.js +1 -1
  85. package/dist/seedingAllianceBidAdapter.js +1 -1
  86. package/dist/seedtagBidAdapter.js +1 -1
  87. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  88. package/dist/sharethroughBidAdapter.js +1 -1
  89. package/dist/shinezBidAdapter.js +1 -1
  90. package/dist/smaatoBidAdapter.js +1 -1
  91. package/dist/smartadserverBidAdapter.js +1 -1
  92. package/dist/smartxBidAdapter.js +1 -1
  93. package/dist/smilewantedBidAdapter.js +1 -1
  94. package/dist/sonobiBidAdapter.js +1 -1
  95. package/dist/sovrnAnalyticsAdapter.js +1 -1
  96. package/dist/sovrnBidAdapter.js +1 -1
  97. package/dist/sspBCBidAdapter.js +1 -1
  98. package/dist/sublimeBidAdapter.js +1 -1
  99. package/dist/synacormediaBidAdapter.js +1 -1
  100. package/dist/taboolaBidAdapter.js +1 -1
  101. package/dist/targetVideoBidAdapter.js +1 -1
  102. package/dist/teadsBidAdapter.js +1 -1
  103. package/dist/trionBidAdapter.js +1 -1
  104. package/dist/tripleliftBidAdapter.js +1 -1
  105. package/dist/ttdBidAdapter.js +1 -1
  106. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  107. package/dist/underdogmediaBidAdapter.js +1 -1
  108. package/dist/undertoneBidAdapter.js +1 -1
  109. package/dist/vidazooBidAdapter.js +1 -1
  110. package/dist/videobyteBidAdapter.js +1 -1
  111. package/dist/visxBidAdapter.js +1 -1
  112. package/dist/vuukleBidAdapter.js +1 -1
  113. package/dist/widespaceBidAdapter.js +1 -1
  114. package/dist/winrBidAdapter.js +1 -1
  115. package/dist/yahoosspBidAdapter.js +1 -1
  116. package/dist/yieldmoBidAdapter.js +1 -1
  117. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  118. package/libraries/ortb2.5StrictTranslator/dsl.js +54 -0
  119. package/libraries/ortb2.5StrictTranslator/spec.js +81 -0
  120. package/libraries/ortb2.5StrictTranslator/translator.js +37 -0
  121. package/libraries/ortb2.5Translator/translator.js +82 -0
  122. package/modules/33acrossIdSystem.js +3 -0
  123. package/modules/adhashBidAdapter.js +115 -30
  124. package/modules/adhashBidAdapter.md +1 -3
  125. package/modules/discoveryBidAdapter.js +3 -0
  126. package/modules/kargoBidAdapter.js +1 -1
  127. package/modules/lassoBidAdapter.js +8 -4
  128. package/modules/liveIntentIdSystem.js +1 -2
  129. package/modules/mediagoBidAdapter.js +2 -1
  130. package/modules/openxBidAdapter.md +15 -14
  131. package/modules/taboolaBidAdapter.js +20 -7
  132. package/modules/vidazooBidAdapter.js +20 -7
  133. package/package.json +2 -2
  134. package/src/auction.js +11 -1
  135. package/src/constants.json +2 -1
  136. package/test/helpers/refererDetectionHelper.js +88 -0
  137. package/test/spec/auctionmanager_spec.js +33 -1
  138. package/test/spec/modules/33acrossIdSystem_spec.js +4 -1
  139. package/test/spec/modules/adhashBidAdapter_spec.js +65 -11
  140. package/test/spec/modules/taboolaBidAdapter_spec.js +39 -0
  141. package/test/spec/modules/ttdBidAdapter_spec.js +36 -9
  142. package/test/spec/modules/vidazooBidAdapter_spec.js +134 -3
  143. package/test/spec/ortb2.5StrictTranslator/dsl_spec.js +137 -0
  144. package/test/spec/ortb2.5StrictTranslator/spec_spec.js +358 -0
  145. package/test/spec/ortb2.5StrictTranslator/translator_spec.js +16 -0
  146. package/test/spec/ortb2.5Translator/translator_spec.js +64 -0
  147. 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 () {