prebid.js 6.26.0 → 6.27.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 (188) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adWMGAnalyticsAdapter.js +1 -1
  3. package/dist/adagioAnalyticsAdapter.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/adkernelAdnAnalyticsAdapter.js +1 -1
  8. package/dist/adlooxAdServerVideo.js +1 -1
  9. package/dist/adlooxAnalyticsAdapter.js +1 -1
  10. package/dist/adlooxRtdProvider.js +1 -1
  11. package/dist/adomikAnalyticsAdapter.js +1 -1
  12. package/dist/adrelevantisBidAdapter.js +1 -1
  13. package/dist/adxcgAnalyticsAdapter.js +1 -1
  14. package/dist/adxcgBidAdapter.js +1 -1
  15. package/dist/adxpremiumAnalyticsAdapter.js +1 -1
  16. package/dist/ajaBidAdapter.js +1 -1
  17. package/dist/akamaiDapRtdProvider.js +1 -1
  18. package/dist/amxBidAdapter.js +1 -1
  19. package/dist/amxIdSystem.js +1 -1
  20. package/dist/appierAnalyticsAdapter.js +1 -1
  21. package/dist/appnexusAnalyticsAdapter.js +1 -1
  22. package/dist/appnexusBidAdapter.js +1 -1
  23. package/dist/asoBidAdapter.js +1 -1
  24. package/dist/atsAnalyticsAdapter.js +1 -1
  25. package/dist/axonixBidAdapter.js +1 -1
  26. package/dist/bidglassBidAdapter.js +1 -1
  27. package/dist/bidwatchAnalyticsAdapter.js +1 -1
  28. package/dist/big-richmediaBidAdapter.js +1 -1
  29. package/dist/bridgewellBidAdapter.js +1 -1
  30. package/dist/brightMountainMediaBidAdapter.js +1 -1
  31. package/dist/byDataAnalyticsAdapter.js +1 -1
  32. package/dist/colossussspBidAdapter.js +1 -1
  33. package/dist/concertAnalyticsAdapter.js +1 -1
  34. package/dist/concertBidAdapter.js +1 -1
  35. package/dist/connectadBidAdapter.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/datablocksAnalyticsAdapter.js +1 -1
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/eplanningAnalyticsAdapter.js +1 -1
  43. package/dist/eplanningBidAdapter.js +1 -1
  44. package/dist/fintezaAnalyticsAdapter.js +1 -1
  45. package/dist/ftrackIdSystem.js +1 -1
  46. package/dist/glimpseBidAdapter.js +1 -1
  47. package/dist/gmosspBidAdapter.js +1 -1
  48. package/dist/goldbachBidAdapter.js +1 -1
  49. package/dist/gridBidAdapter.js +1 -1
  50. package/dist/gridNMBidAdapter.js +1 -1
  51. package/dist/gumgumBidAdapter.js +1 -1
  52. package/dist/h12mediaBidAdapter.js +1 -1
  53. package/dist/hadronAnalyticsAdapter.js +1 -1
  54. package/dist/id5AnalyticsAdapter.js +1 -1
  55. package/dist/id5IdSystem.js +1 -1
  56. package/dist/improvedigitalBidAdapter.js +1 -1
  57. package/dist/inmarBidAdapter.js +1 -1
  58. package/dist/insticatorBidAdapter.js +1 -1
  59. package/dist/invisiblyAnalyticsAdapter.js +1 -1
  60. package/dist/ixBidAdapter.js +1 -1
  61. package/dist/justpremiumBidAdapter.js +1 -1
  62. package/dist/kargoAnalyticsAdapter.js +1 -1
  63. package/dist/koblerBidAdapter.js +1 -1
  64. package/dist/konduitAnalyticsAdapter.js +1 -1
  65. package/dist/livewrappedAnalyticsAdapter.js +1 -1
  66. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  67. package/dist/logicadBidAdapter.js +1 -1
  68. package/dist/loglyliftBidAdapter.js +1 -1
  69. package/dist/malltvAnalyticsAdapter.js +1 -1
  70. package/dist/marsmediaAnalyticsAdapter.js +1 -1
  71. package/dist/marsmediaBidAdapter.js +1 -1
  72. package/dist/mediafuseBidAdapter.js +1 -1
  73. package/dist/medianetAnalyticsAdapter.js +1 -1
  74. package/dist/mediasquareBidAdapter.js +1 -1
  75. package/dist/mgidBidAdapter.js +1 -1
  76. package/dist/minutemediaBidAdapter.js +1 -1
  77. package/dist/naveggIdSystem.js +1 -1
  78. package/dist/not-for-prod/prebid.js +153 -152
  79. package/dist/novatiqIdSystem.js +1 -1
  80. package/dist/oguryBidAdapter.js +1 -1
  81. package/dist/oneVideoBidAdapter.js +1 -1
  82. package/dist/onetagBidAdapter.js +1 -1
  83. package/dist/ooloAnalyticsAdapter.js +1 -1
  84. package/dist/openxAnalyticsAdapter.js +1 -1
  85. package/dist/optimonAnalyticsAdapter.js +1 -1
  86. package/dist/outbrainBidAdapter.js +1 -1
  87. package/dist/parrableIdSystem.js +1 -1
  88. package/dist/pixfutureBidAdapter.js +1 -1
  89. package/dist/prebid-core.js +3 -3
  90. package/dist/prebidmanagerAnalyticsAdapter.js +1 -1
  91. package/dist/publinkIdSystem.js +1 -1
  92. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  93. package/dist/pubmaticBidAdapter.js +1 -1
  94. package/dist/pubperfAnalyticsAdapter.js +1 -1
  95. package/dist/pubstackAnalyticsAdapter.js +1 -1
  96. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  97. package/dist/pubxaiAnalyticsAdapter.js +1 -1
  98. package/dist/pulsepointAnalyticsAdapter.js +1 -1
  99. package/dist/pxyzBidAdapter.js +1 -1
  100. package/dist/quantcastBidAdapter.js +1 -1
  101. package/dist/readpeakBidAdapter.js +1 -1
  102. package/dist/realvuAnalyticsAdapter.js +1 -1
  103. package/dist/relaidoBidAdapter.js +1 -1
  104. package/dist/relevantAnalyticsAdapter.js +1 -1
  105. package/dist/rhythmoneBidAdapter.js +1 -1
  106. package/dist/riseBidAdapter.js +1 -1
  107. package/dist/rivrAnalyticsAdapter.js +1 -1
  108. package/dist/roxotAnalyticsAdapter.js +1 -1
  109. package/dist/rubiconAnalyticsAdapter.js +1 -1
  110. package/dist/rubiconBidAdapter.js +1 -1
  111. package/dist/scaleableAnalyticsAdapter.js +1 -1
  112. package/dist/seedingAllianceBidAdapter.js +1 -1
  113. package/dist/seedtagBidAdapter.js +1 -1
  114. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  115. package/dist/sharethroughBidAdapter.js +1 -1
  116. package/dist/sigmoidAnalyticsAdapter.js +1 -1
  117. package/dist/smaatoBidAdapter.js +1 -1
  118. package/dist/smartadserverBidAdapter.js +1 -1
  119. package/dist/smartxBidAdapter.js +1 -1
  120. package/dist/smilewantedBidAdapter.js +1 -1
  121. package/dist/sonobiAnalyticsAdapter.js +1 -1
  122. package/dist/sonobiBidAdapter.js +1 -1
  123. package/dist/sortableAnalyticsAdapter.js +1 -1
  124. package/dist/sortableBidAdapter.js +1 -1
  125. package/dist/sovrnAnalyticsAdapter.js +1 -1
  126. package/dist/sovrnBidAdapter.js +1 -1
  127. package/dist/sspBCBidAdapter.js +1 -1
  128. package/dist/staqAnalyticsAdapter.js +1 -1
  129. package/dist/sublimeBidAdapter.js +1 -1
  130. package/dist/synacormediaBidAdapter.js +1 -1
  131. package/dist/taboolaBidAdapter.js +1 -0
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/terceptAnalyticsAdapter.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/trustxBidAdapter.js +1 -1
  138. package/dist/ttdBidAdapter.js +1 -1
  139. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  140. package/dist/underdogmediaBidAdapter.js +1 -1
  141. package/dist/undertoneBidAdapter.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/videobyteBidAdapter.js +1 -1
  144. package/dist/visxBidAdapter.js +1 -1
  145. package/dist/vuukleBidAdapter.js +1 -1
  146. package/dist/widespaceBidAdapter.js +1 -1
  147. package/dist/winrBidAdapter.js +1 -1
  148. package/dist/yahoosspBidAdapter.js +1 -1
  149. package/dist/yieldmoBidAdapter.js +1 -1
  150. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  151. package/dist/yuktamediaAnalyticsAdapter.js +1 -1
  152. package/dist/zeta_global_sspAnalyticsAdapter.js +1 -1
  153. package/integrationExamples/gpt/akamaidap_segments_example.html +5 -3
  154. package/modules/.submodules.json +1 -0
  155. package/modules/adlooxAnalyticsAdapter.js +9 -5
  156. package/modules/adlooxAnalyticsAdapter.md +3 -3
  157. package/modules/adlooxRtdProvider.js +3 -5
  158. package/modules/adlooxRtdProvider.md +2 -2
  159. package/modules/akamaiDapRtdProvider.js +460 -130
  160. package/modules/akamaiDapRtdProvider.md +5 -3
  161. package/modules/colossussspBidAdapter.js +17 -17
  162. package/modules/conversantBidAdapter.js +2 -2
  163. package/modules/ftrackIdSystem.js +3 -4
  164. package/modules/hadronAnalyticsAdapter.js +5 -1
  165. package/modules/koblerBidAdapter.js +54 -45
  166. package/modules/koblerBidAdapter.md +12 -17
  167. package/modules/naveggIdSystem.js +3 -2
  168. package/modules/novatiqIdSystem.js +6 -1
  169. package/modules/relaidoBidAdapter.js +0 -3
  170. package/modules/taboolaBidAdapter.js +265 -0
  171. package/modules/taboolaBidAdapter.md +49 -0
  172. package/package.json +1 -1
  173. package/src/AnalyticsAdapter.js +5 -1
  174. package/src/adloader.js +2 -1
  175. package/test/mocks/analyticsStub.js +13 -0
  176. package/test/mocks/xhr.js +22 -0
  177. package/test/spec/AnalyticsAdapter_spec.js +4 -0
  178. package/test/spec/modules/akamaiDapRtdProvider_spec.js +402 -108
  179. package/test/spec/modules/conversantBidAdapter_spec.js +36 -5
  180. package/test/spec/modules/datablocksBidAdapter_spec.js +9 -8
  181. package/test/spec/modules/fintezaAnalyticsAdapter_spec.js +4 -4
  182. package/test/spec/modules/ftrackIdSystem_spec.js +1 -9
  183. package/test/spec/modules/koblerBidAdapter_spec.js +160 -124
  184. package/test/spec/modules/naveggIdSystem_spec.js +25 -1
  185. package/test/spec/modules/proxistoreBidAdapter_spec.js +0 -2
  186. package/test/spec/modules/sovrnBidAdapter_spec.js +253 -264
  187. package/test/spec/modules/taboolaBidAdapter_spec.js +455 -0
  188. package/test/test_deps.js +1 -0
