prebid.js 7.25.0 → 7.26.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 (168) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/adagioBidAdapter.js +1 -1
  3. package/dist/adbookpspBidAdapter.js +1 -1
  4. package/dist/adgenerationBidAdapter.js +1 -1
  5. package/dist/admaticBidAdapter.js +1 -1
  6. package/dist/adrelevantisBidAdapter.js +1 -1
  7. package/dist/adtrgtmeBidAdapter.js +1 -1
  8. package/dist/adxcgBidAdapter.js +1 -1
  9. package/dist/ajaBidAdapter.js +1 -1
  10. package/dist/amxBidAdapter.js +1 -1
  11. package/dist/amxIdSystem.js +1 -1
  12. package/dist/appierAnalyticsAdapter.js +1 -1
  13. package/dist/appnexusBidAdapter.js +1 -1
  14. package/dist/asoBidAdapter.js +1 -1
  15. package/dist/axonixBidAdapter.js +1 -1
  16. package/dist/beopBidAdapter.js +1 -1
  17. package/dist/bidglassBidAdapter.js +1 -1
  18. package/dist/big-richmediaBidAdapter.js +1 -1
  19. package/dist/bridgewellBidAdapter.js +1 -1
  20. package/dist/brightMountainMediaBidAdapter.js +1 -1
  21. package/dist/captifyRtdProvider.js +1 -0
  22. package/dist/carodaBidAdapter.js +1 -1
  23. package/dist/chtnwBidAdapter.js +1 -1
  24. package/dist/concertBidAdapter.js +1 -1
  25. package/dist/connectadBidAdapter.js +1 -1
  26. package/dist/consumableBidAdapter.js +1 -1
  27. package/dist/conversantBidAdapter.js +1 -1
  28. package/dist/craftBidAdapter.js +1 -1
  29. package/dist/criteoBidAdapter.js +1 -1
  30. package/dist/discoveryBidAdapter.js +1 -1
  31. package/dist/dspxBidAdapter.js +1 -1
  32. package/dist/eplanningBidAdapter.js +1 -1
  33. package/dist/finativeBidAdapter.js +1 -1
  34. package/dist/glimpseBidAdapter.js +1 -1
  35. package/dist/gmosspBidAdapter.js +1 -1
  36. package/dist/goldbachBidAdapter.js +1 -1
  37. package/dist/gridBidAdapter.js +1 -1
  38. package/dist/gridNMBidAdapter.js +1 -1
  39. package/dist/gumgumBidAdapter.js +1 -1
  40. package/dist/h12mediaBidAdapter.js +1 -1
  41. package/dist/id5IdSystem.js +1 -1
  42. package/dist/improvedigitalBidAdapter.js +1 -1
  43. package/dist/inmarBidAdapter.js +1 -1
  44. package/dist/insticatorBidAdapter.js +1 -1
  45. package/dist/ixBidAdapter.js +1 -1
  46. package/dist/justpremiumBidAdapter.js +1 -1
  47. package/dist/konduitAnalyticsAdapter.js +1 -1
  48. package/dist/kueezBidAdapter.js +1 -1
  49. package/dist/kueezRtbBidAdapter.js +1 -1
  50. package/dist/lassoBidAdapter.js +1 -1
  51. package/dist/lifestreetBidAdapter.js +1 -1
  52. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  53. package/dist/logicadBidAdapter.js +1 -1
  54. package/dist/loglyliftBidAdapter.js +1 -1
  55. package/dist/magniteAnalyticsAdapter.js +1 -1
  56. package/dist/malltvAnalyticsAdapter.js +1 -1
  57. package/dist/marsmediaBidAdapter.js +1 -1
  58. package/dist/mediafuseBidAdapter.js +1 -1
  59. package/dist/mediasquareBidAdapter.js +1 -1
  60. package/dist/mgidBidAdapter.js +1 -1
  61. package/dist/minutemediaBidAdapter.js +1 -1
  62. package/dist/nextMillenniumBidAdapter.js +1 -1
  63. package/dist/not-for-prod/prebid.js +152 -118
  64. package/dist/oguryBidAdapter.js +1 -1
  65. package/dist/onetagBidAdapter.js +1 -1
  66. package/dist/ooloAnalyticsAdapter.js +1 -1
  67. package/dist/outbrainBidAdapter.js +1 -1
  68. package/dist/parrableIdSystem.js +1 -1
  69. package/dist/pixfutureBidAdapter.js +1 -1
  70. package/dist/prebid-core.js +1 -1
  71. package/dist/publinkIdSystem.js +1 -1
  72. package/dist/pubmaticBidAdapter.js +1 -1
  73. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  74. package/dist/pxyzBidAdapter.js +1 -1
  75. package/dist/quantcastBidAdapter.js +1 -1
  76. package/dist/readpeakBidAdapter.js +1 -1
  77. package/dist/relaidoBidAdapter.js +1 -1
  78. package/dist/rhythmoneBidAdapter.js +1 -1
  79. package/dist/riseBidAdapter.js +1 -1
  80. package/dist/rubiconAnalyticsAdapter.js +1 -1
  81. package/dist/rubiconBidAdapter.js +1 -1
  82. package/dist/seedingAllianceBidAdapter.js +1 -1
  83. package/dist/seedtagBidAdapter.js +1 -1
  84. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  85. package/dist/sharethroughBidAdapter.js +1 -1
  86. package/dist/shinezBidAdapter.js +1 -1
  87. package/dist/smaatoBidAdapter.js +1 -1
  88. package/dist/smartadserverBidAdapter.js +1 -1
  89. package/dist/smartxBidAdapter.js +1 -1
  90. package/dist/smartytechBidAdapter.js +1 -0
  91. package/dist/smilewantedBidAdapter.js +1 -1
  92. package/dist/sonobiBidAdapter.js +1 -1
  93. package/dist/sovrnAnalyticsAdapter.js +1 -1
  94. package/dist/sovrnBidAdapter.js +1 -1
  95. package/dist/sspBCBidAdapter.js +1 -1
  96. package/dist/sublimeBidAdapter.js +1 -1
  97. package/dist/synacormediaBidAdapter.js +1 -1
  98. package/dist/taboolaBidAdapter.js +1 -1
  99. package/dist/tappxBidAdapter.js +1 -1
  100. package/dist/targetVideoBidAdapter.js +1 -1
  101. package/dist/teadsBidAdapter.js +1 -1
  102. package/dist/trionBidAdapter.js +1 -1
  103. package/dist/tripleliftBidAdapter.js +1 -1
  104. package/dist/ttdBidAdapter.js +1 -1
  105. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  106. package/dist/underdogmediaBidAdapter.js +1 -1
  107. package/dist/undertoneBidAdapter.js +1 -1
  108. package/dist/userId.js +1 -1
  109. package/dist/vidazooBidAdapter.js +1 -1
  110. package/dist/videobyteBidAdapter.js +1 -1
  111. package/dist/viqeoBidAdapter.js +1 -0
  112. package/dist/visxBidAdapter.js +1 -1
  113. package/dist/vuukleBidAdapter.js +1 -1
  114. package/dist/widespaceBidAdapter.js +1 -1
  115. package/dist/winrBidAdapter.js +1 -1
  116. package/dist/yahoosspBidAdapter.js +1 -1
  117. package/dist/yieldlabBidAdapter.js +1 -1
  118. package/dist/yieldmoBidAdapter.js +1 -1
  119. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  120. package/dist/zeta_global_sspBidAdapter.js +1 -1
  121. package/dist/zeusPrimeRtdProvider.js +31 -0
  122. package/integrationExamples/gpt/captifyRtdProvider_example.html +167 -0
  123. package/modules/.submodules.json +3 -1
  124. package/modules/admaticBidAdapter.js +108 -59
  125. package/modules/admaticBidAdapter.md +2 -2
  126. package/modules/beopBidAdapter.js +17 -2
  127. package/modules/captifyRtdProvider.js +146 -0
  128. package/modules/captifyRtdProvider.md +68 -0
  129. package/modules/discoveryBidAdapter.js +38 -17
  130. package/modules/discoveryBidAdapter.md +7 -6
  131. package/modules/gridBidAdapter.js +440 -22
  132. package/modules/nextMillenniumBidAdapter.js +19 -23
  133. package/modules/smartadserverBidAdapter.js +6 -2
  134. package/modules/smartxBidAdapter.js +10 -7
  135. package/modules/smartytechBidAdapter.js +78 -0
  136. package/modules/smartytechBidAdapter.md +44 -0
  137. package/modules/taboolaBidAdapter.js +3 -3
  138. package/modules/taboolaBidAdapter.md +0 -2
  139. package/modules/tappxBidAdapter.js +21 -6
  140. package/modules/ttdBidAdapter.js +4 -3
  141. package/modules/userId/index.js +1 -1
  142. package/modules/vidazooBidAdapter.js +15 -2
  143. package/modules/viqeoBidAdapter.js +180 -0
  144. package/modules/viqeoBidAdapter.md +56 -0
  145. package/modules/yieldlabBidAdapter.js +19 -8
  146. package/modules/yieldoneBidAdapter.js +60 -8
  147. package/modules/yieldoneBidAdapter.md +109 -9
  148. package/modules/zeta_global_sspBidAdapter.js +4 -0
  149. package/modules/zeusPrimeRtdProvider.js +357 -0
  150. package/modules/zeusPrimeRtdProvider.md +60 -0
  151. package/package.json +1 -1
  152. package/src/adloader.js +0 -1
  153. package/test/spec/modules/admaticBidAdapter_spec.js +262 -3
  154. package/test/spec/modules/beopBidAdapter_spec.js +52 -0
  155. package/test/spec/modules/captifyRtdProvider_spec.js +253 -0
  156. package/test/spec/modules/discoveryBidAdapter_spec.js +9 -8
  157. package/test/spec/modules/gridBidAdapter_spec.js +289 -1
  158. package/test/spec/modules/nextMillenniumBidAdapter_spec.js +4 -3
  159. package/test/spec/modules/smartadserverBidAdapter_spec.js +80 -0
  160. package/test/spec/modules/smartxBidAdapter_spec.js +32 -0
  161. package/test/spec/modules/smartytechBidAdapter_spec.js +162 -0
  162. package/test/spec/modules/taboolaBidAdapter_spec.js +0 -77
  163. package/test/spec/modules/ttdBidAdapter_spec.js +13 -0
  164. package/test/spec/modules/viqeoBidAdapter_spec.js +124 -0
  165. package/test/spec/modules/yieldlabBidAdapter_spec.js +125 -0
  166. package/test/spec/modules/yieldoneBidAdapter_spec.js +30 -6
  167. package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +16 -1
  168. package/test/spec/modules/zeusPrimeRtdProvider_spec.js +410 -0
