prebid.js 7.31.0 → 7.32.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 (180) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/33acrossIdSystem.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/adlooxRtdProvider.js +1 -1
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/aidemBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/alkimiBidAdapter.js +1 -1
  13. package/dist/amxBidAdapter.js +1 -1
  14. package/dist/amxIdSystem.js +1 -1
  15. package/dist/aolBidAdapter.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/appushBidAdapter.js +1 -0
  19. package/dist/asoBidAdapter.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/carodaBidAdapter.js +1 -1
  26. package/dist/chtnwBidAdapter.js +1 -1
  27. package/dist/concertBidAdapter.js +1 -1
  28. package/dist/connectIdSystem.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consumableBidAdapter.js +1 -1
  31. package/dist/conversantBidAdapter.js +1 -1
  32. package/dist/craftBidAdapter.js +1 -1
  33. package/dist/criteoBidAdapter.js +1 -1
  34. package/dist/dspxBidAdapter.js +1 -1
  35. package/dist/eplanningBidAdapter.js +1 -1
  36. package/dist/feedadBidAdapter.js +1 -1
  37. package/dist/finativeBidAdapter.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/holidBidAdapter.js +1 -0
  46. package/dist/id5IdSystem.js +1 -1
  47. package/dist/improvedigitalBidAdapter.js +1 -1
  48. package/dist/inmarBidAdapter.js +1 -1
  49. package/dist/insticatorBidAdapter.js +1 -1
  50. package/dist/ixBidAdapter.js +1 -1
  51. package/dist/justpremiumBidAdapter.js +1 -1
  52. package/dist/jwplayerVideoProvider.js +1 -1
  53. package/dist/konduitAnalyticsAdapter.js +1 -1
  54. package/dist/kueezBidAdapter.js +1 -1
  55. package/dist/kueezRtbBidAdapter.js +1 -1
  56. package/dist/lassoBidAdapter.js +1 -1
  57. package/dist/lifestreetBidAdapter.js +1 -1
  58. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  59. package/dist/logicadBidAdapter.js +1 -1
  60. package/dist/loglyliftBidAdapter.js +1 -1
  61. package/dist/magniteAnalyticsAdapter.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/medianetRtdProvider.js +1 -1
  66. package/dist/mediasquareBidAdapter.js +1 -1
  67. package/dist/mgidBidAdapter.js +1 -1
  68. package/dist/minutemediaBidAdapter.js +1 -1
  69. package/dist/nexx360BidAdapter.js +1 -1
  70. package/dist/not-for-prod/prebid.js +126 -123
  71. package/dist/oguryBidAdapter.js +1 -1
  72. package/dist/onetagBidAdapter.js +1 -1
  73. package/dist/ooloAnalyticsAdapter.js +1 -1
  74. package/dist/orbitsoftBidAdapter.js +1 -0
  75. package/dist/outbrainBidAdapter.js +1 -1
  76. package/dist/parrableIdSystem.js +1 -1
  77. package/dist/permutiveRtdProvider.js +1 -1
  78. package/dist/pixfutureBidAdapter.js +1 -1
  79. package/dist/prebid-core.js +1 -1
  80. package/dist/publinkIdSystem.js +1 -1
  81. package/dist/pubmaticBidAdapter.js +1 -1
  82. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  83. package/dist/pxyzBidAdapter.js +1 -1
  84. package/dist/quantcastBidAdapter.js +1 -1
  85. package/dist/readpeakBidAdapter.js +1 -1
  86. package/dist/relaidoBidAdapter.js +1 -1
  87. package/dist/rhythmoneBidAdapter.js +1 -1
  88. package/dist/riseBidAdapter.js +1 -1
  89. package/dist/rubiconAnalyticsAdapter.js +1 -1
  90. package/dist/rubiconBidAdapter.js +1 -1
  91. package/dist/seedingAllianceBidAdapter.js +1 -1
  92. package/dist/seedtagBidAdapter.js +1 -1
  93. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  94. package/dist/sharethroughBidAdapter.js +1 -1
  95. package/dist/shinezBidAdapter.js +1 -1
  96. package/dist/smaatoBidAdapter.js +1 -1
  97. package/dist/smartadserverBidAdapter.js +1 -1
  98. package/dist/smartxBidAdapter.js +1 -1
  99. package/dist/smilewantedBidAdapter.js +1 -1
  100. package/dist/sonobiBidAdapter.js +1 -1
  101. package/dist/sovrnAnalyticsAdapter.js +1 -1
  102. package/dist/sovrnBidAdapter.js +1 -1
  103. package/dist/sspBCBidAdapter.js +1 -1
  104. package/dist/sublimeBidAdapter.js +1 -1
  105. package/dist/synacormediaBidAdapter.js +1 -1
  106. package/dist/taboolaBidAdapter.js +1 -1
  107. package/dist/targetVideoBidAdapter.js +1 -1
  108. package/dist/teadsBidAdapter.js +1 -1
  109. package/dist/trionBidAdapter.js +1 -1
  110. package/dist/tripleliftBidAdapter.js +1 -1
  111. package/dist/ttdBidAdapter.js +1 -1
  112. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  113. package/dist/uid2IdSystem.js +1 -1
  114. package/dist/underdogmediaBidAdapter.js +1 -1
  115. package/dist/undertoneBidAdapter.js +1 -1
  116. package/dist/vidazooBidAdapter.js +1 -1
  117. package/dist/videobyteBidAdapter.js +1 -1
  118. package/dist/visxBidAdapter.js +1 -1
  119. package/dist/vuukleBidAdapter.js +1 -1
  120. package/dist/widespaceBidAdapter.js +1 -1
  121. package/dist/winrBidAdapter.js +1 -1
  122. package/dist/yahoosspBidAdapter.js +1 -1
  123. package/dist/yieldlabBidAdapter.js +1 -1
  124. package/dist/yieldmoBidAdapter.js +1 -1
  125. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  126. package/integrationExamples/gpt/adloox.html +5 -0
  127. package/modules/adagioBidAdapter.js +0 -4
  128. package/modules/adagioBidAdapter.md +4 -22
  129. package/modules/adlooxAnalyticsAdapter.md +5 -3
  130. package/modules/adlooxRtdProvider.js +82 -278
  131. package/modules/adlooxRtdProvider.md +6 -6
  132. package/modules/aidemBidAdapter.js +4 -0
  133. package/modules/aidemBidAdapter.md +1 -0
  134. package/modules/alkimiBidAdapter.js +23 -6
  135. package/modules/aolBidAdapter.js +12 -0
  136. package/modules/appnexusBidAdapter.js +2 -2
  137. package/modules/appushBidAdapter.js +188 -0
  138. package/modules/appushBidAdapter.md +79 -0
  139. package/modules/asoBidAdapter.js +8 -5
  140. package/modules/confiantRtdProvider.js +1 -1
  141. package/modules/connectIdSystem.js +15 -1
  142. package/modules/feedadBidAdapter.js +7 -5
  143. package/modules/holidBidAdapter.js +170 -0
  144. package/modules/holidBidAdapter.md +36 -0
  145. package/modules/jwplayerVideoProvider.js +10 -3
  146. package/modules/kueezRtbBidAdapter.js +21 -8
  147. package/modules/medianetRtdProvider.js +4 -4
  148. package/modules/nexx360BidAdapter.js +5 -7
  149. package/modules/orbitsoftBidAdapter.js +150 -0
  150. package/modules/permutiveRtdProvider.js +1 -1
  151. package/modules/riseBidAdapter.js +2 -1
  152. package/modules/riseBidAdapter.md +2 -0
  153. package/modules/seedtagBidAdapter.js +12 -0
  154. package/modules/smartxBidAdapter.js +6 -0
  155. package/modules/taboolaBidAdapter.js +61 -14
  156. package/modules/yahoosspBidAdapter.js +5 -0
  157. package/modules/yieldlabBidAdapter.js +150 -134
  158. package/modules/yieldmoBidAdapter.js +1 -12
  159. package/package.json +1 -1
  160. package/test/spec/modules/adagioBidAdapter_spec.js +1 -28
  161. package/test/spec/modules/adlooxRtdProvider_spec.js +28 -120
  162. package/test/spec/modules/aidemBidAdapter_spec.js +10 -2
  163. package/test/spec/modules/alkimiBidAdapter_spec.js +15 -3
  164. package/test/spec/modules/aolBidAdapter_spec.js +22 -0
  165. package/test/spec/modules/appnexusBidAdapter_spec.js +7 -3
  166. package/test/spec/modules/appushBidAdapter_spec.js +372 -0
  167. package/test/spec/modules/connectIdSystem_spec.js +17 -5
  168. package/test/spec/modules/feedadBidAdapter_spec.js +23 -1
  169. package/test/spec/modules/holidBidAdapter_spec.js +165 -0
  170. package/test/spec/modules/kueezRtbBidAdapter_spec.js +147 -24
  171. package/test/spec/modules/medianetRtdProvider_spec.js +3 -3
  172. package/test/spec/modules/orbitsoftBidAdapter_spec.js +255 -0
  173. package/test/spec/modules/riseBidAdapter_spec.js +7 -0
  174. package/test/spec/modules/seedtagBidAdapter_spec.js +56 -10
  175. package/test/spec/modules/smartxBidAdapter_spec.js +10 -0
  176. package/test/spec/modules/taboolaBidAdapter_spec.js +142 -5
  177. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +45 -10
  178. package/test/spec/modules/yahoosspBidAdapter_spec.js +16 -1
  179. package/test/spec/modules/yieldlabBidAdapter_spec.js +311 -301
  180. package/test/spec/modules/yieldmoBidAdapter_spec.js +70 -0
