prebid.js 7.32.0 → 7.34.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/.github/workflows/issue_tracker.yml +26 -15
  2. package/dist/33acrossBidAdapter.js +1 -1
  3. package/dist/33acrossIdSystem.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/admaticBidAdapter.js +1 -1
  8. package/dist/admixerBidAdapter.js +1 -1
  9. package/dist/adnuntiusBidAdapter.js +1 -1
  10. package/dist/adrelevantisBidAdapter.js +1 -1
  11. package/dist/adtrgtmeBidAdapter.js +1 -1
  12. package/dist/adxcgBidAdapter.js +1 -1
  13. package/dist/ajaBidAdapter.js +1 -1
  14. package/dist/amxBidAdapter.js +1 -1
  15. package/dist/amxIdSystem.js +1 -1
  16. package/dist/appierAnalyticsAdapter.js +1 -1
  17. package/dist/appnexusBidAdapter.js +1 -1
  18. package/dist/arcspanRtdProvider.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/bliinkBidAdapter.js +1 -1
  24. package/dist/bridgewellBidAdapter.js +1 -1
  25. package/dist/brightMountainMediaBidAdapter.js +1 -1
  26. package/dist/carodaBidAdapter.js +1 -1
  27. package/dist/chtnwBidAdapter.js +1 -1
  28. package/dist/concertBidAdapter.js +1 -1
  29. package/dist/connectadBidAdapter.js +1 -1
  30. package/dist/consentManagementUsp.js +1 -1
  31. package/dist/consumableBidAdapter.js +1 -1
  32. package/dist/conversantBidAdapter.js +1 -1
  33. package/dist/craftBidAdapter.js +1 -1
  34. package/dist/criteoBidAdapter.js +1 -1
  35. package/dist/dspxBidAdapter.js +1 -1
  36. package/dist/emx_digitalBidAdapter.js +1 -1
  37. package/dist/eplanningBidAdapter.js +1 -1
  38. package/dist/feedadBidAdapter.js +1 -1
  39. package/dist/finativeBidAdapter.js +1 -1
  40. package/dist/glimpseBidAdapter.js +1 -1
  41. package/dist/gmosspBidAdapter.js +1 -1
  42. package/dist/goldbachBidAdapter.js +1 -1
  43. package/dist/gridBidAdapter.js +1 -1
  44. package/dist/gridNMBidAdapter.js +1 -1
  45. package/dist/gumgumBidAdapter.js +1 -1
  46. package/dist/h12mediaBidAdapter.js +1 -1
  47. package/dist/holidBidAdapter.js +1 -1
  48. package/dist/id5IdSystem.js +1 -1
  49. package/dist/improvedigitalBidAdapter.js +1 -1
  50. package/dist/inmarBidAdapter.js +1 -1
  51. package/dist/insticatorBidAdapter.js +1 -1
  52. package/dist/ixBidAdapter.js +1 -1
  53. package/dist/justpremiumBidAdapter.js +1 -1
  54. package/dist/kargoBidAdapter.js +1 -1
  55. package/dist/konduitAnalyticsAdapter.js +1 -1
  56. package/dist/kueezBidAdapter.js +1 -1
  57. package/dist/kueezRtbBidAdapter.js +1 -1
  58. package/dist/lassoBidAdapter.js +1 -1
  59. package/dist/lifestreetBidAdapter.js +1 -1
  60. package/dist/liveIntentIdSystem.js +1 -1
  61. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  62. package/dist/logicadBidAdapter.js +1 -1
  63. package/dist/loglyliftBidAdapter.js +1 -1
  64. package/dist/lotamePanoramaIdSystem.js +1 -1
  65. package/dist/magniteAnalyticsAdapter.js +1 -1
  66. package/dist/malltvAnalyticsAdapter.js +1 -1
  67. package/dist/marsmediaBidAdapter.js +1 -1
  68. package/dist/mediafuseBidAdapter.js +1 -1
  69. package/dist/mediasquareBidAdapter.js +1 -1
  70. package/dist/mgidBidAdapter.js +1 -1
  71. package/dist/minutemediaBidAdapter.js +1 -1
  72. package/dist/nextMillenniumBidAdapter.js +1 -1
  73. package/dist/nexx360BidAdapter.js +1 -1
  74. package/dist/not-for-prod/prebid.js +129 -128
  75. package/dist/oguryBidAdapter.js +1 -1
  76. package/dist/onetagBidAdapter.js +1 -1
  77. package/dist/ooloAnalyticsAdapter.js +1 -1
  78. package/dist/openxBidAdapter.js +1 -1
  79. package/dist/ortbConverter.js +1 -1
  80. package/dist/outbrainBidAdapter.js +1 -1
  81. package/dist/parrableIdSystem.js +1 -1
  82. package/dist/pixfutureBidAdapter.js +1 -1
  83. package/dist/prebid-core.js +1 -1
  84. package/dist/prebidServerBidAdapter.js +1 -1
  85. package/dist/priceFloors.js +1 -1
  86. package/dist/publinkIdSystem.js +1 -1
  87. package/dist/pubmaticBidAdapter.js +1 -1
  88. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  89. package/dist/pxyzBidAdapter.js +1 -1
  90. package/dist/quantcastBidAdapter.js +1 -1
  91. package/dist/readpeakBidAdapter.js +1 -1
  92. package/dist/relaidoBidAdapter.js +1 -1
  93. package/dist/rhythmoneBidAdapter.js +1 -1
  94. package/dist/riseBidAdapter.js +1 -1
  95. package/dist/rubiconAnalyticsAdapter.js +1 -1
  96. package/dist/rubiconBidAdapter.js +1 -1
  97. package/dist/seedingAllianceBidAdapter.js +1 -1
  98. package/dist/seedtagBidAdapter.js +1 -1
  99. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  100. package/dist/sharethroughBidAdapter.js +1 -1
  101. package/dist/shinezBidAdapter.js +1 -1
  102. package/dist/smaatoBidAdapter.js +1 -1
  103. package/dist/smartadserverBidAdapter.js +1 -1
  104. package/dist/smartxBidAdapter.js +1 -1
  105. package/dist/smilewantedBidAdapter.js +1 -1
  106. package/dist/sonobiBidAdapter.js +1 -1
  107. package/dist/sovrnAnalyticsAdapter.js +1 -1
  108. package/dist/sovrnBidAdapter.js +1 -1
  109. package/dist/sspBCBidAdapter.js +1 -1
  110. package/dist/sublimeBidAdapter.js +1 -1
  111. package/dist/synacormediaBidAdapter.js +1 -1
  112. package/dist/targetVideoBidAdapter.js +1 -1
  113. package/dist/teadsBidAdapter.js +1 -1
  114. package/dist/trionBidAdapter.js +1 -1
  115. package/dist/tripleliftBidAdapter.js +1 -1
  116. package/dist/ttdBidAdapter.js +1 -1
  117. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  118. package/dist/uid2IdSystem.js +1 -1
  119. package/dist/underdogmediaBidAdapter.js +1 -1
  120. package/dist/undertoneBidAdapter.js +1 -1
  121. package/dist/vidazooBidAdapter.js +1 -1
  122. package/dist/videobyteBidAdapter.js +1 -1
  123. package/dist/visxBidAdapter.js +1 -1
  124. package/dist/vuukleBidAdapter.js +1 -1
  125. package/dist/widespaceBidAdapter.js +1 -1
  126. package/dist/winrBidAdapter.js +1 -1
  127. package/dist/yahoosspBidAdapter.js +1 -1
  128. package/dist/yieldmoBidAdapter.js +1 -1
  129. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  130. package/libraries/ortbConverter/processors/default.js +19 -1
  131. package/modules/.submodules.json +1 -0
  132. package/modules/admaticBidAdapter.js +2 -1
  133. package/modules/admixerBidAdapter.js +26 -4
  134. package/modules/adnuntiusBidAdapter.js +36 -38
  135. package/modules/arcspanRtdProvider.js +73 -0
  136. package/modules/arcspanRtdProvider.md +11 -0
  137. package/modules/bliinkBidAdapter.js +1 -1
  138. package/modules/consentManagementUsp.js +10 -10
  139. package/modules/consumableBidAdapter.js +20 -2
  140. package/modules/criteoBidAdapter.js +1 -1
  141. package/modules/emx_digitalBidAdapter.js +9 -2
  142. package/modules/holidBidAdapter.js +9 -4
  143. package/modules/id5IdSystem.js +3 -1
  144. package/modules/ixBidAdapter.js +25 -6
  145. package/modules/kargoBidAdapter.js +5 -1
  146. package/modules/lotamePanoramaIdSystem.js +9 -1
  147. package/modules/nextMillenniumBidAdapter.js +19 -9
  148. package/modules/nexx360BidAdapter.js +2 -1
  149. package/modules/openxBidAdapter.js +5 -0
  150. package/modules/prebidServerBidAdapter/index.js +14 -1
  151. package/modules/prebidServerBidAdapter/ortbConverter.js +1 -1
  152. package/modules/priceFloors.js +11 -5
  153. package/modules/seedingAllianceBidAdapter.js +129 -116
  154. package/modules/seedtagBidAdapter.js +20 -6
  155. package/modules/targetVideoBidAdapter.js +1 -1
  156. package/modules/tripleliftBidAdapter.js +4 -0
  157. package/package.json +2 -2
  158. package/src/adloader.js +2 -1
  159. package/src/utils/promise.js +8 -0
  160. package/test/spec/modules/admixerBidAdapter_spec.js +140 -60
  161. package/test/spec/modules/adnuntiusBidAdapter_spec.js +120 -120
  162. package/test/spec/modules/arcspanRtdProvider_spec.js +187 -0
  163. package/test/spec/modules/bliinkBidAdapter_spec.js +7 -7
  164. package/test/spec/modules/consentManagementUsp_spec.js +15 -2
  165. package/test/spec/modules/consumableBidAdapter_spec.js +46 -0
  166. package/test/spec/modules/emx_digitalBidAdapter_spec.js +30 -1
  167. package/test/spec/modules/holidBidAdapter_spec.js +29 -0
  168. package/test/spec/modules/ixBidAdapter_spec.js +117 -6
  169. package/test/spec/modules/kargoBidAdapter_spec.js +32 -0
  170. package/test/spec/modules/lotamePanoramaIdSystem_spec.js +16 -10
  171. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +14 -2
  172. package/test/spec/modules/openxBidAdapter_spec.js +41 -0
  173. package/test/spec/modules/openxOrtbBidAdapter_spec.js +41 -0
  174. package/test/spec/modules/prebidServerBidAdapter_spec.js +138 -0
  175. package/test/spec/modules/priceFloors_spec.js +155 -0
  176. package/test/spec/modules/seedingAllianceAdapter_spec.js +66 -23
  177. package/test/spec/modules/seedtagBidAdapter_spec.js +58 -17
  178. package/test/spec/modules/targetVideoBidAdapter_spec.js +2 -2
  179. package/test/spec/modules/tripleliftBidAdapter_spec.js +13 -0
  180. package/test/spec/ortbConverter/default_processors_spec.js +23 -0