@@ -1,92 +1,91 @@
1
- import {expect} from 'chai';
2
- import {spec} from 'modules/sovrnBidAdapter.js';
3
- import {config} from 'src/config.js';
1
+ import {expect} from 'chai'
2
+ import {spec} from 'modules/sovrnBidAdapter.js'
3
+ import {config} from 'src/config.js'
4
4
  import * as utils from 'src/utils.js'
5
5
 
6
- const ENDPOINT = `https://ap.lijit.com/rtb/bid?src=$$REPO_AND_VERSION$$`;
6
+ const ENDPOINT = `https://ap.lijit.com/rtb/bid?src=$$REPO_AND_VERSION$$`
7
7
 
8
8
  const baseBidRequest = {
9
- 'bidder': 'sovrn',
10
- 'params': {
11
- 'tagid': 403370
9
+ bidder: 'sovrn',
10
+ params: {
11
+ tagid: 403370
12
12
  },
13
- 'adUnitCode': 'adunit-code',
14
- 'sizes': [
13
+ adUnitCode: 'adunit-code',
14
+ sizes: [
15
15
  [300, 250],
16
16
  [300, 600]
17
17
  ],
18
- 'bidId': '30b31c1838de1e',
19
- 'bidderRequestId': '22edbae2733bf6',
20
- 'auctionId': '1d1a030790a475',
18
+ bidId: '30b31c1838de1e',
19
+ bidderRequestId: '22edbae2733bf6',
20
+ auctionId: '1d1a030790a475',
21
21
  }
22
22
  const baseBidderRequest = {
23
23
  refererInfo: {
24
24
  referer: 'http://example.com/page.html',
25
25
  }
26
- };
26
+ }
27
27
 
28
28
  describe('sovrnBidAdapter', function() {
29
29
  describe('isBidRequestValid', function () {
30
30
  it('should return true when required params found', function () {
31
- expect(spec.isBidRequestValid(baseBidRequest)).to.equal(true);
32
- });
31
+ expect(spec.isBidRequestValid(baseBidRequest)).to.equal(true)
32
+ })
33
33
 
34
34
  it('should return false when tagid not passed correctly', function () {
35
35
  const bidRequest = {
36
36
  ...baseBidRequest,
37
- 'params': {
37
+ params: {
38
38
  ...baseBidRequest.params,
39
- 'tagid': 'ABCD'
39
+ tagid: 'ABCD'
40
40
  },
41
- };
41
+ }
42
42
 
43
- expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
44
- });
43
+ expect(spec.isBidRequestValid(bidRequest)).to.equal(false)
44
+ })
45
45
 
46
46
  it('should return false when require params are not passed', function () {
47
47
  const bidRequest = {
48
48
  ...baseBidRequest,
49
- 'params': {}
49
+ params: {}
50
50
  }
51
51
 
52
- expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
53
- });
52
+ expect(spec.isBidRequestValid(bidRequest)).to.equal(false)
53
+ })
54
54
 
