prebid.js 8.40.0 → 8.41.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 (199) hide show
  1. package/dist/33acrossAnalyticsAdapter.js +1 -1
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.js +1 -1
  4. package/dist/BTBidAdapter.js +1 -1
  5. package/dist/adagioAnalyticsAdapter.js +1 -1
  6. package/dist/adagioBidAdapter.js +1 -1
  7. package/dist/adbookpspBidAdapter.js +1 -1
  8. package/dist/adgenerationBidAdapter.js +1 -1
  9. package/dist/adkernelBidAdapter.js +1 -1
  10. package/dist/adqueryBidAdapter.js +1 -1
  11. package/dist/adrelevantisBidAdapter.js +1 -1
  12. package/dist/adstirBidAdapter.js +1 -1
  13. package/dist/adtrgtmeBidAdapter.js +1 -1
  14. package/dist/adxcgBidAdapter.js +1 -1
  15. package/dist/adyoulikeBidAdapter.js +1 -1
  16. package/dist/agmaAnalyticsAdapter.js +1 -1
  17. package/dist/ajaBidAdapter.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/appnexusBidAdapter.js +1 -1
  22. package/dist/asoBidAdapter.js +1 -1
  23. package/dist/automatadAnalyticsAdapter.js +1 -1
  24. package/dist/axonixBidAdapter.js +1 -1
  25. package/dist/bidglassBidAdapter.js +1 -1
  26. package/dist/big-richmediaBidAdapter.js +1 -1
  27. package/dist/bridBidAdapter.js +1 -1
  28. package/dist/bridgewellBidAdapter.js +1 -1
  29. package/dist/brightMountainMediaBidAdapter.js +1 -1
  30. package/dist/carodaBidAdapter.js +1 -1
  31. package/dist/chtnwBidAdapter.js +1 -1
  32. package/dist/concertBidAdapter.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consumableBidAdapter.js +1 -1
  35. package/dist/conversantAnalyticsAdapter.js +1 -1
  36. package/dist/conversantBidAdapter.js +1 -1
  37. package/dist/craftBidAdapter.js +1 -1
  38. package/dist/criteoBidAdapter.js +1 -1
  39. package/dist/cwireBidAdapter.js +1 -1
  40. package/dist/discoveryBidAdapter.js +1 -1
  41. package/dist/dspxBidAdapter.js +1 -1
  42. package/dist/dxkultureBidAdapter.js +1 -1
  43. package/dist/eplanningBidAdapter.js +1 -1
  44. package/dist/euidIdSystem.js +1 -1
  45. package/dist/feedadBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/freewheel-sspBidAdapter.js +1 -1
  48. package/dist/gmosspBidAdapter.js +1 -1
  49. package/dist/goldbachBidAdapter.js +1 -1
  50. package/dist/greenbidsAnalyticsAdapter.js +1 -1
  51. package/dist/greenbidsRtdProvider.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gumgumBidAdapter.js +1 -1
  54. package/dist/h12mediaBidAdapter.js +1 -1
  55. package/dist/hypelabBidAdapter.js +1 -1
  56. package/dist/id5IdSystem.js +1 -1
  57. package/dist/illuminBidAdapter.js +1 -1
  58. package/dist/imdsBidAdapter.js +1 -1
  59. package/dist/improvedigitalBidAdapter.js +1 -1
  60. package/dist/insticatorBidAdapter.js +1 -1
  61. package/dist/ixBidAdapter.js +1 -1
  62. package/dist/jixieBidAdapter.js +1 -1
  63. package/dist/justpremiumBidAdapter.js +1 -1
  64. package/dist/kargoBidAdapter.js +1 -1
  65. package/dist/kimberliteBidAdapter.js +1 -1
  66. package/dist/konduitAnalyticsAdapter.js +1 -1
  67. package/dist/kueezBidAdapter.js +1 -1
  68. package/dist/kueezRtbBidAdapter.js +1 -1
  69. package/dist/lassoBidAdapter.js +1 -1
  70. package/dist/lifestreetBidAdapter.js +1 -1
  71. package/dist/liveIntentIdSystem.js +1 -1
  72. package/dist/logicadBidAdapter.js +1 -1
  73. package/dist/loglyliftBidAdapter.js +1 -1
  74. package/dist/luceadBidAdapter.js +1 -1
  75. package/dist/magniteAnalyticsAdapter.js +1 -1
  76. package/dist/malltvAnalyticsAdapter.js +1 -1
  77. package/dist/marsmediaBidAdapter.js +1 -1
  78. package/dist/mediafuseBidAdapter.js +1 -1
  79. package/dist/mediasquareBidAdapter.js +1 -1
  80. package/dist/mgidBidAdapter.js +1 -1
  81. package/dist/minutemediaBidAdapter.js +1 -1
  82. package/dist/minutemediaplusBidAdapter.js +1 -1
  83. package/dist/missenaBidAdapter.js +1 -1
  84. package/dist/nextMillenniumBidAdapter.js +1 -1
  85. package/dist/nexx360BidAdapter.js +1 -1
  86. package/dist/not-for-prod/prebid.js +155 -153
  87. package/dist/oguryBidAdapter.js +1 -1
  88. package/dist/onetagBidAdapter.js +1 -1
  89. package/dist/ooloAnalyticsAdapter.js +1 -1
  90. package/dist/openxBidAdapter.js +1 -1
  91. package/dist/optidigitalBidAdapter.js +1 -1
  92. package/dist/outbrainBidAdapter.js +1 -1
  93. package/dist/parrableIdSystem.js +1 -1
  94. package/dist/pixfutureBidAdapter.js +1 -1
  95. package/dist/prebid-core.js +1 -1
  96. package/dist/pstudioBidAdapter.js +1 -0
  97. package/dist/publinkIdSystem.js +1 -1
  98. package/dist/publirBidAdapter.js +1 -0
  99. package/dist/pubmaticAnalyticsAdapter.js +1 -1
  100. package/dist/pubmaticBidAdapter.js +1 -1
  101. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  102. package/dist/pxyzBidAdapter.js +1 -1
  103. package/dist/quantcastBidAdapter.js +1 -1
  104. package/dist/rasBidAdapter.js +1 -1
  105. package/dist/readpeakBidAdapter.js +1 -1
  106. package/dist/relaidoBidAdapter.js +1 -1
  107. package/dist/retailspotBidAdapter.js +1 -1
  108. package/dist/rhythmoneBidAdapter.js +1 -1
  109. package/dist/riseBidAdapter.js +1 -1
  110. package/dist/rtbhouseBidAdapter.js +1 -1
  111. package/dist/rubiconBidAdapter.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/shinezBidAdapter.js +1 -1
  117. package/dist/shinezRtbBidAdapter.js +1 -1
  118. package/dist/smaatoBidAdapter.js +1 -1
  119. package/dist/smartadserverBidAdapter.js +1 -1
  120. package/dist/smartxBidAdapter.js +1 -1
  121. package/dist/smartyadsBidAdapter.js +1 -1
  122. package/dist/smilewantedBidAdapter.js +1 -1
  123. package/dist/sonobiBidAdapter.js +1 -1
  124. package/dist/sovrnAnalyticsAdapter.js +1 -1
  125. package/dist/sovrnBidAdapter.js +1 -1
  126. package/dist/sspBCBidAdapter.js +1 -1
  127. package/dist/stnBidAdapter.js +1 -1
  128. package/dist/stvBidAdapter.js +1 -1
  129. package/dist/sublimeBidAdapter.js +1 -1
  130. package/dist/taboolaBidAdapter.js +1 -1
  131. package/dist/tagorasBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/themoneytizerBidAdapter.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/ttdBidAdapter.js +1 -1
  138. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  139. package/dist/uid2IdSystem.js +1 -1
  140. package/dist/underdogmediaBidAdapter.js +1 -1
  141. package/dist/undertoneBidAdapter.js +1 -1
  142. package/dist/unrulyBidAdapter.js +1 -1
  143. package/dist/userId.js +1 -1
  144. package/dist/vidazooBidAdapter.js +1 -1
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/visxBidAdapter.js +1 -1
  147. package/dist/vuukleBidAdapter.js +1 -1
  148. package/dist/weboramaRtdProvider.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/dist/zeta_global_sspBidAdapter.js +1 -1
  155. package/integrationExamples/gpt/publir_hello_world.html +84 -0
  156. package/modules/adkernelBidAdapter.js +2 -1
  157. package/modules/automatadAnalyticsAdapter.js +31 -22
  158. package/modules/discoveryBidAdapter.js +5 -4
  159. package/modules/hypelabBidAdapter.js +31 -5
  160. package/modules/kargoBidAdapter.js +25 -13
  161. package/modules/kueezRtbBidAdapter.js +1 -1
  162. package/modules/nextMillenniumBidAdapter.js +52 -33
  163. package/modules/nexx360BidAdapter.js +2 -3
  164. package/modules/onetagBidAdapter.js +2 -1
  165. package/modules/pstudioBidAdapter.js +435 -0
  166. package/modules/pstudioBidAdapter.md +148 -0
  167. package/modules/publirBidAdapter.js +391 -0
  168. package/modules/publirBidAdapter.md +47 -0
  169. package/modules/pubmaticAnalyticsAdapter.js +7 -2
  170. package/modules/rasBidAdapter.js +178 -22
  171. package/modules/rasBidAdapter.md +2 -2
  172. package/modules/rtbhouseBidAdapter.js +2 -1
  173. package/modules/sharethroughBidAdapter.js +4 -0
  174. package/modules/smartyadsBidAdapter.js +10 -2
  175. package/modules/sovrnBidAdapter.js +15 -8
  176. package/modules/sspBCBidAdapter.js +22 -17
  177. package/modules/taboolaBidAdapter.js +1 -1
  178. package/modules/userId/index.js +1 -1
  179. package/modules/weboramaRtdProvider.js +99 -36
  180. package/modules/weboramaRtdProvider.md +13 -4
  181. package/modules/zeta_global_sspBidAdapter.js +26 -1
  182. package/package.json +1 -1
  183. package/test/spec/modules/automatadAnalyticsAdapter_spec.js +102 -15
  184. package/test/spec/modules/discoveryBidAdapter_spec.js +1 -1
  185. package/test/spec/modules/hypelabBidAdapter_spec.js +5 -1
  186. package/test/spec/modules/kargoBidAdapter_spec.js +29 -11
  187. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +34 -3
  188. package/test/spec/modules/nexx360BidAdapter_spec.js +5 -5
  189. package/test/spec/modules/onetagBidAdapter_spec.js +4 -1
  190. package/test/spec/modules/pstudioBidAdapter_spec.js +514 -0
  191. package/test/spec/modules/publirBidAdapter_spec.js +488 -0
  192. package/test/spec/modules/pubmaticAnalyticsAdapter_spec.js +12 -1
  193. package/test/spec/modules/rasBidAdapter_spec.js +364 -2
  194. package/test/spec/modules/sharethroughBidAdapter_spec.js +35 -0
  195. package/test/spec/modules/sovrnBidAdapter_spec.js +39 -0
  196. package/test/spec/modules/sspBCBidAdapter_spec.js +1 -1
  197. package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
  198. package/test/spec/modules/weboramaRtdProvider_spec.js +114 -0
  199. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +4 -4
