prebid.js 7.3.0 → 7.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/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/adpod.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.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/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/concertBidAdapter.js +1 -1
- package/dist/connectadBidAdapter.js +1 -1
- package/dist/consumableBidAdapter.js +1 -1
- package/dist/conversantBidAdapter.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/dspxBidAdapter.js +1 -1
- package/dist/eplanningBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.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/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/lassoBidAdapter.js +1 -1
- 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/mediasquareBidAdapter.js +1 -1
- package/dist/mgidBidAdapter.js +1 -1
- package/dist/minutemediaBidAdapter.js +1 -1
- package/dist/missenaBidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +112 -110
- 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/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/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/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/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.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/yieldmoBidAdapter.js +1 -1
- package/dist/yieldoneAnalyticsAdapter.js +1 -1
- package/gulpfile.js +1 -1
- package/modules/debugging/bidInterceptor.js +1 -1
- package/modules/debugging/index.js +2 -1
- package/modules/insticatorBidAdapter.js +9 -0
- package/modules/ixBidAdapter.js +389 -48
- package/modules/ixBidAdapter.md +95 -5
- package/modules/kargoBidAdapter.js +1 -2
- package/modules/missenaBidAdapter.js +20 -2
- package/modules/openxBidAdapter.md +3 -1
- package/modules/openxOrtbBidAdapter.js +349 -0
- package/modules/openxOrtbBidAdapter.md +105 -0
- package/modules/readpeakBidAdapter.js +15 -6
- package/modules/relaidoBidAdapter.js +19 -4
- package/modules/shinezBidAdapter.js +435 -0
- package/modules/shinezBidAdapter.md +76 -0
- package/modules/ventesBidAdapter.js +1 -1
- package/modules/ventesBidAdapter.md +1 -1
- package/modules/vrtcalBidAdapter.js +35 -0
- package/package.json +1 -1
- package/plugins/pbjsGlobals.js +2 -1
- package/test/spec/modules/debugging_mod_spec.js +7 -0
- package/test/spec/modules/insticatorBidAdapter_spec.js +22 -1
- package/test/spec/modules/ixBidAdapter_spec.js +333 -5
- package/test/spec/modules/kargoBidAdapter_spec.js +1 -0
- package/test/spec/modules/missenaBidAdapter_spec.js +36 -14
- 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/shinezBidAdapter_spec.js +479 -0
- package/test/spec/modules/ventesBidAdapter_spec.js +2 -2
- package/test/spec/modules/vrtcalBidAdapter_spec.js +17 -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 = {
|
|
@@ -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
|
+
});
|
|
@@ -2,7 +2,7 @@ import { expect } from 'chai';
|
|
|
2
2
|
import * as utils from 'src/utils.js';
|
|
3
3
|
import { spec } from 'modules/ventesBidAdapter.js';
|
|
4
4
|
|
|
5
|
-
const BIDDER_URL = '
|
|
5
|
+
const BIDDER_URL = 'https://ad.ventesavenues.in/va/ad';
|
|
6
6
|
|
|
7
7
|
describe('Ventes Adapter', function () {
|
|
8
8
|
const examples = {
|
|
@@ -35,7 +35,7 @@ describe('Ventes Adapter', function () {
|
|
|
35
35
|
|
|
36
36
|
serverRequest_banner: {
|
|
37
37
|
method: 'POST',
|
|
38
|
-
url:
|
|
38
|
+
url: BIDDER_URL,
|
|
39
39
|
data: {
|
|
40
40
|
id: 'bid_request_id',
|
|
41
41
|
imp: [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai'
|
|
2
2
|
import { spec } from 'modules/vrtcalBidAdapter'
|
|
3
3
|
import { newBidder } from 'src/adapters/bidderFactory'
|
|
4
|
+
import { config } from 'src/config.js';
|
|
4
5
|
|
|
5
6
|
describe('vrtcalBidAdapter', function () {
|
|
6
7
|
const adapter = newBidder(spec)
|
|
@@ -50,6 +51,22 @@ describe('vrtcalBidAdapter', function () {
|
|
|
50
51
|
request = spec.buildRequests(bidRequests);
|
|
51
52
|
expect(request[0].data).to.match(/"bidfloor":0.55/);
|
|
52
53
|
});
|
|
54
|
+
|
|
55
|
+
it('pass GDPR,CCPA, and COPPA indicators/consent strings with the request when present', function () {
|
|
56
|
+
bidRequests[0].gdprConsent = {consentString: 'gdpr-consent-string', gdprApplies: true};
|
|
57
|
+
bidRequests[0].uspConsent = 'ccpa-consent-string';
|
|
58
|
+
config.setConfig({ coppa: false });
|
|
59
|
+
|
|
60
|
+
request = spec.buildRequests(bidRequests);
|
|
61
|
+
expect(request[0].data).to.match(/"user":{"ext":{"consent":"gdpr-consent-string"}}/);
|
|
62
|
+
expect(request[0].data).to.match(/"regs":{"coppa":0,"ext":{"gdpr":1,"us_privacy":"ccpa-consent-string"}}/);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('pass bidder timeout/tmax with the request', function () {
|
|
66
|
+
config.setConfig({ bidderTimeout: 435 });
|
|
67
|
+
request = spec.buildRequests(bidRequests);
|
|
68
|
+
expect(request[0].data).to.match(/"tmax":435/);
|
|
69
|
+
});
|
|
53
70
|
});
|
|
54
71
|
|
|
55
72
|
describe('interpretResponse', function () {
|
package/webpack.conf.js
CHANGED
|
@@ -5,7 +5,7 @@ var webpack = require('webpack');
|
|
|
5
5
|
var helpers = require('./gulpHelpers.js');
|
|
6
6
|
var { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
7
7
|
var argv = require('yargs').argv;
|
|
8
|
-
const babelConfig = require('./babelConfig.js')({disableFeatures: helpers.getDisabledFeatures()});
|
|
8
|
+
const babelConfig = require('./babelConfig.js')({disableFeatures: helpers.getDisabledFeatures(), prebidDistUrlBase: argv.distUrlBase});
|
|
9
9
|
|
|
10
10
|
var plugins = [
|
|
11
11
|
new webpack.EnvironmentPlugin({'LiveConnectMode': null}),
|