diff --git a/libraries/adtelligentUtils/adtelligentUtils.js b/libraries/adtelligentUtils/adtelligentUtils.js index bf76889cdbe..fdfdd1f885a 100644 --- a/libraries/adtelligentUtils/adtelligentUtils.js +++ b/libraries/adtelligentUtils/adtelligentUtils.js @@ -2,14 +2,13 @@ import {deepAccess, isArray} from '../../src/utils.js'; import { config } from '../../src/config.js'; import {BANNER, VIDEO} from '../../src/mediaTypes.js'; -const syncsCache = {}; export const supportedMediaTypes = [VIDEO, BANNER] export function isBidRequestValid (bid) { return !!deepAccess(bid, 'params.aid'); } -export function getUserSyncs (syncOptions, serverResponses) { +export function getUserSyncsFn (syncOptions, serverResponses, syncsCache = {}) { const syncs = []; function addSyncs(bid) { diff --git a/modules/adtargetBidAdapter.js b/modules/adtargetBidAdapter.js index 99cc66fab3a..484fe8aaca8 100644 --- a/modules/adtargetBidAdapter.js +++ b/modules/adtargetBidAdapter.js @@ -5,8 +5,7 @@ import {config} from '../src/config.js'; import {find} from '../src/polyfill.js'; import {chunk} from '../libraries/chunk/chunk.js'; import { - createTag, - getUserSyncs, + createTag, getUserSyncsFn, isBidRequestValid, supportedMediaTypes } from '../libraries/adtelligentUtils/adtelligentUtils.js'; @@ -14,13 +13,16 @@ import { const ENDPOINT = 'https://ghb.console.adtarget.com.tr/v2/auction/'; const BIDDER_CODE = 'adtarget'; const DISPLAY = 'display'; +const syncsCache = {}; export const spec = { code: BIDDER_CODE, gvlid: 779, supportedMediaTypes, isBidRequestValid, - getUserSyncs, + getUserSyncs: function (syncOptions, serverResponses) { + getUserSyncsFn(syncOptions, serverResponses, syncsCache) + }, buildRequests: function (bidRequests, adapterRequest) { const adapterSettings = config.getConfig(adapterRequest.bidderCode) diff --git a/modules/adtelligentBidAdapter.js b/modules/adtelligentBidAdapter.js index deca26eb7b3..08d3773f931 100644 --- a/modules/adtelligentBidAdapter.js +++ b/modules/adtelligentBidAdapter.js @@ -6,12 +6,11 @@ import {Renderer} from '../src/Renderer.js'; import {find} from '../src/polyfill.js'; import {chunk} from '../libraries/chunk/chunk.js'; import { - createTag, getUserSyncs, + createTag, getUserSyncsFn, isBidRequestValid, supportedMediaTypes } from '../libraries/adtelligentUtils/adtelligentUtils.js'; - /** * @typedef {import('../src/adapters/bidderFactory.js').Bid} Bid * @typedef {import('../src/adapters/bidderFactory.js').BidderRequest} BidderRequest @@ -43,6 +42,7 @@ const OUTSTREAM_SRC = 'https://player.adtelligent.com/outstream-unit/2.01/outstr const BIDDER_CODE = 'adtelligent'; const OUTSTREAM = 'outstream'; const DISPLAY = 'display'; +const syncsCache = {}; export const spec = { code: BIDDER_CODE, @@ -58,7 +58,9 @@ export const spec = { ], supportedMediaTypes, isBidRequestValid, - getUserSyncs, + getUserSyncs: function (syncOptions, serverResponses) { + getUserSyncsFn(syncOptions, serverResponses, syncsCache) + }, /** * Make a server request from the list of BidRequests * @param bidRequests @@ -250,6 +252,7 @@ function createBid(bidResponse, bidRequest) { /** * Create Adtelligent renderer * @param requestId + * @param bidderParams * @returns {*} */ function newRenderer(requestId, bidderParams) { diff --git a/modules/viewdeosDXBidAdapter.js b/modules/viewdeosDXBidAdapter.js index 27f50ad98c1..4d844403f78 100644 --- a/modules/viewdeosDXBidAdapter.js +++ b/modules/viewdeosDXBidAdapter.js @@ -4,7 +4,7 @@ import {VIDEO} from '../src/mediaTypes.js'; import {Renderer} from '../src/Renderer.js'; import {findIndex} from '../src/polyfill.js'; import { - getUserSyncs, + getUserSyncsFn, isBidRequestValid, supportedMediaTypes } from '../libraries/adtelligentUtils/adtelligentUtils.js'; @@ -14,6 +14,7 @@ const OUTSTREAM_SRC = 'https://player.sync.viewdeos.com/outstream-unit/2.01/outs const BIDDER_CODE = 'viewdeosDX'; const OUTSTREAM = 'outstream'; const DISPLAY = 'display'; +const syncsCache = {}; export const spec = { code: BIDDER_CODE, @@ -21,7 +22,9 @@ export const spec = { gvlid: 924, supportedMediaTypes, isBidRequestValid, - getUserSyncs, + getUserSyncs: function (syncOptions, serverResponses) { + getUserSyncsFn(syncOptions, serverResponses, syncsCache) + }, /** * Make a server request from the list of BidRequests * @param bidRequests @@ -186,6 +189,7 @@ function createBid(bidResponse, mediaType, bidderParams) { /** * Create renderer * @param requestId + * @param bidderParams * @returns {*} */ function newRenderer(requestId, bidderParams) {