Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Bid/Analytics/ID Adapters: import utils functions as needed and not the whole module #7479

Merged
merged 83 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
33762d1
added support for pubcommon, digitrust, id5id
pm-harshad-mane Sep 12, 2019
0722354
added support for IdentityLink
pm-harshad-mane Sep 13, 2019
f2c32c0
changed the source for id5
pm-harshad-mane Sep 13, 2019
37163d1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 13, 2019
eaed987
added unit test cases
pm-harshad-mane Sep 13, 2019
602ee7e
changed source param for identityLink
pm-harshad-mane Sep 16, 2019
b6fcd36
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2019
58381f3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 26, 2019
c9fb11b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 10, 2019
8ece7fd
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
28d12a0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 16, 2019
05a55e1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 31, 2019
e8b10d5
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 5, 2019
870085f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
844ce4e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 12, 2019
704eca3
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Nov 13, 2019
2565cb9
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
1d75bd4
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 4, 2019
6adde1e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 6, 2019
477c98a
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 9, 2019
cef5422
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 10, 2019
c110a7d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 9, 2020
e8fb062
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 5, 2020
d77cd71
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 17, 2020
817ce3f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 24, 2020
cda825e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 26, 2020
f34a3ec
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 27, 2020
f106dc8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 4, 2020
1f6937e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
06ffe84
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
5448ceb
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 6, 2020
e9b90fe
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 11, 2020
a7a1d12
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 11, 2020
30b72df
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 26, 2020
76adbc9
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
50e13bc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
a1c7ca1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 30, 2020
96fbadc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 1, 2020
4b026e2
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 9, 2020
38740bc
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 10, 2020
9daf778
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 20, 2020
eff8828
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 21, 2020
ede95de
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 21, 2020
c98f1a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 23, 2020
312da6d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane May 18, 2020
d92972c
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 1, 2020
fd4fb2e
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 26, 2020
e551136
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 30, 2020
cfdca3c
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jul 7, 2020
22505ff
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jul 28, 2020
795a54a
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 10, 2020
433c98b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 3, 2020
a0521ac
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2020
635fe74
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 25, 2020
2759212
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Oct 12, 2020
84737d8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
df5fada
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
9ab7840
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Dec 2, 2020
ed4b566
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 8, 2021
f57d220
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jan 20, 2021
6a6d1f4
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 9, 2021
3650c9d
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 10, 2021
85c9d49
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 18, 2021
ca82340
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Feb 23, 2021
12e8f47
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 8, 2021
5d024e7
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Mar 15, 2021
4c87d00
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Apr 22, 2021
93ea6ca
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane May 6, 2021
1eaefc8
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 2, 2021
cd4a279
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Jun 7, 2021
4e9ff9f
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 6, 2021
f971232
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Aug 11, 2021
24b2cd0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 6, 2021
6d3d8a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 10, 2021
ae6dbb2
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 21, 2021
a691bc0
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2021
bb3ceb1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 23, 2021
05b7793
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
51755a1
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
64fdc3b
Merge remote-tracking branch 'upstream/master'
pm-harshad-mane Sep 24, 2021
bc6c9f6
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
ef500ab
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
7e3fa3f
import utils functions as needed and not the whole module
pm-harshad-mane Sep 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions modules/apacdexBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as utils from '../src/utils.js';
import { deepAccess, isPlainObject, isArray, replaceAuctionPrice, isFn } from '../src/utils.js';
import { config } from '../src/config.js';
import { registerBidder } from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'apacdex';
Expand Down Expand Up @@ -32,16 +32,16 @@ export const spec = {
if (!bid.params.siteId && !bid.params.placementId) {
return false;
}
if (!utils.deepAccess(bid, 'mediaTypes.banner') && !utils.deepAccess(bid, 'mediaTypes.video')) {
if (!deepAccess(bid, 'mediaTypes.banner') && !deepAccess(bid, 'mediaTypes.video')) {
return false;
}
if (utils.deepAccess(bid, 'mediaTypes.banner')) { // Not support multi type bids, favor banner over video
if (!utils.deepAccess(bid, 'mediaTypes.banner.sizes')) {
if (deepAccess(bid, 'mediaTypes.banner')) { // Not support multi type bids, favor banner over video
if (!deepAccess(bid, 'mediaTypes.banner.sizes')) {
// sizes at the banner is required.
return false;
}
} else if (utils.deepAccess(bid, 'mediaTypes.video')) {
if (!utils.deepAccess(bid, 'mediaTypes.video.playerSize')) {
} else if (deepAccess(bid, 'mediaTypes.video')) {
if (!deepAccess(bid, 'mediaTypes.video.playerSize')) {
// playerSize is required for instream adUnits.
return false;
}
Expand Down Expand Up @@ -170,12 +170,12 @@ export const spec = {
},
interpretResponse: function (serverResponse, bidRequest) {
const serverBody = serverResponse.body;
if (!serverBody || !utils.isPlainObject(serverBody)) {
if (!serverBody || !isPlainObject(serverBody)) {
return [];
}

const serverBids = serverBody.bids;
if (!serverBids || !utils.isArray(serverBids)) {
if (!serverBids || !isArray(serverBids)) {
return [];
}

Expand All @@ -197,12 +197,12 @@ export const spec = {
bidResponse.dealId = dealId;
}
if (bid.vastXml) {
bidResponse.vastXml = utils.replaceAuctionPrice(bid.vastXml, bid.cpm);
bidResponse.vastXml = replaceAuctionPrice(bid.vastXml, bid.cpm);
} else {
bidResponse.ad = utils.replaceAuctionPrice(bid.ad, bid.cpm);
bidResponse.ad = replaceAuctionPrice(bid.ad, bid.cpm);
}
bidResponse.meta = {};
if (bid.meta && bid.meta.advertiserDomains && utils.isArray(bid.meta.advertiserDomains)) {
if (bid.meta && bid.meta.advertiserDomains && isArray(bid.meta.advertiserDomains)) {
bidResponse.meta.advertiserDomains = bid.meta.advertiserDomains;
}
bidResponses.push(bidResponse);
Expand Down Expand Up @@ -285,7 +285,7 @@ function _extractTopWindowUrlFromBidderRequest(bidderRequest) {
if (config.getConfig('pageUrl')) {
return config.getConfig('pageUrl');
}
if (utils.deepAccess(bidderRequest, 'refererInfo.referer')) {
if (deepAccess(bidderRequest, 'refererInfo.referer')) {
return bidderRequest.refererInfo.referer;
}

Expand All @@ -303,7 +303,7 @@ function _extractTopWindowUrlFromBidderRequest(bidderRequest) {
* @returns {string}
*/
function _extractTopWindowReferrerFromBidderRequest(bidderRequest) {
if (bidderRequest && utils.deepAccess(bidderRequest, 'refererInfo.referer')) {
if (bidderRequest && deepAccess(bidderRequest, 'refererInfo.referer')) {
return bidderRequest.refererInfo.referer;
}

Expand Down Expand Up @@ -340,7 +340,7 @@ export function getDomain(pageUrl) {
* @returns {boolean}
*/
export function validateGeoObject(geo) {
if (!utils.isPlainObject(geo)) {
if (!isPlainObject(geo)) {
return false;
}
if (!geo.lat) {
Expand All @@ -362,7 +362,7 @@ export function validateGeoObject(geo) {
* @returns {float||null}
*/
function getBidFloor(bid) {
if (!utils.isFn(bid.getFloor)) {
if (!isFn(bid.getFloor)) {
return (bid.params.floorPrice) ? bid.params.floorPrice : null;
}

Expand All @@ -371,7 +371,7 @@ function getBidFloor(bid) {
mediaType: '*',
size: '*'
});
if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
return floor.floor;
}
return null;
Expand Down
Loading