55
55
  it('should return false when require video params are not passed', function () {
56
56
  const bidRequest = {
57
57
  ...baseBidRequest,
58
- 'mediaTypes': {
58
+ mediaTypes: {
59
59
  'video': {
60
60
  }
61
61
  }
62
62
  }
63
63
 
64
- expect(spec.isBidRequestValid(bidRequest)).to.equal(false);
65
- });
66
- });
64
+ expect(spec.isBidRequestValid(bidRequest)).to.equal(false)
65
+ })
66
+ })
67
67
 
68
68
  describe('buildRequests', function () {
69
69
  describe('basic bid parameters', function() {
70
- const request = spec.buildRequests([baseBidRequest], baseBidderRequest);
71
- const payload = JSON.parse(request.data);
70
+ const request = spec.buildRequests([baseBidRequest], baseBidderRequest)
71
+ const payload = JSON.parse(request.data)
72
72
 
73
73
  it('sends bid request to our endpoint via POST', function () {
74
- expect(request.method).to.equal('POST');
75
- });
74
+ expect(request.method).to.equal('POST')
75
+ })
76
76
 
77
77
  it('attaches source and version to endpoint URL as query params', function () {
78
78
  expect(request.url).to.equal(ENDPOINT)
79
- });
79
+ })
80
80
 