@@ -0,0 +1,187 @@
1
+ import { arcspanSubmodule } from 'modules/arcspanRtdProvider.js';
2
+ import { expect } from 'chai';
3
+ import { loadExternalScript } from 'src/adloader.js';
4
+
5
+ describe('arcspanRtdProvider', function () {
6
+ describe('init', function () {
7
+ afterEach(function () {
8
+ window.arcobj1 = undefined;
9
+ window.arcobj2 = undefined;
10
+ });
11
+
12
+ it('successfully initializes with a valid silo ID', function () {
13
+ expect(arcspanSubmodule.init(getGoodConfig())).to.equal(true);
14
+ expect(loadExternalScript.called).to.be.ok;
15
+ expect(loadExternalScript.args[0][0]).to.deep.equal('https://silo13.p7cloud.net/as.js');
16
+ loadExternalScript.resetHistory();
17
+ });
18
+
19
+ it('fails to initialize with a missing silo ID', function () {
20
+ expect(arcspanSubmodule.init(getBadConfig())).to.equal(false);
21
+ expect(loadExternalScript.called).to.be.not.ok;
22
+ loadExternalScript.resetHistory();
23
+ });
24
+
25
+ it('drops localhost script for test silo', function () {
26
+ expect(arcspanSubmodule.init(getTestConfig())).to.equal(true);
27
+ expect(loadExternalScript.called).to.be.ok;
28
+ expect(loadExternalScript.args[0][0]).to.deep.equal('https://localhost:8080/as.js');
29
+ loadExternalScript.resetHistory();
30
+ });
31
+ });
32
+
33
+ describe('alterBidRequests', function () {
34
+ afterEach(function () {
35
+ window.arcobj1 = undefined;
36
+ window.arcobj2 = undefined;
37
+ });
38
+
39
+ it('alters the bid request 1', function () {
40
+ setIAB({
41
+ raw: {
42
+ images: [
43
+ 'Religion & Spirituality',
44
+ 'Medical Health>Substance Abuse',
45
+ 'Religion & Spirituality>Astrology',
46
+ 'Medical Health',
47
+ 'Events & Attractions',
48
+ ],
49
+ },
50
+ codes: {
51
+ images: ['IAB23-10', 'IAB7', 'IAB7-42', 'IAB15-1'],
52
+ },
53
+ newcodes: {
54
+ images: ['150', '453', '311', '456', '286'],
55
+ },
56
+ });
57
+
58
+ var reqBidsConfigObj = {};
59
+ reqBidsConfigObj.ortb2Fragments = {};
60
+ reqBidsConfigObj.ortb2Fragments.global = {};
61
+ arcspanSubmodule.getBidRequestData(reqBidsConfigObj, function () {
62
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.name).to.equal(
63
+ 'arcspan'
64
+ );
65
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.keywords).to.equal(
66
+ 'Religion & Spirituality,Medical Health>Substance Abuse,Religion & Spirituality>Astrology,Medical Health,Events & Attractions'
67
+ );
68
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].ext.segtax).to.equal(6);
69
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.cat).to.eql([
70
+ 'IAB23_10',
71
+ 'IAB7',
72
+ 'IAB7_42',
73
+ 'IAB15_1',
74
+ ]);
75
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.sectioncat).to.eql([
76
+ 'IAB23_10',
77
+ 'IAB7',
78
+ 'IAB7_42',
79
+ 'IAB15_1'
80
+ ]);
81
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.pagecat).to.eql([
82
+ 'IAB23_10',
83
+ 'IAB7',
84
+ 'IAB7_42',
85
+ 'IAB15_1',
86
+ ]);
87
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].segment).to.eql([
88
+ { id: '150' },
89
+ { id: '453' },
90
+ { id: '311' },
91
+ { id: '456' },
92
+ { id: '286' }
93
+ ]);
94
+ });
95
+ });
96
+
97
+ it('alters the bid request 2', function () {
98
+ setIAB({
99
+ raw: { text: ['Sports', 'Sports>Soccer'] },
100
+ codes: { text: ['IAB17', 'IAB17-44'] },
101
+ newcodes: { text: ['483', '533'] },
102
+ });
103
+
104
+ var reqBidsConfigObj = {};
105
+ reqBidsConfigObj.ortb2Fragments = {};
106
+ reqBidsConfigObj.ortb2Fragments.global = {};
107
+ arcspanSubmodule.getBidRequestData(reqBidsConfigObj, function () {
108
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.name).to.equal(
109
+ 'arcspan'
110
+ );
111
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.keywords).to.equal(
112
+ 'Sports,Sports>Soccer'
113
+ );
114
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].ext.segtax).to.equal(6);
115
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.cat).to.eql([
116
+ 'IAB17',
117
+ 'IAB17_44',
118
+ ]);
119
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.sectioncat).to.eql([
120
+ 'IAB17',
121
+ 'IAB17_44'
122
+ ]);
123
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.pagecat).to.eql([
124
+ 'IAB17',
125
+ 'IAB17_44',
126
+ ]);
127
+ expect(reqBidsConfigObj.ortb2Fragments.global.site.content.data[0].segment).to.eql([
128
+ { id: '483' },
129
+ { id: '533' }
130
+ ]);
131
+ });
132
+ });
133
+ });
134
+ });
135
+
136
+ function getGoodConfig() {
137
+ return {
138
+ name: 'arcspan',
139
+ waitForIt: true,
140
+ params: {
141
+ silo: 13,
142
+ },
143
+ };
144
+ }
145
+
146
+ function getBadConfig() {
147
+ return {
148
+ name: 'arcspan',
149
+ waitForIt: true,
150
+ params: {
151
+ notasilo: 1,
152
+ },
153
+ };
154
+ }
155
+
156
+ function getTestConfig() {
157
+ return {
158
+ name: 'arcspan',
159
+ waitForIt: true,
160
+ params: {
161
+ silo: 'test',
162
+ },
163
+ };
164
+ }
165
+
166
+ function setIAB(vjson) {
167
+ window.arcobj2 = {};
168
+ window.arcobj2.cat = 0;
169
+ if (typeof vjson.codes != 'undefined') {
170
+ window.arcobj2.cat = 1;
171
+ if (typeof vjson.codes.images != 'undefined') {
172
+ vjson.codes.images.forEach(function f(e, i) {
173
+ vjson.codes.images[i] = e.replace('-', '_');
174
+ });
175
+ }
176
+ if (typeof vjson.codes.text != 'undefined') {
177
+ vjson.codes.text.forEach(function f(e, i) {
178
+ vjson.codes.text[i] = e.replace('-', '_');
179
+ });
180
+ }
181
+ window.arcobj2.sampled = 1;
182
+ window.arcobj1 = {};
183
+ window.arcobj1.page_iab_codes = vjson.codes;
184
+ window.arcobj1.page_iab = vjson.raw;
185
+ window.arcobj1.page_iab_newcodes = vjson.newcodes;
186
+ }
187
+ }
@@ -130,7 +130,7 @@ const getConfigCreative = () => {
130
130
  creativeId: '34567erty',
131
131
  width: 300,
132
132
  height: 250,
133
- ttl: 3600,
133
+ ttl: 300,
134
134
  netRevenue: true,
135
135
  }