@@ -1,7 +1,6 @@
1
1
  import { expect } from 'chai';
2
2
  import { spec } from 'modules/rasBidAdapter.js';
3
3
  import { newBidder } from 'src/adapters/bidderFactory.js';
4
- import {getAdUnitSizes} from '../../../src/utils';
5
4
 
6
5
  const CSR_ENDPOINT = 'https://csr.onet.pl/4178463/csr-006/csr.json?nid=4178463&';
7
6
 
@@ -64,6 +63,20 @@ describe('rasBidAdapter', function () {
64
63
  customParams: {
65
64
  test: 'name=value'
66
65
  }
66
+ },
67
+ mediaTypes: {
68
+ banner: {
69
+ sizes: [
70
+ [
71
+ 300,
72
+ 250
73
+ ],
74
+ [
75
+ 300,
76
+ 600
77
+ ]
78
+ ]
79
+ }
67
80
  }
68
81
  };
69
82
  const bid2 = {
@@ -75,6 +88,16 @@ describe('rasBidAdapter', function () {
75
88
  area: 'areatest',
76
89
  site: 'test',
77
90
  network: '4178463'
91
+ },
92
+ mediaTypes: {
93
+ banner: {
94
+ sizes: [
95
+ [
96
+ 750,
97
+ 300
98
+ ]
99
+ ]
100
+ }
78
101
  }
79
102
  };
80
103
 
@@ -128,6 +151,7 @@ describe('rasBidAdapter', function () {
128
151
  }
129
152
  };
130
153
  const requests = spec.buildRequests([bidCopy, bid2]);
154
+
131
155
  expect(requests[0].url).to.have.string(CSR_ENDPOINT);
132
156
  expect(requests[0].url).to.have.string('slot0=test');
133
157
  expect(requests[0].url).to.have.string('id0=1');
@@ -148,6 +172,39 @@ describe('rasBidAdapter', function () {
148
172
  expect(requests[0].url).to.have.string('kvadunit=test%2Fareatest');
149
173
  expect(requests[0].url).to.have.string('pos0=0');
150
174
  });
175
+
176
+ it('should parse dsainfo when available', function () {
177
+ const bidCopy = { ...bid };
178
+ bidCopy.params = {
179
+ ...bid.params,
180
+ pageContext: {
181
+ dv: 'test/areatest',
182
+ du: 'https://example.com/',
183
+ dr: 'https://example.org/',
184
+ keyWords: ['val1', 'val2'],
185
+ keyValues: {
186
+ adunit: 'test/areatest'
187
+ }
188
+ }
189
+ };
190
+ let bidderRequest = {
191
+ ortb2: {
192
+ regs: {
193
+ ext: {
194
+ dsa: {
195
+ required: 1
196
+ }
197
+ }
198
+ }
199
+ }
200
+ };
201
+ let requests = spec.buildRequests([bidCopy], bidderRequest);
202
+ expect(requests[0].url).to.have.string('dsainfo=1');
203
+
204
+ bidderRequest.ortb2.regs.ext.dsa.required = 0;
205
+ requests = spec.buildRequests([bidCopy], bidderRequest);
206
+ expect(requests[0].url).to.have.string('dsainfo=0');
207
+ });
151
208
  });
