Skip to content

Commit

Permalink
Merge pull request #9 from prebid/master
Browse files Browse the repository at this point in the history
Sync with prebid master
  • Loading branch information
pm-nitin-shirsat committed Sep 12, 2023
2 parents 6a72e8c + a81323f commit 2432d2f
Show file tree
Hide file tree
Showing 86 changed files with 5,108 additions and 730 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue_tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
uses: tibdex/github-app-token@0914d50df753bbc42180d982a6550f195390069f
with:
app_id: ${{ secrets.ISSUE_APP_ID }}
private_key: ${{ secrets.ISSUE_APP_PEM }}
Expand Down
1 change: 0 additions & 1 deletion modules/adkernelBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const spec = {
{code: 'displayioads'},
{code: 'rtbdemand_com'},
{code: 'bidbuddy'},
{code: 'adliveconnect'},
{code: 'didnadisplay'},
{code: 'qortex'},
{code: 'adpluto'},
Expand Down
12 changes: 0 additions & 12 deletions modules/adtelligentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@ const HOST_GETTERS = {
return 'ghb' + subdomainSuffixes[num++ % subdomainSuffixes.length] + '.adtelligent.com';
}
}()),
navelix: () => 'ghb.hb.navelix.com',
appaloosa: () => 'ghb.hb.appaloosa.media',
onefiftytwomedia: () => 'ghb.ads.152media.com',
bidsxchange: () => 'ghb.hbd.bidsxchange.com',
streamkey: () => 'ghb.hb.streamkey.net',
janet: () => 'ghb.bidder.jmgads.com',
pgam: () => 'ghb.pgamssp.com',
ocm: () => 'ghb.cenarius.orangeclickmedia.com',
vidcrunchllc: () => 'ghb.platform.vidcrunch.com',
'9dotsmedia': () => 'ghb.platform.audiodots.com',
copper6: () => 'ghb.app.copper6.com'
}
Expand All @@ -42,16 +36,10 @@ export const spec = {
code: BIDDER_CODE,
gvlid: 410,
aliases: [
'onefiftytwomedia',
'appaloosa',
'bidsxchange',
'streamkey',
'janet',
{ code: 'selectmedia', gvlid: 775 },
{ code: 'navelix', gvlid: 380 },
'pgam',
{ code: 'ocm', gvlid: 1148 },
{ code: 'vidcrunchllc', gvlid: 1145 },
'9dotsmedia',
'copper6',
],
Expand Down
45 changes: 42 additions & 3 deletions modules/bliinkBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const META_DESCRIPTION = 'description'

const VIDEO = 'video'
const BANNER = 'banner'

window.bliinkBid = window.bliinkBid || {};
const supportedMediaTypes = [BANNER, VIDEO]
const aliasBidderCode = ['bk']

Expand All @@ -23,6 +23,37 @@ function getCoppa() {
return config.getConfig('coppa') === true ? 1 : 0;
}

/**
* Retrieves the effective connection type from the browser's Navigator API.
* @returns {string} The effective connection type or 'unsupported' if unavailable.
*/
export function getEffectiveConnectionType() {
/**
* The effective connection type obtained from the browser's Navigator API.
* @type {string|undefined}
*/
const navigatorEffectiveType = navigator?.connection?.effectiveType;

if (navigatorEffectiveType) {
return navigatorEffectiveType;
}

return 'unsupported';
}

/**
* Retrieves the user IDs as EIDs from the first valid bid request.
*
* @param {Array} validBidRequests - Array of valid bid requests
* @returns {Array|undefined} - Array of user IDs as EIDs, or undefined if not found
*/
export function getUserIds(validBidRequests) {
/** @type {Object} */
const firstBidRequest = validBidRequests?.[0]
if (firstBidRequest?.userIds) {
return firstBidRequest.userIds
}
}
export function getMetaList(name) {
if (!name || name.length === 0) return []

Expand Down Expand Up @@ -151,13 +182,16 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
if (!validBidRequests || !bidderRequest || !bidderRequest.bids) return null

const tags = bidderRequest.bids.map((bid) => {
const id = bid.params.tagId
return {
sizes: bid.sizes.map((size) => ({ w: size[0], h: size[1] })),
id: bid.params.tagId,
id,
// TODO: bidId is globally unique, is it a good choice for transaction ID (vs ortb2Imp.ext.tid)?
transactionId: bid.bidId,
mediaTypes: Object.keys(bid.mediaTypes),
imageUrl: deepAccess(bid, 'params.imageUrl', ''),
videoUrl: deepAccess(bid, 'params.videoUrl', ''),
refresh: (window.bliinkBid[id] = (window.bliinkBid[id] ?? -1) + 1) || undefined,
};
});

Expand All @@ -167,11 +201,17 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
pageUrl: deepAccess(bidderRequest, 'refererInfo.page'),
pageDescription: getMetaValue(META_DESCRIPTION),
keywords: getKeywords().join(','),
ect: getEffectiveConnectionType(),
};

const schain = deepAccess(validBidRequests[0], 'schain')
const userIds = getUserIds(validBidRequests)
if (schain) {
request.schain = schain
}
if (userIds) {
request.userIds = userIds
}
const gdprConsent = deepAccess(bidderRequest, 'gdprConsent');
if (!!gdprConsent && gdprConsent.gdprApplies) {
request.gdpr = true
Expand All @@ -183,7 +223,6 @@ export const buildRequests = (validBidRequests, bidderRequest) => {
if (bidderRequest.uspConsent) {
deepSetValue(request, 'uspConsent', bidderRequest.uspConsent);
}

return {
method: 'POST',
url: BLIINK_ENDPOINT_ENGINE,
Expand Down
9 changes: 9 additions & 0 deletions modules/boldwinBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ export const spec = {
if (bidderRequest.gdprConsent) {
request.gdpr = bidderRequest.gdprConsent;
}

// Add GPP consent
if (bidderRequest.gppConsent) {
request.gpp = bidderRequest.gppConsent.gppString;
request.gpp_sid = bidderRequest.gppConsent.applicableSections;
} else if (bidderRequest.ortb2?.regs?.gpp) {
request.gpp = bidderRequest.ortb2.regs.gpp;
request.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
}
}
const len = validBidRequests.length;

Expand Down
10 changes: 9 additions & 1 deletion modules/cadentApertureMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ export const spec = {
}
return cadentBidResponses;
},
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent) {
getUserSyncs: function (syncOptions, responses, gdprConsent, uspConsent, gppConsent) {
const syncs = [];
const consentParams = [];
if (syncOptions.iframeEnabled) {
Expand All @@ -390,6 +390,14 @@ export const spec = {
if (uspConsent && typeof uspConsent.consentString === 'string') {
consentParams.push(`usp=${uspConsent.consentString}`);
}
if (gppConsent && typeof gppConsent === 'object') {
if (gppConsent.gppString && typeof gppConsent.gppString === 'string') {
consentParams.push(`gpp=${gppConsent.gppString}`);
}
if (gppConsent.applicableSections && typeof gppConsent.applicableSections === 'object') {
consentParams.push(`gpp_sid=${gppConsent.applicableSections}`);
}
}
if (consentParams.length > 0) {
url = url + '?' + consentParams.join('&');
}
Expand Down
2 changes: 1 addition & 1 deletion modules/coinzillaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const spec = {
dealId: dealId,
currency: currency,
netRevenue: netRevenue,
ttl: bidRequest.timeout,
ttl: response.timeout,
referrer: referrer,
ad: response.ad,
mediaType: response.mediaType,
Expand Down
2 changes: 1 addition & 1 deletion modules/consentManagementGpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class GPP10Client extends GPPClient {

getGPPData(pingData) {
const parsedSections = GreedyPromise.all(
pingData.supportedAPIs.map((api) => this.cmp({
(pingData.supportedAPIs || pingData.apiSupport || []).map((api) => this.cmp({
command: 'getSection',
parameter: api
}).catch(err => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import {
deepAccess,
deepSetValue,
isArray,
logInfo,
deepAccess,
logError,
isFn,
isNumber,
isPlainObject,
isStr,
logError,
logInfo,
logMessage
isNumber,
isArray, logMessage
} from '../src/utils.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';
import {BANNER, VIDEO} from '../src/mediaTypes.js';

const BIDDER_CODE = 'kulturemedia';
const BIDDER_CODE = 'dxkulture';
const DEFAULT_BID_TTL = 300;
const DEFAULT_CURRENCY = 'USD';
const DEFAULT_NET_REVENUE = true;
Expand Down Expand Up @@ -134,13 +133,13 @@ export const spec = {
}
})
} else {
logInfo('kulturemedia.interpretResponse :: no valid responses to interpret');
logInfo('dxkulture.interpretResponse :: no valid responses to interpret');
}
return bidResponses;
},

getUserSyncs: function (syncOptions, serverResponses) {
logInfo('kulturemedia.getUserSyncs', 'syncOptions', syncOptions, 'serverResponses', serverResponses);
logInfo('dxkulture.getUserSyncs', 'syncOptions', syncOptions, 'serverResponses', serverResponses);
let syncs = [];

if (!syncOptions.iframeEnabled && !syncOptions.pixelEnabled) {
Expand Down Expand Up @@ -172,7 +171,7 @@ export const spec = {
}
}
});
logInfo('kulturemedia.getUserSyncs result=%o', syncs);
logInfo('dxkulture.getUserSyncs result=%o', syncs);
return syncs;
},

Expand Down Expand Up @@ -392,7 +391,7 @@ function buildVideoRequestData(bidRequest, bidderRequest) {
videoParams.content[contentKey].every(catStr => isStr(catStr)))) {
openrtbRequest.site.content[contentKey] = videoParams.content[contentKey];
} else {
logMessage('KultureMedia bid adapter validation error: ', contentKey, ' is either not supported is OpenRTB V2.5 or value is undefined');
logMessage('DXKulture bid adapter validation error: ', contentKey, ' is either not supported is OpenRTB V2.5 or value is undefined');
}
}
}
Expand Down Expand Up @@ -424,7 +423,7 @@ function buildBannerRequestData(bidRequests, bidderRequest) {
}));

const openrtbRequest = {
id: bidderRequest.bidderRequestId,
id: bidderRequest.auctionId,
imp: impr,
site: {
domain: bidderRequest.refererInfo?.domain,
Expand All @@ -441,6 +440,7 @@ function _createBidResponse(bid) {
bid.adomain && bid.adomain.length;
const bidResponse = {
requestId: bid.impid,
bidderCode: spec.code,
cpm: bid.price,
width: bid.w,
height: bid.h,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overview

```
Module Name: Kulture Media Bid Adapter
Module Name: DXKulture Bid Adapter
Module Type: Bidder Adapter
Maintainer: [email protected]
```

# Description

Module that connects to Kulture Media's demand sources.
Kulture Media bid adapter supports Banner and Video.
Module that connects to DXKulture's demand sources.
DXKulture bid adapter supports Banner and Video.


# Test Parameters
Expand All @@ -26,10 +26,11 @@ var adUnits = [
}
},
bids: [{
bidder: 'kulturemedia',
bidder: 'dxkulture',
params: {
placementId: 'test',
publisherId: 'test',
networkId: '123'
}
}]
}
Expand Down Expand Up @@ -79,11 +80,12 @@ We support the following OpenRTB params that can be specified in `mediaTypes.vid
},
bids: [
{
bidder: 'kulturemedia',
bidder: 'dxkulture',
params: {
bidfloor: 0.5,
publisherId: '12345',
placementId: '6789'
placementId: '6789',
networkId" '123'
}
}
]
Expand All @@ -105,7 +107,7 @@ var adUnits = [
}
},
bids: [{
bidder: 'kulturemedia',
bidder: 'dxkulture',
params: {
e2etest: true
}
Expand All @@ -129,7 +131,7 @@ var adUnits = [
},
bids: [
{
bidder: 'kulturemedia',
bidder: 'dxkulture',
params: {
e2etest: true
}
Expand Down
19 changes: 17 additions & 2 deletions modules/eplanningBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,21 @@ function cleanName(name) {
return name.replace(/_|\.|-|\//g, '').replace(/\)\(|\(|\)|:/g, '_').replace(/^_+|_+$/g, '');
}

function getFloorStr(bid) {
if (typeof bid.getFloor === 'function') {
let bidFloor = bid.getFloor({
currency: DOLLAR_CODE,
mediaType: '*',
size: '*'
});

if (bidFloor.floor) {
return '|' + encodeURIComponent(bidFloor.floor);
}
}
return '';
}

function getSpaces(bidRequests, ml) {
let impType = bidRequests.reduce((previousBits, bid) => (bid.mediaTypes && bid.mediaTypes[VIDEO]) ? (bid.mediaTypes[VIDEO].context == 'outstream' ? (previousBits | 2) : (previousBits | 1)) : previousBits, 0);
// Only one type of auction is supported at a time
Expand All @@ -286,7 +301,7 @@ function getSpaces(bidRequests, ml) {
let sizeVast = firstSize ? firstSize.join('x') : DEFAULT_SIZE_VAST;
name = 'video_' + sizeVast + '_' + i;
es.map[name] = bid.bidId;
return name + ':' + sizeVast + ';1';
return name + ':' + sizeVast + ';1' + getFloorStr(bid);
}

if (ml) {
Expand All @@ -296,7 +311,7 @@ function getSpaces(bidRequests, ml) {
}

es.map[name] = bid.bidId;
return name + ':' + getSize(bid);
return name + ':' + getSize(bid) + getFloorStr(bid);
}).join('+')).join('+');
return es;
}
Expand Down
Loading

0 comments on commit 2432d2f

Please sign in to comment.