prebid.js 7.3.0 → 7.6.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 (225) hide show
  1. package/.circleci/config.yml +11 -6
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/adnuntiusBidAdapter.js +1 -1
  7. package/dist/adotBidAdapter.js +1 -1
  8. package/dist/adpod.js +1 -1
  9. package/dist/adrelevantisBidAdapter.js +1 -1
  10. package/dist/adrinoBidAdapter.js +1 -1
  11. package/dist/adtelligentBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/asoBidAdapter.js +1 -1
  19. package/dist/atsAnalyticsAdapter.js +1 -1
  20. package/dist/axonixBidAdapter.js +1 -1
  21. package/dist/bidglassBidAdapter.js +1 -1
  22. package/dist/big-richmediaBidAdapter.js +1 -1
  23. package/dist/bridgewellBidAdapter.js +1 -1
  24. package/dist/brightMountainMediaBidAdapter.js +1 -1
  25. package/dist/byDataAnalyticsAdapter.js +1 -1
  26. package/dist/concertBidAdapter.js +1 -1
  27. package/dist/connectadBidAdapter.js +1 -1
  28. package/dist/consumableBidAdapter.js +1 -1
  29. package/dist/conversantBidAdapter.js +1 -1
  30. package/dist/craftBidAdapter.js +1 -1
  31. package/dist/criteoBidAdapter.js +1 -1
  32. package/dist/debugging-standalone.js +1 -1
  33. package/dist/debugging.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/finativeBidAdapter.js +1 -1
  37. package/dist/gdprEnforcement.js +1 -1
  38. package/dist/glimpseBidAdapter.js +1 -1
  39. package/dist/gmosspBidAdapter.js +1 -1
  40. package/dist/goldbachBidAdapter.js +1 -1
  41. package/dist/gridBidAdapter.js +1 -1
  42. package/dist/gridNMBidAdapter.js +1 -1
  43. package/dist/gumgumBidAdapter.js +1 -1
  44. package/dist/h12mediaBidAdapter.js +1 -1
  45. package/dist/hadronIdSystem.js +1 -1
  46. package/dist/hadronRtdProvider.js +1 -1
  47. package/dist/id5IdSystem.js +1 -1
  48. package/dist/imRtdProvider.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoAnalyticsAdapter.js +1 -1
  55. package/dist/kargoBidAdapter.js +1 -1
  56. package/dist/konduitAnalyticsAdapter.js +1 -1
  57. package/dist/kueezBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  60. package/dist/logicadBidAdapter.js +1 -1
  61. package/dist/loglyliftBidAdapter.js +1 -1
  62. package/dist/malltvAnalyticsAdapter.js +1 -1
  63. package/dist/marsmediaBidAdapter.js +1 -1
  64. package/dist/mediafuseBidAdapter.js +1 -1
  65. package/dist/mediasquareBidAdapter.js +1 -1
  66. package/dist/mgidBidAdapter.js +1 -1
  67. package/dist/minutemediaBidAdapter.js +1 -1
  68. package/dist/missenaBidAdapter.js +1 -1
  69. package/dist/newspassidBidAdapter.js +1 -0
  70. package/dist/nextMillenniumBidAdapter.js +1 -1
  71. package/dist/not-for-prod/prebid.js +131 -127
  72. package/dist/oguryBidAdapter.js +1 -1
  73. package/dist/onetagBidAdapter.js +1 -1
  74. package/dist/ooloAnalyticsAdapter.js +1 -1
  75. package/dist/openxOrtbBidAdapter.js +1 -0
  76. package/dist/outbrainBidAdapter.js +1 -1
  77. package/dist/parrableIdSystem.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +2 -2
  80. package/dist/priceFloors.js +1 -1
  81. package/dist/pubCommonId.js +1 -1
  82. package/dist/publinkIdSystem.js +1 -1
  83. package/dist/pubmaticBidAdapter.js +1 -1
  84. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  85. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  86. package/dist/pxyzBidAdapter.js +1 -1
  87. package/dist/quantcastBidAdapter.js +1 -1
  88. package/dist/rasBidAdapter.js +1 -0
  89. package/dist/readpeakBidAdapter.js +1 -1
  90. package/dist/relaidoBidAdapter.js +1 -1
  91. package/dist/rhythmoneBidAdapter.js +1 -1
  92. package/dist/riseBidAdapter.js +1 -1
  93. package/dist/rubiconAnalyticsAdapter.js +1 -1
  94. package/dist/rubiconBidAdapter.js +1 -1
  95. package/dist/seedingAllianceBidAdapter.js +1 -1
  96. package/dist/seedtagBidAdapter.js +1 -1
  97. package/dist/sharedIdSystem.js +1 -1
  98. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  99. package/dist/sharethroughBidAdapter.js +1 -1
  100. package/dist/shinezBidAdapter.js +1 -0
  101. package/dist/sizeMappingV2.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/taboolaBidAdapter.js +1 -1
  113. package/dist/targetVideoBidAdapter.js +1 -1
  114. package/dist/teadsBidAdapter.js +1 -1
  115. package/dist/trionBidAdapter.js +1 -1
  116. package/dist/tripleliftBidAdapter.js +1 -1
  117. package/dist/ttdBidAdapter.js +1 -1
  118. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/ventesBidAdapter.js +1 -1
  122. package/dist/vidazooBidAdapter.js +1 -1
  123. package/dist/videobyteBidAdapter.js +1 -1
  124. package/dist/visxBidAdapter.js +1 -1
  125. package/dist/vrtcalBidAdapter.js +1 -1
  126. package/dist/vuukleBidAdapter.js +1 -1
  127. package/dist/widespaceBidAdapter.js +1 -1
  128. package/dist/winrBidAdapter.js +1 -1
  129. package/dist/yahoosspBidAdapter.js +1 -1
  130. package/dist/yieldmoBidAdapter.js +1 -1
  131. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  132. package/gulpfile.js +1 -1
  133. package/karma.conf.maker.js +3 -1
  134. package/modules/adgenerationBidAdapter.js +24 -1
  135. package/modules/adnuntiusBidAdapter.js +26 -8
  136. package/modules/adotBidAdapter.js +13 -4
  137. package/modules/adrinoBidAdapter.js +10 -2
  138. package/modules/adrinoBidAdapter.md +6 -0
  139. package/modules/adtelligentBidAdapter.js +2 -1
  140. package/modules/appnexusBidAdapter.js +3 -3
  141. package/modules/atsAnalyticsAdapter.js +4 -5
  142. package/modules/byDataAnalyticsAdapter.js +172 -74
  143. package/modules/byDataAnalyticsAdapter.md +5 -6
  144. package/modules/consumableBidAdapter.js +12 -1
  145. package/modules/criteoBidAdapter.js +7 -1
  146. package/modules/cwireBidAdapter.md +1 -1
  147. package/modules/debugging/bidInterceptor.js +1 -1
  148. package/modules/debugging/index.js +2 -1
  149. package/modules/eplanningBidAdapter.js +82 -97
  150. package/modules/gdprEnforcement.js +8 -14
  151. package/modules/gridNMBidAdapter.js +45 -4
  152. package/modules/hadronAnalyticsAdapter.md +5 -5
  153. package/modules/hadronIdSystem.js +18 -5
  154. package/modules/hadronIdSystem.md +15 -11
  155. package/modules/hadronRtdProvider.js +14 -1
  156. package/modules/hadronRtdProvider.md +17 -13
  157. package/modules/imRtdProvider.js +0 -8
  158. package/modules/insticatorBidAdapter.js +9 -0
  159. package/modules/ixBidAdapter.js +462 -58
  160. package/modules/ixBidAdapter.md +95 -5
  161. package/modules/kargoAnalyticsAdapter.js +88 -6
  162. package/modules/kargoAnalyticsAdapter.md +33 -0
  163. package/modules/kargoBidAdapter.js +1 -2
  164. package/modules/minutemediaBidAdapter.js +1 -0
  165. package/modules/missenaBidAdapter.js +20 -2
  166. package/modules/newspassidBidAdapter.js +649 -0
  167. package/modules/nextMillenniumBidAdapter.js +17 -1
  168. package/modules/oguryBidAdapter.js +2 -0
  169. package/modules/openxBidAdapter.md +3 -1
  170. package/modules/openxOrtbBidAdapter.js +349 -0
  171. package/modules/openxOrtbBidAdapter.md +105 -0
  172. package/modules/priceFloors.js +1 -1
  173. package/modules/pubCommonId.js +1 -2
  174. package/modules/pubxaiAnalyticsAdapter.js +6 -1
  175. package/modules/rasBidAdapter.js +149 -0
  176. package/modules/rasBidAdapter.md +50 -0
  177. package/modules/readpeakBidAdapter.js +15 -6
  178. package/modules/relaidoBidAdapter.js +19 -4
  179. package/modules/seedtagBidAdapter.js +37 -1
  180. package/modules/sharedIdSystem.js +11 -5
  181. package/modules/sharethroughBidAdapter.js +9 -24
  182. package/modules/shinezBidAdapter.js +435 -0
  183. package/modules/shinezBidAdapter.md +76 -0
  184. package/modules/taboolaBidAdapter.js +1 -1
  185. package/modules/taboolaBidAdapter.md +3 -3
  186. package/modules/ventesBidAdapter.js +1 -1
  187. package/modules/ventesBidAdapter.md +1 -1
  188. package/modules/vrtcalBidAdapter.js +35 -0
  189. package/package.json +1 -1
  190. package/plugins/pbjsGlobals.js +2 -1
  191. package/src/storageManager.js +4 -5
  192. package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -4
  193. package/test/spec/modules/adnuntiusBidAdapter_spec.js +126 -14
  194. package/test/spec/modules/adotBidAdapter_spec.js +12 -9
  195. package/test/spec/modules/adrinoBidAdapter_spec.js +22 -0
  196. package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
  197. package/test/spec/modules/byDataAnalyticsAdapter_spec.js +74 -24
  198. package/test/spec/modules/consumableBidAdapter_spec.js +75 -0
  199. package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
  200. package/test/spec/modules/debugging_mod_spec.js +7 -0
  201. package/test/spec/modules/eplanningBidAdapter_spec.js +58 -18
  202. package/test/spec/modules/gdprEnforcement_spec.js +53 -100
  203. package/test/spec/modules/gridNMBidAdapter_spec.js +32 -0
  204. package/test/spec/modules/hadronIdSystem_spec.js +2 -2
  205. package/test/spec/modules/imRtdProvider_spec.js +0 -1
  206. package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
  207. package/test/spec/modules/ixBidAdapter_spec.js +470 -10
  208. package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
  209. package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
  210. package/test/spec/modules/minutemediaBidAdapter_spec.js +3 -0
  211. package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
  212. package/test/spec/modules/newspassidBidAdapter_spec.js +1793 -0
  213. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +20 -0
  214. package/test/spec/modules/openxOrtbBidAdapter_spec.js +1303 -0
  215. package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +5 -0
  216. package/test/spec/modules/rasBidAdapter_spec.js +190 -0
  217. package/test/spec/modules/readpeakBidAdapter_spec.js +1 -0
  218. package/test/spec/modules/relaidoBidAdapter_spec.js +29 -2
  219. package/test/spec/modules/seedtagBidAdapter_spec.js +29 -0
  220. package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
  221. package/test/spec/modules/shinezBidAdapter_spec.js +479 -0
  222. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  223. package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
  224. package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -0
  225. package/webpack.conf.js +1 -1
