prebid.js 8.5.0 → 8.7.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/33acrossIdSystem.js +1 -1
- package/dist/adagioBidAdapter.js +1 -1
- package/dist/adbookpspBidAdapter.js +1 -1
- package/dist/adgenerationBidAdapter.js +1 -1
- package/dist/adqueryBidAdapter.js +1 -1
- package/dist/adrelevantisBidAdapter.js +1 -1
- package/dist/adsinteractiveBidAdapter.js +1 -1
- package/dist/adtrgtmeBidAdapter.js +1 -1
- package/dist/adxcgBidAdapter.js +1 -1
- package/dist/adyoulikeBidAdapter.js +1 -1
- package/dist/ajaBidAdapter.js +1 -1
- package/dist/alkimiBidAdapter.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/automatadAnalyticsAdapter.js +1 -0
- package/dist/axonixBidAdapter.js +1 -1
- package/dist/bidglassBidAdapter.js +1 -1
- package/dist/big-richmediaBidAdapter.js +1 -1
- package/dist/bridBidAdapter.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/concertBidAdapter.js +1 -1
- package/dist/connatixBidAdapter.js +1 -0
- 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/euidIdSystem.js +1 -1
- package/dist/feedadBidAdapter.js +1 -1
- package/dist/finativeBidAdapter.js +1 -1
- package/dist/freepassBidAdapter.js +1 -1
- package/dist/freewheel-sspBidAdapter.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/growthCodeAnalyticsAdapter.js +1 -1
- package/dist/gumgumBidAdapter.js +1 -1
- package/dist/h12mediaBidAdapter.js +1 -1
- package/dist/hypelabBidAdapter.js +1 -1
- package/dist/id5IdSystem.js +1 -1
- package/dist/imdsBidAdapter.js +1 -1
- package/dist/improvedigitalBidAdapter.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/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/medianetBidAdapter.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/mspa.js +1 -1
- package/dist/newspassidBidAdapter.js +1 -1
- package/dist/nexx360BidAdapter.js +1 -1
- package/dist/not-for-prod/prebid.js +140 -136
- 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/parrableIdSystem.js +1 -1
- package/dist/pixfutureBidAdapter.js +1 -1
- package/dist/prebid-core.js +1 -1
- package/dist/pubCircleBidAdapter.js +1 -0
- 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/relevadRtdProvider.js +1 -1
- package/dist/retailspotBidAdapter.js +1 -1
- package/dist/rhythmoneBidAdapter.js +1 -1
- package/dist/riseBidAdapter.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 -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/ssmasBidAdapter.js +1 -1
- package/dist/sspBCBidAdapter.js +1 -1
- package/dist/stvBidAdapter.js +1 -1
- package/dist/sublimeBidAdapter.js +1 -1
- package/dist/tappxBidAdapter.js +1 -1
- package/dist/targetVideoBidAdapter.js +1 -1
- package/dist/teadsBidAdapter.js +1 -1
- package/dist/topicsFpdModule.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/underdogmediaBidAdapter.js +1 -1
- package/dist/undertoneBidAdapter.js +1 -1
- package/dist/viantOrtbBidAdapter.js +1 -0
- package/dist/vidazooBidAdapter.js +1 -1
- package/dist/videobyteBidAdapter.js +1 -1
- package/dist/videojsVideoProvider.js +1 -1
- package/dist/visxBidAdapter.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/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +1 -1
- package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +1 -1
- package/integrationExamples/videoModule/jwplayer/bidsBackHandlerOverride.html +137 -0
- package/integrationExamples/videoModule/jwplayer/eventListeners.html +1 -1
- package/integrationExamples/videoModule/jwplayer/eventsUI.html +1 -1
- package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +1 -1
- package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +1 -1
- package/integrationExamples/videoModule/jwplayer/playlist.html +1 -1
- package/integrationExamples/videoModule/videojs/bidsBackHandlerOverride.html +164 -0
- package/libraries/mspa/activityControls.js +51 -32
- package/modules/adagioBidAdapter.js +15 -1
- package/modules/adgenerationBidAdapter.js +5 -4
- package/modules/adsinteractiveBidAdapter.js +4 -2
- package/modules/alkimiBidAdapter.js +19 -7
- package/modules/appnexusBidAdapter.js +1 -1
- package/modules/automatadAnalyticsAdapter.js +325 -0
- package/modules/automatadAnalyticsAdapter.md +23 -0
- package/modules/connatixBidAdapter.js +185 -0
- package/modules/connatixBidAdapter.md +37 -0
- package/modules/criteoBidAdapter.js +18 -0
- package/modules/cwireBidAdapter.js +19 -0
- package/modules/freepassBidAdapter.js +20 -1
- package/modules/freepassBidAdapter.md +4 -1
- package/modules/gridBidAdapter.js +1 -8
- package/modules/growthCodeAnalyticsAdapter.js +7 -2
- package/modules/medianetBidAdapter.js +7 -4
- package/modules/mediasquareBidAdapter.js +3 -0
- package/modules/newspassid.md +76 -0
- package/modules/newspassidBidAdapter.js +44 -18
- package/modules/optidigitalBidAdapter.js +25 -16
- package/modules/pubCircleBidAdapter.js +231 -0
- package/modules/pubCircleBidAdapter.md +79 -0
- package/modules/relevadRtdProvider.js +6 -7
- package/modules/ssmasBidAdapter.js +2 -2
- package/modules/tappxBidAdapter.js +27 -15
- package/modules/tappxBidAdapter.md +17 -0
- package/modules/topicsFpdModule.js +21 -48
- package/modules/undertoneBidAdapter.md +1 -1
- package/modules/userId/eids.md +7 -0
- package/modules/viantOrtbBidAdapter.js +113 -0
- package/modules/viantOrtbBidAdapter.md +54 -0
- package/modules/vidazooBidAdapter.js +9 -2
- package/modules/videojsVideoProvider.js +9 -2
- package/package.json +1 -1
- package/test/spec/libraries/mspa/activityControls_spec.js +145 -212
- package/test/spec/modules/adagioBidAdapter_spec.js +89 -0
- package/test/spec/modules/adgenerationBidAdapter_spec.js +6 -6
- package/test/spec/modules/alkimiBidAdapter_spec.js +3 -9
- package/test/spec/modules/appnexusBidAdapter_spec.js +12 -1
- package/test/spec/modules/automatadAnalyticsAdapter_spec.js +533 -0
- package/test/spec/modules/connatixBidAdapter_spec.js +366 -0
- package/test/spec/modules/criteoBidAdapter_spec.js +52 -3
- package/test/spec/modules/cwireBidAdapter_spec.js +47 -0
- package/test/spec/modules/freepassBidAdapter_spec.js +44 -0
- package/test/spec/modules/gridBidAdapter_spec.js +68 -0
- package/test/spec/modules/medianetBidAdapter_spec.js +18 -18
- package/test/spec/modules/mediasquareBidAdapter_spec.js +5 -0
- package/test/spec/modules/newspassidBidAdapter_spec.js +6 -0
- package/test/spec/modules/optidigitalBidAdapter_spec.js +9 -2
- package/test/spec/modules/pubCircleBidAdapter_spec.js +399 -0
- package/test/spec/modules/tappxBidAdapter_spec.js +19 -0
- package/test/spec/modules/topicsFpdModule_spec.js +343 -365
- package/test/spec/modules/viantOrtbBidAdapter_spec.js +432 -0
|
@@ -915,24 +915,24 @@ let VALID_BID_REQUEST = [{
|
|
|
915
915
|
cid: '8CUV090'
|
|
916
916
|
}
|
|
917
917
|
},
|
|
918
|
-
|
|
919
|
-
bidder: '
|
|
918
|
+
VALID_PARAMS_TS = {
|
|
919
|
+
bidder: 'trustedstack',
|
|
920
920
|
params: {
|
|
921
|
-
cid: '
|
|
921
|
+
cid: 'TS012345'
|
|
922
922
|
}
|
|
923
923
|
},
|
|
924
924
|
PARAMS_MISSING = {
|
|
925
925
|
bidder: 'medianet',
|
|
926
926
|
},
|
|
927
|
-
|
|
928
|
-
bidder: '
|
|
927
|
+
PARAMS_MISSING_TS = {
|
|
928
|
+
bidder: 'trustedstack',
|
|
929
929
|
},
|
|
930
930
|
PARAMS_WITHOUT_CID = {
|
|
931
931
|
bidder: 'medianet',
|
|
932
932
|
params: {}
|
|
933
933
|
},
|
|
934
|
-
|
|
935
|
-
bidder: '
|
|
934
|
+
PARAMS_WITHOUT_CID_TS = {
|
|
935
|
+
bidder: 'trustedstack',
|
|
936
936
|
params: {}
|
|
937
937
|
},
|
|
938
938
|
PARAMS_WITH_INTEGER_CID = {
|
|
@@ -941,8 +941,8 @@ let VALID_BID_REQUEST = [{
|
|
|
941
941
|
cid: 8867587
|
|
942
942
|
}
|
|
943
943
|
},
|
|
944
|
-
|
|
945
|
-
bidder: '
|
|
944
|
+
PARAMS_WITH_INTEGER_CID_TS = {
|
|
945
|
+
bidder: 'trustedstack',
|
|
946
946
|
params: {
|
|
947
947
|
cid: 8867587
|
|
948
948
|
}
|
|
@@ -953,8 +953,8 @@ let VALID_BID_REQUEST = [{
|
|
|
953
953
|
cid: ''
|
|
954
954
|
}
|
|
955
955
|
},
|
|
956
|
-
|
|
957
|
-
bidder: '
|
|
956
|
+
PARAMS_WITH_EMPTY_CID_TS = {
|
|
957
|
+
bidder: 'trustedstack',
|
|
958
958
|
params: {
|
|
959
959
|
cid: ''
|
|
960
960
|
}
|
|
@@ -1783,34 +1783,34 @@ describe('Media.net bid adapter', function () {
|
|
|
1783
1783
|
});
|
|
1784
1784
|
});
|
|
1785
1785
|
|
|
1786
|
-
describe('isBidRequestValid
|
|
1786
|
+
describe('isBidRequestValid trustedstack', function () {
|
|
1787
1787
|
it('should accept valid bid params', function () {
|
|
1788
|
-
let isValid = spec.isBidRequestValid(
|
|
1788
|
+
let isValid = spec.isBidRequestValid(VALID_PARAMS_TS);
|
|
1789
1789
|
expect(isValid).to.equal(true);
|
|
1790
1790
|
});
|
|
1791
1791
|
|
|
1792
1792
|
it('should reject bid if cid is not present', function () {
|
|
1793
|
-
let isValid = spec.isBidRequestValid(
|
|
1793
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITHOUT_CID_TS);
|
|
1794
1794
|
expect(isValid).to.equal(false);
|
|
1795
1795
|
});
|
|
1796
1796
|
|
|
1797
1797
|
it('should reject bid if cid is not a string', function () {
|
|
1798
|
-
let isValid = spec.isBidRequestValid(
|
|
1798
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITH_INTEGER_CID_TS);
|
|
1799
1799
|
expect(isValid).to.equal(false);
|
|
1800
1800
|
});
|
|
1801
1801
|
|
|
1802
1802
|
it('should reject bid if cid is a empty string', function () {
|
|
1803
|
-
let isValid = spec.isBidRequestValid(
|
|
1803
|
+
let isValid = spec.isBidRequestValid(PARAMS_WITH_EMPTY_CID_TS);
|
|
1804
1804
|
expect(isValid).to.equal(false);
|
|
1805
1805
|
});
|
|
1806
1806
|
|
|
1807
1807
|
it('should have missing params', function () {
|
|
1808
|
-
let isValid = spec.isBidRequestValid(
|
|
1808
|
+
let isValid = spec.isBidRequestValid(PARAMS_MISSING_TS);
|
|
1809
1809
|
expect(isValid).to.equal(false);
|
|
1810
1810
|
});
|
|
1811
1811
|
});
|
|
1812
1812
|
|
|
1813
|
-
describe('interpretResponse
|
|
1813
|
+
describe('interpretResponse trustedstack', function () {
|
|
1814
1814
|
it('should not push response if no-bid', function () {
|
|
1815
1815
|
let validBids = [];
|
|
1816
1816
|
let bids = spec.interpretResponse(SERVER_RESPONSE_NOBID, []);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {expect} from 'chai';
|
|
2
2
|
import {spec} from 'modules/mediasquareBidAdapter.js';
|
|
3
|
+
import { server } from 'test/mocks/xhr.js';
|
|
3
4
|
|
|
4
5
|
describe('MediaSquare bid adapter tests', function () {
|
|
5
6
|
var DEFAULT_PARAMS = [{
|
|
@@ -208,6 +209,10 @@ describe('MediaSquare bid adapter tests', function () {
|
|
|
208
209
|
const response = spec.interpretResponse(BID_RESPONSE, request);
|
|
209
210
|
const won = spec.onBidWon(response[0]);
|
|
210
211
|
expect(won).to.equal(true);
|
|
212
|
+
expect(server.requests.length).to.equal(1);
|
|
213
|
+
let message = JSON.parse(server.requests[0].requestBody);
|
|
214
|
+
expect(message).to.have.property('increment').exist;
|
|
215
|
+
expect(message).to.have.property('increment').and.to.equal('1');
|
|
211
216
|
});
|
|
212
217
|
it('Verifies user sync without cookie in bid response', function () {
|
|
213
218
|
var syncs = spec.getUserSyncs({}, [BID_RESPONSE], DEFAULT_OPTIONS.gdprConsent, DEFAULT_OPTIONS.uspConsent);
|
|
@@ -1667,6 +1667,12 @@ describe('newspassid Adapter', function () {
|
|
|
1667
1667
|
expect(result[0]['price']).to.equal(0.9);
|
|
1668
1668
|
expect(result[0]['adserverTargeting']['np_npappnexus_adId']).to.equal('2899ec066a91ff8-0-np-1');
|
|
1669
1669
|
});
|
|
1670
|
+
it('should add np_auc_id (response id value)', function () {
|
|
1671
|
+
const request = spec.buildRequests(validBidRequests, validBidderRequest);
|
|
1672
|
+
let validres = JSON.parse(JSON.stringify(validBidResponse1adWith2Bidders));
|
|
1673
|
+
const result = spec.interpretResponse(validres, request);
|
|
1674
|
+
expect(utils.deepAccess(result[0].adserverTargeting, 'np_auc_id')).to.equal(validBidResponse1adWith2Bidders.body.id);
|
|
1675
|
+
});
|
|
1670
1676
|
it('should correctly process an auction with 2 adunits & multiple bidders one of which bids for both adslots', function() {
|
|
1671
1677
|
let validres = JSON.parse(JSON.stringify(multiResponse1));
|
|
1672
1678
|
let request = spec.buildRequests(multiRequest1, multiBidderRequest1.bidderRequest);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import { spec } from 'modules/optidigitalBidAdapter.js';
|
|
2
|
+
import { spec, resetSync } from 'modules/optidigitalBidAdapter.js';
|
|
3
3
|
import * as utils from 'src/utils.js';
|
|
4
4
|
|
|
5
5
|
const ENDPOINT = 'https://pbs.optidigital.com/bidder';
|
|
@@ -497,6 +497,7 @@ describe('optidigitalAdapterTests', function () {
|
|
|
497
497
|
let test;
|
|
498
498
|
beforeEach(function () {
|
|
499
499
|
test = sinon.sandbox.create();
|
|
500
|
+
resetSync();
|
|
500
501
|
});
|
|
501
502
|
afterEach(function() {
|
|
502
503
|
test.restore();
|
|
@@ -508,16 +509,22 @@ describe('optidigitalAdapterTests', function () {
|
|
|
508
509
|
}]);
|
|
509
510
|
});
|
|
510
511
|
|
|
511
|
-
it('should return appropriate URL', function() {
|
|
512
|
+
it('should return appropriate URL with GDPR equals to 1 and GDPR consent', function() {
|
|
512
513
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
513
514
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo`
|
|
514
515
|
}]);
|
|
516
|
+
});
|
|
517
|
+
it('should return appropriate URL with GDPR equals to 0 and GDPR consent', function() {
|
|
515
518
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: false, consentString: 'foo'}, undefined)).to.deep.equal([{
|
|
516
519
|
type: 'iframe', url: `${syncurlIframe}&gdpr=0&gdpr_consent=foo`
|
|
517
520
|
}]);
|
|
521
|
+
});
|
|
522
|
+
it('should return appropriate URL with GDPR equals to 1 and no consent', function() {
|
|
518
523
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: undefined}, undefined)).to.deep.equal([{
|
|
519
524
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=`
|
|
520
525
|
}]);
|
|
526
|
+
});
|
|
527
|
+
it('should return appropriate URL with GDPR equals to 1, GDPR consent and CCPA consent', function() {
|
|
521
528
|
expect(spec.getUserSyncs({ iframeEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, {consentString: 'fooUsp'})).to.deep.equal([{
|
|
522
529
|
type: 'iframe', url: `${syncurlIframe}&gdpr=1&gdpr_consent=foo&ccpa_consent=fooUsp`
|
|
523
530
|
}]);
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec } from '../../../modules/pubCircleBidAdapter';
|
|
3
|
+
import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js';
|
|
4
|
+
import { getUniqueIdentifierStr } from '../../../src/utils.js';
|
|
5
|
+
|
|
6
|
+
const bidder = 'pubcircle'
|
|
7
|
+
|
|
8
|
+
describe('PubCircleBidAdapter', function () {
|
|
9
|
+
const bids = [
|
|
10
|
+
{
|
|
11
|
+
bidId: getUniqueIdentifierStr(),
|
|
12
|
+
bidder: bidder,
|
|
13
|
+
mediaTypes: {
|
|
14
|
+
[BANNER]: {
|
|
15
|
+
sizes: [[300, 250]]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
params: {
|
|
19
|
+
placementId: 'testBanner',
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
bidId: getUniqueIdentifierStr(),
|
|
24
|
+
bidder: bidder,
|
|
25
|
+
mediaTypes: {
|
|
26
|
+
[VIDEO]: {
|
|
27
|
+
playerSize: [[300, 300]],
|
|
28
|
+
minduration: 5,
|
|
29
|
+
maxduration: 60
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
params: {
|
|
33
|
+
placementId: 'testVideo',
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
bidId: getUniqueIdentifierStr(),
|
|
38
|
+
bidder: bidder,
|
|
39
|
+
mediaTypes: {
|
|
40
|
+
[NATIVE]: {
|
|
41
|
+
native: {
|
|
42
|
+
title: {
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
body: {
|
|
46
|
+
required: true
|
|
47
|
+
},
|
|
48
|
+
icon: {
|
|
49
|
+
required: true,
|
|
50
|
+
size: [64, 64]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
params: {
|
|
56
|
+
placementId: 'testNative',
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const invalidBid = {
|
|
62
|
+
bidId: getUniqueIdentifierStr(),
|
|
63
|
+
bidder: bidder,
|
|
64
|
+
mediaTypes: {
|
|
65
|
+
[BANNER]: {
|
|
66
|
+
sizes: [[300, 250]]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
params: {
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const bidderRequest = {
|
|
75
|
+
uspConsent: '1---',
|
|
76
|
+
gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw',
|
|
77
|
+
refererInfo: {
|
|
78
|
+
referer: 'https://test.com'
|
|
79
|
+
},
|
|
80
|
+
timeout: 500
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
describe('isBidRequestValid', function () {
|
|
84
|
+
it('Should return true if there are bidId, params and key parameters present', function () {
|
|
85
|
+
expect(spec.isBidRequestValid(bids[0])).to.be.true;
|
|
86
|
+
});
|
|
87
|
+
it('Should return false if at least one of parameters is not present', function () {
|
|
88
|
+
expect(spec.isBidRequestValid(invalidBid)).to.be.false;
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe('buildRequests', function () {
|
|
93
|
+
let serverRequest = spec.buildRequests(bids, bidderRequest);
|
|
94
|
+
|
|
95
|
+
it('Creates a ServerRequest object with method, URL and data', function () {
|
|
96
|
+
expect(serverRequest).to.exist;
|
|
97
|
+
expect(serverRequest.method).to.exist;
|
|
98
|
+
expect(serverRequest.url).to.exist;
|
|
99
|
+
expect(serverRequest.data).to.exist;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('Returns POST method', function () {
|
|
103
|
+
expect(serverRequest.method).to.equal('POST');
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('Returns valid URL', function () {
|
|
107
|
+
expect(serverRequest.url).to.equal('https://ml.pubcircle.ai/pbjs');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('Returns general data valid', function () {
|
|
111
|
+
let data = serverRequest.data;
|
|
112
|
+
expect(data).to.be.an('object');
|
|
113
|
+
expect(data).to.have.all.keys('deviceWidth',
|
|
114
|
+
'deviceHeight',
|
|
115
|
+
'language',
|
|
116
|
+
'secure',
|
|
117
|
+
'host',
|
|
118
|
+
'page',
|
|
119
|
+
'placements',
|
|
120
|
+
'coppa',
|
|
121
|
+
'ccpa',
|
|
122
|
+
'gdpr',
|
|
123
|
+
'tmax'
|
|
124
|
+
);
|
|
125
|
+
expect(data.deviceWidth).to.be.a('number');
|
|
126
|
+
expect(data.deviceHeight).to.be.a('number');
|
|
127
|
+
expect(data.language).to.be.a('string');
|
|
128
|
+
expect(data.secure).to.be.within(0, 1);
|
|
129
|
+
expect(data.host).to.be.a('string');
|
|
130
|
+
expect(data.page).to.be.a('string');
|
|
131
|
+
expect(data.coppa).to.be.a('number');
|
|
132
|
+
expect(data.gdpr).to.be.a('string');
|
|
133
|
+
expect(data.ccpa).to.be.a('string');
|
|
134
|
+
expect(data.tmax).to.be.a('number');
|
|
135
|
+
expect(data.placements).to.have.lengthOf(3);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('Returns valid placements', function () {
|
|
139
|
+
const { placements } = serverRequest.data;
|
|
140
|
+
for (let i = 0, len = placements.length; i < len; i++) {
|
|
141
|
+
const placement = placements[i];
|
|
142
|
+
expect(placement.placementId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']);
|
|
143
|
+
expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]);
|
|
144
|
+
expect(placement.bidId).to.be.a('string');
|
|
145
|
+
expect(placement.schain).to.be.an('object');
|
|
146
|
+
expect(placement.bidfloor).to.exist.and.to.equal(0);
|
|
147
|
+
expect(placement.type).to.exist.and.to.equal('publisher');
|
|
148
|
+
|
|
149
|
+
if (placement.adFormat === BANNER) {
|
|
150
|
+
expect(placement.sizes).to.be.an('array');
|
|
151
|
+
}
|
|
152
|
+
switch (placement.adFormat) {
|
|
153
|
+
case BANNER:
|
|
154
|
+
expect(placement.sizes).to.be.an('array');
|
|
155
|
+
break;
|
|
156
|
+
case VIDEO:
|
|
157
|
+
expect(placement.playerSize).to.be.an('array');
|
|
158
|
+
expect(placement.minduration).to.be.an('number');
|
|
159
|
+
expect(placement.maxduration).to.be.an('number');
|
|
160
|
+
break;
|
|
161
|
+
case NATIVE:
|
|
162
|
+
expect(placement.native).to.be.an('object');
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('Returns data with gdprConsent and without uspConsent', function () {
|
|
169
|
+
delete bidderRequest.uspConsent;
|
|
170
|
+
serverRequest = spec.buildRequests(bids, bidderRequest);
|
|
171
|
+
let data = serverRequest.data;
|
|
172
|
+
expect(data.gdpr).to.exist;
|
|
173
|
+
expect(data.gdpr).to.be.a('string');
|
|
174
|
+
expect(data.gdpr).to.equal(bidderRequest.gdprConsent);
|
|
175
|
+
expect(data.ccpa).to.not.exist;
|
|
176
|
+
delete bidderRequest.gdprConsent;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('Returns data with uspConsent and without gdprConsent', function () {
|
|
180
|
+
bidderRequest.uspConsent = '1---';
|
|
181
|
+
delete bidderRequest.gdprConsent;
|
|
182
|
+
serverRequest = spec.buildRequests(bids, bidderRequest);
|
|
183
|
+
let data = serverRequest.data;
|
|
184
|
+
expect(data.ccpa).to.exist;
|
|
185
|
+
expect(data.ccpa).to.be.a('string');
|
|
186
|
+
expect(data.ccpa).to.equal(bidderRequest.uspConsent);
|
|
187
|
+
expect(data.gdpr).to.not.exist;
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('Returns empty data if no valid requests are passed', function () {
|
|
191
|
+
serverRequest = spec.buildRequests([], bidderRequest);
|
|
192
|
+
let data = serverRequest.data;
|
|
193
|
+
expect(data.placements).to.be.an('array').that.is.empty;
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
describe('interpretResponse', function () {
|
|
198
|
+
it('Should interpret banner response', function () {
|
|
199
|
+
const banner = {
|
|
200
|
+
body: [{
|
|
201
|
+
mediaType: 'banner',
|
|
202
|
+
width: 300,
|
|
203
|
+
height: 250,
|
|
204
|
+
cpm: 0.4,
|
|
205
|
+
ad: 'Test',
|
|
206
|
+
requestId: '23fhj33i987f',
|
|
207
|
+
ttl: 120,
|
|
208
|
+
creativeId: '2',
|
|
209
|
+
netRevenue: true,
|
|
210
|
+
currency: 'USD',
|
|
211
|
+
dealId: '1',
|
|
212
|
+
meta: {
|
|
213
|
+
advertiserDomains: ['google.com'],
|
|
214
|
+
advertiserId: 1234
|
|
215
|
+
}
|
|
216
|
+
}]
|
|
217
|
+
};
|
|
218
|
+
let bannerResponses = spec.interpretResponse(banner);
|
|
219
|
+
expect(bannerResponses).to.be.an('array').that.is.not.empty;
|
|
220
|
+
let dataItem = bannerResponses[0];
|
|
221
|
+
expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId',
|
|
222
|
+
'netRevenue', 'currency', 'dealId', 'mediaType', 'meta');
|
|
223
|
+
expect(dataItem.requestId).to.equal(banner.body[0].requestId);
|
|
224
|
+
expect(dataItem.cpm).to.equal(banner.body[0].cpm);
|
|
225
|
+
expect(dataItem.width).to.equal(banner.body[0].width);
|
|
226
|
+
expect(dataItem.height).to.equal(banner.body[0].height);
|
|
227
|
+
expect(dataItem.ad).to.equal(banner.body[0].ad);
|
|
228
|
+
expect(dataItem.ttl).to.equal(banner.body[0].ttl);
|
|
229
|
+
expect(dataItem.creativeId).to.equal(banner.body[0].creativeId);
|
|
230
|
+
expect(dataItem.netRevenue).to.be.true;
|
|
231
|
+
expect(dataItem.currency).to.equal(banner.body[0].currency);
|
|
232
|
+
expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains');
|
|
233
|
+
});
|
|
234
|
+
it('Should interpret video response', function () {
|
|
235
|
+
const video = {
|
|
236
|
+
body: [{
|
|
237
|
+
vastUrl: 'test.com',
|
|
238
|
+
mediaType: 'video',
|
|
239
|
+
cpm: 0.5,
|
|
240
|
+
requestId: '23fhj33i987f',
|
|
241
|
+
ttl: 120,
|
|
242
|
+
creativeId: '2',
|
|
243
|
+
netRevenue: true,
|
|
244
|
+
currency: 'USD',
|
|
245
|
+
dealId: '1',
|
|
246
|
+
meta: {
|
|
247
|
+
advertiserDomains: ['google.com'],
|
|
248
|
+
advertiserId: 1234
|
|
249
|
+
}
|
|
250
|
+
}]
|
|
251
|
+
};
|
|
252
|
+
let videoResponses = spec.interpretResponse(video);
|
|
253
|
+
expect(videoResponses).to.be.an('array').that.is.not.empty;
|
|
254
|
+
|
|
255
|
+
let dataItem = videoResponses[0];
|
|
256
|
+
expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId',
|
|
257
|
+
'netRevenue', 'currency', 'dealId', 'mediaType', 'meta');
|
|
258
|
+
expect(dataItem.requestId).to.equal('23fhj33i987f');
|
|
259
|
+
expect(dataItem.cpm).to.equal(0.5);
|
|
260
|
+
expect(dataItem.vastUrl).to.equal('test.com');
|
|
261
|
+
expect(dataItem.ttl).to.equal(120);
|
|
262
|
+
expect(dataItem.creativeId).to.equal('2');
|
|
263
|
+
expect(dataItem.netRevenue).to.be.true;
|
|
264
|
+
expect(dataItem.currency).to.equal('USD');
|
|
265
|
+
expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains');
|
|
266
|
+
});
|
|
267
|
+
it('Should interpret native response', function () {
|
|
268
|
+
const native = {
|
|
269
|
+
body: [{
|
|
270
|
+
mediaType: 'native',
|
|
271
|
+
native: {
|
|
272
|
+
clickUrl: 'test.com',
|
|
273
|
+
title: 'Test',
|
|
274
|
+
image: 'test.com',
|
|
275
|
+
impressionTrackers: ['test.com'],
|
|
276
|
+
},
|
|
277
|
+
ttl: 120,
|
|
278
|
+
cpm: 0.4,
|
|
279
|
+
requestId: '23fhj33i987f',
|
|
280
|
+
creativeId: '2',
|
|
281
|
+
netRevenue: true,
|
|
282
|
+
currency: 'USD',
|
|
283
|
+
meta: {
|
|
284
|
+
advertiserDomains: ['google.com'],
|
|
285
|
+
advertiserId: 1234
|
|
286
|
+
}
|
|
287
|
+
}]
|
|
288
|
+
};
|
|
289
|
+
let nativeResponses = spec.interpretResponse(native);
|
|
290
|
+
expect(nativeResponses).to.be.an('array').that.is.not.empty;
|
|
291
|
+
|
|
292
|
+
let dataItem = nativeResponses[0];
|
|
293
|
+
expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native', 'meta');
|
|
294
|
+
expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image')
|
|
295
|
+
expect(dataItem.requestId).to.equal('23fhj33i987f');
|
|
296
|
+
expect(dataItem.cpm).to.equal(0.4);
|
|
297
|
+
expect(dataItem.native.clickUrl).to.equal('test.com');
|
|
298
|
+
expect(dataItem.native.title).to.equal('Test');
|
|
299
|
+
expect(dataItem.native.image).to.equal('test.com');
|
|
300
|
+
expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty;
|
|
301
|
+
expect(dataItem.native.impressionTrackers[0]).to.equal('test.com');
|
|
302
|
+
expect(dataItem.ttl).to.equal(120);
|
|
303
|
+
expect(dataItem.creativeId).to.equal('2');
|
|
304
|
+
expect(dataItem.netRevenue).to.be.true;
|
|
305
|
+
expect(dataItem.currency).to.equal('USD');
|
|
306
|
+
expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains');
|
|
307
|
+
});
|
|
308
|
+
it('Should return an empty array if invalid banner response is passed', function () {
|
|
309
|
+
const invBanner = {
|
|
310
|
+
body: [{
|
|
311
|
+
width: 300,
|
|
312
|
+
cpm: 0.4,
|
|
313
|
+
ad: 'Test',
|
|
314
|
+
requestId: '23fhj33i987f',
|
|
315
|
+
ttl: 120,
|
|
316
|
+
creativeId: '2',
|
|
317
|
+
netRevenue: true,
|
|
318
|
+
currency: 'USD',
|
|
319
|
+
dealId: '1'
|
|
320
|
+
}]
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
let serverResponses = spec.interpretResponse(invBanner);
|
|
324
|
+
expect(serverResponses).to.be.an('array').that.is.empty;
|
|
325
|
+
});
|
|
326
|
+
it('Should return an empty array if invalid video response is passed', function () {
|
|
327
|
+
const invVideo = {
|
|
328
|
+
body: [{
|
|
329
|
+
mediaType: 'video',
|
|
330
|
+
cpm: 0.5,
|
|
331
|
+
requestId: '23fhj33i987f',
|
|
332
|
+
ttl: 120,
|
|
333
|
+
creativeId: '2',
|
|
334
|
+
netRevenue: true,
|
|
335
|
+
currency: 'USD',
|
|
336
|
+
dealId: '1'
|
|
337
|
+
}]
|
|
338
|
+
};
|
|
339
|
+
let serverResponses = spec.interpretResponse(invVideo);
|
|
340
|
+
expect(serverResponses).to.be.an('array').that.is.empty;
|
|
341
|
+
});
|
|
342
|
+
it('Should return an empty array if invalid native response is passed', function () {
|
|
343
|
+
const invNative = {
|
|
344
|
+
body: [{
|
|
345
|
+
mediaType: 'native',
|
|
346
|
+
clickUrl: 'test.com',
|
|
347
|
+
title: 'Test',
|
|
348
|
+
impressionTrackers: ['test.com'],
|
|
349
|
+
ttl: 120,
|
|
350
|
+
requestId: '23fhj33i987f',
|
|
351
|
+
creativeId: '2',
|
|
352
|
+
netRevenue: true,
|
|
353
|
+
currency: 'USD',
|
|
354
|
+
}]
|
|
355
|
+
};
|
|
356
|
+
let serverResponses = spec.interpretResponse(invNative);
|
|
357
|
+
expect(serverResponses).to.be.an('array').that.is.empty;
|
|
358
|
+
});
|
|
359
|
+
it('Should return an empty array if invalid response is passed', function () {
|
|
360
|
+
const invalid = {
|
|
361
|
+
body: [{
|
|
362
|
+
ttl: 120,
|
|
363
|
+
creativeId: '2',
|
|
364
|
+
netRevenue: true,
|
|
365
|
+
currency: 'USD',
|
|
366
|
+
dealId: '1'
|
|
367
|
+
}]
|
|
368
|
+
};
|
|
369
|
+
let serverResponses = spec.interpretResponse(invalid);
|
|
370
|
+
expect(serverResponses).to.be.an('array').that.is.empty;
|
|
371
|
+
});
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
describe('getUserSyncs', function() {
|
|
375
|
+
it('Should return array of objects with proper sync config , include GDPR', function() {
|
|
376
|
+
const syncData = spec.getUserSyncs({}, {}, {
|
|
377
|
+
consentString: 'ALL',
|
|
378
|
+
gdprApplies: true,
|
|
379
|
+
}, {});
|
|
380
|
+
expect(syncData).to.be.an('array').which.is.not.empty;
|
|
381
|
+
expect(syncData[0]).to.be.an('object')
|
|
382
|
+
expect(syncData[0].type).to.be.a('string')
|
|
383
|
+
expect(syncData[0].type).to.equal('image')
|
|
384
|
+
expect(syncData[0].url).to.be.a('string')
|
|
385
|
+
expect(syncData[0].url).to.equal('https://cs.pubcircle.ai/image?pbjs=1&gdpr=1&gdpr_consent=ALL&coppa=0')
|
|
386
|
+
});
|
|
387
|
+
it('Should return array of objects with proper sync config , include CCPA', function() {
|
|
388
|
+
const syncData = spec.getUserSyncs({}, {}, {}, {
|
|
389
|
+
consentString: '1---'
|
|
390
|
+
});
|
|
391
|
+
expect(syncData).to.be.an('array').which.is.not.empty;
|
|
392
|
+
expect(syncData[0]).to.be.an('object')
|
|
393
|
+
expect(syncData[0].type).to.be.a('string')
|
|
394
|
+
expect(syncData[0].type).to.equal('image')
|
|
395
|
+
expect(syncData[0].url).to.be.a('string')
|
|
396
|
+
expect(syncData[0].url).to.equal('https://cs.pubcircle.ai/image?pbjs=1&ccpa_consent=1---&coppa=0')
|
|
397
|
+
});
|
|
398
|
+
});
|
|
399
|
+
});
|
|
@@ -466,4 +466,23 @@ describe('Tappx bid adapter', function () {
|
|
|
466
466
|
assert.isString(_extractPageUrl(validBidRequests, bidderRequest));
|
|
467
467
|
});
|
|
468
468
|
})
|
|
469
|
+
|
|
470
|
+
describe('Empty params values from bid tests', function() {
|
|
471
|
+
let validBidRequest = JSON.parse(JSON.stringify(c_BIDREQUEST));
|
|
472
|
+
|
|
473
|
+
it('should return false when tappxkey is empty', function () {
|
|
474
|
+
validBidRequest.bids[0].params.tappxkey = '';
|
|
475
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
it('should return false when host is empty', function () {
|
|
479
|
+
validBidRequest.bids[0].params.host = '';
|
|
480
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
it('should return false when endpoint is empty', function () {
|
|
484
|
+
validBidRequest.bids[0].params.endpoint = '';
|
|
485
|
+
assert.isFalse(spec.isBidRequestValid(validBidRequest.bids[0]));
|
|
486
|
+
});
|
|
487
|
+
});
|
|
469
488
|
});
|