From 6ec8f4539ea6be403a0d7e08dad5c7a5228f28a1 Mon Sep 17 00:00:00 2001 From: Fatih Kaya Date: Fri, 4 Nov 2022 22:49:31 +0300 Subject: [PATCH] added alias feature and host param --- modules/admaticBidAdapter.js | 6 +++++- modules/admaticBidAdapter.md | 1 + test/spec/modules/admaticBidAdapter_spec.js | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/admaticBidAdapter.js b/modules/admaticBidAdapter.js index 5556a181f7f..cf54557c6c8 100644 --- a/modules/admaticBidAdapter.js +++ b/modules/admaticBidAdapter.js @@ -20,7 +20,7 @@ export const spec = { let isValid = false; if (typeof bid.params !== 'undefined') { let isValidNetworkId = _validateId(getValue(bid.params, 'networkId')); - let isValidHost = getValue(bid.params, 'host'); + let isValidHost = _validateString(getValue(bid.params, 'host')); isValid = isValidNetworkId && isValidHost; } @@ -198,4 +198,8 @@ function _validateId(id) { return (parseInt(id) > 0); } +function _validateString(str) { + return (typeof str == 'string'); +} + registerBidder(spec); diff --git a/modules/admaticBidAdapter.md b/modules/admaticBidAdapter.md index b12aebe5f72..2bf9afb3cdc 100644 --- a/modules/admaticBidAdapter.md +++ b/modules/admaticBidAdapter.md @@ -36,6 +36,7 @@ Use `admatic` as bidder. ``` ## UserSync example + ``` pbjs.setConfig({ userSync: { diff --git a/test/spec/modules/admaticBidAdapter_spec.js b/test/spec/modules/admaticBidAdapter_spec.js index c7d391cfaca..9cbee2fb06b 100644 --- a/test/spec/modules/admaticBidAdapter_spec.js +++ b/test/spec/modules/admaticBidAdapter_spec.js @@ -18,7 +18,8 @@ describe('admaticBidAdapter', () => { let bid = { 'bidder': 'admatic', 'params': { - 'networkId': 10433394 + 'networkId': 10433394, + 'host': 'layer.serve.admatic.com.tr' }, 'adUnitCode': 'adunit-code', 'sizes': [[300, 250], [300, 600]], @@ -37,7 +38,8 @@ describe('admaticBidAdapter', () => { delete bid.params; bid.params = { - 'networkId': 0 + 'networkId': 0, + 'host': 'layer.serve.admatic.com.tr' }; expect(spec.isBidRequestValid(bid)).to.equal(false);