136
136
  }
@@ -145,7 +145,7 @@ const getConfigCreativeVideo = (isNoVast) => {
145
145
  requestId: '6a204ce130280d',
146
146
  width: 300,
147
147
  height: 250,
148
- ttl: 3600,
148
+ ttl: 300,
149
149
  netRevenue: true,
150
150
  }
151
151
  }
@@ -395,7 +395,7 @@ const testsInterpretResponse = [
395
395
  mediaType: 'video',
396
396
  netRevenue: true,
397
397
  requestId: '2def0c5b2a7f6e',
398
- ttl: 3600,
398
+ ttl: 300,
399
399
  vastXml,
400
400
  vastUrl: 'data:text/xml;charset=utf-8;base64,' + btoa(vastXml.replace(/\\"/g, '"'))
401
401
  }]
@@ -421,7 +421,7 @@ const testsInterpretResponse = [
421
421
  mediaType: 'banner',
422
422
  netRevenue: true,
423
423
  requestId: '2def0c5b2a7f6e',
424
- ttl: 3600,
424
+ ttl: 300,
425
425
  width: 300
426
426
  }]
427
427
  },
@@ -505,7 +505,7 @@ const testsBuildBid = [
505
505
  netRevenue: true,
506
506
  vastXml: getConfigCreativeVideo().vastXml,
507
507
  vastUrl: 'data:text/xml;charset=utf-8;base64,' + btoa(getConfigCreativeVideo().vastXml.replace(/\\"/g, '"')),
508
- ttl: 3600,
508
+ ttl: 300,
509
509
  }
510
510
  },
511
511
  {
@@ -535,7 +535,7 @@ const testsBuildBid = [
535
535
  netRevenue: true,
536
536
  vastXml: getConfigCreativeVideo().vastXml,
537
537
  vastUrl: 'data:text/xml;charset=utf-8;base64,' + btoa(getConfigCreativeVideo().vastXml.replace(/\\"/g, '"')),
538
- ttl: 3600,
538
+ ttl: 300,
539
539
  }
540
540
  },
541
541
  {
@@ -552,7 +552,7 @@ const testsBuildBid = [
552
552
  height: 250,
553
553
  creativeId: getConfigCreative().creativeId,
554
554
  ad: getConfigBannerBid().creative.banner.adm,
555
- ttl: 3600,
555
+ ttl: 300,
556
556
  netRevenue: true,
557
557
  }
558
558
  }
@@ -8,7 +8,7 @@ import {
8
8
  } from 'modules/consentManagementUsp.js';
9
9
  import * as utils from 'src/utils.js';
10
10
  import { config } from 'src/config.js';
11
- import adapterManager, {uspDataHandler} from 'src/adapterManager.js';
11
+ import adapterManager, {gdprDataHandler, uspDataHandler} from 'src/adapterManager.js';
12
12
  import 'src/prebid.js';
13
13
  import {defer} from '../../../src/utils/promise.js';
14
14
 
@@ -508,7 +508,20 @@ describe('consentManagement', function () {
508
508
  sinon.assert.notCalled(adapterManager.callDataDeletionRequest);
509
509
  listener();
510
510
  sinon.assert.calledOnce(adapterManager.callDataDeletionRequest);
511
- })
511
+ });
512
+
513
+ it('does not fail if CMP does not support registerDeletion', () => {
514
+ sandbox.stub(window, '__uspapi').callsFake((cmd, _, cb) => {
515
+ if (cmd === 'registerDeletion') {
516
+ throw new Error('CMP not compliant');
517
+ } else if (cmd === 'getUSPData') {
518
+ // eslint-disable-next-line standard/no-callback-literal
519
+ cb({uspString: 'string'}, true);
520
+ }
521
+ });
522
+ setConsentConfig(goodConfig);
523
+ expect(uspDataHandler.getConsentData()).to.eql('string');
524
+ });
512
525
  });