@@ -1,4 +1,4 @@
1
- import {expect} from 'chai';
1
+ import { expect } from 'chai';
2
2
  import {
3
3
  spec as adapter,
4
4
  SUPPORTED_ID_SYSTEMS,
@@ -13,8 +13,9 @@ import {
13
13
  getUniqueDealId,
14
14
  } from 'modules/kueezRtbBidAdapter.js';
15
15
  import * as utils from 'src/utils.js';
16
- import {version} from 'package.json';
17
- import {useFakeTimers} from 'sinon';
16
+ import { version } from 'package.json';
17
+ import { useFakeTimers } from 'sinon';
18
+ import { BANNER, VIDEO } from '../../../src/mediaTypes';
18
19
 
19
20
  const SUB_DOMAIN = 'exchange';
20
21
 
@@ -36,9 +37,42 @@ const BID = {
36
37
  'sizes': [[300, 250], [300, 600]],
37
38
  'bidderRequestId': '1fdb5ff1b6eaa7',
38
39
  'requestId': 'b0777d85-d061-450e-9bc7-260dd54bbb7a',
39
- 'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc'
40
+ 'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
41
+ 'mediaTypes': [BANNER]
40
42
  };
41
43
 
44
+ const VIDEO_BID = {
45
+ 'bidId': '2d52001cabd527',
46
+ 'adUnitCode': '63550ad1ff6642d368cba59dh5884270560',
47
+ 'bidderRequestId': '12a8ae9ada9c13',
48
+ 'transactionId': '56e184c6-bde9-497b-b9b9-cf47a61381ee',
49
+ 'schain': 'a0819c69-005b-41ed-af06-1be1e0aefefc',
50
+ 'params': {
51
+ 'subDomain': SUB_DOMAIN,
52
+ 'cId': '635509f7ff6642d368cb9837',
53
+ 'pId': '59ac17c192832d0011283fe3',
54
+ 'bidFloor': 0.1
55
+ },
56
+ 'sizes': [[545, 307]],
57
+ 'mediaTypes': {
58
+ 'video': {
59
+ 'playerSize': [[545, 307]],
60
+ 'context': 'instream',
61
+ 'mimes': [
62
+ 'video/mp4',
63
+ 'application/javascript'
64
+ ],
65
+ 'protocols': [2, 3, 5, 6],
66
+ 'maxduration': 60,
67
+ 'minduration': 0,
68
+ 'startdelay': 0,
69
+ 'linearity': 1,
70
+ 'api': [2],
71
+ 'placement': 1
72
+ }
73
+ }
74
+ }
75
+
42
76
  const BIDDER_REQUEST = {
43
77
  'gdprConsent': {
44
78
  'consentString': 'consent_string',
@@ -73,6 +107,23 @@ const SERVER_RESPONSE = {
73
107
  }
74
108
  };
75
109
 
110
+ const VIDEO_SERVER_RESPONSE = {
111
+ body: {
112
+ 'cid': '635509f7ff6642d368cb9837',
113
+ 'results': [{
114
+ 'ad': '<VAST version=\"3.0\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"></VAST>',
115
+ 'advertiserDomains': ['kueezrtb.com'],
116
+ 'exp': 60,
117
+ 'width': 545,
118
+ 'height': 307,
119
+ 'mediaType': 'video',
120
+ 'creativeId': '12610997325162499419',
121
+ 'price': 2,
122
+ 'cookies': []
123
+ }]
124
+ }
125
+ };
126
+
76
127
  const REQUEST = {
77
128
  data: {
78
129
  width: 300,
@@ -83,7 +134,7 @@ const REQUEST = {
83
134
 
84
135
  function getTopWindowQueryParams() {
85
136
  try {
86
- const parsedUrl = utils.parseUrl(window.top.document.URL, {decodeSearchAsString: true});
137
+ const parsedUrl = utils.parseUrl(window.top.document.URL, { decodeSearchAsString: true });
87
138
  return parsedUrl.search;
88
139
  } catch (e) {
89
140
  return '';
@@ -111,6 +162,11 @@ describe('KueezRtbBidAdapter', function () {
111
162
  it('exists and is a string', function () {
112
163
  expect(adapter.code).to.exist.and.to.be.a('string');
113
164
  });
165
+
166
+ it('exists and contains media types', function () {
167
+ expect(adapter.supportedMediaTypes).to.exist.and.to.be.an('array').with.length(2);
168
+ expect(adapter.supportedMediaTypes).to.contain.members([BANNER, VIDEO]);
169
+ });
114
170
  });
115
171
 
116
172
  describe('validate bid requests', function () {
@@ -155,7 +211,53 @@ describe('KueezRtbBidAdapter', function () {
155
211
  sandbox.stub(Date, 'now').returns(1000);
156
212
  });
157
213
 
158
- it('should build request for each size', function () {
214
+ it('should build video request', function () {
215
+ const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
216
+ const requests = adapter.buildRequests([VIDEO_BID], BIDDER_REQUEST);
217
+ expect(requests).to.have.length(1);
218
+ expect(requests[0]).to.deep.equal({
219
+ method: 'POST',
220
+ url: `${createDomain(SUB_DOMAIN)}/prebid/multi/635509f7ff6642d368cb9837`,
221
+ data: {
222
+ adUnitCode: '63550ad1ff6642d368cba59dh5884270560',
223
+ bidFloor: 0.1,
224
+ bidId: '2d52001cabd527',
225
+ bidderVersion: adapter.version,
226
+ cb: 1000,
227
+ gdpr: 1,
228
+ gdprConsent: 'consent_string',
229
+ usPrivacy: 'consent_string',
230
+ prebidVersion: version,
231
+ publisherId: '59ac17c192832d0011283fe3',
232
+ url: 'https%3A%2F%2Fwww.greatsite.com',
233
+ referrer: 'https://www.somereferrer.com',
234
+ res: `${window.top.screen.width}x${window.top.screen.height}`,
235
+ schain: VIDEO_BID.schain,
236
+ sizes: ['545x307'],
237
+ uniqueDealId: `${hashUrl}_${Date.now().toString()}`,
238
+ uqs: getTopWindowQueryParams(),
239
+ mediaTypes: {
240
+ video: {
241
+ api: [2],
242
+ context: 'instream',
243
+ linearity: 1,
244
+ maxduration: 60,
245
+ mimes: [
246
+ 'video/mp4',
247
+ 'application/javascript'
248
+ ],
249
+ minduration: 0,
250
+ placement: 1,
251
+ playerSize: [[545, 307]],
252
+ protocols: [2, 3, 5, 6],
253
+ startdelay: 0
254
+ }
255
+ }
256
+ }
257
+ });
258
+ });
259
+
260
+ it('should build banner request for each size', function () {
159
261
  const hashUrl = hashCode(BIDDER_REQUEST.refererInfo.page);
160
262
  const requests = adapter.buildRequests([BID], BIDDER_REQUEST);
161
263
  expect(requests).to.have.length(1);
@@ -179,6 +281,7 @@ describe('KueezRtbBidAdapter', function () {
179
281
  prebidVersion: version,
180
282
  schain: BID.schain,
181
283
  res: `${window.top.screen.width}x${window.top.screen.height}`,
284
+ mediaTypes: [BANNER],
182
285
  uqs: getTopWindowQueryParams(),
183
286
  'ext.param1': 'loremipsum',
184
287
  'ext.param2': 'dolorsitamet',
@@ -193,7 +296,7 @@ describe('KueezRtbBidAdapter', function () {
193
296
  });
194
297
  describe('getUserSyncs', function () {
195
298
  it('should have valid user sync with iframeEnabled', function () {
196
- const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
299
+ const result = adapter.getUserSyncs({ iframeEnabled: true }, [SERVER_RESPONSE]);
197
300
 
198
301
  expect(result).to.deep.equal([{
199
302
  type: 'iframe',
@@ -202,7 +305,7 @@ describe('KueezRtbBidAdapter', function () {
202
305
  });
203
306
 
204
307
  it('should have valid user sync with cid on response', function () {
205
- const result = adapter.getUserSyncs({iframeEnabled: true}, [SERVER_RESPONSE]);
308
+ const result = adapter.getUserSyncs({ iframeEnabled: true }, [SERVER_RESPONSE]);
206
309
  expect(result).to.deep.equal([{
207
310
  type: 'iframe',
208
311
  url: 'https://sync.kueezrtb.com/api/sync/iframe/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy='
@@ -210,7 +313,7 @@ describe('KueezRtbBidAdapter', function () {
210
313
  });
211
314
 
212
315
  it('should have valid user sync with pixelEnabled', function () {
213
- const result = adapter.getUserSyncs({pixelEnabled: true}, [SERVER_RESPONSE]);
316
+ const result = adapter.getUserSyncs({ pixelEnabled: true }, [SERVER_RESPONSE]);
214
317
 
215
318
  expect(result).to.deep.equal([{
216
319
  'url': 'https://sync.kueezrtb.com/api/sync/image/?cid=testcid123&gdpr=0&gdpr_consent=&us_privacy=',
@@ -226,16 +329,16 @@ describe('KueezRtbBidAdapter', function () {
226
329
  });
227
330
 
228
331
  it('should return empty array when there is no ad', function () {
229
- const responses = adapter.interpretResponse({price: 1, ad: ''});
332
+ const responses = adapter.interpretResponse({ price: 1, ad: '' });
230
333
  expect(responses).to.be.empty;
231
334
  });
232
335
 
233
336
  it('should return empty array when there is no price', function () {
234
- const responses = adapter.interpretResponse({price: null, ad: 'great ad'});
337
+ const responses = adapter.interpretResponse({ price: null, ad: 'great ad' });
235
338
  expect(responses).to.be.empty;
236
339
  });
237
340
 
238
- it('should return an array of interpreted responses', function () {
341
+ it('should return an array of interpreted banner responses', function () {
239
342
  const responses = adapter.interpretResponse(SERVER_RESPONSE, REQUEST);
240
343
  expect(responses).to.have.length(1);
241
344
  expect(responses[0]).to.deep.equal({
@@ -254,6 +357,26 @@ describe('KueezRtbBidAdapter', function () {
254
357
  });
255
358
  });
256
359
 
360
+ it('should return an array of interpreted video responses', function () {
361
+ const responses = adapter.interpretResponse(VIDEO_SERVER_RESPONSE, REQUEST);
362
+ expect(responses).to.have.length(1);
363
+ expect(responses[0]).to.deep.equal({
364
+ requestId: '2d52001cabd527',
365
+ cpm: 2,
366
+ width: 545,
367
+ height: 307,
368
+ mediaType: 'video',
369
+ creativeId: '12610997325162499419',
370
+ currency: 'USD',
371
+ netRevenue: true,
372
+ ttl: 60,
373
+ vastXml: '<VAST version=\"3.0\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"></VAST>',
374
+ meta: {
375
+ advertiserDomains: ['kueezrtb.com']
376
+ }
377
+ });
378
+ });
379
+
257
380
  it('should take default TTL', function () {
258
381
  const serverResponse = utils.deepClone(SERVER_RESPONSE);
259
382
  delete serverResponse.body.results[0].exp;
@@ -271,11 +394,11 @@ describe('KueezRtbBidAdapter', function () {
271
394
  const userId = (function () {
272
395
  switch (idSystemProvider) {
273
396
  case 'lipb':
274
- return {lipbid: id};
397
+ return { lipbid: id };
275
398
  case 'parrableId':
276
- return {eid: id};
399
+ return { eid: id };
277
400
  case 'id5id':
278
- return {uid: id};
401
+ return { uid: id };
279
402
  default:
280
403
  return id;
281
404
  }
@@ -294,18 +417,18 @@ describe('KueezRtbBidAdapter', function () {
294
417
 
295
418
  describe('alternate param names extractors', function () {
296
419
  it('should return undefined when param not supported', function () {
297
- const cid = extractCID({'c_id': '1'});
298
- const pid = extractPID({'p_id': '1'});
299
- const subDomain = extractSubDomain({'sub_domain': 'prebid'});
420
+ const cid = extractCID({ 'c_id': '1' });
421
+ const pid = extractPID({ 'p_id': '1' });
422
+ const subDomain = extractSubDomain({ 'sub_domain': 'prebid' });
300
423
  expect(cid).to.be.undefined;
301
424
  expect(pid).to.be.undefined;
302
425
  expect(subDomain).to.be.undefined;
303
426
  });
304
427
 
305
428
  it('should return value when param supported', function () {
306
- const cid = extractCID({'cID': '1'});
307
- const pid = extractPID({'Pid': '2'});
308
- const subDomain = extractSubDomain({'subDOMAIN': 'prebid'});
429
+ const cid = extractCID({ 'cID': '1' });
430
+ const pid = extractPID({ 'Pid': '2' });
431
+ const subDomain = extractSubDomain({ 'subDOMAIN': 'prebid' });
309
432
  expect(cid).to.be.equal('1');
310
433
  expect(pid).to.be.equal('2');
311
434
  expect(subDomain).to.be.equal('prebid');
@@ -365,7 +488,7 @@ describe('KueezRtbBidAdapter', function () {
365
488
  now
366
489
  });
367
490
  setStorageItem('myKey', 2020);
368
- const {value, created} = getStorageItem('myKey');
491
+ const { value, created } = getStorageItem('myKey');
369
492
  expect(created).to.be.equal(now);
370
493
  expect(value).to.be.equal(2020);
371
494
  expect(typeof value).to.be.equal('number');
@@ -381,8 +504,8 @@ describe('KueezRtbBidAdapter', function () {
381
504
  });
382
505
 
383
506
  it('should parse JSON value', function () {
384
- const data = JSON.stringify({event: 'send'});
385
- const {event} = tryParseJSON(data);
507
+ const data = JSON.stringify({ event: 'send' });
508
+ const { event } = tryParseJSON(data);
386
509
  expect(event).to.be.equal('send');
387
510
  });
388
511
 
@@ -66,12 +66,12 @@ describe('medianet realtime module', function () {
66
66
  describe('getTargeting should work correctly', function () {
67
67
  it('should return empty if not loaded', function () {
68
68
  window.mnjs.loaded = false;
69
- assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData([]), {});
69
+ assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData([], {}, {}, {}), {});
70
70
  });
71
71
 
72
72
  it('should return ad unit codes when ad units are present', function () {
73
73
  const adUnitCodes = ['code1', 'code2'];
74
- assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData(adUnitCodes), {
74
+ assert.deepEqual(medianetRTD.medianetRtdModule.getTargetingData(adUnitCodes, {}, {}, {}), {
75
75
  code1: {'mnadc': 'code1'},
76
76
  code2: {'mnadc': 'code2'},
77
77
  });
@@ -79,7 +79,7 @@ describe('medianet realtime module', function () {
79
79
 
80
80
  it('should call mnjs.getTargetingData if loaded', function () {
81
81
  window.mnjs.loaded = true;
82
- medianetRTD.medianetRtdModule.getTargetingData([]);
82
+ medianetRTD.medianetRtdModule.getTargetingData([], {}, {}, {});
83
83
  assert.equal(getTargetingDataSpy.called, true);
84
84
  });
85
85
  });
@@ -0,0 +1,255 @@
1
+ import {expect} from 'chai';
2
+ import {spec} from 'modules/orbitsoftBidAdapter.js';
3
+
4
+ const ENDPOINT_URL = 'https://orbitsoft.com/php/ads/hb.phps';
5
+ const REFERRER_URL = 'http://referrer.url/?_=';
6
+
7
+ describe('Orbitsoft adapter', function () {
8
+ describe('implementation', function () {
9
+ describe('for requests', function () {
10
+ it('should accept valid bid', function () {
11
+ let validBid = {
12
+ bidder: 'orbitsoft',
13
+ params: {
14
+ placementId: '123',
15
+ requestUrl: ENDPOINT_URL
16
+ }
17
+ },
18
+ isValid = spec.isBidRequestValid(validBid);
19
+
20
+ expect(isValid).to.equal(true);
21
+ });
22
+
23
+ it('should reject invalid bid', function () {
24
+ let invalidBid = {
25
+ bidder: 'orbitsoft'
26
+ },
27
+ isValid = spec.isBidRequestValid(invalidBid);
28
+
29
+ expect(isValid).to.equal(false);
30
+ });
31
+ });
32
+ describe('for requests', function () {
33
+ it('should accept valid bid with styles', function () {
34
+ let validBid = {
35
+ bidder: 'orbitsoft',
36
+ params: {
37
+ placementId: '123',
38
+ requestUrl: ENDPOINT_URL,
39
+ style: {
40
+ title: {
41
+ family: 'Tahoma',
42
+ size: 'medium',
43
+ weight: 'normal',
44
+ style: 'normal',
45
+ color: '0053F9'
46
+ },
47
+ description: {
48
+ family: 'Tahoma',
49
+ size: 'medium',
50
+ weight: 'normal',
51
+ style: 'normal',
52
+ color: '0053F9'
53
+ },
54
+ url: {
55
+ family: 'Tahoma',
56
+ size: 'medium',
57
+ weight: 'normal',
58
+ style: 'normal',
59
+ color: '0053F9'
60
+ },
61
+ colors: {
62
+ background: 'ffffff',
63
+ border: 'E0E0E0',
64
+ link: '5B99FE'
65
+ }
66
+ }
67
+ },
68
+ refererInfo: {referer: REFERRER_URL},
69
+ },
70
+ isValid = spec.isBidRequestValid(validBid);
71
+ expect(isValid).to.equal(true);
72
+
73
+ let buildRequest = spec.buildRequests([validBid])[0];
74
+ let requestUrl = buildRequest.url;
75
+ let requestUrlParams = buildRequest.data;
76
+ expect(requestUrl).to.equal(ENDPOINT_URL);
77
+ expect(requestUrlParams).have.property('f1', 'Tahoma');
78
+ expect(requestUrlParams).have.property('fs1', 'medium');
79
+ expect(requestUrlParams).have.property('w1', 'normal');
80
+ expect(requestUrlParams).have.property('s1', 'normal');
81
+ expect(requestUrlParams).have.property('c3', '0053F9');
82
+ expect(requestUrlParams).have.property('f2', 'Tahoma');
83
+ expect(requestUrlParams).have.property('fs2', 'medium');
84
+ expect(requestUrlParams).have.property('w2', 'normal');
85
+ expect(requestUrlParams).have.property('s2', 'normal');
86
+ expect(requestUrlParams).have.property('c4', '0053F9');
87
+ expect(requestUrlParams).have.property('f3', 'Tahoma');
88
+ expect(requestUrlParams).have.property('fs3', 'medium');
89
+ expect(requestUrlParams).have.property('w3', 'normal');
90
+ expect(requestUrlParams).have.property('s3', 'normal');
91
+ expect(requestUrlParams).have.property('c5', '0053F9');
92
+ expect(requestUrlParams).have.property('c2', 'ffffff');
93
+ expect(requestUrlParams).have.property('c1', 'E0E0E0');
94
+ expect(requestUrlParams).have.property('c6', '5B99FE');
95
+ });
96
+
97
+ it('should accept valid bid with custom params', function () {
98
+ let validBid = {
99
+ bidder: 'orbitsoft',
100
+ params: {
101
+ placementId: '123',
102
+ requestUrl: ENDPOINT_URL,
103
+ customParams: {
104
+ cacheBuster: 'bf4d7c1',
105
+ clickUrl: 'http://testclickurl.com'
106
+ }
107
+ },
108
+ refererInfo: {referer: REFERRER_URL},
109
+ },
110
+ isValid = spec.isBidRequestValid(validBid);
111
+ expect(isValid).to.equal(true);
112
+
113
+ let buildRequest = spec.buildRequests([validBid])[0];
114
+ let requestUrlCustomParams = buildRequest.data;
115
+ expect(requestUrlCustomParams).have.property('c.cacheBuster', 'bf4d7c1');
116
+ expect(requestUrlCustomParams).have.property('c.clickUrl', 'http://testclickurl.com');
117
+ });
118
+
119
+ it('should reject invalid bid without requestUrl', function () {
120
+ let invalidBid = {
121
+ bidder: 'orbitsoft',
122
+ params: {
123
+ placementId: '123'
124
+ }
125
+ },
126
+ isValid = spec.isBidRequestValid(invalidBid);
127
+
128
+ expect(isValid).to.equal(false);
129
+ });
130
+
131
+ it('should reject invalid bid without placementId', function () {
132
+ let invalidBid = {
133
+ bidder: 'orbitsoft',
134
+ params: {
135
+ requestUrl: ENDPOINT_URL
136
+ }
137
+ },
138
+ isValid = spec.isBidRequestValid(invalidBid);
139
+
140
+ expect(isValid).to.equal(false);
141
+ });
142
+ });
143
+ describe('bid responses', function () {
144
+ it('should return complete bid response', function () {
145
+ let serverResponse = {
146
+ body: {
147
+ callback_uid: '265b29b70cc106',
148
+ cpm: 0.5,
149
+ width: 240,
150
+ height: 240,
151
+ content_url: 'https://orbitsoft.com/php/ads/hb.html',
152
+ adomain: ['test.adomain.tld']
153
+ }
154
+ };
155
+
156
+ let bidRequests = [
157
+ {
158
+ bidder: 'orbitsoft',
159
+ params: {
160
+ placementId: '123',
161
+ requestUrl: ENDPOINT_URL
162
+ }
163
+ }
164
+ ];
165
+ let bids = spec.interpretResponse(serverResponse, {'bidRequest': bidRequests[0]});
166
+ expect(bids).to.be.lengthOf(1);
167
+ expect(bids[0].cpm).to.equal(serverResponse.body.cpm);
168
+ expect(bids[0].width).to.equal(serverResponse.body.width);
169
+ expect(bids[0].height).to.equal(serverResponse.body.height);
170
+ expect(bids[0].currency).to.equal('USD');
171
+ expect(bids[0].netRevenue).to.equal(true);
172
+ expect(bids[0].adUrl).to.have.length.above(1);
173
+ expect(bids[0].adUrl).to.have.string('https://orbitsoft.com/php/ads/hb.html');
174
+ expect(Object.keys(bids[0].meta)).to.include.members(['advertiserDomains']);
175
+ expect(bids[0].meta.advertiserDomains).to.deep.equal(serverResponse.body.adomain);
176
+ });
177
+
178
+ it('should return empty bid response', function () {
179
+ let bidRequests = [
180
+ {
181
+ bidder: 'orbitsoft',
182
+ params: {
183
+ placementId: '123',
184
+ requestUrl: ENDPOINT_URL
185
+ }
186
+ }
187
+ ];
188
+ let serverResponse = {
189
+ body: {
190
+ callback_uid: '265b29b70cc106',
191
+ cpm: 0
192
+ }
193
+ },
194
+ bids = spec.interpretResponse(serverResponse, {'bidRequest': bidRequests[0]});
195
+
196
+ expect(bids).to.be.lengthOf(0);
197
+ });
198
+
199
+ it('should return empty bid response on incorrect size', function () {
200
+ let bidRequests = [
201
+ {
202
+ bidder: 'orbitsoft',
203
+ params: {
204
+ placementId: '123',
205
+ requestUrl: ENDPOINT_URL
206
+ }
207
+ }
208
+ ];
209
+ let serverResponse = {
210
+ body: {
211
+ callback_uid: '265b29b70cc106',
212
+ cpm: 1.5,
213
+ width: 0,
214
+ height: 0
215
+ }
216
+ },
217
+ bids = spec.interpretResponse(serverResponse, {'bidRequest': bidRequests[0]});
218
+
219
+ expect(bids).to.be.lengthOf(0);
220
+ });
221
+
222
+ it('should return empty bid response with error', function () {
223
+ let bidRequests = [
224
+ {
225
+ bidder: 'orbitsoft',
226
+ params: {
227
+ placementId: '123',
228
+ requestUrl: ENDPOINT_URL
229
+ }
230
+ }
231
+ ];
232
+ let serverResponse = {error: 'error'},
233
+ bids = spec.interpretResponse(serverResponse, {'bidRequest': bidRequests[0]});
234
+
235
+ expect(bids).to.be.lengthOf(0);
236
+ });
237
+
238
+ it('should return empty bid response on empty body', function () {
239
+ let bidRequests = [
240
+ {
241
+ bidder: 'orbitsoft',
242
+ params: {
243
+ placementId: '123',
244
+ requestUrl: ENDPOINT_URL
245
+ }
246
+ }
247
+ ];
248
+ let serverResponse = {},
249
+ bids = spec.interpretResponse(serverResponse, {'bidRequest': bidRequests[0]});
250
+
251
+ expect(bids).to.be.lengthOf(0);
252
+ });
253
+ });
254
+ });
255
+ });
@@ -116,6 +116,13 @@ describe('riseAdapter', function () {
116
116
  expect(request.data.bids[0].placementId).to.equal(placementId);
117
117
  });
118
118
 
119
+ it('sends the is_wrapper parameter to ENDPOINT via POST', function() {
120
+ const request = spec.buildRequests(bidRequests, bidderRequest);
121
+ expect(request.data.params).to.be.an('object');
122
+ expect(request.data.params).to.have.property('is_wrapper');
123
+ expect(request.data.params.is_wrapper).to.equal(false);
124
+ });
125
+
119
126
  it('sends bid request to ENDPOINT via POST', function () {
120
127
  const request = spec.buildRequests(bidRequests, bidderRequest);
121
128
  expect(request.url).to.equal(ENDPOINT);
@@ -395,6 +395,52 @@ describe('Seedtag Adapter', function () {
395
395
  expect(payload.schain).to.not.exist;
396
396
  });
397
397
  });
398
+
399
+ describe('GPP param', function () {
400
+ it('should be added to payload when bidderRequest has gppConsent param', function () {
401
+ const gppConsent = {
402
+ gppString: 'someGppString',
403
+ applicableSections: [7]
404
+ }
405
+ bidderRequest['gppConsent'] = gppConsent
406
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
407
+ const data = JSON.parse(request.data);
408
+ expect(data.gppConsent).to.exist;
409
+ expect(data.gppConsent.gppString).to.equal(gppConsent.gppString);
410
+ expect(data.gppConsent.applicableSections[0]).to.equal(gppConsent.applicableSections[0]);
411
+ });
412
+
413
+ it('should be undefined on payload when bidderRequest has not gppConsent param', function () {
414
+ bidderRequest.gppConsent = undefined
415
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
416
+ const data = JSON.parse(request.data);
417
+ expect(data.gppConsent).to.be.undefined;
418
+ });
419
+
420
+ it('should be added to payload when bidderRequest has ortb2 param', function () {
421
+ const ortb2 = {
422
+ regs: {
423
+ gpp: 'someGppString',
424
+ gpp_sid: [7]
425
+ }
426
+ }
427
+ bidderRequest['gppConsent'] = undefined
428
+ bidderRequest['ortb2'] = ortb2;
429
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
430
+ const data = JSON.parse(request.data);
431
+ expect(data.gppConsent).to.exist;
432
+ expect(data.gppConsent.gppString).to.equal(ortb2.regs.gpp);
433
+ expect(data.gppConsent.applicableSections[0]).to.equal(ortb2.regs.gpp_sid[0]);
434
+ });
435
+
436
+ it('should be added to payload when bidderRequest has neither gppConsent nor ortb2', function () {
437
+ bidderRequest['ortb2'] = undefined;
438
+ bidderRequest['gppConsent'] = undefined;
439
+ const request = spec.buildRequests(validBidRequests, bidderRequest);
440
+ const data = JSON.parse(request.data);
441
+ expect(data.gppConsent).to.be.undefined;
442
+ });
443
+ });
398
444
  });
399
445
 
400
446
  describe('interpret response method', function () {
@@ -533,11 +579,11 @@ describe('Seedtag Adapter', function () {
533
579
  const timeoutUrl = getTimeoutUrl(timeoutData);
534
580
  expect(timeoutUrl).to.equal(
535
581
  'https://s.seedtag.com/se/hb/timeout?publisherToken=' +
536
- params.publisherId +
537
- '&adUnitId=' +
538
- params.adUnitId +
539
- '&timeout=' +
540
- timeout
582
+ params.publisherId +
583
+ '&adUnitId=' +
584
+ params.adUnitId +
585
+ '&timeout=' +
586
+ timeout
541
587
  );
542
588
  });
543
589
 
@@ -549,11 +595,11 @@ describe('Seedtag Adapter', function () {
549
595
  expect(
550
596
  utils.triggerPixel.calledWith(
551
597
  'https://s.seedtag.com/se/hb/timeout?publisherToken=' +
552
- params.publisherId +
553
- '&adUnitId=' +
554
- params.adUnitId +
555
- '&timeout=' +
556
- timeout
598
+ params.publisherId +
599
+ '&adUnitId=' +
600
+ params.adUnitId +
601
+ '&timeout=' +
602
+ timeout
557
603
  )
558
604
  ).to.equal(true);
559
605
  });