81
81
  it('sets the proper banner object', function() {
82
82
  const bannerBidRequest = {
83
83
  ...baseBidRequest,
84
- 'mediaTypes': {
84
+ mediaTypes: {
85
85
  banner: {}
86
86
  }
87
87
  }
88
88
  const request = spec.buildRequests([bannerBidRequest], baseBidderRequest)
89
-
90
89
  const payload = JSON.parse(request.data)
91
90
  const impression = payload.imp[0]
92
91
 
@@ -105,7 +104,7 @@ describe('sovrnBidAdapter', function() {
105
104
  const startdelay = 0
106
105
  const videoBidRequest = {
107
106
  ...baseBidRequest,
108
- 'mediaTypes': {
107
+ mediaTypes: {
109
108
  video: {
110
109
  mimes,
111
110
  protocols,
@@ -117,7 +116,6 @@ describe('sovrnBidAdapter', function() {
117
116
  }
118
117
  }
119
118
  const request = spec.buildRequests([videoBidRequest], baseBidderRequest)
120
-
121
119
  const payload = JSON.parse(request.data)
122
120
  const impression = payload.imp[0]
123
121
 
@@ -131,9 +129,9 @@ describe('sovrnBidAdapter', function() {
131
129
  })
132
130
 
133
131
  it('gets correct site info', function() {
134
- expect(payload.site.page).to.equal('http://example.com/page.html');
135
- expect(payload.site.domain).to.equal('example.com');
136
- });
132
+ expect(payload.site.page).to.equal('http://example.com/page.html')
133
+ expect(payload.site.domain).to.equal('example.com')
134
+ })
137
135
 
138
136
  it('includes the ad unit code in the request', function() {
139
137
  const impression = payload.imp[0]
@@ -142,22 +140,21 @@ describe('sovrnBidAdapter', function() {
142
140
 
143
141
  it('converts tagid to string', function () {
144
142
  expect(request.data).to.contain('"tagid":"403370"')
145
- });
143
+ })
146
144
  })
147
145
 
148
146
  it('accepts a single array as a size', function() {
149
147
  const singleSizeBidRequest = {
150
148
  ...baseBidRequest,
151
- 'params': {
152
- 'iv': 'vet'
149
+ params: {
150
+ iv: 'vet'
153
151
  },
154
- 'sizes': [300, 250],
155
- 'mediaTypes': {
152
+ sizes: [300, 250],
153
+ mediaTypes: {
156
154
  banner: {}
157
155
  },
158
156
  }
159
157
  const request = spec.buildRequests([singleSizeBidRequest], baseBidderRequest)
160
-
161
158
  const payload = JSON.parse(request.data)
162
159
  const impression = payload.imp[0]
163
160
 
@@ -176,22 +173,21 @@ describe('sovrnBidAdapter', function() {
176
173
  const request = spec.buildRequests([ivBidRequest], baseBidderRequest)
177
174
 
178
175
  expect(request.url).to.contain('iv=vet')
179
- });
176
+ })
180
177
 
181
178
  it('sends gdpr info if exists', function () {
182
179
  const bidderRequest = {
183
180
  ...baseBidderRequest,
184
- 'bidderCode': 'sovrn',
185
- 'auctionId': '1d1a030790a475',
186
- 'bidderRequestId': '22edbae2733bf6',
187
- 'timeout': 3000,
188
- 'gdprConsent': {
189
- 'consentString': 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==',
190
- 'gdprApplies': true
181
+ bidderCode: 'sovrn',
182
+ auctionId: '1d1a030790a475',
183
+ bidderRequestId: '22edbae2733bf6',
184
+ timeout: 3000,
185
+ gdprConsent: {
186
+ consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==',
187
+ gdprApplies: true
191
188
  },
192
- 'bids': [baseBidRequest]
193
- };
194
-
189
+ bids: [baseBidRequest]
190
+ }
195
191
  const { regs, user } = JSON.parse(spec.buildRequests([baseBidRequest], bidderRequest).data)
196
192
 
197
193
  expect(regs.ext.gdpr).to.exist.and.to.be.a('number')
@@ -203,14 +199,13 @@ describe('sovrnBidAdapter', function() {
203
199
  it('should send us_privacy if bidderRequest has a value for uspConsent', function () {
204
200
  const bidderRequest = {
205
201
  ...baseBidderRequest,
206
- 'bidderCode': 'sovrn',
207
- 'auctionId': '1d1a030790a475',
208
- 'bidderRequestId': '22edbae2733bf6',
209
- 'timeout': 3000,
210
- 'uspConsent': '1NYN',
211
- 'bids': [baseBidRequest]
202
+ bidderCode: 'sovrn',
203
+ auctionId: '1d1a030790a475',
204
+ bidderRequestId: '22edbae2733bf6',
205
+ timeout: 3000,
206
+ uspConsent: '1NYN',
207
+ bids: [baseBidRequest]
212
208
  }
213
-
214
209
  const data = JSON.parse(spec.buildRequests([baseBidRequest], bidderRequest).data)
215
210
 
216
211
  expect(data.regs.ext['us_privacy']).to.equal(bidderRequest.uspConsent)
@@ -219,21 +214,20 @@ describe('sovrnBidAdapter', function() {
219
214
  it('should add schain if present', function() {
220
215
  const schainRequest = {
221
216
  ...baseBidRequest,
222
- 'schain': {
223
- 'ver': '1.0',
224
- 'complete': 1,
225
- 'nodes': [
217
+ schain: {
218
+ ver: '1.0',
219
+ complete: 1,
220
+ nodes: [
226
221
  {
227
- 'asi': 'directseller.com',
228
- 'sid': '00001',
229
- 'rid': 'BidRequest1',
230
- 'hp': 1
222
+ asi: 'directseller.com',
223
+ sid: '00001',
224
+ rid: 'BidRequest1',
225
+ hp: 1
231
226
  }
232
227
  ]
233
228
  }
234
229
  }
235
230
  const schainRequests = [schainRequest, baseBidRequest]
236
-
237
231
  const data = JSON.parse(spec.buildRequests(schainRequests, baseBidderRequest).data)
238
232
 
239
233
  expect(data.source.ext.schain.nodes.length).to.equal(1)
@@ -248,7 +242,6 @@ describe('sovrnBidAdapter', function() {
248
242
  }
249
243
  }
250
244
  const criteoIdRequests = [criteoIdRequest, baseBidRequest]
251
-
252
245
  const ext = JSON.parse(spec.buildRequests(criteoIdRequests, baseBidderRequest).data).user.ext
253
246
  const firstEID = ext.eids[0]
254
247
  const secondEID = ext.eids[1]
@@ -294,7 +287,6 @@ describe('sovrnBidAdapter', function() {
294
287
  bidfloor: 2.00
295
288
  }
296
289
  }
297
-
298
290
  const request = spec.buildRequests([floorBid], baseBidderRequest)
299
291
  const payload = JSON.parse(request.data)
300
292
 
@@ -309,7 +301,6 @@ describe('sovrnBidAdapter', function() {
309
301
  tagid: 1234,
310
302
  bidfloor: 2.00
311
303
  }
312
-
313
304
  const request = spec.buildRequests([floorBid], baseBidderRequest)
314
305
  const impression = JSON.parse(request.data).imp[0]
315
306
 
@@ -359,7 +350,6 @@ describe('sovrnBidAdapter', function() {
359
350
  }
360
351
  }
361
352
  }
362
-
363
353
  const request = spec.buildRequests([fpdBidRequest], baseBidderRequest)
364
354
  const payload = JSON.parse(request.data)
365
355
 
@@ -381,7 +371,6 @@ describe('sovrnBidAdapter', function() {
381
371
  }
382
372
  }
383
373
  }
384
-
385
374
  const request = spec.buildRequests([fpdBid], baseBidderRequest)
386
375
  const impression = JSON.parse(request.data).imp[0]
387
376
 
@@ -390,102 +379,109 @@ describe('sovrnBidAdapter', function() {
390
379
  expect(impression.ext.deals).to.deep.equal(['seg1', 'seg2'])
391
380
  })
392
381
  })
393
- });
382
+ })
394
383
 
395
384
  describe('interpretResponse', function () {
396
- let response;
385
+ let response
397
386
  const baseResponse = {
398
- 'requestId': '263c448586f5a1',
399
- 'cpm': 0.45882675,
400
- 'width': 728,
401
- 'height': 90,
402
- 'creativeId': 'creativelycreatedcreativecreative',
403
- 'dealId': null,
404
- 'currency': 'USD',
405
- 'netRevenue': true,
406
- 'mediaType': 'banner',
407
- 'ttl': 90,
408
- 'meta': { advertiserDomains: [] },
409
- 'ad': decodeURIComponent(`<!-- Creative --><img src="<!-- NURL -->">`),
387
+ requestId: '263c448586f5a1',
388
+ cpm: 0.45882675,
389
+ width: 728,
390
+ height: 90,
391
+ creativeId: 'creativelycreatedcreativecreative',
392
+ dealId: null,
393
+ currency: 'USD',
394
+ netRevenue: true,
395
+ mediaType: 'banner',
396
+ ttl: 90,
397
+ meta: { advertiserDomains: [] },
398
+ ad: decodeURIComponent(`<!-- Creative --><img src="<!-- NURL -->">`),
410
399
  }
411
400
  const videoBid = {
412
- 'id': 'a_403370_332fdb9b064040ddbec05891bd13ab28',
413
- 'crid': 'creativelycreatedcreativecreative',
414
- 'impid': '263c448586f5a1',
415
- 'price': 0.45882675,
416
- 'nurl': '',
417
- 'adm': '<VAST version="4.2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iab.com/VAST">key%3Dvalue</VAST>',
418
- 'h': 480,
419
- 'w': 640
401
+ id: 'a_403370_332fdb9b064040ddbec05891bd13ab28',
402
+ crid: 'creativelycreatedcreativecreative',
403
+ impid: '263c448586f5a1',
404
+ price: 0.45882675,
405
+ nurl: '',
406
+ adm: '<VAST version="4.2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iab.com/VAST">key%3Dvalue</VAST>',
407
+ h: 480,
408
+ w: 640
420
409
  }
421
410
  const bannerBid = {
422
- 'id': 'a_403370_332fdb9b064040ddbec05891bd13ab28',
423
- 'crid': 'creativelycreatedcreativecreative',
424
- 'impid': '263c448586f5a1',
425
- 'price': 0.45882675,
426
- 'nurl': '<!-- NURL -->',
427
- 'adm': '<!-- Creative -->',
428
- 'h': 90,
429
- 'w': 728
411
+ id: 'a_403370_332fdb9b064040ddbec05891bd13ab28',
412
+ crid: 'creativelycreatedcreativecreative',
413
+ impid: '263c448586f5a1',
414
+ price: 0.45882675,
415
+ nurl: '<!-- NURL -->',
416
+ adm: '<!-- Creative -->',
417
+ h: 90,
418
+ w: 728
430
419
  }
420
+
431
421
  beforeEach(function () {
432
422
  response = {
433
423
  body: {
434
- 'id': '37386aade21a71',
435
- 'seatbid': [{
436
- 'bid': [{
424
+ id: '37386aade21a71',
425
+ seatbid: [{
426
+ bid: [{
437
427
  ...bannerBid
438
428
  }]
439
429
  }]
440
430
  }
441
- };
442
- });
431
+ }
432
+ })
443
433
 
444
434
  it('should get the correct bid response', function () {
445
435
  const expectedResponse = {
446
- ...baseResponse,
447
- 'ttl': 60000,
448
- };
449
-
450
- const result = spec.interpretResponse(response);
436
+ requestId: '263c448586f5a1',
437
+ cpm: 0.45882675,
438
+ width: 728,
439
+ height: 90,
440
+ creativeId: 'creativelycreatedcreativecreative',
441
+ dealId: null,
442
+ currency: 'USD',
443
+ netRevenue: true,
444
+ mediaType: 'banner',
445
+ ttl: 60000,
446
+ meta: { advertiserDomains: [] },
447
+ ad: decodeURIComponent(`<!-- Creative --><img src=<!-- NURL -->>`)
448
+ }
449
+ const result = spec.interpretResponse(response)
451
450
 
452
- expect(result[0]).to.have.deep.keys(expectedResponse)
453
- });
451
+ expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedResponse))
452
+ })
454
453
 
455
454
  it('crid should default to the bid id if not on the response', function () {
456
- delete response.body.seatbid[0].bid[0].crid;
455
+ delete response.body.seatbid[0].bid[0].crid
457
456
 
458
457
  const expectedResponse = {
459
458
  ...baseResponse,
460
- 'creativeId': response.body.seatbid[0].bid[0].id,
461
- 'ad': decodeURIComponent(`<!-- Creative --><img src="<!-- NURL -->">`),
459
+ creativeId: response.body.seatbid[0].bid[0].id,
460
+ ad: decodeURIComponent(`<!-- Creative --><img src="<!-- NURL -->">`),
462
461
  }
462
+ const result = spec.interpretResponse(response)
463
463
 
464
- const result = spec.interpretResponse(response);
465
-
466
- expect(result[0]).to.deep.equal(expectedResponse);
467
- });
464
+ expect(result[0]).to.deep.equal(expectedResponse)
465
+ })
468
466
 
469
467
  it('should get correct bid response when dealId is passed', function () {
470
- response.body.seatbid[0].bid[0].dealid = 'baking';
468
+ response.body.seatbid[0].bid[0].dealid = 'baking'
471
469
  const expectedResponse = {
472
470
  ...baseResponse,
473
- 'dealId': 'baking',
471
+ dealId: 'baking',
474
472
  }
475
-
476
473
  const result = spec.interpretResponse(response)
477
474
 
478
- expect(result[0]).to.deep.equal(expectedResponse);
479
- });
475
+ expect(result[0]).to.deep.equal(expectedResponse)
476
+ })
480
477
 
481
478
  it('should get correct bid response when ttl is set', function () {
482
- response.body.seatbid[0].bid[0].ext = { 'ttl': 480 }
479
+ response.body.seatbid[0].bid[0].ext = { ttl: 480 }
483
480
 
484
481
  const expectedResponse = {
485
482
  ...baseResponse,
486
- 'ttl': 480,
483
+ ttl: 480,
487
484
  }
488
-
489
485
  const result = spec.interpretResponse(response)
490
486
 
491
487
  expect(result[0]).to.deep.equal(expectedResponse)
@@ -494,20 +490,19 @@ describe('sovrnBidAdapter', function() {
494
490
  it('handles empty bid response', function () {
495
491
  const response = {
496
492
  body: {
497
- 'id': '37386aade21a71',
498
- 'seatbid': []
493
+ id: '37386aade21a71',
494
+ seatbid: []
499
495
  }
500
- };
501
-
496
+ }
502
497
  const result = spec.interpretResponse(response)
503
498
 
504
- expect(result.length).to.equal(0);
505
- });
499
+ expect(result.length).to.equal(0)
500
+ })
506
501
 
507
502
  it('should get the correct bid response with 2 different bids', function () {
508
503
  const expectedVideoResponse = {
509
504
  ...baseResponse,
510
- 'vastXml': decodeURIComponent(videoBid.adm)
505
+ vastXml: decodeURIComponent(videoBid.adm)
511
506
  }
512
507
  delete expectedVideoResponse.ad
513
508
 
@@ -533,90 +528,87 @@ describe('sovrnBidAdapter', function() {
533
528
  expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedResponse))
534
529
  expect(Object.keys(result[1])).to.deep.equal(Object.keys(expectedResponse))
535
530
  })
536
- });
531
+ })
537
532
 
538
533
  describe('interpretResponse video', function () {
539
- let videoResponse;
540
- const bidAdm = '<VAST version="4.2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iab.com/VAST">key%3Dvalue</VAST>';
541
- const decodedBidAdm = decodeURIComponent(bidAdm);
534
+ let videoResponse
535
+ const bidAdm = '<VAST version="4.2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.iab.com/VAST">key%3Dvalue</VAST>'
536
+ const decodedBidAdm = decodeURIComponent(bidAdm)
542
537
  const baseVideoResponse = {
543
- 'requestId': '263c448586f5a1',
544
- 'cpm': 0.45882675,
545
- 'width': 640,
546
- 'height': 480,
547
- 'creativeId': 'creativelycreatedcreativecreative',
548
- 'dealId': null,
549
- 'currency': 'USD',
550
- 'netRevenue': true,
551
- 'mediaType': 'video',
552
- 'ttl': 90,
553
- 'meta': { advertiserDomains: [] },
554
- 'vastXml': decodedBidAdm
538
+ requestId: '263c448586f5a1',
539
+ cpm: 0.45882675,
540
+ width: 640,
541
+ height: 480,
542
+ creativeId: 'creativelycreatedcreativecreative',
543
+ dealId: null,
544
+ currency: 'USD',
545
+ netRevenue: true,
546
+ mediaType: 'video',
547
+ ttl: 90,
548
+ meta: { advertiserDomains: [] },
549
+ vastXml: decodedBidAdm
555
550
  }
551
+
556
552
  beforeEach(function () {
557
553
  videoResponse = {
558
554
  body: {
559
- 'id': '37386aade21a71',
560
- 'seatbid': [{
561
- 'bid': [{
562
- 'id': 'a_403370_332fdb9b064040ddbec05891bd13ab28',
563
- 'crid': 'creativelycreatedcreativecreative',
564
- 'impid': '263c448586f5a1',
565
- 'price': 0.45882675,
566
- 'nurl': '',
567
- 'adm': bidAdm,
568
- 'h': 480,
569
- 'w': 640
555
+ id: '37386aade21a71',
556
+ seatbid: [{
557
+ bid: [{
558
+ id: 'a_403370_332fdb9b064040ddbec05891bd13ab28',
559
+ crid: 'creativelycreatedcreativecreative',
560
+ impid: '263c448586f5a1',
561
+ price: 0.45882675,
562
+ nurl: '',
563
+ adm: bidAdm,
564
+ h: 480,
565
+ w: 640
570
566
  }]
571
567
  }]
572
568
  }
573
- };
574
- });
569
+ }
570
+ })
575
571
 
576
572
  it('should get the correct bid response', function () {
577
573
  const expectedResponse = {
578
574
  ...baseVideoResponse,
579
- 'ttl': 60000,
580
- };
581
-
582
- const result = spec.interpretResponse(videoResponse);
575
+ ttl: 60000,
576
+ }
577
+ const result = spec.interpretResponse(videoResponse)
583
578
 
584
579
  expect(result[0]).to.have.deep.keys(expectedResponse)
585
- });
580
+ })
586
581
 
587
582
  it('crid should default to the bid id if not on the response', function () {
588
- delete videoResponse.body.seatbid[0].bid[0].crid;
583
+ delete videoResponse.body.seatbid[0].bid[0].crid
589
584
 
590
585
  const expectedResponse = {
591
586
  ...baseVideoResponse,
592
- 'creativeId': videoResponse.body.seatbid[0].bid[0].id,
587
+ creativeId: videoResponse.body.seatbid[0].bid[0].id,
593
588
  }
589
+ const result = spec.interpretResponse(videoResponse)
594
590
 
595
- const result = spec.interpretResponse(videoResponse);
596
-
597
- expect(result[0]).to.deep.equal(expectedResponse);
598
- });
591
+ expect(result[0]).to.deep.equal(expectedResponse)
592
+ })
599
593
 
600
594
  it('should get correct bid response when dealId is passed', function () {
601
- videoResponse.body.seatbid[0].bid[0].dealid = 'baking';
595
+ videoResponse.body.seatbid[0].bid[0].dealid = 'baking'
602
596
  const expectedResponse = {
603
597
  ...baseVideoResponse,
604
- 'dealId': 'baking',
598
+ dealId: 'baking',
605
599
  }
606
-
607
600
  const result = spec.interpretResponse(videoResponse)
608
601
 
609
- expect(result[0]).to.deep.equal(expectedResponse);
610
- });
602
+ expect(result[0]).to.deep.equal(expectedResponse)
603
+ })
611
604
 
612
605
  it('should get correct bid response when ttl is set', function () {
613
606
  videoResponse.body.seatbid[0].bid[0].ext = { 'ttl': 480 }
614
607
 
615
608
  const expectedResponse = {
616
609
  ...baseVideoResponse,
617
- 'ttl': 480,
610
+ ttl: 480,
618
611
  }
619
-
620
612
  const result = spec.interpretResponse(videoResponse)
621
613
 
622
614
  expect(result[0]).to.deep.equal(expectedResponse)
@@ -625,52 +617,51 @@ describe('sovrnBidAdapter', function() {
625
617
  it('handles empty bid response', function () {
626
618
  const response = {
627
619
  body: {
628
- 'id': '37386aade21a71',
629
- 'seatbid': []
620
+ id: '37386aade21a71',
621
+ seatbid: []
630
622
  }
631
- };
632
-
623
+ }
633
624
  const result = spec.interpretResponse(response)
634
625
 
635
- expect(result.length).to.equal(0);
636
- });
637
- });
626
+ expect(result.length).to.equal(0)
627
+ })
628
+ })
638
629
 