513
526
  });
514
527
  });
@@ -625,6 +625,52 @@ describe('Consumable BidAdapter', function () {
625
625
  expect(opts.length).to.equal(1);
626
626
  });
627
627
 
628
+ it('should return a sync url if iframe syncs are enabled and GDPR applies', function () {
629
+ let gdprConsent = {
630
+ consentString: 'GDPR_CONSENT_STRING',
631
+ gdprApplies: true,
632
+ }
633
+ let opts = spec.getUserSyncs(syncOptions, [AD_SERVER_RESPONSE], gdprConsent);
634
+
635
+ expect(opts.length).to.equal(1);
636
+ expect(opts[0].url).to.equal('https://sync.serverbid.com/ss/730181.html?gdpr=1&gdpr_consent=GDPR_CONSENT_STRING');
637
+ })
638
+
639
+ it('should return a sync url if iframe syncs are enabled and GDPR is undefined', function () {
640
+ let gdprConsent = {
641
+ consentString: 'GDPR_CONSENT_STRING',
642
+ gdprApplies: undefined,
643
+ }
644
+ let opts = spec.getUserSyncs(syncOptions, [AD_SERVER_RESPONSE], gdprConsent);
645
+
646
+ expect(opts.length).to.equal(1);
647
+ expect(opts[0].url).to.equal('https://sync.serverbid.com/ss/730181.html?gdpr=0&gdpr_consent=GDPR_CONSENT_STRING');
648
+ })
649
+
650
+ it('should return a sync url if iframe syncs are enabled and USP applies', function () {
651
+ let uspConsent = {
652
+ consentString: 'USP_CONSENT_STRING',
653
+ }
654
+ let opts = spec.getUserSyncs(syncOptions, [AD_SERVER_RESPONSE], {}, uspConsent);
655
+
656
+ expect(opts.length).to.equal(1);
657
+ expect(opts[0].url).to.equal('https://sync.serverbid.com/ss/730181.html?us_privacy=USP_CONSENT_STRING');
658
+ })
659
+
660
+ it('should return a sync url if iframe syncs are enabled, GDPR and USP applies', function () {
661
+ let gdprConsent = {
662
+ consentString: 'GDPR_CONSENT_STRING',
663
+ gdprApplies: true,
664
+ }
665
+ let uspConsent = {
666
+ consentString: 'USP_CONSENT_STRING',
667
+ }
668
+ let opts = spec.getUserSyncs(syncOptions, [AD_SERVER_RESPONSE], gdprConsent, uspConsent);
669
+
670
+ expect(opts.length).to.equal(1);
671
+ expect(opts[0].url).to.equal('https://sync.serverbid.com/ss/730181.html?gdpr=1&gdpr_consent=GDPR_CONSENT_STRING&us_privacy=USP_CONSENT_STRING');
672
+ })
673
+
628
674
  it('should return a sync url if pixel syncs are enabled and some are returned from the server', function () {
629
675
  let syncOptions = {'pixelEnabled': true};
630
676
  let opts = spec.getUserSyncs(syncOptions, [AD_SERVER_RESPONSE]);
@@ -707,7 +707,7 @@ describe('emx_digital Adapter', function () {
707
707
  }));
708
708
  });
