From 4b00f6119bc4b9f639c57c02edc69003736ff662 Mon Sep 17 00:00:00 2001 From: dani-nova <73398187+dani-nova@users.noreply.github.com> Date: Mon, 28 Aug 2023 21:26:23 +0200 Subject: [PATCH] kulturemedia bid adapter: rebrand to dxkulture (#10358) * Initial implementation of kulturemedia bid adapter * Changing outstream to instream * Enriching md file with test examples * Changing nId to networkId * Cleaning up md file * Submitting rebranded dxkultureBidAdapter --------- Co-authored-by: kmdevops --- ...iaBidAdapter.js => dxkultureBidAdapter.js} | 24 +++++++-------- ...iaBidAdapter.md => dxkultureBidAdapter.md} | 18 +++++++----- ...er_spec.js => dxkultureBidAdapter_spec.js} | 29 ++++++++++--------- 3 files changed, 37 insertions(+), 34 deletions(-) rename modules/{kulturemediaBidAdapter.js => dxkultureBidAdapter.js} (96%) rename modules/{kulturemediaBidAdapter.md => dxkultureBidAdapter.md} (87%) rename test/spec/modules/{kulturemediaBidAdapter_spec.js => dxkultureBidAdapter_spec.js} (97%) diff --git a/modules/kulturemediaBidAdapter.js b/modules/dxkultureBidAdapter.js similarity index 96% rename from modules/kulturemediaBidAdapter.js rename to modules/dxkultureBidAdapter.js index fb3f6e4e231..2e6f6c77b85 100644 --- a/modules/kulturemediaBidAdapter.js +++ b/modules/dxkultureBidAdapter.js @@ -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; @@ -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) { @@ -172,7 +171,7 @@ export const spec = { } } }); - logInfo('kulturemedia.getUserSyncs result=%o', syncs); + logInfo('dxkulture.getUserSyncs result=%o', syncs); return syncs; }, @@ -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'); } } } @@ -424,7 +423,7 @@ function buildBannerRequestData(bidRequests, bidderRequest) { })); const openrtbRequest = { - id: bidderRequest.bidderRequestId, + id: bidderRequest.auctionId, imp: impr, site: { domain: bidderRequest.refererInfo?.domain, @@ -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, diff --git a/modules/kulturemediaBidAdapter.md b/modules/dxkultureBidAdapter.md similarity index 87% rename from modules/kulturemediaBidAdapter.md rename to modules/dxkultureBidAdapter.md index 0bd17e97982..e934aee3301 100644 --- a/modules/kulturemediaBidAdapter.md +++ b/modules/dxkultureBidAdapter.md @@ -1,15 +1,15 @@ # Overview ``` -Module Name: Kulture Media Bid Adapter +Module Name: DXKulture Bid Adapter Module Type: Bidder Adapter Maintainer: devops@kulture.media ``` # 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 @@ -26,10 +26,11 @@ var adUnits = [ } }, bids: [{ - bidder: 'kulturemedia', + bidder: 'dxkulture', params: { placementId: 'test', publisherId: 'test', + networkId: '123' } }] } @@ -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' } } ] @@ -105,7 +107,7 @@ var adUnits = [ } }, bids: [{ - bidder: 'kulturemedia', + bidder: 'dxkulture', params: { e2etest: true } @@ -129,7 +131,7 @@ var adUnits = [ }, bids: [ { - bidder: 'kulturemedia', + bidder: 'dxkulture', params: { e2etest: true } diff --git a/test/spec/modules/kulturemediaBidAdapter_spec.js b/test/spec/modules/dxkultureBidAdapter_spec.js similarity index 97% rename from test/spec/modules/kulturemediaBidAdapter_spec.js rename to test/spec/modules/dxkultureBidAdapter_spec.js index f21fe4a8810..bf76ddd0c8a 100644 --- a/test/spec/modules/kulturemediaBidAdapter_spec.js +++ b/test/spec/modules/dxkultureBidAdapter_spec.js @@ -1,12 +1,12 @@ import {expect} from 'chai'; -import {spec} from 'modules/kulturemediaBidAdapter.js'; +import {spec} from 'modules/dxkultureBidAdapter.js'; const BANNER_REQUEST = { - 'bidderCode': 'kulturemedia', + 'bidderCode': 'dxkulture', 'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708', 'bidderRequestId': 'requestId', 'bidRequest': [{ - 'bidder': 'kulturemedia', + 'bidder': 'dxkulture', 'params': { 'placementId': 123456, }, @@ -17,7 +17,7 @@ const BANNER_REQUEST = { 'auctionId': 'auctionId-56a2-4f71-9098-720a68f2f708' }, { - 'bidder': 'kulturemedia', + 'bidder': 'dxkulture', 'params': { 'placementId': 123456, }, @@ -98,7 +98,7 @@ const RESPONSE = { } } ], - 'seat': 'kulturemedia' + 'seat': 'dxkulture' } ], 'ext': { @@ -131,11 +131,11 @@ const RESPONSE = { const DEFAULT_NETWORK_ID = 1; -describe('kulturemediaBidAdapter:', function () { +describe('dxkultureBidAdapter:', function () { let videoBidRequest; const VIDEO_REQUEST = { - 'bidderCode': 'kulturemedia', + 'bidderCode': 'dxkulture', 'auctionId': 'e158486f-8c7f-472f-94ce-b0cbfbb50ab4', 'bidderRequestId': '34feaad34lkj2', 'bids': videoBidRequest, @@ -158,7 +158,7 @@ describe('kulturemediaBidAdapter:', function () { playerSize: [[640, 480]], } }, - bidder: 'kulturemedia', + bidder: 'dxkulture', sizes: [640, 480], bidId: '30b3efwfwe1e', adUnitCode: 'video1', @@ -192,7 +192,7 @@ describe('kulturemediaBidAdapter:', function () { beforeEach(function () { // Basic Valid BidRequest this.bid = { - bidder: 'kulturemedia', + bidder: 'dxkulture', mediaTypes: { banner: { sizes: [[250, 300]] @@ -223,7 +223,7 @@ describe('kulturemediaBidAdapter:', function () { context('banner validation', function () { it('returns true when banner sizes are defined', function () { const bid = { - bidder: 'kulturemedia', + bidder: 'dxkulture', mediaTypes: { banner: { sizes: [[250, 300]] @@ -248,7 +248,7 @@ describe('kulturemediaBidAdapter:', function () { invalidSizes.forEach((sizes) => { const bid = { - bidder: 'kulturemedia', + bidder: 'dxkulture', mediaTypes: { banner: { sizes @@ -269,7 +269,7 @@ describe('kulturemediaBidAdapter:', function () { beforeEach(function () { // Basic Valid BidRequest this.bid = { - bidder: 'kulturemedia', + bidder: 'dxkulture', mediaTypes: { video: { playerSize: [[300, 50]], @@ -509,7 +509,7 @@ describe('kulturemediaBidAdapter:', function () { price: 6.01, adm: '', adomain: [ - 'kulturemedia.com' + 'dxkulture.com' ], w: 640, h: 480, @@ -530,6 +530,7 @@ describe('kulturemediaBidAdapter:', function () { let o = { requestId: serverResponse.seatbid[0].bid[0].impid, ad: '', + bidderCode: spec.code, cpm: serverResponse.seatbid[0].bid[0].price, creativeId: serverResponse.seatbid[0].bid[0].crid, vastXml: serverResponse.seatbid[0].bid[0].adm, @@ -540,7 +541,7 @@ describe('kulturemediaBidAdapter:', function () { ttl: 300, netRevenue: true, meta: { - advertiserDomains: ['kulturemedia.com'] + advertiserDomains: ['dxkulture.com'] } }; expect(bidResponse[0]).to.deep.equal(o);