639
630
  describe('getUserSyncs ', function() {
640
- const syncOptions = { iframeEnabled: true, pixelEnabled: false };
641
- const iframeDisabledSyncOptions = { iframeEnabled: false, pixelEnabled: false };
631
+ const syncOptions = { iframeEnabled: true, pixelEnabled: false }
632
+ const iframeDisabledSyncOptions = { iframeEnabled: false, pixelEnabled: false }
642
633
  const serverResponse = [
643
634
  {
644
- 'body': {
645
- 'id': '546956d68c757f',
646
- 'seatbid': [
635
+ body: {
636
+ id: '546956d68c757f',
637
+ seatbid: [
647
638
  {
648
- 'bid': [
639
+ bid: [
649
640
  {
650
- 'id': 'a_448326_16c2ada014224bee815a90d2248322f5',
651
- 'impid': '2a3826aae345f4',
652
- 'price': 1.0099999904632568,
653
- 'nurl': 'http://localhost/rtb/impression?bannerid=220958&campaignid=3890&rtb_tid=15588614-75d2-40ab-b27e-13d2127b3c2e&rpid=1295&seatid=seat1&zoneid=448326&cb=26900712&tid=a_448326_16c2ada014224bee815a90d2248322f5',
654
- 'adm': 'yo a creative',
655
- 'crid': 'cridprebidrtb',
656
- 'w': 160,
657
- 'h': 600
641
+ id: 'a_448326_16c2ada014224bee815a90d2248322f5',
642
+ impid: '2a3826aae345f4',
643
+ price: 1.0099999904632568,
644
+ nurl: 'http://localhost/rtb/impression?bannerid=220958&campaignid=3890&rtb_tid=15588614-75d2-40ab-b27e-13d2127b3c2e&rpid=1295&seatid=seat1&zoneid=448326&cb=26900712&tid=a_448326_16c2ada014224bee815a90d2248322f5',
645
+ adm: 'yo a creative',
646
+ crid: 'cridprebidrtb',
647
+ w: 160,
648
+ h: 600
658
649
  },
659
650
  {
660
- 'id': 'a_430392_beac4c1515da4576acf6cb9c5340b40c',
661
- 'impid': '3cf96fd26ed4c5',
662
- 'price': 1.0099999904632568,
663
- 'nurl': 'http://localhost/rtb/impression?bannerid=220957&campaignid=3890&rtb_tid=5bc0e68b-3492-448d-a6f9-26fa3fd0b646&rpid=1295&seatid=seat1&zoneid=430392&cb=62735099&tid=a_430392_beac4c1515da4576acf6cb9c5340b40c',
664
- 'adm': 'yo a creative',
665
- 'crid': 'cridprebidrtb',
666
- 'w': 300,
667
- 'h': 250
651
+ id: 'a_430392_beac4c1515da4576acf6cb9c5340b40c',
652
+ impid: '3cf96fd26ed4c5',
653
+ price: 1.0099999904632568,
654
+ nurl: 'http://localhost/rtb/impression?bannerid=220957&campaignid=3890&rtb_tid=5bc0e68b-3492-448d-a6f9-26fa3fd0b646&rpid=1295&seatid=seat1&zoneid=430392&cb=62735099&tid=a_430392_beac4c1515da4576acf6cb9c5340b40c',
655
+ adm: 'yo a creative',
656
+ crid: 'cridprebidrtb',
657
+ w: 300,
658
+ h: 250
668
659
  },
669
660
  ]
670
661
  }
671
662
  ],
672
- 'ext': {
673
- 'iid': 13487408,
663
+ ext: {
664
+ iid: 13487408,
674
665
  sync: {
675
666
  pixels: [
676
667
  {
@@ -683,20 +674,19 @@ describe('sovrnBidAdapter', function() {
683
674
  }
684
675
  }
685
676
  },
686
- 'headers': {}
677
+ headers: {}
687
678
  }
688
- ];
679
+ ]
689
680
 
690
681
  it('should return if iid present on server response & iframe syncs enabled', function() {
691
682
  const expectedReturnStatement = {
692
- 'type': 'iframe',
693
- 'url': 'https://ap.lijit.com/beacon?informer=13487408',
683
+ type: 'iframe',
684
+ url: 'https://ap.lijit.com/beacon?informer=13487408',
694
685
  }
686
+ const returnStatement = spec.getUserSyncs(syncOptions, serverResponse)
695
687
 
696
- const returnStatement = spec.getUserSyncs(syncOptions, serverResponse);
697
-
698
- expect(returnStatement[0]).to.deep.equal(expectedReturnStatement);
699
- });
688
+ expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
689
+ })
700
690
 
701
691
  it('should include gdpr consent string if present', function() {
702
692
  const gdprConsent = {
@@ -704,64 +694,63 @@ describe('sovrnBidAdapter', function() {
704
694
  consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A=='
705
695
  }
706
696
  const expectedReturnStatement = {
707
- 'type': 'iframe',
708
- 'url': `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&informer=13487408`,
697
+ type: 'iframe',
698
+ url: `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&informer=13487408`,
709
699
  }
710
700
 
711
- const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, '');
701
+ const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, '')
712
702
 
713
- expect(returnStatement[0]).to.deep.equal(expectedReturnStatement);
714
- });
703
+ expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
704
+ })
715
705
 
716
706
  it('should include us privacy string if present', function() {
717
- const uspString = '1NYN';
707
+ const uspString = '1NYN'
718
708
  const expectedReturnStatement = {
719
- 'type': 'iframe',
720
- 'url': `https://ap.lijit.com/beacon?us_privacy=${uspString}&informer=13487408`,
709
+ type: 'iframe',
710
+ url: `https://ap.lijit.com/beacon?us_privacy=${uspString}&informer=13487408`,
721
711
  }
722
712
 
723
- const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, null, uspString);
713
+ const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, null, uspString)
724
714
 
725
- expect(returnStatement[0]).to.deep.equal(expectedReturnStatement);
726
- });
715
+ expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
716
+ })
727
717
 
728
718
  it('should include all privacy strings if present', function() {
729
719
  const gdprConsent = {
730
720
  gdprApplies: 1,
731
721
  consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A=='
732
722
  }
733
- const uspString = '1NYN';
723
+ const uspString = '1NYN'
734
724
  const expectedReturnStatement = {
735
- 'type': 'iframe',
736
- 'url': `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&us_privacy=${uspString}&informer=13487408`,
725
+ type: 'iframe',
726
+ url: `https://ap.lijit.com/beacon?gdpr_consent=${gdprConsent.consentString}&us_privacy=${uspString}&informer=13487408`,
737
727
  }
738
728
 
739
729
  const returnStatement = spec.getUserSyncs(syncOptions, serverResponse, gdprConsent, uspString)
740
730
 
741
731
  expect(returnStatement[0]).to.deep.equal(expectedReturnStatement)
742
- });
732
+ })
743
733
 