709
709
 
710
- it('returns valid advertiser domain', function () {
710
+ it('returns valid advertiser domains', function () {
711
711
  const bidResponse = utils.deepClone(serverResponse);
712
712
  let result = spec.interpretResponse({body: bidResponse});
713
713
  expect(result[0].meta.advertiserDomains).to.deep.equal(expectedResponse[0].meta.advertiserDomains);
@@ -724,6 +724,7 @@ describe('emx_digital Adapter', function () {
724
724
  expect(syncs).to.not.be.an('undefined');
725
725
  expect(syncs).to.have.lengthOf(1);
726
726
  expect(syncs[0].type).to.equal('iframe');
727
+ expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html')
727
728
  });
728
729
 
729
730
  it('should pass gdpr params', function () {
@@ -734,6 +735,34 @@ describe('emx_digital Adapter', function () {
734
735
  expect(syncs).to.have.lengthOf(1);
735
736
  expect(syncs[0].type).to.equal('iframe');
736
737
  expect(syncs[0].url).to.contains('gdpr=0');
738
+ expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=0&gdpr_consent=test')
739
+ });
740
+
741
+ it('should pass us_privacy string', function () {
742
+ let syncs = spec.getUserSyncs({ iframeEnabled: true }, {}, {}, {
743
+ consentString: 'test',
744
+ });
745
+ expect(syncs).to.not.be.an('undefined');
746
+ expect(syncs).to.have.lengthOf(1);
747
+ expect(syncs[0].type).to.equal('iframe');
748
+ expect(syncs[0].url).to.contains('usp=test');
749
+ });
750
+
751
+ it('should pass us_privacy and gdpr strings', function () {
752
+ let syncs = spec.getUserSyncs({ iframeEnabled: true }, {},
753
+ {
754
+ gdprApplies: true,
755
+ consentString: 'test'
756
+ },
757
+ {
758
+ consentString: 'test'
759
+ });
760
+ expect(syncs).to.not.be.an('undefined');
761
+ expect(syncs).to.have.lengthOf(1);
762
+ expect(syncs[0].type).to.equal('iframe');
763
+ expect(syncs[0].url).to.contains('gdpr=1');
764
+ expect(syncs[0].url).to.contains('usp=test');
765
+ expect(syncs[0].url).to.equal('https://biddr.brealtime.com/check.html?gdpr=1&gdpr_consent=test&usp=test')
737
766
  });
738
767
  });
739
768
  });
@@ -161,5 +161,34 @@ describe('holidBidAdapterTests', () => {
161
161
 
162
162
  expect(userSyncs).to.deep.equal(expectedUserSyncs)
163
163
  })
164
+
165
+ it('should return empty user syncs when responsetimemillis is not defined', () => {
166
+ const optionsType = {
167
+ iframeEnabled: true,
168
+ pixelEnabled: true,
169
+ }
170
+ const serverResponse = [
171
+ {
172
+ body: {
173
+ ext: {},
174
+ },
175
+ },
176
+ ]
177
+ const gdprConsent = {
178
+ gdprApplies: 1,
179
+ consentString: 'dkj49Sjmfjuj34as:12jaf90123hufabidfy9u23brfpoig',
180
+ }
181
+ const uspConsent = 'mkjvbiniwot4827obfoy8sdg8203gb'
182
+ const expectedUserSyncs = []
183
+
184
+ const userSyncs = spec.getUserSyncs(
185
+ optionsType,
186
+ serverResponse,
187
+ gdprConsent,
188
+ uspConsent
189
+ )
190
+
191
+ expect(userSyncs).to.deep.equal(expectedUserSyncs)
192
+ })
164
193
  })