@@ -0,0 +1,479 @@
1
+ import { expect } from 'chai';
2
+ import { spec } from 'modules/shinezBidAdapter.js';
3
+ import { newBidder } from 'src/adapters/bidderFactory.js';
4
+ import { config } from 'src/config.js';
5
+ import { BANNER, VIDEO } from '../../../src/mediaTypes.js';
6
+ import * as utils from 'src/utils.js';
7
+
8
+ const ENDPOINT = 'https://hb.sweetgum.io/hb-sz-multi';
9
+ const TEST_ENDPOINT = 'https://hb.sweetgum.io/hb-multi-sz-test';
10
+ const TTL = 360;
11
+ /* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
12
+
13
+ describe('shinezAdapter', function () {
14
+ const adapter = newBidder(spec);
15
+
16
+ describe('inherited functions', function () {
17
+ it('exists and is a function', function () {
18
+ expect(adapter.callBids).to.exist.and.to.be.a('function');
19
+ });
20
+ });
21
+
22
+ describe('isBidRequestValid', function () {
23
+ const bid = {
24
+ 'bidder': spec.code,
25
+ 'adUnitCode': 'adunit-code',
26
+ 'sizes': [['640', '480']],
27
+ 'params': {
28
+ 'org': 'jdye8weeyirk00000001'
29
+ }
30
+ };
31
+
32
+ it('should return true when required params are passed', function () {
33
+ expect(spec.isBidRequestValid(bid)).to.equal(true);
34
+ });
35
+
36
+ it('should return false when required params are not found', function () {
37
+ const newBid = Object.assign({}, bid);
38
+ delete newBid.params;
39
+ newBid.params = {
40
+ 'org': null
41
+ };
42
+ expect(spec.isBidRequestValid(newBid)).to.equal(false);
43
+ });
44
+ });
45
+
46
+ describe('buildRequests', function () {
47
+ const bidRequests = [
48
+ {
49
+ 'bidder': spec.code,
50
+ 'adUnitCode': 'adunit-code',
51
+ 'sizes': [[640, 480]],
52
+ 'params': {
53
+ 'org': 'jdye8weeyirk00000001'
54
+ },
55
+ 'bidId': '299ffc8cca0b87',
56
+ 'bidderRequestId': '1144f487e563f9',
57
+ 'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
58
+ 'mediaTypes': {
59
+ 'video': {
60
+ 'playerSize': [[640, 480]],
61
+ 'context': 'instream'
62
+ }
63
+ },
64
+ 'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
65
+ },
66
+ {
67
+ 'bidder': spec.code,
68
+ 'adUnitCode': 'adunit-code',
69
+ 'sizes': [[300, 250]],
70
+ 'params': {
71
+ 'org': 'jdye8weeyirk00000001'
72
+ },
73
+ 'bidId': '299ffc8cca0b87',
74
+ 'bidderRequestId': '1144f487e563f9',
75
+ 'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
76
+ 'mediaTypes': {
77
+ 'banner': {
78
+ }
79
+ },
80
+ 'ad': '"<img src=\"https://...\"/>"'
81
+ }
82
+ ];
83
+
84
+ const testModeBidRequests = [
85
+ {
86
+ 'bidder': spec.code,
87
+ 'adUnitCode': 'adunit-code',
88
+ 'sizes': [[640, 480]],
89
+ 'params': {
90
+ 'org': 'jdye8weeyirk00000001',
91
+ 'testMode': true
92
+ },
93
+ 'bidId': '299ffc8cca0b87',
94
+ 'bidderRequestId': '1144f487e563f9',
95
+ 'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
96
+ }
97
+ ];
98
+
99
+ const bidderRequest = {
100
+ bidderCode: 'shinez',
101
+ }
102
+ const placementId = '12345678';
103
+
104
+ it('sends the placementId to ENDPOINT via POST', function () {
105
+ bidRequests[0].params.placementId = placementId;
106
+ const request = spec.buildRequests(bidRequests, bidderRequest);
107
+ expect(request.data.bids[0].placementId).to.equal(placementId);
108
+ });
109
+
110
+ it('sends bid request to ENDPOINT via POST', function () {
111
+ const request = spec.buildRequests(bidRequests, bidderRequest);
112
+ expect(request.url).to.equal(ENDPOINT);
113
+ expect(request.method).to.equal('POST');
114
+ });
115
+
116
+ it('sends bid request to TEST ENDPOINT via POST', function () {
117
+ const request = spec.buildRequests(testModeBidRequests, bidderRequest);
118
+ expect(request.url).to.equal(TEST_ENDPOINT);
119
+ expect(request.method).to.equal('POST');
120
+ });
121
+
122
+ it('should send the correct bid Id', function () {
123
+ const request = spec.buildRequests(bidRequests, bidderRequest);
124
+ expect(request.data.bids[0].bidId).to.equal('299ffc8cca0b87');
125
+ });
126
+
127
+ it('should send the correct sizes array', function () {
128
+ const request = spec.buildRequests(bidRequests, bidderRequest);
129
+ expect(request.data.bids[0].sizes).to.be.an('array');
130
+ expect(request.data.bids[0].sizes).to.equal(bidRequests[0].sizes)
131
+ expect(request.data.bids[1].sizes).to.be.an('array');
132
+ expect(request.data.bids[1].sizes).to.equal(bidRequests[1].sizes)
133
+ });
134
+
135
+ it('should send the correct media type', function () {
136
+ const request = spec.buildRequests(bidRequests, bidderRequest);
137
+ expect(request.data.bids[0].mediaType).to.equal(VIDEO)
138
+ expect(request.data.bids[1].mediaType).to.equal(BANNER)
139
+ });
140
+
141
+ it('should respect syncEnabled option', function() {
142
+ config.setConfig({
143
+ userSync: {
144
+ syncEnabled: false,
145
+ filterSettings: {
146
+ all: {
147
+ bidders: '*',
148
+ filter: 'include'
149
+ }
150
+ }
151
+ }
152
+ });
153
+ const request = spec.buildRequests(bidRequests, bidderRequest);
154
+ expect(request.data.params).to.be.an('object');
155
+ expect(request.data.params).to.not.have.property('cs_method');
156
+ });
157
+
158
+ it('should respect "iframe" filter settings', function () {
159
+ config.setConfig({
160
+ userSync: {
161
+ syncEnabled: true,
162
+ filterSettings: {
163
+ iframe: {
164
+ bidders: [spec.code],
165
+ filter: 'include'
166
+ }
167
+ }
168
+ }
169
+ });
170
+ const request = spec.buildRequests(bidRequests, bidderRequest);
171
+ expect(request.data.params).to.be.an('object');
172
+ expect(request.data.params).to.have.property('cs_method', 'iframe');
173
+ });
174
+
175
+ it('should respect "all" filter settings', function () {
176
+ config.setConfig({
177
+ userSync: {
178
+ syncEnabled: true,
179
+ filterSettings: {
180
+ all: {
181
+ bidders: [spec.code],
182
+ filter: 'include'
183
+ }
184
+ }
185
+ }
186
+ });
187
+ const request = spec.buildRequests(bidRequests, bidderRequest);
188
+ expect(request.data.params).to.be.an('object');
189
+ expect(request.data.params).to.have.property('cs_method', 'iframe');
190
+ });
191
+
192
+ it('should send the pixel user sync param if userSync is enabled and no "iframe" or "all" configs are present', function () {
193
+ config.resetConfig();
194
+ config.setConfig({
195
+ userSync: {
196
+ syncEnabled: true,
197
+ }
198
+ });
199
+ const request = spec.buildRequests(bidRequests, bidderRequest);
200
+ expect(request.data.params).to.be.an('object');
201
+ expect(request.data.params).to.have.property('cs_method', 'pixel');
202
+ });
203
+
204
+ it('should respect total exclusion', function() {
205
+ config.setConfig({
206
+ userSync: {
207
+ syncEnabled: true,
208
+ filterSettings: {
209
+ image: {
210
+ bidders: [spec.code],
211
+ filter: 'exclude'
212
+ },
213
+ iframe: {
214
+ bidders: [spec.code],
215
+ filter: 'exclude'
216
+ }
217
+ }
218
+ }
219
+ });
220
+ const request = spec.buildRequests(bidRequests, bidderRequest);
221
+ expect(request.data.params).to.be.an('object');
222
+ expect(request.data.params).to.not.have.property('cs_method');
223
+ });
224
+
225
+ it('should have us_privacy param if usPrivacy is available in the bidRequest', function () {
226
+ const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
227
+ const request = spec.buildRequests(bidRequests, bidderRequestWithUSP);
228
+ expect(request.data.params).to.be.an('object');
229
+ expect(request.data.params).to.have.property('us_privacy', '1YNN');
230
+ });
231
+
232
+ it('should have an empty us_privacy param if usPrivacy is missing in the bidRequest', function () {
233
+ const request = spec.buildRequests(bidRequests, bidderRequest);
234
+ expect(request.data.params).to.be.an('object');
235
+ expect(request.data.params).to.not.have.property('us_privacy');
236
+ });
237
+
238
+ it('should not send the gdpr param if gdprApplies is false in the bidRequest', function () {
239
+ const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: false}}, bidderRequest);
240
+ const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
241
+ expect(request.data.params).to.be.an('object');
242
+ expect(request.data.params).to.not.have.property('gdpr');
243
+ expect(request.data.params).to.not.have.property('gdpr_consent');
244
+ });
245
+
246
+ it('should send the gdpr param if gdprApplies is true in the bidRequest', function () {
247
+ const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: true, consentString: 'test-consent-string'}}, bidderRequest);
248
+ const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
249
+ expect(request.data.params).to.be.an('object');
250
+ expect(request.data.params).to.have.property('gdpr', true);
251
+ expect(request.data.params).to.have.property('gdpr_consent', 'test-consent-string');
252
+ });
253
+
254
+ it('should have schain param if it is available in the bidRequest', () => {
255
+ const schain = {
256
+ ver: '1.0',
257
+ complete: 1,
258
+ nodes: [{ asi: 'indirectseller.com', sid: '00001', hp: 1 }],
259
+ };
260
+ bidRequests[0].schain = schain;
261
+ const request = spec.buildRequests(bidRequests, bidderRequest);
262
+ expect(request.data.params).to.be.an('object');
263
+ expect(request.data.params).to.have.property('schain', '1.0,1!indirectseller.com,00001,1,,,');
264
+ });
265
+
266
+ it('should set flooPrice to getFloor.floor value if it is greater than params.floorPrice', function() {
267
+ const bid = utils.deepClone(bidRequests[0]);
268
+ bid.getFloor = () => {
269
+ return {
270
+ currency: 'USD',
271
+ floor: 3.32
272
+ }
273
+ }
274
+ bid.params.floorPrice = 0.64;
275
+ const request = spec.buildRequests([bid], bidderRequest);
276
+ expect(request.data.bids[0]).to.be.an('object');
277
+ expect(request.data.bids[0]).to.have.property('floorPrice', 3.32);
278
+ });
279
+
280
+ it('should set floorPrice to params.floorPrice value if it is greater than getFloor.floor', function() {
281
+ const bid = utils.deepClone(bidRequests[0]);
282
+ bid.getFloor = () => {
283
+ return {
284
+ currency: 'USD',
285
+ floor: 0.8
286
+ }
287
+ }
288
+ bid.params.floorPrice = 1.5;
289
+ const request = spec.buildRequests([bid], bidderRequest);
290
+ expect(request.data.bids[0]).to.be.an('object');
291
+ expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
292
+ });
293
+ });
294
+
295
+ describe('interpretResponse', function () {
296
+ const response = {
297
+ params: {
298
+ currency: 'USD',
299
+ netRevenue: true,
300
+ },
301
+ bids: [{
302
+ cpm: 12.5,
303
+ vastXml: '<VAST version="3.0"></VAST>',
304
+ width: 640,
305
+ height: 480,
306
+ requestId: '21e12606d47ba7',
307
+ adomain: ['abc.com'],
308
+ mediaType: VIDEO
309
+ },
310
+ {
311
+ cpm: 12.5,
312
+ ad: '"<img src=\"https://...\"/>"',
313
+ width: 300,
314
+ height: 250,
315
+ requestId: '21e12606d47ba7',
316
+ adomain: ['abc.com'],
317
+ mediaType: BANNER
318
+ }]
319
+ };
320
+
321
+ const expectedVideoResponse = {
322
+ requestId: '21e12606d47ba7',
323
+ cpm: 12.5,
324
+ currency: 'USD',
325
+ width: 640,
326
+ height: 480,
327
+ ttl: TTL,
328
+ creativeId: '21e12606d47ba7',
329
+ netRevenue: true,
330
+ nurl: 'http://example.com/win/1234',
331
+ mediaType: VIDEO,
332
+ meta: {
333
+ mediaType: VIDEO,
334
+ advertiserDomains: ['abc.com']
335
+ },
336
+ vastXml: '<VAST version="3.0"></VAST>',
337
+ };
338
+
339
+ const expectedBannerResponse = {
340
+ requestId: '21e12606d47ba7',
341
+ cpm: 12.5,
342
+ currency: 'USD',
343
+ width: 640,
344
+ height: 480,
345
+ ttl: TTL,
346
+ creativeId: '21e12606d47ba7',
347
+ netRevenue: true,
348
+ nurl: 'http://example.com/win/1234',
349
+ mediaType: BANNER,
350
+ meta: {
351
+ mediaType: BANNER,
352
+ advertiserDomains: ['abc.com']
353
+ },
354
+ ad: '"<img src=\"https://...\"/>"'
355
+ };
356
+
357
+ it('should get correct bid response', function () {
358
+ const result = spec.interpretResponse({ body: response });
359
+ expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedVideoResponse));
360
+ expect(Object.keys(result[1])).to.deep.equal(Object.keys(expectedBannerResponse));
361
+ });
362
+
363
+ it('video type should have vastXml key', function () {
364
+ const result = spec.interpretResponse({ body: response });
365
+ expect(result[0].vastXml).to.equal(expectedVideoResponse.vastXml)
366
+ });
367
+
368
+ it('banner type should have ad key', function () {
369
+ const result = spec.interpretResponse({ body: response });
370
+ expect(result[1].ad).to.equal(expectedBannerResponse.ad)
371
+ });
372
+ })
373
+
374
+ describe('getUserSyncs', function() {
375
+ const imageSyncResponse = {
376
+ body: {
377
+ params: {
378
+ userSyncPixels: [
379
+ 'https://image-sync-url.test/1',
380
+ 'https://image-sync-url.test/2',
381
+ 'https://image-sync-url.test/3'
382
+ ]
383
+ }
384
+ }
385
+ };
386
+
387
+ const iframeSyncResponse = {
388
+ body: {
389
+ params: {
390
+ userSyncURL: 'https://iframe-sync-url.test'
391
+ }
392
+ }
393
+ };
394
+
395
+ it('should register all img urls from the response', function() {
396
+ const syncs = spec.getUserSyncs({ pixelEnabled: true }, [imageSyncResponse]);
397
+ expect(syncs).to.deep.equal([
398
+ {
399
+ type: 'image',
400
+ url: 'https://image-sync-url.test/1'
401
+ },
402
+ {
403
+ type: 'image',
404
+ url: 'https://image-sync-url.test/2'
405
+ },
406
+ {
407
+ type: 'image',
408
+ url: 'https://image-sync-url.test/3'
409
+ }
410
+ ]);
411
+ });
412
+
413
+ it('should register the iframe url from the response', function() {
414
+ const syncs = spec.getUserSyncs({ iframeEnabled: true }, [iframeSyncResponse]);
415
+ expect(syncs).to.deep.equal([
416
+ {
417
+ type: 'iframe',
418
+ url: 'https://iframe-sync-url.test'
419
+ }
420
+ ]);
421
+ });
422
+
423
+ it('should register both image and iframe urls from the responses', function() {
424
+ const syncs = spec.getUserSyncs({ pixelEnabled: true, iframeEnabled: true }, [iframeSyncResponse, imageSyncResponse]);
425
+ expect(syncs).to.deep.equal([
426
+ {
427
+ type: 'iframe',
428
+ url: 'https://iframe-sync-url.test'
429
+ },
430
+ {
431
+ type: 'image',
432
+ url: 'https://image-sync-url.test/1'
433
+ },
434
+ {
435
+ type: 'image',
436
+ url: 'https://image-sync-url.test/2'
437
+ },
438
+ {
439
+ type: 'image',
440
+ url: 'https://image-sync-url.test/3'
441
+ }
442
+ ]);
443
+ });
444
+
445
+ it('should handle an empty response', function() {
446
+ const syncs = spec.getUserSyncs({ iframeEnabled: true }, []);
447
+ expect(syncs).to.deep.equal([]);
448
+ });
449
+
450
+ it('should handle when user syncs are disabled', function() {
451
+ const syncs = spec.getUserSyncs({ pixelEnabled: false }, [imageSyncResponse]);
452
+ expect(syncs).to.deep.equal([]);
453
+ });
454
+ })
455
+
456
+ describe('onBidWon', function() {
457
+ beforeEach(function() {
458
+ sinon.stub(utils, 'triggerPixel');
459
+ });
460
+ afterEach(function() {
461
+ utils.triggerPixel.restore();
462
+ });
463
+
464
+ it('Should trigger pixel if bid nurl', function() {
465
+ const bid = {
466
+ 'bidder': spec.code,
467
+ 'adUnitCode': 'adunit-code',
468
+ 'sizes': [['640', '480']],
469
+ 'nurl': 'http://example.com/win/1234',
470
+ 'params': {
471
+ 'org': 'jdye8weeyirk00000001'
472
+ }
473
+ };
474
+
475
+ spec.onBidWon(bid);
476
+ expect(utils.triggerPixel.callCount).to.equal(1)
477
+ })
478
+ })
479
+ });
@@ -370,7 +370,7 @@ describe('Taboola Adapter', function () {
370
370
  requestId: request.bids[0].bidId,
371
371
  cpm: bid.price,
372
372
  creativeId: bid.crid,
373
- ttl: 360,
373
+ ttl: 60,
374
374
  netRevenue: false,
375
375
  currency: serverResponse.body.cur,
376
376
  mediaType: 'banner',
@@ -2,7 +2,7 @@ import { expect } from 'chai';
2
2
  import * as utils from 'src/utils.js';
3
3
  import { spec } from 'modules/ventesBidAdapter.js';
4
4
 
5
- const BIDDER_URL = 'http://13.234.201.146:8088/va/ad';
5
+ const BIDDER_URL = 'https://ad.ventesavenues.in/va/ad';
6
6
 
7
7
  describe('Ventes Adapter', function () {
8
8
  const examples = {
@@ -35,7 +35,7 @@ describe('Ventes Adapter', function () {
35
35
 
36
36
  serverRequest_banner: {
37
37
  method: 'POST',
38
- url: 'http://13.234.201.146:8088/va/ad',
38
+ url: BIDDER_URL,
39
39
  data: {
40
40
  id: 'bid_request_id',
41
41
  imp: [
@@ -1,6 +1,7 @@
1
1
  import { expect } from 'chai'
2
2
  import { spec } from 'modules/vrtcalBidAdapter'
3
3
  import { newBidder } from 'src/adapters/bidderFactory'
4
+ import { config } from 'src/config.js';
4
5
 
5
6
  describe('vrtcalBidAdapter', function () {
6
7
  const adapter = newBidder(spec)
@@ -50,6 +51,22 @@ describe('vrtcalBidAdapter', function () {
50
51
  request = spec.buildRequests(bidRequests);
51
52
  expect(request[0].data).to.match(/"bidfloor":0.55/);
52
53
  });
54
+
55
+ it('pass GDPR,CCPA, and COPPA indicators/consent strings with the request when present', function () {
56
+ bidRequests[0].gdprConsent = {consentString: 'gdpr-consent-string', gdprApplies: true};
57
+ bidRequests[0].uspConsent = 'ccpa-consent-string';
58
+ config.setConfig({ coppa: false });
59
+
60
+ request = spec.buildRequests(bidRequests);
61
+ expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"}}/);
62
+ expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string"}}/);
63
+ });
64
+
65
+ it('pass bidder timeout/tmax with the request', function () {
66
+ config.setConfig({ bidderTimeout: 435 });
67
+ request = spec.buildRequests(bidRequests);
68
+ expect(request[0].data).to.match(/"tmax":435/);
69
+ });
53
70
  });
54
71
 
55
72
  describe('interpretResponse', function () {
package/webpack.conf.js CHANGED
@@ -5,7 +5,7 @@ var webpack = require('webpack');
5
5
  var helpers = require('./gulpHelpers.js');
6
6
  var { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
7
7
  var argv = require('yargs').argv;
8
- const babelConfig = require('./babelConfig.js')({disableFeatures: helpers.getDisabledFeatures()});
8
+ const babelConfig = require('./babelConfig.js')({disableFeatures: helpers.getDisabledFeatures(), prebidDistUrlBase: argv.distUrlBase});
9
9
 
10
10
  var plugins = [
11
11
  new webpack.EnvironmentPlugin({'LiveConnectMode': null}),