From 325c162276d43804a01ae815513b595b865977ec Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Mon, 15 Nov 2021 17:03:22 +0700 Subject: [PATCH 1/8] Alkimi bid adapter --- modules/alkimiAdapter.js | 105 ++++++++++++++++ modules/alkimiAdapter.md | 29 +++++ test/spec/modules/alkimiAdapter_spec.js | 161 ++++++++++++++++++++++++ 3 files changed, 295 insertions(+) create mode 100644 modules/alkimiAdapter.js create mode 100644 modules/alkimiAdapter.md create mode 100644 test/spec/modules/alkimiAdapter_spec.js diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js new file mode 100644 index 00000000000..705057f5c77 --- /dev/null +++ b/modules/alkimiAdapter.js @@ -0,0 +1,105 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { deepClone, deepAccess } from '../src/utils.js'; +import { ajax } from '../src/ajax.js'; +import { VIDEO } from '../src/mediaTypes.js'; + +const BIDDER_CODE = 'alkimi'; +export const ENDPOINT = 'https://exchange-qa.alkimi.asteriosoft.com/bid?prebid=true' + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: ['banner', 'video'], + + isBidRequestValid: function (bid) { + return !!(bid.params && bid.params.bidFloor && bid.params.publisherToken); + }, + + buildRequests: function (validBidRequests, bidderRequest) { + let bids = []; + validBidRequests.forEach(bidRequest => { + let sizes = prepareSizes(bidRequest.sizes) + + bids.push({ + bidId: bidRequest.bidId, + publisherToken: bidRequest.params.publisherToken, + pos: bidRequest.params.pos, + bidFloor: bidRequest.params.bidFloor, + width: sizes[0].width, + height: sizes[0].height, + impMediaType: getFormatType(bidRequest) + }) + }) + + let payload = { + requestId: bidderRequest.bidderRequestId, + bids, + referer: bidderRequest.refererInfo.referer + } + + const options = { + contentType: 'application/json', + customHeaders: { + 'Rtb-Direct': true + } + } + + return { + method: 'POST', + url: ENDPOINT, + data: payload, + options + }; + }, + + interpretResponse: function (serverResponse, request) { + const serverBody = serverResponse.body; + if (!serverBody || typeof serverBody !== 'object') { + return []; + } + + const { prebidResponse } = serverBody; + if (!prebidResponse || typeof prebidResponse !== 'object') { + return []; + } + + let bids = []; + prebidResponse.forEach(bidResponse => { + let bid = deepClone(bidResponse); + bid.cpm = parseFloat(bidResponse.cpm); + + // banner or video + if (VIDEO === bid.format) { + bid.vastXml = bid.ad; + } + + bid.meta = {}; + bid.meta.advertiserDomains = bid.adomain || []; + + bids.push(bid); + }) + + return bids; + }, + + onBidWon: function (bid) { + if (bid.winUrl) { + const cpm = bid.cpm; + const winUrl = bid.winUrl.replace(/\$\{AUCTION_PRICE\}/, cpm); + ajax(winUrl, null); + return true; + } + return false; + } +} + +function prepareSizes(sizes) { + return sizes && sizes.map(size => ({ width: size[0], height: size[1] })); +} + +const getFormatType = bidRequest => { + if (deepAccess(bidRequest, 'mediaTypes.banner')) return 'Banner' + if (deepAccess(bidRequest, 'mediaTypes.video')) return 'Video' + if (deepAccess(bidRequest, 'mediaTypes.audio')) return 'Audio' +} + +registerBidder(spec); diff --git a/modules/alkimiAdapter.md b/modules/alkimiAdapter.md new file mode 100644 index 00000000000..dbaea323ef3 --- /dev/null +++ b/modules/alkimiAdapter.md @@ -0,0 +1,29 @@ +# Overview + +``` +Module Name: Alkimi Bidder Adapter +Module Type: Bidder Adapter +Maintainer: abogdanov@asteriosoft.com +``` + +# Description + +Connects to Alkimi Bidder for bids. +Alkimi bid adapter supports Banner and Video ads. + +# Test Parameters +``` +const adUnits = [ + { + bids: [ + { + bidder: 'alkimi', + params: { + bidFloor: 0.1 + publisherToken: '?????????????????????', // zoneToken provided by Alkimi + } + } + ] + } +]; +``` diff --git a/test/spec/modules/alkimiAdapter_spec.js b/test/spec/modules/alkimiAdapter_spec.js new file mode 100644 index 00000000000..055fb9eb026 --- /dev/null +++ b/test/spec/modules/alkimiAdapter_spec.js @@ -0,0 +1,161 @@ +import { expect } from 'chai' +import { ENDPOINT, spec } from 'modules/alkimiAdapter.js' +import { newBidder } from 'src/adapters/bidderFactory.js' + +const REQUEST = { + 'bidId': '456', + 'bidder': 'alkimi', + 'sizes': [[300, 250]], + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 250]] + } + }, + 'params': { + bidFloor: 0.1, + publisherToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', + pos: 7 + } +} + +const BIDDER_BANNER_RESPONSE = { + 'prebidResponse': [{ + 'ad': '
test
', + 'requestId': 'e64782a4-8e68-4c38-965b-80ccf115d46d', + 'cpm': 900.5, + 'currency': 'USD', + 'width': 640, + 'height': 480, + 'ttl': 300, + 'creativeId': 1, + 'netRevenue': true, + 'winUrl': 'http://test.com', + 'format': 'banner', + 'adomain': ['test.com'] + }] +} + +const BIDDER_VIDEO_RESPONSE = { + 'prebidResponse': [{ + 'ad': 'vast', + 'requestId': 'e64782a4-8e68-4c38-965b-80ccf115d46z', + 'cpm': 800.4, + 'currency': 'USD', + 'width': 1024, + 'height': 768, + 'ttl': 200, + 'creativeId': 2, + 'netRevenue': true, + 'winUrl': 'http://test.com', + 'format': 'video', + 'adomain': ['test.com'] + }] +} + +const BIDDER_NO_BID_RESPONSE = '' + +describe('alkimiAdapter', function () { + const adapter = newBidder(spec) + + describe('inherited functions', function () { + it('exists and is a function', function () { + expect(adapter.callBids).to.exist.and.to.be.a('function') + }) + }) + + describe('isBidRequestValid', function () { + it('should return true when required params found', function () { + expect(spec.isBidRequestValid(REQUEST)).to.equal(true) + }) + + it('should return false when required params are not passed', function () { + let bid = Object.assign({}, REQUEST) + delete bid.params.publisherToken + expect(spec.isBidRequestValid(bid)).to.equal(false) + + bid = Object.assign({}, REQUEST) + delete bid.params.bidFloor + expect(spec.isBidRequestValid(bid)).to.equal(false) + + bid = Object.assign({}, REQUEST) + delete bid.params + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + }) + + describe('buildRequests', function () { + let bidRequests = [REQUEST] + const bidderRequest = spec.buildRequests(bidRequests, { + bidderRequestId: '123', + refererInfo: { + referer: 'http://test.com/path.html' + } + }) + + it('sends bid request to ENDPOINT via POST', function () { + expect(bidderRequest.method).to.equal('POST') + expect(bidderRequest.data.requestId).to.equal('123') + expect(bidderRequest.data.referer).to.equal('http://test.com/path.html') + expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', publisherToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner' }) + expect(bidderRequest.options.customHeaders).to.deep.equal({ 'Rtb-Direct': true }) + expect(bidderRequest.options.contentType).to.equal('application/json') + expect(bidderRequest.url).to.equal(ENDPOINT) + }) + }) + + describe('interpretResponse', function () { + it('handles banner request : should get correct bid response', function () { + const result = spec.interpretResponse({ body: BIDDER_BANNER_RESPONSE }, {}) + + expect(result[0]).to.have.property('ad').equal('
test
') + expect(result[0]).to.have.property('requestId').equal('e64782a4-8e68-4c38-965b-80ccf115d46d') + expect(result[0]).to.have.property('cpm').equal(900.5) + expect(result[0]).to.have.property('currency').equal('USD') + expect(result[0]).to.have.property('width').equal(640) + expect(result[0]).to.have.property('height').equal(480) + expect(result[0]).to.have.property('ttl').equal(300) + expect(result[0]).to.have.property('creativeId').equal(1) + expect(result[0]).to.have.property('netRevenue').equal(true) + expect(result[0]).to.have.property('winUrl').equal('http://test.com') + expect(result[0]).to.have.property('format').equal('banner') + expect(result[0].meta).to.exist.property('advertiserDomains') + expect(result[0].meta).to.have.property('advertiserDomains').lengthOf(1) + }) + + it('handles video request : should get correct bid response', function () { + const result = spec.interpretResponse({ body: BIDDER_VIDEO_RESPONSE }, {}) + + expect(result[0]).to.have.property('ad').equal('vast') + expect(result[0]).to.have.property('requestId').equal('e64782a4-8e68-4c38-965b-80ccf115d46z') + expect(result[0]).to.have.property('cpm').equal(800.4) + expect(result[0]).to.have.property('currency').equal('USD') + expect(result[0]).to.have.property('width').equal(1024) + expect(result[0]).to.have.property('height').equal(768) + expect(result[0]).to.have.property('ttl').equal(200) + expect(result[0]).to.have.property('creativeId').equal(2) + expect(result[0]).to.have.property('netRevenue').equal(true) + expect(result[0]).to.have.property('winUrl').equal('http://test.com') + expect(result[0]).to.have.property('format').equal('video') + expect(result[0]).to.have.property('vastXml').equal('vast') + expect(result[0].meta).to.exist.property('advertiserDomains') + expect(result[0].meta).to.have.property('advertiserDomains').lengthOf(1) + }) + + it('handles no bid response : should get empty array', function () { + let result = spec.interpretResponse({ body: undefined }, {}) + expect(result).to.deep.equal([]) + + result = spec.interpretResponse({ body: BIDDER_NO_BID_RESPONSE }, {}) + expect(result).to.deep.equal([]) + }) + }) + + describe('onBidWon', function () { + it('handles banner win: should get true', function () { + const win = BIDDER_BANNER_RESPONSE.prebidResponse[0] + const bidWonResult = spec.onBidWon(win) + + expect(bidWonResult).to.equal(true) + }) + }) +}) From df09e0d10b110e7e63f2a515dd738b69e5f3f49f Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Wed, 17 Nov 2021 10:50:58 +0700 Subject: [PATCH 2/8] Alkimi bid adapter --- modules/alkimiAdapter.js | 4 ++-- modules/alkimiAdapter.md | 4 ++-- test/spec/modules/alkimiAdapter_spec.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index 705057f5c77..e89212e614a 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -11,7 +11,7 @@ export const spec = { supportedMediaTypes: ['banner', 'video'], isBidRequestValid: function (bid) { - return !!(bid.params && bid.params.bidFloor && bid.params.publisherToken); + return !!(bid.params && bid.params.bidFloor && bid.params.token); }, buildRequests: function (validBidRequests, bidderRequest) { @@ -21,7 +21,7 @@ export const spec = { bids.push({ bidId: bidRequest.bidId, - publisherToken: bidRequest.params.publisherToken, + token: bidRequest.params.token, pos: bidRequest.params.pos, bidFloor: bidRequest.params.bidFloor, width: sizes[0].width, diff --git a/modules/alkimiAdapter.md b/modules/alkimiAdapter.md index dbaea323ef3..92a7c2aefe1 100644 --- a/modules/alkimiAdapter.md +++ b/modules/alkimiAdapter.md @@ -19,8 +19,8 @@ const adUnits = [ { bidder: 'alkimi', params: { - bidFloor: 0.1 - publisherToken: '?????????????????????', // zoneToken provided by Alkimi + bidFloor: 0.1, + token: '?????????????????????', // Publisher Token provided by Alkimi } } ] diff --git a/test/spec/modules/alkimiAdapter_spec.js b/test/spec/modules/alkimiAdapter_spec.js index 055fb9eb026..6013b2bfbee 100644 --- a/test/spec/modules/alkimiAdapter_spec.js +++ b/test/spec/modules/alkimiAdapter_spec.js @@ -13,7 +13,7 @@ const REQUEST = { }, 'params': { bidFloor: 0.1, - publisherToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', + token: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7 } } @@ -70,7 +70,7 @@ describe('alkimiAdapter', function () { it('should return false when required params are not passed', function () { let bid = Object.assign({}, REQUEST) - delete bid.params.publisherToken + delete bid.params.token expect(spec.isBidRequestValid(bid)).to.equal(false) bid = Object.assign({}, REQUEST) @@ -96,7 +96,7 @@ describe('alkimiAdapter', function () { expect(bidderRequest.method).to.equal('POST') expect(bidderRequest.data.requestId).to.equal('123') expect(bidderRequest.data.referer).to.equal('http://test.com/path.html') - expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', publisherToken: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner' }) + expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', token: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner' }) expect(bidderRequest.options.customHeaders).to.deep.equal({ 'Rtb-Direct': true }) expect(bidderRequest.options.contentType).to.equal('application/json') expect(bidderRequest.url).to.equal(ENDPOINT) From b3e36881c248a6aebd2d8c2a4507162d800b4dbf Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Wed, 17 Nov 2021 16:17:43 +0700 Subject: [PATCH 3/8] Alkimi bid adapter --- modules/alkimiAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index e89212e614a..cdd0dabc68c 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -4,7 +4,7 @@ import { ajax } from '../src/ajax.js'; import { VIDEO } from '../src/mediaTypes.js'; const BIDDER_CODE = 'alkimi'; -export const ENDPOINT = 'https://exchange-qa.alkimi.asteriosoft.com/bid?prebid=true' +export const ENDPOINT = 'https://exchange-dev.alkimi.asteriosoft.com/bid?prebid=true' export const spec = { code: BIDDER_CODE, @@ -68,7 +68,7 @@ export const spec = { bid.cpm = parseFloat(bidResponse.cpm); // banner or video - if (VIDEO === bid.format) { + if (VIDEO === bid.mediaType) { bid.vastXml = bid.ad; } From 144cda7ab87bafaa182985a91d74138a5613e98a Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Mon, 7 Feb 2022 11:42:22 +0700 Subject: [PATCH 4/8] alkimi adapter --- modules/alkimiAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index cdd0dabc68c..db2760914b1 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -4,7 +4,7 @@ import { ajax } from '../src/ajax.js'; import { VIDEO } from '../src/mediaTypes.js'; const BIDDER_CODE = 'alkimi'; -export const ENDPOINT = 'https://exchange-dev.alkimi.asteriosoft.com/bid?prebid=true' +export const ENDPOINT = 'https://exchange-dev.alkimi.asteriosoft.com/bid?prebid=true'; export const spec = { code: BIDDER_CODE, From c14dcd2fb6acf306f91a4eec057053188d47385b Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Tue, 8 Feb 2022 13:18:20 +0700 Subject: [PATCH 5/8] onBidWon change --- modules/alkimiAdapter.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index db2760914b1..d819fb76d5e 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -2,6 +2,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { deepClone, deepAccess } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { VIDEO } from '../src/mediaTypes.js'; +import { config } from '../src/config.js'; const BIDDER_CODE = 'alkimi'; export const ENDPOINT = 'https://exchange-dev.alkimi.asteriosoft.com/bid?prebid=true'; @@ -16,11 +17,11 @@ export const spec = { buildRequests: function (validBidRequests, bidderRequest) { let bids = []; + let bidIds = []; validBidRequests.forEach(bidRequest => { let sizes = prepareSizes(bidRequest.sizes) bids.push({ - bidId: bidRequest.bidId, token: bidRequest.params.token, pos: bidRequest.params.pos, bidFloor: bidRequest.params.bidFloor, @@ -28,12 +29,17 @@ export const spec = { height: sizes[0].height, impMediaType: getFormatType(bidRequest) }) + bidIds.push(bidRequest.bidId) }) + const alkimiConfig = config.getConfig('alkimi'); + let payload = { requestId: bidderRequest.bidderRequestId, bids, - referer: bidderRequest.refererInfo.referer + bidIds, + referer: bidderRequest.refererInfo.referer, + signature: alkimiConfig && alkimiConfig.signature } const options = { @@ -82,13 +88,21 @@ export const spec = { }, onBidWon: function (bid) { - if (bid.winUrl) { - const cpm = bid.cpm; - const winUrl = bid.winUrl.replace(/\$\{AUCTION_PRICE\}/, cpm); - ajax(winUrl, null); - return true; + let winUrl; + if (bid.winUrl || bid.vastUrl) { + winUrl = bid.winUrl ? bid.winUrl : bid.vastUrl; + winUrl = winUrl.replace(/\$\{AUCTION_PRICE\}/, bid.cpm); + } else if (bid.ad) { + let trackImg = bid.ad.match(/(?!^)/); + bid.ad = bid.ad.replace(trackImg[0], ''); + winUrl = trackImg[0].split('"')[1]; + winUrl = winUrl.replace(/\$%7BAUCTION_PRICE%7D/, bid.cpm); + } else { + return false; } - return false; + + ajax(winUrl, null); + return true; } } From ddec9979c8e0604ccb495283d9dbd223d23329c7 Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Tue, 8 Feb 2022 15:37:48 +0700 Subject: [PATCH 6/8] sign utils --- modules/alkimiAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index d819fb76d5e..b8f6a3c2c31 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -36,7 +36,7 @@ export const spec = { let payload = { requestId: bidderRequest.bidderRequestId, - bids, + signRequest: { bids, randomUUID: alkimiConfig && alkimiConfig.randomUUID }, bidIds, referer: bidderRequest.refererInfo.referer, signature: alkimiConfig && alkimiConfig.signature From 068c546806a1ac3f7c8818416e5f3126bbfb8f21 Mon Sep 17 00:00:00 2001 From: Alexander Bogdanov Date: Thu, 24 Feb 2022 14:57:50 +0700 Subject: [PATCH 7/8] auction ID as bid request ID --- modules/alkimiAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/alkimiAdapter.js b/modules/alkimiAdapter.js index b8f6a3c2c31..a68f2478e55 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiAdapter.js @@ -35,7 +35,7 @@ export const spec = { const alkimiConfig = config.getConfig('alkimi'); let payload = { - requestId: bidderRequest.bidderRequestId, + requestId: bidderRequest.auctionId, signRequest: { bids, randomUUID: alkimiConfig && alkimiConfig.randomUUID }, bidIds, referer: bidderRequest.refererInfo.referer, From bf432c4d60f3cd26e0efb2b06f0b131cbcd199f0 Mon Sep 17 00:00:00 2001 From: alexander bogdanov Date: Wed, 27 Apr 2022 13:12:40 +0700 Subject: [PATCH 8/8] unit test fixes --- .../{alkimiAdapter.js => alkimiBidAdapter.js} | 2 +- .../{alkimiAdapter.md => alkimiBidAdapter.md} | 0 ...apter_spec.js => alkimiBidAdapter_spec.js} | 19 +++++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) rename modules/{alkimiAdapter.js => alkimiBidAdapter.js} (97%) rename modules/{alkimiAdapter.md => alkimiBidAdapter.md} (100%) rename test/spec/modules/{alkimiAdapter_spec.js => alkimiBidAdapter_spec.js} (88%) diff --git a/modules/alkimiAdapter.js b/modules/alkimiBidAdapter.js similarity index 97% rename from modules/alkimiAdapter.js rename to modules/alkimiBidAdapter.js index a68f2478e55..261fd9dee68 100644 --- a/modules/alkimiAdapter.js +++ b/modules/alkimiBidAdapter.js @@ -5,7 +5,7 @@ import { VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; const BIDDER_CODE = 'alkimi'; -export const ENDPOINT = 'https://exchange-dev.alkimi.asteriosoft.com/bid?prebid=true'; +export const ENDPOINT = 'https://exchange.alkimi-onboarding.com/bid?prebid=true'; export const spec = { code: BIDDER_CODE, diff --git a/modules/alkimiAdapter.md b/modules/alkimiBidAdapter.md similarity index 100% rename from modules/alkimiAdapter.md rename to modules/alkimiBidAdapter.md diff --git a/test/spec/modules/alkimiAdapter_spec.js b/test/spec/modules/alkimiBidAdapter_spec.js similarity index 88% rename from test/spec/modules/alkimiAdapter_spec.js rename to test/spec/modules/alkimiBidAdapter_spec.js index 6013b2bfbee..58a5a3b54ab 100644 --- a/test/spec/modules/alkimiAdapter_spec.js +++ b/test/spec/modules/alkimiBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai' -import { ENDPOINT, spec } from 'modules/alkimiAdapter.js' +import { ENDPOINT, spec } from 'modules/alkimiBidAdapter.js' import { newBidder } from 'src/adapters/bidderFactory.js' const REQUEST = { @@ -30,7 +30,7 @@ const BIDDER_BANNER_RESPONSE = { 'creativeId': 1, 'netRevenue': true, 'winUrl': 'http://test.com', - 'format': 'banner', + 'mediaType': 'banner', 'adomain': ['test.com'] }] } @@ -47,14 +47,14 @@ const BIDDER_VIDEO_RESPONSE = { 'creativeId': 2, 'netRevenue': true, 'winUrl': 'http://test.com', - 'format': 'video', + 'mediaType': 'video', 'adomain': ['test.com'] }] } const BIDDER_NO_BID_RESPONSE = '' -describe('alkimiAdapter', function () { +describe('alkimiBidAdapter', function () { const adapter = newBidder(spec) describe('inherited functions', function () { @@ -86,7 +86,7 @@ describe('alkimiAdapter', function () { describe('buildRequests', function () { let bidRequests = [REQUEST] const bidderRequest = spec.buildRequests(bidRequests, { - bidderRequestId: '123', + auctionId: '123', refererInfo: { referer: 'http://test.com/path.html' } @@ -96,7 +96,10 @@ describe('alkimiAdapter', function () { expect(bidderRequest.method).to.equal('POST') expect(bidderRequest.data.requestId).to.equal('123') expect(bidderRequest.data.referer).to.equal('http://test.com/path.html') - expect(bidderRequest.data.bids).to.deep.contains({ bidId: '456', token: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner' }) + expect(bidderRequest.data.signRequest.bids).to.deep.contains({ token: 'e64782a4-8e68-4c38-965b-80ccf115d46f', pos: 7, bidFloor: 0.1, width: 300, height: 250, impMediaType: 'Banner' }) + expect(bidderRequest.data.signRequest.randomUUID).to.equal(undefined) + expect(bidderRequest.data.bidIds).to.deep.contains('456') + expect(bidderRequest.data.signature).to.equal(undefined) expect(bidderRequest.options.customHeaders).to.deep.equal({ 'Rtb-Direct': true }) expect(bidderRequest.options.contentType).to.equal('application/json') expect(bidderRequest.url).to.equal(ENDPOINT) @@ -117,7 +120,7 @@ describe('alkimiAdapter', function () { expect(result[0]).to.have.property('creativeId').equal(1) expect(result[0]).to.have.property('netRevenue').equal(true) expect(result[0]).to.have.property('winUrl').equal('http://test.com') - expect(result[0]).to.have.property('format').equal('banner') + expect(result[0]).to.have.property('mediaType').equal('banner') expect(result[0].meta).to.exist.property('advertiserDomains') expect(result[0].meta).to.have.property('advertiserDomains').lengthOf(1) }) @@ -135,7 +138,7 @@ describe('alkimiAdapter', function () { expect(result[0]).to.have.property('creativeId').equal(2) expect(result[0]).to.have.property('netRevenue').equal(true) expect(result[0]).to.have.property('winUrl').equal('http://test.com') - expect(result[0]).to.have.property('format').equal('video') + expect(result[0]).to.have.property('mediaType').equal('video') expect(result[0]).to.have.property('vastXml').equal('vast') expect(result[0].meta).to.exist.property('advertiserDomains') expect(result[0].meta).to.have.property('advertiserDomains').lengthOf(1)