165
194
  })
@@ -658,7 +658,7 @@ describe('IndexexchangeAdapter', function () {
658
658
  }
659
659
  };
660
660
 
661
- const DEFAULT_VIDEO_BID_RESPONSE_WITH_MTYPE_SET = {
661
+ const DEFAULT_VIDEO_BID_RESPONSE_WITH_XML_ADM = {
662
662
  cur: 'USD',
663
663
  id: '1aa2bb3cc4de',
664
664
  seatbid: [
@@ -675,7 +675,6 @@ describe('IndexexchangeAdapter', function () {
675
675
  mtype: 2,
676
676
  adm: '<?xml version=\"1.0\" encoding=\"UTF-8\"?><VAST xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"vast.xsd\" version=\"3.0\"> <Ad id=\"488427365\"> <InLine> <AdSystem>Test</AdSystem> <AdTitle>In-Stream Video</AdTitle> </InLine> </Ad></VAST',
677
677
  ext: {
678
- vasturl: 'www.abcd.com/vast',
679
678
  errorurl: 'www.abcd.com/error',
680
679
  dspid: 51,
681
680
  pricelevel: '_110',
@@ -1614,15 +1613,15 @@ describe('IndexexchangeAdapter', function () {
1614
1613
  expect(r.ext.ixdiag.fpd).to.exist;
1615
1614
  });
1616
1615
 
1617
- it('should set ixdiag.tmax value if it exists using tmax', function () {
1616
+ it('should set ixdiag.tmax value from bidderRequest overriding global config bidderTimeout', function () {
1618
1617
  config.setConfig({
1619
1618
  bidderTimeout: 250
1620
1619
  });
1621
1620
 
1622
- const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID)[0];
1621
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { timeout: 1234 })[0];
1623
1622
  const r = extractPayload(request);
1624
1623
 
1625
- expect(r.ext.ixdiag.tmax).to.equal(250);
1624
+ expect(r.ext.ixdiag.tmax).to.equal(1234);
1626
1625
  });
1627
1626
 
1628
1627
  it('should not set ixdiag.tmax value if bidderTimeout is undefined', function () {
@@ -1686,6 +1685,40 @@ describe('IndexexchangeAdapter', function () {
1686
1685
  expect(r.site.keywords).to.be.undefined;
1687
1686
  expect(r.user).to.be.undefined;
1688
1687
  });
1688
+ it('should set gpp and gpp_sid field when defined', function () {
1689
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2: {regs: {gpp: 'gpp', gpp_sid: [1]}} })[0];
1690
+ const r = extractPayload(request);
1691
+
1692
+ expect(r.regs.gpp).to.equal('gpp');
1693
+ expect(r.regs.gpp_sid).to.be.an('array');
1694
+ expect(r.regs.gpp_sid).to.include(1);
1695
+ });
1696
+ it('should not set gpp and gpp_sid field when not defined', function () {
1697
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2: {regs: {}} })[0];
1698
+ const r = extractPayload(request);
1699
+
1700
+ expect(r.regs).to.be.undefined;
1701
+ });
1702
+ it('should not set gpp and gpp_sid field when fields arent strings or array defined', function () {
1703
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2: {regs: {gpp: 1, gpp_sid: 'string'}} })[0];
1704
+ const r = extractPayload(request);
1705
+
1706
+ expect(r.regs).to.be.undefined;
1707
+ });
1708
+ it('should set gpp info from module when it exists', function () {
1709
+ const options = {
1710
+ gppConsent: {
1711
+ gppString: 'gpp',
1712
+ applicableSections: [1]
1713
+ }
1714
+ };
1715
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options);
1716
+ const r = extractPayload(request[0]);
1717
+
1718
+ expect(r.regs.gpp).to.equal('gpp');
1719
+ expect(r.regs.gpp_sid).to.be.an('array');
1720
+ expect(r.regs.gpp_sid).to.include(1);
1721
+ });
1689
1722
  });