152
209
 
153
210
  describe('interpretResponse', function () {
@@ -172,7 +229,7 @@ describe('rasBidAdapter', function () {
172
229
 
173
230
  it('should get correct bid response', function () {
174
231
  const resp = spec.interpretResponse({ body: response }, { bidIds: [{ slot: 'flat-belkagorna', bidId: 1 }] });
175
- expect(resp[0]).to.have.all.keys('cpm', 'currency', 'netRevenue', 'requestId', 'ttl', 'width', 'height', 'creativeId', 'dealId', 'ad', 'meta');
232
+ expect(resp[0]).to.have.all.keys('cpm', 'currency', 'netRevenue', 'requestId', 'ttl', 'width', 'height', 'creativeId', 'dealId', 'ad', 'meta', 'actgMatch', 'mediaType');
176
233
  expect(resp.length).to.equal(1);
177
234
  });
178
235
 
@@ -245,4 +302,309 @@ describe('rasBidAdapter', function () {
245
302
  expect(resp).to.deep.equal({bids: [], fledgeAuctionConfigs: auctionConfigs});
246
303
  });
247
304
  });
305
+
306
+ describe('buildNativeRequests', function () {
307
+ const bid = {
308
+ sizes: 'fluid',
309
+ bidder: 'ras',
310
+ bidId: 1,
311
+ params: {
312
+ slot: 'nativestd',
313
+ area: 'areatest',
314
+ site: 'test',
315
+ slotSequence: '0',
316
+ network: '4178463',
317
+ customParams: {
318
+ test: 'name=value'
319
+ }
320
+ },
321
+ mediaTypes: {
322
+ native: {
323
+ clickUrl: {
324
+ required: true
325
+ },
326
+ image: {
327
+ required: true
328
+ },
329
+ sponsoredBy: {
330
+ len: 25,
331
+ required: true
332
+ },
333
+ title: {
334
+ len: 50,
335
+ required: true
336
+ }
337
+ }
338
+ }
339
+ };
340
+
341
+ it('should parse bids to native request', function () {
342
+ const requests = spec.buildRequests([bid], {
343
+ 'gdprConsent': {
344
+ 'gdprApplies': true,
345
+ 'consentString': 'some-consent-string'
346
+ },
347
+ 'refererInfo': {
348
+ 'ref': 'https://example.org/',
349
+ 'page': 'https://example.com/'
350
+ }
351
+ });
352
+
353
+ expect(requests[0].url).to.have.string(CSR_ENDPOINT);
354
+ expect(requests[0].url).to.have.string('slot0=nativestd');
355
+ expect(requests[0].url).to.have.string('id0=1');
356
+ expect(requests[0].url).to.have.string('site=test');
357
+ expect(requests[0].url).to.have.string('area=areatest');
358
+ expect(requests[0].url).to.have.string('cre_format=html');
359
+ expect(requests[0].url).to.have.string('systems=das');
360
+ expect(requests[0].url).to.have.string('ems_url=1');
361
+ expect(requests[0].url).to.have.string('bid_rate=1');
362
+ expect(requests[0].url).to.have.string('gdpr_applies=true');
363
+ expect(requests[0].url).to.have.string('euconsent=some-consent-string');
364
+ expect(requests[0].url).to.have.string('du=https%3A%2F%2Fexample.com%2F');
365
+ expect(requests[0].url).to.have.string('dr=https%3A%2F%2Fexample.org%2F');
366
+ expect(requests[0].url).to.have.string('test=name%3Dvalue');
367
+ expect(requests[0].url).to.have.string('cre_format0=native');
368
+ expect(requests[0].url).to.have.string('iusizes0=fluid');
369
+ });
370
+ });
371
+
372
+ describe('interpretNativeResponse', function () {
373
+ const response = {
374
+ 'adsCheck': 'ok',
375
+ 'geoloc': {},
376
+ 'ir': '92effd60-0c84-4dac-817e-763ea7b8ac65',
377
+ 'iv': '202003191334467636346500',
378
+ 'ads': [
379
+ {
380
+ 'id': 'nativestd',
381
+ 'slot': 'nativestd',
382
+ 'prio': 10,
383
+ 'type': 'native',
384
+ 'bid_rate': 0.321123,
385
+ 'adid': 'das,50463,152276',
386
+ 'id_3': '12734'
387
+ }
388
+ ]
389
+ };
390
+ const responseTeaserStandard = {
391
+ adsCheck: 'ok',
392
+ geoloc: {},
393
+ ir: '92effd60-0c84-4dac-817e-763ea7b8ac65',
394
+ iv: '202003191334467636346500',
395
+ ads: [
396
+ {
397
+ id: 'nativestd',
398
+ slot: 'nativestd',
399
+ prio: 10,
400
+ type: 'native',
401
+ bid_rate: 0.321123,
402
+ adid: 'das,50463,152276',
403
+ id_3: '12734',
404
+ data: {
405
+ fields: {
406
+ leadtext: 'BODY',
407
+ title: 'Headline',
408
+ image: '//img.url',
409
+ url: '//link.url',
410
+ impression: '//impression.url',
411
+ impression1: '//impression1.url',
412
+ impressionJs1: '//impressionJs1.url'
413
+ },
414
+ meta: {
415
+ slot: 'nativestd',
416
+ height: 1,
417
+ width: 1,
418
+ advertiser_name: 'Test Onet',
419
+ dsaurl: '//dsa.url',
420
+ adclick: '//adclick.url'
421
+ }
422
+ },
423
+ ems_link: '//ems.url'
424
+ }
425
+ ]
426
+ };
427
+ const responseNativeInFeed = {
428
+ adsCheck: 'ok',
429
+ geoloc: {},
430
+ ir: '92effd60-0c84-4dac-817e-763ea7b8ac65',
431
+ iv: '202003191334467636346500',
432
+ ads: [
433
+ {
434
+ id: 'nativestd',
435
+ slot: 'nativestd',
436
+ prio: 10,
437
+ type: 'native',
438
+ bid_rate: 0.321123,
439
+ adid: 'das,50463,152276',
440
+ id_3: '12734',
441
+ data: {
442
+ fields: {
443
+ Body: 'BODY',
444
+ Calltoaction: 'Calltoaction',
445
+ Headline: 'Headline',
446
+ Image: '//img.url',
447
+ Sponsorlabel: 'nie',
448
+ Thirdpartyclicktracker: '//link.url',
449
+ imp: '//imp.url'
450
+ },
451
+ meta: {
452
+ slot: 'nativestd',
453
+ height: 1,
454
+ width: 1,
455
+ advertiser_name: 'Test Onet',
456
+ dsaurl: '//dsa.url',
457
+ adclick: '//adclick.url'
458
+ }
459
+ },
460
+ ems_link: '//ems.url'
461
+ }
462
+ ]
463
+ };
464
+ const expectedTeaserStandardOrtbResponse = {
465
+ ver: '1.2',
466
+ assets: [
467
+ {
468
+ id: 2,
469
+ img: {
470
+ url: '//img.url',
471
+ w: 1,
472
+ h: 1
473
+ }
474
+ },
475
+ {
476
+ id: 4,
477
+ title: {
478
+ text: 'Headline'
479
+ }
480
+ },
481
+ {
482
+ id: 3,
483
+ data: {
484
+ value: 'Test Onet',
485
+ type: 1
486
+ }
487
+ }
488
+ ],
489
+ link: {
490
+ url: '//adclick.url//link.url'
491
+ },
492
+ eventtrackers: [
493
+ {
494
+ event: 1,
495
+ method: 1,
496
+ url: '//ems.url'
497
+ },
498
+ {
499
+ event: 1,
500
+ method: 1,
501
+ url: '//impression.url'
502
+ },
503
+ {
504
+ event: 1,
505
+ method: 1,
506
+ url: '//impression1.url'
507
+ },
508
+ {
509
+ event: 1,
510
+ method: 2,
511
+ url: '//impressionJs1.url'
512
+ }
513
+ ],
514
+ privacy: '//dsa.url'
515
+ };
516
+ const expectedTeaserStandardResponse = {
517
+ sendTargetingKeys: false,
518
+ title: 'Headline',
519
+ image: {
520
+ url: '//img.url',
521
+ width: 1,
522
+ height: 1
523
+ },
524
+ clickUrl: '//adclick.url//link.url',
525
+ cta: '',
526
+ body: 'BODY',
527
+ sponsoredBy: 'Test Onet',
528
+ ortb: expectedTeaserStandardOrtbResponse,
529
+ privacyLink: '//dsa.url'
530
+ };
531
+ const expectedNativeInFeedOrtbResponse = {
532
+ ver: '1.2',
533
+ assets: [
534
+ {
535
+ id: 2,
536
+ img: {
537
+ url: '//img.url',
538
+ w: 1,
539
+ h: 1
540
+ }
541
+ },
542
+ {
543
+ id: 4,
544
+ title: {
545
+ text: 'Headline'
546
+ }
547
+ },
548
+ {
549
+ id: 3,
550
+ data: {
551
+ value: 'Test Onet',
552
+ type: 1
553
+ }
554
+ }
555
+ ],
556
+ link: {
557
+ url: '//adclick.url//link.url'
558
+ },
559
+ eventtrackers: [
560
+ {
561
+ event: 1,
562
+ method: 1,
563
+ url: '//ems.url'
564
+ },
565
+ {
566
+ event: 1,
567
+ method: 1,
568
+ url: '//imp.url'
569
+ }
570
+ ],
571
+ privacy: '//dsa.url',
572
+ };
573
+ const expectedNativeInFeedResponse = {
574
+ sendTargetingKeys: false,
575
+ title: 'Headline',
576
+ image: {
577
+ url: '//img.url',
578
+ width: 1,
579
+ height: 1
580
+ },
581
+ clickUrl: '//adclick.url//link.url',
582
+ cta: 'Calltoaction',
583
+ body: 'BODY',
584
+ sponsoredBy: 'Test Onet',
585
+ ortb: expectedNativeInFeedOrtbResponse,
586
+ privacyLink: '//dsa.url'
587
+ };
588
+
589
+ it('should get correct bid native response', function () {
590
+ const resp = spec.interpretResponse({ body: response }, { bidIds: [{ slot: 'nativestd', bidId: 1, mediaType: 'native' }] });
591
+
592
+ expect(resp[0]).to.have.all.keys('cpm', 'currency', 'netRevenue', 'requestId', 'ttl', 'width', 'height', 'creativeId', 'dealId', 'meta', 'actgMatch', 'mediaType', 'native');
593
+ expect(resp.length).to.equal(1);
594
+ });
595
+
596
+ it('should get correct native response for TeaserStandard', function () {
597
+ const resp = spec.interpretResponse({ body: responseTeaserStandard }, { bidIds: [{ slot: 'nativestd', bidId: 1, mediaType: 'native' }] });
598
+ const teaserStandardResponse = resp[0].native;
599
+
600
+ expect(JSON.stringify(teaserStandardResponse)).to.equal(JSON.stringify(expectedTeaserStandardResponse));
601
+ });
602
+
603
+ it('should get correct native response for NativeInFeed', function () {
604
+ const resp = spec.interpretResponse({ body: responseNativeInFeed }, { bidIds: [{ slot: 'nativestd', bidId: 1, mediaType: 'native' }] });
605
+ const nativeInFeedResponse = resp[0].native;
606
+
607
+ expect(JSON.stringify(nativeInFeedResponse)).to.equal(JSON.stringify(expectedNativeInFeedResponse));
608
+ });
609
+ });
248
610
  });
