prebid.js 7.51.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/adriverIdSystem.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/allowActivities.js +1 -0
- 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/connectIdSystem.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/dependencies.json +6 -0
- 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/gdprEnforcement.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/growthCodeRtdProvider.js +1 -0
- 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 +154 -146
- package/dist/objectGuard.js +1 -0
- 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/oxxionAnalyticsAdapter.js +1 -0
- 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/rtdModule.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/growthcode.html +20 -9
- package/integrationExamples/gpt/userId_example.html +20 -6
- package/libraries/objectGuard/objectGuard.js +108 -0
- package/libraries/objectGuard/ortbGuard.js +88 -0
- package/modules/.submodules.json +3 -1
- package/modules/1plusXRtdProvider.js +31 -60
- package/modules/adagioBidAdapter.js +86 -24
- package/modules/adgenerationBidAdapter.js +14 -5
- package/modules/adkernelBidAdapter.js +2 -2
- package/modules/adriverIdSystem.js +1 -1
- package/modules/airgridRtdProvider.js +11 -12
- package/modules/allowActivities.js +74 -0
- 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/connectIdSystem.js +89 -13
- package/modules/connectIdSystem.md +4 -7
- package/modules/criteoBidAdapter.js +18 -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/gdprEnforcement.js +98 -169
- package/modules/greenbidsAnalyticsAdapter.js +1 -1
- package/modules/growthCodeRtdProvider.js +131 -0
- package/modules/growthCodeRtdProvider.md +55 -0
- package/modules/id5IdSystem.js +3 -5
- package/modules/ixBidAdapter.js +17 -3
- 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/oxxionAnalyticsAdapter.js +212 -0
- package/modules/oxxionAnalyticsAdapter.md +33 -0
- package/modules/pairIdSystem.js +16 -11
- package/modules/proxistoreBidAdapter.js +11 -14
- package/modules/richaudienceBidAdapter.js +10 -1
- package/modules/riseBidAdapter.js +1 -1
- package/modules/rtdModule/index.js +12 -1
- package/modules/schain.js +2 -2
- package/modules/sharethroughBidAdapter.js +2 -2
- package/modules/sirdataRtdProvider.js +73 -146
- package/modules/smartadserverBidAdapter.js +5 -0
- package/modules/sovrnBidAdapter.js +4 -1
- package/modules/stroeerCoreBidAdapter.js +55 -6
- package/modules/stvBidAdapter.js +34 -1
- package/modules/uid2IdSystem.js +27 -210
- package/modules/uid2IdSystem.md +104 -23
- package/modules/uid2IdSystem_shared.js +232 -0
- package/modules/undertoneBidAdapter.js +9 -1
- package/modules/userId/eids.js +8 -0
- package/modules/userId/index.js +69 -41
- 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/yahoosspBidAdapter.js +45 -3
- package/modules/yahoosspBidAdapter.md +1 -1
- package/modules/yieldlabBidAdapter.js +23 -14
- package/modules/zeta_global_sspBidAdapter.js +28 -22
- package/package.json +1 -1
- package/src/activities/activities.js +47 -0
- package/src/activities/activityParams.js +8 -0
- package/src/activities/modules.js +1 -1
- package/src/activities/params.js +59 -0
- package/src/activities/redactor.js +157 -0
- package/src/activities/rules.js +95 -0
- package/src/adapterManager.js +45 -8
- package/src/adloader.js +1 -0
- package/src/fpd/rootDomain.js +1 -1
- package/src/prebid.js +1 -1
- package/src/storageManager.js +57 -44
- package/src/userSync.js +35 -18
- package/test/spec/activities/allowActivites_spec.js +138 -0
- package/test/spec/activities/objectGuard_spec.js +144 -0
- package/test/spec/activities/ortbGuard_spec.js +140 -0
- package/test/spec/activities/params_spec.js +25 -0
- package/test/spec/activities/redactor_spec.js +296 -0
- package/test/spec/activities/rules_spec.js +135 -0
- package/test/spec/modules/1plusXRtdProvider_spec.js +98 -149
- package/test/spec/modules/adagioBidAdapter_spec.js +46 -17
- package/test/spec/modules/adgenerationBidAdapter_spec.js +52 -12
- 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/connectIdSystem_spec.js +291 -23
- package/test/spec/modules/criteoBidAdapter_spec.js +85 -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/gdprEnforcement_spec.js +127 -414
- package/test/spec/modules/growthCodeRtdProvider_spec.js +127 -0
- package/test/spec/modules/id5IdSystem_spec.js +10 -3
- package/test/spec/modules/ixBidAdapter_spec.js +32 -1
- package/test/spec/modules/logicadBidAdapter_spec.js +122 -2
- package/test/spec/modules/mediasquareBidAdapter_spec.js +4 -0
- package/test/spec/modules/oxxionAnalyticsAdapter_spec.js +324 -0
- package/test/spec/modules/pairIdSystem_spec.js +16 -3
- package/test/spec/modules/realTimeDataModule_spec.js +1 -1
- package/test/spec/modules/richaudienceBidAdapter_spec.js +44 -0
- package/test/spec/modules/schain_spec.js +9 -0
- package/test/spec/modules/sharethroughBidAdapter_spec.js +1 -1
- package/test/spec/modules/sirdataRtdProvider_spec.js +110 -17
- package/test/spec/modules/smartadserverBidAdapter_spec.js +42 -0
- package/test/spec/modules/sovrnBidAdapter_spec.js +13 -0
- package/test/spec/modules/stroeerCoreBidAdapter_spec.js +151 -6
- package/test/spec/modules/stvBidAdapter_spec.js +13 -1
- package/test/spec/modules/uid2IdSystem_helpers.js +70 -0
- package/test/spec/modules/uid2IdSystem_spec.js +131 -86
- package/test/spec/modules/undertoneBidAdapter_spec.js +57 -1
- package/test/spec/modules/userId_spec.js +96 -33
- package/test/spec/modules/weboramaRtdProvider_spec.js +331 -205
- package/test/spec/modules/yahoosspBidAdapter_spec.js +103 -51
- package/test/spec/modules/yieldlabBidAdapter_spec.js +42 -2
- package/test/spec/modules/zeta_global_sspBidAdapter_spec.js +204 -4
- package/test/spec/unit/core/adapterManager_spec.js +181 -1
- package/test/spec/unit/core/storageManager_spec.js +76 -68
- package/test/spec/unit/pbjs_api_spec.js +15 -25
- package/test/spec/userSync_spec.js +45 -16
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
2
|
import { BANNER, VIDEO } from 'src/mediaTypes.js';
|
|
3
3
|
import { config } from 'src/config.js';
|
|
4
|
+
import { deepClone } from 'src/utils.js';
|
|
4
5
|
import { spec } from 'modules/smartadserverBidAdapter.js';
|
|
5
6
|
|
|
6
7
|
// Default params with optional ones
|
|
@@ -1339,4 +1340,45 @@ describe('Smart bid adapter tests', function () {
|
|
|
1339
1340
|
expect(bannerRequest).to.have.property('formatid').and.to.equal('90');
|
|
1340
1341
|
});
|
|
1341
1342
|
});
|
|
1343
|
+
|
|
1344
|
+
describe('Global Placement ID (GPID)', function () {
|
|
1345
|
+
it('should not include gpid by default', () => {
|
|
1346
|
+
const request = spec.buildRequests(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1347
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1348
|
+
|
|
1349
|
+
expect(requestContent).to.not.have.property('gdid');
|
|
1350
|
+
});
|
|
1351
|
+
|
|
1352
|
+
it('should include gpid if pbadslot in ortb2Imp', () => {
|
|
1353
|
+
const gpid = '/19968336/header-bid-tag-1';
|
|
1354
|
+
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1355
|
+
|
|
1356
|
+
bidRequests[0].ortb2Imp = {
|
|
1357
|
+
ext: {
|
|
1358
|
+
data: {
|
|
1359
|
+
pbadslot: gpid
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
};
|
|
1363
|
+
|
|
1364
|
+
const request = spec.buildRequests(bidRequests);
|
|
1365
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1366
|
+
|
|
1367
|
+
expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
|
|
1368
|
+
});
|
|
1369
|
+
|
|
1370
|
+
it('should include gpid if imp[].ext.gpid exists', () => {
|
|
1371
|
+
const gpid = '/1111/homepage#div-leftnav';
|
|
1372
|
+
const bidRequests = deepClone(DEFAULT_PARAMS_WO_OPTIONAL);
|
|
1373
|
+
|
|
1374
|
+
bidRequests[0].ortb2Imp = {
|
|
1375
|
+
ext: { gpid }
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
const request = spec.buildRequests(bidRequests);
|
|
1379
|
+
const requestContent = JSON.parse(request[0].data);
|
|
1380
|
+
|
|
1381
|
+
expect(requestContent).to.have.property('gpid').and.to.equal(gpid);
|
|
1382
|
+
});
|
|
1383
|
+
});
|
|
1342
1384
|
});
|
|
@@ -170,6 +170,19 @@ describe('sovrnBidAdapter', function() {
|
|
|
170
170
|
expect(payload.site.domain).to.equal('example.com')
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
+
it('sets correct timeout', function() {
|
|
174
|
+
const bidderRequest = {
|
|
175
|
+
...baseBidderRequest,
|
|
176
|
+
bidderCode: 'sovrn',
|
|
177
|
+
auctionId: '1d1a030790a475',
|
|
178
|
+
bidderRequestId: '22edbae2733bf6',
|
|
179
|
+
timeout: 3000,
|
|
180
|
+
bids: [baseBidRequest]
|
|
181
|
+
}
|
|
182
|
+
const payload = JSON.parse(spec.buildRequests([baseBidRequest], bidderRequest).data)
|
|
183
|
+
expect(payload.tmax).to.equal(3000)
|
|
184
|
+
})
|
|
185
|
+
|
|
173
186
|
it('includes the ad unit code in the request', function() {
|
|
174
187
|
const impression = payload.imp[0]
|
|
175
188
|
expect(impression.adunitcode).to.equal('adunit-code')
|
|
@@ -527,14 +527,16 @@ describe('stroeerCore bid adapter', function () {
|
|
|
527
527
|
'bid': 'bid8',
|
|
528
528
|
'viz': true,
|
|
529
529
|
'ban': {
|
|
530
|
-
'siz': [[300, 600], [160, 60]]
|
|
531
|
-
|
|
530
|
+
'siz': [[300, 600], [160, 60]],
|
|
531
|
+
'fp': undefined
|
|
532
|
+
},
|
|
532
533
|
},
|
|
533
534
|
{
|
|
534
535
|
'sid': 'ABC=',
|
|
535
536
|
'bid': 'bid12',
|
|
536
537
|
'ban': {
|
|
537
|
-
'siz': [[100, 200], [300, 500]]
|
|
538
|
+
'siz': [[100, 200], [300, 500]],
|
|
539
|
+
'fp': undefined
|
|
538
540
|
},
|
|
539
541
|
'viz': undefined
|
|
540
542
|
}
|
|
@@ -548,7 +550,8 @@ describe('stroeerCore bid adapter', function () {
|
|
|
548
550
|
'vid': {
|
|
549
551
|
'ctx': 'instream',
|
|
550
552
|
'siz': [640, 480],
|
|
551
|
-
'mim': ['video/mp4', 'video/quicktime']
|
|
553
|
+
'mim': ['video/mp4', 'video/quicktime'],
|
|
554
|
+
'fp': undefined
|
|
552
555
|
}
|
|
553
556
|
}
|
|
554
557
|
];
|
|
@@ -589,7 +592,8 @@ describe('stroeerCore bid adapter', function () {
|
|
|
589
592
|
'bid': 'bid3',
|
|
590
593
|
'viz': true,
|
|
591
594
|
'ban': {
|
|
592
|
-
'siz': [[100, 200], [300, 500]]
|
|
595
|
+
'siz': [[100, 200], [300, 500]],
|
|
596
|
+
'fp': undefined
|
|
593
597
|
}
|
|
594
598
|
}
|
|
595
599
|
];
|
|
@@ -602,7 +606,8 @@ describe('stroeerCore bid adapter', function () {
|
|
|
602
606
|
'vid': {
|
|
603
607
|
'ctx': 'instream',
|
|
604
608
|
'siz': [640, 480],
|
|
605
|
-
'mim': ['video/mp4', 'video/quicktime']
|
|
609
|
+
'mim': ['video/mp4', 'video/quicktime'],
|
|
610
|
+
'fp': undefined
|
|
606
611
|
}
|
|
607
612
|
}
|
|
608
613
|
];
|
|
@@ -696,6 +701,146 @@ describe('stroeerCore bid adapter', function () {
|
|
|
696
701
|
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
697
702
|
assert.deepEqual(serverRequestInfo.data.schain, schain);
|
|
698
703
|
});
|
|
704
|
+
|
|
705
|
+
it('should add floor info to banner bid request if floor is available', () => {
|
|
706
|
+
const bidReq = buildBidderRequest();
|
|
707
|
+
|
|
708
|
+
const getFloorStub1 = sinon.stub();
|
|
709
|
+
const getFloorStub2 = sinon.stub();
|
|
710
|
+
|
|
711
|
+
getFloorStub1
|
|
712
|
+
.returns({})
|
|
713
|
+
.withArgs({currency: 'EUR', mediaType: BANNER, size: '*'})
|
|
714
|
+
.returns({currency: 'TRY', floor: 0.7})
|
|
715
|
+
.withArgs({currency: 'EUR', mediaType: 'banner', size: [300, 600]})
|
|
716
|
+
.returns({currency: 'TRY', floor: 1.3})
|
|
717
|
+
.withArgs({currency: 'EUR', mediaType: 'banner', size: [160, 60]})
|
|
718
|
+
.returns({currency: 'TRY', floor: 2.5})
|
|
719
|
+
|
|
720
|
+
getFloorStub2
|
|
721
|
+
.returns({})
|
|
722
|
+
.withArgs({currency: 'EUR', mediaType: 'banner', size: '*'})
|
|
723
|
+
.returns({currency: 'USD', floor: 1.2})
|
|
724
|
+
.withArgs({currency: 'EUR', mediaType: 'banner', size: [728, 90]})
|
|
725
|
+
.returns({currency: 'USD', floor: 1.85})
|
|
726
|
+
|
|
727
|
+
bidReq.bids[0].getFloor = getFloorStub1;
|
|
728
|
+
bidReq.bids[1].getFloor = getFloorStub2;
|
|
729
|
+
|
|
730
|
+
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
731
|
+
|
|
732
|
+
const serverRequestBids = serverRequestInfo.data.bids;
|
|
733
|
+
const firstBid = serverRequestBids[0];
|
|
734
|
+
const secondBid = serverRequestBids[1];
|
|
735
|
+
|
|
736
|
+
assert.nestedPropertyVal(firstBid, 'ban.fp.def', 0.7);
|
|
737
|
+
assert.nestedPropertyVal(firstBid, 'ban.fp.cur', 'TRY');
|
|
738
|
+
assert.deepNestedPropertyVal(firstBid, 'ban.fp.siz', [{w: 300, h: 600, p: 1.3}, {w: 160, h: 60, p: 2.5}]);
|
|
739
|
+
|
|
740
|
+
assert.isTrue(getFloorStub1.calledThrice);
|
|
741
|
+
|
|
742
|
+
assert.nestedPropertyVal(secondBid, 'ban.fp.def', 1.2);
|
|
743
|
+
assert.nestedPropertyVal(secondBid, 'ban.fp.cur', 'USD');
|
|
744
|
+
assert.deepNestedPropertyVal(secondBid, 'ban.fp.siz', [{w: 728, h: 90, p: 1.85}]);
|
|
745
|
+
|
|
746
|
+
assert.isTrue(getFloorStub2.calledTwice);
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
it('should add floor info to video bid request if floor is available', () => {
|
|
750
|
+
const bidReq = buildBidderRequest();
|
|
751
|
+
|
|
752
|
+
const getFloorStub1 = sinon.stub();
|
|
753
|
+
const getFloorStub2 = sinon.stub();
|
|
754
|
+
|
|
755
|
+
getFloorStub1
|
|
756
|
+
.returns({})
|
|
757
|
+
.withArgs({currency: 'EUR', mediaType: 'video', size: '*'})
|
|
758
|
+
.returns({currency: 'NZD', floor: 3.25})
|
|
759
|
+
.withArgs({currency: 'EUR', mediaType: 'video', size: [640, 480]})
|
|
760
|
+
.returns({currency: 'NZD', floor: 4.10});
|
|
761
|
+
|
|
762
|
+
getFloorStub2
|
|
763
|
+
.returns({})
|
|
764
|
+
.withArgs({currency: 'EUR', mediaType: 'video', size: '*'})
|
|
765
|
+
.returns({currency: 'GBP', floor: 4.75})
|
|
766
|
+
.withArgs({currency: 'EUR', mediaType: 'video', size: [1280, 720]})
|
|
767
|
+
.returns({currency: 'GBP', floor: 6.50})
|
|
768
|
+
|
|
769
|
+
delete bidReq.bids[0].mediaTypes.banner;
|
|
770
|
+
bidReq.bids[0].mediaTypes.video = {
|
|
771
|
+
playerSize: [640, 480],
|
|
772
|
+
context: 'instream'
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
delete bidReq.bids[1].mediaTypes.banner;
|
|
776
|
+
bidReq.bids[1].mediaTypes.video = {
|
|
777
|
+
playerSize: [1280, 720],
|
|
778
|
+
context: 'outstream'
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
bidReq.bids[0].getFloor = getFloorStub1;
|
|
782
|
+
bidReq.bids[1].getFloor = getFloorStub2;
|
|
783
|
+
|
|
784
|
+
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
785
|
+
|
|
786
|
+
const serverRequestBids = serverRequestInfo.data.bids;
|
|
787
|
+
const firstBid = serverRequestBids[0];
|
|
788
|
+
const secondBid = serverRequestBids[1];
|
|
789
|
+
|
|
790
|
+
assert.nestedPropertyVal(firstBid, 'vid.fp.def', 3.25);
|
|
791
|
+
assert.nestedPropertyVal(firstBid, 'vid.fp.cur', 'NZD');
|
|
792
|
+
assert.deepNestedPropertyVal(firstBid, 'vid.fp.siz', [{w: 640, h: 480, p: 4.10}]);
|
|
793
|
+
|
|
794
|
+
assert.isTrue(getFloorStub1.calledTwice);
|
|
795
|
+
|
|
796
|
+
assert.nestedPropertyVal(secondBid, 'vid.fp.def', 4.75);
|
|
797
|
+
assert.nestedPropertyVal(secondBid, 'vid.fp.cur', 'GBP');
|
|
798
|
+
assert.deepNestedPropertyVal(secondBid, 'vid.fp.siz', [{w: 1280, h: 720, p: 6.50}]);
|
|
799
|
+
|
|
800
|
+
assert.isTrue(getFloorStub2.calledTwice);
|
|
801
|
+
});
|
|
802
|
+
|
|
803
|
+
it('should not add floor info to bid request if floor is unavailable', () => {
|
|
804
|
+
const bidReq = buildBidderRequest();
|
|
805
|
+
const getFloorSpy = sinon.spy(() => ({}));
|
|
806
|
+
|
|
807
|
+
delete bidReq.bids[0].getFloor;
|
|
808
|
+
bidReq.bids[1].getFloor = getFloorSpy;
|
|
809
|
+
|
|
810
|
+
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
811
|
+
|
|
812
|
+
const serverRequestBids = serverRequestInfo.data.bids;
|
|
813
|
+
const firstBid = serverRequestBids[0];
|
|
814
|
+
const secondBid = serverRequestBids[1];
|
|
815
|
+
|
|
816
|
+
assert.nestedPropertyVal(firstBid, 'ban.fp', undefined);
|
|
817
|
+
assert.nestedPropertyVal(secondBid, 'ban.fp', undefined);
|
|
818
|
+
|
|
819
|
+
assert.isTrue(getFloorSpy.calledWith({currency: 'EUR', mediaType: 'banner', size: '*'}));
|
|
820
|
+
assert.isTrue(getFloorSpy.calledWith({currency: 'EUR', mediaType: 'banner', size: [728, 90]}));
|
|
821
|
+
assert.isTrue(getFloorSpy.calledTwice);
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
it('should not add floor info for a size when it is the same as the default', () => {
|
|
825
|
+
const bidReq = buildBidderRequest();
|
|
826
|
+
const getFloorStub = sinon.stub();
|
|
827
|
+
|
|
828
|
+
getFloorStub
|
|
829
|
+
.returns({currency: 'EUR', floor: 1.9})
|
|
830
|
+
.withArgs({currency: 'EUR', mediaType: BANNER, size: [160, 60]})
|
|
831
|
+
.returns({currency: 'EUR', floor: 2.7});
|
|
832
|
+
|
|
833
|
+
bidReq.bids[0].getFloor = getFloorStub;
|
|
834
|
+
|
|
835
|
+
const serverRequestInfo = spec.buildRequests(bidReq.bids, bidReq);
|
|
836
|
+
|
|
837
|
+
const serverRequestBids = serverRequestInfo.data.bids;
|
|
838
|
+
const bid = serverRequestBids[0];
|
|
839
|
+
|
|
840
|
+
assert.nestedPropertyVal(bid, 'ban.fp.def', 1.9);
|
|
841
|
+
assert.nestedPropertyVal(bid, 'ban.fp.cur', 'EUR');
|
|
842
|
+
assert.deepNestedPropertyVal(bid, 'ban.fp.siz', [{w: 160, h: 60, p: 2.7}]);
|
|
843
|
+
});
|
|
699
844
|
});
|
|
700
845
|
});
|
|
701
846
|
});
|
|
@@ -60,6 +60,18 @@ describe('stvAdapter', function() {
|
|
|
60
60
|
'bidderRequestId': '22edbae2733bf61',
|
|
61
61
|
'auctionId': '1d1a030790a475',
|
|
62
62
|
'adUnitCode': 'testDiv1',
|
|
63
|
+
'schain': {
|
|
64
|
+
'ver': '1.0',
|
|
65
|
+
'complete': 0,
|
|
66
|
+
'nodes': [
|
|
67
|
+
{
|
|
68
|
+
'asi': 'reseller.com',
|
|
69
|
+
'sid': 'aaaaa',
|
|
70
|
+
'rid': 'BidRequest4',
|
|
71
|
+
'hp': 1
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
63
75
|
},
|
|
64
76
|
{
|
|
65
77
|
'bidder': 'stv',
|
|
@@ -169,7 +181,7 @@ describe('stvAdapter', function() {
|
|
|
169
181
|
expect(request1.method).to.equal('GET');
|
|
170
182
|
expect(request1.url).to.equal(ENDPOINT_URL);
|
|
171
183
|
let data = request1.data.replace(/rnd=\d+\&/g, '').replace(/ref=.*\&bid/g, 'bid').replace(/pbver=.*?&/g, 'pbver=test&');
|
|
172
|
-
expect(data).to.equal('_f=html&alternative=prebid_js&_ps=6682&srw=300&srh=250&idt=100&bid_id=30b31c1838de1e1&pbver=test&pfilter%5Bfloorprice%5D=1000000&pfilter%5Bgeo%5D%5Bcountry%5D=DE&gdpr_consent=BOJ%2FP2HOJ%2FP2HABABMAAAAAZ%2BA%3D%3D&gdpr=true&bcat=IAB2%2CIAB4&dvt=desktop&pbcode=testDiv1&media_types%5Bbanner%5D=300x250');
|
|
184
|
+
expect(data).to.equal('_f=html&alternative=prebid_js&_ps=6682&srw=300&srh=250&idt=100&bid_id=30b31c1838de1e1&pbver=test&schain=1.0,0!reseller.com,aaaaa,1,BidRequest4,,,&pfilter%5Bfloorprice%5D=1000000&pfilter%5Bgeo%5D%5Bcountry%5D=DE&gdpr_consent=BOJ%2FP2HOJ%2FP2HABABMAAAAAZ%2BA%3D%3D&gdpr=true&bcat=IAB2%2CIAB4&dvt=desktop&pbcode=testDiv1&media_types%5Bbanner%5D=300x250');
|
|
173
185
|
});
|
|
174
186
|
|
|
175
187
|
var request2 = spec.buildRequests([bidRequests[1]], bidderRequest)[0];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { setConsentConfig } from 'modules/consentManagement.js';
|
|
2
|
+
import { server } from 'test/mocks/xhr.js';
|
|
3
|
+
import {coreStorage, init, setSubmoduleRegistry, requestBidsHook} from 'modules/userId/index.js';
|
|
4
|
+
|
|
5
|
+
const msIn12Hours = 60 * 60 * 12 * 1000;
|
|
6
|
+
const expireCookieDate = 'Thu, 01 Jan 1970 00:00:01 GMT';
|
|
7
|
+
|
|
8
|
+
export const cookieHelpers = {
|
|
9
|
+
getFutureCookieExpiry: () => new Date(Date.now() + msIn12Hours).toUTCString(),
|
|
10
|
+
setPublisherCookie: (cookieName, token) => coreStorage.setCookie(cookieName, JSON.stringify(token), cookieHelpers.getFutureCookieExpiry()),
|
|
11
|
+
clearCookies: (...cookieNames) => cookieNames.forEach(cookieName => coreStorage.setCookie(cookieName, '', expireCookieDate)),
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const runAuction = async () => {
|
|
15
|
+
const adUnits = [{
|
|
16
|
+
code: 'adUnit-code',
|
|
17
|
+
mediaTypes: {banner: {}, native: {}},
|
|
18
|
+
sizes: [[300, 200], [300, 600]],
|
|
19
|
+
bids: [{bidder: 'sampleBidder', params: {placementId: 'banner-only-bidder'}}]
|
|
20
|
+
}];
|
|
21
|
+
return new Promise(function(resolve) {
|
|
22
|
+
requestBidsHook(function() {
|
|
23
|
+
resolve(adUnits[0].bids[0]);
|
|
24
|
+
}, {adUnits});
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const apiHelpers = {
|
|
29
|
+
makeTokenResponse: (token, shouldRefresh = false, expired = false) => ({
|
|
30
|
+
advertising_token: token,
|
|
31
|
+
refresh_token: 'fake-refresh-token',
|
|
32
|
+
identity_expires: expired ? Date.now() - 1000 : Date.now() + 60 * 60 * 1000,
|
|
33
|
+
refresh_from: shouldRefresh ? Date.now() - 1000 : Date.now() + 60 * 1000,
|
|
34
|
+
refresh_expires: Date.now() + 24 * 60 * 60 * 1000, // 24 hours
|
|
35
|
+
refresh_response_key: 'wR5t6HKMfJ2r4J7fEGX9Gw==', // Fake data
|
|
36
|
+
}),
|
|
37
|
+
respondAfterDelay: (delay) => new Promise((resolve) => setTimeout(() => {
|
|
38
|
+
server.respond();
|
|
39
|
+
setTimeout(() => resolve());
|
|
40
|
+
}, delay)),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const setGdprApplies = (consent = false) => {
|
|
44
|
+
const consentDetails = consent ? {
|
|
45
|
+
tcString: 'CPhJRpMPhJRpMABAMBFRACBoALAAAEJAAIYgAKwAQAKgArABAAqAAA',
|
|
46
|
+
purpose: {
|
|
47
|
+
consents: {
|
|
48
|
+
'1': true,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
vendor: {
|
|
52
|
+
consents: {
|
|
53
|
+
'21': true,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
} : {
|
|
58
|
+
tcString: 'CPhJRpMPhJRpMABAMBFRACBoALAAAEJAAIYgAKwAQAKgArABAAqAAA'
|
|
59
|
+
};
|
|
60
|
+
const staticConfig = {
|
|
61
|
+
cmpApi: 'static',
|
|
62
|
+
timeout: 7500,
|
|
63
|
+
consentData: {
|
|
64
|
+
gdprApplies: true,
|
|
65
|
+
...consentDetails
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
setConsentConfig(staticConfig);
|
|
69
|
+
return staticConfig;
|
|
70
|
+
}
|