1690
1723
 
1691
1724
  describe('buildRequests', function () {
@@ -2065,6 +2098,44 @@ describe('IndexexchangeAdapter', function () {
2065
2098
  expect(pageUrl).to.equal(expectedPageUrl);
2066
2099
  });
2067
2100
 
2101
+ it('should set device sua if available in fpd and request size does not exceed limit', function () {
2102
+ const ortb2 = {
2103
+ device: {
2104
+ sua: {
2105
+ platform: {
2106
+ brand: 'macOS',
2107
+ version: [ '12', '6', '1' ]
2108
+ },
2109
+ browsers: [
2110
+ {
2111
+ brand: 'Chromium',
2112
+ version: [ '107', '0', '5249', '119' ]
2113
+ },
2114
+ {
2115
+ brand: 'Google Chrome',
2116
+ version: [ '107', '0', '5249', '119' ]
2117
+ },
2118
+ ],
2119
+ mobile: 0,
2120
+ model: ''
2121
+ }
2122
+ }};
2123
+
2124
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2 })[0];
2125
+ const payload = extractPayload(request);
2126
+ expect(payload.device.sua.platform.brand).to.equal('macOS')
2127
+ expect(payload.device.sua.mobile).to.equal(0)
2128
+ });
2129
+
2130
+ it('should not set device sua if not available in fpd', function () {
2131
+ const ortb2 = {
2132
+ device: {}};
2133
+
2134
+ const request = spec.buildRequests(DEFAULT_BANNER_VALID_BID, { ortb2 })[0];
2135
+ const payload = extractPayload(request);
2136
+ expect(payload.device).to.be.undefined
2137
+ });
2138
+
2068
2139
  it('should not set first party data if it is not an object', function () {
2069
2140
  config.setConfig({
2070
2141
  ix: {
@@ -3121,13 +3192,53 @@ describe('IndexexchangeAdapter', function () {
3121
3192
  }
3122
3193
  }
3123
3194
  ];
3124
- const result = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE_WITH_MTYPE_SET }, {
3195
+ const result = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE_WITH_XML_ADM }, {
3125
3196
  data: videoBidderRequest.data, validBidRequests: ONE_VIDEO
3126
3197
  });
3127
3198
 
3128
3199
  expect(result[0]).to.deep.equal(expectedParse[0]);
3129
3200
  });
