prebid.js 7.52.0 → 7.53.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/dist/1plusXRtdProvider.js +1 -1
- package/dist/33acrossBidAdapter.js +1 -1
- package/dist/33acrossIdSystem.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/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/airgridRtdProvider.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/axonixBidAdapter.js +1 -1
- package/dist/beopBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridgewellBidAdapter.js +1 -1
- package/dist/brightMountainMediaBidAdapter.js +1 -1
- package/dist/carodaBidAdapter.js +1 -1
- package/dist/chtnwBidAdapter.js +1 -1
- package/dist/conceptxBidAdapter.js +1 -0
- package/dist/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantAnalyticsAdapter.js +1 -1
- package/dist/conversantBidAdapter.js +1 -1
- package/dist/craftBidAdapter.js +1 -1
- package/dist/criteoBidAdapter.js +1 -1
- package/dist/cwireBidAdapter.js +1 -1
- package/dist/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/eskimiBidAdapter.js +1 -1
- package/dist/euidIdSystem.js +1 -0
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassIdSystem.js +1 -0
- package/dist/freewheel-sspBidAdapter.js +1 -1
- package/dist/glimpseBidAdapter.js +1 -1
- package/dist/gmosspBidAdapter.js +1 -1
- package/dist/goldbachBidAdapter.js +1 -1
- package/dist/greenbidsAnalyticsAdapter.js +1 -1
- package/dist/greenbidsRtdProvider.js +1 -1
- package/dist/gridBidAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/id5IdSystem.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/justpremiumBidAdapter.js +1 -1
- package/dist/kargoBidAdapter.js +1 -1
- package/dist/konduitAnalyticsAdapter.js +1 -1
- package/dist/kueezBidAdapter.js +1 -1
- package/dist/kueezRtbBidAdapter.js +1 -1
- package/dist/kulturemediaBidAdapter.js +1 -1
- package/dist/lassoBidAdapter.js +1 -1
- package/dist/lifestreetBidAdapter.js +1 -1
- package/dist/limelightDigitalBidAdapter.js +1 -1
- package/dist/liveyieldAnalyticsAdapter.js +1 -1
- package/dist/logicadBidAdapter.js +1 -1
- package/dist/loglyliftBidAdapter.js +1 -1
- package/dist/magniteAnalyticsAdapter.js +1 -1
- package/dist/malltvAnalyticsAdapter.js +1 -1
- package/dist/marsmediaBidAdapter.js +1 -1
- package/dist/mediafuseBidAdapter.js +1 -1
- package/dist/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/minutemediaplusBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +146 -142
- package/dist/oguryBidAdapter.js +1 -1
- package/dist/onetagBidAdapter.js +1 -1
- package/dist/ooloAnalyticsAdapter.js +1 -1
- package/dist/optidigitalBidAdapter.js +1 -1
- package/dist/outbrainBidAdapter.js +1 -1
- package/dist/pairIdSystem.js +1 -1
- package/dist/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/proxistoreBidAdapter.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/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/richaudienceBidAdapter.js +1 -1
- package/dist/riseBidAdapter.js +1 -1
- package/dist/rubiconAnalyticsAdapter.js +1 -1
- package/dist/rubiconBidAdapter.js +1 -1
- package/dist/schain.js +1 -1
- package/dist/seedingAllianceBidAdapter.js +1 -1
- package/dist/seedtagBidAdapter.js +1 -1
- package/dist/sharethroughAnalyticsAdapter.js +1 -1
- package/dist/sharethroughBidAdapter.js +1 -1
- package/dist/shinezBidAdapter.js +1 -1
- package/dist/sirdataRtdProvider.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/stroeerCoreBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/synacormediaBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- 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/uid2IdSystem.js +1 -1
- package/dist/uid2IdSystem_shared.js +1 -0
- package/dist/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/userId.js +1 -1
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/viouslyBidAdapter.js +1 -1
- package/dist/visxBidAdapter.js +1 -1
- package/dist/vuukleBidAdapter.js +1 -1
- package/dist/weboramaRtdProvider.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/zeta_global_sspBidAdapter.js +1 -1
- package/integrationExamples/gpt/userId_example.html +20 -6
- package/modules/.submodules.json +3 -1
- package/modules/1plusXRtdProvider.js +31 -60
- package/modules/adagioBidAdapter.js +86 -24
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/airgridRtdProvider.js +11 -12
- package/modules/asoBidAdapter.js +2 -1
- package/modules/beopBidAdapter.js +6 -0
- package/modules/conceptxBidAdapter.js +70 -0
- package/modules/conceptxBidAdapter.md +36 -0
- package/modules/criteoBidAdapter.js +9 -2
- package/modules/eskimiBidAdapter.js +171 -41
- package/modules/eskimiBidAdapter.md +35 -16
- package/modules/euidIdSystem.js +121 -0
- package/modules/euidIdSystem.md +131 -0
- package/modules/freepassIdSystem.js +61 -0
- package/modules/freepassIdSystem.md +47 -0
- package/modules/greenbidsAnalyticsAdapter.js +1 -1
- package/modules/id5IdSystem.js +3 -5
- package/modules/ixBidAdapter.js +12 -1
- package/modules/limelightDigitalBidAdapter.js +1 -1
- package/modules/logicadBidAdapter.js +14 -1
- package/modules/mediasquareBidAdapter.js +13 -5
- package/modules/nexx360BidAdapter.js +1 -0
- package/modules/pairIdSystem.js +10 -5
- package/modules/proxistoreBidAdapter.js +11 -14
- package/modules/richaudienceBidAdapter.js +10 -1
- package/modules/riseBidAdapter.js +1 -1
- package/modules/schain.js +2 -2
- package/modules/sirdataRtdProvider.js +73 -146
- package/modules/sovrnBidAdapter.js +4 -1
- package/modules/stroeerCoreBidAdapter.js +55 -6
- package/modules/uid2IdSystem.js +27 -210
- package/modules/uid2IdSystem.md +104 -23
- package/modules/uid2IdSystem_shared.js +232 -0
- package/modules/userId/eids.js +8 -0
- package/modules/userId/userId.md +2 -1
- package/modules/viouslyBidAdapter.js +2 -2
- package/modules/weboramaRtdProvider.js +25 -95
- package/modules/weboramaRtdProvider.md +4 -4
- package/modules/yieldlabBidAdapter.js +23 -14
- package/modules/zeta_global_sspBidAdapter.js +27 -22
- package/package.json +1 -1
- package/src/adloader.js +1 -0
- package/test/spec/modules/1plusXRtdProvider_spec.js +98 -149
- package/test/spec/modules/adagioBidAdapter_spec.js +46 -17
- package/test/spec/modules/airgridRtdProvider_spec.js +2 -0
- package/test/spec/modules/beopBidAdapter_spec.js +24 -0
- package/test/spec/modules/conceptxBidAdapter_spec.js +136 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +1 -1
- package/test/spec/modules/eids_spec.js +15 -0
- package/test/spec/modules/eskimiBidAdapter_spec.js +264 -112
- package/test/spec/modules/euidIdSystem_spec.js +130 -0
- package/test/spec/modules/freepassIdSystem_spec.js +186 -0
- package/test/spec/modules/id5IdSystem_spec.js +10 -3
- package/test/spec/modules/ixBidAdapter_spec.js +30 -0
- package/test/spec/modules/logicadBidAdapter_spec.js +122 -2
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -0
- package/test/spec/modules/richaudienceBidAdapter_spec.js +44 -0
- package/test/spec/modules/schain_spec.js +9 -0
- package/test/spec/modules/sirdataRtdProvider_spec.js +110 -17
- package/test/spec/modules/sovrnBidAdapter_spec.js +13 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +151 -6
- package/test/spec/modules/uid2IdSystem_helpers.js +70 -0
- package/test/spec/modules/uid2IdSystem_spec.js +131 -86
- package/test/spec/modules/userId_spec.js +16 -12
- package/test/spec/modules/weboramaRtdProvider_spec.js +331 -205
- package/test/spec/modules/yieldlabBidAdapter_spec.js +42 -2
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +200 -4
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// import or require modules necessary for the test, e.g.:
|
|
2
|
+
import { expect } from 'chai'; // may prefer 'assert' in place of 'expect'
|
|
3
|
+
import { spec } from 'modules/conceptxBidAdapter.js';
|
|
4
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
5
|
+
// import { config } from 'src/config.js';
|
|
6
|
+
|
|
7
|
+
describe('conceptxBidAdapter', function () {
|
|
8
|
+
const URL = 'https://conceptx.cncpt-central.com/openrtb';
|
|
9
|
+
|
|
10
|
+
// before(() => {
|
|
11
|
+
|
|
12
|
+
// });
|
|
13
|
+
|
|
14
|
+
// after(() => {
|
|
15
|
+
// // $$PREBID_GLOBAL$$.bidderSettings = {};
|
|
16
|
+
// });
|
|
17
|
+
|
|
18
|
+
// afterEach(function () {
|
|
19
|
+
// config.resetConfig();
|
|
20
|
+
// });
|
|
21
|
+
|
|
22
|
+
const ENDPOINT_URL = `${URL}`;
|
|
23
|
+
const ENDPOINT_URL_CONSENT = `${URL}?gdpr_applies=true&consentString=ihaveconsented`;
|
|
24
|
+
const adapter = newBidder(spec);
|
|
25
|
+
|
|
26
|
+
const bidderRequests = [
|
|
27
|
+
{
|
|
28
|
+
bidId: '123',
|
|
29
|
+
bidder: 'conceptx',
|
|
30
|
+
params: {
|
|
31
|
+
site: 'example',
|
|
32
|
+
adunit: 'some-id-3'
|
|
33
|
+
},
|
|
34
|
+
mediaTypes: {
|
|
35
|
+
banner: {
|
|
36
|
+
sizes: [[930, 180]],
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
const singleBidRequest = {
|
|
43
|
+
bid: [
|
|
44
|
+
{
|
|
45
|
+
bidId: '123',
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const serverResponse = {
|
|
51
|
+
body: {
|
|
52
|
+
'bidResponses': [
|
|
53
|
+
{
|
|
54
|
+
'ads': [
|
|
55
|
+
{
|
|
56
|
+
'referrer': 'http://localhost/prebidpage_concept_bidder.html',
|
|
57
|
+
'ttl': 360,
|
|
58
|
+
'html': '<h1>DUMMY</h1>',
|
|
59
|
+
'requestId': '214dfadd1f8826',
|
|
60
|
+
'cpm': 46,
|
|
61
|
+
'currency': 'DKK',
|
|
62
|
+
'width': 930,
|
|
63
|
+
'height': 180,
|
|
64
|
+
'creativeId': 'FAKE-ID',
|
|
65
|
+
'meta': {
|
|
66
|
+
'mediaType': 'banner'
|
|
67
|
+
},
|
|
68
|
+
'netRevenue': true,
|
|
69
|
+
'destinationUrls': {
|
|
70
|
+
'destination': 'https://concept.dk'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
'matchedAdCount': 1,
|
|
75
|
+
'targetId': '214dfadd1f8826'
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
describe('inherited functions', function () {
|
|
82
|
+
it('exists and is a function', function () {
|
|
83
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
describe('isBidRequestValid', function () {
|
|
88
|
+
it('should return true when required params found', function () {
|
|
89
|
+
expect(spec.isBidRequestValid(bidderRequests[0])).to.equal(true);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('buildRequests', function () {
|
|
94
|
+
it('Test requests', function () {
|
|
95
|
+
const request = spec.buildRequests(bidderRequests, {});
|
|
96
|
+
expect(request.length).to.equal(1);
|
|
97
|
+
expect(request[0]).to.have.property('data');
|
|
98
|
+
const bid = JSON.parse(request[0].data).adUnits[0]
|
|
99
|
+
expect(bid.site).to.equal('example');
|
|
100
|
+
expect(bid.adunit).to.equal('some-id-3');
|
|
101
|
+
expect(JSON.stringify(bid.dimensions)).to.equal(JSON.stringify([
|
|
102
|
+
[930, 180]]));
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe('user privacy', function () {
|
|
107
|
+
it('should NOT send GDPR Consent data if gdprApplies equals undefined', function () {
|
|
108
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: undefined, consentString: 'iDoNotConsent' } });
|
|
109
|
+
expect(request.length).to.equal(1);
|
|
110
|
+
expect(request[0]).to.have.property('url')
|
|
111
|
+
expect(request[0].url).to.equal(ENDPOINT_URL);
|
|
112
|
+
});
|
|
113
|
+
it('should send GDPR Consent data if gdprApplies', function () {
|
|
114
|
+
let request = spec.buildRequests(bidderRequests, { gdprConsent: { gdprApplies: true, consentString: 'ihaveconsented' } });
|
|
115
|
+
expect(request.length).to.equal(1);
|
|
116
|
+
expect(request[0]).to.have.property('url')
|
|
117
|
+
expect(request[0].url).to.equal(ENDPOINT_URL_CONSENT);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe('interpretResponse', function () {
|
|
122
|
+
it('should return valid response when passed valid server response', function () {
|
|
123
|
+
const interpretedResponse = spec.interpretResponse(serverResponse, singleBidRequest);
|
|
124
|
+
const ad = serverResponse.body.bidResponses[0].ads[0]
|
|
125
|
+
expect(interpretedResponse).to.have.lengthOf(1);
|
|
126
|
+
expect(interpretedResponse[0].cpm).to.equal(ad.cpm);
|
|
127
|
+
expect(interpretedResponse[0].width).to.equal(Number(ad.width));
|
|
128
|
+
expect(interpretedResponse[0].height).to.equal(Number(ad.height));
|
|
129
|
+
expect(interpretedResponse[0].creativeId).to.equal(ad.creativeId);
|
|
130
|
+
expect(interpretedResponse[0].currency).to.equal(ad.currency);
|
|
131
|
+
expect(interpretedResponse[0].netRevenue).to.equal(true);
|
|
132
|
+
expect(interpretedResponse[0].ad).to.equal(ad.html);
|
|
133
|
+
expect(interpretedResponse[0].ttl).to.equal(360);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|
|
@@ -2457,7 +2457,7 @@ describe('The Criteo bidding adapter', function () {
|
|
|
2457
2457
|
|
|
2458
2458
|
const adapters = { Prebid: function () { } };
|
|
2459
2459
|
const adaptersMock = sinon.mock(adapters);
|
|
2460
|
-
adaptersMock.expects('Prebid').withExactArgs(PROFILE_ID_PUBLISHERTAG, ADAPTER_VERSION, bidRequests, bidderRequest, '$prebid.version$').once().returns(prebidAdapter);
|
|
2460
|
+
adaptersMock.expects('Prebid').withExactArgs(PROFILE_ID_PUBLISHERTAG, ADAPTER_VERSION, bidRequests, bidderRequest, '$prebid.version$', sinon.match.any).once().returns(prebidAdapter);
|
|
2461
2461
|
|
|
2462
2462
|
global.Criteo = {
|
|
2463
2463
|
PubTag: {
|
|
@@ -348,6 +348,21 @@ describe('eids array generation for known sub-modules', function() {
|
|
|
348
348
|
});
|
|
349
349
|
});
|
|
350
350
|
|
|
351
|
+
it('euid', function() {
|
|
352
|
+
const userId = {
|
|
353
|
+
euid: {'id': 'Sample_AD_Token'}
|
|
354
|
+
};
|
|
355
|
+
const newEids = createEidsArray(userId);
|
|
356
|
+
expect(newEids.length).to.equal(1);
|
|
357
|
+
expect(newEids[0]).to.deep.equal({
|
|
358
|
+
source: 'euid.eu',
|
|
359
|
+
uids: [{
|
|
360
|
+
id: 'Sample_AD_Token',
|
|
361
|
+
atype: 3
|
|
362
|
+
}]
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
|
|
351
366
|
it('kpuid', function() {
|
|
352
367
|
const userId = {
|
|
353
368
|
kpuid: 'Sample_Token'
|
|
@@ -1,155 +1,307 @@
|
|
|
1
|
-
import {expect} from 'chai';
|
|
2
|
-
import {spec} from 'modules/eskimiBidAdapter.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from 'modules/eskimiBidAdapter.js';
|
|
3
|
+
import * as utils from 'src/utils';
|
|
4
|
+
|
|
5
|
+
const BANNER_BID = {
|
|
6
|
+
bidder: 'eskimi',
|
|
7
|
+
params: {
|
|
8
|
+
placementId: 1003000
|
|
9
|
+
},
|
|
10
|
+
mediaTypes: {
|
|
11
|
+
banner: {
|
|
12
|
+
sizes: [
|
|
13
|
+
[300, 250]
|
|
14
|
+
],
|
|
13
15
|
},
|
|
14
|
-
'sizes': [
|
|
15
|
-
[300, 250]
|
|
16
|
-
],
|
|
17
|
-
'bidId': 'bidId1',
|
|
18
|
-
'adUnitCode': 'adUnitCode1',
|
|
19
|
-
'bidderRequestId': 'bidderRequestId',
|
|
20
|
-
'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708'
|
|
21
16
|
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
adUnitCode: 'adUnitCode1',
|
|
18
|
+
bidId: 'bidId',
|
|
19
|
+
bidderRequestId: 'bidderRequestId',
|
|
20
|
+
auctionId: 'auctionId-56a2-4f71-9098-720a68f2f708',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const VIDEO_BID = {
|
|
24
|
+
bidder: 'eskimi',
|
|
25
|
+
params: {
|
|
26
|
+
placementId: 1003000
|
|
27
|
+
},
|
|
28
|
+
mediaTypes: {
|
|
29
|
+
video: {
|
|
30
|
+
context: 'outstream',
|
|
31
|
+
api: [1, 2, 4, 6],
|
|
32
|
+
mimes: ['video/mp4'],
|
|
33
|
+
playbackmethod: [2, 4, 6],
|
|
34
|
+
playerSize: [[1024, 768]],
|
|
35
|
+
protocols: [3, 4, 7, 8, 10],
|
|
36
|
+
placement: 1,
|
|
37
|
+
minduration: 0,
|
|
38
|
+
maxduration: 60,
|
|
39
|
+
startdelay: 0
|
|
27
40
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'bidderRequestId': 'bidderRequestId',
|
|
34
|
-
'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708'
|
|
35
|
-
}],
|
|
36
|
-
'start': 1487883186070,
|
|
37
|
-
'auctionStart': 1487883186069,
|
|
38
|
-
'timeout': 3000
|
|
41
|
+
},
|
|
42
|
+
adUnitCode: 'adUnitCode1',
|
|
43
|
+
bidId: 'bidId',
|
|
44
|
+
bidderRequestId: 'bidderRequestId',
|
|
45
|
+
auctionId: 'auctionId-56a2-4f71-9098-720a68f2f708',
|
|
39
46
|
};
|
|
40
47
|
|
|
41
|
-
const
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
'id': 'bidId1',
|
|
50
|
-
'impid': 'bidId1',
|
|
51
|
-
'price': 0.18,
|
|
52
|
-
'adm': '<script>adm</script>',
|
|
53
|
-
'adid': '144762342',
|
|
54
|
-
'adomain': [
|
|
55
|
-
'https://dummydomain.com'
|
|
56
|
-
],
|
|
57
|
-
'iurl': 'iurl',
|
|
58
|
-
'cid': '109',
|
|
59
|
-
'crid': 'creativeId',
|
|
60
|
-
'cat': [],
|
|
61
|
-
'w': 300,
|
|
62
|
-
'h': 250,
|
|
63
|
-
'ext': {
|
|
64
|
-
'prebid': {
|
|
65
|
-
'type': 'banner'
|
|
66
|
-
},
|
|
67
|
-
'bidder': {
|
|
68
|
-
'eskimi': {
|
|
69
|
-
'brand_id': 334553,
|
|
70
|
-
'auction_id': 514667951122925701,
|
|
71
|
-
'bidder_id': 2,
|
|
72
|
-
'bid_ad_type': 0
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
'seat': 'seat'
|
|
79
|
-
}
|
|
80
|
-
]
|
|
48
|
+
const BIDDER_REQUEST = {
|
|
49
|
+
auctionId: 'auctionId-56a2-4f71-9098-720a68f2f708',
|
|
50
|
+
bidderRequestId: 'bidderRequestId',
|
|
51
|
+
timeout: 3000,
|
|
52
|
+
refererInfo: {
|
|
53
|
+
page: 'https://hello-world-page.com/',
|
|
54
|
+
domain: 'hello-world-page.com',
|
|
55
|
+
ref: 'http://example-domain.com/foo',
|
|
81
56
|
}
|
|
82
57
|
};
|
|
83
58
|
|
|
59
|
+
const BANNER_BID_RESPONSE = {
|
|
60
|
+
'id': 'bidderRequestId',
|
|
61
|
+
'bidId': 'bidid',
|
|
62
|
+
'seatbid': [
|
|
63
|
+
{
|
|
64
|
+
'bid': [
|
|
65
|
+
{
|
|
66
|
+
'id': 'id',
|
|
67
|
+
'impid': 'bidId',
|
|
68
|
+
'price': 0.18,
|
|
69
|
+
'adm': '<script>adm</script>',
|
|
70
|
+
'adid': '144762342',
|
|
71
|
+
'burl': 'http://0.0.0.0:8181/burl',
|
|
72
|
+
'adomain': [
|
|
73
|
+
'https://dummydomain.com'
|
|
74
|
+
],
|
|
75
|
+
'cid': 'cid',
|
|
76
|
+
'crid': 'crid',
|
|
77
|
+
'iurl': 'iurl',
|
|
78
|
+
'cat': [],
|
|
79
|
+
'w': 300,
|
|
80
|
+
'h': 250
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
'cur': 'USD'
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const VIDEO_BID_RESPONSE = {
|
|
89
|
+
'id': 'bidderRequestId',
|
|
90
|
+
'bidid': 'bidid',
|
|
91
|
+
'seatbid': [
|
|
92
|
+
{
|
|
93
|
+
'bid': [
|
|
94
|
+
{
|
|
95
|
+
'id': 'id',
|
|
96
|
+
'impid': 'bidId',
|
|
97
|
+
'price': 1.09,
|
|
98
|
+
'adid': '144762342',
|
|
99
|
+
'burl': 'http://0.0.0.0:8181/burl',
|
|
100
|
+
'adm': '<VAST version="4.2"></VAST>',
|
|
101
|
+
'adomain': [
|
|
102
|
+
'https://dummydomain.com'
|
|
103
|
+
],
|
|
104
|
+
'cid': 'cid',
|
|
105
|
+
'crid': 'crid',
|
|
106
|
+
'iurl': 'iurl',
|
|
107
|
+
'cat': [],
|
|
108
|
+
'h': 768,
|
|
109
|
+
'w': 1024
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
'cur': 'USD'
|
|
115
|
+
};
|
|
116
|
+
|
|
84
117
|
describe('Eskimi bid adapter', function () {
|
|
85
|
-
describe('isBidRequestValid', function () {
|
|
118
|
+
describe('isBidRequestValid()', function () {
|
|
86
119
|
it('should accept request if placementId is passed', function () {
|
|
87
120
|
let bid = {
|
|
88
121
|
bidder: 'eskimi',
|
|
89
122
|
params: {
|
|
90
123
|
placementId: 123
|
|
124
|
+
},
|
|
125
|
+
mediaTypes: {
|
|
126
|
+
banner: {
|
|
127
|
+
sizes: [[300, 250]]
|
|
128
|
+
}
|
|
91
129
|
}
|
|
92
130
|
};
|
|
93
131
|
expect(spec.isBidRequestValid(bid)).to.equal(true);
|
|
94
132
|
});
|
|
95
|
-
|
|
133
|
+
|
|
134
|
+
it('should reject requests without params', function () {
|
|
96
135
|
let bid = {
|
|
97
136
|
bidder: 'eskimi',
|
|
98
137
|
params: {}
|
|
99
138
|
};
|
|
100
139
|
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
101
140
|
});
|
|
102
|
-
});
|
|
103
141
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
expect(request).to.exist.and.to.be.a('object');
|
|
108
|
-
const payload = request.data;
|
|
109
|
-
expect(payload.imp[0]).to.have.property('id', REQUEST.bidRequest[0].bidId);
|
|
110
|
-
expect(payload.imp[1]).to.have.property('id', REQUEST.bidRequest[1].bidId);
|
|
142
|
+
it('should return true when required params found', () => {
|
|
143
|
+
expect(spec.isBidRequestValid(BANNER_BID)).to.equal(true);
|
|
144
|
+
expect(spec.isBidRequestValid(VIDEO_BID)).to.equal(true);
|
|
111
145
|
});
|
|
146
|
+
});
|
|
112
147
|
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
describe('buildRequests()', function () {
|
|
149
|
+
it('should have gdpr data if applicable', function () {
|
|
150
|
+
const bid = utils.deepClone(BANNER_BID);
|
|
151
|
+
|
|
152
|
+
const req = Object.assign({}, BIDDER_REQUEST, {
|
|
115
153
|
gdprConsent: {
|
|
116
154
|
consentString: 'consentString',
|
|
117
155
|
gdprApplies: true,
|
|
118
156
|
}
|
|
119
157
|
});
|
|
120
|
-
let request = spec.buildRequests(
|
|
158
|
+
let request = spec.buildRequests([bid], req)[0];
|
|
121
159
|
|
|
122
160
|
const payload = request.data;
|
|
123
161
|
expect(payload.user.ext).to.have.property('consent', req.gdprConsent.consentString);
|
|
124
162
|
expect(payload.regs.ext).to.have.property('gdpr', 1);
|
|
125
163
|
});
|
|
126
|
-
});
|
|
127
164
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
165
|
+
it('should properly forward ORTB blocking params', function () {
|
|
166
|
+
let bid = utils.deepClone(BANNER_BID);
|
|
167
|
+
bid = utils.mergeDeep(bid, {
|
|
168
|
+
params: { bcat: ['IAB1-1'], badv: ['example.com'], bapp: ['com.example'] },
|
|
169
|
+
mediaTypes: { banner: { battr: [1] } }
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
let [request] = spec.buildRequests([bid], BIDDER_REQUEST);
|
|
173
|
+
|
|
174
|
+
expect(request).to.exist.and.to.be.an('object');
|
|
175
|
+
const payload = request.data;
|
|
176
|
+
expect(payload).to.have.deep.property('bcat', ['IAB1-1']);
|
|
177
|
+
expect(payload).to.have.deep.property('badv', ['example.com']);
|
|
178
|
+
expect(payload).to.have.deep.property('bapp', ['com.example']);
|
|
179
|
+
expect(payload.imp[0].banner).to.have.deep.property('battr', [1]);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
context('when mediaType is banner', function () {
|
|
183
|
+
it('should build correct request for banner bid with both w, h', () => {
|
|
184
|
+
const bid = utils.deepClone(BANNER_BID);
|
|
185
|
+
|
|
186
|
+
const [request] = spec.buildRequests([bid], BIDDER_REQUEST);
|
|
187
|
+
const requestData = request.data;
|
|
188
|
+
|
|
189
|
+
expect(requestData.imp[0].banner.w).to.equal(300);
|
|
190
|
+
expect(requestData.imp[0].banner.h).to.equal(250);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('should create request data', function () {
|
|
194
|
+
const bid = utils.deepClone(BANNER_BID);
|
|
195
|
+
|
|
196
|
+
let [request] = spec.buildRequests([bid], BIDDER_REQUEST);
|
|
197
|
+
expect(request).to.exist.and.to.be.a('object');
|
|
198
|
+
const payload = request.data;
|
|
199
|
+
expect(payload.imp[0]).to.have.property('id', bid.bidId);
|
|
200
|
+
});
|
|
146
201
|
});
|
|
147
202
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
203
|
+
context('when mediaType is video', function () {
|
|
204
|
+
it('should return false when there is no video in mediaTypes', () => {
|
|
205
|
+
const bid = utils.deepClone(VIDEO_BID);
|
|
206
|
+
delete bid.mediaTypes.video;
|
|
207
|
+
|
|
208
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
it('should reutrn false if player size is not set', () => {
|
|
212
|
+
const bid = utils.deepClone(VIDEO_BID);
|
|
213
|
+
delete bid.mediaTypes.video.playerSize;
|
|
214
|
+
|
|
215
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('should use bidder video params if they are set', () => {
|
|
219
|
+
const videoBidWithParams = utils.deepClone(VIDEO_BID);
|
|
220
|
+
const bidderVideoParams = {
|
|
221
|
+
api: [1, 2],
|
|
222
|
+
mimes: ['video/mp4', 'video/x-flv'],
|
|
223
|
+
playbackmethod: [3, 4],
|
|
224
|
+
protocols: [5, 6],
|
|
225
|
+
placement: 1,
|
|
226
|
+
minduration: 0,
|
|
227
|
+
maxduration: 60,
|
|
228
|
+
w: 1024,
|
|
229
|
+
h: 768,
|
|
230
|
+
startdelay: 0
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
videoBidWithParams.params.video = bidderVideoParams;
|
|
234
|
+
|
|
235
|
+
const requests = spec.buildRequests([videoBidWithParams], BIDDER_REQUEST);
|
|
236
|
+
const request = requests[0].data;
|
|
237
|
+
|
|
238
|
+
expect(request.imp[0]).to.deep.include({
|
|
239
|
+
video: {
|
|
240
|
+
...bidderVideoParams,
|
|
241
|
+
w: videoBidWithParams.mediaTypes.video.playerSize[0][0],
|
|
242
|
+
h: videoBidWithParams.mediaTypes.video.playerSize[0][1],
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
});
|
|
153
246
|
});
|
|
154
247
|
});
|
|
248
|
+
|
|
249
|
+
describe('interpretResponse()', function () {
|
|
250
|
+
context('when mediaType is banner', function () {
|
|
251
|
+
it('should correctly interpret valid banner response', function () {
|
|
252
|
+
const bid = utils.deepClone(BANNER_BID);
|
|
253
|
+
const [request] = spec.buildRequests([bid], BIDDER_REQUEST);
|
|
254
|
+
const response = utils.deepClone(BANNER_BID_RESPONSE);
|
|
255
|
+
|
|
256
|
+
const bids = spec.interpretResponse({ body: response }, request);
|
|
257
|
+
expect(bids).to.be.an('array').that.is.not.empty;
|
|
258
|
+
|
|
259
|
+
expect(bids[0].mediaType).to.equal('banner');
|
|
260
|
+
expect(bids[0].burl).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].burl);
|
|
261
|
+
expect(bids[0].currency).to.equal('USD');
|
|
262
|
+
expect(bids[0].requestId).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].impid);
|
|
263
|
+
expect(bids[0].cpm).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].price);
|
|
264
|
+
expect(bids[0].width).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].w);
|
|
265
|
+
expect(bids[0].height).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].h);
|
|
266
|
+
expect(bids[0].ad).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].adm);
|
|
267
|
+
expect(bids[0].creativeId).to.equal(BANNER_BID_RESPONSE.seatbid[0].bid[0].crid);
|
|
268
|
+
expect(bids[0].meta.advertiserDomains[0]).to.equal('https://dummydomain.com');
|
|
269
|
+
expect(bids[0].ttl).to.equal(30);
|
|
270
|
+
expect(bids[0].netRevenue).to.equal(true);
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it('should handle empty bid response', function () {
|
|
274
|
+
const bid = utils.deepClone(BANNER_BID);
|
|
275
|
+
|
|
276
|
+
let request = spec.buildRequests([bid], BIDDER_REQUEST)[0];
|
|
277
|
+
const EMPTY_RESP = Object.assign({}, BANNER_BID_RESPONSE, { 'body': {} });
|
|
278
|
+
const bids = spec.interpretResponse(EMPTY_RESP, request);
|
|
279
|
+
expect(bids).to.be.empty;
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
if (FEATURES.VIDEO) {
|
|
283
|
+
context('when mediaType is video', function () {
|
|
284
|
+
it('should correctly interpret valid instream video response', () => {
|
|
285
|
+
const bid = utils.deepClone(VIDEO_BID);
|
|
286
|
+
|
|
287
|
+
const [request] = spec.buildRequests([bid], BIDDER_REQUEST);
|
|
288
|
+
const bids = spec.interpretResponse({ body: VIDEO_BID_RESPONSE }, request);
|
|
289
|
+
expect(bids).to.be.an('array').that.is.not.empty;
|
|
290
|
+
|
|
291
|
+
expect(bids[0].mediaType).to.equal('video');
|
|
292
|
+
expect(bids[0].burl).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].burl);
|
|
293
|
+
expect(bids[0].currency).to.equal('USD');
|
|
294
|
+
expect(bids[0].requestId).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].impid);
|
|
295
|
+
expect(bids[0].cpm).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].price);
|
|
296
|
+
expect(bids[0].width).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].w);
|
|
297
|
+
expect(bids[0].height).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].h);
|
|
298
|
+
expect(bids[0].vastXml).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].adm);
|
|
299
|
+
expect(bids[0].creativeId).to.equal(VIDEO_BID_RESPONSE.seatbid[0].bid[0].crid);
|
|
300
|
+
expect(bids[0].meta.advertiserDomains[0]).to.equal('https://dummydomain.com');
|
|
301
|
+
expect(bids[0].ttl).to.equal(30);
|
|
302
|
+
expect(bids[0].netRevenue).to.equal(true);
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
155
307
|
});
|