@@ -0,0 +1,162 @@
1
+ import {expect} from 'chai';
2
+ import {spec, ENDPOINT_PROTOCOL, ENDPOINT_DOMAIN, ENDPOINT_PATH} from 'modules/smartytechBidAdapter';
3
+ import {newBidder} from 'src/adapters/bidderFactory.js';
4
+
5
+ const BIDDER_CODE = 'smartytech';
6
+
7
+ describe('SmartyTechDSPAdapter: inherited functions', function () {
8
+ let adapter;
9
+ beforeEach(() => {
10
+ adapter = newBidder(spec);
11
+ });
12
+ it('exists and is a function', function () {
13
+ expect(adapter.callBids).to.be.exist.and.to.be.a('function');
14
+ });
15
+ it(`bidder code is ${BIDDER_CODE}`, function () {
16
+ expect(spec.code).to.be.equal(BIDDER_CODE);
17
+ })
18
+ });
19
+
20
+ describe('SmartyTechDSPAdapter: isBidRequestValid', function () {
21
+ it('Invalid bid request. Should return false', function () {
22
+ const invalidBidFixture = {
23
+ params: {
24
+ use_id: 13144375
25
+ }
26
+ }
27
+ expect(spec.isBidRequestValid(invalidBidFixture)).to.be.false
28
+ });
29
+ it('Valid bid request. Should return true', function () {
30
+ const validBidFixture = {
31
+ params: {
32
+ endpointId: 13144375
33
+ }
34
+ }
35
+ expect(spec.isBidRequestValid(validBidFixture)).to.be.true
36
+ });
37
+ });
38
+
39
+ function mockRandomSizeArray(len) {
40
+ return Array.apply(null, {length: len}).map(i => {
41
+ return [Math.floor(Math.random() * 800), Math.floor(Math.random() * 800)]
42
+ });
43
+ }
44
+
45
+ function mockBidRequestListData(size) {
46
+ return Array.apply(null, {length: size}).map((i, index) => {
47
+ const id = Math.floor(Math.random() * 800) * (index + 1);
48
+ return {
49
+ adUnitCode: `adUnitCode-${id}`,
50
+ sizes: mockRandomSizeArray(index + 1),
51
+ bidId: `bidId-${id}`,
52
+ params: {
53
+ endpointId: id
54
+ }
55
+ }
56
+ });
57
+ }
58
+
59
+ function mockRefererData() {
60
+ return {
61
+ refererInfo: {
62
+ page: 'https://some-test.page'
63
+ }
64
+ }
65
+ }
66
+
67
+ function mockResponseData(requestData) {
68
+ let data = {}
69
+
70
+ requestData.data.forEach((request, index) => {
71
+ const sizeArrayIndex = Math.floor(Math.random() * (request.sizes.length - 1));
72
+ const rndIndex = Math.floor(Math.random() * 800);
73
+
74
+ data[request.adUnitCode] = {
75
+ ad: `ad-${rndIndex}`,
76
+ width: request.sizes[sizeArrayIndex][0],
77
+ height: request.sizes[sizeArrayIndex][1],
78
+ creativeId: `creative-id-${index}`,
79
+ cpm: Math.floor(Math.random() * 100),
80
+ currency: `UAH-${rndIndex}`
81
+ };
82
+ });
83
+ return {
84
+ body: data
85
+ }
86
+ };
87
+
88
+ describe('SmartyTechDSPAdapter: buildRequests', () => {
89
+ let mockBidRequest;
90
+ let mockReferer;
91
+ beforeEach(() => {
92
+ mockBidRequest = mockBidRequestListData(8);
93
+ mockReferer = mockRefererData();
94
+ });
95
+ it('has return data', () => {
96
+ const request = spec.buildRequests(mockBidRequest, mockReferer);
97
+ expect(request).not.null;
98
+ });
99
+ it('correct request URL', () => {
100
+ const request = spec.buildRequests(mockBidRequest, mockReferer);
101
+ expect(request.url).to.be.equal(`${ENDPOINT_PROTOCOL}://${ENDPOINT_DOMAIN}${ENDPOINT_PATH}`)
102
+ });
103
+ it('correct request method', () => {
104
+ const request = spec.buildRequests(mockBidRequest, mockReferer);
105
+ expect(request.method).to.be.equal(`POST`)
106
+ });
107
+ it('correct request data', () => {
108
+ const data = spec.buildRequests(mockBidRequest, mockReferer).data;
109
+ data.forEach((request, index) => {
110
+ expect(request.adUnitCode).to.be.equal(mockBidRequest[index].adUnitCode);
111
+ expect(request.sizes).to.be.equal(mockBidRequest[index].sizes);
112
+ expect(request.bidId).to.be.equal(mockBidRequest[index].bidId);
113
+ expect(request.endpointId).to.be.equal(mockBidRequest[index].params.endpointId);
114
+ expect(request.referer).to.be.equal(mockReferer.refererInfo.page);
115
+ })
116
+ });
117
+ });
118
+
119
+ describe('SmartyTechDSPAdapter: interpretResponse', () => {
120
+ let mockBidRequest;
121
+ let mockReferer;
122
+ let request;
123
+ let mockResponse;
124
+ beforeEach(() => {
125
+ const brData = mockBidRequestListData(2);
126
+ mockReferer = mockRefererData();
127
+ request = spec.buildRequests(brData, mockReferer);
128
+ mockBidRequest = {
129
+ data: brData
130
+ }
131
+ mockResponse = mockResponseData(request);
132
+ });
133
+
134
+ it('interpretResponse: empty data request', () => {
135
+ delete mockResponse['body']
136
+ const data = spec.interpretResponse(mockResponse, mockBidRequest);
137
+ expect(data.length).to.be.equal(0);
138
+ });
139
+
140
+ it('interpretResponse: response data and convert data arrays has same length', () => {
141
+ const keys = Object.keys(mockResponse.body);
142
+ const data = spec.interpretResponse(mockResponse, mockBidRequest);
143
+ expect(data.length).to.be.equal(keys.length);
144
+ });
145
+
146
+ it('interpretResponse: convert to correct data', () => {
147
+ const keys = Object.keys(mockResponse.body);
148
+ const data = spec.interpretResponse(mockResponse, mockBidRequest);
149
+
150
+ data.forEach((responseItem, index) => {
151
+ expect(responseItem.ad).to.be.equal(mockResponse.body[keys[index]].ad);
152
+ expect(responseItem.cpm).to.be.equal(mockResponse.body[keys[index]].cpm);
153
+ expect(responseItem.creativeId).to.be.equal(mockResponse.body[keys[index]].creativeId);
154
+ expect(responseItem.currency).to.be.equal(mockResponse.body[keys[index]].currency);
155
+ expect(responseItem.netRevenue).to.be.true;
156
+ expect(responseItem.ttl).to.be.equal(60);
157
+ expect(responseItem.requestId).to.be.equal(mockBidRequest.data[index].bidId);
158
+ expect(responseItem.width).to.be.equal(mockResponse.body[keys[index]].width);
159
+ expect(responseItem.height).to.be.equal(mockResponse.body[keys[index]].height);
160
+ });
161
+ });
162
+ });
@@ -89,45 +89,6 @@ describe('Taboola Adapter', function () {
89
89
  }
90
90
  expect(spec.isBidRequestValid(bid)).to.equal(true)
91
91
  })