3130
3201
 
3202
+ it('should not set vastxml when vasturl is present and when mtype is 2 (video)', function () {
3203
+ const expectedParse = [
3204
+ {
3205
+ requestId: '1a2b3c4e',
3206
+ cpm: 1.1,
3207
+ creativeId: '12346',
3208
+ mediaType: 'video',
3209
+ mediaTypes: {
3210
+ video: {
3211
+ context: 'instream',
3212
+ playerSize: [
3213
+ [
3214
+ 400,
3215
+ 100
3216
+ ]
3217
+ ]
3218
+ }
3219
+ },
3220
+ width: 640,
3221
+ height: 480,
3222
+ currency: 'USD',
3223
+ ttl: 3600,
3224
+ netRevenue: true,
3225
+ vastUrl: 'www.abcd.com/vast',
3226
+ meta: {
3227
+ networkId: 51,
3228
+ brandId: 303326,
3229
+ brandName: 'OECTB',
3230
+ advertiserDomains: ['www.abcd.com']
3231
+ }
3232
+ }
3233
+ ];
3234
+ let bid_response = DEFAULT_VIDEO_BID_RESPONSE_WITH_XML_ADM;
3235
+ bid_response.seatbid[0].bid[0].ext['vasturl'] = 'www.abcd.com/vast';
3236
+ const result = spec.interpretResponse({ body: bid_response }, {
3237
+ data: videoBidderRequest.data, validBidRequests: ONE_VIDEO
3238
+ });
3239
+ expect(result[0]).to.deep.equal(expectedParse[0]);
3240
+ });
3241
+
3131
3242
  it('bidrequest should not have page if options is undefined', function () {
3132
3243
  const options = {};
3133
3244
  const validBidWithoutreferInfo = spec.buildRequests(DEFAULT_BANNER_VALID_BID, options);
@@ -556,6 +556,17 @@ describe('kargo adapter tests', function () {
556
556
  mediaType: 'video',
557
557
  metadata: {},
558
558
  currency: 'EUR'
559
+ },
560
+ 6: {
561
+ id: 'bar',
562
+ cpm: 2.5,
563
+ adm: '',
564
+ admUrl: 'https://foobar.com/vast_adm',
565
+ width: 300,
566
+ height: 250,
567
+ mediaType: 'video',
568
+ metadata: {},
569
+ currency: 'EUR'
559
570
  }
560
571
  }}, {
561
572
  currency: 'USD',
@@ -584,6 +595,11 @@ describe('kargo adapter tests', function () {
584
595
  params: {
585
596
  placementId: 'bar'
586
597
  }
598
+ }, {
599
+ bidId: 6,
600
+ params: {
601
+ placementId: 'bar'
602
+ }
587
603
  }]
588
604
  });
589
605
  var expectation = [{
@@ -664,6 +680,22 @@ describe('kargo adapter tests', function () {
664
680
  meta: {
665
681
  mediaType: 'video'
666
682
  }
683
+ }, {
684
+ requestId: '6',
685
+ cpm: 2.5,
686
+ width: 300,
687
+ height: 250,
688
+ ad: '',
689
+ vastUrl: 'https://foobar.com/vast_adm',
690
+ ttl: 300,
691
+ creativeId: 'bar',
692
+ dealId: undefined,
693
+ netRevenue: true,
694
+ currency: 'EUR',
695
+ mediaType: 'video',
696
+ meta: {
697
+ mediaType: 'video'
698
+ }
667
699
  }];
668
700
  expect(resp).to.deep.equal(expectation);
669
701
  });