prebid.js 7.33.0 → 7.35.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 (219) hide show
  1. package/.devcontainer/devcontainer.json +2 -1
  2. package/.github/workflows/issue_tracker.yml +27 -16
  3. package/dist/33acrossBidAdapter.js +1 -1
  4. package/dist/33acrossIdSystem.js +1 -1
  5. package/dist/adagioBidAdapter.js +1 -1
  6. package/dist/adbookpspBidAdapter.js +1 -1
  7. package/dist/adgenerationBidAdapter.js +1 -1
  8. package/dist/admaticBidAdapter.js +1 -1
  9. package/dist/admixerBidAdapter.js +1 -1
  10. package/dist/adnuntiusBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.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/amxBidAdapter.js +1 -1
  17. package/dist/amxIdSystem.js +1 -1
  18. package/dist/appierAnalyticsAdapter.js +1 -1
  19. package/dist/appnexusBidAdapter.js +1 -1
  20. package/dist/arcspanRtdProvider.js +1 -0
  21. package/dist/asoBidAdapter.js +1 -1
  22. package/dist/axonixBidAdapter.js +1 -1
  23. package/dist/bidglassBidAdapter.js +1 -1
  24. package/dist/big-richmediaBidAdapter.js +1 -1
  25. package/dist/bliinkBidAdapter.js +1 -1
  26. package/dist/bridgewellBidAdapter.js +1 -1
  27. package/dist/brightMountainMediaBidAdapter.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -1
  30. package/dist/concertBidAdapter.js +1 -1
  31. package/dist/connectadBidAdapter.js +1 -1
  32. package/dist/consentManagement.js +1 -1
  33. package/dist/consumableBidAdapter.js +1 -1
  34. package/dist/conversantBidAdapter.js +1 -1
  35. package/dist/craftBidAdapter.js +1 -1
  36. package/dist/criteoBidAdapter.js +1 -1
  37. package/dist/cwireBidAdapter.js +1 -1
  38. package/dist/dspxBidAdapter.js +1 -1
  39. package/dist/emx_digitalBidAdapter.js +1 -1
  40. package/dist/eplanningBidAdapter.js +1 -1
  41. package/dist/feedadBidAdapter.js +1 -1
  42. package/dist/finativeBidAdapter.js +1 -1
  43. package/dist/glimpseBidAdapter.js +1 -1
  44. package/dist/gmosspBidAdapter.js +1 -1
  45. package/dist/goldbachBidAdapter.js +1 -1
  46. package/dist/gridBidAdapter.js +1 -1
  47. package/dist/gridNMBidAdapter.js +1 -1
  48. package/dist/gumgumBidAdapter.js +1 -1
  49. package/dist/h12mediaBidAdapter.js +1 -1
  50. package/dist/hadronIdSystem.js +1 -1
  51. package/dist/holidBidAdapter.js +1 -1
  52. package/dist/id5IdSystem.js +1 -1
  53. package/dist/improvedigitalBidAdapter.js +1 -1
  54. package/dist/inmarBidAdapter.js +1 -1
  55. package/dist/insticatorBidAdapter.js +1 -1
  56. package/dist/ixBidAdapter.js +1 -1
  57. package/dist/justpremiumBidAdapter.js +1 -1
  58. package/dist/kargoBidAdapter.js +1 -1
  59. package/dist/konduitAnalyticsAdapter.js +1 -1
  60. package/dist/kueezBidAdapter.js +1 -1
  61. package/dist/kueezRtbBidAdapter.js +1 -1
  62. package/dist/lassoBidAdapter.js +1 -1
  63. package/dist/lifestreetBidAdapter.js +1 -1
  64. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  65. package/dist/logicadBidAdapter.js +1 -1
  66. package/dist/loglyliftBidAdapter.js +1 -1
  67. package/dist/lotamePanoramaIdSystem.js +1 -1
  68. package/dist/magniteAnalyticsAdapter.js +1 -1
  69. package/dist/malltvAnalyticsAdapter.js +1 -1
  70. package/dist/marsmediaBidAdapter.js +1 -1
  71. package/dist/mediafuseBidAdapter.js +1 -1
  72. package/dist/mediasquareBidAdapter.js +1 -1
  73. package/dist/mgidBidAdapter.js +1 -1
  74. package/dist/minutemediaBidAdapter.js +1 -1
  75. package/dist/nextMillenniumBidAdapter.js +1 -1
  76. package/dist/nexx360BidAdapter.js +1 -1
  77. package/dist/not-for-prod/prebid.js +140 -149
  78. package/dist/oguryBidAdapter.js +1 -1
  79. package/dist/onetagBidAdapter.js +1 -1
  80. package/dist/ooloAnalyticsAdapter.js +1 -1
  81. package/dist/openxBidAdapter.js +1 -1
  82. package/dist/ortbConverter.js +1 -1
  83. package/dist/outbrainBidAdapter.js +1 -1
  84. package/dist/parrableIdSystem.js +1 -1
  85. package/dist/permutiveRtdProvider.js +1 -1
  86. package/dist/pixfutureBidAdapter.js +1 -1
  87. package/dist/prebid-core.js +1 -1
  88. package/dist/prebidServerBidAdapter.js +1 -1
  89. package/dist/priceFloors.js +1 -1
  90. package/dist/publinkIdSystem.js +1 -1
  91. package/dist/pubmaticBidAdapter.js +1 -1
  92. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  93. package/dist/pulsepointBidAdapter.js +1 -1
  94. package/dist/pxyzBidAdapter.js +1 -1
  95. package/dist/quantcastBidAdapter.js +1 -1
  96. package/dist/readpeakBidAdapter.js +1 -1
  97. package/dist/relaidoBidAdapter.js +1 -1
  98. package/dist/rhythmoneBidAdapter.js +1 -1
  99. package/dist/riseBidAdapter.js +1 -1
  100. package/dist/rubiconAnalyticsAdapter.js +1 -1
  101. package/dist/rubiconBidAdapter.js +1 -1
  102. package/dist/seedingAllianceBidAdapter.js +1 -1
  103. package/dist/seedtagBidAdapter.js +1 -1
  104. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  105. package/dist/sharethroughBidAdapter.js +1 -1
  106. package/dist/shinezBidAdapter.js +1 -1
  107. package/dist/smaatoBidAdapter.js +1 -1
  108. package/dist/smartadserverBidAdapter.js +1 -1
  109. package/dist/smartxBidAdapter.js +1 -1
  110. package/dist/smartytechBidAdapter.js +1 -1
  111. package/dist/smilewantedBidAdapter.js +1 -1
  112. package/dist/sonobiBidAdapter.js +1 -1
  113. package/dist/sovrnAnalyticsAdapter.js +1 -1
  114. package/dist/sovrnBidAdapter.js +1 -1
  115. package/dist/sspBCBidAdapter.js +1 -1
  116. package/dist/sublimeBidAdapter.js +1 -1
  117. package/dist/synacormediaBidAdapter.js +1 -1
  118. package/dist/taboolaBidAdapter.js +1 -1
  119. package/dist/targetVideoBidAdapter.js +1 -1
  120. package/dist/teadsBidAdapter.js +1 -1
  121. package/dist/trionBidAdapter.js +1 -1
  122. package/dist/tripleliftBidAdapter.js +1 -1
  123. package/dist/ttdBidAdapter.js +1 -1
  124. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  125. package/dist/uid2IdSystem.js +1 -1
  126. package/dist/underdogmediaBidAdapter.js +1 -1
  127. package/dist/undertoneBidAdapter.js +1 -1
  128. package/dist/vidazooBidAdapter.js +1 -1
  129. package/dist/videobyteBidAdapter.js +1 -1
  130. package/dist/visxBidAdapter.js +1 -1
  131. package/dist/vuukleBidAdapter.js +1 -1
  132. package/dist/widespaceBidAdapter.js +1 -1
  133. package/dist/winrBidAdapter.js +1 -1
  134. package/dist/yahoosspBidAdapter.js +1 -1
  135. package/dist/yieldmoBidAdapter.js +1 -1
  136. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  137. package/dist/zeta_global_sspBidAdapter.js +1 -1
  138. package/dist/zeusPrimeRtdProvider.js +4 -14
  139. package/integrationExamples/gpt/hello_world.html +0 -0
  140. package/libraries/ortbConverter/processors/default.js +19 -1
  141. package/modules/.submodules.json +1 -0
  142. package/modules/admaticBidAdapter.js +2 -1
  143. package/modules/admixerBidAdapter.js +26 -4
  144. package/modules/adnuntiusBidAdapter.js +36 -38
  145. package/modules/adyoulikeBidAdapter.js +2 -0
  146. package/modules/arcspanRtdProvider.js +73 -0
  147. package/modules/arcspanRtdProvider.md +11 -0
  148. package/modules/bliinkBidAdapter.js +1 -1
  149. package/modules/consentManagement.js +33 -5
  150. package/modules/consumableBidAdapter.js +20 -2
  151. package/modules/criteoBidAdapter.js +1 -1
  152. package/modules/cwireBidAdapter.js +169 -242
  153. package/modules/cwireBidAdapter.md +15 -14
  154. package/modules/emx_digitalBidAdapter.js +9 -2
  155. package/modules/hadronIdSystem.js +37 -32
  156. package/modules/holidBidAdapter.js +9 -4
  157. package/modules/kargoBidAdapter.js +5 -1
  158. package/modules/lotamePanoramaIdSystem.js +9 -1
  159. package/modules/nextMillenniumBidAdapter.js +19 -9
  160. package/modules/nexx360BidAdapter.js +1 -2
  161. package/modules/onetagBidAdapter.js +12 -1
  162. package/modules/openxBidAdapter.js +5 -0
  163. package/modules/outbrainBidAdapter.js +103 -6
  164. package/modules/permutiveRtdProvider.js +17 -12
  165. package/modules/prebidServerBidAdapter/index.js +14 -1
  166. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  167. package/modules/priceFloors.js +7 -8
  168. package/modules/pulsepointBidAdapter.js +2 -0
  169. package/modules/seedingAllianceBidAdapter.js +129 -116
  170. package/modules/smartadserverBidAdapter.js +39 -28
  171. package/modules/smartyadsBidAdapter.md +9 -0
  172. package/modules/smartytechBidAdapter.js +67 -10
  173. package/modules/smartytechBidAdapter.md +44 -33
  174. package/modules/sonobiBidAdapter.js +17 -10
  175. package/modules/taboolaBidAdapter.js +2 -1
  176. package/modules/tripleliftBidAdapter.js +4 -0
  177. package/modules/vidazooBidAdapter.js +56 -22
  178. package/modules/zeta_global_sspBidAdapter.js +15 -0
  179. package/modules/zeusPrimeRtdProvider.js +3 -323
  180. package/modules/zeusPrimeRtdProvider.md +3 -0
  181. package/package.json +1 -1
  182. package/src/adloader.js +2 -1
  183. package/src/auction.js +2 -11
  184. package/src/prebid.js +8 -0
  185. package/src/utils/cpm.js +17 -0
  186. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  187. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  188. package/test/spec/modules/adyoulikeBidAdapter_spec.js +3 -0
  189. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  190. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  191. package/test/spec/modules/consentManagement_spec.js +49 -1
  192. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  193. package/test/spec/modules/cwireBidAdapter_spec.js +249 -335
  194. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  195. package/test/spec/modules/hadronIdSystem_spec.js +4 -6
  196. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  197. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  198. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  199. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  200. package/test/spec/modules/nexx360BidAdapter_spec.js +0 -4
  201. package/test/spec/modules/onetagBidAdapter_spec.js +43 -0
  202. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  203. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  204. package/test/spec/modules/outbrainBidAdapter_spec.js +182 -18
  205. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  206. package/test/spec/modules/pulsepointBidAdapter_spec.js +11 -1
  207. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  208. package/test/spec/modules/smartadserverBidAdapter_spec.js +116 -5
  209. package/test/spec/modules/smartytechBidAdapter_spec.js +172 -14
  210. package/test/spec/modules/sonobiBidAdapter_spec.js +2 -1
  211. package/test/spec/modules/taboolaBidAdapter_spec.js +12 -3
  212. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  213. package/test/spec/modules/userId_spec.js +19 -14
  214. package/test/spec/modules/vidazooBidAdapter_spec.js +61 -22
  215. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +8 -0
  216. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
  217. package/test/spec/unit/pbjs_api_spec.js +14 -0
  218. package/test/spec/unit/utils/cpm_spec.js +64 -0
  219. package/test/spec/modules/zeusPrimeRtdProvider_spec.js +0 -410