744
734
  it('should not return if iid missing on server response', function() {
745
- const returnStatement = spec.getUserSyncs(syncOptions, []);
735
+ const returnStatement = spec.getUserSyncs(syncOptions, [])
746
736
 
747
- expect(returnStatement).to.be.empty;
748
- });
737
+ expect(returnStatement).to.be.empty
738
+ })
749
739
 
750
740
  it('should not return if iframe syncs disabled', function() {
751
- const returnStatement = spec.getUserSyncs(iframeDisabledSyncOptions, serverResponse);
741
+ const returnStatement = spec.getUserSyncs(iframeDisabledSyncOptions, serverResponse)
752
742
 
753
- expect(returnStatement).to.be.empty;
754
- });
743
+ expect(returnStatement).to.be.empty
744
+ })
755
745
 
756
746
  it('should include pixel syncs', function() {
757
747
  const pixelEnabledOptions = { iframeEnabled: false, pixelEnabled: true }
758
-
759
748
  const otherResponce = {
760
749
  ...serverResponse,
761
- 'body': {
750
+ body: {
762
751
  ...serverResponse.body,
763
- 'ext': {
764
- 'iid': 13487408,
752
+ ext: {
753
+ iid: 13487408,
765
754
  sync: {
766
755
  pixels: [
767
756
  {
@@ -778,33 +767,33 @@ describe('sovrnBidAdapter', function() {
778
767
 
779
768
  const returnStatement = spec.getUserSyncs(pixelEnabledOptions, [...serverResponse, otherResponce])
780
769
 
781
- expect(returnStatement.length).to.equal(4);
770
+ expect(returnStatement.length).to.equal(4)
782
771
  expect(returnStatement).to.deep.include.members([
783
772
  { type: 'image', url: 'http://idprovider1.com' },
784
773
  { type: 'image', url: 'http://idprovider2.com' },
785
774
  { type: 'image', url: 'http://idprovider3.com' },
786
775
  { type: 'image', url: 'http://idprovider4.com' }
787
- ]);
776
+ ])
788
777
  })
789
778
  })
790
779
 
791
780
  describe('prebid 3 upgrade', function() {
792
781
  const bidRequest = {
793
782
  ...baseBidRequest,
794
- 'params': {
795
- 'tagid': '403370'
783
+ params: {
784
+ tagid: '403370'
796
785
  },
797
- 'mediaTypes': {
798
- 'banner': {
799
- 'sizes': [
786
+ mediaTypes: {
787
+ banner: {
788
+ sizes: [
800
789
  [300, 250],
801
790
  [300, 600]
802
791
  ]
803
792
  }
804
793
  },
805
- };
806
- const request = spec.buildRequests([bidRequest], baseBidderRequest);
807
- const payload = JSON.parse(request.data);
794
+ }
795
+ const request = spec.buildRequests([bidRequest], baseBidderRequest)
796
+ const payload = JSON.parse(request.data)
808
797
 
809
798
  it('gets sizes from mediaTypes.banner', function() {
810
799
  expect(payload.imp[0].banner.format).to.deep.equal([{w: 300, h: 250}, {w: 300, h: 600}])
@@ -813,8 +802,8 @@ describe('sovrnBidAdapter', function() {
813
802
  })
814
803
 
815
804
  it('gets correct site info', function() {
816
- expect(payload.site.page).to.equal('http://example.com/page.html');
817
- expect(payload.site.domain).to.equal('example.com');
805
+ expect(payload.site.page).to.equal('http://example.com/page.html')
806
+ expect(payload.site.domain).to.equal('example.com')
818
807
  })
819
808
  })
820
809
  })