prebid.js 8.6.0 → 8.8.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 (222) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.js +1 -1
  3. package/dist/a1MediaRtdProvider.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/admaticBidAdapter.js +1 -1
  8. package/dist/adqueryBidAdapter.js +1 -1
  9. package/dist/adqueryIdSystem.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adsinteractiveBidAdapter.js +1 -1
  12. package/dist/adtrgtmeBidAdapter.js +1 -1
  13. package/dist/adxcgBidAdapter.js +1 -1
  14. package/dist/adyoulikeBidAdapter.js +1 -1
  15. package/dist/ajaBidAdapter.js +1 -1
  16. package/dist/alkimiBidAdapter.js +1 -1
  17. package/dist/amxBidAdapter.js +1 -1
  18. package/dist/amxIdSystem.js +1 -1
  19. package/dist/appierAnalyticsAdapter.js +1 -1
  20. package/dist/appnexusBidAdapter.js +1 -1
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/automatadAnalyticsAdapter.js +1 -0
  23. package/dist/axonixBidAdapter.js +1 -1
  24. package/dist/bidViewability.js +1 -1
  25. package/dist/bidglassBidAdapter.js +1 -1
  26. package/dist/big-richmediaBidAdapter.js +1 -1
  27. package/dist/brandmetricsRtdProvider.js +1 -1
  28. package/dist/bridBidAdapter.js +1 -1
  29. package/dist/bridgewellBidAdapter.js +1 -1
  30. package/dist/brightMountainMediaBidAdapter.js +1 -1
  31. package/dist/carodaBidAdapter.js +1 -1
  32. package/dist/chtnwBidAdapter.js +1 -1
  33. package/dist/concertBidAdapter.js +1 -1
  34. package/dist/connatixBidAdapter.js +1 -0
  35. package/dist/connectadBidAdapter.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantAnalyticsAdapter.js +1 -1
  38. package/dist/conversantBidAdapter.js +1 -1
  39. package/dist/craftBidAdapter.js +1 -1
  40. package/dist/criteoBidAdapter.js +1 -1
  41. package/dist/cwireBidAdapter.js +1 -1
  42. package/dist/dependencies.json +7 -1
  43. package/dist/dspxBidAdapter.js +1 -1
  44. package/dist/eplanningBidAdapter.js +1 -1
  45. package/dist/euidIdSystem.js +1 -1
  46. package/dist/feedadBidAdapter.js +1 -1
  47. package/dist/finativeBidAdapter.js +1 -1
  48. package/dist/freepassBidAdapter.js +1 -1
  49. package/dist/freewheel-sspBidAdapter.js +1 -1
  50. package/dist/geoedgeRtdProvider.js +1 -1
  51. package/dist/gmosspBidAdapter.js +1 -1
  52. package/dist/goldbachBidAdapter.js +1 -1
  53. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  54. package/dist/greenbidsRtdProvider.js +1 -1
  55. package/dist/gridBidAdapter.js +1 -1
  56. package/dist/gumgumBidAdapter.js +1 -1
  57. package/dist/h12mediaBidAdapter.js +1 -1
  58. package/dist/hypelabBidAdapter.js +1 -1
  59. package/dist/id5IdSystem.js +1 -1
  60. package/dist/imdsBidAdapter.js +1 -1
  61. package/dist/improvedigitalBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/ixBidAdapter.js +1 -1
  64. package/dist/justpremiumBidAdapter.js +1 -1
  65. package/dist/kargoBidAdapter.js +1 -1
  66. package/dist/konduitAnalyticsAdapter.js +1 -1
  67. package/dist/kueezBidAdapter.js +1 -1
  68. package/dist/kueezRtbBidAdapter.js +1 -1
  69. package/dist/kulturemediaBidAdapter.js +1 -1
  70. package/dist/lassoBidAdapter.js +1 -1
  71. package/dist/lifestreetBidAdapter.js +1 -1
  72. package/dist/liveIntentIdSystem.js +1 -1
  73. package/dist/logicadBidAdapter.js +1 -1
  74. package/dist/loglyliftBidAdapter.js +1 -1
  75. package/dist/magniteAnalyticsAdapter.js +1 -1
  76. package/dist/malltvAnalyticsAdapter.js +1 -1
  77. package/dist/marsmediaBidAdapter.js +1 -1
  78. package/dist/mediafuseBidAdapter.js +1 -1
  79. package/dist/medianetBidAdapter.js +1 -1
  80. package/dist/mediasquareBidAdapter.js +1 -1
  81. package/dist/mgidBidAdapter.js +1 -1
  82. package/dist/minutemediaBidAdapter.js +1 -1
  83. package/dist/minutemediaplusBidAdapter.js +1 -1
  84. package/dist/nativoBidAdapter.js +1 -1
  85. package/dist/nexx360BidAdapter.js +1 -1
  86. package/dist/not-for-prod/prebid.js +145 -142
  87. package/dist/oguryBidAdapter.js +1 -1
  88. package/dist/onetagBidAdapter.js +1 -1
  89. package/dist/ooloAnalyticsAdapter.js +1 -1
  90. package/dist/operaadsBidAdapter.js +1 -1
  91. package/dist/operaadsIdSystem.js +1 -0
  92. package/dist/optidigitalBidAdapter.js +1 -1
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionAnalyticsAdapter.js +1 -1
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pixfutureBidAdapter.js +1 -1
  97. package/dist/prebid-core.js +1 -1
  98. package/dist/publinkIdSystem.js +1 -1
  99. package/dist/pubmaticBidAdapter.js +1 -1
  100. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  101. package/dist/pxyzBidAdapter.js +1 -1
  102. package/dist/quantcastBidAdapter.js +1 -1
  103. package/dist/readpeakBidAdapter.js +1 -1
  104. package/dist/relaidoBidAdapter.js +1 -1
  105. package/dist/retailspotBidAdapter.js +1 -1
  106. package/dist/rhythmoneBidAdapter.js +1 -1
  107. package/dist/riseBidAdapter.js +1 -1
  108. package/dist/rubiconBidAdapter.js +1 -1
  109. package/dist/seedingAllianceBidAdapter.js +1 -1
  110. package/dist/seedtagBidAdapter.js +1 -1
  111. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  112. package/dist/sharethroughBidAdapter.js +1 -1
  113. package/dist/shinezBidAdapter.js +1 -1
  114. package/dist/smaatoBidAdapter.js +1 -1
  115. package/dist/smartadserverBidAdapter.js +1 -1
  116. package/dist/smartxBidAdapter.js +1 -1
  117. package/dist/smartyadsBidAdapter.js +1 -1
  118. package/dist/smilewantedBidAdapter.js +1 -1
  119. package/dist/snigelBidAdapter.js +1 -1
  120. package/dist/sonobiBidAdapter.js +1 -1
  121. package/dist/sovrnAnalyticsAdapter.js +1 -1
  122. package/dist/sovrnBidAdapter.js +1 -1
  123. package/dist/sspBCBidAdapter.js +1 -1
  124. package/dist/stvBidAdapter.js +1 -1
  125. package/dist/sublimeBidAdapter.js +1 -1
  126. package/dist/tappxBidAdapter.js +1 -1
  127. package/dist/targetVideoBidAdapter.js +1 -1
  128. package/dist/teadsBidAdapter.js +1 -1
  129. package/dist/topicsFpdModule.js +1 -1
  130. package/dist/trionBidAdapter.js +1 -1
  131. package/dist/tripleliftBidAdapter.js +1 -1
  132. package/dist/ttdBidAdapter.js +1 -1
  133. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  134. package/dist/uid2IdSystem.js +1 -1
  135. package/dist/underdogmediaBidAdapter.js +1 -1
  136. package/dist/undertoneBidAdapter.js +1 -1
  137. package/dist/vidazooBidAdapter.js +1 -1
  138. package/dist/videobyteBidAdapter.js +1 -1
  139. package/dist/visxBidAdapter.js +1 -1
  140. package/dist/vuukleBidAdapter.js +1 -1
  141. package/dist/widespaceBidAdapter.js +1 -1
  142. package/dist/winrBidAdapter.js +1 -1
  143. package/dist/yahoosspBidAdapter.js +1 -1
  144. package/dist/yieldmoBidAdapter.js +1 -1
  145. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  146. package/integrationExamples/topics/topics-server.js +72 -0
  147. package/modules/.submodules.json +2 -1
  148. package/modules/a1MediaRtdProvider.js +1 -1
  149. package/modules/adagioBidAdapter.js +15 -1
  150. package/modules/adgenerationBidAdapter.js +4 -3
  151. package/modules/admaticBidAdapter.js +5 -0
  152. package/modules/adqueryBidAdapter.js +23 -21
  153. package/modules/adqueryIdSystem.js +45 -30
  154. package/modules/adrelevantisBidAdapter.js +2 -0
  155. package/modules/adsinteractiveBidAdapter.js +2 -0
  156. package/modules/alkimiBidAdapter.js +19 -7
  157. package/modules/automatadAnalyticsAdapter.js +325 -0
  158. package/modules/automatadAnalyticsAdapter.md +23 -0
  159. package/modules/bidViewability.js +7 -0
  160. package/modules/bidViewability.md +9 -8
  161. package/modules/brandmetricsRtdProvider.js +30 -27
  162. package/modules/connatixBidAdapter.js +185 -0
  163. package/modules/connatixBidAdapter.md +37 -0
  164. package/modules/criteoBidAdapter.js +73 -50
  165. package/modules/freepassBidAdapter.js +20 -1
  166. package/modules/freepassBidAdapter.md +4 -1
  167. package/modules/geoedgeRtdProvider.js +43 -13
  168. package/modules/geoedgeRtdProvider.md +2 -1
  169. package/modules/gridBidAdapter.js +1 -8
  170. package/modules/liveIntentIdSystem.js +16 -1
  171. package/modules/medianetBidAdapter.js +7 -4
  172. package/modules/mediasquareBidAdapter.js +3 -0
  173. package/modules/nativoBidAdapter.js +21 -3
  174. package/modules/onetagBidAdapter.js +3 -0
  175. package/modules/operaadsBidAdapter.js +5 -0
  176. package/modules/operaadsBidAdapter.md +5 -5
  177. package/modules/operaadsIdSystem.js +106 -0
  178. package/modules/operaadsIdSystem.md +52 -0
  179. package/modules/optidigitalBidAdapter.js +25 -16
  180. package/modules/oxxionAnalyticsAdapter.js +22 -5
  181. package/modules/rubiconBidAdapter.js +2 -2
  182. package/modules/smartyadsBidAdapter.js +18 -1
  183. package/modules/snigelBidAdapter.js +69 -16
  184. package/modules/snigelBidAdapter.md +9 -3
  185. package/modules/tappxBidAdapter.js +17 -14
  186. package/modules/topicsFpdModule.js +35 -9
  187. package/modules/undertoneBidAdapter.md +1 -1
  188. package/modules/userId/eids.md +7 -0
  189. package/modules/visxBidAdapter.js +51 -1
  190. package/package.json +2 -2
  191. package/src/adloader.js +1 -0
  192. package/src/native.js +2 -2
  193. package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
  194. package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
  195. package/test/spec/modules/admaticBidAdapter_spec.js +5 -0
  196. package/test/spec/modules/adqueryIdSystem_spec.js +13 -24
  197. package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
  198. package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
  199. package/test/spec/modules/bidViewability_spec.js +32 -1
  200. package/test/spec/modules/brandmetricsRtdProvider_spec.js +6 -0
  201. package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
  202. package/test/spec/modules/criteoBidAdapter_spec.js +249 -0
  203. package/test/spec/modules/eids_spec.js +48 -0
  204. package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
  205. package/test/spec/modules/geoedgeRtdProvider_spec.js +44 -24
  206. package/test/spec/modules/gridBidAdapter_spec.js +68 -0
  207. package/test/spec/modules/liveIntentIdMinimalSystem_spec.js +5 -0
  208. package/test/spec/modules/liveIntentIdSystem_spec.js +5 -0
  209. package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
  210. package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
  211. package/test/spec/modules/nativoBidAdapter_spec.js +6 -1
  212. package/test/spec/modules/onetagBidAdapter_spec.js +69 -0
  213. package/test/spec/modules/operaadsIdSystem_spec.js +53 -0
  214. package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
  215. package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +6 -1
  216. package/test/spec/modules/rubiconBidAdapter_spec.js +24 -0
  217. package/test/spec/modules/smartyadsBidAdapter_spec.js +49 -0
  218. package/test/spec/modules/snigelBidAdapter_spec.js +57 -6
  219. package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
  220. package/test/spec/modules/topicsFpdModule_spec.js +102 -1
  221. package/test/spec/modules/visxBidAdapter_spec.js +151 -1
  222. package/test/spec/native_spec.js +5 -3