@@ -1,4 +1,5 @@
1
1
  import { expect } from 'chai';
2
+ import { BANNER, VIDEO } from 'src/mediaTypes.js';
2
3
  import { config } from 'src/config.js';
3
4
  import { spec } from 'modules/smartadserverBidAdapter.js';
4
5
 
@@ -394,7 +395,6 @@ describe('Smart bid adapter tests', function () {
394
395
  afterEach(function () {
395
396
  config.setConfig({ ortb2: undefined });
396
397
  config.resetConfig();
397
- $$PREBID_GLOBAL$$.requestBids.removeAll();
398
398
  });
399
399
 
400
400
  it('Verify build request with GDPR', function () {
@@ -443,10 +443,33 @@ describe('Smart bid adapter tests', function () {
443
443
  });
444
444
  });
445
445
 
446
+ describe('GPP', function () {
447
+ it('should be added to payload when gppConsent available in bidder request', function () {
448
+ const options = {
449
+ gppConsent: {
450
+ gppString: 'some-gpp-string',
451
+ applicableSections: [3, 5]
452
+ }
453
+ };
454
+ const request = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL, options);
455
+ const payload = JSON.parse(request[0].data);
456
+
457
+ expect(payload).to.have.property('gpp').and.to.equal(options.gppConsent.gppString);
458
+ expect(payload).to.have.property('gpp_sid').and.to.be.an('array');
459
+ expect(payload.gpp_sid).to.have.lengthOf(2).and.to.deep.equal(options.gppConsent.applicableSections);
460
+ });
461
+
462
+ it('should be undefined on payload when gppConsent unavailable in bidder request', function () {
463
+ const request = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL, {});
464
+ const payload = JSON.parse(request[0].data);
465
+
466
+ expect(payload.gpp).to.be.undefined;
467
+ });
468
+ });
469
+
446
470
  describe('ccpa/us privacy tests', function () {
447
471
  afterEach(function () {
448
472
  config.resetConfig();
449
- $$PREBID_GLOBAL$$.requestBids.removeAll();
450
473
  });
451
474
 
452
475
  it('Verify build request with us privacy', function () {
@@ -475,7 +498,6 @@ describe('Smart bid adapter tests', function () {
475
498
  describe('Instream video tests', function () {
476
499
  afterEach(function () {
477
500
  config.resetConfig();
478
- $$PREBID_GLOBAL$$.requestBids.removeAll();
479
501
  });
480
502
 
481
503
  const INSTREAM_DEFAULT_PARAMS = [{
@@ -746,7 +768,6 @@ describe('Smart bid adapter tests', function () {
746
768
  describe('Outstream video tests', function () {
747
769
  afterEach(function () {
748
770
  config.resetConfig();
749
- $$PREBID_GLOBAL$$.requestBids.removeAll();
750
771
  });
751
772
 
752
773
  const OUTSTREAM_DEFAULT_PARAMS = [{
@@ -1055,6 +1076,17 @@ describe('Smart bid adapter tests', function () {
1055
1076
  });
1056
1077
 
1057
1078
  describe('Floors module', function () {
1079
+ const getFloor = (bid) => {
1080
+ switch (bid.mediaType) {
1081
+ case BANNER:
1082
+ return { currency: 'USD', floor: 1.93 };
1083
+ case VIDEO:
1084
+ return { currency: 'USD', floor: 2.72 };
1085
+ default:
1086
+ return {};
1087
+ }
1088
+ };
1089
+
1058
1090
  it('should include floor from bid params', function() {
1059
1091
  const bidRequest = JSON.parse((spec.buildRequests(DEFAULT_PARAMS))[0].data);
1060
1092
  expect(bidRequest.bidfloor).to.deep.equal(DEFAULT_PARAMS[0].params.bidfloor);
@@ -1094,12 +1126,91 @@ describe('Smart bid adapter tests', function () {
1094
1126
  const floor = spec.getBidFloor(bidRequest, null);
1095
1127
  expect(floor).to.deep.equal(0);
1096
1128
  });
1129
+
1130
+ it('should take floor from bidder params over ad unit', function() {
1131
+ const bidRequest = [{
1132
+ mediaTypes: {
1133
+ banner: {
1134
+ sizes: [[300, 250]]
1135
+ }
1136
+ },
1137
+ getFloor,
1138
+ params: { siteId: 1234, pageId: 678, formatId: 73, bidfloor: 1.25 }
1139
+ }];
1140
+
1141
+ const request = spec.buildRequests(bidRequest);
1142
+ const requestContent = JSON.parse(request[0].data);
1143
+
1144
+ expect(requestContent).to.have.property('bidfloor').and.to.equal(1.25);
1145
+ });
1146
+
1147
+ it('should take floor from banner ad unit', function() {
1148
+ const bidRequest = [{
1149
+ mediaTypes: {
1150
+ banner: {
1151
+ sizes: [[300, 250], [300, 600]]
1152
+ }
1153
+ },
1154
+ getFloor,
1155
+ params: { siteId: 1234, pageId: 678, formatId: 73 }
1156
+ }];
1157
+
1158
+ const request = spec.buildRequests(bidRequest);
1159
+ const requestContent = JSON.parse(request[0].data);
1160
+
1161
+ expect(requestContent).to.have.property('bidfloor').and.to.equal(1.93);
1162
+ });
1163
+
1164
+ it('should take floor from video ad unit', function() {
1165
+ const bidRequest = [{
1166
+ mediaTypes: {
1167
+ video: {
1168
+ context: 'outstream',
1169
+ playerSize: [[640, 480]]
1170
+ }
1171
+ },
1172
+ getFloor,
1173
+ params: { siteId: 1234, pageId: 678, formatId: 73 }
1174
+ }];
1175
+
1176
+ const request = spec.buildRequests(bidRequest);
1177
+ const requestContent = JSON.parse(request[0].data);
1178
+
1179
+ expect(requestContent).to.have.property('bidfloor').and.to.equal(2.72);
1180
+ });
1181
+
1182
+ it('should take floor from multiple media type ad unit', function() {
1183
+ const bidRequest = [{
1184
+ mediaTypes: {
1185
+ banner: {
1186
+ sizes: [[300, 600]]
1187
+ },
1188
+ video: {
1189
+ context: 'outstream',
1190
+ playerSize: [[640, 480]]
1191
+ }
1192
+ },
1193
+ getFloor,
1194
+ params: { siteId: 1234, pageId: 678, formatId: 73 }
1195
+ }];
1196
+
1197
+ const requests = spec.buildRequests(bidRequest);
1198
+ expect(requests).to.have.lengthOf(2);
1199
+
1200
+ const requestContents = requests.map(r => JSON.parse(r.data));
1201
+ const videoRequest = requestContents.filter(r => r.videoData)[0];
1202
+ expect(videoRequest).to.not.equal(null).and.to.not.be.undefined;
1203
+ expect(videoRequest).to.have.property('bidfloor').and.to.equal(2.72);
1204
+
1205
+ const bannerRequest = requestContents.filter(r => !r.videoData)[0];
1206
+ expect(bannerRequest).to.not.equal(null).and.to.not.be.undefined;
1207
+ expect(bannerRequest).to.have.property('bidfloor').and.to.equal(1.93);
1208
+ });
1097
1209
  });
1098
1210
 
1099
1211
  describe('Verify bid requests with multiple mediaTypes', function () {
1100
1212
  afterEach(function () {
1101
1213
  config.resetConfig();
1102
- $$PREBID_GLOBAL$$.requestBids.removeAll();
1103
1214
  });
1104
1215
 
1105
1216
  var DEFAULT_PARAMS_MULTIPLE_MEDIA_TYPES = [{
@@ -19,20 +19,116 @@ describe('SmartyTechDSPAdapter: inherited functions', function () {
19
19
 
20
20
  describe('SmartyTechDSPAdapter: isBidRequestValid', function () {
21
21
  it('Invalid bid request. Should return false', function () {
22
- const invalidBidFixture = {
22
+ const bidFixture = {
23
23
  params: {
24
24
  use_id: 13144375
25
25
  }
26
26
  }
27
- expect(spec.isBidRequestValid(invalidBidFixture)).to.be.false
27
+
28
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
28
29
  });
29
30
  it('Valid bid request. Should return true', function () {
30
- const validBidFixture = {
31
+ const bidFixture = {
31
32
  params: {
32
33
  endpointId: 13144375
33
34
  }
34
35
  }
35
- expect(spec.isBidRequestValid(validBidFixture)).to.be.true
36
+ expect(spec.isBidRequestValid(bidFixture)).to.be.true
37
+ });
38
+
39
+ it('Invalid bid request. Check video block', function () {
40
+ const bidFixture = {
41
+ params: {
42
+ endpointId: 1
43
+ },
44
+ mediaTypes: {
45
+ video: {}
46
+ }
47
+ }
48
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
49
+ });
50
+
51
+ it('Invalid bid request. Check playerSize', function () {
52
+ const bidFixture = {
53
+ params: {
54
+ endpointId: 1
55
+ },
56
+ mediaTypes: {
57
+ video: {
58
+ playerSize: '300x250'
59
+ }
60
+ }
61
+ }
62
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
63
+ });
64
+
65
+ it('Invalid bid request. Check context', function () {
66
+ const bidFixture = {
67
+ params: {
68
+ endpointId: 1
69
+ },
70
+ mediaTypes: {
71
+ video: {
72
+ playerSize: [300, 250]
73
+ }
74
+ }
75
+ }
76
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
77
+ });
78
+
79
+ it('Valid bid request. valid video bid', function () {
80
+ const bidFixture = {
81
+ params: {
82
+ endpointId: 1
83
+ },
84
+ mediaTypes: {
85
+ video: {
86
+ playerSize: [300, 250],
87
+ context: 'instream'
88
+ }
89
+ }
90
+ }
91
+ expect(spec.isBidRequestValid(bidFixture)).to.be.true
92
+ });
93
+
94
+ it('Invalid bid request. Check banner block', function () {
95
+ const bidFixture = {
96
+ params: {
97
+ endpointId: 1
98
+ },
99
+ mediaTypes: {
100
+ banner: {}
101
+ }
102
+ }
103
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
104
+ });
105
+
106
+ it('Invalid bid request. Check banner sizes', function () {
107
+ const bidFixture = {
108
+ params: {
109
+ endpointId: 1
110
+ },
111
+ mediaTypes: {
112
+ banner: {
113
+ sizes: '300x250'
114
+ }
115
+ }
116
+ }
117
+ expect(spec.isBidRequestValid(bidFixture)).to.be.false
118
+ });
119
+
120
+ it('Valid bid request. valid banner bid', function () {
121
+ const bidFixture = {
122
+ params: {
123
+ endpointId: 1
124
+ },
125
+ mediaTypes: {
126
+ banner: {
127
+ sizes: [[300, 250]]
128
+ }
129
+ }
130
+ }
131
+ expect(spec.isBidRequestValid(bidFixture)).to.be.true
36
132
  });
37
133
  });
38
134
 
@@ -42,12 +138,29 @@ function mockRandomSizeArray(len) {
42
138
  });
43
139
  }
44
140
 
45
- function mockBidRequestListData(size) {
141
+ function mockBidRequestListData(mediaType, size) {
46
142
  return Array.apply(null, {length: size}).map((i, index) => {
47
143
  const id = Math.floor(Math.random() * 800) * (index + 1);
144
+ let mediaTypes;
145
+
146
+ if (mediaType == 'video') {
147
+ mediaTypes = {
148
+ video: {
149
+ playerSize: mockRandomSizeArray(1),
150
+ context: 'instream'
151
+ },
152
+ }
153
+ } else {
154
+ mediaTypes = {
155
+ banner: {
156
+ sizes: mockRandomSizeArray(index + 1)
157
+ }
158
+ }
159
+ }
160
+
48
161
  return {
49
162
  adUnitCode: `adUnitCode-${id}`,
50
- sizes: mockRandomSizeArray(index + 1),
163
+ mediaTypes: mediaTypes,
51
164
  bidId: `bidId-${id}`,
52
165
  params: {
53
166
  endpointId: id
@@ -66,18 +179,27 @@ function mockRefererData() {
66
179
 
67
180
  function mockResponseData(requestData) {
68
181
  let data = {}
69
-
70
182
  requestData.data.forEach((request, index) => {
71
- const sizeArrayIndex = Math.floor(Math.random() * (request.sizes.length - 1));
72
183
  const rndIndex = Math.floor(Math.random() * 800);
184
+ let width, height, mediaType;
185
+ if (request.video !== undefined) {
186
+ width = request.video.playerSize[0][0];
187
+ height = request.video.playerSize[0][1];
188
+ mediaType = 'video';
189
+ } else {
190
+ width = request.banner.sizes[0][0];
191
+ height = request.banner.sizes[0][1];
192
+ mediaType = 'banner';
193
+ }
73
194
 
74
195
  data[request.adUnitCode] = {
75
196
  ad: `ad-${rndIndex}`,
76
- width: request.sizes[sizeArrayIndex][0],
77
- height: request.sizes[sizeArrayIndex][1],
197
+ width: width,
198
+ height: height,
78
199
  creativeId: `creative-id-${index}`,
79
200
  cpm: Math.floor(Math.random() * 100),
80
- currency: `UAH-${rndIndex}`
201
+ currency: `UAH-${rndIndex}`,
202
+ mediaType: mediaType
81
203
  };
82
204
  });
83
205
  return {
@@ -89,7 +211,7 @@ describe('SmartyTechDSPAdapter: buildRequests', () => {
89
211
  let mockBidRequest;
90
212
  let mockReferer;
91
213
  beforeEach(() => {
92
- mockBidRequest = mockBidRequestListData(8);
214
+ mockBidRequest = mockBidRequestListData('banner', 8);
93
215
  mockReferer = mockRefererData();
94
216
  });
95
217
  it('has return data', () => {
@@ -108,7 +230,7 @@ describe('SmartyTechDSPAdapter: buildRequests', () => {
108
230
  const data = spec.buildRequests(mockBidRequest, mockReferer).data;
109
231
  data.forEach((request, index) => {
110
232
  expect(request.adUnitCode).to.be.equal(mockBidRequest[index].adUnitCode);
111
- expect(request.sizes).to.be.equal(mockBidRequest[index].sizes);
233
+ expect(request.banner).to.be.equal(mockBidRequest[index].mediaTypes.banner);
112
234
  expect(request.bidId).to.be.equal(mockBidRequest[index].bidId);
113
235
  expect(request.endpointId).to.be.equal(mockBidRequest[index].params.endpointId);
114
236
  expect(request.referer).to.be.equal(mockReferer.refererInfo.page);
@@ -122,7 +244,7 @@ describe('SmartyTechDSPAdapter: interpretResponse', () => {
122
244
  let request;
123
245
  let mockResponse;
124
246
  beforeEach(() => {
125
- const brData = mockBidRequestListData(2);
247
+ const brData = mockBidRequestListData('banner', 2);
126
248
  mockReferer = mockRefererData();
127
249
  request = spec.buildRequests(brData, mockReferer);
128
250
  mockBidRequest = {
@@ -157,6 +279,42 @@ describe('SmartyTechDSPAdapter: interpretResponse', () => {
157
279
  expect(responseItem.requestId).to.be.equal(mockBidRequest.data[index].bidId);
158
280
  expect(responseItem.width).to.be.equal(mockResponse.body[keys[index]].width);
159
281
  expect(responseItem.height).to.be.equal(mockResponse.body[keys[index]].height);
282
+ expect(responseItem.mediaType).to.be.equal(mockResponse.body[keys[index]].mediaType);
283
+ });
284
+ });
285
+ });
286
+
287
+ describe('SmartyTechDSPAdapter: interpretResponse video', () => {
288
+ let mockBidRequest;
289
+ let mockReferer;
290
+ let request;
291
+ let mockResponse;
292
+ beforeEach(() => {
293
+ const brData = mockBidRequestListData('video', 2);
294
+ mockReferer = mockRefererData();
295
+ request = spec.buildRequests(brData, mockReferer);
296
+ mockBidRequest = {
297
+ data: brData
298
+ }
299
+ mockResponse = mockResponseData(request);
300
+ });
301
+
302
+ it('interpretResponse: convert to correct data', () => {
303
+ const keys = Object.keys(mockResponse.body);
304
+ const data = spec.interpretResponse(mockResponse, mockBidRequest);
305
+
306
+ data.forEach((responseItem, index) => {
307
+ expect(responseItem.ad).to.be.equal(mockResponse.body[keys[index]].ad);
308
+ expect(responseItem.cpm).to.be.equal(mockResponse.body[keys[index]].cpm);
309
+ expect(responseItem.creativeId).to.be.equal(mockResponse.body[keys[index]].creativeId);
310
+ expect(responseItem.currency).to.be.equal(mockResponse.body[keys[index]].currency);
311
+ expect(responseItem.netRevenue).to.be.true;
312
+ expect(responseItem.ttl).to.be.equal(60);
313
+ expect(responseItem.requestId).to.be.equal(mockBidRequest.data[index].bidId);
314
+ expect(responseItem.width).to.be.equal(mockResponse.body[keys[index]].width);
315
+ expect(responseItem.height).to.be.equal(mockResponse.body[keys[index]].height);
316
+ expect(responseItem.mediaType).to.be.equal(mockResponse.body[keys[index]].mediaType);
317
+ expect(responseItem.vastXml).to.be.equal(mockResponse.body[keys[index]].ad);
160
318
  });
161
319
  });
162
320
  });
@@ -287,6 +287,7 @@ describe('SonobiBidAdapter', function () {
287
287
  },
288
288
  mediaTypes: {
289
289
  video: {
290
+ sizes: [[300, 250], [300, 600]],
290
291
  context: 'outstream'
291
292
  }
292
293
  }
@@ -331,7 +332,7 @@ describe('SonobiBidAdapter', function () {
331
332
  }];
332
333
 
333
334
  let keyMakerData = {
334
- '30b31c1838de1f': '1a2b3c4d5e6f1a2b3c4d||f=1.25,gpid=/123123/gpt_publisher/adunit-code-1,c=v,',
335
+ '30b31c1838de1f': '1a2b3c4d5e6f1a2b3c4d|300x250,300x600|f=1.25,gpid=/123123/gpt_publisher/adunit-code-1,c=v,',
335
336
  '30b31c1838de1d': '1a2b3c4d5e6f1a2b3c4e|300x250,300x600|f=0.42,gpid=/123123/gpt_publisher/adunit-code-3,c=d,',
336
337
  '/7780971/sparks_prebid_LB|30b31c1838de1e': '300x250,300x600|gpid=/7780971/sparks_prebid_LB,c=d,',
337
338
  };
@@ -460,7 +460,9 @@ describe('Taboola Adapter', function () {
460
460
  'w': 300,
461
461
  'h': 250,
462
462
  'exp': 60,
463
- 'lurl': 'http://us-trc.taboola.com/sample'
463
+ 'lurl': 'http://us-trc.taboola.com/sample',
464
+ 'nurl': 'http://win.example.com/',
465
+
464
466
  }
465
467
  ],
466
468
  'seat': '14204545260'
@@ -546,7 +548,8 @@ describe('Taboola Adapter', function () {
546
548
  'w': 300,
547
549
  'h': 250,
548
550
  'exp': 60,
549
- 'lurl': 'http://us-trc.taboola.com/sample'
551
+ 'lurl': 'http://us-trc.taboola.com/sample',
552
+ 'nurl': 'http://win.example.com/'
550
553
  },
551
554
  {
552
555
  'id': '0b3dd94348-134b-435f-8db5-6bf5afgfc39e86c',
@@ -562,7 +565,9 @@ describe('Taboola Adapter', function () {
562
565
  'w': 300,
563
566
  'h': 250,
564
567
  'exp': 60,
565
- 'lurl': 'http://us-trc.taboola.com/sample'
568
+ 'lurl': 'http://us-trc.taboola.com/sample',
569
+ 'nurl': 'http://win.example.com/'
570
+
566
571
  }
567
572
  ],
568
573
  'seat': '14204545260'
@@ -586,6 +591,7 @@ describe('Taboola Adapter', function () {
586
591
  ad: multiServerResponse.body.seatbid[0].bid[0].adm,
587
592
  width: bid.w,
588
593
  height: bid.h,
594
+ nurl: 'http://win.example.com/',
589
595
  meta: {
590
596
  'advertiserDomains': bid.adomain
591
597
  },
@@ -601,6 +607,7 @@ describe('Taboola Adapter', function () {
601
607
  ad: multiServerResponse.body.seatbid[0].bid[1].adm,
602
608
  width: bid.w,
603
609
  height: bid.h,
610
+ nurl: 'http://win.example.com/',
604
611
  meta: {
605
612
  'advertiserDomains': bid.adomain
606
613
  },
@@ -625,6 +632,7 @@ describe('Taboola Adapter', function () {
625
632
  ad: bid.adm,
626
633
  width: bid.w,
627
634
  height: bid.h,
635
+ nurl: 'http://win.example.com/',
628
636
  meta: {
629
637
  'advertiserDomains': bid.adomain
630
638
  },
@@ -651,6 +659,7 @@ describe('Taboola Adapter', function () {
651
659
  ad: bid.adm,
652
660
  width: bid.w,
653
661
  height: bid.h,
662
+ nurl: 'http://win.example.com/',
654
663
  meta: {
655
664
  'advertiserDomains': bid.adomain
656
665
  },
@@ -1168,6 +1168,19 @@ describe('triplelift adapter', function () {
1168
1168
  }
1169
1169
  })
1170
1170
  });
1171
+ it('should add gpp consent data to bid request object if gpp data exists', function() {
1172
+ bidderRequest.ortb2 = {
1173
+ regs: {
1174
+ 'gpp': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==',
1175
+ 'gpp_sid': [7]
1176
+ }
1177
+ }
1178
+ const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest);
1179
+ expect(request.data.regs).to.deep.equal({
1180
+ 'gpp': 'BOJ/P2HOJ/P2HABABMAAAAAZ+A==',
1181
+ 'gpp_sid': [7]
1182
+ })
1183
+ });
1171
1184
  });
1172
1185
 
1173
1186
  describe('interpretResponse', function () {
@@ -897,7 +897,7 @@ describe('User ID', function () {
897
897
  storage: {name: 'intentIqId', type: 'cookie'}
898
898
  }, {
899
899
  name: 'hadronId',
900
- storage: {name: 'hadronId', type: 'cookie'}
900
+ storage: {name: 'hadronId', type: 'html5'}
901
901
  }, {
902
902
  name: 'zeotapIdPlus'
903
903
  }, {
@@ -1872,8 +1872,8 @@ describe('User ID', function () {
1872
1872
 
1873
1873
  it('test hook from hadronId html5', function (done) {
1874
1874
  // simulate existing browser local storage values
1875
- localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'random-ls-identifier'}));
1876
- localStorage.setItem('hadronId_exp', '');
1875
+ localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
1876
+ localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
1877
1877
 
1878
1878
  init(config);
1879
1879
  setSubmoduleRegistry([hadronIdSubmodule]);
@@ -1883,15 +1883,15 @@ describe('User ID', function () {
1883
1883
  adUnits.forEach(unit => {
1884
1884
  unit.bids.forEach(bid => {
1885
1885
  expect(bid).to.have.deep.nested.property('userId.hadronId');
1886
- expect(bid.userId.hadronId).to.equal('random-ls-identifier');
1886
+ expect(bid.userId.hadronId).to.equal('testHadronId1');
1887
1887
  expect(bid.userIdAsEids[0]).to.deep.equal({
1888
1888
  source: 'audigent.com',
1889
- uids: [{id: 'random-ls-identifier', atype: 1}]
1889
+ uids: [{id: 'testHadronId1', atype: 1}]
1890
1890
  });
1891
1891
  });
1892
1892
  });
1893
1893
  localStorage.removeItem('hadronId');
1894
- localStorage.removeItem('hadronId_exp', '');
1894
+ localStorage.removeItem('hadronId_exp');
1895
1895
  done();
1896
1896
  }, {adUnits});
1897
1897
  });
@@ -2125,7 +2125,9 @@ describe('User ID', function () {
2125
2125
  coreStorage.setCookie('netId', JSON.stringify({'netId': 'testnetId'}), (new Date(Date.now() + 5000).toUTCString()));
2126
2126
  coreStorage.setCookie('intentIqId', 'testintentIqId', (new Date(Date.now() + 5000).toUTCString()));
2127
2127
  coreStorage.setCookie('IDP', btoa(JSON.stringify('zeotapId')), (new Date(Date.now() + 5000).toUTCString()));
2128
- coreStorage.setCookie('hadronId', JSON.stringify({'hadronId': 'testHadronId'}), (new Date(Date.now() + 5000).toUTCString()));
2128
+ // hadronId only supports localStorage
2129
+ localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
2130
+ localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
2129
2131
  coreStorage.setCookie('storage_criteo', JSON.stringify({'criteoId': 'test_bidid'}), (new Date(Date.now() + 5000).toUTCString()));
2130
2132
  coreStorage.setCookie('mwol', JSON.stringify({eid: 'XX-YY-ZZ-123'}), (new Date(Date.now() + 5000).toUTCString()));
2131
2133
  coreStorage.setCookie('uid2id', 'Sample_AD_Token', (new Date(Date.now() + 5000).toUTCString()));
@@ -2149,7 +2151,7 @@ describe('User ID', function () {
2149
2151
  ['netId', 'netId', 'cookie'],
2150
2152
  ['intentIqId', 'intentIqId', 'cookie'],
2151
2153
  ['zeotapIdPlus', 'IDP', 'cookie'],
2152
- ['hadronId', 'hadronId', 'cookie'],
2154
+ ['hadronId', 'hadronId', 'html5'],
2153
2155
  ['criteo', 'storage_criteo', 'cookie'],
2154
2156
  ['mwOpenLinkId', 'mwol', 'cookie'],
2155
2157
  ['tapadId', 'tapad_id', 'cookie'],
@@ -2192,7 +2194,7 @@ describe('User ID', function () {
2192
2194
  expect(bid.userId.IDP).to.equal('zeotapId');
2193
2195
  // also check that hadronId id was copied to bid
2194
2196
  expect(bid).to.have.deep.nested.property('userId.hadronId');
2195
- expect(bid.userId.hadronId).to.equal('testHadronId');
2197
+ expect(bid.userId.hadronId).to.equal('testHadronId1');
2196
2198
  // also check that criteo id was copied to bid
2197
2199
  expect(bid).to.have.deep.nested.property('userId.criteoId');
2198
2200
  expect(bid.userId.criteoId).to.equal('test_bidid');
@@ -2231,7 +2233,8 @@ describe('User ID', function () {
2231
2233
  coreStorage.setCookie('netId', '', EXPIRED_COOKIE_DATE);
2232
2234
  coreStorage.setCookie('intentIqId', '', EXPIRED_COOKIE_DATE);
2233
2235
  coreStorage.setCookie('IDP', '', EXPIRED_COOKIE_DATE);
2234
- coreStorage.setCookie('hadronId', '', EXPIRED_COOKIE_DATE);
2236
+ localStorage.removeItem('hadronId');
2237
+ localStorage.removeItem('hadronId_exp');
2235
2238
  coreStorage.setCookie('storage_criteo', '', EXPIRED_COOKIE_DATE);
2236
2239
  coreStorage.setCookie('mwol', '', EXPIRED_COOKIE_DATE);
2237
2240
  coreStorage.setCookie('uid2id', '', EXPIRED_COOKIE_DATE);
@@ -2284,7 +2287,8 @@ describe('User ID', function () {
2284
2287
  coreStorage.setCookie('netId', JSON.stringify({'netId': 'testnetId'}), new Date(Date.now() + 5000).toUTCString());
2285
2288
  coreStorage.setCookie('intentIqId', 'testintentIqId', (new Date(Date.now() + 5000).toUTCString()));
2286
2289
  coreStorage.setCookie('IDP', btoa(JSON.stringify('zeotapId')), (new Date(Date.now() + 5000).toUTCString()));
2287
- coreStorage.setCookie('hadronId', JSON.stringify({'hadronId': 'testHadronId'}), (new Date(Date.now() + 5000).toUTCString()));
2290
+ localStorage.setItem('hadronId', JSON.stringify({'hadronId': 'testHadronId1'}));
2291
+ localStorage.setItem('hadronId_exp', (new Date(Date.now() + 5000)).toUTCString());
2288
2292
  coreStorage.setCookie('admixerId', 'testadmixerId', new Date(Date.now() + 5000).toUTCString());
2289
2293
  coreStorage.setCookie('deepintentId', 'testdeepintentId', new Date(Date.now() + 5000).toUTCString());
2290
2294
  coreStorage.setCookie('MOCKID', JSON.stringify({'MOCKID': '123456778'}), new Date(Date.now() + 5000).toUTCString());
@@ -2320,7 +2324,7 @@ describe('User ID', function () {
2320
2324
  }, {
2321
2325
  name: 'zeotapIdPlus'
2322
2326
  }, {
2323
- name: 'hadronId', storage: {name: 'hadronId', type: 'cookie'}
2327
+ name: 'hadronId', storage: {name: 'hadronId', type: 'html5'}
2324
2328
  }, {
2325
2329
  name: 'admixerId', storage: {name: 'admixerId', type: 'cookie'}
2326
2330
  }, {
@@ -2388,7 +2392,7 @@ describe('User ID', function () {
2388
2392
  expect(bid.userId.IDP).to.equal('zeotapId');
2389
2393
  // also check that hadronId id data was copied to bid
2390
2394
  expect(bid).to.have.deep.nested.property('userId.hadronId');
2391
- expect(bid.userId.hadronId).to.equal('testHadronId');
2395
+ expect(bid.userId.hadronId).to.equal('testHadronId1');
2392
2396
  expect(bid.userId.uid2).to.deep.equal({
2393
2397
  id: 'Sample_AD_Token'
2394
2398
  });
@@ -2420,7 +2424,8 @@ describe('User ID', function () {
2420
2424
  coreStorage.setCookie('netId', '', EXPIRED_COOKIE_DATE);
2421
2425
  coreStorage.setCookie('intentIqId', '', EXPIRED_COOKIE_DATE);
2422
2426
  coreStorage.setCookie('IDP', '', EXPIRED_COOKIE_DATE);
2423
- coreStorage.setCookie('hadronId', '', EXPIRED_COOKIE_DATE);
2427
+ localStorage.removeItem('hadronId');
2428
+ localStorage.removeItem('hadronId_exp');
2424
2429
  coreStorage.setCookie('dmdId', '', EXPIRED_COOKIE_DATE);
2425
2430
  coreStorage.setCookie('admixerId', '', EXPIRED_COOKIE_DATE);
2426
2431
  coreStorage.setCookie('deepintentId', '', EXPIRED_COOKIE_DATE);