prebid.js 6.24.0 → 6.26.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 (178) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adgenerationBidAdapter.js +1 -1
  5. package/dist/adrelevantisBidAdapter.js +1 -1
  6. package/dist/adtelligentBidAdapter.js +1 -1
  7. package/dist/adxcgBidAdapter.js +1 -1
  8. package/dist/adyoulikeBidAdapter.js +1 -1
  9. package/dist/ajaBidAdapter.js +1 -1
  10. package/dist/amxBidAdapter.js +1 -1
  11. package/dist/amxIdSystem.js +1 -1
  12. package/dist/appierAnalyticsAdapter.js +1 -1
  13. package/dist/appnexusBidAdapter.js +1 -1
  14. package/dist/asoBidAdapter.js +1 -1
  15. package/dist/audiencerunBidAdapter.js +1 -1
  16. package/dist/axonixBidAdapter.js +1 -1
  17. package/dist/beopBidAdapter.js +1 -1
  18. package/dist/bidglassBidAdapter.js +1 -1
  19. package/dist/big-richmediaBidAdapter.js +1 -1
  20. package/dist/bluebillywigBidAdapter.js +1 -1
  21. package/dist/bridgewellBidAdapter.js +1 -1
  22. package/dist/brightMountainMediaBidAdapter.js +1 -1
  23. package/dist/concertBidAdapter.js +1 -1
  24. package/dist/connectadBidAdapter.js +1 -1
  25. package/dist/consumableBidAdapter.js +1 -1
  26. package/dist/conversantBidAdapter.js +1 -1
  27. package/dist/cpexIdSystem.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/currency.js +1 -1
  31. package/dist/dfpAdServerVideo.js +1 -1
  32. package/dist/dspxBidAdapter.js +1 -1
  33. package/dist/eplanningBidAdapter.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/gravitoIdSystem.js +1 -0
  38. package/dist/gridBidAdapter.js +1 -1
  39. package/dist/gridNMBidAdapter.js +1 -1
  40. package/dist/gumgumBidAdapter.js +1 -1
  41. package/dist/h12mediaBidAdapter.js +1 -1
  42. package/dist/id5IdSystem.js +1 -1
  43. package/dist/impactifyBidAdapter.js +1 -1
  44. package/dist/improvedigitalBidAdapter.js +1 -1
  45. package/dist/inmarBidAdapter.js +1 -1
  46. package/dist/insticatorBidAdapter.js +1 -1
  47. package/dist/invibesBidAdapter.js +1 -1
  48. package/dist/ixBidAdapter.js +1 -1
  49. package/dist/jixieBidAdapter.js +1 -1
  50. package/dist/justpremiumBidAdapter.js +1 -1
  51. package/dist/kargoBidAdapter.js +1 -1
  52. package/dist/konduitAnalyticsAdapter.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/malltvAnalyticsAdapter.js +1 -1
  58. package/dist/marsmediaBidAdapter.js +1 -1
  59. package/dist/mediafuseBidAdapter.js +1 -1
  60. package/dist/mediakeysBidAdapter.js +1 -1
  61. package/dist/mediasquareBidAdapter.js +1 -1
  62. package/dist/mgidBidAdapter.js +1 -1
  63. package/dist/minutemediaBidAdapter.js +1 -1
  64. package/dist/not-for-prod/prebid.js +123 -121
  65. package/dist/oguryBidAdapter.js +1 -1
  66. package/dist/oneVideoBidAdapter.js +1 -1
  67. package/dist/onetagBidAdapter.js +1 -1
  68. package/dist/ooloAnalyticsAdapter.js +1 -1
  69. package/dist/outbrainBidAdapter.js +1 -1
  70. package/dist/parrableIdSystem.js +1 -1
  71. package/dist/pixfutureBidAdapter.js +1 -1
  72. package/dist/prebid-core.js +3 -3
  73. package/dist/publinkIdSystem.js +1 -1
  74. package/dist/pubmaticBidAdapter.js +1 -1
  75. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  76. package/dist/pxyzBidAdapter.js +1 -1
  77. package/dist/quantcastBidAdapter.js +1 -1
  78. package/dist/readpeakBidAdapter.js +1 -1
  79. package/dist/relaidoBidAdapter.js +1 -1
  80. package/dist/rhythmoneBidAdapter.js +1 -1
  81. package/dist/riseBidAdapter.js +1 -1
  82. package/dist/rubiconAnalyticsAdapter.js +1 -1
  83. package/dist/rubiconBidAdapter.js +1 -1
  84. package/dist/seedingAllianceBidAdapter.js +1 -1
  85. package/dist/seedtagBidAdapter.js +1 -1
  86. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  87. package/dist/sharethroughBidAdapter.js +1 -1
  88. package/dist/smaatoBidAdapter.js +1 -1
  89. package/dist/smartadserverBidAdapter.js +1 -1
  90. package/dist/smartxBidAdapter.js +1 -1
  91. package/dist/smilewantedBidAdapter.js +1 -1
  92. package/dist/sonobiBidAdapter.js +1 -1
  93. package/dist/sortableBidAdapter.js +1 -1
  94. package/dist/sovrnAnalyticsAdapter.js +1 -1
  95. package/dist/sovrnBidAdapter.js +1 -1
  96. package/dist/sspBCBidAdapter.js +1 -1
  97. package/dist/sublimeBidAdapter.js +1 -1
  98. package/dist/synacormediaBidAdapter.js +1 -1
  99. package/dist/targetVideoBidAdapter.js +1 -1
  100. package/dist/teadsBidAdapter.js +1 -1
  101. package/dist/trionBidAdapter.js +1 -1
  102. package/dist/tripleliftBidAdapter.js +1 -1
  103. package/dist/trustpidSystem.js +1 -1
  104. package/dist/trustxBidAdapter.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/userId.js +1 -1
  110. package/dist/vidazooBidAdapter.js +1 -1
  111. package/dist/videobyteBidAdapter.js +1 -1
  112. package/dist/videoheroesBidAdapter.js +1 -0
  113. package/dist/vidoomyBidAdapter.js +1 -1
  114. package/dist/visxBidAdapter.js +1 -1
  115. package/dist/vuukleBidAdapter.js +1 -1
  116. package/dist/weboramaRtdProvider.js +1 -1
  117. package/dist/widespaceBidAdapter.js +1 -1
  118. package/dist/winrBidAdapter.js +1 -1
  119. package/dist/yahoosspBidAdapter.js +1 -1
  120. package/dist/yieldmoBidAdapter.js +1 -1
  121. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  122. package/dist/zeta_global_sspBidAdapter.js +1 -1
  123. package/integrationExamples/gpt/userId_example.html +3 -0
  124. package/integrationExamples/gpt/weboramaRtdProvider_example.html +65 -11
  125. package/modules/.submodules.json +2 -1
  126. package/modules/adagioBidAdapter.js +2 -0
  127. package/modules/adtelligentBidAdapter.js +3 -1
  128. package/modules/alkimiBidAdapter.md +10 -4
  129. package/modules/appnexusBidAdapter.js +13 -2
  130. package/modules/beopBidAdapter.js +51 -6
  131. package/modules/cpexIdSystem.js +1 -2
  132. package/modules/currency.js +4 -13
  133. package/modules/dacIdSystem.md +4 -4
  134. package/modules/dfpAdServerVideo.js +8 -0
  135. package/modules/gravitoIdSystem.js +57 -0
  136. package/modules/gravitoIdSystem.md +28 -0
  137. package/modules/improvedigitalBidAdapter.js +100 -43
  138. package/modules/invibesBidAdapter.js +55 -34
  139. package/modules/ixBidAdapter.js +62 -26
  140. package/modules/ixBidAdapter.md +42 -42
  141. package/modules/jixieBidAdapter.js +2 -0
  142. package/modules/kargoBidAdapter.js +23 -8
  143. package/modules/oguryBidAdapter.js +27 -1
  144. package/modules/trustpidSystem.js +9 -28
  145. package/modules/trustpidSystem.md +11 -34
  146. package/modules/userId/eids.js +6 -0
  147. package/modules/userId/index.js +30 -55
  148. package/modules/userId/userId.md +3 -11
  149. package/modules/videoheroesBidAdapter.js +267 -0
  150. package/modules/videoheroesBidAdapter.md +134 -0
  151. package/modules/vidoomyBidAdapter.js +2 -6
  152. package/modules/weboramaRtdProvider.js +515 -241
  153. package/modules/weboramaRtdProvider.md +488 -51
  154. package/modules/zeta_global_sspBidAdapter.js +1 -1
  155. package/package.json +4 -4
  156. package/src/adserver.js +7 -0
  157. package/src/hook.js +19 -1
  158. package/src/utils/promise.js +36 -0
  159. package/test/spec/modules/adtelligentBidAdapter_spec.js +1 -0
  160. package/test/spec/modules/appnexusBidAdapter_spec.js +37 -10
  161. package/test/spec/modules/beopBidAdapter_spec.js +15 -2
  162. package/test/spec/modules/dfpAdServerVideo_spec.js +45 -0
  163. package/test/spec/modules/gravitoIdSystem_spec.js +51 -0
  164. package/test/spec/modules/improvedigitalBidAdapter_spec.js +289 -72
  165. package/test/spec/modules/invibesBidAdapter_spec.js +98 -7
  166. package/test/spec/modules/ixBidAdapter_spec.js +132 -26
  167. package/test/spec/modules/jixieBidAdapter_spec.js +17 -0
  168. package/test/spec/modules/kargoBidAdapter_spec.js +45 -3
  169. package/test/spec/modules/liveIntentIdSystem_spec.js +2 -2
  170. package/test/spec/modules/loglyliftBidAdapter_spec.js +8 -0
  171. package/test/spec/modules/oguryBidAdapter_spec.js +181 -3
  172. package/test/spec/modules/trustpidSystem_spec.js +42 -19
  173. package/test/spec/modules/userId_spec.js +18 -0
  174. package/test/spec/modules/videoheroesBidAdapter_spec.js +363 -0
  175. package/test/spec/modules/weboramaRtdProvider_spec.js +2333 -266
  176. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +37 -24
  177. package/test/spec/unit/utils/promise_spec.js +49 -0
  178. package/test/spec/modules/medianetRtdProvider_spec.js +0 -146
