prebid.js 7.2.0 → 7.5.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/.circleci/config.yml +11 -6
- package/.github/dependabot.yml +6 -0
- package/.github/workflows/issue_tracker.yml +5 -0
- package/.github/workflows/release-drafter.yml +6 -0
- package/README.md +35 -0
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adkernelBidAdapter.js +1 -1
- package/dist/adotBidAdapter.js +1 -1
- package/dist/adpod.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/amxBidAdapter.js +1 -1
- package/dist/amxIdSystem.js +1 -1
- package/dist/appierAnalyticsAdapter.js +1 -1
- package/dist/appnexusBidAdapter.js +1 -1
- package/dist/asoBidAdapter.js +1 -1
- package/dist/audiencerunBidAdapter.js +1 -1
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bluebillywigBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/cpexIdSystem.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/debugging-standalone.js +1 -1
- package/dist/debugging.js +1 -1
- package/dist/dianomiBidAdapter.js +1 -0
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -0
- package/dist/fpdModule.js +1 -1
- package/dist/gdprEnforcement.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gridNMBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hadronIdSystem.js +1 -1
- package/dist/hadronRtdProvider.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/impactifyBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.js +1 -1
- package/dist/inmarBidAdapter.js +1 -1
- package/dist/insticatorBidAdapter.js +1 -1
- package/dist/ixBidAdapter.js +1 -1
- package/dist/jixieBidAdapter.js +1 -1
- package/dist/justpremiumBidAdapter.js +1 -1
- package/dist/kargoAnalyticsAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -0
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediakeysBidAdapter.js +1 -1
- package/dist/medianetBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/nativoBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +137 -131
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/openxOrtbBidAdapter.js +1 -0
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +2 -2
- package/dist/pubCommonId.js +1 -1
- package/dist/publinkIdSystem.js +1 -1
- package/dist/pubmaticBidAdapter.js +1 -1
- package/dist/pubwiseAnalyticsAdapter.js +1 -1
- package/dist/pxyzBidAdapter.js +1 -1
- package/dist/quantcastBidAdapter.js +1 -1
- package/dist/readpeakBidAdapter.js +1 -1
- package/dist/relaidoBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharedIdSystem.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -0
- package/dist/sizeMappingV2.js +1 -1
- package/dist/smaatoBidAdapter.js +1 -1
- package/dist/smartadserverBidAdapter.js +1 -1
- package/dist/smartxBidAdapter.js +1 -1
- package/dist/smilewantedBidAdapter.js +1 -1
- package/dist/sonobiBidAdapter.js +1 -1
- package/dist/sovrnAnalyticsAdapter.js +1 -1
- package/dist/sovrnBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/taboolaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/tncIdSystem.js +1 -0
- package/dist/trionBidAdapter.js +1 -1
- package/dist/tripleliftBidAdapter.js +1 -1
- package/dist/ttdBidAdapter.js +1 -1
- package/dist/ucfunnelAnalyticsAdapter.js +1 -1
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/ventesBidAdapter.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vrtcalBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/widespaceBidAdapter.js +1 -1
- package/dist/winrBidAdapter.js +1 -1
- package/dist/yahoosspBidAdapter.js +1 -1
- package/dist/yieldlabBidAdapter.js +1 -1
- package/dist/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/dist/yieldoneBidAdapter.js +1 -1
- package/governance.md +5 -11
- package/gulpHelpers.js +1 -1
- package/gulpfile.js +1 -1
- package/karma.conf.maker.js +3 -1
- package/modules/.submodules.json +1 -0
- package/modules/33acrossBidAdapter.js +5 -1
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/adotBidAdapter.js +3 -3
- package/modules/adqueryBidAdapter.js +5 -1
- package/modules/appnexusBidAdapter.js +3 -3
- package/modules/cpexIdSystem.js +7 -8
- package/modules/criteoBidAdapter.js +7 -1
- package/modules/cwireBidAdapter.md +1 -1
- package/modules/debugging/bidInterceptor.js +1 -1
- package/modules/debugging/index.js +2 -1
- package/modules/dianomiBidAdapter.js +369 -0
- package/modules/dianomiBidAdapter.md +73 -0
- package/modules/finativeBidAdapter.js +235 -0
- package/modules/finativeBidAdapter.md +45 -0
- package/modules/fpdModule/index.js +6 -5
- package/modules/gdprEnforcement.js +8 -14
- package/modules/gumgumBidAdapter.js +2 -0
- package/modules/gumgumBidAdapter.md +19 -1
- package/modules/hadronAnalyticsAdapter.md +5 -5
- package/modules/hadronIdSystem.js +18 -5
- package/modules/hadronIdSystem.md +15 -11
- package/modules/hadronRtdProvider.js +14 -1
- package/modules/hadronRtdProvider.md +17 -13
- package/modules/insticatorBidAdapter.js +9 -0
- package/modules/ixBidAdapter.js +457 -57
- package/modules/ixBidAdapter.md +95 -5
- package/modules/kargoAnalyticsAdapter.js +88 -6
- package/modules/kargoAnalyticsAdapter.md +33 -0
- package/modules/kargoBidAdapter.js +1 -2
- package/modules/lassoBidAdapter.js +133 -0
- package/modules/lassoBidAdapter.md +29 -0
- package/modules/medianetBidAdapter.js +9 -5
- package/modules/missenaBidAdapter.js +20 -2
- package/modules/nativoBidAdapter.js +19 -7
- package/modules/openxBidAdapter.md +3 -1
- package/modules/openxOrtbBidAdapter.js +349 -0
- package/modules/openxOrtbBidAdapter.md +105 -0
- package/modules/pubCommonId.js +1 -2
- package/modules/readpeakBidAdapter.js +15 -6
- package/modules/relaidoBidAdapter.js +19 -4
- package/modules/riseBidAdapter.js +1 -0
- package/modules/seedtagBidAdapter.js +33 -1
- package/modules/sharedIdSystem.js +11 -5
- package/modules/sharethroughBidAdapter.js +9 -24
- package/modules/shinezBidAdapter.js +435 -0
- package/modules/shinezBidAdapter.md +76 -0
- package/modules/sonobiBidAdapter.js +28 -9
- package/modules/sovrnBidAdapter.js +16 -10
- package/modules/taboolaBidAdapter.js +1 -1
- package/modules/taboolaBidAdapter.md +3 -3
- package/modules/tncIdSystem.js +63 -0
- package/modules/tncIdSystem.md +33 -0
- package/modules/userId/eids.js +12 -0
- package/modules/userId/eids.md +7 -0
- package/modules/userId/userId.md +17 -0
- package/modules/ventesBidAdapter.js +1 -1
- package/modules/ventesBidAdapter.md +1 -1
- package/modules/vrtcalBidAdapter.js +35 -0
- package/modules/yieldlabBidAdapter.js +4 -0
- package/modules/yieldmoBidAdapter.js +20 -2
- package/modules/yieldoneBidAdapter.js +12 -1
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +2 -1
- package/src/adloader.js +1 -0
- package/src/prebid.js +4 -1
- package/src/storageManager.js +4 -5
- package/test/spec/modules/33acrossBidAdapter_spec.js +39 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +165 -156
- package/test/spec/modules/cpexIdSystem_spec.js +5 -5
- package/test/spec/modules/criteoBidAdapter_spec.js +15 -5
- package/test/spec/modules/debugging_mod_spec.js +7 -0
- package/test/spec/modules/dianomiBidAdapter_spec.js +1223 -0
- package/test/spec/modules/eids_spec.js +26 -1
- package/test/spec/modules/finativeBidAdapter_spec.js +186 -0
- package/test/spec/modules/fpdModule_spec.js +28 -1
- package/test/spec/modules/gdprEnforcement_spec.js +53 -100
- package/test/spec/modules/gumgumBidAdapter_spec.js +5 -0
- package/test/spec/modules/hadronIdSystem_spec.js +2 -2
- package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
- package/test/spec/modules/ixBidAdapter_spec.js +429 -10
- package/test/spec/modules/kargoAnalyticsAdapter_spec.js +42 -0
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
- package/test/spec/modules/lassoBidAdapter_spec.js +177 -0
- package/test/spec/modules/medianetBidAdapter_spec.js +24 -1
- package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
- package/test/spec/modules/nativoBidAdapter_spec.js +67 -17
- package/test/spec/modules/openxOrtbBidAdapter_spec.js +1303 -0
- package/test/spec/modules/readpeakBidAdapter_spec.js +1 -0
- package/test/spec/modules/relaidoBidAdapter_spec.js +29 -2
- package/test/spec/modules/riseBidAdapter_spec.js +3 -0
- package/test/spec/modules/seedtagBidAdapter_spec.js +4 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +4 -4
- package/test/spec/modules/shinezBidAdapter_spec.js +479 -0
- package/test/spec/modules/sonobiBidAdapter_spec.js +38 -23
- package/test/spec/modules/sovrnBidAdapter_spec.js +39 -5
- package/test/spec/modules/taboolaBidAdapter_spec.js +1 -1
- package/test/spec/modules/tncIdSystem_spec.js +109 -0
- package/test/spec/modules/userId_spec.js +6 -3
- package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
- package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -0
- package/test/spec/modules/yieldlabBidAdapter_spec.js +4 -0
- package/test/spec/modules/yieldmoBidAdapter_spec.js +15 -2
- package/test/spec/modules/yieldoneBidAdapter_spec.js +43 -2
- package/test/spec/unit/pbjs_api_spec.js +23 -0
- package/webpack.conf.js +1 -1
|
@@ -528,6 +528,7 @@ describe('ReadPeakAdapter', function() {
|
|
|
528
528
|
ad: bannerServerResponse.seatbid[0].bid[0].adm,
|
|
529
529
|
width: bannerServerResponse.seatbid[0].bid[0].w,
|
|
530
530
|
height: bannerServerResponse.seatbid[0].bid[0].h,
|
|
531
|
+
burl: bannerServerResponse.seatbid[0].bid[0].burl,
|
|
531
532
|
});
|
|
532
533
|
expect(bidResponse.meta).to.deep.equal({
|
|
533
534
|
advertiserDomains: ['readpeak.com'],
|
|
@@ -81,8 +81,8 @@ describe('RelaidoAdapter', function () {
|
|
|
81
81
|
data: {
|
|
82
82
|
bids: [{
|
|
83
83
|
bidId: bidRequest.bidId,
|
|
84
|
-
width: bidRequest.mediaTypes.video.playerSize[0][0],
|
|
85
|
-
height: bidRequest.mediaTypes.video.playerSize[0][1],
|
|
84
|
+
width: bidRequest.mediaTypes.video.playerSize[0][0] || bidRequest.mediaTypes.video.playerSize[0],
|
|
85
|
+
height: bidRequest.mediaTypes.video.playerSize[0][1] || bidRequest.mediaTypes.video.playerSize[1],
|
|
86
86
|
mediaType: 'video'}]
|
|
87
87
|
}
|
|
88
88
|
};
|
|
@@ -98,6 +98,33 @@ describe('RelaidoAdapter', function () {
|
|
|
98
98
|
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
+
it('should return true when not existed mediaTypes.video.playerSize and existed valid params.video.playerSize by video', function () {
|
|
102
|
+
bidRequest.mediaTypes = {
|
|
103
|
+
video: {
|
|
104
|
+
context: 'outstream'
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
bidRequest.params = {
|
|
108
|
+
placementId: '100000',
|
|
109
|
+
video: {
|
|
110
|
+
playerSize: [
|
|
111
|
+
[640, 360]
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it('should return even true when the playerSize is Array[Number, Number] by video', function () {
|
|
119
|
+
bidRequest.mediaTypes = {
|
|
120
|
+
video: {
|
|
121
|
+
context: 'outstream',
|
|
122
|
+
playerSize: [640, 360]
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
expect(spec.isBidRequestValid(bidRequest)).to.equal(true);
|
|
126
|
+
});
|
|
127
|
+
|
|
101
128
|
it('should return true when the required params are passed by banner', function () {
|
|
102
129
|
setUAMobile();
|
|
103
130
|
bidRequest.mediaTypes = {
|
|
@@ -53,6 +53,7 @@ describe('riseAdapter', function () {
|
|
|
53
53
|
'org': 'jdye8weeyirk00000001'
|
|
54
54
|
},
|
|
55
55
|
'bidId': '299ffc8cca0b87',
|
|
56
|
+
'loop': 1,
|
|
56
57
|
'bidderRequestId': '1144f487e563f9',
|
|
57
58
|
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
58
59
|
'mediaTypes': {
|
|
@@ -71,6 +72,7 @@ describe('riseAdapter', function () {
|
|
|
71
72
|
'org': 'jdye8weeyirk00000001'
|
|
72
73
|
},
|
|
73
74
|
'bidId': '299ffc8cca0b87',
|
|
75
|
+
'loop': 1,
|
|
74
76
|
'bidderRequestId': '1144f487e563f9',
|
|
75
77
|
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
76
78
|
'mediaTypes': {
|
|
@@ -91,6 +93,7 @@ describe('riseAdapter', function () {
|
|
|
91
93
|
'testMode': true
|
|
92
94
|
},
|
|
93
95
|
'bidId': '299ffc8cca0b87',
|
|
96
|
+
'loop': 2,
|
|
94
97
|
'bidderRequestId': '1144f487e563f9',
|
|
95
98
|
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
96
99
|
}
|
|
@@ -223,6 +223,7 @@ describe('Seedtag Adapter', function () {
|
|
|
223
223
|
});
|
|
224
224
|
|
|
225
225
|
it('Common data request should be correct', function () {
|
|
226
|
+
const now = Date.now();
|
|
226
227
|
const request = spec.buildRequests(validBidRequests, bidderRequest);
|
|
227
228
|
const data = JSON.parse(request.data);
|
|
228
229
|
expect(data.url).to.equal('referer');
|
|
@@ -231,6 +232,9 @@ describe('Seedtag Adapter', function () {
|
|
|
231
232
|
expect(
|
|
232
233
|
['fixed', 'mobile', 'unknown'].indexOf(data.connectionType)
|
|
233
234
|
).to.be.above(-1);
|
|
235
|
+
expect(data.auctionStart).to.be.greaterThanOrEqual(now);
|
|
236
|
+
expect(data.ttfb).to.be.greaterThanOrEqual(0);
|
|
237
|
+
|
|
234
238
|
expect(data.bidRequests[0].adUnitCode).to.equal('adunit-code');
|
|
235
239
|
});
|
|
236
240
|
|
|
@@ -601,11 +601,11 @@ describe('sharethrough adapter spec', function () {
|
|
|
601
601
|
const serverResponses = [{ body: { cookieSyncUrls: cookieSyncs } }];
|
|
602
602
|
|
|
603
603
|
it('returns an array of correctly formatted user syncs', function () {
|
|
604
|
-
const syncArray = spec.getUserSyncs({ pixelEnabled: true }, serverResponses
|
|
604
|
+
const syncArray = spec.getUserSyncs({ pixelEnabled: true }, serverResponses);
|
|
605
605
|
expect(syncArray).to.deep.equal([
|
|
606
|
-
{ type: 'image', url: 'cookieUrl1
|
|
607
|
-
{ type: 'image', url: 'cookieUrl2
|
|
608
|
-
{ type: 'image', url: 'cookieUrl3
|
|
606
|
+
{ type: 'image', url: 'cookieUrl1' },
|
|
607
|
+
{ type: 'image', url: 'cookieUrl2' },
|
|
608
|
+
{ type: 'image', url: 'cookieUrl3' }],
|
|
609
609
|
);
|
|
610
610
|
});
|
|
611
611
|
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from 'modules/shinezBidAdapter.js';
|
|
3
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
4
|
+
import { config } from 'src/config.js';
|
|
5
|
+
import { BANNER, VIDEO } from '../../../src/mediaTypes.js';
|
|
6
|
+
import * as utils from 'src/utils.js';
|
|
7
|
+
|
|
8
|
+
const ENDPOINT = 'https://hb.sweetgum.io/hb-sz-multi';
|
|
9
|
+
const TEST_ENDPOINT = 'https://hb.sweetgum.io/hb-multi-sz-test';
|
|
10
|
+
const TTL = 360;
|
|
11
|
+
/* eslint no-console: ["error", { allow: ["log", "warn", "error"] }] */
|
|
12
|
+
|
|
13
|
+
describe('shinezAdapter', function () {
|
|
14
|
+
const adapter = newBidder(spec);
|
|
15
|
+
|
|
16
|
+
describe('inherited functions', function () {
|
|
17
|
+
it('exists and is a function', function () {
|
|
18
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('isBidRequestValid', function () {
|
|
23
|
+
const bid = {
|
|
24
|
+
'bidder': spec.code,
|
|
25
|
+
'adUnitCode': 'adunit-code',
|
|
26
|
+
'sizes': [['640', '480']],
|
|
27
|
+
'params': {
|
|
28
|
+
'org': 'jdye8weeyirk00000001'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('should return true when required params are passed', function () {
|
|
33
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should return false when required params are not found', function () {
|
|
37
|
+
const newBid = Object.assign({}, bid);
|
|
38
|
+
delete newBid.params;
|
|
39
|
+
newBid.params = {
|
|
40
|
+
'org': null
|
|
41
|
+
};
|
|
42
|
+
expect(spec.isBidRequestValid(newBid)).to.equal(false);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('buildRequests', function () {
|
|
47
|
+
const bidRequests = [
|
|
48
|
+
{
|
|
49
|
+
'bidder': spec.code,
|
|
50
|
+
'adUnitCode': 'adunit-code',
|
|
51
|
+
'sizes': [[640, 480]],
|
|
52
|
+
'params': {
|
|
53
|
+
'org': 'jdye8weeyirk00000001'
|
|
54
|
+
},
|
|
55
|
+
'bidId': '299ffc8cca0b87',
|
|
56
|
+
'bidderRequestId': '1144f487e563f9',
|
|
57
|
+
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
58
|
+
'mediaTypes': {
|
|
59
|
+
'video': {
|
|
60
|
+
'playerSize': [[640, 480]],
|
|
61
|
+
'context': 'instream'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
'bidder': spec.code,
|
|
68
|
+
'adUnitCode': 'adunit-code',
|
|
69
|
+
'sizes': [[300, 250]],
|
|
70
|
+
'params': {
|
|
71
|
+
'org': 'jdye8weeyirk00000001'
|
|
72
|
+
},
|
|
73
|
+
'bidId': '299ffc8cca0b87',
|
|
74
|
+
'bidderRequestId': '1144f487e563f9',
|
|
75
|
+
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
76
|
+
'mediaTypes': {
|
|
77
|
+
'banner': {
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
'ad': '"<img src=\"https://...\"/>"'
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
const testModeBidRequests = [
|
|
85
|
+
{
|
|
86
|
+
'bidder': spec.code,
|
|
87
|
+
'adUnitCode': 'adunit-code',
|
|
88
|
+
'sizes': [[640, 480]],
|
|
89
|
+
'params': {
|
|
90
|
+
'org': 'jdye8weeyirk00000001',
|
|
91
|
+
'testMode': true
|
|
92
|
+
},
|
|
93
|
+
'bidId': '299ffc8cca0b87',
|
|
94
|
+
'bidderRequestId': '1144f487e563f9',
|
|
95
|
+
'auctionId': 'bfc420c3-8577-4568-9766-a8a935fb620d',
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
|
|
99
|
+
const bidderRequest = {
|
|
100
|
+
bidderCode: 'shinez',
|
|
101
|
+
}
|
|
102
|
+
const placementId = '12345678';
|
|
103
|
+
|
|
104
|
+
it('sends the placementId to ENDPOINT via POST', function () {
|
|
105
|
+
bidRequests[0].params.placementId = placementId;
|
|
106
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
107
|
+
expect(request.data.bids[0].placementId).to.equal(placementId);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('sends bid request to ENDPOINT via POST', function () {
|
|
111
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
112
|
+
expect(request.url).to.equal(ENDPOINT);
|
|
113
|
+
expect(request.method).to.equal('POST');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('sends bid request to TEST ENDPOINT via POST', function () {
|
|
117
|
+
const request = spec.buildRequests(testModeBidRequests, bidderRequest);
|
|
118
|
+
expect(request.url).to.equal(TEST_ENDPOINT);
|
|
119
|
+
expect(request.method).to.equal('POST');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should send the correct bid Id', function () {
|
|
123
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
124
|
+
expect(request.data.bids[0].bidId).to.equal('299ffc8cca0b87');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('should send the correct sizes array', function () {
|
|
128
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
129
|
+
expect(request.data.bids[0].sizes).to.be.an('array');
|
|
130
|
+
expect(request.data.bids[0].sizes).to.equal(bidRequests[0].sizes)
|
|
131
|
+
expect(request.data.bids[1].sizes).to.be.an('array');
|
|
132
|
+
expect(request.data.bids[1].sizes).to.equal(bidRequests[1].sizes)
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should send the correct media type', function () {
|
|
136
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
137
|
+
expect(request.data.bids[0].mediaType).to.equal(VIDEO)
|
|
138
|
+
expect(request.data.bids[1].mediaType).to.equal(BANNER)
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should respect syncEnabled option', function() {
|
|
142
|
+
config.setConfig({
|
|
143
|
+
userSync: {
|
|
144
|
+
syncEnabled: false,
|
|
145
|
+
filterSettings: {
|
|
146
|
+
all: {
|
|
147
|
+
bidders: '*',
|
|
148
|
+
filter: 'include'
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
154
|
+
expect(request.data.params).to.be.an('object');
|
|
155
|
+
expect(request.data.params).to.not.have.property('cs_method');
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('should respect "iframe" filter settings', function () {
|
|
159
|
+
config.setConfig({
|
|
160
|
+
userSync: {
|
|
161
|
+
syncEnabled: true,
|
|
162
|
+
filterSettings: {
|
|
163
|
+
iframe: {
|
|
164
|
+
bidders: [spec.code],
|
|
165
|
+
filter: 'include'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
171
|
+
expect(request.data.params).to.be.an('object');
|
|
172
|
+
expect(request.data.params).to.have.property('cs_method', 'iframe');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('should respect "all" filter settings', function () {
|
|
176
|
+
config.setConfig({
|
|
177
|
+
userSync: {
|
|
178
|
+
syncEnabled: true,
|
|
179
|
+
filterSettings: {
|
|
180
|
+
all: {
|
|
181
|
+
bidders: [spec.code],
|
|
182
|
+
filter: 'include'
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
188
|
+
expect(request.data.params).to.be.an('object');
|
|
189
|
+
expect(request.data.params).to.have.property('cs_method', 'iframe');
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('should send the pixel user sync param if userSync is enabled and no "iframe" or "all" configs are present', function () {
|
|
193
|
+
config.resetConfig();
|
|
194
|
+
config.setConfig({
|
|
195
|
+
userSync: {
|
|
196
|
+
syncEnabled: true,
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
200
|
+
expect(request.data.params).to.be.an('object');
|
|
201
|
+
expect(request.data.params).to.have.property('cs_method', 'pixel');
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it('should respect total exclusion', function() {
|
|
205
|
+
config.setConfig({
|
|
206
|
+
userSync: {
|
|
207
|
+
syncEnabled: true,
|
|
208
|
+
filterSettings: {
|
|
209
|
+
image: {
|
|
210
|
+
bidders: [spec.code],
|
|
211
|
+
filter: 'exclude'
|
|
212
|
+
},
|
|
213
|
+
iframe: {
|
|
214
|
+
bidders: [spec.code],
|
|
215
|
+
filter: 'exclude'
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
221
|
+
expect(request.data.params).to.be.an('object');
|
|
222
|
+
expect(request.data.params).to.not.have.property('cs_method');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should have us_privacy param if usPrivacy is available in the bidRequest', function () {
|
|
226
|
+
const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest);
|
|
227
|
+
const request = spec.buildRequests(bidRequests, bidderRequestWithUSP);
|
|
228
|
+
expect(request.data.params).to.be.an('object');
|
|
229
|
+
expect(request.data.params).to.have.property('us_privacy', '1YNN');
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
it('should have an empty us_privacy param if usPrivacy is missing in the bidRequest', function () {
|
|
233
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
234
|
+
expect(request.data.params).to.be.an('object');
|
|
235
|
+
expect(request.data.params).to.not.have.property('us_privacy');
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
it('should not send the gdpr param if gdprApplies is false in the bidRequest', function () {
|
|
239
|
+
const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: false}}, bidderRequest);
|
|
240
|
+
const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
|
|
241
|
+
expect(request.data.params).to.be.an('object');
|
|
242
|
+
expect(request.data.params).to.not.have.property('gdpr');
|
|
243
|
+
expect(request.data.params).to.not.have.property('gdpr_consent');
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('should send the gdpr param if gdprApplies is true in the bidRequest', function () {
|
|
247
|
+
const bidderRequestWithGDPR = Object.assign({gdprConsent: {gdprApplies: true, consentString: 'test-consent-string'}}, bidderRequest);
|
|
248
|
+
const request = spec.buildRequests(bidRequests, bidderRequestWithGDPR);
|
|
249
|
+
expect(request.data.params).to.be.an('object');
|
|
250
|
+
expect(request.data.params).to.have.property('gdpr', true);
|
|
251
|
+
expect(request.data.params).to.have.property('gdpr_consent', 'test-consent-string');
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
it('should have schain param if it is available in the bidRequest', () => {
|
|
255
|
+
const schain = {
|
|
256
|
+
ver: '1.0',
|
|
257
|
+
complete: 1,
|
|
258
|
+
nodes: [{ asi: 'indirectseller.com', sid: '00001', hp: 1 }],
|
|
259
|
+
};
|
|
260
|
+
bidRequests[0].schain = schain;
|
|
261
|
+
const request = spec.buildRequests(bidRequests, bidderRequest);
|
|
262
|
+
expect(request.data.params).to.be.an('object');
|
|
263
|
+
expect(request.data.params).to.have.property('schain', '1.0,1!indirectseller.com,00001,1,,,');
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
it('should set flooPrice to getFloor.floor value if it is greater than params.floorPrice', function() {
|
|
267
|
+
const bid = utils.deepClone(bidRequests[0]);
|
|
268
|
+
bid.getFloor = () => {
|
|
269
|
+
return {
|
|
270
|
+
currency: 'USD',
|
|
271
|
+
floor: 3.32
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
bid.params.floorPrice = 0.64;
|
|
275
|
+
const request = spec.buildRequests([bid], bidderRequest);
|
|
276
|
+
expect(request.data.bids[0]).to.be.an('object');
|
|
277
|
+
expect(request.data.bids[0]).to.have.property('floorPrice', 3.32);
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
it('should set floorPrice to params.floorPrice value if it is greater than getFloor.floor', function() {
|
|
281
|
+
const bid = utils.deepClone(bidRequests[0]);
|
|
282
|
+
bid.getFloor = () => {
|
|
283
|
+
return {
|
|
284
|
+
currency: 'USD',
|
|
285
|
+
floor: 0.8
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
bid.params.floorPrice = 1.5;
|
|
289
|
+
const request = spec.buildRequests([bid], bidderRequest);
|
|
290
|
+
expect(request.data.bids[0]).to.be.an('object');
|
|
291
|
+
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
describe('interpretResponse', function () {
|
|
296
|
+
const response = {
|
|
297
|
+
params: {
|
|
298
|
+
currency: 'USD',
|
|
299
|
+
netRevenue: true,
|
|
300
|
+
},
|
|
301
|
+
bids: [{
|
|
302
|
+
cpm: 12.5,
|
|
303
|
+
vastXml: '<VAST version="3.0"></VAST>',
|
|
304
|
+
width: 640,
|
|
305
|
+
height: 480,
|
|
306
|
+
requestId: '21e12606d47ba7',
|
|
307
|
+
adomain: ['abc.com'],
|
|
308
|
+
mediaType: VIDEO
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
cpm: 12.5,
|
|
312
|
+
ad: '"<img src=\"https://...\"/>"',
|
|
313
|
+
width: 300,
|
|
314
|
+
height: 250,
|
|
315
|
+
requestId: '21e12606d47ba7',
|
|
316
|
+
adomain: ['abc.com'],
|
|
317
|
+
mediaType: BANNER
|
|
318
|
+
}]
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
const expectedVideoResponse = {
|
|
322
|
+
requestId: '21e12606d47ba7',
|
|
323
|
+
cpm: 12.5,
|
|
324
|
+
currency: 'USD',
|
|
325
|
+
width: 640,
|
|
326
|
+
height: 480,
|
|
327
|
+
ttl: TTL,
|
|
328
|
+
creativeId: '21e12606d47ba7',
|
|
329
|
+
netRevenue: true,
|
|
330
|
+
nurl: 'http://example.com/win/1234',
|
|
331
|
+
mediaType: VIDEO,
|
|
332
|
+
meta: {
|
|
333
|
+
mediaType: VIDEO,
|
|
334
|
+
advertiserDomains: ['abc.com']
|
|
335
|
+
},
|
|
336
|
+
vastXml: '<VAST version="3.0"></VAST>',
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const expectedBannerResponse = {
|
|
340
|
+
requestId: '21e12606d47ba7',
|
|
341
|
+
cpm: 12.5,
|
|
342
|
+
currency: 'USD',
|
|
343
|
+
width: 640,
|
|
344
|
+
height: 480,
|
|
345
|
+
ttl: TTL,
|
|
346
|
+
creativeId: '21e12606d47ba7',
|
|
347
|
+
netRevenue: true,
|
|
348
|
+
nurl: 'http://example.com/win/1234',
|
|
349
|
+
mediaType: BANNER,
|
|
350
|
+
meta: {
|
|
351
|
+
mediaType: BANNER,
|
|
352
|
+
advertiserDomains: ['abc.com']
|
|
353
|
+
},
|
|
354
|
+
ad: '"<img src=\"https://...\"/>"'
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
it('should get correct bid response', function () {
|
|
358
|
+
const result = spec.interpretResponse({ body: response });
|
|
359
|
+
expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedVideoResponse));
|
|
360
|
+
expect(Object.keys(result[1])).to.deep.equal(Object.keys(expectedBannerResponse));
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
it('video type should have vastXml key', function () {
|
|
364
|
+
const result = spec.interpretResponse({ body: response });
|
|
365
|
+
expect(result[0].vastXml).to.equal(expectedVideoResponse.vastXml)
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it('banner type should have ad key', function () {
|
|
369
|
+
const result = spec.interpretResponse({ body: response });
|
|
370
|
+
expect(result[1].ad).to.equal(expectedBannerResponse.ad)
|
|
371
|
+
});
|
|
372
|
+
})
|
|
373
|
+
|
|
374
|
+
describe('getUserSyncs', function() {
|
|
375
|
+
const imageSyncResponse = {
|
|
376
|
+
body: {
|
|
377
|
+
params: {
|
|
378
|
+
userSyncPixels: [
|
|
379
|
+
'https://image-sync-url.test/1',
|
|
380
|
+
'https://image-sync-url.test/2',
|
|
381
|
+
'https://image-sync-url.test/3'
|
|
382
|
+
]
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
const iframeSyncResponse = {
|
|
388
|
+
body: {
|
|
389
|
+
params: {
|
|
390
|
+
userSyncURL: 'https://iframe-sync-url.test'
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
it('should register all img urls from the response', function() {
|
|
396
|
+
const syncs = spec.getUserSyncs({ pixelEnabled: true }, [imageSyncResponse]);
|
|
397
|
+
expect(syncs).to.deep.equal([
|
|
398
|
+
{
|
|
399
|
+
type: 'image',
|
|
400
|
+
url: 'https://image-sync-url.test/1'
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
type: 'image',
|
|
404
|
+
url: 'https://image-sync-url.test/2'
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
type: 'image',
|
|
408
|
+
url: 'https://image-sync-url.test/3'
|
|
409
|
+
}
|
|
410
|
+
]);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it('should register the iframe url from the response', function() {
|
|
414
|
+
const syncs = spec.getUserSyncs({ iframeEnabled: true }, [iframeSyncResponse]);
|
|
415
|
+
expect(syncs).to.deep.equal([
|
|
416
|
+
{
|
|
417
|
+
type: 'iframe',
|
|
418
|
+
url: 'https://iframe-sync-url.test'
|
|
419
|
+
}
|
|
420
|
+
]);
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
it('should register both image and iframe urls from the responses', function() {
|
|
424
|
+
const syncs = spec.getUserSyncs({ pixelEnabled: true, iframeEnabled: true }, [iframeSyncResponse, imageSyncResponse]);
|
|
425
|
+
expect(syncs).to.deep.equal([
|
|
426
|
+
{
|
|
427
|
+
type: 'iframe',
|
|
428
|
+
url: 'https://iframe-sync-url.test'
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
type: 'image',
|
|
432
|
+
url: 'https://image-sync-url.test/1'
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
type: 'image',
|
|
436
|
+
url: 'https://image-sync-url.test/2'
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
type: 'image',
|
|
440
|
+
url: 'https://image-sync-url.test/3'
|
|
441
|
+
}
|
|
442
|
+
]);
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
it('should handle an empty response', function() {
|
|
446
|
+
const syncs = spec.getUserSyncs({ iframeEnabled: true }, []);
|
|
447
|
+
expect(syncs).to.deep.equal([]);
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
it('should handle when user syncs are disabled', function() {
|
|
451
|
+
const syncs = spec.getUserSyncs({ pixelEnabled: false }, [imageSyncResponse]);
|
|
452
|
+
expect(syncs).to.deep.equal([]);
|
|
453
|
+
});
|
|
454
|
+
})
|
|
455
|
+
|
|
456
|
+
describe('onBidWon', function() {
|
|
457
|
+
beforeEach(function() {
|
|
458
|
+
sinon.stub(utils, 'triggerPixel');
|
|
459
|
+
});
|
|
460
|
+
afterEach(function() {
|
|
461
|
+
utils.triggerPixel.restore();
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
it('Should trigger pixel if bid nurl', function() {
|
|
465
|
+
const bid = {
|
|
466
|
+
'bidder': spec.code,
|
|
467
|
+
'adUnitCode': 'adunit-code',
|
|
468
|
+
'sizes': [['640', '480']],
|
|
469
|
+
'nurl': 'http://example.com/win/1234',
|
|
470
|
+
'params': {
|
|
471
|
+
'org': 'jdye8weeyirk00000001'
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
spec.onBidWon(bid);
|
|
476
|
+
expect(utils.triggerPixel.callCount).to.equal(1)
|
|
477
|
+
})
|
|
478
|
+
})
|
|
479
|
+
});
|