@@ -425,6 +425,41 @@ describe('sharethrough adapter spec', function () {
425
425
  });
426
426
  });
427
427
 
428
+ describe('dsa', () => {
429
+ it('should properly attach dsa information to the request when applicable', () => {
430
+ bidderRequest.ortb2 = {
431
+ regs: {
432
+ ext: {
433
+ dsa: {
434
+ 'dsarequired': 1,
435
+ 'pubrender': 0,
436
+ 'datatopub': 1,
437
+ 'transparency': [{
438
+ 'domain': 'good-domain',
439
+ 'dsaparams': [1, 2]
440
+ }, {
441
+ 'domain': 'bad-setup',
442
+ 'dsaparams': ['1', 3]
443
+ }]
444
+ }
445
+ }
446
+ }
447
+ }
448
+
449
+ const openRtbReq = spec.buildRequests(bidRequests, bidderRequest)[0].data;
450
+ expect(openRtbReq.regs.ext.dsa.dsarequired).to.equal(1);
451
+ expect(openRtbReq.regs.ext.dsa.pubrender).to.equal(0);
452
+ expect(openRtbReq.regs.ext.dsa.datatopub).to.equal(1);
453
+ expect(openRtbReq.regs.ext.dsa.transparency).to.deep.equal([{
454
+ 'domain': 'good-domain',
455
+ 'dsaparams': [1, 2]
456
+ }, {
457
+ 'domain': 'bad-setup',
458
+ 'dsaparams': ['1', 3]
459
+ }]);
460
+ });
461
+ });
462
+
428
463
  describe('transaction id at the impression level', () => {
429
464
  it('should include transaction id when provided', () => {
430
465
  const requests = spec.buildRequests(bidRequests, bidderRequest);
@@ -530,6 +530,45 @@ describe('sovrnBidAdapter', function() {
530
530
 
531
531
  expect(impression.bidfloor).to.equal(2.00)
532
532
  })
533
+ it('floor should be undefined if there is no floor from the floor module and params', function() {
534
+ const floorBid = {
535
+ ...baseBidRequest
536
+ }
537
+ floorBid.params = {
538
+ tagid: 1234
539
+ }
540
+ const request = spec.buildRequests([floorBid], baseBidderRequest)
541
+ const impression = JSON.parse(request.data).imp[0]
542
+
543
+ expect(impression.bidfloor).to.be.undefined
544
+ })
545
+ it('floor should be undefined if there is incorrect floor value from the floor module', function() {
546
+ const floorBid = {
547
+ ...baseBidRequest,
548
+ getFloor: () => ({currency: 'USD', floor: 'incorrect_value'}),
549
+ params: {
550
+ tagid: 1234
551
+ }
552
+ }
553
+ const request = spec.buildRequests([floorBid], baseBidderRequest)
554
+ const impression = JSON.parse(request.data).imp[0]
555
+
556
+ expect(impression.bidfloor).to.be.undefined
557
+ })
558
+ it('floor should be undefined if there is incorrect floor value from the params', function() {
559
+ const floorBid = {
560
+ ...baseBidRequest,
561
+ getFloor: () => ({})
562
+ }
563
+ floorBid.params = {
564
+ tagid: 1234,
565
+ bidfloor: 'incorrect_value'
566
+ }
567
+ const request = spec.buildRequests([floorBid], baseBidderRequest)
568
+ const impression = JSON.parse(request.data).imp[0]
569
+
570
+ expect(impression.bidfloor).to.be.undefined
571
+ })
533
572
  describe('First Party Data', function () {
534
573
  it('should provide first party data if provided', function() {
535
574
  const ortb2 = {
@@ -638,7 +638,7 @@ describe('SSPBC adapter', function () {
638
638
  expect(adcode).to.be.a('string');
639
639
  expect(adcode).to.contain('window.rekid');
640
640
  expect(adcode).to.contain('window.mcad');
641
- expect(adcode).to.contain('window.gdpr');
641
+ expect(adcode).to.contain('window.tcString');
642
642
  expect(adcode).to.contain('window.page');
643
643
  expect(adcode).to.contain('window.requestPVID');
644
644
  });
@@ -157,7 +157,7 @@ describe('Taboola Adapter', function () {
157
157
  spec.onBidderError({error, bidderRequest});
158
158
  expect(server.requests[0].method).to.equal('POST');
159
159
  expect(server.requests[0].url).to.equal(EVENT_ENDPOINT + '/bidError');
160
- expect(JSON.parse(server.requests[0].requestBody)).to.deep.equal(error, bidderRequest);
160
+ expect(JSON.parse(server.requests[0].requestBody)).to.deep.equal({error, bidderRequest});
161
161
  });
162
162
  });
163
163
 
@@ -48,6 +48,120 @@ describe('weboramaRtdProvider', function() {
48
48
  };
49
49
  expect(weboramaSubmodule.init(moduleConfig)).to.equal(true);
50
50
  });
51
+
52
+ it('instantiate with empty sfbxLiteData should return true', function() {
53
+ const moduleConfig = {
54
+ params: {
55
+ sfbxLiteDataConf: {},
56
+ }
57
+ };
58
+ expect(weboramaSubmodule.init(moduleConfig)).to.equal(true);
59
+ });
60
+
61
+ describe('webo user data should check gdpr consent', function() {
62
+ it('should initialize if gdpr does not applies', function() {
63
+ const moduleConfig = {
64
+ params: {
65
+ weboUserDataConf: {}
66
+ }
67
+ };
68
+ const userConsent = {
69
+ gdpr: {
70
+ gdprApplies: false,
71
+ },
72
+ }
73
+ expect(weboramaSubmodule.init(moduleConfig, userConsent)).to.equal(true);
74
+ });
75
+ it('should initialize if gdpr applies and consent is ok', function() {
76
+ const moduleConfig = {
77
+ params: {
78
+ weboUserDataConf: {}
79
+ }
80
+ };
81
+ const userConsent = {
82
+ gdpr: {
83
+ gdprApplies: true,
84
+ vendorData: {
85
+ purpose: {
86
+ consents: {
87
+ 1: true,
88
+ 3: true,
89
+ 4: true,
90
+ 5: true,
91
+ 6: true,
92
+ 9: true,
93
+ },
94
+ },
95
+ specialFeatureOptins: {
96
+ 1: true,
97
+ },
98
+ vendor: {
99
+ consents: {
100
+ 284: true,
101
+ },
102
+ }
103
+ },
104
+ },
105
+ }
106
+ expect(weboramaSubmodule.init(moduleConfig, userConsent)).to.equal(true);
107
+ });
108
+ it('should NOT initialize if gdpr applies and consent is nok: miss consent vendor id', function() {
109
+ const moduleConfig = {
110
+ params: {
111
+ weboUserDataConf: {}
112
+ }
113
+ };
114
+ const userConsent = {
115
+ gdpr: {
116
+ gdprApplies: true,
117
+ vendorData: {
118
+ purpose: {
119
+ consents: {
120
+ 1: true,
121
+ 3: true,
122
+ 4: true,
123
+ },
124
+ },
125
+ specialFeatureOptins: {},
126
+ vendor: {
127
+ consents: {
128
+ 284: false,
129
+ },
130
+ }
131
+ },
132
+ },
133
+ }
134
+ expect(weboramaSubmodule.init(moduleConfig, userConsent)).to.equal(false);
135
+ });
136
+ it('should NOT initialize if gdpr applies and consent is nok: miss one purpose id', function() {
137
+ const moduleConfig = {
138
+ params: {
139
+ weboUserDataConf: {}
140
+ }
141
+ };
142
+ const userConsent = {
143
+ gdpr: {
144
+ gdprApplies: true,
145
+ vendorData: {
146
+ purpose: {
147
+ consents: {
148
+ 1: false,
149
+ 3: true,
150
+ 4: true,
151
+ },
152
+ },
153
+ specialFeatureOptins: {},
154
+ vendor: {
155
+ consents: {
156
+ 284: true,
157
+ },
158
+ }
159
+ },
160
+ },
161
+ }
162
+ expect(weboramaSubmodule.init(moduleConfig, userConsent)).to.equal(false);
163
+ });
164
+ });
51
165
  });
52
166
 
53
167
  describe('Handle Set Targeting and Bid Request', function() {
@@ -59,7 +59,7 @@ describe('Zeta Ssp Bid Adapter', function () {
59
59
  sid: 'publisherId',
60
60
  tagid: 'test_tag_id',
61
61
  site: {
62
- page: 'testPage'
62
+ page: 'http://www.zetaglobal.com/page?param=value'
63
63
  },
64
64
  app: {
65
65
  bundle: 'testBundle'
@@ -235,7 +235,7 @@ describe('Zeta Ssp Bid Adapter', function () {
235
235
  id: '123',
236
236
  site: {
237
237
  id: 'SITE_ID',
238
- page: 'page.com',
238
+ page: 'http://www.zetaglobal.com/page?param=value',
239
239
  domain: 'domain.com'
240
240
  },
241
241
  user: {
@@ -263,7 +263,7 @@ describe('Zeta Ssp Bid Adapter', function () {
263
263
  id: '123',
264
264
  site: {
265
265
  id: 'SITE_ID',
266
- page: 'page.com',
266
+ page: 'http://www.zetaglobal.com/page?param=value',
267
267
  domain: 'domain.com'
268
268
  },
269
269
  user: {
@@ -312,7 +312,7 @@ describe('Zeta Ssp Bid Adapter', function () {
312
312
  it('Test page and domain in site', function () {
313
313
  const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
314
314
  const payload = JSON.parse(request.data);
315
- expect(payload.site.page).to.eql('http://www.zetaglobal.com/page?param=value');
315
+ expect(payload.site.page).to.eql('zetaglobal.com/page');
316
316
  expect(payload.site.domain).to.eql('zetaglobal.com');
317
317
  });
318
318