@@ -271,6 +271,39 @@ describe('eids array generation for known sub-modules', function() {
271
271
  });
272
272
  });
273
273
 
274
+ it('index', function() {
275
+ const userId = {
276
+ index: {'id': 'sample_id'}
277
+ };
278
+ const newEids = createEidsArray(userId);
279
+ expect(newEids.length).to.equal(1);
280
+ expect(newEids[0]).to.deep.equal({
281
+ source: 'liveintent.indexexchange.com',
282
+ uids: [{
283
+ id: 'sample_id',
284
+ atype: 3
285
+ }]
286
+ });
287
+ });
288
+
289
+ it('index with ext', function() {
290
+ const userId = {
291
+ index: {'id': 'sample_id', 'ext': {'provider': 'some.provider.com'}}
292
+ };
293
+ const newEids = createEidsArray(userId);
294
+ expect(newEids.length).to.equal(1);
295
+ expect(newEids[0]).to.deep.equal({
296
+ source: 'liveintent.indexexchange.com',
297
+ uids: [{
298
+ id: 'sample_id',
299
+ atype: 3,
300
+ ext: {
301
+ provider: 'some.provider.com'
302
+ }
303
+ }]
304
+ });
305
+ });
306
+
274
307
  it('liveIntentId; getValue call and NO ext', function() {
275
308
  const userId = {
276
309
  lipb: {
@@ -547,6 +580,21 @@ describe('eids array generation for known sub-modules', function() {
547
580
  });
548
581
  });
549
582
 
583
+ it('operaId', function() {
584
+ const userId = {
585
+ operaId: 'some-random-id-value'
586
+ };
587
+ const newEids = createEidsArray(userId);
588
+ expect(newEids.length).to.equal(1);
589
+ expect(newEids[0]).to.deep.equal({
590
+ source: 't.adx.opera.com',
591
+ uids: [{
592
+ id: 'some-random-id-value',
593
+ atype: 1
594
+ }]
595
+ });
596
+ });
597
+
550
598
  it('33acrossId', function() {
551
599
  const userId = {
552
600
  '33acrossId': {
@@ -19,6 +19,9 @@ describe('FreePass adapter', function () {
19
19
  }
20
20
  },
21
21
  adUnitCode: 'adunit-code',
22
+ params: {
23
+ publisherId: 'publisherIdValue'
24
+ }
22
25
  };
23
26
 
24
27
  it('should return true when required params found', function () {
@@ -30,6 +33,12 @@ describe('FreePass adapter', function () {
30
33
  delete localBid.adUnitCode;
31
34
  expect(spec.isBidRequestValid(localBid)).to.equal(false);
32
35
  });
36
+
37
+ it('should return false when params.publisherId is missing', function () {
38
+ let localBid = Object.assign({}, bid);
39
+ delete localBid.params.publisherId;
40
+ expect(spec.isBidRequestValid(localBid)).to.equal(false);
41
+ });
33
42
  });
34
43
 
35
44
  describe('buildRequests', function () {
@@ -43,6 +52,10 @@ describe('FreePass adapter', function () {
43
52
  'userId': '56c4c789-71ce-46f5-989e-9e543f3d5f96',
44
53
  'commonId': 'commonIdValue'
45
54
  }
55
+ },
56
+ 'adUnitCode': 'adunit-code',
57
+ 'params': {
58
+ 'publisherId': 'publisherIdValue'
46
59
  }
47
60
  }];
48
61
  bidderRequest = {};
@@ -108,6 +121,33 @@ describe('FreePass adapter', function () {
108
121
  expect(ortbData.device.ext).to.be.an('object');
109
122
  expect(ortbData.device.ext.is_accurate_ip).to.equal(0);
110
123
  });
124
+
125
+ it('it should add publisher related information w/o publisherUrl', function () {
126
+ const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
127
+ const ortbData = bidRequest.data;
128
+ expect(ortbData.site).to.be.an('object');
129
+ expect(ortbData.site.publisher.id).to.equal('publisherIdValue');
130
+ // publisher.domain is optional
131
+ expect(ortbData.site.publisher.domain).to.be.undefined;
132
+ });
133
+
134
+ it('it should add publisher related information w/ publisherUrl', function () {
135
+ const PUBLISHER_URL = 'publisherUrlValue';
136
+ let localBidRequests = [Object.assign({}, bidRequests[0])];
137
+ localBidRequests[0].params.publisherUrl = PUBLISHER_URL;
138
+ const bidRequest = spec.buildRequests(localBidRequests, bidderRequest);
139
+ const ortbData = bidRequest.data;
140
+ expect(ortbData.site).to.be.an('object');
141
+ expect(ortbData.site.publisher.id).to.equal('publisherIdValue');
142
+ // publisher.domain is optional. set when given
143
+ expect(ortbData.site.publisher.domain).to.equal(PUBLISHER_URL);
144
+ });
145
+
146
+ it('it should imp.tagId from adUnitCode', function () {
147
+ const bidRequest = spec.buildRequests(bidRequests, bidderRequest);
148
+ const ortbData = bidRequest.data;
149
+ expect(ortbData.imp[0].tagId).to.equal('adunit-code');
150
+ });
111
151
  });
112
152
 
113
153
  describe('interpretResponse', function () {
@@ -122,6 +162,10 @@ describe('FreePass adapter', function () {
122
162
  'userId': '56c4c789-71ce-46f5-989e-9e543f3d5f96',
123
163
  'commonId': 'commonIdValue'
124
164
  }
165
+ },
166
+ 'adUnitCode': 'adunit-code',
167
+ 'params': {
168
+ 'publisherId': 'publisherIdValue'
125
169
  }
126
170
  }];
127
171
  bidderRequest = {};
@@ -1,12 +1,13 @@
1
1
  import * as utils from '../../../src/utils.js';
2
+ import { loadExternalScript } from '../../../src/adloader.js';
2
3
  import * as hook from '../../../src/hook.js'
3
- import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl } from '../../../modules/geoedgeRtdProvider.js';
4
+ import { beforeInit, geoedgeSubmodule, setWrapper, wrapper, htmlPlaceholder, WRAPPER_URL, getClientUrl, getInPageUrl } from '../../../modules/geoedgeRtdProvider.js';
4
5
  import { server } from '../../../test/mocks/xhr.js';
5
6
  import * as events from '../../../src/events.js';
6
7
  import CONSTANTS from '../../../src/constants.json';
7
8
 
8
9
  let key = '123123123';
9
- function makeConfig() {
10
+ function makeConfig(gpt) {
10
11
  return {
11
12
  name: 'geoedge',
12
13
  params: {
@@ -15,7 +16,8 @@ function makeConfig() {
15
16
  bidders: {
16
17
  bidderA: true,
17
18
  bidderB: false
18
- }
19
+ },
20
+ gpt: gpt
19
21
  }
20
22
  };
21
23
  }
@@ -23,6 +25,7 @@ function makeConfig() {
23
25
  function mockBid(bidderCode) {
24
26
  return {
25
27
  'ad': '<creative/>',
28
+ 'adId': '1234',
26
29
  'cpm': '1.00',
27
30
  'width': 300,
28
31
  'height': 250,
@@ -35,6 +38,15 @@ function mockBid(bidderCode) {
35
38
  };
36
39
  }
37
40
 
41
+ function mockMessageFromClient(key) {
42
+ return {
43
+ key,
44
+ impression: true,
45
+ adId: 1234,
46
+ type: 'impression'
47
+ };
48
+ }
49
+
38
50
  let mockWrapper = `<wrapper>${htmlPlaceholder}</wrapper>`;
39
51
 
40
52
  describe('Geoedge RTD module', function () {
@@ -47,22 +59,11 @@ describe('Geoedge RTD module', function () {
47
59
  after(function () {
48
60
  submoduleStub.restore();
49
61
  });
50
- it('should fetch the wrapper', function () {
51
- beforeInit();
52
- let request = server.requests[0];
53
- let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
54
- expect(isWrapperRequest).to.equal(true);
55
- });
56
62
  it('should register RTD submodule provider', function () {
63
+ beforeInit();
57
64
  expect(submoduleStub.calledWith('realTimeData', geoedgeSubmodule)).to.equal(true);
58
65
  });
59
66
  });
60
- describe('setWrapper', function () {
61
- it('should set the wrapper', function () {
62
- setWrapper(mockWrapper);
63
- expect(wrapper).to.equal(mockWrapper);
64
- });
65
- });
66
67
  describe('submodule', function () {
67
68
  describe('name', function () {
68
69
  it('should be geoedge', function () {
@@ -84,35 +85,54 @@ describe('Geoedge RTD module', function () {
84
85
  expect(missingParams || missingKey).to.equal(false);
85
86
  });
86
87
  it('should return true when params are ok', function () {
87
- expect(geoedgeSubmodule.init(makeConfig())).to.equal(true);
88
+ expect(geoedgeSubmodule.init(makeConfig(false))).to.equal(true);
89
+ });
90
+ it('should fetch the wrapper', function () {
91
+ geoedgeSubmodule.init(makeConfig(false));
92
+ let request = server.requests[0];
93
+ let isWrapperRequest = request && request.url && request.url && request.url === WRAPPER_URL;
94
+ expect(isWrapperRequest).to.equal(true);
88
95
  });
89
96
  it('should preload the client', function () {
90
97
  let isLinkPreloadAsScript = arg => arg.tagName === 'LINK' && arg.rel === 'preload' && arg.as === 'script' && arg.href === getClientUrl(key);
91
98
  expect(insertElementStub.calledWith(sinon.match(isLinkPreloadAsScript))).to.equal(true);
92
99
  });
93
- it('should emit billable events with applicable winning bids', function () {
94
- let applicableBid = mockBid('bidderA');
95
- let nonApplicableBid = mockBid('bidderB');
100
+ it('should emit billable events with applicable winning bids', function (done) {
96
101
  let counter = 0;
97
102
  events.on(CONSTANTS.EVENTS.BILLABLE_EVENT, function (event) {
98
103
  if (event.vendor === 'geoedge' && event.type === 'impression') {
99
104
  counter += 1;
100
105
  }
106
+ expect(counter).to.equal(1);
107
+ done();
101
108
  });
102
- events.emit(CONSTANTS.EVENTS.BID_WON, applicableBid);
103
- events.emit(CONSTANTS.EVENTS.BID_WON, nonApplicableBid);
104
- expect(counter).to.equal(1);
109
+ window.postMessage(mockMessageFromClient(key), '*');
110
+ });
111
+ it('should load the in page code when gpt params is true', function () {
112
+ geoedgeSubmodule.init(makeConfig(true));
113
+ let isInPageUrl = arg => arg == getInPageUrl(key);
114
+ expect(loadExternalScript.calledWith(sinon.match(isInPageUrl))).to.equal(true);
115
+ });
116
+ it('should set the window.grumi config object when gpt params is true', function () {
117
+ let hasGrumiObj = typeof window.grumi === 'object';
118
+ expect(hasGrumiObj && window.grumi.key === key && window.grumi.fromPrebid).to.equal(true);
119
+ });
120
+ });
121
+ describe('setWrapper', function () {
122
+ it('should set the wrapper', function () {
123
+ setWrapper(mockWrapper);
124
+ expect(wrapper).to.equal(mockWrapper);
105
125
  });
106
126
  });
107
127
  describe('onBidResponseEvent', function () {
108
128
  let bidFromA = mockBid('bidderA');
109
129
  it('should wrap bid html when bidder is configured', function () {
110
- geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig());
130
+ geoedgeSubmodule.onBidResponseEvent(bidFromA, makeConfig(false));
111
131
  expect(bidFromA.ad.indexOf('<wrapper>')).to.equal(0);
112
132
  });
113
133
  it('should not wrap bid html when bidder is not configured', function () {
114
134
  let bidFromB = mockBid('bidderB');
115
- geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig());
135
+ geoedgeSubmodule.onBidResponseEvent(bidFromB, makeConfig(false));
116
136
  expect(bidFromB.ad.indexOf('<wrapper>')).to.equal(-1);
117
137
  });
118
138
  it('should only muatate the bid ad porperty', function () {
@@ -786,6 +786,74 @@ describe('TheMediaGrid Adapter', function () {
786
786
  });
787
787
  });
788
788
 
789
+ it('should prioritize pbadslot over adslot', function() {
790
+ const ortb2Imp = [{
791
+ ext: {
792
+ data: {
793
+ adserver: {
794
+ adslot: 'adslot'
795
+ }
796
+ }
797
+ }
798
+ }, {
799
+ ext: {
800
+ data: {
801
+ adserver: {
802
+ adslot: 'adslot'
803
+ },
804
+ pbadslot: 'pbadslot'
805
+ }
806
+ }
807
+ }];
808
+ const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 2).map((bid, ind) => {
809
+ return Object.assign({}, bid, ortb2Imp[ind] ? { ortb2Imp: {...bid.ortb2Imp, ...ortb2Imp[ind]} } : {});
810
+ });
811
+ const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
812
+ expect(request.data).to.be.an('string');
813
+ const payload = parseRequest(request.data);
814
+ expect(payload.imp[0].ext.gpid).to.equal(ortb2Imp[0].ext.data.adserver.adslot);
815
+ expect(payload.imp[1].ext.gpid).to.equal(ortb2Imp[1].ext.data.pbadslot);
816
+ });
817
+
818
+ it('should prioritize gpid over pbadslot and adslot', function() {
819
+ const ortb2Imp = [{
820
+ ext: {
821
+ gpid: 'gpid',
822
+ data: {
823
+ adserver: {
824
+ adslot: 'adslot'
825
+ },
826
+ pbadslot: 'pbadslot'
827
+ }
828
+ }
829
+ }, {
830
+ ext: {
831
+ gpid: 'gpid',
832
+ data: {
833
+ adserver: {
834
+ adslot: 'adslot'
835
+ }
836
+ }
837
+ }
838
+ }, {
839
+ ext: {
840
+ gpid: 'gpid',
841
+ data: {
842
+ pbadslot: 'pbadslot'
843
+ }
844
+ }
845
+ }];
846
+ const bidRequestsWithOrtb2Imp = bidRequests.slice(0, 3).map((bid, ind) => {
847
+ return Object.assign({}, bid, ortb2Imp[ind] ? { ortb2Imp: {...bid.ortb2Imp, ...ortb2Imp[ind]} } : {});
848
+ });
849
+ const [request] = spec.buildRequests(bidRequestsWithOrtb2Imp, bidderRequest);
850
+ expect(request.data).to.be.an('string');
851
+ const payload = parseRequest(request.data);
852
+ expect(payload.imp[0].ext.gpid).to.equal(ortb2Imp[0].ext.gpid);
853
+ expect(payload.imp[1].ext.gpid).to.equal(ortb2Imp[1].ext.gpid);
854
+ expect(payload.imp[2].ext.gpid).to.equal(ortb2Imp[2].ext.gpid);
855
+ });
856
+
789
857
  it('should contain imp[].instl if available', function() {
790
858
  const ortb2Imp = [{
791
859
  instl: 1
@@ -266,6 +266,11 @@ describe('LiveIntentMinimalId', function() {
266
266
  expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
267
267
  });
268
268
 
269
+ it('should decode an index id to a seperate object when present', function() {
270
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
271
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
272
+ });
273
+
269
274
  it('should allow disabling nonId resolution', function() {
270
275
  let callBackSpy = sinon.spy();
271
276
  let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
@@ -378,6 +378,11 @@ describe('LiveIntentId', function() {
378
378
  expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'magnite': 'bar'}, 'magnite': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
379
379
  });
380
380
 
381
+ it('should decode an index id to a seperate object when present', function() {
382
+ const result = liveIntentIdSubmodule.decode({ nonId: 'foo', index: 'bar' });
383
+ expect(result).to.eql({'lipb': {'lipbid': 'foo', 'nonId': 'foo', 'index': 'bar'}, 'index': {'id': 'bar', 'ext': {'provider': 'liveintent.com'}}});
384
+ });
385
+
381
386
  it('should allow disabling nonId resolution', function() {
382
387
  let callBackSpy = sinon.spy();
383
388
  let submoduleCallback = liveIntentIdSubmodule.getId({ params: {
@@ -915,24 +915,24 @@ let VALID_BID_REQUEST = [{
915
915
  cid: '8CUV090'
916
916
  }
917
917
  },
918
- VALID_PARAMS_AAX = {
919
- bidder: 'aax',
918
+ VALID_PARAMS_TS = {
919
+ bidder: 'trustedstack',
920
920
  params: {
921
- cid: 'AAXG123'
921
+ cid: 'TS012345'
922
922
  }
923
923
  },
924
924
  PARAMS_MISSING = {
925
925
  bidder: 'medianet',
926
926
  },
927
- PARAMS_MISSING_AAX = {
928
- bidder: 'aax',
927
+ PARAMS_MISSING_TS = {
928
+ bidder: 'trustedstack',
929
929
  },
930
930
  PARAMS_WITHOUT_CID = {
931
931
  bidder: 'medianet',
932
932
  params: {}
933
933
  },
934
- PARAMS_WITHOUT_CID_AAX = {
935
- bidder: 'aax',
934
+ PARAMS_WITHOUT_CID_TS = {
935
+ bidder: 'trustedstack',
936
936
  params: {}
937
937
  },
938
938
  PARAMS_WITH_INTEGER_CID = {
@@ -941,8 +941,8 @@ let VALID_BID_REQUEST = [{
941
941
  cid: 8867587
942
942
  }
943
943
  },
944
- PARAMS_WITH_INTEGER_CID_AAX = {
945
- bidder: 'aax',
944
+ PARAMS_WITH_INTEGER_CID_TS = {
945
+ bidder: 'trustedstack',
946
946
  params: {
947
947
  cid: 8867587
948
948
  }
@@ -953,8 +953,8 @@ let VALID_BID_REQUEST = [{
953
953
  cid: ''
954
954
  }
955
955
  },
956
- PARAMS_WITH_EMPTY_CID_AAX = {
957
- bidder: 'aax',
956
+ PARAMS_WITH_EMPTY_CID_TS = {
957
+ bidder: 'trustedstack',
958
958
  params: {
959
959
  cid: ''
960
960
  }
@@ -1783,34 +1783,34 @@ describe('Media.net bid adapter', function () {
1783
1783
  });
1784
1784
  });
1785
1785
 
1786
- describe('isBidRequestValid aax', function () {
1786
+ describe('isBidRequestValid trustedstack', function () {
1787
1787
  it('should accept valid bid params', function () {
1788
- let isValid = spec.isBidRequestValid(VALID_PARAMS_AAX);
1788
+ let isValid = spec.isBidRequestValid(VALID_PARAMS_TS);
1789
1789
  expect(isValid).to.equal(true);
1790
1790
  });
1791
1791
 
1792
1792
  it('should reject bid if cid is not present', function () {
1793
- let isValid = spec.isBidRequestValid(PARAMS_WITHOUT_CID_AAX);
1793
+ let isValid = spec.isBidRequestValid(PARAMS_WITHOUT_CID_TS);
1794
1794
  expect(isValid).to.equal(false);
1795
1795
  });
1796
1796
 
1797
1797
  it('should reject bid if cid is not a string', function () {
1798
- let isValid = spec.isBidRequestValid(PARAMS_WITH_INTEGER_CID_AAX);
1798
+ let isValid = spec.isBidRequestValid(PARAMS_WITH_INTEGER_CID_TS);
1799
1799
  expect(isValid).to.equal(false);
1800
1800
  });
1801
1801
 
1802
1802
  it('should reject bid if cid is a empty string', function () {
1803
- let isValid = spec.isBidRequestValid(PARAMS_WITH_EMPTY_CID_AAX);
1803
+ let isValid = spec.isBidRequestValid(PARAMS_WITH_EMPTY_CID_TS);
1804
1804
  expect(isValid).to.equal(false);
1805
1805
  });
1806
1806
 
1807
1807
  it('should have missing params', function () {
1808
- let isValid = spec.isBidRequestValid(PARAMS_MISSING_AAX);
1808
+ let isValid = spec.isBidRequestValid(PARAMS_MISSING_TS);
1809
1809
  expect(isValid).to.equal(false);
1810
1810
  });
1811
1811
  });
1812
1812
 
1813
- describe('interpretResponse aax', function () {
1813
+ describe('interpretResponse trustedstack', function () {
1814
1814
  it('should not push response if no-bid', function () {
1815
1815
  let validBids = [];
1816
1816
  let bids = spec.interpretResponse(SERVER_RESPONSE_NOBID, []);
@@ -1,5 +1,6 @@
1
1
  import {expect} from 'chai';
2
2
  import {spec} from 'modules/mediasquareBidAdapter.js';
3
+ import { server } from 'test/mocks/xhr.js';
3
4
 
4
5
  describe('MediaSquare bid adapter tests', function () {
5
6
  var DEFAULT_PARAMS = [{
@@ -208,6 +209,10 @@ describe('MediaSquare bid adapter tests', function () {
208
209
  const response = spec.interpretResponse(BID_RESPONSE, request);
209
210
  const won = spec.onBidWon(response[0]);
210
211
  expect(won).to.equal(true);
212
+ expect(server.requests.length).to.equal(1);
213
+ let message = JSON.parse(server.requests[0].requestBody);
214
+ expect(message).to.have.property('increment').exist;
215
+ expect(message).to.have.property('increment').and.to.equal('1');
211
216
  });
212
217
  it('Verifies user sync without cookie in bid response', function () {
213
218
  var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
@@ -112,7 +112,7 @@ describe('nativoBidAdapterTests', function () {
112
112
  bidRequests = [JSON.parse(bidRequestString)]
113
113
  })
114
114
 
115
- it('url should contain query string parameters', function () {
115
+ it('Request should be POST, with JSON string payload and QS params should be added to the url', function () {
116
116
  const request = spec.buildRequests(bidRequests, {
117
117
  bidderRequestId: 123456,
118
118
  refererInfo: {
@@ -120,6 +120,11 @@ describe('nativoBidAdapterTests', function () {
120
120
  },
121
121
  })
122
122
 
123
+ expect(request.method).to.equal('POST')
124
+
125
+ expect(request.data).to.exist
126
+ expect(request.data).to.be.a('string')
127
+
123
128
  expect(request.url).to.exist
124
129
  expect(request.url).to.be.a('string')
125
130
 
@@ -312,6 +312,75 @@ describe('onetag', function () {
312
312
  expect(payload.usPrivacy).to.exist;
313
313
  expect(payload.usPrivacy).to.exist.and.to.equal(consentString);
314
314
  });
315
+ it('Should send FPD (ortb2 field)', function () {
316
+ const firtPartyData = {
317
+ // this is where the contextual data is placed
318
+ site: {
319
+ name: 'example',
320
+ domain: 'page.example.com',
321
+ // OpenRTB 2.5 spec / Content Taxonomy
322
+ cat: ['IAB2'],
323
+ sectioncat: ['IAB2-2'],
324
+ pagecat: ['IAB2-2'],
325
+ page: 'https://page.example.com/here.html',
326
+ ref: 'https://ref.example.com',
327
+ keywords: 'power tools, drills',
328
+ search: 'drill',
329
+ content: {
330
+ userrating: '4',
331
+ data: [{
332
+ name: 'www.dataprovider1.com', // who resolved the segments
333
+ ext: {
334
+ segtax: 7, // taxonomy used to encode the segments
335
+ cids: ['iris_c73g5jq96mwso4d8']
336
+ },
337
+ // the bare minimum are the IDs. These IDs are the ones from the new IAB Content Taxonomy v3
338
+ segment: [ { id: '687' }, { id: '123' } ]
339
+ }]
340
+ },
341
+ ext: {
342
+ data: { // fields that aren't part of openrtb 2.6
343
+ pageType: 'article',
344
+ category: 'repair'
345
+ }
346
+ }
347
+ },
348
+ // this is where the user data is placed
349
+ user: {
350
+ keywords: 'a,b',
351
+ data: [{
352
+ name: 'dataprovider.com',
353
+ ext: {
354
+ segtax: 4
355
+ },
356
+ segment: [{
357
+ id: '1'
358
+ }]
359
+ }],
360
+ ext: {
361
+ data: {
362
+ registered: true,
363
+ interests: ['cars']
364
+ }
365
+ }
366
+ },
367
+ regs: {
368
+ gpp: 'abc1234',
369
+ gpp_sid: [7]
370
+ }
371
+ };
372
+ let bidderRequest = {
373
+ 'bidderCode': 'onetag',
374
+ 'auctionId': '1d1a030790a475',
375
+ 'bidderRequestId': '22edbae2733bf6',
376
+ 'timeout': 3000,
377
+ 'ortb2': firtPartyData
378
+ }
379
+ let serverRequest = spec.buildRequests([bannerBid], bidderRequest);
380
+ const payload = JSON.parse(serverRequest.data);
381
+ expect(payload.ortb2).to.exist;
382
+ expect(payload.ortb2).to.exist.and.to.deep.equal(firtPartyData);
383
+ });
315
384
  });
316
385
  describe('interpretResponse', function () {
317
386
  const request = getBannerVideoRequest();
@@ -0,0 +1,53 @@
1
+ import { operaIdSubmodule } from 'modules/operaadsIdSystem'
2
+ import * as ajaxLib from 'src/ajax.js'
3
+
4
+ const TEST_ID = 'opera-test-id';
5
+ const operaIdRemoteResponse = { uid: TEST_ID };
6
+
7
+ describe('operaId submodule properties', () => {
8
+ it('should expose a "name" property equal to "operaId"', () => {
9
+ expect(operaIdSubmodule.name).to.equal('operaId');
10
+ });
11
+ });
12
+
13
+ function fakeRequest(fn) {
14
+ const ajaxBuilderStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(() => {
15
+ return (url, cbObj) => {
16
+ cbObj.success(JSON.stringify(operaIdRemoteResponse));
17
+ }
18
+ });
19
+ fn();
20
+ ajaxBuilderStub.restore();
21
+ }
22
+
23
+ describe('operaId submodule getId', function() {
24
+ it('request to the fake server to correctly extract test ID', function() {
25
+ fakeRequest(() => {
26
+ const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: { pid: 'pub123' } });
27
+ moduleIdCallbackResponse.callback((id) => {
28
+ expect(id).to.equal(operaIdRemoteResponse.operaId);
29
+ });
30
+ });
31
+ });
32
+
33
+ it('request to the fake server without publiser ID', function() {
34
+ fakeRequest(() => {
35
+ const moduleIdCallbackResponse = operaIdSubmodule.getId({ params: {} });
36
+ expect(moduleIdCallbackResponse).to.equal(undefined);
37
+ });
38
+ });
39
+ });
40
+
41
+ describe('operaId submodule decode', function() {
42
+ it('should respond with an object containing "operaId" as key with the value', () => {
43
+ expect(operaIdSubmodule.decode(TEST_ID)).to.deep.equal({
44
+ operaId: TEST_ID
45
+ });
46
+ });
47
+
48
+ it('should respond with undefined if the value is not a string or an empty string', () => {
49
+ [1, 2.0, null, undefined, NaN, [], {}].forEach((value) => {
50
+ expect(operaIdSubmodule.decode(value)).to.equal(undefined);
51
+ });
52
+ });
53
+ });
@@ -1,5 +1,5 @@
1
1
  import { expect } from 'chai';
2
- import { spec } from 'modules/optidigitalBidAdapter.js';
2
+ import { spec, resetSync } from 'modules/optidigitalBidAdapter.js';
3
3
  import * as utils from 'src/utils.js';
4
4
 
5
5
  const ENDPOINT = 'https://pbs.optidigital.com/bidder';
@@ -497,6 +497,7 @@ describe('optidigitalAdapterTests', function () {
497
497
  let test;
498
498
  beforeEach(function () {
499
499
  test = sinon.sandbox.create();
500
+ resetSync();
500
501
  });
501
502
  afterEach(function() {
502
503
  test.restore();
@@ -508,16 +509,22 @@ describe('optidigitalAdapterTests', function () {
508
509
  }]);
509
510
  });
510
511
 
511
- it('should return appropriate URL', function() {
512
+ it('should return appropriate URL with GDPR equals to 1 and GDPR consent', function() {
512
513
  expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, undefined)).to.deep.equal([{
513
514
  type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo`
514
515
  }]);
516
+ });
517
+ it('should return appropriate URL with GDPR equals to 0 and GDPR consent', function() {
515
518
  expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: false, consentString: 'foo'}, undefined)).to.deep.equal([{
516
519
  type: 'iframe', url: `${syncurlIframe}&gdpr=0&gdpr_consent=foo`
517
520
  }]);
521
+ });
522
+ it('should return appropriate URL with GDPR equals to 1 and no consent', function() {
518
523
  expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: undefined}, undefined)).to.deep.equal([{
519
524
  type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
520
525
  }]);
526
+ });
527
+ it('should return appropriate URL with GDPR equals to 1, GDPR consent and CCPA consent', function() {
521
528
  expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, {consentString: 'fooUsp'})).to.deep.equal([{
522
529
  type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&ccpa_consent=fooUsp`
523
530
  }]);