prebid.js 6.0.0 → 6.4.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.
- package/.babelrc.js +1 -7
- package/.circleci/config.yml +1 -1
- package/README.md +1 -1
- package/browsers.json +13 -29
- package/gulpfile.js +88 -82
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +23 -14
- package/karma.conf.maker.js +2 -2
- package/modules/33acrossBidAdapter.js +189 -102
- package/modules/adagioBidAdapter.js +1 -1
- package/modules/addefendBidAdapter.js +1 -0
- package/modules/adheseBidAdapter.js +7 -2
- package/modules/adkernelBidAdapter.js +147 -61
- package/modules/adlivetechBidAdapter.md +61 -0
- package/modules/adlooxAdServerVideo.js +2 -2
- package/modules/adlooxAnalyticsAdapter.js +4 -4
- package/modules/admanBidAdapter.js +1 -0
- package/modules/admixerBidAdapter.js +3 -2
- package/modules/adnuntiusBidAdapter.js +5 -2
- package/modules/adomikAnalyticsAdapter.js +16 -4
- package/modules/adplusBidAdapter.js +203 -0
- package/modules/adplusBidAdapter.md +39 -0
- package/modules/adxcgBidAdapter.js +311 -359
- package/modules/adxcgBidAdapter.md +22 -21
- package/modules/adyoulikeBidAdapter.js +7 -2
- package/modules/aniviewBidAdapter.js +1 -1
- package/modules/appnexusBidAdapter.js +23 -3
- package/modules/beachfrontBidAdapter.js +14 -17
- package/modules/beopBidAdapter.js +6 -4
- package/modules/bidViewability.js +3 -3
- package/modules/bidViewabilityIO.js +3 -3
- package/modules/codefuelBidAdapter.js +1 -3
- package/modules/codefuelBidAdapter.md +3 -3
- package/modules/colossussspBidAdapter.js +7 -0
- package/modules/compassBidAdapter.js +201 -0
- package/modules/compassBidAdapter.md +79 -0
- package/modules/craftBidAdapter.js +5 -3
- package/modules/criteoBidAdapter.js +1 -1
- package/modules/currency.js +2 -2
- package/modules/cwireBidAdapter.js +3 -0
- package/modules/dailyhuntBidAdapter.js +435 -0
- package/modules/dailyhuntBidAdapter.md +4 -0
- package/modules/datablocksBidAdapter.js +3 -3
- package/modules/dchain.js +149 -0
- package/modules/dchain.md +45 -0
- package/modules/deepintentBidAdapter.js +1 -1
- package/modules/dspxBidAdapter.js +1 -1
- package/modules/emx_digitalBidAdapter.js +9 -1
- package/modules/engageyaBidAdapter.js +68 -54
- package/modules/feedadBidAdapter.js +2 -2
- package/modules/feedadBidAdapter.md +4 -2
- package/modules/freewheel-sspBidAdapter.js +6 -0
- package/modules/futureads.md +48 -0
- package/modules/glimpseBidAdapter.js +44 -16
- package/modules/goldbachBidAdapter.js +1176 -0
- package/modules/goldbachBidAdapter.md +151 -0
- package/modules/gptPreAuction.js +11 -5
- package/modules/gridBidAdapter.js +5 -4
- package/modules/gumgumBidAdapter.js +7 -3
- package/modules/id5IdSystem.md +6 -6
- package/modules/imRtdProvider.js +31 -0
- package/modules/improvedigitalBidAdapter.js +19 -3
- package/modules/instreamTracking.js +4 -4
- package/modules/intersectionRtdProvider.js +114 -0
- package/modules/invibesBidAdapter.js +64 -14
- package/modules/invibesBidAdapter.md +2 -1
- package/modules/ipromBidAdapter.js +79 -0
- package/modules/ixBidAdapter.js +185 -22
- package/modules/kinessoIdSystem.js +1 -1
- package/modules/limelightDigitalBidAdapter.js +2 -1
- package/modules/livewrappedBidAdapter.js +8 -2
- package/modules/lotamePanoramaIdSystem.js +80 -8
- package/modules/luponmediaBidAdapter.js +570 -0
- package/modules/mediasquareBidAdapter.js +1 -9
- package/modules/merkleIdSystem.js +5 -0
- package/modules/missenaBidAdapter.js +89 -0
- package/modules/nativoBidAdapter.js +27 -1
- package/modules/nextMillenniumBidAdapter.js +37 -7
- package/modules/oguryBidAdapter.js +2 -1
- package/modules/openxBidAdapter.js +6 -1
- package/modules/prebidServerBidAdapter/index.js +19 -15
- package/modules/pubgeniusBidAdapter.js +1 -1
- package/modules/pubmaticBidAdapter.js +5 -3
- package/modules/pubxaiAnalyticsAdapter.js +17 -0
- package/modules/relaidoBidAdapter.js +86 -65
- package/modules/richaudienceBidAdapter.js +2 -3
- package/modules/rtdModule/index.js +48 -18
- package/modules/rubiconBidAdapter.js +31 -19
- package/modules/saambaaBidAdapter.js +420 -0
- package/modules/saambaaBidAdapter.md +65 -68
- package/modules/seedtagBidAdapter.js +6 -0
- package/modules/sharedIdSystem.js +27 -1
- package/modules/smaatoBidAdapter.js +9 -1
- package/modules/smartxBidAdapter.js +17 -1
- package/modules/sspBCBidAdapter.js +34 -3
- package/modules/tappxBidAdapter.js +3 -1
- package/modules/targetVideoBidAdapter.js +187 -0
- package/modules/targetVideoBidAdapter.md +34 -0
- package/modules/telariaBidAdapter.js +2 -2
- package/modules/trustxBidAdapter.js +18 -17
- package/modules/undertoneBidAdapter.js +8 -1
- package/modules/userId/index.js +27 -2
- package/modules/ventes.md +71 -0
- package/modules/ventesBidAdapter.js +104 -64
- package/modules/ventesBidAdapter.md +0 -1
- package/modules/vidoomyBidAdapter.js +65 -108
- package/modules/visxBidAdapter.js +20 -3
- package/modules/visxBidAdapter.md +4 -6
- package/modules/weboramaRtdProvider.js +288 -73
- package/modules/weboramaRtdProvider.md +27 -10
- package/modules/yahoosspBidAdapter.js +5 -1
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +41 -10
- package/modules/yieldlabBidAdapter.md +91 -48
- package/modules/yieldoneBidAdapter.js +115 -11
- package/modules/zetaSspBidAdapter.md +33 -1
- package/modules/zeta_global_sspBidAdapter.js +22 -1
- package/package.json +6 -1
- package/plugins/pbjsGlobals.js +28 -1
- package/src/adapterManager.js +14 -8
- package/src/auction.js +5 -4
- package/src/prebid.js +1 -2
- package/src/targeting.js +24 -3
- package/src/utils.js +41 -7
- package/test/helpers/prebidGlobal.js +1 -0
- package/test/spec/integration/faker/googletag.js +6 -0
- package/test/spec/modules/33acrossBidAdapter_spec.js +300 -78
- package/test/spec/modules/adheseBidAdapter_spec.js +27 -1
- package/test/spec/modules/adlooxAnalyticsAdapter_spec.js +6 -6
- package/test/spec/modules/adnuntiusBidAdapter_spec.js +35 -0
- package/test/spec/modules/adomikAnalyticsAdapter_spec.js +9 -1
- package/test/spec/modules/adplusBidAdapter_spec.js +213 -0
- package/test/spec/modules/adxcgBidAdapter_spec.js +820 -571
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +26 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +63 -1
- package/test/spec/modules/beachfrontBidAdapter_spec.js +65 -1
- package/test/spec/modules/beopBidAdapter_spec.js +1 -1
- package/test/spec/modules/bidViewabilityIO_spec.js +2 -2
- package/test/spec/modules/bidViewability_spec.js +4 -4
- package/test/spec/modules/codefuelBidAdapter_spec.js +1 -1
- package/test/spec/modules/colossussspBidAdapter_spec.js +9 -0
- package/test/spec/modules/compassBidAdapter_spec.js +397 -0
- package/test/spec/modules/cwireBidAdapter_spec.js +10 -8
- package/test/spec/modules/dailyhuntBidAdapter_spec.js +404 -0
- package/test/spec/modules/datablocksBidAdapter_spec.js +3 -3
- package/test/spec/modules/dchain_spec.js +329 -0
- package/test/spec/modules/emx_digitalBidAdapter_spec.js +10 -0
- package/test/spec/modules/engageyaBidAdapter_spec.js +231 -95
- package/test/spec/modules/eplanningBidAdapter_spec.js +8 -8
- package/test/spec/modules/feedadBidAdapter_spec.js +15 -0
- package/test/spec/modules/freewheel-sspBidAdapter_spec.js +19 -0
- package/test/spec/modules/glimpseBidAdapter_spec.js +33 -0
- package/test/spec/modules/goldbachBidAdapter_spec.js +1359 -0
- package/test/spec/modules/gptPreAuction_spec.js +58 -4
- package/test/spec/modules/gumgumBidAdapter_spec.js +6 -0
- package/test/spec/modules/imRtdProvider_spec.js +25 -0
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +3 -1
- package/test/spec/modules/intersectionRtdProvider_spec.js +141 -0
- package/test/spec/modules/invibesBidAdapter_spec.js +148 -4
- package/test/spec/modules/ipromBidAdapter_spec.js +195 -0
- package/test/spec/modules/ixBidAdapter_spec.js +293 -2
- package/test/spec/modules/konduitWrapper_spec.js +0 -1
- package/test/spec/modules/limelightDigitalBidAdapter_spec.js +10 -7
- package/test/spec/modules/livewrappedBidAdapter_spec.js +31 -0
- package/test/spec/modules/lotamePanoramaIdSystem_spec.js +227 -0
- package/test/spec/modules/luponmediaBidAdapter_spec.js +412 -0
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -4
- package/test/spec/modules/merkleIdSystem_spec.js +18 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +134 -0
- package/test/spec/modules/nativoBidAdapter_spec.js +35 -18
- package/test/spec/modules/nextMillenniumBidAdapter_spec.js +26 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +13 -11
- package/test/spec/modules/openxBidAdapter_spec.js +5 -0
- package/test/spec/modules/prebidServerBidAdapter_spec.js +62 -2
- package/test/spec/modules/pubgeniusBidAdapter_spec.js +3 -3
- package/test/spec/modules/pubmaticBidAdapter_spec.js +1 -1
- package/test/spec/modules/pubxaiAnalyticsAdapter_spec.js +11 -0
- package/test/spec/modules/realTimeDataModule_spec.js +135 -49
- package/test/spec/modules/relaidoBidAdapter_spec.js +71 -63
- package/test/spec/modules/richaudienceBidAdapter_spec.js +2 -2
- package/test/spec/modules/rubiconBidAdapter_spec.js +65 -9
- package/test/spec/modules/seedtagBidAdapter_spec.js +3 -0
- package/test/spec/modules/sharedIdSystem_spec.js +52 -6
- package/test/spec/modules/smaatoBidAdapter_spec.js +61 -0
- package/test/spec/modules/smartxBidAdapter_spec.js +9 -0
- package/test/spec/modules/sspBCBidAdapter_spec.js +33 -3
- package/test/spec/modules/tappxBidAdapter_spec.js +4 -0
- package/test/spec/modules/targetVideoBidAdapter_spec.js +96 -0
- package/test/spec/modules/trustxBidAdapter_spec.js +42 -0
- package/test/spec/modules/userId_spec.js +51 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +32 -13
- package/test/spec/modules/visxBidAdapter_spec.js +121 -5
- package/test/spec/modules/weboramaRtdProvider_spec.js +408 -214
- package/test/spec/modules/yahoosspBidAdapter_spec.js +28 -1
- package/test/spec/modules/yieldlabBidAdapter_spec.js +81 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +299 -53
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +33 -1
- package/test/spec/unit/core/adapterManager_spec.js +24 -6
- package/test/spec/unit/core/targeting_spec.js +116 -0
- package/test/spec/utils_spec.js +38 -0
- package/test/test_deps.js +3 -0
- package/test/test_index.js +1 -3
|
@@ -57,23 +57,34 @@ describe('RelaidoAdapter', function () {
|
|
|
57
57
|
serverResponse = {
|
|
58
58
|
body: {
|
|
59
59
|
status: 'ok',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
ads: [{
|
|
61
|
+
placementId: 100000,
|
|
62
|
+
width: 640,
|
|
63
|
+
height: 360,
|
|
64
|
+
bidId: '2ed93003f7bb99',
|
|
65
|
+
price: 500,
|
|
66
|
+
model: 'vcpm',
|
|
67
|
+
currency: 'JPY',
|
|
68
|
+
creativeId: 1000,
|
|
69
|
+
vast: '<VAST version="3.0"><Ad><InLine></InLine></Ad></VAST>',
|
|
70
|
+
syncUrl: 'https://relaido/sync.html',
|
|
71
|
+
adomain: ['relaido.co.jp', 'www.cmertv.co.jp'],
|
|
72
|
+
mediaType: 'video'
|
|
73
|
+
}],
|
|
66
74
|
playerUrl: 'https://relaido/player.js',
|
|
67
|
-
syncUrl: 'https://
|
|
68
|
-
|
|
75
|
+
syncUrl: 'https://api-dev.ulizaex.com/tr/v1/prebid/sync.html',
|
|
76
|
+
uuid: relaido_uuid,
|
|
69
77
|
}
|
|
70
78
|
};
|
|
71
79
|
serverRequest = {
|
|
72
|
-
method: '
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
method: 'POST',
|
|
81
|
+
data: {
|
|
82
|
+
bids: [{
|
|
83
|
+
bidId: bidRequest.bidId,
|
|
84
|
+
width: bidRequest.mediaTypes.video.playerSize[0][0],
|
|
85
|
+
height: bidRequest.mediaTypes.video.playerSize[0][1],
|
|
86
|
+
mediaType: 'video'}]
|
|
87
|
+
}
|
|
77
88
|
};
|
|
78
89
|
});
|
|
79
90
|
|
|
@@ -195,28 +206,23 @@ describe('RelaidoAdapter', function () {
|
|
|
195
206
|
describe('spec.buildRequests', function () {
|
|
196
207
|
it('should build bid requests by video', function () {
|
|
197
208
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
expect(
|
|
202
|
-
expect(
|
|
203
|
-
expect(
|
|
204
|
-
expect(
|
|
205
|
-
expect(request.
|
|
206
|
-
expect(request.
|
|
207
|
-
expect(
|
|
208
|
-
expect(request.
|
|
209
|
-
expect(
|
|
210
|
-
expect(request.
|
|
211
|
-
expect(request.
|
|
212
|
-
expect(request.
|
|
213
|
-
expect(
|
|
214
|
-
expect(
|
|
215
|
-
expect(request.data.media_type).to.equal('video');
|
|
216
|
-
expect(request.data.uuid).to.equal(relaido_uuid);
|
|
217
|
-
expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]);
|
|
218
|
-
expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]);
|
|
219
|
-
expect(request.data.pv).to.equal('$prebid.version$');
|
|
209
|
+
const data = JSON.parse(bidRequests.data);
|
|
210
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
211
|
+
const request = data.bids[0];
|
|
212
|
+
expect(bidRequests.method).to.equal('POST');
|
|
213
|
+
expect(bidRequests.url).to.equal('https://api.relaido.jp/bid/v1/sprebid');
|
|
214
|
+
expect(data.ref).to.equal(bidderRequest.refererInfo.referer);
|
|
215
|
+
expect(data.timeout_ms).to.equal(bidderRequest.timeout);
|
|
216
|
+
expect(request.ad_unit_code).to.equal(bidRequest.adUnitCode);
|
|
217
|
+
expect(request.auction_id).to.equal(bidRequest.auctionId);
|
|
218
|
+
expect(data.bidder).to.equal(bidRequest.bidder);
|
|
219
|
+
expect(request.bidder_request_id).to.equal(bidRequest.bidderRequestId);
|
|
220
|
+
expect(data.bid_requests_count).to.equal(bidRequest.bidRequestsCount);
|
|
221
|
+
expect(request.bid_id).to.equal(bidRequest.bidId);
|
|
222
|
+
expect(request.transaction_id).to.equal(bidRequest.transactionId);
|
|
223
|
+
expect(request.media_type).to.equal('video');
|
|
224
|
+
expect(data.uuid).to.equal(relaido_uuid);
|
|
225
|
+
expect(data.pv).to.equal('$prebid.version$');
|
|
220
226
|
});
|
|
221
227
|
|
|
222
228
|
it('should build bid requests by banner', function () {
|
|
@@ -236,9 +242,10 @@ describe('RelaidoAdapter', function () {
|
|
|
236
242
|
}
|
|
237
243
|
};
|
|
238
244
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
245
|
+
const data = JSON.parse(bidRequests.data);
|
|
246
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
247
|
+
const request = data.bids[0];
|
|
248
|
+
expect(request.media_type).to.equal('banner');
|
|
242
249
|
});
|
|
243
250
|
|
|
244
251
|
it('should take 1x1 size', function () {
|
|
@@ -258,17 +265,18 @@ describe('RelaidoAdapter', function () {
|
|
|
258
265
|
}
|
|
259
266
|
};
|
|
260
267
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
261
|
-
|
|
262
|
-
|
|
268
|
+
const data = JSON.parse(bidRequests.data);
|
|
269
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
270
|
+
const request = data.bids[0];
|
|
263
271
|
|
|
264
272
|
expect(request.width).to.equal(1);
|
|
265
273
|
});
|
|
266
274
|
|
|
267
275
|
it('The referrer should be the last', function () {
|
|
268
276
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const keys = Object.keys(
|
|
277
|
+
const data = JSON.parse(bidRequests.data);
|
|
278
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
279
|
+
const keys = Object.keys(data);
|
|
272
280
|
expect(keys[0]).to.equal('version');
|
|
273
281
|
expect(keys[keys.length - 1]).to.equal('ref');
|
|
274
282
|
});
|
|
@@ -277,9 +285,9 @@ describe('RelaidoAdapter', function () {
|
|
|
277
285
|
bidRequest.userId = {}
|
|
278
286
|
bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw';
|
|
279
287
|
const bidRequests = spec.buildRequests([bidRequest], bidderRequest);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
expect(
|
|
288
|
+
const data = JSON.parse(bidRequests.data);
|
|
289
|
+
expect(data.bids).to.have.lengthOf(1);
|
|
290
|
+
expect(data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw');
|
|
283
291
|
});
|
|
284
292
|
});
|
|
285
293
|
|
|
@@ -288,29 +296,29 @@ describe('RelaidoAdapter', function () {
|
|
|
288
296
|
const bidResponses = spec.interpretResponse(serverResponse, serverRequest);
|
|
289
297
|
expect(bidResponses).to.have.lengthOf(1);
|
|
290
298
|
const response = bidResponses[0];
|
|
291
|
-
expect(response.requestId).to.equal(serverRequest.bidId);
|
|
292
|
-
expect(response.width).to.equal(serverRequest.width);
|
|
293
|
-
expect(response.height).to.equal(serverRequest.height);
|
|
294
|
-
expect(response.cpm).to.equal(serverResponse.body.price);
|
|
295
|
-
expect(response.currency).to.equal(serverResponse.body.currency);
|
|
296
|
-
expect(response.creativeId).to.equal(serverResponse.body.creativeId);
|
|
297
|
-
expect(response.vastXml).to.equal(serverResponse.body.vast);
|
|
298
|
-
expect(response.meta.advertiserDomains).to.equal(serverResponse.body.adomain);
|
|
299
|
+
expect(response.requestId).to.equal(serverRequest.data.bids[0].bidId);
|
|
300
|
+
expect(response.width).to.equal(serverRequest.data.bids[0].width);
|
|
301
|
+
expect(response.height).to.equal(serverRequest.data.bids[0].height);
|
|
302
|
+
expect(response.cpm).to.equal(serverResponse.body.ads[0].price);
|
|
303
|
+
expect(response.currency).to.equal(serverResponse.body.ads[0].currency);
|
|
304
|
+
expect(response.creativeId).to.equal(serverResponse.body.ads[0].creativeId);
|
|
305
|
+
expect(response.vastXml).to.equal(serverResponse.body.ads[0].vast);
|
|
306
|
+
expect(response.meta.advertiserDomains).to.equal(serverResponse.body.ads[0].adomain);
|
|
299
307
|
expect(response.meta.mediaType).to.equal(VIDEO);
|
|
300
308
|
expect(response.ad).to.be.undefined;
|
|
301
309
|
});
|
|
302
310
|
|
|
303
311
|
it('should build bid response by banner', function () {
|
|
304
|
-
|
|
312
|
+
serverResponse.body.ads[0].mediaType = 'banner';
|
|
305
313
|
const bidResponses = spec.interpretResponse(serverResponse, serverRequest);
|
|
306
314
|
expect(bidResponses).to.have.lengthOf(1);
|
|
307
315
|
const response = bidResponses[0];
|
|
308
|
-
expect(response.requestId).to.equal(serverRequest.bidId);
|
|
309
|
-
expect(response.width).to.equal(serverRequest.width);
|
|
310
|
-
expect(response.height).to.equal(serverRequest.height);
|
|
311
|
-
expect(response.cpm).to.equal(serverResponse.body.price);
|
|
312
|
-
expect(response.currency).to.equal(serverResponse.body.currency);
|
|
313
|
-
expect(response.creativeId).to.equal(serverResponse.body.creativeId);
|
|
316
|
+
expect(response.requestId).to.equal(serverRequest.data.bids[0].bidId);
|
|
317
|
+
expect(response.width).to.equal(serverRequest.data.bids[0].width);
|
|
318
|
+
expect(response.height).to.equal(serverRequest.data.bids[0].height);
|
|
319
|
+
expect(response.cpm).to.equal(serverResponse.body.ads[0].price);
|
|
320
|
+
expect(response.currency).to.equal(serverResponse.body.ads[0].currency);
|
|
321
|
+
expect(response.creativeId).to.equal(serverResponse.body.ads[0].creativeId);
|
|
314
322
|
expect(response.vastXml).to.be.undefined;
|
|
315
323
|
expect(response.ad).to.include(`<div id="rop-prebid">`);
|
|
316
324
|
expect(response.ad).to.include(`<script src="https://relaido/player.js"></script>`);
|
|
@@ -370,8 +378,8 @@ describe('RelaidoAdapter', function () {
|
|
|
370
378
|
it('Should create nurl pixel if bid nurl', function () {
|
|
371
379
|
let bid = {
|
|
372
380
|
bidder: bidRequest.bidder,
|
|
373
|
-
creativeId: serverResponse.body.creativeId,
|
|
374
|
-
cpm: serverResponse.body.price,
|
|
381
|
+
creativeId: serverResponse.body.ads[0].creativeId,
|
|
382
|
+
cpm: serverResponse.body.ads[0].price,
|
|
375
383
|
params: [bidRequest.params],
|
|
376
384
|
auctionId: bidRequest.auctionId,
|
|
377
385
|
requestId: bidRequest.bidId,
|
|
@@ -905,7 +905,7 @@ describe('Richaudience adapter tests', function () {
|
|
|
905
905
|
}, [], {
|
|
906
906
|
consentString: null,
|
|
907
907
|
referer: 'http://domain.com',
|
|
908
|
-
gdprApplies:
|
|
908
|
+
gdprApplies: false
|
|
909
909
|
})
|
|
910
910
|
expect(syncs).to.have.lengthOf(1);
|
|
911
911
|
expect(syncs[0].type).to.equal('image');
|
|
@@ -942,7 +942,7 @@ describe('Richaudience adapter tests', function () {
|
|
|
942
942
|
}, [], {
|
|
943
943
|
consentString: null,
|
|
944
944
|
referer: 'http://domain.com',
|
|
945
|
-
gdprApplies:
|
|
945
|
+
gdprApplies: false
|
|
946
946
|
})
|
|
947
947
|
expect(syncs).to.have.lengthOf(0);
|
|
948
948
|
});
|
|
@@ -1408,7 +1408,7 @@ describe('the rubicon adapter', function () {
|
|
|
1408
1408
|
expect(data['tg_i.pbadslot']).to.equal('abc');
|
|
1409
1409
|
});
|
|
1410
1410
|
|
|
1411
|
-
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string
|
|
1411
|
+
it('should send \"tg_i.pbadslot\" if \"ortb2Imp.ext.data.pbadslot\" value is a valid string', function () {
|
|
1412
1412
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1413
1413
|
ext: {
|
|
1414
1414
|
data: {
|
|
@@ -1422,7 +1422,45 @@ describe('the rubicon adapter', function () {
|
|
|
1422
1422
|
|
|
1423
1423
|
expect(data).to.be.an('Object');
|
|
1424
1424
|
expect(data).to.have.property('tg_i.pbadslot');
|
|
1425
|
-
expect(data['tg_i.pbadslot']).to.equal('a/b/c');
|
|
1425
|
+
expect(data['tg_i.pbadslot']).to.equal('/a/b/c');
|
|
1426
|
+
});
|
|
1427
|
+
|
|
1428
|
+
it('should send gpid as p_gpid if valid', function () {
|
|
1429
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1430
|
+
ext: {
|
|
1431
|
+
gpid: '/1233/sports&div1'
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1436
|
+
const data = parseQuery(request.data);
|
|
1437
|
+
|
|
1438
|
+
expect(data).to.be.an('Object');
|
|
1439
|
+
expect(data).to.have.property('p_gpid');
|
|
1440
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1441
|
+
});
|
|
1442
|
+
|
|
1443
|
+
it('should send gpid and pbadslot since it is prefered over dfp code', function () {
|
|
1444
|
+
bidderRequest.bids[0].ortb2Imp = {
|
|
1445
|
+
ext: {
|
|
1446
|
+
gpid: '/1233/sports&div1',
|
|
1447
|
+
data: {
|
|
1448
|
+
pbadslot: 'pb_slot',
|
|
1449
|
+
adserver: {
|
|
1450
|
+
adslot: '/1234/sports',
|
|
1451
|
+
name: 'gam'
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
|
|
1458
|
+
const data = parseQuery(request.data);
|
|
1459
|
+
|
|
1460
|
+
expect(data).to.be.an('Object');
|
|
1461
|
+
expect(data['p_gpid']).to.equal('/1233/sports&div1');
|
|
1462
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1463
|
+
expect(data['tg_i.pbadslot']).to.equal('pb_slot');
|
|
1426
1464
|
});
|
|
1427
1465
|
});
|
|
1428
1466
|
|
|
@@ -1470,12 +1508,13 @@ describe('the rubicon adapter', function () {
|
|
|
1470
1508
|
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1471
1509
|
});
|
|
1472
1510
|
|
|
1473
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string', function () {
|
|
1511
|
+
it('should send NOT \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string but not gam', function () {
|
|
1474
1512
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1475
1513
|
ext: {
|
|
1476
1514
|
data: {
|
|
1477
1515
|
adserver: {
|
|
1478
|
-
adslot: '
|
|
1516
|
+
adslot: '/a/b/c',
|
|
1517
|
+
name: 'not gam'
|
|
1479
1518
|
}
|
|
1480
1519
|
}
|
|
1481
1520
|
}
|
|
@@ -1485,16 +1524,16 @@ describe('the rubicon adapter', function () {
|
|
|
1485
1524
|
const data = parseQuery(request.data);
|
|
1486
1525
|
|
|
1487
1526
|
expect(data).to.be.an('Object');
|
|
1488
|
-
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1489
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('abc');
|
|
1527
|
+
expect(data).to.not.have.property('tg_i.dfp_ad_unit_code');
|
|
1490
1528
|
});
|
|
1491
1529
|
|
|
1492
|
-
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string
|
|
1530
|
+
it('should send \"tg_i.dfp_ad_unit_code\" if \"ortb2Imp.ext.data.adServer.adslot\" value is a valid string and name is gam', function () {
|
|
1493
1531
|
bidderRequest.bids[0].ortb2Imp = {
|
|
1494
1532
|
ext: {
|
|
1495
1533
|
data: {
|
|
1496
1534
|
adserver: {
|
|
1497
|
-
|
|
1535
|
+
name: 'gam',
|
|
1536
|
+
adslot: '/a/b/c'
|
|
1498
1537
|
}
|
|
1499
1538
|
}
|
|
1500
1539
|
}
|
|
@@ -1505,7 +1544,7 @@ describe('the rubicon adapter', function () {
|
|
|
1505
1544
|
|
|
1506
1545
|
expect(data).to.be.an('Object');
|
|
1507
1546
|
expect(data).to.have.property('tg_i.dfp_ad_unit_code');
|
|
1508
|
-
expect(data['tg_i.dfp_ad_unit_code']).to.equal('a/b/c');
|
|
1547
|
+
expect(data['tg_i.dfp_ad_unit_code']).to.equal('/a/b/c');
|
|
1509
1548
|
});
|
|
1510
1549
|
});
|
|
1511
1550
|
});
|
|
@@ -3343,6 +3382,23 @@ describe('the rubicon adapter', function () {
|
|
|
3343
3382
|
type: 'iframe', url: `${emilyUrl}?gdpr_consent=foo&us_privacy=1NYN`
|
|
3344
3383
|
});
|
|
3345
3384
|
});
|
|
3385
|
+
|
|
3386
|
+
it('should pass gdprApplies', function () {
|
|
3387
|
+
expect(spec.getUserSyncs({iframeEnabled: true}, {}, {
|
|
3388
|
+
gdprApplies: true
|
|
3389
|
+
}, '1NYN')).to.deep.equal({
|
|
3390
|
+
type: 'iframe', url: `${emilyUrl}?gdpr=1&us_privacy=1NYN`
|
|
3391
|
+
});
|
|
3392
|
+
});
|
|
3393
|
+
|
|
3394
|
+
it('should pass all correctly', function () {
|
|
3395
|
+
expect(spec.getUserSyncs({iframeEnabled: true}, {}, {
|
|
3396
|
+
gdprApplies: true,
|
|
3397
|
+
consentString: 'foo'
|
|
3398
|
+
}, '1NYN')).to.deep.equal({
|
|
3399
|
+
type: 'iframe', url: `${emilyUrl}?gdpr=1&gdpr_consent=foo&us_privacy=1NYN`
|
|
3400
|
+
});
|
|
3401
|
+
});
|
|
3346
3402
|
});
|
|
3347
3403
|
|
|
3348
3404
|
describe('get price granularity', function () {
|
|
@@ -50,10 +50,10 @@ describe('SharedId System', function () {
|
|
|
50
50
|
expect(callbackSpy.calledOnce).to.be.true;
|
|
51
51
|
expect(callbackSpy.lastCall.lastArg).to.equal(UUID);
|
|
52
52
|
});
|
|
53
|
-
it('should
|
|
53
|
+
it('should abort if coppa is set', function () {
|
|
54
54
|
coppaDataHandlerDataStub.returns('true');
|
|
55
|
-
sharedIdSystemSubmodule.getId({});
|
|
56
|
-
expect(
|
|
55
|
+
const result = sharedIdSystemSubmodule.getId({});
|
|
56
|
+
expect(result).to.be.undefined;
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
describe('SharedId System extendId()', function () {
|
|
@@ -85,10 +85,56 @@ describe('SharedId System', function () {
|
|
|
85
85
|
let pubcommId = sharedIdSystemSubmodule.extendId(config, undefined, 'TestId').id;
|
|
86
86
|
expect(pubcommId).to.equal('TestId');
|
|
87
87
|
});
|
|
88
|
-
it('should
|
|
88
|
+
it('should abort if coppa is set', function () {
|
|
89
89
|
coppaDataHandlerDataStub.returns('true');
|
|
90
|
-
sharedIdSystemSubmodule.extendId({}, undefined, 'TestId');
|
|
91
|
-
expect(
|
|
90
|
+
const result = sharedIdSystemSubmodule.extendId({params: {extend: true}}, undefined, 'TestId');
|
|
91
|
+
expect(result).to.be.undefined;
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('SharedID System domainOverride', () => {
|
|
96
|
+
let sandbox, domain, cookies, rejectCookiesFor;
|
|
97
|
+
|
|
98
|
+
beforeEach(() => {
|
|
99
|
+
sandbox = sinon.createSandbox();
|
|
100
|
+
sandbox.stub(document, 'domain').get(() => domain);
|
|
101
|
+
cookies = {};
|
|
102
|
+
sandbox.stub(storage, 'getCookie').callsFake((key) => cookies[key]);
|
|
103
|
+
rejectCookiesFor = null;
|
|
104
|
+
sandbox.stub(storage, 'setCookie').callsFake((key, value, expires, sameSite, domain) => {
|
|
105
|
+
if (domain !== rejectCookiesFor) {
|
|
106
|
+
if (expires != null) {
|
|
107
|
+
expires = new Date(expires);
|
|
108
|
+
}
|
|
109
|
+
if (expires == null || expires > Date.now()) {
|
|
110
|
+
cookies[key] = value;
|
|
111
|
+
} else {
|
|
112
|
+
delete cookies[key];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
afterEach(() => {
|
|
119
|
+
sandbox.restore();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should return TLD if cookies can be set there', () => {
|
|
123
|
+
domain = 'sub.domain.com';
|
|
124
|
+
rejectCookiesFor = 'com';
|
|
125
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.equal('domain.com');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should return undefined when cookies cannot be set', () => {
|
|
129
|
+
domain = 'sub.domain.com';
|
|
130
|
+
rejectCookiesFor = 'sub.domain.com';
|
|
131
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.be.undefined;
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should return half-way domain if parent domain rejects cookies', () => {
|
|
135
|
+
domain = 'inner.outer.domain.com';
|
|
136
|
+
rejectCookiesFor = 'domain.com';
|
|
137
|
+
expect(sharedIdSystemSubmodule.domainOverride()).to.equal('outer.domain.com');
|
|
92
138
|
});
|
|
93
139
|
});
|
|
94
140
|
});
|
|
@@ -287,6 +287,23 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
287
287
|
expect(req.regs.ext.us_privacy).to.equal('uspConsentString');
|
|
288
288
|
});
|
|
289
289
|
|
|
290
|
+
it('sends no schain if no schain exists', () => {
|
|
291
|
+
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);
|
|
292
|
+
|
|
293
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
294
|
+
expect(req.source.ext.schain).to.not.exist;
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it('sends instl if instl exists', () => {
|
|
298
|
+
const instl = { instl: 1 };
|
|
299
|
+
const bidRequestWithInstl = Object.assign({}, singleBannerBidRequest, {ortb2Imp: instl});
|
|
300
|
+
|
|
301
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
302
|
+
|
|
303
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
304
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
305
|
+
});
|
|
306
|
+
|
|
290
307
|
it('sends tmax', () => {
|
|
291
308
|
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);
|
|
292
309
|
|
|
@@ -435,6 +452,16 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
435
452
|
expect(req.imp[0].bidfloor).to.be.equal(0.456);
|
|
436
453
|
});
|
|
437
454
|
|
|
455
|
+
it('sends instl if instl exists', () => {
|
|
456
|
+
const instl = { instl: 1 };
|
|
457
|
+
const bidRequestWithInstl = Object.assign({}, singleVideoBidRequest, {ortb2Imp: instl});
|
|
458
|
+
|
|
459
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
460
|
+
|
|
461
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
462
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
463
|
+
});
|
|
464
|
+
|
|
438
465
|
it('splits multi format bid requests', () => {
|
|
439
466
|
const combinedBannerAndVideoBidRequest = {
|
|
440
467
|
bidder: 'smaato',
|
|
@@ -516,6 +543,17 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
516
543
|
expect(req.imp[1].video.sequence).to.be.equal(2);
|
|
517
544
|
});
|
|
518
545
|
|
|
546
|
+
it('sends instl if instl exists', () => {
|
|
547
|
+
const instl = { instl: 1 };
|
|
548
|
+
const bidRequestWithInstl = Object.assign({}, longFormVideoBidRequest, {ortb2Imp: instl});
|
|
549
|
+
|
|
550
|
+
const reqs = spec.buildRequests([bidRequestWithInstl], defaultBidderRequest);
|
|
551
|
+
|
|
552
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
553
|
+
expect(req.imp[0].instl).to.equal(1);
|
|
554
|
+
expect(req.imp[1].instl).to.equal(1);
|
|
555
|
+
});
|
|
556
|
+
|
|
519
557
|
it('sends bidfloor when configured', () => {
|
|
520
558
|
const longFormVideoBidRequestWithFloor = Object.assign({}, longFormVideoBidRequest);
|
|
521
559
|
longFormVideoBidRequestWithFloor.getFloor = function(arg) {
|
|
@@ -854,6 +892,29 @@ describe('smaatoBidAdapterTest', () => {
|
|
|
854
892
|
expect(req.user.ext.eids).to.have.length(2);
|
|
855
893
|
});
|
|
856
894
|
});
|
|
895
|
+
|
|
896
|
+
describe('schain in request', () => {
|
|
897
|
+
it('schain is added to source.ext.schain', () => {
|
|
898
|
+
const schain = {
|
|
899
|
+
ver: '1.0',
|
|
900
|
+
complete: 1,
|
|
901
|
+
nodes: [
|
|
902
|
+
{
|
|
903
|
+
'asi': 'asi',
|
|
904
|
+
'sid': 'sid',
|
|
905
|
+
'rid': 'rid',
|
|
906
|
+
'hp': 1
|
|
907
|
+
}
|
|
908
|
+
]
|
|
909
|
+
};
|
|
910
|
+
const bidRequestWithSchain = Object.assign({}, singleBannerBidRequest, {schain: schain});
|
|
911
|
+
|
|
912
|
+
const reqs = spec.buildRequests([bidRequestWithSchain], defaultBidderRequest);
|
|
913
|
+
|
|
914
|
+
const req = extractPayloadOfFirstAndOnlyRequest(reqs);
|
|
915
|
+
expect(req.source.ext.schain).to.deep.equal(schain);
|
|
916
|
+
});
|
|
917
|
+
});
|
|
857
918
|
});
|
|
858
919
|
|
|
859
920
|
describe('interpretResponse', () => {
|
|
@@ -189,6 +189,14 @@ describe('The smartx adapter', function () {
|
|
|
189
189
|
domain: '',
|
|
190
190
|
publisher: {
|
|
191
191
|
id: '__name__'
|
|
192
|
+
},
|
|
193
|
+
content: {
|
|
194
|
+
ext: {
|
|
195
|
+
prebid: {
|
|
196
|
+
name: 'pbjs',
|
|
197
|
+
version: '$prebid.version$'
|
|
198
|
+
}
|
|
199
|
+
}
|
|
192
200
|
}
|
|
193
201
|
});
|
|
194
202
|
});
|
|
@@ -525,6 +533,7 @@ describe('The smartx adapter', function () {
|
|
|
525
533
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.title = 'abc';
|
|
526
534
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.skipOffset = 2;
|
|
527
535
|
bidderRequestObj.bidRequest.bids[0].params.outstream_options.desiredBitrate = 123;
|
|
536
|
+
bidderRequestObj.bidRequest.bids[0].params.outstream_options.visibilityThreshold = 30;
|
|
528
537
|
|
|
529
538
|
responses[0].renderer.render(responses[0]);
|
|
530
539
|
|
|
@@ -518,6 +518,33 @@ describe('SSPBC adapter', function () {
|
|
|
518
518
|
expect(payload.user).to.be.an('object').and.to.have.property('[ortb_extensions.consent]', bidRequest.gdprConsent.consentString);
|
|
519
519
|
});
|
|
520
520
|
|
|
521
|
+
it('should send net info and pvid', function () {
|
|
522
|
+
expect(payload.user).to.be.an('object').and.to.have.property('data').that.is.an('array');
|
|
523
|
+
|
|
524
|
+
const userData = payload.user.data;
|
|
525
|
+
expect(userData.length).to.equal(2);
|
|
526
|
+
|
|
527
|
+
const netInfo = userData[0];
|
|
528
|
+
expect(netInfo.id).to.equal('12');
|
|
529
|
+
expect(netInfo.name).to.equal('NetInfo');
|
|
530
|
+
expect(netInfo).to.have.property('segment').that.is.an('array');
|
|
531
|
+
|
|
532
|
+
const pvid = userData[1];
|
|
533
|
+
expect(pvid.id).to.equal('7');
|
|
534
|
+
expect(pvid.name).to.equal('pvid');
|
|
535
|
+
expect(pvid).to.have.property('segment').that.is.an('array');
|
|
536
|
+
expect(pvid.segment[0]).to.have.property('value');
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
it('pvid should be constant on a single page view', function () {
|
|
540
|
+
const userData1 = payload.user.data;
|
|
541
|
+
const userData2 = payloadNative.user.data;
|
|
542
|
+
const pvid1 = userData1[1];
|
|
543
|
+
const pvid2 = userData2[1];
|
|
544
|
+
|
|
545
|
+
expect(pvid1.segment[0].value).to.equal(pvid2.segment[0].value);
|
|
546
|
+
});
|
|
547
|
+
|
|
521
548
|
it('should build correct native payload', function () {
|
|
522
549
|
const nativeAssets = payloadNative.imp && payloadNative.imp[0].native.request;
|
|
523
550
|
|
|
@@ -543,13 +570,16 @@ describe('SSPBC adapter', function () {
|
|
|
543
570
|
expect(videoAssets).to.have.property('api').that.is.an('array');
|
|
544
571
|
});
|
|
545
572
|
|
|
546
|
-
it('should create auxilary placement identifier (size_numUsed)', function () {
|
|
573
|
+
it('should create auxilary placement identifier (size_numUsed), that is constant for a given adUnit', function () {
|
|
547
574
|
const extAssets1 = payload.imp && payload.imp[0].ext.data;
|
|
548
575
|
const extAssets2 = payloadSingle.imp && payloadSingle.imp[0].ext.data;
|
|
549
576
|
|
|
550
|
-
|
|
577
|
+
/*
|
|
578
|
+
note that payload comes from first, and payloadSingle from second auction in the test run
|
|
579
|
+
also, since both have same adUnitName, value of pbsize property should be the same
|
|
580
|
+
*/
|
|
551
581
|
expect(extAssets1).to.have.property('pbsize').that.equals('750x200_1')
|
|
552
|
-
expect(extAssets2).to.have.property('pbsize').that.equals('
|
|
582
|
+
expect(extAssets2).to.have.property('pbsize').that.equals('750x200_1')
|
|
553
583
|
});
|
|
554
584
|
});
|
|
555
585
|
|
|
@@ -183,6 +183,10 @@ describe('Tappx bid adapter', function () {
|
|
|
183
183
|
badBidRequest_v.bids.mediaTypes.video.playerSize = [320, 250];
|
|
184
184
|
assert.isFalse(spec.isBidRequestValid(badBidRequest_v.bids));
|
|
185
185
|
});
|
|
186
|
+
|
|
187
|
+
it('should export the TCF vendor ID', function () {
|
|
188
|
+
expect(spec.gvlid).to.equal(628);
|
|
189
|
+
})
|
|
186
190
|
});
|
|
187
191
|
|
|
188
192
|
/**
|