92
-
93
- it('should succeed when url is null', function () {
94
- const bid = {
95
- bidder: 'taboola',
96
- params: {
97
- publisherId: 'publisherId',
98
- tagId: 'below the article',
99
- endpointUrl: null
100
- },
101
- ...displayBidRequestParams
102
- }
103
- expect(spec.isBidRequestValid(bid)).to.equal(true)
104
- })
105
-
106
- it('should succeed when url is empty string', function () {
107
- const bid = {
108
- bidder: 'taboola',
109
- params: {
110
- publisherId: 'publisherId',
111
- tagId: 'below the article',
112
- endpointUrl: ''
113
- },
114
- ...displayBidRequestParams
115
- }
116
- expect(spec.isBidRequestValid(bid)).to.equal(true)
117
- })
118
-
119
- it('should succeed when url is filled', function () {
120
- const bid = {
121
- bidder: 'taboola',
122
- params: {
123
- publisherId: 'publisherId',
124
- tagId: 'below the article',
125
- endpointUrl: 'https://example.com'
126
- },
127
- ...displayBidRequestParams
128
- }
129
- expect(spec.isBidRequestValid(bid)).to.equal(true)
130
- })
131
92
  })
132
93
 
133
94
  describe('buildRequests', function () {
@@ -189,44 +150,6 @@ describe('Taboola Adapter', function () {
189
150
  expect(res.data).to.deep.equal(JSON.stringify(expectedData));
190
151
  });
191
152
 
192
- it('should fill the url when it is passed', function () {
193
- const commonBidRequestWithUrl = {
194
- bidder: 'taboola',
195
- params: {
196
- publisherId: 'publisherId',
197
- tagId: 'placement name',
198
- endpointUrl: 'https://example.com'
199
- },
200
- bidId: 'aa43860a-4644-442a-b5e0-93f268cs4d19',
201
- auctionId: '65746dca-26f3-4186-be13-dfa63469b1b7',
202
- }
203
- let defaultBidRequestWithUrl = {
204
- ...commonBidRequestWithUrl,
205
- ...displayBidRequestParams,
206
- }
207
- const res = spec.buildRequests([defaultBidRequestWithUrl], commonBidderRequest);
208
- expect(res.url).to.equal(`${commonBidRequestWithUrl.params.endpointUrl}/${commonBidRequest.params.publisherId}`);
209
- })
210
-
211
- it('should fill default url when url param is empty string', function () {
212
- const commonBidRequestWithUrl = {
213
- bidder: 'taboola',
214
- params: {
215
- publisherId: 'publisherId',
216
- tagId: 'placement name',
217
- endpointUrl: ''
218
- },
219
- bidId: 'aa43860a-4644-442a-b5e0-93f268cs4d19',
220
- auctionId: '65746dca-26f3-4186-be13-dfa63469b1b7',
221
- }
222
- let defaultBidRequestWithUrl = {
223
- ...commonBidRequestWithUrl,
224
- ...displayBidRequestParams,
225
- }
226
- const res = spec.buildRequests([defaultBidRequestWithUrl], commonBidderRequest);
227
- expect(res.url).to.equal(`${END_POINT_URL}/${commonBidRequestWithUrl.params.publisherId}`);
228
- })
229
-
230
153
  it('should pass optional parameters in request', function () {
231
154
  const optionalParams = {
232
155
  bidfloor: 0.25,
@@ -310,6 +310,19 @@ describe('ttdBidAdapter', function () {
310
310
  expect(requestBody.imp[0].banner.expdir).to.equal(expdir);
311
311
  });
312
312
 
313
+ it('merges first party site data', function () {
314
+ const ortb2 = {
315
+ site: {
316
+ publisher: {
317
+ domain: 'https://foo.bar',
318
+ }
319
+ }
320
+ };
321
+ const requestBody = testBuildRequests(baseBannerBidRequests, {...baseBidderRequest, ortb2}).data;
322
+ config.resetConfig();
323
+ expect(requestBody.site.publisher).to.deep.equal({domain: 'https://foo.bar', id: '13144370'});
324
+ });
325
+
313
326
  it('sets keywords properly if sent', function () {
314
327
  const ortb2 = {
315
328
  site: {
@@ -0,0 +1,124 @@
1
+ import {expect} from 'chai';
2
+ import {spec} from 'modules/viqeoBidAdapter';
3
+
4
+ describe('viqeoBidAdapter', function () {
5
+ it('minimal params', function () {
6
+ expect(spec.isBidRequestValid({
7
+ bidder: 'viqeo',
8
+ params: {
9
+ user: {
10
+ buyeruid: '1',
11
+ },
12
+ playerOptions: {
13
+ videoId: 'ed584da454c7205ca7e4',
14
+ profileId: 1382,
15
+ },
16
+ }})).to.equal(true);
17
+ });
18
+ it('minimal params no playerOptions', function () {
19
+ expect(spec.isBidRequestValid({
20
+ bidder: 'viqeo',
21
+ params: {
22
+ currency: 'EUR',
23
+ }})).to.equal(false);
24
+ });
25
+ it('build request check data', function () {
26
+ const bidRequestData = [{
27
+ bidId: 'id1',
28
+ bidder: 'viqeo',
29
+ params: {
30
+ user: {
31
+ buyeruid: '1',
32
+ },
33
+ currency: 'EUR',
34
+ floor: 0.5,
35
+ playerOptions: {
36
+ videoId: 'ed584da454c7205ca7e4',
37
+ profileId: 1382,
38
+ },
39
+ },
40
+ mediaTypes: {
41
+ video: { playerSize: [[240, 400]] }
42
+ },
43
+ }];
44
+ const request = spec.buildRequests(bidRequestData);
45
+ const requestData = request[0].data;
46
+ expect(requestData.id).to.equal('id1')
47
+ expect(requestData.imp[0].bidfloorcur).to.equal('EUR');
48
+ expect(requestData.imp[0].bidfloor).to.equal(0.5);
49
+ expect(requestData.imp[0].video.w).to.equal(240);
50
+ expect(requestData.imp[0].video.h).to.equal(400);
51
+ expect(requestData.user.buyeruid).to.equal('1');
52
+ });
53
+ it('build request check url', function () {
54
+ const bidRequestData = [{
55
+ bidder: 'viqeo',
56
+ params: {
57
+ playerOptions: {
58
+ videoId: 'ed584da454c7205ca7e4',
59
+ profileId: 1382,
60
+ },
61
+ sspId: 42,
62
+ },
63
+ mediaTypes: {
64
+ video: { playerSize: [[240, 400]] }
65
+ },
66
+ }];
67
+ const request = spec.buildRequests(bidRequestData);
68
+ expect(request[0].url).to.equal('https://ads.betweendigital.com/openrtb_bid/?sspId=42')
69
+ });
70
+ it('response_params common case', function () {
71
+ const bidRequestData = {
72
+ bids: [{
73
+ bidId: 'id1',
74
+ params: {},
75
+ mediaTypes: {
76
+ video: { playerSize: [[240, 400]] }
77
+ },
78
+ }],
79
+ };
80
+ const serverResponse = {
81
+ body: {
82
+ id: 'id1',
83
+ cur: 'EUR',
84
+ seatbid: [{
85
+ bid: [{
86
+ cpm: 0.5,
87
+ ttl: 3600,
88
+ netRevenue: true,
89
+ creativeId: 'test1',
90
+ adm: '',
91
+ }],
92
+ }],
93
+ }
94
+ };
95
+ const bids = spec.interpretResponse(serverResponse, bidRequestData);
96
+ expect(bids).to.have.lengthOf(1);
97
+ });
98
+ it('should set flooPrice to getFloor.floor value if it is greater than params.floor', function() {
99
+ const bidRequestData = [{
100
+ bidId: 'id1',
101
+ bidder: 'viqeo',
102
+ params: {
103
+ currency: 'EUR',
104
+ floor: 0.5,
105
+ playerOptions: {
106
+ videoId: 'ed584da454c7205ca7e4',
107
+ profileId: 1382,
108
+ },
109
+ },
110
+ mediaTypes: {
111
+ video: { playerSize: [[240, 400]] }
112
+ },
113
+ getFloor: () => {
114
+ return {
115
+ currency: 'EUR',
116
+ floor: 3.32
117
+ }
118
+ },
119
+ }];
120
+ const request = spec.buildRequests(bidRequestData);
121
+ const requestData = request[0].data;
122
+ expect(requestData.imp[0].bidfloor).to.equal(3.32)
123
+ });
124
+ });
@@ -80,6 +80,81 @@ const NATIVE_REQUEST = () => Object.assign(DEFAULT_REQUEST(), {
80
80
  }
81
81
  })
82
82
 
83
+ const IAB_REQUEST = () => Object.assign(DEFAULT_REQUEST(), {
84
+ params: {
85
+ adslotId: '1111',
86
+ supplyId: '2222',
87
+ iabContent: {
88
+ id: 'foo',
89
+ episode: '99',
90
+ title: 'bar',
91
+ series: 'baz',
92
+ season: 's01',
93
+ artist: 'foobar',
94
+ genre: 'barbaz',
95
+ isrc: 'CC-XXX-YY-NNNNN',
96
+ url: 'https://foo.test',
97
+ cat: ['cat1', 'cat2,ppp', 'cat3|||//'],
98
+ context: '2',
99
+ keywords: ['k1', 'k2', 'k3', 'k4'],
100
+ live: '0',
101
+ album: 'foo',
102
+ cattax: '3',
103
+ prodq: 2,
104
+ contentrating: 'foo',
105
+ userrating: 'bar',
106
+ qagmediarating: 2,
107
+ sourcerelationship: 1,
108
+ len: 12345,
109
+ language: 'en',
110
+ embeddable: 0,
111
+ producer: {
112
+ id: 'foo',
113
+ name: 'bar',
114
+ cattax: 532,
115
+ cat: [1, 'foo', true],
116
+ domain: 'producer.test'
117
+ },
118
+ data: {
119
+ id: 'foo',
120
+ name: 'bar',
121
+ segment: [{
122
+ name: 'foo',
123
+ value: 'bar',
124
+ ext: {
125
+ foo: {
126
+ bar: 'bar'
127
+ }
128
+ },
129
+ }, {
130
+ name: 'foo2',
131
+ value: 'bar2',
132
+ ext: {
133
+ test: {
134
+ nums: {
135
+ int: 123,
136
+ float: 123.123
137
+ },
138
+ bool: true,
139
+ string: 'foo2'
140
+ }
141
+ }
142
+ }],
143
+ },
144
+ network: {
145
+ id: 'foo',
146
+ name: 'bar',
147
+ domain: 'network.test'
148
+ },
149
+ channel: {
150
+ id: 'bar',
151
+ name: 'foo',
152
+ domain: 'channel.test'
153
+ }
154
+ }
155
+ }
156
+ })
157
+
83
158
  const RESPONSE = {
84
159
  advertiser: 'yieldlab',
85
160
  curl: 'https://www.yieldlab.de',
@@ -251,6 +326,56 @@ describe('yieldlabBidAdapter', () => {
251
326
  const request = spec.buildRequests([{...requestWithoutIabContent, ...siteConfig}])
252
327
  expect(request.url).to.include('iab_content=id%3Aid_from_config')
253
328
  })
329
+
330
+ it('flattens the iabContent, encodes the values, joins the keywords into one value, and than encodes the iab_content request param ', () => {
331
+ const expectedIabContentValue = encodeURIComponent(
332
+ 'id:foo,' +
333
+ 'episode:99,' +
334
+ 'title:bar,' +
335
+ 'series:baz,' +
336
+ 'season:s01,' +
337
+ 'artist:foobar,' +
338
+ 'genre:barbaz,' +
339
+ 'isrc:CC-XXX-YY-NNNNN,' +
340
+ 'url:https%3A%2F%2Ffoo.test,' +
341
+ 'cat:cat1|cat2%2Cppp|cat3%7C%7C%7C%2F%2F,' +
342
+ 'context:2,' +
343
+ 'keywords:k1|k2|k3|k4,' +
344
+ 'live:0,' +
345
+ 'album:foo,' +
346
+ 'cattax:3,' +
347
+ 'prodq:2,' +
348
+ 'contentrating:foo,' +
349
+ 'userrating:bar,' +
350
+ 'qagmediarating:2,' +
351
+ 'sourcerelationship:1,' +
352
+ 'len:12345,' +
353
+ 'language:en,' +
354
+ 'embeddable:0,' +
355
+ 'producer.id:foo,' +
356
+ 'producer.name:bar,' +
357
+ 'producer.cattax:532,' +
358
+ 'cat:1|foo|true,' +
359
+ 'producer.domain:producer.test,' +
360
+ 'data.id:foo,data.name:bar,' +
361
+ 'data.segment.0.name:foo,' +
362
+ 'data.segment.0.value:bar,' +
363
+ 'data.segment.0.ext.foo.bar:bar,' +
364
+ 'data.segment.1.name:foo2,' +
365
+ 'data.segment.1.value:bar2,' +
366
+ 'data.segment.1.ext.test.nums.int:123,' +
367
+ 'data.segment.1.ext.test.nums.float:123.123,' +
368
+ 'data.segment.1.ext.test.bool:true,' +
369
+ 'data.segment.1.ext.test.string:foo2,' +
370
+ 'network.id:foo,network.name:bar,' +
371
+ 'network.domain:network.test,' +
372
+ 'channel.id:bar,' +
373
+ 'channel.name:foo,' +
374
+ 'channel.domain:channel.test'
375
+ )
376
+ const request = spec.buildRequests([IAB_REQUEST()], REQPARAMS)
377
+ expect(request.url).to.include('iab_content=' + expectedIabContentValue)
378
+ })
254
379
  })
255
380
 
256
381
  it('passes unencoded schain string to bid request when complete == 0', () => {
@@ -140,7 +140,7 @@ describe('yieldoneBidAdapter', function() {
140
140
  });
141
141
  });
142
142
 
143
- describe('New Format', function () {
143
+ describe('Single Format', function () {
144
144
  const bidRequests = [
145
145
  {
146
146
  params: {placementId: '0'},
@@ -206,8 +206,11 @@ describe('yieldoneBidAdapter', function() {
206
206
 
207
207
  it('width and height should be set as separate parameters on outstream requests', function () {
208
208
  expect(request[0].data).to.not.have.property('w');
209
+ expect(request[0].data).to.not.have.property('h');
209
210
  expect(request[1].data).to.not.have.property('w');
211
+ expect(request[1].data).to.not.have.property('h');
210
212
  expect(request[2].data).to.not.have.property('w');
213
+ expect(request[2].data).to.not.have.property('h');
211
214
  expect(request[3].data.w).to.equal(1280);
212
215
  expect(request[3].data.h).to.equal(720);
213
216
  expect(request[4].data.w).to.equal(1920);
@@ -260,12 +263,13 @@ describe('yieldoneBidAdapter', function() {
260
263
 
261
264
  it('width and height should be set as separate parameters on outstream requests', function () {
262
265
  expect(request[0].data).to.not.have.property('w');
266
+ expect(request[0].data).to.not.have.property('h');
263
267
  expect(request[1].data.w).to.equal(1920);
264
268
  expect(request[1].data.h).to.equal(1080);
265
269
  });
266
270
  });
267
271
 
268
- describe('FLUX Format', function () {
272
+ describe('1x1 Format', function () {
269
273
  const bidRequests = [
270
274
  {
271
275
  // It will be treated as a banner.
@@ -326,6 +330,7 @@ describe('yieldoneBidAdapter', function() {
326
330
 
327
331
  it('width and height should be set as separate parameters on outstream requests', function () {
328
332
  expect(request[0].data).to.not.have.property('w');
333
+ expect(request[0].data).to.not.have.property('h');
329
334
  expect(request[1].data.w).to.equal(1920);
330
335
  expect(request[1].data.h).to.equal(1080);
331
336
  expect(request[2].data.w).to.equal(DEFAULT_VIDEO_SIZE.w);
@@ -500,9 +505,9 @@ describe('yieldoneBidAdapter', function() {
500
505
  'currency': 'JPY',
501
506
  'statusMessage': 'Bid available',
502
507
  'dealId': 'P1-FIX-7800-DSP-MON',
503
- 'admoain': [
508
+ 'adomain': [
504
509
  'www.example.com'
505
- ]
510
+ ],
506
511
  }
507
512
  };
508
513
 
@@ -528,7 +533,16 @@ describe('yieldoneBidAdapter', function() {
528
533
  }];
529
534
  let result = spec.interpretResponse(serverResponseBanner, bidRequestBanner[0]);
530
535
  expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedResponse[0]));
536
+ expect(result[0].requestId).to.equal(expectedResponse[0].requestId);
537
+ expect(result[0].cpm).to.equal(expectedResponse[0].cpm);
538
+ expect(result[0].width).to.equal(expectedResponse[0].width);
539
+ expect(result[0].height).to.equal(expectedResponse[0].height);
540
+ expect(result[0].creativeId).to.equal(expectedResponse[0].creativeId);
541
+ expect(result[0].dealId).to.equal(expectedResponse[0].dealId);
542
+ expect(result[0].currency).to.equal(expectedResponse[0].currency);
531
543
  expect(result[0].mediaType).to.equal(expectedResponse[0].mediaType);
544
+ expect(result[0].ad).to.equal(expectedResponse[0].ad);
545
+ expect(result[0].meta.advertiserDomains[0]).to.equal(expectedResponse[0].meta.advertiserDomains[0]);
532
546
  });
533
547
 
534
548
  let serverResponseVideo = {
@@ -537,7 +551,7 @@ describe('yieldoneBidAdapter', function() {
537
551
  'height': 360,
538
552
  'width': 640,
539
553
  'cpm': 0.0536616,
540
- 'dealId': 'P1-FIX-766-DSP-MON',
554
+ 'dealId': 'P1-FIX-7800-DSP-MON',
541
555
  'crid': '2494768',
542
556
  'currency': 'JPY',
543
557
  'statusMessage': 'Bid available',
@@ -575,7 +589,7 @@ describe('yieldoneBidAdapter', function() {
575
589
  'currency': 'JPY',
576
590
  'netRevenue': true,
577
591
  'ttl': 3000,
578
- 'referrer': '',
592
+ 'referrer': 'http%3A%2F%2Flocalhost%3A9876%2F%3Fid%3D74552836',
579
593
  'meta': {
580
594
  'advertiserDomains': []
581
595
  },
@@ -588,9 +602,19 @@ describe('yieldoneBidAdapter', function() {
588
602
  }];
589
603
  let result = spec.interpretResponse(serverResponseVideo, bidRequestVideo[0]);
590
604
  expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedResponse[0]));
605
+ expect(result[0].requestId).to.equal(expectedResponse[0].requestId);
606
+ expect(result[0].cpm).to.equal(expectedResponse[0].cpm);
607
+ expect(result[0].width).to.equal(expectedResponse[0].width);
608
+ expect(result[0].height).to.equal(expectedResponse[0].height);
609
+ expect(result[0].creativeId).to.equal(expectedResponse[0].creativeId);
610
+ expect(result[0].dealId).to.equal(expectedResponse[0].dealId);
611
+ expect(result[0].currency).to.equal(expectedResponse[0].currency);
612
+ expect(result[0].vastXml).to.equal(expectedResponse[0].vastXml);
591
613
  expect(result[0].mediaType).to.equal(expectedResponse[0].mediaType);
614
+ expect(result[0].referrer).to.equal(expectedResponse[0].referrer);
592
615
  expect(result[0].renderer.id).to.equal(expectedResponse[0].renderer.id);
593
616
  expect(result[0].renderer.url).to.equal(expectedResponse[0].renderer.url);
617
+ expect(result[0].meta.advertiserDomains[0]).to.equal(expectedResponse[0].meta.advertiserDomains[0]);
594
618
  });
595
619
 
596
620
  it('handles empty bid response', function () {
@@ -104,7 +104,8 @@ describe('Zeta Ssp Bid Adapter', function () {
104
104
  },
105
105
  uspConsent: 'someCCPAString',
106
106
  params: params,
107
- userIdAsEids: eids
107
+ userIdAsEids: eids,
108
+ timeout: 500
108
109
  }];
109
110
 
110
111
  const videoRequest = [{
@@ -344,4 +345,18 @@ describe('Zeta Ssp Bid Adapter', function () {
344
345
  expect(payload.imp[1].banner.w).to.eql(600);
345
346
  expect(payload.imp[1].banner.h).to.eql(400);
346
347
  });
348
+
349
+ it('Test provide tmax', function () {
350
+ const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
351
+ const payload = JSON.parse(request.data);
352
+
353
+ expect(payload.tmax).to.eql(500);
354
+ });
355
+
356
+ it('Test provide tmax without value', function () {
357
+ const request = spec.buildRequests(videoRequest, videoRequest[0]);
358
+ const payload = JSON.parse(request.data);
359
+
360
+ expect(payload.tmax).to.be.undefined;
361
+ });
347
362
  });