package/src/hook.js CHANGED
@@ -1,10 +1,28 @@
1
-
2
1
  import funHooks from 'fun-hooks/no-eval/index.js';
2
+ import {promiseControls} from './utils/promise.js';
3
3
 
4
4
  export let hook = funHooks({
5
5
  ready: funHooks.SYNC | funHooks.ASYNC | funHooks.QUEUE
6
6
  });
7
7
 
8
+ const readyCtl = promiseControls();
9
+ hook.ready = (() => {
10
+ const ready = hook.ready;
11
+ return function () {
12
+ try {
13
+ return ready.apply(hook, arguments);
14
+ } finally {
15
+ readyCtl.resolve();
16
+ }
17
+ }
18
+ })();
19
+
20
+ /**
21
+ * A promise that resolves when hooks are ready.
22
+ * @type {Promise}
23
+ */
24
+ export const ready = readyCtl.promise;
25
+
8
26
  export const getHook = hook.get;
9
27
 
10
28
  export function setupBeforeHookFnOnce(baseFn, hookFn, priority = 15) {
@@ -0,0 +1,36 @@
1
+ const SUCCESS = 0;
2
+ const FAIL = 1;
3
+ const RESULT = 2;
4
+
5
+ /**
6
+ * @returns a {promise, resolve, reject} trio where `promise` is resolved by calling `resolve` or `reject`.
7
+ */
8
+ export function promiseControls({promiseFactory = (resolver) => new Promise(resolver)} = {}) {
9
+ const status = {};
10
+
11
+ function finisher(slot) {
12
+ return function (val) {
13
+ if (typeof status[slot] === 'function') {
14
+ status[slot](val);
15
+ } else if (!status[slot]) {
16
+ status[slot] = true;
17
+ status[RESULT] = val;
18
+ }
19
+ }
20
+ }
21
+
22
+ return {
23
+ promise: promiseFactory((resolve, reject) => {
24
+ if (status[SUCCESS] != null) {
25
+ resolve(status[RESULT]);
26
+ } else if (status[FAIL] != null) {
27
+ reject(status[RESULT]);
28
+ } else {
29
+ status[SUCCESS] = resolve;
30
+ status[FAIL] = reject;
31
+ }
32
+ }),
33
+ resolve: finisher(SUCCESS),
34
+ reject: finisher(FAIL)
35
+ }
36
+ }
@@ -18,6 +18,7 @@ const aliasEP = {
18
18
  bidsxchange: 'https://ghb.hbd.bidsxchange.com/v2/auction/',
19
19
  streamkey: 'https://ghb.hb.streamkey.net/v2/auction/',
20
20
  janet: 'https://ghb.bidder.jmgads.com/v2/auction/',
21
+ pgam: 'https://ghb.pgamssp.com/v2/auction/',
21
22
  };
22
23
 
23
24
  const DEFAULT_ADATPER_REQ = { bidderCode: 'adtelligent' };
@@ -1549,14 +1549,24 @@ describe('AppNexusAdapter', function () {
1549
1549
  });
1550
1550
 
1551
1551
  describe('transformBidParams', function () {
1552
- it('convert keywords param differently for psp endpoint', function () {
1553
- sinon.stub(config, 'getConfig')
1554
- .withArgs('s2sConfig')
1555
- .returns({
1556
- endpoint: {
1557
- p1Consent: 'https://ib.adnxs.com/openrtb2/prebid'
1558
- }
1559
- });
1552
+ let gcStub;
1553
+ let adUnit = { bids: [{ bidder: 'appnexus' }] }; ;
1554
+
1555
+ before(function() {
1556
+ gcStub = sinon.stub(config, 'getConfig');
1557
+ });
1558
+
1559
+ after(function() {
1560
+ gcStub.restore();
1561
+ });
1562
+
1563
+ it('convert keywords param differently for psp endpoint with single s2sConfig', function () {
1564
+ gcStub.withArgs('s2sConfig').returns({
1565
+ bidders: ['appnexus'],
1566
+ endpoint: {
1567
+ p1Consent: 'https://ib.adnxs.com/openrtb2/prebid'
1568
+ }
1569
+ });
1560
1570
 
1561
1571
  const oldParams = {
1562
1572
  keywords: {
@@ -1565,10 +1575,27 @@ describe('AppNexusAdapter', function () {
1565
1575
  }
1566
1576
  };
1567
1577
 
1568
- const newParams = spec.transformBidParams(oldParams, true);
1578
+ const newParams = spec.transformBidParams(oldParams, true, adUnit);
1569
1579
  expect(newParams.keywords).to.equal('genre=rock,genre=pop,pets=dog');
1580
+ });
1570
1581
 
1571
- config.getConfig.restore();
1582
+ it('convert keywords param differently for psp endpoint with array s2sConfig', function () {
1583
+ gcStub.withArgs('s2sConfig').returns([{
1584
+ bidders: ['appnexus'],
1585
+ endpoint: {
1586
+ p1Consent: 'https://ib.adnxs.com/openrtb2/prebid'
1587
+ }
1588
+ }]);
1589
+
1590
+ const oldParams = {
1591
+ keywords: {
1592
+ genre: ['rock', 'pop'],
1593
+ pets: 'dog'
1594
+ }
1595
+ };
1596
+
1597
+ const newParams = spec.transformBidParams(oldParams, true, adUnit);
1598
+ expect(newParams.keywords).to.equal('genre=rock,genre=pop,pets=dog');
1572
1599
  });
1573
1600
  });
1574
1601
  });
@@ -115,7 +115,7 @@ describe('BeOp Bid Adapter tests', () => {
115
115
  },
116
116
  'refererInfo':
117
117
  {
118
- 'canonicalUrl': 'http://test.te'
118
+ 'canonicalUrl': 'test.te'
119
119
  }
120
120
  };
121
121
 
@@ -124,7 +124,20 @@ describe('BeOp Bid Adapter tests', () => {
124
124
  expect(payload.tc_string).to.exist;
125
125
  expect(payload.tc_string).to.equal('BOJ8RZsOJ8RZsABAB8AAAAAZ+A==');
126
126
  expect(payload.url).to.exist;
127
- expect(payload.url).to.equal('http://localhost:9876/context.html');
127
+ // check that the protocol is added correctly
128
+ expect(payload.url).to.equal('http://test.te');
129
+ });
130
+
131
+ it('should not prepend the protocol in page url if already present', function () {
132
+ const bidderRequest = {
133
+ 'refererInfo': {
134
+ 'canonicalUrl': 'https://test.te'
135
+ }
136
+ };
137
+ const request = spec.buildRequests(bidRequests, bidderRequest);
138
+ const payload = JSON.parse(request.data);
139
+ expect(payload.url).to.exist;
140
+ expect(payload.url).to.equal('https://test.te');
128
141
  });
129
142
  });
130
143
 
@@ -10,6 +10,9 @@ import { auctionManager } from 'src/auctionManager.js';
10
10
  import { gdprDataHandler, uspDataHandler } from 'src/adapterManager.js';
11
11
  import * as adpod from 'modules/adpod.js';
12
12
  import { server } from 'test/mocks/xhr.js';
13
+ import * as adServer from 'src/adserver.js';
14
+ import {deepClone} from 'src/utils.js';
15
+ import {hook} from '../../../src/hook.js';
13
16
 
14
17
  const bid = {
15
18
  videoCacheKey: 'abc',
@@ -20,6 +23,10 @@ const bid = {
20
23
  };
21
24
 
22
25
  describe('The DFP video support module', function () {
26
+ before(() => {
27
+ hook.ready();
28
+ });
29
+
23
30
  it('should make a legal request URL when given the required params', function () {
24
31
  const url = parse(buildDfpVideoUrl({
25
32
  adUnit: adUnit,
@@ -226,6 +233,44 @@ describe('The DFP video support module', function () {
226
233
  gdprDataHandlerStub.restore();
227
234
  });
228
235
 
236
+ describe('GAM PPID', () => {
237
+ let ppid;
238
+ let getPPIDStub;
239
+ beforeEach(() => {
240
+ getPPIDStub = sinon.stub(adServer, 'getPPID').callsFake(() => ppid);
241
+ });
242
+ afterEach(() => {
243
+ getPPIDStub.restore();
244
+ });
245
+
246
+ Object.entries({
247
+ 'params': {params: {'iu': 'mock/unit'}},
248
+ 'url': {url: 'https://video.adserver.mock/', params: {'iu': 'mock/unit'}}
249
+ }).forEach(([t, opts]) => {
250
+ describe(`when using ${t}`, () => {
251
+ function buildUrlAndGetParams() {
252
+ const url = parse(buildDfpVideoUrl(Object.assign({
253
+ adUnit: adUnit,
254
+ bid: deepClone(bid),
255
+ }, opts)));
256
+ return utils.parseQS(url.query);
257
+ }
258
+
259
+ it('should be included if available', () => {
260
+ ppid = 'mockPPID';
261
+ const q = buildUrlAndGetParams();
262
+ expect(q.ppid).to.equal('mockPPID');
263
+ });
264
+
265
+ it('should not be included if not available', () => {
266
+ ppid = undefined;
267
+ const q = buildUrlAndGetParams();
268
+ expect(q.hasOwnProperty('ppid')).to.be.false;
269
+ })
270
+ })
271
+ })
272
+ })
273
+
229
274
  describe('special targeting unit test', function () {
230
275
  const allTargetingData = {
231
276
  'hb_format': 'video',
@@ -0,0 +1,51 @@
1
+ import { gravitoIdSystemSubmodule, storage, cookieKey } from 'modules/gravitoIdSystem.js';
2
+
3
+ const GRAVITOID_TEST_VALUE = 'gravitompIdTest';
4
+ const GRAVITOID_TEST_OBJ = {
5
+ gravitompId: GRAVITOID_TEST_VALUE
6
+ };
7
+
8
+ describe('gravitompId module', function () {
9
+ let getCookieStub;
10
+
11
+ beforeEach(function (done) {
12
+ getCookieStub = sinon.stub(storage, 'getCookie');
13
+ done();
14
+ });
15
+
16
+ afterEach(function () {
17
+ getCookieStub.restore();
18
+ });
19
+
20
+ const cookieTestCasesForEmpty = [
21
+ undefined,
22
+ null,
23
+ ''
24
+ ]
25
+
26
+ describe('getId()', function () {
27
+ it('should return the gravitompId when it exists in cookie', function () {
28
+ getCookieStub.withArgs(cookieKey).returns(GRAVITOID_TEST_VALUE);
29
+ const id = gravitoIdSystemSubmodule.getId();
30
+ expect(id).to.be.deep.equal({id: {gravitompId: GRAVITOID_TEST_VALUE}});
31
+ });
32
+
33
+ cookieTestCasesForEmpty.forEach(testCase => it('should return the gravitompId when it not exists in cookie', function () {
34
+ getCookieStub.withArgs(cookieKey).returns(testCase);
35
+ const id = gravitoIdSystemSubmodule.getId();
36
+ expect(id).to.be.deep.equal(undefined);
37
+ }));
38
+ });
39
+
40
+ describe('decode()', function () {
41
+ it('should return the gravitompId when it exists in cookie', function () {
42
+ const decoded = gravitoIdSystemSubmodule.decode(GRAVITOID_TEST_OBJ);
43
+ expect(decoded).to.be.deep.equal({gravitompId: {id: GRAVITOID_TEST_VALUE}});
44
+ });
45
+
46
+ it('should return the undefined when decode id is not "string"', function () {
47
+ const decoded = gravitoIdSystemSubmodule.decode(1);
48
+ expect(decoded).to.equal(undefined);
49
+ });
50
+ });
51
+ });