From c978365c5b54ff13f5834db60ef765fa196f349c Mon Sep 17 00:00:00 2001 From: Xingwang Liao <60087633+xingwangl@users.noreply.github.com> Date: Tue, 31 Aug 2021 01:52:51 +0800 Subject: [PATCH 001/250] Opera Ads Adapter: fix floor price support (#7357) * Opera Ads Adapter: update example parameters in docs * Opera Ads Adapter: fix floor price support * Our OpenRTB server only supports USD, any other currency request will be ignored --- modules/operaadsBidAdapter.js | 77 ++++++++------------ modules/operaadsBidAdapter.md | 25 +++---- test/spec/modules/operaadsBidAdapter_spec.js | 15 +++- 3 files changed, 54 insertions(+), 63 deletions(-) diff --git a/modules/operaadsBidAdapter.js b/modules/operaadsBidAdapter.js index 85ba25c1404..6b7115b61d0 100644 --- a/modules/operaadsBidAdapter.js +++ b/modules/operaadsBidAdapter.js @@ -189,8 +189,6 @@ export const spec = { * @returns {Request} */ function buildOpenRtbBidRequest(bidRequest, bidderRequest) { - const currencies = getCurrencies(bidRequest); - const pageReferrer = utils.deepAccess(bidderRequest, 'refererInfo.referer'); // build OpenRTB request body @@ -198,7 +196,7 @@ function buildOpenRtbBidRequest(bidRequest, bidderRequest) { id: bidderRequest.auctionId, tmax: bidderRequest.timeout || config.getConfig('bidderTimeout'), test: config.getConfig('debug') ? 1 : 0, - imp: createImp(bidRequest, currencies[0]), + imp: createImp(bidRequest), device: getDevice(), site: { id: String(utils.deepAccess(bidRequest, 'params.publisherId')), @@ -208,7 +206,7 @@ function buildOpenRtbBidRequest(bidRequest, bidderRequest) { }, at: 1, bcat: getBcat(bidRequest), - cur: currencies, + cur: [DEFAULT_CURRENCY], regs: { coppa: config.getConfig('coppa') ? 1 : 0, ext: {} @@ -456,22 +454,19 @@ function interpretNativeAd(nativeResponse, currency, cpm) { * @param {Currency} cur * @returns {Imp[]} */ -function createImp(bidRequest, cur) { +function createImp(bidRequest) { const imp = []; - const floor = getBidFloor(bidRequest, cur); - const impItem = { id: bidRequest.bidId, tagid: String(utils.deepAccess(bidRequest, 'params.placementId')), - bidfloor: floor, }; - let mediaType; + let mediaType, size; let bannerReq, videoReq, nativeReq; if ((bannerReq = utils.deepAccess(bidRequest, 'mediaTypes.banner'))) { - const size = canonicalizeSizesArray(bannerReq.sizes || BANNER_DEFAULTS.SIZE)[0]; + size = canonicalizeSizesArray(bannerReq.sizes || BANNER_DEFAULTS.SIZE)[0]; impItem.banner = { w: size[0], @@ -481,7 +476,7 @@ function createImp(bidRequest, cur) { mediaType = BANNER; } else if ((videoReq = utils.deepAccess(bidRequest, 'mediaTypes.video'))) { - const size = canonicalizeSizesArray(videoReq.playerSize || VIDEO_DEFAULTS.SIZE)[0]; + size = canonicalizeSizesArray(videoReq.playerSize || VIDEO_DEFAULTS.SIZE)[0]; impItem.video = { w: size[0], @@ -516,6 +511,14 @@ function createImp(bidRequest, cur) { mediaType = NATIVE; } + const floorDetail = getBidFloor(bidRequest, { + mediaType: mediaType || '*', + size: size || '*' + }) + + impItem.bidfloor = floorDetail.floor; + impItem.bidfloorcur = floorDetail.currency; + if (mediaType) { imp.push(impItem); } @@ -678,47 +681,29 @@ function getDomain(referer) { * Get bid floor price * * @param {BidRequest} bid - * @param {String} cur - * @returns {Number} floor price + * @param {Params} params + * @returns {Floor} floor price */ -function getBidFloor(bid, cur) { - let floorInfo = {}; - - if (typeof bid.getFloor === 'function') { - floorInfo = bid.getFloor({ - currency: cur, - mediaType: '*', - size: '*' +function getBidFloor(bid, {mediaType = '*', size = '*'}) { + if (utils.isFn(bid.getFloor)) { + const floorInfo = bid.getFloor({ + currency: DEFAULT_CURRENCY, + mediaType, + size }); - } - return floorInfo.floor || 0.0; -} - -/** - * Get currencies from bid request - * - * @param {BidRequest} bidRequest - * @returns {String[]} currencies - */ -function getCurrencies(bidRequest) { - let currencies = []; - - const pCur = utils.deepAccess(bidRequest, 'params.currency'); - if (pCur) { - currencies = currencies.concat(pCur); - } - - if (!currencies.length) { - let currency; - if ((currency = config.getConfig('currency')) && currency.adServerCurrency) { - currencies.push(currency.adServerCurrency); - } else { - currencies.push(DEFAULT_CURRENCY); + if (utils.isPlainObject(floorInfo) && !isNaN(floorInfo.floor)) { + return { + currency: floorInfo.currency || DEFAULT_CURRENCY, + floor: floorInfo.floor + }; } } - return currencies; + return { + currency: DEFAULT_CURRENCY, + floor: 0.0 + } } /** diff --git a/modules/operaadsBidAdapter.md b/modules/operaadsBidAdapter.md index 9bfe3e76b88..709c67a04a7 100644 --- a/modules/operaadsBidAdapter.md +++ b/modules/operaadsBidAdapter.md @@ -16,10 +16,9 @@ Module that connects to OperaAds's demand sources | Name | Scope | Type | Description | Example | ---- | ----- | ---- | ----------- | ------- -| `placementId` | required | String | The Placement Id provided by Opera Ads. | `s12345678` -| `endpointId` | required | String | The Endpoint Id provided by Opera Ads. | `ep12345678` -| `publisherId` | required | String | The Publisher Id provided by Opera Ads. | `pub12345678` -| `currency` | optional | String or String[] | Currency. | `USD` +| `placementId` | required | String | The Placement Id provided by Opera Ads. | `s5340077725248` +| `endpointId` | required | String | The Endpoint Id provided by Opera Ads. | `ep3425464070464` +| `publisherId` | required | String | The Publisher Id provided by Opera Ads. | `pub3054952966336` | `bcat` | optional | String or String[] | The bcat value. | `IAB9-31` ### Bid Video Parameters @@ -66,9 +65,9 @@ var adUnits = [{ bids: [{ bidder: 'operaads', params: { - placementId: 's12345678', - endpointId: 's12345678', - publisherId: 's12345678' + placementId: 's5340077725248', + endpointId: 'ep3425464070464', + publisherId: 'pub3054952966336' } }] }]; @@ -92,9 +91,9 @@ var adUnits = [{ bids: [{ bidder: 'operaads', params: { - placementId: 's12345678', - endpointId: 's12345678', - publisherId: 's12345678' + placementId: 's5340077725248', + endpointId: 'ep3425464070464', + publisherId: 'pub3054952966336' } }] }]; @@ -126,9 +125,9 @@ var adUnits = [{ bids: [{ bidder: 'operaads', params: { - placementId: 's12345678', - endpointId: 's12345678', - publisherId: 's12345678' + placementId: 's5340077725248', + endpointId: 'ep3425464070464', + publisherId: 'pub3054952966336' } }] }]; diff --git a/test/spec/modules/operaadsBidAdapter_spec.js b/test/spec/modules/operaadsBidAdapter_spec.js index 92e51c5473d..c225835fcc2 100644 --- a/test/spec/modules/operaadsBidAdapter_spec.js +++ b/test/spec/modules/operaadsBidAdapter_spec.js @@ -266,7 +266,7 @@ describe('Opera Ads Bid Adapter', function () { } }); - it('currency in params should be used', function () { + it('test getBidFloor', function() { const bidRequests = [ { adUnitCode: 'test-div', @@ -276,8 +276,13 @@ describe('Opera Ads Bid Adapter', function () { params: { placementId: 's12345678', publisherId: 'pub12345678', - endpointId: 'ep12345678', - currency: 'RMB' + endpointId: 'ep12345678' + }, + getFloor: function() { + return { + currency: 'USD', + floor: 0.1 + } } } ]; @@ -292,7 +297,9 @@ describe('Opera Ads Bid Adapter', function () { requestData = JSON.parse(req.data); }).to.not.throw(); - expect(requestData.cur).to.be.an('array').that.includes('RMB'); + expect(requestData.imp).to.be.an('array').that.have.lengthOf(1); + expect(requestData.imp[0].bidfloor).to.be.equal(0.1); + expect(requestData.imp[0].bidfloorcur).to.be.equal('USD'); } }); From 695e4803c97964197beb1799e14a7b79fbe96f3b Mon Sep 17 00:00:00 2001 From: AdmixerTech <35560933+AdmixerTech@users.noreply.github.com> Date: Mon, 30 Aug 2021 21:16:12 +0300 Subject: [PATCH 002/250] change request method (#7360) Co-authored-by: atkachov --- modules/admixerBidAdapter.js | 5 ++--- test/spec/modules/admixerBidAdapter_spec.js | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/admixerBidAdapter.js b/modules/admixerBidAdapter.js index 5c01152200e..bb9a6dd44a3 100644 --- a/modules/admixerBidAdapter.js +++ b/modules/admixerBidAdapter.js @@ -46,11 +46,10 @@ export const spec = { Object.keys(bid).forEach(key => imp[key] = bid[key]); payload.imps.push(imp); }); - const payloadString = JSON.stringify(payload); return { - method: 'GET', + method: 'POST', url: endpointUrl || ENDPOINT_URL, - data: `data=${payloadString}`, + data: payload, }; }, /** diff --git a/test/spec/modules/admixerBidAdapter_spec.js b/test/spec/modules/admixerBidAdapter_spec.js index 27dc895e3a4..6dfde0d0652 100644 --- a/test/spec/modules/admixerBidAdapter_spec.js +++ b/test/spec/modules/admixerBidAdapter_spec.js @@ -67,7 +67,7 @@ describe('AdmixerAdapter', function () { it('should add referrer and imp to be equal bidRequest', function () { const request = spec.buildRequests(validRequest, bidderRequest); - const payload = JSON.parse(request.data.substr(5)); + const payload = request.data; expect(payload.referrer).to.not.be.undefined; expect(payload.imps[0]).to.deep.equal(validRequest[0]); }); @@ -75,7 +75,7 @@ describe('AdmixerAdapter', function () { it('sends bid request to ENDPOINT via GET', function () { const request = spec.buildRequests(validRequest, bidderRequest); expect(request.url).to.equal(ENDPOINT_URL); - expect(request.method).to.equal('GET'); + expect(request.method).to.equal('POST'); }); it('sends bid request to CUSTOM_ENDPOINT via GET', function () { @@ -85,7 +85,7 @@ describe('AdmixerAdapter', function () { }); const request = config.runWithBidder(BIDDER_CODE, () => spec.buildRequests(validRequest, bidderRequest)); expect(request.url).to.equal(ENDPOINT_URL_CUSTOM); - expect(request.method).to.equal('GET'); + expect(request.method).to.equal('POST'); }); }); From d16aada3e52ba46a4747c41913704d11e01c4039 Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Mon, 30 Aug 2021 21:48:47 +0300 Subject: [PATCH 003/250] Colossus Bid Adapter: add Unified ID 2.0 (#7358) * add video&native traffic colossus ssp * Native obj validation * Native obj validation #2 * Added size field in requests * fixed test * fix merge conflicts * move to 3.0 * move to 3.0 * fix IE11 new URL issue * fix IE11 new URL issue * fix IE11 new URL issue * https for 3.0 * add https test * add ccp and schain features * fix test * sync with upstream, fix conflicts * Update colossussspBidAdapter.js remove commented code * Update colossussspBidAdapter.js lint fix * identity extensions * identity extensions * fix * fix * fix * fix * fix * add tests for user ids * fix * fix * fix * fix * fix * fix * fix * add gdpr support * add gdpr support * id5id support * Update colossussspBidAdapter.js add bidfloor parameter * Update colossussspBidAdapter.js check bidfloor * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter_spec.js * use floor module * Revert "use floor module" This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad. * use floor module * update to 5v * fix * add uid2 and bidFloor support * fix Co-authored-by: Vladislav Isaiko Co-authored-by: Aiholkin Co-authored-by: Mykhailo Yaremchuk --- modules/colossussspBidAdapter.js | 3 ++- test/spec/modules/colossussspBidAdapter_spec.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 0f7daf8fda9..52865b8085d 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -109,7 +109,8 @@ export const spec = { if (bid.userId) { getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com'); getUserId(placement.eids, bid.userId.idl_env, 'identityLink'); - getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com') + getUserId(placement.eids, bid.userId.id5id, 'id5-sync.com'); + getUserId(placement.eids, bid.userId.uid2 && bid.userId.uid2.id, 'uidapi.com'); getUserId(placement.eids, bid.userId.tdid, 'adserver.org', { rtiPartner: 'TDID' }); diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index 150bcb72121..fa543f28fd1 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -110,6 +110,7 @@ describe('ColossussspAdapter', function () { bid.userId.idl_env = 'idl_env123'; bid.userId.tdid = 'tdid123'; bid.userId.id5id = { uid: 'id5id123' }; + bid.userId.uid2 = { id: 'uid2id123' }; let serverRequest = spec.buildRequests([bid], bidderRequest); it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; @@ -119,11 +120,11 @@ describe('ColossussspAdapter', function () { let placement = placements[i]; expect(placement).to.have.property('eids') expect(placement.eids).to.be.an('array') - expect(placement.eids.length).to.be.equal(4) + expect(placement.eids.length).to.be.equal(5) for (let index in placement.eids) { let v = placement.eids[index]; expect(v).to.have.all.keys('source', 'uids') - expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org', 'id5-sync.com']) + expect(v.source).to.be.oneOf(['britepool.com', 'identityLink', 'adserver.org', 'id5-sync.com', 'uidapi.com']) expect(v.uids).to.be.an('array'); expect(v.uids.length).to.be.equal(1) expect(v.uids[0]).to.have.property('id') From 9960c27682b005ac93af58c6bf2e6db7e4737b75 Mon Sep 17 00:00:00 2001 From: hugopenha-navegg <86666691+hugopenha-navegg@users.noreply.github.com> Date: Tue, 31 Aug 2021 11:11:27 -0300 Subject: [PATCH 004/250] Navegg UserId: add new userid submodule (#7123) * navegg userid * remove unused variable results * fix submodules json * unit test to find navegg id * Adjustments according to revision * new unit tests * add akamai module * add akamai module --- modules/.submodules.json | 1 + modules/naveggIdSystem.js | 90 ++++++++++++++++++++++++ modules/naveggIdSystem.md | 22 ++++++ modules/userId/eids.js | 14 ++-- modules/userId/eids.md | 16 +++-- modules/userId/userId.md | 3 + test/spec/modules/naveggIdSystem_spec.js | 21 ++++++ 7 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 modules/naveggIdSystem.js create mode 100644 modules/naveggIdSystem.md create mode 100644 test/spec/modules/naveggIdSystem_spec.js diff --git a/modules/.submodules.json b/modules/.submodules.json index 1e52b02a358..f08db109bb6 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -31,6 +31,7 @@ "akamaiDAPId", "flocIdSystem", "amxIdSystem", + "naveggId", "imuIdSystem" ], "adpod": [ diff --git a/modules/naveggIdSystem.js b/modules/naveggIdSystem.js new file mode 100644 index 00000000000..c37530b4151 --- /dev/null +++ b/modules/naveggIdSystem.js @@ -0,0 +1,90 @@ +/** + * This module adds naveggId to the User ID module + * The {@link module:modules/userId} module is required + * @module modules/naveggId + * @requires module:modules/userId + */ +import * as utils from '../src/utils.js' +import { submodule } from '../src/hook.js'; +import { getStorageManager } from '../src/storageManager.js'; + +const MODULE_NAME = 'naveggId'; +const OLD_NAVEGG_ID = 'nid'; +const NAVEGG_ID = 'nvggid' + +export const storage = getStorageManager(); + +function readnaveggIdFromLocalStorage() { + return storage.getDataFromLocalStorage(NAVEGG_ID); +} + +function readnaveggIDFromCookie() { + return storage.cookiesAreEnabled ? storage.getCookie(NAVEGG_ID) : null; +} + +function readoldnaveggIDFromCookie() { + return storage.cookiesAreEnabled ? storage.getCookie(OLD_NAVEGG_ID) : null; +} + +function readnvgIDFromCookie() { + return storage.cookiesAreEnabled ? (storage.findSimilarCookies('nvg') ? storage.findSimilarCookies('nvg')[0] : null) : null; +} + +function readnavIDFromCookie() { + return storage.cookiesAreEnabled ? (storage.findSimilarCookies('nav') ? storage.findSimilarCookies('nav')[0] : null) : null; +} + +function readnvgnavFromLocalStorage() { + var i; + const query = '^nvg|^nav'; + for (i in window.localStorage) { + if (i.match(query) || (!query && typeof i === 'string')) { + return storage.getDataFromLocalStorage(i.match(query).input); + } + } +} + +/** @type {Submodule} */ +export const naveggIdSubmodule = { + /** + * used to link submodule with config + * @type {string} + */ + name: MODULE_NAME, + /** + * decode the stored id value for passing to bid requests + * @function + * @param { Object | string | undefined } value + * @return { Object | string | undefined } + */ + decode(value) { + const naveggIdVal = value ? utils.isStr(value) ? value : utils.isPlainObject(value) ? value.id : undefined : undefined; + return naveggIdVal ? { + 'naveggId': naveggIdVal + } : undefined; + }, + /** + * performs action to obtain id and return a value in the callback's response argument + * @function + * @param {SubmoduleConfig} config + * @return {{id: string | undefined } | undefined} + */ + getId() { + let naveggIdStringFromLocalStorage = null; + if (storage.localStorageIsEnabled) { + naveggIdStringFromLocalStorage = readnaveggIdFromLocalStorage() || readnvgnavFromLocalStorage(); + } + + const naveggIdString = naveggIdStringFromLocalStorage || readnaveggIDFromCookie() || readoldnaveggIDFromCookie() || readnvgIDFromCookie() || readnavIDFromCookie(); + + if (typeof naveggIdString == 'string' && naveggIdString) { + try { + return { id: naveggIdString }; + } catch (error) { + utils.logError(error); + } + } + return undefined; + } +}; +submodule('userId', naveggIdSubmodule); diff --git a/modules/naveggIdSystem.md b/modules/naveggIdSystem.md new file mode 100644 index 00000000000..f758fbc9d5d --- /dev/null +++ b/modules/naveggIdSystem.md @@ -0,0 +1,22 @@ +## Navegg User ID Submodule + +For assistance setting up your module please contact us at [prebid@navegg.com](prebid@navegg.com). + +### Prebid Params + +Individual params may be set for the IDx Submodule. +``` +pbjs.setConfig({ + userSync: { + userIds: [{ + name: 'naveggId', + }] + } +}); +``` +## Parameter Descriptions for the `userSync` Configuration Section +The below parameters apply only to the naveggID integration. + +| Param under usersync.userIds[] | Scope | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Required | String | ID of the module - `"naveggId"` | `"naveggId"` | diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 71267616662..f6707f211d2 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -11,6 +11,12 @@ const USER_IDS_CONFIG = { atype: 1 }, + // naveggId + 'naveggId': { + source: 'navegg.com', + atype: 1 + }, + // pubCommonId 'pubcid': { source: 'pubcid.org', @@ -199,15 +205,15 @@ const USER_IDS_CONFIG = { return data.id; } }, - 'deepintentId': { - source: 'deepintent.com', - atype: 3 - }, // Akamai Data Activation Platform (DAP) 'dapId': { source: 'akamai.com', atype: 1 }, + 'deepintentId': { + source: 'deepintent.com', + atype: 3 + }, // Admixer Id 'admixerId': { source: 'admixer.net', diff --git a/modules/userId/eids.md b/modules/userId/eids.md index ab454c54d30..a8e73216327 100644 --- a/modules/userId/eids.md +++ b/modules/userId/eids.md @@ -21,6 +21,14 @@ userIdAsEids = [ }] }, + { + source: 'navegg.com', + uids: [{ + id: 'naveggId', + atype: 1 + }] + }, + { source: 'neustar.biz', uids: [{ @@ -176,17 +184,17 @@ userIdAsEids = [ }] }, { - source: 'admixer.net', + source: 'akamai.com', uids: [{ id: 'some-random-id-value', - atype: 3 + atype: 1 }] }, { - source: 'akamai.com', + source: 'admixer.net', uids: [{ id: 'some-random-id-value', - atype: 1 + atype: 3 }] }, { diff --git a/modules/userId/userId.md b/modules/userId/userId.md index 11bf74e5d87..88460093c63 100644 --- a/modules/userId/userId.md +++ b/modules/userId/userId.md @@ -316,6 +316,9 @@ pbjs.setConfig({ { name: "novatiq", value: { "snowflake": "81b001ec-8914-488c-a96e-8c220d4ee08895ef" } + }, + { + name: 'naveggId', }], syncDelay: 5000 } diff --git a/test/spec/modules/naveggIdSystem_spec.js b/test/spec/modules/naveggIdSystem_spec.js new file mode 100644 index 00000000000..c0973a05372 --- /dev/null +++ b/test/spec/modules/naveggIdSystem_spec.js @@ -0,0 +1,21 @@ +import { naveggIdSubmodule, storage } from 'modules/naveggIdSystem.js'; + +describe('naveggId', function () { + it('should NOT find navegg id', function () { + let id = naveggIdSubmodule.getId(); + + expect(id).to.be.undefined; + }); + + it('getId() should return "test-nid" id from cookie OLD_NAVEGG_ID', function() { + sinon.stub(storage, 'getCookie').withArgs('nid').returns('test-nid'); + let id = naveggIdSubmodule.getId(); + expect(id).to.be.deep.equal({id: 'test-nid'}) + }) + + it('getId() should return "test-nvggid" id from local storage NAVEGG_ID', function() { + sinon.stub(storage, 'getDataFromLocalStorage').withArgs('nvggid').returns('test-ninvggidd'); + let id = naveggIdSubmodule.getId(); + expect(id).to.be.deep.equal({id: 'test-ninvggidd'}) + }) +}); From 60ce3e646cdb746c73100c4f73ba77e327439427 Mon Sep 17 00:00:00 2001 From: Renato Aguilar <41385245+raguilar-ias@users.noreply.github.com> Date: Tue, 31 Aug 2021 09:45:26 -0500 Subject: [PATCH 005/250] iasRtdProvider: implements getTargetingData method (#7344) * PREP-285 Previd v.5 adapter for publisher optimization * PREP-285 update getBidRequestData function response * PREP-285 add test case for getTargetingData function * PREP-185 refactor code * PREP-285 add test cases * PREP-285 fix test case * PREP-285 change to use getAdUnitSizes function to get sizes --- modules/iasRtdProvider.js | 36 ++++++++++++---- test/spec/modules/iasRtdProvider_spec.js | 53 +++++++++++++++--------- 2 files changed, 62 insertions(+), 27 deletions(-) diff --git a/modules/iasRtdProvider.js b/modules/iasRtdProvider.js index bbd2529bf86..a1ff57971ba 100644 --- a/modules/iasRtdProvider.js +++ b/modules/iasRtdProvider.js @@ -7,6 +7,8 @@ import { ajaxBuilder } from '../src/ajax.js'; const MODULE_NAME = 'realTimeData'; const SUBMODULE_NAME = 'ias'; +let bidResponses = {}; + /** * Module init * @param {Object} provider @@ -29,10 +31,11 @@ function stringifySlotSizes(sizes) { return result; } -function stringifySlot(bidRequest) { +function stringifySlot(bidRequest, adUnitPath) { + const sizes = utils.getAdUnitSizes(bidRequest); const id = bidRequest.code; - const ss = stringifySlotSizes(bidRequest.sizes); - const p = bidRequest.bids[0].params.adUnitPath; + const ss = stringifySlotSizes(sizes); + const p = bidRequest.code; const slot = { id, ss, p }; const keyValues = utils.getKeys(slot).map(function (key) { return [key, slot[key]].join(':'); @@ -67,17 +70,16 @@ function shallowMerge(dest, src) { function getBidRequestData(reqBidsConfigObj, callback, config) { const adUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits; - let isFinish = false; const IAS_HOST = 'https://pixel.adsafeprotected.com/services/pub'; - const { pubId } = config.params; + const { pubId, adUnitPath } = config.params; const anId = pubId; let queries = []; queries.push(['anId', anId]); queries = queries.concat(adUnits.reduce(function (acc, request) { - acc.push(['slot', stringifySlot(request)]); + acc.push(['slot', stringifySlot(request, adUnitPath)]); return acc; }, [])); @@ -94,11 +96,15 @@ function getBidRequestData(reqBidsConfigObj, callback, config) { if (!isFinish) { if (request.status === 200) { const iasResponse = JSON.parse(response); + const commonBidResponse = {}; + shallowMerge(commonBidResponse, getPageLevelKeywords(iasResponse)); + commonBidResponse.slots = iasResponse.slots; + bidResponses = commonBidResponse; adUnits.forEach(adUnit => { adUnit.bids.forEach(bid => { const rtd = bid.rtd || {}; const iasRtd = {}; - iasRtd[SUBMODULE_NAME] = Object.assign({}, rtd[SUBMODULE_NAME], getPageLevelKeywords(iasResponse)); + iasRtd[SUBMODULE_NAME] = Object.assign({}, rtd[SUBMODULE_NAME], bidResponses); bid.rtd = Object.assign({}, rtd, iasRtd); }); }); @@ -114,11 +120,25 @@ function getBidRequestData(reqBidsConfigObj, callback, config) { }); } +function getTargetingData(adUnits, config, userConsent) { + const targeting = {}; + Object.keys(bidResponses).forEach(key => bidResponses[key] === undefined ? delete bidResponses[key] : {}); + try { + adUnits.forEach(function(adUnit) { + targeting[adUnit] = bidResponses; + }); + } catch (err) { + utils.logError('error', err); + } + return targeting; +} + /** @type {RtdSubmodule} */ export const iasSubModule = { name: SUBMODULE_NAME, init: init, - getBidRequestData: getBidRequestData + getBidRequestData: getBidRequestData, + getTargetingData: getTargetingData }; submodule(MODULE_NAME, iasSubModule); diff --git a/test/spec/modules/iasRtdProvider_spec.js b/test/spec/modules/iasRtdProvider_spec.js index 778a3a81b9b..e5e12355566 100644 --- a/test/spec/modules/iasRtdProvider_spec.js +++ b/test/spec/modules/iasRtdProvider_spec.js @@ -1,5 +1,6 @@ import { iasSubModule } from 'modules/iasRtdProvider.js'; import { expect } from 'chai'; +import { server } from 'test/mocks/xhr.js'; describe('iasRtdProvider is a RTD provider that', function () { it('has the correct module name', function () { @@ -14,14 +15,6 @@ describe('iasRtdProvider is a RTD provider that', function () { }); }); describe('has a method `getBidRequestData` that', function () { - const callback = sinon.spy(); - const config = { - name: 'ias', - waitForIt: true, - params: { - pubId: 1234 - } - }; it('exists', function () { expect(iasSubModule.getBidRequestData).to.be.a('function'); }); @@ -32,43 +25,65 @@ describe('iasRtdProvider is a RTD provider that', function () { expect(config.params).to.have.property('pubId'); }); it('invoke method', function () { + const callback = sinon.spy(); + let request; + const adUnitsOriginal = adUnits; iasSubModule.getBidRequestData({ adUnits: adUnits }, callback, config); + request = server.requests[0]; + server.respond(); + expect(request.url).to.be.include(`https://pixel.adsafeprotected.com/services/pub?anId=1234`); expect(adUnits).to.length(2); - expect(callback.calledOnce).to.be.false; + expect(adUnits[0]).to.be.eq(adUnitsOriginal[0]); + }); + }); + + describe('has a method `getTargetingData` that', function () { + it('exists', function () { + expect(iasSubModule.getTargetingData).to.be.a('function'); + }); + it('invoke method', function () { + const targeting = iasSubModule.getTargetingData(adUnits, config); + expect(adUnits).to.length(2); + expect(targeting).to.be.not.null; + expect(targeting).to.be.not.empty; }); }); }); +const config = { + name: 'ias', + waitForIt: true, + params: { + pubId: 1234 + } +}; + const adUnits = [ { code: 'one-div-id', mediaTypes: { banner: { - sizes: [[970, 250], [728, 90], [1000, 90]] + sizes: [970, 250] } }, - sizes: [[970, 250], [728, 90], [1000, 90]], bids: [ { - bidder: 'ias', + bidder: 'appnexus', params: { - pubId: '1234', - adUnitPath: '/a/b/c' + placementId: 12345370, } }] }, { code: 'two-div-id', mediaTypes: { - banner: { sizes: [[300, 250], [300, 600]] } + banner: { sizes: [300, 250] } }, - sizes: [[300, 250], [300, 600]], bids: [ { - bidder: 'ias', + bidder: 'appnexus', params: { - pubId: '1234', - adUnitPath: '/d/e/f' + placementId: 12345370, } }] }]; From ad8f4cc2ebf3e575b97746035498077ffccdfa3b Mon Sep 17 00:00:00 2001 From: Prebid-bydata <71428180+Prebid-bydata@users.noreply.github.com> Date: Tue, 31 Aug 2021 20:16:01 +0530 Subject: [PATCH 006/250] byData Analytics Adapter: add new analytics adapter (#7260) * initial commit-byDataAnalyticsAdapter * update metadata fields at byDataAnalyticsAdapter.md * eslint import error fixed * update unneeded defective code and insecure randomness * updated unique userid function * samplerate update-suggested changes Co-authored-by: Jitendra Kumar --- modules/byDataAnalyticsAdapter.js | 311 ++++++++++++++++++ modules/byDataAnalyticsAdapter.md | 34 ++ .../modules/byDataAnalyticsAdapter_spec.js | 139 ++++++++ 3 files changed, 484 insertions(+) create mode 100644 modules/byDataAnalyticsAdapter.js create mode 100644 modules/byDataAnalyticsAdapter.md create mode 100644 test/spec/modules/byDataAnalyticsAdapter_spec.js diff --git a/modules/byDataAnalyticsAdapter.js b/modules/byDataAnalyticsAdapter.js new file mode 100644 index 00000000000..0f1d59024b7 --- /dev/null +++ b/modules/byDataAnalyticsAdapter.js @@ -0,0 +1,311 @@ +import Base64 from 'crypto-js/enc-base64'; +import hmacSHA512 from 'crypto-js/hmac-sha512'; +import enc from 'crypto-js/enc-utf8'; +import adapter from '../src/AnalyticsAdapter.js'; +import CONSTANTS from '../src/constants.json'; +import adapterManager from '../src/adapterManager.js'; +import { ajax } from '../src/ajax.js'; +import * as utils from '../src/utils.js'; + +const secretKey = 'bydata@123456'; +const { EVENTS: { NO_BID, BID_TIMEOUT, AUCTION_END } } = CONSTANTS; +const DEFAULT_EVENT_URL = 'https://pbjs-stream.bydata.com/topics/prebid'; +const analyticsType = 'endpoint'; +var payload = {}; +var bdNbTo = { 'to': [], 'nb': [] }; +let initOptions = {}; + +function onBidTimeout(t) { + if (payload['visitor_data'] && t && t.length > 0) { + bdNbTo['to'] = t; + } +} + +function onNoBidData(t) { + if (payload['visitor_data'] && t) { + bdNbTo['nb'].push(t); + } +} + +function onAuctionEnd(t) { + logInfo('onAuctionEnd', t); + const {isCorrectOption, logFrequency} = initOptions; + var value = Math.floor(Math.random() * 10000 + 1); + logInfo(' value - frequency ', (value + '-' + logFrequency)); + setTimeout(() => { + if (isCorrectOption && value < logFrequency) { + ascAdapter.dataProcess(t); + addKeyForPrebidWinningAndWinningsBids(); + ascAdapter.sendPayload(); + } + }, 500); +} + +const ascAdapter = Object.assign(adapter({ url: DEFAULT_EVENT_URL, analyticsType: analyticsType }), { + track({ eventType, args }) { + switch (eventType) { + case NO_BID: + onNoBidData(args); + break; + case BID_TIMEOUT: + onBidTimeout(args); + break; + case AUCTION_END: + onAuctionEnd(args); + break; + default: + break; + } + } +}); + +// save the base class function +ascAdapter.originEnableAnalytics = ascAdapter.enableAnalytics; +// override enableAnalytics so we can get access to the config passed in from the page +ascAdapter.enableAnalytics = function(config) { + if (this.initConfig(config)) { + logInfo('initiated:', initOptions); + initOptions.isCorrectOption && ascAdapter.getVisitorData(); + ascAdapter.originEnableAnalytics(config); + } +}; + +ascAdapter.initConfig = function (config) { + let isCorrectOption = true; + initOptions = {}; + logInfo('initConfig', config); + initOptions.options = utils.deepClone(config.options); + initOptions.clientId = initOptions.options.clientId || null; + initOptions.logFrequency = initOptions.options.logFrequency; + if (!initOptions.clientId) { + logError('"options.clientId" should not empty!!'); + isCorrectOption = false; + } + initOptions.isCorrectOption = isCorrectOption; + this.initOptions = initOptions; + return isCorrectOption; +}; + +ascAdapter.getVisitorData = function(data = {}) { + var ua = data.userId ? data : {}; + var module = { + options: [], + header: [window.navigator.platform, window.navigator.userAgent, window.navigator.appVersion, window.navigator.vendor, window.opera], + dataos: [ + { name: 'Windows Phone', value: 'Windows Phone', version: 'OS' }, + { name: 'Windows', value: 'Win', version: 'NT' }, + { name: 'iPhone', value: 'iPhone', version: 'OS' }, + { name: 'iPad', value: 'iPad', version: 'OS' }, + { name: 'Kindle', value: 'Silk', version: 'Silk' }, + { name: 'Android', value: 'Android', version: 'Android' }, + { name: 'PlayBook', value: 'PlayBook', version: 'OS' }, + { name: 'BlackBerry', value: 'BlackBerry', version: '/' }, + { name: 'Macintosh', value: 'Mac', version: 'OS X' }, + { name: 'Linux', value: 'Linux', version: 'rv' }, + { name: 'Palm', value: 'Palm', version: 'PalmOS' } + ], + databrowser: [ + { name: 'Chrome', value: 'Chrome', version: 'Chrome' }, + { name: 'Firefox', value: 'Firefox', version: 'Firefox' }, + { name: 'Safari', value: 'Safari', version: 'Version' }, + { name: 'Internet Explorer', value: 'MSIE', version: 'MSIE' }, + { name: 'Opera', value: 'Opera', version: 'Opera' }, + { name: 'BlackBerry', value: 'CLDC', version: 'CLDC' }, + { name: 'Mozilla', value: 'Mozilla', version: 'Mozilla' } + ], + init: function () { var agent = this.header.join(' '); var os = this.matchItem(agent, this.dataos); var browser = this.matchItem(agent, this.databrowser); return { os: os, browser: browser }; }, + matchItem: function (string, data) { + var i = 0; var j = 0; var regex; var regexv; var match; var matches; var version; + for (i = 0; i < data.length; i += 1) { + regex = new RegExp(data[i].value, 'i'); + match = regex.test(string); + if (match) { + regexv = new RegExp(data[i].version + '[- /:;]([\\d._]+)', 'i'); + matches = string.match(regexv); + version = ''; + if (matches) { if (matches[1]) { matches = matches[1]; } } + if (matches) { + matches = matches.split(/[._]+/); + for (j = 0; j < matches.length; j += 1) { + if (j === 0) { + version += matches[j] + '.'; + } else { + version += matches[j]; + } + } + } else { + version = '0'; + } + return { + name: data[i].name, + version: parseFloat(version) + }; + } + } + return { name: 'unknown', version: 0 }; + } + }; + + function generateUid() { + try { + var buffer = new Uint8Array(16); + crypto.getRandomValues(buffer); + buffer[6] = (buffer[6] & ~176) | 64; + buffer[8] = (buffer[8] & ~64) | 128; + var hex = Array.prototype.map.call(new Uint8Array(buffer), function(x) { + return ('00' + x.toString(16)).slice(-2); + }).join(''); + return hex.slice(0, 5) + '-' + hex.slice(5, 9) + '-' + hex.slice(9, 13) + '-' + hex.slice(13, 18); + } catch (e) { + return ''; + } + } + function base64url(source) { + var encodedSource = Base64.stringify(source); + encodedSource = encodedSource.replace(/=+$/, ''); + encodedSource = encodedSource.replace(/\+/g, '-'); + encodedSource = encodedSource.replace(/\//g, '_'); + return encodedSource; + } + function getJWToken(data) { + var header = { + 'alg': 'HS256', + 'typ': 'JWT' + }; + var stringifiedHeader = enc.parse(JSON.stringify(header)); + var encodedHeader = base64url(stringifiedHeader); + var stringifiedData = enc.parse(JSON.stringify(data)); + var encodedData = base64url(stringifiedData); + var token = encodedHeader + '.' + encodedData; + var signature = hmacSHA512(token, secretKey); + signature = base64url(signature); + var signedToken = token + '.' + signature; + return signedToken; + } + const {clientId} = initOptions; + var userId = window.localStorage.getItem('userId'); + if (!userId) { + userId = generateUid(); + window.localStorage.setItem('userId', userId); + } + var screenSize = {width: window.screen.width, height: window.screen.height}; + var deviceType = window.navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) ? 'Mobile' : 'Desktop'; + var e = module.init(); + if (!ua['userId']) { + ua['userId'] = userId; + ua['client_id'] = clientId; + ua['plateform_name'] = e.os.name; + ua['os_version'] = e.os.version; + ua['browser_name'] = e.browser.name; + ua['browser_version'] = e.browser.version; + ua['screen_size'] = screenSize; + ua['device_type'] = deviceType; + ua['time_zone'] = window.Intl.DateTimeFormat().resolvedOptions().timeZone; + } + var signedToken = getJWToken(ua); + payload['visitor_data'] = signedToken; + return signedToken; +} + +ascAdapter.dataProcess = function(t) { + payload['auction_id'] = t.auctionId; + payload['auction_start'] = t.timestamp; + payload['auctionData'] = []; + var bidderRequestsData = []; var bidsReceivedData = []; + t.bidderRequests && t.bidderRequests.forEach(bidReq => { + var pObj = {}; pObj['bids'] = []; + bidReq.bids.forEach(bid => { + var data = {}; + data['adUnitCode'] = bid.adUnitCode; + data['sizes'] = bid.sizes; + data['bidder'] = bid.bidder; + data['bidId'] = bid.bidId; + data['mediaTypes'] = []; + var mt = bid.mediaTypes.banner ? 'display' : 'video'; + data['mediaTypes'].push(mt); + pObj['bids'].push(data); + }) + bidderRequestsData.push(pObj); + }); + t.bidsReceived && t.bidsReceived.forEach(bid => { + const {requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode} = bid; + bidsReceivedData.push({requestId, bidder, width, height, cpm, currency, timeToRespond, adUnitCode}); + }); + bidderRequestsData.length > 0 && bidderRequestsData.forEach(bdObj => { + var bdsArray = bdObj['bids']; + bdsArray.forEach(bid => { + const {adUnitCode, sizes, bidder, bidId, mediaTypes} = bid; + sizes.forEach(size => { + var sstr = size[0] + 'x' + size[1] + payload['auctionData'].push({adUnit: adUnitCode, size: sstr, media_type: mediaTypes[0], bids_bidder: bidder, bids_bid_id: bidId}); + }); + }); + }); + bidsReceivedData.length > 0 && bidsReceivedData.forEach(bdRecived => { + const {requestId, bidder, width, height, cpm, currency, timeToRespond} = bdRecived; + payload['auctionData'].forEach(rwData => { + if (rwData['bids_bid_id'] === requestId && rwData['size'] === width + 'x' + height) { + rwData['br_request_id'] = requestId; rwData['br_bidder'] = bidder; rwData['br_pb_mg'] = cpm; + rwData['br_currency'] = currency; rwData['br_time_to_respond'] = timeToRespond; rwData['br_size'] = width + 'x' + height; + } + }) + }); + payload['auctionData'] && payload['auctionData'].length > 0 && payload['auctionData'].forEach(u => { + bdNbTo['to'].forEach(i => { + if (u.bids_bid_id === i.bidId) u.is_timeout = 1; + }); + bdNbTo['nb'].forEach(i => { + if (u.adUnit === i.adUnitCode && u.bids_bidder === i.bidder && u.bids_bid_id === i.bidId) { u.is_nobid = 1; } + }) + }); + return payload; +} + +ascAdapter.sendPayload = function () { + var obj = { 'records': [ { 'value': payload } ] }; + let strJSON = JSON.stringify(obj); + logInfo(' sendPayload ', JSON.stringify(obj)); + ajax(DEFAULT_EVENT_URL, undefined, strJSON, { + contentType: 'application/vnd.kafka.json.v2+json', + method: 'POST', + withCredentials: true + }); +} + +function addKeyForPrebidWinningAndWinningsBids() { + var prebidWinningBids = $$PREBID_GLOBAL$$.getAllPrebidWinningBids(); + var winningBids = $$PREBID_GLOBAL$$.getAllWinningBids(); + prebidWinningBids && prebidWinningBids.length > 0 && prebidWinningBids.forEach(pbbid => { + payload['auctionData'] && payload['auctionData'].forEach(rwData => { + if (rwData['bids_bid_id'] === pbbid.requestId && rwData['br_size'] === pbbid.size) { + rwData['is_prebid_winning_bid'] = 1; + } + }); + }) + winningBids && winningBids.length > 0 && winningBids.forEach(wBid => { + payload['auctionData'] && payload['auctionData'].forEach(rwData => { + if (rwData['bids_bid_id'] === wBid.requestId && rwData['br_size'] === wBid.size) { + rwData['is_winning_bid'] = 1; + } + }); + }) +} + +adapterManager.registerAnalyticsAdapter({ + adapter: ascAdapter, + code: 'bydata' +}); + +function logInfo(message, meta) { + utils.logInfo(buildLogMessage(message), meta); +} + +function logError(message) { + utils.logError(buildLogMessage(message)); +} + +function buildLogMessage(message) { + return 'Bydata Prebid Analytics: ' + message; +} + +export default ascAdapter; diff --git a/modules/byDataAnalyticsAdapter.md b/modules/byDataAnalyticsAdapter.md new file mode 100644 index 00000000000..84207d8b3a1 --- /dev/null +++ b/modules/byDataAnalyticsAdapter.md @@ -0,0 +1,34 @@ +# Overview + +layout: Analytics Adapter +title: Ascendeum Pvt Ltd. (https://ascendeum.com/) +description: Bydata Analytics Adapter +modulecode: byDataAnalyticsAdapter +gdpr_supported: false (EU GDPR support) +usp_supported: false (US Privacy support) +coppa_supported: false (COPPA support) +prebid_member: false +gvl_id: (IAB Global Vendor List ID) +enable_download: false (in case you don't want users of the website to download your adapter) + +Module Name: Bydata Analytics Adapter +Module Type: Analytics Adapter +Maintainer: Ascendeum + +# Description + +Analytics adapter for https://ascendeum.com/. Contact engineering@ascendeum.com for information. + +# Test Parameters + +``` +{ + provider: 'bydata', + options : { + clientId: "ASCENDEUM_PROVIDED_CLIENT_ID", + logFrequency : 100, // Sample Rate Default - 1% + } +} +``` + + diff --git a/test/spec/modules/byDataAnalyticsAdapter_spec.js b/test/spec/modules/byDataAnalyticsAdapter_spec.js new file mode 100644 index 00000000000..90b4e1d53a6 --- /dev/null +++ b/test/spec/modules/byDataAnalyticsAdapter_spec.js @@ -0,0 +1,139 @@ +import ascAdapter from 'modules/byDataAnalyticsAdapter'; +import { expect } from 'chai'; +let adapterManager = require('src/adapterManager').default; +let events = require('src/events'); +let constants = require('src/constants.json'); +let auctionId = 'b70ef967-5c5b-4602-831e-f2cf16e59af2'; +const initOptions = { + clientId: 'asc00000', + logFrequency: 1, +}; +let userData = { + userId: '5da77-ec87-277b-8e7a5', + client_id: 'asc00000', + plateform_name: 'Macintosh', + os_version: 10.157, + browser_name: 'Chrome', + browser_version: 92.04515107, + screen_size: { + width: 1440, + height: 900 + }, + device_type: 'Desktop', + time_zone: 'Asia/Calcutta' +}; +let bidTimeoutArgs = [{ + auctionId, + bidId: '12e90cb5ddc5dea', + bidder: 'appnexus', + adUnitCode: 'div-gpt-ad-mrec1' +}]; +let noBidArgs = { + adUnitCode: 'div-gpt-ad-mrec1', + auctionId, + bidId: '14480e9832f2d2b', + bidder: 'appnexus', + bidderRequestId: '13b87b6c20d3636', + mediaTypes: {banner: {sizes: [[300, 250], [250, 250]]}}, + sizes: [[300, 250], [250, 250]], + src: 'client', + transactionId: 'c8ee3914-1ee0-4ce6-9126-748d5692188c' +} +let auctionEndArgs = { + adUnitCodes: ['div-gpt-ad-mrec1'], + adUnits: [{ + code: 'div-gpt-ad-mrec1', + mediaTypes: {banner: {sizes: [[300, 250], [250, 250]]}}, + sizes: [[300, 250], [250, 250]], + bids: [{bidder: 'appnexus', params: {placementId: '19305195'}}], + transactionId: 'c8ee3914-1ee0-4ce6-9126-748d5692188c' + }], + auctionEnd: 1627973487504, + auctionId, + auctionStatus: 'completed', + timestamp: 1627973484504, + bidsReceived: [], + bidderRequests: [{ + auctionId, + auctionStart: 1627973484504, + bidderCode: 'appnexus', + bidderRequestId: '13b87b6c20d3636', + bids: [ + { + adUnitCode: 'div-gpt-ad-mrec1', + auctionId, + bidId: '14480e9832f2d2b', + bidder: 'appnexus', + bidderRequestId: '13b87b6c20d3636', + src: 'client', + mediaTypes: {banner: {sizes: [[300, 250], [250, 250]]}}, + sizes: [[300, 250], [250, 250]], + transactionId: 'c8ee3914-1ee0-4ce6-9126-748d5692188c' + } + ] + }] +} +let expectedDataArgs = { + visitor_data: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1ZGE3Ny1lYzg3LTI3N2ItOGU3YTUiLCJjbGllbnRfaWQiOiJhc2MwMDAwMCIsInBsYXRlZm9ybV9uYW1lIjoiTWFjaW50b3NoIiwib3NfdmVyc2lvbiI6MTAuMTU3LCJicm93c2VyX25hbWUiOiJDaHJvbWUiLCJicm93c2VyX3ZlcnNpb24iOjkyLjA0NTE1MTA3LCJzY3JlZW5fc2l6ZSI6eyJ3aWR0aCI6MTQ0MCwiaGVpZ2h0Ijo5MDB9LCJkZXZpY2VfdHlwZSI6IkRlc2t0b3AiLCJ0aW1lX3pvbmUiOiJBc2lhL0NhbGN1dHRhIn0.jNKjsb3Q-ZjkVMcbss_dQFOmu_GdkGqd7t9MbRmqlG4YEMorcJHhUVmUuPi-9pKvC9_t4XlgjED90UieCvdxCQ', + auction_id: auctionId, + auction_start: 1627973484504, + auctionData: [ { + 'adUnit': 'div-gpt-ad-mrec1', + 'size': '300x250', + 'media_type': 'display', + 'bids_bidder': 'appnexus', + 'bids_bid_id': '14480e9832f2d2b' + }, { + 'adUnit': 'div-gpt-ad-mrec1', + 'size': '250x250', + 'media_type': 'display', + 'bids_bidder': 'appnexus', + 'bids_bid_id': '14480e9832f2d2b' + }] +} + +describe('byData Analytics Adapter ', () => { + beforeEach(() => { + sinon.stub(events, 'getEvents').returns([]); + }); + afterEach(() => { + events.getEvents.restore(); + }); + + describe('enableAnalytics ', function () { + beforeEach(() => { + sinon.spy(ascAdapter, 'track'); + }); + afterEach(() => { + ascAdapter.disableAnalytics(); + ascAdapter.track.restore(); + }); + it('should init with correct options', function () { + ascAdapter.enableAnalytics(initOptions) + // Step 1: Initialize adapter + adapterManager.enableAnalytics({ + provider: 'bydata', + options: initOptions + }); + expect(ascAdapter.initOptions).to.have.property('clientId', 'asc00000'); + expect(ascAdapter.initOptions).to.have.property('logFrequency', 1); + }); + }); + + describe('track-events', function () { + ascAdapter.enableAnalytics(initOptions) + // Step 1: Initialize adapter + adapterManager.enableAnalytics({ + provider: 'bydata', + options: initOptions + }); + it('sends and formatted auction data ', function () { + events.emit(constants.EVENTS.BID_TIMEOUT, bidTimeoutArgs); + events.emit(constants.EVENTS.NO_BID, noBidArgs); + var userToken = ascAdapter.getVisitorData(userData); + var newAuData = ascAdapter.dataProcess(auctionEndArgs); + newAuData['visitor_data'] = userToken; + expect(newAuData).to.deep.equal(expectedDataArgs); + }); + }); +}); From 46751bd0112cc7f11b09e8ebbc1b6b75e6ff1045 Mon Sep 17 00:00:00 2001 From: eknis Date: Tue, 31 Aug 2021 23:46:18 +0900 Subject: [PATCH 007/250] im rtd segment module (#7359) --- .../gpt/imRtdProvider_example.html | 115 ++++++++++ modules/imRtdProvider.js | 197 ++++++++++++++++++ modules/imRtdProvider.md | 41 ++++ test/spec/modules/imRtdProvider_spec.js | 151 ++++++++++++++ 4 files changed, 504 insertions(+) create mode 100644 integrationExamples/gpt/imRtdProvider_example.html create mode 100644 modules/imRtdProvider.js create mode 100644 modules/imRtdProvider.md create mode 100644 test/spec/modules/imRtdProvider_spec.js diff --git a/integrationExamples/gpt/imRtdProvider_example.html b/integrationExamples/gpt/imRtdProvider_example.html new file mode 100644 index 00000000000..b98f053047b --- /dev/null +++ b/integrationExamples/gpt/imRtdProvider_example.html @@ -0,0 +1,115 @@ + + + + + + + + + + + + + +

IM RTD Prebid

+ +
+ +
+ +Intimate Merger Universal Identifier: +
+ +Intimate Merger Real-Time Data: +
+ + diff --git a/modules/imRtdProvider.js b/modules/imRtdProvider.js new file mode 100644 index 00000000000..db2c51ccf51 --- /dev/null +++ b/modules/imRtdProvider.js @@ -0,0 +1,197 @@ +/** + * The {@link module:modules/realTimeData} module is required + * The module will fetch real-time data from Intimate Merger + * @module modules/imRtdProvider + * @requires module:modules/realTimeData + */ +import {ajax} from '../src/ajax.js'; +import {config} from '../src/config.js'; +import {getGlobal} from '../src/prebidGlobal.js' +import {getStorageManager} from '../src/storageManager.js'; +import { + deepSetValue, + deepAccess, + timestamp, + mergeDeep, + logError, + logInfo, + isFn +} from '../src/utils.js' +import {submodule} from '../src/hook.js'; + +export const imUidLocalName = '__im_uid'; +export const imVidCookieName = '_im_vid'; +export const imRtdLocalName = '__im_sids'; +export const storage = getStorageManager(); +const submoduleName = 'im'; +const segmentsMaxAge = 3600000; // 1 hour (30 * 60 * 1000) +const uidMaxAge = 1800000; // 30 minites (30 * 60 * 1000) +const vidMaxAge = 97200000000; // 37 months ((365 * 3 + 30) * 24 * 60 * 60 * 1000) + +function setImDataInCookie(value) { + storage.setCookie( + imVidCookieName, + value, + new Date(timestamp() + vidMaxAge).toUTCString(), + 'none' + ); +} + +export function getCustomBidderFunction(config, bidder) { + const overwriteFn = deepAccess(config, `params.overwrites.${bidder}`) + + if (overwriteFn && isFn(overwriteFn)) { + return overwriteFn + } else { + return null + } +} + +/** + * Add real-time data. + * @param {Object} bidConfig + * @param {Object} moduleConfig + * @param {Object} data + */ +export function setRealTimeData(bidConfig, moduleConfig, data) { + const adUnits = bidConfig.adUnits || getGlobal().adUnits; + const utils = {deepSetValue, deepAccess, logInfo, logError, mergeDeep}; + + if (data.im_segments) { + const ortb2 = config.getConfig('ortb2') || {}; + deepSetValue(ortb2, 'user.ext.data.im_segments', data.im_segments); + config.setConfig({ortb2: ortb2}); + + if (moduleConfig.params.setGptKeyValues || !moduleConfig.params.hasOwnProperty('setGptKeyValues')) { + window.googletag = window.googletag || {cmd: []}; + window.googletag.cmd = window.googletag.cmd || []; + window.googletag.cmd.push(() => { + window.googletag.pubads().setTargeting('im_segments', data.im_segments); + }); + } + } + + adUnits.forEach(adUnit => { + adUnit.bids.forEach(bid => { + const overwriteFunction = getCustomBidderFunction(moduleConfig, bid.bidder); + if (overwriteFunction) { + overwriteFunction(bid, data, utils, config); + } + }) + }); +} + +/** + * Real-time data retrieval from Intimate Merger + * @param {Object} reqBidsConfigObj + * @param {function} onDone + * @param {Object} moduleConfig + */ +export function getRealTimeData(reqBidsConfigObj, onDone, moduleConfig) { + const cid = deepAccess(moduleConfig, 'params.cid'); + if (!cid) { + logError('imRtdProvider requires a valid cid to be defined'); + onDone(); + return; + } + const sids = storage.getDataFromLocalStorage(imRtdLocalName); + const parsedSids = sids ? sids.split(',') : []; + const mt = storage.getDataFromLocalStorage(`${imRtdLocalName}_mt`); + const localVid = storage.getCookie(imVidCookieName); + let apiUrl = `https://sync6.im-apps.net/${cid}/rtd`; + let expired = true; + let alreadyDone = false; + + if (localVid) { + apiUrl += `?vid=${localVid}`; + setImDataInCookie(localVid); + } + + if (Date.parse(mt) && Date.now() - (new Date(mt)).getTime() < segmentsMaxAge) { + expired = false; + } + + if (sids !== null) { + setRealTimeData(reqBidsConfigObj, moduleConfig, {im_segments: parsedSids}); + onDone(); + alreadyDone = true; + } + + if (expired) { + ajax( + apiUrl, + getApiCallback(reqBidsConfigObj, alreadyDone ? undefined : onDone, moduleConfig), + undefined, + {method: 'GET', withCredentials: true} + ); + } +} + +/** + * Api callback from Intimate Merger + * @param {Object} reqBidsConfigObj + * @param {function} onDone + * @param {Object} moduleConfig + */ +export function getApiCallback(reqBidsConfigObj, onDone, moduleConfig) { + return { + success: function (response, req) { + let parsedResponse = {}; + if (req.status === 200) { + try { + parsedResponse = JSON.parse(response); + } catch (e) { + logError('unable to get Intimate Merger segment data'); + } + + if (parsedResponse.uid) { + const imuid = storage.getDataFromLocalStorage(imUidLocalName); + const imuidMt = storage.getDataFromLocalStorage(`${imUidLocalName}_mt`); + const imuidExpired = Date.parse(imuidMt) && Date.now() - (new Date(imuidMt)).getTime() < uidMaxAge; + if (!imuid || imuidExpired) { + storage.setDataInLocalStorage(imUidLocalName, parsedResponse.uid); + storage.setDataInLocalStorage(`${imUidLocalName}_mt`, new Date(timestamp()).toUTCString()); + } + } + + if (parsedResponse.vid) { + setImDataInCookie(parsedResponse.vid); + } + + if (parsedResponse.segments) { + setRealTimeData(reqBidsConfigObj, moduleConfig, {im_segments: parsedResponse.segments}); + storage.setDataInLocalStorage(imRtdLocalName, parsedResponse.segments); + storage.setDataInLocalStorage(`${imRtdLocalName}_mt`, new Date(timestamp()).toUTCString()); + } + } + if (onDone) { + onDone(); + } + }, + error: function () { + if (onDone) { + onDone(); + } + logError('unable to get Intimate Merger segment data'); + } + } +} + +/** + * Module init + * @param {Object} provider + * @param {Object} userConsent + * @return {boolean} + */ +function init(provider, userConsent) { + return true; +} + +/** @type {RtdSubmodule} */ +export const imRtdSubmodule = { + name: submoduleName, + getBidRequestData: getRealTimeData, + init: init +}; + +submodule('realTimeData', imRtdSubmodule); diff --git a/modules/imRtdProvider.md b/modules/imRtdProvider.md new file mode 100644 index 00000000000..7ece2b996b4 --- /dev/null +++ b/modules/imRtdProvider.md @@ -0,0 +1,41 @@ +## Intimate Merger Real-time Data Submodule + +provided by Intimate Merger. + +## Building Prebid with Real-time Data Support + +First, make sure to add the Intimate Merger submodule to your Prebid.js package with: + +`gulp build --modules=rtdModule,imRtdProvider` + +The following configuration parameters are available: + +``` +pbjs.setConfig( + ... + realTimeData: { + auctionDelay: 5000, + dataProviders: [ + { + name: "im", + waitForIt: true, + params: { + cid: 5126, // Set your Intimate Merger Customer ID here for production + setGptKeyValues: true + } + } + ] + } + ... +} +``` + +### Parameter Descriptions for the im Configuration Section + +| Param under dataProviders | Scope | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Required | String | The name of this module. | `"im"` | +| waitForIt | Optional | Boolean | Required to ensure that the auction is delayed until prefetch is complete. Defaults to false but recommended to true | `true` | +| params | Required | Object | Details of module params. | | +| params.cid | Required | Number | This is the Customer ID value obtained via Intimate Merger. | `5126` | +| params.setGptKeyValues | Optional | Boolean | This is set targeting for GPT/GAM. Default setting is true. | `true` | diff --git a/test/spec/modules/imRtdProvider_spec.js b/test/spec/modules/imRtdProvider_spec.js new file mode 100644 index 00000000000..58410dc0e38 --- /dev/null +++ b/test/spec/modules/imRtdProvider_spec.js @@ -0,0 +1,151 @@ +import { + imRtdSubmodule, + storage, + getCustomBidderFunction, + setRealTimeData, + getRealTimeData, + getApiCallback, + imUidLocalName, + imVidCookieName, + imRtdLocalName +} from 'modules/imRtdProvider.js' +import { timestamp } from '../../../src/utils.js' + +describe('imRtdProvider', function () { + let getLocalStorageStub; + let getCookieStub; + + const testReqBidsConfigObj = { + adUnits: [ + { + bids: ['test1', 'test2'] + } + ] + }; + const onDone = function() { return true }; + const moduleConfig = { + params: { + cid: 5126, + setGptKeyValues: true + } + } + + beforeEach(function (done) { + getLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage'); + getCookieStub = sinon.stub(storage, 'getCookie'); + done(); + }); + + afterEach(function () { + getLocalStorageStub.restore(); + getCookieStub.restore(); + }); + + describe('imRtdSubmodule', function () { + it('should initalise and return true', function () { + expect(imRtdSubmodule.init()).to.equal(true) + }) + }) + + describe('getCustomBidderFunction', function () { + it('should return config function', function () { + const config = { + params: { + overwrites: { + testBidder: function() { + return 'testString'; + } + } + } + }; + const bidder = 'testBidder' + expect(getCustomBidderFunction(config, bidder)).to.exist.and.to.be.a('function'); + expect(getCustomBidderFunction(config, bidder)()).to.equal('testString'); + }) + it('should return null when overwrites falsy', function () { + const config = { + params: { + overwrites: { + testBidder: null + } + } + }; + const bidder = 'testBidder' + expect(getCustomBidderFunction(config, bidder)).to.equal(null); + }) + }) + + describe('processBidderFunction', function () { + + }) + + describe('setRealTimeData', function () { + it('should return true when empty params', function () { + expect(setRealTimeData({adUnits: []}, {params: {}}, {im_segments: []})).to.equal(undefined) + }); + it('should return true when overwrites and bid params', function () { + const config = { + params: { + overwrites: { + testBidder: function() { return true } + } + } + }; + expect(setRealTimeData(testReqBidsConfigObj, config, {im_segments: []})).to.equal(undefined) + }); + }) + + describe('getRealTimeData', function () { + it('should initalise and return when empty params', function () { + expect(getRealTimeData({}, function() {}, {})).to.equal(undefined) + }); + + it('should initalise and return with config', function () { + expect(getRealTimeData(testReqBidsConfigObj, onDone, moduleConfig)).to.equal(undefined) + }); + + it('should return the uid when sids(rtd) not expired', function () { + getLocalStorageStub.withArgs(imUidLocalName).returns('testUid'); + getLocalStorageStub.withArgs(imRtdLocalName).returns('testSids'); + getCookieStub.withArgs(imVidCookieName).returns('testUid'); + getLocalStorageStub.withArgs(`${imRtdLocalName}_mt`).returns(new Date(timestamp()).toUTCString()); + expect(getRealTimeData(testReqBidsConfigObj, onDone, moduleConfig)).to.equal(undefined) + }); + + it('should return the uid when it exists uid, sids(rtd), vid in storages and sids(rtd) expired', function () { + getLocalStorageStub.withArgs(imUidLocalName).returns('testUid'); + getLocalStorageStub.withArgs(imRtdLocalName).returns('testSids'); + getCookieStub.withArgs(imVidCookieName).returns('testUid'); + getLocalStorageStub.withArgs(`${imRtdLocalName}_mt`).returns(0); + expect(getRealTimeData(testReqBidsConfigObj, onDone, moduleConfig)).to.equal(undefined) + }); + + it('should return the uid when uid not expired', function () { + getLocalStorageStub.withArgs(imUidLocalName).returns('testUid'); + getLocalStorageStub.withArgs(imRtdLocalName).returns('testSids'); + getCookieStub.withArgs(imVidCookieName).returns('testUid'); + getLocalStorageStub.withArgs(`${imUidLocalName}_mt`).returns(new Date(timestamp()).toUTCString()); + expect(getRealTimeData(testReqBidsConfigObj, onDone, moduleConfig)).to.equal(undefined) + }); + }) + + describe('getApiCallback', function () { + it('should return success and error functions', function () { + const res = getApiCallback(testReqBidsConfigObj, false, moduleConfig); + expect(res.success).to.exist.and.to.be.a('function'); + expect(res.error).to.exist.and.to.be.a('function'); + }); + + it('should return "undefined" success', function () { + const res = getApiCallback(testReqBidsConfigObj, false, moduleConfig); + const successResponse = '{"uid": "testid", "segments": "testsegment", "vid": "testvid"}'; + expect(res.success(successResponse, {status: 200})).to.equal(undefined); + expect(res.error()).to.equal(undefined); + }); + + it('should return "undefined" catch error response', function () { + const res = getApiCallback(testReqBidsConfigObj, false, moduleConfig); + expect(res.success('error response', {status: 400})).to.equal(undefined); + }); + }) +}) From 51caaef5c8a70c2c98e1c0a6163cea3b1175ca0f Mon Sep 17 00:00:00 2001 From: Manasi Date: Wed, 1 Sep 2021 01:59:00 +0530 Subject: [PATCH 008/250] Pubmatic Bid Adapter: add support for JW Player (#7291) * changes to support jw player in pubmatic adapter * changed incorrect variable name in function * code optimisation changes * unmix quotes for linting Co-authored-by: Manasi Co-authored-by: Chris Huie --- modules/pubmaticBidAdapter.js | 21 +++++++ test/spec/modules/pubmaticBidAdapter_spec.js | 63 ++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index f6e6e67444a..7edeb5589d1 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -605,6 +605,26 @@ function _addDealCustomTargetings(imp, bid) { } } +function _addJWPlayerSegmentData(imp, bid) { + var jwSegData = (bid.rtd && bid.rtd.jwplayer && bid.rtd.jwplayer.targeting) || undefined; + var jwPlayerData = ''; + const jwMark = 'jw-'; + + if (jwSegData === undefined || jwSegData === '' || !jwSegData.hasOwnProperty('segments')) return; + + var maxLength = jwSegData.segments.length; + + jwPlayerData += jwMark + 'id=' + jwSegData.content.id; // add the content id first + + for (var i = 0; i < maxLength; i++) { + jwPlayerData += '|' + jwMark + jwSegData.segments[i] + '=1'; + } + const ext = imp.ext; + (ext && ext.key_val === undefined) + ? ext.key_val = jwPlayerData + : ext.key_val += '|' + jwPlayerData; +} + function _createImpressionObject(bid, conf) { var impObj = {}; var bannerObj; @@ -627,6 +647,7 @@ function _createImpressionObject(bid, conf) { _addPMPDealsInImpression(impObj, bid); _addDealCustomTargetings(impObj, bid); + _addJWPlayerSegmentData(impObj, bid); if (bid.hasOwnProperty('mediaTypes')) { for (mediaTypes in bid.mediaTypes) { switch (mediaTypes) { diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index 23c5f01e520..df3516579de 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -1565,6 +1565,69 @@ describe('PubMatic adapter', function () { expect(data2.regs).to.equal(undefined);// USP/CCPAs }); + it('Request params check with JW player params', function() { + let bidRequests = [ + { + bidder: 'pubmatic', + params: { + publisherId: '301', + adSlot: '/15671365/DMDemo@300x250:0', + dctr: 'key1=val1|key2=val2,val3' + }, + placementCode: '/19968336/header-bid-tag-1', + sizes: [[300, 250], [300, 600]], + bidId: '23acc48ad47af5', + requestId: '0fb4905b-9456-4152-86be-c6f6d259ba99', + bidderRequestId: '1c56ad30b9b8ca8', + transactionId: '92489f71-1bf2-49a0-adf9-000cea934729', + rtd: { + jwplayer: { + targeting: { + content: { id: 'jw_d9J2zcaA' }, + segments: ['80011026', '80011035'] + } + } + } + }]; + let key_val_output = 'key1=val1|key2=val2,val3|jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1' + let request = spec.buildRequests(bidRequests, { + auctionId: 'new-auction-id' + }); + let data = JSON.parse(request.data); + expect(data.imp[0].ext).to.exist.and.to.be.an('object'); + expect(data.imp[0].ext.key_val).to.exist.and.to.equal(key_val_output); + + // jw player data not available. Only dctr sent. + delete bidRequests[0].rtd; + request = spec.buildRequests(bidRequests, { + auctionId: 'new-auction-id' + }); + data = JSON.parse(request.data); + + expect(data.imp[0].ext).to.exist.and.to.be.an('object'); // dctr parameter + expect(data.imp[0].ext.key_val).to.exist.and.to.equal(bidRequests[0].params.dctr); + + // jw player data is available, but dctr is not present + bidRequests[0].rtd = { + jwplayer: { + targeting: { + content: { id: 'jw_d9J2zcaA' }, + segments: ['80011026', '80011035'] + } + } + }; + + delete bidRequests[0].params.dctr; + key_val_output = 'jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1'; + request = spec.buildRequests(bidRequests, { + auctionId: 'new-auction-id' + }); + data = JSON.parse(request.data); + + expect(data.imp[0].ext).to.exist.and.to.be.an('object'); + expect(data.imp[0].ext.key_val).to.exist.and.to.equal(key_val_output); + }); + describe('FPD', function() { let newRequest; From c4feb7000098f7d3579e4dca0f8743885d4b0fc9 Mon Sep 17 00:00:00 2001 From: IQZoneAdx <88879712+IQZoneAdx@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:15:53 +0300 Subject: [PATCH 009/250] add IQZone adapter (#7309) LGTM --- modules/iqzoneBidAdapter.js | 176 ++++++++++ modules/iqzoneBidAdapter.md | 80 +++++ test/spec/modules/iqzoneBidAdapter_spec.js | 371 +++++++++++++++++++++ 3 files changed, 627 insertions(+) create mode 100644 modules/iqzoneBidAdapter.js create mode 100644 modules/iqzoneBidAdapter.md create mode 100644 test/spec/modules/iqzoneBidAdapter_spec.js diff --git a/modules/iqzoneBidAdapter.js b/modules/iqzoneBidAdapter.js new file mode 100644 index 00000000000..77bdcc0188d --- /dev/null +++ b/modules/iqzoneBidAdapter.js @@ -0,0 +1,176 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; +import * as utils from '../src/utils.js'; +import { config } from '../src/config.js'; + +const BIDDER_CODE = 'iqzone'; +const AD_URL = 'https://smartssp-us-east.iqzone.com/pbjs'; + +function isBidResponseValid(bid) { + if (!bid.requestId || !bid.cpm || !bid.creativeId || + !bid.ttl || !bid.currency) { + return false; + } + + switch (bid.mediaType) { + case BANNER: + return Boolean(bid.width && bid.height && bid.ad); + case VIDEO: + return Boolean(bid.vastUrl || bid.vastXml); + case NATIVE: + return Boolean(bid.native && bid.native.impressionTrackers && bid.native.impressionTrackers.length); + default: + return false; + } +} + +function getPlacementReqData(bid) { + const { params, bidId, mediaTypes } = bid; + const schain = bid.schain || {}; + const { placementId } = params; + const bidfloor = getBidFloor(bid); + + const placement = { + placementId, + bidId, + schain, + bidfloor + }; + + if (mediaTypes && mediaTypes[BANNER]) { + placement.adFormat = BANNER; + placement.sizes = mediaTypes[BANNER].sizes; + } else if (mediaTypes && mediaTypes[VIDEO]) { + placement.adFormat = VIDEO; + placement.playerSize = mediaTypes[VIDEO].playerSize; + placement.minduration = mediaTypes[VIDEO].minduration; + placement.maxduration = mediaTypes[VIDEO].maxduration; + placement.mimes = mediaTypes[VIDEO].mimes; + placement.protocols = mediaTypes[VIDEO].protocols; + placement.startdelay = mediaTypes[VIDEO].startdelay; + placement.placement = mediaTypes[VIDEO].placement; + placement.skip = mediaTypes[VIDEO].skip; + placement.skipafter = mediaTypes[VIDEO].skipafter; + placement.minbitrate = mediaTypes[VIDEO].minbitrate; + placement.maxbitrate = mediaTypes[VIDEO].maxbitrate; + placement.delivery = mediaTypes[VIDEO].delivery; + placement.playbackmethod = mediaTypes[VIDEO].playbackmethod; + placement.api = mediaTypes[VIDEO].api; + placement.linearity = mediaTypes[VIDEO].linearity; + } else if (mediaTypes && mediaTypes[NATIVE]) { + placement.native = mediaTypes[NATIVE]; + placement.adFormat = NATIVE; + } + + return placement; +} + +function getBidFloor(bid) { + if (!utils.isFn(bid.getFloor)) { + return utils.deepAccess(bid, 'params.bidfloor', 0); + } + + try { + const bidFloor = bid.getFloor({ + currency: 'USD', + mediaType: '*', + size: '*', + }); + return bidFloor.floor; + } catch (_) { + return 0 + } +} + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, VIDEO, NATIVE], + + isBidRequestValid: (bid = {}) => { + const { params, bidId, mediaTypes } = bid; + let valid = Boolean(bidId && params && params.placementId); + + if (mediaTypes && mediaTypes[BANNER]) { + valid = valid && Boolean(mediaTypes[BANNER] && mediaTypes[BANNER].sizes); + } else if (mediaTypes && mediaTypes[VIDEO]) { + valid = valid && Boolean(mediaTypes[VIDEO] && mediaTypes[VIDEO].playerSize); + } else if (mediaTypes && mediaTypes[NATIVE]) { + valid = valid && Boolean(mediaTypes[NATIVE]); + } else { + valid = false; + } + return valid; + }, + + buildRequests: (validBidRequests = [], bidderRequest = {}) => { + let deviceWidth = 0; + let deviceHeight = 0; + + let winLocation; + try { + const winTop = window.top; + deviceWidth = winTop.screen.width; + deviceHeight = winTop.screen.height; + winLocation = winTop.location; + } catch (e) { + utils.logMessage(e); + winLocation = window.location; + } + + const refferUrl = bidderRequest.refererInfo && bidderRequest.refererInfo.referer; + let refferLocation; + try { + refferLocation = refferUrl && new URL(refferUrl); + } catch (e) { + utils.logMessage(e); + } + + let location = refferLocation || winLocation; + const language = (navigator && navigator.language) ? navigator.language.split('-')[0] : ''; + const host = location.host; + const page = location.pathname; + const secure = location.protocol === 'https:' ? 1 : 0; + const placements = []; + const request = { + deviceWidth, + deviceHeight, + language, + secure, + host, + page, + placements, + coppa: config.getConfig('coppa') === true ? 1 : 0, + ccpa: bidderRequest.uspConsent || undefined, + gdpr: bidderRequest.gdprConsent || undefined, + tmax: config.getConfig('bidderTimeout') + }; + + const len = validBidRequests.length; + for (let i = 0; i < len; i++) { + const bid = validBidRequests[i]; + placements.push(getPlacementReqData(bid)); + } + + return { + method: 'POST', + url: AD_URL, + data: request + }; + }, + + interpretResponse: (serverResponse) => { + let response = []; + for (let i = 0; i < serverResponse.body.length; i++) { + let resItem = serverResponse.body[i]; + if (isBidResponseValid(resItem)) { + const advertiserDomains = resItem.adomain && resItem.adomain.length ? resItem.adomain : []; + resItem.meta = { ...resItem.meta, advertiserDomains }; + + response.push(resItem); + } + } + return response; + } +}; + +registerBidder(spec); diff --git a/modules/iqzoneBidAdapter.md b/modules/iqzoneBidAdapter.md new file mode 100644 index 00000000000..75e82d59b3e --- /dev/null +++ b/modules/iqzoneBidAdapter.md @@ -0,0 +1,80 @@ +# Overview + +``` +Module Name: IQZone Bidder Adapter +Module Type: IQZone Bidder Adapter +Maintainer: no-reply@vsn.si +``` + +# Description + +Connects to IQZone exchange for bids. + +IQZone bid adapter supports Banner, Video (instream and outstream) and Native. + +# Test Parameters +``` + var adUnits = [ + // Will return static test banner + { + code: 'adunit1', + mediaTypes: { + banner: { + sizes: [ [300, 250], [320, 50] ], + } + }, + bids: [ + { + bidder: 'iqzone', + params: { + placementId: 'testBanner', + } + } + ] + }, + { + code: 'addunit2', + mediaTypes: { + video: { + playerSize: [ [640, 480] ], + context: 'instream', + minduration: 5, + maxduration: 60, + } + }, + bids: [ + { + bidder: 'iqzone', + params: { + placementId: 'testVideo', + } + } + ] + }, + { + code: 'addunit3', + mediaTypes: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + }, + bids: [ + { + bidder: 'iqzone', + params: { + placementId: 'testNative', + } + } + ] + } + ]; +``` \ No newline at end of file diff --git a/test/spec/modules/iqzoneBidAdapter_spec.js b/test/spec/modules/iqzoneBidAdapter_spec.js new file mode 100644 index 00000000000..3c7da783728 --- /dev/null +++ b/test/spec/modules/iqzoneBidAdapter_spec.js @@ -0,0 +1,371 @@ +import { expect } from 'chai'; +import { spec } from '../../../modules/iqzoneBidAdapter.js'; +import { BANNER, VIDEO, NATIVE } from '../../../src/mediaTypes.js'; +import { getUniqueIdentifierStr } from '../../../src/utils.js'; + +const bidder = 'iqzone' + +describe('IQZoneBidAdapter', function () { + const bids = [ + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + placementId: 'testBanner', + } + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [VIDEO]: { + playerSize: [[300, 300]], + minduration: 5, + maxduration: 60 + } + }, + params: { + placementId: 'testVideo', + } + }, + { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [NATIVE]: { + native: { + title: { + required: true + }, + body: { + required: true + }, + icon: { + required: true, + size: [64, 64] + } + } + } + }, + params: { + placementId: 'testNative', + } + } + ]; + + const invalidBid = { + bidId: getUniqueIdentifierStr(), + bidder: bidder, + mediaTypes: { + [BANNER]: { + sizes: [[300, 250]] + } + }, + params: { + + } + } + + const bidderRequest = { + uspConsent: '1---', + gdprConsent: 'COvFyGBOvFyGBAbAAAENAPCAAOAAAAAAAAAAAEEUACCKAAA.IFoEUQQgAIQwgIwQABAEAAAAOIAACAIAAAAQAIAgEAACEAAAAAgAQBAAAAAAAGBAAgAAAAAAAFAAECAAAgAAQARAEQAAAAAJAAIAAgAAAYQEAAAQmAgBC3ZAYzUw', + refererInfo: { + referer: 'https://test.com' + } + }; + + describe('isBidRequestValid', function () { + it('Should return true if there are bidId, params and key parameters present', function () { + expect(spec.isBidRequestValid(bids[0])).to.be.true; + }); + it('Should return false if at least one of parameters is not present', function () { + expect(spec.isBidRequestValid(invalidBid)).to.be.false; + }); + }); + + describe('buildRequests', function () { + let serverRequest = spec.buildRequests(bids, bidderRequest); + + it('Creates a ServerRequest object with method, URL and data', function () { + expect(serverRequest).to.exist; + expect(serverRequest.method).to.exist; + expect(serverRequest.url).to.exist; + expect(serverRequest.data).to.exist; + }); + + it('Returns POST method', function () { + expect(serverRequest.method).to.equal('POST'); + }); + + it('Returns valid URL', function () { + expect(serverRequest.url).to.equal('https://smartssp-us-east.iqzone.com/pbjs'); + }); + + it('Returns general data valid', function () { + let data = serverRequest.data; + expect(data).to.be.an('object'); + expect(data).to.have.all.keys('deviceWidth', + 'deviceHeight', + 'language', + 'secure', + 'host', + 'page', + 'placements', + 'coppa', + 'ccpa', + 'gdpr', + 'tmax' + ); + expect(data.deviceWidth).to.be.a('number'); + expect(data.deviceHeight).to.be.a('number'); + expect(data.language).to.be.a('string'); + expect(data.secure).to.be.within(0, 1); + expect(data.host).to.be.a('string'); + expect(data.page).to.be.a('string'); + expect(data.coppa).to.be.a('number'); + expect(data.gdpr).to.be.a('string'); + expect(data.ccpa).to.be.a('string'); + expect(data.tmax).to.be.a('number'); + expect(data.placements).to.have.lengthOf(3); + }); + + it('Returns valid placements', function () { + const { placements } = serverRequest.data; + for (let i = 0, len = placements.length; i < len; i++) { + const placement = placements[i]; + expect(placement.placementId).to.be.oneOf(['testBanner', 'testVideo', 'testNative']); + expect(placement.adFormat).to.be.oneOf([BANNER, VIDEO, NATIVE]); + expect(placement.bidId).to.be.a('string'); + expect(placement.schain).to.be.an('object'); + expect(placement.bidfloor).to.exist.and.to.equal(0); + + if (placement.adFormat === BANNER) { + expect(placement.sizes).to.be.an('array'); + } + switch (placement.adFormat) { + case BANNER: + expect(placement.sizes).to.be.an('array'); + break; + case VIDEO: + expect(placement.playerSize).to.be.an('array'); + expect(placement.minduration).to.be.an('number'); + expect(placement.maxduration).to.be.an('number'); + break; + case NATIVE: + expect(placement.native).to.be.an('object'); + break; + } + } + }); + + it('Returns data with gdprConsent and without uspConsent', function () { + delete bidderRequest.uspConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + let data = serverRequest.data; + expect(data.gdpr).to.exist; + expect(data.gdpr).to.be.a('string'); + expect(data.gdpr).to.equal(bidderRequest.gdprConsent); + expect(data.ccpa).to.not.exist; + delete bidderRequest.gdprConsent; + }); + + it('Returns data with uspConsent and without gdprConsent', function () { + bidderRequest.uspConsent = '1---'; + delete bidderRequest.gdprConsent; + serverRequest = spec.buildRequests(bids, bidderRequest); + let data = serverRequest.data; + expect(data.ccpa).to.exist; + expect(data.ccpa).to.be.a('string'); + expect(data.ccpa).to.equal(bidderRequest.uspConsent); + expect(data.gdpr).to.not.exist; + }); + + it('Returns empty data if no valid requests are passed', function () { + serverRequest = spec.buildRequests([], bidderRequest); + let data = serverRequest.data; + expect(data.placements).to.be.an('array').that.is.empty; + }); + }); + + describe('interpretResponse', function () { + it('Should interpret banner response', function () { + const banner = { + body: [{ + mediaType: 'banner', + width: 300, + height: 250, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let bannerResponses = spec.interpretResponse(banner); + expect(bannerResponses).to.be.an('array').that.is.not.empty; + let dataItem = bannerResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'width', 'height', 'ad', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal(banner.body[0].requestId); + expect(dataItem.cpm).to.equal(banner.body[0].cpm); + expect(dataItem.width).to.equal(banner.body[0].width); + expect(dataItem.height).to.equal(banner.body[0].height); + expect(dataItem.ad).to.equal(banner.body[0].ad); + expect(dataItem.ttl).to.equal(banner.body[0].ttl); + expect(dataItem.creativeId).to.equal(banner.body[0].creativeId); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal(banner.body[0].currency); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret video response', function () { + const video = { + body: [{ + vastUrl: 'test.com', + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let videoResponses = spec.interpretResponse(video); + expect(videoResponses).to.be.an('array').that.is.not.empty; + + let dataItem = videoResponses[0]; + expect(dataItem).to.have.all.keys('requestId', 'cpm', 'vastUrl', 'ttl', 'creativeId', + 'netRevenue', 'currency', 'dealId', 'mediaType', 'meta'); + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.5); + expect(dataItem.vastUrl).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should interpret native response', function () { + const native = { + body: [{ + mediaType: 'native', + native: { + clickUrl: 'test.com', + title: 'Test', + image: 'test.com', + impressionTrackers: ['test.com'], + }, + ttl: 120, + cpm: 0.4, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + meta: { + advertiserDomains: ['google.com'], + advertiserId: 1234 + } + }] + }; + let nativeResponses = spec.interpretResponse(native); + expect(nativeResponses).to.be.an('array').that.is.not.empty; + + let dataItem = nativeResponses[0]; + expect(dataItem).to.have.keys('requestId', 'cpm', 'ttl', 'creativeId', 'netRevenue', 'currency', 'mediaType', 'native', 'meta'); + expect(dataItem.native).to.have.keys('clickUrl', 'impressionTrackers', 'title', 'image') + expect(dataItem.requestId).to.equal('23fhj33i987f'); + expect(dataItem.cpm).to.equal(0.4); + expect(dataItem.native.clickUrl).to.equal('test.com'); + expect(dataItem.native.title).to.equal('Test'); + expect(dataItem.native.image).to.equal('test.com'); + expect(dataItem.native.impressionTrackers).to.be.an('array').that.is.not.empty; + expect(dataItem.native.impressionTrackers[0]).to.equal('test.com'); + expect(dataItem.ttl).to.equal(120); + expect(dataItem.creativeId).to.equal('2'); + expect(dataItem.netRevenue).to.be.true; + expect(dataItem.currency).to.equal('USD'); + expect(dataItem.meta).to.be.an('object').that.has.any.key('advertiserDomains'); + }); + it('Should return an empty array if invalid banner response is passed', function () { + const invBanner = { + body: [{ + width: 300, + cpm: 0.4, + ad: 'Test', + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + + let serverResponses = spec.interpretResponse(invBanner); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid video response is passed', function () { + const invVideo = { + body: [{ + mediaType: 'video', + cpm: 0.5, + requestId: '23fhj33i987f', + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + let serverResponses = spec.interpretResponse(invVideo); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid native response is passed', function () { + const invNative = { + body: [{ + mediaType: 'native', + clickUrl: 'test.com', + title: 'Test', + impressionTrackers: ['test.com'], + ttl: 120, + requestId: '23fhj33i987f', + creativeId: '2', + netRevenue: true, + currency: 'USD', + }] + }; + let serverResponses = spec.interpretResponse(invNative); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + it('Should return an empty array if invalid response is passed', function () { + const invalid = { + body: [{ + ttl: 120, + creativeId: '2', + netRevenue: true, + currency: 'USD', + dealId: '1' + }] + }; + let serverResponses = spec.interpretResponse(invalid); + expect(serverResponses).to.be.an('array').that.is.empty; + }); + }); +}); From e485e9ea7e36e7efb26accd83d71a92e183e26b8 Mon Sep 17 00:00:00 2001 From: Skylinar <53079123+Skylinar@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:18:00 +0200 Subject: [PATCH 010/250] smartx Bid Adapter: bugfix outstream options for default outstream renderer configuration (#7372) * Add smartclipBidAdapter * smartxBidAdapter.js - removed unused variables, removed debug, added window before the outstream related functions * - made outstream player configurable * remove wrong named files * camelcase * fix * Out-Stream render update to SmartPlay 5.2 * ESlint fix * ESlint fix * ESlint fix * adjust tests, fixes * ESlint * adjusted desired bitrate examples * added bid.meta.advertiserDomains support * bug fix for numeric elementID outstream render * fix renderer url * support for floors module * bugfixes to be openRTB 2.5 compliant * update internal renderer usage * remove unused outstream_function logic * bugfix outstream options for default outstream renderer configuration Co-authored-by: smartclip AdTechnology Co-authored-by: Gino Cirlini --- modules/smartxBidAdapter.js | 47 ++++++++++++----- modules/smartxBidAdapter.md | 8 +-- test/spec/modules/smartxBidAdapter_spec.js | 61 ++++++++++++++++++---- 3 files changed, 89 insertions(+), 27 deletions(-) diff --git a/modules/smartxBidAdapter.js b/modules/smartxBidAdapter.js index c29708c8420..44e70082d9d 100644 --- a/modules/smartxBidAdapter.js +++ b/modules/smartxBidAdapter.js @@ -329,25 +329,20 @@ export const spec = { } function createOutstreamConfig(bid) { - const confMinAdWidth = utils.getBidIdParameter('minAdWidth', bid.renderer.config.outstream_options) || 290; - const confMaxAdWidth = utils.getBidIdParameter('maxAdWidth', bid.renderer.config.outstream_options) || 900; - const confStartOpen = utils.getBidIdParameter('startOpen', bid.renderer.config.outstream_options); - const confEndingScreen = utils.getBidIdParameter('endingScreen', bid.renderer.config.outstream_options); - const confTitle = utils.getBidIdParameter('title', bid.renderer.config.outstream_options); - const confSkipOffset = utils.getBidIdParameter('skipOffset', bid.renderer.config.outstream_options); - const confDesiredBitrate = utils.getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options); - const elementId = utils.getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode; + let confMinAdWidth = utils.getBidIdParameter('minAdWidth', bid.renderer.config.outstream_options) || 290; + let confMaxAdWidth = utils.getBidIdParameter('maxAdWidth', bid.renderer.config.outstream_options) || 900; + let confStartOpen = utils.getBidIdParameter('startOpen', bid.renderer.config.outstream_options) + let confEndingScreen = utils.getBidIdParameter('endingScreen', bid.renderer.config.outstream_options) + let confTitle = utils.getBidIdParameter('title', bid.renderer.config.outstream_options); + let confSkipOffset = utils.getBidIdParameter('skipOffset', bid.renderer.config.outstream_options); + let confDesiredBitrate = utils.getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options); + let elementId = utils.getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode; utils.logMessage('[SMARTX][renderer] Handle SmartX outstream renderer'); var smartPlayObj = { minAdWidth: confMinAdWidth, maxAdWidth: confMaxAdWidth, - title: confTitle, - skipOffset: confSkipOffset, - startOpen: confStartOpen, - endingScreen: confEndingScreen, - desiredBitrate: confDesiredBitrate, onStartCallback: function (m, n) { try { window.sc_smartIntxtStart(n); @@ -365,13 +360,37 @@ function createOutstreamConfig(bid) { }, }; + if (confStartOpen == 'true') { + smartPlayObj.startOpen = true; + } else if (confStartOpen == 'false') { + smartPlayObj.startOpen = false; + } + + if (confEndingScreen == 'true') { + smartPlayObj.endingScreen = true; + } else if (confEndingScreen == 'false') { + smartPlayObj.endingScreen = false; + } + + if (confTitle) { + smartPlayObj.title = confTitle; + } + + if (confSkipOffset) { + smartPlayObj.skipOffset = confSkipOffset; + } + + if (confDesiredBitrate) { + smartPlayObj.desiredBitrate = confDesiredBitrate; + } + smartPlayObj.adResponse = bid.vastContent; const divID = '[id="' + elementId + '"]'; try { // eslint-disable-next-line - let _outstreamPlayer = new OutstreamPlayer(divID, smartPlayObj); + let _outstreamPlayer = new OutstreamPlayer(divID, smartPlayObj); } catch (e) { utils.logError('[SMARTX][renderer] Error caught: ' + e); } diff --git a/modules/smartxBidAdapter.md b/modules/smartxBidAdapter.md index 223e51763b9..853f06d6baf 100644 --- a/modules/smartxBidAdapter.md +++ b/modules/smartxBidAdapter.md @@ -38,8 +38,8 @@ This adapter requires setup and approval from the smartclip team. maxAdWidth: 900, title: '', skipOffset: 0, - startOpen: true, - endingScreen: true, + startOpen: 'true', + endingScreen: 'true', desiredBitrate: 800, }, } @@ -73,8 +73,8 @@ This adapter requires setup and approval from the smartclip team. maxAdWidth: 900, title: '', skipOffset: 0, - startOpen: true, - endingScreen: true, + startOpen: 'true', + endingScreen: 'true', desiredBitrate: 800, }, user: { diff --git a/test/spec/modules/smartxBidAdapter_spec.js b/test/spec/modules/smartxBidAdapter_spec.js index 89c03034ba4..4e560c87df3 100644 --- a/test/spec/modules/smartxBidAdapter_spec.js +++ b/test/spec/modules/smartxBidAdapter_spec.js @@ -495,7 +495,7 @@ describe('The smartx adapter', function () { }; }); - it('should attempt to insert the script', function () { + it('should attempt to insert the script without outstream config options set', function () { var scriptTag; sinon.stub(window.document, 'getElementById').returns({ appendChild: sinon.stub().callsFake(function (script) { @@ -506,8 +506,51 @@ describe('The smartx adapter', function () { responses[0].renderer.render(responses[0]); - // expect(scriptTag.getAttribute('type')).to.equal('text/javascript'); - // expect(scriptTag.getAttribute('src')).to.equal('https://dco.smartclip.net/?plc=7777778'); + expect(responses[0].renderer.url).to.equal('https://dco.smartclip.net/?plc=7777778'); + + window.document.getElementById.restore(); + }); + + it('should attempt to insert the script with outstream config options set', function () { + var scriptTag; + sinon.stub(window.document, 'getElementById').returns({ + appendChild: sinon.stub().callsFake(function (script) { + scriptTag = script + }) + }); + var responses = spec.interpretResponse(serverResponse, bidderRequestObj); + + bidderRequestObj.bidRequest.bids[0].params.outstream_options.startOpen = 'true'; + bidderRequestObj.bidRequest.bids[0].params.outstream_options.endingScreen = 'true'; + bidderRequestObj.bidRequest.bids[0].params.outstream_options.title = 'abc'; + bidderRequestObj.bidRequest.bids[0].params.outstream_options.skipOffset = 2; + bidderRequestObj.bidRequest.bids[0].params.outstream_options.desiredBitrate = 123; + + responses[0].renderer.render(responses[0]); + + bidderRequestObj.bidRequest.bids[0].params.outstream_options.startOpen = 'false'; + bidderRequestObj.bidRequest.bids[0].params.outstream_options.endingScreen = 'false'; + + responses[0].renderer.render(responses[0]); + + expect(responses[0].renderer.url).to.equal('https://dco.smartclip.net/?plc=7777778'); + + window.document.getElementById.restore(); + }); + + it('should attempt to insert the script without defined slot', function () { + var scriptTag; + sinon.stub(window.document, 'getElementById').returns({ + appendChild: sinon.stub().callsFake(function (script) { + scriptTag = script + }) + }); + var responses = spec.interpretResponse(serverResponse, bidderRequestObj); + + delete bidderRequestObj.bidRequest.bids[0].params.outstream_options.slot; + + responses[0].renderer.render(responses[0]); + expect(responses[0].renderer.url).to.equal('https://dco.smartclip.net/?plc=7777778'); window.document.getElementById.restore(); @@ -540,7 +583,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 3.21); }); - it('obtain floor from params', function() { + it('obtain floor from params', function () { bid.getFloor = () => { return { currency: 'EUR', @@ -553,7 +596,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 0.64); }); - it('check currency USD', function() { + it('check currency USD', function () { bid.getFloor = () => { return { currency: 'USD', @@ -567,7 +610,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 1.23); }); - it('check defaut currency EUR', function() { + it('check defaut currency EUR', function () { delete bid.params.bidfloorcur; bid.getFloor = () => { @@ -582,7 +625,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 4.56); }); - it('bad floor value', function() { + it('bad floor value', function () { bid.getFloor = () => { return { currency: 'EUR', @@ -594,7 +637,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 0); }); - it('empty floor object', function() { + it('empty floor object', function () { bid.getFloor = () => { return {}; }; @@ -603,7 +646,7 @@ describe('The smartx adapter', function () { expect(payload.data.imp[0]).to.have.property('bidfloor', 0); }); - it('undefined floor result', function() { + it('undefined floor result', function () { bid.getFloor = () => {}; const payload = spec.buildRequests([bid], bidRequestObj)[0]; From fffa3e32ad8e6ef7d1086c2367d8583774738a01 Mon Sep 17 00:00:00 2001 From: Alexander Clouter Date: Wed, 1 Sep 2021 16:35:01 +0100 Subject: [PATCH 011/250] Adloox real time data module (#6310) --- integrationExamples/gpt/adloox.html | 27 +- modules/adlooxAnalyticsAdapter.js | 11 +- modules/adlooxAnalyticsAdapter.md | 17 +- modules/adlooxRtdProvider.js | 390 ++++++++++++++++++ modules/adlooxRtdProvider.md | 105 +++++ .../modules/adlooxAnalyticsAdapter_spec.js | 2 +- test/spec/modules/adlooxRtdProvider_spec.js | 313 ++++++++++++++ 7 files changed, 848 insertions(+), 17 deletions(-) create mode 100644 modules/adlooxRtdProvider.js create mode 100644 modules/adlooxRtdProvider.md create mode 100644 test/spec/modules/adlooxRtdProvider_spec.js diff --git a/integrationExamples/gpt/adloox.html b/integrationExamples/gpt/adloox.html index 2a772bb7ce2..e8920cf2ee1 100644 --- a/integrationExamples/gpt/adloox.html +++ b/integrationExamples/gpt/adloox.html @@ -64,9 +64,11 @@ playerSize: [ 640, 480 ] } }, - fpd: { - context: { - pbAdSlot: '/19968336/prebid_cache_video_adunit' + ortb2Imp: { + ext: { + data: { + pbadslot: '/19968336/prebid_cache_video_adunit' + } } }, bids: [ @@ -106,7 +108,8 @@ pbjs.initAdserverSet = true; googletag.cmd.push(function() { - pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync(adUnits); + const adUnitCodes = adUnits.map(adUnit => adUnit.code); + pbjs.setTargetingForGPTAsync(adUnitCodes); googletag.pubads().refresh(); }); @@ -135,12 +138,24 @@ } // optionally wrap with googletag to have gpt-pre-auction - // automatically populate Prebid Ad Slot (pbAdSlot) + // automatically populate Prebid Ad Slot (pbadslot) // https://docs.prebid.org/dev-docs/modules/gpt-pre-auction.html - // alternatively remove wrapping and set AdUnit.fpd.context.pbAdSlot + // alternatively remove wrapping and set AdUnit.ortb2Imp.ext.data.pbadslot googletag.cmd.push(function() { pbjs.que.push(function() { pbjs.setConfig({ + realTimeData: { + auctionDelay: AUCTION_DELAY, + dataProviders: [ + { + name: 'adloox', + params: { // optional, defaults shown + thresholds: [ 50, 60, 70, 80, 90 ], + slotinpath: false + } + } + ] + }, instreamTracking: { enabled: true }, diff --git a/modules/adlooxAnalyticsAdapter.js b/modules/adlooxAnalyticsAdapter.js index cfd01b4434a..17787f816df 100644 --- a/modules/adlooxAnalyticsAdapter.js +++ b/modules/adlooxAnalyticsAdapter.js @@ -43,14 +43,15 @@ MACRO['targetelt'] = function(b, c) { MACRO['creatype'] = function(b, c) { return b.mediaType == 'video' ? ADLOOX_MEDIATYPE.VIDEO : ADLOOX_MEDIATYPE.DISPLAY; }; -MACRO['pbAdSlot'] = function(b, c) { +MACRO['pbadslot'] = function(b, c) { const adUnit = find(auctionManager.getAdUnits(), a => b.adUnitCode === a.code); - return utils.deepAccess(adUnit, 'fpd.context.pbAdSlot') || utils.getGptSlotInfoForAdUnitCode(b.adUnitCode).gptSlot || b.adUnitCode; + return utils.deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot') || utils.getGptSlotInfoForAdUnitCode(b.adUnitCode).gptSlot || b.adUnitCode; }; +MACRO['pbAdSlot'] = MACRO['pbadslot']; // legacy const PARAMS_DEFAULT = { 'id1': function(b) { return b.adUnitCode }, - 'id2': '%%pbAdSlot%%', + 'id2': '%%pbadslot%%', 'id3': function(b) { return b.bidder }, 'id4': function(b) { return b.adId }, 'id5': function(b) { return b.dealId }, @@ -251,6 +252,7 @@ export default analyticsAdapter; const COMMAND_QUEUE = {}; export const COMMAND = { CONFIG: 'config', + TOSELECTOR: 'toselector', URL: 'url', TRACK: 'track' }; @@ -278,6 +280,9 @@ function commandProcess(cid) { }; callback(response); break; + case COMMAND.TOSELECTOR: + callback(analyticsAdapter.context.toselector(data.bid)); + break; case COMMAND.URL: if (data.ids) data.args = data.args.concat(analyticsAdapter.context.params.filter(p => /^id([1-9]|10)$/.test(p[0]))); // not >10 callback(analyticsAdapter.url(data.url, data.args, data.bid)); diff --git a/modules/adlooxAnalyticsAdapter.md b/modules/adlooxAnalyticsAdapter.md index d4d53a81b3c..c4618a2e3aa 100644 --- a/modules/adlooxAnalyticsAdapter.md +++ b/modules/adlooxAnalyticsAdapter.md @@ -2,11 +2,11 @@ Module Name: Adloox Analytics Adapter Module Type: Analytics Adapter - Maintainer: technique@adloox.com + Maintainer: contact@adloox.com # Description -Analytics adapter for adloox.com. Contact adops@adloox.com for information. +Analytics adapter for adloox.com. Contact contact@adloox.com for information. This module can be used to track: @@ -34,7 +34,7 @@ When tracking video you have two options: To view an [example of an Adloox integration](../integrationExamples/gpt/adloox.html): - gulp serve --nolint --notest --modules=gptPreAuction,categoryTranslation,dfpAdServerVideo,instreamTracking,rubiconBidAdapter,spotxBidAdapter,adlooxAnalyticsAdapter,adlooxAdServerVideo + gulp serve --nolint --notest --modules=gptPreAuction,categoryTranslation,dfpAdServerVideo,rtdModule,instreamTracking,rubiconBidAdapter,spotxBidAdapter,adlooxAnalyticsAdapter,adlooxAdServerVideo,adlooxRtdProvider **N.B.** `categoryTranslation` is required by `dfpAdServerVideo` that otherwise causes a JavaScript console warning @@ -44,6 +44,8 @@ Now point your browser at: http://localhost:9999/integrationExamples/gpt/adloox. The example is published publically at: https://storage.googleapis.com/adloox-ads-js-test/prebid.html?pbjs_debug=true +**N.B.** this will show a [CORS error](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors) for the request `https://p.adlooxtracking.com/q?...` that is safe to ignore on the public example page; it is related to the [RTD integration](./adlooxRtdProvider.md) which requires pre-registration of your sites + It is recommended you use [Google Chrome's 'Local Overrides' located in the Developer Tools panel](https://www.trysmudford.com/blog/chrome-local-overrides/) to explore the example without the inconvience of having to run your own web server. #### Pre-built `prebid.js` @@ -61,7 +63,7 @@ You should be able to use this during the QA process of your own internal testin The main Prebid.js documentation is a bit opaque on this but you can use the following to test only Adloox's modules: gulp lint - gulp test-coverage --file 'test/spec/modules/adloox{AnalyticsAdapter,AdServerVideo}_spec.js' + gulp test-coverage --file 'test/spec/modules/adloox{AnalyticsAdapter,AdServerVideo,RtdProvider}_spec.js' gulp view-coverage # Integration @@ -103,8 +105,8 @@ For example, you have a number of reporting breakdown slots available in the for platformid: 0, tagid: 0, params: { - id1: function(b) { return b.adUnitCode }, - id2: '%%pbAdSlot%%', + id1: function(b) { return b.adUnitCode }, // do not change when using the Adloox RTD Provider + id2: '%%pbadslot%%', // do not change when using the Adloox RTD Provider id3: function(b) { return b.bidder }, id4: function(b) { return b.adId }, id5: function(b) { return b.dealId }, @@ -123,7 +125,8 @@ For example, you have a number of reporting breakdown slots available in the for The following macros are available - * `%%pbAdSlot%%`: [Prebid Ad Slot](https://docs.prebid.org/features/pbAdSlot.html) returns [`AdUnit.code`](https://docs.prebid.org/features/pbAdSlot.html) if set otherwise returns [`AdUnit.code`](https://docs.prebid.org/dev-docs/adunit-reference.html#adunit) + * `%%pbadslot%%`: [Prebid Ad Slot](https://docs.prebid.org/features/pbAdSlot.html) returns [`AdUnit.code`](https://docs.prebid.org/features/pbAdSlot.html) if set otherwise returns [`AdUnit.code`](https://docs.prebid.org/dev-docs/adunit-reference.html#adunit) + * it is recommended you read the [Prebid Ad Slot section in the Adloox RTD Provider documentation](./adlooxRtdProvider.md#prebid-ad-slot) ### Functions diff --git a/modules/adlooxRtdProvider.js b/modules/adlooxRtdProvider.js new file mode 100644 index 00000000000..3e93047cccc --- /dev/null +++ b/modules/adlooxRtdProvider.js @@ -0,0 +1,390 @@ +/** + * This module adds the Adloox provider to the real time data module + * This module adds the [Adloox]{@link https://www.adloox.com/} provider to the real time data module + * The {@link module:modules/realTimeData} module is required + * The module will fetch segments from Adloox's server + * @module modules/adlooxRtdProvider + * @requires module:modules/realTimeData + * @requires module:modules/adlooxAnalyticsAdapter + */ + +/* eslint standard/no-callback-literal: "off" */ +/* eslint prebid/validate-imports: "off" */ + +import { command as analyticsCommand, COMMAND } from './adlooxAnalyticsAdapter.js'; +import { config as _config } from '../src/config.js'; +import { submodule } from '../src/hook.js'; +import { ajax } from '../src/ajax.js'; +import { getGlobal } from '../src/prebidGlobal.js'; +import * as utils from '../src/utils.js'; +import includes from 'core-js-pure/features/array/includes.js'; + +const MODULE_NAME = 'adloox'; +const MODULE = `${MODULE_NAME}RtdProvider`; + +const API_ORIGIN = 'https://p.adlooxtracking.com'; +const SEGMENT_HISTORIC = { 'a': 'aud', 'd': 'dis', 'v': 'vid' }; +const SEGMENT_HISTORIC_VALUES = Object.keys(SEGMENT_HISTORIC).map(k => SEGMENT_HISTORIC[k]); + +const ADSERVER_TARGETING_PREFIX = 'adl_'; + +const CREATIVE_WIDTH_MIN = 20; +const CREATIVE_HEIGHT_MIN = 20; +const CREATIVE_AREA_MIN = CREATIVE_WIDTH_MIN * CREATIVE_HEIGHT_MIN; +// try to avoid using IntersectionObserver as it has unbounded (observed multi-second) latency +let intersectionObserver = window == top ? false : undefined; +const intersectionObserverElements = []; +// .map/.findIndex are safe here as they are only used for intersectionObserver +function atf(adUnit, cb) { + analyticsCommand(COMMAND.TOSELECTOR, { bid: { adUnitCode: adUnit.code } }, function(selector) { + const element = document.querySelector(selector); + if (!element) return cb(null); + + if (window.getComputedStyle(element)['display'] == 'none') return cb(NaN); + + try { + // short circuit for cross-origin + if (intersectionObserver) throw false; + + // Google's advice is to collapse slots on no fill but + // we have to cater to clients that grow slots on fill + const rect = (function(rect) { + const sizes = utils.getAdUnitSizes(adUnit); + + if (sizes.length == 0) return false; + // interstitial (0x0, 1x1) + if (sizes.length == 1 && (sizes[0][0] * sizes[0][1]) <= 1) return true; + // try to catch premium slots (coord=0,0) as they will likely bounce into view + if (rect.top <= -window.pageYOffset && rect.left <= -window.pageXOffset && rect.top == rect.bottom) return true; + + // pick the smallest creative size as many publishers will just leave the element unbounded in the vertical + let width = Infinity; + let height = Infinity; + for (let i = 0; i < sizes.length; i++) { + const area = sizes[i][0] * sizes[i][1]; + if (area < CREATIVE_AREA_MIN) continue; + if (area < (width * height)) { + width = sizes[i][0]; + height = sizes[i][1]; + } + } + // we also scale the smallest size to the size of the slot as publishers resize units depending on viewport + const scale = Math.min(1, (rect.right - rect.left) / width); + + return { + left: rect.left, + right: rect.left + Math.max(CREATIVE_WIDTH_MIN, scale * width), + top: rect.top, + bottom: rect.top + Math.max(CREATIVE_HEIGHT_MIN, scale * height) + }; + })(element.getBoundingClientRect()); + + if (rect === false) return cb(NaN); + if (rect === true) return cb(1); + + const W = rect.right - rect.left; + const H = rect.bottom - rect.top; + + if (W * H < CREATIVE_AREA_MIN) return cb(NaN); + + let el; + let win = window; + while (1) { + // https://stackoverflow.com/a/8876069 + const vw = Math.max(win.document.documentElement.clientWidth || 0, win.innerWidth || 0); + const vh = Math.max(win.document.documentElement.clientHeight || 0, win.innerHeight || 0); + + // cut to viewport + rect.left = Math.min(Math.max(rect.left, 0), vw); + rect.right = Math.min(Math.max(rect.right, 0), vw); + rect.top = Math.min(Math.max(rect.top, 0), vh); + rect.bottom = Math.min(Math.max(rect.bottom, 0), vh); + + if (win == top) return cb(((rect.right - rect.left) * (rect.bottom - rect.top)) / (W * H)); + el = win.frameElement; + if (!el) throw false; // cross-origin + win = win.parent; + + // transpose to frame element + const frameElementRect = el.getBoundingClientRect(); + rect.left += frameElementRect.left; + rect.right = Math.min(rect.right + frameElementRect.left, frameElementRect.right); + rect.top += frameElementRect.top; + rect.bottom = Math.min(rect.bottom + frameElementRect.top, frameElementRect.bottom); + } + } catch (_) { + if (intersectionObserver === undefined) { + try { + intersectionObserver = new IntersectionObserver(function(entries) { + entries.forEach(entry => { + const ratio = entry.intersectionRect.width * entry.intersectionRect.height < CREATIVE_AREA_MIN ? NaN : entry.intersectionRatio; + const idx = intersectionObserverElements.findIndex(x => x.element == entry.target); + intersectionObserverElements[idx].cb.forEach(cb => cb(ratio)); + intersectionObserverElements.splice(idx, 1); + intersectionObserver.unobserve(entry.target); + }); + }); + } catch (_) { + intersectionObserver = false; + } + } + if (!intersectionObserver) return cb(null); + const idx = intersectionObserverElements.findIndex(x => x.element == element); + if (idx == -1) { + intersectionObserverElements.push({ element, cb: [ cb ] }); + intersectionObserver.observe(element); + } else { + intersectionObserverElements[idx].cb.push(cb); + } + } + }); +} + +function init(config, userConsent) { + utils.logInfo(MODULE, 'init', config, userConsent); + + if (!utils.isPlainObject(config)) { + utils.logError(MODULE, 'missing config'); + return false; + } + if (config.params === undefined) config.params = {}; + if (!(utils.isPlainObject(config.params))) { + utils.logError(MODULE, 'invalid params'); + return false; + } + if (!(config.params.api_origin === undefined || utils.isStr(config.params.api_origin))) { + utils.logError(MODULE, 'invalid api_origin params value'); + return false; + } + if (!(config.params.imps === undefined || (utils.isInteger(config.params.imps) && config.params.imps > 0))) { + utils.logError(MODULE, 'invalid imps params value'); + return false; + } + if (!(config.params.freqcap_ip === undefined || (utils.isInteger(config.params.freqcap_ip) && config.params.freqcap_ip >= 0))) { + utils.logError(MODULE, 'invalid freqcap_ip params value'); + return false; + } + if (!(config.params.freqcap_ipua === undefined || (utils.isInteger(config.params.freqcap_ipua) && config.params.freqcap_ipua >= 0))) { + utils.logError(MODULE, 'invalid freqcap_ipua params value'); + return false; + } + if (!(config.params.thresholds === undefined || (utils.isArray(config.params.thresholds) && config.params.thresholds.every(x => utils.isInteger(x) && x > 0 && x <= 100)))) { + utils.logError(MODULE, 'invalid thresholds params value'); + return false; + } + if (!(config.params.slotinpath === undefined || utils.isBoolean(config.params.slotinpath))) { + utils.logError(MODULE, 'invalid slotinpath params value'); + return false; + } + // legacy/deprecated configuration code path + if (!(config.params.params === undefined || (utils.isPlainObject(config.params.params) && utils.isInteger(config.params.params.clientid) && utils.isInteger(config.params.params.tagid) && utils.isInteger(config.params.params.platformid)))) { + utils.logError(MODULE, 'invalid subsection params block'); + return false; + } + + config.params.thresholds = config.params.thresholds || [ 50, 60, 70, 80, 90 ]; + + function analyticsConfigCallback(data) { + config = utils.mergeDeep(config.params, data); + } + if (config.params.params) { + utils.logWarn(MODULE, `legacy/deprecated configuration (please migrate to ${MODULE_NAME}AnalyticsAdapter)`); + analyticsConfigCallback(config.params.params); + } else { + analyticsCommand(COMMAND.CONFIG, null, analyticsConfigCallback); + } + + return true; +} + +function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { + // gptPreAuction runs *after* RTD so pbadslot may not be populated... (╯°□°)╯ ┻━┻ + const adUnits = (reqBidsConfigObj.adUnits || getGlobal().adUnits).map(adUnit => { + let path = utils.deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot'); + if (!path) path = utils.getGptSlotInfoForAdUnitCode(adUnit.code).gptSlot; + return { + path: path, + unit: adUnit + }; + }).filter(adUnit => !!adUnit.path); + + let response = {}; + function setSegments() { + function val(v, k) { + if (!((SEGMENT_HISTORIC[k] || k == 'atf') && v >= 0)) return v; + return config.params.thresholds.filter(t => t <= v); + } + + const ortb2 = _config.getConfig('ortb2') || {}; + const dataSite = _config.getConfig('ortb2.site.ext.data') || {}; + const dataUser = _config.getConfig('ortb2.user.ext.data') || {}; + + utils._each(response, (v0, k0) => { + if (k0 == '_') return; + const k = SEGMENT_HISTORIC[k0] || k0; + const v = val(v0, k0); + utils.deepSetValue(k == k0 ? dataUser : dataSite, `${MODULE_NAME}_rtd.${k}`, v); + }); + utils.deepSetValue(dataSite, `${MODULE_NAME}_rtd.ok`, true); + + utils.deepSetValue(ortb2, 'site.ext.data', dataSite); + utils.deepSetValue(ortb2, 'user.ext.data', dataUser); + _config.setConfig({ ortb2 }); + + adUnits.forEach((adUnit, i) => { + utils._each(response['_'][i], (v0, k0) => { + const k = SEGMENT_HISTORIC[k0] || k0; + const v = val(v0, k0); + utils.deepSetValue(adUnit.unit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd.${k}`, v); + }); + }); + }; + + // utils.mergeDeep does not handle merging deep arrays... (╯°□°)╯ ┻━┻ + function mergeDeep(target, ...sources) { + function emptyValue(v) { + if (utils.isPlainObject(v)) { + return {}; + } else if (utils.isArray(v)) { + return []; + } else { + return undefined; + } + } + + if (!sources.length) return target; + const source = sources.shift(); + + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + Object.keys(source).forEach(key => { + if (!(key in target)) target[key] = emptyValue(source[key]); + target[key] = target[key] !== undefined ? mergeDeep(target[key], source[key]) : source[key]; + }); + } else if (utils.isArray(target) && utils.isArray(source)) { + source.forEach((v, i) => { + if (!(i in target)) target[i] = emptyValue(v); + target[i] = target[i] !== undefined ? mergeDeep(target[i], v) : v; + }); + } else { + target = source; + } + + return mergeDeep(target, ...sources); + } + + let semaphore = 1; + function semaphoreInc(inc) { + if (semaphore == 0) return; + semaphore += inc; + if (semaphore == 0) { + setSegments() + callback(); + } + } + + const args = [ + [ 'v', `pbjs-${getGlobal().version}` ], + [ 'c', config.params.clientid ], + [ 'p', config.params.platformid ], + [ 't', config.params.tagid ], + [ 'imp', config.params.imps ], + [ 'fc_ip', config.params.freqcap_ip ], + [ 'fc_ipua', config.params.freqcap_ipua ], + [ 'pn', document.location.pathname ] + ]; + + if (!adUnits.length) { + utils.logWarn(MODULE, 'no suitable adUnits (missing pbadslot?)'); + } + const atfQueue = []; + adUnits.map((adUnit, i) => { + const ref = [ adUnit.path ]; + if (!config.params.slotinpath) ref.push(adUnit.unit.code); + args.push(['s', ref.join('\t')]); + + semaphoreInc(1); + atfQueue.push(function() { + atf(adUnit.unit, function(x) { + let viewable = document.visibilityState === undefined || document.visibilityState == 'visible'; + try { viewable = viewable && top.document.hasFocus() } catch (_) {} + utils.logInfo(MODULE, `atf code=${adUnit.unit.code} has area=${x}, viewable=${viewable}`); + const atfList = []; atfList[i] = { atf: parseInt(x * 100) }; + response = mergeDeep(response, { _: atfList }); + semaphoreInc(-1); + }); + }); + }); + function atfCb() { + atfQueue.forEach(x => x()); + } + if (document.readyState == 'loading') { + document.addEventListener('DOMContentLoaded', atfCb, false); + } else { + atfCb(); + } + + analyticsCommand(COMMAND.URL, { + url: (config.params.api_origin || API_ORIGIN) + '/q?', + args: args + }, function(url) { + ajax(url, { + success: function(responseText, q) { + try { + if (q.getResponseHeader('content-type') == 'application/json') { + response = mergeDeep(response, JSON.parse(responseText)); + } else { + throw false; + } + } catch (_) { + utils.logError(MODULE, 'unexpected response'); + } + semaphoreInc(-1); + }, + error: function(statusText, q) { + utils.logError(MODULE, 'request failed'); + semaphoreInc(-1); + } + }); + }); +} + +function getTargetingData(adUnitArray, config, userConsent) { + function targetingNormalise(v) { + if (utils.isArray(v) && v.length == 0) return undefined; + if (utils.isBoolean(v)) v = ~~v; + if (!v) return undefined; // empty string and zero + return v; + } + + const dataSite = _config.getConfig(`ortb2.site.ext.data.${MODULE_NAME}_rtd`) || {}; + if (!dataSite.ok) return {}; + + const dataUser = _config.getConfig(`ortb2.user.ext.data.${MODULE_NAME}_rtd`) || {}; + return getGlobal().adUnits.filter(adUnit => includes(adUnitArray, adUnit.code)).reduce((a, adUnit) => { + a[adUnit.code] = {}; + + utils._each(dataSite, (v0, k) => { + if (includes(SEGMENT_HISTORIC_VALUES, k)) return; // ignore site average viewability + const v = targetingNormalise(v0); + if (v) a[adUnit.code][ADSERVER_TARGETING_PREFIX + k] = v; + }); + + const adUnitSegments = utils.deepAccess(adUnit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd`, {}); + utils._each(Object.assign({}, dataUser, adUnitSegments), (v0, k) => { + const v = targetingNormalise(v0); + if (v) a[adUnit.code][ADSERVER_TARGETING_PREFIX + k] = v; + }); + + return a; + }, {}); +} + +export const subModuleObj = { + name: MODULE_NAME, + init, + getBidRequestData, + getTargetingData, + atf // used by adlooxRtdProvider_spec.js +}; + +submodule('realTimeData', subModuleObj); diff --git a/modules/adlooxRtdProvider.md b/modules/adlooxRtdProvider.md new file mode 100644 index 00000000000..6c75fbc2d8b --- /dev/null +++ b/modules/adlooxRtdProvider.md @@ -0,0 +1,105 @@ +# Overview + + Module Name: Adloox RTD Provider + Module Type: RTD Provider + Maintainer: contact@adloox.com + +# Description + +RTD provider for adloox.com. Contact contact@adloox.com for information. + +This provider fetches segments and populates the [First Party Data](https://docs.prebid.org/features/firstPartyData.html) attributes, some examples of the segments as described by the Adloox 'Google Publisher Tag Targeting Guidelines' and where they are placed are: + + * Page segments are placed into `ortb2.site.ext.data.adloox_rtd`: + * **`ok`:** boolean (use to capture if our module successfully ran) + * Device segments are placed into `ortb2.user.ext.data.adloox_rtd`: + * **`ivt`:** boolean + * **`ua_old`:** boolean + * **`ip`:** list of strings describing classification of IP (eg. `rfc-special`, `iab-dc`, ...) + * AdUnit segments are placed into `AdUnit.ortb2Imp.ext.data.adloox_rtd`: + * **`{dis,vid,aud}`:** an list of integers describing the likelihood the AdUnit will be visible + * **`atf`:** an list of integers describing the percentage of pixels visible at auction + * measured only once at pre-auction + * usable when the publisher uses the strategy of collapsing ad slots on no-fill + * using the reverse strategy, growing ad slots on fill, invalidates the measurement the position of all content (including the slots) changes post-auction + * works best when your page loads your ad slots have their actual size rendered (ie. not zero height) + * uses the smallest ad unit (above a threshold area of 20x20) supplied by the [publisher to Prebid.js](https://docs.prebid.org/dev-docs/examples/basic-example.html) and measures viewability as if that size to be used + * when used in cross-origin (unfriendly) IFRAME environments the ad slot is directly measured as is (ignoring publisher provided sizes) due to limitations in using [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) + +**N.B.** this provider does not offer or utilise any user orientated data + +These segments are also sent to your ad server but are translated using the following rules: + + * prepended the segment name with `adl_` + * segments are filtered out when their value is either: + * empty string ("") + * zero (`0`) + * boolean `false` + * empty list/array + +For example: + + * `ortb2.site.ext.data.adloox_rtd.ok` is translated to `adl_ok` + * `ortb2.user.ext.data.adloox_rtd.ivt` is translated to `adl_ivt` + * `AdUnit.ortb2Imp.ext.data.adloox_rtd.dis` is translated to `adl_dis` + +## Example + +To view an example of an Adloox integration look at the example provided in the [Adloox Analytics Adapter documentation](./adlooxAnalyticsAdapter.md#example). + +# Integration + +To use this, you *must* also integrate the [Adloox Analytics Adapter](./adlooxAnalyticsAdapter.md) as shown below: + + pbjs.setConfig({ + ... + + realTimeData: { + auctionDelay: 100, // see below for guidance + dataProviders: [ + { + name: 'adloox', + params: { // optional, defaults shown + thresholds: [ 50, 60, 70, 80, 90 ], + slotinpath: false + } + } + ] + }, + + ... + }); + pbjs.enableAnalytics({ + provider: 'adloox', + options: { + client: 'adlooxtest', + clientid: 127, + platformid: 0, + tagid: 0 + } + }); + +You may optionally pass a subsection `params` in the `params` block to the Adloox RTD Provider, these will be passed through to the segment handler as is and as described by the integration guidelines. + +**N.B.** If you pass `params` to the Adloox Analytics Adapter, `id1` (`AdUnit.code`) and `id2` (`%%pbadslot%%`) *must* describe a stable identifier otherwise no usable segments will be served and so they *must not* be changed; if `id1` for your inventory could contain a non-stable random number please consult with us before continuing + +Though our segment technology is fast (less than 10ms) the time it takes for the users device to connect to our service and fetch the segments may not be. For this reason we recommend setting `auctionDelay` no lower than 100ms and if possible you should explore using user-agent sourced information such as [NetworkInformation.{rtt,downlink,...}](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation) to dynamically tune this for each user. + +## Prebid Ad Slot + +To create reliable segments, a stable description for slots on your inventory needs to be supplied which is typically solved by using the [Prebid Ad Slot](https://docs.prebid.org/features/pbAdSlot.html). + +You may use one of two ways to do achieve this: + + * for display inventory [using GPT](https://developers.google.com/publisher-tag/guides/get-started) you may configure Prebid.js to automatically use the [full ad unit path](https://developers.google.com/publisher-tag/reference#googletag.Slot_getAdUnitPath) + 1. include the [`gptPreAuction` module](https://docs.prebid.org/dev-docs/modules/gpt-pre-auction.html) + 1. wrap both `pbjs.setConfig({...})` and `pbjs.enableAnalytics({...})` with `googletag.cmd.push(function() { ... })` + * set `pbadslot` in the [first party data](https://docs.prebid.org/dev-docs/adunit-reference.html#first-party-data) variable `AdUnit.ortb2Imp.ext.data.pbadslot` for all your ad units + +## Timeouts + +It is strongly recommended you increase any [failsafe timeout](https://docs.prebid.org/dev-docs/faq.html#when-starting-out-what-should-my-timeouts-be) you use by at least the value you supply to `auctionDelay` above. + +Adloox recommends you use the following (based on [examples provided on the Prebid.js website](https://docs.prebid.org/dev-docs/examples/basic-example.html)) + + FAILSAFE_TIMEOUT = AUCTION_DELAY + (3 * PREBID_TIMEOUT) diff --git a/test/spec/modules/adlooxAnalyticsAdapter_spec.js b/test/spec/modules/adlooxAnalyticsAdapter_spec.js index 0264922f45e..01ab3afcf2f 100644 --- a/test/spec/modules/adlooxAnalyticsAdapter_spec.js +++ b/test/spec/modules/adlooxAnalyticsAdapter_spec.js @@ -35,7 +35,7 @@ describe('Adloox Analytics Adapter', function () { tagid: 0, params: { dummy1: '%%client%%', - dummy2: '%%pbAdSlot%%', + dummy2: '%%pbadslot%%', dummy3: function(bid) { throw new Error(esplode) } } }; diff --git a/test/spec/modules/adlooxRtdProvider_spec.js b/test/spec/modules/adlooxRtdProvider_spec.js new file mode 100644 index 00000000000..c0438c45451 --- /dev/null +++ b/test/spec/modules/adlooxRtdProvider_spec.js @@ -0,0 +1,313 @@ +import adapterManager from 'src/adapterManager.js'; +import analyticsAdapter from 'modules/adlooxAnalyticsAdapter.js'; +import { config as _config } from 'src/config.js'; +import { expect } from 'chai'; +import events from 'src/events.js'; +import * as prebidGlobal from 'src/prebidGlobal.js'; +import { subModuleObj as rtdProvider } from 'modules/adlooxRtdProvider.js'; +import * as utils from 'src/utils.js'; + +const analyticsAdapterName = 'adloox'; + +describe('Adloox RTD Provider', function () { + let sandbox; + + const adUnit = { + code: 'ad-slot-1', + ortb2Imp: { + ext: { + data: { + pbadslot: '/123456/home/ad-slot-1' + } + } + }, + mediaTypes: { + banner: { + sizes: [ [300, 250] ] + } + }, + bids: [ + { + bidder: 'dummy' + } + ] + }; + + const analyticsOptions = { + js: 'https://j.adlooxtracking.com/ads/js/tfav_adl_%%clientid%%.js', + client: 'adlooxtest', + clientid: 127, + platformid: 0, + tagid: 0 + }; + + const config = {}; + + adapterManager.registerAnalyticsAdapter({ + code: analyticsAdapterName, + adapter: analyticsAdapter + }); + + before(function () { + sandbox = sinon.sandbox.create(); + sandbox.stub(events, 'getEvents').returns([]); + }); + + after(function () { + sandbox.restore(); + sandbox = undefined; + }); + + describe('invalid config', function () { + it('should require config', function (done) { + const ret = rtdProvider.init(); + + expect(ret).is.false; + + done(); + }); + + it('should reject non-object config.params', function (done) { + const ret = rtdProvider.init({ params: null }); + + expect(ret).is.false; + + done(); + }); + + it('should reject non-string config.params.api_origin', function (done) { + const ret = rtdProvider.init({ params: { api_origin: null } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject less than one config.params.imps', function (done) { + const ret = rtdProvider.init({ params: { imps: 0 } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject negative config.params.freqcap_ip', function (done) { + const ret = rtdProvider.init({ params: { freqcap_ip: -1 } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject negative integer config.params.freqcap_ipua', function (done) { + const ret = rtdProvider.init({ params: { freqcap_ipua: -1 } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject non-array of integers with value greater than zero config.params.thresholds', function (done) { + const ret = rtdProvider.init({ params: { thresholds: [ 70, null ] } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject non-boolean config.params.slotinpath', function (done) { + const ret = rtdProvider.init({ params: { slotinpath: null } }); + + expect(ret).is.false; + + done(); + }); + + it('should reject invalid config.params.params (legacy/deprecated)', function (done) { + const ret = rtdProvider.init({ params: { params: { clientid: 0, tagid: 0 } } }); + + expect(ret).is.false; + + done(); + }); + }); + + describe('process segments', function () { + before(function () { + adapterManager.enableAnalytics({ + provider: analyticsAdapterName, + options: analyticsOptions + }); + expect(analyticsAdapter.context).is.not.null; + }); + + after(function () { + analyticsAdapter.disableAnalytics(); + expect(analyticsAdapter.context).is.null; + }); + + let server = null; + let __config = null, CONFIG = null; + let getConfigStub, setConfigStub; + beforeEach(function () { + server = sinon.createFakeServer(); + __config = {}; + CONFIG = utils.deepClone(config); + getConfigStub = sinon.stub(_config, 'getConfig').callsFake(function (path) { + return utils.deepAccess(__config, path); + }); + setConfigStub = sinon.stub(_config, 'setConfig').callsFake(function (obj) { + utils.mergeDeep(__config, obj); + }); + }); + afterEach(function () { + setConfigStub.restore(); + getConfigStub.restore(); + getConfigStub = setConfigStub = undefined; + CONFIG = null; + __config = null; + server.restore(); + server = null; + }); + + it('should fetch segments', function (done) { + const adUnitWithSegments = utils.deepClone(adUnit); + const getGlobalStub = sinon.stub(prebidGlobal, 'getGlobal').returns({ + adUnits: [ adUnitWithSegments ] + }); + + const ret = rtdProvider.init(CONFIG); + expect(ret).is.true; + + const callback = function () { + expect(__config.ortb2.site.ext.data.adloox_rtd.ok).is.true; + expect(__config.ortb2.site.ext.data.adloox_rtd.nope).is.undefined; + expect(__config.ortb2.user.ext.data.adloox_rtd.unused).is.false; + expect(__config.ortb2.user.ext.data.adloox_rtd.nope).is.undefined; + expect(adUnitWithSegments.ortb2Imp.ext.data.adloox_rtd.dis.length).is.equal(3); + expect(adUnitWithSegments.ortb2Imp.ext.data.adloox_rtd.nope).is.undefined; + + getGlobalStub.restore(); + + done(); + }; + rtdProvider.getBidRequestData({}, callback, CONFIG, null); + + const request = server.requests[0]; + const response = { unused: false, _: [ { d: 77 } ] }; + request.respond(200, { 'content-type': 'application/json' }, JSON.stringify(response)); + }); + + it('should set ad server targeting', function (done) { + utils.deepSetValue(__config, 'ortb2.site.ext.data.adloox_rtd.ok', true); + + const adUnitWithSegments = utils.deepClone(adUnit); + utils.deepSetValue(adUnitWithSegments, 'ortb2Imp.ext.data.adloox_rtd.dis', [ 50, 60 ]); + const getGlobalStub = sinon.stub(prebidGlobal, 'getGlobal').returns({ + adUnits: [ adUnitWithSegments ] + }); + + const targetingData = rtdProvider.getTargetingData([ adUnitWithSegments.code ], CONFIG); + expect(Object.keys(targetingData).length).is.equal(1); + expect(Object.keys(targetingData[adUnit.code]).length).is.equal(2); + expect(targetingData[adUnit.code].adl_ok).is.equal(1); + expect(targetingData[adUnit.code].adl_dis.length).is.equal(2); + + getGlobalStub.restore(); + + done(); + }); + }); + + describe('measure atf', function () { + const adUnitCopy = utils.deepClone(adUnit); + + const ratio = 0.38; + const [ [width, height] ] = utils.getAdUnitSizes(adUnitCopy); + + before(function () { + adapterManager.enableAnalytics({ + provider: analyticsAdapterName, + options: analyticsOptions + }); + expect(analyticsAdapter.context).is.not.null; + }); + + after(function () { + analyticsAdapter.disableAnalytics(); + expect(analyticsAdapter.context).is.null; + }); + + it(`should return ${ratio} for same-origin`, function (done) { + const el = document.createElement('div'); + el.setAttribute('id', adUnitCopy.code); + + const offset = height * ratio; + const elStub = sinon.stub(el, 'getBoundingClientRect').returns({ + top: 0 - (height - offset), + bottom: height - offset, + left: 0, + right: width + }); + + const querySelectorStub = sinon.stub(document, 'querySelector'); + querySelectorStub.withArgs(`#${adUnitCopy.code}`).returns(el); + + rtdProvider.atf(adUnitCopy, function(x) { + expect(x).is.equal(ratio); + + querySelectorStub.restore(); + elStub.restore(); + + done(); + }); + }); + + ('IntersectionObserver' in window ? it : it.skip)(`should return ${ratio} for cross-origin`, function (done) { + const frameElementStub = sinon.stub(window, 'frameElement').value(null); + + const el = document.createElement('div'); + el.setAttribute('id', adUnitCopy.code); + + const elStub = sinon.stub(el, 'getBoundingClientRect').returns({ + top: 0, + bottom: height, + left: 0, + right: width + }); + + const querySelectorStub = sinon.stub(document, 'querySelector'); + querySelectorStub.withArgs(`#${adUnitCopy.code}`).returns(el); + + let intersectionObserverStubFn = null; + const intersectionObserverStub = sinon.stub(window, 'IntersectionObserver').callsFake((fn) => { + intersectionObserverStubFn = fn; + return { + observe: (element) => { + expect(element).is.equal(el); + + intersectionObserverStubFn([{ + target: element, + intersectionRect: { width, height }, + intersectionRatio: ratio + }]); + }, + unobserve: (element) => { + expect(element).is.equal(el); + } + } + }); + + rtdProvider.atf(adUnitCopy, function(x) { + expect(x).is.equal(ratio); + + intersectionObserverStub.restore(); + querySelectorStub.restore(); + elStub.restore(); + frameElementStub.restore(); + + done(); + }); + }); + }); +}); From 343bae2334ea938049a58b874a19910e685710ff Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Wed, 1 Sep 2021 13:45:44 -0400 Subject: [PATCH 012/250] Prebid 5.12.0 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 35c7c304230..308a529a671 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.12.0-pre", + "version": "5.12.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 68c2a4d83d145d35c04c1cb549b55e79bcbef933 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Wed, 1 Sep 2021 14:28:04 -0400 Subject: [PATCH 013/250] Increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 308a529a671..e9ac6d496dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.12.0", + "version": "5.13.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 253600d5839adb8e13a5d1bfbfec12f09ee4df0b Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Wed, 1 Sep 2021 17:49:25 -0700 Subject: [PATCH 014/250] Finteza Analytics Adapter: bugfix for flaky test (Issue #7348) (#7356) * Testing if Another Adapter is the Issue * researching error * add time to test latency * add this * fix undefined * move length check after other checks * fix linting * move other length test * update other length check to test --- test/spec/modules/fintezaAnalyticsAdapter_spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/spec/modules/fintezaAnalyticsAdapter_spec.js b/test/spec/modules/fintezaAnalyticsAdapter_spec.js index 4c76f79f518..54d1a7e7976 100644 --- a/test/spec/modules/fintezaAnalyticsAdapter_spec.js +++ b/test/spec/modules/fintezaAnalyticsAdapter_spec.js @@ -119,11 +119,11 @@ describe('finteza analytics adapter', function () { // Emit the events with the "real" arguments events.emit(constants.EVENTS.BID_RESPONSE, bidResponse); - expect(server.requests.length).to.equal(2); - expect(server.requests[0].method).to.equal('GET'); expect(server.requests[0].withCredentials).to.equal(true); + expect(server.requests.length).to.equal(2); + let url = parseUrl(server.requests[0].url); expect(url.protocol).to.equal('https'); @@ -173,11 +173,11 @@ describe('finteza analytics adapter', function () { // Emit the events with the "real" arguments events.emit(constants.EVENTS.BID_WON, bidWon); - expect(server.requests.length).to.equal(1); - expect(server.requests[0].method).to.equal('GET'); expect(server.requests[0].withCredentials).to.equal(true); + expect(server.requests.length).to.equal(1); + const url = parseUrl(server.requests[0].url); expect(url.protocol).to.equal('https'); @@ -212,11 +212,11 @@ describe('finteza analytics adapter', function () { // Emit the events with the "real" arguments events.emit(constants.EVENTS.BID_TIMEOUT, bidTimeout); - expect(server.requests.length).to.equal(1); - expect(server.requests[0].method).to.equal('GET'); expect(server.requests[0].withCredentials).to.equal(true); + expect(server.requests.length).to.equal(1); + const url = parseUrl(server.requests[0].url); expect(url.protocol).to.equal('https'); From b3c091613ec29967f2102f0ca8c4e4c0cbf18c49 Mon Sep 17 00:00:00 2001 From: Love Sharma Date: Thu, 2 Sep 2021 08:25:54 -0400 Subject: [PATCH 015/250] IX Adapter: buildRequests refactor (#7364) * buildRequests refactor * remove use of Array.includes Co-authored-by: Love Sharma Co-authored-by: Kajan Umakanthan --- modules/ixBidAdapter.js | 180 ++++++++++++++++--------- test/spec/modules/ixBidAdapter_spec.js | 29 +--- 2 files changed, 116 insertions(+), 93 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 2d7157bc674..ab9c995aa7c 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -4,6 +4,7 @@ import { config } from '../src/config.js'; import find from 'core-js-pure/features/array/find.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { INSTREAM, OUTSTREAM } from '../src/video.js'; +import includes from 'core-js-pure/features/array/includes.js'; const BIDDER_CODE = 'ix'; const ALIAS_BIDDER_CODE = 'roundel'; @@ -108,8 +109,8 @@ function bidToVideoImp(bid) { const imp = bidToImp(bid); const videoAdUnitRef = utils.deepAccess(bid, 'mediaTypes.video'); const videoParamRef = utils.deepAccess(bid, 'params.video'); - - if (!checkVideoParams(bid, videoAdUnitRef, videoParamRef)) { + const videoParamErrors = checkVideoParams(videoAdUnitRef, videoParamRef); + if (videoParamErrors.length) { return {}; } @@ -305,7 +306,7 @@ function isValidSize(size) { * @return {boolean} True if the size object is an element of the size array, and false * otherwise. */ -function includesSize(sizeArray = [], size) { +function includesSize(sizeArray = [], size = []) { if (isValidSize(sizeArray)) { return sizeArray[0] === size[0] && sizeArray[1] === size[1]; } @@ -319,13 +320,12 @@ function includesSize(sizeArray = [], size) { /** * Checks if all required video params are present - * @param {object} bid Bid Object * @param {object} mediaTypeVideoRef Ad unit level mediaTypes object * @param {object} paramsVideoRef IX bidder params level video object - * @returns bool Are the required video params available + * @returns {string[]} Are the required video params available */ -function checkVideoParams(bid, mediaTypeVideoRef, paramsVideoRef) { - let reqParamsPresent = true; +function checkVideoParams(mediaTypeVideoRef, paramsVideoRef) { + const errorList = []; if (!mediaTypeVideoRef) { utils.logWarn('IX Bid Adapter: mediaTypes.video is the preferred location for video params in ad unit'); @@ -336,23 +336,21 @@ function checkVideoParams(bid, mediaTypeVideoRef, paramsVideoRef) { const propInVideoRef = paramsVideoRef && paramsVideoRef.hasOwnProperty(property); if (!propInMediaType && !propInVideoRef) { - utils.logError(`IX Bid Adapter: ${property} is not included in either the adunit or params level`); - reqParamsPresent = false; + errorList.push(`IX Bid Adapter: ${property} is not included in either the adunit or params level`); } } - // early return - if (!reqParamsPresent) { - return false; - } - // check protocols/protocol const protocolMediaType = mediaTypeVideoRef && mediaTypeVideoRef.hasOwnProperty('protocol'); const protocolsMediaType = mediaTypeVideoRef && mediaTypeVideoRef.hasOwnProperty('protocols'); const protocolVideoRef = paramsVideoRef && paramsVideoRef.hasOwnProperty('protocol'); const protocolsVideoRef = paramsVideoRef && paramsVideoRef.hasOwnProperty('protocols'); - return protocolMediaType || protocolsMediaType || protocolVideoRef || protocolsVideoRef; + if (!(protocolMediaType || protocolsMediaType || protocolVideoRef || protocolsVideoRef)) { + errorList.push('IX Bid Adapter: protocol/protcols is not included in either the adunit or params level'); + } + + return errorList; } /** @@ -825,6 +823,66 @@ function removeFromSizes(bannerSizeList, bannerSize) { } } +/** + * Creates IX Video impressions based on validBidRequests + * @param {object} validBidRequest valid request provided by prebid + * @param {object} videoImps reference to created video impressions + */ +function createVideoImps(validBidRequest, videoImps) { + const imp = bidToVideoImp(validBidRequest); + if (Object.keys(imp).length != 0) { + videoImps[validBidRequest.transactionId] = {}; + videoImps[validBidRequest.transactionId].ixImps = []; + videoImps[validBidRequest.transactionId].ixImps.push(imp); + } +} + +/** + * Creates IX banner impressions based on validBidRequests + * @param {object} validBidRequest valid request provided by prebid + * @param {object} missingBannerSizes reference to missing banner config sizes + * @param {object} bannerImps reference to created banner impressions + */ +function createBannerImps(validBidRequest, missingBannerSizes, bannerImps) { + const DEFAULT_IX_CONFIG = { + detectMissingSizes: true, + }; + + const ixConfig = { ...DEFAULT_IX_CONFIG, ...config.getConfig('ix') }; + + let imp = bidToBannerImp(validBidRequest); + + const bannerSizeDefined = includesSize(utils.deepAccess(validBidRequest, 'mediaTypes.banner.sizes'), utils.deepAccess(validBidRequest, 'params.size')); + + // Create IX imps from params.size + if (bannerSizeDefined) { + if (!bannerImps.hasOwnProperty(validBidRequest.transactionId)) { + bannerImps[validBidRequest.transactionId] = {}; + } + if (!bannerImps[validBidRequest.transactionId].hasOwnProperty('ixImps')) { + bannerImps[validBidRequest.transactionId].ixImps = [] + } + bannerImps[validBidRequest.transactionId].ixImps.push(imp); + } + + if (ixConfig.hasOwnProperty('detectMissingSizes') && ixConfig.detectMissingSizes) { + updateMissingSizes(validBidRequest, missingBannerSizes, imp); + } +} + +/** + * Determines IX configuration type based on IX params + * @param {object} valid IX configured param + * @returns {string} + */ +function detectParamsType(validBidRequest) { + if (utils.deepAccess(validBidRequest, 'params.video') && utils.deepAccess(validBidRequest, 'mediaTypes.video')) { + return VIDEO; + } + + return BANNER; +} + /** * Updates the Object to track missing banner sizes. * @@ -933,9 +991,15 @@ export const spec = { return false; } } - // For multi format unit - if (!mediaTypeBannerSizes && (mediaTypeVideoRef || paramsVideoRef)) { - return checkVideoParams(bid, mediaTypeVideoRef, paramsVideoRef); + + if (mediaTypeVideoRef && paramsVideoRef) { + const errorList = checkVideoParams(mediaTypeVideoRef, paramsVideoRef); + if (errorList.length) { + errorList.forEach((err) => { + utils.logError(err); + }); + return false; + } } return true; }, @@ -948,58 +1012,43 @@ export const spec = { * @return {object} Info describing the request to the server. */ buildRequests: function (validBidRequests, bidderRequest) { - let reqs = []; - let bannerImps = {}; - let videoImps = {}; - let validBidRequest = null; - - // To capture the missing sizes i.e not configured for ix - let missingBannerSizes = {}; + const reqs = []; // Stores banner + video requests + const bannerImps = {}; // Stores created banner impressions + const videoImps = {}; // Stores created video impressions + const multiFormatAdUnits = {}; // Stores references identified multi-format adUnits + const missingBannerSizes = {}; // To capture the missing sizes i.e not configured for ix + + // Step 1: Create impresssions from IX params + validBidRequests.forEach((validBidRequest) => { + const adUnitMediaTypes = Object.keys(utils.deepAccess(validBidRequest, 'mediaTypes', {})) + + switch (detectParamsType(validBidRequest)) { + case BANNER: + createBannerImps(validBidRequest, missingBannerSizes, bannerImps); + break; + case VIDEO: + createVideoImps(validBidRequest, videoImps) + break; + } - const DEFAULT_IX_CONFIG = { - detectMissingSizes: true, - }; + if (includes(adUnitMediaTypes, BANNER) && includes(adUnitMediaTypes, VIDEO)) { + multiFormatAdUnits[validBidRequest.transactionId] = validBidRequest; + } + }); - const ixConfig = { ...DEFAULT_IX_CONFIG, ...config.getConfig('ix') }; - - for (let i = 0; i < validBidRequests.length; i++) { - validBidRequest = validBidRequests[i]; - const videoAdUnitRef = utils.deepAccess(validBidRequest, 'mediaTypes.video'); - const videoParamRef = utils.deepAccess(validBidRequest, 'params.video'); - - // identify video ad unit - if (validBidRequest.mediaType === VIDEO || videoAdUnitRef || videoParamRef) { - if (!videoImps.hasOwnProperty(validBidRequest.transactionId)) { - const imp = bidToVideoImp(validBidRequest); - if (Object.keys(imp).length != 0) { - videoImps[validBidRequest.transactionId] = {}; - videoImps[validBidRequest.transactionId].ixImps = []; - videoImps[validBidRequest.transactionId].ixImps.push(imp); - } - } + // Step 2: Create impressions for multi-format adunits missing configurations + Object.keys(multiFormatAdUnits).forEach((transactionId) => { + const validBidRequest = multiFormatAdUnits[transactionId]; + if (!bannerImps[transactionId]) { + createBannerImps(validBidRequest, missingBannerSizes, bannerImps); } - if (validBidRequest.mediaType === BANNER || - (utils.deepAccess(validBidRequest, 'mediaTypes.banner.sizes')) || - (!validBidRequest.mediaType && !validBidRequest.mediaTypes)) { - let imp = bidToBannerImp(validBidRequest); - // Create IX imps from params.size - if (utils.deepAccess(validBidRequest, 'params.size')) { - if (!bannerImps.hasOwnProperty(validBidRequest.transactionId)) { - bannerImps[validBidRequest.transactionId] = {}; - } - if (!bannerImps[validBidRequest.transactionId].hasOwnProperty('ixImps')) { - bannerImps[validBidRequest.transactionId].ixImps = [] - } - bannerImps[validBidRequest.transactionId].ixImps.push(imp); - } - if (ixConfig.hasOwnProperty('detectMissingSizes') && ixConfig.detectMissingSizes) { - updateMissingSizes(validBidRequest, missingBannerSizes, imp); - } + if (!videoImps[transactionId]) { + createVideoImps(validBidRequest, videoImps) } - } + }); - // Finding the missing banner sizes, and making impressions for them + // Step 3: Update banner impressions with missing sizes for (var transactionId in missingBannerSizes) { if (missingBannerSizes.hasOwnProperty(transactionId)) { let missingSizes = missingBannerSizes[transactionId].missingSizes; @@ -1014,13 +1063,14 @@ export const spec = { let origImp = missingBannerSizes[transactionId].impression; for (let i = 0; i < missingSizes.length; i++) { - let newImp = createMissingBannerImp(validBidRequest, origImp, missingSizes[i]); + let newImp = createMissingBannerImp(validBidRequests[0], origImp, missingSizes[i]); bannerImps[transactionId].missingImps.push(newImp); bannerImps[transactionId].missingCount++; } } } + // Step 4: Build banner & video requests if (Object.keys(bannerImps).length > 0) { reqs.push(...buildRequest(validBidRequests, bidderRequest, bannerImps, BANNER_ENDPOINT_VERSION)); } diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 53bfc74af7f..85236571383 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -1372,12 +1372,6 @@ describe('IndexexchangeAdapter', function () { const requestWithoutSchain = spec.buildRequests(bidWithoutSchain, DEFAULT_OPTION)[0]; const queryWithoutSchain = requestWithoutSchain.data; - const bidWithoutMediaType = utils.deepClone(DEFAULT_BANNER_VALID_BID); - delete bidWithoutMediaType[0].mediaTypes; - bidWithoutMediaType[0].sizes = [[300, 250], [300, 600]]; - const requestWithoutMediaType = spec.buildRequests(bidWithoutMediaType, DEFAULT_OPTION)[0]; - const queryWithoutMediaType = requestWithoutMediaType.data; - it('request should be made to IX endpoint with GET method', function () { expect(requestMethod).to.equal('GET'); expect(requestUrl).to.equal(IX_SECURE_ENDPOINT); @@ -1598,27 +1592,6 @@ describe('IndexexchangeAdapter', function () { }); }); - it('payload without mediaType should have correct format and value', function () { - const payload = JSON.parse(queryWithoutMediaType.r); - - expect(payload.id).to.equal(DEFAULT_BANNER_VALID_BID[0].bidderRequestId); - expect(payload.site.page).to.equal(DEFAULT_OPTION.refererInfo.referer); - expect(payload.site.ref).to.equal(document.referrer); - expect(payload.ext.source).to.equal('prebid'); - expect(payload.imp).to.be.an('array'); - expect(payload.imp).to.have.lengthOf(1); - }); - - it('impression without mediaType should have correct format and value', function () { - const impression = JSON.parse(queryWithoutMediaType.r).imp[0]; - - expect(impression.id).to.equal(DEFAULT_BANNER_VALID_BID[0].bidId); - expect(impression.banner.format).to.be.length(1); - expect(impression.banner.format[0].w).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[0]); - expect(impression.banner.format[0].h).to.equal(DEFAULT_BANNER_VALID_BID[0].params.size[1]); - expect(impression.banner.topframe).to.be.oneOf([0, 1]); - }); - it('impression should have sid if id is configured as number', function () { const bid = utils.deepClone(DEFAULT_BANNER_VALID_BID[0]); bid.params.id = 50; @@ -2005,7 +1978,7 @@ describe('IndexexchangeAdapter', function () { it('should handle unexpected context', function () { const bid = utils.deepClone(DEFAULT_VIDEO_VALID_BID[0]); - bid.mediaTypes.video.context = 'VaccineJanssen'; + bid.mediaTypes.video.context = 'not-valid'; const request = spec.buildRequests([bid])[0]; const impression = JSON.parse(request.data.r).imp[0]; expect(impression.video.placement).to.be.undefined; From 28202c990a8add61438cdd2784165f18e004b115 Mon Sep 17 00:00:00 2001 From: onetag-dev <38786435+onetag-dev@users.noreply.github.com> Date: Thu, 2 Sep 2021 15:25:03 +0200 Subject: [PATCH 016/250] Onetag Bid Adapter: extend mediaType support (#7363) * add support for all mediaType fields * fix test unit Co-authored-by: francesco --- modules/onetagBidAdapter.js | 9 +++------ test/spec/modules/onetagBidAdapter_spec.js | 7 ++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/onetagBidAdapter.js b/modules/onetagBidAdapter.js index aab68176d87..7a0b78ceeff 100644 --- a/modules/onetagBidAdapter.js +++ b/modules/onetagBidAdapter.js @@ -7,6 +7,7 @@ import find from 'core-js-pure/features/array/find.js'; import { getStorageManager } from '../src/storageManager.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { createEidsArray } from './userId/eids.js'; +import { deepClone } from '../src/utils.js'; const ENDPOINT = 'https://onetag-sys.com/prebid-request'; const USER_SYNC_ENDPOINT = 'https://onetag-sys.com/usync/'; @@ -239,15 +240,10 @@ function requestsToBids(bidRequests) { // Pass parameters // Context: instream - outstream - adpod videoObj['context'] = bidRequest.mediaTypes.video.context; - // MIME Video Types - videoObj['mimes'] = bidRequest.mediaTypes.video.mimes; // Sizes videoObj['playerSize'] = parseVideoSize(bidRequest); // Other params - videoObj['protocols'] = bidRequest.mediaTypes.video.protocols; - videoObj['maxDuration'] = bidRequest.mediaTypes.video.maxduration; - videoObj['api'] = bidRequest.mediaTypes.video.api; - videoObj['playbackmethod'] = bidRequest.mediaTypes.video.playbackmethod || []; + videoObj['mediaTypeInfo'] = deepClone(bidRequest.mediaTypes.video); videoObj['type'] = VIDEO; return videoObj; }); @@ -256,6 +252,7 @@ function requestsToBids(bidRequests) { setGeneralInfo.call(bannerObj, bidRequest); bannerObj['sizes'] = parseSizes(bidRequest); bannerObj['type'] = BANNER; + bannerObj['mediaTypeInfo'] = deepClone(bidRequest.mediaTypes.banner); return bannerObj; }); return videoBidRequests.concat(bannerBidRequests); diff --git a/test/spec/modules/onetagBidAdapter_spec.js b/test/spec/modules/onetagBidAdapter_spec.js index 9fb73f7774b..e873597ca15 100644 --- a/test/spec/modules/onetagBidAdapter_spec.js +++ b/test/spec/modules/onetagBidAdapter_spec.js @@ -191,12 +191,8 @@ describe('onetag', function () { 'pubId', 'transactionId', 'context', - 'mimes', 'playerSize', - 'protocols', - 'maxDuration', - 'api', - 'playbackmethod', + 'mediaTypeInfo', 'type' ); } else if (isValid(BANNER, bid)) { @@ -207,6 +203,7 @@ describe('onetag', function () { 'bidderRequestId', 'pubId', 'transactionId', + 'mediaTypeInfo', 'sizes', 'type' ); From 697abe06a4b63bc64635688a69beda084d2dd7e6 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 2 Sep 2021 19:09:55 +0200 Subject: [PATCH 017/250] Impactify Bid Adapter: add userid schain support (#7377) * Update for Prebid 5.X * Update to Prebid 5.X * Add support for UserID and Schain Modules. * Remove ESL-lint for no console * Add the UserID in test --- modules/impactifyBidAdapter.js | 17 +++++++++++++++-- test/spec/modules/impactifyBidAdapter_spec.js | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/impactifyBidAdapter.js b/modules/impactifyBidAdapter.js index 8809d853dd9..5b0b1dff048 100644 --- a/modules/impactifyBidAdapter.js +++ b/modules/impactifyBidAdapter.js @@ -2,6 +2,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import {ajax} from '../src/ajax.js'; +import { createEidsArray } from './userId/eids.js'; const BIDDER_CODE = 'impactify'; const BIDDER_ALIAS = ['imp']; @@ -32,7 +33,8 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => { id: bidderRequest.auctionId, validBidRequests, cur: [DEFAULT_CURRENCY], - imp: [] + imp: [], + source: {tid: bidderRequest.auctionId} }; // Force impactify debugging parameter @@ -40,6 +42,17 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => { request.test = Number(window.localStorage.getItem('_im_db_bidder')); } + // Set Schain in request + let schain = utils.deepAccess(validBidRequests, '0.schain'); + if (schain) request.source.ext = { schain: schain }; + + // Set eids + let bidUserId = utils.deepAccess(validBidRequests, '0.userId'); + let eids = createEidsArray(bidUserId); + if (eids.length) { + utils.deepSetValue(request, 'user.ext.eids', eids); + } + // Set device/user/site if (!request.device) request.device = {}; if (!request.site) request.site = {}; @@ -106,7 +119,7 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => { export const spec = { code: BIDDER_CODE, gvlid: GVLID, - supportedMediaTypes: ['video'], + supportedMediaTypes: ['video', 'banner'], aliases: BIDDER_ALIAS, /** diff --git a/test/spec/modules/impactifyBidAdapter_spec.js b/test/spec/modules/impactifyBidAdapter_spec.js index 8bc02d9afce..8bb2d089ad8 100644 --- a/test/spec/modules/impactifyBidAdapter_spec.js +++ b/test/spec/modules/impactifyBidAdapter_spec.js @@ -135,7 +135,21 @@ describe('ImpactifyAdapter', function () { bidId: '123456789', bidderRequestId: '987654321', auctionId: '19ab94a9-b0d7-4ed7-9f80-ad0c033cf1b1', - transactionId: 'f7b2c372-7a7b-11eb-9439-0242ac130002' + transactionId: 'f7b2c372-7a7b-11eb-9439-0242ac130002', + userId: { + pubcid: '87a0327b-851c-4bb3-a925-0c7be94548f5' + }, + userIdAsEids: [ + { + source: 'pubcid.org', + uids: [ + { + id: '87a0327b-851c-4bb3-a925-0c7be94548f5', + atype: 1 + } + ] + } + ] } ]; let videoBidderRequest = { From 9945c02fa5063864e57ab8d702e13863889ce372 Mon Sep 17 00:00:00 2001 From: Michael Kuryshev Date: Fri, 3 Sep 2021 22:08:31 +0200 Subject: [PATCH 018/250] VIS.X Bid Adapter: migrate from GET to POSTs & send additional userIDs as an EIDS object (#7328) * VIS.X: migrate from GET to POSTs & send additional userIDs * VIS.X: fix tests --- modules/visxBidAdapter.js | 344 +++++++++---------- test/spec/modules/visxBidAdapter_spec.js | 405 +++++++++++++++-------- 2 files changed, 414 insertions(+), 335 deletions(-) diff --git a/modules/visxBidAdapter.js b/modules/visxBidAdapter.js index 535beb8af3c..2677b970dfd 100644 --- a/modules/visxBidAdapter.js +++ b/modules/visxBidAdapter.js @@ -3,19 +3,21 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { INSTREAM as VIDEO_INSTREAM } from '../src/video.js'; -const { parseSizesInput, getKeys, logError, deepAccess } = utils; +const { parseSizesInput, logError, deepAccess } = utils; const BIDDER_CODE = 'visx'; const GVLID = 154; const BASE_URL = 'https://t.visx.net'; -const ENDPOINT_URL = BASE_URL + '/hb'; +const DEBUG_URL = 'https://t-stage.visx.net'; +const ENDPOINT_PATH = '/hb_post'; const TIME_TO_LIVE = 360; const DEFAULT_CUR = 'EUR'; -const ADAPTER_SYNC_URL = BASE_URL + '/push_sync'; -const TRACK_TIMEOUT_URL = BASE_URL + '/track/bid_timeout'; +const ADAPTER_SYNC_PATH = '/push_sync'; +const TRACK_TIMEOUT_PATH = '/track/bid_timeout'; const LOG_ERROR_MESS = { noAuid: 'Bid from response has no auid parameter - ', noAdm: 'Bid from response has no adm parameter - ', noBid: 'Array of bid objects is empty', + noImpId: 'Bid from response has no impid parameter - ', noPlacementCode: 'Can\'t find in requested bids the bid with auid - ', emptyUids: 'Uids should not be empty', emptySeatbid: 'Seatbid array from response has an empty item', @@ -28,7 +30,6 @@ const LOG_ERROR_MESS = { videoMissing: 'Bid request videoType property is missing - ' }; const currencyWhiteList = ['EUR', 'USD', 'GBP', 'PLN']; -const RE_EMPTY_OR_ONLY_COMMAS = /^,*$/; export const spec = { code: BIDDER_CODE, gvlid: GVLID, @@ -47,89 +48,53 @@ export const spec = { buildRequests: function(validBidRequests, bidderRequest) { const auids = []; const bidsMap = {}; - const slotsMapByUid = {}; - const sizeMap = {}; const bids = validBidRequests || []; const currency = config.getConfig(`currency.bidderCurrencyDefault.${BIDDER_CODE}`) || config.getConfig('currency.adServerCurrency') || DEFAULT_CUR; + let reqId; let payloadSchain; let payloadUserId; - const videoTypes = _initVideoTypes(bids); + let payloadUserEids; + let timeout; if (currencyWhiteList.indexOf(currency) === -1) { logError(LOG_ERROR_MESS.notAllowedCurrency + currency); return; } + const imp = []; + bids.forEach(bid => { reqId = bid.bidderRequestId; - const {params: {uid}, adUnitCode, schain, userId} = bid; - auids.push(uid); + + const impObj = buildImpObject(bid); + if (impObj) { + imp.push(impObj); + bidsMap[bid.bidId] = bid; + } + + const { params: { uid }, schain, userId, userIdAsEids } = bid; + if (!payloadSchain && schain) { payloadSchain = schain; } - if (!payloadUserId && userId) { - payloadUserId = userId; + if (!payloadUserEids && userIdAsEids) { + payloadUserEids = userIdAsEids; } - const sizesId = parseSizesInput(bid.sizes); - if (!slotsMapByUid[uid]) { - slotsMapByUid[uid] = {}; - } - const slotsMap = slotsMapByUid[uid]; - if (!slotsMap[adUnitCode]) { - slotsMap[adUnitCode] = {adUnitCode, bids: [bid], parents: []}; - } else { - slotsMap[adUnitCode].bids.push(bid); + if (!payloadUserId && userId) { + payloadUserId = userId; } - const slot = slotsMap[adUnitCode]; - - sizesId.forEach((sizeId) => { - sizeMap[sizeId] = true; - if (!bidsMap[uid]) { - bidsMap[uid] = {}; - } - - if (!bidsMap[uid][sizeId]) { - bidsMap[uid][sizeId] = [slot]; - } else { - bidsMap[uid][sizeId].push(slot); - } - slot.parents.push({parent: bidsMap[uid], key: sizeId, uid}); - }); + auids.push(uid); }); - const payload = { - pt: 'net', - auids: auids.join(','), - sizes: getKeys(sizeMap).join(','), - r: reqId, - cur: currency, - wrapperType: 'Prebid_js', - wrapperVersion: '$prebid.version$', - ...videoTypes - }; - - if (payloadSchain) { - payload.schain = JSON.stringify(payloadSchain); - } - - if (payloadUserId) { - if (payloadUserId.tdid) { - payload.tdid = payloadUserId.tdid; - } - if (payloadUserId.id5id && payloadUserId.id5id.uid) { - payload.id5 = payloadUserId.id5id.uid; - } - if (payloadUserId.digitrustid && payloadUserId.digitrustid.data && payloadUserId.digitrustid.data.id) { - payload.dtid = payloadUserId.digitrustid.data.id; - } - } + const payload = {}; if (bidderRequest) { + timeout = bidderRequest.timeout; if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) { payload.u = bidderRequest.refererInfo.referer; } @@ -143,19 +108,50 @@ export const spec = { } } + const bidderTimeout = Number(config.getConfig('bidderTimeout')) || timeout; + const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout; + const source = { + ext: { + wrapperType: 'Prebid_js', + wrapperVersion: '$prebid.version$', + ...(payloadSchain && { schain: payloadSchain }) + } + }; + const user = { + ext: { + ...(payloadUserEids && { eids: payloadUserEids }), + ...(payload.gdpr_consent && { consent: payload.gdpr_consent }) + } + }; + const regs = ('gdpr_applies' in payload) && { + ext: { + gdpr: payload.gdpr_applies + } + }; + + const request = { + id: reqId, + imp, + tmax, + cur: [currency], + source, + site: { page: payload.u }, + ...(Object.keys(user.ext).length && { user }), + ...(regs && { regs }) + }; + return { - method: 'GET', - url: ENDPOINT_URL, - data: payload, - bidsMap: bidsMap, + method: 'POST', + url: buildUrl(ENDPOINT_PATH) + '?auids=' + encodeURIComponent(auids.join(',')), + data: request, + bidsMap }; }, interpretResponse: function(serverResponse, bidRequest) { serverResponse = serverResponse && serverResponse.body; const bidResponses = []; - const bidsWithoutSizeMatching = []; const bidsMap = bidRequest.bidsMap; - const currency = bidRequest.data.cur; + const currency = bidRequest.data.cur[0]; let errorMessage; @@ -166,10 +162,7 @@ export const spec = { if (!errorMessage && serverResponse.seatbid) { serverResponse.seatbid.forEach(respItem => { - _addBidResponse(_getBidFromResponse(respItem), bidsMap, currency, bidResponses, bidsWithoutSizeMatching); - }); - bidsWithoutSizeMatching.forEach(serverBid => { - _addBidResponse(serverBid, bidsMap, currency, bidResponses); + _addBidResponse(_getBidFromResponse(respItem), bidsMap, currency, bidResponses); }); } if (errorMessage) logError(errorMessage); @@ -188,7 +181,7 @@ export const spec = { } return [{ type: 'image', - url: ADAPTER_SYNC_URL + (query.length ? '?' + query.join('&') : '') + url: buildUrl(ADAPTER_SYNC_PATH) + (query.length ? '?' + query.join('&') : '') }]; } }, @@ -206,10 +199,61 @@ export const spec = { }, onTimeout: function(timeoutData) { // Call '/track/bid_timeout' with timeout data - utils.triggerPixel(TRACK_TIMEOUT_URL + '?data=' + JSON.stringify(timeoutData)); + utils.triggerPixel(buildUrl(TRACK_TIMEOUT_PATH) + '?data=' + JSON.stringify(timeoutData)); } }; +function buildUrl(path) { + return (config.getConfig('devMode') ? DEBUG_URL : BASE_URL) + path; +} + +function makeBanner(bannerParams) { + const bannerSizes = bannerParams && bannerParams.sizes; + if (bannerSizes) { + const sizes = utils.parseSizesInput(bannerSizes); + if (sizes.length) { + const format = sizes.map(size => { + const [ width, height ] = size.split('x'); + const w = parseInt(width, 10); + const h = parseInt(height, 10); + return { w, h }; + }); + + return { format }; + } + } +} + +function makeVideo(videoParams = {}) { + const video = Object.keys(videoParams).filter((param) => param !== 'context' && param !== 'playerSize') + .reduce((result, param) => { + result[param] = videoParams[param]; + return result; + }, { w: utils.deepAccess(videoParams, 'playerSize.0.0'), h: utils.deepAccess(videoParams, 'playerSize.0.1') }); + + if (video.w && video.h && video.mimes) { + return video; + } +} + +function buildImpObject(bid) { + const { params: { uid }, bidId, mediaTypes, sizes } = bid; + const video = mediaTypes && _isVideoBid(bid) && _isValidVideoBid(bid) && makeVideo(mediaTypes.video); + const banner = makeBanner((mediaTypes && mediaTypes.banner) || (!video && { sizes })); + const impObject = { + id: bidId, + ...(banner && { banner }), + ...(video && { video }), + ext: { + bidder: { uid: Number(uid) }, + } + }; + + if (impObject.ext.bidder.uid && (impObject.banner || impObject.video)) { + return impObject; + } +} + function _getBidFromResponse(respItem) { if (!respItem) { logError(LOG_ERROR_MESS.emptySeatbid); @@ -221,69 +265,47 @@ function _getBidFromResponse(respItem) { return respItem && respItem.bid && respItem.bid[0]; } -function _addBidResponse(serverBid, bidsMap, currency, bidResponses, bidsWithoutSizeMatching) { +function _addBidResponse(serverBid, bidsMap, currency, bidResponses) { if (!serverBid) return; let errorMessage; if (!serverBid.auid) errorMessage = LOG_ERROR_MESS.noAuid + JSON.stringify(serverBid); + if (!serverBid.impid) errorMessage = LOG_ERROR_MESS.noImpId + JSON.stringify(serverBid); if (!serverBid.adm) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid); else { const reqCurrency = currency || DEFAULT_CUR; - const awaitingBids = bidsMap[serverBid.auid]; - if (awaitingBids) { + const bid = bidsMap[serverBid.impid]; + if (bid) { if (serverBid.cur && serverBid.cur !== reqCurrency) { errorMessage = LOG_ERROR_MESS.currencyMismatch + reqCurrency + ' - ' + serverBid.cur; } else { - const sizeId = bidsWithoutSizeMatching ? `${serverBid.w}x${serverBid.h}` : Object.keys(awaitingBids)[0]; - if (awaitingBids[sizeId]) { - const slot = awaitingBids[sizeId][0]; - - const bid = slot.bids.shift(); - const bidResponse = { - requestId: bid.bidId, - cpm: serverBid.price, - width: serverBid.w, - height: serverBid.h, - creativeId: serverBid.auid, - currency: reqCurrency, - netRevenue: true, - ttl: TIME_TO_LIVE, - dealId: serverBid.dealid, - meta: { - advertiserDomains: serverBid.advertiserDomains ? serverBid.advertiserDomains : [], - mediaType: serverBid.mediaType - }, - }; - - if (serverBid.ext && serverBid.ext.prebid) { - bidResponse.ext = serverBid.ext.prebid; - } - - if (!_isVideoInstreamBid(bid)) { - bidResponse.ad = serverBid.adm; - } else { - bidResponse.vastXml = serverBid.adm; - bidResponse.mediaType = 'video'; - } - - bidResponses.push(bidResponse); - - if (!slot.bids.length) { - slot.parents.forEach(({parent, key, uid}) => { - const index = parent[key].indexOf(slot); - if (index > -1) { - parent[key].splice(index, 1); - } - if (!parent[key].length) { - delete parent[key]; - if (!getKeys(parent).length) { - delete bidsMap[uid]; - } - } - }); - } + const bidResponse = { + requestId: bid.bidId, + cpm: serverBid.price, + width: serverBid.w, + height: serverBid.h, + creativeId: serverBid.auid, + currency: reqCurrency, + netRevenue: true, + ttl: TIME_TO_LIVE, + dealId: serverBid.dealid, + meta: { + advertiserDomains: serverBid.advertiserDomains ? serverBid.advertiserDomains : [], + mediaType: serverBid.mediaType + }, + }; + + if (serverBid.ext && serverBid.ext.prebid) { + bidResponse.ext = serverBid.ext.prebid; + } + + if (!_isVideoInstreamBid(bid)) { + bidResponse.ad = serverBid.adm; } else { - bidsWithoutSizeMatching && bidsWithoutSizeMatching.push(serverBid); + bidResponse.vastXml = serverBid.adm; + bidResponse.mediaType = 'video'; } + + bidResponses.push(bidResponse); } } else { errorMessage = LOG_ERROR_MESS.noPlacementCode + serverBid.auid; @@ -336,74 +358,4 @@ function _isValidVideoBid(bid, logErrors = false) { return result; } -function _initVideoTypes(bids) { - const result = {}; - let _playerSize = []; - let _protocols = []; - let _api = []; - let _mimes = []; - let _minduration = []; - let _maxduration = []; - let _skip = []; - if (bids && bids.length) { - bids.forEach(function (bid) { - const mediaTypes = deepAccess(bid, 'mediaTypes.video', {}); - let bidPlayerSize = ''; - let bidProtocols = ''; - let bidApi = ''; - let bidMimes = ''; - let bidMinduration = null; - let bidMaxduration = null; - let bidSkip = null; - if (_isVideoBid(bid) && _isValidVideoBid(bid)) { - bidPlayerSize = parseSizesInput(deepAccess(mediaTypes, 'playerSize', [])).join('|'); - bidProtocols = deepAccess(mediaTypes, 'protocols', []).join('|'); - bidApi = deepAccess(mediaTypes, 'api', []).join('|'); - bidMimes = deepAccess(mediaTypes, 'mimes', []).join('|'); - bidMinduration = deepAccess(mediaTypes, 'minduration', null); - bidMaxduration = deepAccess(mediaTypes, 'maxduration', null); - bidSkip = deepAccess(mediaTypes, 'skip', null); - } - _playerSize.push(bidPlayerSize); - _protocols.push(bidProtocols); - _api.push(bidApi); - _mimes.push(bidMimes); - _minduration.push(bidMinduration); - _maxduration.push(bidMaxduration); - _skip.push(bidSkip); - }); - } - _playerSize = _playerSize.join(','); - _protocols = _protocols.join(','); - _api = _api.join(','); - _mimes = _mimes.join(','); - _minduration = _minduration.join(','); - _maxduration = _maxduration.join(','); - _skip = _skip.join(','); - - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_playerSize)) { - result.playerSize = _playerSize; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_protocols)) { - result.protocols = _protocols; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_api)) { - result.api = _api; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_mimes)) { - result.mimes = _mimes; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_minduration)) { - result.minduration = _minduration; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_maxduration)) { - result.maxduration = _maxduration; - } - if (!RE_EMPTY_OR_ONLY_COMMAS.test(_skip)) { - result.skip = _skip; - } - - return result; -} - registerBidder(spec); diff --git a/test/spec/modules/visxBidAdapter_spec.js b/test/spec/modules/visxBidAdapter_spec.js index 4a8207768ab..74ab959b5f2 100755 --- a/test/spec/modules/visxBidAdapter_spec.js +++ b/test/spec/modules/visxBidAdapter_spec.js @@ -44,7 +44,7 @@ describe('VisxAdapter', function () { videoBid.mediaTypes = { video: { context: 'instream', - playerSize: [400, 300] + playerSize: [[400, 300]] } }; expect(spec.isBidRequestValid(videoBid)).to.equal(false); @@ -55,7 +55,7 @@ describe('VisxAdapter', function () { videoBid.mediaTypes = { video: { context: 'instream', - playerSize: [400, 300], + playerSize: [[400, 300]], mimes: ['video/mp4'], protocols: [3, 6] } @@ -65,7 +65,16 @@ describe('VisxAdapter', function () { }); describe('buildRequests', function () { + function parseRequest(url) { + const res = {}; + (url.split('?')[1] || '').split('&').forEach((it) => { + const couple = it.split('='); + res[couple[0]] = decodeURIComponent(couple[1]); + }); + return res; + } const bidderRequest = { + timeout: 3000, refererInfo: { referer: 'https://example.com' } @@ -78,12 +87,11 @@ describe('VisxAdapter', function () { {asi: 'exchange1.com', sid: '1234!abcd', hp: 1, name: 'publisher, Inc.', domain: 'publisher.com'} ] }; - const schainString = JSON.stringify(schainObject); let bidRequests = [ { 'bidder': 'visx', 'params': { - 'uid': '903535' + 'uid': 903535 }, 'adUnitCode': 'adunit-code-1', 'sizes': [[300, 250], [300, 600]], @@ -94,7 +102,7 @@ describe('VisxAdapter', function () { { 'bidder': 'visx', 'params': { - 'uid': '903535' + 'uid': 903535 }, 'adUnitCode': 'adunit-code-2', 'sizes': [[728, 90], [300, 250]], @@ -105,7 +113,7 @@ describe('VisxAdapter', function () { { 'bidder': 'visx', 'params': { - 'uid': '903536' + 'uid': 903536 }, 'adUnitCode': 'adunit-code-1', 'sizes': [[300, 250], [300, 600]], @@ -116,13 +124,13 @@ describe('VisxAdapter', function () { { 'bidder': 'visx', 'params': { - 'uid': '903537' + 'uid': 903537 }, 'adUnitCode': 'adunit-code-video-3', 'mediaTypes': { 'video': { 'context': 'instream', - 'playerSize': [400, 300], + 'playerSize': [[400, 300]], 'mimes': ['video/mp4', 'video/mpeg'], 'protocols': [3, 6], 'minduration': 5, @@ -135,83 +143,91 @@ describe('VisxAdapter', function () { } ]; + const expectedFullImps = [{ + 'id': '30b31c1838de1e', + 'banner': {'format': [{'w': 300, 'h': 250}, {'w': 300, 'h': 600}]}, + 'ext': {'bidder': {'uid': 903535}} + }, + { + 'id': '3150ccb55da321', + 'banner': {'format': [{'w': 728, 'h': 90}, {'w': 300, 'h': 250}]}, + 'ext': {'bidder': {'uid': 903535}} + }, + { + 'id': '42dbe3a7168a6a', + 'banner': {'format': [{'w': 300, 'h': 250}, {'w': 300, 'h': 600}]}, + 'ext': {'bidder': {'uid': 903536}} + }, + { + 'id': '39a4e3a7168a6a', + 'video': { + 'w': 400, + 'h': 300, + 'mimes': ['video/mp4', 'video/mpeg'], + 'protocols': [3, 6], + 'minduration': 5, + 'maxduration': 30 + }, + 'ext': {'bidder': {'uid': 903537}} + }]; + it('should attach valid params to the tag', function () { - const request = spec.buildRequests([bidRequests[0]], bidderRequest); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); + const firstBid = bidRequests[0]; + const bids = [firstBid]; + const request = spec.buildRequests(bids, bidderRequest); + const payload = parseRequest(request.url); + expect(request.url).to.be.an('string'); expect(payload).to.have.property('auids', '903535'); - expect(payload).to.have.property('sizes', '300x250,300x600'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); - }); - it('sizes must not be duplicated', function () { - const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); - expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': [expectedFullImps[0]], + 'tmax': 3000, + 'cur': ['EUR'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer} + }); }); - it('pt parameter must be "net" if params.priceType === "gross"', function () { - bidRequests[1].params.priceType = 'gross'; + it('should attach valid params to the tag with multiformat request', function () { const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; + const payload = parseRequest(request.url); expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); - delete bidRequests[1].params.priceType; - }); - it('pt parameter must be "net" if params.priceType === "net"', function () { - bidRequests[1].params.priceType = 'net'; - const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); - expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); - delete bidRequests[1].params.priceType; - }); - it('pt parameter must be "net" if params.priceType === "undefined"', function () { - bidRequests[1].params.priceType = 'undefined'; - const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); - expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); - delete bidRequests[1].params.priceType; + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['EUR'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer} + }); }); it('should add currency from currency.bidderCurrencyDefault', function () { const getConfigStub = sinon.stub(config, 'getConfig').callsFake( arg => arg === 'currency.bidderCurrencyDefault.visx' ? 'GBP' : 'USD'); const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; + const payload = parseRequest(request.url); expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'GBP'); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['GBP'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer} + }); + getConfigStub.restore(); }); @@ -219,39 +235,73 @@ describe('VisxAdapter', function () { const getConfigStub = sinon.stub(config, 'getConfig').callsFake( arg => arg === 'currency.bidderCurrencyDefault.visx' ? '' : 'USD'); const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; + const payload = parseRequest(request.url); expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); expect(payload).to.have.property('auids', '903535,903535,903536,903537'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'USD'); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['USD'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer} + }); + getConfigStub.restore(); }); it('if gdprConsent is present payload must have gdpr params', function () { - const request = spec.buildRequests(bidRequests, {gdprConsent: {consentString: 'AAA', gdprApplies: true}}); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', 1); + const request = spec.buildRequests(bidRequests, Object.assign({gdprConsent: {consentString: 'AAA', gdprApplies: true}}, bidderRequest)); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['EUR'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer}, + 'user': {'ext': {'consent': 'AAA'}}, + 'regs': {'ext': {'gdpr': 1}} + }); }); it('if gdprApplies is false gdpr_applies must be 0', function () { - const request = spec.buildRequests(bidRequests, {gdprConsent: {consentString: 'AAA', gdprApplies: false}}); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', 0); + const request = spec.buildRequests(bidRequests, Object.assign({gdprConsent: {consentString: 'AAA', gdprApplies: false}}, bidderRequest)); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['EUR'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer}, + 'user': {'ext': {'consent': 'AAA'}}, + 'regs': {'ext': {'gdpr': 0}} + }); }); it('if gdprApplies is undefined gdpr_applies must be 1', function () { - const request = spec.buildRequests(bidRequests, {gdprConsent: {consentString: 'AAA'}}); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', 1); + const request = spec.buildRequests(bidRequests, Object.assign({gdprConsent: {consentString: 'AAA'}}, bidderRequest)); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['EUR'], + 'source': {'ext': {'wrapperType': 'Prebid_js', 'wrapperVersion': '$prebid.version$'}}, + 'site': {'page': referrer}, + 'user': {'ext': {'consent': 'AAA'}}, + 'regs': {'ext': {'gdpr': 1}} + }); }); it('if schain is present payload must have schain param', function () { @@ -261,49 +311,110 @@ describe('VisxAdapter', function () { bidRequests[2] ]; const request = spec.buildRequests(schainBidRequests, bidderRequest); - const payload = request.data; + const payload = parseRequest(request.url); expect(payload).to.be.an('object'); - expect(payload).to.have.property('schain', schainString); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); expect(payload).to.have.property('auids', '903535,903535,903536'); - expect(payload).to.have.property('sizes', '300x250,300x600,728x90'); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('cur', 'EUR'); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps.slice(0, -1), + 'tmax': 3000, + 'cur': ['EUR'], + 'source': { + 'ext': { + 'wrapperType': 'Prebid_js', + 'wrapperVersion': '$prebid.version$', + 'schain': schainObject + } + }, + 'site': {'page': referrer}, + }); }); it('if userId is available payload must have appropriate params', function () { - const schainBidRequests = [ + const eids = [ + { + source: 'pubcid.org', + uids: [{ + id: 'some-random-id-value', + atype: 1 + }] + }, + { + source: 'adserver.org', + uids: [{ + id: 'some-random-id-value', + atype: 1, + ext: { + rtiPartner: 'TDID' + } + }] + } + ]; + const userIdBidRequests = [ Object.assign({userId: { tdid: '111', id5id: { uid: '222' }, digitrustid: {data: {id: 'DTID', keyv: 4, privacy: {optout: false}, producer: 'ABC', version: 2}} - }}, bidRequests[0]), + }, + userIdAsEids: eids}, bidRequests[0]), bidRequests[1], bidRequests[2] ]; - const request = spec.buildRequests(schainBidRequests, bidderRequest); - const payload = request.data; - expect(payload).to.be.an('object'); - expect(payload).to.have.property('tdid', '111'); - expect(payload).to.have.property('id5', '222'); - expect(payload).to.have.property('dtid', 'DTID'); + const request = spec.buildRequests(userIdBidRequests, bidderRequest); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps.slice(0, -1), + 'tmax': 3000, + 'cur': ['EUR'], + 'source': { + 'ext': { + 'wrapperType': 'Prebid_js', + 'wrapperVersion': '$prebid.version$' + } + }, + 'site': {'page': referrer}, + 'user': {'ext': {'eids': eids}} + }); }); it('should pass grouped video bid\'s params in payload', function () { const request = spec.buildRequests(bidRequests, bidderRequest); - const payload = request.data; - expect(payload).to.have.property('protocols', ',,,3|6'); - expect(payload).to.have.property('mimes', ',,,video/mp4|video/mpeg'); - expect(payload).to.have.property('playerSize', ',,,400x300'); - expect(payload).to.have.property('minduration', ',,,5'); - expect(payload).to.have.property('maxduration', ',,,30'); - expect(payload).to.not.have.property('skip'); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': expectedFullImps, + 'tmax': 3000, + 'cur': ['EUR'], + 'source': { + 'ext': { + 'wrapperType': 'Prebid_js', + 'wrapperVersion': '$prebid.version$' + } + }, + 'site': {'page': referrer} + }); }); }); describe('buildRequests (multiple media types w/ unsupported video+outstream)', function () { + function parseRequest(url) { + const res = {}; + (url.split('?')[1] || '').split('&').forEach((it) => { + const couple = it.split('='); + res[couple[0]] = decodeURIComponent(couple[1]); + }); + return res; + } const bidderRequest = { + timeout: 3000, refererInfo: { referer: 'https://example.com' } @@ -320,33 +431,49 @@ describe('VisxAdapter', function () { 'mediaTypes': { 'video': { 'context': 'outstream', - 'playerSize': [400, 300] + 'playerSize': [[400, 300]] } }, 'bidId': '39aff3a7169a6a', - 'bidderRequestId': '22edffe2733bf6', + 'bidderRequestId': '22edbae2733bf6', 'auctionId': '1d1a030790a476', } ]; it('should send requst for banner bid', function () { const request = spec.buildRequests([bidRequests[0]], bidderRequest); - const payload = request.data; + const payload = parseRequest(request.url); expect(payload).to.be.an('object'); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('pt', 'net'); expect(payload).to.have.property('auids', '903538'); - expect(payload).to.have.property('sizes', '300x250,300x600'); - expect(payload).to.not.have.property('playerSize'); + + const postData = request.data; + expect(postData).to.be.an('object'); + expect(postData).to.deep.equal({ + 'id': '22edbae2733bf6', + 'imp': [{ + 'id': '39aff3a7169a6a', + 'banner': {'format': [{'w': 300, 'h': 250}, {'w': 300, 'h': 600}]}, + 'ext': {'bidder': {'uid': 903538}} + }], + 'tmax': 3000, + 'cur': ['EUR'], + 'source': { + 'ext': { + 'wrapperType': 'Prebid_js', + 'wrapperVersion': '$prebid.version$' + } + }, + 'site': {'page': referrer} + }); }); }); describe('interpretResponse', function () { const responses = [ - {'bid': [{'price': 1.15, 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner', 'advertiserDomains': ['some_domain.com']}], 'seat': '1'}, - {'bid': [{'price': 0.5, 'adm': '
test content 2
', 'auid': 903536, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0.15, 'adm': '
test content 3
', 'auid': 903535, 'h': 90, 'w': 728, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0, 'auid': 903537, 'h': 250, 'w': 300, 'cur': 'EUR'}], 'seat': '1'}, + {'bid': [{'price': 1.15, 'impid': '300bfeb0d71a5b', 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner', 'advertiserDomains': ['some_domain.com']}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '4dff80cc4ee346', 'adm': '
test content 2
', 'auid': 903536, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0.15, 'impid': '5703af74d0472a', 'adm': '
test content 3
', 'auid': 903535, 'h': 90, 'w': 728, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0, 'impid': '300bfeb0d7190gf', 'auid': 903537, 'h': 250, 'w': 300, 'cur': 'EUR'}], 'seat': '1'}, {'bid': [{'price': 0, 'adm': '
test content 5
', 'h': 250, 'w': 300, 'cur': 'EUR'}], 'seat': '1'}, undefined, {'bid': [], 'seat': '1'}, @@ -362,7 +489,7 @@ describe('VisxAdapter', function () { }, 'adUnitCode': 'adunit-code-1', 'sizes': [[300, 250], [300, 600]], - 'bidId': '659423fff799cb', + 'bidId': '300bfeb0d71a5b', 'bidderRequestId': '5f2009617a7c0a', 'auctionId': '1cbd2feafe5e8b', } @@ -370,7 +497,7 @@ describe('VisxAdapter', function () { const request = spec.buildRequests(bidRequests); const expectedResponse = [ { - 'requestId': '659423fff799cb', + 'requestId': '300bfeb0d71a5b', 'cpm': 1.15, 'creativeId': 903535, 'dealId': undefined, @@ -492,7 +619,7 @@ describe('VisxAdapter', function () { }, 'adUnitCode': 'adunit-code-1', 'sizes': [[300, 250], [300, 600]], - 'bidId': '659423fff799cb', + 'bidId': '300bfeb0d71a5b', 'bidderRequestId': '5f2009617a7c0a', 'auctionId': '1cbd2feafe5e8b', } @@ -501,7 +628,7 @@ describe('VisxAdapter', function () { const request = spec.buildRequests(bidRequests); const expectedResponse = [ { - 'requestId': '659423fff799cb', + 'requestId': '300bfeb0d71a5b', 'cpm': 1.15, 'creativeId': 903535, 'dealId': undefined, @@ -568,11 +695,11 @@ describe('VisxAdapter', function () { it('complicated case', function () { const fullResponse = [ - {'bid': [{'price': 1.15, 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner', 'advertiserDomains': ['some_domain.com']}], 'seat': '1'}, - {'bid': [{'price': 0.5, 'adm': '
test content 2
', 'auid': 903536, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0.15, 'adm': '
test content 3
', 'auid': 903535, 'h': 90, 'w': 728, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0.15, 'adm': '
test content 4
', 'auid': 903535, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0.5, 'adm': '
test content 5
', 'auid': 903536, 'h': 600, 'w': 350, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 1.15, 'impid': '2164be6358b9', 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner', 'advertiserDomains': ['some_domain.com']}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '4e111f1b66e4', 'adm': '
test content 2
', 'auid': 903536, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0.15, 'impid': '26d6f897b516', 'adm': '
test content 3
', 'auid': 903535, 'h': 90, 'w': 728, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0.15, 'impid': '326bde7fbf69', 'adm': '
test content 4
', 'auid': 903535, 'h': 600, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '1751cd90161', 'adm': '
test content 5
', 'auid': 903536, 'h': 600, 'w': 350, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, ]; const bidRequests = [ { @@ -721,8 +848,8 @@ describe('VisxAdapter', function () { it('dublicate uids and sizes in one slot', function () { const fullResponse = [ - {'bid': [{'price': 1.15, 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, - {'bid': [{'price': 0.5, 'adm': '
test content 2
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 1.15, 'impid': '5126e301f4be', 'adm': '
test content 1
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '57b2ebe70e16', 'adm': '
test content 2
', 'auid': 903535, 'h': 250, 'w': 300, 'cur': 'EUR', 'mediaType': 'banner'}], 'seat': '1'}, ]; const bidRequests = [ { @@ -801,7 +928,7 @@ describe('VisxAdapter', function () { it('handles video bid', function () { const fullResponse = [ - {'bid': [{'price': 0.5, 'adm': '', 'auid': 903537, 'w': 400, 'h': 300, 'cur': 'EUR', 'mediaType': 'video'}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '2164be6358b9', 'adm': '', 'auid': 903537, 'w': 400, 'h': 300, 'cur': 'EUR', 'mediaType': 'video'}], 'seat': '1'}, ]; const bidRequests = [ { @@ -813,7 +940,7 @@ describe('VisxAdapter', function () { 'mediaTypes': { 'video': { 'context': 'instream', - 'playerSize': [400, 300], + 'playerSize': [[400, 300]], 'mimes': ['video/mp4'], 'protocols': [3, 6] } @@ -850,7 +977,7 @@ describe('VisxAdapter', function () { it('handles multiformat bid response with outstream+banner as banner', function () { const fullResponse = [ - {'bid': [{'price': 0.5, 'adm': '', 'auid': 903537, 'w': 400, 'h': 300, 'cur': 'EUR', 'mediaType': 'video'}], 'seat': '1'}, + {'bid': [{'price': 0.5, 'impid': '2164be6358b9', 'adm': '', 'auid': 903537, 'w': 400, 'h': 300, 'cur': 'EUR', 'mediaType': 'video'}], 'seat': '1'}, ]; const bidRequests = [ { @@ -862,7 +989,7 @@ describe('VisxAdapter', function () { 'mediaTypes': { 'video': { 'context': 'outstream', - 'playerSize': [400, 300], + 'playerSize': [[400, 300]], 'mimes': ['video/mp4'], 'protocols': [3, 6] } @@ -908,7 +1035,7 @@ describe('VisxAdapter', function () { }, 'adUnitCode': 'adunit-code-1', 'sizes': [[300, 250], [300, 600]], - 'bidId': '659423fff799cb', + 'bidId': '300bfeb0d71a5b', 'bidderRequestId': '5f2009617a7c0a', 'auctionId': '1cbd2feafe5e8b', } @@ -918,7 +1045,7 @@ describe('VisxAdapter', function () { const winUrl = 'https://t.visx.net/track/win/53245341'; const expectedResponse = [ { - 'requestId': '659423fff799cb', + 'requestId': '300bfeb0d71a5b', 'cpm': 1.15, 'creativeId': 903535, 'dealId': undefined, From b029e51b219f36ce444fe702abadab5fd6248f13 Mon Sep 17 00:00:00 2001 From: Noam Tzuberi Date: Mon, 6 Sep 2021 13:26:09 +0300 Subject: [PATCH 019/250] Rise Bid Adapter: improve isBidRequestValid and size detection along with other updates (#7362) * add Rise adapter * fixes * change param isOrg to org * Rise adapter * change email for rise * fix circle failed * bump * bump * bump * remove space * Upgrade Rise adapter to 5.0 * improvments * fixes & extra improcments * fix bug * revert packege-lock.json * rollback getsizes changes * fix * bump Co-authored-by: Noam Tzuberi Co-authored-by: Laslo Chechur --- modules/riseBidAdapter.js | 102 ++++++++++++++++++++++++++++++++++---- 1 file changed, 93 insertions(+), 9 deletions(-) diff --git a/modules/riseBidAdapter.js b/modules/riseBidAdapter.js index 6887805b854..492653afb95 100644 --- a/modules/riseBidAdapter.js +++ b/modules/riseBidAdapter.js @@ -5,7 +5,7 @@ import {config} from '../src/config.js'; const SUPPORTED_AD_TYPES = [VIDEO]; const BIDDER_CODE = 'rise'; -const BIDDER_VERSION = '4.0.1'; +const ADAPTER_VERSION = '5.0.0'; const TTL = 360; const CURRENCY = 'USD'; const SELLER_ENDPOINT = 'https://hb.yellowblue.io/'; @@ -20,10 +20,21 @@ const SUPPORTED_SYNC_METHODS = { export const spec = { code: BIDDER_CODE, - version: BIDDER_VERSION, + gvlid: 1043, + version: ADAPTER_VERSION, supportedMediaTypes: SUPPORTED_AD_TYPES, isBidRequestValid: function(bidRequest) { - return !!(bidRequest.params.org); + if (!bidRequest.params) { + utils.logWarn('no params have been set to Rise adapter'); + return false; + } + + if (!bidRequest.params.org) { + utils.logWarn('org is a mandatory param for Rise adapter'); + return false; + } + + return true; }, buildRequests: function (bidRequests, bidderRequest) { if (bidRequests.length === 0) { @@ -101,7 +112,7 @@ function getFloor(bid) { mediaType: VIDEO, size: '*' }); - return floorResult.currency === CURRENCY ? floorResult.floor : 0; + return floorResult.currency === CURRENCY && floorResult.floor ? floorResult.floor : 0; } /** @@ -207,6 +218,27 @@ function getEndpoint(testMode) { : SELLER_ENDPOINT + MODES.PRODUCTION; } +/** + * get device type + * @param uad {ua} + * @returns {string} + */ +function getDeviceType(ua) { + if (/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i + .test(ua.toLowerCase())) { + return '5'; + } + if (/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i + .test(ua.toLowerCase())) { + return '4'; + } + if (/smart[-_\s]?tv|hbbtv|appletv|googletv|hdmi|netcast|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b/i + .test(ua.toLowerCase())) { + return '3'; + } + return '1'; +} + /** * Generate query parameters for the request * @param bid {bid} @@ -214,14 +246,23 @@ function getEndpoint(testMode) { * @returns {Object} */ function generateParameters(bid, bidderRequest) { + const {params} = bid; const timeout = config.getConfig('bidderTimeout'); - const { syncEnabled, filterSettings } = config.getConfig('userSync') || {}; - const [ width, height ] = getSizes(bid); - const { params } = bid; - const { bidderCode } = bidderRequest; + const {syncEnabled, filterSettings} = config.getConfig('userSync') || {}; + const [width, height] = getSizes(bid); + const {bidderCode} = bidderRequest; const domain = window.location.hostname; + // fix floor price in case of NAN + if (isNaN(params.floorPrice)) { + params.floorPrice = 0; + } + const requestParams = { + wrapper_type: 'prebidjs', + wrapper_vendor: '$$PREBID_GLOBAL$$', + wrapper_version: '$prebid.version$', + adapter_version: ADAPTER_VERSION, auction_start: utils.timestamp(), ad_unit_code: utils.getBidIdParameter('adUnitCode', bid), tmax: timeout, @@ -236,9 +277,52 @@ function generateParameters(bid, bidderRequest) { session_id: utils.getBidIdParameter('auctionId', bid), publisher_name: domain, site_domain: domain, - bidder_version: BIDDER_VERSION + dnt: (navigator.doNotTrack == 'yes' || navigator.doNotTrack == '1' || navigator.msDoNotTrack == '1') ? 1 : 0, + device_type: getDeviceType(navigator.userAgent) }; + const userIdsParam = utils.getBidIdParameter('userId', bid); + if (userIdsParam) { + requestParams.userIds = JSON.stringify(userIdsParam); + } + + const ortb2Metadata = config.getConfig('ortb2') || {}; + if (ortb2Metadata.site) { + requestParams.site_metadata = JSON.stringify(ortb2Metadata.site); + } + if (ortb2Metadata.user) { + requestParams.user_metadata = JSON.stringify(ortb2Metadata.user); + } + + const playbackMethod = utils.deepAccess(bid, 'mediaTypes.video.playbackmethod'); + if (playbackMethod) { + requestParams.playback_method = playbackMethod; + } + const placement = utils.deepAccess(bid, 'mediaTypes.video.placement'); + if (placement) { + requestParams.placement = placement; + } + const pos = utils.deepAccess(bid, 'mediaTypes.video.pos'); + if (pos) { + requestParams.pos = pos; + } + const minduration = utils.deepAccess(bid, 'mediaTypes.video.minduration'); + if (minduration) { + requestParams.min_duration = minduration; + } + const maxduration = utils.deepAccess(bid, 'mediaTypes.video.maxduration'); + if (maxduration) { + requestParams.max_duration = maxduration; + } + const skip = utils.deepAccess(bid, 'mediaTypes.video.skip'); + if (skip) { + requestParams.skip = skip; + } + const linearity = utils.deepAccess(bid, 'mediaTypes.video.linearity'); + if (linearity) { + requestParams.linearity = linearity; + } + if (params.placementId) { requestParams.placement_id = params.placementId; } From 126e16529b4acb98b56a4d07984cfd7864fe36d3 Mon Sep 17 00:00:00 2001 From: Denis Logachov Date: Tue, 7 Sep 2021 15:04:17 +0300 Subject: [PATCH 020/250] Adkernel Bid Adapter: unibots alias (#7387) --- modules/adkernelBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index 5cfb44f7127..a6bf56f8cad 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -70,7 +70,8 @@ export const spec = { {code: 'converge', gvlid: 248}, {code: 'adomega'}, {code: 'denakop'}, - {code: 'rtbanalytica'} + {code: 'rtbanalytica'}, + {code: 'unibots'} ], supportedMediaTypes: [BANNER, VIDEO, NATIVE], From b4daf00252e7f08d0402334497bbe55a0d198d6d Mon Sep 17 00:00:00 2001 From: SmartyAdsSSP <41569976+SmartyAdsSSP@users.noreply.github.com> Date: Tue, 7 Sep 2021 17:28:04 +0300 Subject: [PATCH 021/250] change smartyads ad unit parameters (#7380) --- modules/smartyadsBidAdapter.js | 33 +++++++++++++------ modules/smartyadsBidAdapter.md | 12 +++++-- test/spec/modules/smartyadsBidAdapter_spec.js | 25 +++++++++----- 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/modules/smartyadsBidAdapter.js b/modules/smartyadsBidAdapter.js index 610617155ed..9c38cb89492 100644 --- a/modules/smartyadsBidAdapter.js +++ b/modules/smartyadsBidAdapter.js @@ -4,8 +4,8 @@ import { config } from '../src/config.js'; import * as utils from '../src/utils.js'; const BIDDER_CODE = 'smartyads'; -const AD_URL = 'https://ssp-nj.webtradehub.com/?c=o&m=multi'; -const URL_SYNC = 'https://ssp-nj.webtradehub.com/?c=o&m=cookie'; +const AD_URL = 'https://n1.smartyads.com/?c=o&m=prebid&secret_key=prebid_js'; +const URL_SYNC = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a'; function isBidResponseValid(bid) { if (!bid.requestId || !bid.cpm || !bid.creativeId || @@ -29,7 +29,7 @@ export const spec = { supportedMediaTypes: [BANNER, VIDEO, NATIVE], isBidRequestValid: (bid) => { - return Boolean(bid.bidId && bid.params && !isNaN(bid.params.placementId)); + return Boolean(bid.bidId && bid.params && !isNaN(bid.params.sourceid) && !isNaN(bid.params.accountid) && bid.params.host == 'prebid'); }, buildRequests: (validBidRequests = [], bidderRequest) => { @@ -68,10 +68,11 @@ export const spec = { let bid = validBidRequests[i]; let traff = bid.params.traffic || BANNER placements.push({ - placementId: bid.params.placementId, + placementId: bid.params.sourceid, bidId: bid.bidId, sizes: bid.mediaTypes && bid.mediaTypes[traff] && bid.mediaTypes[traff].sizes ? bid.mediaTypes[traff].sizes : [], - traffic: traff + traffic: traff, + publisherId: bid.params.accountid }); if (bid.schain) { placements.schain = bid.schain; @@ -96,11 +97,23 @@ export const spec = { return response; }, - getUserSyncs: (syncOptions, serverResponses) => { - return [{ - type: 'image', - url: URL_SYNC - }]; + getUserSyncs: (syncOptions, serverResponses = [], gdprConsent = {}, uspConsent = '') => { + let syncs = []; + let { gdprApplies, consentString = '' } = gdprConsent; + + if (syncOptions.iframeEnabled) { + syncs.push({ + type: 'iframe', + url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=iframe&us_privacy=${uspConsent}` + }); + } else { + syncs.push({ + type: 'image', + url: `${URL_SYNC}&gdpr=${gdprApplies ? 1 : 0}&gdpr_consent=${consentString}&type=image&us_privacy=${uspConsent}` + }); + } + + return syncs } }; diff --git a/modules/smartyadsBidAdapter.md b/modules/smartyadsBidAdapter.md index 4fe4d51a2e6..f078d905e62 100644 --- a/modules/smartyadsBidAdapter.md +++ b/modules/smartyadsBidAdapter.md @@ -23,7 +23,9 @@ Module that connects to SmartyAds' demand sources { bidder: 'smartyads', params: { - placementId: 0, + host: 'prebid', + sourceid: '0', + accountid: '0', traffic: 'native' } } @@ -41,7 +43,9 @@ Module that connects to SmartyAds' demand sources { bidder: 'smartyads', params: { - placementId: 0, + host: 'prebid', + sourceid: '0', + accountid: '0', traffic: 'banner' } } @@ -60,7 +64,9 @@ Module that connects to SmartyAds' demand sources { bidder: 'smartyads', params: { - placementId: 0, + host: 'prebid', + sourceid: '0', + accountid: '0', traffic: 'video' } } diff --git a/test/spec/modules/smartyadsBidAdapter_spec.js b/test/spec/modules/smartyadsBidAdapter_spec.js index 14363329a9e..3474753c838 100644 --- a/test/spec/modules/smartyadsBidAdapter_spec.js +++ b/test/spec/modules/smartyadsBidAdapter_spec.js @@ -7,17 +7,19 @@ describe('SmartyadsAdapter', function () { bidId: '23fhj33i987f', bidder: 'smartyads', params: { - placementId: 0, + host: 'prebid', + sourceid: '0', + accountid: '0', traffic: 'banner' } }; describe('isBidRequestValid', function () { - it('Should return true if there are bidId, params and placementId parameters present', function () { + it('Should return true if there are bidId, params and sourceid parameters present', function () { expect(spec.isBidRequestValid(bid)).to.be.true; }); it('Should return false if at least one of parameters is not present', function () { - delete bid.params.placementId; + delete bid.params.sourceid; expect(spec.isBidRequestValid(bid)).to.be.false; }); }); @@ -34,7 +36,7 @@ describe('SmartyadsAdapter', function () { expect(serverRequest.method).to.equal('POST'); }); it('Returns valid URL', function () { - expect(serverRequest.url).to.equal('https://ssp-nj.webtradehub.com/?c=o&m=multi'); + expect(serverRequest.url).to.equal('https://n1.smartyads.com/?c=o&m=prebid&secret_key=prebid_js'); }); it('Returns valid data if array of bids is valid', function () { let data = serverRequest.data; @@ -48,8 +50,8 @@ describe('SmartyadsAdapter', function () { expect(data.host).to.be.a('string'); expect(data.page).to.be.a('string'); let placement = data['placements'][0]; - expect(placement).to.have.keys('placementId', 'bidId', 'traffic', 'sizes'); - expect(placement.placementId).to.equal(0); + expect(placement).to.have.keys('placementId', 'bidId', 'traffic', 'sizes', 'publisherId'); + expect(placement.placementId).to.equal('0'); expect(placement.bidId).to.equal('23fhj33i987f'); expect(placement.traffic).to.equal('banner'); }); @@ -241,13 +243,18 @@ describe('SmartyadsAdapter', function () { }); }); describe('getUserSyncs', function () { - let userSync = spec.getUserSyncs(); + const syncUrl = 'https://as.ck-ie.com/prebidjs?p=7c47322e527cf8bdeb7facc1bb03387a&gdpr=0&gdpr_consent=&type=iframe&us_privacy='; + const syncOptions = { + iframeEnabled: true + }; + let userSync = spec.getUserSyncs(syncOptions); it('Returns valid URL and type', function () { expect(userSync).to.be.an('array').with.lengthOf(1); expect(userSync[0].type).to.exist; expect(userSync[0].url).to.exist; - expect(userSync[0].type).to.be.equal('image'); - expect(userSync[0].url).to.be.equal('https://ssp-nj.webtradehub.com/?c=o&m=cookie'); + expect(userSync).to.deep.equal([ + { type: 'iframe', url: syncUrl } + ]); }); }); }); From 5b87fdcbb094e30fdc7a4e8a777674e530753127 Mon Sep 17 00:00:00 2001 From: PWyrembak Date: Tue, 7 Sep 2021 18:34:03 +0300 Subject: [PATCH 022/250] TrustX Bid Adapter: convert all id-like request fields to a string (#7386) --- modules/trustxBidAdapter.js | 8 ++-- test/spec/modules/trustxBidAdapter_spec.js | 45 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/modules/trustxBidAdapter.js b/modules/trustxBidAdapter.js index 141ed79cfca..d99dbf0cd87 100644 --- a/modules/trustxBidAdapter.js +++ b/modules/trustxBidAdapter.js @@ -95,10 +95,10 @@ export const spec = { } } let impObj = { - id: bidId, + id: bidId && bidId.toString(), tagid: uid.toString(), ext: { - divid: adUnitCode + divid: adUnitCode && adUnitCode.toString() } }; @@ -132,7 +132,7 @@ export const spec = { }); const source = { - tid: auctionId, + tid: auctionId && auctionId.toString(), ext: { wrapper: 'Prebid_js', wrapper_version: '$prebid.version$' @@ -147,7 +147,7 @@ export const spec = { const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout; let request = { - id: bidderRequestId, + id: bidderRequestId && bidderRequestId.toString(), site: { page: referer }, diff --git a/test/spec/modules/trustxBidAdapter_spec.js b/test/spec/modules/trustxBidAdapter_spec.js index a32943eef80..faaae620ad2 100644 --- a/test/spec/modules/trustxBidAdapter_spec.js +++ b/test/spec/modules/trustxBidAdapter_spec.js @@ -519,6 +519,51 @@ describe('TrustXAdapter', function () { expect(payload.tmax).to.equal(3000); getConfigStub.restore(); }); + it('all id like request fields must be a string', function () { + const bidderRequestWithNumId = Object.assign({}, bidderRequest, { bidderRequestId: 123123, auctionId: 345345543 }); + + let bidRequestWithNumId = { + 'bidder': 'trustx', + 'params': { + 'uid': 43, + }, + 'adUnitCode': 111111, + 'sizes': [[300, 250], [300, 600]], + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 250], [300, 600]] + } + }, + 'bidId': 23423423, + 'bidderRequestId': 123123, + 'auctionId': 345345543, + }; + + const request = spec.buildRequests([bidRequestWithNumId], bidderRequestWithNumId); + expect(request.data).to.be.an('string'); + const payload = parseRequest(request.data); + expect(payload).to.deep.equal({ + 'id': '123123', + 'site': { + 'page': referrer + }, + 'tmax': bidderRequest.timeout, + 'source': { + 'tid': '345345543', + 'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'} + }, + 'imp': [{ + 'id': '23423423', + 'tagid': '43', + 'ext': {'divid': '111111'}, + 'banner': { + 'w': 300, + 'h': 250, + 'format': [{'w': 300, 'h': 250}, {'w': 300, 'h': 600}] + } + }] + }); + }); describe('floorModule', function () { const floorTestData = { From 1ba68883a4aa0b6cc6a59e75d1ba07027589e4a0 Mon Sep 17 00:00:00 2001 From: Eddy Pechuzal <46331062+epechuzal@users.noreply.github.com> Date: Tue, 7 Sep 2021 13:57:53 -0700 Subject: [PATCH 023/250] Sharethrough adapter: connect to OpenRTB endpoint (#7290) --- modules/sharethroughBidAdapter.js | 427 ++++---- modules/sharethroughBidAdapter.md | 68 +- .../modules/sharethroughBidAdapter_spec.js | 980 ++++++++---------- 3 files changed, 704 insertions(+), 771 deletions(-) diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 967d8194607..24ab2530014 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -1,123 +1,190 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; +import { BANNER, VIDEO } from '../src/mediaTypes.js'; +import { createEidsArray } from './userId/eids.js'; -const VERSION = '3.4.1'; +const VERSION = '4.0.0'; const BIDDER_CODE = 'sharethrough'; -const STR_ENDPOINT = 'https://btlr.sharethrough.com/WYu2BXv1/v1'; -const DEFAULT_SIZE = [1, 1]; +const SUPPLY_ID = 'WYu2BXv1'; + +const STR_ENDPOINT = `https://btlr.sharethrough.com/universal/v1?supply_id=${SUPPLY_ID}`; // this allows stubbing of utility function that is used internally by the sharethrough adapter export const sharethroughInternal = { - b64EncodeUnicode, - handleIframe, - isLockedInFrame, - getProtocol + getProtocol, }; export const sharethroughAdapterSpec = { code: BIDDER_CODE, + supportedMediaTypes: [VIDEO, BANNER], isBidRequestValid: bid => !!bid.params.pkey && bid.bidder === BIDDER_CODE, buildRequests: (bidRequests, bidderRequest) => { - return bidRequests.map(bidRequest => { - let query = { - placement_key: bidRequest.params.pkey, - bidId: bidRequest.bidId, - consent_required: false, - instant_play_capable: canAutoPlayHTML5Video(), - hbSource: 'prebid', - hbVersion: '$prebid.version$', - strVersion: VERSION, - }; - - const gpid = utils.deepAccess(bidRequest, 'ortb2Imp.ext.data.pbadslot'); - if (gpid) { - query.gpid = gpid; - } - - Object.assign(query, handleUniversalIds(bidRequest)); - - const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0; - query.secure = nonHttp || (sharethroughInternal.getProtocol().indexOf('https') > -1); - - if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprConsent.consentString) { - query.consent_string = bidderRequest.gdprConsent.consentString; - } - - if (bidderRequest && bidderRequest.gdprConsent) { - query.consent_required = !!bidderRequest.gdprConsent.gdprApplies; - } - - if (bidderRequest && bidderRequest.uspConsent) { - query.us_privacy = bidderRequest.uspConsent + const timeout = config.getConfig('bidderTimeout'); + + const nonHttp = sharethroughInternal.getProtocol().indexOf('http') < 0; + const secure = nonHttp || (sharethroughInternal.getProtocol().indexOf('https') > -1); + + const req = { + id: utils.generateUUID(), + at: 1, + cur: ['USD'], + tmax: timeout, + site: { + domain: window.location.hostname, + page: window.location.href, + ref: bidderRequest.refererInfo ? bidderRequest.refererInfo.referer || null : null, + }, + user: { + ext: { + eids: userIdAsEids(bidRequests[0]), + }, + }, + device: { + ua: navigator.userAgent, + language: navigator.language, + js: 1, + dnt: navigator.doNotTrack === '1' ? 1 : 0, + h: window.screen.height, + w: window.screen.width, + }, + regs: { + coppa: config.getConfig('coppa') === true ? 1 : 0, + ext: {}, + }, + source: { + ext: { + version: '$prebid.version$', + str: VERSION, + schain: bidRequests[0].schain, + }, + }, + bcat: bidRequests[0].params.bcat || [], + badv: bidRequests[0].params.badv || [], + test: 0, + }; + + if (bidderRequest.gdprConsent) { + const gdprApplies = bidderRequest.gdprConsent.gdprApplies === true; + req.regs.ext.gdpr = gdprApplies ? 1 : 0; + if (gdprApplies) { + req.user.ext.consent = bidderRequest.gdprConsent.consentString; } + } - if (config.getConfig('coppa') === true) { - query.coppa = true - } + if (bidderRequest.uspConsent) { + req.regs.ext.us_privacy = bidderRequest.uspConsent; + } - if (bidRequest.schain) { - query.schain = JSON.stringify(bidRequest.schain); - } + const imps = bidRequests.map(bidReq => { + const impression = {}; - const floor = getFloor(bidRequest); - if (floor) { - query.bidfloor = floor; + const gpid = utils.deepAccess(bidReq, 'ortb2Imp.ext.data.pbadslot'); + if (gpid) { + impression.ext = { gpid: gpid }; } - if (bidRequest.params.badv) { - query.badv = bidRequest.params.badv; + // if request is for video, we only support instream + if (bidReq.mediaTypes && bidReq.mediaTypes.video && bidReq.mediaTypes.video.context === 'outstream') { + // return null so we can easily remove this imp from the array of imps that we send to adserver + return null; } - if (bidRequest.params.bcat) { - query.bcat = bidRequest.params.bcat; + if (bidReq.mediaTypes && bidReq.mediaTypes.video) { + const videoRequest = bidReq.mediaTypes.video; + + // default playerSize, only change this if we know width and height are properly defined in the request + let [w, h] = [640, 360]; + if (videoRequest.playerSize && videoRequest.playerSize[0] && videoRequest.playerSize[1]) { + [w, h] = videoRequest.playerSize; + } + + impression.video = { + pos: nullish(videoRequest.pos, 0), + topframe: utils.inIframe() ? 0 : 1, + skip: nullish(videoRequest.skip, 0), + linearity: nullish(videoRequest.linearity, 1), + minduration: nullish(videoRequest.minduration, 5), + maxduration: nullish(videoRequest.maxduration, 60), + playbackmethod: videoRequest.playbackmethod || [2], + api: getVideoApi(videoRequest), + mimes: videoRequest.mimes || ['video/mp4'], + protocols: getVideoProtocols(videoRequest), + w, + h, + startdelay: nullish(videoRequest.startdelay, 0), + skipmin: nullish(videoRequest.skipmin, 0), + skipafter: nullish(videoRequest.skipafter, 0), + }; + + if (videoRequest.placement) impression.video.placement = videoRequest.placement; + if (videoRequest.delivery) impression.video.delivery = videoRequest.delivery; + if (videoRequest.companiontype) impression.video.companiontype = videoRequest.companiontype; + if (videoRequest.companionad) impression.video.companionad = videoRequest.companionad; + } else { + impression.banner = { + pos: utils.deepAccess(bidReq, 'mediaTypes.banner.pos', 0), + topframe: utils.inIframe() ? 0 : 1, + format: bidReq.sizes.map(size => ({ w: +size[0], h: +size[1] })), + }; } - // Data that does not need to go to the server, - // but we need as part of interpretResponse() - const strData = { - skipIframeBusting: bidRequest.params.iframe, - iframeSize: bidRequest.params.iframeSize, - sizes: bidRequest.sizes - }; - return { - method: 'POST', - url: STR_ENDPOINT, - data: query, - strData: strData + id: bidReq.bidId, + tagid: String(bidReq.params.pkey), + secure: secure ? 1 : 0, + bidfloor: getBidRequestFloor(bidReq), + ...impression, }; - }) + }).filter(imp => !!imp); + + return { + method: 'POST', + url: STR_ENDPOINT, + data: { + ...req, + imp: imps, + }, + bidRequests, + bidderRequest, + }; }, interpretResponse: ({ body }, req) => { - if (!body || !body.creatives || !body.creatives.length) { + if (!body || !body.seatbid || body.seatbid.length === 0 || !body.seatbid[0].bid || body.seatbid[0].bid.length === 0) { return []; } - const creative = body.creatives[0]; - let size = DEFAULT_SIZE; - if (req.strData.iframeSize || req.strData.sizes.length) { - size = req.strData.iframeSize - ? req.strData.iframeSize - : getLargestSize(req.strData.sizes); - } + return body.seatbid[0].bid.map(bid => { + const request = matchRequest(bid.impid, req); + + const response = { + requestId: bid.impid, + width: +bid.w, + height: +bid.h, + cpm: +bid.price, + creativeId: bid.crid, + dealId: bid.dealid || null, + mediaType: request.mediaTypes && request.mediaTypes.video ? VIDEO : BANNER, + currency: body.cur || 'USD', + netRevenue: true, + ttl: 360, + ad: bid.adm, + nurl: bid.nurl, + meta: { + advertiserDomains: bid.adomain || [], + }, + }; - return [{ - requestId: req.data.bidId, - width: size[0], - height: size[1], - cpm: creative.cpm, - creativeId: creative.creative.creative_key, - dealId: creative.creative.deal_id, - currency: 'USD', - netRevenue: true, - ttl: 360, - meta: { advertiserDomains: creative.creative && creative.creative.adomain ? creative.creative.adomain : [] }, - ad: generateAd(body, req) - }]; + if (response.mediaType === VIDEO) { + response.ttl = 3600; + response.vastXml = bid.adm; + } + + return response; + }); }, getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { @@ -138,175 +205,77 @@ export const sharethroughAdapterSpec = { }, // Empty implementation for prebid core to be able to find it - onTimeout: (data) => {}, + onTimeout: (data) => { + }, // Empty implementation for prebid core to be able to find it - onBidWon: (bid) => {}, + onBidWon: (bid) => { + }, // Empty implementation for prebid core to be able to find it - onSetTargeting: (bid) => {} + onSetTargeting: (bid) => { + }, }; -function handleUniversalIds(bidRequest) { - if (!bidRequest.userId) return {}; - - const universalIds = {}; - - const ttd = utils.deepAccess(bidRequest, 'userId.tdid'); - if (ttd) universalIds.ttduid = ttd; - - const pubc = utils.deepAccess(bidRequest, 'userId.pubcid') || utils.deepAccess(bidRequest, 'crumbs.pubcid'); - if (pubc) universalIds.pubcid = pubc; - - const idl = utils.deepAccess(bidRequest, 'userId.idl_env'); - if (idl) universalIds.idluid = idl; - - const id5 = utils.deepAccess(bidRequest, 'userId.id5id.uid'); - if (id5) { - universalIds.id5uid = { id: id5 }; - const id5link = utils.deepAccess(bidRequest, 'userId.id5id.ext.linkType'); - if (id5link) universalIds.id5uid.linkType = id5link; - } - - const lipb = utils.deepAccess(bidRequest, 'userId.lipb.lipbid'); - if (lipb) universalIds.liuid = lipb; - - return universalIds; -} - -function getLargestSize(sizes) { - function area(size) { - return size[0] * size[1]; +function getVideoApi({ api }) { + let defaultValue = [2]; + if (api && Array.isArray(api) && api.length > 0) { + return api; + } else { + return defaultValue; } - - return sizes.reduce((prev, current) => { - if (area(current) > area(prev)) { - return current - } else { - return prev - } - }); } -function generateAd(body, req) { - const strRespId = `str_response_${req.data.bidId}`; - - let adMarkup = ` -
-
- - `; - - if (req.strData.skipIframeBusting) { - // Don't break out of iframe - adMarkup = adMarkup + ``; +function getVideoProtocols({ protocols }) { + let defaultValue = [2, 3, 5, 6, 7, 8]; + if (protocols && Array.isArray(protocols) && protocols.length > 0) { + return protocols; } else { - // Add logic to the markup that detects whether or not in top level document is accessible - // this logic will deploy sfp.js and/or iframe buster script(s) as appropriate - adMarkup = adMarkup + ` - - `; + return defaultValue; } - - return adMarkup; } -function handleIframe () { - // only load iframe buster JS if we can access the top level document - // if we are 'locked in' to this frame then no point trying to bust out: we may as well render in the frame instead - var iframeBusterLoaded = false; - if (!window.lockedInFrame) { - var sfpIframeBusterJs = document.createElement('script'); - sfpIframeBusterJs.src = 'https://native.sharethrough.com/assets/sfp-set-targeting.js'; - sfpIframeBusterJs.type = 'text/javascript'; - try { - window.document.getElementsByTagName('body')[0].appendChild(sfpIframeBusterJs); - iframeBusterLoaded = true; - } catch (e) { - utils.logError('Trouble writing frame buster script, error details:', e); - } - } - - var clientJsLoaded = (!iframeBusterLoaded) ? !!(window.STR && window.STR.Tag) : !!(window.top.STR && window.top.STR.Tag); - if (!clientJsLoaded) { - var sfpJs = document.createElement('script'); - sfpJs.src = 'https://native.sharethrough.com/assets/sfp.js'; - sfpJs.type = 'text/javascript'; - - // only add sfp js to window.top if iframe busting successfully loaded; otherwise, add to iframe - try { - if (iframeBusterLoaded) { - window.top.document.getElementsByTagName('body')[0].appendChild(sfpJs); - } else { - window.document.getElementsByTagName('body')[0].appendChild(sfpJs); - } - } catch (e) { - utils.logError('Trouble writing sfp script, error details:', e); +function getBidRequestFloor(bid) { + let floor = null; + if (typeof bid.getFloor === 'function') { + const floorInfo = bid.getFloor({ + currency: 'USD', + mediaType: bid.mediaTypes && bid.mediaTypes.video ? 'video' : 'banner', + size: bid.sizes.map(size => ({ w: size[0], h: size[1] })), + }); + if (typeof floorInfo === 'object' && floorInfo.currency === 'USD' && !isNaN(parseFloat(floorInfo.floor))) { + floor = parseFloat(floorInfo.floor); } } + return floor !== null ? floor : bid.params.floor; } -// determines if we are capable of busting out of the iframe we are in -// if we catch a DOMException when trying to access top-level document, it means we're stuck in the frame we're in -function isLockedInFrame () { - window.lockedInFrame = false; - try { - window.lockedInFrame = !window.top.document; - } catch (e) { - window.lockedInFrame = (e instanceof DOMException); +function userIdAsEids(bidRequest) { + const eids = createEidsArray(utils.deepAccess(bidRequest, 'userId')) || []; + + const flocData = utils.deepAccess(bidRequest, 'userId.flocId'); + const isFlocIdValid = flocData && flocData.id && flocData.version; + if (isFlocIdValid) { + eids.push({ + source: 'chrome.com', + uids: [{ id: flocData.id, atype: 1, ext: { ver: flocData.version } }], + }); } -} -// See https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem -function b64EncodeUnicode(str) { - return btoa( - encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, - function toSolidBytes(match, p1) { - return String.fromCharCode('0x' + p1); - })); + return eids; } -function canAutoPlayHTML5Video() { - const userAgent = navigator.userAgent; - if (!userAgent) return false; - - const isAndroid = /Android/i.test(userAgent); - const isiOS = /iPhone|iPad|iPod/i.test(userAgent); - const chromeVersion = parseInt((/Chrome\/([0-9]+)/.exec(userAgent) || [0, 0])[1]); - const chromeiOSVersion = parseInt((/CriOS\/([0-9]+)/.exec(userAgent) || [0, 0])[1]); - const safariVersion = parseInt((/Version\/([0-9]+)/.exec(userAgent) || [0, 0])[1]); - - if ( - (isAndroid && chromeVersion >= 53) || - (isiOS && (safariVersion >= 10 || chromeiOSVersion >= 53)) || - !(isAndroid || isiOS) - ) { - return true; - } else { - return false; - } +function getProtocol() { + return window.location.protocol; } -function getProtocol() { - return document.location.protocol; +function matchRequest(id, request) { + return request.bidRequests.find(bid => bid.bidId === id); } -function getFloor(bid) { - if (utils.isFn(bid.getFloor)) { - const floorInfo = bid.getFloor({ - currency: 'USD', - mediaType: 'banner', - size: bid.sizes.map(size => ({ w: size[0], h: size[1] })) - }); - if (utils.isPlainObject(floorInfo) && !isNaN(floorInfo.floor) && floorInfo.currency === 'USD') { - return parseFloat(floorInfo.floor); - } - } - return null; +// stub for ?? operator +function nullish(input, def) { + return input === null || input === undefined ? def : input; } registerBidder(sharethroughAdapterSpec); diff --git a/modules/sharethroughBidAdapter.md b/modules/sharethroughBidAdapter.md index 396b8164577..218ef353d4e 100644 --- a/modules/sharethroughBidAdapter.md +++ b/modules/sharethroughBidAdapter.md @@ -23,22 +23,74 @@ Module that connects to Sharethrough's demand sources // REQUIRED - The placement key pkey: 'LuB3vxGGFrBZJa6tifXW4xgK', - // OPTIONAL - Render Sharethrough creative in an iframe, defaults to false - iframe: true, - - // OPTIONAL - If iframeSize is provided, we'll use this size for the iframe - // otherwise we'll grab the largest size from the sizes array - // This is ignored if iframe: false - iframeSize: [250, 250], - // OPTIONAL - Blocked Advertiser Domains badv: ['domain1.com', 'domain2.com'], // OPTIONAL - Blocked Categories (IAB codes) bcat: ['IAB1-1', 'IAB1-2'], + + // OPTIONAL - default bid floor, if not specified in bid request (USD) + floor: 0.1, } } ] } ]; ``` + +# Sample Instream Video Ad Unit: For Publishers +``` +var adVideoAdUnits = [ +{ + code: 'test-div-video', + mediaTypes: { + video: { + // CANNOT be 'outstream' + context: 'instream', + placement: 1, + delivery: 1, + companiontype: 'companion type', + companionad: 'companion ad', + // default values shown below this point + pos: 0, + skip: 0, + linearity: 1, + minduration: 5, + maxduration: 60, + playbackmethod: [2], + api: [2], + mimes: ['video/mp4'], + protocols: [2, 3, 5, 6, 7, 8], + playerSize: [640, 360], + startdelay: 0, + skipmin: 0, + skipafter: 0, + }, + }, + bids: [{ + bidder: 'sharethrough', + params: { + pkey: 'pkey1' + } + }] +}] +``` + +# Sample Banner Ad Unit: For Publishers +``` +var adUnits = [ +{ + code: 'test-div-video', + mediaTypes: { + banner: { + pos: 0, // default + }, + }, + bids: [{ + bidder: 'sharethrough', + params: { + pkey: 'pkey1' + } + }] +}] +``` diff --git a/test/spec/modules/sharethroughBidAdapter_spec.js b/test/spec/modules/sharethroughBidAdapter_spec.js index 3e406e1af44..122c6cdbb39 100644 --- a/test/spec/modules/sharethroughBidAdapter_spec.js +++ b/test/spec/modules/sharethroughBidAdapter_spec.js @@ -1,247 +1,38 @@ import { expect } from 'chai'; import { sharethroughAdapterSpec, sharethroughInternal } from 'modules/sharethroughBidAdapter.js'; import { newBidder } from 'src/adapters/bidderFactory.js'; -import * as utils from '../../../src/utils.js'; import { config } from 'src/config'; +import * as utils from 'src/utils'; const spec = newBidder(sharethroughAdapterSpec).getSpec(); -const bidRequests = [ - { - bidder: 'sharethrough', - bidId: 'bidId1', - sizes: [[600, 300]], - placementCode: 'foo', - params: { - pkey: 'aaaa1111' - }, - ortb2Imp: { - ext: { - data: { - pbadslot: 'adslot-id-1' - } - } - }, - userId: { - tdid: 'fake-tdid', - pubcid: 'fake-pubcid', - idl_env: 'fake-identity-link', - id5id: { - uid: 'fake-id5id', - ext: { - linkType: 2 - } - }, - lipb: { - lipbid: 'fake-lipbid' - } - }, - crumbs: { - pubcid: 'fake-pubcid-in-crumbs-obj' - } - }, - { - bidder: 'sharethrough', - bidId: 'bidId2', - sizes: [[700, 400]], - placementCode: 'bar', - params: { - pkey: 'bbbb2222', - iframe: true - } - }, - { - bidder: 'sharethrough', - bidId: 'bidId3', - sizes: [[700, 400]], - placementCode: 'coconut', - params: { - pkey: 'cccc3333', - iframe: true, - iframeSize: [500, 500] - } - }, - { - bidder: 'sharethrough', - bidId: 'bidId4', - sizes: [[700, 400]], - placementCode: 'bar', - params: { - pkey: 'dddd4444', - badv: ['domain1.com', 'domain2.com'] - } - }, - { - bidder: 'sharethrough', - bidId: 'bidId5', - sizes: [[700, 400]], - placementCode: 'bar', - params: { - pkey: 'eeee5555', - bcat: ['IAB1-1', 'IAB1-2'] - } - }, -]; - -const prebidRequests = [ - { - method: 'POST', - url: 'https://btlr.sharethrough.com/WYu2BXv1/v1', - data: { - bidId: 'bidId', - placement_key: 'pKey' - }, - strData: { - skipIframeBusting: false, - sizes: [] - } - }, - { - method: 'POST', - url: 'https://btlr.sharethrough.com/WYu2BXv1/v1', - data: { - bidId: 'bidId', - placement_key: 'pKey' - }, - strData: { - skipIframeBusting: true, - sizes: [[300, 250], [300, 300], [250, 250], [600, 50]] - } - }, - { - method: 'POST', - url: 'https://btlr.sharethrough.com/WYu2BXv1/v1', - data: { - bidId: 'bidId', - placement_key: 'pKey' - }, - strData: { - skipIframeBusting: true, - iframeSize: [500, 500], - sizes: [[300, 250], [300, 300], [250, 250], [600, 50]] - } - }, - { - method: 'POST', - url: 'https://btlr.sharethrough.com/WYu2BXv1/v1', - data: { - bidId: 'bidId', - placement_key: 'pKey' - }, - strData: { - skipIframeBusting: false, - sizes: [[0, 0]] - } - }, - { - method: 'POST', - url: 'https://btlr.sharethrough.com/WYu2BXv1/v1', - data: { - bidId: 'bidId', - placement_key: 'pKey' - }, - strData: { - skipIframeBusting: false, - sizes: [[300, 250], [300, 300], [250, 250], [600, 50]] - } - } -]; - -const bidderResponse = { - body: { - 'adserverRequestId': '40b6afd5-6134-4fbb-850a-bb8972a46994', - 'bidId': 'bidId1', - 'version': 1, - 'creatives': [{ - 'auctionWinId': 'b2882d5e-bf8b-44da-a91c-0c11287b8051', - 'cpm': 12.34, - 'creative': { - 'deal_id': 'aDealId', - 'creative_key': 'aCreativeId', - 'title': '✓ à la mode' - } - }], - 'stxUserId': '' - }, - header: { get: (header) => header } -}; - -const setUserAgent = (uaString) => { - window.navigator['__defineGetter__']('userAgent', function() { - return uaString; - }); -}; - -describe('sharethrough internal spec', function() { - let windowStub, windowTopStub; - let stubbedReturn = [{ - appendChild: () => undefined - }] - beforeEach(function() { - windowStub = sinon.stub(window.document, 'getElementsByTagName'); - windowTopStub = sinon.stub(window.top.document, 'getElementsByTagName'); - windowStub.withArgs('body').returns(stubbedReturn); - windowTopStub.withArgs('body').returns(stubbedReturn); - }); - - afterEach(function() { - windowStub.restore(); - windowTopStub.restore(); - window.STR = undefined; - window.top.STR = undefined; - }); - - describe('we cannot access top level document', function() { - beforeEach(function() { - window.lockedInFrame = true; - }); - - afterEach(function() { - window.lockedInFrame = false; - }); - it('appends sfp.js to the safeframe', function() { - sharethroughInternal.handleIframe(); - expect(windowStub.calledOnce).to.be.true; - }); +describe('sharethrough adapter spec', function() { + let protocolStub; + let inIframeStub; - it('does not append anything if sfp.js is already loaded in the safeframe', function() { - window.STR = { Tag: true }; - sharethroughInternal.handleIframe(); - expect(windowStub.notCalled).to.be.true; - expect(windowTopStub.notCalled).to.be.true; - }); + beforeEach(() => { + protocolStub = sinon.stub(sharethroughInternal, 'getProtocol').returns('https'); + inIframeStub = sinon.stub(utils, 'inIframe').returns(false); }); - describe('we are able to bust out of the iframe', function() { - it('appends sfp.js to window.top', function() { - sharethroughInternal.handleIframe(); - expect(windowStub.calledOnce).to.be.true; - expect(windowTopStub.calledOnce).to.be.true; - }); - - it('only appends sfp-set-targeting.js if sfp.js is already loaded on the page', function() { - window.top.STR = { Tag: true }; - sharethroughInternal.handleIframe(); - expect(windowStub.calledOnce).to.be.true; - expect(windowTopStub.notCalled).to.be.true; - }); + afterEach(() => { + protocolStub.restore(); + inIframeStub.restore(); }); -}); -describe('sharethrough adapter spec', function() { - describe('.code', function() { + describe('code', function() { it('should return a bidder code of sharethrough', function() { expect(spec.code).to.eql('sharethrough'); }); }); - describe('.isBidRequestValid', function() { + describe('isBidRequestValid', function() { it('should return false if req has no pkey', function() { const invalidBidRequest = { bidder: 'sharethrough', params: { - notPKey: 'abc123' - } + notPKey: 'abc123', + }, }; expect(spec.isBidRequestValid(invalidBidRequest)).to.eql(false); }); @@ -250,383 +41,504 @@ describe('sharethrough adapter spec', function() { const invalidBidRequest = { bidder: 'notSharethrough', params: { - notPKey: 'abc123' + pkey: 'abc123', } }; expect(spec.isBidRequestValid(invalidBidRequest)).to.eql(false); }); it('should return true if req is correct', function() { - expect(spec.isBidRequestValid(bidRequests[0])).to.eq(true); - expect(spec.isBidRequestValid(bidRequests[1])).to.eq(true); + const validBidRequest = { + bidder: 'sharethrough', + params: { + pkey: 'abc123', + }, + }; + expect(spec.isBidRequestValid(validBidRequest)).to.eq(true); }); }); - describe('.buildRequests', function() { - it('should return an array of requests', function() { - const builtBidRequests = spec.buildRequests(bidRequests); + describe('open rtb', () => { + let bidRequests, bidderRequest; + + beforeEach(() => { + config.setConfig({ + bidderTimeout: 242, + coppa: true, + }); - expect(builtBidRequests[0].url).to.eq('https://btlr.sharethrough.com/WYu2BXv1/v1'); - expect(builtBidRequests[1].url).to.eq('https://btlr.sharethrough.com/WYu2BXv1/v1'); - expect(builtBidRequests[0].method).to.eq('POST'); + bidRequests = [ + { + bidder: 'sharethrough', + bidId: 'bidId1', + sizes: [[300, 250], [300, 600]], + params: { + pkey: 'aaaa1111', + bcat: ['cat1', 'cat2'], + badv: ['adv1', 'adv2'], + }, + mediaTypes: { + banner: { + pos: 1, + }, + }, + ortb2Imp: { + ext: { + data: { + pbadslot: 'universal-id', + }, + }, + }, + userId: { + tdid: 'fake-tdid', + pubcid: 'fake-pubcid', + idl_env: 'fake-identity-link', + id5id: { + uid: 'fake-id5id', + ext: { + linkType: 2, + }, + }, + lipb: { + lipbid: 'fake-lipbid', + }, + criteoId: 'fake-criteo', + britepoolid: 'fake-britepool', + intentIqId: 'fake-intentiq', + lotamePanoramaId: 'fake-lotame', + parrableId: { + eid: 'fake-parrable', + }, + netId: 'fake-netid', + sharedid: { + id: 'fake-sharedid', + }, + flocId: { + id: 'fake-flocid', + version: '42', + }, + }, + crumbs: { + pubcid: 'fake-pubcid-in-crumbs-obj', + }, + schain: { + ver: '1.0', + complete: 1, + nodes: [ + { + asi: 'directseller.com', + sid: '00001', + rid: 'BidRequest1', + hp: 1, + }, + ], + }, + getFloor: () => ({ currency: 'USD', floor: 42 }), + }, + { + bidder: 'sharethrough', + bidId: 'bidId2', + sizes: [[600, 300]], + params: { + pkey: 'bbbb2222', + }, + mediaTypes: { + video: { + pos: 3, + skip: 1, + linearity: 0, + minduration: 10, + maxduration: 30, + playbackmethod: [1], + api: [3], + mimes: ['video/3gpp'], + protocols: [2, 3], + playerSize: [640, 480], + startdelay: 42, + skipmin: 10, + skipafter: 20, + placement: 1, + delivery: 1, + companiontype: 'companion type', + companionad: 'companion ad', + context: 'instream', + }, + }, + getFloor: () => ({ currency: 'USD', floor: 42 }), + }, + ]; + + bidderRequest = { + refererInfo: { + referer: 'https://referer.com', + }, + }; }); - it('should set the instant_play_capable parameter correctly based on browser userAgent string', function() { - setUserAgent('Android Chrome/60'); - let builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.true; + describe('buildRequests', function() { + describe('top level object', () => { + it('should build openRTB request', () => { + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + + expect(builtRequest.method).to.equal('POST'); + expect(builtRequest.url).not.to.be.undefined; + expect(builtRequest.options).to.be.undefined; + expect(builtRequest.bidderRequest).to.deep.equal(bidderRequest); + + const openRtbReq = builtRequest.data; + expect(openRtbReq.id).not.to.be.undefined; + expect(openRtbReq.cur).to.deep.equal(['USD']); + expect(openRtbReq.tmax).to.equal(242); + + expect(openRtbReq.site.domain).not.to.be.undefined; + expect(openRtbReq.site.page).not.to.be.undefined; + expect(openRtbReq.site.ref).to.equal('https://referer.com'); + + const expectedEids = { + 'liveramp.com': { id: 'fake-identity-link' }, + 'id5-sync.com': { id: 'fake-id5id' }, + 'pubcid.org': { id: 'fake-pubcid' }, + 'adserver.org': { id: 'fake-tdid' }, + 'criteo.com': { id: 'fake-criteo' }, + 'britepool.com': { id: 'fake-britepool' }, + 'liveintent.com': { id: 'fake-lipbid' }, + 'intentiq.com': { id: 'fake-intentiq' }, + 'crwdcntrl.net': { id: 'fake-lotame' }, + 'parrable.com': { id: 'fake-parrable' }, + 'netid.de': { id: 'fake-netid' }, + 'chrome.com': { id: 'fake-flocid' }, + }; + expect(openRtbReq.user.ext.eids).to.be.an('array').that.have.length(Object.keys(expectedEids).length); + for (const eid of openRtbReq.user.ext.eids) { + expect(Object.keys(expectedEids)).to.include(eid.source); + expect(eid.uids[0].id).to.equal(expectedEids[eid.source].id); + expect(eid.uids[0].atype).to.be.ok; + } - setUserAgent('iPhone Version/11'); - builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.true; + expect(openRtbReq.device.ua).to.equal(navigator.userAgent); + expect(openRtbReq.regs.coppa).to.equal(1); - setUserAgent('iPhone CriOS/60'); - builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.true; + expect(openRtbReq.source.ext.version).not.to.be.undefined; + expect(openRtbReq.source.ext.str).not.to.be.undefined; + expect(openRtbReq.source.ext.schain).to.deep.equal(bidRequests[0].schain); - setUserAgent('Android Chrome/50'); - builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.false; + expect(openRtbReq.bcat).to.deep.equal(bidRequests[0].params.bcat); + expect(openRtbReq.badv).to.deep.equal(bidRequests[0].params.badv); - setUserAgent('Android Chrome'); - builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.false; + expect(openRtbReq.imp).to.have.length(2); - setUserAgent(undefined); - builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0].data.instant_play_capable).to.be.false; - }); + expect(openRtbReq.imp[0].id).to.equal('bidId1'); + expect(openRtbReq.imp[0].tagid).to.equal('aaaa1111'); + expect(openRtbReq.imp[0].secure).to.equal(1); + expect(openRtbReq.imp[0].bidfloor).to.equal(42); - it('should set the secure parameter to false when the protocol is http', function() { - const stub = sinon.stub(sharethroughInternal, 'getProtocol').returns('http:'); - const bidRequest = spec.buildRequests(bidRequests, null)[0]; - expect(bidRequest.data.secure).to.be.false; - stub.restore(); - }); + expect(openRtbReq.imp[1].id).to.equal('bidId2'); + expect(openRtbReq.imp[1].tagid).to.equal('bbbb2222'); + expect(openRtbReq.imp[1].secure).to.equal(1); + expect(openRtbReq.imp[1].bidfloor).to.equal(42); + }); - it('should set the secure parameter to true when the protocol is https', function() { - const stub = sinon.stub(sharethroughInternal, 'getProtocol').returns('https:'); - const bidRequest = spec.buildRequests(bidRequests, null)[0]; - expect(bidRequest.data.secure).to.be.true; - stub.restore(); - }); + it('should have empty eid array if no id is provided', () => { + const openRtbReq = spec.buildRequests([bidRequests[1]], bidderRequest).data; - it('should set the secure parameter to true when the protocol is neither http or https', function() { - const stub = sinon.stub(sharethroughInternal, 'getProtocol').returns('about:'); - const bidRequest = spec.buildRequests(bidRequests, null)[0]; - expect(bidRequest.data.secure).to.be.true; - stub.restore(); - }); + expect(openRtbReq.user.ext.eids).to.deep.equal([]); + }); + }); - it('should add ccpa parameter if uspConsent is present', function() { - const uspConsent = '1YNN'; - const bidderRequest = { uspConsent: uspConsent }; - const bidRequest = spec.buildRequests(bidRequests, bidderRequest)[0]; - expect(bidRequest.data.us_privacy).to.eq(uspConsent); - }); + describe('regulation', () => { + describe('gdpr', () => { + it('should populate request accordingly when gdpr applies', () => { + bidderRequest.gdprConsent = { + gdprApplies: true, + consentString: 'consent', + }; - it('should add consent parameters if gdprConsent is present', function() { - const gdprConsent = { consentString: 'consent_string123', gdprApplies: true }; - const bidderRequest = { gdprConsent: gdprConsent }; - const bidRequest = spec.buildRequests(bidRequests, bidderRequest)[0]; - expect(bidRequest.data.consent_required).to.eq(true); - expect(bidRequest.data.consent_string).to.eq('consent_string123'); - }); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should handle gdprConsent is present but values are undefined case', function() { - const gdprConsent = { consent_string: undefined, gdprApplies: undefined }; - const bidderRequest = { gdprConsent: gdprConsent }; - const bidRequest = spec.buildRequests(bidRequests, bidderRequest)[0]; - expect(bidRequest.data).to.not.include.any.keys('consent_string'); - }); + expect(openRtbReq.regs.ext.gdpr).to.equal(1); + expect(openRtbReq.user.ext.consent).to.equal('consent'); + }); - it('should add the ttduid parameter if a bid request contains a value for Unified ID from The Trade Desk', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.ttduid).to.eq('fake-tdid'); - }); + it('should populate request accordingly when gdpr explicitly does not apply', () => { + bidderRequest.gdprConsent = { + gdprApplies: false, + }; - it('should add the pubcid parameter if a bid request contains a value for the Publisher Common ID Module in the' + - ' userId object of the bidrequest', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.pubcid).to.eq('fake-pubcid'); - }); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should add the pubcid parameter if a bid request contains a value for the Publisher Common ID Module in the' + - ' crumbs object of the bidrequest', function() { - const bidData = utils.deepClone(bidRequests); - delete bidData[0].userId.pubcid; + expect(openRtbReq.regs.ext.gdpr).to.equal(0); + expect(openRtbReq.user.ext.consent).to.be.undefined; + }); + }); - const bidRequest = spec.buildRequests(bidData)[0]; - expect(bidRequest.data.pubcid).to.eq('fake-pubcid-in-crumbs-obj'); - }); + describe('US privacy', () => { + it('should populate request accordingly when us privacy applies', () => { + bidderRequest.uspConsent = 'consent'; - it('should add the pubcid parameter if a bid request contains a value for the Publisher Common ID Module in the' + - ' crumbs object of the bidrequest', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - delete bidRequest.userId; - expect(bidRequest.data.pubcid).to.eq('fake-pubcid'); - }); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should add the idluid parameter if a bid request contains a value for Identity Link from Live Ramp', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.idluid).to.eq('fake-identity-link'); - }); + expect(openRtbReq.regs.ext.us_privacy).to.equal('consent'); + }); + }); - it('should add the id5uid parameter if a bid request contains a value for ID5', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.id5uid.id).to.eq('fake-id5id'); - expect(bidRequest.data.id5uid.linkType).to.eq(2); - }); + describe('coppa', () => { + it('should populate request accordingly when coppa does not apply', () => { + config.setConfig({ coppa: false }); - it('should add the liuid parameter if a bid request contains a value for LiveIntent ID', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.liuid).to.eq('fake-lipbid'); - }); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should add Sharethrough specific parameters', function() { - const builtBidRequests = spec.buildRequests(bidRequests); - expect(builtBidRequests[0]).to.deep.include({ - strData: { - skipIframeBusting: undefined, - iframeSize: undefined, - sizes: [[600, 300]] - } + expect(openRtbReq.regs.coppa).to.equal(0); + }); + }); }); - }); - - it('should add a supply chain parameter if schain is present', function() { - // shallow copy of the first bidRequest obj, so we don't mutate - const bidRequest = Object.assign({}, bidRequests[0]); - bidRequest['schain'] = { - ver: '1.0', - complete: 1, - nodes: [ - { - asi: 'directseller.com', - sid: '00001', - rid: 'BidRequest1', - hp: 1 - } - ] - }; - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data.schain).to.eq(JSON.stringify(bidRequest.schain)); - }); - - describe('gpid', () => { - it('should include the gpid param if pbadslot is found in ortb2Imp in the bid request', () => { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data.gpid).to.eq('adslot-id-1') - }); + describe('universal id', () => { + it('should include gpid when universal id is provided', () => { + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should not include the gpid param if pbadslot is not found in ortb2Imp in the bid request', () => { - const bidRequest = spec.buildRequests(bidRequests)[1]; - expect(bidRequest.data).to.not.include.any.keys('gpid'); + expect(openRtbReq.imp[0].ext.gpid).to.equal('universal-id'); + expect(openRtbReq.imp[1].ext).to.be.undefined; + }); }); - }); - - it('should add badv if provided', () => { - const builtBidRequest = spec.buildRequests([bidRequests[3]])[0]; - - expect(builtBidRequest.data.badv).to.have.members(['domain1.com', 'domain2.com']) - }); - - it('should add bcat if provided', () => { - const builtBidRequest = spec.buildRequests([bidRequests[4]])[0]; - expect(builtBidRequest.data.bcat).to.have.members(['IAB1-1', 'IAB1-2']) - }); + describe('secure flag', () => { + it('should be positive when protocol is https', () => { + protocolStub.returns('https'); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should not add a supply chain parameter if schain is missing', function() { - const bidRequest = spec.buildRequests(bidRequests)[0]; - expect(bidRequest.data).to.not.include.any.keys('schain'); - }); + expect(openRtbReq.imp[0].secure).to.equal(1); + expect(openRtbReq.imp[1].secure).to.equal(1); + }); - it('should include the bidfloor parameter if it is present in the bid request', function() { - const bidRequest = Object.assign({}, bidRequests[0]); - bidRequest['getFloor'] = () => ({ currency: 'USD', floor: 0.5 }); - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data.bidfloor).to.eq(0.5); - }); + it('should be negative when protocol is http', () => { + protocolStub.returns('http'); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should not include the bidfloor parameter if it is missing in the bid request', function() { - const bidRequest = Object.assign({}, bidRequests[0]); - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data).to.not.include.any.keys('bidfloor'); - }); + expect(openRtbReq.imp[0].secure).to.equal(0); + expect(openRtbReq.imp[1].secure).to.equal(0); + }); - describe('coppa', function() { - it('should add coppa to request if enabled', function() { - config.setConfig({coppa: true}); - const bidRequest = Object.assign({}, bidRequests[0]); - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data.coppa).to.eq(true); - }); + it('should be positive when protocol is neither http nor https', () => { + protocolStub.returns('about'); + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + const openRtbReq = builtRequest.data; - it('should not add coppa to request if disabled', function() { - config.setConfig({coppa: false}); - const bidRequest = Object.assign({}, bidRequests[0]); - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data.coppa).to.be.undefined; + expect(openRtbReq.imp[0].secure).to.equal(1); + expect(openRtbReq.imp[1].secure).to.equal(1); + }); }); - it('should not add coppa to request if unknown value', function() { - config.setConfig({coppa: 'something'}); - const bidRequest = Object.assign({}, bidRequests[0]); - const builtBidRequest = spec.buildRequests([bidRequest])[0]; - expect(builtBidRequest.data.coppa).to.be.undefined; - }); - }); - }); + describe('banner imp', () => { + it('should generate open rtb banner imp', () => { + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); - describe('.interpretResponse', function() { - it('returns a correctly parsed out response', function() { - expect(spec.interpretResponse(bidderResponse, prebidRequests[0])[0]).to.deep.include( - { - width: 1, - height: 1, - cpm: 12.34, - creativeId: 'aCreativeId', - dealId: 'aDealId', - currency: 'USD', - netRevenue: true, - ttl: 360, - meta: { advertiserDomains: [] } + const bannerImp = builtRequest.data.imp[0].banner; + expect(bannerImp.pos).to.equal(1); + expect(bannerImp.topframe).to.equal(1); + expect(bannerImp.format).to.deep.equal([{ w: 300, h: 250 }, { w: 300, h: 600 }]); }); - }); - it('returns a correctly parsed out response with largest size when strData.skipIframeBusting is true', function() { - expect(spec.interpretResponse(bidderResponse, prebidRequests[1])[0]).to.include( - { - width: 300, - height: 300, - cpm: 12.34, - creativeId: 'aCreativeId', - dealId: 'aDealId', - currency: 'USD', - netRevenue: true, - ttl: 360 - }); - }); + it('should default to pos 0 if not provided', () => { + delete bidRequests[0].mediaTypes; + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); - it('returns a correctly parsed out response with explicitly defined size when strData.skipIframeBusting is true and strData.iframeSize is provided', function() { - expect(spec.interpretResponse(bidderResponse, prebidRequests[2])[0]).to.include( - { - width: 500, - height: 500, - cpm: 12.34, - creativeId: 'aCreativeId', - dealId: 'aDealId', - currency: 'USD', - netRevenue: true, - ttl: 360 + const bannerImp = builtRequest.data.imp[0].banner; + expect(bannerImp.pos).to.equal(0); }); - }); + }); - it('returns a correctly parsed out response with explicitly defined size when strData.skipIframeBusting is false and strData.sizes contains [0, 0] only', function() { - expect(spec.interpretResponse(bidderResponse, prebidRequests[3])[0]).to.include( - { - width: 0, - height: 0, - cpm: 12.34, - creativeId: 'aCreativeId', - dealId: 'aDealId', - currency: 'USD', - netRevenue: true, - ttl: 360 + describe('video imp', () => { + it('should generate open rtb video imp', () => { + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + + const videoImp = builtRequest.data.imp[1].video; + expect(videoImp.pos).to.equal(3); + expect(videoImp.topframe).to.equal(1); + expect(videoImp.skip).to.equal(1); + expect(videoImp.linearity).to.equal(0); + expect(videoImp.minduration).to.equal(10); + expect(videoImp.maxduration).to.equal(30); + expect(videoImp.playbackmethod).to.deep.equal([1]); + expect(videoImp.api).to.deep.equal([3]); + expect(videoImp.mimes).to.deep.equal(['video/3gpp']); + expect(videoImp.protocols).to.deep.equal([2, 3]); + expect(videoImp.w).to.equal(640); + expect(videoImp.h).to.equal(480); + expect(videoImp.startdelay).to.equal(42); + expect(videoImp.skipmin).to.equal(10); + expect(videoImp.skipafter).to.equal(20); + expect(videoImp.placement).to.equal(1); + expect(videoImp.delivery).to.equal(1); + expect(videoImp.companiontype).to.equal('companion type'); + expect(videoImp.companionad).to.equal('companion ad'); }); - }); - it('returns a correctly parsed out response with explicitly defined size when strData.skipIframeBusting is false and strData.sizes contains multiple sizes', function() { - expect(spec.interpretResponse(bidderResponse, prebidRequests[4])[0]).to.include( - { - width: 300, - height: 300, - cpm: 12.34, - creativeId: 'aCreativeId', - dealId: 'aDealId', - currency: 'USD', - netRevenue: true, - ttl: 360 + it('should set defaults if no value provided', () => { + delete bidRequests[1].mediaTypes.video.pos; + delete bidRequests[1].mediaTypes.video.skip; + delete bidRequests[1].mediaTypes.video.linearity; + delete bidRequests[1].mediaTypes.video.minduration; + delete bidRequests[1].mediaTypes.video.maxduration; + delete bidRequests[1].mediaTypes.video.playbackmethod; + delete bidRequests[1].mediaTypes.video.api; + delete bidRequests[1].mediaTypes.video.mimes; + delete bidRequests[1].mediaTypes.video.protocols; + delete bidRequests[1].mediaTypes.video.playerSize; + delete bidRequests[1].mediaTypes.video.startdelay; + delete bidRequests[1].mediaTypes.video.skipmin; + delete bidRequests[1].mediaTypes.video.skipafter; + delete bidRequests[1].mediaTypes.video.placement; + delete bidRequests[1].mediaTypes.video.delivery; + delete bidRequests[1].mediaTypes.video.companiontype; + delete bidRequests[1].mediaTypes.video.companionad; + + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); + + const videoImp = builtRequest.data.imp[1].video; + expect(videoImp.pos).to.equal(0); + expect(videoImp.skip).to.equal(0); + expect(videoImp.linearity).to.equal(1); + expect(videoImp.minduration).to.equal(5); + expect(videoImp.maxduration).to.equal(60); + expect(videoImp.playbackmethod).to.deep.equal([2]); + expect(videoImp.api).to.deep.equal([2]); + expect(videoImp.mimes).to.deep.equal(['video/mp4']); + expect(videoImp.protocols).to.deep.equal([2, 3, 5, 6, 7, 8]); + expect(videoImp.w).to.equal(640); + expect(videoImp.h).to.equal(360); + expect(videoImp.startdelay).to.equal(0); + expect(videoImp.skipmin).to.equal(0); + expect(videoImp.skipafter).to.equal(0); + expect(videoImp.placement).to.be.undefined; + expect(videoImp.delivery).to.be.undefined; + expect(videoImp.companiontype).to.be.undefined; + expect(videoImp.companionad).to.be.undefined; }); - }); - it('returns a blank array if there are no creatives', function() { - const bidResponse = { body: { creatives: [] } }; - expect(spec.interpretResponse(bidResponse, prebidRequests[0])).to.be.an('array').that.is.empty; - }); + it('should not return a video impression if context is outstream', () => { + bidRequests[1].mediaTypes.video.context = 'outstream'; + const builtRequest = spec.buildRequests(bidRequests, bidderRequest); - it('returns a blank array if body object is empty', function() { - const bidResponse = { body: {} }; - expect(spec.interpretResponse(bidResponse, prebidRequests[0])).to.be.an('array').that.is.empty; - }); - - it('returns a blank array if body is null', function() { - const bidResponse = { body: null }; - expect(spec.interpretResponse(bidResponse, prebidRequests[0])).to.be.an('array').that.is.empty; + const videoImp = builtRequest.data.imp[1]; + expect(videoImp).to.be.undefined; + }); + }); }); - it('correctly generates ad markup when skipIframeBusting is false', function() { - const adMarkup = spec.interpretResponse(bidderResponse, prebidRequests[0])[0].ad; - let resp = null; + describe('interpretResponse', function() { + let request; + let response; + + beforeEach(() => { + request = spec.buildRequests(bidRequests, bidderRequest); + response = { + body: { + seatbid: [{ + bid: [{ + id: '123', + impid: 'bidId1', + w: 300, + h: 250, + price: 42, + crid: 'creative', + dealid: 'deal', + adomain: ['domain.com'], + adm: 'markup', + }, { + id: '456', + impid: 'bidId2', + w: 640, + h: 480, + price: 42, + adm: 'vastTag', + }], + }], + }, + }; + }); - expect(() => btoa(JSON.stringify(bidderResponse))).to.throw(); - expect(() => resp = sharethroughInternal.b64EncodeUnicode(JSON.stringify(bidderResponse))).not.to.throw(); - expect(adMarkup).to.match( - /data-str-native-key="pKey" data-stx-response-name="str_response_bidId"/); - expect(!!adMarkup.indexOf(resp)).to.eql(true); + describe('banner', () => { + it('should return a banner bid', () => { + const resp = spec.interpretResponse(response, request); + + const bannerBid = resp[0]; + expect(bannerBid.requestId).to.equal('bidId1'); + expect(bannerBid.width).to.equal(300); + expect(bannerBid.height).to.equal(250); + expect(bannerBid.cpm).to.equal(42); + expect(bannerBid.creativeId).to.equal('creative'); + expect(bannerBid.dealId).to.equal('deal'); + expect(bannerBid.mediaType).to.equal('banner'); + expect(bannerBid.currency).to.equal('USD'); + expect(bannerBid.netRevenue).to.equal(true); + expect(bannerBid.ttl).to.equal(360); + expect(bannerBid.ad).to.equal('markup'); + expect(bannerBid.meta.advertiserDomains).to.deep.equal(['domain.com']); + expect(bannerBid.vastXml).to.be.undefined; + }); + }); - // insert functionality to autodetect whether or not in safeframe, and handle JS insertion - expect(adMarkup).to.match(/isLockedInFrame/); - expect(adMarkup).to.match(/handleIframe/); + describe('video', () => { + it('should return a video bid', () => { + const resp = spec.interpretResponse(response, request); + + const bannerBid = resp[1]; + expect(bannerBid.requestId).to.equal('bidId2'); + expect(bannerBid.width).to.equal(640); + expect(bannerBid.height).to.equal(480); + expect(bannerBid.cpm).to.equal(42); + expect(bannerBid.creativeId).to.be.undefined; + expect(bannerBid.dealId).to.be.null; + expect(bannerBid.mediaType).to.equal('video'); + expect(bannerBid.currency).to.equal('USD'); + expect(bannerBid.netRevenue).to.equal(true); + expect(bannerBid.ttl).to.equal(3600); + expect(bannerBid.ad).to.equal('vastTag'); + expect(bannerBid.meta.advertiserDomains).to.deep.equal([]); + expect(bannerBid.vastXml).to.equal('vastTag'); + }); + }); }); - it('correctly generates ad markup when skipIframeBusting is true', function() { - const adMarkup = spec.interpretResponse(bidderResponse, prebidRequests[1])[0].ad; - let resp = null; - - expect(() => btoa(JSON.stringify(bidderResponse))).to.throw(); - expect(() => resp = sharethroughInternal.b64EncodeUnicode(JSON.stringify(bidderResponse))).not.to.throw(); - expect(adMarkup).to.match( - /data-str-native-key="pKey" data-stx-response-name="str_response_bidId"/); - expect(!!adMarkup.indexOf(resp)).to.eql(true); - expect(adMarkup).to.match( - / + + + + + + + + +

Ad Serverless Test Page

+ +
+
+
+ + From 1cd74ba202f2aeeb66db61bd4510b40cfc812f03 Mon Sep 17 00:00:00 2001 From: johnwier <49074029+johnwier@users.noreply.github.com> Date: Wed, 8 Sep 2021 12:52:02 -0700 Subject: [PATCH 036/250] Publink Id System (Conversant): add new user id module (#7322) --- modules/.submodules.json | 3 +- modules/publinkIdSystem.js | 123 +++++++++++++++++++ modules/publinkIdSystem.md | 28 +++++ modules/userId/eids.js | 4 + test/spec/modules/publinkIdSystem_spec.js | 136 ++++++++++++++++++++++ 5 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 modules/publinkIdSystem.js create mode 100644 modules/publinkIdSystem.md create mode 100644 test/spec/modules/publinkIdSystem_spec.js diff --git a/modules/.submodules.json b/modules/.submodules.json index f08db109bb6..e4de1819a16 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -32,7 +32,8 @@ "flocIdSystem", "amxIdSystem", "naveggId", - "imuIdSystem" + "imuIdSystem", + "publinkIdSystem" ], "adpod": [ "freeWheelAdserverVideo", diff --git a/modules/publinkIdSystem.js b/modules/publinkIdSystem.js new file mode 100644 index 00000000000..5e549732097 --- /dev/null +++ b/modules/publinkIdSystem.js @@ -0,0 +1,123 @@ +/** + * This module adds the PublinkId to the User ID module + * The {@link module:modules/userId} module is required + * @module modules/publinkIdSystem + * @requires module:modules/userId + */ + +import {submodule} from '../src/hook.js'; +import {getStorageManager} from '../src/storageManager.js'; +import {ajax} from '../src/ajax.js'; +import * as utils from '../src/utils.js'; +import {uspDataHandler} from '../src/adapterManager.js'; + +const MODULE_NAME = 'publinkId'; +const GVLID = 24; +const PUBLINK_COOKIE = '_publink'; +const PUBLINK_S2S_COOKIE = '_publink_srv'; + +export const storage = getStorageManager(GVLID); + +function publinkIdUrl(params, consentData) { + let url = utils.parseUrl('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink'); + url.search = { + deh: params.e, + mpn: 'Prebid.js', + mpv: '$prebid.version$', + }; + if (consentData) { + url.search.gdpr = (consentData.gdprApplies) ? 1 : 0; + url.search.gdpr_consent = consentData.consentString; + } + + const usPrivacyString = uspDataHandler.getConsentData(); + if (usPrivacyString && typeof usPrivacyString === 'string') { + url.search.us_privacy = usPrivacyString; + } + + return utils.buildUrl(url); +} + +function makeCallback(config = {}, consentData) { + return function(prebidCallback) { + const options = {method: 'GET', withCredentials: true}; + let handleResponse = function(responseText, xhr) { + if (xhr.status === 200) { + let response = JSON.parse(responseText); + if (response) { + prebidCallback(response.publink); + } + } + }; + if (config.params && config.params.e) { + ajax(publinkIdUrl(config.params, consentData), handleResponse, undefined, options); + } + }; +} + +function getlocalValue() { + let result; + function getData(key) { + let value; + if (storage.hasLocalStorage()) { + value = storage.getDataFromLocalStorage(key); + } + if (!value) { + value = storage.getCookie(key); + } + + if (typeof value === 'string') { + try { + const obj = JSON.parse(value); + if (obj && obj.exp && obj.exp > Date.now()) { + return obj.publink; + } + } catch (e) { + utils.logError(e); + } + } + } + result = getData(PUBLINK_S2S_COOKIE); + if (!result) { + result = getData(PUBLINK_COOKIE); + } + return result; +} + +/** @type {Submodule} */ +export const publinkIdSubmodule = { + /** + * used to link submodule with config + * @type {string} + */ + name: MODULE_NAME, + gvlid: GVLID, + + /** + * decode the stored id value for passing to bid requests + * @function + * @param {string} id encrypted userid + * @returns {{publinkId: string} | undefined} + */ + decode(publinkId) { + return {publink: publinkId}; + }, + + /** + * performs action to obtain id + * Use a publink cookie first if it is present, otherwise use prebids copy, if neither are available callout to get a new id + * @function + * @param {SubmoduleConfig} [config] Config object with params and storage properties + * @returns {IdResponse} + */ + getId: function(config, consentData, storedId) { + const localValue = getlocalValue(); + if (localValue) { + return {id: localValue}; + } + if (!storedId) { + return {callback: makeCallback(config, consentData)}; + } + } +}; +submodule('userId', publinkIdSubmodule); diff --git a/modules/publinkIdSystem.md b/modules/publinkIdSystem.md new file mode 100644 index 00000000000..669828322a5 --- /dev/null +++ b/modules/publinkIdSystem.md @@ -0,0 +1,28 @@ +## Publink User ID Submodule + +Publink user id module + +## Configuration Descriptions for the `userId` Configuration Section + +| Param Name | Required | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Yes | String | module identifier | `"publinkId"` | +| params.e | Yes | String | hashed email address | `"e80b5017098950fc58aad83c8c14978e"` | + +### Example configuration for Publink +``` +pbjs.setConfig({ + userSync: { + userIds: [{ + name: "publinkId", + storage: { + name: "pbjs_publink", + type: "html5" + }, + params: { + e: "e80b5017098950fc58aad83c8c14978e", // example hashed email (md5) + } + }], + } + }); +``` diff --git a/modules/userId/eids.js b/modules/userId/eids.js index f6707f211d2..0a8e94883b4 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -228,6 +228,10 @@ const USER_IDS_CONFIG = { source: 'amxrtb.com', atype: 1, }, + 'publinkId': { + source: 'epsilon.com', + atype: 3 + }, 'kpuid': { source: 'kpuid.com', atype: 3 diff --git a/test/spec/modules/publinkIdSystem_spec.js b/test/spec/modules/publinkIdSystem_spec.js new file mode 100644 index 00000000000..326285709f3 --- /dev/null +++ b/test/spec/modules/publinkIdSystem_spec.js @@ -0,0 +1,136 @@ +import {publinkIdSubmodule} from 'modules/publinkIdSystem.js'; +import {getStorageManager} from '../../../src/storageManager'; +import {server} from 'test/mocks/xhr.js'; +import sinon from 'sinon'; +import {uspDataHandler} from '../../../src/adapterManager'; + +export const storage = getStorageManager(24); +const TEST_COOKIE_VALUE = 'cookievalue'; +describe('PublinkIdSystem', () => { + describe('decode', () => { + it('decode', () => { + const result = publinkIdSubmodule.decode(TEST_COOKIE_VALUE); + expect(result).deep.equals({publink: TEST_COOKIE_VALUE}); + }); + }); + + describe('Fetch Local Cookies', () => { + const PUBLINK_COOKIE = '_publink'; + const PUBLINK_SRV_COOKIE = '_publink_srv'; + const EXP = Date.now() + 60 * 60 * 24 * 7 * 1000; + const COOKIE_VALUE = {publink: 'publinkCookieValue', exp: EXP}; + const LOCAL_VALUE = {publink: 'publinkLocalStorageValue', exp: EXP}; + const COOKIE_EXPIRATION = (new Date(Date.now() + 60 * 60 * 24 * 1000)).toUTCString(); + const DELETE_COOKIE = 'Thu, 01 Jan 1970 00:00:01 GMT'; + it('publink srv cookie', () => { + storage.setCookie(PUBLINK_SRV_COOKIE, JSON.stringify(COOKIE_VALUE), COOKIE_EXPIRATION); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(COOKIE_VALUE.publink); + storage.setCookie(PUBLINK_SRV_COOKIE, '', DELETE_COOKIE); + }); + it('publink srv local storage', () => { + storage.setDataInLocalStorage(PUBLINK_SRV_COOKIE, JSON.stringify(LOCAL_VALUE)); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(LOCAL_VALUE.publink); + storage.removeDataFromLocalStorage(PUBLINK_SRV_COOKIE); + }); + it('publink cookie', () => { + storage.setCookie(PUBLINK_COOKIE, JSON.stringify(COOKIE_VALUE), COOKIE_EXPIRATION); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(COOKIE_VALUE.publink); + storage.setCookie(PUBLINK_COOKIE, '', DELETE_COOKIE); + }); + it('publink local storage', () => { + storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify(LOCAL_VALUE)); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(LOCAL_VALUE.publink); + storage.removeDataFromLocalStorage(PUBLINK_COOKIE); + }); + it('ignore expired cookie', () => { + storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify({publink: 'value', exp: Date.now() - 60 * 60 * 24 * 1000})); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.be.undefined; + storage.removeDataFromLocalStorage(PUBLINK_COOKIE); + }); + it('priority goes to publink_srv cookie', () => { + storage.setCookie(PUBLINK_SRV_COOKIE, JSON.stringify(COOKIE_VALUE), COOKIE_EXPIRATION); + storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify(LOCAL_VALUE)); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(COOKIE_VALUE.publink); + storage.setCookie(PUBLINK_SRV_COOKIE, '', DELETE_COOKIE); + storage.removeDataFromLocalStorage(PUBLINK_COOKIE); + }); + }); + + describe('getId', () => { + const serverResponse = {publink: 'ec0xHT3yfAOnykP64Qf0ORSi7LjNT1wju04ZSCsoPBekOJdBwK-0Zl_lXKDNnzhauC4iszBc-PvA1Be6IMlh1QocA'}; + it('no config', () => { + const result = publinkIdSubmodule.getId(); + expect(result).to.exist; + expect(result.callback).to.be.a('function'); + }); + it('Use local copy', () => { + const result = publinkIdSubmodule.getId({}, undefined, TEST_COOKIE_VALUE); + expect(result).to.be.undefined; + }); + + describe('callout for id', () => { + let callbackSpy = sinon.spy(); + + beforeEach(() => { + callbackSpy.resetHistory(); + }); + + it('Fetch with consent data', () => { + const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + const consentData = {gdprApplies: 1, consentString: 'myconsentstring'}; + let submoduleCallback = publinkIdSubmodule.getId(config, consentData).callback; + submoduleCallback(callbackSpy); + + let request = server.requests[0]; + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&gdpr=1&gdpr_consent=myconsentstring'); + + request.respond(200, {}, JSON.stringify(serverResponse)); + expect(callbackSpy.calledOnce).to.be.true; + expect(callbackSpy.lastCall.lastArg).to.equal(serverResponse.publink); + }); + + it('server doesnt respond', () => { + const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + let submoduleCallback = publinkIdSubmodule.getId(config).callback; + submoduleCallback(callbackSpy); + + let request = server.requests[0]; + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$'); + + request.respond(204, {}, JSON.stringify(serverResponse)); + expect(callbackSpy.calledOnce).to.be.false; + }); + }); + + describe('usPrivacy', () => { + let callbackSpy = sinon.spy(); + const oldPrivacy = uspDataHandler.getConsentData(); + before(() => { + uspDataHandler.setConsentData('1YNN'); + }); + after(() => { + uspDataHandler.setConsentData(oldPrivacy); + callbackSpy.resetHistory(); + }); + + it('Fetch with usprivacy data', () => { + const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + let submoduleCallback = publinkIdSubmodule.getId(config).callback; + submoduleCallback(callbackSpy); + + let request = server.requests[0]; + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&us_privacy=1YNN'); + + request.respond(200, {}, JSON.stringify(serverResponse)); + expect(callbackSpy.calledOnce).to.be.true; + expect(callbackSpy.lastCall.lastArg).to.equal(serverResponse.publink); + }); + }); + }); +}); From e8b344dac65a3600b7d4ff058c9701a830c90334 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Wed, 8 Sep 2021 13:04:32 -0700 Subject: [PATCH 037/250] If the bidReq has gam adslot use it (#7374) --- modules/priceFloors.js | 8 ++- test/spec/integration/faker/googletag.js | 5 ++ test/spec/modules/priceFloors_spec.js | 79 ++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/modules/priceFloors.js b/modules/priceFloors.js index 3555fedbf3a..5f7a39e0784 100644 --- a/modules/priceFloors.js +++ b/modules/priceFloors.js @@ -64,13 +64,19 @@ function getHostNameFromReferer(referer) { return referrerHostname; } +// First look into bidRequest! +function getGptSlotFromBidRequest(bidRequest) { + const isGam = utils.deepAccess(bidRequest, 'ortb2Imp.ext.data.adserver.name') === 'gam'; + return isGam && bidRequest.ortb2Imp.ext.data.adserver.adslot; +} + /** * @summary floor field types with their matching functions to resolve the actual matched value */ export let fieldMatchingFunctions = { 'size': (bidRequest, bidResponse) => utils.parseGPTSingleSizeArray(bidResponse.size) || '*', 'mediaType': (bidRequest, bidResponse) => bidResponse.mediaType || 'banner', - 'gptSlot': (bidRequest, bidResponse) => utils.getGptSlotInfoForAdUnitCode(bidRequest.adUnitCode).gptSlot, + 'gptSlot': (bidRequest, bidResponse) => getGptSlotFromBidRequest(bidRequest) || utils.getGptSlotInfoForAdUnitCode(bidRequest.adUnitCode).gptSlot, 'domain': (bidRequest, bidResponse) => referrerHostname || getHostNameFromReferer(getRefererInfo().referer), 'adUnitCode': (bidRequest, bidResponse) => bidRequest.adUnitCode } diff --git a/test/spec/integration/faker/googletag.js b/test/spec/integration/faker/googletag.js index 9d91bf315d9..1d1a7512153 100644 --- a/test/spec/integration/faker/googletag.js +++ b/test/spec/integration/faker/googletag.js @@ -91,4 +91,9 @@ export function disable() { window.googletag = undefined; } +export function reset() { + disable(); + enable(); +} + enable(); diff --git a/test/spec/modules/priceFloors_spec.js b/test/spec/modules/priceFloors_spec.js index 548d2789d3e..b3105dafc39 100644 --- a/test/spec/modules/priceFloors_spec.js +++ b/test/spec/modules/priceFloors_spec.js @@ -15,6 +15,7 @@ import { allowedFields } from 'modules/priceFloors.js'; import events from 'src/events.js'; +import * as mockGpt from '../integration/faker/googletag.js'; describe('the price floors module', function () { let logErrorSpy; @@ -398,6 +399,84 @@ describe('the price floors module', function () { matchingFloor: 5.0 }); }); + describe('with gpt enabled', function () { + let gptFloorData; + beforeEach(function () { + gptFloorData = { + currency: 'USD', + schema: { + fields: ['gptSlot'] + }, + values: { + '/12345/sports/soccer': 1.1, + '/12345/sports/basketball': 2.2, + '/12345/news/politics': 3.3, + '/12345/news/weather': 4.4, + '*': 5.5, + }, + default: 0.5 + }; + // reset it so no lingering stuff from other test specs + mockGpt.reset(); + mockGpt.makeSlot({ + code: '/12345/sports/soccer', + divId: 'test_div_1' + }); + mockGpt.makeSlot({ + code: '/12345/sports/basketball', + divId: 'test_div_2' + }); + }); + afterEach(function () { + // reset it so no lingering stuff from other test specs + mockGpt.reset(); + }); + it('picks the right rule when looking for gptSlot', function () { + expect(getFirstMatchingFloor(gptFloorData, basicBidRequest)).to.deep.equal({ + floorMin: 0, + floorRuleValue: 1.1, + matchingFloor: 1.1, + matchingData: '/12345/sports/soccer', + matchingRule: '/12345/sports/soccer' + }); + + let newBidRequest = { ...basicBidRequest, adUnitCode: 'test_div_2' } + expect(getFirstMatchingFloor(gptFloorData, newBidRequest)).to.deep.equal({ + floorMin: 0, + floorRuleValue: 2.2, + matchingFloor: 2.2, + matchingData: '/12345/sports/basketball', + matchingRule: '/12345/sports/basketball' + }); + }); + it('picks the gptSlot from the bidRequest and does not call the slotMatching', function () { + const newBidRequest1 = { ...basicBidRequest }; + utils.deepSetValue(newBidRequest1, 'ortb2Imp.ext.data.adserver', { + name: 'gam', + adslot: '/12345/news/politics' + }) + expect(getFirstMatchingFloor(gptFloorData, newBidRequest1)).to.deep.equal({ + floorMin: 0, + floorRuleValue: 3.3, + matchingFloor: 3.3, + matchingData: '/12345/news/politics', + matchingRule: '/12345/news/politics' + }); + + const newBidRequest2 = { ...basicBidRequest, adUnitCode: 'test_div_2' }; + utils.deepSetValue(newBidRequest2, 'ortb2Imp.ext.data.adserver', { + name: 'gam', + adslot: '/12345/news/weather' + }) + expect(getFirstMatchingFloor(gptFloorData, newBidRequest2)).to.deep.equal({ + floorMin: 0, + floorRuleValue: 4.4, + matchingFloor: 4.4, + matchingData: '/12345/news/weather', + matchingRule: '/12345/news/weather' + }); + }); + }); }); describe('pre-auction tests', function () { let exposedAdUnits; From 5e2dcbd6a046c1247dc0ffe4fec0910f7a7b8637 Mon Sep 17 00:00:00 2001 From: Kajan Umakanthan Date: Thu, 9 Sep 2021 08:07:49 -0700 Subject: [PATCH 038/250] IX Bid Adapter: Adding support for IX Outstream Renderer (#7390) * add ix renderer support * add unit tests * lint fix --- modules/ixBidAdapter.js | 62 +++++++++++++++++++++++--- test/spec/modules/ixBidAdapter_spec.js | 40 +++++++++++------ 2 files changed, 83 insertions(+), 19 deletions(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index ab9c995aa7c..8f821e87911 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -5,6 +5,7 @@ import find from 'core-js-pure/features/array/find.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { INSTREAM, OUTSTREAM } from '../src/video.js'; import includes from 'core-js-pure/features/array/includes.js'; +import { Renderer } from '../src/Renderer.js'; const BIDDER_CODE = 'ix'; const ALIAS_BIDDER_CODE = 'roundel'; @@ -24,7 +25,7 @@ const PRICE_TO_DOLLAR_FACTOR = { JPY: 1 }; const USER_SYNC_URL = 'https://js-sec.indexww.com/um/ixmatch.html'; - +const RENDERER_URL = 'https://js-sec.indexww.com/htv/video-player.js'; const FLOOR_SOURCE = { PBJS: 'p', IX: 'x' }; // determines which eids we send and the rtiPartner field in ext @@ -267,6 +268,7 @@ function parseBid(rawBid, currency, bidRequest) { bid.width = bidRequest.video.w; bid.height = bidRequest.video.h; bid.mediaType = VIDEO; + bid.mediaTypes = bidRequest.mediaTypes; bid.ttl = isValidExpiry ? rawBid.exp : VIDEO_TIME_TO_LIVE; } else { bid.ad = rawBid.adm; @@ -385,17 +387,22 @@ function isValidBidFloorParams(bidFloor, bidFloorCur) { } /** - * Finds the impression with the associated id. + * Get bid request object with the associated id. * * @param {*} id Id of the impression. * @param {array} impressions List of impressions sent in the request. * @return {object} The impression with the associated id. */ -function getBidRequest(id, impressions) { +function getBidRequest(id, impressions, validBidRequests) { if (!id) { return; } - return find(impressions, imp => imp.id === id); + const bidRequest = { + ...find(validBidRequests, bid => bid.bidId === id), + ...find(impressions, imp => imp.id === id) + } + + return bidRequest; } /** @@ -718,7 +725,8 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { requests.push({ method: 'GET', url: baseUrl, - data: clonedPayload + data: clonedPayload, + validBidRequests }); currentRequestSize = baseRequestSize; @@ -930,6 +938,43 @@ function createMissingBannerImp(bid, imp, newSize) { return newImp; } +/** + * Initialize Outstream Renderer + * @param {Object} bid + */ +function outstreamRenderer (bid) { + bid.renderer.push(() => { + var config = { + width: bid.width, + height: bid.height, + timeout: 3000 + }; + + window.IXOutstreamPlayer(bid.vastUrl, bid.adUnitCode, config); + }); +} + +/** + * Create Outstream Renderer + * @param {string} id + * @returns {Renderer} + */ +function createRenderer (id) { + const renderer = Renderer.install({ + id: id, + url: RENDERER_URL, + loaded: false + }); + + try { + renderer.setRender(outstreamRenderer); + } catch (err) { + utils.logWarn('Prebid Error calling setRender on renderer', err); + } + + return renderer; +} + export const spec = { code: BIDDER_CODE, @@ -1108,8 +1153,13 @@ export const spec = { let requestBid = JSON.parse(bidderRequest.data.r); for (let j = 0; j < innerBids.length; j++) { - const bidRequest = getBidRequest(innerBids[j].impid, requestBid.imp); + const bidRequest = getBidRequest(innerBids[j].impid, requestBid.imp, bidderRequest.validBidRequests); bid = parseBid(innerBids[j], responseBody.cur, bidRequest); + + if (!utils.deepAccess(bid, 'mediaTypes.video.renderer') && utils.deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + bid.mediaTypes.video.renderer = createRenderer(innerBids[j].bidId); + } + bids.push(bid); } } diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 85236571383..6eff922536f 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -1233,7 +1233,7 @@ describe('IndexexchangeAdapter', function () { }); describe('First party data', function () { - afterEach(function() { + afterEach(function () { config.setConfig({ ortb2: {} }) @@ -2129,7 +2129,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0]).to.deep.equal(expectedParse[0]); }); @@ -2153,7 +2153,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE_WITHOUT_ADOMAIN }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0]).to.deep.equal(expectedParse[0]); }); @@ -2180,7 +2180,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); }); it('should set Japanese price correctly', function () { @@ -2206,7 +2206,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0]).to.deep.equal(expectedParse[0]); }); @@ -2235,7 +2235,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0].dealId).to.equal(expectedParse[0].dealId); }); @@ -2262,7 +2262,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0]).to.deep.equal(expectedParse[0]); }); @@ -2290,7 +2290,7 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: bidResponse }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(result[0].dealId).to.deep.equal(expectedParse[0].dealId); }); @@ -2301,6 +2301,17 @@ describe('IndexexchangeAdapter', function () { cpm: 1.1, creativeId: '12346', mediaType: 'video', + mediaTypes: { + video: { + context: 'instream', + playerSize: [ + [ + 400, + 100 + ] + ] + } + }, width: 640, height: 480, currency: 'USD', @@ -2315,7 +2326,10 @@ describe('IndexexchangeAdapter', function () { } } ]; - const result = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const result = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE }, { + data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: ONE_VIDEO + }); + expect(result[0]).to.deep.equal(expectedParse[0]); }); @@ -2357,16 +2371,16 @@ describe('IndexexchangeAdapter', function () { const VIDEO_RESPONSE_WITH_EXP = utils.deepClone(DEFAULT_VIDEO_BID_RESPONSE); VIDEO_RESPONSE_WITH_EXP.seatbid[0].bid[0].exp = 200; BANNER_RESPONSE_WITH_EXP.seatbid[0].bid[0].exp = 100; - const bannerResult = spec.interpretResponse({ body: BANNER_RESPONSE_WITH_EXP }, { data: DEFAULT_BIDDER_REQUEST_DATA }); - const videoResult = spec.interpretResponse({ body: VIDEO_RESPONSE_WITH_EXP }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const bannerResult = spec.interpretResponse({ body: BANNER_RESPONSE_WITH_EXP }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); + const videoResult = spec.interpretResponse({ body: VIDEO_RESPONSE_WITH_EXP }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(bannerResult[0].ttl).to.equal(100); expect(videoResult[0].ttl).to.equal(200); }); it('should default bid[].ttl if seat[].bid[].exp is not in the resposne', function () { - const bannerResult = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); - const videoResult = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA }); + const bannerResult = spec.interpretResponse({ body: DEFAULT_BANNER_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); + const videoResult = spec.interpretResponse({ body: DEFAULT_VIDEO_BID_RESPONSE }, { data: DEFAULT_BIDDER_REQUEST_DATA, validBidRequests: [] }); expect(bannerResult[0].ttl).to.equal(300); expect(videoResult[0].ttl).to.equal(3600); From 5e0e47391d7d989dd9493b15aefd06b2f3754195 Mon Sep 17 00:00:00 2001 From: JonGoSonobi Date: Thu, 9 Sep 2021 11:38:13 -0400 Subject: [PATCH 039/250] A publisher requested that we remove the bid.ad value for outstream since we provide the vastUrl (#7394) --- modules/sonobiBidAdapter.js | 1 + test/spec/modules/sonobiBidAdapter_spec.js | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 2edcdca1a51..01966f3d6b1 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -230,6 +230,7 @@ export const spec = { delete bids.width; delete bids.height; } else if (mediaType === 'outstream' && bidRequest) { + delete bids.ad; // Some pubs expect bids.ad to be a vast xml structure, we have a vatUrl so lets delete this. bids.mediaType = 'video'; bids.vastUrl = createCreative(bidResponse.sbi_dc, bid.sbi_aid); bids.renderer = newRenderer(bidRequest.adUnitCode, bids, deepAccess( diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index 8eee973794a..05ba3f0897b 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -752,6 +752,7 @@ describe('SonobiBidAdapter', function () { expect(resp.width).to.equal(prebidResponse[i].width); expect(resp.height).to.equal(prebidResponse[i].height); expect(resp.renderer).to.be.ok; + expect(resp.ad).to.equal(undefined); } else if (resp.mediaType === 'video') { expect(resp.vastUrl.indexOf('vast.xml')).to.be.greaterThan(0); expect(resp.ad).to.be.undefined; From 545d9031c108c5ae4a924707e216498769ea1ade Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 9 Sep 2021 18:08:29 +0200 Subject: [PATCH 040/250] BLIINK Bid Adapter : Add new adapter (#7299) * feat(adapter): Add bliink bid adapter * feat(tests): Add tests unit file * refactor: code optimisation and fix cookie sync * fix(bliinkAdapter): get meta value Co-authored-by: Jonathan Co-authored-by: samuel.kerboeuf --- modules/bliinkBidAdapter.js | 309 ++++++++++++ modules/bliinkBidAdapter.md | 71 +++ test/spec/modules/bliinkBidAdapter_spec.js | 559 +++++++++++++++++++++ 3 files changed, 939 insertions(+) create mode 100644 modules/bliinkBidAdapter.js create mode 100644 modules/bliinkBidAdapter.md create mode 100644 test/spec/modules/bliinkBidAdapter_spec.js diff --git a/modules/bliinkBidAdapter.js b/modules/bliinkBidAdapter.js new file mode 100644 index 00000000000..2f4cb9beac6 --- /dev/null +++ b/modules/bliinkBidAdapter.js @@ -0,0 +1,309 @@ +// eslint-disable-next-line prebid/validate-imports +// eslint-disable-next-line prebid/validate-imports +import {registerBidder} from 'src/adapters/bidderFactory.js' + +export const BIDDER_CODE = 'bliink' +export const BLIINK_ENDPOINT_ENGINE = 'https://engine.bliink.io/delivery' +export const BLIINK_ENDPOINT_ENGINE_VAST = 'https://engine.bliink.io/vast' +export const BLIINK_ENDPOINT_COOKIE_SYNC = 'https://cookiesync.api.bliink.io' +export const META_KEYWORDS = 'keywords' +export const META_DESCRIPTION = 'description' + +const VIDEO = 'video' +const NATIVE = 'native' +const BANNER = 'banner' + +const supportedMediaTypes = [BANNER, VIDEO, NATIVE] +const aliasBidderCode = ['bk'] + +export function getMetaList(name) { + if (!name || name.length === 0) return [] + + return [ + { + key: 'name', + value: name, + }, + { + key: 'name*', + value: name, + }, + { + key: 'itemprop*', + value: name, + }, + { + key: 'property', + value: `'og:${name}'`, + }, + { + key: 'property', + value: `'twitter:${name}'`, + }, + { + key: 'property', + value: `'article:${name}'`, + }, + ] +} + +export function getOneMetaValue(query) { + const metaEl = document.querySelector(query) + + if (metaEl && metaEl.content) { + return metaEl.content + } + + return null +} + +export function getMetaValue(name) { + const metaList = getMetaList(name) + for (let i = 0; i < metaList.length; i++) { + const meta = metaList[i]; + const metaValue = getOneMetaValue(`meta[${meta.key}=${meta.value}]`); + if (metaValue) { + return metaValue + } + } + return '' +} + +export function getKeywords() { + const metaKeywords = getMetaValue(META_KEYWORDS) + if (metaKeywords) { + const keywords = [ + ...metaKeywords.split(','), + ] + + if (keywords && keywords.length > 0) { + return keywords + .filter((value) => value) + .map((value) => value.trim()) + } + } + + return [] +} + +export const parseXML = (content) => { + if (typeof content !== 'string' || content.length === 0) return null + + const parser = new DOMParser() + const xml = parser.parseFromString(content, 'text/xml') + + if (xml && + xml.getElementsByTagName('VAST')[0] && + xml.getElementsByTagName('VAST')[0].tagName === 'VAST') { + return xml + } + + return null +} + +/** + * @param bidRequest + * @param bliinkCreative + * @return {{cpm, netRevenue: boolean, ad: string, requestId, width: number, currency: string, mediaType: string, vastXml, ttl: number, height: number}|null} + */ +export const buildBid = (bidRequest, bliinkCreative) => { + if (!bidRequest && !bliinkCreative) return null + + const body = { + requestId: bidRequest.bidId, + cpm: bliinkCreative.price, + creativeId: bliinkCreative.creativeId, + currency: 'EUR', + netRevenue: false, + width: 1, + height: 1, + ttl: 3600, + } + + // eslint-disable-next-line no-mixed-operators + if ((bliinkCreative) && bidRequest && + // eslint-disable-next-line no-mixed-operators + !bidRequest.bidId || + !bidRequest.sizes || + !bidRequest.params || + !(bidRequest.params.placement) + ) return null + + delete bidRequest['bids'] + + return Object.assign(body, { + currency: bliinkCreative.currency, + width: 1, + height: 1, + mediaType: VIDEO, + ad: '', + vastXml: bliinkCreative.content, + }) +} + +/** + * @description Verify the the AdUnits.bids, respond with true (valid) or false (invalid). + * + * @param bid + * @return boolean + */ +export const isBidRequestValid = (bid) => { + return !(!bid || !bid.params || !bid.params.placement || !bid.params.tagId) +} + +/** + * @description Takes an array of valid bid requests, all of which are guaranteed to have passed the isBidRequestValid() test. + * + * @param _[] + * @param bidderRequest + * @return {{ method: string, url: string } | null} + */ +export const buildRequests = (_, bidderRequest) => { + if (!bidderRequest) return null + + let data = { + pageUrl: bidderRequest.refererInfo.referer, + pageDescription: getMetaValue(META_DESCRIPTION), + keywords: getKeywords().join(','), + pageTitle: document.title, + } + + const endPoint = bidderRequest.bids[0].params.placement === VIDEO ? BLIINK_ENDPOINT_ENGINE_VAST : BLIINK_ENDPOINT_ENGINE + + const params = { + bidderRequestId: bidderRequest.bidderRequestId, + bidderCode: bidderRequest.bidderCode, + bids: bidderRequest.bids, + refererInfo: bidderRequest.refererInfo, + } + + if (bidderRequest.gdprConsent) { + data = Object.assign(data, { + gdpr: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies, + gdpr_consent: bidderRequest.gdprConsent.consentString + }) + } + + if (bidderRequest.bids && bidderRequest.bids.length > 0 && bidderRequest.bids[0].sizes && bidderRequest.bids[0].sizes[0]) { + data = Object.assign(data, { + width: bidderRequest.bids[0].sizes[0][0], + height: bidderRequest.bids[0].sizes[0][1] + }) + + return { + method: 'GET', + url: `${endPoint}/${bidderRequest.bids[0].params.tagId}`, + data: data, + params: params, + } + } + + return null +} + +/** + * @description Parse the response (from buildRequests) and generate one or more bid objects. + * + * @param serverResponse + * @param request + * @return + */ +const interpretResponse = (serverResponse, request) => { + if ((serverResponse && serverResponse.mode === 'no-ad') && (!request.params)) { + return [] + } + + const body = serverResponse.body + const serverBody = request.params + + const xml = parseXML(body) + + if (xml) { + const price = xml.getElementsByTagName('Price') && xml.getElementsByTagName('Price')[0] + const currency = xml.getElementsByTagName('Currency') && xml.getElementsByTagName('Currency')[0] + const creativeId = xml.getElementsByTagName('CreativeId') && xml.getElementsByTagName('CreativeId')[0] + + const creative = { + content: body, + price: (price && price.textContent) || 0, + currency: (currency && currency.textContent) || 'EUR', + creativeId: creativeId || 0, + media_type: 'video', + } + + return buildBid(serverBody.bids[0], creative); + } + + return [] +} + +/** + * @description If the publisher allows user-sync activity, the platform will call this function and the adapter may register pixels and/or iframe user syncs. For more information, see Registering User Syncs below + * @param syncOptions + * @param serverResponses + * @param gdprConsent + * @return {[{type: string, url: string}]|*[]} + */ +const getUserSyncs = (syncOptions, serverResponses, gdprConsent) => { + let syncs = [] + + if (syncOptions.pixelEnabled && serverResponses.length > 0) { + if (gdprConsent) { + const gdprParams = `consentString=${gdprConsent.consentString}` + const smartCallbackURL = encodeURIComponent(`${BLIINK_ENDPOINT_COOKIE_SYNC}/cookiesync?partner=smart&uid=[sas_uid]`) + const azerionCallbackURL = encodeURIComponent(`${BLIINK_ENDPOINT_COOKIE_SYNC}/cookiesync?partner=azerion&uid={PUB_USER_ID}`) + const appnexusCallbackURL = encodeURIComponent(`${BLIINK_ENDPOINT_COOKIE_SYNC}/cookiesync?partner=azerion&uid=$UID`) + return [ + { + type: 'script', + url: 'https://prg.smartadserver.com/ac?out=js&nwid=3392&siteid=305791&pgname=rg&fmtid=81127&tgt=[sas_target]&visit=m&tmstp=[timestamp]&clcturl=[countgo]' + }, + { + type: 'image', + url: `https://sync.smartadserver.com/getuid?nwid=3392&${gdprParams}&url=${smartCallbackURL}`, + }, + { + type: 'image', + url: `https://ad.360yield.com/server_match?partner_id=1531&${gdprParams}&r=${azerionCallbackURL}`, + }, + { + type: 'image', + url: `https://ads.stickyadstv.com/auto-user-sync?${gdprParams}`, + }, + { + type: 'image', + url: `https://cookiesync.api.bliink.io/getuid?url=https%3A%2F%2Fvisitor.omnitagjs.com%2Fvisitor%2Fsync%3Fuid%3D1625272249969090bb9d544bd6d8d645%26name%3DBLIINK%26visitor%3D%24UID%26external%3Dtrue&${gdprParams}`, + }, + { + type: 'image', + url: `https://cookiesync.api.bliink.io/getuid?url=https://pixel.advertising.com/ups/58444/sync?&gdpr=1&gdpr_consent=${gdprConsent.consentString}&redir=true&uid=$UID`, + }, + { + type: 'image', + url: `https://ups.analytics.yahoo.com/ups/58499/occ?gdpr=1&gdpr_consent=${gdprConsent.consentString}`, + }, + { + type: 'image', + url: `https://secure.adnxs.com/getuid?${appnexusCallbackURL}`, + }, + ] + } + } + + return syncs; +} + +/** + * @type {{interpretResponse: interpretResponse, code: string, aliases: string[], getUserSyncs: getUserSyncs, buildRequests: buildRequests, onTimeout: onTimeout, onSetTargeting: onSetTargeting, isBidRequestValid: isBidRequestValid, onBidWon: onBidWon}} + */ +export const spec = { + code: BIDDER_CODE, + aliases: aliasBidderCode, + supportedMediaTypes: supportedMediaTypes, + isBidRequestValid, + buildRequests, + interpretResponse, + getUserSyncs, +} + +registerBidder(spec) diff --git a/modules/bliinkBidAdapter.md b/modules/bliinkBidAdapter.md new file mode 100644 index 00000000000..ae0d4275396 --- /dev/null +++ b/modules/bliinkBidAdapter.md @@ -0,0 +1,71 @@ +# Overview + +``` +Module Name: BLIINK Bidder Adapter +Module Type: Bidder Adapter +Maintainer: samuel@bliink.io | jonathan@bliink.io +gdpr_supported: true +tcf2_supported: true +media_types: banner, native, video +``` + +# Description + +Module that connects to BLIINK demand sources to fetch bids. + +# Test Parameters + +## Sample Banner Ad Unit + +```js +const adUnits = [ + { + code: '/19968336/test', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + bids: [ + { + bidder: 'bliink', + params: { + placement: 'banner', + tagId: '14f30eca-85d2-11e8-9eed-0242ac120007' + } + } + ] + } +] +``` + +## Sample Instream Video Ad Unit + +```js +const adUnits = [ + { + code: '/19968336/prebid_cache_video_adunit', + sizes: [[640,480]], + mediaType: 'video', + mediaTypes: { + video: { + context: 'instream', + playerSize: [640, 480], + mimes: ['video/mp4'], + protocols: [1, 2, 3, 4, 5, 6, 7, 8], + playbackmethod: [2], + skip: 1 + } + }, + bids: [ + { + bidder: 'bliink', + params: { + tagId: '41', + placement: 'video', + } + } + ] + } +] +``` diff --git a/test/spec/modules/bliinkBidAdapter_spec.js b/test/spec/modules/bliinkBidAdapter_spec.js new file mode 100644 index 00000000000..4fbd0978552 --- /dev/null +++ b/test/spec/modules/bliinkBidAdapter_spec.js @@ -0,0 +1,559 @@ +import { expect } from 'chai' +import { spec, buildBid, BLIINK_ENDPOINT_ENGINE, parseXML, getMetaList } from 'modules/bliinkBidAdapter.js' + +/** + * @description Mockup bidRequest + * @return {{ + * bidderWinsCount: number, + * adUnitCode: string, + * bidder: string, + * src: string, + * bidRequestsCount: number, + * params: {tagId: string, placement: string}, + * bidId: string, + * transactionId: string, + * auctionId: string, + * bidderRequestId: string, + * bidderRequestsCount: number, + * mediaTypes: {banner: {sizes: number[][]}}, + * sizes: number[][], + * crumbs: {pubcid: string}, + * ortb2Imp: {ext: {data: {pbadslot: string}}}}} + */ +const getConfigBid = () => { + return { + adUnitCode: '/19968336/test', + auctionId: '6752b51c-dcd4-4001-85dc-885ab5c504cf', + bidId: '2def0c5b2a7f6e', + bidRequestsCount: 1, + bidder: 'bliink', + bidderRequestId: '1592eb20088b18', + bidderRequestsCount: 1, + bidderWinsCount: 0, + crumbs: { + pubcid: '55ffadc5-051f-428d-8ecc-dc585e0bde0d' + }, + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + } + }, + ortb2Imp: { + ext: { + data: { + pbadslot: '/19968336/test' + } + } + }, + params: { + placement: 'banner', + tagId: '14f30eca-85d2-11e8-9eed-0242ac120007' + }, + sizes: [ + [300, 250] + ], + src: 'client', + transactionId: 'cc6678c4-9746-4082-b9e2-d8065d078ebf' + } +} + +/** + * @description Mockup response from engine.bliink.io/xxxx + * @return { + * { + * viewability_percent_in_view: number, + * viewability_duration: number, + * ad_id: number, + * adm: string, + * id: number, + * category: number, + * type: number + * } +* } + */ +const getConfigCreative = () => { + return { + ad_id: 5648, + adm: '', + price: 1, + currency: 'EUR', + category: 1, + id: 2825, + type: 1, + viewability_duration: 1, + viewability_percent_in_view: 30, + } +} + +const getConfigCreativeVideo = () => { + return { + ad_id: 5648, + price: 1, + currency: 'EUR', + category: 1, + creativeId: 2825, + content: '' + } +} + +/** + * @description Mockup BuildRequest function + * @return {{bidderRequestId: string, bidderCode: string, bids: {bidderWinsCount: number, adUnitCode: string, bidder: string, src: string, bidRequestsCount: number, params: {tagId: string, placement: string}, bidId: string, transactionId: string, auctionId: string, bidderRequestId: string, bidderRequestsCount: number, mediaTypes: {banner: {sizes: number[][]}}, sizes: number[][], crumbs: {pubcid: string}, ortb2Imp: {ext: {data: {pbadslot: string}}}}[], refererInfo: {referer: string, canonicalUrl: null, isAmp: boolean, reachedTop: boolean, numIframes: number}}} + */ +const getConfigBuildRequest = () => { + return { + bidderRequestId: '164ddfd207e94d', + bidderCode: 'bliink', + bids: [getConfigBid()], + params: { + bids: [getConfigBid()], + }, + refererInfo: { + canonicalUrl: null, + isAmp: false, + numIframes: 0, + reachedTop: true, + referer: 'http://localhost:9999/integrationExamples/gpt/bliink-adapter.html?pbjs_debug=true', + }, + } +} + +/** + * @description Mockup response from API + * @param noAd + * @return {{mode: string, message: string}|{headers: {}, body: {mode: string, creative: {viewability_percent_in_view: number, viewability_duration: number, ad_id: number, adm: string, id: number, category: number, type: number}, token: string}}} + */ +const getConfigInterpretResponse = (noAd = false) => { + if (noAd) { + return { + message: 'invalid tag', + mode: 'no-ad' + } + } + + return { + body: { + creative: getConfigCreative(), + mode: 'ad', + token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjgxNzA4MzEsImlhdCI6MTYyNzU2NjAzMSwiaXNzIjoiYmxpaW5rIiwiZGF0YSI6eyJ0eXBlIjoiYWQtc2VydmVyIiwidHJhbnNhY3Rpb25JZCI6IjM1YmU1NDNjLTNkZTQtNGQ1Yy04N2NjLWIzYzEyOGZiYzU0MCIsIm5ldHdvcmtJZCI6MjEsInNpdGVJZCI6NTksInRhZ0lkIjo1OSwiY29va2llSWQiOiJjNGU4MWVhOS1jMjhmLTQwZDItODY1ZC1hNjQzZjE1OTcyZjUiLCJldmVudElkIjozLCJ0YXJnZXRpbmciOnsicGxhdGZvcm0iOiJXZWJzaXRlIiwiaXAiOiI3OC4xMjIuNzUuNzIiLCJ0aW1lIjoxNjI3NTY2MDMxLCJsb2NhdGlvbiI6eyJsYXRpdHVkZSI6NDguOTczOSwibG9uZ2l0dWRlIjozLjMxMTMsInJlZ2lvbiI6IkhERiIsImNvdW50cnkiOiJGUiIsImNpdHkiOiJTYXVsY2hlcnkiLCJ6aXBDb2RlIjoiMDIzMTAiLCJkZXBhcnRtZW50IjoiMDIifSwiY2l0eSI6IlNhdWxjaGVyeSIsImNvdW50cnkiOiJGUiIsImRldmljZU9zIjoibWFjT1MiLCJkZXZpY2VQbGF0Zm9ybSI6IldlYnNpdGUiLCJyYXdVc2VyQWdlbnQiOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV83KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvOTEuMC40NDcyLjEyNCBTYWZhcmkvNTM3LjM2In0sImdkcHIiOnsiaGFzQ29uc2VudCI6dHJ1ZX0sIndpbiI6ZmFsc2UsImFkSWQiOjU2NDgsImFkdmVydGlzZXJJZCI6MSwiY2FtcGFpZ25JZCI6MSwiY3JlYXRpdmVJZCI6MjgyNSwiZXJyb3IiOmZhbHNlfX0.-UefQH4G0k-RJGemBYffs-KL7EEwma2Wuwgk2xnpij8' + }, + headers: {}, + } +} + +/** + * @description Mockup response from API for RTB creative + * @param noAd + * @return {{body: string} | {mode: string, message: string}} + */ +const getConfigInterpretResponseRTB = (noAd = false) => { + if (noAd) { + return { + message: 'invalid tag', + mode: 'no-ad' + } + } + + return { + body: '' + } +} + +/** + * + * + * + * @description Below start tests for utils fonctions + * + * + * + */ + +const testsGetMetaList = [ + { + title: 'Should return empty array if there are no parameters', + args: { + fn: getMetaList() + }, + want: [] + }, + { + title: 'Should return list of metas with name associated', + args: { + fn: getMetaList('test'), + }, + want: [ + { + key: 'name', + value: 'test', + }, + { + key: 'name*', + value: 'test', + }, + { + key: 'itemprop*', + value: 'test', + }, + { + key: 'property', + value: `'og:${'test'}'`, + }, + { + key: 'property', + value: `'twitter:${'test'}'`, + }, + { + key: 'property', + value: `'article:${'test'}'`, + }, + ] + } +] + +describe('BLIINK Adapter getMetaList', function() { + for (const test of testsGetMetaList) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +/** + * @description Array of tests used in describe function below + * @type {[{args: {fn: (string|Document)}, want: string, title: string}, {args: {fn: (string|Document)}, want: string, title: string}]} + */ +const testsParseXML = [ + { + title: 'Should return null, if content length equal to 0', + args: { + fn: parseXML('') + }, + want: null, + }, + { + title: 'Should return null, if content isnt string', + args: { + fn: parseXML({}) + }, + want: null, + }, +] + +describe('BLIINK Adapter parseXML', function() { + for (const test of testsParseXML) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +/** + * + * + * + * @description End tests for utils fonctions + * + * + * + */ + +/** + * @description Array of tests used in describe function below + * @type {[{args: {fn}, want: boolean, title: string}, {args: {fn}, want: boolean, title: string}, {args: {fn}, want: boolean, title: string}]} + */ +const testsIsBidRequestValid = [ + { + title: 'isBidRequestValid format not valid', + args: { + fn: spec.isBidRequestValid({}) + }, + want: false, + }, + { + title: 'isBidRequestValid does not receive any bid', + args: { + fn: spec.isBidRequestValid() + }, + want: false, + }, + { + title: 'isBidRequestValid Receive a valid bid', + args: { + fn: spec.isBidRequestValid(getConfigBid()) + }, + want: true, + } +] + +describe('BLIINK Adapter isBidRequestValid', function() { + for (const test of testsIsBidRequestValid) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +const testsInterpretResponse = [ + { + title: 'Should construct bid for video instream', + args: { + fn: spec.interpretResponse(getConfigInterpretResponseRTB(false), getConfigBuildRequest()) + }, + want: { + ad: '', + cpm: 0, + currency: 'EUR', + height: 1, + width: 1, + creativeId: 0, + mediaType: 'video', + netRevenue: false, + requestId: '2def0c5b2a7f6e', + ttl: 3600, + vastXml: getConfigInterpretResponseRTB().body, + } + }, + { + title: 'ServerResponse with message: invalid tag, return empty array', + args: { + fn: spec.interpretResponse(getConfigInterpretResponse(true), getConfigBuildRequest()) + }, + want: [] + }, +] + +describe('BLIINK Adapter interpretResponse', function() { + for (const test of testsInterpretResponse) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +/** + * @description Array of tests used in describe function below + * @type {[ + * {args: + * {fn: { + * cpm: number, + * netRevenue: boolean, + * ad, requestId, + * meta: {mediaType}, + * width: number, + * currency: string, + * ttl: number, + * creativeId: number, + * height: number + * } + * }, want, title: string}]} + */ +const testsBuildBid = [ + { + title: 'Should return null if no bid passed in parameters', + args: { + fn: buildBid() + }, + want: null + }, + { + title: 'Input data must respect the output model', + args: { + fn: buildBid({ id: 1, test: '123' }, { id: 2, test: '345' }, false, false) + }, + want: null + }, + { + title: 'input data respect the output model for video', + args: { + fn: buildBid(getConfigBid(), getConfigCreativeVideo()) + }, + want: { + requestId: getConfigBid().bidId, + cpm: 1, + currency: 'EUR', + mediaType: 'video', + width: 1, + height: 1, + creativeId: getConfigCreativeVideo().creativeId, + netRevenue: false, + vastXml: getConfigCreativeVideo().content, + ad: getConfigCreative().adm, + ttl: 3600, + } + } +] + +describe('BLIINK Adapter buildBid', function() { + for (const test of testsBuildBid) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +/** + * @description Array of tests used in describe function below + * @type {[{args: {fn}, want, title: string}]} + */ +const testsBuildRequests = [ + { + title: 'Should not build request, no bidder request exist', + args: { + fn: spec.buildRequests() + }, + want: null + }, + { + title: 'Should build request if bidderRequest exist', + args: { + fn: spec.buildRequests([], getConfigBuildRequest()) + }, + want: { + method: 'GET', + url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest().bids[0].params.tagId}`, + params: { + bidderRequestId: getConfigBuildRequest().bidderRequestId, + bidderCode: getConfigBuildRequest().bidderCode, + bids: getConfigBuildRequest().bids, + refererInfo: getConfigBuildRequest().refererInfo + }, + data: { + height: 250, + width: 300, + keywords: '', + pageDescription: '', + pageTitle: '', + pageUrl: 'http://localhost:9999/integrationExamples/gpt/bliink-adapter.html?pbjs_debug=true', + } + } + }, + { + title: 'Should build request width GDPR configuration', + args: { + fn: spec.buildRequests([], Object.assign(getConfigBuildRequest(), { + gdprConsent: { + gdprApplies: true, + consentString: 'XXXX' + }, + })) + }, + want: { + method: 'GET', + url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest().bids[0].params.tagId}`, + params: { + bidderRequestId: getConfigBuildRequest().bidderRequestId, + bidderCode: getConfigBuildRequest().bidderCode, + bids: getConfigBuildRequest().bids, + refererInfo: getConfigBuildRequest().refererInfo + }, + data: { + gdpr: true, + gdpr_consent: 'XXXX', + pageDescription: '', + pageTitle: '', + keywords: '', + pageUrl: 'http://localhost:9999/integrationExamples/gpt/bliink-adapter.html?pbjs_debug=true', + height: 250, + width: 300, + } + } + } +] + +describe('BLIINK Adapter buildRequests', function() { + for (const test of testsBuildRequests) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) + +const getSyncOptions = (pixelEnabled = true, iframeEnabled = 'false') => { + return { + pixelEnabled, + iframeEnabled + } +} + +const getServerResponses = () => { + return [ + { + body: '', + } + ] +} + +const getGdprConsent = () => { + return { + gdprApplies: 1, + consentString: 'XXX' + } +} + +const testsGetUserSyncs = [ + { + title: 'Should not have gdprConsent exist', + args: { + fn: spec.getUserSyncs(getSyncOptions(), getServerResponses(), getGdprConsent()) + }, + want: [ + { + type: 'script', + url: 'https://prg.smartadserver.com/ac?out=js&nwid=3392&siteid=305791&pgname=rg&fmtid=81127&tgt=[sas_target]&visit=m&tmstp=[timestamp]&clcturl=[countgo]' + }, + { + type: 'image', + url: 'https://sync.smartadserver.com/getuid?nwid=3392&consentString=XXX&url=https%3A%2F%2Fcookiesync.api.bliink.io%2Fcookiesync%3Fpartner%3Dsmart%26uid%3D%5Bsas_uid%5D' + }, + { + type: 'image', + url: 'https://ad.360yield.com/server_match?partner_id=1531&consentString=XXX&r=https%3A%2F%2Fcookiesync.api.bliink.io%2Fcookiesync%3Fpartner%3Dazerion%26uid%3D%7BPUB_USER_ID%7D', + }, + { + type: 'image', + url: 'https://ads.stickyadstv.com/auto-user-sync?consentString=XXX', + }, + { + type: 'image', + url: 'https://cookiesync.api.bliink.io/getuid?url=https%3A%2F%2Fvisitor.omnitagjs.com%2Fvisitor%2Fsync%3Fuid%3D1625272249969090bb9d544bd6d8d645%26name%3DBLIINK%26visitor%3D%24UID%26external%3Dtrue&consentString=XXX', + }, + { + type: 'image', + url: 'https://cookiesync.api.bliink.io/getuid?url=https://pixel.advertising.com/ups/58444/sync?&gdpr=1&gdpr_consent=XXX&redir=true&uid=$UID', + }, + { + type: 'image', + url: 'https://ups.analytics.yahoo.com/ups/58499/occ?gdpr=1&gdpr_consent=XXX', + }, + { + type: 'image', + url: 'https://secure.adnxs.com/getuid?https%3A%2F%2Fcookiesync.api.bliink.io%2Fcookiesync%3Fpartner%3Dazerion%26uid%3D%24UID', + }, + ] + }, + { + title: 'Should not have gdpr consent', + args: { + fn: spec.getUserSyncs(getSyncOptions(), getServerResponses()) + }, + want: [] + } +] + +describe('BLIINK Adapter getUserSyncs', function() { + for (const test of testsGetUserSyncs) { + it(test.title, () => { + const res = test.args.fn + expect(res).to.eql(test.want) + }) + } +}) From 5ac1dbff44d7c557e5cedb459e0c84a3741e7b93 Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Thu, 9 Sep 2021 19:01:16 +0200 Subject: [PATCH 041/250] PBjs Core (Targeting): bugfix for issue #7323 adding extra spaces (#7337) --- src/targeting.js | 8 ++++---- test/spec/unit/core/targeting_spec.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/targeting.js b/src/targeting.js index 4bbed7bb758..96692376d82 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -337,7 +337,7 @@ export function newTargeting(auctionManager) { * "div-gpt-ad-1460505748561-0": [{"hb_bidder": ["appnexusAst"]}] * }, * { - * "div-gpt-ad-1460505748561-0": [{"hb_bidder_appnexusAs": ["appnexusAst"]}] + * "div-gpt-ad-1460505748561-0": [{"hb_bidder_appnexusAs": ["appnexusAst", "other"]}] * } * ] * ``` @@ -346,7 +346,7 @@ export function newTargeting(auctionManager) { * { * "div-gpt-ad-1460505748561-0": { * "hb_bidder": "appnexusAst", - * "hb_bidder_appnexusAs": "appnexusAst" + * "hb_bidder_appnexusAs": "appnexusAst,other" * } * } * ``` @@ -360,7 +360,7 @@ export function newTargeting(auctionManager) { [Object.keys(targeting)[0]]: targeting[Object.keys(targeting)[0]] .map(target => { return { - [Object.keys(target)[0]]: target[Object.keys(target)[0]].join(', ') + [Object.keys(target)[0]]: target[Object.keys(target)[0]].join(',') }; }).reduce((p, c) => Object.assign(c, p), {}) }; @@ -634,7 +634,7 @@ export function newTargeting(auctionManager) { return Object.keys(aut) .map(function(key) { - if (utils.isStr(aut[key])) aut[key] = aut[key].split(','); + if (utils.isStr(aut[key])) aut[key] = aut[key].split(',').map(s => s.trim()); if (!utils.isArray(aut[key])) aut[key] = [ aut[key] ]; return { [key]: aut[key] }; }); diff --git a/test/spec/unit/core/targeting_spec.js b/test/spec/unit/core/targeting_spec.js index f83bd2f6635..1064d7c0f7d 100644 --- a/test/spec/unit/core/targeting_spec.js +++ b/test/spec/unit/core/targeting_spec.js @@ -309,10 +309,10 @@ describe('targeting tests', function () { ['string', '2.3', '2.3'], ['number', 2.3, '2.3'], ['boolean', true, 'true'], - ['string-separated', '2.3,4.5', '2.3, 4.5'], - ['array-of-string', ['2.3', '4.5'], '2.3, 4.5'], - ['array-of-number', [2.3, 4.5], '2.3, 4.5'], - ['array-of-boolean', [true, false], 'true, false'] + ['string-separated', '2.3, 4.5', '2.3,4.5'], + ['array-of-string', ['2.3', '4.5'], '2.3,4.5'], + ['array-of-number', [2.3, 4.5], '2.3,4.5'], + ['array-of-boolean', [true, false], 'true,false'] ]; pairs.forEach(([type, value, result]) => { it(`accepts ${type}`, function() { From 71cb998afc4491f7fc7bea5e09b7bcc1cf7ac49f Mon Sep 17 00:00:00 2001 From: anastasya123 <89073753+anastasya123@users.noreply.github.com> Date: Thu, 9 Sep 2021 21:03:14 +0300 Subject: [PATCH 042/250] Between Bid Adapter: add ids (#7316) * between adapter: add ids * between-adapter: update ids --- modules/betweenBidAdapter.js | 19 ++--- test/spec/modules/betweenBidAdapter_spec.js | 95 +++++++++++---------- 2 files changed, 55 insertions(+), 59 deletions(-) diff --git a/modules/betweenBidAdapter.js b/modules/betweenBidAdapter.js index 5a351def958..7ac1e4edf15 100644 --- a/modules/betweenBidAdapter.js +++ b/modules/betweenBidAdapter.js @@ -1,5 +1,5 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; -import { getAdUnitSizes, parseSizesInput, deepAccess } from '../src/utils.js'; +import { getAdUnitSizes, parseSizesInput } from '../src/utils.js'; import { getRefererInfo } from '../src/refererDetection.js'; const BIDDER_CODE = 'between'; @@ -21,7 +21,7 @@ export const spec = { /** * Make a server request from the list of BidRequests. * - * @param {validBidRequests[]} - an array of bids + * @param {validBidRequest?pbjs_debug=trues[]} - an array of bids * @return ServerRequest Info describing the request to the server. */ buildRequests: function(validBidRequests, bidderRequest) { @@ -29,21 +29,21 @@ export const spec = { const gdprConsent = bidderRequest && bidderRequest.gdprConsent; const refInfo = getRefererInfo(); - validBidRequests.forEach(i => { + validBidRequests.forEach((i) => { let params = { + eids: getUsersIds(i), sizes: parseSizesInput(getAdUnitSizes(i)), jst: 'hb', ord: Math.random() * 10000000000000000, tz: getTz(), fl: getFl(), rr: getRr(), - shid: getSharedId(i)('id'), - shid3: getSharedId(i)('third'), s: i.params.s, bidid: i.bidId, transactionid: i.transactionId, auctionid: i.auctionId }; + if (i.params.itu !== undefined) { params.itu = i.params.itu; } @@ -149,13 +149,8 @@ export const spec = { } } -function getSharedId(bid) { - const id = deepAccess(bid, 'userId.sharedid.id'); - const third = deepAccess(bid, 'userId.sharedid.third'); - return function(kind) { - if (kind === 'id') return id || ''; - return third || ''; - } +function getUsersIds({ userIdAsEids }) { + return (userIdAsEids && userIdAsEids.length !== 0) ? userIdAsEids : []; } function getRr() { diff --git a/test/spec/modules/betweenBidAdapter_spec.js b/test/spec/modules/betweenBidAdapter_spec.js index 44d0752d4b2..7f8e69669a8 100644 --- a/test/spec/modules/betweenBidAdapter_spec.js +++ b/test/spec/modules/betweenBidAdapter_spec.js @@ -77,6 +77,54 @@ describe('betweenBidAdapterTests', function () { expect(req_data.subid).to.equal(1138); }); + + it('validate eids parameter', function() { + const USER_ID_DATA = [ + { + source: 'admixer.net', + uids: [ + { id: '5706411dc1c54268ac2ed668b27f92a3', atype: 3 } + ] + } + ]; + + let bidRequestData = [{ + bidId: 'bid1234', + bidder: 'between', + params: { + w: 240, + h: 400, + s: 1112, + }, + sizes: [[240, 400]], + userIdAsEids: USER_ID_DATA, + }]; + + let request = spec.buildRequests(bidRequestData); + let req_data = JSON.parse(request.data)[0].data; + + expect(req_data.eids).to.have.deep.members(USER_ID_DATA); + }); + + it('validate eids parameter, if userIdAsEids = undefined', function() { + let bidRequestData = [{ + bidId: 'bid1234', + bidder: 'between', + params: { + w: 240, + h: 400, + s: 1112, + }, + sizes: [[240, 400]], + userIdAsEids: undefined + }]; + + let request = spec.buildRequests(bidRequestData); + let req_data = JSON.parse(request.data)[0].data; + + expect(req_data.eids).to.have.deep.members([]); + }); + it('validate click3rd param', function() { let bidRequestData = [{ bidId: 'bid1234', @@ -222,53 +270,6 @@ describe('betweenBidAdapterTests', function () { expect(req_data.sizes).to.deep.equal(['970x250', '240x400', '728x90']) }); - it('check sharedId with id and third', function() { - const bidRequestData = [{ - bidId: 'bid123', - bidder: 'between', - mediaTypes: { - banner: { - sizes: [[728, 90]] - } - }, - params: { - s: 1112, - }, - userId: { - sharedid: { - id: '01EXQE7JKNDRDDVATB0S2GX1NT', - third: '01EXQE7JKNDRDDVATB0S2GX1NT' - } - } - }]; - const shid = JSON.parse(spec.buildRequests(bidRequestData).data)[0].data.shid; - const shid3 = JSON.parse(spec.buildRequests(bidRequestData).data)[0].data.shid3; - expect(shid).to.equal('01EXQE7JKNDRDDVATB0S2GX1NT') && expect(shid3).to.equal('01EXQE7JKNDRDDVATB0S2GX1NT'); - }); - - it('check sharedId with only id', function() { - const bidRequestData = [{ - bidId: 'bid123', - bidder: 'between', - mediaTypes: { - banner: { - sizes: [[728, 90]] - } - }, - params: { - s: 1112, - }, - userId: { - sharedid: { - id: '01EXQE7JKNDRDDVATB0S2GX1NT', - } - } - }]; - const shid = JSON.parse(spec.buildRequests(bidRequestData).data)[0].data.shid; - const shid3 = JSON.parse(spec.buildRequests(bidRequestData).data)[0].data.shid3; - expect(shid).to.equal('01EXQE7JKNDRDDVATB0S2GX1NT') && expect(shid3).to.equal(''); - }); - it('check adomain', function() { const serverResponse = { body: [{ From 300db10dbc0fc79b6fff0c54ebbbbe55600cfbde Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 9 Sep 2021 11:32:31 -0700 Subject: [PATCH 043/250] "Prebid 5.13 Release" --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9ac6d496dd..2a151a4b8b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.13.0-pre", + "version": "5.13.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From bbb73bb00c6c1439536dceed1d635ab22f56ebbc Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 9 Sep 2021 11:59:27 -0700 Subject: [PATCH 044/250] Increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a151a4b8b3..769dc0bbbf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.13.0", + "version": "5.14.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 6b1d704e002be80488e6a1e0fc3fe71377c69600 Mon Sep 17 00:00:00 2001 From: Dejan Grbavcic Date: Fri, 10 Sep 2021 00:40:13 +0200 Subject: [PATCH 045/250] TargetVideo Bid Adapter: add new adapter (#7336) * TargetVideo bid adapter * TargetVideo bid adapter * TargetVideo bid adapter --- modules/appnexusBidAdapter.js | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index 72cf0baa3bd..9882e71fe4f 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -78,6 +78,7 @@ export const spec = { { code: 'districtm', gvlid: 144 }, { code: 'adasta' }, { code: 'beintoo', gvlid: 618 }, + { code: 'targetVideo' }, ], supportedMediaTypes: [BANNER, VIDEO, NATIVE], From 2b921539c0dd58fdc0743083266e2ab352fe7bde Mon Sep 17 00:00:00 2001 From: SKOCHERI <37454420+SKOCHERI@users.noreply.github.com> Date: Fri, 10 Sep 2021 10:50:31 -0700 Subject: [PATCH 046/250] Merkle endpoint configurable (#7400) Co-authored-by: skocheri --- integrationExamples/gpt/userId_example.html | 1 + modules/merkleIdSystem.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/integrationExamples/gpt/userId_example.html b/integrationExamples/gpt/userId_example.html index dfea06d17d0..653dd9c59f3 100644 --- a/integrationExamples/gpt/userId_example.html +++ b/integrationExamples/gpt/userId_example.html @@ -154,6 +154,7 @@ { "name": "merkleId", "params": { + "endpoint": "https://test_endpoint/", "vendor": "sdfg", "sv_cid": "dfg", "sv_pubid": "xcv", diff --git a/modules/merkleIdSystem.js b/modules/merkleIdSystem.js index 4ab29ec6f68..f4fc4356fbb 100644 --- a/modules/merkleIdSystem.js +++ b/modules/merkleIdSystem.js @@ -11,7 +11,6 @@ import {submodule} from '../src/hook.js' import {getStorageManager} from '../src/storageManager.js'; const MODULE_NAME = 'merkleId'; -const ID_URL = 'https://id2.sv.rkdms.com/identity/'; const DEFAULT_REFRESH = 7 * 3600; const SESSION_COOKIE_NAME = '_svsid'; @@ -42,7 +41,7 @@ function setSession(storage, response) { function constructUrl(configParams) { const session = getSession(configParams); - let url = ID_URL + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; + let url = configParams.endpoint + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; if (session) { url = `${url}&sv_session=${session}`; } @@ -126,6 +125,11 @@ export const merkleIdSubmodule = { utils.logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); return; } + + if (typeof configParams.endpoint !== 'string') { + utils.logError('User ID - merkleId submodule requires a valid endpoint string to be defined'); + return; + } if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) { utils.logError('User ID - merkleId submodule does not currently handle consent strings'); return; From 35b5dca0a9c0e8bd05d1e5b9a5cb6b1541ae6935 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Fri, 10 Sep 2021 14:38:17 -0400 Subject: [PATCH 047/250] Revert "Merkle endpoint configurable (#7400)" (#7401) This reverts commit 2b921539c0dd58fdc0743083266e2ab352fe7bde. --- integrationExamples/gpt/userId_example.html | 1 - modules/merkleIdSystem.js | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/integrationExamples/gpt/userId_example.html b/integrationExamples/gpt/userId_example.html index 653dd9c59f3..dfea06d17d0 100644 --- a/integrationExamples/gpt/userId_example.html +++ b/integrationExamples/gpt/userId_example.html @@ -154,7 +154,6 @@ { "name": "merkleId", "params": { - "endpoint": "https://test_endpoint/", "vendor": "sdfg", "sv_cid": "dfg", "sv_pubid": "xcv", diff --git a/modules/merkleIdSystem.js b/modules/merkleIdSystem.js index f4fc4356fbb..4ab29ec6f68 100644 --- a/modules/merkleIdSystem.js +++ b/modules/merkleIdSystem.js @@ -11,6 +11,7 @@ import {submodule} from '../src/hook.js' import {getStorageManager} from '../src/storageManager.js'; const MODULE_NAME = 'merkleId'; +const ID_URL = 'https://id2.sv.rkdms.com/identity/'; const DEFAULT_REFRESH = 7 * 3600; const SESSION_COOKIE_NAME = '_svsid'; @@ -41,7 +42,7 @@ function setSession(storage, response) { function constructUrl(configParams) { const session = getSession(configParams); - let url = configParams.endpoint + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; + let url = ID_URL + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; if (session) { url = `${url}&sv_session=${session}`; } @@ -125,11 +126,6 @@ export const merkleIdSubmodule = { utils.logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); return; } - - if (typeof configParams.endpoint !== 'string') { - utils.logError('User ID - merkleId submodule requires a valid endpoint string to be defined'); - return; - } if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) { utils.logError('User ID - merkleId submodule does not currently handle consent strings'); return; From 46fe440f82d7c0b09d4698292ed376768c3f1cb4 Mon Sep 17 00:00:00 2001 From: Luigi Sayson <48766825+luigi-sayson@users.noreply.github.com> Date: Mon, 13 Sep 2021 17:51:04 -0700 Subject: [PATCH 048/250] Timeout RTD module: initial release (#7395) * Add Prebid timeout RTD module * increase test coverage * Add header to doc * Lint fixes * Add unknown connection speed to doc * Fix doc, add unit test --- modules/timeoutRtdProvider.js | 173 ++++++++++ modules/timeoutRtdProvider.md | 151 +++++++++ test/spec/modules/timeoutRtdProvider_spec.js | 339 +++++++++++++++++++ 3 files changed, 663 insertions(+) create mode 100644 modules/timeoutRtdProvider.js create mode 100644 modules/timeoutRtdProvider.md create mode 100644 test/spec/modules/timeoutRtdProvider_spec.js diff --git a/modules/timeoutRtdProvider.js b/modules/timeoutRtdProvider.js new file mode 100644 index 00000000000..020a7d6f7f0 --- /dev/null +++ b/modules/timeoutRtdProvider.js @@ -0,0 +1,173 @@ + +import { submodule } from '../src/hook.js'; +import * as ajax from '../src/ajax.js'; +import * as utils from '../src/utils.js'; +import { getGlobal } from '../src/prebidGlobal.js'; + +const SUBMODULE_NAME = 'timeout'; + +// this allows the stubbing of functions during testing +export const timeoutRtdFunctions = { + getDeviceType, + getConnectionSpeed, + checkVideo, + calculateTimeoutModifier, + handleTimeoutIncrement +}; + +function getDeviceType() { + const userAgent = window.navigator.userAgent.toLowerCase(); + if ((/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent))) { + return 5; // tablet + } + if ((/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(userAgent))) { + return 4; // mobile + } + return 2; // personal computer +} + +function checkVideo(adUnits) { + return adUnits.some((adUnit) => { + return adUnit.mediaTypes && adUnit.mediaTypes.video; + }); +} + +function getConnectionSpeed() { + const connection = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection || {} + const connectionType = connection.type || connection.effectiveType; + + switch (connectionType) { + case 'slow-2g': + case '2g': + return 'slow'; + + case '3g': + return 'medium'; + + case 'bluetooth': + case 'cellular': + case 'ethernet': + case 'wifi': + case 'wimax': + case '4g': + return 'fast'; + } + + return 'unknown'; +} +/** + * Calculate the time to be added to the timeout + * @param {Array} adUnits + * @param {Object} rules + * @return {int} + */ +function calculateTimeoutModifier(adUnits, rules) { + utils.logInfo('Timeout rules', rules); + let timeoutModifier = 0; + let toAdd = 0; + + if (rules.includesVideo) { + const hasVideo = timeoutRtdFunctions.checkVideo(adUnits); + toAdd = rules.includesVideo[hasVideo] || 0; + utils.logInfo(`Adding ${toAdd} to timeout for includesVideo ${hasVideo}`) + timeoutModifier += toAdd; + } + + if (rules.numAdUnits) { + const numAdUnits = adUnits.length; + if (rules.numAdUnits[numAdUnits]) { + timeoutModifier += rules.numAdUnits[numAdUnits]; + } else { + for (const [rangeStr, timeoutVal] of Object.entries(rules.numAdUnits)) { + const [lowerBound, upperBound] = rangeStr.split('-'); + if (parseInt(lowerBound) <= numAdUnits && numAdUnits <= parseInt(upperBound)) { + utils.logInfo(`Adding ${timeoutVal} to timeout for numAdUnits ${numAdUnits}`) + timeoutModifier += timeoutVal; + break; + } + } + } + } + + if (rules.deviceType) { + const deviceType = timeoutRtdFunctions.getDeviceType(); + toAdd = rules.deviceType[deviceType] || 0; + utils.logInfo(`Adding ${toAdd} to timeout for deviceType ${deviceType}`) + timeoutModifier += toAdd; + } + + if (rules.connectionSpeed) { + const connectionSpeed = timeoutRtdFunctions.getConnectionSpeed(); + toAdd = rules.connectionSpeed[connectionSpeed] || 0; + utils.logInfo(`Adding ${toAdd} to timeout for connectionSpeed ${connectionSpeed}`) + timeoutModifier += toAdd; + } + + utils.logInfo('timeout Modifier calculated', timeoutModifier); + return timeoutModifier; +} + +/** + * + * @param {Object} reqBidsConfigObj + * @param {function} callback + * @param {Object} config + * @param {Object} userConsent + */ +function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { + utils.logInfo('Timeout rtd config', config); + const timeoutUrl = utils.deepAccess(config, 'params.endpoint.url'); + if (timeoutUrl) { + utils.logInfo('Timeout url', timeoutUrl); + ajax.ajaxBuilder()(timeoutUrl, { + success: function(response) { + try { + const rules = JSON.parse(response); + timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, rules); + } catch (e) { + utils.logError('Error parsing json response from timeout provider.') + } + callback(); + }, + error: function(errorStatus) { + utils.logError('Timeout request error!', errorStatus); + callback(); + } + }); + } else if (utils.deepAccess(config, 'params.rules')) { + timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, utils.deepAccess(config, 'params.rules')); + callback(); + } else { + utils.logInfo('No timeout endpoint or timeout rules found. Exiting timeout rtd module'); + callback(); + } +} + +/** + * Gets the timeout modifier, adds it to the bidder timeout, and sets it to reqBidsConfigObj + * @param {Object} reqBidsConfigObj + * @param {Object} rules + */ +function handleTimeoutIncrement(reqBidsConfigObj, rules) { + const adUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits; + const timeoutModifier = timeoutRtdFunctions.calculateTimeoutModifier(adUnits, rules); + const bidderTimeout = getGlobal().getConfig('bidderTimeout'); + reqBidsConfigObj.timeout = bidderTimeout + timeoutModifier; +} + +/** @type {RtdSubmodule} */ +export const timeoutSubmodule = { + /** + * used to link submodule with realTimeData + * @type {string} + */ + name: SUBMODULE_NAME, + init: () => true, + getBidRequestData, +}; + +function registerSubModule() { + submodule('realTimeData', timeoutSubmodule); +} + +registerSubModule(); diff --git a/modules/timeoutRtdProvider.md b/modules/timeoutRtdProvider.md new file mode 100644 index 00000000000..49d1e1fc70a --- /dev/null +++ b/modules/timeoutRtdProvider.md @@ -0,0 +1,151 @@ + --- + layout: page_v2 + title: Timeout Rtd Module + description: Module for managing timeouts in real time + page_type: module + module_type: rtd + module_code : example + enable_download : true + sidebarType : 1 + --- + +## Overview +The timeout RTD module enables publishers to set rules that determine the timeout based on +certain features. It supports rule sets dynamically retrieved from a timeout provider as well as rules +set directly via configuration. +Build the timeout RTD module into the Prebid.js package with: +``` +gulp build --modules=timeoutRtdProvider,rtdModule... +``` + +## Configuration +The module is configured in the realTimeData.dataProviders object. The module will override +`bidderTimeout` in the pbjs config. + +### Timeout Data Provider interface +The timeout RTD module provides an interface of dynamically fetching timeout rules from +a data provider just before the auction begins. The endpoint url is set in the config just as in +the example below, and the timeout data will be used when making bid requests. + +``` +pbjs.setConfig({ + ... + "realTimeData": { + "dataProviders": [{ + "name": 'timeout', + "params": { + "endpoint": { + "url": "http://{cdn-link}.json" + } + } + } + ]}, + + // This value below will be modified by the timeout RTD module if it successfully + // fetches the timeout data. + "bidderTimeout": 1500, + ... +}); +``` + +Sample Endpoint Response: +``` +{ + "rules": { + "includesVideo": { + "true": 200, + "false": 50 + }, + "numAdUnits" : { + "1-5": 100, + "6-10": 200, + "11-15": 300 + }, + "deviceType": { + "2": 50, + "4": 100, + "5": 200 + }, + "connectionSpeed": { + "slow": 200, + "medium": 100, + "fast": 50, + "unknown": 10 + }, +} +``` + +### Rule Handling: +The rules retrieved from the endpoint will be used to add time to the `bidderTimeout` based on certain features such as +the user's deviceType, connection speed, etc. These rules can also be configured statically on page via a `rules` object. +Note that the timeout Module will ignore the static rules if an endpoint url is provided. The timeout rules follow the +format: +``` +{ + '': { + '': + } +} +``` +See bottom of page for examples. + +Currently supported features: + +|Name |Description | Keys | Example +| :------------ | :------------ | :------------ |:------------ | +| includesVideo | Adds time to the timeout based on whether there is a video ad unit in the auction or not | 'true'/'false'| { "true": 200, "false": 50 } | +| numAdUnits | Adds time based on the number of ad units. Ranges in the format `'lowerbound-upperbound` are accepted. This range is inclusive | numbers or number ranges | {"1": 50, "2-5": 100, "6-10": 200} | +| deviceType | Adds time based on device type| 2, 4, or 5| {"2": 50, "4": 100} | +| connectionSpeed | Adds time based on connection speed. `connectionSpeed` defaults to 'unknown' if connection speed cannot be determined | slow, medium, fast, or unknown | { "slow": 200} | + +If there are multiple rules set, all of them would be used and any that apply will be added to the base timeout. For example, if the rules object contains: +``` +{ + "includesVideo": { + "true": 200, + "false": 50 + }, + "numAdUnits" : { + "1-3": 100, + "4-5": 200 + } +} +``` +and there are 3 ad units in the auction, all of which are banner, then the timeout to be added will be 150 milliseconds (50 for `includesVideo[false]` + 100 for `numAdUnits['1-3']`). + +Full example: +``` +pbjs.setConfig({ + ... + "realTimeData": { + "dataProviders": [{ + "name": 'timeout', + "params": { + "rules": { + "includesVideo": { + "true": 200, + "false": 50 + }, + "numAdUnits" : { + "1-5": 100, + "6-10": 200, + "11-15": 300 + }, + "deviceType": { + "2": 50, + "4": 100, + "5": 200 + }, + "connectionSpeed": { + "slow": 200, + "medium": 100, + "fast": 50, + "unknown": 10 + }, + } + } + ]} + ... + // The timeout RTD module will add time to `bidderTimeout` based on the rules set above. + "bidderTimeout": 1500, +``` diff --git a/test/spec/modules/timeoutRtdProvider_spec.js b/test/spec/modules/timeoutRtdProvider_spec.js new file mode 100644 index 00000000000..88415a99b5e --- /dev/null +++ b/test/spec/modules/timeoutRtdProvider_spec.js @@ -0,0 +1,339 @@ + +import { timeoutRtdFunctions, timeoutSubmodule } from '../../../modules/timeoutRtdProvider' +import { expect } from 'chai'; +import * as ajax from 'src/ajax.js'; +import * as prebidGlobal from 'src/prebidGlobal.js'; + +const DEFAULT_USER_AGENT = window.navigator.userAgent; +const DEFAULT_CONNECTION = window.navigator.connection; + +const PC_USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246'; +const MOBILE_USER_AGENT = 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1'; +const TABLET_USER_AGENT = 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148'; + +function resetUserAgent() { + window.navigator.__defineGetter__('userAgent', () => DEFAULT_USER_AGENT); +}; + +function setUserAgent(userAgent) { + window.navigator.__defineGetter__('userAgent', () => userAgent); +} + +function resetConnection() { + window.navigator.__defineGetter__('connection', () => DEFAULT_CONNECTION); +} +function setConnectionType(connectionType) { + window.navigator.__defineGetter__('connection', () => { return {'type': connectionType} }); +} + +describe('getDeviceType', () => { + afterEach(() => { + resetUserAgent(); + }); + + [ + // deviceType, userAgent, deviceTypeNum + ['pc', PC_USER_AGENT, 2], + ['mobile', MOBILE_USER_AGENT, 4], + ['tablet', TABLET_USER_AGENT, 5], + ].forEach(function(args) { + const [deviceType, userAgent, deviceTypeNum] = args; + it(`should be able to recognize ${deviceType} devices`, () => { + setUserAgent(userAgent); + const res = timeoutRtdFunctions.getDeviceType(); + expect(res).to.equal(deviceTypeNum) + }) + }) +}); + +describe('getConnectionSpeed', () => { + afterEach(() => { + resetConnection(); + }); + [ + // connectionType, connectionSpeed + ['slow-2g', 'slow'], + ['2g', 'slow'], + ['3g', 'medium'], + ['bluetooth', 'fast'], + ['cellular', 'fast'], + ['ethernet', 'fast'], + ['wifi', 'fast'], + ['wimax', 'fast'], + ['4g', 'fast'], + ['not known', 'unknown'], + [undefined, 'unknown'], + ].forEach(function(args) { + const [connectionType, connectionSpeed] = args; + it(`should be able to categorize connection speed when the connection type is ${connectionType}`, () => { + setConnectionType(connectionType); + const res = timeoutRtdFunctions.getConnectionSpeed(); + expect(res).to.equal(connectionSpeed) + }) + }) +}); + +describe('Timeout modifier calculations', () => { + let sandbox; + beforeEach(() => { + sandbox = sinon.sandbox.create(); + }); + + afterEach(() => { + sandbox.restore(); + }); + + it('should be able to detect video ad units', () => { + let adUnits = [] + let res = timeoutRtdFunctions.checkVideo(adUnits); + expect(res).to.be.false; + + adUnits = [{ + mediaTypes: { + video: [] + } + }]; + res = timeoutRtdFunctions.checkVideo(adUnits); + expect(res).to.be.true; + + adUnits = [{ + mediaTypes: { + banner: [] + } + }]; + res = timeoutRtdFunctions.checkVideo(adUnits); + expect(res).to.be.false; + }); + + it('should calculate the timeout modifier for video', () => { + sandbox.stub(timeoutRtdFunctions, 'checkVideo').returns(true); + const rules = { + includesVideo: { + 'true': 200, + 'false': 50 + } + } + const res = timeoutRtdFunctions.calculateTimeoutModifier([], rules); + expect(res).to.equal(200) + }); + + it('should calculate the timeout modifier for connectionSpeed', () => { + sandbox.stub(timeoutRtdFunctions, 'getConnectionSpeed').returns('slow'); + const rules = { + connectionSpeed: { + 'slow': 200, + 'medium': 100, + 'fast': 50 + } + } + const res = timeoutRtdFunctions.calculateTimeoutModifier([], rules); + expect(res).to.equal(200); + }); + + it('should calculate the timeout modifier for deviceType', () => { + sandbox.stub(timeoutRtdFunctions, 'getDeviceType').returns(4); + const rules = { + deviceType: { + '2': 50, + '4': 100, + '5': 200 + }, + } + const res = timeoutRtdFunctions.calculateTimeoutModifier([], rules); + expect(res).to.equal(100) + }); + + it('should calculate the timeout modifier for ranged numAdunits', () => { + const rules = { + numAdUnits: { + '1-5': 100, + '6-10': 200, + '11-15': 300, + } + } + const adUnits = [1, 2, 3, 4, 5, 6]; + const res = timeoutRtdFunctions.calculateTimeoutModifier(adUnits, rules); + expect(res).to.equal(200) + }); + + it('should calculate the timeout modifier for exact numAdunits', () => { + const rules = { + numAdUnits: { + '1': 100, + '2': 200, + '3': 300, + '4-5': 400, + } + } + const adUnits = [1, 2]; + const res = timeoutRtdFunctions.calculateTimeoutModifier(adUnits, rules); + expect(res).to.equal(200); + }); + + it('should add up all the modifiers when all the rules are present', () => { + sandbox.stub(timeoutRtdFunctions, 'getConnectionSpeed').returns('slow'); + sandbox.stub(timeoutRtdFunctions, 'getDeviceType').returns(4); + const rules = { + connectionSpeed: { + 'slow': 200, + 'medium': 100, + 'fast': 50 + }, + deviceType: { + '2': 50, + '4': 100, + '5': 200 + }, + includesVideo: { + 'true': 200, + 'false': 50 + }, + numAdUnits: { + '1': 100, + '2': 200, + '3': 300, + '4-5': 400, + } + } + const res = timeoutRtdFunctions.calculateTimeoutModifier([{ + mediaTypes: { + video: [] + } + }], rules); + expect(res).to.equal(600); + }); +}); + +describe('Timeout RTD submodule', () => { + let sandbox; + beforeEach(() => { + sandbox = sinon.sandbox.create(); + }); + + afterEach(() => { + sandbox.restore(); + }); + + it('should init successfully', () => { + expect(timeoutSubmodule.init()).to.equal(true); + }); + + it('should make a request to the endpoint url if it is provided, and handle the response', () => { + const response = '{"deviceType":{ "2": 50, "4": 100, "5": 200 }}' + const ajaxStub = sandbox.stub().callsFake(function (url, callbackObj) { + callbackObj.success(response); + }); + sandbox.stub(ajax, 'ajaxBuilder').callsFake(function () { return ajaxStub }); + + const reqBidsConfigObj = {} + const expectedLink = 'https://somelink.json' + const config = { + 'name': 'timeout', + 'params': { + 'endpoint': { + url: expectedLink + } + } + } + const handleTimeoutIncrementStub = sandbox.stub(timeoutRtdFunctions, 'handleTimeoutIncrement'); + timeoutSubmodule.getBidRequestData(reqBidsConfigObj, function() {}, config) + + expect(ajaxStub.calledWith(expectedLink)).to.be.true; + expect(handleTimeoutIncrementStub.calledWith(reqBidsConfigObj, JSON.parse(response))).to.be.true; + }); + + it('should make a request to the endpoint url and ignore the rules object if the endpoint is provided', () => { + const ajaxStub = sandbox.stub().callsFake((url, callbackObj) => {}); + sandbox.stub(ajax, 'ajaxBuilder').callsFake(() => ajaxStub); + const expectedLink = 'https://somelink.json' + const config = { + 'name': 'timeout', + 'params': { + 'endpoint': { + url: expectedLink + }, + 'rules': { + 'includesVideo': { + 'true': 200, + }, + } + } + } + timeoutSubmodule.getBidRequestData({}, function() {}, config); + expect(ajaxStub.calledWith(expectedLink)).to.be.true; + }); + + it('should use the rules object if there is no endpoint url', () => { + const config = { + 'name': 'timeout', + 'params': { + 'rules': { + 'includesVideo': { + 'true': 200, + }, + } + } + } + const handleTimeoutIncrementStub = sandbox.stub(timeoutRtdFunctions, 'handleTimeoutIncrement'); + const reqBidsConfigObj = {}; + timeoutSubmodule.getBidRequestData(reqBidsConfigObj, function() {}, config); + expect(handleTimeoutIncrementStub.calledWith(reqBidsConfigObj, config.params.rules)).to.be.true; + }); + + it('should exit quietly if no relevant timeout config is found', () => { + const callback = sandbox.stub() + const ajaxStub = sandbox.stub().callsFake((url, callbackObj) => {}); + sandbox.stub(ajax, 'ajaxBuilder').callsFake(function() { return ajaxStub }); + const handleTimeoutIncrementStub = sandbox.stub(timeoutRtdFunctions, 'handleTimeoutIncrement'); + + timeoutSubmodule.getBidRequestData({}, callback, {}); + + expect(handleTimeoutIncrementStub.called).to.be.false; + expect(callback.called).to.be.true; + expect(ajaxStub.called).to.be.false; + }); + + it('should be able to increment the timeout with the calculated timeout modifier', () => { + const baseTimeout = 100; + const getConfigStub = sandbox.stub().returns(baseTimeout); + sandbox.stub(prebidGlobal, 'getGlobal').callsFake(() => { + return { + getConfig: getConfigStub + } + }); + + const reqBidsConfigObj = {adUnits: [1, 2, 3]} + const addedTimeout = 400; + const rules = { + numAdUnits: { + '3-5': addedTimeout, + } + } + + timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, rules) + expect(reqBidsConfigObj.timeout).to.be.equal(baseTimeout + addedTimeout); + }); + + it('should be able to increment the timeout with the calculated timeout modifier when there are multiple matching rules', () => { + const baseTimeout = 100; + const getConfigStub = sandbox.stub().returns(baseTimeout); + sandbox.stub(prebidGlobal, 'getGlobal').callsFake(() => { + return { + getConfig: getConfigStub + } + }); + + const reqBidsConfigObj = {adUnits: [1, 2, 3]} + const addedTimeout = 400; + const rules = { + numAdUnits: { + '3-5': addedTimeout / 2, + }, + includesVideo: { + 'false': addedTimeout / 2, + } + } + timeoutRtdFunctions.handleTimeoutIncrement(reqBidsConfigObj, rules) + expect(reqBidsConfigObj.timeout).to.be.equal(baseTimeout + addedTimeout); + }); +}); From 848ae9cc9cb40bc69379e9a1269024e5d14d51cd Mon Sep 17 00:00:00 2001 From: Tachfine Date: Tue, 14 Sep 2021 12:43:07 +0200 Subject: [PATCH 049/250] CriteoIdSystem returns a callback to initiate user sync (#7371) --- modules/criteoIdSystem.js | 44 ++++++++------ test/spec/modules/criteoIdSystem_spec.js | 75 +++++++++++++----------- 2 files changed, 68 insertions(+), 51 deletions(-) diff --git a/modules/criteoIdSystem.js b/modules/criteoIdSystem.js index ac26d34d529..6a028a6cc25 100644 --- a/modules/criteoIdSystem.js +++ b/modules/criteoIdSystem.js @@ -6,8 +6,8 @@ */ import * as utils from '../src/utils.js' -import * as ajax from '../src/ajax.js' -import { getRefererInfo } from '../src/refererDetection.js' +import { ajax } from '../src/ajax.js'; +import { getRefererInfo } from '../src/refererDetection.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -65,7 +65,7 @@ function buildCriteoUsersyncUrl(topUrl, domain, bundle, areCookiesWriteable, isL return url; } -function callCriteoUserSync(parsedCriteoData, gdprString) { +function callCriteoUserSync(parsedCriteoData, gdprString, callback) { const cw = storage.cookiesAreEnabled(); const lsw = storage.localStorageIsEnabled(); const topUrl = extractProtocolHost(getRefererInfo().referer); @@ -82,26 +82,32 @@ function callCriteoUserSync(parsedCriteoData, gdprString) { gdprString ); - ajax.ajaxBuilder()( - url, - response => { + const callbacks = { + success: response => { const jsonResponse = JSON.parse(response); - if (jsonResponse.bidId) { - saveOnAllStorages(bididStorageKey, jsonResponse.bidId); - } else { - deleteFromAllStorages(bididStorageKey); - } - if (jsonResponse.acwsUrl) { const urlsToCall = typeof jsonResponse.acwsUrl === 'string' ? [jsonResponse.acwsUrl] : jsonResponse.acwsUrl; urlsToCall.forEach(url => utils.triggerPixel(url)); } else if (jsonResponse.bundle) { saveOnAllStorages(bundleStorageKey, jsonResponse.bundle); } + + if (jsonResponse.bidId) { + saveOnAllStorages(bididStorageKey, jsonResponse.bidId); + const criteoId = { criteoId: jsonResponse.bidId }; + callback(criteoId); + } else { + deleteFromAllStorages(bididStorageKey); + callback(); + } }, - undefined, - { method: 'GET', contentType: 'application/json', withCredentials: true } - ); + error: error => { + utils.logError(`criteoIdSystem: unable to sync user id`, error); + callback(); + } + }; + + ajax(url, callbacks, undefined, { method: 'GET', contentType: 'application/json', withCredentials: true }); } /** @type {Submodule} */ @@ -132,9 +138,13 @@ export const criteoIdSubmodule = { const gdprConsentString = hasGdprData ? consentData.consentString : undefined; let localData = getCriteoDataFromAllStorages(); - callCriteoUserSync(localData, gdprConsentString); - return { id: localData.bidId ? { criteoId: localData.bidId } : undefined } + const result = (callback) => callCriteoUserSync(localData, gdprConsentString, callback); + + return { + id: localData.bidId ? { criteoId: localData.bidId } : undefined, + callback: result + } } }; diff --git a/test/spec/modules/criteoIdSystem_spec.js b/test/spec/modules/criteoIdSystem_spec.js index 65e5aaf741d..828b8401af1 100644 --- a/test/spec/modules/criteoIdSystem_spec.js +++ b/test/spec/modules/criteoIdSystem_spec.js @@ -1,15 +1,9 @@ import { criteoIdSubmodule, storage } from 'modules/criteoIdSystem.js'; import * as utils from 'src/utils.js'; -import * as ajaxLib from 'src/ajax.js'; +import {server} from '../../mocks/xhr'; const pastDateString = new Date(0).toString() -function mockResponse(responseText, fakeResponse = (url, callback) => callback(responseText)) { - return function() { - return fakeResponse; - } -} - describe('CriteoId module', function () { const cookiesMaxAge = 13 * 30 * 24 * 60 * 60 * 1000; @@ -22,7 +16,6 @@ describe('CriteoId module', function () { let removeFromLocalStorageStub; let timeStampStub; let parseUrlStub; - let ajaxBuilderStub; let triggerPixelStub; beforeEach(function (done) { @@ -32,7 +25,6 @@ describe('CriteoId module', function () { setLocalStorageStub = sinon.stub(storage, 'setDataInLocalStorage'); removeFromLocalStorageStub = sinon.stub(storage, 'removeDataFromLocalStorage'); timeStampStub = sinon.stub(utils, 'timestamp').returns(nowTimestamp); - ajaxBuilderStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(mockResponse('{}')); parseUrlStub = sinon.stub(utils, 'parseUrl').returns({protocol: 'https', hostname: 'testdev.com'}) triggerPixelStub = sinon.stub(utils, 'triggerPixel'); done(); @@ -45,7 +37,6 @@ describe('CriteoId module', function () { setLocalStorageStub.restore(); removeFromLocalStorageStub.restore(); timeStampStub.restore(); - ajaxBuilderStub.restore(); triggerPixelStub.restore(); parseUrlStub.restore(); }); @@ -61,8 +52,9 @@ describe('CriteoId module', function () { getCookieStub.withArgs('cto_bidid').returns(testCase.cookie); getLocalStorageStub.withArgs('cto_bidid').returns(testCase.localStorage); - const id = criteoIdSubmodule.getId(); - expect(id).to.be.deep.equal({id: testCase.expected ? { criteoId: testCase.expected } : undefined}); + const result = criteoIdSubmodule.getId(); + expect(result.id).to.be.deep.equal(testCase.expected ? { criteoId: testCase.expected } : undefined); + expect(result.callback).to.be.a('function'); })) it('decode() should return the bidId when it exists in local storages', function () { @@ -74,16 +66,21 @@ describe('CriteoId module', function () { getCookieStub.withArgs('cto_bundle').returns('bundle'); window.criteo_pubtag = {} - const emptyObj = '{}'; - let ajaxStub = sinon.stub().callsFake((url, callback) => callback(emptyObj)); - ajaxBuilderStub.callsFake(mockResponse(undefined, ajaxStub)) + let callBackSpy = sinon.spy(); + let result = criteoIdSubmodule.getId(); + result.callback(callBackSpy); - criteoIdSubmodule.getId(); const expectedUrl = `https://gum.criteo.com/sid/json?origin=prebid&topUrl=https%3A%2F%2Ftestdev.com%2F&domain=testdev.com&bundle=bundle&cw=1&pbt=1&lsw=1`; - expect(ajaxStub.calledWith(expectedUrl)).to.be.true; + let request = server.requests[0]; + expect(request.url).to.be.eq(expectedUrl); - window.criteo_pubtag = undefined; + request.respond( + 200, + {'Content-Type': 'application/json'}, + JSON.stringify({}) + ); + expect(callBackSpy.calledOnce).to.be.true; }); const responses = [ @@ -101,16 +98,19 @@ describe('CriteoId module', function () { responses.forEach(response => describe('test user sync response behavior', function () { const expirationTs = new Date(nowTimestamp + cookiesMaxAge).toString(); - beforeEach(function (done) { - const fakeResponse = (url, callback) => { - callback(JSON.stringify(response)); - setTimeout(done, 0); - } - ajaxBuilderStub.callsFake(mockResponse(undefined, fakeResponse)); - criteoIdSubmodule.getId(); - }) - it('should save bidId if it exists', function () { + const result = criteoIdSubmodule.getId(); + result.callback((id) => { + expect(id).to.be.deep.equal(response.bidId ? { criteoId: response.bidId } : undefined); + }); + + let request = server.requests[0]; + request.respond( + 200, + {'Content-Type': 'application/json'}, + JSON.stringify(response) + ); + if (response.acwsUrl) { expect(triggerPixelStub.called).to.be.true; expect(setCookieStub.calledWith('cto_bundle')).to.be.false; @@ -140,16 +140,23 @@ describe('CriteoId module', function () { ]; gdprConsentTestCases.forEach(testCase => it('should call user sync url with the gdprConsent', function () { - const emptyObj = '{}'; - let ajaxStub = sinon.stub().callsFake((url, callback) => callback(emptyObj)); - ajaxBuilderStub.callsFake(mockResponse(undefined, ajaxStub)) - - criteoIdSubmodule.getId(undefined, testCase.consentData); + let callBackSpy = sinon.spy(); + let result = criteoIdSubmodule.getId(undefined, testCase.consentData); + result.callback(callBackSpy); + let request = server.requests[0]; if (testCase.expected) { - expect(ajaxStub.calledWithMatch(`gdprString=${testCase.expected}`)).to.be.true; + expect(request.url).to.have.string(`gdprString=${testCase.expected}`); } else { - expect(ajaxStub.calledWithMatch('gdprString')).not.to.be.true; + expect(request.url).to.not.have.string('gdprString'); } + + request.respond( + 200, + {'Content-Type': 'application/json'}, + JSON.stringify({}) + ); + + expect(callBackSpy.calledOnce).to.be.true; })); }); From 0f7d0ceb8d9dd401308808a6c1cf8497e7c635ce Mon Sep 17 00:00:00 2001 From: hdeodhar <35999856+hdeodhar@users.noreply.github.com> Date: Tue, 14 Sep 2021 17:25:36 +0100 Subject: [PATCH 050/250] Added sizeId 562 (300x431) (#7408) --- modules/rubiconBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 354289a1823..3fca68521bb 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -110,7 +110,8 @@ var sizeMap = { 548: '500x1000', 550: '980x480', 552: '300x200', - 558: '640x640' + 558: '640x640', + 562: '300x431' }; utils._each(sizeMap, (item, key) => sizeMap[item] = key); From 27a90675ef76f2179c1b47ebb3159ba9dbee7674 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Tue, 14 Sep 2021 12:40:48 -0400 Subject: [PATCH 051/250] Update .submodules.json (#7406) --- modules/.submodules.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/.submodules.json b/modules/.submodules.json index e4de1819a16..3a3b94ea469 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -50,7 +50,8 @@ "optimeraRtdProvider", "permutiveRtdProvider", "reconciliationRtdProvider", - "sirdataRtdProvider" + "sirdataRtdProvider", + "timeoutRtdProvider" ], "fpdModule": [ "enrichmentFpdModule", From d9bc98e77863da18a842c7e7b16ec3207bbae9f0 Mon Sep 17 00:00:00 2001 From: John Salis Date: Tue, 14 Sep 2021 14:36:25 -0400 Subject: [PATCH 052/250] add custom error messages for beachfront bid validation (#7412) Co-authored-by: John Salis --- modules/beachfrontBidAdapter.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/beachfrontBidAdapter.js b/modules/beachfrontBidAdapter.js index d633359eb8e..3531fa45d1b 100644 --- a/modules/beachfrontBidAdapter.js +++ b/modules/beachfrontBidAdapter.js @@ -6,7 +6,7 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js'; import find from 'core-js-pure/features/array/find.js'; import includes from 'core-js-pure/features/array/includes.js'; -const ADAPTER_VERSION = '1.17'; +const ADAPTER_VERSION = '1.18'; const ADAPTER_NAME = 'BFIO_PREBID'; const OUTSTREAM = 'outstream'; const CURRENCY = 'USD'; @@ -32,7 +32,27 @@ export const spec = { supportedMediaTypes: [ VIDEO, BANNER ], isBidRequestValid(bid) { - return !!(isVideoBidValid(bid) || isBannerBidValid(bid)); + if (isVideoBid(bid)) { + if (!getVideoBidParam(bid, 'appId')) { + utils.logWarn('Beachfront: appId param is required for video bids.'); + return false; + } + if (!getVideoBidParam(bid, 'bidfloor')) { + utils.logWarn('Beachfront: bidfloor param is required for video bids.'); + return false; + } + } + if (isBannerBid(bid)) { + if (!getBannerBidParam(bid, 'appId')) { + utils.logWarn('Beachfront: appId param is required for banner bids.'); + return false; + } + if (!getBannerBidParam(bid, 'bidfloor')) { + utils.logWarn('Beachfront: bidfloor param is required for banner bids.'); + return false; + } + } + return true; }, buildRequests(bids, bidderRequest) { From c064ea9ed4c00a31333d780c5ad4dd0d351ef363 Mon Sep 17 00:00:00 2001 From: hdeodhar <35999856+hdeodhar@users.noreply.github.com> Date: Tue, 14 Sep 2021 19:53:20 +0100 Subject: [PATCH 053/250] Add new sizes (#7414) Dimensions: 320x431 Size ID: 564 Dimensions: 320x300 Size ID: 566 Dimensions: 300x150 Size ID: 568 Dimensions: 300x125 Size ID: 570 Dimensions: 250x350 Size ID: 572 Dimensions: 620x891 Size ID: 574 Dimensions: 610x877 Size ID: 576 Dimensions: 980x552 Size ID: 578 Dimensions: 505x656 Size ID: 580 --- modules/rubiconBidAdapter.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 3fca68521bb..d502d7efb25 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -111,7 +111,16 @@ var sizeMap = { 550: '980x480', 552: '300x200', 558: '640x640', - 562: '300x431' + 562: '300x431', + 564: '320x431', + 566: '320x300', + 568: '300x150', + 570: '300x125', + 572: '250x350', + 574: '620x891', + 576: '610x877', + 578: '980x552', + 580: '505x656' }; utils._each(sizeMap, (item, key) => sizeMap[item] = key); From 648b08d1c415a8e6ae49eea0ee861e53aa34c4e8 Mon Sep 17 00:00:00 2001 From: Anand Venkatraman Date: Tue, 14 Sep 2021 16:26:01 -0400 Subject: [PATCH 054/250] PulsePoint Bid Adapter: support for additional user id providers (#7389) * ET-1691: Pulsepoint Analytics adapter for Prebid. (#1) * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: Adding pulsepoint analytics and tests for pulsepoint adapter * ET-1691: cleanup * ET-1691: minor * ET-1691: revert package.json change * Adding bidRequest to bidFactory.createBid method as per https://github.com/prebid/Prebid.js/issues/509 * ET-1765: Adding support for additional params in PulsePoint adapter (#2) * ET-1850: Fixing https://github.com/prebid/Prebid.js/issues/866 * Minor fix * Adding mandatory parameters to Bid * ET-9372: PulsePoint Adapter - support for additional user id providers * Fix for haloId --- modules/pulsepointBidAdapter.js | 12 ++++++--- .../spec/modules/pulsepointBidAdapter_spec.js | 26 +++++++++++++++---- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/modules/pulsepointBidAdapter.js b/modules/pulsepointBidAdapter.js index adea33fc3b9..5f8f096926b 100644 --- a/modules/pulsepointBidAdapter.js +++ b/modules/pulsepointBidAdapter.js @@ -421,12 +421,18 @@ function user(bidRequest, bidderRequest) { if (bidRequest) { if (bidRequest.userId) { ext.eids = []; - addExternalUserId(ext.eids, bidRequest.userId.pubcid, 'pubcommon'); + addExternalUserId(ext.eids, bidRequest.userId.pubcid, 'pubcid.org'); addExternalUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); - addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo'); - addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'identityLink'); + addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo.com'); + addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'liveramp.com'); addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.id5id.uid'), 'id5-sync.com', utils.deepAccess(bidRequest, 'userId.id5id.ext')); addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.parrableId.eid'), 'parrable.com'); + addExternalUserId(ext.eids, bidRequest.userId.fabrickId, 'neustar.biz'); + addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.haloId.haloId'), 'audigent.com'); + addExternalUserId(ext.eids, bidRequest.userId.merkleId, 'merkleinc.com'); + addExternalUserId(ext.eids, bidRequest.userId.lotamePanoramaId, 'crwdcntrl.net'); + addExternalUserId(ext.eids, bidRequest.userId.connectid, 'verizonmedia.com'); + addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.uid2.id'), 'uidapi.com'); // liveintent if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) { addExternalUserId(ext.eids, bidRequest.userId.lipb.lipbid, 'liveintent.com'); diff --git a/test/spec/modules/pulsepointBidAdapter_spec.js b/test/spec/modules/pulsepointBidAdapter_spec.js index 6630cb0907c..92f7aa0b70d 100644 --- a/test/spec/modules/pulsepointBidAdapter_spec.js +++ b/test/spec/modules/pulsepointBidAdapter_spec.js @@ -637,7 +637,7 @@ describe('PulsePoint Adapter Tests', function () { expect(ortbRequest.user.ext).to.not.be.undefined; expect(ortbRequest.user.ext.eids).to.not.be.undefined; expect(ortbRequest.user.ext.eids).to.have.lengthOf(2); - expect(ortbRequest.user.ext.eids[0].source).to.equal('pubcommon'); + expect(ortbRequest.user.ext.eids[0].source).to.equal('pubcid.org'); expect(ortbRequest.user.ext.eids[0].uids).to.have.lengthOf(1); expect(ortbRequest.user.ext.eids[0].uids[0].id).to.equal('userid_pubcid'); expect(ortbRequest.user.ext.eids[1].source).to.equal('adserver.org'); @@ -659,6 +659,16 @@ describe('PulsePoint Adapter Tests', function () { parrableId: { eid: 'parrable_id234' }, lipb: { lipbid: 'liveintent_id123' + }, + haloId: { + haloId: 'halo_user1' + }, + lotamePanoramaId: 'lotame_user2', + merkleId: 'merkle_user3', + fabrickId: 'fabrick_user4', + connectid: 'connect_user5', + uid2: { + id: 'uid2_user6' } }; const userVerify = function(obj, source, id) { @@ -677,13 +687,19 @@ describe('PulsePoint Adapter Tests', function () { expect(ortbRequest.user).to.not.be.undefined; expect(ortbRequest.user.ext).to.not.be.undefined; expect(ortbRequest.user.ext.eids).to.not.be.undefined; - expect(ortbRequest.user.ext.eids).to.have.lengthOf(6); + expect(ortbRequest.user.ext.eids).to.have.lengthOf(12); userVerify(ortbRequest.user.ext.eids[0], 'britepool.com', 'britepool_id123'); - userVerify(ortbRequest.user.ext.eids[1], 'criteo', 'criteo_id234'); - userVerify(ortbRequest.user.ext.eids[2], 'identityLink', 'idl_id123'); + userVerify(ortbRequest.user.ext.eids[1], 'criteo.com', 'criteo_id234'); + userVerify(ortbRequest.user.ext.eids[2], 'liveramp.com', 'idl_id123'); userVerify(ortbRequest.user.ext.eids[3], 'id5-sync.com', 'id5id_234'); userVerify(ortbRequest.user.ext.eids[4], 'parrable.com', 'parrable_id234'); - userVerify(ortbRequest.user.ext.eids[5], 'liveintent.com', 'liveintent_id123'); + userVerify(ortbRequest.user.ext.eids[5], 'neustar.biz', 'fabrick_user4'); + userVerify(ortbRequest.user.ext.eids[6], 'audigent.com', 'halo_user1'); + userVerify(ortbRequest.user.ext.eids[7], 'merkleinc.com', 'merkle_user3'); + userVerify(ortbRequest.user.ext.eids[8], 'crwdcntrl.net', 'lotame_user2'); + userVerify(ortbRequest.user.ext.eids[9], 'verizonmedia.com', 'connect_user5'); + userVerify(ortbRequest.user.ext.eids[10], 'uidapi.com', 'uid2_user6'); + userVerify(ortbRequest.user.ext.eids[11], 'liveintent.com', 'liveintent_id123'); }); it('Verify multiple adsizes', function () { const bidRequests = deepClone(slotConfigs); From be25401d8214158a79f2aa6dec1768924a853930 Mon Sep 17 00:00:00 2001 From: Skylinar <53079123+Skylinar@users.noreply.github.com> Date: Wed, 15 Sep 2021 16:07:58 +0200 Subject: [PATCH 055/250] smartx Bid Adapter: fix empty title not configurable (#7417) * Add smartclipBidAdapter * smartxBidAdapter.js - removed unused variables, removed debug, added window before the outstream related functions * - made outstream player configurable * remove wrong named files * camelcase * fix * Out-Stream render update to SmartPlay 5.2 * ESlint fix * ESlint fix * ESlint fix * adjust tests, fixes * ESlint * adjusted desired bitrate examples * added bid.meta.advertiserDomains support * bug fix for numeric elementID outstream render * fix renderer url * support for floors module * bugfixes to be openRTB 2.5 compliant * update internal renderer usage * remove unused outstream_function logic * bugfix outstream options for default outstream renderer configuration * [PREB-10] fix empty title not configurable Co-authored-by: smartclip AdTechnology Co-authored-by: Gino Cirlini --- modules/smartxBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/smartxBidAdapter.js b/modules/smartxBidAdapter.js index 44e70082d9d..73e036cadb0 100644 --- a/modules/smartxBidAdapter.js +++ b/modules/smartxBidAdapter.js @@ -372,7 +372,7 @@ function createOutstreamConfig(bid) { smartPlayObj.endingScreen = false; } - if (confTitle) { + if (confTitle || (typeof bid.renderer.config.outstream_options.title == 'string' && bid.renderer.config.outstream_options.title == '')) { smartPlayObj.title = confTitle; } From 8ab5cfd1d5701caf6087fb16b2d1dbf216a02163 Mon Sep 17 00:00:00 2001 From: ardit-baloku <77985953+ardit-baloku@users.noreply.github.com> Date: Wed, 15 Sep 2021 18:27:46 +0200 Subject: [PATCH 056/250] gjirafa Bid Adapter: add biskoID and segmeents (#7409) * Added integr8 adapter * Added floor module support * Added floor tests * Added integr8 adapter * Added floor module support * Added floor tests * Added biskoId and segments to bid request --- modules/gjirafaBidAdapter.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/gjirafaBidAdapter.js b/modules/gjirafaBidAdapter.js index df33369d6ad..c6777ebe44e 100644 --- a/modules/gjirafaBidAdapter.js +++ b/modules/gjirafaBidAdapter.js @@ -1,10 +1,15 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { getStorageManager } from '../src/storageManager.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; const BIDDER_CODE = 'gjirafa'; const ENDPOINT_URL = 'https://central.gjirafa.com/bid'; const DIMENSION_SEPARATOR = 'x'; const SIZE_SEPARATOR = ';'; +const BISKO_ID = 'biskoId'; +const STORAGE_ID = 'bisko-sid'; +const SEGMENTS = 'biskoSegments'; +const storage = getStorageManager(); export const spec = { code: BIDDER_CODE, @@ -25,9 +30,12 @@ export const spec = { * @return ServerRequest Info describing the request to the server. */ buildRequests: function (validBidRequests, bidderRequest) { + const storageId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(STORAGE_ID) || '' : ''; + const biskoId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(BISKO_ID) || '' : ''; + const segments = storage.localStorageIsEnabled() ? JSON.parse(storage.getDataFromLocalStorage(SEGMENTS)) || [] : []; + let propertyId = ''; let pageViewGuid = ''; - let storageId = ''; let bidderRequestId = ''; let url = ''; let contents = []; @@ -36,7 +44,6 @@ export const spec = { let placements = validBidRequests.map(bidRequest => { if (!propertyId) { propertyId = bidRequest.params.propertyId; } if (!pageViewGuid && bidRequest.params) { pageViewGuid = bidRequest.params.pageViewGuid || ''; } - if (!storageId && bidRequest.params) { storageId = bidRequest.params.storageId || ''; } if (!bidderRequestId) { bidderRequestId = bidRequest.bidderRequestId; } if (!url && bidderRequest) { url = bidderRequest.refererInfo.referer; } if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; } @@ -60,6 +67,8 @@ export const spec = { propertyId: propertyId, pageViewGuid: pageViewGuid, storageId: storageId, + biskoId: biskoId, + segments: segments, url: url, requestid: bidderRequestId, placements: placements, From f01f467838222ffab59ef1d887904b559419b5be Mon Sep 17 00:00:00 2001 From: ardit-baloku <77985953+ardit-baloku@users.noreply.github.com> Date: Wed, 15 Sep 2021 18:35:16 +0200 Subject: [PATCH 057/250] Added biskoId and segments to bid request (#7411) --- modules/integr8BidAdapter.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/integr8BidAdapter.js b/modules/integr8BidAdapter.js index e79878e0b3a..c5415951155 100644 --- a/modules/integr8BidAdapter.js +++ b/modules/integr8BidAdapter.js @@ -1,4 +1,5 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { getStorageManager } from '../src/storageManager.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import * as utils from '../src/utils.js'; @@ -6,6 +7,10 @@ const BIDDER_CODE = 'integr8'; const ENDPOINT_URL = 'https://integr8.central.gjirafa.tech/bid'; const DIMENSION_SEPARATOR = 'x'; const SIZE_SEPARATOR = ';'; +const BISKO_ID = 'biskoId'; +const STORAGE_ID = 'bisko-sid'; +const SEGMENTS = 'biskoSegments'; +const storage = getStorageManager(); export const spec = { code: BIDDER_CODE, @@ -26,9 +31,12 @@ export const spec = { * @return ServerRequest Info describing the request to the server. */ buildRequests: function (validBidRequests, bidderRequest) { + const storageId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(STORAGE_ID) || '' : ''; + const biskoId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(BISKO_ID) || '' : ''; + const segments = storage.localStorageIsEnabled() ? JSON.parse(storage.getDataFromLocalStorage(SEGMENTS)) || [] : []; + let propertyId = ''; let pageViewGuid = ''; - let storageId = ''; let bidderRequestId = ''; let url = ''; let contents = []; @@ -45,7 +53,6 @@ export const spec = { let placements = validBidRequests.map(bidRequest => { if (!propertyId) { propertyId = bidRequest.params.propertyId; } if (!pageViewGuid) { pageViewGuid = bidRequest.params.pageViewGuid || ''; } - if (!storageId) { storageId = bidRequest.params.storageId || ''; } if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; } if (!Object.keys(data).length && bidRequest.params.data && Object.keys(bidRequest.params.data).length) { data = bidRequest.params.data; } @@ -64,6 +71,8 @@ export const spec = { propertyId: propertyId, pageViewGuid: pageViewGuid, storageId: storageId, + biskoId: biskoId, + segments: segments, url: url, requestid: bidderRequestId, placements: placements, From 274b101ba828883ab2c3b8f0f031d342aef660a8 Mon Sep 17 00:00:00 2001 From: ardit-baloku <77985953+ardit-baloku@users.noreply.github.com> Date: Wed, 15 Sep 2021 18:35:46 +0200 Subject: [PATCH 058/250] malltv Bid Adapter : add biskoId, auctionId, and segments (#7410) * Added biskoId and segments to bid request * Added auctionId to bid request --- modules/malltvBidAdapter.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/malltvBidAdapter.js b/modules/malltvBidAdapter.js index 4e600135e0b..a7c5b2a9dde 100644 --- a/modules/malltvBidAdapter.js +++ b/modules/malltvBidAdapter.js @@ -1,10 +1,15 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { getStorageManager } from '../src/storageManager.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; const BIDDER_CODE = 'malltv'; const ENDPOINT_URL = 'https://central.mall.tv/bid'; const DIMENSION_SEPARATOR = 'x'; const SIZE_SEPARATOR = ';'; +const BISKO_ID = 'biskoId'; +const STORAGE_ID = 'bisko-sid'; +const SEGMENTS = 'biskoSegments'; +const storage = getStorageManager(); export const spec = { code: BIDDER_CODE, @@ -25,18 +30,21 @@ export const spec = { * @return ServerRequest Info describing the request to the server. */ buildRequests: function (validBidRequests, bidderRequest) { + const storageId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(STORAGE_ID) || '' : ''; + const biskoId = storage.localStorageIsEnabled() ? storage.getDataFromLocalStorage(BISKO_ID) || '' : ''; + const segments = storage.localStorageIsEnabled() ? JSON.parse(storage.getDataFromLocalStorage(SEGMENTS)) || [] : []; + let propertyId = ''; let pageViewGuid = ''; - let storageId = ''; let bidderRequestId = ''; let url = ''; let contents = []; let data = {}; + let auctionId = bidderRequest ? bidderRequest.auctionId : ''; let placements = validBidRequests.map(bidRequest => { if (!propertyId) { propertyId = bidRequest.params.propertyId; } if (!pageViewGuid && bidRequest.params) { pageViewGuid = bidRequest.params.pageViewGuid || ''; } - if (!storageId && bidRequest.params) { storageId = bidRequest.params.storageId || ''; } if (!bidderRequestId) { bidderRequestId = bidRequest.bidderRequestId; } if (!url && bidderRequest) { url = bidderRequest.refererInfo.referer; } if (!contents.length && bidRequest.params.contents && bidRequest.params.contents.length) { contents = bidRequest.params.contents; } @@ -57,9 +65,12 @@ export const spec = { }); let body = { + auctionId: auctionId, propertyId: propertyId, pageViewGuid: pageViewGuid, storageId: storageId, + biskoId: biskoId, + segments: segments, url: url, requestid: bidderRequestId, placements: placements, From 6b8108fab47a2a0974a418f94c826e918c414644 Mon Sep 17 00:00:00 2001 From: Lisa Benmore Date: Wed, 15 Sep 2021 12:31:12 -0700 Subject: [PATCH 059/250] Gumgum Bid Adapter: remove slotid type checking (#7420) * Gumgum: ADTS-149 Prevent slot ID type coercion before sending request * confirmed with ad server BE that native params should also not be forced integers --- modules/gumgumBidAdapter.js | 8 ++++---- test/spec/modules/gumgumBidAdapter_spec.js | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 3a0862b9aec..7ac43d32d56 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -336,11 +336,11 @@ function buildRequests(validBidRequests, bidderRequest) { const [maxw, maxh] = getGreatestDimensions(sizes); data.maxw = maxw; data.maxh = maxh; - data.si = parseInt(params.slot, 10); + data.si = params.slot; data.pi = 3; data.bf = sizes.reduce((acc, curSlotDim) => `${acc}${acc && ','}${curSlotDim[0]}x${curSlotDim[1]}`, ''); } else if (params.native) { - data.ni = parseInt(params.native, 10); + data.ni = params.native; data.pi = 5; } else if (mediaTypes.video) { data.pi = mediaTypes.video.linearity === 2 ? 6 : 7; // invideo : video @@ -391,12 +391,12 @@ function handleLegacyParams(params, sizes) { const [maxw, maxh] = getGreatestDimensions(sizes); data.maxw = maxw; data.maxh = maxh; - data.si = parseInt(params.inSlot, 10); + data.si = params.inSlot; data.pi = 3; data.bf = sizes.reduce((acc, curSlotDim) => `${acc}${acc && ','}${curSlotDim[0]}x${curSlotDim[1]}`, ''); } if (params.ICV) { - data.ni = parseInt(params.ICV, 10); + data.ni = params.ICV; data.pi = 5; } if (params.videoPubID) { diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index 6c3b4eb680d..e91308849ed 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -177,7 +177,27 @@ describe('gumgumAdapter', function () { expect(slotZoneBidRequest.data.maxh).to.equal(600); expect(slotPubIdBidRequest.data.maxw).to.equal(300); expect(slotPubIdBidRequest.data.maxh).to.equal(600); - }) + }); + + // if slot ID is set up incorrectly by a pub, we should send the invalid ID to be + // invalidated by ad server instead of trying to force integer type. forcing + // integer type can result in incorrect slot IDs that correlate to the incorrect pub ID + it('should send params.slot or params.inSlot as string when configured incorrectly', function () { + const invalidSlotId = '9gkal1cn'; + const slotRequest = { ...bidRequests[0] }; + const legacySlotRequest = { ...bidRequests[0] }; + let req; + let legReq; + + slotRequest.params.slot = invalidSlotId; + legacySlotRequest.params.inSlot = invalidSlotId; + + req = spec.buildRequests([ slotRequest ])[0]; + legReq = spec.buildRequests([ legacySlotRequest ])[0]; + + expect(req.data.si).to.equal(invalidSlotId); + expect(legReq.data.si).to.equal(invalidSlotId); + }); it('should set the iriscat param when found', function () { const request = { ...bidRequests[0], params: { iriscat: 'abc123' } } From 51c3c0d320d745e8661a2f0fe102af330fc3eb26 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 16 Sep 2021 05:02:30 -0700 Subject: [PATCH 060/250] Fluct Bid Adapter: add adomain for Prebid 5 compliance (#7353) * add fluct * add newline for linting --- modules/fluctBidAdapter.js | 125 +++++++++++++ test/spec/modules/fluctBidAdapter_spec.js | 213 ++++++++++++++++++++++ 2 files changed, 338 insertions(+) create mode 100644 modules/fluctBidAdapter.js create mode 100644 test/spec/modules/fluctBidAdapter_spec.js diff --git a/modules/fluctBidAdapter.js b/modules/fluctBidAdapter.js new file mode 100644 index 00000000000..5d25043f1bf --- /dev/null +++ b/modules/fluctBidAdapter.js @@ -0,0 +1,125 @@ +import * as utils from '../src/utils.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; + +const BIDDER_CODE = 'fluct'; +const END_POINT = 'https://hb.adingo.jp/prebid'; +const VERSION = '1.2'; +const NET_REVENUE = true; +const TTL = 300; + +export const spec = { + code: BIDDER_CODE, + aliases: ['adingo'], + + /** + * Determines whether or not the given bid request is valid. + * + * @param {BidRequest} bid The bid params to validate. + * @return boolean True if this is a valid bid, and false otherwise. + */ + isBidRequestValid: (bid) => { + return !!(bid.params.groupId && bid.params.tagId); + }, + + /** + * Make a server request from the list of BidRequests. + * + * @param {validBidRequests[]} - an array of bids. + * @return ServerRequest Info describing the request to the server. + */ + buildRequests: (validBidRequests, bidderRequest) => { + const serverRequests = []; + const referer = bidderRequest.refererInfo.referer; + + utils._each(validBidRequests, (request) => { + const data = Object(); + + data.referer = referer; + data.adUnitCode = request.adUnitCode; + data.bidId = request.bidId; + data.transactionId = request.transactionId; + + data.sizes = []; + utils._each(request.sizes, (size) => { + data.sizes.push({ + w: size[0], + h: size[1] + }); + }); + + data.params = request.params; + const searchParams = new URLSearchParams(request.params); + + serverRequests.push({ + method: 'POST', + url: END_POINT + '?' + searchParams.toString(), + options: { + contentType: 'application/json', + withCredentials: true, + customHeaders: { + 'x-fluct-app': 'prebid/fluctBidAdapter', + 'x-fluct-version': VERSION, + 'x-openrtb-version': 2.5 + } + }, + data: data + }); + }); + + return serverRequests; + }, + + /* + * Unpack the respnse from the server into a list of bids. + * + * @param {serverResponse} serverResponse A successful response from the server. + * @return {bid[]} An array of bids which weer nested inside the server. + */ + interpretResponse: (serverResponse, serverRequest) => { + const bidResponses = []; + + const res = serverResponse.body; + if (!utils.isEmpty(res) && !utils.isEmpty(res.seatbid) && !utils.isEmpty(res.seatbid[0].bid)) { + const bid = res.seatbid[0].bid[0]; + const dealId = bid.dealid; + const beaconUrl = bid.burl; + const callImpBeacon = ``; + let data = { + bidderCode: BIDDER_CODE, + requestId: res.id, + currency: res.cur, + cpm: parseFloat(bid.price) || 0, + netRevenue: NET_REVENUE, + width: bid.w, + height: bid.h, + creativeId: bid.crid, + ttl: TTL, + ad: bid.adm + callImpBeacon, + meta: { + advertiserDomains: bid.adomain || [], + }, + }; + if (!utils.isEmpty(dealId)) { + data.dealId = dealId; + } + bidResponses.push(data); + } + return bidResponses; + }, + + /* + * Register the user sync pixels which should be dropped after the auction. + * + * @params {syncOptions} syncOptions which user syncs are allowed? + * @params {ServerResponse[]} serverResponses List of server's responses. + * @return {UserSync[]} The user syncs which should be dropped. + * + */ + getUserSyncs: (syncOptions, serverResponses) => { + return []; + }, +}; + +registerBidder(spec); diff --git a/test/spec/modules/fluctBidAdapter_spec.js b/test/spec/modules/fluctBidAdapter_spec.js new file mode 100644 index 00000000000..70666532442 --- /dev/null +++ b/test/spec/modules/fluctBidAdapter_spec.js @@ -0,0 +1,213 @@ +import {expect} from 'chai'; +import {spec} from 'modules/fluctBidAdapter'; +import {newBidder} from 'src/adapters/bidderFactory'; +import {config} from 'src/config'; + +describe('fluctAdapter', 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 () { + const bid = { + bidder: 'fluct', + params: { + dfpUnitCode: '/1000/dfp_unit_code', + tagId: '10000:100000001', + groupId: '1000000002', + } + }; + it('should return true when required params found', function () { + expect(spec.isBidRequestValid(bid)).to.equal(true); + }); + + it('should return false when required params are not passed', function () { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = {}; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return true when dfpUnitCode is not passed', function () { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = { + tagId: '10000:100000001', + groupId: '1000000002', + }; + expect(spec.isBidRequestValid(bid)).to.equal(true); + }); + + it('should return false when groupId is not passed', function () { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = { + dfpUnitCode: '/1000/dfp_unit_code', + tagId: '10000:100000001', + }; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + }); + + describe('buildRequests', function () { + const bidRequests = [{ + bidder: 'fluct', + params: { + dfpUnitCode: '/100000/unit_code', + tagId: '10000:100000001', + groupId: '1000000002', + }, + adUnitCode: '/10000/unit_code', + sizes: [[300, 250], [336, 280]], + bidId: '237f4d1a293f99', + bidderRequestId: '1a857fa34c1c96', + auctionId: 'a297d1aa-7900-4ce4-a0aa-caa8d46c4af7', + transactionId: '00b2896c-2731-4f01-83e4-7a3ad5da13b6', + }]; + const bidderRequest = { + refererInfo: { + referer: 'http://example.com' + } + }; + + it('sends bid request to ENDPOINT via POST', function () { + const request = spec.buildRequests(bidRequests, bidderRequest)[0]; + expect(request.method).to.equal('POST'); + }); + + it('sends bid request to ENDPOINT with query parameter', function () { + const request = spec.buildRequests(bidRequests, bidderRequest)[0]; + expect(request.url).to.equal('https://hb.adingo.jp/prebid?dfpUnitCode=%2F100000%2Funit_code&tagId=10000%3A100000001&groupId=1000000002'); + }); + }); + + describe('interpretResponse', function() { + const callBeaconSnippet = ''; + + it('should get correct bid response', function() { + const bidRequest = { + bidder: 'fluct', + params: { + dfpUnitCode: '/10000/unit_code', + tagid: '10000:100000001', + groupId: '1000000002', + }, + adUnitCode: '/10000/unit_code', + sizes: [[300, 250], [336, 280]], + bidId: '237f4d1a293f99', + bidderRequestId: '1a857fa34c1c96', + auctionId: 'a297d1aa-7900-4ce4-a0aa-caa8d46c4af7', + transactionId: '00b2896c-2731-4f01-83e4-7a3ad5da13b6', + }; + + const serverResponse = { + body: { + id: '237f4d1a293f99', + cur: 'JPY', + seatbid: [{ + bid: [{ + price: 100, + w: 300, + h: 250, + adm: '', + burl: 'https://i.adingo.jp/?test=1&et=hb&bidid=237f4d1a293f99', + crid: 'test_creative', + adomain: ['test_adomain'] + }] + }] + } + }; + + const expectedResponse = [ + { + bidderCode: 'fluct', + requestId: '237f4d1a293f99', + currency: 'JPY', + cpm: 100, + netRevenue: true, + width: 300, + height: 250, + creativeId: 'test_creative', + ttl: 300, + ad: '' + callBeaconSnippet, + meta: { + advertiserDomains: ['test_adomain'], + }, + } + ]; + + const result = spec.interpretResponse(serverResponse, bidRequest); + expect(result).to.have.lengthOf(1); + expect(result).to.deep.have.same.members(expectedResponse); + }); + + it('should get correct bid response with dealId', function() { + const bidRequest = { + bidder: 'fluct', + params: { + dfpUnitCode: '/10000/unit_code', + tagid: '10000:100000001', + groupId: '1000000002' + }, + adUnitCode: '/10000/unit_code', + sizes: [[300, 250], [336, 280]], + bidId: '237f4d1a293f99', + bidderRequestId: '1a857fa34c1c96', + auctionId: 'a297d1aa-7900-4ce4-a0aa-caa8d46c4af7', + transactionId: '00b2896c-2731-4f01-83e4-7a3ad5da13b6', + }; + + const serverResponse = { + body: { + id: '237f4d1a293f99', + cur: 'JPY', + seatbid: [{ + bid: [{ + price: 100, + w: 300, + h: 250, + adm: '', + burl: 'https://i.adingo.jp/?test=1&et=hb&bidid=237f4d1a293f99', + crid: 'test_creative', + dealid: 'test_deal', + }] + }] + } + }; + + const expectedResponse = [ + { + bidderCode: 'fluct', + requestId: '237f4d1a293f99', + currency: 'JPY', + cpm: 100, + netRevenue: true, + width: 300, + height: 250, + creativeId: 'test_creative', + ttl: 300, + ad: '' + callBeaconSnippet, + dealId: 'test_deal', + meta: { + advertiserDomains: [], + }, + } + ]; + + const result = spec.interpretResponse(serverResponse, bidRequest); + expect(result).to.have.lengthOf(1); + expect(result).to.deep.have.same.members(expectedResponse); + }); + + it('should get empty response when bid server returns 204', function() { + expect(spec.interpretResponse({})).to.be.empty; + }); + }); +}); From 84f82c316c8aaeae8f2b81342dac9924bd114bb7 Mon Sep 17 00:00:00 2001 From: SKOCHERI <37454420+SKOCHERI@users.noreply.github.com> Date: Thu, 16 Sep 2021 05:05:17 -0700 Subject: [PATCH 061/250] Merkle Id System: make endpoint optionally configurable (#7404) --- integrationExamples/gpt/userId_example.html | 1 + modules/merkleIdSystem.js | 22 +- test/spec/modules/merkleIdSystem_spec.js | 212 ++++++++++++++++++++ 3 files changed, 227 insertions(+), 8 deletions(-) create mode 100644 test/spec/modules/merkleIdSystem_spec.js diff --git a/integrationExamples/gpt/userId_example.html b/integrationExamples/gpt/userId_example.html index dfea06d17d0..653dd9c59f3 100644 --- a/integrationExamples/gpt/userId_example.html +++ b/integrationExamples/gpt/userId_example.html @@ -154,6 +154,7 @@ { "name": "merkleId", "params": { + "endpoint": "https://test_endpoint/", "vendor": "sdfg", "sv_cid": "dfg", "sv_pubid": "xcv", diff --git a/modules/merkleIdSystem.js b/modules/merkleIdSystem.js index 4ab29ec6f68..bcb2b943834 100644 --- a/modules/merkleIdSystem.js +++ b/modules/merkleIdSystem.js @@ -6,7 +6,7 @@ */ import * as utils from '../src/utils.js' -import {ajax} from '../src/ajax.js'; +import * as ajaxLib from '../src/ajax.js'; import {submodule} from '../src/hook.js' import {getStorageManager} from '../src/storageManager.js'; @@ -42,7 +42,7 @@ function setSession(storage, response) { function constructUrl(configParams) { const session = getSession(configParams); - let url = ID_URL + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; + let url = configParams.endpoint + `?vendor=${configParams.vendor}&sv_cid=${configParams.sv_cid}&sv_domain=${configParams.sv_domain}&sv_pubid=${configParams.sv_pubid}`; if (session) { url = `${url}&sv_session=${session}`; } @@ -54,8 +54,9 @@ function generateId(configParams, configStorage) { const url = constructUrl(configParams); const resp = function (callback) { - const callbacks = { - success: response => { + ajaxLib.ajaxBuilder()( + url, + response => { let responseObj; if (response) { try { @@ -72,12 +73,12 @@ function generateId(configParams, configStorage) { utils.logInfo('Merkle responseObj with date ' + JSON.stringify(responseObj)); callback(responseObj); }, - error: error => { + error => { utils.logError(`${MODULE_NAME}: merkleId fetch encountered an error`, error); callback(); - } - }; - ajax(url, callbacks, undefined, {method: 'GET', withCredentials: true}); + }, + {method: 'GET', withCredentials: true} + ); }; return resp; } @@ -126,10 +127,15 @@ export const merkleIdSubmodule = { utils.logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); return; } + if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) { utils.logError('User ID - merkleId submodule does not currently handle consent strings'); return; } + if (typeof configParams.endpoint !== 'string') { + utils.logWarn('User ID - merkleId submodule endpoint string is not defined'); + configParams.endpoint = ID_URL + } if (typeof configParams.sv_domain !== 'string') { configParams.sv_domain = merkleIdSubmodule.findRootDomain(); diff --git a/test/spec/modules/merkleIdSystem_spec.js b/test/spec/modules/merkleIdSystem_spec.js new file mode 100644 index 00000000000..64dfc0d463c --- /dev/null +++ b/test/spec/modules/merkleIdSystem_spec.js @@ -0,0 +1,212 @@ +import * as ajaxLib from 'src/ajax.js'; +import * as utils from 'src/utils.js'; +import {merkleIdSubmodule} from 'modules/merkleIdSystem.js'; + +import sinon from 'sinon'; + +let expect = require('chai').expect; + +const CONFIG_PARAMS = { + endpoint: 'https://test/id', + vendor: 'idsv2', + sv_cid: '5344_04531', + sv_pubid: '11314', + sv_domain: 'www.testDomain.com', + sv_session: 'testsession' +}; + +const STORAGE_PARAMS = { + type: 'cookie', + name: 'merkle', + expires: 10, + refreshInSeconds: 10 +}; + +const MOCK_RESPONSE = { + c: { + name: '_svsid', + value: '123876327647627364236478' + } +}; + +function mockResponse( + responseText, + response = (url, successCallback) => successCallback(responseText)) { + return function() { + return response; + } +} + +describe('Merkle System', function () { + describe('Merkle System getId()', function () { + const callbackSpy = sinon.spy(); + let sandbox; + let ajaxStub; + + beforeEach(function () { + sandbox = sinon.sandbox.create(); + sinon.stub(utils, 'logInfo'); + sinon.stub(utils, 'logWarn'); + sinon.stub(utils, 'logError'); + callbackSpy.resetHistory(); + ajaxStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(mockResponse(JSON.stringify(MOCK_RESPONSE))); + }); + + afterEach(function () { + utils.logInfo.restore(); + utils.logWarn.restore(); + utils.logError.restore(); + ajaxStub.restore(); + }); + + it('getId() should fail on missing vendor', function () { + let config = { + params: { + ...CONFIG_PARAMS, + vendor: undefined + }, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined); + expect(submoduleCallback).to.be.undefined; + expect(utils.logError.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule requires a valid vendor to be defined'); + }); + + it('getId() should fail on missing vendor', function () { + let config = { + params: { + ...CONFIG_PARAMS, + vendor: undefined + }, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined); + expect(submoduleCallback).to.be.undefined; + expect(utils.logError.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule requires a valid vendor to be defined'); + }); + + it('getId() should fail on missing sv_cid', function () { + let config = { + params: { + ...CONFIG_PARAMS, + sv_cid: undefined + }, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined); + expect(submoduleCallback).to.be.undefined; + expect(utils.logError.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule requires a valid sv_cid string to be defined'); + }); + + it('getId() should fail on missing sv_pubid', function () { + let config = { + params: { + ...CONFIG_PARAMS, + sv_pubid: undefined + }, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined); + expect(submoduleCallback).to.be.undefined; + expect(utils.logError.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); + }); + + it('getId() should warn on missing endpoint', function () { + let config = { + params: { + ...CONFIG_PARAMS, + endpoint: undefined + }, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined).callback; + submoduleCallback(callbackSpy); + expect(callbackSpy.calledOnce).to.be.true; + expect(utils.logWarn.args[0][0]).to.exist.and.to.equal('User ID - merkleId submodule endpoint string is not defined'); + }); + + it('getId() should handle callback with valid configuration', function () { + let config = { + params: CONFIG_PARAMS, + storage: STORAGE_PARAMS + }; + + let submoduleCallback = merkleIdSubmodule.getId(config, undefined).callback; + submoduleCallback(callbackSpy); + expect(callbackSpy.calledOnce).to.be.true; + }); + }); + + describe('Merkle System extendId()', function () { + const callbackSpy = sinon.spy(); + let sandbox; + let ajaxStub; + + beforeEach(function () { + sandbox = sinon.sandbox.create(); + sinon.stub(utils, 'logInfo'); + sinon.stub(utils, 'logWarn'); + sinon.stub(utils, 'logError'); + callbackSpy.resetHistory(); + ajaxStub = sinon.stub(ajaxLib, 'ajaxBuilder').callsFake(mockResponse(JSON.stringify(MOCK_RESPONSE))); + }); + + afterEach(function () { + utils.logInfo.restore(); + utils.logWarn.restore(); + utils.logError.restore(); + ajaxStub.restore(); + }); + + it('extendId() get storedid', function () { + let config = { + params: { + ...CONFIG_PARAMS, + }, + storage: STORAGE_PARAMS + }; + + let id = merkleIdSubmodule.extendId(config, undefined, 'Merkle_Stored_ID'); + expect(id.id).to.exist.and.to.equal('Merkle_Stored_ID'); + }); + + it('extendId() get storedId on configured storageParam.refreshInSeconds', function () { + let config = { + params: { + ...CONFIG_PARAMS, + refreshInSeconds: 1000 + }, + storage: STORAGE_PARAMS + }; + + let yesterday = new Date(Date.now() - 86400000).toUTCString(); + let storedId = {value: 'Merkle_Stored_ID', date: yesterday}; + + let id = merkleIdSubmodule.extendId(config, undefined, + storedId); + + expect(id.id).to.exist.and.to.equal(storedId); + }); + + it('extendId() callback on configured storageParam.refreshInSeconds', function () { + let config = { + params: { + ...CONFIG_PARAMS, + refreshInSeconds: 1 + } + }; + + let yesterday = new Date(Date.now() - 86400000).toUTCString(); + let storedId = {value: 'Merkle_Stored_ID', date: yesterday}; + + let submoduleCallback = merkleIdSubmodule.extendId(config, undefined, storedId).callback; + submoduleCallback(callbackSpy); + expect(callbackSpy.calledOnce).to.be.true; + }); + }); +}); From 66a76a15eb4d5b637d0aae1a4d9005c78a84249e Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 16 Sep 2021 08:52:33 -0400 Subject: [PATCH 062/250] Timeout RTD Provider & Insticator & Sharethrough Bid Adapter: bug fixes for imports (#7424) * Update timeoutRtdProvider.js * Update timeoutRtdProvider.js * Update timeoutRtdProvider.js * Update sharethroughBidAdapter.js * Update sharethroughBidAdapter.js * Update sharethroughBidAdapter.js * Update insticatorBidAdapter.js --- modules/insticatorBidAdapter.js | 3 ++- modules/sharethroughBidAdapter.js | 3 ++- modules/timeoutRtdProvider.js | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/insticatorBidAdapter.js b/modules/insticatorBidAdapter.js index a081873e78c..47a3353a897 100644 --- a/modules/insticatorBidAdapter.js +++ b/modules/insticatorBidAdapter.js @@ -7,6 +7,7 @@ import { logError, } from '../src/utils.js'; import { getStorageManager } from '../src/storageManager.js'; +import find from 'core-js-pure/features/array/find.js'; const BIDDER_CODE = 'insticator'; const ENDPOINT = 'https://ex.ingage.tech/v1/openrtb'; // production endpoint @@ -151,7 +152,7 @@ function buildRequest(validBidRequests, bidderRequest) { } function buildBid(bid, bidderRequest) { - const originalBid = bidderRequest.bids.find((b) => b.bidId === bid.impid); + const originalBid = find(bidderRequest.bids, (b) => b.bidId === bid.impid); return { requestId: bid.impid, diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 24ab2530014..3b4f0ec2a4e 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -3,6 +3,7 @@ import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { createEidsArray } from './userId/eids.js'; +import find from 'core-js-pure/features/array/find.js'; const VERSION = '4.0.0'; const BIDDER_CODE = 'sharethrough'; @@ -270,7 +271,7 @@ function getProtocol() { } function matchRequest(id, request) { - return request.bidRequests.find(bid => bid.bidId === id); + return find(request.bidRequests, bid => bid.bidId === id); } // stub for ?? operator diff --git a/modules/timeoutRtdProvider.js b/modules/timeoutRtdProvider.js index 020a7d6f7f0..8f68cf1bcc5 100644 --- a/modules/timeoutRtdProvider.js +++ b/modules/timeoutRtdProvider.js @@ -15,6 +15,14 @@ export const timeoutRtdFunctions = { handleTimeoutIncrement }; +const entries = Object.entries || function(obj) { + const ownProps = Object.keys(obj); + let i = ownProps.length; + let resArray = new Array(i); + while (i--) { resArray[i] = [ownProps[i], obj[ownProps[i]]]; } + return resArray; +}; + function getDeviceType() { const userAgent = window.navigator.userAgent.toLowerCase(); if ((/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent))) { @@ -78,7 +86,7 @@ function calculateTimeoutModifier(adUnits, rules) { if (rules.numAdUnits[numAdUnits]) { timeoutModifier += rules.numAdUnits[numAdUnits]; } else { - for (const [rangeStr, timeoutVal] of Object.entries(rules.numAdUnits)) { + for (const [rangeStr, timeoutVal] of entries(rules.numAdUnits)) { const [lowerBound, upperBound] = rangeStr.split('-'); if (parseInt(lowerBound) <= numAdUnits && numAdUnits <= parseInt(upperBound)) { utils.logInfo(`Adding ${timeoutVal} to timeout for numAdUnits ${numAdUnits}`) From 585ca01e5e9c0963edc32e2419aa0ae6e47c06c7 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 16 Sep 2021 13:37:04 -0400 Subject: [PATCH 063/250] Publink UserId Submodule: publinkIdSystem_spec.js test fix on ie11 (#7425) --- test/spec/modules/publinkIdSystem_spec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/spec/modules/publinkIdSystem_spec.js b/test/spec/modules/publinkIdSystem_spec.js index 326285709f3..2999fda5aa0 100644 --- a/test/spec/modules/publinkIdSystem_spec.js +++ b/test/spec/modules/publinkIdSystem_spec.js @@ -88,6 +88,7 @@ describe('PublinkIdSystem', () => { submoduleCallback(callbackSpy); let request = server.requests[0]; + request.url = request.url.replace(':443', ''); expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&gdpr=1&gdpr_consent=myconsentstring'); request.respond(200, {}, JSON.stringify(serverResponse)); @@ -101,6 +102,7 @@ describe('PublinkIdSystem', () => { submoduleCallback(callbackSpy); let request = server.requests[0]; + request.url = request.url.replace(':443', ''); expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$'); request.respond(204, {}, JSON.stringify(serverResponse)); @@ -125,6 +127,7 @@ describe('PublinkIdSystem', () => { submoduleCallback(callbackSpy); let request = server.requests[0]; + request.url = request.url.replace(':443', ''); expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&us_privacy=1YNN'); request.respond(200, {}, JSON.stringify(serverResponse)); From 911ceb34fc650b3d7edd6153476191deff8f5059 Mon Sep 17 00:00:00 2001 From: onetag-dev <38786435+onetag-dev@users.noreply.github.com> Date: Thu, 16 Sep 2021 19:43:21 +0200 Subject: [PATCH 064/250] Fix ancestorOrigin access (#7429) Co-authored-by: francesco --- modules/onetagBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/onetagBidAdapter.js b/modules/onetagBidAdapter.js index 7a0b78ceeff..c8899070e5e 100644 --- a/modules/onetagBidAdapter.js +++ b/modules/onetagBidAdapter.js @@ -206,8 +206,8 @@ function getPageInfo() { ? topmostFrame.document.referrer : null, ancestorOrigin: - window.location.ancestorOrigins && window.location.ancestorOrigins[0] != null - ? window.location.ancestorOrigins[0] + window.location.ancestorOrigins && window.location.ancestorOrigins.length > 0 + ? window.location.ancestorOrigins[window.location.ancestorOrigins.length - 1] : null, masked: currentFrameNesting, wWidth: topmostFrame.innerWidth, From 76f708a8a16adcbd344db330c37d885261eecba0 Mon Sep 17 00:00:00 2001 From: dzhang-criteo <87757739+dzhang-criteo@users.noreply.github.com> Date: Thu, 16 Sep 2021 19:58:43 +0200 Subject: [PATCH 065/250] Criteo Bid Adapter: update FastBid version to 113 (#7418) --- modules/criteoBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/criteoBidAdapter.js b/modules/criteoBidAdapter.js index aa7308d1f4c..e7267048e8a 100644 --- a/modules/criteoBidAdapter.js +++ b/modules/criteoBidAdapter.js @@ -24,7 +24,7 @@ const LOG_PREFIX = 'Criteo: '; Unminified source code can be found in the privately shared repo: https://github.com/Prebid-org/prebid-js-external-js-criteo/blob/master/dist/prod.js */ const FAST_BID_VERSION_PLACEHOLDER = '%FAST_BID_VERSION%'; -export const FAST_BID_VERSION_CURRENT = 105; +export const FAST_BID_VERSION_CURRENT = 113; const FAST_BID_VERSION_LATEST = 'latest'; const FAST_BID_VERSION_NONE = 'none'; const PUBLISHER_TAG_URL_TEMPLATE = 'https://static.criteo.net/js/ld/publishertag.prebid' + FAST_BID_VERSION_PLACEHOLDER + '.js'; From 627ee1a83921f776bd029d9d12a619fda5db880b Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 16 Sep 2021 14:13:02 -0400 Subject: [PATCH 066/250] Nativo Bid Adapter: Define GVLID (#7432) * Update nativoBidAdapter.js * Update nativoBidAdapter.js --- modules/nativoBidAdapter.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index 880ff4b6a8e..2f63dcb45f8 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -1,22 +1,25 @@ -import * as utils from '../src/utils.js' -import { registerBidder } from '../src/adapters/bidderFactory.js' -import { BANNER } from '../src/mediaTypes.js' +import * as utils from '../src/utils.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER } from '../src/mediaTypes.js'; // import { config } from 'src/config' -const BIDDER_CODE = 'nativo' -const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid' +const BIDDER_CODE = 'nativo'; +const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'; -const TIME_TO_LIVE = 360 +const GVLID = 263; -const SUPPORTED_AD_TYPES = [BANNER] +const TIME_TO_LIVE = 360; -const bidRequestMap = {} -const adUnitsRequested = {} +const SUPPORTED_AD_TYPES = [BANNER]; + +const bidRequestMap = {}; +const adUnitsRequested = {}; // Prebid adapter referrence doc: https://docs.prebid.org/dev-docs/bidder-adaptor.html export const spec = { code: BIDDER_CODE, + gvlid: GVLID, aliases: ['ntv'], // short code supportedMediaTypes: SUPPORTED_AD_TYPES, From 99b61caeb30f47c43b8d1b502709605d073f3555 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Thu, 16 Sep 2021 11:17:18 -0700 Subject: [PATCH 067/250] PubMatic bid adapter: while retrieving floor from floor module pass banner-sizes instead of * (#7419) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * use minimum floor from each size * added comments * floor retrieval: removed custom logic for Video; will pass * for video * added some logs * corrected teh value * indent * modified the test cases * read banner sizes from impObj than bid object --- modules/pubmaticBidAdapter.js | 34 +++++++++++++++++--- test/spec/modules/pubmaticBidAdapter_spec.js | 27 ++++++++++++---- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index 7edeb5589d1..46e3257ae2e 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -740,22 +740,48 @@ function _addFloorFromFloorModule(impObj, bid) { if (typeof bid.getFloor === 'function' && !config.getConfig('pubmatic.disableFloors')) { [BANNER, VIDEO, NATIVE].forEach(mediaType => { if (impObj.hasOwnProperty(mediaType)) { - let floorInfo = bid.getFloor({ currency: impObj.bidfloorcur, mediaType: mediaType, size: '*' }); - if (typeof floorInfo === 'object' && floorInfo.currency === impObj.bidfloorcur && !isNaN(parseInt(floorInfo.floor))) { - let mediaTypeFloor = parseFloat(floorInfo.floor); - bidFloor = (bidFloor == -1 ? mediaTypeFloor : Math.min(mediaTypeFloor, bidFloor)) + let sizesArray = []; + + if (mediaType === 'banner') { + if (impObj[mediaType].w && impObj[mediaType].h) { + sizesArray.push([impObj[mediaType].w, impObj[mediaType].h]); + } + if (utils.isArray(impObj[mediaType].format)) { + impObj[mediaType].format.forEach(size => sizesArray.push([size.w, size.h])); + } + } + + if (sizesArray.length === 0) { + sizesArray.push('*') } + + sizesArray.forEach(size => { + let floorInfo = bid.getFloor({ currency: impObj.bidfloorcur, mediaType: mediaType, size: size }); + utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module returned for mediatype:', mediaType, ' and size:', size, ' is: currency', floorInfo.currency, 'floor', floorInfo.floor); + if (typeof floorInfo === 'object' && floorInfo.currency === impObj.bidfloorcur && !isNaN(parseInt(floorInfo.floor))) { + let mediaTypeFloor = parseFloat(floorInfo.floor); + utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module:', mediaTypeFloor, 'previous floor value', bidFloor, 'Min:', Math.min(mediaTypeFloor, bidFloor)); + if (bidFloor === -1) { + bidFloor = mediaTypeFloor; + } else { + bidFloor = Math.min(mediaTypeFloor, bidFloor) + } + utils.logInfo(LOG_WARN_PREFIX, 'new floor value:', bidFloor); + } + }); } }); } // get highest from impObj.bidfllor and floor from floor module // as we are using Math.max, it is ok if we have not got any floor from floorModule, then value of bidFloor will be -1 if (impObj.bidfloor) { + utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module:', bidFloor, 'impObj.bidfloor', impObj.bidfloor, 'Max:', Math.max(bidFloor, impObj.bidfloor)); bidFloor = Math.max(bidFloor, impObj.bidfloor) } // assign value only if bidFloor is > 0 impObj.bidfloor = ((!isNaN(bidFloor) && bidFloor > 0) ? bidFloor : UNDEFINED); + utils.logInfo(LOG_WARN_PREFIX, 'new impObj.bidfloor value:', impObj.bidfloor); } function _getFlocId(validBidRequests, flocFormat) { diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index df3516579de..54da555e6ce 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -1846,14 +1846,25 @@ describe('PubMatic adapter', function () { let newRequest; let floorModuleTestData; let getFloor = function(req) { - return floorModuleTestData[req.mediaType]; + // actual getFloor module does not work like this :) + // special treatment for banner since for other mediaTypes we pass * + if (req.mediaType === 'banner') { + return floorModuleTestData[req.mediaType][ req.size[0] + 'x' + req.size[1] ] || {}; + } + return floorModuleTestData[req.mediaType] || {}; }; beforeEach(() => { floorModuleTestData = { 'banner': { - 'currency': 'USD', - 'floor': 1.50 + '300x250': { + 'currency': 'USD', + 'floor': 1.50 + }, + '300x600': { + 'currency': 'USD', + 'floor': 2.0 + } }, 'video': { 'currency': 'USD', @@ -1869,7 +1880,7 @@ describe('PubMatic adapter', function () { }); it('bidfloor should be undefined if calculation is <= 0', function() { - floorModuleTestData.banner.floor = 0; // lowest of them all + floorModuleTestData.banner['300x250'].floor = 0; // lowest of them all newRequest[0].params.kadfloor = undefined; let request = spec.buildRequests(newRequest, { auctionId: 'new-auction-id' @@ -1880,7 +1891,8 @@ describe('PubMatic adapter', function () { }); it('ignore floormodule o/p if floor is not number', function() { - floorModuleTestData.banner.floor = 'INR'; + floorModuleTestData.banner['300x250'].floor = 'Not-a-Number'; + floorModuleTestData.banner['300x600'].floor = 'Not-a-Number'; newRequest[0].params.kadfloor = undefined; let request = spec.buildRequests(newRequest, { auctionId: 'new-auction-id' @@ -1891,7 +1903,8 @@ describe('PubMatic adapter', function () { }); it('ignore floormodule o/p if currency is not matched', function() { - floorModuleTestData.banner.currency = 'INR'; + floorModuleTestData.banner['300x250'].currency = 'INR'; + floorModuleTestData.banner['300x600'].currency = 'INR'; newRequest[0].params.kadfloor = undefined; let request = spec.buildRequests(newRequest, { auctionId: 'new-auction-id' @@ -1921,7 +1934,7 @@ describe('PubMatic adapter', function () { expect(data.bidfloor).to.equal(3); }); - it('kadfloor is passed as 1, use min of fllorModule as it is highest', function() { + it('kadfloor is passed as 1, use min of floorModule as it is highest', function() { newRequest[0].params.kadfloor = '1.0';// yes, we want it as a string let request = spec.buildRequests(newRequest, { auctionId: 'new-auction-id' From 8aeb105326242b0c3f4c7abc19d227711e49dc23 Mon Sep 17 00:00:00 2001 From: Matt Kendall <1870166+mkendall07@users.noreply.github.com> Date: Thu, 16 Sep 2021 14:27:06 -0400 Subject: [PATCH 068/250] 5.14.0 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 769dc0bbbf9..5c8f9b5ec23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.14.0-pre", + "version": "5.14.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From da820a0cd9bea49e856f70c3323559f74d57903b Mon Sep 17 00:00:00 2001 From: Matt Kendall <1870166+mkendall07@users.noreply.github.com> Date: Thu, 16 Sep 2021 14:56:02 -0400 Subject: [PATCH 069/250] 5.15.0-pre --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5c8f9b5ec23..b6a861f60d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.14.0", + "version": "5.15.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From d4ea3639d8262b8781680e8b3bef2c9bd3b5fe0d Mon Sep 17 00:00:00 2001 From: Jurij Sinickij Date: Thu, 16 Sep 2021 23:49:12 +0300 Subject: [PATCH 070/250] Adf adapter: price floors module support (#7427) --- modules/adfBidAdapter.js | 10 ++++- test/spec/modules/adfBidAdapter_spec.js | 55 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/modules/adfBidAdapter.js b/modules/adfBidAdapter.js index 43dcdcd1604..2153f12316f 100644 --- a/modules/adfBidAdapter.js +++ b/modules/adfBidAdapter.js @@ -99,9 +99,17 @@ export const spec = { const imp = validBidRequests.map((bid, id) => { bid.netRevenue = pt; + const floorInfo = bid.getFloor ? bid.getFloor({ + currency: currency || 'USD' + }) : {}; + const bidfloor = floorInfo.floor; + const bidfloorcur = floorInfo.currency; + const imp = { id: id + 1, - tagid: bid.params.mid + tagid: bid.params.mid, + bidfloor, + bidfloorcur }; const assets = utils._map(bid.nativeParams, (bidParams, key) => { diff --git a/test/spec/modules/adfBidAdapter_spec.js b/test/spec/modules/adfBidAdapter_spec.js index ef11490529a..c8697032b3f 100644 --- a/test/spec/modules/adfBidAdapter_spec.js +++ b/test/spec/modules/adfBidAdapter_spec.js @@ -331,6 +331,61 @@ describe('Adf adapter', function () { } }); + describe('price floors', function () { + it('should not add if floors module not configured', function () { + const validBidRequests = [{ bidId: 'bidId', params: {mid: 1000}, mediaTypes: {video: {}} }]; + let imp = getRequestImps(validBidRequests)[0]; + + assert.equal(imp.bidfloor, undefined); + assert.equal(imp.bidfloorcur, undefined); + }); + + it('should not add if floor price not defined', function () { + const validBidRequests = [ getBidWithFloor() ]; + let imp = getRequestImps(validBidRequests)[0]; + + assert.equal(imp.bidfloor, undefined); + assert.equal(imp.bidfloorcur, 'USD'); + }); + + it('should request floor price in adserver currency', function () { + config.setConfig({ currency: { adServerCurrency: 'DKK' } }); + const validBidRequests = [ getBidWithFloor() ]; + let imp = getRequestImps(validBidRequests)[0]; + + assert.equal(imp.bidfloor, undefined); + assert.equal(imp.bidfloorcur, 'DKK'); + }); + + it('should add correct floor values', function () { + const expectedFloors = [ 1, 1.3, 0.5 ]; + const validBidRequests = expectedFloors.map(getBidWithFloor); + let imps = getRequestImps(validBidRequests); + + expectedFloors.forEach((floor, index) => { + assert.equal(imps[index].bidfloor, floor); + assert.equal(imps[index].bidfloorcur, 'USD'); + }); + }); + + function getBidWithFloor(floor) { + return { + params: { mid: 1 }, + mediaTypes: { video: {} }, + getFloor: ({ currency }) => { + return { + currency: currency, + floor + } + } + }; + } + + function getRequestImps(validBidRequests) { + return JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + } + }); + describe('multiple media types', function () { it('should use single media type for bidding', function () { let validBidRequests = [{ From f11fe4e02325aeb68f5d38818ba008505345ba3d Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Thu, 16 Sep 2021 16:01:30 -0700 Subject: [PATCH 071/250] Rubicon Analytics: send error.description instead (#7433) --- modules/rubiconAnalyticsAdapter.js | 28 +-- .../modules/rubiconAnalyticsAdapter_spec.js | 181 ++++++++++-------- test/spec/modules/rubiconAnalyticsSchema.json | 7 +- 3 files changed, 119 insertions(+), 97 deletions(-) diff --git a/modules/rubiconAnalyticsAdapter.js b/modules/rubiconAnalyticsAdapter.js index 3f140e32d12..3222c673a1b 100644 --- a/modules/rubiconAnalyticsAdapter.js +++ b/modules/rubiconAnalyticsAdapter.js @@ -43,7 +43,7 @@ const { } = CONSTANTS; let serverConfig; -config.getConfig('s2sConfig', ({s2sConfig}) => { +config.getConfig('s2sConfig', ({ s2sConfig }) => { serverConfig = s2sConfig; }); @@ -74,7 +74,7 @@ config.getConfig('rubicon', config => { export function getHostNameFromReferer(referer) { try { - rubiconAdapter.referrerHostname = utils.parseUrl(referer, {noDecodeWholeURL: true}).hostname; + rubiconAdapter.referrerHostname = utils.parseUrl(referer, { noDecodeWholeURL: true }).hostname; } catch (e) { utils.logError('Rubicon Analytics: Unable to parse hostname from supplied url: ', referer, e); rubiconAdapter.referrerHostname = ''; @@ -294,7 +294,7 @@ function sendMessage(auctionId, bidWonId, trigger) { } if (auctionCache.userIds.length) { - auction.user = {ids: auctionCache.userIds}; + auction.user = { ids: auctionCache.userIds }; } message.auctions = [auction]; @@ -375,7 +375,7 @@ export function parseBidResponse(bid, previousBidResponse, auctionFloorData) { 'dimensions', () => { const width = bid.width || bid.playerWidth; const height = bid.height || bid.playerHeight; - return (width && height) ? {width, height} : undefined; + return (width && height) ? { width, height } : undefined; }, // Handling use case where pbs sends back 0 or '0' bidIds 'pbsBidId', pbsBidId => pbsBidId == 0 ? utils.generateUUID() : pbsBidId, @@ -476,7 +476,7 @@ function updateRpaCookie() { // possible that decodedRpaCookie is undefined, and if it is, we probably are blocked by storage or some other exception if (Object.keys(decodedRpaCookie).length) { decodedRpaCookie.lastSeen = currentTime; - decodedRpaCookie.fpkvs = {...decodedRpaCookie.fpkvs, ...getFpkvs()}; + decodedRpaCookie.fpkvs = { ...decodedRpaCookie.fpkvs, ...getFpkvs() }; decodedRpaCookie.pvid = rubiConf.pvid; setRpaCookie(decodedRpaCookie) } @@ -520,7 +520,7 @@ function subscribeToGamSlots() { }); } -let baseAdapter = adapter({analyticsType: 'endpoint'}); +let baseAdapter = adapter({ analyticsType: 'endpoint' }); let rubiconAdapter = Object.assign({}, baseAdapter, { MODULE_INITIALIZED_TIME: Date.now(), referrerHostname: '', @@ -570,7 +570,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { cache.gpt.registered = false; baseAdapter.disableAnalytics.apply(this, arguments); }, - track({eventType, args}) { + track({ eventType, args }) { switch (eventType) { case AUCTION_INIT: // set the rubicon aliases @@ -585,12 +585,12 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { cacheEntry.referrer = utils.deepAccess(args, 'bidderRequests.0.refererInfo.referer'); const floorData = utils.deepAccess(args, 'bidderRequests.0.bids.0.floorData'); if (floorData) { - cacheEntry.floorData = {...floorData}; + cacheEntry.floorData = { ...floorData }; } cacheEntry.gdprConsent = utils.deepAccess(args, 'bidderRequests.0.gdprConsent'); cacheEntry.session = storage.localStorageIsEnabled() && updateRpaCookie(); cacheEntry.userIds = Object.keys(utils.deepAccess(args, 'bidderRequests.0.bids.0.userId', {})).map(id => { - return {provider: id, hasId: true} + return { provider: id, hasId: true } }); cache.auctions[args.auctionId] = cacheEntry; // register to listen to gpt events if not done yet @@ -601,7 +601,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { cache.gpt.registered = true; window.googletag = window.googletag || {}; window.googletag.cmd = window.googletag.cmd || []; - window.googletag.cmd.push(function() { + window.googletag.cmd.push(function () { subscribeToGamSlots(); }); } @@ -681,7 +681,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { }, 'gam', () => { if (utils.deepAccess(bid, 'ortb2Imp.ext.data.adserver.name') === 'gam') { - return {adSlot: bid.ortb2Imp.ext.data.adserver.adslot} + return { adSlot: bid.ortb2Imp.ext.data.adserver.adslot } } }, 'pbAdSlot', () => utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'), @@ -695,7 +695,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { let auctionEntry = cache.auctions[args.auctionId]; if (!auctionEntry.bids[args.requestId] && args.originalRequestId) { - auctionEntry.bids[args.requestId] = {...auctionEntry.bids[args.originalRequestId]}; + auctionEntry.bids[args.requestId] = { ...auctionEntry.bids[args.originalRequestId] }; auctionEntry.bids[args.requestId].bidId = args.requestId; auctionEntry.bids[args.requestId].bidderDetail = args.targetingBidder; } @@ -707,7 +707,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { } // if we have not set enforcements yet set it if (!utils.deepAccess(auctionEntry, 'floorData.enforcements') && utils.deepAccess(args, 'floorData.enforcements')) { - auctionEntry.floorData.enforcements = {...args.floorData.enforcements}; + auctionEntry.floorData.enforcements = { ...args.floorData.enforcements }; } if (!bid) { utils.logError('Rubicon Anlytics Adapter Error: Could not find associated bid request for bid response with requestId: ', args.requestId); @@ -803,7 +803,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, { bid.status = 'error'; bid.error = { code: 'timeout-error', - message: 'marked by prebid.js as timeout' // will help us diff if timeout was set by PBS or PBJS + description: 'prebid.js timeout' // will help us diff if timeout was set by PBS or PBJS }; } }); diff --git a/test/spec/modules/rubiconAnalyticsAdapter_spec.js b/test/spec/modules/rubiconAnalyticsAdapter_spec.js index a9909f8a964..798e98bb97d 100644 --- a/test/spec/modules/rubiconAnalyticsAdapter_spec.js +++ b/test/spec/modules/rubiconAnalyticsAdapter_spec.js @@ -168,8 +168,8 @@ const floorMinRequest = { 'zoneId': '335918', 'userId': '12346', 'keywords': ['a', 'b', 'c'], - 'inventory': {'rating': '4-star', 'prodtype': 'tech'}, - 'visitor': {'ucat': 'new', 'lastsearch': 'iphone'}, + 'inventory': { 'rating': '4-star', 'prodtype': 'tech' }, + 'visitor': { 'ucat': 'new', 'lastsearch': 'iphone' }, 'position': 'atf' }, 'mediaTypes': { @@ -195,24 +195,24 @@ const MOCK = { 'auctionId': '25c6d7f5-699a-4bfc-87c9-996f915341fa', 'timestamp': 1519767010567, 'auctionStatus': 'inProgress', - 'adUnits': [ { + 'adUnits': [{ 'code': '/19968336/header-bid-tag1', 'sizes': [[640, 480]], - 'bids': [ { + 'bids': [{ 'bidder': 'rubicon', 'params': { 'accountId': 1001, 'siteId': 113932, 'zoneId': 535512 } - } ], + }], 'transactionId': 'ca4af27a-6d02-4f90-949d-d5541fa12014' } ], 'adUnitCodes': ['/19968336/header-bid-tag1'], - 'bidderRequests': [ { + 'bidderRequests': [{ 'bidderCode': 'rubicon', 'auctionId': '25c6d7f5-699a-4bfc-87c9-996f915341fa', 'bidderRequestId': '1be65d7958826a', - 'bids': [ { + 'bids': [{ 'bidder': 'rubicon', 'params': { 'accountId': 1001, 'siteId': 113932, 'zoneId': 535512 @@ -259,7 +259,7 @@ const MOCK = { 'userId': '12346', 'keywords': ['a', 'b', 'c'], 'inventory': 'test', - 'visitor': {'ucat': 'new', 'lastsearch': 'iphone'}, + 'visitor': { 'ucat': 'new', 'lastsearch': 'iphone' }, 'position': 'btf', 'video': { 'language': 'en', @@ -296,8 +296,8 @@ const MOCK = { 'zoneId': '335918', 'userId': '12346', 'keywords': ['a', 'b', 'c'], - 'inventory': {'rating': '4-star', 'prodtype': 'tech'}, - 'visitor': {'ucat': 'new', 'lastsearch': 'iphone'}, + 'inventory': { 'rating': '4-star', 'prodtype': 'tech' }, + 'visitor': { 'ucat': 'new', 'lastsearch': 'iphone' }, 'position': 'atf' }, 'mediaTypes': { @@ -655,10 +655,10 @@ describe('rubicon analytics adapter', function () { expect(utils.logError.called).to.equal(true); }); - describe('config subscribe', function() { + describe('config subscribe', function () { it('should update the pvid if user asks', function () { expect(utils.generateUUID.called).to.equal(false); - config.setConfig({rubicon: {updatePageView: true}}); + config.setConfig({ rubicon: { updatePageView: true } }); expect(utils.generateUUID.called).to.equal(true); }); it('should merge in and preserve older set configs', function () { @@ -859,7 +859,7 @@ describe('rubicon analytics adapter', function () { criteoId: 'sadfe4334', lotamePanoramaId: 'asdf3gf4eg', pubcid: 'dsfa4545-svgdfs5', - sharedId: {id1: 'asdf', id2: 'sadf4344'} + sharedId: { id1: 'asdf', id2: 'sadf4344' } }; events.emit(AUCTION_INIT, auctionInit); @@ -881,10 +881,10 @@ describe('rubicon analytics adapter', function () { expect(message.auctions[0].user).to.deep.equal({ ids: [ - {provider: 'criteoId', 'hasId': true}, - {provider: 'lotamePanoramaId', 'hasId': true}, - {provider: 'pubcid', 'hasId': true}, - {provider: 'sharedId', 'hasId': true}, + { provider: 'criteoId', 'hasId': true }, + { provider: 'lotamePanoramaId', 'hasId': true }, + { provider: 'pubcid', 'hasId': true }, + { provider: 'sharedId', 'hasId': true }, ] }); }); @@ -1206,7 +1206,7 @@ describe('rubicon analytics adapter', function () { describe('with session handling', function () { const expectedPvid = STUBBED_UUID.slice(0, 8); beforeEach(function () { - config.setConfig({rubicon: {updatePageView: true}}); + config.setConfig({ rubicon: { updatePageView: true } }); }); it('should not log any session data if local storage is not enabled', function () { @@ -1230,12 +1230,14 @@ describe('rubicon analytics adapter', function () { }); it('should should pass along custom rubicon kv and pvid when defined', function () { - config.setConfig({rubicon: { - fpkvs: { - source: 'fb', - link: 'email' + config.setConfig({ + rubicon: { + fpkvs: { + source: 'fb', + link: 'email' + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); let request = server.requests[0]; @@ -1245,22 +1247,24 @@ describe('rubicon analytics adapter', function () { let expectedMessage = utils.deepClone(ANALYTICS_MESSAGE); expectedMessage.session.pvid = STUBBED_UUID.slice(0, 8); expectedMessage.fpkvs = [ - {key: 'source', value: 'fb'}, - {key: 'link', value: 'email'} + { key: 'source', value: 'fb' }, + { key: 'link', value: 'email' } ] expect(message).to.deep.equal(expectedMessage); }); it('should convert kvs to strings before sending', function () { - config.setConfig({rubicon: { - fpkvs: { - number: 24, - boolean: false, - string: 'hello', - array: ['one', 2, 'three'], - object: {one: 'two'} + config.setConfig({ + rubicon: { + fpkvs: { + number: 24, + boolean: false, + string: 'hello', + array: ['one', 2, 'three'], + object: { one: 'two' } + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); let request = server.requests[0]; @@ -1270,24 +1274,26 @@ describe('rubicon analytics adapter', function () { let expectedMessage = utils.deepClone(ANALYTICS_MESSAGE); expectedMessage.session.pvid = STUBBED_UUID.slice(0, 8); expectedMessage.fpkvs = [ - {key: 'number', value: '24'}, - {key: 'boolean', value: 'false'}, - {key: 'string', value: 'hello'}, - {key: 'array', value: 'one,2,three'}, - {key: 'object', value: '[object Object]'} + { key: 'number', value: '24' }, + { key: 'boolean', value: 'false' }, + { key: 'string', value: 'hello' }, + { key: 'array', value: 'one,2,three' }, + { key: 'object', value: '[object Object]' } ] expect(message).to.deep.equal(expectedMessage); }); it('should use the query utm param rubicon kv value and pass updated kv and pvid when defined', function () { - sandbox.stub(utils, 'getWindowLocation').returns({'search': '?utm_source=other', 'pbjs_debug': 'true'}); + sandbox.stub(utils, 'getWindowLocation').returns({ 'search': '?utm_source=other', 'pbjs_debug': 'true' }); - config.setConfig({rubicon: { - fpkvs: { - source: 'fb', - link: 'email' + config.setConfig({ + rubicon: { + fpkvs: { + source: 'fb', + link: 'email' + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); let request = server.requests[0]; @@ -1297,8 +1303,8 @@ describe('rubicon analytics adapter', function () { let expectedMessage = utils.deepClone(ANALYTICS_MESSAGE); expectedMessage.session.pvid = STUBBED_UUID.slice(0, 8); expectedMessage.fpkvs = [ - {key: 'source', value: 'other'}, - {key: 'link', value: 'email'} + { key: 'source', value: 'other' }, + { key: 'link', value: 'email' } ] message.fpkvs.sort((left, right) => left.key < right.key); @@ -1318,11 +1324,13 @@ describe('rubicon analytics adapter', function () { }; getDataFromLocalStorageStub.withArgs('rpaSession').returns(btoa(JSON.stringify(inputlocalStorage))); - config.setConfig({rubicon: { - fpkvs: { - link: 'email' // should merge this with what is in the localStorage! + config.setConfig({ + rubicon: { + fpkvs: { + link: 'email' // should merge this with what is in the localStorage! + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); let request = server.requests[0]; @@ -1337,8 +1345,8 @@ describe('rubicon analytics adapter', function () { pvid: expectedPvid } expectedMessage.fpkvs = [ - {key: 'source', value: 'tw'}, - {key: 'link', value: 'email'} + { key: 'source', value: 'tw' }, + { key: 'link', value: 'email' } ] expect(message).to.deep.equal(expectedMessage); @@ -1360,7 +1368,7 @@ describe('rubicon analytics adapter', function () { }); it('should overwrite matching localstorge value and use its remaining values', function () { - sandbox.stub(utils, 'getWindowLocation').returns({'search': '?utm_source=fb&utm_click=dog'}); + sandbox.stub(utils, 'getWindowLocation').returns({ 'search': '?utm_source=fb&utm_click=dog' }); // set some localStorage let inputlocalStorage = { @@ -1372,11 +1380,13 @@ describe('rubicon analytics adapter', function () { }; getDataFromLocalStorageStub.withArgs('rpaSession').returns(btoa(JSON.stringify(inputlocalStorage))); - config.setConfig({rubicon: { - fpkvs: { - link: 'email' // should merge this with what is in the localStorage! + config.setConfig({ + rubicon: { + fpkvs: { + link: 'email' // should merge this with what is in the localStorage! + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); let request = server.requests[0]; @@ -1391,9 +1401,9 @@ describe('rubicon analytics adapter', function () { pvid: expectedPvid } expectedMessage.fpkvs = [ - {key: 'source', value: 'fb'}, - {key: 'link', value: 'email'}, - {key: 'click', value: 'dog'} + { key: 'source', value: 'fb' }, + { key: 'link', value: 'email' }, + { key: 'click', value: 'dog' } ] message.fpkvs.sort((left, right) => left.key < right.key); @@ -1429,11 +1439,13 @@ describe('rubicon analytics adapter', function () { }; getDataFromLocalStorageStub.withArgs('rpaSession').returns(btoa(JSON.stringify(inputlocalStorage))); - config.setConfig({rubicon: { - fpkvs: { - link: 'email' // should merge this with what is in the localStorage! + config.setConfig({ + rubicon: { + fpkvs: { + link: 'email' // should merge this with what is in the localStorage! + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); @@ -1447,7 +1459,7 @@ describe('rubicon analytics adapter', function () { // the saved fpkvs should have been thrown out since session expired expectedMessage.fpkvs = [ - {key: 'link', value: 'email'} + { key: 'link', value: 'email' } ] expect(message).to.deep.equal(expectedMessage); @@ -1479,11 +1491,13 @@ describe('rubicon analytics adapter', function () { }; getDataFromLocalStorageStub.withArgs('rpaSession').returns(btoa(JSON.stringify(inputlocalStorage))); - config.setConfig({rubicon: { - fpkvs: { - link: 'email' // should merge this with what is in the localStorage! + config.setConfig({ + rubicon: { + fpkvs: { + link: 'email' // should merge this with what is in the localStorage! + } } - }}); + }); performStandardAuction(); expect(server.requests.length).to.equal(1); @@ -1497,7 +1511,7 @@ describe('rubicon analytics adapter', function () { // the saved fpkvs should have been thrown out since session expired expectedMessage.fpkvs = [ - {key: 'link', value: 'email'} + { key: 'link', value: 'email' } ] expect(message).to.deep.equal(expectedMessage); @@ -1523,7 +1537,7 @@ describe('rubicon analytics adapter', function () { let gptSlotRenderEnded0, gptSlotRenderEnded1; beforeEach(function () { mockGpt.enable(); - gptSlot0 = mockGpt.makeSlot({code: '/19968336/header-bid-tag-0'}); + gptSlot0 = mockGpt.makeSlot({ code: '/19968336/header-bid-tag-0' }); gptSlotRenderEnded0 = { eventName: 'slotRenderEnded', params: { @@ -1535,7 +1549,7 @@ describe('rubicon analytics adapter', function () { } }; - gptSlot1 = mockGpt.makeSlot({code: '/19968336/header-bid-tag1'}); + gptSlot1 = mockGpt.makeSlot({ code: '/19968336/header-bid-tag1' }); gptSlotRenderEnded1 = { eventName: 'slotRenderEnded', params: { @@ -1971,6 +1985,7 @@ describe('rubicon analytics adapter', function () { let timedOutBid = message.auctions[0].adUnits[0].bids[0]; expect(timedOutBid.status).to.equal('error'); expect(timedOutBid.error.code).to.equal('timeout-error'); + expect(timedOutBid.error.description).to.equal('prebid.js timeout'); expect(timedOutBid).to.not.have.property('bidResponse'); }); @@ -2051,7 +2066,7 @@ describe('rubicon analytics adapter', function () { // Now add the bidResponse hook which hooks on the currenct conversion function onto the bid response let innerBid; - addBidResponseHook(function(adCodeId, bid) { + addBidResponseHook(function (adCodeId, bid) { innerBid = bid; }, 'elementId', bidCopy); @@ -2064,9 +2079,11 @@ describe('rubicon analytics adapter', function () { describe('config with integration type', () => { it('should use the integration type provided in the config instead of the default', () => { - config.setConfig({rubicon: { - int_type: 'testType' - }}) + config.setConfig({ + rubicon: { + int_type: 'testType' + } + }) rubiconAnalyticsAdapter.enableAnalytics({ options: { @@ -2088,11 +2105,13 @@ describe('rubicon analytics adapter', function () { describe('wrapper details passed in', () => { it('should correctly pass in the wrapper details if provided', () => { - config.setConfig({rubicon: { - wrapperName: '1001_wrapperName_exp.4', - wrapperFamily: '1001_wrapperName', - rule_name: 'na-mobile' - }}); + config.setConfig({ + rubicon: { + wrapperName: '1001_wrapperName_exp.4', + wrapperFamily: '1001_wrapperName', + rule_name: 'na-mobile' + } + }); rubiconAnalyticsAdapter.enableAnalytics({ options: { diff --git a/test/spec/modules/rubiconAnalyticsSchema.json b/test/spec/modules/rubiconAnalyticsSchema.json index a8fdeae5268..39a33867edd 100644 --- a/test/spec/modules/rubiconAnalyticsSchema.json +++ b/test/spec/modules/rubiconAnalyticsSchema.json @@ -263,7 +263,9 @@ }, "isSlotEmpty": { "type": "boolean", - "enum": [true] + "enum": [ + true + ] } } }, @@ -369,6 +371,7 @@ }, "error": { "type": "object", + "additionalProperties": false, "required": [ "code" ], @@ -448,4 +451,4 @@ } } } -} +} \ No newline at end of file From c6a4838d3bacd3121f4fb6fa843db3cd2a77f5cd Mon Sep 17 00:00:00 2001 From: SeedingAllianceTech <55976067+SeedingAllianceTech@users.noreply.github.com> Date: Fri, 17 Sep 2021 18:32:08 +0200 Subject: [PATCH 072/250] seeding Alliance Bid Adapter: update to comply with Prebid 5 (#7426) * add seedingAlliance Adapter * add two native default params * ... * ... * seedingAlliance Adapter: add two more default native params * updating seedingAlliance Adapter * seedingAlliance Adapter Co-authored-by: Jonas Hilsen --- modules/seedingAllianceBidAdapter.js | 231 ++++++++++++++++++ .../modules/seedingAllianceAdapter_spec.js | 186 ++++++++++++++ 2 files changed, 417 insertions(+) create mode 100755 modules/seedingAllianceBidAdapter.js create mode 100755 test/spec/modules/seedingAllianceAdapter_spec.js diff --git a/modules/seedingAllianceBidAdapter.js b/modules/seedingAllianceBidAdapter.js new file mode 100755 index 00000000000..258830d422a --- /dev/null +++ b/modules/seedingAllianceBidAdapter.js @@ -0,0 +1,231 @@ +// jshint esversion: 6, es3: false, node: true +'use strict'; + +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { NATIVE } from '../src/mediaTypes.js'; +import * as utils from '../src/utils.js'; +import { config } from '../src/config.js'; + +const BIDDER_CODE = 'seedingAlliance'; +const DEFAULT_CUR = 'EUR'; +const ENDPOINT_URL = 'https://b.nativendo.de/cds/rtb/bid?format=openrtb2.5&ssp=nativendo'; + +const NATIVE_ASSET_IDS = {0: 'title', 1: 'body', 2: 'sponsoredBy', 3: 'image', 4: 'cta', 5: 'icon'}; + +const NATIVE_PARAMS = { + title: { + id: 0, + name: 'title' + }, + + body: { + id: 1, + name: 'data', + type: 2 + }, + + sponsoredBy: { + id: 2, + name: 'data', + type: 1 + }, + + image: { + id: 3, + type: 3, + name: 'img' + }, + + cta: { + id: 4, + type: 12, + name: 'data' + }, + + icon: { + id: 5, + type: 1, + name: 'img' + } +}; + +export const spec = { + code: BIDDER_CODE, + + supportedMediaTypes: [NATIVE], + + isBidRequestValid: function(bid) { + return !!bid.params.adUnitId; + }, + + buildRequests: (validBidRequests, bidderRequest) => { + const pt = setOnAny(validBidRequests, 'params.pt') || setOnAny(validBidRequests, 'params.priceType') || 'net'; + const tid = validBidRequests[0].transactionId; + const cur = [config.getConfig('currency.adServerCurrency') || DEFAULT_CUR]; + let url = bidderRequest.refererInfo.referer; + + const imp = validBidRequests.map((bid, id) => { + const assets = utils._map(bid.nativeParams, (bidParams, key) => { + const props = NATIVE_PARAMS[key]; + + const asset = { + required: bidParams.required & 1 + }; + + if (props) { + asset.id = props.id; + + let w, h; + + if (bidParams.sizes) { + w = bidParams.sizes[0]; + h = bidParams.sizes[1]; + } + + asset[props.name] = { + len: bidParams.len, + type: props.type, + w, + h + }; + + return asset; + } + }) + .filter(Boolean); + + if (bid.params.url) { + url = bid.params.url; + } + + return { + id: String(id + 1), + tagid: bid.params.adUnitId, + tid: tid, + pt: pt, + native: { + request: { + assets + } + } + }; + }); + + const request = { + id: bidderRequest.auctionId, + site: { + page: url + }, + device: { + ua: navigator.userAgent + }, + cur, + imp, + user: {}, + regs: { + ext: { + gdpr: 0 + } + } + }; + + if (bidderRequest && bidderRequest.gdprConsent) { + utils.deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + utils.deepSetValue(request, 'regs.ext.gdpr', (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean' && bidderRequest.gdprConsent.gdprApplies) ? 1 : 0); + } + + return { + method: 'POST', + url: ENDPOINT_URL, + data: JSON.stringify(request), + options: { + contentType: 'application/json' + }, + bids: validBidRequests + }; + }, + + interpretResponse: function(serverResponse, { bids }) { + if (utils.isEmpty(serverResponse.body)) { + return []; + } + + const { seatbid, cur } = serverResponse.body; + + const bidResponses = flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => { + result[bid.impid - 1] = bid; + return result; + }, []); + + return bids + .map((bid, id) => { + const bidResponse = bidResponses[id]; + + if (bidResponse) { + return { + requestId: bid.bidId, + cpm: bidResponse.price, + creativeId: bidResponse.crid, + ttl: 1000, + netRevenue: bid.netRevenue === 'net', + currency: cur, + mediaType: NATIVE, + bidderCode: BIDDER_CODE, + native: parseNative(bidResponse), + meta: { + advertiserDomains: bidResponse.adomain && bidResponse.adomain.length > 0 ? bidResponse.adomain : [] + } + }; + } + }) + .filter(Boolean); + } +}; + +registerBidder(spec); + +function parseNative(bid) { + const {assets, link, imptrackers} = bid.adm.native; + + if (link.clicktrackers) { + link.clicktrackers.forEach(function (clicktracker, index) { + link.clicktrackers[index] = clicktracker.replace(/\$\{AUCTION_PRICE\}/, bid.price); + }); + } + if (imptrackers) { + imptrackers.forEach(function (imptracker, index) { + imptrackers[index] = imptracker.replace(/\$\{AUCTION_PRICE\}/, bid.price); + }); + } + + const result = { + url: link.url, + clickUrl: link.url, + clickTrackers: link.clicktrackers || undefined, + impressionTrackers: imptrackers || undefined + }; + + assets.forEach(asset => { + const kind = NATIVE_ASSET_IDS[asset.id]; + const content = kind && asset[NATIVE_PARAMS[kind].name]; + + if (content) { + result[kind] = content.text || content.value || { url: content.url, width: content.w, height: content.h }; + } + }); + + return result; +} + +function setOnAny(collection, key) { + for (let i = 0, result; i < collection.length; i++) { + result = utils.deepAccess(collection[i], key); + if (result) { + return result; + } + } +} + +function flatten(arr) { + return [].concat(...arr); +} diff --git a/test/spec/modules/seedingAllianceAdapter_spec.js b/test/spec/modules/seedingAllianceAdapter_spec.js new file mode 100755 index 00000000000..81af9546ff0 --- /dev/null +++ b/test/spec/modules/seedingAllianceAdapter_spec.js @@ -0,0 +1,186 @@ +// jshint esversion: 6, es3: false, node: true +import {assert, expect} from 'chai'; +import {spec} from 'modules/seedingAllianceBidAdapter.js'; +import { NATIVE } from 'src/mediaTypes.js'; +import { config } from 'src/config.js'; + +describe('SeedingAlliance adapter', function () { + let serverResponse, bidRequest, bidResponses; + let bid = { + 'bidder': 'seedingAlliance', + 'params': { + 'adUnitId': '1hq8' + } + }; + + describe('isBidRequestValid', function () { + it('should return true when required params found', function () { + assert(spec.isBidRequestValid(bid)); + }); + + it('should return false when AdUnitId is not set', function () { + delete bid.params.adUnitId; + assert.isFalse(spec.isBidRequestValid(bid)); + }); + }); + + describe('buildRequests', function () { + it('should send request with correct structure', function () { + let validBidRequests = [{ + bidId: 'bidId', + params: {} + }]; + + let request = spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }); + + assert.equal(request.method, 'POST'); + assert.ok(request.data); + }); + + it('should have default request structure', function () { + let keys = 'site,device,cur,imp,user,regs'.split(','); + let validBidRequests = [{ + bidId: 'bidId', + params: {} + }]; + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + let data = Object.keys(request); + + assert.deepEqual(keys, data); + }); + + it('Verify the auction ID', function () { + let validBidRequests = [{ + bidId: 'bidId', + params: {}, + auctionId: 'auctionId' + }]; + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' }, auctionId: validBidRequests[0].auctionId }).data); + + assert.equal(request.id, validBidRequests[0].auctionId); + }); + + it('Verify the device', function () { + let validBidRequests = [{ + bidId: 'bidId', + params: {} + }]; + let request = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data); + + assert.equal(request.device.ua, navigator.userAgent); + }); + + it('Verify native asset ids', function () { + let validBidRequests = [{ + bidId: 'bidId', + params: {}, + nativeParams: { + body: { + required: true, + len: 350 + }, + image: { + required: true + }, + title: { + required: true + }, + sponsoredBy: { + required: true + }, + cta: { + required: true + }, + icon: { + required: true + } + } + }]; + + let assets = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp[0].native.request.assets; + + assert.equal(assets[0].id, 1); + assert.equal(assets[1].id, 3); + assert.equal(assets[2].id, 0); + assert.equal(assets[3].id, 2); + assert.equal(assets[4].id, 4); + assert.equal(assets[5].id, 5); + }); + }); + + describe('interpretResponse', function () { + const goodResponse = { + body: { + cur: 'EUR', + id: '4b516b80-886e-4ec0-82ae-9209e6d625fb', + seatbid: [ + { + seat: 'seedingAlliance', + bid: [{ + adm: { + native: { + assets: [ + {id: 0, title: {text: 'this is a title'}} + ], + imptrackers: ['https://domain.for/imp/tracker?price=${AUCTION_PRICE}'], + link: { + clicktrackers: ['https://domain.for/imp/tracker?price=${AUCTION_PRICE}'], + url: 'https://domain.for/ad/' + } + } + }, + impid: 1, + price: 0.55 + }] + } + ] + } + }; + const badResponse = { body: { + cur: 'EUR', + id: '4b516b80-886e-4ec0-82ae-9209e6d625fb', + seatbid: [] + }}; + + const bidRequest = { + data: {}, + bids: [{ bidId: 'bidId1' }] + }; + + it('should return null if body is missing or empty', function () { + const result = spec.interpretResponse(badResponse, bidRequest); + assert.equal(result.length, 0); + + delete badResponse.body + + const result1 = spec.interpretResponse(badResponse, bidRequest); + assert.equal(result.length, 0); + }); + + it('should return the correct params', function () { + const result = spec.interpretResponse(goodResponse, bidRequest); + const bid = goodResponse.body.seatbid[0].bid[0]; + + assert.deepEqual(result[0].currency, goodResponse.body.cur); + assert.deepEqual(result[0].requestId, bidRequest.bids[0].bidId); + assert.deepEqual(result[0].cpm, bid.price); + assert.deepEqual(result[0].creativeId, bid.crid); + assert.deepEqual(result[0].mediaType, 'native'); + assert.deepEqual(result[0].bidderCode, 'seedingAlliance'); + }); + + it('should return the correct tracking links', function () { + const result = spec.interpretResponse(goodResponse, bidRequest); + const bid = goodResponse.body.seatbid[0].bid[0]; + const regExpPrice = new RegExp('price=' + bid.price); + + result[0].native.clickTrackers.forEach(function (clickTracker) { + assert.ok(clickTracker.search(regExpPrice) > -1); + }); + + result[0].native.impressionTrackers.forEach(function (impTracker) { + assert.ok(impTracker.search(regExpPrice) > -1); + }); + }); + }); +}); From 1a9d74a3eaff5f7f0ce2e4580d00e5e51a9e314e Mon Sep 17 00:00:00 2001 From: Damyan Date: Fri, 17 Sep 2021 20:21:26 +0300 Subject: [PATCH 073/250] AdHash Bid Adaptor : update to comply with Prebid 5.0 (#7403) * AdHash Bidder Adapter: initial prebid.js integration * AdHash Bidder Adapter: code review comments fixed * Fixed documentation * AdHash compliance with #6650 Adding advertiserDomains to meta data * Fixed deep equal for unit test --- modules/adhashBidAdapter.js | 105 ++++++++++++++ modules/adhashBidAdapter.md | 2 +- test/spec/modules/adhashBidAdapter_spec.js | 155 +++++++++++++++++++++ 3 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 modules/adhashBidAdapter.js create mode 100644 test/spec/modules/adhashBidAdapter_spec.js diff --git a/modules/adhashBidAdapter.js b/modules/adhashBidAdapter.js new file mode 100644 index 00000000000..c94a4e35efd --- /dev/null +++ b/modules/adhashBidAdapter.js @@ -0,0 +1,105 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import includes from 'core-js-pure/features/array/includes.js'; +import { BANNER } from '../src/mediaTypes.js'; + +const VERSION = '1.0'; + +export const spec = { + code: 'adhash', + url: 'https://bidder.adhash.org/rtb?version=' + VERSION + '&prebid=true', + supportedMediaTypes: [ BANNER ], + + isBidRequestValid: (bid) => { + try { + const { publisherId, platformURL } = bid.params; + return ( + includes(Object.keys(bid.mediaTypes), BANNER) && + typeof publisherId === 'string' && + publisherId.length === 42 && + typeof platformURL === 'string' && + platformURL.length >= 13 + ); + } catch (error) { + return false; + } + }, + + buildRequests: (validBidRequests, bidderRequest) => { + const { gdprConsent } = bidderRequest; + const { url } = spec; + const bidRequests = []; + let referrer = ''; + if (bidderRequest && bidderRequest.refererInfo) { + referrer = bidderRequest.refererInfo.referer; + } + for (var i = 0; i < validBidRequests.length; i++) { + var index = Math.floor(Math.random() * validBidRequests[i].sizes.length); + var size = validBidRequests[i].sizes[index].join('x'); + bidRequests.push({ + method: 'POST', + url: url, + bidRequest: validBidRequests[i], + data: { + timezone: new Date().getTimezoneOffset() / 60, + location: referrer, + publisherId: validBidRequests[i].params.publisherId, + size: { + screenWidth: window.screen.width, + screenHeight: window.screen.height + }, + navigator: { + platform: window.navigator.platform, + language: window.navigator.language, + userAgent: window.navigator.userAgent + }, + creatives: [{ + size: size, + position: validBidRequests[i].adUnitCode + }], + blockedCreatives: [], + currentTimestamp: new Date().getTime(), + recentAds: [], + GDPR: gdprConsent + }, + options: { + withCredentials: false, + crossOrigin: true + }, + }); + } + return bidRequests; + }, + + interpretResponse: (serverResponse, request) => { + const responseBody = serverResponse ? serverResponse.body : {}; + + if (!responseBody.creatives || responseBody.creatives.length === 0) { + return []; + } + + const publisherURL = JSON.stringify(request.bidRequest.params.platformURL); + const oneTimeId = request.bidRequest.adUnitCode + Math.random().toFixed(16).replace('0.', '.'); + const bidderResponse = JSON.stringify({ responseText: JSON.stringify(responseBody) }); + const requestData = JSON.stringify(request.data); + + return [{ + requestId: request.bidRequest.bidId, + cpm: responseBody.creatives[0].costEUR, + ad: + `
+ + `, + width: request.bidRequest.sizes[0][0], + height: request.bidRequest.sizes[0][1], + creativeId: request.bidRequest.adUnitCode, + netRevenue: true, + currency: 'EUR', + ttl: 60, + meta: { + advertiserDomains: responseBody.advertiserDomains ? [responseBody.advertiserDomains] : [] + } + }]; + } +}; + +registerBidder(spec); diff --git a/modules/adhashBidAdapter.md b/modules/adhashBidAdapter.md index c1093e0ccd7..4ee6ed3dc83 100644 --- a/modules/adhashBidAdapter.md +++ b/modules/adhashBidAdapter.md @@ -34,7 +34,7 @@ Please note that a number of AdHash functionalities are not supported in the Pre bidder: 'adhash', params: { publisherId: '0x1234567890123456789012345678901234567890', - platformURL: 'https://adhash.org/p/struma/' + platformURL: 'https://adhash.org/p/example/' } } ] diff --git a/test/spec/modules/adhashBidAdapter_spec.js b/test/spec/modules/adhashBidAdapter_spec.js new file mode 100644 index 00000000000..eda164da852 --- /dev/null +++ b/test/spec/modules/adhashBidAdapter_spec.js @@ -0,0 +1,155 @@ +import { expect } from 'chai'; +import { spec } from 'modules/adhashBidAdapter.js'; + +describe('adhashBidAdapter', function () { + describe('isBidRequestValid', function () { + const validBid = { + bidder: 'adhash', + params: { + publisherId: '0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb', + platformURL: 'https://adhash.org/p/struma/' + }, + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + adUnitCode: 'adunit-code', + sizes: [[300, 250]], + bidId: '12345678901234', + bidderRequestId: '98765432109876', + auctionId: '01234567891234', + }; + + it('should return true when all mandatory parameters are there', function () { + expect(spec.isBidRequestValid(validBid)).to.equal(true); + }); + + it('should return false when there are no params', function () { + const bid = { ...validBid }; + delete bid.params; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when unsupported media type is requested', function () { + const bid = { ...validBid }; + bid.mediaTypes = { native: { sizes: [[300, 250]] } }; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when publisherId is not a string', function () { + const bid = { ...validBid }; + bid.params.publisherId = 123; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when publisherId is not valid', function () { + const bid = { ...validBid }; + bid.params.publisherId = 'short string'; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when publisherId is not a string', function () { + const bid = { ...validBid }; + bid.params.platformURL = 123; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when publisherId is not valid', function () { + const bid = { ...validBid }; + bid.params.platformURL = 'https://'; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + }); + + describe('buildRequests', function () { + const bidRequest = { + params: { + publisherId: '0xc3b09b27e9c6ef73957901aa729b9e69e5bbfbfb' + }, + sizes: [[300, 250]], + adUnitCode: 'adUnitCode' + }; + it('should build the request correctly', function () { + const result = spec.buildRequests( + [ bidRequest ], + { gdprConsent: true, refererInfo: { referer: 'http://example.com/' } } + ); + expect(result.length).to.equal(1); + expect(result[0].method).to.equal('POST'); + expect(result[0].url).to.equal('https://bidder.adhash.org/rtb?version=1.0&prebid=true'); + expect(result[0].bidRequest).to.equal(bidRequest); + expect(result[0].data).to.have.property('timezone'); + expect(result[0].data).to.have.property('location'); + expect(result[0].data).to.have.property('publisherId'); + expect(result[0].data).to.have.property('size'); + expect(result[0].data).to.have.property('navigator'); + expect(result[0].data).to.have.property('creatives'); + expect(result[0].data).to.have.property('blockedCreatives'); + expect(result[0].data).to.have.property('currentTimestamp'); + expect(result[0].data).to.have.property('recentAds'); + }); + it('should build the request correctly without referer', function () { + const result = spec.buildRequests([ bidRequest ], { gdprConsent: true }); + expect(result.length).to.equal(1); + expect(result[0].method).to.equal('POST'); + expect(result[0].url).to.equal('https://bidder.adhash.org/rtb?version=1.0&prebid=true'); + expect(result[0].bidRequest).to.equal(bidRequest); + expect(result[0].data).to.have.property('timezone'); + expect(result[0].data).to.have.property('location'); + expect(result[0].data).to.have.property('publisherId'); + expect(result[0].data).to.have.property('size'); + expect(result[0].data).to.have.property('navigator'); + expect(result[0].data).to.have.property('creatives'); + expect(result[0].data).to.have.property('blockedCreatives'); + expect(result[0].data).to.have.property('currentTimestamp'); + expect(result[0].data).to.have.property('recentAds'); + }); + }); + + describe('interpretResponse', function () { + const request = { + data: { some: 'data' }, + bidRequest: { + bidId: '12345678901234', + adUnitCode: 'adunit-code', + sizes: [[300, 250]], + params: { + platformURL: 'https://adhash.org/p/struma/' + } + } + }; + + it('should interpret the response correctly', function () { + const serverResponse = { + body: { + creatives: [{ costEUR: 1.234 }], + advertiserDomains: 'adhash.org' + } + }; + const result = spec.interpretResponse(serverResponse, request); + expect(result.length).to.equal(1); + expect(result[0].requestId).to.equal('12345678901234'); + expect(result[0].cpm).to.equal(1.234); + expect(result[0].width).to.equal(300); + expect(result[0].height).to.equal(250); + expect(result[0].creativeId).to.equal('adunit-code'); + expect(result[0].netRevenue).to.equal(true); + expect(result[0].currency).to.equal('EUR'); + expect(result[0].ttl).to.equal(60); + expect(result[0].meta.advertiserDomains).to.eql(['adhash.org']); + }); + + it('should return empty array when there are no creatives returned', function () { + expect(spec.interpretResponse({body: {creatives: []}}, request).length).to.equal(0); + }); + + it('should return empty array when there is no creatives key in the response', function () { + expect(spec.interpretResponse({body: {}}, request).length).to.equal(0); + }); + + it('should return empty array when something is not right', function () { + expect(spec.interpretResponse(null, request).length).to.equal(0); + }); + }); +}); From 1fdc735b27d47d3647db71df2554e9c2ee52652c Mon Sep 17 00:00:00 2001 From: andrey-ka-97 <42410701+andrey-ka-97@users.noreply.github.com> Date: Fri, 17 Sep 2021 21:16:52 +0300 Subject: [PATCH 074/250] AFP Bid Adapter: add new bid adapter and integration examples (#7301) * Fix astraoneBidAdapter * Fix examples; update astraoneBidAdapter description * Fix astraoneBidAdapter_spec * Remove integration examples * Rename gbt to gpt * update AFP Adapter and add page examples * replace "AstraLab" with "AFP" * fix prefixes in example pages * Revert "update AFP Adapter and add page examples" This reverts commit 6e15c6a6 (Revert "astraone" adapter) * fix error while testing in CircleCI * update AFP Adapter and add page examples * Revert "update AFP Adapter and add page examples" This reverts commit 31224ed19b624c5c639bf59f17abcd67061e6768. * fix error while testing in CircleCI * fix error while testing in CircleCI * fix error while testing in CircleCI * replace test ids * add new format "Just Banner" and refactoring * update examples in test page and in '.md' file Co-authored-by: Liza Kobrazova --- integrationExamples/gpt/afpExample.html | 242 ++++++++++++++ integrationExamples/gpt/afpGamExample.html | 152 +++++++++ modules/afpBidAdapter.js | 166 ++++++++++ modules/afpBidAdapter.md | 348 +++++++++++++++++++++ test/spec/modules/afpBidAdapter_spec.js | 306 ++++++++++++++++++ 5 files changed, 1214 insertions(+) create mode 100644 integrationExamples/gpt/afpExample.html create mode 100644 integrationExamples/gpt/afpGamExample.html create mode 100644 modules/afpBidAdapter.js create mode 100644 modules/afpBidAdapter.md create mode 100644 test/spec/modules/afpBidAdapter_spec.js diff --git a/integrationExamples/gpt/afpExample.html b/integrationExamples/gpt/afpExample.html new file mode 100644 index 00000000000..a1e6e800d69 --- /dev/null +++ b/integrationExamples/gpt/afpExample.html @@ -0,0 +1,242 @@ + + + + + Prebid.js Banner Example + + + + +

In-image

+
+
+ +
+ +
+ +

In-image Max

+
+
+ +
+ +
+ +

In-content Banner

+
+
+ +
+ +

In-content Stories

+
+
+ +
+ +

Action Scroller

+
+
+ +
+ +

Action Scroller Light

+
+
+ +
+ +

Just Banner

+
+
+ +
+ +

In-content Video

+
+
+ +
+ + + + + diff --git a/integrationExamples/gpt/afpGamExample.html b/integrationExamples/gpt/afpGamExample.html new file mode 100644 index 00000000000..64cb169893c --- /dev/null +++ b/integrationExamples/gpt/afpGamExample.html @@ -0,0 +1,152 @@ + + + + + Prebid.js Banner Example + + + + + +

In-image

+
+
+ +
+
+ +
+
+ +

In-content Video

+
+
+
+ +
+
+ +

Action Scroller

+
+
+
+ +
+
+ + diff --git a/modules/afpBidAdapter.js b/modules/afpBidAdapter.js new file mode 100644 index 00000000000..68941ff17c9 --- /dev/null +++ b/modules/afpBidAdapter.js @@ -0,0 +1,166 @@ +import includes from 'core-js-pure/features/array/includes.js' +import { registerBidder } from '../src/adapters/bidderFactory.js' +import { Renderer } from '../src/Renderer.js' +import { BANNER, VIDEO } from '../src/mediaTypes.js' + +export const IS_DEV = location.hostname === 'localhost' +export const BIDDER_CODE = 'afp' +export const SSP_ENDPOINT = 'https://ssp.afp.ai/api/prebid' +export const REQUEST_METHOD = 'POST' +export const TEST_PAGE_URL = 'https://rtbinsight.ru/smiert-bolshikh-dannykh-kto-na-novienkogo/' +const SDK_PATH = 'https://cdn.afp.ai/ssp/sdk.js?auto_initialization=false&deploy_to_parent_window=true' +const TTL = 60 +export const IN_IMAGE_BANNER_TYPE = 'In-image' +export const IN_IMAGE_MAX_BANNER_TYPE = 'In-image Max' +export const IN_CONTENT_BANNER_TYPE = 'In-content Banner' +export const IN_CONTENT_VIDEO_TYPE = 'In-content Video' +export const OUT_CONTENT_VIDEO_TYPE = 'Out-content Video' +export const IN_CONTENT_STORY_TYPE = 'In-content Stories' +export const ACTION_SCROLLER_TYPE = 'Action Scroller' +export const ACTION_SCROLLER_LIGHT_TYPE = 'Action Scroller Light' +export const JUST_BANNER_TYPE = 'Just Banner' + +export const mediaTypeByPlaceType = { + [IN_IMAGE_BANNER_TYPE]: BANNER, + [IN_IMAGE_MAX_BANNER_TYPE]: BANNER, + [IN_CONTENT_BANNER_TYPE]: BANNER, + [IN_CONTENT_STORY_TYPE]: BANNER, + [ACTION_SCROLLER_TYPE]: BANNER, + [ACTION_SCROLLER_LIGHT_TYPE]: BANNER, + [JUST_BANNER_TYPE]: BANNER, + [IN_CONTENT_VIDEO_TYPE]: VIDEO, + [OUT_CONTENT_VIDEO_TYPE]: VIDEO, +} + +const wrapAd = (dataToCreatePlace) => { + return ` + + + + + + + + + + ` +} + +const bidRequestMap = {} + +const createRenderer = (bid, dataToCreatePlace) => { + const renderer = new Renderer({ + targetId: bid.adUnitCode, + url: SDK_PATH, + callback() { + renderer.loaded = true + window.afp.createPlaceByData(dataToCreatePlace) + } + }) + + return renderer +} + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, VIDEO], + isBidRequestValid({mediaTypes, params}) { + if (typeof params !== 'object' || typeof mediaTypes !== 'object') { + return false + } + + const {placeId, placeType, imageUrl, imageWidth, imageHeight} = params + const media = mediaTypes[mediaTypeByPlaceType[placeType]] + + if (placeId && media) { + if (mediaTypeByPlaceType[placeType] === VIDEO) { + if (!media.playerSize) { + return false + } + } else if (mediaTypeByPlaceType[placeType] === BANNER) { + if (!media.sizes) { + return false + } + } + if (includes([IN_IMAGE_BANNER_TYPE, IN_IMAGE_MAX_BANNER_TYPE], placeType)) { + if (imageUrl && imageWidth && imageHeight) { + return true + } + } else { + return true + } + } + return false + }, + buildRequests(validBidRequests, {refererInfo, gdprConsent}) { + const payload = { + pageUrl: IS_DEV ? TEST_PAGE_URL : refererInfo.referer, + gdprConsent: gdprConsent, + bidRequests: validBidRequests.map(validBidRequest => { + const {bidId, transactionId, sizes, params: { + placeId, placeType, imageUrl, imageWidth, imageHeight + }} = validBidRequest + bidRequestMap[bidId] = validBidRequest + const bidRequest = { + bidId, + transactionId, + sizes, + placeId, + } + if (includes([IN_IMAGE_BANNER_TYPE, IN_IMAGE_MAX_BANNER_TYPE], placeType)) { + Object.assign(bidRequest, { + imageUrl, + imageWidth: Math.floor(imageWidth), + imageHeight: Math.floor(imageHeight), + }) + } + return bidRequest + }) + } + + return { + method: REQUEST_METHOD, + url: SSP_ENDPOINT, + data: payload, + options: { + contentType: 'application/json' + } + } + }, + interpretResponse(serverResponse) { + let bids = serverResponse.body && serverResponse.body.bids + bids = Array.isArray(bids) ? bids : [] + + return bids.map(({bidId, cpm, width, height, creativeId, currency, netRevenue, adSettings, placeSettings}, index) => { + const bid = { + requestId: bidId, + cpm, + width, + height, + creativeId, + currency, + netRevenue, + meta: { + mediaType: mediaTypeByPlaceType[placeSettings.placeType], + }, + ttl: TTL + } + + const bidRequest = bidRequestMap[bidId] + const placeContainer = bidRequest.params.placeContainer + const dataToCreatePlace = { adSettings, placeSettings, placeContainer, isPrebid: true } + + if (mediaTypeByPlaceType[placeSettings.placeType] === BANNER) { + bid.ad = wrapAd(dataToCreatePlace) + } else if (mediaTypeByPlaceType[placeSettings.placeType] === VIDEO) { + bid.vastXml = adSettings.content + bid.renderer = createRenderer(bid, dataToCreatePlace) + } + return bid + }) + } +} + +registerBidder(spec); diff --git a/modules/afpBidAdapter.md b/modules/afpBidAdapter.md new file mode 100644 index 00000000000..75ebf2bce48 --- /dev/null +++ b/modules/afpBidAdapter.md @@ -0,0 +1,348 @@ +# Overview + + +**Module Name**: AFP Bidder Adapter +**Module Type**: Bidder Adapter +**Maintainer**: devops@astraone.io + +# Description + +You can use this adapter to get a bid from AFP. +Please reach out to your AFP account team before using this plugin to get placeId. +The code below returns a demo ad. + +About us: https://afp.ai + +# Test Parameters +```js +var adUnits = [{ + code: 'iib-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "In-image", + placeId: "613221112871613d1517d181", // id from personal account + placeContainer: '#iib-container', + imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png", + imageWidth: 1000, + imageHeight: 524, + } + }] +}]; + +var adUnits = [{ + code: 'iimb-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "In-image Max", + placeId: "6139ae472871613d1517dedd", // id from personal account + placeContainer: '#iimb-container', + imageUrl: "https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png", + imageWidth: 1000, + imageHeight: 524, + } + }] +}]; + +var adUnits = [{ + code: 'icb-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "In-content Banner", + placeId: "6139ae082871613d1517dec0", // id from personal account + placeContainer: '#icb-container', + } + }] +}]; + +var adUnits = [{ + code: 'ics-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "In-content Stories", + placeId: "6139ae292871613d1517ded3", // id from personal account + placeContainer: '#ics-container', + } + }] +}]; + +var adUnits = [{ + code: 'as-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "Action Scroller", + placeId: "6139adc12871613d1517deb0", // id from personal account + placeContainer: '#as-container', + } + }] +}]; + +var adUnits = [{ + code: 'asl-target', + mediaTypes: { + banner: { + sizes: [[0, 0]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "Action Scroller Light", + placeId: "6139adda2871613d1517deb8", // id from personal account + placeContainer: '#asl-container', + } + }] +}]; + +var adUnits = [{ + code: 'jb-target', + mediaTypes: { + banner: { + sizes: [[300, 250]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "Just Banner", + placeId: "6139ae832871613d1517dee9", // id from personal account + placeContainer: '#jb-container', + } + }] +}]; + +var adUnits = [{ + code: 'icv-target', + mediaTypes: { + video: { + playerSize: [[480, 320]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "In-content Video", + placeId: "6139ae182871613d1517deca", // id from personal account + placeContainer: '#icv-container', + } + }] +}]; + +var adUnits = [{ + code: 'ocv-target', + mediaTypes: { + video: { + playerSize: [[480, 320]], + } + }, + bids: [{ + bidder: "afp", + params: { + placeType: "Out-content Video", + placeId: "6139ae5b2871613d1517dee2", // id from personal account + placeContainer: '#ocv-container', // only the "body" tag is used as a container + } + }] +}]; +``` + +# Example page + +```html + + + + + Prebid.js In-image Example + + + + +

In-image

+
+
+ +
+ +
+ +

Just Banner

+
+
+ +
+ + + +``` +# Example page with GPT + +```html + + + + + Prebid.js In-image Example + + + + + +

In-image

+
+
+ +
+
+ +
+
+ + +``` diff --git a/test/spec/modules/afpBidAdapter_spec.js b/test/spec/modules/afpBidAdapter_spec.js new file mode 100644 index 00000000000..8e77a1f3e15 --- /dev/null +++ b/test/spec/modules/afpBidAdapter_spec.js @@ -0,0 +1,306 @@ +import includes from 'core-js-pure/features/array/includes.js' +import cloneDeep from 'lodash/cloneDeep' +import unset from 'lodash/unset' +import { expect } from 'chai' +import { BANNER, VIDEO } from '../../../src/mediaTypes.js' +import { + spec, + IN_IMAGE_BANNER_TYPE, + IN_IMAGE_MAX_BANNER_TYPE, + IN_CONTENT_BANNER_TYPE, + IN_CONTENT_VIDEO_TYPE, + OUT_CONTENT_VIDEO_TYPE, + IN_CONTENT_STORY_TYPE, + ACTION_SCROLLER_TYPE, + ACTION_SCROLLER_LIGHT_TYPE, + JUST_BANNER_TYPE, + BIDDER_CODE, + SSP_ENDPOINT, + REQUEST_METHOD, + TEST_PAGE_URL, + IS_DEV, mediaTypeByPlaceType +} from 'modules/afpBidAdapter.js' + +const placeId = '613221112871613d1517d181' +const bidId = '2a67c5577ff6a5' +const transactionId = '7e8515a2-2ed9-4733-b976-6c2596a03287' +const imageUrl = 'https://rtbinsight.ru/content/images/size/w1000/2021/05/ximage-30.png.pagespeed.ic.IfuX4zAEPP.png' +const placeContainer = '#container' +const imageWidth = 600 +const imageHeight = 400 +const pageUrl = IS_DEV ? TEST_PAGE_URL : 'referer' +const sizes = [[imageWidth, imageHeight]] +const bidderRequest = { + refererInfo: { referer: pageUrl }, +} +const mediaTypeBanner = { [BANNER]: {sizes: [[imageWidth, imageHeight]]} } +const mediaTypeVideo = { [VIDEO]: {playerSize: [[imageWidth, imageHeight]]} } +const commonParams = { + placeId, + placeContainer, +} +const commonParamsForInImage = Object.assign({}, commonParams, { + imageUrl, + imageWidth, + imageHeight, +}) +const configByPlaceType = { + get [IN_IMAGE_BANNER_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParamsForInImage, { + placeType: IN_IMAGE_BANNER_TYPE + }), + }) + }, + get [IN_IMAGE_MAX_BANNER_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParamsForInImage, { + placeType: IN_IMAGE_MAX_BANNER_TYPE + }), + }) + }, + get [IN_CONTENT_BANNER_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParams, { + placeType: IN_CONTENT_BANNER_TYPE + }), + }) + }, + get [IN_CONTENT_VIDEO_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeVideo, + params: Object.assign({}, commonParams, { + placeType: IN_CONTENT_VIDEO_TYPE + }), + }) + }, + get [OUT_CONTENT_VIDEO_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeVideo, + params: Object.assign({}, commonParams, { + placeType: OUT_CONTENT_VIDEO_TYPE + }), + }) + }, + get [IN_CONTENT_STORY_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParams, { + placeType: IN_CONTENT_STORY_TYPE + }), + }) + }, + get [ACTION_SCROLLER_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParams, { + placeType: ACTION_SCROLLER_TYPE + }), + }) + }, + get [ACTION_SCROLLER_LIGHT_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParams, { + placeType: ACTION_SCROLLER_LIGHT_TYPE + }), + }) + }, + get [JUST_BANNER_TYPE]() { + return cloneDeep({ + mediaTypes: mediaTypeBanner, + params: Object.assign({}, commonParams, { + placeType: JUST_BANNER_TYPE + }), + }) + }, +} +const getTransformedConfig = ({mediaTypes, params}) => { + return { + params: params, + sizes, + bidId, + bidder: BIDDER_CODE, + mediaTypes: mediaTypes, + transactionId, + } +} +const validBidRequests = Object.keys(configByPlaceType).map(key => getTransformedConfig(configByPlaceType[key])) + +describe('AFP Adapter', function() { + describe('isBidRequestValid method', function() { + describe('returns true', function() { + describe('when config has all mandatory params', () => { + Object.keys(configByPlaceType).forEach(placeType => { + it(`and ${placeType} config has the correct value`, function() { + const isBidRequestValid = spec.isBidRequestValid(configByPlaceType[placeType]) + expect(isBidRequestValid).to.equal(true) + }) + }) + }) + }) + describe('returns false', function() { + const checkMissingParams = (placesTypes, missingParams) => + placesTypes.forEach(placeType => + missingParams.forEach(missingParam => { + const config = configByPlaceType[placeType] + it(`${placeType} does not have the ${missingParam}.`, function() { + unset(config, missingParam) + const isBidRequestValid = spec.isBidRequestValid(config) + expect(isBidRequestValid).to.equal(false) + }) + }) + ) + + describe('when params are not correct', function() { + checkMissingParams(Object.keys(configByPlaceType), ['params.placeId', 'params.placeType']) + checkMissingParams([IN_IMAGE_BANNER_TYPE, IN_IMAGE_MAX_BANNER_TYPE], + ['params.imageUrl', 'params.imageWidth', 'params.imageHeight']) + + it('does not have a the correct placeType.', function() { + const config = configByPlaceType[IN_IMAGE_BANNER_TYPE] + config.params.placeType = 'something' + const isBidRequestValid = spec.isBidRequestValid(config) + expect(isBidRequestValid).to.equal(false) + }) + }) + describe('when video mediaType object is not correct.', function() { + checkMissingParams([IN_CONTENT_VIDEO_TYPE, OUT_CONTENT_VIDEO_TYPE], + [`mediaTypes.${VIDEO}.playerSize`, `mediaTypes.${VIDEO}`]) + checkMissingParams([ + IN_IMAGE_BANNER_TYPE, + IN_IMAGE_MAX_BANNER_TYPE, + IN_CONTENT_BANNER_TYPE, + IN_CONTENT_STORY_TYPE, + ACTION_SCROLLER_TYPE, + ACTION_SCROLLER_LIGHT_TYPE, + JUST_BANNER_TYPE + ], [`mediaTypes.${BANNER}.sizes`, `mediaTypes.${BANNER}`]) + }) + }) + }) + + describe('buildRequests method', function() { + const request = spec.buildRequests(validBidRequests, bidderRequest) + + it('Url should be correct', function() { + expect(request.url).to.equal(SSP_ENDPOINT) + }) + + it('Method should be correct', function() { + expect(request.method).to.equal(REQUEST_METHOD) + }) + + describe('Common data request should be correct', function() { + it('pageUrl should be correct', function() { + expect(request.data.pageUrl).to.equal(pageUrl) + }) + it('bidRequests should be array', function() { + expect(Array.isArray(request.data.bidRequests)).to.equal(true) + }) + + request.data.bidRequests.forEach((bid, index) => { + describe(`bid with ${validBidRequests[index].params.placeType} should be correct`, function() { + it('bidId should be correct', function() { + expect(bid.bidId).to.equal(bidId) + }) + it('placeId should be correct', function() { + expect(bid.placeId).to.equal(placeId) + }) + it('transactionId should be correct', function() { + expect(bid.transactionId).to.equal(transactionId) + }) + it('sizes should be correct', function() { + expect(bid.sizes).to.equal(sizes) + }) + + if (includes([IN_IMAGE_BANNER_TYPE, IN_IMAGE_MAX_BANNER_TYPE], validBidRequests[index].params.placeType)) { + it('imageUrl should be correct', function() { + expect(bid.imageUrl).to.equal(imageUrl) + }) + it('imageWidth should be correct', function() { + expect(bid.imageWidth).to.equal(Math.floor(imageWidth)) + }) + it('imageHeight should be correct', function() { + expect(bid.imageHeight).to.equal(Math.floor(imageHeight)) + }) + } + }) + }) + }) + }) + + describe('interpretResponse method', function() { + it('should return a void array, when the server response are not correct.', function() { + const request = { data: JSON.stringify({}) } + const serverResponse = { + body: {} + } + const bids = spec.interpretResponse(serverResponse, request) + expect(Array.isArray(bids)).to.equal(true) + expect(bids.length).to.equal(0) + }) + it('should return a void array, when the server response have not got bids.', function() { + const request = { data: JSON.stringify({}) } + const serverResponse = { body: { bids: [] } } + const bids = spec.interpretResponse(serverResponse, request) + expect(Array.isArray(bids)).to.equal(true) + expect(bids.length).to.equal(0) + }) + describe('when the server response return a bids', function() { + Object.keys(configByPlaceType).forEach(placeType => { + it(`should return a bid with ${placeType} placeType`, function() { + const cpm = 10 + const currency = 'RUB' + const creativeId = '123' + const netRevenue = true + const width = sizes[0][0] + const height = sizes[0][1] + const adSettings = { + content: 'html' + } + const placeSettings = { + placeType, + } + const request = spec.buildRequests([validBidRequests[0]], bidderRequest) + const serverResponse = { + body: { + bids: [ + { + bidId, + cpm, + currency, + creativeId, + netRevenue, + width, + height, + adSettings, + placeSettings, + } + ] + } + } + const bids = spec.interpretResponse(serverResponse, request) + expect(bids.length).to.equal(1) + expect(bids[0].requestId).to.equal(bidId) + expect(bids[0].meta.mediaType).to.equal(mediaTypeByPlaceType[placeSettings.placeType]) + expect(bids[0].cpm).to.equal(cpm) + expect(bids[0].width).to.equal(width) + expect(bids[0].height).to.equal(height) + expect(bids[0].currency).to.equal(currency) + expect(bids[0].netRevenue).to.equal(netRevenue) + + if (mediaTypeByPlaceType[placeSettings.placeType] === BANNER) { + expect(typeof bids[0].ad).to.equal('string') + } else if (mediaTypeByPlaceType[placeSettings.placeType] === VIDEO) { + expect(typeof bids[0].vastXml).to.equal('string') + expect(typeof bids[0].renderer).to.equal('object') + } + }) + }) + }) + }) +}) From a22705a60a1c5c0cb6183fab189e8b3e067dd762 Mon Sep 17 00:00:00 2001 From: Noam Tzuberi Date: Mon, 20 Sep 2021 16:46:33 +0300 Subject: [PATCH 075/250] Rise Bid Adapteer: docs update (#7442) * add Rise adapter * fixes * change param isOrg to org * Rise adapter * change email for rise * fix circle failed * bump * bump * bump * remove space * Upgrade Rise adapter to 5.0 * update docs Co-authored-by: Noam Tzuberi Co-authored-by: Laslo Chechur --- modules/riseBidAdapter.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/riseBidAdapter.md b/modules/riseBidAdapter.md index 6251b92e0a9..83f8adfd645 100644 --- a/modules/riseBidAdapter.md +++ b/modules/riseBidAdapter.md @@ -13,7 +13,7 @@ Module that connects to Rise's demand sources. The Rise adapter requires setup and approval from the Rise. Please reach out to prebid-rise-engage@risecodes.com to create an Rise account. -The adapter supports Video(instream). For the integration, Rise returns content as vastXML and requires the publisher to define the cache url in config passed to Prebid for it to be valid in the auction. +The adapter supports Video(instream). # Bid Parameters ## Video @@ -22,7 +22,6 @@ The adapter supports Video(instream). For the integration, Rise returns content | ---- | ----- | ---- | ----------- | ------- | `org` | required | String | Rise publisher Id provided by your Rise representative | "56f91cd4d3e3660002000033" | `floorPrice` | optional | Number | Minimum price in USD. Misuse of this parameter can impact revenue | 2.00 -| `ifa` | optional | String | The ID for advertisers (also referred to as "IDFA") | "XXX-XXX" | `placementId` | optional | String | A unique placement identifier | "12345678" | `testMode` | optional | Boolean | This activates the test mode | false @@ -43,7 +42,6 @@ var adUnits = [ params: { org: '56f91cd4d3e3660002000033', // Required floorPrice: 2.00, // Optional - ifa: 'XXX-XXX', // Optional placementId: '12345678', // Optional testMode: false // Optional } From 6b8c5941042aeb646ee14e574ac88630be7023df Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Wed, 22 Sep 2021 15:46:29 +0200 Subject: [PATCH 076/250] Weborama Real-time Data Module: add new RTD module (#7437) * add first version * small fixes * fix email * fix token encoding * update doc * add unit test, fix small code issues * add option about ortb2 * update doc * format doc * fix example * update example * rename module name to weborama * add placement id * keep ortb2 feature not active by default * remove gam key renaming options * fix typo in doc * fix typo * fix typo 2 Co-authored-by: Tiago Peczenyj --- .../gpt/weboramaRtdProvider_example.html | 126 ++++++++ modules/weboramaRtdProvider.js | 174 +++++++++++ modules/weboramaRtdProvider.md | 70 +++++ test/spec/modules/weboramaRtdProvider_spec.js | 288 ++++++++++++++++++ 4 files changed, 658 insertions(+) create mode 100644 integrationExamples/gpt/weboramaRtdProvider_example.html create mode 100644 modules/weboramaRtdProvider.js create mode 100644 modules/weboramaRtdProvider.md create mode 100644 test/spec/modules/weboramaRtdProvider_spec.js diff --git a/integrationExamples/gpt/weboramaRtdProvider_example.html b/integrationExamples/gpt/weboramaRtdProvider_example.html new file mode 100644 index 00000000000..824d7a2f0c7 --- /dev/null +++ b/integrationExamples/gpt/weboramaRtdProvider_example.html @@ -0,0 +1,126 @@ + + + + + + + + + + + + + +
+

+test webo ctx using prebid.js +

+
+

Basic Prebid.js Example

+
Div-1
+
+ +
+ + + diff --git a/modules/weboramaRtdProvider.js b/modules/weboramaRtdProvider.js new file mode 100644 index 00000000000..141b88a48da --- /dev/null +++ b/modules/weboramaRtdProvider.js @@ -0,0 +1,174 @@ +/** + * This module adds Weborama provider to the real time data module + * The {@link module:modules/realTimeData} module is required + * The module will fetch contextual data (page-centric) from Weborama server + * @module modules/weboramaRtdProvider + * @requires module:modules/realTimeData + */ + +/** +* @typedef {Object} ModuleParams +* @property {WeboCtxConf} weboCtxConf +*/ + +/** +* @typedef {Object} WeboCtxConf +* @property {string} token required token to be used on bigsea contextual API requests +* @property {?string} targetURL specify the target url instead use the referer +* @property {?boolean} setTargeting if true will set the GAM targeting +* @property {?object} defaultProfile to be used if the profile is not found +*/ + +import * as utils from '../src/utils.js'; +import {submodule} from '../src/hook.js'; +import {ajax} from '../src/ajax.js'; +import {config} from '../src/config.js'; + +/** @type {string} */ +const MODULE_NAME = 'realTimeData'; +/** @type {string} */ +const SUBMODULE_NAME = 'weborama'; +/** @type {string} */ +const WEBO_CTX = 'webo_ctx'; +/** @type {string} */ +const WEBO_DS = 'webo_ds'; + +/** @type {null|Object} */ +let _bigseaContextualProfile = null; + +/** function that provides ad server targeting data to RTD-core +* @param {Array} adUnitsCodes +* @param {Object} moduleConfig +* @returns {Object} target data + */ +function getTargetingData(adUnitsCodes, moduleConfig) { + moduleConfig = moduleConfig || {}; + const moduleParams = moduleConfig.params || {}; + const weboCtxConf = moduleParams.weboCtxConf || {}; + const defaultContextualProfiles = weboCtxConf.defaultProfile || {} + const profile = _bigseaContextualProfile || defaultContextualProfiles; + + if (weboCtxConf.setOrtb2) { + const ortb2 = config.getConfig('ortb2') || {}; + if (profile[WEBO_CTX]) { + utils.deepSetValue(ortb2, 'site.ext.data.webo_ctx', profile[WEBO_CTX]); + } + if (profile[WEBO_DS]) { + utils.deepSetValue(ortb2, 'site.ext.data.webo_ds', profile[WEBO_DS]); + } + config.setConfig({ortb2: ortb2}); + } + + if (weboCtxConf.setTargeting === false) { + return {}; + } + + try { + const formattedProfile = profile; + const r = adUnitsCodes.reduce((rp, adUnitCode) => { + if (adUnitCode) { + rp[adUnitCode] = formattedProfile; + } + return rp; + }, {}); + return r; + } catch (e) { + utils.logError('unable to format weborama rtd targeting data', e); + return {}; + } +} + +/** set bigsea contextual profile on module state + * if the profile is empty, will store the default profile + * @param {null|Object} data + * @returns {void} + */ +export function setBigseaContextualProfile(data) { + if (data && Object.keys(data).length > 0) { + _bigseaContextualProfile = data; + } +} + +/** onSuccess callback type + * @callback successCallback + * @param {null|Object} data + * @returns {void} + */ + +/** onDone callback type + * @callback doneCallback + * @returns {void} + */ + +/** Fetch Bigsea Contextual Profile + * @param {WeboCtxConf} weboCtxConf + * @param {successCallback} onSuccess callback + * @param {doneCallback} onDone callback + * @returns {void} + */ +function fetchContextualProfile(weboCtxConf, onSuccess, onDone) { + const targetURL = weboCtxConf.targetURL || document.URL; + const token = weboCtxConf.token; + + let queryString = ''; + queryString = utils.tryAppendQueryString(queryString, 'token', token); + queryString = utils.tryAppendQueryString(queryString, 'url', targetURL); + + const url = 'https://ctx.weborama.com/api/profile?' + queryString; + + ajax(url, { + success: function (response, req) { + if (req.status === 200) { + try { + const data = JSON.parse(response); + onSuccess(data); + onDone(); + } catch (e) { + onDone(); + utils.logError('unable to parse weborama data', e); + } + } else if (req.status === 204) { + onDone(); + } + }, + error: function () { + onDone(); + utils.logError('unable to get weborama data'); + } + }, + null, + { + method: 'GET', + withCredentials: false, + }); +} + +/** Initialize module + * @param {object} moduleConfig + * @return {boolean} true if module was initialized with success + */ +function init(moduleConfig) { + _bigseaContextualProfile = null; + + moduleConfig = moduleConfig || {}; + const moduleParams = moduleConfig.params || {}; + const weboCtxConf = moduleParams.weboCtxConf || {}; + + if (weboCtxConf.token) { + fetchContextualProfile(weboCtxConf, setBigseaContextualProfile, + () => utils.logMessage('fetchContextualProfile on init is done')); + } else { + utils.logError('missing param "token" for weborama rtd module initialization'); + return false; + } + + return true; +} + +export const weboramaSubmodule = { + name: SUBMODULE_NAME, + init: init, + getTargetingData: getTargetingData, +}; + +submodule(MODULE_NAME, weboramaSubmodule); diff --git a/modules/weboramaRtdProvider.md b/modules/weboramaRtdProvider.md new file mode 100644 index 00000000000..e7b9b96d668 --- /dev/null +++ b/modules/weboramaRtdProvider.md @@ -0,0 +1,70 @@ +# Weborama Real-Time Data Submodule + +``` +Module Name: Weborama Rtd Provider +Module Type: Rtd Provider +Maintainer: prebid-support@weborama.com +``` + +# Description + +Weborama provides a Semantic AI Contextual API that classifies in Real-time a web page seen by a web user within generic and custom topics. It enables publishers to better monetize their inventory and unlock it to programmatic. + +ORTB2 compliant and FPD support for Prebid versions < 4.29 + +Contact prebid-support@weborama.com for information. + +### Publisher Usage + +Compile the Weborama RTD module into your Prebid build: + +`gulp build --modules=rtdModule,weboramaRtdProvider` + +Add the Weborama RTD provider to your Prebid config. + +```javascript +pbjs.setConfig( + ... + realTimeData: { + auctionDelay: 1000, + dataProviders: [ + { + name: "weborama", + waitForIt: true, + params: { + weboCtxConf: { + setTargeting: true, + token: "<>", + targetURL: "..." // default is document.URL + } + } + } + ] + } + ... +} +``` + +### Parameter Descriptions for the Weborama Configuration Section + +| Name |Type | Description | Notes | +| :------------ | :------------ | :------------ |:------------ | +| name | String | Real time data module name | Mandatory. Always 'Weborama' | +| waitForIt | Boolean | Mandatory. Required to ensure that the auction is delayed until prefetch is complete | Optional. Defaults to false but recommended to true | +| params | Object | | Optional | +| params.weboCtxConf | Object | Weborama Contextual Configuration | Optional | +| params.weboCtxConf.token | String | Security Token provided by Weborama, unique per client | Mandatory | +| params.weboCtxConf.targetURL | String | Url to be profiled in the contextual api | Optional. Defaults to `document.URL` | +| params.weboCtxConf.defaultProfile | Object | default value of the profile to be used when there are no response from contextual api (such as timeout)| Optional. Default is `{}` | +| params.weboCtxConf.setTargeting|Boolean|If true, will use the contextual profile to set the gam targeting of all adunits managed by prebid.js| Optional. Default is *true*.| +| params.weboCtxConf.setOrtb2|Boolean|If true, will use the contextual profile to set the ortb2 configuration on `site.ext.data`| Optional. Default is *false*.| + +### Testing + +To view an example of available segments returned by Weborama's backends: + +`gulp serve --modules=rtdModule,weboramaRtdProvider,appnexusBidAdapter` + +and then point your browser at: + +`http://localhost:9999/integrationExamples/gpt/weboramaRtdProvider_example.html` diff --git a/test/spec/modules/weboramaRtdProvider_spec.js b/test/spec/modules/weboramaRtdProvider_spec.js new file mode 100644 index 00000000000..155f26990a7 --- /dev/null +++ b/test/spec/modules/weboramaRtdProvider_spec.js @@ -0,0 +1,288 @@ +import { setBigseaContextualProfile, weboramaSubmodule } from 'modules/weboramaRtdProvider.js'; +import { server } from 'test/mocks/xhr.js'; +import {config} from 'src/config.js'; + +const responseHeader = {'Content-Type': 'application/json'}; + +// TODO fix it + +describe('weboramaRtdProvider', function() { + describe('weboramaSubmodule', function() { + it('successfully instantiates and call contextual api', function () { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + } + } + }; + + expect(weboramaSubmodule.init(moduleConfig)).to.equal(true); + + let request = server.requests[0]; + + expect(request.url).to.equal('https://ctx.weborama.com/api/profile?token=foo&url=https%3A%2F%2Fprebid.org&'); + expect(request.method).to.equal('GET') + }); + it('instantiate without token should fail', function () { + const moduleConfig = { + params: { + weboCtxConf: {} + } + }; + expect(weboramaSubmodule.init(moduleConfig)).to.equal(false); + }); + }); + + describe('Add Contextual Data', function() { + beforeEach(function() { + let conf = { + site: { + ext: { + data: { + inventory: ['value1'] + } + } + }, + user: { + ext: { + data: { + visitor: ['value2'] + } + } + }, + cur: ['USD'] + }; + + config.setConfig({ortb2: conf}); + }); + it('should set targeting and ortb2 if omit setTargeting', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setOrtb2: true, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + webo_ds: ['baz'], + }; + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': data, + 'adunit2': data, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data.webo_ctx).to.deep.equal(data.webo_ctx); + expect(ortb2.site.ext.data.webo_ds).to.deep.equal(data.webo_ds); + }); + + it('should set targeting and ortb2 with setTargeting=true', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: true, + setOrtb2: true, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + webo_ds: ['baz'], + }; + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': data, + 'adunit2': data, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data.webo_ctx).to.deep.equal(data.webo_ctx); + expect(ortb2.site.ext.data.webo_ds).to.deep.equal(data.webo_ds); + }); + it('should set targeting and ortb2 only webo_ctx with setTargeting=true', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: true, + setOrtb2: true, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + }; + + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': data, + 'adunit2': data, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data.webo_ctx).to.deep.equal(data.webo_ctx); + expect(ortb2.site.ext.data).to.not.have.property('webo_ds'); + }); + it('should set only targeting and not ortb2 with setTargeting=true and setOrtb2=false', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: true, + setOrtb2: false, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + }; + + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': data, + 'adunit2': data, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data).to.not.have.property('webo_ctx'); + expect(ortb2.site.ext.data).to.not.have.property('webo_ds'); + }); + it('should set only targeting and not ortb2 with setTargeting=true and omit setOrtb2', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: true, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + }; + + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': data, + 'adunit2': data, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data).to.not.have.property('webo_ctx'); + expect(ortb2.site.ext.data).to.not.have.property('webo_ds'); + }); + + it('should set only ortb2 with setTargeting=false', function() { + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: false, + setOrtb2: true, + } + } + }; + const data = { + webo_ctx: ['foo', 'bar'], + }; + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify(data)); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({}); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data.webo_ctx).to.deep.equal(data.webo_ctx); + expect(ortb2.site.ext.data).to.not.have.property('webo_ds'); + }); + it('should use default profile in case of api error', function() { + const defaultProfile = { + webo_ctx: ['baz'], + }; + const moduleConfig = { + params: { + weboCtxConf: { + token: 'foo', + targetURL: 'https://prebid.org', + setTargeting: true, + defaultProfile: defaultProfile, + } + } + }; + + const adUnitsCodes = ['adunit1', 'adunit2']; + weboramaSubmodule.init(moduleConfig); + + let request = server.requests[0]; + request.respond(500, responseHeader); + + const targeting = weboramaSubmodule.getTargetingData(adUnitsCodes, moduleConfig); + + expect(targeting).to.deep.equal({ + 'adunit1': defaultProfile, + 'adunit2': defaultProfile, + }); + + const ortb2 = config.getConfig('ortb2'); + + expect(ortb2.site.ext.data).to.not.have.property('webo_ctx'); + expect(ortb2.site.ext.data).to.not.have.property('webo_ds'); + }); + }); +}); From 5f6881cec1f16e91b2be80d23a29754cb43a61ff Mon Sep 17 00:00:00 2001 From: adquery <89853721+adquery@users.noreply.github.com> Date: Wed, 22 Sep 2021 15:54:05 +0200 Subject: [PATCH 077/250] New bidder adapter - Adquery (#7441) * init adapter * implemented buildRequests * new adquery adapter * adquery adapter - prepared test * adquery adapter - increase test coverage and minor changes after review * adquery - fixed multi bid and response from server Co-authored-by: m.czerwiak --- modules/adqueryBidAdapter.js | 204 ++++++++++++++++++++ modules/adqueryBidAdapter.md | 32 +++ test/spec/modules/adqueryBidAdapter_spec.js | 185 ++++++++++++++++++ 3 files changed, 421 insertions(+) create mode 100644 modules/adqueryBidAdapter.js create mode 100644 modules/adqueryBidAdapter.md create mode 100644 test/spec/modules/adqueryBidAdapter_spec.js diff --git a/modules/adqueryBidAdapter.js b/modules/adqueryBidAdapter.js new file mode 100644 index 00000000000..bbff7edea47 --- /dev/null +++ b/modules/adqueryBidAdapter.js @@ -0,0 +1,204 @@ +import {registerBidder} from '../src/adapters/bidderFactory.js'; +import {BANNER} from '../src/mediaTypes.js'; +import * as utils from '../src/utils.js'; +import { getStorageManager } from '../src/storageManager.js'; + +const ADQUERY_GVLID = 902; +const ADQUERY_BIDDER_CODE = 'adquery'; +const ADQUERY_BIDDER_DOMAIN_PROTOCOL = 'https'; +const ADQUERY_BIDDER_DOMAIN = 'bidder.adquery.io'; +const ADQUERY_USER_SYNC_DOMAIN = ADQUERY_BIDDER_DOMAIN_PROTOCOL + '://' + ADQUERY_BIDDER_DOMAIN + '/prebid/userSync?1=1'; +const ADQUERY_DEFAULT_CURRENCY = 'PLN'; +const ADQUERY_NET_REVENUE = true; +const ADQUERY_TTL = 360; +const storage = getStorageManager(ADQUERY_GVLID); + +/** @type {BidderSpec} */ +export const spec = { + code: ADQUERY_BIDDER_CODE, + gvlid: ADQUERY_GVLID, + supportedMediaTypes: [BANNER], + + /** f + * @param {object} bid + * @return {boolean} + */ + isBidRequestValid: (bid) => { + return !!(bid && bid.params && bid.params.placementId) + }, + + /** + * @param {BidRequest[]} bidRequests + * @param {*} bidderRequest + * @return {ServerRequest} + */ + buildRequests: (bidRequests, bidderRequest) => { + const requests = []; + for (let i = 0, len = bidRequests.length; i < len; i++) { + const request = { + method: 'POST', + url: ADQUERY_BIDDER_DOMAIN_PROTOCOL + '://' + ADQUERY_BIDDER_DOMAIN + '/prebid/bid', + data: buildRequest(bidRequests[i], bidderRequest), + options: { + withCredentials: false, + crossOrigin: true + } + }; + requests.push(request); + } + return requests; + }, + + /** + * @param {*} response + * @param {ServerRequest} request + * @return {Bid[]} + */ + interpretResponse: (response, request) => { + utils.logInfo(request); + utils.logInfo(response); + + const res = response && response.body && response.body.data; + let bidResponses = []; + + if (!res) { + return []; + } + + const bidResponse = { + requestId: res.requestId, + cpm: res.cpm, + width: res.mediaType.width, + height: res.mediaType.height, + creativeId: res.creationId, + dealId: res.dealid || '', + currency: res.currency || ADQUERY_DEFAULT_CURRENCY, + netRevenue: ADQUERY_NET_REVENUE, + ttl: ADQUERY_TTL, + referrer: '', + ad: '' + res.tag, + mediaType: res.mediaType.name || 'banner', + meta: { + advertiserDomains: res.adDomains && res.adDomains.length ? res.adDomains : [], + mediaType: res.mediaType.name || 'banner', + } + }; + bidResponses.push(bidResponse); + utils.logInfo('bidResponses', bidResponses); + + return bidResponses; + }, + + /** + * @param {TimedOutBid} timeoutData + */ + onTimeout: (timeoutData) => { + if (timeoutData == null) { + return; + } + utils.logInfo('onTimeout ', timeoutData); + let params = { + bidder: timeoutData.bidder, + bId: timeoutData.bidId, + adUnitCode: timeoutData.adUnitCode, + timeout: timeoutData.timeout, + auctionId: timeoutData.auctionId, + }; + let adqueryRequestUrl = utils.buildUrl({ + protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, + hostname: ADQUERY_BIDDER_DOMAIN, + pathname: '/prebid/eventTimeout', + search: params + }); + utils.triggerPixel(adqueryRequestUrl); + }, + + /** + * @param {Bid} bid + */ + onBidWon: (bid) => { + utils.logInfo('onBidWon', bid); + const bidString = JSON.stringify(bid); + const encodedBuf = window.btoa(bidString); + + let params = { + q: encodedBuf, + }; + let adqueryRequestUrl = utils.buildUrl({ + protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, + hostname: ADQUERY_BIDDER_DOMAIN, + pathname: '/prebid/eventBidWon', + search: params + }); + utils.triggerPixel(adqueryRequestUrl); + }, + + /** + * @param {Bid} bid + */ + onSetTargeting: (bid) => { + utils.logInfo('onSetTargeting', bid); + + let params = { + bidder: bid.bidder, + width: bid.width, + height: bid.height, + bid: bid.adId, + mediaType: bid.mediaType, + cpm: bid.cpm, + requestId: bid.requestId, + adUnitCode: bid.adUnitCode + }; + + let adqueryRequestUrl = utils.buildUrl({ + protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, + hostname: ADQUERY_BIDDER_DOMAIN, + pathname: '/prebid/eventSetTargeting', + search: params + }); + utils.triggerPixel(adqueryRequestUrl); + }, + getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { + let syncUrl = ADQUERY_USER_SYNC_DOMAIN; + if (gdprConsent && gdprConsent.consentString) { + if (typeof gdprConsent.gdprApplies === 'boolean') { + syncUrl += `&gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`; + } else { + syncUrl += `&gdpr=0&gdpr_consent=${gdprConsent.consentString}`; + } + } + if (uspConsent && uspConsent.consentString) { + syncUrl += `&ccpa_consent=${uspConsent.consentString}`; + } + return [{ + type: 'image', + url: syncUrl + }]; + } + +}; +function buildRequest(validBidRequests, bidderRequest) { + let qid = Math.random().toString(36).substring(2) + Date.now().toString(36); + let bid = validBidRequests; + + if (storage.getDataFromLocalStorage('qid')) { + qid = storage.getDataFromLocalStorage('qid'); + } else { + storage.setDataInLocalStorage('qid', qid); + } + + return { + placementCode: bid.params.placementId, + auctionId: bid.auctionId, + qid: qid, + type: bid.params.type, + adUnitCode: bid.adUnitCode, + bidId: bid.bidId, + bidder: bid.bidder, + bidderRequestId: bid.bidderRequestId, + bidRequestsCount: bid.bidRequestsCount, + bidderRequestsCount: bid.bidderRequestsCount, + }; +} + +registerBidder(spec); diff --git a/modules/adqueryBidAdapter.md b/modules/adqueryBidAdapter.md new file mode 100644 index 00000000000..e8b68e30406 --- /dev/null +++ b/modules/adqueryBidAdapter.md @@ -0,0 +1,32 @@ +# Overview + +Module Name: Adquery Bidder Adapter +Module Type: Bidder Adapter +Maintainer: prebid@adquery.com + +# Description + +Module that connects to Adquery's demand sources. + +# Test Parameters +``` + var adUnits = [ + { + code: 'banner-adquery-div', + mediaTypes: { + banner: { + sizes: [[300, 250]], + } + }, + bids: [ + { + bidder: 'adquery', + params: { + placementId: '6d93f2a0e5f0fe2cc3a6e9e3ade964b43b07f897', + type: 'banner300x250' + } + } + ] + } + ]; +``` diff --git a/test/spec/modules/adqueryBidAdapter_spec.js b/test/spec/modules/adqueryBidAdapter_spec.js new file mode 100644 index 00000000000..4285377e8a7 --- /dev/null +++ b/test/spec/modules/adqueryBidAdapter_spec.js @@ -0,0 +1,185 @@ +import { expect } from 'chai' +import { spec } from 'modules/adqueryBidAdapter.js' +import { newBidder } from 'src/adapters/bidderFactory.js' +import * as utils from '../../../src/utils'; + +describe('adqueryBidAdapter', function () { + const adapter = newBidder(spec) + let bidRequest = { + bidder: 'adquery', + params: { + placementId: '6d93f2a0e5f0fe2cc3a6e9e3ade964b43b07f897', + type: 'banner300x250' + }, + mediaTypes: { + banner: { + sizes: [[300, 250]], + } + } + } + + let expectedResponse = { + 'body': { + 'data': + { + 'requestId': 1, + 'emission_id': 1, + 'eventTracker': 'https://example.com', + 'externalEmissionCodes': 'https://example.com', + 'impressionTracker': 'https://example.com', + 'viewabilityTracker': 'https://example.com', + 'clickTracker': 'https://example.com', + 'link': 'https://example.com', + 'logo': 'https://example.com', + 'medias': [ + { + 'src': 'banner/2021-04-09/938', + 'ext': 'zip', + 'type': 3, + } + ], + 'domain': 'https://example.com', + 'urlAdq': 'https://example.com', + 'creationId': 1, + 'currency': 'PLN', + 'adDomains': ['https://example.com'], + 'tag': ' ', + 'adqLib': 'https://example.com/js/example.js', + 'mediaType': {'width': 300, 'height': 250, 'name': 'banner', 'type': 'banner300x250'}, + 'cpm': 2.5, + 'meta': { + 'advertiserDomains': ['example.com'], + 'mediaType': 'banner', + } + } + } + } + describe('codes', function () { + it('should return a bidder code of adquery', function () { + expect(spec.code).to.equal('adquery') + }) + }) + + describe('isBidRequestValid', function () { + let inValidBid = Object.assign({}, bidRequest) + delete inValidBid.params + it('should return true if all params present', function () { + expect(spec.isBidRequestValid(bidRequest)).to.equal(true) + }) + + it('should return false if any parameter missing', function () { + expect(spec.isBidRequestValid(inValidBid)).to.be.false + }) + }) + + describe('buildRequests', function () { + let req = spec.buildRequests([ bidRequest ], { refererInfo: { } })[0] + let rdata + + it('should return request object', function () { + expect(req).to.not.be.null + }) + + it('should build request data', function () { + expect(req.data).to.not.be.null + }) + + it('should include one request', function () { + rdata = req.data; + expect(rdata.data).to.not.be.null + }) + + it('should include placementCode', function () { + expect(rdata.placementCode).not.be.null + }) + + it('should include qid', function () { + expect(rdata.qid).not.be.null + }) + + it('should include type', function () { + expect(rdata.type !== null).not.be.null + }) + + it('should include all publisher params', function () { + expect(rdata.type !== null && rdata.placementCode !== null).to.be.true + }) + + it('should include bidder', function () { + expect(rdata.bidder !== null).to.be.true + }) + }) + + describe('interpretResponse', function () { + it('should get the correct bid response', function () { + let result = spec.interpretResponse(expectedResponse) + expect(result).to.be.an('array') + }) + + it('validate response params', function() { + const newResponse = spec.interpretResponse(expectedResponse, bidRequest); + expect(newResponse[0].requestId).to.be.equal(1) + }); + it('handles empty bid response', function () { + let response = { + body: {} + }; + let result = spec.interpretResponse(response); + expect(result.length).to.equal(0); + }) + }) + + describe('getUserSyncs', function () { + it('should return iframe sync', function () { + let sync = spec.getUserSyncs() + expect(sync.length).to.equal(1) + expect(sync[0].type === 'iframe') + expect(typeof sync[0].url === 'string') + }) + + it('Should return array of objects with proper sync config , include GDPR', function() { + const syncData = spec.getUserSyncs({}, {}, { + consentString: 'ALL', + gdprApplies: true, + }, {}); + expect(syncData).to.be.an('array').which.is.not.empty; + expect(syncData[0]).to.be.an('object') + expect(syncData[0].type).to.be.a('string') + expect(syncData[0].type).to.equal('image') + }); + }) + + describe('test onBidWon function', function () { + beforeEach(function() { + sinon.stub(utils, 'triggerPixel'); + }); + afterEach(function() { + utils.triggerPixel.restore(); + }); + it('exists and is a function', () => { + expect(spec.onBidWon).to.exist.and.to.be.a('function'); + }); + it('should return nothing', function () { + var response = spec.onBidWon({}); + expect(response).to.be.an('undefined') + expect(utils.triggerPixel.called).to.equal(true); + }); + }) + + describe('onTimeout', function () { + const timeoutData = [{ + timeout: null + }]; + + it('should exists and be a function', () => { + expect(spec.onTimeout).to.exist.and.to.be.a('function'); + }); + it('should include timeoutData', function () { + expect(spec.onTimeout(timeoutData)).to.be.undefined; + }) + }); + + it(`onSetTargeting is present and type function`, function () { + expect(spec.onSetTargeting).to.exist.and.to.be.a('function') + }); +}) From 6f556543069b8f8158ef70fa230128fc07dcf286 Mon Sep 17 00:00:00 2001 From: Monis Qadri Date: Wed, 22 Sep 2021 19:31:40 +0530 Subject: [PATCH 078/250] medianetBidAdapter sending ortb2imp in bid request (#7443) Co-authored-by: monis.q --- modules/medianetBidAdapter.js | 5 ++ test/spec/modules/medianetBidAdapter_spec.js | 63 +++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/modules/medianetBidAdapter.js b/modules/medianetBidAdapter.js index 3b7e555cc72..d78f4a70e2c 100644 --- a/modules/medianetBidAdapter.js +++ b/modules/medianetBidAdapter.js @@ -179,6 +179,11 @@ function slotParams(bidRequest) { }, all: bidRequest.params }; + + if (bidRequest.ortb2Imp) { + params.ortb2Imp = bidRequest.ortb2Imp; + } + let bannerSizes = utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes') || []; const videoInMediaType = utils.deepAccess(bidRequest, 'mediaTypes.video') || {}; diff --git a/test/spec/modules/medianetBidAdapter_spec.js b/test/spec/modules/medianetBidAdapter_spec.js index adb9663ba7c..8589c3b404f 100644 --- a/test/spec/modules/medianetBidAdapter_spec.js +++ b/test/spec/modules/medianetBidAdapter_spec.js @@ -1,4 +1,4 @@ -import {expect} from 'chai'; +import {expect, assert} from 'chai'; import {spec} from 'modules/medianetBidAdapter.js'; import { makeSlot } from '../integration/faker/googletag.js'; import { config } from 'src/config.js'; @@ -99,6 +99,56 @@ let VALID_BID_REQUEST = [{ 'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d', 'bidRequestsCount': 1 }], + VALID_BID_REQUEST_WITH_ORTB2 = [{ + 'bidder': 'medianet', + 'params': { + 'crid': 'crid', + 'cid': 'customer_id', + 'site': { + 'page': 'http://media.net/prebidtest', + 'domain': 'media.net', + 'ref': 'http://media.net/prebidtest', + 'isTop': true + } + }, + 'adUnitCode': 'div-gpt-ad-1460505748561-0', + 'transactionId': '277b631f-92f5-4844-8b19-ea13c095d3f1', + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 250]], + } + }, + 'bidId': '28f8f8130a583e', + 'bidderRequestId': '1e9b1f07797c1c', + 'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d', + 'ortb2Imp': { 'ext': { 'data': { 'pbadslot': '/12345/my-gpt-tag-0' } } }, + 'bidRequestsCount': 1 + }, { + 'bidder': 'medianet', + 'params': { + 'crid': 'crid', + 'cid': 'customer_id', + 'site': { + 'page': 'http://media.net/prebidtest', + 'domain': 'media.net', + 'ref': 'http://media.net/prebidtest', + 'isTop': true + } + }, + 'adUnitCode': 'div-gpt-ad-1460505748561-123', + 'transactionId': 'c52a5c62-3c2b-4b90-9ff8-ec1487754822', + 'mediaTypes': { + 'banner': { + 'sizes': [[300, 251]], + } + }, + 'sizes': [[300, 251]], + 'bidId': '3f97ca71b1e5c2', + 'bidderRequestId': '1e9b1f07797c1c', + 'auctionId': 'aafabfd0-28c0-4ac0-aa09-99689e88b81d', + 'ortb2Imp': { 'ext': { 'data': { 'pbadslot': '/12345/my-gpt-tag-0' } } }, + 'bidRequestsCount': 1 + }], VALID_BID_REQUEST_WITH_USERID = [{ 'bidder': 'medianet', 'params': { @@ -1247,6 +1297,17 @@ describe('Media.net bid adapter', function () { expect(JSON.parse(bidreq.data)).to.deep.equal(VALID_PAYLOAD_WITH_CRID); }); + it('should have valid ortb2Imp param present in bid request', function() { + let bidreq = spec.buildRequests(VALID_BID_REQUEST_WITH_ORTB2, VALID_AUCTIONDATA); + let actual = JSON.parse(bidreq.data).imp[0].ortb2Imp; + const expected = VALID_BID_REQUEST_WITH_ORTB2[0].ortb2Imp + assert.equal(JSON.stringify(actual), JSON.stringify(expected)) + + bidreq = spec.buildRequests(VALID_BID_REQUEST, VALID_AUCTIONDATA); + actual = JSON.parse(bidreq.data).imp[0].ortb2Imp; + assert.equal(actual, undefined) + }); + it('should have userid in bid request', function () { let bidReq = spec.buildRequests(VALID_BID_REQUEST_WITH_USERID, VALID_AUCTIONDATA); expect(JSON.parse(bidReq.data)).to.deep.equal(VALID_PAYLOAD_WITH_USERID); From 46b12294ad7da21ee71fc60686d46f264f460f96 Mon Sep 17 00:00:00 2001 From: Monis Qadri Date: Wed, 22 Sep 2021 20:05:17 +0530 Subject: [PATCH 079/250] removed pr logs and fixed sampling in medianetAnalyticsAdapter (#7423) Co-authored-by: monis.q --- modules/medianetAnalyticsAdapter.js | 105 +++--------------- .../modules/medianetAnalyticsAdapter_spec.js | 46 ++++++-- 2 files changed, 53 insertions(+), 98 deletions(-) diff --git a/modules/medianetAnalyticsAdapter.js b/modules/medianetAnalyticsAdapter.js index cb65a6afc54..45fb39d8c82 100644 --- a/modules/medianetAnalyticsAdapter.js +++ b/modules/medianetAnalyticsAdapter.js @@ -42,17 +42,10 @@ const VALID_URL_KEY = ['canonical_url', 'og_url', 'twitter_url']; const DEFAULT_URL_KEY = 'page'; const LOG_TYPE = { - AP: 'AP', - PR: 'PR', APPR: 'APPR', RA: 'RA' }; -const BATCHING = { - SINGLE: 'SINGLE', - MULTI: 'MULTI' -} - let auctions = {}; let config; let pageDetails; @@ -66,7 +59,6 @@ class ErrorLogger { this.project = 'prebidanalytics'; this.dn = pageDetails.domain || ''; this.requrl = pageDetails.requrl || ''; - this.event = this.event; this.pbversion = PREBID_VERSION; this.cid = config.cid || ''; this.rd = additionalData; @@ -89,18 +81,10 @@ class Configure { this.gdprConsent = undefined; this.gdprApplies = undefined; this.uspConsent = undefined; - this.pixelWaitTime = 0; - this.apLoggingPct = 0; - this.prLoggingPct = 0; - this.batching = BATCHING.SINGLE; this.shouldBeLogged = {}; this.mnetDebugConfig = ''; } - set publisherLper(plper) { - this.pubLper = plper; - } - getLoggingData() { return { cid: this.cid, @@ -139,20 +123,6 @@ class Configure { if (!isNaN(parseInt(response.percentage, 10))) { this.loggingPercent = response.percentage; } - - if (!isNaN(parseInt(response.pixelwaittime, 10))) { - this.pixelWaitTime = response.pixelwaittime; - } - - if (!isNaN(parseInt(response.aplper, 10))) { - this.apLoggingPct = response.aplper; - this.batching = BATCHING.MULTI; - } - - if (!isNaN(parseInt(response.prlper, 10))) { - this.prLoggingPct = response.prlper; - this.batching = BATCHING.MULTI; - } } overrideDomainLevelData(response) { @@ -268,18 +238,14 @@ class AdSlot { this.context = context; this.adext = adext; this.logged = {}; - this.logged[LOG_TYPE.PR] = false; - this.logged[LOG_TYPE.AP] = false; - this.logged[LOG_TYPE.APPR] = false; this.targeting = undefined; this.medianetPresent = 0; } getShouldBeLogged(logType) { if (!config.shouldBeLogged.hasOwnProperty(logType)) { - config.shouldBeLogged[logType] = isSampled(logType); + config.shouldBeLogged[logType] = isSampled(); } - config.shouldBeLogged[logType] = isSampled(logType); return config.shouldBeLogged[logType]; } @@ -343,7 +309,7 @@ class Bid { bdp: this.cpm, cbdp: this.dfpbd, dfpbd: this.dfpbd, - szs: this.allMediaTypeSizes.map(sz => sz.join('x')).join('|'), + szs: this.allMediaTypeSizes.join('|'), size: this.size, mtype: this.mediaType, dId: this.dealId, @@ -475,10 +441,9 @@ function addAddSlots(auctionId, adUnits, tmax) { adext = utils.isEmpty(adext) ? undefined : adext; oSizes.banner = oSizes.banner.filter(utils.uniques); oSizes.video = oSizes.video.filter(utils.uniques); - oSizes.native = mediaTypeMap.native === 1 ? [[1, 1]] : []; + oSizes.native = mediaTypeMap.native === 1 ? [[1, 1].join('x')] : []; const allMediaTypeSizes = [].concat(oSizes.banner, oSizes.native, oSizes.video); const mediaTypes = Object.keys(mediaTypeMap).join('|'); - auctions[auctionId].addSlot({adUnitCode, supplyAdCode, mediaTypes, allMediaTypeSizes, context, tmax, adext}); }); } @@ -518,7 +483,11 @@ function _getSizes(mediaTypes, sizes) { if (playerSize.length === 2) { video = [playerSize] } - return { banner, native, video } + return { + banner: banner.map(size => size.join('x')), + native: native.map(size => size.join('x')), + video: video.map(size => size.join('x')) + } } function bidResponseHandler(bid) { @@ -593,18 +562,12 @@ function bidTimeoutHandler(timedOutBids) { }) } -function auctionEndHandler({auctionId, auctionEnd, adUnitCodes}) { +function auctionEndHandler({auctionId, auctionEnd}) { if (!(auctions[auctionId] instanceof Auction)) { return; } auctions[auctionId].status = AUCTION_COMPLETED; auctions[auctionId].auctionEndTime = auctionEnd; - - if (config.batching === BATCHING.MULTI) { - adUnitCodes.forEach(function (adUnitCode) { - sendEvent(auctionId, adUnitCode, LOG_TYPE.PR); - }); - } } function setTargetingHandler(params) { @@ -639,30 +602,11 @@ function setTargetingHandler(params) { bid.height = utils.deepAccess(winningBid, 'height'); } }); - sendEvent(auctionId, adunit, getLogType()); + sendEvent(auctionId, adunit, LOG_TYPE.APPR); } } } -function getLogType() { - if (config.batching === BATCHING.SINGLE) { - return LOG_TYPE.APPR; - } - return LOG_TYPE.AP; -} - -function setBidderDone(params) { - if (config.pixelWaitTime != null && config.pixelWaitTime > 0) { - setTimeout(fireApAfterWait, config.pixelWaitTime, params) - } -} - -function fireApAfterWait(params) { - params.bids.forEach(function (adUnit) { - sendEvent(params.auctionId, adUnit.adUnitCode, LOG_TYPE.AP); - }); -} - function bidWonHandler(bid) { const { requestId, auctionId, adUnitCode } = bid; if (!(auctions[auctionId] instanceof Auction)) { @@ -677,20 +621,8 @@ function bidWonHandler(bid) { sendEvent(auctionId, adUnitCode, LOG_TYPE.RA); } -function isSampled(logType) { - return Math.random() * 100 < parseFloat(getLogPercentage(logType)); -} - -function getLogPercentage(logType) { - let logPercentage = config.loggingPercent; - if (config.batching === BATCHING.MULTI) { - if (logType === LOG_TYPE.AP) { - logPercentage = config.apLoggingPct; - } else if (logType === LOG_TYPE.PR) { - logPercentage = config.prLoggingPct; - } - } - return logPercentage; +function isSampled() { + return Math.random() * 100 < parseFloat(config.loggingPercent); } function isValidAuctionAdSlot(acid, adtag) { @@ -711,13 +643,8 @@ function sendEvent(id, adunit, logType) { function fireApPrLog(auctionId, adUnitName, logType) { const adSlot = auctions[auctionId].adSlots[adUnitName]; if (adSlot.getShouldBeLogged(logType) && !adSlot.logged[logType]) { - if (config.batching === BATCHING.SINGLE) { - adSlot.logged[LOG_TYPE.AP] = true; - adSlot.logged[LOG_TYPE.PR] = true; - } else { - adSlot.logged[logType] = true; - } fireAuctionLog(auctionId, adUnitName, logType); + adSlot.logged[logType] = true; } } @@ -844,10 +771,6 @@ let medianetAnalytics = Object.assign(adapter({URL, analyticsType}), { setTargetingHandler(args); break; } - case CONSTANTS.EVENTS.BIDDER_DONE : { - setBidderDone(args); - break; - } case CONSTANTS.EVENTS.BID_WON: { bidWonHandler(args); break; @@ -868,7 +791,7 @@ medianetAnalytics.enableAnalytics = function (configuration) { pageDetails = new PageDetail(); config = new Configure(configuration.options.cid); - config.publisherLper = configuration.options.sampling || ''; + config.pubLper = configuration.options.sampling || ''; config.init(); configuration.options.sampling = 1; medianetAnalytics.originEnableAnalytics(configuration); diff --git a/test/spec/modules/medianetAnalyticsAdapter_spec.js b/test/spec/modules/medianetAnalyticsAdapter_spec.js index 41a6338225e..a0a62710a56 100644 --- a/test/spec/modules/medianetAnalyticsAdapter_spec.js +++ b/test/spec/modules/medianetAnalyticsAdapter_spec.js @@ -11,10 +11,12 @@ const { const MOCK = { Ad_Units: [{'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'banner': {'sizes': [[300, 250]]}}, 'bids': [], 'ext': {'prop1': 'value1'}}], MULTI_FORMAT_TWIN_AD_UNITS: [{'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'banner': {'sizes': [[300, 250]]}, 'native': {'image': {'required': true, 'sizes': [150, 50]}}}, 'bids': [], 'ext': {'prop1': 'value1'}}, {'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'video': {'playerSize': [640, 480], 'context': 'instream'}}, 'bids': [], 'ext': {'prop1': 'value1'}}], + TWIN_AD_UNITS: [{'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'banner': {'sizes': [[300, 100]]}}, 'ask': '300x100', 'bids': [{'bidder': 'bidder1', 'params': {'siteId': '451465'}}]}, {'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'banner': {'sizes': [[300, 250], [300, 100]]}}, 'bids': [{'bidder': 'medianet', 'params': {'cid': 'TEST_CID', 'crid': '451466393'}}]}, {'code': 'div-gpt-ad-1460505748561-0', 'mediaTypes': {'banner': {'sizes': [[300, 250]]}}, 'bids': [{'bidder': 'bidder1', 'params': {'siteId': '451466'}}]}], AUCTION_INIT: {'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'timestamp': 1584563605739, 'timeout': 6000}, AUCTION_INIT_WITH_FLOOR: {'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'timestamp': 1584563605739, 'timeout': 6000, 'bidderRequests': [{'bids': [{ 'floorData': {'enforcements': {'enforceJS': true}} }]}]}, BID_REQUESTED: {'bidderCode': 'medianet', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'bids': [{'bidder': 'medianet', 'params': {'cid': 'TEST_CID', 'crid': '451466393'}, 'mediaTypes': {'banner': {'sizes': [[300, 250]], 'ext': ['asdads']}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'sizes': [[300, 250]], 'bidId': '28248b0e6aece2', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'src': 'client'}], 'auctionStart': 1584563605739, 'timeout': 6000, 'uspConsent': '1YY', 'start': 1584563605743}, MULTI_FORMAT_BID_REQUESTED: {'bidderCode': 'medianet', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'bids': [{'bidder': 'medianet', 'params': {'cid': 'TEST_CID', 'crid': '451466393'}, 'mediaTypes': {'banner': {'sizes': [[300, 250]]}, 'video': {'playerSize': [640, 480], 'context': 'instream'}, 'native': {'image': {'required': true, 'sizes': [150, 50]}, 'title': {'required': true, 'len': 80}}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'sizes': [[300, 250]], 'bidId': '28248b0e6aece2', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'src': 'client'}], 'auctionStart': 1584563605739, 'timeout': 6000, 'uspConsent': '1YY', 'start': 1584563605743}, + TWIN_AD_UNITS_BID_REQUESTED: [{'bidderCode': 'bidder1', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'bidderRequestId': '16f0746ff657b5', 'bids': [{'bidder': 'bidder1', 'params': {'siteId': '451465'}, 'mediaTypes': {'banner': {'sizes': [[300, 100]]}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'transactionId': '9615b5d1-7a4f-4c65-9464-4178b91da9e3', 'sizes': [[300, 100]], 'bidId': '2984d18e18bdfe', 'bidderRequestId': '16f0746ff657b5', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'src': 'client', 'bidRequestsCount': 3, 'bidderRequestsCount': 2, 'bidderWinsCount': 0}, {'bidder': 'bidder1', 'params': {'siteId': '451466'}, 'mediaTypes': {'banner': {'sizes': [[300, 250]]}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'transactionId': '8bd7c9f2-0fe6-4ac5-8f2a-7f4a88af1b71', 'sizes': [[300, 250]], 'bidId': '3dced609066035', 'bidderRequestId': '16f0746ff657b5', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'src': 'client', 'bidRequestsCount': 3, 'bidderRequestsCount': 2, 'bidderWinsCount': 0}], 'auctionStart': 1584563605739, 'timeout': 3000, 'start': 1584563605743}, {'bidderCode': 'medianet', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'bidderRequestId': '4b45d1de1fa8fe', 'bids': [{'bidder': 'medianet', 'params': {'cid': 'TEST_CID', 'crid': '451466393'}, 'mediaTypes': {'banner': {'sizes': [[300, 250], [300, 100]]}}, 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'transactionId': '215c038e-3b6a-465b-8937-d32e2ad8de45', 'sizes': [[300, 250], [300, 100]], 'bidId': '58d34adcb09c99', 'bidderRequestId': '4b45d1de1fa8fe', 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'src': 'client', 'bidRequestsCount': 3, 'bidderRequestsCount': 1, 'bidderWinsCount': 0}], 'auctionStart': 1584563605739, 'timeout': 3000, 'start': 1584563605743}], BID_RESPONSE: {'bidderCode': 'medianet', 'width': 300, 'height': 250, 'adId': '3e6e4bce5c8fb3', 'requestId': '28248b0e6aece2', 'mediaType': 'banner', 'source': 'client', 'ext': {'pvid': 123, 'crid': '321'}, 'no_bid': false, 'cpm': 2.299, 'ad': 'AD_CODE', 'ttl': 180, 'creativeId': 'Test1', 'netRevenue': true, 'currency': 'USD', 'dfp_id': 'div-gpt-ad-1460505748561-0', 'originalCpm': 1.1495, 'originalCurrency': 'USD', 'floorData': {'floorValue': 1.10, 'floorRule': 'banner'}, 'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'responseTimestamp': 1584563606009, 'requestTimestamp': 1584563605743, 'bidder': 'medianet', 'adUnitCode': 'div-gpt-ad-1460505748561-0', 'timeToRespond': 266, 'pbLg': '2.00', 'pbMg': '2.20', 'pbHg': '2.29', 'pbAg': '2.25', 'pbDg': '2.29', 'pbCg': '2.00', 'size': '300x250', 'adserverTargeting': {'hb_bidder': 'medianet', 'hb_adid': '3e6e4bce5c8fb3', 'hb_pb': '2.00', 'hb_size': '300x250', 'hb_source': 'client', 'hb_format': 'banner', 'prebid_test': 1}, 'status': 'rendered', 'params': [{'cid': 'test123', 'crid': '451466393'}]}, AUCTION_END: {'auctionId': '8e0d5245-deb3-406c-96ca-9b609e077ff7', 'auctionEnd': 1584563605739}, SET_TARGETING: {'div-gpt-ad-1460505748561-0': {'prebid_test': '1', 'hb_format': 'banner', 'hb_source': 'client', 'hb_size': '300x250', 'hb_pb': '2.00', 'hb_adid': '3e6e4bce5c8fb3', 'hb_bidder': 'medianet', 'hb_format_medianet': 'banner', 'hb_source_medianet': 'client', 'hb_size_medianet': '300x250', 'hb_pb_medianet': '2.00', 'hb_adid_medianet': '3e6e4bce5c8fb3', 'hb_bidder_medianet': 'medianet'}}, @@ -25,7 +27,7 @@ const MOCK = { } function performAuctionWithFloorConfig() { - events.emit(AUCTION_INIT, {...MOCK.AUCTION_INIT_WITH_FLOOR, adUnits: MOCK.Ad_Units}); + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT_WITH_FLOOR, {adUnits: MOCK.Ad_Units})); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); events.emit(BID_RESPONSE, MOCK.BID_RESPONSE); events.emit(AUCTION_END, MOCK.AUCTION_END); @@ -34,7 +36,7 @@ function performAuctionWithFloorConfig() { } function performStandardAuctionWithWinner() { - events.emit(AUCTION_INIT, {...MOCK.AUCTION_INIT, adUnits: MOCK.Ad_Units}); + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT, {adUnits: MOCK.Ad_Units})); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); events.emit(BID_RESPONSE, MOCK.BID_RESPONSE); events.emit(AUCTION_END, MOCK.AUCTION_END); @@ -43,15 +45,23 @@ function performStandardAuctionWithWinner() { } function performMultiFormatAuctionWithNoBid() { - events.emit(AUCTION_INIT, {...MOCK.AUCTION_INIT, adUnits: MOCK.MULTI_FORMAT_TWIN_AD_UNITS}); + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT, {adUnits: MOCK.MULTI_FORMAT_TWIN_AD_UNITS})); events.emit(BID_REQUESTED, MOCK.MULTI_FORMAT_BID_REQUESTED); events.emit(NO_BID, MOCK.NO_BID); events.emit(AUCTION_END, MOCK.AUCTION_END); events.emit(SET_TARGETING, MOCK.NO_BID_SET_TARGETING); } +function performTwinAdUnitAuctionWithNoBid() { + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT, {adUnits: MOCK.TWIN_AD_UNITS})); + MOCK.TWIN_AD_UNITS_BID_REQUESTED.forEach(bidRequested => events.emit(BID_REQUESTED, bidRequested)); + MOCK.TWIN_AD_UNITS_BID_REQUESTED.forEach(bidRequested => bidRequested.bids.forEach(noBid => events.emit(NO_BID, noBid))); + events.emit(AUCTION_END, MOCK.AUCTION_END); + events.emit(SET_TARGETING, MOCK.NO_BID_SET_TARGETING); +} + function performStandardAuctionWithNoBid() { - events.emit(AUCTION_INIT, {...MOCK.AUCTION_INIT, adUnits: MOCK.Ad_Units}); + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT, {adUnits: MOCK.Ad_Units})); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); events.emit(NO_BID, MOCK.NO_BID); events.emit(AUCTION_END, MOCK.AUCTION_END); @@ -59,17 +69,20 @@ function performStandardAuctionWithNoBid() { } function performStandardAuctionWithTimeout() { - events.emit(AUCTION_INIT, {...MOCK.AUCTION_INIT, adUnits: MOCK.Ad_Units}); + events.emit(AUCTION_INIT, Object.assign({}, MOCK.AUCTION_INIT, {adUnits: MOCK.Ad_Units})); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); events.emit(BID_TIMEOUT, MOCK.BID_TIMEOUT); events.emit(AUCTION_END, MOCK.AUCTION_END); events.emit(SET_TARGETING, MOCK.NO_BID_SET_TARGETING); } -function getQueryData(url) { +function getQueryData(url, decode = false) { const queryArgs = url.split('?')[1].split('&'); return queryArgs.reduce((data, arg) => { - const [key, val] = arg.split('='); + let [key, val] = arg.split('='); + if (decode) { + val = decodeURIComponent(val); + } if (data[key] !== undefined) { if (!Array.isArray(data[key])) { data[key] = [data[key]]; @@ -149,6 +162,25 @@ describe('Media.net Analytics Adapter', function() { expect(noBidLog.vplcmtt).to.equal('instream'); }); + it('twin ad units should have correct sizes', function() { + performTwinAdUnitAuctionWithNoBid(); + const noBidLog = medianetAnalytics.getlogsQueue().map((log) => getQueryData(log, true))[0]; + const banner = 'banner'; + expect(noBidLog.pvnm).to.have.ordered.members(['-2', 'bidder1', 'bidder1', 'medianet']); + expect(noBidLog.mtype).to.have.ordered.members([banner, banner, banner, banner]); + expect(noBidLog.status).to.have.ordered.members(['1', '2', '2', '2']); + expect(noBidLog.size).to.have.ordered.members(['', '', '', '']); + expect(noBidLog.szs).to.have.ordered.members(['300x100|300x250', '300x100', '300x250', '300x250|300x100']); + }); + + it('AP log should fire only once', function() { + performStandardAuctionWithNoBid(); + events.emit(SET_TARGETING, MOCK.NO_BID_SET_TARGETING); + const logs = medianetAnalytics.getlogsQueue().map((log) => getQueryData(log, true)); + expect(logs.length).to.equal(1); + expect(logs[0].lgtp).to.equal('APPR'); + }); + it('should have winner log in standard auction', function() { medianetAnalytics.clearlogsQueue(); performStandardAuctionWithWinner(); From 4281953912f7da1f84a758c59a2a479270f7d329 Mon Sep 17 00:00:00 2001 From: rcheptanariu <35690143+rcheptanariu@users.noreply.github.com> Date: Thu, 23 Sep 2021 15:54:15 +0300 Subject: [PATCH 080/250] Invibes Bid Adapter : multi request support (#7398) * Invibes Bid Adapter - support for meta taxonomy * InvibesBidAdapter - support for multi placement * InvibesBidAdapter - support for multiplacement - tests & fixes * InvibesBidAdapter - fix object typo * InvibesBidAdapter - incremented version --- modules/invibesBidAdapter.js | 58 ++++++++-- test/spec/modules/invibesBidAdapter_spec.js | 116 +++++++++++++++++++- 2 files changed, 160 insertions(+), 14 deletions(-) diff --git a/modules/invibesBidAdapter.js b/modules/invibesBidAdapter.js index 18011359a6d..0441f712a2f 100644 --- a/modules/invibesBidAdapter.js +++ b/modules/invibesBidAdapter.js @@ -8,7 +8,7 @@ const CONSTANTS = { SYNC_ENDPOINT: 'https://k.r66net.com/GetUserSync', TIME_TO_LIVE: 300, DEFAULT_CURRENCY: 'EUR', - PREBID_VERSION: 6, + PREBID_VERSION: 7, METHOD: 'GET', INVIBES_VENDOR_ID: 436, USERID_PROVIDERS: ['pubcid', 'pubProvidedId', 'uid2', 'zeotapIdPlus', 'id5id'], @@ -57,14 +57,11 @@ const topWin = getTopMostWindow(); let invibes = topWin.invibes = topWin.invibes || {}; invibes.purposes = invibes.purposes || [false, false, false, false, false, false, false, false, false, false]; invibes.legitimateInterests = invibes.legitimateInterests || [false, false, false, false, false, false, false, false, false, false]; +invibes.placementBids = invibes.placementBids || []; +invibes.pushedCids = invibes.pushedCids || {}; let _customUserSync; function isBidRequestValid(bid) { - if (invibes && typeof invibes.bidResponse === 'object') { - utils.logInfo('Invibes Adapter - Bid response already received. Invibes only responds to one bid request per user visit'); - return false; - } - if (typeof bid.params !== 'object') { return false; } @@ -117,6 +114,7 @@ function buildRequest(bidRequests, bidderRequest) { bidParamsJson: JSON.stringify(bidParamsJson), capCounts: getCappedCampaignsAsString(), + pcids: Object.keys(invibes.pushedCids).join(','), vId: invibes.visitId, width: topWin.innerWidth, @@ -170,16 +168,25 @@ function handleResponse(responseObj, bidRequests) { responseObj = responseObj.videoAdContentResult || responseObj; if (typeof invibes.bidResponse === 'object') { - utils.logInfo('Invibes Adapter - Bid response already received. Invibes only responds to one bid request per user visit'); - return []; + if (responseObj.MultipositionEnabled === true) { + invibes.bidResponse.AdPlacements = invibes.bidResponse.AdPlacements.concat(responseObj.AdPlacements); + } else { + utils.logInfo('Invibes Adapter - Bid response already received. Invibes only responds to one bid request per user visit'); + return []; + } + } else { + invibes.bidResponse = responseObj; } - invibes.bidResponse = responseObj; - const bidResponses = []; for (let i = 0; i < bidRequests.length; i++) { let bidRequest = bidRequests[i]; + if (invibes.placementBids.indexOf(bidRequest.params.placementId) > -1) { + utils.logInfo('Invibes Adapter - Placement was previously bid on ' + bidRequest.params.placementId); + continue; + } + let requestPlacement = null; if (responseObj.AdPlacements != null) { for (let j = 0; j < responseObj.AdPlacements.length; j++) { @@ -196,8 +203,9 @@ function handleResponse(responseObj, bidRequests) { } } - let bid = createBid(bidRequest, requestPlacement); + let bid = createBid(bidRequest, requestPlacement, responseObj.MultipositionEnabled); if (bid !== null) { + invibes.placementBids.push(bidRequest.params.placementId); bidResponses.push(bid); } } @@ -205,7 +213,7 @@ function handleResponse(responseObj, bidRequests) { return bidResponses; } -function createBid(bidRequest, requestPlacement) { +function createBid(bidRequest, requestPlacement, multipositionEnabled) { if (requestPlacement === null || requestPlacement.BidModel === null) { utils.logInfo('Invibes Adapter - Placement not configured for bidding ' + bidRequest.params.placementId); return null; @@ -225,6 +233,30 @@ function createBid(bidRequest, requestPlacement) { let ad = ads[0]; let size = getBiggerSize(bidRequest.sizes); + if (multipositionEnabled === true) { + if (Object.keys(invibes.pushedCids).length > 0) { + if (ad.Blcids != null && ad.Blcids.length > 0) { + let blacklistsPushedCids = Object.keys(invibes.pushedCids).some(function(pushedCid) { + return ad.Blcids.indexOf(parseInt(pushedCid)) > -1; + }); + + if (blacklistsPushedCids) { + utils.logInfo('Invibes Adapter - Ad blacklists pushed ids'); + return null; + } + } + + let isBlacklisted = Object.keys(invibes.pushedCids).some(function(pushedCid) { + return invibes.pushedCids[pushedCid].indexOf(ad.Cid) > -1; + }); + if (isBlacklisted) { + utils.logInfo('Invibes Adapter - Ad is blacklisted'); + return null; + } + } + } + + invibes.pushedCids[ad.Cid] = ad.Blcids || []; const now = Date.now(); utils.logInfo('Bid auction started at ' + bidModel.AuctionStartTime + ' . Invibes registered the bid at ' + now + ' ; bid request took a total of ' + (now - bidModel.AuctionStartTime) + ' ms.'); @@ -660,6 +692,8 @@ export function resetInvibes() { invibes.dom = undefined; invibes.bidResponse = undefined; invibes.domainOptions = undefined; + invibes.placementBids = []; + invibes.pushedCids = {}; } export function stubDomainOptions(persistence) { diff --git a/test/spec/modules/invibesBidAdapter_spec.js b/test/spec/modules/invibesBidAdapter_spec.js index ea3e1d6611b..8b92e0ee81b 100644 --- a/test/spec/modules/invibesBidAdapter_spec.js +++ b/test/spec/modules/invibesBidAdapter_spec.js @@ -8,6 +8,39 @@ describe('invibesBidAdapter:', function () { const SYNC_ENDPOINT = 'https://k.r66net.com/GetUserSync'; let bidRequests = [ + { + bidId: 'b1', + bidder: BIDDER_CODE, + bidderRequestId: 'r1', + params: { + placementId: PLACEMENT_ID + }, + adUnitCode: 'test-div', + auctionId: 'a1', + sizes: [ + [300, 250], + [400, 300], + [125, 125] + ], + transactionId: 't1' + }, { + bidId: 'b2', + bidder: BIDDER_CODE, + bidderRequestId: 'r2', + params: { + placementId: 'abcde' + }, + adUnitCode: 'test-div', + auctionId: 'a2', + sizes: [ + [300, 250], + [400, 300] + ], + transactionId: 't2' + } + ]; + + let bidRequestsWithUserId = [ { bidId: 'b1', bidder: BIDDER_CODE, @@ -104,7 +137,7 @@ describe('invibesBidAdapter:', function () { expect(spec.isBidRequestValid(invalidBid)).to.be.false; }); - it('returns false when bid response was previously received', function () { + it('returns true when bid response was previously received', function () { const validBid = { bidder: BIDDER_CODE, params: { @@ -113,7 +146,7 @@ describe('invibesBidAdapter:', function () { } top.window.invibes.bidResponse = {prop: 'prop'}; - expect(spec.isBidRequestValid(validBid)).to.be.false; + expect(spec.isBidRequestValid(validBid)).to.be.true; }); }); }); @@ -190,11 +223,22 @@ describe('invibesBidAdapter:', function () { expect(JSON.parse(request.data.bidParamsJson).placementIds).to.contain(bidRequests[1].params.placementId); }); + it('sends all Placement Ids and userId', function () { + const request = spec.buildRequests(bidRequestsWithUserId); + expect(JSON.parse(request.data.bidParamsJson).userId).to.exist; + }); + it('sends undefined lid when no cookie', function () { let request = spec.buildRequests(bidRequests); expect(request.data.lId).to.be.undefined; }); + it('sends pushed cids if they exist', function () { + top.window.invibes.pushedCids = { 981: [] }; + let request = spec.buildRequests(bidRequests); + expect(request.data.pcids).to.contain(981); + }); + it('sends lid when comes on cookie', function () { top.window.invibes.optIn = 1; top.window.invibes.purposes = [true, false, false, false, false, false, false, false, false, false]; @@ -738,6 +782,7 @@ describe('invibesBidAdapter:', function () { }]; let multiResponse = { + MultipositionEnabled: true, AdPlacements: [{ Ads: [{ BidPrice: 0.5, @@ -778,6 +823,26 @@ describe('invibesBidAdapter:', function () { } }; + var buildResponse = function(placementId, cid, blcids, creativeId) { + return { + MultipositionEnabled: true, + AdPlacements: [{ + Ads: [{ + BidPrice: 0.5, + VideoExposedId: creativeId, + Cid: cid, + Blcids: blcids + }], + BidModel: { + BidVersion: 1, + PlacementId: placementId, + AuctionStartTime: Date.now(), + CreativeHtml: '' + } + }] + }; + }; + context('when the response is not valid', function () { it('handles response with no bids requested', function () { let emptyResult = spec.interpretResponse({body: response}); @@ -856,6 +921,53 @@ describe('invibesBidAdapter:', function () { expect(result[0].meta.advertiserDomains).to.contain('theadvertiser_2.com'); }); }); + + context('in multiposition context, with conflicting ads', function() { + it('registers the second ad when no conflict', function() { + var firstResponse = buildResponse('12345', 1, [1], 123); + var secondResponse = buildResponse('abcde', 2, [2], 456); + + var firstResult = spec.interpretResponse({body: firstResponse}, {bidRequests}); + var secondResult = spec.interpretResponse({body: secondResponse}, {bidRequests}); + expect(secondResult[0].creativeId).to.equal(456); + }); + + it('registers the second ad when no conflict - empty arrays', function() { + var firstResponse = buildResponse('12345', 1, [], 123); + var secondResponse = buildResponse('abcde', 2, [], 456); + + var firstResult = spec.interpretResponse({body: firstResponse}, {bidRequests}); + var secondResult = spec.interpretResponse({body: secondResponse}, {bidRequests}); + expect(secondResult[0].creativeId).to.equal(456); + }); + + it('doesnt register the second ad when it is blacklisted by the first', function() { + var firstResponse = buildResponse('12345', 1, [2], 123); + var secondResponse = buildResponse('abcde', 2, [], 456); + + var firstResult = spec.interpretResponse({body: firstResponse}, {bidRequests}); + var secondResult = spec.interpretResponse({body: secondResponse}, {bidRequests}); + expect(secondResult).to.be.empty; + }); + + it('doesnt register the second ad when it is blacklisting the first', function() { + var firstResponse = buildResponse('12345', 1, [], 123); + var secondResponse = buildResponse('abcde', 2, [1], 456); + + var firstResult = spec.interpretResponse({body: firstResponse}, {bidRequests}); + var secondResult = spec.interpretResponse({body: secondResponse}, {bidRequests}); + expect(secondResult).to.be.empty; + }); + + it('doesnt register the second ad when it has same ids as the first', function() { + var firstResponse = buildResponse('12345', 1, [1], 123); + var secondResponse = buildResponse('abcde', 1, [1], 456); + + var firstResult = spec.interpretResponse({body: firstResponse}, {bidRequests}); + var secondResult = spec.interpretResponse({body: secondResponse}, {bidRequests}); + expect(secondResult).to.be.empty; + }); + }); }); describe('getUserSyncs', function () { From 7b76219e767566310f671ecbe248573f6bf7a685 Mon Sep 17 00:00:00 2001 From: nllerandi3lift <75995508+nllerandi3lift@users.noreply.github.com> Date: Thu, 23 Sep 2021 09:57:10 -0400 Subject: [PATCH 081/250] Triplelift Bid Adapter: Increase Instream TTL (#7455) * removes duplicate eids from POST call * additional tests * pubcid support * Bump elliptic from 6.5.3 to 6.5.4 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4) Signed-off-by: dependabot[bot] * Revert "Bump elliptic from 6.5.3 to 6.5.4" * increases instream TTL Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dan Goldin Co-authored-by: Dan Goldin --- modules/tripleliftBidAdapter.js | 5 ++++- test/spec/modules/tripleliftBidAdapter_spec.js | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index e8d248eea03..2dc0b069a3c 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -6,6 +6,8 @@ import { config } from '../src/config.js'; const GVLID = 28; const BIDDER_CODE = 'triplelift'; const STR_ENDPOINT = 'https://tlx.3lift.com/header/auction?'; +const BANNER_TIME_TO_LIVE = 300; +const INSTREAM_TIME_TO_LIVE = 3600; let gdprApplies = true; let consentString = null; @@ -311,7 +313,7 @@ function _buildResponseObject(bidderRequest, bid) { creativeId: creativeId, dealId: dealId, currency: 'USD', - ttl: 300, + ttl: BANNER_TIME_TO_LIVE, tl_source: bid.tl_source, meta: {} }; @@ -319,6 +321,7 @@ function _buildResponseObject(bidderRequest, bid) { if (_isInstreamBidRequest(breq)) { bidResponse.vastXml = bid.ad; bidResponse.mediaType = 'video'; + bidResponse.ttl = INSTREAM_TIME_TO_LIVE; }; if (bid.advertiser_name) { diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index 30377ec0a5d..d523976826e 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -809,6 +809,8 @@ describe('triplelift adapter', function () { expect(result).to.have.length(2); expect(Object.keys(result[0])).to.have.members(Object.keys(expectedResponse[0])); expect(Object.keys(result[1])).to.have.members(Object.keys(expectedResponse[1])); + expect(result[0].ttl).to.equal(300); + expect(result[1].ttl).to.equal(3600); }); it('should return multiple responses to support SRA', function () { From 5b07374c7e6aa38b64fee22716a44f82f5dca7b6 Mon Sep 17 00:00:00 2001 From: TheMediaGrid <44166371+TheMediaGrid@users.noreply.github.com> Date: Thu, 23 Sep 2021 18:10:58 +0300 Subject: [PATCH 082/250] TheMediaGridNM: use /hbjson endpoint (#7430) * Added TheMediaGridNM Bid Adapter * Updated required params for TheMediaGridNM Bid Adapter * Update TheMediGridNM Bid Adapter * Fix tests for TheMediaGridNM Bid Adapter * Fixes after review for TheMediaGridNM Bid Adapter * Add support of multi-format in TheMediaGrid Bid Adapter * Update sync url for grid and gridNM Bid Adapters * TheMediaGrid Bid Adapter: added keywords adUnit parameter * Update TheMediaGrid Bid Adapter to support keywords from config * Implement new request format for TheMediaGrid Bid Adapter * Fix jwpseg params for TheMediaGrid Bid Adapter * Update unit tests for The Media Grid Bid Adapter * Fix typo in TheMediaGrid Bid Adapter * Added test for jwTargeting in TheMediaGrid Bid Adapter * The new request format was made by default in TheMediaGrid Bid Adapter * Update userId format in ad request for TheMediaGrid Bid Adapter * Added bidFloor parameter for TheMediaGrid Bid Adapter * Fix for review TheMediaGrid Bid Adapter * Support floorModule in TheMediaGrid Bid Adapter * Fix empty bidfloor for TheMediaGrid Bid Adapter * Some change to restart autotests * Fix userIds format for TheMediaGrid Bid Adapter * Remove digitrust userId from TheMediaGrid Bid Adapter * Protocols was added in video section in ad request for TheMediaGrid Bid Adapter * TheMediaGrid: fix trouble with alias using * TheMediaGridNM: fix trouble with alias * TheMediaGrid Bid Adapter: added support of PBAdSlot module * TheMediaGrid Bid Adapter: fix typo * GridNM Bid Adapter: use absent in params data from mediaTypes * GridNM Bid Adapter: fix md file + add advertiserDomains support * TheMediaGrid and gridNM Bid Adapter: minor netRevenue fixes * gridNM Bid Adapter updates after review * TheMediaGrid Bid Adapter: fix keywords workflow * fix testing and kick off lgtm again * TheMediaGrid: added ext.bidder.grid.demandSource processing * TheMediaGrid: added user.id from fpd cookie * TheMediaGrid: control cookie setting via bidder config * TheMediaGrid: use localStorage instead cookie * TheMediaGridNM Bid Adapter: update adapter to use /hbjson endpoint * TheMediaGridNM: fix unnecessary conditions Co-authored-by: Chris Huie --- modules/gridNMBidAdapter.js | 240 +++++++++++++++++---- test/spec/modules/gridNMBidAdapter_spec.js | 127 +++++++---- 2 files changed, 276 insertions(+), 91 deletions(-) diff --git a/modules/gridNMBidAdapter.js b/modules/gridNMBidAdapter.js index 4ab8464b115..66a244e1607 100644 --- a/modules/gridNMBidAdapter.js +++ b/modules/gridNMBidAdapter.js @@ -1,10 +1,11 @@ import * as utils from '../src/utils.js'; -import {registerBidder} from '../src/adapters/bidderFactory.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; import { Renderer } from '../src/Renderer.js'; import { VIDEO } from '../src/mediaTypes.js'; +import { config } from '../src/config.js'; const BIDDER_CODE = 'gridNM'; -const ENDPOINT_URL = 'https://grid.bidswitch.net/hbnm'; +const ENDPOINT_URL = 'https://grid.bidswitch.net/hbjson'; const SYNC_URL = 'https://x.bidswitch.net/sync?ssp=themediagrid'; const TIME_TO_LIVE = 360; const RENDERER_URL = 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js'; @@ -64,62 +65,146 @@ export const spec = { buildRequests: function(validBidRequests, bidderRequest) { const bids = validBidRequests || []; const requests = []; + let { bidderRequestId, auctionId, gdprConsent, uspConsent, timeout, refererInfo } = bidderRequest || {}; + + const referer = refererInfo ? encodeURIComponent(refererInfo.referer) : ''; bids.forEach(bid => { - const { params, bidderRequestId, sizes } = bid; - const payload = { - sizes: utils.parseSizesInput(sizes).join(','), - r: bidderRequestId, - wrapperType: 'Prebid_js', - wrapperVersion: '$prebid.version$' - }; + let user; + let userExt; - if (bidderRequest) { - if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) { - payload.u = bidderRequest.refererInfo.referer; - } - if (bidderRequest.timeout) { - payload.wtimeout = bidderRequest.timeout; - } - if (bidderRequest.gdprConsent) { - if (bidderRequest.gdprConsent.consentString) { - payload.gdpr_consent = bidderRequest.gdprConsent.consentString; - } - payload.gdpr_applies = - (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') - ? Number(bidderRequest.gdprConsent.gdprApplies) : 1; + const schain = bid.schain; + const userIdAsEids = bid.userIdAsEids; + + if (!bidderRequestId) { + bidderRequestId = bid.bidderRequestId; + } + if (!auctionId) { + auctionId = bid.auctionId; + } + const { + params: { floorcpm, pubdata, source, secid, pubid, content, video }, + mediaTypes, bidId, adUnitCode, rtd, ortb2Imp, sizes + } = bid; + + const bidFloor = _getFloor(mediaTypes || {}, bid, utils.isNumber(floorcpm) && floorcpm); + const jwTargeting = rtd && rtd.jwplayer && rtd.jwplayer.targeting; + const jwpseg = (pubdata && pubdata.jwpseg) || (jwTargeting && jwTargeting.segments); + + const siteContent = content || (jwTargeting && jwTargeting.content); + + const impObj = { + id: bidId.toString(), + tagid: secid.toString(), + video: createVideoForImp(video, sizes, mediaTypes && mediaTypes.video), + ext: { + divid: adUnitCode.toString() } - if (bidderRequest.uspConsent) { - payload.us_privacy = bidderRequest.uspConsent; + }; + + if (ortb2Imp && ortb2Imp.ext && ortb2Imp.ext.data) { + impObj.ext.data = ortb2Imp.ext.data; + if (impObj.ext.data.adserver && impObj.ext.data.adserver.adslot) { + impObj.ext.gpid = impObj.ext.data.adserver.adslot.toString(); + } else { + impObj.ext.gpid = ortb2Imp.ext.data.pbadslot && ortb2Imp.ext.data.pbadslot.toString(); } } - const video = utils.deepAccess(bid, 'mediaTypes.video') || {}; - const paramsVideo = Object.assign({}, params.video); - VIDEO_KEYS.forEach((key) => { - if (!(key in paramsVideo) && key in video) { - paramsVideo[key] = video[key]; + if (bidFloor) { + impObj.bidfloor = bidFloor; + } + + const imp = [impObj]; + + const reqSource = { + tid: auctionId && auctionId.toString(), + ext: { + wrapper: 'Prebid_js', + wrapper_version: '$prebid.version$' } - }); + }; + + if (schain) { + reqSource.ext.schain = schain; + } + + const bidderTimeout = config.getConfig('bidderTimeout') || timeout; + const tmax = timeout ? Math.min(bidderTimeout, timeout) : bidderTimeout; + + const request = { + id: bidderRequestId && bidderRequestId.toString(), + site: { + page: referer, + publisher: { + id: pubid, + }, + }, + source: reqSource, + tmax, + imp, + }; + + if (siteContent) { + request.site.content = siteContent; + } + + if (jwpseg && jwpseg.length) { + user = { + data: [{ + name: 'iow_labs_pub_data', + segment: jwpseg.map((seg) => { + return {name: 'jwpseg', value: seg}; + }) + }] + }; + } + + if (gdprConsent && gdprConsent.consentString) { + userExt = { consent: gdprConsent.consentString }; + } + + if (userIdAsEids && userIdAsEids.length) { + userExt = userExt || {}; + userExt.eids = [...userIdAsEids]; + } + + if (userExt && Object.keys(userExt).length) { + user = user || {}; + user.ext = userExt; + } - if (!paramsVideo.size && video.playerSize && video.playerSize.length === 2) { - paramsVideo.size = video.playerSize.join('x'); + if (user) { + request.user = user; } - if (!('mind' in paramsVideo) && 'minduration' in video) { - paramsVideo.mind = video.minduration; + if (gdprConsent && gdprConsent.gdprApplies) { + request.regs = { + ext: { + gdpr: gdprConsent.gdprApplies ? 1 : 0 + } + } } - if (!('maxd' in paramsVideo) && 'maxduration' in video) { - paramsVideo.maxd = video.maxduration; + + if (uspConsent) { + if (!request.regs) { + request.regs = { ext: {} }; + } + request.regs.ext.us_privacy = uspConsent; } - const paramsToSend = Object.assign({}, params, {video: paramsVideo}); + if (config.getConfig('coppa') === true) { + if (!request.regs) { + request.regs = {}; + } + request.regs.coppa = 1; + } requests.push({ method: 'POST', - url: ENDPOINT_URL + '?' + utils.parseQueryStringParameters(payload).replace(/\&$/, ''), + url: ENDPOINT_URL + '?no_mapping=1&sp=' + source, bid: bid, - data: paramsToSend // content + data: request }); }); @@ -151,11 +236,6 @@ export const spec = { else if (serverBid.content_type !== 'video') errorMessage = LOG_ERROR_MESS.wrongContentType + serverBid.content_type; if (!errorMessage) { const bid = bidRequest.bid; - if (!serverBid.w || !serverBid.h) { - const size = utils.parseSizesInput(bid.sizes)[0].split('x'); - serverBid.w = size[0]; - serverBid.h = size[1]; - } const bidResponse = { requestId: bid.bidId, cpm: serverBid.price, @@ -176,6 +256,10 @@ export const spec = { } }; + if (serverBid.nurl) { + bidResponse.vastUrl = serverBid.nurl; + } + if (!bid.renderer && (!bid.mediaTypes || !bid.mediaTypes.video || bid.mediaTypes.video.context === 'outstream')) { bidResponse.renderer = createRenderer(bidResponse, { id: bid.bidId, @@ -213,6 +297,33 @@ export const spec = { } }; +/** + * Gets bidfloor + * @param {Object} mediaTypes + * @param {Object} bid + * @param {Number} floor + * @returns {Number} floor + */ +function _getFloor (mediaTypes, bid, floor) { + const curMediaType = mediaTypes.video ? 'video' : 'banner'; + + if (typeof bid.getFloor === 'function') { + const floorInfo = bid.getFloor({ + currency: 'USD', + mediaType: curMediaType, + size: bid.sizes.map(([w, h]) => ({w, h})) + }); + + if (typeof floorInfo === 'object' && + floorInfo.currency === 'USD' && + !isNaN(parseFloat(floorInfo.floor))) { + floor = Math.max(floor, parseFloat(floorInfo.floor)); + } + } + + return floor; +} + function _getBidFromResponse(respItem) { if (!respItem) { utils.logError(LOG_ERROR_MESS.emptySeatbid); @@ -249,6 +360,45 @@ function createRenderer (bid, rendererParams) { return renderer; } +function createVideoForImp({ mind, maxd, size, ...paramsVideo }, bidSizes, bidVideo = {}) { + VIDEO_KEYS.forEach((key) => { + if (!(key in paramsVideo) && key in bidVideo) { + paramsVideo[key] = bidVideo[key]; + } + }); + + if (size && utils.isStr(size)) { + const sizeArray = size.split('x'); + if (sizeArray.length === 2 && parseInt(sizeArray[0]) && parseInt(sizeArray[1])) { + paramsVideo.w = parseInt(sizeArray[0]); + paramsVideo.h = parseInt(sizeArray[1]); + } + } + + if (!paramsVideo.w || !paramsVideo.h) { + const playerSizes = bidVideo.playerSize && bidVideo.playerSize.length === 2 ? bidVideo.playerSize : bidSizes; + if (playerSizes) { + const playerSize = playerSizes[0]; + if (playerSize) { + Object.assign(paramsVideo, utils.parseGPTSingleSizeArrayToRtbSize(playerSize)); + } + } + } + + const durationRangeSec = bidVideo.durationRangeSec || []; + const minDur = mind || durationRangeSec[0] || bidVideo.minduration; + const maxDur = maxd || durationRangeSec[1] || bidVideo.maxduration; + + if (minDur) { + paramsVideo.minduration = minDur; + } + if (maxDur) { + paramsVideo.maxduration = maxDur; + } + + return paramsVideo; +} + export function resetUserSync() { hasSynced = false; } diff --git a/test/spec/modules/gridNMBidAdapter_spec.js b/test/spec/modules/gridNMBidAdapter_spec.js index 6d3a607c0c5..baff5862fca 100644 --- a/test/spec/modules/gridNMBidAdapter_spec.js +++ b/test/spec/modules/gridNMBidAdapter_spec.js @@ -180,13 +180,19 @@ describe('TheMediaGridNM Adapter', function () { }); return res; } - const bidderRequest = {refererInfo: {referer: 'https://example.com'}}; - const referrer = bidderRequest.refererInfo.referer; + const bidderRequest = { + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + timeout: 3000, + refererInfo: { referer: 'https://example.com' } + }; + const referrer = encodeURIComponent(bidderRequest.refererInfo.referer); let bidRequests = [ { 'bidder': 'gridNM', 'params': { 'source': 'jwp', + 'floorcpm': 2, 'secid': '11', 'pubid': '22', 'video': { @@ -226,12 +232,36 @@ describe('TheMediaGridNM Adapter', function () { requests.forEach((req, i) => { expect(req.url).to.be.an('string'); const payload = parseRequestUrl(req.url); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('wrapperType', 'Prebid_js'); - expect(payload).to.have.property('wrapperVersion', '$prebid.version$'); - expect(payload).to.have.property('sizes', requestsSizes[i]); - expect(req.data).to.deep.equal(bidRequests[i].params); + expect(payload).to.have.property('no_mapping', '1'); + expect(payload).to.have.property('sp', 'jwp'); + + const sizes = { w: bidRequests[i].sizes[0][0], h: bidRequests[i].sizes[0][1] }; + const impObj = { + 'id': bidRequests[i].bidId, + 'tagid': bidRequests[i].params.secid, + 'ext': {'divid': bidRequests[i].adUnitCode}, + 'video': Object.assign(sizes, bidRequests[i].params.video) + }; + + if (bidRequests[i].params.floorcpm) { + impObj.bidfloor = bidRequests[i].params.floorcpm; + } + + expect(req.data).to.deep.equal({ + 'id': bidderRequest.bidderRequestId, + 'site': { + 'page': referrer, + 'publisher': { + 'id': bidRequests[i].params.pubid + } + }, + 'tmax': bidderRequest.timeout, + 'source': { + 'tid': bidderRequest.auctionId, + 'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'} + }, + 'imp': [impObj] + }); }); }); @@ -242,63 +272,68 @@ describe('TheMediaGridNM Adapter', function () { minduration: 10, maxduration: 100, protocols: [1, 3, 4], - playerSize: [300, 250] + playerSize: [[300, 250]] } }; const bidRequest = Object.assign({ mediaTypes }, bidRequests[0]); const req = spec.buildRequests([bidRequest], bidderRequest)[0]; const expectedVideo = { 'skipafter': 10, - 'mind': 10, - 'maxd': 100, + 'minduration': 10, + 'maxduration': 100, 'mimes': ['video/mp4', 'video/x-ms-wmv'], 'protocols': [1, 2, 3, 4, 5, 6], - 'size': '300x250' + 'w': 300, + 'h': 250 }; - const expectedParams = Object.assign({}, bidRequest.params); - expectedParams.video = Object.assign(expectedParams.video, expectedVideo); expect(req.url).to.be.an('string'); const payload = parseRequestUrl(req.url); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('r', '22edbae2733bf6'); - expect(payload).to.have.property('wrapperType', 'Prebid_js'); - expect(payload).to.have.property('wrapperVersion', '$prebid.version$'); - expect(payload).to.have.property('sizes', '300x250,300x600'); - expect(req.data).to.deep.equal(expectedParams); + expect(payload).to.have.property('no_mapping', '1'); + expect(payload).to.have.property('sp', 'jwp'); + expect(req.data).to.deep.equal({ + 'id': bidderRequest.bidderRequestId, + 'site': { + 'page': referrer, + 'publisher': { + 'id': bidRequest.params.pubid + } + }, + 'tmax': bidderRequest.timeout, + 'source': { + 'tid': bidderRequest.auctionId, + 'ext': {'wrapper': 'Prebid_js', 'wrapper_version': '$prebid.version$'} + }, + 'imp': [{ + 'id': bidRequest.bidId, + 'bidfloor': bidRequest.params.floorcpm, + 'tagid': bidRequest.params.secid, + 'ext': {'divid': bidRequest.adUnitCode}, + 'video': expectedVideo + }] + }); }); it('if gdprConsent is present payload must have gdpr params', function () { - const [request] = spec.buildRequests([bidRequests[0]], {gdprConsent: {consentString: 'AAA', gdprApplies: true}, refererInfo: bidderRequest.refererInfo}); - expect(request.url).to.be.an('string'); - const payload = parseRequestUrl(request.url); - expect(payload).to.have.property('u', referrer); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', '1'); - }); - - it('if gdprApplies is false gdpr_applies must be 0', function () { - const [request] = spec.buildRequests([bidRequests[0]], {gdprConsent: {consentString: 'AAA', gdprApplies: false}}); - expect(request.url).to.be.an('string'); - const payload = parseRequestUrl(request.url); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', '0'); - }); - - it('if gdprApplies is undefined gdpr_applies must be 1', function () { - const [request] = spec.buildRequests([bidRequests[0]], {gdprConsent: {consentString: 'AAA'}}); - expect(request.url).to.be.an('string'); - const payload = parseRequestUrl(request.url); - expect(payload).to.have.property('gdpr_consent', 'AAA'); - expect(payload).to.have.property('gdpr_applies', '1'); + const gdprBidderRequest = Object.assign({gdprConsent: {consentString: 'AAA', gdprApplies: true}}, bidderRequest); + const request = spec.buildRequests([bidRequests[0]], gdprBidderRequest)[0]; + const payload = request.data; + expect(request).to.have.property('data'); + expect(payload).to.have.property('user'); + expect(payload.user).to.have.property('ext'); + expect(payload.user.ext).to.have.property('consent', 'AAA'); + expect(payload).to.have.property('regs'); + expect(payload.regs).to.have.property('ext'); + expect(payload.regs.ext).to.have.property('gdpr', 1); }); it('if usPrivacy is present payload must have us_privacy param', function () { const bidderRequestWithUSP = Object.assign({uspConsent: '1YNN'}, bidderRequest); - const [request] = spec.buildRequests([bidRequests[0]], bidderRequestWithUSP); - expect(request.url).to.be.an('string'); - const payload = parseRequestUrl(request.url); - expect(payload).to.have.property('us_privacy', '1YNN'); + const request = spec.buildRequests([bidRequests[0]], bidderRequestWithUSP)[0]; + const payload = request.data; + expect(payload).to.have.property('regs'); + expect(payload.regs).to.have.property('ext'); + expect(payload.regs.ext).to.have.property('us_privacy', '1YNN'); }); }); From a5482376282b2376b7eb1074a87de8039bc27e42 Mon Sep 17 00:00:00 2001 From: Michael Burns Date: Thu, 23 Sep 2021 11:12:37 -0400 Subject: [PATCH 083/250] Fix inf loop (#7460) --- modules/ixBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 8f821e87911..4ff84e7c104 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -638,7 +638,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { let currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length; - while (currentImpressionSize > remainingRequestSize) { + while (impressionObjects.length && currentImpressionSize > remainingRequestSize) { wasAdUnitImpressionsTrimmed = true; impressionObjects.pop(); currentImpressionSize = encodeURIComponent(JSON.stringify({ impressionObjects })).length; From 6ab27bd09cf8a873c26498ec6b46282178edab1f Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Thu, 23 Sep 2021 17:30:49 +0200 Subject: [PATCH 084/250] update .submodules.json to include weborama rtd (#7461) update .submodules.json to include weborama rtd submodule --- modules/.submodules.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/.submodules.json b/modules/.submodules.json index 3a3b94ea469..87b05dca33d 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -51,7 +51,8 @@ "permutiveRtdProvider", "reconciliationRtdProvider", "sirdataRtdProvider", - "timeoutRtdProvider" + "timeoutRtdProvider", + "weboramaRtdProvider" ], "fpdModule": [ "enrichmentFpdModule", From b2577b7afca04a06d9b8e4d3e83fb0aa602e5ef1 Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Thu, 23 Sep 2021 20:40:44 +0300 Subject: [PATCH 085/250] Inskin Bid Adapter: override schain with publisher id (#7444) * Set publisher ID as schain id * Updated Inskin markdown file --- modules/inskinBidAdapter.js | 12 ++++++++++++ modules/inskinBidAdapter.md | 9 +++++---- test/spec/modules/inskinBidAdapter_spec.js | 11 ++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/modules/inskinBidAdapter.js b/modules/inskinBidAdapter.js index 5173f1dca63..8f2e35a41e0 100644 --- a/modules/inskinBidAdapter.js +++ b/modules/inskinBidAdapter.js @@ -55,6 +55,18 @@ export const spec = { parallel: true }, validBidRequests[0].params); + if (data.publisherId) { + data.rtb = { + schain: { + ext: { + sid: String(data.publisherId) + } + } + }; + + delete data.publisherId; + } + data.keywords = data.keywords || []; const restrictions = []; diff --git a/modules/inskinBidAdapter.md b/modules/inskinBidAdapter.md index 2284124dc98..2cb19f9a0e0 100644 --- a/modules/inskinBidAdapter.md +++ b/modules/inskinBidAdapter.md @@ -1,14 +1,14 @@ # Overview -Module Name: InSkin Bid Adapter +Module Name: Inskin Bid Adapter Module Type: Bid Adapter -Maintainer: jgrimes@adzerk.com +Maintainer: tech@inskinmedia.com # Description -Connects to InSkin Media for receiving bids from configured demand sources. +Connects to Inskin Media for receiving bids from configured demand sources. # Test Parameters ```javascript @@ -21,7 +21,8 @@ Connects to InSkin Media for receiving bids from configured demand sources. bidder: 'inskin', params: { networkId: '9874', - siteId: '983808' + siteId: '983808', + publisherId: '123456' } } ] diff --git a/test/spec/modules/inskinBidAdapter_spec.js b/test/spec/modules/inskinBidAdapter_spec.js index 151cbce7692..3d0ec82fca5 100644 --- a/test/spec/modules/inskinBidAdapter_spec.js +++ b/test/spec/modules/inskinBidAdapter_spec.js @@ -12,7 +12,8 @@ const REQUEST = { 'bidder': 'inskin', 'params': { 'networkId': 9874, - 'siteId': 730181 + 'siteId': 730181, + 'publisherId': 123456 }, 'placementCode': 'div-gpt-ad-1487778092495-0', 'sizes': [ @@ -374,4 +375,12 @@ describe('InSkin BidAdapter', function () { expect(opts.length).to.equal(3); }); }); + describe('supply chain id', function () { + it('should use publisherId as sid', function () { + const request = spec.buildRequests(REQUEST.bidRequest, bidderRequest); + const payload = JSON.parse(request.data); + + expect(payload.rtb.schain.ext.sid).to.equal('123456'); + }); + }); }); From 795f3a16e50275f25474d0a68d837bc136cee39f Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Thu, 23 Sep 2021 14:07:57 -0400 Subject: [PATCH 086/250] Prebid 5.15.0 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6a861f60d4..3c719773479 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.15.0-pre", + "version": "5.15.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From f607450696f22ddce07b6a8bd28bf97e806bbfcf Mon Sep 17 00:00:00 2001 From: Jason Snellbaker Date: Thu, 23 Sep 2021 14:25:37 -0400 Subject: [PATCH 087/250] increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c719773479..e254410e5fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.15.0", + "version": "5.16.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From a0d085ea51b945fe3099daf9e015ee31f4ffb1bf Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 23 Sep 2021 14:13:03 -0700 Subject: [PATCH 088/250] PublinkId - validate hash and fix decode (#7439) --- modules/conversantBidAdapter.js | 1 + modules/publinkIdSystem.js | 17 +++++++++++--- test/spec/modules/publinkIdSystem_spec.js | 27 ++++++++++++++++------- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/modules/conversantBidAdapter.js b/modules/conversantBidAdapter.js index a1ca094273b..5e05499a18e 100644 --- a/modules/conversantBidAdapter.js +++ b/modules/conversantBidAdapter.js @@ -373,6 +373,7 @@ function collectEids(bidRequests) { if (utils.isArray(request.userIdAsEids) && request.userIdAsEids.length > 0) { // later following white-list can be converted to block-list if needed const requiredSourceValues = { + 'epsilon.com': 1, 'adserver.org': 1, 'liveramp.com': 1, 'criteo.com': 1, diff --git a/modules/publinkIdSystem.js b/modules/publinkIdSystem.js index 5e549732097..ca6ca9cf8d8 100644 --- a/modules/publinkIdSystem.js +++ b/modules/publinkIdSystem.js @@ -18,6 +18,10 @@ const PUBLINK_S2S_COOKIE = '_publink_srv'; export const storage = getStorageManager(GVLID); +function isHex(s) { + return (typeof s === 'string' && /^[A-F0-9]+$/i.test(s)); +} + function publinkIdUrl(params, consentData) { let url = utils.parseUrl('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink'); url.search = { @@ -49,8 +53,13 @@ function makeCallback(config = {}, consentData) { } } }; + if (config.params && config.params.e) { - ajax(publinkIdUrl(config.params, consentData), handleResponse, undefined, options); + if (isHex(config.params.e)) { + ajax(publinkIdUrl(config.params, consentData), handleResponse, undefined, options); + } else { + utils.logError('params.e must be a hex string'); + } } }; } @@ -96,11 +105,11 @@ export const publinkIdSubmodule = { /** * decode the stored id value for passing to bid requests * @function - * @param {string} id encrypted userid + * @param {string} publinkId encrypted userid * @returns {{publinkId: string} | undefined} */ decode(publinkId) { - return {publink: publinkId}; + return {publinkId: publinkId}; }, /** @@ -108,6 +117,8 @@ export const publinkIdSubmodule = { * Use a publink cookie first if it is present, otherwise use prebids copy, if neither are available callout to get a new id * @function * @param {SubmoduleConfig} [config] Config object with params and storage properties + * @param {ConsentData|undefined} consentData GDPR consent + * @param {(Object|undefined)} storedId Previously cached id * @returns {IdResponse} */ getId: function(config, consentData, storedId) { diff --git a/test/spec/modules/publinkIdSystem_spec.js b/test/spec/modules/publinkIdSystem_spec.js index 2999fda5aa0..0680e02e3fa 100644 --- a/test/spec/modules/publinkIdSystem_spec.js +++ b/test/spec/modules/publinkIdSystem_spec.js @@ -10,7 +10,7 @@ describe('PublinkIdSystem', () => { describe('decode', () => { it('decode', () => { const result = publinkIdSubmodule.decode(TEST_COOKIE_VALUE); - expect(result).deep.equals({publink: TEST_COOKIE_VALUE}); + expect(result).deep.equals({publinkId: TEST_COOKIE_VALUE}); }); }); @@ -69,6 +69,7 @@ describe('PublinkIdSystem', () => { expect(result).to.exist; expect(result.callback).to.be.a('function'); }); + it('Use local copy', () => { const result = publinkIdSubmodule.getId({}, undefined, TEST_COOKIE_VALUE); expect(result).to.be.undefined; @@ -82,14 +83,14 @@ describe('PublinkIdSystem', () => { }); it('Fetch with consent data', () => { - const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7'}}; const consentData = {gdprApplies: 1, consentString: 'myconsentstring'}; let submoduleCallback = publinkIdSubmodule.getId(config, consentData).callback; submoduleCallback(callbackSpy); let request = server.requests[0]; request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&gdpr=1&gdpr_consent=myconsentstring'); + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$&gdpr=1&gdpr_consent=myconsentstring'); request.respond(200, {}, JSON.stringify(serverResponse)); expect(callbackSpy.calledOnce).to.be.true; @@ -97,16 +98,26 @@ describe('PublinkIdSystem', () => { }); it('server doesnt respond', () => { - const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7'}}; let submoduleCallback = publinkIdSubmodule.getId(config).callback; submoduleCallback(callbackSpy); let request = server.requests[0]; request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$'); + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$'); request.respond(204, {}, JSON.stringify(serverResponse)); - expect(callbackSpy.calledOnce).to.be.false; + expect(callbackSpy.called).to.be.false; + }); + + it('reject plain email address', () => { + const config = {storage: {type: 'cookie'}, params: {e: 'tester@test.com'}}; + const consentData = {gdprApplies: 1, consentString: 'myconsentstring'}; + let submoduleCallback = publinkIdSubmodule.getId(config, consentData).callback; + submoduleCallback(callbackSpy); + + expect(server.requests).to.have.lengthOf(0); + expect(callbackSpy.called).to.be.false; }); }); @@ -122,13 +133,13 @@ describe('PublinkIdSystem', () => { }); it('Fetch with usprivacy data', () => { - const config = {storage: {type: 'cookie'}, params: {e: 'hashedemailvalue'}}; + const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7'}}; let submoduleCallback = publinkIdSubmodule.getId(config).callback; submoduleCallback(callbackSpy); let request = server.requests[0]; request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=hashedemailvalue&mpn=Prebid.js&mpv=$prebid.version$&us_privacy=1YNN'); + expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$&us_privacy=1YNN'); request.respond(200, {}, JSON.stringify(serverResponse)); expect(callbackSpy.calledOnce).to.be.true; From 8eb0f77c194a8a1ae3b00133d1a6617a35adc8f2 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Fri, 24 Sep 2021 16:55:36 +0330 Subject: [PATCH 089/250] Vidoomy Bid Adapter: bugfix for cookie sync with pixel fires (#7407) * fix: vidoomy adapter, cookie sync with pixel fires * fix: revert package-lock.json * fix: switch to xhr * fix: remove index.html Co-authored-by: Sasan Farrokh --- modules/vidoomyBidAdapter.js | 101 ++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 13 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index b579de8618b..78c19a38b6a 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -8,6 +8,9 @@ import { INSTREAM, OUTSTREAM } from '../src/video.js'; const ENDPOINT = `https://d.vidoomy.com/api/rtbserver/prebid/`; const BIDDER_CODE = 'vidoomy'; const GVLID = 380; + +const COOKIE_SYNC_JSON = 'https://vpaid.vidoomy.com/sync/urls.json'; + const isBidRequestValid = bid => { if (!bid.params) { utils.logError(BIDDER_CODE + ': bid.params should be non-empty'); @@ -58,17 +61,9 @@ const buildRequests = (validBidRequests, bidderRequest) => { adType = VIDEO; } - let host = ''; - try { - host = bidderRequest.refererInfo.referer.split('#')[0].replace(/^(https\:\/\/|http\:\/\/)|(\/)$/g, '').split('/')[0]; - } catch (eBidRequest) { - try { - host = window.location.href.replace(/^(https\:\/\/|http\:\/\/)|(\/)$/g, '').split('/')[0]; - } catch (eLocationHref) { - host = window.location.href; - } - } - const hostname = host.split(':')[0]; + const aElement = document.createElement('a'); + aElement.href = (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) || top.location.href; + const hostname = aElement.hostname const videoContext = utils.deepAccess(bid, 'mediaTypes.video.context'); @@ -83,8 +78,8 @@ const buildRequests = (validBidRequests, bidderRequest) => { queryParams.push(['dt', /Mobi/.test(navigator.userAgent) ? 2 : 1]); queryParams.push(['pid', bid.params.pid]); queryParams.push(['requestId', bid.bidId]); - queryParams.push(['d', hostname]); - queryParams.push(['sp', encodeURIComponent(bidderRequest.refererInfo.referer)]); + queryParams.push(['d', getDomainWithoutSubdomain(hostname)]); + queryParams.push(['sp', encodeURIComponent(aElement.href)]); if (bidderRequest.gdprConsent) { queryParams.push(['gdpr', bidderRequest.gdprConsent.gdprApplies]); queryParams.push(['gdprcs', bidderRequest.gdprConsent.consentString]); @@ -94,6 +89,19 @@ const buildRequests = (validBidRequests, bidderRequest) => { const rawQueryParams = queryParams.map(qp => qp.join('=')).join('&'); + const xhr = new XMLHttpRequest(); + xhr.open('GET', COOKIE_SYNC_JSON) + xhr.addEventListener('load', function () { + const macro = Macro({ + gpdr: bidderRequest.gdprConsent.gdprApplies, + gpdr_consent: bidderRequest.gdprConsent.consentString + }); + JSON.parse(this.responseText).filter(Boolean).forEach(url => { + firePixel(macro.replace(url)) + }) + }) + xhr.send() + const url = `${ENDPOINT}?${rawQueryParams}`; return { method: 'GET', @@ -198,3 +206,70 @@ export const spec = { }; registerBidder(spec); + +function firePixel(url) { + const img = document.createElement('img'); + img.width = 1; + img.height = 1; + img.src = url; + document.body.appendChild(img); + setTimeout(() => { + img.remove(); + }, 10000) +} + +function normalizeKey (x) { + return x.replace(/_/g, '').toLowerCase(); +} + +function Macro (obj) { + const macros = {}; + for (const key in obj) { + macros[normalizeKey(key)] = obj[key]; + } + + const set = (key, value) => { + macros[normalizeKey(key)] = typeof value === 'function' ? value : String(value); + }; + + return { + set, + setAll (obj) { + for (const key in obj) { + macros[normalizeKey(key)] = set(obj[key]); + } + }, + replace (string, extraMacros = {}) { + const allMacros = { + ...macros, + ...extraMacros, + }; + const regexes = [ + /{{\s*([a-zA-Z0-9_]+)\s*}}/g, + /\$\$\s*([a-zA-Z0-9_]+)\s*\$\$/g, + /\[\s*([a-zA-Z0-9_]+)\s*\]/g, + ]; + regexes.forEach(regex => { + string = string.replace(regex, (str, x) => { + x = normalizeKey(x); + let value = allMacros[x]; + value = typeof value === 'function' ? value(allMacros) : value; + return !value && value !== 0 ? '' : value; + }); + }); + return string; + }, + }; +} + +function getDomainWithoutSubdomain (hostname) { + const parts = hostname.split('.'); + const newParts = []; + for (let i = parts.length - 1; i >= 0; i--) { + newParts.push(parts[i]); + if (newParts.length !== 1 && parts[i].length > 3) { + break; + } + } + return newParts.reverse().join('.'); +} From d02fee2e3f4938542cafd71093a3c78d8e93984a Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Fri, 24 Sep 2021 16:38:56 +0300 Subject: [PATCH 090/250] Colossus Adapter: add pbAdSlot support (#7464) * add video&native traffic colossus ssp * Native obj validation * Native obj validation #2 * Added size field in requests * fixed test * fix merge conflicts * move to 3.0 * move to 3.0 * fix IE11 new URL issue * fix IE11 new URL issue * fix IE11 new URL issue * https for 3.0 * add https test * add ccp and schain features * fix test * sync with upstream, fix conflicts * Update colossussspBidAdapter.js remove commented code * Update colossussspBidAdapter.js lint fix * identity extensions * identity extensions * fix * fix * fix * fix * fix * add tests for user ids * fix * fix * fix * fix * fix * fix * fix * add gdpr support * add gdpr support * id5id support * Update colossussspBidAdapter.js add bidfloor parameter * Update colossussspBidAdapter.js check bidfloor * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter_spec.js * use floor module * Revert "use floor module" This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad. * use floor module * update to 5v * fix * add uid2 and bidFloor support * fix * add pbadslot support Co-authored-by: Vladislav Isaiko Co-authored-by: Aiholkin Co-authored-by: Mykhailo Yaremchuk --- modules/colossussspBidAdapter.js | 4 ++++ .../modules/colossussspBidAdapter_spec.js | 20 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 52865b8085d..b000cefd1b2 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -106,6 +106,10 @@ export const spec = { if (bid.schain) { placement.schain = bid.schain; } + let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'); + if (gpid) { + placement.gpid = gpid; + } if (bid.userId) { getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com'); getUserId(placement.eids, bid.userId.idl_env, 'identityLink'); diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index fa543f28fd1..0fe4d5b358e 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -1,5 +1,5 @@ -import {expect} from 'chai'; -import {spec} from '../../../modules/colossussspBidAdapter.js'; +import { expect } from 'chai'; +import { spec } from '../../../modules/colossussspBidAdapter.js'; describe('ColossussspAdapter', function () { let bid = { @@ -16,6 +16,13 @@ describe('ColossussspAdapter', function () { sizes: [[300, 250]] } }, + ortb2Imp: { + ext: { + data: { + pbadslot: '/19968336/prebid_cache_video_adunit' + } + } + }, transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62', schain: { ver: '1.0', @@ -71,7 +78,7 @@ describe('ColossussspAdapter', function () { it('Returns valid URL', function () { expect(serverRequest.url).to.equal('https://colossusssp.com/?c=o&m=multi'); }); - it('Should contain ccpa', function() { + it('Should contain ccpa', function () { expect(serverRequest.data.ccpa).to.be.an('string') }) @@ -88,13 +95,14 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor'); + expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor', 'gpid'); expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); expect(placement.sizes).to.be.an('array'); expect(placement.floor).to.be.an('object'); + expect(placement.gpid).to.be.an('string'); } }); it('Returns empty data if no valid requests are passed', function () { @@ -135,7 +143,7 @@ describe('ColossussspAdapter', function () { describe('interpretResponse', function () { let resObject = { - body: [ { + body: [{ requestId: '123', mediaType: 'banner', cpm: 0.3, @@ -150,7 +158,7 @@ describe('ColossussspAdapter', function () { advertiserDomains: ['google.com'], advertiserId: 1234 } - } ] + }] }; let serverResponses = spec.interpretResponse(resObject); it('Returns an array of valid server responses if response object is valid', function () { From 23aa14e6f7d0833cefcf1c15f36f2e81ed016c55 Mon Sep 17 00:00:00 2001 From: bretg Date: Fri, 24 Sep 2021 15:31:19 -0400 Subject: [PATCH 091/250] updating user ID module list (#7475) --- modules/.submodules.json | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/modules/.submodules.json b/modules/.submodules.json index 87b05dca33d..3ac1e1ef59f 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -1,39 +1,40 @@ { "userId": [ - "unifiedIdSystem", - "pubCommonIdSystem", - "id5IdSystem", - "parrableIdSystem", + "admixerIdSystem", + "adtelligentIdSystem", + "akamaiDAPIdSystem", + "amxIdSystem", "britepoolIdSystem", - "liveIntentIdSystem", - "lotamePanoramaId", - "merkleIdSystem", "criteoIdSystem", - "netIdSystem", + "deepintentDpesIdSystem", + "dmdIdSystem", + "fabrickIdSystem", + "flocIdSystem", + "haloIdSystem", + "id5IdSystem", "identityLinkIdSystem", - "sharedIdSystem", + "idxIdSystem", + "imuIdSystem", "intentIqIdSystem", - "zeotapIdPlusIdSystem", - "haloIdSystem", - "quantcastIdSystem", - "deepintentDpesIdSystem", + "kinessoIdSystem", + "liveIntentIdSystem", + "lotamePanoramaIdSystem", + "merkleIdSystem", + "mwOpenLinkIdSystem", + "naveggIdSystem", + "netIdSystem", "nextrollIdSystem", - "idxIdSystem", - "fabrickIdSystem", - "verizonMediaIdSystem", + "novatiqIdSystem", + "parrableIdSystem", "pubProvidedIdSystem", - "mwOpenLinkIdSystem", + "publinkIdSystem", + "quantcastIdSystem", + "sharedIdSystem", "tapadIdSystem", - "novatiqIdSystem", "uid2IdSystem", - "admixerIdSystem", - "dmdIdSystem", - "akamaiDAPId", - "flocIdSystem", - "amxIdSystem", - "naveggId", - "imuIdSystem", - "publinkIdSystem" + "unifiedIdSystem", + "verizonMediaIdSystem", + "zeotapIdPlusIdSystem" ], "adpod": [ "freeWheelAdserverVideo", From cd10ea01e16fd550c2a89061e0bea425276243db Mon Sep 17 00:00:00 2001 From: Jonathan Nadarajah <50102657+jogury@users.noreply.github.com> Date: Mon, 27 Sep 2021 15:46:31 +0200 Subject: [PATCH 092/250] ogury Bid Adapter: fix getusersync method (#7472) --- modules/oguryBidAdapter.js | 2 +- test/spec/modules/oguryBidAdapter_spec.js | 66 +++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index 2e5342e6f9e..513f9ed384e 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -25,7 +25,7 @@ function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) { return [{ type: 'image', - url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${gdprConsent.consentString}&source=prebid` + url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid` }] } diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index 0a57690db27..d693e8fd3cc 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -140,6 +140,72 @@ describe('OguryBidAdapter', function () { syncOptions.pixelEnabled = false; expect(spec.getUserSyncs(syncOptions, [], gdprConsent)).to.have.lengthOf(0); }); + + it('should return syncs array with an element of type image when consentString is undefined', () => { + gdprConsent = { + gdprApplies: true, + consentString: undefined + }; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); + + it('should return syncs array with an element of type image when consentString is null', () => { + gdprConsent = { + gdprApplies: true, + consentString: null + }; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); + + it('should return syncs array with an element of type image when gdprConsent is undefined', () => { + gdprConsent = undefined; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); + + it('should return syncs array with an element of type image when gdprConsent is null', () => { + gdprConsent = null; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); + + it('should return syncs array with an element of type image when gdprConsent is null and gdprApplies is false', () => { + gdprConsent = { + gdprApplies: false, + consentString: null + }; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); + + it('should return syncs array with an element of type image when gdprConsent is empty string and gdprApplies is false', () => { + gdprConsent = { + gdprApplies: false, + consentString: '' + }; + + const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); + expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs[0].type).to.equal('image'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + }); }); describe('buildRequests', function () { From 2f7d3fdef88fe2d70876e18412d71c9c74b3cbad Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 27 Sep 2021 11:04:54 -0700 Subject: [PATCH 093/250] Multiple Bid/Analytics Adapters: import utils functions as needed and not the whole module (#7471) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils as needed; dont import all * import utils as needed; dont import all * Import utils functions as needed; do not import whole module --- modules/adkernelBidAdapter.js | 89 +++++++++++++++-------------- modules/adlooxAdServerVideo.js | 52 ++++++++--------- modules/adlooxAnalyticsAdapter.js | 73 ++++++++++++------------ modules/adlooxRtdProvider.js | 95 ++++++++++++++++--------------- modules/admanBidAdapter.js | 8 +-- modules/admixerBidAdapter.js | 4 +- modules/admixerIdSystem.js | 8 +-- modules/adnowBidAdapter.js | 8 +-- modules/adnuntiusBidAdapter.js | 10 ++-- modules/adoceanBidAdapter.js | 20 +++---- modules/adpartnerBidAdapter.js | 6 +- modules/adpod.js | 87 ++++++++++++++-------------- modules/adprimeBidAdapter.js | 8 +-- modules/adqueryBidAdapter.js | 26 ++++----- modules/adrelevantisBidAdapter.js | 57 ++++++++++--------- 15 files changed, 283 insertions(+), 268 deletions(-) diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index a6bf56f8cad..dcbd8283c71 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -1,4 +1,7 @@ -import * as utils from '../src/utils.js'; +import { + isStr, isArray, isPlainObject, deepSetValue, isNumber, deepAccess, getAdUnitSizes, parseGPTSingleSizeArrayToRtbSize, + cleanObj, contains, getDNT, parseUrl, createTrackPixelHtml, _each, isArrayOfNums +} from '../src/utils.js'; import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import find from 'core-js-pure/features/array/find.js'; @@ -154,24 +157,24 @@ export const spec = { prBid.mediaType = NATIVE; prBid.native = buildNativeAd(JSON.parse(rtbBid.adm)); } - if (utils.isStr(rtbBid.dealid)) { + if (isStr(rtbBid.dealid)) { prBid.dealId = rtbBid.dealid; } - if (utils.isArray(rtbBid.adomain)) { - utils.deepSetValue(prBid, 'meta.advertiserDomains', rtbBid.adomain); + if (isArray(rtbBid.adomain)) { + deepSetValue(prBid, 'meta.advertiserDomains', rtbBid.adomain); } - if (utils.isArray(rtbBid.cat)) { - utils.deepSetValue(prBid, 'meta.secondaryCatIds', rtbBid.cat); + if (isArray(rtbBid.cat)) { + deepSetValue(prBid, 'meta.secondaryCatIds', rtbBid.cat); } - if (utils.isPlainObject(rtbBid.ext)) { - if (utils.isNumber(rtbBid.ext.advertiser_id)) { - utils.deepSetValue(prBid, 'meta.advertiserId', rtbBid.ext.advertiser_id); + if (isPlainObject(rtbBid.ext)) { + if (isNumber(rtbBid.ext.advertiser_id)) { + deepSetValue(prBid, 'meta.advertiserId', rtbBid.ext.advertiser_id); } - if (utils.isStr(rtbBid.ext.advertiser_name)) { - utils.deepSetValue(prBid, 'meta.advertiserName', rtbBid.ext.advertiser_name); + if (isStr(rtbBid.ext.advertiser_name)) { + deepSetValue(prBid, 'meta.advertiserName', rtbBid.ext.advertiser_name); } - if (utils.isStr(rtbBid.ext.agency_name)) { - utils.deepSetValue(prBid, 'meta.agencyName', rtbBid.ext.agency_name); + if (isStr(rtbBid.ext.agency_name)) { + deepSetValue(prBid, 'meta.agencyName', rtbBid.ext.agency_name); } } @@ -241,19 +244,19 @@ function buildImp(bidRequest, secure) { var mediaType; var sizes = []; - if (utils.deepAccess(bidRequest, 'mediaTypes.banner')) { - sizes = utils.getAdUnitSizes(bidRequest); + if (deepAccess(bidRequest, 'mediaTypes.banner')) { + sizes = getAdUnitSizes(bidRequest); imp.banner = { - format: sizes.map(wh => utils.parseGPTSingleSizeArrayToRtbSize(wh)), + format: sizes.map(wh => parseGPTSingleSizeArrayToRtbSize(wh)), topframe: 0 }; mediaType = BANNER; - } else if (utils.deepAccess(bidRequest, 'mediaTypes.video')) { - let video = utils.deepAccess(bidRequest, 'mediaTypes.video'); + } else if (deepAccess(bidRequest, 'mediaTypes.video')) { + let video = deepAccess(bidRequest, 'mediaTypes.video'); imp.video = {}; if (video.playerSize) { sizes = video.playerSize[0]; - imp.video = Object.assign(imp.video, utils.parseGPTSingleSizeArrayToRtbSize(sizes) || {}); + imp.video = Object.assign(imp.video, parseGPTSingleSizeArrayToRtbSize(sizes) || {}); } if (bidRequest.params.video) { Object.keys(bidRequest.params.video) @@ -261,7 +264,7 @@ function buildImp(bidRequest, secure) { .forEach(key => imp.video[key] = bidRequest.params.video[key]); } mediaType = VIDEO; - } else if (utils.deepAccess(bidRequest, 'mediaTypes.native')) { + } else if (deepAccess(bidRequest, 'mediaTypes.native')) { let nativeRequest = buildNativeRequest(bidRequest.mediaTypes.native); imp.native = { ver: '1.1', @@ -299,7 +302,7 @@ function buildNativeRequest(nativeReq) { if (desc.assetType === 'img') { assetRoot[desc.assetType] = buildImageAsset(desc, v); } else if (desc.assetType === 'data') { - assetRoot.data = utils.cleanObj({type: desc.type, len: v.len}); + assetRoot.data = cleanObj({type: desc.type, len: v.len}); } else if (desc.assetType === 'title') { assetRoot.title = {len: v.len || 90}; } else { @@ -323,7 +326,7 @@ function buildImageAsset(desc, val) { img.wmin = val.aspect_ratios[0].min_width; img.hmin = val.aspect_ratios[0].min_height; } - return utils.cleanObj(img); + return cleanObj(img); } /** @@ -336,9 +339,9 @@ function isSyncMethodAllowed(syncRule, bidderCode) { if (!syncRule) { return false; } - let bidders = utils.isArray(syncRule.bidders) ? syncRule.bidders : [bidderCode]; + let bidders = isArray(syncRule.bidders) ? syncRule.bidders : [bidderCode]; let rule = syncRule.filter === 'include'; - return utils.contains(bidders, bidderCode) === rule; + return contains(bidders, bidderCode) === rule; } /** @@ -382,33 +385,33 @@ function buildRtbRequest(imps, bidderRequest, schain) { }, 'tmax': parseInt(timeout) }; - if (utils.getDNT()) { + if (getDNT()) { req.device.dnt = 1; } if (gdprConsent) { if (gdprConsent.gdprApplies !== undefined) { - utils.deepSetValue(req, 'regs.ext.gdpr', ~~gdprConsent.gdprApplies); + deepSetValue(req, 'regs.ext.gdpr', ~~gdprConsent.gdprApplies); } if (gdprConsent.consentString !== undefined) { - utils.deepSetValue(req, 'user.ext.consent', gdprConsent.consentString); + deepSetValue(req, 'user.ext.consent', gdprConsent.consentString); } } if (uspConsent) { - utils.deepSetValue(req, 'regs.ext.us_privacy', uspConsent); + deepSetValue(req, 'regs.ext.us_privacy', uspConsent); } if (coppa) { - utils.deepSetValue(req, 'regs.coppa', 1); + deepSetValue(req, 'regs.coppa', 1); } let syncMethod = getAllowedSyncMethod(bidderCode); if (syncMethod) { - utils.deepSetValue(req, 'ext.adk_usersync', syncMethod); + deepSetValue(req, 'ext.adk_usersync', syncMethod); } if (schain) { - utils.deepSetValue(req, 'source.ext.schain', schain); + deepSetValue(req, 'source.ext.schain', schain); } let eids = getExtendedUserIds(bidderRequest); if (eids) { - utils.deepSetValue(req, 'user.ext.eids', eids); + deepSetValue(req, 'user.ext.eids', eids); } return req; } @@ -426,7 +429,7 @@ function getLanguage() { * Creates site description object */ function createSite(refInfo) { - let url = utils.parseUrl(refInfo.referer); + let url = parseUrl(refInfo.referer); let site = { 'domain': url.hostname, 'page': `${url.protocol}://${url.hostname}${url.pathname}` @@ -442,8 +445,8 @@ function createSite(refInfo) { } function getExtendedUserIds(bidderRequest) { - let eids = utils.deepAccess(bidderRequest, 'bids.0.userIdAsEids'); - if (utils.isArray(eids)) { + let eids = deepAccess(bidderRequest, 'bids.0.userIdAsEids'); + if (isArray(eids)) { return eids; } } @@ -455,7 +458,7 @@ function getExtendedUserIds(bidderRequest) { function formatAdMarkup(bid) { let adm = bid.adm; if ('nurl' in bid) { - adm += utils.createTrackPixelHtml(`${bid.nurl}&px=1`); + adm += createTrackPixelHtml(`${bid.nurl}&px=1`); } return adm; } @@ -465,8 +468,8 @@ function formatAdMarkup(bid) { */ function validateNativeAdUnit(adUnit) { return validateNativeImageSize(adUnit.image) && validateNativeImageSize(adUnit.icon) && - !utils.deepAccess(adUnit, 'privacyLink.required') && // not supported yet - !utils.deepAccess(adUnit, 'privacyIcon.required'); // not supported yet + !deepAccess(adUnit, 'privacyLink.required') && // not supported yet + !deepAccess(adUnit, 'privacyIcon.required'); // not supported yet } /** @@ -477,9 +480,9 @@ function validateNativeImageSize(img) { return true; } if (img.sizes) { - return utils.isArrayOfNums(img.sizes, 2); + return isArrayOfNums(img.sizes, 2); } - if (utils.isArray(img.aspect_ratios)) { + if (isArray(img.aspect_ratios)) { return img.aspect_ratios.length > 0 && img.aspect_ratios[0].min_height && img.aspect_ratios[0].min_width; } return true; @@ -496,14 +499,14 @@ function buildNativeAd(nativeResp) { javascriptTrackers: jstracker ? [jstracker] : undefined, privacyLink: privacy, }; - utils._each(assets, asset => { + _each(assets, asset => { let assetName = NATIVE_MODEL[asset.id].name; let assetType = NATIVE_MODEL[asset.id].assetType; - nativeAd[assetName] = asset[assetType].text || asset[assetType].value || utils.cleanObj({ + nativeAd[assetName] = asset[assetType].text || asset[assetType].value || cleanObj({ url: asset[assetType].url, width: asset[assetType].w, height: asset[assetType].h }); }); - return utils.cleanObj(nativeAd); + return cleanObj(nativeAd); } diff --git a/modules/adlooxAdServerVideo.js b/modules/adlooxAdServerVideo.js index 2a61e59b714..7305283039c 100644 --- a/modules/adlooxAdServerVideo.js +++ b/modules/adlooxAdServerVideo.js @@ -11,48 +11,48 @@ import { command as analyticsCommand, COMMAND } from './adlooxAnalyticsAdapter.j import { ajax } from '../src/ajax.js'; import { EVENTS } from '../src/constants.json'; import { targeting } from '../src/targeting.js'; -import * as utils from '../src/utils.js'; +import { logInfo, isFn, logError, isPlainObject, isStr, isBoolean, deepSetValue, deepClone, timestamp, logWarn } from '../src/utils.js'; const MODULE = 'adlooxAdserverVideo'; const URL_VAST = 'https://j.adlooxtracking.com/ads/vast/tag.php'; export function buildVideoUrl(options, callback) { - utils.logInfo(MODULE, 'buildVideoUrl', options); + logInfo(MODULE, 'buildVideoUrl', options); - if (!utils.isFn(callback)) { - utils.logError(MODULE, 'invalid callback'); + if (!isFn(callback)) { + logError(MODULE, 'invalid callback'); return false; } - if (!utils.isPlainObject(options)) { - utils.logError(MODULE, 'missing options'); + if (!isPlainObject(options)) { + logError(MODULE, 'missing options'); return false; } - if (!(options.url_vast === undefined || utils.isStr(options.url_vast))) { - utils.logError(MODULE, 'invalid url_vast options value'); + if (!(options.url_vast === undefined || isStr(options.url_vast))) { + logError(MODULE, 'invalid url_vast options value'); return false; } - if (!(utils.isPlainObject(options.adUnit) || utils.isPlainObject(options.bid))) { - utils.logError(MODULE, "requires either 'adUnit' or 'bid' options value"); + if (!(isPlainObject(options.adUnit) || isPlainObject(options.bid))) { + logError(MODULE, "requires either 'adUnit' or 'bid' options value"); return false; } - if (!utils.isStr(options.url)) { - utils.logError(MODULE, 'invalid url options value'); + if (!isStr(options.url)) { + logError(MODULE, 'invalid url options value'); return false; } - if (!(options.wrap === undefined || utils.isBoolean(options.wrap))) { - utils.logError(MODULE, 'invalid wrap options value'); + if (!(options.wrap === undefined || isBoolean(options.wrap))) { + logError(MODULE, 'invalid wrap options value'); return false; } - if (!(options.blob === undefined || utils.isBoolean(options.blob))) { - utils.logError(MODULE, 'invalid blob options value'); + if (!(options.blob === undefined || isBoolean(options.blob))) { + logError(MODULE, 'invalid blob options value'); return false; } // same logic used in modules/dfpAdServerVideo.js options.bid = options.bid || targeting.getWinningBids(options.adUnit.code)[0]; - utils.deepSetValue(options.bid, 'ext.adloox.video.adserver', true); + deepSetValue(options.bid, 'ext.adloox.video.adserver', true); if (options.wrap !== false) { VASTWrapper(options, callback); @@ -70,7 +70,7 @@ registerVideoSupport('adloox', { function track(options, callback) { callback(options.url); - const bid = utils.deepClone(options.bid); + const bid = deepClone(options.bid); bid.ext.adloox.video.adserver = false; analyticsCommand(COMMAND.TRACK, { @@ -85,13 +85,13 @@ function VASTWrapper(options, callback) { function process(result) { function getAd(xml) { if (!xml || xml.documentElement.tagName != 'VAST') { - utils.logError(MODULE, 'not a VAST tag, using non-wrapped tracking'); + logError(MODULE, 'not a VAST tag, using non-wrapped tracking'); return; } const ads = xml.querySelectorAll('Ad'); if (!ads.length) { - utils.logError(MODULE, 'no VAST ads, using non-wrapped tracking'); + logError(MODULE, 'no VAST ads, using non-wrapped tracking'); return; } @@ -132,7 +132,7 @@ function VASTWrapper(options, callback) { options.url = toBlob(chain[0]); - const epoch = utils.timestamp() - new Date().getTimezoneOffset() * 60 * 1000; + const epoch = timestamp() - new Date().getTimezoneOffset() * 60 * 1000; const expires0 = options.bid.ttl * 1000 - (epoch - options.bid.responseTimestamp); const expires = Math.max(30 * 1000, expires0); setTimeout(function() { urls.forEach(u => URL.revokeObjectURL(u)) }, expires); @@ -154,7 +154,7 @@ function VASTWrapper(options, callback) { const wrapper = getWrapper(ad); if (wrapper) { if (chain.length > 5) { - utils.logWarn(MODULE, `got wrapped tag at depth ${chain.length}, not continuing`); + logWarn(MODULE, `got wrapped tag at depth ${chain.length}, not continuing`); blobify(); return track(options, callback); } @@ -191,7 +191,7 @@ function VASTWrapper(options, callback) { if (duration != 15) args.push([ 'duration', duration ]); if (skip) args.push([ 'skip', skip ]); - utils.logInfo(MODULE, `processed VAST tag chain of depth ${chain.depth}, running callback`); + logInfo(MODULE, `processed VAST tag chain of depth ${chain.depth}, running callback`); analyticsCommand(COMMAND.URL, { url: (options.url_vast || URL_VAST) + '?', @@ -202,7 +202,7 @@ function VASTWrapper(options, callback) { } function fetch(url, withoutcredentials) { - utils.logInfo(MODULE, `fetching VAST ${url}`); + logInfo(MODULE, `fetching VAST ${url}`); ajax(url, { success: function(responseText, q) { @@ -210,10 +210,10 @@ function VASTWrapper(options, callback) { }, error: function(statusText, q) { if (!withoutcredentials) { - utils.logWarn(MODULE, `unable to download (${statusText}), suspected CORS withCredentials problem, retrying without`); + logWarn(MODULE, `unable to download (${statusText}), suspected CORS withCredentials problem, retrying without`); return fetch(url, true); } - utils.logError(MODULE, `failed to fetch (${statusText}), using non-wrapped tracking`); + logError(MODULE, `failed to fetch (${statusText}), using non-wrapped tracking`); process(); } }, undefined, { withCredentials: !withoutcredentials }); diff --git a/modules/adlooxAnalyticsAdapter.js b/modules/adlooxAnalyticsAdapter.js index 17787f816df..6ea1df1b72c 100644 --- a/modules/adlooxAnalyticsAdapter.js +++ b/modules/adlooxAnalyticsAdapter.js @@ -11,7 +11,10 @@ import { auctionManager } from '../src/auctionManager.js'; import { AUCTION_COMPLETED } from '../src/auction.js'; import { EVENTS } from '../src/constants.json'; import find from 'core-js-pure/features/array/find.js'; -import * as utils from '../src/utils.js'; +import { + deepAccess, logInfo, isPlainObject, logError, isStr, isNumber, getGptSlotInfoForAdUnitCode, + isFn, mergeDeep, logMessage, insertElement, logWarn, getUniqueIdentifierStr, parseUrl +} from '../src/utils.js'; const MODULE = 'adlooxAnalyticsAdapter'; @@ -45,7 +48,7 @@ MACRO['creatype'] = function(b, c) { }; MACRO['pbadslot'] = function(b, c) { const adUnit = find(auctionManager.getAdUnits(), a => b.adUnitCode === a.code); - return utils.deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot') || utils.getGptSlotInfoForAdUnitCode(b.adUnitCode).gptSlot || b.adUnitCode; + return deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot') || getGptSlotInfoForAdUnitCode(b.adUnitCode).gptSlot || b.adUnitCode; }; MACRO['pbAdSlot'] = MACRO['pbadslot']; // legacy @@ -66,7 +69,7 @@ let analyticsAdapter = Object.assign(adapter({ analyticsType: 'endpoint' }), { track({ eventType, args }) { if (!analyticsAdapter[`handle_${eventType}`]) return; - utils.logInfo(MODULE, 'track', eventType, args); + logInfo(MODULE, 'track', eventType, args); analyticsAdapter[`handle_${eventType}`](args); } @@ -78,45 +81,45 @@ analyticsAdapter.originEnableAnalytics = analyticsAdapter.enableAnalytics; analyticsAdapter.enableAnalytics = function(config) { analyticsAdapter.context = null; - utils.logInfo(MODULE, 'config', config); + logInfo(MODULE, 'config', config); - if (!utils.isPlainObject(config.options)) { - utils.logError(MODULE, 'missing options'); + if (!isPlainObject(config.options)) { + logError(MODULE, 'missing options'); return; } - if (!(config.options.js === undefined || utils.isStr(config.options.js))) { - utils.logError(MODULE, 'invalid js options value'); + if (!(config.options.js === undefined || isStr(config.options.js))) { + logError(MODULE, 'invalid js options value'); return; } - if (!(config.options.toselector === undefined || utils.isFn(config.options.toselector))) { - utils.logError(MODULE, 'invalid toselector options value'); + if (!(config.options.toselector === undefined || isFn(config.options.toselector))) { + logError(MODULE, 'invalid toselector options value'); return; } - if (!utils.isStr(config.options.client)) { - utils.logError(MODULE, 'invalid client options value'); + if (!isStr(config.options.client)) { + logError(MODULE, 'invalid client options value'); return; } - if (!utils.isNumber(config.options.clientid)) { - utils.logError(MODULE, 'invalid clientid options value'); + if (!isNumber(config.options.clientid)) { + logError(MODULE, 'invalid clientid options value'); return; } - if (!utils.isNumber(config.options.tagid)) { - utils.logError(MODULE, 'invalid tagid options value'); + if (!isNumber(config.options.tagid)) { + logError(MODULE, 'invalid tagid options value'); return; } - if (!utils.isNumber(config.options.platformid)) { - utils.logError(MODULE, 'invalid platformid options value'); + if (!isNumber(config.options.platformid)) { + logError(MODULE, 'invalid platformid options value'); return; } - if (!(config.options.params === undefined || utils.isPlainObject(config.options.params))) { - utils.logError(MODULE, 'invalid params options value'); + if (!(config.options.params === undefined || isPlainObject(config.options.params))) { + logError(MODULE, 'invalid params options value'); return; } analyticsAdapter.context = { js: config.options.js || URL_JS, toselector: config.options.toselector || function(bid) { - let code = utils.getGptSlotInfoForAdUnitCode(bid.adUnitCode).divId || bid.adUnitCode; + let code = getGptSlotInfoForAdUnitCode(bid.adUnitCode).divId || bid.adUnitCode; // https://mathiasbynens.be/notes/css-escapes code = code.replace(/^\d/, '\\3$& '); return `#${code}` @@ -128,7 +131,7 @@ analyticsAdapter.enableAnalytics = function(config) { params: [] }; - config.options.params = utils.mergeDeep({}, PARAMS_DEFAULT, config.options.params || {}); + config.options.params = mergeDeep({}, PARAMS_DEFAULT, config.options.params || {}); Object .keys(config.options.params) .forEach(k => { @@ -180,15 +183,15 @@ analyticsAdapter.url = function(url, args, bid) { let n = args.length; while (n-- > 0) { - if (utils.isFn(args[n][1])) { + if (isFn(args[n][1])) { try { args[n][1] = args[n][1](bid); } catch (_) { - utils.logError(MODULE, 'macro', args[n][0], _.message); + logError(MODULE, 'macro', args[n][0], _.message); args[n][1] = `ERROR: ${_.message}`; } } - if (utils.isStr(args[n][1])) { + if (isStr(args[n][1])) { args[n][1] = macros(args[n][1]); } } @@ -200,20 +203,20 @@ analyticsAdapter[`handle_${EVENTS.AUCTION_END}`] = function(auctionDetails) { if (!(auctionDetails.auctionStatus == AUCTION_COMPLETED && auctionDetails.bidsReceived.length > 0)) return; analyticsAdapter[`handle_${EVENTS.AUCTION_END}`] = NOOP; - utils.logMessage(MODULE, 'preloading verification JS'); + logMessage(MODULE, 'preloading verification JS'); - const uri = utils.parseUrl(analyticsAdapter.url(`${analyticsAdapter.context.js}#`)); + const uri = parseUrl(analyticsAdapter.url(`${analyticsAdapter.context.js}#`)); const link = document.createElement('link'); link.setAttribute('href', `${uri.protocol}://${uri.host}${uri.pathname}`); link.setAttribute('rel', 'preload'); link.setAttribute('as', 'script'); - utils.insertElement(link); + insertElement(link); } analyticsAdapter[`handle_${EVENTS.BID_WON}`] = function(bid) { - if (utils.deepAccess(bid, 'ext.adloox.video.adserver')) { - utils.logMessage(MODULE, `measuring '${bid.mediaType}' ad unit code '${bid.adUnitCode}' via Ad Server module`); + if (deepAccess(bid, 'ext.adloox.video.adserver')) { + logMessage(MODULE, `measuring '${bid.mediaType}' ad unit code '${bid.adUnitCode}' via Ad Server module`); return; } @@ -223,11 +226,11 @@ analyticsAdapter[`handle_${EVENTS.BID_WON}`] = function(bid) { el = document.querySelector(sl); } catch (_) { } if (!el) { - utils.logWarn(MODULE, `unable to find ad unit code '${bid.adUnitCode}' slot using selector '${sl}' (use options.toselector to change), ignoring`); + logWarn(MODULE, `unable to find ad unit code '${bid.adUnitCode}' slot using selector '${sl}' (use options.toselector to change), ignoring`); return; } - utils.logMessage(MODULE, `measuring '${bid.mediaType}' unit at '${bid.adUnitCode}'`); + logMessage(MODULE, `measuring '${bid.mediaType}' unit at '${bid.adUnitCode}'`); const params = analyticsAdapter.context.params.concat([ [ 'tagid', '%%tagid%%' ], @@ -257,7 +260,7 @@ export const COMMAND = { TRACK: 'track' }; export function command(cmd, data, callback0) { - const cid = utils.getUniqueIdentifierStr(); + const cid = getUniqueIdentifierStr(); const callback = function() { delete COMMAND_QUEUE[cid]; if (callback0) callback0.apply(null, arguments); @@ -268,7 +271,7 @@ export function command(cmd, data, callback0) { function commandProcess(cid) { const { cmd, data, callback } = COMMAND_QUEUE[cid]; - utils.logInfo(MODULE, 'command', cmd, data); + logInfo(MODULE, 'command', cmd, data); switch (cmd) { case COMMAND.CONFIG: @@ -292,7 +295,7 @@ function commandProcess(cid) { callback(); // drain queue break; default: - utils.logWarn(MODULE, 'command unknown', cmd); + logWarn(MODULE, 'command unknown', cmd); // do not callback as arguments are unknown and to aid debugging } } diff --git a/modules/adlooxRtdProvider.js b/modules/adlooxRtdProvider.js index 3e93047cccc..34d1428ea1d 100644 --- a/modules/adlooxRtdProvider.js +++ b/modules/adlooxRtdProvider.js @@ -16,7 +16,10 @@ import { config as _config } from '../src/config.js'; import { submodule } from '../src/hook.js'; import { ajax } from '../src/ajax.js'; import { getGlobal } from '../src/prebidGlobal.js'; -import * as utils from '../src/utils.js'; +import { + getAdUnitSizes, logInfo, isPlainObject, logError, isStr, isInteger, isArray, isBoolean, mergeDeep, deepAccess, + _each, deepSetValue, logWarn, getGptSlotInfoForAdUnitCode +} from '../src/utils.js'; import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'adloox'; @@ -49,7 +52,7 @@ function atf(adUnit, cb) { // Google's advice is to collapse slots on no fill but // we have to cater to clients that grow slots on fill const rect = (function(rect) { - const sizes = utils.getAdUnitSizes(adUnit); + const sizes = getAdUnitSizes(adUnit); if (sizes.length == 0) return false; // interstitial (0x0, 1x1) @@ -141,54 +144,54 @@ function atf(adUnit, cb) { } function init(config, userConsent) { - utils.logInfo(MODULE, 'init', config, userConsent); + logInfo(MODULE, 'init', config, userConsent); - if (!utils.isPlainObject(config)) { - utils.logError(MODULE, 'missing config'); + if (!isPlainObject(config)) { + logError(MODULE, 'missing config'); return false; } if (config.params === undefined) config.params = {}; - if (!(utils.isPlainObject(config.params))) { - utils.logError(MODULE, 'invalid params'); + if (!(isPlainObject(config.params))) { + logError(MODULE, 'invalid params'); return false; } - if (!(config.params.api_origin === undefined || utils.isStr(config.params.api_origin))) { - utils.logError(MODULE, 'invalid api_origin params value'); + if (!(config.params.api_origin === undefined || isStr(config.params.api_origin))) { + logError(MODULE, 'invalid api_origin params value'); return false; } - if (!(config.params.imps === undefined || (utils.isInteger(config.params.imps) && config.params.imps > 0))) { - utils.logError(MODULE, 'invalid imps params value'); + if (!(config.params.imps === undefined || (isInteger(config.params.imps) && config.params.imps > 0))) { + logError(MODULE, 'invalid imps params value'); return false; } - if (!(config.params.freqcap_ip === undefined || (utils.isInteger(config.params.freqcap_ip) && config.params.freqcap_ip >= 0))) { - utils.logError(MODULE, 'invalid freqcap_ip params value'); + if (!(config.params.freqcap_ip === undefined || (isInteger(config.params.freqcap_ip) && config.params.freqcap_ip >= 0))) { + logError(MODULE, 'invalid freqcap_ip params value'); return false; } - if (!(config.params.freqcap_ipua === undefined || (utils.isInteger(config.params.freqcap_ipua) && config.params.freqcap_ipua >= 0))) { - utils.logError(MODULE, 'invalid freqcap_ipua params value'); + if (!(config.params.freqcap_ipua === undefined || (isInteger(config.params.freqcap_ipua) && config.params.freqcap_ipua >= 0))) { + logError(MODULE, 'invalid freqcap_ipua params value'); return false; } - if (!(config.params.thresholds === undefined || (utils.isArray(config.params.thresholds) && config.params.thresholds.every(x => utils.isInteger(x) && x > 0 && x <= 100)))) { - utils.logError(MODULE, 'invalid thresholds params value'); + if (!(config.params.thresholds === undefined || (isArray(config.params.thresholds) && config.params.thresholds.every(x => isInteger(x) && x > 0 && x <= 100)))) { + logError(MODULE, 'invalid thresholds params value'); return false; } - if (!(config.params.slotinpath === undefined || utils.isBoolean(config.params.slotinpath))) { - utils.logError(MODULE, 'invalid slotinpath params value'); + if (!(config.params.slotinpath === undefined || isBoolean(config.params.slotinpath))) { + logError(MODULE, 'invalid slotinpath params value'); return false; } // legacy/deprecated configuration code path - if (!(config.params.params === undefined || (utils.isPlainObject(config.params.params) && utils.isInteger(config.params.params.clientid) && utils.isInteger(config.params.params.tagid) && utils.isInteger(config.params.params.platformid)))) { - utils.logError(MODULE, 'invalid subsection params block'); + if (!(config.params.params === undefined || (isPlainObject(config.params.params) && isInteger(config.params.params.clientid) && isInteger(config.params.params.tagid) && isInteger(config.params.params.platformid)))) { + logError(MODULE, 'invalid subsection params block'); return false; } config.params.thresholds = config.params.thresholds || [ 50, 60, 70, 80, 90 ]; function analyticsConfigCallback(data) { - config = utils.mergeDeep(config.params, data); + config = mergeDeep(config.params, data); } if (config.params.params) { - utils.logWarn(MODULE, `legacy/deprecated configuration (please migrate to ${MODULE_NAME}AnalyticsAdapter)`); + logWarn(MODULE, `legacy/deprecated configuration (please migrate to ${MODULE_NAME}AnalyticsAdapter)`); analyticsConfigCallback(config.params.params); } else { analyticsCommand(COMMAND.CONFIG, null, analyticsConfigCallback); @@ -200,8 +203,8 @@ function init(config, userConsent) { function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { // gptPreAuction runs *after* RTD so pbadslot may not be populated... (╯°□°)╯ ┻━┻ const adUnits = (reqBidsConfigObj.adUnits || getGlobal().adUnits).map(adUnit => { - let path = utils.deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot'); - if (!path) path = utils.getGptSlotInfoForAdUnitCode(adUnit.code).gptSlot; + let path = deepAccess(adUnit, 'ortb2Imp.ext.data.pbadslot'); + if (!path) path = getGptSlotInfoForAdUnitCode(adUnit.code).gptSlot; return { path: path, unit: adUnit @@ -219,33 +222,33 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { const dataSite = _config.getConfig('ortb2.site.ext.data') || {}; const dataUser = _config.getConfig('ortb2.user.ext.data') || {}; - utils._each(response, (v0, k0) => { + _each(response, (v0, k0) => { if (k0 == '_') return; const k = SEGMENT_HISTORIC[k0] || k0; const v = val(v0, k0); - utils.deepSetValue(k == k0 ? dataUser : dataSite, `${MODULE_NAME}_rtd.${k}`, v); + deepSetValue(k == k0 ? dataUser : dataSite, `${MODULE_NAME}_rtd.${k}`, v); }); - utils.deepSetValue(dataSite, `${MODULE_NAME}_rtd.ok`, true); + deepSetValue(dataSite, `${MODULE_NAME}_rtd.ok`, true); - utils.deepSetValue(ortb2, 'site.ext.data', dataSite); - utils.deepSetValue(ortb2, 'user.ext.data', dataUser); + deepSetValue(ortb2, 'site.ext.data', dataSite); + deepSetValue(ortb2, 'user.ext.data', dataUser); _config.setConfig({ ortb2 }); adUnits.forEach((adUnit, i) => { - utils._each(response['_'][i], (v0, k0) => { + _each(response['_'][i], (v0, k0) => { const k = SEGMENT_HISTORIC[k0] || k0; const v = val(v0, k0); - utils.deepSetValue(adUnit.unit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd.${k}`, v); + deepSetValue(adUnit.unit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd.${k}`, v); }); }); }; - // utils.mergeDeep does not handle merging deep arrays... (╯°□°)╯ ┻━┻ + // mergeDeep does not handle merging deep arrays... (╯°□°)╯ ┻━┻ function mergeDeep(target, ...sources) { function emptyValue(v) { - if (utils.isPlainObject(v)) { + if (isPlainObject(v)) { return {}; - } else if (utils.isArray(v)) { + } else if (isArray(v)) { return []; } else { return undefined; @@ -255,12 +258,12 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { if (!sources.length) return target; const source = sources.shift(); - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + if (isPlainObject(target) && isPlainObject(source)) { Object.keys(source).forEach(key => { if (!(key in target)) target[key] = emptyValue(source[key]); target[key] = target[key] !== undefined ? mergeDeep(target[key], source[key]) : source[key]; }); - } else if (utils.isArray(target) && utils.isArray(source)) { + } else if (isArray(target) && isArray(source)) { source.forEach((v, i) => { if (!(i in target)) target[i] = emptyValue(v); target[i] = target[i] !== undefined ? mergeDeep(target[i], v) : v; @@ -294,7 +297,7 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { ]; if (!adUnits.length) { - utils.logWarn(MODULE, 'no suitable adUnits (missing pbadslot?)'); + logWarn(MODULE, 'no suitable adUnits (missing pbadslot?)'); } const atfQueue = []; adUnits.map((adUnit, i) => { @@ -307,7 +310,7 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { atf(adUnit.unit, function(x) { let viewable = document.visibilityState === undefined || document.visibilityState == 'visible'; try { viewable = viewable && top.document.hasFocus() } catch (_) {} - utils.logInfo(MODULE, `atf code=${adUnit.unit.code} has area=${x}, viewable=${viewable}`); + logInfo(MODULE, `atf code=${adUnit.unit.code} has area=${x}, viewable=${viewable}`); const atfList = []; atfList[i] = { atf: parseInt(x * 100) }; response = mergeDeep(response, { _: atfList }); semaphoreInc(-1); @@ -336,12 +339,12 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { throw false; } } catch (_) { - utils.logError(MODULE, 'unexpected response'); + logError(MODULE, 'unexpected response'); } semaphoreInc(-1); }, error: function(statusText, q) { - utils.logError(MODULE, 'request failed'); + logError(MODULE, 'request failed'); semaphoreInc(-1); } }); @@ -350,8 +353,8 @@ function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { function getTargetingData(adUnitArray, config, userConsent) { function targetingNormalise(v) { - if (utils.isArray(v) && v.length == 0) return undefined; - if (utils.isBoolean(v)) v = ~~v; + if (isArray(v) && v.length == 0) return undefined; + if (isBoolean(v)) v = ~~v; if (!v) return undefined; // empty string and zero return v; } @@ -363,14 +366,14 @@ function getTargetingData(adUnitArray, config, userConsent) { return getGlobal().adUnits.filter(adUnit => includes(adUnitArray, adUnit.code)).reduce((a, adUnit) => { a[adUnit.code] = {}; - utils._each(dataSite, (v0, k) => { + _each(dataSite, (v0, k) => { if (includes(SEGMENT_HISTORIC_VALUES, k)) return; // ignore site average viewability const v = targetingNormalise(v0); if (v) a[adUnit.code][ADSERVER_TARGETING_PREFIX + k] = v; }); - const adUnitSegments = utils.deepAccess(adUnit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd`, {}); - utils._each(Object.assign({}, dataUser, adUnitSegments), (v0, k) => { + const adUnitSegments = deepAccess(adUnit, `ortb2Imp.ext.data.${MODULE_NAME}_rtd`, {}); + _each(Object.assign({}, dataUser, adUnitSegments), (v0, k) => { const v = targetingNormalise(v0); if (v) a[adUnit.code][ADSERVER_TARGETING_PREFIX + k] = v; }); diff --git a/modules/admanBidAdapter.js b/modules/admanBidAdapter.js index 18d1fb57486..e02a1a9df04 100644 --- a/modules/admanBidAdapter.js +++ b/modules/admanBidAdapter.js @@ -1,6 +1,6 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { isFn, deepAccess, logMessage } from '../src/utils.js'; const BIDDER_CODE = 'adman'; const AD_URL = 'https://pub.admanmedia.com/?c=o&m=multi'; @@ -24,8 +24,8 @@ function isBidResponseValid(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -69,7 +69,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; let placements = []; let request = { diff --git a/modules/admixerBidAdapter.js b/modules/admixerBidAdapter.js index bb9a6dd44a3..e136dfcfbdb 100644 --- a/modules/admixerBidAdapter.js +++ b/modules/admixerBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logError } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; @@ -61,7 +61,7 @@ export const spec = { const {body: {ads = []} = {}} = serverResponse; ads.forEach((ad) => bidResponses.push(ad)); } catch (e) { - utils.logError(e); + logError(e); } return bidResponses; }, diff --git a/modules/admixerIdSystem.js b/modules/admixerIdSystem.js index c963f1e5b88..49ffe4f4680 100644 --- a/modules/admixerIdSystem.js +++ b/modules/admixerIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logError, logInfo } from '../src/utils.js' import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import {getStorageManager} from '../src/storageManager.js'; @@ -43,13 +43,13 @@ export const admixerIdSubmodule = { getId(config, consentData) { const {e, p, pid} = (config && config.params) || {}; if (!pid || typeof pid !== 'string') { - utils.logError('admixerId submodule requires partner id to be defined'); + logError('admixerId submodule requires partner id to be defined'); return; } const gdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0; const consentString = gdpr ? consentData.consentString : ''; if (gdpr && !consentString) { - utils.logInfo('Consent string is required to call admixer id.'); + logInfo('Consent string is required to call admixer id.'); return; } const url = `https://inv-nets.admixer.net/cntcm.aspx?ssp=${pid}${e ? `&e=${e}` : ''}${p ? `&p=${p}` : ''}${consentString ? `&cs=${consentString}` : ''}`; @@ -83,7 +83,7 @@ function retrieveVisitorId(url, callback) { } }, error: error => { - utils.logInfo(`admixerId: fetch encountered an error`, error); + logInfo(`admixerId: fetch encountered an error`, error); callback(); } }, undefined, { method: 'GET', withCredentials: true }); diff --git a/modules/adnowBidAdapter.js b/modules/adnowBidAdapter.js index 7412db8d7b6..badf57ed5c9 100644 --- a/modules/adnowBidAdapter.js +++ b/modules/adnowBidAdapter.js @@ -1,6 +1,6 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { NATIVE, BANNER } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { parseSizesInput, deepAccess, parseQueryStringParameters } from '../src/utils.js'; import includes from 'core-js-pure/features/array/includes.js'; const BIDDER_CODE = 'adnow'; @@ -61,13 +61,13 @@ export const spec = { }; if (mediaType === BANNER) { - data.sizes = utils.parseSizesInput( + data.sizes = parseSizesInput( req.mediaTypes && req.mediaTypes.banner && req.mediaTypes.banner.sizes ).join('|') } else { data.width = data.height = 200; - let sizes = utils.deepAccess(req, 'mediaTypes.native.image.sizes', []); + let sizes = deepAccess(req, 'mediaTypes.native.image.sizes', []); if (sizes.length > 0) { const size = Array.isArray(sizes[0]) ? sizes[0] : sizes; @@ -81,7 +81,7 @@ export const spec = { return { method: 'GET', url: ENDPOINT, - data: utils.parseQueryStringParameters(data), + data: parseQueryStringParameters(data), options: { withCredentials: false, crossOrigin: true diff --git a/modules/adnuntiusBidAdapter.js b/modules/adnuntiusBidAdapter.js index 68c3e9caffd..4429e37f091 100644 --- a/modules/adnuntiusBidAdapter.js +++ b/modules/adnuntiusBidAdapter.js @@ -1,6 +1,6 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { isStr, deepAccess } from '../src/utils.js'; import { config } from '../src/config.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -9,12 +9,12 @@ const ENDPOINT_URL = 'https://ads.adnuntius.delivery/i'; const GVLID = 855; const checkSegment = function (segment) { - if (utils.isStr(segment)) return segment; + if (isStr(segment)) return segment; if (segment.id) return segment.id } const getSegmentsFromOrtb = function (ortb2) { - const userData = utils.deepAccess(ortb2, 'user.data'); + const userData = deepAccess(ortb2, 'user.data'); let segments = []; if (userData) { userData.forEach(userdat => { @@ -59,8 +59,8 @@ export const spec = { const usi = getUsi(adnMeta, ortb2, bidderRequest) const segments = getSegmentsFromOrtb(ortb2); const tzo = new Date().getTimezoneOffset(); - const gdprApplies = utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies'); - const consentString = utils.deepAccess(bidderRequest, 'gdprConsent.consentString'); + const gdprApplies = deepAccess(bidderRequest, 'gdprConsent.gdprApplies'); + const consentString = deepAccess(bidderRequest, 'gdprConsent.consentString'); request.push('tzo=' + tzo) request.push('format=json') diff --git a/modules/adoceanBidAdapter.js b/modules/adoceanBidAdapter.js index 7ce9c7ae8f2..0c23f5e3d8a 100644 --- a/modules/adoceanBidAdapter.js +++ b/modules/adoceanBidAdapter.js @@ -1,11 +1,11 @@ -import * as utils from '../src/utils.js'; +import { _each, parseSizesInput, isStr, isArray } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'adocean'; function buildEndpointUrl(emiter, payloadMap) { const payload = []; - utils._each(payloadMap, function(v, k) { + _each(payloadMap, function(v, k) { payload.push(k + '=' + encodeURIComponent(v)); }); @@ -26,12 +26,12 @@ function buildRequest(masterBidRequests, masterId, gdprConsent) { const bidIdMap = {}; - utils._each(masterBidRequests, function(bid, slaveId) { + _each(masterBidRequests, function(bid, slaveId) { if (!emiter) { emiter = bid.params.emiter; } - const slaveSizes = utils.parseSizesInput(bid.mediaTypes.banner.sizes).join('_'); + const slaveSizes = parseSizesInput(bid.mediaTypes.banner.sizes).join('_'); const rawSlaveId = bid.params.slaveId.replace('adocean', ''); payload.aosspsizes.push(rawSlaveId + '~' + slaveSizes); @@ -95,7 +95,7 @@ export const spec = { isBidRequestValid: function(bid) { const requiredParams = ['slaveId', 'masterId', 'emiter']; - if (requiredParams.some(name => !utils.isStr(bid.params[name]) || !bid.params[name].length)) { + if (requiredParams.some(name => !isStr(bid.params[name]) || !bid.params[name].length)) { return false; } @@ -106,12 +106,12 @@ export const spec = { const bidRequestsByMaster = {}; let requests = []; - utils._each(validBidRequests, function(bidRequest) { + _each(validBidRequests, function(bidRequest) { assignToMaster(bidRequest, bidRequestsByMaster); }); - utils._each(bidRequestsByMaster, function(masterRequests, masterId) { - utils._each(masterRequests, function(instanceRequests) { + _each(bidRequestsByMaster, function(masterRequests, masterId) { + _each(masterRequests, function(instanceRequests) { requests.push(buildRequest(instanceRequests, masterId, bidderRequest.gdprConsent)); }); }); @@ -122,8 +122,8 @@ export const spec = { interpretResponse: function(serverResponse, bidRequest) { let bids = []; - if (utils.isArray(serverResponse.body)) { - utils._each(serverResponse.body, function(placementResponse) { + if (isArray(serverResponse.body)) { + _each(serverResponse.body, function(placementResponse) { interpretResponse(placementResponse, bidRequest, bids); }); } diff --git a/modules/adpartnerBidAdapter.js b/modules/adpartnerBidAdapter.js index e8942884a9c..e8d8a43aa1b 100644 --- a/modules/adpartnerBidAdapter.js +++ b/modules/adpartnerBidAdapter.js @@ -1,5 +1,5 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js' +import { buildUrl } from '../src/utils.js' import {ajax} from '../src/ajax.js'; const BIDDER_CODE = 'adpartner'; @@ -64,7 +64,7 @@ export const spec = { beaconParams.tag = beaconParams.tag.join(','); beaconParams.sizes = beaconParams.sizes.join(','); - let adPartnerRequestUrl = utils.buildUrl({ + let adPartnerRequestUrl = buildUrl({ protocol: ENDPOINT_PROTOCOL, hostname: ENDPOINT_DOMAIN, pathname: ENDPOINT_PATH, @@ -127,7 +127,7 @@ export const spec = { onBidWon: function(data) { data.winNotification.forEach(function(unitWon) { - let adPartnerBidWonUrl = utils.buildUrl({ + let adPartnerBidWonUrl = buildUrl({ protocol: ENDPOINT_PROTOCOL, hostname: ENDPOINT_DOMAIN, pathname: unitWon.path diff --git a/modules/adpod.js b/modules/adpod.js index 57baf5b5fc6..ddceed1c344 100644 --- a/modules/adpod.js +++ b/modules/adpod.js @@ -12,7 +12,10 @@ * module that designed to support adpod video type ads. This import process allows this module to effectively act as a sub-module. */ -import * as utils from '../src/utils.js'; +import { + generateUUID, deepAccess, logWarn, logInfo, isArrayOfNums, isArray, isNumber, logError, groupBy, compareOn, + isPlainObject +} from '../src/utils.js'; import { addBidToAuction, doCallbacksIfTimedout, AUCTION_IN_PROGRESS, callPrebidCache, getPriceByGranularity, getPriceGranularity } from '../src/auction.js'; import { checkAdUnitSetup } from '../src/prebid.js'; import { checkVideoBidSetup } from '../src/video.js'; @@ -45,7 +48,7 @@ function createBidCacheRegistry() { registry[auctionId] = {}; registry[auctionId].bidStorage = new Set(); registry[auctionId].queueDispatcher = createDispatcher(queueTimeDelay); - registry[auctionId].initialCacheKey = utils.generateUUID(); + registry[auctionId].initialCacheKey = generateUUID(); } return { @@ -68,7 +71,7 @@ function createBidCacheRegistry() { setupInitialCacheKey: function (bid) { if (!registry[bid.auctionId]) { registry[bid.auctionId] = {}; - registry[bid.auctionId].initialCacheKey = utils.generateUUID(); + registry[bid.auctionId].initialCacheKey = generateUUID(); } }, getInitialCacheKey: function (bid) { @@ -115,9 +118,9 @@ function createDispatcher(timeoutDuration) { function getPricePartForAdpodKey(bid) { let pricePart let prioritizeDeals = config.getConfig('adpod.prioritizeDeals'); - if (prioritizeDeals && utils.deepAccess(bid, 'video.dealTier')) { + if (prioritizeDeals && deepAccess(bid, 'video.dealTier')) { const adpodDealPrefix = config.getConfig(`adpod.dealTier.${bid.bidderCode}.prefix`); - pricePart = (adpodDealPrefix) ? adpodDealPrefix + utils.deepAccess(bid, 'video.dealTier') : utils.deepAccess(bid, 'video.dealTier'); + pricePart = (adpodDealPrefix) ? adpodDealPrefix + deepAccess(bid, 'video.dealTier') : deepAccess(bid, 'video.dealTier'); } else { const granularity = getPriceGranularity(bid.mediaType); pricePart = getPriceByGranularity(granularity)(bid); @@ -132,12 +135,12 @@ function getPricePartForAdpodKey(bid) { */ function attachPriceIndustryDurationKeyToBid(bid, brandCategoryExclusion) { let initialCacheKey = bidCacheRegistry.getInitialCacheKey(bid); - let duration = utils.deepAccess(bid, 'video.durationBucket'); + let duration = deepAccess(bid, 'video.durationBucket'); const pricePart = getPricePartForAdpodKey(bid); let pcd; if (brandCategoryExclusion) { - let category = utils.deepAccess(bid, 'meta.adServerCatId'); + let category = deepAccess(bid, 'meta.adServerCatId'); pcd = `${pricePart}_${category}_${duration}s`; } else { pcd = `${pricePart}_${duration}s`; @@ -168,7 +171,7 @@ function updateBidQueue(auctionInstance, bidResponse, afterBidAdded) { let killQueue = !!(auctionInstance.getAuctionStatus() !== AUCTION_IN_PROGRESS); callDispatcher(auctionInstance, bidListArr, afterBidAdded, killQueue); } else { - utils.logWarn('Attempted to cache a bid from an unknown auction. Bid:', bidResponse); + logWarn('Attempted to cache a bid from an unknown auction. Bid:', bidResponse); } } @@ -196,7 +199,7 @@ function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) { store(bidList, function (error, cacheIds) { if (error) { - utils.logWarn(`Failed to save to the video cache: ${error}. Video bid(s) must be discarded.`); + logWarn(`Failed to save to the video cache: ${error}. Video bid(s) must be discarded.`); for (let i = 0; i < bidList.length; i++) { doCallbacksIfTimedout(auctionInstance, bidList[i]); } @@ -206,7 +209,7 @@ function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) { if (cacheIds[i].uuid !== '') { addBidToAuction(auctionInstance, bidList[i]); } else { - utils.logInfo(`Detected a bid was not cached because the custom key was already registered. Attempted to use key: ${bidList[i].customCacheKey}. Bid was: `, bidList[i]); + logInfo(`Detected a bid was not cached because the custom key was already registered. Attempted to use key: ${bidList[i].customCacheKey}. Bid was: `, bidList[i]); } afterBidAdded(); } @@ -223,12 +226,12 @@ function firePrebidCacheCall(auctionInstance, bidList, afterBidAdded) { * @param {Object} bidderRequest copy of bid's associated bidderRequest object */ export function callPrebidCacheHook(fn, auctionInstance, bidResponse, afterBidAdded, bidderRequest) { - let videoConfig = utils.deepAccess(bidderRequest, 'mediaTypes.video'); + let videoConfig = deepAccess(bidderRequest, 'mediaTypes.video'); if (videoConfig && videoConfig.context === ADPOD) { let brandCategoryExclusion = config.getConfig('adpod.brandCategoryExclusion'); - let adServerCatId = utils.deepAccess(bidResponse, 'meta.adServerCatId'); + let adServerCatId = deepAccess(bidResponse, 'meta.adServerCatId'); if (!adServerCatId && brandCategoryExclusion) { - utils.logWarn('Detected a bid without meta.adServerCatId while setConfig({adpod.brandCategoryExclusion}) was enabled. This bid has been rejected:', bidResponse) + logWarn('Detected a bid without meta.adServerCatId while setConfig({adpod.brandCategoryExclusion}) was enabled. This bid has been rejected:', bidResponse) afterBidAdded(); } else { if (config.getConfig('adpod.deferCaching') === false) { @@ -260,12 +263,12 @@ export function callPrebidCacheHook(fn, auctionInstance, bidResponse, afterBidAd */ export function checkAdUnitSetupHook(fn, adUnits) { let goodAdUnits = adUnits.filter(adUnit => { - let mediaTypes = utils.deepAccess(adUnit, 'mediaTypes'); - let videoConfig = utils.deepAccess(mediaTypes, 'video'); + let mediaTypes = deepAccess(adUnit, 'mediaTypes'); + let videoConfig = deepAccess(mediaTypes, 'video'); if (videoConfig && videoConfig.context === ADPOD) { // run check to see if other mediaTypes are defined (ie multi-format); reject adUnit if so if (Object.keys(mediaTypes).length > 1) { - utils.logWarn(`Detected more than one mediaType in adUnitCode: ${adUnit.code} while attempting to define an 'adpod' video adUnit. 'adpod' adUnits cannot be mixed with other mediaTypes. This adUnit will be removed from the auction.`); + logWarn(`Detected more than one mediaType in adUnitCode: ${adUnit.code} while attempting to define an 'adpod' video adUnit. 'adpod' adUnits cannot be mixed with other mediaTypes. This adUnit will be removed from the auction.`); return false; } @@ -274,20 +277,20 @@ export function checkAdUnitSetupHook(fn, adUnits) { let playerSize = !!( ( videoConfig.playerSize && ( - utils.isArrayOfNums(videoConfig.playerSize, 2) || ( - utils.isArray(videoConfig.playerSize) && videoConfig.playerSize.every(sz => utils.isArrayOfNums(sz, 2)) + isArrayOfNums(videoConfig.playerSize, 2) || ( + isArray(videoConfig.playerSize) && videoConfig.playerSize.every(sz => isArrayOfNums(sz, 2)) ) ) ) || (videoConfig.sizeConfig) ); - let adPodDurationSec = !!(videoConfig.adPodDurationSec && utils.isNumber(videoConfig.adPodDurationSec) && videoConfig.adPodDurationSec > 0); - let durationRangeSec = !!(videoConfig.durationRangeSec && utils.isArrayOfNums(videoConfig.durationRangeSec) && videoConfig.durationRangeSec.every(range => range > 0)); + let adPodDurationSec = !!(videoConfig.adPodDurationSec && isNumber(videoConfig.adPodDurationSec) && videoConfig.adPodDurationSec > 0); + let durationRangeSec = !!(videoConfig.durationRangeSec && isArrayOfNums(videoConfig.durationRangeSec) && videoConfig.durationRangeSec.every(range => range > 0)); if (!playerSize || !adPodDurationSec || !durationRangeSec) { errMsg += (!playerSize) ? '\nmediaTypes.video.playerSize' : ''; errMsg += (!adPodDurationSec) ? '\nmediaTypes.video.adPodDurationSec' : ''; errMsg += (!durationRangeSec) ? '\nmediaTypes.video.durationRangeSec' : ''; - utils.logWarn(errMsg); + logWarn(errMsg); return false; } } @@ -313,8 +316,8 @@ export function checkAdUnitSetupHook(fn, adUnits) { */ function checkBidDuration(bidderRequest, bidResponse) { const buffer = 2; - let bidDuration = utils.deepAccess(bidResponse, 'video.durationSeconds'); - let videoConfig = utils.deepAccess(bidderRequest, 'mediaTypes.video'); + let bidDuration = deepAccess(bidResponse, 'video.durationSeconds'); + let videoConfig = deepAccess(bidderRequest, 'mediaTypes.video'); let adUnitRanges = videoConfig.durationRangeSec; adUnitRanges.sort((a, b) => a - b); // ensure the ranges are sorted in numeric order @@ -324,14 +327,14 @@ function checkBidDuration(bidderRequest, bidResponse) { let nextHighestRange = find(adUnitRanges, range => (range + buffer) >= bidDuration); bidResponse.video.durationBucket = nextHighestRange; } else { - utils.logWarn(`Detected a bid with a duration value outside the accepted ranges specified in adUnit.mediaTypes.video.durationRangeSec. Rejecting bid: `, bidResponse); + logWarn(`Detected a bid with a duration value outside the accepted ranges specified in adUnit.mediaTypes.video.durationRangeSec. Rejecting bid: `, bidResponse); return false; } } else { if (find(adUnitRanges, range => range === bidDuration)) { bidResponse.video.durationBucket = bidDuration; } else { - utils.logWarn(`Detected a bid with a duration value not part of the list of accepted ranges specified in adUnit.mediaTypes.video.durationRangeSec. Exact match durations must be used for this adUnit. Rejecting bid: `, bidResponse); + logWarn(`Detected a bid with a duration value not part of the list of accepted ranges specified in adUnit.mediaTypes.video.durationRangeSec. Exact match durations must be used for this adUnit. Rejecting bid: `, bidResponse); return false; } } @@ -352,16 +355,16 @@ export function checkVideoBidSetupHook(fn, bid, bidRequest, videoMediaType, cont if (context === ADPOD) { let result = true; let brandCategoryExclusion = config.getConfig('adpod.brandCategoryExclusion'); - if (brandCategoryExclusion && !utils.deepAccess(bid, 'meta.primaryCatId')) { + if (brandCategoryExclusion && !deepAccess(bid, 'meta.primaryCatId')) { result = false; } - if (utils.deepAccess(bid, 'video')) { - if (!utils.deepAccess(bid, 'video.context') || bid.video.context !== ADPOD) { + if (deepAccess(bid, 'video')) { + if (!deepAccess(bid, 'video.context') || bid.video.context !== ADPOD) { result = false; } - if (!utils.deepAccess(bid, 'video.durationSeconds') || bid.video.durationSeconds <= 0) { + if (!deepAccess(bid, 'video.durationSeconds') || bid.video.durationSeconds <= 0) { result = false; } else { let isBidGood = checkBidDuration(bidRequest, bid); @@ -370,7 +373,7 @@ export function checkVideoBidSetupHook(fn, bid, bidRequest, videoMediaType, cont } if (!config.getConfig('cache.url') && bid.vastXml && !bid.vastUrl) { - utils.logError(` + logError(` This bid contains only vastXml and will not work when a prebid cache url is not specified. Try enabling prebid cache with pbjs.setConfig({ cache: {url: "..."} }); `); @@ -392,7 +395,7 @@ export function adpodSetConfig(config) { if (typeof config.bidQueueTimeDelay === 'number' && config.bidQueueTimeDelay > 0) { queueTimeDelay = config.bidQueueTimeDelay; } else { - utils.logWarn(`Detected invalid value for adpod.bidQueueTimeDelay in setConfig; must be a positive number. Using default: ${queueTimeDelay}`) + logWarn(`Detected invalid value for adpod.bidQueueTimeDelay in setConfig; must be a positive number. Using default: ${queueTimeDelay}`) } } @@ -400,7 +403,7 @@ export function adpodSetConfig(config) { if (typeof config.bidQueueSizeLimit === 'number' && config.bidQueueSizeLimit > 0) { queueSizeLimit = config.bidQueueSizeLimit; } else { - utils.logWarn(`Detected invalid value for adpod.bidQueueSizeLimit in setConfig; must be a positive number. Using default: ${queueSizeLimit}`) + logWarn(`Detected invalid value for adpod.bidQueueSizeLimit in setConfig; must be a positive number. Using default: ${queueSizeLimit}`) } } } @@ -464,7 +467,7 @@ export function sortByPricePerSecond(a, b) { */ export function getTargeting({ codes, callback } = {}) { if (!callback) { - utils.logError('No callback function was defined in the getTargeting call. Aborting getTargeting().'); + logError('No callback function was defined in the getTargeting call. Aborting getTargeting().'); return; } codes = codes || []; @@ -480,7 +483,7 @@ export function getTargeting({ codes, callback } = {}) { let prioritizeDeals = config.getConfig('adpod.prioritizeDeals'); if (prioritizeDeals) { let [otherBids, highPriorityDealBids] = bids.reduce((partitions, bid) => { - let bidDealTier = utils.deepAccess(bid, 'video.dealTier'); + let bidDealTier = deepAccess(bid, 'video.dealTier'); let minDealTier = config.getConfig(`adpod.dealTier.${bid.bidderCode}.minDealTier`); if (minDealTier && bidDealTier) { if (bidDealTier >= minDealTier) { @@ -506,7 +509,7 @@ export function getTargeting({ codes, callback } = {}) { if (deferCachingEnabled === false) { adPodAdUnits.forEach((adUnit) => { let adPodTargeting = []; - let adPodDurationSeconds = utils.deepAccess(adUnit, 'mediaTypes.video.adPodDurationSec'); + let adPodDurationSeconds = deepAccess(adUnit, 'mediaTypes.video.adPodDurationSec'); bids .filter((bid) => bid.adUnitCode === adUnit.code) @@ -530,7 +533,7 @@ export function getTargeting({ codes, callback } = {}) { } else { let bidsToCache = []; adPodAdUnits.forEach((adUnit) => { - let adPodDurationSeconds = utils.deepAccess(adUnit, 'mediaTypes.video.adPodDurationSec'); + let adPodDurationSeconds = deepAccess(adUnit, 'mediaTypes.video.adPodDurationSec'); bids .filter((bid) => bid.adUnitCode === adUnit.code) @@ -546,7 +549,7 @@ export function getTargeting({ codes, callback } = {}) { if (error) { callback(error, null); } else { - let groupedBids = utils.groupBy(bidsSuccessfullyCached, 'adUnitCode'); + let groupedBids = groupBy(bidsSuccessfullyCached, 'adUnitCode'); Object.keys(groupedBids).forEach((adUnitCode) => { let adPodTargeting = []; @@ -578,7 +581,7 @@ export function getTargeting({ codes, callback } = {}) { */ function getAdPodAdUnits(codes) { return auctionManager.getAdUnits() - .filter((adUnit) => utils.deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD) + .filter((adUnit) => deepAccess(adUnit, 'mediaTypes.video.context') === ADPOD) .filter((adUnit) => (codes.length > 0) ? codes.indexOf(adUnit.code) != -1 : true); } @@ -590,10 +593,10 @@ function getAdPodAdUnits(codes) { function getExclusiveBids(bidsReceived) { let bids = bidsReceived .map((bid) => Object.assign({}, bid, { [TARGETING_KEY_PB_CAT_DUR]: bid.adserverTargeting[TARGETING_KEY_PB_CAT_DUR] })); - bids = utils.groupBy(bids, TARGETING_KEY_PB_CAT_DUR); + bids = groupBy(bids, TARGETING_KEY_PB_CAT_DUR); let filteredBids = []; Object.keys(bids).forEach((targetingKey) => { - bids[targetingKey].sort(utils.compareOn('responseTimestamp')); + bids[targetingKey].sort(compareOn('responseTimestamp')); filteredBids.push(bids[targetingKey][0]); }); return filteredBids; @@ -619,8 +622,8 @@ const sharedMethods = { Object.freeze(sharedMethods); module('adpod', function shareAdpodUtilities(...args) { - if (!utils.isPlainObject(args[0])) { - utils.logError('Adpod module needs plain object to share methods with submodule'); + if (!isPlainObject(args[0])) { + logError('Adpod module needs plain object to share methods with submodule'); return; } function addMethods(object, func) { diff --git a/modules/adprimeBidAdapter.js b/modules/adprimeBidAdapter.js index ef370301184..2b5a7e15af2 100644 --- a/modules/adprimeBidAdapter.js +++ b/modules/adprimeBidAdapter.js @@ -1,6 +1,6 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { isFn, deepAccess, logMessage } from '../src/utils.js'; const BIDDER_CODE = 'adprime'; const AD_URL = 'https://delta.adprime.com/pbjs'; @@ -24,8 +24,8 @@ function isBidResponseValid(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -56,7 +56,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; let placements = []; let request = { diff --git a/modules/adqueryBidAdapter.js b/modules/adqueryBidAdapter.js index bbff7edea47..ce31f64d705 100644 --- a/modules/adqueryBidAdapter.js +++ b/modules/adqueryBidAdapter.js @@ -1,6 +1,6 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER} from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { logInfo, buildUrl, triggerPixel } from '../src/utils.js'; import { getStorageManager } from '../src/storageManager.js'; const ADQUERY_GVLID = 902; @@ -55,8 +55,8 @@ export const spec = { * @return {Bid[]} */ interpretResponse: (response, request) => { - utils.logInfo(request); - utils.logInfo(response); + logInfo(request); + logInfo(response); const res = response && response.body && response.body.data; let bidResponses = []; @@ -84,7 +84,7 @@ export const spec = { } }; bidResponses.push(bidResponse); - utils.logInfo('bidResponses', bidResponses); + logInfo('bidResponses', bidResponses); return bidResponses; }, @@ -96,7 +96,7 @@ export const spec = { if (timeoutData == null) { return; } - utils.logInfo('onTimeout ', timeoutData); + logInfo('onTimeout ', timeoutData); let params = { bidder: timeoutData.bidder, bId: timeoutData.bidId, @@ -104,40 +104,40 @@ export const spec = { timeout: timeoutData.timeout, auctionId: timeoutData.auctionId, }; - let adqueryRequestUrl = utils.buildUrl({ + let adqueryRequestUrl = buildUrl({ protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, hostname: ADQUERY_BIDDER_DOMAIN, pathname: '/prebid/eventTimeout', search: params }); - utils.triggerPixel(adqueryRequestUrl); + triggerPixel(adqueryRequestUrl); }, /** * @param {Bid} bid */ onBidWon: (bid) => { - utils.logInfo('onBidWon', bid); + logInfo('onBidWon', bid); const bidString = JSON.stringify(bid); const encodedBuf = window.btoa(bidString); let params = { q: encodedBuf, }; - let adqueryRequestUrl = utils.buildUrl({ + let adqueryRequestUrl = buildUrl({ protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, hostname: ADQUERY_BIDDER_DOMAIN, pathname: '/prebid/eventBidWon', search: params }); - utils.triggerPixel(adqueryRequestUrl); + triggerPixel(adqueryRequestUrl); }, /** * @param {Bid} bid */ onSetTargeting: (bid) => { - utils.logInfo('onSetTargeting', bid); + logInfo('onSetTargeting', bid); let params = { bidder: bid.bidder, @@ -150,13 +150,13 @@ export const spec = { adUnitCode: bid.adUnitCode }; - let adqueryRequestUrl = utils.buildUrl({ + let adqueryRequestUrl = buildUrl({ protocol: ADQUERY_BIDDER_DOMAIN_PROTOCOL, hostname: ADQUERY_BIDDER_DOMAIN, pathname: '/prebid/eventSetTargeting', search: params }); - utils.triggerPixel(adqueryRequestUrl); + triggerPixel(adqueryRequestUrl); }, getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { let syncUrl = ADQUERY_USER_SYNC_DOMAIN; diff --git a/modules/adrelevantisBidAdapter.js b/modules/adrelevantisBidAdapter.js index b6832cfeb0d..649031d1e3b 100644 --- a/modules/adrelevantisBidAdapter.js +++ b/modules/adrelevantisBidAdapter.js @@ -1,5 +1,8 @@ import { Renderer } from '../src/Renderer.js'; -import * as utils from '../src/utils.js'; +import { + logError, convertTypes, convertCamelToUnderscore, isArray, deepClone, logWarn, logMessage, getBidRequest, deepAccess, + isStr, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, chunk, isArrayOfNums +} from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; @@ -145,7 +148,7 @@ export const spec = { if (!serverResponse || serverResponse.error) { let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`; if (serverResponse && serverResponse.error) { errorMessage += `: ${serverResponse.error}`; } - utils.logError(errorMessage); + logError(errorMessage); return bids; } @@ -166,9 +169,9 @@ export const spec = { }, transformBidParams: function(params, isOpenRtb) { - params = utils.convertTypes({ + params = convertTypes({ 'placementId': 'number', - 'keywords': utils.transformBidderParamKeywords + 'keywords': transformBidderParamKeywords }, params); if (isOpenRtb) { @@ -180,7 +183,7 @@ export const spec = { } Object.keys(params).forEach(paramKey => { - let convertedKey = utils.convertCamelToUnderscore(paramKey); + let convertedKey = convertCamelToUnderscore(paramKey); if (convertedKey !== paramKey) { params[convertedKey] = params[paramKey]; delete params[paramKey]; @@ -193,7 +196,7 @@ export const spec = { } function isPopulatedArray(arr) { - return !!(utils.isArray(arr) && arr.length > 0); + return !!(isArray(arr) && arr.length > 0); } function deleteValues(keyPairObj) { @@ -206,9 +209,9 @@ function formatRequest(payload, bidderRequest) { let request = []; if (payload.tags.length > MAX_IMPS_PER_REQUEST) { - const clonedPayload = utils.deepClone(payload); + const clonedPayload = deepClone(payload); - utils.chunk(payload.tags, MAX_IMPS_PER_REQUEST).forEach(tags => { + chunk(payload.tags, MAX_IMPS_PER_REQUEST).forEach(tags => { clonedPayload.tags = tags; const payloadString = JSON.stringify(clonedPayload); request.push({ @@ -243,14 +246,14 @@ function newRenderer(adUnitCode, rtbBid, rendererOptions = {}) { try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } renderer.setEventHandlers({ - impression: () => utils.logMessage('AdRelevantis outstream video impression event'), - loaded: () => utils.logMessage('AdRelevantis outstream video loaded event'), + impression: () => logMessage('AdRelevantis outstream video impression event'), + loaded: () => logMessage('AdRelevantis outstream video loaded event'), ended: () => { - utils.logMessage('AdRelevantis outstream renderer video event'); + logMessage('AdRelevantis outstream renderer video event'); document.querySelector(`#${adUnitCode}`).style.display = 'none'; } }); @@ -295,7 +298,7 @@ function handleOutstreamRendererEvents(bid, id, eventName) { * @return Bid */ function newBid(serverBid, rtbBid, bidderRequest) { - const bidRequest = utils.getBidRequest(serverBid.uuid, [bidderRequest]); + const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]); const bid = { requestId: serverBid.uuid, cpm: rtbBid.cpm, @@ -324,7 +327,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { ttl: 3600 }); - const videoContext = utils.deepAccess(bidRequest, 'mediaTypes.video.context'); + const videoContext = deepAccess(bidRequest, 'mediaTypes.video.context'); switch (videoContext) { case OUTSTREAM: bid.adResponse = serverBid; @@ -334,7 +337,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { if (rtbBid.renderer_url) { const videoBid = find(bidderRequest.bids, bid => bid.bidId === serverBid.uuid); - const rendererOptions = utils.deepAccess(videoBid, 'renderer.options'); + const rendererOptions = deepAccess(videoBid, 'renderer.options'); bid.renderer = newRenderer(bid.adUnitCode, rtbBid, rendererOptions); } break; @@ -354,7 +357,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { if (jsTrackers == undefined) { jsTrackers = jsTrackerDisarmed; - } else if (utils.isStr(jsTrackers)) { + } else if (isStr(jsTrackers)) { jsTrackers = [jsTrackers, jsTrackerDisarmed]; } else { jsTrackers.push(jsTrackerDisarmed); @@ -402,10 +405,10 @@ function newBid(serverBid, rtbBid, bidderRequest) { }); try { const url = rtbBid.rtb.trackers[0].impression_urls[0]; - const tracker = utils.createTrackPixelHtml(url); + const tracker = createTrackPixelHtml(url); bid.ad += tracker; } catch (error) { - utils.logError('Error appending tracking pixel', error); + logError('Error appending tracking pixel', error); } } @@ -449,8 +452,8 @@ function bidToTag(bid) { if (bid.params.externalImpId) { tag.external_imp_id = bid.params.externalImpId; } - if (!utils.isEmpty(bid.params.keywords)) { - let keywords = utils.transformBidderParamKeywords(bid.params.keywords); + if (!isEmpty(bid.params.keywords)) { + let keywords = transformBidderParamKeywords(bid.params.keywords); if (keywords.length > 0) { keywords.forEach(deleteValues); @@ -461,7 +464,7 @@ function bidToTag(bid) { tag.category = bid.params.category; } - if (bid.mediaType === NATIVE || utils.deepAccess(bid, `mediaTypes.${NATIVE}`)) { + if (bid.mediaType === NATIVE || deepAccess(bid, `mediaTypes.${NATIVE}`)) { tag.ad_types.push(NATIVE); if (tag.sizes.length === 0) { tag.sizes = transformSizes([1, 1]); @@ -473,8 +476,8 @@ function bidToTag(bid) { } } - const videoMediaType = utils.deepAccess(bid, `mediaTypes.${VIDEO}`); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const videoMediaType = deepAccess(bid, `mediaTypes.${VIDEO}`); + const context = deepAccess(bid, 'mediaTypes.video.context'); tag.hb_source = 1; if (bid.mediaType === VIDEO || videoMediaType) { @@ -499,7 +502,7 @@ function bidToTag(bid) { } if ( - (utils.isEmpty(bid.mediaType) && utils.isEmpty(bid.mediaTypes)) || + (isEmpty(bid.mediaType) && isEmpty(bid.mediaTypes)) || (bid.mediaType === BANNER || (bid.mediaTypes && bid.mediaTypes[BANNER])) ) { tag.ad_types.push(BANNER); @@ -513,8 +516,8 @@ function transformSizes(requestSizes) { let sizes = []; let sizeObj = {}; - if (utils.isArray(requestSizes) && requestSizes.length === 2 && - !utils.isArray(requestSizes[0])) { + if (isArray(requestSizes) && requestSizes.length === 2 && + !isArray(requestSizes[0])) { sizeObj.width = parseInt(requestSizes[0], 10); sizeObj.height = parseInt(requestSizes[1], 10); sizes.push(sizeObj); @@ -575,7 +578,7 @@ function buildNativeRequest(params) { const isImageAsset = !!(requestKey === NATIVE_MAPPING.image.serverName || requestKey === NATIVE_MAPPING.icon.serverName); if (isImageAsset && request[requestKey].sizes) { let sizes = request[requestKey].sizes; - if (utils.isArrayOfNums(sizes) || (utils.isArray(sizes) && sizes.length > 0 && sizes.every(sz => utils.isArrayOfNums(sz)))) { + if (isArrayOfNums(sizes) || (isArray(sizes) && sizes.length > 0 && sizes.every(sz => isArrayOfNums(sz)))) { request[requestKey].sizes = transformSizes(request[requestKey].sizes); } } From faf00c7643d069e325212e9f63aeb3c906208b71 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 27 Sep 2021 11:10:13 -0700 Subject: [PATCH 094/250] Multiple Bid/Analytics Adapters : import utils functions as needed, not whole module (#7469) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils as needed; dont import all * import utils as needed; dont import all --- modules/33acrossBidAdapter.js | 43 ++++--- modules/a4gBidAdapter.js | 6 +- modules/ablidaBidAdapter.js | 4 +- modules/adagioAnalyticsAdapter.js | 8 +- modules/adagioBidAdapter.js | 167 +++++++++++++------------ modules/adbookpspBidAdapter.js | 110 ++++++++-------- modules/adfBidAdapter.js | 30 ++--- modules/adgenerationBidAdapter.js | 30 ++--- modules/adkernelAdnAnalyticsAdapter.js | 12 +- modules/adkernelAdnBidAdapter.js | 46 +++---- 10 files changed, 232 insertions(+), 224 deletions(-) diff --git a/modules/33acrossBidAdapter.js b/modules/33acrossBidAdapter.js index 4b8028d97fd..2bdbdd6414b 100644 --- a/modules/33acrossBidAdapter.js +++ b/modules/33acrossBidAdapter.js @@ -1,6 +1,9 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; +import { + deepAccess, uniques, isArray, getWindowTop, isGptPubadsDefined, isSlotMatchingAdUnitCode, logInfo, logWarn, + getWindowSelf +} from '../src/utils.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; const BIDDER_CODE = '33across'; @@ -61,7 +64,7 @@ function _validateBasic(bid) { } function _validateGUID(bid) { - const siteID = utils.deepAccess(bid, 'params.siteId', '') || ''; + const siteID = deepAccess(bid, 'params.siteId', '') || ''; if (siteID.trim().match(GUID_PATTERN) === null) { return false; } @@ -70,7 +73,7 @@ function _validateGUID(bid) { } function _validateBanner(bid) { - const banner = utils.deepAccess(bid, 'mediaTypes.banner'); + const banner = deepAccess(bid, 'mediaTypes.banner'); // If there's no banner no need to validate against banner rules if (banner === undefined) { return true; @@ -84,8 +87,8 @@ function _validateBanner(bid) { } function _validateVideo(bid) { - const videoAdUnit = utils.deepAccess(bid, 'mediaTypes.video'); - const videoBidderParams = utils.deepAccess(bid, 'params.video', {}); + const videoAdUnit = deepAccess(bid, 'mediaTypes.video'); + const videoBidderParams = deepAccess(bid, 'params.video', {}); // If there's no video no need to validate against video rules if (videoAdUnit === undefined) { @@ -145,7 +148,7 @@ function buildRequests(bidRequests, bidderRequest) { const uspConsent = bidderRequest && bidderRequest.uspConsent; const pageUrl = (bidderRequest && bidderRequest.refererInfo) ? (bidderRequest.refererInfo.referer) : (undefined); - adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(utils.uniques); + adapterState.uniqueSiteIds = bidRequests.map(req => req.params.siteId).filter(uniques); return bidRequests.map(bidRequest => _createServerRequest( { @@ -168,13 +171,13 @@ function _createServerRequest({bidRequest, gdprConsent = {}, uspConsent, pageUrl */ ttxRequest.imp = [{}]; - if (utils.deepAccess(bidRequest, 'mediaTypes.banner')) { + if (deepAccess(bidRequest, 'mediaTypes.banner')) { ttxRequest.imp[0].banner = { ..._buildBannerORTB(bidRequest) } } - if (utils.deepAccess(bidRequest, 'mediaTypes.video')) { + if (deepAccess(bidRequest, 'mediaTypes.video')) { ttxRequest.imp[0].video = _buildVideoORTB(bidRequest); } @@ -279,7 +282,7 @@ function setExtension(obj = {}, key, value) { // BUILD REQUESTS: SIZE INFERENCE function _transformSizes(sizes) { - if (utils.isArray(sizes) && sizes.length === 2 && !utils.isArray(sizes[0])) { + if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) { return [ _getSize(sizes) ]; } @@ -308,7 +311,7 @@ function _getProduct(bidRequest) { // BUILD REQUESTS: BANNER function _buildBannerORTB(bidRequest) { - const bannerAdUnit = utils.deepAccess(bidRequest, 'mediaTypes.banner', {}); + const bannerAdUnit = deepAccess(bidRequest, 'mediaTypes.banner', {}); const element = _getAdSlotHTMLElement(bidRequest.adUnitCode); const sizes = _transformSizes(bannerAdUnit.sizes); @@ -340,7 +343,7 @@ function _buildBannerORTB(bidRequest) { const minSize = _getMinSize(sizes); const viewabilityAmount = _isViewabilityMeasurable(element) - ? _getViewability(element, utils.getWindowTop(), minSize) + ? _getViewability(element, getWindowTop(), minSize) : NON_MEASURABLE; const ext = contributeViewability(viewabilityAmount); @@ -354,8 +357,8 @@ function _buildBannerORTB(bidRequest) { // BUILD REQUESTS: VIDEO // eslint-disable-next-line no-unused-vars function _buildVideoORTB(bidRequest) { - const videoAdUnit = utils.deepAccess(bidRequest, 'mediaTypes.video', {}); - const videoBidderParams = utils.deepAccess(bidRequest, 'params.video', {}); + const videoAdUnit = deepAccess(bidRequest, 'mediaTypes.video', {}); + const videoBidderParams = deepAccess(bidRequest, 'params.video', {}); const videoParams = { ...videoAdUnit, @@ -429,23 +432,23 @@ function _getViewability(element, topWin, { w, h } = {}) { } function _mapAdUnitPathToElementId(adUnitCode) { - if (utils.isGptPubadsDefined()) { + if (isGptPubadsDefined()) { // eslint-disable-next-line no-undef const adSlots = googletag.pubads().getSlots(); - const isMatchingAdSlot = utils.isSlotMatchingAdUnitCode(adUnitCode); + const isMatchingAdSlot = isSlotMatchingAdUnitCode(adUnitCode); for (let i = 0; i < adSlots.length; i++) { if (isMatchingAdSlot(adSlots[i])) { const id = adSlots[i].getSlotElementId(); - utils.logInfo(`[33Across Adapter] Map ad unit path to HTML element id: '${adUnitCode}' -> ${id}`); + logInfo(`[33Across Adapter] Map ad unit path to HTML element id: '${adUnitCode}' -> ${id}`); return id; } } } - utils.logWarn(`[33Across Adapter] Unable to locate element for ad unit code: '${adUnitCode}'`); + logWarn(`[33Across Adapter] Unable to locate element for ad unit code: '${adUnitCode}'`); return null; } @@ -546,7 +549,7 @@ function contributeViewability(viewabilityAmount) { function _isIframe() { try { - return utils.getWindowSelf() !== utils.getWindowTop(); + return getWindowSelf() !== getWindowTop(); } catch (e) { return true; } @@ -579,7 +582,7 @@ function _createBidResponse(response) { ad: response.seatbid[0].bid[0].adm, ttl: response.seatbid[0].bid[0].ttl || 60, creativeId: response.seatbid[0].bid[0].crid, - mediaType: utils.deepAccess(response.seatbid[0].bid[0], 'ext.ttx.mediaType', BANNER), + mediaType: deepAccess(response.seatbid[0].bid[0], 'ext.ttx.mediaType', BANNER), currency: response.cur, netRevenue: true } @@ -591,7 +594,7 @@ function _createBidResponse(response) { } if (bid.mediaType === VIDEO) { - const vastType = utils.deepAccess(response.seatbid[0].bid[0], 'ext.ttx.vastType', 'xml'); + const vastType = deepAccess(response.seatbid[0].bid[0], 'ext.ttx.vastType', 'xml'); if (vastType === 'xml') { bid.vastXml = bid.ad; diff --git a/modules/a4gBidAdapter.js b/modules/a4gBidAdapter.js index 01c59616dc0..03f9d6fd726 100644 --- a/modules/a4gBidAdapter.js +++ b/modules/a4gBidAdapter.js @@ -1,5 +1,5 @@ import {registerBidder} from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; +import { _each } from '../src/utils.js'; const A4G_BIDDER_CODE = 'a4g'; const A4G_CURRENCY = 'USD'; @@ -28,7 +28,7 @@ export const spec = { const sizeParams = []; const zoneIds = []; - utils._each(validBidRequests, function(bid) { + _each(validBidRequests, function(bid) { if (!deliveryUrl && typeof bid.params.deliveryUrl === 'string') { deliveryUrl = bid.params.deliveryUrl; } @@ -66,7 +66,7 @@ export const spec = { interpretResponse: function(serverResponses, request) { const bidResponses = []; - utils._each(serverResponses.body, function(response) { + _each(serverResponses.body, function(response) { if (response.cpm > 0) { const bidResponse = { requestId: response.id, diff --git a/modules/ablidaBidAdapter.js b/modules/ablidaBidAdapter.js index 2400952367f..cb4f4ef2724 100644 --- a/modules/ablidaBidAdapter.js +++ b/modules/ablidaBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { triggerPixel } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; @@ -79,7 +79,7 @@ export const spec = { }, onBidWon: function (bid) { if (!bid['nurl']) { return; } - utils.triggerPixel(bid['nurl']); + triggerPixel(bid['nurl']); } }; diff --git a/modules/adagioAnalyticsAdapter.js b/modules/adagioAnalyticsAdapter.js index fd7a742d9e7..f929f7e660b 100644 --- a/modules/adagioAnalyticsAdapter.js +++ b/modules/adagioAnalyticsAdapter.js @@ -5,7 +5,7 @@ import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; +import { getWindowTop } from '../src/utils.js'; const emptyUrl = ''; const analyticsType = 'endpoint'; @@ -13,12 +13,12 @@ const events = Object.keys(CONSTANTS.EVENTS).map(key => CONSTANTS.EVENTS[key]); const VERSION = '2.0.0'; const adagioEnqueue = function adagioEnqueue(action, data) { - utils.getWindowTop().ADAGIO.queue.push({ action, data, ts: Date.now() }); + getWindowTop().ADAGIO.queue.push({ action, data, ts: Date.now() }); } function canAccessTopWindow() { try { - if (utils.getWindowTop().location.href) { + if (getWindowTop().location.href) { return true; } } catch (error) { @@ -41,7 +41,7 @@ adagioAdapter.enableAnalytics = config => { return; } - const w = utils.getWindowTop(); + const w = getWindowTop(); w.ADAGIO = w.ADAGIO || {}; w.ADAGIO.queue = w.ADAGIO.queue || []; diff --git a/modules/adagioBidAdapter.js b/modules/adagioBidAdapter.js index ffa955290be..264cf5f9fcb 100644 --- a/modules/adagioBidAdapter.js +++ b/modules/adagioBidAdapter.js @@ -1,5 +1,8 @@ import find from 'core-js-pure/features/array/find.js'; -import * as utils from '../src/utils.js'; +import { + isInteger, isArray, deepAccess, mergeDeep, logWarn, logInfo, logError, getWindowTop, getWindowSelf, generateUUID, _map, + getDNT, parseUrl, getUniqueIdentifierStr, isNumber, cleanObj, isFn, inIframe, deepClone, getGptSlotInfoForAdUnitCode +} from '../src/utils.js'; import { config } from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { loadExternalScript } from '../src/adloader.js'; @@ -31,22 +34,22 @@ const DEFAULT_FLOOR = 0.1; // https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf export const ORTB_VIDEO_PARAMS = { 'mimes': (value) => Array.isArray(value) && value.length > 0 && value.every(v => typeof v === 'string'), - 'minduration': (value) => utils.isInteger(value), - 'maxduration': (value) => utils.isInteger(value), + 'minduration': (value) => isInteger(value), + 'maxduration': (value) => isInteger(value), 'protocols': (value) => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].indexOf(v) !== -1), - 'w': (value) => utils.isInteger(value), - 'h': (value) => utils.isInteger(value), - 'startdelay': (value) => utils.isInteger(value), + 'w': (value) => isInteger(value), + 'h': (value) => isInteger(value), + 'startdelay': (value) => isInteger(value), 'placement': (value) => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5].indexOf(v) !== -1), 'linearity': (value) => [1, 2].indexOf(value) !== -1, 'skip': (value) => [0, 1].indexOf(value) !== -1, - 'skipmin': (value) => utils.isInteger(value), - 'skipafter': (value) => utils.isInteger(value), - 'sequence': (value) => utils.isInteger(value), + 'skipmin': (value) => isInteger(value), + 'skipafter': (value) => isInteger(value), + 'sequence': (value) => isInteger(value), 'battr': (value) => Array.isArray(value) && value.every(v => Array.from({length: 17}, (_, i) => i + 1).indexOf(v) !== -1), - 'maxextended': (value) => utils.isInteger(value), - 'minbitrate': (value) => utils.isInteger(value), - 'maxbitrate': (value) => utils.isInteger(value), + 'maxextended': (value) => isInteger(value), + 'minbitrate': (value) => isInteger(value), + 'maxbitrate': (value) => isInteger(value), 'boxingallowed': (value) => [0, 1].indexOf(value) !== -1, 'playbackmethod': (value) => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1), 'playbackend': (value) => [1, 2, 3].indexOf(value) !== -1, @@ -88,7 +91,7 @@ export const GlobalExchange = (function() { return value; } }); - let random = utils.deepAccess(adagioStorage, 'session.rnd'); + let random = deepAccess(adagioStorage, 'session.rnd'); let newSession = false; if (internal.isNewSession(adagioStorage)) { @@ -103,7 +106,7 @@ export const GlobalExchange = (function() { } } - utils.mergeDeep(exchangeData, adagioStorage, data); + mergeDeep(exchangeData, adagioStorage, data); internal.enqueue({ action: 'session', @@ -121,14 +124,14 @@ export const GlobalExchange = (function() { export function adagioScriptFromLocalStorageCb(ls) { try { if (!ls) { - utils.logWarn(`${LOG_PREFIX} script not found.`); + logWarn(`${LOG_PREFIX} script not found.`); return; } const hashRgx = /^(\/\/ hash: (.+)\n)(.+\n)$/; if (!hashRgx.test(ls)) { - utils.logWarn(`${LOG_PREFIX} no hash found.`); + logWarn(`${LOG_PREFIX} no hash found.`); storage.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY); } else { const r = ls.match(hashRgx); @@ -136,15 +139,15 @@ export function adagioScriptFromLocalStorageCb(ls) { const content = r[3]; if (verify(content, hash, ADAGIO_PUBKEY, ADAGIO_PUBKEY_E)) { - utils.logInfo(`${LOG_PREFIX} start script.`); + logInfo(`${LOG_PREFIX} start script.`); Function(ls)(); // eslint-disable-line no-new-func } else { - utils.logWarn(`${LOG_PREFIX} invalid script found.`); + logWarn(`${LOG_PREFIX} invalid script found.`); storage.removeDataFromLocalStorage(ADAGIO_LOCALSTORAGE_KEY); } } } catch (err) { - utils.logError(LOG_PREFIX, err); + logError(LOG_PREFIX, err); } } @@ -167,7 +170,7 @@ export function getAdagioScript() { // This key is removed only if localStorage is not accessible. window.localStorage.removeItem('adagio'); } catch (e) { - utils.logInfo(`${LOG_PREFIX} unable to clear Adagio scripts from localstorage.`); + logInfo(`${LOG_PREFIX} unable to clear Adagio scripts from localstorage.`); } } }); @@ -175,7 +178,7 @@ export function getAdagioScript() { function canAccessTopWindow() { try { - if (utils.getWindowTop().location.href) { + if (getWindowTop().location.href) { return true; } } catch (error) { @@ -184,17 +187,17 @@ function canAccessTopWindow() { } function getCurrentWindow() { - return currentWindow || utils.getWindowSelf(); + return currentWindow || getWindowSelf(); } function isSafeFrameWindow() { - const ws = utils.getWindowSelf(); + const ws = getWindowSelf(); return !!(ws.$sf && ws.$sf.ext); } function initAdagio() { if (canAccessTopWindow()) { - currentWindow = (canAccessTopWindow()) ? utils.getWindowTop() : utils.getWindowSelf(); + currentWindow = (canAccessTopWindow()) ? getWindowTop() : getWindowSelf(); } const w = internal.getCurrentWindow(); @@ -211,7 +214,7 @@ function initAdagio() { try { GlobalExchange.prepareExchangeData(storageData); } catch (e) { - utils.logError(LOG_PREFIX, e); + logError(LOG_PREFIX, e); } }); @@ -230,7 +233,7 @@ function getPageviewId() { const w = internal.getCurrentWindow(); w.ADAGIO = w.ADAGIO || {}; - w.ADAGIO.pageviewId = w.ADAGIO.pageviewId || utils.generateUUID(); + w.ADAGIO.pageviewId = w.ADAGIO.pageviewId || generateUUID(); return w.ADAGIO.pageviewId; }; @@ -240,7 +243,7 @@ function getDevice() { return { userAgent: navigator.userAgent, language: navigator[language], - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, geo: {}, js: 1 }; @@ -254,12 +257,12 @@ function getSite(bidderRequest) { const { refererInfo } = bidderRequest; if (canAccessTopWindow()) { - const wt = utils.getWindowTop(); + const wt = getWindowTop(); domain = wt.location.hostname; page = wt.location.href; referrer = wt.document.referrer || ''; } else if (refererInfo.reachedTop) { - const url = utils.parseUrl(refererInfo.referer); + const url = parseUrl(refererInfo.referer); domain = url.hostname; page = refererInfo.referer; } else if (refererInfo.stack && refererInfo.stack.length && refererInfo.stack[0]) { @@ -267,7 +270,7 @@ function getSite(bidderRequest) { // will be considered as "localhost" by the parseUrl function. // As the isBidRequestValid returns false when it does not reach the referer // this should never called. - const url = utils.parseUrl(refererInfo.stack[0]); + const url = parseUrl(refererInfo.stack[0]); domain = url.hostname; } @@ -280,9 +283,9 @@ function getSite(bidderRequest) { function getElementFromTopWindow(element, currentWindow) { try { - if (utils.getWindowTop() === currentWindow) { + if (getWindowTop() === currentWindow) { if (!element.getAttribute('id')) { - element.setAttribute('id', `adg-${utils.getUniqueIdentifierStr()}`); + element.setAttribute('id', `adg-${getUniqueIdentifierStr()}`); } return element; } else { @@ -297,13 +300,13 @@ function getElementFromTopWindow(element, currentWindow) { return getElementFromTopWindow(frame, currentWindow.parent); } } catch (err) { - utils.logWarn(`${LOG_PREFIX}`, err); + logWarn(`${LOG_PREFIX}`, err); return false; } }; function autoDetectAdUnitElementIdFromGpt(adUnitCode) { - const autoDetectedAdUnit = utils.getGptSlotInfoForAdUnitCode(adUnitCode); + const autoDetectedAdUnit = getGptSlotInfoForAdUnitCode(adUnitCode); if (autoDetectedAdUnit && autoDetectedAdUnit.divId) { return autoDetectedAdUnit.divId; @@ -312,11 +315,11 @@ function autoDetectAdUnitElementIdFromGpt(adUnitCode) { function isRendererPreferredFromPublisher(bidRequest) { // renderer defined at adUnit level - const adUnitRenderer = utils.deepAccess(bidRequest, 'renderer'); + const adUnitRenderer = deepAccess(bidRequest, 'renderer'); const hasValidAdUnitRenderer = !!(adUnitRenderer && adUnitRenderer.url && adUnitRenderer.render); // renderer defined at adUnit.mediaTypes level - const mediaTypeRenderer = utils.deepAccess(bidRequest, 'mediaTypes.video.renderer'); + const mediaTypeRenderer = deepAccess(bidRequest, 'mediaTypes.video.renderer'); const hasValidMediaTypeRenderer = !!(mediaTypeRenderer && mediaTypeRenderer.url && mediaTypeRenderer.render); return !!( @@ -332,10 +335,10 @@ function isRendererPreferredFromPublisher(bidRequest) { */ function isNewSession(adagioStorage) { const now = Date.now(); - const { lastActivityTime, vwSmplg } = utils.deepAccess(adagioStorage, 'session', {}); + const { lastActivityTime, vwSmplg } = deepAccess(adagioStorage, 'session', {}); return ( - !utils.isNumber(lastActivityTime) || - !utils.isNumber(vwSmplg) || + !isNumber(lastActivityTime) || + !isNumber(vwSmplg) || (now - lastActivityTime) > MAX_SESS_DURATION ) } @@ -344,7 +347,7 @@ function setPlayerName(bidRequest) { const playerName = (internal.isRendererPreferredFromPublisher(bidRequest)) ? 'other' : 'adagio'; if (playerName === 'other') { - utils.logWarn(`${LOG_PREFIX} renderer.backupOnly has not been set. Adagio recommends to use its own player to get expected behavior.`); + logWarn(`${LOG_PREFIX} renderer.backupOnly has not been set. Adagio recommends to use its own player to get expected behavior.`); } return playerName; @@ -365,7 +368,7 @@ export const internal = { }; function _getGdprConsent(bidderRequest) { - if (!utils.deepAccess(bidderRequest, 'gdprConsent')) { + if (!deepAccess(bidderRequest, 'gdprConsent')) { return false; } @@ -376,7 +379,7 @@ function _getGdprConsent(bidderRequest) { allowAuctionWithoutConsent } = bidderRequest.gdprConsent; - return utils.cleanObj({ + return cleanObj({ apiVersion, consentString, consentRequired: gdprApplies ? 1 : 0, @@ -391,22 +394,22 @@ function _getCoppa() { } function _getUspConsent(bidderRequest) { - return (utils.deepAccess(bidderRequest, 'uspConsent')) ? { uspConsent: bidderRequest.uspConsent } : false; + return (deepAccess(bidderRequest, 'uspConsent')) ? { uspConsent: bidderRequest.uspConsent } : false; } function _getSchain(bidRequest) { - return utils.deepAccess(bidRequest, 'schain'); + return deepAccess(bidRequest, 'schain'); } function _getEids(bidRequest) { - if (utils.deepAccess(bidRequest, 'userId')) { + if (deepAccess(bidRequest, 'userId')) { return createEidsArray(bidRequest.userId); } } function _buildVideoBidRequest(bidRequest) { - const videoAdUnitParams = utils.deepAccess(bidRequest, 'mediaTypes.video', {}); - const videoBidderParams = utils.deepAccess(bidRequest, 'params.video', {}); + const videoAdUnitParams = deepAccess(bidRequest, 'mediaTypes.video', {}); + const videoBidderParams = deepAccess(bidRequest, 'params.video', {}); const computedParams = {}; // Special case for playerSize. @@ -436,7 +439,7 @@ function _buildVideoBidRequest(bidRequest) { bidRequest.mediaTypes.video[paramName] = videoParams[paramName]; } else { delete bidRequest.mediaTypes.video[paramName]; - utils.logWarn(`${LOG_PREFIX} The OpenRTB video param ${paramName} has been skipped due to misformating. Please refer to OpenRTB 2.5 spec.`); + logWarn(`${LOG_PREFIX} The OpenRTB video param ${paramName} has been skipped due to misformating. Please refer to OpenRTB 2.5 spec.`); } } }); @@ -447,14 +450,14 @@ function _renderer(bid) { if (typeof window.ADAGIO.outstreamPlayer === 'function') { window.ADAGIO.outstreamPlayer(bid); } else { - utils.logError(`${LOG_PREFIX} Adagio outstream player is not defined`); + logError(`${LOG_PREFIX} Adagio outstream player is not defined`); } }); } function _parseNativeBidResponse(bid) { if (!bid.admNative || !Array.isArray(bid.admNative.assets)) { - utils.logError(`${LOG_PREFIX} Invalid native response`); + logError(`${LOG_PREFIX} Invalid native response`); return; } @@ -559,7 +562,7 @@ function _parseNativeBidResponse(bid) { } function _getFloors(bidRequest) { - if (!utils.isFn(bidRequest.getFloor)) { + if (!isFn(bidRequest.getFloor)) { return false; } @@ -572,9 +575,9 @@ function _getFloors(bidRequest) { size: [] }); - floors.push(utils.cleanObj({ + floors.push(cleanObj({ mt: mediaType, - s: utils.isArray(size) ? `${size[0]}x${size[1]}` : undefined, + s: isArray(size) ? `${size[0]}x${size[1]}` : undefined, f: (!isNaN(info.floor) && info.currency === CURRENCY) ? info.floor : DEFAULT_FLOOR })); } @@ -584,7 +587,7 @@ function _getFloors(bidRequest) { const sizeProp = mediaType === VIDEO ? 'playerSize' : 'sizes'; if (bidRequest.mediaTypes[mediaType][sizeProp] && bidRequest.mediaTypes[mediaType][sizeProp].length) { - if (utils.isArray(bidRequest.mediaTypes[mediaType][sizeProp][0])) { + if (isArray(bidRequest.mediaTypes[mediaType][sizeProp][0])) { bidRequest.mediaTypes[mediaType][sizeProp].forEach(size => { getAndPush(mediaType, [size[0], size[1]]); }); @@ -621,7 +624,7 @@ export function setExtraParam(bid, paramName) { const adgGlobalConf = config.getConfig('adagio') || {}; const ortb2Conf = config.getConfig('ortb2'); - const detected = adgGlobalConf[paramName] || utils.deepAccess(ortb2Conf, `site.ext.data.${paramName}`, null); + const detected = adgGlobalConf[paramName] || deepAccess(ortb2Conf, `site.ext.data.${paramName}`, null); if (detected) { bid.params[paramName] = detected; } @@ -644,7 +647,7 @@ function autoFillParams(bid) { bid.params.placement = bid.adUnitCode; } - bid.params.adUnitElementId = utils.deepAccess(bid, 'ortb2Imp.ext.data.elementId', null) || bid.params.adUnitElementId; + bid.params.adUnitElementId = deepAccess(bid, 'ortb2Imp.ext.data.elementId', null) || bid.params.adUnitElementId; if (!bid.params.adUnitElementId) { if (adgGlobalConf.useAdUnitCodeAsAdUnitElementId === true || bid.params.useAdUnitCodeAsAdUnitElementId === true) { @@ -667,7 +670,7 @@ function getPageDimensions() { } // the page dimension can be computed on window.top only. - const wt = utils.getWindowTop(); + const wt = getWindowTop(); const body = wt.document.querySelector('body'); if (!body) { @@ -692,17 +695,17 @@ function getViewPortDimensions() { const viewportDims = { w: 0, h: 0 }; if (isSafeFrameWindow()) { - const ws = utils.getWindowSelf(); + const ws = getWindowSelf(); if (typeof ws.$sf.ext.geom !== 'function') { - utils.logWarn(LOG_PREFIX, 'Unable to compute from safeframe api.'); + logWarn(LOG_PREFIX, 'Unable to compute from safeframe api.'); return ''; } const sfGeom = ws.$sf.ext.geom(); if (!sfGeom || !sfGeom.win) { - utils.logWarn(LOG_PREFIX, 'Unable to compute from safeframe api. Missing `geom().win` property'); + logWarn(LOG_PREFIX, 'Unable to compute from safeframe api. Missing `geom().win` property'); return ''; } @@ -710,7 +713,7 @@ function getViewPortDimensions() { viewportDims.h = Math.round(sfGeom.h); } else { // window.top based computing - const wt = utils.getWindowTop(); + const wt = getWindowTop(); viewportDims.w = wt.innerWidth; viewportDims.h = wt.innerHeight; } @@ -730,17 +733,17 @@ function getSlotPosition(adUnitElementId) { const position = { x: 0, y: 0 }; if (isSafeFrameWindow()) { - const ws = utils.getWindowSelf(); + const ws = getWindowSelf(); if (typeof ws.$sf.ext.geom !== 'function') { - utils.logWarn(LOG_PREFIX, 'Unable to compute from safeframe api.'); + logWarn(LOG_PREFIX, 'Unable to compute from safeframe api.'); return ''; } const sfGeom = ws.$sf.ext.geom(); if (!sfGeom || !sfGeom.self) { - utils.logWarn(LOG_PREFIX, 'Unable to compute from safeframe api. Missing `geom().self` property'); + logWarn(LOG_PREFIX, 'Unable to compute from safeframe api. Missing `geom().self` property'); return ''; } @@ -748,13 +751,13 @@ function getSlotPosition(adUnitElementId) { position.y = Math.round(sfGeom.l); } else if (canAccessTopWindow()) { // window.top based computing - const wt = utils.getWindowTop(); + const wt = getWindowTop(); const d = wt.document; let domElement; - if (utils.inIframe() === true) { - const ws = utils.getWindowSelf(); + if (inIframe() === true) { + const ws = getWindowSelf(); const currentElement = ws.document.getElementById(adUnitElementId); domElement = internal.getElementFromTopWindow(currentElement, ws); } else { @@ -813,7 +816,7 @@ function getDomLoadingDuration() { let domLoadingDuration = -1; let performance; - performance = (canAccessTopWindow()) ? utils.getWindowTop().performance : utils.getWindowSelf().performance; + performance = (canAccessTopWindow()) ? getWindowTop().performance : getWindowSelf().performance; if (performance && performance.timing && performance.timing.navigationStart > 0) { const val = performance.timing.domLoading - performance.timing.navigationStart; @@ -871,13 +874,13 @@ export const spec = { autoFillParams(bid); if (!internal.getRefererInfo().reachedTop) { - utils.logWarn(`${LOG_PREFIX} the main page url is unreachabled.`); + logWarn(`${LOG_PREFIX} the main page url is unreachabled.`); // internal.enqueue(debugData()); return false; } if (!(bid.params.organizationId && bid.params.site && bid.params.placement)) { - utils.logWarn(`${LOG_PREFIX} at least one required param is missing.`); + logWarn(`${LOG_PREFIX} at least one required param is missing.`); // internal.enqueue(debugData()); return false; } @@ -896,7 +899,7 @@ export const spec = { const schain = _getSchain(validBidRequests[0]); const eids = _getEids(validBidRequests[0]) || []; - const adUnits = utils._map(validBidRequests, (bidRequest) => { + const adUnits = _map(validBidRequests, (bidRequest) => { const globalFeatures = GlobalExchange.getOrSetGlobalFeatures(); const features = { ...globalFeatures, @@ -925,7 +928,7 @@ export const spec = { // Handle priceFloors module bidRequest.floors = _getFloors(bidRequest); - if (utils.deepAccess(bidRequest, 'mediaTypes.video')) { + if (deepAccess(bidRequest, 'mediaTypes.video')) { _buildVideoBidRequest(bidRequest); } @@ -936,7 +939,7 @@ export const spec = { // Group ad units by organizationId const groupedAdUnits = adUnits.reduce((groupedAdUnits, adUnit) => { - const adUnitCopy = utils.deepClone(adUnit); + const adUnitCopy = deepClone(adUnit); adUnitCopy.params.organizationId = adUnitCopy.params.organizationId.toString(); // remove useless props @@ -950,12 +953,12 @@ export const spec = { }, {}); // Build one request per organizationId - const requests = utils._map(Object.keys(groupedAdUnits), organizationId => { + const requests = _map(Object.keys(groupedAdUnits), organizationId => { return { method: 'POST', url: ENDPOINT, data: { - id: utils.generateUUID(), + id: generateUUID(), organizationId: organizationId, secure: secure, device: device, @@ -1001,12 +1004,12 @@ export const spec = { const bidReq = (find(bidRequest.data.adUnits, bid => bid.bidId === bidObj.requestId)); if (bidReq) { - bidObj.meta = utils.deepAccess(bidObj, 'meta', {}); + bidObj.meta = deepAccess(bidObj, 'meta', {}); bidObj.meta.mediaType = bidObj.mediaType; bidObj.meta.advertiserDomains = (Array.isArray(bidObj.aDomain) && bidObj.aDomain.length) ? bidObj.aDomain : []; if (bidObj.mediaType === VIDEO) { - const mediaTypeContext = utils.deepAccess(bidReq, 'mediaTypes.video.context'); + const mediaTypeContext = deepAccess(bidReq, 'mediaTypes.video.context'); // Adagio SSP returns a `vastXml` only. No `vastUrl` nor `videoCacheKey`. if (!bidObj.vastUrl && bidObj.vastXml) { bidObj.vastUrl = 'data:text/xml;charset=utf-8;base64,' + btoa(bidObj.vastXml.replace(/\\"/g, '"')); @@ -1018,8 +1021,8 @@ export const spec = { adUnitCode: bidObj.adUnitCode, url: bidObj.urlRenderer || RENDERER_URL, config: { - ...utils.deepAccess(bidReq, 'mediaTypes.video'), - ...utils.deepAccess(bidObj, 'outstream', {}) + ...deepAccess(bidReq, 'mediaTypes.video'), + ...deepAccess(bidObj, 'outstream', {}) } }); @@ -1043,7 +1046,7 @@ export const spec = { } } } catch (err) { - utils.logError(err); + logError(err); } return bidResponses; }, @@ -1077,7 +1080,7 @@ export const spec = { if (isOrtb) { autoFillParams(adagioBid); - adagioBid.params.auctionId = utils.deepAccess(adagioBidderRequest, 'auctionId'); + adagioBid.params.auctionId = deepAccess(adagioBidderRequest, 'auctionId'); const globalFeatures = GlobalExchange.getOrSetGlobalFeatures(); adagioBid.params.features = { @@ -1090,7 +1093,7 @@ export const spec = { adagioBid.params.prebidVersion = '$prebid.version$'; adagioBid.params.data = GlobalExchange.getExchangeData(); - if (utils.deepAccess(adagioBid, 'mediaTypes.video.context') === OUTSTREAM) { + if (deepAccess(adagioBid, 'mediaTypes.video.context') === OUTSTREAM) { adagioBid.params.playerName = setPlayerName(adagioBid); } diff --git a/modules/adbookpspBidAdapter.js b/modules/adbookpspBidAdapter.js index d3f3ba295b9..ca4795c574f 100644 --- a/modules/adbookpspBidAdapter.js +++ b/modules/adbookpspBidAdapter.js @@ -3,7 +3,10 @@ import find from 'core-js-pure/features/array/find'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { getStorageManager } from '../src/storageManager.js'; -import * as utils from '../src/utils.js'; +import { + isPlainObject, deepSetValue, deepAccess, logWarn, inIframe, isNumber, logError, isArray, uniques, + flatten, triggerPixel, isStr, isEmptyStr, generateUUID +} from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; /** @@ -150,7 +153,7 @@ function buildDevice() { const deviceConfig = common.getConfig('device'); - if (utils.isPlainObject(deviceConfig)) { + if (isPlainObject(deviceConfig)) { return { ...device, ...deviceConfig }; } @@ -163,12 +166,12 @@ function buildRegs(bidderRequest) { }; if (bidderRequest.gdprConsent) { - utils.deepSetValue( + deepSetValue( regs, 'ext.gdpr', bidderRequest.gdprConsent.gdprApplies ? 1 : 0 ); - utils.deepSetValue( + deepSetValue( regs, 'ext.gdprConsentString', bidderRequest.gdprConsent.consentString || '' @@ -176,7 +179,7 @@ function buildRegs(bidderRequest) { } if (bidderRequest.uspConsent) { - utils.deepSetValue(regs, 'ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(regs, 'ext.us_privacy', bidderRequest.uspConsent); } return regs; @@ -187,10 +190,10 @@ function buildSource(bidRequests, bidderRequest) { fd: 1, tid: bidderRequest.auctionId, }; - const schain = utils.deepAccess(bidRequests, '0.schain'); + const schain = deepAccess(bidRequests, '0.schain'); if (schain) { - utils.deepSetValue(source, 'ext.schain', schain); + deepSetValue(source, 'ext.schain', schain); } return source; @@ -232,7 +235,7 @@ function buildMediaTypeObject(mediaType, bidRequest) { case VIDEO: return buildVideoObject(bidRequest); default: - utils.logWarn(`${BIDDER_CODE}: Unsupported media type ${mediaType}!`); + logWarn(`${BIDDER_CODE}: Unsupported media type ${mediaType}!`); } } @@ -246,7 +249,7 @@ function buildBannerObject(bidRequest) { return { pos: 0, - topframe: utils.inIframe() ? 0 : 1, + topframe: inIframe() ? 0 : 1, format, w, h, @@ -261,8 +264,8 @@ function buildVideoObject(bidRequest) { }; for (const param of VIDEO_PARAMS) { - const paramsValue = utils.deepAccess(bidRequest, `params.video.${param}`); - const mediaTypeValue = utils.deepAccess( + const paramsValue = deepAccess(bidRequest, `params.video.${param}`); + const mediaTypeValue = deepAccess( bidRequest, `mediaTypes.video.${param}` ); @@ -276,10 +279,10 @@ function buildVideoObject(bidRequest) { } function getVideoSize(bidRequest) { - const playerSize = utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize', [[]]); - const { w, h } = utils.deepAccess(bidRequest, 'mediaTypes.video', {}); + const playerSize = deepAccess(bidRequest, 'mediaTypes.video.playerSize', [[]]); + const { w, h } = deepAccess(bidRequest, 'mediaTypes.video', {}); - if (utils.isNumber(w) && utils.isNumber(h)) { + if (isNumber(w) && isNumber(h)) { return { w, h }; } @@ -296,11 +299,11 @@ function buildImpExt(validBidRequest) { const ext = {}; if (placementId) { - utils.deepSetValue(ext, 'adbook.placementId', placementId); + deepSetValue(ext, 'adbook.placementId', placementId); } if (effectiverOrgId) { - utils.deepSetValue(ext, 'adbook.orgId', effectiverOrgId); + deepSetValue(ext, 'adbook.orgId', effectiverOrgId); } return ext; @@ -314,20 +317,19 @@ function interpretResponse(bidResponse, bidderRequest) { const bidderRequestBody = safeJSONparse(bidderRequest.data); if ( - utils.deepAccess(bidderRequestBody, 'id') != - utils.deepAccess(bidResponse, 'body.id') + deepAccess(bidderRequestBody, 'id') != + deepAccess(bidResponse, 'body.id') ) { - utils.logError( + logError( `${BIDDER_CODE}: Bid response id does not match bidder request id` ); return []; } - const referrer = utils.deepAccess(bidderRequestBody, 'site.ref', ''); - const incomingBids = utils - .deepAccess(bidResponse, 'body.seatbid', []) - .filter((seat) => utils.isArray(seat.bid)) + const referrer = deepAccess(bidderRequestBody, 'site.ref', ''); + const incomingBids = deepAccess(bidResponse, 'body.seatbid', []) + .filter((seat) => isArray(seat.bid)) .reduce((bids, seat) => bids.concat(seat.bid), []) .filter(validateBid(bidderRequestBody)); const targetingMap = buildTargetingMap(incomingBids); @@ -366,11 +368,11 @@ const impToPrebidBid = const bidRequest = findBidRequest(bidderRequestBody, bid); if (!bidRequest) { - utils.logError(`${BIDDER_CODE}: Could not match bid to bid request`); + logError(`${BIDDER_CODE}: Could not match bid to bid request`); return null; } - const categories = utils.deepAccess(bid, 'cat', []); + const categories = deepAccess(bid, 'cat', []); const mediaType = getMediaType(bid.adm); let prebidBid = { ad: bid.adm, @@ -383,7 +385,7 @@ const impToPrebidBid = creativeId: bid.crid || bid.id, currency: bidResponseCurrency || getBidderConfig('defaultCurrency'), height: bid.h, - lineItemId: utils.deepAccess(bid, 'ext.liid'), + lineItemId: deepAccess(bid, 'ext.liid'), mediaType, meta: { advertiserDomains: bid.adomain, @@ -408,7 +410,7 @@ const impToPrebidBid = return prebidBid; } catch (error) { - utils.logError(`${BIDDER_CODE}: Error while building bid`, error); + logError(`${BIDDER_CODE}: Error while building bid`, error); return null; } @@ -423,7 +425,7 @@ function getVideoSpecificParams(bidRequest, bid) { } function buildTargetingMap(bids) { - const impIds = bids.map(({ impid }) => impid).filter(utils.uniques); + const impIds = bids.map(({ impid }) => impid).filter(uniques); const values = impIds.reduce((result, id) => { result[id] = { lineItemIds: [], @@ -459,12 +461,12 @@ function buildTargetingMap(bids) { function hasRequiredParams(bidRequest) { const value = - utils.deepAccess(bidRequest, 'params.placementId') != null || - utils.deepAccess(bidRequest, 'params.orgId') != null || + deepAccess(bidRequest, 'params.placementId') != null || + deepAccess(bidRequest, 'params.orgId') != null || getBidderConfig('orgId') != null; if (!value) { - utils.logError(`${BIDDER_CODE}: missing orgId and placementId parameter`); + logError(`${BIDDER_CODE}: missing orgId and placementId parameter`); } return value; @@ -472,7 +474,7 @@ function hasRequiredParams(bidRequest) { function isValidBannerRequest(bidRequest) { const value = validateSizes( - utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes', []) + deepAccess(bidRequest, 'mediaTypes.banner.sizes', []) ); return value; @@ -480,28 +482,28 @@ function isValidBannerRequest(bidRequest) { function isValidVideoRequest(bidRequest) { const value = - utils.isArray(utils.deepAccess(bidRequest, 'mediaTypes.video.mimes')) && + isArray(deepAccess(bidRequest, 'mediaTypes.video.mimes')) && validateVideoSizes(bidRequest); return value; } function validateSize(size) { - return utils.isArray(size) && size.length === 2 && size.every(utils.isNumber); + return isArray(size) && size.length === 2 && size.every(isNumber); } function validateSizes(sizes) { - return utils.isArray(sizes) && sizes.length > 0 && sizes.every(validateSize); + return isArray(sizes) && sizes.length > 0 && sizes.every(validateSize); } function validateVideoSizes(bidRequest) { - const { w, h } = utils.deepAccess(bidRequest, 'mediaTypes.video', {}); + const { w, h } = deepAccess(bidRequest, 'mediaTypes.video', {}); return ( validateSizes( - utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize') + deepAccess(bidRequest, 'mediaTypes.video.playerSize') ) || - (utils.isNumber(w) && utils.isNumber(h)) + (isNumber(w) && isNumber(h)) ); } @@ -518,7 +520,7 @@ function validateBid(bidderRequestBody) { const value = validators.every((validator) => validator(bid, bidRequest)); if (!value) { - utils.logWarn(`${BIDDER_CODE}: Invalid bid`, bid); + logWarn(`${BIDDER_CODE}: Invalid bid`, bid); } return value; @@ -526,13 +528,13 @@ function validateBid(bidderRequestBody) { } const commonBidValidators = [ - (bid) => utils.isPlainObject(bid), + (bid) => isPlainObject(bid), (bid) => isNonEmptyStr(bid.adid), (bid) => isNonEmptyStr(bid.adm), (bid) => isNonEmptyStr(bid.id), (bid) => isNonEmptyStr(bid.impid), - (bid) => isNonEmptyStr(utils.deepAccess(bid, 'ext.liid')), - (bid) => utils.isNumber(bid.price), + (bid) => isNonEmptyStr(deepAccess(bid, 'ext.liid')), + (bid) => isNumber(bid.price), ]; const bannerBidValidators = [ @@ -546,12 +548,12 @@ function validateBannerDimension(dimension) { return bannerHasSingleSize(bidRequest); } - return utils.isNumber(bid[dimension]); + return isNumber(bid[dimension]); }; } function bannerHasSingleSize(bidRequest) { - return utils.deepAccess(bidRequest, 'banner.format', []).length === 1; + return deepAccess(bidRequest, 'banner.format', []).length === 1; } /** @@ -562,9 +564,9 @@ export const storage = getStorageManager(); function getUserSyncs(syncOptions, responses, gdprConsent, uspConsent) { return responses - .map((response) => utils.deepAccess(response, 'body.ext.sync')) - .filter(utils.isArray) - .reduce(utils.flatten, []) + .map((response) => deepAccess(response, 'body.ext.sync')) + .filter(isArray) + .reduce(flatten, []) .filter(validateSync(syncOptions)) .map(applyConsents(gdprConsent, uspConsent)); } @@ -644,11 +646,11 @@ function onBidWon(bid) { const wurl = buildWinUrl(bid); if (wurl !== null) { - utils.triggerPixel(wurl); + triggerPixel(wurl); } - if (utils.isStr(bid.nurl)) { - utils.triggerPixel(bid.nurl); + if (isStr(bid.nurl)) { + triggerPixel(bid.nurl); } } @@ -662,7 +664,7 @@ function buildWinUrl(bid) { return url.toString(); } catch (_) { - utils.logError( + logError( `${BIDDER_CODE}: Could not build win tracking URL with %s`, getBidderConfig('winTrackingUrl') ); @@ -686,7 +688,7 @@ function getMediaType(adm) { const markup = safeJSONparse(adm.replace(/\\/g, '')); - if (markup && utils.isPlainObject(markup.native)) { + if (markup && isPlainObject(markup.native)) { return NATIVE; } @@ -702,7 +704,7 @@ function safeJSONparse(...args) { } function isNonEmptyStr(value) { - return utils.isStr(value) && !utils.isEmptyStr(value); + return isStr(value) && !isEmptyStr(value); } function findBidRequest(bidderRequest, bid) { @@ -782,7 +784,7 @@ const getUrlBuilder = function (url) { export const common = { generateUUID: function () { - return utils.generateUUID(); + return generateUUID(); }, getConfig: function (property) { return config.getConfig(property); diff --git a/modules/adfBidAdapter.js b/modules/adfBidAdapter.js index 2153f12316f..f7727a168b8 100644 --- a/modules/adfBidAdapter.js +++ b/modules/adfBidAdapter.js @@ -7,7 +7,7 @@ import { import { NATIVE, BANNER, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { mergeDeep, _map, deepAccess, parseSizesInput, deepSetValue } from '../src/utils.js'; import { config } from '../src/config.js'; import { Renderer } from '../src/Renderer.js'; @@ -68,12 +68,12 @@ export const spec = { if (typeof getConfig('app') === 'object') { app = getConfig('app') || {}; if (commonFpd.app) { - utils.mergeDeep(app, commonFpd.app); + mergeDeep(app, commonFpd.app); } } else { site = getConfig('site') || {}; if (commonFpd.site) { - utils.mergeDeep(site, commonFpd.site); + mergeDeep(site, commonFpd.site); } if (!site.page) { @@ -112,7 +112,7 @@ export const spec = { bidfloorcur }; - const assets = utils._map(bid.nativeParams, (bidParams, key) => { + const assets = _map(bid.nativeParams, (bidParams, key) => { const props = NATIVE_PARAMS[key]; const asset = { required: bidParams.required & 1, @@ -158,10 +158,10 @@ export const spec = { return imp; } - const bannerParams = utils.deepAccess(bid, 'mediaTypes.banner'); + const bannerParams = deepAccess(bid, 'mediaTypes.banner'); if (bannerParams && bannerParams.sizes) { - const sizes = utils.parseSizesInput(bannerParams.sizes); + const sizes = parseSizesInput(bannerParams.sizes); const format = sizes.map(size => { const [ width, height ] = size.split('x'); const w = parseInt(width, 10); @@ -177,7 +177,7 @@ export const spec = { return imp; } - const videoParams = utils.deepAccess(bid, 'mediaTypes.video'); + const videoParams = deepAccess(bid, 'mediaTypes.video'); if (videoParams) { imp.video = videoParams; bid.mediaType = VIDEO; @@ -202,21 +202,21 @@ export const spec = { request.is_debug = !!test; request.test = 1; } - if (utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies') !== undefined) { - utils.deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(request, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies & 1); + if (deepAccess(bidderRequest, 'gdprConsent.gdprApplies') !== undefined) { + deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(request, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies & 1); } if (bidderRequest.uspConsent) { - utils.deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); } if (eids) { - utils.deepSetValue(request, 'user.ext.eids', eids); + deepSetValue(request, 'user.ext.eids', eids); } if (schain) { - utils.deepSetValue(request, 'source.ext.schain', schain); + deepSetValue(request, 'source.ext.schain', schain); } return { @@ -266,7 +266,7 @@ export const spec = { result[ bid.mediaType === VIDEO ? 'vastXml' : 'ad' ] = bidResponse.adm; } - if (!bid.renderer && bid.mediaType === VIDEO && utils.deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + if (!bid.renderer && bid.mediaType === VIDEO && deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { result.renderer = Renderer.install({id: bid.bidId, url: OUTSTREAM_RENDERER_URL, adUnitCode: bid.adUnitCode}); result.renderer.setRender(renderer); } @@ -300,7 +300,7 @@ function parseNative(bid) { function setOnAny(collection, key) { for (let i = 0, result; i < collection.length; i++) { - result = utils.deepAccess(collection[i], key); + result = deepAccess(collection[i], key); if (result) { return result; } diff --git a/modules/adgenerationBidAdapter.js b/modules/adgenerationBidAdapter.js index f43fd284bad..2696915ea0a 100644 --- a/modules/adgenerationBidAdapter.js +++ b/modules/adgenerationBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { tryAppendQueryString, getBidIdParameter } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, NATIVE} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -33,23 +33,23 @@ export const spec = { const URL = 'https://d.socdm.com/adsv/v1'; const url = validReq.params.debug ? DEBUG_URL : URL; let data = ``; - data = utils.tryAppendQueryString(data, 'posall', 'SSPLOC'); - const id = utils.getBidIdParameter('id', validReq.params); - data = utils.tryAppendQueryString(data, 'id', id); - data = utils.tryAppendQueryString(data, 'sdktype', '0'); - data = utils.tryAppendQueryString(data, 'hb', 'true'); - data = utils.tryAppendQueryString(data, 't', 'json3'); - data = utils.tryAppendQueryString(data, 'transactionid', validReq.transactionId); - data = utils.tryAppendQueryString(data, 'sizes', getSizes(validReq)); - data = utils.tryAppendQueryString(data, 'currency', getCurrencyType()); - data = utils.tryAppendQueryString(data, 'pbver', '$prebid.version$'); - data = utils.tryAppendQueryString(data, 'sdkname', 'prebidjs'); - data = utils.tryAppendQueryString(data, 'adapterver', ADGENE_PREBID_VERSION); + data = tryAppendQueryString(data, 'posall', 'SSPLOC'); + const id = getBidIdParameter('id', validReq.params); + data = tryAppendQueryString(data, 'id', id); + data = tryAppendQueryString(data, 'sdktype', '0'); + data = tryAppendQueryString(data, 'hb', 'true'); + data = tryAppendQueryString(data, 't', 'json3'); + data = tryAppendQueryString(data, 'transactionid', validReq.transactionId); + data = tryAppendQueryString(data, 'sizes', getSizes(validReq)); + data = tryAppendQueryString(data, 'currency', getCurrencyType()); + data = tryAppendQueryString(data, 'pbver', '$prebid.version$'); + data = tryAppendQueryString(data, 'sdkname', 'prebidjs'); + data = tryAppendQueryString(data, 'adapterver', ADGENE_PREBID_VERSION); // native以外にvideo等の対応が入った場合は要修正 if (!validReq.mediaTypes || !validReq.mediaTypes.native) { - data = utils.tryAppendQueryString(data, 'imark', '1'); + data = tryAppendQueryString(data, 'imark', '1'); } - data = utils.tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.referer); + data = tryAppendQueryString(data, 'tp', bidderRequest.refererInfo.referer); // remove the trailing "&" if (data.lastIndexOf('&') === data.length - 1) { data = data.substring(0, data.length - 1); diff --git a/modules/adkernelAdnAnalyticsAdapter.js b/modules/adkernelAdnAnalyticsAdapter.js index 23501f7dd63..2b4e67736f3 100644 --- a/modules/adkernelAdnAnalyticsAdapter.js +++ b/modules/adkernelAdnAnalyticsAdapter.js @@ -1,7 +1,7 @@ import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; +import { logError, parseUrl, _each } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import {getStorageManager} from '../src/storageManager.js'; import {config} from '../src/config.js'; @@ -90,7 +90,7 @@ analyticsAdapter.originEnableAnalytics = analyticsAdapter.enableAnalytics; analyticsAdapter.enableAnalytics = (config) => { if (!config.options.pubId) { - utils.logError('PubId is not defined. Analytics won\'t work'); + logError('PubId is not defined. Analytics won\'t work'); return; } analyticsAdapter.context = { @@ -215,7 +215,7 @@ export function getUmtSource(pageUrl, referrer) { if (se) { return asUtm(se, ORGANIC, ORGANIC); } - let parsedUrl = utils.parseUrl(pageUrl); + let parsedUrl = parseUrl(pageUrl); let [refHost, refPath] = getReferrer(referrer); if (refHost && refHost !== parsedUrl.hostname) { return asUtm(refHost, REFERRAL, REFERRAL, '', refPath); @@ -242,17 +242,17 @@ export function getUmtSource(pageUrl, referrer) { } function getReferrer(referrer) { - let ref = utils.parseUrl(referrer); + let ref = parseUrl(referrer); return [ref.hostname, ref.pathname]; } function getUTM(pageUrl) { - let urlParameters = utils.parseUrl(pageUrl).search; + let urlParameters = parseUrl(pageUrl).search; if (!urlParameters['utm_campaign'] || !urlParameters['utm_source']) { return; } let utmArgs = []; - utils._each(UTM_TAGS, (utmTagName) => { + _each(UTM_TAGS, (utmTagName) => { let utmValue = urlParameters[utmTagName] || ''; utmArgs.push(utmValue); }); diff --git a/modules/adkernelAdnBidAdapter.js b/modules/adkernelAdnBidAdapter.js index dc56ed6abbb..39f7b9fd2b2 100644 --- a/modules/adkernelAdnBidAdapter.js +++ b/modules/adkernelAdnBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, parseSizesInput, isArray, deepSetValue, parseUrl, isStr, isNumber, logInfo } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -19,12 +19,12 @@ function buildImp(bidRequest) { tagid: bidRequest.adUnitCode }; let mediaType; - let bannerReq = utils.deepAccess(bidRequest, `mediaTypes.banner`); - let videoReq = utils.deepAccess(bidRequest, `mediaTypes.video`); + let bannerReq = deepAccess(bidRequest, `mediaTypes.banner`); + let videoReq = deepAccess(bidRequest, `mediaTypes.video`); if (bannerReq) { let sizes = canonicalizeSizesArray(bannerReq.sizes); imp.banner = { - format: utils.parseSizesInput(sizes) + format: parseSizesInput(sizes) }; mediaType = BANNER; } else if (videoReq) { @@ -51,7 +51,7 @@ function buildImp(bidRequest) { * @return Array[Array[Number]] */ function canonicalizeSizesArray(sizes) { - if (sizes.length === 2 && !utils.isArray(sizes[0])) { + if (sizes.length === 2 && !isArray(sizes[0])) { return [sizes]; } return sizes; @@ -67,23 +67,23 @@ function buildRequestParams(tags, bidderRequest) { }; if (gdprConsent) { if (gdprConsent.gdprApplies !== undefined) { - utils.deepSetValue(req, 'user.gdpr', ~~gdprConsent.gdprApplies); + deepSetValue(req, 'user.gdpr', ~~gdprConsent.gdprApplies); } if (gdprConsent.consentString !== undefined) { - utils.deepSetValue(req, 'user.consent', gdprConsent.consentString); + deepSetValue(req, 'user.consent', gdprConsent.consentString); } } if (uspConsent) { - utils.deepSetValue(req, 'user.us_privacy', uspConsent); + deepSetValue(req, 'user.us_privacy', uspConsent); } if (config.getConfig('coppa')) { - utils.deepSetValue(req, 'user.coppa', 1); + deepSetValue(req, 'user.coppa', 1); } return req; } function buildSite(refInfo) { - let loc = utils.parseUrl(refInfo.referer); + let loc = parseUrl(refInfo.referer); let result = { page: `${loc.protocol}://${loc.hostname}${loc.pathname}`, secure: ~~(loc.protocol === 'https') @@ -126,23 +126,23 @@ function buildBid(tag) { } function fillBidMeta(bid, tag) { - if (utils.isStr(tag.agencyName)) { - utils.deepSetValue(bid, 'meta.agencyName', tag.agencyName); + if (isStr(tag.agencyName)) { + deepSetValue(bid, 'meta.agencyName', tag.agencyName); } - if (utils.isNumber(tag.advertiserId)) { - utils.deepSetValue(bid, 'meta.advertiserId', tag.advertiserId); + if (isNumber(tag.advertiserId)) { + deepSetValue(bid, 'meta.advertiserId', tag.advertiserId); } - if (utils.isStr(tag.advertiserName)) { - utils.deepSetValue(bid, 'meta.advertiserName', tag.advertiserName); + if (isStr(tag.advertiserName)) { + deepSetValue(bid, 'meta.advertiserName', tag.advertiserName); } - if (utils.isArray(tag.advertiserDomains)) { - utils.deepSetValue(bid, 'meta.advertiserDomains', tag.advertiserDomains); + if (isArray(tag.advertiserDomains)) { + deepSetValue(bid, 'meta.advertiserDomains', tag.advertiserDomains); } - if (utils.isStr(tag.primaryCatId)) { - utils.deepSetValue(bid, 'meta.primaryCatId', tag.primaryCatId); + if (isStr(tag.primaryCatId)) { + deepSetValue(bid, 'meta.primaryCatId', tag.primaryCatId); } - if (utils.isArray(tag.secondaryCatIds)) { - utils.deepSetValue(bid, 'meta.secondaryCatIds', tag.secondaryCatIds); + if (isArray(tag.secondaryCatIds)) { + deepSetValue(bid, 'meta.secondaryCatIds', tag.secondaryCatIds); } } @@ -204,7 +204,7 @@ export const spec = { return []; } if (response.debug) { - utils.logInfo(`ADKERNEL DEBUG:\n${response.debug}`); + logInfo(`ADKERNEL DEBUG:\n${response.debug}`); } return response.tags.map(buildBid); }, From 29f49e339b3cf502ecd46c6b966b8d5007fc348e Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 27 Sep 2021 11:37:45 -0700 Subject: [PATCH 095/250] Multiple Bid/Analytics/ID Adapters: import utils functions as needed and not the whole module (#7477) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/adWMGBidAdapter.js | 8 +- modules/adriverBidAdapter.js | 26 +++--- modules/adtargetBidAdapter.js | 48 +++++------ modules/adtelligentBidAdapter.js | 58 ++++++------- modules/adtrueBidAdapter.js | 70 ++++++++-------- modules/aduptechBidAdapter.js | 20 ++--- modules/advangelistsBidAdapter.js | 28 +++---- modules/adxcgAnalyticsAdapter.js | 10 +-- modules/adxcgBidAdapter.js | 112 +++++++++++++------------- modules/adxpremiumAnalyticsAdapter.js | 34 ++++---- modules/adyoulikeBidAdapter.js | 22 ++--- modules/ajaBidAdapter.js | 24 +++--- modules/akamaiDAPIdSystem.js | 18 ++--- modules/aniviewBidAdapter.js | 4 +- modules/aolBidAdapter.js | 26 +++--- 15 files changed, 254 insertions(+), 254 deletions(-) diff --git a/modules/adWMGBidAdapter.js b/modules/adWMGBidAdapter.js index a3d78a69d91..7bf6c703a55 100644 --- a/modules/adWMGBidAdapter.js +++ b/modules/adWMGBidAdapter.js @@ -1,6 +1,6 @@ 'use strict'; -import * as utils from '../src/utils.js'; +import { tryAppendQueryString } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER } from '../src/mediaTypes.js'; @@ -128,11 +128,11 @@ export const spec = { }, getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { if (gdprConsent && SYNC_ENDPOINT.indexOf('gdpr') === -1) { - SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); + SYNC_ENDPOINT = tryAppendQueryString(SYNC_ENDPOINT, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); } if (gdprConsent && typeof gdprConsent.consentString === 'string' && SYNC_ENDPOINT.indexOf('gdpr_consent') === -1) { - SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); + SYNC_ENDPOINT = tryAppendQueryString(SYNC_ENDPOINT, 'gdpr_consent', gdprConsent.consentString); } if (SYNC_ENDPOINT.slice(-1) === '&') { @@ -140,7 +140,7 @@ export const spec = { } /* if (uspConsent) { - SYNC_ENDPOINT = utils.tryAppendQueryString(SYNC_ENDPOINT, 'us_privacy', uspConsent); + SYNC_ENDPOINT = tryAppendQueryString(SYNC_ENDPOINT, 'us_privacy', uspConsent); } */ let syncs = []; if (syncOptions.iframeEnabled) { diff --git a/modules/adriverBidAdapter.js b/modules/adriverBidAdapter.js index d5a777f6111..67e039e4692 100644 --- a/modules/adriverBidAdapter.js +++ b/modules/adriverBidAdapter.js @@ -1,5 +1,5 @@ // ADRIVER BID ADAPTER for Prebid 1.13 -import * as utils from '../src/utils.js'; +import { logInfo, getWindowLocation, getBidIdParameter, _each } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'adriver'; @@ -21,12 +21,12 @@ export const spec = { }, buildRequests: function (validBidRequests, bidderRequest) { - utils.logInfo('validBidRequests', validBidRequests); + logInfo('validBidRequests', validBidRequests); - let win = utils.getWindowLocation(); + let win = getWindowLocation(); let customID = Math.round(Math.random() * 999999999) + '-' + Math.round(new Date() / 1000) + '-1-46-'; - let siteId = utils.getBidIdParameter('siteid', validBidRequests[0].params) + ''; - let currency = utils.getBidIdParameter('currency', validBidRequests[0].params); + let siteId = getBidIdParameter('siteid', validBidRequests[0].params) + ''; + let currency = getBidIdParameter('currency', validBidRequests[0].params); currency = 'RUB'; let timeout = null; @@ -58,8 +58,8 @@ export const spec = { 'imp': [] }; - utils._each(validBidRequests, (bid) => { - utils._each(bid.sizes, (sizes) => { + _each(validBidRequests, (bid) => { + _each(bid.sizes, (sizes) => { let width; let height; let par; @@ -67,7 +67,7 @@ export const spec = { let floorAndCurrency = _getFloor(bid, currency, sizes); let bidFloor = floorAndCurrency.floor; - let dealId = utils.getBidIdParameter('dealid', bid.params); + let dealId = getBidIdParameter('dealid', bid.params); if (typeof sizes[0] === 'number' && typeof sizes[1] === 'number') { width = sizes[0]; height = sizes[1]; @@ -93,7 +93,7 @@ export const spec = { }] }; } - utils.logInfo('par', par); + logInfo('par', par); payload.imp.push(par); }); }); @@ -108,11 +108,11 @@ export const spec = { }, interpretResponse: function (serverResponse, bidRequest) { - utils.logInfo('serverResponse.body.seatbid', serverResponse.body.seatbid); + logInfo('serverResponse.body.seatbid', serverResponse.body.seatbid); const bidResponses = []; let nurl = 0; - utils._each(serverResponse.body.seatbid, (seatbid) => { - utils.logInfo('_each', seatbid); + _each(serverResponse.body.seatbid, (seatbid) => { + logInfo('_each', seatbid); var bid = seatbid.bid[0]; if (bid.nurl !== undefined) { nurl = bid.nurl.split('://'); @@ -135,7 +135,7 @@ export const spec = { }, ad: '' }; - utils.logInfo('bidResponse', bidResponse); + logInfo('bidResponse', bidResponse); bidResponses.push(bidResponse); } }); diff --git a/modules/adtargetBidAdapter.js b/modules/adtargetBidAdapter.js index 1779ba94371..0ad0177815a 100644 --- a/modules/adtargetBidAdapter.js +++ b/modules/adtargetBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isArray, chunk, _map, flatten, logError, parseSizesInput } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; @@ -13,7 +13,7 @@ export const spec = { code: BIDDER_CODE, supportedMediaTypes: [VIDEO, BANNER], isBidRequestValid: function (bid) { - return !!utils.deepAccess(bid, 'params.aid'); + return !!deepAccess(bid, 'params.aid'); }, getUserSyncs: function (syncOptions, serverResponses) { const syncs = []; @@ -42,9 +42,9 @@ export const spec = { } if (syncOptions.pixelEnabled || syncOptions.iframeEnabled) { - utils.isArray(serverResponses) && serverResponses.forEach((response) => { + isArray(serverResponses) && serverResponses.forEach((response) => { if (response.body) { - if (utils.isArray(response.body)) { + if (isArray(response.body)) { response.body.forEach(b => { addSyncs(b); }) @@ -59,10 +59,10 @@ export const spec = { buildRequests: function (bidRequests, adapterRequest) { const adapterSettings = config.getConfig(adapterRequest.bidderCode) - const chunkSize = utils.deepAccess(adapterSettings, 'chunkSize', 10); + const chunkSize = deepAccess(adapterSettings, 'chunkSize', 10); const { tag, bids } = bidToTag(bidRequests, adapterRequest); - const bidChunks = utils.chunk(bids, chunkSize); - return utils._map(bidChunks, (bids) => { + const bidChunks = chunk(bids, chunkSize); + return _map(bidChunks, (bids) => { return { data: Object.assign({}, tag, { BidRequests: bids }), adapterRequest, @@ -75,12 +75,12 @@ export const spec = { serverResponse = serverResponse.body; let bids = []; - if (!utils.isArray(serverResponse)) { + if (!isArray(serverResponse)) { return parseResponse(serverResponse, adapterRequest); } serverResponse.forEach(serverBidResponse => { - bids = utils.flatten(bids, parseResponse(serverBidResponse, adapterRequest)); + bids = flatten(bids, parseResponse(serverBidResponse, adapterRequest)); }); return bids; @@ -88,14 +88,14 @@ export const spec = { }; function parseResponse(serverResponse, adapterRequest) { - const isInvalidValidResp = !serverResponse || !utils.isArray(serverResponse.bids); + const isInvalidValidResp = !serverResponse || !isArray(serverResponse.bids); const bids = []; if (isInvalidValidResp) { const extMessage = serverResponse && serverResponse.ext && serverResponse.ext.message ? `: ${serverResponse.ext.message}` : ''; const errorMessage = `in response for ${adapterRequest.bidderCode} adapter ${extMessage}`; - utils.logError(errorMessage); + logError(errorMessage); return bids; } @@ -117,23 +117,23 @@ function parseResponse(serverResponse, adapterRequest) { function bidToTag(bidRequests, adapterRequest) { const tag = { - Domain: utils.deepAccess(adapterRequest, 'refererInfo.referer') + Domain: deepAccess(adapterRequest, 'refererInfo.referer') }; if (config.getConfig('coppa') === true) { tag.Coppa = 1; } - if (utils.deepAccess(adapterRequest, 'gdprConsent.gdprApplies')) { + if (deepAccess(adapterRequest, 'gdprConsent.gdprApplies')) { tag.GDPR = 1; - tag.GDPRConsent = utils.deepAccess(adapterRequest, 'gdprConsent.consentString'); + tag.GDPRConsent = deepAccess(adapterRequest, 'gdprConsent.consentString'); } - if (utils.deepAccess(adapterRequest, 'uspConsent')) { - tag.USP = utils.deepAccess(adapterRequest, 'uspConsent'); + if (deepAccess(adapterRequest, 'uspConsent')) { + tag.USP = deepAccess(adapterRequest, 'uspConsent'); } - if (utils.deepAccess(bidRequests[0], 'schain')) { - tag.Schain = utils.deepAccess(bidRequests[0], 'schain'); + if (deepAccess(bidRequests[0], 'schain')) { + tag.Schain = deepAccess(bidRequests[0], 'schain'); } - if (utils.deepAccess(bidRequests[0], 'userId')) { - tag.UserIds = utils.deepAccess(bidRequests[0], 'userId'); + if (deepAccess(bidRequests[0], 'userId')) { + tag.UserIds = deepAccess(bidRequests[0], 'userId'); } const bids = [] @@ -147,19 +147,19 @@ function bidToTag(bidRequests, adapterRequest) { } function prepareBidRequests(bidReq) { - const mediaType = utils.deepAccess(bidReq, 'mediaTypes.video') ? VIDEO : DISPLAY; - const sizes = mediaType === VIDEO ? utils.deepAccess(bidReq, 'mediaTypes.video.playerSize') : utils.deepAccess(bidReq, 'mediaTypes.banner.sizes'); + const mediaType = deepAccess(bidReq, 'mediaTypes.video') ? VIDEO : DISPLAY; + const sizes = mediaType === VIDEO ? deepAccess(bidReq, 'mediaTypes.video.playerSize') : deepAccess(bidReq, 'mediaTypes.banner.sizes'); const bidReqParams = { 'CallbackId': bidReq.bidId, 'Aid': bidReq.params.aid, 'AdType': mediaType, - 'Sizes': utils.parseSizesInput(sizes).join(',') + 'Sizes': parseSizesInput(sizes).join(',') }; return bidReqParams; } function getMediaType(bidderRequest) { - return utils.deepAccess(bidderRequest, 'mediaTypes.video') ? VIDEO : BANNER; + return deepAccess(bidderRequest, 'mediaTypes.video') ? VIDEO : BANNER; } function createBid(bidResponse, bidRequest) { diff --git a/modules/adtelligentBidAdapter.js b/modules/adtelligentBidAdapter.js index e1c6dc1ca35..8523e01c0ea 100644 --- a/modules/adtelligentBidAdapter.js +++ b/modules/adtelligentBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isArray, chunk, _map, flatten, convertTypes, parseSizesInput } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { ADPOD, BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; @@ -44,7 +44,7 @@ export const spec = { ], supportedMediaTypes: [VIDEO, BANNER], isBidRequestValid: function (bid) { - return !!utils.deepAccess(bid, 'params.aid'); + return !!deepAccess(bid, 'params.aid'); }, getUserSyncs: function (syncOptions, serverResponses) { const syncs = []; @@ -73,9 +73,9 @@ export const spec = { } if (syncOptions.pixelEnabled || syncOptions.iframeEnabled) { - utils.isArray(serverResponses) && serverResponses.forEach((response) => { + isArray(serverResponses) && serverResponses.forEach((response) => { if (response.body) { - if (utils.isArray(response.body)) { + if (isArray(response.body)) { response.body.forEach(b => { addSyncs(b); }) @@ -94,10 +94,10 @@ export const spec = { */ buildRequests: function (bidRequests, adapterRequest) { const adapterSettings = config.getConfig(adapterRequest.bidderCode) - const chunkSize = utils.deepAccess(adapterSettings, 'chunkSize', 10); + const chunkSize = deepAccess(adapterSettings, 'chunkSize', 10); const { tag, bids } = bidToTag(bidRequests, adapterRequest); - const bidChunks = utils.chunk(bids, chunkSize); - return utils._map(bidChunks, (bids) => { + const bidChunks = chunk(bids, chunkSize); + return _map(bidChunks, (bids) => { return { data: Object.assign({}, tag, { BidRequests: bids }), adapterRequest, @@ -117,26 +117,26 @@ export const spec = { serverResponse = serverResponse.body; let bids = []; - if (!utils.isArray(serverResponse)) { + if (!isArray(serverResponse)) { return parseRTBResponse(serverResponse, adapterRequest); } serverResponse.forEach(serverBidResponse => { - bids = utils.flatten(bids, parseRTBResponse(serverBidResponse, adapterRequest)); + bids = flatten(bids, parseRTBResponse(serverBidResponse, adapterRequest)); }); return bids; }, transformBidParams(params) { - return utils.convertTypes({ + return convertTypes({ 'aid': 'number', }, params); } }; function parseRTBResponse(serverResponse, adapterRequest) { - const isEmptyResponse = !serverResponse || !utils.isArray(serverResponse.bids); + const isEmptyResponse = !serverResponse || !isArray(serverResponse.bids); const bids = []; if (isEmptyResponse) { @@ -161,26 +161,26 @@ function parseRTBResponse(serverResponse, adapterRequest) { function bidToTag(bidRequests, adapterRequest) { // start publisher env const tag = { - Domain: utils.deepAccess(adapterRequest, 'refererInfo.referer') + Domain: deepAccess(adapterRequest, 'refererInfo.referer') }; if (config.getConfig('coppa') === true) { tag.Coppa = 1; } - if (utils.deepAccess(adapterRequest, 'gdprConsent.gdprApplies')) { + if (deepAccess(adapterRequest, 'gdprConsent.gdprApplies')) { tag.GDPR = 1; - tag.GDPRConsent = utils.deepAccess(adapterRequest, 'gdprConsent.consentString'); + tag.GDPRConsent = deepAccess(adapterRequest, 'gdprConsent.consentString'); } - if (utils.deepAccess(adapterRequest, 'uspConsent')) { - tag.USP = utils.deepAccess(adapterRequest, 'uspConsent'); + if (deepAccess(adapterRequest, 'uspConsent')) { + tag.USP = deepAccess(adapterRequest, 'uspConsent'); } - if (utils.deepAccess(bidRequests[0], 'schain')) { - tag.Schain = utils.deepAccess(bidRequests[0], 'schain'); + if (deepAccess(bidRequests[0], 'schain')) { + tag.Schain = deepAccess(bidRequests[0], 'schain'); } - if (utils.deepAccess(bidRequests[0], 'userId')) { - tag.UserIds = utils.deepAccess(bidRequests[0], 'userId'); + if (deepAccess(bidRequests[0], 'userId')) { + tag.UserIds = deepAccess(bidRequests[0], 'userId'); } - if (utils.deepAccess(bidRequests[0], 'userIdAsEids')) { - tag.UserEids = utils.deepAccess(bidRequests[0], 'userIdAsEids'); + if (deepAccess(bidRequests[0], 'userIdAsEids')) { + tag.UserEids = deepAccess(bidRequests[0], 'userIdAsEids'); } if (window.adtDmp && window.adtDmp.ready) { tag.DMPId = window.adtDmp.getUID(); @@ -203,13 +203,13 @@ function bidToTag(bidRequests, adapterRequest) { * @returns {object} */ function prepareBidRequests(bidReq) { - const mediaType = utils.deepAccess(bidReq, 'mediaTypes.video') ? VIDEO : DISPLAY; - const sizes = mediaType === VIDEO ? utils.deepAccess(bidReq, 'mediaTypes.video.playerSize') : utils.deepAccess(bidReq, 'mediaTypes.banner.sizes'); + const mediaType = deepAccess(bidReq, 'mediaTypes.video') ? VIDEO : DISPLAY; + const sizes = mediaType === VIDEO ? deepAccess(bidReq, 'mediaTypes.video.playerSize') : deepAccess(bidReq, 'mediaTypes.banner.sizes'); const bidReqParams = { 'CallbackId': bidReq.bidId, 'Aid': bidReq.params.aid, 'AdType': mediaType, - 'Sizes': utils.parseSizesInput(sizes).join(',') + 'Sizes': parseSizesInput(sizes).join(',') }; bidReqParams.PlacementId = bidReq.adUnitCode; @@ -220,9 +220,9 @@ function prepareBidRequests(bidReq) { bidReqParams.PlacementId = bidReq.params.vpb_placement_id; } if (mediaType === VIDEO) { - const context = utils.deepAccess(bidReq, 'mediaTypes.video.context'); + const context = deepAccess(bidReq, 'mediaTypes.video.context'); if (context === ADPOD) { - bidReqParams.Adpod = utils.deepAccess(bidReq, 'mediaTypes.video'); + bidReqParams.Adpod = deepAccess(bidReq, 'mediaTypes.video'); } } return bidReqParams; @@ -234,7 +234,7 @@ function prepareBidRequests(bidReq) { * @returns {object} */ function getMediaType(bidderRequest) { - return utils.deepAccess(bidderRequest, 'mediaTypes.video') ? VIDEO : BANNER; + return deepAccess(bidderRequest, 'mediaTypes.video') ? VIDEO : BANNER; } /** @@ -245,7 +245,7 @@ function getMediaType(bidderRequest) { */ function createBid(bidResponse, bidRequest) { const mediaType = getMediaType(bidRequest) - const context = utils.deepAccess(bidRequest, 'mediaTypes.video.context'); + const context = deepAccess(bidRequest, 'mediaTypes.video.context'); const bid = { requestId: bidResponse.requestId, creativeId: bidResponse.cmpId, diff --git a/modules/adtrueBidAdapter.js b/modules/adtrueBidAdapter.js index 96f1ceb12f0..df848fba823 100644 --- a/modules/adtrueBidAdapter.js +++ b/modules/adtrueBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logWarn, isArray, inIframe, isNumber, isStr, deepClone, deepSetValue, logError, deepAccess, isBoolean } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -190,22 +190,22 @@ function _checkParamDataType(key, value, datatype) { var functionToExecute; switch (datatype) { case DATA_TYPES.BOOLEAN: - functionToExecute = utils.isBoolean; + functionToExecute = isBoolean; break; case DATA_TYPES.NUMBER: - functionToExecute = utils.isNumber; + functionToExecute = isNumber; break; case DATA_TYPES.STRING: - functionToExecute = utils.isStr; + functionToExecute = isStr; break; case DATA_TYPES.ARRAY: - functionToExecute = utils.isArray; + functionToExecute = isArray; break; } if (functionToExecute(value)) { return value; } - utils.logWarn(LOG_WARN_PREFIX + errMsg); + logWarn(LOG_WARN_PREFIX + errMsg); return UNDEFINED; } @@ -216,7 +216,7 @@ function _parseNativeResponse(bid, newBid) { try { adm = JSON.parse(bid.adm.replace(/\\/g, '')); } catch (ex) { - // utils.logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + newBid.adm); + // logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + newBid.adm); return; } if (adm && adm.native && adm.native.assets && adm.native.assets.length > 0) { @@ -274,13 +274,13 @@ function _createBannerRequest(bid) { var sizes = bid.mediaTypes.banner.sizes; var format = []; var bannerObj; - if (sizes !== UNDEFINED && utils.isArray(sizes)) { + if (sizes !== UNDEFINED && isArray(sizes)) { bannerObj = {}; if (!bid.params.width && !bid.params.height) { if (sizes.length === 0) { // i.e. since bid.params does not have width or height, and length of sizes is 0, need to ignore this banner imp bannerObj = UNDEFINED; - utils.logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); return bannerObj; } else { bannerObj.w = parseInt(sizes[0][0], 10); @@ -303,9 +303,9 @@ function _createBannerRequest(bid) { } } bannerObj.pos = 0; - bannerObj.topframe = utils.inIframe() ? 0 : 1; + bannerObj.topframe = inIframe() ? 0 : 1; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); bannerObj = UNDEFINED; } return bannerObj; @@ -323,10 +323,10 @@ function _createVideoRequest(bid) { } } // read playersize and assign to h and w. - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + if (isArray(bid.mediaTypes.video.playerSize[0])) { videoObj.w = parseInt(bid.mediaTypes.video.playerSize[0][0], 10); videoObj.h = parseInt(bid.mediaTypes.video.playerSize[0][1], 10); - } else if (utils.isNumber(bid.mediaTypes.video.playerSize[0])) { + } else if (isNumber(bid.mediaTypes.video.playerSize[0])) { videoObj.w = parseInt(bid.mediaTypes.video.playerSize[0], 10); videoObj.h = parseInt(bid.mediaTypes.video.playerSize[1], 10); } @@ -337,7 +337,7 @@ function _createVideoRequest(bid) { } } else { videoObj = UNDEFINED; - utils.logWarn(LOG_WARN_PREFIX + 'Error: Video config params missing for adunit: ' + bid.params.adUnit + ' with mediaType set as video. Ignoring video impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: Video config params missing for adunit: ' + bid.params.adUnit + ' with mediaType set as video. Ignoring video impression in the adunit.'); } return videoObj; } @@ -355,7 +355,7 @@ function _checkMediaType(adm, newBid) { newBid.mediaType = NATIVE; } } catch (e) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + adm); + logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + adm); } } } @@ -401,9 +401,9 @@ function _createImpressionObject(bid, conf) { pos: 0, w: bid.params.width, h: bid.params.height, - topframe: utils.inIframe() ? 0 : 1 + topframe: inIframe() ? 0 : 1 }; - if (utils.isArray(sizes) && sizes.length > 1) { + if (isArray(sizes) && sizes.length > 1) { sizes = sizes.splice(1, sizes.length - 1); sizes.forEach(size => { format.push({ @@ -428,19 +428,19 @@ export const spec = { isBidRequestValid: function (bid) { if (bid && bid.params) { if (!bid.params.zoneId) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: missing zoneId'); + logWarn(LOG_WARN_PREFIX + 'Error: missing zoneId'); return false; } if (!bid.params.publisherId) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: missing publisherId'); + logWarn(LOG_WARN_PREFIX + 'Error: missing publisherId'); return false; } - if (!utils.isStr(bid.params.publisherId)) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric'); + if (!isStr(bid.params.publisherId)) { + logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric'); return false; } - if (!utils.isStr(bid.params.zoneId)) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: zoneId is mandatory and cannot be numeric'); + if (!isStr(bid.params.zoneId)) { + logWarn(LOG_WARN_PREFIX + 'Error: zoneId is mandatory and cannot be numeric'); return false; } return true; @@ -458,7 +458,7 @@ export const spec = { let bidCurrency = ''; let bid; validBidRequests.forEach(originalBid => { - bid = utils.deepClone(originalBid); + bid = deepClone(originalBid); _parseAdSlot(bid); conf.zoneId = conf.zoneId || bid.params.zoneId; @@ -468,7 +468,7 @@ export const spec = { if (bidCurrency === '') { bidCurrency = bid.params.currency || UNDEFINED; } else if (bid.params.hasOwnProperty('currency') && bidCurrency !== bid.params.currency) { - utils.logWarn(LOG_WARN_PREFIX + 'Currency specifier ignored. Only one currency permitted.'); + logWarn(LOG_WARN_PREFIX + 'Currency specifier ignored. Only one currency permitted.'); } bid.params.currency = bidCurrency; @@ -502,28 +502,28 @@ export const spec = { if (typeof config.getConfig('device') === 'object') { payload.device = Object.assign(payload.device, config.getConfig('device')); } - utils.deepSetValue(payload, 'source.tid', conf.transactionId); + deepSetValue(payload, 'source.tid', conf.transactionId); // test bids if (window.location.href.indexOf('adtrueTest=true') !== -1) { payload.test = 1; } // adding schain object if (validBidRequests[0].schain) { - utils.deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); + deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); } // Attaching GDPR Consent Params if (bidderRequest && bidderRequest.gdprConsent) { - utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); + deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } // CCPA if (bidderRequest && bidderRequest.uspConsent) { - utils.deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); } // coppa compliance if (config.getConfig('coppa') === true) { - utils.deepSetValue(payload, 'regs.coppa', 1); + deepSetValue(payload, 'regs.coppa', 1); } return { @@ -539,12 +539,12 @@ export const spec = { let parsedRequest = JSON.parse(bidderRequest.data); let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : ''; try { - if (serverResponses.body && serverResponses.body.seatbid && utils.isArray(serverResponses.body.seatbid)) { + if (serverResponses.body && serverResponses.body.seatbid && isArray(serverResponses.body.seatbid)) { // Supporting multiple bid responses for same adSize respCur = serverResponses.body.cur || respCur; serverResponses.body.seatbid.forEach(seatbidder => { seatbidder.bid && - utils.isArray(seatbidder.bid) && + isArray(seatbidder.bid) && seatbidder.bid.forEach(bid => { let newBid = { requestId: bid.impid, @@ -598,7 +598,7 @@ export const spec = { }); } } catch (error) { - utils.logError(error); + logError(error); } return bidResponses; }, @@ -607,7 +607,7 @@ export const spec = { return []; } return responses.reduce((accum, rsp) => { - let cookieSyncs = utils.deepAccess(rsp, 'body.ext.cookie_sync'); + let cookieSyncs = deepAccess(rsp, 'body.ext.cookie_sync'); if (cookieSyncs) { let cookieSyncObjects = cookieSyncs.map(cookieSync => { return { diff --git a/modules/aduptechBidAdapter.js b/modules/aduptechBidAdapter.js index b70f7cf3ce6..1186e0410ab 100644 --- a/modules/aduptechBidAdapter.js +++ b/modules/aduptechBidAdapter.js @@ -1,7 +1,7 @@ +import { deepAccess, getWindowTop, getWindowSelf, getAdUnitSizes } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js' -import * as utils from '../src/utils.js'; export const BIDDER_CODE = 'aduptech'; export const ENDPOINT_URL_PUBLISHER_PLACEHOLDER = '{PUBLISHER}'; @@ -37,7 +37,7 @@ export const internal = { * @returns {string} */ extractPageUrl: (bidderRequest) => { - if (bidderRequest && utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl')) { + if (bidderRequest && deepAccess(bidderRequest, 'refererInfo.canonicalUrl')) { return bidderRequest.refererInfo.canonicalUrl; } @@ -46,9 +46,9 @@ export const internal = { } try { - return utils.getWindowTop().location.href; + return getWindowTop().location.href; } catch (e) { - return utils.getWindowSelf().location.href; + return getWindowSelf().location.href; } }, @@ -59,14 +59,14 @@ export const internal = { * @returns {string} */ extractReferrer: (bidderRequest) => { - if (bidderRequest && utils.deepAccess(bidderRequest, 'refererInfo.referer')) { + if (bidderRequest && deepAccess(bidderRequest, 'refererInfo.referer')) { return bidderRequest.refererInfo.referer; } try { - return utils.getWindowTop().document.referrer; + return getWindowTop().document.referrer; } catch (e) { - return utils.getWindowSelf().document.referrer; + return getWindowSelf().document.referrer; } }, @@ -77,7 +77,7 @@ export const internal = { * @returns {null|Object.} */ extractBannerConfig: (bidRequest) => { - const sizes = utils.getAdUnitSizes(bidRequest); + const sizes = getAdUnitSizes(bidRequest); if (Array.isArray(sizes) && sizes.length > 0) { return { sizes: sizes }; } @@ -92,7 +92,7 @@ export const internal = { * @returns {null|Object.} */ extractNativeConfig: (bidRequest) => { - if (bidRequest && utils.deepAccess(bidRequest, 'mediaTypes.native')) { + if (bidRequest && deepAccess(bidRequest, 'mediaTypes.native')) { return bidRequest.mediaTypes.native; } @@ -267,7 +267,7 @@ export const spec = { const bidResponses = []; // stop here on invalid or empty data - if (!response || !utils.deepAccess(response, 'body.bids') || response.body.bids.length === 0) { + if (!response || !deepAccess(response, 'body.bids') || response.body.bids.length === 0) { return bidResponses; } diff --git a/modules/advangelistsBidAdapter.js b/modules/advangelistsBidAdapter.js index edf58fefd64..854c65b1f22 100755 --- a/modules/advangelistsBidAdapter.js +++ b/modules/advangelistsBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isEmpty, deepAccess, isFn, parseSizesInput, generateUUID, parseUrl } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { VIDEO, BANNER } from '../src/mediaTypes.js'; @@ -56,7 +56,7 @@ export const spec = { interpretResponse(serverResponse, {bidRequest}) { let response = serverResponse.body; - if (response !== null && utils.isEmpty(response) == false) { + if (response !== null && isEmpty(response) == false) { if (isVideoBid(bidRequest)) { let bidResponse = { requestId: response.id, @@ -103,20 +103,20 @@ export const spec = { }; function isBannerBid(bid) { - return utils.deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); + return deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); } function isVideoBid(bid) { - return utils.deepAccess(bid, 'mediaTypes.video'); + return deepAccess(bid, 'mediaTypes.video'); } function getBannerBidFloor(bid) { - let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {}; + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'banner', size: '*' }) : {}; return floorInfo.floor || getBannerBidParam(bid, 'bidfloor'); } function getVideoBidFloor(bid) { - let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {}; + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: 'USD', mediaType: 'video', size: '*' }) : {}; return floorInfo.floor || getVideoBidParam(bid, 'bidfloor'); } @@ -129,11 +129,11 @@ function isBannerBidValid(bid) { } function getVideoBidParam(bid, key) { - return utils.deepAccess(bid, 'params.video.' + key) || utils.deepAccess(bid, 'params.' + key); + return deepAccess(bid, 'params.video.' + key) || deepAccess(bid, 'params.' + key); } function getBannerBidParam(bid, key) { - return utils.deepAccess(bid, 'params.banner.' + key) || utils.deepAccess(bid, 'params.' + key); + return deepAccess(bid, 'params.banner.' + key) || deepAccess(bid, 'params.' + key); } function isMobile() { @@ -184,7 +184,7 @@ function getFirstSize(sizes) { } function parseSizes(sizes) { - return utils.parseSizesInput(sizes).map(size => { + return parseSizesInput(sizes).map(size => { let [ width, height ] = size.split('x'); return { w: parseInt(width, 10) || undefined, @@ -194,11 +194,11 @@ function parseSizes(sizes) { } function getVideoSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); } function getBannerSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); } function getTopWindowReferrer() { @@ -290,7 +290,7 @@ function createVideoRequestData(bid, bidderRequest) { 'bidfloorcur': 'USD', 'secure': secure, 'video': Object.assign({ - 'id': utils.generateUUID(), + 'id': generateUUID(), 'pos': 0, 'w': firstSize.w, 'h': firstSize.h, @@ -311,7 +311,7 @@ function createVideoRequestData(bid, bidderRequest) { function getTopWindowLocation(bidderRequest) { let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; - return utils.parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); + return parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); } function createBannerRequestData(bid, bidderRequest) { @@ -378,7 +378,7 @@ function createBannerRequestData(bid, bidderRequest) { 'bidfloorcur': 'USD', 'secure': secure, 'banner': { - 'id': utils.generateUUID(), + 'id': generateUUID(), 'pos': 0, 'w': size['w'], 'h': size['h'] diff --git a/modules/adxcgAnalyticsAdapter.js b/modules/adxcgAnalyticsAdapter.js index 9f514c545a1..5cd04ce13cd 100644 --- a/modules/adxcgAnalyticsAdapter.js +++ b/modules/adxcgAnalyticsAdapter.js @@ -1,8 +1,8 @@ +import { parseSizesInput, uniques, buildUrl, logError } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; /** * Analytics adapter from adxcg.com @@ -32,7 +32,7 @@ var adxcgAnalyticsAdapter = Object.assign(adapter( case CONSTANTS.EVENTS.BID_ADJUSTMENT: break; case CONSTANTS.EVENTS.BID_TIMEOUT: - adxcgAnalyticsAdapter.context.events.bidTimeout = args.map(item => item.bidder).filter(utils.uniques); + adxcgAnalyticsAdapter.context.events.bidTimeout = args.map(item => item.bidder).filter(uniques); break; case CONSTANTS.EVENTS.BIDDER_DONE: break; @@ -67,7 +67,7 @@ function mapBidRequested (bidRequests) { adUnitCode: bid.adUnitCode, bidId: bid.bidId, start: bid.startTime, - sizes: utils.parseSizesInput(bid.sizes).toString(), + sizes: parseSizesInput(bid.sizes).toString(), params: bid.params }; }), @@ -112,7 +112,7 @@ function mapBidWon (bidResponse) { } function send (data) { - let adxcgAnalyticsRequestUrl = utils.buildUrl({ + let adxcgAnalyticsRequestUrl = buildUrl({ protocol: 'https', hostname: adxcgAnalyticsAdapter.context.host, pathname: '/pbrx/v2', @@ -143,7 +143,7 @@ adxcgAnalyticsAdapter.context = {}; adxcgAnalyticsAdapter.originEnableAnalytics = adxcgAnalyticsAdapter.enableAnalytics; adxcgAnalyticsAdapter.enableAnalytics = function (config) { if (!config.options.publisherId) { - utils.logError('PublisherId option is not defined. Analytics won\'t work'); + logError('PublisherId option is not defined. Analytics won\'t work'); return; } diff --git a/modules/adxcgBidAdapter.js b/modules/adxcgBidAdapter.js index e10eeaa3302..a02812a1608 100644 --- a/modules/adxcgBidAdapter.js +++ b/modules/adxcgBidAdapter.js @@ -1,5 +1,5 @@ +import { logWarn, isStr, deepAccess, inIframe, checkCookieSupport, timestamp, getBidIdParameter, parseSizesInput, buildUrl, logMessage, isArray, deepSetValue, isPlainObject, triggerPixel, replaceAuctionPrice, isFn } from '../src/utils.js'; import {config} from '../src/config.js' -import * as utils from '../src/utils.js' import {registerBidder} from '../src/adapters/bidderFactory.js' import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js' import includes from 'core-js-pure/features/array/includes.js' @@ -36,44 +36,44 @@ export const spec = { */ isBidRequestValid: function (bid) { if (!bid || !bid.params) { - utils.logWarn(BIDDER_CODE + ': Missing bid parameters'); + logWarn(BIDDER_CODE + ': Missing bid parameters'); return false } - if (!utils.isStr(bid.params.adzoneid)) { - utils.logWarn(BIDDER_CODE + ': adzoneid must be specified as a string'); + if (!isStr(bid.params.adzoneid)) { + logWarn(BIDDER_CODE + ': adzoneid must be specified as a string'); return false } if (isBannerRequest(bid)) { - const banneroAdUnit = utils.deepAccess(bid, 'mediaTypes.banner'); + const banneroAdUnit = deepAccess(bid, 'mediaTypes.banner'); if (!banneroAdUnit.sizes) { - utils.logWarn(BIDDER_CODE + ': banner sizes must be specified'); + logWarn(BIDDER_CODE + ': banner sizes must be specified'); return false; } } if (isVideoRequest(bid)) { // prebid 4.0 use standardized Video parameters - const videoAdUnit = utils.deepAccess(bid, 'mediaTypes.video'); + const videoAdUnit = deepAccess(bid, 'mediaTypes.video'); if (!Array.isArray(videoAdUnit.playerSize)) { - utils.logWarn(BIDDER_CODE + ': video playerSize must be an array of integers'); + logWarn(BIDDER_CODE + ': video playerSize must be an array of integers'); return false; } if (!videoAdUnit.context) { - utils.logWarn(BIDDER_CODE + ': video context must be specified'); + logWarn(BIDDER_CODE + ': video context must be specified'); return false; } if (!Array.isArray(videoAdUnit.mimes) || videoAdUnit.mimes.length === 0) { - utils.logWarn(BIDDER_CODE + ': video mimes must be an array of strings'); + logWarn(BIDDER_CODE + ': video mimes must be an array of strings'); return false; } if (!Array.isArray(videoAdUnit.protocols) || videoAdUnit.protocols.length === 0) { - utils.logWarn(BIDDER_CODE + ': video protocols must be an array of integers'); + logWarn(BIDDER_CODE + ': video protocols must be an array of integers'); return false; } } @@ -97,8 +97,8 @@ export const spec = { bt = Math.min(window.PREBID_TIMEOUT, bt); } - let referrer = utils.deepAccess(bidderRequest, 'refererInfo.referer'); - let page = utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || utils.deepAccess(window, 'location.href'); + let referrer = deepAccess(bidderRequest, 'refererInfo.referer'); + let page = deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || deepAccess(window, 'location.href'); // add common parameters let beaconParams = { @@ -110,10 +110,10 @@ export const spec = { uh: window.screen.height, dpr: ratio, bt: bt, - isinframe: utils.inIframe(), - cookies: utils.checkCookieSupport() ? '1' : '0', + isinframe: inIframe(), + cookies: checkCookieSupport() ? '1' : '0', tz: dt.getTimezoneOffset(), - dt: utils.timestamp(), + dt: timestamp(), iob: iobavailable ? '1' : '0', pbjs: '$prebid.version$', rndid: Math.floor(Math.random() * (999999 - 100000 + 1)) + 100000, @@ -126,19 +126,19 @@ export const spec = { beaconParams.gdpr_consent = bidderRequest.gdprConsent.consentString; } - if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.pubcid'))) { + if (isStr(deepAccess(validBidRequests, '0.userId.pubcid'))) { beaconParams.pubcid = validBidRequests[0].userId.pubcid; } - if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.tdid'))) { + if (isStr(deepAccess(validBidRequests, '0.userId.tdid'))) { beaconParams.tdid = validBidRequests[0].userId.tdid; } - if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.id5id.uid'))) { + if (isStr(deepAccess(validBidRequests, '0.userId.id5id.uid'))) { beaconParams.id5id = validBidRequests[0].userId.id5id.uid; } - if (utils.isStr(utils.deepAccess(validBidRequests, '0.userId.idl_env'))) { + if (isStr(deepAccess(validBidRequests, '0.userId.idl_env'))) { beaconParams.idl_env = validBidRequests[0].userId.idl_env; } @@ -156,14 +156,14 @@ export const spec = { let bidfloors = []; validBidRequests.forEach((bid, index) => { - adZoneIds.push(utils.getBidIdParameter('adzoneid', bid.params)); + adZoneIds.push(getBidIdParameter('adzoneid', bid.params)); prebidBidIds.push(bid.bidId); let bidfloor = getFloor(bid); bidfloors.push(bidfloor); // copy all custom parameters impression level parameters not supported above - let customBidParams = utils.getBidIdParameter('custom', bid.params) || {} + let customBidParams = getBidIdParameter('custom', bid.params) || {} if (customBidParams) { Object.keys(customBidParams) .filter(param => includes(USER_PARAMS_BID, param)) @@ -171,7 +171,7 @@ export const spec = { } if (isBannerRequest(bid)) { - sizes.push(utils.parseSizesInput(bid.mediaTypes.banner.sizes).join('|')); + sizes.push(parseSizesInput(bid.mediaTypes.banner.sizes).join('|')); } if (isNativeRequest(bid)) { @@ -185,10 +185,10 @@ export const spec = { .forEach(param => beaconParams['video.' + param + '.' + index] = encodeURIComponent(bid.params.video[param])) } // copy video standarized params - beaconParams['video.context' + '.' + index] = utils.deepAccess(bid, 'mediaTypes.video.context'); - sizes.push(utils.parseSizesInput(bid.mediaTypes.video.playerSize).join('|')); - beaconParams['video.mimes' + '.' + index] = utils.deepAccess(bid, 'mediaTypes.video.mimes').join(','); - beaconParams['video.protocols' + '.' + index] = utils.deepAccess(bid, 'mediaTypes.video.protocols').join(','); + beaconParams['video.context' + '.' + index] = deepAccess(bid, 'mediaTypes.video.context'); + sizes.push(parseSizesInput(bid.mediaTypes.video.playerSize).join('|')); + beaconParams['video.mimes' + '.' + index] = deepAccess(bid, 'mediaTypes.video.mimes').join(','); + beaconParams['video.protocols' + '.' + index] = deepAccess(bid, 'mediaTypes.video.protocols').join(','); } }) @@ -197,14 +197,14 @@ export const spec = { beaconParams.prebidBidIds = prebidBidIds.join(','); beaconParams.bidfloors = bidfloors.join(','); - let adxcgRequestUrl = utils.buildUrl({ + let adxcgRequestUrl = buildUrl({ protocol: 'https', hostname: 'hbps.adxcg.net', pathname: '/get/adi', search: beaconParams }); - utils.logMessage(`calling adi adxcg`); + logMessage(`calling adi adxcg`); return { contentType: 'text/plain', method: 'GET', @@ -220,11 +220,11 @@ export const spec = { */ interpretResponse: function (serverResponse) { - utils.logMessage(`interpretResponse adxcg`); + logMessage(`interpretResponse adxcg`); let bidsAll = []; - if (!serverResponse || !serverResponse.body || !utils.isArray(serverResponse.body.seatbid) || !serverResponse.body.seatbid.length) { - utils.logWarn(BIDDER_CODE + ': empty bid response'); + if (!serverResponse || !serverResponse.body || !isArray(serverResponse.body.seatbid) || !serverResponse.body.seatbid.length) { + logWarn(BIDDER_CODE + ': empty bid response'); return bidsAll; } @@ -256,28 +256,28 @@ export const spec = { bid.mediaType = 'native'; bid.native = parseNative(JSON.parse(serverResponseOneItem.adm)); } else { - utils.logWarn(BIDDER_CODE + ': unknown or undefined crType'); + logWarn(BIDDER_CODE + ': unknown or undefined crType'); } // prebid 4.0 meta taxonomy - if (utils.isArray(serverResponseOneItem.adomain)) { - utils.deepSetValue(bid, 'meta.advertiserDomains', serverResponseOneItem.adomain); + if (isArray(serverResponseOneItem.adomain)) { + deepSetValue(bid, 'meta.advertiserDomains', serverResponseOneItem.adomain); } - if (utils.isArray(serverResponseOneItem.cat)) { - utils.deepSetValue(bid, 'meta.secondaryCatIds', serverResponseOneItem.cat); + if (isArray(serverResponseOneItem.cat)) { + deepSetValue(bid, 'meta.secondaryCatIds', serverResponseOneItem.cat); } - if (utils.isPlainObject(serverResponseOneItem.ext)) { - if (utils.isStr(serverResponseOneItem.ext.advertiser_id)) { - utils.deepSetValue(bid, 'meta.mediaType', serverResponseOneItem.ext.mediaType); + if (isPlainObject(serverResponseOneItem.ext)) { + if (isStr(serverResponseOneItem.ext.advertiser_id)) { + deepSetValue(bid, 'meta.mediaType', serverResponseOneItem.ext.mediaType); } - if (utils.isStr(serverResponseOneItem.ext.advertiser_id)) { - utils.deepSetValue(bid, 'meta.advertiserId', serverResponseOneItem.ext.advertiser_id); + if (isStr(serverResponseOneItem.ext.advertiser_id)) { + deepSetValue(bid, 'meta.advertiserId', serverResponseOneItem.ext.advertiser_id); } - if (utils.isStr(serverResponseOneItem.ext.advertiser_name)) { - utils.deepSetValue(bid, 'meta.advertiserName', serverResponseOneItem.ext.advertiser_name); + if (isStr(serverResponseOneItem.ext.advertiser_name)) { + deepSetValue(bid, 'meta.advertiserName', serverResponseOneItem.ext.advertiser_name); } - if (utils.isStr(serverResponseOneItem.ext.agency_name)) { - utils.deepSetValue(bid, 'meta.agencyName', serverResponseOneItem.ext.agency_name); + if (isStr(serverResponseOneItem.ext.agency_name)) { + deepSetValue(bid, 'meta.agencyName', serverResponseOneItem.ext.agency_name); } } bidsAll.push(bid) @@ -288,7 +288,7 @@ export const spec = { onBidWon: (bid) => { if (bid.burl) { - utils.triggerPixel(utils.replaceAuctionPrice(bid.burl, bid.originalCpm)); + triggerPixel(replaceAuctionPrice(bid.burl, bid.originalCpm)); } }, @@ -304,14 +304,14 @@ export const spec = { cn: timeoutData.timeout, aud: timeoutData.auctionId, }; - let adxcgRequestUrl = utils.buildUrl({ + let adxcgRequestUrl = buildUrl({ protocol: 'https', hostname: 'hbps.adxcg.net', pathname: '/event/timeout.gif', search: beaconParams }); - utils.logWarn(BIDDER_CODE + ': onTimeout called'); - utils.triggerPixel(adxcgRequestUrl); + logWarn(BIDDER_CODE + ': onTimeout called'); + triggerPixel(adxcgRequestUrl); }, getUserSyncs: function (syncOptions, serverResponses, gdprConsent) { @@ -336,20 +336,20 @@ export const spec = { } function isVideoRequest(bid) { - return bid.mediaType === 'video' || !!utils.deepAccess(bid, 'mediaTypes.video'); + return bid.mediaType === 'video' || !!deepAccess(bid, 'mediaTypes.video'); } function isBannerRequest(bid) { - return bid.mediaType === 'banner' || !!utils.deepAccess(bid, 'mediaTypes.banner'); + return bid.mediaType === 'banner' || !!deepAccess(bid, 'mediaTypes.banner'); } function isNativeRequest(bid) { - return bid.mediaType === 'native' || !!utils.deepAccess(bid, 'mediaTypes.native'); + return bid.mediaType === 'native' || !!deepAccess(bid, 'mediaTypes.native'); } function getFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.floor', DEFAULT_MIN_FLOOR); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.floor', DEFAULT_MIN_FLOOR); } try { @@ -361,7 +361,7 @@ function getFloor(bid) { }); return floor.floor; } catch (e) { - utils.logWarn(BIDDER_CODE + ': call to getFloor failed:' + e.message); + logWarn(BIDDER_CODE + ': call to getFloor failed:' + e.message); return DEFAULT_MIN_FLOOR; } } diff --git a/modules/adxpremiumAnalyticsAdapter.js b/modules/adxpremiumAnalyticsAdapter.js index f11e3b8d4e5..3e30de14052 100644 --- a/modules/adxpremiumAnalyticsAdapter.js +++ b/modules/adxpremiumAnalyticsAdapter.js @@ -1,8 +1,8 @@ +import { logError, logInfo, deepClone } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; import includes from 'core-js-pure/features/array/includes.js'; const analyticsType = 'endpoint'; @@ -95,7 +95,7 @@ function auctionInit(args) { completeObject.auction_id = args.auctionId; completeObject.publisher_id = adxpremiumAnalyticsAdapter.initOptions.pubId; - try { completeObject.referer = encodeURI(args.bidderRequests[0].refererInfo.referer.split('?')[0]); } catch (e) { utils.logError('AdxPremium Analytics - ' + e.message); } + try { completeObject.referer = encodeURI(args.bidderRequests[0].refererInfo.referer.split('?')[0]); } catch (e) { logError('AdxPremium Analytics - ' + e.message); } if (args.adUnitCodes && args.adUnitCodes.length > 0) { elementIds = args.adUnitCodes; } @@ -140,20 +140,20 @@ function bidWon(args) { if (requestDelivered) { if (completeObject.events[eventIndex]) { // do the upgrade - utils.logInfo('AdxPremium Analytics - Upgrading request'); + logInfo('AdxPremium Analytics - Upgrading request'); completeObject.events[eventIndex].is_winning = true; completeObject.events[eventIndex].is_upgrade = true; - upgradedObject = utils.deepClone(completeObject); + upgradedObject = deepClone(completeObject); upgradedObject.events = [completeObject.events[eventIndex]]; sendEvent(upgradedObject); // send upgrade } else { - utils.logInfo('AdxPremium Analytics - CANNOT FIND INDEX FOR REQUEST ' + args.requestId); + logInfo('AdxPremium Analytics - CANNOT FIND INDEX FOR REQUEST ' + args.requestId); } } else { completeObject.events[eventIndex].is_winning = true; } } else { - utils.logInfo('AdxPremium Analytics - Response not found, creating new one.'); + logInfo('AdxPremium Analytics - Response not found, creating new one.'); let tmpObject = { type: 'RESPONSE', bidder_code: args.bidderCode, @@ -167,14 +167,14 @@ function bidWon(args) { is_winning: true, is_lost: true }; - let lostObject = utils.deepClone(completeObject); + let lostObject = deepClone(completeObject); lostObject.events = [tmpObject]; sendEvent(lostObject); // send lost object } } function bidTimeout(args) { - let timeoutObject = utils.deepClone(completeObject); + let timeoutObject = deepClone(completeObject); timeoutObject.events = []; let usedRequestIds = []; @@ -191,12 +191,12 @@ function bidTimeout(args) { if (timeoutObject.events.length > 0) { sendEvent(timeoutObject); // send timeouted - utils.logInfo('AdxPremium Analytics - Sending timeouted requests'); + logInfo('AdxPremium Analytics - Sending timeouted requests'); } } function auctionEnd(args) { - utils.logInfo('AdxPremium Analytics - Auction Ended at ' + Date.now()); + logInfo('AdxPremium Analytics - Auction Ended at ' + Date.now()); if (timeoutBased) { setTimeout(function () { requestSent = true; sendEvent(completeObject); }, 3500); } else { sendEventFallback(); } } @@ -212,22 +212,22 @@ function deviceType() { } function clearSlot(elementId) { - if (includes(elementIds, elementId)) { elementIds.splice(elementIds.indexOf(elementId), 1); utils.logInfo('AdxPremium Analytics - Done with: ' + elementId); } + if (includes(elementIds, elementId)) { elementIds.splice(elementIds.indexOf(elementId), 1); logInfo('AdxPremium Analytics - Done with: ' + elementId); } if (elementIds.length == 0 && !requestSent && !timeoutBased) { requestSent = true; sendEvent(completeObject); - utils.logInfo('AdxPremium Analytics - Everything ready'); + logInfo('AdxPremium Analytics - Everything ready'); } } export function testSend() { sendEvent(completeObject); - utils.logInfo('AdxPremium Analytics - Sending without any conditions, used for testing'); + logInfo('AdxPremium Analytics - Sending without any conditions, used for testing'); } function sendEventFallback() { setTimeout(function () { - if (!requestSent) { requestSent = true; sendEvent(completeObject); utils.logInfo('AdxPremium Analytics - Sending event using fallback method.'); } + if (!requestSent) { requestSent = true; sendEvent(completeObject); logInfo('AdxPremium Analytics - Sending event using fallback method.'); } }, 2000); } @@ -241,11 +241,11 @@ function sendEvent(completeObject) { if (adxpremiumAnalyticsAdapter.initOptions.sid) { ajaxEndpoint = 'https://' + adxpremiumAnalyticsAdapter.initOptions.sid + '.adxpremium.services/graphql' } - ajax(ajaxEndpoint, function () { utils.logInfo('AdxPremium Analytics - Sending complete events at ' + Date.now()) }, dataToSend, { + ajax(ajaxEndpoint, function () { logInfo('AdxPremium Analytics - Sending complete events at ' + Date.now()) }, dataToSend, { contentType: 'application/json', method: 'POST' }); - } catch (err) { utils.logError('AdxPremium Analytics - Sending event error: ' + err); } + } catch (err) { logError('AdxPremium Analytics - Sending event error: ' + err); } } // save the base class function @@ -256,7 +256,7 @@ adxpremiumAnalyticsAdapter.enableAnalytics = function (config) { adxpremiumAnalyticsAdapter.initOptions = config.options; if (!config.options.pubId) { - utils.logError('AdxPremium Analytics - Publisher ID (pubId) option is not defined. Analytics won\'t work'); + logError('AdxPremium Analytics - Publisher ID (pubId) option is not defined. Analytics won\'t work'); return; } diff --git a/modules/adyoulikeBidAdapter.js b/modules/adyoulikeBidAdapter.js index 38731fdc91c..334309aec5c 100644 --- a/modules/adyoulikeBidAdapter.js +++ b/modules/adyoulikeBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, buildUrl, parseSizesInput } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import find from 'core-js-pure/features/array/find.js'; @@ -175,11 +175,11 @@ function getCanonicalUrl() { /* Get mediatype from bidRequest */ function getMediatype(bidRequest) { - if (utils.deepAccess(bidRequest, 'mediaTypes.video')) { + if (deepAccess(bidRequest, 'mediaTypes.video')) { return VIDEO; - } else if (utils.deepAccess(bidRequest, 'mediaTypes.banner')) { + } else if (deepAccess(bidRequest, 'mediaTypes.banner')) { return BANNER; - } else if (utils.deepAccess(bidRequest, 'mediaTypes.native')) { + } else if (deepAccess(bidRequest, 'mediaTypes.native')) { return NATIVE; } } @@ -210,7 +210,7 @@ function getPageRefreshed() { /* Create endpoint url */ function createEndpoint(bidRequests, bidderRequest) { let host = getHostname(bidRequests); - return utils.buildUrl({ + return buildUrl({ protocol: 'https', host: `${DEFAULT_DC}${host}.omnitagjs.com`, pathname: '/hb-api/prebid/v1', @@ -260,7 +260,7 @@ function getSizeArray(bid) { } } - return utils.parseSizesInput(inputSize); + return parseSizesInput(inputSize); } /* Get parsed size from request size */ @@ -342,7 +342,7 @@ function getVideoAd(response) { var adJson = {}; if (typeof response.Ad === 'string') { adJson = JSON.parse(response.Ad.match(/\/\*PREBID\*\/(.*)\/\*PREBID\*\//)[1]); - return utils.deepAccess(adJson, 'Content.MainVideo.Vast'); + return deepAccess(adJson, 'Content.MainVideo.Vast'); } } @@ -404,7 +404,7 @@ function getNativeAssets(response, nativeConfig) { imgSize[1] = response.Height || 250; } - const url = getImageUrl(adJson, utils.deepAccess(adJson, 'Content.Preview.Thumbnail.Image'), imgSize[0], imgSize[1]); + const url = getImageUrl(adJson, deepAccess(adJson, 'Content.Preview.Thumbnail.Image'), imgSize[0], imgSize[1]); if (url) { native[key] = { url, @@ -422,7 +422,7 @@ function getNativeAssets(response, nativeConfig) { iconSize[1] = 50; } - const icurl = getImageUrl(adJson, utils.deepAccess(adJson, 'Content.Preview.Sponsor.Logo.Resource'), iconSize[0], iconSize[1]); + const icurl = getImageUrl(adJson, deepAccess(adJson, 'Content.Preview.Sponsor.Logo.Resource'), iconSize[0], iconSize[1]); if (url) { native[key] = { @@ -433,10 +433,10 @@ function getNativeAssets(response, nativeConfig) { } break; case 'privacyIcon': - native[key] = getImageUrl(adJson, utils.deepAccess(adJson, 'Content.Preview.Credit.Logo.Resource'), 25, 25); + native[key] = getImageUrl(adJson, deepAccess(adJson, 'Content.Preview.Credit.Logo.Resource'), 25, 25); break; case 'privacyLink': - native[key] = utils.deepAccess(adJson, 'Content.Preview.Credit.Url'); + native[key] = deepAccess(adJson, 'Content.Preview.Credit.Url'); break; } }); diff --git a/modules/ajaBidAdapter.js b/modules/ajaBidAdapter.js index f7a9bfe5793..a9364a7a05f 100644 --- a/modules/ajaBidAdapter.js +++ b/modules/ajaBidAdapter.js @@ -1,5 +1,5 @@ +import { getBidIdParameter, tryAppendQueryString, createTrackPixelHtml, logError, logWarn } from '../src/utils.js'; import { Renderer } from '../src/Renderer.js'; -import * as utils from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { VIDEO, BANNER, NATIVE } from '../src/mediaTypes.js'; @@ -42,20 +42,20 @@ export const spec = { const bidRequest = validBidRequests[i]; let queryString = ''; - const asi = utils.getBidIdParameter('asi', bidRequest.params); - queryString = utils.tryAppendQueryString(queryString, 'asi', asi); - queryString = utils.tryAppendQueryString(queryString, 'skt', SDK_TYPE); - queryString = utils.tryAppendQueryString(queryString, 'tid', bidRequest.transactionId) - queryString = utils.tryAppendQueryString(queryString, 'prebid_id', bidRequest.bidId); - queryString = utils.tryAppendQueryString(queryString, 'prebid_ver', '$prebid.version$'); + const asi = getBidIdParameter('asi', bidRequest.params); + queryString = tryAppendQueryString(queryString, 'asi', asi); + queryString = tryAppendQueryString(queryString, 'skt', SDK_TYPE); + queryString = tryAppendQueryString(queryString, 'tid', bidRequest.transactionId) + queryString = tryAppendQueryString(queryString, 'prebid_id', bidRequest.bidId); + queryString = tryAppendQueryString(queryString, 'prebid_ver', '$prebid.version$'); if (pageUrl) { - queryString = utils.tryAppendQueryString(queryString, 'page_url', pageUrl); + queryString = tryAppendQueryString(queryString, 'page_url', pageUrl); } const eids = bidRequest.userIdAsEids; if (eids && eids.length) { - queryString = utils.tryAppendQueryString(queryString, 'eids', JSON.stringify({ + queryString = tryAppendQueryString(queryString, 'eids', JSON.stringify({ 'eids': eids, })) } @@ -114,11 +114,11 @@ export const spec = { }); try { bannerAd.imps.forEach(impTracker => { - const tracker = utils.createTrackPixelHtml(impTracker); + const tracker = createTrackPixelHtml(impTracker); bid.ad += tracker; }); } catch (error) { - utils.logError('Error appending tracking pixel', error); + logError('Error appending tracking pixel', error); } Array.prototype.push.apply(bid.meta.advertiserDomains, bannerAd.adomain) @@ -207,7 +207,7 @@ function newRenderer(bidderResponse) { try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on newRenderer', err); + logWarn('Prebid Error calling setRender on newRenderer', err); } return renderer; diff --git a/modules/akamaiDAPIdSystem.js b/modules/akamaiDAPIdSystem.js index a78d65b40a9..5e3a607d5fd 100644 --- a/modules/akamaiDAPIdSystem.js +++ b/modules/akamaiDAPIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logMessage, logError } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -29,7 +29,7 @@ export const akamaiDAPIdSubmodule = { * @returns {{dapId:string}} */ decode(value) { - utils.logMessage('akamaiDAPId [decode] value=', value); + logMessage('akamaiDAPId [decode] value=', value); return { dapId: value }; }, @@ -43,23 +43,23 @@ export const akamaiDAPIdSubmodule = { getId(config, consentData) { const configParams = (config && config.params); if (!configParams) { - utils.logError('User ID - akamaiDAPId submodule requires a valid configParams'); + logError('User ID - akamaiDAPId submodule requires a valid configParams'); return; } else if (typeof configParams.apiHostname !== 'string') { - utils.logError('User ID - akamaiDAPId submodule requires a valid configParams.apiHostname'); + logError('User ID - akamaiDAPId submodule requires a valid configParams.apiHostname'); return; } else if (typeof configParams.domain !== 'string') { - utils.logError('User ID - akamaiDAPId submodule requires a valid configParams.domain'); + logError('User ID - akamaiDAPId submodule requires a valid configParams.domain'); return; } else if (typeof configParams.type !== 'string') { - utils.logError('User ID - akamaiDAPId submodule requires a valid configParams.type'); + logError('User ID - akamaiDAPId submodule requires a valid configParams.type'); return; } const hasGdpr = (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) ? 1 : 0; const gdprConsentString = hasGdpr ? consentData.consentString : ''; const uspConsent = uspDataHandler.getConsentData(); if (hasGdpr && (!gdprConsentString || gdprConsentString === '')) { - utils.logError('User ID - akamaiDAPId submodule requires consent string to call API'); + logError('User ID - akamaiDAPId submodule requires consent string to call API'); return; } // XXX: retrieve first-party data here if needed @@ -99,14 +99,14 @@ export const akamaiDAPIdSubmodule = { storage.setDataInLocalStorage(STORAGE_KEY, token); }, error: error => { - utils.logError('akamaiDAPId [getId:ajax.error] failed to retrieve ' + tokenName, error); + logError('akamaiDAPId [getId:ajax.error] failed to retrieve ' + tokenName, error); } }; ajax(url, cb, JSON.stringify(postData), { contentType: 'application/json' }); let token = storage.getDataFromLocalStorage(STORAGE_KEY); - utils.logMessage('akamaiDAPId [getId] returning', token); + logMessage('akamaiDAPId [getId] returning', token); return { id: token }; } diff --git a/modules/aniviewBidAdapter.js b/modules/aniviewBidAdapter.js index 83a1ab20bb4..96bdf153e3f 100644 --- a/modules/aniviewBidAdapter.js +++ b/modules/aniviewBidAdapter.js @@ -1,7 +1,7 @@ import { VIDEO, BANNER } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { Renderer } from '../src/Renderer.js'; -import * as utils from '../src/utils.js'; +import { logError } from '../src/utils.js'; const BIDDER_CODE = 'aniview'; const GVLID = 780; @@ -224,7 +224,7 @@ function interpretResponse(serverResponse, bidRequest) { }); bidResponse.vastUrl = window.URL.createObjectURL(blob); } catch (ex) { - utils.logError('Aniview Debug create vastXml error:\n\n' + ex); + logError('Aniview Debug create vastXml error:\n\n' + ex); } bidResponse.vastXml = xmlStr; if (bidRequest.bidRequest && bidRequest.bidRequest.mediaTypes && bidRequest.bidRequest.mediaTypes.video && bidRequest.bidRequest.mediaTypes.video.context === 'outstream') { diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index 4ab6f53ebdc..7203439059b 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isInteger, logError, isEmpty, logWarn, getUniqueIdentifierStr, _each, deepSetValue } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; @@ -64,7 +64,7 @@ function template(strings, ...keys) { let dict = values[values.length - 1] || {}; let result = [strings[0]]; keys.forEach(function (key, i) { - let value = utils.isInteger(key) ? values[key] : dict[key]; + let value = isInteger(key) ? values[key] : dict[key]; result.push(value, strings[i + 1]); }); return result.join(''); @@ -147,7 +147,7 @@ export const spec = { }, interpretResponse({ body }, bidRequest) { if (!body) { - utils.logError('Empty bid response', bidRequest.bidderCode, body); + logError('Empty bid response', bidRequest.bidderCode, body); } else { let bid = this._parseBidResponse(body, bidRequest); @@ -157,7 +157,7 @@ export const spec = { } }, getUserSyncs(options, serverResponses) { - const bidResponse = !utils.isEmpty(serverResponses) && serverResponses[0].body; + const bidResponse = !isEmpty(serverResponses) && serverResponses[0].body; if (bidResponse && bidResponse.ext && bidResponse.ext.pixels) { return this.parsePixelItems(bidResponse.ext.pixels); @@ -215,7 +215,7 @@ export const spec = { let server; if (!MP_SERVER_MAP.hasOwnProperty(regionParam)) { - utils.logWarn(`Unknown region '${regionParam}' for AOL bidder.`); + logWarn(`Unknown region '${regionParam}' for AOL bidder.`); regionParam = 'us'; // Default region. } @@ -234,7 +234,7 @@ export const spec = { placement: parseInt(params.placement), pageid: params.pageId || 0, sizeid: params.sizeId || 0, - alias: params.alias || utils.getUniqueIdentifierStr(), + alias: params.alias || getUniqueIdentifierStr(), misc: new Date().getTime(), // cache busting dynamicParams: this.formatMarketplaceDynamicParams(params, consentData) })); @@ -273,7 +273,7 @@ export const spec = { Object.assign(queryParams, this.formatConsentData(consentData)); let paramsFormatted = ''; - utils._each(queryParams, (value, key) => { + _each(queryParams, (value, key) => { paramsFormatted += `${key}=${encodeURIComponent(value)};`; }); @@ -287,7 +287,7 @@ export const spec = { Object.assign(params, this.formatConsentData(consentData)); let paramsFormatted = ''; - utils._each(params, (value, key) => { + _each(params, (value, key) => { paramsFormatted += `&${key}=${encodeURIComponent(value)}`; }); @@ -300,14 +300,14 @@ export const spec = { }; if (this.isEUConsentRequired(consentData)) { - utils.deepSetValue(openRtbObject, 'regs.ext.gdpr', NUMERIC_VALUES.TRUE); + deepSetValue(openRtbObject, 'regs.ext.gdpr', NUMERIC_VALUES.TRUE); if (consentData.gdpr.consentString) { - utils.deepSetValue(openRtbObject, 'user.ext.consent', consentData.gdpr.consentString); + deepSetValue(openRtbObject, 'user.ext.consent', consentData.gdpr.consentString); } } if (consentData.uspConsent) { - utils.deepSetValue(openRtbObject, 'regs.ext.us_privacy', consentData.uspConsent); + deepSetValue(openRtbObject, 'regs.ext.us_privacy', consentData.uspConsent); } if (typeof bid.userId === 'object') { @@ -328,7 +328,7 @@ export const spec = { formatKeyValues(keyValues) { let keyValuesHash = {}; - utils._each(keyValues, (value, key) => { + _each(keyValues, (value, key) => { keyValuesHash[`kv${key}`] = value; }); @@ -394,7 +394,7 @@ export const spec = { cpm = bidData.price; if (cpm === null || isNaN(cpm)) { - utils.logError('Invalid price in bid response', AOL_BIDDERS_CODES.AOL, bidData); + logError('Invalid price in bid response', AOL_BIDDERS_CODES.AOL, bidData); return; } } From a75058777d9346cc8e4f902108602f3e91a21d88 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 27 Sep 2021 12:32:17 -0700 Subject: [PATCH 096/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7490) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/krushmediaBidAdapter.js | 8 ++-- modules/kubientBidAdapter.js | 10 ++--- modules/limelightDigitalBidAdapter.js | 8 ++-- modules/liveIntentIdSystem.js | 9 ++--- modules/livewrappedAnalyticsAdapter.js | 26 ++++++------- modules/livewrappedBidAdapter.js | 14 +++---- modules/liveyieldAnalyticsAdapter.js | 26 ++++++------- modules/lockerdomeBidAdapter.js | 4 +- modules/loganBidAdapter.js | 8 ++-- modules/lotamePanoramaIdSystem.js | 26 ++++++------- modules/lunamediahbBidAdapter.js | 4 +- modules/madvertiseBidAdapter.js | 6 +-- modules/marsmediaBidAdapter.js | 52 +++++++++++++------------- modules/mathildeadsBidAdapter.js | 10 ++--- modules/mediaforceBidAdapter.js | 22 +++++------ 15 files changed, 116 insertions(+), 117 deletions(-) diff --git a/modules/krushmediaBidAdapter.js b/modules/krushmediaBidAdapter.js index db024230e2a..da68bddcb7b 100644 --- a/modules/krushmediaBidAdapter.js +++ b/modules/krushmediaBidAdapter.js @@ -1,6 +1,6 @@ +import { isFn, deepAccess, logMessage } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'krushmedia'; const AD_URL = 'https://ads4.krushmedia.com/?c=rtb&m=hb'; @@ -24,8 +24,8 @@ function isBidResponseValid(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -56,7 +56,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; const placements = []; diff --git a/modules/kubientBidAdapter.js b/modules/kubientBidAdapter.js index 6751a8a567c..07c614230a7 100644 --- a/modules/kubientBidAdapter.js +++ b/modules/kubientBidAdapter.js @@ -1,6 +1,6 @@ +import { isArray, deepAccess } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'kubient'; const END_POINT = 'https://kssp.kbntx.ch/kubprebidjs'; @@ -96,7 +96,7 @@ export const spec = { ad: bid.adm, meta: {} }; - if (bid.meta && bid.meta.adomain && utils.isArray(bid.meta.adomain)) { + if (bid.meta && bid.meta.adomain && isArray(bid.meta.adomain)) { bidResponse.meta.advertiserDomains = bid.meta.adomain; } if (bid.mediaType === VIDEO) { @@ -137,13 +137,13 @@ export const spec = { function kubientGetConsentGiven(gdprConsent) { let consentGiven = 0; if (typeof gdprConsent !== 'undefined') { - let apiVersion = utils.deepAccess(gdprConsent, `apiVersion`); + let apiVersion = deepAccess(gdprConsent, `apiVersion`); switch (apiVersion) { case 1: - consentGiven = utils.deepAccess(gdprConsent, `vendorData.vendorConsents.${VENDOR_ID}`) ? 1 : 0; + consentGiven = deepAccess(gdprConsent, `vendorData.vendorConsents.${VENDOR_ID}`) ? 1 : 0; break; case 2: - consentGiven = utils.deepAccess(gdprConsent, `vendorData.vendor.consents.${VENDOR_ID}`) ? 1 : 0; + consentGiven = deepAccess(gdprConsent, `vendorData.vendor.consents.${VENDOR_ID}`) ? 1 : 0; break; } } diff --git a/modules/limelightDigitalBidAdapter.js b/modules/limelightDigitalBidAdapter.js index 6203e22d253..5ad20924067 100644 --- a/modules/limelightDigitalBidAdapter.js +++ b/modules/limelightDigitalBidAdapter.js @@ -1,7 +1,7 @@ +import { logMessage, groupBy, uniques } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import {ajax} from '../src/ajax.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'limelightDigital'; @@ -51,10 +51,10 @@ export const spec = { winTop = window.top; winTop.location.toString(); } catch (e) { - utils.logMessage(e); + logMessage(e); winTop = window; } - const placements = utils.groupBy(validBidRequests.map(bidRequest => buildPlacement(bidRequest)), 'host') + const placements = groupBy(validBidRequests.map(bidRequest => buildPlacement(bidRequest)), 'host') return Object.keys(placements) .map(host => buildRequest(winTop, host, placements[host].map(placement => placement.adUnit))); }, @@ -125,7 +125,7 @@ function buildPlacement(bidRequest) { break; } } - sizes = (sizes || []).concat(bidRequest.sizes || []).filter(utils.uniques); + sizes = (sizes || []).concat(bidRequest.sizes || []).filter(uniques); return { host: bidRequest.params.host, adUnit: { diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index 5a955eefa92..91415daa497 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -4,8 +4,7 @@ * @module modules/liveIntentIdSystem * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; -import { triggerPixel } from '../src/utils.js'; +import { triggerPixel, logError } from '../src/utils.js'; import { ajaxBuilder } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { LiveConnect } from 'live-connect-js/esm/initializer.js'; @@ -93,8 +92,8 @@ function initializeLiveConnect(configParams) { liveConnectConfig.gdprConsent = gdprConsent.consentString; } - // The second param is the storage object, LS & Cookie manipulation uses PBJS utils. - // The third param is the ajax and pixel object, the ajax and pixel use PBJS utils. + // The second param is the storage object, LS & Cookie manipulation uses PBJS + // The third param is the ajax and pixel object, the ajax and pixel use PBJS liveConnect = liveIntentIdSubmodule.getInitializer()(liveConnectConfig, storage, calls); if (configParams.emailHash) { liveConnect.push({ hash: configParams.emailHash }) @@ -169,7 +168,7 @@ export const liveIntentIdSubmodule = { callback(response); }, error => { - utils.logError(`${MODULE_NAME}: ID fetch encountered an error: `, error); + logError(`${MODULE_NAME}: ID fetch encountered an error: `, error); callback(); } ) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 29b57e3dd97..03e5eea6974 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { timestamp, logInfo, getWindowTop } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; @@ -21,16 +21,16 @@ const cache = { let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE}), { track({eventType, args}) { - const time = utils.timestamp(); - utils.logInfo('LIVEWRAPPED_EVENT:', [eventType, args]); + const time = timestamp(); + logInfo('LIVEWRAPPED_EVENT:', [eventType, args]); switch (eventType) { case CONSTANTS.EVENTS.AUCTION_INIT: - utils.logInfo('LIVEWRAPPED_AUCTION_INIT:', args); + logInfo('LIVEWRAPPED_AUCTION_INIT:', args); cache.auctions[args.auctionId] = {bids: {}, bidAdUnits: {}}; break; case CONSTANTS.EVENTS.BID_REQUESTED: - utils.logInfo('LIVEWRAPPED_BID_REQUESTED:', args); + logInfo('LIVEWRAPPED_BID_REQUESTED:', args); cache.auctions[args.auctionId].timeStamp = args.start; args.bids.forEach(function(bidRequest) { @@ -62,12 +62,12 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE lw: bidRequest.lw } - utils.logInfo(bidRequest); + logInfo(bidRequest); }) - utils.logInfo(livewrappedAnalyticsAdapter.requestEvents); + logInfo(livewrappedAnalyticsAdapter.requestEvents); break; case CONSTANTS.EVENTS.BID_RESPONSE: - utils.logInfo('LIVEWRAPPED_BID_RESPONSE:', args); + logInfo('LIVEWRAPPED_BID_RESPONSE:', args); let bidResponse = cache.auctions[args.auctionId].bids[args.requestId]; bidResponse.isBid = args.getStatusCode() === CONSTANTS.STATUS.GOOD; @@ -90,7 +90,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE } break; case CONSTANTS.EVENTS.BIDDER_DONE: - utils.logInfo('LIVEWRAPPED_BIDDER_DONE:', args); + logInfo('LIVEWRAPPED_BIDDER_DONE:', args); args.bids.forEach(doneBid => { let bid = cache.auctions[doneBid.auctionId].bids[doneBid.bidId || doneBid.requestId]; if (!bid.ttr) { @@ -100,7 +100,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE }); break; case CONSTANTS.EVENTS.BID_WON: - utils.logInfo('LIVEWRAPPED_BID_WON:', args); + logInfo('LIVEWRAPPED_BID_WON:', args); let wonBid = cache.auctions[args.auctionId].bids[args.requestId]; wonBid.won = true; if (wonBid.sendStatus != 0) { @@ -108,13 +108,13 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE } break; case CONSTANTS.EVENTS.BID_TIMEOUT: - utils.logInfo('LIVEWRAPPED_BID_TIMEOUT:', args); + logInfo('LIVEWRAPPED_BID_TIMEOUT:', args); args.forEach(timeout => { cache.auctions[timeout.auctionId].bids[timeout.bidId].timeout = true; }); break; case CONSTANTS.EVENTS.AUCTION_END: - utils.logInfo('LIVEWRAPPED_AUCTION_END:', args); + logInfo('LIVEWRAPPED_AUCTION_END:', args); setTimeout(() => { livewrappedAnalyticsAdapter.sendEvents(); }, BID_WON_TIMEOUT); @@ -159,7 +159,7 @@ livewrappedAnalyticsAdapter.sendEvents = function() { function getAdblockerRecovered() { try { - return utils.getWindowTop().I12C && utils.getWindowTop().I12C.Morph === 1; + return getWindowTop().I12C && getWindowTop().I12C.Morph === 1; } catch (e) {} } diff --git a/modules/livewrappedBidAdapter.js b/modules/livewrappedBidAdapter.js index 93552638007..84b80ac14d4 100644 --- a/modules/livewrappedBidAdapter.js +++ b/modules/livewrappedBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isSafariBrowser, deepAccess, getWindowTop } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import find from 'core-js-pure/features/array/find.js'; @@ -83,7 +83,7 @@ export const spec = { gdprConsent: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.consentString : undefined, coppa: getCoppa(), usPrivacy: bidderRequest.uspConsent, - cookieSupport: !utils.isSafariBrowser() && storage.cookiesAreEnabled(), + cookieSupport: !isSafariBrowser() && storage.cookiesAreEnabled(), rcv: getAdblockerRecovered(), adRequests: [...adRequests], rtbData: handleEids(bidRequests), @@ -228,11 +228,11 @@ function bidToAdRequest(bid) { adRequest.auc = bid.auc; } - adRequest.native = utils.deepAccess(bid, 'mediaTypes.native'); + adRequest.native = deepAccess(bid, 'mediaTypes.native'); - adRequest.video = utils.deepAccess(bid, 'mediaTypes.video'); + adRequest.video = deepAccess(bid, 'mediaTypes.video'); - if ((adRequest.native || adRequest.video) && utils.deepAccess(bid, 'mediaTypes.banner')) { + if ((adRequest.native || adRequest.video) && deepAccess(bid, 'mediaTypes.banner')) { adRequest.banner = true; } @@ -240,7 +240,7 @@ function bidToAdRequest(bid) { } function getSizes(bid) { - if (utils.deepAccess(bid, 'mediaTypes.banner.sizes')) { + if (deepAccess(bid, 'mediaTypes.banner.sizes')) { return bid.mediaTypes.banner.sizes; } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) { return bid.sizes; @@ -257,7 +257,7 @@ function sizeToFormat(size) { function getAdblockerRecovered() { try { - return utils.getWindowTop().I12C && utils.getWindowTop().I12C.Morph === 1; + return getWindowTop().I12C && getWindowTop().I12C.Morph === 1; } catch (e) {} } diff --git a/modules/liveyieldAnalyticsAdapter.js b/modules/liveyieldAnalyticsAdapter.js index d80a7067f2e..411b76a5149 100644 --- a/modules/liveyieldAnalyticsAdapter.js +++ b/modules/liveyieldAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { logError } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; const { EVENTS: { BID_REQUESTED, BID_TIMEOUT, BID_RESPONSE, BID_WON } @@ -198,7 +198,7 @@ const liveyield = Object.assign(adapter({ analyticsType: 'bundle' }), { args.bidderCode ); } catch (e) { - utils.logError(e); + logError(e); } }); break; @@ -220,7 +220,7 @@ const liveyield = Object.assign(adapter({ analyticsType: 'bundle' }), { args.statusMessage !== 'Bid available' ); } catch (e) { - utils.logError(e); + logError(e); } break; case BID_TIMEOUT: @@ -243,7 +243,7 @@ const liveyield = Object.assign(adapter({ analyticsType: 'bundle' }), { ) ); if (!ad) { - utils.logError( + logError( 'Cannot find ad by unit name: ' + liveyield.instanceConfig.getAdUnitName( liveyield.instanceConfig.getPlacementOrAdUnitCode( @@ -255,7 +255,7 @@ const liveyield = Object.assign(adapter({ analyticsType: 'bundle' }), { break; } if (!args.bidderCode || !args.cpm) { - utils.logError('Bidder code or cpm is not valid'); + logError('Bidder code or cpm is not valid'); break; } const resolution = { targetings: [] }; @@ -280,7 +280,7 @@ const liveyield = Object.assign(adapter({ analyticsType: 'bundle' }), { resolutionToUse ); } catch (e) { - utils.logError(e); + logError(e); } break; } @@ -310,27 +310,27 @@ liveyield.originEnableAnalytics = liveyield.enableAnalytics; */ liveyield.enableAnalytics = function(config) { if (!config || !config.provider || config.provider !== 'liveyield') { - utils.logError('expected config.provider to equal liveyield'); + logError('expected config.provider to equal liveyield'); return; } if (!config.options) { - utils.logError('options must be defined'); + logError('options must be defined'); return; } if (!config.options.customerId) { - utils.logError('options.customerId is required'); + logError('options.customerId is required'); return; } if (!config.options.customerName) { - utils.logError('options.customerName is required'); + logError('options.customerName is required'); return; } if (!config.options.customerSite) { - utils.logError('options.customerSite is required'); + logError('options.customerSite is required'); return; } if (!config.options.sessionTimezoneOffset) { - utils.logError('options.sessionTimezoneOffset is required'); + logError('options.sessionTimezoneOffset is required'); return; } liveyield.instanceConfig = Object.assign( @@ -340,7 +340,7 @@ liveyield.enableAnalytics = function(config) { ); if (typeof window[liveyield.instanceConfig.rtaFunctionName] !== 'function') { - utils.logError( + logError( `Function ${liveyield.instanceConfig.rtaFunctionName} is not defined.` + `Make sure that LiveYield snippet in included before the Prebid Analytics configuration.` ); diff --git a/modules/lockerdomeBidAdapter.js b/modules/lockerdomeBidAdapter.js index 4e30519c6d3..66accb4e02a 100644 --- a/modules/lockerdomeBidAdapter.js +++ b/modules/lockerdomeBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { getBidIdParameter } from '../src/utils.js'; import {BANNER} from '../src/mediaTypes.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; @@ -16,7 +16,7 @@ export const spec = { return { requestId: bid.bidId, adUnitCode: bid.adUnitCode, - adUnitId: utils.getBidIdParameter('adUnitId', bid.params), + adUnitId: getBidIdParameter('adUnitId', bid.params), sizes: bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes }; }); diff --git a/modules/loganBidAdapter.js b/modules/loganBidAdapter.js index ae6d7a344d3..75327453b2e 100644 --- a/modules/loganBidAdapter.js +++ b/modules/loganBidAdapter.js @@ -1,6 +1,6 @@ +import { isFn, deepAccess, getWindowTop } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; import {config} from '../src/config.js'; const BIDDER_CODE = 'logan'; @@ -25,8 +25,8 @@ function isBidResponseValid(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -50,7 +50,7 @@ export const spec = { }, buildRequests: (validBidRequests = [], bidderRequest) => { - const winTop = utils.getWindowTop(); + const winTop = getWindowTop(); const location = winTop.location; const placements = []; const request = { diff --git a/modules/lotamePanoramaIdSystem.js b/modules/lotamePanoramaIdSystem.js index 6d36687b4e8..9abebb5533c 100644 --- a/modules/lotamePanoramaIdSystem.js +++ b/modules/lotamePanoramaIdSystem.js @@ -4,7 +4,7 @@ * @module modules/lotamePanoramaId * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; +import { timestamp, isStr, logError, isBoolean, buildUrl, isEmpty, isArray } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -28,7 +28,7 @@ let cookieDomain; */ function setProfileId(profileId) { if (storage.cookiesAreEnabled()) { - let expirationDate = new Date(utils.timestamp() + NINE_MONTHS_MS).toUTCString(); + let expirationDate = new Date(timestamp() + NINE_MONTHS_MS).toUTCString(); storage.setCookie( KEY_PROFILE, profileId, @@ -88,7 +88,7 @@ function getFromStorage(key) { function saveLotameCache( key, value, - expirationTimestamp = utils.timestamp() + DAYS_TO_CACHE * DAY_MS + expirationTimestamp = timestamp() + DAYS_TO_CACHE * DAY_MS ) { if (key && value) { let expirationDate = new Date(expirationTimestamp).toUTCString(); @@ -124,11 +124,11 @@ function getLotameLocalCache() { try { const rawExpiry = getFromStorage(KEY_EXPIRY); - if (utils.isStr(rawExpiry)) { + if (isStr(rawExpiry)) { cache.expiryTimestampMs = parseInt(rawExpiry, 10); } } catch (error) { - utils.logError(error); + logError(error); } return cache; @@ -178,7 +178,7 @@ export const lotamePanoramaIdSubmodule = { * @returns {(Object|undefined)} */ decode(value, config) { - return utils.isStr(value) ? { lotamePanoramaId: value } : undefined; + return isStr(value) ? { lotamePanoramaId: value } : undefined; }, /** @@ -211,7 +211,7 @@ export const lotamePanoramaIdSubmodule = { let consentString; if (consentData) { - if (utils.isBoolean(consentData.gdprApplies)) { + if (isBoolean(consentData.gdprApplies)) { queryParams.gdpr_applies = consentData.gdprApplies; } consentString = consentData.consentString; @@ -226,11 +226,11 @@ export const lotamePanoramaIdSubmodule = { if (consentString) { queryParams.gdpr_consent = consentString; } - const url = utils.buildUrl({ + const url = buildUrl({ protocol: 'https', host: `id.crwdcntrl.net`, pathname: '/id', - search: utils.isEmpty(queryParams) ? undefined : queryParams, + search: isEmpty(queryParams) ? undefined : queryParams, }); ajax( url, @@ -240,18 +240,18 @@ export const lotamePanoramaIdSubmodule = { try { let responseObj = JSON.parse(response); const shouldUpdateProfileId = !( - utils.isArray(responseObj.errors) && + isArray(responseObj.errors) && responseObj.errors.indexOf(MISSING_CORE_CONSENT) !== -1 ); saveLotameCache(KEY_EXPIRY, responseObj.expiry_ts, responseObj.expiry_ts); - if (utils.isStr(responseObj.profile_id)) { + if (isStr(responseObj.profile_id)) { if (shouldUpdateProfileId) { setProfileId(responseObj.profile_id); } - if (utils.isStr(responseObj.core_id)) { + if (isStr(responseObj.core_id)) { saveLotameCache( KEY_ID, responseObj.core_id, @@ -268,7 +268,7 @@ export const lotamePanoramaIdSubmodule = { clearLotameCache(KEY_ID); } } catch (error) { - utils.logError(error); + logError(error); } } callback(coreId); diff --git a/modules/lunamediahbBidAdapter.js b/modules/lunamediahbBidAdapter.js index 1376d0c1714..2798eef33e4 100644 --- a/modules/lunamediahbBidAdapter.js +++ b/modules/lunamediahbBidAdapter.js @@ -1,6 +1,6 @@ +import { logMessage } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'lunamediahb'; const AD_URL = 'https://balancer.lmgssp.com/?c=o&m=multi'; @@ -38,7 +38,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; const placements = []; diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 219295f0d50..457ff2409b8 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { parseSizesInput, _each } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; @@ -15,7 +15,7 @@ export const spec = { if (typeof bid.params !== 'object') { return false; } - let sizes = utils.parseSizesInput(bid.sizes); + let sizes = parseSizesInput(bid.sizes); if (!sizes || sizes.length === 0) { return false; } @@ -46,7 +46,7 @@ export const spec = { } } - utils._each(bidRequest.params, (item, key) => src = src + '&' + key + '=' + item); + _each(bidRequest.params, (item, key) => src = src + '&' + key + '=' + item); if (typeof bidRequest.params.u == 'undefined') { src = src + '&u=' + navigator.userAgent; diff --git a/modules/marsmediaBidAdapter.js b/modules/marsmediaBidAdapter.js index bb1763ebb2e..79e2148084a 100644 --- a/modules/marsmediaBidAdapter.js +++ b/modules/marsmediaBidAdapter.js @@ -1,6 +1,6 @@ -'use strict'; -import * as utils from '../src/utils.js'; +'use strict'; +import { deepAccess, getDNT, parseSizesInput, isArray, getWindowTop, deepSetValue, triggerPixel, getWindowSelf } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -42,13 +42,13 @@ function MarsmediaAdapter() { impObj.id = BRs[i].adUnitCode; impObj.secure = isSecure; - if (utils.deepAccess(BRs[i], 'mediaTypes.banner') || utils.deepAccess(BRs[i], 'mediaType') === 'banner') { + if (deepAccess(BRs[i], 'mediaTypes.banner') || deepAccess(BRs[i], 'mediaType') === 'banner') { let banner = frameBanner(BRs[i]); if (banner) { impObj.banner = banner; } } - if (utils.deepAccess(BRs[i], 'mediaTypes.video') || utils.deepAccess(BRs[i], 'mediaType') === 'video') { + if (deepAccess(BRs[i], 'mediaTypes.video') || deepAccess(BRs[i], 'mediaType') === 'video') { impObj.video = frameVideo(BRs[i]); } if (!(impObj.banner || impObj.video)) { @@ -87,7 +87,7 @@ function MarsmediaAdapter() { return { ua: navigator.userAgent, ip: '', // Empty Ip string is required, server gets the ip from HTTP header - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, } } @@ -107,7 +107,7 @@ function MarsmediaAdapter() { if (adUnit.mediaTypes && adUnit.mediaTypes.banner) { sizeList = adUnit.mediaTypes.banner.sizes; } - var sizeStringList = utils.parseSizesInput(sizeList); + var sizeStringList = parseSizesInput(sizeList); var format = []; sizeStringList.forEach(function(size) { if (size) { @@ -131,9 +131,9 @@ function MarsmediaAdapter() { function frameVideo(bid) { var size = []; - if (utils.deepAccess(bid, 'mediaTypes.video.playerSize')) { + if (deepAccess(bid, 'mediaTypes.video.playerSize')) { var dimensionSet = bid.mediaTypes.video.playerSize; - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + if (isArray(bid.mediaTypes.video.playerSize[0])) { dimensionSet = bid.mediaTypes.video.playerSize[0]; } var validSize = getValidSizeSet(dimensionSet) @@ -142,29 +142,29 @@ function MarsmediaAdapter() { } } return { - mimes: utils.deepAccess(bid, 'mediaTypes.video.mimes') || SUPPORTED_VIDEO_MIMES, - protocols: utils.deepAccess(bid, 'mediaTypes.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS, + mimes: deepAccess(bid, 'mediaTypes.video.mimes') || SUPPORTED_VIDEO_MIMES, + protocols: deepAccess(bid, 'mediaTypes.video.protocols') || SUPPORTED_VIDEO_PROTOCOLS, w: size[0], h: size[1], - startdelay: utils.deepAccess(bid, 'mediaTypes.video.startdelay') || 0, - skip: utils.deepAccess(bid, 'mediaTypes.video.skip') || 0, - playbackmethod: utils.deepAccess(bid, 'mediaTypes.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS, - delivery: utils.deepAccess(bid, 'mediaTypes.video.delivery') || SUPPORTED_VIDEO_DELIVERY, - api: utils.deepAccess(bid, 'mediaTypes.video.api') || SUPPORTED_VIDEO_API, + startdelay: deepAccess(bid, 'mediaTypes.video.startdelay') || 0, + skip: deepAccess(bid, 'mediaTypes.video.skip') || 0, + playbackmethod: deepAccess(bid, 'mediaTypes.video.playbackmethod') || SUPPORTED_VIDEO_PLAYBACK_METHODS, + delivery: deepAccess(bid, 'mediaTypes.video.delivery') || SUPPORTED_VIDEO_DELIVERY, + api: deepAccess(bid, 'mediaTypes.video.api') || SUPPORTED_VIDEO_API, } } function frameExt(bid) { if ((bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes)) { let bidSizes = (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes) || bid.sizes; - bidSizes = ((utils.isArray(bidSizes) && utils.isArray(bidSizes[0])) ? bidSizes : [bidSizes]); - bidSizes = bidSizes.filter(size => utils.isArray(size)); + bidSizes = ((isArray(bidSizes) && isArray(bidSizes[0])) ? bidSizes : [bidSizes]); + bidSizes = bidSizes.filter(size => isArray(size)); const processedSizes = bidSizes.map(size => ({w: parseInt(size[0], 10), h: parseInt(size[1], 10)})); const element = document.getElementById(bid.adUnitCode); const minSize = _getMinSize(processedSizes); const viewabilityAmount = _isViewabilityMeasurable(element) - ? _getViewability(element, utils.getWindowTop(), minSize) + ? _getViewability(element, getWindowTop(), minSize) : 'na'; const viewabilityAmountRounded = isNaN(viewabilityAmount) ? viewabilityAmount : Math.round(viewabilityAmount); @@ -192,25 +192,25 @@ function MarsmediaAdapter() { device: frameDevice(), user: { ext: { - consent: utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies') ? bidderRequest.gdprConsent.consentString : '' + consent: deepAccess(bidderRequest, 'gdprConsent.gdprApplies') ? bidderRequest.gdprConsent.consentString : '' } }, at: 1, tmax: 650, regs: { ext: { - gdpr: utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies') ? Boolean(bidderRequest.gdprConsent.gdprApplies & 1) : false + gdpr: deepAccess(bidderRequest, 'gdprConsent.gdprApplies') ? Boolean(bidderRequest.gdprConsent.gdprApplies & 1) : false } } }; if (BRs[0].schain) { - utils.deepSetValue(bid, 'source.ext.schain', BRs[0].schain); + deepSetValue(bid, 'source.ext.schain', BRs[0].schain); } if (bidderRequest.uspConsent) { - utils.deepSetValue(bid, 'regs.ext.us_privacy', bidderRequest.uspConsent) + deepSetValue(bid, 'regs.ext.us_privacy', bidderRequest.uspConsent) } if (config.getConfig('coppa') === true) { - utils.deepSetValue(bid, 'regs.coppa', config.getConfig('coppa') & 1) + deepSetValue(bid, 'regs.coppa', config.getConfig('coppa') & 1) } return bid; @@ -255,7 +255,7 @@ function MarsmediaAdapter() { /\$\{AUCTION_PRICE\}/, cpm ); - utils.triggerPixel(bid.nurl, null); + triggerPixel(bid.nurl, null); }; sendbeacon(bid, 17) }; @@ -320,7 +320,7 @@ function MarsmediaAdapter() { function sendbeacon(bid, type) { const bidString = JSON.stringify(bid); const encodedBuf = window.btoa(bidString); - utils.triggerPixel('https://ping-hqx-1.go2speed.media/notification/rtb/beacon/?bt=' + type + '&bid=3mhdom&hb_j=' + encodedBuf, null); + triggerPixel('https://ping-hqx-1.go2speed.media/notification/rtb/beacon/?bt=' + type + '&bid=3mhdom&hb_j=' + encodedBuf, null); } /** @@ -359,7 +359,7 @@ function MarsmediaAdapter() { function _isIframe() { try { - return utils.getWindowSelf() !== utils.getWindowTop(); + return getWindowSelf() !== getWindowTop(); } catch (e) { return true; } diff --git a/modules/mathildeadsBidAdapter.js b/modules/mathildeadsBidAdapter.js index 096b655c3be..3f5d94f0df2 100644 --- a/modules/mathildeadsBidAdapter.js +++ b/modules/mathildeadsBidAdapter.js @@ -1,6 +1,6 @@ +import { isFn, deepAccess, logMessage } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; import {config} from '../src/config.js'; const BIDDER_CODE = 'mathildeads'; @@ -71,8 +71,8 @@ function getPlacementReqData (bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -121,7 +121,7 @@ export const spec = { deviceHeight = winTop.screen.height; winLocation = winTop.location; } catch (e) { - utils.logMessage(e); + logMessage(e); winLocation = window.location; } @@ -130,7 +130,7 @@ export const spec = { try { refferLocation = refferUrl && new URL(refferUrl); } catch (e) { - utils.logMessage(e); + logMessage(e); } let location = refferLocation || winLocation; diff --git a/modules/mediaforceBidAdapter.js b/modules/mediaforceBidAdapter.js index 4c303ea9b37..7d4f22b7916 100644 --- a/modules/mediaforceBidAdapter.js +++ b/modules/mediaforceBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { getDNT, deepAccess, isStr, replaceAuctionPrice, triggerPixel, parseGPTSingleSizeArrayToRtbSize, isEmpty } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, NATIVE} from '../src/mediaTypes.js'; @@ -116,7 +116,7 @@ export const spec = { const referer = bidderRequest && bidderRequest.refererInfo ? encodeURIComponent(bidderRequest.refererInfo.referer) : ''; const auctionId = bidderRequest && bidderRequest.auctionId; const timeout = bidderRequest && bidderRequest.timeout; - const dnt = utils.getDNT() ? 1 : 0; + const dnt = getDNT() ? 1 : 0; const requestsMap = {}; const requests = []; let isTest = false; @@ -260,10 +260,10 @@ export const spec = { * @param {Bid} The bid that won the auction */ onBidWon: function(bid) { - const cpm = utils.deepAccess(bid, 'adserverTargeting.hb_pb') || ''; - if (utils.isStr(bid.burl) && bid.burl !== '') { - bid.burl = utils.replaceAuctionPrice(bid.burl, cpm); - utils.triggerPixel(bid.burl); + const cpm = deepAccess(bid, 'adserverTargeting.hb_pb') || ''; + if (isStr(bid.burl) && bid.burl !== '') { + bid.burl = replaceAuctionPrice(bid.burl, cpm); + triggerPixel(bid.burl); } }, }; @@ -280,9 +280,9 @@ function createBannerRequest(bid) { if (!sizes.length) return; let format = []; - let r = utils.parseGPTSingleSizeArrayToRtbSize(sizes[0]); + let r = parseGPTSingleSizeArrayToRtbSize(sizes[0]); for (let f = 1; f < sizes.length; f++) { - format.push(utils.parseGPTSingleSizeArrayToRtbSize(sizes[f])); + format.push(parseGPTSingleSizeArrayToRtbSize(sizes[f])); } if (format.length) { r.format = format @@ -303,15 +303,15 @@ function parseNative(native) { const {id, img, data, title} = asset; const key = NATIVE_ID_MAP[id]; if (key) { - if (!utils.isEmpty(title)) { + if (!isEmpty(title)) { result.title = title.text - } else if (!utils.isEmpty(img)) { + } else if (!isEmpty(img)) { result[key] = { url: img.url, height: img.h, width: img.w } - } else if (!utils.isEmpty(data)) { + } else if (!isEmpty(data)) { result[key] = data.value; } } From f4f634d0c1162cfe71350247c7764f3edc6dd029 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 27 Sep 2021 13:23:06 -0700 Subject: [PATCH 097/250] Multiple Bid/Analytics/ID Adapters: import utils functions as needed and not the whole module (#7479) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/apacdexBidAdapter.js | 32 ++++----- modules/appnexusBidAdapter.js | 118 +++++++++++++++---------------- modules/apstreamBidAdapter.js | 10 +-- modules/asoBidAdapter.js | 60 ++++++++-------- modules/astraoneBidAdapter.js | 4 +- modules/atsAnalyticsAdapter.js | 22 +++--- modules/audiencerunBidAdapter.js | 30 ++++---- modules/automatadBidAdapter.js | 4 +- modules/axonixBidAdapter.js | 14 ++-- modules/beachfrontBidAdapter.js | 46 ++++++------ modules/beopBidAdapter.js | 44 ++++++------ modules/bidViewabilityIO.js | 14 ++-- modules/bidglassBidAdapter.js | 16 ++--- modules/bidscubeBidAdapter.js | 6 +- modules/bizzclickBidAdapter.js | 20 +++--- 15 files changed, 220 insertions(+), 220 deletions(-) diff --git a/modules/apacdexBidAdapter.js b/modules/apacdexBidAdapter.js index 6c1c350b800..421eb99b4c1 100644 --- a/modules/apacdexBidAdapter.js +++ b/modules/apacdexBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isPlainObject, isArray, replaceAuctionPrice, isFn } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'apacdex'; @@ -32,16 +32,16 @@ export const spec = { if (!bid.params.siteId && !bid.params.placementId) { return false; } - if (!utils.deepAccess(bid, 'mediaTypes.banner') && !utils.deepAccess(bid, 'mediaTypes.video')) { + if (!deepAccess(bid, 'mediaTypes.banner') && !deepAccess(bid, 'mediaTypes.video')) { return false; } - if (utils.deepAccess(bid, 'mediaTypes.banner')) { // Not support multi type bids, favor banner over video - if (!utils.deepAccess(bid, 'mediaTypes.banner.sizes')) { + if (deepAccess(bid, 'mediaTypes.banner')) { // Not support multi type bids, favor banner over video + if (!deepAccess(bid, 'mediaTypes.banner.sizes')) { // sizes at the banner is required. return false; } - } else if (utils.deepAccess(bid, 'mediaTypes.video')) { - if (!utils.deepAccess(bid, 'mediaTypes.video.playerSize')) { + } else if (deepAccess(bid, 'mediaTypes.video')) { + if (!deepAccess(bid, 'mediaTypes.video.playerSize')) { // playerSize is required for instream adUnits. return false; } @@ -170,12 +170,12 @@ export const spec = { }, interpretResponse: function (serverResponse, bidRequest) { const serverBody = serverResponse.body; - if (!serverBody || !utils.isPlainObject(serverBody)) { + if (!serverBody || !isPlainObject(serverBody)) { return []; } const serverBids = serverBody.bids; - if (!serverBids || !utils.isArray(serverBids)) { + if (!serverBids || !isArray(serverBids)) { return []; } @@ -197,12 +197,12 @@ export const spec = { bidResponse.dealId = dealId; } if (bid.vastXml) { - bidResponse.vastXml = utils.replaceAuctionPrice(bid.vastXml, bid.cpm); + bidResponse.vastXml = replaceAuctionPrice(bid.vastXml, bid.cpm); } else { - bidResponse.ad = utils.replaceAuctionPrice(bid.ad, bid.cpm); + bidResponse.ad = replaceAuctionPrice(bid.ad, bid.cpm); } bidResponse.meta = {}; - if (bid.meta && bid.meta.advertiserDomains && utils.isArray(bid.meta.advertiserDomains)) { + if (bid.meta && bid.meta.advertiserDomains && isArray(bid.meta.advertiserDomains)) { bidResponse.meta.advertiserDomains = bid.meta.advertiserDomains; } bidResponses.push(bidResponse); @@ -285,7 +285,7 @@ function _extractTopWindowUrlFromBidderRequest(bidderRequest) { if (config.getConfig('pageUrl')) { return config.getConfig('pageUrl'); } - if (utils.deepAccess(bidderRequest, 'refererInfo.referer')) { + if (deepAccess(bidderRequest, 'refererInfo.referer')) { return bidderRequest.refererInfo.referer; } @@ -303,7 +303,7 @@ function _extractTopWindowUrlFromBidderRequest(bidderRequest) { * @returns {string} */ function _extractTopWindowReferrerFromBidderRequest(bidderRequest) { - if (bidderRequest && utils.deepAccess(bidderRequest, 'refererInfo.referer')) { + if (bidderRequest && deepAccess(bidderRequest, 'refererInfo.referer')) { return bidderRequest.refererInfo.referer; } @@ -340,7 +340,7 @@ export function getDomain(pageUrl) { * @returns {boolean} */ export function validateGeoObject(geo) { - if (!utils.isPlainObject(geo)) { + if (!isPlainObject(geo)) { return false; } if (!geo.lat) { @@ -362,7 +362,7 @@ export function validateGeoObject(geo) { * @returns {float||null} */ function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return (bid.params.floorPrice) ? bid.params.floorPrice : null; } @@ -371,7 +371,7 @@ function getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { return floor.floor; } return null; diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index 9882e71fe4f..7dcbd74d779 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -1,5 +1,5 @@ +import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, logError, logInfo, deepAccess, logMessage, convertTypes, isStr, getParameterByName, deepClone, chunk, logWarn, getBidRequest, createTrackPixelHtml, isEmpty, transformBidderParamKeywords, getMaxValueFromArray, fill, getMinValueFromArray, isArrayOfNums, isFn } from '../src/utils.js'; import { Renderer } from '../src/Renderer.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder, getIabSubCategory } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO, ADPOD } from '../src/mediaTypes.js'; @@ -109,13 +109,13 @@ export const spec = { Object.keys(userObjBid.params.user) .filter(param => includes(USER_PARAMS, param)) .forEach((param) => { - let uparam = utils.convertCamelToUnderscore(param); - if (param === 'segments' && utils.isArray(userObjBid.params.user[param])) { + let uparam = convertCamelToUnderscore(param); + if (param === 'segments' && isArray(userObjBid.params.user[param])) { let segs = []; userObjBid.params.user[param].forEach(val => { - if (utils.isNumber(val)) { + if (isNumber(val)) { segs.push({'id': val}); - } else if (utils.isPlainObject(val)) { + } else if (isPlainObject(val)) { segs.push(val); } }); @@ -152,7 +152,7 @@ export const spec = { try { debugObj = JSON.parse(debugCookie); } catch (e) { - utils.logError('AppNexus Debug Auction Cookie Error:\n\n' + e); + logError('AppNexus Debug Auction Cookie Error:\n\n' + e); } } else { const debugBidRequest = find(bidRequests, hasDebug); @@ -208,7 +208,7 @@ export const spec = { if (debugObjParams.enabled) { payload.debug = debugObjParams; - utils.logInfo('AppNexus Debug Auction Settings:\n\n' + JSON.stringify(debugObjParams, null, 4)); + logInfo('AppNexus Debug Auction Settings:\n\n' + JSON.stringify(debugObjParams, null, 4)); } if (bidderRequest && bidderRequest.gdprConsent) { @@ -253,12 +253,12 @@ export const spec = { if (bidRequests[0].userId) { let eids = []; - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.flocId.id`), 'chrome.com', null); - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.criteoId`), 'criteo.com', null); - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.netId`), 'netid.de', null); - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.idl_env`), 'liveramp.com', null); - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.tdid`), 'adserver.org', 'TDID'); - addUserId(eids, utils.deepAccess(bidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2'); + addUserId(eids, deepAccess(bidRequests[0], `userId.flocId.id`), 'chrome.com', null); + addUserId(eids, deepAccess(bidRequests[0], `userId.criteoId`), 'criteo.com', null); + addUserId(eids, deepAccess(bidRequests[0], `userId.netId`), 'netid.de', null); + addUserId(eids, deepAccess(bidRequests[0], `userId.idl_env`), 'liveramp.com', null); + addUserId(eids, deepAccess(bidRequests[0], `userId.tdid`), 'adserver.org', 'TDID'); + addUserId(eids, deepAccess(bidRequests[0], `userId.uid2.id`), 'uidapi.com', 'UID2'); if (eids.length) { payload.eids = eids; @@ -285,7 +285,7 @@ export const spec = { if (!serverResponse || serverResponse.error) { let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`; if (serverResponse && serverResponse.error) { errorMessage += `: ${serverResponse.error}`; } - utils.logError(errorMessage); + logError(errorMessage); return bids; } @@ -313,8 +313,8 @@ export const spec = { .replace(/

(.*)<\/h1>/gm, '\n\n===== $1 =====\n\n') // Header H1 .replace(/(.*)<\/h[2-6]>/gm, '\n\n*** $1 ***\n\n') // Headers .replace(/(<([^>]+)>)/igm, ''); // Remove any other tags - utils.logMessage('https://console.appnexus.com/docs/understanding-the-debug-auction'); - utils.logMessage(debugText); + logMessage('https://console.appnexus.com/docs/understanding-the-debug-auction'); + logMessage(debugText); } return bids; @@ -348,11 +348,11 @@ export const spec = { }, transformBidParams: function (params, isOpenRtb) { - params = utils.convertTypes({ + params = convertTypes({ 'member': 'string', 'invCode': 'string', 'placementId': 'number', - 'keywords': utils.transformBidderParamKeywords, + 'keywords': transformBidderParamKeywords, 'publisherId': 'number' }, params); @@ -365,7 +365,7 @@ export const spec = { } Object.keys(params).forEach(paramKey => { - let convertedKey = utils.convertCamelToUnderscore(paramKey); + let convertedKey = convertCamelToUnderscore(paramKey); if (convertedKey !== paramKey) { params[convertedKey] = params[paramKey]; delete params[paramKey]; @@ -388,7 +388,7 @@ export const spec = { } function isPopulatedArray(arr) { - return !!(utils.isArray(arr) && arr.length > 0); + return !!(isArray(arr) && arr.length > 0); } function deleteValues(keyPairObj) { @@ -460,9 +460,9 @@ function strIsAppnexusViewabilityScript(str) { function getAppnexusViewabilityScriptFromJsTrackers(jsTrackerArray) { let viewJsPayload; - if (utils.isStr(jsTrackerArray) && strIsAppnexusViewabilityScript(jsTrackerArray)) { + if (isStr(jsTrackerArray) && strIsAppnexusViewabilityScript(jsTrackerArray)) { viewJsPayload = jsTrackerArray; - } else if (utils.isArray(jsTrackerArray)) { + } else if (isArray(jsTrackerArray)) { for (let i = 0; i < jsTrackerArray.length; i++) { let currentJsTracker = jsTrackerArray[i]; if (strIsAppnexusViewabilityScript(currentJsTracker)) { @@ -486,7 +486,7 @@ function hasPurpose1Consent(bidderRequest) { let result = true; if (bidderRequest && bidderRequest.gdprConsent) { if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) { - result = !!(utils.deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true); + result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true); } } return result; @@ -504,16 +504,16 @@ function formatRequest(payload, bidderRequest) { endpointUrl = URL_SIMPLE; } - if (utils.getParameterByName('apn_test').toUpperCase() === 'TRUE' || config.getConfig('apn_test') === true) { + if (getParameterByName('apn_test').toUpperCase() === 'TRUE' || config.getConfig('apn_test') === true) { options.customHeaders = { 'X-Is-Test': 1 } } if (payload.tags.length > MAX_IMPS_PER_REQUEST) { - const clonedPayload = utils.deepClone(payload); + const clonedPayload = deepClone(payload); - utils.chunk(payload.tags, MAX_IMPS_PER_REQUEST).forEach(tags => { + chunk(payload.tags, MAX_IMPS_PER_REQUEST).forEach(tags => { clonedPayload.tags = tags; const payloadString = JSON.stringify(clonedPayload); request.push({ @@ -550,14 +550,14 @@ function newRenderer(adUnitCode, rtbBid, rendererOptions = {}) { try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } renderer.setEventHandlers({ - impression: () => utils.logMessage('AppNexus outstream video impression event'), - loaded: () => utils.logMessage('AppNexus outstream video loaded event'), + impression: () => logMessage('AppNexus outstream video impression event'), + loaded: () => logMessage('AppNexus outstream video loaded event'), ended: () => { - utils.logMessage('AppNexus outstream renderer video event'); + logMessage('AppNexus outstream renderer video event'); document.querySelector(`#${adUnitCode}`).style.display = 'none'; } }); @@ -572,7 +572,7 @@ function newRenderer(adUnitCode, rtbBid, rendererOptions = {}) { * @return Bid */ function newBid(serverBid, rtbBid, bidderRequest) { - const bidRequest = utils.getBidRequest(serverBid.uuid, [bidderRequest]); + const bidRequest = getBidRequest(serverBid.uuid, [bidderRequest]); const bid = { requestId: serverBid.uuid, cpm: rtbBid.cpm, @@ -607,7 +607,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { ttl: 3600 }); - const videoContext = utils.deepAccess(bidRequest, 'mediaTypes.video.context'); + const videoContext = deepAccess(bidRequest, 'mediaTypes.video.context'); switch (videoContext) { case ADPOD: const primaryCatId = getIabSubCategory(bidRequest.bidder, rtbBid.brand_category_id); @@ -628,7 +628,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { if (rtbBid.renderer_url) { const videoBid = find(bidderRequest.bids, bid => bid.bidId === serverBid.uuid); - const rendererOptions = utils.deepAccess(videoBid, 'renderer.options'); + const rendererOptions = deepAccess(videoBid, 'renderer.options'); bid.renderer = newRenderer(bid.adUnitCode, rtbBid, rendererOptions); } break; @@ -648,7 +648,7 @@ function newBid(serverBid, rtbBid, bidderRequest) { if (jsTrackers == undefined) { jsTrackers = jsTrackerDisarmed; - } else if (utils.isStr(jsTrackers)) { + } else if (isStr(jsTrackers)) { jsTrackers = [jsTrackers, jsTrackerDisarmed]; } else { jsTrackers.push(jsTrackerDisarmed); @@ -697,11 +697,11 @@ function newBid(serverBid, rtbBid, bidderRequest) { try { if (rtbBid.rtb.trackers) { const url = rtbBid.rtb.trackers[0].impression_urls[0]; - const tracker = utils.createTrackPixelHtml(url); + const tracker = createTrackPixelHtml(url); bid.ad += tracker; } } catch (error) { - utils.logError('Error appending tracking pixel', error); + logError('Error appending tracking pixel', error); } } @@ -751,8 +751,8 @@ function bidToTag(bid) { if (bid.params.externalImpId) { tag.external_imp_id = bid.params.externalImpId; } - if (!utils.isEmpty(bid.params.keywords)) { - let keywords = utils.transformBidderParamKeywords(bid.params.keywords); + if (!isEmpty(bid.params.keywords)) { + let keywords = transformBidderParamKeywords(bid.params.keywords); if (keywords.length > 0) { keywords.forEach(deleteValues); @@ -760,12 +760,12 @@ function bidToTag(bid) { tag.keywords = keywords; } - let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'); + let gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'); if (gpid) { tag.gpid = gpid; } - if (bid.mediaType === NATIVE || utils.deepAccess(bid, `mediaTypes.${NATIVE}`)) { + if (bid.mediaType === NATIVE || deepAccess(bid, `mediaTypes.${NATIVE}`)) { tag.ad_types.push(NATIVE); if (tag.sizes.length === 0) { tag.sizes = transformSizes([1, 1]); @@ -777,8 +777,8 @@ function bidToTag(bid) { } } - const videoMediaType = utils.deepAccess(bid, `mediaTypes.${VIDEO}`); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const videoMediaType = deepAccess(bid, `mediaTypes.${VIDEO}`); + const context = deepAccess(bid, 'mediaTypes.video.context'); if (videoMediaType && context === 'adpod') { tag.hb_source = 7; @@ -804,7 +804,7 @@ function bidToTag(bid) { case 'context': case 'playback_method': let type = bid.params.video[param]; - type = (utils.isArray(type)) ? type[0] : type; + type = (isArray(type)) ? type[0] : type; tag.video[param] = VIDEO_MAPPING[param][type]; break; // Deprecating tags[].video.frameworks in favor of tags[].video_frameworks @@ -815,7 +815,7 @@ function bidToTag(bid) { } }); - if (bid.params.video.frameworks && utils.isArray(bid.params.video.frameworks)) { + if (bid.params.video.frameworks && isArray(bid.params.video.frameworks)) { tag['video_frameworks'] = bid.params.video.frameworks; } } @@ -840,7 +840,7 @@ function bidToTag(bid) { case 'playbackmethod': if (typeof tag.video['playback_method'] !== 'number') { let type = videoMediaType[param]; - type = (utils.isArray(type)) ? type[0] : type; + type = (isArray(type)) ? type[0] : type; // we only support iab's options 1-4 at this time. if (type >= 1 && type <= 4) { @@ -849,7 +849,7 @@ function bidToTag(bid) { } break; case 'api': - if (!tag['video_frameworks'] && utils.isArray(videoMediaType[param])) { + if (!tag['video_frameworks'] && isArray(videoMediaType[param])) { // need to read thru array; remove 6 (we don't support it), swap 4 <> 5 if found (to match our adserver mapping for these specific values) let apiTmp = videoMediaType[param].map(val => { let v = (val === 4) ? 5 : (val === 5) ? 4 : val; @@ -869,7 +869,7 @@ function bidToTag(bid) { tag.video = Object.assign({}, tag.video, { custom_renderer_present: true }); } - if (bid.params.frameworks && utils.isArray(bid.params.frameworks)) { + if (bid.params.frameworks && isArray(bid.params.frameworks)) { tag['banner_frameworks'] = bid.params.frameworks; } @@ -890,8 +890,8 @@ function transformSizes(requestSizes) { let sizes = []; let sizeObj = {}; - if (utils.isArray(requestSizes) && requestSizes.length === 2 && - !utils.isArray(requestSizes[0])) { + if (isArray(requestSizes) && requestSizes.length === 2 && + !isArray(requestSizes[0])) { sizeObj.width = parseInt(requestSizes[0], 10); sizeObj.height = parseInt(requestSizes[1], 10); sizes.push(sizeObj); @@ -945,10 +945,10 @@ function hasOmidSupport(bid) { let hasOmid = false; const bidderParams = bid.params; const videoParams = bid.params.video; - if (bidderParams.frameworks && utils.isArray(bidderParams.frameworks)) { + if (bidderParams.frameworks && isArray(bidderParams.frameworks)) { hasOmid = includes(bid.params.frameworks, 6); } - if (!hasOmid && videoParams && videoParams.frameworks && utils.isArray(videoParams.frameworks)) { + if (!hasOmid && videoParams && videoParams.frameworks && isArray(videoParams.frameworks)) { hasOmid = includes(bid.params.video.frameworks, 6); } return hasOmid; @@ -963,14 +963,14 @@ function createAdPodRequest(tags, adPodBid) { const { durationRangeSec, requireExactDuration } = adPodBid.mediaTypes.video; const numberOfPlacements = getAdPodPlacementNumber(adPodBid.mediaTypes.video); - const maxDuration = utils.getMaxValueFromArray(durationRangeSec); + const maxDuration = getMaxValueFromArray(durationRangeSec); const tagToDuplicate = tags.filter(tag => tag.uuid === adPodBid.bidId); - let request = utils.fill(...tagToDuplicate, numberOfPlacements); + let request = fill(...tagToDuplicate, numberOfPlacements); if (requireExactDuration) { const divider = Math.ceil(numberOfPlacements / durationRangeSec.length); - const chunked = utils.chunk(request, divider); + const chunked = chunk(request, divider); // each configured duration is set as min/maxduration for a subset of requests durationRangeSec.forEach((duration, index) => { @@ -989,7 +989,7 @@ function createAdPodRequest(tags, adPodBid) { function getAdPodPlacementNumber(videoParams) { const { adPodDurationSec, durationRangeSec, requireExactDuration } = videoParams; - const minAllowedDuration = utils.getMinValueFromArray(durationRangeSec); + const minAllowedDuration = getMinValueFromArray(durationRangeSec); const numberOfPlacements = Math.floor(adPodDurationSec / minAllowedDuration); return requireExactDuration @@ -998,7 +998,7 @@ function getAdPodPlacementNumber(videoParams) { } function setVideoProperty(tag, key, value) { - if (utils.isEmpty(tag.video)) { tag.video = {}; } + if (isEmpty(tag.video)) { tag.video = {}; } tag.video[key] = value; } @@ -1029,7 +1029,7 @@ function buildNativeRequest(params) { const isImageAsset = !!(requestKey === NATIVE_MAPPING.image.serverName || requestKey === NATIVE_MAPPING.icon.serverName); if (isImageAsset && request[requestKey].sizes) { let sizes = request[requestKey].sizes; - if (utils.isArrayOfNums(sizes) || (utils.isArray(sizes) && sizes.length > 0 && sizes.every(sz => utils.isArrayOfNums(sz)))) { + if (isArrayOfNums(sizes) || (isArray(sizes) && sizes.length > 0 && sizes.every(sz => isArrayOfNums(sz)))) { request[requestKey].sizes = transformSizes(request[requestKey].sizes); } } @@ -1108,7 +1108,7 @@ function addUserId(eids, id, source, rti) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return (bid.params.reserve) ? bid.params.reserve : null; } @@ -1117,7 +1117,7 @@ function getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { return floor.floor; } return null; diff --git a/modules/apstreamBidAdapter.js b/modules/apstreamBidAdapter.js index 4fb89b9c720..f2d4189f237 100644 --- a/modules/apstreamBidAdapter.js +++ b/modules/apstreamBidAdapter.js @@ -1,6 +1,6 @@ +import { generateUUID, deepAccess, createTrackPixelHtml, getDNT } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; import { getStorageManager } from '../src/storageManager.js'; const CONSTANTS = { @@ -221,7 +221,7 @@ var dsuModule = (function() { } function generateDsu() { - var dsuId = utils.generateUUID(); + var dsuId = generateUUID(); var loc = location(); var dsuIdSuffix = hashWithKey(dsuId + loc.toString()); @@ -303,7 +303,7 @@ function getConsentStringFromPrebid(gdprConsentConfig) { } function getIabConsentString(bidderRequest) { - if (utils.deepAccess(bidderRequest, 'gdprConsent')) { + if (deepAccess(bidderRequest, 'gdprConsent')) { return getConsentStringFromPrebid(bidderRequest.gdprConsent); } @@ -318,7 +318,7 @@ function injectPixels(ad, pixels, scripts) { let trackedAd = ad; if (pixels) { pixels.forEach(pixel => { - const tracker = utils.createTrackPixelHtml(pixel); + const tracker = createTrackPixelHtml(pixel); trackedAd += tracker; }); } @@ -420,7 +420,7 @@ function buildRequests(bidRequests, bidderRequest) { med: encodeURIComponent(window.location.href), auid: bidderRequest.auctionId, ref: document.referrer, - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, sr: getScreenParams() }; diff --git a/modules/asoBidAdapter.js b/modules/asoBidAdapter.js index 8f06b8ed856..bf45b9ee48f 100644 --- a/modules/asoBidAdapter.js +++ b/modules/asoBidAdapter.js @@ -1,5 +1,5 @@ +import { _each, deepAccess, logWarn, tryAppendQueryString, inIframe, getWindowTop, parseUrl, parseSizesInput, isFn, getDNT, deepSetValue } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import {config} from '../src/config.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {Renderer} from '../src/Renderer.js'; @@ -22,16 +22,16 @@ export const spec = { buildRequests: (validBidRequests, bidderRequest) => { let serverRequests = []; - utils._each(validBidRequests, bidRequest => { + _each(validBidRequests, bidRequest => { const payload = createBasePayload(bidRequest, bidderRequest); - const bannerParams = utils.deepAccess(bidRequest, 'mediaTypes.banner'); - const videoParams = utils.deepAccess(bidRequest, 'mediaTypes.video'); + const bannerParams = deepAccess(bidRequest, 'mediaTypes.banner'); + const videoParams = deepAccess(bidRequest, 'mediaTypes.video'); let imp; if (bannerParams && videoParams) { - utils.logWarn('Please note, multiple mediaTypes are not supported. The only banner will be used.') + logWarn('Please note, multiple mediaTypes are not supported. The only banner will be used.') } if (bannerParams) { @@ -93,7 +93,7 @@ export const spec = { bid.ad = serverBid.adm; } else if (bid.mediaType === VIDEO) { bid.vastXml = serverBid.adm; - if (utils.deepAccess(bidRequest, 'mediaTypes.video.context') === 'outstream') { + if (deepAccess(bidRequest, 'mediaTypes.video.context') === 'outstream') { bid.adResponse = { content: bid.vastXml, }; @@ -112,25 +112,25 @@ export const spec = { if (serverResponses && serverResponses.length !== 0) { let query = ''; if (gdprConsent) { - query = utils.tryAppendQueryString(query, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); - query = utils.tryAppendQueryString(query, 'consents_str', gdprConsent.consentString); + query = tryAppendQueryString(query, 'gdpr', (gdprConsent.gdprApplies ? 1 : 0)); + query = tryAppendQueryString(query, 'consents_str', gdprConsent.consentString); const consentsIds = getConsentsIds(gdprConsent); if (consentsIds) { - query = utils.tryAppendQueryString(query, 'consents', consentsIds); + query = tryAppendQueryString(query, 'consents', consentsIds); } } if (uspConsent) { - query = utils.tryAppendQueryString(query, 'us_privacy', uspConsent); + query = tryAppendQueryString(query, 'us_privacy', uspConsent); } - utils._each(serverResponses, resp => { - const userSyncs = utils.deepAccess(resp, 'body.ext.user_syncs'); + _each(serverResponses, resp => { + const userSyncs = deepAccess(resp, 'body.ext.user_syncs'); if (!userSyncs) { return; } - utils._each(userSyncs, us => { + _each(userSyncs, us => { urls.push({ type: us.type, url: us.url + (query ? '?' + query : '') @@ -159,7 +159,7 @@ function createRenderer(bid, url) { id: bid.bidId, url: url, loaded: false, - config: utils.deepAccess(bid, 'renderer.options'), + config: deepAccess(bid, 'renderer.options'), adUnitCode: bid.adUnitCode }); renderer.setRender(outstreamRender); @@ -172,16 +172,16 @@ function getUrlsInfo(bidderRequest) { const {refererInfo} = bidderRequest; - if (utils.inIframe()) { + if (inIframe()) { page = refererInfo.referer; } else { - const w = utils.getWindowTop(); + const w = getWindowTop(); page = w.location.href; referrer = w.document.referrer || ''; } page = config.getConfig('pageUrl') || page; - const url = utils.parseUrl(page); + const url = parseUrl(page); const domain = url.hostname; return { @@ -192,7 +192,7 @@ function getUrlsInfo(bidderRequest) { } function getSize(paramSizes) { - const parsedSizes = utils.parseSizesInput(paramSizes); + const parsedSizes = parseSizesInput(paramSizes); const sizes = parsedSizes.map(size => { const [width, height] = size.split('x'); const w = parseInt(width, 10); @@ -204,7 +204,7 @@ function getSize(paramSizes) { } function getBidFloor(bidRequest, size) { - if (!utils.isFn(bidRequest.getFloor)) { + if (!isFn(bidRequest.getFloor)) { return null; } @@ -245,7 +245,7 @@ function createBannerImp(bidRequest, bannerParams) { imp.banner = { w: size.w, h: size.h, - topframe: utils.inIframe() ? 0 : 1 + topframe: inIframe() ? 0 : 1 } return imp; @@ -284,7 +284,7 @@ function getEnpoint(bidRequest) { } function getConsentsIds(gdprConsent) { - const consents = utils.deepAccess(gdprConsent, 'vendorData.purpose.consents', []); + const consents = deepAccess(gdprConsent, 'vendorData.purpose.consents', []); let consentsIds = []; Object.keys(consents).forEach(function (key) { @@ -310,7 +310,7 @@ function createBasePayload(bidRequest, bidderRequest) { ref: urlsInfo.referrer }, device: { - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, h: window.innerHeight, w: window.innerWidth, }, @@ -320,29 +320,29 @@ function createBasePayload(bidRequest, bidderRequest) { }; if (bidRequest.params.attr) { - utils.deepSetValue(payload, 'site.ext.attr', bidRequest.params.attr); + deepSetValue(payload, 'site.ext.attr', bidRequest.params.attr); } if (bidderRequest.gdprConsent) { - utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); const consentsIds = getConsentsIds(bidderRequest.gdprConsent); if (consentsIds) { - utils.deepSetValue(payload, 'user.ext.consents', consentsIds); + deepSetValue(payload, 'user.ext.consents', consentsIds); } - utils.deepSetValue(payload, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies & 1); + deepSetValue(payload, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies & 1); } if (bidderRequest.uspConsent) { - utils.deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); } if (config.getConfig('coppa')) { - utils.deepSetValue(payload, 'regs.coppa', 1); + deepSetValue(payload, 'regs.coppa', 1); } - const eids = utils.deepAccess(bidRequest, 'userIdAsEids'); + const eids = deepAccess(bidRequest, 'userIdAsEids'); if (eids && eids.length) { - utils.deepSetValue(payload, 'user.ext.eids', eids); + deepSetValue(payload, 'user.ext.eids', eids); } return payload; diff --git a/modules/astraoneBidAdapter.js b/modules/astraoneBidAdapter.js index 2fec3892d27..c233e665499 100644 --- a/modules/astraoneBidAdapter.js +++ b/modules/astraoneBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js' +import { _map } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js' import { BANNER } from '../src/mediaTypes.js' @@ -7,7 +7,7 @@ const SSP_ENDPOINT = 'https://ssp.astraone.io/auction/prebid'; const TTL = 60; function buildBidRequests(validBidRequests) { - return utils._map(validBidRequests, function(validBidRequest) { + return _map(validBidRequests, function(validBidRequest) { const params = validBidRequest.params; const bidRequest = { bidId: validBidRequest.bidId, diff --git a/modules/atsAnalyticsAdapter.js b/modules/atsAnalyticsAdapter.js index 0cff7bbd68f..df293556a4c 100644 --- a/modules/atsAnalyticsAdapter.js +++ b/modules/atsAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { logError, logInfo } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adaptermanager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import {getStorageManager} from '../src/storageManager.js'; @@ -256,7 +256,7 @@ export function parseBrowser() { let browserName = result && result.length ? result[0].name : ''; return (listOfSupportedBrowsers.indexOf(browserName) >= 0) ? browserName : 'Unknown'; } catch (err) { - utils.logError('ATS Analytics - Error while checking user browser!', err); + logError('ATS Analytics - Error while checking user browser!', err); } } @@ -265,20 +265,20 @@ function sendDataToAnalytic () { try { let dataToSend = {'Data': atsAnalyticsAdapter.context.events}; let strJSON = JSON.stringify(dataToSend); - utils.logInfo('ATS Analytics - tried to send analytics data!'); + logInfo('ATS Analytics - tried to send analytics data!'); ajax(analyticsUrl, function () { }, strJSON, {method: 'POST', contentType: 'application/json'}); } catch (err) { - utils.logError('ATS Analytics - request encounter an error: ', err); + logError('ATS Analytics - request encounter an error: ', err); } } // preflight request, to check did publisher have permission to send data to analytics endpoint function preflightRequest (envelopeSourceCookieValue) { - utils.logInfo('ATS Analytics - preflight request!'); + logInfo('ATS Analytics - preflight request!'); ajax(preflightUrl + atsAnalyticsAdapter.context.pid, function (data) { let samplingRateObject = JSON.parse(data); - utils.logInfo('ATS Analytics - Sampling Rate: ', samplingRateObject); + logInfo('ATS Analytics - Sampling Rate: ', samplingRateObject); let samplingRate = samplingRateObject['samplingRate']; setSamplingCookie(samplingRate); let samplingRateNumber = Number(samplingRate); @@ -332,7 +332,7 @@ let atsAnalyticsAdapter = Object.assign(adapter( } } } catch (err) { - utils.logError('ATS Analytics - preflight request encounter an error: ', err); + logError('ATS Analytics - preflight request encounter an error: ', err); } } } @@ -345,10 +345,10 @@ atsAnalyticsAdapter.originEnableAnalytics = atsAnalyticsAdapter.enableAnalytics; atsAnalyticsAdapter.shouldFireRequest = function (samplingRate) { if (samplingRate !== 0) { let shouldFireRequestValue = (Math.floor((Math.random() * 100 + 1)) === 100); - utils.logInfo('ATS Analytics - Should Fire Request: ', shouldFireRequestValue); + logInfo('ATS Analytics - Should Fire Request: ', shouldFireRequestValue); return shouldFireRequestValue; } else { - utils.logInfo('ATS Analytics - Should Fire Request: ', false); + logInfo('ATS Analytics - Should Fire Request: ', false); return false; } }; @@ -359,7 +359,7 @@ atsAnalyticsAdapter.getUserAgent = function () { // override enableAnalytics so we can get access to the config passed in from the page atsAnalyticsAdapter.enableAnalytics = function (config) { if (!config.options.pid) { - utils.logError('ATS Analytics - Publisher ID (pid) option is not defined. Analytics won\'t work'); + logError('ATS Analytics - Publisher ID (pid) option is not defined. Analytics won\'t work'); return; } atsAnalyticsAdapter.context = { @@ -367,7 +367,7 @@ atsAnalyticsAdapter.enableAnalytics = function (config) { pid: config.options.pid }; let initOptions = config.options; - utils.logInfo('ATS Analytics - adapter enabled! '); + logInfo('ATS Analytics - adapter enabled! '); atsAnalyticsAdapter.originEnableAnalytics(initOptions); // call the base class function }; diff --git a/modules/audiencerunBidAdapter.js b/modules/audiencerunBidAdapter.js index da0cbb39925..2c100bce27b 100644 --- a/modules/audiencerunBidAdapter.js +++ b/modules/audiencerunBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isFn, logError, getValue, getBidIdParameter, _each, isArray, triggerPixel } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; @@ -20,7 +20,7 @@ let requestedBids = []; function getPageUrl(bidderRequest) { return ( config.getConfig('pageUrl') || - utils.deepAccess(bidderRequest, 'refererInfo.referer') || + deepAccess(bidderRequest, 'refererInfo.referer') || null ); } @@ -32,8 +32,8 @@ function getPageUrl(bidderRequest) { * @returns {number} */ function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -61,8 +61,8 @@ export const spec = { */ isBidRequestValid: function (bid) { let isValid = true; - if (!utils.deepAccess(bid, 'params.zoneId')) { - utils.logError('AudienceRun zoneId parameter is required. Bid aborted.'); + if (!deepAccess(bid, 'params.zoneId')) { + logError('AudienceRun zoneId parameter is required. Bid aborted.'); isValid = false; } return isValid; @@ -77,19 +77,19 @@ export const spec = { */ buildRequests: function (bidRequests, bidderRequest) { const bids = bidRequests.map((bid) => { - const sizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes', []); + const sizes = deepAccess(bid, 'mediaTypes.banner.sizes', []); return { - zoneId: utils.getValue(bid.params, 'zoneId'), + zoneId: getValue(bid.params, 'zoneId'), sizes: sizes.map((size) => ({ w: size[0], h: size[1], })), bidfloor: getBidFloor(bid), bidId: bid.bidId, - bidderRequestId: utils.getBidIdParameter('bidderRequestId', bid), - adUnitCode: utils.getBidIdParameter('adUnitCode', bid), - auctionId: utils.getBidIdParameter('auctionId', bid), - transactionId: utils.getBidIdParameter('transactionId', bid), + bidderRequestId: getBidIdParameter('bidderRequestId', bid), + adUnitCode: getBidIdParameter('adUnitCode', bid), + auctionId: getBidIdParameter('auctionId', bid), + transactionId: getBidIdParameter('transactionId', bid), }; }); @@ -133,7 +133,7 @@ export const spec = { */ interpretResponse: function (serverResponse, bidRequest) { const bids = []; - utils._each(serverResponse.body.bid, function (bidObject) { + _each(serverResponse.body.bid, function (bidObject) { if (!bidObject.cpm || bidObject.cpm === null || !bidObject.adm) { return; } @@ -196,7 +196,7 @@ export const spec = { * @param {Array} timeoutData timeout specific data */ onTimeout: function (timeoutData) { - if (!utils.isArray(timeoutData)) { + if (!isArray(timeoutData)) { return; } @@ -204,7 +204,7 @@ export const spec = { const bidOnTimeout = requestedBids.find((requestedBid) => requestedBid.bidId === bid.bidId); if (bidOnTimeout) { - utils.triggerPixel( + triggerPixel( `${TIMEOUT_EVENT_URL}/${bidOnTimeout.zoneId}/${bidOnTimeout.bidId}` ); } diff --git a/modules/automatadBidAdapter.js b/modules/automatadBidAdapter.js index 415c52ba6d3..2cfcfbe98b4 100644 --- a/modules/automatadBidAdapter.js +++ b/modules/automatadBidAdapter.js @@ -1,5 +1,5 @@ +import { logInfo } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js' -import * as utils from '../src/utils.js' import {BANNER} from '../src/mediaTypes.js' import {ajax} from '../src/ajax.js' @@ -92,7 +92,7 @@ export const spec = { }) }) } else { - utils.logInfo('automatad :: no valid responses to interpret') + logInfo('automatad :: no valid responses to interpret') } return bidResponses diff --git a/modules/axonixBidAdapter.js b/modules/axonixBidAdapter.js index daaac27e6a4..7cd8f63bd2a 100644 --- a/modules/axonixBidAdapter.js +++ b/modules/axonixBidAdapter.js @@ -1,7 +1,7 @@ +import { isArray, logError, deepAccess, isEmpty, triggerPixel, replaceAuctionPrice } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; import { ajax } from '../src/ajax.js'; const BIDDER_CODE = 'axonix'; @@ -68,9 +68,9 @@ export const spec = { // video bid request validation if (bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty(VIDEO)) { if (!bid.mediaTypes[VIDEO].hasOwnProperty('mimes') || - !utils.isArray(bid.mediaTypes[VIDEO].mimes) || + !isArray(bid.mediaTypes[VIDEO].mimes) || bid.mediaTypes[VIDEO].mimes.length === 0) { - utils.logError('mimes are mandatory for video bid request. Ad Unit: ', JSON.stringify(bid)); + logError('mimes are mandatory for video bid request. Ad Unit: ', JSON.stringify(bid)); return false; } @@ -142,7 +142,7 @@ export const spec = { interpretResponse: function(serverResponse) { const response = serverResponse ? serverResponse.body : []; - if (!utils.isArray(response)) { + if (!isArray(response)) { return []; } @@ -160,9 +160,9 @@ export const spec = { }, onTimeout: function(timeoutData) { - const params = utils.deepAccess(timeoutData, '0.params.0'); + const params = deepAccess(timeoutData, '0.params.0'); - if (!utils.isEmpty(params)) { + if (!isEmpty(params)) { ajax(getURL(params, 'prebid/timeout'), null, timeoutData[0], { method: 'POST', options: { @@ -177,7 +177,7 @@ export const spec = { const { nurl } = bid || {}; if (bid.nurl) { - utils.triggerPixel(utils.replaceAuctionPrice(nurl, bid.cpm)); + triggerPixel(replaceAuctionPrice(nurl, bid.cpm)); }; } } diff --git a/modules/beachfrontBidAdapter.js b/modules/beachfrontBidAdapter.js index 3531fa45d1b..a882a796851 100644 --- a/modules/beachfrontBidAdapter.js +++ b/modules/beachfrontBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logWarn, deepAccess, isArray, parseSizesInput, isFn, parseUrl, getUniqueIdentifierStr } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { Renderer } from '../src/Renderer.js'; @@ -34,21 +34,21 @@ export const spec = { isBidRequestValid(bid) { if (isVideoBid(bid)) { if (!getVideoBidParam(bid, 'appId')) { - utils.logWarn('Beachfront: appId param is required for video bids.'); + logWarn('Beachfront: appId param is required for video bids.'); return false; } if (!getVideoBidParam(bid, 'bidfloor')) { - utils.logWarn('Beachfront: bidfloor param is required for video bids.'); + logWarn('Beachfront: bidfloor param is required for video bids.'); return false; } } if (isBannerBid(bid)) { if (!getBannerBidParam(bid, 'appId')) { - utils.logWarn('Beachfront: appId param is required for banner bids.'); + logWarn('Beachfront: appId param is required for banner bids.'); return false; } if (!getBannerBidParam(bid, 'bidfloor')) { - utils.logWarn('Beachfront: bidfloor param is required for banner bids.'); + logWarn('Beachfront: bidfloor param is required for banner bids.'); return false; } } @@ -85,12 +85,12 @@ export const spec = { if (isVideoBid(bidRequest)) { if (!response || !response.bidPrice) { - utils.logWarn(`No valid video bids from ${spec.code} bidder`); + logWarn(`No valid video bids from ${spec.code} bidder`); return []; } let sizes = getVideoSizes(bidRequest); let firstSize = getFirstSize(sizes); - let context = utils.deepAccess(bidRequest, 'mediaTypes.video.context'); + let context = deepAccess(bidRequest, 'mediaTypes.video.context'); let responseType = getVideoBidParam(bidRequest, 'responseType') || 'both'; let responseMeta = Object.assign({ mediaType: VIDEO, advertiserDomains: [] }, response.meta); let bidResponse = { @@ -119,7 +119,7 @@ export const spec = { return bidResponse; } else { if (!response || !response.length) { - utils.logWarn(`No valid banner bids from ${spec.code} bidder`); + logWarn(`No valid banner bids from ${spec.code} bidder`); return []; } return response @@ -148,7 +148,7 @@ export const spec = { getUserSyncs(syncOptions, serverResponses = [], gdprConsent = {}, uspConsent = '') { let syncs = []; let { gdprApplies, consentString = '' } = gdprConsent; - let bannerResponse = find(serverResponses, (res) => utils.isArray(res.body)); + let bannerResponse = find(serverResponses, (res) => isArray(res.body)); if (bannerResponse) { if (syncOptions.iframeEnabled) { @@ -206,7 +206,7 @@ function getFirstSize(sizes) { } function parseSizes(sizes) { - return utils.parseSizesInput(sizes).map(size => { + return parseSizesInput(sizes).map(size => { let [ width, height ] = size.split('x'); return { w: parseInt(width, 10) || undefined, @@ -216,11 +216,11 @@ function parseSizes(sizes) { } function getVideoSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); } function getBannerSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); } function getOsVersion() { @@ -257,33 +257,33 @@ function getDoNotTrack() { } function isVideoBid(bid) { - return utils.deepAccess(bid, 'mediaTypes.video'); + return deepAccess(bid, 'mediaTypes.video'); } function isBannerBid(bid) { - return utils.deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); + return deepAccess(bid, 'mediaTypes.banner') || !isVideoBid(bid); } function getVideoBidParam(bid, key) { - return utils.deepAccess(bid, 'params.video.' + key) || utils.deepAccess(bid, 'params.' + key); + return deepAccess(bid, 'params.video.' + key) || deepAccess(bid, 'params.' + key); } function getBannerBidParam(bid, key) { - return utils.deepAccess(bid, 'params.banner.' + key) || utils.deepAccess(bid, 'params.' + key); + return deepAccess(bid, 'params.banner.' + key) || deepAccess(bid, 'params.' + key); } function getPlayerBidParam(bid, key, defaultValue) { - let param = utils.deepAccess(bid, 'params.player.' + key); + let param = deepAccess(bid, 'params.player.' + key); return param === undefined ? defaultValue : param; } function getBannerBidFloor(bid) { - let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'banner', size: '*' }) : {}; + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'banner', size: '*' }) : {}; return floorInfo.floor || getBannerBidParam(bid, 'bidfloor'); } function getVideoBidFloor(bid) { - let floorInfo = utils.isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'video', size: '*' }) : {}; + let floorInfo = isFn(bid.getFloor) ? bid.getFloor({ currency: CURRENCY, mediaType: 'video', size: '*' }) : {}; return floorInfo.floor || getVideoBidParam(bid, 'bidfloor'); } @@ -297,7 +297,7 @@ function isBannerBidValid(bid) { function getTopWindowLocation(bidderRequest) { let url = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; - return utils.parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); + return parseUrl(config.getConfig('pageUrl') || url, { decodeSearchAsString: true }); } function getTopWindowReferrer() { @@ -316,7 +316,7 @@ function getEids(bid) { function getUserId(bid) { return ({ key, source, rtiPartner, atype }) => { - let id = utils.deepAccess(bid, `userId.${key}`); + let id = deepAccess(bid, `userId.${key}`); return id ? formatEid(id, source, rtiPartner, atype) : null; }; } @@ -364,7 +364,7 @@ function createVideoRequestData(bid, bidderRequest) { isPrebid: true, appId: appId, domain: document.location.hostname, - id: utils.getUniqueIdentifierStr(), + id: getUniqueIdentifierStr(), imp: [{ video: Object.assign({ w: firstSize.w, @@ -469,7 +469,7 @@ function createBannerRequestData(bids, bidderRequest) { } SUPPORTED_USER_IDS.forEach(({ key, queryParam }) => { - let id = utils.deepAccess(bids, `0.userId.${key}`) + let id = deepAccess(bids, `0.userId.${key}`) if (id) { payload[queryParam] = id; } diff --git a/modules/beopBidAdapter.js b/modules/beopBidAdapter.js index aed5d04a151..a6bc8a5687d 100644 --- a/modules/beopBidAdapter.js +++ b/modules/beopBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isArray, logWarn, triggerPixel, buildUrl, logInfo, getValue, getBidIdParameter } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; const BIDDER_CODE = 'beop'; @@ -36,7 +36,7 @@ export const spec = { */ buildRequests: function(validBidRequests, bidderRequest) { const slots = validBidRequests.map(beOpRequestSlotsMaker); - let pageUrl = utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || utils.deepAccess(window, 'location.href'); + let pageUrl = deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || deepAccess(window, 'location.href'); let fpd = config.getLegacyFpd(config.getConfig('ortb2')); let gdpr = bidderRequest.gdprConsent; let firstSlot = slots[0]; @@ -50,7 +50,7 @@ export const spec = { kwds: (fpd && fpd.site && fpd.site.keywords) || [], dbg: false, slts: slots, - is_amp: utils.deepAccess(bidderRequest, 'referrerInfo.isAmp'), + is_amp: deepAccess(bidderRequest, 'referrerInfo.isAmp'), tc_string: (gdpr && gdpr.gdprApplies) ? gdpr.consentString : null, }; const payloadString = JSON.stringify(payloadObject); @@ -61,7 +61,7 @@ export const spec = { } }, interpretResponse: function(serverResponse, request) { - if (serverResponse && serverResponse.body && utils.isArray(serverResponse.body.bids) && serverResponse.body.bids.length > 0) { + if (serverResponse && serverResponse.body && isArray(serverResponse.body.bids) && serverResponse.body.bids.length > 0) { return serverResponse.body.bids; } return []; @@ -73,8 +73,8 @@ export const spec = { let trackingParams = buildTrackingParams(timeoutData, 'timeout', timeoutData.timeout); - utils.logWarn(BIDDER_CODE + ': timed out request'); - utils.triggerPixel(utils.buildUrl({ + logWarn(BIDDER_CODE + ': timed out request'); + triggerPixel(buildUrl({ protocol: 'https', hostname: 't.beop.io', pathname: '/bid', @@ -87,8 +87,8 @@ export const spec = { } let trackingParams = buildTrackingParams(bid, 'won', bid.cpm); - utils.logInfo(BIDDER_CODE + ': won request'); - utils.triggerPixel(utils.buildUrl({ + logInfo(BIDDER_CODE + ': won request'); + triggerPixel(buildUrl({ protocol: 'https', hostname: 't.beop.io', pathname: '/bid', @@ -113,8 +113,8 @@ function buildTrackingParams(data, info, value) { } function beOpRequestSlotsMaker(bid) { - const bannerSizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes'); - const publisherCurrency = config.getConfig('currency.adServerCurrency') || utils.getValue(bid.params, 'currency') || 'EUR'; + const bannerSizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + const publisherCurrency = config.getConfig('currency.adServerCurrency') || getValue(bid.params, 'currency') || 'EUR'; let floor; if (typeof bid.getFloor === 'function') { const floorInfo = bid.getFloor({currency: publisherCurrency, mediaType: 'banner', size: [1, 1]}); @@ -123,19 +123,19 @@ function beOpRequestSlotsMaker(bid) { } } return { - sizes: utils.isArray(bannerSizes) ? bannerSizes : bid.sizes, + sizes: isArray(bannerSizes) ? bannerSizes : bid.sizes, flr: floor, - pid: utils.getValue(bid.params, 'accountId'), - nid: utils.getValue(bid.params, 'networkId'), - nptnid: utils.getValue(bid.params, 'networkPartnerId'), - bid: utils.getBidIdParameter('bidId', bid), - brid: utils.getBidIdParameter('bidderRequestId', bid), - name: utils.getBidIdParameter('adUnitCode', bid), - aid: utils.getBidIdParameter('auctionId', bid), - tid: utils.getBidIdParameter('transactionId', bid), - brc: utils.getBidIdParameter('bidRequestsCount', bid), - bdrc: utils.getBidIdParameter('bidderRequestCount', bid), - bwc: utils.getBidIdParameter('bidderWinsCount', bid), + pid: getValue(bid.params, 'accountId'), + nid: getValue(bid.params, 'networkId'), + nptnid: getValue(bid.params, 'networkPartnerId'), + bid: getBidIdParameter('bidId', bid), + brid: getBidIdParameter('bidderRequestId', bid), + name: getBidIdParameter('adUnitCode', bid), + aid: getBidIdParameter('auctionId', bid), + tid: getBidIdParameter('transactionId', bid), + brc: getBidIdParameter('bidRequestsCount', bid), + bdrc: getBidIdParameter('bidderRequestCount', bid), + bwc: getBidIdParameter('bidderWinsCount', bid), } } diff --git a/modules/bidViewabilityIO.js b/modules/bidViewabilityIO.js index 4651e424d00..d936fb4aeec 100644 --- a/modules/bidViewabilityIO.js +++ b/modules/bidViewabilityIO.js @@ -1,7 +1,7 @@ +import { logMessage } from '../src/utils.js'; import { config } from '../src/config.js'; import * as events from '../src/events.js'; import { EVENTS } from '../src/constants.json'; -import * as utils from '../src/utils.js'; const MODULE_NAME = 'bidViewabilityIO'; const CONFIG_ENABLED = 'enabled'; @@ -23,8 +23,8 @@ export let isSupportedMediaType = (bid) => { return supportedMediaTypes.indexOf(bid.mediaType) > -1; } -let logMessage = (message) => { - return utils.logMessage(`${MODULE_NAME}: ${message}`); +let _logMessage = (message) => { + return logMessage(`${MODULE_NAME}: ${message}`); } // returns options for the iO that detects if the ad is viewable @@ -43,7 +43,7 @@ export let markViewed = (bid, entry, observer) => { return () => { observer.unobserve(entry.target); events.emit(EVENTS.BID_VIEWABLE, bid); - logMessage(`id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode} was viewed`); + _logMessage(`id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode} was viewed`); } } @@ -59,13 +59,13 @@ export let viewCallbackFactory = (bid) => { return (entries, observer) => { entries.forEach(entry => { if (entry.isIntersecting) { - logMessage(`viewable timer starting for id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode}`); + _logMessage(`viewable timer starting for id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode}`); entry.target.view_tracker = setTimeout(markViewed(bid, entry, observer), IAB_VIEWABLE_DISPLAY_TIME); } else { - logMessage(`id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode} is out of view`); + _logMessage(`id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode} is out of view`); if (entry.target.view_tracker) { clearTimeout(entry.target.view_tracker); - logMessage(`viewable timer stopped for id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode}`); + _logMessage(`viewable timer stopped for id: ${entry.target.getAttribute('id')} code: ${bid.adUnitCode}`); } } }); diff --git a/modules/bidglassBidAdapter.js b/modules/bidglassBidAdapter.js index b77ca474e13..3184372881b 100644 --- a/modules/bidglassBidAdapter.js +++ b/modules/bidglassBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { _each, isArray, getBidIdParameter, deepClone, getUniqueIdentifierStr } from '../src/utils.js'; // import {config} from 'src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; @@ -69,12 +69,12 @@ export const spec = { let bidglass = window['bidglass']; - utils._each(validBidRequests, function(bid) { - bid.sizes = ((utils.isArray(bid.sizes) && utils.isArray(bid.sizes[0])) ? bid.sizes : [bid.sizes]); - bid.sizes = bid.sizes.filter(size => utils.isArray(size)); + _each(validBidRequests, function(bid) { + bid.sizes = ((isArray(bid.sizes) && isArray(bid.sizes[0])) ? bid.sizes : [bid.sizes]); + bid.sizes = bid.sizes.filter(size => isArray(size)); - var adUnitId = utils.getBidIdParameter('adUnitId', bid.params); - var options = utils.deepClone(bid.params); + var adUnitId = getBidIdParameter('adUnitId', bid.params); + var options = deepClone(bid.params); delete options.adUnitId; @@ -96,7 +96,7 @@ export const spec = { // Stuff to send: page URL const bidReq = { - reqId: utils.getUniqueIdentifierStr(), + reqId: getUniqueIdentifierStr(), imps: imps, ref: getReferer(), ori: getOrigins() @@ -125,7 +125,7 @@ export const spec = { interpretResponse: function(serverResponse) { const bidResponses = []; - utils._each(serverResponse.body.bidResponses, function(serverBid) { + _each(serverResponse.body.bidResponses, function(serverBid) { const bidResponse = { requestId: serverBid.requestId, cpm: parseFloat(serverBid.cpm), diff --git a/modules/bidscubeBidAdapter.js b/modules/bidscubeBidAdapter.js index d3f27a5ac6d..951bd97d255 100644 --- a/modules/bidscubeBidAdapter.js +++ b/modules/bidscubeBidAdapter.js @@ -1,6 +1,6 @@ +import { logMessage, getWindowLocation } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js' import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js' -import * as utils from '../src/utils.js' const BIDDER_CODE = 'bidscube' const URL = 'https://supply.bidscube.com/?c=o&m=multi' @@ -20,9 +20,9 @@ export const spec = { try { window.top.location.toString() winTop = window.top - } catch (e) { utils.logMessage(e) } + } catch (e) { logMessage(e) } - const location = utils.getWindowLocation() + const location = getWindowLocation() const placements = [] for (let i = 0; i < validBidRequests.length; i++) { diff --git a/modules/bizzclickBidAdapter.js b/modules/bizzclickBidAdapter.js index 95c53b78de2..38195f8f9d9 100644 --- a/modules/bizzclickBidAdapter.js +++ b/modules/bizzclickBidAdapter.js @@ -1,6 +1,6 @@ +import { logMessage, getDNT, deepSetValue, deepAccess, _map, logWarn } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; import {config} from '../src/config.js'; const BIDDER_CODE = 'bizzclick'; const ACCOUNTID_MACROS = '[account_id]'; @@ -67,7 +67,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; let bids = []; for (let bidRequest of validBidRequests) { @@ -80,7 +80,7 @@ export const spec = { device: { w: winTop.screen.width, h: winTop.screen.height, - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, language: (navigator && navigator.language) ? navigator.language.indexOf('-') != -1 ? navigator.language.split('-')[0] : navigator.language : '', }, site: { @@ -124,12 +124,12 @@ export const spec = { } if (bidRequest) { if (bidRequest.gdprConsent && bidRequest.gdprConsent.gdprApplies) { - utils.deepSetValue(data, 'regs.ext.gdpr', bidRequest.gdprConsent.gdprApplies ? 1 : 0); - utils.deepSetValue(data, 'user.ext.consent', bidRequest.gdprConsent.consentString); + deepSetValue(data, 'regs.ext.gdpr', bidRequest.gdprConsent.gdprApplies ? 1 : 0); + deepSetValue(data, 'user.ext.consent', bidRequest.gdprConsent.consentString); } if (bidRequest.uspConsent !== undefined) { - utils.deepSetValue(data, 'regs.ext.us_privacy', bidRequest.uspConsent); + deepSetValue(data, 'regs.ext.us_privacy', bidRequest.uspConsent); } } bids.push(data) @@ -194,7 +194,7 @@ export const spec = { * @returns {boolean} */ const checkRequestType = (bidRequest, type) => { - return (typeof utils.deepAccess(bidRequest, `mediaTypes.${type}`) !== 'undefined'); + return (typeof deepAccess(bidRequest, `mediaTypes.${type}`) !== 'undefined'); } const parseNative = admObject => { const { assets, link, imptrackers, jstracker } = admObject.native; @@ -240,7 +240,7 @@ const addNativeParameters = bidRequest => { id: bidRequest.transactionId, ver: NATIVE_VERSION, }; - const assets = utils._map(bidRequest.mediaTypes.native, (bidParams, key) => { + const assets = _map(bidRequest.mediaTypes.native, (bidParams, key) => { const props = NATIVE_PARAMS[key]; const asset = { required: bidParams.required & 1, @@ -286,7 +286,7 @@ const parseSizes = (bid, mediaType) => { mediaTypes.video.w, mediaTypes.video.h ]; - } else if (Array.isArray(utils.deepAccess(bid, 'mediaTypes.video.playerSize')) && bid.mediaTypes.video.playerSize.length === 1) { + } else if (Array.isArray(deepAccess(bid, 'mediaTypes.video.playerSize')) && bid.mediaTypes.video.playerSize.length === 1) { size = bid.mediaTypes.video.playerSize[0]; } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0 && Array.isArray(bid.sizes[0]) && bid.sizes[0].length > 1) { size = bid.sizes[0]; @@ -299,7 +299,7 @@ const parseSizes = (bid, mediaType) => { } else if (Array.isArray(bid.sizes) && bid.sizes.length > 0) { sizes = bid.sizes } else { - utils.logWarn('no sizes are setup or found'); + logWarn('no sizes are setup or found'); } return sizes } From b4ea663a1cdfbd8bf0eda227879a5e38aa990d34 Mon Sep 17 00:00:00 2001 From: TheMediaGrid <44166371+TheMediaGrid@users.noreply.github.com> Date: Tue, 28 Sep 2021 17:57:22 +0300 Subject: [PATCH 098/250] TheMediaGrid: fix bug with wrong vastUrl (#7507) * Added TheMediaGridNM Bid Adapter * Updated required params for TheMediaGridNM Bid Adapter * Update TheMediGridNM Bid Adapter * Fix tests for TheMediaGridNM Bid Adapter * Fixes after review for TheMediaGridNM Bid Adapter * Add support of multi-format in TheMediaGrid Bid Adapter * Update sync url for grid and gridNM Bid Adapters * TheMediaGrid Bid Adapter: added keywords adUnit parameter * Update TheMediaGrid Bid Adapter to support keywords from config * Implement new request format for TheMediaGrid Bid Adapter * Fix jwpseg params for TheMediaGrid Bid Adapter * Update unit tests for The Media Grid Bid Adapter * Fix typo in TheMediaGrid Bid Adapter * Added test for jwTargeting in TheMediaGrid Bid Adapter * The new request format was made by default in TheMediaGrid Bid Adapter * Update userId format in ad request for TheMediaGrid Bid Adapter * Added bidFloor parameter for TheMediaGrid Bid Adapter * Fix for review TheMediaGrid Bid Adapter * Support floorModule in TheMediaGrid Bid Adapter * Fix empty bidfloor for TheMediaGrid Bid Adapter * Some change to restart autotests * Fix userIds format for TheMediaGrid Bid Adapter * Remove digitrust userId from TheMediaGrid Bid Adapter * Protocols was added in video section in ad request for TheMediaGrid Bid Adapter * TheMediaGrid: fix trouble with alias using * TheMediaGridNM: fix trouble with alias * TheMediaGrid Bid Adapter: added support of PBAdSlot module * TheMediaGrid Bid Adapter: fix typo * GridNM Bid Adapter: use absent in params data from mediaTypes * GridNM Bid Adapter: fix md file + add advertiserDomains support * TheMediaGrid and gridNM Bid Adapter: minor netRevenue fixes * gridNM Bid Adapter updates after review * TheMediaGrid Bid Adapter: fix keywords workflow * fix testing and kick off lgtm again * TheMediaGrid: added ext.bidder.grid.demandSource processing * TheMediaGrid: added user.id from fpd cookie * TheMediaGrid: control cookie setting via bidder config * TheMediaGrid: use localStorage instead cookie * TheMediaGridNM Bid Adapter: update adapter to use /hbjson endpoint * TheMediaGridNM: fix unnecessary conditions * TheMediaGrid: fix bug with nurl field in response * TheMediaGrid: update test Co-authored-by: Chris Huie --- modules/gridBidAdapter.js | 3 +- test/spec/modules/gridBidAdapter_spec.js | 40 ++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/modules/gridBidAdapter.js b/modules/gridBidAdapter.js index 9411f38ebd8..aba840793d4 100644 --- a/modules/gridBidAdapter.js +++ b/modules/gridBidAdapter.js @@ -382,8 +382,7 @@ function _addBidResponse(serverBid, bidRequest, bidResponses) { bidResponse.adResponse = { content: bidResponse.vastXml }; - } - if (serverBid.nurl) { + } else if (serverBid.nurl) { bidResponse.vastUrl = serverBid.nurl; } bidResponse.mediaType = VIDEO; diff --git a/test/spec/modules/gridBidAdapter_spec.js b/test/spec/modules/gridBidAdapter_spec.js index 7913dd7b44d..f31b8f16ef7 100644 --- a/test/spec/modules/gridBidAdapter_spec.js +++ b/test/spec/modules/gridBidAdapter_spec.js @@ -874,6 +874,22 @@ describe('TheMediaGrid Adapter', function () { }, 'adUnitCode': 'adunit-code-2', 'sizes': [[300, 250], [300, 600]], + 'bidId': '112432ab4f34', + 'bidderRequestId': '5f2009617a7c0a', + 'auctionId': '1cbd2feafe5e8b', + 'mediaTypes': { + 'video': { + 'context': 'instream' + } + } + }, + { + 'bidder': 'grid', + 'params': { + 'uid': '15' + }, + 'adUnitCode': 'adunit-code-2', + 'sizes': [[300, 250], [300, 600]], 'bidId': 'a74b342f8cd', 'bidderRequestId': '5f2009617a7c0a', 'auctionId': '1cbd2feafe5e8b', @@ -888,7 +904,8 @@ describe('TheMediaGrid Adapter', function () { {'bid': [{'impid': '659423fff799cb', 'price': 1.15, 'adm': '\n<\/Ad>\n<\/VAST>', 'auid': 11, content_type: 'video', w: 300, h: 600}], 'seat': '2'}, {'bid': [{'impid': '2bc598e42b6a', 'price': 1.00, 'adm': '\n<\/Ad>\n<\/VAST>', 'auid': 12, content_type: 'video'}], 'seat': '2'}, {'bid': [{'impid': '23312a43bc42', 'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'auid': 13, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, - {'bid': [{'impid': 'a74b342f8cd', 'price': 1.50, 'nurl': '', 'auid': 14, content_type: 'video'}], 'seat': '2'} + {'bid': [{'impid': '112432ab4f34', 'price': 1.80, 'adm': '\n<\/Ad>\n<\/VAST>', 'nurl': 'https://wrong_url.com', 'auid': 14, content_type: 'video', 'adomain': ['example.com'], w: 300, h: 600}], 'seat': '2'}, + {'bid': [{'impid': 'a74b342f8cd', 'price': 1.50, 'nurl': '', 'auid': 15, content_type: 'video'}], 'seat': '2'} ]; const request = spec.buildRequests(bidRequests); const expectedResponse = [ @@ -945,7 +962,26 @@ describe('TheMediaGrid Adapter', function () { advertiserDomains: ['example.com'] }, 'vastUrl': 'https://some_test_vast_url.com', - } + }, + { + 'requestId': '112432ab4f34', + 'cpm': 1.80, + 'creativeId': 14, + 'dealId': undefined, + 'width': 300, + 'height': 600, + 'currency': 'USD', + 'mediaType': 'video', + 'netRevenue': true, + 'ttl': 360, + 'meta': { + advertiserDomains: ['example.com'] + }, + 'vastXml': '\n<\/Ad>\n<\/VAST>', + 'adResponse': { + 'content': '\n<\/Ad>\n<\/VAST>' + } + }, ]; const result = spec.interpretResponse({'body': {'seatbid': response}}, request); From eb8c4cb661541f7c36146eb61d4e6aaa729cf011 Mon Sep 17 00:00:00 2001 From: Lisa Benmore Date: Tue, 28 Sep 2021 08:47:45 -0700 Subject: [PATCH 099/250] Gumgum: ADTS-156 Improve GPID support by checking for value in new location within request object (#7500) --- modules/gumgumBidAdapter.js | 6 ++++-- test/spec/modules/gumgumBidAdapter_spec.js | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 7ac43d32d56..0580675eed8 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -298,8 +298,10 @@ function buildRequests(validBidRequests, bidderRequest) { // ADTS-134 Retrieve ID envelopes for (const eid in eids) data[eid] = eids[eid]; - // ADJS-1024 - if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) { + // ADJS-1024 & ADSS-1297 + if (utils.deepAccess(ortb2Imp, 'ext.data.pbadslot')) { + gpid = utils.deepAccess(ortb2Imp, 'ext.data.pbadslot') + } else if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) { gpid = ortb2Imp.ext.data.adserver.adslot } diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index e91308849ed..e11123729e0 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -229,13 +229,21 @@ describe('gumgumAdapter', function () { expect(bidRequest.data).to.not.have.property('irisid'); }); - it('should set the global placement id (gpid)', function () { + it('should set the global placement id (gpid) if in adserver property', function () { const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { adserver: { name: 'test', adslot: 123456 } } } } } const bidRequest = spec.buildRequests([req])[0]; expect(bidRequest.data).to.have.property('gpid'); expect(bidRequest.data.gpid).to.equal(123456); }); + it('should set the global placement id (gpid) if in pbadslot property', function () { + const pbadslot = 'abc123' + const req = { ...bidRequests[0], ortb2Imp: { ext: { data: { pbadslot } } } } + const bidRequest = spec.buildRequests([req])[0]; + expect(bidRequest.data).to.have.property('gpid'); + expect(bidRequest.data.gpid).to.equal(pbadslot); + }); + it('should set the bid floor if getFloor module is not present but static bid floor is defined', function () { const req = { ...bidRequests[0], params: { bidfloor: 42 } } const bidRequest = spec.buildRequests([req])[0]; From 35b1d71b986da92821d3d17ffe0c874a43daa5a6 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 09:49:37 -0700 Subject: [PATCH 100/250] PBjs Core : User sync iframe over image (#7454) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * Issue 7330 first loops through iframe syncs (it used to do pixel syncs first) If a bidder gets an iframe, mark it. Then PBJS should loop through pixel syncs If a bidder is about to get a pixel but already got an iframe sync, skip it. --- src/userSync.js | 14 ++++++++++++-- test/spec/userSync_spec.js | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/userSync.js b/src/userSync.js index f653880fa29..fc9f577fd7e 100644 --- a/src/userSync.js +++ b/src/userSync.js @@ -91,10 +91,10 @@ export function newUserSync(userSyncDependencies) { } try { - // Image pixels - fireImagePixels(); // Iframe syncs loadIframes(); + // Image pixels + fireImagePixels(); } catch (e) { return utils.logError('Error firing user syncs', e); } @@ -138,11 +138,21 @@ export function newUserSync(userSyncDependencies) { if (!(permittedPixels.iframe)) { return; } + forEachFire(queue.iframe, (sync) => { let [bidderName, iframeUrl] = sync; utils.logMessage(`Invoking iframe user sync for bidder: ${bidderName}`); // Insert iframe into DOM utils.insertUserSyncIframe(iframeUrl); + // for a bidder, if iframe sync is present then remove image pixel + removeImagePixelsForBidder(queue, bidderName); + }); + } + + function removeImagePixelsForBidder(queue, iframeSyncBidderName) { + queue.image = queue.image.filter(imageSync => { + let imageSyncBidderName = imageSync[0]; + return imageSyncBidderName !== iframeSyncBidderName }); } diff --git a/test/spec/userSync_spec.js b/test/spec/userSync_spec.js index 55b613ce929..910ffe7b2d6 100644 --- a/test/spec/userSync_spec.js +++ b/test/spec/userSync_spec.js @@ -401,6 +401,33 @@ describe('user sync', function () { expect(insertUserSyncIframeStub.getCall(0).args[0]).to.equal('http://example.com/iframe'); }); + it('should not fire image pixel for a bidder if iframe pixel is fired for same bidder', function() { + const userSync = newUserSync({ + config: config.getConfig('userSync'), + browserSupportsCookies: true + }); + + config.setConfig({ + userSync: { + filterSettings: { + iframe: { + bidders: ['bidderXYZ'], + filter: 'include' + } + } + } + }); + // we are registering iframe and image sync for bidderXYZ and we expect image sync not to execute. + userSync.registerSync('image', 'testBidder', 'http://testBidder.example.com/image'); + userSync.registerSync('iframe', 'bidderXYZ', 'http://bidderXYZ.example.com/iframe'); + userSync.registerSync('image', 'bidderXYZ', 'http://bidderXYZ.example.com/image'); + userSync.syncUsers(); + expect(triggerPixelStub.getCall(0)).to.not.be.null; + expect(triggerPixelStub.getCall(0).args[0]).to.exist.and.to.equal('http://testBidder.example.com/image'); + expect(triggerPixelStub.callCount).to.equal(1); // should not be 2 for 2 registered image syncs + expect(insertUserSyncIframeStub.getCall(0).args[0]).to.equal('http://bidderXYZ.example.com/iframe'); + }); + it('should override default image syncs if setConfig used image filter', function () { const userSync = newUserSync({ config: config.getConfig('userSync'), @@ -448,8 +475,9 @@ describe('user sync', function () { userSync.registerSync('iframe', 'testBidder', 'http://example.com/iframe'); userSync.registerSync('iframe', 'bidderXYZ', 'http://example.com/iframe-blocked'); userSync.syncUsers(); - expect(triggerPixelStub.getCall(0)).to.not.be.null; - expect(triggerPixelStub.getCall(0).args[0]).to.exist.and.to.equal('http://example.com'); + // expect(triggerPixelStub.getCall(0)).to.not.be.null; + expect(triggerPixelStub.getCall(0)).to.be.null;// image sync will not execute as iframe sync has executed for same bidder + // expect(triggerPixelStub.getCall(0).args[0]).to.exist.and.to.equal('http://example.com'); expect(triggerPixelStub.getCall(1)).to.be.null; expect(insertUserSyncIframeStub.getCall(0).args[0]).to.equal('http://example.com/iframe'); expect(insertUserSyncIframeStub.getCall(1)).to.be.null; From a5141af2f738be6980f19843315e5953da501ad7 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 10:46:58 -0700 Subject: [PATCH 101/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7493) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/proxistoreBidAdapter.js | 6 +- modules/pubCommonId.js | 22 ++-- modules/pubProvidedIdSystem.js | 6 +- modules/publinkIdSystem.js | 10 +- modules/pubmaticAnalyticsAdapter.js | 32 ++--- modules/pubmaticBidAdapter.js | 174 ++++++++++++++-------------- modules/pubperfAnalyticsAdapter.js | 6 +- modules/pubwiseAnalyticsAdapter.js | 12 +- modules/pubwiseBidAdapter.js | 46 ++++---- modules/pubxBidAdapter.js | 4 +- modules/pubxaiAnalyticsAdapter.js | 14 +-- modules/pulsepointBidAdapter.js | 26 ++--- modules/pxyzBidAdapter.js | 14 +-- modules/quantcastBidAdapter.js | 32 ++--- modules/radsBidAdapter.js | 10 +- 15 files changed, 207 insertions(+), 207 deletions(-) diff --git a/modules/proxistoreBidAdapter.js b/modules/proxistoreBidAdapter.js index 8b191c70e75..68151f820dd 100644 --- a/modules/proxistoreBidAdapter.js +++ b/modules/proxistoreBidAdapter.js @@ -1,5 +1,5 @@ +import { isFn, isPlainObject } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'proxistore'; const PROXISTORE_VENDOR_ID = 418; @@ -170,7 +170,7 @@ function interpretResponse(serverResponse, bidRequest) { } function _assignFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { // eslint-disable-next-line no-console console.log(bid.params.bidFloor); return bid.params.bidFloor ? bid.params.bidFloor : null; @@ -182,7 +182,7 @@ function _assignFloor(bid) { }); if ( - utils.isPlainObject(floor) && + isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'EUR' ) { diff --git a/modules/pubCommonId.js b/modules/pubCommonId.js index 427f775c44b..6ecf0723aae 100644 --- a/modules/pubCommonId.js +++ b/modules/pubCommonId.js @@ -3,7 +3,7 @@ * stored in the page's domain. When the module is included, an id is generated if needed, * persisted as a cookie, and automatically appended to all the bidRequest as bid.crumbs.pubcid. */ -import * as utils from '../src/utils.js'; +import { logMessage, parseUrl, buildUrl, triggerPixel, generateUUID, isArray } from '../src/utils.js'; import { config } from '../src/config.js'; import events from '../src/events.js'; import CONSTANTS from '../src/constants.json'; @@ -44,7 +44,7 @@ export function setStorageItem(key, val, expires) { storage.setDataInLocalStorage(key, val); } catch (e) { - utils.logMessage(e); + logMessage(e); } } @@ -74,7 +74,7 @@ export function getStorageItem(key) { } } } catch (e) { - utils.logMessage(e); + logMessage(e); } return val; @@ -89,7 +89,7 @@ export function removeStorageItem(key) { storage.removeDataFromLocalStorage(key + EXP_SUFFIX); storage.removeDataFromLocalStorage(key); } catch (e) { - utils.logMessage(e); + logMessage(e); } } @@ -141,13 +141,13 @@ function queuePixelCallback(pixelUrl, id) { id = id || ''; // Use pubcid as a cache buster - const urlInfo = utils.parseUrl(pixelUrl); + const urlInfo = parseUrl(pixelUrl); urlInfo.search.id = encodeURIComponent('pubcid:' + id); - const targetUrl = utils.buildUrl(urlInfo); + const targetUrl = buildUrl(urlInfo); events.on(CONSTANTS.EVENTS.AUCTION_END, function auctionEndHandler() { events.off(CONSTANTS.EVENTS.AUCTION_END, auctionEndHandler); - utils.triggerPixel(targetUrl); + triggerPixel(targetUrl); }); return true; @@ -177,7 +177,7 @@ export function requestBidHook(next, config) { if (typeof window[PUB_COMMON] === 'object') { // If the page includes its own pubcid object, then use that instead. pubcid = window[PUB_COMMON].getId(); - utils.logMessage(PUB_COMMON + ': pubcid = ' + pubcid); + logMessage(PUB_COMMON + ': pubcid = ' + pubcid); } else { // Otherwise get the existing cookie pubcid = readValue(ID_NAME); @@ -190,7 +190,7 @@ export function requestBidHook(next, config) { } // Generate a new id if (!pubcid) { - pubcid = utils.generateUUID(); + pubcid = generateUUID(); } // Update the cookie/storage with the latest expiration date writeValue(ID_NAME, pubcid, pubcidConfig.interval); @@ -205,14 +205,14 @@ export function requestBidHook(next, config) { } } - utils.logMessage('pbjs: pubcid = ' + pubcid); + logMessage('pbjs: pubcid = ' + pubcid); } // Append pubcid to each bid object, which will be incorporated // into bid requests later. if (adUnits && pubcid) { adUnits.forEach((unit) => { - if (unit.bids && utils.isArray(unit.bids)) { + if (unit.bids && isArray(unit.bids)) { unit.bids.forEach((bid) => { Object.assign(bid, {crumbs: {pubcid}}); }); diff --git a/modules/pubProvidedIdSystem.js b/modules/pubProvidedIdSystem.js index 0b2175f57cb..669d223c57f 100644 --- a/modules/pubProvidedIdSystem.js +++ b/modules/pubProvidedIdSystem.js @@ -6,7 +6,7 @@ */ import {submodule} from '../src/hook.js'; -import * as utils from '../src/utils.js'; +import { logInfo, isArray } from '../src/utils.js'; const MODULE_NAME = 'pubProvidedId'; @@ -27,7 +27,7 @@ export const pubProvidedIdSubmodule = { */ decode(value) { const res = value ? {pubProvidedId: value} : undefined; - utils.logInfo('PubProvidedId: Decoded value ' + JSON.stringify(res)); + logInfo('PubProvidedId: Decoded value ' + JSON.stringify(res)); return res; }, @@ -40,7 +40,7 @@ export const pubProvidedIdSubmodule = { getId(config) { const configParams = (config && config.params) || {}; let res = []; - if (utils.isArray(configParams.eids)) { + if (isArray(configParams.eids)) { res = res.concat(configParams.eids); } if (typeof configParams.eidsFunction === 'function') { diff --git a/modules/publinkIdSystem.js b/modules/publinkIdSystem.js index ca6ca9cf8d8..9acc741f7da 100644 --- a/modules/publinkIdSystem.js +++ b/modules/publinkIdSystem.js @@ -8,7 +8,7 @@ import {submodule} from '../src/hook.js'; import {getStorageManager} from '../src/storageManager.js'; import {ajax} from '../src/ajax.js'; -import * as utils from '../src/utils.js'; +import { parseUrl, buildUrl, logError } from '../src/utils.js'; import {uspDataHandler} from '../src/adapterManager.js'; const MODULE_NAME = 'publinkId'; @@ -23,7 +23,7 @@ function isHex(s) { } function publinkIdUrl(params, consentData) { - let url = utils.parseUrl('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink'); + let url = parseUrl('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink'); url.search = { deh: params.e, mpn: 'Prebid.js', @@ -39,7 +39,7 @@ function publinkIdUrl(params, consentData) { url.search.us_privacy = usPrivacyString; } - return utils.buildUrl(url); + return buildUrl(url); } function makeCallback(config = {}, consentData) { @@ -58,7 +58,7 @@ function makeCallback(config = {}, consentData) { if (isHex(config.params.e)) { ajax(publinkIdUrl(config.params, consentData), handleResponse, undefined, options); } else { - utils.logError('params.e must be a hex string'); + logError('params.e must be a hex string'); } } }; @@ -82,7 +82,7 @@ function getlocalValue() { return obj.publink; } } catch (e) { - utils.logError(e); + logError(e); } } } diff --git a/modules/pubmaticAnalyticsAdapter.js b/modules/pubmaticAnalyticsAdapter.js index 9aa40a2282d..2477ab4c0a3 100755 --- a/modules/pubmaticAnalyticsAdapter.js +++ b/modules/pubmaticAnalyticsAdapter.js @@ -1,9 +1,9 @@ +import { _each, pick, logWarn, isStr, isArray, logError } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; import { ajax } from '../src/ajax.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; import { getGlobal } from '../src/prebidGlobal.js'; /// /////////// CONSTANTS ////////////// @@ -69,7 +69,7 @@ function setMediaTypes(types, bid) { if (typeof types === 'object') { if (!bid.sizes) { bid.dimensions = []; - utils._each(types, (type) => + _each(types, (type) => bid.dimensions = bid.dimensions.concat( type.sizes.map(sizeToDimensions) ) @@ -81,13 +81,13 @@ function setMediaTypes(types, bid) { } function copyRequiredBidDetails(bid) { - return utils.pick(bid, [ + return pick(bid, [ 'bidder', 'bidId', 'status', () => NO_BID, // default a bid to NO_BID until response is recieved or bid is timed out 'finalSource as source', 'params', - 'adUnit', () => utils.pick(bid, [ + 'adUnit', () => pick(bid, [ 'adUnitCode', 'transactionId', 'sizes as dimensions', sizes => sizes.map(sizeToDimensions), @@ -115,7 +115,7 @@ function setBidStatus(bid, args) { } function parseBidResponse(bid) { - return utils.pick(bid, [ + return pick(bid, [ 'bidPriceUSD', () => { // todo: check whether currency cases are handled here if (typeof bid.currency === 'string' && bid.currency.toUpperCase() === CURRENCY_USD) { @@ -125,7 +125,7 @@ function parseBidResponse(bid) { if (typeof bid.getCpmInNewCurrency === 'function') { return window.parseFloat(Number(bid.getCpmInNewCurrency(CURRENCY_USD)).toFixed(BID_PRECISION)); } - utils.logWarn(LOG_PRE_FIX + 'Could not determine the Net cpm in USD for the bid thus using bid.cpm', bid); + logWarn(LOG_PRE_FIX + 'Could not determine the Net cpm in USD for the bid thus using bid.cpm', bid); return bid.cpm }, 'bidGrossCpmUSD', () => { @@ -136,7 +136,7 @@ function parseBidResponse(bid) { if (typeof getGlobal().convertCurrency === 'function') { return window.parseFloat(Number(getGlobal().convertCurrency(bid.originalCpm, bid.originalCurrency, CURRENCY_USD)).toFixed(BID_PRECISION)); } - utils.logWarn(LOG_PRE_FIX + 'Could not determine the Gross cpm in USD for the bid, thus using bid.originalCpm', bid); + logWarn(LOG_PRE_FIX + 'Could not determine the Gross cpm in USD for the bid, thus using bid.originalCpm', bid); return bid.originalCpm }, 'dealId', @@ -154,7 +154,7 @@ function parseBidResponse(bid) { 'mi', 'regexPattern', () => bid.regexPattern || undefined, 'partnerImpId', // partner impression ID - 'dimensions', () => utils.pick(bid, [ + 'dimensions', () => pick(bid, [ 'width', 'height' ]) @@ -171,7 +171,7 @@ function getDevicePlatform() { var deviceType = 3; try { var ua = navigator.userAgent; - if (ua && utils.isStr(ua) && ua.trim() != '') { + if (ua && isStr(ua) && ua.trim() != '') { ua = ua.toLowerCase().trim(); var isMobileRegExp = new RegExp('(mobi|tablet|ios).*'); if (ua.match(isMobileRegExp)) { @@ -325,9 +325,9 @@ function executeBidWonLoggerCall(auctionId, adUnitId) { function auctionInitHandler(args) { s2sBidders = (function() { let s2sConf = config.getConfig('s2sConfig'); - return (s2sConf && utils.isArray(s2sConf.bidders)) ? s2sConf.bidders : []; + return (s2sConf && isArray(s2sConf.bidders)) ? s2sConf.bidders : []; }()); - let cacheEntry = utils.pick(args, [ + let cacheEntry = pick(args, [ 'timestamp', 'timeout', 'bidderDonePendingCount', () => args.bidderRequests.length, @@ -353,7 +353,7 @@ function bidRequestedHandler(args) { function bidResponseHandler(args) { let bid = cache.auctions[args.auctionId].adUnitCodes[args.adUnitCode].bids[args.requestId]; if (!bid) { - utils.logError(LOG_PRE_FIX + 'Could not find associated bid request for bid response with requestId: ', args.requestId); + logError(LOG_PRE_FIX + 'Could not find associated bid request for bid response with requestId: ', args.requestId); return; } bid.source = formatSource(bid.source || args.source); @@ -404,7 +404,7 @@ function bidTimeoutHandler(args) { code: TIMEOUT_ERROR }; } else { - utils.logWarn(LOG_PRE_FIX + 'bid not found'); + logWarn(LOG_PRE_FIX + 'bid not found'); } }); } @@ -424,17 +424,17 @@ let pubmaticAdapter = Object.assign({}, baseAdapter, { profileId = Number(conf.options.profileId) || DEFAULT_PROFILE_ID; profileVersionId = Number(conf.options.profileVersionId) || DEFAULT_PROFILE_VERSION_ID; } else { - utils.logError(LOG_PRE_FIX + 'Config not found.'); + logError(LOG_PRE_FIX + 'Config not found.'); error = true; } if (!publisherId) { - utils.logError(LOG_PRE_FIX + 'Missing publisherId(Number).'); + logError(LOG_PRE_FIX + 'Missing publisherId(Number).'); error = true; } if (error) { - utils.logError(LOG_PRE_FIX + 'Not collecting data due to error(s).'); + logError(LOG_PRE_FIX + 'Not collecting data due to error(s).'); } else { baseAdapter.enableAnalytics.call(this, conf); } diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index 46e3257ae2e..fa1f04a25e2 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logWarn, _each, isBoolean, isStr, isArray, inIframe, mergeDeep, deepAccess, isNumber, deepSetValue, logInfo, logError, deepClone, convertTypes } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO, NATIVE } from '../src/mediaTypes.js'; import {config} from '../src/config.js'; @@ -124,7 +124,7 @@ const BB_RENDERER = { else if (bid.vastUrl) config.vastUrl = bid.vastUrl; if (!bid.vastXml && !bid.vastUrl) { - utils.logWarn(`${LOG_WARN_PREFIX}: No vastXml or vastUrl on bid, bailing...`); + logWarn(`${LOG_WARN_PREFIX}: No vastXml or vastUrl on bid, bailing...`); return; } @@ -142,7 +142,7 @@ const BB_RENDERER = { } if (renderer) renderer.bootstrap(config, ele); - else utils.logWarn(`${LOG_WARN_PREFIX}: Couldn't find a renderer with ${rendererId}`); + else logWarn(`${LOG_WARN_PREFIX}: Couldn't find a renderer with ${rendererId}`); }, newRenderer: function(rendererCode, adUnitCode) { var rendererUrl = RENDERER_URL.replace('$RENDERER', rendererCode); @@ -155,7 +155,7 @@ const BB_RENDERER = { try { renderer.setRender(BB_RENDERER.outstreamRender); } catch (err) { - utils.logWarn(`${LOG_WARN_PREFIX}: Error tying to setRender on renderer`, err); + logWarn(`${LOG_WARN_PREFIX}: Error tying to setRender on renderer`, err); } return renderer; @@ -180,9 +180,9 @@ let NATIVE_ASSET_ID_TO_KEY_MAP = {}; let NATIVE_ASSET_KEY_TO_ASSET_MAP = {}; // loading NATIVE_ASSET_ID_TO_KEY_MAP -utils._each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); +_each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); // loading NATIVE_ASSET_KEY_TO_ASSET_MAP -utils._each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); +_each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); function _getDomainFromURL(url) { let anchor = document.createElement('a'); @@ -191,8 +191,8 @@ function _getDomainFromURL(url) { } function _parseSlotParam(paramName, paramValue) { - if (!utils.isStr(paramValue)) { - paramValue && utils.logWarn(LOG_WARN_PREFIX + 'Ignoring param key: ' + paramName + ', expects string-value, found ' + typeof paramValue); + if (!isStr(paramValue)) { + paramValue && logWarn(LOG_WARN_PREFIX + 'Ignoring param key: ' + paramName + ', expects string-value, found ' + typeof paramValue); return UNDEFINED; } @@ -213,11 +213,11 @@ function _parseSlotParam(paramName, paramValue) { } function _cleanSlot(slotName) { - if (utils.isStr(slotName)) { + if (isStr(slotName)) { return slotName.replace(/^\s+/g, '').replace(/\s+$/g, ''); } if (slotName) { - utils.logWarn(BIDDER_CODE + ': adSlot must be a string. Ignoring adSlot'); + logWarn(BIDDER_CODE + ': adSlot must be a string. Ignoring adSlot'); } return ''; } @@ -243,7 +243,7 @@ function _parseAdSlot(bid) { // i.e size is specified in adslot, so consider that and ignore sizes array splits = splits[1].split('x'); if (splits.length != 2) { - utils.logWarn(LOG_WARN_PREFIX + 'AdSlot Error: adSlot not in required format'); + logWarn(LOG_WARN_PREFIX + 'AdSlot Error: adSlot not in required format'); return; } bid.params.width = parseInt(splits[0], 10); @@ -294,10 +294,10 @@ function _handleCustomParams(params, conf) { value = entry.f(value, conf); } - if (utils.isStr(value)) { + if (isStr(value)) { conf[key] = value; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Ignoring param : ' + key + ' with value : ' + CUSTOM_PARAMS[key] + ', expects string-value, found ' + typeof value); + logWarn(LOG_WARN_PREFIX + 'Ignoring param : ' + key + ' with value : ' + CUSTOM_PARAMS[key] + ', expects string-value, found ' + typeof value); } } } @@ -334,22 +334,22 @@ function _checkParamDataType(key, value, datatype) { var functionToExecute; switch (datatype) { case DATA_TYPES.BOOLEAN: - functionToExecute = utils.isBoolean; + functionToExecute = isBoolean; break; case DATA_TYPES.NUMBER: - functionToExecute = utils.isNumber; + functionToExecute = isNumber; break; case DATA_TYPES.STRING: - functionToExecute = utils.isStr; + functionToExecute = isStr; break; case DATA_TYPES.ARRAY: - functionToExecute = utils.isArray; + functionToExecute = isArray; break; } if (functionToExecute(value)) { return value; } - utils.logWarn(LOG_WARN_PREFIX + errMsg); + logWarn(LOG_WARN_PREFIX + errMsg); return UNDEFINED; } @@ -386,7 +386,7 @@ function _createNativeRequest(params) { } }; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Title Length is required for native ad: ' + JSON.stringify(params)); + logWarn(LOG_WARN_PREFIX + 'Error: Title Length is required for native ad: ' + JSON.stringify(params)); } break; case NATIVE_ASSETS.IMAGE.KEY: @@ -405,7 +405,7 @@ function _createNativeRequest(params) { } }; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Image sizes is required for native ad: ' + JSON.stringify(params)); + logWarn(LOG_WARN_PREFIX + 'Error: Image sizes is required for native ad: ' + JSON.stringify(params)); } break; case NATIVE_ASSETS.ICON.KEY: @@ -420,7 +420,7 @@ function _createNativeRequest(params) { } }; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Icon sizes is required for native ad: ' + JSON.stringify(params)); + logWarn(LOG_WARN_PREFIX + 'Error: Icon sizes is required for native ad: ' + JSON.stringify(params)); }; break; case NATIVE_ASSETS.VIDEO.KEY: @@ -500,13 +500,13 @@ function _createBannerRequest(bid) { var sizes = bid.mediaTypes.banner.sizes; var format = []; var bannerObj; - if (sizes !== UNDEFINED && utils.isArray(sizes)) { + if (sizes !== UNDEFINED && isArray(sizes)) { bannerObj = {}; if (!bid.params.width && !bid.params.height) { if (sizes.length === 0) { // i.e. since bid.params does not have width or height, and length of sizes is 0, need to ignore this banner imp bannerObj = UNDEFINED; - utils.logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); return bannerObj; } else { bannerObj.w = parseInt(sizes[0][0], 10); @@ -529,16 +529,16 @@ function _createBannerRequest(bid) { } } bannerObj.pos = 0; - bannerObj.topframe = utils.inIframe() ? 0 : 1; + bannerObj.topframe = inIframe() ? 0 : 1; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); bannerObj = UNDEFINED; } return bannerObj; } function _createVideoRequest(bid) { - var videoData = utils.mergeDeep(utils.deepAccess(bid.mediaTypes, 'video'), bid.params.video); + var videoData = mergeDeep(deepAccess(bid.mediaTypes, 'video'), bid.params.video); var videoObj; if (videoData !== UNDEFINED) { @@ -549,16 +549,16 @@ function _createVideoRequest(bid) { } } // read playersize and assign to h and w. - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + if (isArray(bid.mediaTypes.video.playerSize[0])) { videoObj.w = parseInt(bid.mediaTypes.video.playerSize[0][0], 10); videoObj.h = parseInt(bid.mediaTypes.video.playerSize[0][1], 10); - } else if (utils.isNumber(bid.mediaTypes.video.playerSize[0])) { + } else if (isNumber(bid.mediaTypes.video.playerSize[0])) { videoObj.w = parseInt(bid.mediaTypes.video.playerSize[0], 10); videoObj.h = parseInt(bid.mediaTypes.video.playerSize[1], 10); } } else { videoObj = UNDEFINED; - utils.logWarn(LOG_WARN_PREFIX + 'Error: Video config params missing for adunit: ' + bid.params.adUnit + ' with mediaType set as video. Ignoring video impression in the adunit.'); + logWarn(LOG_WARN_PREFIX + 'Error: Video config params missing for adunit: ' + bid.params.adUnit + ' with mediaType set as video. Ignoring video impression in the adunit.'); } return videoObj; } @@ -566,19 +566,19 @@ function _createVideoRequest(bid) { // support for PMP deals function _addPMPDealsInImpression(impObj, bid) { if (bid.params.deals) { - if (utils.isArray(bid.params.deals)) { + if (isArray(bid.params.deals)) { bid.params.deals.forEach(function(dealId) { - if (utils.isStr(dealId) && dealId.length > 3) { + if (isStr(dealId) && dealId.length > 3) { if (!impObj.pmp) { impObj.pmp = { private_auction: 0, deals: [] }; } impObj.pmp.deals.push({ id: dealId }); } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: deal-id present in array bid.params.deals should be a strings with more than 3 charaters length, deal-id ignored: ' + dealId); + logWarn(LOG_WARN_PREFIX + 'Error: deal-id present in array bid.params.deals should be a strings with more than 3 charaters length, deal-id ignored: ' + dealId); } }); } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: bid.params.deals should be an array of strings.'); + logWarn(LOG_WARN_PREFIX + 'Error: bid.params.deals should be an array of strings.'); } } } @@ -588,7 +588,7 @@ function _addDealCustomTargetings(imp, bid) { var dctrLen; if (bid.params.dctr) { dctr = bid.params.dctr; - if (utils.isStr(dctr) && dctr.length > 0) { + if (isStr(dctr) && dctr.length > 0) { var arr = dctr.split('|'); dctr = ''; arr.forEach(val => { @@ -600,7 +600,7 @@ function _addDealCustomTargetings(imp, bid) { } imp.ext['key_val'] = dctr.trim() } else { - utils.logWarn(LOG_WARN_PREFIX + 'Ignoring param : dctr with value : ' + dctr + ', expects string-value, found empty or non-string value'); + logWarn(LOG_WARN_PREFIX + 'Ignoring param : dctr with value : ' + dctr + ', expects string-value, found empty or non-string value'); } } } @@ -662,7 +662,7 @@ function _createImpressionObject(bid, conf) { if (!isInvalidNativeRequest) { impObj.native = nativeObj; } else { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Error in Native adunit ' + bid.params.adUnit + '. Ignoring the adunit. Refer to ' + PREBID_NATIVE_HELP_LINK + ' for more details.'); + logWarn(LOG_WARN_PREFIX + 'Error: Error in Native adunit ' + bid.params.adUnit + '. Ignoring the adunit. Refer to ' + PREBID_NATIVE_HELP_LINK + ' for more details.'); } break; case VIDEO: @@ -680,9 +680,9 @@ function _createImpressionObject(bid, conf) { pos: 0, w: bid.params.width, h: bid.params.height, - topframe: utils.inIframe() ? 0 : 1 + topframe: inIframe() ? 0 : 1 }; - if (utils.isArray(sizes) && sizes.length > 1) { + if (isArray(sizes) && sizes.length > 1) { sizes = sizes.splice(1, sizes.length - 1); sizes.forEach(size => { format.push({ @@ -705,31 +705,31 @@ function _createImpressionObject(bid, conf) { } function _addImpressionFPD(imp, bid) { - const ortb2 = {...utils.deepAccess(bid, 'ortb2Imp.ext.data')}; + const ortb2 = {...deepAccess(bid, 'ortb2Imp.ext.data')}; Object.keys(ortb2).forEach(prop => { /** * Prebid AdSlot * @type {(string|undefined)} */ if (prop === 'pbadslot') { - if (typeof ortb2[prop] === 'string' && ortb2[prop]) utils.deepSetValue(imp, 'ext.data.pbadslot', ortb2[prop]); + if (typeof ortb2[prop] === 'string' && ortb2[prop]) deepSetValue(imp, 'ext.data.pbadslot', ortb2[prop]); } else if (prop === 'adserver') { /** * Copy GAM AdUnit and Name to imp */ ['name', 'adslot'].forEach(name => { /** @type {(string|undefined)} */ - const value = utils.deepAccess(ortb2, `adserver.${name}`); + const value = deepAccess(ortb2, `adserver.${name}`); if (typeof value === 'string' && value) { - utils.deepSetValue(imp, `ext.data.adserver.${name.toLowerCase()}`, value); + deepSetValue(imp, `ext.data.adserver.${name.toLowerCase()}`, value); // copy GAM ad unit id as imp[].ext.dfp_ad_unit_code if (name === 'adslot') { - utils.deepSetValue(imp, `ext.dfp_ad_unit_code`, value); + deepSetValue(imp, `ext.dfp_ad_unit_code`, value); } } }); } else { - utils.deepSetValue(imp, `ext.data.${prop}`, ortb2[prop]); + deepSetValue(imp, `ext.data.${prop}`, ortb2[prop]); } }); } @@ -746,7 +746,7 @@ function _addFloorFromFloorModule(impObj, bid) { if (impObj[mediaType].w && impObj[mediaType].h) { sizesArray.push([impObj[mediaType].w, impObj[mediaType].h]); } - if (utils.isArray(impObj[mediaType].format)) { + if (isArray(impObj[mediaType].format)) { impObj[mediaType].format.forEach(size => sizesArray.push([size.w, size.h])); } } @@ -757,16 +757,16 @@ function _addFloorFromFloorModule(impObj, bid) { sizesArray.forEach(size => { let floorInfo = bid.getFloor({ currency: impObj.bidfloorcur, mediaType: mediaType, size: size }); - utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module returned for mediatype:', mediaType, ' and size:', size, ' is: currency', floorInfo.currency, 'floor', floorInfo.floor); + logInfo(LOG_WARN_PREFIX, 'floor from floor module returned for mediatype:', mediaType, ' and size:', size, ' is: currency', floorInfo.currency, 'floor', floorInfo.floor); if (typeof floorInfo === 'object' && floorInfo.currency === impObj.bidfloorcur && !isNaN(parseInt(floorInfo.floor))) { let mediaTypeFloor = parseFloat(floorInfo.floor); - utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module:', mediaTypeFloor, 'previous floor value', bidFloor, 'Min:', Math.min(mediaTypeFloor, bidFloor)); + logInfo(LOG_WARN_PREFIX, 'floor from floor module:', mediaTypeFloor, 'previous floor value', bidFloor, 'Min:', Math.min(mediaTypeFloor, bidFloor)); if (bidFloor === -1) { bidFloor = mediaTypeFloor; } else { bidFloor = Math.min(mediaTypeFloor, bidFloor) } - utils.logInfo(LOG_WARN_PREFIX, 'new floor value:', bidFloor); + logInfo(LOG_WARN_PREFIX, 'new floor value:', bidFloor); } }); } @@ -775,18 +775,18 @@ function _addFloorFromFloorModule(impObj, bid) { // get highest from impObj.bidfllor and floor from floor module // as we are using Math.max, it is ok if we have not got any floor from floorModule, then value of bidFloor will be -1 if (impObj.bidfloor) { - utils.logInfo(LOG_WARN_PREFIX, 'floor from floor module:', bidFloor, 'impObj.bidfloor', impObj.bidfloor, 'Max:', Math.max(bidFloor, impObj.bidfloor)); + logInfo(LOG_WARN_PREFIX, 'floor from floor module:', bidFloor, 'impObj.bidfloor', impObj.bidfloor, 'Max:', Math.max(bidFloor, impObj.bidfloor)); bidFloor = Math.max(bidFloor, impObj.bidfloor) } // assign value only if bidFloor is > 0 impObj.bidfloor = ((!isNaN(bidFloor) && bidFloor > 0) ? bidFloor : UNDEFINED); - utils.logInfo(LOG_WARN_PREFIX, 'new impObj.bidfloor value:', impObj.bidfloor); + logInfo(LOG_WARN_PREFIX, 'new impObj.bidfloor value:', impObj.bidfloor); } function _getFlocId(validBidRequests, flocFormat) { var flocIdObject = null; - var flocId = utils.deepAccess(validBidRequests, '0.userId.flocId'); + var flocId = deepAccess(validBidRequests, '0.userId.flocId'); if (flocId && flocId.id) { switch (flocFormat) { case FLOC_FORMAT.SEGMENT: @@ -837,7 +837,7 @@ function _handleFlocId(payload, validBidRequests) { } function _handleEids(payload, validBidRequests) { - let bidUserIdAsEids = utils.deepAccess(validBidRequests, '0.userIdAsEids'); + let bidUserIdAsEids = deepAccess(validBidRequests, '0.userIdAsEids'); let flocObject = _getFlocId(validBidRequests, FLOC_FORMAT.EID); if (flocObject) { if (!bidUserIdAsEids) { @@ -845,8 +845,8 @@ function _handleEids(payload, validBidRequests) { } bidUserIdAsEids.push(flocObject); } - if (utils.isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { - utils.deepSetValue(payload, 'user.eids', bidUserIdAsEids); + if (isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { + deepSetValue(payload, 'user.eids', bidUserIdAsEids); } } @@ -855,7 +855,7 @@ function _checkMediaType(bid, newBid) { if (bid.ext && bid.ext['BidType'] != undefined) { newBid.mediaType = MEDIATYPE[bid.ext.BidType]; } else { - utils.logInfo(LOG_WARN_PREFIX + 'bid.ext.BidType does not exist, checking alternatively for mediaType') + logInfo(LOG_WARN_PREFIX + 'bid.ext.BidType does not exist, checking alternatively for mediaType') var adm = bid.adm; var admStr = ''; var videoRegex = new RegExp(/VAST\s+version/); @@ -870,7 +870,7 @@ function _checkMediaType(bid, newBid) { newBid.mediaType = NATIVE; } } catch (e) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + adm); + logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + adm); } } } @@ -883,7 +883,7 @@ function _parseNativeResponse(bid, newBid) { try { adm = JSON.parse(bid.adm.replace(/\\/g, '')); } catch (ex) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + newBid.adm); + logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native reponse for ad response: ' + newBid.adm); return; } if (adm && adm.native && adm.native.assets && adm.native.assets.length > 0) { @@ -943,7 +943,7 @@ function _blockedIabCategoriesValidation(payload, blockedIabCategories) { if (typeof category === 'string') { // only strings return true; } else { - utils.logWarn(LOG_WARN_PREFIX + 'bcat: Each category should be a string, ignoring category: ' + category); + logWarn(LOG_WARN_PREFIX + 'bcat: Each category should be a string, ignoring category: ' + category); return false; } }) @@ -952,11 +952,11 @@ function _blockedIabCategoriesValidation(payload, blockedIabCategories) { if (category.length > 3) { return arr.indexOf(category) === index; // unique value only } else { - utils.logWarn(LOG_WARN_PREFIX + 'bcat: Each category should have a value of a length of more than 3 characters, ignoring category: ' + category) + logWarn(LOG_WARN_PREFIX + 'bcat: Each category should have a value of a length of more than 3 characters, ignoring category: ' + category) } }); if (blockedIabCategories.length > 0) { - utils.logWarn(LOG_WARN_PREFIX + 'bcat: Selected: ', blockedIabCategories); + logWarn(LOG_WARN_PREFIX + 'bcat: Selected: ', blockedIabCategories); payload.bcat = blockedIabCategories; } } @@ -979,7 +979,7 @@ function _assignRenderer(newBid, request) { } function isNonEmptyArray(test) { - if (utils.isArray(test) === true) { + if (isArray(test) === true) { if (test.length > 0) { return true; } @@ -999,27 +999,27 @@ export const spec = { */ isBidRequestValid: bid => { if (bid && bid.params) { - if (!utils.isStr(bid.params.publisherId)) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric (wrap it in quotes in your config). Call to OpenBid will not be sent for ad unit: ' + JSON.stringify(bid)); + if (!isStr(bid.params.publisherId)) { + logWarn(LOG_WARN_PREFIX + 'Error: publisherId is mandatory and cannot be numeric (wrap it in quotes in your config). Call to OpenBid will not be sent for ad unit: ' + JSON.stringify(bid)); return false; } // video ad validation if (bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty(VIDEO)) { // bid.mediaTypes.video.mimes OR bid.params.video.mimes should be present and must be a non-empty array - let mediaTypesVideoMimes = utils.deepAccess(bid.mediaTypes, 'video.mimes'); - let paramsVideoMimes = utils.deepAccess(bid, 'params.video.mimes'); + let mediaTypesVideoMimes = deepAccess(bid.mediaTypes, 'video.mimes'); + let paramsVideoMimes = deepAccess(bid, 'params.video.mimes'); if (isNonEmptyArray(mediaTypesVideoMimes) === false && isNonEmptyArray(paramsVideoMimes) === false) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: For video ads, bid.mediaTypes.video.mimes OR bid.params.video.mimes should be present and must be a non-empty array. Call to OpenBid will not be sent for ad unit:' + JSON.stringify(bid)); + logWarn(LOG_WARN_PREFIX + 'Error: For video ads, bid.mediaTypes.video.mimes OR bid.params.video.mimes should be present and must be a non-empty array. Call to OpenBid will not be sent for ad unit:' + JSON.stringify(bid)); return false; } if (!bid.mediaTypes[VIDEO].hasOwnProperty('context')) { - utils.logError(`${LOG_WARN_PREFIX}: no context specified in bid. Rejecting bid: `, bid); + logError(`${LOG_WARN_PREFIX}: no context specified in bid. Rejecting bid: `, bid); return false; } if (bid.mediaTypes[VIDEO].context === 'outstream' && - !utils.isStr(bid.params.outstreamAU) && + !isStr(bid.params.outstreamAU) && !bid.hasOwnProperty('renderer') && !bid.mediaTypes[VIDEO].hasOwnProperty('renderer')) { // we are here since outstream ad-unit is provided without outstreamAU and renderer @@ -1029,10 +1029,10 @@ export const spec = { if (bid.mediaTypes.hasOwnProperty(BANNER) || bid.mediaTypes.hasOwnProperty(NATIVE)) { delete bid.mediaTypes[VIDEO]; - utils.logWarn(`${LOG_WARN_PREFIX}: for "outstream" bids either outstreamAU parameter must be provided or ad unit supplied renderer is required. Rejecting mediatype Video of bid: `, bid); + logWarn(`${LOG_WARN_PREFIX}: for "outstream" bids either outstreamAU parameter must be provided or ad unit supplied renderer is required. Rejecting mediatype Video of bid: `, bid); return true; } else { - utils.logError(`${LOG_WARN_PREFIX}: for "outstream" bids either outstreamAU parameter must be provided or ad unit supplied renderer is required. Rejecting bid: `, bid); + logError(`${LOG_WARN_PREFIX}: for "outstream" bids either outstreamAU parameter must be provided or ad unit supplied renderer is required. Rejecting bid: `, bid); return false; } } @@ -1061,7 +1061,7 @@ export const spec = { var blockedIabCategories = []; validBidRequests.forEach(originalBid => { - bid = utils.deepClone(originalBid); + bid = deepClone(originalBid); bid.params.adSlot = bid.params.adSlot || ''; _parseAdSlot(bid); if (bid.params.hasOwnProperty('video')) { @@ -1070,7 +1070,7 @@ export const spec = { // If we have a native mediaType configured alongside banner, its ok if the banner size is not set in width and height // The corresponding banner imp object will not be generated, but we still want the native object to be sent, hence the following check if (!(bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty(NATIVE)) && bid.params.width === 0 && bid.params.height === 0) { - utils.logWarn(LOG_WARN_PREFIX + 'Skipping the non-standard adslot: ', bid.params.adSlot, JSON.stringify(bid)); + logWarn(LOG_WARN_PREFIX + 'Skipping the non-standard adslot: ', bid.params.adSlot, JSON.stringify(bid)); return; } } @@ -1080,14 +1080,14 @@ export const spec = { if (bidCurrency === '') { bidCurrency = bid.params.currency || UNDEFINED; } else if (bid.params.hasOwnProperty('currency') && bidCurrency !== bid.params.currency) { - utils.logWarn(LOG_WARN_PREFIX + 'Currency specifier ignored. Only one currency permitted.'); + logWarn(LOG_WARN_PREFIX + 'Currency specifier ignored. Only one currency permitted.'); } bid.params.currency = bidCurrency; // check if dctr is added to more than 1 adunit - if (bid.params.hasOwnProperty('dctr') && utils.isStr(bid.params.dctr)) { + if (bid.params.hasOwnProperty('dctr') && isStr(bid.params.dctr)) { dctrArr.push(bid.params.dctr); } - if (bid.params.hasOwnProperty('bcat') && utils.isArray(bid.params.bcat)) { + if (bid.params.hasOwnProperty('bcat') && isArray(bid.params.bcat)) { blockedIabCategories = blockedIabCategories.concat(bid.params.bcat); } var impObj = _createImpressionObject(bid, conf); @@ -1130,7 +1130,7 @@ export const spec = { } // passing transactionId in source.tid - utils.deepSetValue(payload, 'source.tid', conf.transactionId); + deepSetValue(payload, 'source.tid', conf.transactionId); // test bids if (window.location.href.indexOf('pubmaticTest=true') !== -1) { @@ -1139,23 +1139,23 @@ export const spec = { // adding schain object if (validBidRequests[0].schain) { - utils.deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); + deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); } // Attaching GDPR Consent Params if (bidderRequest && bidderRequest.gdprConsent) { - utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); + deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } // CCPA if (bidderRequest && bidderRequest.uspConsent) { - utils.deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); } // coppa compliance if (config.getConfig('coppa') === true) { - utils.deepSetValue(payload, 'regs.coppa', 1); + deepSetValue(payload, 'regs.coppa', 1); } _handleEids(payload, validBidRequests); @@ -1164,10 +1164,10 @@ export const spec = { // First Party Data const commonFpd = config.getConfig('ortb2') || {}; if (commonFpd.site) { - utils.mergeDeep(payload, {site: commonFpd.site}); + mergeDeep(payload, {site: commonFpd.site}); } if (commonFpd.user) { - utils.mergeDeep(payload, {user: commonFpd.user}); + mergeDeep(payload, {user: commonFpd.user}); } // Note: Do not move this block up @@ -1205,12 +1205,12 @@ export const spec = { let parsedRequest = JSON.parse(request.data); let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : ''; try { - if (response.body && response.body.seatbid && utils.isArray(response.body.seatbid)) { + if (response.body && response.body.seatbid && isArray(response.body.seatbid)) { // Supporting multiple bid responses for same adSize respCur = response.body.cur || respCur; response.body.seatbid.forEach(seatbidder => { seatbidder.bid && - utils.isArray(seatbidder.bid) && + isArray(seatbidder.bid) && seatbidder.bid.forEach(bid => { let newBid = { requestId: bid.impid, @@ -1276,7 +1276,7 @@ export const spec = { }); } } catch (error) { - utils.logError(error); + logError(error); } return bidResponses; }, @@ -1323,7 +1323,7 @@ export const spec = { * @return {Object} params bid params */ transformBidParams: function (params, isOpenRtb) { - return utils.convertTypes({ + return convertTypes({ 'publisherId': 'string', 'adSlot': 'string' }, params); diff --git a/modules/pubperfAnalyticsAdapter.js b/modules/pubperfAnalyticsAdapter.js index 800ea1cd550..9282d5814c0 100644 --- a/modules/pubperfAnalyticsAdapter.js +++ b/modules/pubperfAnalyticsAdapter.js @@ -4,7 +4,7 @@ import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; +import { logError } from '../src/utils.js'; var pubperfAdapter = adapter({ global: 'pubperf_pbjs', @@ -16,11 +16,11 @@ pubperfAdapter.originEnableAnalytics = pubperfAdapter.enableAnalytics; pubperfAdapter.enableAnalytics = config => { if (!config || !config.provider || config.provider !== 'pubperf') { - utils.logError('expected config.provider to equal pubperf'); + logError('expected config.provider to equal pubperf'); return; } if (!window['pubperf_pbjs']) { - utils.logError( + logError( `Make sure that Pubperf tag from https://www.pubperf.com is included before the Prebid configuration.` ); return; diff --git a/modules/pubwiseAnalyticsAdapter.js b/modules/pubwiseAnalyticsAdapter.js index fe217454b88..006d6da7eb7 100644 --- a/modules/pubwiseAnalyticsAdapter.js +++ b/modules/pubwiseAnalyticsAdapter.js @@ -1,9 +1,9 @@ +import { getParameterByName, logInfo, generateUUID, debugTurnedOn } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; import { getStorageManager } from '../src/storageManager.js'; -const utils = require('../src/utils.js'); const storage = getStorageManager(); /**** @@ -76,7 +76,7 @@ function enrichWithUTM(dataBag) { let newUtm = false; try { for (let prop in utmKeys) { - utmKeys[prop] = utils.getParameterByName(prop); + utmKeys[prop] = getParameterByName(prop); if (utmKeys[prop]) { newUtm = true; dataBag[prop] = utmKeys[prop]; @@ -192,7 +192,7 @@ function markEnabled() { } function pwInfo(info, context) { - utils.logInfo(`${analyticsName} ` + info, context); + logInfo(`${analyticsName} ` + info, context); } function filterBidResponse(data) { @@ -304,7 +304,7 @@ pubwiseAnalytics.storeSessionID = function (userSessID) { // ensure a session exists, if not make one, always store it pubwiseAnalytics.ensureSession = function () { if (sessionExpired() === true || userSessionID() === null || userSessionID() === '') { - let generatedId = utils.generateUUID(); + let generatedId = generateUUID(); expireUtmData(); this.storeSessionID(generatedId); sessionData.sessionId = generatedId; @@ -320,10 +320,10 @@ pubwiseAnalytics.enableAnalytics = function (config) { configOptions = Object.assign(configOptions, config.options); // take the PBJS debug for our debug setting if no PW debug is defined if (configOptions.debug === null) { - configOptions.debug = utils.debugTurnedOn(); + configOptions.debug = debugTurnedOn(); } markEnabled(); - sessionData.activationId = utils.generateUUID(); + sessionData.activationId = generateUUID(); this.ensureSession(); pubwiseAnalytics.adapterEnableAnalytics(config); }; diff --git a/modules/pubwiseBidAdapter.js b/modules/pubwiseBidAdapter.js index f450a8bede8..a1b9ffb56a0 100644 --- a/modules/pubwiseBidAdapter.js +++ b/modules/pubwiseBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { _each, isStr, deepClone, isArray, deepSetValue, inIframe, logMessage, logInfo, logWarn, logError } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js'; @@ -81,9 +81,9 @@ let NATIVE_ASSET_KEY_TO_ASSET_MAP = {}; // together allows traversal of NATIVE_ASSETS_LIST in any direction // id -> key -utils._each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); +_each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); // key -> asset -utils._each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); +_each(NATIVE_ASSETS, anAsset => { NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); export const spec = { code: BIDDER_CODE, @@ -99,7 +99,7 @@ export const spec = { // siteId is required if (bid.params && bid.params.siteId) { // it must be a string - if (!utils.isStr(bid.params.siteId)) { + if (!isStr(bid.params.siteId)) { _logWarn('siteId is required for bid', bid); return false; } @@ -127,7 +127,7 @@ export const spec = { var blockedIabCategories = []; validBidRequests.forEach(originalBid => { - bid = utils.deepClone(originalBid); + bid = deepClone(originalBid); bid.params.adSlot = bid.params.adSlot || ''; _parseAdSlot(bid); @@ -136,7 +136,7 @@ export const spec = { bidCurrency = bid.params.currency || UNDEFINED; bid.params.currency = bidCurrency; - if (bid.params.hasOwnProperty('bcat') && utils.isArray(bid.params.bcat)) { + if (bid.params.hasOwnProperty('bcat') && isArray(bid.params.bcat)) { blockedIabCategories = blockedIabCategories.concat(bid.params.bcat); } @@ -180,27 +180,27 @@ export const spec = { } // passing transactionId in source.tid - utils.deepSetValue(payload, 'source.tid', conf.transactionId); + deepSetValue(payload, 'source.tid', conf.transactionId); // schain if (validBidRequests[0].schain) { - utils.deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); + deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); } // gdpr consent if (bidderRequest && bidderRequest.gdprConsent) { - utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); + deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } // ccpa on the root object if (bidderRequest && bidderRequest.uspConsent) { - utils.deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); } // if coppa is in effect then note it if (config.getConfig('coppa') === true) { - utils.deepSetValue(payload, 'regs.coppa', 1); + deepSetValue(payload, 'regs.coppa', 1); } var options = {contentType: 'text/plain'} @@ -230,12 +230,12 @@ export const spec = { // let parsedReferrer = parsedRequest.site && parsedRequest.site.ref ? parsedRequest.site.ref : ''; // try { - if (response.body && response.body.seatbid && utils.isArray(response.body.seatbid)) { + if (response.body && response.body.seatbid && isArray(response.body.seatbid)) { // Supporting multiple bid responses for same adSize respCur = response.body.cur || respCur; response.body.seatbid.forEach(seatbidder => { seatbidder.bid && - utils.isArray(seatbidder.bid) && + isArray(seatbidder.bid) && seatbidder.bid.forEach(bid => { let newBid = { requestId: bid.impid, @@ -388,7 +388,7 @@ function _handleCustomParams(params, conf) { value = entry.f(value, conf); } - if (utils.isStr(value)) { + if (isStr(value)) { conf[key] = value; } else { _logWarn('Ignoring param : ' + key + ' with value : ' + CUSTOM_PARAMS[key] + ', expects string-value, found ' + typeof value); @@ -469,7 +469,7 @@ function _createImpressionObject(bid, conf) { } function _parseSlotParam(paramName, paramValue) { - if (!utils.isStr(paramValue)) { + if (!isStr(paramValue)) { paramValue && _logWarn('Ignoring param key: ' + paramName + ', expects string-value, found ' + typeof paramValue); return UNDEFINED; } @@ -520,7 +520,7 @@ function _parseAdSlot(bid) { } function _cleanSlotName(slotName) { - if (utils.isStr(slotName)) { + if (isStr(slotName)) { return slotName.replace(/^\s+/g, '').replace(/\s+$/g, ''); } return ''; @@ -705,7 +705,7 @@ function _createBannerRequest(bid) { var sizes = bid.mediaTypes.banner.sizes; var format = []; var bannerObj; - if (sizes !== UNDEFINED && utils.isArray(sizes)) { + if (sizes !== UNDEFINED && isArray(sizes)) { bannerObj = {}; if (!bid.params.width && !bid.params.height) { if (sizes.length === 0) { @@ -734,7 +734,7 @@ function _createBannerRequest(bid) { } } bannerObj.pos = 0; - bannerObj.topframe = utils.inIframe() ? 0 : 1; + bannerObj.topframe = inIframe() ? 0 : 1; } else { _logWarn('Error: mediaTypes.banner.size missing for adunit: ' + bid.params.adUnit + '. Ignoring the banner impression in the adunit.'); bannerObj = UNDEFINED; @@ -745,22 +745,22 @@ function _createBannerRequest(bid) { // various error levels are not always used // eslint-disable-next-line no-unused-vars function _logMessage(textValue, objectValue) { - utils.logMessage('PubWise: ' + textValue, objectValue); + logMessage('PubWise: ' + textValue, objectValue); } // eslint-disable-next-line no-unused-vars function _logInfo(textValue, objectValue) { - utils.logInfo('PubWise: ' + textValue, objectValue); + logInfo('PubWise: ' + textValue, objectValue); } // eslint-disable-next-line no-unused-vars function _logWarn(textValue, objectValue) { - utils.logWarn('PubWise: ' + textValue, objectValue); + logWarn('PubWise: ' + textValue, objectValue); } // eslint-disable-next-line no-unused-vars function _logError(textValue, objectValue) { - utils.logError('PubWise: ' + textValue, objectValue); + logError('PubWise: ' + textValue, objectValue); } // function _decorateLog() { diff --git a/modules/pubxBidAdapter.js b/modules/pubxBidAdapter.js index c7b63d3f7f7..18d2bb11404 100644 --- a/modules/pubxBidAdapter.js +++ b/modules/pubxBidAdapter.js @@ -1,5 +1,5 @@ +import { deepSetValue } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'pubx'; const BID_ENDPOINT = 'https://api.primecaster.net/adlogue/api/slot/bid'; @@ -43,7 +43,7 @@ export const spec = { ad: body.adm }; if (body.adomains) { - utils.deepSetValue(bidResponse, 'meta.advertiserDomains', Array.isArray(body.adomains) ? body.adomains : [body.adomains]); + deepSetValue(bidResponse, 'meta.advertiserDomains', Array.isArray(body.adomains) ? body.adomains : [body.adomains]); } bidResponses.push(bidResponse); } else {}; diff --git a/modules/pubxaiAnalyticsAdapter.js b/modules/pubxaiAnalyticsAdapter.js index 98b4dec1dca..3232d34ccba 100644 --- a/modules/pubxaiAnalyticsAdapter.js +++ b/modules/pubxaiAnalyticsAdapter.js @@ -1,8 +1,8 @@ +import { deepAccess, getGptSlotInfoForAdUnitCode, parseSizesInput, getWindowLocation, buildUrl } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; const emptyUrl = ''; const analyticsType = 'endpoint'; @@ -34,7 +34,7 @@ var pubxaiAnalyticsAdapter = Object.assign(adapter( events.auctionInit = args; events.floorDetail = {}; events.bids = []; - const floorData = utils.deepAccess(args, 'bidderRequests.0.bids.0.floorData'); + const floorData = deepAccess(args, 'bidderRequests.0.bids.0.floorData'); if (typeof floorData !== 'undefined') { Object.assign(events.floorDetail, floorData); } @@ -57,7 +57,7 @@ function mapBidResponse(bidResponse, status) { if (typeof bidResponse !== 'undefined') { let bid = { adUnitCode: bidResponse.adUnitCode, - gptSlotCode: utils.getGptSlotInfoForAdUnitCode(bidResponse.adUnitCode).gptSlot || null, + gptSlotCode: getGptSlotInfoForAdUnitCode(bidResponse.adUnitCode).gptSlot || null, auctionId: bidResponse.auctionId, bidderCode: bidResponse.bidder, cpm: bidResponse.cpm, @@ -77,7 +77,7 @@ function mapBidResponse(bidResponse, status) { Object.assign(bid, { bidId: status === 'timeout' ? bidResponse.bidId : bidResponse.requestId, renderStatus: status === 'timeout' ? 3 : 2, - sizes: utils.parseSizesInput(bidResponse.size).toString(), + sizes: parseSizesInput(bidResponse.size).toString(), }); events.bids.push(bid); } else { @@ -85,7 +85,7 @@ function mapBidResponse(bidResponse, status) { bidId: bidResponse.requestId, floorProvider: events.floorDetail ? events.floorDetail.floorProvider : null, isWinningBid: true, - placementId: bidResponse.params ? utils.deepAccess(bidResponse, 'params.0.placementId') : null, + placementId: bidResponse.params ? deepAccess(bidResponse, 'params.0.placementId') : null, renderedSize: bidResponse.size, renderStatus: 4 }); @@ -131,7 +131,7 @@ pubxaiAnalyticsAdapter.shouldFireEventRequest = function (samplingRate = 1) { function send(data, status) { if (pubxaiAnalyticsAdapter.shouldFireEventRequest(initOptions.samplingRate)) { - let location = utils.getWindowLocation(); + let location = getWindowLocation(); data.initOptions = initOptions; if (typeof data !== 'undefined' && typeof data.auctionInit !== 'undefined') { Object.assign(data.pageDetail, { @@ -150,7 +150,7 @@ function send(data, status) { deviceOS: getOS(), browser: getBrowser() }); - let pubxaiAnalyticsRequestUrl = utils.buildUrl({ + let pubxaiAnalyticsRequestUrl = buildUrl({ protocol: 'https', hostname: (initOptions && initOptions.hostName) || defaultHost, pathname: status == 'bidwon' ? winningBidPath : auctionPath, diff --git a/modules/pulsepointBidAdapter.js b/modules/pulsepointBidAdapter.js index 5f8f096926b..7aa3ad6088c 100644 --- a/modules/pulsepointBidAdapter.js +++ b/modules/pulsepointBidAdapter.js @@ -1,5 +1,5 @@ /* eslint dot-notation:0, quote-props:0 */ -import * as utils from '../src/utils.js'; +import { convertTypes, deepAccess, isArray, logError, isFn } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { Renderer } from '../src/Renderer.js'; @@ -77,7 +77,7 @@ export const spec = { } }, transformBidParams: function(params, isOpenRtb) { - return utils.convertTypes({ + return convertTypes({ 'cf': 'string', 'cp': 'number', 'ct': 'number' @@ -124,8 +124,8 @@ function bidResponseAvailable(request, response) { }; if (idToImpMap[id].video) { // for outstream, a renderer is specified - if (idToSlotConfig[id] && utils.deepAccess(idToSlotConfig[id], 'mediaTypes.video.context') === 'outstream') { - bid.renderer = outstreamRenderer(utils.deepAccess(idToSlotConfig[id], 'renderer.options'), utils.deepAccess(idToBidMap[id], 'ext.outstream')); + if (idToSlotConfig[id] && deepAccess(idToSlotConfig[id], 'mediaTypes.video.context') === 'outstream') { + bid.renderer = outstreamRenderer(deepAccess(idToSlotConfig[id], 'renderer.options'), deepAccess(idToBidMap[id], 'ext.outstream')); } bid.vastXml = idToBidMap[id].adm; bid.mediaType = 'video'; @@ -178,9 +178,9 @@ function banner(slot) { * Produce openrtb format objects based on the sizes configured for the slot. */ function parseSizes(slot) { - const sizes = utils.deepAccess(slot, 'mediaTypes.banner.sizes'); - if (sizes && utils.isArray(sizes)) { - return sizes.filter(sz => utils.isArray(sz) && sz.length === 2).map(sz => ({ + const sizes = deepAccess(slot, 'mediaTypes.banner.sizes'); + if (sizes && isArray(sizes)) { + return sizes.filter(sz => isArray(sz) && sz.length === 2).map(sz => ({ w: sz[0], h: sz[1] })); @@ -387,7 +387,7 @@ function parse(rawResponse) { return JSON.parse(rawResponse); } } catch (ex) { - utils.logError('pulsepointLite.safeParse', 'ERROR', ex); + logError('pulsepointLite.safeParse', 'ERROR', ex); } return null; } @@ -425,14 +425,14 @@ function user(bidRequest, bidderRequest) { addExternalUserId(ext.eids, bidRequest.userId.britepoolid, 'britepool.com'); addExternalUserId(ext.eids, bidRequest.userId.criteoId, 'criteo.com'); addExternalUserId(ext.eids, bidRequest.userId.idl_env, 'liveramp.com'); - addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.id5id.uid'), 'id5-sync.com', utils.deepAccess(bidRequest, 'userId.id5id.ext')); - addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.parrableId.eid'), 'parrable.com'); + addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.id5id.uid'), 'id5-sync.com', deepAccess(bidRequest, 'userId.id5id.ext')); + addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.parrableId.eid'), 'parrable.com'); addExternalUserId(ext.eids, bidRequest.userId.fabrickId, 'neustar.biz'); - addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.haloId.haloId'), 'audigent.com'); + addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.haloId.haloId'), 'audigent.com'); addExternalUserId(ext.eids, bidRequest.userId.merkleId, 'merkleinc.com'); addExternalUserId(ext.eids, bidRequest.userId.lotamePanoramaId, 'crwdcntrl.net'); addExternalUserId(ext.eids, bidRequest.userId.connectid, 'verizonmedia.com'); - addExternalUserId(ext.eids, utils.deepAccess(bidRequest, 'userId.uid2.id'), 'uidapi.com'); + addExternalUserId(ext.eids, deepAccess(bidRequest, 'userId.uid2.id'), 'uidapi.com'); // liveintent if (bidRequest.userId.lipb && bidRequest.userId.lipb.lipbid) { addExternalUserId(ext.eids, bidRequest.userId.lipb.lipbid, 'liveintent.com'); @@ -532,7 +532,7 @@ function nativeResponse(imp, bid) { function bidFloor(slot) { let floor = slot.params.bidfloor; - if (utils.isFn(slot.getFloor)) { + if (isFn(slot.getFloor)) { const floorData = slot.getFloor({ mediaType: slot.mediaTypes.banner ? 'banner' : slot.mediaTypes.video ? 'video' : 'Native', size: '*', diff --git a/modules/pxyzBidAdapter.js b/modules/pxyzBidAdapter.js index 9baff4d1533..e144eb84a01 100644 --- a/modules/pxyzBidAdapter.js +++ b/modules/pxyzBidAdapter.js @@ -1,6 +1,6 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; +import { logInfo, logError, isArray } from '../src/utils.js'; const BIDDER_CODE = 'pxyz'; const URL = 'https://ads.playground.xyz/host-config/prebid?v=2'; @@ -61,15 +61,15 @@ export const spec = { if (bidderRequest && bidderRequest.gdprConsent) { const gdpr = bidderRequest.gdprConsent.gdprApplies ? 1 : 0; const consentString = bidderRequest.gdprConsent.consentString; - utils.logInfo(`PXYZ: GDPR applies ${gdpr}`); - utils.logInfo(`PXYZ: GDPR consent string ${consentString}`); + logInfo(`PXYZ: GDPR applies ${gdpr}`); + logInfo(`PXYZ: GDPR consent string ${consentString}`); payload.Regs.ext.gdpr = gdpr; payload.User = { ext: { consent: consentString } }; } // CCPA if (bidderRequest && bidderRequest.uspConsent) { - utils.logInfo(`PXYZ: USP Consent ${bidderRequest.uspConsent}`); + logInfo(`PXYZ: USP Consent ${bidderRequest.uspConsent}`); payload.Regs.ext['us_privacy'] = bidderRequest.uspConsent; } @@ -95,14 +95,14 @@ export const spec = { let errorMessage = `in response for ${bidderRequest.bidderCode} adapter`; if (serverResponse && serverResponse.error) { errorMessage += `: ${serverResponse.error}`; - utils.logError(errorMessage); + logError(errorMessage); } return bids; } - if (!utils.isArray(serverResponse.seatbid)) { + if (!isArray(serverResponse.seatbid)) { let errorMessage = `in response for ${bidderRequest.bidderCode} adapter `; - utils.logError(errorMessage += 'Malformed seatbid response'); + logError(errorMessage += 'Malformed seatbid response'); return bids; } diff --git a/modules/quantcastBidAdapter.js b/modules/quantcastBidAdapter.js index ecb5ad3176e..e168339426d 100644 --- a/modules/quantcastBidAdapter.js +++ b/modules/quantcastBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, logInfo, logError, isEmpty, isArray } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { config } from '../src/config.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -24,8 +24,8 @@ export const QUANTCAST_FPA = '__qca'; export const storage = getStorageManager(QUANTCAST_VENDOR_ID, BIDDER_CODE); function makeVideoImp(bid) { - const videoInMediaType = utils.deepAccess(bid, 'mediaTypes.video') || {}; - const videoInParams = utils.deepAccess(bid, 'params.video') || {}; + const videoInMediaType = deepAccess(bid, 'mediaTypes.video') || {}; + const videoInParams = deepAccess(bid, 'params.video') || {}; const video = Object.assign({}, videoInParams, videoInMediaType); if (video.playerSize) { @@ -142,10 +142,10 @@ export const spec = { */ buildRequests(bidRequests, bidderRequest) { const bids = bidRequests || []; - const gdprConsent = utils.deepAccess(bidderRequest, 'gdprConsent') || {}; - const uspConsent = utils.deepAccess(bidderRequest, 'uspConsent'); - const referrer = utils.deepAccess(bidderRequest, 'refererInfo.referer'); - const page = utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || utils.deepAccess(window, 'location.href'); + const gdprConsent = deepAccess(bidderRequest, 'gdprConsent') || {}; + const uspConsent = deepAccess(bidderRequest, 'uspConsent'); + const referrer = deepAccess(bidderRequest, 'refererInfo.referer'); + const page = deepAccess(bidderRequest, 'refererInfo.canonicalUrl') || config.getConfig('pageUrl') || deepAccess(window, 'location.href'); const domain = getDomain(page); // Check for GDPR consent for purpose 1, and drop request if consent has not been given @@ -153,11 +153,11 @@ export const spec = { if (gdprConsent.gdprApplies) { if (gdprConsent.vendorData) { if (gdprConsent.apiVersion === 1 && !checkTCFv1(gdprConsent.vendorData)) { - utils.logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v1`); + logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v1`); return; } if (gdprConsent.apiVersion === 2 && !checkTCFv2(gdprConsent.vendorData)) { - utils.logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v2`); + logInfo(`${BIDDER_CODE}: No purpose 1 consent for TCF v2`); return; } } @@ -174,7 +174,7 @@ export const spec = { imp = makeBannerImp(bid); } else { // Unsupported mediaType - utils.logInfo(`${BIDDER_CODE}: No supported mediaTypes found in ${JSON.stringify(bid.mediaTypes)}`); + logInfo(`${BIDDER_CODE}: No supported mediaTypes found in ${JSON.stringify(bid.mediaTypes)}`); return; } } else { @@ -231,18 +231,18 @@ export const spec = { */ interpretResponse(serverResponse) { if (serverResponse === undefined) { - utils.logError('Server Response is undefined'); + logError('Server Response is undefined'); return []; } const response = serverResponse['body']; if (response === undefined || !response.hasOwnProperty('bids')) { - utils.logError('Sub-optimal JSON received from Quantcast server'); + logError('Sub-optimal JSON received from Quantcast server'); return []; } - if (utils.isEmpty(response.bids)) { + if (isEmpty(response.bids)) { // Shortcut response handling if no bids are present return []; } @@ -271,7 +271,7 @@ export const spec = { result['dealId'] = dealId; } - if (meta !== undefined && meta.advertiserDomains && utils.isArray(meta.advertiserDomains)) { + if (meta !== undefined && meta.advertiserDomains && isArray(meta.advertiserDomains)) { result.meta = {}; result.meta.advertiserDomains = meta.advertiserDomains; } @@ -289,11 +289,11 @@ export const spec = { const syncs = [] if (!hasUserSynced && syncOptions.pixelEnabled) { const responseWithUrl = find(serverResponses, serverResponse => - utils.deepAccess(serverResponse.body, 'userSync.url') + deepAccess(serverResponse.body, 'userSync.url') ); if (responseWithUrl) { - const url = utils.deepAccess(responseWithUrl.body, 'userSync.url') + const url = deepAccess(responseWithUrl.body, 'userSync.url') syncs.push({ type: 'image', url: url diff --git a/modules/radsBidAdapter.js b/modules/radsBidAdapter.js index 5cc88440629..fee5daa3fb4 100644 --- a/modules/radsBidAdapter.js +++ b/modules/radsBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -216,7 +216,7 @@ function prepareExtraParams(params, payload, bidderRequest, bidRequest) { * @returns {boolean} True if it's a banner bid */ function isBannerRequest(bid) { - return bid.mediaType === 'banner' || !!utils.deepAccess(bid, 'mediaTypes.banner') || !isVideoRequest(bid); + return bid.mediaType === 'banner' || !!deepAccess(bid, 'mediaTypes.banner') || !isVideoRequest(bid); } /** @@ -226,7 +226,7 @@ function isBannerRequest(bid) { * @returns {boolean} True if it's a video bid */ function isVideoRequest(bid) { - return bid.mediaType === 'video' || !!utils.deepAccess(bid, 'mediaTypes.video'); + return bid.mediaType === 'video' || !!deepAccess(bid, 'mediaTypes.video'); } /** @@ -236,7 +236,7 @@ function isVideoRequest(bid) { * @returns {object} True if it's a video bid */ function getVideoSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); } /** @@ -246,7 +246,7 @@ function getVideoSizes(bid) { * @returns {object} True if it's a video bid */ function getBannerSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); } /** From f0be8816095d91ddac4ed9fc11fb4673ad9bf42f Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 10:56:56 -0700 Subject: [PATCH 102/250] PBjs Core: use GPT's slot.updateTargetingFromMap instead of slot.setTargeting (Issue #7416) (#7453) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * using GPT's slot.updateTargetingFromMap instead of slot.setTargeting tests are failing; need to fix tests * now tests are passing * tests passsing now * modified the check for splitting the string * added some explanation in comment * code review suggestions --- src/targeting.js | 23 ++++++++++------------- test/spec/unit/pbjs_api_spec.js | 4 ++++ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/targeting.js b/src/targeting.js index 96692376d82..ce519f8add3 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -379,21 +379,18 @@ export function newTargeting(auctionManager) { targeting.setTargetingForGPT = function(targetingConfig, customSlotMatching) { window.googletag.pubads().getSlots().forEach(slot => { Object.keys(targetingConfig).filter(customSlotMatching ? customSlotMatching(slot) : isAdUnitCodeMatchingSlot(slot)) - .forEach(targetId => + .forEach(targetId => { Object.keys(targetingConfig[targetId]).forEach(key => { - let valueArr = targetingConfig[targetId][key]; - if (typeof valueArr === 'string') { - valueArr = valueArr.split(','); + let value = targetingConfig[targetId][key]; + if (typeof value === 'string' && value.indexOf(',') !== -1) { + // due to the check the array will be formed only if string has ',' else plain string will be assigned as value + value = value.split(','); } - valueArr = (valueArr.length > 1) ? [valueArr] : valueArr; - valueArr.map((value) => { - utils.logMessage(`Attempting to set key value for slot: ${slot.getSlotElementId()} key: ${key} value: ${value}`); - return value; - }).forEach(value => { - slot.setTargeting(key, value); - }); - }) - ) + targetingConfig[targetId][key] = value; + }); + utils.logMessage(`Attempting to set targeting-map for slot: ${slot.getSlotElementId()} with targeting-map:`, targetingConfig[targetId]); + slot.updateTargetingFromMap(targetingConfig[targetId]) + }) }) }; diff --git a/test/spec/unit/pbjs_api_spec.js b/test/spec/unit/pbjs_api_spec.js index 199ce699dc8..cc75b95a7ac 100644 --- a/test/spec/unit/pbjs_api_spec.js +++ b/test/spec/unit/pbjs_api_spec.js @@ -75,6 +75,10 @@ var Slot = function Slot(elementId, pathId) { clearTargeting: function clearTargeting() { this.targeting = {}; return this; + }, + + updateTargetingFromMap: function updateTargetingFromMap(targetingMap) { + Object.keys(targetingMap).forEach(key => this.setTargeting(key, targetingMap[key])) } }; slot.spySetTargeting = sinon.spy(slot, 'setTargeting'); From 38c353a04994806c55ad50179a76bb37b94608ea Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 11:46:24 -0700 Subject: [PATCH 103/250] Multiple Bid/Analytics/ID Adapters: import utils functions as needed and not the whole module (#7483) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/datablocksBidAdapter.js | 24 +++++++-------- modules/deepintentBidAdapter.js | 26 ++++++++-------- modules/dgkeywordRtdProvider.js | 20 ++++++------ modules/districtmDMXBidAdapter.js | 30 +++++++++--------- modules/dmdIdSystem.js | 10 +++--- modules/docereeBidAdapter.js | 18 +++++------ modules/dspxBidAdapter.js | 10 +++--- modules/ebdrBidAdapter.js | 18 +++++------ modules/emx_digitalBidAdapter.js | 46 ++++++++++++++-------------- modules/enrichmentFpdModule.js | 19 ++++++------ modules/eplanningAnalyticsAdapter.js | 4 +-- modules/eplanningBidAdapter.js | 14 ++++----- modules/etargetBidAdapter.js | 8 ++--- modules/express.js | 19 ++++++------ modules/fabrickIdSystem.js | 12 ++++---- 15 files changed, 139 insertions(+), 139 deletions(-) diff --git a/modules/datablocksBidAdapter.js b/modules/datablocksBidAdapter.js index bfbe7a16fc6..197ba19b1d6 100644 --- a/modules/datablocksBidAdapter.js +++ b/modules/datablocksBidAdapter.js @@ -1,6 +1,6 @@ +import { getWindowTop, isGptPubadsDefined, deepAccess, getAdUnitSizes, isEmpty } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; import { BANNER, NATIVE } from '../src/mediaTypes.js'; import { getStorageManager } from '../src/storageManager.js'; import { ajax } from '../src/ajax.js'; @@ -199,7 +199,7 @@ export const spec = { // GET BASIC CLIENT INFORMATION get_client_info: function () { let botTest = new BotClientTests(); - let win = utils.getWindowTop(); + let win = getWindowTop(); return { 'wiw': win.innerWidth, 'wih': win.innerHeight, @@ -226,7 +226,7 @@ export const spec = { // ADD GPT EVENT LISTENERS let scope = this; - if (utils.isGptPubadsDefined()) { + if (isGptPubadsDefined()) { if (typeof window['googletag'].pubads().addEventListener == 'function') { window['googletag'].pubads().addEventListener('impressionViewable', function(event) { scope.queue_metric({type: 'slot_view', source_id: scope.db_obj.source_id, auction_id: bid.auctionId, div_id: event.slot.getSlotElementId(), slot_id: event.slot.getSlotId().getAdUnitPath()}); @@ -306,7 +306,7 @@ export const spec = { tagid: bidRequest.params.tagid || bidRequest.adUnitCode, placement_id: bidRequest.params.placement_id || 0, secure: window.location.protocol == 'https:', - ortb2: utils.deepAccess(bidRequest, `ortb2Imp`) || {}, + ortb2: deepAccess(bidRequest, `ortb2Imp`) || {}, floor: {} } @@ -320,8 +320,8 @@ export const spec = { } // BUILD THE SIZES - if (utils.deepAccess(bidRequest, `mediaTypes.banner`)) { - let sizes = utils.getAdUnitSizes(bidRequest); + if (deepAccess(bidRequest, `mediaTypes.banner`)) { + let sizes = getAdUnitSizes(bidRequest); if (sizes.length) { imp.banner = { w: sizes[0][0], @@ -332,7 +332,7 @@ export const spec = { // ADD TO THE LIST OF IMP REQUESTS imps.push(imp); } - } else if (utils.deepAccess(bidRequest, `mediaTypes.native`)) { + } else if (deepAccess(bidRequest, `mediaTypes.native`)) { // ADD TO THE LIST OF IMP REQUESTS imp.native = createNativeRequest(bidRequest); imps.push(imp); @@ -521,15 +521,15 @@ export const spec = { const {id, img, data, title} = asset; const key = NATIVE_ID_MAP[id]; if (key) { - if (!utils.isEmpty(title)) { + if (!isEmpty(title)) { result.title = title.text - } else if (!utils.isEmpty(img)) { + } else if (!isEmpty(img)) { result[key] = { url: img.url, height: img.h, width: img.w } - } else if (!utils.isEmpty(data)) { + } else if (!isEmpty(data)) { result[key] = data.value; } } @@ -539,11 +539,11 @@ export const spec = { } let bids = []; - let resBids = utils.deepAccess(rtbResponse, 'body.seatbid') || []; + let resBids = deepAccess(rtbResponse, 'body.seatbid') || []; resBids.forEach(bid => { let resultItem = {requestId: bid.id, cpm: bid.price, creativeId: bid.crid, currency: bid.currency || 'USD', netRevenue: true, ttl: bid.ttl || 360, meta: {advertiserDomains: bid.adomain}}; - let mediaType = utils.deepAccess(bid, 'ext.mtype') || ''; + let mediaType = deepAccess(bid, 'ext.mtype') || ''; switch (mediaType) { case 'banner': bids.push(Object.assign({}, resultItem, {mediaType: BANNER, width: bid.w, height: bid.h, ad: bid.adm})); diff --git a/modules/deepintentBidAdapter.js b/modules/deepintentBidAdapter.js index 25c6ee9b25b..f2314454ab9 100644 --- a/modules/deepintentBidAdapter.js +++ b/modules/deepintentBidAdapter.js @@ -1,6 +1,6 @@ +import { generateUUID, deepSetValue, deepAccess, isArray } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER} from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'deepintent'; const BIDDER_ENDPOINT = 'https://prebid.deepintent.com/prebid'; const USER_SYNC_URL = 'https://cdn.deepintent.com/syncpixel.html'; @@ -32,7 +32,7 @@ export const spec = { var user = validBidRequests.map(bid => buildUser(bid)); clean(user); const openRtbBidRequest = { - id: utils.generateUUID(), + id: generateUUID(), at: 1, imp: validBidRequests.map(bid => buildImpression(bid)), site: buildSite(bidderRequest), @@ -41,12 +41,12 @@ export const spec = { }; if (bidderRequest && bidderRequest.uspConsent) { - utils.deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(openRtbBidRequest, 'regs.ext.us_privacy', bidderRequest.uspConsent); } if (bidderRequest && bidderRequest.gdprConsent) { - utils.deepSetValue(openRtbBidRequest, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(openRtbBidRequest, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); + deepSetValue(openRtbBidRequest, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(openRtbBidRequest, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } injectEids(openRtbBidRequest, validBidRequests); @@ -134,19 +134,19 @@ function buildUser(bid) { } function injectEids(openRtbBidRequest, validBidRequests) { - const bidUserIdAsEids = utils.deepAccess(validBidRequests, '0.userIdAsEids'); - if (utils.isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { - utils.deepSetValue(openRtbBidRequest, 'user.eids', bidUserIdAsEids); - utils.deepSetValue(openRtbBidRequest, 'user.ext.eids', bidUserIdAsEids); + const bidUserIdAsEids = deepAccess(validBidRequests, '0.userIdAsEids'); + if (isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { + deepSetValue(openRtbBidRequest, 'user.eids', bidUserIdAsEids); + deepSetValue(openRtbBidRequest, 'user.ext.eids', bidUserIdAsEids); } } function buildBanner(bid) { - if (utils.deepAccess(bid, 'mediaTypes.banner')) { + if (deepAccess(bid, 'mediaTypes.banner')) { // Get Sizes from MediaTypes Object, Will always take first size, will be overrided by params for exact w,h - if (utils.deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { - let sizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes'); - if (utils.isArray(sizes) && sizes.length > 0) { + if (deepAccess(bid, 'mediaTypes.banner.sizes') && !bid.params.height && !bid.params.width) { + let sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + if (isArray(sizes) && sizes.length > 0) { return { h: sizes[0][1], w: sizes[0][0], diff --git a/modules/dgkeywordRtdProvider.js b/modules/dgkeywordRtdProvider.js index 58cec36a6b9..a086091d464 100644 --- a/modules/dgkeywordRtdProvider.js +++ b/modules/dgkeywordRtdProvider.js @@ -7,7 +7,7 @@ * @requires module:modules/realTimeData */ -import * as utils from '../src/utils.js'; +import { logMessage, deepSetValue, logError, logInfo } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getGlobal } from '../src/prebidGlobal.js'; @@ -26,19 +26,19 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us const url = (moduleConfig && moduleConfig.params && moduleConfig.params.url) ? moduleConfig.params.url : URL + encodeURIComponent(window.location.href); const adUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits; let isFinish = false; - utils.logMessage('[dgkeyword sub module]', adUnits, timeout); + logMessage('[dgkeyword sub module]', adUnits, timeout); let setKeywordTargetBidders = getTargetBidderOfDgKeywords(adUnits); if (setKeywordTargetBidders.length <= 0) { - utils.logMessage('[dgkeyword sub module] no dgkeyword targets.'); + logMessage('[dgkeyword sub module] no dgkeyword targets.'); callback(); } else { - utils.logMessage('[dgkeyword sub module] dgkeyword targets:', setKeywordTargetBidders); - utils.logMessage('[dgkeyword sub module] get targets from profile api start.'); + logMessage('[dgkeyword sub module] dgkeyword targets:', setKeywordTargetBidders); + logMessage('[dgkeyword sub module] get targets from profile api start.'); ajax(url, { success: function(response) { const res = JSON.parse(response); if (!isFinish) { - utils.logMessage('[dgkeyword sub module] get targets from profile api end.'); + logMessage('[dgkeyword sub module] get targets from profile api end.'); if (res) { let keywords = {}; if (res['s'] != null && res['s'].length > 0) { @@ -60,8 +60,8 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us if (!reqBidsConfigObj._ignoreSetOrtb2) { // set keywrods to ortb2 let addOrtb2 = {}; - utils.deepSetValue(addOrtb2, 'site.keywords', keywords); - utils.deepSetValue(addOrtb2, 'user.keywords', keywords); + deepSetValue(addOrtb2, 'site.keywords', keywords); + deepSetValue(addOrtb2, 'user.keywords', keywords); const ortb2 = {ortb2: addOrtb2}; reqBidsConfigObj.setBidderConfig({ bidders: Object.keys(targetBidKeys), config: ortb2 }); } @@ -73,7 +73,7 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us }, error: function(errorStatus) { // error occur - utils.logError('[dgkeyword sub module] profile api access error.', errorStatus); + logError('[dgkeyword sub module] profile api access error.', errorStatus); callback(); } }, null, { @@ -83,7 +83,7 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us setTimeout(function () { if (!isFinish) { // profile api timeout - utils.logInfo('[dgkeyword sub module] profile api timeout. [timeout: ' + timeout + 'ms]'); + logInfo('[dgkeyword sub module] profile api timeout. [timeout: ' + timeout + 'ms]'); isFinish = true; } callback(); diff --git a/modules/districtmDMXBidAdapter.js b/modules/districtmDMXBidAdapter.js index a35965c4cb4..f909a1f1329 100644 --- a/modules/districtmDMXBidAdapter.js +++ b/modules/districtmDMXBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isArray, generateUUID, deepAccess, isStr } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -30,7 +30,7 @@ export const spec = { interpretResponse(response, bidRequest) { response = response.body || {}; if (response.seatbid) { - if (utils.isArray(response.seatbid)) { + if (isArray(response.seatbid)) { const { seatbid } = response; let winners = seatbid.reduce((bid, ads) => { let ad = ads.bid.reduce(function (oBid, nBid) { @@ -89,7 +89,7 @@ export const spec = { let timeout = config.getConfig('bidderTimeout'); let schain = null; let dmxRequest = { - id: utils.generateUUID(), + id: generateUUID(), cur: ['USD'], tmax: (timeout - 300), test: this.test() || 0, @@ -109,17 +109,17 @@ export const spec = { let eids = []; if (bidRequest[0] && bidRequest[0].userId) { - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.idl_env`), 'liveramp.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.id5id.uid`), 'id5-sync.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.pubcid`), 'pubcid.org', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.tdid`), 'adserver.org', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.criteoId`), 'criteo.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.britepoolid`), 'britepool.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.lipb.lipbid`), 'liveintent.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.intentiqid`), 'intentiq.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.lotamePanoramaId`), 'lotame.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.parrableId`), 'parrable.com', 1); - bindUserId(eids, utils.deepAccess(bidRequest[0], `userId.netId`), 'netid.de', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.idl_env`), 'liveramp.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.id5id.uid`), 'id5-sync.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.pubcid`), 'pubcid.org', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.tdid`), 'adserver.org', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.criteoId`), 'criteo.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.britepoolid`), 'britepool.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.lipb.lipbid`), 'liveintent.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.intentiqid`), 'intentiq.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.lotamePanoramaId`), 'lotame.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.parrableId`), 'parrable.com', 1); + bindUserId(eids, deepAccess(bidRequest[0], `userId.netId`), 'netid.de', 1); dmxRequest.user = dmxRequest.user || {}; dmxRequest.user.ext = dmxRequest.user.ext || {}; dmxRequest.user.ext.eids = eids; @@ -370,7 +370,7 @@ export function defaultSize(thebidObj) { } export function bindUserId(eids, value, source, atype) { - if (utils.isStr(value) && Array.isArray(eids)) { + if (isStr(value) && Array.isArray(eids)) { eids.push({ source, uids: [ diff --git a/modules/dmdIdSystem.js b/modules/dmdIdSystem.js index 72d3518c20f..b42315d66ee 100644 --- a/modules/dmdIdSystem.js +++ b/modules/dmdIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; +import { logError, getWindowLocation } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { ajax } from '../src/ajax.js'; @@ -46,7 +46,7 @@ export const dmdIdSubmodule = { !configParams.api_key || typeof configParams.api_key !== 'string' ) { - utils.logError('dmd submodule requires an api_key.'); + logError('dmd submodule requires an api_key.'); return; } // If cahceIdObj is null or undefined - calling AIX-API @@ -59,7 +59,7 @@ export const dmdIdSubmodule = { // Setting headers const headers = {}; headers['x-api-key'] = configParams.api_key; - headers['x-domain'] = utils.getWindowLocation(); + headers['x-domain'] = getWindowLocation(); // Response callbacks const resp = function (callback) { const callbacks = { @@ -72,12 +72,12 @@ export const dmdIdSubmodule = { responseId = responseObj.dgid; } } catch (error) { - utils.logError(error); + logError(error); } callback(responseId); }, error: error => { - utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error); + logError(`${MODULE_NAME}: ID fetch encountered an error`, error); callback(); } }; diff --git a/modules/docereeBidAdapter.js b/modules/docereeBidAdapter.js index f9f3e1bcc70..704619f3ff7 100644 --- a/modules/docereeBidAdapter.js +++ b/modules/docereeBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { tryAppendQueryString } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER } from '../src/mediaTypes.js'; @@ -24,14 +24,14 @@ export const spec = { const { publisherUrl, placementId } = validBidRequest.params; const url = publisherUrl || page let queryString = ''; - queryString = utils.tryAppendQueryString(queryString, 'id', placementId); - queryString = utils.tryAppendQueryString(queryString, 'publisherDomain', domain); - queryString = utils.tryAppendQueryString(queryString, 'pubRequestedURL', encodeURIComponent(url)); - queryString = utils.tryAppendQueryString(queryString, 'loggedInUser', encodedUserInfo); - queryString = utils.tryAppendQueryString(queryString, 'currentUrl', url); - queryString = utils.tryAppendQueryString(queryString, 'prebidjs', true); - queryString = utils.tryAppendQueryString(queryString, 'token', token); - queryString = utils.tryAppendQueryString(queryString, 'requestId', validBidRequest.bidId); + queryString = tryAppendQueryString(queryString, 'id', placementId); + queryString = tryAppendQueryString(queryString, 'publisherDomain', domain); + queryString = tryAppendQueryString(queryString, 'pubRequestedURL', encodeURIComponent(url)); + queryString = tryAppendQueryString(queryString, 'loggedInUser', encodedUserInfo); + queryString = tryAppendQueryString(queryString, 'currentUrl', url); + queryString = tryAppendQueryString(queryString, 'prebidjs', true); + queryString = tryAppendQueryString(queryString, 'token', token); + queryString = tryAppendQueryString(queryString, 'requestId', validBidRequest.bidId); serverRequests.push({ method: 'GET', diff --git a/modules/dspxBidAdapter.js b/modules/dspxBidAdapter.js index df0f6f3b8ea..16c06073c41 100644 --- a/modules/dspxBidAdapter.js +++ b/modules/dspxBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -199,7 +199,7 @@ function objectToQueryString(obj, prefix) { * @returns {boolean} True if it's a banner bid */ function isBannerRequest(bid) { - return bid.mediaType === 'banner' || !!utils.deepAccess(bid, 'mediaTypes.banner') || !isVideoRequest(bid); + return bid.mediaType === 'banner' || !!deepAccess(bid, 'mediaTypes.banner') || !isVideoRequest(bid); } /** @@ -209,7 +209,7 @@ function isBannerRequest(bid) { * @returns {boolean} True if it's a video bid */ function isVideoRequest(bid) { - return bid.mediaType === 'video' || !!utils.deepAccess(bid, 'mediaTypes.video'); + return bid.mediaType === 'video' || !!deepAccess(bid, 'mediaTypes.video'); } /** @@ -219,7 +219,7 @@ function isVideoRequest(bid) { * @returns {object} True if it's a video bid */ function getVideoSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.video.playerSize') || bid.sizes); } /** @@ -229,7 +229,7 @@ function getVideoSizes(bid) { * @returns {object} True if it's a video bid */ function getBannerSizes(bid) { - return parseSizes(utils.deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); + return parseSizes(deepAccess(bid, 'mediaTypes.banner.sizes') || bid.sizes); } /** diff --git a/modules/ebdrBidAdapter.js b/modules/ebdrBidAdapter.js index cfbbbee61cb..62a3b171b74 100644 --- a/modules/ebdrBidAdapter.js +++ b/modules/ebdrBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logInfo, getBidIdParameter } from '../src/utils.js'; import { VIDEO, BANNER } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'ebdr'; @@ -18,11 +18,11 @@ export const spec = { let zoneid = ''; let requestId = ''; bids.forEach(bid => { - utils.logInfo('Log bid', bid); - let bidFloor = utils.getBidIdParameter('bidfloor', bid.params); + logInfo('Log bid', bid); + let bidFloor = getBidIdParameter('bidfloor', bid.params); let whArr = getWidthAndHeight(bid); let _mediaTypes = (bid.mediaTypes && bid.mediaTypes.video) ? VIDEO : BANNER; - zoneid = utils.getBidIdParameter('zoneid', bid.params); + zoneid = getBidIdParameter('zoneid', bid.params); requestId = bid.bidderRequestId; ebdrImps.push({ id: bid.bidId, @@ -36,9 +36,9 @@ export const spec = { w: whArr[0], h: whArr[1] }; - ebdrParams['latitude'] = utils.getBidIdParameter('latitude', bid.params); - ebdrParams['longitude'] = utils.getBidIdParameter('longitude', bid.params); - ebdrParams['ifa'] = (utils.getBidIdParameter('IDFA', bid.params).length > utils.getBidIdParameter('ADID', bid.params).length) ? utils.getBidIdParameter('IDFA', bid.params) : utils.getBidIdParameter('ADID', bid.params); + ebdrParams['latitude'] = getBidIdParameter('latitude', bid.params); + ebdrParams['longitude'] = getBidIdParameter('longitude', bid.params); + ebdrParams['ifa'] = (getBidIdParameter('IDFA', bid.params).length > getBidIdParameter('ADID', bid.params).length) ? getBidIdParameter('IDFA', bid.params) : getBidIdParameter('ADID', bid.params); }); let ebdrBidReq = { id: requestId, @@ -62,8 +62,8 @@ export const spec = { }; }, interpretResponse: function(serverResponse, bidRequest) { - utils.logInfo('Log serverResponse', serverResponse); - utils.logInfo('Log bidRequest', bidRequest); + logInfo('Log serverResponse', serverResponse); + logInfo('Log bidRequest', bidRequest); let ebdrResponseImps = []; const ebdrResponseObj = serverResponse.body; if (!ebdrResponseObj || !ebdrResponseObj.seatbid || ebdrResponseObj.seatbid.length === 0 || !ebdrResponseObj.seatbid[0].bid || ebdrResponseObj.seatbid[0].bid.length === 0) { diff --git a/modules/emx_digitalBidAdapter.js b/modules/emx_digitalBidAdapter.js index 260ffe105f4..3ab9af8e523 100644 --- a/modules/emx_digitalBidAdapter.js +++ b/modules/emx_digitalBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isArray, logWarn, logError, parseUrl, deepAccess, isStr, _each, getBidIdParameter, isFn, isPlainObject } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { Renderer } from '../src/Renderer.js'; @@ -18,11 +18,11 @@ const EIDS_SUPPORTED = [ export const emxAdapter = { validateSizes: (sizes) => { - if (!utils.isArray(sizes) || typeof sizes[0] === 'undefined') { - utils.logWarn(BIDDER_CODE + ': Sizes should be an array'); + if (!isArray(sizes) || typeof sizes[0] === 'undefined') { + logWarn(BIDDER_CODE + ': Sizes should be an array'); return false; } - return sizes.every(size => utils.isArray(size) && size.length === 2); + return sizes.every(size => isArray(size) && size.length === 2); }, checkVideoContext: (bid) => { return ((bid && bid.mediaTypes && bid.mediaTypes.video && bid.mediaTypes.video.context) && ((bid.mediaTypes.video.context === 'instream') || (bid.mediaTypes.video.context === 'outstream'))); @@ -31,7 +31,7 @@ export const emxAdapter = { let sizes = []; bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes ? sizes = bid.mediaTypes.banner.sizes : sizes = bid.sizes; if (!emxAdapter.validateSizes(sizes)) { - utils.logWarn(BIDDER_CODE + ': could not detect mediaType banner sizes. Assigning to bid sizes instead'); + logWarn(BIDDER_CODE + ': could not detect mediaType banner sizes. Assigning to bid sizes instead'); sizes = bid.sizes } return { @@ -78,7 +78,7 @@ export const emxAdapter = { cleanProtocols: (video) => { if (video.protocols && includes(video.protocols, 7)) { // not supporting VAST protocol 7 (VAST 4.0); - utils.logWarn(BIDDER_CODE + ': VAST 4.0 is currently not supported. This protocol has been filtered out of the request.'); + logWarn(BIDDER_CODE + ': VAST 4.0 is currently not supported. This protocol has been filtered out of the request.'); video.protocols = video.protocols.filter(protocol => protocol !== 7); } return video; @@ -106,7 +106,7 @@ export const emxAdapter = { try { renderer.setRender(emxAdapter.outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } return renderer; @@ -114,7 +114,7 @@ export const emxAdapter = { buildVideo: (bid) => { let videoObj = Object.assign(bid.mediaTypes.video, bid.params.video); - if (utils.isArray(bid.mediaTypes.video.playerSize[0])) { + if (isArray(bid.mediaTypes.video.playerSize[0])) { videoObj['w'] = bid.mediaTypes.video.playerSize[0][0]; videoObj['h'] = bid.mediaTypes.video.playerSize[0][1]; } else { @@ -127,7 +127,7 @@ export const emxAdapter = { try { return decodeURIComponent(bidResponseAdm.replace(/%(?![0-9][0-9a-fA-F]+)/g, '%25')); } catch (err) { - utils.logError('emx_digitalBidAdapter', 'error', err); + logError('emx_digitalBidAdapter', 'error', err); } }, getReferrer: () => { @@ -138,7 +138,7 @@ export const emxAdapter = { } }, getSite: (refInfo) => { - let url = utils.parseUrl(refInfo.referer); + let url = parseUrl(refInfo.referer); return { domain: url.hostname, page: refInfo.referer, @@ -182,7 +182,7 @@ export const emxAdapter = { }, getUserId(bidRequests) { return ({ key, source, rtiPartner }) => { - let id = utils.deepAccess(bidRequests, `userId.${key}`); + let id = deepAccess(bidRequests, `userId.${key}`); return id ? emxAdapter.formatEid(id, source, rtiPartner) : null; }; }, @@ -203,17 +203,17 @@ export const spec = { supportedMediaTypes: [BANNER, VIDEO], isBidRequestValid: function (bid) { if (!bid || !bid.params) { - utils.logWarn(BIDDER_CODE + ': Missing bid or bid params.'); + logWarn(BIDDER_CODE + ': Missing bid or bid params.'); return false; } if (bid.bidder !== BIDDER_CODE) { - utils.logWarn(BIDDER_CODE + ': Must use "emx_digital" as bidder code.'); + logWarn(BIDDER_CODE + ': Must use "emx_digital" as bidder code.'); return false; } - if (!bid.params.tagid || !utils.isStr(bid.params.tagid)) { - utils.logWarn(BIDDER_CODE + ': Missing tagid param or tagid present and not type String.'); + if (!bid.params.tagid || !isStr(bid.params.tagid)) { + logWarn(BIDDER_CODE + ': Missing tagid param or tagid present and not type String.'); return false; } @@ -221,17 +221,17 @@ export const spec = { let sizes; bid.mediaTypes.banner.sizes ? sizes = bid.mediaTypes.banner.sizes : sizes = bid.sizes; if (!emxAdapter.validateSizes(sizes)) { - utils.logWarn(BIDDER_CODE + ': Missing sizes in bid'); + logWarn(BIDDER_CODE + ': Missing sizes in bid'); return false; } } else if (bid.mediaTypes && bid.mediaTypes.video) { if (!emxAdapter.checkVideoContext(bid)) { - utils.logWarn(BIDDER_CODE + ': Missing video context: instream or outstream'); + logWarn(BIDDER_CODE + ': Missing video context: instream or outstream'); return false; } if (!bid.mediaTypes.video.playerSize) { - utils.logWarn(BIDDER_CODE + ': Missing video playerSize'); + logWarn(BIDDER_CODE + ': Missing video playerSize'); return false; } } @@ -247,8 +247,8 @@ export const spec = { const device = emxAdapter.getDevice(); const site = emxAdapter.getSite(bidderRequest.refererInfo); - utils._each(validBidRequests, function (bid) { - let tagid = utils.getBidIdParameter('tagid', bid.params); + _each(validBidRequests, function (bid) { + let tagid = getBidIdParameter('tagid', bid.params); let bidfloor = parseFloat(getBidFloor(bid)) || 0; let isVideo = !!bid.mediaTypes.video; let data = { @@ -364,8 +364,8 @@ export const spec = { // support floors module in prebid 5.0 function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return parseFloat(utils.getBidIdParameter('bidfloor', bid.params)); + if (!isFn(bid.getFloor)) { + return parseFloat(getBidIdParameter('bidfloor', bid.params)); } let floor = bid.getFloor({ @@ -373,7 +373,7 @@ function getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { return floor.floor; } return null; diff --git a/modules/enrichmentFpdModule.js b/modules/enrichmentFpdModule.js index e1942fbadc3..9268c81c033 100644 --- a/modules/enrichmentFpdModule.js +++ b/modules/enrichmentFpdModule.js @@ -1,8 +1,9 @@ + /** * This module sets default values and validates ortb2 first part data * @module modules/firstPartyData */ -import * as utils from '../src/utils.js'; +import { timestamp, mergeDeep } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getRefererInfo } from '../src/refererDetection.js'; import { getCoreStorageManager } from '../src/storageManager.js'; @@ -32,7 +33,7 @@ export function findRootDomain(fullDomain = window.location.hostname) { const TEST_COOKIE_VALUE = 'writeable'; do { rootDomain = domainParts.slice(startIndex).join('.'); - let expirationDate = new Date(utils.timestamp() + 10 * 1000).toUTCString(); + let expirationDate = new Date(timestamp() + 10 * 1000).toUTCString(); // Write a test cookie coreStorage.setCookie( @@ -69,14 +70,14 @@ export function findRootDomain(fullDomain = window.location.hostname) { * Checks for referer and if exists merges into ortb2 global data */ function setReferer() { - if (getRefererInfo().referer) utils.mergeDeep(ortb2, { site: { ref: getRefererInfo().referer } }); + if (getRefererInfo().referer) mergeDeep(ortb2, { site: { ref: getRefererInfo().referer } }); } /** * Checks for canonical url and if exists merges into ortb2 global data */ function setPage() { - if (getRefererInfo().canonicalUrl) utils.mergeDeep(ortb2, { site: { page: getRefererInfo().canonicalUrl } }); + if (getRefererInfo().canonicalUrl) mergeDeep(ortb2, { site: { page: getRefererInfo().canonicalUrl } }); } /** @@ -94,8 +95,8 @@ function setDomain() { let domain = parseDomain(getRefererInfo().canonicalUrl) if (domain) { - utils.mergeDeep(ortb2, { site: { domain: domain } }); - utils.mergeDeep(ortb2, { site: { publisher: { domain: findRootDomain(domain) } } }); + mergeDeep(ortb2, { site: { domain: domain } }); + mergeDeep(ortb2, { site: { publisher: { domain: findRootDomain(domain) } } }); }; } @@ -114,7 +115,7 @@ function setDimensions() { height = window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight; } - utils.mergeDeep(ortb2, { device: { w: width, h: height } }); + mergeDeep(ortb2, { device: { w: width, h: height } }); } /** @@ -129,7 +130,7 @@ function setKeywords() { keywords = window.document.querySelector("meta[name='keywords']"); } - if (keywords && keywords.content) utils.mergeDeep(ortb2, { site: { keywords: keywords.content.replace(/\s/g, '') } }); + if (keywords && keywords.content) mergeDeep(ortb2, { site: { keywords: keywords.content.replace(/\s/g, '') } }); } /** @@ -153,7 +154,7 @@ function runEnrichments() { export function initSubmodule(fpdConf, data) { resetOrtb2(); - return (!fpdConf.skipEnrichments) ? utils.mergeDeep(runEnrichments(), data) : data; + return (!fpdConf.skipEnrichments) ? mergeDeep(runEnrichments(), data) : data; } /** @type {firstPartyDataSubmodule} */ diff --git a/modules/eplanningAnalyticsAdapter.js b/modules/eplanningAnalyticsAdapter.js index 08db2f2ca9d..fb77014400c 100644 --- a/modules/eplanningAnalyticsAdapter.js +++ b/modules/eplanningAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { logError } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; const CONSTANTS = require('../src/constants.json'); @@ -110,7 +110,7 @@ eplAnalyticsAdapter.originEnableAnalytics = eplAnalyticsAdapter.enableAnalytics; eplAnalyticsAdapter.enableAnalytics = function (config) { if (!config.options.ci) { - utils.logError('Client ID (ci) option is not defined. Analytics won\'t work'); + logError('Client ID (ci) option is not defined. Analytics won\'t work'); return; } diff --git a/modules/eplanningBidAdapter.js b/modules/eplanningBidAdapter.js index dd96353dea3..5aef90d413d 100644 --- a/modules/eplanningBidAdapter.js +++ b/modules/eplanningBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isEmpty, getWindowSelf, parseSizesInput } from '../src/utils.js'; import { getGlobal } from '../src/prebidGlobal.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -102,9 +102,9 @@ export const spec = { const response = serverResponse.body; let bidResponses = []; - if (response && !utils.isEmpty(response.sp)) { + if (response && !isEmpty(response.sp)) { response.sp.forEach(space => { - if (!utils.isEmpty(space.a)) { + if (!isEmpty(space.a)) { space.a.forEach(ad => { const bidResponse = { requestId: request.adUnitToBidId[space.k], @@ -132,9 +132,9 @@ export const spec = { }, getUserSyncs: function(syncOptions, serverResponses) { const syncs = []; - const response = !utils.isEmpty(serverResponses) && serverResponses[0].body; + const response = !isEmpty(serverResponses) && serverResponses[0].body; - if (response && !utils.isEmpty(response.cs)) { + if (response && !isEmpty(response.cs)) { const responseSyncs = response.cs; responseSyncs.forEach(sync => { if (typeof sync === 'string' && syncOptions.pixelEnabled) { @@ -159,7 +159,7 @@ function getUserAgent() { return window.navigator.userAgent; } function getInnerWidth() { - return utils.getWindowSelf().innerWidth; + return getWindowSelf().innerWidth; } function isMobileUserAgent() { return getUserAgent().match(/(mobile)|(ip(hone|ad))|(android)|(blackberry)|(nokia)|(phone)|(opera\smini)/i); @@ -216,7 +216,7 @@ function compareSizesByPriority(size1, size2) { } function getSizesSortedByPriority(sizes) { - return utils.parseSizesInput(sizes).sort(compareSizesByPriority); + return parseSizesInput(sizes).sort(compareSizesByPriority); } function getSize(bid, first) { diff --git a/modules/etargetBidAdapter.js b/modules/etargetBidAdapter.js index 51f2759d256..f7d552b1b09 100644 --- a/modules/etargetBidAdapter.js +++ b/modules/etargetBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepSetValue, isFn, isPlainObject } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -145,7 +145,7 @@ export const spec = { bidObject.gdpr_consent = bidRequest.gdpr.gdpr_consent; } if (bid.adomain) { - utils.deepSetValue(bidObject, 'meta.advertiserDomains', Array.isArray(bid.adomain) ? bid.adomain : [bid.adomain]); + deepSetValue(bidObject, 'meta.advertiserDomains', Array.isArray(bid.adomain) ? bid.adomain : [bid.adomain]); } bidRespones.push(bidObject); } @@ -165,7 +165,7 @@ export const spec = { } }; function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return null; } let floor = bid.getFloor({ @@ -173,7 +173,7 @@ function getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor)) { + if (isPlainObject(floor) && !isNaN(floor.floor)) { return floor.floor; } return null; diff --git a/modules/express.js b/modules/express.js index f4a76daefdf..0b1780e3c26 100644 --- a/modules/express.js +++ b/modules/express.js @@ -1,5 +1,4 @@ - -import * as utils from '../src/utils.js'; +import { logMessage, logWarn, logError, logInfo } from '../src/utils.js'; const MODULE_NAME = 'express'; @@ -14,10 +13,10 @@ const MODULE_NAME = 'express'; * @param {Object[]} [adUnits = pbjs.adUnits] - an array of adUnits for express to operate on. */ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { - utils.logMessage('loading ' + MODULE_NAME); + logMessage('loading ' + MODULE_NAME); if (adUnits.length === 0) { - utils.logWarn('no valid adUnits found, not loading ' + MODULE_NAME); + logWarn('no valid adUnits found, not loading ' + MODULE_NAME); } // store gpt slots in a more performant hash lookup by elementId (adUnit code) @@ -27,7 +26,7 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { if (adUnit.code && adUnit.bids) { cache[adUnit.code] = adUnit; } else { - utils.logError('misconfigured adUnit', null, adUnit); + logError('misconfigured adUnit', null, adUnit); } return cache; }, {}); @@ -39,10 +38,10 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { var gpt = window.googletag; var pads = gpt.pubads; if (!gpt.display || !gpt.enableServices || typeof pads !== 'function' || !pads().refresh || !pads().disableInitialLoad || !pads().getSlots || !pads().enableSingleRequest) { - utils.logError('could not bind to gpt googletag api'); + logError('could not bind to gpt googletag api'); return; } - utils.logMessage('running'); + logMessage('running'); // function to convert google tag slot sizes to [[w,h],...] function mapGptSlotSizes(aGPTSlotSizes) { @@ -51,7 +50,7 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { try { aSlotSizes.push([aGPTSlotSizes[i].getWidth(), aGPTSlotSizes[i].getHeight()]); } catch (e) { - utils.logWarn('slot size ' + aGPTSlotSizes[i].toString() + ' not supported by' + MODULE_NAME); + logWarn('slot size ' + aGPTSlotSizes[i].toString() + ' not supported by' + MODULE_NAME); } } return aSlotSizes; @@ -110,7 +109,7 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { // - else run an auction and call the real fGptRefresh() to // initiate the DFP request gpt.display = function (sElementId) { - utils.logInfo('display:', sElementId); + logInfo('display:', sElementId); // call original gpt display() function fGptDisplay.apply(gpt, arguments); @@ -157,7 +156,7 @@ $$PREBID_GLOBAL$$.express = function(adUnits = $$PREBID_GLOBAL$$.adUnits) { // override gpt refresh() function // - run auctions for provided gpt slots, then initiate ad-server call pads().refresh = function (aGptSlots, options) { - utils.logInfo('refresh:', aGptSlots); + logInfo('refresh:', aGptSlots); // get already displayed adUnits from aGptSlots if provided, else all defined gptSlots aGptSlots = defaultSlots(aGptSlots); var adUnits = pickAdUnits(/* mutated: */ aGptSlots).filter(function (adUnit) { diff --git a/modules/fabrickIdSystem.js b/modules/fabrickIdSystem.js index bb838788f07..08eb2d4f043 100644 --- a/modules/fabrickIdSystem.js +++ b/modules/fabrickIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logError } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getRefererInfo } from '../src/refererDetection.js'; @@ -47,7 +47,7 @@ export const fabrickIdSubmodule = { window.fabrickMod1(configParams, consentData, cacheIdObj); } if (!configParams || !configParams.apiKey || typeof configParams.apiKey !== 'string') { - utils.logError('fabrick submodule requires an apiKey.'); + logError('fabrick submodule requires an apiKey.'); return; } try { @@ -96,7 +96,7 @@ export const fabrickIdSubmodule = { try { responseObj = JSON.parse(response); } catch (error) { - utils.logError(error); + logError(error); responseObj = {}; } } @@ -104,7 +104,7 @@ export const fabrickIdSubmodule = { } }, error: error => { - utils.logError(`fabrickId fetch encountered an error`, error); + logError(`fabrickId fetch encountered an error`, error); callback(); } }; @@ -112,10 +112,10 @@ export const fabrickIdSubmodule = { }; return {callback: resp}; } catch (e) { - utils.logError(`fabrickIdSystem encountered an error`, e); + logError(`fabrickIdSystem encountered an error`, e); } } catch (e) { - utils.logError(`fabrickIdSystem encountered an error`, e); + logError(`fabrickIdSystem encountered an error`, e); } } }; From 467ad51691654fbfd5b3cee5ac8cf1a841e48940 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 11:54:46 -0700 Subject: [PATCH 104/250] Pbjs Core: avoid import all from utils in src/ files (#7466) * adloader: not importing * from utils * ajax: not importing * from utils * AnalyticsAdapter: not importing * from utils * adapterManager: not importing * from utils * auction: not importing * from utils * bidfactory: not importing * from utils * config: not importing * from utils * cpmBucketManager: not importing * from utils * prebid: not importing * from utils * Renderer: not importing * from utils * storageManager: not importing * from utils * targeting: not importing * from utils * userSync: not importing * from utils * videoCache: not importing * from utils --- src/AnalyticsAdapter.js | 12 +-- src/Renderer.js | 18 +++-- src/adapterManager.js | 87 +++++++++++---------- src/adloader.js | 12 +-- src/ajax.js | 17 ++-- src/auction.js | 49 ++++++------ src/bidfactory.js | 4 +- src/config.js | 102 ++++++++++++------------ src/cpmBucketManager.js | 4 +- src/prebid.js | 166 ++++++++++++++++++++-------------------- src/storageManager.js | 10 +-- src/targeting.js | 30 ++++---- src/userSync.js | 43 ++++++----- src/videoCache.js | 4 +- 14 files changed, 288 insertions(+), 270 deletions(-) diff --git a/src/AnalyticsAdapter.js b/src/AnalyticsAdapter.js index 97513b80cc7..2c27307ead3 100644 --- a/src/AnalyticsAdapter.js +++ b/src/AnalyticsAdapter.js @@ -1,8 +1,8 @@ import CONSTANTS from './constants.json'; import { ajax } from './ajax.js'; +import { logMessage, _each } from './utils.js'; const events = require('./events.js'); -const utils = require('./utils.js'); const { EVENTS: { @@ -123,22 +123,22 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler } } }; - utils._each(_handlers, (handler, event) => { + _each(_handlers, (handler, event) => { events.on(event, handler); }); } else { - utils.logMessage(`Analytics adapter for "${global}" disabled by sampling`); + logMessage(`Analytics adapter for "${global}" disabled by sampling`); } // finally set this function to return log message, prevents multiple adapter listeners this._oldEnable = this.enableAnalytics; this.enableAnalytics = function _enable() { - return utils.logMessage(`Analytics adapter for "${global}" already enabled, unnecessary call to \`enableAnalytics\`.`); + return logMessage(`Analytics adapter for "${global}" already enabled, unnecessary call to \`enableAnalytics\`.`); }; } function _disable() { - utils._each(_handlers, (handler, event) => { + _each(_handlers, (handler, event) => { events.off(event, handler); }); this.enableAnalytics = this._oldEnable ? this._oldEnable : _enable; @@ -158,6 +158,6 @@ export default function AnalyticsAdapter({ url, analyticsType, global, handler } _enableCheck = false; } - utils.logMessage(`event count sent to ${global}: ${_eventCount}`); + logMessage(`event count sent to ${global}: ${_eventCount}`); } } diff --git a/src/Renderer.js b/src/Renderer.js index c997658b30b..1d7506418bb 100644 --- a/src/Renderer.js +++ b/src/Renderer.js @@ -1,5 +1,7 @@ import { loadExternalScript } from './adloader.js'; -import * as utils from './utils.js'; +import { + logError, logWarn, logMessage, deepAccess +} from './utils.js'; import find from 'core-js-pure/features/array/find.js'; const moduleCode = 'outstream'; @@ -25,7 +27,7 @@ export function Renderer(options) { this.cmd = []; this.push = func => { if (typeof func !== 'function') { - utils.logError('Commands given to Renderer.push must be wrapped in a function'); + logError('Commands given to Renderer.push must be wrapped in a function'); return; } this.loaded ? func.call() : this.cmd.push(func); @@ -44,7 +46,7 @@ export function Renderer(options) { if (this._render) { this._render.apply(this, renderArgs) } else { - utils.logWarn(`No render function was provided, please use .setRender on the renderer`); + logWarn(`No render function was provided, please use .setRender on the renderer`); } } @@ -53,7 +55,7 @@ export function Renderer(options) { this.cmd.unshift(runRender) // should render run first ? loadExternalScript(url, moduleCode, this.callback); } else { - utils.logWarn(`External Js not loaded by Renderer since renderer url and callback is already defined on adUnit ${adUnitCode}`); + logWarn(`External Js not loaded by Renderer since renderer url and callback is already defined on adUnit ${adUnitCode}`); runRender() } }.bind(this) // bind the function to this object to avoid 'this' errors @@ -80,7 +82,7 @@ Renderer.prototype.handleVideoEvent = function({ id, eventName }) { this.handlers[eventName](); } - utils.logMessage(`Prebid Renderer event for id ${id} type ${eventName}`); + logMessage(`Prebid Renderer event for id ${id} type ${eventName}`); }; /* @@ -92,7 +94,7 @@ Renderer.prototype.process = function() { try { this.cmd.shift().call(); } catch (error) { - utils.logError('Error processing Renderer command: ', error); + logError('Error processing Renderer command: ', error); } } }; @@ -126,11 +128,11 @@ function isRendererPreferredFromAdUnit(adUnitCode) { } // renderer defined at adUnit level - const adUnitRenderer = utils.deepAccess(adUnit, 'renderer'); + const adUnitRenderer = deepAccess(adUnit, 'renderer'); const hasValidAdUnitRenderer = !!(adUnitRenderer && adUnitRenderer.url && adUnitRenderer.render); // renderer defined at adUnit.mediaTypes level - const mediaTypeRenderer = utils.deepAccess(adUnit, 'mediaTypes.video.renderer'); + const mediaTypeRenderer = deepAccess(adUnit, 'mediaTypes.video.renderer'); const hasValidMediaTypeRenderer = !!(mediaTypeRenderer && mediaTypeRenderer.url && mediaTypeRenderer.render) return !!( diff --git a/src/adapterManager.js b/src/adapterManager.js index 5f8f2e5721c..9a3d05a4321 100644 --- a/src/adapterManager.js +++ b/src/adapterManager.js @@ -1,6 +1,10 @@ /** @module adaptermanger */ -import { flatten, getBidderCodes, getDefinedParams, shuffle, timestamp, getBidderRequest, bind } from './utils.js'; +import { + _each, getUserConfiguredParams, groupBy, logInfo, deepAccess, isValidMediaTypes, + getUniqueIdentifierStr, deepClone, logWarn, logError, logMessage, isArray, generateUUID, + flatten, getBidderCodes, getDefinedParams, shuffle, timestamp, getBidderRequest, bind +} from './utils.js'; import { getLabels, resolveStatus } from './sizeMapping.js'; import { processNativeAdUnitParams, nativeAdapters } from './native.js'; import { newBidder } from './adapters/bidderFactory.js'; @@ -12,7 +16,6 @@ import find from 'core-js-pure/features/array/find.js'; import { adunitCounter } from './adUnits.js'; import { getRefererInfo } from './refererDetection.js'; -var utils = require('./utils.js'); var CONSTANTS = require('./constants.json'); var events = require('./events.js'); let s2sTestingModule; // store s2sTesting module if it's loaded @@ -25,7 +28,7 @@ let _aliasRegistry = adapterManager.aliasRegistry = {}; let _s2sConfigs = []; config.getConfig('s2sConfig', config => { if (config && config.s2sConfig) { - _s2sConfigs = Array.isArray(config.s2sConfig) ? config.s2sConfig : [config.s2sConfig]; + _s2sConfigs = isArray(config.s2sConfig) ? config.s2sConfig : [config.s2sConfig]; } }); @@ -51,16 +54,16 @@ function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels, src}) ); if (!active) { - utils.logInfo(`Size mapping disabled adUnit "${adUnit.code}"`); + logInfo(`Size mapping disabled adUnit "${adUnit.code}"`); } else if (filterResults) { - utils.logInfo(`Size mapping filtered adUnit "${adUnit.code}" banner sizes from `, filterResults.before, 'to ', filterResults.after); + logInfo(`Size mapping filtered adUnit "${adUnit.code}" banner sizes from `, filterResults.before, 'to ', filterResults.after); } if (active) { result.push(adUnit.bids.filter(bid => bid.bidder === bidderCode) .reduce((bids, bid) => { const nativeParams = - adUnit.nativeParams || utils.deepAccess(adUnit, 'mediaTypes.native'); + adUnit.nativeParams || deepAccess(adUnit, 'mediaTypes.native'); if (nativeParams) { bid = Object.assign({}, bid, { nativeParams: processNativeAdUnitParams(nativeParams), @@ -81,17 +84,17 @@ function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels, src}) } = resolveStatus(getLabels(bid, labels), filteredMediaTypes); if (!active) { - utils.logInfo(`Size mapping deactivated adUnit "${adUnit.code}" bidder "${bid.bidder}"`); + logInfo(`Size mapping deactivated adUnit "${adUnit.code}" bidder "${bid.bidder}"`); } else if (filterResults) { - utils.logInfo(`Size mapping filtered adUnit "${adUnit.code}" bidder "${bid.bidder}" banner sizes from `, filterResults.before, 'to ', filterResults.after); + logInfo(`Size mapping filtered adUnit "${adUnit.code}" bidder "${bid.bidder}" banner sizes from `, filterResults.before, 'to ', filterResults.after); } - if (utils.isValidMediaTypes(mediaTypes)) { + if (isValidMediaTypes(mediaTypes)) { bid = Object.assign({}, bid, { mediaTypes }); } else { - utils.logError( + logError( `mediaTypes is not correctly configured for adunit ${adUnit.code}` ); } @@ -100,8 +103,8 @@ function getBids({bidderCode, auctionId, bidderRequestId, adUnits, labels, src}) bids.push(Object.assign({}, bid, { adUnitCode: adUnit.code, transactionId: adUnit.transactionId, - sizes: utils.deepAccess(mediaTypes, 'banner.sizes') || utils.deepAccess(mediaTypes, 'video.playerSize') || [], - bidId: bid.bid_id || utils.getUniqueIdentifierStr(), + sizes: deepAccess(mediaTypes, 'banner.sizes') || deepAccess(mediaTypes, 'video.playerSize') || [], + bidId: bid.bid_id || getUniqueIdentifierStr(), bidderRequestId, auctionId, src, @@ -122,7 +125,7 @@ const hookedGetBids = hook('sync', getBids, 'getBids'); function getAdUnitCopyForPrebidServer(adUnits, s2sConfig) { let adaptersServerSide = s2sConfig.bidders; - let adUnitsCopy = utils.deepClone(adUnits); + let adUnitsCopy = deepClone(adUnits); adUnitsCopy.forEach((adUnit) => { // filter out client side bids @@ -130,7 +133,7 @@ function getAdUnitCopyForPrebidServer(adUnits, s2sConfig) { return includes(adaptersServerSide, bid.bidder) && (!doingS2STesting(s2sConfig) || bid.finalSource !== s2sTestingModule.CLIENT); }).map((bid) => { - bid.bid_id = utils.getUniqueIdentifierStr(); + bid.bid_id = getUniqueIdentifierStr(); return bid; }); }); @@ -143,7 +146,7 @@ function getAdUnitCopyForPrebidServer(adUnits, s2sConfig) { } function getAdUnitCopyForClientAdapters(adUnits) { - let adUnitsClientCopy = utils.deepClone(adUnits); + let adUnitsClientCopy = deepClone(adUnits); // filter out s2s bids adUnitsClientCopy.forEach((adUnit) => { adUnit.bids = adUnit.bids.filter((bid) => { @@ -254,20 +257,20 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a _s2sConfigs.forEach(s2sConfig => { if (s2sConfig && s2sConfig.enabled) { if ((isTestingServerOnly(s2sConfig) && adUnitsContainServerRequests(adUnits, s2sConfig))) { - utils.logWarn('testServerOnly: True. All client requests will be suppressed.'); + logWarn('testServerOnly: True. All client requests will be suppressed.'); clientBidderCodes.length = 0; } let adUnitsS2SCopy = getAdUnitCopyForPrebidServer(adUnits, s2sConfig); - let tid = utils.generateUUID(); + let tid = generateUUID(); adaptersServerSide.forEach(bidderCode => { - const bidderRequestId = utils.getUniqueIdentifierStr(); + const bidderRequestId = getUniqueIdentifierStr(); const bidderRequest = { bidderCode, auctionId, bidderRequestId, tid, - bids: hookedGetBids({bidderCode, auctionId, bidderRequestId, 'adUnits': utils.deepClone(adUnitsS2SCopy), labels, src: CONSTANTS.S2S.SRC}), + bids: hookedGetBids({bidderCode, auctionId, bidderRequestId, 'adUnits': deepClone(adUnitsS2SCopy), labels, src: CONSTANTS.S2S.SRC}), auctionStart: auctionStart, timeout: s2sConfig.timeout, src: CONSTANTS.S2S.SRC, @@ -298,19 +301,19 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a // client adapters let adUnitsClientCopy = getAdUnitCopyForClientAdapters(adUnits); clientBidderCodes.forEach(bidderCode => { - const bidderRequestId = utils.getUniqueIdentifierStr(); + const bidderRequestId = getUniqueIdentifierStr(); const bidderRequest = { bidderCode, auctionId, bidderRequestId, - bids: hookedGetBids({bidderCode, auctionId, bidderRequestId, 'adUnits': utils.deepClone(adUnitsClientCopy), labels, src: 'client'}), + bids: hookedGetBids({bidderCode, auctionId, bidderRequestId, 'adUnits': deepClone(adUnitsClientCopy), labels, src: 'client'}), auctionStart: auctionStart, timeout: cbTimeout, refererInfo }; const adapter = _bidderRegistry[bidderCode]; if (!adapter) { - utils.logError(`Trying to make a request for bidder that does not exist: ${bidderCode}`); + logError(`Trying to make a request for bidder that does not exist: ${bidderCode}`); } if (adapter && bidderRequest.bids && bidderRequest.bids.length !== 0) { @@ -334,7 +337,7 @@ adapterManager.makeBidRequests = hook('sync', function (adUnits, auctionStart, a adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbacks, requestBidsTimeout, onTimelyResponse) => { if (!bidRequests.length) { - utils.logWarn('callBids executed with no bidRequests. Were they filtered by labels or sizing?'); + logWarn('callBids executed with no bidRequests. Were they filtered by labels or sizing?'); return; } @@ -384,7 +387,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request let allBidders = s2sBidRequest.ad_units.reduce((adapters, adUnit) => { return adapters.concat((adUnit.bids || []).reduce((adapters, bid) => adapters.concat(bid.bidder), [])); }, []); - utils.logMessage(`CALLING S2S HEADER BIDDERS ==== ${adaptersServerSide.filter(adapter => includes(allBidders, adapter)).join(',')}`); + logMessage(`CALLING S2S HEADER BIDDERS ==== ${adaptersServerSide.filter(adapter => includes(allBidders, adapter)).join(',')}`); // fire BID_REQUESTED event for each s2s bidRequest uniqueServerRequests.forEach(bidRequest => { @@ -406,7 +409,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request ); } } else { - utils.logError('missing ' + s2sConfig.adapter); + logError('missing ' + s2sConfig.adapter); } counter++ } @@ -418,7 +421,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request // TODO : Do we check for bid in pool from here and skip calling adapter again ? const adapter = _bidderRegistry[bidRequest.bidderCode]; config.runWithBidder(bidRequest.bidderCode, () => { - utils.logMessage(`CALLING BIDDER`); + logMessage(`CALLING BIDDER`); events.emit(CONSTANTS.EVENTS.BID_REQUESTED, bidRequest); }); let ajax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? { @@ -441,7 +444,7 @@ adapterManager.callBids = (adUnits, bidRequests, addBidResponse, doneCb, request ) ); } catch (e) { - utils.logError(`${bidRequest.bidderCode} Bid Adapter emitted an uncaught error when parsing their bidRequest`, {e, bidRequest}); + logError(`${bidRequest.bidderCode} Bid Adapter emitted an uncaught error when parsing their bidRequest`, {e, bidRequest}); adapterDone(); } }); @@ -476,10 +479,10 @@ adapterManager.registerBidAdapter = function (bidAdapter, bidderCode, {supported nativeAdapters.push(bidderCode); } } else { - utils.logError('Bidder adaptor error for bidder code: ' + bidderCode + 'bidder must implement a callBids() function'); + logError('Bidder adaptor error for bidder code: ' + bidderCode + 'bidder must implement a callBids() function'); } } else { - utils.logError('bidAdapter or bidderCode not specified'); + logError('bidAdapter or bidderCode not specified'); } }; @@ -502,7 +505,7 @@ adapterManager.aliasBidAdapter = function (bidderCode, alias, options) { } }); nonS2SAlias.forEach(bidderCode => { - utils.logError('bidderCode "' + bidderCode + '" is not an existing bidder.', 'adapterManager.aliasBidAdapter'); + logError('bidderCode "' + bidderCode + '" is not an existing bidder.', 'adapterManager.aliasBidAdapter'); }) } else { try { @@ -524,11 +527,11 @@ adapterManager.aliasBidAdapter = function (bidderCode, alias, options) { supportedMediaTypes }); } catch (e) { - utils.logError(bidderCode + ' bidder does not currently support aliasing.', 'adapterManager.aliasBidAdapter'); + logError(bidderCode + ' bidder does not currently support aliasing.', 'adapterManager.aliasBidAdapter'); } } } else { - utils.logMessage('alias name "' + alias + '" has been already specified.'); + logMessage('alias name "' + alias + '" has been already specified.'); } }; @@ -538,25 +541,25 @@ adapterManager.registerAnalyticsAdapter = function ({adapter, code, gvlid}) { adapter.code = code; _analyticsRegistry[code] = { adapter, gvlid }; } else { - utils.logError(`Prebid Error: Analytics adaptor error for analytics "${code}" + logError(`Prebid Error: Analytics adaptor error for analytics "${code}" analytics adapter must implement an enableAnalytics() function`); } } else { - utils.logError('Prebid Error: analyticsAdapter or analyticsCode not specified'); + logError('Prebid Error: analyticsAdapter or analyticsCode not specified'); } }; adapterManager.enableAnalytics = function (config) { - if (!utils.isArray(config)) { + if (!isArray(config)) { config = [config]; } - utils._each(config, adapterConfig => { + _each(config, adapterConfig => { var adapter = _analyticsRegistry[adapterConfig.provider].adapter; if (adapter) { adapter.enableAnalytics(adapterConfig); } else { - utils.logError(`Prebid Error: no analytics adapter found in registry for + logError(`Prebid Error: no analytics adapter found in registry for ${adapterConfig.provider}.`); } }); @@ -581,22 +584,22 @@ function tryCallBidderMethod(bidder, method, param) { const adapter = _bidderRegistry[bidder]; const spec = adapter.getSpec(); if (spec && spec[method] && typeof spec[method] === 'function') { - utils.logInfo(`Invoking ${bidder}.${method}`); + logInfo(`Invoking ${bidder}.${method}`); config.runWithBidder(bidder, bind.call(spec[method], spec, param)); } } catch (e) { - utils.logWarn(`Error calling ${method} of ${bidder}`); + logWarn(`Error calling ${method} of ${bidder}`); } } adapterManager.callTimedOutBidders = function(adUnits, timedOutBidders, cbTimeout) { timedOutBidders = timedOutBidders.map((timedOutBidder) => { // Adding user configured params & timeout to timeout event data - timedOutBidder.params = utils.getUserConfiguredParams(adUnits, timedOutBidder.adUnitCode, timedOutBidder.bidder); + timedOutBidder.params = getUserConfiguredParams(adUnits, timedOutBidder.adUnitCode, timedOutBidder.bidder); timedOutBidder.timeout = cbTimeout; return timedOutBidder; }); - timedOutBidders = utils.groupBy(timedOutBidders, 'bidder'); + timedOutBidders = groupBy(timedOutBidders, 'bidder'); Object.keys(timedOutBidders).forEach((bidder) => { tryCallBidderMethod(bidder, 'onTimeout', timedOutBidders[bidder]); @@ -605,7 +608,7 @@ adapterManager.callTimedOutBidders = function(adUnits, timedOutBidders, cbTimeou adapterManager.callBidWonBidder = function(bidder, bid, adUnits) { // Adding user configured params to bidWon event data - bid.params = utils.getUserConfiguredParams(adUnits, bid.adUnitCode, bid.bidder); + bid.params = getUserConfiguredParams(adUnits, bid.adUnitCode, bid.bidder); adunitCounter.incrementBidderWinsCounter(bid.adUnitCode, bid.bidder); tryCallBidderMethod(bidder, 'onBidWon', bid); }; diff --git a/src/adloader.js b/src/adloader.js index 5460cc79410..9039fa14c4c 100644 --- a/src/adloader.js +++ b/src/adloader.js @@ -1,5 +1,5 @@ import includes from 'core-js-pure/features/array/includes.js'; -import * as utils from './utils.js'; +import { logError, logWarn, insertElement } from './utils.js'; const _requestCache = {}; // The below list contains modules or vendors whom Prebid allows to load external JS. @@ -20,11 +20,11 @@ const _approvedLoadExternalJSList = [ */ export function loadExternalScript(url, moduleCode, callback) { if (!moduleCode || !url) { - utils.logError('cannot load external script without url and moduleCode'); + logError('cannot load external script without url and moduleCode'); return; } if (!includes(_approvedLoadExternalJSList, moduleCode)) { - utils.logError(`${moduleCode} not whitelisted for loading external JavaScript`); + logError(`${moduleCode} not whitelisted for loading external JavaScript`); return; } // only load each asset once @@ -49,7 +49,7 @@ export function loadExternalScript(url, moduleCode, callback) { _requestCache[url].callbacks.push(callback); } - utils.logWarn(`module ${moduleCode} is loading external JavaScript`); + logWarn(`module ${moduleCode} is loading external JavaScript`); return requestResource(url, function () { _requestCache[url].loaded = true; try { @@ -57,7 +57,7 @@ export function loadExternalScript(url, moduleCode, callback) { _requestCache[url].callbacks[i](); } } catch (e) { - utils.logError('Error executing callback', 'adloader.js:loadExternalScript', e); + logError('Error executing callback', 'adloader.js:loadExternalScript', e); } }); @@ -84,7 +84,7 @@ export function loadExternalScript(url, moduleCode, callback) { jptScript.src = tagSrc; // add the new script tag to the page - utils.insertElement(jptScript); + insertElement(jptScript); return jptScript; } diff --git a/src/ajax.js b/src/ajax.js index a6317e7963d..5e926f3210d 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -1,6 +1,5 @@ import { config } from './config.js'; - -var utils = require('./utils.js'); +import { logMessage, logError, parseUrl, buildUrl, _each } from './utils.js'; const XHR_DONE = 4; @@ -25,10 +24,10 @@ export function ajaxBuilder(timeout = 3000, {request, done} = {}) { let callbacks = typeof callback === 'object' && callback !== null ? callback : { success: function() { - utils.logMessage('xhr success'); + logMessage('xhr success'); }, error: function(e) { - utils.logError('xhr error', null, e); + logError('xhr error', null, e); } }; @@ -55,14 +54,14 @@ export function ajaxBuilder(timeout = 3000, {request, done} = {}) { // Disabled timeout temporarily to avoid xhr failed requests. https://github.com/prebid/Prebid.js/issues/2648 if (!config.getConfig('disableAjaxTimeout')) { x.ontimeout = function () { - utils.logError(' xhr timeout after ', x.timeout, 'ms'); + logError(' xhr timeout after ', x.timeout, 'ms'); }; } if (method === 'GET' && data) { - let urlInfo = utils.parseUrl(url, options); + let urlInfo = parseUrl(url, options); Object.assign(urlInfo.search, data); - url = utils.buildUrl(urlInfo); + url = buildUrl(urlInfo); } x.open(method, url, true); @@ -75,7 +74,7 @@ export function ajaxBuilder(timeout = 3000, {request, done} = {}) { if (options.withCredentials) { x.withCredentials = true; } - utils._each(options.customHeaders, (value, header) => { + _each(options.customHeaders, (value, header) => { x.setRequestHeader(header, value); }); if (options.preflight) { @@ -93,7 +92,7 @@ export function ajaxBuilder(timeout = 3000, {request, done} = {}) { x.send(); } } catch (error) { - utils.logError('xhr construction', error); + logError('xhr construction', error); typeof callback === 'object' && callback !== null && callback.error(error); } } diff --git a/src/auction.js b/src/auction.js index a6f0342e582..498f08d6c73 100644 --- a/src/auction.js +++ b/src/auction.js @@ -57,7 +57,10 @@ * @property {function(): void} callBids - sends requests to all adapters for bids */ -import {flatten, timestamp, adUnitsFilter, deepAccess, getBidRequest, getValue, parseUrl} from './utils.js'; +import { + flatten, timestamp, adUnitsFilter, deepAccess, getBidRequest, getValue, parseUrl, generateUUID, + logMessage, bind, logError, logInfo, logWarn, isEmpty, _each, isFn, isEmptyStr +} from './utils.js'; import { getPriceBucketString } from './cpmBucketManager.js'; import { getNativeTargeting } from './native.js'; import { getCacheUrl, store } from './videoCache.js'; @@ -71,7 +74,7 @@ import { OUTSTREAM } from './video.js'; import { VIDEO } from './mediaTypes.js'; const { syncUsers } = userSync; -const utils = require('./utils.js'); + const adapterManager = require('./adapterManager.js').default; const events = require('./events.js'); const CONSTANTS = require('./constants.json'); @@ -112,7 +115,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a let _noBids = []; let _auctionStart; let _auctionEnd; - let _auctionId = auctionId || utils.generateUUID(); + let _auctionId = auctionId || generateUUID(); let _auctionStatus; let _callback = callback; let _timer; @@ -157,7 +160,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a if (_auctionEnd === undefined) { let timedOutBidders = []; if (timedOut) { - utils.logMessage(`Auction ${_auctionId} timedOut`); + logMessage(`Auction ${_auctionId} timedOut`); timedOutBidders = getTimedOutBids(_bidderRequests, _timelyBidders); if (timedOutBidders.length) { events.emit(CONSTANTS.EVENTS.BID_TIMEOUT, timedOutBidders); @@ -173,13 +176,13 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a if (_callback != null) { const adUnitCodes = _adUnitCodes; const bids = _bidsReceived - .filter(utils.bind.call(adUnitsFilter, this, adUnitCodes)) + .filter(bind.call(adUnitsFilter, this, adUnitCodes)) .reduce(groupByPlacement, {}); _callback.apply($$PREBID_GLOBAL$$, [bids, timedOut, _auctionId]); _callback = null; } } catch (e) { - utils.logError('Error executing bidsBackHandler', null, e); + logError('Error executing bidsBackHandler', null, e); } finally { // Calling timed out bidders if (timedOutBidders.length) { @@ -199,7 +202,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a function auctionDone() { config.resetBidder(); // when all bidders have called done callback atleast once it means auction is complete - utils.logInfo(`Bids Received for Auction with id: ${_auctionId}`, _bidsReceived); + logInfo(`Bids Received for Auction with id: ${_auctionId}`, _bidsReceived); _auctionStatus = AUCTION_COMPLETED; executeCallback(false, true); } @@ -213,10 +216,10 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a _auctionStart = Date.now(); let bidRequests = adapterManager.makeBidRequests(_adUnits, _auctionStart, _auctionId, _timeout, _labels); - utils.logInfo(`Bids Requested for Auction with id: ${_auctionId}`, bidRequests); + logInfo(`Bids Requested for Auction with id: ${_auctionId}`, bidRequests); if (bidRequests.length < 1) { - utils.logWarn('No valid bid requests returned for auction'); + logWarn('No valid bid requests returned for auction'); auctionDone(); } else { addBidderRequests.call({ @@ -279,7 +282,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels, a }; if (!runIfOriginHasCapacity(call)) { - utils.logWarn('queueing auction due to limited endpoint capacity'); + logWarn('queueing auction due to limited endpoint capacity'); queuedCalls.push(call); } @@ -404,7 +407,7 @@ export function auctionCallbacks(auctionDone, auctionInstance) { bidderRequestsDone.add(bidderRequest); - if (auctionOptionsConfig && !utils.isEmpty(auctionOptionsConfig)) { + if (auctionOptionsConfig && !isEmpty(auctionOptionsConfig)) { const secondaryBidders = auctionOptionsConfig.secondaryBidders; if (secondaryBidders && !bidderRequests.every(bidder => includes(secondaryBidders, bidder.bidderCode))) { bidderRequests = bidderRequests.filter(request => !includes(secondaryBidders, request.bidderCode)); @@ -463,7 +466,7 @@ function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded addBid = false; callPrebidCache(auctionInstance, bidResponse, afterBidAdded, bidderRequest); } else if (!bidResponse.vastUrl) { - utils.logError('videoCacheKey specified but not required vastUrl for video bid'); + logError('videoCacheKey specified but not required vastUrl for video bid'); addBid = false; } } @@ -476,12 +479,12 @@ function tryAddVideoBid(auctionInstance, bidResponse, bidRequests, afterBidAdded export const callPrebidCache = hook('async', function(auctionInstance, bidResponse, afterBidAdded, bidderRequest) { store([bidResponse], function (error, cacheIds) { if (error) { - utils.logWarn(`Failed to save to the video cache: ${error}. Video bid must be discarded.`); + logWarn(`Failed to save to the video cache: ${error}. Video bid must be discarded.`); doCallbacksIfTimedout(auctionInstance, bidResponse); } else { if (cacheIds[0].uuid === '') { - utils.logWarn(`Supplied video cache key was already in use by Prebid Cache; caching attempt was rejected. Video bid must be discarded.`); + logWarn(`Supplied video cache key was already in use by Prebid Cache; caching attempt was rejected. Video bid must be discarded.`); doCallbacksIfTimedout(auctionInstance, bidResponse); } else { @@ -688,12 +691,12 @@ export function getStandardBidderSettings(mediaType, bidderCode, bidReq) { }); // Adding hb_cache_host - if (config.getConfig('cache.url') && (!bidderCode || utils.deepAccess(bidderSettings, `${bidderCode}.sendStandardTargeting`) !== false)) { + if (config.getConfig('cache.url') && (!bidderCode || deepAccess(bidderSettings, `${bidderCode}.sendStandardTargeting`) !== false)) { const urlInfo = parseUrl(config.getConfig('cache.url')); if (typeof find(adserverTargeting, targetingKeyVal => targetingKeyVal.key === TARGETING_KEYS.CACHE_HOST) === 'undefined') { adserverTargeting.push(createKeyVal(TARGETING_KEYS.CACHE_HOST, function(bidResponse) { - return utils.deepAccess(bidResponse, `adserverTargeting.${TARGETING_KEYS.CACHE_HOST}`) + return deepAccess(bidResponse, `adserverTargeting.${TARGETING_KEYS.CACHE_HOST}`) ? bidResponse.adserverTargeting[TARGETING_KEYS.CACHE_HOST] : urlInfo.hostname; })); } @@ -735,19 +738,19 @@ function setKeys(keyValues, bidderSettings, custBidObj) { var targeting = bidderSettings[CONSTANTS.JSON_MAPPING.ADSERVER_TARGETING]; custBidObj.size = custBidObj.getSize(); - utils._each(targeting, function (kvPair) { + _each(targeting, function (kvPair) { var key = kvPair.key; var value = kvPair.val; if (keyValues[key]) { - utils.logWarn('The key: ' + key + ' is getting ovewritten'); + logWarn('The key: ' + key + ' is getting ovewritten'); } - if (utils.isFn(value)) { + if (isFn(value)) { try { value = value(custBidObj); } catch (e) { - utils.logError('bidmanager', 'ERROR', e); + logError('bidmanager', 'ERROR', e); } } @@ -755,12 +758,12 @@ function setKeys(keyValues, bidderSettings, custBidObj) { ((typeof bidderSettings.suppressEmptyKeys !== 'undefined' && bidderSettings.suppressEmptyKeys === true) || key === CONSTANTS.TARGETING_KEYS.DEAL) && // hb_deal is suppressed automatically if not set ( - utils.isEmptyStr(value) || + isEmptyStr(value) || value === null || value === undefined ) ) { - utils.logInfo("suppressing empty key '" + key + "' from adserver targeting"); + logInfo("suppressing empty key '" + key + "' from adserver targeting"); } else { keyValues[key] = value; } @@ -783,7 +786,7 @@ export function adjustBids(bid) { try { bidPriceAdjusted = bidCpmAdjustment(bid.cpm, Object.assign({}, bid)); } catch (e) { - utils.logError('Error during bid adjustment', 'bidmanager.js', e); + logError('Error during bid adjustment', 'bidmanager.js', e); } } } diff --git a/src/bidfactory.js b/src/bidfactory.js index 8701184c799..e15112f1735 100644 --- a/src/bidfactory.js +++ b/src/bidfactory.js @@ -1,4 +1,4 @@ -var utils = require('./utils.js'); +import { getUniqueIdentifierStr } from './utils.js'; /** Required paramaters @@ -22,7 +22,7 @@ function Bid(statusCode, bidRequest) { this.width = 0; this.height = 0; this.statusMessage = _getStatus(); - this.adId = utils.getUniqueIdentifierStr(); + this.adId = getUniqueIdentifierStr(); this.requestId = bidRequest && bidRequest.bidId; this.mediaType = 'banner'; this.source = _bidSrc; diff --git a/src/config.js b/src/config.js index c05a1d9e2a9..72d760c5b87 100644 --- a/src/config.js +++ b/src/config.js @@ -16,13 +16,15 @@ import { isValidPriceConfig } from './cpmBucketManager.js'; import find from 'core-js-pure/features/array/find.js'; import includes from 'core-js-pure/features/array/includes.js'; import Set from 'core-js-pure/features/set'; -import { mergeDeep, deepClone } from './utils.js'; +import { + mergeDeep, deepClone, getParameterByName, isPlainObject, logMessage, logWarn, logError, + isArray, isStr, isBoolean, deepAccess, bind +} from './utils.js'; const from = require('core-js-pure/features/array/from.js'); -const utils = require('./utils.js'); const CONSTANTS = require('./constants.json'); -const DEFAULT_DEBUG = utils.getParameterByName(CONSTANTS.DEBUG_MODE).toUpperCase() === 'TRUE'; +const DEFAULT_DEBUG = getParameterByName(CONSTANTS.DEBUG_MODE).toUpperCase() === 'TRUE'; const DEFAULT_BIDDER_TIMEOUT = 3000; const DEFAULT_PUBLISHER_DOMAIN = window.location.origin; const DEFAULT_ENABLE_SEND_ALL_BIDS = true; @@ -103,10 +105,10 @@ export function newConfig() { if (validatePriceGranularity(val)) { if (typeof val === 'string') { this._priceGranularity = (hasGranularity(val)) ? val : GRANULARITY_OPTIONS.MEDIUM; - } else if (utils.isPlainObject(val)) { + } else if (isPlainObject(val)) { this._customPriceBucket = val; this._priceGranularity = GRANULARITY_OPTIONS.CUSTOM; - utils.logMessage('Using custom price granularity'); + logMessage('Using custom price granularity'); } } }, @@ -133,12 +135,12 @@ export function newConfig() { if (validatePriceGranularity(val[item])) { if (typeof val === 'string') { aggregate[item] = (hasGranularity(val[item])) ? val[item] : this._priceGranularity; - } else if (utils.isPlainObject(val)) { + } else if (isPlainObject(val)) { aggregate[item] = val[item]; - utils.logMessage(`Using custom price granularity for ${item}`); + logMessage(`Using custom price granularity for ${item}`); } } else { - utils.logWarn(`Invalid price granularity for media type: ${item}`); + logWarn(`Invalid price granularity for media type: ${item}`); } return aggregate; }, {}); @@ -180,7 +182,7 @@ export function newConfig() { if (VALID_ORDERS[val]) { this._bidderSequence = val; } else { - utils.logWarn(`Invalid order: ${val}. Bidder Sequence was not set.`); + logWarn(`Invalid order: ${val}. Bidder Sequence was not set.`); } }, @@ -242,16 +244,16 @@ export function newConfig() { function validatePriceGranularity(val) { if (!val) { - utils.logError('Prebid Error: no value passed to `setPriceGranularity()`'); + logError('Prebid Error: no value passed to `setPriceGranularity()`'); return false; } if (typeof val === 'string') { if (!hasGranularity(val)) { - utils.logWarn('Prebid Warning: setPriceGranularity was called with invalid setting, using `medium` as default.'); + logWarn('Prebid Warning: setPriceGranularity was called with invalid setting, using `medium` as default.'); } - } else if (utils.isPlainObject(val)) { + } else if (isPlainObject(val)) { if (!isValidPriceConfig(val)) { - utils.logError('Invalid custom price value passed to `setPriceGranularity()`'); + logError('Invalid custom price value passed to `setPriceGranularity()`'); return false; } } @@ -259,27 +261,27 @@ export function newConfig() { } function validateauctionOptions(val) { - if (!utils.isPlainObject(val)) { - utils.logWarn('Auction Options must be an object') + if (!isPlainObject(val)) { + logWarn('Auction Options must be an object') return false } for (let k of Object.keys(val)) { if (k !== 'secondaryBidders' && k !== 'suppressStaleRender') { - utils.logWarn(`Auction Options given an incorrect param: ${k}`) + logWarn(`Auction Options given an incorrect param: ${k}`) return false } if (k === 'secondaryBidders') { - if (!utils.isArray(val[k])) { - utils.logWarn(`Auction Options ${k} must be of type Array`); + if (!isArray(val[k])) { + logWarn(`Auction Options ${k} must be of type Array`); return false - } else if (!val[k].every(utils.isStr)) { - utils.logWarn(`Auction Options ${k} must be only string`); + } else if (!val[k].every(isStr)) { + logWarn(`Auction Options ${k} must be only string`); return false } } else if (k === 'suppressStaleRender') { - if (!utils.isBoolean(val[k])) { - utils.logWarn(`Auction Options ${k} must be of type boolean`); + if (!isBoolean(val[k])) { + logWarn(`Auction Options ${k} must be of type boolean`); return false; } } @@ -293,7 +295,7 @@ export function newConfig() { * @private */ function _getConfig() { - if (currBidder && bidderConfig && utils.isPlainObject(bidderConfig[currBidder])) { + if (currBidder && bidderConfig && isPlainObject(bidderConfig[currBidder])) { let currBidderConfig = bidderConfig[currBidder]; const configTopicSet = new Set(Object.keys(config).concat(Object.keys(currBidderConfig))); @@ -303,7 +305,7 @@ export function newConfig() { } else if (typeof config[topic] === 'undefined') { memo[topic] = currBidderConfig[topic]; } else { - if (utils.isPlainObject(currBidderConfig[topic])) { + if (isPlainObject(currBidderConfig[topic])) { memo[topic] = mergeDeep({}, config[topic], currBidderConfig[topic]); } else { memo[topic] = currBidderConfig[topic]; @@ -329,7 +331,7 @@ export function newConfig() { if (args.length <= 1 && typeof args[0] !== 'function') { const option = args[0]; const configClone = deepClone(_getConfig()); - return option ? utils.deepAccess(configClone, option) : configClone; + return option ? deepAccess(configClone, option) : configClone; } return subscribe(...args); @@ -346,7 +348,7 @@ export function newConfig() { function getConfig(...args) { if (args.length <= 1 && typeof args[0] !== 'function') { const option = args[0]; - return option ? utils.deepAccess(_getConfig(), option) : _getConfig(); + return option ? deepAccess(_getConfig(), option) : _getConfig(); } return subscribe(...args); @@ -371,9 +373,9 @@ export function newConfig() { let prop = (type === 'site') ? 'context' : type; duplicate[prop] = (prop === 'context' || prop === 'user') ? Object.keys(obj[type]).filter(key => key !== 'data').reduce((result, key) => { if (key === 'ext') { - utils.mergeDeep(result, obj[type][key]); + mergeDeep(result, obj[type][key]); } else { - utils.mergeDeep(result, {[key]: obj[type][key]}); + mergeDeep(result, {[key]: obj[type][key]}); } return result; @@ -391,14 +393,14 @@ export function newConfig() { let duplicate = {}; - if (utils.deepAccess(obj, 'ext.data')) { + if (deepAccess(obj, 'ext.data')) { Object.keys(obj.ext.data).forEach((key) => { if (key === 'pbadslot') { - utils.mergeDeep(duplicate, {context: {pbAdSlot: obj.ext.data[key]}}); + mergeDeep(duplicate, {context: {pbAdSlot: obj.ext.data[key]}}); } else if (key === 'adserver') { - utils.mergeDeep(duplicate, {context: {adServer: obj.ext.data[key]}}); + mergeDeep(duplicate, {context: {adServer: obj.ext.data[key]}}); } else { - utils.mergeDeep(duplicate, {context: {data: {[key]: obj.ext.data[key]}}}); + mergeDeep(duplicate, {context: {data: {[key]: obj.ext.data[key]}}}); } }); } @@ -416,9 +418,9 @@ export function newConfig() { let prop = (type === 'context') ? 'site' : type; duplicate[prop] = (prop === 'site' || prop === 'user') ? Object.keys(opt[type]).reduce((result, key) => { if (key === 'data') { - utils.mergeDeep(result, {ext: {data: opt[type][key]}}); + mergeDeep(result, {ext: {data: opt[type][key]}}); } else { - utils.mergeDeep(result, {[key]: opt[type][key]}); + mergeDeep(result, {[key]: opt[type][key]}); } return result; @@ -438,14 +440,14 @@ export function newConfig() { Object.keys(opt).filter(prop => prop === 'context').forEach((type) => { Object.keys(opt[type]).forEach((key) => { if (key === 'data') { - utils.mergeDeep(duplicate, {ext: {data: opt[type][key]}}); + mergeDeep(duplicate, {ext: {data: opt[type][key]}}); } else { if (typeof opt[type][key] === 'object' && !Array.isArray(opt[type][key])) { Object.keys(opt[type][key]).forEach(data => { - utils.mergeDeep(duplicate, {ext: {data: {[key.toLowerCase()]: {[data.toLowerCase()]: opt[type][key][data]}}}}); + mergeDeep(duplicate, {ext: {data: {[key.toLowerCase()]: {[data.toLowerCase()]: opt[type][key][data]}}}}); }); } else { - utils.mergeDeep(duplicate, {ext: {data: {[key.toLowerCase()]: opt[type][key]}}}); + mergeDeep(duplicate, {ext: {data: {[key.toLowerCase()]: opt[type][key]}}}); } } }); @@ -462,7 +464,7 @@ export function newConfig() { arr.forEach((adunit) => { if (adunit.fpd) { - (adunit['ortb2Imp']) ? utils.mergeDeep(adunit['ortb2Imp'], convertImpFpd(adunit.fpd)) : adunit['ortb2Imp'] = convertImpFpd(adunit.fpd); + (adunit['ortb2Imp']) ? mergeDeep(adunit['ortb2Imp'], convertImpFpd(adunit.fpd)) : adunit['ortb2Imp'] = convertImpFpd(adunit.fpd); convert.push((({ fpd, ...duplicate }) => duplicate)(adunit)); } else { convert.push(adunit); @@ -477,8 +479,8 @@ export function newConfig() { * listeners that were added by the `subscribe` function */ function setConfig(options) { - if (!utils.isPlainObject(options)) { - utils.logError('setConfig options must be an object'); + if (!isPlainObject(options)) { + logError('setConfig options must be an object'); return; } @@ -489,7 +491,7 @@ export function newConfig() { let prop = (topic === 'fpd') ? 'ortb2' : topic; let option = (topic === 'fpd') ? convertFpd(options[topic]) : options[topic]; - if (utils.isPlainObject(defaults[prop]) && utils.isPlainObject(option)) { + if (isPlainObject(defaults[prop]) && isPlainObject(option)) { option = Object.assign({}, defaults[prop], option); } @@ -504,8 +506,8 @@ export function newConfig() { * @param {object} options */ function setDefaults(options) { - if (!utils.isPlainObject(defaults)) { - utils.logError('defaults must be an object'); + if (!isPlainObject(defaults)) { + logError('defaults must be an object'); return; } @@ -546,7 +548,7 @@ export function newConfig() { } if (typeof callback !== 'function') { - utils.logError('listener must be a function'); + logError('listener must be a function'); return; } @@ -589,7 +591,7 @@ export function newConfig() { let prop = (topic === 'fpd') ? 'ortb2' : topic; let option = (topic === 'fpd') ? convertFpd(config.config[topic]) : config.config[topic]; - if (utils.isPlainObject(option)) { + if (isPlainObject(option)) { bidderConfig[bidder][prop] = Object.assign({}, bidderConfig[bidder][prop] || {}, option); } else { bidderConfig[bidder][prop] = option; @@ -597,16 +599,16 @@ export function newConfig() { }); }); } catch (e) { - utils.logError(e); + logError(e); } function check(obj) { - if (!utils.isPlainObject(obj)) { + if (!isPlainObject(obj)) { throw 'setBidderConfig bidder options must be an object'; } if (!(Array.isArray(obj.bidders) && obj.bidders.length)) { throw 'setBidderConfig bidder options must contain a bidders list with at least 1 bidder'; } - if (!utils.isPlainObject(obj.config)) { + if (!isPlainObject(obj.config)) { throw 'setBidderConfig bidder options must contain a config object'; } } @@ -627,9 +629,9 @@ export function newConfig() { return function(cb) { return function(...args) { if (typeof cb === 'function') { - return runWithBidder(bidder, utils.bind.call(cb, this, ...args)) + return runWithBidder(bidder, bind.call(cb, this, ...args)) } else { - utils.logWarn('config.callbackWithBidder callback is not a function'); + logWarn('config.callbackWithBidder callback is not a function'); } } } diff --git a/src/cpmBucketManager.js b/src/cpmBucketManager.js index a6b76cc38e2..b90dc8df717 100644 --- a/src/cpmBucketManager.js +++ b/src/cpmBucketManager.js @@ -1,5 +1,5 @@ import find from 'core-js-pure/features/array/find.js'; -const utils = require('./utils.js'); +import { isEmpty } from './utils.js'; const _defaultPrecision = 2; const _lgPriceConfig = { @@ -102,7 +102,7 @@ function getCpmStringValue(cpm, config, granularityMultiplier) { } function isValidPriceConfig(config) { - if (utils.isEmpty(config) || !config.buckets || !Array.isArray(config.buckets)) { + if (isEmpty(config) || !config.buckets || !Array.isArray(config.buckets)) { return false; } let isValid = true; diff --git a/src/prebid.js b/src/prebid.js index 31fb1ac410e..855d53d7de0 100644 --- a/src/prebid.js +++ b/src/prebid.js @@ -1,7 +1,12 @@ /** @module pbjs */ import { getGlobal } from './prebidGlobal.js'; -import { adUnitsFilter, flatten, getHighestCpm, isArrayOfNums, isGptPubadsDefined, uniques } from './utils.js'; +import { + adUnitsFilter, flatten, getHighestCpm, isArrayOfNums, isGptPubadsDefined, uniques, logInfo, + contains, logError, isArray, deepClone, deepAccess, isNumber, logWarn, logMessage, isFn, + transformAdServerTargetingObj, bind, replaceAuctionPrice, replaceClickThrough, insertElement, + inIframe, callBurl, createInvisibleIframe, generateUUID, unsupportedBidderMessage, isEmpty +} from './utils.js'; import { listenMessagesFromCreative } from './secureCreatives.js'; import { userSync } from './userSync.js'; import { config } from './config.js'; @@ -17,7 +22,6 @@ import { storageCallbacks } from './storageManager.js'; const $$PREBID_GLOBAL$$ = getGlobal(); const CONSTANTS = require('./constants.json'); -const utils = require('./utils.js'); const adapterManager = require('./adapterManager.js').default; const events = require('./events.js'); const { triggerUserSyncs } = userSync; @@ -41,7 +45,7 @@ $$PREBID_GLOBAL$$.libLoaded = true; // version auto generated from build $$PREBID_GLOBAL$$.version = 'v$prebid.version$'; -utils.logInfo('Prebid.js v$prebid.version$ loaded'); +logInfo('Prebid.js v$prebid.version$ loaded'); // modules list generated from build $$PREBID_GLOBAL$$.installedModules = ['v$prebid.modulesList$']; @@ -57,8 +61,8 @@ function checkDefinedPlacement(id) { .reduce(flatten) .filter(uniques); - if (!utils.contains(adUnitCodes, id)) { - utils.logError('The "' + id + '" placement is not defined.'); + if (!contains(adUnitCodes, id)) { + logError('The "' + id + '" placement is not defined.'); return; } @@ -74,7 +78,7 @@ function setRenderSize(doc, width, height) { function validateSizes(sizes, targLength) { let cleanSizes = []; - if (utils.isArray(sizes) && ((targLength) ? sizes.length === targLength : sizes.length > 0)) { + if (isArray(sizes) && ((targLength) ? sizes.length === targLength : sizes.length > 0)) { // check if an array of arrays or array of numbers if (sizes.every(sz => isArrayOfNums(sz, 2))) { cleanSizes = sizes; @@ -86,7 +90,7 @@ function validateSizes(sizes, targLength) { } function validateBannerMediaType(adUnit) { - const validatedAdUnit = utils.deepClone(adUnit); + const validatedAdUnit = deepClone(adUnit); const banner = validatedAdUnit.mediaTypes.banner; const bannerSizes = validateSizes(banner.sizes); if (bannerSizes.length > 0) { @@ -94,14 +98,14 @@ function validateBannerMediaType(adUnit) { // Deprecation Warning: This property will be deprecated in next release in favor of adUnit.mediaTypes.banner.sizes validatedAdUnit.sizes = bannerSizes; } else { - utils.logError('Detected a mediaTypes.banner object without a proper sizes field. Please ensure the sizes are listed like: [[300, 250], ...]. Removing invalid mediaTypes.banner object from request.'); + logError('Detected a mediaTypes.banner object without a proper sizes field. Please ensure the sizes are listed like: [[300, 250], ...]. Removing invalid mediaTypes.banner object from request.'); delete validatedAdUnit.mediaTypes.banner } return validatedAdUnit; } function validateVideoMediaType(adUnit) { - const validatedAdUnit = utils.deepClone(adUnit); + const validatedAdUnit = deepClone(adUnit); const video = validatedAdUnit.mediaTypes.video; if (video.playerSize) { let tarPlayerSizeLen = (typeof video.playerSize[0] === 'number') ? 2 : 1; @@ -109,13 +113,13 @@ function validateVideoMediaType(adUnit) { const videoSizes = validateSizes(video.playerSize, tarPlayerSizeLen); if (videoSizes.length > 0) { if (tarPlayerSizeLen === 2) { - utils.logInfo('Transforming video.playerSize from [640,480] to [[640,480]] so it\'s in the proper format.'); + logInfo('Transforming video.playerSize from [640,480] to [[640,480]] so it\'s in the proper format.'); } video.playerSize = videoSizes; // Deprecation Warning: This property will be deprecated in next release in favor of adUnit.mediaTypes.video.playerSize validatedAdUnit.sizes = videoSizes; } else { - utils.logError('Detected incorrect configuration of mediaTypes.video.playerSize. Please specify only one set of dimensions in a format like: [[640, 480]]. Removing invalid mediaTypes.video.playerSize property from request.'); + logError('Detected incorrect configuration of mediaTypes.video.playerSize. Please specify only one set of dimensions in a format like: [[640, 480]]. Removing invalid mediaTypes.video.playerSize property from request.'); delete validatedAdUnit.mediaTypes.video.playerSize; } } @@ -123,30 +127,30 @@ function validateVideoMediaType(adUnit) { } function validateNativeMediaType(adUnit) { - const validatedAdUnit = utils.deepClone(adUnit); + const validatedAdUnit = deepClone(adUnit); const native = validatedAdUnit.mediaTypes.native; if (native.image && native.image.sizes && !Array.isArray(native.image.sizes)) { - utils.logError('Please use an array of sizes for native.image.sizes field. Removing invalid mediaTypes.native.image.sizes property from request.'); + logError('Please use an array of sizes for native.image.sizes field. Removing invalid mediaTypes.native.image.sizes property from request.'); delete validatedAdUnit.mediaTypes.native.image.sizes; } if (native.image && native.image.aspect_ratios && !Array.isArray(native.image.aspect_ratios)) { - utils.logError('Please use an array of sizes for native.image.aspect_ratios field. Removing invalid mediaTypes.native.image.aspect_ratios property from request.'); + logError('Please use an array of sizes for native.image.aspect_ratios field. Removing invalid mediaTypes.native.image.aspect_ratios property from request.'); delete validatedAdUnit.mediaTypes.native.image.aspect_ratios; } if (native.icon && native.icon.sizes && !Array.isArray(native.icon.sizes)) { - utils.logError('Please use an array of sizes for native.icon.sizes field. Removing invalid mediaTypes.native.icon.sizes property from request.'); + logError('Please use an array of sizes for native.icon.sizes field. Removing invalid mediaTypes.native.icon.sizes property from request.'); delete validatedAdUnit.mediaTypes.native.icon.sizes; } return validatedAdUnit; } function validateAdUnitPos(adUnit, mediaType) { - let pos = utils.deepAccess(adUnit, `mediaTypes.${mediaType}.pos`); + let pos = deepAccess(adUnit, `mediaTypes.${mediaType}.pos`); - if (!pos || !utils.isNumber(pos) || !isFinite(pos)) { + if (!pos || !isNumber(pos) || !isFinite(pos)) { let warning = `Value of property 'pos' on ad unit ${adUnit.code} should be of type: Number`; - utils.logWarn(warning); + logWarn(warning); events.emit(CONSTANTS.EVENTS.AUCTION_DEBUG, {type: 'WARNING', arguments: warning}); delete adUnit.mediaTypes[mediaType].pos; } @@ -169,13 +173,13 @@ export const checkAdUnitSetup = hook('sync', function (adUnits) { const bids = adUnit.bids; let validatedBanner, validatedVideo, validatedNative; - if (!bids || !utils.isArray(bids)) { - utils.logError(`Detected adUnit.code '${adUnit.code}' did not have 'adUnit.bids' defined or 'adUnit.bids' is not an array. Removing adUnit from auction.`); + if (!bids || !isArray(bids)) { + logError(`Detected adUnit.code '${adUnit.code}' did not have 'adUnit.bids' defined or 'adUnit.bids' is not an array. Removing adUnit from auction.`); return; } if (!mediaTypes || Object.keys(mediaTypes).length === 0) { - utils.logError(`Detected adUnit.code '${adUnit.code}' did not have a 'mediaTypes' object defined. This is a required field for the auction, so this adUnit has been removed.`); + logError(`Detected adUnit.code '${adUnit.code}' did not have a 'mediaTypes' object defined. This is a required field for the auction, so this adUnit has been removed.`); return; } @@ -214,14 +218,14 @@ export const checkAdUnitSetup = hook('sync', function (adUnits) { * @return {Array} returnObj return bids array */ $$PREBID_GLOBAL$$.getAdserverTargetingForAdUnitCodeStr = function (adunitCode) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.getAdserverTargetingForAdUnitCodeStr', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.getAdserverTargetingForAdUnitCodeStr', arguments); // call to retrieve bids array if (adunitCode) { var res = $$PREBID_GLOBAL$$.getAdserverTargetingForAdUnitCode(adunitCode); - return utils.transformAdServerTargetingObj(res); + return transformAdServerTargetingObj(res); } else { - utils.logMessage('Need to call getAdserverTargetingForAdUnitCodeStr with adunitCode'); + logMessage('Need to call getAdserverTargetingForAdUnitCodeStr with adunitCode'); } }; @@ -239,7 +243,7 @@ $$PREBID_GLOBAL$$.getHighestUnusedBidResponseForAdUnitCode = function (adunitCod return bid.length ? bid.reduce(getHighestCpm) : {} } else { - utils.logMessage('Need to call getHighestUnusedBidResponseForAdUnitCode with adunitCode'); + logMessage('Need to call getHighestUnusedBidResponseForAdUnitCode with adunitCode'); } }; @@ -260,13 +264,13 @@ $$PREBID_GLOBAL$$.getAdserverTargetingForAdUnitCode = function (adUnitCode) { */ $$PREBID_GLOBAL$$.getAdserverTargeting = function (adUnitCode) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.getAdserverTargeting', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.getAdserverTargeting', arguments); return targeting.getAllTargeting(adUnitCode); }; function getBids(type) { const responses = auctionManager[type]() - .filter(utils.bind.call(adUnitsFilter, this, auctionManager.getAdUnitCodes())); + .filter(bind.call(adUnitsFilter, this, auctionManager.getAdUnitCodes())); // find the last auction id to get responses for most recent auction only const currentAuctionId = auctionManager.getLastAuctionId(); @@ -291,7 +295,7 @@ function getBids(type) { */ $$PREBID_GLOBAL$$.getNoBids = function () { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.getNoBids', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.getNoBids', arguments); return getBids('getNoBids'); }; @@ -314,7 +318,7 @@ $$PREBID_GLOBAL$$.getNoBidsForAdUnitCode = function (adUnitCode) { */ $$PREBID_GLOBAL$$.getBidResponses = function () { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.getBidResponses', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.getBidResponses', arguments); return getBids('getBidsReceived'); }; @@ -337,9 +341,9 @@ $$PREBID_GLOBAL$$.getBidResponsesForAdUnitCode = function (adUnitCode) { * @alias module:pbjs.setTargetingForGPTAsync */ $$PREBID_GLOBAL$$.setTargetingForGPTAsync = function (adUnit, customSlotMatching) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.setTargetingForGPTAsync', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.setTargetingForGPTAsync', arguments); if (!isGptPubadsDefined()) { - utils.logError('window.googletag is not defined on the page'); + logError('window.googletag is not defined on the page'); return; } @@ -370,9 +374,9 @@ $$PREBID_GLOBAL$$.setTargetingForGPTAsync = function (adUnit, customSlotMatching * @alias module:pbjs.setTargetingForAst */ $$PREBID_GLOBAL$$.setTargetingForAst = function (adUnitCodes) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.setTargetingForAn', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.setTargetingForAn', arguments); if (!targeting.isApntagDefined()) { - utils.logError('window.apntag is not defined on the page'); + logError('window.apntag is not defined on the page'); return; } @@ -387,7 +391,7 @@ function emitAdRenderFail({ reason, message, bid, id }) { if (bid) data.bid = bid; if (id) data.adId = id; - utils.logError(message); + logError(message); events.emit(AD_RENDER_FAILED, data); } @@ -407,8 +411,8 @@ function emitAdRenderSucceeded({ doc, bid, id }) { * @alias module:pbjs.renderAd */ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.renderAd', arguments); - utils.logMessage('Calling renderAd with adId :' + id); + logInfo('Invoking $$PREBID_GLOBAL$$.renderAd', arguments); + logMessage('Calling renderAd with adId :' + id); if (doc && id) { try { @@ -418,23 +422,23 @@ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) { if (bid) { let shouldRender = true; if (bid && bid.status === CONSTANTS.BID_STATUS.RENDERED) { - utils.logWarn(`Ad id ${bid.adId} has been rendered before`); + logWarn(`Ad id ${bid.adId} has been rendered before`); events.emit(STALE_RENDER, bid); - if (utils.deepAccess(config.getConfig('auctionOptions'), 'suppressStaleRender')) { + if (deepAccess(config.getConfig('auctionOptions'), 'suppressStaleRender')) { shouldRender = false; } } if (shouldRender) { // replace macros according to openRTB with price paid = bid.cpm - bid.ad = utils.replaceAuctionPrice(bid.ad, bid.cpm); - bid.adUrl = utils.replaceAuctionPrice(bid.adUrl, bid.cpm); + bid.ad = replaceAuctionPrice(bid.ad, bid.cpm); + bid.adUrl = replaceAuctionPrice(bid.adUrl, bid.cpm); // replacing clickthrough if submitted if (options && options.clickThrough) { const {clickThrough} = options; - bid.ad = utils.replaceClickThrough(bid.ad, clickThrough); - bid.adUrl = utils.replaceClickThrough(bid.adUrl, clickThrough); + bid.ad = replaceClickThrough(bid.ad, clickThrough); + bid.adUrl = replaceClickThrough(bid.adUrl, clickThrough); } // save winning bids @@ -449,9 +453,9 @@ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) { if (isRendererRequired(renderer)) { executeRenderer(renderer, bid); - utils.insertElement(creativeComment, doc, 'html'); + insertElement(creativeComment, doc, 'html'); emitAdRenderSucceeded({ doc, bid, id }); - } else if ((doc === document && !utils.inIframe()) || mediaType === 'video') { + } else if ((doc === document && !inIframe()) || mediaType === 'video') { const message = `Error trying to write ad. Ad render call ad id ${id} was prevented from writing to the main document.`; emitAdRenderFail({reason: PREVENT_WRITING_ON_MAIN_DOCUMENT, message, bid, id}); } else if (ad) { @@ -468,21 +472,21 @@ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) { doc.write(ad); doc.close(); setRenderSize(doc, width, height); - utils.insertElement(creativeComment, doc, 'html'); - utils.callBurl(bid); + insertElement(creativeComment, doc, 'html'); + callBurl(bid); emitAdRenderSucceeded({ doc, bid, id }); } else if (adUrl) { - const iframe = utils.createInvisibleIframe(); + const iframe = createInvisibleIframe(); iframe.height = height; iframe.width = width; iframe.style.display = 'inline'; iframe.style.overflow = 'hidden'; iframe.src = adUrl; - utils.insertElement(iframe, doc, 'body'); + insertElement(iframe, doc, 'body'); setRenderSize(doc, width, height); - utils.insertElement(creativeComment, doc, 'html'); - utils.callBurl(bid); + insertElement(creativeComment, doc, 'html'); + callBurl(bid); emitAdRenderSucceeded({ doc, bid, id }); } else { const message = `Error trying to write ad. No ad for bid response id: ${id}`; @@ -509,7 +513,7 @@ $$PREBID_GLOBAL$$.renderAd = hook('async', function (doc, id, options) { * @alias module:pbjs.removeAdUnit */ $$PREBID_GLOBAL$$.removeAdUnit = function (adUnitCode) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.removeAdUnit', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.removeAdUnit', arguments); if (!adUnitCode) { $$PREBID_GLOBAL$$.adUnits = []; @@ -518,7 +522,7 @@ $$PREBID_GLOBAL$$.removeAdUnit = function (adUnitCode) { let adUnitCodes; - if (utils.isArray(adUnitCode)) { + if (isArray(adUnitCode)) { adUnitCodes = adUnitCode; } else { adUnitCodes = [adUnitCode]; @@ -546,9 +550,9 @@ $$PREBID_GLOBAL$$.removeAdUnit = function (adUnitCode) { $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeout, adUnits, adUnitCodes, labels, auctionId } = {}) { events.emit(REQUEST_BIDS); const cbTimeout = timeout || config.getConfig('bidderTimeout'); - adUnits = (adUnits && config.convertAdUnitFpd(utils.isArray(adUnits) ? adUnits : [adUnits])) || $$PREBID_GLOBAL$$.adUnits; + adUnits = (adUnits && config.convertAdUnitFpd(isArray(adUnits) ? adUnits : [adUnits])) || $$PREBID_GLOBAL$$.adUnits; - utils.logInfo('Invoking $$PREBID_GLOBAL$$.requestBids', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.requestBids', arguments); let _s2sConfigs = []; const s2sBidders = []; @@ -588,7 +592,7 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo const bidders = (s2sBidders) ? allBidders.filter(bidder => !includes(s2sBidders, bidder)) : allBidders; - adUnit.transactionId = utils.generateUUID(); + adUnit.transactionId = generateUUID(); bidders.forEach(bidder => { const adapter = bidderRegistry[bidder]; @@ -600,7 +604,7 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo const bidderEligible = adUnitMediaTypes.some(type => includes(bidderMediaTypes, type)); if (!bidderEligible) { // drop the bidder from the ad unit if it's not compatible - utils.logWarn(utils.unsupportedBidderMessage(adUnit, bidder)); + logWarn(unsupportedBidderMessage(adUnit, bidder)); adUnit.bids = adUnit.bids.filter(bid => bid.bidder !== bidder); } else { adunitCounter.incrementBidderRequestsCounter(adUnit.code, bidder); @@ -610,13 +614,13 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo }); if (!adUnits || adUnits.length === 0) { - utils.logMessage('No adUnits configured. No bids requested.'); + logMessage('No adUnits configured. No bids requested.'); if (typeof bidsBackHandler === 'function') { // executeCallback, this will only be called in case of first request try { bidsBackHandler(); } catch (e) { - utils.logError('Error executing bidsBackHandler', null, e); + logError('Error executing bidsBackHandler', null, e); } } return; @@ -626,7 +630,7 @@ $$PREBID_GLOBAL$$.requestBids = hook('async', function ({ bidsBackHandler, timeo let adUnitsLen = adUnits.length; if (adUnitsLen > 15) { - utils.logInfo(`Current auction ${auction.getAuctionId()} contains ${adUnitsLen} adUnits.`, adUnits); + logInfo(`Current auction ${auction.getAuctionId()} contains ${adUnitsLen} adUnits.`, adUnits); } adUnitCodes.forEach(code => targeting.setLatestAuctionForAdUnit(code, auction.getAuctionId())); @@ -656,8 +660,8 @@ $$PREBID_GLOBAL$$.requestBids.before(executeCallbacks, 49); * @alias module:pbjs.addAdUnits */ $$PREBID_GLOBAL$$.addAdUnits = function (adUnitArr) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.addAdUnits', arguments); - $$PREBID_GLOBAL$$.adUnits.push.apply($$PREBID_GLOBAL$$.adUnits, config.convertAdUnitFpd(utils.isArray(adUnitArr) ? adUnitArr : [adUnitArr])); + logInfo('Invoking $$PREBID_GLOBAL$$.addAdUnits', arguments); + $$PREBID_GLOBAL$$.adUnits.push.apply($$PREBID_GLOBAL$$.adUnits, config.convertAdUnitFpd(isArray(adUnitArr) ? adUnitArr : [adUnitArr])); // emit event events.emit(ADD_AD_UNITS); }; @@ -679,14 +683,14 @@ $$PREBID_GLOBAL$$.addAdUnits = function (adUnitArr) { * Currently `bidWon` is the only event that accepts an `id` parameter. */ $$PREBID_GLOBAL$$.onEvent = function (event, handler, id) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.onEvent', arguments); - if (!utils.isFn(handler)) { - utils.logError('The event handler provided is not a function and was not set on event "' + event + '".'); + logInfo('Invoking $$PREBID_GLOBAL$$.onEvent', arguments); + if (!isFn(handler)) { + logError('The event handler provided is not a function and was not set on event "' + event + '".'); return; } if (id && !eventValidators[event].call(null, id)) { - utils.logError('The id provided is not valid for event "' + event + '" and no handler was set.'); + logError('The id provided is not valid for event "' + event + '" and no handler was set.'); return; } @@ -700,7 +704,7 @@ $$PREBID_GLOBAL$$.onEvent = function (event, handler, id) { * @alias module:pbjs.offEvent */ $$PREBID_GLOBAL$$.offEvent = function (event, handler, id) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.offEvent', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.offEvent', arguments); if (id && !eventValidators[event].call(null, id)) { return; } @@ -714,7 +718,7 @@ $$PREBID_GLOBAL$$.offEvent = function (event, handler, id) { * @alias module:pbjs.getEvents */ $$PREBID_GLOBAL$$.getEvents = function () { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.getEvents'); + logInfo('Invoking $$PREBID_GLOBAL$$.getEvents'); return events.getEvents(); }; @@ -725,11 +729,11 @@ $$PREBID_GLOBAL$$.getEvents = function () { * @alias module:pbjs.registerBidAdapter */ $$PREBID_GLOBAL$$.registerBidAdapter = function (bidderAdaptor, bidderCode) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.registerBidAdapter', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.registerBidAdapter', arguments); try { adapterManager.registerBidAdapter(bidderAdaptor(), bidderCode); } catch (e) { - utils.logError('Error registering bidder adapter : ' + e.message); + logError('Error registering bidder adapter : ' + e.message); } }; @@ -739,11 +743,11 @@ $$PREBID_GLOBAL$$.registerBidAdapter = function (bidderAdaptor, bidderCode) { * @alias module:pbjs.registerAnalyticsAdapter */ $$PREBID_GLOBAL$$.registerAnalyticsAdapter = function (options) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.registerAnalyticsAdapter', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.registerAnalyticsAdapter', arguments); try { adapterManager.registerAnalyticsAdapter(options); } catch (e) { - utils.logError('Error registering analytics adapter : ' + e.message); + logError('Error registering analytics adapter : ' + e.message); } }; @@ -754,7 +758,7 @@ $$PREBID_GLOBAL$$.registerAnalyticsAdapter = function (options) { * @return {Object} bidResponse [description] */ $$PREBID_GLOBAL$$.createBid = function (statusCode) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.createBid', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.createBid', arguments); return createBid(statusCode); }; @@ -777,11 +781,11 @@ $$PREBID_GLOBAL$$.createBid = function (statusCode) { const enableAnalyticsCallbacks = []; const enableAnalyticsCb = hook('async', function (config) { - if (config && !utils.isEmpty(config)) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.enableAnalytics for: ', config); + if (config && !isEmpty(config)) { + logInfo('Invoking $$PREBID_GLOBAL$$.enableAnalytics for: ', config); adapterManager.enableAnalytics(config); } else { - utils.logError('$$PREBID_GLOBAL$$.enableAnalytics should be called with option {}'); + logError('$$PREBID_GLOBAL$$.enableAnalytics should be called with option {}'); } }, 'enableAnalyticsCb'); @@ -793,11 +797,11 @@ $$PREBID_GLOBAL$$.enableAnalytics = function (config) { * @alias module:pbjs.aliasBidder */ $$PREBID_GLOBAL$$.aliasBidder = function (bidderCode, alias, options) { - utils.logInfo('Invoking $$PREBID_GLOBAL$$.aliasBidder', arguments); + logInfo('Invoking $$PREBID_GLOBAL$$.aliasBidder', arguments); if (bidderCode && alias) { adapterManager.aliasBidAdapter(bidderCode, alias, options); } else { - utils.logError('bidderCode and alias must be passed as arguments', '$$PREBID_GLOBAL$$.aliasBidder'); + logError('bidderCode and alias must be passed as arguments', '$$PREBID_GLOBAL$$.aliasBidder'); } }; @@ -883,7 +887,7 @@ $$PREBID_GLOBAL$$.markWinningBidAsUsed = function (markBidRequest) { } else if (markBidRequest.adId) { bids = auctionManager.getBidsReceived().filter(bid => bid.adId === markBidRequest.adId); } else { - utils.logWarn('Improper use of markWinningBidAsUsed. It needs an adUnitCode or an adId to function.'); + logWarn('Improper use of markWinningBidAsUsed. It needs an adUnitCode or an adId to function.'); } if (bids.length > 0) { @@ -975,10 +979,10 @@ $$PREBID_GLOBAL$$.cmd.push = function (command) { try { command.call(); } catch (e) { - utils.logError('Error processing command :', e.message, e.stack); + logError('Error processing command :', e.message, e.stack); } } else { - utils.logError('Commands written into $$PREBID_GLOBAL$$.cmd.push must be wrapped in a function'); + logError('Commands written into $$PREBID_GLOBAL$$.cmd.push must be wrapped in a function'); } }; @@ -991,7 +995,7 @@ function processQueue(queue) { cmd.call(); cmd.called = true; } catch (e) { - utils.logError('Error processing command :', 'prebid.js', e); + logError('Error processing command :', 'prebid.js', e); } } }); diff --git a/src/storageManager.js b/src/storageManager.js index 66a0cf68cbf..888cdf24325 100644 --- a/src/storageManager.js +++ b/src/storageManager.js @@ -1,5 +1,5 @@ import {hook} from './hook.js'; -import * as utils from './utils.js'; +import { hasDeviceAccess, checkCookieSupport, logError } from './utils.js'; import includes from 'core-js-pure/features/array/includes.js'; const moduleTypeWhiteList = ['core', 'prebid-module']; @@ -40,7 +40,7 @@ export function newStorageManager({gvlid, moduleName, moduleType} = {}) { } else { let result = { hasEnforcementHook: false, - valid: utils.hasDeviceAccess() + valid: hasDeviceAccess() } value = cb(result); } @@ -135,7 +135,7 @@ export function newStorageManager({gvlid, moduleName, moduleType} = {}) { const cookiesAreEnabled = function (done) { let cb = function (result) { if (result && result.valid) { - if (utils.checkCookieSupport()) { + if (checkCookieSupport()) { return true; } window.document.cookie = 'prebid.cookieTest'; @@ -222,7 +222,7 @@ export function newStorageManager({gvlid, moduleName, moduleType} = {}) { try { return !!window.localStorage; } catch (e) { - utils.logError('Local storage api disabled'); + logError('Local storage api disabled'); } } return false; @@ -247,7 +247,7 @@ export function newStorageManager({gvlid, moduleName, moduleType} = {}) { let cb = function (result) { if (result && result.valid) { const all = []; - if (utils.hasDeviceAccess()) { + if (hasDeviceAccess()) { const cookies = document.cookie.split(';'); while (cookies.length) { const cookie = cookies.pop(); diff --git a/src/targeting.js b/src/targeting.js index ce519f8add3..61a9f9a76b7 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -1,4 +1,7 @@ -import { uniques, isGptPubadsDefined, getHighestCpm, getOldestHighestCpmBid, groupBy, isAdUnitCodeMatchingSlot, timestamp, deepAccess, deepClone, logError, logWarn, logInfo } from './utils.js'; +import { + uniques, isGptPubadsDefined, getHighestCpm, getOldestHighestCpmBid, groupBy, isAdUnitCodeMatchingSlot, timestamp, + deepAccess, deepClone, logError, logWarn, logInfo, isFn, isArray, logMessage, isStr +} from './utils.js'; import { config } from './config.js'; import { NATIVE_TARGETING_KEYS } from './native.js'; import { auctionManager } from './auctionManager.js'; @@ -8,7 +11,6 @@ import { hook } from './hook.js'; import includes from 'core-js-pure/features/array/includes.js'; import find from 'core-js-pure/features/array/find.js'; -const utils = require('./utils.js'); var CONSTANTS = require('./constants.json'); var pbTargetingKeys = []; @@ -122,13 +124,13 @@ export function newTargeting(auctionManager) { const adUnitCodes = getAdUnitCodes(adUnitCode); const adUnits = auctionManager.getAdUnits().filter(adUnit => includes(adUnitCodes, adUnit.code)); window.googletag.pubads().getSlots().forEach(slot => { - let customSlotMatchingFunc = utils.isFn(customSlotMatching) && customSlotMatching(slot); + let customSlotMatchingFunc = isFn(customSlotMatching) && customSlotMatching(slot); pbTargetingKeys.forEach(function(key) { // reset only registered adunits adUnits.forEach(function(unit) { if (unit.code === slot.getAdUnitPath() || unit.code === slot.getSlotElementId() || - (utils.isFn(customSlotMatchingFunc) && customSlotMatchingFunc(unit.code))) { + (isFn(customSlotMatchingFunc) && customSlotMatchingFunc(unit.code))) { slot.setTargeting(key, null); } }); @@ -160,7 +162,7 @@ export function newTargeting(auctionManager) { */ function bidShouldBeAddedToTargeting(bid, adUnitCodes) { return bid.adserverTargeting && adUnitCodes && - ((utils.isArray(adUnitCodes) && includes(adUnitCodes, bid.adUnitCode)) || + ((isArray(adUnitCodes) && includes(adUnitCodes, bid.adUnitCode)) || (typeof adUnitCodes === 'string' && bid.adUnitCode === adUnitCodes)); }; @@ -388,7 +390,7 @@ export function newTargeting(auctionManager) { } targetingConfig[targetId][key] = value; }); - utils.logMessage(`Attempting to set targeting-map for slot: ${slot.getSlotElementId()} with targeting-map:`, targetingConfig[targetId]); + logMessage(`Attempting to set targeting-map for slot: ${slot.getSlotElementId()} with targeting-map:`, targetingConfig[targetId]); slot.updateTargetingFromMap(targetingConfig[targetId]) }) }) @@ -402,7 +404,7 @@ export function newTargeting(auctionManager) { function getAdUnitCodes(adUnitCode) { if (typeof adUnitCode === 'string') { return [adUnitCode]; - } else if (utils.isArray(adUnitCode)) { + } else if (isArray(adUnitCode)) { return adUnitCode; } return auctionManager.getAdUnitCodes() || []; @@ -452,14 +454,14 @@ export function newTargeting(auctionManager) { try { targeting.resetPresetTargetingAST(adUnitCodes); } catch (e) { - utils.logError('unable to reset targeting for AST' + e) + logError('unable to reset targeting for AST' + e) } Object.keys(astTargeting).forEach(targetId => Object.keys(astTargeting[targetId]).forEach(key => { - utils.logMessage(`Attempting to set targeting for targetId: ${targetId} key: ${key} value: ${astTargeting[targetId][key]}`); + logMessage(`Attempting to set targeting for targetId: ${targetId} key: ${key} value: ${astTargeting[targetId][key]}`); // setKeywords supports string and array as value - if (utils.isStr(astTargeting[targetId][key]) || utils.isArray(astTargeting[targetId][key])) { + if (isStr(astTargeting[targetId][key]) || isArray(astTargeting[targetId][key])) { let keywordsObj = {}; let regex = /pt[0-9]/; if (key.search(regex) < 0) { @@ -524,7 +526,7 @@ export function newTargeting(auctionManager) { function mergeAdServerTargeting(acc, bid, index, arr) { function concatTargetingValue(key) { return function(currentBidElement) { - if (!utils.isArray(currentBidElement.adserverTargeting[key])) { + if (!isArray(currentBidElement.adserverTargeting[key])) { currentBidElement.adserverTargeting[key] = [currentBidElement.adserverTargeting[key]]; } currentBidElement.adserverTargeting[key] = currentBidElement.adserverTargeting[key].concat(bid.adserverTargeting[key]).filter(uniques); @@ -631,8 +633,8 @@ export function newTargeting(auctionManager) { return Object.keys(aut) .map(function(key) { - if (utils.isStr(aut[key])) aut[key] = aut[key].split(',').map(s => s.trim()); - if (!utils.isArray(aut[key])) aut[key] = [ aut[key] ]; + if (isStr(aut[key])) aut[key] = aut[key].split(',').map(s => s.trim()); + if (!isArray(aut[key])) aut[key] = [ aut[key] ]; return { [key]: aut[key] }; }); } @@ -645,7 +647,7 @@ export function newTargeting(auctionManager) { } targeting.isApntagDefined = function() { - if (window.apntag && utils.isFn(window.apntag.setKeywords)) { + if (window.apntag && isFn(window.apntag.setKeywords)) { return true; } }; diff --git a/src/userSync.js b/src/userSync.js index fc9f577fd7e..60e605f29fb 100644 --- a/src/userSync.js +++ b/src/userSync.js @@ -1,4 +1,7 @@ -import * as utils from './utils.js'; +import { + deepClone, isPlainObject, logError, shuffle, logMessage, triggerPixel, insertUserSyncIframe, isArray, + logWarn, isStr, isSafariBrowser +} from './utils.js'; import { config } from './config.js'; import includes from 'core-js-pure/features/array/includes.js'; import { getCoreStorageManager } from './storageManager.js'; @@ -18,7 +21,7 @@ export const USERSYNC_DEFAULT_CONFIG = { // Set userSync default values config.setDefaults({ - 'userSync': utils.deepClone(USERSYNC_DEFAULT_CONFIG) + 'userSync': deepClone(USERSYNC_DEFAULT_CONFIG) }); const storage = getCoreStorageManager('usersync'); @@ -54,7 +57,7 @@ export function newUserSync(userSyncDependencies) { // if userSync.filterSettings does not contain image/all configs, merge in default image config to ensure image pixels are fired if (conf.userSync) { let fs = conf.userSync.filterSettings; - if (utils.isPlainObject(fs)) { + if (isPlainObject(fs)) { if (!fs.image && !fs.all) { conf.userSync.filterSettings.image = { bidders: '*', @@ -96,7 +99,7 @@ export function newUserSync(userSyncDependencies) { // Image pixels fireImagePixels(); } catch (e) { - return utils.logError('Error firing user syncs', e); + return logError('Error firing user syncs', e); } // Reset the user sync queue queue = getDefaultQueue(); @@ -106,7 +109,7 @@ export function newUserSync(userSyncDependencies) { // Randomize the order of the pixels before firing // This is to avoid giving any bidder who has registered multiple syncs // any preferential treatment and balancing them out - utils.shuffle(queue).forEach((sync) => { + shuffle(queue).forEach((sync) => { fn(sync); hasFiredBidder.add(sync[0]); }); @@ -123,9 +126,9 @@ export function newUserSync(userSyncDependencies) { } forEachFire(queue.image, (sync) => { let [bidderName, trackingPixelUrl] = sync; - utils.logMessage(`Invoking image pixel user sync for bidder: ${bidderName}`); + logMessage(`Invoking image pixel user sync for bidder: ${bidderName}`); // Create image object and add the src url - utils.triggerPixel(trackingPixelUrl); + triggerPixel(trackingPixelUrl); }); } @@ -141,9 +144,9 @@ export function newUserSync(userSyncDependencies) { forEachFire(queue.iframe, (sync) => { let [bidderName, iframeUrl] = sync; - utils.logMessage(`Invoking iframe user sync for bidder: ${bidderName}`); + logMessage(`Invoking iframe user sync for bidder: ${bidderName}`); // Insert iframe into DOM - utils.insertUserSyncIframe(iframeUrl); + insertUserSyncIframe(iframeUrl); // for a bidder, if iframe sync is present then remove image pixel removeImagePixelsForBidder(queue, bidderName); }); @@ -187,21 +190,21 @@ export function newUserSync(userSyncDependencies) { */ publicApi.registerSync = (type, bidder, url) => { if (hasFiredBidder.has(bidder)) { - return utils.logMessage(`already fired syncs for "${bidder}", ignoring registerSync call`); + return logMessage(`already fired syncs for "${bidder}", ignoring registerSync call`); } - if (!usConfig.syncEnabled || !utils.isArray(queue[type])) { - return utils.logWarn(`User sync type "${type}" not supported`); + if (!usConfig.syncEnabled || !isArray(queue[type])) { + return logWarn(`User sync type "${type}" not supported`); } if (!bidder) { - return utils.logWarn(`Bidder is required for registering sync`); + return logWarn(`Bidder is required for registering sync`); } if (usConfig.syncsPerBidder !== 0 && Number(numAdapterBids[bidder]) >= usConfig.syncsPerBidder) { - return utils.logWarn(`Number of user syncs exceeded for "${bidder}"`); + return logWarn(`Number of user syncs exceeded for "${bidder}"`); } const canBidderRegisterSync = publicApi.canBidderRegisterSync(type, bidder); if (!canBidderRegisterSync) { - return utils.logWarn(`Bidder "${bidder}" not permitted to register their "${type}" userSync pixels.`); + return logWarn(`Bidder "${bidder}" not permitted to register their "${type}" userSync pixels.`); } // the bidder's pixel has passed all checks and is allowed to register @@ -248,7 +251,7 @@ export function newUserSync(userSyncDependencies) { */ function isFilterConfigValid(filterConfig, type) { if (filterConfig.all && filterConfig[type]) { - utils.logWarn(`Detected presence of the "filterSettings.all" and "filterSettings.${type}" in userSync config. You cannot mix "all" with "iframe/image" configs; they are mutually exclusive.`); + logWarn(`Detected presence of the "filterSettings.all" and "filterSettings.${type}" in userSync config. You cannot mix "all" with "iframe/image" configs; they are mutually exclusive.`); return false; } @@ -265,12 +268,12 @@ export function newUserSync(userSyncDependencies) { let biddersField = activeConfig.bidders; if (filterField && filterField !== 'include' && filterField !== 'exclude') { - utils.logWarn(`UserSync "filterSettings.${activeConfigName}.filter" setting '${filterField}' is not a valid option; use either 'include' or 'exclude'.`); + logWarn(`UserSync "filterSettings.${activeConfigName}.filter" setting '${filterField}' is not a valid option; use either 'include' or 'exclude'.`); return false; } - if (biddersField !== '*' && !(Array.isArray(biddersField) && biddersField.length > 0 && biddersField.every(bidderInList => utils.isStr(bidderInList) && bidderInList !== '*'))) { - utils.logWarn(`Detected an invalid setup in userSync "filterSettings.${activeConfigName}.bidders"; use either '*' (to represent all bidders) or an array of bidders.`); + if (biddersField !== '*' && !(Array.isArray(biddersField) && biddersField.length > 0 && biddersField.every(bidderInList => isStr(bidderInList) && bidderInList !== '*'))) { + logWarn(`Detected an invalid setup in userSync "filterSettings.${activeConfigName}.bidders"; use either '*' (to represent all bidders) or an array of bidders.`); return false; } @@ -312,7 +315,7 @@ export function newUserSync(userSyncDependencies) { return publicApi; } -const browserSupportsCookies = !utils.isSafariBrowser() && storage.cookiesAreEnabled(); +const browserSupportsCookies = !isSafariBrowser() && storage.cookiesAreEnabled(); export const userSync = newUserSync({ config: config.getConfig('userSync'), diff --git a/src/videoCache.js b/src/videoCache.js index 9e378d90574..57618024c32 100644 --- a/src/videoCache.js +++ b/src/videoCache.js @@ -11,7 +11,7 @@ import { ajax } from './ajax.js'; import { config } from './config.js'; -import * as utils from './utils.js'; +import { isPlainObject } from './utils.js'; /** * @typedef {object} CacheableUrlBid @@ -73,7 +73,7 @@ function toStorageRequest(bid) { payload.bidid = bid.requestId; payload.aid = bid.auctionId; // function has a thisArg set to bidderRequest for accessing the auctionStart - if (utils.isPlainObject(this) && this.hasOwnProperty('auctionStart')) { + if (isPlainObject(this) && this.hasOwnProperty('auctionStart')) { payload.timestamp = this.auctionStart; } } From b815976146d912c533395c71a9e9679fc62ae536 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 11:55:13 -0700 Subject: [PATCH 105/250] Key Prebid Modules: import only what is needed from utils (#7468) * validationFPDModule: import only what is needed from utils * userIdModule: import only what is needed from utils * rtdModule: import only what is needed from utils * PBS: import only what is needed from utils * multibid: import only what is needed from utils --- modules/multibid/index.js | 28 ++-- modules/prebidServerBidAdapter/index.js | 212 ++++++++++++------------ modules/rtdModule/index.js | 6 +- modules/userId/eids.js | 18 +- modules/userId/index.js | 72 ++++---- modules/validationFpdModule/index.js | 30 ++-- 6 files changed, 187 insertions(+), 179 deletions(-) diff --git a/modules/multibid/index.js b/modules/multibid/index.js index dd4999b2dca..cf4821de183 100644 --- a/modules/multibid/index.js +++ b/modules/multibid/index.js @@ -5,7 +5,9 @@ import {config} from '../../src/config.js'; import {setupBeforeHookFnOnce, getHook} from '../../src/hook.js'; -import * as utils from '../../src/utils.js'; +import { + logWarn, deepAccess, getUniqueIdentifierStr, deepSetValue, groupBy +} from '../../src/utils.js'; import events from '../../src/events.js'; import CONSTANTS from '../../src/constants.json'; import {addBidderRequests} from '../../src/auction.js'; @@ -50,7 +52,7 @@ export function validateMultibid(conf) { let duplicate = conf.filter(entry => { // Check if entry.bidder is not defined or typeof string, filter entry and reset configuration if ((!entry.bidder || typeof entry.bidder !== 'string') && (!entry.bidders || !Array.isArray(entry.bidders))) { - utils.logWarn('Filtering multibid entry. Missing required bidder or bidders property.'); + logWarn('Filtering multibid entry. Missing required bidder or bidders property.'); check = false; return false; } @@ -97,26 +99,26 @@ export function adjustBidderRequestsHook(fn, bidderRequests) { * @param {Object} bid object */ export function addBidResponseHook(fn, adUnitCode, bid) { - let floor = utils.deepAccess(bid, 'floorData.floorValue'); + let floor = deepAccess(bid, 'floorData.floorValue'); if (!config.getConfig('multibid')) resetMultiConfig(); // Checks if multiconfig exists and bid bidderCode exists within config and is an adpod bid // Else checks if multiconfig exists and bid bidderCode exists within config // Else continue with no modifications - if (hasMultibid && multiConfig[bid.bidderCode] && utils.deepAccess(bid, 'video.context') === 'adpod') { + if (hasMultibid && multiConfig[bid.bidderCode] && deepAccess(bid, 'video.context') === 'adpod') { fn.call(this, adUnitCode, bid); } else if (hasMultibid && multiConfig[bid.bidderCode]) { // Set property multibidPrefix on bid if (multiConfig[bid.bidderCode].prefix) bid.multibidPrefix = multiConfig[bid.bidderCode].prefix; bid.originalBidder = bid.bidderCode; // Check if stored bids for auction include adUnitCode.bidder and max limit not reach for ad unit - if (utils.deepAccess(multibidUnits, `${adUnitCode}.${bid.bidderCode}`)) { + if (deepAccess(multibidUnits, `${adUnitCode}.${bid.bidderCode}`)) { // Store request id under new property originalRequestId, create new unique bidId, // and push bid into multibid stored bids for auction if max not reached and bid cpm above floor if (!multibidUnits[adUnitCode][bid.bidderCode].maxReached && (!floor || floor <= bid.cpm)) { bid.originalRequestId = bid.requestId; - bid.requestId = utils.getUniqueIdentifierStr(); + bid.requestId = getUniqueIdentifierStr(); multibidUnits[adUnitCode][bid.bidderCode].ads.push(bid); let length = multibidUnits[adUnitCode][bid.bidderCode].ads.length; @@ -126,12 +128,12 @@ export function addBidResponseHook(fn, adUnitCode, bid) { fn.call(this, adUnitCode, bid); } else { - utils.logWarn(`Filtering multibid received from bidder ${bid.bidderCode}: ` + ((multibidUnits[adUnitCode][bid.bidderCode].maxReached) ? `Maximum bid limit reached for ad unit code ${adUnitCode}` : 'Bid cpm under floors value.')); + logWarn(`Filtering multibid received from bidder ${bid.bidderCode}: ` + ((multibidUnits[adUnitCode][bid.bidderCode].maxReached) ? `Maximum bid limit reached for ad unit code ${adUnitCode}` : 'Bid cpm under floors value.')); } } else { - if (utils.deepAccess(bid, 'floorData.floorValue')) utils.deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {floor: utils.deepAccess(bid, 'floorData.floorValue')}); + if (deepAccess(bid, 'floorData.floorValue')) deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {floor: deepAccess(bid, 'floorData.floorValue')}); - utils.deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {ads: [bid]}); + deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {ads: [bid]}); if (multibidUnits[adUnitCode][bid.bidderCode].ads.length === multiConfig[bid.bidderCode].maxbids) multibidUnits[adUnitCode][bid.bidderCode].maxReached = true; fn.call(this, adUnitCode, bid); @@ -170,11 +172,11 @@ export function targetBidPoolHook(fn, bidsReceived, highestCpmCallback, adUnitBi if (hasMultibid) { const dealPrioritization = config.getConfig('sendBidsControl.dealPrioritization'); let modifiedBids = []; - let buckets = utils.groupBy(bidsReceived, 'adUnitCode'); + let buckets = groupBy(bidsReceived, 'adUnitCode'); let bids = [].concat.apply([], Object.keys(buckets).reduce((result, slotId) => { let bucketBids = []; // Get bids and group by property originalBidder - let bidsByBidderName = utils.groupBy(buckets[slotId], 'originalBidder'); + let bidsByBidderName = groupBy(buckets[slotId], 'originalBidder'); let adjustedBids = [].concat.apply([], Object.keys(bidsByBidderName).map(key => { // Reset all bidderCodes to original bidder values and sort by CPM return bidsByBidderName[key].sort((bidA, bidB) => { @@ -183,7 +185,7 @@ export function targetBidPoolHook(fn, bidsReceived, highestCpmCallback, adUnitBi return bidA.cpm > bidB.cpm ? -1 : (bidA.cpm < bidB.cpm ? 1 : 0); }).map((bid, index) => { // For each bid (post CPM sort), set dynamic bidderCode using prefix and index if less than maxbid amount - if (utils.deepAccess(multiConfig, `${bid.bidderCode}.prefix`) && index !== 0 && index < multiConfig[bid.bidderCode].maxbids) { + if (deepAccess(multiConfig, `${bid.bidderCode}.prefix`) && index !== 0 && index < multiConfig[bid.bidderCode].maxbids) { bid.bidderCode = multiConfig[bid.bidderCode].prefix + (index + 1); } @@ -191,7 +193,7 @@ export function targetBidPoolHook(fn, bidsReceived, highestCpmCallback, adUnitBi }) })); // Get adjustedBids by bidderCode and reduce using highestCpmCallback - let bidsByBidderCode = utils.groupBy(adjustedBids, 'bidderCode'); + let bidsByBidderCode = groupBy(adjustedBids, 'bidderCode'); Object.keys(bidsByBidderCode).forEach(key => bucketBids.push(bidsByBidderCode[key].reduce(highestCpmCallback))); // if adUnitBidLimit is set, pass top N number bids if (adUnitBidLimit > 0) { diff --git a/modules/prebidServerBidAdapter/index.js b/modules/prebidServerBidAdapter/index.js index d7caf0dbad8..245cb7fc0b0 100644 --- a/modules/prebidServerBidAdapter/index.js +++ b/modules/prebidServerBidAdapter/index.js @@ -1,6 +1,11 @@ import Adapter from '../../src/adapter.js'; import { createBid } from '../../src/bidfactory.js'; -import * as utils from '../../src/utils.js'; +import { + getPrebidInternal, logError, isStr, isPlainObject, logWarn, generateUUID, bind, logMessage, + triggerPixel, insertUserSyncIframe, deepAccess, mergeDeep, deepSetValue, cleanObj, parseSizesInput, + getBidRequest, getDefinedParams, createTrackPixelHtml, pick, deepClone, uniques, flatten, isNumber, + isEmpty, isArray, logInfo +} from '../../src/utils.js'; import CONSTANTS from '../../src/constants.json'; import adapterManager from '../../src/adapterManager.js'; import { config } from '../../src/config.js'; @@ -12,7 +17,6 @@ import includes from 'core-js-pure/features/array/includes.js'; import { S2S_VENDORS } from './config.js'; import { ajax } from '../../src/ajax.js'; import find from 'core-js-pure/features/array/find.js'; -import { getPrebidInternal } from '../../src/utils.js'; const getConfig = config.getConfig; @@ -100,7 +104,7 @@ function updateConfigDefaultVendor(option) { } }); } else { - utils.logError('Incorrect or unavailable prebid server default vendor option: ' + vendor); + logError('Incorrect or unavailable prebid server default vendor option: ' + vendor); return false; } } @@ -116,7 +120,7 @@ function validateConfigRequiredProps(option) { const keys = Object.keys(option); if (['accountId', 'bidders', 'endpoint'].filter(key => { if (!includes(keys, key)) { - utils.logError(key + ' missing in server to server config'); + logError(key + ' missing in server to server config'); return true; } return false; @@ -129,14 +133,14 @@ function validateConfigRequiredProps(option) { // could be removed later as part of a major release, if we decide to not support the old format function formatUrlParams(option) { ['endpoint', 'syncEndpoint'].forEach((prop) => { - if (utils.isStr(option[prop])) { + if (isStr(option[prop])) { let temp = option[prop]; option[prop] = { p1Consent: temp, noP1Consent: temp }; } - if (utils.isPlainObject(option[prop]) && (!option[prop].p1Consent || !option[prop].noP1Consent)) { + if (isPlainObject(option[prop]) && (!option[prop].p1Consent || !option[prop].noP1Consent)) { ['p1Consent', 'noP1Consent'].forEach((conUrl) => { if (!option[prop][conUrl]) { - utils.logWarn(`s2sConfig.${prop}.${conUrl} not defined. PBS request will be skipped in some P1 scenarios.`); + logWarn(`s2sConfig.${prop}.${conUrl} not defined. PBS request will be skipped in some P1 scenarios.`); } }); } @@ -171,7 +175,7 @@ function setS2sConfig(options) { return true; } } - utils.logWarn('prebidServer: s2s config is disabled'); + logWarn('prebidServer: s2s config is disabled'); return false; }); @@ -198,13 +202,13 @@ function queueSync(bidderCodes, gdprConsent, uspConsent, s2sConfig) { _syncCount++; const payload = { - uuid: utils.generateUUID(), + uuid: generateUUID(), bidders: bidderCodes, account: s2sConfig.accountId }; let userSyncLimit = s2sConfig.userSyncLimit; - if (utils.isNumber(userSyncLimit) && userSyncLimit > 0) { + if (isNumber(userSyncLimit) && userSyncLimit > 0) { payload['limit'] = userSyncLimit; } @@ -232,7 +236,7 @@ function queueSync(bidderCodes, gdprConsent, uspConsent, s2sConfig) { response = JSON.parse(response); doAllSyncs(response.bidder_status, s2sConfig); } catch (e) { - utils.logError(e); + logError(e); } }, jsonPayload, @@ -252,7 +256,7 @@ function doAllSyncs(bidders, s2sConfig) { // if PBS reports this bidder doesn't have an ID, then call the sync and recurse to the next sync entry if (thisSync.no_cookie) { - doPreBidderSync(thisSync.usersync.type, thisSync.usersync.url, thisSync.bidder, utils.bind.call(doAllSyncs, null, bidders, s2sConfig), s2sConfig); + doPreBidderSync(thisSync.usersync.type, thisSync.usersync.url, thisSync.bidder, bind.call(doAllSyncs, null, bidders, s2sConfig), s2sConfig); } else { // bidder already has an ID, so just recurse to the next sync entry doAllSyncs(bidders, s2sConfig); @@ -287,16 +291,16 @@ function doPreBidderSync(type, url, bidder, done, s2sConfig) { */ function doBidderSync(type, url, bidder, done) { if (!url) { - utils.logError(`No sync url for bidder "${bidder}": ${url}`); + logError(`No sync url for bidder "${bidder}": ${url}`); done(); } else if (type === 'image' || type === 'redirect') { - utils.logMessage(`Invoking image pixel user sync for bidder: "${bidder}"`); - utils.triggerPixel(url, done); + logMessage(`Invoking image pixel user sync for bidder: "${bidder}"`); + triggerPixel(url, done); } else if (type == 'iframe') { - utils.logMessage(`Invoking iframe user sync for bidder: "${bidder}"`); - utils.insertUserSyncIframe(url, done); + logMessage(`Invoking iframe user sync for bidder: "${bidder}"`); + insertUserSyncIframe(url, done); } else { - utils.logError(`User sync type "${type}" not supported for bidder: "${bidder}"`); + logError(`User sync type "${type}" not supported for bidder: "${bidder}"`); done(); } } @@ -312,7 +316,7 @@ function doClientSideSyncs(bidders, gdprConsent, uspConsent) { if (clientAdapter && clientAdapter.registerSyncs) { config.runWithBidder( bidder, - utils.bind.call( + bind.call( clientAdapter.registerSyncs, clientAdapter, [], @@ -333,12 +337,12 @@ function _appendSiteAppDevice(request, pageUrl, accountId) { request.app.publisher = {id: accountId} } else { request.site = {}; - if (utils.isPlainObject(config.getConfig('site'))) { + if (isPlainObject(config.getConfig('site'))) { request.site = config.getConfig('site'); } // set publisher.id if not already defined - if (!utils.deepAccess(request.site, 'publisher.id')) { - utils.deepSetValue(request.site, 'publisher.id', accountId); + if (!deepAccess(request.site, 'publisher.id')) { + deepSetValue(request.site, 'publisher.id', accountId); } // set site.page if not already defined if (!request.site.page) { @@ -364,7 +368,7 @@ function addBidderFirstPartyDataToRequest(request) { const fpdConfigs = Object.keys(bidderConfig).reduce((acc, bidder) => { const currBidderConfig = bidderConfig[bidder]; if (currBidderConfig.ortb2) { - const ortb2 = utils.mergeDeep({}, currBidderConfig.ortb2); + const ortb2 = mergeDeep({}, currBidderConfig.ortb2); acc.push({ bidders: [ bidder ], @@ -375,7 +379,7 @@ function addBidderFirstPartyDataToRequest(request) { }, []); if (fpdConfigs.length) { - utils.deepSetValue(request, 'ext.prebid.bidderconfig', fpdConfigs); + deepSetValue(request, 'ext.prebid.bidderconfig', fpdConfigs); } } @@ -442,13 +446,13 @@ let wurlMap = {}; * @param {string} wurl events.winurl passed from prebidServer as wurl */ function addWurl(auctionId, adId, wurl) { - if ([auctionId, adId].every(utils.isStr)) { + if ([auctionId, adId].every(isStr)) { wurlMap[`${auctionId}${adId}`] = wurl; } } function getPbsResponseData(bidderRequests, response, pbsName, pbjsName) { - const bidderValues = utils.deepAccess(response, `ext.${pbsName}`); + const bidderValues = deepAccess(response, `ext.${pbsName}`); if (bidderValues) { Object.keys(bidderValues).forEach(bidder => { let biddersReq = find(bidderRequests, bidderReq => bidderReq.bidderCode === bidder); @@ -464,7 +468,7 @@ function getPbsResponseData(bidderRequests, response, pbsName, pbjsName) { * @param {string} adId generated value set to bidObject.adId by bidderFactory Bid() */ function removeWurl(auctionId, adId) { - if ([auctionId, adId].every(utils.isStr)) { + if ([auctionId, adId].every(isStr)) { wurlMap[`${auctionId}${adId}`] = undefined; } } @@ -474,7 +478,7 @@ function removeWurl(auctionId, adId) { * @return {(string|undefined)} events.winurl which was passed as wurl */ function getWurl(auctionId, adId) { - if ([auctionId, adId].every(utils.isStr)) { + if ([auctionId, adId].every(isStr)) { return wurlMap[`${auctionId}${adId}`]; } } @@ -506,7 +510,7 @@ const OPEN_RTB_PROTOCOL = { } impIds.add(impressionId); - const nativeParams = processNativeAdUnitParams(utils.deepAccess(adUnit, 'mediaTypes.native')); + const nativeParams = processNativeAdUnitParams(deepAccess(adUnit, 'mediaTypes.native')); let nativeAssets; if (nativeParams) { try { @@ -516,19 +520,19 @@ const OPEN_RTB_PROTOCOL = { function newAsset(obj) { return Object.assign({ required: params.required ? 1 : 0 - }, obj ? utils.cleanObj(obj) : {}); + }, obj ? cleanObj(obj) : {}); } switch (type) { case 'image': case 'icon': let imgTypeId = nativeImgIdMap[type]; - let asset = utils.cleanObj({ + let asset = cleanObj({ type: imgTypeId, - w: utils.deepAccess(params, 'sizes.0'), - h: utils.deepAccess(params, 'sizes.1'), - wmin: utils.deepAccess(params, 'aspect_ratios.0.min_width'), - hmin: utils.deepAccess(params, 'aspect_ratios.0.min_height') + w: deepAccess(params, 'sizes.0'), + h: deepAccess(params, 'sizes.1'), + wmin: deepAccess(params, 'aspect_ratios.0.min_width'), + hmin: deepAccess(params, 'aspect_ratios.0.min_height') }); if (!((asset.w && asset.h) || (asset.hmin && asset.wmin))) { throw 'invalid img sizes (must provide sizes or min_height & min_width if using aspect_ratios)'; @@ -569,11 +573,11 @@ const OPEN_RTB_PROTOCOL = { return assets; }, []); } catch (e) { - utils.logError('error creating native request: ' + String(e)) + logError('error creating native request: ' + String(e)) } } - const videoParams = utils.deepAccess(adUnit, 'mediaTypes.video'); - const bannerParams = utils.deepAccess(adUnit, 'mediaTypes.banner'); + const videoParams = deepAccess(adUnit, 'mediaTypes.video'); + const bannerParams = deepAccess(adUnit, 'mediaTypes.banner'); adUnit.bids.forEach(bid => { // OpenRTB response contains imp.id and bidder name. These are @@ -592,7 +596,7 @@ const OPEN_RTB_PROTOCOL = { let mediaTypes = {}; if (bannerParams && bannerParams.sizes) { - const sizes = utils.parseSizesInput(bannerParams.sizes); + const sizes = parseSizesInput(bannerParams.sizes); // get banner sizes in form [{ w: , h: }, ...] const format = sizes.map(size => { @@ -607,10 +611,10 @@ const OPEN_RTB_PROTOCOL = { if (bannerParams.pos) mediaTypes['banner'].pos = bannerParams.pos; } - if (!utils.isEmpty(videoParams)) { + if (!isEmpty(videoParams)) { if (videoParams.context === 'outstream' && !videoParams.renderer && !adUnit.renderer) { // Don't push oustream w/o renderer to request object. - utils.logError('Outstream bid without renderer cannot be sent to Prebid Server.'); + logError('Outstream bid without renderer cannot be sent to Prebid Server.'); } else { if (videoParams.context === 'instream' && !videoParams.hasOwnProperty('placement')) { videoParams.placement = 1; @@ -619,8 +623,8 @@ const OPEN_RTB_PROTOCOL = { mediaTypes['video'] = Object.keys(videoParams).filter(param => param !== 'context') .reduce((result, param) => { if (param === 'playerSize') { - result.w = utils.deepAccess(videoParams, `${param}.0.0`); - result.h = utils.deepAccess(videoParams, `${param}.0.1`); + result.w = deepAccess(videoParams, `${param}.0.0`); + result.h = deepAccess(videoParams, `${param}.0.1`); } else { result[param] = videoParams[param]; } @@ -646,7 +650,7 @@ const OPEN_RTB_PROTOCOL = { ver: '1.2' } } catch (e) { - utils.logError('error creating native request: ' + String(e)) + logError('error creating native request: ' + String(e)) } } @@ -659,11 +663,11 @@ const OPEN_RTB_PROTOCOL = { } acc[bid.bidder] = (s2sConfig.adapterOptions && s2sConfig.adapterOptions[bid.bidder]) ? Object.assign({}, bid.params, s2sConfig.adapterOptions[bid.bidder]) : bid.params; return acc; - }, {...utils.deepAccess(adUnit, 'ortb2Imp.ext')}); + }, {...deepAccess(adUnit, 'ortb2Imp.ext')}); const imp = { id: impressionId, ext, secure: s2sConfig.secure }; - const ortb2 = {...utils.deepAccess(adUnit, 'ortb2Imp.ext.data')}; + const ortb2 = {...deepAccess(adUnit, 'ortb2Imp.ext.data')}; Object.keys(ortb2).forEach(prop => { /** * Prebid AdSlot @@ -671,7 +675,7 @@ const OPEN_RTB_PROTOCOL = { */ if (prop === 'pbadslot') { if (typeof ortb2[prop] === 'string' && ortb2[prop]) { - utils.deepSetValue(imp, 'ext.data.pbadslot', ortb2[prop]); + deepSetValue(imp, 'ext.data.pbadslot', ortb2[prop]); } else { // remove pbadslot property if it doesn't meet the spec delete imp.ext.data.pbadslot; @@ -682,13 +686,13 @@ const OPEN_RTB_PROTOCOL = { */ ['name', 'adslot'].forEach(name => { /** @type {(string|undefined)} */ - const value = utils.deepAccess(ortb2, `adserver.${name}`); + const value = deepAccess(ortb2, `adserver.${name}`); if (typeof value === 'string' && value) { - utils.deepSetValue(imp, `ext.data.adserver.${name.toLowerCase()}`, value); + deepSetValue(imp, `ext.data.adserver.${name.toLowerCase()}`, value); } }); } else { - utils.deepSetValue(imp, `ext.data.${prop}`, ortb2[prop]); + deepSetValue(imp, `ext.data.${prop}`, ortb2[prop]); } }); @@ -697,7 +701,7 @@ const OPEN_RTB_PROTOCOL = { // if storedAuctionResponse has been set, pass SRID const storedAuctionResponseBid = find(firstBidRequest.bids, bid => (bid.adUnitCode === adUnit.code && bid.storedAuctionResponse)); if (storedAuctionResponseBid) { - utils.deepSetValue(imp, 'ext.prebid.storedauctionresponse.id', storedAuctionResponseBid.storedAuctionResponse.toString()); + deepSetValue(imp, 'ext.prebid.storedauctionresponse.id', storedAuctionResponseBid.storedAuctionResponse.toString()); } const getFloorBid = find(firstBidRequest.bids, bid => bid.adUnitCode === adUnit.code && typeof bid.getFloor === 'function'); @@ -709,7 +713,7 @@ const OPEN_RTB_PROTOCOL = { currency: config.getConfig('currency.adServerCurrency') || DEFAULT_S2S_CURRENCY, }); } catch (e) { - utils.logError('PBS: getFloor threw an error: ', e); + logError('PBS: getFloor threw an error: ', e); } if (floorInfo && floorInfo.currency && !isNaN(parseFloat(floorInfo.floor))) { imp.bidfloor = parseFloat(floorInfo.floor); @@ -723,7 +727,7 @@ const OPEN_RTB_PROTOCOL = { }); if (!imps.length) { - utils.logError('Request to Prebid Server rejected due to invalid media type(s) in adUnit.'); + logError('Request to Prebid Server rejected due to invalid media type(s) in adUnit.'); return; } const request = { @@ -775,36 +779,36 @@ const OPEN_RTB_PROTOCOL = { _appendSiteAppDevice(request, bidRequests[0].refererInfo.referer, s2sConfig.accountId); // pass schain object if it is present - const schain = utils.deepAccess(bidRequests, '0.bids.0.schain'); + const schain = deepAccess(bidRequests, '0.bids.0.schain'); if (schain) { request.source.ext = { schain: schain }; } - if (!utils.isEmpty(aliases)) { + if (!isEmpty(aliases)) { request.ext.prebid.aliases = {...request.ext.prebid.aliases, ...aliases}; } - const bidUserIdAsEids = utils.deepAccess(bidRequests, '0.bids.0.userIdAsEids'); - if (utils.isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { - utils.deepSetValue(request, 'user.ext.eids', bidUserIdAsEids); + const bidUserIdAsEids = deepAccess(bidRequests, '0.bids.0.userIdAsEids'); + if (isArray(bidUserIdAsEids) && bidUserIdAsEids.length > 0) { + deepSetValue(request, 'user.ext.eids', bidUserIdAsEids); } - if (utils.isArray(eidPermissions) && eidPermissions.length > 0) { - if (requestedBidders && utils.isArray(requestedBidders)) { + if (isArray(eidPermissions) && eidPermissions.length > 0) { + if (requestedBidders && isArray(requestedBidders)) { eidPermissions.forEach(i => { if (i.bidders) { i.bidders = i.bidders.filter(bidder => requestedBidders.includes(bidder)) } }); } - utils.deepSetValue(request, 'ext.prebid.data.eidpermissions', eidPermissions); + deepSetValue(request, 'ext.prebid.data.eidpermissions', eidPermissions); } const multibid = config.getConfig('multibid'); if (multibid) { - utils.deepSetValue(request, 'ext.prebid.multibid', multibid.reduce((result, i) => { + deepSetValue(request, 'ext.prebid.multibid', multibid.reduce((result, i) => { let obj = {}; Object.keys(i).forEach(key => { @@ -824,25 +828,25 @@ const OPEN_RTB_PROTOCOL = { if (typeof firstBidRequest.gdprConsent.gdprApplies === 'boolean') { gdprApplies = firstBidRequest.gdprConsent.gdprApplies ? 1 : 0; } - utils.deepSetValue(request, 'regs.ext.gdpr', gdprApplies); - utils.deepSetValue(request, 'user.ext.consent', firstBidRequest.gdprConsent.consentString); + deepSetValue(request, 'regs.ext.gdpr', gdprApplies); + deepSetValue(request, 'user.ext.consent', firstBidRequest.gdprConsent.consentString); if (firstBidRequest.gdprConsent.addtlConsent && typeof firstBidRequest.gdprConsent.addtlConsent === 'string') { - utils.deepSetValue(request, 'user.ext.ConsentedProvidersSettings.consented_providers', firstBidRequest.gdprConsent.addtlConsent); + deepSetValue(request, 'user.ext.ConsentedProvidersSettings.consented_providers', firstBidRequest.gdprConsent.addtlConsent); } } // US Privacy (CCPA) support if (firstBidRequest.uspConsent) { - utils.deepSetValue(request, 'regs.ext.us_privacy', firstBidRequest.uspConsent); + deepSetValue(request, 'regs.ext.us_privacy', firstBidRequest.uspConsent); } } if (getConfig('coppa') === true) { - utils.deepSetValue(request, 'regs.coppa', 1); + deepSetValue(request, 'regs.coppa', 1); } const commonFpd = getConfig('ortb2') || {}; - utils.mergeDeep(request, commonFpd); + mergeDeep(request, commonFpd); addBidderFirstPartyDataToRequest(request); @@ -862,7 +866,7 @@ const OPEN_RTB_PROTOCOL = { let bidRequest; let key = `${bid.impid}${seatbid.seat}`; if (bidIdMap[key]) { - bidRequest = utils.getBidRequest( + bidRequest = getBidRequest( bidIdMap[key], bidderRequests ); @@ -879,31 +883,31 @@ const OPEN_RTB_PROTOCOL = { // temporarily leaving attaching it to each bidResponse so no breaking change // BUT: this is a flat map, so it should be only attached to bidderRequest, a the change above does - let serverResponseTimeMs = utils.deepAccess(response, ['ext', 'responsetimemillis', seatbid.seat].join('.')); + let serverResponseTimeMs = deepAccess(response, ['ext', 'responsetimemillis', seatbid.seat].join('.')); if (bidRequest && serverResponseTimeMs) { bidRequest.serverResponseTimeMs = serverResponseTimeMs; } // Look for seatbid[].bid[].ext.prebid.bidid and place it in the bidResponse object for use in analytics adapters as 'pbsBidId' - const bidId = utils.deepAccess(bid, 'ext.prebid.bidid'); - if (utils.isStr(bidId)) { + const bidId = deepAccess(bid, 'ext.prebid.bidid'); + if (isStr(bidId)) { bidObject.pbsBidId = bidId; } // store wurl by auctionId and adId so it can be accessed from the BID_WON event handler - if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.events.win'))) { - addWurl(bidRequest.auctionId, bidObject.adId, utils.deepAccess(bid, 'ext.prebid.events.win')); + if (isStr(deepAccess(bid, 'ext.prebid.events.win'))) { + addWurl(bidRequest.auctionId, bidObject.adId, deepAccess(bid, 'ext.prebid.events.win')); } - let extPrebidTargeting = utils.deepAccess(bid, 'ext.prebid.targeting'); + let extPrebidTargeting = deepAccess(bid, 'ext.prebid.targeting'); // If ext.prebid.targeting exists, add it as a property value named 'adserverTargeting' // The removal of hb_winurl and hb_bidid targeting values is temporary // once we get through the transition, this block will be removed. - if (utils.isPlainObject(extPrebidTargeting)) { + if (isPlainObject(extPrebidTargeting)) { // If wurl exists, remove hb_winurl and hb_bidid targeting attributes - if (utils.isStr(utils.deepAccess(bid, 'ext.prebid.events.win'))) { - extPrebidTargeting = utils.getDefinedParams(extPrebidTargeting, Object.keys(extPrebidTargeting) + if (isStr(deepAccess(bid, 'ext.prebid.events.win'))) { + extPrebidTargeting = getDefinedParams(extPrebidTargeting, Object.keys(extPrebidTargeting) .filter(i => (i.indexOf('hb_winurl') === -1 && i.indexOf('hb_bidid') === -1))); } bidObject.adserverTargeting = extPrebidTargeting; @@ -911,7 +915,7 @@ const OPEN_RTB_PROTOCOL = { bidObject.seatBidId = bid.id; - if (utils.deepAccess(bid, 'ext.prebid.type') === VIDEO) { + if (deepAccess(bid, 'ext.prebid.type') === VIDEO) { bidObject.mediaType = VIDEO; let sizes = bidRequest.sizes && bidRequest.sizes[0]; bidObject.playerWidth = sizes[0]; @@ -930,7 +934,7 @@ const OPEN_RTB_PROTOCOL = { if (bid.adm) { bidObject.vastXml = bid.adm; } if (!bidObject.vastUrl && bid.nurl) { bidObject.vastUrl = bid.nurl; } - } else if (utils.deepAccess(bid, 'ext.prebid.type') === NATIVE) { + } else if (deepAccess(bid, 'ext.prebid.type') === NATIVE) { bidObject.mediaType = NATIVE; let adm; if (typeof bid.adm === 'string') { @@ -956,18 +960,18 @@ const OPEN_RTB_PROTOCOL = { }); } - if (utils.isPlainObject(adm) && Array.isArray(adm.assets)) { + if (isPlainObject(adm) && Array.isArray(adm.assets)) { let origAssets = nativeAssetCache[bid.impid]; - bidObject.native = utils.cleanObj(adm.assets.reduce((native, asset) => { + bidObject.native = cleanObj(adm.assets.reduce((native, asset) => { let origAsset = origAssets[asset.id]; - if (utils.isPlainObject(asset.img)) { - native[origAsset.img.type ? nativeImgIdMap[origAsset.img.type] : 'image'] = utils.pick( + if (isPlainObject(asset.img)) { + native[origAsset.img.type ? nativeImgIdMap[origAsset.img.type] : 'image'] = pick( asset.img, ['url', 'w as width', 'h as height'] ); - } else if (utils.isPlainObject(asset.title)) { + } else if (isPlainObject(asset.title)) { native['title'] = asset.title.text - } else if (utils.isPlainObject(asset.data)) { + } else if (isPlainObject(asset.data)) { nativeDataNames.forEach(dataType => { if (nativeDataIdMap[dataType] === origAsset.data.type) { native[dataType] = asset.data.value; @@ -975,19 +979,19 @@ const OPEN_RTB_PROTOCOL = { }); } return native; - }, utils.cleanObj({ + }, cleanObj({ clickUrl: adm.link, - clickTrackers: utils.deepAccess(adm, 'link.clicktrackers'), + clickTrackers: deepAccess(adm, 'link.clicktrackers'), impressionTrackers: trackers[nativeEventTrackerMethodMap.img], javascriptTrackers: trackers[nativeEventTrackerMethodMap.js] }))); } else { - utils.logError('prebid server native response contained no assets'); + logError('prebid server native response contained no assets'); } } else { // banner if (bid.adm && bid.nurl) { bidObject.ad = bid.adm; - bidObject.ad += utils.createTrackPixelHtml(decodeURIComponent(bid.nurl)); + bidObject.ad += createTrackPixelHtml(decodeURIComponent(bid.nurl)); } else if (bid.adm) { bidObject.ad = bid.adm; } else if (bid.nurl) { @@ -1004,8 +1008,8 @@ const OPEN_RTB_PROTOCOL = { if (bid.burl) { bidObject.burl = bid.burl; } bidObject.currency = (response.cur) ? response.cur : DEFAULT_S2S_CURRENCY; bidObject.meta = {}; - let extPrebidMeta = utils.deepAccess(bid, 'ext.prebid.meta'); - if (extPrebidMeta && utils.isPlainObject(extPrebidMeta)) { bidObject.meta = utils.deepClone(extPrebidMeta); } + let extPrebidMeta = deepAccess(bid, 'ext.prebid.meta'); + if (extPrebidMeta && isPlainObject(extPrebidMeta)) { bidObject.meta = deepClone(extPrebidMeta); } if (bid.adomain) { bidObject.meta.advertiserDomains = bid.adomain; } // the OpenRTB location for "TTL" as understood by Prebid.js is "exp" (expiration). @@ -1028,9 +1032,9 @@ const OPEN_RTB_PROTOCOL = { */ function bidWonHandler(bid) { const wurl = getWurl(bid.auctionId, bid.adId); - if (utils.isStr(wurl)) { - utils.logMessage(`Invoking image pixel for wurl on BID_WIN: "${wurl}"`); - utils.triggerPixel(wurl); + if (isStr(wurl)) { + logMessage(`Invoking image pixel for wurl on BID_WIN: "${wurl}"`); + triggerPixel(wurl); // remove from wurl cache, since the wurl url was called removeWurl(bid.auctionId, bid.adId); @@ -1041,7 +1045,7 @@ function hasPurpose1Consent(gdprConsent) { let result = true; if (gdprConsent) { if (gdprConsent.gdprApplies && gdprConsent.apiVersion === 2) { - result = !!(utils.deepAccess(gdprConsent, 'vendorData.purpose.consents.1') === true); + result = !!(deepAccess(gdprConsent, 'vendorData.purpose.consents.1') === true); } } return result; @@ -1068,7 +1072,7 @@ export function PrebidServer() { /* Prebid executes this function when the page asks to send out bid requests */ baseAdapter.callBids = function(s2sBidRequest, bidRequests, addBidResponse, done, ajax) { - const adUnits = utils.deepClone(s2sBidRequest.ad_units); + const adUnits = deepClone(s2sBidRequest.ad_units); let { gdprConsent, uspConsent } = getConsentData(bidRequests); // at this point ad units should have a size array either directly or mapped so filter for that @@ -1078,9 +1082,9 @@ export function PrebidServer() { // in case config.bidders contains invalid bidders, we only process those we sent requests for const requestedBidders = validAdUnits - .map(adUnit => adUnit.bids.map(bid => bid.bidder).filter(utils.uniques)) - .reduce(utils.flatten) - .filter(utils.uniques); + .map(adUnit => adUnit.bids.map(bid => bid.bidder).filter(uniques)) + .reduce(flatten) + .filter(uniques); if (Array.isArray(_s2sConfigs)) { if (s2sBidRequest.s2sConfig && s2sBidRequest.s2sConfig.syncEndpoint && getMatchingConsentUrl(s2sBidRequest.s2sConfig.syncEndpoint, gdprConsent)) { @@ -1093,7 +1097,7 @@ export function PrebidServer() { const request = OPEN_RTB_PROTOCOL.buildRequest(s2sBidRequest, bidRequests, validAdUnits, s2sBidRequest.s2sConfig, requestedBidders); const requestJson = request && JSON.stringify(request); - utils.logInfo('BidRequest: ' + requestJson); + logInfo('BidRequest: ' + requestJson); const endpointUrl = getMatchingConsentUrl(s2sBidRequest.s2sConfig.endpoint, gdprConsent); if (request && requestJson && endpointUrl) { ajax( @@ -1106,7 +1110,7 @@ export function PrebidServer() { { contentType: 'text/plain', withCredentials: true } ); } else { - utils.logError('PBS request not made. Check endpoints.'); + logError('PBS request not made. Check endpoints.'); } } }; @@ -1134,11 +1138,11 @@ export function PrebidServer() { bidderRequests.forEach(bidderRequest => events.emit(CONSTANTS.EVENTS.BIDDER_DONE, bidderRequest)); } catch (error) { - utils.logError(error); + logError(error); } if (!result || (result.status && includes(result.status, 'Error'))) { - utils.logError('error parsing response: ', result.status); + logError('error parsing response: ', result.status); } done(); diff --git a/modules/rtdModule/index.js b/modules/rtdModule/index.js index e235868f791..7dce09f0d1d 100644 --- a/modules/rtdModule/index.js +++ b/modules/rtdModule/index.js @@ -143,7 +143,7 @@ import {config} from '../../src/config.js'; import {module} from '../../src/hook.js'; -import * as utils from '../../src/utils.js'; +import { logError, logWarn } from '../../src/utils.js'; import events from '../../src/events.js'; import CONSTANTS from '../../src/constants.json'; import {gdprDataHandler, uspDataHandler} from '../../src/adapterManager.js'; @@ -174,7 +174,7 @@ export function attachRealTimeDataProvider(submodule) { export function init(config) { const confListener = config.getConfig(MODULE_NAME, ({realTimeData}) => { if (!realTimeData.dataProviders) { - utils.logError('missing parameters for real time module'); + logError('missing parameters for real time module'); return; } confListener(); // unsubscribe config listener @@ -314,7 +314,7 @@ export function getAdUnitTargeting(auction) { if (smTargeting && typeof smTargeting === 'object') { targeting.push(smTargeting); } else { - utils.logWarn('invalid getTargetingData response for sub module', relevantSubModules[i].name); + logWarn('invalid getTargetingData response for sub module', relevantSubModules[i].name); } } // place data on auction adUnits diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 0a8e94883b4..0f159c4f33b 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -1,4 +1,4 @@ -import * as utils from '../../src/utils.js'; +import { pick, isFn, isStr, isPlainObject, deepAccess } from '../../src/utils.js'; // Each user-id sub-module is expected to mention respective config here const USER_IDS_CONFIG = { @@ -64,7 +64,7 @@ const USER_IDS_CONFIG = { return null; }, getUidExt: function(parrableId) { - const extendedData = utils.pick(parrableId, [ + const extendedData = pick(parrableId, [ 'ibaOptout', 'ccpaOptout' ]); @@ -248,11 +248,11 @@ function createEidObject(userIdData, subModuleKey) { if (conf && userIdData) { let eid = {}; eid.source = conf['source']; - const value = utils.isFn(conf['getValue']) ? conf['getValue'](userIdData) : userIdData; - if (utils.isStr(value)) { + const value = isFn(conf['getValue']) ? conf['getValue'](userIdData) : userIdData; + if (isStr(value)) { const uid = { id: value, atype: conf['atype'] }; // getUidExt - if (utils.isFn(conf['getUidExt'])) { + if (isFn(conf['getUidExt'])) { const uidExt = conf['getUidExt'](userIdData); if (uidExt) { uid.ext = uidExt; @@ -260,7 +260,7 @@ function createEidObject(userIdData, subModuleKey) { } eid.uids = [uid]; // getEidExt - if (utils.isFn(conf['getEidExt'])) { + if (isFn(conf['getEidExt'])) { const eidExt = conf['getEidExt'](userIdData); if (eidExt) { eid.ext = eidExt; @@ -297,11 +297,11 @@ export function createEidsArray(bidRequestUserId) { */ export function buildEidPermissions(submodules) { let eidPermissions = []; - submodules.filter(i => utils.isPlainObject(i.idObj) && Object.keys(i.idObj).length) + submodules.filter(i => isPlainObject(i.idObj) && Object.keys(i.idObj).length) .forEach(i => { Object.keys(i.idObj).forEach(key => { - if (utils.deepAccess(i, 'config.bidders') && Array.isArray(i.config.bidders) && - utils.deepAccess(USER_IDS_CONFIG, key + '.source')) { + if (deepAccess(i, 'config.bidders') && Array.isArray(i.config.bidders) && + deepAccess(USER_IDS_CONFIG, key + '.source')) { eidPermissions.push( { source: USER_IDS_CONFIG[key].source, diff --git a/modules/userId/index.js b/modules/userId/index.js index a6a824fe89e..b0293a9c26a 100644 --- a/modules/userId/index.js +++ b/modules/userId/index.js @@ -133,14 +133,16 @@ import find from 'core-js-pure/features/array/find.js'; import { config } from '../../src/config.js'; import events from '../../src/events.js'; -import * as utils from '../../src/utils.js'; import { getGlobal } from '../../src/prebidGlobal.js'; import { gdprDataHandler } from '../../src/adapterManager.js'; import CONSTANTS from '../../src/constants.json'; import { module, hook } from '../../src/hook.js'; import { createEidsArray, buildEidPermissions } from './eids.js'; import { getCoreStorageManager } from '../../src/storageManager.js'; -import {getPrebidInternal} from '../../src/utils.js'; +import { + getPrebidInternal, isPlainObject, logError, isArray, cyrb53Hash, deepAccess, timestamp, delayExecution, logInfo, isFn, + logWarn, isEmptyStr, isNumber +} from '../../src/utils.js'; import includes from 'core-js-pure/features/array/includes.js'; const MODULE_NAME = 'User ID'; @@ -199,7 +201,7 @@ export function setStoredValue(submodule, value) { const domainOverride = (typeof submodule.submodule.domainOverride === 'function') ? submodule.submodule.domainOverride() : null; try { - const valueStr = utils.isPlainObject(value) ? JSON.stringify(value) : value; + const valueStr = isPlainObject(value) ? JSON.stringify(value) : value; const expiresStr = (new Date(Date.now() + (storage.expires * (60 * 60 * 24 * 1000)))).toUTCString(); if (storage.type === COOKIE) { coreStorage.setCookie(storage.name, valueStr, expiresStr, 'Lax', domainOverride); @@ -214,13 +216,13 @@ export function setStoredValue(submodule, value) { } } } catch (error) { - utils.logError(error); + logError(error); } } function setPrebidServerEidPermissions(initializedSubmodules) { let setEidPermissions = getPrebidInternal().setEidPermissions; - if (typeof setEidPermissions === 'function' && utils.isArray(initializedSubmodules)) { + if (typeof setEidPermissions === 'function' && isArray(initializedSubmodules)) { setEidPermissions(buildEidPermissions(initializedSubmodules)); } } @@ -253,7 +255,7 @@ function getStoredValue(storage, key = undefined) { storedValue = JSON.parse(storedValue); } } catch (e) { - utils.logError(e); + logError(e); } return storedValue; } @@ -278,7 +280,7 @@ function makeStoredConsentDataHash(consentData) { storedConsentData.apiVersion = consentData.apiVersion; } - return utils.cyrb53Hash(JSON.stringify(storedConsentData)); + return cyrb53Hash(JSON.stringify(storedConsentData)); } /** @@ -290,7 +292,7 @@ export function setStoredConsentData(consentData) { const expiresStr = (new Date(Date.now() + (CONSENT_DATA_COOKIE_STORAGE_CONFIG.expires * (60 * 60 * 24 * 1000)))).toUTCString(); coreStorage.setCookie(CONSENT_DATA_COOKIE_STORAGE_CONFIG.name, makeStoredConsentDataHash(consentData), expiresStr, 'Lax'); } catch (error) { - utils.logError(error); + logError(error); } } @@ -302,7 +304,7 @@ function getStoredConsentData() { try { return coreStorage.getCookie(CONSENT_DATA_COOKIE_STORAGE_CONFIG.name); } catch (e) { - utils.logError(e); + logError(e); } } @@ -332,10 +334,10 @@ function hasGDPRConsent(consentData) { if (!consentData.consentString) { return false; } - if (consentData.apiVersion === 1 && utils.deepAccess(consentData, 'vendorData.purposeConsents.1') === false) { + if (consentData.apiVersion === 1 && deepAccess(consentData, 'vendorData.purposeConsents.1') === false) { return false; } - if (consentData.apiVersion === 2 && utils.deepAccess(consentData, 'vendorData.purpose.consents.1') === false) { + if (consentData.apiVersion === 2 && deepAccess(consentData, 'vendorData.purpose.consents.1') === false) { return false; } } @@ -363,7 +365,7 @@ export function findRootDomain(fullDomain = window.location.hostname) { const TEST_COOKIE_VALUE = 'writeable'; do { rootDomain = domainParts.slice(startIndex).join('.'); - let expirationDate = new Date(utils.timestamp() + 10 * 1000).toUTCString(); + let expirationDate = new Date(timestamp() + 10 * 1000).toUTCString(); // Write a test cookie coreStorage.setCookie( @@ -403,7 +405,7 @@ export function findRootDomain(fullDomain = window.location.hostname) { function processSubmoduleCallbacks(submodules, cb) { let done = () => {}; if (cb) { - done = utils.delayExecution(() => { + done = delayExecution(() => { clearTimeout(timeoutID); cb(); }, submodules.length); @@ -418,7 +420,7 @@ function processSubmoduleCallbacks(submodules, cb) { // cache decoded value (this is copied to every adUnit bid) submodule.idObj = submodule.submodule.decode(idObj, submodule.config); } else { - utils.logInfo(`${MODULE_NAME}: ${submodule.submodule.name} - request id responded with an empty value`); + logInfo(`${MODULE_NAME}: ${submodule.submodule.name} - request id responded with an empty value`); } done(); }); @@ -436,7 +438,7 @@ function getCombinedSubmoduleIds(submodules) { if (!Array.isArray(submodules) || !submodules.length) { return {}; } - const combinedSubmoduleIds = submodules.filter(i => utils.isPlainObject(i.idObj) && Object.keys(i.idObj).length).reduce((carry, i) => { + const combinedSubmoduleIds = submodules.filter(i => isPlainObject(i.idObj) && Object.keys(i.idObj).length).reduce((carry, i) => { Object.keys(i.idObj).forEach(key => { carry[key] = i.idObj[key]; }); @@ -456,8 +458,8 @@ function getCombinedSubmoduleIdsForBidder(submodules, bidder) { return {}; } return submodules - .filter(i => !i.config.bidders || !utils.isArray(i.config.bidders) || includes(i.config.bidders, bidder)) - .filter(i => utils.isPlainObject(i.idObj) && Object.keys(i.idObj).length) + .filter(i => !i.config.bidders || !isArray(i.config.bidders) || includes(i.config.bidders, bidder)) + .filter(i => isPlainObject(i.idObj) && Object.keys(i.idObj).length) .reduce((carry, i) => { Object.keys(i.idObj).forEach(key => { carry[key] = i.idObj[key]; @@ -475,7 +477,7 @@ function addIdDataToAdUnitBids(adUnits, submodules) { return; } adUnits.forEach(adUnit => { - if (adUnit.bids && utils.isArray(adUnit.bids)) { + if (adUnit.bids && isArray(adUnit.bids)) { adUnit.bids.forEach(bid => { const combinedSubmoduleIds = getCombinedSubmoduleIdsForBidder(submodules, bid.bidder); if (Object.keys(combinedSubmoduleIds).length) { @@ -500,7 +502,7 @@ function initializeSubmodulesAndExecuteCallbacks(continueAuction) { if (initializedSubmodules.length) { setPrebidServerEidPermissions(initializedSubmodules); // list of submodules that have callbacks that need to be executed - const submodulesWithCallbacks = initializedSubmodules.filter(item => utils.isFn(item.callback)); + const submodulesWithCallbacks = initializedSubmodules.filter(item => isFn(item.callback)); if (submodulesWithCallbacks.length) { if (continueAuction && auctionDelay > 0) { @@ -513,7 +515,7 @@ function initializeSubmodulesAndExecuteCallbacks(continueAuction) { continueAuction(); } } - utils.logInfo(`${MODULE_NAME} - auction delayed by ${auctionDelay} at most to fetch ids`); + logInfo(`${MODULE_NAME} - auction delayed by ${auctionDelay} at most to fetch ids`); timeoutID = setTimeout(continueCallback, auctionDelay); processSubmoduleCallbacks(submodulesWithCallbacks, continueCallback); @@ -596,7 +598,7 @@ function refreshUserIds(options, callback) { // gdpr consent with purpose one is required, otherwise exit immediately let {userIdModules, hasValidated} = validateGdprEnforcement(submodules, consentData); if (!hasValidated && !hasGDPRConsent(consentData)) { - utils.logWarn(`${MODULE_NAME} - gdpr permission not valid for local storage or cookies, exit module`); + logWarn(`${MODULE_NAME} - gdpr permission not valid for local storage or cookies, exit module`); return; } @@ -611,7 +613,7 @@ function refreshUserIds(options, callback) { continue; } - utils.logInfo(`${MODULE_NAME} - refreshing ${submodule.submodule.name}`); + logInfo(`${MODULE_NAME} - refreshing ${submodule.submodule.name}`); populateSubmoduleId(submodule, consentData, storedConsentData, true); updateInitializedSubmodules(submodule); @@ -619,7 +621,7 @@ function refreshUserIds(options, callback) { setPrebidServerEidPermissions(initializedSubmodules); } - if (utils.isFn(submodule.callback)) { + if (isFn(submodule.callback)) { callbackSubmodules.push(submodule); } } @@ -663,7 +665,7 @@ function populateSubmoduleId(submodule, consentData, storedConsentData, forceRef response = submodule.submodule.extendId(submodule.config, consentData, storedId); } - if (utils.isPlainObject(response)) { + if (isPlainObject(response)) { if (response.id) { // A getId/extendId result assumed to be valid user id data, which should be saved to users local storage or cookies setStoredValue(submodule, response.id); @@ -685,7 +687,7 @@ function populateSubmoduleId(submodule, consentData, storedConsentData, forceRef submodule.idObj = submodule.config.value; } else { const response = submodule.submodule.getId(submodule.config, consentData, undefined); - if (utils.isPlainObject(response)) { + if (isPlainObject(response)) { if (typeof response.callback === 'function') { submodule.callback = response.callback; } if (response.id) { submodule.idObj = submodule.submodule.decode(response.id, submodule.config); } } @@ -701,7 +703,7 @@ function initSubmodules(submodules, consentData) { // gdpr consent with purpose one is required, otherwise exit immediately let { userIdModules, hasValidated } = validateGdprEnforcement(submodules, consentData); if (!hasValidated && !hasGDPRConsent(consentData)) { - utils.logWarn(`${MODULE_NAME} - gdpr permission not valid for local storage or cookies, exit module`); + logWarn(`${MODULE_NAME} - gdpr permission not valid for local storage or cookies, exit module`); return []; } @@ -746,17 +748,17 @@ function getValidSubmoduleConfigs(configRegistry, submoduleRegistry, activeStora } return configRegistry.reduce((carry, config) => { // every submodule config obj must contain a valid 'name' - if (!config || utils.isEmptyStr(config.name)) { + if (!config || isEmptyStr(config.name)) { return carry; } // Validate storage config contains 'type' and 'name' properties with non-empty string values // 'type' must be a value currently enabled in the browser if (config.storage && - !utils.isEmptyStr(config.storage.type) && - !utils.isEmptyStr(config.storage.name) && + !isEmptyStr(config.storage.type) && + !isEmptyStr(config.storage.name) && activeStorageTypes.indexOf(config.storage.type) !== -1) { carry.push(config); - } else if (utils.isPlainObject(config.value)) { + } else if (isPlainObject(config.value)) { carry.push(config); } else if (!config.storage && !config.value) { carry.push(config); @@ -793,7 +795,7 @@ function updateSubmodules() { if (!addedUserIdHook && submodules.length) { // priority value 40 will load after consentManagement with a priority of 50 getGlobal().requestBids.before(requestBidsHook, 40); - utils.logInfo(`${MODULE_NAME} - usersync config updated for ${submodules.length} submodules: `, submodules.map(a => a.submodule.name)); + logInfo(`${MODULE_NAME} - usersync config updated for ${submodules.length} submodules: `, submodules.map(a => a.submodule.name)); addedUserIdHook = true; } } @@ -828,11 +830,11 @@ export function init(config) { // exit immediately if opt out cookie or local storage keys exists. if (validStorageTypes.indexOf(COOKIE) !== -1 && coreStorage.getCookie(PBJS_USER_ID_OPTOUT_NAME)) { - utils.logInfo(`${MODULE_NAME} - opt-out cookie found, exit module`); + logInfo(`${MODULE_NAME} - opt-out cookie found, exit module`); return; } if (validStorageTypes.indexOf(LOCAL_STORAGE) !== -1 && coreStorage.getDataFromLocalStorage(PBJS_USER_ID_OPTOUT_NAME)) { - utils.logInfo(`${MODULE_NAME} - opt-out localStorage found, exit module`); + logInfo(`${MODULE_NAME} - opt-out localStorage found, exit module`); return; } @@ -842,8 +844,8 @@ export function init(config) { const userSync = conf.userSync; if (userSync && userSync.userIds) { configRegistry = userSync.userIds; - syncDelay = utils.isNumber(userSync.syncDelay) ? userSync.syncDelay : DEFAULT_SYNC_DELAY; - auctionDelay = utils.isNumber(userSync.auctionDelay) ? userSync.auctionDelay : NO_AUCTION_DELAY; + syncDelay = isNumber(userSync.syncDelay) ? userSync.syncDelay : DEFAULT_SYNC_DELAY; + auctionDelay = isNumber(userSync.auctionDelay) ? userSync.auctionDelay : NO_AUCTION_DELAY; updateSubmodules(); } }); diff --git a/modules/validationFpdModule/index.js b/modules/validationFpdModule/index.js index a1d1a3823f0..2db170c1bd1 100644 --- a/modules/validationFpdModule/index.js +++ b/modules/validationFpdModule/index.js @@ -3,7 +3,7 @@ * @module modules/firstPartyData */ import { config } from '../../src/config.js'; -import * as utils from '../../src/utils.js'; +import { isEmpty, isNumber, logWarn, deepAccess } from '../../src/utils.js'; import { ORTB_MAP } from './config.js'; import { submodule } from '../../src/hook.js'; import { getStorageManager } from '../../src/storageManager.js'; @@ -19,9 +19,9 @@ let optout; function isEmptyData(data) { let check = true; - if (typeof data === 'object' && !utils.isEmpty(data)) { + if (typeof data === 'object' && !isEmpty(data)) { check = false; - } else if (typeof data !== 'object' && (utils.isNumber(data) || data)) { + } else if (typeof data !== 'object' && (isNumber(data) || data)) { check = false; } @@ -42,7 +42,7 @@ function getRequiredData(obj, required, parent, i) { required.forEach(key => { if (!obj[key] || isEmptyData(obj[key])) { check = false; - utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: missing required property ${key}`); + logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: missing required property ${key}`); } }); @@ -91,17 +91,17 @@ export function filterArrayData(arr, child, path, parent) { return true; } - utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); + logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); }).filter((index, i) => { let requiredCheck = true; - let mapping = utils.deepAccess(ORTB_MAP, path); + let mapping = deepAccess(ORTB_MAP, path); if (mapping && mapping.required) requiredCheck = getRequiredData(index, mapping.required, parent, i); if (requiredCheck) return true; }).reduce((result, value, i) => { let typeBool = false; - let mapping = utils.deepAccess(ORTB_MAP, path); + let mapping = deepAccess(ORTB_MAP, path); switch (child.type) { case 'string': @@ -126,7 +126,7 @@ export function filterArrayData(arr, child, path, parent) { break; } - if (!typeBool) utils.logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); + if (!typeBool) logWarn(`Filtered ${parent}[] value at index ${i} in ortb2 data: expected type ${child.type}`); return result; }, []); @@ -146,26 +146,26 @@ export function validateFpd(fpd, path = '', parent = '') { // Filter out imp property if exists let validObject = Object.assign({}, Object.keys(fpd).filter(key => { - let mapping = utils.deepAccess(ORTB_MAP, path + key); + let mapping = deepAccess(ORTB_MAP, path + key); if (!mapping || !mapping.invalid) return key; - utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: invalid property`); + logWarn(`Filtered ${parent}${key} property in ortb2 data: invalid property`); }).filter(key => { - let mapping = utils.deepAccess(ORTB_MAP, path + key); + let mapping = deepAccess(ORTB_MAP, path + key); // let typeBool = false; let typeBool = (mapping) ? typeValidation(fpd[key], {type: mapping.type, isArray: mapping.isArray}) : true; if (typeBool || !mapping) return key; - utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: expected type ${(mapping.isArray) ? 'array' : mapping.type}`); + logWarn(`Filtered ${parent}${key} property in ortb2 data: expected type ${(mapping.isArray) ? 'array' : mapping.type}`); }).reduce((result, key) => { - let mapping = utils.deepAccess(ORTB_MAP, path + key); + let mapping = deepAccess(ORTB_MAP, path + key); let modified = {}; if (mapping) { if (mapping.optoutApplies && optout) { - utils.logWarn(`Filtered ${parent}${key} data: pubcid optout found`); + logWarn(`Filtered ${parent}${key} data: pubcid optout found`); return result; } @@ -176,7 +176,7 @@ export function validateFpd(fpd, path = '', parent = '') { // Check if modified data has data and return (!isEmptyData(modified)) ? result[key] = modified - : utils.logWarn(`Filtered ${parent}${key} property in ortb2 data: empty data found`); + : logWarn(`Filtered ${parent}${key} property in ortb2 data: empty data found`); } else { result[key] = fpd[key]; } From 9e0c0d26ca337f12cd00b57a2f2c62c5a7bcff4d Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 12:59:56 -0700 Subject: [PATCH 106/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7496) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/seedtagBidAdapter.js | 20 ++-- modules/sharedIdSystem.js | 22 ++-- modules/sharethroughAnalyticsAdapter.js | 16 +-- modules/sharethroughBidAdapter.js | 16 +-- modules/showheroes-bsBidAdapter.js | 46 ++++---- modules/sigmoidAnalyticsAdapter.js | 9 +- modules/sirdataRtdProvider.js | 68 +++++------ modules/sizeMappingV2.js | 78 ++++++------- modules/smaatoBidAdapter.js | 88 +++++++-------- modules/smartadserverBidAdapter.js | 14 +-- modules/smartxBidAdapter.js | 144 ++++++++++++------------ modules/smartyadsBidAdapter.js | 4 +- modules/smilewantedBidAdapter.js | 12 +- modules/sonobiAnalyticsAdapter.js | 46 ++++---- modules/sortableAnalyticsAdapter.js | 10 +- 15 files changed, 296 insertions(+), 297 deletions(-) diff --git a/modules/seedtagBidAdapter.js b/modules/seedtagBidAdapter.js index 8b7629df211..cb646fe10c3 100644 --- a/modules/seedtagBidAdapter.js +++ b/modules/seedtagBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js' +import { isArray, _map, triggerPixel } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js' import { VIDEO, BANNER } from '../src/mediaTypes.js' @@ -62,13 +62,13 @@ function hasMandatoryVideoParams(bid) { const videoParams = getVideoParams(bid) return hasVideoMediaType(bid) && !!videoParams.playerSize && - utils.isArray(videoParams.playerSize) && + isArray(videoParams.playerSize) && videoParams.playerSize.length > 0; } function buildBidRequest(validBidRequest) { const params = validBidRequest.params; - const mediaTypes = utils._map( + const mediaTypes = _map( Object.keys(validBidRequest.mediaTypes), function (pbjsType) { return mediaTypesMap[pbjsType]; @@ -145,8 +145,8 @@ function buildBidResponse(seedtagBid) { export function getTimeoutUrl (data) { let queryParams = ''; if ( - utils.isArray(data) && data[0] && - utils.isArray(data[0].params) && data[0].params[0] + isArray(data) && data[0] && + isArray(data[0].params) && data[0].params[0] ) { const params = data[0].params[0]; queryParams = @@ -186,7 +186,7 @@ export const spec = { timeout: bidderRequest.timeout, version: '$prebid.version$', connectionType: getConnectionType(), - bidRequests: utils._map(validBidRequests, buildBidRequest) + bidRequests: _map(validBidRequests, buildBidRequest) }; if (payload.cmp) { @@ -211,8 +211,8 @@ export const spec = { */ interpretResponse: function(serverResponse) { const serverBody = serverResponse.body; - if (serverBody && serverBody.bids && utils.isArray(serverBody.bids)) { - return utils._map(serverBody.bids, function(bid) { + if (serverBody && serverBody.bids && isArray(serverBody.bids)) { + return _map(serverBody.bids, function(bid) { return buildBidResponse(bid); }); } else { @@ -243,7 +243,7 @@ export const spec = { */ onTimeout(data) { const url = getTimeoutUrl(data); - utils.triggerPixel(url); + triggerPixel(url); }, /** @@ -252,7 +252,7 @@ export const spec = { */ onBidWon: function (bid) { if (bid && bid.nurl) { - utils.triggerPixel(bid.nurl); + triggerPixel(bid.nurl); } } } diff --git a/modules/sharedIdSystem.js b/modules/sharedIdSystem.js index 2e3abd6b1a2..0c25a1747f6 100644 --- a/modules/sharedIdSystem.js +++ b/modules/sharedIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; +import { parseUrl, buildUrl, triggerPixel, logInfo, hasDeviceAccess, generateUUID } from '../src/utils.js'; import {submodule} from '../src/hook.js'; import { coppaDataHandler } from '../src/adapterManager.js'; import {getStorageManager} from '../src/storageManager.js'; @@ -53,12 +53,12 @@ function queuePixelCallback(pixelUrl, id = '', callback) { } // Use pubcid as a cache buster - const urlInfo = utils.parseUrl(pixelUrl); + const urlInfo = parseUrl(pixelUrl); urlInfo.search.id = encodeURIComponent('pubcid:' + id); - const targetUrl = utils.buildUrl(urlInfo); + const targetUrl = buildUrl(urlInfo); return function () { - utils.triggerPixel(targetUrl); + triggerPixel(targetUrl); }; } @@ -89,10 +89,10 @@ export const sharedIdSystemSubmodule = { */ decode(value, config) { if (hasOptedOut()) { - utils.logInfo('PubCommonId decode: Has opted-out'); + logInfo('PubCommonId decode: Has opted-out'); return undefined; } - utils.logInfo(' Decoded value PubCommonId ' + value); + logInfo(' Decoded value PubCommonId ' + value); const idObj = {'pubcid': value}; return idObj; }, @@ -106,13 +106,13 @@ export const sharedIdSystemSubmodule = { */ getId: function (config = {}, consentData, storedId) { if (hasOptedOut()) { - utils.logInfo('PubCommonId: Has opted-out'); + logInfo('PubCommonId: Has opted-out'); return; } const coppa = coppaDataHandler.getCoppa(); if (coppa) { - utils.logInfo('PubCommonId: IDs not provided for coppa requests, exiting PubCommonId'); + logInfo('PubCommonId: IDs not provided for coppa requests, exiting PubCommonId'); return; } const {params: {create = true, pixelUrl} = {}} = config; @@ -126,7 +126,7 @@ export const sharedIdSystemSubmodule = { } catch (e) { } - if (!newId) newId = (create && utils.hasDeviceAccess()) ? utils.generateUUID() : undefined; + if (!newId) newId = (create && hasDeviceAccess()) ? generateUUID() : undefined; } const pixelCallback = queuePixelCallback(pixelUrl, newId); @@ -153,12 +153,12 @@ export const sharedIdSystemSubmodule = { */ extendId: function(config = {}, consentData, storedId) { if (hasOptedOut()) { - utils.logInfo('PubCommonId: Has opted-out'); + logInfo('PubCommonId: Has opted-out'); return {id: undefined}; } const coppa = coppaDataHandler.getCoppa(); if (coppa) { - utils.logInfo('PubCommonId: IDs not provided for coppa requests, exiting PubCommonId'); + logInfo('PubCommonId: IDs not provided for coppa requests, exiting PubCommonId'); return; } const {params: {extend = false, pixelUrl} = {}} = config; diff --git a/modules/sharethroughAnalyticsAdapter.js b/modules/sharethroughAnalyticsAdapter.js index 5147b2a4275..4f065cbca23 100644 --- a/modules/sharethroughAnalyticsAdapter.js +++ b/modules/sharethroughAnalyticsAdapter.js @@ -1,6 +1,6 @@ +import { tryAppendQueryString } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; -const utils = require('../src/utils.js'); const emptyUrl = ''; const analyticsType = 'endpoint'; @@ -42,18 +42,18 @@ var sharethroughAdapter = Object.assign(adapter( fireLoseBeacon(winningBidderCode, winningCPM, arid, type) { let loseBeaconUrl = this.STR_BEACON_HOST; - loseBeaconUrl = utils.tryAppendQueryString(loseBeaconUrl, 'winnerBidderCode', winningBidderCode); - loseBeaconUrl = utils.tryAppendQueryString(loseBeaconUrl, 'winnerCpm', winningCPM); - loseBeaconUrl = utils.tryAppendQueryString(loseBeaconUrl, 'arid', arid); - loseBeaconUrl = utils.tryAppendQueryString(loseBeaconUrl, 'type', type); + loseBeaconUrl = tryAppendQueryString(loseBeaconUrl, 'winnerBidderCode', winningBidderCode); + loseBeaconUrl = tryAppendQueryString(loseBeaconUrl, 'winnerCpm', winningCPM); + loseBeaconUrl = tryAppendQueryString(loseBeaconUrl, 'arid', arid); + loseBeaconUrl = tryAppendQueryString(loseBeaconUrl, 'type', type); loseBeaconUrl = this.appendEnvFields(loseBeaconUrl); this.fireBeacon(loseBeaconUrl); }, appendEnvFields(url) { - url = utils.tryAppendQueryString(url, 'hbVersion', '$prebid.version$'); - url = utils.tryAppendQueryString(url, 'strVersion', STR_VERSION); - url = utils.tryAppendQueryString(url, 'hbSource', 'prebid'); + url = tryAppendQueryString(url, 'hbVersion', '$prebid.version$'); + url = tryAppendQueryString(url, 'strVersion', STR_VERSION); + url = tryAppendQueryString(url, 'hbSource', 'prebid'); return url; }, diff --git a/modules/sharethroughBidAdapter.js b/modules/sharethroughBidAdapter.js index 3b4f0ec2a4e..11e62553038 100644 --- a/modules/sharethroughBidAdapter.js +++ b/modules/sharethroughBidAdapter.js @@ -1,5 +1,5 @@ +import { generateUUID, deepAccess, inIframe } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { createEidsArray } from './userId/eids.js'; @@ -29,7 +29,7 @@ export const sharethroughAdapterSpec = { const secure = nonHttp || (sharethroughInternal.getProtocol().indexOf('https') > -1); const req = { - id: utils.generateUUID(), + id: generateUUID(), at: 1, cur: ['USD'], tmax: timeout, @@ -82,7 +82,7 @@ export const sharethroughAdapterSpec = { const imps = bidRequests.map(bidReq => { const impression = {}; - const gpid = utils.deepAccess(bidReq, 'ortb2Imp.ext.data.pbadslot'); + const gpid = deepAccess(bidReq, 'ortb2Imp.ext.data.pbadslot'); if (gpid) { impression.ext = { gpid: gpid }; } @@ -104,7 +104,7 @@ export const sharethroughAdapterSpec = { impression.video = { pos: nullish(videoRequest.pos, 0), - topframe: utils.inIframe() ? 0 : 1, + topframe: inIframe() ? 0 : 1, skip: nullish(videoRequest.skip, 0), linearity: nullish(videoRequest.linearity, 1), minduration: nullish(videoRequest.minduration, 5), @@ -126,8 +126,8 @@ export const sharethroughAdapterSpec = { if (videoRequest.companionad) impression.video.companionad = videoRequest.companionad; } else { impression.banner = { - pos: utils.deepAccess(bidReq, 'mediaTypes.banner.pos', 0), - topframe: utils.inIframe() ? 0 : 1, + pos: deepAccess(bidReq, 'mediaTypes.banner.pos', 0), + topframe: inIframe() ? 0 : 1, format: bidReq.sizes.map(size => ({ w: +size[0], h: +size[1] })), }; } @@ -252,9 +252,9 @@ function getBidRequestFloor(bid) { } function userIdAsEids(bidRequest) { - const eids = createEidsArray(utils.deepAccess(bidRequest, 'userId')) || []; + const eids = createEidsArray(deepAccess(bidRequest, 'userId')) || []; - const flocData = utils.deepAccess(bidRequest, 'userId.flocId'); + const flocData = deepAccess(bidRequest, 'userId.flocId'); const isFlocIdValid = flocData && flocData.id && flocData.version; if (isFlocIdValid) { eids.push({ diff --git a/modules/showheroes-bsBidAdapter.js b/modules/showheroes-bsBidAdapter.js index 8d94a8e508b..99378b494df 100644 --- a/modules/showheroes-bsBidAdapter.js +++ b/modules/showheroes-bsBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, getBidIdParameter, getWindowTop, logError } from '../src/utils.js'; import { config } from '../src/config.js'; import { Renderer } from '../src/Renderer.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; @@ -32,18 +32,18 @@ export const spec = { let adUnits = []; const pageURL = validBidRequests[0].params.contentPageUrl || bidderRequest.refererInfo.referer; const isStage = !!validBidRequests[0].params.stage; - const isOutstream = utils.deepAccess(validBidRequests[0], 'mediaTypes.video.context') === 'outstream'; - const isCustomRender = utils.deepAccess(validBidRequests[0], 'params.outstreamOptions.customRender'); - const isNodeRender = utils.deepAccess(validBidRequests[0], 'params.outstreamOptions.slot') || utils.deepAccess(validBidRequests[0], 'params.outstreamOptions.iframe'); - const isNativeRender = utils.deepAccess(validBidRequests[0], 'renderer'); - const outstreamOptions = utils.deepAccess(validBidRequests[0], 'params.outstreamOptions'); + const isOutstream = deepAccess(validBidRequests[0], 'mediaTypes.video.context') === 'outstream'; + const isCustomRender = deepAccess(validBidRequests[0], 'params.outstreamOptions.customRender'); + const isNodeRender = deepAccess(validBidRequests[0], 'params.outstreamOptions.slot') || deepAccess(validBidRequests[0], 'params.outstreamOptions.iframe'); + const isNativeRender = deepAccess(validBidRequests[0], 'renderer'); + const outstreamOptions = deepAccess(validBidRequests[0], 'params.outstreamOptions'); const isBanner = !!validBidRequests[0].mediaTypes.banner || (isOutstream && !(isCustomRender || isNativeRender || isNodeRender)); const defaultSchain = validBidRequests[0].schain || {}; validBidRequests.forEach((bid) => { const videoSizes = getVideoSizes(bid); const bannerSizes = getBannerSizes(bid); - const vpaidMode = utils.getBidIdParameter('vpaidMode', bid.params); + const vpaidMode = getBidIdParameter('vpaidMode', bid.params); const makeBids = (type, size) => { let context = ''; @@ -52,7 +52,7 @@ export const spec = { if (type === BANNER) { streamType = 5; } else { - context = utils.deepAccess(bid, 'mediaTypes.video.context'); + context = deepAccess(bid, 'mediaTypes.video.context'); if (vpaidMode && context === 'instream') { streamType = 1; } @@ -66,7 +66,7 @@ export const spec = { bidId: bid.bidId, mediaType: type, context: context, - playerId: utils.getBidIdParameter('playerId', bid.params), + playerId: getBidIdParameter('playerId', bid.params), auctionId: bidderRequest.auctionId, bidderCode: BIDDER_CODE, gdprConsent: bidderRequest.gdprConsent, @@ -100,7 +100,7 @@ export const spec = { 'adapterVersion': 2, 'pageURL': encodeURIComponent(pageURL), 'vastCacheEnabled': (!!config.getConfig('cache') && !isBanner && !outstreamOptions) || false, - 'isDesktop': utils.getWindowTop().document.documentElement.clientWidth > 700, + 'isDesktop': getWindowTop().document.documentElement.clientWidth > 700, 'xmlAndTag': !!(isOutstream && isCustomRender) || false, 'stage': isStage || undefined }, @@ -192,9 +192,9 @@ function createBids(bidRes, reqData) { vastXml: bid.vastXml, debug: reqData.debug, isStage: !!reqData.meta.stage, - customRender: utils.getBidIdParameter('customRender', currentBidParams.outstreamOptions), - slot: utils.getBidIdParameter('slot', currentBidParams.outstreamOptions), - iframe: utils.getBidIdParameter('iframe', currentBidParams.outstreamOptions), + customRender: getBidIdParameter('customRender', currentBidParams.outstreamOptions), + slot: getBidIdParameter('slot', currentBidParams.outstreamOptions), + iframe: getBidIdParameter('iframe', currentBidParams.outstreamOptions), } }); renderer.setRender(outstreamRender); @@ -212,7 +212,7 @@ function outstreamRender(bid) { bid.renderer.config.customRender(bid, embedCode); } else { try { - const inIframe = utils.getBidIdParameter('iframe', bid.renderer.config); + const inIframe = getBidIdParameter('iframe', bid.renderer.config); if (inIframe && window.document.getElementById(inIframe).nodeName === 'IFRAME') { const iframe = window.document.getElementById(inIframe); let framedoc = iframe.contentDocument || (iframe.contentWindow && iframe.contentWindow.document); @@ -220,20 +220,20 @@ function outstreamRender(bid) { return; } - const slot = utils.getBidIdParameter('slot', bid.renderer.config) || bid.adUnitCode; + const slot = getBidIdParameter('slot', bid.renderer.config) || bid.adUnitCode; if (slot && window.document.getElementById(slot)) { window.document.getElementById(slot).appendChild(embedCode); } else if (slot) { - utils.logError('[ShowHeroes][renderer] Error: spot not found'); + logError('[ShowHeroes][renderer] Error: spot not found'); } } catch (err) { - utils.logError('[ShowHeroes][renderer] Error:' + err.message) + logError('[ShowHeroes][renderer] Error:' + err.message) } } } function createOutstreamEmbedCode(bid) { - const isStage = utils.getBidIdParameter('isStage', bid.renderer.config); + const isStage = getBidIdParameter('isStage', bid.renderer.config); const urls = getEnvURLs(isStage); const fragment = window.document.createDocumentFragment(); @@ -245,9 +245,9 @@ function createOutstreamEmbedCode(bid) { const spot = window.document.createElement('div'); spot.setAttribute('class', 'showheroes-spot'); - spot.setAttribute('data-player', utils.getBidIdParameter('playerId', bid.renderer.config)); - spot.setAttribute('data-debug', utils.getBidIdParameter('debug', bid.renderer.config)); - spot.setAttribute('data-ad-vast-tag', utils.getBidIdParameter('vastUrl', bid.renderer.config)); + spot.setAttribute('data-player', getBidIdParameter('playerId', bid.renderer.config)); + spot.setAttribute('data-debug', getBidIdParameter('debug', bid.renderer.config)); + spot.setAttribute('data-ad-vast-tag', getBidIdParameter('vastUrl', bid.renderer.config)); spot.setAttribute('data-stream-type', 'outstream'); fragment.appendChild(spot); @@ -275,11 +275,11 @@ function getBannerHtml (bid, reqBid, reqData) { } function getVideoSizes(bidRequest) { - return formatSizes(utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize') || []); + return formatSizes(deepAccess(bidRequest, 'mediaTypes.video.playerSize') || []); } function getBannerSizes(bidRequest) { - return formatSizes(utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes') || []); + return formatSizes(deepAccess(bidRequest, 'mediaTypes.banner.sizes') || []); } function formatSizes(sizes) { diff --git a/modules/sigmoidAnalyticsAdapter.js b/modules/sigmoidAnalyticsAdapter.js index 303fbbc8995..da0ca9e38e5 100644 --- a/modules/sigmoidAnalyticsAdapter.js +++ b/modules/sigmoidAnalyticsAdapter.js @@ -5,11 +5,10 @@ import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; import { getStorageManager } from '../src/storageManager.js'; +import { generateUUID, logInfo, logError } from '../src/utils.js'; const storage = getStorageManager(); -const utils = require('../src/utils.js'); - const url = 'https://kinesis.us-east-1.amazonaws.com/'; const analyticsType = 'endpoint'; @@ -56,7 +55,7 @@ function buildSessionIdTimeoutLocalStorageKey() { function updateSessionId() { if (isSessionIdTimeoutExpired()) { - let newSessionId = utils.generateUUID(); + let newSessionId = generateUUID(); storage.setDataInLocalStorage(buildSessionIdLocalStorageKey(), newSessionId); } initOptions.sessionId = getSessionId(); @@ -206,7 +205,7 @@ sigmoidAdapter.originEnableAnalytics = sigmoidAdapter.enableAnalytics; sigmoidAdapter.enableAnalytics = function (config) { initOptions = config.options; initOptions.utmTagData = this.buildUtmTagData(); - utils.logInfo('Sigmoid Analytics enabled with config', initOptions); + logInfo('Sigmoid Analytics enabled with config', initOptions); sigmoidAdapter.originEnableAnalytics(config); }; @@ -246,7 +245,7 @@ function send(eventType, data, sendDataType) { AWS.config.credentials.get(function(err) { // attach event listener if (err) { - utils.logError(err); + logError(err); return; } // create kinesis service object diff --git a/modules/sirdataRtdProvider.js b/modules/sirdataRtdProvider.js index 373468b2f14..344357bcb62 100644 --- a/modules/sirdataRtdProvider.js +++ b/modules/sirdataRtdProvider.js @@ -7,7 +7,7 @@ * @requires module:modules/realTimeData */ import {getGlobal} from '../src/prebidGlobal.js'; -import * as utils from '../src/utils.js'; +import { deepAccess, logError, deepEqual, deepSetValue, isEmpty, mergeDeep } from '../src/utils.js'; import {submodule} from '../src/hook.js'; import {ajax} from '../src/ajax.js'; import findIndex from 'core-js-pure/features/array/find-index.js'; @@ -44,7 +44,7 @@ export function getSegmentsAndCategories(reqBidsConfigObj, onDone, moduleConfig, } // default global endpoint is cookie-based if no rules falls into cookieless or consent has been given or GDPR doesn't apply - if (!sirdataDomain || !gdprApplies || (utils.deepAccess(userConsent, 'gdpr.vendorData.vendor.consents') && userConsent.gdpr.vendorData.vendor.consents[53] && userConsent.gdpr.vendorData.purpose.consents[1] && userConsent.gdpr.vendorData.purpose.consents[4])) { + if (!sirdataDomain || !gdprApplies || (deepAccess(userConsent, 'gdpr.vendorData.vendor.consents') && userConsent.gdpr.vendorData.vendor.consents[53] && userConsent.gdpr.vendorData.purpose.consents[1] && userConsent.gdpr.vendorData.purpose.consents[4])) { sirdataDomain = 'sddan.com'; sendWithCredentials = true; } @@ -64,7 +64,7 @@ export function getSegmentsAndCategories(reqBidsConfigObj, onDone, moduleConfig, } } catch (e) { onDone(); - utils.logError('unable to parse Sirdata data' + e); + logError('unable to parse Sirdata data' + e); } } else if (req.status === 204) { onDone(); @@ -72,7 +72,7 @@ export function getSegmentsAndCategories(reqBidsConfigObj, onDone, moduleConfig, }, error: function () { onDone(); - utils.logError('unable to get Sirdata data'); + logError('unable to get Sirdata data'); } }, null, @@ -89,18 +89,18 @@ export function setGlobalOrtb2(segments, categories) { try { let addOrtb2 = {}; let testGlobal = getGlobal().getConfig('ortb2') || {}; - if (!utils.deepAccess(testGlobal, 'user.ext.data.sd_rtd') || !utils.deepEqual(testGlobal.user.ext.data.sd_rtd, segments)) { - utils.deepSetValue(addOrtb2, 'user.ext.data.sd_rtd', segments || {}); + if (!deepAccess(testGlobal, 'user.ext.data.sd_rtd') || !deepEqual(testGlobal.user.ext.data.sd_rtd, segments)) { + deepSetValue(addOrtb2, 'user.ext.data.sd_rtd', segments || {}); } - if (!utils.deepAccess(testGlobal, 'site.ext.data.sd_rtd') || !utils.deepEqual(testGlobal.site.ext.data.sd_rtd, categories)) { - utils.deepSetValue(addOrtb2, 'site.ext.data.sd_rtd', categories || {}); + if (!deepAccess(testGlobal, 'site.ext.data.sd_rtd') || !deepEqual(testGlobal.site.ext.data.sd_rtd, categories)) { + deepSetValue(addOrtb2, 'site.ext.data.sd_rtd', categories || {}); } - if (!utils.isEmpty(addOrtb2)) { - let ortb2 = {ortb2: utils.mergeDeep({}, testGlobal, addOrtb2)}; + if (!isEmpty(addOrtb2)) { + let ortb2 = {ortb2: mergeDeep({}, testGlobal, addOrtb2)}; getGlobal().setConfig(ortb2); } } catch (e) { - utils.logError(e) + logError(e) } return true; @@ -109,19 +109,19 @@ export function setGlobalOrtb2(segments, categories) { export function setBidderOrtb2(bidder, segments, categories) { try { let addOrtb2 = {}; - let testBidder = utils.deepAccess(config.getBidderConfig(), bidder + '.ortb2') || {}; - if (!utils.deepAccess(testBidder, 'user.ext.data.sd_rtd') || !utils.deepEqual(testBidder.user.ext.data.sd_rtd, segments)) { - utils.deepSetValue(addOrtb2, 'user.ext.data.sd_rtd', segments || {}); + let testBidder = deepAccess(config.getBidderConfig(), bidder + '.ortb2') || {}; + if (!deepAccess(testBidder, 'user.ext.data.sd_rtd') || !deepEqual(testBidder.user.ext.data.sd_rtd, segments)) { + deepSetValue(addOrtb2, 'user.ext.data.sd_rtd', segments || {}); } - if (!utils.deepAccess(testBidder, 'site.ext.data.sd_rtd') || !utils.deepEqual(testBidder.site.ext.data.sd_rtd, categories)) { - utils.deepSetValue(addOrtb2, 'site.ext.data.sd_rtd', categories || {}); + if (!deepAccess(testBidder, 'site.ext.data.sd_rtd') || !deepEqual(testBidder.site.ext.data.sd_rtd, categories)) { + deepSetValue(addOrtb2, 'site.ext.data.sd_rtd', categories || {}); } - if (!utils.isEmpty(addOrtb2)) { - let ortb2 = {ortb2: utils.mergeDeep({}, testBidder, addOrtb2)}; + if (!isEmpty(addOrtb2)) { + let ortb2 = {ortb2: mergeDeep({}, testBidder, addOrtb2)}; getGlobal().setBidderConfig({ bidders: [bidder], config: ortb2 }); } } catch (e) { - utils.logError(e) + logError(e) } return true; @@ -132,7 +132,7 @@ export function loadCustomFunction (todo, adUnit, list, data, bid) { if (typeof todo == 'function') { todo(adUnit, list, data, bid); } - } catch (e) { utils.logError(e); } + } catch (e) { logError(e); } return true; } @@ -148,14 +148,14 @@ export function getSegAndCatsArray(data, minScore) { } } } - } catch (e) { utils.logError(e); } + } catch (e) { logError(e); } try { if (data && data.segments) { for (let segId in data.segments) { sirdataData.segments.push(data.segments[segId].toString()); } } - } catch (e) { utils.logError(e); } + } catch (e) { logError(e); } return sirdataData; } @@ -165,7 +165,7 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { const globalMinScore = moduleConfig.params.hasOwnProperty('contextualMinRelevancyScore') ? moduleConfig.params.contextualMinRelevancyScore : 30; var sirdataData = getSegAndCatsArray(data, globalMinScore); - if (!sirdataData || (sirdataData.segments.length < 1 && sirdataData.categories.length < 1)) { utils.logError('no cats'); onDone(); return adUnits; } + if (!sirdataData || (sirdataData.segments.length < 1 && sirdataData.categories.length < 1)) { logError('no cats'); onDone(); return adUnits; } const sirdataList = sirdataData.segments.concat(sirdataData.categories); @@ -191,7 +191,7 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { n.setTargeting('sd_rtd', sirdataList.concat(curationData.segments).concat(curationData.categories)); } }) - } catch (e) { utils.logError(e); } + } catch (e) { logError(e); } } // Bid targeting level for FPD non-generic biders @@ -199,8 +199,8 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { var indexFound = false; adUnits.forEach(adUnit => { - if (!biddersParamsExist && !utils.deepAccess(adUnit, 'ortb2Imp.ext.data.sd_rtd')) { - utils.deepSetValue(adUnit, 'ortb2Imp.ext.data.sd_rtd', sirdataList); + if (!biddersParamsExist && !deepAccess(adUnit, 'ortb2Imp.ext.data.sd_rtd')) { + deepSetValue(adUnit, 'ortb2Imp.ext.data.sd_rtd', sirdataList); } adUnit.hasOwnProperty('bids') && adUnit.bids.forEach(bid => { @@ -236,7 +236,7 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { if (indexFound && moduleConfig.params.bidders[bidderIndex].hasOwnProperty('customFunction')) { loadCustomFunction(moduleConfig.params.bidders[bidderIndex].customFunction, adUnit, sirdataList.concat(curationData.segments).concat(curationData.categories), data, bid); } else { - utils.deepSetValue(bid, 'params.keywords.sd_rtd', sirdataList.concat(curationData.segments).concat(curationData.categories)); + deepSetValue(bid, 'params.keywords.sd_rtd', sirdataList.concat(curationData.segments).concat(curationData.categories)); } break; @@ -259,7 +259,7 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { target.push('sd_rtd=' + entry); } }); - utils.deepSetValue(bid, 'params.target', target.join(';')); + deepSetValue(bid, 'params.target', target.join(';')); } break; @@ -313,7 +313,7 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { if (indexFound && moduleConfig.params.bidders[bidderIndex].hasOwnProperty('customFunction')) { loadCustomFunction(moduleConfig.params.bidders[bidderIndex].customFunction, adUnit, sirdataList.concat(curationData.segments).concat(curationData.categories), data, bid); } else { - utils.deepSetValue(bid, 'ortb2.user.ext.data', {segments: sirdataData.segments.concat(curationData.segments), contextual_categories: {...data.contextual_categories, ...data.shared_taxonomy[curationId].contextual_categories}}); + deepSetValue(bid, 'ortb2.user.ext.data', {segments: sirdataData.segments.concat(curationData.segments), contextual_categories: {...data.contextual_categories, ...data.shared_taxonomy[curationId].contextual_categories}}); } break; @@ -372,16 +372,16 @@ export function addSegmentData(adUnits, data, moduleConfig, onDone) { default: if (!biddersParamsExist || indexFound) { - if (!utils.deepAccess(bid, 'ortb2.site.ext.data.sd_rtd')) { - utils.deepSetValue(bid, 'ortb2.site.ext.data.sd_rtd', sirdataData.categories); + if (!deepAccess(bid, 'ortb2.site.ext.data.sd_rtd')) { + deepSetValue(bid, 'ortb2.site.ext.data.sd_rtd', sirdataData.categories); } - if (!utils.deepAccess(bid, 'ortb2.user.ext.data.sd_rtd')) { - utils.deepSetValue(bid, 'ortb2.user.ext.data.sd_rtd', sirdataData.segments); + if (!deepAccess(bid, 'ortb2.user.ext.data.sd_rtd')) { + deepSetValue(bid, 'ortb2.user.ext.data.sd_rtd', sirdataData.segments); } } } } - } catch (e) { utils.logError(e) } + } catch (e) { logError(e) } }) }); diff --git a/modules/sizeMappingV2.js b/modules/sizeMappingV2.js index ffd242e57ac..95f0eea4075 100644 --- a/modules/sizeMappingV2.js +++ b/modules/sizeMappingV2.js @@ -4,7 +4,7 @@ * rendering. Read full API documentation on Prebid.org, http://prebid.org/dev-docs/modules/sizeMappingV2.html */ -import * as utils from '../src/utils.js'; +import { isArray, logError, isArrayOfNums, deepClone, logWarn, getWindowTop, deepEqual, logInfo, isValidMediaTypes, deepAccess, getDefinedParams, getUniqueIdentifierStr, flatten } from '../src/utils.js'; import { processNativeAdUnitParams } from '../src/native.js'; import { adunitCounter } from '../src/adUnits.js'; import includes from 'core-js-pure/features/array/includes.js'; @@ -66,7 +66,7 @@ export function isUsingNewSizeMapping(adUnits) { }); // checks for the presence of sizeConfig property at the adUnit.bids[].bidder object - adUnit.bids && utils.isArray(adUnit.bids) && adUnit.bids.forEach(bidder => { + adUnit.bids && isArray(adUnit.bids) && adUnit.bids.forEach(bidder => { if (bidder.sizeConfig) { if (isUsingSizeMappingBool === false) { isUsingSizeMappingBool = true; @@ -108,7 +108,7 @@ export function checkAdUnitSetupHook(adUnits) { If they do not, return 'false'. */ if (!(includes(keys, 'minViewPort') && includes(keys, propertyName))) { - utils.logError(`Ad unit ${adUnitCode}: Missing required property 'minViewPort' or 'sizes' from 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); + logError(`Ad unit ${adUnitCode}: Missing required property 'minViewPort' or 'sizes' from 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); isValid = false; return; } @@ -117,8 +117,8 @@ export function checkAdUnitSetupHook(adUnits) { Verify that 'config.minViewPort' property is in [width, height] format. If not, return false. */ - if (!utils.isArrayOfNums(config.minViewPort, 2)) { - utils.logError(`Ad unit ${adUnitCode}: Invalid declaration of 'minViewPort' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); + if (!isArrayOfNums(config.minViewPort, 2)) { + logError(`Ad unit ${adUnitCode}: Invalid declaration of 'minViewPort' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); isValid = false return; } @@ -141,7 +141,7 @@ export function checkAdUnitSetupHook(adUnits) { showError = true; } if (showError) { - utils.logError(`Ad unit ${adUnitCode}: Invalid declaration of '${propertyName}' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); + logError(`Ad unit ${adUnitCode}: Invalid declaration of '${propertyName}' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); return; } } @@ -152,13 +152,13 @@ export function checkAdUnitSetupHook(adUnits) { */ if (mediaType === 'native') { if (typeof config[propertyName] !== 'boolean') { - utils.logError(`Ad unit ${adUnitCode}: Invalid declaration of 'active' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); + logError(`Ad unit ${adUnitCode}: Invalid declaration of 'active' in 'mediaTypes.${mediaType}.sizeConfig[${index}]'. ${conditionalLogMessages[mediaType]}`); isValid = false; } } }); } else { - utils.logError(`Ad unit ${adUnitCode}: Invalid declaration of 'sizeConfig' in 'mediaTypes.${mediaType}.sizeConfig'. ${conditionalLogMessages[mediaType]}`); + logError(`Ad unit ${adUnitCode}: Invalid declaration of 'sizeConfig' in 'mediaTypes.${mediaType}.sizeConfig'. ${conditionalLogMessages[mediaType]}`); isValid = false; return isValid; } @@ -172,13 +172,13 @@ export function checkAdUnitSetupHook(adUnits) { const mediaTypes = adUnit.mediaTypes; let validatedBanner, validatedVideo, validatedNative; - if (!bids || !utils.isArray(bids)) { - utils.logError(`Detected adUnit.code '${adUnit.code}' did not have 'adUnit.bids' defined or 'adUnit.bids' is not an array. Removing adUnit from auction.`); + if (!bids || !isArray(bids)) { + logError(`Detected adUnit.code '${adUnit.code}' did not have 'adUnit.bids' defined or 'adUnit.bids' is not an array. Removing adUnit from auction.`); return; } if (!mediaTypes || Object.keys(mediaTypes).length === 0) { - utils.logError(`Detected adUnit.code '${adUnit.code}' did not have a 'mediaTypes' object defined. This is a required field for the auction, so this adUnit has been removed.`); + logError(`Detected adUnit.code '${adUnit.code}' did not have a 'mediaTypes' object defined. This is a required field for the auction, so this adUnit has been removed.`); return; } if (mediaTypes.banner) { @@ -187,7 +187,7 @@ export function checkAdUnitSetupHook(adUnits) { validatedBanner = adUnitSetupChecks.validateBannerMediaType(adUnit); } else if (mediaTypes.banner.sizeConfig) { // Ad unit is using the 'sizeConfig' property, 'mediaTypes.banner.sizeConfig'. Apply the new checks! - validatedBanner = utils.deepClone(adUnit); + validatedBanner = deepClone(adUnit); const isBannerValid = validateSizeConfig('banner', mediaTypes.banner.sizeConfig, adUnit.code); if (!isBannerValid) { delete validatedBanner.mediaTypes.banner; @@ -204,8 +204,8 @@ export function checkAdUnitSetupHook(adUnits) { } } else { // Ad unit is invalid since it's mediaType property does not have either 'sizes' or 'sizeConfig' declared. - utils.logError(`Ad unit ${adUnit.code}: 'mediaTypes.banner' does not contain either 'sizes' or 'sizeConfig' property. Removing 'mediaTypes.banner' from ad unit.`); - validatedBanner = utils.deepClone(adUnit); + logError(`Ad unit ${adUnit.code}: 'mediaTypes.banner' does not contain either 'sizes' or 'sizeConfig' property. Removing 'mediaTypes.banner' from ad unit.`); + validatedBanner = deepClone(adUnit); delete validatedBanner.mediaTypes.banner; } } @@ -216,7 +216,7 @@ export function checkAdUnitSetupHook(adUnits) { validatedVideo = validatedBanner ? adUnitSetupChecks.validateVideoMediaType(validatedBanner) : adUnitSetupChecks.validateVideoMediaType(adUnit); } else if (mediaTypes.video.sizeConfig) { // Ad unit is using the 'sizeConfig' property, 'mediaTypes.video.sizeConfig'. Apply the new checks! - validatedVideo = validatedBanner || utils.deepClone(adUnit); + validatedVideo = validatedBanner || deepClone(adUnit); const isVideoValid = validateSizeConfig('video', mediaTypes.video.sizeConfig, adUnit.code); if (!isVideoValid) { delete validatedVideo.mediaTypes.video.sizeConfig; @@ -274,7 +274,7 @@ export function checkBidderSizeConfigFormat(sizeConfig) { const keys = Object.keys(config); if ((includes(keys, 'minViewPort') && includes(keys, 'relevantMediaTypes')) && - utils.isArrayOfNums(config.minViewPort, 2) && + isArrayOfNums(config.minViewPort, 2) && Array.isArray(config.relevantMediaTypes) && config.relevantMediaTypes.length > 0 && (config.relevantMediaTypes.length > 1 ? (config.relevantMediaTypes.every(mt => (includes(['banner', 'video', 'native'], mt)))) @@ -322,14 +322,14 @@ export function isLabelActivated(bidOrAdUnit, activeLabels, adUnitCode, adUnitIn let labelOperator; const labelsFound = Object.keys(bidOrAdUnit).filter(prop => prop === 'labelAny' || prop === 'labelAll'); if (labelsFound && labelsFound.length > 1) { - utils.logWarn(`Size Mapping V2:: ${(bidOrAdUnit.code) + logWarn(`Size Mapping V2:: ${(bidOrAdUnit.code) ? (`Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Ad unit has multiple label operators. Using the first declared operator: ${labelsFound[0]}`) : (`Ad Unit: ${adUnitCode}(${adUnitInstance}), Bidder: ${bidOrAdUnit.bidder} => Bidder has multiple label operators. Using the first declared operator: ${labelsFound[0]}`)}`); } labelOperator = labelsFound[0]; if (labelOperator && !activeLabels) { - utils.logWarn(`Size Mapping V2:: ${(bidOrAdUnit.code) + logWarn(`Size Mapping V2:: ${(bidOrAdUnit.code) ? (`Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Found '${labelOperator}' on ad unit, but 'labels' is not set. Did you pass 'labels' to pbjs.requestBids() ?`) : (`Ad Unit: ${adUnitCode}(${adUnitInstance}), Bidder: ${bidOrAdUnit.bidder} => Found '${labelOperator}' on bidder, but 'labels' is not set. Did you pass 'labels' to pbjs.requestBids() ?`)}`); return true; @@ -337,13 +337,13 @@ export function isLabelActivated(bidOrAdUnit, activeLabels, adUnitCode, adUnitIn if (labelOperator === 'labelAll' && Array.isArray(bidOrAdUnit[labelOperator])) { if (bidOrAdUnit.labelAll.length === 0) { - utils.logWarn(`Size Mapping V2:: Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Ad unit has declared property 'labelAll' with an empty array.`); + logWarn(`Size Mapping V2:: Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Ad unit has declared property 'labelAll' with an empty array.`); return true; } return bidOrAdUnit.labelAll.every(label => includes(activeLabels, label)); } else if (labelOperator === 'labelAny' && Array.isArray(bidOrAdUnit[labelOperator])) { if (bidOrAdUnit.labelAny.length === 0) { - utils.logWarn(`Size Mapping V2:: Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Ad unit has declared property 'labelAny' with an empty array.`); + logWarn(`Size Mapping V2:: Ad Unit: ${bidOrAdUnit.code}(${adUnitInstance}) => Ad unit has declared property 'labelAny' with an empty array.`); return true; } return bidOrAdUnit.labelAny.some(label => includes(activeLabels, label)); @@ -363,7 +363,7 @@ export function getFilteredMediaTypes(mediaTypes) { activeViewportHeight, transformedMediaTypes; - transformedMediaTypes = utils.deepClone(mediaTypes); + transformedMediaTypes = deepClone(mediaTypes); let activeSizeBucket = { banner: undefined, @@ -372,10 +372,10 @@ export function getFilteredMediaTypes(mediaTypes) { } try { - activeViewportWidth = utils.getWindowTop().innerWidth; - activeViewportHeight = utils.getWindowTop().innerHeight; + activeViewportWidth = getWindowTop().innerWidth; + activeViewportHeight = getWindowTop().innerHeight; } catch (e) { - utils.logWarn(`SizeMappingv2:: Unfriendly iframe blocks viewport size to be evaluated correctly`); + logWarn(`SizeMappingv2:: Unfriendly iframe blocks viewport size to be evaluated correctly`); activeViewportWidth = window.innerWidth; activeViewportHeight = window.innerHeight; } @@ -490,7 +490,7 @@ export function getAdUnitDetail(auctionId, adUnit, labels) { const adUnitsForAuction = sizeMappingInternalStore.getAuctionDetail(auctionId).adUnits; // check if the adUnit exists already in the sizeMappingInterStore (check for equivalence of 'code' && 'mediaTypes' properties) - const adUnitDetail = adUnitsForAuction.filter(adUnitDetail => adUnitDetail.adUnitCode === adUnit.code && utils.deepEqual(adUnitDetail.mediaTypes, adUnit.mediaTypes)); + const adUnitDetail = adUnitsForAuction.filter(adUnitDetail => adUnitDetail.adUnitCode === adUnit.code && deepEqual(adUnitDetail.mediaTypes, adUnit.mediaTypes)); if (adUnitDetail.length > 0) { adUnitDetail[0].cacheHits++; @@ -514,7 +514,7 @@ export function getAdUnitDetail(auctionId, adUnit, labels) { // set adUnitDetail in sizeMappingInternalStore against the correct 'auctionId'. sizeMappingInternalStore.setAuctionDetail(auctionId, adUnitDetail); - isLabelActivated && utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Active size buckets after filtration: `, sizeBucketToSizeMap); + isLabelActivated && logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Active size buckets after filtration: `, sizeBucketToSizeMap); return adUnitDetail; } @@ -522,13 +522,13 @@ export function getAdUnitDetail(auctionId, adUnit, labels) { export function getBids({ bidderCode, auctionId, bidderRequestId, adUnits, labels, src }) { return adUnits.reduce((result, adUnit) => { - if (adUnit.mediaTypes && utils.isValidMediaTypes(adUnit.mediaTypes)) { + if (adUnit.mediaTypes && isValidMediaTypes(adUnit.mediaTypes)) { const { activeViewport, transformedMediaTypes, instance: adUnitInstance, isLabelActivated, cacheHits } = internal.getAdUnitDetail(auctionId, adUnit, labels); if (isLabelActivated) { // check if adUnit has any active media types remaining, if not drop the adUnit from auction, // else proceed to evaluate the bids object. if (Object.keys(transformedMediaTypes).length === 0) { - cacheHits === 0 && utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Ad unit disabled since there are no active media types after sizeConfig filtration.`); + cacheHits === 0 && logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Ad unit disabled since there are no active media types after sizeConfig filtration.`); return result; } result @@ -536,19 +536,19 @@ export function getBids({ bidderCode, auctionId, bidderRequestId, adUnits, label .reduce((bids, bid) => { if (internal.isLabelActivated(bid, labels, adUnit.code, adUnitInstance)) { // handle native params - const nativeParams = adUnit.nativeParams || utils.deepAccess(adUnit, 'mediaTypes.native'); + const nativeParams = adUnit.nativeParams || deepAccess(adUnit, 'mediaTypes.native'); if (nativeParams) { bid = Object.assign({}, bid, { nativeParams: processNativeAdUnitParams(nativeParams) }); } - bid = Object.assign({}, bid, utils.getDefinedParams(adUnit, ['mediaType', 'renderer'])); + bid = Object.assign({}, bid, getDefinedParams(adUnit, ['mediaType', 'renderer'])); if (bid.sizeConfig) { const relevantMediaTypes = internal.getRelevantMediaTypesForBidder(bid.sizeConfig, activeViewport); if (relevantMediaTypes.length === 0) { - utils.logError(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bidderCode} => 'sizeConfig' is not configured properly. This bidder won't be eligible for sizeConfig checks and will remail active.`); + logError(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bidderCode} => 'sizeConfig' is not configured properly. This bidder won't be eligible for sizeConfig checks and will remail active.`); bid = Object.assign({}, bid); } else if (relevantMediaTypes[0] !== 'none') { const bidderMediaTypes = Object @@ -562,20 +562,20 @@ export function getBids({ bidderCode, auctionId, bidderRequestId, adUnits, label if (Object.keys(bidderMediaTypes).length > 0) { bid = Object.assign({}, bid, { mediaTypes: bidderMediaTypes }); } else { - utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => 'relevantMediaTypes' does not match with any of the active mediaTypes at the Ad Unit level. This bidder is disabled.`); + logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => 'relevantMediaTypes' does not match with any of the active mediaTypes at the Ad Unit level. This bidder is disabled.`); return bids; } } else { - utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => 'relevantMediaTypes' is set to 'none' in sizeConfig for current viewport size. This bidder is disabled.`); + logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => 'relevantMediaTypes' is set to 'none' in sizeConfig for current viewport size. This bidder is disabled.`); return bids; } } bids.push(Object.assign({}, bid, { adUnitCode: adUnit.code, transactionId: adUnit.transactionId, - sizes: utils.deepAccess(transformedMediaTypes, 'banner.sizes') || utils.deepAccess(transformedMediaTypes, 'video.playerSize') || [], + sizes: deepAccess(transformedMediaTypes, 'banner.sizes') || deepAccess(transformedMediaTypes, 'video.playerSize') || [], mediaTypes: bid.mediaTypes || transformedMediaTypes, - bidId: bid.bid_id || utils.getUniqueIdentifierStr(), + bidId: bid.bid_id || getUniqueIdentifierStr(), bidderRequestId, auctionId, src, @@ -585,17 +585,17 @@ export function getBids({ bidderCode, auctionId, bidderRequestId, adUnits, label })); return bids; } else { - utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => Label check for this bidder has failed. This bidder is disabled.`); + logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}), Bidder: ${bid.bidder} => Label check for this bidder has failed. This bidder is disabled.`); return bids; } }, [])); } else { - cacheHits === 0 && utils.logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Ad unit is disabled due to failing label check.`); + cacheHits === 0 && logInfo(`Size Mapping V2:: Ad Unit: ${adUnit.code}(${adUnitInstance}) => Ad unit is disabled due to failing label check.`); } } else { - utils.logWarn(`Size Mapping V2:: Ad Unit: ${adUnit.code} => Ad unit has declared invalid 'mediaTypes' or has not declared a 'mediaTypes' property`); + logWarn(`Size Mapping V2:: Ad Unit: ${adUnit.code} => Ad unit has declared invalid 'mediaTypes' or has not declared a 'mediaTypes' property`); return result; } return result; - }, []).reduce(utils.flatten, []).filter(val => val !== ''); + }, []).reduce(flatten, []).filter(val => val !== ''); } diff --git a/modules/smaatoBidAdapter.js b/modules/smaatoBidAdapter.js index 700fcf17785..dd389b42098 100644 --- a/modules/smaatoBidAdapter.js +++ b/modules/smaatoBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, getDNT, deepSetValue, logInfo, logError, isEmpty, getAdUnitSizes, fill, chunk, getMaxValueFromArray, getMinValueFromArray } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; import {ADPOD, BANNER, VIDEO} from '../src/mediaTypes.js'; @@ -17,7 +17,7 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => { site: { id: window.location.hostname, publisher: { - id: utils.deepAccess(bidRequest, 'params.publisherId') + id: deepAccess(bidRequest, 'params.publisherId') }, domain: window.location.hostname, page: window.location.href, @@ -26,7 +26,7 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => { device: { language: (navigator && navigator.language) ? navigator.language.split('-')[0] : '', ua: navigator.userAgent, - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, h: screen.height, w: screen.width }, @@ -47,34 +47,34 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => { Object.assign(requestTemplate.site, ortb2.site); if (bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies === true) { - utils.deepSetValue(requestTemplate, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies ? 1 : 0); - utils.deepSetValue(requestTemplate, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(requestTemplate, 'regs.ext.gdpr', bidderRequest.gdprConsent.gdprApplies ? 1 : 0); + deepSetValue(requestTemplate, 'user.ext.consent', bidderRequest.gdprConsent.consentString); } if (bidderRequest.uspConsent !== undefined) { - utils.deepSetValue(requestTemplate, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(requestTemplate, 'regs.ext.us_privacy', bidderRequest.uspConsent); } - if (utils.deepAccess(bidRequest, 'params.app')) { - const geo = utils.deepAccess(bidRequest, 'params.app.geo'); - utils.deepSetValue(requestTemplate, 'device.geo', geo); - const ifa = utils.deepAccess(bidRequest, 'params.app.ifa') - utils.deepSetValue(requestTemplate, 'device.ifa', ifa); + if (deepAccess(bidRequest, 'params.app')) { + const geo = deepAccess(bidRequest, 'params.app.geo'); + deepSetValue(requestTemplate, 'device.geo', geo); + const ifa = deepAccess(bidRequest, 'params.app.ifa') + deepSetValue(requestTemplate, 'device.ifa', ifa); } - const eids = utils.deepAccess(bidRequest, 'userIdAsEids'); + const eids = deepAccess(bidRequest, 'userIdAsEids'); if (eids && eids.length) { - utils.deepSetValue(requestTemplate, 'user.ext.eids', eids); + deepSetValue(requestTemplate, 'user.ext.eids', eids); } let requests = []; - if (utils.deepAccess(bidRequest, 'mediaTypes.banner')) { + if (deepAccess(bidRequest, 'mediaTypes.banner')) { const bannerRequest = Object.assign({}, requestTemplate, createBannerImp(bidRequest)); requests.push(bannerRequest); } - const videoMediaType = utils.deepAccess(bidRequest, 'mediaTypes.video'); + const videoMediaType = deepAccess(bidRequest, 'mediaTypes.video'); if (videoMediaType) { if (videoMediaType.context === ADPOD) { const adPodRequest = Object.assign({}, requestTemplate, createAdPodImp(bidRequest, videoMediaType)); @@ -90,7 +90,7 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => { } const buildServerRequest = (validBidRequest, data) => { - utils.logInfo('[SMAATO] OpenRTB Request:', data); + logInfo('[SMAATO] OpenRTB Request:', data); return { method: 'POST', url: validBidRequest.params.endpoint || SMAATO_ENDPOINT, @@ -114,47 +114,47 @@ export const spec = { */ isBidRequestValid: (bid) => { if (typeof bid.params !== 'object') { - utils.logError('[SMAATO] Missing params object'); + logError('[SMAATO] Missing params object'); return false; } if (typeof bid.params.publisherId !== 'string') { - utils.logError('[SMAATO] Missing mandatory publisherId param'); + logError('[SMAATO] Missing mandatory publisherId param'); return false; } - if (utils.deepAccess(bid, 'mediaTypes.video.context') === ADPOD) { - utils.logInfo('[SMAATO] Verifying adpod bid request'); + if (deepAccess(bid, 'mediaTypes.video.context') === ADPOD) { + logInfo('[SMAATO] Verifying adpod bid request'); if (typeof bid.params.adbreakId !== 'string') { - utils.logError('[SMAATO] Missing for adpod request mandatory adbreakId param'); + logError('[SMAATO] Missing for adpod request mandatory adbreakId param'); return false; } if (bid.params.adspaceId) { - utils.logError('[SMAATO] The adspaceId param is not allowed in an adpod bid request'); + logError('[SMAATO] The adspaceId param is not allowed in an adpod bid request'); return false; } } else { - utils.logInfo('[SMAATO] Verifying a non adpod bid request'); + logInfo('[SMAATO] Verifying a non adpod bid request'); if (typeof bid.params.adspaceId !== 'string') { - utils.logError('[SMAATO] Missing mandatory adspaceId param'); + logError('[SMAATO] Missing mandatory adspaceId param'); return false; } if (bid.params.adbreakId) { - utils.logError('[SMAATO] The adbreakId param is only allowed in an adpod bid request'); + logError('[SMAATO] The adbreakId param is only allowed in an adpod bid request'); return false; } } - utils.logInfo('[SMAATO] Verification done, all good'); + logInfo('[SMAATO] Verification done, all good'); return true; }, buildRequests: (validBidRequests, bidderRequest) => { - utils.logInfo('[SMAATO] Client version:', SMAATO_CLIENT); + logInfo('[SMAATO] Client version:', SMAATO_CLIENT); return validBidRequests.map((validBidRequest) => { const openRtbBidRequests = buildOpenRtbBidRequest(validBidRequest, bidderRequest); @@ -169,19 +169,19 @@ export const spec = { */ interpretResponse: (serverResponse, bidRequest) => { // response is empty (HTTP 204) - if (utils.isEmpty(serverResponse.body)) { - utils.logInfo('[SMAATO] Empty response body HTTP 204, no bids'); + if (isEmpty(serverResponse.body)) { + logInfo('[SMAATO] Empty response body HTTP 204, no bids'); return []; // no bids } const serverResponseHeaders = serverResponse.headers; const smtExpires = serverResponseHeaders.get('X-SMT-Expires'); - utils.logInfo('[SMAATO] Expires:', smtExpires); + logInfo('[SMAATO] Expires:', smtExpires); const ttlInSec = smtExpires ? Math.floor((smtExpires - Date.now()) / 1000) : 300; const response = serverResponse.body; - utils.logInfo('[SMAATO] OpenRTB Response:', response); + logInfo('[SMAATO] OpenRTB Response:', response); const smtAdType = serverResponseHeaders.get('X-SMT-ADTYPE'); const bids = []; @@ -195,7 +195,7 @@ export const spec = { ttl: ttlInSec, creativeId: bid.crid, dealId: bid.dealid || null, - netRevenue: utils.deepAccess(bid, 'ext.net', true), + netRevenue: deepAccess(bid, 'ext.net', true), currency: response.cur, meta: { advertiserDomains: bid.adomain, @@ -204,7 +204,7 @@ export const spec = { } }; - const videoContext = utils.deepAccess(JSON.parse(bidRequest.data).imp[0], 'video.ext.context') + const videoContext = deepAccess(JSON.parse(bidRequest.data).imp[0], 'video.ext.context') if (videoContext === ADPOD) { resultingBid.vastXml = bid.adm; resultingBid.mediaType = VIDEO; @@ -234,14 +234,14 @@ export const spec = { bids.push(resultingBid); break; default: - utils.logInfo('[SMAATO] Invalid ad type:', smtAdType); + logInfo('[SMAATO] Invalid ad type:', smtAdType); } } resultingBid.meta.mediaType = resultingBid.mediaType; }); }); - utils.logInfo('[SMAATO] Prebid bids:', bids); + logInfo('[SMAATO] Prebid bids:', bids); return bids; }, @@ -292,12 +292,12 @@ const createRichmediaAd = (adm) => { }; function createBannerImp(bidRequest) { - const adUnitSizes = utils.getAdUnitSizes(bidRequest); + const adUnitSizes = getAdUnitSizes(bidRequest); const sizes = adUnitSizes.map((size) => ({w: size[0], h: size[1]})); return { imp: [{ id: bidRequest.bidId, - tagid: utils.deepAccess(bidRequest, 'params.adspaceId'), + tagid: deepAccess(bidRequest, 'params.adspaceId'), bidfloor: getBidFloor(bidRequest, BANNER, adUnitSizes), banner: { w: sizes[0].w, @@ -312,7 +312,7 @@ function createVideoImp(bidRequest, videoMediaType) { return { imp: [{ id: bidRequest.bidId, - tagid: utils.deepAccess(bidRequest, 'params.adspaceId'), + tagid: deepAccess(bidRequest, 'params.adspaceId'), bidfloor: getBidFloor(bidRequest, VIDEO, videoMediaType.playerSize), video: { mimes: videoMediaType.mimes, @@ -335,7 +335,7 @@ function createVideoImp(bidRequest, videoMediaType) { } function createAdPodImp(bidRequest, videoMediaType) { - const tagid = utils.deepAccess(bidRequest, 'params.adbreakId') + const tagid = deepAccess(bidRequest, 'params.adbreakId') const bce = config.getConfig('adpod.brandCategoryExclusion') let imp = { id: bidRequest.bidId, @@ -359,13 +359,13 @@ function createAdPodImp(bidRequest, videoMediaType) { } const numberOfPlacements = getAdPodNumberOfPlacements(videoMediaType) - let imps = utils.fill(imp, numberOfPlacements) + let imps = fill(imp, numberOfPlacements) const durationRangeSec = videoMediaType.durationRangeSec if (videoMediaType.requireExactDuration) { // equal distribution of numberOfPlacement over all available durations const divider = Math.ceil(numberOfPlacements / durationRangeSec.length) - const chunked = utils.chunk(imps, divider) + const chunked = chunk(imps, divider) // each configured duration is set as min/maxduration for a subset of requests durationRangeSec.forEach((duration, index) => { @@ -378,7 +378,7 @@ function createAdPodImp(bidRequest, videoMediaType) { }); } else { // all maxdurations should be the same - const maxDuration = utils.getMaxValueFromArray(durationRangeSec); + const maxDuration = getMaxValueFromArray(durationRangeSec); imps.map((imp, index) => { const sequence = index + 1; imp.video.maxduration = maxDuration @@ -393,7 +393,7 @@ function createAdPodImp(bidRequest, videoMediaType) { function getAdPodNumberOfPlacements(videoMediaType) { const {adPodDurationSec, durationRangeSec, requireExactDuration} = videoMediaType - const minAllowedDuration = utils.getMinValueFromArray(durationRangeSec) + const minAllowedDuration = getMinValueFromArray(durationRangeSec) const numberOfPlacements = Math.floor(adPodDurationSec / minAllowedDuration) return requireExactDuration @@ -423,7 +423,7 @@ const addOptionalAdpodParameters = (request, videoMediaType) => { content.livestream = videoMediaType.contentMode === 'live' ? 1 : 0 } - if (!utils.isEmpty(content)) { + if (!isEmpty(content)) { request.site.content = content } } diff --git a/modules/smartadserverBidAdapter.js b/modules/smartadserverBidAdapter.js index a7b609bca20..d6e1c8de452 100644 --- a/modules/smartadserverBidAdapter.js +++ b/modules/smartadserverBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, deepClone, logError, isFn, isPlainObject } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; import { createEidsArray } from './userId/eids.js'; @@ -170,8 +170,8 @@ export const spec = { payload.us_privacy = bidderRequest.uspConsent; } - const videoMediaType = utils.deepAccess(bid, 'mediaTypes.video'); - const bannerMediaType = utils.deepAccess(bid, 'mediaTypes.banner'); + const videoMediaType = deepAccess(bid, 'mediaTypes.video'); + const bannerMediaType = deepAccess(bid, 'mediaTypes.banner'); const isAdUnitContainingVideo = videoMediaType && (videoMediaType.context === 'instream' || videoMediaType.context === 'outstream'); if (!isAdUnitContainingVideo && bannerMediaType) { payload.sizes = spec.adaptBannerSizes(bannerMediaType.sizes); @@ -182,7 +182,7 @@ export const spec = { } else if (isAdUnitContainingVideo && bannerMediaType) { // If there are video and banner media types in the ad unit, we clone the payload // to create a specific one for video. - let videoPayload = utils.deepClone(payload); + let videoPayload = deepClone(payload); spec.fillPayloadForVideoBidRequest(videoPayload, videoMediaType, bid.params.video); bidRequests.push(spec.createServerRequest(videoPayload, bid.params.domain)); @@ -238,7 +238,7 @@ export const spec = { bidResponses.push(bidResponse); } } catch (error) { - utils.logError('Error while parsing smart server response', error); + logError('Error while parsing smart server response', error); } return bidResponses; }, @@ -251,7 +251,7 @@ export const spec = { * @return {number} Floor price */ getBidFloor: function (bid, currency) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return DEFAULT_FLOOR; } @@ -261,7 +261,7 @@ export const spec = { size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor)) { + if (isPlainObject(floor) && !isNaN(floor.floor)) { return floor.floor; } diff --git a/modules/smartxBidAdapter.js b/modules/smartxBidAdapter.js index 73e036cadb0..da63331cd0f 100644 --- a/modules/smartxBidAdapter.js +++ b/modules/smartxBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logError, deepAccess, isArray, getBidIdParameter, getDNT, generateUUID, isEmpty, _each, logMessage, logWarn, isFn, isPlainObject } from '../src/utils.js'; import { Renderer } from '../src/Renderer.js'; @@ -22,37 +22,37 @@ export const spec = { */ isBidRequestValid: function (bid) { if (bid && typeof bid.params !== 'object') { - utils.logError(BIDDER_CODE + ': params is not defined or is incorrect in the bidder settings.'); + logError(BIDDER_CODE + ': params is not defined or is incorrect in the bidder settings.'); return false; } - if (!utils.deepAccess(bid, 'mediaTypes.video')) { - utils.logError(BIDDER_CODE + ': mediaTypes.video is not present in the bidder settings.'); + if (!deepAccess(bid, 'mediaTypes.video')) { + logError(BIDDER_CODE + ': mediaTypes.video is not present in the bidder settings.'); return false; } - const playerSize = utils.deepAccess(bid, 'mediaTypes.video.playerSize'); - if (!playerSize || !utils.isArray(playerSize)) { - utils.logError(BIDDER_CODE + ': mediaTypes.video.playerSize is not defined in the bidder settings.'); + const playerSize = deepAccess(bid, 'mediaTypes.video.playerSize'); + if (!playerSize || !isArray(playerSize)) { + logError(BIDDER_CODE + ': mediaTypes.video.playerSize is not defined in the bidder settings.'); return false; } - if (!utils.getBidIdParameter('tagId', bid.params)) { - utils.logError(BIDDER_CODE + ': tagId is not present in bidder params'); + if (!getBidIdParameter('tagId', bid.params)) { + logError(BIDDER_CODE + ': tagId is not present in bidder params'); return false; } - if (!utils.getBidIdParameter('publisherId', bid.params)) { - utils.logError(BIDDER_CODE + ': publisherId is not present in bidder params'); + if (!getBidIdParameter('publisherId', bid.params)) { + logError(BIDDER_CODE + ': publisherId is not present in bidder params'); return false; } - if (!utils.getBidIdParameter('siteId', bid.params)) { - utils.logError(BIDDER_CODE + ': siteId is not present in bidder params'); + if (!getBidIdParameter('siteId', bid.params)) { + logError(BIDDER_CODE + ': siteId is not present in bidder params'); return false; } - if (utils.deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { - if (!utils.getBidIdParameter('outstream_options', bid.params)) { - utils.logError(BIDDER_CODE + ': outstream_options parameter is not defined'); + if (deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + if (!getBidIdParameter('outstream_options', bid.params)) { + logError(BIDDER_CODE + ': outstream_options parameter is not defined'); return false; } - if (!utils.getBidIdParameter('slot', bid.params.outstream_options)) { - utils.logError(BIDDER_CODE + ': slot parameter is not defined in outstream_options object in the configuration'); + if (!getBidIdParameter('slot', bid.params.outstream_options)) { + logError(BIDDER_CODE + ': slot parameter is not defined in outstream_options object in the configuration'); return false; } } @@ -71,33 +71,33 @@ export const spec = { const isPageSecure = !!page.match(/^https:/) const smartxRequests = bidRequests.map(function (bid) { - const tagId = utils.getBidIdParameter('tagId', bid.params); - const publisherId = utils.getBidIdParameter('publisherId', bid.params); + const tagId = getBidIdParameter('tagId', bid.params); + const publisherId = getBidIdParameter('publisherId', bid.params); const bidfloor = getBidFloor(bid) || 0; - const bidfloorcur = utils.getBidIdParameter('bidfloorcur', bid.params) || 'EUR'; - const siteId = utils.getBidIdParameter('siteId', bid.params); - const domain = utils.getBidIdParameter('domain', bid.params); - const cat = utils.getBidIdParameter('cat', bid.params) || ['']; + const bidfloorcur = getBidIdParameter('bidfloorcur', bid.params) || 'EUR'; + const siteId = getBidIdParameter('siteId', bid.params); + const domain = getBidIdParameter('domain', bid.params); + const cat = getBidIdParameter('cat', bid.params) || ['']; let pubcid = null; - const playerSize = utils.deepAccess(bid, 'mediaTypes.video.playerSize'); + const playerSize = deepAccess(bid, 'mediaTypes.video.playerSize'); const contentWidth = playerSize[0][0]; const contentHeight = playerSize[0][1]; - const secure = +(isPageSecure || (utils.getBidIdParameter('secure', bid.params) ? 1 : 0)); + const secure = +(isPageSecure || (getBidIdParameter('secure', bid.params) ? 1 : 0)); const ext = { sdk_name: 'Prebid 1+' }; - const mimes = utils.getBidIdParameter('mimes', bid.params) || ['application/javascript', 'video/mp4', 'video/webm']; - const linearity = utils.getBidIdParameter('linearity', bid.params) || 1; - const minduration = utils.getBidIdParameter('minduration', bid.params) || 0; - const maxduration = utils.getBidIdParameter('maxduration', bid.params) || 500; - const startdelay = utils.getBidIdParameter('startdelay', bid.params) || 0; - const minbitrate = utils.getBidIdParameter('minbitrate', bid.params) || 0; - const maxbitrate = utils.getBidIdParameter('maxbitrate', bid.params) || 3500; - const delivery = utils.getBidIdParameter('delivery', bid.params) || [2]; - const pos = utils.getBidIdParameter('pos', bid.params) || 1; - const api = utils.getBidIdParameter('api', bid.params) || [2]; - const protocols = utils.getBidIdParameter('protocols', bid.params) || [2, 3, 5, 6]; - var contextcustom = utils.deepAccess(bid, 'mediaTypes.video.context'); + const mimes = getBidIdParameter('mimes', bid.params) || ['application/javascript', 'video/mp4', 'video/webm']; + const linearity = getBidIdParameter('linearity', bid.params) || 1; + const minduration = getBidIdParameter('minduration', bid.params) || 0; + const maxduration = getBidIdParameter('maxduration', bid.params) || 500; + const startdelay = getBidIdParameter('startdelay', bid.params) || 0; + const minbitrate = getBidIdParameter('minbitrate', bid.params) || 0; + const maxbitrate = getBidIdParameter('maxbitrate', bid.params) || 3500; + const delivery = getBidIdParameter('delivery', bid.params) || [2]; + const pos = getBidIdParameter('pos', bid.params) || 1; + const api = getBidIdParameter('api', bid.params) || [2]; + const protocols = getBidIdParameter('protocols', bid.params) || [2, 3, 5, 6]; + var contextcustom = deepAccess(bid, 'mediaTypes.video.context'); var placement = 1; if (contextcustom === 'outstream') { @@ -141,18 +141,18 @@ export const spec = { const device = { h: screen.height, w: screen.width, - dnt: utils.getDNT() ? 1 : 0, + dnt: getDNT() ? 1 : 0, language: navigator[language].split('-')[0], make: navigator.vendor ? navigator.vendor : '', ua: navigator.userAgent }; - const at = utils.getBidIdParameter('at', bid.params) || 2; + const at = getBidIdParameter('at', bid.params) || 2; - const cur = utils.getBidIdParameter('cur', bid.params) || ['EUR']; + const cur = getBidIdParameter('cur', bid.params) || ['EUR']; const requestPayload = { - id: utils.generateUUID(), + id: generateUUID(), imp: smartxReq, site: { id: siteId, @@ -188,14 +188,14 @@ export const spec = { } // Only add the user object if it's not empty - if (!utils.isEmpty(userExt)) { + if (!isEmpty(userExt)) { requestPayload.user = { ext: userExt }; } // Targeting - if (utils.getBidIdParameter('data', bid.params.user)) { + if (getBidIdParameter('data', bid.params.user)) { var targetingarr = []; for (var i = 0; i < bid.params.user.data.length; i++) { var isemq = (bid.params.user.data[i].name) || 'empty'; @@ -246,9 +246,9 @@ export const spec = { interpretResponse: function (serverResponse, bidderRequest) { const bidResponses = []; const serverResponseBody = serverResponse.body; - if (serverResponseBody && utils.isArray(serverResponseBody.seatbid)) { - utils._each(serverResponseBody.seatbid, function (bids) { - utils._each(bids.bid, function (smartxBid) { + if (serverResponseBody && isArray(serverResponseBody.seatbid)) { + _each(serverResponseBody.seatbid, function (bids) { + _each(bids.bid, function (smartxBid) { let currentBidRequest = {}; for (let i in bidderRequest.bidRequest.bids) { if (smartxBid.impid == bidderRequest.bidRequest.bids[i].bidId) { @@ -259,7 +259,7 @@ export const spec = { * Make sure currency and price are the right ones * TODO: what about the pre_market_bid partners sizes? */ - utils._each(currentBidRequest.params.pre_market_bids, function (pmb) { + _each(currentBidRequest.params.pre_market_bids, function (pmb) { if (pmb.deal_id == smartxBid.id) { smartxBid.price = pmb.price; serverResponseBody.cur = pmb.currency; @@ -285,10 +285,10 @@ export const spec = { bid.meta.advertiserDomains = smartxBid.adomain; } - const context = utils.deepAccess(currentBidRequest, 'mediaTypes.video.context'); + const context = deepAccess(currentBidRequest, 'mediaTypes.video.context'); if (context === 'outstream') { - const playersize = utils.deepAccess(currentBidRequest, 'mediaTypes.video.playerSize'); + const playersize = deepAccess(currentBidRequest, 'mediaTypes.video.playerSize'); const renderer = Renderer.install({ id: 0, url: 'https://dco.smartclip.net/?plc=7777778', @@ -296,27 +296,27 @@ export const spec = { adText: 'SmartX Outstream Video Ad via Prebid.js', player_width: playersize[0][0], player_height: playersize[0][1], - content_page_url: utils.deepAccess(bidderRequest, 'data.site.page'), - ad_mute: +!!utils.deepAccess(currentBidRequest, 'params.ad_mute'), - hide_skin: +!!utils.deepAccess(currentBidRequest, 'params.hide_skin'), - outstream_options: utils.deepAccess(currentBidRequest, 'params.outstream_options') + content_page_url: deepAccess(bidderRequest, 'data.site.page'), + ad_mute: +!!deepAccess(currentBidRequest, 'params.ad_mute'), + hide_skin: +!!deepAccess(currentBidRequest, 'params.hide_skin'), + outstream_options: deepAccess(currentBidRequest, 'params.outstream_options') } }); try { renderer.setRender(createOutstreamConfig); renderer.setEventHandlers({ impression: function impression() { - return utils.logMessage('SmartX outstream video impression event'); + return logMessage('SmartX outstream video impression event'); }, loaded: function loaded() { - return utils.logMessage('SmartX outstream video loaded event'); + return logMessage('SmartX outstream video loaded event'); }, ended: function ended() { - return utils.logMessage('SmartX outstream renderer video event'); + return logMessage('SmartX outstream renderer video event'); } }); } catch (err) { - utils.logWarn('Prebid Error calling setRender or setEventHandlers on renderer', err); + logWarn('Prebid Error calling setRender or setEventHandlers on renderer', err); } bid.renderer = renderer; } @@ -329,16 +329,16 @@ export const spec = { } function createOutstreamConfig(bid) { - let confMinAdWidth = utils.getBidIdParameter('minAdWidth', bid.renderer.config.outstream_options) || 290; - let confMaxAdWidth = utils.getBidIdParameter('maxAdWidth', bid.renderer.config.outstream_options) || 900; - let confStartOpen = utils.getBidIdParameter('startOpen', bid.renderer.config.outstream_options) - let confEndingScreen = utils.getBidIdParameter('endingScreen', bid.renderer.config.outstream_options) - let confTitle = utils.getBidIdParameter('title', bid.renderer.config.outstream_options); - let confSkipOffset = utils.getBidIdParameter('skipOffset', bid.renderer.config.outstream_options); - let confDesiredBitrate = utils.getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options); - let elementId = utils.getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode; + let confMinAdWidth = getBidIdParameter('minAdWidth', bid.renderer.config.outstream_options) || 290; + let confMaxAdWidth = getBidIdParameter('maxAdWidth', bid.renderer.config.outstream_options) || 900; + let confStartOpen = getBidIdParameter('startOpen', bid.renderer.config.outstream_options) + let confEndingScreen = getBidIdParameter('endingScreen', bid.renderer.config.outstream_options) + let confTitle = getBidIdParameter('title', bid.renderer.config.outstream_options); + let confSkipOffset = getBidIdParameter('skipOffset', bid.renderer.config.outstream_options); + let confDesiredBitrate = getBidIdParameter('desiredBitrate', bid.renderer.config.outstream_options); + let elementId = getBidIdParameter('slot', bid.renderer.config.outstream_options) || bid.adUnitCode; - utils.logMessage('[SMARTX][renderer] Handle SmartX outstream renderer'); + logMessage('[SMARTX][renderer] Handle SmartX outstream renderer'); var smartPlayObj = { minAdWidth: confMinAdWidth, @@ -392,7 +392,7 @@ function createOutstreamConfig(bid) { // eslint-disable-next-line let _outstreamPlayer = new OutstreamPlayer(divID, smartPlayObj); } catch (e) { - utils.logError('[SMARTX][renderer] Error caught: ' + e); + logError('[SMARTX][renderer] Error caught: ' + e); } return smartPlayObj; } @@ -404,17 +404,17 @@ function createOutstreamConfig(bid) { * @returns {*|number} floor price */ function getBidFloor(bid) { - let floor = utils.getBidIdParameter('bidfloor', bid.params); - let floorcur = utils.getBidIdParameter('bidfloorcur', bid.params) || 'EUR'; + let floor = getBidIdParameter('bidfloor', bid.params); + let floorcur = getBidIdParameter('bidfloorcur', bid.params) || 'EUR'; - if (!floor && utils.isFn(bid.getFloor)) { + if (!floor && isFn(bid.getFloor)) { const floorObj = bid.getFloor({ currency: floorcur, mediaType: '*', size: '*' }); - if (utils.isPlainObject(floorObj) && !isNaN(floorObj.floor) && floorObj.currency === floorcur) { + if (isPlainObject(floorObj) && !isNaN(floorObj.floor) && floorObj.currency === floorcur) { floor = floorObj.floor; } } diff --git a/modules/smartyadsBidAdapter.js b/modules/smartyadsBidAdapter.js index 9c38cb89492..b999d02b059 100644 --- a/modules/smartyadsBidAdapter.js +++ b/modules/smartyadsBidAdapter.js @@ -1,7 +1,7 @@ +import { logMessage } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'smartyads'; const AD_URL = 'https://n1.smartyads.com/?c=o&m=prebid&secret_key=prebid_js'; @@ -40,7 +40,7 @@ export const spec = { winTop = window.top; } catch (e) { location = winTop.location; - utils.logMessage(e); + logMessage(e); }; let placements = []; let request = { diff --git a/modules/smilewantedBidAdapter.js b/modules/smilewantedBidAdapter.js index 65f166566fe..73bd6101670 100644 --- a/modules/smilewantedBidAdapter.js +++ b/modules/smilewantedBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isArray, logError, logWarn, isFn, isPlainObject } from '../src/utils.js'; import { Renderer } from '../src/Renderer.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; @@ -108,13 +108,13 @@ export const spec = { } bidResponse.meta = {}; - if (response.meta && response.meta.advertiserDomains && utils.isArray(response.meta.advertiserDomains)) { + if (response.meta && response.meta.advertiserDomains && isArray(response.meta.advertiserDomains)) { bidResponse.meta.advertiserDomains = response.meta.advertiserDomains; } bidResponses.push(bidResponse); } } catch (error) { - utils.logError('Error while parsing smilewanted response', error); + logError('Error while parsing smilewanted response', error); } return bidResponses; }, @@ -170,7 +170,7 @@ function newRenderer(bidRequest, bidResponse) { try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on newRenderer', err); + logWarn('Prebid Error calling setRender on newRenderer', err); } return renderer; } @@ -197,13 +197,13 @@ function outstreamRender(bid) { * @returns {*|number} floor price */ function getBidFloor(bid) { - if (utils.isFn(bid.getFloor)) { + if (isFn(bid.getFloor)) { const floorInfo = bid.getFloor({ currency: 'USD', mediaType: 'banner', size: bid.sizes.map(size => ({ w: size[0], h: size[1] })) }); - if (utils.isPlainObject(floorInfo) && !isNaN(floorInfo.floor) && floorInfo.currency === 'USD') { + if (isPlainObject(floorInfo) && !isNaN(floorInfo.floor) && floorInfo.currency === 'USD') { return parseFloat(floorInfo.floor); } } diff --git a/modules/sonobiAnalyticsAdapter.js b/modules/sonobiAnalyticsAdapter.js index d69276e915c..0de6647149a 100644 --- a/modules/sonobiAnalyticsAdapter.js +++ b/modules/sonobiAnalyticsAdapter.js @@ -1,9 +1,9 @@ +import { deepClone, logInfo, logError } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; import {ajaxBuilder} from '../src/ajax.js'; -const utils = require('../src/utils.js'); let ajax = ajaxBuilder(0); const DEFAULT_EVENT_URL = 'apex.go.sonobi.com/keymaker'; @@ -91,7 +91,7 @@ function addToAuctionQueue(auctionId, id) { if (item.bidid !== id) { return true; } return auction.stats[id].data.p !== item.p; }); - auction.queue.push(utils.deepClone(auction.stats[id].data)); + auction.queue.push(deepClone(auction.stats[id].data)); if (!auction.qTimeout) { auction.qTimeout = setTimeout(() => { sendQueue(auctionId); @@ -102,18 +102,18 @@ function updateBidStats(auctionId, id, data) { let auction = auctionCache[auctionId]; auction.stats[id].data = {...auction.stats[id].data, ...data}; addToAuctionQueue(auctionId, id); - logInfo('Updated Bid Stats: ', auction.stats[id]); + _logInfo('Updated Bid Stats: ', auction.stats[id]); return auction.stats[id]; } function handleOtherEvents(eventType, args) { - logInfo('Other Event: ' + eventType, args); + _logInfo('Other Event: ' + eventType, args); } function handlerAuctionInit(args) { auctionCache[args.auctionId] = buildAuctionEntity(args); deleteOldAuctions(); - logInfo('Auction Init', args); + _logInfo('Auction Init', args); } function handlerBidRequested(args) { let auction = auctionCache[args.auctionId]; @@ -127,14 +127,14 @@ function handlerBidRequested(args) { addToAuctionQueue(args.auctionId, built.bidid); }) - logInfo('Bids Requested ', data); + _logInfo('Bids Requested ', data); } function handlerBidAdjustment(args) { - logInfo('Bid Adjustment', args); + _logInfo('Bid Adjustment', args); } function handlerBidderDone(args) { - logInfo('Bidder Done', args); + _logInfo('Bidder Done', args); } function handlerAuctionEnd(args) { @@ -152,24 +152,24 @@ function handlerAuctionEnd(args) { updateBidStats(args.auctionId, bidId, {response: 4}); } }) - logInfo('Auction End', args); - logInfo('Auction Cache', auctionCache[args.auctionId].stats); + _logInfo('Auction End', args); + _logInfo('Auction Cache', auctionCache[args.auctionId].stats); } function handlerBidWon(args) { let {auctionId, requestId} = args; let res = updateBidStats(auctionId, requestId, {p: 3, response: 6}); - logInfo('Bid Won ', args); - logInfo('Bid Update Result: ', res); + _logInfo('Bid Won ', args); + _logInfo('Bid Update Result: ', res); } function handlerBidResponse(args) { let {auctionId, requestId, cpm, size, timeToRespond} = args; updateBidStats(auctionId, requestId, {bid: cpm, s: size, jsLatency: timeToRespond, latency: timeToRespond, p: 2, response: 9}); - logInfo('Bid Response ', args); + _logInfo('Bid Response ', args); } function handlerBidTimeout(args) { let {auctionId, bidId} = args; - logInfo('Bid Timeout ', args); + _logInfo('Bid Timeout ', args); updateBidStats(auctionId, bidId, {p: 2, response: 0, latency: args.timeout, jsLatency: args.timeout}); } let sonobiAdapter = Object.assign(adapter({url: DEFAULT_EVENT_URL, analyticsType}), { @@ -211,7 +211,7 @@ sonobiAdapter.originEnableAnalytics = sonobiAdapter.enableAnalytics; sonobiAdapter.enableAnalytics = function (config) { if (this.initConfig(config)) { - logInfo('Analytics adapter enabled', initOptions); + _logInfo('Analytics adapter enabled', initOptions); sonobiAdapter.originEnableAnalytics(config); } }; @@ -219,17 +219,17 @@ sonobiAdapter.enableAnalytics = function (config) { sonobiAdapter.initConfig = function (config) { let isCorrectConfig = true; initOptions = {}; - initOptions.options = utils.deepClone(config.options); + initOptions.options = deepClone(config.options); initOptions.pubId = initOptions.options.pubId || null; initOptions.siteId = initOptions.options.siteId || null; initOptions.delay = initOptions.options.delay || QUEUE_TIMEOUT_DEFAULT; if (!initOptions.pubId) { - logError('"options.pubId" is empty'); + _logError('"options.pubId" is empty'); isCorrectConfig = false; } if (!initOptions.siteId) { - logError('"options.siteId" is empty'); + _logError('"options.siteId" is empty'); isCorrectConfig = false; } @@ -247,7 +247,7 @@ sonobiAdapter.sendData = function (auction, data) { let url = 'https://' + initOptions.server + '?pageviewid=' + auction.id + '&corscred=1&pubId=' + initOptions.pubId + '&siteId=' + initOptions.siteId; ajax( url, - function () { logInfo('Auction [' + auction.id + '] sent ', data); }, + function () { _logInfo('Auction [' + auction.id + '] sent ', data); }, JSON.stringify(data), { method: 'POST', @@ -257,12 +257,12 @@ sonobiAdapter.sendData = function (auction, data) { ); } -function logInfo(message, meta) { - utils.logInfo(buildLogMessage(message), meta); +function _logInfo(message, meta) { + logInfo(buildLogMessage(message), meta); } -function logError(message) { - utils.logError(buildLogMessage(message)); +function _logError(message) { + logError(buildLogMessage(message)); } function buildLogMessage(message) { diff --git a/modules/sortableAnalyticsAdapter.js b/modules/sortableAnalyticsAdapter.js index 73ce1393c23..76d3ca63d69 100644 --- a/modules/sortableAnalyticsAdapter.js +++ b/modules/sortableAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { logInfo, getParameterByName, getOldestHighestCpmBid } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import {getGlobal} from '../src/prebidGlobal.js'; import { config } from '../src/config.js'; @@ -160,7 +160,7 @@ function getSessionParams() { sessionParams = paramsFromStorage && stillValid(paramsFromStorage) ? paramsFromStorage : null; } sessionParams = sessionParams || {'created': +new Date(), 'sessionId': generateRandomId()}; - const urlParams = UTM_PARAMS.map(utils.getParameterByName); + const urlParams = UTM_PARAMS.map(getParameterByName); if (UTM_PARAMS.every(key => !sessionParams[key])) { UTM_PARAMS.forEach((v, i) => sessionParams[v] = urlParams[i] || sessionParams[v]); sessionParams.created = +new Date(); @@ -318,7 +318,7 @@ function sendEvents(events) { 'method': 'POST', 'withCredentials': true }; - const onSend = () => utils.logInfo('Sortable Analytics data sent'); + const onSend = () => logInfo('Sortable Analytics data sent'); ajax(url, onSend, JSON.stringify(mergedEvents), options); } @@ -444,7 +444,7 @@ function handleAuctionEnd(event) { const events = Object.keys(adUnits).map(adUnitCode => { const bidderKeys = Object.keys(auction.adUnits[adUnitCode].bids); const bids = bidderKeys.map(bidderCode => auction.adUnits[adUnitCode].bids[bidderCode]); - const highestBid = bids.length ? bids.reduce(utils.getOldestHighestCpmBid) : null; + const highestBid = bids.length ? bids.reduce(getOldestHighestCpmBid) : null; return bidderKeys.map(bidderCode => { const bid = auction.adUnits[adUnitCode].bids[bidderCode]; if (highestBid && highestBid.cpm) { @@ -507,7 +507,7 @@ sortableAnalyticsAdapter.originEnableAnalytics = sortableAnalyticsAdapter.enable sortableAnalyticsAdapter.enableAnalytics = function (setupConfig) { if (this.initConfig(setupConfig)) { - utils.logInfo('Sortable Analytics adapter enabled'); + logInfo('Sortable Analytics adapter enabled'); sortableAnalyticsAdapter.originEnableAnalytics(setupConfig); } }; From c3d518f8eb5b00251493472640b84a2717691cbb Mon Sep 17 00:00:00 2001 From: Marcin Grzebyk <35067477+marcin15g@users.noreply.github.com> Date: Tue, 28 Sep 2021 22:44:39 +0200 Subject: [PATCH 107/250] JustPremium - schain support added (#7506) --- modules/justpremiumBidAdapter.js | 6 +++++- .../spec/modules/justpremiumBidAdapter_spec.js | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/justpremiumBidAdapter.js b/modules/justpremiumBidAdapter.js index da30ee16427..fa0f939affc 100644 --- a/modules/justpremiumBidAdapter.js +++ b/modules/justpremiumBidAdapter.js @@ -4,7 +4,7 @@ import { deepAccess } from '../src/utils.js'; const BIDDER_CODE = 'justpremium' const GVLID = 62 const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr' -const JP_ADAPTER_VERSION = '1.7' +const JP_ADAPTER_VERSION = '1.8' const pixels = [] export const spec = { @@ -65,6 +65,10 @@ export const spec = { jp_adapter: JP_ADAPTER_VERSION } + if (validBidRequests[0].schain) { + payload.schain = validBidRequests[0].schain; + } + const payloadString = JSON.stringify(payload) return { diff --git a/test/spec/modules/justpremiumBidAdapter_spec.js b/test/spec/modules/justpremiumBidAdapter_spec.js index cb3648cba44..74526660f61 100644 --- a/test/spec/modules/justpremiumBidAdapter_spec.js +++ b/test/spec/modules/justpremiumBidAdapter_spec.js @@ -12,6 +12,18 @@ describe('justpremium adapter', function () { sandbox.restore(); }); + let schainConfig = { + 'ver': '1.0', + 'complete': 1, + 'nodes': [ + { + 'asi': 'indirectseller.com', + 'sid': '00001', + 'hp': 1 + } + ] + } + let adUnits = [ { adUnitCode: 'div-gpt-ad-1471513102552-1', @@ -33,7 +45,8 @@ describe('justpremium adapter', function () { params: { zone: 28313, allow: ['lb', 'wp'] - } + }, + schain: schainConfig }, { adUnitCode: 'div-gpt-ad-1471513102552-2', @@ -75,6 +88,7 @@ describe('justpremium adapter', function () { expect(jpxRequest).to.not.equal(null) expect(jpxRequest.zone).to.not.equal('undefined') expect(bidderRequest.refererInfo.referer).to.equal('https://justpremium.com') + expect(jpxRequest.schain).to.deep.equal(schainConfig) expect(jpxRequest.sw).to.equal(window.top.screen.width) expect(jpxRequest.sh).to.equal(window.top.screen.height) expect(jpxRequest.ww).to.equal(window.top.innerWidth) @@ -83,7 +97,7 @@ describe('justpremium adapter', function () { expect(jpxRequest.id).to.equal(adUnits[0].params.zone) expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined') expect(jpxRequest.version.prebid).to.equal('$prebid.version$') - expect(jpxRequest.version.jp_adapter).to.equal('1.7') + expect(jpxRequest.version.jp_adapter).to.equal('1.8') expect(jpxRequest.pubcid).to.equal('0000000') expect(jpxRequest.uids.tdid).to.equal('1111111') expect(jpxRequest.uids.id5id.uid).to.equal('2222222') From 0d56358e107c8a14ef802fea271b75c34e4ff412 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 15:11:04 -0700 Subject: [PATCH 108/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7491) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/mediakeysBidAdapter.js | 80 +++++++++++----------- modules/medianetAnalyticsAdapter.js | 68 +++++++++---------- modules/medianetBidAdapter.js | 66 +++++++++--------- modules/medianetRtdProvider.js | 14 ++-- modules/merkleIdSystem.js | 38 +++++------ modules/mgidBidAdapter.js | 100 ++++++++++++++-------------- modules/microadBidAdapter.js | 6 +- modules/mwOpenLinkIdSystem.js | 14 ++-- modules/nativoBidAdapter.js | 6 +- modules/naveggIdSystem.js | 6 +- modules/nextMillenniumBidAdapter.js | 12 ++-- modules/nobidBidAdapter.js | 20 +++--- modules/novatiqIdSystem.js | 16 ++--- modules/oneVideoBidAdapter.js | 40 +++++------ modules/onomagicBidAdapter.js | 32 ++++----- 15 files changed, 259 insertions(+), 259 deletions(-) diff --git a/modules/mediakeysBidAdapter.js b/modules/mediakeysBidAdapter.js index 539d2f6c9cf..5b48e732942 100644 --- a/modules/mediakeysBidAdapter.js +++ b/modules/mediakeysBidAdapter.js @@ -1,7 +1,7 @@ +import { getWindowTop, isFn, logWarn, getDNT, deepAccess, isArray, inIframe, mergeDeep, isStr, isEmpty, deepSetValue, deepClone, parseUrl, cleanObj, logError, triggerPixel } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; import { createEidsArray } from './userId/eids.js'; const AUCTION_TYPE = 1; @@ -19,7 +19,7 @@ const NET_REVENUE = true; */ function canAccessTopWindow() { try { - return !!utils.getWindowTop().location.href; + return !!getWindowTop().location.href; } catch (error) { return false; } @@ -65,12 +65,12 @@ function getOS() { * @returns {number|boolean} */ function getFloor(bid, mediaType, size = '*') { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return false; } if (SUPPORTED_MEDIA_TYPES.indexOf(mediaType) === -1) { - utils.logWarn(`${BIDDER_CODE}: Unable to detect floor price for unsupported mediaType ${mediaType}. No floor will be used.`); + logWarn(`${BIDDER_CODE}: Unable to detect floor price for unsupported mediaType ${mediaType}. No floor will be used.`); return false; } @@ -99,7 +99,7 @@ function createOrtbTemplate() { device: { ip: '', js: 1, - dnt: utils.getDNT(), + dnt: getDNT(), ua: navigator.userAgent, devicetype: getDeviceType(), os: getOS(), @@ -128,10 +128,10 @@ function createOrtbTemplate() { */ function createBannerImp(bid) { let sizes = bid.mediaTypes.banner.sizes; - const params = utils.deepAccess(bid, 'params', {}); + const params = deepAccess(bid, 'params', {}); - if (!utils.isArray(sizes) || !sizes.length) { - utils.logWarn(`${BIDDER_CODE}: mediaTypes.banner.size missing for adunit: ${bid.params.adUnit}. Ignoring the banner impression in the adunit.`); + if (!isArray(sizes) || !sizes.length) { + logWarn(`${BIDDER_CODE}: mediaTypes.banner.size missing for adunit: ${bid.params.adUnit}. Ignoring the banner impression in the adunit.`); } else { const banner = {}; @@ -146,7 +146,7 @@ function createBannerImp(bid) { }); banner.format = format; - banner.topframe = utils.inIframe() ? 0 : 1; + banner.topframe = inIframe() ? 0 : 1; banner.pos = params.pos || 0; return banner; @@ -185,10 +185,10 @@ function createImp(bid) { } // handle FPD for imp. - const ortb2Imp = utils.deepAccess(bid, 'ortb2Imp.ext.data'); + const ortb2Imp = deepAccess(bid, 'ortb2Imp.ext.data'); if (ortb2Imp) { const fpd = { ...bid.ortb2Imp }; - utils.mergeDeep(imp, fpd); + mergeDeep(imp, fpd); } return imp; @@ -202,13 +202,13 @@ function createImp(bid) { * @returns {string|null} */ function getPrimaryCatFromResponse(cat) { - if (!cat || (utils.isArray(cat) && !cat.length)) { + if (!cat || (isArray(cat) && !cat.length)) { return; } - if (utils.isArray(cat)) { + if (isArray(cat)) { return cat[0]; - } else if (utils.isStr(cat)) { + } else if (isStr(cat)) { return cat; } } @@ -221,7 +221,7 @@ export const spec = { supportedMediaTypes: SUPPORTED_MEDIA_TYPES, isBidRequestValid: function(bid) { - return !!(bid && !utils.isEmpty(bid)); + return !!(bid && !isEmpty(bid)); }, buildRequests: function(validBidRequests, bidderRequest) { @@ -229,11 +229,11 @@ export const spec = { // Pass the auctionId as ortb2 id // See https://github.com/prebid/Prebid.js/issues/6563 - utils.deepSetValue(payload, 'id', bidderRequest.auctionId); - utils.deepSetValue(payload, 'source.tid', bidderRequest.auctionId); + deepSetValue(payload, 'id', bidderRequest.auctionId); + deepSetValue(payload, 'source.tid', bidderRequest.auctionId); validBidRequests.forEach(validBid => { - let bid = utils.deepClone(validBid); + let bid = deepClone(validBid); // No additional params atm. const imp = createImp(bid); @@ -242,37 +242,37 @@ export const spec = { }); if (validBidRequests[0].schain) { - utils.deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); + deepSetValue(payload, 'source.ext.schain', validBidRequests[0].schain); } if (bidderRequest && bidderRequest.gdprConsent) { - utils.deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); - utils.deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); + deepSetValue(payload, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(payload, 'regs.ext.gdpr', (bidderRequest.gdprConsent.gdprApplies ? 1 : 0)); } if (bidderRequest && bidderRequest.uspConsent) { - utils.deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(payload, 'regs.ext.us_privacy', bidderRequest.uspConsent); } if (config.getConfig('coppa') === true) { - utils.deepSetValue(payload, 'regs.coppa', 1); + deepSetValue(payload, 'regs.coppa', 1); } - if (utils.deepAccess(validBidRequests[0], 'userId')) { - utils.deepSetValue(payload, 'user.ext.eids', createEidsArray(validBidRequests[0].userId)); + if (deepAccess(validBidRequests[0], 'userId')) { + deepSetValue(payload, 'user.ext.eids', createEidsArray(validBidRequests[0].userId)); } // Assign payload.site from refererinfo if (bidderRequest.refererInfo) { if (bidderRequest.refererInfo.reachedTop) { const sitePage = bidderRequest.refererInfo.referer; - utils.deepSetValue(payload, 'site.page', sitePage); - utils.deepSetValue(payload, 'site.domain', utils.parseUrl(sitePage, { + deepSetValue(payload, 'site.page', sitePage); + deepSetValue(payload, 'site.domain', parseUrl(sitePage, { noDecodeWholeURL: true }).hostname); if (canAccessTopWindow()) { - utils.deepSetValue(payload, 'site.ref', utils.getWindowTop().document.referrer); + deepSetValue(payload, 'site.ref', getWindowTop().document.referrer); } } } @@ -280,15 +280,15 @@ export const spec = { // Handle First Party Data (need publisher fpd setup) const fpd = config.getConfig('ortb2') || {}; if (fpd.site) { - utils.mergeDeep(payload, { site: fpd.site }); + mergeDeep(payload, { site: fpd.site }); } if (fpd.user) { - utils.mergeDeep(payload, { user: fpd.user }); + mergeDeep(payload, { user: fpd.user }); } // Here we can handle device.geo prop - const deviceGeo = utils.deepAccess(fpd, 'device.geo'); + const deviceGeo = deepAccess(fpd, 'device.geo'); if (deviceGeo) { - utils.mergeDeep(payload.device, { geo: deviceGeo }); + mergeDeep(payload.device, { geo: deviceGeo }); } const request = { @@ -307,19 +307,19 @@ export const spec = { const bidResponses = []; try { - if (serverResponse.body && serverResponse.body.seatbid && utils.isArray(serverResponse.body.seatbid)) { + if (serverResponse.body && serverResponse.body.seatbid && isArray(serverResponse.body.seatbid)) { const currency = serverResponse.body.cur || DEFAULT_CURRENCY; const referrer = bidRequest.site && bidRequest.site.ref ? bidRequest.site.ref : ''; serverResponse.body.seatbid.forEach(bidderSeat => { - if (!utils.isArray(bidderSeat.bid) || !bidderSeat.bid.length) { + if (!isArray(bidderSeat.bid) || !bidderSeat.bid.length) { return; } bidderSeat.bid.forEach(bid => { let mediaType; // Actually only BANNER is supported, but other types will be added soon. - switch (utils.deepAccess(bid, 'ext.prebid.type')) { + switch (deepAccess(bid, 'ext.prebid.type')) { case 'V': mediaType = VIDEO; break; @@ -332,8 +332,8 @@ export const spec = { const meta = { advertiserDomains: (Array.isArray(bid.adomain) && bid.adomain.length) ? bid.adomain : [], - advertiserName: utils.deepAccess(bid, 'ext.advertiser_name', null), - agencyName: utils.deepAccess(bid, 'ext.agency_name', null), + advertiserName: deepAccess(bid, 'ext.advertiser_name', null), + agencyName: deepAccess(bid, 'ext.agency_name', null), primaryCatId: getPrimaryCatFromResponse(bid.cat), mediaType } @@ -352,7 +352,7 @@ export const spec = { ad: bid.adm, mediaType, burl: bid.burl, - meta: utils.cleanObj(meta) + meta: cleanObj(meta) }; bidResponses.push(newBid); @@ -360,7 +360,7 @@ export const spec = { }); } } catch (e) { - utils.logError(BIDDER_CODE, e); + logError(BIDDER_CODE, e); } return bidResponses; @@ -373,7 +373,7 @@ export const spec = { const url = bid.burl.replace(/\$\{AUCTION_PRICE\}/, bid.cpm); - utils.triggerPixel(url); + triggerPixel(url); } } diff --git a/modules/medianetAnalyticsAdapter.js b/modules/medianetAnalyticsAdapter.js index 45fb39d8c82..e281dde8ad0 100644 --- a/modules/medianetAnalyticsAdapter.js +++ b/modules/medianetAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { triggerPixel, deepAccess, getWindowTop, uniques, groupBy, isEmpty, _map, isPlainObject, logInfo, logError } from '../src/utils.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; import CONSTANTS from '../src/constants.json'; -import * as utils from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { getRefererInfo } from '../src/refererDetection.js'; import { AUCTION_COMPLETED, AUCTION_IN_PROGRESS, getPriceGranularity } from '../src/auction.js'; @@ -66,7 +66,7 @@ class ErrorLogger { send() { let url = EVENT_PIXEL_URL + '?' + formatQS(this); - utils.triggerPixel(url); + triggerPixel(url); } } @@ -126,7 +126,7 @@ class Configure { } overrideDomainLevelData(response) { - const domain = utils.deepAccess(response, 'domain.' + pageDetails.domain); + const domain = deepAccess(response, 'domain.' + pageDetails.domain); if (domain) { this.setDataFromResponse(domain); } @@ -149,14 +149,14 @@ class Configure { init() { // Forces Logging % to 100% let urlObj = URL.parseUrl(pageDetails.page); - if (utils.deepAccess(urlObj, 'search.medianet_test') || urlObj.hostname === 'localhost') { + if (deepAccess(urlObj, 'search.medianet_test') || urlObj.hostname === 'localhost') { this.loggingPercent = 100; this.ajaxState = CONFIG_PASS; this.debug = true; return; } - if (utils.deepAccess(urlObj, 'search.mnet_setconfig')) { - this.mnetDebugConfig = utils.deepAccess(urlObj, 'search.mnet_setconfig'); + if (deepAccess(urlObj, 'search.mnet_setconfig')) { + this.mnetDebugConfig = deepAccess(urlObj, 'search.mnet_setconfig'); } ajax( this._configURL(), @@ -201,7 +201,7 @@ class PageDetail { _getAttributeFromSelector(selector, attribute) { try { - let doc = utils.getWindowTop().document; + let doc = getWindowTop().document; let element = doc.querySelector(selector); if (element !== null && element[attribute]) { return element[attribute]; @@ -210,7 +210,7 @@ class PageDetail { } _getAbsoluteUrl(url) { - let aTag = utils.getWindowTop().document.createElement('a'); + let aTag = getWindowTop().document.createElement('a'); aTag.href = url; return aTag.href; @@ -358,8 +358,8 @@ class Auction { flrdata: this._mergeFieldsToLog({ ln: this.floorData.location, skp: this.floorData.skipped, - enfj: utils.deepAccess(this.floorData, 'enforcements.enforceJS'), - enfd: utils.deepAccess(this.floorData, 'enforcements.floorDeals'), + enfj: deepAccess(this.floorData, 'enforcements.enforceJS'), + enfd: deepAccess(this.floorData, 'enforcements.floorDeals'), sr: this.floorData.skipRate, fs: this.floorData.fetchStatus }), @@ -411,7 +411,7 @@ function auctionInitHandler({auctionId, adUnits, timeout, timestamp, bidderReque auctions[auctionId].auctionInitTime = timestamp; } addAddSlots(auctionId, adUnits, timeout); - const floorData = utils.deepAccess(bidderRequests, '0.bids.0.floorData'); + const floorData = deepAccess(bidderRequests, '0.bids.0.floorData'); if (floorData) { auctions[auctionId].floorData = {...floorData}; } @@ -419,10 +419,10 @@ function auctionInitHandler({auctionId, adUnits, timeout, timestamp, bidderReque function addAddSlots(auctionId, adUnits, tmax) { adUnits = adUnits || []; - const groupedAdUnits = utils.groupBy(adUnits, 'code'); + const groupedAdUnits = groupBy(adUnits, 'code'); Object.keys(groupedAdUnits).forEach((adUnitCode) => { const adUnits = groupedAdUnits[adUnitCode]; - const supplyAdCode = utils.deepAccess(adUnits, '0.adUnitCode') || adUnitCode; + const supplyAdCode = deepAccess(adUnits, '0.adUnitCode') || adUnitCode; let context = ''; let adext = {}; @@ -430,17 +430,17 @@ function addAddSlots(auctionId, adUnits, tmax) { const oSizes = {banner: [], video: []}; adUnits.forEach(({mediaTypes, sizes, ext}) => { mediaTypes = mediaTypes || {}; - adext = Object.assign(adext, ext || utils.deepAccess(mediaTypes, 'banner.ext')); - context = utils.deepAccess(mediaTypes, 'video.context') || context; + adext = Object.assign(adext, ext || deepAccess(mediaTypes, 'banner.ext')); + context = deepAccess(mediaTypes, 'video.context') || context; Object.keys(mediaTypes).forEach((mediaType) => mediaTypeMap[mediaType] = 1); const sizeObject = _getSizes(mediaTypes, sizes); sizeObject.banner.forEach(size => oSizes.banner.push(size)); sizeObject.video.forEach(size => oSizes.video.push(size)); }); - adext = utils.isEmpty(adext) ? undefined : adext; - oSizes.banner = oSizes.banner.filter(utils.uniques); - oSizes.video = oSizes.video.filter(utils.uniques); + adext = isEmpty(adext) ? undefined : adext; + oSizes.banner = oSizes.banner.filter(uniques); + oSizes.video = oSizes.video.filter(uniques); oSizes.native = mediaTypeMap.native === 1 ? [[1, 1].join('x')] : []; const allMediaTypeSizes = [].concat(oSizes.banner, oSizes.native, oSizes.video); const mediaTypes = Object.keys(mediaTypeMap).join('|'); @@ -468,17 +468,17 @@ function bidRequestedHandler({ auctionId, auctionStart, bids, start, uspConsent, const bidObj = new Bid(bidId, bidder, src, start, adUnitCode, mediaTypes && Object.keys(mediaTypes).join('|'), requestSizes); auctions[auctionId].addBid(bidObj); if (bidder === MEDIANET_BIDDER_CODE) { - bidObj.crid = utils.deepAccess(bid, 'params.crid'); - bidObj.pubcrid = utils.deepAccess(bid, 'params.crid'); + bidObj.crid = deepAccess(bid, 'params.crid'); + bidObj.pubcrid = deepAccess(bid, 'params.crid'); auctions[auctionId].adSlots[adUnitCode].medianetPresent = 1; } }); } function _getSizes(mediaTypes, sizes) { - const banner = utils.deepAccess(mediaTypes, 'banner.sizes') || sizes || []; - const native = utils.deepAccess(mediaTypes, 'native') ? [[1, 1]] : []; - const playerSize = utils.deepAccess(mediaTypes, 'video.playerSize') || []; + const banner = deepAccess(mediaTypes, 'banner.sizes') || sizes || []; + const native = deepAccess(mediaTypes, 'native') ? [[1, 1]] : []; + const playerSize = deepAccess(mediaTypes, 'video.playerSize') || []; let video = []; if (playerSize.length === 2) { video = [playerSize] @@ -506,10 +506,10 @@ function bidResponseHandler(bid) { { cpm, width, height, mediaType, timeToRespond, dealId, creativeId }, { adId, currency } ); - bidObj.floorPrice = utils.deepAccess(bid, 'floorData.floorValue'); - bidObj.floorRule = utils.deepAccess(bid, 'floorData.floorRule'); + bidObj.floorPrice = deepAccess(bid, 'floorData.floorValue'); + bidObj.floorRule = deepAccess(bid, 'floorData.floorRule'); bidObj.originalCpm = originalCpm || cpm; - let dfpbd = utils.deepAccess(bid, 'adserverTargeting.hb_pb'); + let dfpbd = deepAccess(bid, 'adserverTargeting.hb_pb'); if (!dfpbd) { let priceGranularity = getPriceGranularity(mediaType, bid); let priceGranularityKey = PRICE_GRANULARITY[priceGranularity]; @@ -598,8 +598,8 @@ function setTargetingHandler(params) { auctionObj.bids.forEach(bid => { if (bid.bidder === DUMMY_BIDDER && bid.adUnitCode === adunit) { bid.iwb = bidAdIds.length === 0 ? 0 : 1; - bid.width = utils.deepAccess(winningBid, 'width'); - bid.height = utils.deepAccess(winningBid, 'height'); + bid.width = deepAccess(winningBid, 'width'); + bid.height = deepAccess(winningBid, 'height'); } }); sendEvent(auctionId, adunit, LOG_TYPE.APPR); @@ -658,7 +658,7 @@ function getCommonLoggingData(acid, adtag) { function fireAuctionLog(acid, adtag, logType) { let commonParams = getCommonLoggingData(acid, adtag); commonParams.lgtp = logType; - let targeting = utils.deepAccess(commonParams, 'targ'); + let targeting = deepAccess(commonParams, 'targ'); Object.keys(commonParams).forEach((key) => (commonParams[key] == null) && delete commonParams[key]); delete commonParams.targ; @@ -686,11 +686,11 @@ function fireAuctionLog(acid, adtag, logType) { } function formatQS(data) { - return utils._map(data, (value, key) => { + return _map(data, (value, key) => { if (value === undefined) { return key + '='; } - if (utils.isPlainObject(value)) { + if (isPlainObject(value)) { value = JSON.stringify(value); } return key + '=' + encodeURIComponent(value); @@ -699,7 +699,7 @@ function formatQS(data) { function firePixel(qs) { logsQueue.push(ENDPOINT + '&' + qs); - utils.triggerPixel(ENDPOINT + '&' + qs); + triggerPixel(ENDPOINT + '&' + qs); } class URL { @@ -740,7 +740,7 @@ let medianetAnalytics = Object.assign(adapter({URL, analyticsType}), { }, track({ eventType, args }) { if (config.debug) { - utils.logInfo(eventType, args); + logInfo(eventType, args); } switch (eventType) { case CONSTANTS.EVENTS.AUCTION_INIT: { @@ -782,7 +782,7 @@ medianetAnalytics.originEnableAnalytics = medianetAnalytics.enableAnalytics; medianetAnalytics.enableAnalytics = function (configuration) { if (!configuration || !configuration.options || !configuration.options.cid) { - utils.logError('Media.net Analytics adapter: cid is required.'); + logError('Media.net Analytics adapter: cid is required.'); return; } $$PREBID_GLOBAL$$.medianetGlobals = $$PREBID_GLOBAL$$.medianetGlobals || {}; diff --git a/modules/medianetBidAdapter.js b/modules/medianetBidAdapter.js index d78f4a70e2c..db3921c9a47 100644 --- a/modules/medianetBidAdapter.js +++ b/modules/medianetBidAdapter.js @@ -1,5 +1,5 @@ +import { parseUrl, getWindowTop, isArray, getGptSlotInfoForAdUnitCode, isStr, deepAccess, isEmpty, logError, triggerPixel, buildUrl, isEmptyStr, logInfo } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import { getRefererInfo } from '../src/refererDetection.js'; @@ -27,7 +27,7 @@ window.mnet = window.mnet || {}; window.mnet.queue = window.mnet.queue || []; mnData.urlData = { - domain: utils.parseUrl(refererInfo.referer).hostname, + domain: parseUrl(refererInfo.referer).hostname, page: refererInfo.referer, isTop: refererInfo.reachedTop } @@ -78,7 +78,7 @@ function getUrlFromSelector(selector, attribute) { function getAttributeFromSelector(selector, attribute) { try { - let doc = utils.getWindowTop().document; + let doc = getWindowTop().document; let element = doc.querySelector(selector); if (element !== null && element[attribute]) { return element[attribute]; @@ -87,7 +87,7 @@ function getAttributeFromSelector(selector, attribute) { } function getAbsoluteUrl(url) { - let aTag = utils.getWindowTop().document.createElement('a'); + let aTag = getWindowTop().document.createElement('a'); aTag.href = url; return aTag.href; @@ -98,7 +98,7 @@ function filterUrlsByType(urls, type) { } function transformSizes(sizes) { - if (utils.isArray(sizes) && sizes.length === 2 && !utils.isArray(sizes[0])) { + if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) { return [getSize(sizes)]; } @@ -123,8 +123,8 @@ function getCoordinates(adUnitCode) { let element = document.getElementById(adUnitCode); if (!element && adUnitCode.indexOf('/') !== -1) { // now it means that adUnitCode is GAM AdUnitPath - const {divId} = utils.getGptSlotInfoForAdUnitCode(adUnitCode); - if (utils.isStr(divId)) { + const {divId} = getGptSlotInfoForAdUnitCode(adUnitCode); + if (isStr(divId)) { element = document.getElementById(divId); } } @@ -145,11 +145,11 @@ function getCoordinates(adUnitCode) { } function extParams(bidRequest, bidderRequests) { - const params = utils.deepAccess(bidRequest, 'params'); - const gdpr = utils.deepAccess(bidderRequests, 'gdprConsent'); - const uspConsent = utils.deepAccess(bidderRequests, 'uspConsent'); - const userId = utils.deepAccess(bidRequest, 'userId'); - const sChain = utils.deepAccess(bidRequest, 'schain') || {}; + const params = deepAccess(bidRequest, 'params'); + const gdpr = deepAccess(bidderRequests, 'gdprConsent'); + const uspConsent = deepAccess(bidderRequests, 'uspConsent'); + const userId = deepAccess(bidRequest, 'userId'); + const sChain = deepAccess(bidRequest, 'schain') || {}; const windowSize = spec.getWindowSize(); const gdprApplies = !!(gdpr && gdpr.gdprApplies); const uspApplies = !!(uspConsent); @@ -165,7 +165,7 @@ function extParams(bidRequest, bidderRequests) { windowSize.w !== -1 && windowSize.h !== -1 && { screen: windowSize }, userId && { user_id: userId }, $$PREBID_GLOBAL$$.medianetGlobals.analyticsEnabled && { analytics: true }, - !utils.isEmpty(sChain) && {schain: sChain} + !isEmpty(sChain) && {schain: sChain} ); } @@ -184,13 +184,13 @@ function slotParams(bidRequest) { params.ortb2Imp = bidRequest.ortb2Imp; } - let bannerSizes = utils.deepAccess(bidRequest, 'mediaTypes.banner.sizes') || []; + let bannerSizes = deepAccess(bidRequest, 'mediaTypes.banner.sizes') || []; - const videoInMediaType = utils.deepAccess(bidRequest, 'mediaTypes.video') || {}; - const videoInParams = utils.deepAccess(bidRequest, 'params.video') || {}; + const videoInMediaType = deepAccess(bidRequest, 'mediaTypes.video') || {}; + const videoInParams = deepAccess(bidRequest, 'params.video') || {}; const videoCombinedObj = Object.assign({}, videoInParams, videoInMediaType); - if (!utils.isEmpty(videoCombinedObj)) { + if (!isEmpty(videoCombinedObj)) { params.video = videoCombinedObj; } @@ -201,7 +201,7 @@ function slotParams(bidRequest) { try { params.native = JSON.stringify(bidRequest.nativeParams); } catch (e) { - utils.logError((`${BIDDER_CODE} : Incorrect JSON : bidRequest.nativeParams`)); + logError((`${BIDDER_CODE} : Incorrect JSON : bidRequest.nativeParams`)); } } @@ -319,8 +319,8 @@ function isValidBid(bid) { } function fetchCookieSyncUrls(response) { - if (!utils.isEmpty(response) && response[0].body && - response[0].body.ext && utils.isArray(response[0].body.ext.csUrl)) { + if (!isEmpty(response) && response[0].body && + response[0].body.ext && isArray(response[0].body.ext.csUrl)) { return response[0].body.ext.csUrl; } @@ -328,15 +328,15 @@ function fetchCookieSyncUrls(response) { } function getLoggingData(event, data) { - data = (utils.isArray(data) && data) || []; + data = (isArray(data) && data) || []; let params = {}; params.logid = 'kfk'; params.evtid = 'projectevents'; params.project = 'prebid'; - params.acid = utils.deepAccess(data, '0.auctionId') || ''; + params.acid = deepAccess(data, '0.auctionId') || ''; params.cid = $$PREBID_GLOBAL$$.medianetGlobals.cid || ''; - params.crid = data.map((adunit) => utils.deepAccess(adunit, 'params.0.crid') || adunit.adUnitCode).join('|'); + params.crid = data.map((adunit) => deepAccess(adunit, 'params.0.crid') || adunit.adUnitCode).join('|'); params.adunit_count = data.length || 0; params.dn = mnData.urlData.domain || ''; params.requrl = mnData.urlData.page || ''; @@ -354,7 +354,7 @@ function logEvent (event, data) { hostname: EVENT_PIXEL_URL, search: getLoggingData(event, data) }; - utils.triggerPixel(utils.buildUrl(getParams)); + triggerPixel(buildUrl(getParams)); } function clearMnData() { @@ -362,8 +362,8 @@ function clearMnData() { } function addRenderer(bid) { - const videoContext = utils.deepAccess(bid, 'context') || ''; - const vastTimeout = utils.deepAccess(bid, 'vto'); + const videoContext = deepAccess(bid, 'context') || ''; + const vastTimeout = deepAccess(bid, 'vto'); /* Adding renderer only when the context is Outstream and the provider has responded with a renderer. */ @@ -389,7 +389,7 @@ function newVideoRenderer(bid) { mute: bid.mt } const adUnitCode = bid.dfp_id; - const divId = utils.getGptSlotInfoForAdUnitCode(adUnitCode).divId || adUnitCode; + const divId = getGptSlotInfoForAdUnitCode(adUnitCode).divId || adUnitCode; window.mnet.mediaNetoutstreamPlayer(bid, divId, obj); }); }); @@ -410,12 +410,12 @@ export const spec = { */ isBidRequestValid: function(bid) { if (!bid.params) { - utils.logError(`${BIDDER_CODE} : Missing bid parameters`); + logError(`${BIDDER_CODE} : Missing bid parameters`); return false; } - if (!bid.params.cid || !utils.isStr(bid.params.cid) || utils.isEmptyStr(bid.params.cid)) { - utils.logError(`${BIDDER_CODE} : cid should be a string`); + if (!bid.params.cid || !isStr(bid.params.cid) || isEmptyStr(bid.params.cid)) { + logError(`${BIDDER_CODE} : cid should be a string`); return false; } @@ -450,13 +450,13 @@ export const spec = { let validBids = []; if (!serverResponse || !serverResponse.body) { - utils.logInfo(`${BIDDER_CODE} : response is empty`); + logInfo(`${BIDDER_CODE} : response is empty`); return validBids; } let bids = serverResponse.body.bidList; - if (!utils.isArray(bids) || bids.length === 0) { - utils.logInfo(`${BIDDER_CODE} : no bids`); + if (!isArray(bids) || bids.length === 0) { + logInfo(`${BIDDER_CODE} : no bids`); return validBids; } validBids = bids.filter(bid => isValidBid(bid)); diff --git a/modules/medianetRtdProvider.js b/modules/medianetRtdProvider.js index 77889db5ff2..cd86bf891f3 100644 --- a/modules/medianetRtdProvider.js +++ b/modules/medianetRtdProvider.js @@ -1,5 +1,5 @@ +import { isStr, isEmptyStr, logError, mergeDeep, isFn, insertElement } from '../src/utils.js'; import { submodule } from '../src/hook.js'; -import * as utils from '../src/utils.js'; import { getGlobal } from '../src/prebidGlobal.js'; import includes from 'core-js-pure/features/array/includes.js'; @@ -15,8 +15,8 @@ window.mnjs.que = window.mnjs.que || []; function init(config) { const customerId = config.params && config.params.cid; - if (!customerId || !utils.isStr(customerId) || utils.isEmptyStr(customerId)) { - utils.logError(`${SOURCE}: cid should be a string`); + if (!customerId || !isStr(customerId) || isEmptyStr(customerId)) { + logError(`${SOURCE}: cid should be a string`); return false; } @@ -40,8 +40,8 @@ function getBidRequestData(requestBidsProps, callback, config, userConsent) { const success = (adUnitProps, openRtbProps) => { adUnits.forEach(adUnit => { adUnit[OPEN_RTB_FIELD] = adUnit[OPEN_RTB_FIELD] || {}; - utils.mergeDeep(adUnit[OPEN_RTB_FIELD], openRtbProps[adUnit.code]); - utils.mergeDeep(adUnit, adUnitProps[adUnit.code]); + mergeDeep(adUnit[OPEN_RTB_FIELD], openRtbProps[adUnit.code]); + mergeDeep(adUnit, adUnitProps[adUnit.code]); }); callback(); }; @@ -61,7 +61,7 @@ function onAuctionInitEvent(auctionInit) { function getTargetingData(adUnitCode) { const adUnits = getAdUnits(undefined, adUnitCode); let targetingData = {}; - if (window.mnjs.loaded && utils.isFn(window.mnjs.getTargetingData)) { + if (window.mnjs.loaded && isFn(window.mnjs.getTargetingData)) { targetingData = window.mnjs.getTargetingData(adUnitCode, adUnits, SOURCE) || {}; } const targeting = {}; @@ -86,7 +86,7 @@ function loadRtdScript(customerId) { script.type = 'text/javascript'; script.async = true; script.src = getClientUrl(customerId, window.location.hostname); - utils.insertElement(script, window.document, 'head'); + insertElement(script, window.document, 'head'); } function getAdUnits(adUnits, adUnitCodes) { diff --git a/modules/merkleIdSystem.js b/modules/merkleIdSystem.js index bcb2b943834..5339b653596 100644 --- a/modules/merkleIdSystem.js +++ b/modules/merkleIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logInfo, logError, logWarn } from '../src/utils.js'; import * as ajaxLib from '../src/ajax.js'; import {submodule} from '../src/hook.js' import {getStorageManager} from '../src/storageManager.js'; @@ -34,7 +34,7 @@ function setCookie(name, value, expires) { } function setSession(storage, response) { - utils.logInfo('Merkle setting session '); + logInfo('Merkle setting session '); if (response && response.c && response.c.value && typeof response.c.value === 'string') { setCookie(SESSION_COOKIE_NAME, response.c.value, storage.expires); } @@ -46,7 +46,7 @@ function constructUrl(configParams) { if (session) { url = `${url}&sv_session=${session}`; } - utils.logInfo('Merkle url :' + url); + logInfo('Merkle url :' + url); return url; } @@ -62,19 +62,19 @@ function generateId(configParams, configStorage) { try { responseObj = JSON.parse(response); setSession(configStorage, responseObj) - utils.logInfo('Merkle responseObj ' + JSON.stringify(responseObj)); + logInfo('Merkle responseObj ' + JSON.stringify(responseObj)); } catch (error) { - utils.logError(error); + logError(error); } } const date = new Date().toUTCString(); responseObj.date = date; - utils.logInfo('Merkle responseObj with date ' + JSON.stringify(responseObj)); + logInfo('Merkle responseObj with date ' + JSON.stringify(responseObj)); callback(responseObj); }, error => { - utils.logError(`${MODULE_NAME}: merkleId fetch encountered an error`, error); + logError(`${MODULE_NAME}: merkleId fetch encountered an error`, error); callback(); }, {method: 'GET', withCredentials: true} @@ -98,7 +98,7 @@ export const merkleIdSubmodule = { */ decode(value) { const id = (value && value.pam_id && typeof value.pam_id.id === 'string') ? value.pam_id : undefined; - utils.logInfo('Merkle id ' + JSON.stringify(id)); + logInfo('Merkle id ' + JSON.stringify(id)); return id ? {'merkleId': id} : undefined; }, /** @@ -109,31 +109,31 @@ export const merkleIdSubmodule = { * @returns {IdResponse|undefined} */ getId(config, consentData) { - utils.logInfo('User ID - merkleId generating id'); + logInfo('User ID - merkleId generating id'); const configParams = (config && config.params) || {}; if (!configParams || typeof configParams.vendor !== 'string') { - utils.logError('User ID - merkleId submodule requires a valid vendor to be defined'); + logError('User ID - merkleId submodule requires a valid vendor to be defined'); return; } if (typeof configParams.sv_cid !== 'string') { - utils.logError('User ID - merkleId submodule requires a valid sv_cid string to be defined'); + logError('User ID - merkleId submodule requires a valid sv_cid string to be defined'); return; } if (typeof configParams.sv_pubid !== 'string') { - utils.logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); + logError('User ID - merkleId submodule requires a valid sv_pubid string to be defined'); return; } if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) { - utils.logError('User ID - merkleId submodule does not currently handle consent strings'); + logError('User ID - merkleId submodule does not currently handle consent strings'); return; } if (typeof configParams.endpoint !== 'string') { - utils.logWarn('User ID - merkleId submodule endpoint string is not defined'); + logWarn('User ID - merkleId submodule endpoint string is not defined'); configParams.endpoint = ID_URL } @@ -146,11 +146,11 @@ export const merkleIdSubmodule = { return {callback: resp}; }, extendId: function (config = {}, consentData, storedId) { - utils.logInfo('User ID - merkleId stored id ' + storedId); + logInfo('User ID - merkleId stored id ' + storedId); const configParams = (config && config.params) || {}; if (consentData && typeof consentData.gdprApplies === 'boolean' && consentData.gdprApplies) { - utils.logError('User ID - merkleId submodule does not currently handle consent strings'); + logError('User ID - merkleId submodule does not currently handle consent strings'); return; } @@ -164,19 +164,19 @@ export const merkleIdSubmodule = { let refreshInSeconds = DEFAULT_REFRESH; if (configParams && configParams.refreshInSeconds && typeof configParams.refreshInSeconds === 'number') { refreshInSeconds = configParams.refreshInSeconds; - utils.logInfo('User ID - merkleId param refreshInSeconds' + refreshInSeconds); + logInfo('User ID - merkleId param refreshInSeconds' + refreshInSeconds); } const storedDate = new Date(storedId.date); let refreshNeeded = false; if (storedDate) { refreshNeeded = storedDate && (Date.now() - storedDate.getTime() > refreshInSeconds * 1000); if (refreshNeeded) { - utils.logInfo('User ID - merkleId needs refreshing id'); + logInfo('User ID - merkleId needs refreshing id'); const resp = generateId(configParams, configStorage) return {callback: resp}; } } - utils.logInfo('User ID - merkleId not refreshed'); + logInfo('User ID - merkleId not refreshed'); return {id: storedId}; } diff --git a/modules/mgidBidAdapter.js b/modules/mgidBidAdapter.js index 3b45c1e69a5..c811a0b2981 100644 --- a/modules/mgidBidAdapter.js +++ b/modules/mgidBidAdapter.js @@ -1,5 +1,5 @@ +import { _each, deepAccess, isPlainObject, isArray, isStr, logInfo, parseUrl, isEmpty, triggerPixel, logWarn, getBidIdParameter, isFn, isNumber } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import {BANNER, NATIVE} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -58,9 +58,9 @@ let _NATIVE_ASSET_ID_TO_KEY_MAP = {}; let _NATIVE_ASSET_KEY_TO_ASSET_MAP = {}; // loading _NATIVE_ASSET_ID_TO_KEY_MAP -utils._each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); +_each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_ID_TO_KEY_MAP[anAsset.ID] = anAsset.KEY }); // loading _NATIVE_ASSET_KEY_TO_ASSET_MAP -utils._each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); +_each(NATIVE_ASSETS, anAsset => { _NATIVE_ASSET_KEY_TO_ASSET_MAP[anAsset.KEY] = anAsset }); export const spec = { VERSION: '1.5', @@ -76,20 +76,20 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: (bid) => { - const banner = utils.deepAccess(bid, 'mediaTypes.banner'); - const native = utils.deepAccess(bid, 'mediaTypes.native'); - let nativeOk = utils.isPlainObject(native); + const banner = deepAccess(bid, 'mediaTypes.banner'); + const native = deepAccess(bid, 'mediaTypes.native'); + let nativeOk = isPlainObject(native); if (nativeOk) { - const nativeParams = utils.deepAccess(bid, 'nativeParams'); + const nativeParams = deepAccess(bid, 'nativeParams'); let assetsCount = 0; - if (utils.isPlainObject(nativeParams)) { + if (isPlainObject(nativeParams)) { for (let k in nativeParams) { let v = nativeParams[k]; const supportProp = spec.NATIVE_ASSET_KEY_TO_ASSET_MAP.hasOwnProperty(k); if (supportProp) { assetsCount++ } - if (!utils.isPlainObject(v) || (!supportProp && utils.deepAccess(v, 'required'))) { + if (!isPlainObject(v) || (!supportProp && deepAccess(v, 'required'))) { nativeOk = false; break; } @@ -97,17 +97,17 @@ export const spec = { } nativeOk = nativeOk && (assetsCount > 0); } - let bannerOk = utils.isPlainObject(banner); + let bannerOk = isPlainObject(banner); if (bannerOk) { - const sizes = utils.deepAccess(banner, 'sizes'); - bannerOk = utils.isArray(sizes) && sizes.length > 0; + const sizes = deepAccess(banner, 'sizes'); + bannerOk = isArray(sizes) && sizes.length > 0; for (let f = 0; bannerOk && f < sizes.length; f++) { bannerOk = sizes[f].length === 2; } } let acc = Number(bid.params.accountId); let plcmt = Number(bid.params.placementId); - return (bannerOk || nativeOk) && utils.isPlainObject(bid.params) && !!bid.adUnitCode && utils.isStr(bid.adUnitCode) && (plcmt > 0 ? bid.params.placementId.toString().search(spec.reId) === 0 : true) && + return (bannerOk || nativeOk) && isPlainObject(bid.params) && !!bid.adUnitCode && isStr(bid.adUnitCode) && (plcmt > 0 ? bid.params.placementId.toString().search(spec.reId) === 0 : true) && !!acc && acc > 0 && bid.params.accountId.toString().search(spec.reId) === 0; }, /** @@ -117,25 +117,25 @@ export const spec = { * @return ServerRequest Info describing the request to the server. */ buildRequests: (validBidRequests, bidderRequest) => { - utils.logInfo(LOG_INFO_PREFIX + `buildRequests`); + logInfo(LOG_INFO_PREFIX + `buildRequests`); if (validBidRequests.length === 0) { return; } const info = pageInfo(); - const page = info.location || utils.deepAccess(bidderRequest, 'refererInfo.referer') || utils.deepAccess(bidderRequest, 'refererInfo.canonicalUrl'); - const hostname = utils.parseUrl(page).hostname; + const page = info.location || deepAccess(bidderRequest, 'refererInfo.referer') || deepAccess(bidderRequest, 'refererInfo.canonicalUrl'); + const hostname = parseUrl(page).hostname; let domain = extractDomainFromHost(hostname) || hostname; const accountId = setOnAny(validBidRequests, 'params.accountId'); const muid = getLocalStorageSafely('mgMuidn'); let url = (setOnAny(validBidRequests, 'params.bidUrl') || ENDPOINT_URL) + accountId; - if (utils.isStr(muid) && muid.length > 0) { + if (isStr(muid) && muid.length > 0) { url += '?muid=' + muid; } const cur = setOnAny(validBidRequests, 'params.currency') || setOnAny(validBidRequests, 'params.cur') || config.getConfig('currency.adServerCurrency') || DEFAULT_CUR; const secure = window.location.protocol === 'https:' ? 1 : 0; let imp = []; validBidRequests.forEach(bid => { - let tagid = utils.deepAccess(bid, 'params.placementId') || 0; + let tagid = deepAccess(bid, 'params.placementId') || 0; tagid = !tagid ? bid.adUnitCode : tagid + '/' + bid.adUnitCode; let impObj = { id: bid.bidId, @@ -173,7 +173,7 @@ export const spec = { } let request = { - id: utils.deepAccess(bidderRequest, 'bidderRequestId'), + id: deepAccess(bidderRequest, 'bidderRequestId'), site: {domain, page}, cur: [cur], geo: {utcoffset: info.timeOffset}, @@ -195,7 +195,7 @@ export const spec = { if (info.referrer) { request.site.ref = info.referrer } - utils.logInfo(LOG_INFO_PREFIX + `buildRequest:`, request); + logInfo(LOG_INFO_PREFIX + `buildRequest:`, request); return { method: 'POST', url: url, @@ -209,36 +209,36 @@ export const spec = { * @return {Bid[]} An array of bids which were nested inside the server. */ interpretResponse: (serverResponse, bidRequests) => { - utils.logInfo(LOG_INFO_PREFIX + `interpretResponse`, serverResponse); - if (serverResponse == null || serverResponse.body == null || serverResponse.body === '' || !utils.isArray(serverResponse.body.seatbid) || !serverResponse.body.seatbid.length) { + logInfo(LOG_INFO_PREFIX + `interpretResponse`, serverResponse); + if (serverResponse == null || serverResponse.body == null || serverResponse.body === '' || !isArray(serverResponse.body.seatbid) || !serverResponse.body.seatbid.length) { return; } const returnedBids = []; - const muidn = utils.deepAccess(serverResponse.body, 'ext.muidn') - if (utils.isStr(muidn) && muidn.length > 0) { + const muidn = deepAccess(serverResponse.body, 'ext.muidn') + if (isStr(muidn) && muidn.length > 0) { setLocalStorageSafely('mgMuidn', muidn) } serverResponse.body.seatbid.forEach((bids) => { bids.bid.forEach((bid) => { const pbid = prebidBid(bid, serverResponse.body.cur); - if (pbid.mediaType === NATIVE && utils.isEmpty(pbid.native)) { + if (pbid.mediaType === NATIVE && isEmpty(pbid.native)) { return; } returnedBids.push(pbid); }) }); - utils.logInfo(LOG_INFO_PREFIX + `interpretedResponse`, returnedBids); + logInfo(LOG_INFO_PREFIX + `interpretedResponse`, returnedBids); return returnedBids; }, onBidWon: (bid) => { - const cpm = utils.deepAccess(bid, 'adserverTargeting.hb_pb') || ''; - if (utils.isStr(bid.nurl) && bid.nurl !== '') { + const cpm = deepAccess(bid, 'adserverTargeting.hb_pb') || ''; + if (isStr(bid.nurl) && bid.nurl !== '') { bid.nurl = bid.nurl.replace( /\${AUCTION_PRICE}/, cpm ); - utils.triggerPixel(bid.nurl); + triggerPixel(bid.nurl); } if (bid.isBurl) { if (bid.mediaType === BANNER) { @@ -251,13 +251,13 @@ export const spec = { /\${AUCTION_PRICE}/, cpm ); - utils.triggerPixel(bid.burl); + triggerPixel(bid.burl); } } - utils.logInfo(LOG_INFO_PREFIX + `onBidWon`); + logInfo(LOG_INFO_PREFIX + `onBidWon`); }, getUserSyncs: (syncOptions, serverResponses) => { - utils.logInfo(LOG_INFO_PREFIX + `getUserSyncs`); + logInfo(LOG_INFO_PREFIX + `getUserSyncs`); } }; @@ -265,7 +265,7 @@ registerBidder(spec); function setOnAny(collection, key) { for (let i = 0, result; i < collection.length; i++) { - result = utils.deepAccess(collection[i], key); + result = deepAccess(collection[i], key); if (result) { return result; } @@ -278,7 +278,7 @@ function setOnAny(collection, key) { * @return Bid */ function prebidBid(serverBid, cur) { - if (!utils.isStr(cur) || cur === '') { + if (!isStr(cur) || cur === '') { cur = DEFAULT_CUR; } const bid = { @@ -295,8 +295,8 @@ function prebidBid(serverBid, cur) { ttl: serverBid.ttl || 300, nurl: serverBid.nurl || '', burl: serverBid.burl || '', - isBurl: utils.isStr(serverBid.burl) && serverBid.burl.length > 0, - meta: { advertiserDomains: (utils.isArray(serverBid.adomain) && serverBid.adomain.length > 0 ? serverBid.adomain : []) }, + isBurl: isStr(serverBid.burl) && serverBid.burl.length > 0, + meta: { advertiserDomains: (isArray(serverBid.adomain) && serverBid.adomain.length > 0 ? serverBid.adomain : []) }, }; setMediaType(serverBid, bid); switch (bid.mediaType) { @@ -310,7 +310,7 @@ function prebidBid(serverBid, cur) { } function setMediaType(bid, newBid) { - if (utils.deepAccess(bid, 'ext.crtype') === 'native') { + if (deepAccess(bid, 'ext.crtype') === 'native') { newBid.mediaType = NATIVE; } else { newBid.mediaType = BANNER; @@ -364,7 +364,7 @@ function setLocalStorageSafely(key, val) { } function createBannerRequest(bid) { - const sizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes'); + const sizes = deepAccess(bid, 'mediaTypes.banner.sizes'); let format = []; if (sizes.length > 1) { for (let f = 0; f < sizes.length; f++) { @@ -380,7 +380,7 @@ function createBannerRequest(bid) { if (format.length) { r.format = format } - const pos = utils.deepAccess(bid, 'mediaTypes.banner.pos') || 0 + const pos = deepAccess(bid, 'mediaTypes.banner.pos') || 0 if (pos) { r.pos = pos } @@ -407,15 +407,15 @@ function createNativeRequest(params) { }; break; case NATIVE_ASSETS.IMAGE.KEY: - const wmin = params[key].wmin || params[key].minimumWidth || (utils.isArray(params[key].minsizes) && params[key].minsizes.length > 0 ? params[key].minsizes[0] : 0); - const hmin = params[key].hmin || params[key].minimumHeight || (utils.isArray(params[key].minsizes) && params[key].minsizes.length > 1 ? params[key].minsizes[1] : 0); + const wmin = params[key].wmin || params[key].minimumWidth || (isArray(params[key].minsizes) && params[key].minsizes.length > 0 ? params[key].minsizes[0] : 0); + const hmin = params[key].hmin || params[key].minimumHeight || (isArray(params[key].minsizes) && params[key].minsizes.length > 1 ? params[key].minsizes[1] : 0); assetObj = { id: NATIVE_ASSETS.IMAGE.ID, required: params[key].required ? 1 : 0, img: { type: NATIVE_ASSET_IMAGE_TYPE.IMAGE, - w: params[key].w || params[key].width || (utils.isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[0] : 0), - h: params[key].h || params[key].height || (utils.isArray(params[key].sizes) && params[key].sizes.length > 1 ? params[key].sizes[1] : 0), + w: params[key].w || params[key].width || (isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[0] : 0), + h: params[key].h || params[key].height || (isArray(params[key].sizes) && params[key].sizes.length > 1 ? params[key].sizes[1] : 0), mimes: params[key].mimes, ext: params[key].ext, } @@ -439,8 +439,8 @@ function createNativeRequest(params) { required: params[key].required ? 1 : 0, img: { type: NATIVE_ASSET_IMAGE_TYPE.ICON, - w: params[key].w || params[key].width || (utils.isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[0] : 0), - h: params[key].h || params[key].height || (utils.isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[1] : 0), + w: params[key].w || params[key].width || (isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[0] : 0), + h: params[key].h || params[key].height || (isArray(params[key].sizes) && params[key].sizes.length > 0 ? params[key].sizes[1] : 0), } }; if (!assetObj.img.w) { @@ -485,7 +485,7 @@ function createNativeRequest(params) { break; } else { if (ele.id === 4 && nativeRequestObject.assets[i].id === 11) { - if (utils.deepAccess(nativeRequestObject.assets[i], 'data.type') === ele.data.type) { + if (deepAccess(nativeRequestObject.assets[i], 'data.type') === ele.data.type) { presentrequiredAssetCount++; break; } @@ -517,7 +517,7 @@ function parseNativeResponse(bid, newBid) { try { adm = JSON.parse(bid.adm); } catch (ex) { - utils.logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native response for ad response: ' + newBid.adm); + logWarn(LOG_WARN_PREFIX + 'Error: Cannot parse native response for ad response: ' + newBid.adm); return; } if (adm && adm.native && adm.native.assets && adm.native.assets.length > 0) { @@ -591,16 +591,16 @@ function pageInfo() { * @returns {*|number} floor price */ function getBidFloor(bid, cur) { - let bidFloor = utils.getBidIdParameter('bidfloor', bid.params) || utils.getBidIdParameter('bidFloor', bid.params) || 0; + let bidFloor = getBidIdParameter('bidfloor', bid.params) || getBidIdParameter('bidFloor', bid.params) || 0; const reqCur = cur - if (!bidFloor && utils.isFn(bid.getFloor)) { + if (!bidFloor && isFn(bid.getFloor)) { const floorObj = bid.getFloor({ currency: '*', mediaType: '*', size: '*' }); - if (utils.isPlainObject(floorObj) && utils.isNumber(floorObj.floor)) { + if (isPlainObject(floorObj) && isNumber(floorObj.floor)) { if (!floorObj.currency && reqCur !== DEFAULT_CUR) { floorObj.currency = DEFAULT_CUR } diff --git a/modules/microadBidAdapter.js b/modules/microadBidAdapter.js index c78a66aecee..982bd61840a 100644 --- a/modules/microadBidAdapter.js +++ b/modules/microadBidAdapter.js @@ -1,6 +1,6 @@ +import { deepAccess, isEmpty, isStr } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'microad'; @@ -82,8 +82,8 @@ export const spec = { } } - const idlEnv = utils.deepAccess(bid, 'userId.idl_env') - if (!utils.isEmpty(idlEnv) && utils.isStr(idlEnv)) { + const idlEnv = deepAccess(bid, 'userId.idl_env') + if (!isEmpty(idlEnv) && isStr(idlEnv)) { params['idl_env'] = idlEnv } diff --git a/modules/mwOpenLinkIdSystem.js b/modules/mwOpenLinkIdSystem.js index b2381836d5d..552223fa73c 100644 --- a/modules/mwOpenLinkIdSystem.js +++ b/modules/mwOpenLinkIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; +import { timestamp, logError, deepClone, generateUUID, isPlainObject } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -18,20 +18,20 @@ const openLinkID = { const storage = getStorageManager(); function getExpirationDate() { - return (new Date(utils.timestamp() + openLinkID.cookie_expiration)).toGMTString(); + return (new Date(timestamp() + openLinkID.cookie_expiration)).toGMTString(); } function isValidConfig(configParams) { if (!configParams) { - utils.logError('User ID - mwOlId submodule requires configParams'); + logError('User ID - mwOlId submodule requires configParams'); return false; } if (!configParams.accountId) { - utils.logError('User ID - mwOlId submodule requires accountId to be defined'); + logError('User ID - mwOlId submodule requires accountId to be defined'); return false; } if (!configParams.partnerId) { - utils.logError('User ID - mwOlId submodule requires partnerId to be defined'); + logError('User ID - mwOlId submodule requires partnerId to be defined'); return false; } return true; @@ -96,7 +96,7 @@ function register(configParams, olid) { function setID(configParams) { if (!isValidConfig(configParams)) return undefined; const mwOlId = readCookie(); - const newMwOlId = mwOlId ? utils.deepClone(mwOlId) : {eid: utils.generateUUID()}; + const newMwOlId = mwOlId ? deepClone(mwOlId) : {eid: generateUUID()}; writeCookie(newMwOlId); register(configParams, newMwOlId.eid); return { @@ -122,7 +122,7 @@ export const mwOpenLinkIdSubModule = { * @return {(Object|undefined} */ decode(mwOlId) { - const id = mwOlId && utils.isPlainObject(mwOlId) ? mwOlId.eid : undefined; + const id = mwOlId && isPlainObject(mwOlId) ? mwOlId.eid : undefined; return id ? { 'mwOpenLinkId': id } : undefined; }, diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index 2f63dcb45f8..f91a8b6085b 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { isEmpty } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; // import { config } from 'src/config' @@ -120,7 +120,7 @@ export const spec = { */ interpretResponse: function (response, request) { // If the bid response was empty, return [] - if (!response || !response.body || utils.isEmpty(response.body)) return [] + if (!response || !response.body || isEmpty(response.body)) return [] try { const body = @@ -216,7 +216,7 @@ export const spec = { let body serverResponses.forEach((response) => { // If the bid response was empty, return [] - if (!response || !response.body || utils.isEmpty(response.body)) { + if (!response || !response.body || isEmpty(response.body)) { return syncs } diff --git a/modules/naveggIdSystem.js b/modules/naveggIdSystem.js index c37530b4151..7bd86879e9d 100644 --- a/modules/naveggIdSystem.js +++ b/modules/naveggIdSystem.js @@ -4,7 +4,7 @@ * @module modules/naveggId * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { isStr, isPlainObject, logError } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -58,7 +58,7 @@ export const naveggIdSubmodule = { * @return { Object | string | undefined } */ decode(value) { - const naveggIdVal = value ? utils.isStr(value) ? value : utils.isPlainObject(value) ? value.id : undefined : undefined; + const naveggIdVal = value ? isStr(value) ? value : isPlainObject(value) ? value.id : undefined : undefined; return naveggIdVal ? { 'naveggId': naveggIdVal } : undefined; @@ -81,7 +81,7 @@ export const naveggIdSubmodule = { try { return { id: naveggIdString }; } catch (error) { - utils.logError(error); + logError(error); } } return undefined; diff --git a/modules/nextMillenniumBidAdapter.js b/modules/nextMillenniumBidAdapter.js index 2101bb34e2b..d275fbf1160 100644 --- a/modules/nextMillenniumBidAdapter.js +++ b/modules/nextMillenniumBidAdapter.js @@ -1,5 +1,5 @@ +import { isStr, _each, getBidIdParameter } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import { BANNER } from '../src/mediaTypes.js'; const BIDDER_CODE = 'nextMillennium'; @@ -12,20 +12,20 @@ export const spec = { isBidRequestValid: function(bid) { return !!( - bid.params.placement_id && utils.isStr(bid.params.placement_id) + bid.params.placement_id && isStr(bid.params.placement_id) ); }, buildRequests: function(validBidRequests, bidderRequest) { const requests = []; - utils._each(validBidRequests, function(bid) { + _each(validBidRequests, function(bid) { const postBody = { 'id': bid.auctionId, 'ext': { 'prebid': { 'storedrequest': { - 'id': utils.getBidIdParameter('placement_id', bid.params) + 'id': getBidIdParameter('placement_id', bid.params) } } } @@ -60,8 +60,8 @@ export const spec = { const response = serverResponse.body; const bidResponses = []; - utils._each(response.seatbid, (resp) => { - utils._each(resp.bid, (bid) => { + _each(response.seatbid, (resp) => { + _each(resp.bid, (bid) => { bidResponses.push({ requestId: bidRequest.bidId, cpm: bid.price, diff --git a/modules/nobidBidAdapter.js b/modules/nobidBidAdapter.js index 619b46ecd1f..5c017852d3e 100644 --- a/modules/nobidBidAdapter.js +++ b/modules/nobidBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logInfo, deepAccess, logWarn, isArray, getParameterByName } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -14,7 +14,7 @@ window.nobid.timeoutTotal = 0; window.nobid.bidWonTotal = 0; window.nobid.refreshCount = 0; function log(msg, obj) { - utils.logInfo('-NoBid- ' + msg, obj) + logInfo('-NoBid- ' + msg, obj) } function nobidSetCookie(cname, cvalue, hours) { var d = new Date(); @@ -29,7 +29,7 @@ function nobidHasPurpose1Consent(bidderRequest) { let result = true; if (bidderRequest && bidderRequest.gdprConsent) { if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) { - result = !!(utils.deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true); + result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true); } } return result; @@ -112,11 +112,11 @@ function nobidBuildRequests(bids, bidderRequest) { var height = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); return `${width}x${height}`; } catch (e) { - utils.logWarn('Could not parse screen dimensions, error details:', e); + logWarn('Could not parse screen dimensions, error details:', e); } } var getEIDs = function(eids) { - if (utils.isArray(eids) && eids.length > 0) { + if (isArray(eids) && eids.length > 0) { let src = []; eids.forEach((eid) => { let ids = []; @@ -150,7 +150,7 @@ function nobidBuildRequests(bids, bidderRequest) { if (sch) state['schain'] = sch; const cop = coppa(); if (cop) state['coppa'] = cop; - const eids = getEIDs(utils.deepAccess(bids, '0.userIdAsEids')); + const eids = getEIDs(deepAccess(bids, '0.userIdAsEids')); if (eids && eids.length > 0) state['eids'] = eids; return state; } @@ -228,8 +228,8 @@ function nobidBuildRequests(bids, bidderRequest) { var placementId = bid.params['placementId']; var adType = 'banner'; - const videoMediaType = utils.deepAccess(bid, 'mediaTypes.video'); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const videoMediaType = deepAccess(bid, 'mediaTypes.video'); + const context = deepAccess(bid, 'mediaTypes.video.context'); if (bid.mediaType === VIDEO || (videoMediaType && (context === 'instream' || context === 'outstream'))) { adType = 'video'; } @@ -363,7 +363,7 @@ export const spec = { buildRequests: function(validBidRequests, bidderRequest) { function resolveEndpoint() { var ret = 'https://ads.servenobid.com/'; - var env = (typeof utils.getParameterByName === 'function') && (utils.getParameterByName('nobid-env')); + var env = (typeof getParameterByName === 'function') && (getParameterByName('nobid-env')); if (!env) ret = 'https://ads.servenobid.com/'; else if (env == 'beta') ret = 'https://beta.servenobid.com/'; else if (env == 'dev') ret = '//localhost:8282/'; @@ -448,7 +448,7 @@ export const spec = { } return syncs; } else { - utils.logWarn('-NoBid- Please enable iframe based user sync.', syncOptions); + logWarn('-NoBid- Please enable iframe based user sync.', syncOptions); return []; } }, diff --git a/modules/novatiqIdSystem.js b/modules/novatiqIdSystem.js index fbfa6ca8abc..4c3324d3fc0 100644 --- a/modules/novatiqIdSystem.js +++ b/modules/novatiqIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js'; +import { logInfo } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; @@ -47,22 +47,22 @@ export const novatiqIdSubmodule = { const configParams = config.params || {}; const srcId = this.getSrcId(configParams); - utils.logInfo('NOVATIQ Sync request used sourceid param: ' + srcId); + logInfo('NOVATIQ Sync request used sourceid param: ' + srcId); let partnerhost; partnerhost = window.location.hostname; - utils.logInfo('NOVATIQ partner hostname: ' + partnerhost); + logInfo('NOVATIQ partner hostname: ' + partnerhost); const novatiqId = snowflakeId(); const url = 'https://spadsync.com/sync?sptoken=' + novatiqId + '&sspid=' + srcId + '&ssphost=' + partnerhost; ajax(url, undefined, undefined, { method: 'GET', withCredentials: false }); - utils.logInfo('NOVATIQ snowflake: ' + novatiqId); + logInfo('NOVATIQ snowflake: ' + novatiqId); return { 'id': novatiqId } }, getSrcId(configParams) { - utils.logInfo('NOVATIQ Configured sourceid param: ' + configParams.sourceid); + logInfo('NOVATIQ Configured sourceid param: ' + configParams.sourceid); function isHex(str) { var a = parseInt(str, 16); @@ -72,13 +72,13 @@ export const novatiqIdSubmodule = { let srcId; if (typeof configParams.sourceid === 'undefined' || configParams.sourceid === null || configParams.sourceid === '') { srcId = '000'; - utils.logInfo('NOVATIQ sourceid param set to value 000 due to undefined parameter or missing value in config section'); + logInfo('NOVATIQ sourceid param set to value 000 due to undefined parameter or missing value in config section'); } else if (configParams.sourceid.length < 3 || configParams.sourceid.length > 3) { srcId = '001'; - utils.logInfo('NOVATIQ sourceid param set to value 001 due to wrong size in config section 3 chars max e.g. 1ab'); + logInfo('NOVATIQ sourceid param set to value 001 due to wrong size in config section 3 chars max e.g. 1ab'); } else if (isHex(configParams.sourceid) == false) { srcId = '002'; - utils.logInfo('NOVATIQ sourceid param set to value 002 due to wrong format in config section expecting hex value only'); + logInfo('NOVATIQ sourceid param set to value 002 due to wrong format in config section expecting hex value only'); } else { srcId = configParams.sourceid; } diff --git a/modules/oneVideoBidAdapter.js b/modules/oneVideoBidAdapter.js index 880f4992614..e0db143dc0f 100644 --- a/modules/oneVideoBidAdapter.js +++ b/modules/oneVideoBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logError, logWarn, parseSizesInput, generateUUID, isFn, logMessage, isPlainObject, isStr, isNumber, isArray } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'oneVideo'; @@ -28,7 +28,7 @@ export const spec = { } // MediaTypes Video / Banner validation if (typeof bid.mediaTypes.video === 'undefined' && typeof bid.mediaTypes.banner === 'undefined') { - utils.logError('Failed validation: adUnit mediaTypes.video OR mediaTypes.banner not declared'); + logError('Failed validation: adUnit mediaTypes.video OR mediaTypes.banner not declared'); return false; }; @@ -36,27 +36,27 @@ export const spec = { // Player size validation if (typeof bid.mediaTypes.video.playerSize === 'undefined') { if (bid.params.video && (typeof bid.params.video.playerWidth === 'undefined' || typeof bid.params.video.playerHeight === 'undefined')) { - utils.logError('Failed validation: Player size not declared in either mediaTypes.playerSize OR bid.params.video.plauerWidth & bid.params.video.playerHeight.'); + logError('Failed validation: Player size not declared in either mediaTypes.playerSize OR bid.params.video.plauerWidth & bid.params.video.playerHeight.'); return false; }; }; // Mimes validation if (typeof bid.mediaTypes.video.mimes === 'undefined') { if (!bid.params.video || typeof bid.params.video.mimes === 'undefined') { - utils.logError('Failed validation: adUnit mediaTypes.mimes OR params.video.mimes not declared'); + logError('Failed validation: adUnit mediaTypes.mimes OR params.video.mimes not declared'); return false; }; }; // Prevend DAP Outstream validation, Banner DAP validation & Multi-Format adUnit support if (bid.mediaTypes.video.context === 'outstream' && bid.params.video && bid.params.video.display === 1) { - utils.logError('Failed validation: Dynamic Ad Placement cannot be used with context Outstream (params.video.display=1)'); + logError('Failed validation: Dynamic Ad Placement cannot be used with context Outstream (params.video.display=1)'); return false; }; }; // Publisher Id (Exchange) validation if (typeof bid.params.pubId === 'undefined') { - utils.logError('Failed validation: Adapter cannot send requests without bid.params.pubId'); + logError('Failed validation: Adapter cannot send requests without bid.params.pubId'); return false; } @@ -106,7 +106,7 @@ export const spec = { response = null; } if (!response || !bid || (!bid.adm && !bid.nurl) || !bid.price) { - utils.logWarn(`No valid bids from ${spec.code} bidder`); + logWarn(`No valid bids from ${spec.code} bidder`); return []; } size = getSize(bidRequest.sizes); @@ -172,7 +172,7 @@ export const spec = { }; function getSize(sizes) { - let parsedSizes = utils.parseSizesInput(sizes); + let parsedSizes = parseSizesInput(sizes); let [ width, height ] = parsedSizes.length ? parsedSizes[0].split('x') : []; return { width: parseInt(width, 10) || undefined, @@ -194,7 +194,7 @@ function getRequestData(bid, consentData, bidRequest) { size: '*' }; let bidData = { - id: utils.generateUUID(), + id: generateUUID(), at: 2, imp: [{ id: '1', @@ -286,7 +286,7 @@ function getRequestData(bid, consentData, bidRequest) { } } - if (utils.isFn(bid.getFloor)) { + if (isFn(bid.getFloor)) { let floorData = bid.getFloor(getFloorRequestObject); bidData.imp[0].bidfloor = floorData.floor; bidData.cur = floorData.currency; @@ -344,7 +344,7 @@ function getRequestData(bid, consentData, bidRequest) { } } if (bid.params.video.e2etest) { - utils.logMessage('E2E test mode enabled: \n The following parameters are being overridden by e2etest mode:\n* bidfloor:null\n* width:300\n* height:250\n* mimes: video/mp4, application/javascript\n* api:2\n* site.page/ref: verizonmedia.com\n* tmax:1000'); + logMessage('E2E test mode enabled: \n The following parameters are being overridden by e2etest mode:\n* bidfloor:null\n* width:300\n* height:250\n* mimes: video/mp4, application/javascript\n* api:2\n* site.page/ref: verizonmedia.com\n* tmax:1000'); bidData.imp[0].bidfloor = null; bidData.imp[0].video.w = 300; bidData.imp[0].video.h = 250; @@ -354,15 +354,15 @@ function getRequestData(bid, consentData, bidRequest) { bidData.site.ref = 'https://verizonmedia.com'; bidData.tmax = 1000; } - if (bid.params.video.custom && utils.isPlainObject(bid.params.video.custom)) { + if (bid.params.video.custom && isPlainObject(bid.params.video.custom)) { bidData.imp[0].ext.custom = {}; for (const key in bid.params.video.custom) { - if (utils.isStr(bid.params.video.custom[key]) || utils.isNumber(bid.params.video.custom[key])) { + if (isStr(bid.params.video.custom[key]) || isNumber(bid.params.video.custom[key])) { bidData.imp[0].ext.custom[key] = bid.params.video.custom[key]; } } } - if (bid.params.video.content && utils.isPlainObject(bid.params.video.content)) { + if (bid.params.video.content && isPlainObject(bid.params.video.content)) { bidData.site.content = {}; const contentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; const contentNumberkeys = ['episode', 'prodq', 'context', 'livestream', 'len']; @@ -370,14 +370,14 @@ function getRequestData(bid, consentData, bidRequest) { const contentObjectKeys = ['ext']; for (const contentKey in bid.params.video.content) { if ( - (contentStringKeys.indexOf(contentKey) > -1 && utils.isStr(bid.params.video.content[contentKey])) || - (contentNumberkeys.indexOf(contentKey) > -1 && utils.isNumber(bid.params.video.content[contentKey])) || - (contentObjectKeys.indexOf(contentKey) > -1 && utils.isPlainObject(bid.params.video.content[contentKey])) || - (contentArrayKeys.indexOf(contentKey) > -1 && utils.isArray(bid.params.video.content[contentKey]) && - bid.params.video.content[contentKey].every(catStr => utils.isStr(catStr)))) { + (contentStringKeys.indexOf(contentKey) > -1 && isStr(bid.params.video.content[contentKey])) || + (contentNumberkeys.indexOf(contentKey) > -1 && isNumber(bid.params.video.content[contentKey])) || + (contentObjectKeys.indexOf(contentKey) > -1 && isPlainObject(bid.params.video.content[contentKey])) || + (contentArrayKeys.indexOf(contentKey) > -1 && isArray(bid.params.video.content[contentKey]) && + bid.params.video.content[contentKey].every(catStr => isStr(catStr)))) { bidData.site.content[contentKey] = bid.params.video.content[contentKey]; } else { - utils.logMessage('oneVideo bid adapter validation error: ', contentKey, ' is either not supported is OpenRTB V2.5 or value is undefined'); + logMessage('oneVideo bid adapter validation error: ', contentKey, ' is either not supported is OpenRTB V2.5 or value is undefined'); } } } diff --git a/modules/onomagicBidAdapter.js b/modules/onomagicBidAdapter.js index 548c0170c05..25b0f1a5934 100644 --- a/modules/onomagicBidAdapter.js +++ b/modules/onomagicBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { getBidIdParameter, _each, isArray, getWindowTop, getUniqueIdentifierStr, parseUrl, logError, logWarn, createTrackPixelHtml, getWindowSelf, isFn, isPlainObject } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; @@ -22,17 +22,17 @@ function buildRequests(bidReqs, bidderRequest) { referrer = bidderRequest.refererInfo.referer; } const onomagicImps = []; - const publisherId = utils.getBidIdParameter('publisherId', bidReqs[0].params); - utils._each(bidReqs, function (bid) { + const publisherId = getBidIdParameter('publisherId', bidReqs[0].params); + _each(bidReqs, function (bid) { let bidSizes = (bid.mediaTypes && bid.mediaTypes.banner && bid.mediaTypes.banner.sizes) || bid.sizes; - bidSizes = ((utils.isArray(bidSizes) && utils.isArray(bidSizes[0])) ? bidSizes : [bidSizes]); - bidSizes = bidSizes.filter(size => utils.isArray(size)); + bidSizes = ((isArray(bidSizes) && isArray(bidSizes[0])) ? bidSizes : [bidSizes]); + bidSizes = bidSizes.filter(size => isArray(size)); const processedSizes = bidSizes.map(size => ({w: parseInt(size[0], 10), h: parseInt(size[1], 10)})); const element = document.getElementById(bid.adUnitCode); const minSize = _getMinSize(processedSizes); const viewabilityAmount = _isViewabilityMeasurable(element) - ? _getViewability(element, utils.getWindowTop(), minSize) + ? _getViewability(element, getWindowTop(), minSize) : 'na'; const viewabilityAmountRounded = isNaN(viewabilityAmount) ? viewabilityAmount : Math.round(viewabilityAmount); @@ -53,10 +53,10 @@ function buildRequests(bidReqs, bidderRequest) { onomagicImps.push(imp); }); const onomagicBidReq = { - id: utils.getUniqueIdentifierStr(), + id: getUniqueIdentifierStr(), imp: onomagicImps, site: { - domain: utils.parseUrl(referrer).host, + domain: parseUrl(referrer).host, page: referrer, publisher: { id: publisherId @@ -77,7 +77,7 @@ function buildRequests(bidReqs, bidderRequest) { options: {contentType: 'text/plain', withCredentials: false} }; } catch (e) { - utils.logError(e, {bidReqs, bidderRequest}); + logError(e, {bidReqs, bidderRequest}); } } @@ -95,7 +95,7 @@ function isBidRequestValid(bid) { function interpretResponse(serverResponse) { if (!serverResponse.body || typeof serverResponse.body != 'object') { - utils.logWarn('Onomagic server returned empty/non-json response: ' + JSON.stringify(serverResponse.body)); + logWarn('Onomagic server returned empty/non-json response: ' + JSON.stringify(serverResponse.body)); return []; } const { body: {id, seatbid} } = serverResponse; @@ -126,7 +126,7 @@ function interpretResponse(serverResponse) { } return onomagicBidResponses; } catch (e) { - utils.logError(e, {id, seatbid}); + logError(e, {id, seatbid}); } } @@ -150,7 +150,7 @@ function _getDeviceType() { function _getAdMarkup(bid) { let adm = bid.adm; if ('nurl' in bid) { - adm += utils.createTrackPixelHtml(bid.nurl); + adm += createTrackPixelHtml(bid.nurl); } return adm; } @@ -160,14 +160,14 @@ function _isViewabilityMeasurable(element) { } function _getViewability(element, topWin, { w, h } = {}) { - return utils.getWindowTop().document.visibilityState === 'visible' + return getWindowTop().document.visibilityState === 'visible' ? _getPercentInView(element, topWin, { w, h }) : 0; } function _isIframe() { try { - return utils.getWindowSelf() !== utils.getWindowTop(); + return getWindowSelf() !== getWindowTop(); } catch (e) { return true; } @@ -247,7 +247,7 @@ function _getPercentInView(element, topWin, { w, h } = {}) { } function _getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return bid.params.bidFloor ? bid.params.bidFloor : null; } @@ -256,7 +256,7 @@ function _getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { return floor.floor; } return null; From 384521ca46c5a43654f4a0bbbf35a6ea21dbdb88 Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 15:27:29 -0700 Subject: [PATCH 109/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7486) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module --- modules/instreamTracking.js | 10 +- modules/integr8BidAdapter.js | 8 +- modules/intentIqIdSystem.js | 14 +-- modules/interactiveOffersBidAdapter.js | 10 +- modules/invibesBidAdapter.js | 22 ++-- modules/invisiblyAnalyticsAdapter.js | 10 +- modules/iqmBidAdapter.js | 38 +++---- modules/iqzoneBidAdapter.js | 10 +- modules/ixBidAdapter.js | 144 ++++++++++++------------- modules/jixieBidAdapter.js | 12 +-- modules/kargoBidAdapter.js | 4 +- modules/kinessoIdSystem.js | 16 +-- modules/koblerBidAdapter.js | 24 ++--- modules/konduitAnalyticsAdapter.js | 8 +- modules/konduitWrapper.js | 28 ++--- 15 files changed, 179 insertions(+), 179 deletions(-) diff --git a/modules/instreamTracking.js b/modules/instreamTracking.js index 68bb4be79de..40a6ecb1939 100644 --- a/modules/instreamTracking.js +++ b/modules/instreamTracking.js @@ -1,8 +1,8 @@ +import { deepClone, getBidRequest, deepAccess } from '../src/utils.js'; import { config } from '../src/config.js'; import { auctionManager } from '../src/auctionManager.js'; import { INSTREAM } from '../src/video.js'; import * as events from '../src/events.js'; -import * as utils from '../src/utils.js'; import { BID_STATUS, EVENTS, TARGETING_KEYS } from '../src/constants.json'; const {CACHE_ID, UUID} = TARGETING_KEYS; @@ -17,7 +17,7 @@ const INSTREAM_TRACKING_DEFAULT_CONFIG = { // Set instreamTracking default values config.setDefaults({ - 'instreamTracking': utils.deepClone(INSTREAM_TRACKING_DEFAULT_CONFIG) + 'instreamTracking': deepClone(INSTREAM_TRACKING_DEFAULT_CONFIG) }); const whitelistedResources = /video|fetch|xmlhttprequest|other/; @@ -50,8 +50,8 @@ export function trackInstreamDeliveredImpressions({adUnits, bidsReceived, bidder // filter for video bids const instreamBids = bidsReceived.filter(bid => { - const bidderRequest = utils.getBidRequest(bid.requestId, bidderRequests); - return bidderRequest && utils.deepAccess(bidderRequest, 'mediaTypes.video.context') === INSTREAM && bid.videoCacheKey; + const bidderRequest = getBidRequest(bid.requestId, bidderRequests); + return bidderRequest && deepAccess(bidderRequest, 'mediaTypes.video.context') === INSTREAM && bid.videoCacheKey; }); if (!instreamBids.length) { return false; @@ -60,7 +60,7 @@ export function trackInstreamDeliveredImpressions({adUnits, bidsReceived, bidder // find unique instream ad units const instreamAdUnitMap = {}; adUnits.forEach(adUnit => { - if (!instreamAdUnitMap[adUnit.code] && utils.deepAccess(adUnit, 'mediaTypes.video.context') === INSTREAM) { + if (!instreamAdUnitMap[adUnit.code] && deepAccess(adUnit, 'mediaTypes.video.context') === INSTREAM) { instreamAdUnitMap[adUnit.code] = true; } }); diff --git a/modules/integr8BidAdapter.js b/modules/integr8BidAdapter.js index c5415951155..321c3c4c1ab 100644 --- a/modules/integr8BidAdapter.js +++ b/modules/integr8BidAdapter.js @@ -1,7 +1,7 @@ +import { deepAccess, isFn, isPlainObject } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'integr8'; const ENDPOINT_URL = 'https://integr8.central.gjirafa.tech/bid'; @@ -62,7 +62,7 @@ export const spec = { placementId: bidRequest.params.placementId, bidid: bidRequest.bidId, count: bidRequest.params.count, - skipTime: utils.deepAccess(bidRequest, 'mediaTypes.video.skipafter', bidRequest.params.skipTime), + skipTime: deepAccess(bidRequest, 'mediaTypes.video.skipafter', bidRequest.params.skipTime), floor: getBidFloor(bidRequest) }; }); @@ -130,7 +130,7 @@ function generateSizeParam(sizes) { } export function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return null; } @@ -140,7 +140,7 @@ export function getBidFloor(bid) { size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'EUR') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'EUR') { return floor.floor; } diff --git a/modules/intentIqIdSystem.js b/modules/intentIqIdSystem.js index e12a765c086..2092f9a185a 100644 --- a/modules/intentIqIdSystem.js +++ b/modules/intentIqIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logError, logInfo } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import {submodule} from '../src/hook.js' import {getStorageManager} from '../src/storageManager.js'; @@ -47,7 +47,7 @@ export function readData(key) { return storage.getCookie(key); } } catch (error) { - utils.logError(error); + logError(error); } } @@ -59,7 +59,7 @@ export function readData(key) { */ function storeData(key, value) { try { - utils.logInfo(MODULE_NAME + ': storing data: key=' + key + ' value=' + value); + logInfo(MODULE_NAME + ': storing data: key=' + key + ' value=' + value); if (value) { if (storage.hasLocalStorage()) { @@ -71,7 +71,7 @@ function storeData(key, value) { } } } catch (error) { - utils.logError(error); + logError(error); } } @@ -84,7 +84,7 @@ function tryParse(data) { try { return JSON.parse(data); } catch (err) { - utils.logError(err); + logError(err); return null; } } @@ -114,7 +114,7 @@ export const intentIqIdSubmodule = { getId(config) { const configParams = (config && config.params) || {}; if (!configParams || typeof configParams.partner !== 'number') { - utils.logError('User ID - intentIqId submodule requires a valid partner to be defined'); + logError('User ID - intentIqId submodule requires a valid partner to be defined'); return; } @@ -155,7 +155,7 @@ export const intentIqIdSubmodule = { } }, error: error => { - utils.logError(MODULE_NAME + ': ID fetch encountered an error', error); + logError(MODULE_NAME + ': ID fetch encountered an error', error); callback(); } }; diff --git a/modules/interactiveOffersBidAdapter.js b/modules/interactiveOffersBidAdapter.js index 958c671e4b9..c1757198eca 100644 --- a/modules/interactiveOffersBidAdapter.js +++ b/modules/interactiveOffersBidAdapter.js @@ -1,7 +1,7 @@ +import { logWarn, isNumber } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER} from '../src/mediaTypes.js'; import {config} from '../src/config.js'; -import * as utils from '../src/utils.js'; const BIDDER_CODE = 'interactiveOffers'; const ENDPOINT = 'https://prebid.ioadx.com/bidRequest/?partnerId='; @@ -36,15 +36,15 @@ export const spec = { let ret = true; if (bid && bid.params) { if (!bid.params.partnerId) { - utils.logWarn('partnerId must be a valid ID'); + logWarn('partnerId must be a valid ID'); ret = false; } - if (bid.params.tmax && !utils.isNumber(bid.params.tmax)) { - utils.logWarn('tmax must be a valid numeric ID'); + if (bid.params.tmax && !isNumber(bid.params.tmax)) { + logWarn('tmax must be a valid numeric ID'); ret = false; } } else { - utils.logWarn('invalid request'); + logWarn('invalid request'); ret = false; } return ret; diff --git a/modules/invibesBidAdapter.js b/modules/invibesBidAdapter.js index 0441f712a2f..75da1509f19 100644 --- a/modules/invibesBidAdapter.js +++ b/modules/invibesBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logInfo } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {getStorageManager} from '../src/storageManager.js'; @@ -155,12 +155,12 @@ function buildRequest(bidRequests, bidderRequest) { function handleResponse(responseObj, bidRequests) { if (bidRequests == null || bidRequests.length === 0) { - utils.logInfo('Invibes Adapter - No bids have been requested'); + logInfo('Invibes Adapter - No bids have been requested'); return []; } if (!responseObj) { - utils.logInfo('Invibes Adapter - Bid response is empty'); + logInfo('Invibes Adapter - Bid response is empty'); return []; } @@ -171,7 +171,7 @@ function handleResponse(responseObj, bidRequests) { if (responseObj.MultipositionEnabled === true) { invibes.bidResponse.AdPlacements = invibes.bidResponse.AdPlacements.concat(responseObj.AdPlacements); } else { - utils.logInfo('Invibes Adapter - Bid response already received. Invibes only responds to one bid request per user visit'); + logInfo('Invibes Adapter - Bid response already received. Invibes only responds to one bid request per user visit'); return []; } } else { @@ -183,7 +183,7 @@ function handleResponse(responseObj, bidRequests) { let bidRequest = bidRequests[i]; if (invibes.placementBids.indexOf(bidRequest.params.placementId) > -1) { - utils.logInfo('Invibes Adapter - Placement was previously bid on ' + bidRequest.params.placementId); + logInfo('Invibes Adapter - Placement was previously bid on ' + bidRequest.params.placementId); continue; } @@ -215,7 +215,7 @@ function handleResponse(responseObj, bidRequests) { function createBid(bidRequest, requestPlacement, multipositionEnabled) { if (requestPlacement === null || requestPlacement.BidModel === null) { - utils.logInfo('Invibes Adapter - Placement not configured for bidding ' + bidRequest.params.placementId); + logInfo('Invibes Adapter - Placement not configured for bidding ' + bidRequest.params.placementId); return null; } @@ -223,10 +223,10 @@ function createBid(bidRequest, requestPlacement, multipositionEnabled) { let ads = requestPlacement.Ads; if (!Array.isArray(ads) || ads.length < 1) { if (requestPlacement.AdReason != null) { - utils.logInfo('Invibes Adapter - No ads ' + requestPlacement.AdReason); + logInfo('Invibes Adapter - No ads ' + requestPlacement.AdReason); } - utils.logInfo('Invibes Adapter - No ads available'); + logInfo('Invibes Adapter - No ads available'); return null; } @@ -241,7 +241,7 @@ function createBid(bidRequest, requestPlacement, multipositionEnabled) { }); if (blacklistsPushedCids) { - utils.logInfo('Invibes Adapter - Ad blacklists pushed ids'); + logInfo('Invibes Adapter - Ad blacklists pushed ids'); return null; } } @@ -250,7 +250,7 @@ function createBid(bidRequest, requestPlacement, multipositionEnabled) { return invibes.pushedCids[pushedCid].indexOf(ad.Cid) > -1; }); if (isBlacklisted) { - utils.logInfo('Invibes Adapter - Ad is blacklisted'); + logInfo('Invibes Adapter - Ad is blacklisted'); return null; } } @@ -258,7 +258,7 @@ function createBid(bidRequest, requestPlacement, multipositionEnabled) { invibes.pushedCids[ad.Cid] = ad.Blcids || []; const now = Date.now(); - utils.logInfo('Bid auction started at ' + bidModel.AuctionStartTime + ' . Invibes registered the bid at ' + now + ' ; bid request took a total of ' + (now - bidModel.AuctionStartTime) + ' ms.'); + logInfo('Bid auction started at ' + bidModel.AuctionStartTime + ' . Invibes registered the bid at ' + now + ' ; bid request took a total of ' + (now - bidModel.AuctionStartTime) + ' ms.'); return { requestId: bidRequest.bidId, diff --git a/modules/invisiblyAnalyticsAdapter.js b/modules/invisiblyAnalyticsAdapter.js index d4fd3831210..5d15ae55bfc 100644 --- a/modules/invisiblyAnalyticsAdapter.js +++ b/modules/invisiblyAnalyticsAdapter.js @@ -5,11 +5,11 @@ import { ajaxBuilder } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; +import { generateUUID, logInfo } from '../src/utils.js'; + const DEFAULT_EVENT_URL = 'https://api.pymx5.com/v1/' + 'sites/events'; const analyticsType = 'endpoint'; const analyticsName = 'Invisibly Analytics Adapter:'; - -const utils = require('../src/utils.js'); const CONSTANTS = require('../src/constants.json'); const ajax = ajaxBuilder(0); @@ -33,7 +33,7 @@ const { } = CONSTANTS; const _VERSION = 1; -const _pageViewId = utils.generateUUID(); +const _pageViewId = generateUUID(); let initOptions = null; let _startAuction = 0; let _bidRequestTimeout = 0; @@ -122,7 +122,7 @@ function flush() { }; ajax( initOptions.url, - () => utils.logInfo(`${analyticsName} sent events batch`), + () => logInfo(`${analyticsName} sent events batch`), JSON.stringify(payload), { contentType: 'application/json', @@ -206,7 +206,7 @@ function handleEvent(eventType, eventArgs) { function sendEvent(event) { _eventQueue.push(event); - utils.logInfo(`${analyticsName}Event ${event.eventType}:`, event); + logInfo(`${analyticsName}Event ${event.eventType}:`, event); if (event.eventType === AUCTION_END) { flush(); diff --git a/modules/iqmBidAdapter.js b/modules/iqmBidAdapter.js index e7599fd54c0..75854d39fd5 100644 --- a/modules/iqmBidAdapter.js +++ b/modules/iqmBidAdapter.js @@ -1,6 +1,6 @@ +import { deepAccess, getBidIdParameter, isArray, _each, getWindowTop, parseUrl } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {config} from '../src/config.js'; -import * as utils from '../src/utils.js'; import {BANNER, VIDEO} from '../src/mediaTypes.js'; import {INSTREAM} from '../src/video.js'; @@ -28,11 +28,11 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: function (bid) { - const banner = utils.deepAccess(bid, 'mediaTypes.banner'); - const videoMediaType = utils.deepAccess(bid, 'mediaTypes.video'); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const banner = deepAccess(bid, 'mediaTypes.banner'); + const videoMediaType = deepAccess(bid, 'mediaTypes.video'); + const context = deepAccess(bid, 'mediaTypes.video.context'); if ((videoMediaType && context === INSTREAM)) { - const videoBidderParams = utils.deepAccess(bid, 'params.video', {}); + const videoBidderParams = deepAccess(bid, 'params.video', {}); if (!Array.isArray(videoMediaType.playerSize)) { return false; @@ -85,7 +85,7 @@ export const spec = { buildRequests: function (validBidRequests, bidderRequest) { return validBidRequests.map(bid => { var finalRequest = {}; - let bidfloor = utils.getBidIdParameter('bidfloor', bid.params); + let bidfloor = getBidIdParameter('bidfloor', bid.params); const imp = { id: bid.bidId, @@ -95,10 +95,10 @@ export const spec = { displaymanagerver: VERSION, } - if (utils.deepAccess(bid, 'mediaTypes.banner')) { + if (deepAccess(bid, 'mediaTypes.banner')) { imp.banner = getSize(bid.sizes); imp.mediatype = 'banner'; - } else if (utils.deepAccess(bid, 'mediaTypes.video')) { + } else if (deepAccess(bid, 'mediaTypes.video')) { imp.video = _buildVideoORTB(bid); imp.mediatype = 'video'; } @@ -107,8 +107,8 @@ export const spec = { finalRequest = { sizes: bid.sizes, id: bid.bidId, - publisherId: utils.getBidIdParameter('publisherId', bid.params), - placementId: utils.getBidIdParameter('placementId', bid.params), + publisherId: getBidIdParameter('publisherId', bid.params), + placementId: getBidIdParameter('placementId', bid.params), device: device, site: site, imp: imp, @@ -138,9 +138,9 @@ export const spec = { interpretResponse: function (serverResponse, bidRequest) { const bidResponses = []; serverResponse = serverResponse.body; - if (serverResponse && utils.isArray(serverResponse.seatbid)) { - utils._each(serverResponse.seatbid, function (bidList) { - utils._each(bidList.bid, function (bid) { + if (serverResponse && isArray(serverResponse.seatbid)) { + _each(serverResponse.seatbid, function (bidList) { + _each(bidList.bid, function (bid) { const responseCPM = parseFloat(bid.price); if (responseCPM > 0.0 && bid.impid) { const bidResponse = { @@ -228,16 +228,16 @@ function getSite(bidderRequest) { const {refererInfo} = bidderRequest; if (canAccessTopWindow()) { - const wt = utils.getWindowTop(); + const wt = getWindowTop(); domain = wt.location.hostname; page = wt.location.href; referrer = wt.document.referrer || ''; } else if (refererInfo.reachedTop) { - const url = utils.parseUrl(refererInfo.referer); + const url = parseUrl(refererInfo.referer); domain = url.hostname; page = refererInfo.referer; } else if (refererInfo.stack && refererInfo.stack.length && refererInfo.stack[0]) { - const url = utils.parseUrl(refererInfo.stack[0]); + const url = parseUrl(refererInfo.stack[0]); domain = url.hostname; } @@ -251,7 +251,7 @@ function getSite(bidderRequest) { function canAccessTopWindow() { try { - if (utils.getWindowTop().location.href) { + if (getWindowTop().location.href) { return true; } } catch (error) { @@ -260,8 +260,8 @@ function canAccessTopWindow() { } function _buildVideoORTB(bidRequest) { - const videoAdUnit = utils.deepAccess(bidRequest, 'mediaTypes.video'); - const videoBidderParams = utils.deepAccess(bidRequest, 'params.video', {}); + const videoAdUnit = deepAccess(bidRequest, 'mediaTypes.video'); + const videoBidderParams = deepAccess(bidRequest, 'params.video', {}); const video = {} const videoParams = { diff --git a/modules/iqzoneBidAdapter.js b/modules/iqzoneBidAdapter.js index 77bdcc0188d..5268f8935be 100644 --- a/modules/iqzoneBidAdapter.js +++ b/modules/iqzoneBidAdapter.js @@ -1,6 +1,6 @@ +import { isFn, deepAccess, logMessage } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; const BIDDER_CODE = 'iqzone'; @@ -66,8 +66,8 @@ function getPlacementReqData(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { - return utils.deepAccess(bid, 'params.bidfloor', 0); + if (!isFn(bid.getFloor)) { + return deepAccess(bid, 'params.bidfloor', 0); } try { @@ -113,7 +113,7 @@ export const spec = { deviceHeight = winTop.screen.height; winLocation = winTop.location; } catch (e) { - utils.logMessage(e); + logMessage(e); winLocation = window.location; } @@ -122,7 +122,7 @@ export const spec = { try { refferLocation = refferUrl && new URL(refferUrl); } catch (e) { - utils.logMessage(e); + logMessage(e); } let location = refferLocation || winLocation; diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 4ff84e7c104..cf551c4f3db 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, parseGPTSingleSizeArray, inIframe, deepClone, logError, logWarn, isFn, contains, isInteger, isArray, deepSetValue, parseQueryStringParameters, isEmpty, mergeDeep, convertTypes } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; import find from 'core-js-pure/features/array/find.js'; @@ -83,17 +83,17 @@ const VIDEO_PARAMS_ALLOW_LIST = [ function bidToBannerImp(bid) { const imp = bidToImp(bid); imp.banner = {}; - const impSize = utils.deepAccess(bid, 'params.size'); + const impSize = deepAccess(bid, 'params.size'); if (impSize) { imp.banner.w = impSize[0]; imp.banner.h = impSize[1]; // populate sid with size if not id - if (!utils.deepAccess(imp, 'ext.sid')) { - imp.ext.sid = utils.parseGPTSingleSizeArray(impSize); + if (!deepAccess(imp, 'ext.sid')) { + imp.ext.sid = parseGPTSingleSizeArray(impSize); } } - imp.banner.topframe = utils.inIframe() ? 0 : 1; + imp.banner.topframe = inIframe() ? 0 : 1; _applyFloor(bid, imp, BANNER); @@ -108,14 +108,14 @@ function bidToBannerImp(bid) { */ function bidToVideoImp(bid) { const imp = bidToImp(bid); - const videoAdUnitRef = utils.deepAccess(bid, 'mediaTypes.video'); - const videoParamRef = utils.deepAccess(bid, 'params.video'); + const videoAdUnitRef = deepAccess(bid, 'mediaTypes.video'); + const videoParamRef = deepAccess(bid, 'params.video'); const videoParamErrors = checkVideoParams(videoAdUnitRef, videoParamRef); if (videoParamErrors.length) { return {}; } - imp.video = videoParamRef ? utils.deepClone(bid.params.video) : {}; + imp.video = videoParamRef ? deepClone(bid.params.video) : {}; // copy all video properties to imp object for (const adUnitProperty in videoAdUnitRef) { @@ -125,7 +125,7 @@ function bidToVideoImp(bid) { } if (imp.video.minduration > imp.video.maxduration) { - utils.logError(`IX Bid Adapter: video minduration [${imp.video.minduration}] cannot be greater than video maxduration [${imp.video.maxduration}]`); + logError(`IX Bid Adapter: video minduration [${imp.video.minduration}] cannot be greater than video maxduration [${imp.video.maxduration}]`); return {}; } @@ -138,21 +138,21 @@ function bidToVideoImp(bid) { } else if (context === OUTSTREAM) { imp.video.placement = 4; } else { - utils.logWarn(`IX Bid Adapter: Video context '${context}' is not supported`); + logWarn(`IX Bid Adapter: Video context '${context}' is not supported`); } } if (!(imp.video.w && imp.video.h)) { // Getting impression Size - const impSize = getFirstSize(utils.deepAccess(imp, 'video.playerSize')) || getFirstSize(utils.deepAccess(bid, 'params.size')); + const impSize = getFirstSize(deepAccess(imp, 'video.playerSize')) || getFirstSize(deepAccess(bid, 'params.size')); if (impSize) { imp.video.w = impSize[0]; imp.video.h = impSize[1]; - if (!(utils.deepAccess(imp, 'ext.sid'))) { - imp.ext.sid = utils.parseGPTSingleSizeArray(impSize); + if (!(deepAccess(imp, 'ext.sid'))) { + imp.ext.sid = parseGPTSingleSizeArray(impSize); } } else { - utils.logWarn('IX Bid Adapter: Video size is missing in [mediaTypes.video] missing'); + logWarn('IX Bid Adapter: Video size is missing in [mediaTypes.video] missing'); return {}; } } @@ -180,7 +180,7 @@ function bidToImp(bid) { imp.ext.sid = String(bid.params.id); } - const dfpAdUnitCode = utils.deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot'); + const dfpAdUnitCode = deepAccess(bid, 'ortb2Imp.ext.data.adserver.adslot'); if (dfpAdUnitCode) { imp.ext.dfp_ad_unit_code = dfpAdUnitCode; } @@ -202,11 +202,11 @@ function _applyFloor(bid, imp, mediaType) { adapterFloor = { floor: bid.params.bidFloor, currency: bid.params.bidFloorCur }; } - if (utils.isFn(bid.getFloor)) { + if (isFn(bid.getFloor)) { let _mediaType = '*'; let _size = '*'; - if (mediaType && utils.contains(SUPPORTED_AD_TYPES, mediaType)) { + if (mediaType && contains(SUPPORTED_AD_TYPES, mediaType)) { const { w: width, h: height } = imp[mediaType]; _mediaType = mediaType; _size = [width, height]; @@ -218,7 +218,7 @@ function _applyFloor(bid, imp, mediaType) { }); } catch (err) { // continue with no module floors - utils.logWarn('priceFloors module call getFloor failed, error : ', err); + logWarn('priceFloors module call getFloor failed, error : ', err); } } @@ -243,8 +243,8 @@ function _applyFloor(bid, imp, mediaType) { */ function parseBid(rawBid, currency, bidRequest) { const bid = {}; - const isValidExpiry = !!((utils.deepAccess(rawBid, 'exp') && utils.isInteger(rawBid.exp))); - const dealID = utils.deepAccess(rawBid, 'dealid') || utils.deepAccess(rawBid, 'ext.dealid'); + const isValidExpiry = !!((deepAccess(rawBid, 'exp') && isInteger(rawBid.exp))); + const dealID = deepAccess(rawBid, 'dealid') || deepAccess(rawBid, 'ext.dealid'); if (PRICE_TO_DOLLAR_FACTOR.hasOwnProperty(currency)) { bid.cpm = rawBid.price / PRICE_TO_DOLLAR_FACTOR[currency]; @@ -263,7 +263,7 @@ function parseBid(rawBid, currency, bidRequest) { bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-'; // in the event of a video - if (utils.deepAccess(rawBid, 'ext.vasturl')) { + if (deepAccess(rawBid, 'ext.vasturl')) { bid.vastUrl = rawBid.ext.vasturl bid.width = bidRequest.video.w; bid.height = bidRequest.video.h; @@ -279,9 +279,9 @@ function parseBid(rawBid, currency, bidRequest) { } bid.meta = {}; - bid.meta.networkId = utils.deepAccess(rawBid, 'ext.dspid'); - bid.meta.brandId = utils.deepAccess(rawBid, 'ext.advbrandid'); - bid.meta.brandName = utils.deepAccess(rawBid, 'ext.advbrand'); + bid.meta.networkId = deepAccess(rawBid, 'ext.dspid'); + bid.meta.brandId = deepAccess(rawBid, 'ext.advbrandid'); + bid.meta.brandName = deepAccess(rawBid, 'ext.advbrand'); if (rawBid.adomain && rawBid.adomain.length > 0) { bid.meta.advertiserDomains = rawBid.adomain; } @@ -296,7 +296,7 @@ function parseBid(rawBid, currency, bidRequest) { * @return {boolean} True if this is a valid size format, and false otherwise. */ function isValidSize(size) { - return Array.isArray(size) && size.length === 2 && utils.isInteger(size[0]) && utils.isInteger(size[1]); + return Array.isArray(size) && size.length === 2 && isInteger(size[0]) && isInteger(size[1]); } /** @@ -330,7 +330,7 @@ function checkVideoParams(mediaTypeVideoRef, paramsVideoRef) { const errorList = []; if (!mediaTypeVideoRef) { - utils.logWarn('IX Bid Adapter: mediaTypes.video is the preferred location for video params in ad unit'); + logWarn('IX Bid Adapter: mediaTypes.video is the preferred location for video params in ad unit'); } for (let property of REQUIRED_VIDEO_PARAMS) { @@ -416,9 +416,9 @@ function getBidRequest(id, impressions, validBidRequests) { function getEidInfo(allEids, flocData) { let toSend = []; let seenSources = {}; - if (utils.isArray(allEids)) { + if (isArray(allEids)) { for (const eid of allEids) { - if (SOURCE_RTI_MAPPING[eid.source] && utils.deepAccess(eid, 'uids.0')) { + if (SOURCE_RTI_MAPPING[eid.source] && deepAccess(eid, 'uids.0')) { seenSources[eid.source] = true; eid.uids[0].ext = { rtiPartner: SOURCE_RTI_MAPPING[eid.source] @@ -454,7 +454,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { // Always use secure HTTPS protocol. let baseUrl = SECURE_BID_URL; // Get ids from Prebid User ID Modules - let eidInfo = getEidInfo(utils.deepAccess(validBidRequests, '0.userIdAsEids'), utils.deepAccess(validBidRequests, '0.userId.flocId')); + let eidInfo = getEidInfo(deepAccess(validBidRequests, '0.userIdAsEids'), deepAccess(validBidRequests, '0.userId.flocId')); let userEids = eidInfo.toSend; // RTI ids will be included in the bid request if the function getIdentityInfo() is loaded @@ -543,7 +543,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { } if (bidderRequest.uspConsent) { - utils.deepSetValue(r, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(r, 'regs.ext.us_privacy', bidderRequest.uspConsent); } if (bidderRequest.refererInfo) { @@ -552,7 +552,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { } if (config.getConfig('coppa')) { - utils.deepSetValue(r, 'regs.coppa', 1); + deepSetValue(r, 'regs.coppa', 1); } const payload = {}; @@ -572,10 +572,10 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { const requests = []; let requestSequenceNumber = 0; const transactionIds = Object.keys(impressions); - const baseRequestSize = `${baseUrl}${utils.parseQueryStringParameters({ ...payload, r: JSON.stringify(r) })}`.length; + const baseRequestSize = `${baseUrl}${parseQueryStringParameters({ ...payload, r: JSON.stringify(r) })}`.length; if (baseRequestSize > MAX_REQUEST_SIZE) { - utils.logError('ix bidder: Base request size has exceeded maximum request size.'); + logError('ix bidder: Base request size has exceeded maximum request size.'); return requests; } @@ -605,7 +605,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { } currentRequestSize += fpdRequestSize; } else { - utils.logError('ix bidder: IX config FPD request size has exceeded maximum request size.'); + logError('ix bidder: IX config FPD request size has exceeded maximum request size.'); } } @@ -673,7 +673,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { const fpd = config.getConfig('ortb2') || {}; - if (!utils.isEmpty(fpd) && !isFpdAdded) { + if (!isEmpty(fpd) && !isFpdAdded) { r.ext.ixdiag.fpd = true; const site = { ...(fpd.site || fpd.context) }; @@ -692,28 +692,28 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { } }); - const clonedRObject = utils.deepClone(r); + const clonedRObject = deepClone(r); - clonedRObject.site = utils.mergeDeep({}, clonedRObject.site, site); - clonedRObject.user = utils.mergeDeep({}, clonedRObject.user, user); + clonedRObject.site = mergeDeep({}, clonedRObject.site, site); + clonedRObject.user = mergeDeep({}, clonedRObject.user, user); - const requestSize = `${baseUrl}${utils.parseQueryStringParameters({ ...payload, r: JSON.stringify(clonedRObject) })}`.length; + const requestSize = `${baseUrl}${parseQueryStringParameters({ ...payload, r: JSON.stringify(clonedRObject) })}`.length; if (requestSize < MAX_REQUEST_SIZE) { - r.site = utils.mergeDeep({}, r.site, site); - r.user = utils.mergeDeep({}, r.user, user); + r.site = mergeDeep({}, r.site, site); + r.user = mergeDeep({}, r.user, user); isFpdAdded = true; const fpdRequestSize = encodeURIComponent(JSON.stringify({ ...site, ...user })).length; currentRequestSize += fpdRequestSize; } else { - utils.logError('ix bidder: FPD request size has exceeded maximum request size.'); + logError('ix bidder: FPD request size has exceeded maximum request size.'); } } const isLastAdUnit = adUnitIndex === transactionIds.length - 1; if (wasAdUnitImpressionsTrimmed || isLastAdUnit) { - const clonedPayload = utils.deepClone(payload); + const clonedPayload = deepClone(payload); if (!isLastAdUnit || requestSequenceNumber) { r.ext.ixdiag.sn = requestSequenceNumber; clonedPayload.sn = requestSequenceNumber; @@ -778,30 +778,30 @@ function buildIXDiag(validBidRequests) { for (let i = 0; i < adUnitMap.length; i++) { var bid = validBidRequests.filter(bidRequest => bidRequest.transactionId === adUnitMap[i])[0]; - if (utils.deepAccess(bid, 'mediaTypes')) { + if (deepAccess(bid, 'mediaTypes')) { if (Object.keys(bid.mediaTypes).length > 1) { ixdiag.mfu++; } - if (utils.deepAccess(bid, 'mediaTypes.native')) { + if (deepAccess(bid, 'mediaTypes.native')) { ixdiag.nu++; } - if (utils.deepAccess(bid, 'mediaTypes.banner')) { + if (deepAccess(bid, 'mediaTypes.banner')) { ixdiag.bu++; } - if (utils.deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + if (deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { ixdiag.ou++; // renderer only needed for outstream - const hasRenderer = typeof (utils.deepAccess(bid, 'renderer') || utils.deepAccess(bid, 'mediaTypes.video.renderer')) === 'object'; + const hasRenderer = typeof (deepAccess(bid, 'renderer') || deepAccess(bid, 'mediaTypes.video.renderer')) === 'object'; // if any one ad unit is missing renderer, set ren status to false in diag - ixdiag.ren = ixdiag.ren && hasRenderer ? (utils.deepAccess(ixdiag, 'ren')) : hasRenderer; + ixdiag.ren = ixdiag.ren && hasRenderer ? (deepAccess(ixdiag, 'ren')) : hasRenderer; } - if (utils.deepAccess(bid, 'mediaTypes.video.context') === 'instream') { + if (deepAccess(bid, 'mediaTypes.video.context') === 'instream') { ixdiag.iu++; } @@ -860,7 +860,7 @@ function createBannerImps(validBidRequest, missingBannerSizes, bannerImps) { let imp = bidToBannerImp(validBidRequest); - const bannerSizeDefined = includesSize(utils.deepAccess(validBidRequest, 'mediaTypes.banner.sizes'), utils.deepAccess(validBidRequest, 'params.size')); + const bannerSizeDefined = includesSize(deepAccess(validBidRequest, 'mediaTypes.banner.sizes'), deepAccess(validBidRequest, 'params.size')); // Create IX imps from params.size if (bannerSizeDefined) { @@ -884,7 +884,7 @@ function createBannerImps(validBidRequest, missingBannerSizes, bannerImps) { * @returns {string} */ function detectParamsType(validBidRequest) { - if (utils.deepAccess(validBidRequest, 'params.video') && utils.deepAccess(validBidRequest, 'mediaTypes.video')) { + if (deepAccess(validBidRequest, 'params.video') && deepAccess(validBidRequest, 'mediaTypes.video')) { return VIDEO; } @@ -909,8 +909,8 @@ function updateMissingSizes(validBidRequest, missingBannerSizes, imp) { missingBannerSizes[transactionID].missingSizes = currentSizeList; } else { // New Ad Unit - if (utils.deepAccess(validBidRequest, 'mediaTypes.banner.sizes')) { - let sizeList = utils.deepClone(validBidRequest.mediaTypes.banner.sizes); + if (deepAccess(validBidRequest, 'mediaTypes.banner.sizes')) { + let sizeList = deepClone(validBidRequest.mediaTypes.banner.sizes); removeFromSizes(sizeList, validBidRequest.params.size); let newAdUnitEntry = { 'missingSizes': sizeList, @@ -928,8 +928,8 @@ function updateMissingSizes(validBidRequest, missingBannerSizes, imp) { * @return {object} newImp Updated impression object */ function createMissingBannerImp(bid, imp, newSize) { - const newImp = utils.deepClone(imp); - newImp.ext.sid = utils.parseGPTSingleSizeArray(newSize); + const newImp = deepClone(imp); + newImp.ext.sid = parseGPTSingleSizeArray(newSize); newImp.banner.w = newSize[0]; newImp.banner.h = newSize[1]; @@ -969,7 +969,7 @@ function createRenderer (id) { try { renderer.setRender(outstreamRenderer); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } return renderer; @@ -993,19 +993,19 @@ export const spec = { * @return {boolean} True if this is a valid bid, and false otherwise. */ isBidRequestValid: function (bid) { - const paramsVideoRef = utils.deepAccess(bid, 'params.video'); - const paramsSize = utils.deepAccess(bid, 'params.size'); - const mediaTypeBannerSizes = utils.deepAccess(bid, 'mediaTypes.banner.sizes'); - const mediaTypeVideoRef = utils.deepAccess(bid, 'mediaTypes.video'); - const mediaTypeVideoPlayerSize = utils.deepAccess(bid, 'mediaTypes.video.playerSize'); + const paramsVideoRef = deepAccess(bid, 'params.video'); + const paramsSize = deepAccess(bid, 'params.size'); + const mediaTypeBannerSizes = deepAccess(bid, 'mediaTypes.banner.sizes'); + const mediaTypeVideoRef = deepAccess(bid, 'mediaTypes.video'); + const mediaTypeVideoPlayerSize = deepAccess(bid, 'mediaTypes.video.playerSize'); const hasBidFloor = bid.params.hasOwnProperty('bidFloor'); const hasBidFloorCur = bid.params.hasOwnProperty('bidFloorCur'); - if (bid.hasOwnProperty('mediaType') && !(utils.contains(SUPPORTED_AD_TYPES, bid.mediaType))) { + if (bid.hasOwnProperty('mediaType') && !(contains(SUPPORTED_AD_TYPES, bid.mediaType))) { return false; } - if (utils.deepAccess(bid, 'mediaTypes.banner') && !mediaTypeBannerSizes) { + if (deepAccess(bid, 'mediaTypes.banner') && !mediaTypeBannerSizes) { return false; } @@ -1013,26 +1013,26 @@ export const spec = { // since there is an ix bidder level size, make sure its valid const ixSize = getFirstSize(paramsSize); if (!ixSize) { - utils.logError('ix bidder params: size has invalid format.'); + logError('ix bidder params: size has invalid format.'); return false; } // check if the ix bidder level size, is present in ad unit level if (!includesSize(bid.sizes, ixSize) && !(includesSize(mediaTypeVideoPlayerSize, ixSize)) && !(includesSize(mediaTypeBannerSizes, ixSize))) { - utils.logError('ix bidder params: bid size is not included in ad unit sizes or player size.'); + logError('ix bidder params: bid size is not included in ad unit sizes or player size.'); return false; } } if (typeof bid.params.siteId !== 'string' && typeof bid.params.siteId !== 'number') { - utils.logError('ix bidder params: siteId must be string or number value.'); + logError('ix bidder params: siteId must be string or number value.'); return false; } if (hasBidFloor || hasBidFloorCur) { if (!(hasBidFloor && hasBidFloorCur && isValidBidFloorParams(bid.params.bidFloor, bid.params.bidFloorCur))) { - utils.logError('ix bidder params: bidFloor / bidFloorCur parameter has invalid format.'); + logError('ix bidder params: bidFloor / bidFloorCur parameter has invalid format.'); return false; } } @@ -1041,7 +1041,7 @@ export const spec = { const errorList = checkVideoParams(mediaTypeVideoRef, paramsVideoRef); if (errorList.length) { errorList.forEach((err) => { - utils.logError(err); + logError(err); }); return false; } @@ -1065,7 +1065,7 @@ export const spec = { // Step 1: Create impresssions from IX params validBidRequests.forEach((validBidRequest) => { - const adUnitMediaTypes = Object.keys(utils.deepAccess(validBidRequest, 'mediaTypes', {})) + const adUnitMediaTypes = Object.keys(deepAccess(validBidRequest, 'mediaTypes', {})) switch (detectParamsType(validBidRequest)) { case BANNER: @@ -1156,7 +1156,7 @@ export const spec = { const bidRequest = getBidRequest(innerBids[j].impid, requestBid.imp, bidderRequest.validBidRequests); bid = parseBid(innerBids[j], responseBody.cur, bidRequest); - if (!utils.deepAccess(bid, 'mediaTypes.video.renderer') && utils.deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + if (!deepAccess(bid, 'mediaTypes.video.renderer') && deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { bid.mediaTypes.video.renderer = createRenderer(innerBids[j].bidId); } @@ -1174,7 +1174,7 @@ export const spec = { * @return {Object} params bid params */ transformBidParams: function (params, isOpenRtb) { - return utils.convertTypes({ + return convertTypes({ 'siteID': 'number' }, params); }, diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index db6c9032e65..0e05616465a 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logWarn, parseUrl, deepAccess, isArray } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -95,7 +95,7 @@ function createRenderer_(bidAd, scriptUrl, createFcn) { try { renderer.setRender(createFcn); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } return renderer; } @@ -110,7 +110,7 @@ function getMiscDims_() { let refererInfo_ = getRefererInfo(); let url_ = ((refererInfo_ && refererInfo_.referer) ? refererInfo_.referer : window.location.href); ret.pageurl = url_; - ret.domain = utils.parseUrl(url_).host; + ret.domain = parseUrl(url_).host; ret.device = getDevice_(); } catch (error) {} return ret; @@ -194,8 +194,8 @@ export const spec = { device: miscDims.device, pageurl: encodeURIComponent(miscDims.pageurl), domain: encodeURIComponent(miscDims.domain), - auctionid: utils.deepAccess(timeoutData, '0.auctionId'), - timeout: utils.deepAccess(timeoutData, '0.timeout'), + auctionid: deepAccess(timeoutData, '0.auctionId'), + timeout: deepAccess(timeoutData, '0.timeout'), count: timeoutData.length }); }, @@ -224,7 +224,7 @@ export const spec = { }, interpretResponse: function(response, bidRequest) { - if (response && response.body && utils.isArray(response.body.bids)) { + if (response && response.body && isArray(response.body.bids)) { const bidResponses = []; response.body.bids.forEach(function(oneBid) { let bnd = {}; diff --git a/modules/kargoBidAdapter.js b/modules/kargoBidAdapter.js index 610f4558139..895d8a7d259 100644 --- a/modules/kargoBidAdapter.js +++ b/modules/kargoBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { _each } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -28,7 +28,7 @@ export const spec = { const currency = (currencyObj && currencyObj.adServerCurrency) || 'USD'; const bidIds = {}; const bidSizes = {}; - utils._each(validBidRequests, bid => { + _each(validBidRequests, bid => { bidIds[bid.bidId] = bid.params.placementId; bidSizes[bid.bidId] = bid.sizes; }); diff --git a/modules/kinessoIdSystem.js b/modules/kinessoIdSystem.js index 2cd7f594dd2..ca8fe269a5e 100644 --- a/modules/kinessoIdSystem.js +++ b/modules/kinessoIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { logError, logInfo } from '../src/utils.js'; import {ajax} from '../src/ajax.js'; import {submodule} from '../src/hook.js'; import {coppaDataHandler, uspDataHandler} from '../src/adapterManager.js'; @@ -111,7 +111,7 @@ function encodeTime(now, len) { * @returns {Error} */ function createError(message) { - utils.logError(message); + logError(message); const err = new Error(message); err.source = 'kinessoId'; return err; @@ -147,10 +147,10 @@ function detectPrng(root) { function syncId(storedId) { return { success: function (responseBody) { - utils.logInfo('KinessoId: id to be synced: ' + storedId); + logInfo('KinessoId: id to be synced: ' + storedId); }, error: function () { - utils.logInfo('KinessoId: Sync error for id : ' + storedId); + logInfo('KinessoId: Sync error for id : ' + storedId); } } } @@ -165,7 +165,7 @@ function encodeId(value) { const knssoId = (value && typeof value === 'string') ? value : undefined; if (knssoId) { result.kpuid = knssoId; - utils.logInfo('KinessoId: Decoded value ' + JSON.stringify(result)); + logInfo('KinessoId: Decoded value ' + JSON.stringify(result)); return result; } return knssoId; @@ -217,17 +217,17 @@ export const kinessoIdSubmodule = { getId(config, consentData) { const configParams = (config && config.params) || {}; if (!configParams || typeof configParams.accountid !== 'number') { - utils.logError('User ID - KinessoId submodule requires a valid accountid to be defined'); + logError('User ID - KinessoId submodule requires a valid accountid to be defined'); return; } const coppa = coppaDataHandler.getCoppa(); if (coppa) { - utils.logInfo('KinessoId: IDs not provided for coppa requests, exiting KinessoId'); + logInfo('KinessoId: IDs not provided for coppa requests, exiting KinessoId'); return; } const accountId = configParams.accountid; const knnsoId = id(); - utils.logInfo('KinessoId: generated id ' + knnsoId); + logInfo('KinessoId: generated id ' + knnsoId); const kinessoIdPayload = {}; kinessoIdPayload.id = knnsoId; const payloadString = JSON.stringify(kinessoIdPayload); diff --git a/modules/koblerBidAdapter.js b/modules/koblerBidAdapter.js index 59d1639a329..49be80e969c 100644 --- a/modules/koblerBidAdapter.js +++ b/modules/koblerBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepAccess, isStr, replaceAuctionPrice, triggerPixel, isArray, parseQueryStringParameters, getWindowSelf } from '../src/utils.js'; import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER} from '../src/mediaTypes.js'; @@ -60,34 +60,34 @@ export const interpretResponse = function (serverResponse) { export const onBidWon = function (bid) { const cpm = bid.cpm || 0; const cpmCurrency = bid.currency || SUPPORTED_CURRENCY; - const adServerPrice = utils.deepAccess(bid, 'adserverTargeting.hb_pb', 0); + const adServerPrice = deepAccess(bid, 'adserverTargeting.hb_pb', 0); const adServerPriceCurrency = config.getConfig('currency.adServerCurrency') || SUPPORTED_CURRENCY; - if (utils.isStr(bid.nurl) && bid.nurl !== '') { - const winNotificationUrl = utils.replaceAuctionPrice(bid.nurl, cpm) + if (isStr(bid.nurl) && bid.nurl !== '') { + const winNotificationUrl = replaceAuctionPrice(bid.nurl, cpm) .replace(/\${AUCTION_PRICE_CURRENCY}/g, cpmCurrency) .replace(/\${AD_SERVER_PRICE}/g, adServerPrice) .replace(/\${AD_SERVER_PRICE_CURRENCY}/g, adServerPriceCurrency); - utils.triggerPixel(winNotificationUrl); + triggerPixel(winNotificationUrl); } }; export const onTimeout = function (timeoutDataArray) { - if (utils.isArray(timeoutDataArray)) { + if (isArray(timeoutDataArray)) { const refererInfo = getRefererInfo(); const pageUrl = (refererInfo && refererInfo.referer) ? refererInfo.referer : window.location.href; timeoutDataArray.forEach(timeoutData => { - const query = utils.parseQueryStringParameters({ + const query = parseQueryStringParameters({ ad_unit_code: timeoutData.adUnitCode, auction_id: timeoutData.auctionId, bid_id: timeoutData.bidId, timeout: timeoutData.timeout, - placement_id: utils.deepAccess(timeoutData, 'params.0.placementId'), + placement_id: deepAccess(timeoutData, 'params.0.placementId'), page_url: pageUrl, }); const timeoutNotificationUrl = `${TIMEOUT_NOTIFICATION_ENDPOINT}?${query}`; - utils.triggerPixel(timeoutNotificationUrl); + triggerPixel(timeoutNotificationUrl); }); } }; @@ -143,7 +143,7 @@ function buildOpenRtbImpObject(validBidRequest) { } function getDevice() { - const ws = utils.getWindowSelf(); + const ws = getWindowSelf(); const ua = ws.navigator.userAgent; if (/(tablet|ipad|playbook|silk|android 3.0|xoom|sch-i800|kindle)|(android(?!.*mobi))/i @@ -171,8 +171,8 @@ function getTest(validBidRequest) { } function getSizes(validBidRequest) { - const sizes = utils.deepAccess(validBidRequest, 'mediaTypes.banner.sizes', validBidRequest.sizes); - if (utils.isArray(sizes) && sizes.length > 0) { + const sizes = deepAccess(validBidRequest, 'mediaTypes.banner.sizes', validBidRequest.sizes); + if (isArray(sizes) && sizes.length > 0) { return sizes; } diff --git a/modules/konduitAnalyticsAdapter.js b/modules/konduitAnalyticsAdapter.js index f6b77f23d87..f8a44d7cc94 100644 --- a/modules/konduitAnalyticsAdapter.js +++ b/modules/konduitAnalyticsAdapter.js @@ -1,7 +1,7 @@ +import { parseSizesInput, logError, uniques } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import adapterManager from '../src/adapterManager.js'; -import * as utils from '../src/utils.js'; import { targeting } from '../src/targeting.js'; import { config } from '../src/config.js'; import CONSTANTS from '../src/constants.json'; @@ -84,7 +84,7 @@ const konduitAnalyticsAdapter = Object.assign( ); function obtainBidTimeoutInfo (args) { - return args.map(item => item.bidder).filter(utils.uniques); + return args.map(item => item.bidder).filter(uniques); } function obtainAuctionInfo (auction) { @@ -109,7 +109,7 @@ function obtainBidRequestsInfo (bidRequests) { adUnitCode: bid.adUnitCode, bidId: bid.bidId, startTime: bid.startTime, - sizes: utils.parseSizesInput(bid.sizes).toString(), + sizes: parseSizesInput(bid.sizes).toString(), params: bid.params }; }), @@ -208,7 +208,7 @@ konduitAnalyticsAdapter.enableAnalytics = function (analyticsConfig) { const konduitId = config.getConfig('konduit.konduitId'); if (!konduitId) { - utils.logError('A konduitId in config is required to use konduitAnalyticsAdapter'); + logError('A konduitId in config is required to use konduitAnalyticsAdapter'); return; } diff --git a/modules/konduitWrapper.js b/modules/konduitWrapper.js index 3ce9bc7a501..f19318e3128 100644 --- a/modules/konduitWrapper.js +++ b/modules/konduitWrapper.js @@ -1,6 +1,6 @@ +import { logInfo, logError, isNumber, isStr, isEmpty } from '../src/utils.js'; import { registerVideoSupport } from '../src/adServerManager.js'; import { targeting } from '../src/targeting.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import { ajaxBuilder } from '../src/ajax.js'; import { getPriceBucketString } from '../src/cpmBucketManager.js'; @@ -49,12 +49,12 @@ function addLogLabel(args) { return args; } -function logInfo() { - utils.logInfo(...addLogLabel(arguments)); +function _logInfo() { + logInfo(...addLogLabel(arguments)); } -function logError() { - utils.logError(...addLogLabel(arguments)); +function _logError() { + logError(...addLogLabel(arguments)); } function sendRequest ({ host = SERVER_HOST, protocol = SERVER_PROTOCOL, method = 'GET', path, payload, callbacks, timeout }) { @@ -113,7 +113,7 @@ function setDefaultKCpmToBid(bid, winnerBid, priceGranularity) { } function addKCpmToBid(kCpm, bid, winnerBid, priceGranularity) { - if (utils.isNumber(kCpm)) { + if (isNumber(kCpm)) { bid.kCpm = kCpm; const priceStringsObj = getPriceBucketString( kCpm, @@ -134,7 +134,7 @@ function addKCpmToBid(kCpm, bid, winnerBid, priceGranularity) { } function addKonduitCacheKeyToBid(cacheKey, bid, winnerBid) { - if (utils.isStr(cacheKey)) { + if (isStr(cacheKey)) { bid.konduitCacheKey = cacheKey; if (config.getConfig(SEND_ALL_BIDS_CONFIG)) { @@ -163,7 +163,7 @@ export function processBids(options = {}) { options = options || {}; if (!konduitId) { - logError(errorMessages.NO_KONDUIT_ID); + _logError(errorMessages.NO_KONDUIT_ID); if (options.callback) { options.callback(new Error(errorMessages.NO_KONDUIT_ID), []); @@ -184,7 +184,7 @@ export function processBids(options = {}) { } if (!bids.length) { - logError(errorMessages.NO_BIDS); + _logError(errorMessages.NO_BIDS); if (options.callback) { options.callback(new Error(errorMessages.NO_BIDS), []); @@ -216,11 +216,11 @@ export function processBids(options = {}) { callbacks: { success: (data) => { let error = null; - logInfo('Bids processed successfully ', data); + _logInfo('Bids processed successfully ', data); try { const { kCpmData, cacheData } = JSON.parse(data); - if (utils.isEmpty(cacheData)) { + if (isEmpty(cacheData)) { throw new Error(errorMessages.CACHE_FAILURE); } @@ -234,7 +234,7 @@ export function processBids(options = {}) { }) } catch (err) { error = err; - logError('Error parsing JSON response for bidsProcessor data: ', err) + _logError('Error parsing JSON response for bidsProcessor data: ', err) } if (options.callback) { @@ -242,9 +242,9 @@ export function processBids(options = {}) { } }, error: (error) => { - logError('Bids were not processed successfully ', error); + _logError('Bids were not processed successfully ', error); if (options.callback) { - options.callback(utils.isStr(error) ? new Error(error) : error, bids); + options.callback(isStr(error) ? new Error(error) : error, bids); } } } From 5f45f957deddd4c12823597b45a828a7b783a6c6 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Tue, 28 Sep 2021 15:28:08 -0700 Subject: [PATCH 110/250] Fluct Bid Adapter: ie polyfill for url search params (#7478) * Fluct Bid Adapter: ie polyfill 4 url search params * more specific import * see if corejs is white listed * update to pure core js * update link * change format * add to whitelist * fix path to web * add features path * update path * drop web in path * fix path * try again * update to root * restore path * add comma --- allowedModules.js | 3 ++- modules/fluctBidAdapter.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/allowedModules.js b/allowedModules.js index 2d23b35c501..81920cdc15f 100644 --- a/allowedModules.js +++ b/allowedModules.js @@ -5,7 +5,8 @@ const sharedWhiteList = [ 'core-js-pure/features/set', // ie11 supports Set but not Set#values 'core-js-pure/features/string/includes', // no ie11 'core-js-pure/features/number/is-integer', // no ie11, - 'core-js-pure/features/array/from' // no ie11 + 'core-js-pure/features/array/from', // no ie11 + 'core-js-pure/web/url-search-params' // no ie11 ]; module.exports = { diff --git a/modules/fluctBidAdapter.js b/modules/fluctBidAdapter.js index 5d25043f1bf..57efaf2503f 100644 --- a/modules/fluctBidAdapter.js +++ b/modules/fluctBidAdapter.js @@ -1,5 +1,6 @@ import * as utils from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; +import URLSearchParams from 'core-js-pure/web/url-search-params' const BIDDER_CODE = 'fluct'; const END_POINT = 'https://hb.adingo.jp/prebid'; From d8282ecaa726a62b5a71b72b49394e7aa11409ae Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Tue, 28 Sep 2021 15:34:58 -0700 Subject: [PATCH 111/250] Multiple Bid/Analytics/ID/ other modules: import utils functions as needed and not the whole module (#7485) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * fix typo Co-authored-by: Chris Huie --- modules/growadvertisingBidAdapter.js | 15 +++--- modules/gumgumBidAdapter.js | 28 +++++------ modules/h12mediaBidAdapter.js | 24 +++++----- modules/haloIdSystem.js | 16 +++---- modules/hybridBidAdapter.js | 14 +++--- modules/iasRtdProvider.js | 14 +++--- modules/id5IdSystem.js | 48 +++++++++---------- modules/idImportLibrary.js | 70 +++++++++++++-------------- modules/idxIdSystem.js | 6 +-- modules/impactifyBidAdapter.js | 20 ++++---- modules/improvedigitalBidAdapter.js | 72 ++++++++++++++-------------- modules/imuIdSystem.js | 12 ++--- modules/inmarBidAdapter.js | 4 +- modules/innityBidAdapter.js | 6 +-- modules/inskinBidAdapter.js | 4 +- 15 files changed, 175 insertions(+), 178 deletions(-) diff --git a/modules/growadvertisingBidAdapter.js b/modules/growadvertisingBidAdapter.js index 0626b137a1b..286d27607c5 100644 --- a/modules/growadvertisingBidAdapter.js +++ b/modules/growadvertisingBidAdapter.js @@ -1,9 +1,8 @@ 'use strict'; -import * as utils from '../src/utils.js'; +import { getBidIdParameter, deepAccess, _each, triggerPixel } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; import {BANNER, NATIVE} from '../src/mediaTypes.js'; -import {triggerPixel} from '../src/utils.js'; const BIDDER_CODE = 'growads'; @@ -23,8 +22,8 @@ export const spec = { const zoneCounters = {}; return validBidRequests.map(bidRequest => { - zoneId = utils.getBidIdParameter('zoneId', bidRequest.params); - domain = utils.getBidIdParameter('domain', bidRequest.params); + zoneId = getBidIdParameter('zoneId', bidRequest.params); + domain = getBidIdParameter('domain', bidRequest.params); if (!(zoneId in zoneCounters)) { zoneCounters[zoneId] = 0; @@ -77,8 +76,8 @@ export const spec = { width = parseInt(response.width); height = parseInt(response.height); - minCPM = utils.getBidIdParameter('minCPM', request.params); - maxCPM = utils.getBidIdParameter('maxCPM', request.params); + minCPM = getBidIdParameter('minCPM', request.params); + maxCPM = getBidIdParameter('maxCPM', request.params); width = parseInt(response.width); height = parseInt(response.height); @@ -102,7 +101,7 @@ export const spec = { netRevenue: true, ttl: response.ttl, adUnitCode: request.adUnitCode, - referrer: utils.deepAccess(request, 'refererInfo.referer') + referrer: deepAccess(request, 'refererInfo.referer') }; if (response.hasOwnProperty(NATIVE)) { @@ -137,7 +136,7 @@ export const spec = { bid.ad = response.ad; bid.mediaType = BANNER; // Ensure that response ad matches one of the placement sizes. - utils._each(utils.deepAccess(request, 'mediaTypes.banner.sizes', []), function (size) { + _each(deepAccess(request, 'mediaTypes.banner.sizes', []), function (size) { if (width === size[0] && height === size[1]) { isCorrectSize = true; } diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 0580675eed8..756d204e00d 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -1,7 +1,5 @@ -import * as utils from '../src/utils.js' - +import { logError, logWarn, parseSizesInput, _each, deepAccess } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; - import { config } from '../src/config.js' import { getStorageManager } from '../src/storageManager.js'; import includes from 'core-js-pure/features/array/includes'; @@ -51,7 +49,7 @@ function _getBrowserParams(topWindowUrl) { topScreen = topWindow.screen; topUrl = topWindowUrl || ''; } catch (error) { - utils.logError(error); + logError(error); return browserParams } @@ -131,7 +129,7 @@ function isBidRequestValid(bid) { const id = legacyParamID || params.slot || params.native || params.zone || params.pubID; if (invalidRequestIds[id]) { - utils.logWarn(`[GumGum] Please check the implementation for ${id} for the placement ${adUnitCode}`); + logWarn(`[GumGum] Please check the implementation for ${id} for the placement ${adUnitCode}`); return false; } @@ -146,12 +144,12 @@ function isBidRequestValid(bid) { case !!(params.inVideo): break; case !!(params.videoPubID): break; default: - utils.logWarn(`[GumGum] No product selected for the placement ${adUnitCode}, please check your implementation.`); + logWarn(`[GumGum] No product selected for the placement ${adUnitCode}, please check your implementation.`); return false; } if (params.bidfloor && !(typeof params.bidfloor === 'number' && isFinite(params.bidfloor))) { - utils.logWarn('[GumGum] bidfloor must be a Number'); + logWarn('[GumGum] bidfloor must be a Number'); return false; } @@ -173,7 +171,7 @@ function _getVidParams(attributes) { protocols = [], playerSize = [] } = attributes; - const sizes = utils.parseSizesInput(playerSize); + const sizes = parseSizesInput(playerSize); const [viw, vih] = sizes[0] && sizes[0].split('x'); let pr = ''; @@ -279,7 +277,7 @@ function buildRequests(validBidRequests, bidderRequest) { const uspConsent = bidderRequest && bidderRequest.uspConsent; const timeout = config.getConfig('bidderTimeout'); const topWindowUrl = bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer; - utils._each(validBidRequests, bidRequest => { + _each(validBidRequests, bidRequest => { const { bidId, mediaTypes = {}, @@ -299,9 +297,9 @@ function buildRequests(validBidRequests, bidderRequest) { for (const eid in eids) data[eid] = eids[eid]; // ADJS-1024 & ADSS-1297 - if (utils.deepAccess(ortb2Imp, 'ext.data.pbadslot')) { - gpid = utils.deepAccess(ortb2Imp, 'ext.data.pbadslot') - } else if (utils.deepAccess(ortb2Imp, 'ext.data.adserver.name')) { + if (deepAccess(ortb2Imp, 'ext.data.pbadslot')) { + gpid = deepAccess(ortb2Imp, 'ext.data.pbadslot') + } else if (deepAccess(ortb2Imp, 'ext.data.adserver.name')) { gpid = ortb2Imp.ext.data.adserver.adslot } @@ -435,7 +433,7 @@ function interpretResponse(serverResponse, bidRequest) { setTimeout(() => { !!invalidRequestIds[id] && delete invalidRequestIds[id]; }, delayTime); - utils.logWarn(`[GumGum] Please check the implementation for ${id}`); + logWarn(`[GumGum] Please check the implementation for ${id}`); } const defaultResponse = { @@ -483,14 +481,14 @@ function interpretResponse(serverResponse, bidRequest) { advertiserDomains: advertiserDomains || [], mediaType: type || mediaType }; - let sizes = utils.parseSizesInput(bidRequest.sizes); + let sizes = parseSizesInput(bidRequest.sizes); if (maxw && maxh) { sizes = [`${maxw}x${maxh}`]; } else if (product === 5 && includes(sizes, '1x1')) { sizes = ['1x1']; } else if (product === 2 && includes(sizes, '1x1')) { - sizes = responseWidth && responseHeight ? [`${responseWidth}x${responseHeight}`] : utils.parseSizesInput(bidRequest.sizes) + sizes = responseWidth && responseHeight ? [`${responseWidth}x${responseHeight}`] : parseSizesInput(bidRequest.sizes) } let [width, height] = sizes[0].split('x'); diff --git a/modules/h12mediaBidAdapter.js b/modules/h12mediaBidAdapter.js index 7b736780226..9a6244a9e82 100644 --- a/modules/h12mediaBidAdapter.js +++ b/modules/h12mediaBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { inIframe, logError, logMessage, deepAccess } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'h12media'; const DEFAULT_URL = 'https://bidder.h12-media.com/prebid/'; @@ -15,7 +15,7 @@ export const spec = { }, buildRequests: function(validBidRequests, bidderRequest) { - const isiframe = utils.inIframe(); + const isiframe = inIframe(); const screenSize = getClientDimensions(); const docSize = getDocumentDimensions(); @@ -24,7 +24,7 @@ export const spec = { const requestUrl = bidderParams.endpointdom || DEFAULT_URL; let pubsubid = bidderParams.pubsubid || ''; if (pubsubid && pubsubid.length > 32) { - utils.logError('Bidder param \'pubsubid\' should be not more than 32 chars.'); + logError('Bidder param \'pubsubid\' should be not more than 32 chars.'); pubsubid = ''; } const pubcontainerid = bidderParams.pubcontainerid; @@ -57,7 +57,7 @@ export const spec = { try { windowTop = window.top; } catch (e) { - utils.logMessage(e); + logMessage(e); windowTop = window; } @@ -66,11 +66,11 @@ export const spec = { url: requestUrl, options: {withCredentials: true}, data: { - gdpr: !!utils.deepAccess(bidderRequest, 'gdprConsent.gdprApplies', false), - gdpr_cs: utils.deepAccess(bidderRequest, 'gdprConsent.consentString', ''), - usp: !!utils.deepAccess(bidderRequest, 'uspConsent', false), - usp_cs: utils.deepAccess(bidderRequest, 'uspConsent', ''), - topLevelUrl: utils.deepAccess(bidderRequest, 'refererInfo.referer', ''), + gdpr: !!deepAccess(bidderRequest, 'gdprConsent.gdprApplies', false), + gdpr_cs: deepAccess(bidderRequest, 'gdprConsent.consentString', ''), + usp: !!deepAccess(bidderRequest, 'uspConsent', false), + usp_cs: deepAccess(bidderRequest, 'uspConsent', ''), + topLevelUrl: deepAccess(bidderRequest, 'refererInfo.referer', ''), refererUrl: windowTop.document.referrer, isiframe, version: '$prebid.version$', @@ -122,14 +122,14 @@ export const spec = { } return bidResponses; } catch (err) { - utils.logError(err); + logError(err); } }, getUserSyncs: function(syncOptions, serverResponses, gdprConsent, usPrivacy) { const syncs = []; - const uspApplies = !!utils.deepAccess(usPrivacy, 'uspConsent', false); - const uspString = utils.deepAccess(usPrivacy, 'uspConsent', ''); + const uspApplies = !!deepAccess(usPrivacy, 'uspConsent', false); + const uspString = deepAccess(usPrivacy, 'uspConsent', ''); gdprConsent = gdprConsent || { gdprApplies: false, consentString: '', }; diff --git a/modules/haloIdSystem.js b/modules/haloIdSystem.js index 3011569a17d..e961f75d31b 100644 --- a/modules/haloIdSystem.js +++ b/modules/haloIdSystem.js @@ -8,7 +8,7 @@ import {ajax} from '../src/ajax.js'; import {getStorageManager} from '../src/storageManager.js'; import {submodule} from '../src/hook.js'; -import * as utils from '../src/utils.js'; +import { isFn, isStr, isPlainObject, logError } from '../src/utils.js'; const MODULE_NAME = 'haloId'; const AU_GVLID = 561; @@ -21,9 +21,9 @@ export const storage = getStorageManager(AU_GVLID, 'halo'); * @param {String} defaultVal */ function paramOrDefault(param, defaultVal, arg) { - if (utils.isFn(param)) { + if (isFn(param)) { return param(arg); - } else if (utils.isStr(param)) { + } else if (isStr(param)) { return param; } return defaultVal; @@ -44,7 +44,7 @@ export const haloIdSubmodule = { */ decode(value) { let haloId = storage.getDataFromLocalStorage('auHaloId'); - if (utils.isStr(haloId)) { + if (isStr(haloId)) { return {haloId: haloId}; } return (value && typeof value['haloId'] === 'string') ? { 'haloId': value['haloId'] } : undefined; @@ -56,7 +56,7 @@ export const haloIdSubmodule = { * @returns {IdResponse|undefined} */ getId(config) { - if (!utils.isPlainObject(config.params)) { + if (!isPlainObject(config.params)) { config.params = {}; } const url = paramOrDefault(config.params.url, @@ -65,7 +65,7 @@ export const haloIdSubmodule = { const resp = function (callback) { let haloId = storage.getDataFromLocalStorage('auHaloId'); - if (utils.isStr(haloId)) { + if (isStr(haloId)) { const responseObj = {haloId: haloId}; callback(responseObj); } else { @@ -76,13 +76,13 @@ export const haloIdSubmodule = { try { responseObj = JSON.parse(response); } catch (error) { - utils.logError(error); + logError(error); } } callback(responseObj); }, error: error => { - utils.logError(`${MODULE_NAME}: ID fetch encountered an error`, error); + logError(`${MODULE_NAME}: ID fetch encountered an error`, error); callback(); } }; diff --git a/modules/hybridBidAdapter.js b/modules/hybridBidAdapter.js index 15f8acd824f..4383e62c16e 100644 --- a/modules/hybridBidAdapter.js +++ b/modules/hybridBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js' +import { _map, logWarn, deepAccess, isArray } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js' import { auctionManager } from '../src/auctionManager.js' import { BANNER, VIDEO } from '../src/mediaTypes.js' @@ -21,7 +21,7 @@ const placementTypes = { }; function buildBidRequests(validBidRequests) { - return utils._map(validBidRequests, function(validBidRequest) { + return _map(validBidRequests, function(validBidRequest) { const params = validBidRequest.params; const bidRequest = { bidId: validBidRequest.bidId, @@ -63,7 +63,7 @@ const createRenderer = (bid) => { try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } return renderer; @@ -143,8 +143,8 @@ function hasVideoMandatoryParams(mediaTypes) { const isHasVideoContext = !!mediaTypes.video && (mediaTypes.video.context === 'instream' || mediaTypes.video.context === 'outstream'); const isPlayerSize = - !!utils.deepAccess(mediaTypes, 'video.playerSize') && - utils.isArray(utils.deepAccess(mediaTypes, 'video.playerSize')); + !!deepAccess(mediaTypes, 'video.playerSize') && + isArray(deepAccess(mediaTypes, 'video.playerSize')); return isHasVideoContext && isPlayerSize; } @@ -237,8 +237,8 @@ export const spec = { let bidRequests = JSON.parse(bidRequest.data).bidRequests; const serverBody = serverResponse.body; - if (serverBody && serverBody.bids && utils.isArray(serverBody.bids)) { - return utils._map(serverBody.bids, function(bid) { + if (serverBody && serverBody.bids && isArray(serverBody.bids)) { + return _map(serverBody.bids, function(bid) { let rawBid = find(bidRequests, function (item) { return item.bidId === bid.bidId; }); diff --git a/modules/iasRtdProvider.js b/modules/iasRtdProvider.js index a1ff57971ba..25ca39c23d6 100644 --- a/modules/iasRtdProvider.js +++ b/modules/iasRtdProvider.js @@ -1,6 +1,6 @@ +import { isArray, getAdUnitSizes, getKeys, logError } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getGlobal } from '../src/prebidGlobal.js'; -import * as utils from '../src/utils.js'; import { ajaxBuilder } from '../src/ajax.js'; /** @type {string} */ @@ -21,7 +21,7 @@ export function init(config, userConsent) { function stringifySlotSizes(sizes) { let result = ''; - if (utils.isArray(sizes)) { + if (isArray(sizes)) { result = sizes.reduce((acc, size) => { acc.push(size.join('.')); return acc; @@ -32,12 +32,12 @@ function stringifySlotSizes(sizes) { } function stringifySlot(bidRequest, adUnitPath) { - const sizes = utils.getAdUnitSizes(bidRequest); + const sizes = getAdUnitSizes(bidRequest); const id = bidRequest.code; const ss = stringifySlotSizes(sizes); const p = bidRequest.code; const slot = { id, ss, p }; - const keyValues = utils.getKeys(slot).map(function (key) { + const keyValues = getKeys(slot).map(function (key) { return [key, slot[key]].join(':'); }); return '{' + keyValues.join(',') + '}'; @@ -62,7 +62,7 @@ function getPageLevelKeywords(response) { } function shallowMerge(dest, src) { - utils.getKeys(src).reduce((dest, srcKey) => { + getKeys(src).reduce((dest, srcKey) => { dest[srcKey] = src[srcKey]; return dest; }, dest); @@ -114,7 +114,7 @@ function getBidRequestData(reqBidsConfigObj, callback, config) { callback(); }, error: function () { - utils.logError('failed to retrieve targeting information'); + logError('failed to retrieve targeting information'); callback(); } }); @@ -128,7 +128,7 @@ function getTargetingData(adUnits, config, userConsent) { targeting[adUnit] = bidResponses; }); } catch (err) { - utils.logError('error', err); + logError('error', err); } return targeting; } diff --git a/modules/id5IdSystem.js b/modules/id5IdSystem.js index d2d64f52738..43d26224164 100644 --- a/modules/id5IdSystem.js +++ b/modules/id5IdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { deepAccess, logInfo, deepSetValue, logError, isEmpty, isEmptyStr, logWarn } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { submodule } from '../src/hook.js'; import { getRefererInfo } from '../src/refererDetection.js'; @@ -67,25 +67,25 @@ export const id5IdSubmodule = { } }; - const abTestingResult = utils.deepAccess(value, 'ab_testing.result'); + const abTestingResult = deepAccess(value, 'ab_testing.result'); switch (abTestingResult) { case 'control': // A/B Testing is enabled and user is in the Control Group - utils.logInfo(LOG_PREFIX + 'A/B Testing - user is in the Control Group: ID5 ID is NOT exposed'); - utils.deepSetValue(responseObj, 'id5id.ext.abTestingControlGroup', true); + logInfo(LOG_PREFIX + 'A/B Testing - user is in the Control Group: ID5 ID is NOT exposed'); + deepSetValue(responseObj, 'id5id.ext.abTestingControlGroup', true); break; case 'error': // A/B Testing is enabled, but configured improperly, so skip A/B testing - utils.logError(LOG_PREFIX + 'A/B Testing ERROR! controlGroupPct must be a number >= 0 and <= 1'); + logError(LOG_PREFIX + 'A/B Testing ERROR! controlGroupPct must be a number >= 0 and <= 1'); break; case 'normal': // A/B Testing is enabled but user is not in the Control Group, so ID5 ID is shared - utils.logInfo(LOG_PREFIX + 'A/B Testing - user is NOT in the Control Group'); - utils.deepSetValue(responseObj, 'id5id.ext.abTestingControlGroup', false); + logInfo(LOG_PREFIX + 'A/B Testing - user is NOT in the Control Group'); + deepSetValue(responseObj, 'id5id.ext.abTestingControlGroup', false); break; } - utils.logInfo(LOG_PREFIX + 'Decoded ID', responseObj); + logInfo(LOG_PREFIX + 'Decoded ID', responseObj); return responseObj; }, @@ -120,19 +120,19 @@ export const id5IdSubmodule = { }; // pass in optional data, but only if populated - if (hasGdpr && typeof consentData.consentString !== 'undefined' && !utils.isEmpty(consentData.consentString) && !utils.isEmptyStr(consentData.consentString)) { + if (hasGdpr && typeof consentData.consentString !== 'undefined' && !isEmpty(consentData.consentString) && !isEmptyStr(consentData.consentString)) { data.gdpr_consent = consentData.consentString; } - if (typeof usp !== 'undefined' && !utils.isEmpty(usp) && !utils.isEmptyStr(usp)) { + if (typeof usp !== 'undefined' && !isEmpty(usp) && !isEmptyStr(usp)) { data.us_privacy = usp; } - if (typeof signature !== 'undefined' && !utils.isEmptyStr(signature)) { + if (typeof signature !== 'undefined' && !isEmptyStr(signature)) { data.s = signature; } - if (typeof config.params.pd !== 'undefined' && !utils.isEmptyStr(config.params.pd)) { + if (typeof config.params.pd !== 'undefined' && !isEmptyStr(config.params.pd)) { data.pd = config.params.pd; } - if (typeof config.params.provider !== 'undefined' && !utils.isEmptyStr(config.params.provider)) { + if (typeof config.params.provider !== 'undefined' && !isEmptyStr(config.params.provider)) { data.provider = config.params.provider; } @@ -151,7 +151,7 @@ export const id5IdSubmodule = { if (response) { try { responseObj = JSON.parse(response); - utils.logInfo(LOG_PREFIX + 'response received from the server', responseObj); + logInfo(LOG_PREFIX + 'response received from the server', responseObj); resetNb(config.params.partner); @@ -165,17 +165,17 @@ export const id5IdSubmodule = { removeLegacyCookies(config.params.partner); } } catch (error) { - utils.logError(LOG_PREFIX + error); + logError(LOG_PREFIX + error); } } callback(responseObj); }, error: error => { - utils.logError(LOG_PREFIX + 'getId fetch encountered an error', error); + logError(LOG_PREFIX + 'getId fetch encountered an error', error); callback(); } }; - utils.logInfo(LOG_PREFIX + 'requesting an ID from the server', data); + logInfo(LOG_PREFIX + 'requesting an ID from the server', data); ajax(url, callbacks, JSON.stringify(data), { method: 'POST', withCredentials: true }); }; return { callback: resp }; @@ -198,29 +198,29 @@ export const id5IdSubmodule = { const partnerId = (config && config.params && config.params.partner) || 0; incrementNb(partnerId); - utils.logInfo(LOG_PREFIX + 'using cached ID', cacheIdObj); + logInfo(LOG_PREFIX + 'using cached ID', cacheIdObj); return cacheIdObj; } }; function hasRequiredConfig(config) { if (!config || !config.params || !config.params.partner || typeof config.params.partner !== 'number') { - utils.logError(LOG_PREFIX + 'partner required to be defined as a number'); + logError(LOG_PREFIX + 'partner required to be defined as a number'); return false; } if (!config.storage || !config.storage.type || !config.storage.name) { - utils.logError(LOG_PREFIX + 'storage required to be set'); + logError(LOG_PREFIX + 'storage required to be set'); return false; } // in a future release, we may return false if storage type or name are not set as required if (config.storage.type !== LOCAL_STORAGE) { - utils.logWarn(LOG_PREFIX + `storage type recommended to be '${LOCAL_STORAGE}'. In a future release this may become a strict requirement`); + logWarn(LOG_PREFIX + `storage type recommended to be '${LOCAL_STORAGE}'. In a future release this may become a strict requirement`); } // in a future release, we may return false if storage type or name are not set as required if (config.storage.name !== ID5_STORAGE_NAME) { - utils.logWarn(LOG_PREFIX + `storage name recommended to be '${ID5_STORAGE_NAME}'. In a future release this may become a strict requirement`); + logWarn(LOG_PREFIX + `storage name recommended to be '${ID5_STORAGE_NAME}'. In a future release this may become a strict requirement`); } return true; @@ -265,7 +265,7 @@ function getLegacyCookieSignature() { * @param {integer} partnerId */ function removeLegacyCookies(partnerId) { - utils.logInfo(LOG_PREFIX + 'removing legacy cookies'); + logInfo(LOG_PREFIX + 'removing legacy cookies'); LEGACY_COOKIE_NAMES.forEach(function(cookie) { storage.setCookie(`${cookie}`, ' ', expDaysStr(-1)); storage.setCookie(`${cookie}_nb`, ' ', expDaysStr(-1)); @@ -313,7 +313,7 @@ export function storeInLocalStorage(key, value, expDays) { * @returns {Object} an object which always contains at least the property "enabled" */ function getAbTestingConfig(config) { - return utils.deepAccess(config, 'params.abTesting', { enabled: false }); + return deepAccess(config, 'params.abTesting', { enabled: false }); } submodule('userId', id5IdSubmodule); diff --git a/modules/idImportLibrary.js b/modules/idImportLibrary.js index 2a3a86cf270..e266f10cc4e 100644 --- a/modules/idImportLibrary.js +++ b/modules/idImportLibrary.js @@ -1,7 +1,7 @@ +import { logInfo, logError } from '../src/utils.js'; import {getGlobal} from '../src/prebidGlobal.js'; import {ajax} from '../src/ajax.js'; import {config} from '../src/config.js'; -import * as utils from '../src/utils.js'; import MD5 from 'crypto-js/md5.js'; let email; @@ -18,18 +18,18 @@ const OBSERVER_CONFIG = { characterData: true, characterDataOldValue: false }; -const logInfo = createLogInfo(LOG_PRE_FIX); -const logError = createLogError(LOG_PRE_FIX); +const _logInfo = createLogInfo(LOG_PRE_FIX); +const _logError = createLogError(LOG_PRE_FIX); function createLogInfo(prefix) { return function (...strings) { - utils.logInfo(prefix + ' ', ...strings); + logInfo(prefix + ' ', ...strings); } } function createLogError(prefix) { return function (...strings) { - utils.logError(prefix + ' ', ...strings); + logError(prefix + ' ', ...strings); } } @@ -38,39 +38,39 @@ function getEmail(value) { if (!matched) { return null; } - logInfo('Email found: ' + matched[0]); + _logInfo('Email found: ' + matched[0]); return matched[0]; } function bodyAction(mutations, observer) { - logInfo('BODY observer on debounce called'); + _logInfo('BODY observer on debounce called'); // If the email is found in the input element, disconnect the observer if (email) { observer.disconnect(); - logInfo('Email is found, body observer disconnected'); + _logInfo('Email is found, body observer disconnected'); return; } const body = document.body.innerHTML; email = getEmail(body); if (email !== null) { - logInfo(`Email obtained from the body ${email}`); + _logInfo(`Email obtained from the body ${email}`); observer.disconnect(); - logInfo('Post data on email found in body'); + _logInfo('Post data on email found in body'); postData(); } } function targetAction(mutations, observer) { - logInfo('Target observer called'); + _logInfo('Target observer called'); for (const mutation of mutations) { for (const node of mutation.addedNodes) { email = node.textContent; if (email) { - logInfo('Email obtained from the target ' + email); + _logInfo('Email obtained from the target ' + email); observer.disconnect(); - logInfo('Post data on email found in target'); + _logInfo('Post data on email found in target'); postData(); return; } @@ -79,18 +79,18 @@ function targetAction(mutations, observer) { } function addInputElementsElementListner(conf) { - logInfo('Adding input element listeners'); + _logInfo('Adding input element listeners'); const inputs = document.querySelectorAll('input[type=text], input[type=email]'); for (var i = 0; i < inputs.length; i++) { - logInfo(`Original Value in Input = ${inputs[i].value}`); + _logInfo(`Original Value in Input = ${inputs[i].value}`); inputs[i].addEventListener('change', event => processInputChange(event)); inputs[i].addEventListener('blur', event => processInputChange(event)); } } function removeInputElementsElementListner() { - logInfo('Removing input element listeners'); + _logInfo('Removing input element listeners'); const inputs = document.querySelectorAll('input[type=text], input[type=email]'); for (var i = 0; i < inputs.length; i++) { @@ -101,10 +101,10 @@ function removeInputElementsElementListner() { function processInputChange(event) { const value = event.target.value; - logInfo(`Modified Value of input ${event.target.value}`); + _logInfo(`Modified Value of input ${event.target.value}`); email = getEmail(value); if (email !== null) { - logInfo('Email found in input ' + email); + _logInfo('Email found in input ' + email); postData(); removeInputElementsElementListner(); } @@ -124,7 +124,7 @@ function debounce(func, wait, immediate) { if (callNow) { func.apply(context, args); } else { - logInfo('Debounce wait time ' + wait); + _logInfo('Debounce wait time ' + wait); timeout = setTimeout(later, wait); } }; @@ -138,11 +138,11 @@ function handleTargetElement() { email = targetElement.innerText; if (!email) { - logInfo('Finding the email with observer'); + _logInfo('Finding the email with observer'); targetObserver.observe(targetElement, OBSERVER_CONFIG); } else { - logInfo('Target found with target ' + email); - logInfo('Post data on email found in target with target'); + _logInfo('Target found with target ' + email); + _logInfo('Post data on email found in target with target'); postData(); } } @@ -150,15 +150,15 @@ function handleTargetElement() { function handleBodyElements() { if (doesInputElementsHaveEmail()) { - logInfo('Email found in input elements ' + email); - logInfo('Post data on email found in target without'); + _logInfo('Email found in input elements ' + email); + _logInfo('Post data on email found in target without'); postData(); return; } email = getEmail(document.body.innerHTML); if (email !== null) { - logInfo('Email found in body ' + email); - logInfo('Post data on email found in the body without observer'); + _logInfo('Email found in body ' + email); + _logInfo('Post data on email found in the body without observer'); postData(); return; } @@ -185,10 +185,10 @@ function doesInputElementsHaveEmail() { function syncCallback() { return { success: function () { - logInfo('Data synced successfully.'); + _logInfo('Data synced successfully.'); }, error: function () { - logInfo('Data sync failed.'); + _logInfo('Data sync failed.'); } } } @@ -197,15 +197,15 @@ function postData() { (getGlobal()).refreshUserIds(); const userIds = (getGlobal()).getUserIds(); if (Object.keys(userIds).length === 0) { - logInfo('No user ids'); + _logInfo('No user ids'); return; } - logInfo('Users' + userIds); + _logInfo('Users' + userIds); const syncPayload = {}; syncPayload.hid = MD5(email).toString(); syncPayload.uids = userIds; const payloadString = JSON.stringify(syncPayload); - logInfo(payloadString); + _logInfo(payloadString); ajax(conf.url, syncCallback(), payloadString, {method: 'POST', withCredentials: true}); } @@ -221,20 +221,20 @@ function associateIds() { export function setConfig(config) { if (!config) { - logError('Required confirguration not provided'); + _logError('Required confirguration not provided'); return; } if (!config.url) { - logError('The required url is not configured'); + _logError('The required url is not configured'); return; } if (typeof config.debounce !== 'number') { config.debounce = CONF_DEFAULT_OBSERVER_DEBOUNCE_MS; - logInfo('Set default observer debounce to ' + CONF_DEFAULT_OBSERVER_DEBOUNCE_MS); + _logInfo('Set default observer debounce to ' + CONF_DEFAULT_OBSERVER_DEBOUNCE_MS); } if (typeof config.fullscan !== 'boolean') { config.fullscan = CONF_DEFAULT_FULL_BODY_SCAN; - logInfo('Set default fullscan ' + CONF_DEFAULT_FULL_BODY_SCAN); + _logInfo('Set default fullscan ' + CONF_DEFAULT_FULL_BODY_SCAN); } conf = config; associateIds(); diff --git a/modules/idxIdSystem.js b/modules/idxIdSystem.js index 00e8a8bc5e5..908edad4c04 100644 --- a/modules/idxIdSystem.js +++ b/modules/idxIdSystem.js @@ -4,7 +4,7 @@ * @module modules/idxIdSystem * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { isStr, isPlainObject, logError } from '../src/utils.js'; import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -34,7 +34,7 @@ export const idxIdSubmodule = { * @return { Object | string | undefined } */ decode(value) { - const idxVal = value ? utils.isStr(value) ? value : utils.isPlainObject(value) ? value.id : undefined : undefined; + const idxVal = value ? isStr(value) ? value : isPlainObject(value) ? value.id : undefined : undefined; return idxVal ? { 'idx': idxVal } : undefined; @@ -52,7 +52,7 @@ export const idxIdSubmodule = { const idxObj = JSON.parse(idxString); return idxObj && idxObj.idx ? { id: idxObj.idx } : undefined; } catch (error) { - utils.logError(error); + logError(error); } } return undefined; diff --git a/modules/impactifyBidAdapter.js b/modules/impactifyBidAdapter.js index 5b0b1dff048..b204e81f22c 100644 --- a/modules/impactifyBidAdapter.js +++ b/modules/impactifyBidAdapter.js @@ -1,5 +1,5 @@ +import { deepAccess, deepSetValue, generateUUID } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import * as utils from '../src/utils.js'; import { config } from '../src/config.js'; import {ajax} from '../src/ajax.js'; import { createEidsArray } from './userId/eids.js'; @@ -43,14 +43,14 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => { } // Set Schain in request - let schain = utils.deepAccess(validBidRequests, '0.schain'); + let schain = deepAccess(validBidRequests, '0.schain'); if (schain) request.source.ext = { schain: schain }; // Set eids - let bidUserId = utils.deepAccess(validBidRequests, '0.userId'); + let bidUserId = deepAccess(validBidRequests, '0.userId'); let eids = createEidsArray(bidUserId); if (eids.length) { - utils.deepSetValue(request, 'user.ext.eids', eids); + deepSetValue(request, 'user.ext.eids', eids); } // Set device/user/site @@ -71,23 +71,23 @@ const createOpenRtbRequest = (validBidRequests, bidderRequest) => { let gdprApplies = 0; if (bidderRequest.gdprConsent) { if (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') gdprApplies = bidderRequest.gdprConsent.gdprApplies ? 1 : 0; - utils.deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString); + deepSetValue(request, 'user.ext.consent', bidderRequest.gdprConsent.consentString); } - utils.deepSetValue(request, 'regs.ext.gdpr', gdprApplies); + deepSetValue(request, 'regs.ext.gdpr', gdprApplies); if (bidderRequest.uspConsent) { - utils.deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); this.syncStore.uspConsent = bidderRequest.uspConsent; } - if (GETCONFIG('coppa') == true) utils.deepSetValue(request, 'regs.coppa', 1); + if (GETCONFIG('coppa') == true) deepSetValue(request, 'regs.coppa', 1); if (bidderRequest.uspConsent) { - utils.deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); + deepSetValue(request, 'regs.ext.us_privacy', bidderRequest.uspConsent); } // Set buyer uid - utils.deepSetValue(request, 'user.buyeruid', utils.generateUUID()); + deepSetValue(request, 'user.buyeruid', generateUUID()); // Create imps with bids validBidRequests.forEach((bid) => { diff --git a/modules/improvedigitalBidAdapter.js b/modules/improvedigitalBidAdapter.js index e73df68b625..688a8815e93 100644 --- a/modules/improvedigitalBidAdapter.js +++ b/modules/improvedigitalBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { deepSetValue, logError, _each, getBidRequest, isNumber, isArray, deepAccess, isFn, isPlainObject, logWarn, getBidIdParameter, getUniqueIdentifierStr, isEmpty, isInteger } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; @@ -62,7 +62,7 @@ export const spec = { if (bidRequests[0].userId) { const eids = createEidsArray(bidRequests[0].userId); if (eids.length) { - utils.deepSetValue(requestParameters, 'user.ext.eids', eids); + deepSetValue(requestParameters, 'user.ext.eids', eids); } } @@ -72,7 +72,7 @@ export const spec = { ); if (requestObj.errors && requestObj.errors.length > 0) { - utils.logError('ID WARNING 0x01'); + logError('ID WARNING 0x01'); } requestObj.requests.forEach(request => request.bidderRequest = bidderRequest); return requestObj.requests; @@ -86,13 +86,13 @@ export const spec = { */ interpretResponse: function (serverResponse, {bidderRequest}) { const bids = []; - utils._each(serverResponse.body.bid, function (bidObject) { + _each(serverResponse.body.bid, function (bidObject) { if (!bidObject.price || bidObject.price === null || bidObject.hasOwnProperty('errorCode') || (!bidObject.adm && !bidObject.native)) { return; } - const bidRequest = utils.getBidRequest(bidObject.id, [bidderRequest]); + const bidRequest = getBidRequest(bidObject.id, [bidderRequest]); const bid = {}; if (bidObject.native) { @@ -132,7 +132,7 @@ export const spec = { // Deal ID. Composite ads can have multiple line items and the ID of the first // dealID line item will be used. - if (utils.isNumber(bidObject.lid) && bidObject.buying_type && bidObject.buying_type !== 'rtb') { + if (isNumber(bidObject.lid) && bidObject.buying_type && bidObject.buying_type !== 'rtb') { bid.dealId = bidObject.lid; } else if (Array.isArray(bidObject.lid) && Array.isArray(bidObject.buying_type) && @@ -181,7 +181,7 @@ export const spec = { const syncs = []; serverResponses.forEach(response => { response.body.bid.forEach(bidObject => { - if (utils.isArray(bidObject.sync)) { + if (isArray(bidObject.sync)) { bidObject.sync.forEach(syncElement => { if (syncs.indexOf(syncElement) === -1) { syncs.push(syncElement); @@ -197,15 +197,15 @@ export const spec = { }; function isInstreamVideo(bid) { - const mediaTypes = Object.keys(utils.deepAccess(bid, 'mediaTypes', {})); - const videoMediaType = utils.deepAccess(bid, 'mediaTypes.video'); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const mediaTypes = Object.keys(deepAccess(bid, 'mediaTypes', {})); + const videoMediaType = deepAccess(bid, 'mediaTypes.video'); + const context = deepAccess(bid, 'mediaTypes.video.context'); return bid.mediaType === 'video' || (mediaTypes.length === 1 && videoMediaType && context !== 'outstream'); } function isOutstreamVideo(bid) { - const videoMediaType = utils.deepAccess(bid, 'mediaTypes.video'); - const context = utils.deepAccess(bid, 'mediaTypes.video.context'); + const videoMediaType = deepAccess(bid, 'mediaTypes.video'); + const context = deepAccess(bid, 'mediaTypes.video.context'); return videoMediaType && context === 'outstream'; } @@ -225,7 +225,7 @@ function getVideoTargetingParams(bid) { } function getBidFloor(bid) { - if (!utils.isFn(bid.getFloor)) { + if (!isFn(bid.getFloor)) { return null; } const floor = bid.getFloor({ @@ -233,7 +233,7 @@ function getBidFloor(bid) { mediaType: '*', size: '*' }); - if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') { return floor.floor; } return null; @@ -259,31 +259,31 @@ function createRenderer(bidRequest) { id: bidRequest.adUnitCode, url: RENDERER_URL, loaded: false, - config: utils.deepAccess(bidRequest, 'renderer.options'), + config: deepAccess(bidRequest, 'renderer.options'), adUnitCode: bidRequest.adUnitCode }); try { renderer.setRender(outstreamRender); } catch (err) { - utils.logWarn('Prebid Error calling setRender on renderer', err); + logWarn('Prebid Error calling setRender on renderer', err); } return renderer; } function getNormalizedBidRequest(bid) { - let adUnitId = utils.getBidIdParameter('adUnitCode', bid) || null; - let placementId = utils.getBidIdParameter('placementId', bid.params) || null; + let adUnitId = getBidIdParameter('adUnitCode', bid) || null; + let placementId = getBidIdParameter('placementId', bid.params) || null; let publisherId = null; let placementKey = null; if (placementId === null) { - publisherId = utils.getBidIdParameter('publisherId', bid.params) || null; - placementKey = utils.getBidIdParameter('placementKey', bid.params) || null; + publisherId = getBidIdParameter('publisherId', bid.params) || null; + placementKey = getBidIdParameter('placementKey', bid.params) || null; } - const keyValues = utils.getBidIdParameter('keyValues', bid.params) || null; - const singleSizeFilter = utils.getBidIdParameter('size', bid.params) || null; - const bidId = utils.getBidIdParameter('bidId', bid); - const transactionId = utils.getBidIdParameter('transactionId', bid); + const keyValues = getBidIdParameter('keyValues', bid.params) || null; + const singleSizeFilter = getBidIdParameter('size', bid.params) || null; + const bidId = getBidIdParameter('bidId', bid); + const transactionId = getBidIdParameter('transactionId', bid); const currency = config.getConfig('currency.adServerCurrency'); let normalizedBidRequest = {}; @@ -332,8 +332,8 @@ function getNormalizedBidRequest(bid) { let bidFloor = getBidFloor(bid); let bidFloorCur = null; if (!bidFloor) { - bidFloor = utils.getBidIdParameter('bidFloor', bid.params); - bidFloorCur = utils.getBidIdParameter('bidFloorCur', bid.params); + bidFloor = getBidIdParameter('bidFloor', bid.params); + bidFloorCur = getBidIdParameter('bidFloorCur', bid.params); } if (bidFloor) { normalizedBidRequest.bidFloor = bidFloor; @@ -344,7 +344,7 @@ function getNormalizedBidRequest(bid) { function getNormalizedNativeAd(rawNative) { const native = {}; - if (!rawNative || !utils.isArray(rawNative.assets)) { + if (!rawNative || !isArray(rawNative.assets)) { return null; } // Assets @@ -475,7 +475,7 @@ export function ImproveDigitalAdServerJSClient(endPoint) { let impressionObjects = []; let impressionObject; - if (utils.isArray(requestObject)) { + if (isArray(requestObject)) { for (let counter = 0; counter < requestObject.length; counter++) { impressionObject = this.createImpressionObject(requestObject[counter]); impressionObjects.push(impressionObject); @@ -576,7 +576,7 @@ export function ImproveDigitalAdServerJSClient(endPoint) { if (requestParameters.requestId) { impressionBidRequestObject.id = requestParameters.requestId; } else { - impressionBidRequestObject.id = utils.getUniqueIdentifierStr(); + impressionBidRequestObject.id = getUniqueIdentifierStr(); } if (requestParameters.domain) { impressionBidRequestObject.domain = requestParameters.domain; @@ -625,7 +625,7 @@ export function ImproveDigitalAdServerJSClient(endPoint) { if (placementObject.id) { impressionObject.id = placementObject.id; } else { - impressionObject.id = utils.getUniqueIdentifierStr(); + impressionObject.id = getUniqueIdentifierStr(); } if (placementObject.adTypes) { impressionObject.ad_types = placementObject.adTypes; @@ -654,18 +654,18 @@ export function ImproveDigitalAdServerJSClient(endPoint) { if (placementObject.transactionId) { impressionObject.tid = placementObject.transactionId; } - if (!utils.isEmpty(placementObject.video)) { + if (!isEmpty(placementObject.video)) { const video = Object.assign({}, placementObject.video); // skip must be 0 or 1 if (video.skip !== 1) { delete video.skipmin; delete video.skipafter; if (video.skip !== 0) { - utils.logWarn(`video.skip: invalid value '${video.skip}'. Expected 0 or 1`); + logWarn(`video.skip: invalid value '${video.skip}'. Expected 0 or 1`); delete video.skip; } } - if (!utils.isEmpty(video)) { + if (!isEmpty(video)) { impressionObject.video = video; } } @@ -687,11 +687,11 @@ export function ImproveDigitalAdServerJSClient(endPoint) { // Set of desired creative sizes // Input Format: array of pairs, i.e. [[300, 250], [250, 250]] - if (placementObject.format && utils.isArray(placementObject.format)) { + if (placementObject.format && isArray(placementObject.format)) { const format = placementObject.format .filter(sizePair => sizePair.length === 2 && - utils.isInteger(sizePair[0]) && - utils.isInteger(sizePair[1]) && + isInteger(sizePair[0]) && + isInteger(sizePair[1]) && sizePair[0] >= 0 && sizePair[1] >= 0) .map(sizePair => { diff --git a/modules/imuIdSystem.js b/modules/imuIdSystem.js index da03c63fc8a..72e81d243a3 100644 --- a/modules/imuIdSystem.js +++ b/modules/imuIdSystem.js @@ -5,7 +5,7 @@ * @requires module:modules/userId */ -import * as utils from '../src/utils.js' +import { timestamp, logError } from '../src/utils.js'; import { ajax } from '../src/ajax.js' import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; @@ -20,7 +20,7 @@ const cookiesMaxAge = 97200000000; // 37 months ((365 * 3 + 30) * 24 * 60 * 60 * export function setImDataInLocalStorage(value) { storage.setDataInLocalStorage(storageKey, value); - storage.setDataInLocalStorage(`${storageKey}_mt`, new Date(utils.timestamp()).toUTCString()); + storage.setDataInLocalStorage(`${storageKey}_mt`, new Date(timestamp()).toUTCString()); } export function removeImDataFromLocalStorage() { @@ -32,7 +32,7 @@ function setImDataInCookie(value) { storage.setCookie( cookieKey, value, - new Date(utils.timestamp() + cookiesMaxAge).toUTCString(), + new Date(timestamp() + cookiesMaxAge).toUTCString(), 'none' ); } @@ -73,7 +73,7 @@ export function getApiCallback(callback) { responseObj = JSON.parse(response); apiSuccessProcess(responseObj); } catch (error) { - utils.logError('User ID - imuid submodule: ' + error); + logError('User ID - imuid submodule: ' + error); } } if (callback && responseObj.uid) { @@ -81,7 +81,7 @@ export function getApiCallback(callback) { } }, error: error => { - utils.logError('User ID - imuid submodule was unable to get data from api: ' + error); + logError('User ID - imuid submodule was unable to get data from api: ' + error); if (callback) { callback(); } @@ -128,7 +128,7 @@ export const imuIdSubmodule = { getId(config) { const configParams = (config && config.params) || {}; if (!configParams || typeof configParams.cid !== 'number') { - utils.logError('User ID - imuid submodule requires a valid cid to be defined'); + logError('User ID - imuid submodule requires a valid cid to be defined'); return undefined; } let apiUrl = getApiUrl(configParams.cid, configParams.url); diff --git a/modules/inmarBidAdapter.js b/modules/inmarBidAdapter.js index e1edd935587..0e056551b35 100755 --- a/modules/inmarBidAdapter.js +++ b/modules/inmarBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { logError } from '../src/utils.js'; import { config } from '../src/config.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; @@ -83,7 +83,7 @@ export const spec = { bidResponses.push(bidResponse); } } catch (error) { - utils.logError('Error while parsing inmar response', error); + logError('Error while parsing inmar response', error); } return bidResponses; }, diff --git a/modules/innityBidAdapter.js b/modules/innityBidAdapter.js index ab7ee07db4a..0a2f701ef64 100644 --- a/modules/innityBidAdapter.js +++ b/modules/innityBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { parseSizesInput, timestamp } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'innity'; @@ -11,13 +11,13 @@ export const spec = { }, buildRequests: function(validBidRequests, bidderRequest) { return validBidRequests.map(bidRequest => { - let parseSized = utils.parseSizesInput(bidRequest.sizes); + let parseSized = parseSizesInput(bidRequest.sizes); let arrSize = parseSized[0].split('x'); return { method: 'GET', url: ENDPOINT, data: { - cb: utils.timestamp(), + cb: timestamp(), ver: 2, hb: 1, output: 'js', diff --git a/modules/inskinBidAdapter.js b/modules/inskinBidAdapter.js index 8f2e35a41e0..b6d23bb7207 100644 --- a/modules/inskinBidAdapter.js +++ b/modules/inskinBidAdapter.js @@ -1,4 +1,4 @@ -import * as utils from '../src/utils.js'; +import { createTrackPixelHtml } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'inskin'; @@ -289,7 +289,7 @@ function getSize(sizes) { } function retrieveAd(bidId, decision) { - return ""'; +describe('slimcutBidAdapter', 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() { + let bid = { + 'bidder': 'slimcut', + 'params': { + 'placementId': 83 + }, + 'adUnitCode': 'adunit-code', + 'sizes': [ + [300, 250], + [300, 600] + ], + 'bidId': '3c871ffa8ef14c', + 'bidderRequestId': 'b41642f1aee381', + 'auctionId': '4e156668c977d7' + }; + it('should return true when required params found', function() { + expect(spec.isBidRequestValid(bid)).to.equal(true); + }); + it('should return false when placementId is not valid (letters)', function() { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = { + 'placementId': 'ABCD' + }; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + it('should return false when placementId < 0', function() { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = { + 'placementId': -1 + }; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + it('should return false when required params are not passed', function() { + let bid = Object.assign({}, bid); + delete bid.params; + bid.params = {}; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + }); + describe('buildRequests', function() { + let bidRequests = [{ + 'bidder': 'teads', + 'params': { + 'placementId': 10433394 + }, + 'adUnitCode': 'adunit-code', + 'sizes': [ + [300, 250], + [300, 600] + ], + 'bidId': '3c871ffa8ef14c', + 'bidderRequestId': 'b41642f1aee381', + 'auctionId': '4e156668c977d7', + 'deviceWidth': 1680 + }]; + let bidderResquestDefault = { + 'auctionId': '4e156668c977d7', + 'bidderRequestId': 'b41642f1aee381', + 'timeout': 3000 + }; + it('sends bid request to ENDPOINT via POST', function() { + const request = spec.buildRequests(bidRequests, bidderResquestDefault); + expect(request.url).to.equal(ENDPOINT); + expect(request.method).to.equal('POST'); + }); + it('should send GDPR to endpoint', function() { + let consentString = 'JRJ8RKfDeBNsERRDCSAAZ+A=='; + let bidderRequest = { + 'auctionId': '4e156668c977d7', + 'bidderRequestId': 'b41642f1aee381', + 'timeout': 3000, + 'gdprConsent': { + 'consentString': consentString, + 'gdprApplies': true, + 'vendorData': { + 'hasGlobalConsent': false + } + } + }; + const request = spec.buildRequests(bidRequests, bidderRequest); + const payload = JSON.parse(request.data); + expect(payload.gdpr_iab).to.exist; + expect(payload.gdpr_iab.consent).to.equal(consentString); + }); + it('should add referer info to payload', function() { + const bidRequest = Object.assign({}, bidRequests[0]) + const bidderRequest = { + refererInfo: { + referer: 'https://example.com/page.html', + reachedTop: true, + numIframes: 2 + } + } + const request = spec.buildRequests([bidRequest], bidderRequest); + const payload = JSON.parse(request.data); + expect(payload.referrer).to.exist; + expect(payload.referrer).to.deep.equal('https://example.com/page.html') + }); + }); + describe('getUserSyncs', () => { + let bids = { + 'body': { + 'responses': [{ + 'ad': AD_SCRIPT, + 'cpm': 0.5, + 'currency': 'USD', + 'height': 250, + 'netRevenue': true, + 'requestId': '3ede2a3fa0db94', + 'ttl': 360, + 'width': 300, + 'creativeId': 'er2ee', + 'transactionId': 'deadb33f', + 'winUrl': 'https://sb.freeskreen.com/win' + }] + } + }; + it('should get the correct number of sync urls', () => { + let urls = spec.getUserSyncs({ + iframeEnabled: true + }, bids); + expect(urls.length).to.equal(1); + expect(urls[0].url).to.equal('https://sb.freeskreen.com/async_usersync.html'); + }); + it('should return no url if not iframe enabled', () => { + let urls = spec.getUserSyncs({ + iframeEnabled: false + }, bids); + expect(urls.length).to.equal(0); + }); + }); + describe('interpretResponse', function() { + let bids = { + 'body': { + 'responses': [{ + 'ad': AD_SCRIPT, + 'cpm': 0.5, + 'currency': 'USD', + 'height': 250, + 'netRevenue': true, + 'requestId': '3ede2a3fa0db94', + 'ttl': 360, + 'width': 300, + 'creativeId': 'er2ee', + 'transactionId': 'deadb33f', + 'winUrl': 'https://sb.freeskreen.com/win' + }] + } + }; + it('should get correct bid response', function() { + let expectedResponse = [{ + 'cpm': 0.5, + 'width': 300, + 'height': 250, + 'currency': 'USD', + 'netRevenue': true, + 'ttl': 360, + 'ad': AD_SCRIPT, + 'requestId': '3ede2a3fa0db94', + 'creativeId': 'er2ee', + 'transactionId': 'deadb33f', + 'winUrl': 'https://sb.freeskreen.com/win', + 'meta': { + 'advertiserDomains': [] + } + }]; + let result = spec.interpretResponse(bids); + expect(Object.keys(result[0])).to.deep.equal(Object.keys(expectedResponse[0])); + }); + it('handles nobid responses', function() { + let bids = { + 'body': { + 'responses': [] + } + }; + let result = spec.interpretResponse(bids); + expect(result.length).to.equal(0); + }); + }); +}); From a696789dccf454aa0f26dd139b98acd13b0e7d62 Mon Sep 17 00:00:00 2001 From: jsfledd Date: Thu, 30 Sep 2021 05:32:10 -0700 Subject: [PATCH 129/250] Nativo Bid Adapter: update to adUnit param usage (#7517) * Initial nativoBidAdapter document creation (js, md and spec) * Fulling working prebid using nativoBidAdapter. Support for GDPR and CCPA in user syncs. * Added defult size settings based on the largest ad unit. Added response body validation. Added consent to request url qs params. * Changed bidder endpoint url * Changed double quotes to single quotes. * Reverted package-json.lock to remove modifications from PR * Added optional bidder param 'url' so the ad server can force- match an existing placement * Lint fix. Added space after if. * Added new QS param to send various adUnit data to adapter endpopint * Updated unit test for new QS param * Added qs param to keep track of ad unit refreshes * Updated bidMap key default value --- modules/nativoBidAdapter.js | 73 +++++++++++++--------- modules/nativoBidAdapter.md | 1 - test/spec/modules/nativoBidAdapter_spec.js | 53 +++++++++++++++- 3 files changed, 94 insertions(+), 33 deletions(-) diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index f91a8b6085b..8259c179675 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -1,19 +1,19 @@ -import { isEmpty } from '../src/utils.js'; -import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { BANNER } from '../src/mediaTypes.js'; +import { deepAccess, isEmpty } from '../src/utils.js' +import { registerBidder } from '../src/adapters/bidderFactory.js' +import { BANNER } from '../src/mediaTypes.js' // import { config } from 'src/config' -const BIDDER_CODE = 'nativo'; -const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid'; +const BIDDER_CODE = 'nativo' +const BIDDER_ENDPOINT = 'https://exchange.postrelease.com/prebid' -const GVLID = 263; +const GVLID = 263 -const TIME_TO_LIVE = 360; +const TIME_TO_LIVE = 360 -const SUPPORTED_AD_TYPES = [BANNER]; +const SUPPORTED_AD_TYPES = [BANNER] -const bidRequestMap = {}; -const adUnitsRequested = {}; +const bidRequestMap = {} +const adUnitsRequested = {} // Prebid adapter referrence doc: https://docs.prebid.org/dev-docs/bidder-adaptor.html @@ -30,7 +30,7 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: function (bid) { - return bid.params && !!bid.params.placementId + return true }, /** @@ -42,27 +42,37 @@ export const spec = { * @return ServerRequest Info describing the request to the server. */ buildRequests: function (validBidRequests, bidderRequest) { - const placementIds = [] + const placementIds = new Set() const placmentBidIdMap = {} let placementId, pageUrl validBidRequests.forEach((request) => { - pageUrl = pageUrl || request.params.url // Use the first url value found - placementId = request.params.placementId - placementIds.push(placementId) - placmentBidIdMap[placementId] = { + pageUrl = deepAccess( + request, + 'params.url', + bidderRequest.refererInfo.referer + ) + placementId = deepAccess(request, 'params.placementId') + + if (placementId) { + placementIds.add(placementId) + } + + var key = placementId || request.adUnitCode + placmentBidIdMap[key] = { bidId: request.bidId, size: getLargestSize(request.sizes), } }) bidRequestMap[bidderRequest.bidderRequestId] = placmentBidIdMap - if (!pageUrl) pageUrl = bidderRequest.refererInfo.referer - // Build adUnit data const adUnitData = { adUnits: validBidRequests.map((adUnit) => { // Track if we've already requested for this ad unit code - adUnitsRequested[adUnit.adUnitCode] = adUnitsRequested[adUnit.adUnitCode] !== undefined ? adUnitsRequested[adUnit.adUnitCode]++ : 0 + adUnitsRequested[adUnit.adUnitCode] = + adUnitsRequested[adUnit.adUnitCode] !== undefined + ? adUnitsRequested[adUnit.adUnitCode]++ + : 0 return { adUnitCode: adUnit.adUnitCode, mediaTypes: adUnit.mediaTypes, @@ -72,7 +82,6 @@ export const spec = { // Build QS Params let params = [ - { key: 'ntv_ptd', value: placementIds.toString() }, { key: 'ntv_pb_rid', value: bidderRequest.bidderRequestId }, { key: 'ntv_ppc', @@ -80,14 +89,18 @@ export const spec = { }, { key: 'ntv_dbr', - value: btoa(JSON.stringify(adUnitsRequested)) + value: btoa(JSON.stringify(adUnitsRequested)), }, { key: 'ntv_url', value: encodeURIComponent(pageUrl), - } + }, ] + if (placementIds.size > 0) { + params.unshift({ key: 'ntv_ptd', value: [...placementIds].join(',') }) + } + if (bidderRequest.gdprConsent) { // Put on the beginning of the qs param array params.unshift({ @@ -135,7 +148,7 @@ export const spec = { let bidResponse, adUnit seatbids.forEach((seatbid) => { seatbid.bid.forEach((bid) => { - adUnit = this.getRequestId(body.id, bid.impid) + adUnit = this.getAdUnitData(body.id, bid) bidResponse = { requestId: adUnit.bidId, cpm: bid.price, @@ -268,14 +281,16 @@ export const spec = { /** * Maps Prebid's bidId to Nativo's placementId values per unique bidderRequestId * @param {String} bidderRequestId - The unique ID value associated with the bidderRequest - * @param {String} placementId - The placement ID value from Nativo + * @param {Object} bid - The placement ID value from Nativo * @returns {String} - The bidId value associated with the corresponding placementId */ - getRequestId: function (bidderRequestId, placementId) { - return ( - bidRequestMap[bidderRequestId] && - bidRequestMap[bidderRequestId][placementId] - ) + getAdUnitData: function (bidderRequestId, bid) { + var data = deepAccess(bidRequestMap, `${bidderRequestId}.${bid.impid}`) + + if (data) return data + + var unitCode = deepAccess(bid, 'ext.ad_unit_id') + return deepAccess(bidRequestMap, `${bidderRequestId}.${unitCode}`) }, } registerBidder(spec) diff --git a/modules/nativoBidAdapter.md b/modules/nativoBidAdapter.md index ec0980aae50..f83fb45b52e 100644 --- a/modules/nativoBidAdapter.md +++ b/modules/nativoBidAdapter.md @@ -29,7 +29,6 @@ var adUnits = [ bids: [{ bidder: 'nativo', params: { - placementId: 1125609, url: 'https://test-sites.internal.nativo.net/testing/prebid_adpater.html' } }] diff --git a/test/spec/modules/nativoBidAdapter_spec.js b/test/spec/modules/nativoBidAdapter_spec.js index 4202b7c6f91..dfc9f5b99b3 100644 --- a/test/spec/modules/nativoBidAdapter_spec.js +++ b/test/spec/modules/nativoBidAdapter_spec.js @@ -26,11 +26,11 @@ describe('nativoBidAdapterTests', function () { expect(spec.isBidRequestValid(bid)).to.equal(true) }) - it('should return false when required params are not passed', function () { + it('should return true when params are not passed', function () { let bid2 = Object.assign({}, bid) delete bid2.params bid2.params = {} - expect(spec.isBidRequestValid(bid2)).to.equal(false) + expect(spec.isBidRequestValid(bid2)).to.equal(true) }) }) @@ -129,7 +129,12 @@ describe('interpretResponse', function () { } // mock - spec.getRequestId = () => 123456 + spec.getAdUnitData = () => { + return { + bidId: 123456, + sizes: [300, 250], + } + } let result = spec.interpretResponse({ body: response }, { bidderRequest }) expect(Object.keys(result[0])).to.have.deep.members( @@ -232,3 +237,45 @@ describe('getUserSyncs', function () { ) }) }) + +describe('getAdUnitData', () => { + afterEach(() => { + if (window.bidRequestMap) delete window.bidRequestMap + }) + + it('Matches placementId value', () => { + const adUnitData = { + bidId: 123456, + sizes: [300, 250], + } + + window.bidRequestMap = { + 9876543: { + 12345: adUnitData, + }, + } + + const data = spec.getAdUnitData(9876543, { impid: 12345 }) + expect(Object.keys(data)).to.have.deep.members( + Object.keys(adUnitData) + ) + }) + + it('Falls back to ad unit code value', () => { + const adUnitData = { + bidId: 123456, + sizes: [300, 250], + } + + window.bidRequestMap = { + 9876543: { + '#test-code': adUnitData, + }, + } + + const data = spec.getAdUnitData(9876543, { impid: 12345, ext: { ad_unit_code: '#test-code' } }) + expect(Object.keys(data)).to.have.deep.members( + Object.keys(adUnitData) + ) + }) +}) From 6d4daa437c2002a483aaf4003848f64916d35150 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 30 Sep 2021 06:14:59 -0700 Subject: [PATCH 130/250] PubLink id system adds params for site id and api key (#7515) --- modules/publinkIdSystem.js | 7 ++++- modules/publinkIdSystem.md | 9 ++++-- test/spec/modules/publinkIdSystem_spec.js | 37 +++++++++++++++++------ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/modules/publinkIdSystem.js b/modules/publinkIdSystem.js index 9acc741f7da..299158a175e 100644 --- a/modules/publinkIdSystem.js +++ b/modules/publinkIdSystem.js @@ -19,7 +19,7 @@ const PUBLINK_S2S_COOKIE = '_publink_srv'; export const storage = getStorageManager(GVLID); function isHex(s) { - return (typeof s === 'string' && /^[A-F0-9]+$/i.test(s)); + return /^[A-F0-9]+$/i.test(s); } function publinkIdUrl(params, consentData) { @@ -29,11 +29,16 @@ function publinkIdUrl(params, consentData) { mpn: 'Prebid.js', mpv: '$prebid.version$', }; + if (consentData) { url.search.gdpr = (consentData.gdprApplies) ? 1 : 0; url.search.gdpr_consent = consentData.consentString; } + if (params.site_id) { url.search.sid = params.site_id; } + + if (params.api_key) { url.search.apikey = params.api_key; } + const usPrivacyString = uspDataHandler.getConsentData(); if (usPrivacyString && typeof usPrivacyString === 'string') { url.search.us_privacy = usPrivacyString; diff --git a/modules/publinkIdSystem.md b/modules/publinkIdSystem.md index 669828322a5..263ce490529 100644 --- a/modules/publinkIdSystem.md +++ b/modules/publinkIdSystem.md @@ -7,7 +7,10 @@ Publink user id module | Param Name | Required | Type | Description | Example | | --- | --- | --- | --- | --- | | name | Yes | String | module identifier | `"publinkId"` | -| params.e | Yes | String | hashed email address | `"e80b5017098950fc58aad83c8c14978e"` | +| params.e | Yes | String | hashed email address | `"7D320454942620664D96EF78ED4E3A2A"` | +| params.api_key | Yes | String | api key for access | `"7ab62359-bdc0-4095-b573-ef474fb55d24"` | +| params.site_id | Yes | String | site identifier | `"123456"` | + ### Example configuration for Publink ``` @@ -20,7 +23,9 @@ pbjs.setConfig({ type: "html5" }, params: { - e: "e80b5017098950fc58aad83c8c14978e", // example hashed email (md5) + e: "7D320454942620664D96EF78ED4E3A2A", // example hashed email (md5) + site_id: "123456", // provided by Epsilon + api_key: "7ab62359-bdc0-4095-b573-ef474fb55d2" // provided by Epsilon } }], } diff --git a/test/spec/modules/publinkIdSystem_spec.js b/test/spec/modules/publinkIdSystem_spec.js index 0680e02e3fa..aa6b669d773 100644 --- a/test/spec/modules/publinkIdSystem_spec.js +++ b/test/spec/modules/publinkIdSystem_spec.js @@ -3,6 +3,7 @@ import {getStorageManager} from '../../../src/storageManager'; import {server} from 'test/mocks/xhr.js'; import sinon from 'sinon'; import {uspDataHandler} from '../../../src/adapterManager'; +import {parseUrl} from '../../../src/utils'; export const storage = getStorageManager(24); const TEST_COOKIE_VALUE = 'cookievalue'; @@ -83,14 +84,22 @@ describe('PublinkIdSystem', () => { }); it('Fetch with consent data', () => { - const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7'}}; + const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7', site_id: '102030'}}; const consentData = {gdprApplies: 1, consentString: 'myconsentstring'}; let submoduleCallback = publinkIdSubmodule.getId(config, consentData).callback; submoduleCallback(callbackSpy); - let request = server.requests[0]; - request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$&gdpr=1&gdpr_consent=myconsentstring'); + const request = server.requests[0]; + const parsed = parseUrl(request.url); + + expect(parsed.hostname).to.equal('proc.ad.cpe.dotomi.com'); + expect(parsed.pathname).to.equal('/cvx/client/sync/publink'); + expect(parsed.search.mpn).to.equal('Prebid.js'); + expect(parsed.search.mpv).to.equal('$prebid.version$'); + expect(parsed.search.gdpr).to.equal('1'); + expect(parsed.search.gdpr_consent).to.equal('myconsentstring'); + expect(parsed.search.sid).to.equal('102030'); + expect(parsed.search.apikey).to.be.undefined; request.respond(200, {}, JSON.stringify(serverResponse)); expect(callbackSpy.calledOnce).to.be.true; @@ -103,8 +112,12 @@ describe('PublinkIdSystem', () => { submoduleCallback(callbackSpy); let request = server.requests[0]; - request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$'); + const parsed = parseUrl(request.url); + + expect(parsed.hostname).to.equal('proc.ad.cpe.dotomi.com'); + expect(parsed.pathname).to.equal('/cvx/client/sync/publink'); + expect(parsed.search.mpn).to.equal('Prebid.js'); + expect(parsed.search.mpv).to.equal('$prebid.version$'); request.respond(204, {}, JSON.stringify(serverResponse)); expect(callbackSpy.called).to.be.false; @@ -133,13 +146,19 @@ describe('PublinkIdSystem', () => { }); it('Fetch with usprivacy data', () => { - const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7'}}; + const config = {storage: {type: 'cookie'}, params: {e: 'ca11c0ca7', api_key: 'abcdefg'}}; let submoduleCallback = publinkIdSubmodule.getId(config).callback; submoduleCallback(callbackSpy); let request = server.requests[0]; - request.url = request.url.replace(':443', ''); - expect(request.url).to.equal('https://proc.ad.cpe.dotomi.com/cvx/client/sync/publink?deh=ca11c0ca7&mpn=Prebid.js&mpv=$prebid.version$&us_privacy=1YNN'); + const parsed = parseUrl(request.url); + + expect(parsed.hostname).to.equal('proc.ad.cpe.dotomi.com'); + expect(parsed.pathname).to.equal('/cvx/client/sync/publink'); + expect(parsed.search.mpn).to.equal('Prebid.js'); + expect(parsed.search.mpv).to.equal('$prebid.version$'); + expect(parsed.search.us_privacy).to.equal('1YNN'); + expect(parsed.search.apikey).to.equal('abcdefg'); request.respond(200, {}, JSON.stringify(serverResponse)); expect(callbackSpy.calledOnce).to.be.true; From 34c189d97d7c8af0dd73ae24325f53d1d3613f30 Mon Sep 17 00:00:00 2001 From: Lisa Benmore Date: Thu, 30 Sep 2021 08:46:56 -0700 Subject: [PATCH 131/250] Gumgum Bid Adapter: use nearest matching h/w dimensions from bid request (#7505) * Gumgum: ADTS-157 use nearest matching h/w dimensions from bid request * updated method calls from utils --- modules/gumgumBidAdapter.js | 10 ++++++++-- test/spec/modules/gumgumBidAdapter_spec.js | 23 +++++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 756d204e00d..76fb7023bb1 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -1,5 +1,6 @@ -import { logError, logWarn, parseSizesInput, _each, deepAccess } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; +import { _each, deepAccess, logError, logWarn, parseSizesInput } from '../src/utils.js'; + import { config } from '../src/config.js' import { getStorageManager } from '../src/storageManager.js'; import includes from 'core-js-pure/features/array/includes'; @@ -488,7 +489,12 @@ function interpretResponse(serverResponse, bidRequest) { } else if (product === 5 && includes(sizes, '1x1')) { sizes = ['1x1']; } else if (product === 2 && includes(sizes, '1x1')) { - sizes = responseWidth && responseHeight ? [`${responseWidth}x${responseHeight}`] : parseSizesInput(bidRequest.sizes) + const requestSizesThatMatchResponse = (bidRequest.sizes && bidRequest.sizes.reduce((result, current) => { + const [ width, height ] = current; + if (responseWidth === width || responseHeight === height) result.push(current.join('x')); + return result + }, [])) || []; + sizes = requestSizesThatMatchResponse.length ? requestSizesThatMatchResponse : parseSizesInput(bidRequest.sizes) } let [width, height] = sizes[0].split('x'); diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index e11123729e0..713bd514c0c 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -683,11 +683,24 @@ describe('gumgumAdapter', function () { expect(result[0].height).to.equal('1'); }); - it('uses response width and height for inscreen product', function () { - const result = spec.interpretResponse({ body: serverResponse }, bidRequest)[0]; - expect(result.width).to.equal(serverResponse.ad.width.toString()); - expect(result.height).to.equal(serverResponse.ad.height.toString()); - }); + it('uses request size that nearest matches response size for in-screen', function () { + const request = { ...bidRequest }; + const body = { ...serverResponse }; + const expectedSize = [ 300, 50 ]; + let result; + + request.pi = 2; + request.sizes.unshift(expectedSize); + + // typical ad server response values for in-screen + body.ad.width = 300; + body.ad.height = 100; + + result = spec.interpretResponse({ body }, request)[0]; + + expect(result.width = expectedSize[0]); + expect(result.height = expectedSize[1]); + }) it('defaults to use bidRequest sizes', function () { const { ad, jcsi, pag, thms, meta } = serverResponse From 60a12e0780ebe2de2b0f1f7af41b72743402333e Mon Sep 17 00:00:00 2001 From: Manasi Date: Thu, 30 Sep 2021 22:08:57 +0530 Subject: [PATCH 132/250] Pubmatic Bid Adapter: add support for JW player (#7450) * changes to support jwplayer segment data in pubmatic s2s endpoint * remove additional '|' getting added if dctr is blank * changes utils.convertType to remove reference to utils --- modules/pubmaticBidAdapter.js | 19 +- test/spec/modules/pubmaticBidAdapter_spec.js | 178 +++++++++++++++++++ 2 files changed, 191 insertions(+), 6 deletions(-) diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index fa1f04a25e2..4c182c214a3 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -605,7 +605,7 @@ function _addDealCustomTargetings(imp, bid) { } } -function _addJWPlayerSegmentData(imp, bid) { +function _addJWPlayerSegmentData(imp, bid, isS2S) { var jwSegData = (bid.rtd && bid.rtd.jwplayer && bid.rtd.jwplayer.targeting) || undefined; var jwPlayerData = ''; const jwMark = 'jw-'; @@ -619,10 +619,15 @@ function _addJWPlayerSegmentData(imp, bid) { for (var i = 0; i < maxLength; i++) { jwPlayerData += '|' + jwMark + jwSegData.segments[i] + '=1'; } - const ext = imp.ext; - (ext && ext.key_val === undefined) - ? ext.key_val = jwPlayerData - : ext.key_val += '|' + jwPlayerData; + + var ext; + + if (isS2S) { + (imp.dctr === undefined || imp.dctr.length == 0) ? imp.dctr = jwPlayerData : imp.dctr += '|' + jwPlayerData; + } else { + ext = imp.ext; + ext && ext.key_val === undefined ? ext.key_val = jwPlayerData : ext.key_val += '|' + jwPlayerData; + } } function _createImpressionObject(bid, conf) { @@ -1322,7 +1327,9 @@ export const spec = { * @param {Boolean} isOpenRtb boolean to check openrtb2 protocol * @return {Object} params bid params */ - transformBidParams: function (params, isOpenRtb) { + + transformBidParams: function (params, isOpenRtb, adUnit, bidRequests) { + _addJWPlayerSegmentData(params, adUnit.bids[0], true); return convertTypes({ 'publisherId': 'string', 'adSlot': 'string' diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index 54da555e6ce..47b9c984ff5 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -3644,5 +3644,183 @@ describe('PubMatic adapter', function () { }]); }); }); + + describe('JW player segment data for S2S', function() { + let sandbox = sinon.sandbox.create(); + beforeEach(function () { + sandbox = sinon.sandbox.create(); + }); + afterEach(function() { + sandbox.restore(); + }); + it('Should append JW player segment data to dctr values in auction endpoint', function() { + var videoAdUnit = { + 'bidderCode': 'pubmatic', + 'bids': [ + { + 'bidder': 'pubmatic', + 'params': { + 'publisherId': '156276', + 'adSlot': 'pubmatic_video2', + 'dctr': 'key1=123|key2=345', + 'pmzoneid': '1243', + 'video': { + 'mimes': ['video/mp4', 'video/x-flv'], + 'skippable': true, + 'minduration': 5, + 'maxduration': 30, + 'startdelay': 5, + 'playbackmethod': [1, 3], + 'api': [1, 2], + 'protocols': [2, 3], + 'battr': [13, 14], + 'linearity': 1, + 'placement': 2, + 'minbitrate': 10, + 'maxbitrate': 10 + } + }, + 'rtd': { + 'jwplayer': { + 'targeting': { + 'segments': ['80011026', '80011035'], + 'content': { + 'id': 'jw_d9J2zcaA' + } + } + } + }, + 'bid_id': '17a6771be26cc4', + 'ortb2Imp': { + 'ext': { + 'data': { + 'pbadslot': 'abcd', + 'jwTargeting': { + 'playerID': 'myElement1', + 'mediaID': 'd9J2zcaA' + } + } + } + } + } + ], + 'auctionStart': 1630923178417, + 'timeout': 1000, + 'src': 's2s' + } + + spec.transformBidParams(bidRequests[0].params, true, videoAdUnit); + expect(bidRequests[0].params.dctr).to.equal('key1:val1,val2|key2:val1|jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1'); + }); + it('Should send only JW player segment data in auction endpoint, if dctr is missing', function() { + var videoAdUnit = { + 'bidderCode': 'pubmatic', + 'bids': [ + { + 'bidder': 'pubmatic', + 'params': { + 'publisherId': '156276', + 'adSlot': 'pubmatic_video2', + 'dctr': 'key1=123|key2=345', + 'pmzoneid': '1243', + 'video': { + 'mimes': ['video/mp4', 'video/x-flv'], + 'skippable': true, + 'minduration': 5, + 'maxduration': 30, + 'startdelay': 5, + 'playbackmethod': [1, 3], + 'api': [1, 2], + 'protocols': [2, 3], + 'battr': [13, 14], + 'linearity': 1, + 'placement': 2, + 'minbitrate': 10, + 'maxbitrate': 10 + } + }, + 'rtd': { + 'jwplayer': { + 'targeting': { + 'segments': ['80011026', '80011035'], + 'content': { + 'id': 'jw_d9J2zcaA' + } + } + } + }, + 'bid_id': '17a6771be26cc4', + 'ortb2Imp': { + 'ext': { + 'data': { + 'pbadslot': 'abcd', + 'jwTargeting': { + 'playerID': 'myElement1', + 'mediaID': 'd9J2zcaA' + } + } + } + } + } + ], + 'auctionStart': 1630923178417, + 'timeout': 1000, + 'src': 's2s' + } + + delete bidRequests[0].params.dctr; + spec.transformBidParams(bidRequests[0].params, true, videoAdUnit); + expect(bidRequests[0].params.dctr).to.equal('jw-id=jw_d9J2zcaA|jw-80011026=1|jw-80011035=1'); + }); + + it('Should not send any JW player segment data in auction endpoint, if it is not available', function() { + var videoAdUnit = { + 'bidderCode': 'pubmatic', + 'bids': [ + { + 'bidder': 'pubmatic', + 'params': { + 'publisherId': '156276', + 'adSlot': 'pubmatic_video2', + 'dctr': 'key1=123|key2=345', + 'pmzoneid': '1243', + 'video': { + 'mimes': ['video/mp4', 'video/x-flv'], + 'skippable': true, + 'minduration': 5, + 'maxduration': 30, + 'startdelay': 5, + 'playbackmethod': [1, 3], + 'api': [1, 2], + 'protocols': [2, 3], + 'battr': [13, 14], + 'linearity': 1, + 'placement': 2, + 'minbitrate': 10, + 'maxbitrate': 10 + } + }, + 'bid_id': '17a6771be26cc4', + 'ortb2Imp': { + 'ext': { + 'data': { + 'pbadslot': 'abcd', + 'jwTargeting': { + 'playerID': 'myElement1', + 'mediaID': 'd9J2zcaA' + } + } + } + } + } + ], + 'auctionStart': 1630923178417, + 'timeout': 1000, + 'src': 's2s' + } + spec.transformBidParams(bidRequests[0].params, true, videoAdUnit); + expect(bidRequests[0].params.dctr).to.equal('key1:val1,val2|key2:val1'); + }); + }) }); }); From 9ba675043d8ff28e0b2468759080b3aa338feae0 Mon Sep 17 00:00:00 2001 From: Sasan Farrokh Date: Thu, 30 Sep 2021 20:09:34 +0330 Subject: [PATCH 133/250] fix(vidoomyBidAdapter): macro replacement and gdprConsent null fix (#7518) Co-authored-by: Sasan Farrokh --- modules/vidoomyBidAdapter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/vidoomyBidAdapter.js b/modules/vidoomyBidAdapter.js index afb06e06d12..90a8cfff44d 100644 --- a/modules/vidoomyBidAdapter.js +++ b/modules/vidoomyBidAdapter.js @@ -93,8 +93,8 @@ const buildRequests = (validBidRequests, bidderRequest) => { xhr.open('GET', COOKIE_SYNC_JSON) xhr.addEventListener('load', function () { const macro = Macro({ - gpdr: bidderRequest.gdprConsent.gdprApplies, - gpdr_consent: bidderRequest.gdprConsent.consentString + gpdr: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.gdprApplies : '0', + gpdr_consent: bidderRequest.gdprConsent ? bidderRequest.gdprConsent.consentString : '', }); JSON.parse(this.responseText).filter(Boolean).forEach(url => { firePixel(macro.replace(url)) @@ -248,6 +248,7 @@ function Macro (obj) { /{{\s*([a-zA-Z0-9_]+)\s*}}/g, /\$\$\s*([a-zA-Z0-9_]+)\s*\$\$/g, /\[\s*([a-zA-Z0-9_]+)\s*\]/g, + /\{\s*([a-zA-Z0-9_]+)\s*\}/g, ]; regexes.forEach(regex => { string = string.replace(regex, (str, x) => { From 0ee71d2e2a68159dad931e00bf7d3af18bcf2833 Mon Sep 17 00:00:00 2001 From: relaido <63339139+relaido@users.noreply.github.com> Date: Fri, 1 Oct 2021 01:59:41 +0900 Subject: [PATCH 134/250] Relaido Bid Adapter: support imuid module (#7422) * add relaido adapter * remove event listener * fixed UserSyncs and e.data * fix conflicts * supports imuid module Co-authored-by: ishigami_shingo Co-authored-by: cmertv-sishigami Co-authored-by: t_bun --- modules/relaidoBidAdapter.js | 10 ++++-- test/spec/modules/relaidoBidAdapter_spec.js | 40 ++++++++++----------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/modules/relaidoBidAdapter.js b/modules/relaidoBidAdapter.js index 4df13b52a39..a3b83e73ae3 100644 --- a/modules/relaidoBidAdapter.js +++ b/modules/relaidoBidAdapter.js @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js'; const BIDDER_CODE = 'relaido'; const BIDDER_DOMAIN = 'api.relaido.jp'; -const ADAPTER_VERSION = '1.0.5'; +const ADAPTER_VERSION = '1.0.6'; const DEFAULT_TTL = 300; const UUID_KEY = 'relaido_uuid'; @@ -68,9 +68,15 @@ function buildRequests(validBidRequests, bidderRequest) { media_type: mediaType, uuid: uuid, width: width, - height: height + height: height, + pv: '$prebid.version$' }; + const imuid = utils.deepAccess(bidRequest, 'userId.imuid'); + if (imuid) { + payload.imuid = imuid; + } + // It may not be encoded, so add it at the end of the payload payload.ref = bidderRequest.refererInfo.referer; diff --git a/test/spec/modules/relaidoBidAdapter_spec.js b/test/spec/modules/relaidoBidAdapter_spec.js index e372c67bb4e..c6e2a9ae5d5 100644 --- a/test/spec/modules/relaidoBidAdapter_spec.js +++ b/test/spec/modules/relaidoBidAdapter_spec.js @@ -20,8 +20,12 @@ describe('RelaidoAdapter', function () { let bidderRequest; let serverResponse; let serverRequest; + let generateUUIDStub; + let triggerPixelStub; beforeEach(function () { + generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid); + triggerPixelStub = sinon.stub(utils, 'triggerPixel'); bidRequest = { bidder: 'relaido', params: { @@ -72,6 +76,10 @@ describe('RelaidoAdapter', function () { mediaType: 'video', }; }); + afterEach(() => { + generateUUIDStub.restore(); + triggerPixelStub.restore(); + }); describe('spec.isBidRequestValid', function () { it('should return true when the required params are passed by video', function () { @@ -207,6 +215,7 @@ describe('RelaidoAdapter', function () { expect(request.data.uuid).to.equal(relaido_uuid); expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]); expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]); + expect(request.data.pv).to.equal('$prebid.version$'); }); it('should build bid requests by banner', function () { @@ -251,8 +260,6 @@ describe('RelaidoAdapter', function () { expect(bidRequests).to.have.lengthOf(1); const request = bidRequests[0]; - // eslint-disable-next-line no-console - console.log(bidRequests); expect(request.width).to.equal(1); }); @@ -264,6 +271,15 @@ describe('RelaidoAdapter', function () { expect(keys[0]).to.equal('version'); expect(keys[keys.length - 1]).to.equal('ref'); }); + + it('should get imuid', function () { + bidRequest.userId = {} + bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw'; + const bidRequests = spec.buildRequests([bidRequest], bidderRequest); + expect(bidRequests).to.have.lengthOf(1); + const request = bidRequests[0]; + expect(request.data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw'); + }); }); describe('spec.interpretResponse', function () { @@ -350,14 +366,6 @@ describe('RelaidoAdapter', function () { }); describe('spec.onBidWon', function () { - let stub; - beforeEach(() => { - stub = sinon.stub(utils, 'triggerPixel'); - }); - afterEach(() => { - stub.restore(); - }); - it('Should create nurl pixel if bid nurl', function () { let bid = { bidder: bidRequest.bidder, @@ -371,7 +379,7 @@ describe('RelaidoAdapter', function () { ref: window.location.href, } spec.onBidWon(bid); - const parser = utils.parseUrl(stub.getCall(0).args[0]); + const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/win.gif'); @@ -387,14 +395,6 @@ describe('RelaidoAdapter', function () { }); describe('spec.onTimeout', function () { - let stub; - beforeEach(() => { - stub = sinon.stub(utils, 'triggerPixel'); - }); - afterEach(() => { - stub.restore(); - }); - it('Should create nurl pixel if bid nurl', function () { const data = [{ bidder: bidRequest.bidder, @@ -405,7 +405,7 @@ describe('RelaidoAdapter', function () { timeout: bidderRequest.timeout, }]; spec.onTimeout(data); - const parser = utils.parseUrl(stub.getCall(0).args[0]); + const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/timeout.gif'); From d7fc1a74ad69f6fbfcf8ff2e0df1eaf2683a4019 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 30 Sep 2021 10:02:45 -0700 Subject: [PATCH 135/250] Revert "Relaido Bid Adapter: support imuid module (#7422)" (#7520) This reverts commit 0ee71d2e2a68159dad931e00bf7d3af18bcf2833. --- modules/relaidoBidAdapter.js | 10 ++---- test/spec/modules/relaidoBidAdapter_spec.js | 40 ++++++++++----------- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/modules/relaidoBidAdapter.js b/modules/relaidoBidAdapter.js index a3b83e73ae3..4df13b52a39 100644 --- a/modules/relaidoBidAdapter.js +++ b/modules/relaidoBidAdapter.js @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js'; const BIDDER_CODE = 'relaido'; const BIDDER_DOMAIN = 'api.relaido.jp'; -const ADAPTER_VERSION = '1.0.6'; +const ADAPTER_VERSION = '1.0.5'; const DEFAULT_TTL = 300; const UUID_KEY = 'relaido_uuid'; @@ -68,15 +68,9 @@ function buildRequests(validBidRequests, bidderRequest) { media_type: mediaType, uuid: uuid, width: width, - height: height, - pv: '$prebid.version$' + height: height }; - const imuid = utils.deepAccess(bidRequest, 'userId.imuid'); - if (imuid) { - payload.imuid = imuid; - } - // It may not be encoded, so add it at the end of the payload payload.ref = bidderRequest.refererInfo.referer; diff --git a/test/spec/modules/relaidoBidAdapter_spec.js b/test/spec/modules/relaidoBidAdapter_spec.js index c6e2a9ae5d5..e372c67bb4e 100644 --- a/test/spec/modules/relaidoBidAdapter_spec.js +++ b/test/spec/modules/relaidoBidAdapter_spec.js @@ -20,12 +20,8 @@ describe('RelaidoAdapter', function () { let bidderRequest; let serverResponse; let serverRequest; - let generateUUIDStub; - let triggerPixelStub; beforeEach(function () { - generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid); - triggerPixelStub = sinon.stub(utils, 'triggerPixel'); bidRequest = { bidder: 'relaido', params: { @@ -76,10 +72,6 @@ describe('RelaidoAdapter', function () { mediaType: 'video', }; }); - afterEach(() => { - generateUUIDStub.restore(); - triggerPixelStub.restore(); - }); describe('spec.isBidRequestValid', function () { it('should return true when the required params are passed by video', function () { @@ -215,7 +207,6 @@ describe('RelaidoAdapter', function () { expect(request.data.uuid).to.equal(relaido_uuid); expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]); expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]); - expect(request.data.pv).to.equal('$prebid.version$'); }); it('should build bid requests by banner', function () { @@ -260,6 +251,8 @@ describe('RelaidoAdapter', function () { expect(bidRequests).to.have.lengthOf(1); const request = bidRequests[0]; + // eslint-disable-next-line no-console + console.log(bidRequests); expect(request.width).to.equal(1); }); @@ -271,15 +264,6 @@ describe('RelaidoAdapter', function () { expect(keys[0]).to.equal('version'); expect(keys[keys.length - 1]).to.equal('ref'); }); - - it('should get imuid', function () { - bidRequest.userId = {} - bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw'; - const bidRequests = spec.buildRequests([bidRequest], bidderRequest); - expect(bidRequests).to.have.lengthOf(1); - const request = bidRequests[0]; - expect(request.data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw'); - }); }); describe('spec.interpretResponse', function () { @@ -366,6 +350,14 @@ describe('RelaidoAdapter', function () { }); describe('spec.onBidWon', function () { + let stub; + beforeEach(() => { + stub = sinon.stub(utils, 'triggerPixel'); + }); + afterEach(() => { + stub.restore(); + }); + it('Should create nurl pixel if bid nurl', function () { let bid = { bidder: bidRequest.bidder, @@ -379,7 +371,7 @@ describe('RelaidoAdapter', function () { ref: window.location.href, } spec.onBidWon(bid); - const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); + const parser = utils.parseUrl(stub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/win.gif'); @@ -395,6 +387,14 @@ describe('RelaidoAdapter', function () { }); describe('spec.onTimeout', function () { + let stub; + beforeEach(() => { + stub = sinon.stub(utils, 'triggerPixel'); + }); + afterEach(() => { + stub.restore(); + }); + it('Should create nurl pixel if bid nurl', function () { const data = [{ bidder: bidRequest.bidder, @@ -405,7 +405,7 @@ describe('RelaidoAdapter', function () { timeout: bidderRequest.timeout, }]; spec.onTimeout(data); - const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); + const parser = utils.parseUrl(stub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/timeout.gif'); From cd53743b3a9736fd0492c518237d26b0327fe598 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 30 Sep 2021 10:43:49 -0700 Subject: [PATCH 136/250] Relaido Bid Adapter: support imuid (with utils fix after revert) (#7521) * Relaido Bid Adapter: support imuid `utils.` no longer needed because of specific import of functions * update testing * fix spaces * fix test linting * fix blank line padding --- modules/relaidoBidAdapter.js | 10 ++++- test/spec/modules/relaidoBidAdapter_spec.js | 41 +++++++++++---------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/modules/relaidoBidAdapter.js b/modules/relaidoBidAdapter.js index 4df13b52a39..16e01f80819 100644 --- a/modules/relaidoBidAdapter.js +++ b/modules/relaidoBidAdapter.js @@ -6,7 +6,7 @@ import { getStorageManager } from '../src/storageManager.js'; const BIDDER_CODE = 'relaido'; const BIDDER_DOMAIN = 'api.relaido.jp'; -const ADAPTER_VERSION = '1.0.5'; +const ADAPTER_VERSION = '1.0.6'; const DEFAULT_TTL = 300; const UUID_KEY = 'relaido_uuid'; @@ -68,9 +68,15 @@ function buildRequests(validBidRequests, bidderRequest) { media_type: mediaType, uuid: uuid, width: width, - height: height + height: height, + pv: '$prebid.version$' }; + const imuid = deepAccess(bidRequest, 'userId.imuid'); + if (imuid) { + payload.imuid = imuid; + } + // It may not be encoded, so add it at the end of the payload payload.ref = bidderRequest.refererInfo.referer; diff --git a/test/spec/modules/relaidoBidAdapter_spec.js b/test/spec/modules/relaidoBidAdapter_spec.js index e372c67bb4e..868b1856c34 100644 --- a/test/spec/modules/relaidoBidAdapter_spec.js +++ b/test/spec/modules/relaidoBidAdapter_spec.js @@ -20,8 +20,12 @@ describe('RelaidoAdapter', function () { let bidderRequest; let serverResponse; let serverRequest; + let generateUUIDStub; + let triggerPixelStub; beforeEach(function () { + generateUUIDStub = sinon.stub(utils, 'generateUUID').returns(relaido_uuid); + triggerPixelStub = sinon.stub(utils, 'triggerPixel'); bidRequest = { bidder: 'relaido', params: { @@ -73,6 +77,11 @@ describe('RelaidoAdapter', function () { }; }); + afterEach(() => { + generateUUIDStub.restore(); + triggerPixelStub.restore(); + }); + describe('spec.isBidRequestValid', function () { it('should return true when the required params are passed by video', function () { expect(spec.isBidRequestValid(bidRequest)).to.equal(true); @@ -207,6 +216,7 @@ describe('RelaidoAdapter', function () { expect(request.data.uuid).to.equal(relaido_uuid); expect(request.data.width).to.equal(bidRequest.mediaTypes.video.playerSize[0][0]); expect(request.data.height).to.equal(bidRequest.mediaTypes.video.playerSize[0][1]); + expect(request.data.pv).to.equal('$prebid.version$'); }); it('should build bid requests by banner', function () { @@ -251,8 +261,6 @@ describe('RelaidoAdapter', function () { expect(bidRequests).to.have.lengthOf(1); const request = bidRequests[0]; - // eslint-disable-next-line no-console - console.log(bidRequests); expect(request.width).to.equal(1); }); @@ -264,6 +272,15 @@ describe('RelaidoAdapter', function () { expect(keys[0]).to.equal('version'); expect(keys[keys.length - 1]).to.equal('ref'); }); + + it('should get imuid', function () { + bidRequest.userId = {} + bidRequest.userId.imuid = 'i.tjHcK_7fTcqnbrS_YA2vaw'; + const bidRequests = spec.buildRequests([bidRequest], bidderRequest); + expect(bidRequests).to.have.lengthOf(1); + const request = bidRequests[0]; + expect(request.data.imuid).to.equal('i.tjHcK_7fTcqnbrS_YA2vaw'); + }); }); describe('spec.interpretResponse', function () { @@ -350,14 +367,6 @@ describe('RelaidoAdapter', function () { }); describe('spec.onBidWon', function () { - let stub; - beforeEach(() => { - stub = sinon.stub(utils, 'triggerPixel'); - }); - afterEach(() => { - stub.restore(); - }); - it('Should create nurl pixel if bid nurl', function () { let bid = { bidder: bidRequest.bidder, @@ -371,7 +380,7 @@ describe('RelaidoAdapter', function () { ref: window.location.href, } spec.onBidWon(bid); - const parser = utils.parseUrl(stub.getCall(0).args[0]); + const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/win.gif'); @@ -387,14 +396,6 @@ describe('RelaidoAdapter', function () { }); describe('spec.onTimeout', function () { - let stub; - beforeEach(() => { - stub = sinon.stub(utils, 'triggerPixel'); - }); - afterEach(() => { - stub.restore(); - }); - it('Should create nurl pixel if bid nurl', function () { const data = [{ bidder: bidRequest.bidder, @@ -405,7 +406,7 @@ describe('RelaidoAdapter', function () { timeout: bidderRequest.timeout, }]; spec.onTimeout(data); - const parser = utils.parseUrl(stub.getCall(0).args[0]); + const parser = utils.parseUrl(triggerPixelStub.getCall(0).args[0]); const query = parser.search; expect(parser.hostname).to.equal('api.relaido.jp'); expect(parser.pathname).to.equal('/tr/v1/prebid/timeout.gif'); From 7e558a5689e379f2ea4662f09fd71818ddafe744 Mon Sep 17 00:00:00 2001 From: Denislavrov <31471151+Denislavrov@users.noreply.github.com> Date: Fri, 1 Oct 2021 00:42:38 +0300 Subject: [PATCH 137/250] Mytarget Bid Adapter : update adapter to comply with Prebid 5 (#7397) * Add myTargetBitAdapter for Prebid 5.0 * added support advertiserDomains * fixed utils import Co-authored-by: Denis Lavrov --- modules/mytargetBidAdapter.js | 112 +++++++++++ test/spec/modules/mytargetBidAdapter_spec.js | 199 +++++++++++++++++++ 2 files changed, 311 insertions(+) create mode 100644 modules/mytargetBidAdapter.js create mode 100644 test/spec/modules/mytargetBidAdapter_spec.js diff --git a/modules/mytargetBidAdapter.js b/modules/mytargetBidAdapter.js new file mode 100644 index 00000000000..f55f2e6b802 --- /dev/null +++ b/modules/mytargetBidAdapter.js @@ -0,0 +1,112 @@ +import { _map } from '../src/utils.js'; +import { config } from '../src/config.js'; +import { registerBidder } from '../src/adapters/bidderFactory.js'; + +const BIDDER_CODE = 'mytarget'; +const BIDDER_URL = '//ad.mail.ru/hbid_prebid/'; +const DEFAULT_CURRENCY = 'RUB'; +const DEFAULT_TTL = 180; + +function buildPlacement(bidRequest) { + let { bidId, params } = bidRequest; + let { placementId, position, response, bidfloor } = params; + let placement = { + placementId, + id: bidId, + position: position || 0, + response: response || 0 + }; + + if (typeof bidfloor !== 'undefined') { + placement.bidfloor = bidfloor; + } + + return placement; +} + +function getSiteName(referrer) { + let sitename = config.getConfig('mytarget.sitename'); + + if (!sitename) { + const parsed = document.createElement('a'); + parsed.href = decodeURIComponent(referrer); + sitename = parsed.hostname; + } + + return sitename; +} + +function generateRandomId() { + return Math.random().toString(16).substring(2); +} + +export const spec = { + code: BIDDER_CODE, + + isBidRequestValid: function(bid) { + return !!bid.params.placementId; + }, + + buildRequests: function(validBidRequests, bidderRequest) { + let referrer = ''; + + if (bidderRequest && bidderRequest.refererInfo) { + referrer = bidderRequest.refererInfo.referer; + } + + const payload = { + places: _map(validBidRequests, buildPlacement), + site: { + sitename: getSiteName(referrer), + page: referrer + }, + settings: { + currency: DEFAULT_CURRENCY, + windowSize: { + width: window.screen.width, + height: window.screen.height + } + } + }; + + return { + method: 'POST', + url: BIDDER_URL, + data: payload, + }; + }, + + interpretResponse: function(serverResponse, bidRequest) { + let { body } = serverResponse; + + if (body.bids) { + return _map(body.bids, (bid) => { + let bidResponse = { + requestId: bid.id, + cpm: bid.price, + width: bid.size.width, + height: bid.size.height, + ttl: bid.ttl || DEFAULT_TTL, + currency: bid.currency || DEFAULT_CURRENCY, + creativeId: bid.creativeId || generateRandomId(), + netRevenue: true, + meta: { + advertiserDomains: bid.adomain && bid.adomain.length > 0 ? bid.adomain : [], + } + } + + if (bid.adm) { + bidResponse.ad = bid.adm; + } else { + bidResponse.adUrl = bid.displayUrl; + } + + return bidResponse; + }); + } + + return []; + } +} + +registerBidder(spec); diff --git a/test/spec/modules/mytargetBidAdapter_spec.js b/test/spec/modules/mytargetBidAdapter_spec.js new file mode 100644 index 00000000000..62d139bb926 --- /dev/null +++ b/test/spec/modules/mytargetBidAdapter_spec.js @@ -0,0 +1,199 @@ +import { expect } from 'chai'; +import { spec } from 'modules/mytargetBidAdapter'; + +describe('MyTarget Adapter', function() { + describe('isBidRequestValid', function () { + it('should return true when required params found', function () { + let validBid = { + bidder: 'mytarget', + params: { + placementId: '1' + } + }; + + expect(spec.isBidRequestValid(validBid)).to.equal(true); + }); + + it('should return false for when required params are not passed', function () { + let invalidBid = { + bidder: 'mytarget', + params: {} + }; + + expect(spec.isBidRequestValid(invalidBid)).to.equal(false); + }); + }); + + describe('buildRequests', function () { + let bidRequests = [ + { + bidId: 'bid1', + bidder: 'mytarget', + params: { + placementId: '1' + } + }, + { + bidId: 'bid2', + bidder: 'mytarget', + params: { + placementId: '2', + position: 1, + response: 1, + bidfloor: 10000 + } + } + ]; + let bidderRequest = { + refererInfo: { + referer: 'https://example.com?param=value' + } + }; + + let bidRequest = spec.buildRequests(bidRequests, bidderRequest); + + it('should build single POST request for multiple bids', function() { + expect(bidRequest.method).to.equal('POST'); + expect(bidRequest.url).to.equal('//ad.mail.ru/hbid_prebid/'); + expect(bidRequest.data).to.be.an('object'); + expect(bidRequest.data.places).to.be.an('array'); + expect(bidRequest.data.places).to.have.lengthOf(2); + }); + + it('should pass bid parameters', function() { + let place1 = bidRequest.data.places[0]; + let place2 = bidRequest.data.places[1]; + + expect(place1.placementId).to.equal('1'); + expect(place2.placementId).to.equal('2'); + expect(place1.id).to.equal('bid1'); + expect(place2.id).to.equal('bid2'); + }); + + it('should pass default position and response type', function() { + let place = bidRequest.data.places[0]; + + expect(place.position).to.equal(0); + expect(place.response).to.equal(0); + }); + + it('should pass provided position and response type', function() { + let place = bidRequest.data.places[1]; + + expect(place.position).to.equal(1); + expect(place.response).to.equal(1); + }); + + it('should not pass default bidfloor', function() { + let place = bidRequest.data.places[0]; + + expect(place.bidfloor).not.to.exist; + }); + + it('should not pass provided bidfloor', function() { + let place = bidRequest.data.places[1]; + + expect(place.bidfloor).to.exist; + expect(place.bidfloor).to.equal(10000); + }); + + it('should pass site parameters', function() { + let site = bidRequest.data.site; + + expect(site).to.be.an('object'); + expect(site.sitename).to.equal('example.com'); + expect(site.page).to.equal('https://example.com?param=value'); + }); + + it('should pass settings', function() { + let settings = bidRequest.data.settings; + + expect(settings).to.be.an('object'); + expect(settings.currency).to.equal('RUB'); + expect(settings.windowSize).to.be.an('object'); + expect(settings.windowSize.width).to.equal(window.screen.width); + expect(settings.windowSize.height).to.equal(window.screen.height); + }); + }); + + describe('interpretResponse', function () { + let serverResponse = { + body: { + 'bidder_status': + [ + { + 'bidder': 'mail.ru', + 'response_time_ms': 100, + 'num_bids': 2 + } + ], + 'bids': + [ + { + 'displayUrl': 'https://ad.mail.ru/hbid_imp/12345', + 'size': + { + 'height': '400', + 'width': '240' + }, + 'id': '1', + 'currency': 'RUB', + 'price': 100, + 'ttl': 360, + 'creativeId': '123456' + }, + { + 'adm': '

Ad

', + 'size': + { + 'height': '250', + 'width': '300' + }, + 'id': '2', + 'price': 200 + } + ] + } + }; + + let bids = spec.interpretResponse(serverResponse); + + it('should return empty array for response with no bids', function() { + let emptyBids = spec.interpretResponse({ body: {} }); + + expect(emptyBids).to.have.lengthOf(0); + }); + + it('should parse all bids from response', function() { + expect(bids).to.have.lengthOf(2); + }); + + it('should parse bid with ad url', function() { + expect(bids[0].requestId).to.equal('1'); + expect(bids[0].cpm).to.equal(100); + expect(bids[0].width).to.equal('240'); + expect(bids[0].height).to.equal('400'); + expect(bids[0].ttl).to.equal(360); + expect(bids[0].currency).to.equal('RUB'); + expect(bids[0]).to.have.property('creativeId'); + expect(bids[0].creativeId).to.equal('123456'); + expect(bids[0].netRevenue).to.equal(true); + expect(bids[0].adUrl).to.equal('https://ad.mail.ru/hbid_imp/12345'); + expect(bids[0]).to.not.have.property('ad'); + }); + + it('should parse bid with ad markup', function() { + expect(bids[1].requestId).to.equal('2'); + expect(bids[1].cpm).to.equal(200); + expect(bids[1].width).to.equal('300'); + expect(bids[1].height).to.equal('250'); + expect(bids[1].ttl).to.equal(180); + expect(bids[1].currency).to.equal('RUB'); + expect(bids[1]).to.have.property('creativeId'); + expect(bids[1].creativeId).not.to.equal('123456'); + expect(bids[1].netRevenue).to.equal(true); + expect(bids[1].ad).to.equal('

Ad

'); + expect(bids[1]).to.not.have.property('adUrl'); + }); + }); +}); From 80bc6e2b85bbbc57fb2d626375c6b88de8c92c3a Mon Sep 17 00:00:00 2001 From: Renato Aguilar <41385245+raguilar-ias@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:21:29 -0500 Subject: [PATCH 138/250] IAS RTD adapter: improve workflow (#7431) --- modules/iasRtdProvider.js | 150 +++++++++++++---------- test/spec/modules/iasRtdProvider_spec.js | 77 +++++++++++- 2 files changed, 154 insertions(+), 73 deletions(-) diff --git a/modules/iasRtdProvider.js b/modules/iasRtdProvider.js index 25ca39c23d6..6f7b2d5215d 100644 --- a/modules/iasRtdProvider.js +++ b/modules/iasRtdProvider.js @@ -1,13 +1,18 @@ -import { isArray, getAdUnitSizes, getKeys, logError } from '../src/utils.js'; import { submodule } from '../src/hook.js'; +import * as utils from '../src/utils.js'; +import { ajax } from '../src/ajax.js'; import { getGlobal } from '../src/prebidGlobal.js'; -import { ajaxBuilder } from '../src/ajax.js'; /** @type {string} */ const MODULE_NAME = 'realTimeData'; const SUBMODULE_NAME = 'ias'; - -let bidResponses = {}; +const IAS_HOST = 'https://pixel.adsafeprotected.com/services/pub'; +export let iasTargeting = {}; +const BRAND_SAFETY_OBJECT_FIELD_NAME = 'brandSafety'; +const FRAUD_FIELD_NAME = 'fr'; +const SLOTS_OBJECT_FIELD_NAME = 'slots'; +const CUSTOM_FIELD_NAME = 'custom'; +const IAS_KW = 'ias-kw'; /** * Module init @@ -16,12 +21,17 @@ let bidResponses = {}; * @return {boolean} */ export function init(config, userConsent) { + const params = config.params; + if (!params || !params.pubId) { + utils.logError('missing pubId param for IAS provider'); + return false; + } return true; } function stringifySlotSizes(sizes) { let result = ''; - if (isArray(sizes)) { + if (utils.isArray(sizes)) { result = sizes.reduce((acc, size) => { acc.push(size.join('.')); return acc; @@ -31,13 +41,14 @@ function stringifySlotSizes(sizes) { return result; } -function stringifySlot(bidRequest, adUnitPath) { - const sizes = getAdUnitSizes(bidRequest); +function stringifySlot(bidRequest) { + const sizes = utils.getAdUnitSizes(bidRequest); const id = bidRequest.code; const ss = stringifySlotSizes(sizes); - const p = bidRequest.code; + const adSlot = utils.getGptSlotInfoForAdUnitCode(bidRequest.code); + const p = utils.isEmpty(adSlot) ? bidRequest.code : adSlot.gptSlot; const slot = { id, ss, p }; - const keyValues = getKeys(slot).map(function (key) { + const keyValues = utils.getKeys(slot).map(function (key) { return [key, slot[key]].join(':'); }); return '{' + keyValues.join(',') + '}'; @@ -51,35 +62,29 @@ function stringifyScreenSize() { return [(window.screen && window.screen.width) || -1, (window.screen && window.screen.height) || -1].join('.'); } -function getPageLevelKeywords(response) { +function formatTargetingData(adUnit) { let result = {}; - if (response.brandSafety) { - shallowMerge(result, response.brandSafety); + if (iasTargeting[BRAND_SAFETY_OBJECT_FIELD_NAME]) { + utils.mergeDeep(result, iasTargeting[BRAND_SAFETY_OBJECT_FIELD_NAME]); + } + if (iasTargeting[FRAUD_FIELD_NAME]) { + result[FRAUD_FIELD_NAME] = iasTargeting[FRAUD_FIELD_NAME]; + } + if (iasTargeting[CUSTOM_FIELD_NAME] && IAS_KW in iasTargeting[CUSTOM_FIELD_NAME]) { + result[IAS_KW] = iasTargeting[CUSTOM_FIELD_NAME][IAS_KW]; + } + if (iasTargeting[SLOTS_OBJECT_FIELD_NAME] && adUnit in iasTargeting[SLOTS_OBJECT_FIELD_NAME]) { + utils.mergeDeep(result, iasTargeting[SLOTS_OBJECT_FIELD_NAME][adUnit]); } - result.fr = response.fr; - result.custom = response.custom; return result; } -function shallowMerge(dest, src) { - getKeys(src).reduce((dest, srcKey) => { - dest[srcKey] = src[srcKey]; - return dest; - }, dest); -} - -function getBidRequestData(reqBidsConfigObj, callback, config) { - const adUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits; - let isFinish = false; - - const IAS_HOST = 'https://pixel.adsafeprotected.com/services/pub'; - const { pubId, adUnitPath } = config.params; - const anId = pubId; +function constructQueryString(anId, adUnits) { let queries = []; queries.push(['anId', anId]); queries = queries.concat(adUnits.reduce(function (acc, request) { - acc.push(['slot', stringifySlot(request, adUnitPath)]); + acc.push(['slot', stringifySlot(request)]); return acc; }, [])); @@ -87,58 +92,69 @@ function getBidRequestData(reqBidsConfigObj, callback, config) { queries.push(['sr', stringifyScreenSize()]); queries.push(['url', encodeURIComponent(window.location.href)]); - const queryString = encodeURI(queries.map(qs => qs.join('=')).join('&')); - - const ajax = ajaxBuilder(); - - ajax(`${IAS_HOST}?${queryString}`, { - success: function (response, request) { - if (!isFinish) { - if (request.status === 200) { - const iasResponse = JSON.parse(response); - const commonBidResponse = {}; - shallowMerge(commonBidResponse, getPageLevelKeywords(iasResponse)); - commonBidResponse.slots = iasResponse.slots; - bidResponses = commonBidResponse; - adUnits.forEach(adUnit => { - adUnit.bids.forEach(bid => { - const rtd = bid.rtd || {}; - const iasRtd = {}; - iasRtd[SUBMODULE_NAME] = Object.assign({}, rtd[SUBMODULE_NAME], bidResponses); - bid.rtd = Object.assign({}, rtd, iasRtd); - }); - }); - } - isFinish = true; - } - callback(); - }, - error: function () { - logError('failed to retrieve targeting information'); - callback(); - } - }); + return encodeURI(queries.map(qs => qs.join('=')).join('&')); +} + +function parseResponse(result) { + let iasResponse = {}; + try { + iasResponse = JSON.parse(result); + } catch (err) { + utils.logError('error', err); + } + iasTargeting = iasResponse; } function getTargetingData(adUnits, config, userConsent) { const targeting = {}; - Object.keys(bidResponses).forEach(key => bidResponses[key] === undefined ? delete bidResponses[key] : {}); try { - adUnits.forEach(function(adUnit) { - targeting[adUnit] = bidResponses; - }); + if (!utils.isEmpty(iasTargeting)) { + adUnits.forEach(function (adUnit) { + targeting[adUnit] = formatTargetingData(adUnit); + }); + } } catch (err) { - logError('error', err); + utils.logError('error', err); } + utils.logInfo('IAS targeting', targeting); return targeting; } +export function getApiCallback() { + return { + success: function (response, req) { + if (req.status === 200) { + try { + parseResponse(response); + } catch (e) { + utils.logError('Unable to parse IAS response.', e); + } + } + }, + error: function () { + utils.logError('failed to retrieve IAS data'); + } + } +} + +function getBidRequestData(reqBidsConfigObj, callback, config, userConsent) { + const adUnits = reqBidsConfigObj.adUnits || getGlobal().adUnits; + const { pubId } = config.params; + const queryString = constructQueryString(pubId, adUnits); + ajax( + `${IAS_HOST}?${queryString}`, + getApiCallback(), + undefined, + { method: 'GET' } + ); +} + /** @type {RtdSubmodule} */ export const iasSubModule = { name: SUBMODULE_NAME, init: init, - getBidRequestData: getBidRequestData, - getTargetingData: getTargetingData + getTargetingData: getTargetingData, + getBidRequestData: getBidRequestData }; submodule(MODULE_NAME, iasSubModule); diff --git a/test/spec/modules/iasRtdProvider_spec.js b/test/spec/modules/iasRtdProvider_spec.js index e5e12355566..192b2c6e3c3 100644 --- a/test/spec/modules/iasRtdProvider_spec.js +++ b/test/spec/modules/iasRtdProvider_spec.js @@ -1,7 +1,9 @@ -import { iasSubModule } from 'modules/iasRtdProvider.js'; +import { iasSubModule, iasTargeting } from 'modules/iasRtdProvider.js'; import { expect } from 'chai'; import { server } from 'test/mocks/xhr.js'; +const responseHeader = { 'Content-Type': 'application/json' }; + describe('iasRtdProvider is a RTD provider that', function () { it('has the correct module name', function () { expect(iasSubModule.name).to.equal('ias'); @@ -10,8 +12,33 @@ describe('iasRtdProvider is a RTD provider that', function () { it('exists', function () { expect(iasSubModule.init).to.be.a('function'); }); - it('returns true', function () { - expect(iasSubModule.init()).to.equal(true); + it('returns false missing config params', function () { + const config = { + name: 'ias', + waitForIt: true, + }; + const value = iasSubModule.init(config); + expect(value).to.equal(false); + }); + it('returns false missing pubId param', function () { + const config = { + name: 'ias', + waitForIt: true, + params: {} + }; + const value = iasSubModule.init(config); + expect(value).to.equal(false); + }); + it('returns false missing pubId param', function () { + const config = { + name: 'ias', + waitForIt: true, + params: { + pubId: '123456' + } + }; + const value = iasSubModule.init(config); + expect(value).to.equal(true); }); }); describe('has a method `getBidRequestData` that', function () { @@ -30,10 +57,17 @@ describe('iasRtdProvider is a RTD provider that', function () { const adUnitsOriginal = adUnits; iasSubModule.getBidRequestData({ adUnits: adUnits }, callback, config); request = server.requests[0]; - server.respond(); + request.respond(200, responseHeader, JSON.stringify(data)); expect(request.url).to.be.include(`https://pixel.adsafeprotected.com/services/pub?anId=1234`); expect(adUnits).to.length(2); expect(adUnits[0]).to.be.eq(adUnitsOriginal[0]); + const targetingKeys = Object.keys(iasTargeting); + const dataKeys = Object.keys(data); + expect(targetingKeys.length).to.equal(dataKeys.length); + expect(targetingKeys['fr']).to.be.eq(dataKeys['fr']); + expect(targetingKeys['brandSafety']).to.be.eq(dataKeys['brandSafety']); + expect(targetingKeys['ias-kw']).to.be.eq(dataKeys['ias-kw']); + expect(targetingKeys['slots']).to.be.eq(dataKeys['slots']); }); }); @@ -42,10 +76,32 @@ describe('iasRtdProvider is a RTD provider that', function () { expect(iasSubModule.getTargetingData).to.be.a('function'); }); it('invoke method', function () { - const targeting = iasSubModule.getTargetingData(adUnits, config); - expect(adUnits).to.length(2); + const targeting = iasSubModule.getTargetingData(adUnitsCode, config); + expect(adUnitsCode).to.length(2); expect(targeting).to.be.not.null; expect(targeting).to.be.not.empty; + expect(targeting['one-div-id']).to.be.not.null; + const targetingKeys = Object.keys(targeting['one-div-id']); + expect(targetingKeys.length).to.equal(10); + expect(targetingKeys['adt']).to.be.not.null; + expect(targetingKeys['alc']).to.be.not.null; + expect(targetingKeys['dlm']).to.be.not.null; + expect(targetingKeys['drg']).to.be.not.null; + expect(targetingKeys['hat']).to.be.not.null; + expect(targetingKeys['off']).to.be.not.null; + expect(targetingKeys['vio']).to.be.not.null; + expect(targetingKeys['fr']).to.be.not.null; + expect(targetingKeys['ias-kw']).to.be.not.null; + expect(targetingKeys['id']).to.be.not.null; + expect(targeting['one-div-id']['adt']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['alc']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['dlm']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['drg']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['hat']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['off']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['vio']).to.be.eq('veryLow'); + expect(targeting['one-div-id']['fr']).to.be.eq('false'); + expect(targeting['one-div-id']['id']).to.be.eq('4813f7a2-1f22-11ec-9bfd-0a1107f94461'); }); }); }); @@ -58,6 +114,8 @@ const config = { } }; +const adUnitsCode = ['one-div-id', 'two-div-id']; + const adUnits = [ { code: 'one-div-id', @@ -87,3 +145,10 @@ const adUnits = [ } }] }]; + +const data = { + brandSafety: { adt: 'veryLow', alc: 'veryLow', dlm: 'veryLow', drg: 'veryLow', hat: 'veryLow', off: 'veryLow', vio: 'veryLow' }, + custom: { 'ias-kw': ['IAS_5995_KW', 'IAS_7066_KW', 'IAS_7232_KW', 'IAS_7364_KW', 'IAS_3894_KW', 'IAS_6535_KW', 'IAS_6153_KW', 'IAS_5238_KW', 'IAS_7393_KW', 'IAS_1499_KW', 'IAS_7376_KW', 'IAS_1035_KW', 'IAS_6566_KW', 'IAS_1058_KW', 'IAS_11338_724_KW', 'IAS_7301_KW', 'IAS_15969_725_KW', 'IAS_6358_KW', 'IAS_710_KW', 'IAS_5445_KW', 'IAS_3822_KW', 'IAS_4901_KW', 'IAS_5806_KW', 'IAS_460_KW', 'IAS_11461_702_KW', 'IAS_5681_KW', 'IAS_17609_1240_KW', 'IAS_6634_KW', 'IAS_5597_KW'] }, + fr: 'false', + slots: { 'one-div-id': { id: '4813f7a2-1f22-11ec-9bfd-0a1107f94461' } } +}; From 68b21beb67d9f36c46adb0df4bebf7fc810014a7 Mon Sep 17 00:00:00 2001 From: MK Platform <88486298+mediakeys-platform@users.noreply.github.com> Date: Fri, 1 Oct 2021 16:07:52 +0200 Subject: [PATCH 139/250] Mediakeys bid adapter: native and video support (#7452) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Mediatypes native and video support * fix utils reference * add isNumber & isInteger to imports * fix typo in isNumber * Ensure instream tracking sends bidWon event * Use production endpoint Co-authored-by: François Maturel Co-authored-by: Chris Huie --- modules/mediakeysBidAdapter.js | 418 +++++++++++++++- modules/mediakeysBidAdapter.md | 108 +++++ test/spec/modules/mediakeysBidAdapter_spec.js | 457 ++++++++++++++++-- 3 files changed, 918 insertions(+), 65 deletions(-) diff --git a/modules/mediakeysBidAdapter.js b/modules/mediakeysBidAdapter.js index 5b48e732942..ea0ce897395 100644 --- a/modules/mediakeysBidAdapter.js +++ b/modules/mediakeysBidAdapter.js @@ -1,4 +1,5 @@ -import { getWindowTop, isFn, logWarn, getDNT, deepAccess, isArray, inIframe, mergeDeep, isStr, isEmpty, deepSetValue, deepClone, parseUrl, cleanObj, logError, triggerPixel } from '../src/utils.js'; +import find from 'core-js-pure/features/array/find.js'; +import { getWindowTop, isFn, logWarn, getDNT, deepAccess, isArray, inIframe, mergeDeep, isStr, isEmpty, deepSetValue, deepClone, parseUrl, cleanObj, logError, triggerPixel, isInteger, isNumber } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; @@ -8,10 +9,63 @@ const AUCTION_TYPE = 1; const BIDDER_CODE = 'mediakeys'; const ENDPOINT = 'https://prebid.eu-central-1.bidder.mediakeys.io/bids'; const GVLID = 498; -const SUPPORTED_MEDIA_TYPES = [BANNER]; +const SUPPORTED_MEDIA_TYPES = [BANNER, NATIVE, VIDEO]; const DEFAULT_CURRENCY = 'USD'; const NET_REVENUE = true; +const NATIVE_ASSETS_MAPPING = [ + { name: 'title', id: 1, type: 0 }, + { name: 'image', id: 2, type: 3 }, + { name: 'icon', id: 3, type: 1 }, + { name: 'sponsoredBy', id: 5, type: 1 }, + { name: 'body', id: 6, type: 2 }, + { name: 'rating', id: 7, type: 3 }, + { name: 'likes', id: 8, type: 4 }, + { name: 'downloads', id: 9, type: 5 }, + { name: 'price', id: 10, type: 6 }, + { name: 'salePrice', id: 11, type: 7 }, + { name: 'phone', id: 12, type: 8 }, + { name: 'address', id: 13, type: 9 }, + { name: 'body2', id: 14, type: 10 }, + { name: 'displayUrl', id: 15, type: 11 }, + { name: 'cta', id: 16, type: 12 }, +]; + +// This provide a whitelist and a basic validation of OpenRTB native 1.2 options. +// https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf +const ORTB_NATIVE_PARAMS = { + context: value => [1, 2, 3].indexOf(value) !== -1, + plcmttype: value => [1, 2, 3, 4].indexOf(value) !== -1 +}; + +// This provide a whitelist and a basic validation of OpenRTB 2.5 video options. +// https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf +const ORTB_VIDEO_PARAMS = { + mimes: value => Array.isArray(value) && value.length > 0 && value.every(v => typeof v === 'string'), + minduration: value => isInteger(value), + maxduration: value => isInteger(value), + protocols: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].indexOf(v) !== -1), + w: value => isInteger(value), + h: value => isInteger(value), + startdelay: value => isInteger(value), + placement: value => [1, 2, 3, 4, 5].indexOf(value) !== -1, + linearity: value => [1, 2].indexOf(value) !== -1, + skip: value => [0, 1].indexOf(value) !== -1, + skipmin: value => isInteger(value), + skipafter: value => isInteger(value), + sequence: value => isInteger(value), + battr: value => Array.isArray(value) && value.every(v => Array.from({length: 17}, (_, i) => i + 1).indexOf(v) !== -1), + maxextended: value => isInteger(value), + minbitrate: value => isInteger(value), + maxbitrate: value => isInteger(value), + boxingallowed: value => [0, 1].indexOf(value) !== -1, + playbackmethod: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1), + playbackend: value => [1, 2, 3].indexOf(value) !== -1, + delivery: value => [1, 2, 3].indexOf(value) !== -1, + pos: value => [0, 1, 2, 3, 4, 5, 6, 7].indexOf(value) !== -1, + api: value => Array.isArray(value) && value.every(v => [1, 2, 3, 4, 5, 6].indexOf(v) !== -1), +}; + /** * Detects the capability to reach window.top. * @@ -83,6 +137,33 @@ function getFloor(bid, mediaType, size = '*') { return (!isNaN(floor.floor) && floor.currency === DEFAULT_CURRENCY) ? floor.floor : false } +/** + * Returns the highest floor price found when a bid have + * several mediaTypes. + * + * @param {*} bid a Prebid.js bid (request) object + * @returns {number|boolean} + */ +function getHighestFloor(bid) { + const floors = []; + + for (let mediaType in bid.mediaTypes) { + const floor = getFloor(bid, mediaType); + + if (isNumber(floor)) { + floors.push(floor); + } + } + + if (!floors.length) { + return false; + } + + return floors.reduce((a, b) => { + return Math.max(a, b); + }); +} + /** * Returns an openRTB 2.5 object. * This one will be populated at each step of the buildRequest process. @@ -153,6 +234,190 @@ function createBannerImp(bid) { } } +/** + * Returns an openRtb 2.5 native object with a native 1.2 request. + * + * @param {object} bid Prebid bid object from request + * @returns {object} + */ +function createNativeImp(bid) { + if (!bid.nativeParams) { + logWarn(`${BIDDER_CODE}: bid.nativeParams object has not been found.`); + return + } + + const nativeParams = deepClone(bid.nativeParams); + + const nativeAdUnitParams = deepAccess(bid, 'mediaTypes.native', {}); + const nativeBidderParams = deepAccess(bid, 'params.native', {}); + + const extraParams = { + ...nativeAdUnitParams, + ...nativeBidderParams + }; + + const nativeObject = { + ver: '1.2', + context: 1, // overwrited later if needed + plcmttype: 1, // overwrited later if needed + assets: [] + } + + Object.keys(ORTB_NATIVE_PARAMS).forEach(name => { + if (extraParams.hasOwnProperty(name)) { + if (ORTB_NATIVE_PARAMS[name](extraParams[name])) { + nativeObject[name] = extraParams[name]; + } else { + logWarn(`${BIDDER_CODE}: the OpenRTB native param ${name} has been skipped due to misformating. Please refer to OpenRTB Native spec.`); + } + } + }); + + // just a helper function + const setImageAssetSizes = function(asset, param) { + if (param.sizes && param.sizes.length) { + asset.img.w = param.sizes ? param.sizes[0] : undefined; + asset.img.h = param.sizes ? param.sizes[1] : undefined; + } + + if (!asset.img.w) { + asset.img.wmin = 0; + } + + if (!asset.img.h) { + asset.img.hmin = 0; + } + } + + // Prebid.js "image" type support. + // Add some defaults to support special type provided by Prebid.js `mediaTypes.native.type: "image"` + const nativeImageType = deepAccess(bid, 'mediaTypes.native.type'); + if (nativeImageType === 'image') { + // Default value is ones of the recommended by the spec: https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf + nativeParams.title.len = 90; + } + + for (let key in nativeParams) { + if (nativeParams.hasOwnProperty(key)) { + const internalNativeAsset = find(NATIVE_ASSETS_MAPPING, ref => ref.name === key); + if (!internalNativeAsset) { + logWarn(`${BIDDER_CODE}: the asset "${key}" has not been found in Prebid assets map. Skipped for request.`); + continue; + } + + const param = nativeParams[key]; + + const asset = { + id: internalNativeAsset.id, + required: param.required ? 1 : 0 + } + + switch (key) { + case 'title': + if (param.len || param.length) { + asset.title = { + len: param.len || param.length, + ext: param.ext + } + } else { + logWarn(`${BIDDER_CODE}: "title.length" property for native asset is required. Skipped for request.`) + continue; + } + break; + + case 'image': + asset.img = { + type: internalNativeAsset.type, + mimes: param.mimes, + ext: param.ext, + } + + setImageAssetSizes(asset, param); + + break; + case 'icon': + asset.img = { + type: internalNativeAsset.type, + mimes: param.mimes, + ext: param.ext, + } + + setImageAssetSizes(asset, param); + break; + + case 'sponsoredBy': // sponsored + case 'body': // desc + case 'rating': + case 'likes': + case 'downloads': + case 'price': + case 'salePrice': + case 'phone': + case 'address': + case 'body2': // desc2 + case 'displayUrl': + case 'cta': + // generic asset.data + asset.data = { + type: internalNativeAsset.type, + len: param.len, + ext: param.ext + } + break; + } + + nativeObject.assets.push(asset); + } + } + + if (nativeObject.assets.length) { + return { + request: nativeObject + } + } +} + +/** + * Returns an openRtb 2.5 video object. + * + * @param {object} bid Prebid bid object from request + * @returns {object} + */ +function createVideoImp(bid) { + const videoAdUnitParams = deepAccess(bid, 'mediaTypes.video', {}); + const videoBidderParams = deepAccess(bid, 'params.video', {}); + const computedParams = {}; + + // Special case for playerSize. + // Eeach props will be overrided if they are defined in config. + if (Array.isArray(videoAdUnitParams.playerSize)) { + const tempSize = (Array.isArray(videoAdUnitParams.playerSize[0])) ? videoAdUnitParams.playerSize[0] : videoAdUnitParams.playerSize; + computedParams.w = tempSize[0]; + computedParams.h = tempSize[1]; + } + + const videoParams = { + ...computedParams, + ...videoAdUnitParams, + ...videoBidderParams + }; + + const video = {}; + + // Only whitelisted OpenRTB options need to be validated. + Object.keys(ORTB_VIDEO_PARAMS).forEach(name => { + if (videoParams.hasOwnProperty(name)) { + if (ORTB_VIDEO_PARAMS[name](videoParams[name])) { + video[name] = videoParams[name]; + } else { + logWarn(`${BIDDER_CODE}: the OpenRTB video param ${name} has been skipped due to misformating. Please refer to OpenRTB 2.5 spec.`); + } + } + }); + + return video +} + /** * Create the OpenRTB 2.5 imp object. * @@ -167,20 +432,34 @@ function createImp(bid) { secure: 1, }; + // There is no default floor. bidfloor is set only + // if the priceFloors module is activated and returns a valid floor. + const floor = getHighestFloor(bid); + if (isNumber(floor)) { + imp.bidfloor = floor; + } + // Only supports proper mediaTypes definition… for (let mediaType in bid.mediaTypes) { - // There is no default floor. bidfloor is set only - // if the priceFloors module is activated and returns a valid floor. - const floor = getFloor(bid, mediaType); - if (floor) { - imp.bidfloor = floor; - } - - if (mediaType === BANNER) { - const banner = createBannerImp(bid); - if (banner) { - imp.banner = banner; - } + switch (mediaType) { + case BANNER: + const banner = createBannerImp(bid); + if (banner) { + imp.banner = banner; + } + break; + case NATIVE: + const native = createNativeImp(bid); + if (native) { + imp.native = native; + } + break; + case VIDEO: + const video = createVideoImp(bid); + if (video) { + imp.video = video; + } + break; } } @@ -213,6 +492,94 @@ function getPrimaryCatFromResponse(cat) { } } +/** + * Create the Prebid.js native object from response. + * + * @param {*} bid bid object from response + * @returns {object} Prebid.js native object used in response + */ +function nativeBidResponseHandler(bid) { + const nativeAdm = JSON.parse(bid.adm); + if (!nativeAdm || !nativeAdm.assets.length) { + logError(`${BIDDER_CODE}: invalid native response.`); + return; + } + + const native = {} + + nativeAdm.assets.forEach(asset => { + if (asset.title) { + native.title = asset.title.text; + return; + } + + if (asset.img) { + switch (asset.img.type) { + case 1: + native.icon = { + url: asset.img.url, + width: asset.img.w, + height: asset.img.h + }; + break; + default: + native.image = { + url: asset.img.url, + width: asset.img.w, + height: asset.img.h + }; + break; + } + return; + } + + if (asset.data) { + const internalNativeAsset = find(NATIVE_ASSETS_MAPPING, ref => ref.id === asset.id); + if (internalNativeAsset) { + native[internalNativeAsset.name] = asset.data.value; + } + } + }); + + if (nativeAdm.link) { + if (nativeAdm.link.url) { + native.clickUrl = nativeAdm.link.url; + } + if (Array.isArray(nativeAdm.link.clicktrackers)) { + native.clickTrackers = nativeAdm.link.clicktrackers + } + } + + if (Array.isArray(nativeAdm.eventtrackers)) { + native.impressionTrackers = []; + nativeAdm.eventtrackers.forEach(tracker => { + // Only Impression events are supported. Prebid does not support Viewability events yet. + if (tracker.event !== 1) { + return; + } + + // methods: + // 1: image + // 2: js + // note: javascriptTrackers is a string. If there's more than one JS tracker in bid response, the last script will be used. + switch (tracker.method) { + case 1: + native.impressionTrackers.push(tracker.url); + break; + case 2: + native.javascriptTrackers = ``; + break; + } + }); + } + + if (nativeAdm.privacy) { + native.privacyLink = nativeAdm.privacy; + } + + return native; +} + export const spec = { code: BIDDER_CODE, @@ -355,6 +722,29 @@ export const spec = { meta: cleanObj(meta) }; + if (mediaType === NATIVE) { + const native = nativeBidResponseHandler(bid); + if (native) { + newBid.native = native; + } + } + + if (mediaType === VIDEO) { + // Note: + // Mediakeys bid adapter expects a publisher has set his own video player + // in the `mediaTypes.video` configuration object. + + // Mediakeys bidder does not provide inline XML in the bid response + // newBid.vastXml = bid.ext.vast_url; + + // For instream video, disable server cache as vast is generated per bid request + newBid.videoCacheKey = 'no_cache'; + + // The vast URL is server independently and must be fetched before video rendering in the renderer + // appending '&no_cache' is safe and fast as the vast url always have parameters + newBid.vastUrl = bid.ext.vast_url + '&no_cache'; + } + bidResponses.push(newBid); }); }); diff --git a/modules/mediakeysBidAdapter.md b/modules/mediakeysBidAdapter.md index 75e69659c8a..ec313c2fe3a 100644 --- a/modules/mediakeysBidAdapter.md +++ b/modules/mediakeysBidAdapter.md @@ -29,3 +29,111 @@ var adUnits = [ }] }, ``` + +## Native only Ad Unit + +The Mediakeys adapter accepts two optional params for native requests. Please see the [OpenRTB Native Ads Specification](https://www.iab.com/wp-content/uploads/2018/03/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) for valid values. + +``` +var adUnits = [ +{ + code: 'test', + mediaTypes: { + native: { + type: 'image', + } + }, + bids: [{ + bidder: 'mediakeys', + params: { + native: { + context: 1, // ORTB Native Context Type IDs. Default `1`. + plcmttype: 1, // ORTB Native Placement Type IDs. Default `1`. + } + } + }] +}, +``` + +## Video only Ad Unit + +The Mediakeys adapter accepts any valid openRTB 2.5 video property. Properties can be defined at the adUnit `mediaTypes.video` or `bid[].params` level. + +### Outstream context + +``` +var adUnits = [ +{ + code: 'test', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [300, 250], + // additional OpenRTB video params + // placement: 2, + // api: [1], + // … + } + }, + renderer: { + url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js', + render: function (bid) { + var bidReqConfig = pbjs.adUnits.find(bidReq => bidReq.bidId === bid.impid); + + if (bidReqConfig && bidReqConfig.mediaTypes && bidReqConfig.mediaTypes.video && bidReqConfig.mediaTypes.video.context === 'outstream') { + var adResponse = fetch(bid.vastUrl).then(resp => resp.text()).then(text => ({ + ad: { + video: { + content: text, + player_width: bid.width || bidReqConfig.mediaTypes.video.playerSize[0], + player_height: bid.height || bidReqConfig.mediaTypes.video.playerSize[1], + } + } + })) + + adResponse.then((ad) => { + bid.renderer.push(() => { + ANOutstreamVideo.renderAd({ + targetId: bid.adUnitCode, + adResponse: ad + }); + }); + }) + } + } + }, + bids: [{ + bidder: 'mediakeys', + params: { + video: { + // additional OpenRTB video params. Will be merged with params defined at mediaTypes level + } + } + }] +}, +``` + +### Instream context + +``` +var adUnits = [ +{ + code: 'test', + mediaTypes: { + video: { + context: 'instream', + playerSize: [300, 250], + // additional OpenRTB video params + // placement: 2, + // api: [1], + // … + } + }, + bids: [{ + bidder: 'mediakeys', + params: { + // additional OpenRTB video params. Will be merged with params defined at mediaTypes level + } + }] +}, +``` diff --git a/test/spec/modules/mediakeysBidAdapter_spec.js b/test/spec/modules/mediakeysBidAdapter_spec.js index 040c0abd566..602524e6eb3 100644 --- a/test/spec/modules/mediakeysBidAdapter_spec.js +++ b/test/spec/modules/mediakeysBidAdapter_spec.js @@ -1,9 +1,11 @@ import { expect } from 'chai'; +import find from 'core-js-pure/features/array/find.js'; import { spec } from 'modules/mediakeysBidAdapter.js'; import { newBidder } from 'src/adapters/bidderFactory.js'; import * as utils from 'src/utils.js'; import { config } from 'src/config.js'; import { BANNER, NATIVE, VIDEO } from '../../../src/mediaTypes.js'; +import { OUTSTREAM } from '../../../src/video.js'; describe('mediakeysBidAdapter', function () { const adapter = newBidder(spec); @@ -39,39 +41,100 @@ describe('mediakeysBidAdapter', function () { } }; + const bidNative = { + bidder: 'mediakeys', + params: {}, + mediaTypes: { + native: { + body: { + required: true + }, + title: { + required: true, + len: 800 + }, + sponsoredBy: { + required: true + }, + body2: { + required: true + }, + image: { + required: true, + sizes: [[300, 250], [300, 600], [100, 150]], + }, + icon: { + required: true, + sizes: [50, 50], + }, + }, + }, + nativeParams: { + body: { + required: true + }, + title: { + required: true, + len: 800 + }, + sponsoredBy: { + required: true + }, + body2: { + required: true + }, + image: { + required: true, + sizes: [[300, 250], [300, 600], [100, 150]], + }, + icon: { + required: true, + sizes: [50, 50], + }, + }, + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: '47789656-9e5c-4250-b7e0-2ce4cbe71a55', + bidId: '299320f4de980d', + bidderRequestId: '1c1b642f803242', + auctionId: '84212956-c377-40e8-b000-9885a06dc692', + src: 'client', + bidRequestsCount: 1, + bidderRequestsCount: 1, + bidderWinsCount: 0, + ortb2Imp: { + ext: { data: { something: 'test' } } + } + }; + + const bidVideo = { + bidder: 'mediakeys', + params: {}, + mediaTypes: { + video: { + context: OUTSTREAM, + playerSize: [480, 320] + } + }, + adUnitCode: 'div-gpt-ad-1460505748561-0', + transactionId: '47789656-9e5c-4250-b7e0-2ce4cbe71a55', + bidId: '299320f4de980d', + bidderRequestId: '1c1b642f803242', + auctionId: '84212956-c377-40e8-b000-9885a06dc692', + src: 'client', + bidRequestsCount: 1, + bidderRequestsCount: 1, + bidderWinsCount: 0, + ortb2Imp: { + ext: { data: { something: 'test' } } + } + }; + const bidderRequest = { bidderCode: 'mediakeys', auctionId: '84212956-c377-40e8-b000-9885a06dc692', bidderRequestId: '1c1b642f803242', bids: [ - { - bidder: 'mediakeys', - params: {}, - mediaTypes: { - banner: { - sizes: [ - [300, 250], - [300, 600], - ], - }, - }, - adUnitCode: 'div-gpt-ad-1460505748561-0', - transactionId: '47789656-9e5c-4250-b7e0-2ce4cbe71a55', - sizes: [ - [300, 250], - [300, 600], - ], - bidId: '299320f4de980d', - bidderRequestId: '1c1b642f803242', - auctionId: '84212956-c377-40e8-b000-9885a06dc692', - src: 'client', - bidRequestsCount: 1, - bidderRequestsCount: 1, - bidderWinsCount: 0, - ortb2Imp: { - ext: { data: { something: 'test' } } - } - }, + bid ], auctionStart: 1620973766319, timeout: 1000, @@ -116,23 +179,25 @@ describe('mediakeysBidAdapter', function () { it('should create imp for supported mediaType only', function() { const bidRequests = [utils.deepClone(bid)]; const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; bidRequests[0].mediaTypes.video = { playerSize: [300, 250], - context: 'outstream' + context: OUTSTREAM } - bidRequests[0].mediaTypes.native = { - type: 'image' - } + bidRequests[0].mediaTypes.native = bidNative.mediaTypes.native; + bidRequests[0].nativeParams = bidNative.mediaTypes.native; + + bidderRequestCopy.bids = bidRequests[0]; const request = spec.buildRequests(bidRequests, bidderRequestCopy); const data = request.data; expect(data.imp.length).to.equal(1); expect(data.imp[0].banner).to.exist; - expect(data.imp[0].video).to.not.exist; - expect(data.imp[0].native).to.not.exist; + expect(data.imp[0].video).to.exist; + expect(data.imp[0].native).to.exist; }); it('should get expected properties with default values (no params set)', function () { @@ -161,6 +226,205 @@ describe('mediakeysBidAdapter', function () { expect(data.imp[0].ext.data.something).to.equal('test'); }); + describe('native imp', function() { + it('should get a native object in request', function() { + const bidRequests = [utils.deepClone(bidNative)]; + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].native).to.exist; + expect(data.imp[0].native.request.ver).to.equal('1.2'); + expect(data.imp[0].native.request.context).to.equal(1); + expect(data.imp[0].native.request.plcmttype).to.equal(1); + expect(data.imp[0].native.request.assets.length).to.equal(6); + // find the asset body + const bodyAsset = find(data.imp[0].native.request.assets, asset => asset.id === 6); + expect(bodyAsset.data.type).to.equal(2); + }); + + it('should get a native object in request with properties filled with params values', function() { + const bidRequests = [utils.deepClone(bidNative)]; + bidRequests[0].params = { + native: { + context: 3, + plcmttype: 3, + } + } + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].native).to.exist; + expect(data.imp[0].native.request.ver).to.equal('1.2'); + expect(data.imp[0].native.request.context).to.equal(3); + expect(data.imp[0].native.request.plcmttype).to.equal(3); + expect(data.imp[0].native.request.assets.length).to.equal(6); + }); + + it('should get a native object in request when native type ,image" has been set', function() { + const bidRequests = [utils.deepClone(bidNative)]; + bidRequests[0].mediaTypes.native = { type: 'image' }; + bidRequests[0].nativeParams = { + image: { required: true }, + title: { required: true }, + sponsoredBy: { required: true }, + clickUrl: { required: true }, // [1] Will be ignored as it is used in response validation only + body: { required: false }, + icon: { required: false }, + }; + + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].native).to.exist; + expect(data.imp[0].native.request.ver).to.equal('1.2'); + expect(data.imp[0].native.request.context).to.equal(1); + expect(data.imp[0].native.request.plcmttype).to.equal(1); + expect(data.imp[0].native.request.assets.length).to.equal(5); // [1] clickUrl ignored + }); + + it('should log errors and ignore misformated assets', function() { + const bidRequests = [utils.deepClone(bidNative)]; + delete bidRequests[0].nativeParams.title.len; + bidRequests[0].nativeParams.unregistred = {required: true}; + + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + utilsMock.expects('logWarn').twice(); + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].native).to.exist; + expect(data.imp[0].native.request.assets.length).to.equal(5); + }); + }); + + describe('video imp', function() { + it('should get a video object in request', function() { + const bidRequests = [utils.deepClone(bidVideo)]; + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].banner).to.not.exist; + expect(data.imp[0].video).to.exist; + expect(data.imp[0].video.w).to.equal(480); + expect(data.imp[0].video.h).to.equal(320); + }); + + it('should ignore and warn misformated ORTB video properties', function() { + const bidRequests = [utils.deepClone(bidVideo)]; + bidRequests[0].mediaTypes.video.unknown = 'foo'; + bidRequests[0].mediaTypes.video.placement = 10; + bidRequests[0].mediaTypes.video.skipmin = 5; + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].banner).to.not.exist; + expect(data.imp[0].video).to.exist; + expect(data.imp[0].video.w).to.equal(480); + expect(data.imp[0].video.h).to.equal(320); + expect(data.imp[0].video.skipmin).to.equal(5); + expect(data.imp[0].video.placement).to.not.exist; + expect(data.imp[0].video.unknown).to.not.exist; + }); + + it('should merge adUnit mediaTypes level and bidder level params properties ', function() { + const bidRequests = [utils.deepClone(bidVideo)]; + bidRequests[0].mediaTypes.video.placement = 1; + bidRequests[0].mediaTypes.video.mimes = ['video/mpeg4']; + bidRequests[0].mediaTypes.video.protocols = [1]; + bidRequests[0].mediaTypes.video.minduration = 10; + bidRequests[0].mediaTypes.video.maxduration = 45; + bidRequests[0].mediaTypes.video.skipmin = 5; + bidRequests[0].mediaTypes.video.sequence = 3; + bidRequests[0].mediaTypes.video.linearity = 1; + bidRequests[0].mediaTypes.video.battr = [12]; + bidRequests[0].mediaTypes.video.maxextended = 10; + bidRequests[0].mediaTypes.video.minbitrate = 720; + bidRequests[0].mediaTypes.video.maxbitrate = 720; + bidRequests[0].mediaTypes.video.boxingallowed = 1; + bidRequests[0].mediaTypes.video.playbackmethod = [1]; + bidRequests[0].mediaTypes.video.playbackend = 2; + bidRequests[0].mediaTypes.video.delivery = 2; + bidRequests[0].mediaTypes.video.pos = 0; + bidRequests[0].mediaTypes.video.companionad = [{ w: 360, h: 80 }] + bidRequests[0].mediaTypes.video.api = [1]; + bidRequests[0].mediaTypes.video.companiontype = [1]; + + // bidder level + bidRequests[0].params.video = { + pos: 2, // override + skip: 1, + skipafter: 10, + startdelay: 3 + }; + + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + utilsMock.expects('logWarn').never(); + + const request = spec.buildRequests(bidRequests, bidderRequestCopy); + const data = request.data; + + expect(data.imp.length).to.equal(1); + expect(data.imp[0].id).to.equal(bidRequests[0].bidId); + expect(data.imp[0].banner).to.not.exist; + expect(data.imp[0].video).to.exist; + + expect(Object.keys(data.imp[0].video).length).to.equal(23); // 21 ortb params (2 skipped) + computed width/height. + expect(data.imp[0].video.w).to.equal(480); + expect(data.imp[0].video.h).to.equal(320); + expect(data.imp[0].video.mimes[0]).to.equal('video/mpeg4'); + expect(data.imp[0].video.pos).to.equal(2); + expect(data.imp[0].video.skip).to.equal(1); + expect(data.imp[0].video.skipafter).to.equal(10); + expect(data.imp[0].video.startdelay).to.equal(3); + expect(data.imp[0].video.companionad).to.not.exist; + expect(data.imp[0].video.companiontype).to.not.exist; + }); + + it('should log warn message when OpenRTB validation fails ', function() { + const bidRequests = [utils.deepClone(bidVideo)]; + bidRequests[0].mediaTypes.video.placement = 'string'; + bidRequests[0].mediaTypes.video.api = 1; + const bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + utilsMock.expects('logWarn').twice(); + + spec.buildRequests(bidRequests, bidderRequestCopy); + }); + }); + it('should get expected properties with values from params', function () { const bidRequests = [utils.deepClone(bid)]; bidRequests[0].params = { @@ -265,13 +529,25 @@ describe('mediakeysBidAdapter', function () { expect(data.imp[0].bidfloor).to.not.exist; }); - it('should get and set floor by mediatype', function() { + it('should get the highest floorPrice found when bid have several mediaTypes', function() { const bidWithPriceFloors = utils.deepClone(bid); bidWithPriceFloors.mediaTypes.video = { playerSize: [600, 480] }; + bidWithPriceFloors.mediaTypes.native = { + body: { + required: true + } + }; + + bidWithPriceFloors.nativeParams = { + body: { + required: true + } + }; + bidWithPriceFloors.getFloor = getFloorTest; const bidRequests = [bidWithPriceFloors]; @@ -279,10 +555,9 @@ describe('mediakeysBidAdapter', function () { const data = request.data; expect(data.imp[0].banner).to.exist; - expect(data.imp[0].bidfloor).to.equal(1); - - // expect(data.imp[1].video).to.exist; - // expect(data.imp[1].bidfloor).to.equal(5); + expect(data.imp[0].video).to.exist; + expect(data.imp[0].native).to.exist; + expect(data.imp[0].bidfloor).to.equal(5); }); it('should set properties at payload level from FPD', function() { @@ -420,8 +695,8 @@ describe('mediakeysBidAdapter', function () { const bidRequests = [utils.deepClone(bid)]; const request = spec.buildRequests(bidRequests, bidderRequest); sinon.stub(utils, 'isArray').throws(); - spec.interpretResponse(rawServerResponse, request); utilsMock.expects('logError').once(); + spec.interpretResponse(rawServerResponse, request); utils.isArray.restore(); }); @@ -483,28 +758,108 @@ describe('mediakeysBidAdapter', function () { }); }); - it('Build video response', function () { - const bidRequests = [utils.deepClone(bid)]; + it('interprets video bid response', function () { + const vastUrl = 'https://url.local?req=content'; + const bidRequests = [utils.deepClone(bidVideo)]; const request = spec.buildRequests(bidRequests, bidderRequest); + const rawServerResponseVideo = utils.deepClone(rawServerResponse); rawServerResponseVideo.body.seatbid[0].bid[0].ext.prebid.type = 'V'; + rawServerResponseVideo.body.seatbid[0].bid[0].ext.vast_url = vastUrl; + const response = spec.interpretResponse(rawServerResponseVideo, request); expect(response.length).to.equal(1); expect(response[0].mediaType).to.equal('video'); expect(response[0].meta.mediaType).to.equal('video'); + expect(response[0].vastXml).to.not.exist; + expect(response[0].vastUrl).to.equal(vastUrl + '&no_cache'); + expect(response[0].videoCacheKey).to.equal('no_cache'); }); - it('Build native response', function () { - const bidRequests = [utils.deepClone(bid)]; - const request = spec.buildRequests(bidRequests, bidderRequest); - const rawServerResponseVideo = utils.deepClone(rawServerResponse); - rawServerResponseVideo.body.seatbid[0].bid[0].ext.prebid.type = 'N'; - const response = spec.interpretResponse(rawServerResponseVideo, request); + describe('Native response', function () { + let bidRequests; + let bidderRequestCopy; + let request; + let rawServerResponseNative; + let nativeObject; + + beforeEach(function() { + bidRequests = [utils.deepClone(bidNative)]; + bidderRequestCopy = utils.deepClone(bidderRequest); + bidderRequestCopy.bids = bidRequests; + + request = spec.buildRequests(bidRequests, bidderRequestCopy); + + nativeObject = { + ver: '1.2', + privacy: 'https://privacy.me', + assets: [ + { id: 5, data: { type: 1, value: 'Sponsor Brand' } }, + { id: 6, data: { type: 2, value: 'Brand Body' } }, + { id: 14, data: { type: 10, value: 'Brand Body 2' } }, + { id: 1, title: { text: 'Brand Title' } }, + { id: 2, img: { type: 3, url: 'https://url.com/img.jpg', w: 300, h: 250 } }, + { id: 3, img: { type: 1, url: 'https://url.com/ico.png', w: 50, h: 50 } }, + ], + link: { + url: 'https://brand.me', + clicktrackers: [ + 'https://click.me' + ] + }, + eventtrackers: [ + { event: 1, method: 1, url: 'https://click.me' }, + { event: 1, method: 2, url: 'https://click-script.me' } + ] + }; - expect(response.length).to.equal(1); - expect(response[0].mediaType).to.equal('native'); - expect(response[0].meta.mediaType).to.equal('native'); + rawServerResponseNative = utils.deepClone(rawServerResponse); + rawServerResponseNative.body.seatbid[0].bid[0].ext.prebid.type = 'N'; + rawServerResponseNative.body.seatbid[0].bid[0].adm = JSON.stringify(nativeObject) + }); + + it('should ignore invalid native response', function() { + const nativeObjectCopy = utils.deepClone(nativeObject); + nativeObjectCopy.assets = []; + const rawServerResponseNativeCopy = utils.deepClone(rawServerResponseNative); + rawServerResponseNativeCopy.body.seatbid[0].bid[0].adm = JSON.stringify(nativeObjectCopy) + const response = spec.interpretResponse(rawServerResponseNativeCopy, request); + expect(response.length).to.equal(1); + expect(response[0].native).to.not.exist; + }); + + it('should build a classic Prebid.js native object for response', function() { + const rawServerResponseNativeCopy = utils.deepClone(rawServerResponseNative); + const response = spec.interpretResponse(rawServerResponseNativeCopy, request); + expect(response.length).to.equal(1); + expect(response[0].mediaType).to.equal('native'); + expect(response[0].meta.mediaType).to.equal('native'); + expect(response[0].native).to.exist; + expect(response[0].native.body).to.exist; + expect(response[0].native.privacyLink).to.exist; + expect(response[0].native.body2).to.exist; + expect(response[0].native.sponsoredBy).to.exist; + expect(response[0].native.image).to.exist; + expect(response[0].native.icon).to.exist; + expect(response[0].native.title).to.exist; + expect(response[0].native.clickUrl).to.exist; + expect(response[0].native.clickTrackers).to.exist; + expect(response[0].native.clickTrackers.length).to.equal(1); + expect(response[0].native.javascriptTrackers).to.equal(''); + expect(response[0].native.impressionTrackers).to.exist; + expect(response[0].native.impressionTrackers.length).to.equal(1); + }); + + it('should ignore eventtrackers with a unsupported type', function() { + const rawServerResponseNativeCopy = utils.deepClone(rawServerResponseNative); + const nativeObjectCopy = utils.deepClone(nativeObject); + nativeObjectCopy.eventtrackers[0].event = 2; + rawServerResponseNativeCopy.body.seatbid[0].bid[0].adm = JSON.stringify(nativeObjectCopy); + const response = spec.interpretResponse(rawServerResponseNativeCopy, request); + expect(response[0].native.impressionTrackers).to.exist; + expect(response[0].native.impressionTrackers.length).to.equal(0); + }) }); }); From 35c1db85bcdb7c892c4e7530d145b88d0b90e37f Mon Sep 17 00:00:00 2001 From: Stephen Johnston Date: Fri, 1 Oct 2021 12:09:53 -0400 Subject: [PATCH 140/250] Prebid Core: Support for Devcontainer for VSCode, Docker Desktop, Codespaces, etc. (#7487) * support common ports, add chrome headless for testing * change Dockefile variant to match passed in variant initially --- .devcontainer/Dockerfile | 11 +++++++++++ .devcontainer/devcontainer.json | 27 +++++++++++++++++++++++++++ .devcontainer/postCreate.sh | 6 ++++++ 3 files changed, 44 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/postCreate.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..cfb29ebdfa9 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,11 @@ +ARG VARIANT="12" +FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT} + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - +RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list +RUN apt update +RUN apt install -y google-chrome-stable xvfb diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..0176b8317b3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/main/containers/javascript-node +{ + "name": "Ubuntu", + + "build": { + "dockerfile": "Dockerfile", + "args": { "VARIANT": "12" } + }, + + "postCreateCommand": "bash .devcontainer/postCreate.sh", + + // Set *default* container specific settings.json values on container create. + "settings": {}, + + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "nickdodd79.gulptasks" + ], + + // 9999 is web server, 9876 is karma + "forwardPorts": [9876, 9999], + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node" +} diff --git a/.devcontainer/postCreate.sh b/.devcontainer/postCreate.sh new file mode 100644 index 00000000000..7e14a2d200d --- /dev/null +++ b/.devcontainer/postCreate.sh @@ -0,0 +1,6 @@ +echo "Post Create Starting" + +nvm install +nvm use +npm install gulp-cli -g +npm ci From c6e74d2848136701ef286da4298d45dfdb143494 Mon Sep 17 00:00:00 2001 From: mamatic <52153441+mamatic@users.noreply.github.com> Date: Mon, 4 Oct 2021 10:58:30 +0200 Subject: [PATCH 141/250] Ats Analytics Adapter: handle preflight request error & increase _lr_sample_rate cookie expiration (#7462) * ATS-analytics-adapter - increase sampling rate cookie expiration time, handle error on preflight request * ATS-analytics-adapter - increase adapter version to 2 * ATS-analytics-adapter - fix logs * ATS-analytics-adapter - add unit tests * ATS-analytics-adapter - code improvements, add more unit tests --- modules/atsAnalyticsAdapter.js | 45 ++++++++++--------- test/spec/modules/atsAnalyticsAdapter_spec.js | 39 +++++++++++++++- 2 files changed, 62 insertions(+), 22 deletions(-) diff --git a/modules/atsAnalyticsAdapter.js b/modules/atsAnalyticsAdapter.js index df293556a4c..d1e520b4b8f 100644 --- a/modules/atsAnalyticsAdapter.js +++ b/modules/atsAnalyticsAdapter.js @@ -13,9 +13,6 @@ export const storage = getStorageManager(); */ const analyticsType = 'endpoint'; -// dev endpoints -// const preflightUrl = 'https://analytics-check.publishersite.xyz/check/'; -// export const analyticsUrl = 'https://analyticsv2.publishersite.xyz'; const preflightUrl = 'https://check.analytics.rlcdn.com/check/'; export const analyticsUrl = 'https://analytics.rlcdn.com'; @@ -23,7 +20,7 @@ export const analyticsUrl = 'https://analytics.rlcdn.com'; let handlerRequest = []; let handlerResponse = []; -let atsAnalyticsAdapterVersion = 1; +let atsAnalyticsAdapterVersion = 2; let browsersList = [ /* Googlebot */ @@ -207,12 +204,6 @@ let browsersList = [ }, ]; -function setSamplingCookie(samplRate) { - let now = new Date(); - now.setTime(now.getTime() + 3600000); - storage.setCookie('_lr_sampling_rate', samplRate, now.toUTCString()); -} - let listOfSupportedBrowsers = ['Safari', 'Chrome', 'Firefox', 'Microsoft Edge']; function bidRequestedHandler(args) { @@ -276,16 +267,23 @@ function sendDataToAnalytic () { // preflight request, to check did publisher have permission to send data to analytics endpoint function preflightRequest (envelopeSourceCookieValue) { logInfo('ATS Analytics - preflight request!'); - ajax(preflightUrl + atsAnalyticsAdapter.context.pid, function (data) { - let samplingRateObject = JSON.parse(data); - logInfo('ATS Analytics - Sampling Rate: ', samplingRateObject); - let samplingRate = samplingRateObject['samplingRate']; - setSamplingCookie(samplingRate); - let samplingRateNumber = Number(samplingRate); - if (data && samplingRate && atsAnalyticsAdapter.shouldFireRequest(samplingRateNumber) && envelopeSourceCookieValue != null) { - sendDataToAnalytic(); - } - }, undefined, { method: 'GET', crossOrigin: true }); + ajax(preflightUrl + atsAnalyticsAdapter.context.pid, + { + success: function (data) { + let samplingRateObject = JSON.parse(data); + logInfo('ATS Analytics - Sampling Rate: ', samplingRateObject); + let samplingRate = samplingRateObject.samplingRate; + atsAnalyticsAdapter.setSamplingCookie(samplingRate); + let samplingRateNumber = Number(samplingRate); + if (data && samplingRate && atsAnalyticsAdapter.shouldFireRequest(samplingRateNumber) && envelopeSourceCookieValue != null) { + sendDataToAnalytic(); + } + }, + error: function () { + atsAnalyticsAdapter.setSamplingCookie(0); + logInfo('ATS Analytics - Sampling Rate Request Error!'); + } + }, undefined, {method: 'GET', crossOrigin: true}); } function callHandler(evtype, args) { @@ -356,6 +354,13 @@ atsAnalyticsAdapter.shouldFireRequest = function (samplingRate) { atsAnalyticsAdapter.getUserAgent = function () { return window.navigator.userAgent; }; + +atsAnalyticsAdapter.setSamplingCookie = function (samplRate) { + const now = new Date(); + now.setTime(now.getTime() + 86400000); + storage.setCookie('_lr_sampling_rate', samplRate, now.toUTCString()); +} + // override enableAnalytics so we can get access to the config passed in from the page atsAnalyticsAdapter.enableAnalytics = function (config) { if (!config.options.pid) { diff --git a/test/spec/modules/atsAnalyticsAdapter_spec.js b/test/spec/modules/atsAnalyticsAdapter_spec.js index e2dd4747199..7f662ffd06d 100644 --- a/test/spec/modules/atsAnalyticsAdapter_spec.js +++ b/test/spec/modules/atsAnalyticsAdapter_spec.js @@ -5,16 +5,18 @@ import {server} from '../../mocks/xhr.js'; import {parseBrowser} from '../../../modules/atsAnalyticsAdapter.js'; import {getStorageManager} from '../../../src/storageManager.js'; import {analyticsUrl} from '../../../modules/atsAnalyticsAdapter.js'; +let utils = require('src/utils'); let events = require('src/events'); let constants = require('src/constants.json'); export const storage = getStorageManager(); - +let sandbox; describe('ats analytics adapter', function () { beforeEach(function () { sinon.stub(events, 'getEvents').returns([]); storage.setCookie('_lr_env_src_ats', 'true', 'Thu, 01 Jan 1970 00:00:01 GMT'); + sandbox = sinon.sandbox.create(); }); afterEach(function () { @@ -22,6 +24,7 @@ describe('ats analytics adapter', function () { atsAnalyticsAdapter.getUserAgent.restore(); atsAnalyticsAdapter.disableAnalytics(); Math.random.restore(); + sandbox.restore(); }); describe('track', function () { @@ -87,7 +90,7 @@ describe('ats analytics adapter', function () { let expectedAfterBid = { 'Data': [{ 'has_envelope': true, - 'adapter_version': 1, + 'adapter_version': 2, 'bidder': 'appnexus', 'bid_id': '30c77d079cdf17', 'auction_id': 'a5b849e5-87d7-4205-8300-d063084fcfb7', @@ -185,6 +188,12 @@ describe('ats analytics adapter', function () { let browser = parseBrowser(); expect(browser).to.equal('Firefox'); }) + it('check browser is unknown', function () { + sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns(undefined); + sinon.stub(Math, 'random').returns(0.99); + let browser = parseBrowser(); + expect(browser).to.equal('Unknown'); + }) it('should not fire analytics request if sampling rate is 0', function () { sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); sinon.stub(Math, 'random').returns(0.99); @@ -205,5 +214,31 @@ describe('ats analytics adapter', function () { let result = atsAnalyticsAdapter.shouldFireRequest(10); expect(result).to.equal(false); }) + + it('should set cookie value to 10 for _lr_sampling_rate', function () { + sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); + sinon.stub(Math, 'random').returns(0.99); + atsAnalyticsAdapter.setSamplingCookie(10); + let samplingRate = storage.getCookie('_lr_sampling_rate'); + expect(samplingRate).to.equal('10'); + }) + + it('should set cookie value to 0 for _lr_sampling_rate', function () { + sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); + sinon.stub(Math, 'random').returns(0.99); + atsAnalyticsAdapter.setSamplingCookie(0); + let samplingRate = storage.getCookie('_lr_sampling_rate'); + expect(samplingRate).to.equal('0'); + }) + + it('enable analytics', function () { + sandbox.stub(utils, 'logError'); + sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); + sinon.stub(Math, 'random').returns(0.99); + atsAnalyticsAdapter.enableAnalytics({ + options: {} + }); + expect(utils.logError.called).to.equal(true); + }) }) }) From f62ad030f4927277149dfe183c35d37df84008ef Mon Sep 17 00:00:00 2001 From: Amanda Dillon <41923726+agdillon@users.noreply.github.com> Date: Mon, 4 Oct 2021 06:21:22 -0600 Subject: [PATCH 142/250] SpotX: add support for price floors module (#7481) --- modules/spotxBidAdapter.js | 16 +++++++++- test/spec/modules/spotxBidAdapter_spec.js | 36 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/modules/spotxBidAdapter.js b/modules/spotxBidAdapter.js index 7111aa7e7ce..7d5865684a7 100644 --- a/modules/spotxBidAdapter.js +++ b/modules/spotxBidAdapter.js @@ -1,4 +1,4 @@ -import { logError, deepAccess, isArray, getBidIdParameter, getDNT, deepSetValue, isEmpty, _each, logMessage, logWarn, isBoolean, isNumber, isPlainObject } from '../src/utils.js'; +import { logError, deepAccess, isArray, getBidIdParameter, getDNT, deepSetValue, isEmpty, _each, logMessage, logWarn, isBoolean, isNumber, isPlainObject, isFn } from '../src/utils.js'; import { config } from '../src/config.js'; import { Renderer } from '../src/Renderer.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; @@ -163,6 +163,20 @@ export const spec = { } }; + if (isFn(bid.getFloor)) { + let floorInfo = bid.getFloor({ + currency: 'USD', + mediaType: 'video', + size: '*' + }); + + if (floorInfo.currency === 'USD') { + spotxReq.bidfloor = floorInfo.floor; + } + } else if (getBidIdParameter('price_floor', bid.params) != '') { + spotxReq.bidfloor = getBidIdParameter('price_floor', bid.params); + } + if (getBidIdParameter('start_delay', bid.params) != '') { spotxReq.video.startdelay = 0 + Boolean(getBidIdParameter('start_delay', bid.params)); } diff --git a/test/spec/modules/spotxBidAdapter_spec.js b/test/spec/modules/spotxBidAdapter_spec.js index 2db8a1c9d2c..d536976092b 100644 --- a/test/spec/modules/spotxBidAdapter_spec.js +++ b/test/spec/modules/spotxBidAdapter_spec.js @@ -403,6 +403,42 @@ describe('the spotx adapter', function () { expect(request.data.ext.wrap_response).to.equal(0); config.getConfig.restore(); }); + + it('should pass price floor in USD from the floors module if available', function () { + var request; + + bid.getFloor = function () { + return { currency: 'USD', floor: 3 }; + } + + bid.params.price_floor = 2; + + request = spec.buildRequests([bid], bidRequestObj)[0]; + + expect(request.data.imp.bidfloor).to.equal(3); + }); + + it('should not pass price floor if price floors module gives a non-USD currency', function () { + var request; + + bid.getFloor = function () { + return { currency: 'EUR', floor: 3 }; + } + + request = spec.buildRequests([bid], bidRequestObj)[0]; + + expect(request.data.imp.bidfloor).to.be.undefined; + }); + + it('if floors module is not available, should pass price floor from price_floor param if available', function () { + var request; + + bid.params.price_floor = 2; + + request = spec.buildRequests([bid], bidRequestObj)[0]; + + expect(request.data.imp.bidfloor).to.equal(2); + }); }); describe('interpretResponse', function() { From 3d606dec8d7b0a4856a6a2c4e6bb58ae53beffea Mon Sep 17 00:00:00 2001 From: prebidtappx <77485538+prebidtappx@users.noreply.github.com> Date: Mon, 4 Oct 2021 18:41:15 +0200 Subject: [PATCH 143/250] tappxBidAdapter: fix wrong params (#7528) Co-authored-by: marc_tappx --- modules/tappxBidAdapter.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index 337779d1d53..a026b2cd6a6 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -9,7 +9,7 @@ import { Renderer } from '../src/Renderer.js'; const BIDDER_CODE = 'tappx'; const TTL = 360; const CUR = 'USD'; -const TAPPX_BIDDER_VERSION = '0.1.0921'; +const TAPPX_BIDDER_VERSION = '0.1.1004'; const TYPE_CNN = 'prebidjs'; const LOG_PREFIX = '[TAPPX]: '; const VIDEO_SUPPORT = ['instream', 'outstream']; @@ -495,15 +495,16 @@ export function _getHostInfo(validBidRequests) { } function outstreamRender(bid, request) { + let rendererOptions = {}; + rendererOptions = (typeof bid.params[0].video != 'undefined') ? bid.params[0].video : {}; + rendererOptions.content = bid.vastXml; + bid.renderer.push(() => { window.tappxOutstream.renderAd({ sizes: [bid.width, bid.height], targetId: bid.adUnitCode, adResponse: bid.adResponse, - rendererOptions: { - content: bid.vastXml, - skip: (typeof bid.params[0].video.skip != 'undefined' && bid.params[0].video.skip > 0) ? bid.params[0].video.skip : 0 - } + rendererOptions: rendererOptions }); }); } From 20e0c44d9a2d5c14184536e2fce16f16eba0b4cf Mon Sep 17 00:00:00 2001 From: TheMediaGrid <44166371+TheMediaGrid@users.noreply.github.com> Date: Mon, 4 Oct 2021 20:21:06 +0300 Subject: [PATCH 144/250] TheMediaGridNM: Fix bug with wrong vastUrl (#7530) * Added TheMediaGridNM Bid Adapter * Updated required params for TheMediaGridNM Bid Adapter * Update TheMediGridNM Bid Adapter * Fix tests for TheMediaGridNM Bid Adapter * Fixes after review for TheMediaGridNM Bid Adapter * Add support of multi-format in TheMediaGrid Bid Adapter * Update sync url for grid and gridNM Bid Adapters * TheMediaGrid Bid Adapter: added keywords adUnit parameter * Update TheMediaGrid Bid Adapter to support keywords from config * Implement new request format for TheMediaGrid Bid Adapter * Fix jwpseg params for TheMediaGrid Bid Adapter * Update unit tests for The Media Grid Bid Adapter * Fix typo in TheMediaGrid Bid Adapter * Added test for jwTargeting in TheMediaGrid Bid Adapter * The new request format was made by default in TheMediaGrid Bid Adapter * Update userId format in ad request for TheMediaGrid Bid Adapter * Added bidFloor parameter for TheMediaGrid Bid Adapter * Fix for review TheMediaGrid Bid Adapter * Support floorModule in TheMediaGrid Bid Adapter * Fix empty bidfloor for TheMediaGrid Bid Adapter * Some change to restart autotests * Fix userIds format for TheMediaGrid Bid Adapter * Remove digitrust userId from TheMediaGrid Bid Adapter * Protocols was added in video section in ad request for TheMediaGrid Bid Adapter * TheMediaGrid: fix trouble with alias using * TheMediaGridNM: fix trouble with alias * TheMediaGrid Bid Adapter: added support of PBAdSlot module * TheMediaGrid Bid Adapter: fix typo * GridNM Bid Adapter: use absent in params data from mediaTypes * GridNM Bid Adapter: fix md file + add advertiserDomains support * TheMediaGrid and gridNM Bid Adapter: minor netRevenue fixes * gridNM Bid Adapter updates after review * TheMediaGrid Bid Adapter: fix keywords workflow * fix testing and kick off lgtm again * TheMediaGrid: added ext.bidder.grid.demandSource processing * TheMediaGrid: added user.id from fpd cookie * TheMediaGrid: control cookie setting via bidder config * TheMediaGrid: use localStorage instead cookie * TheMediaGridNM Bid Adapter: update adapter to use /hbjson endpoint * TheMediaGridNM: fix unnecessary conditions * TheMediaGrid: fix bug with nurl field in response * TheMediaGrid: update test * TheMediaGridNM: fix possible bug with nurl Co-authored-by: Chris Huie --- modules/gridNMBidAdapter.js | 13 +++---- test/spec/modules/gridNMBidAdapter_spec.js | 41 +++++++++++++++++++++- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/modules/gridNMBidAdapter.js b/modules/gridNMBidAdapter.js index 0daddb4ee42..3c46b25b8e1 100644 --- a/modules/gridNMBidAdapter.js +++ b/modules/gridNMBidAdapter.js @@ -231,7 +231,7 @@ export const spec = { if (!errorMessage && serverResponse.seatbid) { const serverBid = _getBidFromResponse(serverResponse.seatbid[0]); if (serverBid) { - if (!serverBid.adm) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid); + if (!serverBid.adm && !serverBid.nurl) errorMessage = LOG_ERROR_MESS.noAdm + JSON.stringify(serverBid); else if (!serverBid.price) errorMessage = LOG_ERROR_MESS.noPrice + JSON.stringify(serverBid); else if (serverBid.content_type !== 'video') errorMessage = LOG_ERROR_MESS.wrongContentType + serverBid.content_type; if (!errorMessage) { @@ -246,17 +246,18 @@ export const spec = { netRevenue: true, ttl: TIME_TO_LIVE, dealId: serverBid.dealid, - vastXml: serverBid.adm, mediaType: VIDEO, meta: { advertiserDomains: serverBid.adomain ? serverBid.adomain : [] - }, - adResponse: { - content: serverBid.adm } }; - if (serverBid.nurl) { + if (serverBid.adm) { + bidResponse.vastXml = serverBid.adm; + bidResponse.adResponse = { + content: bidResponse.vastXml + }; + } else if (serverBid.nurl) { bidResponse.vastUrl = serverBid.nurl; } diff --git a/test/spec/modules/gridNMBidAdapter_spec.js b/test/spec/modules/gridNMBidAdapter_spec.js index baff5862fca..89efe942c1f 100644 --- a/test/spec/modules/gridNMBidAdapter_spec.js +++ b/test/spec/modules/gridNMBidAdapter_spec.js @@ -341,6 +341,7 @@ describe('TheMediaGridNM Adapter', function () { const responses = [ {'bid': [{'price': 1.15, 'adm': '\n<\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 250, 'w': 300, 'dealid': 11}], 'seat': '2'}, {'bid': [{'price': 0.5, 'adm': '\n<\/Ad>\n<\/VAST>', 'content_type': 'video', 'h': 600, 'w': 300, adomain: ['my_domain.ru']}], 'seat': '2'}, + {'bid': [{'price': 2.00, 'nurl': 'https://some_test_vast_url.com', 'content_type': 'video', 'adomain': ['example.com'], 'w': 300, 'h': 600}], 'seat': '2'}, {'bid': [{'price': 0, 'h': 250, 'w': 300}], 'seat': '2'}, {'bid': [{'price': 0, 'adm': '\n<\/Ad>\n<\/VAST>', 'h': 250, 'w': 300}], 'seat': '2'}, undefined, @@ -394,6 +395,28 @@ describe('TheMediaGridNM Adapter', function () { 'context': 'instream' } } + }, + { + 'bidder': 'gridNM', + 'params': { + 'source': 'jwp', + 'secid': '11', + 'pubid': '22', + 'video': { + 'mimes': ['video/mp4'], + 'protocols': [1, 2, 3], + } + }, + 'adUnitCode': 'adunit-code-1', + 'sizes': [[300, 250], [300, 600]], + 'bidId': '127f4b12a432c', + 'bidderRequestId': 'a75bc868f32', + 'auctionId': '1cbd2feafe5e8b', + 'mediaTypes': { + 'video': { + 'context': 'instream' + } + } } ]; const requests = spec.buildRequests(bidRequests); @@ -435,6 +458,22 @@ describe('TheMediaGridNM Adapter', function () { 'adResponse': { 'content': '\n<\/Ad>\n<\/VAST>' } + }, + { + 'requestId': '127f4b12a432c', + 'cpm': 2.00, + 'creativeId': 'a75bc868f32', + 'dealId': undefined, + 'width': 300, + 'height': 600, + 'currency': 'USD', + 'mediaType': 'video', + 'netRevenue': true, + 'ttl': 360, + 'meta': { + advertiserDomains: ['example.com'] + }, + 'vastUrl': 'https://some_test_vast_url.com', } ]; @@ -445,7 +484,7 @@ describe('TheMediaGridNM Adapter', function () { }); it('handles wrong and nobid responses', function () { - responses.slice(2).forEach((resp) => { + responses.slice(3).forEach((resp) => { const request = spec.buildRequests([{ 'bidder': 'gridNM', 'params': { From d15d519850f90583668223db6a3166a3396e4f62 Mon Sep 17 00:00:00 2001 From: wojciech-bialy-wpm <67895844+wojciech-bialy-wpm@users.noreply.github.com> Date: Mon, 4 Oct 2021 19:58:23 +0200 Subject: [PATCH 145/250] sspBC Bid Adaptor : add native support, instream video support, & test coverage updates (#7447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update tests for sspBC adapter Update tests for sspBC adapter: - change userSync test (due to tcf param appended in v4.6) - add tests for onBidWon and onTimeout * [sspbc-adapter] RC for 5.2 version of sspBCBidAdapter * [sspbc-adapter] RC for 5.2 version of sspBCBidAdapter(fixed commit) Co-authored-by: Wojciech Biały --- modules/sspBCBidAdapter.js | 219 ++++++++++++++++- modules/sspBCBidAdapter.md | 2 +- test/spec/modules/sspBCBidAdapter_spec.js | 272 +++++++++++++++++----- 3 files changed, 418 insertions(+), 75 deletions(-) diff --git a/modules/sspBCBidAdapter.js b/modules/sspBCBidAdapter.js index 44b96d42deb..188f41dfad9 100644 --- a/modules/sspBCBidAdapter.js +++ b/modules/sspBCBidAdapter.js @@ -1,7 +1,7 @@ import { isArray, deepAccess, logWarn, parseUrl } from '../src/utils.js'; import { ajax } from '../src/ajax.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; -import { BANNER } from '../src/mediaTypes.js'; +import { BANNER, NATIVE, VIDEO } from '../src/mediaTypes.js'; import strIncludes from 'core-js-pure/features/string/includes.js'; const BIDDER_CODE = 'sspBC'; @@ -9,7 +9,7 @@ const BIDDER_URL = 'https://ssp.wp.pl/bidder/'; const SYNC_URL = 'https://ssp.wp.pl/bidder/usersync'; const NOTIFY_URL = 'https://ssp.wp.pl/bidder/notify'; const TMAX = 450; -const BIDDER_VERSION = '5.0'; +const BIDDER_VERSION = '5.2'; const W = window; const { navigator } = W; const oneCodeDetection = {}; @@ -155,6 +155,108 @@ const mapBanner = slot => { } } +/** + * @param {string} paramName Native parameter name + * @param {object} paramValue Native parameter value + * @returns {object} native asset object that conforms to ortb native ads spec + */ +const mapAsset = (paramName, paramValue) => { + let asset; + switch (paramName) { + case 'title': + asset = { + id: 0, + required: paramValue.required, + title: { len: paramValue.len } + } + break; + case 'cta': + asset = { + id: 1, + required: paramValue.required, + data: { type: 12 } + } + break; + case 'icon': + asset = { + id: 2, + required: paramValue.required, + img: { type: 1, w: paramValue.sizes[0], h: paramValue.sizes[1] } + } + break; + case 'image': + asset = { + id: 3, + required: paramValue.required, + img: { type: 3, w: paramValue.sizes[0], h: paramValue.sizes[1] } + } + break; + case 'body': + asset = { + id: 4, + required: paramValue.required, + data: { type: 2 } + } + break; + case 'sponsoredBy': + asset = { + id: 5, + required: paramValue.required, + data: { type: 1 } + } + break; + } + return asset; +} + +/** + * @param {object} slot Ad Unit Params by Prebid + * @returns {object} native object that conforms to ortb native ads spec + */ +const mapNative = slot => { + const native = utils.deepAccess(slot, 'mediaTypes.native'); + let assets; + if (native) { + const nativeParams = Object.keys(native); + assets = []; + nativeParams.forEach(par => { + const newAsset = mapAsset(par, native[par]); + if (newAsset) { assets.push(newAsset) }; + }); + } + return assets ? { request: JSON.stringify({ native: { assets } }) } : undefined; +} + +var mapVideo = slot => { + var video = utils.deepAccess(slot, 'mediaTypes.video'); + var videoParamsUsed = ['api', 'context', 'linearity', 'maxduration', 'mimes', 'protocols']; + var videoAssets; + + if (video) { + var videoParams = Object.keys(video); + var playerSize = video.playerSize; + videoAssets = {}; // player width / height + + if (playerSize) { + var maxSize = playerSize.reduce(function (prev, next) { + return next[0] >= prev[0] && next[1] >= prev[1] ? next : prev; + }, [1, 1]); + videoAssets.w = maxSize[0]; + videoAssets.h = maxSize[1]; + } // remaining supported params + + videoParams.forEach(function (par) { + if (videoParamsUsed.indexOf(par) >= 0) { + videoAssets[par] = video[par]; + } + + ; + }); + } + + return videoAssets; +}; + const mapImpression = slot => { const { adUnitCode, bidId, params = {}, ortb2Imp = {} } = slot; const { id, siteId } = params; @@ -165,32 +267,100 @@ const mapImpression = slot => { send this info as ext.pbsize */ const slotSize = slot.sizes.length ? slot.sizes.reduce((prev, next) => prev[0] * prev[1] <= next[0] * next[1] ? next : prev).join('x') : '1x1'; - adSizesCalled[slotSize] = adSizesCalled[slotSize] ? adSizesCalled[slotSize] + 1 : 1; + adSizesCalled[slotSize] = adSizesCalled[slotSize] ? adSizesCalled[slotSize] += 1 : 1; ext.data = Object.assign({ pbsize: `${slotSize}_${adSizesCalled[slotSize]}` }, ext.data); const imp = { id: id && siteId ? id : 'bidid-' + bidId, banner: mapBanner(slot), - // native: mapNative(slot), + native: mapNative(slot), + video: mapVideo(slot), tagid: adUnitCode, ext, }; // Check floorprices for this imp if (typeof slot.getFloor === 'function') { - let bannerFloor = 0; - // sspBC adapter accepts only floor per imp - check for maximum value for requested ad types and sizes + var bannerFloor = 0; + var nativeFloor = 0; + var videoFloor = 0; // sspBC adapter accepts only floor per imp - check for maximum value for requested ad types and sizes + if (slot.sizes.length) { - bannerFloor = slot.sizes.reduce((prev, next) => { - const currentFloor = slot.getFloor({ mediaType: 'banner', size: next }).floor; + bannerFloor = slot.sizes.reduce(function (prev, next) { + var currentFloor = slot.getFloor({ + mediaType: 'banner', + size: next + }).floor; return prev > currentFloor ? prev : currentFloor; }, 0); } - imp.bidfloor = bannerFloor; + + nativeFloor = slot.getFloor({ + mediaType: 'native' + }); + videoFloor = slot.getFloor({ + mediaType: 'video' + }); + imp.bidfloor = Math.max(bannerFloor, nativeFloor, videoFloor); } return imp; } +const isVideoAd = bid => { + const xmlTester = new RegExp(/^<\?xml/); + return bid.adm && bid.adm.match(xmlTester); +} + +const isNativeAd = bid => { + const xmlTester = new RegExp(/^{['"]native['"]/); + + return bid.adm && bid.adm.match(xmlTester); +} + +const parseNative = nativeData => { + const result = {}; + nativeData.assets.forEach(asset => { + const id = parseInt(asset.id); + switch (id) { + case 0: + result.title = asset.title.text; + break; + case 2: + result.icon = { + url: asset.img.url, + width: asset.img.w, + height: asset.img.h, + }; + break; + case 3: + result.image = { + url: asset.img.url, + width: asset.img.w, + height: asset.img.h, + }; + break; + case 4: + result.body = asset.data.value; + break; + case 5: + result.sponsoredBy = asset.data.value; + break; + + default: + utils.logWarn('Unrecognized native asset', asset); + } + }); + result.clickUrl = nativeData.link.url; + result.impressionTrackers = nativeData.imptrackers; + + if (utils.isArray(nativeData.jstracker)) { + result.javascriptTrackers = nativeData.jstracker; + } else if (nativeData.jstracker) { + result.javascriptTrackers = [nativeData.jstracker]; + } + return result; +} + const renderCreative = (site, auctionId, bid, seat, request) => { let gam; @@ -243,6 +413,7 @@ const renderCreative = (site, auctionId, bid, seat, request) => { `; +} + +function insertVASTMethodForAPV(targetId, vastXml) { let apvVideoAdParam = { s: targetId }; @@ -200,6 +217,13 @@ function insertVASTMethod(targetId, vastXml) { return script.outerHTML; } +function insertVASTMethodForADGBrowserM(vastXml, marginTop) { + const script = document.createElement(`script`); + script.type = 'text/javascript'; + script.innerHTML = `window.ADGBrowserM.init({vastXml: '${vastXml.replace(/\r?\n/g, '')}', marginTop: '${marginTop}'});`; + return script.outerHTML; +} + /** * * @param ad diff --git a/test/spec/modules/adgenerationBidAdapter_spec.js b/test/spec/modules/adgenerationBidAdapter_spec.js index 7eacba2f7d4..3ff5e1fb302 100644 --- a/test/spec/modules/adgenerationBidAdapter_spec.js +++ b/test/spec/modules/adgenerationBidAdapter_spec.js @@ -92,9 +92,9 @@ describe('AdgenerationAdapter', function () { } }; const data = { - banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.1.0&imark=1&tp=https%3A%2F%2Fexample.com`, - bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.1.0&imark=1&tp=https%3A%2F%2Fexample.com`, - native: 'posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=' + prebid.version + '&sdkname=prebidjs&adapterver=1.1.0&tp=https%3A%2F%2Fexample.com' + banner: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=JPY&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.2.0&imark=1&tp=https%3A%2F%2Fexample.com`, + bannerUSD: `posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=300x250%2C320x100¤cy=USD&pbver=${prebid.version}&sdkname=prebidjs&adapterver=1.2.0&imark=1&tp=https%3A%2F%2Fexample.com`, + native: 'posall=SSPLOC&id=58278&sdktype=0&hb=true&t=json3&sizes=1x1¤cy=JPY&pbver=' + prebid.version + '&sdkname=prebidjs&adapterver=1.2.0&tp=https%3A%2F%2Fexample.com' }; it('sends bid request to ENDPOINT via GET', function () { const request = spec.buildRequests(bidRequests, bidderRequest)[0]; @@ -192,6 +192,21 @@ describe('AdgenerationAdapter', function () { transactionTd: 'f76f6dfd-d64f-4645-a29f-682bac7f431a' }, }, + upperBillboard: { + bidRequest: { + bidder: 'adg', + params: { + id: '143038', // banner + marginTop: '50', + }, + adUnitCode: 'adunit-code', + sizes: [[320, 180]], + bidId: '2f6ac468a9c15e', + bidderRequestId: '14a9f773e30243', + auctionId: '4aae9f05-18c6-4fcd-80cf-282708cd584a', + transactionTd: 'f76f6dfd-d64f-4645-a29f-682bac7f431a' + }, + }, }; const serverResponse = { @@ -216,12 +231,12 @@ describe('AdgenerationAdapter', function () { dealid: 'fd5sa5fa7f', ttl: 1000, results: [ - {ad: '
'}, + {ad: '<\!DOCTYPE html>
'}, ], adomain: ['advertiserdomain.com'] }, native: { - ad: '↵ ↵ ↵ ↵ ↵
↵ ', + ad: '<\!DOCTYPE html>↵ ↵ ↵ ↵ ↵
↵ ', beacon: '', cpm: 36.0008, displaytype: '1', @@ -311,6 +326,78 @@ describe('AdgenerationAdapter', function () { creativeid: '1k2kv35vsa5r', dealid: 'fd5sa5fa7f', ttl: 1000 + }, + upperBillboard: { + 'ad': '<\!DOCTYPE html>\n \n \n \n \n \n \n \n
\n \n
\n \n', + 'beacon': '', + 'beaconurl': 'https://tg.socdm.com/bc/v3?b=Y2hzbT0yOTQsNGZiM2NkNWVpZD0xNDMwMzgmcG9zPVNTUExPQyZhZD0xMjMzMzIzLzI2MTA2MS4yNjU3OTkuMTIzMzMyMy8yMTY2NDY2LzE1NDQxMC8xNDMwMzg6U1NQTE9DOiovaWR4PTA7ZHNwaWQ9MTtkaTI9MjEzNC0xMzI4NjRfbmV3Zm9ybWF0X3Rlc3Q7ZnR5cGU9Mztwcj15TXB3O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTExLjkyO2NyeTJkPTAuMDA4OTM0OTUzNTM4MjQxNjAxMztwcnY9aWp6QVZtWW9wbmJUV1B0cWhtZEN1ZWRXNDd0MjU1MEtmYjFWYmI3SzsmZXg9MTYzMzMyNzU4MyZjdD0xNjMzMzI3NTgzODAzJnNyPWh0dHA-&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA&ctsv=m-ad240&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&seqctx=gat3by5hZy5mdHlwZaEz&t=.gif', + 'cpm': 80, + 'creative_params': {}, + 'creativeid': 'ScaleOut_2146187', + 'dealid': '2134-132864_newformat_test', + 'displaytype': '1', + 'h': 180, + 'ids': { + 'anid': '', + 'diid': '', + 'idfa': '', + 'soc': 'Xm8Q8cCo5r8AAHCCMg0AAAAA' + }, + 'location_params': { + 'option': { + 'ad_type': 'upper_billboard' + } + }, + 'locationid': '143038', + 'results': [ + { + 'ad': '<\!DOCTYPE html>\n \n \n \n \n \n \n \n
\n \n
\n \n', + 'beacon': '', + 'beaconurl': 'https://tg.socdm.com/bc/v3?b=Y2hzbT0yOTQsNGZiM2NkNWVpZD0xNDMwMzgmcG9zPVNTUExPQyZhZD0xMjMzMzIzLzI2MTA2MS4yNjU3OTkuMTIzMzMyMy8yMTY2NDY2LzE1NDQxMC8xNDMwMzg6U1NQTE9DOiovaWR4PTA7ZHNwaWQ9MTtkaTI9MjEzNC0xMzI4NjRfbmV3Zm9ybWF0X3Rlc3Q7ZnR5cGU9Mztwcj15TXB3O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTExLjkyO2NyeTJkPTAuMDA4OTM0OTUzNTM4MjQxNjAxMztwcnY9aWp6QVZtWW9wbmJUV1B0cWhtZEN1ZWRXNDd0MjU1MEtmYjFWYmI3SzsmZXg9MTYzMzMyNzU4MyZjdD0xNjMzMzI3NTgzODAzJnNyPWh0dHA-&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA&ctsv=m-ad240&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&seqctx=gat3by5hZy5mdHlwZaEz&t=.gif', + 'cpm': 80, + 'creative_params': {}, + 'creativeid': 'ScaleOut_2146187', + 'dealid': '2134-132864_newformat_test', + 'h': 180, + 'landing_url': 'https://supership.jp/', + 'rparams': {}, + 'scheduleid': '1233323', + 'trackers': { + 'imp': [ + 'https://tg.socdm.com/bc/v3?b=Y2hzbT0yOTQsNGZiM2NkNWVpZD0xNDMwMzgmcG9zPVNTUExPQyZhZD0xMjMzMzIzLzI2MTA2MS4yNjU3OTkuMTIzMzMyMy8yMTY2NDY2LzE1NDQxMC8xNDMwMzg6U1NQTE9DOiovaWR4PTA7ZHNwaWQ9MTtkaTI9MjEzNC0xMzI4NjRfbmV3Zm9ybWF0X3Rlc3Q7ZnR5cGU9Mztwcj15TXB3O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTExLjkyO2NyeTJkPTAuMDA4OTM0OTUzNTM4MjQxNjAxMztwcnY9aWp6QVZtWW9wbmJUV1B0cWhtZEN1ZWRXNDd0MjU1MEtmYjFWYmI3SzsmZXg9MTYzMzMyNzU4MyZjdD0xNjMzMzI3NTgzODAzJnNyPWh0dHA-&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA&ctsv=m-ad240&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&seqctx=gat3by5hZy5mdHlwZaEz&t=.gif' + ], + 'viewable_imp': [ + 'https://tg.socdm.com/aux/inview?creative_id=2166466&ctsv=m-ad240&extra_field=idx%3D0%3Bdspid%3D1%3Bdi2%3D2134-132864_newformat_test%3Bftype%3D3%3Bprb%3D0%3Bpro%3D0%3Bproc%3DJPY%3Bcrd2y%3D111.92%3Bcry2d%3D0.0089349535382416013%3Bsspm%3D0%3Bsom%3D0.2%3Borgm%3D0%3Btechm%3D0%3Bssp_margin%3D0%3Bso_margin%3D0.2%3Borg_margin%3D0%3Btech_margin%3D0%3Bbs%3Dclassic%3B&family_id=1233323&id=143038&loglocation_id=154410&lookupname=143038%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=261061.265799.1233323&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA' + ], + 'viewable_measured': [ + 'https://tg.socdm.com/aux/measured?creative_id=2166466&ctsv=m-ad240&extra_field=idx%3D0%3Bdspid%3D1%3Bdi2%3D2134-132864_newformat_test%3Bftype%3D3%3Bprb%3D0%3Bpro%3D0%3Bproc%3DJPY%3Bcrd2y%3D111.92%3Bcry2d%3D0.0089349535382416013%3Bsspm%3D0%3Bsom%3D0.2%3Borgm%3D0%3Btechm%3D0%3Bssp_margin%3D0%3Bso_margin%3D0.2%3Borg_margin%3D0%3Btech_margin%3D0%3Bbs%3Dclassic%3B&family_id=1233323&id=143038&loglocation_id=154410&lookupname=143038%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=261061.265799.1233323&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA' + ] + }, + 'ttl': 1000, + 'vastxml': '\n \n \n SOADS\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n https://i.socdm.com/a/2/2095/2091787/20210810043037-de3e74aec30f36.mp4\n https://i.socdm.com/a/2/2095/2091788/20210810043037-6dd368dc91d507.mp4\n https://i.socdm.com/a/2/2095/2091789/20210810043037-c8eb814ddd85c4.webm\n https://i.socdm.com/a/2/2095/2091790/20210810043037-0a7f74c40268ab.webm\n \n \n \n \n \n \n', + 'vcpm': 0, + 'w': 320, + 'weight': 1 + } + ], + 'rotation': '0', + 'scheduleid': '1233323', + 'sdktype': '0', + 'trackers': { + 'imp': [ + 'https://tg.socdm.com/bc/v3?b=Y2hzbT0yOTQsNGZiM2NkNWVpZD0xNDMwMzgmcG9zPVNTUExPQyZhZD0xMjMzMzIzLzI2MTA2MS4yNjU3OTkuMTIzMzMyMy8yMTY2NDY2LzE1NDQxMC8xNDMwMzg6U1NQTE9DOiovaWR4PTA7ZHNwaWQ9MTtkaTI9MjEzNC0xMzI4NjRfbmV3Zm9ybWF0X3Rlc3Q7ZnR5cGU9Mztwcj15TXB3O3ByYj15UTtwcm89eVE7cHJvYz1KUFk7Y3JkMnk9MTExLjkyO2NyeTJkPTAuMDA4OTM0OTUzNTM4MjQxNjAxMztwcnY9aWp6QVZtWW9wbmJUV1B0cWhtZEN1ZWRXNDd0MjU1MEtmYjFWYmI3SzsmZXg9MTYzMzMyNzU4MyZjdD0xNjMzMzI3NTgzODAzJnNyPWh0dHA-&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA&ctsv=m-ad240&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&seqctx=gat3by5hZy5mdHlwZaEz&t=.gif' + ], + 'viewable_imp': [ + 'https://tg.socdm.com/aux/inview?creative_id=2166466&ctsv=m-ad240&extra_field=idx%3D0%3Bdspid%3D1%3Bdi2%3D2134-132864_newformat_test%3Bftype%3D3%3Bprb%3D0%3Bpro%3D0%3Bproc%3DJPY%3Bcrd2y%3D111.92%3Bcry2d%3D0.0089349535382416013%3Bsspm%3D0%3Bsom%3D0.2%3Borgm%3D0%3Btechm%3D0%3Bssp_margin%3D0%3Bso_margin%3D0.2%3Borg_margin%3D0%3Btech_margin%3D0%3Bbs%3Dclassic%3B&family_id=1233323&id=143038&loglocation_id=154410&lookupname=143038%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=261061.265799.1233323&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA' + ], + 'viewable_measured': [ + 'https://tg.socdm.com/aux/measured?creative_id=2166466&ctsv=m-ad240&extra_field=idx%3D0%3Bdspid%3D1%3Bdi2%3D2134-132864_newformat_test%3Bftype%3D3%3Bprb%3D0%3Bpro%3D0%3Bproc%3DJPY%3Bcrd2y%3D111.92%3Bcry2d%3D0.0089349535382416013%3Bsspm%3D0%3Bsom%3D0.2%3Borgm%3D0%3Btechm%3D0%3Bssp_margin%3D0%3Bso_margin%3D0.2%3Borg_margin%3D0%3Btech_margin%3D0%3Bbs%3Dclassic%3B&family_id=1233323&id=143038&loglocation_id=154410&lookupname=143038%3ASSPLOC%3A*&pos=SSPLOC&schedule_id=261061.265799.1233323&seqid=be38bdb4-74a7-14a7-3439-b7f1ea8b4f33&seqtime=1633327583803&xuid=Xm8Q8cCo5r8AAHCCMg0AAAAA' + ] + }, + 'ttl': 1000, + 'vastxml': '\n \n \n SOADS\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n https://i.socdm.com/a/2/2095/2091787/20210810043037-de3e74aec30f36.mp4\n https://i.socdm.com/a/2/2095/2091788/20210810043037-6dd368dc91d507.mp4\n https://i.socdm.com/a/2/2095/2091789/20210810043037-c8eb814ddd85c4.webm\n https://i.socdm.com/a/2/2095/2091790/20210810043037-0a7f74c40268ab.webm\n \n \n \n \n \n \n', + 'vcpm': 0, + 'w': 320, } }, emptyAdomain: { @@ -331,12 +418,12 @@ describe('AdgenerationAdapter', function () { dealid: 'fd5sa5fa7f', ttl: 1000, results: [ - {ad: '
'}, + {ad: '<\!DOCTYPE html>
'}, ], adomain: [] }, native: { - ad: '↵ ↵ ↵ ↵ ↵
↵ ', + ad: '<\!DOCTYPE html>↵ ↵ ↵ ↵ ↵
↵ ', beacon: '', cpm: 36.0008, displaytype: '1', @@ -446,11 +533,11 @@ describe('AdgenerationAdapter', function () { dealid: 'fd5sa5fa7f', ttl: 1000, results: [ - {ad: '
'}, + {ad: '<\!DOCTYPE html>
'}, ], }, native: { - ad: '↵ ↵ ↵ ↵ ↵
↵ ', + ad: '<\!DOCTYPE html>↵ ↵ ↵ ↵ ↵
↵ ', beacon: '', cpm: 36.0008, displaytype: '1', @@ -591,7 +678,20 @@ describe('AdgenerationAdapter', function () { impressionTrackers: ['https://adg-dummy-dsp.s3-ap-northeast-1.amazonaws.com/1x1.gif'] }, mediaType: NATIVE - } + }, + upperBillboard: { + requestId: '2f6ac468a9c15e', + cpm: 80, + width: 320, + height: 180, + creativeId: 'ScaleOut_2146187', + dealId: '2134-132864_newformat_test', + currency: 'JPY', + netRevenue: true, + ttl: 1000, + ad: ``, + adomain: ['advertiserdomain.com'] + }, }, emptyAdomain: { banner: { @@ -696,46 +796,17 @@ describe('AdgenerationAdapter', function () { expect(result.length).to.equal(0); }); - it('handles banner responses', function () { - const result = spec.interpretResponse({body: serverResponse.normal.banner}, bidRequests.banner)[0]; - expect(result.requestId).to.equal(bidResponses.normal.banner.requestId); - expect(result.width).to.equal(bidResponses.normal.banner.width); - expect(result.height).to.equal(bidResponses.normal.banner.height); - expect(result.creativeId).to.equal(bidResponses.normal.banner.creativeId); - expect(result.dealId).to.equal(bidResponses.normal.banner.dealId); - expect(result.currency).to.equal(bidResponses.normal.banner.currency); - expect(result.netRevenue).to.equal(bidResponses.normal.banner.netRevenue); - expect(result.ttl).to.equal(bidResponses.normal.banner.ttl); - expect(result.ad).to.equal(bidResponses.normal.banner.ad); - expect(result.meta.advertiserDomains).deep.equal(bidResponses.normal.banner.adomain); - }); - - it('handles native responses', function () { - const result = spec.interpretResponse({body: serverResponse.normal.native}, bidRequests.native)[0]; - expect(result.requestId).to.equal(bidResponses.normal.native.requestId); - expect(result.width).to.equal(bidResponses.normal.native.width); - expect(result.height).to.equal(bidResponses.normal.native.height); - expect(result.creativeId).to.equal(bidResponses.normal.native.creativeId); - expect(result.dealId).to.equal(bidResponses.normal.native.dealId); - expect(result.currency).to.equal(bidResponses.normal.native.currency); - expect(result.netRevenue).to.equal(bidResponses.normal.native.netRevenue); - expect(result.ttl).to.equal(bidResponses.normal.native.ttl); - expect(result.native.title).to.equal(bidResponses.normal.native.native.title); - expect(result.native.image.url).to.equal(bidResponses.normal.native.native.image.url); - expect(result.native.image.height).to.equal(bidResponses.normal.native.native.image.height); - expect(result.native.image.width).to.equal(bidResponses.normal.native.native.image.width); - expect(result.native.icon.url).to.equal(bidResponses.normal.native.native.icon.url); - expect(result.native.icon.width).to.equal(bidResponses.normal.native.native.icon.width); - expect(result.native.icon.height).to.equal(bidResponses.normal.native.native.icon.height); - expect(result.native.sponsoredBy).to.equal(bidResponses.normal.native.native.sponsoredBy); - expect(result.native.body).to.equal(bidResponses.normal.native.native.body); - expect(result.native.cta).to.equal(bidResponses.normal.native.native.cta); - expect(decodeURIComponent(result.native.privacyLink)).to.equal(bidResponses.normal.native.native.privacyLink); - expect(result.native.clickUrl).to.equal(bidResponses.normal.native.native.clickUrl); - expect(result.native.impressionTrackers[0]).to.equal(bidResponses.normal.native.native.impressionTrackers[0]); - expect(result.native.clickTrackers[0]).to.equal(bidResponses.normal.native.native.clickTrackers[0]); - expect(result.mediaType).to.equal(bidResponses.normal.native.mediaType); - expect(result.meta.advertiserDomains).deep.equal(bidResponses.normal.native.adomain); + it('handles ADGBrowserM responses', function () { + const result = spec.interpretResponse({body: serverResponse.normal.upperBillboard}, bidRequests.upperBillboard)[0]; + expect(result.requestId).to.equal(bidResponses.normal.upperBillboard.requestId); + expect(result.width).to.equal(bidResponses.normal.upperBillboard.width); + expect(result.height).to.equal(bidResponses.normal.upperBillboard.height); + expect(result.creativeId).to.equal(bidResponses.normal.upperBillboard.creativeId); + expect(result.dealId).to.equal(bidResponses.normal.upperBillboard.dealId); + expect(result.currency).to.equal(bidResponses.normal.upperBillboard.currency); + expect(result.netRevenue).to.equal(bidResponses.normal.upperBillboard.netRevenue); + expect(result.ttl).to.equal(bidResponses.normal.upperBillboard.ttl); + expect(result.ad).to.equal(bidResponses.normal.upperBillboard.ad); }); it('handles banner responses for empty adomain', function () { From 6d8a1465f3fd1b144d93adf795bec04cb847f0f5 Mon Sep 17 00:00:00 2001 From: Mehdi Bouallagui <45876988+mbouallagui@users.noreply.github.com> Date: Fri, 8 Oct 2021 17:22:19 +0200 Subject: [PATCH 163/250] Ogury Bid Adapter: adding onTimeout support (#7535) * [SPY-10216] adding onTimeout support * [SPY-12216] reformulating test name --- modules/oguryBidAdapter.js | 11 ++++- test/spec/modules/oguryBidAdapter_spec.js | 50 ++++++++++++++++++----- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index 513f9ed384e..fcbb89c5188 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -8,6 +8,7 @@ import { ajax } from '../src/ajax.js' const BIDDER_CODE = 'ogury'; const DEFAULT_TIMEOUT = 1000; const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request'; +const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io'; const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io'; function isBidRequestValid(bid) { @@ -141,6 +142,13 @@ function onBidWon(bid) { if (bid && bid.hasOwnProperty('nurl') && bid.nurl.length > 0) ajax(bid['nurl'], null); } +function onTimeout(timeoutData) { + ajax(`${TIMEOUT_MONITORING_HOST}/bid_timeout`, null, JSON.stringify(timeoutData[0]), { + method: 'POST', + contentType: 'application/json' + }); +} + export const spec = { code: BIDDER_CODE, supportedMediaTypes: [BANNER], @@ -149,7 +157,8 @@ export const spec = { buildRequests, interpretResponse, getFloor, - onBidWon + onBidWon, + onTimeout } registerBidder(spec); diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index d693e8fd3cc..d3a154b3989 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -2,7 +2,8 @@ import { expect } from 'chai'; import { spec } from 'modules/oguryBidAdapter'; import { deepClone } from 'src/utils.js'; -const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request'; +const BID_URL = 'https://mweb-hb.presage.io/api/header-bidding-request'; +const TIMEOUT_URL = 'https://ms-ads-monitoring-events.presage.io/bid_timeout' describe('OguryBidAdapter', function () { let bidRequests; @@ -150,7 +151,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); it('should return syncs array with an element of type image when consentString is null', () => { @@ -162,7 +163,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); it('should return syncs array with an element of type image when gdprConsent is undefined', () => { @@ -171,7 +172,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); it('should return syncs array with an element of type image when gdprConsent is null', () => { @@ -180,7 +181,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); it('should return syncs array with an element of type image when gdprConsent is null and gdprApplies is false', () => { @@ -192,7 +193,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); it('should return syncs array with an element of type image when gdprConsent is empty string and gdprApplies is false', () => { @@ -204,7 +205,7 @@ describe('OguryBidAdapter', function () { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs).to.have.lengthOf(1); expect(userSyncs[0].type).to.equal('image'); - expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid'); + expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') }); }); @@ -255,7 +256,7 @@ describe('OguryBidAdapter', function () { const validBidRequests = deepClone(bidRequests) const request = spec.buildRequests(validBidRequests, bidderRequest); - expect(request.url).to.equal(BID_HOST); + expect(request.url).to.equal(BID_URL); expect(request.method).to.equal('POST'); }); @@ -453,11 +454,11 @@ describe('OguryBidAdapter', function () { }) afterEach(function() { - xhr.restore(); + xhr.restore() }) it('Should not create nurl request if bid is undefined', function() { - spec.onBidWon(); + spec.onBidWon() expect(requests.length).to.equal(0); }) @@ -473,4 +474,33 @@ describe('OguryBidAdapter', function () { expect(requests[0].method).to.equal('GET') }) }) + + describe('onTimeout', function () { + let xhr; + let requests; + + beforeEach(function() { + xhr = sinon.useFakeXMLHttpRequest(); + requests = []; + xhr.onCreate = (xhr) => { + requests.push(xhr); + }; + }) + + afterEach(function() { + xhr.restore() + }) + + it('should send notification on bid timeout', function() { + const bid = { + ad: 'cookies', + cpm: 3 + } + spec.onTimeout(bid); + expect(requests).to.not.be.undefined; + expect(requests.length).to.equal(1); + expect(requests[0].url).to.equal(TIMEOUT_URL); + expect(requests[0].method).to.equal('POST'); + }) + }); }); From 2e83adcc11dd7aea9aaf68190b5f0377587c5a65 Mon Sep 17 00:00:00 2001 From: mediaconsortium-develop <76139568+mediaconsortium-develop@users.noreply.github.com> Date: Sat, 9 Oct 2021 01:36:51 +0900 Subject: [PATCH 164/250] Dgkeeword RTD: add content type to request (#7550) * change to stop preflight. * stop preflight --- modules/dgkeywordRtdProvider.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/dgkeywordRtdProvider.js b/modules/dgkeywordRtdProvider.js index a086091d464..26a8257077a 100644 --- a/modules/dgkeywordRtdProvider.js +++ b/modules/dgkeywordRtdProvider.js @@ -78,7 +78,6 @@ export function getDgKeywordsAndSet(reqBidsConfigObj, callback, moduleConfig, us } }, null, { withCredentials: true, - contentType: 'application/json', }); setTimeout(function () { if (!isFinish) { From f72e63fbb20b4f5b9bb33f14fa31754bbc92600b Mon Sep 17 00:00:00 2001 From: Michael Kuryshev Date: Sat, 9 Oct 2021 18:03:32 +0200 Subject: [PATCH 165/250] VIS.X: iframe sync support & optional video params (#7527) --- modules/visxBidAdapter.js | 37 +++++++---------- test/spec/modules/visxBidAdapter_spec.js | 52 ++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 26 deletions(-) diff --git a/modules/visxBidAdapter.js b/modules/visxBidAdapter.js index 3c7431409d7..1d80ea79e99 100644 --- a/modules/visxBidAdapter.js +++ b/modules/visxBidAdapter.js @@ -168,16 +168,21 @@ export const spec = { return bidResponses; }, getUserSyncs: function(syncOptions, serverResponses, gdprConsent) { - if (syncOptions.pixelEnabled) { - var query = []; - if (gdprConsent) { - if (gdprConsent.consentString) { - query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString)); - } - query.push('gdpr_applies=' + encodeURIComponent( - (typeof gdprConsent.gdprApplies === 'boolean') - ? Number(gdprConsent.gdprApplies) : 1)); + var query = []; + if (gdprConsent) { + if (gdprConsent.consentString) { + query.push('gdpr_consent=' + encodeURIComponent(gdprConsent.consentString)); } + query.push('gdpr_applies=' + encodeURIComponent( + (typeof gdprConsent.gdprApplies === 'boolean') + ? Number(gdprConsent.gdprApplies) : 1)); + } + if (syncOptions.iframeEnabled) { + return [{ + type: 'iframe', + url: buildUrl(ADAPTER_SYNC_PATH) + '?iframe=1' + (query.length ? '&' + query.join('&') : '') + }]; + } else if (syncOptions.pixelEnabled) { return [{ type: 'image', url: buildUrl(ADAPTER_SYNC_PATH) + (query.length ? '?' + query.join('&') : '') @@ -230,7 +235,7 @@ function makeVideo(videoParams = {}) { return result; }, { w: deepAccess(videoParams, 'playerSize.0.0'), h: deepAccess(videoParams, 'playerSize.0.1') }); - if (video.w && video.h && video.mimes) { + if (video.w && video.h) { return video; } } @@ -347,18 +352,6 @@ function _isValidVideoBid(bid, logErrors = false) { } result = false; } - if (!videoMediaType.mimes) { - if (logErrors) { - logError(LOG_ERROR_MESS.videoMissing + 'mimes'); - } - result = false; - } - if (!videoMediaType.protocols) { - if (logErrors) { - logError(LOG_ERROR_MESS.videoMissing + 'protocols'); - } - result = false; - } return result; } diff --git a/test/spec/modules/visxBidAdapter_spec.js b/test/spec/modules/visxBidAdapter_spec.js index 99ab327eda4..c3d2d216586 100755 --- a/test/spec/modules/visxBidAdapter_spec.js +++ b/test/spec/modules/visxBidAdapter_spec.js @@ -44,7 +44,8 @@ describe('VisxAdapter', function () { videoBid.mediaTypes = { video: { context: 'instream', - playerSize: [[400, 300]] + mimes: ['video/mp4'], + protocols: [3, 6] } }; expect(spec.isBidRequestValid(videoBid)).to.equal(false); @@ -55,9 +56,7 @@ describe('VisxAdapter', function () { videoBid.mediaTypes = { video: { context: 'instream', - playerSize: [[400, 300]], - mimes: ['video/mp4'], - protocols: [3, 6] + playerSize: [[400, 300]] } }; expect(spec.isBidRequestValid(videoBid)).to.equal(true); @@ -1153,4 +1152,49 @@ describe('VisxAdapter', function () { expect(utils.triggerPixel.calledOnceWith('https://t.visx.net/track/bid_timeout?data=' + JSON.stringify(data))).to.equal(true); }); }); + + describe('user sync', function () { + function parseUrl(url) { + const [, path, querySt] = url.match(/^https?:\/\/[^\/]+(?:\/([^?]+)?)?(?:\?(.+)?)?$/) || []; + const query = {}; + (querySt || '').split('&').forEach((q) => { + var kv = q.split('='); + if (kv[0]) { + query[kv[0]] = decodeURIComponent(kv[1] || ''); + } + }); + return { path, query }; + } + it('should call iframe', function () { + let syncs = spec.getUserSyncs({ + iframeEnabled: true + }); + + expect(Array.isArray(syncs)).to.equal(true); + expect(syncs.length).to.equal(1); + expect(syncs[0]).to.have.property('type', 'iframe'); + expect(syncs[0]).to.have.property('url'); + expect(syncs[0].url).to.be.an('string'); + + const { path, query } = parseUrl(syncs[0].url); + expect(path).to.equal('push_sync'); + expect(query).to.deep.equal({iframe: '1'}); + }); + + it('should call image', function () { + let syncs = spec.getUserSyncs({ + pixelEnabled: true + }); + + expect(Array.isArray(syncs)).to.equal(true); + expect(syncs.length).to.equal(1); + expect(syncs[0]).to.have.property('type', 'image'); + expect(syncs[0]).to.have.property('url'); + expect(syncs[0].url).to.be.an('string'); + + const { path, query } = parseUrl(syncs[0].url); + expect(path).to.equal('push_sync'); + expect(query).to.deep.equal({}); + }); + }); }); From a9e10602ad3d84c9f1d9dfa2db88a17f9fdae1b2 Mon Sep 17 00:00:00 2001 From: natexo-technical-team <91968830+natexo-technical-team@users.noreply.github.com> Date: Tue, 12 Oct 2021 12:00:46 +0200 Subject: [PATCH 166/250] Talkads Bid Adapter: add new bid adapter (#7546) * Add files via upload * Add files via upload * Params update * Params update * Add test feature with fake test bid --- modules/talkadsBidAdapter.js | 129 +++++++++++ modules/talkadsBidAdapter.md | 60 +++++ test/spec/modules/talkadsBidAdapter_spec.js | 231 ++++++++++++++++++++ 3 files changed, 420 insertions(+) create mode 100644 modules/talkadsBidAdapter.js create mode 100644 modules/talkadsBidAdapter.md create mode 100644 test/spec/modules/talkadsBidAdapter_spec.js diff --git a/modules/talkadsBidAdapter.js b/modules/talkadsBidAdapter.js new file mode 100644 index 00000000000..f95456b5c54 --- /dev/null +++ b/modules/talkadsBidAdapter.js @@ -0,0 +1,129 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { NATIVE, BANNER } from '../src/mediaTypes.js'; +import * as utils from '../src/utils.js'; +import {ajax} from '../src/ajax.js'; + +const CURRENCY = 'EUR'; +const BIDDER_CODE = 'talkads'; + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [ NATIVE, BANNER ], + params: null, + + /** + * Determines whether or not the given bid request is valid. + * + * @param poBid The bid params to validate. + * @return boolean True if this is a valid bid, and false otherwise. + */ + isBidRequestValid: (poBid) => { + utils.logInfo('isBidRequestValid : ', poBid); + if (poBid.params === undefined) { + utils.logError('VALIDATION FAILED : the parameters must be defined'); + return false; + } + if (poBid.params.tag_id === undefined) { + utils.logError('VALIDATION FAILED : the parameter "tag_id" must be defined'); + return false; + } + if (poBid.params.bidder_url === undefined) { + utils.logError('VALIDATION FAILED : the parameter "bidder_url" must be defined'); + return false; + } + this.params = poBid.params; + return !!(poBid.nativeParams || poBid.sizes); + }, // isBidRequestValid + + /** + * Make a server request from the list of BidRequests. + * + * @param paValidBidRequests An array of bids + * @param poBidderRequest + * @return ServerRequest Info describing the request to the server. + */ + buildRequests: (paValidBidRequests, poBidderRequest) => { + utils.logInfo('buildRequests : ', paValidBidRequests, poBidderRequest); + const laBids = paValidBidRequests.map((poBid, piId) => { + const loOne = { id: piId, ad_unit: poBid.adUnitCode, bid_id: poBid.bidId, type: '', size: [] }; + if (poBid.nativeParams) { + loOne.type = 'native'; + } else { + loOne.type = 'banner'; + loOne.size = poBid.sizes; + } + return loOne; + }); + const loServerRequest = { + cur: CURRENCY, + timeout: poBidderRequest.timeout, + auction_id: paValidBidRequests[0].auctionId, + transaction_id: paValidBidRequests[0].transactionId, + bids: laBids, + gdpr: { applies: false, consent: false }, + }; + if (poBidderRequest && poBidderRequest.gdprConsent) { + const loGdprConsent = poBidderRequest.gdprConsent; + if ((typeof loGdprConsent.gdprApplies === 'boolean') && loGdprConsent.gdprApplies) { + loServerRequest.gdpr.applies = true; + } + if ((typeof loGdprConsent.consentString === 'string') && loGdprConsent.consentString) { + loServerRequest.gdpr.consent = poBidderRequest.gdprConsent.consentString; + } + } + const lsUrl = this.params.bidder_url + '/' + this.params.tag_id; + return { + method: 'POST', + url: lsUrl, + data: JSON.stringify(loServerRequest), + }; + }, // buildRequests + + /** + * Unpack the response from the server into a list of bids. + * + * @param poServerResponse A successful response from the server. + * @param poPidRequest Request original server request + * @return An array of bids which were nested inside the server. + */ + interpretResponse: (poServerResponse, poPidRequest) => { + utils.logInfo('interpretResponse : ', poServerResponse); + if (!poServerResponse.body) { + return []; + } + let laResponse = []; + if (poServerResponse.body.status !== 'ok') { + utils.logInfo('Error : ', poServerResponse.body.error); + return laResponse; + } + poServerResponse.body.bids.forEach((poResponse) => { + laResponse[laResponse.length] = { + requestId: poResponse.requestId, + cpm: poResponse.cpm, + currency: poResponse.currency, + width: poResponse.width, + height: poResponse.height, + ad: poResponse.ad, + ttl: poResponse.ttl, + creativeId: poResponse.creativeId, + netRevenue: poResponse.netRevenue, + pbid: poServerResponse.body.pbid, + }; + }); + return laResponse; + }, // interpretResponse + + /** + * Register bidder specific code, which will execute if a bid from this bidder won the auction. + * + * @param poBid The bid that won the auction + */ + onBidWon: (poBid) => { + utils.logInfo('onBidWon : ', poBid); + if (poBid.pbid) { + ajax(this.params.bidder_url + 'won/' + poBid.pbid); + } + }, // onBidWon +}; + +registerBidder(spec); diff --git a/modules/talkadsBidAdapter.md b/modules/talkadsBidAdapter.md new file mode 100644 index 00000000000..3ab8aaa8354 --- /dev/null +++ b/modules/talkadsBidAdapter.md @@ -0,0 +1,60 @@ +# Overview + +``` +Module Name: TalkAds Adapter +Module Type: Bidder Adapter +Maintainer: technical_team@natexo.com +``` + +# Description + +Module that connects to TalkAds bidder to fetch bids. +Both native and banner formats are supported but not at the same time. +The only currently supported currency is EUR. + +This adapter requires setup and approval from the Natexo programmatic team. + +# Configuration + + + + +# Test parameters + +## Test banner Parameters + +``` + var adUnits = [ + code: 'prebid_banner_test', + mediaTypes: { + banner: { + sizes: [[300, 250], [300, 600]], + } + }, + bids: [{ + bidder: 'talkads', + params: { + tag_id: 0, + bidder_url: 'https://d.natexo-programmatic.com/tad/tag/testbid', + }, + }] + ]; +``` + +## Test native parameters + +``` + var adUnits = [ + code: 'prebid_native_test', + mediaTypes: { + native: {} + }, + bids: [{ + bidder: 'talkads', + params: { + tag_id: 0, + bidder_url: 'https://d.natexo-programmatic.com/tad/tag/testbid', + }, + }] + ]; +``` diff --git a/test/spec/modules/talkadsBidAdapter_spec.js b/test/spec/modules/talkadsBidAdapter_spec.js new file mode 100644 index 00000000000..00f52ba7b6a --- /dev/null +++ b/test/spec/modules/talkadsBidAdapter_spec.js @@ -0,0 +1,231 @@ +import {expect} from 'chai'; +import {spec} from 'modules/talkadsBidAdapter.js'; +import {newBidder} from 'src/adapters/bidderFactory.js'; +import {config} from '../../../src/config'; +import {server} from '../../mocks/xhr'; + +describe('TalkAds adapter', function () { + const commonBidderRequest = { + refererInfo: { + referer: 'https://example.com/' + }, + timeout: 3000, + } + const commonBidRequest = { + bidder: 'talkads', + params: { + tag_id: 999999, + bidder_url: 'https://test.natexo-programmatic.com/tad/tag/prebid', + }, + bidId: '1a2b3c4d56e7f0', + auctionId: '12345678-1234-1a2b-3c4d-1a2b3c4d56e7', + transactionId: '4f68b713-04ba-4d7f-8df9-643bcdab5efb', + }; + const nativeBidRequestParams = { + nativeParams: {}, + }; + const bannerBidRequestParams = { + sizes: [[300, 250], [300, 600]], + }; + + /** + * isBidRequestValid + */ + describe('isBidRequestValid1', function() { + it('should fail when config is invalid', function () { + const bidRequest = { + ...commonBidRequest, + ...bannerBidRequestParams, + }; + bidRequest.params = Object.assign({}, bidRequest.params); + delete bidRequest.params; + expect(spec.isBidRequestValid(bidRequest)).to.equal(false); + }); + }); // isBidRequestValid1 + describe('isBidRequestValid2', function() { + it('should fail when config is invalid', function () { + const bidRequest = { + ...commonBidRequest, + ...bannerBidRequestParams, + }; + bidRequest.params = Object.assign({}, bidRequest.params); + delete bidRequest.params.bidder_url; + expect(spec.isBidRequestValid(bidRequest)).to.equal(false); + }); + }); // isBidRequestValid2 + describe('isBidRequestValid3', function() { + it('should fail when config is invalid', function () { + const bidRequest = { + ...commonBidRequest, + ...bannerBidRequestParams, + }; + bidRequest.params = Object.assign({}, bidRequest.params); + delete bidRequest.params.tag_id; + expect(spec.isBidRequestValid(bidRequest)).to.equal(false); + }); + }); // isBidRequestValid3 + describe('isBidRequestValid4', function() { + let bidRequest = { + ...commonBidRequest, + ...bannerBidRequestParams, + }; + it('should succeed when a banner bid is valid', function () { + expect(spec.isBidRequestValid(bidRequest)).to.equal(true); + }); + bidRequest = { + ...commonBidRequest, + ...nativeBidRequestParams, + }; + it('should succeed when a native bid is valid', function () { + expect(spec.isBidRequestValid(bidRequest)).to.equal(true); + }); + }); // isBidRequestValid4 + + /** + * buildRequests + */ + describe('buildRequests1', function() { + let bidRequest = { + ...commonBidRequest, + ...bannerBidRequestParams, + }; + const loServerRequest = { + cur: 'EUR', + timeout: commonBidderRequest.timeout, + auction_id: commonBidRequest.auctionId, + transaction_id: commonBidRequest.transactionId, + bids: [{ id: 0, bid_id: commonBidRequest.bidId, type: 'banner', size: bannerBidRequestParams.sizes }], + gdpr: { applies: false, consent: false }, + }; + it('should generate a valid banner bid request', function () { + let laResponse = spec.buildRequests([bidRequest], commonBidderRequest); + expect(laResponse.method).to.equal('POST'); + expect(laResponse.url).to.equal('https://test.natexo-programmatic.com/tad/tag/prebid/999999'); + expect(laResponse.data).to.equal(JSON.stringify(loServerRequest)); + }); + }); // buildRequests1 + describe('buildRequests2', function() { + let bidRequest = { + ...commonBidRequest, + ...nativeBidRequestParams, + }; + const loServerRequest = { + cur: 'EUR', + timeout: commonBidderRequest.timeout, + auction_id: commonBidRequest.auctionId, + transaction_id: commonBidRequest.transactionId, + bids: [{ id: 0, bid_id: commonBidRequest.bidId, type: 'native', size: [] }], + gdpr: { applies: false, consent: false }, + }; + it('should generate a valid native bid request', function () { + let laResponse = spec.buildRequests([bidRequest], commonBidderRequest); + expect(laResponse.method).to.equal('POST'); + expect(laResponse.url).to.equal('https://test.natexo-programmatic.com/tad/tag/prebid/999999'); + expect(laResponse.data).to.equal(JSON.stringify(loServerRequest)); + }); + const bidderRequest = { + ...commonBidderRequest, + gdprConsent: { gdprApplies: true, consentString: 'yes' } + }; + const loServerRequest2 = { + ...loServerRequest, + gdpr: { applies: true, consent: 'yes' }, + }; + it('should generate a valid native bid request', function () { + let laResponse = spec.buildRequests([bidRequest], bidderRequest); + expect(laResponse.method).to.equal('POST'); + expect(laResponse.url).to.equal('https://test.natexo-programmatic.com/tad/tag/prebid/999999'); + expect(laResponse.data).to.equal(JSON.stringify(loServerRequest2)); + }); + }); // buildRequests2 + + /** + * interpretResponse + */ + describe('interpretResponse1', function() { + it('should return empty array if no valid bids', function () { + const laResult = spec.interpretResponse({}, []) + expect(laResult).to.be.an('array').that.is.empty; + }); + const loServerResult = { + body: { status: 'error', error: 'aie' } + }; + it('should return empty array if there is an error', function () { + const laResult = spec.interpretResponse(loServerResult, []) + expect(laResult).to.be.an('array').that.is.empty; + }); + }); // interpretResponse1 + describe('interpretResponse2', function() { + const loServerResult = { + body: { + status: 'ok', + error: '', + pbid: '6147833a65749742875ace47', + bids: [{ + requestId: commonBidRequest.bidId, + cpm: 0.10, + currency: 'EUR', + width: 300, + height: 250, + ad: 'test ad', + ttl: 60, + creativeId: 'c123a456', + netRevenue: false, + }] + } + }; + const loExpected = [{ + requestId: '1a2b3c4d56e7f0', + cpm: 0.1, + currency: 'EUR', + width: 300, + height: 250, + ad: 'test ad', + ttl: 60, + creativeId: 'c123a456', + netRevenue: false, + pbid: '6147833a65749742875ace47' + }]; + it('should return a correct bid response', function () { + const laResult = spec.interpretResponse(loServerResult, []) + expect(JSON.stringify(laResult)).to.equal(JSON.stringify(loExpected)); + }); + }); // interpretResponse2 + + /** + * onBidWon + */ + describe('onBidWon', function() { + it('should not make an ajax call if pbid is null', function () { + const loBid = { + requestId: '1a2b3c4d56e7f0', + cpm: 0.1, + currency: 'EUR', + width: 300, + height: 250, + ad: 'test ad', + ttl: 60, + creativeId: 'c123a456', + netRevenue: false, + } + spec.onBidWon(loBid) + expect(server.requests.length).to.equals(0); + }); + it('should make an ajax call', function () { + const loBid = { + requestId: '1a2b3c4d56e7f0', + cpm: 0.1, + currency: 'EUR', + width: 300, + height: 250, + ad: 'test ad', + ttl: 60, + creativeId: 'c123a456', + netRevenue: false, + pbid: '6147833a65749742875ace47' + } + spec.onBidWon(loBid) + expect(server.requests[0].url).to.equals('https://test.natexo-programmatic.com/tad/tag/prebidwon/6147833a65749742875ace47'); + }); + }); // onBidWon +}); From 7123eae8323c151394ce5be5676e6ed6582dd01e Mon Sep 17 00:00:00 2001 From: kapil-tuptewar <91458408+kapil-tuptewar@users.noreply.github.com> Date: Tue, 12 Oct 2021 17:22:12 +0530 Subject: [PATCH 167/250] Pubmatic Bid Adapter: video.placement param missing message in debug (#7561) * Added video.placement param missing debug message * Added Adunit code along with message * Updated test cases for video placement missing scenario Co-authored-by: Kapil Tuptewar --- modules/pubmaticBidAdapter.js | 9 +++++ test/spec/modules/pubmaticBidAdapter_spec.js | 40 +++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/modules/pubmaticBidAdapter.js b/modules/pubmaticBidAdapter.js index 4c182c214a3..2d53bda4e78 100644 --- a/modules/pubmaticBidAdapter.js +++ b/modules/pubmaticBidAdapter.js @@ -17,6 +17,7 @@ const DEFAULT_HEIGHT = 0; const PREBID_NATIVE_HELP_LINK = 'http://prebid.org/dev-docs/show-native-ads.html'; const PUBLICATION = 'pubmatic'; // Your publication on Blue Billywig, potentially with environment (e.g. publication.bbvms.com or publication.test.bbvms.com) const RENDERER_URL = 'https://pubmatic.bbvms.com/r/'.concat('$RENDERER', '.js'); // URL of the renderer application +const MSG_VIDEO_PLACEMENT_MISSING = 'Video.Placement param missing'; const CUSTOM_PARAMS = { 'kadpageurl': '', // Custom page url 'gender': '', // User gender @@ -537,12 +538,20 @@ function _createBannerRequest(bid) { return bannerObj; } +export function checkVideoPlacement(videoData, adUnitCode) { + // Check for video.placement property. If property is missing display log message. + if (!deepAccess(videoData, 'placement')) { + logWarn(MSG_VIDEO_PLACEMENT_MISSING + ' for ' + adUnitCode); + }; +} + function _createVideoRequest(bid) { var videoData = mergeDeep(deepAccess(bid.mediaTypes, 'video'), bid.params.video); var videoObj; if (videoData !== UNDEFINED) { videoObj = {}; + checkVideoPlacement(videoData, bid.adUnitCode); for (var key in VIDEO_CUSTOM_PARAMS) { if (videoData.hasOwnProperty(key)) { videoObj[key] = _checkParamDataType(key, videoData[key], VIDEO_CUSTOM_PARAMS[key]); diff --git a/test/spec/modules/pubmaticBidAdapter_spec.js b/test/spec/modules/pubmaticBidAdapter_spec.js index 47b9c984ff5..8905dfa5924 100644 --- a/test/spec/modules/pubmaticBidAdapter_spec.js +++ b/test/spec/modules/pubmaticBidAdapter_spec.js @@ -1,5 +1,5 @@ import {expect} from 'chai'; -import {spec} from 'modules/pubmaticBidAdapter.js'; +import {spec, checkVideoPlacement} from 'modules/pubmaticBidAdapter.js'; import * as utils from 'src/utils.js'; import {config} from 'src/config.js'; import { createEidsArray } from 'modules/userId/eids.js'; @@ -3822,5 +3822,43 @@ describe('PubMatic adapter', function () { expect(bidRequests[0].params.dctr).to.equal('key1:val1,val2|key2:val1'); }); }) + + describe('Checking for Video.Placement property', function() { + let sandbox, utilsMock; + const adUnit = 'Div1'; + const msg_placement_missing = 'Video.Placement param missing for Div1'; + let videoData = { + battr: [6, 7], + skipafter: 15, + maxduration: 50, + context: 'instream', + playerSize: [640, 480], + skip: 0, + connectiontype: [1, 2, 6], + skipmin: 10, + minduration: 10, + mimes: ['video/mp4', 'video/x-flv'], + } + beforeEach(() => { + utilsMock = sinon.mock(utils); + sandbox = sinon.sandbox.create(); + sandbox.spy(utils, 'logWarn'); + }); + + afterEach(() => { + utilsMock.restore(); + sandbox.restore(); + }) + + it('should log Video.Placement param missing', function() { + checkVideoPlacement(videoData, adUnit); + sinon.assert.calledWith(utils.logWarn, msg_placement_missing); + }) + it('shoud not log Video.Placement param missing', function() { + videoData['placement'] = 1; + checkVideoPlacement(videoData, adUnit); + sinon.assert.neverCalledWith(utils.logWarn, msg_placement_missing); + }) + }); }); }); From b2fe1941fcecf325b36ea6a4b2a7155f83080c33 Mon Sep 17 00:00:00 2001 From: Filip Stamenkovic Date: Tue, 12 Oct 2021 16:15:32 +0200 Subject: [PATCH 168/250] replace Array.from function and use from core-js (#7562) --- modules/mediakeysBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mediakeysBidAdapter.js b/modules/mediakeysBidAdapter.js index ea0ce897395..72dca2f1add 100644 --- a/modules/mediakeysBidAdapter.js +++ b/modules/mediakeysBidAdapter.js @@ -1,4 +1,5 @@ import find from 'core-js-pure/features/array/find.js'; +import arrayFrom from 'core-js-pure/features/array/from'; import { getWindowTop, isFn, logWarn, getDNT, deepAccess, isArray, inIframe, mergeDeep, isStr, isEmpty, deepSetValue, deepClone, parseUrl, cleanObj, logError, triggerPixel, isInteger, isNumber } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; @@ -54,7 +55,7 @@ const ORTB_VIDEO_PARAMS = { skipmin: value => isInteger(value), skipafter: value => isInteger(value), sequence: value => isInteger(value), - battr: value => Array.isArray(value) && value.every(v => Array.from({length: 17}, (_, i) => i + 1).indexOf(v) !== -1), + battr: value => Array.isArray(value) && value.every(v => arrayFrom({length: 17}, (_, i) => i + 1).indexOf(v) !== -1), maxextended: value => isInteger(value), minbitrate: value => isInteger(value), maxbitrate: value => isInteger(value), From b14589bae92ded9fa66e9a0ae76eacb6ad4b3556 Mon Sep 17 00:00:00 2001 From: Denis Logachov Date: Tue, 12 Oct 2021 17:27:08 +0300 Subject: [PATCH 169/250] Adkernel Bid Adapter: add turktelekom alias (#7559) --- modules/adkernelBidAdapter.js | 3 +- modules/turktelekomBidAdapter.md | 49 -------------------------------- 2 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 modules/turktelekomBidAdapter.md diff --git a/modules/adkernelBidAdapter.js b/modules/adkernelBidAdapter.js index 7c685a64255..11c8b464a7e 100644 --- a/modules/adkernelBidAdapter.js +++ b/modules/adkernelBidAdapter.js @@ -75,7 +75,8 @@ export const spec = { {code: 'denakop'}, {code: 'rtbanalytica'}, {code: 'unibots'}, - {code: 'ergadx'} + {code: 'ergadx'}, + {code: 'turktelekom'} ], supportedMediaTypes: [BANNER, VIDEO, NATIVE], diff --git a/modules/turktelekomBidAdapter.md b/modules/turktelekomBidAdapter.md deleted file mode 100644 index 360e7f95230..00000000000 --- a/modules/turktelekomBidAdapter.md +++ /dev/null @@ -1,49 +0,0 @@ -# Overview - -Module Name: Türk Telekom Bidder Adapter -Module Type: Bidder Adapter -Maintainer: turktelssp@gmail.com - -# Description - -Module that connects to Türk Telekom demand source to fetch bids. -Türk Telekom Bid Adapter supports Banner and Video (instream and outstream). - -# Test Parameters -``` - var adUnits = [ - { - code: 'test-div', - mediaTypes: { - banner: { - sizes: [[300, 250], [300,600]] - } - }, - bids: [ - { - bidder: "turktelekom", - params: { - uid: 17, - priceType: 'gross' // by default is 'net' - } - } - ] - },{ - code: 'test-div', - mediaTypes: { - video: { - playerSize: [[640, 360]], - context: 'instream' - } - }, - bids: [ - { - bidder: "turktelekom", - params: { - uid: 19 - } - } - ] - } - ]; -``` \ No newline at end of file From 74cd51a2006d39d2585557e715b5eded74f0f6f0 Mon Sep 17 00:00:00 2001 From: Adam Browning <19834421+adam-browning@users.noreply.github.com> Date: Tue, 12 Oct 2021 18:13:12 +0300 Subject: [PATCH 170/250] Yahoo SSP Bid Adapter: Initial Release (#7522) --- modules/yahoosspBidAdapter.js | 637 +++++++++ modules/yahoosspBidAdapter.md | 795 +++++++++++ test/spec/modules/yahoosspBidAdapter_spec.js | 1305 ++++++++++++++++++ 3 files changed, 2737 insertions(+) create mode 100644 modules/yahoosspBidAdapter.js create mode 100644 modules/yahoosspBidAdapter.md create mode 100644 test/spec/modules/yahoosspBidAdapter_spec.js diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js new file mode 100644 index 00000000000..35fc2ba7b59 --- /dev/null +++ b/modules/yahoosspBidAdapter.js @@ -0,0 +1,637 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER, VIDEO } from '../src/mediaTypes.js'; +import { deepAccess, isFn, isStr, isNumber, isArray, isEmpty, isPlainObject, generateUUID, logInfo, logWarn } from '../src/utils.js'; +import { config } from '../src/config.js'; +import { Renderer } from '../src/Renderer.js'; + +const INTEGRATION_METHOD = 'prebid.js'; +const BIDDER_CODE = 'yahoossp'; +const ADAPTER_VERSION = '1.0.0'; +const PREBID_VERSION = '$prebid.version$'; +const DEFAULT_BID_TTL = 300; +const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011'; +const TEST_MODE_PUBID_DCN = '1234567'; +const TEST_MODE_BANNER_POS = '8a969978017a7aaabab4ab0bc01a0009'; +const TEST_MODE_VIDEO_POS = '8a96958a017a7a57ac375d50c0c700cc'; +const DEFAULT_RENDERER_TIMEOUT = 700; +const DEFAULT_CURRENCY = 'USD'; +const SSP_ENDPOINT_DCN_POS = 'https://c2shb.pubgw.yahoo.com/bidRequest'; +const SSP_ENDPOINT_PUBID = 'https://c2shb.pubgw.yahoo.com/admax/bid/partners/PBJS'; +const SUPPORTED_USER_ID_SOURCES = [ + 'admixer.net', + 'adserver.org', + 'adtelligent.com', + 'akamai.com', + 'amxrtb.com', + 'audigent.com', + 'britepool.com', + 'criteo.com', + 'crwdcntrl.net', + 'deepintent.com', + 'hcn.health', + 'id5-sync.com', + 'idx.lat', + 'intentiq.com', + 'intimatemerger.com', + 'liveintent.com', + 'liveramp.com', + 'mediawallahscript.com', + 'merkleinc.com', + 'netid.de', + 'neustar.biz', + 'nextroll.com', + 'novatiq.com', + 'parrable.com', + 'pubcid.org', + 'quantcast.com', + 'quantcast.com', + 'tapad.com', + 'uidapi.com', + 'verizonmedia.com', + 'yahoo.com', + 'zeotap.com' +]; + +/* Utility functions */ +function hasPurpose1Consent(bidderRequest) { + if (bidderRequest && bidderRequest.gdprConsent) { + if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) { + return !!false; + } + } + return true; +} + +function getSize(size) { + return { + w: parseInt(size[0]), + h: parseInt(size[1]) + } +} + +function transformSizes(sizes) { + if (isArray(sizes) && sizes.length === 2 && !isArray(sizes[0])) { + return [ getSize(sizes) ]; + } + return sizes.map(getSize); +} + +function extractUserSyncUrls(syncOptions, pixels) { + let itemsRegExp = /(img|iframe)[\s\S]*?src\s*=\s*("|')(.*?)\2/gi; + let tagNameRegExp = /\w*(?=\s)/; + let srcRegExp = /src=("|')(.*?)\1/; + let userSyncObjects = []; + + if (pixels) { + let matchedItems = pixels.match(itemsRegExp); + if (matchedItems) { + matchedItems.forEach(item => { + let tagName = item.match(tagNameRegExp)[0]; + let url = item.match(srcRegExp)[2]; + + if (tagName && url) { + let tagType = tagName.toLowerCase() === 'img' ? 'image' : 'iframe'; + if ((!syncOptions.iframeEnabled && tagType === 'iframe') || + (!syncOptions.pixelEnabled && tagType === 'image')) { + return; + } + userSyncObjects.push({ + type: tagType, + url: url + }); + } + }); + } + } + + return userSyncObjects; +} + +function getSupportedEids(bid) { + if (isArray(deepAccess(bid, 'userIdAsEids'))) { + return bid.userIdAsEids.filter(eid => { + return SUPPORTED_USER_ID_SOURCES.indexOf(eid.source) !== -1; + }); + } + return []; +} + +function isSecure(bid) { + return deepAccess(bid, 'params.bidOverride.imp.secure') || (document.location.protocol === 'https:') ? 1 : 0; +}; + +function getPubIdMode(bid) { + let pubIdMode; + if (deepAccess(bid, 'params.pubId')) { + pubIdMode = true; + } else if (deepAccess(bid, 'params.dcn') && deepAccess(bid, 'params.pos')) { + pubIdMode = false; + }; + return pubIdMode; +}; + +function getAdapterMode() { + let adapterMode = config.getConfig('yahoossp.mode'); + adapterMode = adapterMode ? adapterMode.toLowerCase() : undefined; + if (typeof adapterMode === 'undefined' || adapterMode === BANNER) { + return BANNER; + } else if (adapterMode === VIDEO) { + return VIDEO; + } else if (adapterMode === 'all') { + return '*'; + } +}; + +function getResponseFormat(bid) { + const adm = bid.adm; + if (adm.includes('o2playerSettings') || adm.includes('YAHOO.VideoPlatform.VideoPlayer') || adm.includes('AdPlacement')) { + return BANNER; + } else if (adm.includes('VAST')) { + return VIDEO; + } +}; + +function getFloorModuleData(bid) { + const adapterMode = getAdapterMode(); + const getFloorRequestObject = { + currency: deepAccess(bid, 'params.bidOverride.cur') || DEFAULT_CURRENCY, + mediaType: adapterMode, + size: '*' + }; + return (isFn(bid.getFloor)) ? bid.getFloor(getFloorRequestObject) : false; +}; + +function filterBidRequestByMode(validBidRequests) { + const mediaTypesMode = getAdapterMode(); + let result = []; + if (mediaTypesMode === BANNER) { + result = validBidRequests.filter(bid => { + return Object.keys(bid.mediaTypes).some(item => item === BANNER); + }); + } else if (mediaTypesMode === VIDEO) { + result = validBidRequests.filter(bid => { + return Object.keys(bid.mediaTypes).some(item => item === VIDEO); + }); + } else if (mediaTypesMode === '*') { + result = validBidRequests.filter(bid => { + return Object.keys(bid.mediaTypes).some(item => item === BANNER || item === VIDEO); + }); + }; + return result; +}; + +function validateAppendObject(validationType, allowedKeys, inputObject, appendToObject) { + const outputObject = { + ...appendToObject + }; + + for (const objectKey in inputObject) { + switch (validationType) { + case 'string': + if (allowedKeys.includes(objectKey) && isStr(inputObject[objectKey])) { + outputObject[objectKey] = inputObject[objectKey]; + }; + break; + case 'number': + if (allowedKeys.includes(objectKey) && isNumber(inputObject[objectKey])) { + outputObject[objectKey] = inputObject[objectKey]; + }; + break; + + case 'array': + if (allowedKeys.includes(objectKey) && isArray(inputObject[objectKey])) { + outputObject[objectKey] = inputObject[objectKey]; + }; + break; + case 'object': + if (allowedKeys.includes(objectKey) && isPlainObject(inputObject[objectKey])) { + outputObject[objectKey] = inputObject[objectKey]; + }; + break; + case 'objectAllKeys': + if (isPlainObject(inputObject)) { + outputObject[objectKey] = inputObject[objectKey]; + }; + break; + }; + }; + return outputObject; +}; + +function getTtl(bidderRequest) { + const globalTTL = config.getConfig('yahoossp.ttl'); + return globalTTL ? validateTTL(globalTTL) : validateTTL(deepAccess(bidderRequest, 'params.ttl')); +}; + +function validateTTL(ttl) { + return (isNumber(ttl) && ttl > 0 && ttl < 3600) ? ttl : DEFAULT_BID_TTL +}; + +function isNotEmptyStr(value) { + return (isStr(value) && value.length > 0); +}; + +function generateOpenRtbObject(bidderRequest, bid) { + if (bidderRequest) { + let outBoundBidRequest = { + id: generateUUID(), + cur: [getFloorModuleData(bidderRequest).currency || deepAccess(bid, 'params.bidOverride.cur') || DEFAULT_CURRENCY], + imp: [], + site: { + page: deepAccess(bidderRequest, 'refererInfo.referer'), + }, + device: { + dnt: 0, + ua: navigator.userAgent, + ip: deepAccess(bid, 'params.bidOverride.device.ip') || deepAccess(bid, 'params.ext.ip') || undefined + }, + regs: { + ext: { + 'us_privacy': bidderRequest.uspConsent ? bidderRequest.uspConsent : '', + gdpr: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies ? 1 : 0 + } + }, + source: { + ext: { + hb: 1, + adapterver: ADAPTER_VERSION, + prebidver: PREBID_VERSION, + integration: { + name: INTEGRATION_METHOD, + ver: PREBID_VERSION + } + }, + fd: 1 + }, + user: { + ext: { + consent: bidderRequest.gdprConsent && bidderRequest.gdprConsent.gdprApplies + ? bidderRequest.gdprConsent.consentString : '', + eids: getSupportedEids(bid) + } + } + }; + + if (getPubIdMode(bid) === true) { + outBoundBidRequest.site.publisher = { + id: bid.params.pubId + } + if (deepAccess(bid, 'params.bidOverride.site.id') || deepAccess(bid, 'params.siteId')) { + outBoundBidRequest.site.id = deepAccess(bid, 'params.bidOverride.site.id') || bid.params.siteId; + } + } else { + outBoundBidRequest.site.id = bid.params.dcn; + }; + + if (config.getConfig('ortb2')) { + outBoundBidRequest = appendFirstPartyData(outBoundBidRequest, bid); + }; + + if (deepAccess(bid, 'schain')) { + outBoundBidRequest.source.ext.schain = bid.schain; + outBoundBidRequest.source.ext.schain.nodes[0].rid = outBoundBidRequest.id; + }; + + return outBoundBidRequest; + }; +}; + +function appendImpObject(bid, openRtbObject) { + const mediaTypeMode = getAdapterMode(); + + if (openRtbObject && bid) { + const impObject = { + id: bid.bidId, + secure: isSecure(bid), + bidfloor: getFloorModuleData(bid).floor || deepAccess(bid, 'params.bidOverride.imp.bidfloor') + }; + + if (bid.mediaTypes.banner && (typeof mediaTypeMode === 'undefined' || mediaTypeMode === BANNER || mediaTypeMode === '*')) { + impObject.banner = { + mimes: bid.mediaTypes.banner.mimes || ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: transformSizes(bid.sizes) + }; + if (bid.mediaTypes.banner.pos) { + impObject.banner.pos = bid.mediaTypes.banner.pos; + }; + }; + + if (bid.mediaTypes.video && (mediaTypeMode === VIDEO || mediaTypeMode === '*')) { + const playerSize = transformSizes(bid.mediaTypes.video.playerSize); + impObject.video = { + mimes: deepAccess(bid, 'params.bidOverride.imp.video.mimes') || bid.mediaTypes.video.mimes || ['video/mp4', 'application/javascript'], + w: deepAccess(bid, 'params.bidOverride.imp.video.w') || playerSize[0].w, + h: deepAccess(bid, 'params.bidOverride.imp.video.h') || playerSize[0].h, + maxbitrate: deepAccess(bid, 'params.bidOverride.imp.video.maxbitrate') || bid.mediaTypes.video.maxbitrate || undefined, + maxduration: deepAccess(bid, 'params.bidOverride.imp.video.maxduration') || bid.mediaTypes.video.maxduration || undefined, + minduration: deepAccess(bid, 'params.bidOverride.imp.video.minduration') || bid.mediaTypes.video.minduration || undefined, + api: deepAccess(bid, 'params.bidOverride.imp.video.api') || bid.mediaTypes.video.api || [2], + delivery: deepAccess(bid, 'params.bidOverride.imp.video.delivery') || bid.mediaTypes.video.delivery || undefined, + pos: deepAccess(bid, 'params.bidOverride.imp.video.pos') || bid.mediaTypes.video.pos || undefined, + playbackmethod: deepAccess(bid, 'params.bidOverride.imp.video.playbackmethod') || bid.mediaTypes.video.playbackmethod || undefined, + placement: deepAccess(bid, 'params.bidOverride.imp.video.placement') || bid.mediaTypes.video.placement || undefined, + linearity: deepAccess(bid, 'params.bidOverride.imp.video.linearity') || bid.mediaTypes.video.linearity || 1, + protocols: deepAccess(bid, 'params.bidOverride.imp.video.protocols') || bid.mediaTypes.video.protocols || [2, 5], + startdelay: deepAccess(bid, 'params.bidOverride.imp.video.startdelay') || bid.mediaTypes.video.startdelay || 0, + rewarded: deepAccess(bid, 'params.bidOverride.imp.video.rewarded') || undefined, + } + } + + impObject.ext = { + dfp_ad_unit_code: bid.adUnitCode + }; + + if (deepAccess(bid, 'params.kvp') && isPlainObject(bid.params.kvp)) { + impObject.ext.kvs = {}; + for (const key in bid.params.kvp) { + if (isStr(bid.params.kvp[key]) || isNumber(bid.params.kvp[key])) { + impObject.ext.kvs[key] = bid.params.kvp[key]; + } else if (isArray(bid.params.kvp[key])) { + const array = bid.params.kvp[key]; + if (array.every(value => isStr(value)) || array.every(value => isNumber(value))) { + impObject.ext.kvs[key] = bid.params.kvp[key]; + } + } + } + }; + + if (deepAccess(bid, 'ortb2Imp.ext.data') && isPlainObject(bid.ortb2Imp.ext.data)) { + impObject.ext.data = bid.ortb2Imp.ext.data; + }; + + if (getPubIdMode(bid) === false) { + impObject.tagid = bid.params.pos; + impObject.ext.pos = bid.params.pos; + } else if (deepAccess(bid, 'params.placementId')) { + impObject.tagid = bid.params.placementId + }; + + openRtbObject.imp.push(impObject); + }; +}; + +function appendFirstPartyData(outBoundBidRequest, bid) { + const ortb2Object = config.getConfig('ortb2'); + const siteObject = deepAccess(ortb2Object, 'site') || undefined; + const siteContentObject = deepAccess(siteObject, 'content') || undefined; + const siteContentDataArray = deepAccess(siteObject, 'content.data') || undefined; + const appContentObject = deepAccess(ortb2Object, 'app.content') || undefined; + const appContentDataArray = deepAccess(ortb2Object, 'app.content.data') || undefined; + const userObject = deepAccess(ortb2Object, 'user') || undefined; + + if (siteObject && isPlainObject(siteObject)) { + const allowedSiteStringKeys = ['name', 'domain', 'page', 'ref', 'keywords', 'search']; + const allowedSiteArrayKeys = ['cat', 'sectioncat', 'pagecat']; + const allowedSiteObjectKeys = ['ext']; + outBoundBidRequest.site = validateAppendObject('string', allowedSiteStringKeys, siteObject, outBoundBidRequest.site); + outBoundBidRequest.site = validateAppendObject('array', allowedSiteArrayKeys, siteObject, outBoundBidRequest.site); + outBoundBidRequest.site = validateAppendObject('object', allowedSiteObjectKeys, siteObject, outBoundBidRequest.site); + }; + + if (siteContentObject && isPlainObject(siteContentObject)) { + const allowedContentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; + const allowedContentNumberkeys = ['episode', 'prodq', 'context', 'livestream', 'len']; + const allowedContentArrayKeys = ['cat']; + const allowedContentObjectKeys = ['ext']; + outBoundBidRequest.site.content = validateAppendObject('string', allowedContentStringKeys, siteContentObject, outBoundBidRequest.site.content); + outBoundBidRequest.site.content = validateAppendObject('number', allowedContentNumberkeys, siteContentObject, outBoundBidRequest.site.content); + outBoundBidRequest.site.content = validateAppendObject('array', allowedContentArrayKeys, siteContentObject, outBoundBidRequest.site.content); + outBoundBidRequest.site.content = validateAppendObject('object', allowedContentObjectKeys, siteContentObject, outBoundBidRequest.site.content); + + if (siteContentDataArray && isArray(siteContentDataArray)) { + siteContentDataArray.every(dataObject => { + let newDataObject = {}; + const allowedContentDataStringKeys = ['id', 'name']; + const allowedContentDataArrayKeys = ['segment']; + const allowedContentDataObjectKeys = ['ext']; + newDataObject = validateAppendObject('string', allowedContentDataStringKeys, dataObject, newDataObject); + newDataObject = validateAppendObject('array', allowedContentDataArrayKeys, dataObject, newDataObject); + newDataObject = validateAppendObject('object', allowedContentDataObjectKeys, dataObject, newDataObject); + outBoundBidRequest.site.content.data = []; + outBoundBidRequest.site.content.data.push(newDataObject); + }) + }; + }; + + if (appContentObject && isPlainObject(appContentObject)) { + if (appContentDataArray && isArray(appContentDataArray)) { + appContentDataArray.every(dataObject => { + let newDataObject = {}; + const allowedContentDataStringKeys = ['id', 'name']; + const allowedContentDataArrayKeys = ['segment']; + const allowedContentDataObjectKeys = ['ext']; + newDataObject = validateAppendObject('string', allowedContentDataStringKeys, dataObject, newDataObject); + newDataObject = validateAppendObject('array', allowedContentDataArrayKeys, dataObject, newDataObject); + newDataObject = validateAppendObject('object', allowedContentDataObjectKeys, dataObject, newDataObject); + outBoundBidRequest.app = { + content: { + data: [] + } + }; + outBoundBidRequest.app.content.data.push(newDataObject); + }) + }; + }; + + if (userObject && isPlainObject(userObject)) { + const allowedUserStrings = ['id', 'buyeruid', 'gender', 'keywords', 'customdata']; + const allowedUserNumbers = ['yob']; + const allowedUserArrays = ['data']; + const allowedUserObjects = ['ext']; + outBoundBidRequest.user = validateAppendObject('string', allowedUserStrings, userObject, outBoundBidRequest.user); + outBoundBidRequest.user = validateAppendObject('number', allowedUserNumbers, userObject, outBoundBidRequest.user); + outBoundBidRequest.user = validateAppendObject('array', allowedUserArrays, userObject, outBoundBidRequest.user); + outBoundBidRequest.user.ext = validateAppendObject('object', allowedUserObjects, userObject, outBoundBidRequest.user.ext); + }; + + return outBoundBidRequest; +}; + +function generateServerRequest({payload, requestOptions, bidderRequest}) { + const pubIdMode = getPubIdMode(bidderRequest); + let sspEndpoint = config.getConfig('yahoossp.endpoint') || SSP_ENDPOINT_DCN_POS; + + if (pubIdMode === true) { + sspEndpoint = config.getConfig('yahoossp.endpoint') || SSP_ENDPOINT_PUBID; + }; + + if (deepAccess(bidderRequest, 'params.testing.e2etest') === true) { + logInfo('yahoossp adapter e2etest mode is active'); + requestOptions.withCredentials = false; + + if (pubIdMode === true) { + payload.site.id = TEST_MODE_PUBID_DCN; + } else { + const mediaTypeMode = getAdapterMode(); + payload.site.id = TEST_MODE_DCN; + payload.imp.forEach(impObject => { + impObject.ext.e2eTestMode = true; + if (mediaTypeMode === BANNER) { + impObject.tagid = TEST_MODE_BANNER_POS; // banner passback + } else if (mediaTypeMode === VIDEO) { + impObject.tagid = TEST_MODE_VIDEO_POS; // video passback + } else { + logWarn('yahoossp adapter e2etest mode does not support yahoossp.mode="all". \n Please specify either "banner" or "video"'); + logWarn('yahoossp adapter e2etest mode: Please make sure your adUnit matches the yahoossp.mode video or banner'); + } + }); + } + }; + logWarn('yahoossp adapter endpoint override enabled. Pointing requests to: ', sspEndpoint); + + return { + url: sspEndpoint, + method: 'POST', + data: payload, + options: requestOptions, + bidderRequest: bidderRequest + }; +}; + +function createRenderer(bidderRequest, bidResponse) { + const renderer = Renderer.install({ + url: 'https://cdn.vidible.tv/prod/hb-outstream-renderer/renderer.js', + loaded: false, + adUnitCode: bidderRequest.adUnitCode + }) + + try { + renderer.setRender(function(bidResponse) { + setTimeout(function() { + // eslint-disable-next-line no-undef + o2PlayerRender(bidResponse); + }, deepAccess(bidderRequest, 'params.testing.renderer.setTimeout') || DEFAULT_RENDERER_TIMEOUT); + }); + } catch (error) { + logWarn('yahoossp renderer error: setRender() failed', error); + } + return renderer; +} +/* Utility functions */ + +export const spec = { + code: BIDDER_CODE, + aliases: [], + supportedMediaTypes: [BANNER, VIDEO], + + isBidRequestValid: function(bid) { + const params = bid.params; + if (deepAccess(params, 'testing.e2etest') === true) { + return true; + } else if ( + isPlainObject(params) && + (isNotEmptyStr(params.pubId) || (isNotEmptyStr(params.dcn) && isNotEmptyStr(params.pos))) + ) { + return true; + } else { + logWarn('yahoossp bidder params missing or incorrect, please pass object with either: dcn & pos OR pubId'); + return false; + } + }, + + buildRequests: function(validBidRequests, bidderRequest) { + if (isEmpty(validBidRequests) || isEmpty(bidderRequest)) { + logWarn('yahoossp Adapter: buildRequests called with either empty "validBidRequests" or "bidderRequest"'); + return undefined; + }; + + const requestOptions = { + contentType: 'application/json', + customHeaders: { + 'x-openrtb-version': '2.5' + } + }; + + requestOptions.withCredentials = hasPurpose1Consent(bidderRequest); + + const filteredBidRequests = filterBidRequestByMode(validBidRequests); + + if (config.getConfig('yahoossp.singleRequestMode') === true) { + const payload = generateOpenRtbObject(bidderRequest, filteredBidRequests[0]); + filteredBidRequests.forEach(bid => { + appendImpObject(bid, payload); + }); + + return generateServerRequest({payload, requestOptions, bidderRequest}); + } + + return filteredBidRequests.map(bid => { + const payloadClone = generateOpenRtbObject(bidderRequest, bid); + appendImpObject(bid, payloadClone); + return generateServerRequest({payload: payloadClone, requestOptions, bidderRequest: bid}); + }); + }, + + interpretResponse: function(serverResponse, { data, bidderRequest }) { + const response = []; + if (!serverResponse.body || !Array.isArray(serverResponse.body.seatbid)) { + return response; + } + + let seatbids = serverResponse.body.seatbid; + seatbids.forEach(seatbid => { + let bid; + + try { + bid = seatbid.bid[0]; + } catch (e) { + return response; + } + + let cpm = (bid.ext && bid.ext.encp) ? bid.ext.encp : bid.price; + + let bidResponse = { + adId: bid.id, + adUnitCode: bidderRequest.adUnitCode, + requestId: bid.impid, + bidderCode: spec.code, + cpm: cpm, + width: bid.w, + height: bid.h, + creativeId: bid.crid || 0, + currency: bid.cur || DEFAULT_CURRENCY, + dealId: bid.dealid ? bid.dealid : null, + netRevenue: true, + ttl: getTtl(bidderRequest), + meta: { + advertiserDomains: bid.adomain, + } + }; + + const responseAdmFormat = getResponseFormat(bid); + if (responseAdmFormat === BANNER) { + bidResponse.mediaType = BANNER; + bidResponse.ad = bid.adm; + bidResponse.meta.mediaType = BANNER; + } else if (responseAdmFormat === VIDEO) { + bidResponse.mediaType = VIDEO; + bidResponse.meta.mediaType = VIDEO; + bidResponse.vastXml = bid.adm; + + if (bid.nurl) { + bidResponse.vastUrl = bid.nurl; + }; + } + + if (deepAccess(bidderRequest, 'mediaTypes.video.context') === 'outstream' && !bidderRequest.renderer) { + bidResponse.renderer = createRenderer(bidderRequest, bidResponse) || undefined; + } + + response.push(bidResponse); + }); + + return response; + }, + + getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) { + const bidResponse = !isEmpty(serverResponses) && serverResponses[0].body; + + if (bidResponse && bidResponse.ext && bidResponse.ext.pixels) { + return extractUserSyncUrls(syncOptions, bidResponse.ext.pixels); + } + + return []; + } +}; + +registerBidder(spec); diff --git a/modules/yahoosspBidAdapter.md b/modules/yahoosspBidAdapter.md new file mode 100644 index 00000000000..5433e1fe3c9 --- /dev/null +++ b/modules/yahoosspBidAdapter.md @@ -0,0 +1,795 @@ +# Overview +**Module Name:** yahoossp Bid Adapter +**Module Type:** Bidder Adapter +**Maintainer:** hb-fe-tech@yahooinc.com + +# Description +The Yahoo SSP Bid Adapter is an OpenRTB interface that consolidates all previous "Oath.inc" adapters such as: "aol", "oneMobile", "oneDisplay" & "oneVideo" supply-side platforms. + +# Supported Features: +* Media Types: Banner & Video +* Outstream renderer +* Multi-format adUnits +* Schain module +* Price floors module +* Advertiser domains +* End-2-End self-served testing mode +* Outstream renderer/Player +* User ID Modules - ConnectId and others +* First Party Data (ortb2 & ortb2Imp) +* Custom TTL (time to live) + + +# Adapter Request mode +Since the yahoossp adapter now supports both Banner and Video adUnits a controller was needed to allow you to define when the adapter should generate a bid-requests to our Yahoo SSP. + +**Important!** By default the adapter mode is set to "banner" only. +This means that you do not need to explicitly declare the yahoossp.mode in the Global config to initiate banner adUnit requests. + +## Request modes: +* **undefined** - (Default) Will generate bid-requests for "Banner" formats only. +* **banner** - Will generate bid-requests for "Banner" formats only (Explicit declaration). +* **video** - Will generate bid-requests for "Video" formats only (Explicit declaration). +* **all** - Will generate bid-requests for both "Banner" & "Video" formats + +**Important!** When setting yahoossp.mode = 'all' Make sure your Yahoo SSP Placement (pos id) supports both Banner & Video placements. +If it does not, the Yahoo SSP will respond only in the format it is set too. + +```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'banner' // 'all', 'video', 'banner' (default) + } +}); +``` +# Integration Options +The `yahoossp` bid adapter supports 2 types of integration: +1. **dcn & pos** DEFAULT (Site/App & Position targeting) - For Display partners/publishers. +2. **pubId** (Publisher ID) - For legacy "oneVideo" AND New partners/publishers. +**Important:** pubId integration (option 2) is only possible when your Seller account is setup for "Inventory Mapping". + +**Please Note:** Most examples in this file are using dcn & pos. + +## Who is currently eligible for "pubId" integration +At this time, only the following partners/publishers are eligble for pubId integration: +1. New partners/publishers that do not have any existing accounts on Yahoo SSP (aka: aol, oneMobile, oneDisplay). +2. Video SSP (oneVideo) partners/publishers that + A. Do not have any display/banner inventory. + B. Do not have any existing accounts on Yahoo SSP (aka: aol, oneMobile, oneDisplay). + +# Mandaotory Bidder Parameters +## dcn & pos (DEFAULT) +The minimal requirements for the 'yahoossp' bid adapter to generate an outbound bid-request to our Yahoo SSP are: +1. At least 1 adUnit including mediaTypes: banner or video +2. **bidder.params** object must include: + A. **dcn:** Yahoo SSP Site/App inventory parameter. + B. **pos:** Yahoo SSP position inventory parameter. + +### Example: dcn & pos Mandatory Parameters (Single banner adUnit) +```javascript +const adUnits = [{ + code: 'your-placement', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + bids: [ + { + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from SSP + pos: '8a969978017a7aaabab4ab0bc01a0009' // Placement ID provided from SSP + } + } + ] +}]; +``` + +## pubId +The minimal requirements for the 'yahoossp' bid adapter to generate an outbound bid-request to our Yahoo SSP are: +1. At least 1 adUnit including mediaTypes: banner or video +2. **bidder.params** object must include: + A. **pubId:** Yahoo SSP Publisher ID (AKA oneVideo pubId/Exchange name) + +### Example: pubId Mandatory Parameters (Single banner adUnit) +```javascript +const adUnits = [{ + code: 'your-placement', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + bids: [ + { + bidder: 'yahoossp', + params: { + pubId: 'DemoPublisher', // Publisher External ID provided from Yahoo SSP. + } + } + ] +}]; +``` +# Advanced adUnit Examples: +## Banner +```javascript +const adUnits = [{ + code: 'banner-adUnit', + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from Yahoo SSP + pos: '8a969978017a7aaabab4ab0bc01a0009', // Placement ID provided from Yahoo SSP + } + } + }] +}]; +``` +## Video Instream +**Important!** Make sure that the Yahoo SSP Placement type (in-stream) matches the adUnit video inventory type. +**Note:** Make sure to set the adapter mode to allow video requests by setting it to mode: 'video' OR mode: 'all'. +```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'video' + } +}); + +const adUnits = [{ + code: 'video-adUnit', + mediaTypes: { + video: { + context: 'instream', + playerSize: [ + [300, 250] + ], + mimes: ['video/mp4','application/javascript'], + api: [2] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from Yahoo SSP + pos: '8a96958a017a7a57ac375d50c0c700cc', // Placement ID provided from Yahoo SSP + } + }] +}]; +``` +## Video Outstream +**Important!** Make sure that the Yahoo SSP Placement type (in-feed/ in-article) matches the adUnit video inventory type. +**Note:** Make sure to set the adapter mode to allow video requests by setting it to mode: 'video' OR mode: 'all' +```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'video' + } +}); + +const adUnits = [{ + code: 'video-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + mimes: ['video/mp4','application/javascript'], + api: [2] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from Yahoo SSP + pos: '8a96958a017a7a57ac375d50c0c700cc', // Placement ID provided from Yahoo SSP + } + }] +}]; +``` +## Multi-Format +**Important!** If you intend to use the yahoossp bidder for both Banner and Video formats please make sure: +1. Set the adapter as mode: 'all' - to call the Yahoo SSP for both banner & video formats. +2. Make sure the Yahoo SSP placement (pos id) supports both banner & video format requests. + +```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'all' + } +}); + +const adUnits = [{ + code: 'video-adUnit', + mediaTypes: { + banner: { + sizes: [[300, 250]] + }, + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + mimes: ['video/mp4','application/javascript'], + api: [2] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from Yahoo SSP + pos: '8a96958a017a7a57ac375d50c0c700cc', // Placement ID provided from Yahoo SSP + } + }] +}]; +``` + +# Optional: Schain module support +The yahoossp adapter supports the Prebid.org Schain module and will pass it through to our Yahoo SSP +For further details please see, https://docs.prebid.org/dev-docs/modules/schain.html + +## Global Schain Example: +```javascript + pbjs.setConfig({ + "schain": { + "validation": "off", + "config": { + "ver": "1.0", + "complete": 1, + "nodes": [{ + "asi": "some-platform.com", + "sid": "111111", + "hp": 1 + }] + } + } + }); +``` +## Bidder Specific Schain Example: +```javascript + pbjs.setBidderConfig({ + "bidders": ['yahoossp'], // can list more bidders here if they share the same config + "config": { + "schain": { + "validation": "strict", + "config": { + "ver": "1.0", + "complete": 1, + "nodes": [{ + "asi": "other-platform.com", + "sid": "222222", + "hp": 0 + }] + } + } + } + }); +``` + +# Optional: Price floors module & bidfloor +The yahoossp adapter supports the Prebid.org Price Floors module and will use it to define the outbound bidfloor and currency. +By default the adapter will always check the existance of Module price floor. +If a module price floor does not exist you can set a custom bid floor for your impression using "params.bidOverride.imp.bidfloor". + +**Note:** All override params apply to all requests generated using this configuration regardless of format type. + +```javascript +const adUnits = [{ + code: 'override-pricefloor', + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', // Site/App ID provided from Yahoo SSP + pos: '8a969978017a7aaabab4ab0bc01a0009', // Placement ID provided from Yahoo SSP + bidOverride :{ + imp: { + bidfloor: 5.00 // bidOverride priceFloor + } + } + } + } + }] +}]; +``` + +For further details please see, https://docs.prebid.org/dev-docs/modules/floors.html + +# Optional: Self-served E2E testing mode +If you want to see how the yahoossp adapter works and loads you are invited to try it out using our testing mode. +This is useful for integration testing and response parsing when checking banner vs video capabilities. + +## How to use E2E test mode: +1. Set the yahoossp global config mode to either 'banner' or 'video' - depending on the adUnit you want to test. +2. Add params.testing.e2etest: true to your adUnit bidder config - See examples below. + +**Note:** When using E2E Test Mode you do not need to pass mandatory bidder params dcn or pos. + +**Important!** E2E Testing Mode only works when the Bidder Request Mode is set explicitly to either 'banner' or 'video'. + +## Activating E2E Test for "Banner" + ```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'banner' // select 'banner' or 'video' to define what response to load + } +}); + +const adUnits = [{ + code: 'your-placement', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + bids: [ + { + bidder: 'yahoossp', + params: { + testing: { + e2etest: true // Activate E2E Test mode + } + } + } + ] +}]; + +``` +## Activating E2E Test for "Video" +**Note:** We recommend using Video Outstream as it would load the video response using our Outstream Renderer feature + ```javascript +pbjs.setConfig({ + yahoossp: { + mode: 'video' + } +}); + +const adUnits = [{ + code: 'video-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + mimes: ['video/mp4','application/javascript'], + api: [2] + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + testing: { + e2etest: true // Activate E2E Test mode + } + } + }] +}]; +``` + +# Optional: First Party Data +The yahoossp adapter now supports first party data passed via: +1. Global ortb2 object using pbjs.setConfig() +2. adUnit ortb2Imp object declared within an adUnit. +For further details please see, https://docs.prebid.org/features/firstPartyData.html +## Global First Party Data "ortb2" +### Passing First Party "site" data: +```javascript +pbjs.setConfig({ + ortb2: { + site: { + name: 'yahooAdTech', + domain: 'yahooadtech.com', + cat: ['IAB2'], + sectioncat: ['IAB2-2'], + pagecat: ['IAB2-2'], + page: 'https://page.yahooadtech.com/here.html', + ref: 'https://ref.yahooadtech.com/there.html', + keywords:'yahoo, ad, tech', + search: 'SSP', + content: { + id: '1234', + title: 'Title', + series: 'Series', + season: 'Season', + episode: 1, + cat: ['IAB1', 'IAB1-1', 'IAB1-2', 'IAB2', 'IAB2-1'], + genre: 'Fantase', + contentrating: 'C-Rating', + language: 'EN', + prodq: 1, + context: 1, + len: 200, + data: [{ + name: "www.dataprovider1.com", + ext: { segtax: 4 }, + segment: [ + { id: "687" }, + { id: "123" } + ] + }], + ext: { + network: 'ext-network', + channel: 'ext-channel', + data: { + pageType: "article", + category: "repair" + } + } + } + } + } + }); +``` +### Passing First Party "user" data: +```javascript +pbjs.setConfig({ + ortb2: { + user: { + yob: 1985, + gender: 'm', + keywords: 'a,b', + data: [{ + name: "www.dataprovider1.com", + ext: { segtax: 4 }, + segment: [ + { id: "687" }, + { id: "123" } + ] + }], + ext: { + data: { + registered: true, + interests: ['cars'] + } + } + } + } + }); +``` +### Passing First Party "app.content.data" data: +```javascript +pbjs.setConfig({ + ortb2: { + app: { + content: { + data: [{ + name: "www.dataprovider1.com", + ext: { segtax: 4 }, + segment: [ + { id: "687" }, + { id: "123" } + ] + }], + } + } + } + }); +``` + + +## AdUnit First Party Data "ortb2Imp" +Most DSPs are adopting the Global Placement ID (GPID). +Please pass your placement specific GPID value to Yahoo SSP using `adUnit.ortb2Imp.ext.data.pbadslot`. +```javascript +const adUnits = [{ + code: 'placement', + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + }, + }, + ortb2Imp: { + ext: { + data: { + pbadslot: "homepage-top-rect", + adUnitSpecificAttribute: "123" + } + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + pubdId: 'DemoPublisher' + } + }] + } + ] +``` + +# Optional: Bidder bidOverride Parameters +The yahoossp adapter allows passing override data to the outbound bid-request in that overrides First Party Data. +**Important!** We highly recommend using prebid modules to pass data instead of bidder speicifc overrides. +The use of these parameters are a last resort to force a specific feature or use case in your implementation. + +Currently the bidOverride object only accepts the following: +* imp + * video + * mimes + * w + * h + * maxbitrate + * maxduration + * minduration + * api + * delivery + * pos + * playbackmethod + * placement + * linearity + * protocols + * rewarded +* site + * page +* device + * ip + + +```javascript +const adUnits = [{ + code: 'bidOverride-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', + pos: '8a96958a017a7a57ac375d50c0c700cc', + bidOverride: { + imp: { + video: { + mimes: ['video/mp4', 'javascript/application'], + w: 300, + h: 200, + maxbitrate: 4000, + maxduration: 30, + minduration: 10, + api: [1,2], + delivery: 1, + pos: 1, + playbackmethod: 0, + placement: 1, + linearity: 1, + protocols: [2,5], + startdelay: 0, + rewarded: 0 + } + }, + site: { + page: 'https://yahoossp-bid-adapter.com', + }, + device: { + ip: "1.2.3.4" + } + } + } + }] +}] +``` + +# Optional: Custom Key-Value Pairs +Custom key-value paris can be used for both inventory targeting and reporting. +You must set up key-value pairs in the Yahoo SSP before sending them via the adapter otherwise the Ad Server will not be listening and picking them up. + +Important! Key-value pairs can only contain values of types: String, Number, Array of strings OR Array of numbers + +```javascript +const adUnits = [{ + code: 'key-value-pairs', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', + pos: '8a96958a017a7a57ac375d50c0c700cc', + kvp: { + key1: 'value', // String + key2: 123456, // Number + key3: ['string1','string2', 'string3'], // Array of strings + key4: [1, 23, 456, 7890] // Array of Numbers + } + } + }] +}] +``` + +# Optional: Custom Cache Time To Live (ttl): +The yahoossp adapter supports passing of "Time To Live" (ttl) that indicates to prebid chache for how long to keep the chaced winning bid alive. Value is Number in seconds and you can enter any number between 1 - 3600 (seconds). +The setting can be defined globally using setConfig or within the adUnit.params. +Global level setConfig overrides adUnit.params. +If no value is being passed default is 300 seconds. +## Global TTL +```javascript +pbjs.setConfig({ + yahoossp: { + ttl: 300 + } +}); + +const adUnits = [{ + code: 'global-ttl', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', + pos: '8a96958a017a7a57ac375d50c0c700cc', + } + }] +}] +``` + +## Ad Unit Params TTL +```javascript +const adUnits = [{ + code: 'adUnit-ttl', + mediaTypes: { + banner: { + sizes: [[300, 250]], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', + pos: '8a96958a017a7a57ac375d50c0c700cc', + ttl: 300, + } + }] +}] +``` +# Optional: Video Features +## Rewarded video flag +To indicate to Yahoo SSP that this adUnit is a rewarded video you can pass the following in the params.bidOverride.imp.video.rewarded: 1 + +```javascript +const adUnits = [{ + code: 'rewarded-video-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + dcn: '8a969516017a7a396ec539d97f540011', + pos: '8a96958a017a7a57ac375d50c0c700cc', + bidOverride: { + imp: { + video: { + rewarded: 1 + } + } + } + } + }] +}] +``` + +## Site/App Targeting for "pubId" Inventory Mapping +To target your adUnit explicitly to a specific Site/App Object in Yahoo SSP, you can pass one of the following: +1. params.siteId = External Site ID || Video SSP RTBIS Id (in String format). +2. params.bidOverride.site.id = External Site ID || Video SSP RTBIS Id (in String format). +**Important:** Site override is a only supported when using "pubId" mode. +**Important:** If you are switching from the oneVideo adapter, please make sure to pass inventoryid as a String instead of Integer. + +```javascript +const adUnits = [{ + code: 'pubId-site-targeting-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + pubId: 'DemoPublisher', + siteId: '1234567'; + } + }] +}] +``` + +## Placement Targeting for "pubId" Inventory Mapping +To target your adUnit explicitly to a specific Placement within a Site/App Object in Yahoo SSP, you can pass the following params.placementId = External Placement ID || Placement Alias + +**Important!** Placement override is a only supported when using "pubId" mode. +**Important!** It is highly recommended that you pass both `siteId` AND `placementId` together to avoid inventory miss matching. + +### Site & Placement override +**Important!** If the placement ID does not reside under the defined Site/App object, the request will not resolve and no response will be sent back from the ad-server. +```javascript +const adUnits = [{ + code: 'pubId-site-targeting-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + pubId: 'DemoPublisher', + siteId: '1234567', + placementId: 'header-250x300' + } + }] +}] +``` +### Placement only override +**Important!** Using this method is not advised if you have multiple Site/Apps that are broken out of a Run Of Network (RON) Site/App. If the placement ID does not reside under a matching Site/App object, the request will not resolve and no response will be sent back from the ad-server. +```javascript +const adUnits = [{ + code: 'pubId-site-targeting-adUnit', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [ + [300, 250] + ], + } + }, + bids: [{ + bidder: 'yahoossp', + params: { + pubId: 'DemoPublisher', + placementId: 'header-250x300' + } + }] +}] +``` + +# Optional: Legacy override Parameters +This adapter does not support passing legacy overrides via 'bidder.params.ext' since most of the data should be passed using prebid modules (First Party Data, Schain, Price Floors etc.). +If you do not know how to pass a custom parameter that you previously used, please contact us using the information provided above. + +Thanks you, +Yahoo SSP + diff --git a/test/spec/modules/yahoosspBidAdapter_spec.js b/test/spec/modules/yahoosspBidAdapter_spec.js new file mode 100644 index 00000000000..9c24ecedda1 --- /dev/null +++ b/test/spec/modules/yahoosspBidAdapter_spec.js @@ -0,0 +1,1305 @@ +import { expect } from 'chai'; +import { config } from 'src/config.js'; +import { BANNER, VIDEO } from 'src/mediaTypes.js'; +import { spec } from 'modules/yahoosspBidAdapter.js'; + +const DEFAULT_BID_ID = '84ab500420319d'; +const DEFAULT_BID_DCN = '2093845709823475'; +const DEFAULT_BID_POS = 'header'; +const DEFAULT_PUBID = 'PubId'; +const DEFAULT_AD_UNIT_CODE = '/19968336/header-bid-tag-1'; +const DEFAULT_AD_UNIT_TYPE = 'banner'; +const DEFAULT_PARAMS_BID_OVERRIDE = {}; +const DEFAULT_VIDEO_CONTEXT = 'instream'; +const ADAPTER_VERSION = '1.0.0'; +const PREBID_VERSION = '$prebid.version$'; +const INTEGRATION_METHOD = 'prebid.js'; + +// Utility functions +const generateBidRequest = ({bidId, pos, adUnitCode, adUnitType, bidOverrideObject, videoContext, pubIdMode}) => { + const bidRequest = { + adUnitCode, + auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917', + bidId, + bidderRequestsCount: 1, + bidder: 'yahoossp', + bidderRequestId: '7101db09af0db2', + bidderWinsCount: 0, + mediaTypes: {}, + params: { + bidOverride: bidOverrideObject + }, + src: 'client', + transactionId: '5b17b67d-7704-4732-8cc9-5b1723e9bcf9' + }; + + const bannerObj = { + sizes: [[300, 250], [300, 600]] + }; + + const videoObject = { + context: videoContext, + playerSize: [[300, 250]], + mimes: ['video/mp4', 'application/javascript'], + api: [2] + }; + + if (videoContext === 'outstream') { + bidRequest.renderer = undefined + }; + + if (adUnitType === 'banner' || adUnitType === 'dap-o2' || adUnitType === 'dap-up') { + bidRequest.mediaTypes.banner = bannerObj; + bidRequest.sizes = [[300, 250], [300, 600]]; + } else if (adUnitType === 'video') { + bidRequest.mediaTypes.video = videoObject; + } else if (adUnitType === 'multi-format') { + bidRequest.mediaTypes.banner = bannerObj; + bidRequest.sizes = [[300, 250], [300, 600]]; + bidRequest.mediaTypes.video = videoObject; + } else if (adUnitType === 'native') { + bidRequest.mediaTypes.native = {a: 123, b: 456}; + } + + if (pubIdMode === true) { + bidRequest.params.pubId = DEFAULT_PUBID; + } else { + bidRequest.params.dcn = DEFAULT_BID_DCN; + bidRequest.params.pos = pos || DEFAULT_BID_POS; + }; + + return bidRequest; +} + +let generateBidderRequest = (bidRequestArray, adUnitCode) => { + const bidderRequest = { + adUnitCode: adUnitCode || 'default-adUnitCode', + auctionId: 'd4c83a3b-18e4-4208-b98b-63848449c7aa', + auctionStart: new Date().getTime(), + bidderCode: 'yahoossp', + bidderRequestId: '112f1c7c5d399a', + bids: bidRequestArray, + refererInfo: { + referer: 'https://publisher-test.com', + reachedTop: true, + isAmp: false, + numIframes: 0, + stack: ['https://publisher-test.com'], + }, + gdprConsent: { + consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA', + vendorData: {}, + gdprApplies: true + }, + start: new Date().getTime(), + timeout: 1000, + }; + + return bidderRequest; +}; + +const generateBuildRequestMock = ({bidId, pos, adUnitCode, adUnitType, bidOverrideObject, videoContext, pubIdMode}) => { + const bidRequestConfig = { + bidId: bidId || DEFAULT_BID_ID, + pos: pos || DEFAULT_BID_POS, + adUnitCode: adUnitCode || DEFAULT_AD_UNIT_CODE, + adUnitType: adUnitType || DEFAULT_AD_UNIT_TYPE, + bidOverrideObject: bidOverrideObject || DEFAULT_PARAMS_BID_OVERRIDE, + videoContext: videoContext || DEFAULT_VIDEO_CONTEXT, + pubIdMode: pubIdMode || false + }; + const bidRequest = generateBidRequest(bidRequestConfig); + const validBidRequests = [bidRequest]; + const bidderRequest = generateBidderRequest(validBidRequests, adUnitCode); + + return { bidRequest, validBidRequests, bidderRequest } +}; + +const generateAdmPayload = (admPayloadType) => { + let ADM_PAYLOAD; + switch (admPayloadType) { + case 'banner': + ADM_PAYLOAD = ''; // banner + break; + case 'video': + ADM_PAYLOAD = ''; // VAST xml + break; + case 'multi-format': + const admPayloads = [ + '', // banner + '' // VAST xml + ] + const random = Math.floor(Math.random() * admPayloads.length); + ADM_PAYLOAD = admPayloads[random] + break; + case 'dap-o2': + ADM_PAYLOAD = ''; // O2 player + break; + case 'dap-up': + ADM_PAYLOAD = ''; // Unified Player + break; + }; + return ADM_PAYLOAD; +}; + +const generateResponseMock = (admPayloadType, vastVersion, videoContext) => { + const bidResponse = { + id: 'fc0c35df-21fb-4f93-9ebd-88759dbe31f9', + impid: '274395c06a24e5', + adm: generateAdmPayload(admPayloadType), + price: 1, + w: 300, + h: 250, + crid: 'ssp-placement-name', + adomain: ['advertiser-domain.com'] + }; + + if (vastVersion === 'vast') { + bidResponse.nurl = 'https://yahoo.com?event=adAttempt'; + }; + + const serverResponse = { + body: { + id: 'fc0c35df-21fb-4f93-9ebd-88759dbe31f9', + seatbid: [{ bid: [ bidResponse ], seat: 13107 }] + } + }; + const { validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: admPayloadType, videoContext: videoContext}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + + return {serverResponse, data, bidderRequest}; +} + +// Unit tests +describe('YahooSSP Bid Adapter:', () => { + it('PLACEHOLDER TO PASS GULP', () => { + const obj = {}; + expect(obj).to.be.an('object'); + }); + + describe('getUserSyncs()', () => { + const IMAGE_PIXEL_URL = 'http://image-pixel.com/foo/bar?1234&baz=true'; + const IFRAME_ONE_URL = 'http://image-iframe.com/foo/bar?1234&baz=true'; + const IFRAME_TWO_URL = 'http://image-iframe-two.com/foo/bar?1234&baz=true'; + + let serverResponses = []; + beforeEach(() => { + serverResponses[0] = { + body: { + ext: { + pixels: `` + } + } + } + }); + + after(() => { + serverResponses = undefined; + }); + + it('for only iframe enabled syncs', () => { + let syncOptions = { + iframeEnabled: true, + pixelEnabled: false + }; + let pixelsObjects = spec.getUserSyncs(syncOptions, serverResponses); + expect(pixelsObjects.length).to.equal(2); + expect(pixelsObjects).to.deep.equal( + [ + {type: 'iframe', 'url': IFRAME_ONE_URL}, + {type: 'iframe', 'url': IFRAME_TWO_URL} + ] + ) + }); + + it('for only pixel enabled syncs', () => { + let syncOptions = { + iframeEnabled: false, + pixelEnabled: true + }; + let pixelsObjects = spec.getUserSyncs(syncOptions, serverResponses); + expect(pixelsObjects.length).to.equal(1); + expect(pixelsObjects).to.deep.equal( + [ + {type: 'image', 'url': IMAGE_PIXEL_URL} + ] + ) + }); + + it('for both pixel and iframe enabled syncs', () => { + let syncOptions = { + iframeEnabled: true, + pixelEnabled: true + }; + let pixelsObjects = spec.getUserSyncs(syncOptions, serverResponses); + expect(pixelsObjects.length).to.equal(3); + expect(pixelsObjects).to.deep.equal( + [ + {type: 'iframe', 'url': IFRAME_ONE_URL}, + {type: 'image', 'url': IMAGE_PIXEL_URL}, + {type: 'iframe', 'url': IFRAME_TWO_URL} + ] + ) + }); + }); + + // Validate Bid Requests + describe('isBidRequestValid()', () => { + const INVALID_INPUT = [ + {}, + {params: {}}, + {params: {dcn: '2c9d2b50015a5aa95b70a9b0b5b10012'}}, + {params: {dcn: 1234, pos: 'header'}}, + {params: {dcn: '2c9d2b50015a5aa95b70a9b0b5b10012', pos: 1234}}, + {params: {dcn: '2c9d2b50015a5aa95b70a9b0b5b10012', pos: ''}}, + {params: {dcn: '', pos: 'header'}}, + ]; + + INVALID_INPUT.forEach(input => { + it(`should determine that the bid is INVALID for the input ${JSON.stringify(input)}`, () => { + expect(spec.isBidRequestValid(input)).to.be.false; + }); + }); + + it('should determine that the bid is VALID if dcn and pos are present on the params object', () => { + const validBid = { + params: { + dcn: '2c9d2b50015a5aa95b70a9b0b5b10012', + pos: 'header' + } + }; + expect(spec.isBidRequestValid(validBid)).to.be.true; + }); + + it('should mark bid as VALID if bid.params.testing.e2etest = "true" (dcn & pos not required)', () => { + const validBid = { + params: { + dcn: 8888, + pos: 9999, + testing: { + e2etest: true + } + } + }; + expect(spec.isBidRequestValid(validBid)).to.be.true; + }); + + it('should mark bid ad VALID if pubId exists instead of dcn & pos', () => { + const validBid = { + params: { + pubId: DEFAULT_PUBID + } + }; + expect(spec.isBidRequestValid(validBid)).to.be.true; + }); + }); + + describe('Price Floor module support:', () => { + it('should get bidfloor from getFloor method', () => { + const { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({}); + bidRequest.params.bidOverride = {cur: 'EUR'}; + bidRequest.getFloor = (floorObj) => { + return { + floor: bidRequest.floors.values[floorObj.mediaType + '|640x480'], + currency: floorObj.currency, + mediaType: floorObj.mediaType + } + }; + bidRequest.floors = { + currency: 'EUR', + values: { + 'banner|640x480': 5.55 + } + }; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.cur).to.deep.equal(['EUR']); + expect(data.imp[0].bidfloor).is.a('number'); + expect(data.imp[0].bidfloor).to.equal(5.55); + }); + }); + + describe('Schain module support:', () => { + it('should send Global or Bidder specific schain', function () { + const { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const globalSchain = { + ver: '1.0', + complete: 1, + nodes: [{ + asi: 'some-platform.com', + sid: '111111', + rid: bidRequest.bidId, + hp: 1 + }] + }; + bidRequest.schain = globalSchain; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + const schain = data.source.ext.schain; + expect(schain.nodes.length).to.equal(1); + expect(schain).to.equal(globalSchain); + }); + }); + + describe('First party data module - "Site" support (ortb2):', () => { + // Should not allow invalid "site" data types + const INVALID_ORTB2_TYPES = [ null, [], 123, 'unsupportedKeyName', true, false, undefined ]; + INVALID_ORTB2_TYPES.forEach(param => { + const ortb2 = { site: param } + config.setConfig({ortb2}); + it(`should not allow invalid site types to be added to bid-request: ${JSON.stringify(param)}`, () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site[param]).to.be.undefined; + }); + }); + + // Should add valid "site" params + const VALID_SITE_STRINGS = ['name', 'domain', 'page', 'ref', 'keywords', 'search']; + const VALID_SITE_ARRAYS = ['cat', 'sectioncat', 'pagecat']; + + VALID_SITE_STRINGS.forEach(param => { + it(`should allow supported site keys to be added bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + [param]: 'something' + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site[param]).to.exist; + expect(data.site[param]).to.be.a('string'); + expect(data.site[param]).to.be.equal(ortb2.site[param]); + }); + }); + + VALID_SITE_ARRAYS.forEach(param => { + it(`should determine that the ortb2.site Array key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + [param]: ['something'] + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site[param]).to.exist; + expect(data.site[param]).to.be.a('array'); + expect(data.site[param]).to.be.equal(ortb2.site[param]); + }); + }); + + // Should not allow invalid "site.content" data types + INVALID_ORTB2_TYPES.forEach(param => { + it(`should determine that the ortb2.site.content key is invalid and should not be added to bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + content: param + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content).to.be.undefined; + }); + }); + + // Should not allow invalid "site.content" keys + it(`should not allow invalid ortb2.site.content object keys to be added to bid-request: {custom object}`, () => { + const ortb2 = { + site: { + content: { + fake: 'news', + unreal: 'param', + counterfit: 'data' + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content).to.be.a('object'); + }); + + // Should append valid "site.content" keys + const VALID_CONTENT_STRINGS = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; + VALID_CONTENT_STRINGS.forEach(param => { + it(`should determine that the ortb2.site String key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + content: { + [param]: 'something' + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content[param]).to.exist; + expect(data.site.content[param]).to.be.a('string'); + expect(data.site.content[param]).to.be.equal(ortb2.site.content[param]); + }); + }); + + const VALID_CONTENT_NUMBERS = ['episode', 'prodq', 'context', 'livestream', 'len']; + VALID_CONTENT_NUMBERS.forEach(param => { + it(`should determine that the ortb2.site.content Number key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + content: { + [param]: 1234 + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content[param]).to.be.a('number'); + expect(data.site.content[param]).to.be.equal(ortb2.site.content[param]); + }); + }); + + const VALID_CONTENT_ARRAYS = ['cat']; + VALID_CONTENT_ARRAYS.forEach(param => { + it(`should determine that the ortb2.site Array key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + content: { + [param]: ['something', 'something-else'] + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content[param]).to.be.a('array'); + expect(data.site.content[param]).to.be.equal(ortb2.site.content[param]); + }); + }); + + const VALID_CONTENT_OBJECTS = ['ext']; + VALID_CONTENT_OBJECTS.forEach(param => { + it(`should determine that the ortb2.site.content Object key is valid and append to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + site: { + content: { + [param]: {a: '123', b: '456'} + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.content[param]).to.be.a('object'); + expect(data.site.content[param]).to.be.equal(ortb2.site.content[param]); + config.setConfig({ortb2: {}}); + }); + }); + }); + + describe('First party data module - "User" support (ortb2):', () => { + // Global ortb2.user validations + // Should not allow invalid "user" data types + const INVALID_ORTB2_TYPES = [ null, [], 'unsupportedKeyName', true, false, undefined ]; + INVALID_ORTB2_TYPES.forEach(param => { + const ortb2 = { user: param } + config.setConfig({ortb2}); + it(`should not allow invalid site types to be added to bid-request: ${JSON.stringify(param)}`, () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user[param]).to.be.undefined; + }); + }); + + // Should add valid "user" params + const VALID_USER_STRINGS = ['id', 'buyeruid', 'gender', 'keywords', 'customdata']; + VALID_USER_STRINGS.forEach(param => { + it(`should allow supported user string keys to be added bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + [param]: 'something' + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user[param]).to.exist; + expect(data.user[param]).to.be.a('string'); + expect(data.user[param]).to.be.equal(ortb2.user[param]); + }); + }); + + const VALID_USER_NUMBERS = ['yob']; + VALID_USER_NUMBERS.forEach(param => { + it(`should allow supported user number keys to be added bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + [param]: 1982 + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user[param]).to.exist; + expect(data.user[param]).to.be.a('number'); + expect(data.user[param]).to.be.equal(ortb2.user[param]); + }); + }); + + const VALID_USER_ARRAYS = ['data']; + VALID_USER_ARRAYS.forEach(param => { + it(`should allow supported user Array keys to be added to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + [param]: ['something'] + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user[param]).to.exist; + expect(data.user[param]).to.be.a('array'); + expect(data.user[param]).to.be.equal(ortb2.user[param]); + }); + }); + + const VALID_USER_OBJECTS = ['ext']; + VALID_USER_OBJECTS.forEach(param => { + it(`should allow supported user extObject keys to be added to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + [param]: {a: '123', b: '456'} + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user[param]).to.be.a('object'); + expect(data.user[param]).to.be.deep.include({[param]: {a: '123', b: '456'}}); + config.setConfig({ortb2: {}}); + }); + }); + + // Should allow valid user.data && site.content.data + const VALID_USER_DATA_STRINGS = ['id', 'name']; + VALID_USER_DATA_STRINGS.forEach(param => { + it(`should allow supported user.data & site.content.data strings to be added to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + data: [{[param]: 'string'}] + }, + site: { + content: { + data: [{[param]: 'string'}] + } + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user.data[0][param]).to.exist; + expect(data.user.data[0][param]).to.be.a('string'); + expect(data.user.data[0][param]).to.be.equal(ortb2.user.data[0][param]); + expect(data.site.content.data[0][param]).to.exist; + expect(data.site.content.data[0][param]).to.be.a('string'); + expect(data.site.content.data[0][param]).to.be.equal(ortb2.site.content.data[0][param]); + }); + }); + + const VALID_USER_DATA_ARRAYS = ['segment'] + VALID_USER_DATA_ARRAYS.forEach(param => { + it(`should allow supported user data arrays to be added to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + data: [{[param]: [{id: 1}]}] + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user.data[0][param]).to.exist; + expect(data.user.data[0][param]).to.be.a('array'); + expect(data.user.data[0][param]).to.be.equal(ortb2.user.data[0][param]); + }); + }); + + const VALID_USER_DATA_OBJECTS = ['ext']; + VALID_USER_DATA_OBJECTS.forEach(param => { + it(`should allow supported user data objects to be added to the bid-request: ${JSON.stringify(param)}`, () => { + const ortb2 = { + user: { + data: [{[param]: {id: 'ext'}}] + } + }; + config.setConfig({ortb2}); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.user.data[0][param]).to.exist; + expect(data.user.data[0][param]).to.be.a('object'); + expect(data.user.data[0][param]).to.be.equal(ortb2.user.data[0][param]); + config.setConfig({ortb2: {}}); + }); + }); + + // adUnit.ortb2Imp.ext.data + it(`should allow adUnit.ortb2Imp.ext.data object to be added to the bid-request`, () => { + let { validBidRequests, bidderRequest } = generateBuildRequestMock({}) + validBidRequests[0].ortb2Imp = { + ext: { + data: { + pbadslot: 'homepage-top-rect', + adUnitSpecificAttribute: '123' + } + } + }; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].ext.data).to.deep.equal(validBidRequests[0].ortb2Imp.ext.data); + }); + }); + + describe('e2etest mode support:', () => { + it(`should override DCN & POS when params.testing.e2etest = "true".`, () => { + const { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const params = { + dcn: '1234', + pos: '5678', + testing: { + e2etest: true + } + } + bidRequest.params = params; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.site.id).to.be.equal('8a969516017a7a396ec539d97f540011'); + expect(data.imp[0].tagid).to.be.equal('8a969978017a7aaabab4ab0bc01a0009'); + expect(data.imp[0].ext.e2eTestMode).to.be.true; + }); + }); + + describe('GDPR & Consent:', () => { + it('should return request objects that do not send cookies if purpose 1 consent is not provided', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + bidderRequest.gdprConsent = { + consentString: 'BOtmiBKOtmiBKABABAENAFAAAAACeAAA', + apiVersion: 2, + vendorData: { + purpose: { + consents: { + '1': false + } + } + }, + gdprApplies: true + }; + const options = spec.buildRequests(validBidRequests, bidderRequest)[0].options; + expect(options.withCredentials).to.be.false; + }); + }); + + describe('Endpoint & Impression Request Mode:', () => { + it('should route request to config override endpoint', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const testOverrideEndpoint = 'http://foo.bar.baz.com/bidderRequest'; + config.setConfig({ + yahoossp: { + endpoint: testOverrideEndpoint + } + }); + const response = spec.buildRequests(validBidRequests, bidderRequest)[0]; + expect(response).to.deep.include( + { + method: 'POST', + url: testOverrideEndpoint + }); + }); + + it('should route request to /bidRequest endpoint when dcn & pos present', () => { + config.setConfig({ + yahoossp: {} + }); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const response = spec.buildRequests(validBidRequests, bidderRequest); + expect(response[0]).to.deep.include({ + method: 'POST', + url: 'https://c2shb.pubgw.yahoo.com/bidRequest' + }); + }); + + it('should route request to /partners endpoint when pubId is present', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({pubIdMode: true}); + const response = spec.buildRequests(validBidRequests, bidderRequest); + expect(response[0]).to.deep.include({ + method: 'POST', + url: 'https://c2shb.pubgw.yahoo.com/admax/bid/partners/PBJS' + }); + }); + + it('should return a single request object for single request mode', () => { + let { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const BID_ID_2 = '84ab50xxxxx'; + const BID_POS_2 = 'footer'; + const AD_UNIT_CODE_2 = 'test-ad-unit-code-123'; + const { bidRequest: bidRequest2 } = generateBuildRequestMock({bidId: BID_ID_2, pos: BID_POS_2, adUnitCode: AD_UNIT_CODE_2}); + validBidRequests = [bidRequest, bidRequest2]; + bidderRequest.bids = validBidRequests; + + config.setConfig({ + yahoossp: { + singleRequestMode: true + } + }); + + const data = spec.buildRequests(validBidRequests, bidderRequest).data; + expect(data.imp).to.be.an('array').with.lengthOf(2); + + expect(data.imp[0]).to.deep.include({ + id: DEFAULT_BID_ID, + ext: { + pos: DEFAULT_BID_POS, + dfp_ad_unit_code: DEFAULT_AD_UNIT_CODE + } + }); + + expect(data.imp[1]).to.deep.include({ + id: BID_ID_2, + ext: { + pos: BID_POS_2, + dfp_ad_unit_code: AD_UNIT_CODE_2 + } + }); + }); + }); + + describe('Validate request filtering:', () => { + it('should not return request when no bids are present', function () { + let request = spec.buildRequests([]); + expect(request).to.be.undefined; + }); + + it('buildRequests(): should return an array with the correct amount of request objects', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const response = spec.buildRequests(validBidRequests, bidderRequest).bidderRequest; + expect(response.bids).to.be.an('array').to.have.lengthOf(1); + }); + }); + + describe('Request Headers validation:', () => { + it('should return request objects with the relevant custom headers and content type declaration', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const options = spec.buildRequests(validBidRequests, bidderRequest).options; + expect(options).to.deep.equal( + { + contentType: 'application/json', + customHeaders: { + 'x-openrtb-version': '2.5' + }, + withCredentials: true + }); + }); + }); + + describe('Request Payload oRTB bid validation:', () => { + it('should generate a valid openRTB bid-request object in the data field', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest).data; + expect(data.site).to.deep.equal({ + id: bidderRequest.bids[0].params.dcn, + page: bidderRequest.refererInfo.referer + }); + + expect(data.device).to.deep.equal({ + dnt: 0, + ua: navigator.userAgent, + ip: undefined + }); + + expect(data.regs).to.deep.equal({ + ext: { + 'us_privacy': '', + gdpr: 1 + } + }); + + expect(data.source).to.deep.equal({ + ext: { + hb: 1, + adapterver: ADAPTER_VERSION, + prebidver: PREBID_VERSION, + integration: { + name: INTEGRATION_METHOD, + ver: PREBID_VERSION + } + }, + fd: 1 + }); + + expect(data.user).to.deep.equal({ + ext: { + consent: bidderRequest.gdprConsent.consentString, + eids: [] + } + }); + + expect(data.cur).to.deep.equal(['USD']); + }); + + it('should generate a valid openRTB imp.ext object in the bid-request', () => { + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const bid = validBidRequests[0]; + const data = spec.buildRequests(validBidRequests, bidderRequest).data; + expect(data.imp[0].ext).to.deep.equal({ + pos: bid.params.pos, + dfp_ad_unit_code: DEFAULT_AD_UNIT_CODE + }); + }); + + it('should use siteId value as site.id in the outbound bid-request when using "pubId" integration mode', () => { + let { validBidRequests, bidderRequest } = generateBuildRequestMock({pubIdMode: true}); + validBidRequests[0].params.siteId = '1234567'; + const data = spec.buildRequests(validBidRequests, bidderRequest).data; + expect(data.site.id).to.equal('1234567'); + }); + + it('should use placementId value as imp.tagid in the outbound bid-request when using "pubId" integration mode', () => { + let { validBidRequests, bidderRequest } = generateBuildRequestMock({pubIdMode: true}); + validBidRequests[0].params.placementId = 'header-300x250'; + const data = spec.buildRequests(validBidRequests, bidderRequest).data; + expect(data.imp[0].tagid).to.deep.equal('header-300x250'); + }); + }); + + describe('Request Payload oRTB bid.imp validation:', () => { + // Validate Banner imp imp when yahoossp.mode=undefined + it('should generate a valid "Banner" imp object', () => { + config.setConfig({ + yahoossp: {} + }); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].video).to.not.exist; + expect(data.imp[0].banner).to.deep.equal({ + mimes: ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: [{w: 300, h: 250}, {w: 300, h: 600}] + }); + }); + + // Validate Banner imp when yahoossp.mode="banner" + it('should generate a valid "Banner" imp object', () => { + config.setConfig({ + yahoossp: { mode: 'banner' } + }); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].video).to.not.exist; + expect(data.imp[0].banner).to.deep.equal({ + mimes: ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: [{w: 300, h: 250}, {w: 300, h: 600}] + }); + }); + + // Validate Video imp + it('should generate a valid "Video" only imp object', () => { + config.setConfig({ + yahoossp: { mode: 'video' } + }); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'video'}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].banner).to.not.exist; + expect(data.imp[0].video).to.deep.equal({ + mimes: ['video/mp4', 'application/javascript'], + w: 300, + h: 250, + api: [2], + protocols: [2, 5], + startdelay: 0, + linearity: 1, + maxbitrate: undefined, + maxduration: undefined, + minduration: undefined, + delivery: undefined, + pos: undefined, + playbackmethod: undefined, + rewarded: undefined, + placement: undefined + }); + }); + + // Validate multi-format Video+banner imp + it('should generate a valid multi-format "Video + Banner" imp object', () => { + config.setConfig({ + yahoossp: { mode: 'all' } + }); + const { validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'multi-format'}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].banner).to.deep.equal({ + mimes: ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: [{w: 300, h: 250}, {w: 300, h: 600}] + }); + expect(data.imp[0].video).to.deep.equal({ + mimes: ['video/mp4', 'application/javascript'], + w: 300, + h: 250, + api: [2], + protocols: [2, 5], + startdelay: 0, + linearity: 1, + maxbitrate: undefined, + maxduration: undefined, + minduration: undefined, + delivery: undefined, + pos: undefined, + playbackmethod: undefined, + rewarded: undefined, + placement: undefined + }); + }); + + // Validate Key-Value Pairs + it('should generate supported String, Number, Array of Strings, Array of Numbers key-value pairs and append to imp.ext.kvs', () => { + let { validBidRequests, bidderRequest } = generateBuildRequestMock({}) + validBidRequests[0].params.kvp = { + key1: 'String', + key2: 123456, + key3: ['String', 'String', 'String'], + key4: [1, 2, 3], + invalidKey1: true, + invalidKey2: null, + invalidKey3: ['string', 1234], + invalidKey4: {a: 1, b: 2}, + invalidKey5: undefined + }; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + + expect(data.imp[0].ext.kvs).to.deep.equal({ + key1: 'String', + key2: 123456, + key3: ['String', 'String', 'String'], + key4: [1, 2, 3] + }); + }); + }); + + describe('Multiple adUnit validations:', () => { + // Multiple banner adUnits + it('should generate multiple bid-requests for each adUnit - 2 banner only', () => { + config.setConfig({ + yahoossp: { mode: 'banner' } + }); + + const BID_ID_2 = '84ab50xxxxx'; + const BID_POS_2 = 'footer'; + const AD_UNIT_CODE_2 = 'test-ad-unit-code-123'; + const BID_ID_3 = '84ab50yyyyy'; + const BID_POS_3 = 'hero'; + const AD_UNIT_CODE_3 = 'video-ad-unit'; + + let { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({}); // banner + const { bidRequest: bidRequest2 } = generateBuildRequestMock({bidId: BID_ID_2, pos: BID_POS_2, adUnitCode: AD_UNIT_CODE_2}); // banner + const { bidRequest: bidRequest3 } = generateBuildRequestMock({bidId: BID_ID_3, pos: BID_POS_3, adUnitCode: AD_UNIT_CODE_3, adUnitType: 'video'}); // video (should be filtered) + validBidRequests = [bidRequest, bidRequest2, bidRequest3]; + bidderRequest.bids = validBidRequests; + + const response = spec.buildRequests(validBidRequests, bidderRequest) + expect(response).to.be.a('array'); + expect(response.length).to.equal(2); + response.forEach((obj) => { + expect(obj.data.imp[0].video).to.not.exist + expect(obj.data.imp[0].banner).to.deep.equal({ + mimes: ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: [{w: 300, h: 250}, {w: 300, h: 600}] + }); + }); + }); + + // Multiple video adUnits + it('should generate multiple bid-requests for each adUnit - 2 video only', () => { + config.setConfig({ + yahoossp: { mode: 'video' } + }); + const BID_ID_2 = '84ab50xxxxx'; + const BID_POS_2 = 'footer'; + const AD_UNIT_CODE_2 = 'test-ad-unit-code-123'; + const BID_ID_3 = '84ab50yyyyy'; + const BID_POS_3 = 'hero'; + const AD_UNIT_CODE_3 = 'video-ad-unit'; + + let { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'video'}); // video + const { bidRequest: bidRequest2 } = generateBuildRequestMock({bidId: BID_ID_2, pos: BID_POS_2, adUnitCode: AD_UNIT_CODE_2, adUnitType: 'video'}); // video + const { bidRequest: bidRequest3 } = generateBuildRequestMock({bidId: BID_ID_3, pos: BID_POS_3, adUnitCode: AD_UNIT_CODE_3}); // banner (should be filtered) + validBidRequests = [bidRequest, bidRequest2, bidRequest3]; + bidderRequest.bids = validBidRequests; + + const response = spec.buildRequests(validBidRequests, bidderRequest) + expect(response).to.be.a('array'); + expect(response.length).to.equal(2); + response.forEach((obj) => { + expect(obj.data.imp[0].banner).to.not.exist + expect(obj.data.imp[0].video).to.deep.equal({ + mimes: ['video/mp4', 'application/javascript'], + w: 300, + h: 250, + api: [2], + protocols: [2, 5], + startdelay: 0, + linearity: 1, + maxbitrate: undefined, + maxduration: undefined, + minduration: undefined, + delivery: undefined, + pos: undefined, + playbackmethod: undefined, + rewarded: undefined, + placement: undefined + }); + }); + }); + // Mixed adUnits 1-banner, 1-video, 1-native (should filter out native) + it('should generate multiple bid-requests for both "video & banner" adUnits', () => { + config.setConfig({ + yahoossp: { mode: 'all' } + }); + const BID_ID_2 = '84ab50xxxxx'; + const BID_POS_2 = 'footer'; + const AD_UNIT_CODE_2 = 'video-ad-unit'; + const BID_ID_3 = '84ab50yyyyy'; + const BID_POS_3 = 'hero'; + const AD_UNIT_CODE_3 = 'native-ad-unit'; + + let { bidRequest, validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'banner'}); // banner + const { bidRequest: bidRequest2 } = generateBuildRequestMock({bidId: BID_ID_2, pos: BID_POS_2, adUnitCode: AD_UNIT_CODE_2, adUnitType: 'video'}); // video + const { bidRequest: bidRequest3 } = generateBuildRequestMock({bidId: BID_ID_3, pos: BID_POS_3, adUnitCode: AD_UNIT_CODE_3, adUnitType: 'native'}); // native (should be filtered) + validBidRequests = [bidRequest, bidRequest2, bidRequest3]; + bidderRequest.bids = validBidRequests; + + const response = spec.buildRequests(validBidRequests, bidderRequest); + expect(response).to.be.a('array'); + expect(response.length).to.equal(2); + response.forEach((obj) => { + expect(obj.data.imp[0].native).to.not.exist; + }); + + const data1 = response[0].data; + expect(data1.imp[0].video).to.not.exist; + expect(data1.imp[0].banner).to.deep.equal({ + mimes: ['text/html', 'text/javascript', 'application/javascript', 'image/jpg'], + format: [{w: 300, h: 250}, {w: 300, h: 600}] + }); + + const data2 = response[1].data; + expect(data2.imp[0].banner).to.not.exist; + expect(data2.imp[0].video).to.deep.equal({ + mimes: ['video/mp4', 'application/javascript'], + w: 300, + h: 250, + api: [2], + protocols: [2, 5], + startdelay: 0, + linearity: 1, + maxbitrate: undefined, + maxduration: undefined, + minduration: undefined, + delivery: undefined, + pos: undefined, + playbackmethod: undefined, + rewarded: undefined, + placement: undefined + }); + }); + }); + + describe('Video params firstlook & bidOverride validations:', () => { + it('should first look at params.bidOverride for video placement data', () => { + config.setConfig({ + yahoossp: { mode: 'video' } + }); + const bidOverride = { + imp: { + video: { + mimes: ['video/mp4'], + w: 400, + h: 350, + api: [1], + protocols: [1, 3], + startdelay: 0, + linearity: 1, + maxbitrate: 400000, + maxduration: 3600, + minduration: 1500, + delivery: 1, + pos: 123456, + playbackmethod: 1, + rewarded: 1, + placement: 1 + } + } + } + const { validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'video', bidOverrideObject: bidOverride}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].video).to.deep.equal(bidOverride.imp.video); + }); + + it('should second look at bid.mediaTypes.video for video placement data', () => { + config.setConfig({ + yahoossp: { mode: 'video' } + }); + let { bidRequest, bidderRequest } = generateBuildRequestMock({adUnitType: 'video'}); + bidRequest.mediaTypes.video = { + mimes: ['video/mp4'], + playerSize: [400, 350], + api: [1], + protocols: [1, 3], + startdelay: 0, + linearity: 1, + maxbitrate: 400000, + maxduration: 3600, + minduration: 1500, + delivery: 1, + pos: 123456, + playbackmethod: 1, + placement: 1 + } + const validBidRequests = [bidRequest]; + bidderRequest.bids = validBidRequests; + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.imp[0].video).to.deep.equal({ + mimes: ['video/mp4'], + w: 400, + h: 350, + api: [1], + protocols: [1, 3], + startdelay: 0, + linearity: 1, + maxbitrate: 400000, + maxduration: 3600, + minduration: 1500, + delivery: 1, + pos: 123456, + playbackmethod: 1, + placement: 1, + rewarded: undefined + }); + }); + + it('should use params.bidOverride.device.ip override', () => { + config.setConfig({ + yahoossp: { mode: 'all' } + }); + const bidOverride = { + device: { + ip: '1.2.3.4' + } + } + const { validBidRequests, bidderRequest } = generateBuildRequestMock({adUnitType: 'video', bidOverrideObject: bidOverride}); + const data = spec.buildRequests(validBidRequests, bidderRequest)[0].data; + expect(data.device.ip).to.deep.equal(bidOverride.device.ip); + }); + }); + // #endregion buildRequests(): + + describe('interpretResponse()', () => { + describe('for mediaTypes: "banner"', () => { + it('should insert banner payload into response[0].ad', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ad).to.equal(''); + expect(response[0].mediaType).to.equal('banner'); + }) + }); + + describe('for mediaTypes: "video"', () => { + it('should insert video VPAID payload into vastXml', () => { + const { serverResponse, bidderRequest } = generateResponseMock('video'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ad).to.be.undefined; + expect(response[0].vastXml).to.equal(''); + expect(response[0].mediaType).to.equal('video'); + }) + + it('should insert video VAST win notification into vastUrl', () => { + const { serverResponse, bidderRequest } = generateResponseMock('video', 'vast'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ad).to.be.undefined; + expect(response[0].vastUrl).to.equal('https://yahoo.com?event=adAttempt'); + expect(response[0].vastXml).to.equal(''); + expect(response[0].mediaType).to.equal('video'); + }) + + it('should insert video DAP O2 Player into ad', () => { + const { serverResponse, bidderRequest } = generateResponseMock('dap-o2', 'vpaid'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ad).to.equal(''); + expect(response[0].vastUrl).to.be.undefined; + expect(response[0].vastXml).to.be.undefined; + expect(response[0].mediaType).to.equal('banner'); + }); + + it('should insert video DAP Unified Player into ad', () => { + const { serverResponse, bidderRequest } = generateResponseMock('dap-up', 'vpaid'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ad).to.equal(''); + expect(response[0].vastUrl).to.be.undefined; + expect(response[0].vastXml).to.be.undefined; + expect(response[0].mediaType).to.equal('banner'); + }) + }); + + describe('Support Advertiser domains', () => { + it('should append bid-response adomain to meta.advertiserDomains', () => { + const { serverResponse, bidderRequest } = generateResponseMock('video', 'vpaid'); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].meta.advertiserDomains).to.be.a('array'); + expect(response[0].meta.advertiserDomains[0]).to.equal('advertiser-domain.com'); + }) + }); + + describe('Time To Live (ttl)', () => { + const UNSUPPORTED_TTL_FORMATS = ['string', [1, 2, 3], true, false, null, undefined]; + UNSUPPORTED_TTL_FORMATS.forEach(param => { + it('should not allow unsupported global yahoossp.ttl formats and default to 300', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + config.setConfig({ + yahoossp: { ttl: param } + }); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ttl).to.equal(300); + }); + + it('should not allow unsupported params.ttl formats and default to 300', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + bidderRequest.bids[0].params.ttl = param; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ttl).to.equal(300); + }); + }); + + const UNSUPPORTED_TTL_VALUES = [-1, 3601]; + UNSUPPORTED_TTL_VALUES.forEach(param => { + it('should not allow invalid global yahoossp.ttl values 3600 < ttl < 0 and default to 300', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + config.setConfig({ + yahoossp: { ttl: param } + }); + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ttl).to.equal(300); + }); + + it('should not allow invalid params.ttl values 3600 < ttl < 0 and default to 300', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + bidderRequest.bids[0].params.ttl = param; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ttl).to.equal(300); + }); + }); + + it('should give presedence to Gloabl ttl over params.ttl ', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + config.setConfig({ + yahoossp: { ttl: 500 } + }); + bidderRequest.bids[0].params.ttl = 400; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].ttl).to.equal(500); + }); + }); + }); +}); From 9d9621d9cf578ee49e1d281eb3905147feb7d24d Mon Sep 17 00:00:00 2001 From: Samuel Adu Date: Tue, 12 Oct 2021 16:13:59 +0100 Subject: [PATCH 171/250] Support yahoo.com eid source value (#7563) Co-authored-by: slimkrazy --- modules/aolBidAdapter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/aolBidAdapter.js b/modules/aolBidAdapter.js index 7203439059b..c9f64ab66b0 100644 --- a/modules/aolBidAdapter.js +++ b/modules/aolBidAdapter.js @@ -38,7 +38,8 @@ const SUPPORTED_USER_ID_SOURCES = [ 'liveintent.com', 'quantcast.com', 'verizonmedia.com', - 'liveramp.com' + 'liveramp.com', + 'yahoo.com' ]; const pubapiTemplate = template`${'host'}/pubapi/3.0/${'network'}/${'placement'}/${'pageid'}/${'sizeid'}/ADTECH;v=2;cmd=bid;cors=yes;alias=${'alias'};misc=${'misc'};${'dynamicParams'}`; From e54ec611affff05d150ab78c291e8b074478355a Mon Sep 17 00:00:00 2001 From: Desvillettes <30619957+AurelienMozoo@users.noreply.github.com> Date: Tue, 12 Oct 2021 17:17:12 +0200 Subject: [PATCH 172/250] Ogury Bid Adapter: Handle TTD as a new source (#7558) * add TTD URL in getUserSyncs method and related unit tests * Refactor unit tests naming * refactor unit test name --- modules/oguryBidAdapter.js | 14 +++++-- test/spec/modules/oguryBidAdapter_spec.js | 46 +++++++++++++++-------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index fcbb89c5188..c7a722b2003 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -24,10 +24,16 @@ function isBidRequestValid(bid) { function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent) { if (!syncOptions.pixelEnabled) return []; - return [{ - type: 'image', - url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid` - }] + return [ + { + type: 'image', + url: `${MS_COOKIE_SYNC_DOMAIN}/v1/init-sync/bid-switch?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid` + }, + { + type: 'image', + url: `${MS_COOKIE_SYNC_DOMAIN}/ttd/init-sync?iab_string=${(gdprConsent && gdprConsent.consentString) || ''}&source=prebid` + } + ] } function buildRequests(validBidRequests, bidderRequest) { diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index d3a154b3989..51e586460bd 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -119,22 +119,26 @@ describe('OguryBidAdapter', function () { }; }); - it('should return syncs array with an element of type image', () => { + it('should return sync array with two elements of type image', () => { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.contain('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch'); + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.contain('https://ms-cookie-sync.presage.io/ttd/init-sync'); }); - it('should set the source as query param', () => { + it('should set the same source as query param', () => { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs[0].url).to.contain('source=prebid'); + expect(userSyncs[1].url).to.contain('source=prebid'); }); it('should set the tcString as query param', () => { const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); expect(userSyncs[0].url).to.contain(`iab_string=${gdprConsent.consentString}`); + expect(userSyncs[1].url).to.contain(`iab_string=${gdprConsent.consentString}`); }); it('should return an empty array when pixel is disable', () => { @@ -142,70 +146,82 @@ describe('OguryBidAdapter', function () { expect(spec.getUserSyncs(syncOptions, [], gdprConsent)).to.have.lengthOf(0); }); - it('should return syncs array with an element of type image when consentString is undefined', () => { + it('should return sync array with two elements of type image when consentString is undefined', () => { gdprConsent = { gdprApplies: true, consentString: undefined }; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); - it('should return syncs array with an element of type image when consentString is null', () => { + it('should return sync array with two elements of type image when consentString is null', () => { gdprConsent = { gdprApplies: true, consentString: null }; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); - it('should return syncs array with an element of type image when gdprConsent is undefined', () => { + it('should return sync array with two elements of type image when gdprConsent is undefined', () => { gdprConsent = undefined; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); - it('should return syncs array with an element of type image when gdprConsent is null', () => { + it('should return sync array with two elements of type image when gdprConsent is null', () => { gdprConsent = null; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); - it('should return syncs array with an element of type image when gdprConsent is null and gdprApplies is false', () => { + it('should return sync array with two elements of type image when gdprConsent is null and gdprApplies is false', () => { gdprConsent = { gdprApplies: false, consentString: null }; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); - it('should return syncs array with an element of type image when gdprConsent is empty string and gdprApplies is false', () => { + it('should return sync array with two elements of type image when gdprConsent is empty string and gdprApplies is false', () => { gdprConsent = { gdprApplies: false, consentString: '' }; const userSyncs = spec.getUserSyncs(syncOptions, [], gdprConsent); - expect(userSyncs).to.have.lengthOf(1); + expect(userSyncs).to.have.lengthOf(2); expect(userSyncs[0].type).to.equal('image'); expect(userSyncs[0].url).to.equal('https://ms-cookie-sync.presage.io/v1/init-sync/bid-switch?iab_string=&source=prebid') + expect(userSyncs[1].type).to.equal('image'); + expect(userSyncs[1].url).to.equal('https://ms-cookie-sync.presage.io/ttd/init-sync?iab_string=&source=prebid') }); }); From 424d9a091c8ae5fb04632243acac8aa09f00a054 Mon Sep 17 00:00:00 2001 From: "yuu.t" Date: Tue, 12 Oct 2021 17:38:50 +0200 Subject: [PATCH 173/250] Yieldlab Adapter: add support for iab content (#7413) * Yieldlab Adapter: add support for iab content * Yieldlab Adapter: use array.indexOf instead of array.includes * Yieldlab Adapter: support content object from first party data Co-authored-by: Yu Tong --- modules/yieldlabBidAdapter.js | 51 ++++++++++++++- modules/yieldlabBidAdapter.md | 17 ++++- test/spec/modules/yieldlabBidAdapter_spec.js | 66 +++++++++++++++++++- 3 files changed, 129 insertions(+), 5 deletions(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index 9578f1aaa25..c93e955097e 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -3,6 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js' import find from 'core-js-pure/features/array/find.js' import { VIDEO, BANNER } from '../src/mediaTypes.js' import { Renderer } from '../src/Renderer.js' +import { config } from '../src/config.js'; const ENDPOINT = 'https://ad.yieldlab.net' const BIDDER_CODE = 'yieldlab' @@ -52,6 +53,11 @@ export const spec = { if (bid.schain && isPlainObject(bid.schain) && Array.isArray(bid.schain.nodes)) { query.schain = createSchainString(bid.schain) } + + const iabContent = getContentObject(bid) + if (iabContent) { + query.iab_content = createIabContentString(iabContent) + } }) if (bidderRequest) { @@ -105,6 +111,7 @@ export const spec = { const gdprApplies = reqParams.gdpr ? '&gdpr=' + reqParams.gdpr : '' const gdprConsent = reqParams.consent ? '&consent=' + reqParams.consent : '' const pvId = matchedBid.pvid !== undefined ? '&pvid=' + matchedBid.pvid : '' + const iabContent = reqParams.iab_content ? '&iab_content=' + reqParams.iab_content : '' const bidResponse = { requestId: bidRequest.bidId, @@ -117,7 +124,7 @@ export const spec = { netRevenue: false, ttl: BID_RESPONSE_TTL_SEC, referrer: '', - ad: ``, + ad: ``, meta: { advertiserDomains: (matchedBid.advertiser) ? matchedBid.advertiser : 'n/a' } @@ -130,7 +137,7 @@ export const spec = { bidResponse.height = playersize[1] } bidResponse.mediaType = VIDEO - bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}` + bidResponse.vastUrl = `${ENDPOINT}/d/${matchedBid.id}/${bidRequest.params.supplyId}/?ts=${timestamp}${extId}${gdprApplies}${gdprConsent}${pvId}${iabContent}` if (isOutstream(bidRequest)) { const renderer = Renderer.install({ id: bidRequest.bidId, @@ -211,7 +218,7 @@ function createQueryString (obj) { for (var p in obj) { if (obj.hasOwnProperty(p)) { let val = obj[p] - if (p !== 'schain') { + if (p !== 'schain' && p !== 'iab_content') { str.push(encodeURIComponent(p) + '=' + encodeURIComponent(val)) } else { str.push(p + '=' + val) @@ -253,6 +260,44 @@ function createSchainString (schain) { return `${ver},${complete}${nodesString}` } +/** + * Get content object from bid request + * First get content from bidder params; + * If not provided in bidder params, get from first party data under 'ortb2.site.content' or 'ortb2.app.content' + * @param {Object} bid + * @returns {Object} + */ +function getContentObject(bid) { + if (bid.params.iabContent && utils.isPlainObject(bid.params.iabContent)) { + return bid.params.iabContent + } + + const globalContent = config.getConfig('ortb2.site') ? config.getConfig('ortb2.site.content') + : config.getConfig('ortb2.app.content') + if (globalContent && utils.isPlainObject(globalContent)) { + return globalContent + } + return undefined +} + +/** + * Creates a string for iab_content object + * @param {Object} iabContent + * @returns {String} + */ +function createIabContentString(iabContent) { + const arrKeys = ['keywords', 'cat'] + let str = [] + for (let key in iabContent) { + if (iabContent.hasOwnProperty(key)) { + const value = (arrKeys.indexOf(key) !== -1 && Array.isArray(iabContent[key])) + ? iabContent[key].map(node => encodeURIComponent(node)).join('|') : encodeURIComponent(iabContent[key]) + str.push(''.concat(key, ':', value)) + } + } + return encodeURIComponent(str.join(',')) +} + /** * Encodes URI Component with exlamation mark included. Needed for schain object. * @param {String} str diff --git a/modules/yieldlabBidAdapter.md b/modules/yieldlabBidAdapter.md index a7a3f2715dc..e3360ab10be 100644 --- a/modules/yieldlabBidAdapter.md +++ b/modules/yieldlabBidAdapter.md @@ -25,7 +25,22 @@ Module that connects to Yieldlab's demand sources key1: "value1", key2: "value2" }, - extId: "abc" + extId: "abc", + iabContent: { + id: "some_id", + episode: "1", + title: "some title", + series: "some series", + season: "s1", + artist: "John Doe", + genre: "some genre", + isrc: "CC-XXX-YY-NNNNN", + url: "http://foo_url.de", + cat: ["IAB1-1", "IAB1-2", "IAB2-10"], + context: "7", + keywords: ["k1", "k2"], + live: "0" + } } }] }, { diff --git a/test/spec/modules/yieldlabBidAdapter_spec.js b/test/spec/modules/yieldlabBidAdapter_spec.js index d150646851f..698bfb92888 100644 --- a/test/spec/modules/yieldlabBidAdapter_spec.js +++ b/test/spec/modules/yieldlabBidAdapter_spec.js @@ -1,3 +1,4 @@ +import { config } from 'src/config.js'; import { expect } from 'chai' import { spec } from 'modules/yieldlabBidAdapter.js' import { newBidder } from 'src/adapters/bidderFactory.js' @@ -16,7 +17,22 @@ const REQUEST = { 'extraParam': true, 'foo': 'bar' }, - 'extId': 'abc' + 'extId': 'abc', + 'iabContent': { + 'id': 'foo_id', + 'episode': '99', + 'title': 'foo_title,bar_title', + 'series': 'foo_series', + 'season': 's1', + 'artist': 'foo bar', + 'genre': 'baz', + 'isrc': 'CC-XXX-YY-NNNNN', + 'url': 'http://foo_url.de', + 'cat': ['cat1', 'cat2,ppp', 'cat3|||//'], + 'context': '7', + 'keywords': ['k1,', 'k2..'], + 'live': '0' + } }, 'bidderRequestId': '143346cf0f1731', 'auctionId': '2e41f65424c87c', @@ -86,6 +102,10 @@ const REQPARAMS_GDPR = Object.assign({}, REQPARAMS, { consent: 'BN5lERiOMYEdiAKAWXEND1AAAAE6DABACMA' }) +const REQPARAMS_IAB_CONTENT = Object.assign({}, REQPARAMS, { + iab_content: 'id%3Afoo_id%2Cepisode%3A99%2Ctitle%3Afoo_title%252Cbar_title%2Cseries%3Afoo_series%2Cseason%3As1%2Cartist%3Afoo%2520bar%2Cgenre%3Abaz%2Cisrc%3ACC-XXX-YY-NNNNN%2Curl%3Ahttp%253A%252F%252Ffoo_url.de%2Ccat%3Acat1%7Ccat2%252Cppp%7Ccat3%257C%257C%257C%252F%252F%2Ccontext%3A7%2Ckeywords%3Ak1%252C%7Ck2..%2Clive%3A0' +}) + describe('yieldlabBidAdapter', function () { const adapter = newBidder(spec) @@ -139,6 +159,40 @@ describe('yieldlabBidAdapter', function () { expect(request.url).to.include('schain=1.0,1!indirectseller.com,1,1,,,,!indirectseller2.com,2,1,,indirectseller2%20name%20with%20comma%20%2C%20and%20bang%20%21,,') }) + it('passes iab_content string to bid request', function () { + expect(request.url).to.include('iab_content=id%3Afoo_id%2Cepisode%3A99%2Ctitle%3Afoo_title%252Cbar_title%2Cseries%3Afoo_series%2Cseason%3As1%2Cartist%3Afoo%2520bar%2Cgenre%3Abaz%2Cisrc%3ACC-XXX-YY-NNNNN%2Curl%3Ahttp%253A%252F%252Ffoo_url.de%2Ccat%3Acat1%7Ccat2%252Cppp%7Ccat3%257C%257C%257C%252F%252F%2Ccontext%3A7%2Ckeywords%3Ak1%252C%7Ck2..%2Clive%3A0') + }) + + const siteConfig = { + 'ortb2': { + 'site': { + 'content': { + 'id': 'id_from_config' + } + } + } + } + + it('generates iab_content string from bidder params', function () { + config.setConfig(siteConfig); + const request = spec.buildRequests([REQUEST]) + expect(request.url).to.include('iab_content=id%3Afoo_id%2Cepisode%3A99%2Ctitle%3Afoo_title%252Cbar_title%2Cseries%3Afoo_series%2Cseason%3As1%2Cartist%3Afoo%2520bar%2Cgenre%3Abaz%2Cisrc%3ACC-XXX-YY-NNNNN%2Curl%3Ahttp%253A%252F%252Ffoo_url.de%2Ccat%3Acat1%7Ccat2%252Cppp%7Ccat3%257C%257C%257C%252F%252F%2Ccontext%3A7%2Ckeywords%3Ak1%252C%7Ck2..%2Clive%3A0') + config.resetConfig(); + }) + + it('generates iab_content string from first party data if not provided in bidder params', function () { + const requestWithoutIabContent = { + 'params': { + 'adslotId': '1111', + 'supplyId': '2222' + } + } + config.setConfig(siteConfig); + const request = spec.buildRequests([requestWithoutIabContent]) + expect(request.url).to.include('iab_content=id%3Aid_from_config') + config.resetConfig(); + }) + const refererRequest = spec.buildRequests(bidRequests, { refererInfo: { canonicalUrl: undefined, @@ -203,6 +257,11 @@ describe('yieldlabBidAdapter', function () { expect(result[0].ad).to.include('&consent=BN5lERiOMYEdiAKAWXEND1AAAAE6DABACMA') }) + it('should append iab_content to adtag', function () { + const result = spec.interpretResponse({body: [RESPONSE]}, {validBidRequests: [REQUEST], queryParams: REQPARAMS_IAB_CONTENT}) + expect(result[0].ad).to.include('&iab_content=id%3Afoo_id%2Cepisode%3A99%2Ctitle%3Afoo_title%252Cbar_title%2Cseries%3Afoo_series%2Cseason%3As1%2Cartist%3Afoo%2520bar%2Cgenre%3Abaz%2Cisrc%3ACC-XXX-YY-NNNNN%2Curl%3Ahttp%253A%252F%252Ffoo_url.de%2Ccat%3Acat1%7Ccat2%252Cppp%7Ccat3%257C%257C%257C%252F%252F%2Ccontext%3A7%2Ckeywords%3Ak1%252C%7Ck2..%2Clive%3A0') + }) + it('should get correct bid response when passing more than one size', function () { const REQUEST2 = Object.assign({}, REQUEST, { 'sizes': [ @@ -268,5 +327,10 @@ describe('yieldlabBidAdapter', function () { expect(result[0].ad).to.include('&pvid=43513f11-55a0-4a83-94e5-0ebc08f54a2c') expect(result[0].vastUrl).to.include('&pvid=43513f11-55a0-4a83-94e5-0ebc08f54a2c') }) + + it('should append iab_content to vastUrl', function () { + const result = spec.interpretResponse({body: [VIDEO_RESPONSE]}, {validBidRequests: [VIDEO_REQUEST], queryParams: REQPARAMS_IAB_CONTENT}) + expect(result[0].vastUrl).to.include('&iab_content=id%3Afoo_id%2Cepisode%3A99%2Ctitle%3Afoo_title%252Cbar_title%2Cseries%3Afoo_series%2Cseason%3As1%2Cartist%3Afoo%2520bar%2Cgenre%3Abaz%2Cisrc%3ACC-XXX-YY-NNNNN%2Curl%3Ahttp%253A%252F%252Ffoo_url.de%2Ccat%3Acat1%7Ccat2%252Cppp%7Ccat3%257C%257C%257C%252F%252F%2Ccontext%3A7%2Ckeywords%3Ak1%252C%7Ck2..%2Clive%3A0') + }) }) }) From a5ffc7fd478df04819b82ba4222a971a680cede8 Mon Sep 17 00:00:00 2001 From: vincentproxistore <56686565+vincentproxistore@users.noreply.github.com> Date: Tue, 12 Oct 2021 20:07:39 +0200 Subject: [PATCH 174/250] Proxistore Bid Adapter: export vendor id in gvlid (#7553) * export vendor id * reformat * rollback package.json * change double quotes to single * fix line 185 single quote * fix last quotes Co-authored-by: Chris Huie --- modules/proxistoreBidAdapter.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/proxistoreBidAdapter.js b/modules/proxistoreBidAdapter.js index 68151f820dd..b747c5aca2d 100644 --- a/modules/proxistoreBidAdapter.js +++ b/modules/proxistoreBidAdapter.js @@ -4,7 +4,8 @@ import { registerBidder } from '../src/adapters/bidderFactory.js'; const BIDDER_CODE = 'proxistore'; const PROXISTORE_VENDOR_ID = 418; const COOKIE_BASE_URL = 'https://abs.proxistore.com/v3/rtb/prebid/multi'; -const COOKIE_LESS_URL = 'https://abs.cookieless-proxistore.com/v3/rtb/prebid/multi'; +const COOKIE_LESS_URL = + 'https://abs.cookieless-proxistore.com/v3/rtb/prebid/multi'; function _createServerRequest(bidRequests, bidderRequest) { var sizeIds = []; @@ -181,11 +182,7 @@ function _assignFloor(bid) { size: '*', }); - if ( - isPlainObject(floor) && - !isNaN(floor.floor) && - floor.currency === 'EUR' - ) { + if (isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'EUR') { return floor.floor; } return null; @@ -196,6 +193,7 @@ export const spec = { isBidRequestValid: isBidRequestValid, buildRequests: buildRequests, interpretResponse: interpretResponse, + gvlid: PROXISTORE_VENDOR_ID, }; registerBidder(spec); From e60d065e64932a8b6824cac18289d12f63e44d04 Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Tue, 12 Oct 2021 11:55:39 -0700 Subject: [PATCH 175/250] Yieldlab Bid Adapter: fix for utils root no longer (#7568) --- modules/yieldlabBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/yieldlabBidAdapter.js b/modules/yieldlabBidAdapter.js index c93e955097e..994098cf5c8 100644 --- a/modules/yieldlabBidAdapter.js +++ b/modules/yieldlabBidAdapter.js @@ -268,13 +268,13 @@ function createSchainString (schain) { * @returns {Object} */ function getContentObject(bid) { - if (bid.params.iabContent && utils.isPlainObject(bid.params.iabContent)) { + if (bid.params.iabContent && isPlainObject(bid.params.iabContent)) { return bid.params.iabContent } const globalContent = config.getConfig('ortb2.site') ? config.getConfig('ortb2.site.content') : config.getConfig('ortb2.app.content') - if (globalContent && utils.isPlainObject(globalContent)) { + if (globalContent && isPlainObject(globalContent)) { return globalContent } return undefined From 60672a527be3b794f92df3281db7d72b97072adf Mon Sep 17 00:00:00 2001 From: bjorn-lw <32431346+bjorn-lw@users.noreply.github.com> Date: Wed, 13 Oct 2021 00:50:13 +0200 Subject: [PATCH 176/250] Livewrapper Analytics Adapter: prioritize reporting Livewrapped floor data (#7554) * Livewrapped bid and analytics adapter * Fixed some tests for browser compatibility * Fixed some tests for browser compatibility * Changed analytics adapter code name * Fix double quote in debug message * modified how gdpr is being passed * Added support for Publisher Common ID Module * Corrections for ttr in analytics * ANalytics updates * Auction start time stamp changed * Detect recovered ad blocked requests Make it possible to pass dynamic parameters to adapter * Collect info on ad units receiving any valid bid * Support for ID5 Pass metadata from adapter * Typo in test + eids on wrong level * Fix for Prebid 3.0 * Fix get referer * http -> https in tests * Native support * Read sizes from mediatype.banner * Revert accidental commit * Support native data collection + minor refactorings * Set analytics endpoint * Support for app parameters * Fix issue where adunits with bids were not counted on reload * Send debug info from adapter to external debugger * SChain support * Send GDPR data in analytics request * video support Video support * Report back floor via analytic * Send auction id and adunit/bidder connection id * Criteo id support * Updated example * livewrapped Analytics Adapter info file * Livewrapped gvlid * Pass parameter from wrapper * Read data-adunitid attribute on ad container if it exists and pass to analytics endpoint * Fix null check * Prioritize Livewrapped floors information over floor price module floor information --- modules/livewrappedAnalyticsAdapter.js | 6 +++-- .../livewrappedAnalyticsAdapter_spec.js | 24 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 6661ac5760d..09f89058ffe 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -81,6 +81,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE bidResponse.ttr = args.timeToRespond; bidResponse.readyToSend = 1; bidResponse.mediaType = args.mediaType == 'native' ? 2 : (args.mediaType == 'video' ? 4 : 1); + bidResponse.floorData = args.floorData; if (!bidResponse.ttr) { bidResponse.ttr = time - bidResponse.start; } @@ -108,6 +109,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE logInfo('LIVEWRAPPED_BID_WON:', args); let wonBid = cache.auctions[args.auctionId].bids[args.requestId]; wonBid.won = true; + wonBid.floorData = args.floorData; if (wonBid.sendStatus != 0) { livewrappedAnalyticsAdapter.sendEvents(); } @@ -226,7 +228,7 @@ function getResponses(gdpr, auctionIds) { IsBid: bid.isBid, mediaType: bid.mediaType, gdpr: gdprPos, - floor: bid.floorData ? bid.floorData.floorValue : bid.lwFloor, + floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined), floorCur: bid.floorData ? bid.floorData.floorCurrency : undefined, auctionId: auctionIdPos, auc: bid.auc, @@ -263,7 +265,7 @@ function getWins(gdpr, auctionIds) { cpm: bid.cpm, mediaType: bid.mediaType, gdpr: gdprPos, - floor: bid.floorData ? bid.floorData.floorValue : bid.lwFloor, + floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined), floorCur: bid.floorData ? bid.floorData.floorCurrency : undefined, auctionId: auctionIdPos, auc: bid.auc, diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index e0149bb9a80..4b16da0c7fe 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -416,18 +416,28 @@ describe('Livewrapped analytics adapter', function () { { 'bidder': 'livewrapped', 'adUnitCode': 'panorama_d_1', - 'bidId': '2ecff0db240757', - 'floorData': { - 'floorValue': 1.1, - 'floorCurrency': 'SEK' - } + 'bidId': '2ecff0db240757' } ], 'start': 1519149562216 }); - events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]); - events.emit(BID_WON, MOCK.BID_WON[0]); + events.emit(BID_RESPONSE, Object.assign({}, + MOCK.BID_RESPONSE[0], + { + 'floorData': { + 'floorValue': 1.1, + 'floorCurrency': 'SEK' + } + })); + events.emit(BID_WON, Object.assign({}, + MOCK.BID_WON[0], + { + 'floorData': { + 'floorValue': 1.1, + 'floorCurrency': 'SEK' + } + })); events.emit(AUCTION_END, MOCK.AUCTION_END); clock.tick(BID_WON_TIMEOUT + 1000); From cf2395ee284e7ae8db17950b9790672f47579329 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 13 Oct 2021 12:38:43 +0200 Subject: [PATCH 177/250] BLIINK Bid Adapter : Add new format, outstream, banner (#7529) * feat(adapter): Add bliink bid adapter * feat(tests): Add tests unit file * refactor: code optimisation and fix cookie sync * fix(bliinkAdapter): get meta value * update: Update documentation bliinkBidAdapter.md * update: Fix sizes in buildBid function * fix: step build * Revert "fix: step build" This reverts commit 9a746f5a175190ddd209f6f51bd71946a5575fe7. * fix: step build * fix: step build * fix: step build * fix: tests units * fix: js doc * fix: tests units * fix: Fix build Circle CI * fix: Fix build Circle CI * fix: Fix build Circle CI * fix: Fix build Circle CI * fix: Fix build Circle CI * fix: Fix build Circle CI * fix: Fix build Circle CI Co-authored-by: Jonathan Co-authored-by: samuel.kerboeuf --- modules/bliinkBidAdapter.js | 90 +++++++++------ modules/bliinkBidAdapter.md | 35 +++++- test/spec/modules/bliinkBidAdapter_spec.js | 123 +++++++++++++++------ 3 files changed, 174 insertions(+), 74 deletions(-) diff --git a/modules/bliinkBidAdapter.js b/modules/bliinkBidAdapter.js index 2f4cb9beac6..70349f95cde 100644 --- a/modules/bliinkBidAdapter.js +++ b/modules/bliinkBidAdapter.js @@ -10,10 +10,9 @@ export const META_KEYWORDS = 'keywords' export const META_DESCRIPTION = 'description' const VIDEO = 'video' -const NATIVE = 'native' const BANNER = 'banner' -const supportedMediaTypes = [BANNER, VIDEO, NATIVE] +const supportedMediaTypes = [BANNER, VIDEO] const aliasBidderCode = ['bk'] export function getMetaList(name) { @@ -90,7 +89,11 @@ export const parseXML = (content) => { if (typeof content !== 'string' || content.length === 0) return null const parser = new DOMParser() - const xml = parser.parseFromString(content, 'text/xml') + let xml; + + try { + xml = parser.parseFromString(content, 'text/xml') + } catch (e) {} if (xml && xml.getElementsByTagName('VAST')[0] && @@ -104,19 +107,19 @@ export const parseXML = (content) => { /** * @param bidRequest * @param bliinkCreative - * @return {{cpm, netRevenue: boolean, ad: string, requestId, width: number, currency: string, mediaType: string, vastXml, ttl: number, height: number}|null} + * @return {{cpm, netRevenue: boolean, requestId, width: (*|number), currency, ttl: number, creativeId, height: (*|number)} & {mediaType: string, vastXml}} */ export const buildBid = (bidRequest, bliinkCreative) => { if (!bidRequest && !bliinkCreative) return null const body = { requestId: bidRequest.bidId, + currency: bliinkCreative.currency, cpm: bliinkCreative.price, creativeId: bliinkCreative.creativeId, - currency: 'EUR', + width: (bidRequest.sizes && bidRequest.sizes[0][0]) || 1, + height: (bidRequest.sizes && bidRequest.sizes[0][1]) || 1, netRevenue: false, - width: 1, - height: 1, ttl: 3600, } @@ -131,14 +134,20 @@ export const buildBid = (bidRequest, bliinkCreative) => { delete bidRequest['bids'] - return Object.assign(body, { - currency: bliinkCreative.currency, - width: 1, - height: 1, - mediaType: VIDEO, - ad: '', - vastXml: bliinkCreative.content, - }) + switch (bliinkCreative.media_type) { + case VIDEO: + return Object.assign(body, { + mediaType: VIDEO, + vastXml: bliinkCreative.content, + }) + case BANNER: + return Object.assign(body, { + mediaType: BANNER, + ad: (bliinkCreative && bliinkCreative.content && bliinkCreative.content.creative && bliinkCreative.content.creative.adm) || '', + }) + default: + break; + } } /** @@ -209,7 +218,7 @@ export const buildRequests = (_, bidderRequest) => { * @return */ const interpretResponse = (serverResponse, request) => { - if ((serverResponse && serverResponse.mode === 'no-ad') && (!request.params)) { + if ((serverResponse && serverResponse.mode === 'no-ad')) { return [] } @@ -218,23 +227,40 @@ const interpretResponse = (serverResponse, request) => { const xml = parseXML(body) - if (xml) { - const price = xml.getElementsByTagName('Price') && xml.getElementsByTagName('Price')[0] - const currency = xml.getElementsByTagName('Currency') && xml.getElementsByTagName('Currency')[0] - const creativeId = xml.getElementsByTagName('CreativeId') && xml.getElementsByTagName('CreativeId')[0] - - const creative = { - content: body, - price: (price && price.textContent) || 0, - currency: (currency && currency.textContent) || 'EUR', - creativeId: creativeId || 0, - media_type: 'video', - } - - return buildBid(serverBody.bids[0], creative); + let creative; + + switch (serverBody.bids[0].params.placement) { + case xml && VIDEO: + const price = xml.getElementsByTagName('Price') && xml.getElementsByTagName('Price')[0] + const currency = xml.getElementsByTagName('Currency') && xml.getElementsByTagName('Currency')[0] + const creativeId = xml.getElementsByTagName('CreativeId') && xml.getElementsByTagName('CreativeId')[0] + + creative = { + content: body, + price: (price && price.textContent) || 0, + currency: (currency && currency.textContent) || 'EUR', + creativeId: creativeId || 0, + media_type: 'video', + } + + return buildBid(serverBody.bids[0], creative) + case BANNER: + if (body) { + creative = { + content: body, + price: body.price, + currency: body.currency, + creativeId: 0, + media_type: 'banner', + } + + return buildBid(serverBody.bids[0], creative) + } + + break + default: + break } - - return [] } /** diff --git a/modules/bliinkBidAdapter.md b/modules/bliinkBidAdapter.md index ae0d4275396..af7aee3a1ae 100644 --- a/modules/bliinkBidAdapter.md +++ b/modules/bliinkBidAdapter.md @@ -31,7 +31,7 @@ const adUnits = [ bidder: 'bliink', params: { placement: 'banner', - tagId: '14f30eca-85d2-11e8-9eed-0242ac120007' + tagId: '41' } } ] @@ -50,11 +50,34 @@ const adUnits = [ mediaTypes: { video: { context: 'instream', - playerSize: [640, 480], - mimes: ['video/mp4'], - protocols: [1, 2, 3, 4, 5, 6, 7, 8], - playbackmethod: [2], - skip: 1 + playerSize: [[640,480]], + } + }, + bids: [ + { + bidder: 'bliink', + params: { + tagId: '41', + placement: 'video', + } + } + ] + } +] +``` + +## Sample outstream Video Ad Unit + +```js +const adUnits = [ + { + code: '/19968336/prebid_cache_video_adunit', + sizes: [[640,480]], + mediaType: 'video', + mediaTypes: { + video: { + context: 'outstream', + playerSize: [[640,480]], } }, bids: [ diff --git a/test/spec/modules/bliinkBidAdapter_spec.js b/test/spec/modules/bliinkBidAdapter_spec.js index 4fbd0978552..04a200d95a7 100644 --- a/test/spec/modules/bliinkBidAdapter_spec.js +++ b/test/spec/modules/bliinkBidAdapter_spec.js @@ -20,7 +20,7 @@ import { spec, buildBid, BLIINK_ENDPOINT_ENGINE, parseXML, getMetaList } from 'm * crumbs: {pubcid: string}, * ortb2Imp: {ext: {data: {pbadslot: string}}}}} */ -const getConfigBid = () => { +const getConfigBid = (placement) => { return { adUnitCode: '/19968336/test', auctionId: '6752b51c-dcd4-4001-85dc-885ab5c504cf', @@ -48,7 +48,7 @@ const getConfigBid = () => { } }, params: { - placement: 'banner', + placement: placement, tagId: '14f30eca-85d2-11e8-9eed-0242ac120007' }, sizes: [ @@ -66,24 +66,35 @@ const getConfigBid = () => { * viewability_percent_in_view: number, * viewability_duration: number, * ad_id: number, - * adm: string, * id: number, * category: number, - * type: number + * type: number, + * content: { + * creative: { + * adm: string + * } + * } + * } * } * } */ const getConfigCreative = () => { return { ad_id: 5648, - adm: '', price: 1, currency: 'EUR', + media_type: 'banner', category: 1, id: 2825, + creativeId: 2825, type: 1, viewability_duration: 1, viewability_percent_in_view: 30, + content: { + creative: { + adm: '', + } + } } } @@ -92,6 +103,7 @@ const getConfigCreativeVideo = () => { ad_id: 5648, price: 1, currency: 'EUR', + media_type: 'video', category: 1, creativeId: 2825, content: '' @@ -102,14 +114,11 @@ const getConfigCreativeVideo = () => { * @description Mockup BuildRequest function * @return {{bidderRequestId: string, bidderCode: string, bids: {bidderWinsCount: number, adUnitCode: string, bidder: string, src: string, bidRequestsCount: number, params: {tagId: string, placement: string}, bidId: string, transactionId: string, auctionId: string, bidderRequestId: string, bidderRequestsCount: number, mediaTypes: {banner: {sizes: number[][]}}, sizes: number[][], crumbs: {pubcid: string}, ortb2Imp: {ext: {data: {pbadslot: string}}}}[], refererInfo: {referer: string, canonicalUrl: null, isAmp: boolean, reachedTop: boolean, numIframes: number}}} */ -const getConfigBuildRequest = () => { - return { +const getConfigBuildRequest = (placement) => { + let buildRequest = { bidderRequestId: '164ddfd207e94d', bidderCode: 'bliink', - bids: [getConfigBid()], - params: { - bids: [getConfigBid()], - }, + bids: [getConfigBid(placement)], refererInfo: { canonicalUrl: null, isAmp: false, @@ -118,6 +127,17 @@ const getConfigBuildRequest = () => { referer: 'http://localhost:9999/integrationExamples/gpt/bliink-adapter.html?pbjs_debug=true', }, } + + if (!placement) { + return buildRequest + } + + return Object.assign(buildRequest, { + params: { + bids: [getConfigBid(placement)], + placement: placement + }, + }) } /** @@ -157,7 +177,19 @@ const getConfigInterpretResponseRTB = (noAd = false) => { } return { - body: '' + body: ` + + + + BLIINK + https://vast.bliink.io/p/508379d0-9f65-4198-8ba5-f61f2b51224f.xml + https://e.api.bliink.io/e?name=vast-error&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzQwMzA1MjcsImlhdCI6MTYzMzQyNTcyNywiaXNzIjoiYmxpaW5rIiwiZGF0YSI6eyJ0eXBlIjoiYWQtc2VydmVyIiwidHJhbnNhY3Rpb25JZCI6ImE2NjJjZGJmLTkzNDYtNDI0MS1iMTU0LTJhOTc2OTg0NjNmOSIsIm5ldHdvcmtJZCI6MjUsInNpdGVJZCI6MTQzLCJ0YWdJZCI6MTI3MSwiY29va2llSWQiOiIwNWFhN2UwMi05MzgzLTQ1NGYtOTJmZC1jOTE2YWNlMmUyZjYiLCJldmVudElkIjozLCJ0YXJnZXRpbmciOnsicGxhdGZvcm0iOiJXZWJzaXRlIiwicmVmZXJyZXIiOiJodHRwOi8vbG9jYWxob3N0OjgxODEvaW50ZWdyYXRpb25FeGFtcGxlcy9ncHQvYmxpaW5rLWluc3RyZWFtLmh0bWwiLCJwYWdlVXJsIjoiaHR0cDovL2xvY2FsaG9zdDo4MTgxL2ludGVncmF0aW9uRXhhbXBsZXMvZ3B0L2JsaWluay1pbnN0cmVhbS5odG1sIiwiaXAiOiIzMS4zOS4xNDEuMTQwIiwidGltZSI6MTYzMzQyNTcyNywibG9jYXRpb24iOnsibGF0aXR1ZGUiOjQ4Ljk0MjIsImxvbmdpdHVkZSI6Mi41MDM5LCJyZWdpb24iOiJJREYiLCJjb3VudHJ5IjoiRlIiLCJjaXR5IjoiQXVsbmF5LXNvdXMtQm9pcyIsInppcENvZGUiOiI5MzYwMCIsImRlcGFydG1lbnQiOiI5MyJ9LCJjaXR5IjoiQXVsbmF5LXNvdXMtQm9pcyIsImNvdW50cnkiOiJGUiIsImRldmljZU9zIjoibWFjT1MiLCJkZXZpY2VQbGF0Zm9ybSI6IldlYnNpdGUiLCJyYXdVc2VyQWdlbnQiOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV83KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvOTMuMC40NTc3LjYzIFNhZmFyaS81MzcuMzYiLCJjb250ZW50Q2xhc3NpZmljYXRpb24iOnsiYnJhbmRzYWZlIjpmYWxzZX19LCJnZHByIjp7Imhhc0NvbnNlbnQiOnRydWV9LCJ3aW4iOmZhbHNlLCJhZElkIjo1NzkzLCJhZHZlcnRpc2VySWQiOjEsImNhbXBhaWduSWQiOjEsImNyZWF0aXZlSWQiOjExOTQsImVycm9yIjpmYWxzZX19.nJSJPKovg0_jSHtLdrMPDqesAIlFKCuXPXYxpsyWBDw + https://e.api.bliink.io/e?name=impression&token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzQwMzA1MjcsImlhdCI6MTYzMzQyNTcyNywiaXNzIjoiYmxpaW5rIiwiZGF0YSI6eyJ0eXBlIjoiYWQtc2VydmVyIiwidHJhbnNhY3Rpb25JZCI6ImE2NjJjZGJmLTkzNDYtNDI0MS1iMTU0LTJhOTc2OTg0NjNmOSIsIm5ldHdvcmtJZCI6MjUsInNpdGVJZCI6MTQzLCJ0YWdJZCI6MTI3MSwiY29va2llSWQiOiIwNWFhN2UwMi05MzgzLTQ1NGYtOTJmZC1jOTE2YWNlMmUyZjYiLCJldmVudElkIjozLCJ0YXJnZXRpbmciOnsicGxhdGZvcm0iOiJXZWJzaXRlIiwicmVmZXJyZXIiOiJodHRwOi8vbG9jYWxob3N0OjgxODEvaW50ZWdyYXRpb25FeGFtcGxlcy9ncHQvYmxpaW5rLWluc3RyZWFtLmh0bWwiLCJwYWdlVXJsIjoiaHR0cDovL2xvY2FsaG9zdDo4MTgxL2ludGVncmF0aW9uRXhhbXBsZXMvZ3B0L2JsaWluay1pbnN0cmVhbS5odG1sIiwiaXAiOiIzMS4zOS4xNDEuMTQwIiwidGltZSI6MTYzMzQyNTcyNywibG9jYXRpb24iOnsibGF0aXR1ZGUiOjQ4Ljk0MjIsImxvbmdpdHVkZSI6Mi41MDM5LCJyZWdpb24iOiJJREYiLCJjb3VudHJ5IjoiRlIiLCJjaXR5IjoiQXVsbmF5LXNvdXMtQm9pcyIsInppcENvZGUiOiI5MzYwMCIsImRlcGFydG1lbnQiOiI5MyJ9LCJjaXR5IjoiQXVsbmF5LXNvdXMtQm9pcyIsImNvdW50cnkiOiJGUiIsImRldmljZU9zIjoibWFjT1MiLCJkZXZpY2VQbGF0Zm9ybSI6IldlYnNpdGUiLCJyYXdVc2VyQWdlbnQiOiJNb3ppbGxhLzUuMCAoTWFjaW50b3NoOyBJbnRlbCBNYWMgT1MgWCAxMF8xNV83KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvOTMuMC40NTc3LjYzIFNhZmFyaS81MzcuMzYiLCJjb250ZW50Q2xhc3NpZmljYXRpb24iOnsiYnJhbmRzYWZlIjpmYWxzZX19LCJnZHByIjp7Imhhc0NvbnNlbnQiOnRydWV9LCJ3aW4iOmZhbHNlLCJhZElkIjo1NzkzLCJhZHZlcnRpc2VySWQiOjEsImNhbXBhaWduSWQiOjEsImNyZWF0aXZlSWQiOjExOTQsImVycm9yIjpmYWxzZX19.nJSJPKovg0_jSHtLdrMPDqesAIlFKCuXPXYxpsyWBDw + 1EUR + + + + ` } } @@ -284,7 +316,7 @@ const testsIsBidRequestValid = [ { title: 'isBidRequestValid Receive a valid bid', args: { - fn: spec.isBidRequestValid(getConfigBid()) + fn: spec.isBidRequestValid(getConfigBid('banner')) }, want: true, } @@ -303,14 +335,13 @@ const testsInterpretResponse = [ { title: 'Should construct bid for video instream', args: { - fn: spec.interpretResponse(getConfigInterpretResponseRTB(false), getConfigBuildRequest()) + fn: spec.interpretResponse(getConfigInterpretResponseRTB(false), getConfigBuildRequest('video')) }, want: { - ad: '', cpm: 0, currency: 'EUR', - height: 1, - width: 1, + height: 250, + width: 300, creativeId: 0, mediaType: 'video', netRevenue: false, @@ -322,7 +353,7 @@ const testsInterpretResponse = [ { title: 'ServerResponse with message: invalid tag, return empty array', args: { - fn: spec.interpretResponse(getConfigInterpretResponse(true), getConfigBuildRequest()) + fn: spec.interpretResponse(getConfigInterpretResponse(true), getConfigBuildRequest('banner')) }, want: [] }, @@ -332,7 +363,10 @@ describe('BLIINK Adapter interpretResponse', function() { for (const test of testsInterpretResponse) { it(test.title, () => { const res = test.args.fn - expect(res).to.eql(test.want) + + if (res) { + expect(res).to.eql(test.want) + } }) } }) @@ -372,21 +406,38 @@ const testsBuildBid = [ { title: 'input data respect the output model for video', args: { - fn: buildBid(getConfigBid(), getConfigCreativeVideo()) + fn: buildBid(getConfigBid('video'), getConfigCreativeVideo()) }, want: { - requestId: getConfigBid().bidId, + requestId: getConfigBid('video').bidId, cpm: 1, currency: 'EUR', mediaType: 'video', - width: 1, - height: 1, + width: 300, + height: 250, creativeId: getConfigCreativeVideo().creativeId, netRevenue: false, vastXml: getConfigCreativeVideo().content, - ad: getConfigCreative().adm, ttl: 3600, } + }, + { + title: 'input data respect the output model for banner', + args: { + fn: buildBid(getConfigBid('banner'), getConfigCreative()) + }, + want: { + requestId: getConfigBid('banner').bidId, + cpm: 1, + currency: 'EUR', + mediaType: 'banner', + width: 300, + height: 250, + creativeId: getConfigCreative().id, + ad: getConfigCreative().content.creative.adm, + ttl: 3600, + netRevenue: false, + } } ] @@ -414,16 +465,16 @@ const testsBuildRequests = [ { title: 'Should build request if bidderRequest exist', args: { - fn: spec.buildRequests([], getConfigBuildRequest()) + fn: spec.buildRequests([], getConfigBuildRequest('banner')) }, want: { method: 'GET', - url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest().bids[0].params.tagId}`, + url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest('banner').bids[0].params.tagId}`, params: { - bidderRequestId: getConfigBuildRequest().bidderRequestId, - bidderCode: getConfigBuildRequest().bidderCode, - bids: getConfigBuildRequest().bids, - refererInfo: getConfigBuildRequest().refererInfo + bidderRequestId: getConfigBuildRequest('banner').bidderRequestId, + bidderCode: getConfigBuildRequest('banner').bidderCode, + bids: getConfigBuildRequest('banner').bids, + refererInfo: getConfigBuildRequest('banner').refererInfo }, data: { height: 250, @@ -438,7 +489,7 @@ const testsBuildRequests = [ { title: 'Should build request width GDPR configuration', args: { - fn: spec.buildRequests([], Object.assign(getConfigBuildRequest(), { + fn: spec.buildRequests([], Object.assign(getConfigBuildRequest('banner'), { gdprConsent: { gdprApplies: true, consentString: 'XXXX' @@ -447,12 +498,12 @@ const testsBuildRequests = [ }, want: { method: 'GET', - url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest().bids[0].params.tagId}`, + url: `${BLIINK_ENDPOINT_ENGINE}/${getConfigBuildRequest('banner').bids[0].params.tagId}`, params: { - bidderRequestId: getConfigBuildRequest().bidderRequestId, - bidderCode: getConfigBuildRequest().bidderCode, - bids: getConfigBuildRequest().bids, - refererInfo: getConfigBuildRequest().refererInfo + bidderRequestId: getConfigBuildRequest('banner').bidderRequestId, + bidderCode: getConfigBuildRequest('banner').bidderCode, + bids: getConfigBuildRequest('banner').bids, + refererInfo: getConfigBuildRequest('banner').refererInfo }, data: { gdpr: true, From c514d20ffd06476b86b18c8af3d1ce7a2be243f5 Mon Sep 17 00:00:00 2001 From: jsfledd Date: Wed, 13 Oct 2021 04:02:46 -0700 Subject: [PATCH 178/250] Nativo Bid Adapter : refresh increment logic change (#7569) * Initial nativoBidAdapter document creation (js, md and spec) * Fulling working prebid using nativoBidAdapter. Support for GDPR and CCPA in user syncs. * Added defult size settings based on the largest ad unit. Added response body validation. Added consent to request url qs params. * Changed bidder endpoint url * Changed double quotes to single quotes. * Reverted package-json.lock to remove modifications from PR * Added optional bidder param 'url' so the ad server can force- match an existing placement * Lint fix. Added space after if. * Added new QS param to send various adUnit data to adapter endpopint * Updated unit test for new QS param * Added qs param to keep track of ad unit refreshes * Updated bidMap key default value * Updated refresh increment logic Co-authored-by: Joshua Fledderjohn --- modules/nativoBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index 8259c179675..9a0cd62258b 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -71,7 +71,7 @@ export const spec = { // Track if we've already requested for this ad unit code adUnitsRequested[adUnit.adUnitCode] = adUnitsRequested[adUnit.adUnitCode] !== undefined - ? adUnitsRequested[adUnit.adUnitCode]++ + ? adUnitsRequested[adUnit.adUnitCode] + 1 : 0 return { adUnitCode: adUnit.adUnitCode, From 719523b765fd652cbc346d30230ae5a4abe08c00 Mon Sep 17 00:00:00 2001 From: AdmixerTech <35560933+AdmixerTech@users.noreply.github.com> Date: Wed, 13 Oct 2021 17:13:27 +0300 Subject: [PATCH 179/250] add docReferrer (#7551) Co-authored-by: atkachov --- modules/admixerBidAdapter.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/admixerBidAdapter.js b/modules/admixerBidAdapter.js index e136dfcfbdb..bb91ddcdfc8 100644 --- a/modules/admixerBidAdapter.js +++ b/modules/admixerBidAdapter.js @@ -19,9 +19,20 @@ export const spec = { * Make a server request from the list of BidRequests. */ buildRequests: function (validRequest, bidderRequest) { + let w; + let docRef; + do { + w = w ? w.parent : window; + try { + docRef = w.document.referrer; + } catch (e) { + break; + } + } while (w !== window.top); const payload = { imps: [], ortb2: config.getConfig('ortb2'), + docReferrer: docRef, }; let endpointUrl; if (bidderRequest) { From b8a7ee4b979c0aee2a254a43c7f6ee22bc5f284f Mon Sep 17 00:00:00 2001 From: Adam Browning <19834421+adam-browning@users.noreply.github.com> Date: Wed, 13 Oct 2021 18:07:28 +0300 Subject: [PATCH 180/250] Yahoo SSP Bid Adapter: fix for adId (#7571) * Added ysspBidAdapter * Renaming to Yahoo SSP * changing all internal references from yssp to yahoossp * added alias for aol, onemobile, onedisplay * Removing aliases from adapter * Pass EU consent string in the correct location in the payload. * WIP * WIP * pubId support 1st draft * WIP * WIP * WIP pubId unit tests * WIP * WIP * pubid tests stable * pubId support * md update * site id inventory mapping fix * update to md file * update to md file * order userId list * added user id yahoo.com * placementId support * inventoryId & placementId stable unit tests * maintainer group update * maintainer group update * Redirecting to PubGW urls without .ads. * url switch fix * fetch specific utils * lint * change inventoryId to siteId * WIP * custom key-value pair support * WIP * WIP * WIP * WIP * WIP * WIP * updated FPD support * unit tests stable * unit tests stable * check includes * md file update * code review updates * WIP * WIP * code review comments * WIP * review comments implemented * update to md file * update to md file * update to md file * type fix * type fix * typo fix * readme structure * typo * yarn.lock removed * revert yarn.lock * SRA Mode adId fix * SRA adId patch v1.0.1 * SRA adId patch v1.0.1 Co-authored-by: slimkrazy Co-authored-by: Samuel Adu --- modules/yahoosspBidAdapter.js | 4 +-- test/spec/modules/yahoosspBidAdapter_spec.js | 29 +++++++++++++++++++- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js index 35fc2ba7b59..ac91596f8d0 100644 --- a/modules/yahoosspBidAdapter.js +++ b/modules/yahoosspBidAdapter.js @@ -6,7 +6,7 @@ import { Renderer } from '../src/Renderer.js'; const INTEGRATION_METHOD = 'prebid.js'; const BIDDER_CODE = 'yahoossp'; -const ADAPTER_VERSION = '1.0.0'; +const ADAPTER_VERSION = '1.0.1'; const PREBID_VERSION = '$prebid.version$'; const DEFAULT_BID_TTL = 300; const TEST_MODE_DCN = '8a969516017a7a396ec539d97f540011'; @@ -581,7 +581,7 @@ export const spec = { let cpm = (bid.ext && bid.ext.encp) ? bid.ext.encp : bid.price; let bidResponse = { - adId: bid.id, + adId: deepAccess(bid, 'adId') ? bid.adId : bid.impid || bid.crid, adUnitCode: bidderRequest.adUnitCode, requestId: bid.impid, bidderCode: spec.code, diff --git a/test/spec/modules/yahoosspBidAdapter_spec.js b/test/spec/modules/yahoosspBidAdapter_spec.js index 9c24ecedda1..5eb82b399cc 100644 --- a/test/spec/modules/yahoosspBidAdapter_spec.js +++ b/test/spec/modules/yahoosspBidAdapter_spec.js @@ -11,7 +11,7 @@ const DEFAULT_AD_UNIT_CODE = '/19968336/header-bid-tag-1'; const DEFAULT_AD_UNIT_TYPE = 'banner'; const DEFAULT_PARAMS_BID_OVERRIDE = {}; const DEFAULT_VIDEO_CONTEXT = 'instream'; -const ADAPTER_VERSION = '1.0.0'; +const ADAPTER_VERSION = '1.0.1'; const PREBID_VERSION = '$prebid.version$'; const INTEGRATION_METHOD = 'prebid.js'; @@ -1252,6 +1252,33 @@ describe('YahooSSP Bid Adapter:', () => { }) }); + describe('bid response Ad ID / Creative ID', () => { + it('should use adId if it exists in the bid-response', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + const adId = 'bid-response-adId'; + serverResponse.body.seatbid[0].bid[0].adId = adId; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].adId).to.equal(adId); + }); + + it('should use impid if adId does not exist in the bid-response', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + const impid = '25b6c429c1f52f'; + serverResponse.body.seatbid[0].bid[0].impid = impid; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].adId).to.equal(impid); + }); + + it('should use crid if adId & impid do not exist in the bid-response', () => { + const { serverResponse, bidderRequest } = generateResponseMock('banner'); + const crid = 'passback-12579'; + serverResponse.body.seatbid[0].bid[0].impid = undefined; + serverResponse.body.seatbid[0].bid[0].crid = crid; + const response = spec.interpretResponse(serverResponse, {bidderRequest}); + expect(response[0].adId).to.equal(crid); + }); + }); + describe('Time To Live (ttl)', () => { const UNSUPPORTED_TTL_FORMATS = ['string', [1, 2, 3], true, false, null, undefined]; UNSUPPORTED_TTL_FORMATS.forEach(param => { From e20c46fd6d20428b42fc395a3c7ae58e07b94657 Mon Sep 17 00:00:00 2001 From: Mehdi Bouallagui <45876988+mbouallagui@users.noreply.github.com> Date: Thu, 14 Oct 2021 15:03:01 +0200 Subject: [PATCH 181/250] adding page URL to bid request (#7581) --- modules/oguryBidAdapter.js | 3 ++- test/spec/modules/oguryBidAdapter_spec.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index c7a722b2003..dbef3ef7300 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -47,7 +47,8 @@ function buildRequests(validBidRequests, bidderRequest) { }, }, site: { - domain: location.hostname + domain: location.hostname, + page: location.href }, user: { ext: { diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index 51e586460bd..ecda1f681ce 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -260,6 +260,7 @@ describe('OguryBidAdapter', function () { site: { id: bidRequests[0].params.assetKey, domain: window.location.hostname, + page: window.location.href }, user: { ext: { From 8cb225050baf0193c8772f0699d1404b1e203273 Mon Sep 17 00:00:00 2001 From: Vitali Ioussoupov <84333122+pixfuture-media@users.noreply.github.com> Date: Thu, 14 Oct 2021 09:25:11 -0400 Subject: [PATCH 182/250] Pixfuture Bid Adapter: updated the getUserSyncs method (#7456) * Add files via upload * Add files via upload * Update pixfutureBidAdapter.md * Update pixfutureBidAdapter.md * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter_spec.js * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js Bug fixing: has been lost "pubext" parameter * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.md * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js Removing the trailing spaces in lines: 168 and 172 * Add files via upload * Update pixfutureBidAdapter.js removing trilling spaces in the lines: 168,172,178 * Update pixfutureBidAdapter.md * Update pixfutureBidAdapter.md * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js * Update pixfutureBidAdapter.js * Pixfuture Bid Adapter: updated the getUserSyncs method and changed utils import by separated methods instead whole utils updated the getUserSyncs method and changed utils import by separated methods instead whole utils * Fixed utls import Fixed utls import * Bugfixing remove non used fill import Bugfixing remove non used fill import * Update pixfutureBidAdapter.js * resolving conflicts * multiline fix Co-authored-by: polischukPix Co-authored-by: Alexandr --- modules/pixfutureBidAdapter.js | 28 ++++++-- modules/pixfutureBidAdapter.md | 127 +++++++++++++++++++++++++++++++++ 2 files changed, 151 insertions(+), 4 deletions(-) diff --git a/modules/pixfutureBidAdapter.js b/modules/pixfutureBidAdapter.js index 41e561a6f83..e9db875fc2f 100644 --- a/modules/pixfutureBidAdapter.js +++ b/modules/pixfutureBidAdapter.js @@ -1,9 +1,9 @@ -import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { getStorageManager } from '../src/storageManager.js'; import { BANNER } from '../src/mediaTypes.js'; import { config } from '../src/config.js'; import includes from 'core-js-pure/features/array/includes.js'; +import { convertCamelToUnderscore, isArray, isNumber, isPlainObject, deepAccess, isEmpty, transformBidderParamKeywords, isFn } from '../src/utils.js'; import { auctionManager } from '../src/auctionManager.js'; import find from 'core-js-pure/features/array/find.js'; @@ -12,7 +12,7 @@ const storageManager = getStorageManager(); const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language']; export const spec = { code: 'pixfuture', - hostname: 'https://prebid-js.pixfuture.com', + hostname: 'https://gosrv.pixfuture.com', getHostname() { let ret = this.hostname; @@ -77,7 +77,7 @@ export const spec = { }; if (bidderRequest && bidderRequest.uspConsent) { - payload.us_privacy = bidderRequest.uspConsent + payload.us_privacy = bidderRequest.uspConsent; } if (bidderRequest && bidderRequest.refererInfo) { @@ -112,7 +112,7 @@ export const spec = { } const ret = { - url: `${hostname}/`, + url: `${hostname}/pixservices`, method: 'POST', options: {withCredentials: false}, data: { @@ -153,6 +153,16 @@ export const spec = { return bids; }, + getUserSyncs: function (syncOptions, bid, gdprConsent) { + var pixid = ''; + if (typeof bid[0] === 'undefined' || bid[0] === null) { pixid = '0'; } else { pixid = bid[0].body.pix_id; } + if (syncOptions.iframeEnabled && hasPurpose1Consent({gdprConsent})) { + return [{ + type: 'iframe', + url: 'https://gosrv.pixfuture.com/cookiesync?adsync=' + gdprConsent.consentString + '&pixid=' + pixid + '&gdprconcent=' + gdprConsent.gdprApplies + }]; + } + } }; function newBid(serverBid, rtbBid, placementId, uuid) { @@ -179,6 +189,16 @@ function newBid(serverBid, rtbBid, placementId, uuid) { return bid; } +function hasPurpose1Consent(bidderRequest) { + let result = true; + if (bidderRequest && bidderRequest.gdprConsent) { + if (bidderRequest.gdprConsent.gdprApplies && bidderRequest.gdprConsent.apiVersion === 2) { + result = !!(deepAccess(bidderRequest.gdprConsent, 'vendorData.purpose.consents.1') === true); + } + } + return result; +} + // Functions related optional parameters function bidToTag(bid) { const tag = {}; diff --git a/modules/pixfutureBidAdapter.md b/modules/pixfutureBidAdapter.md index e5728ededc6..b7911d6c9bb 100644 --- a/modules/pixfutureBidAdapter.md +++ b/modules/pixfutureBidAdapter.md @@ -25,3 +25,130 @@ var adUnits = [{ "pix_id": "Abc123" }]; ``` + +# Test Example +... + + + + + + + + + + + +

Basic Prebid.js Example

+
Div-1
+
+ +
+ +
+ +
Div-2
+
+ +
+ + + + From 7b6aad6518e8cdeda4772ba5cada0416f1bf29ca Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Thu, 14 Oct 2021 09:53:24 -0700 Subject: [PATCH 183/250] delete rogue yarn.lock (#7572) --- yarn.lock | 13122 ---------------------------------------------------- 1 file changed, 13122 deletions(-) delete mode 100644 yarn.lock diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 2e081e121db..00000000000 --- a/yarn.lock +++ /dev/null @@ -1,13122 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.12.11": - version "7.12.11" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.12.11.tgz#f4ad435aa263db935b8f10f2c552d23fb716a63f" - integrity sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw== - dependencies: - "@babel/highlight" "^7.10.4" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.14.5.tgz#23b08d740e83f49c5e59945fbf1b43e80bbf4edb" - integrity sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw== - dependencies: - "@babel/highlight" "^7.14.5" - -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.15.0": - version "7.15.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.15.0.tgz#2dbaf8b85334796cafbb0f5793a90a2fc010b176" - integrity sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA== - -"@babel/core@7.12.3": - version "7.12.3" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.12.3.tgz#1b436884e1e3bff6fb1328dc02b208759de92ad8" - integrity sha512-0qXcZYKZp3/6N2jKYVxZv0aNCsxTSVCiK72DTiTYZAu7sjg73W0/aynWjMbiGd87EQL4WyA8reiJVh92AVla9g== - dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/generator" "^7.12.1" - "@babel/helper-module-transforms" "^7.12.1" - "@babel/helpers" "^7.12.1" - "@babel/parser" "^7.12.3" - "@babel/template" "^7.10.4" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.1" - json5 "^2.1.2" - lodash "^4.17.19" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/core@^7.7.5", "@babel/core@^7.8.4": - version "7.15.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.15.5.tgz#f8ed9ace730722544609f90c9bb49162dc3bf5b9" - integrity sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helpers" "^7.15.4" - "@babel/parser" "^7.15.5" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - source-map "^0.5.0" - -"@babel/generator@7.12.1": - version "7.12.1" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.12.1.tgz#0d70be32bdaa03d7c51c8597dda76e0df1f15468" - integrity sha512-DB+6rafIdc9o72Yc3/Ph5h+6hUjeOp66pF0naQBgUFFuPqzQwIlPTm3xZR7YNvduIMtkDIj2t21LSQwnbCrXvg== - dependencies: - "@babel/types" "^7.12.1" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.12.1", "@babel/generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.15.4.tgz#85acb159a267ca6324f9793986991ee2022a05b0" - integrity sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw== - dependencies: - "@babel/types" "^7.15.4" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/helper-annotate-as-pure@^7.14.5", "@babel/helper-annotate-as-pure@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz#3d0e43b00c5e49fdb6c57e421601a7a658d5f835" - integrity sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.14.5": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz#21ad815f609b84ee0e3058676c33cf6d1670525f" - integrity sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz#cf6d94f30fbefc139123e27dd6b02f65aeedb7b9" - integrity sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" - semver "^6.3.0" - -"@babel/helper-create-class-features-plugin@^7.14.5", "@babel/helper-create-class-features-plugin@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz#7f977c17bd12a5fba363cb19bea090394bf37d2e" - integrity sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - -"@babel/helper-create-regexp-features-plugin@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.5.tgz#c7d5ac5e9cf621c26057722fb7a8a4c5889358c4" - integrity sha512-TLawwqpOErY2HhWbGJ2nZT5wSkR192QpN+nBg1THfBfftrlvOh+WbhrxXCH4q4xJ9Gl16BGPR/48JA+Ryiho/A== - dependencies: - "@babel/helper-annotate-as-pure" "^7.14.5" - regexpu-core "^4.7.1" - -"@babel/helper-define-polyfill-provider@^0.2.2": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz#0525edec5094653a282688d34d846e4c75e9c0b6" - integrity sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew== - dependencies: - "@babel/helper-compilation-targets" "^7.13.0" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/traverse" "^7.13.0" - debug "^4.1.1" - lodash.debounce "^4.0.8" - resolve "^1.14.2" - semver "^6.1.2" - -"@babel/helper-explode-assignable-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz#f9aec9d219f271eaf92b9f561598ca6b2682600c" - integrity sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-function-name@^7.14.5", "@babel/helper-function-name@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz#845744dafc4381a4a5fb6afa6c3d36f98a787ebc" - integrity sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw== - dependencies: - "@babel/helper-get-function-arity" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-get-function-arity@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz#098818934a137fce78b536a3e015864be1e2879b" - integrity sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-hoist-variables@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz#09993a3259c0e918f99d104261dfdfc033f178df" - integrity sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-member-expression-to-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz#bfd34dc9bba9824a4658b0317ec2fd571a51e6ef" - integrity sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.14.5", "@babel/helper-module-imports@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz#e18007d230632dea19b47853b984476e7b4e103f" - integrity sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.14.5", "@babel/helper-module-transforms@^7.15.4": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.15.7.tgz#7da80c8cbc1f02655d83f8b79d25866afe50d226" - integrity sha512-ZNqjjQG/AuFfekFTY+7nY4RgBSklgTu970c7Rj3m/JOhIu5KPBUuTA9AY6zaKcUvk4g6EbDXdBnhi35FAssdSw== - dependencies: - "@babel/helper-module-imports" "^7.15.4" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-simple-access" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.6" - -"@babel/helper-optimise-call-expression@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz#f310a5121a3b9cc52d9ab19122bd729822dee171" - integrity sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-remap-async-to-generator@^7.14.5", "@babel/helper-remap-async-to-generator@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz#2637c0731e4c90fbf58ac58b50b2b5a192fc970f" - integrity sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-wrap-function" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-replace-supers@^7.14.5", "@babel/helper-replace-supers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz#52a8ab26ba918c7f6dee28628b07071ac7b7347a" - integrity sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helper-simple-access@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz#ac368905abf1de8e9781434b635d8f8674bcc13b" - integrity sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-skip-transparent-expression-wrappers@^7.14.5", "@babel/helper-skip-transparent-expression-wrappers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz#707dbdba1f4ad0fa34f9114fc8197aec7d5da2eb" - integrity sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-split-export-declaration@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz#aecab92dcdbef6a10aa3b62ab204b085f776e257" - integrity sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw== - dependencies: - "@babel/types" "^7.15.4" - -"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== - -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== - -"@babel/helper-wrap-function@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz#6f754b2446cfaf3d612523e6ab8d79c27c3a3de7" - integrity sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw== - dependencies: - "@babel/helper-function-name" "^7.15.4" - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/helpers@^7.12.1", "@babel/helpers@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.15.4.tgz#5f40f02050a3027121a3cf48d497c05c555eaf43" - integrity sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ== - dependencies: - "@babel/template" "^7.15.4" - "@babel/traverse" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/highlight@^7.10.4", "@babel/highlight@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.14.5.tgz#6861a52f03966405001f6aa534a01a24d99e8cd9" - integrity sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@7.12.3": - version "7.12.3" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.12.3.tgz#a305415ebe7a6c7023b40b5122a0662d928334cd" - integrity sha512-kFsOS0IbsuhO5ojF8Hc8z/8vEIOkylVBrjiZUbLTE3XFe0Qi+uu6HjzQixkFaqr0ZPAMZcBVxEwmsnsLPZ2Xsw== - -"@babel/parser@^7.10.5", "@babel/parser@^7.12.3", "@babel/parser@^7.15.0", "@babel/parser@^7.15.4", "@babel/parser@^7.15.5": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.7.tgz#0c3ed4a2eb07b165dfa85b3cc45c727334c4edae" - integrity sha512-rycZXvQ+xS9QyIcJ9HXeDWf1uxqlbVFAUq0Rq0dbc50Zb/+wUe/ehyfzGfm9KZZF0kBejYgxltBXocP+gKdL2g== - -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz#dbdeabb1e80f622d9f0b583efb2999605e0a567e" - integrity sha512-eBnpsl9tlhPhpI10kU06JHnrYXwg3+V6CaP2idsCXNef0aeslpqyITXQ74Vfk5uHgY7IG7XP0yIH8b42KSzHog== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.15.4" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - -"@babel/plugin-proposal-async-generator-functions@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.4.tgz#f82aabe96c135d2ceaa917feb9f5fca31635277e" - integrity sha512-2zt2g5vTXpMC3OmK6uyjvdXptbhBXfA77XGrd3gh93zwG8lZYBLOBImiGBEG0RANu3JqKEACCz5CGk73OJROBw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.15.4" - "@babel/plugin-syntax-async-generators" "^7.8.4" - -"@babel/plugin-proposal-class-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.14.5.tgz#40d1ee140c5b1e31a350f4f5eed945096559b42e" - integrity sha512-q/PLpv5Ko4dVc1LYMpCY7RVAAO4uk55qPwrIuJ5QJ8c6cVuAmhu7I/49JOppXL6gXf7ZHzpRVEUZdYoPLM04Gg== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-proposal-class-static-block@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.15.4.tgz#3e7ca6128453c089e8b477a99f970c63fc1cb8d7" - integrity sha512-M682XWrrLNk3chXCjoPUQWOyYsB93B9z3mRyjtqqYJWDf2mfCdIYgDrA11cgNVhAQieaq6F2fn2f3wI0U4aTjA== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - -"@babel/plugin-proposal-dynamic-import@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.14.5.tgz#0c6617df461c0c1f8fff3b47cd59772360101d2c" - integrity sha512-ExjiNYc3HDN5PXJx+bwC50GIx/KKanX2HiggnIUAYedbARdImiCU4RhhHfdf0Kd7JNXGpsBBBCOm+bBVy3Gb0g== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - -"@babel/plugin-proposal-export-namespace-from@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.14.5.tgz#dbad244310ce6ccd083072167d8cea83a52faf76" - integrity sha512-g5POA32bXPMmSBu5Dx/iZGLGnKmKPc5AiY7qfZgurzrCYgIztDlHFbznSNCoQuv57YQLnQfaDi7dxCtLDIdXdA== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - -"@babel/plugin-proposal-json-strings@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.14.5.tgz#38de60db362e83a3d8c944ac858ddf9f0c2239eb" - integrity sha512-NSq2fczJYKVRIsUJyNxrVUMhB27zb7N7pOFGQOhBKJrChbGcgEAqyZrmZswkPk18VMurEeJAaICbfm57vUeTbQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-json-strings" "^7.8.3" - -"@babel/plugin-proposal-logical-assignment-operators@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.14.5.tgz#6e6229c2a99b02ab2915f82571e0cc646a40c738" - integrity sha512-YGn2AvZAo9TwyhlLvCCWxD90Xq8xJ4aSgaX3G5D/8DW94L8aaT+dS5cSP+Z06+rCJERGSr9GxMBZ601xoc2taw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.14.5.tgz#ee38589ce00e2cc59b299ec3ea406fcd3a0fdaf6" - integrity sha512-gun/SOnMqjSb98Nkaq2rTKMwervfdAoz6NphdY0vTfuzMfryj+tDGb2n6UkDKwez+Y8PZDhE3D143v6Gepp4Hg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - -"@babel/plugin-proposal-numeric-separator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.14.5.tgz#83631bf33d9a51df184c2102a069ac0c58c05f18" - integrity sha512-yiclALKe0vyZRZE0pS6RXgjUOt87GWv6FYa5zqj15PvhOGFO69R5DusPlgK/1K5dVnCtegTiWu9UaBSrLLJJBg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - -"@babel/plugin-proposal-object-rest-spread@^7.15.6": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz#ef68050c8703d07b25af402cb96cf7f34a68ed11" - integrity sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.15.4" - -"@babel/plugin-proposal-optional-catch-binding@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.14.5.tgz#939dd6eddeff3a67fdf7b3f044b5347262598c3c" - integrity sha512-3Oyiixm0ur7bzO5ybNcZFlmVsygSIQgdOa7cTfOYCMY+wEPAYhZAJxi3mixKFCTCKUhQXuCTtQ1MzrpL3WT8ZQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - -"@babel/plugin-proposal-optional-chaining@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.14.5.tgz#fa83651e60a360e3f13797eef00b8d519695b603" - integrity sha512-ycz+VOzo2UbWNI1rQXxIuMOzrDdHGrI23fRiz/Si2R4kv2XZQ1BK8ccdHwehMKBlcH/joGW/tzrUmo67gbJHlQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - -"@babel/plugin-proposal-private-methods@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.14.5.tgz#37446495996b2945f30f5be5b60d5e2aa4f5792d" - integrity sha512-838DkdUA1u+QTCplatfq4B7+1lnDa/+QMI89x5WZHBcnNv+47N8QEj2k9I2MUU9xIv8XJ4XvPCviM/Dj7Uwt9g== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-proposal-private-property-in-object@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.15.4.tgz#55c5e3b4d0261fd44fe637e3f624cfb0f484e3e5" - integrity sha512-X0UTixkLf0PCCffxgu5/1RQyGGbgZuKoI+vXP4iSbJSYwPb7hu06omsFGBvQ9lJEvwgrxHdS8B5nbfcd8GyUNA== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-create-class-features-plugin" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - -"@babel/plugin-proposal-unicode-property-regex@^7.14.5", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.14.5.tgz#0f95ee0e757a5d647f378daa0eca7e93faa8bbe8" - integrity sha512-6axIeOU5LnY471KenAB9vI8I5j7NQ2d652hIYwVyRfgaZT5UpiqFKCuVXCDMSrU+3VFafnu2c5m3lrWIlr6A5Q== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.12.13": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-class-static-block@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" - integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-dynamic-import@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" - integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-export-namespace-from@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" - integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.3" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.10.4": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-private-property-in-object@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" - integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-top-level-await@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-arrow-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.14.5.tgz#f7187d9588a768dd080bf4c9ffe117ea62f7862a" - integrity sha512-KOnO0l4+tD5IfOdi4x8C1XmEIRWUjNRV8wc6K2vz/3e8yAOoZZvsRXRRIF/yo/MAOFb4QjtAw9xSxMXbSMRy8A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-async-to-generator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.14.5.tgz#72c789084d8f2094acb945633943ef8443d39e67" - integrity sha512-szkbzQ0mNk0rpu76fzDdqSyPu0MuvpXgC+6rz5rpMb5OIRxdmHfQxrktL8CYolL2d8luMCZTR0DpIMIdL27IjA== - dependencies: - "@babel/helper-module-imports" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.14.5" - -"@babel/plugin-transform-block-scoped-functions@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.14.5.tgz#e48641d999d4bc157a67ef336aeb54bc44fd3ad4" - integrity sha512-dtqWqdWZ5NqBX3KzsVCWfQI3A53Ft5pWFCT2eCVUftWZgjc5DpDponbIF1+c+7cSGk2wN0YK7HGL/ezfRbpKBQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-block-scoping@^7.15.3": - version "7.15.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz#94c81a6e2fc230bcce6ef537ac96a1e4d2b3afaf" - integrity sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-classes@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz#50aee17aaf7f332ae44e3bce4c2e10534d5d3bf1" - integrity sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-optimise-call-expression" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.14.5.tgz#1b9d78987420d11223d41195461cc43b974b204f" - integrity sha512-pWM+E4283UxaVzLb8UBXv4EIxMovU4zxT1OPnpHJcmnvyY9QbPPTKZfEj31EUvG3/EQRbYAGaYEUZ4yWOBC2xg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-destructuring@^7.14.7": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.7.tgz#0ad58ed37e23e22084d109f185260835e5557576" - integrity sha512-0mDE99nK+kVh3xlc5vKwB6wnP9ecuSj+zQCa/n0voENtP/zymdT4HH6QEb65wjjcbqr1Jb/7z9Qp7TF5FtwYGw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-dotall-regex@^7.14.5", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.14.5.tgz#2f6bf76e46bdf8043b4e7e16cf24532629ba0c7a" - integrity sha512-loGlnBdj02MDsFaHhAIJzh7euK89lBrGIdM9EAtHFo6xKygCUGuuWe07o1oZVk287amtW1n0808sQM99aZt3gw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-duplicate-keys@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.14.5.tgz#365a4844881bdf1501e3a9f0270e7f0f91177954" - integrity sha512-iJjbI53huKbPDAsJ8EmVmvCKeeq21bAze4fu9GBQtSLqfvzj2oRuHVx4ZkDwEhg1htQ+5OBZh/Ab0XDf5iBZ7A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-exponentiation-operator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.14.5.tgz#5154b8dd6a3dfe6d90923d61724bd3deeb90b493" - integrity sha512-jFazJhMBc9D27o9jDnIE5ZErI0R0m7PbKXVq77FFvqFbzvTMuv8jaAwLZ5PviOLSFttqKIW0/wxNSDbjLk0tYA== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-for-of@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz#25c62cce2718cfb29715f416e75d5263fb36a8c2" - integrity sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-function-name@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.14.5.tgz#e81c65ecb900746d7f31802f6bed1f52d915d6f2" - integrity sha512-vbO6kv0fIzZ1GpmGQuvbwwm+O4Cbm2NrPzwlup9+/3fdkuzo1YqOZcXw26+YUJB84Ja7j9yURWposEHLYwxUfQ== - dependencies: - "@babel/helper-function-name" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.14.5.tgz#41d06c7ff5d4d09e3cf4587bd3ecf3930c730f78" - integrity sha512-ql33+epql2F49bi8aHXxvLURHkxJbSmMKl9J5yHqg4PLtdE6Uc48CH1GS6TQvZ86eoB/ApZXwm7jlA+B3kra7A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-member-expression-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.14.5.tgz#b39cd5212a2bf235a617d320ec2b48bcc091b8a7" - integrity sha512-WkNXxH1VXVTKarWFqmso83xl+2V3Eo28YY5utIkbsmXoItO8Q3aZxN4BTS2k0hz9dGUloHK26mJMyQEYfkn/+Q== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-modules-amd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.14.5.tgz#4fd9ce7e3411cb8b83848480b7041d83004858f7" - integrity sha512-3lpOU8Vxmp3roC4vzFpSdEpGUWSMsHFreTWOMMLzel2gNGfHE5UWIh/LN6ghHs2xurUp4jRFYMUIZhuFbody1g== - dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - babel-plugin-dynamic-import-node "^2.3.3" - -"@babel/plugin-transform-modules-commonjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz#8201101240eabb5a76c08ef61b2954f767b6b4c1" - integrity sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA== - dependencies: - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.15.4" - babel-plugin-dynamic-import-node "^2.3.3" - -"@babel/plugin-transform-modules-systemjs@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz#b42890c7349a78c827719f1d2d0cd38c7d268132" - integrity sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw== - dependencies: - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-module-transforms" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.14.9" - babel-plugin-dynamic-import-node "^2.3.3" - -"@babel/plugin-transform-modules-umd@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.14.5.tgz#fb662dfee697cce274a7cda525190a79096aa6e0" - integrity sha512-RfPGoagSngC06LsGUYyM9QWSXZ8MysEjDJTAea1lqRjNECE3y0qIJF/qbvJxc4oA4s99HumIMdXOrd+TdKaAAA== - dependencies: - "@babel/helper-module-transforms" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.14.9": - version "7.14.9" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz#c68f5c5d12d2ebaba3762e57c2c4f6347a46e7b2" - integrity sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - -"@babel/plugin-transform-new-target@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.14.5.tgz#31bdae8b925dc84076ebfcd2a9940143aed7dbf8" - integrity sha512-Nx054zovz6IIRWEB49RDRuXGI4Gy0GMgqG0cII9L3MxqgXz/+rgII+RU58qpo4g7tNEx1jG7rRVH4ihZoP4esQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-object-super@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.14.5.tgz#d0b5faeac9e98597a161a9cf78c527ed934cdc45" - integrity sha512-MKfOBWzK0pZIrav9z/hkRqIk/2bTv9qvxHzPQc12RcVkMOzpIKnFCNYJip00ssKWYkd8Sf5g0Wr7pqJ+cmtuFg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.14.5" - -"@babel/plugin-transform-parameters@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz#5f2285cc3160bf48c8502432716b48504d29ed62" - integrity sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-property-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.14.5.tgz#0ddbaa1f83db3606f1cdf4846fa1dfb473458b34" - integrity sha512-r1uilDthkgXW8Z1vJz2dKYLV1tuw2xsbrp3MrZmD99Wh9vsfKoob+JTgri5VUb/JqyKRXotlOtwgu4stIYCmnw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-regenerator@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.14.5.tgz#9676fd5707ed28f522727c5b3c0aa8544440b04f" - integrity sha512-NVIY1W3ITDP5xQl50NgTKlZ0GrotKtLna08/uGY6ErQt6VEQZXla86x/CTddm5gZdcr+5GSsvMeTmWA5Ii6pkg== - dependencies: - regenerator-transform "^0.14.2" - -"@babel/plugin-transform-reserved-words@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.14.5.tgz#c44589b661cfdbef8d4300dcc7469dffa92f8304" - integrity sha512-cv4F2rv1nD4qdexOGsRQXJrOcyb5CrgjUH9PKrrtyhSDBNWGxd0UIitjyJiWagS+EbUGjG++22mGH1Pub8D6Vg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-shorthand-properties@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.14.5.tgz#97f13855f1409338d8cadcbaca670ad79e091a58" - integrity sha512-xLucks6T1VmGsTB+GWK5Pl9Jl5+nRXD1uoFdA5TSO6xtiNjtXTjKkmPdFXVLGlK5A2/or/wQMKfmQ2Y0XJfn5g== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-spread@^7.14.6": - version "7.14.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.14.6.tgz#6bd40e57fe7de94aa904851963b5616652f73144" - integrity sha512-Zr0x0YroFJku7n7+/HH3A2eIrGMjbmAIbJSVv0IZ+t3U2WUQUA64S/oeied2e+MaGSjmt4alzBCsK9E8gh+fag== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-skip-transparent-expression-wrappers" "^7.14.5" - -"@babel/plugin-transform-sticky-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.14.5.tgz#5b617542675e8b7761294381f3c28c633f40aeb9" - integrity sha512-Z7F7GyvEMzIIbwnziAZmnSNpdijdr4dWt+FJNBnBLz5mwDFkqIXU9wmBcWWad3QeJF5hMTkRe4dAq2sUZiG+8A== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-template-literals@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.14.5.tgz#a5f2bc233937d8453885dc736bdd8d9ffabf3d93" - integrity sha512-22btZeURqiepOfuy/VkFr+zStqlujWaarpMErvay7goJS6BWwdd6BY9zQyDLDa4x2S3VugxFb162IZ4m/S/+Gg== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-typeof-symbol@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.14.5.tgz#39af2739e989a2bd291bf6b53f16981423d457d4" - integrity sha512-lXzLD30ffCWseTbMQzrvDWqljvZlHkXU+CnseMhkMNqU1sASnCsz3tSzAaH3vCUXb9PHeUb90ZT1BdFTm1xxJw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-unicode-escapes@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.14.5.tgz#9d4bd2a681e3c5d7acf4f57fa9e51175d91d0c6b" - integrity sha512-crTo4jATEOjxj7bt9lbYXcBAM3LZaUrbP2uUdxb6WIorLmjNKSpHfIybgY4B8SRpbf8tEVIWH3Vtm7ayCrKocA== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-transform-unicode-regex@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.14.5.tgz#4cd09b6c8425dd81255c7ceb3fb1836e7414382e" - integrity sha512-UygduJpC5kHeCiRw/xDVzC+wj8VaYSoKl5JNVmbP7MadpNinAm3SvZCxZ42H37KZBKztz46YC73i9yV34d0Tzw== - dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.14.5" - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/preset-env@^7.8.4": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.15.6.tgz#0f3898db9d63d320f21b17380d8462779de57659" - integrity sha512-L+6jcGn7EWu7zqaO2uoTDjjMBW+88FXzV8KvrBl2z6MtRNxlsmUNRlZPaNNPUTgqhyC5DHNFk/2Jmra+ublZWw== - dependencies: - "@babel/compat-data" "^7.15.0" - "@babel/helper-compilation-targets" "^7.15.4" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.15.4" - "@babel/plugin-proposal-async-generator-functions" "^7.15.4" - "@babel/plugin-proposal-class-properties" "^7.14.5" - "@babel/plugin-proposal-class-static-block" "^7.15.4" - "@babel/plugin-proposal-dynamic-import" "^7.14.5" - "@babel/plugin-proposal-export-namespace-from" "^7.14.5" - "@babel/plugin-proposal-json-strings" "^7.14.5" - "@babel/plugin-proposal-logical-assignment-operators" "^7.14.5" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.14.5" - "@babel/plugin-proposal-numeric-separator" "^7.14.5" - "@babel/plugin-proposal-object-rest-spread" "^7.15.6" - "@babel/plugin-proposal-optional-catch-binding" "^7.14.5" - "@babel/plugin-proposal-optional-chaining" "^7.14.5" - "@babel/plugin-proposal-private-methods" "^7.14.5" - "@babel/plugin-proposal-private-property-in-object" "^7.15.4" - "@babel/plugin-proposal-unicode-property-regex" "^7.14.5" - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-class-properties" "^7.12.13" - "@babel/plugin-syntax-class-static-block" "^7.14.5" - "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.10.4" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-private-property-in-object" "^7.14.5" - "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.14.5" - "@babel/plugin-transform-async-to-generator" "^7.14.5" - "@babel/plugin-transform-block-scoped-functions" "^7.14.5" - "@babel/plugin-transform-block-scoping" "^7.15.3" - "@babel/plugin-transform-classes" "^7.15.4" - "@babel/plugin-transform-computed-properties" "^7.14.5" - "@babel/plugin-transform-destructuring" "^7.14.7" - "@babel/plugin-transform-dotall-regex" "^7.14.5" - "@babel/plugin-transform-duplicate-keys" "^7.14.5" - "@babel/plugin-transform-exponentiation-operator" "^7.14.5" - "@babel/plugin-transform-for-of" "^7.15.4" - "@babel/plugin-transform-function-name" "^7.14.5" - "@babel/plugin-transform-literals" "^7.14.5" - "@babel/plugin-transform-member-expression-literals" "^7.14.5" - "@babel/plugin-transform-modules-amd" "^7.14.5" - "@babel/plugin-transform-modules-commonjs" "^7.15.4" - "@babel/plugin-transform-modules-systemjs" "^7.15.4" - "@babel/plugin-transform-modules-umd" "^7.14.5" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.14.9" - "@babel/plugin-transform-new-target" "^7.14.5" - "@babel/plugin-transform-object-super" "^7.14.5" - "@babel/plugin-transform-parameters" "^7.15.4" - "@babel/plugin-transform-property-literals" "^7.14.5" - "@babel/plugin-transform-regenerator" "^7.14.5" - "@babel/plugin-transform-reserved-words" "^7.14.5" - "@babel/plugin-transform-shorthand-properties" "^7.14.5" - "@babel/plugin-transform-spread" "^7.14.6" - "@babel/plugin-transform-sticky-regex" "^7.14.5" - "@babel/plugin-transform-template-literals" "^7.14.5" - "@babel/plugin-transform-typeof-symbol" "^7.14.5" - "@babel/plugin-transform-unicode-escapes" "^7.14.5" - "@babel/plugin-transform-unicode-regex" "^7.14.5" - "@babel/preset-modules" "^0.1.4" - "@babel/types" "^7.15.6" - babel-plugin-polyfill-corejs2 "^0.2.2" - babel-plugin-polyfill-corejs3 "^0.2.2" - babel-plugin-polyfill-regenerator "^0.2.2" - core-js-compat "^3.16.0" - semver "^6.3.0" - -"@babel/preset-modules@^0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.4.tgz#362f2b68c662842970fdb5e254ffc8fc1c2e415e" - integrity sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/types" "^7.4.4" - esutils "^2.0.2" - -"@babel/runtime-corejs3@^7.10.2": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.15.4.tgz#403139af262b9a6e8f9ba04a6fdcebf8de692bf1" - integrity sha512-lWcAqKeB624/twtTc3w6w/2o9RqJPaNBhPGK6DKLSiwuVWC7WFkypWyNg+CpZoyJH0jVzv1uMtXZ/5/lQOLtCg== - dependencies: - core-js-pure "^3.16.0" - regenerator-runtime "^0.13.4" - -"@babel/runtime@^7.10.2", "@babel/runtime@^7.8.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" - integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== - dependencies: - regenerator-runtime "^0.13.4" - -"@babel/template@^7.10.4", "@babel/template@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.15.4.tgz#51898d35dcf3faa670c4ee6afcfd517ee139f194" - integrity sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - -"@babel/traverse@^7.10.5", "@babel/traverse@^7.12.1", "@babel/traverse@^7.13.0", "@babel/traverse@^7.15.4": - version "7.15.4" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.15.4.tgz#ff8510367a144bfbff552d9e18e28f3e2889c22d" - integrity sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA== - dependencies: - "@babel/code-frame" "^7.14.5" - "@babel/generator" "^7.15.4" - "@babel/helper-function-name" "^7.15.4" - "@babel/helper-hoist-variables" "^7.15.4" - "@babel/helper-split-export-declaration" "^7.15.4" - "@babel/parser" "^7.15.4" - "@babel/types" "^7.15.4" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.12.1", "@babel/types@^7.15.4", "@babel/types@^7.15.6", "@babel/types@^7.4.4": - version "7.15.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f" - integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig== - dependencies: - "@babel/helper-validator-identifier" "^7.14.9" - to-fast-properties "^2.0.0" - -"@eslint/eslintrc@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" - integrity sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw== - dependencies: - ajv "^6.12.4" - debug "^4.1.1" - espree "^7.3.0" - globals "^13.9.0" - ignore "^4.0.6" - import-fresh "^3.2.1" - js-yaml "^3.13.1" - minimatch "^3.0.4" - strip-json-comments "^3.1.1" - -"@gulp-sourcemaps/identity-map@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/identity-map/-/identity-map-2.0.1.tgz#a6e8b1abec8f790ec6be2b8c500e6e68037c0019" - integrity sha512-Tb+nSISZku+eQ4X1lAkevcQa+jknn/OVUgZ3XCxEKIsLsqYuPoJwJOPQeaOk75X3WPftb29GWY1eqE7GLsXb1Q== - dependencies: - acorn "^6.4.1" - normalize-path "^3.0.0" - postcss "^7.0.16" - source-map "^0.6.0" - through2 "^3.0.1" - -"@gulp-sourcemaps/map-sources@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz#890ae7c5d8c877f6d384860215ace9d7ec945bda" - integrity sha1-iQrnxdjId/bThIYCFazp1+yUW9o= - dependencies: - normalize-path "^2.0.1" - through2 "^2.0.3" - -"@humanwhocodes/config-array@^0.5.0": - version "0.5.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" - integrity sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg== - dependencies: - "@humanwhocodes/object-schema" "^1.2.0" - debug "^4.1.1" - minimatch "^3.0.4" - -"@humanwhocodes/object-schema@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz#87de7af9c231826fdd68ac7258f77c429e0e5fcf" - integrity sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w== - -"@hutson/parse-repository-url@^3.0.0": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" - integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/types@^27.2.4": - version "27.2.4" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.2.4.tgz#2430042a66e00dc5b140c3636f4474d464c21ee8" - integrity sha512-IDO2ezTxeMvQAHxzG/ZvEyA47q0aVfzT95rGFl7bZs/Go0aIucvfDbS2rmnoEdXxlLQhcolmoG/wvL/uKx4tKA== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - -"@jsdevtools/coverage-istanbul-loader@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jsdevtools/coverage-istanbul-loader/-/coverage-istanbul-loader-3.0.5.tgz#2a4bc65d0271df8d4435982db4af35d81754ee26" - integrity sha512-EUCPEkaRPvmHjWAAZkWMT7JDzpw7FKB00WTISaiXsbNOd5hCHg77XLA8sLYLFDo1zepYLo2w7GstN8YBqRXZfA== - dependencies: - convert-source-map "^1.7.0" - istanbul-lib-instrument "^4.0.3" - loader-utils "^2.0.0" - merge-source-map "^1.1.0" - schema-utils "^2.7.0" - -"@sindresorhus/is@^4.0.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.2.0.tgz#667bfc6186ae7c9e0b45a08960c551437176e1ca" - integrity sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw== - -"@sinonjs/commons@^1", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.7.0": - version "1.8.3" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.3.tgz#3802ddd21a50a949b6721ddd72da36e67e7f1b2d" - integrity sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ== - dependencies: - type-detect "4.0.8" - -"@sinonjs/formatio@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2" - integrity sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg== - dependencies: - samsam "1.3.0" - -"@sinonjs/formatio@^3.2.1": - version "3.2.2" - resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.2.2.tgz#771c60dfa75ea7f2d68e3b94c7e888a78781372c" - integrity sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ== - dependencies: - "@sinonjs/commons" "^1" - "@sinonjs/samsam" "^3.1.0" - -"@sinonjs/samsam@^3.1.0": - version "3.3.3" - resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.3.tgz#46682efd9967b259b81136b9f120fd54585feb4a" - integrity sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ== - dependencies: - "@sinonjs/commons" "^1.3.0" - array-from "^2.1.1" - lodash "^4.17.15" - -"@sinonjs/text-encoding@^0.7.1": - version "0.7.1" - resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5" - integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ== - -"@szmarczak/http-timer@^4.0.5": - version "4.0.6" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" - integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== - dependencies: - defer-to-connect "^2.0.0" - -"@types/aria-query@^4.2.1": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" - integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== - -"@types/cacheable-request@^6.0.1": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.2.tgz#c324da0197de0a98a2312156536ae262429ff6b9" - integrity sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "*" - "@types/node" "*" - "@types/responselike" "*" - -"@types/component-emitter@^1.2.10": - version "1.2.10" - resolved "https://registry.yarnpkg.com/@types/component-emitter/-/component-emitter-1.2.10.tgz#ef5b1589b9f16544642e473db5ea5639107ef3ea" - integrity sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg== - -"@types/cookie@^0.4.0": - version "0.4.1" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.4.1.tgz#bfd02c1f2224567676c1545199f87c3a861d878d" - integrity sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q== - -"@types/cors@^2.8.8": - version "2.8.12" - resolved "https://registry.yarnpkg.com/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080" - integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw== - -"@types/diff@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@types/diff/-/diff-5.0.1.tgz#9c9b9a331d4e41ccccff553f5d7ef964c6cf4042" - integrity sha512-XIpxU6Qdvp1ZE6Kr3yrkv1qgUab0fyf4mHYvW8N3Bx3PCsbN6or1q9/q72cv5jIFWolaGH08U9XyYoLLIykyKQ== - -"@types/easy-table@^0.0.33": - version "0.0.33" - resolved "https://registry.yarnpkg.com/@types/easy-table/-/easy-table-0.0.33.tgz#b1f7ec29014ec24906b4f28d8368e2e99b399313" - integrity sha512-/vvqcJPmZUfQwCgemL0/34G7bIQnCuvgls379ygRlcC1FqNqk3n+VZ15dAO51yl6JNDoWd8vsk+kT8zfZ1VZSw== - -"@types/ejs@^3.0.5": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@types/ejs/-/ejs-3.1.0.tgz#ab8109208106b5e764e5a6c92b2ba1c625b73020" - integrity sha512-DCg+Ka+uDQ31lJ/UtEXVlaeV3d6t81gifaVWKJy4MYVVgvJttyX/viREy+If7fz+tK/gVxTGMtyrFPnm4gjrVA== - -"@types/expect@^1.20.4": - version "1.20.4" - resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" - integrity sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg== - -"@types/fibers@^3.1.0": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@types/fibers/-/fibers-3.1.1.tgz#b714d357eebf6aec0bc5d70512e573b89bc84f20" - integrity sha512-yHoUi46uika0snoTpNcVqUSvgbRndaIps4TUCotrXjtc0DHDoPQckmyXEZ2bX3e4mpJmyEW3hRhCwQa/ISCPaA== - -"@types/fs-extra@^9.0.4": - version "9.0.13" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-9.0.13.tgz#7594fbae04fe7f1918ce8b3d213f74ff44ac1f45" - integrity sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA== - dependencies: - "@types/node" "*" - -"@types/http-cache-semantics@*": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" - integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== - -"@types/inquirer@^8.1.2": - version "8.1.3" - resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.1.3.tgz#dfda4c97cdbe304e4dceb378a80f79448ea5c8fe" - integrity sha512-AayK4ZL5ssPzR1OtnOLGAwpT0Dda3Xi/h1G0l1oJDNrowp7T1423q4Zb8/emr7tzRlCy4ssEri0LWVexAqHyKQ== - dependencies: - "@types/through" "*" - rxjs "^7.2.0" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/json-schema@^7.0.5": - version "7.0.9" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@types/json5@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" - integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= - -"@types/keyv@*": - version "3.1.3" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.3.tgz#1c9aae32872ec1f20dcdaee89a9f3ba88f465e41" - integrity sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg== - dependencies: - "@types/node" "*" - -"@types/lodash.flattendeep@^4.4.6": - version "4.4.6" - resolved "https://registry.yarnpkg.com/@types/lodash.flattendeep/-/lodash.flattendeep-4.4.6.tgz#2686d9161ae6c3d56d6745fa118308d88562ae53" - integrity sha512-uLm2MaRVlqJSGsMK0RZpP5T3KqReq+9WbYDHCUhBhp98v56hMG/Yht52bsoTSui9xz2mUvQ9NfG3LrNGDL92Ng== - dependencies: - "@types/lodash" "*" - -"@types/lodash.pickby@^4.6.6": - version "4.6.6" - resolved "https://registry.yarnpkg.com/@types/lodash.pickby/-/lodash.pickby-4.6.6.tgz#3dc39c2b38432f7a0c5e5627b0d5c0e3878b4f35" - integrity sha512-NFa13XxlMd9eFi0UFZFWIztpMpXhozbijrx3Yb1viYZphT7jyopIFVoIRF4eYMjruWNEG1rnyrRmg/8ej9T8Iw== - dependencies: - "@types/lodash" "*" - -"@types/lodash.union@^4.6.6": - version "4.6.6" - resolved "https://registry.yarnpkg.com/@types/lodash.union/-/lodash.union-4.6.6.tgz#2f77f2088326ed147819e9e384182b99aae8d4b0" - integrity sha512-Wu0ZEVNcyCz8eAn6TlUbYWZoGbH9E+iOHxAZbwUoCEXdUiy6qpcz5o44mMXViM4vlPLLCPlkAubEP1gokoSZaw== - dependencies: - "@types/lodash" "*" - -"@types/lodash@*": - version "4.14.175" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.175.tgz#b78dfa959192b01fae0ad90e166478769b215f45" - integrity sha512-XmdEOrKQ8a1Y/yxQFOMbC47G/V2VDO1GvMRnl4O75M4GW/abC5tnfzadQYkqEveqRM1dEJGFFegfPNA2vvx2iw== - -"@types/mdast@^3.0.0", "@types/mdast@^3.0.3": - version "3.0.10" - resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af" - integrity sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA== - dependencies: - "@types/unist" "*" - -"@types/minimist@^1.2.0": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== - -"@types/mocha@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.0.0.tgz#3205bcd15ada9bc681ac20bef64e9e6df88fd297" - integrity sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA== - -"@types/node@*", "@types/node@>=10.0.0": - version "16.10.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.10.2.tgz#5764ca9aa94470adb4e1185fe2e9f19458992b2e" - integrity sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ== - -"@types/node@^14.14.41": - version "14.17.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.20.tgz#74cc80438fd0467dc4377ee5bbad89a886df3c10" - integrity sha512-gI5Sl30tmhXsqkNvopFydP7ASc4c2cLfGNQrVKN3X90ADFWFsPEsotm/8JHSUJQKTHbwowAHtcJPeyVhtKv0TQ== - -"@types/node@^15.12.5": - version "15.14.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa" - integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A== - -"@types/normalize-package-data@^2.4.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz#d3357479a0fdfdd5907fe67e17e0a85c906e1301" - integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== - -"@types/object-inspect@^1.8.0": - version "1.8.1" - resolved "https://registry.yarnpkg.com/@types/object-inspect/-/object-inspect-1.8.1.tgz#7c08197ad05cc0e513f529b1f3919cc99f720e1f" - integrity sha512-0JTdf3CGV0oWzE6Wa40Ayv2e2GhpP3pEJMcrlM74vBSJPuuNkVwfDnl0SZxyFCXETcB4oKA/MpTVfuYSMOelBg== - -"@types/puppeteer@^5.4.0": - version "5.4.4" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-5.4.4.tgz#e92abeccc4f46207c3e1b38934a1246be080ccd0" - integrity sha512-3Nau+qi69CN55VwZb0ATtdUAlYlqOOQ3OfQfq0Hqgc4JMFXiQT/XInlwQ9g6LbicDslE6loIFsXFklGh5XmI6Q== - dependencies: - "@types/node" "*" - -"@types/recursive-readdir@^2.2.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@types/recursive-readdir/-/recursive-readdir-2.2.0.tgz#b39cd5474fd58ea727fe434d5c68b7a20ba9121c" - integrity sha512-HGk753KRu2N4mWduovY4BLjYq4jTOL29gV2OfGdGxHcPSWGFkC5RRIdk+VTs5XmYd7MVAD+JwKrcb5+5Y7FOCg== - dependencies: - "@types/node" "*" - -"@types/responselike@*", "@types/responselike@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== - -"@types/stream-buffers@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/stream-buffers/-/stream-buffers-3.0.4.tgz#bf128182da7bc62722ca0ddf5458a9c65f76e648" - integrity sha512-qU/K1tb2yUdhXkLIATzsIPwbtX6BpZk0l3dPW6xqWyhfzzM1ECaQ/8faEnu3CNraLiQ9LHyQQPBGp7N9Fbs25w== - dependencies: - "@types/node" "*" - -"@types/supports-color@^8.1.0": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/supports-color/-/supports-color-8.1.1.tgz#1b44b1b096479273adf7f93c75fc4ecc40a61ee4" - integrity sha512-dPWnWsf+kzIG140B8z2w3fr5D03TLWbOAFQl45xUpI3vcizeXriNR5VYkWZ+WTMsUHqZ9Xlt3hrxGNANFyNQfw== - -"@types/through@*": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/through/-/through-0.0.30.tgz#e0e42ce77e897bd6aead6f6ea62aeb135b8a3895" - integrity sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg== - dependencies: - "@types/node" "*" - -"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" - integrity sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ== - -"@types/vinyl@^2.0.4": - version "2.0.6" - resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.6.tgz#b2d134603557a7c3d2b5d3dc23863ea2b5eb29b0" - integrity sha512-ayJ0iOCDNHnKpKTgBG6Q6JOnHTj9zFta+3j2b8Ejza0e4cvRyMn0ZoLEmbPrTHe5YYRlDYPvPWVdV4cTaRyH7g== - dependencies: - "@types/expect" "^1.20.4" - "@types/node" "*" - -"@types/which@^1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.2.tgz#9c246fc0c93ded311c8512df2891fb41f6227fdf" - integrity sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA== - -"@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== - -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - -"@types/yauzl@^2.9.1": - version "2.9.2" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" - integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== - dependencies: - "@types/node" "*" - -"@ungap/promise-all-settled@1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" - integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== - -"@vue/compiler-core@3.2.19": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.19.tgz#b537dd377ce51fdb64e9b30ebfbff7cd70a64cb9" - integrity sha512-8dOPX0YOtaXol0Zf2cfLQ4NU/yHYl2H7DCKsLEZ7gdvPK6ZSEwGLJ7IdghhY2YEshEpC5RB9QKdC5I07z8Dtjg== - dependencies: - "@babel/parser" "^7.15.0" - "@vue/shared" "3.2.19" - estree-walker "^2.0.2" - source-map "^0.6.1" - -"@vue/compiler-dom@3.2.19": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.19.tgz#0607bc90de6af55fde73b09b3c4d0bf8cb597ed8" - integrity sha512-WzQoE8rfkFjPtIioc7SSgTsnz9g2oG61DU8KHnzPrRS7fW/lji6H2uCYJfp4Z6kZE8GjnHc1Ljwl3/gxDes0cw== - dependencies: - "@vue/compiler-core" "3.2.19" - "@vue/shared" "3.2.19" - -"@vue/compiler-sfc@^3.0.11": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.19.tgz#d412195a98ebd49b84602f171719294a1d9549be" - integrity sha512-pLlbgkO1UHTO02MSpa/sFOXUwIDxSMiKZ1ozE5n71CY4DM+YmI+G3gT/ZHZ46WBId7f3VTF/D8pGwMygcQbrQA== - dependencies: - "@babel/parser" "^7.15.0" - "@vue/compiler-core" "3.2.19" - "@vue/compiler-dom" "3.2.19" - "@vue/compiler-ssr" "3.2.19" - "@vue/ref-transform" "3.2.19" - "@vue/shared" "3.2.19" - estree-walker "^2.0.2" - magic-string "^0.25.7" - postcss "^8.1.10" - source-map "^0.6.1" - -"@vue/compiler-ssr@3.2.19": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.19.tgz#3e91ecf70f8f961c5f63eacd2139bcdab9a7a07c" - integrity sha512-oLon0Cn3O7WEYzzmzZavGoqXH+199LT+smdjBT3Uf3UX4HwDNuBFCmvL0TsqV9SQnIgKvBRbQ7lhbpnd4lqM3w== - dependencies: - "@vue/compiler-dom" "3.2.19" - "@vue/shared" "3.2.19" - -"@vue/ref-transform@3.2.19": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/ref-transform/-/ref-transform-3.2.19.tgz#cf0f986486bb26838fbd09749e927bab19745600" - integrity sha512-03wwUnoIAeKti5IGGx6Vk/HEBJ+zUcm5wrUM3+PQsGf7IYnXTbeIfHHpx4HeSeWhnLAjqZjADQwW8uA4rBmVbg== - dependencies: - "@babel/parser" "^7.15.0" - "@vue/compiler-core" "3.2.19" - "@vue/shared" "3.2.19" - estree-walker "^2.0.2" - magic-string "^0.25.7" - -"@vue/shared@3.2.19": - version "3.2.19" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.19.tgz#111ec3da18337d86274446984c49925b1b2b2dd7" - integrity sha512-Knqhx7WieLdVgwCAZgTVrDCXZ50uItuecLh9JdLC8O+a5ayaSyIQYveUK3hCRNC7ws5zalHmZwfdLMGaS8r4Ew== - -"@wdio/browserstack-service@^6.1.4": - version "6.12.1" - resolved "https://registry.yarnpkg.com/@wdio/browserstack-service/-/browserstack-service-6.12.1.tgz#648cbf419f434f7e7dd31f04f25fe9178e2733a8" - integrity sha512-B4zYlaE8q1Jxb6ctcuUPlKL3inwloETwks+cB9fFtVMDf/HH2Cau3Pi0CoIs8435EI+J4/1LxLHQV2uhzbBSlQ== - dependencies: - "@wdio/logger" "6.10.10" - browserstack-local "^1.4.5" - got "^11.0.2" - -"@wdio/cli@^7.5.2": - version "7.14.0" - resolved "https://registry.yarnpkg.com/@wdio/cli/-/cli-7.14.0.tgz#bb852e716dc3f35f5be5d569b061841ed13b76cc" - integrity sha512-9s2gzy4VI3DII3VGAb4AABm1dC05QN2sZU5TgPtqTUn9Cub5Rjht5wCGHhn8C3SiIfoR6fzuQezl1FpIzL3+yQ== - dependencies: - "@types/ejs" "^3.0.5" - "@types/fs-extra" "^9.0.4" - "@types/inquirer" "^8.1.2" - "@types/lodash.flattendeep" "^4.4.6" - "@types/lodash.pickby" "^4.6.6" - "@types/lodash.union" "^4.6.6" - "@types/node" "^15.12.5" - "@types/recursive-readdir" "^2.2.0" - "@wdio/config" "7.13.2" - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - async-exit-hook "^2.0.1" - chalk "^4.0.0" - chokidar "^3.0.0" - cli-spinners "^2.1.0" - ejs "^3.0.1" - fs-extra "^10.0.0" - inquirer "8.1.5" - lodash.flattendeep "^4.4.0" - lodash.pickby "^4.6.0" - lodash.union "^4.6.0" - mkdirp "^1.0.4" - recursive-readdir "^2.2.2" - webdriverio "7.13.2" - yargs "^17.0.0" - yarn-install "^1.0.0" - -"@wdio/concise-reporter@^7.5.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/concise-reporter/-/concise-reporter-7.13.2.tgz#4244c21c7c8c5b63782a8ec67cbd9405e7bd9f19" - integrity sha512-ndRWq9JUq8XXPpDQ+PbZGlrD5wejvTqfCMNtHpA9VHl5p1fhe7ZHOxzSEbz6UmHK7yZwgdplHdxxsOVoGaWRZA== - dependencies: - "@wdio/reporter" "7.13.2" - "@wdio/types" "7.13.2" - chalk "^4.0.0" - pretty-ms "^7.0.0" - -"@wdio/config@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/config/-/config-7.13.2.tgz#5abdd8ce71caefd013ec62bb2e885a0a23861d37" - integrity sha512-EKrckwuUIABeOX9ju8t+Dj74urrXUko8aNj8TpxPdRL/J3cBQVOb1k/ffm2NSOga9RaLKhbKWzWeWfUULSYsiQ== - dependencies: - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - deepmerge "^4.0.0" - glob "^7.1.2" - -"@wdio/local-runner@^7.5.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/local-runner/-/local-runner-7.13.2.tgz#10b559d9c4090a694cc89ef7427d33f97f8c1985" - integrity sha512-wegCw6d/Omm3zFek1hhFmW363hW/gnzf1pTvWa91rC4jlWjMSEp1HkEVnjLIdLeiaPcya5JuB0gSKTQnsl9EpA== - dependencies: - "@types/stream-buffers" "^3.0.3" - "@wdio/logger" "7.7.0" - "@wdio/repl" "7.13.2" - "@wdio/runner" "7.13.2" - "@wdio/types" "7.13.2" - async-exit-hook "^2.0.1" - split2 "^3.2.2" - stream-buffers "^3.0.2" - -"@wdio/logger@6.10.10": - version "6.10.10" - resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-6.10.10.tgz#1e07cf32a69606ddb94fa9fd4b0171cb839a5980" - integrity sha512-2nh0hJz9HeZE0VIEMI+oPgjr/Q37ohrR9iqsl7f7GW5ik+PnKYCT9Eab5mR1GNMG60askwbskgGC1S9ygtvrSw== - dependencies: - chalk "^4.0.0" - loglevel "^1.6.0" - loglevel-plugin-prefix "^0.8.4" - strip-ansi "^6.0.0" - -"@wdio/logger@7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-7.7.0.tgz#cac834008b7570f3b6ae30ed731545618c51da40" - integrity sha512-XX/OkC8NlvsBdhKsb9j7ZbuQtF/Vuo0xf38PXdqYtVezOrYbDuba0hPG++g/IGNuAF34ZbSi+49cvz4u5w92kQ== - dependencies: - chalk "^4.0.0" - loglevel "^1.6.0" - loglevel-plugin-prefix "^0.8.4" - strip-ansi "^6.0.0" - -"@wdio/mocha-framework@^7.5.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/mocha-framework/-/mocha-framework-7.13.2.tgz#59600bc823b249d8cd2cb91d6d00204294a44ded" - integrity sha512-NR73KcZrKZYIgly26jTDUIOhC0YvYDdBUgKN/LsIbp63gQsOmx0/QGuh2O58OxMT5Z1ri7vfcnJhf8H73Adu2Q== - dependencies: - "@types/mocha" "^9.0.0" - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - expect-webdriverio "^3.0.0" - mocha "^9.0.0" - -"@wdio/protocols@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/protocols/-/protocols-7.13.2.tgz#639cb0d9863e8d899c51642e9f1980aa1e713f86" - integrity sha512-GUbYbV2IjPlPhlz457nMD6C0GA9yPfVtZQAwgqaKXf9yR2cuNGHHkidWivfXJNG3zws2uFm/9I1+K9OaYIKVkQ== - -"@wdio/repl@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/repl/-/repl-7.13.2.tgz#f9a1b1f7f98e170c5af2cc6a8d5f19b9365583df" - integrity sha512-gEnC39RANX2lMip95lpCle0hkdQn2qVvLbUFAE3RzkTO8vW3Cs8Rkg905AfJdVUlsnAc3NpzINq+UBWxpk3EQw== - dependencies: - "@wdio/utils" "7.13.2" - -"@wdio/reporter@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/reporter/-/reporter-7.13.2.tgz#039de4ec8d57b29363d1bc3c51ebf891ff1269ea" - integrity sha512-R5tqFybwfXyvopAcmYXZOb3pG0I8b3sB9S3OYLGGVeYhv21aFuEn3+2LBth65cVpRQ+vlqoYBxmcJ7A4BvoS5g== - dependencies: - "@types/diff" "^5.0.0" - "@types/node" "^15.12.5" - "@types/object-inspect" "^1.8.0" - "@types/supports-color" "^8.1.0" - "@wdio/types" "7.13.2" - diff "^5.0.0" - fs-extra "^10.0.0" - object-inspect "^1.10.3" - supports-color "8.1.1" - -"@wdio/runner@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/runner/-/runner-7.13.2.tgz#fcb0368c71cea1949181f6c8c73a95ad211899d4" - integrity sha512-IlhObs9bH+cSs2gH/RzYuiKEXZ7HL65cBIgRhuFKVjunrAiZZUGugk2MJHQltYXBaydSkk2kJCj0noHzEBR/CA== - dependencies: - "@wdio/config" "7.13.2" - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - deepmerge "^4.0.0" - gaze "^1.1.2" - webdriver "7.13.2" - webdriverio "7.13.2" - -"@wdio/spec-reporter@^7.5.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/spec-reporter/-/spec-reporter-7.13.2.tgz#5de5e6645183309679f061c8090f2d43676d5662" - integrity sha512-ZrQGRvAox8egDIbJyNGIC8YDpAqEaRHOzcgGlZlTpoW81Ufmn1/iX2t+Dlhu/Zku1qT23uhtV1T3PqKDW4JDHQ== - dependencies: - "@types/easy-table" "^0.0.33" - "@wdio/reporter" "7.13.2" - "@wdio/types" "7.13.2" - chalk "^4.0.0" - easy-table "^1.1.1" - pretty-ms "^7.0.0" - -"@wdio/sync@^7.5.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/sync/-/sync-7.13.2.tgz#5e11532bc3e8d101b2b956288cad6c68fde09e08" - integrity sha512-KRGwDeFVeDrojtB2ptPQe0MZCVF+43gIjo98TLxmO+ZdruDt8j6v4bTmg55kTBhVVgiFIbN1dE6WyH1JllUcgw== - dependencies: - "@types/fibers" "^3.1.0" - "@types/puppeteer" "^5.4.0" - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - fibers "^5.0.0" - webdriverio "7.13.2" - -"@wdio/types@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/types/-/types-7.13.2.tgz#7ad775145f3af26225349838ac893ef09008f701" - integrity sha512-uTU9e4QjOIME0z4HIEwefitGNjvgeekA4G8EnOGPpgI9JCoR6kjl3X6T58tilDtZVpTC54XwjpjHESz5MwQt2w== - dependencies: - "@types/node" "^15.12.5" - got "^11.8.1" - -"@wdio/utils@7.13.2": - version "7.13.2" - resolved "https://registry.yarnpkg.com/@wdio/utils/-/utils-7.13.2.tgz#1e3aa228451365ee1b4812d6fd5298b11455f238" - integrity sha512-FvOMpwDu56PadYuHyd0GFOHQzdm/zK1A2DC2ZRalVOgaZ6adG3HrtYtFfbbVFio9XaQxoefO9OOiRphGjg8tzg== - dependencies: - "@wdio/logger" "7.7.0" - "@wdio/types" "7.13.2" - p-iteration "^1.1.8" - -JSONStream@^1.0.3, JSONStream@^1.0.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - -abbrev@1.0.x: - version "1.0.9" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" - integrity sha1-kbR5JYinc4wl813W9jdSovh3YTU= - -accepts@~1.3.4, accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -acorn-dynamic-import@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" - integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= - dependencies: - acorn "^4.0.3" - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= - dependencies: - acorn "^3.0.4" - -acorn-jsx@^5.3.1: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn-node@^1.6.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" - integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== - dependencies: - acorn "^7.0.0" - acorn-walk "^7.0.0" - xtend "^4.0.2" - -acorn-walk@^7.0.0, acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== - -acorn@^3.0.0, acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= - -acorn@^4.0.3: - version "4.0.13" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" - integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= - -acorn@^5.0.0, acorn@^5.5.0: - version "5.7.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e" - integrity sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg== - -acorn@^6.4.1: - version "6.4.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" - integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ== - -acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.0: - version "7.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" - integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== - -add-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" - integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= - -agent-base@5: - version "5.1.1" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c" - integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g== - -agent-base@6: - version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" - integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== - dependencies: - debug "4" - -agent-base@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== - dependencies: - es6-promisify "^5.0.0" - -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= - -ajv-keywords@^3.1.0, ajv-keywords@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" - integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== - -ajv@5.5.2, ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.12.3, ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.1: - version "8.6.3" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764" - integrity sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= - -ansi-colors@4.1.1, ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - -ansi-colors@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" - integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== - dependencies: - ansi-wrap "^0.1.0" - -ansi-colors@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-2.0.5.tgz#5da37825fef3e75f3bda47f760d64bfd10e15e10" - integrity sha512-yAdfUZ+c2wetVNIFsNRn44THW+Lty6S5TwMpUfLA/UaGhiXbBv/F8E60/1hMLd0cnF/CDoWH8vzVaI5bAcHCjw== - -ansi-escapes@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-gray@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" - integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= - dependencies: - ansi-wrap "0.1.0" - -ansi-html@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e" - integrity sha1-gTWEAhliqenm/QOflA0S9WynhZ4= - -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - integrity sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk= - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - integrity sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94= - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -ansi-wrap@0.1.0, ansi-wrap@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" - integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= - -anymatch@^1.3.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" - integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== - dependencies: - micromatch "^2.1.5" - normalize-path "^2.0.0" - -anymatch@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" - integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== - dependencies: - micromatch "^3.1.4" - normalize-path "^2.1.1" - -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -append-buffer@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" - integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= - dependencies: - buffer-equal "^1.0.0" - -archiver-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-2.1.0.tgz#e8a460e94b693c3e3da182a098ca6285ba9249e2" - integrity sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw== - dependencies: - glob "^7.1.4" - graceful-fs "^4.2.0" - lazystream "^1.0.0" - lodash.defaults "^4.2.0" - lodash.difference "^4.5.0" - lodash.flatten "^4.4.0" - lodash.isplainobject "^4.0.6" - lodash.union "^4.6.0" - normalize-path "^3.0.0" - readable-stream "^2.0.0" - -archiver@^5.0.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/archiver/-/archiver-5.3.0.tgz#dd3e097624481741df626267564f7dd8640a45ba" - integrity sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg== - dependencies: - archiver-utils "^2.1.0" - async "^3.2.0" - buffer-crc32 "^0.2.1" - readable-stream "^3.6.0" - readdir-glob "^1.0.0" - tar-stream "^2.2.0" - zip-stream "^4.1.0" - -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= - dependencies: - arr-flatten "^1.0.1" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-filter@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" - integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= - dependencies: - make-iterator "^1.0.0" - -arr-flatten@^1.0.1, arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-map@^2.0.0, arr-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" - integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= - dependencies: - make-iterator "^1.0.0" - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-differ@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" - integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= - -array-each@^1.0.0, array-each@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" - integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= - -array-find-index@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" - integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-from@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195" - integrity sha1-z+nYwmYoudxa7MYqn12PHzUsEZU= - -array-ify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" - integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= - -array-includes@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.3.tgz#c7f619b382ad2afaf5326cddfdc0afc61af7690a" - integrity sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.18.0-next.2" - get-intrinsic "^1.1.1" - is-string "^1.0.5" - -array-initial@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" - integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= - dependencies: - array-slice "^1.0.0" - is-number "^4.0.0" - -array-last@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" - integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== - dependencies: - is-number "^4.0.0" - -array-slice@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" - integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== - -array-sort@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" - integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== - dependencies: - default-compare "^1.0.0" - get-value "^2.0.6" - kind-of "^5.0.2" - -array-uniq@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -array.prototype.flat@^1.2.4: - version "1.2.5" - resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.5.tgz#07e0975d84bbc7c48cd1879d609e682598d33e13" - integrity sha512-KaYU+S+ndVqyUnignHftkwc58o3uVU1jzczILJ1tN2YaIZpFIKBiP/x/j97E5MVPsaCloPbqWLB/8qCTVvT2qg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.0" - -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= - -asn1.js@^5.2.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-5.4.1.tgz#11a980b84ebb91781ce35b0fdc2ee294e3783f07" - integrity sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA== - dependencies: - bn.js "^4.0.0" - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - safer-buffer "^2.1.0" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -assert@^1.1.1: - version "1.5.0" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" - integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== - dependencies: - object-assign "^4.1.1" - util "0.10.3" - -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -astral-regex@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" - integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== - -async-done@^1.2.0, async-done@^1.2.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" - integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.2" - process-nextick-args "^2.0.0" - stream-exhaust "^1.0.1" - -async-each@^1.0.0, async-each@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" - integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== - -async-exit-hook@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz#8bd8b024b0ec9b1c01cccb9af9db29bd717dfaf3" - integrity sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw== - -async-limiter@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" - integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== - -async-settle@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" - integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= - dependencies: - async-done "^1.2.2" - -async@0.9.x, async@^0.9.0: - version "0.9.2" - resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" - integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0= - -async@1.x, async@^1.3.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= - -async@^2.0.0, async@^2.1.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -async@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.1.tgz#d3274ec66d107a47476a4c49136aacdb00665fc8" - integrity sha512-XdD5lRO/87udXCMC9meWdYiR+Nq6ZjUfXidViUZGu2F1MO4T3XwZ1et0hb2++BgLfhyJwy44BGB/yx80ABx8hg== - -async@~0.2.6: - version "0.2.10" - resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" - integrity sha1-trvgsGdLnXGXCMo43owjfLUmw9E= - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -atob@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -available-typed-arrays@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" - integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - -babel-loader@^8.0.5: - version "8.2.2" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.2.2.tgz#9363ce84c10c9a40e6c753748e1441b60c8a0b81" - integrity sha512-JvTd0/D889PQBtUXJ2PXaKU/pjZDMtHA9V2ecm+eNRmmBCMR09a+fmpGTNwnJtFmFl5Ei7Vy47LjBb+L0wQ99g== - dependencies: - find-cache-dir "^3.3.1" - loader-utils "^1.4.0" - make-dir "^3.1.0" - schema-utils "^2.6.5" - -babel-plugin-dynamic-import-node@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz#84fda19c976ec5c6defef57f9427b3def66e17a3" - integrity sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ== - dependencies: - object.assign "^4.1.0" - -babel-plugin-polyfill-corejs2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz#e9124785e6fd94f94b618a7954e5693053bf5327" - integrity sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ== - dependencies: - "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.2" - semver "^6.1.1" - -babel-plugin-polyfill-corejs3@^0.2.2: - version "0.2.5" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.5.tgz#2779846a16a1652244ae268b1e906ada107faf92" - integrity sha512-ninF5MQNwAX9Z7c9ED+H2pGt1mXdP4TqzlHKyPIYmJIYz0N+++uwdM7RnJukklhzJ54Q84vA4ZJkgs7lu5vqcw== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - core-js-compat "^3.16.2" - -babel-plugin-polyfill-regenerator@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz#b310c8d642acada348c1fa3b3e6ce0e851bee077" - integrity sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg== - dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.2" - -babel-plugin-transform-object-assign@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-assign/-/babel-plugin-transform-object-assign-6.22.0.tgz#f99d2f66f1a0b0d498e346c5359684740caa20ba" - integrity sha1-+Z0vZvGgsNSY40bFNZaEdAyqILo= - dependencies: - babel-runtime "^6.22.0" - -babel-runtime@^6.0.0, babel-runtime@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" - integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.11.0" - -babelify@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/babelify/-/babelify-10.0.0.tgz#fe73b1a22583f06680d8d072e25a1e0d1d1d7fb5" - integrity sha512-X40FaxyH7t3X+JFAKvb1H9wooWKLRCi8pg3m8poqtdZaIng+bjzp9RvKQCvRjF9isHiPkXspbbXT/zwXLtwgwg== - -bach@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" - integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= - dependencies: - arr-filter "^1.1.1" - arr-flatten "^1.0.1" - arr-map "^2.0.0" - array-each "^1.0.0" - array-initial "^1.0.0" - array-last "^1.1.1" - async-done "^1.2.2" - async-settle "^1.0.0" - now-and-later "^2.0.0" - -bail@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" - integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ== - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -base64-arraybuffer@0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz#9818c79e059b1355f97e0428a017c838e90ba812" - integrity sha1-mBjHngWbE1X5fgQooBfIOOkLqBI= - -base64-js@^1.0.2, base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== - -base64id@2.0.0, base64id@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" - integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -basic-auth@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a" - integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg== - dependencies: - safe-buffer "5.1.2" - -batch@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" - integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= - -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - integrity sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak= - -bfj@^6.1.1: - version "6.1.2" - resolved "https://registry.yarnpkg.com/bfj/-/bfj-6.1.2.tgz#325c861a822bcb358a41c78a33b8e6e2086dde7f" - integrity sha512-BmBJa4Lip6BPRINSZ0BPEIfB1wUY/9rwbwvIHQA1KjX9om29B6id0wnWXq7m3bn5JrUVjeOTnVuhPT1FiHwPGw== - dependencies: - bluebird "^3.5.5" - check-types "^8.0.3" - hoopy "^0.1.4" - tryer "^1.0.1" - -big-integer@^1.6.17: - version "1.6.49" - resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.49.tgz#f6817d3ea5d4f3fb19e24df9f4b1b4471a8328ce" - integrity sha512-KJ7VhqH+f/BOt9a3yMwJNmcZjG53ijWMTjSAGMveQWyLwqIiwkjNP5PFgDob3Snnx86SjDj6I89fIbv0dkQeNw== - -big.js@^3.1.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" - integrity sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q== - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -binary-extensions@^1.0.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" - integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -binary@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79" - integrity sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk= - dependencies: - buffers "~0.1.1" - chainsaw "~0.1.0" - -binaryextensions@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/binaryextensions/-/binaryextensions-2.3.0.tgz#1d269cbf7e6243ea886aa41453c3651ccbe13c22" - integrity sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg== - -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bl@^4.0.3, bl@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" - integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== - dependencies: - buffer "^5.5.0" - inherits "^2.0.4" - readable-stream "^3.4.0" - -bluebird@^3.5.5: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - -bluebird@~3.4.1: - version "3.4.7" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" - integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= - -bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== - -bn.js@^5.0.0, bn.js@^5.1.1: - version "5.2.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" - integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== - -body-parser@1.19.0, body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -body@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" - integrity sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk= - dependencies: - continuable-cache "^0.3.1" - error "^7.0.0" - raw-body "~1.1.0" - safe-json-parse "~1.0.1" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -braces@^2.3.1, braces@^2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -braces@^3.0.1, braces@^3.0.2, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -brorand@^1.0.1, brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= - -browser-resolve@^1.7.0: - version "1.11.3" - resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" - integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== - dependencies: - resolve "1.1.7" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserify-aes@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-0.4.0.tgz#067149b668df31c4b58533e02d01e806d8608e2c" - integrity sha1-BnFJtmjfMcS1hTPgLQHoBthgjiw= - dependencies: - inherits "^2.0.1" - -browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - -browserify-cipher@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" - integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== - dependencies: - browserify-aes "^1.0.4" - browserify-des "^1.0.0" - evp_bytestokey "^1.0.0" - -browserify-des@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" - integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== - dependencies: - cipher-base "^1.0.1" - des.js "^1.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -browserify-rsa@^4.0.0, browserify-rsa@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.0.tgz#b2fd06b5b75ae297f7ce2dc651f918f5be158c8d" - integrity sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog== - dependencies: - bn.js "^5.0.0" - randombytes "^2.0.1" - -browserify-sign@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.1.tgz#eaf4add46dd54be3bb3b36c0cf15abbeba7956c3" - integrity sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg== - dependencies: - bn.js "^5.1.1" - browserify-rsa "^4.0.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - elliptic "^6.5.3" - inherits "^2.0.4" - parse-asn1 "^5.1.5" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -browserify-zlib@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" - integrity sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0= - dependencies: - pako "~0.2.0" - -browserify-zlib@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" - integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== - dependencies: - pako "~1.0.5" - -browserslist@^4.16.6, browserslist@^4.17.1: - version "4.17.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.2.tgz#aa15dbd2fab399a399fe4df601bb09363c5458a6" - integrity sha512-jSDZyqJmkKMEMi7SZAgX5UltFdR5NAO43vY0AwTpu4X3sGH7GLLQ83KiUomgrnvZRCeW0yPPnKqnxPqQOER9zQ== - dependencies: - caniuse-lite "^1.0.30001261" - electron-to-chromium "^1.3.854" - escalade "^3.1.1" - nanocolors "^0.2.12" - node-releases "^1.1.76" - -browserstack-local@^1.4.5: - version "1.4.8" - resolved "https://registry.yarnpkg.com/browserstack-local/-/browserstack-local-1.4.8.tgz#07f74a19b324cf2de69ffe65f9c2baa3a2dd9a0e" - integrity sha512-s+mc3gTOJwELdLWi4qFVKtGwMbb5JWsR+JxKlMaJkRJxoZ0gg3WREgPxAN0bm6iU5+S4Bi0sz0oxBRZT8BiNsQ== - dependencies: - https-proxy-agent "^4.0.0" - is-running "^2.1.0" - ps-tree "=1.2.0" - temp-fs "^0.9.9" - -browserstack@~1.5.1: - version "1.5.3" - resolved "https://registry.yarnpkg.com/browserstack/-/browserstack-1.5.3.tgz#93ab48799a12ef99dbd074dd595410ddb196a7ac" - integrity sha512-AO+mECXsW4QcqC9bxwM29O7qWa7bJT94uBFzeb5brylIQwawuEziwq20dPYbins95GlWzOawgyDNdjYAo32EKg== - dependencies: - https-proxy-agent "^2.2.1" - -browserstacktunnel-wrapper@~2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/browserstacktunnel-wrapper/-/browserstacktunnel-wrapper-2.0.4.tgz#0ebffd3d6311b8526c30d8b430fdc651a535eebb" - integrity sha512-GCV599FUUxNOCFl3WgPnfc5dcqq9XTmMXoxWpqkvmk0R9TOIoqmjENNU6LY6DtgIL6WfBVbg/jmWtnM5K6UYSg== - dependencies: - https-proxy-agent "^2.2.1" - unzipper "^0.9.3" - -buffer-crc32@^0.2.1, buffer-crc32@^0.2.13, buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - -buffer-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" - integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-indexof-polyfill@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/buffer-indexof-polyfill/-/buffer-indexof-polyfill-1.0.2.tgz#d2732135c5999c64b277fcf9b1abe3498254729c" - integrity sha512-I7wzHwA3t1/lwXQh+A5PbNvJxgfo5r3xulgpYDB5zckTu/Z9oUK9biouBKQUjEqzaz3HnAT6TYoovmE+GqSf7A== - -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - integrity sha1-mXjOMXOIxkmth5MCjDR37wRKi1E= - -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= - -buffer@^4.3.0, buffer@^4.9.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8" - integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg== - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - -buffer@^5.2.1, buffer@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" - integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== - dependencies: - base64-js "^1.3.1" - ieee754 "^1.1.13" - -buffers@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" - integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s= - -builtin-status-codes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" - integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= - -bytes@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" - integrity sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g= - -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - -cac@^3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/cac/-/cac-3.0.4.tgz#6d24ceec372efe5c9b798808bc7f49b47242a4ef" - integrity sha1-bSTO7Dcu/lybeYgIvH9JtHJCpO8= - dependencies: - camelcase-keys "^3.0.0" - chalk "^1.1.3" - indent-string "^3.0.0" - minimist "^1.2.0" - read-pkg-up "^1.0.1" - suffix "^0.1.0" - text-table "^0.2.0" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -cacheable-lookup@^5.0.3: - version "5.0.4" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" - integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== - -cacheable-request@^7.0.1: - version "7.0.2" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" - integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^4.0.0" - lowercase-keys "^2.0.0" - normalize-url "^6.0.1" - responselike "^2.0.0" - -cached-path-relative@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.2.tgz#a13df4196d26776220cc3356eb147a52dba2c6db" - integrity sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg== - -call-bind@^1.0.0, call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" - integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= - dependencies: - camelcase "^2.0.0" - map-obj "^1.0.0" - -camelcase-keys@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-3.0.0.tgz#fc0c6c360363f7377e3793b9a16bccf1070c1ca4" - integrity sha1-/AxsNgNj9zd+N5O5oWvM8QcMHKQ= - dependencies: - camelcase "^3.0.0" - map-obj "^1.0.0" - -camelcase-keys@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-6.2.2.tgz#5e755d6ba51aa223ec7d3d52f25778210f9dc3c0" - integrity sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg== - dependencies: - camelcase "^5.3.1" - map-obj "^4.0.0" - quick-lru "^4.0.1" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= - -camelcase@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" - integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= - -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= - -camelcase@^5.0.0, camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.0.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== - -caniuse-lite@^1.0.30001261: - version "1.0.30001264" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001264.tgz#88f625a60efb6724c7c62ac698bc8dbd9757e55b" - integrity sha512-Ftfqqfcs/ePiUmyaySsQ4PUsdcYyXG2rfoBVsk3iY1ahHaJEw65vfb7Suzqm+cEkwwPIv/XWkg27iCpRavH4zA== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -ccount@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" - integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chai@^4.2.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.1" - type-detect "^4.0.5" - -chainsaw@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98" - integrity sha1-XqtQsor+WAdNDVgpE4iCi15fvJg= - dependencies: - traverse ">=0.3.0 <0.4" - -chalk@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" - integrity sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ= - dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" - -chalk@^1.0.0, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -character-entities-html4@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.4.tgz#0e64b0a3753ddbf1fdc044c5fd01d0199a02e125" - integrity sha512-HRcDxZuZqMx3/a+qrzxdBKBPUpxWEq9xw2OPZ3a/174ihfrQKVsFhqtthBInFy1zZ9GgZyFXOatNujm8M+El3g== - -character-entities-legacy@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" - integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== - -character-entities@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" - integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== - -character-reference-invalid@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" - integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== - -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - -check-types@^8.0.3: - version "8.0.3" - resolved "https://registry.yarnpkg.com/check-types/-/check-types-8.0.3.tgz#3356cca19c889544f2d7a95ed49ce508a0ecf552" - integrity sha512-YpeKZngUmG65rLudJ4taU7VLkOCTMhNl/u4ctNC56LQS/zJTyNH0Lrtwm1tfTsbLlwvlfsA2d1c8vCf/Kh2KwQ== - -chokidar@3.5.2, chokidar@^3.0.0, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.5.1: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -chokidar@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" - integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= - dependencies: - anymatch "^1.3.0" - async-each "^1.0.0" - glob-parent "^2.0.0" - inherits "^2.0.1" - is-binary-path "^1.0.0" - is-glob "^2.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.0.0" - optionalDependencies: - fsevents "^1.0.0" - -chokidar@^2.0.0, chokidar@^2.1.8: - version "2.1.8" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" - integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== - dependencies: - anymatch "^2.0.0" - async-each "^1.0.1" - braces "^2.3.2" - glob-parent "^3.1.0" - inherits "^2.0.3" - is-binary-path "^1.0.0" - is-glob "^4.0.0" - normalize-path "^3.0.0" - path-is-absolute "^1.0.0" - readdirp "^2.2.1" - upath "^1.1.1" - optionalDependencies: - fsevents "^1.2.7" - -chownr@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - -chrome-launcher@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/chrome-launcher/-/chrome-launcher-0.14.0.tgz#de8d8a534ccaeea0f36ea8dc12dd99e3169f3320" - integrity sha512-W//HpflaW6qBGrmuskup7g+XJZN6w03ko9QSIe5CtcTal2u0up5SeReK3Ll1Why4Ey8dPkv8XSodZyHPnGbVHQ== - dependencies: - "@types/node" "*" - escape-string-regexp "^4.0.0" - is-wsl "^2.2.0" - lighthouse-logger "^1.0.0" - -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" - integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" - integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== - dependencies: - restore-cursor "^3.1.0" - -cli-spinners@^2.1.0, cli-spinners@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" - integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== - -cli-width@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" - integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== - -cli-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-3.0.0.tgz#a2f48437a2caa9a22436e794bf071ec9e61cedf6" - integrity sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw== - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -cliui@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" - integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^6.2.0" - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -clone-buffer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" - integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= - -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - -clone-stats@^0.0.1, clone-stats@~0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" - integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= - -clone-stats@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" - integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= - -clone@^1.0.0, clone@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" - integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= - -clone@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" - integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= - -cloneable-readable@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" - integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== - dependencies: - inherits "^2.0.1" - process-nextick-args "^2.0.0" - readable-stream "^2.3.5" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-map@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" - integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= - dependencies: - arr-map "^2.0.2" - for-own "^1.0.0" - make-iterator "^1.0.0" - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -color-support@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - -colors@^1.1.2, colors@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -comma-separated-tokens@^1.0.0: - version "1.0.8" - resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" - integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== - -commander@2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== - -commander@^2.18.0, commander@^2.20.0: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= - -compare-func@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-2.0.0.tgz#fb65e75edbddfd2e568554e8b5b05fff7a51fcb3" - integrity sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA== - dependencies: - array-ify "^1.0.0" - dot-prop "^5.1.0" - -component-emitter@^1.2.1, component-emitter@~1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -compress-commons@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/compress-commons/-/compress-commons-4.1.1.tgz#df2a09a7ed17447642bad10a85cc9a19e5c42a7d" - integrity sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ== - dependencies: - buffer-crc32 "^0.2.13" - crc32-stream "^4.0.2" - normalize-path "^3.0.0" - readable-stream "^3.6.0" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -concat-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" - integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.0.2" - typedarray "^0.0.6" - -concat-stream@~1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" - integrity sha1-cIl4Yk2FavQaWnQd790mHadSwmY= - dependencies: - inherits "~2.0.1" - readable-stream "~2.0.0" - typedarray "~0.0.5" - -concat-with-sourcemaps@^1.0.0, concat-with-sourcemaps@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz#d4ea93f05ae25790951b99e7b3b09e3908a4082e" - integrity sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg== - dependencies: - source-map "^0.6.1" - -connect-livereload@^0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/connect-livereload/-/connect-livereload-0.6.1.tgz#1ac0c8bb9d9cfd5b28b629987a56a9239db9baaa" - integrity sha512-3R0kMOdL7CjJpU66fzAkCe6HNtd3AavCS4m+uW4KtJjrdGPT0SQEZieAYd+cm+lJoBznNQ4lqipYWkhBMgk00g== - -connect@^3.6.6, connect@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.7.0.tgz#5d49348910caa5e07a01800b030d0c35f20484f8" - integrity sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ== - dependencies: - debug "2.6.9" - finalhandler "1.1.2" - parseurl "~1.3.3" - utils-merge "1.0.1" - -console-browserify@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" - integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== - -constants-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" - integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= - -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -continuable-cache@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" - integrity sha1-vXJ6f67XfnH/OYWskzUakSczrQ8= - -conventional-changelog-angular@^5.0.12: - version "5.0.13" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.13.tgz#896885d63b914a70d4934b59d2fe7bde1832b28c" - integrity sha512-i/gipMxs7s8L/QeuavPF2hLnJgH6pEZAttySB6aiQLWcX3puWDL3ACVmvBhJGxnAy52Qc15ua26BufY6KpmrVA== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - -conventional-changelog-atom@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-2.0.8.tgz#a759ec61c22d1c1196925fca88fe3ae89fd7d8de" - integrity sha512-xo6v46icsFTK3bb7dY/8m2qvc8sZemRgdqLb/bjpBsH2UyOS8rKNTgcb5025Hri6IpANPApbXMg15QLb1LJpBw== - dependencies: - q "^1.5.1" - -conventional-changelog-codemirror@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.8.tgz#398e9530f08ce34ec4640af98eeaf3022eb1f7dc" - integrity sha512-z5DAsn3uj1Vfp7po3gpt2Boc+Bdwmw2++ZHa5Ak9k0UKsYAO5mH1UBTN0qSCuJZREIhX6WU4E1p3IW2oRCNzQw== - dependencies: - q "^1.5.1" - -conventional-changelog-config-spec@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz#874a635287ef8b581fd8558532bf655d4fb59f2d" - integrity sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ== - -conventional-changelog-conventionalcommits@4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz#a02e0b06d11d342fdc0f00c91d78265ed0bc0a62" - integrity sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - -conventional-changelog-conventionalcommits@^4.5.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.1.tgz#f4c0921937050674e578dc7875f908351ccf4014" - integrity sha512-lzWJpPZhbM1R0PIzkwzGBCnAkH5RKJzJfFQZcl/D+2lsJxAwGnDKBqn/F4C1RD31GJNn8NuKWQzAZDAVXPp2Mw== - dependencies: - compare-func "^2.0.0" - lodash "^4.17.15" - q "^1.5.1" - -conventional-changelog-core@^4.2.1: - version "4.2.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" - integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== - dependencies: - add-stream "^1.0.0" - conventional-changelog-writer "^5.0.0" - conventional-commits-parser "^3.2.0" - dateformat "^3.0.0" - get-pkg-repo "^4.0.0" - git-raw-commits "^2.0.8" - git-remote-origin-url "^2.0.0" - git-semver-tags "^4.1.1" - lodash "^4.17.15" - normalize-package-data "^3.0.0" - q "^1.5.1" - read-pkg "^3.0.0" - read-pkg-up "^3.0.0" - through2 "^4.0.0" - -conventional-changelog-ember@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-2.0.9.tgz#619b37ec708be9e74a220f4dcf79212ae1c92962" - integrity sha512-ulzIReoZEvZCBDhcNYfDIsLTHzYHc7awh+eI44ZtV5cx6LVxLlVtEmcO+2/kGIHGtw+qVabJYjdI5cJOQgXh1A== - dependencies: - q "^1.5.1" - -conventional-changelog-eslint@^3.0.9: - version "3.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.9.tgz#689bd0a470e02f7baafe21a495880deea18b7cdb" - integrity sha512-6NpUCMgU8qmWmyAMSZO5NrRd7rTgErjrm4VASam2u5jrZS0n38V7Y9CzTtLT2qwz5xEChDR4BduoWIr8TfwvXA== - dependencies: - q "^1.5.1" - -conventional-changelog-express@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-2.0.6.tgz#420c9d92a347b72a91544750bffa9387665a6ee8" - integrity sha512-SDez2f3iVJw6V563O3pRtNwXtQaSmEfTCaTBPCqn0oG0mfkq0rX4hHBq5P7De2MncoRixrALj3u3oQsNK+Q0pQ== - dependencies: - q "^1.5.1" - -conventional-changelog-jquery@^3.0.11: - version "3.0.11" - resolved "https://registry.yarnpkg.com/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.11.tgz#d142207400f51c9e5bb588596598e24bba8994bf" - integrity sha512-x8AWz5/Td55F7+o/9LQ6cQIPwrCjfJQ5Zmfqi8thwUEKHstEn4kTIofXub7plf1xvFA2TqhZlq7fy5OmV6BOMw== - dependencies: - q "^1.5.1" - -conventional-changelog-jshint@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.9.tgz#f2d7f23e6acd4927a238555d92c09b50fe3852ff" - integrity sha512-wMLdaIzq6TNnMHMy31hql02OEQ8nCQfExw1SE0hYL5KvU+JCTuPaDO+7JiogGT2gJAxiUGATdtYYfh+nT+6riA== - dependencies: - compare-func "^2.0.0" - q "^1.5.1" - -conventional-changelog-preset-loader@^2.3.4: - version "2.3.4" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz#14a855abbffd59027fd602581f1f34d9862ea44c" - integrity sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g== - -conventional-changelog-writer@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-5.0.0.tgz#c4042f3f1542f2f41d7d2e0d6cad23aba8df8eec" - integrity sha512-HnDh9QHLNWfL6E1uHz6krZEQOgm8hN7z/m7tT16xwd802fwgMN0Wqd7AQYVkhpsjDUx/99oo+nGgvKF657XP5g== - dependencies: - conventional-commits-filter "^2.0.7" - dateformat "^3.0.0" - handlebars "^4.7.6" - json-stringify-safe "^5.0.1" - lodash "^4.17.15" - meow "^8.0.0" - semver "^6.0.0" - split "^1.0.0" - through2 "^4.0.0" - -conventional-changelog@3.1.24: - version "3.1.24" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.24.tgz#ebd180b0fd1b2e1f0095c4b04fd088698348a464" - integrity sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg== - dependencies: - conventional-changelog-angular "^5.0.12" - conventional-changelog-atom "^2.0.8" - conventional-changelog-codemirror "^2.0.8" - conventional-changelog-conventionalcommits "^4.5.0" - conventional-changelog-core "^4.2.1" - conventional-changelog-ember "^2.0.9" - conventional-changelog-eslint "^3.0.9" - conventional-changelog-express "^2.0.6" - conventional-changelog-jquery "^3.0.11" - conventional-changelog-jshint "^2.0.9" - conventional-changelog-preset-loader "^2.3.4" - -conventional-commits-filter@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.7.tgz#f8d9b4f182fce00c9af7139da49365b136c8a0b3" - integrity sha512-ASS9SamOP4TbCClsRHxIHXRfcGCnIoQqkvAzCSbZzTFLfcTqJVugB0agRgsEELsqaeWgsXv513eS116wnlSSPA== - dependencies: - lodash.ismatch "^4.4.0" - modify-values "^1.0.0" - -conventional-commits-parser@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.2.2.tgz#190fb9900c6e02be0c0bca9b03d57e24982639fd" - integrity sha512-Jr9KAKgqAkwXMRHjxDwO/zOCDKod1XdAESHAGuJX38iZ7ZzVti/tvVoysO0suMsdAObp9NQ2rHSsSbnAqZ5f5g== - dependencies: - JSONStream "^1.0.4" - is-text-path "^1.0.1" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" - -conventional-recommended-bump@6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz#cfa623285d1de554012f2ffde70d9c8a22231f55" - integrity sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw== - dependencies: - concat-stream "^2.0.0" - conventional-changelog-preset-loader "^2.3.4" - conventional-commits-filter "^2.0.7" - conventional-commits-parser "^3.2.0" - git-raw-commits "^2.0.8" - git-semver-tags "^4.1.1" - meow "^8.0.0" - q "^1.5.1" - -convert-source-map@^1.0.0, convert-source-map@^1.5.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cookie@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -copy-props@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.5.tgz#03cf9ae328d4ebb36f8f1d804448a6af9ee3f2d2" - integrity sha512-XBlx8HSqrT0ObQwmSzM7WE5k8FxTV75h1DX1Z3n6NhQ/UYYAvInWYmG06vFt7hQZArE2fuO62aihiWIVQwh1sw== - dependencies: - each-props "^1.3.2" - is-plain-object "^5.0.0" - -core-js-compat@^3.16.0, core-js-compat@^3.16.2: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.18.1.tgz#01942a0877caf9c6e5007c027183cf0bdae6a191" - integrity sha512-XJMYx58zo4W0kLPmIingVZA10+7TuKrMLPt83+EzDmxFJQUMcTVVmQ+n5JP4r6Z14qSzhQBRi3NSWoeVyKKXUg== - dependencies: - browserslist "^4.17.1" - semver "7.0.0" - -core-js-pure@^3.13.0, core-js-pure@^3.16.0: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.18.1.tgz#097d34d24484be45cea700a448d1e74622646c80" - integrity sha512-kmW/k8MaSuqpvA1xm2l3TVlBuvW+XBkcaOroFUpO3D4lsTGQWBTb/tBDCf/PNkkPLrwgrkQRIYNPB0CeqGJWGQ== - -core-js@^2.4.0: - version "2.6.12" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" - integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== - -core-js@^3.13.0: - version "3.18.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.18.1.tgz#289d4be2ce0085d40fc1244c0b1a54c00454622f" - integrity sha512-vJlUi/7YdlCZeL6fXvWNaLUPh/id12WXj3MbkMw5uOyF0PfWPBNOCNbs53YqgrvtujLNlt9JQpruyIKkUZ+PKA== - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cors@~2.8.5: - version "2.8.5" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.5.tgz#eac11da51592dd86b9f06f6e7ac293b3df875d29" - integrity sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g== - dependencies: - object-assign "^4" - vary "^1" - -coveralls@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.1.1.tgz#f5d4431d8b5ae69c5079c8f8ca00d64ac77cf081" - integrity sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww== - dependencies: - js-yaml "^3.13.1" - lcov-parse "^1.0.0" - log-driver "^1.2.7" - minimist "^1.2.5" - request "^2.88.2" - -crc-32@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.0.tgz#cb2db6e29b88508e32d9dd0ec1693e7b41a18208" - integrity sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA== - dependencies: - exit-on-epipe "~1.0.1" - printj "~1.1.0" - -crc32-stream@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/crc32-stream/-/crc32-stream-4.0.2.tgz#c922ad22b38395abe9d3870f02fa8134ed709007" - integrity sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w== - dependencies: - crc-32 "^1.2.0" - readable-stream "^3.4.0" - -create-ecdh@^4.0.0: - version "4.0.4" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" - integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== - dependencies: - bn.js "^4.1.0" - elliptic "^6.5.3" - -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -criteo-direct-rsa-validate@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/criteo-direct-rsa-validate/-/criteo-direct-rsa-validate-1.1.0.tgz#eb2fead0ff0bcbe4f6369213dd5eef455f0e53c4" - integrity sha512-7gQ3zX+d+hS/vOxzLrZ4aRAceB7qNJ0VzaGNpcWjDCmtOpASB50USJDupTik/H2nHgiSAA3VNZ3SFuONs8LR9Q== - -cross-spawn@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - -cross-spawn@^5.0.1, cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -crypto-browserify@3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.3.0.tgz#b9fc75bb4a0ed61dcf1cd5dae96eb30c9c3e506c" - integrity sha1-ufx1u0oO1h3PHNXa6W6zDJw+UGw= - dependencies: - browserify-aes "0.4.0" - pbkdf2-compat "2.0.1" - ripemd160 "0.2.0" - sha.js "2.2.6" - -crypto-browserify@^3.11.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" - integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== - dependencies: - browserify-cipher "^1.0.0" - browserify-sign "^4.0.0" - create-ecdh "^4.0.0" - create-hash "^1.1.0" - create-hmac "^1.1.0" - diffie-hellman "^5.0.0" - inherits "^2.0.1" - pbkdf2 "^3.0.3" - public-encrypt "^4.0.0" - randombytes "^2.0.0" - randomfill "^1.0.3" - -crypto-js@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/crypto-js/-/crypto-js-3.3.0.tgz#846dd1cce2f68aacfa156c8578f926a609b7976b" - integrity sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q== - -css-shorthand-properties@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/css-shorthand-properties/-/css-shorthand-properties-1.1.1.tgz#1c808e63553c283f289f2dd56fcee8f3337bd935" - integrity sha512-Md+Juc7M3uOdbAFwOYlTrccIZ7oCFuzrhKYQjdeUEW/sE1hv17Jp/Bws+ReOPpGVBTYCBoYo+G17V5Qo8QQ75A== - -css-value@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/css-value/-/css-value-0.0.1.tgz#5efd6c2eea5ea1fd6b6ac57ec0427b18452424ea" - integrity sha1-Xv1sLupeof1rasV+wEJ7GEUkJOo= - -css@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d" - integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ== - dependencies: - inherits "^2.0.4" - source-map "^0.6.1" - source-map-resolve "^0.6.0" - -currently-unhandled@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" - integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= - dependencies: - array-find-index "^1.0.1" - -custom-event@~1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" - integrity sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU= - -d@1, d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" - integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== - dependencies: - es5-ext "^0.10.50" - type "^1.0.1" - -dargs@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" - integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== - -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -date-format@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-2.1.0.tgz#31d5b5ea211cf5fd764cd38baf9d033df7e125cf" - integrity sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA== - -date-format@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/date-format/-/date-format-3.0.0.tgz#eb8780365c7d2b1511078fb491e6479780f3ad95" - integrity sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w== - -dateformat@^1.0.7-1.2.3: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - integrity sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk= - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - -dateformat@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" - integrity sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI= - -dateformat@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" - integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== - -de-indent@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d" - integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0= - -debug-fabulous@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/debug-fabulous/-/debug-fabulous-1.1.0.tgz#af8a08632465224ef4174a9f06308c3c2a1ebc8e" - integrity sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg== - dependencies: - debug "3.X" - memoizee "0.4.X" - object-assign "4.X" - -debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@3.X, debug@^3.1.0, debug@^3.2.7: - version "3.2.7" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -debug@4, debug@4.3.2, debug@^4.0.0, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@~4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== - dependencies: - ms "2.1.2" - -debug@4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" - integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== - dependencies: - ms "2.1.2" - -decamelize-keys@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" - integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= - dependencies: - decamelize "^1.1.0" - map-obj "^1.0.0" - -decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decamelize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" - integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -decompress-response@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" - integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== - dependencies: - mimic-response "^3.1.0" - -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -deep-equal@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.5.tgz#55cd2fe326d83f9cbf7261ef0e060b3f724c5cb9" - integrity sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw== - dependencies: - call-bind "^1.0.0" - es-get-iterator "^1.1.1" - get-intrinsic "^1.0.1" - is-arguments "^1.0.4" - is-date-object "^1.0.2" - is-regex "^1.1.1" - isarray "^2.0.5" - object-is "^1.1.4" - object-keys "^1.1.1" - object.assign "^4.1.2" - regexp.prototype.flags "^1.3.0" - side-channel "^1.0.3" - which-boxed-primitive "^1.0.1" - which-collection "^1.0.1" - which-typed-array "^1.1.2" - -deep-is@^0.1.3, deep-is@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - -deepmerge@^4.0.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - -default-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" - integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== - dependencies: - kind-of "^5.0.2" - -default-resolution@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" - integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= - -defaults@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= - dependencies: - clone "^1.0.2" - -defer-to-connect@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" - integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== - -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -depd@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -des.js@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" - integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== - dependencies: - inherits "^2.0.1" - minimalistic-assert "^1.0.0" - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-file@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" - integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= - -detect-indent@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" - integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== - -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= - -detect-newline@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" - integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= - -detect-newline@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -detective@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" - integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== - dependencies: - acorn-node "^1.6.1" - defined "^1.0.0" - minimist "^1.1.1" - -devtools-protocol@0.0.901419: - version "0.0.901419" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.901419.tgz#79b5459c48fe7e1c5563c02bd72f8fec3e0cebcd" - integrity sha512-4INMPwNm9XRpBukhNbF7OB6fNTTCaI8pzy/fXg0xQzAy5h3zL1P8xT3QazgKqBrb/hAYwIBizqDBZ7GtJE74QQ== - -devtools-protocol@^0.0.925217: - version "0.0.925217" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.925217.tgz#ac44689c0bc6e187da5cbd71bd10ebec3761b4d1" - integrity sha512-sI7aLeM9VcH1f+HYEGWaPv2RlWmfBCsnHt/rsPzJ4MCyejvx5R5fauW1dll7OIyE6frwXoEzqi7Y0925XdFIKA== - -devtools@7.13.2: - version "7.13.2" - resolved "https://registry.yarnpkg.com/devtools/-/devtools-7.13.2.tgz#00ed825f7402aa9c28b1c15241167205edd759b9" - integrity sha512-MwxanDu5o01uoWC6CzAoJASQSJRouJmz0rUgMu+5sZYnQ2f7J5QBB4djbPfGAr7titbQcVPkzASZXg54FP2PIg== - dependencies: - "@types/node" "^15.12.5" - "@wdio/config" "7.13.2" - "@wdio/logger" "7.7.0" - "@wdio/protocols" "7.13.2" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - chrome-launcher "^0.14.0" - edge-paths "^2.1.0" - puppeteer-core "^10.1.0" - query-selector-shadow-dom "^1.0.0" - ua-parser-js "^0.7.21" - uuid "^8.0.0" - -di@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/di/-/di-0.0.1.tgz#806649326ceaa7caa3306d75d985ea2748ba913c" - integrity sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw= - -diff-sequences@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723" - integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ== - -diff@3.5.0, diff@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -diff@5.0.0, diff@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -diffie-hellman@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" - integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== - dependencies: - bn.js "^4.1.0" - miller-rabin "^4.0.0" - randombytes "^2.0.0" - -dlv@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79" - integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA== - -doctrine-temporary-fork@2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine-temporary-fork/-/doctrine-temporary-fork-2.1.0.tgz#36f2154f556ee4f1e60311d391cd23de5187ed57" - integrity sha512-nliqOv5NkE4zMON4UA6AMJE6As35afs8aYXATpU4pTUdIKiARZwrJVEP1boA3Rx1ZXHVkwxkhcq4VkqvsuRLsA== - dependencies: - esutils "^2.0.2" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -documentation@^13.2.5: - version "13.2.5" - resolved "https://registry.yarnpkg.com/documentation/-/documentation-13.2.5.tgz#2d4c8a94ce60a0342d6981d34488ad6184e463a0" - integrity sha512-d1TrfrHXYZR63xrOzkYwwe297vkSwBoEhyyMBOi20T+7Ohe1aX1dW4nqXncQmdmE5MxluSaxxa3BW1dCvbF5AQ== - dependencies: - "@babel/core" "7.12.3" - "@babel/generator" "7.12.1" - "@babel/parser" "7.12.3" - "@babel/traverse" "^7.12.1" - "@babel/types" "^7.12.1" - ansi-html "^0.0.7" - babelify "^10.0.0" - chalk "^2.3.0" - chokidar "^3.4.0" - concat-stream "^1.6.0" - diff "^4.0.1" - doctrine-temporary-fork "2.1.0" - get-port "^5.0.0" - git-url-parse "^11.1.2" - github-slugger "1.2.0" - glob "^7.1.2" - globals-docs "^2.4.0" - highlight.js "^10.7.2" - ini "^1.3.5" - js-yaml "^3.10.0" - lodash "^4.17.10" - mdast-util-find-and-replace "^1.1.1" - mdast-util-inject "^1.1.0" - micromatch "^3.1.5" - mime "^2.2.0" - module-deps-sortable "^5.0.3" - parse-filepath "^1.0.2" - pify "^5.0.0" - read-pkg-up "^4.0.0" - remark "^13.0.0" - remark-gfm "^1.0.0" - remark-html "^13.0.1" - remark-reference-links "^5.0.0" - remark-toc "^7.2.0" - resolve "^1.8.1" - stream-array "^1.1.2" - strip-json-comments "^2.0.1" - tiny-lr "^1.1.0" - unist-builder "^2.0.3" - unist-util-visit "^2.0.3" - vfile "^4.0.0" - vfile-reporter "^6.0.0" - vfile-sort "^2.1.0" - vinyl "^2.1.0" - vinyl-fs "^3.0.2" - yargs "^15.3.1" - optionalDependencies: - "@vue/compiler-sfc" "^3.0.11" - vue-template-compiler "^2.6.12" - -dom-serialize@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/dom-serialize/-/dom-serialize-2.2.1.tgz#562ae8999f44be5ea3076f5419dcd59eb43ac95b" - integrity sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs= - dependencies: - custom-event "~1.0.0" - ent "~2.2.0" - extend "^3.0.0" - void-elements "^2.0.0" - -domain-browser@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" - integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== - -dot-prop@^5.1.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88" - integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q== - dependencies: - is-obj "^2.0.0" - -dotgitignore@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/dotgitignore/-/dotgitignore-2.1.0.tgz#a4b15a4e4ef3cf383598aaf1dfa4a04bcc089b7b" - integrity sha512-sCm11ak2oY6DglEPpCB8TixLjWAxd3kJTs6UIcSasNYxXdFPV+YKlye92c8H4kKFqV5qYMIh7d+cYecEg0dIkA== - dependencies: - find-up "^3.0.0" - minimatch "^3.0.4" - -dset@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/dset/-/dset-2.0.1.tgz#a15fff3d1e4d60ac0c95634625cbd5441a76deb1" - integrity sha512-nI29OZMRYq36hOcifB6HTjajNAAiBKSXsyWZrq+VniusseuP2OpNlTiYgsaNRSGvpyq5Wjbc2gQLyBdTyWqhnQ== - -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - integrity sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds= - dependencies: - readable-stream "~1.1.9" - -duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" - integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= - dependencies: - readable-stream "^2.0.2" - -duplexer@^0.1.1, duplexer@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" - integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== - -duplexify@^3.6.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" - integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== - dependencies: - end-of-stream "^1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" - -duplexify@^4.1.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-4.1.2.tgz#18b4f8d28289132fa0b9573c898d9f903f81c7b0" - integrity sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw== - dependencies: - end-of-stream "^1.4.1" - inherits "^2.0.3" - readable-stream "^3.1.1" - stream-shift "^1.0.0" - -each-props@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" - integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== - dependencies: - is-plain-object "^2.0.1" - object.defaults "^1.1.0" - -easy-table@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/easy-table/-/easy-table-1.1.1.tgz#c1b9b9ad68a017091a1c235e4bcba277540e143f" - integrity sha512-C9Lvm0WFcn2RgxbMnTbXZenMIWcBtkzMr+dWqq/JsVoGFSVUVlPqeOa5LP5kM0I3zoOazFpckOEb2/0LDFfToQ== - dependencies: - ansi-regex "^3.0.0" - optionalDependencies: - wcwidth ">=1.0.1" - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -edge-paths@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/edge-paths/-/edge-paths-2.2.1.tgz#d2d91513225c06514aeac9843bfce546abbf4391" - integrity sha512-AI5fC7dfDmCdKo3m5y7PkYE8m6bMqR6pvVpgtrZkkhcJXFLelUgkjrhk3kXXx8Kbw2cRaTT4LkOR7hqf39KJdw== - dependencies: - "@types/which" "^1.3.2" - which "^2.0.2" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -ejs@^2.6.1: - version "2.7.4" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" - integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== - -ejs@^3.0.1: - version "3.1.6" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.6.tgz#5bfd0a0689743bb5268b3550cceeebbc1702822a" - integrity sha512-9lt9Zse4hPucPkoP7FHDF0LQAlGyF9JVpnClFLFH3aSSbxmyoqINRpp/9wePWJTUl4KOQwRL72Iw3InHPDkoGw== - dependencies: - jake "^10.6.1" - -electron-to-chromium@^1.3.854: - version "1.3.857" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.857.tgz#dcc239ff8a12b6e4b501e6a5ad20fd0d5a3210f9" - integrity sha512-a5kIr2lajm4bJ5E4D3fp8Y/BRB0Dx2VOcCRE5Gtb679mXIME/OFhWler8Gy2ksrf8gFX+EFCSIGA33FB3gqYpg== - -elliptic@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" - integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - -"emoji-regex@>=6.0.0 <=6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e" - integrity sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4= - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: - version "1.4.4" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" - integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== - dependencies: - once "^1.4.0" - -engine.io-parser@~4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/engine.io-parser/-/engine.io-parser-4.0.3.tgz#83d3a17acfd4226f19e721bb22a1ee8f7662d2f6" - integrity sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA== - dependencies: - base64-arraybuffer "0.1.4" - -engine.io@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/engine.io/-/engine.io-4.1.1.tgz#9a8f8a5ac5a5ea316183c489bf7f5b6cf91ace5b" - integrity sha512-t2E9wLlssQjGw0nluF6aYyfX8LwYU8Jj0xct+pAhfWfv/YrBn6TSNtEYsgxHIfaMqfrLx07czcMg9bMN6di+3w== - dependencies: - accepts "~1.3.4" - base64id "2.0.0" - cookie "~0.4.1" - cors "~2.8.5" - debug "~4.3.1" - engine.io-parser "~4.0.0" - ws "~7.4.2" - -enhanced-resolve@^3.4.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" - integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.4.0" - object-assign "^4.0.1" - tapable "^0.2.7" - -enhanced-resolve@~0.9.0: - version "0.9.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz#4d6e689b3725f86090927ccc86cd9f1635b89e2e" - integrity sha1-TW5omzcl+GCQknzMhs2fFjW4ni4= - dependencies: - graceful-fs "^4.1.2" - memory-fs "^0.2.0" - tapable "^0.1.8" - -enquirer@^2.3.5: - version "2.3.6" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" - integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== - dependencies: - ansi-colors "^4.1.1" - -ent@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d" - integrity sha1-6WQhkyWiHQX0RGai9obtbOX13R0= - -errno@^0.1.3: - version "0.1.8" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f" - integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A== - dependencies: - prr "~1.0.1" - -error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -error@^7.0.0: - version "7.2.1" - resolved "https://registry.yarnpkg.com/error/-/error-7.2.1.tgz#eab21a4689b5f684fc83da84a0e390de82d94894" - integrity sha512-fo9HBvWnx3NGUKMvMwB/CBCMMrfEJgbDTVDEkPygA3Bdd3lM1OyCd+rbQ8BwnpF6GdVeOLDNmyL4N5Bg80ZvdA== - dependencies: - string-template "~0.2.1" - -es-abstract@^1.18.0-next.2, es-abstract@^1.18.5, es-abstract@^1.19.0, es-abstract@^1.19.1: - version "1.19.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.1.tgz#d4885796876916959de78edaa0df456627115ec3" - integrity sha512-2vJ6tjA/UfqLm2MPs7jxVybLoB8i1t1Jd9R3kISld20sIxPcTbLuggQOUxeWeAvIUkduv/CfMjuh4WmiXr2v9w== - dependencies: - call-bind "^1.0.2" - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - get-intrinsic "^1.1.1" - get-symbol-description "^1.0.0" - has "^1.0.3" - has-symbols "^1.0.2" - internal-slot "^1.0.3" - is-callable "^1.2.4" - is-negative-zero "^2.0.1" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.1" - is-string "^1.0.7" - is-weakref "^1.0.1" - object-inspect "^1.11.0" - object-keys "^1.1.1" - object.assign "^4.1.2" - string.prototype.trimend "^1.0.4" - string.prototype.trimstart "^1.0.4" - unbox-primitive "^1.0.1" - -es-get-iterator@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.2.tgz#9234c54aba713486d7ebde0220864af5e2b283f7" - integrity sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.0" - has-symbols "^1.0.1" - is-arguments "^1.1.0" - is-map "^2.0.2" - is-set "^2.0.2" - is-string "^1.0.5" - isarray "^2.0.5" - -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: - version "0.10.53" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" - integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.3" - next-tick "~1.0.0" - -es5-shim@^4.0.5, es5-shim@^4.5.14: - version "4.6.2" - resolved "https://registry.yarnpkg.com/es5-shim/-/es5-shim-4.6.2.tgz#827cdd0c6fb5beb26fd368d65430e8b5eaeba942" - integrity sha512-n0XTVMGps+Deyr38jtqKPR5F5hb9owYeRQcKJW39eFvzUk/u/9Ww315werRzbiNMnHCUw/YHDPBphTlEnzdi+A== - -es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-symbol@^3.1.1, es6-symbol@~3.1.1, es6-symbol@~3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" - integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== - dependencies: - d "^1.0.1" - ext "^1.1.2" - -es6-weak-map@^2.0.1, es6-weak-map@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" - integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== - dependencies: - d "1" - es5-ext "^0.10.46" - es6-iterator "^2.0.3" - es6-symbol "^3.1.1" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -escodegen@1.8.x: - version "1.8.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" - integrity sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg= - dependencies: - esprima "^2.7.1" - estraverse "^1.9.1" - esutils "^2.0.2" - optionator "^0.8.1" - optionalDependencies: - source-map "~0.2.0" - -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-config-standard@^10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" - integrity sha1-wGHk0GbzedwXzVYsZOgZtN1FRZE= - -eslint-import-resolver-node@^0.3.6: - version "0.3.6" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" - integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== - dependencies: - debug "^3.2.7" - resolve "^1.20.0" - -eslint-module-utils@^2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz#94e5540dd15fe1522e8ffa3ec8db3b7fa7e7a534" - integrity sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q== - dependencies: - debug "^3.2.7" - pkg-dir "^2.0.0" - -eslint-plugin-es@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz#75a7cdfdccddc0589934aeeb384175f221c57893" - integrity sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ== - dependencies: - eslint-utils "^2.0.0" - regexpp "^3.0.0" - -eslint-plugin-import@^2.20.2: - version "2.24.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.24.2.tgz#2c8cd2e341f3885918ee27d18479910ade7bb4da" - integrity sha512-hNVtyhiEtZmpsabL4neEj+6M5DCLgpYyG9nzJY8lZQeQXEn5UPW1DpUdsMHMXsq98dbNm7nt1w9ZMSVpfJdi8Q== - dependencies: - array-includes "^3.1.3" - array.prototype.flat "^1.2.4" - debug "^2.6.9" - doctrine "^2.1.0" - eslint-import-resolver-node "^0.3.6" - eslint-module-utils "^2.6.2" - find-up "^2.0.0" - has "^1.0.3" - is-core-module "^2.6.0" - minimatch "^3.0.4" - object.values "^1.1.4" - pkg-up "^2.0.0" - read-pkg-up "^3.0.0" - resolve "^1.20.0" - tsconfig-paths "^3.11.0" - -eslint-plugin-node@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz#c95544416ee4ada26740a30474eefc5402dc671d" - integrity sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g== - dependencies: - eslint-plugin-es "^3.0.0" - eslint-utils "^2.0.0" - ignore "^5.1.1" - minimatch "^3.0.4" - resolve "^1.10.1" - semver "^6.1.0" - -"eslint-plugin-prebid@file:./plugins/eslint": - version "1.0.0" - -eslint-plugin-promise@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-5.1.0.tgz#fb2188fb734e4557993733b41aa1a688f46c6f24" - integrity sha512-NGmI6BH5L12pl7ScQHbg7tvtk4wPxxj8yPHH47NvSmMtFneC077PSeY3huFj06ZWZvtbfxSPt3RuOQD5XcR4ng== - -eslint-plugin-standard@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47" - integrity sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w== - -eslint-scope@^3.7.1: - version "3.7.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" - integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -eslint-utils@^2.0.0, eslint-utils@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-2.1.0.tgz#d2de5e03424e707dc10c74068ddedae708741b27" - integrity sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg== - dependencies: - eslint-visitor-keys "^1.1.0" - -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz#30ebd1ef7c2fdff01c3a4f151044af25fab0523e" - integrity sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ== - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - -eslint@^4.0.0: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - integrity sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ== - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" - -eslint@^7.27.0: - version "7.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.32.0.tgz#c6d328a14be3fb08c8d1d21e12c02fdb7a2a812d" - integrity sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA== - dependencies: - "@babel/code-frame" "7.12.11" - "@eslint/eslintrc" "^0.4.3" - "@humanwhocodes/config-array" "^0.5.0" - ajv "^6.10.0" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.0.1" - doctrine "^3.0.0" - enquirer "^2.3.5" - escape-string-regexp "^4.0.0" - eslint-scope "^5.1.1" - eslint-utils "^2.1.0" - eslint-visitor-keys "^2.0.0" - espree "^7.3.1" - esquery "^1.4.0" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^6.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^5.1.2" - globals "^13.6.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.0.4" - natural-compare "^1.4.0" - optionator "^0.9.1" - progress "^2.0.0" - regexpp "^3.1.0" - semver "^7.2.1" - strip-ansi "^6.0.0" - strip-json-comments "^3.1.0" - table "^6.0.9" - text-table "^0.2.0" - v8-compile-cache "^2.0.3" - -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== - dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" - -espree@^7.3.0, espree@^7.3.1: - version "7.3.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-7.3.1.tgz#f2df330b752c6f55019f8bd89b7660039c1bbbb6" - integrity sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g== - dependencies: - acorn "^7.4.0" - acorn-jsx "^5.3.1" - eslint-visitor-keys "^1.3.0" - -esprima@2.7.x, esprima@^2.7.1: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.0, esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.1.0, esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^1.9.1: - version "1.9.3" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" - integrity sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q= - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880" - integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ== - -estree-walker@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -event-emitter@^0.3.5, event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= - dependencies: - d "1" - es5-ext "~0.10.14" - -event-stream@=3.3.4: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - integrity sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE= - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - -eventemitter3@^4.0.0: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -events@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= - -events@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -exit-on-epipe@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz#0bdd92e87d5285d267daa8171d0eb06159689692" - integrity sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw== - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= - dependencies: - is-posix-bracket "^0.1.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= - dependencies: - fill-range "^2.1.0" - -expand-tilde@^2.0.0, expand-tilde@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" - integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= - dependencies: - homedir-polyfill "^1.0.1" - -expect-webdriverio@^3.0.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/expect-webdriverio/-/expect-webdriverio-3.1.3.tgz#d9c52a1bf3300fd283bb98c09b484b6cfa53645a" - integrity sha512-p9h8ntvTGAN/nXP6RRPcqnPX4t0z/Axaf3WyfhgADHXOAz1WoJu4NBZlPItPvycXyRmMZ6MBsoUoF2soSpsOtA== - dependencies: - expect "^27.0.2" - jest-matcher-utils "^27.0.2" - -expect@^27.0.2: - version "27.2.4" - resolved "https://registry.yarnpkg.com/expect/-/expect-27.2.4.tgz#4debf546050bcdad8914a8c95fec7662e02bf67c" - integrity sha512-gOtuonQ8TCnbNNCSw2fhVzRf8EFYDII4nB5NmG4IEV0rbUnW1I5zXvoTntU4iicB/Uh0oZr20NGlOLdJiwsOZA== - dependencies: - "@jest/types" "^27.2.4" - ansi-styles "^5.0.0" - jest-get-type "^27.0.6" - jest-matcher-utils "^27.2.4" - jest-message-util "^27.2.4" - jest-regex-util "^27.0.6" - -express@^4.15.4, express@^4.16.3: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -ext@^1.1.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" - integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== - dependencies: - type "^2.5.0" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -extend@^3.0.0, extend@^3.0.2, extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -external-editor@^2.0.4: - version "2.2.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" - integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== - dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" - tmp "^0.0.33" - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= - dependencies: - is-extglob "^1.0.0" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extract-zip@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -faker@^5.5.3: - version "5.5.3" - resolved "https://registry.yarnpkg.com/faker/-/faker-5.5.3.tgz#c57974ee484431b25205c2c8dc09fda861e51e0e" - integrity sha512-wLTv2a28wjUyWkbnX7u/ABZBkUkIF2fCd73V6P2oFqEGEktDfzWx4UxrSqtPRw0xPRAcjeAOIiJWqZm3pP4u3g== - -fancy-log@^1.1.0, fancy-log@^1.3.2, fancy-log@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" - integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== - dependencies: - ansi-gray "^0.1.1" - color-support "^1.1.3" - parse-node-version "^1.0.0" - time-stamp "^1.0.0" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.1.4.tgz#e6a754cc8f15e58987aa9cbd27af66fd6f4e5af9" - integrity sha1-5qdUzI8V5YmHqpy9J69m/W9OWvk= - -fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -faye-websocket@~0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" - integrity sha1-TkkvjQTftviQA1B/btvy1QHnxvQ= - dependencies: - websocket-driver ">=0.5.1" - -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - -fibers@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/fibers/-/fibers-5.0.0.tgz#3a60e0695b3ee5f6db94e62726716fa7a59acc41" - integrity sha512-UpGv/YAZp7mhKHxDvC1tColrroGRX90sSvh8RMZV9leo+e5+EkRVgCEZPlmXeo3BUNQTZxUaVdLskq1Q2FyCPg== - dependencies: - detect-libc "^1.0.3" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -figures@^3.0.0, figures@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" - integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -file-entry-cache@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" - integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== - dependencies: - flat-cache "^3.0.4" - -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - -filelist@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.2.tgz#80202f21462d4d1c2e214119b1807c1bc0380e5b" - integrity sha512-z7O0IS8Plc39rTCq6i6iHxk43duYOn8uFJiWSewIq0Bww1RNybVHSCjahmcC87ZqAm4OTvFzlzeGu3XAzG1ctQ== - dependencies: - minimatch "^3.0.4" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= - -filesize@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/filesize/-/filesize-3.6.1.tgz#090bb3ee01b6f801a8a8be99d31710b3422bb317" - integrity sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg== - -fill-range@^2.1.0: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" - integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^3.0.0" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -filter-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= - -finalhandler@1.1.2, finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-cache-dir@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" - integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== - dependencies: - commondir "^1.0.1" - make-dir "^3.0.2" - pkg-dir "^4.1.0" - -find-up@5.0.0, find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -findup-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" - integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= - dependencies: - detect-file "^1.0.0" - is-glob "^3.1.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -findup-sync@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-3.0.0.tgz#17b108f9ee512dfb7a5c7f3c8b27ea9e1a9c08d1" - integrity sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg== - dependencies: - detect-file "^1.0.0" - is-glob "^4.0.0" - micromatch "^3.0.4" - resolve-dir "^1.0.1" - -fined@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" - integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== - dependencies: - expand-tilde "^2.0.2" - is-plain-object "^2.0.3" - object.defaults "^1.1.0" - object.pick "^1.2.0" - parse-filepath "^1.0.1" - -flagged-respawn@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" - integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== - -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" - integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== - dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" - -flat-cache@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" - integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== - dependencies: - flatted "^3.1.0" - rimraf "^3.0.2" - -flat@^5.0.2: - version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" - integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== - -flatted@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138" - integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA== - -flatted@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" - integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== - -flush-write-stream@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" - integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== - dependencies: - inherits "^2.0.3" - readable-stream "^2.3.6" - -follow-redirects@^1.0.0: - version "1.14.4" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" - integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== - -for-in@^1.0.1, for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - -for-own@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" - integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= - dependencies: - for-in "^1.0.1" - -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - -foreachasync@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/foreachasync/-/foreachasync-3.0.0.tgz#5502987dc8714be3392097f32e0071c9dee07cf6" - integrity sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -fork-stream@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/fork-stream/-/fork-stream-0.0.4.tgz#db849fce77f6708a5f8f386ae533a0907b54ae70" - integrity sha1-24Sfznf2cIpfjzhq5TOgkHtUrnA= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -from@~0: - version "0.1.7" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" - integrity sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4= - -fs-access@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" - integrity sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o= - dependencies: - null-check "^1.0.0" - -fs-constants@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" - integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== - -fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - -fs-extra@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" - integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^4.0.0" - universalify "^0.1.0" - -fs-extra@~0.6.1: - version "0.6.4" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.6.4.tgz#f46f0c75b7841f8d200b3348cd4d691d5a099d15" - integrity sha1-9G8MdbeEH40gCzNIzU1pHVoJnRU= - dependencies: - jsonfile "~1.0.1" - mkdirp "0.3.x" - ncp "~0.4.2" - rimraf "~2.2.0" - -fs-mkdirp-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" - integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= - dependencies: - graceful-fs "^4.1.11" - through2 "^2.0.3" - -fs.extra@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fs.extra/-/fs.extra-1.3.2.tgz#dd023f93013bee24531f1b33514c37b20fd93349" - integrity sha1-3QI/kwE77iRTHxszUUw3sg/ZM0k= - dependencies: - fs-extra "~0.6.1" - mkdirp "~0.3.5" - walk "^2.3.9" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^1.0.0, fsevents@^1.2.7: - version "1.2.13" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" - integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== - dependencies: - bindings "^1.5.0" - nan "^2.12.1" - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -fstream@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.12.tgz#4e8ba8ee2d48be4f7d0de505455548eae5932045" - integrity sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg== - dependencies: - graceful-fs "^4.1.2" - inherits "~2.0.0" - mkdirp ">=0.5 0" - rimraf "2" - -fun-hooks@^0.9.9: - version "0.9.10" - resolved "https://registry.yarnpkg.com/fun-hooks/-/fun-hooks-0.9.10.tgz#3f123f990899f1933ca24492b97bd4989b18ee76" - integrity sha512-7xBjdT+oMYOPWgwFxNiNzF4ubeUvim4zs1DnQqSSGyxu8UD7AW/6Z0iFsVRwuVSIZKUks2en2VHHotmNfj3ipw== - dependencies: - typescript-tuple "^2.2.1" - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -gaze@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" - integrity sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g== - dependencies: - globule "^1.0.0" - -gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.1, get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - -get-intrinsic@^1.0.1, get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-pkg-repo@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-4.2.1.tgz#75973e1c8050c73f48190c52047c4cee3acbf385" - integrity sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA== - dependencies: - "@hutson/parse-repository-url" "^3.0.0" - hosted-git-info "^4.0.0" - through2 "^2.0.0" - yargs "^16.2.0" - -get-port@^5.0.0, get-port@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-5.1.1.tgz#0469ed07563479de6efb986baf053dcd7d4e3193" - integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== - -get-stdin@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" - integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-stream@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" - integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== - dependencies: - pump "^3.0.0" - -get-symbol-description@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" - integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.1" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -git-raw-commits@^2.0.8: - version "2.0.10" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.10.tgz#e2255ed9563b1c9c3ea6bd05806410290297bbc1" - integrity sha512-sHhX5lsbG9SOO6yXdlwgEMQ/ljIn7qMpAbJZCGfXX2fq5T8M5SrDnpYk9/4HswTildcIqatsWa91vty6VhWSaQ== - dependencies: - dargs "^7.0.0" - lodash "^4.17.15" - meow "^8.0.0" - split2 "^3.0.0" - through2 "^4.0.0" - -git-remote-origin-url@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" - integrity sha1-UoJlna4hBxRaERJhEq0yFuxfpl8= - dependencies: - gitconfiglocal "^1.0.0" - pify "^2.3.0" - -git-semver-tags@^4.0.0, git-semver-tags@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-4.1.1.tgz#63191bcd809b0ec3e151ba4751c16c444e5b5780" - integrity sha512-OWyMt5zBe7xFs8vglMmhM9lRQzCWL3WjHtxNNfJTMngGym7pC1kh8sP6jevfydJ6LP3ZvGxfb6ABYgPUM0mtsA== - dependencies: - meow "^8.0.0" - semver "^6.0.0" - -git-up@^4.0.0: - version "4.0.5" - resolved "https://registry.yarnpkg.com/git-up/-/git-up-4.0.5.tgz#e7bb70981a37ea2fb8fe049669800a1f9a01d759" - integrity sha512-YUvVDg/vX3d0syBsk/CKUTib0srcQME0JyHkL5BaYdwLsiCslPWmDSi8PUMo9pXYjrryMcmsCoCgsTpSCJEQaA== - dependencies: - is-ssh "^1.3.0" - parse-url "^6.0.0" - -git-url-parse@^11.1.2: - version "11.6.0" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-11.6.0.tgz#c634b8de7faa66498a2b88932df31702c67df605" - integrity sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g== - dependencies: - git-up "^4.0.0" - -gitconfiglocal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" - integrity sha1-QdBF84UaXqiPA/JMocYXgRRGS5s= - dependencies: - ini "^1.3.2" - -github-slugger@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.0.tgz#8ada3286fd046d8951c3c952a8d7854cfd90fd9a" - integrity sha512-wIaa75k1vZhyPm9yWrD08A5Xnx/V+RmzGrpjQuLemGKSb77Qukiaei58Bogrl/LZSADDfPzKJX8jhLs4CRTl7Q== - dependencies: - emoji-regex ">=6.0.0 <=6.1.1" - -github-slugger@^1.2.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.4.0.tgz#206eb96cdb22ee56fdc53a28d5a302338463444e" - integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ== - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= - dependencies: - is-glob "^2.0.0" - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-stream@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" - integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= - dependencies: - extend "^3.0.0" - glob "^7.1.1" - glob-parent "^3.1.0" - is-negated-glob "^1.0.0" - ordered-read-streams "^1.0.0" - pumpify "^1.3.5" - readable-stream "^2.1.5" - remove-trailing-separator "^1.0.1" - to-absolute-glob "^2.0.0" - unique-stream "^2.0.2" - -glob-watcher@^5.0.3: - version "5.0.5" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.5.tgz#aa6bce648332924d9a8489be41e3e5c52d4186dc" - integrity sha512-zOZgGGEHPklZNjZQaZ9f41i7F2YwE+tS5ZHrDhbBCk3stwahn5vQxnFmBJZHoYdusR6R1bLSXeGUy/BhctwKzw== - dependencies: - anymatch "^2.0.0" - async-done "^1.2.0" - chokidar "^2.0.0" - is-negated-glob "^1.0.0" - just-debounce "^1.0.0" - normalize-path "^3.0.0" - object.defaults "^1.1.0" - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@7.1.7, glob@~7.1.1: - version "7.1.7" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" - integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^5.0.15: - version "5.0.15" - resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" - integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "2 || 3" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.7: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -global-modules@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" - integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== - dependencies: - global-prefix "^1.0.1" - is-windows "^1.0.1" - resolve-dir "^1.0.0" - -global-prefix@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" - integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= - dependencies: - expand-tilde "^2.0.2" - homedir-polyfill "^1.0.1" - ini "^1.3.4" - is-windows "^1.0.1" - which "^1.2.14" - -globals-docs@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/globals-docs/-/globals-docs-2.4.1.tgz#d16887709f4a15eb22d97e96343591f87a2ee3db" - integrity sha512-qpPnUKkWnz8NESjrCvnlGklsgiQzlq+rcCxoG5uNQ+dNA7cFMCmn231slLAwS2N/PlkzZ3COL8CcS10jXmLHqg== - -globals@^11.0.1, globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globals@^13.6.0, globals@^13.9.0: - version "13.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.11.0.tgz#40ef678da117fe7bd2e28f1fab24951bd0255be7" - integrity sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g== - dependencies: - type-fest "^0.20.2" - -globule@^1.0.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/globule/-/globule-1.3.3.tgz#811919eeac1ab7344e905f2e3be80a13447973c2" - integrity sha512-mb1aYtDbIjTu4ShMB85m3UzjX9BVKe9WCzsnfMSZk+K5GpIbBOexgg4PPCt5eHDEG5/ZQAUX2Kct02zfiPLsKg== - dependencies: - glob "~7.1.1" - lodash "~4.17.10" - minimatch "~3.0.2" - -glogg@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" - integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== - dependencies: - sparkles "^1.0.0" - -got@^11.0.2, got@^11.8.1: - version "11.8.2" - resolved "https://registry.yarnpkg.com/got/-/got-11.8.2.tgz#7abb3959ea28c31f3576f1576c1effce23f33599" - integrity sha512-D0QywKgIe30ODs+fm8wMZiAcZjypcCodPNuMz5H9Mny7RJ+IjJ10BdmGW7OM7fHXP+O7r6ZwapQ/YQmMSvB0UQ== - dependencies: - "@sindresorhus/is" "^4.0.0" - "@szmarczak/http-timer" "^4.0.5" - "@types/cacheable-request" "^6.0.1" - "@types/responselike" "^1.0.0" - cacheable-lookup "^5.0.3" - cacheable-request "^7.0.1" - decompress-response "^6.0.0" - http2-wrapper "^1.0.0-beta.5.2" - lowercase-keys "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== - -grapheme-splitter@^1.0.2: - version "1.0.4" - resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" - integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -gulp-clean@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/gulp-clean/-/gulp-clean-0.3.2.tgz#a347d473acea40182f935587a451941671928102" - integrity sha1-o0fUc6zqQBgvk1WHpFGUFnGSgQI= - dependencies: - gulp-util "^2.2.14" - rimraf "^2.2.8" - through2 "^0.4.2" - -gulp-cli@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.3.0.tgz#ec0d380e29e52aa45e47977f0d32e18fd161122f" - integrity sha512-zzGBl5fHo0EKSXsHzjspp3y5CONegCm8ErO5Qh0UzFzk2y4tMvzLWhoDokADbarfZRL2pGpRp7yt6gfJX4ph7A== - dependencies: - ansi-colors "^1.0.1" - archy "^1.0.0" - array-sort "^1.0.0" - color-support "^1.1.3" - concat-stream "^1.6.0" - copy-props "^2.0.1" - fancy-log "^1.3.2" - gulplog "^1.0.0" - interpret "^1.4.0" - isobject "^3.0.1" - liftoff "^3.1.0" - matchdep "^2.0.0" - mute-stdout "^1.0.0" - pretty-hrtime "^1.0.0" - replace-homedir "^1.0.0" - semver-greatest-satisfied-range "^1.1.0" - v8flags "^3.2.0" - yargs "^7.1.0" - -gulp-concat@^2.6.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/gulp-concat/-/gulp-concat-2.6.1.tgz#633d16c95d88504628ad02665663cee5a4793353" - integrity sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M= - dependencies: - concat-with-sourcemaps "^1.0.0" - through2 "^2.0.0" - vinyl "^2.0.0" - -gulp-connect@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/gulp-connect/-/gulp-connect-5.7.0.tgz#7e925f5e4c34ebfedf9f318576966e8fe8840d5a" - integrity sha512-8tRcC6wgXMLakpPw9M7GRJIhxkYdgZsXwn7n56BA2bQYGLR9NOPhMzx7js+qYDy6vhNkbApGKURjAw1FjY4pNA== - dependencies: - ansi-colors "^2.0.5" - connect "^3.6.6" - connect-livereload "^0.6.0" - fancy-log "^1.3.2" - map-stream "^0.0.7" - send "^0.16.2" - serve-index "^1.9.1" - serve-static "^1.13.2" - tiny-lr "^1.1.1" - -gulp-eslint@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-4.0.2.tgz#18a2a6768e4404cbf3e203239cb57474168fa606" - integrity sha512-fcFUQzFsN6dJ6KZlG+qPOEkqfcevRUXgztkYCvhNvJeSvOicC8ucutN4qR/ID8LmNZx9YPIkBzazTNnVvbh8wg== - dependencies: - eslint "^4.0.0" - fancy-log "^1.3.2" - plugin-error "^1.0.0" - -gulp-footer@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/gulp-footer/-/gulp-footer-2.0.2.tgz#2cf58e1cc046b8a3a479f1a41bcd1b7baae076cd" - integrity sha512-HsG5VOgKHFRqZXnHGI6oGhPDg70p9pobM+dYOnjBZVLMQUHzLG6bfaPNRJ7XG707E+vWO3TfN0CND9UrYhk94g== - dependencies: - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.6.2" - map-stream "0.0.7" - -gulp-header@^2.0.9: - version "2.0.9" - resolved "https://registry.yarnpkg.com/gulp-header/-/gulp-header-2.0.9.tgz#8b432c4d4379dee6788845b16785b09c7675af84" - integrity sha512-LMGiBx+qH8giwrOuuZXSGvswcIUh0OiioNkUpLhNyvaC6/Ga8X6cfAeme2L5PqsbXMhL8o8b/OmVqIQdxprhcQ== - dependencies: - concat-with-sourcemaps "^1.1.0" - lodash.template "^4.5.0" - map-stream "0.0.7" - through2 "^2.0.0" - -gulp-if@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/gulp-if/-/gulp-if-3.0.0.tgz#6c3e7edc8bafadc34f2ebecb314bf43324ba1e40" - integrity sha512-fCUEngzNiEZEK2YuPm+sdMpO6ukb8+/qzbGfJBXyNOXz85bCG7yBI+pPSl+N90d7gnLvMsarthsAImx0qy7BAw== - dependencies: - gulp-match "^1.1.0" - ternary-stream "^3.0.0" - through2 "^3.0.1" - -gulp-js-escape@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/gulp-js-escape/-/gulp-js-escape-1.0.1.tgz#1cd445fbd009e0da76959a03a7f49b3566aff868" - integrity sha1-HNRF+9AJ4Np2lZoDp/SbNWav+Gg= - dependencies: - through2 "^0.6.3" - -gulp-match@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/gulp-match/-/gulp-match-1.1.0.tgz#552b7080fc006ee752c90563f9fec9d61aafdf4f" - integrity sha512-DlyVxa1Gj24DitY2OjEsS+X6tDpretuxD6wTfhXE/Rw2hweqc1f6D/XtsJmoiCwLWfXgR87W9ozEityPCVzGtQ== - dependencies: - minimatch "^3.0.3" - -gulp-replace@^1.0.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/gulp-replace/-/gulp-replace-1.1.3.tgz#8641cdca78e683e8573ca4a012e7e4ebb7e4db60" - integrity sha512-HcPHpWY4XdF8zxYkDODHnG2+7a3nD/Y8Mfu3aBgMiCFDW3X2GiOKXllsAmILcxe3KZT2BXoN18WrpEFm48KfLQ== - dependencies: - "@types/node" "^14.14.41" - "@types/vinyl" "^2.0.4" - istextorbinary "^3.0.0" - replacestream "^4.0.3" - yargs-parser ">=5.0.0-security.0" - -gulp-shell@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/gulp-shell/-/gulp-shell-0.8.0.tgz#0ed4980de1d0c67e5f6cce971d7201fd0be50555" - integrity sha512-wHNCgmqbWkk1c6Gc2dOL5SprcoeujQdeepICwfQRo91DIylTE7a794VEE+leq3cE2YDoiS5ulvRfKVIEMazcTQ== - dependencies: - chalk "^3.0.0" - fancy-log "^1.3.3" - lodash.template "^4.5.0" - plugin-error "^1.0.1" - through2 "^3.0.1" - tslib "^1.10.0" - -gulp-sourcemaps@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-3.0.0.tgz#2e154e1a2efed033c0e48013969e6f30337b2743" - integrity sha512-RqvUckJkuYqy4VaIH60RMal4ZtG0IbQ6PXMNkNsshEGJ9cldUPRb/YCgboYae+CLAs1HQNb4ADTKCx65HInquQ== - dependencies: - "@gulp-sourcemaps/identity-map" "^2.0.1" - "@gulp-sourcemaps/map-sources" "^1.0.0" - acorn "^6.4.1" - convert-source-map "^1.0.0" - css "^3.0.0" - debug-fabulous "^1.0.0" - detect-newline "^2.0.0" - graceful-fs "^4.0.0" - source-map "^0.6.0" - strip-bom-string "^1.0.0" - through2 "^2.0.0" - -gulp-terser@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/gulp-terser/-/gulp-terser-2.1.0.tgz#149b693a1adbde922807b60b844bb7351dafbde1" - integrity sha512-lQ3+JUdHDVISAlUIUSZ/G9Dz/rBQHxOiYDQ70IVWFQeh4b33TC1MCIU+K18w07PS3rq/CVc34aQO4SUbdaNMPQ== - dependencies: - plugin-error "^1.0.1" - terser "^5.9.0" - through2 "^4.0.2" - vinyl-sourcemaps-apply "^0.2.1" - -gulp-util@^2.2.14: - version "2.2.20" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-2.2.20.tgz#d7146e5728910bd8f047a6b0b1e549bc22dbd64c" - integrity sha1-1xRuVyiRC9jwR6awseVJvCLb1kw= - dependencies: - chalk "^0.5.0" - dateformat "^1.0.7-1.2.3" - lodash._reinterpolate "^2.4.1" - lodash.template "^2.4.1" - minimist "^0.2.0" - multipipe "^0.1.0" - through2 "^0.5.0" - vinyl "^0.2.1" - -gulp-util@^3.0.0, gulp-util@^3.0.7: - version "3.0.8" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08= - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^2.0.0" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulp@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.2.tgz#543651070fd0f6ab0a0650c6a3e6ff5a7cb09caa" - integrity sha512-dvEs27SCZt2ibF29xYgmnwwCYZxdxhQ/+LFWlbAW8y7jt68L/65402Lz3+CKy0Ov4rOs+NERmDq7YlZaDqUIfA== - dependencies: - glob-watcher "^5.0.3" - gulp-cli "^2.2.0" - undertaker "^1.2.1" - vinyl-fs "^3.0.0" - -gulplog@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" - integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= - dependencies: - glogg "^1.0.0" - -gzip-size@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" - integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== - dependencies: - duplexer "^0.1.1" - pify "^4.0.1" - -handlebars@^4.0.1, handlebars@^4.7.6: - version "4.7.7" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" - integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== - dependencies: - minimist "^1.2.5" - neo-async "^2.6.0" - source-map "^0.6.1" - wordwrap "^1.0.0" - optionalDependencies: - uglify-js "^3.1.4" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.3: - version "5.1.5" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd" - integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w== - dependencies: - ajv "^6.12.3" - har-schema "^2.0.0" - -hard-rejection@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" - integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== - -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - integrity sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4= - dependencies: - ansi-regex "^0.2.0" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-bigints@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" - integrity sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA== - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - integrity sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4= - dependencies: - sparkles "^1.0.0" - -has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" - integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.1" - -hast-util-is-element@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.1.0.tgz#3b3ed5159a2707c6137b48637fbfe068e175a425" - integrity sha512-oUmNua0bFbdrD/ELDSSEadRVtWZOf3iF6Lbv81naqsIV99RnSCieTbWuWCY8BAeEfKJTKl0gRdokv+dELutHGQ== - -hast-util-sanitize@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/hast-util-sanitize/-/hast-util-sanitize-3.0.2.tgz#b0b783220af528ba8fe6999f092d138908678520" - integrity sha512-+2I0x2ZCAyiZOO/sb4yNLFmdwPBnyJ4PBkVTUMKMqBwYNA+lXSgOmoRXlJFazoyid9QPogRRKgKhVEodv181sA== - dependencies: - xtend "^4.0.0" - -hast-util-to-html@^7.0.0: - version "7.1.3" - resolved "https://registry.yarnpkg.com/hast-util-to-html/-/hast-util-to-html-7.1.3.tgz#9f339ca9bea71246e565fc79ff7dbfe98bb50f5e" - integrity sha512-yk2+1p3EJTEE9ZEUkgHsUSVhIpCsL/bvT8E5GzmWc+N1Po5gBw+0F8bo7dpxXR0nu0bQVxVZGX2lBGF21CmeDw== - dependencies: - ccount "^1.0.0" - comma-separated-tokens "^1.0.0" - hast-util-is-element "^1.0.0" - hast-util-whitespace "^1.0.0" - html-void-elements "^1.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - stringify-entities "^3.0.1" - unist-util-is "^4.0.0" - xtend "^4.0.0" - -hast-util-whitespace@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz#e4fe77c4a9ae1cb2e6c25e02df0043d0164f6e41" - integrity sha512-I5GTdSfhYfAPNztx2xJRQpG8cuDSNt599/7YUn7Gx/WxNMsG+a835k97TDkFgk123cwjfwINaZknkKkphx/f2A== - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -he@1.2.0, he@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -highlight.js@^10.7.2: - version "10.7.3" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" - integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== - -hmac-drbg@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" - integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= - dependencies: - hash.js "^1.0.3" - minimalistic-assert "^1.0.0" - minimalistic-crypto-utils "^1.0.1" - -homedir-polyfill@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" - integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== - dependencies: - parse-passwd "^1.0.0" - -hoopy@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/hoopy/-/hoopy-0.1.4.tgz#609207d661100033a9a9402ad3dea677381c1b1d" - integrity sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ== - -hosted-git-info@^2.1.4: - version "2.8.9" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" - integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== - -hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== - dependencies: - lru-cache "^6.0.0" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -html-void-elements@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.5.tgz#ce9159494e86d95e45795b166c2021c2cfca4483" - integrity sha512-uE/TxKuyNIcx44cIWnjr/rfIATDH7ZaOMmstu0CwhFG1Dunhlp4OC6/NMbhiwoq5BpW0ubi303qnEk/PZj614w== - -http-cache-semantics@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" - integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== - -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-parser-js@>=0.5.1: - version "0.5.3" - resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" - integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== - -http-proxy@^1.18.1: - version "1.18.1" - resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" - integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - -http2-wrapper@^1.0.0-beta.5.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" - integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== - dependencies: - quick-lru "^5.1.1" - resolve-alpn "^1.0.0" - -https-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" - integrity sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI= - -https-browserify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" - integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= - -https-proxy-agent@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" - integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== - dependencies: - agent-base "6" - debug "4" - -https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== - dependencies: - agent-base "^4.3.0" - debug "^3.1.0" - -https-proxy-agent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b" - integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg== - dependencies: - agent-base "5" - debug "4" - -iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ieee754@^1.1.13, ieee754@^1.1.4: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - -ignore@^3.3.3: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -ignore@^5.1.1: - version "5.1.8" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" - integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== - -import-fresh@^3.0.0, import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= - dependencies: - repeating "^2.0.0" - -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" - integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" - integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.2, ini@^1.3.4, ini@^1.3.5: - version "1.3.8" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" - integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== - -inquirer@8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.1.5.tgz#2dc5159203c826d654915b5fe6990fd17f54a150" - integrity sha512-G6/9xUqmt/r+UvufSyrPpt84NYwhKZ9jLsgMbQzlx804XErNupor8WQdBnBRrXmBfTPpuwf1sV+ss2ovjgdXIg== - dependencies: - ansi-escapes "^4.2.1" - chalk "^4.1.1" - cli-cursor "^3.1.0" - cli-width "^3.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.21" - mute-stream "0.0.8" - ora "^5.4.1" - run-async "^2.4.0" - rxjs "^7.2.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" - integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -internal-slot@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" - integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== - dependencies: - get-intrinsic "^1.1.0" - has "^1.0.3" - side-channel "^1.0.4" - -interpret@^0.6.4: - version "0.6.6" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-0.6.6.tgz#fecd7a18e7ce5ca6abfb953e1f86213a49f1625b" - integrity sha1-/s16GOfOXKar+5U+H4YhOknxYls= - -interpret@^1.0.0, interpret@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" - integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-absolute@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" - integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== - dependencies: - is-relative "^1.0.0" - is-windows "^1.0.1" - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-alphabetical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" - integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== - -is-alphanumerical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" - integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A== - dependencies: - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - -is-arguments@^1.0.4, is-arguments@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-bigint@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" - integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== - dependencies: - has-bigints "^1.0.1" - -is-binary-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" - integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= - dependencies: - binary-extensions "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-boolean-object@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" - integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@^2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" - integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== - -is-callable@^1.1.4, is-callable@^1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" - integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== - -is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.6.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.7.0.tgz#3c0ef7d31b4acfc574f80c58409d568a836848e3" - integrity sha512-ByY+tjCciCr+9nLryBYcSD50EOGWt95c7tIsKTG1J2ixKKXPvF7Ej3AVd+UfDydAJom3biBGDBALaO79ktwgEQ== - dependencies: - has "^1.0.3" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1, is-date-object@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -is-decimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" - integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-docker@^2.0.0, is-docker@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-finite@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" - integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= - dependencies: - is-extglob "^1.0.0" - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-hexadecimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" - integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== - -is-interactive@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" - integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== - -is-map@^2.0.1, is-map@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" - integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== - -is-negated-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" - integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= - -is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== - -is-number-object@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.6.tgz#6a7aaf838c7f0686a50b4553f7e54a96494e89f0" - integrity sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g== - dependencies: - has-tostringtag "^1.0.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-number@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" - integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-obj@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" - integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== - -is-plain-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" - integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= - -is-plain-obj@^2.0.0, is-plain-obj@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= - -is-promise@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" - integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== - -is-regex@^1.1.1, is-regex@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-relative@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" - integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== - dependencies: - is-unc-path "^1.0.0" - -is-resolvable@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== - -is-running@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-running/-/is-running-2.1.0.tgz#30a73ff5cc3854e4fc25490809e9f5abf8de09e0" - integrity sha1-MKc/9cw4VOT8JUkICen1q/jeCeA= - -is-set@^2.0.1, is-set@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" - integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== - -is-shared-array-buffer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.1.tgz#97b0c85fbdacb59c9c446fe653b82cf2b5b7cfe6" - integrity sha512-IU0NmyknYZN0rChcKhRO1X8LYz5Isj/Fsqh8NJOSf+N/hCOTwy29F32Ik7a+QszE63IdvmwdTPDd6cZ5pg4cwA== - -is-ssh@^1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/is-ssh/-/is-ssh-1.3.3.tgz#7f133285ccd7f2c2c7fc897b771b53d95a2b2c7e" - integrity sha512-NKzJmQzJfEEma3w5cJNcUMxoXfDjz0Zj0eyCalHn2E6VOwlzjZo0yuO2fcBSf8zhFuVCL/82/r5gRcoi6aEPVQ== - dependencies: - protocols "^1.1.0" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-string@^1.0.5, is-string@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" - integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== - dependencies: - has-tostringtag "^1.0.0" - -is-symbol@^1.0.2, is-symbol@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" - integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== - dependencies: - has-symbols "^1.0.2" - -is-text-path@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" - integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= - dependencies: - text-extensions "^1.0.0" - -is-typed-array@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.8.tgz#cbaa6585dc7db43318bc5b89523ea384a6f65e79" - integrity sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - -is-unc-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" - integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== - dependencies: - unc-path-regex "^0.1.2" - -is-unicode-supported@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" - integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== - -is-utf8@^0.2.0, is-utf8@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= - -is-valid-glob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" - integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= - -is-weakmap@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" - integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== - -is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== - dependencies: - call-bind "^1.0.0" - -is-weakset@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" - integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== - -is-windows@^1.0.1, is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -is-wsl@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" - integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= - -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= - -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - -isbinaryfile@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/isbinaryfile/-/isbinaryfile-4.0.8.tgz#5d34b94865bd4946633ecc78a026fc76c5b11fcf" - integrity sha512-53h6XFniq77YdW+spoRrebh0mnmTxRPTlcuIArO57lmMdq4uBKFKaeTjnb92oYWrSn/LVL+LT+Hap2tFQj8V+w== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -istanbul-lib-coverage@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" - integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== - -istanbul-lib-coverage@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.1.tgz#e8900b3ed6069759229cf30f7067388d148aeb5e" - integrity sha512-GvCYYTxaCPqwMjobtVcVKvSHtAGe48MNhGjpK8LtVF8K0ISX7hCKl85LgtuaSneWVyQmaGcW3iXVV3GaZSLpmQ== - -istanbul-lib-instrument@^4.0.1, istanbul-lib-instrument@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" - integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== - dependencies: - "@babel/core" "^7.7.5" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.0.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" - integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^2.0.5" - make-dir "^2.1.0" - rimraf "^2.6.3" - source-map "^0.6.1" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9" - integrity sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.0.0, istanbul-reports@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" - integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -istanbul@^0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" - integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= - dependencies: - abbrev "1.0.x" - async "1.x" - escodegen "1.8.x" - esprima "2.7.x" - glob "^5.0.15" - handlebars "^4.0.1" - js-yaml "3.x" - mkdirp "0.5.x" - nopt "3.x" - once "1.x" - resolve "1.1.x" - supports-color "^3.1.0" - which "^1.1.1" - wordwrap "^1.0.0" - -istextorbinary@^3.0.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/istextorbinary/-/istextorbinary-3.3.0.tgz#06b1c57d948da11461bd237c00ce09e9902964f2" - integrity sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ== - dependencies: - binaryextensions "^2.2.0" - textextensions "^3.2.0" - -jake@^10.6.1: - version "10.8.2" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" - integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== - dependencies: - async "0.9.x" - chalk "^2.4.2" - filelist "^1.0.1" - minimatch "^3.0.4" - -jest-diff@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.2.4.tgz#171c51d3d2c105c457100fee6e7bf7cee51c8d8c" - integrity sha512-bLAVlDSCR3gqUPGv+4nzVpEXGsHh98HjUL7Vb2hVyyuBDoQmja8eJb0imUABsuxBeUVmf47taJSAd9nDrwWKEg== - dependencies: - chalk "^4.0.0" - diff-sequences "^27.0.6" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-get-type@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.0.6.tgz#0eb5c7f755854279ce9b68a9f1a4122f69047cfe" - integrity sha512-XTkK5exIeUbbveehcSR8w0bhH+c0yloW/Wpl+9vZrjzztCPWrxhHwkIFpZzCt71oRBsgxmuUfxEqOYoZI2macg== - -jest-matcher-utils@^27.0.2, jest-matcher-utils@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.2.4.tgz#008fff018151415ad1b6cfc083fd70fe1e012525" - integrity sha512-nQeLfFAIPPkyhkDfifAPfP/U5wm1x0fLtAzqXZSSKckXDNuk2aaOfQiDYv1Mgf5GY6yOsxfUnvNm3dDjXM+BXw== - dependencies: - chalk "^4.0.0" - jest-diff "^27.2.4" - jest-get-type "^27.0.6" - pretty-format "^27.2.4" - -jest-message-util@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.2.4.tgz#667e8c0f2b973156d1bac7398a7f677705cafaca" - integrity sha512-wbKT/BNGnBVB9nzi+IoaLkXt6fbSvqUxx+IYY66YFh96J3goY33BAaNG3uPqaw/Sh/FR9YpXGVDfd5DJdbh4nA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.2.4" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.4" - micromatch "^4.0.4" - pretty-format "^27.2.4" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-regex-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-27.0.6.tgz#02e112082935ae949ce5d13b2675db3d8c87d9c5" - integrity sha512-SUhPzBsGa1IKm8hx2F4NfTGGp+r7BXJ4CulsZ1k2kI+mGLG+lxGrs76veN2LF/aUdGosJBzKgXmNCw+BzFqBDQ== - -js-tokens@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" - integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@3.x, js-yaml@^3.10.0, js-yaml@^3.13.1, js-yaml@^3.9.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-loader@^0.5.4: - version "0.5.7" - resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" - integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -json5@^0.5.0, json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -jsonfile@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" - integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" - integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== - dependencies: - universalify "^2.0.0" - optionalDependencies: - graceful-fs "^4.1.6" - -jsonfile@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-1.0.1.tgz#ea5efe40b83690b98667614a7392fc60e842c0dd" - integrity sha1-6l7+QLg2kLmGZ2FKc5L8YOhCwN0= - -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -just-clone@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/just-clone/-/just-clone-1.0.2.tgz#bfb3faef65aa12a316058712945c326fd8f01434" - integrity sha1-v7P672WqEqMWBYcSlFwyb9jwFDQ= - -just-debounce@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.1.0.tgz#2f81a3ad4121a76bc7cb45dbf704c0d76a8e5ddf" - integrity sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ== - -just-extend@^4.0.2: - version "4.2.1" - resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.2.1.tgz#ef5e589afb61e5d66b24eca749409a8939a8c744" - integrity sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg== - -karma-babel-preprocessor@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/karma-babel-preprocessor/-/karma-babel-preprocessor-8.0.1.tgz#63b33cc7b5b3b5c7815ec453f7df58fb88345af1" - integrity sha512-5upyawNi3c7Gg6tPH1FWRVTmUijGf3v1GV4ScLM/2jKdDP18SlaKlUpu8eJrRI3STO8qK1bkqFcdgAA364nLYQ== - -karma-browserstack-launcher@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/karma-browserstack-launcher/-/karma-browserstack-launcher-1.4.0.tgz#22f92e969d2db6cfc00e578708bda39378d5f2ab" - integrity sha512-bUQK84U+euDfOUfEjcF4IareySMOBNRLrrl9q6cttIe8f011Ir6olLITTYMOJDcGY58wiFIdhPHSPd9Pi6+NfQ== - dependencies: - browserstack "~1.5.1" - browserstacktunnel-wrapper "~2.0.2" - q "~1.5.0" - -karma-chai@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/karma-chai/-/karma-chai-0.1.0.tgz#bee5ad40400517811ae34bb945f762909108b79a" - integrity sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o= - -karma-chrome-launcher@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz#805a586799a4d05f4e54f72a204979f3f3066738" - integrity sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg== - dependencies: - which "^1.2.1" - -karma-coverage-istanbul-reporter@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-3.0.3.tgz#f3b5303553aadc8e681d40d360dfdc19bc7e9fe9" - integrity sha512-wE4VFhG/QZv2Y4CdAYWDbMmcAHeS926ZIji4z+FkB2aF/EposRb6DP6G5ncT/wXhqUfAb/d7kZrNKPonbvsATw== - dependencies: - istanbul-lib-coverage "^3.0.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^3.0.6" - istanbul-reports "^3.0.2" - minimatch "^3.0.4" - -karma-coverage@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/karma-coverage/-/karma-coverage-2.0.3.tgz#c10f4711f4cf5caaaa668b1d6f642e7da122d973" - integrity sha512-atDvLQqvPcLxhED0cmXYdsPMCQuh6Asa9FMZW1bhNqlVEhJoB9qyZ2BY1gu7D/rr5GLGb5QzYO4siQskxaWP/g== - dependencies: - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^4.0.1" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.0.0" - minimatch "^3.0.4" - -karma-es5-shim@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/karma-es5-shim/-/karma-es5-shim-0.0.4.tgz#cdd00333cce77c2e4ce03e3ac93f2f8ecd1fb952" - integrity sha1-zdADM8znfC5M4D46yT8vjs0fuVI= - dependencies: - es5-shim "^4.0.5" - -karma-firefox-launcher@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/karma-firefox-launcher/-/karma-firefox-launcher-2.1.1.tgz#6457226f8e4f091b664cef79bb5d39bf1e008765" - integrity sha512-VzDMgPseXak9DtfyE1O5bB2BwsMy1zzO1kUxVW1rP0yhC4tDNJ0p3JoFdzvrK4QqVzdqUMa9Rx9YzkdFp8hz3Q== - dependencies: - is-wsl "^2.2.0" - which "^2.0.1" - -karma-ie-launcher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz#497986842c490190346cd89f5494ca9830c6d59c" - integrity sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw= - dependencies: - lodash "^4.6.1" - -karma-mocha-reporter@^2.2.5: - version "2.2.5" - resolved "https://registry.yarnpkg.com/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz#15120095e8ed819186e47a0b012f3cd741895560" - integrity sha1-FRIAlejtgZGG5HoLAS8810GJVWA= - dependencies: - chalk "^2.1.0" - log-symbols "^2.1.0" - strip-ansi "^4.0.0" - -karma-mocha@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-2.0.1.tgz#4b0254a18dfee71bdbe6188d9a6861bf86b0cd7d" - integrity sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ== - dependencies: - minimist "^1.2.3" - -karma-opera-launcher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-opera-launcher/-/karma-opera-launcher-1.0.0.tgz#fa51628531a1d0be84b2d8dc0d7ee209fc8ff91a" - integrity sha1-+lFihTGh0L6EstjcDX7iCfyP+Ro= - -karma-safari-launcher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz#96982a2cc47d066aae71c553babb28319115a2ce" - integrity sha1-lpgqLMR9BmquccVTursoMZEVos4= - -karma-script-launcher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/karma-script-launcher/-/karma-script-launcher-1.0.0.tgz#cd017c4de5ef09e5a9da793276176108dd4b542d" - integrity sha1-zQF8TeXvCeWp2nkydhdhCN1LVC0= - -karma-sinon@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/karma-sinon/-/karma-sinon-1.0.5.tgz#4e3443f2830fdecff624d3747163f1217daa2a9a" - integrity sha1-TjRD8oMP3s/2JNN0cWPxIX2qKpo= - -karma-sourcemap-loader@^0.3.7: - version "0.3.8" - resolved "https://registry.yarnpkg.com/karma-sourcemap-loader/-/karma-sourcemap-loader-0.3.8.tgz#d4bae72fb7a8397328a62b75013d2df937bdcf9c" - integrity sha512-zorxyAakYZuBcHRJE+vbrK2o2JXLFWK8VVjiT/6P+ltLBUGUvqTEkUiQ119MGdOrK7mrmxXHZF1/pfT6GgIZ6g== - dependencies: - graceful-fs "^4.1.2" - -karma-spec-reporter@^0.0.32: - version "0.0.32" - resolved "https://registry.yarnpkg.com/karma-spec-reporter/-/karma-spec-reporter-0.0.32.tgz#2e9c7207ea726771260259f82becb543209e440a" - integrity sha1-LpxyB+pyZ3EmAln4K+y1QyCeRAo= - dependencies: - colors "^1.1.2" - -karma-webpack@^3.0.5: - version "3.0.5" - resolved "https://registry.yarnpkg.com/karma-webpack/-/karma-webpack-3.0.5.tgz#1ff1e3a690fb73ae95ee95f9ab58f341cfc7b40f" - integrity sha512-nRudGJWstvVuA6Tbju9tyGUfXTtI1UXMXoRHVmM2/78D0q6s/Ye2IC157PKNDC15PWFGR0mVIRtWLAdcfsRJoA== - dependencies: - async "^2.0.0" - babel-runtime "^6.0.0" - loader-utils "^1.0.0" - lodash "^4.0.0" - source-map "^0.5.6" - webpack-dev-middleware "^2.0.6" - -karma@^6.3.2: - version "6.3.4" - resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.4.tgz#359899d3aab3d6b918ea0f57046fd2a6b68565e6" - integrity sha512-hbhRogUYIulfkBTZT7xoPrCYhRBnBoqbbL4fszWD0ReFGUxU+LYBr3dwKdAluaDQ/ynT9/7C+Lf7pPNW4gSx4Q== - dependencies: - body-parser "^1.19.0" - braces "^3.0.2" - chokidar "^3.5.1" - colors "^1.4.0" - connect "^3.7.0" - di "^0.0.1" - dom-serialize "^2.2.1" - glob "^7.1.7" - graceful-fs "^4.2.6" - http-proxy "^1.18.1" - isbinaryfile "^4.0.8" - lodash "^4.17.21" - log4js "^6.3.0" - mime "^2.5.2" - minimatch "^3.0.4" - qjobs "^1.2.0" - range-parser "^1.2.1" - rimraf "^3.0.2" - socket.io "^3.1.0" - source-map "^0.6.1" - tmp "^0.2.1" - ua-parser-js "^0.7.28" - yargs "^16.1.1" - -keyv@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.0.3.tgz#4f3aa98de254803cafcd2896734108daa35e4254" - integrity sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA== - dependencies: - json-buffer "3.0.1" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0, kind-of@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -konan@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/konan/-/konan-2.1.1.tgz#eea88f05c56249b78903b952b953393900346dd1" - integrity sha512-7ZhYV84UzJ0PR/RJnnsMZcAbn+kLasJhVNWsu8ZyVEJYRpGA5XESQ9d/7zOa08U0Ou4cmB++hMNY/3OSV9KIbg== - dependencies: - "@babel/parser" "^7.10.5" - "@babel/traverse" "^7.10.5" - -ky@^0.28.5: - version "0.28.5" - resolved "https://registry.yarnpkg.com/ky/-/ky-0.28.5.tgz#4b7ada24fb0440c3898406f3a4986abe60ba213e" - integrity sha512-O5gg9kF4MeyfSw+YkgPAafOPwEUU6xcdGEJKUJmKpIPbLzk3oxUtY4OdBNekG7mawofzkyZ/ZHuR9ev5uZZdAA== - -last-run@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" - integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= - dependencies: - default-resolution "^2.0.0" - es6-weak-map "^2.0.1" - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= - -lazystream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" - integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= - dependencies: - readable-stream "^2.0.5" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= - dependencies: - invert-kv "^1.0.0" - -lcov-parse@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-1.0.0.tgz#eb0d46b54111ebc561acb4c408ef9363bdc8f7e0" - integrity sha1-6w1GtUER68VhrLTECO+TY73I9+A= - -lead@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" - integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= - dependencies: - flush-write-stream "^1.0.2" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -liftoff@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" - integrity sha512-DlIPlJUkCV0Ips2zf2pJP0unEoT1kwYhiiPUGF3s/jtxTCjziNLoiVVh+jqWOWeFi6mmwQ5fNxvAUyPad4Dfog== - dependencies: - extend "^3.0.0" - findup-sync "^3.0.0" - fined "^1.0.1" - flagged-respawn "^1.0.0" - is-plain-object "^2.0.4" - object.map "^1.0.0" - rechoir "^0.6.2" - resolve "^1.1.7" - -lighthouse-logger@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/lighthouse-logger/-/lighthouse-logger-1.3.0.tgz#ba6303e739307c4eee18f08249524e7dafd510db" - integrity sha512-BbqAKApLb9ywUli+0a+PcV04SyJ/N1q/8qgCNe6U97KbPCS1BTksEuHFLYdvc8DltuhfxIUBqDZsC0bBGtl3lA== - dependencies: - debug "^2.6.9" - marky "^1.2.2" - -lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= - -listenercount@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/listenercount/-/listenercount-1.0.1.tgz#84c8a72ab59c4725321480c975e6508342e70937" - integrity sha1-hMinKrWcRyUyFIDJdeZQg0LnCTc= - -live-connect-js@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/live-connect-js/-/live-connect-js-2.0.0.tgz#1ad26e04ddece44e7cf7d902ab8003f6bc0b10f4" - integrity sha512-Xhrj1JU5LoLjJuujjTlvDfc/n3Shzk2hPlYmLdCx/lsltFFVuCFa9uM8u5mcHlmOUKP5pu9I54bAITxZBMHoXg== - dependencies: - tiny-hashes "1.0.1" - -livereload-js@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.4.0.tgz#447c31cf1ea9ab52fc20db615c5ddf678f78009c" - integrity sha512-XPQH8Z2GDP/Hwz2PCDrh2mth4yFejwA1OZ/81Ti3LgKyhDcEjsSsqFWZojHG0va/duGd+WyosY7eXLDoOyqcPw== - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" - integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - -loader-runner@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - -loader-utils@^0.2.11: - version "0.2.17" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348" - integrity sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g= - dependencies: - big.js "^3.1.3" - emojis-list "^2.0.0" - json5 "^0.5.0" - object-assign "^4.0.1" - -loader-utils@^1.0.0, loader-utils@^1.1.0, loader-utils@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^1.0.1" - -loader-utils@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0" - integrity sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - integrity sha1-jaDmqHbPNEwK2KVIghEd08XHyjY= - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - integrity sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U= - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - integrity sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc= - -lodash._escapehtmlchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz#df67c3bb6b7e8e1e831ab48bfa0795b92afe899d" - integrity sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0= - dependencies: - lodash._htmlescapes "~2.4.1" - -lodash._escapestringchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz#ecfe22618a2ade50bfeea43937e51df66f0edb72" - integrity sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I= - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - -lodash._htmlescapes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz#32d14bf0844b6de6f8b62a051b4f67c228b624cb" - integrity sha1-MtFL8IRLbeb4tioFG09nwii2JMs= - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - integrity sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw= - -lodash._isnative@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._isnative/-/lodash._isnative-2.4.1.tgz#3ea6404b784a7be836c7b57580e1cdf79b14832c" - integrity sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw= - -lodash._objecttypes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz#7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11" - integrity sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE= - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - integrity sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo= - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - integrity sha1-WLx0xAZklTrgsSTYBpltrKQx4u0= - -lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222" - integrity sha1-TxInqlqHEfxjL1sHofRgequLMiI= - -lodash._reinterpolate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" - integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= - -lodash._reunescapedhtml@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz#747c4fc40103eb3bb8a0976e571f7a2659e93ba7" - integrity sha1-dHxPxAED6zu4oJduVx96JlnpO6c= - dependencies: - lodash._htmlescapes "~2.4.1" - lodash.keys "~2.4.1" - -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= - -lodash._shimkeys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz#6e9cc9666ff081f0b5a6c978b83e242e6949d203" - integrity sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM= - dependencies: - lodash._objecttypes "~2.4.1" - -lodash.clone@^4.3.2: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= - -lodash.debounce@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" - integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= - -lodash.defaults@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" - integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= - -lodash.defaults@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-2.4.1.tgz#a7e8885f05e68851144b6e12a8f3678026bc4c54" - integrity sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ= - dependencies: - lodash._objecttypes "~2.4.1" - lodash.keys "~2.4.1" - -lodash.difference@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.difference/-/lodash.difference-4.5.0.tgz#9ccb4e505d486b91651345772885a2df27fd017c" - integrity sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw= - -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - integrity sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg= - dependencies: - lodash._root "^3.0.0" - -lodash.escape@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-2.4.1.tgz#2ce12c5e084db0a57dda5e5d1eeeb9f5d175a3b4" - integrity sha1-LOEsXghNsKV92l5dHu659dF1o7Q= - dependencies: - lodash._escapehtmlchar "~2.4.1" - lodash._reunescapedhtml "~2.4.1" - lodash.keys "~2.4.1" - -lodash.flatten@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" - integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= - -lodash.flattendeep@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" - integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= - -lodash.get@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" - integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - integrity sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U= - -lodash.ismatch@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" - integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= - -lodash.isobject@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d" - integrity sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0= - -lodash.isobject@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" - integrity sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU= - dependencies: - lodash._objecttypes "~2.4.1" - -lodash.isplainobject@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - integrity sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo= - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash.keys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-2.4.1.tgz#48dea46df8ff7632b10d706b8acb26591e2b3727" - integrity sha1-SN6kbfj/djKxDXBrissmWR4rNyc= - dependencies: - lodash._isnative "~2.4.1" - lodash._shimkeys "~2.4.1" - lodash.isobject "~2.4.1" - -lodash.merge@^4.6.1, lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - integrity sha1-feoh2MGNdwOifHBMFdO4SmfjOv8= - -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - -lodash.some@^4.2.2: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= - -lodash.template@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-2.4.1.tgz#9e611007edf629129a974ab3c48b817b3e1cf20d" - integrity sha1-nmEQB+32KRKal0qzxIuBez4c8g0= - dependencies: - lodash._escapestringchar "~2.4.1" - lodash._reinterpolate "~2.4.1" - lodash.defaults "~2.4.1" - lodash.escape "~2.4.1" - lodash.keys "~2.4.1" - lodash.templatesettings "~2.4.1" - lodash.values "~2.4.1" - -lodash.template@^3.0.0, lodash.template@^3.6.2: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - integrity sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8= - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - -lodash.template@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" - integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.templatesettings "^4.0.0" - -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - integrity sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU= - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - -lodash.templatesettings@^4.0.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz#e481310f049d3cf6d47e912ad09313b154f0fb33" - integrity sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ== - dependencies: - lodash._reinterpolate "^3.0.0" - -lodash.templatesettings@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz#ea76c75d11eb86d4dbe89a83893bb861929ac699" - integrity sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk= - dependencies: - lodash._reinterpolate "~2.4.1" - lodash.escape "~2.4.1" - -lodash.truncate@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" - integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= - -lodash.union@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88" - integrity sha1-SLtQiECfFvGCFmZkHETdGqrjzYg= - -lodash.values@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-2.4.1.tgz#abf514436b3cb705001627978cbcf30b1280eea4" - integrity sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ= - dependencies: - lodash.keys "~2.4.1" - -lodash.zip@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" - integrity sha1-7GZi5IlkCO1KtsVCo5kLcswIACA= - -lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0, lodash@^4.6.1, lodash@~4.17.10: - version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -log-driver@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" - integrity sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg== - -log-symbols@4.1.0, log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - -log-symbols@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -log4js@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.3.0.tgz#10dfafbb434351a3e30277a00b9879446f715bcb" - integrity sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw== - dependencies: - date-format "^3.0.0" - debug "^4.1.1" - flatted "^2.0.1" - rfdc "^1.1.4" - streamroller "^2.2.4" - -loglevel-plugin-prefix@^0.8.4: - version "0.8.4" - resolved "https://registry.yarnpkg.com/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz#2fe0e05f1a820317d98d8c123e634c1bd84ff644" - integrity sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g== - -loglevel@^1.6.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197" - integrity sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw== - -loglevelnext@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/loglevelnext/-/loglevelnext-1.0.5.tgz#36fc4f5996d6640f539ff203ba819641680d75a2" - integrity sha512-V/73qkPuJmx4BcBF19xPBr+0ZRVBhc4POxvZTZdMeXpJ4NItXSJ/MSwuFT0kQJlCbXvdlZoQQ/418bS1y9Jh6A== - dependencies: - es6-symbol "^3.1.1" - object.assign "^4.1.0" - -lolex@^2.2.0: - version "2.7.5" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733" - integrity sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q== - -lolex@^5.0.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367" - integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A== - dependencies: - "@sinonjs/commons" "^1.7.0" - -longest-streak@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" - integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= - -loud-rejection@^1.0.0, loud-rejection@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" - integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= - dependencies: - currently-unhandled "^0.4.1" - signal-exit "^3.0.0" - -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" - integrity sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM= - dependencies: - es5-ext "~0.10.2" - -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== - dependencies: - sourcemap-codec "^1.4.4" - -make-dir@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" - integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== - dependencies: - pify "^4.0.1" - semver "^5.6.0" - -make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-iterator@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" - integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== - dependencies: - kind-of "^6.0.2" - -map-cache@^0.2.0, map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-obj@^1.0.0, map-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" - integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= - -map-obj@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" - integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== - -map-stream@0.0.7, map-stream@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.0.7.tgz#8a1f07896d82b10926bd3744a2420009f88974a8" - integrity sha1-ih8HiW2CsQkmvTdEokIACfiJdKg= - -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" - integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -markdown-table@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" - integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A== - dependencies: - repeat-string "^1.0.0" - -marky@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/marky/-/marky-1.2.2.tgz#4456765b4de307a13d263a69b0c79bf226e68323" - integrity sha512-k1dB2HNeaNyORco8ulVEhctyEGkKHb2YWAhDsxeFlW2nROIirsctBYzKwwS3Vza+sKTS1zO4Z+n9/+9WbGLIxQ== - -matchdep@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" - integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= - dependencies: - findup-sync "^2.0.0" - micromatch "^3.0.4" - resolve "^1.4.0" - stack-trace "0.0.10" - -math-random@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" - integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== - -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - -mdast-util-definitions@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" - integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== - dependencies: - unist-util-visit "^2.0.0" - -mdast-util-find-and-replace@^1.1.0, mdast-util-find-and-replace@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz#b7db1e873f96f66588c321f1363069abf607d1b5" - integrity sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA== - dependencies: - escape-string-regexp "^4.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - -mdast-util-from-markdown@^0.8.0: - version "0.8.5" - resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz#d1ef2ca42bc377ecb0463a987910dae89bd9a28c" - integrity sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ== - dependencies: - "@types/mdast" "^3.0.0" - mdast-util-to-string "^2.0.0" - micromark "~2.11.0" - parse-entities "^2.0.0" - unist-util-stringify-position "^2.0.0" - -mdast-util-gfm-autolink-literal@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz#9c4ff399c5ddd2ece40bd3b13e5447d84e385fb7" - integrity sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A== - dependencies: - ccount "^1.0.0" - mdast-util-find-and-replace "^1.1.0" - micromark "^2.11.3" - -mdast-util-gfm-strikethrough@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz#45eea337b7fff0755a291844fbea79996c322890" - integrity sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA== - dependencies: - mdast-util-to-markdown "^0.6.0" - -mdast-util-gfm-table@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz#af05aeadc8e5ee004eeddfb324b2ad8c029b6ecf" - integrity sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ== - dependencies: - markdown-table "^2.0.0" - mdast-util-to-markdown "~0.6.0" - -mdast-util-gfm-task-list-item@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz#70c885e6b9f543ddd7e6b41f9703ee55b084af10" - integrity sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A== - dependencies: - mdast-util-to-markdown "~0.6.0" - -mdast-util-gfm@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz#8ecddafe57d266540f6881f5c57ff19725bd351c" - integrity sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ== - dependencies: - mdast-util-gfm-autolink-literal "^0.1.0" - mdast-util-gfm-strikethrough "^0.2.0" - mdast-util-gfm-table "^0.1.0" - mdast-util-gfm-task-list-item "^0.1.0" - mdast-util-to-markdown "^0.6.1" - -mdast-util-inject@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mdast-util-inject/-/mdast-util-inject-1.1.0.tgz#db06b8b585be959a2dcd2f87f472ba9b756f3675" - integrity sha1-2wa4tYW+lZotzS+H9HK6m3VvNnU= - dependencies: - mdast-util-to-string "^1.0.0" - -mdast-util-to-hast@^10.0.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" - integrity sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ== - dependencies: - "@types/mdast" "^3.0.0" - "@types/unist" "^2.0.0" - mdast-util-definitions "^4.0.0" - mdurl "^1.0.0" - unist-builder "^2.0.0" - unist-util-generated "^1.0.0" - unist-util-position "^3.0.0" - unist-util-visit "^2.0.0" - -mdast-util-to-markdown@^0.6.0, mdast-util-to-markdown@^0.6.1, mdast-util-to-markdown@~0.6.0: - version "0.6.5" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" - integrity sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^2.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - -mdast-util-to-string@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.1.0.tgz#27055500103f51637bd07d01da01eb1967a43527" - integrity sha512-jVU0Nr2B9X3MU4tSK7JP1CMkSvOj7X5l/GboG1tKRw52lLF1x2Ju92Ms9tNetCcbfX3hzlM73zYo2NKkWSfF/A== - -mdast-util-to-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" - integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== - -mdast-util-toc@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/mdast-util-toc/-/mdast-util-toc-5.1.0.tgz#3af0f9c9a764b993538af03f1f79f4e3cec22736" - integrity sha512-csimbRIVkiqc+PpFeKDGQ/Ck2N4f9FYH3zzBMMJzcxoKL8m+cM0n94xXm0I9eaxHnKdY9n145SGTdyJC7i273g== - dependencies: - "@types/mdast" "^3.0.3" - "@types/unist" "^2.0.3" - extend "^3.0.2" - github-slugger "^1.2.1" - mdast-util-to-string "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit "^2.0.0" - -mdurl@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" - integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4= - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - -memoizee@0.4.X: - version "0.4.15" - resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" - integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== - dependencies: - d "^1.0.1" - es5-ext "^0.10.53" - es6-weak-map "^2.0.3" - event-emitter "^0.3.5" - is-promise "^2.2.2" - lru-queue "^0.1.0" - next-tick "^1.1.0" - timers-ext "^0.1.7" - -memory-fs@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" - integrity sha1-8rslNovBIeORwlIN6Slpyu4KApA= - -memory-fs@^0.3.0, memory-fs@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20" - integrity sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -memory-fs@^0.4.0, memory-fs@~0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" - integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= - dependencies: - errno "^0.1.3" - readable-stream "^2.0.1" - -meow@^3.3.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" - integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= - dependencies: - camelcase-keys "^2.0.0" - decamelize "^1.1.2" - loud-rejection "^1.0.0" - map-obj "^1.0.1" - minimist "^1.1.3" - normalize-package-data "^2.3.4" - object-assign "^4.0.1" - read-pkg-up "^1.0.1" - redent "^1.0.0" - trim-newlines "^1.0.0" - -meow@^8.0.0: - version "8.1.2" - resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" - integrity sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q== - dependencies: - "@types/minimist" "^1.2.0" - camelcase-keys "^6.2.2" - decamelize-keys "^1.1.0" - hard-rejection "^2.1.0" - minimist-options "4.1.0" - normalize-package-data "^3.0.0" - read-pkg-up "^7.0.1" - redent "^3.0.0" - trim-newlines "^3.0.0" - type-fest "^0.18.0" - yargs-parser "^20.2.3" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-source-map@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" - integrity sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw== - dependencies: - source-map "^0.6.1" - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromark-extension-gfm-autolink-literal@~0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz#53866c1f0c7ef940ae7ca1f72c6faef8fed9f204" - integrity sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw== - dependencies: - micromark "~2.11.3" - -micromark-extension-gfm-strikethrough@~0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz#96cb83356ff87bf31670eefb7ad7bba73e6514d1" - integrity sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm-table@~0.4.0: - version "0.4.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz#4d49f1ce0ca84996c853880b9446698947f1802b" - integrity sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm-tagfilter@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" - integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== - -micromark-extension-gfm-task-list-item@~0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz#d90c755f2533ed55a718129cee11257f136283b8" - integrity sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ== - dependencies: - micromark "~2.11.0" - -micromark-extension-gfm@^0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz#36d1a4c089ca8bdfd978c9bd2bf1a0cb24e2acfe" - integrity sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A== - dependencies: - micromark "~2.11.0" - micromark-extension-gfm-autolink-literal "~0.5.0" - micromark-extension-gfm-strikethrough "~0.6.5" - micromark-extension-gfm-table "~0.4.0" - micromark-extension-gfm-tagfilter "~0.3.0" - micromark-extension-gfm-task-list-item "~0.3.0" - -micromark@^2.11.3, micromark@~2.11.0, micromark@~2.11.3: - version "2.11.4" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" - integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - -micromatch@^2.1.5: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.5: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -miller-rabin@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" - integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== - dependencies: - bn.js "^4.0.0" - brorand "^1.0.1" - -mime-db@1.50.0: - version "1.50.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" - integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== - -mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.33" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" - integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== - dependencies: - mime-db "1.50.0" - -mime@1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6" - integrity sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ== - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mime@^2.1.0, mime@^2.2.0, mime@^2.5.2: - version "2.5.2" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe" - integrity sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mimic-response@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" - integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== - -mimic-response@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" - integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== - -min-indent@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" - integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== - -minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimalistic-crypto-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" - integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= - -"minimatch@2 || 3", minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist-options@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" - integrity sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A== - dependencies: - arrify "^1.0.1" - is-plain-obj "^1.1.0" - kind-of "^6.0.3" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.1.tgz#827ba4e7593464e7c221e8c5bed930904ee2c455" - integrity sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg== - -minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0, minimist@^1.2.3, minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.3.x, mkdirp@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.5.tgz#de3e5f8961c88c787ee1368df849ac4413eca8d7" - integrity sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc= - -mkdirp@0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.0: - version "0.5.5" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -mkdirp@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -mocha@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - -mocha@^9.0.0: - version "9.1.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.1.2.tgz#93f53175b0f0dc4014bd2d612218fccfcf3534d3" - integrity sha512-ta3LtJ+63RIBP03VBjMGtSqbe6cWXRejF9SyM9Zyli1CKZJZ+vfCTj3oW24V7wAphMJdpOFLoMI3hjJ1LWbs0w== - dependencies: - "@ungap/promise-all-settled" "1.1.2" - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.2" - debug "4.3.2" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.1.7" - growl "1.10.5" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "3.0.4" - ms "2.1.3" - nanoid "3.1.25" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - which "2.0.2" - workerpool "6.1.5" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" - -modify-values@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" - integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== - -module-deps-sortable@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/module-deps-sortable/-/module-deps-sortable-5.0.3.tgz#e640e7450e0869f4ae8e03437665ca2a8a28f843" - integrity sha512-eiyIZj/A0dj1o4ywXWqicazUL3l0HP3TydUR6xF0X3xh3LGBMLqW8a9aFe6MuNH4mxNMk53QKBHM6LOPR8kSgw== - dependencies: - JSONStream "^1.0.3" - browser-resolve "^1.7.0" - cached-path-relative "^1.0.0" - concat-stream "~1.5.0" - defined "^1.0.0" - detective "^5.2.0" - duplexer2 "^0.1.2" - inherits "^2.0.1" - konan "^2.1.1" - readable-stream "^2.0.2" - resolve "^1.1.3" - standard-version "^9.0.0" - stream-combiner2 "^1.1.1" - subarg "^1.0.0" - through2 "^2.0.0" - xtend "^4.0.0" - -morgan@^1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7" - integrity sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ== - dependencies: - basic-auth "~2.0.1" - debug "2.6.9" - depd "~2.0.0" - on-finished "~2.3.0" - on-headers "~1.0.2" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multipipe@^0.1.0, multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - integrity sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s= - dependencies: - duplexer2 "0.0.2" - -mute-stdout@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" - integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -mute-stream@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - -nan@^2.12.1: - version "2.15.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" - integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== - -nanocolors@^0.2.12, nanocolors@^0.2.2: - version "0.2.12" - resolved "https://registry.yarnpkg.com/nanocolors/-/nanocolors-0.2.12.tgz#4d05932e70116078673ea4cc6699a1c56cc77777" - integrity sha512-SFNdALvzW+rVlzqexid6epYdt8H9Zol7xDoQarioEFcFN0JHo4CYNztAxmtfgGTVRCmFlEOqqhBpoFGKqSAMug== - -nanoid@3.1.25: - version "3.1.25" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" - integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== - -nanoid@^3.1.25: - version "3.1.28" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.28.tgz#3c01bac14cb6c5680569014cc65a2f26424c6bd4" - integrity sha512-gSu9VZ2HtmoKYe/lmyPFES5nknFrHa+/DT9muUFWFMi6Jh9E1I7bkvlQ8xxf1Kos9pi9o8lBnIOkatMhKX/YUw== - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -ncp@~0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574" - integrity sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ= - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -neo-async@^2.5.0, neo-async@^2.6.0: - version "2.6.2" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -next-tick@1, next-tick@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" - integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== - -next-tick@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" - integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -nise@^1.2.0: - version "1.5.3" - resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.3.tgz#9d2cfe37d44f57317766c6e9408a359c5d3ac1f7" - integrity sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ== - dependencies: - "@sinonjs/formatio" "^3.2.1" - "@sinonjs/text-encoding" "^0.7.1" - just-extend "^4.0.2" - lolex "^5.0.1" - path-to-regexp "^1.7.0" - -node-fetch@2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== - -node-libs-browser@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-0.7.0.tgz#3e272c0819e308935e26674408d7af0e1491b83b" - integrity sha1-PicsCBnjCJNeJmdECNevDhSRuDs= - dependencies: - assert "^1.1.1" - browserify-zlib "^0.1.4" - buffer "^4.9.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "3.3.0" - domain-browser "^1.1.1" - events "^1.0.0" - https-browserify "0.0.1" - os-browserify "^0.2.0" - path-browserify "0.0.0" - process "^0.11.0" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.0.5" - stream-browserify "^2.0.1" - stream-http "^2.3.1" - string_decoder "^0.10.25" - timers-browserify "^2.0.2" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.10.3" - vm-browserify "0.0.4" - -node-libs-browser@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" - -node-releases@^1.1.76: - version "1.1.77" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.77.tgz#50b0cfede855dd374e7585bf228ff34e57c1c32e" - integrity sha512-rB1DUFUNAN4Gn9keO2K1efO35IDK7yKHCdCaIMvFO7yUYmmZYeDjnGKle26G4rwj+LKRQpjyUUvMkPglwGCYNQ== - -nopt@3.x: - version "3.0.6" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" - integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= - dependencies: - abbrev "1" - -normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= - dependencies: - remove-trailing-separator "^1.0.1" - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -normalize-url@^6.0.1, normalize-url@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" - integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== - -now-and-later@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" - integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== - dependencies: - once "^1.3.2" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -null-check@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/null-check/-/null-check-1.0.0.tgz#977dffd7176012b9ec30d2a39db5cf72a0439edd" - integrity sha1-l33/1xdgErnsMNKjnbXPcqBDnt0= - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -object-assign@4.X, object-assign@^4, object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-inspect@^1.10.3, object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== - -object-is@^1.1.4: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-keys@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" - integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@^4.0.4, object.assign@^4.1.0, object.assign@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940" - integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ== - dependencies: - call-bind "^1.0.0" - define-properties "^1.1.3" - has-symbols "^1.0.1" - object-keys "^1.1.1" - -object.defaults@^1.0.0, object.defaults@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" - integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= - dependencies: - array-each "^1.0.1" - array-slice "^1.0.0" - for-own "^1.0.0" - isobject "^3.0.0" - -object.map@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" - integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -object.pick@^1.2.0, object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -object.reduce@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" - integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= - dependencies: - for-own "^1.0.0" - make-iterator "^1.0.0" - -object.values@^1.1.4: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" - integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - es-abstract "^1.19.1" - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - -once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -onetime@^5.1.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -opener@^1.5.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" - integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== - -opn@^5.4.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc" - integrity sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA== - dependencies: - is-wsl "^1.1.0" - -optimist@~0.6.0: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" - integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.6" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - word-wrap "~1.2.3" - -optionator@^0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" - integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== - dependencies: - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - word-wrap "^1.2.3" - -ora@^5.4.1: - version "5.4.1" - resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" - integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== - dependencies: - bl "^4.1.0" - chalk "^4.1.0" - cli-cursor "^3.1.0" - cli-spinners "^2.5.0" - is-interactive "^1.0.0" - is-unicode-supported "^0.1.0" - log-symbols "^4.1.0" - strip-ansi "^6.0.0" - wcwidth "^1.0.1" - -ordered-read-streams@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" - integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= - dependencies: - readable-stream "^2.0.1" - -os-browserify@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" - integrity sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8= - -os-browserify@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" - integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= - -os-locale@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" - integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= - dependencies: - lcid "^1.0.0" - -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -p-cancelable@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" - integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-iteration@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/p-iteration/-/p-iteration-1.1.8.tgz#14df726d55af368beba81bcc92a26bb1b48e714a" - integrity sha512-IMFBSDIYcPNnW7uWYGrBqmvTiq7W0uB0fJn6shQZs7dlF3OvrHOre+JT9ikSZ7gZS3vWqclVgoQSvToJrns7uQ== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0, p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -pako@~0.2.0: - version "0.2.9" - resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" - integrity sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU= - -pako@~1.0.5: - version "1.0.11" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" - integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-asn1@^5.0.0, parse-asn1@^5.1.5: - version "5.1.6" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.6.tgz#385080a3ec13cb62a62d39409cb3e88844cdaed4" - integrity sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw== - dependencies: - asn1.js "^5.2.0" - browserify-aes "^1.0.0" - evp_bytestokey "^1.0.0" - pbkdf2 "^3.0.3" - safe-buffer "^5.1.1" - -parse-entities@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" - integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - -parse-filepath@^1.0.1, parse-filepath@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" - integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= - dependencies: - is-absolute "^1.0.0" - map-cache "^0.2.0" - path-root "^0.1.1" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -parse-json@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parse-ms@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" - integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== - -parse-node-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" - integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== - -parse-passwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" - integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= - -parse-path@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-4.0.3.tgz#82d81ec3e071dcc4ab49aa9f2c9c0b8966bb22bf" - integrity sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA== - dependencies: - is-ssh "^1.3.0" - protocols "^1.4.0" - qs "^6.9.4" - query-string "^6.13.8" - -parse-url@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-6.0.0.tgz#f5dd262a7de9ec00914939220410b66cff09107d" - integrity sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw== - dependencies: - is-ssh "^1.3.0" - normalize-url "^6.1.0" - parse-path "^4.0.0" - protocols "^1.4.0" - -parseurl@~1.3.2, parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" - integrity sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo= - -path-browserify@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" - integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-root-regex@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" - integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= - -path-root@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" - integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= - dependencies: - path-root-regex "^0.1.0" - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-to-regexp@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.8.0.tgz#887b3ba9d84393e87a0a0b9f4cb756198b53548a" - integrity sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA== - dependencies: - isarray "0.0.1" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= - dependencies: - pify "^2.0.0" - -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== - dependencies: - pify "^3.0.0" - -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" - integrity sha1-/lo0sMvOErWqaitAPuLnO2AvFEU= - dependencies: - through "~2.3" - -pbkdf2-compat@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz#b6e0c8fa99494d94e0511575802a59a5c142f288" - integrity sha1-tuDI+plJTZTgURV1gCpZpcFC8og= - -pbkdf2@^3.0.3: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" - integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== - dependencies: - create-hash "^1.1.2" - create-hmac "^1.1.4" - ripemd160 "^2.0.1" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== - -pify@^2.0.0, pify@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pify@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" - integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== - -pify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-5.0.0.tgz#1f5eca3f5e87ebec28cc6d54a0e4aaf00acc127f" - integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= - -pkg-dir@4.2.0, pkg-dir@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - -pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f" - integrity sha1-yBmscoBZpGHKscOImivjxJoATX8= - dependencies: - find-up "^2.1.0" - -plugin-error@^1.0.0, plugin-error@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" - integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== - dependencies: - ansi-colors "^1.0.1" - arr-diff "^4.0.0" - arr-union "^3.1.0" - extend-shallow "^3.0.2" - -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -postcss@^7.0.16: - version "7.0.38" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.38.tgz#5365a9c5126643d977046ad239f60eadda2491d6" - integrity sha512-wNrSHWjHDQJR/IZL5IKGxRtFgrYNaAA/UrkW2WqbtZO6uxSLMxMN+s2iqUMwnAWm3fMROlDYZB41dr0Mt7vBwQ== - dependencies: - nanocolors "^0.2.2" - source-map "^0.6.1" - -postcss@^8.1.10: - version "8.3.8" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.8.tgz#9ebe2a127396b4b4570ae9f7770e7fb83db2bac1" - integrity sha512-GT5bTjjZnwDifajzczOC+r3FI3Cu+PgPvrsjhQdRqa2kTJ4968/X9CUce9xttIB0xOs5c6xf0TCWZo/y9lF6bA== - dependencies: - nanocolors "^0.2.2" - nanoid "^3.1.25" - source-map-js "^0.6.2" - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= - -pretty-format@^27.2.4: - version "27.2.4" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.2.4.tgz#08ea39c5eab41b082852d7093059a091f6ddc748" - integrity sha512-NUjw22WJHldzxyps2YjLZkUj6q1HvjqFezkB9Y2cklN8NtVZN/kZEXGZdFw4uny3oENzV5EEMESrkI0YDUH8vg== - dependencies: - "@jest/types" "^27.2.4" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-hrtime@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" - integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= - -pretty-ms@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" - integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== - dependencies: - parse-ms "^2.1.0" - -printj@~1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/printj/-/printj-1.1.2.tgz#d90deb2975a8b9f600fb3a1c94e3f4c53c78a222" - integrity sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ== - -process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= - -process@^0.11.0, process@^0.11.10: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= - -progress@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.1.tgz#c9242169342b1c29d275889c95734621b1952e31" - integrity sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -property-information@^5.0.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" - integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== - dependencies: - xtend "^4.0.0" - -protocols@^1.1.0, protocols@^1.4.0: - version "1.4.8" - resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8" - integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg== - -proxy-addr@~2.0.5: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -proxy-from-env@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - -prr@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" - integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= - -ps-tree@=1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.2.0.tgz#5e7425b89508736cdd4f2224d028f7bb3f722ebd" - integrity sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA== - dependencies: - event-stream "=3.3.4" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== - -public-encrypt@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" - integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== - dependencies: - bn.js "^4.1.0" - browserify-rsa "^4.0.0" - create-hash "^1.1.0" - parse-asn1 "^5.0.0" - randombytes "^2.0.1" - safe-buffer "^5.1.2" - -pump@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" - integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -pumpify@^1.3.5: - version "1.5.1" - resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" - integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== - dependencies: - duplexify "^3.6.0" - inherits "^2.0.3" - pump "^2.0.0" - -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - -punycode@^1.2.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0, punycode@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -puppeteer-core@^10.1.0: - version "10.4.0" - resolved "https://registry.yarnpkg.com/puppeteer-core/-/puppeteer-core-10.4.0.tgz#4e2da57c52339b8c07cd9362922020eb3c3c95bf" - integrity sha512-KU8zyb7AIOqNjLCN3wkrFXxh+EVaG+zrs2P03ATNjc3iwSxHsu5/EvZiREpQ/IJiT9xfQbDVgKcsvRuzLCxglQ== - dependencies: - debug "4.3.1" - devtools-protocol "0.0.901419" - extract-zip "2.0.1" - https-proxy-agent "5.0.0" - node-fetch "2.6.1" - pkg-dir "4.2.0" - progress "2.0.1" - proxy-from-env "1.1.0" - rimraf "3.0.2" - tar-fs "2.0.0" - unbzip2-stream "1.3.3" - ws "7.4.6" - -q@^1.5.1, q@~1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - -qjobs@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.2.0.tgz#c45e9c61800bd087ef88d7e256423bdd49e5d071" - integrity sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg== - -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - -qs@^6.4.0, qs@^6.9.4: - version "6.10.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.10.1.tgz#4931482fa8d647a5aab799c5271d2133b981fb6a" - integrity sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg== - dependencies: - side-channel "^1.0.4" - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -query-selector-shadow-dom@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.0.tgz#8fa7459a4620f094457640e74e953a9dbe61a38e" - integrity sha512-bK0/0cCI+R8ZmOF1QjT7HupDUYCxbf/9TJgAmSXQxZpftXmTAeil9DRoCnTDkWbvOyZzhcMBwKpptWcdkGFIMg== - -query-string@^6.13.8: - version "6.14.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" - integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== - dependencies: - decode-uri-component "^0.2.0" - filter-obj "^1.1.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" - -querystring-es3@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" - integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== - -quick-lru@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" - integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== - -quick-lru@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" - integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== - -randomatic@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" - integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== - dependencies: - is-number "^4.0.0" - kind-of "^6.0.0" - math-random "^1.0.1" - -randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -randomfill@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" - integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== - dependencies: - randombytes "^2.0.5" - safe-buffer "^5.1.0" - -range-parser@^1.0.3, range-parser@^1.2.1, range-parser@~1.2.0, range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - -raw-body@~1.1.0: - version "1.1.7" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-1.1.7.tgz#1d027c2bfa116acc6623bca8f00016572a87d425" - integrity sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU= - dependencies: - bytes "1" - string_decoder "0.10" - -react-is@^17.0.1: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" - integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= - dependencies: - find-up "^2.0.0" - read-pkg "^3.0.0" - -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - -read-pkg-up@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-7.0.1.tgz#f3a6135758459733ae2b95638056e1854e7ef507" - integrity sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg== - dependencies: - find-up "^4.1.0" - read-pkg "^5.2.0" - type-fest "^0.8.1" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - -read-pkg@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" - integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= - dependencies: - load-json-file "^4.0.0" - normalize-package-data "^2.3.2" - path-type "^3.0.0" - -read-pkg@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" - integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== - dependencies: - "@types/normalize-package-data" "^2.4.0" - normalize-package-data "^2.5.0" - parse-json "^5.0.0" - type-fest "^0.6.0" - -"readable-stream@2 || 3", readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17: - version "1.0.34" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" - integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@~1.1.9: - version "1.1.14" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" - integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "0.0.1" - string_decoder "~0.10.x" - -readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readable-stream@~2.1.0: - version "2.1.5" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" - integrity sha1-ZvqLcg4UOLNkaB8q0aY8YYRIydA= - dependencies: - buffer-shims "^1.0.0" - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - -readdir-glob@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/readdir-glob/-/readdir-glob-1.1.1.tgz#f0e10bb7bf7bfa7e0add8baffdc54c3f7dbee6c4" - integrity sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA== - dependencies: - minimatch "^3.0.4" - -readdirp@^2.0.0, readdirp@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" - integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== - dependencies: - graceful-fs "^4.1.11" - micromatch "^3.1.10" - readable-stream "^2.0.2" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= - dependencies: - resolve "^1.1.6" - -recursive-readdir@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" - integrity sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg== - dependencies: - minimatch "3.0.4" - -redent@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" - integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= - dependencies: - indent-string "^2.1.0" - strip-indent "^1.0.1" - -redent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" - integrity sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg== - dependencies: - indent-string "^4.0.0" - strip-indent "^3.0.0" - -regenerate-unicode-properties@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326" - integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA== - dependencies: - regenerate "^1.4.2" - -regenerate@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" - integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== - -regenerator-runtime@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" - integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== - -regenerator-runtime@^0.13.4: - version "0.13.9" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" - integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== - -regenerator-transform@^0.14.2: - version "0.14.5" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" - integrity sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw== - dependencies: - "@babel/runtime" "^7.8.4" - -regex-cache@^0.4.2: - version "0.4.4" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" - integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== - dependencies: - is-equal-shallow "^0.1.3" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp.prototype.flags@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26" - integrity sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" - integrity sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw== - -regexpp@^3.0.0, regexpp@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - -regexpu-core@^4.7.1: - version "4.8.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" - integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg== - dependencies: - regenerate "^1.4.2" - regenerate-unicode-properties "^9.0.0" - regjsgen "^0.5.2" - regjsparser "^0.7.0" - unicode-match-property-ecmascript "^2.0.0" - unicode-match-property-value-ecmascript "^2.0.0" - -regjsgen@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" - integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== - -regjsparser@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968" - integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ== - dependencies: - jsesc "~0.5.0" - -remark-gfm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" - integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== - dependencies: - mdast-util-gfm "^0.1.0" - micromark-extension-gfm "^0.3.0" - -remark-html@^13.0.1: - version "13.0.2" - resolved "https://registry.yarnpkg.com/remark-html/-/remark-html-13.0.2.tgz#de5f052749ff61fc904c9708c155c88a2e2655dc" - integrity sha512-LhSRQ+3RKdBqB/RGesFWkNNfkGqprDUCwjq54SylfFeNyZby5kqOG8Dn/vYsRoM8htab6EWxFXCY6XIZvMoRiQ== - dependencies: - hast-util-sanitize "^3.0.0" - hast-util-to-html "^7.0.0" - mdast-util-to-hast "^10.0.0" - -remark-parse@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-9.0.0.tgz#4d20a299665880e4f4af5d90b7c7b8a935853640" - integrity sha512-geKatMwSzEXKHuzBNU1z676sGcDcFoChMK38TgdHJNAYfFtsfHDQG7MoJAjs6sgYMqyLduCYWDIWZIxiPeafEw== - dependencies: - mdast-util-from-markdown "^0.8.0" - -remark-reference-links@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/remark-reference-links/-/remark-reference-links-5.0.0.tgz#2c75b60a99c53251f25193566953b0c71e096b8d" - integrity sha512-oSIo6lfDyG/1yYl2jPZNXmD9dgyPxp07mSd7snJagVMsDU6NRlD8i54MwHWUgMoOHTs8lIKPkwaUok/tbr5syQ== - dependencies: - unist-util-visit "^2.0.0" - -remark-stringify@^9.0.0: - version "9.0.1" - resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-9.0.1.tgz#576d06e910548b0a7191a71f27b33f1218862894" - integrity sha512-mWmNg3ZtESvZS8fv5PTvaPckdL4iNlCHTt8/e/8oN08nArHRHjNZMKzA/YW3+p7/lYqIw4nx1XsjCBo/AxNChg== - dependencies: - mdast-util-to-markdown "^0.6.0" - -remark-toc@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/remark-toc/-/remark-toc-7.2.0.tgz#1c5159e9091826150db14c97ac00c2ad5a7f1523" - integrity sha512-ppHepvpbg7j5kPFmU5rzDC4k2GTcPDvWcxXyr/7BZzO1cBSPk0stKtEJdsgAyw2WHKPGxadcHIZRjb2/sHxjkg== - dependencies: - "@types/unist" "^2.0.3" - mdast-util-toc "^5.0.0" - -remark@^13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/remark/-/remark-13.0.0.tgz#d15d9bf71a402f40287ebe36067b66d54868e425" - integrity sha512-HDz1+IKGtOyWN+QgBiAT0kn+2s6ovOxHyPAFGKVE81VSzJ+mq7RwHFledEvB5F1p4iJvOah/LOKdFuzvRnNLCA== - dependencies: - remark-parse "^9.0.0" - remark-stringify "^9.0.0" - unified "^9.1.0" - -remove-bom-buffer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" - integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== - dependencies: - is-buffer "^1.1.5" - is-utf8 "^0.2.1" - -remove-bom-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" - integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= - dependencies: - remove-bom-buffer "^3.0.0" - safe-buffer "^5.1.0" - through2 "^2.0.3" - -remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" - integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= - -repeat-element@^1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9" - integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ== - -repeat-string@^1.0.0, repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= - dependencies: - is-finite "^1.0.0" - -replace-ext@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" - integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= - -replace-ext@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.1.tgz#2d6d996d04a15855d967443631dd5f77825b016a" - integrity sha512-yD5BHCe7quCgBph4rMQ+0KkIRKwWCrHDOX1p1Gp6HwjPM5kVoCdKGNhN7ydqqsX6lJEnQDKZ/tFMiEdQ1dvPEw== - -replace-homedir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" - integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= - dependencies: - homedir-polyfill "^1.0.1" - is-absolute "^1.0.0" - remove-trailing-separator "^1.1.0" - -replacestream@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/replacestream/-/replacestream-4.0.3.tgz#3ee5798092be364b1cdb1484308492cb3dff2f36" - integrity sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA== - dependencies: - escape-string-regexp "^1.0.3" - object-assign "^4.0.1" - readable-stream "^2.0.2" - -request@^2.88.2: - version "2.88.2" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" - integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.3" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-alpn@^1.0.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" - integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== - -resolve-dir@^1.0.0, resolve-dir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" - integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= - dependencies: - expand-tilde "^2.0.0" - global-modules "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve-options@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" - integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= - dependencies: - value-or-function "^3.0.0" - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@1.1.7, resolve@1.1.x: - version "1.1.7" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" - integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= - -resolve@^1.1.3, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.8.1: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== - dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" - -responselike@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" - integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== - dependencies: - lowercase-keys "^2.0.0" - -resq@^1.9.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/resq/-/resq-1.10.1.tgz#c05d1b3808016cceec4d485ceb375acb49565f53" - integrity sha512-zhp1iyUH02MLciv3bIM2bNtTFx/fqRsK4Jk73jcPqp00d/sMTTjOtjdTMAcgjrQKGx5DvQ/HSpeqaMW0atGRJA== - dependencies: - fast-deep-equal "^2.0.1" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -restore-cursor@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" - integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== - dependencies: - onetime "^5.1.0" - signal-exit "^3.0.2" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rfdc@^1.1.4: - version "1.3.0" - resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" - integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== - -rgb2hex@0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.2.5.tgz#f82230cd3ab1364fa73c99be3a691ed688f8dbdc" - integrity sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw== - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= - dependencies: - align-text "^0.1.1" - -rimraf@2, rimraf@^2.2.8, rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@3.0.2, rimraf@^3.0.0, rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -rimraf@~2.2.0: - version "2.2.8" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" - integrity sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI= - -rimraf@~2.5.2: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" - integrity sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ= - dependencies: - glob "^7.0.5" - -rimraf@~2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -ripemd160@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-0.2.0.tgz#2bf198bde167cacfa51c0a928e84b68bbe171fce" - integrity sha1-K/GYveFnys+lHAqSjoS2i74XH84= - -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - -run-async@^2.2.0, run-async@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" - integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== - -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= - -rxjs@^7.2.0: - version "7.3.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.3.1.tgz#cc375521f9e238b474fe552b0b9fd1be33d08099" - integrity sha512-vNenx7gqjPyeKpRnM6S5Ksm/oFTRijWWzYlRON04KaehZ3YjDwEmVjGUGo0TKWVjeNXOujVRlh0K1drUbcdPkw== - dependencies: - tslib "~2.1.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-json-parse@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" - integrity sha1-PnZyPjjf3aE8mx0poeB//uSzC1c= - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -samsam@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50" - integrity sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg== - -schema-utils@^2.6.5, schema-utils@^2.7.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-2.7.1.tgz#1ca4f32d1b24c590c203b8e7a50bf0ea4cd394d7" - integrity sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg== - dependencies: - "@types/json-schema" "^7.0.5" - ajv "^6.12.4" - ajv-keywords "^3.5.2" - -semver-greatest-satisfied-range@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" - integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= - dependencies: - sver-compat "^1.5.0" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" - integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== - -semver@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - -semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.1.1, semver@^7.2.1, semver@^7.3.4: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -send@^0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1" - integrity sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.6.2" - mime "1.4.1" - ms "2.0.0" - on-finished "~2.3.0" - range-parser "~1.2.0" - statuses "~1.4.0" - -serialize-error@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-8.1.0.tgz#3a069970c712f78634942ddd50fbbc0eaebe2f67" - integrity sha512-3NnuWfM6vBYoy5gZFvHiYsVbafvI9vZv/+jlIigFn4oP4zjNPK3LhcY0xSCgeb1a5L8jO71Mit9LlNoi2UfDDQ== - dependencies: - type-fest "^0.20.2" - -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -serve-index@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239" - integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= - dependencies: - accepts "~1.3.4" - batch "0.6.1" - debug "2.6.9" - escape-html "~1.0.3" - http-errors "~1.6.2" - mime-types "~2.1.17" - parseurl "~1.3.2" - -serve-static@1.14.1, serve-static@^1.13.2: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -setimmediate@^1.0.4, setimmediate@~1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - -sha.js@2.2.6: - version "2.2.6" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.2.6.tgz#17ddeddc5f722fb66501658895461977867315ba" - integrity sha1-F93t3F9yL7ZlAWWIlUYZd4ZzFbo= - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.3, side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== - -sinon@^4.1.3: - version "4.5.0" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-4.5.0.tgz#427ae312a337d3c516804ce2754e8c0d5028cb04" - integrity sha512-trdx+mB0VBBgoYucy6a9L7/jfQOmvGeaKZT4OOJ+lPAtI8623xyGr8wLiE4eojzBS8G9yXbhx42GHUOVLr4X2w== - dependencies: - "@sinonjs/formatio" "^2.0.0" - diff "^3.1.0" - lodash.get "^4.4.2" - lolex "^2.2.0" - nise "^1.2.0" - supports-color "^5.1.0" - type-detect "^4.0.5" - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== - dependencies: - is-fullwidth-code-point "^2.0.0" - -slice-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" - integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== - dependencies: - ansi-styles "^4.0.0" - astral-regex "^2.0.0" - is-fullwidth-code-point "^3.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -socket.io-adapter@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/socket.io-adapter/-/socket.io-adapter-2.1.0.tgz#edc5dc36602f2985918d631c1399215e97a1b527" - integrity sha512-+vDov/aTsLjViYTwS9fPy5pEtTkrbEKsw2M+oVSoFGw6OD1IpvlV1VPhUzNbofCQ8oyMbdYJqDtGdmHQK6TdPg== - -socket.io-parser@~4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-4.0.4.tgz#9ea21b0d61508d18196ef04a2c6b9ab630f4c2b0" - integrity sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g== - dependencies: - "@types/component-emitter" "^1.2.10" - component-emitter "~1.3.0" - debug "~4.3.1" - -socket.io@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/socket.io/-/socket.io-3.1.2.tgz#06e27caa1c4fc9617547acfbb5da9bc1747da39a" - integrity sha512-JubKZnTQ4Z8G4IZWtaAZSiRP3I/inpy8c/Bsx2jrwGrTbKeVU5xd6qkKMHpChYeM3dWZSO0QACiGK+obhBNwYw== - dependencies: - "@types/cookie" "^0.4.0" - "@types/cors" "^2.8.8" - "@types/node" ">=10.0.0" - accepts "~1.3.4" - base64id "~2.0.0" - debug "~4.3.1" - engine.io "~4.1.0" - socket.io-adapter "~2.1.0" - socket.io-parser "~4.0.3" - -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - -source-list-map@~0.1.7: - version "0.1.8" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" - integrity sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY= - -source-map-js@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" - integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== - -source-map-resolve@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" - integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-resolve@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2" - integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w== - dependencies: - atob "^2.1.2" - decode-uri-component "^0.2.0" - -source-map-support@~0.5.20: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map-url@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56" - integrity sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw== - -source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" - integrity sha1-2rc/vPwrqBm03gO9b26qSBZLP50= - dependencies: - amdefine ">=0.0.4" - -source-map@~0.4.1: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - integrity sha1-66T12pwNyZneaAMti092FzZSA2s= - dependencies: - amdefine ">=0.0.4" - -source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -sourcemap-codec@^1.4.4: - version "1.4.8" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" - integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== - -space-separated-tokens@^1.0.0: - version "1.1.5" - resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" - integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== - -sparkles@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" - integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== - -spdx-correct@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9" - integrity sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz#3f28ce1a77a00372683eade4a433183527a2163d" - integrity sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A== - -spdx-expression-parse@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz#cf70f50482eefdc98e3ce0a6833e4a53ceeba679" - integrity sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== - -split-on-first@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" - integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -split2@^3.0.0, split2@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" - -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" - integrity sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8= - dependencies: - through "2" - -split@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -stack-trace@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" - integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= - -stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - -standard-version@^9.0.0: - version "9.3.1" - resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-9.3.1.tgz#786c16c318847f58a31a2434f97e8db33a635853" - integrity sha512-5qMxXw/FxLouC5nANyx/5RY1kiorJx9BppUso8gN07MG64q2uLRmrPb4KfXp3Ql4s/gxjZwZ89e0FwxeLubGww== - dependencies: - chalk "^2.4.2" - conventional-changelog "3.1.24" - conventional-changelog-config-spec "2.1.0" - conventional-changelog-conventionalcommits "4.5.0" - conventional-recommended-bump "6.1.0" - detect-indent "^6.0.0" - detect-newline "^3.1.0" - dotgitignore "^2.1.0" - figures "^3.1.0" - find-up "^5.0.0" - fs-access "^1.0.1" - git-semver-tags "^4.0.0" - semver "^7.1.1" - stringify-package "^1.0.1" - yargs "^16.0.0" - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -statuses@~1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.4.0.tgz#bb73d446da2796106efcc1b601a253d6c46bd087" - integrity sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew== - -stream-array@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/stream-array/-/stream-array-1.1.2.tgz#9e5f7345f2137c30ee3b498b9114e80b52bb7eb5" - integrity sha1-nl9zRfITfDDuO0mLkRToC1K7frU= - dependencies: - readable-stream "~2.1.0" - -stream-browserify@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" - integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== - dependencies: - inherits "~2.0.1" - readable-stream "^2.0.2" - -stream-buffers@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/stream-buffers/-/stream-buffers-3.0.2.tgz#5249005a8d5c2d00b3a32e6e0a6ea209dc4f3521" - integrity sha512-DQi1h8VEBA/lURbSwFtEHnSTb9s2/pwLEaFuNhXwy1Dx3Sa0lOuYT2yNUr4/j2fs8oCAMANtrZ5OrPZtyVs3MQ== - -stream-combiner2@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" - integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= - dependencies: - duplexer2 "~0.1.0" - readable-stream "^2.0.2" - -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" - integrity sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ= - dependencies: - duplexer "~0.1.1" - -stream-exhaust@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" - integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== - -stream-http@^2.3.1, stream-http@^2.7.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== - dependencies: - builtin-status-codes "^3.0.0" - inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" - xtend "^4.0.0" - -stream-shift@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d" - integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ== - -streamroller@^2.2.4: - version "2.2.4" - resolved "https://registry.yarnpkg.com/streamroller/-/streamroller-2.2.4.tgz#c198ced42db94086a6193608187ce80a5f2b0e53" - integrity sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ== - dependencies: - date-format "^2.1.0" - debug "^4.1.1" - fs-extra "^8.1.0" - -strict-uri-encode@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= - -string-template@~0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" - integrity sha1-QpMuWYo1LQH8IuwzZ9nYTuxsmt0= - -string-width@^1.0.1, string-width@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string.prototype.trimend@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" - integrity sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string.prototype.trimstart@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed" - integrity sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -string_decoder@0.10, string_decoder@^0.10.25, string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" - integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= - -string_decoder@^1.0.0, string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -stringify-entities@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-3.1.0.tgz#b8d3feac256d9ffcc9fa1fefdcf3ca70576ee903" - integrity sha512-3FP+jGMmMV/ffZs86MoghGqAoqXAdxLrJP4GUdrDN1aIScYih5tuIO3eF4To5AJZ79KDZ8Fpdy7QJnK8SsL1Vg== - dependencies: - character-entities-html4 "^1.0.0" - character-entities-legacy "^1.0.0" - xtend "^4.0.0" - -stringify-package@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" - integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== - -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - integrity sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA= - dependencies: - ansi-regex "^0.2.1" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom-string@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom-string/-/strip-bom-string-1.0.0.tgz#e5211e9224369fbb81d633a2f00044dc8cedad92" - integrity sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI= - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= - dependencies: - is-utf8 "^0.2.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-indent@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" - integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= - dependencies: - get-stdin "^4.0.1" - -strip-indent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-3.0.0.tgz#c32e1cee940b6b3432c771bc2c54bcce73cd3001" - integrity sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ== - dependencies: - min-indent "^1.0.0" - -strip-json-comments@3.1.1, strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -subarg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" - integrity sha1-9izxdYHplrSPyWVpn1TAauJouNI= - dependencies: - minimist "^1.1.0" - -suffix@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/suffix/-/suffix-0.1.1.tgz#cc58231646a0ef1102f79478ef3a9248fd9c842f" - integrity sha1-zFgjFkag7xEC95R47zqSSP2chC8= - -supports-color@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== - dependencies: - has-flag "^3.0.0" - -supports-color@8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - integrity sha1-2S3iaU6z9nMjlz1649i1W0wiGQo= - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^3.1.0: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - -supports-color@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= - dependencies: - has-flag "^2.0.0" - -supports-color@^5.1.0, supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" - integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -sver-compat@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" - integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= - dependencies: - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== - dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - -table@^6.0.9: - version "6.7.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.7.2.tgz#a8d39b9f5966693ca8b0feba270a78722cbaf3b0" - integrity sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g== - dependencies: - ajv "^8.0.1" - lodash.clonedeep "^4.5.0" - lodash.truncate "^4.4.2" - slice-ansi "^4.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - -tapable@^0.1.8, tapable@~0.1.8: - version "0.1.10" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.1.10.tgz#29c35707c2b70e50d07482b5d202e8ed446dafd4" - integrity sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q= - -tapable@^0.2.7: - version "0.2.9" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.9.tgz#af2d8bbc9b04f74ee17af2b4d9048f807acd18a8" - integrity sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A== - -tar-fs@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad" - integrity sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA== - dependencies: - chownr "^1.1.1" - mkdirp "^0.5.1" - pump "^3.0.0" - tar-stream "^2.0.0" - -tar-stream@^2.0.0, tar-stream@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" - integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== - dependencies: - bl "^4.0.3" - end-of-stream "^1.4.1" - fs-constants "^1.0.0" - inherits "^2.0.3" - readable-stream "^3.1.1" - -temp-fs@^0.9.9: - version "0.9.9" - resolved "https://registry.yarnpkg.com/temp-fs/-/temp-fs-0.9.9.tgz#8071730437870720e9431532fe2814364f8803d7" - integrity sha1-gHFzBDeHByDpQxUy/igUNk+IA9c= - dependencies: - rimraf "~2.5.2" - -ternary-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ternary-stream/-/ternary-stream-3.0.0.tgz#7951930ea9e823924d956f03d516151a2d516253" - integrity sha512-oIzdi+UL/JdktkT+7KU5tSIQjj8pbShj3OASuvDEhm0NT5lppsm7aXWAmAq4/QMaBIyfuEcNLbAQA+HpaISobQ== - dependencies: - duplexify "^4.1.1" - fork-stream "^0.0.4" - merge-stream "^2.0.0" - through2 "^3.0.1" - -terser@^5.9.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" - integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - -text-extensions@^1.0.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" - integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== - -text-table@^0.2.0, text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -textextensions@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-3.3.0.tgz#03530d5287b86773c08b77458589148870cc71d3" - integrity sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw== - -through2-filter@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" - integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== - dependencies: - through2 "~2.0.0" - xtend "~4.0.0" - -through2@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" - integrity sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s= - dependencies: - readable-stream "~1.0.17" - xtend "~2.1.1" - -through2@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7" - integrity sha1-390BLrnHAOIyP9M084rGIqs3Lac= - dependencies: - readable-stream "~1.0.17" - xtend "~3.0.0" - -through2@^0.6.3: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - integrity sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg= - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - -through2@^2.0.0, through2@^2.0.3, through2@~2.0.0: - version "2.0.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" - integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== - dependencies: - readable-stream "~2.3.6" - xtend "~4.0.1" - -through2@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.2.tgz#99f88931cfc761ec7678b41d5d7336b5b6a07bf4" - integrity sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ== - dependencies: - inherits "^2.0.4" - readable-stream "2 || 3" - -through2@^4.0.0, through2@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" - integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== - dependencies: - readable-stream "3" - -through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -time-stamp@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" - integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= - -timers-browserify@^2.0.2, timers-browserify@^2.0.4: - version "2.0.12" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" - integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== - dependencies: - setimmediate "^1.0.4" - -timers-ext@^0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" - integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== - dependencies: - es5-ext "~0.10.46" - next-tick "1" - -tiny-hashes@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tiny-hashes/-/tiny-hashes-1.0.1.tgz#ddbe9060312ddb4efe0a174bb3a27e1331c425a1" - integrity sha512-knIN5zj4fl7kW4EBU5sLP20DWUvi/rVouvJezV0UAym2DkQaqm365Nyc8F3QEiOvunNDMxR8UhcXd1d5g+Wg1g== - -tiny-lr@^1.1.0, tiny-lr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/tiny-lr/-/tiny-lr-1.1.1.tgz#9fa547412f238fedb068ee295af8b682c98b2aab" - integrity sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA== - dependencies: - body "^5.1.0" - debug "^3.1.0" - faye-websocket "~0.10.0" - livereload-js "^2.3.0" - object-assign "^4.1.0" - qs "^6.4.0" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tmp@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== - dependencies: - rimraf "^3.0.0" - -to-absolute-glob@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" - integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= - dependencies: - is-absolute "^1.0.0" - is-negated-glob "^1.0.0" - -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -to-through@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" - integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= - dependencies: - through2 "^2.0.3" - -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -"traverse@>=0.3.0 <0.4": - version "0.3.9" - resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9" - integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk= - -trim-newlines@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" - integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= - -trim-newlines@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144" - integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw== - -trough@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" - integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== - -tryer@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tryer/-/tryer-1.0.1.tgz#f2c85406800b9b0f74c9f7465b81eaad241252f8" - integrity sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA== - -tsconfig-paths@^3.11.0: - version "3.11.0" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz#954c1fe973da6339c78e06b03ce2e48810b65f36" - integrity sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA== - dependencies: - "@types/json5" "^0.0.29" - json5 "^1.0.1" - minimist "^1.2.0" - strip-bom "^3.0.0" - -tslib@^1.10.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.18.0: - version "0.18.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" - integrity sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw== - -type-fest@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" - integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-fest@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" - integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== - -type-fest@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" - integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== - -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -type@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" - integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== - -type@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" - integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== - -typedarray@^0.0.6, typedarray@~0.0.5: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= - -typescript-compare@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/typescript-compare/-/typescript-compare-0.0.2.tgz#7ee40a400a406c2ea0a7e551efd3309021d5f425" - integrity sha512-8ja4j7pMHkfLJQO2/8tut7ub+J3Lw2S3061eJLFQcvs3tsmJKp8KG5NtpLn7KcY2w08edF74BSVN7qJS0U6oHA== - dependencies: - typescript-logic "^0.0.0" - -typescript-logic@^0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/typescript-logic/-/typescript-logic-0.0.0.tgz#66ebd82a2548f2b444a43667bec120b496890196" - integrity sha512-zXFars5LUkI3zP492ls0VskH3TtdeHCqu0i7/duGt60i5IGPIpAHE/DWo5FqJ6EjQ15YKXrt+AETjv60Dat34Q== - -typescript-tuple@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/typescript-tuple/-/typescript-tuple-2.2.1.tgz#7d9813fb4b355f69ac55032e0363e8bb0f04dad2" - integrity sha512-Zcr0lbt8z5ZdEzERHAMAniTiIKerFCMgd7yjq1fPnDJ43et/k9twIFQMUYff9k5oXcsQ0WpvFcgzK2ZKASoW6Q== - dependencies: - typescript-compare "^0.0.2" - -ua-parser-js@^0.7.21, ua-parser-js@^0.7.28: - version "0.7.28" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.28.tgz#8ba04e653f35ce210239c64661685bf9121dec31" - integrity sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g== - -uglify-js@^2.8.29: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-js@^3.1.4: - version "3.14.2" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.2.tgz#d7dd6a46ca57214f54a2d0a43cad0f35db82ac99" - integrity sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A== - -uglify-js@~2.7.3: - version "2.7.5" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8" - integrity sha1-RhLAx7qu4rp8SH3kkErhIgefLKg= - dependencies: - async "~0.2.6" - source-map "~0.5.1" - uglify-to-browserify "~1.0.0" - yargs "~3.10.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= - -uglifyjs-webpack-plugin@^0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" - integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= - dependencies: - source-map "^0.5.6" - uglify-js "^2.8.29" - webpack-sources "^1.0.1" - -unbox-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471" - integrity sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw== - dependencies: - function-bind "^1.1.1" - has-bigints "^1.0.1" - has-symbols "^1.0.2" - which-boxed-primitive "^1.0.2" - -unbzip2-stream@1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.3.3.tgz#d156d205e670d8d8c393e1c02ebd506422873f6a" - integrity sha512-fUlAF7U9Ah1Q6EieQ4x4zLNejrRvDWUYmxXUpN3uziFYCHapjWFaCAnreY9bGgxzaMCFAPPpYNng57CypwJVhg== - dependencies: - buffer "^5.2.1" - through "^2.3.8" - -unc-path-regex@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" - integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= - -undertaker-registry@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" - integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= - -undertaker@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.3.0.tgz#363a6e541f27954d5791d6fa3c1d321666f86d18" - integrity sha512-/RXwi5m/Mu3H6IHQGww3GNt1PNXlbeCuclF2QYR14L/2CHPz3DFZkvB5hZ0N/QUkiXWCACML2jXViIQEQc2MLg== - dependencies: - arr-flatten "^1.0.1" - arr-map "^2.0.0" - bach "^1.0.0" - collection-map "^1.0.0" - es6-weak-map "^2.0.1" - fast-levenshtein "^1.0.0" - last-run "^1.1.0" - object.defaults "^1.0.0" - object.reduce "^1.0.0" - undertaker-registry "^1.0.0" - -unicode-canonical-property-names-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" - integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== - -unicode-match-property-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" - integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== - dependencies: - unicode-canonical-property-names-ecmascript "^2.0.0" - unicode-property-aliases-ecmascript "^2.0.0" - -unicode-match-property-value-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz#1a01aa57247c14c568b89775a54938788189a714" - integrity sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw== - -unicode-property-aliases-ecmascript@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" - integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== - -unified@^9.1.0: - version "9.2.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" - integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== - dependencies: - bail "^1.0.0" - extend "^3.0.0" - is-buffer "^2.0.0" - is-plain-obj "^2.0.0" - trough "^1.0.0" - vfile "^4.0.0" - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unique-stream@^2.0.2: - version "2.3.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" - integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== - dependencies: - json-stable-stringify-without-jsonify "^1.0.1" - through2-filter "^3.0.0" - -unist-builder@^2.0.0, unist-builder@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" - integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== - -unist-util-generated@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" - integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== - -unist-util-is@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" - integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== - -unist-util-position@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" - integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== - -unist-util-stringify-position@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" - integrity sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g== - dependencies: - "@types/unist" "^2.0.2" - -unist-util-visit-parents@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" - integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - -unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" - integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== - dependencies: - "@types/unist" "^2.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" - -universalify@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" - integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== - -universalify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" - integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -unzipper@^0.9.3: - version "0.9.15" - resolved "https://registry.yarnpkg.com/unzipper/-/unzipper-0.9.15.tgz#97d99203dad17698ee39882483c14e4845c7549c" - integrity sha512-2aaUvO4RAeHDvOCuEtth7jrHFaCKTSXPqUkXwADaLBzGbgZGzUDccoEdJ5lW+3RmfpOZYNx0Rw6F6PUzM6caIA== - dependencies: - big-integer "^1.6.17" - binary "~0.3.0" - bluebird "~3.4.1" - buffer-indexof-polyfill "~1.0.0" - duplexer2 "~0.1.4" - fstream "^1.0.12" - listenercount "~1.0.1" - readable-stream "~2.3.6" - setimmediate "~1.0.4" - -upath@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" - integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -url-join@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/url-join/-/url-join-2.0.5.tgz#5af22f18c052a000a48d7b82c5e9c2e2feeda728" - integrity sha1-WvIvGMBSoACkjXuCxenC4v7tpyg= - -url-parse@^1.0.5: - version "1.5.3" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.3.tgz#71c1303d38fb6639ade183c2992c8cc0686df862" - integrity sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -util-deprecate@^1.0.1, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -util@0.10.3: - version "0.10.3" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" - integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= - dependencies: - inherits "2.0.1" - -util@^0.10.3: - version "0.10.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== - dependencies: - inherits "2.0.3" - -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@^3.1.0, uuid@^3.3.2: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - -uuid@^8.0.0: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -v8-compile-cache@^2.0.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" - integrity sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA== - -v8flags@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656" - integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg== - dependencies: - homedir-polyfill "^1.0.1" - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -value-or-function@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" - integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= - -vary@^1, vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -vfile-message@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" - integrity sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ== - dependencies: - "@types/unist" "^2.0.0" - unist-util-stringify-position "^2.0.0" - -vfile-reporter@^6.0.0: - version "6.0.2" - resolved "https://registry.yarnpkg.com/vfile-reporter/-/vfile-reporter-6.0.2.tgz#cbddaea2eec560f27574ce7b7b269822c191a676" - integrity sha512-GN2bH2gs4eLnw/4jPSgfBjo+XCuvnX9elHICJZjVD4+NM0nsUrMTvdjGY5Sc/XG69XVTgLwj7hknQVc6M9FukA== - dependencies: - repeat-string "^1.5.0" - string-width "^4.0.0" - supports-color "^6.0.0" - unist-util-stringify-position "^2.0.0" - vfile-sort "^2.1.2" - vfile-statistics "^1.1.0" - -vfile-sort@^2.1.0, vfile-sort@^2.1.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/vfile-sort/-/vfile-sort-2.2.2.tgz#720fe067ce156aba0b411a01bb0dc65596aa1190" - integrity sha512-tAyUqD2R1l/7Rn7ixdGkhXLD3zsg+XLAeUDUhXearjfIcpL1Hcsj5hHpCoy/gvfK/Ws61+e972fm0F7up7hfYA== - -vfile-statistics@^1.1.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/vfile-statistics/-/vfile-statistics-1.1.4.tgz#b99fd15ecf0f44ba088cc973425d666cb7a9f245" - integrity sha512-lXhElVO0Rq3frgPvFBwahmed3X03vjPF8OcjKMy8+F1xU/3Q3QU3tKEDp743SFtb74PdF0UWpxPvtOP0GCLheA== - -vfile@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" - integrity sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA== - dependencies: - "@types/unist" "^2.0.0" - is-buffer "^2.0.0" - unist-util-stringify-position "^2.0.0" - vfile-message "^2.0.0" - -vinyl-fs@^3.0.0, vinyl-fs@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" - integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== - dependencies: - fs-mkdirp-stream "^1.0.0" - glob-stream "^6.1.0" - graceful-fs "^4.0.0" - is-valid-glob "^1.0.0" - lazystream "^1.0.0" - lead "^1.0.0" - object.assign "^4.0.4" - pumpify "^1.3.5" - readable-stream "^2.3.3" - remove-bom-buffer "^3.0.0" - remove-bom-stream "^1.2.0" - resolve-options "^1.1.0" - through2 "^2.0.0" - to-through "^2.0.0" - value-or-function "^3.0.0" - vinyl "^2.0.0" - vinyl-sourcemap "^1.1.0" - -vinyl-sourcemap@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" - integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= - dependencies: - append-buffer "^1.0.2" - convert-source-map "^1.5.0" - graceful-fs "^4.1.6" - normalize-path "^2.1.1" - now-and-later "^2.0.0" - remove-bom-buffer "^3.0.0" - vinyl "^2.0.0" - -vinyl-sourcemaps-apply@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" - integrity sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU= - dependencies: - source-map "^0.5.1" - -vinyl@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.2.3.tgz#bca938209582ec5a49ad538a00fa1f125e513252" - integrity sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI= - dependencies: - clone-stats "~0.0.1" - -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - integrity sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4= - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - -vinyl@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" - integrity sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ= - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - -vinyl@^2.0.0, vinyl@^2.1.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.1.tgz#23cfb8bbab5ece3803aa2c0a1eb28af7cbba1974" - integrity sha512-LII3bXRFBZLlezoG5FfZVcXflZgWP/4dCwKtxd5ky9+LOtM4CS3bIRQsmR1KMnMW07jpE8fqR2lcxPZ+8sJIcw== - dependencies: - clone "^2.1.1" - clone-buffer "^1.0.0" - clone-stats "^1.0.0" - cloneable-readable "^1.0.0" - remove-trailing-separator "^1.0.1" - replace-ext "^1.0.0" - -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - integrity sha1-XX6kW7755Kb/ZflUOOCofDV9WnM= - dependencies: - indexof "0.0.1" - -vm-browserify@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" - integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== - -void-elements@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" - integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= - -vue-template-compiler@^2.6.12: - version "2.6.14" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz#a2f0e7d985670d42c9c9ee0d044fed7690f4f763" - integrity sha512-ODQS1SyMbjKoO1JBJZojSw6FE4qnh9rIpUZn2EUT86FKizx9uH5z6uXiIrm4/Nb/gwxTi/o17ZDEGWAXHvtC7g== - dependencies: - de-indent "^1.0.2" - he "^1.1.0" - -walk@^2.3.9: - version "2.3.15" - resolved "https://registry.yarnpkg.com/walk/-/walk-2.3.15.tgz#1b4611e959d656426bc521e2da5db3acecae2424" - integrity sha512-4eRTBZljBfIISK1Vnt69Gvr2w/wc3U6Vtrw7qiN5iqYJPH7LElcYh/iU4XWhdCy2dZqv1ToMyYlybDylfG/5Vg== - dependencies: - foreachasync "^3.0.0" - -watchpack-chokidar2@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957" - integrity sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww== - dependencies: - chokidar "^2.1.8" - -watchpack@^0.2.1: - version "0.2.9" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-0.2.9.tgz#62eaa4ab5e5ba35fdfc018275626e3c0f5e3fb0b" - integrity sha1-Yuqkq15bo1/fwBgnVibjwPXj+ws= - dependencies: - async "^0.9.0" - chokidar "^1.0.0" - graceful-fs "^4.1.2" - -watchpack@^1.4.0: - version "1.7.5" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453" - integrity sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ== - dependencies: - graceful-fs "^4.1.2" - neo-async "^2.5.0" - optionalDependencies: - chokidar "^3.4.1" - watchpack-chokidar2 "^2.0.1" - -wcwidth@>=1.0.1, wcwidth@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" - integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= - dependencies: - defaults "^1.0.3" - -webdriver@7.13.2: - version "7.13.2" - resolved "https://registry.yarnpkg.com/webdriver/-/webdriver-7.13.2.tgz#47fc49d5f30c7537707875143e08a83231b04eb8" - integrity sha512-NhAs5icJOMltKZHhk3dz3mKArUu4tBe+P6o8kNE5qJYhgXs6lkoBy03zBMh8x9tnbWykVM4Ccw38kA0k2BJ41Q== - dependencies: - "@types/node" "^15.12.5" - "@wdio/config" "7.13.2" - "@wdio/logger" "7.7.0" - "@wdio/protocols" "7.13.2" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - got "^11.0.2" - ky "^0.28.5" - lodash.merge "^4.6.1" - -webdriverio@7.13.2, webdriverio@^7.6.1: - version "7.13.2" - resolved "https://registry.yarnpkg.com/webdriverio/-/webdriverio-7.13.2.tgz#a97849c351d8f9fe96f83fe34f2778f211c7f737" - integrity sha512-T6zSlTEqIBLWHaUKv/vOg55OMjjczZ881MrE47p9mfJ3Po+pdTLWPRcx3WwAdnYrJUi30EXdv3QNX7gC+WmgSQ== - dependencies: - "@types/aria-query" "^4.2.1" - "@types/node" "^15.12.5" - "@wdio/config" "7.13.2" - "@wdio/logger" "7.7.0" - "@wdio/protocols" "7.13.2" - "@wdio/repl" "7.13.2" - "@wdio/types" "7.13.2" - "@wdio/utils" "7.13.2" - archiver "^5.0.0" - aria-query "^4.2.2" - atob "^2.1.2" - css-shorthand-properties "^1.1.1" - css-value "^0.0.1" - devtools "7.13.2" - devtools-protocol "^0.0.925217" - fs-extra "^10.0.0" - get-port "^5.1.1" - grapheme-splitter "^1.0.2" - lodash.clonedeep "^4.5.0" - lodash.isobject "^3.0.2" - lodash.isplainobject "^4.0.6" - lodash.zip "^4.2.0" - minimatch "^3.0.4" - puppeteer-core "^10.1.0" - query-selector-shadow-dom "^1.0.0" - resq "^1.9.1" - rgb2hex "0.2.5" - serialize-error "^8.0.0" - webdriver "7.13.2" - -webpack-bundle-analyzer@^3.8.0: - version "3.9.0" - resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.9.0.tgz#f6f94db108fb574e415ad313de41a2707d33ef3c" - integrity sha512-Ob8amZfCm3rMB1ScjQVlbYYUEJyEjdEtQ92jqiFUYt5VkEeO2v5UMbv49P/gnmCZm3A6yaFQzCBvpZqN4MUsdA== - dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" - bfj "^6.1.1" - chalk "^2.4.1" - commander "^2.18.0" - ejs "^2.6.1" - express "^4.16.3" - filesize "^3.6.1" - gzip-size "^5.0.0" - lodash "^4.17.19" - mkdirp "^0.5.1" - opener "^1.5.1" - ws "^6.0.0" - -webpack-core@~0.6.9: - version "0.6.9" - resolved "https://registry.yarnpkg.com/webpack-core/-/webpack-core-0.6.9.tgz#fc571588c8558da77be9efb6debdc5a3b172bdc2" - integrity sha1-/FcViMhVjad76e+23r3Fo7FyvcI= - dependencies: - source-list-map "~0.1.7" - source-map "~0.4.1" - -webpack-dev-middleware@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-2.0.6.tgz#a51692801e8310844ef3e3790e1eacfe52326fd4" - integrity sha512-tj5LLD9r4tDuRIDa5Mu9lnY2qBBehAITv6A9irqXhw/HQquZgTx3BCd57zYbU2gMDnncA49ufK2qVQSbaKJwOw== - dependencies: - loud-rejection "^1.6.0" - memory-fs "~0.4.1" - mime "^2.1.0" - path-is-absolute "^1.0.0" - range-parser "^1.0.3" - url-join "^2.0.2" - webpack-log "^1.0.1" - -webpack-log@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/webpack-log/-/webpack-log-1.2.0.tgz#a4b34cda6b22b518dbb0ab32e567962d5c72a43d" - integrity sha512-U9AnICnu50HXtiqiDxuli5gLB5PGBo7VvcHx36jRZHwK4vzOYLbImqT4lwWwoMHdQWwEKw736fCHEekokTEKHA== - dependencies: - chalk "^2.1.0" - log-symbols "^2.1.0" - loglevelnext "^1.0.1" - uuid "^3.1.0" - -webpack-sources@^1.0.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack-stream@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-3.2.0.tgz#3a1d160fb11d41727b7ce6f32f722464f98b2186" - integrity sha1-Oh0WD7EdQXJ7fObzL3IkZPmLIYY= - dependencies: - gulp-util "^3.0.7" - lodash.clone "^4.3.2" - lodash.some "^4.2.2" - memory-fs "^0.3.0" - through "^2.3.8" - vinyl "^1.1.0" - webpack "^1.12.9" - -webpack@^1.12.9: - version "1.15.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-1.15.0.tgz#4ff31f53db03339e55164a9d468ee0324968fe98" - integrity sha1-T/MfU9sDM55VFkqdRo7gMklo/pg= - dependencies: - acorn "^3.0.0" - async "^1.3.0" - clone "^1.0.2" - enhanced-resolve "~0.9.0" - interpret "^0.6.4" - loader-utils "^0.2.11" - memory-fs "~0.3.0" - mkdirp "~0.5.0" - node-libs-browser "^0.7.0" - optimist "~0.6.0" - supports-color "^3.1.0" - tapable "~0.1.8" - uglify-js "~2.7.3" - watchpack "^0.2.1" - webpack-core "~0.6.9" - -webpack@^3.0.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" - integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== - dependencies: - acorn "^5.0.0" - acorn-dynamic-import "^2.0.0" - ajv "^6.1.0" - ajv-keywords "^3.1.0" - async "^2.1.2" - enhanced-resolve "^3.4.0" - escope "^3.6.0" - interpret "^1.0.0" - json-loader "^0.5.4" - json5 "^0.5.1" - loader-runner "^2.3.0" - loader-utils "^1.1.0" - memory-fs "~0.4.1" - mkdirp "~0.5.0" - node-libs-browser "^2.0.0" - source-map "^0.5.3" - supports-color "^4.2.1" - tapable "^0.2.7" - uglifyjs-webpack-plugin "^0.4.6" - watchpack "^1.4.0" - webpack-sources "^1.0.1" - yargs "^8.0.2" - -websocket-driver@>=0.5.1: - version "0.7.4" - resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760" - integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== - dependencies: - http-parser-js ">=0.5.1" - safe-buffer ">=5.1.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.4" - resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42" - integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== - -which-boxed-primitive@^1.0.1, which-boxed-primitive@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" - integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== - dependencies: - is-bigint "^1.0.1" - is-boolean-object "^1.1.0" - is-number-object "^1.0.4" - is-string "^1.0.5" - is-symbol "^1.0.3" - -which-collection@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" - integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== - dependencies: - is-map "^2.0.1" - is-set "^2.0.1" - is-weakmap "^2.0.1" - is-weakset "^2.0.1" - -which-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" - integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which-typed-array@^1.1.2: - version "1.1.7" - resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.7.tgz#2761799b9a22d4b8660b3c1b40abaa7739691793" - integrity sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw== - dependencies: - available-typed-arrays "^1.0.5" - call-bind "^1.0.2" - es-abstract "^1.18.5" - foreach "^2.0.5" - has-tostringtag "^1.0.0" - is-typed-array "^1.1.7" - -which@2.0.2, which@^2.0.1, which@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -which@^1.1.1, which@^1.2.1, which@^1.2.14, which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= - -word-wrap@^1.2.3, word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= - -wordwrap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - -workerpool@6.1.5: - version "6.1.5" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.1.5.tgz#0f7cf076b6215fd7e1da903ff6f22ddd1886b581" - integrity sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw== - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" - integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= - dependencies: - mkdirp "^0.5.1" - -ws@7.4.6, ws@~7.4.2: - version "7.4.6" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" - integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== - -ws@^6.0.0: - version "6.2.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e" - integrity sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw== - dependencies: - async-limiter "~1.0.0" - -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -xtend@~2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" - integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= - dependencies: - object-keys "~0.4.0" - -xtend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" - integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo= - -y18n@^3.2.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.2.tgz#85c901bd6470ce71fc4bb723ad209b70f7f28696" - integrity sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ== - -y18n@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf" - integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - -yargs-parser@>=5.0.0-security.0, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^18.1.2: - version "18.1.3" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" - integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.1.tgz#7ede329c1d8cdbbe209bd25cdb990e9b1ebbb394" - integrity sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA== - dependencies: - camelcase "^3.0.0" - object.assign "^4.1.0" - -yargs-parser@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= - dependencies: - camelcase "^4.1.0" - -yargs-unparser@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" - integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== - dependencies: - camelcase "^6.0.0" - decamelize "^4.0.0" - flat "^5.0.2" - is-plain-obj "^2.1.0" - -yargs@16.2.0, yargs@^16.0.0, yargs@^16.1.1, yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^1.3.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.3.3.tgz#054de8b61f22eefdb7207059eaef9d6b83fb931a" - integrity sha1-BU3oth8i7v23IHBZ6u+da4P7kxo= - -yargs@^15.3.1: - version "15.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" - integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== - dependencies: - cliui "^6.0.0" - decamelize "^1.2.0" - find-up "^4.1.0" - get-caller-file "^2.0.1" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^4.2.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^18.1.2" - -yargs@^17.0.0: - version "17.2.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" - integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - -yargs@^7.1.0: - version "7.1.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.2.tgz#63a0a5d42143879fdbb30370741374e0641d55db" - integrity sha512-ZEjj/dQYQy0Zx0lgLMLR8QuaqTihnxirir7EwUHp1Axq4e3+k8jXU5K0VLbNvedv1f4EWtBonDIZm0NUr+jCcA== - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^5.0.1" - -yargs@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= - dependencies: - camelcase "^4.1.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - read-pkg-up "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^7.0.0" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - -yarn-install@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yarn-install/-/yarn-install-1.0.0.tgz#57f45050b82efd57182b3973c54aa05cb5d25230" - integrity sha1-V/RQULgu/VcYKzlzxUqgXLXSUjA= - dependencies: - cac "^3.0.3" - chalk "^1.1.3" - cross-spawn "^4.0.2" - -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zip-stream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-4.1.0.tgz#51dd326571544e36aa3f756430b313576dc8fc79" - integrity sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A== - dependencies: - archiver-utils "^2.1.0" - compress-commons "^4.1.0" - readable-stream "^3.6.0" - -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== From 9ad4b849fbb71394a3a43ef468bf5321dd2cf036 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Thu, 14 Oct 2021 13:41:46 -0400 Subject: [PATCH 184/250] Prebid Server Adapter: fix eid permissions for ie11 (#7583) * Update index.js * Update index.js --- modules/prebidServerBidAdapter/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/prebidServerBidAdapter/index.js b/modules/prebidServerBidAdapter/index.js index 245cb7fc0b0..e82fdfd02a9 100644 --- a/modules/prebidServerBidAdapter/index.js +++ b/modules/prebidServerBidAdapter/index.js @@ -799,7 +799,7 @@ const OPEN_RTB_PROTOCOL = { if (requestedBidders && isArray(requestedBidders)) { eidPermissions.forEach(i => { if (i.bidders) { - i.bidders = i.bidders.filter(bidder => requestedBidders.includes(bidder)) + i.bidders = i.bidders.filter(bidder => includes(requestedBidders, bidder)) } }); } From 8c6216543306845ccd7b31fa36a841771ef17aca Mon Sep 17 00:00:00 2001 From: robertrmartinez Date: Thu, 14 Oct 2021 11:03:25 -0700 Subject: [PATCH 185/250] Prebid 5.18.0 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c6cb061c36..49ecc0d3c3a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.18.0-pre", + "version": "5.18.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 0bbea5e8cf0f448ab02d5ecfc64064d584271379 Mon Sep 17 00:00:00 2001 From: robertrmartinez Date: Thu, 14 Oct 2021 11:34:23 -0700 Subject: [PATCH 186/250] Increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 49ecc0d3c3a..c5694c7974b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.18.0", + "version": "5.19.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From ff188769cc096d949ef7d9f07d3130588a72c87f Mon Sep 17 00:00:00 2001 From: tamirnPerion <44399211+tamirnPerion@users.noreply.github.com> Date: Thu, 14 Oct 2021 21:37:05 +0300 Subject: [PATCH 187/250] Codefuel Bid Adapter: add new bid adapter (#7489) * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * fix lint issue in undertone adapter spec * added user sync function to undertone adapter * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * added user sync function to undertone adapter * added user sync function to undertone adapter * revert package-lock.json * added user sync function to undertone adapter * Update undertoneBidAdapter.js * Update browsers.json * sanity * indentation * cf adapter, md and spec * spec.js fix * spec.js fix (2) * final fixes: - browsers.json -> remove newline - adapter -> import only used functions * adomain -> meta.advertiserDomains * re-check * re-check-2 Co-authored-by: omerko Co-authored-by: Omer Koren Co-authored-by: AnnaPerion Co-authored-by: Oran Hollaender --- modules/codefuelBidAdapter.js | 183 +++++++++++ modules/codefuelBidAdapter.md | 111 +++++++ test/spec/modules/codefuelBidAdapter_spec.js | 316 +++++++++++++++++++ 3 files changed, 610 insertions(+) create mode 100644 modules/codefuelBidAdapter.js create mode 100644 modules/codefuelBidAdapter.md create mode 100644 test/spec/modules/codefuelBidAdapter_spec.js diff --git a/modules/codefuelBidAdapter.js b/modules/codefuelBidAdapter.js new file mode 100644 index 00000000000..ecb56c00d29 --- /dev/null +++ b/modules/codefuelBidAdapter.js @@ -0,0 +1,183 @@ +import { deepAccess, isArray } from '../src/utils.js'; +import { config } from '../src/config.js'; +import {registerBidder} from '../src/adapters/bidderFactory.js'; +import { BANNER } from '../src/mediaTypes.js'; +const BIDDER_CODE = 'codefuel'; +const CURRENCY = 'USD'; + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [ BANNER ], + aliases: ['ex'], // short code + /** + * Determines whether or not the given bid request is valid. + * + * @param {BidRequest} bid The bid params to validate. + * @return boolean True if this is a valid bid, and false otherwise. + */ + isBidRequestValid: function(bid) { + if (bid.nativeParams) { + return false; + } + return !!(bid.params.placementId || (bid.params.member && bid.params.invCode)); + }, + /** + * Make a server request from the list of BidRequests. + * + * @param {validBidRequests[]} - an array of bids + * @return ServerRequest Info describing the request to the server. + */ + buildRequests: function(validBidRequests, bidderRequest) { + const page = bidderRequest.refererInfo.referer; + const domain = getDomainFromURL(page) + const ua = navigator.userAgent; + const devicetype = getDeviceType() + const publisher = setOnAny(validBidRequests, 'params.publisher'); + const cur = CURRENCY; + // const endpointUrl = 'http://localhost:5000/prebid' + const endpointUrl = config.getConfig('codefuel.bidderUrl'); + const timeout = bidderRequest.timeout; + + validBidRequests.forEach(bid => bid.netRevenue = 'net'); + + const imps = validBidRequests.map((bid, idx) => { + const imp = { + id: idx + 1 + '' + } + + if (bid.params.tagid) { + imp.tagid = bid.params.tagid + } + + if (bid.sizes) { + imp.banner = { + format: transformSizes(bid.sizes) + } + } + + return imp; + }); + + const request = { + id: bidderRequest.auctionId, + site: { page, domain, publisher }, + device: { ua, devicetype }, + source: { fd: 1 }, + cur: [cur], + tmax: timeout, + imp: imps, + }; + + return { + method: 'POST', + url: endpointUrl, + data: request, + bids: validBidRequests, + options: { + withCredentials: false + } + }; + }, + /** + * Unpack the response from the server into a list of bids. + * + * @param {ServerResponse} serverResponse A successful response from the server. + * @return {Bid[]} An array of bids which were nested inside the server. + */ + interpretResponse: (serverResponse, { bids }) => { + if (!serverResponse.body) { + return []; + } + const { seatbid, cur } = serverResponse.body; + + const bidResponses = flatten(seatbid.map(seat => seat.bid)).reduce((result, bid) => { + result[bid.impid - 1] = bid; + return result; + }, []); + + return bids.map((bid, id) => { + const bidResponse = bidResponses[id]; + if (bidResponse) { + const bidObject = { + requestId: bid.bidId, + cpm: bidResponse.price, + creativeId: bidResponse.crid, + ttl: 360, + netRevenue: true, + currency: cur, + mediaType: BANNER, + ad: bidResponse.adm, + width: bidResponse.w, + height: bidResponse.h, + meta: { advertiserDomains: bid.adomain ? bid.adomain : [] } + }; + return bidObject; + } + }).filter(Boolean); + }, + + /** + * Register the user sync pixels which should be dropped after the auction. + * + * @param {SyncOptions} syncOptions Which user syncs are allowed? + * @param {ServerResponse[]} serverResponses List of server's responses. + * @return {UserSync[]} The user syncs which should be dropped. + */ + getUserSyncs: function(syncOptions, serverResponses, gdprConsent, uspConsent) { + return []; + } + +} +registerBidder(spec); + +function getDomainFromURL(url) { + let anchor = document.createElement('a'); + anchor.href = url; + return anchor.hostname; +} + +function getDeviceType() { + if ((/ipad|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(navigator.userAgent.toLowerCase()))) { + return 5; // 'tablet' + } + if ((/iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile/i.test(navigator.userAgent.toLowerCase()))) { + return 4; // 'mobile' + } + return 2; // 'desktop' +} + +function setOnAny(collection, key) { + for (let i = 0, result; i < collection.length; i++) { + result = deepAccess(collection[i], key); + if (result) { + return result; + } + } +} + +function flatten(arr) { + return [].concat(...arr); +} + +/* Turn bid request sizes into ut-compatible format */ +function transformSizes(requestSizes) { + if (!isArray(requestSizes)) { + return []; + } + + if (requestSizes.length === 2 && !isArray(requestSizes[0])) { + return [{ + w: parseInt(requestSizes[0], 10), + h: parseInt(requestSizes[1], 10) + }]; + } else if (isArray(requestSizes[0])) { + return requestSizes.map(item => + ({ + w: parseInt(item[0], 10), + h: parseInt(item[1], 10) + }) + ); + } + + return []; +} diff --git a/modules/codefuelBidAdapter.md b/modules/codefuelBidAdapter.md new file mode 100644 index 00000000000..321ae3b6644 --- /dev/null +++ b/modules/codefuelBidAdapter.md @@ -0,0 +1,111 @@ +# Overview + +``` +Module Name: Codefuel Adapter +Module Type: Bidder Adapter +Maintainer: hayimm@codefuel.com +``` + +# Description + +Module that connects to Codefuel bidder to fetch bids. +Display format is supported but not native format. Using OpenRTB standard. + +# Configuration + +## Bidder and usersync URLs + +The Codefuel adapter does not work without setting the correct bidder. +You will receive the URLs when contacting us. + +``` +pbjs.setConfig({ + codefuel: { + bidderUrl: 'https://ai-i-codefuel-ds-rtb-us-east-1-k8s-internal.seccint.com/prebid', + usersyncUrl: 'https://usersync-url.com' + } +}); +``` + + +# Test Native Parameters +``` + var adUnits = [ + code: '/19968336/prebid_native_example_1', + mediaTypes: { + native: { + image: { + required: false, + sizes: [100, 50] + }, + title: { + required: false, + len: 140 + }, + sponsoredBy: { + required: false + }, + clickUrl: { + required: false + }, + body: { + required: false + }, + icon: { + required: false, + sizes: [50, 50] + } + } + }, + bids: [{ + bidder: 'codefuel', + params: { + publisher: { + id: '2706', // required + name: 'Publishers Name', + domain: 'publisher.com' + }, + tagid: 'tag-id', + bcat: ['IAB1-1'], + badv: ['example.com'] + } + }] + ]; + + pbjs.setConfig({ + codefuel: { + bidderUrl: 'https://prebidtest.zemanta.com/api/bidder/prebidtest/bid/' + } + }); +``` + +# Test Display Parameters +``` + var adUnits = [ + code: '/19968336/prebid_display_example_1', + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + }, + bids: [{ + bidder: 'codefuel', + params: { + publisher: { + id: '2706', // required + name: 'Publishers Name', + domain: 'publisher.com' + }, + tagid: 'tag-id', + bcat: ['IAB1-1'], + badv: ['example.com'] + }, + }] + ]; + + pbjs.setConfig({ + codefuel: { + bidderUrl: 'https://prebidtest.zemanta.com/api/bidder/prebidtest/bid/' + } + }); +``` diff --git a/test/spec/modules/codefuelBidAdapter_spec.js b/test/spec/modules/codefuelBidAdapter_spec.js new file mode 100644 index 00000000000..808c221af07 --- /dev/null +++ b/test/spec/modules/codefuelBidAdapter_spec.js @@ -0,0 +1,316 @@ +import {expect} from 'chai'; +import {spec} from 'modules/codefuelBidAdapter.js'; +import {config} from 'src/config.js'; +import {server} from 'test/mocks/xhr'; + +const USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4515.159 Safari/537.36'; +const DEFAULT_USER_AGENT = window.navigator.userAgent; +const setUADefault = () => { window.navigator.__defineGetter__('userAgent', function () { return DEFAULT_USER_AGENT }) }; +const setUAMock = () => { window.navigator.__defineGetter__('userAgent', function () { return USER_AGENT }) }; + +describe('Codefuel Adapter', function () { + describe('Bid request and response', function () { + const commonBidRequest = { + bidder: 'codefuel', + params: { + publisher: { + id: 'publisher-id' + }, + }, + bidId: '2d6815a92ba1ba', + auctionId: '12043683-3254-4f74-8934-f941b085579e', + } + const nativeBidRequestParams = { + nativeParams: { + image: { + required: true, + sizes: [ + 120, + 100 + ], + sendId: true + }, + title: { + required: true, + sendId: true + }, + sponsoredBy: { + required: false + } + }, + } + + const displayBidRequestParams = { + sizes: [ + [ + 300, + 250 + ] + ] + } + + describe('isBidRequestValid', function () { + before(() => { + config.setConfig({ + codefuel: { + bidderUrl: 'https://bidder-url.com', + } + } + ) + }) + after(() => { + config.resetConfig() + }) + + it('should fail when bid is invalid', function () { + const bid = { + bidder: 'codefuel', + params: { + publisher: { + id: 'publisher-id', + } + }, + } + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + it('should not succeed when bid contains native params', function () { + const bid = { + bidder: 'codefuel', + params: { + publisher: { + id: 'publisher-id', + } + }, + ...nativeBidRequestParams, + } + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + it('should not succeed when bid contains only sizes', function () { + const bid = { + bidder: 'codefuel', + params: { + publisher: { + id: 'publisher-id', + } + }, + ...displayBidRequestParams, + } + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + it('should fail if publisher id is not set', function () { + const bid = { + bidder: 'codefuel', + ...nativeBidRequestParams, + } + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + + it('should fail if bidder url is not set', function () { + const bid = { + bidder: 'codefuel', + params: { + publisher: { + id: 'publisher-id', + } + }, + ...nativeBidRequestParams, + } + config.resetConfig() + expect(spec.isBidRequestValid(bid)).to.equal(false) + }) + }) + + describe('buildRequests', function () { + before(() => { + setUAMock() + config.setConfig({ + codefuel: { + bidderUrl: 'https://bidder-url.com', + } + } + ) + }) + after(() => { + config.resetConfig() + setUADefault() + }) + + const commonBidderRequest = { + timeout: 500, + auctionId: '12043683-3254-4f74-8934-f941b085579e', + refererInfo: { + referer: 'https://example.com/', + } + } + + it('should build display request', function () { + const bidRequest = { + ...commonBidRequest, + ...displayBidRequestParams, + } + const expectedData = { + cur: [ + 'USD' + ], + device: { + devicetype: 2, + ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4515.159 Safari/537.36' + }, + id: '12043683-3254-4f74-8934-f941b085579e', + imp: [ + { + banner: { + format: [ + { + h: 250, + w: 300 + } + ] + }, + id: '1' + } + ], + site: { + domain: 'example.com', + page: 'https://example.com/', + publisher: { + id: 'publisher-id' + } + }, + source: { + fd: 1 + }, + tmax: 500 + } + const res = spec.buildRequests([bidRequest], commonBidderRequest) + expect(res.url).to.equal('https://bidder-url.com') + expect(res.data).to.deep.equal(expectedData) + }) + + it('should pass bidder timeout', function () { + const bidRequest = { + ...commonBidRequest, + } + const bidderRequest = { + ...commonBidderRequest, + timeout: 500 + } + const res = spec.buildRequests([bidRequest], bidderRequest) + const resData = res.data + expect(resData.tmax).to.equal(500) + }); + }) + + describe('interpretResponse', function () { + it('should return empty array if no valid bids', function () { + const res = spec.interpretResponse({}, []) + expect(res).to.be.an('array').that.is.empty + }); + + it('should interpret display response', function () { + const serverResponse = { + body: { + id: '6b2eedc8-8ff5-46ef-adcf-e701b508943e', + seatbid: [ + { + bid: [ + { + id: 'd90fe7fa-28d7-11eb-8ce4-462a842a7cf9', + impid: '1', + price: 1.1, + nurl: 'http://example.com/win/${AUCTION_PRICE}', + adm: '
ad
', + adomain: [ + 'example.com' + ], + cid: '3865084', + crid: '29998660', + cat: [ + 'IAB10-2' + ], + w: 300, + h: 250 + } + ], + seat: 'acc-6536' + } + ], + bidid: 'd90fe7fa-28d7-11eb-8ce4-13d94bfa26f9', + cur: 'USD' + } + } + const request = { + bids: [ + { + ...commonBidRequest, + ...displayBidRequestParams + } + ] + } + const expectedRes = [ + { + requestId: request.bids[0].bidId, + cpm: 1.1, + creativeId: '29998660', + ttl: 360, + netRevenue: true, + currency: 'USD', + mediaType: 'banner', + ad: '
ad
', + width: 300, + height: 250, + meta: {'advertiserDomains': []} + } + ] + + const res = spec.interpretResponse(serverResponse, request) + expect(res).to.deep.equal(expectedRes) + }); + }) + }) + + describe('getUserSyncs', function () { + const usersyncUrl = 'https://usersync-url.com'; + beforeEach(() => { + config.setConfig({ + codefuel: { + usersyncUrl: usersyncUrl, + } + } + ) + }) + after(() => { + config.resetConfig() + }) + + it('should not return user sync if pixel enabled with codefuel config', function () { + const ret = spec.getUserSyncs({pixelEnabled: true}) + expect(ret).to.be.an('array').that.is.empty + }) + + it('should not return user sync if pixel disabled', function () { + const ret = spec.getUserSyncs({pixelEnabled: false}) + expect(ret).to.be.an('array').that.is.empty + }) + + it('should not return user sync if url is not set', function () { + config.resetConfig() + const ret = spec.getUserSyncs({pixelEnabled: true}) + expect(ret).to.be.an('array').that.is.empty + }) + + it('should not pass GDPR consent', function() { + expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, undefined)).to.to.be.an('array').that.is.empty + expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: false, consentString: 'foo'}, undefined)).to.be.an('array').that.is.empty + expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: true, consentString: undefined}, undefined)).to.be.an('array').that.is.empty + }); + + it('should not pass US consent', function() { + expect(spec.getUserSyncs({ pixelEnabled: true }, {}, undefined, '1NYN')).to.be.an('array').that.is.empty + }); + + it('should pass GDPR and US consent', function() { + expect(spec.getUserSyncs({ pixelEnabled: true }, {}, {gdprApplies: true, consentString: 'foo'}, '1NYN')).to.be.an('array').that.is.empty + }); + }) +}) From a8461eb8b90915107f3616d8423a56d000e6bf94 Mon Sep 17 00:00:00 2001 From: videobyte20 <85643547+videobyte20@users.noreply.github.com> Date: Fri, 15 Oct 2021 13:45:45 +0200 Subject: [PATCH 188/250] VideoByte Bid Adapter: added new params placementid & nid (#7578) * videobyte - added params: placementId, nid, content.url; changed endpoint; minor cleanup * videobyte - added params docs * videobyte - new params fixed tests * videobyte - new params fixed tests eslint --- modules/videobyteBidAdapter.js | 19 ++++--- modules/videobyteBidAdapter.md | 49 +++++++++++++++++++ test/spec/modules/videobyteBidAdapter_spec.js | 4 +- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/modules/videobyteBidAdapter.js b/modules/videobyteBidAdapter.js index 172e0c763f4..6e99b5bc42a 100644 --- a/modules/videobyteBidAdapter.js +++ b/modules/videobyteBidAdapter.js @@ -27,7 +27,7 @@ export const spec = { code: BIDDER_CODE, supportedMediaTypes: [VIDEO], VERSION: '1.0.0', - ENDPOINT: 'https://x.videobyte.com/ortb/', + ENDPOINT: 'https://x.videobyte.com/ortbhb', /** * Determines whether or not the given bid request is valid. @@ -53,13 +53,22 @@ export const spec = { return bidRequests.map(bidRequest => { const {params} = bidRequest; let pubId = params.pubId; + const placementId = params.placementId; + const nId = params.nid; if (bidRequest.params.video && bidRequest.params.video.e2etest) { logMessage('E2E test mode enabled'); pubId = 'e2etest' } + let baseEndpoint = spec.ENDPOINT + '?pid=' + pubId; + if (placementId) { + baseEndpoint += '&placementId=' + placementId + } + if (nId) { + baseEndpoint += '&nid=' + nId + } return { method: 'POST', - url: spec.ENDPOINT + pubId, + url: baseEndpoint, data: JSON.stringify(buildRequestData(bidRequest, bidderRequest)), } }); @@ -97,8 +106,6 @@ export const spec = { }; bidResponses.push(bidResponse) } - } else { - logError('invalid server response received'); } return bidResponses; }, @@ -228,7 +235,7 @@ function buildRequestData(bidRequest, bidderRequest) { // content if (videoParams.content && isPlainObject(videoParams.content)) { openrtbRequest.site.content = {}; - const contentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language']; + const contentStringKeys = ['id', 'title', 'series', 'season', 'genre', 'contentrating', 'language', 'url']; const contentNumberkeys = ['episode', 'prodq', 'context', 'livestream', 'len']; const contentArrayKeys = ['cat']; const contentObjectKeys = ['ext']; @@ -271,7 +278,7 @@ function validateVideo(bidRequest) { } if (!bidRequest.params.pubId) { - logError('failed validation: publisher id not declared'); + logError('failed validation: pubId not declared'); return false; } diff --git a/modules/videobyteBidAdapter.md b/modules/videobyteBidAdapter.md index fc2b0bce4b5..d0037b0972a 100644 --- a/modules/videobyteBidAdapter.md +++ b/modules/videobyteBidAdapter.md @@ -49,6 +49,55 @@ Module that connects to VideoByte's demand sources ] ``` +## Instream Video adUnit with placement, nid and content params +``` + var adUnits = [ + { + code: 'video1', + mediaTypes: { + video: { + context: 'instream', + playerSize: [640, 480], + mimes: ['video/mp4', 'application/javascript'], + protocols: [2,5], + api: [2], + position: 1, + delivery: [2], + minduration: 10, + maxduration: 30, + placement: 1, + playbackmethod: [1,5], + protocols: [2,5], + api: [2], + } + }, + bids: [ + { + bidder: 'videobyte', + params: { + bidfloor: 0.5, + pubId: 'e2etest', + placementId: '1234567', + nid: '1234', + video: { + content:{ + id: "uuid", + url: "https://videobyte.com/awesome-video.mp4", + title: "Awesome video", + genre: "Comedy", + language: "en", + season: "1", + series: "1", + + } + } + } + } + ] + } + ] +``` + # End To End testing mode By passing bid.params.video.e2etest = true you will be able to receive a test creative diff --git a/test/spec/modules/videobyteBidAdapter_spec.js b/test/spec/modules/videobyteBidAdapter_spec.js index b8e41829031..f7ea0698956 100644 --- a/test/spec/modules/videobyteBidAdapter_spec.js +++ b/test/spec/modules/videobyteBidAdapter_spec.js @@ -153,7 +153,7 @@ describe('VideoByteBidAdapter', function () { it('should create a POST request for every bid', function () { const requests = spec.buildRequests([bidRequest], bidderRequest); expect(requests[0].method).to.equal('POST'); - expect(requests[0].url).to.equal(spec.ENDPOINT + bidRequest.params.pubId); + expect(requests[0].url).to.equal(spec.ENDPOINT + '?pid=' + bidRequest.params.pubId); }); it('should attach request data', function () { @@ -172,7 +172,7 @@ describe('VideoByteBidAdapter', function () { bidRequest.params.video.e2etest = true; const requests = spec.buildRequests([bidRequest], bidderRequest); expect(requests[0].method).to.equal('POST'); - expect(requests[0].url).to.equal(spec.ENDPOINT + 'e2etest'); + expect(requests[0].url).to.equal(spec.ENDPOINT + '?pid=e2etest'); }); it('should attach End 2 End test data', function () { From c5efe4c195a7624da78989afce3dbbd724c85473 Mon Sep 17 00:00:00 2001 From: Catalin Ciocov Date: Sat, 16 Oct 2021 00:12:31 +0300 Subject: [PATCH 189/250] InskinBidAdapter: add schain object from the schain module if used by the publisher (#7541) * Add schain object from the schain module if used by the publisher * Fix linting issues --- modules/inskinBidAdapter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/inskinBidAdapter.js b/modules/inskinBidAdapter.js index b6d23bb7207..781bca90660 100644 --- a/modules/inskinBidAdapter.js +++ b/modules/inskinBidAdapter.js @@ -55,7 +55,11 @@ export const spec = { parallel: true }, validBidRequests[0].params); - if (data.publisherId) { + if (validBidRequests[0].schain) { + data.rtb = { + schain: validBidRequests[0].schain + }; + } else if (data.publisherId) { data.rtb = { schain: { ext: { @@ -63,10 +67,10 @@ export const spec = { } } }; - - delete data.publisherId; } + delete data.publisherId; + data.keywords = data.keywords || []; const restrictions = []; From 38b981672f018dcc16d0dbbec6f85b99a086d818 Mon Sep 17 00:00:00 2001 From: Samuel Adu Date: Fri, 15 Oct 2021 22:39:13 +0100 Subject: [PATCH 190/250] Yahoo user identity module - connectId: initial release (#7519) --- modules/.submodules.json | 1 + modules/connectIdSystem.js | 104 ++++++++++++ modules/connectIdSystem.md | 33 ++++ modules/userId/eids.js | 18 +++ modules/userId/eids.md | 7 + modules/userId/userId.md | 12 ++ test/spec/modules/connectIdSystem_spec.js | 189 ++++++++++++++++++++++ 7 files changed, 364 insertions(+) create mode 100644 modules/connectIdSystem.js create mode 100644 modules/connectIdSystem.md create mode 100644 test/spec/modules/connectIdSystem_spec.js diff --git a/modules/.submodules.json b/modules/.submodules.json index 3ac1e1ef59f..ea3f556dbb4 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -5,6 +5,7 @@ "akamaiDAPIdSystem", "amxIdSystem", "britepoolIdSystem", + "connectIdSystem", "criteoIdSystem", "deepintentDpesIdSystem", "dmdIdSystem", diff --git a/modules/connectIdSystem.js b/modules/connectIdSystem.js new file mode 100644 index 00000000000..ac44a8b5a2d --- /dev/null +++ b/modules/connectIdSystem.js @@ -0,0 +1,104 @@ +/** + * This module adds support for Yahoo ConnectID to the user ID module system. + * The {@link module:modules/userId} module is required + * @module modules/connectIdSystem + * @requires module:modules/userId + */ + +import {ajax} from '../src/ajax.js'; +import {submodule} from '../src/hook.js'; +import {logError, formatQS} from '../src/utils.js'; +import includes from 'core-js-pure/features/array/includes.js'; + +const MODULE_NAME = 'connectId'; +const VENDOR_ID = 25; +const PLACEHOLDER = '__PIXEL_ID__'; +const UPS_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PLACEHOLDER}/fed`; + +function isEUConsentRequired(consentData) { + return !!(consentData && consentData.gdpr && consentData.gdpr.gdprApplies); +} + +/** @type {Submodule} */ +export const connectIdSubmodule = { + /** + * used to link submodule with config + * @type {string} + */ + name: MODULE_NAME, + /** + * @type {Number} + */ + gvlid: VENDOR_ID, + /** + * decode the stored id value for passing to bid requests + * @function + * @returns {{connectId: string} | undefined} + */ + decode(value) { + return (typeof value === 'object' && value.connectid) + ? {connectId: value.connectid} : undefined; + }, + /** + * Gets the Yahoo ConnectID + * @function + * @param {SubmoduleConfig} [config] + * @param {ConsentData} [consentData] + * @returns {IdResponse|undefined} + */ + getId(config, consentData) { + const params = config.params || {}; + if (!params || typeof params.he !== 'string' || + (typeof params.pixelId === 'undefined' && typeof params.endpoint === 'undefined')) { + logError('The connectId submodule requires the \'he\' and \'pixelId\' parameters to be defined.'); + return; + } + + const data = { + '1p': includes([1, '1', true], params['1p']) ? '1' : '0', + he: params.he, + gdpr: isEUConsentRequired(consentData) ? '1' : '0', + gdpr_consent: isEUConsentRequired(consentData) ? consentData.gdpr.consentString : '', + us_privacy: consentData && consentData.uspConsent ? consentData.uspConsent : '' + }; + + if (params.pixelId) { + data.pixelId = params.pixelId + } + + const resp = function (callback) { + const callbacks = { + success: response => { + let responseObj; + if (response) { + try { + responseObj = JSON.parse(response); + } catch (error) { + logError(error); + } + } + callback(responseObj); + }, + error: error => { + logError(`${MODULE_NAME}: ID fetch encountered an error`, error); + callback(); + } + }; + const endpoint = UPS_ENDPOINT.replace(PLACEHOLDER, params.pixelId); + let url = `${params.endpoint || endpoint}?${formatQS(data)}`; + connectIdSubmodule.getAjaxFn()(url, callbacks, null, {method: 'GET', withCredentials: true}); + }; + return {callback: resp}; + }, + + /** + * Return the function used to perform XHR calls. + * Utilised for each of testing. + * @returns {Function} + */ + getAjaxFn() { + return ajax; + } +}; + +submodule('userId', connectIdSubmodule); diff --git a/modules/connectIdSystem.md b/modules/connectIdSystem.md new file mode 100644 index 00000000000..f2153e1b6cb --- /dev/null +++ b/modules/connectIdSystem.md @@ -0,0 +1,33 @@ +## Yahoo ConnectID User ID Submodule + +Yahoo ConnectID user ID Module. + +### Prebid Params + +``` +pbjs.setConfig({ + userSync: { + userIds: [{ + name: 'connectId', + storage: { + name: 'connectId', + type: 'html5', + expires: 15 + }, + params: { + pixelId: 58776, + he: '0bef996248d63cea1529cb86de31e9547a712d9f380146e98bbd39beec70355a' + } + }] + } +}); +``` +## Parameter Descriptions for the `usersync` Configuration Section +The below parameters apply only to the Yahoo ConnectID user ID Module. + +| Param under usersync.userIds[] | Scope | Type | Description | Example | +| --- | --- | --- | --- | --- | +| name | Required | String | ID value for the Yahoo ConnectID module - `"connectId"` | `"connectId"` | +| params | Required | Object | Data for Yahoo ConnectID initialization. | | +| params.pixelId | Required | Number | The Yahoo supplied publisher specific pixel Id | `8976` | +| params.he | Required | String | The SHA-256 hashed user email address | `"529cb86de31e9547a712d9f380146e98bbd39beec"` | diff --git a/modules/userId/eids.js b/modules/userId/eids.js index 0f159c4f33b..87b6ecc1f1c 100644 --- a/modules/userId/eids.js +++ b/modules/userId/eids.js @@ -181,15 +181,18 @@ const USER_IDS_CONFIG = { source: 'neustar.biz', atype: 1 }, + // MediaWallah OpenLink 'mwOpenLinkId': { source: 'mediawallahscript.com', atype: 1 }, + 'tapadId': { source: 'tapad.com', atype: 1 }, + // Novatiq Snowflake 'novatiq': { getValue: function(data) { @@ -198,6 +201,7 @@ const USER_IDS_CONFIG = { source: 'novatiq.com', atype: 1 }, + 'uid2': { source: 'uidapi.com', atype: 3, @@ -205,40 +209,54 @@ const USER_IDS_CONFIG = { return data.id; } }, + // Akamai Data Activation Platform (DAP) 'dapId': { source: 'akamai.com', atype: 1 }, + 'deepintentId': { source: 'deepintent.com', atype: 3 }, + // Admixer Id 'admixerId': { source: 'admixer.net', atype: 3 }, + // Adtelligent Id 'adtelligentId': { source: 'adtelligent.com', atype: 3 }, + amxId: { source: 'amxrtb.com', atype: 1, }, + 'publinkId': { source: 'epsilon.com', atype: 3 }, + 'kpuid': { source: 'kpuid.com', atype: 3 }, + 'imuid': { source: 'intimatemerger.com', atype: 1 + }, + + // Yahoo ConnectID + 'connectId': { + source: 'yahoo.com', + atype: 3 } }; diff --git a/modules/userId/eids.md b/modules/userId/eids.md index a8e73216327..679bf5ffe27 100644 --- a/modules/userId/eids.md +++ b/modules/userId/eids.md @@ -210,6 +210,13 @@ userIdAsEids = [ id: 'some-random-id-value', atype: 3 }] + }, + { + source: 'yahoo.com', + uids: [{ + id: 'some-random-id-value', + atype: 3 + }] } ] ``` diff --git a/modules/userId/userId.md b/modules/userId/userId.md index 88460093c63..095685aba3d 100644 --- a/modules/userId/userId.md +++ b/modules/userId/userId.md @@ -285,6 +285,18 @@ pbjs.setConfig({ params: { cid: 5126 // Set your Intimate Merger Customer ID here for production } + }, + { + name: 'connectId', + params: { + pixelId: 58776, + he: '0bef996248d63cea1529cb86de31e9547a712d9f380146e98bbd39beec70355a' + }, + storage: { + name: 'connectId', + type: 'html5', + expires: 15 + } }], syncDelay: 5000 } diff --git a/test/spec/modules/connectIdSystem_spec.js b/test/spec/modules/connectIdSystem_spec.js new file mode 100644 index 00000000000..41135a74515 --- /dev/null +++ b/test/spec/modules/connectIdSystem_spec.js @@ -0,0 +1,189 @@ +import {expect} from 'chai'; +import {parseQS} from 'src/utils.js'; +import {connectIdSubmodule} from 'modules/connectIdSystem.js'; + +describe('Yahoo ConnectID Submodule', () => { + const HASHED_EMAIL = '6bda6f2fa268bf0438b5423a9861a2cedaa5dec163c03f743cfe05c08a8397b2'; + const PIXEL_ID = '1234'; + const PROD_ENDPOINT = `https://ups.analytics.yahoo.com/ups/${PIXEL_ID}/fed`; + const OVERRIDE_ENDPOINT = 'https://foo/bar'; + + it('should have the correct module name declared', () => { + expect(connectIdSubmodule.name).to.equal('connectId'); + }); + + it('should have the correct TCFv2 Vendor ID declared', () => { + expect(connectIdSubmodule.gvlid).to.equal(25); + }); + + describe('getId()', () => { + let ajaxStub; + let getAjaxFnStub; + let consentData; + beforeEach(() => { + ajaxStub = sinon.stub(); + getAjaxFnStub = sinon.stub(connectIdSubmodule, 'getAjaxFn'); + getAjaxFnStub.returns(ajaxStub); + + consentData = { + gdpr: { + gdprApplies: 1, + consentString: 'GDPR_CONSENT_STRING' + }, + uspConsent: 'USP_CONSENT_STRING' + }; + }); + + afterEach(() => { + getAjaxFnStub.restore(); + }); + + function invokeGetIdAPI(configParams, consentData) { + let result = connectIdSubmodule.getId({ + params: configParams + }, consentData); + if (typeof result === 'object') { + result.callback(sinon.stub()); + } + return result; + } + + it('returns undefined if he and pixelId params are not passed', () => { + expect(invokeGetIdAPI({}, consentData)).to.be.undefined; + expect(ajaxStub.callCount).to.equal(0); + }); + + it('returns undefined if the pixelId param is not passed', () => { + expect(invokeGetIdAPI({ + he: HASHED_EMAIL + }, consentData)).to.be.undefined; + expect(ajaxStub.callCount).to.equal(0); + }); + + it('returns undefined if the he param is not passed', () => { + expect(invokeGetIdAPI({ + pixelId: PIXEL_ID + }, consentData)).to.be.undefined; + expect(ajaxStub.callCount).to.equal(0); + }); + + it('returns an object with the callback function if the correct params are passed', () => { + let result = invokeGetIdAPI({ + he: HASHED_EMAIL, + pixelId: PIXEL_ID + }, consentData); + expect(result).to.be.an('object').that.has.all.keys('callback'); + expect(result.callback).to.be.a('function'); + }); + + it('Makes an ajax GET request to the production API endpoint with query params', () => { + invokeGetIdAPI({ + he: HASHED_EMAIL, + pixelId: PIXEL_ID + }, consentData); + + const expectedParams = { + he: HASHED_EMAIL, + pixelId: PIXEL_ID, + '1p': '0', + gdpr: '1', + gdpr_consent: consentData.gdpr.consentString, + us_privacy: consentData.uspConsent + }; + const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); + + expect(ajaxStub.firstCall.args[0].indexOf(`${PROD_ENDPOINT}?`)).to.equal(0); + expect(requestQueryParams).to.deep.equal(expectedParams); + expect(ajaxStub.firstCall.args[3]).to.deep.equal({method: 'GET', withCredentials: true}); + }); + + it('Makes an ajax GET request to the specified override API endpoint with query params', () => { + invokeGetIdAPI({ + he: HASHED_EMAIL, + endpoint: OVERRIDE_ENDPOINT + }, consentData); + + const expectedParams = { + he: HASHED_EMAIL, + '1p': '0', + gdpr: '1', + gdpr_consent: consentData.gdpr.consentString, + us_privacy: consentData.uspConsent + }; + const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); + + expect(ajaxStub.firstCall.args[0].indexOf(`${OVERRIDE_ENDPOINT}?`)).to.equal(0); + expect(requestQueryParams).to.deep.equal(expectedParams); + expect(ajaxStub.firstCall.args[3]).to.deep.equal({method: 'GET', withCredentials: true}); + }); + + it('sets the callbacks param of the ajax function call correctly', () => { + invokeGetIdAPI({ + he: HASHED_EMAIL, + pixelId: PIXEL_ID, + }, consentData); + + expect(ajaxStub.firstCall.args[1]).to.be.an('object').that.has.all.keys(['success', 'error']); + }); + + it('sets GDPR consent data flag correctly when call is under GDPR jurisdiction.', () => { + invokeGetIdAPI({ + he: HASHED_EMAIL, + pixelId: PIXEL_ID, + }, consentData); + + const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); + expect(requestQueryParams.gdpr).to.equal('1'); + expect(requestQueryParams.gdpr_consent).to.equal(consentData.gdpr.consentString); + }); + + it('sets GDPR consent data flag correctly when call is NOT under GDPR jurisdiction.', () => { + consentData.gdpr.gdprApplies = false; + + invokeGetIdAPI({ + he: HASHED_EMAIL, + pixelId: PIXEL_ID, + }, consentData); + + const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); + expect(requestQueryParams.gdpr).to.equal('0'); + expect(requestQueryParams.gdpr_consent).to.equal(''); + }); + + [1, '1', true].forEach(firstPartyParamValue => { + it(`sets 1p payload property to '1' for a config value of ${firstPartyParamValue}`, () => { + invokeGetIdAPI({ + '1p': firstPartyParamValue, + he: HASHED_EMAIL, + pixelId: PIXEL_ID, + }, consentData); + + const requestQueryParams = parseQS(ajaxStub.firstCall.args[0].split('?')[1]); + expect(requestQueryParams['1p']).to.equal('1'); + }); + }); + }); + + describe('decode()', () => { + const VALID_API_RESPONSES = [{ + key: 'connectid', + expected: '4567', + payload: { + connectid: '4567' + } + }]; + VALID_API_RESPONSES.forEach(responseData => { + it('should return a newly constructed object with the connect ID for a payload with ${responseData.key} key(s)', () => { + expect(connectIdSubmodule.decode(responseData.payload)).to.deep.equal( + {connectId: responseData.expected} + ); + }); + }); + + [{}, '', {foo: 'bar'}].forEach((response) => { + it(`should return undefined for an invalid response "${JSON.stringify(response)}"`, () => { + expect(connectIdSubmodule.decode(response)).to.be.undefined; + }); + }); + }); +}); From 0e506354b744834926c37d3ae5c90d22ced5e0d1 Mon Sep 17 00:00:00 2001 From: Andrea Fassina Date: Mon, 18 Oct 2021 11:37:19 +0200 Subject: [PATCH 191/250] new BIDDER_ERROR event and new onBidderError function called when ajax call fail (#7438) --- src/adapterManager.js | 5 ++ src/adapters/bidderFactory.js | 7 +-- src/constants.json | 1 + test/spec/unit/core/adapterManager_spec.js | 31 +++++++++++ test/spec/unit/core/bidderFactory_spec.js | 62 +++++++++++++++++++++- 5 files changed, 102 insertions(+), 4 deletions(-) diff --git a/src/adapterManager.js b/src/adapterManager.js index 9a3d05a4321..3ee0dff81ad 100644 --- a/src/adapterManager.js +++ b/src/adapterManager.js @@ -621,4 +621,9 @@ adapterManager.callBidViewableBidder = function(bidder, bid) { tryCallBidderMethod(bidder, 'onBidViewable', bid); }; +adapterManager.callBidderError = function(bidder, error, bidderRequest) { + const param = { error, bidderRequest }; + tryCallBidderMethod(bidder, 'onBidderError', param); +}; + export default adapterManager; diff --git a/src/adapters/bidderFactory.js b/src/adapters/bidderFactory.js index fa0ad36e7ff..fc736926dd7 100644 --- a/src/adapters/bidderFactory.js +++ b/src/adapters/bidderFactory.js @@ -335,10 +335,11 @@ export function newBidder(spec) { // If the server responds with an error, there's not much we can do. Log it, and make sure to // call onResponse() so that we're one step closer to calling done(). - function onFailure(err) { + function onFailure(errorMessage, error) { onTimelyResponse(spec.code); - - logError(`Server call for ${spec.code} failed: ${err}. Continuing without bids.`); + adapterManager.callBidderError(spec.code, error, bidderRequest) + events.emit(CONSTANTS.EVENTS.BIDDER_ERROR, { error, bidderRequest }); + logError(`Server call for ${spec.code} failed: ${errorMessage} ${error.status}. Continuing without bids.`); onResponse(); } } diff --git a/src/constants.json b/src/constants.json index 114cedf112b..055ccd8aacb 100644 --- a/src/constants.json +++ b/src/constants.json @@ -32,6 +32,7 @@ "NO_BID": "noBid", "BID_WON": "bidWon", "BIDDER_DONE": "bidderDone", + "BIDDER_ERROR": "bidderError", "SET_TARGETING": "setTargeting", "BEFORE_REQUEST_BIDS": "beforeRequestBids", "BEFORE_BIDDER_HTTP": "beforeBidderHttp", diff --git a/test/spec/unit/core/adapterManager_spec.js b/test/spec/unit/core/adapterManager_spec.js index f33c9139e5f..75fd74748a0 100644 --- a/test/spec/unit/core/adapterManager_spec.js +++ b/test/spec/unit/core/adapterManager_spec.js @@ -436,6 +436,37 @@ describe('adapterManager tests', function () { }); }); // end onBidViewable + describe('onBidderError', function () { + const bidder = 'appnexus'; + const appnexusSpec = { onBidderError: sinon.stub() }; + const appnexusAdapter = { + bidder, + getSpec: function() { return appnexusSpec; }, + } + before(function () { + config.setConfig({s2sConfig: { enabled: false }}); + }); + + beforeEach(function () { + adapterManager.bidderRegistry[bidder] = appnexusAdapter; + }); + + afterEach(function () { + delete adapterManager.bidderRegistry[bidder]; + }); + + it('should call spec\'s onBidderError callback when callBidderError is called', function () { + const bidderRequest = getBidRequests().find(bidRequest => bidRequest.bidderCode === bidder); + const xhrErrorMock = { + status: 500, + statusText: 'Internal Server Error' + }; + adapterManager.callBidderError(bidder, xhrErrorMock, bidderRequest); + sinon.assert.calledOnce(appnexusSpec.onBidderError); + sinon.assert.calledWithExactly(appnexusSpec.onBidderError, { error: xhrErrorMock, bidderRequest }); + }); + }); // end onBidderError + describe('S2S tests', function () { beforeEach(function () { config.setConfig({s2sConfig: CONFIG}); diff --git a/test/spec/unit/core/bidderFactory_spec.js b/test/spec/unit/core/bidderFactory_spec.js index 48c17a90398..4dc79deaf85 100644 --- a/test/spec/unit/core/bidderFactory_spec.js +++ b/test/spec/unit/core/bidderFactory_spec.js @@ -552,17 +552,27 @@ describe('bidders created by newBidder', function () { describe('when the ajax call fails', function () { let ajaxStub; + let callBidderErrorStub; + let eventEmitterStub; + let xhrErrorMock = { + status: 500, + statusText: 'Internal Server Error' + }; beforeEach(function () { ajaxStub = sinon.stub(ajax, 'ajax').callsFake(function(url, callbacks) { - callbacks.error('ajax call failed.'); + callbacks.error('ajax call failed.', xhrErrorMock); }); + callBidderErrorStub = sinon.stub(adapterManager, 'callBidderError'); + eventEmitterStub = sinon.stub(events, 'emit'); addBidResponseStub.reset(); doneStub.reset(); }); afterEach(function () { ajaxStub.restore(); + callBidderErrorStub.restore(); + eventEmitterStub.restore(); }); it('should not spec.interpretResponse()', function () { @@ -580,6 +590,14 @@ describe('bidders created by newBidder', function () { expect(spec.interpretResponse.called).to.equal(false); expect(doneStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.firstCall.args[0]).to.equal(CODE); + expect(callBidderErrorStub.firstCall.args[1]).to.equal(xhrErrorMock); + expect(callBidderErrorStub.firstCall.args[2]).to.equal(MOCK_BIDS_REQUEST); + sinon.assert.calledWith(eventEmitterStub, CONSTANTS.EVENTS.BIDDER_ERROR, { + error: xhrErrorMock, + bidderRequest: MOCK_BIDS_REQUEST + }); }); it('should not add bids for each adunit code into the auction', function () { @@ -598,6 +616,14 @@ describe('bidders created by newBidder', function () { expect(addBidResponseStub.callCount).to.equal(0); expect(doneStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.firstCall.args[0]).to.equal(CODE); + expect(callBidderErrorStub.firstCall.args[1]).to.equal(xhrErrorMock); + expect(callBidderErrorStub.firstCall.args[2]).to.equal(MOCK_BIDS_REQUEST); + sinon.assert.calledWith(eventEmitterStub, CONSTANTS.EVENTS.BIDDER_ERROR, { + error: xhrErrorMock, + bidderRequest: MOCK_BIDS_REQUEST + }); }); it('should call spec.getUserSyncs() with no responses', function () { @@ -616,6 +642,40 @@ describe('bidders created by newBidder', function () { expect(spec.getUserSyncs.calledOnce).to.equal(true); expect(spec.getUserSyncs.firstCall.args[1]).to.deep.equal([]); expect(doneStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.firstCall.args[0]).to.equal(CODE); + expect(callBidderErrorStub.firstCall.args[1]).to.equal(xhrErrorMock); + expect(callBidderErrorStub.firstCall.args[2]).to.equal(MOCK_BIDS_REQUEST); + sinon.assert.calledWith(eventEmitterStub, CONSTANTS.EVENTS.BIDDER_ERROR, { + error: xhrErrorMock, + bidderRequest: MOCK_BIDS_REQUEST + }); + }); + + it('should call spec.getUserSyncs() with no responses', function () { + const bidder = newBidder(spec); + + spec.isBidRequestValid.returns(true); + spec.buildRequests.returns({ + method: 'POST', + url: 'test.url.com', + data: {} + }); + spec.getUserSyncs.returns([]); + + bidder.callBids(MOCK_BIDS_REQUEST, addBidResponseStub, doneStub, ajaxStub, onTimelyResponseStub, wrappedCallback); + + expect(spec.getUserSyncs.calledOnce).to.equal(true); + expect(spec.getUserSyncs.firstCall.args[1]).to.deep.equal([]); + expect(doneStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.calledOnce).to.equal(true); + expect(callBidderErrorStub.firstCall.args[0]).to.equal(CODE); + expect(callBidderErrorStub.firstCall.args[1]).to.equal(xhrErrorMock); + expect(callBidderErrorStub.firstCall.args[2]).to.equal(MOCK_BIDS_REQUEST); + sinon.assert.calledWith(eventEmitterStub, CONSTANTS.EVENTS.BIDDER_ERROR, { + error: xhrErrorMock, + bidderRequest: MOCK_BIDS_REQUEST + }); }); }); }); From 7123fa27a7fce0050f2b734493b486a25e72075b Mon Sep 17 00:00:00 2001 From: Ilya Medvedev Date: Mon, 18 Oct 2021 21:04:13 +0600 Subject: [PATCH 192/250] Limelight Digital Bid Adapter: Add user sync (#7560) * Limelight Digital Bid Adapter: Add user sync * improve tests * Improve unique size checking * fix adunit sizes * remove unused variable --- modules/limelightDigitalBidAdapter.js | 24 ++- .../limelightDigitalBidAdapter_spec.js | 156 +++++++++++++++++- 2 files changed, 177 insertions(+), 3 deletions(-) diff --git a/modules/limelightDigitalBidAdapter.js b/modules/limelightDigitalBidAdapter.js index 5ad20924067..fad4b6b96b3 100644 --- a/modules/limelightDigitalBidAdapter.js +++ b/modules/limelightDigitalBidAdapter.js @@ -1,4 +1,4 @@ -import { logMessage, groupBy, uniques } from '../src/utils.js'; +import { logMessage, groupBy, uniques, flatten, deepAccess } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import {ajax} from '../src/ajax.js'; @@ -92,6 +92,26 @@ export const spec = { } return bidResponses; }, + + getUserSyncs: (syncOptions, serverResponses, gdprConsent, uspConsent) => { + const syncs = serverResponses.map(response => response.body).reduce(flatten, []) + .map(response => deepAccess(response, 'ext.sync')).filter(Boolean); + const iframeSyncUrls = !syncOptions.iframeEnabled ? [] : syncs.map(sync => sync.iframe).filter(Boolean) + .filter(uniques).map(url => { + return { + type: 'iframe', + url: url + } + }); + const pixelSyncUrls = !syncOptions.pixelEnabled ? [] : syncs.map(sync => sync.pixel).filter(Boolean) + .filter(uniques).map(url => { + return { + type: 'image', + url: url + } + }); + return [iframeSyncUrls, pixelSyncUrls].reduce(flatten, []); + } }; registerBidder(spec); @@ -125,7 +145,7 @@ function buildPlacement(bidRequest) { break; } } - sizes = (sizes || []).concat(bidRequest.sizes || []).filter(uniques); + sizes = (sizes || []).concat(bidRequest.sizes || []); return { host: bidRequest.params.host, adUnit: { diff --git a/test/spec/modules/limelightDigitalBidAdapter_spec.js b/test/spec/modules/limelightDigitalBidAdapter_spec.js index 336f199eb4f..1a33bbe6cb9 100644 --- a/test/spec/modules/limelightDigitalBidAdapter_spec.js +++ b/test/spec/modules/limelightDigitalBidAdapter_spec.js @@ -299,6 +299,160 @@ describe('limelightDigitalAdapter', function () { expect(spec.interpretResponse(bidResponses)).to.deep.equal([ resObject ]); }); }); + describe('getUserSyncs', function () { + const serverResponses = [ + { + body: [ + { + ext: { + sync: { + iframe: 'iframeUrl', + } + } + }, + { + ext: { + sync: { + pixel: 'pixelUrl' + } + } + }, + {}, + { + ext: {} + }, + { + ext: { + sync: {} + } + }, + { + ext: { + sync: { + iframe: 'iframeUrl2', + pixel: 'pixelUrl3' + } + } + } + ] + }, + { + body: [ + { + ext: { + sync: { + iframe: 'iframeUrl2', + pixel: 'pixelUrl2' + } + } + }, + { + ext: { + sync: { + iframe: 'iframeUrl3', + pixel: 'pixelUrl3' + } + } + } + ] + } + ]; + it('should return empty array if server responses do not contain sync urls', function () { + const syncOptions = { + iframeEnabled: true, + pixelEnabled: true + }; + const serverResponsesWithoutSyncUrls = serverResponses.map(serverResponse => { + const serverResponseWithoutSyncUrls = Object.assign({}, serverResponse); + serverResponseWithoutSyncUrls.body = serverResponse.body.map(serverResponseBody => { + const serverResponseBodyWithoutSyncUrls = Object.assign({}, serverResponseBody); + delete serverResponseBodyWithoutSyncUrls.ext; + return serverResponseBodyWithoutSyncUrls; + }); + return serverResponseWithoutSyncUrls; + }); + expect(spec.getUserSyncs(syncOptions, serverResponsesWithoutSyncUrls)).to.be.an('array').that.is.empty; + }); + it('should return empty array if all sync types are disabled', function () { + const syncOptions = { + iframeEnabled: false, + pixelEnabled: false + }; + expect(spec.getUserSyncs(syncOptions, serverResponses)).to.be.an('array').that.is.empty; + }); + it('should return iframe sync urls if iframe sync is enabled', function () { + const syncOptions = { + iframeEnabled: true, + pixelEnabled: false + }; + expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([ + { + type: 'iframe', + url: 'iframeUrl' + }, + { + type: 'iframe', + url: 'iframeUrl2' + }, + { + type: 'iframe', + url: 'iframeUrl3' + } + ]); + }); + it('should return image sync urls if pixel sync is enabled', function () { + const syncOptions = { + iframeEnabled: false, + pixelEnabled: true + }; + expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([ + { + type: 'image', + url: 'pixelUrl' + }, + { + type: 'image', + url: 'pixelUrl3' + }, + { + type: 'image', + url: 'pixelUrl2' + } + ]); + }); + it('should return all sync urls if all sync types are enabled', function () { + const syncOptions = { + iframeEnabled: true, + pixelEnabled: true + } + expect(spec.getUserSyncs(syncOptions, serverResponses)).to.deep.equal([ + { + type: 'iframe', + url: 'iframeUrl' + }, + { + type: 'iframe', + url: 'iframeUrl2' + }, + { + type: 'iframe', + url: 'iframeUrl3' + }, + { + type: 'image', + url: 'pixelUrl' + }, + { + type: 'image', + url: 'pixelUrl3' + }, + { + type: 'image', + url: 'pixelUrl2' + } + ]); + }); + }); }); function validateAdUnit(adUnit, bid) { @@ -323,5 +477,5 @@ function validateAdUnit(adUnit, bid) { width: size[0], height: size[1] } - })) + })); } From c225b875754dbc30f40c99cf38a207d80233b703 Mon Sep 17 00:00:00 2001 From: Luigi Sayson <48766825+luigi-sayson@users.noreply.github.com> Date: Mon, 18 Oct 2021 09:08:26 -0700 Subject: [PATCH 193/250] OpenX Bid Adapter: Handle site.content.data & bug fixes (#7576) * make OpenX bid adapter send data from site.content.data * lint * fix merkleId for openxBidAdapter Co-authored-by: Brian Schmidt --- modules/openxBidAdapter.js | 56 ++++++---- test/spec/modules/openxBidAdapter_spec.js | 124 +++++++++++++++++++--- 2 files changed, 145 insertions(+), 35 deletions(-) diff --git a/modules/openxBidAdapter.js b/modules/openxBidAdapter.js index f393ea87569..f27c0316476 100644 --- a/modules/openxBidAdapter.js +++ b/modules/openxBidAdapter.js @@ -256,27 +256,14 @@ function buildCommonQueryParamsFromBids(bids, bidderRequest) { nocache: new Date().getTime() }; - const firstPartyData = config.getConfig('ortb2.user.data') - if (Array.isArray(firstPartyData) && firstPartyData.length > 0) { - // extract and merge valid segments by provider/taxonomy - const fpd = firstPartyData - .filter( - data => (Array.isArray(data.segment) && - data.segment.length > 0 && - data.name !== undefined && - data.name.length > 0) - ) - .reduce((acc, data) => { - const name = typeof data.ext === 'object' && data.ext.segtax ? `${data.name}/${data.ext.segtax}` : data.name; - acc[name] = (acc[name] || []).concat(data.segment.map(seg => seg.id)); - return acc; - }, {}) - const sm = Object.keys(fpd) - .map((name, _) => name + ':' + fpd[name].join('|')) - .join(',') - if (sm.length > 0) { - defaultParams.sm = encodeURIComponent(sm); - } + const userDataSegments = buildFpdQueryParams('ortb2.user.data'); + if (userDataSegments.length > 0) { + defaultParams.sm = userDataSegments; + } + + const siteContentDataSegments = buildFpdQueryParams('ortb2.site.content.data'); + if (siteContentDataSegments.length > 0) { + defaultParams.scsm = siteContentDataSegments; } if (bids[0].params.platform) { @@ -317,12 +304,37 @@ function buildCommonQueryParamsFromBids(bids, bidderRequest) { return defaultParams; } +function buildFpdQueryParams(fpdPath) { + const firstPartyData = config.getConfig(fpdPath); + if (!Array.isArray(firstPartyData) || !firstPartyData.length) { + return ''; + } + const fpd = firstPartyData + .filter( + data => (Array.isArray(data.segment) && + data.segment.length > 0 && + data.name !== undefined && + data.name.length > 0) + ) + .reduce((acc, data) => { + const name = typeof data.ext === 'object' && data.ext.segtax ? `${data.name}/${data.ext.segtax}` : data.name; + acc[name] = (acc[name] || []).concat(data.segment.map(seg => seg.id)); + return acc; + }, {}) + return Object.keys(fpd) + .map((name, _) => name + ':' + [...new Set(fpd[name])].join('|')) + .join(',') +} + function appendUserIdsToQueryParams(queryParams, userIds) { _each(userIds, (userIdObjectOrValue, userIdProviderKey) => { const key = USER_ID_CODE_TO_QUERY_ARG[userIdProviderKey]; if (USER_ID_CODE_TO_QUERY_ARG.hasOwnProperty(userIdProviderKey)) { switch (userIdProviderKey) { + case 'merkleId': + queryParams[key] = userIdObjectOrValue.id; + break; case 'flocId': queryParams[key] = userIdObjectOrValue.id; break; @@ -333,7 +345,7 @@ function appendUserIdsToQueryParams(queryParams, userIds) { queryParams[key] = userIdObjectOrValue.lipbid; if (Array.isArray(userIdObjectOrValue.segments) && userIdObjectOrValue.segments.length > 0) { const liveIntentSegments = 'liveintent:' + userIdObjectOrValue.segments.join('|') - queryParams.sm = `${queryParams.sm ? queryParams.sm + encodeURIComponent(',') : ''}${encodeURIComponent(liveIntentSegments)}`; + queryParams.sm = `${queryParams.sm ? queryParams.sm + ',' : ''}${liveIntentSegments}`; } break; case 'parrableId': diff --git a/test/spec/modules/openxBidAdapter_spec.js b/test/spec/modules/openxBidAdapter_spec.js index 96e545d70fa..aa869b07e47 100644 --- a/test/spec/modules/openxBidAdapter_spec.js +++ b/test/spec/modules/openxBidAdapter_spec.js @@ -1085,7 +1085,7 @@ describe('OpenxAdapter', function () { intentIqId: '1111-intentiqid', lipb: {lipbid: '1111-lipb'}, lotamePanoramaId: '1111-lotameid', - merkleId: '1111-merkleid', + merkleId: {id: '1111-merkleid'}, netId: 'fH5A3n2O8_CZZyPoJVD-eabc6ECb7jhxCicsds7qSg', parrableId: { eid: 'eidVersion.encryptionKeyReference.encryptedValue' }, pubcid: '1111-pubcid', @@ -1139,6 +1139,9 @@ describe('OpenxAdapter', function () { let userIdValue; // handle cases where userId key refers to an object switch (userIdProviderKey) { + case 'merkleId': + userIdValue = EXAMPLE_DATA_BY_ATTR.merkleId.id; + break; case 'flocId': userIdValue = EXAMPLE_DATA_BY_ATTR.flocId.id; break; @@ -1545,7 +1548,7 @@ describe('OpenxAdapter', function () { describe('with segments', function () { const TESTS = [ { - name: 'should send proprietary segment data from first party config', + name: 'should send proprietary segment data from ortb2.user.data', config: { ortb2: { user: { @@ -1556,10 +1559,77 @@ describe('OpenxAdapter', function () { } } }, - expect: 'dmp1/4:foo|bar,dmp2:baz', + expect: {sm: 'dmp1/4:foo|bar,dmp2:baz'}, + }, + { + name: 'should send proprietary segment data from ortb2.site.content.data', + config: { + ortb2: { + site: { + content: { + data: [ + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, + {name: 'dmp2', segment: [{id: 'baz'}]}, + ] + } + } + } + }, + expect: {scsm: 'dmp1/4:foo|bar,dmp2:baz'}, + }, + { + name: 'should send proprietary segment data from both ortb2.site.content.data and ortb2.user.data', + config: { + ortb2: { + user: { + data: [ + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, + {name: 'dmp2', segment: [{id: 'baz'}]}, + ] + }, + site: { + content: { + data: [ + {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]}, + {name: 'dmp4', segment: [{id: 'baz2'}]}, + ] + } + } + } + }, + expect: { + sm: 'dmp1/4:foo|bar,dmp2:baz', + scsm: 'dmp3/5:foo2|bar2,dmp4:baz2' + }, + }, + { + name: 'should not send duplicate proprietary segment data from first party config ', + config: { + ortb2: { + user: { + data: [ + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}, {id: 'foo'}]}, + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, + ] + }, + site: { + content: { + data: [ + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, + {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'foo2'}, {id: 'bar2'}]}, + {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]}, + ] + } + } + } + }, + expect: { + sm: 'dmp1/4:foo|bar', + scsm: 'dmp1/4:foo|bar,dmp3/5:foo2|bar2' + }, }, { - name: 'should combine same provider segment data from first party config', + name: 'should combine same provider segment data from ortb2.user.data', config: { ortb2: { user: { @@ -1570,7 +1640,23 @@ describe('OpenxAdapter', function () { } } }, - expect: 'dmp1/4:foo|bar,dmp1:baz', + expect: {sm: 'dmp1/4:foo|bar,dmp1:baz'}, + }, + { + name: 'should combine same provider segment data from ortb2.site.content.data', + config: { + ortb2: { + site: { + content: { + data: [ + {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, + {name: 'dmp1', ext: {}, segment: [{id: 'baz'}]}, + ] + } + } + } + }, + expect: {scsm: 'dmp1/4:foo|bar,dmp1:baz'}, }, { name: 'should not send any segment data if first party config is incomplete', @@ -1595,6 +1681,14 @@ describe('OpenxAdapter', function () { {name: 'dmp1', segment: [{id: 'foo'}, {id: 'bar'}]}, {name: 'dmp2', segment: [{id: 'baz'}]}, ] + }, + site: { + content: { + data: [ + {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]}, + {name: 'dmp4', segment: [{id: 'baz2'}]}, + ] + } } } }, @@ -1606,7 +1700,10 @@ describe('OpenxAdapter', function () { }, }, }, - expect: 'dmp1:foo|bar,dmp2:baz,liveintent:l1|l2', + expect: { + sm: 'dmp1:foo|bar,dmp2:baz,liveintent:l1|l2', + scsm: 'dmp3/5:foo2|bar2,dmp4:baz2' + }, }, { name: 'should send just liveintent segment from request if no first party config', @@ -1619,7 +1716,7 @@ describe('OpenxAdapter', function () { }, }, }, - expect: 'liveintent:l1|l2', + expect: {sm: 'liveintent:l1|l2'}, }, { name: 'should send nothing if lipb section does not contain segments', @@ -1636,13 +1733,11 @@ describe('OpenxAdapter', function () { utils._each(TESTS, (t) => { context('in ortb2.user.data', function () { let bidRequests; - let configStub; - beforeEach(function () { let fpdConfig = t.config - configStub = sinon + sinon .stub(config, 'getConfig') - .withArgs('ortb2.user.data') + .withArgs(sinon.match(/^ortb2\.user\.data$|^ortb2\.site\.content\.data$/)) .callsFake((key) => { return utils.deepAccess(fpdConfig, key); }); @@ -1658,10 +1753,13 @@ describe('OpenxAdapter', function () { const request = spec.buildRequests(bidRequests, mockBidderRequest) expect(request.length).to.equal(1); if (t.expect) { - expect(request[0].data.sm).to.exist; - expect(request[0].data.sm).to.equal(encodeURIComponent(t.expect)); + for (const key in t.expect) { + expect(request[0].data[key]).to.exist; + expect(request[0].data[key]).to.equal(t.expect[key]); + } } else { expect(request[0].data.sm).to.not.exist; + expect(request[0].data.scsm).to.not.exist; } }); }); From e59a314ac468e021b6f6f7503dba735faf39b5cf Mon Sep 17 00:00:00 2001 From: Harshad Mane Date: Mon, 18 Oct 2021 10:15:51 -0700 Subject: [PATCH 194/250] Prebid Core: use gptSlot.updateTargetingFromMap than gptSlot.setTargeting in targeting.resetPresetTargeting (#7552) * added support for pubcommon, digitrust, id5id * added support for IdentityLink * changed the source for id5 * added unit test cases * changed source param for identityLink * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * import utils functions as needed and not the whole module * Revert "import utils functions as needed and not the whole module" This reverts commit bc6c9f61f889e9aa2ef8ab207b87d4e7b49e3e57. * Revert "import utils functions as needed and not the whole module" This reverts commit ef500abb06648c763caa066ccd18fd5a18f2a1b5. * Revert "import utils functions as needed and not the whole module" This reverts commit 7e3fa3feba9ec9b8e81524419c3c13e94ee1049e. * use updateTargetingFromMap than setTargeting in targeting.resetPresetTargeting * indent * using arrow functions --- src/targeting.js | 20 +++++++++-------- test/spec/unit/pbjs_api_spec.js | 39 +++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/targeting.js b/src/targeting.js index 61a9f9a76b7..a140c952230 100644 --- a/src/targeting.js +++ b/src/targeting.js @@ -123,17 +123,19 @@ export function newTargeting(auctionManager) { if (isGptPubadsDefined()) { const adUnitCodes = getAdUnitCodes(adUnitCode); const adUnits = auctionManager.getAdUnits().filter(adUnit => includes(adUnitCodes, adUnit.code)); + let unsetKeys = pbTargetingKeys.reduce((reducer, key) => { + reducer[key] = null; + return reducer; + }, {}); window.googletag.pubads().getSlots().forEach(slot => { let customSlotMatchingFunc = isFn(customSlotMatching) && customSlotMatching(slot); - pbTargetingKeys.forEach(function(key) { - // reset only registered adunits - adUnits.forEach(function(unit) { - if (unit.code === slot.getAdUnitPath() || - unit.code === slot.getSlotElementId() || - (isFn(customSlotMatchingFunc) && customSlotMatchingFunc(unit.code))) { - slot.setTargeting(key, null); - } - }); + // reset only registered adunits + adUnits.forEach(unit => { + if (unit.code === slot.getAdUnitPath() || + unit.code === slot.getSlotElementId() || + (isFn(customSlotMatchingFunc) && customSlotMatchingFunc(unit.code))) { + slot.updateTargetingFromMap(unsetKeys); + } }); }); } diff --git a/test/spec/unit/pbjs_api_spec.js b/test/spec/unit/pbjs_api_spec.js index cc75b95a7ac..962fae60db1 100644 --- a/test/spec/unit/pbjs_api_spec.js +++ b/test/spec/unit/pbjs_api_spec.js @@ -98,7 +98,6 @@ var createSlotArrayScenario2 = function createSlotArrayScenario2() { var slot1 = new Slot(config.adUnitElementIDs[0], config.adUnitCodes[0]); slot1.setTargeting('pos1', '750x350'); var slot2 = new Slot(config.adUnitElementIDs[1], config.adUnitCodes[0]); - slot2.setTargeting('gender', ['male', 'female']); return [ slot1, slot2 @@ -862,6 +861,9 @@ describe('Unit: Prebid Module', function () { it('should set googletag targeting keys after calling setTargetingForGPTAsync function', function () { var slots = createSlotArrayScenario2(); + + // explicitly setting some PBJS key value pairs to verify whether these are removed befor new keys are set + window.googletag.pubads().setSlots(slots); $$PREBID_GLOBAL$$.setTargetingForGPTAsync([config.adUnitCodes[0]]); @@ -869,7 +871,7 @@ describe('Unit: Prebid Module', function () { // googletag's targeting structure // googletag setTargeting will override old value if invoked with same key - const targeting = []; + let targeting = []; slots[1].getTargetingKeys().map(function (key) { const value = slots[1].getTargeting(key); targeting.push([key, value]); @@ -887,6 +889,39 @@ describe('Unit: Prebid Module', function () { invokedTargeting.push([key, value]); }); assert.deepEqual(targeting, invokedTargeting, 'google tag targeting options not matching'); + + // resetPresetTargeting: initiate a new auction with no winning bids, now old targeting should be removed + + resetAuction(); + auction.getBidsReceived = function() { return [] }; + + var slots = createSlotArrayScenario2(); + window.googletag.pubads().setSlots(slots); + + $$PREBID_GLOBAL$$.setTargetingForGPTAsync([config.adUnitCodes[0]]); + + targeting = []; + slots[1].getTargetingKeys().map(function (key) { + const value = slots[1].getTargeting(key); + targeting.push([key, value]); + }); + + invokedTargetingMap = {}; + slots[1].spySetTargeting.args.map(function (entry) { + invokedTargetingMap[entry[0]] = entry[1]; + }); + + var invokedTargeting = []; + + Object.getOwnPropertyNames(invokedTargetingMap).map(function (key) { + const value = Array.isArray(invokedTargetingMap[key]) ? invokedTargetingMap[key] : [invokedTargetingMap[key]]; // values are always returned as array in googletag + invokedTargeting.push([key, value]); + }); + assert.deepEqual(targeting, invokedTargeting, 'google tag targeting options not matching'); + targeting.forEach(function(e) { + // here e[0] is key and e[1] is value in array that should be [null] as we are un-setting prebid keys in resetPresetTargeting + assert.deepEqual(e[1], [null], 'resetPresetTargeting: the value of the key ' + e[0] + ' should be [null]'); + }); }); it('should set googletag targeting keys to specific slot with customSlotMatching', function () { From 92ba116da2cabbb2076588326eab5e4e44d3495b Mon Sep 17 00:00:00 2001 From: nllerandi3lift <75995508+nllerandi3lift@users.noreply.github.com> Date: Mon, 18 Oct 2021 14:35:17 -0400 Subject: [PATCH 195/250] Triplelift Bid Adapter: Additional eid filtering and checks (#7565) --- modules/tripleliftBidAdapter.js | 27 +++- .../spec/modules/tripleliftBidAdapter_spec.js | 128 ++++++++++++++++++ 2 files changed, 150 insertions(+), 5 deletions(-) diff --git a/modules/tripleliftBidAdapter.js b/modules/tripleliftBidAdapter.js index 01df88f62ee..215769e9812 100644 --- a/modules/tripleliftBidAdapter.js +++ b/modules/tripleliftBidAdapter.js @@ -1,4 +1,4 @@ -import { tryAppendQueryString, logMessage, isEmpty } from '../src/utils.js'; +import { tryAppendQueryString, logMessage, isEmpty, isStr, isPlainObject, isArray, logWarn } from '../src/utils.js'; import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { config } from '../src/config.js'; @@ -262,19 +262,36 @@ function getPubCommonEids(bidRequest) { function getEids(bidRequest, type, source, rtiPartner) { return bidRequest .map(getUserId(type)) // bids -> userIds of a certain type - .filter((x) => !!x) // filter out null userIds + .filter(filterEids(type)) // filter out unqualified userIds .map(formatEid(source, rtiPartner)); // userIds -> eid objects } +const filterEids = type => (userId, i, arr) => { + let isValidUserId = + !!userId && // is not null nor empty + (isStr(userId) + ? !!userId + : isPlainObject(userId) && // or, is object + !isArray(userId) && // not an array + !isEmpty(userId) && // is not empty + userId.id && // contains nested id field + isStr(userId.id) && // nested id field is a string + !!userId.id); // that is not empty + if (!isValidUserId && arr[0] !== undefined) { + logWarn(`Triplelift: invalid ${type} userId format`); + } + return isValidUserId; +}; + function getUserId(type) { - return (bid) => (bid && bid.userId && bid.userId[type]); + return bid => bid && bid.userId && bid.userId[type]; } function formatEid(source, rtiPartner) { - return (id) => ({ + return (userId) => ({ source, uids: [{ - id, + id: userId.id ? userId.id : userId, ext: { rtiPartner } }] }); diff --git a/test/spec/modules/tripleliftBidAdapter_spec.js b/test/spec/modules/tripleliftBidAdapter_spec.js index d523976826e..6f2674dadc5 100644 --- a/test/spec/modules/tripleliftBidAdapter_spec.js +++ b/test/spec/modules/tripleliftBidAdapter_spec.js @@ -568,6 +568,134 @@ describe('triplelift adapter', function () { expect(payload.user.ext.eids).to.have.lengthOf(4); }); + it('should remove malformed ids that would otherwise break call', function () { + let tdidId = '6bca7f6b-a98a-46c0-be05-6020f7604598'; + let idlEnvId = null; // fail; can't be null + let criteoId = '53e30ea700424f7bbdd793b02abc5d7'; + let pubcid = ''; // fail; can't be empty string + + let bidRequestsMultiple = [ + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } } + ]; + + let request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest); + let payload = request.data; + + expect(payload.user).to.deep.equal({ + ext: { + eids: [ + { + source: 'adserver.org', + uids: [ + { + id: tdidId, + ext: { rtiPartner: 'TDID' } + } + ], + }, + { + source: 'criteo.com', + uids: [ + { + id: criteoId, + ext: { rtiPartner: 'criteoId' } + } + ] + } + ] + } + }); + + expect(payload.user.ext.eids).to.be.an('array'); + expect(payload.user.ext.eids).to.have.lengthOf(2); + + tdidId = {}; // fail; can't be empty object + idlEnvId = { id: '987654' }; // pass + criteoId = [{ id: '123456' }]; // fail; can't be an array + pubcid = '3261d8ad-435d-481d-abd1-9f1a9ec99f0e'; // pass + + bidRequestsMultiple = [ + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } } + ]; + + request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest); + payload = request.data; + + expect(payload.user).to.deep.equal({ + ext: { + eids: [ + { + source: 'liveramp.com', + uids: [ + { + id: '987654', + ext: { rtiPartner: 'idl' } + } + ] + }, + { + source: 'pubcid.org', + uids: [ + { + id: pubcid, + ext: { rtiPartner: 'pubcid' } + } + ] + } + ] + } + }); + + expect(payload.user.ext.eids).to.be.an('array'); + expect(payload.user.ext.eids).to.have.lengthOf(2); + + tdidId = { id: '987654' }; // pass + idlEnvId = { id: 987654 }; // fail; can't be an int + criteoId = '53e30ea700424f7bbdd793b02abc5d7'; // pass + pubcid = { id: '' }; // fail; can't be an empty string + + bidRequestsMultiple = [ + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } }, + { ...bidRequests[0], userId: { tdid: tdidId, idl_env: idlEnvId, criteoId, pubcid } } + ]; + + request = tripleliftAdapterSpec.buildRequests(bidRequestsMultiple, bidderRequest); + payload = request.data; + + expect(payload.user).to.deep.equal({ + ext: { + eids: [ + { + source: 'adserver.org', + uids: [ + { + id: '987654', + ext: { rtiPartner: 'TDID' } + } + ], + }, + { + source: 'criteo.com', + uids: [ + { + id: criteoId, + ext: { rtiPartner: 'criteoId' } + } + ] + } + ] + } + }); + + expect(payload.user.ext.eids).to.be.an('array'); + expect(payload.user.ext.eids).to.have.lengthOf(2); + }); + it('should return a query string for TL call', function () { const request = tripleliftAdapterSpec.buildRequests(bidRequests, bidderRequest); const url = request.url; From 8fed46638e54a45c5ffce7b604122977d67596ed Mon Sep 17 00:00:00 2001 From: Ayushman Mishra Date: Tue, 19 Oct 2021 03:26:56 +0530 Subject: [PATCH 196/250] Adding akamaiDapRtdProvider module (#7508) --- .../gpt/akamaidap_segments_example.html | 132 +++++ modules/akamaiDapRtdProvider.js | 474 ++++++++++++++++++ modules/akamaiDapRtdProvider.md | 47 ++ .../spec/modules/akamaiDapRtdProvider_spec.js | 246 +++++++++ 4 files changed, 899 insertions(+) create mode 100644 integrationExamples/gpt/akamaidap_segments_example.html create mode 100644 modules/akamaiDapRtdProvider.js create mode 100644 modules/akamaiDapRtdProvider.md create mode 100644 test/spec/modules/akamaiDapRtdProvider_spec.js diff --git a/integrationExamples/gpt/akamaidap_segments_example.html b/integrationExamples/gpt/akamaidap_segments_example.html new file mode 100644 index 00000000000..e85ac8e1337 --- /dev/null +++ b/integrationExamples/gpt/akamaidap_segments_example.html @@ -0,0 +1,132 @@ + + + + + + + + + + + + + +

Prebid.js Test

+
Div-1
+
+ +
+
Segments Sent to Bidding Adapter
+
+ + diff --git a/modules/akamaiDapRtdProvider.js b/modules/akamaiDapRtdProvider.js new file mode 100644 index 00000000000..d143a53fbf4 --- /dev/null +++ b/modules/akamaiDapRtdProvider.js @@ -0,0 +1,474 @@ +/** + * This module adds the Akamai DAP RTD provider to the real time data module + * The {@link module:modules/realTimeData} module is required + * The module will fetch real-time data from DAP + * @module modules/akamaiDapRtdProvider + * @requires module:modules/realTimeData + */ +import {ajax} from '../src/ajax.js'; +import {config} from '../src/config.js'; +import {getStorageManager} from '../src/storageManager.js'; +import {submodule} from '../src/hook.js'; +import {isPlainObject, mergeDeep, logMessage, logInfo, logError} from '../src/utils.js'; + +const MODULE_NAME = 'realTimeData'; +const SUBMODULE_NAME = 'dap'; + +export const SEGMENTS_STORAGE_KEY = 'akamaiDapSegments'; +export const storage = getStorageManager(null, SUBMODULE_NAME); + +/** + * Lazy merge objects. + * @param {String} target + * @param {String} source + */ +function mergeLazy(target, source) { + if (!isPlainObject(target)) { + target = {}; + } + if (!isPlainObject(source)) { + source = {}; + } + return mergeDeep(target, source); +} + +/** + * Add real-time data & merge segments. + * @param {Object} bidConfig + * @param {Object} rtd + * @param {Object} rtdConfig + */ +export function addRealTimeData(rtd) { + logInfo('DEBUG(addRealTimeData) - ENTER'); + if (isPlainObject(rtd.ortb2)) { + let ortb2 = config.getConfig('ortb2') || {}; + logMessage('DEBUG(addRealTimeData): merging original: ', ortb2); + logMessage('DEBUG(addRealTimeData): merging in: ', rtd.ortb2); + config.setConfig({ortb2: mergeLazy(ortb2, rtd.ortb2)}); + } + logInfo('DEBUG(addRealTimeData) - EXIT'); +} + +/** + * Real-time data retrieval from Audigent + * @param {Object} reqBidsConfigObj + * @param {function} onDone + * @param {Object} rtdConfi + * @param {Object} userConsent + */ +export function getRealTimeData(bidConfig, onDone, rtdConfig, userConsent) { + logInfo('DEBUG(getRealTimeData) - ENTER'); + logMessage(' - apiHostname: ' + rtdConfig.params.apiHostname); + logMessage(' - apiVersion: ' + rtdConfig.params.apiVersion); + let jsonData = storage.getDataFromLocalStorage(SEGMENTS_STORAGE_KEY); + if (jsonData) { + let data = JSON.parse(jsonData); + if (data.rtd) { + addRealTimeData(data.rtd); + onDone(); + logInfo('DEBUG(getRealTimeData) - 1'); + // Don't return - ensure the data is always fresh. + } + } + + if (rtdConfig && isPlainObject(rtdConfig.params)) { + let config = { + api_hostname: rtdConfig.params.apiHostname, + api_version: rtdConfig.params.apiVersion, + domain: rtdConfig.params.domain, + segtax: rtdConfig.params.segtax + }; + let identity = { + type: rtdConfig.params.identityType + }; + let token = dapUtils.dapGetToken(config, identity, rtdConfig.params.tokenTtl); + if (token !== null) { + let membership = dapUtils.dapGetMembership(config, token); + let udSegment = dapUtils.dapMembershipToRtbSegment(membership, config); + logMessage('DEBUG(getRealTimeData) - token: ' + token + ', user.data.segment: ', udSegment); + let data = { + rtd: { + ortb2: { + user: { + data: [ + udSegment + ] + }, + site: { + ext: { + data: { + dapSAID: membership.said + } + } + } + } + } + }; + storage.setDataInLocalStorage(SEGMENTS_STORAGE_KEY, JSON.stringify(data)); + onDone(); + } + } +} + +/** + * Module init + * @param {Object} provider + * @param {Object} userConsent + * @return {boolean} + */ +function init(provider, userConsent) { + return true; +} + +/** @type {RtdSubmodule} */ +export const akamaiDapRtdSubmodule = { + name: SUBMODULE_NAME, + getBidRequestData: getRealTimeData, + init: init +}; + +submodule(MODULE_NAME, akamaiDapRtdSubmodule); + +export const dapUtils = { + + dapGetToken: function(config, identity, ttl) { + let now = Math.round(Date.now() / 1000.0); // in seconds + let storageName = 'async_dap_token'; + let token = null; + + if (ttl == 0) { + localStorage.removeItem(storageName); + } + + let item = JSON.parse(localStorage.getItem(storageName)); + if (item == null) { + item = { + expires_at: now - 1, + token: null + }; + } else { + token = item.token; + } + + if (now > item.expires_at) { + dapUtils.dapLog('Token missing or expired, fetching a new one...'); + // Trigger a refresh + let configAsync = {...config}; + dapUtils.dapTokenize(configAsync, identity, + function(token, status, xhr) { + item.expires_at = now + ttl; + item.token = token; + localStorage.setItem(storageName, JSON.stringify(item)); + dapUtils.dapLog('Successfully updated and stored token; expires in ' + ttl + ' seconds'); + let deviceId100 = xhr.getResponseHeader('Akamai-DAP-100'); + if (deviceId100 != null) { + localStorage.setItem('dap_deviceId100', deviceId100); + dapUtils.dapLog('Successfully stored DAP 100 Device ID: ' + deviceId100); + } + }, + function(xhr, status, error) { + logError('ERROR(' + error + '): failed to retrieve token! ' + status); + } + ); + } + + return token; + }, + + dapGetMembership: function(config, token) { + let now = Math.round(Date.now() / 1000.0); // in seconds + let storageName = 'async_dap_membership'; + let maxTtl = 3600; // if the cached membership is older than this, return null + let membership = null; + let item = JSON.parse(localStorage.getItem(storageName)); + if (item == null || (now - item.expires_at) > maxTtl) { + item = { + expires_at: now - 1, + said: null, + cohorts: null, + attributes: null + }; + } else { + membership = { + said: item.said, + cohorts: item.cohorts, + attributes: null + }; + } + + // Always refresh the cached membership. + let configAsync = {...config}; + dapUtils.dapMembership(configAsync, token, + function(membership, status, xhr) { + item.expires_at = now + maxTtl; + item.said = membership.said; + item.cohorts = membership.cohorts; + localStorage.setItem(storageName, JSON.stringify(item)); + dapUtils.dapLog('Successfully updated and stored membership:'); + dapUtils.dapLog(item); + }, + function(xhr, status, error) { + logError('ERROR(' + error + '): failed to retrieve membership! ' + status); + } + ); + + return membership; + }, + + /** + * DESCRIPTION + * + * Convert a DAP membership response to an OpenRTB2 segment object suitable + * for insertion into user.data.segment or site.data.segment. + */ + dapMembershipToRtbSegment: function(membership, config) { + let segment = { + name: 'dap.akamai.com', + ext: { + 'segtax': config.segtax + }, + segment: [] + }; + if (membership != null) { + for (const i of membership.cohorts) { + segment.segment.push({ id: i }); + } + } + return segment; + }, + + dapLog: function(args) { + let css = ''; + css += 'display: inline-block;'; + css += 'color: #fff;'; + css += 'background: #F28B20;'; + css += 'padding: 1px 4px;'; + css += 'border-radius: 3px'; + + logInfo('%cDAP Client', css, args); + }, + + /******************************************************************************* + * + * V2 (And Beyond) API + * + ******************************************************************************/ + + /** + * SYNOPSIS + * + * dapTokenize( config, identity ); + * + * DESCRIPTION + * + * Tokenize an identity into a secure, privacy safe pseudonymiziation. + * + * PARAMETERS + * + * config: an array of system configuration parameters + * + * identity: an array of identity parameters passed to the tokenizing system + * + * EXAMPLE + * + * config = { + * api_hostname: "prebid.dap.akadns.net", // required + * domain: "prebid.org", // required + * api_version: "x1", // optional, default "x1" + * }; + * + * token = null; + * identity_email = { + * type: "email", + * identity: "obiwan@jedi.com" + * attributes: { cohorts: [ "100:1641013200", "101:1641013200", "102":3:1641013200" ] }, + * }; + * dap_x1_tokenize( config, identity_email, + * function( response, status, xhr ) { token = response; }, + * function( xhr, status, error ) { ; } // handle error + * + * token = null; + * identity_signature = { type: "signature:1.0.0" }; + * dap_x1_tokenize( config, identity_signature, + * function( response, status, xhr } { token = response; }, + * function( xhr, status, error ) { ; } // handle error + */ + dapTokenize: function(config, identity, onSuccess = null, onError = null) { + if (onError == null) { + onError = function(xhr, status, error) {}; + } + + if (config == null || typeof (config) == typeof (undefined)) { + onError(null, 'Invalid config object', 'ClientError'); + return; + } + + if (typeof (config.domain) != 'string') { + onError(null, 'Invalid config.domain: must be a string', 'ClientError'); + return; + } + + if (config.domain.length <= 0) { + onError(null, 'Invalid config.domain: must have non-zero length', 'ClientError'); + return; + } + + if (!('api_version' in config) || (typeof (config.api_version) == 'string' && config.api_version.length == 0)) { + config.api_version = 'x1'; + } + + if (typeof (config.api_version) != 'string') { + onError(null, "Invalid api_version: must be a string like 'x1', etc.", 'ClientError'); + return; + } + + if (!(('api_hostname') in config) || typeof (config.api_hostname) != 'string' || config.api_hostname.length == 0) { + onError(null, 'Invalid api_hostname: must be a non-empty string', 'ClientError'); + return; + } + + if (identity == null || typeof (identity) == typeof (undefined)) { + onError(null, 'Invalid identity object', 'ClientError'); + return; + } + + if (!('type' in identity) || typeof (identity.type) != 'string' || identity.type.length <= 0) { + onError(null, "Identity must contain a valid 'type' field", 'ClientError'); + return; + } + + let apiParams = { + 'type': identity.type, + }; + + if (typeof (identity.identity) != typeof (undefined)) { + apiParams.identity = identity.identity; + } + if (typeof (identity.attributes) != typeof (undefined)) { + apiParams.attributes = identity.attributes; + } + + let method; + let body; + let path; + switch (config.api_version) { + case 'x1': + case 'x1-dev': + method = 'POST'; + path = '/data-activation/' + config.api_version + '/domain/' + config.domain + '/identity/tokenize'; + body = JSON.stringify(apiParams); + break; + default: + onError(null, 'Invalid api_version: ' + config.api_version, 'ClientError'); + return; + } + + let url = 'https://' + config.api_hostname + path; + let cb = { + success: (response, request) => { + let token = null; + switch (config.api_version) { + case 'x1': + case 'x1-dev': + token = request.getResponseHeader('Akamai-DAP-Token'); + break; + } + onSuccess(token, request.status, request); + }, + error: (request, error) => { + onError(request, request.statusText, error); + } + }; + + ajax(url, cb, body, { + method: method, + customHeaders: { + 'Content-Type': 'application/json', + 'Pragma': 'akamai-x-cache-on' + } + }); + }, + + /** + * SYNOPSIS + * + * dapMembership( config, token, onSuccess, onError ); + * + * DESCRIPTION + * + * Return the audience segment membership along with a new Secure Advertising + * ID for this token. + * + * PARAMETERS + * + * config: an array of system configuration parameters + * + * token: the token previously returned from the tokenize API + * + * EXAMPLE + * + * config = { + * api_hostname: 'api.dap.akadns.net', + * }; + * + * // token from dap_x1_tokenize + * + * dapMembership( config, token, + * function( membership, status, xhr ) { + * // Run auction with membership.segments and membership.said + * }, + * function( xhr, status, error ) { + * // error + * } ); + * + */ + dapMembership: function(config, token, onSuccess = null, onError = null) { + if (onError == null) { + onError = function(xhr, status, error) {}; + } + + if (config == null || typeof (config) == typeof (undefined)) { + onError(null, 'Invalid config object', 'ClientError'); + return; + } + + if (!('api_version' in config) || (typeof (config.api_version) == 'string' && config.api_version.length == 0)) { + config.api_version = 'x1'; + } + + if (typeof (config.api_version) != 'string') { + onError(null, "Invalid api_version: must be a string like 'x1', etc.", 'ClientError'); + return; + } + + if (!(('api_hostname') in config) || typeof (config.api_hostname) != 'string' || config.api_hostname.length == 0) { + onError(null, 'Invalid api_hostname: must be a non-empty string', 'ClientError'); + return; + } + + if (token == null || typeof (token) != 'string') { + onError(null, 'Invalid token: must be a non-null string', 'ClientError'); + return; + } + let path = '/data-activation/' + + config.api_version + + '/token/' + token + + '/membership'; + + let url = 'https://' + config.api_hostname + path; + + let cb = { + success: (response, request) => { + onSuccess(JSON.parse(response), request.status, request); + }, + error: (error, request) => { + onError(request, request.status, error); + } + }; + + ajax(url, cb, undefined, { + method: 'GET', + customHeaders: {} + }); + } +} diff --git a/modules/akamaiDapRtdProvider.md b/modules/akamaiDapRtdProvider.md new file mode 100644 index 00000000000..ade11b88602 --- /dev/null +++ b/modules/akamaiDapRtdProvider.md @@ -0,0 +1,47 @@ +### Overview + + Akamai DAP Real time data Provider automatically invokes the DAP APIs and submit audience segments and the SAID to the bid-stream. + +### Integration + + 1) Build the akamaiDapRTD module into the Prebid.js package with: + + ``` + gulp build --modules=akamaiDapRtdProvider,... + ``` + + 2) Use `setConfig` to instruct Prebid.js to initilaize the akamaiDapRtdProvider module, as specified below. + +### Configuration + +``` + pbjs.setConfig({ + realTimeData: { + dataProviders: [ + { + name: "dap", + waitForIt: true, + params: { + apiHostname: '', + apiVersion: "x1", + domain: 'your-domain.com', + identityType: 'email' | 'mobile' | ... | 'dap-signature:1.0.0', + segtax: , + tokenTtl: 5, + } + } + ] + } + }); + ``` + +Please reach out to your Akamai account representative(Prebid@akamai.com) to get provisioned on the DAP platform. + + +### Testing +To view an example of available segments returned by dap: +``` +‘gulp serve --modules=rtdModule,akamaiDapRtdProvider,appnexusBidAdapter,sovrnBidAdapter’ +``` +and then point your browser at: +"http://localhost:9999/integrationExamples/gpt/akamaidap_segments_example.html" diff --git a/test/spec/modules/akamaiDapRtdProvider_spec.js b/test/spec/modules/akamaiDapRtdProvider_spec.js new file mode 100644 index 00000000000..b350c2bb529 --- /dev/null +++ b/test/spec/modules/akamaiDapRtdProvider_spec.js @@ -0,0 +1,246 @@ +import {config} from 'src/config.js'; +import {SEGMENTS_STORAGE_KEY, TOKEN_STORAGE_KEY, dapUtils, addRealTimeData, getRealTimeData, akamaiDapRtdSubmodule, storage} from 'modules/akamaiDapRtdProvider.js'; +import {server} from 'test/mocks/xhr.js'; +import logMessage from 'src/utils.js' +const responseHeader = {'Content-Type': 'application/json'}; + +describe('akamaiDapRtdProvider', function() { + let getDataFromLocalStorageStub; + let getDapTokenStub; + + const testReqBidsConfigObj = { + adUnits: [ + { + bids: ['bid1', 'bid2'] + } + ] + }; + + const onDone = function() { return true }; + + const onSuccess = function() { return ('request', 200, 'success') }; + + const cmoduleConfig = { + 'name': 'dap', + 'waitForIt': true, + 'params': { + 'apiHostname': 'prebid.dap.akadns.net', + 'apiVersion': 'x1', + 'domain': 'prebid.org', + 'identityType': 'dap-signature:1.0.0', + 'segtax': 503, + 'tokenTtl': 5 + } + } + + const sampleConfig = { + 'api_hostname': 'prebid.dap.akadns.net', + 'api_version': 'x1', + 'domain': 'prebid.org', + 'segtax': 503 + } + const sampleIdentity = { + type: 'dap-signature:1.0.0' + }; + + beforeEach(function() { + config.resetConfig(); + getDataFromLocalStorageStub = sinon.stub(storage, 'getDataFromLocalStorage') + }); + + afterEach(function () { + getDataFromLocalStorageStub.restore(); + }); + + describe('akamaiDapRtdSubmodule', function() { + it('successfully instantiates', function () { + expect(akamaiDapRtdSubmodule.init()).to.equal(true); + }); + }); + + describe('Get Real-Time Data', function() { + it('gets rtd from local storage cache', function() { + const rtdConfig = { + params: { + segmentCache: true + } + }; + + const bidConfig = {}; + + const rtdUserObj1 = { + name: 'www.dataprovider3.com', + ext: { + taxonomyname: 'iab_audience_taxonomy' + }, + segment: [ + { + id: '1918' + }, + { + id: '1939' + } + ] + }; + + const cachedRtd = { + rtd: { + ortb2: { + user: { + data: [rtdUserObj1] + } + } + } + }; + + getDataFromLocalStorageStub.withArgs(SEGMENTS_STORAGE_KEY).returns(JSON.stringify(cachedRtd)); + + expect(config.getConfig().ortb2).to.be.undefined; + getRealTimeData(bidConfig, () => {}, rtdConfig, {}); + expect(config.getConfig().ortb2.user.data).to.deep.include.members([rtdUserObj1]); + }); + + it('should initalise and return with config', function () { + expect(getRealTimeData(testReqBidsConfigObj, onDone, cmoduleConfig)).to.equal(undefined) + }); + }); + + describe('dapTokenize', function () { + it('dapTokenize error callback', function () { + let configAsync = JSON.parse(JSON.stringify(sampleConfig)); + let submoduleCallback = dapUtils.dapTokenize(configAsync, sampleIdentity, + function(token, status, xhr) { + }, + function(xhr, status, error) { + } + ); + let request = server.requests[0]; + request.respond(400, responseHeader, JSON.stringify('error')); + expect(submoduleCallback).to.equal(undefined); + }); + + it('dapTokenize success callback', function () { + let configAsync = JSON.parse(JSON.stringify(sampleConfig)); + let submoduleCallback = dapUtils.dapTokenize(configAsync, sampleIdentity, + function(token, status, xhr) { + }, + function(xhr, status, error) { + } + ); + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify('success')); + expect(submoduleCallback).to.equal(undefined); + }); + }); + + describe('dapTokenize and dapMembership incorrect params', function () { + it('Onerror and config are null', function () { + expect(dapUtils.dapTokenize(null, 'identity', null, null)).to.be.equal(undefined); + expect(dapUtils.dapMembership(null, 'identity', null, null)).to.be.equal(undefined); + const config = { + 'api_hostname': 'prebid.dap.akadns.net', + 'api_version': 1, + 'domain': '', + 'segtax': 503 + }; + let identity = { + type: 'dap-signature:1.0.0' + }; + expect(dapUtils.dapTokenize(config, identity, null, null)).to.be.equal(undefined); + expect(dapUtils.dapMembership(config, 'token', null, null)).to.be.equal(undefined); + }); + + it('dapGetToken success', function () { + let dapTokenizeStub = sinon.stub(dapUtils, 'dapTokenize').returns(onSuccess); + expect(dapUtils.dapGetToken(sampleConfig, 'token', + function(token, status, xhr) { + }, + function(xhr, status, error) { + } + )).to.be.equal(null); + dapTokenizeStub.restore(); + }); + }); + + describe('dapMembership', function () { + it('dapMembership success callback', function () { + let configAsync = JSON.parse(JSON.stringify(sampleConfig)); + let submoduleCallback = dapUtils.dapMembership(configAsync, 'token', + function(token, status, xhr) { + }, + function(xhr, status, error) { + } + ); + let request = server.requests[0]; + request.respond(200, responseHeader, JSON.stringify('success')); + expect(submoduleCallback).to.equal(undefined); + }); + + it('dapMembership error callback', function () { + let configAsync = JSON.parse(JSON.stringify(sampleConfig)); + let submoduleCallback = dapUtils.dapMembership(configAsync, 'token', + function(token, status, xhr) { + }, + function(xhr, status, error) { + } + ); + let request = server.requests[0]; + request.respond(400, responseHeader, JSON.stringify('error')); + expect(submoduleCallback).to.equal(undefined); + }); + }); + + describe('dapMembership', function () { + it('should invoke the getDapToken and getDapMembership', function () { + let config = { + api_hostname: cmoduleConfig.params.apiHostname, + api_version: cmoduleConfig.params.apiVersion, + domain: cmoduleConfig.params.domain, + segtax: cmoduleConfig.params.segtax + }; + let identity = { + type: cmoduleConfig.params.identityType + }; + + let membership = { + said: 'item.said1', + cohorts: 'item.cohorts', + attributes: null + }; + + let getDapTokenStub = sinon.stub(dapUtils, 'dapGetToken').returns('token3'); + let getDapMembershipStub = sinon.stub(dapUtils, 'dapGetMembership').returns(membership); + let dapTokenizeStub = sinon.stub(dapUtils, 'dapTokenize').returns('response', 200, 'request'); + getRealTimeData(testReqBidsConfigObj, onDone, cmoduleConfig); + expect(getDapTokenStub.calledOnce).to.be.equal(true); + expect(getDapMembershipStub.calledOnce).to.be.equal(true); + getDapTokenStub.restore(); + getDapMembershipStub.restore(); + dapTokenizeStub.restore(); + }); + }); + + describe('dapMembershipToRtbSegment', function () { + it('dapMembershipToRtbSegment', function () { + let membership1 = { + said: 'item.said1', + cohorts: 'item.cohorts', + attributes: null + }; + const config = { + apiHostname: 'prebid.dap.akadns.net', + apiVersion: 'x1', + domain: 'prebid.org', + tokenTtl: 5, + segtax: 503 + }; + let identity = { + type: 'dap-signature:1.0.0' + }; + + expect(dapUtils.dapGetMembership(config, 'token')).to.equal(null) + const membership = {cohorts: ['1', '5', '7']} + expect(dapUtils.dapMembershipToRtbSegment(membership, config)).to.not.equal(undefined); + }); + }); +}); From a68796a9cca7bb5a00694bf5ceac00cfde027409 Mon Sep 17 00:00:00 2001 From: shahinrahbariasl <56240400+shahinrahbariasl@users.noreply.github.com> Date: Tue, 19 Oct 2021 09:28:56 -0400 Subject: [PATCH 197/250] PBJS IX adapter should signal 1PA (#7596) Co-authored-by: shahin.rahbariasl --- modules/ixBidAdapter.js | 1 + test/spec/modules/ixBidAdapter_spec.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index cf551c4f3db..5a6cae6d0c6 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -490,6 +490,7 @@ function buildRequest(validBidRequests, bidderRequest, impressions, version) { r.ext.ixdiag.msd = 0; r.ext.ixdiag.msi = 0; r.imp = []; + r.at = 1; // getting ixdiags for adunits of the video, outstream & multi format (MF) style let ixdiag = buildIXDiag(validBidRequests); diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 6eff922536f..d704e47a669 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -1377,6 +1377,11 @@ describe('IndexexchangeAdapter', function () { expect(requestUrl).to.equal(IX_SECURE_ENDPOINT); }); + it('auction type should be set correctly', function () { + const at = JSON.parse(query.r).at; + expect(at).to.equal(1); + }) + it('query object (version, siteID and request) should be correct', function () { expect(query.v).to.equal(BANNER_ENDPOINT_VERSION); expect(query.s).to.equal(DEFAULT_BANNER_VALID_BID[0].params.siteId); @@ -1929,6 +1934,11 @@ describe('IndexexchangeAdapter', function () { expect(query.nf).to.equal(1); }); + it('auction type should be set correctly', function () { + const at = JSON.parse(query.r).at; + expect(at).to.equal(1); + }) + it('impression should have correct format and value', function () { const impression = JSON.parse(query.r).imp[0]; const sidValue = utils.parseGPTSingleSizeArray(DEFAULT_VIDEO_VALID_BID[0].params.size); From 689510460e7e2d88b897826ce5b21f0e51ee9fce Mon Sep 17 00:00:00 2001 From: anastasya123 <89073753+anastasya123@users.noreply.github.com> Date: Tue, 19 Oct 2021 19:08:57 +0300 Subject: [PATCH 198/250] BetweenBidAdapter: add video support (#7594) * add video * Between Bid Adapter: update video * BetweenBidAdapter: jst fix * BetweenBitAdapter: update test --- modules/betweenBidAdapter.js | 22 +++++++++-- test/spec/modules/betweenBidAdapter_spec.js | 41 +++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/modules/betweenBidAdapter.js b/modules/betweenBidAdapter.js index 7ac1e4edf15..09c8678d1ff 100644 --- a/modules/betweenBidAdapter.js +++ b/modules/betweenBidAdapter.js @@ -3,12 +3,13 @@ import { getAdUnitSizes, parseSizesInput } from '../src/utils.js'; import { getRefererInfo } from '../src/refererDetection.js'; const BIDDER_CODE = 'between'; -const ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid'; +let ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid'; +const CODE_TYPES = ['inpage', 'preroll', 'midroll', 'postroll']; export const spec = { code: BIDDER_CODE, aliases: ['btw'], - supportedMediaTypes: ['banner'], + supportedMediaTypes: ['banner', 'video'], /** * Determines whether or not the given bid request is valid. * @@ -30,6 +31,8 @@ export const spec = { const refInfo = getRefererInfo(); validBidRequests.forEach((i) => { + const video = i.mediaTypes && i.mediaTypes.video; + let params = { eids: getUsersIds(i), sizes: parseSizesInput(getAdUnitSizes(i)), @@ -38,12 +41,21 @@ export const spec = { tz: getTz(), fl: getFl(), rr: getRr(), - s: i.params.s, + s: i.params && i.params.s, bidid: i.bidId, transactionid: i.transactionId, auctionid: i.auctionId }; + if (video) { + params.mediaType = 2; + params.maxd = video.maxd; + params.mind = video.mind; + params.pos = 'atf'; + ENDPOINT += '&jst=pvc'; + params.codeType = CODE_TYPES.includes(video.codeType) ? video.codeType : 'inpage'; + } + if (i.params.itu !== undefined) { params.itu = i.params.itu; } @@ -94,12 +106,15 @@ export const spec = { */ interpretResponse: function(serverResponse, bidRequest) { const bidResponses = []; + for (var i = 0; i < serverResponse.body.length; i++) { let bidResponse = { requestId: serverResponse.body[i].bidid, cpm: serverResponse.body[i].cpm || 0, width: serverResponse.body[i].w, height: serverResponse.body[i].h, + vastXml: serverResponse.body[i].vastXml, + mediaType: serverResponse.body[i].mediaType, ttl: serverResponse.body[i].ttl, creativeId: serverResponse.body[i].creativeid, currency: serverResponse.body[i].currency || 'RUB', @@ -109,6 +124,7 @@ export const spec = { advertiserDomains: serverResponse.body[i].adomain ? serverResponse.body[i].adomain : [] } }; + bidResponses.push(bidResponse); } return bidResponses; diff --git a/test/spec/modules/betweenBidAdapter_spec.js b/test/spec/modules/betweenBidAdapter_spec.js index 7f8e69669a8..65c200748e4 100644 --- a/test/spec/modules/betweenBidAdapter_spec.js +++ b/test/spec/modules/betweenBidAdapter_spec.js @@ -23,6 +23,32 @@ describe('betweenBidAdapterTests', function () { let req_data = JSON.parse(request.data)[0].data; expect(req_data.bidid).to.equal('bid1234'); }); + + it('validate_video_params', function () { + let bidRequestData = [{ + bidId: 'bid1234', + bidder: 'between', + params: {w: 240, h: 400, s: 1112}, + mediaTypes: { + video: { + context: 'outstream', + playerSize: [970, 250], + maxd: 123, + mind: 234, + codeType: 'unknown code type' + } + }, + }]; + let request = spec.buildRequests(bidRequestData); + let req_data = JSON.parse(request.data)[0].data; + + expect(req_data.mediaType).to.equal(2); + expect(req_data.maxd).to.equal(123); + expect(req_data.mind).to.equal(234); + expect(req_data.pos).to.equal('atf'); + expect(req_data.codeType).to.equal('inpage'); + }); + it('validate itu param', function() { let bidRequestData = [{ bidId: 'bid1234', @@ -230,6 +256,21 @@ describe('betweenBidAdapterTests', function () { expect(bid.requestId).to.equal('bid1234'); expect(bid.ad).to.equal('Ad html'); }); + + it('validate_response_video_params', function () { + let serverResponse = { + body: [{ + mediaType: 2, + vastXml: 'vastXml', + }] + }; + let bids = spec.interpretResponse(serverResponse); + expect(bids).to.have.lengthOf(1); + let bid = bids[0]; + expect(bid.mediaType).to.equal(2); + expect(bid.vastXml).to.equal('vastXml'); + }); + it('validate response params without currency', function () { let serverResponse = { body: [{ From 92b4367447f29ca17537b4f79eecc6648ed3eced Mon Sep 17 00:00:00 2001 From: tamarm <40788385+tamarm-perion@users.noreply.github.com> Date: Tue, 19 Oct 2021 19:28:45 +0300 Subject: [PATCH 199/250] Undertone Bid Adapter: add schain support (#7590) * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * fix lint issue in undertone adapter spec * added user sync function to undertone adapter * * Update undertone adapter - change parameters - placementId parameter is now optional and not mandatory - undertoneBidAdapter.js * Updated undertone bid adapter tests accordingly - undertoneBidAdapter_spec.js * added user sync function to undertone adapter * added user sync function to undertone adapter * revert package-lock.json * added user sync function to undertone adapter * Update undertoneBidAdapter.js * Update browsers.json * schain support * undertoneBidAdapter.js - fixed indentation Co-authored-by: omerko Co-authored-by: Omer Koren Co-authored-by: AnnaPerion Co-authored-by: Oran Hollaender Co-authored-by: tamirnPerion <44399211+tamirnPerion@users.noreply.github.com> --- browsers.json | 1 + modules/undertoneBidAdapter.js | 14 +++-- modules/undertoneBidAdapter.md | 6 ++- test/spec/modules/undertoneBidAdapter_spec.js | 52 +++++++++++++++++++ 4 files changed, 67 insertions(+), 6 deletions(-) diff --git a/browsers.json b/browsers.json index 4f2ea456f68..aad51ca6383 100644 --- a/browsers.json +++ b/browsers.json @@ -71,4 +71,5 @@ "device": null, "os": "OS X" } + } diff --git a/modules/undertoneBidAdapter.js b/modules/undertoneBidAdapter.js index 14a765206b6..d9c9f84e050 100644 --- a/modules/undertoneBidAdapter.js +++ b/modules/undertoneBidAdapter.js @@ -85,13 +85,17 @@ export const spec = { const vw = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); const vh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); const pageSizeArray = vw == 0 || vh == 0 ? null : [vw, vh]; + const commons = { + 'adapterVersion': '$prebid.version$', + 'uids': validBidRequests[0].userId, + 'pageSize': pageSizeArray + }; + if (validBidRequests[0].schain) { + commons.schain = validBidRequests[0].schain; + } const payload = { 'x-ut-hb-params': [], - 'commons': { - 'adapterVersion': '$prebid.version$', - 'uids': validBidRequests[0].userId, - 'pageSize': pageSizeArray - } + 'commons': commons }; const referer = bidderRequest.refererInfo.referer; const hostname = parseUrl(referer).hostname; diff --git a/modules/undertoneBidAdapter.md b/modules/undertoneBidAdapter.md index 8ac84b77bd8..8e0b234fd7a 100644 --- a/modules/undertoneBidAdapter.md +++ b/modules/undertoneBidAdapter.md @@ -1,9 +1,13 @@ # Overview ``` -Module Name: Example Bidder Adapter +Module Name: Undertone Bidder Adapter Module Type: Bidder Adapter Maintainer: RampProgrammatic@perion.com +gdpr_supported: true +usp_supported: true +schain_supported: true +media_types: video, native ``` # Description diff --git a/test/spec/modules/undertoneBidAdapter_spec.js b/test/spec/modules/undertoneBidAdapter_spec.js index 0faa321be5f..56217fe3561 100644 --- a/test/spec/modules/undertoneBidAdapter_spec.js +++ b/test/spec/modules/undertoneBidAdapter_spec.js @@ -60,6 +60,23 @@ const videoBidReq = [{ bidId: '263be71e91dd9d', auctionId: '9ad1fa8d-2297-4660-a018-b39945054746' }]; +const schainObj = { + 'ver': '1.0', + 'complete': 1, + 'nodes': [ + { + 'asi': 'indirectseller.com', + 'sid': '00001', + 'hp': 1 + }, + + { + 'asi': 'indirectseller-2.com', + 'sid': '00002', + 'hp': 2 + } + ] +}; const bidReq = [{ adUnitCode: 'div-gpt-ad-1460505748561-0', bidder: BIDDER_CODE, @@ -72,6 +89,29 @@ const bidReq = [{ auctionId: '9ad1fa8d-2297-4660-a018-b39945054746' }, { + adUnitCode: 'div-gpt-ad-1460505748561-0', + bidder: BIDDER_CODE, + params: { + publisherId: 12345 + }, + sizes: [[1, 1]], + bidId: '453cf42d72bb3c', + auctionId: '6c22f5a5-59df-4dc6-b92c-f433bcf0a874', + schain: schainObj +}]; + +const supplyChainedBidReqs = [{ + adUnitCode: 'div-gpt-ad-1460505748561-0', + bidder: BIDDER_CODE, + params: { + placementId: '10433394', + publisherId: 12345, + }, + sizes: [[300, 250], [300, 600]], + bidId: '263be71e91dd9d', + auctionId: '9ad1fa8d-2297-4660-a018-b39945054746', + schain: schainObj +}, { adUnitCode: 'div-gpt-ad-1460505748561-0', bidder: BIDDER_CODE, params: { @@ -236,6 +276,18 @@ describe('Undertone Adapter', () => { sandbox.restore(); }); + describe('supply chain', function () { + it('should send supply chain if found on first bid', function () { + const request = spec.buildRequests(supplyChainedBidReqs, bidderReq); + const commons = JSON.parse(request.data)['commons']; + expect(commons.schain).to.deep.equal(schainObj); + }); + it('should not send supply chain if not found on first bid', function () { + const request = spec.buildRequests(bidReq, bidderReq); + const commons = JSON.parse(request.data)['commons']; + expect(commons.schain).to.not.exist; + }); + }); it('should send request to correct url via POST not in GDPR or CCPA', function () { const request = spec.buildRequests(bidReq, bidderReq); const domainStart = bidderReq.refererInfo.referer.indexOf('//'); From 9b063c76eb108f55c2cb344c58071024d08edeb7 Mon Sep 17 00:00:00 2001 From: Miko Stern <37616476+mikomgk@users.noreply.github.com> Date: Tue, 19 Oct 2021 19:40:38 +0300 Subject: [PATCH 200/250] Support adomain (#7579) * Add adomain to bid * Handle better tests --- modules/engageyaBidAdapter.js | 157 ++++++++++ test/spec/modules/engageyaBidAdapter_spec.js | 286 +++++++++++++++++++ 2 files changed, 443 insertions(+) create mode 100644 modules/engageyaBidAdapter.js create mode 100644 test/spec/modules/engageyaBidAdapter_spec.js diff --git a/modules/engageyaBidAdapter.js b/modules/engageyaBidAdapter.js new file mode 100644 index 00000000000..27d1bb15af8 --- /dev/null +++ b/modules/engageyaBidAdapter.js @@ -0,0 +1,157 @@ +import { + BANNER, + NATIVE +} from '../src/mediaTypes.js'; +import { createTrackPixelHtml } from '../src/utils.js'; + +const { + registerBidder +} = require('../src/adapters/bidderFactory.js'); +const BIDDER_CODE = 'engageya'; +const ENDPOINT_URL = 'https://recs.engageya.com/rec-api/getrecs.json'; +const ENDPOINT_METHOD = 'GET'; + +function getPageUrl() { + var pUrl = window.location.href; + if (isInIframe()) { + pUrl = document.referrer ? document.referrer : pUrl; + } + pUrl = encodeURIComponent(pUrl); + return pUrl; +} + +function isInIframe() { + try { + var isInIframe = (window.self !== window.top); + } catch (e) { + isInIframe = true; + } + return isInIframe; +} + +function getImageSrc(rec) { + return rec.thumbnail_path.indexOf('http') === -1 ? 'https:' + rec.thumbnail_path : rec.thumbnail_path; +} + +function getImpressionTrackers(rec) { + if (!rec.trackers) { + return []; + } + const impressionTrackers = rec.trackers.impressionPixels || []; + const viewTrackers = rec.trackers.viewPixels || []; + return [...impressionTrackers, ...viewTrackers]; +} + +function parseNativeResponse(rec, response) { + return { + title: rec.title, + body: '', + image: { + url: getImageSrc(rec), + width: response.imageWidth, + height: response.imageHeight + }, + privacyLink: '', + clickUrl: rec.clickUrl, + displayUrl: rec.url, + cta: '', + sponsoredBy: rec.displayName, + impressionTrackers: getImpressionTrackers(rec), + }; +} + +function parseBannerResponse(rec, response) { + if (rec.tag) { + return rec.tag; + } + let style; + try { + let additionalData = JSON.parse(response.widget.additionalData); + const css = additionalData.css || ''; + style = css ? `` : ''; + } catch (e) { + style = ''; + } + const title = rec.title && rec.title.trim() ? `` : ''; + const displayName = rec.displayName && title ? `` : ''; + const trackers = getImpressionTrackers(rec) + .map(createTrackPixelHtml) + .join(''); + return `${style}`; +} + +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER, NATIVE], + isBidRequestValid: function (bid) { + return bid && bid.params && bid.params.hasOwnProperty('widgetId') && bid.params.hasOwnProperty('websiteId') && !isNaN(bid.params.widgetId) && !isNaN(bid.params.websiteId); + }, + + buildRequests: function (validBidRequests, bidderRequest) { + var bidRequests = []; + if (validBidRequests && validBidRequests.length > 0) { + validBidRequests.forEach(function (bidRequest) { + if (bidRequest.params) { + var mediaType = bidRequest.hasOwnProperty('nativeParams') ? 1 : 2; + var imageWidth = -1; + var imageHeight = -1; + if (bidRequest.sizes && bidRequest.sizes.length > 0) { + imageWidth = bidRequest.sizes[0][0]; + imageHeight = bidRequest.sizes[0][1]; + } else if (bidRequest.nativeParams && bidRequest.nativeParams.image && bidRequest.nativeParams.image.sizes) { + imageWidth = bidRequest.nativeParams.image.sizes[0]; + imageHeight = bidRequest.nativeParams.image.sizes[1]; + } + + var widgetId = bidRequest.params.widgetId; + var websiteId = bidRequest.params.websiteId; + var pageUrl = (bidRequest.params.pageUrl && bidRequest.params.pageUrl != '[PAGE_URL]') ? bidRequest.params.pageUrl : ''; + if (!pageUrl) { + pageUrl = (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) ? bidderRequest.refererInfo.referer : getPageUrl(); + } + var bidId = bidRequest.bidId; + var finalUrl = ENDPOINT_URL + '?pubid=0&webid=' + websiteId + '&wid=' + widgetId + '&url=' + pageUrl + '&ireqid=' + bidId + '&pbtpid=' + mediaType + '&imw=' + imageWidth + '&imh=' + imageHeight; + if (bidderRequest && bidderRequest.gdprConsent && bidderRequest.gdprApplies && bidderRequest.consentString) { + finalUrl += '&is_gdpr=1&gdpr_consent=' + bidderRequest.consentString; + } + bidRequests.push({ + url: finalUrl, + method: ENDPOINT_METHOD, + data: '' + }); + } + }); + } + + return bidRequests; + }, + + interpretResponse: function (serverResponse, bidRequest) { + if (!serverResponse.body || !serverResponse.body.recs || !serverResponse.body.recs.length) { + return []; + } + var response = serverResponse.body; + var isNative = response.pbtypeId == 1; + return response.recs.map(rec => { + let bid = { + requestId: response.ireqId, + cpm: rec.ecpm, + width: response.imageWidth, + height: response.imageHeight, + creativeId: rec.postId, + currency: 'USD', + netRevenue: false, + ttl: 360, + meta: { advertiserDomains: rec.domain ? [rec.domain] : [] }, + } + if (isNative) { + bid.native = parseNativeResponse(rec, response); + } else { + bid.ad = parseBannerResponse(rec, response); + } + return bid; + }); + } +}; + +registerBidder(spec); diff --git a/test/spec/modules/engageyaBidAdapter_spec.js b/test/spec/modules/engageyaBidAdapter_spec.js new file mode 100644 index 00000000000..ae22948994b --- /dev/null +++ b/test/spec/modules/engageyaBidAdapter_spec.js @@ -0,0 +1,286 @@ +import { expect } from 'chai'; +import { spec } from 'modules/engageyaBidAdapter.js'; +import * as utils from 'src/utils.js'; + +const ENDPOINT_URL = 'https://recs.engageya.com/rec-api/getrecs.json'; + +export const _getUrlVars = function (url) { + var hash; + var myJson = {}; + var hashes = url.slice(url.indexOf('?') + 1).split('&'); + for (var i = 0; i < hashes.length; i++) { + hash = hashes[i].split('='); + myJson[hash[0]] = hash[1]; + } + return myJson; +} + +describe('engageya adapter', function () { + let bidRequests; + let nativeBidRequests; + + beforeEach(function () { + bidRequests = [ + { + bidder: 'engageya', + params: { + widgetId: 85610, + websiteId: 91140, + pageUrl: '[PAGE_URL]' + } + } + ] + + nativeBidRequests = [ + { + bidder: 'engageya', + params: { + widgetId: 85610, + websiteId: 91140, + pageUrl: '[PAGE_URL]' + }, + nativeParams: { + title: { + required: true, + len: 80 + }, + image: { + required: true, + sizes: [150, 50] + }, + sponsoredBy: { + required: true + } + } + } + ] + }) + describe('isBidRequestValid', function () { + it('valid bid case', function () { + let validBid = { + bidder: 'engageya', + params: { + widgetId: 85610, + websiteId: 91140, + pageUrl: '[PAGE_URL]' + } + } + let isValid = spec.isBidRequestValid(validBid); + expect(isValid).to.equal(true); + }); + + it('invalid bid case: widgetId and websiteId is not passed', function () { + let validBid = { + bidder: 'engageya', + params: {} + } + let isValid = spec.isBidRequestValid(validBid); + expect(isValid).to.equal(false); + }) + + it('invalid bid case: widget id must be number', function () { + let invalidBid = { + bidder: 'engageya', + params: { + widgetId: '157746a', + websiteId: 91140, + pageUrl: '[PAGE_URL]' + } + } + let isValid = spec.isBidRequestValid(invalidBid); + expect(isValid).to.equal(false); + }) + }) + + describe('buildRequests', function () { + it('sends bid request to ENDPOINT via GET', function () { + const request = spec.buildRequests(bidRequests)[0]; + expect(request.url).to.include(ENDPOINT_URL); + expect(request.method).to.equal('GET'); + }); + + it('buildRequests function should not modify original bidRequests object', function () { + let originalBidRequests = utils.deepClone(bidRequests); + let request = spec.buildRequests(bidRequests); + expect(bidRequests).to.deep.equal(originalBidRequests); + }); + + it('buildRequests function should not modify original nativeBidRequests object', function () { + let originalBidRequests = utils.deepClone(nativeBidRequests); + let request = spec.buildRequests(nativeBidRequests); + expect(nativeBidRequests).to.deep.equal(originalBidRequests); + }); + + it('Request params check', function () { + let request = spec.buildRequests(bidRequests)[0]; + const data = _getUrlVars(request.url) + expect(parseInt(data.wid)).to.exist.and.to.equal(bidRequests[0].params.widgetId); + expect(parseInt(data.webid)).to.exist.and.to.equal(bidRequests[0].params.websiteId); + }) + }) + + describe('interpretResponse', function () { + it('should return empty array if no response', function () { + const result = spec.interpretResponse({}, []) + expect(result).to.be.an('array').that.is.empty + }); + + it('should return empty array if no valid bids', function () { + let response = { + recs: [], + imageWidth: 300, + imageHeight: 250, + ireqId: '1d236f7890b', + pbtypeId: 2 + }; + let request = spec.buildRequests(bidRequests)[0]; + const result = spec.interpretResponse({ body: response }, request) + expect(result).to.be.an('array').that.is.empty + }); + + it('should interpret native response', function () { + let serverResponse = { + recs: [ + { + ecpm: 0.0920, + postId: '', + thumbnail_path: 'https://engageya.live/wp-content/uploads/2019/05/images.png', + domain: 'domain.test', + title: 'Test title', + clickUrl: '//click.test', + url: '//url.test', + displayName: 'Test displayName', + trackers: { + impressionPixels: ['//impression.test'], + viewPixels: ['//view.test'], + } + } + ], + imageWidth: 300, + imageHeight: 250, + ireqId: '1d236f7890b', + pbtypeId: 1 + }; + let expectedResult = [ + { + requestId: '1d236f7890b', + cpm: 0.0920, + width: 300, + height: 250, + netRevenue: false, + currency: 'USD', + creativeId: '', + ttl: 360, + meta: { + advertiserDomains: ['domain.test'] + }, + native: { + title: 'Test title', + body: '', + image: { + url: 'https://engageya.live/wp-content/uploads/2019/05/images.png', + width: 300, + height: 250 + }, + privacyLink: '', + clickUrl: '//click.test', + displayUrl: '//url.test', + cta: '', + sponsoredBy: 'Test displayName', + impressionTrackers: ['//impression.test', '//view.test'], + }, + } + ]; + let request = spec.buildRequests(bidRequests)[0]; + let result = spec.interpretResponse({ body: serverResponse }, request); + expect(result).to.deep.equal(expectedResult); + }); + + it('should interpret display response', function () { + let serverResponse = { + recs: [ + { + ecpm: 0.0920, + postId: '', + thumbnail_path: 'https://engageya.live/wp-content/uploads/2019/05/images.png', + domain: 'domain.test', + title: 'Test title', + clickUrl: '//click.test', + url: '//url.test', + displayName: 'Test displayName', + trackers: { + impressionPixels: ['//impression.test'], + viewPixels: ['//view.test'], + } + } + ], + imageWidth: 300, + imageHeight: 250, + ireqId: '1d236f7890b', + pbtypeId: 2, + widget: { + additionalData: '{"css":".eng_tag_ttl{display:block!important}"}' + } + }; + let expectedResult = [ + { + requestId: '1d236f7890b', + cpm: 0.0920, + width: 300, + height: 250, + netRevenue: false, + currency: 'USD', + creativeId: '', + ttl: 360, + meta: { + advertiserDomains: ['domain.test'] + }, + ad: ``, + } + ]; + let request = spec.buildRequests(bidRequests)[0]; + let result = spec.interpretResponse({ body: serverResponse }, request); + expect(result).to.deep.equal(expectedResult); + }); + + it('should interpret display response without title', function () { + let serverResponse = { + recs: [ + { + ecpm: 0.0920, + postId: '', + thumbnail_path: 'https://engageya.live/wp-content/uploads/2019/05/images.png', + domain: 'domain.test', + title: ' ', + clickUrl: '//click.test', + url: '//url.test', + displayName: 'Test displayName', + } + ], + imageWidth: 300, + imageHeight: 250, + ireqId: '1d236f7890b', + pbtypeId: 2, + }; + let expectedResult = [ + { + requestId: '1d236f7890b', + cpm: 0.0920, + width: 300, + height: 250, + netRevenue: false, + currency: 'USD', + creativeId: '', + ttl: 360, + meta: { + advertiserDomains: ['domain.test'] + }, + ad: `
`, + } + ]; + let request = spec.buildRequests(bidRequests)[0]; + let result = spec.interpretResponse({ body: serverResponse }, request); + expect(result).to.deep.equal(expectedResult); + }); + }) +}) From 7dba6199814a21257309eb0b890fa221e7e6c3ee Mon Sep 17 00:00:00 2001 From: Desvillettes <30619957+AurelienMozoo@users.noreply.github.com> Date: Tue, 19 Oct 2021 18:46:37 +0200 Subject: [PATCH 201/250] Ogury Bid Adapter: use utils functions to get ad content (#7573) * handle bid object context * update test naming * Update unit test naming --- modules/oguryBidAdapter.js | 15 +++++- test/spec/modules/oguryBidAdapter_spec.js | 65 ++++++++++++++++++----- 2 files changed, 67 insertions(+), 13 deletions(-) diff --git a/modules/oguryBidAdapter.js b/modules/oguryBidAdapter.js index dbef3ef7300..40843d58d02 100644 --- a/modules/oguryBidAdapter.js +++ b/modules/oguryBidAdapter.js @@ -1,7 +1,7 @@ 'use strict'; import { BANNER } from '../src/mediaTypes.js'; -import { getAdUnitSizes, logWarn, isFn } from '../src/utils.js'; +import { getAdUnitSizes, logWarn, isFn, getWindowTop, getWindowSelf } from '../src/utils.js'; import { registerBidder } from '../src/adapters/bidderFactory.js'; import { ajax } from '../src/ajax.js' @@ -145,7 +145,19 @@ function getFloor(bid) { return floorResult.currency === 'USD' ? floorResult.floor : 0; } +function getWindowContext() { + try { + return getWindowTop() + } catch (e) { + return getWindowSelf() + } +} + function onBidWon(bid) { + const w = getWindowContext() + w.OG_PREBID_BID_OBJECT = { + ...(bid && { ...bid }), + } if (bid && bid.hasOwnProperty('nurl') && bid.nurl.length > 0) ajax(bid['nurl'], null); } @@ -165,6 +177,7 @@ export const spec = { interpretResponse, getFloor, onBidWon, + getWindowContext, onTimeout } diff --git a/test/spec/modules/oguryBidAdapter_spec.js b/test/spec/modules/oguryBidAdapter_spec.js index ecda1f681ce..883119d2707 100644 --- a/test/spec/modules/oguryBidAdapter_spec.js +++ b/test/spec/modules/oguryBidAdapter_spec.js @@ -1,6 +1,6 @@ import { expect } from 'chai'; import { spec } from 'modules/oguryBidAdapter'; -import { deepClone } from 'src/utils.js'; +import * as utils from 'src/utils.js'; const BID_URL = 'https://mweb-hb.presage.io/api/header-bidding-request'; const TIMEOUT_URL = 'https://ms-ads-monitoring-events.presage.io/bid_timeout' @@ -68,14 +68,14 @@ describe('OguryBidAdapter', function () { describe('isBidRequestValid', function () { it('should validate correct bid', () => { - let validBid = deepClone(bidRequests[0]); + let validBid = utils.deepClone(bidRequests[0]); let isValid = spec.isBidRequestValid(validBid); expect(isValid).to.equal(true); }); it('should not validate incorrect bid', () => { - let invalidBid = deepClone(bidRequests[0]); + let invalidBid = utils.deepClone(bidRequests[0]); delete invalidBid.sizes; delete invalidBid.mediaTypes; @@ -84,7 +84,7 @@ describe('OguryBidAdapter', function () { }); it('should not validate bid if adunit is not present', () => { - let invalidBid = deepClone(bidRequests[0]); + let invalidBid = utils.deepClone(bidRequests[0]); delete invalidBid.params.adUnitId; let isValid = spec.isBidRequestValid(invalidBid); @@ -92,7 +92,7 @@ describe('OguryBidAdapter', function () { }); it('should not validate bid if assetKet is not present', () => { - let invalidBid = deepClone(bidRequests[0]); + let invalidBid = utils.deepClone(bidRequests[0]); delete invalidBid.params.assetKey; let isValid = spec.isBidRequestValid(invalidBid); @@ -100,7 +100,7 @@ describe('OguryBidAdapter', function () { }); it('should validate bid if getFloor is not present', () => { - let invalidBid = deepClone(bidRequests[1]); + let invalidBid = utils.deepClone(bidRequests[1]); delete invalidBid.getFloor; let isValid = spec.isBidRequestValid(invalidBid); @@ -270,7 +270,7 @@ describe('OguryBidAdapter', function () { }; it('sends bid request to ENDPOINT via POST', function () { - const validBidRequests = deepClone(bidRequests) + const validBidRequests = utils.deepClone(bidRequests) const request = spec.buildRequests(validBidRequests, bidderRequest); expect(request.url).to.equal(BID_URL); @@ -278,7 +278,7 @@ describe('OguryBidAdapter', function () { }); it('bid request object should be conform', function () { - const validBidRequests = deepClone(bidRequests) + const validBidRequests = utils.deepClone(bidRequests) const request = spec.buildRequests(validBidRequests, bidderRequest); expect(request.data).to.deep.equal(expectedRequestObject); @@ -316,7 +316,7 @@ describe('OguryBidAdapter', function () { ...expectedRequestObject }; - const validBidRequests = deepClone(bidRequests); + const validBidRequests = utils.deepClone(bidRequests); validBidRequests[1] = { ...validBidRequests[1], getFloor: undefined @@ -331,7 +331,7 @@ describe('OguryBidAdapter', function () { ...expectedRequestObject }; - let validBidRequests = deepClone(bidRequests); + let validBidRequests = utils.deepClone(bidRequests); validBidRequests[1] = { ...validBidRequests[1], getFloor: 'getFloor' @@ -342,9 +342,9 @@ describe('OguryBidAdapter', function () { }); it('should handle bidFloor when currency is not USD', () => { - const expectedRequestWithUnsupportedFloorCurrency = deepClone(expectedRequestObject) + const expectedRequestWithUnsupportedFloorCurrency = utils.deepClone(expectedRequestObject) expectedRequestWithUnsupportedFloorCurrency.imp[0].bidfloor = 0; - let validBidRequests = deepClone(bidRequests); + let validBidRequests = utils.deepClone(bidRequests); validBidRequests[0] = { ...validBidRequests[0], getFloor: ({ size, currency, mediaType }) => { @@ -490,6 +490,47 @@ describe('OguryBidAdapter', function () { expect(requests[0].url).to.equal(nurl); expect(requests[0].method).to.equal('GET') }) + + it('Should trigger getWindowContext method', function() { + const bidSample = { + id: 'advertId', + impid: 'bidId', + price: 100, + nurl: 'url', + adm: `test creative
cookies
`, + adomain: ['renault.fr'], + ext: { + adcontent: 'sample_creative', + advertid: '1a278c48-b79a-4bbf-b69f-3824803e7d87', + campaignid: '31724', + mediatype: 'image', + userid: 'ab4aabed-5230-49d9-9f1a-f06280d28366', + usersync: true, + advertiserid: '1', + isomidcompliant: false + }, + w: 180, + h: 101 + } + spec.onBidWon(bidSample) + expect(window.top.OG_PREBID_BID_OBJECT).to.deep.equal(bidSample) + }) + }) + + describe('getWindowContext', function() { + it('Should return top window if exist', function() { + const res = spec.getWindowContext() + expect(res).to.equal(window.top) + expect(res).to.not.be.undefined; + }) + + it('Should return self window if getting top window throw an error', function() { + const stub = sinon.stub(utils, 'getWindowTop') + stub.throws() + const res = spec.getWindowContext() + expect(res).to.equal(window.self) + utils.getWindowTop.restore() + }) }) describe('onTimeout', function () { From ce28fe450338221a6dff1f03677bf1b550eab803 Mon Sep 17 00:00:00 2001 From: Jurij Sinickij Date: Tue, 19 Oct 2021 20:30:53 +0300 Subject: [PATCH 202/250] Adf adapter: new bidder params added, multiformat bids supported (#7570) * Adf adapter: additional bidder parameters * allow multi media type bids --- modules/adfBidAdapter.js | 37 ++++---- test/spec/modules/adfBidAdapter_spec.js | 112 ++++++++++++++++++------ 2 files changed, 104 insertions(+), 45 deletions(-) diff --git a/modules/adfBidAdapter.js b/modules/adfBidAdapter.js index f7727a168b8..f0425a174ff 100644 --- a/modules/adfBidAdapter.js +++ b/modules/adfBidAdapter.js @@ -58,7 +58,11 @@ export const spec = { aliases: BIDDER_ALIAS, gvlid: GVLID, supportedMediaTypes: [ NATIVE, BANNER, VIDEO ], - isBidRequestValid: bid => !!bid.params.mid, + isBidRequestValid: (bid) => { + const params = bid.params || {}; + const { mid, inv, mname } = params; + return !!(mid || (inv && mname)); + }, buildRequests: (validBidRequests, bidderRequest) => { let app, site; @@ -104,12 +108,19 @@ export const spec = { }) : {}; const bidfloor = floorInfo.floor; const bidfloorcur = floorInfo.currency; + const { mid, inv, mname } = bid.params; const imp = { id: id + 1, - tagid: bid.params.mid, + tagid: mid, bidfloor, - bidfloorcur + bidfloorcur, + ext: { + bidder: { + inv, + mname + } + } }; const assets = _map(bid.nativeParams, (bidParams, key) => { @@ -153,9 +164,6 @@ export const spec = { assets } }; - - bid.mediaType = NATIVE; - return imp; } const bannerParams = deepAccess(bid, 'mediaTypes.banner'); @@ -172,18 +180,14 @@ export const spec = { imp.banner = { format }; - bid.mediaType = BANNER; - - return imp; } const videoParams = deepAccess(bid, 'mediaTypes.video'); if (videoParams) { imp.video = videoParams; - bid.mediaType = VIDEO; - - return imp; } + + return imp; }); const request = { @@ -243,6 +247,7 @@ export const spec = { return bids.map((bid, id) => { const bidResponse = bidResponses[id]; if (bidResponse) { + const mediaType = deepAccess(bidResponse, 'ext.prebid.type'); const result = { requestId: bid.bidId, cpm: bidResponse.price, @@ -250,12 +255,12 @@ export const spec = { ttl: 360, netRevenue: bid.netRevenue === 'net', currency: cur, - mediaType: bid.mediaType, + mediaType, width: bidResponse.w, height: bidResponse.h, dealId: bidResponse.dealid, meta: { - mediaType: bid.mediaType, + mediaType, advertiserDomains: bidResponse.adomain } }; @@ -263,10 +268,10 @@ export const spec = { if (bidResponse.native) { result.native = parseNative(bidResponse); } else { - result[ bid.mediaType === VIDEO ? 'vastXml' : 'ad' ] = bidResponse.adm; + result[ mediaType === VIDEO ? 'vastXml' : 'ad' ] = bidResponse.adm; } - if (!bid.renderer && bid.mediaType === VIDEO && deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { + if (!bid.renderer && mediaType === VIDEO && deepAccess(bid, 'mediaTypes.video.context') === 'outstream') { result.renderer = Renderer.install({id: bid.bidId, url: OUTSTREAM_RENDERER_URL, adUnitCode: bid.adUnitCode}); result.renderer.setRender(renderer); } diff --git a/test/spec/modules/adfBidAdapter_spec.js b/test/spec/modules/adfBidAdapter_spec.js index c8697032b3f..ed096e7189d 100644 --- a/test/spec/modules/adfBidAdapter_spec.js +++ b/test/spec/modules/adfBidAdapter_spec.js @@ -29,11 +29,34 @@ describe('Adf adapter', function () { it('should return true when required params found', function () { assert(spec.isBidRequestValid(bid)); + + bid.params = { + inv: 1234, + mname: 'some-placement' + }; + assert(spec.isBidRequestValid(bid)); + + bid.params = { + mid: 4332, + inv: 1234, + mname: 'some-placement' + }; + assert(spec.isBidRequestValid(bid)); }); it('should return false when required params are missing', function () { bid.params = { adxDomain: 'adx.adform.net' }; assert.isFalse(spec.isBidRequestValid(bid)); + + bid.params = { + mname: 'some-placement' + }; + assert.isFalse(spec.isBidRequestValid(bid)); + + bid.params = { + inv: 1234 + }; + assert.isFalse(spec.isBidRequestValid(bid)); }); }); @@ -331,6 +354,30 @@ describe('Adf adapter', function () { } }); + describe('dynamic placement tag', function () { + it('should add imp parameters correctly', function () { + const validBidRequests = [ + { bidId: 'bidId', params: { inv: 1000, mname: 'placement' }, mediaTypes: {video: {}} }, + { bidId: 'bidId', params: { mid: 1234, inv: 1002, mname: 'placement2' }, mediaTypes: {video: {}} }, + { bidId: 'bidId', params: { mid: 1234 }, mediaTypes: {video: {}} } + ]; + const [ imp1, imp2, imp3 ] = getRequestImps(validBidRequests); + + assert.equal(imp1.ext.bidder.inv, 1000); + assert.equal(imp1.ext.bidder.mname, 'placement'); + assert.equal('tagid' in imp1, false); + + assert.equal(imp2.ext.bidder.inv, 1002); + assert.equal(imp2.ext.bidder.mname, 'placement2'); + assert.equal(imp2.tagid, 1234); + + assert.ok(imp3.ext.bidder); + assert.equal('inv' in imp3.ext.bidder, false); + assert.equal('mname' in imp3.ext.bidder, false); + assert.equal(imp3.tagid, 1234); + }); + }); + describe('price floors', function () { it('should not add if floors module not configured', function () { const validBidRequests = [{ bidId: 'bidId', params: {mid: 1000}, mediaTypes: {video: {}} }]; @@ -376,18 +423,14 @@ describe('Adf adapter', function () { return { currency: currency, floor - } + }; } }; } - - function getRequestImps(validBidRequests) { - return JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; - } }); describe('multiple media types', function () { - it('should use single media type for bidding', function () { + it('should use all configured media types for bidding', function () { let validBidRequests = [{ bidId: 'bidId', params: { mid: 1000 }, @@ -414,20 +457,23 @@ describe('Adf adapter', function () { banner: { sizes: [[100, 100], [200, 300]] }, - native: {} + native: {}, + video: {} } }]; - let [ banner, video, native ] = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; - - assert.ok(banner.banner); - assert.equal(banner.video, undefined); - assert.equal(banner.native, undefined); - assert.ok(video.video); - assert.equal(video.banner, undefined); - assert.equal(video.native, undefined); - assert.ok(native.native); - assert.equal(native.video, undefined); - assert.equal(native.banner, undefined); + let [ first, second, third ] = JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + + assert.ok(first.banner); + assert.ok(first.video); + assert.equal(first.native, undefined); + + assert.ok(second.video); + assert.equal(second.banner, undefined); + assert.equal(second.native, undefined); + + assert.ok(third.native); + assert.ok(third.video); + assert.ok(third.banner); }); }); @@ -626,6 +672,10 @@ describe('Adf adapter', function () { }); }); }); + + function getRequestImps(validBidRequests) { + return JSON.parse(spec.buildRequests(validBidRequests, { refererInfo: { referer: 'page' } }).data).imp; + } }); describe('interpretResponse', function () { @@ -754,7 +804,12 @@ describe('Adf adapter', function () { imptrackers: ['imptrackers url1', 'imptrackers url2'] }, dealid: 'deal-id', - adomain: [ 'demo.com' ] + adomain: [ 'demo.com' ], + ext: { + prebid: { + type: 'native' + } + } } ] }], @@ -767,7 +822,6 @@ describe('Adf adapter', function () { { bidId: 'bidId1', params: { mid: 1000 }, - mediaType: 'native', nativeParams: { title: { required: true, len: 140 }, image: { required: false, wmin: 836, hmin: 627, w: 325, h: 300, mimes: ['image/jpg', 'image/gif'] }, @@ -899,7 +953,7 @@ describe('Adf adapter', function () { let serverResponse = { body: { seatbid: [{ - bid: [{ impid: '1', adm: '' }] + bid: [{ impid: '1', adm: '', ext: { prebid: { type: 'banner' } } }] }] } }; @@ -908,8 +962,7 @@ describe('Adf adapter', function () { bids: [ { bidId: 'bidId1', - params: { mid: 1000 }, - mediaType: 'banner' + params: { mid: 1000 } } ] }; @@ -917,6 +970,8 @@ describe('Adf adapter', function () { bids = spec.interpretResponse(serverResponse, bidRequest); assert.equal(bids.length, 1); assert.equal(bids[0].ad, ''); + assert.equal(bids[0].mediaType, 'banner'); + assert.equal(bids[0].meta.mediaType, 'banner'); }); }); @@ -925,7 +980,7 @@ describe('Adf adapter', function () { let serverResponse = { body: { seatbid: [{ - bid: [{ impid: '1', adm: '' }] + bid: [{ impid: '1', adm: '', ext: { prebid: { type: 'video' } } }] }] } }; @@ -934,8 +989,7 @@ describe('Adf adapter', function () { bids: [ { bidId: 'bidId1', - params: { mid: 1000 }, - mediaType: 'video' + params: { mid: 1000 } } ] }; @@ -943,13 +997,15 @@ describe('Adf adapter', function () { bids = spec.interpretResponse(serverResponse, bidRequest); assert.equal(bids.length, 1); assert.equal(bids[0].vastXml, ''); + assert.equal(bids[0].mediaType, 'video'); + assert.equal(bids[0].meta.mediaType, 'video'); }); it('should add renderer for outstream bids', function () { let serverResponse = { body: { seatbid: [{ - bid: [{ impid: '1', adm: '' }, { impid: '2', adm: '' }] + bid: [{ impid: '1', adm: '', ext: { prebid: { type: 'video' } } }, { impid: '2', adm: '', ext: { prebid: { type: 'video' } } }] }] } }; @@ -959,7 +1015,6 @@ describe('Adf adapter', function () { { bidId: 'bidId1', params: { mid: 1000 }, - mediaType: 'video', mediaTypes: { video: { context: 'outstream' @@ -969,7 +1024,6 @@ describe('Adf adapter', function () { { bidId: 'bidId2', params: { mid: 1000 }, - mediaType: 'video', mediaTypes: { video: { constext: 'instream' From 10f52a0d0f60bb29cc443a792ab89d63395e0f0b Mon Sep 17 00:00:00 2001 From: johnwier <49074029+johnwier@users.noreply.github.com> Date: Tue, 19 Oct 2021 10:35:43 -0700 Subject: [PATCH 203/250] Publink Id System(Conversant) add support for nonjson cookie (#7575) --- modules/publinkIdSystem.js | 17 +++++++++++------ test/spec/modules/publinkIdSystem_spec.js | 12 ++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/publinkIdSystem.js b/modules/publinkIdSystem.js index 299158a175e..990227e7cfe 100644 --- a/modules/publinkIdSystem.js +++ b/modules/publinkIdSystem.js @@ -81,13 +81,18 @@ function getlocalValue() { } if (typeof value === 'string') { - try { - const obj = JSON.parse(value); - if (obj && obj.exp && obj.exp > Date.now()) { - return obj.publink; + // if it's a json object parse it and return the publink value, otherwise assume the value is the id + if (value.charAt(0) === '{') { + try { + const obj = JSON.parse(value); + if (obj) { + return obj.publink; + } + } catch (e) { + logError(e); } - } catch (e) { - logError(e); + } else { + return value; } } } diff --git a/test/spec/modules/publinkIdSystem_spec.js b/test/spec/modules/publinkIdSystem_spec.js index aa6b669d773..cfb5f8ed135 100644 --- a/test/spec/modules/publinkIdSystem_spec.js +++ b/test/spec/modules/publinkIdSystem_spec.js @@ -47,12 +47,6 @@ describe('PublinkIdSystem', () => { expect(result.id).to.equal(LOCAL_VALUE.publink); storage.removeDataFromLocalStorage(PUBLINK_COOKIE); }); - it('ignore expired cookie', () => { - storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify({publink: 'value', exp: Date.now() - 60 * 60 * 24 * 1000})); - const result = publinkIdSubmodule.getId(); - expect(result.id).to.be.undefined; - storage.removeDataFromLocalStorage(PUBLINK_COOKIE); - }); it('priority goes to publink_srv cookie', () => { storage.setCookie(PUBLINK_SRV_COOKIE, JSON.stringify(COOKIE_VALUE), COOKIE_EXPIRATION); storage.setDataInLocalStorage(PUBLINK_COOKIE, JSON.stringify(LOCAL_VALUE)); @@ -61,6 +55,12 @@ describe('PublinkIdSystem', () => { storage.setCookie(PUBLINK_SRV_COOKIE, '', DELETE_COOKIE); storage.removeDataFromLocalStorage(PUBLINK_COOKIE); }); + it('publink non-json cookie', () => { + storage.setCookie(PUBLINK_COOKIE, COOKIE_VALUE.publink, COOKIE_EXPIRATION); + const result = publinkIdSubmodule.getId(); + expect(result.id).to.equal(COOKIE_VALUE.publink); + storage.setCookie(PUBLINK_COOKIE, '', DELETE_COOKIE); + }); }); describe('getId', () => { From a32b39bf527b41cfbc6e2c08daec8c609d62fce3 Mon Sep 17 00:00:00 2001 From: Gena Date: Tue, 19 Oct 2021 21:12:09 +0300 Subject: [PATCH 204/250] Add streamkey (#7580) --- modules/adtelligentBidAdapter.js | 3 ++- test/spec/modules/adtelligentBidAdapter_spec.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/adtelligentBidAdapter.js b/modules/adtelligentBidAdapter.js index 8523e01c0ea..44a9c90d438 100644 --- a/modules/adtelligentBidAdapter.js +++ b/modules/adtelligentBidAdapter.js @@ -20,6 +20,7 @@ const HOST_GETTERS = { onefiftytwomedia: () => 'ghb.ads.152media.com', mediafuse: () => 'ghb.hbmp.mediafuse.com', bidsxchange: () => 'ghb.hbd.bidsxchange.com', + streamkey: () => 'ghb.hb.streamkey.net', } const getUri = function (bidderCode) { let bidderWithoutSuffix = bidderCode.split('_')[0]; @@ -35,7 +36,7 @@ const syncsCache = {}; export const spec = { code: BIDDER_CODE, gvlid: 410, - aliases: ['onefiftytwomedia', 'selectmedia', 'appaloosa', 'bidsxchange', + aliases: ['onefiftytwomedia', 'selectmedia', 'appaloosa', 'bidsxchange', 'streamkey', { code: 'navelix', gvlid: 380 }, { code: 'mediafuse', diff --git a/test/spec/modules/adtelligentBidAdapter_spec.js b/test/spec/modules/adtelligentBidAdapter_spec.js index 4cfb367efb3..a004d888268 100644 --- a/test/spec/modules/adtelligentBidAdapter_spec.js +++ b/test/spec/modules/adtelligentBidAdapter_spec.js @@ -17,6 +17,7 @@ const aliasEP = { mediafuse: 'https://ghb.hbmp.mediafuse.com/v2/auction/', navelix: 'https://ghb.hb.navelix.com/v2/auction/', bidsxchange: 'https://ghb.hbd.bidsxchange.com/v2/auction/', + streamkey: 'https://ghb.hb.streamkey.net/v2/auction/', }; const DEFAULT_ADATPER_REQ = { bidderCode: 'adtelligent' }; From 12a6c7f1722b57b4589cb25f98dd83af0bfcc442 Mon Sep 17 00:00:00 2001 From: ym-abaranov <78230460+ym-abaranov@users.noreply.github.com> Date: Wed, 20 Oct 2021 03:48:56 -0700 Subject: [PATCH 205/250] Yieldmo Synthetic Inventory Module: add new module (#7537) * Yieldmo Synthetic Inventory Module: initial commit * Updating Documentation * Test coverage improved * Fixes after PR (using isGptPubadsDefined and window.googletag instead of window.top.googletag) Co-authored-by: Nayan Co-authored-by: Dmitriy Labuzov --- modules/yieldmoSyntheticInventoryModule.js | 46 ++++++++++ modules/yieldmoSyntheticInventoryModule.md | 68 ++++++++++++++ .../yieldmoSyntheticInventoryModule_spec.js | 89 +++++++++++++++++++ 3 files changed, 203 insertions(+) create mode 100644 modules/yieldmoSyntheticInventoryModule.js create mode 100644 modules/yieldmoSyntheticInventoryModule.md create mode 100644 test/spec/modules/yieldmoSyntheticInventoryModule_spec.js diff --git a/modules/yieldmoSyntheticInventoryModule.js b/modules/yieldmoSyntheticInventoryModule.js new file mode 100644 index 00000000000..bca778a7b43 --- /dev/null +++ b/modules/yieldmoSyntheticInventoryModule.js @@ -0,0 +1,46 @@ +import { config } from '../src/config.js'; +import { isGptPubadsDefined } from '../src/utils.js'; + +export const MODULE_NAME = 'Yieldmo Synthetic Inventory Module'; + +export function init(config) { + validateConfig(config); + + if (!isGptPubadsDefined()) { + window.googletag = window.googletag || {}; + window.googletag.cmd = window.googletag.cmd || []; + } + + const googletag = window.googletag; + const containerName = 'ym_sim_container_' + config.placementId; + + googletag.cmd.push(() => { + if (window.document.body) { + googletagCmd(config, containerName, googletag); + } else { + window.document.addEventListener('DOMContentLoaded', () => googletagCmd(config, containerName, googletag)); + } + }); +} + +export function validateConfig(config) { + if (!('placementId' in config)) { + throw new Error(`${MODULE_NAME}: placementId required`); + } + if (!('adUnitPath' in config)) { + throw new Error(`${MODULE_NAME}: adUnitPath required`); + } +} + +function googletagCmd(config, containerName, googletag) { + const gamContainer = window.document.createElement('div'); + gamContainer.id = containerName; + window.document.body.appendChild(gamContainer); + googletag.defineSlot(config.adUnitPath, [1, 1], containerName) + .addService(googletag.pubads()) + .setTargeting('ym_sim_p_id', config.placementId); + googletag.enableServices(); + googletag.display(containerName); +} + +config.getConfig('yieldmo_synthetic_inventory', config => init(config.yieldmo_synthetic_inventory)); diff --git a/modules/yieldmoSyntheticInventoryModule.md b/modules/yieldmoSyntheticInventoryModule.md new file mode 100644 index 00000000000..dd6f0acf884 --- /dev/null +++ b/modules/yieldmoSyntheticInventoryModule.md @@ -0,0 +1,68 @@ +# Yieldmo Synthetic Inventory Module + +## Overview + +This module enables publishers to set up Yieldmo Synthetic Outstream ads on their pages. + +If publishers will enable this module and provide placementId and Google Ad Manager ad unit path, this module will create a placement on the page and inject Yieldmo SDK into this placement. Publisher will then need to get a placement id from their Yieldmo account manager (accounts email) and setup corresponding ad units on the GAM ad server. + +## Integration + +Build the Yieldmo Synthetic Inventory Module into the Prebid.js package with: + +``` +gulp build --modules=yieldmoSyntheticInventoryModule,... +``` + +## Module Configuration + +```js +pbjs.que.push(function() { + pbjs.setConfig({ + yieldmo_synthetic_inventory: { + placementId: '1234567890', + adUnitPath: '/1234567/ad_unit_name_used_in_gam' + } + }); +}); +``` + +### Configuration Parameters + +|Name |Scope |Description | Example| Type +| :------------ | :------------ | :------------ | :------------ | :------------ | +|placementId | required | Yieldmo placement ID | '1234567890' | string +|adUnitPath | required | Google Ad Manager ad unit path | '/6355419/ad_unit_name_used_in_gam' | string + +### How to get ad unit path + +Ad unit path follows the format /network-code/[parent-ad-unit-code/.../]ad-unit-code, where: + +- network-code is a unique identifier for the Ad Manager network the ad unit belongs to +- parent-ad-unit-code are the codes of all parent ad units (only applies to non-top level ad units) +- ad-unit-code is the code for the ad unit to be displayed + +Note that all ad unit codes included in the ad unit path must adhere to the [formatting rules](https://support.google.com/admanager/answer/1628457#ad-unit-codes) specified by Ad Manager. + +Another and probably the easiest way to get an ad unit path is to get it from the google ad manager ad unit document header generated tag: + +```js +googletag.defineSlot('/1234567/ad_unit_name_used_in_gam', [1, 1], 'ad-container-id').addService(googletag.pubads()); +``` + +### How to get Yieldmo placement id + +Please reach out to your Yieldmo account's person or email to support@yieldmo.com + +### Google Ad Manager setup + +Yieldmo Synthetic Inventory Module is designed to be used along with Google Ad Manager. GAM should be set as usual, but there are a few requirements: + +- Ad unit size should be 1x1 +- Creative should NOT be served into a SafeFrame and also should have 1x1 size +- Synthetic Inventory Universal Tag should be used as 3rd party creative code +### Synthetic Inventory Universal Tag + +```js +
+``` \ No newline at end of file diff --git a/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js b/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js new file mode 100644 index 00000000000..55b4e7255f7 --- /dev/null +++ b/test/spec/modules/yieldmoSyntheticInventoryModule_spec.js @@ -0,0 +1,89 @@ +import { expect } from 'chai'; +import { + init, + MODULE_NAME, + validateConfig +} from 'modules/yieldmoSyntheticInventoryModule'; + +const mockedYmConfig = { + placementId: '123456', + adUnitPath: '/6355419/ad_unit_name_used_in_gam' +}; + +const setGoogletag = () => { + window.googletag = { + cmd: [], + defineSlot: sinon.stub(), + addService: sinon.stub(), + pubads: sinon.stub(), + setTargeting: sinon.stub(), + enableServices: sinon.stub(), + display: sinon.stub(), + }; + window.googletag.defineSlot.returns(window.googletag); + window.googletag.addService.returns(window.googletag); + window.googletag.pubads.returns({getSlots: sinon.stub()}); + return window.googletag; +} + +describe('Yieldmo Synthetic Inventory Module', function() { + let config = Object.assign({}, mockedYmConfig); + let googletagBkp; + + beforeEach(function () { + googletagBkp = window.googletag; + delete window.googletag; + }); + + afterEach(function () { + window.googletag = googletagBkp; + }); + + it('should be enabled with valid required params', function() { + expect(function () { + init(mockedYmConfig); + }).not.to.throw() + }); + + it('should throw an error if placementId is missed', function() { + const {placementId, ...config} = mockedYmConfig; + + expect(function () { + validateConfig(config); + }).throw(`${MODULE_NAME}: placementId required`) + }); + + it('should throw an error if adUnitPath is missed', function() { + const {adUnitPath, ...config} = mockedYmConfig; + + expect(function () { + validateConfig(config); + }).throw(`${MODULE_NAME}: adUnitPath required`) + }); + + it('should add correct googletag.cmd', function() { + const containerName = 'ym_sim_container_' + mockedYmConfig.placementId; + const gtag = setGoogletag(); + + init(mockedYmConfig); + + expect(gtag.cmd.length).to.equal(1); + + gtag.cmd[0](); + + expect(gtag.addService.getCall(0)).to.not.be.null; + expect(gtag.setTargeting.getCall(0)).to.not.be.null; + expect(gtag.setTargeting.getCall(0).args[0]).to.exist.and.to.equal('ym_sim_p_id'); + expect(gtag.setTargeting.getCall(0).args[1]).to.exist.and.to.equal(mockedYmConfig.placementId); + expect(gtag.defineSlot.getCall(0)).to.not.be.null; + expect(gtag.enableServices.getCall(0)).to.not.be.null; + expect(gtag.display.getCall(0)).to.not.be.null; + expect(gtag.display.getCall(0).args[0]).to.exist.and.to.equal(containerName); + expect(gtag.pubads.getCall(0)).to.not.be.null; + + const gamContainerEl = window.document.getElementById(containerName); + expect(gamContainerEl).to.not.be.null; + + gamContainerEl.parentNode.removeChild(gamContainerEl); + }); +}); From f1c5abd8dff8f13f3d4af7003a711a8e060cbae8 Mon Sep 17 00:00:00 2001 From: Filip Stamenkovic Date: Wed, 20 Oct 2021 13:22:02 +0200 Subject: [PATCH 206/250] Prebid Core: native puc multiple events fix (#7543) * fire bidWon and impression tracker only once * add special test case for 'fireNativeTrackers' --- src/secureCreatives.js | 13 ++--- test/spec/unit/secureCreatives_spec.js | 79 ++++++++++++++++++-------- 2 files changed, 60 insertions(+), 32 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 60e60688c64..c82d1375015 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -60,7 +60,6 @@ export function receiveMessage(ev) { if (data.action === 'assetRequest') { const message = getAssetMessage(data, adObject); ev.source.postMessage(JSON.stringify(message), ev.origin); - return; } else if (data.action === 'allAssetRequest') { const message = getAllAssetsMessage(data, adObject); ev.source.postMessage(JSON.stringify(message), ev.origin); @@ -68,13 +67,13 @@ export function receiveMessage(ev) { adObject.height = data.height; adObject.width = data.width; resizeRemoteCreative(adObject); - } - - const trackerType = fireNativeTrackers(data, adObject); - if (trackerType === 'click') { return; } + } else { + const trackerType = fireNativeTrackers(data, adObject); + if (trackerType === 'click') { return; } - auctionManager.addWinningBid(adObject); - events.emit(BID_WON, adObject); + auctionManager.addWinningBid(adObject); + events.emit(BID_WON, adObject); + } } } } diff --git a/test/spec/unit/secureCreatives_spec.js b/test/spec/unit/secureCreatives_spec.js index eca00e8c8fa..cee416bd1be 100644 --- a/test/spec/unit/secureCreatives_spec.js +++ b/test/spec/unit/secureCreatives_spec.js @@ -116,7 +116,7 @@ describe('secureCreatives', () => { beforeEach(function() { spyAddWinningBid = sinon.spy(auctionManager, 'addWinningBid'); spyLogWarn = sinon.spy(utils, 'logWarn'); - stubFireNativeTrackers = sinon.stub(native, 'fireNativeTrackers'); + stubFireNativeTrackers = sinon.stub(native, 'fireNativeTrackers').callsFake(message => { return message.action; }); stubGetAllAssetsMessage = sinon.stub(native, 'getAllAssetsMessage'); stubEmit = sinon.stub(events, 'emit'); }); @@ -263,10 +263,9 @@ describe('secureCreatives', () => { sinon.assert.calledOnce(stubGetAllAssetsMessage); sinon.assert.calledWith(stubGetAllAssetsMessage, data, adResponse); sinon.assert.calledOnce(ev.source.postMessage); - sinon.assert.calledOnce(stubFireNativeTrackers); - sinon.assert.calledWith(stubFireNativeTrackers, data, adResponse); - sinon.assert.calledOnce(spyAddWinningBid); - sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.notCalled(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.STALE_RENDER); }); @@ -293,14 +292,11 @@ describe('secureCreatives', () => { sinon.assert.calledOnce(stubGetAllAssetsMessage); sinon.assert.calledWith(stubGetAllAssetsMessage, data, adResponse); sinon.assert.calledOnce(ev.source.postMessage); - sinon.assert.calledOnce(stubFireNativeTrackers); - sinon.assert.calledWith(stubFireNativeTrackers, data, adResponse); - sinon.assert.calledOnce(spyAddWinningBid); - sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.notCalled(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.STALE_RENDER); - expect(adResponse).to.have.property('status', CONSTANTS.BID_STATUS.RENDERED); - resetHistories(ev.source.postMessage); receiveMessage(ev); @@ -309,10 +305,9 @@ describe('secureCreatives', () => { sinon.assert.calledOnce(stubGetAllAssetsMessage); sinon.assert.calledWith(stubGetAllAssetsMessage, data, adResponse); sinon.assert.calledOnce(ev.source.postMessage); - sinon.assert.calledOnce(stubFireNativeTrackers); - sinon.assert.calledWith(stubFireNativeTrackers, data, adResponse); - sinon.assert.calledOnce(spyAddWinningBid); - sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.notCalled(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.STALE_RENDER); }); @@ -341,14 +336,11 @@ describe('secureCreatives', () => { sinon.assert.calledOnce(stubGetAllAssetsMessage); sinon.assert.calledWith(stubGetAllAssetsMessage, data, adResponse); sinon.assert.calledOnce(ev.source.postMessage); - sinon.assert.calledOnce(stubFireNativeTrackers); - sinon.assert.calledWith(stubFireNativeTrackers, data, adResponse); - sinon.assert.calledOnce(spyAddWinningBid); - sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.notCalled(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.STALE_RENDER); - expect(adResponse).to.have.property('status', CONSTANTS.BID_STATUS.RENDERED); - resetHistories(ev.source.postMessage); receiveMessage(ev); @@ -357,14 +349,51 @@ describe('secureCreatives', () => { sinon.assert.calledOnce(stubGetAllAssetsMessage); sinon.assert.calledWith(stubGetAllAssetsMessage, data, adResponse); sinon.assert.calledOnce(ev.source.postMessage); - sinon.assert.calledOnce(stubFireNativeTrackers); - sinon.assert.calledWith(stubFireNativeTrackers, data, adResponse); - sinon.assert.calledOnce(spyAddWinningBid); - sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.notCalled(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.STALE_RENDER); configObj.setConfig({'auctionOptions': {}}); }); + + it('Prebid native should fire trackers', function () { + pushBidResponseToAuction({}); + + const data = { + adId: bidId, + message: 'Prebid Native', + action: 'click', + }; + + const ev = { + data: JSON.stringify(data), + source: { + postMessage: sinon.stub() + }, + origin: 'any origin' + }; + + receiveMessage(ev); + + sinon.assert.neverCalledWith(spyLogWarn, warning); + sinon.assert.calledOnce(stubFireNativeTrackers); + sinon.assert.neverCalledWith(stubEmit, CONSTANTS.EVENTS.BID_WON); + sinon.assert.notCalled(spyAddWinningBid); + + resetHistories(ev.source.postMessage); + + delete data.action; + ev.data = JSON.stringify(data); + receiveMessage(ev); + + sinon.assert.neverCalledWith(spyLogWarn, warning); + sinon.assert.calledOnce(stubFireNativeTrackers); + sinon.assert.calledWith(stubEmit, CONSTANTS.EVENTS.BID_WON, adResponse); + sinon.assert.calledOnce(spyAddWinningBid); + + expect(adResponse).to.have.property('status', CONSTANTS.BID_STATUS.RENDERED); + }); }); }); }); From f874aa4a7dd3f4b661243faa6543584d0c6ac352 Mon Sep 17 00:00:00 2001 From: bjorn-lw <32431346+bjorn-lw@users.noreply.github.com> Date: Wed, 20 Oct 2021 16:23:27 +0200 Subject: [PATCH 207/250] Collect AD_RENDER_FAILED events (#7591) --- modules/livewrappedAnalyticsAdapter.js | 45 ++++++++++++++++++- .../livewrappedAnalyticsAdapter_spec.js | 32 +++++++++++-- 2 files changed, 73 insertions(+), 4 deletions(-) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 09f89058ffe..64806b793c2 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -11,6 +11,7 @@ const REQUESTSENT = 1; const RESPONSESENT = 2; const WINSENT = 4; const TIMEOUTSENT = 8; +const ADRENDERFAILEDSENT = 16; let initOptions; export const BID_WON_TIMEOUT = 500; @@ -114,6 +115,16 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE livewrappedAnalyticsAdapter.sendEvents(); } break; + case CONSTANTS.EVENTS.AD_RENDER_FAILED: + logInfo('LIVEWRAPPED_AD_RENDER_FAILED:', args); + let adRenderFailedBid = cache.auctions[args.bid.auctionId].bids[args.bid.requestId]; + adRenderFailedBid.adRenderFailed = true; + adRenderFailedBid.reason = args.reason; + adRenderFailedBid.message = args.message; + if (adRenderFailedBid.sendStatus != 0) { + livewrappedAnalyticsAdapter.sendEvents(); + } + break; case CONSTANTS.EVENTS.BID_TIMEOUT: logInfo('LIVEWRAPPED_BID_TIMEOUT:', args); args.forEach(timeout => { @@ -151,13 +162,15 @@ livewrappedAnalyticsAdapter.sendEvents = function() { wins: getWins(sentRequests.gdpr, sentRequests.auctionIds), timeouts: getTimeouts(sentRequests.auctionIds), bidAdUnits: getbidAdUnits(), + rf: getAdRenderFailed(sentRequests.auctionIds), rcv: getAdblockerRecovered() }; if (events.requests.length == 0 && events.responses.length == 0 && events.wins.length == 0 && - events.timeouts.length == 0) { + events.timeouts.length == 0 && + events.rf.length == 0) { return; } @@ -338,6 +351,36 @@ function getTimeouts(auctionIds) { return timeouts; } +function getAdRenderFailed(auctionIds) { + var adRenderFails = []; + + Object.keys(cache.auctions).forEach(auctionId => { + let auctionIdPos = getAuctionIdPos(auctionIds, auctionId); + Object.keys(cache.auctions[auctionId].bids).forEach(bidId => { + let auction = cache.auctions[auctionId]; + let bid = auction.bids[bidId]; + if (!(bid.sendStatus & ADRENDERFAILEDSENT) && bid.adRenderFailed) { + bid.sendStatus |= ADRENDERFAILEDSENT; + + adRenderFails.push({ + bidder: bid.bidder, + adUnit: bid.adUnit, + adUnitId: bid.adUnitId, + timeStamp: auction.timeStamp, + auctionId: auctionIdPos, + auc: bid.auc, + buc: bid.buc, + lw: bid.lw, + rsn: bid.reason, + msg: bid.message + }); + } + }); + }); + + return adRenderFails; +} + function getbidAdUnits() { var bidAdUnits = []; diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index 4b16da0c7fe..fc0d4a55e54 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -16,7 +16,8 @@ const { BIDDER_DONE, BID_WON, BID_TIMEOUT, - SET_TARGETING + SET_TARGETING, + AD_RENDER_FAILED }, STATUS: { GOOD @@ -115,6 +116,14 @@ const MOCK = { 'bidId': '2ecff0db240757', 'auctionId': '25c6d7f5-699a-4bfc-87c9-996f915341fa' } + ], + AD_RENDER_FAILED: [ + { + 'bidId': '2ecff0db240757', + 'reason': CONSTANTS.AD_RENDER_FAILED_REASON.CANNOT_FIND_AD, + 'message': 'message', + 'bid': BID1 + } ] }; @@ -226,6 +235,17 @@ const ANALYTICS_MESSAGE = { gdpr: 0, auctionId: 0 } + ], + rf: [ + { + timeStamp: 1519149562216, + adUnit: 'panorama_d_1', + adUnitId: 'adunitid', + bidder: 'livewrapped', + auctionId: 0, + rsn: CONSTANTS.AD_RENDER_FAILED_REASON.CANNOT_FIND_AD, + msg: 'message' + }, ] }; @@ -239,6 +259,7 @@ function performStandardAuction() { events.emit(SET_TARGETING, MOCK.SET_TARGETING); events.emit(BID_WON, MOCK.BID_WON[0]); events.emit(BID_WON, MOCK.BID_WON[1]); + events.emit(AD_RENDER_FAILED, MOCK.AD_RENDER_FAILED[0]); } describe('Livewrapped analytics adapter', function () { @@ -300,7 +321,7 @@ describe('Livewrapped analytics adapter', function () { expect(message).to.deep.equal(ANALYTICS_MESSAGE); }); - it('should send batched message without BID_WON if necessary and further BID_WON events individually', function () { + it('should send batched message without BID_WON AND AD_RENDER_FAILED if necessary and further BID_WON and AD_RENDER_FAILED events individually', function () { events.emit(AUCTION_INIT, MOCK.AUCTION_INIT); events.emit(BID_REQUESTED, MOCK.BID_REQUESTED); events.emit(BID_RESPONSE, MOCK.BID_RESPONSE[0]); @@ -313,8 +334,9 @@ describe('Livewrapped analytics adapter', function () { clock.tick(BID_WON_TIMEOUT + 1000); events.emit(BID_WON, MOCK.BID_WON[1]); + events.emit(AD_RENDER_FAILED, MOCK.AD_RENDER_FAILED[0]); - expect(server.requests.length).to.equal(2); + expect(server.requests.length).to.equal(3); let message = JSON.parse(server.requests[0].requestBody); expect(message.wins.length).to.equal(1); @@ -324,6 +346,10 @@ describe('Livewrapped analytics adapter', function () { message = JSON.parse(server.requests[1].requestBody); expect(message.wins.length).to.equal(1); expect(message.wins[0]).to.deep.equal(ANALYTICS_MESSAGE.wins[1]); + + message = JSON.parse(server.requests[2].requestBody); + expect(message.rf.length).to.equal(1); + expect(message.rf[0]).to.deep.equal(ANALYTICS_MESSAGE.rf[0]); }); it('should properly mark bids as timed out', function () { From 1693ed0fdfc4efb58d3b338c1e431026239ab8e2 Mon Sep 17 00:00:00 2001 From: Mikhail Ivanchenko Date: Wed, 20 Oct 2021 18:12:20 +0300 Subject: [PATCH 208/250] NextMillennium Bid Adapter: add gdpr support (#7593) * Add gdpr to NextMillennium adapter * Added us_privacy and unit-tests * restore package-lock.json Co-authored-by: Mihail Ivanchenko --- modules/nextMillenniumBidAdapter.js | 15 ++++++++++++--- .../spec/modules/nextMillenniumBidAdapter_spec.js | 14 +++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/modules/nextMillenniumBidAdapter.js b/modules/nextMillenniumBidAdapter.js index d275fbf1160..afc409c19f6 100644 --- a/modules/nextMillenniumBidAdapter.js +++ b/modules/nextMillenniumBidAdapter.js @@ -30,14 +30,23 @@ export const spec = { } } } + const gdprConsent = bidderRequest && bidderRequest.gdprConsent; + const uspConsent = bidderRequest && bidderRequest.uspConsent + + if (gdprConsent || uspConsent) { + postBody.regs = { ext: {} } - if (gdprConsent) { + if (uspConsent) { + postBody.regs.ext.us_privacy = uspConsent; + } if (typeof gdprConsent.gdprApplies !== 'undefined') { - postBody.gdprApplies = !!gdprConsent.gdprApplies; + postBody.regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0; } if (typeof gdprConsent.consentString !== 'undefined') { - postBody.consentString = gdprConsent.consentString; + postBody.user = { + ext: { consent: gdprConsent.consentString } + } } } diff --git a/test/spec/modules/nextMillenniumBidAdapter_spec.js b/test/spec/modules/nextMillenniumBidAdapter_spec.js index 15256d6c382..1a24c6d0575 100644 --- a/test/spec/modules/nextMillenniumBidAdapter_spec.js +++ b/test/spec/modules/nextMillenniumBidAdapter_spec.js @@ -8,10 +8,22 @@ describe('nextMillenniumBidAdapterTests', function() { auctionId: 'b06c5141-fe8f-4cdf-9d7d-54415490a917', bidder: 'nextMillennium', params: { placement_id: '-1' }, - sizes: [[300, 250]] + sizes: [[300, 250]], + uspConsent: '1---', + gdprConsent: { + consentString: 'kjfdniwjnifwenrif3', + gdprApplies: true + } } ]; + it('Request params check with GDPR Consent', function () { + const request = spec.buildRequests(bidRequestData, bidRequestData[0]); + expect(JSON.parse(request[0].data).user.ext.consent).to.equal('kjfdniwjnifwenrif3'); + expect(JSON.parse(request[0].data).regs.ext.us_privacy).to.equal('1---'); + expect(JSON.parse(request[0].data).regs.ext.gdpr).to.equal(1); + }); + it('validate_generated_params', function() { const request = spec.buildRequests(bidRequestData); expect(request[0].bidId).to.equal('bid1234'); From 26599cf98c594892f09ed11a19784305f23a5f32 Mon Sep 17 00:00:00 2001 From: Sourabh Gandhe Date: Wed, 20 Oct 2021 20:45:37 +0530 Subject: [PATCH 209/250] DeepIntent Bid Adapter: instream video support added (#7494) * instream video support added * additional tests and docs added * tests changed * addressed comments * add video type support * tagId is mandatory * test suite fixes Co-authored-by: Sourabh Gandhe Co-authored-by: Parth Shah --- modules/deepintentBidAdapter.js | 115 ++++++++++++- modules/deepintentBidAdapter.md | 37 ++++- .../spec/modules/deepintentBidAdapter_spec.js | 156 +++++++++++++++++- 3 files changed, 295 insertions(+), 13 deletions(-) diff --git a/modules/deepintentBidAdapter.js b/modules/deepintentBidAdapter.js index f2314454ab9..d0c8eb29993 100644 --- a/modules/deepintentBidAdapter.js +++ b/modules/deepintentBidAdapter.js @@ -1,13 +1,38 @@ -import { generateUUID, deepSetValue, deepAccess, isArray } from '../src/utils.js'; +import { generateUUID, deepSetValue, deepAccess, isArray, isInteger, logError, logWarn } from '../src/utils.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; -import {BANNER} from '../src/mediaTypes.js'; +import {BANNER, VIDEO} from '../src/mediaTypes.js'; const BIDDER_CODE = 'deepintent'; const BIDDER_ENDPOINT = 'https://prebid.deepintent.com/prebid'; const USER_SYNC_URL = 'https://cdn.deepintent.com/syncpixel.html'; const DI_M_V = '1.0.0'; +export const ORTB_VIDEO_PARAMS = { + 'mimes': (value) => Array.isArray(value) && value.length > 0 && value.every(v => typeof v === 'string'), + 'minduration': (value) => isInteger(value), + 'maxduration': (value) => isInteger(value), + 'protocols': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 10), + 'w': (value) => isInteger(value), + 'h': (value) => isInteger(value), + 'startdelay': (value) => isInteger(value), + 'placement': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 5), + 'linearity': (value) => [1, 2].indexOf(value) !== -1, + 'skip': (value) => [0, 1].indexOf(value) !== -1, + 'skipmin': (value) => isInteger(value), + 'skipafter': (value) => isInteger(value), + 'sequence': (value) => isInteger(value), + 'battr': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 17), + 'maxextended': (value) => isInteger(value), + 'minbitrate': (value) => isInteger(value), + 'maxbitrate': (value) => isInteger(value), + 'boxingallowed': (value) => [0, 1].indexOf(value) !== -1, + 'playbackmethod': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 6), + 'playbackend': (value) => [1, 2, 3].indexOf(value) !== -1, + 'delivery': (value) => [1, 2, 3].indexOf(value) !== -1, + 'pos': (value) => [0, 1, 2, 3, 4, 5, 6, 7].indexOf(value) !== -1, + 'api': (value) => Array.isArray(value) && value.every(v => v >= 1 && v <= 6) +}; export const spec = { code: BIDDER_CODE, - supportedMediaTypes: [BANNER], + supportedMediaTypes: [BANNER, VIDEO], aliases: [], // tagId is mandatory param @@ -15,16 +40,38 @@ export const spec = { let valid = false; if (bid && bid.params && bid.params.tagId) { if (typeof bid.params.tagId === 'string' || bid.params.tagId instanceof String) { - valid = true; + if (bid.hasOwnProperty('mediaTypes') && bid.mediaTypes.hasOwnProperty(VIDEO)) { + if (bid.mediaTypes[VIDEO].hasOwnProperty('context')) { + valid = true; + } + } else { + valid = true; + } } } return valid; }, - interpretResponse: function(bidResponse, request) { + interpretResponse: function(bidResponse, bidRequest) { let responses = []; if (bidResponse && bidResponse.body) { - let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; - responses = bids.map(bid => formatResponse(bid)) + try { + let bids = bidResponse.body.seatbid && bidResponse.body.seatbid[0] ? bidResponse.body.seatbid[0].bid : []; + if (bids) { + bids.forEach(bidObj => { + let newBid = formatResponse(bidObj); + let mediaType = _checkMediaType(bidObj); + if (mediaType === BANNER) { + newBid.mediaType = BANNER; + } else if (mediaType === VIDEO) { + newBid.mediaType = VIDEO; + newBid.vastXml = bidObj.adm; + } + responses.push(newBid); + }); + } + } catch (err) { + logError(err); + } } return responses; }, @@ -73,6 +120,17 @@ export const spec = { } }; +function _checkMediaType(bid) { + let videoRegex = new RegExp(/VAST\s+version/); + let mediaType; + if (bid.adm && bid.adm.indexOf('deepintent_wrapper') >= 0) { + mediaType = BANNER; + } else if (videoRegex.test(bid.adm)) { + mediaType = VIDEO; + } + return mediaType; +} + function clean(obj) { for (let propName in obj) { if (obj[propName] === null || obj[propName] === undefined) { @@ -100,16 +158,55 @@ function formatResponse(bid) { } function buildImpression(bid) { - return { + let impression = {}; + impression = { id: bid.bidId, tagid: bid.params.tagId || '', secure: window.location.protocol === 'https' ? 1 : 0, - banner: buildBanner(bid), displaymanager: 'di_prebid', displaymanagerver: DI_M_V, ext: buildCustomParams(bid) }; + if (deepAccess(bid, 'mediaTypes.banner')) { + impression['banner'] = buildBanner(bid); + } + if (deepAccess(bid, 'mediaTypes.video')) { + impression['video'] = _buildVideo(bid); + } + return impression; } + +function _buildVideo(bid) { + const videoObj = {}; + const videoAdUnitParams = deepAccess(bid, 'mediaTypes.video', {}); + const videoBidderParams = deepAccess(bid, 'params.video', {}); + const computedParams = {}; + + if (Array.isArray(videoAdUnitParams.playerSize)) { + const tempSize = (Array.isArray(videoAdUnitParams.playerSize[0])) ? videoAdUnitParams.playerSize[0] : videoAdUnitParams.playerSize; + computedParams.w = tempSize[0]; + computedParams.h = tempSize[1]; + } + + const videoParams = { + ...computedParams, + ...videoAdUnitParams, + ...videoBidderParams + }; + + Object.keys(ORTB_VIDEO_PARAMS).forEach(paramName => { + if (videoParams.hasOwnProperty(paramName)) { + if (ORTB_VIDEO_PARAMS[paramName](videoParams[paramName])) { + videoObj[paramName] = videoParams[paramName]; + } else { + logWarn(`The OpenRTB video param ${paramName} has been skipped due to misformating. Please refer to OpenRTB 2.5 spec.`); + } + } + }); + + return videoObj; +}; + function buildCustomParams(bid) { if (bid.params && bid.params.custom) { return { diff --git a/modules/deepintentBidAdapter.md b/modules/deepintentBidAdapter.md index 79a6a1679e2..84c375d69a4 100644 --- a/modules/deepintentBidAdapter.md +++ b/modules/deepintentBidAdapter.md @@ -8,7 +8,7 @@ Maintainer: prebid@deepintent.com # Description -Deepintent currently supports the BANNER type ads through prebid js +Deepintent currently supports the BANNER and VIDEO type ads through prebid js Module that connects to Deepintent's demand sources. @@ -40,6 +40,41 @@ Module that connects to Deepintent's demand sources. ]; ``` +# Sample Video Ad Unit +``` +var adVideoAdUnits = [ +{ + code: 'test-div-video', + mediaTypes: { + video: { + playerSize: [640, 480], // required + context: 'instream' //required + } + }, + bids: [{ + bidder: 'deepintent', + params: { + tagId: '1300', // Required parameter // required + video: { + mimes: ['video/mp4','video/x-flv'], // required + skippable: true, // optional + minduration: 5, // optional + maxduration: 30, // optional + startdelay: 5, // optional + playbackmethod: [1,3], // optional + api: [ 1, 2 ], // optional + protocols: [ 2, 3 ], // optional + battr: [ 13, 14 ], // optional + linearity: 1, // optional + placement: 2, // optional + minbitrate: 10, // optional + maxbitrate: 10 // optional + } + } + }] +}] +``` + ###Recommended User Sync Configuration ```javascript diff --git a/test/spec/modules/deepintentBidAdapter_spec.js b/test/spec/modules/deepintentBidAdapter_spec.js index fcf7056fb3f..d2a351b4089 100644 --- a/test/spec/modules/deepintentBidAdapter_spec.js +++ b/test/spec/modules/deepintentBidAdapter_spec.js @@ -3,8 +3,8 @@ import {spec} from 'modules/deepintentBidAdapter.js'; import * as utils from '../../../src/utils.js'; describe('Deepintent adapter', function () { - let request; - let bannerResponse; + let request, videoBidRequests; + let bannerResponse, videoBidResponse, invalidResponse; beforeEach(function () { request = [ @@ -32,6 +32,38 @@ describe('Deepintent adapter', function () { } } ]; + videoBidRequests = + [ + { + code: 'video1', + mediaTypes: { + video: { + playerSize: [640, 480], + context: 'instream' + } + }, + bidder: 'deepintent', + bidId: '22bddb28db77d', + params: { + tagId: '100013', + video: { + mimes: ['video/mp4', 'video/x-flv'], + skippable: true, + testwrongparam: 3, + testwrongparam1: 'wrong', + minduration: 5, + maxduration: 30, + startdelay: 5, + playbackmethod: [1, 3], + api: [1, 2], + protocols: [2, 3], + battr: [13, 14], + minbitrate: 10, + maxbitrate: 10 + } + } + } + ]; bannerResponse = { 'body': { 'id': '303e1fae-9677-41e2-9a92-15a23445363f', @@ -53,7 +85,47 @@ describe('Deepintent adapter', function () { }], 'bidid': '0b08b09f-aaa1-4c14-b1c8-7debb1a7c1cd' } - } + }; + invalidResponse = { + 'body': { + 'id': '303e1fae-9677-41e2-9a92-15a23445363f', + 'seatbid': [{ + 'bid': [{ + 'id': '11447bb1-a266-470d-b0d7-8810f5b1b75f', + 'impid': 'a7e92b9b-d9db-4de8-9c3f-f90737335445', + 'price': 0.6, + 'adid': '10001', + 'adm': 'invalid response', + 'adomain': ['deepintent.com'], + 'cid': '103389', + 'crid': '13665', + 'w': 300, + 'h': 250, + 'dealId': 'dee_12312stdszzsx' + }], + 'seat': '10000' + }], + 'bidid': '0b08b09f-aaa1-4c14-b1c8-7debb1a7c1cd' + } + }; + videoBidResponse = { + 'body': { + 'id': '93D3BAD6-E2E2-49FB-9D89-920B1761C865', + 'seatbid': [{ + 'bid': [{ + 'id': '74858439-49D7-4169-BA5D-44A046315B2F', + 'impid': '22bddb28db77d', + 'price': 1.3, + 'adm': 'Acudeo CompatibleVAST 2.0 Instream Test 1VAST 2.0 Instream Test 1https://dsptracker.com/{PSPM}00:00:04https://www.deepintent.com', + 'h': 250, + 'w': 300, + 'ext': { + 'deal_channel': 6 + } + }] + }] + } + }; }); describe('validations', function () { @@ -88,6 +160,45 @@ describe('Deepintent adapter', function () { isValid = spec.isBidRequestValid(bid); expect(isValid).to.equals(false); }); + it('should check for context if video is present', function() { + let bid = { + bidder: 'deepintent', + params: { + tagId: '12345', + video: { + mimes: ['video/mp4', 'video/x-flv'], + skippable: true, + } + }, + mediaTypes: { + video: { + playerSize: [640, 480], + context: 'instream' + } + }, + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equal(true); + }); + it('should error out if context is not present and is Video', function() { + let bid = { + bidder: 'deepintent', + params: { + tagId: '12345', + video: { + mimes: ['video/mp4', 'video/x-flv'], + skippable: true, + } + }, + mediaTypes: { + video: { + playerSize: [640, 480] + } + }, + }, + isValid = spec.isBidRequestValid(bid); + expect(isValid).to.equal(false); + }) }); describe('request check', function () { it('unmutaable bid request check', function () { @@ -179,6 +290,28 @@ describe('Deepintent adapter', function () { expect(data2.regs).to.equal(undefined); expect(data2.user.ext).to.equal(undefined); }); + it('bid request check: Video params check ', function() { + let bRequest = spec.buildRequests(videoBidRequests); + let data = JSON.parse(bRequest.data); + expect(data.imp[0].video).to.be.a('object'); + expect(data.imp[0].video.minduration).to.be.a('number'); + expect(data.imp[0].video.maxduration).to.be.a('number'); + expect(data.imp[0].video.startdelay).to.be.a('number'); + expect(data.imp[0].video.playbackmethod).to.be.an('array'); + expect(data.imp[0].video.api).to.be.an('array'); + expect(data.imp[0].video.protocols).to.be.an('array'); + expect(data.imp[0].video.battr).to.be.an('array'); + expect(data.imp[0].video.minbitrate).to.be.a('number'); + expect(data.imp[0].video.maxbitrate).to.be.a('number'); + expect(data.imp[0].video.w).to.be.a('number'); + }); + it('bid request param check : invalid video params', function() { + let bRequest = spec.buildRequests(videoBidRequests); + let data = JSON.parse(bRequest.data); + expect(data.imp[0].video).to.be.a('object'); + expect(data.imp[0].video.testwrongparam).to.equal(undefined); + expect(data.imp[0].video.testwrongparam1).to.equal(undefined); + }); }); describe('user sync check', function () { it('user sync url check', function () { @@ -202,10 +335,27 @@ describe('Deepintent adapter', function () { expect(bResponse[0].height).to.equal(bannerResponse.body.seatbid[0].bid[0].h); expect(bResponse[0].currency).to.equal('USD'); expect(bResponse[0].netRevenue).to.equal(false); + expect(bResponse[0].mediaType).to.equal('banner'); expect(bResponse[0].meta.advertiserDomains).to.deep.equal(['deepintent.com']); expect(bResponse[0].ttl).to.equal(300); expect(bResponse[0].creativeId).to.equal(bannerResponse.body.seatbid[0].bid[0].crid); expect(bResponse[0].dealId).to.equal(bannerResponse.body.seatbid[0].bid[0].dealId); }); + it('bid response check: valid video bid response', function() { + let request = spec.buildRequests(videoBidRequests); + let response = spec.interpretResponse(videoBidResponse, request); + expect(response[0].mediaType).to.equal('video'); + expect(response[0].vastXml).to.not.equal(undefined); + }); + it('invalid bid response check ', function() { + let bRequest = spec.buildRequests(request); + let response = spec.interpretResponse(invalidResponse, bRequest); + expect(response[0].mediaType).to.equal(undefined); + }); + it('invalid bid response check ', function() { + let bRequest = spec.buildRequests(videoBidRequests); + let response = spec.interpretResponse(invalidResponse, bRequest); + expect(response[0].mediaType).to.equal(undefined); + }); }) }); From fdfe85e49ad93d3b1bf1efb8ebe31f43ebc5b44d Mon Sep 17 00:00:00 2001 From: Lisa Benmore Date: Wed, 20 Oct 2021 08:55:42 -0700 Subject: [PATCH 210/250] Gumgum Bid Adapter: add local time and timezone offset in requests (#7587) * Gumgum: ADTS-164 Send local time and timezone offset in ad requests * object existence check before accessing property --- modules/gumgumBidAdapter.js | 8 ++++++++ test/spec/modules/gumgumBidAdapter_spec.js | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 76fb7023bb1..8012afa2f30 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -294,6 +294,14 @@ function buildRequests(validBidRequests, bidderRequest) { let data = {}; let gpid = ''; + const date = new Date(); + const lt = date && date.getTime(); + const to = date && date.getTimezoneOffset(); + if (to) { + lt && (data.lt = lt); + data.to = to; + } + // ADTS-134 Retrieve ID envelopes for (const eid in eids) data[eid] = eids[eid]; diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index 713bd514c0c..dfd7db7d922 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -531,9 +531,13 @@ describe('gumgumAdapter', function () { const jcsi = JSON.stringify(JCSI); const bidRequest = spec.buildRequests(bidRequests)[0]; const actualKeys = Object.keys(JSON.parse(bidRequest.data.jcsi)).sort(); - expect(actualKeys).to.eq(actualKeys); + expect(actualKeys).to.eql(expectedKeys); expect(bidRequest.data.jcsi).to.eq(jcsi); }); + it('should include the local time and timezone offset', function () { + const bidRequest = spec.buildRequests(bidRequests)[0]; + expect(!!bidRequest.data.lt).to.be.true; + }); }) describe('interpretResponse', function () { From 4ecaeb0915b9bfe25a08db5d1d95926132013db4 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Wed, 20 Oct 2021 13:42:12 -0400 Subject: [PATCH 211/250] Prebid 5.19.0 Release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5694c7974b..e87f7a7109b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.19.0-pre", + "version": "5.19.0", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 8ebafdce77980a63524322d7f6f1f99bcaa56030 Mon Sep 17 00:00:00 2001 From: Eric Harper Date: Wed, 20 Oct 2021 14:12:42 -0400 Subject: [PATCH 212/250] Increment pre version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e87f7a7109b..1795cbe2fe6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prebid.js", - "version": "5.19.0", + "version": "5.20.0-pre", "description": "Header Bidding Management Library", "main": "src/prebid.js", "scripts": { From 191a3cb148eb27419e458dfbd62280522019bb15 Mon Sep 17 00:00:00 2001 From: jessoventes <82361050+jessoventes@users.noreply.github.com> Date: Thu, 21 Oct 2021 00:33:50 +0530 Subject: [PATCH 213/250] Ventes Bid Adapter: add new bid adapter (#7525) * Ventes Avenues initial changes * Ventes Avenues initial changes * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues * Ventes Avenues Solved issues for user agent * Added few more info * Ventes Avenues Solved issues for user agent --- modules/ventesBidAdapter.js | 370 +++++++++ modules/ventesBidAdapter.md | 94 +++ test/spec/modules/ventesBidAdapter_spec.js | 845 +++++++++++++++++++++ 3 files changed, 1309 insertions(+) create mode 100644 modules/ventesBidAdapter.js create mode 100644 modules/ventesBidAdapter.md create mode 100644 test/spec/modules/ventesBidAdapter_spec.js diff --git a/modules/ventesBidAdapter.js b/modules/ventesBidAdapter.js new file mode 100644 index 00000000000..7a2b60d2ee2 --- /dev/null +++ b/modules/ventesBidAdapter.js @@ -0,0 +1,370 @@ +import {registerBidder} from '../src/adapters/bidderFactory.js'; +import {BANNER, NATIVE, VIDEO} from '../src/mediaTypes.js'; +import {convertCamelToUnderscore, isStr, isArray, isNumber, isPlainObject, replaceAuctionPrice} from '../src/utils.js'; +import find from 'core-js-pure/features/array/find.js'; +import includes from 'core-js-pure/features/array/includes.js'; + +const BID_METHOD = 'POST'; +const BIDDER_URL = 'http://13.234.201.146:8088/va/ad'; +const FIRST_PRICE = 1; +const NET_REVENUE = true; +const TTL = 10; +const USER_PARAMS = ['age', 'externalUid', 'segments', 'gender', 'dnt', 'language']; +const DEVICE_PARAMS = ['ua', 'geo', 'dnt', 'lmt', 'ip', 'ipv6', 'devicetype']; +const APP_DEVICE_PARAMS = ['geo', 'device_id']; // appid is collected separately +const DOMAIN_REGEX = new RegExp('//([^/]*)'); + +function groupBy(values, key) { + const groups = values.reduce((acc, value) => { + const groupId = value[key]; + + if (!acc[groupId]) acc[groupId] = []; + acc[groupId].push(value); + + return acc; + }, {}); + + return Object + .keys(groups) + .map(id => ({id, key, values: groups[id]})); +} + +function validateMediaTypes(mediaTypes, allowedMediaTypes) { + if (!isPlainObject(mediaTypes)) return false; + if (!allowedMediaTypes.some(mediaType => mediaType in mediaTypes)) return false; + + if (isBanner(mediaTypes)) { + if (!validateBanner(mediaTypes.banner)) return false; + } + return true; +} + +function isBanner(mediaTypes) { + return isPlainObject(mediaTypes) && isPlainObject(mediaTypes.banner); +} + +function validateBanner(banner) { + return isPlainObject(banner) && + isArray(banner.sizes) && + (banner.sizes.length > 0) && + banner.sizes.every(validateMediaSizes); +} + +function validateMediaSizes(mediaSize) { + return isArray(mediaSize) && + (mediaSize.length === 2) && + mediaSize.every(size => (isNumber(size) && size >= 0)); +} + +function hasUserInfo(bid) { + return !!bid.params.user; +} + +function validateParameters(parameters, adUnit) { + if (!(parameters.placementId)) { + return false; + } + if (!(parameters.publisherId)) { + return false; + } + + return true; +} + +function extractSiteDomainFromURL(url) { + if (!url || !isStr(url)) return null; + + const domain = url.match(DOMAIN_REGEX); + + if (isArray(domain) && domain.length === 2) return domain[1]; + + return null; +} + +function generateSiteFromAdUnitContext(bidRequests, adUnitContext) { + if (!adUnitContext || !adUnitContext.refererInfo) return null; + + const domain = extractSiteDomainFromURL(adUnitContext.refererInfo.referer); + const publisherId = bidRequests[0].params.publisherId; + + if (!domain) return null; + + return { + page: adUnitContext.refererInfo.referer, + domain: domain, + name: domain, + publisher: { + id: publisherId + } + }; +} + +function validateServerRequest(serverRequest) { + return isPlainObject(serverRequest) && + isPlainObject(serverRequest.data) && + isArray(serverRequest.data.imp) +} + +function createServerRequestFromAdUnits(adUnits, bidRequestId, adUnitContext) { + return { + method: BID_METHOD, + url: BIDDER_URL, + data: generateBidRequestsFromAdUnits(adUnits, bidRequestId, adUnitContext), + options: { + contentType: 'application/json', + withCredentials: false, + } + } +} + +function generateBidRequestsFromAdUnits(bidRequests, bidRequestId, adUnitContext) { + const userObjBid = find(bidRequests, hasUserInfo); + let userObj = {}; + if (userObjBid) { + Object.keys(userObjBid.params.user) + .filter(param => includes(USER_PARAMS, param)) + .forEach((param) => { + let uparam = convertCamelToUnderscore(param); + if (param === 'segments' && isArray(userObjBid.params.user[param])) { + let segs = []; + userObjBid.params.user[param].forEach(val => { + if (isNumber(val)) { + segs.push({'id': val}); + } else if (isPlainObject(val)) { + segs.push(val); + } + }); + userObj[uparam] = segs; + } else if (param !== 'segments') { + userObj[uparam] = userObjBid.params.user[param]; + } + }); + } + + const deviceObjBid = find(bidRequests, hasDeviceInfo); + let deviceObj; + if (deviceObjBid && deviceObjBid.params && deviceObjBid.params.device) { + deviceObj = {}; + Object.keys(deviceObjBid.params.device) + .filter(param => includes(DEVICE_PARAMS, param)) + .forEach(param => deviceObj[param] = deviceObjBid.params.device[param]); + if (!deviceObjBid.hasOwnProperty('ua')) { + deviceObj.ua = navigator.userAgent; + } + if (!deviceObjBid.hasOwnProperty('language')) { + deviceObj.language = navigator.language; + } + } else { + deviceObj = {}; + deviceObj.ua = navigator.userAgent; + deviceObj.language = navigator.language; + } + const appDeviceObjBid = find(bidRequests, hasAppInfo); + let appIdObj; + if (appDeviceObjBid && appDeviceObjBid.params && appDeviceObjBid.params.app && appDeviceObjBid.params.app.id) { + Object.keys(appDeviceObjBid.params.app) + .filter(param => includes(APP_DEVICE_PARAMS, param)) + .forEach(param => appDeviceObjBid[param] = appDeviceObjBid.params.app[param]); + } + + const payload = {} + payload.id = bidRequestId + payload.at = FIRST_PRICE + payload.cur = ['USD'] + payload.imp = bidRequests.reduce(generateImpressionsFromAdUnit, []) + payload.site = generateSiteFromAdUnitContext(bidRequests, adUnitContext) + payload.device = deviceObj + if (appDeviceObjBid && payload.site != null) { + payload.app = appIdObj; + } + payload.user = userObj + // payload.regs = getRegulationFromAdUnitContext(adUnitContext) + // payload.ext = generateBidRequestExtension() + + return payload +} + +function generateImpressionsFromAdUnit(acc, adUnit) { + const {bidId, mediaTypes, params} = adUnit; + const {placementId} = params; + const pmp = {}; + + if (placementId) pmp.deals = [{id: placementId}] + + const imps = Object + .keys(mediaTypes) + .reduce((acc, mediaType) => { + const data = mediaTypes[mediaType]; + const impId = `${bidId}`; + + if (mediaType === 'banner') return acc.concat(generateBannerFromAdUnit(impId, data, params)); + }, []); + + return acc.concat(imps); +} + +function generateBannerFromAdUnit(impId, data, params) { + const {position, placementId} = params; + const pos = position || 0; + const pmp = {}; + const ext = {placementId}; + + if (placementId) pmp.deals = [{id: placementId}] + + return data.sizes.map(([w, h]) => ({id: `${impId}`, banner: {format: [{w, h}], w, h, pos}, pmp, ext, tagid: placementId})); +} + +function validateServerResponse(serverResponse) { + return isPlainObject(serverResponse) && + isPlainObject(serverResponse.body) && + isStr(serverResponse.body.cur) && + isArray(serverResponse.body.seatbid); +} + +function seatBidsToAds(seatBid, bidResponse, serverRequest) { + return seatBid.bid + .filter(bid => validateBids(bid)) + .map(bid => generateAdFromBid(bid, bidResponse)); +} + +function validateBids(bid) { + if (!isPlainObject(bid)) return false; + if (!isStr(bid.impid)) return false; + if (!isStr(bid.crid)) return false; + if (!isNumber(bid.price)) return false; + if (!isNumber(bid.w)) return false; + if (!isNumber(bid.h)) return false; + if (!bid.adm) return false; + if (bid.adm) { + if (!isStr(bid.adm)) return false; + } + return true; +} + +const VAST_REGEXP = /VAST\s+version/; + +function getMediaType(adm) { + const videoRegex = new RegExp(VAST_REGEXP); + + if (videoRegex.test(adm)) { + return VIDEO; + } + + const markup = safeJSONparse(adm.replace(/\\/g, '')); + + if (markup && isPlainObject(markup.native)) { + return NATIVE; + } + + return BANNER; +} + +function safeJSONparse(...args) { + try { + return JSON.parse(...args); + } catch (_) { + return undefined; + } +} + +function generateAdFromBid(bid, bidResponse) { + const mediaType = getMediaType(bid.adm); + const base = { + requestId: bid.impid, + cpm: bid.price, + currency: bidResponse.cur, + ttl: TTL, + creativeId: bid.crid, + mediaType: mediaType, + netRevenue: NET_REVENUE + }; + + if (bid.adomain) { + base.meta = { advertiserDomains: bid.adomain }; + } + + const size = getSizeFromBid(bid); + const creative = getCreativeFromBid(bid); + + return { + ...base, + height: size.height, + width: size.width, + ad: creative.markup, + adUrl: creative.markupUrl, + // vastXml: isVideo && !isStr(creative.markupUrl) ? creative.markup : null, + // vastUrl: isVideo && isStr(creative.markupUrl) ? creative.markupUrl : null, + renderer: creative.renderer + }; +} + +function getSizeFromBid(bid) { + if (isNumber(bid.w) && isNumber(bid.h)) { + return { width: bid.w, height: bid.h }; + } + return { width: null, height: null }; +} + +function getCreativeFromBid(bid) { + const shouldUseAdMarkup = !!bid.adm; + const price = bid.price; + return { + markup: shouldUseAdMarkup ? replaceAuctionPrice(bid.adm, price) : null, + markupUrl: !shouldUseAdMarkup ? replaceAuctionPrice(bid.nurl, price) : null + }; +} + +function hasDeviceInfo(bid) { + if (bid.params) { + return !!bid.params.device + } +} + +function hasAppInfo(bid) { + if (bid.params) { + return !!bid.params.app + } +} + +const venavenBidderSpec = { + code: 'ventes', + supportedMediaTypes: [BANNER], + isBidRequestValid(adUnit) { + const allowedBidderCodes = [this.code]; + + return isPlainObject(adUnit) && + allowedBidderCodes.indexOf(adUnit.bidder) !== -1 && + isStr(adUnit.adUnitCode) && + isStr(adUnit.bidderRequestId) && + isStr(adUnit.bidId) && + validateMediaTypes(adUnit.mediaTypes, this.supportedMediaTypes) && + validateParameters(adUnit.params, adUnit); + }, + buildRequests(bidRequests, bidderRequest) { + if (!bidRequests) return null; + + return groupBy(bidRequests, 'bidderRequestId').map(group => { + const bidRequestId = group.id; + const adUnits = groupBy(group.values, 'bidId').map((group) => { + const length = group.values.length; + return length > 0 && group.values[length - 1] + }); + + return createServerRequestFromAdUnits(adUnits, bidRequestId, bidderRequest) + }); + }, + interpretResponse(serverResponse, serverRequest) { + if (!validateServerRequest(serverRequest)) return []; + if (!validateServerResponse(serverResponse)) return []; + + const bidResponse = serverResponse.body; + + return bidResponse.seatbid + .filter(seatBid => isPlainObject(seatBid) && isArray(seatBid.bid)) + .reduce((acc, seatBid) => acc.concat(seatBidsToAds(seatBid, bidResponse, serverRequest)), []); + } +}; + +registerBidder(venavenBidderSpec); + +export {venavenBidderSpec as spec}; diff --git a/modules/ventesBidAdapter.md b/modules/ventesBidAdapter.md new file mode 100644 index 00000000000..479f6dd2898 --- /dev/null +++ b/modules/ventesBidAdapter.md @@ -0,0 +1,94 @@ +--- +layout: bidder +title: ventes +description: Prebid ventes Bidder Adapter +pbjs: false +biddercode: ventes +gdpr_supported: false +usp_supported: false +media_types: banner +coppa_supported: false +schain_supported: false +dchain_supported: false +prebid_member: false +--- + +### BidParams +{: .table .table-bordered .table-striped } +| Name | Scope | Description | Example | Type | +|-----------------|----------|-----------------------------------------------------------|----------------------------------------------|---------------| +| `placementId` | required | Placement ID from Ventes Avenues | `'VA-062-0013-0183'` | `string` | +| `publisherId` | required | Publisher ID from Ventes Avenues | `'VA-062'` | `string` | +| `user` | optional | Object that specifies information about an external user. | `user: { age: 25, gender: 0, dnt: true}` | `object` | +| `app` | required | Object containing mobile app parameters. | `app : { id: 'app-id'}` | `object` | +| `device` | required | Object containing device info mandatory for mobile devices| `device : { ifa: 'device-id'}` | `object` | + +#### User Object + +{: .table .table-bordered .table-striped } +| Name | Description | Example | Type | +|-------------------|-------------------------------------------------------------------------------------------|-----------------------|-----------------------| +| `age` | The age of the user. | `35` | `integer` | +| `externalUid` | Specifies a string that corresponds to an external user ID for this user. | `'1234567890abcdefg'` | `string` | +| `segments` | Specifies the segments to which the user belongs. | `[1, 2]` | `Array` | +| `gender` | Specifies the gender of the user. Allowed values: Unknown: `0`; Male: `1`; Female: `2` | `1` | `integer` | +| `dnt` | Do not track flag. Indicates if tracking cookies should be disabled for this auction | `true` | `boolean` | +| `language` | Two-letter ANSI code for this user's language. | `EN` | `string` | + + +### Ad Unit Setup for Banner through mobile devices +```javascript +var adUnits = [ +{ + code: 'test-hb-ad-11111-1', + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + } + }, + bids: [{ + bidder: 'ventes', + params: { + placementId: 'VA-062-0013-0183', + publisherId: '5cebea3c9eea646c7b623d5e', + IABCategories: "['IAB1', 'IAB5']", + device:{ + ip: '123.145.167.189', + ifa:"AEBE52E7-03EE-455A-B3C4-E57283966239", + }, + app: { + id: "agltb3B1Yi1pbmNyDAsSA0FwcBiJkfIUDA", + name: "Yahoo Weather", + bundle: 'com.kiloo.subwaysurf', + storeurl: 'https://play.google.com/store/apps/details?id=com.kiloo.subwaysurf&hl=en', + domain: 'somoaudience.com', + } + } + }] + } +] +``` + +### Ad Unit Setup for Banner through Websites +```javascript +var adUnits = [ +{ + code: 'test-hb-ad-11111-1', + mediaTypes: { + banner: { + sizes: [ + [300, 250] + ] + } + }, + bids: [{ + bidder: 'ventes', + params: { + placementId: 'VA-002-0007-0799', + publisherId: '5cebea3c9eea646c7b623d5e', + } + }] + } +] diff --git a/test/spec/modules/ventesBidAdapter_spec.js b/test/spec/modules/ventesBidAdapter_spec.js new file mode 100644 index 00000000000..219c24deced --- /dev/null +++ b/test/spec/modules/ventesBidAdapter_spec.js @@ -0,0 +1,845 @@ +import { expect } from 'chai'; +import * as utils from 'src/utils.js'; +import { spec } from 'modules/ventesBidAdapter.js'; + +const BIDDER_URL = 'http://13.234.201.146:8088/va/ad'; + +describe('Ventes Adapter', function () { + const examples = { + adUnit_banner: { + adUnitCode: 'ad_unit_banner', + bidder: 'ventes', + bidderRequestId: 'bid_request_id', + bidId: 'bid_id', + params: { + publisherId: 'agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV', + placementId: 'VA-062-0013-0183', + device: { + ip: '123.145.167.189', + ifa: 'AEBE52E7-03EE-455A-B3C4-E57283966239', + } + }, + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + } + }, + + adUnitContext: { + refererInfo: { + referer: 'https://ventesavenues.in', + } + }, + + serverRequest_banner: { + method: 'POST', + url: 'http://13.234.201.146:8088/va/ad', + data: { + id: 'bid_request_id', + imp: [ + { + id: 'imp_id_banner', + banner: { + format: [{ + w: 300, + h: 200 + }] + } + } + ], + site: { + page: 'https://ventesavenues.in', + domain: 'ventesavenues.in', + name: 'ventesavenues.in' + }, + device: { + ua: '', + ip: '123.145.167.189', + ifa: 'AEBE52E7-03EE-455A-B3C4-E57283966239', + language: 'en' + }, + user: null, + regs: null, + at: 1 + } + }, + serverResponse_banner: { + body: { + cur: 'USD', + seatbid: [ + { + seat: '4', + bid: [ + { + id: 'id', + impid: 'imp_id_banner', + cid: 'campaign_id', + crid: 'creative_id', + adm: '..', + price: 1.5, + w: 300, + h: 200 + } + ] + } + ] + } + } + }; + + describe('isBidRequestValid', function () { + describe('General', function () { + it('should return false when not given an ad unit', function () { + const adUnit = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an invalid ad unit', function () { + const adUnit = 'bad_bid'; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without bidder code', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidder = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with a bad bidder code', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidder = 'unknownBidder'; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without ad unit code', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.adUnitCode = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid ad unit code', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.adUnitCode = {}; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without bid request identifier', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidderRequestId = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid bid request identifier', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidderRequestId = {}; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without impression identifier', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidId = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid impression identifier', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.bidId = {}; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without media types', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with empty media types', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes = {}; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with invalid media types', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes = 'bad_media_types'; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + }); + + describe('Banner', function () { + it('should return true when given a valid ad unit', function () { + const adUnit = examples.adUnit_banner; + + expect(spec.isBidRequestValid(adUnit)).to.equal(true); + }); + + it('should return true when given a valid ad unit with invalid publisher id', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.params = {}; + adUnit.params.publisherId = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return true when given a valid ad unit without placement id', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.params = {}; + adUnit.params.publisherId = 'agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV'; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return true when given a valid ad unit with invalid placement id', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.params = {}; + adUnit.params.publisherId = 'agltb3B1Yi1pbmNyDAsSA0FwcBiJkfTUCV'; + adUnit.params.placementId = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit without size', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = undefined; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid size', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = 'bad_banner_size'; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an empty size', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = []; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid size value', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = ['bad_banner_size_value']; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with a size value with less than 2 dimensions', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[300]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with a size value with more than 2 dimensions', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[300, 250, 30]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with a negative width value', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[-300, 250]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with a negative height value', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[300, -250]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid width value', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[false, 250]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + + it('should return false when given an ad unit with an invalid height value', function () { + const adUnit = utils.deepClone(examples.adUnit_banner); + adUnit.mediaTypes.banner.sizes = [[300, {}]]; + + expect(spec.isBidRequestValid(adUnit)).to.equal(false); + }); + }); + }); + + describe('buildRequests', function () { + describe('ServerRequest', function () { + it('should return a server request when given a valid ad unit and a valid ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + expect(serverRequests).to.be.an('array').and.to.have.length(1); + expect(serverRequests[0].method).to.exist.and.to.be.a('string').and.to.equal('POST'); + expect(serverRequests[0].url).to.exist.and.to.be.a('string').and.to.equal(BIDDER_URL); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + }); + + it('should return an empty server request list when given an empty ad unit list and a valid ad unit context', function () { + const adUnits = []; + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + expect(serverRequests).to.be.an('array').and.to.have.length(0); + }); + + it('should not return a server request when given no ad unit and a valid ad unit context', function () { + const serverRequests = spec.buildRequests(null, examples.adUnitContext); + expect(serverRequests).to.equal(null); + }); + + it('should not return a server request when given a valid ad unit and no ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + const serverRequests = spec.buildRequests(adUnits, null); + expect(serverRequests).to.be.an('array').and.to.have.length(1); + }); + + it('should not return a server request when given a valid ad unit and an invalid ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + const serverRequests = spec.buildRequests(adUnits, {}); + expect(serverRequests).to.be.an('array').and.to.have.length(1); + }); + }); + + describe('BidRequest', function () { + it('should return a valid server request when given a valid ad unit', function () { + const adUnits = [examples.adUnit_banner]; + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data.id).to.exist.and.to.be.a('string').and.to.equal(adUnits[0].bidderRequestId); + expect(serverRequests[0].data.at).to.exist.and.to.be.a('number').and.to.equal(1); + }); + + it('should return one server request when given one valid ad unit', function () { + const adUnits = [examples.adUnit_banner]; + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data.id).to.exist.and.to.be.a('string').and.to.equal(adUnits[0].bidderRequestId); + }); + }); + + describe('Impression', function () { + describe('Banner', function () { + it('should return a server request with one impression when given a valid ad unit', function () { + const adUnits = [examples.adUnit_banner]; + + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.imp).to.exist.and.to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data.imp[0]).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.imp[0].id).to.exist.and.to.be.a('string').and.to.equal(`${adUnits[0].bidId}`); + expect(serverRequests[0].data.imp[0].banner).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.imp[0].banner.w).to.exist.and.to.be.a('number').and.to.equal(adUnits[0].mediaTypes.banner.sizes[0][0]); + expect(serverRequests[0].data.imp[0].banner.h).to.exist.and.to.be.a('number').and.to.equal(adUnits[0].mediaTypes.banner.sizes[0][1]); + expect(serverRequests[0].data.imp[0].banner.format).to.exist.and.to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data.imp[0].banner.format[0]).to.exist.and.to.be.an('object').and.to.deep.equal({ + w: adUnits[0].mediaTypes.banner.sizes[0][0], + h: adUnits[0].mediaTypes.banner.sizes[0][1] + }); + }); + }); + }); + + describe('Site', function () { + it('should return a server request with site information when given a valid ad unit and a valid ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = examples.adUnitContext; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + expect(serverRequests[0].data.site).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.site.page).to.exist.and.to.be.an('string').and.to.equal(adUnitContext.refererInfo.referer); + expect(serverRequests[0].data.site.domain).to.exist.and.to.be.an('string').and.to.equal('ventesavenues.in'); + expect(serverRequests[0].data.site.name).to.exist.and.to.be.an('string').and.to.equal('ventesavenues.in'); + }); + + it('should return a server request without site information when given an ad unit context without referer information', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = utils.deepClone(examples.adUnitContext); + adUnitContext.refererInfo = undefined; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + + it('should return a server request without site information when given an ad unit context with invalid referer information', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = utils.deepClone(examples.adUnitContext); + adUnitContext.refererInfo = 'bad_referer_information'; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + + it('should return a server request without site information when given an ad unit context without referer', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = utils.deepClone(examples.adUnitContext); + adUnitContext.refererInfo.referer = undefined; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + + it('should return a server request without site information when given an ad unit context with an invalid referer', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = utils.deepClone(examples.adUnitContext); + adUnitContext.refererInfo.referer = {}; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + + it('should return a server request without site information when given an ad unit context with a misformatted referer', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = utils.deepClone(examples.adUnitContext); + adUnitContext.refererInfo.referer = 'we-are-adot'; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + }); + + describe('Device', function () { + it('should return a server request with device information when given a valid ad unit and a valid ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + + const serverRequests = spec.buildRequests(adUnits, examples.adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + expect(serverRequests[0].data.device).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.device.ua).to.exist.and.to.be.a('string'); + expect(serverRequests[0].data.device.language).to.exist.and.to.be.a('string'); + }); + }); + + describe('User', function () { + it('should return a server request with user information when given a valid ad unit and a valid ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = examples.adUnitContext; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + expect(serverRequests[0].data.user).to.exist.and.to.be.an('object'); + }); + + it('should return a server request without user information when not given an ad unit context', function () { + const adUnits = [examples.adUnit_banner]; + + const adUnitContext = undefined; + + const serverRequests = spec.buildRequests(adUnits, adUnitContext); + + expect(serverRequests).to.be.an('array').and.to.have.lengthOf(1); + expect(serverRequests[0].data).to.exist.and.to.be.an('object'); + expect(serverRequests[0].data.id).to.exist.and.to.be.an('string').and.to.equal(adUnits[0].bidderRequestId); + }); + }); + }); + + describe('interpretResponse', function () { + describe('General', function () { + it('should return an ad when given a valid server response with one bid with USD currency', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.cur = 'USD'; + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(1); + expect(ads[0].creativeId).to.exist.and.to.be.a('string').and.to.equal(serverResponse.body.seatbid[0].bid[0].crid); + expect(ads[0].cpm).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].price); + expect(ads[0].currency).to.exist.and.to.be.a('string').and.to.equal(serverResponse.body.cur); + expect(ads[0].netRevenue).to.exist.and.to.be.a('boolean').and.to.equal(true); + expect(ads[0].ttl).to.exist.and.to.be.a('number').and.to.equal(10); + expect(ads[0].height).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].h); + expect(ads[0].width).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].w); + expect(ads[0].mediaType).to.exist.and.to.be.a('string').and.to.equal('banner'); + }); + + it('should return no ad when not given a server response', function () { + const ads = spec.interpretResponse(null); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when not given a server response body', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given an invalid server response body', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body = 'invalid_body'; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response without seat bids', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with invalid seat bids', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid = 'invalid_seat_bids'; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with an empty seat bids array', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid = []; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with an invalid seat bid', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid = 'invalid_bids'; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with an empty bids array', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid = []; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with an invalid bid', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid = ['invalid_bid']; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without currency', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.cur = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid currency', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.cur = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without impression identifier', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].impid = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid impression identifier', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].impid = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without creative identifier', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].crid = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid creative identifier', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].crid = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without ad markup and ad serving URL', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].adm = undefined; + serverResponse.body.seatbid[0].bid[0].nurl = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid ad markup', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].adm = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without bid price', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].price = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid bid price', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].price = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and no server request', function () { + const serverRequest = undefined; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and an invalid server request', function () { + const serverRequest = 'bad_server_request'; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and a server request without bid request', function () { + const serverRequest = utils.deepClone(examples.serverRequest_banner); + serverRequest.data = undefined; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and a server request with an invalid bid request', function () { + const serverRequest = utils.deepClone(examples.serverRequest_banner); + serverRequest.data = 'bad_bid_request'; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and a server request without impression', function () { + const serverRequest = utils.deepClone(examples.serverRequest_banner); + serverRequest.data.imp = undefined; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a valid server response and a server request with an invalid impression field', function () { + const serverRequest = utils.deepClone(examples.serverRequest_banner); + serverRequest.data.imp = 'invalid_impressions'; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + }); + + describe('Banner', function () { + it('should return an ad when given a valid server response with one bid', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = examples.serverResponse_banner; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(1); + expect(ads[0].adUrl).to.equal(null); + expect(ads[0].creativeId).to.exist.and.to.be.a('string').and.to.equal(serverResponse.body.seatbid[0].bid[0].crid); + expect(ads[0].cpm).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].price); + expect(ads[0].currency).to.exist.and.to.be.a('string').and.to.equal(serverResponse.body.cur); + expect(ads[0].netRevenue).to.exist.and.to.be.a('boolean').and.to.equal(true); + expect(ads[0].ttl).to.exist.and.to.be.a('number').and.to.equal(10); + expect(ads[0].height).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].h); + expect(ads[0].width).to.exist.and.to.be.a('number').and.to.equal(serverResponse.body.seatbid[0].bid[0].w); + expect(ads[0].mediaType).to.exist.and.to.be.a('string').and.to.equal('banner'); + }); + + it('should return no ad when given a server response with a bid without height', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].h = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid height', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].h = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid without width', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].w = undefined; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + + it('should return no ad when given a server response with a bid with an invalid width', function () { + const serverRequest = examples.serverRequest_banner; + + const serverResponse = utils.deepClone(examples.serverResponse_banner); + serverResponse.body.seatbid[0].bid[0].w = {}; + + const ads = spec.interpretResponse(serverResponse, serverRequest); + + expect(ads).to.be.an('array').and.to.have.length(0); + }); + }); + }); +}); From 2a4f6785a7fe4ae2374db36aac2813d8b4366e52 Mon Sep 17 00:00:00 2001 From: jxdeveloper1 <71084096+jxdeveloper1@users.noreply.github.com> Date: Thu, 21 Oct 2021 05:56:44 +0800 Subject: [PATCH 214/250] Jixiee Bid Adapter: add code to try get keywords from the page meta (#7592) * Adapter does not seem capable of supporting advertiserDomains #6650 added response comment and some trivial code. * removed a blank line at the end of file added a space behind the // in comments * in response to comment from reviewer. add the aspect of advertiserdomain in unit tests * added the code to get the keywords from the meta tags if available. --- modules/jixieBidAdapter.js | 10 ++++++++-- test/spec/modules/jixieBidAdapter_spec.js | 24 ++++++++++++----------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/modules/jixieBidAdapter.js b/modules/jixieBidAdapter.js index 0e05616465a..119fcdf142b 100644 --- a/modules/jixieBidAdapter.js +++ b/modules/jixieBidAdapter.js @@ -10,7 +10,7 @@ export const storage = getStorageManager(); const BIDDER_CODE = 'jixie'; const EVENTS_URL = 'https://hbtra.jixie.io/sync/hb?'; -const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js'; +const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js'; const REQUESTS_URL = 'https://hb.jixie.io/v2/hbpost'; const sidTTLMins_ = 30; @@ -104,7 +104,8 @@ function getMiscDims_() { let ret = { pageurl: '', domain: '', - device: 'unknown' + device: 'unknown', + mkeywords: '' } try { let refererInfo_ = getRefererInfo(); @@ -112,6 +113,10 @@ function getMiscDims_() { ret.pageurl = url_; ret.domain = parseUrl(url_).host; ret.device = getDevice_(); + let keywords = document.getElementsByTagName('meta')['keywords']; + if (keywords && keywords.content) { + ret.mkeywords = keywords.content; + } } catch (error) {} return ret; } @@ -167,6 +172,7 @@ export const spec = { device: miscDims.device, domain: miscDims.domain, pageurl: miscDims.pageurl, + mkeywords: miscDims.mkeywords, bids: bids, cfg: jixieCfgBlob }, ids); diff --git a/test/spec/modules/jixieBidAdapter_spec.js b/test/spec/modules/jixieBidAdapter_spec.js index ae58da30f64..68de5c7a8fd 100644 --- a/test/spec/modules/jixieBidAdapter_spec.js +++ b/test/spec/modules/jixieBidAdapter_spec.js @@ -9,6 +9,7 @@ describe('jixie Adapter', function () { const device_ = 'desktop'; const timeout_ = 1000; const currency_ = 'USD'; + const keywords_ = ''; /** * Basic @@ -212,7 +213,7 @@ describe('jixie Adapter', function () { ); let miscDimsStub = sinon.stub(jixieaux, 'getMiscDims'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); // actual api call: const request = spec.buildRequests(bidRequests_, bidderRequest_); @@ -229,6 +230,7 @@ describe('jixie Adapter', function () { expect(payload).to.have.property('device', device_); expect(payload).to.have.property('domain', domain_); expect(payload).to.have.property('pageurl', pageurl_); + expect(payload).to.have.property('mkeywords', keywords_); expect(payload).to.have.property('timeout', timeout_); expect(payload).to.have.property('currency', currency_); expect(payload).to.have.property('bids').that.deep.equals(refBids_); @@ -243,15 +245,15 @@ describe('jixie Adapter', function () { /** * interpretResponse: */ - const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/dummyscript.js'; - const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.io/jxhboutstream.js'; + const JX_OTHER_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/dummyscript.js'; + const JX_OUTSTREAM_RENDERER_URL = 'https://scripts.jixie.media/jxhbrenderer.1.1.min.js'; - const mockVastXml_ = `JXADSERVERAlway%20Live%20Prebid%20CreativeHybrid in-stream00:00:10`; + const mockVastXml_ = `JXADSERVERAlway%20Live%20Prebid%20CreativeHybrid in-stream00:00:10`; const responseBody_ = { 'bids': [ // video (vast tag url) returned here { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '62847e4c696edcb-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '62847e4c696edcb', 'cpm': 2.19, @@ -284,7 +286,7 @@ describe('jixie Adapter', function () { // display ad returned here: This one there is advertiserDomains // in the response . Will be checked in the unit tests below { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '600c9ae6fda1acb-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '600c9ae6fda1acb', 'cpm': 1.999, @@ -317,11 +319,11 @@ describe('jixie Adapter', function () { ], 'mediaType': 'BANNER' }, - 'ad': '
' + 'ad': '
' }, // outstream, jx non-default renderer specified: { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '99bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '99bc539c81b00ce', 'cpm': 2.99, @@ -340,7 +342,7 @@ describe('jixie Adapter', function () { }, // outstream, jx default renderer: { - 'trackingUrlBase': 'https://tr.jixie.io/sync/ad?', + 'trackingUrlBase': 'https://traid.jixie.io/sync/ad?', 'jxBidId': '61bc539c81b00ce-028d5dee-2c83-44e3-bed1-b75002475cdf', 'requestId': '61bc539c81b00ce', 'cpm': 1.99, @@ -475,7 +477,7 @@ describe('jixie Adapter', function () { ajaxStub = sinon.stub(jixieaux, 'ajax'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); }) afterEach(function() { @@ -537,7 +539,7 @@ describe('jixie Adapter', function () { ajaxStub = sinon.stub(jixieaux, 'ajax'); miscDimsStub = sinon.stub(jixieaux, 'getMiscDims'); miscDimsStub - .returns({ device: device_, pageurl: pageurl_, domain: domain_ }); + .returns({ device: device_, pageurl: pageurl_, domain: domain_, mkeywords: keywords_ }); }) afterEach(function() { From d61717b9e0f5ee3272b1d20396d4dffa1fcf24aa Mon Sep 17 00:00:00 2001 From: wallacebt <82829669+wallacebt@users.noreply.github.com> Date: Thu, 21 Oct 2021 10:51:21 -0400 Subject: [PATCH 215/250] multibid module: Use array instead of string template to allow . in adUnitCode value (#7434) * Use array instead of string template to allow . in adUnitCode value * Change deepAccess param from string literal to array and modify unit test adUnitCode to include . in value --- modules/multibid/index.js | 6 +-- test/spec/modules/multibid_spec.js | 62 +++++++++++++++--------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/modules/multibid/index.js b/modules/multibid/index.js index cf4821de183..ef0771e291f 100644 --- a/modules/multibid/index.js +++ b/modules/multibid/index.js @@ -112,7 +112,7 @@ export function addBidResponseHook(fn, adUnitCode, bid) { if (multiConfig[bid.bidderCode].prefix) bid.multibidPrefix = multiConfig[bid.bidderCode].prefix; bid.originalBidder = bid.bidderCode; // Check if stored bids for auction include adUnitCode.bidder and max limit not reach for ad unit - if (deepAccess(multibidUnits, `${adUnitCode}.${bid.bidderCode}`)) { + if (deepAccess(multibidUnits, [adUnitCode, bid.bidderCode])) { // Store request id under new property originalRequestId, create new unique bidId, // and push bid into multibid stored bids for auction if max not reached and bid cpm above floor if (!multibidUnits[adUnitCode][bid.bidderCode].maxReached && (!floor || floor <= bid.cpm)) { @@ -131,9 +131,9 @@ export function addBidResponseHook(fn, adUnitCode, bid) { logWarn(`Filtering multibid received from bidder ${bid.bidderCode}: ` + ((multibidUnits[adUnitCode][bid.bidderCode].maxReached) ? `Maximum bid limit reached for ad unit code ${adUnitCode}` : 'Bid cpm under floors value.')); } } else { - if (deepAccess(bid, 'floorData.floorValue')) deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {floor: deepAccess(bid, 'floorData.floorValue')}); + if (deepAccess(bid, 'floorData.floorValue')) deepSetValue(multibidUnits, [adUnitCode, bid.bidderCode], {floor: deepAccess(bid, 'floorData.floorValue')}); - deepSetValue(multibidUnits, `${adUnitCode}.${bid.bidderCode}`, {ads: [bid]}); + deepSetValue(multibidUnits, [adUnitCode, bid.bidderCode], {ads: [bid]}); if (multibidUnits[adUnitCode][bid.bidderCode].ads.length === multiConfig[bid.bidderCode].maxbids) multibidUnits[adUnitCode][bid.bidderCode].maxReached = true; fn.call(this, adUnitCode, bid); diff --git a/test/spec/modules/multibid_spec.js b/test/spec/modules/multibid_spec.js index e849392ee4b..86365eb520f 100644 --- a/test/spec/modules/multibid_spec.js +++ b/test/spec/modules/multibid_spec.js @@ -82,7 +82,7 @@ describe('multibid adapter', function () { 'sizes': [[300, 250]] } }, - 'adUnitCode': 'test-div', + 'adUnitCode': 'test.div', 'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60', 'sizes': [[300, 250]], 'bidId': '2408ef83b84c9d', @@ -106,7 +106,7 @@ describe('multibid adapter', function () { 'sizes': [[300, 250]] } }, - 'adUnitCode': 'test-div', + 'adUnitCode': 'test.div', 'transactionId': 'c153f3da-84f0-4be8-95cb-0647c458bc60', 'sizes': [[300, 250]], 'bidId': '2408ef83b84c9d', @@ -197,14 +197,14 @@ describe('multibid adapter', function () { }); it('adds original bids and does not modify', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArray[0]}, {...bidArray[1]}]; addBidResponseHook(callbackFn, adUnitCode, {...bids[0]}); expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[0]); @@ -214,13 +214,13 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[1]); }); it('modifies and adds both bids based on multibid configuration', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArray[0]}, {...bidArray[1]}]; config.setConfig({multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}]}); @@ -232,7 +232,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[0]); @@ -250,13 +250,13 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[1]); }); it('only modifies bids defined in the multibid configuration', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArray[0]}, {...bidArray[1]}]; bids.push({ @@ -276,7 +276,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[0]); @@ -292,7 +292,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[1]); @@ -302,13 +302,13 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[2]); }); it('only modifies and returns bids under limit for a specifc bidder in the multibid configuration', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArray[0]}, {...bidArray[1]}]; bids.push({ @@ -328,7 +328,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[0]); @@ -344,7 +344,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[1]); @@ -356,7 +356,7 @@ describe('multibid adapter', function () { }); it('if no prefix in multibid configuration, modifies and returns bids under limit without preifx property', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArray[0]}, {...bidArray[1]}]; bids.push({ @@ -375,7 +375,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[0]); @@ -389,7 +389,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid).to.deep.equal(bids[1]); @@ -401,7 +401,7 @@ describe('multibid adapter', function () { }); it('does not include extra bids if cpm is less than floor value', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}]; bids.map(bid => { @@ -418,7 +418,7 @@ describe('multibid adapter', function () { floorRuleValue: 65, floorValue: 65, matchedFields: { - gptSlot: 'test-div', + gptSlot: 'test.div', mediaType: 'banner' } } @@ -435,7 +435,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid.bidder).to.equal('bidderA'); expect(result.bid.targetingBidder).to.equal(undefined); @@ -452,7 +452,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid.bidder).to.equal('bidderB'); expect(result.bid.targetingBidder).to.equal(undefined); @@ -463,14 +463,14 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid.bidder).to.equal('bidderC'); expect(result.bid.targetingBidder).to.equal(undefined); }); it('does include extra bids if cpm is not less than floor value', function () { - let adUnitCode = 'test-div'; + let adUnitCode = 'test.div'; let bids = [{...bidArrayAlt[1]}, {...bidArrayAlt[0]}]; bids.map(bid => { @@ -487,7 +487,7 @@ describe('multibid adapter', function () { floorRuleValue: 25, floorValue: 25, matchedFields: { - gptSlot: 'test-div', + gptSlot: 'test.div', mediaType: 'banner' } } @@ -504,7 +504,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid.bidder).to.equal('bidderA'); expect(result.bid.targetingBidder).to.equal(undefined); @@ -518,7 +518,7 @@ describe('multibid adapter', function () { expect(result).to.not.equal(null); expect(result.adUnitCode).to.not.equal(null); - expect(result.adUnitCode).to.equal('test-div'); + expect(result.adUnitCode).to.equal('test.div'); expect(result.bid).to.not.equal(null); expect(result.bid.bidder).to.equal('bidderA'); expect(result.bid.targetingBidder).to.equal('bidA2'); @@ -578,7 +578,7 @@ describe('multibid adapter', function () { it('it sorts and creates dynamic alias on bidsReceived if multibid configuration found with prefix', function () { let modifiedBids = [{...bidArray[1]}, {...bidArray[0]}].map(bid => { - addBidResponseHook(bidResponseCallback, 'test-div', {...bid}); + addBidResponseHook(bidResponseCallback, 'test.div', {...bid}); return bidResult; }); @@ -603,7 +603,7 @@ describe('multibid adapter', function () { it('it sorts by cpm treating dynamic alias as unique bid when no bid limit defined', function () { let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => { - addBidResponseHook(bidResponseCallback, 'test-div', {...bid}); + addBidResponseHook(bidResponseCallback, 'test.div', {...bid}); return bidResult; }); @@ -636,7 +636,7 @@ describe('multibid adapter', function () { it('it should filter out dynamic bid when bid limit is less than unique bid pool', function () { let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => { - addBidResponseHook(bidResponseCallback, 'test-div', {...bid}); + addBidResponseHook(bidResponseCallback, 'test.div', {...bid}); return bidResult; }); @@ -662,7 +662,7 @@ describe('multibid adapter', function () { config.setConfig({ multibid: [{bidder: 'bidderA', maxBids: 2, targetBiddercodePrefix: 'bidA'}] }); let modifiedBids = [{...bidArrayAlt[0]}, {...bidArrayAlt[2]}, {...bidArrayAlt[3]}, {...bidArrayAlt[1]}].map(bid => { - addBidResponseHook(bidResponseCallback, 'test-div', {...bid}); + addBidResponseHook(bidResponseCallback, 'test.div', {...bid}); return bidResult; }); From a5282aad74de0200d11e7b132ab450c000b46f9b Mon Sep 17 00:00:00 2001 From: liliana-sortable Date: Thu, 21 Oct 2021 11:02:21 -0400 Subject: [PATCH 216/250] Sortable Bid Adapter: Set gpid (#7608) --- modules/sortableBidAdapter.js | 1 + test/spec/modules/sortableBidAdapter_spec.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/modules/sortableBidAdapter.js b/modules/sortableBidAdapter.js index c1cb607e5ab..15246a10eab 100644 --- a/modules/sortableBidAdapter.js +++ b/modules/sortableBidAdapter.js @@ -227,6 +227,7 @@ export const spec = { rv.ext[partner] = params; }); } + rv.ext.gpid = deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'); return rv; }); const gdprConsent = bidderRequest && bidderRequest.gdprConsent; diff --git a/test/spec/modules/sortableBidAdapter_spec.js b/test/spec/modules/sortableBidAdapter_spec.js index 17f77e96d51..7357fa77952 100644 --- a/test/spec/modules/sortableBidAdapter_spec.js +++ b/test/spec/modules/sortableBidAdapter_spec.js @@ -112,6 +112,13 @@ describe('sortableBidAdapter', function() { 'key2': 'val2' } }, + 'ortb2Imp': { + 'ext': { + 'data': { + 'pbadslot': 'abc/123' + } + } + }, 'sizes': [ [300, 250] ], @@ -176,6 +183,10 @@ describe('sortableBidAdapter', function() { expect(requestBody.imp[0].floor).to.equal(0.21); }); + it('includes pbadslot in the bid request', function () { + expect(requestBody.imp[0].ext.gpid).to.equal('abc/123'); + }); + it('sets domain and href correctly', function () { expect(requestBody.site.domain).to.equal('example.com'); expect(requestBody.site.page).to.equal('http://example.com/page?param=val'); From 1cd4eba0fc2ae8f240b305df3274c60e79bddad9 Mon Sep 17 00:00:00 2001 From: Kylian Deau <89531203+github-kylian-deau@users.noreply.github.com> Date: Thu, 21 Oct 2021 22:15:17 +0200 Subject: [PATCH 217/250] Teads adapter: global placement id support (#7588) --- modules/teadsBidAdapter.js | 3 + test/spec/modules/teadsBidAdapter_spec.js | 132 ++++++++++++++++++++++ 2 files changed, 135 insertions(+) diff --git a/modules/teadsBidAdapter.js b/modules/teadsBidAdapter.js index 3edca828bf0..ea581905883 100644 --- a/modules/teadsBidAdapter.js +++ b/modules/teadsBidAdapter.js @@ -190,6 +190,8 @@ function buildRequestObject(bid) { const reqObj = {}; let placementId = getValue(bid.params, 'placementId'); let pageId = getValue(bid.params, 'pageId'); + const impressionData = deepAccess(bid, 'ortb2Imp.ext.data'); + const gpid = deepAccess(impressionData, 'pbadslot') || deepAccess(impressionData, 'adserver.adslot'); reqObj.sizes = getSizes(bid); reqObj.bidId = getBidIdParameter('bidId', bid); @@ -199,6 +201,7 @@ function buildRequestObject(bid) { reqObj.adUnitCode = getBidIdParameter('adUnitCode', bid); reqObj.auctionId = getBidIdParameter('auctionId', bid); reqObj.transactionId = getBidIdParameter('transactionId', bid); + if (gpid) { reqObj.gpid = gpid; } return reqObj; } diff --git a/test/spec/modules/teadsBidAdapter_spec.js b/test/spec/modules/teadsBidAdapter_spec.js index 7fd3b70398b..83f5045cca1 100644 --- a/test/spec/modules/teadsBidAdapter_spec.js +++ b/test/spec/modules/teadsBidAdapter_spec.js @@ -582,6 +582,138 @@ describe('teadsBidAdapter', () => { }); }); + describe('Global Placement Id', function () { + let bidRequests = [ + { + 'bidder': 'teads', + 'params': { + 'placementId': 10433394, + 'pageId': 1234 + }, + 'adUnitCode': 'adunit-code-1', + 'sizes': [[300, 250], [300, 600]], + 'bidId': '30b31c1838de1e', + 'bidderRequestId': '22edbae2733bf6', + 'auctionId': '1d1a030790a475', + 'creativeId': 'er2ee', + 'deviceWidth': 1680 + }, + { + 'bidder': 'teads', + 'params': { + 'placementId': 10433395, + 'pageId': 1234 + }, + 'adUnitCode': 'adunit-code-2', + 'sizes': [[300, 250], [300, 600]], + 'bidId': '30b31c1838de1f', + 'bidderRequestId': '22edbae2733bf6', + 'auctionId': '1d1a030790a475', + 'creativeId': 'er2ef', + 'deviceWidth': 1680 + } + ]; + + it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (and ortb2Imp.ext.data.adserver.adslot is not present)', function () { + const updatedBidRequests = bidRequests.map(function(bidRequest, index) { + return { + ...bidRequest, + ortb2Imp: { + ext: { + data: { + pbadslot: '1111/home-left-' + index + } + } + } + }; + } + ); + const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault); + const payload = JSON.parse(request.data); + + expect(payload.data[0].gpid).to.equal('1111/home-left-0'); + expect(payload.data[1].gpid).to.equal('1111/home-left-1'); + }); + + it('should add gpid if ortb2Imp.ext.data.pbadslot is present and is non empty (even if ortb2Imp.ext.data.adserver.adslot is present and is non empty too)', function () { + const updatedBidRequests = bidRequests.map(function(bidRequest, index) { + return { + ...bidRequest, + ortb2Imp: { + ext: { + data: { + pbadslot: '1111/home-left-' + index, + adserver: { + adslot: '1111/home-left/div-' + index + } + } + } + } + }; + } + ); + const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault); + const payload = JSON.parse(request.data); + + expect(payload.data[0].gpid).to.equal('1111/home-left-0'); + expect(payload.data[1].gpid).to.equal('1111/home-left-1'); + }); + + it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are present but empty', function () { + const updatedBidRequests = bidRequests.map(bidRequest => ({ + ...bidRequest, + ortb2Imp: { + ext: { + data: { + pbadslot: '', + adserver: { + adslot: '' + } + } + } + } + })); + + const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault); + const payload = JSON.parse(request.data); + + return payload.data.forEach(bid => { + expect(bid).not.to.have.property('gpid'); + }); + }); + + it('should not add gpid if both ortb2Imp.ext.data.pbadslot and ortb2Imp.ext.data.adserver.adslot are not present', function () { + const request = spec.buildRequests(bidRequests, bidderResquestDefault); + const payload = JSON.parse(request.data); + + return payload.data.forEach(bid => { + expect(bid).not.to.have.property('gpid'); + }); + }); + + it('should add gpid if ortb2Imp.ext.data.pbadslot is not present but ortb2Imp.ext.data.adserver.adslot is present and is non empty', function () { + const updatedBidRequests = bidRequests.map(function(bidRequest, index) { + return { + ...bidRequest, + ortb2Imp: { + ext: { + data: { + adserver: { + adslot: '1111/home-left-' + index + } + } + } + } + }; + }); + const request = spec.buildRequests(updatedBidRequests, bidderResquestDefault); + const payload = JSON.parse(request.data); + + expect(payload.data[0].gpid).to.equal('1111/home-left-0'); + expect(payload.data[1].gpid).to.equal('1111/home-left-1'); + }); + }); + function checkMediaTypesSizes(mediaTypes, expectedSizes) { const bidRequestWithBannerSizes = Object.assign(bidRequests[0], mediaTypes); const requestWithBannerSizes = spec.buildRequests([bidRequestWithBannerSizes], bidderResquestDefault); From ba0b9e5fc657a601bda453ff467f80ea313c04cf Mon Sep 17 00:00:00 2001 From: TheMediaGrid <44166371+TheMediaGrid@users.noreply.github.com> Date: Thu, 21 Oct 2021 23:21:33 +0300 Subject: [PATCH 218/250] TheMediaGrid Bid Adapter: add playwire as alias (#7603) * Added TheMediaGridNM Bid Adapter * Updated required params for TheMediaGridNM Bid Adapter * Update TheMediGridNM Bid Adapter * Fix tests for TheMediaGridNM Bid Adapter * Fixes after review for TheMediaGridNM Bid Adapter * Add support of multi-format in TheMediaGrid Bid Adapter * Update sync url for grid and gridNM Bid Adapters * TheMediaGrid Bid Adapter: added keywords adUnit parameter * Update TheMediaGrid Bid Adapter to support keywords from config * Implement new request format for TheMediaGrid Bid Adapter * Fix jwpseg params for TheMediaGrid Bid Adapter * Update unit tests for The Media Grid Bid Adapter * Fix typo in TheMediaGrid Bid Adapter * Added test for jwTargeting in TheMediaGrid Bid Adapter * The new request format was made by default in TheMediaGrid Bid Adapter * Update userId format in ad request for TheMediaGrid Bid Adapter * Added bidFloor parameter for TheMediaGrid Bid Adapter * Fix for review TheMediaGrid Bid Adapter * Support floorModule in TheMediaGrid Bid Adapter * Fix empty bidfloor for TheMediaGrid Bid Adapter * Some change to restart autotests * Fix userIds format for TheMediaGrid Bid Adapter * Remove digitrust userId from TheMediaGrid Bid Adapter * Protocols was added in video section in ad request for TheMediaGrid Bid Adapter * TheMediaGrid: fix trouble with alias using * TheMediaGridNM: fix trouble with alias * TheMediaGrid Bid Adapter: added support of PBAdSlot module * TheMediaGrid Bid Adapter: fix typo * GridNM Bid Adapter: use absent in params data from mediaTypes * GridNM Bid Adapter: fix md file + add advertiserDomains support * TheMediaGrid and gridNM Bid Adapter: minor netRevenue fixes * gridNM Bid Adapter updates after review * TheMediaGrid Bid Adapter: fix keywords workflow * fix testing and kick off lgtm again * TheMediaGrid: added ext.bidder.grid.demandSource processing * TheMediaGrid: added user.id from fpd cookie * TheMediaGrid: control cookie setting via bidder config * TheMediaGrid: use localStorage instead cookie * TheMediaGridNM Bid Adapter: update adapter to use /hbjson endpoint * TheMediaGridNM: fix unnecessary conditions * TheMediaGrid: fix bug with nurl field in response * TheMediaGrid: update test * TheMediaGridNM: fix possible bug with nurl * TheMediaGrid: added alias as playwire Co-authored-by: Chris Huie --- modules/gridBidAdapter.js | 1 + modules/playwireBidAdapter.md | 61 +++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/playwireBidAdapter.md diff --git a/modules/gridBidAdapter.js b/modules/gridBidAdapter.js index 6c862a262b4..f62b62b7a97 100644 --- a/modules/gridBidAdapter.js +++ b/modules/gridBidAdapter.js @@ -29,6 +29,7 @@ let hasSynced = false; export const spec = { code: BIDDER_CODE, + aliases: ['playwire'], supportedMediaTypes: [ BANNER, VIDEO ], /** * Determines whether or not the given bid request is valid. diff --git a/modules/playwireBidAdapter.md b/modules/playwireBidAdapter.md new file mode 100644 index 00000000000..dddb57c9bc1 --- /dev/null +++ b/modules/playwireBidAdapter.md @@ -0,0 +1,61 @@ +# Overview + +Module Name: Playwire Bidder Adapter +Module Type: Bidder Adapter +Maintainer: grid-tech@themediagrid.com + +# Description + +Module that connects to Grid demand source to fetch bids. +The adapter is GDPR compliant and supports banner and video (instream and outstream). + +# Test Parameters +``` + var adUnits = [ + { + code: 'test-div', + sizes: [[300, 250]], + bids: [ + { + bidder: "playwire", + params: { + uid: '1', + bidFloor: 0.5 + } + } + ] + },{ + code: 'test-div', + sizes: [[728, 90]], + bids: [ + { + bidder: "playwire", + params: { + uid: 2, + keywords: { + brandsafety: ['disaster'], + topic: ['stress', 'fear'] + } + } + } + ] + }, + { + code: 'test-div', + sizes: [[728, 90]], + mediaTypes: { video: { + context: 'instream', + playerSize: [728, 90], + mimes: ['video/mp4'] + }, + bids: [ + { + bidder: "playwire", + params: { + uid: 11 + } + } + ] + } + ]; +``` From 7e67bbcd81f0090984dfa2247b3429e324679e75 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Fri, 22 Oct 2021 14:18:08 -0400 Subject: [PATCH 219/250] Update nativoBidAdapter.js --- modules/nativoBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index 9a0cd62258b..9b7ffef8957 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -98,7 +98,7 @@ export const spec = { ] if (placementIds.size > 0) { - params.unshift({ key: 'ntv_ptd', value: [...placementIds].join(',') }) + params.unshift({ key: 'ntv_ptd', value: placementIds.toString() }) } if (bidderRequest.gdprConsent) { From 9e6b054e84ab6394efe9a08f64183f23a8a6d6d4 Mon Sep 17 00:00:00 2001 From: Luigi Sayson <48766825+luigi-sayson@users.noreply.github.com> Date: Fri, 22 Oct 2021 15:40:21 -0700 Subject: [PATCH 220/250] Remove duplicate segment handling (#7622) --- modules/openxBidAdapter.js | 2 +- test/spec/modules/openxBidAdapter_spec.js | 26 ----------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/modules/openxBidAdapter.js b/modules/openxBidAdapter.js index f27c0316476..eb165e886e8 100644 --- a/modules/openxBidAdapter.js +++ b/modules/openxBidAdapter.js @@ -322,7 +322,7 @@ function buildFpdQueryParams(fpdPath) { return acc; }, {}) return Object.keys(fpd) - .map((name, _) => name + ':' + [...new Set(fpd[name])].join('|')) + .map((name, _) => name + ':' + fpd[name].join('|')) .join(',') } diff --git a/test/spec/modules/openxBidAdapter_spec.js b/test/spec/modules/openxBidAdapter_spec.js index aa869b07e47..783449723ae 100644 --- a/test/spec/modules/openxBidAdapter_spec.js +++ b/test/spec/modules/openxBidAdapter_spec.js @@ -1602,32 +1602,6 @@ describe('OpenxAdapter', function () { scsm: 'dmp3/5:foo2|bar2,dmp4:baz2' }, }, - { - name: 'should not send duplicate proprietary segment data from first party config ', - config: { - ortb2: { - user: { - data: [ - {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}, {id: 'foo'}]}, - {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, - ] - }, - site: { - content: { - data: [ - {name: 'dmp1', ext: {segtax: 4}, segment: [{id: 'foo'}, {id: 'bar'}]}, - {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'foo2'}, {id: 'bar2'}]}, - {name: 'dmp3', ext: {segtax: 5}, segment: [{id: 'foo2'}, {id: 'bar2'}]}, - ] - } - } - } - }, - expect: { - sm: 'dmp1/4:foo|bar', - scsm: 'dmp1/4:foo|bar,dmp3/5:foo2|bar2' - }, - }, { name: 'should combine same provider segment data from ortb2.user.data', config: { From 2c0f9f79490abf2f3f15c1beabd2f77bbb136e17 Mon Sep 17 00:00:00 2001 From: jsnellbaker <31102355+jsnellbaker@users.noreply.github.com> Date: Mon, 25 Oct 2021 08:00:15 -0400 Subject: [PATCH 221/250] appnexus bid adapter - update impression urls logic (#7618) --- modules/appnexusBidAdapter.js | 8 +++++--- test/spec/modules/appnexusBidAdapter_spec.js | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/appnexusBidAdapter.js b/modules/appnexusBidAdapter.js index 7dcbd74d779..20e002cdc1a 100644 --- a/modules/appnexusBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -696,9 +696,11 @@ function newBid(serverBid, rtbBid, bidderRequest) { }); try { if (rtbBid.rtb.trackers) { - const url = rtbBid.rtb.trackers[0].impression_urls[0]; - const tracker = createTrackPixelHtml(url); - bid.ad += tracker; + for (let i = 0; i < rtbBid.rtb.trackers[0].impression_urls.length; i++) { + const url = rtbBid.rtb.trackers[0].impression_urls[i]; + const tracker = createTrackPixelHtml(url); + bid.ad += tracker; + } } } catch (error) { logError('Error appending tracking pixel', error); diff --git a/test/spec/modules/appnexusBidAdapter_spec.js b/test/spec/modules/appnexusBidAdapter_spec.js index 9396c1e1928..0d553aba705 100644 --- a/test/spec/modules/appnexusBidAdapter_spec.js +++ b/test/spec/modules/appnexusBidAdapter_spec.js @@ -1047,7 +1047,8 @@ describe('AppNexusAdapter', function () { 'trackers': [ { 'impression_urls': [ - 'https://lax1-ib.adnxs.com/impression' + 'https://lax1-ib.adnxs.com/impression', + 'https://www.test.com/tracker' ], 'video_events': {} } From efb81c1d5d21cbcc72803a2a14130f9632f9eec3 Mon Sep 17 00:00:00 2001 From: bjorn-lw <32431346+bjorn-lw@users.noreply.github.com> Date: Mon, 25 Oct 2021 15:54:10 +0200 Subject: [PATCH 222/250] Send info about original CPM bid (#7623) --- modules/livewrappedAnalyticsAdapter.js | 5 ++++ .../livewrappedAnalyticsAdapter_spec.js | 27 ++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/modules/livewrappedAnalyticsAdapter.js b/modules/livewrappedAnalyticsAdapter.js index 64806b793c2..5ef109aef96 100644 --- a/modules/livewrappedAnalyticsAdapter.js +++ b/modules/livewrappedAnalyticsAdapter.js @@ -3,6 +3,7 @@ import {ajax} from '../src/ajax.js'; import adapter from '../src/AnalyticsAdapter.js'; import CONSTANTS from '../src/constants.json'; import adapterManager from '../src/adapterManager.js'; +import { getGlobal } from '../src/prebidGlobal.js'; const ANALYTICSTYPE = 'endpoint'; const URL = 'https://lwadm.com/analytics/10'; @@ -14,6 +15,7 @@ const TIMEOUTSENT = 8; const ADRENDERFAILEDSENT = 16; let initOptions; +let prebidGlobal = getGlobal(); export const BID_WON_TIMEOUT = 500; const cache = { @@ -79,6 +81,7 @@ let livewrappedAnalyticsAdapter = Object.assign(adapter({EMPTYURL, ANALYTICSTYPE bidResponse.width = args.width; bidResponse.height = args.height; bidResponse.cpm = args.cpm; + bidResponse.originalCpm = prebidGlobal.convertCurrency(args.originalCpm, args.originalCurrency, args.currency); bidResponse.ttr = args.timeToRespond; bidResponse.readyToSend = 1; bidResponse.mediaType = args.mediaType == 'native' ? 2 : (args.mediaType == 'video' ? 4 : 1); @@ -237,6 +240,7 @@ function getResponses(gdpr, auctionIds) { width: bid.width, height: bid.height, cpm: bid.cpm, + orgCpm: bid.originalCpm, ttr: bid.ttr, IsBid: bid.isBid, mediaType: bid.mediaType, @@ -276,6 +280,7 @@ function getWins(gdpr, auctionIds) { width: bid.width, height: bid.height, cpm: bid.cpm, + orgCpm: bid.originalCpm, mediaType: bid.mediaType, gdpr: gdprPos, floor: bid.lwFloor ? bid.lwFloor : (bid.floorData ? bid.floorData.floorValue : undefined), diff --git a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js index fc0d4a55e54..3e568c1175d 100644 --- a/test/spec/modules/livewrappedAnalyticsAdapter_spec.js +++ b/test/spec/modules/livewrappedAnalyticsAdapter_spec.js @@ -2,6 +2,7 @@ import livewrappedAnalyticsAdapter, { BID_WON_TIMEOUT } from 'modules/livewrappe import CONSTANTS from 'src/constants.json'; import { config } from 'src/config.js'; import { server } from 'test/mocks/xhr.js'; +import { setConfig } from 'modules/currency.js'; let events = require('src/events'); let utils = require('src/utils'); @@ -28,6 +29,9 @@ const BID1 = { width: 980, height: 240, cpm: 1.1, + originalCpm: 12.0, + currency: 'USD', + originalCurrency: 'FOO', timeToRespond: 200, bidId: '2ecff0db240757', requestId: '2ecff0db240757', @@ -43,6 +47,9 @@ const BID2 = Object.assign({}, BID1, { width: 300, height: 250, cpm: 2.2, + originalCpm: 23.0, + currency: 'USD', + originalCurrency: 'FOO', timeToRespond: 300, bidId: '3ecff0db240757', requestId: '3ecff0db240757', @@ -178,6 +185,7 @@ const ANALYTICS_MESSAGE = { width: 980, height: 240, cpm: 1.1, + orgCpm: 120, ttr: 200, IsBid: true, mediaType: 1, @@ -192,6 +200,7 @@ const ANALYTICS_MESSAGE = { width: 300, height: 250, cpm: 2.2, + orgCpm: 230, ttr: 300, IsBid: true, mediaType: 1, @@ -219,6 +228,7 @@ const ANALYTICS_MESSAGE = { width: 980, height: 240, cpm: 1.1, + orgCpm: 120, mediaType: 1, gdpr: 0, auctionId: 0 @@ -231,6 +241,7 @@ const ANALYTICS_MESSAGE = { width: 300, height: 250, cpm: 2.2, + orgCpm: 230, mediaType: 1, gdpr: 0, auctionId: 0 @@ -279,6 +290,14 @@ describe('Livewrapped analytics adapter', function () { sandbox.stub(document, 'getElementById').returns(element); clock = sandbox.useFakeTimers(1519767013781); + setConfig({ + adServerCurrency: 'USD', + rates: { + USD: { + FOO: 0.1 + } + } + }); }); afterEach(function () { @@ -453,7 +472,7 @@ describe('Livewrapped analytics adapter', function () { { 'floorData': { 'floorValue': 1.1, - 'floorCurrency': 'SEK' + 'floorCurrency': 'FOO' } })); events.emit(BID_WON, Object.assign({}, @@ -461,7 +480,7 @@ describe('Livewrapped analytics adapter', function () { { 'floorData': { 'floorValue': 1.1, - 'floorCurrency': 'SEK' + 'floorCurrency': 'FOO' } })); events.emit(AUCTION_END, MOCK.AUCTION_END); @@ -476,11 +495,11 @@ describe('Livewrapped analytics adapter', function () { expect(message.responses.length).to.equal(1); expect(message.responses[0].floor).to.equal(1.1); - expect(message.responses[0].floorCur).to.equal('SEK'); + expect(message.responses[0].floorCur).to.equal('FOO'); expect(message.wins.length).to.equal(1); expect(message.wins[0].floor).to.equal(1.1); - expect(message.wins[0].floorCur).to.equal('SEK'); + expect(message.wins[0].floorCur).to.equal('FOO'); }); it('should forward Livewrapped floor data', function () { From 6729f8f8239011705fccb1ea6a84159ca7e0ab29 Mon Sep 17 00:00:00 2001 From: mamatic <52153441+mamatic@users.noreply.github.com> Date: Mon, 25 Oct 2021 16:05:23 +0200 Subject: [PATCH 223/250] Ats Analytics Adapter: listen to bid won events (#7577) * ATS-analytics-adapter - add bid_won logic * ATS-analytics-adapter - increase timeout in order to get bid_won events * ATS-analytics-adapter - make bid_won timeout configurable * ATS-analytics-adapter - change readme file --- modules/atsAnalyticsAdapter.js | 113 +++++++++++------- modules/atsAnalyticsAdapter.md | 1 + test/spec/modules/atsAnalyticsAdapter_spec.js | 51 ++++++-- 3 files changed, 110 insertions(+), 55 deletions(-) diff --git a/modules/atsAnalyticsAdapter.js b/modules/atsAnalyticsAdapter.js index d1e520b4b8f..f45d2e80055 100644 --- a/modules/atsAnalyticsAdapter.js +++ b/modules/atsAnalyticsAdapter.js @@ -20,7 +20,7 @@ export const analyticsUrl = 'https://analytics.rlcdn.com'; let handlerRequest = []; let handlerResponse = []; -let atsAnalyticsAdapterVersion = 2; +let atsAnalyticsAdapterVersion = 3; let browsersList = [ /* Googlebot */ @@ -222,7 +222,8 @@ function bidRequestedHandler(args) { auction_start: new Date(args.auctionStart).toJSON(), domain: window.location.hostname, pid: atsAnalyticsAdapter.context.pid, - adapter_version: atsAnalyticsAdapterVersion + adapter_version: atsAnalyticsAdapterVersion, + bid_won: false }; }); return requests; @@ -251,13 +252,14 @@ export function parseBrowser() { } } -function sendDataToAnalytic () { +function sendDataToAnalytic (events) { // send data to ats analytic endpoint try { - let dataToSend = {'Data': atsAnalyticsAdapter.context.events}; + let dataToSend = {'Data': events}; let strJSON = JSON.stringify(dataToSend); logInfo('ATS Analytics - tried to send analytics data!'); ajax(analyticsUrl, function () { + logInfo('ATS Analytics - events sent successfully!'); }, strJSON, {method: 'POST', contentType: 'application/json'}); } catch (err) { logError('ATS Analytics - request encounter an error: ', err); @@ -265,7 +267,7 @@ function sendDataToAnalytic () { } // preflight request, to check did publisher have permission to send data to analytics endpoint -function preflightRequest (envelopeSourceCookieValue) { +function preflightRequest (envelopeSourceCookieValue, events) { logInfo('ATS Analytics - preflight request!'); ajax(preflightUrl + atsAnalyticsAdapter.context.pid, { @@ -276,7 +278,8 @@ function preflightRequest (envelopeSourceCookieValue) { atsAnalyticsAdapter.setSamplingCookie(samplingRate); let samplingRateNumber = Number(samplingRate); if (data && samplingRate && atsAnalyticsAdapter.shouldFireRequest(samplingRateNumber) && envelopeSourceCookieValue != null) { - sendDataToAnalytic(); + logInfo('ATS Analytics - events to send: ', events); + sendDataToAnalytic(events); } }, error: function () { @@ -286,29 +289,6 @@ function preflightRequest (envelopeSourceCookieValue) { }, undefined, {method: 'GET', crossOrigin: true}); } -function callHandler(evtype, args) { - if (evtype === CONSTANTS.EVENTS.BID_REQUESTED) { - handlerRequest = handlerRequest.concat(bidRequestedHandler(args)); - } else if (evtype === CONSTANTS.EVENTS.BID_RESPONSE) { - handlerResponse.push(bidResponseHandler(args)); - } - if (evtype === CONSTANTS.EVENTS.AUCTION_END) { - if (handlerRequest.length) { - let events = []; - if (handlerResponse.length) { - events = handlerRequest.filter(request => handlerResponse.filter(function(response) { - if (request.bid_id === response.bid_id) { - Object.assign(request, response); - } - })); - } else { - events = handlerRequest; - } - atsAnalyticsAdapter.context.events = events; - } - } -} - let atsAnalyticsAdapter = Object.assign(adapter( { analyticsType @@ -316,22 +296,7 @@ let atsAnalyticsAdapter = Object.assign(adapter( { track({eventType, args}) { if (typeof args !== 'undefined') { - callHandler(eventType, args); - } - if (eventType === CONSTANTS.EVENTS.AUCTION_END) { - let envelopeSourceCookieValue = storage.getCookie('_lr_env_src_ats'); - try { - let samplingRateCookie = storage.getCookie('_lr_sampling_rate'); - if (!samplingRateCookie) { - preflightRequest(envelopeSourceCookieValue); - } else { - if (atsAnalyticsAdapter.shouldFireRequest(parseInt(samplingRateCookie)) && envelopeSourceCookieValue != null) { - sendDataToAnalytic(); - } - } - } catch (err) { - logError('ATS Analytics - preflight request encounter an error: ', err); - } + atsAnalyticsAdapter.callHandler(eventType, args); } } }); @@ -369,13 +334,69 @@ atsAnalyticsAdapter.enableAnalytics = function (config) { } atsAnalyticsAdapter.context = { events: [], - pid: config.options.pid + pid: config.options.pid, + bidWonTimeout: config.options.bidWonTimeout }; let initOptions = config.options; logInfo('ATS Analytics - adapter enabled! '); atsAnalyticsAdapter.originEnableAnalytics(initOptions); // call the base class function }; +atsAnalyticsAdapter.callHandler = function (evtype, args) { + if (evtype === CONSTANTS.EVENTS.BID_REQUESTED) { + handlerRequest = handlerRequest.concat(bidRequestedHandler(args)); + } else if (evtype === CONSTANTS.EVENTS.BID_RESPONSE) { + handlerResponse.push(bidResponseHandler(args)); + } + if (evtype === CONSTANTS.EVENTS.AUCTION_END) { + let bidWonTimeout = atsAnalyticsAdapter.context.bidWonTimeout ? atsAnalyticsAdapter.context.bidWonTimeout : 2000; + let events = []; + setTimeout(() => { + let winningBids = $$PREBID_GLOBAL$$.getAllWinningBids(); + logInfo('ATS Analytics - winning bids: ', winningBids) + // prepare format data for sending to analytics endpoint + if (handlerRequest.length) { + let wonEvent = {}; + if (handlerResponse.length) { + events = handlerRequest.filter(request => handlerResponse.filter(function (response) { + if (request.bid_id === response.bid_id) { + Object.assign(request, response); + } + })); + if (winningBids.length) { + events = events.filter(event => winningBids.filter(function (won) { + wonEvent.bid_id = won.requestId; + wonEvent.bid_won = true; + if (event.bid_id === wonEvent.bid_id) { + Object.assign(event, wonEvent); + } + })) + } + } else { + events = handlerRequest; + } + // check should we send data to analytics or not, check first cookie value _lr_sampling_rate + try { + let envelopeSourceCookieValue = storage.getCookie('_lr_env_src_ats'); + let samplingRateCookie = storage.getCookie('_lr_sampling_rate'); + if (!samplingRateCookie) { + preflightRequest(envelopeSourceCookieValue, events); + } else { + if (atsAnalyticsAdapter.shouldFireRequest(parseInt(samplingRateCookie)) && envelopeSourceCookieValue != null) { + logInfo('ATS Analytics - events to send: ', events); + sendDataToAnalytic(events); + } + } + // empty events array to not send duplicate events + events = []; + } catch (err) { + logError('ATS Analytics - preflight request encounter an error: ', err); + } + } + }, bidWonTimeout); + } +} + adaptermanager.registerAnalyticsAdapter({ adapter: atsAnalyticsAdapter, code: 'atsAnalytics', diff --git a/modules/atsAnalyticsAdapter.md b/modules/atsAnalyticsAdapter.md index 7c634f39ae2..17819ac61b3 100644 --- a/modules/atsAnalyticsAdapter.md +++ b/modules/atsAnalyticsAdapter.md @@ -17,6 +17,7 @@ Analytics adapter for Authenticated Traffic Solution(ATS), provided by LiveRamp. provider: 'atsAnalytics', options: { pid: '999', // publisher ID + bidWonTimeout: 2000 // on auction end for how long to wait for bid_won events, by default it's 2000 miliseconds, if it's not set it will be 2000 miliseconds. } } ``` diff --git a/test/spec/modules/atsAnalyticsAdapter_spec.js b/test/spec/modules/atsAnalyticsAdapter_spec.js index 7f662ffd06d..cae90a19223 100644 --- a/test/spec/modules/atsAnalyticsAdapter_spec.js +++ b/test/spec/modules/atsAnalyticsAdapter_spec.js @@ -12,11 +12,15 @@ let constants = require('src/constants.json'); export const storage = getStorageManager(); let sandbox; +let clock; +let now = new Date(); + describe('ats analytics adapter', function () { beforeEach(function () { sinon.stub(events, 'getEvents').returns([]); storage.setCookie('_lr_env_src_ats', 'true', 'Thu, 01 Jan 1970 00:00:01 GMT'); sandbox = sinon.sandbox.create(); + clock = sandbox.useFakeTimers(now.getTime()); }); afterEach(function () { @@ -25,18 +29,20 @@ describe('ats analytics adapter', function () { atsAnalyticsAdapter.disableAnalytics(); Math.random.restore(); sandbox.restore(); + clock.restore(); }); describe('track', function () { it('builds and sends request and response data', function () { sinon.stub(Math, 'random').returns(0.99); - sinon.stub(atsAnalyticsAdapter, 'shouldFireRequest').returns(true); sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); - let now = new Date(); + now.setTime(now.getTime() + 3600000); storage.setCookie('_lr_env_src_ats', 'true', now.toUTCString()); storage.setCookie('_lr_sampling_rate', '10', now.toUTCString()); + this.timeout(2100); + let initOptions = { pid: '10433394' }; @@ -62,7 +68,7 @@ describe('ats analytics adapter', function () { 'refererInfo': { 'referer': 'https://example.com/dev' }, - 'auctionId': 'a5b849e5-87d7-4205-8300-d063084fcfb7', + 'auctionId': 'a5b849e5-87d7-4205-8300-d063084fcfb7' }; // prepare general auction - response let bidResponse = { @@ -90,7 +96,7 @@ describe('ats analytics adapter', function () { let expectedAfterBid = { 'Data': [{ 'has_envelope': true, - 'adapter_version': 2, + 'adapter_version': 3, 'bidder': 'appnexus', 'bid_id': '30c77d079cdf17', 'auction_id': 'a5b849e5-87d7-4205-8300-d063084fcfb7', @@ -103,10 +109,30 @@ describe('ats analytics adapter', function () { 'response_time_stamp': '2020-02-03T14:23:11.978Z', 'currency': 'USD', 'cpm': 0.5, - 'net_revenue': true + 'net_revenue': true, + 'bid_won': true }] }; + let wonRequest = { + 'adId': '2eddfdc0c791dc', + 'mediaType': 'banner', + 'requestId': '30c77d079cdf17', + 'cpm': 0.5, + 'creativeId': 29681110, + 'currency': 'USD', + 'netRevenue': true, + 'ttl': 300, + 'auctionId': 'a5b849e5-87d7-4205-8300-d063084fcfb7', + 'statusMessage': 'Bid available', + 'responseTimestamp': 1633525319061, + 'requestTimestamp': 1633525319258, + 'bidder': 'appnexus', + 'adUnitCode': 'div-gpt-ad-1438287399331-0', + 'size': '300x250', + 'status': 'rendered' + }; + // lets simulate that some bidders timeout let bidTimeoutArgsV1 = [ { @@ -148,6 +174,14 @@ describe('ats analytics adapter', function () { // Step 5: Send auction end event events.emit(constants.EVENTS.AUCTION_END, {}); + // Step 6: Send bid won event + events.emit(constants.EVENTS.BID_WON, wonRequest); + + sandbox.stub($$PREBID_GLOBAL$$, 'getAllWinningBids').callsFake((key) => { + return [wonRequest] + }); + + clock.tick(2000); let requests = server.requests.filter(req => { return req.url.indexOf(analyticsUrl) > -1; @@ -156,13 +190,12 @@ describe('ats analytics adapter', function () { expect(requests.length).to.equal(1); let realAfterBid = JSON.parse(requests[0].requestBody); - // Step 6: assert real data after bid and expected data + + // Step 7: assert real data after bid and expected data expect(realAfterBid['Data']).to.deep.equal(expectedAfterBid['Data']); // check that the publisher ID is configured via options expect(atsAnalyticsAdapter.context.pid).to.equal(initOptions.pid); - - atsAnalyticsAdapter.shouldFireRequest.restore(); }) it('check browser is safari', function () { sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); @@ -204,7 +237,7 @@ describe('ats analytics adapter', function () { sinon.stub(atsAnalyticsAdapter, 'getUserAgent').returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25'); sinon.stub(Math, 'random').returns(0.99); // publisher can try to pass anything they want but we will set sampling rate to 100, which means we will have 1% of requests - let result = atsAnalyticsAdapter.shouldFireRequest(10); + let result = atsAnalyticsAdapter.shouldFireRequest(8); expect(result).to.equal(true); }) it('should not fire analytics request if math random is something other then 0.99', function () { From be35c1c28aab4e507b310724f1c2e23c3cacb0eb Mon Sep 17 00:00:00 2001 From: jsfledd Date: Mon, 25 Oct 2021 11:35:24 -0700 Subject: [PATCH 224/250] Nativo Bid Adapter - Refactored spread adapter for IE11 support (#7625) * Initial nativoBidAdapter document creation (js, md and spec) * Fulling working prebid using nativoBidAdapter. Support for GDPR and CCPA in user syncs. * Added defult size settings based on the largest ad unit. Added response body validation. Added consent to request url qs params. * Changed bidder endpoint url * Changed double quotes to single quotes. * Reverted package-json.lock to remove modifications from PR * Added optional bidder param 'url' so the ad server can force- match an existing placement * Lint fix. Added space after if. * Added new QS param to send various adUnit data to adapter endpopint * Updated unit test for new QS param * Added qs param to keep track of ad unit refreshes * Updated bidMap key default value * Updated refresh increment logic * Refactored spread operator for IE11 support Co-authored-by: Joshua Fledderjohn --- modules/nativoBidAdapter.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/nativoBidAdapter.js b/modules/nativoBidAdapter.js index 9b7ffef8957..06586b80102 100644 --- a/modules/nativoBidAdapter.js +++ b/modules/nativoBidAdapter.js @@ -98,7 +98,11 @@ export const spec = { ] if (placementIds.size > 0) { - params.unshift({ key: 'ntv_ptd', value: placementIds.toString() }) + // Convert Set to Array (IE 11 Safe) + const placements = [] + placementIds.forEach((value) => placements.push(value)) + // Append to query string paramters + params.unshift({ key: 'ntv_ptd', value: placements.join(',') }) } if (bidderRequest.gdprConsent) { From aee50395ad134549463a50dab529aabd085dfec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rok=20Su=C5=A1nik?= Date: Mon, 25 Oct 2021 22:25:11 +0200 Subject: [PATCH 225/250] support eids in outbrain (#7567) --- modules/outbrainBidAdapter.js | 5 +++++ test/spec/modules/outbrainBidAdapter_spec.js | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/modules/outbrainBidAdapter.js b/modules/outbrainBidAdapter.js index 3dd9c67dc98..439570e976e 100644 --- a/modules/outbrainBidAdapter.js +++ b/modules/outbrainBidAdapter.js @@ -40,6 +40,7 @@ export const spec = { const publisher = setOnAny(validBidRequests, 'params.publisher'); const bcat = setOnAny(validBidRequests, 'params.bcat'); const badv = setOnAny(validBidRequests, 'params.badv'); + const eids = setOnAny(validBidRequests, 'userIdAsEids') const cur = CURRENCY; const endpointUrl = config.getConfig('outbrain.bidderUrl'); const timeout = bidderRequest.timeout; @@ -105,6 +106,10 @@ export const spec = { deepSetValue(request, 'regs.coppa', config.getConfig('coppa') & 1) } + if (eids) { + deepSetValue(request, 'user.ext.eids', eids); + } + return { method: 'POST', url: endpointUrl, diff --git a/test/spec/modules/outbrainBidAdapter_spec.js b/test/spec/modules/outbrainBidAdapter_spec.js index a5f23240a7c..4bc163aefe6 100644 --- a/test/spec/modules/outbrainBidAdapter_spec.js +++ b/test/spec/modules/outbrainBidAdapter_spec.js @@ -2,6 +2,7 @@ import {expect} from 'chai'; import {spec} from 'modules/outbrainBidAdapter.js'; import {config} from 'src/config.js'; import {server} from 'test/mocks/xhr'; +import { createEidsArray } from 'modules/userId/eids.js'; describe('Outbrain Adapter', function () { describe('Bid request and response', function () { @@ -344,6 +345,23 @@ describe('Outbrain Adapter', function () { config.resetConfig() }); + + it('should pass extended ids', function () { + let bidRequest = { + bidId: 'bidId', + params: {}, + userIdAsEids: createEidsArray({ + idl_env: 'id-value', + }), + ...commonBidRequest, + }; + + let res = spec.buildRequests([bidRequest], commonBidderRequest); + const resData = JSON.parse(res.data) + expect(resData.user.ext.eids).to.deep.equal([ + {source: 'liveramp.com', uids: [{id: 'id-value', atype: 3}]} + ]); + }); }) describe('interpretResponse', function () { From f54ccecc29f41245d2a8639779f9413fae0636c1 Mon Sep 17 00:00:00 2001 From: JonGoSonobi Date: Mon, 25 Oct 2021 17:05:20 -0400 Subject: [PATCH 226/250] Send ortb2 object to sonobi bidding endpoint as fpd param (#7612) --- modules/sonobiBidAdapter.js | 7 +++++ test/spec/modules/sonobiBidAdapter_spec.js | 35 +++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 01966f3d6b1..c5fc07320d8 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -83,8 +83,15 @@ export const spec = { 'lib_name': 'prebid', 'lib_v': '$prebid.version$', 'us': 0, + }; + const fpd = config.getConfig('ortb2'); + + if (fpd) { + payload.fpd = JSON.stringify(fpd); + } + if (config.getConfig('userSync') && config.getConfig('userSync').syncsPerBidder) { payload.us = config.getConfig('userSync').syncsPerBidder; } diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index 05ba3f0897b..f56f4e0c12b 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -238,14 +238,17 @@ describe('SonobiBidAdapter', function () { }); describe('.buildRequests', function () { + let sandbox; beforeEach(function() { sinon.stub(userSync, 'canBidderRegisterSync'); sinon.stub(utils, 'getGptSlotInfoForAdUnitCode') - .onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'}) + .onFirstCall().returns({gptSlot: '/123123/gpt_publisher/adunit-code-3', divId: 'adunit-code-3-div-id'}); + sandbox = sinon.createSandbox(); }); afterEach(function() { userSync.canBidderRegisterSync.restore(); utils.getGptSlotInfoForAdUnitCode.restore(); + sandbox.restore(); }); let bidRequest = [{ 'schain': { @@ -333,6 +336,36 @@ describe('SonobiBidAdapter', function () { uspConsent: 'someCCPAString' }; + it('should set fpd if there is any data in ortb2', function() { + const ortb2 = { + site: { + ext: { + data: { + pageType: 'article', + category: 'tools' + } + } + }, + user: { + ext: { + data: { + registered: true, + interests: ['cars'] + } + } + } + }; + + sandbox.stub(config, 'getConfig').callsFake(key => { + const config = { + ortb2: ortb2 + }; + return utils.deepAccess(config, key); + }); + const bidRequests = spec.buildRequests(bidRequest, bidderRequests); + expect(bidRequests.data.fpd).to.equal(JSON.stringify(ortb2)); + }); + it('should populate coppa as 1 if set in config', function () { config.setConfig({coppa: true}); const bidRequests = spec.buildRequests(bidRequest, bidderRequests); From 4dc1a22482ade356830af1e1ec7902977f9fe66c Mon Sep 17 00:00:00 2001 From: nwlosinski Date: Mon, 25 Oct 2021 23:25:34 +0200 Subject: [PATCH 227/250] support for adserverTargeting in response (#7605) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Norbert Włosiński --- modules/justpremiumBidAdapter.js | 7 ++++++- test/spec/modules/justpremiumBidAdapter_spec.js | 11 +++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/justpremiumBidAdapter.js b/modules/justpremiumBidAdapter.js index fa0f939affc..56f9935ea6e 100644 --- a/modules/justpremiumBidAdapter.js +++ b/modules/justpremiumBidAdapter.js @@ -4,7 +4,7 @@ import { deepAccess } from '../src/utils.js'; const BIDDER_CODE = 'justpremium' const GVLID = 62 const ENDPOINT_URL = 'https://pre.ads.justpremium.com/v/2.0/t/xhr' -const JP_ADAPTER_VERSION = '1.8' +const JP_ADAPTER_VERSION = '1.8.1' const pixels = [] export const spec = { @@ -101,6 +101,11 @@ export const spec = { advertiserDomains: bid.adomain && bid.adomain.length > 0 ? bid.adomain : [] } } + if (bid.ext && bid.ext.pg) { + bidResponse.adserverTargeting = { + 'hb_deal_justpremium': 'jp_pg' + } + } bidResponses.push(bidResponse) } }) diff --git a/test/spec/modules/justpremiumBidAdapter_spec.js b/test/spec/modules/justpremiumBidAdapter_spec.js index 74526660f61..edc5325def3 100644 --- a/test/spec/modules/justpremiumBidAdapter_spec.js +++ b/test/spec/modules/justpremiumBidAdapter_spec.js @@ -97,7 +97,7 @@ describe('justpremium adapter', function () { expect(jpxRequest.id).to.equal(adUnits[0].params.zone) expect(jpxRequest.mediaTypes && jpxRequest.mediaTypes.banner && jpxRequest.mediaTypes.banner.sizes).to.not.equal('undefined') expect(jpxRequest.version.prebid).to.equal('$prebid.version$') - expect(jpxRequest.version.jp_adapter).to.equal('1.8') + expect(jpxRequest.version.jp_adapter).to.equal('1.8.1') expect(jpxRequest.pubcid).to.equal('0000000') expect(jpxRequest.uids.tdid).to.equal('1111111') expect(jpxRequest.uids.id5id.uid).to.equal('2222222') @@ -118,7 +118,10 @@ describe('justpremium adapter', function () { 'price': 0.52, 'format': 'lb', 'adm': 'creative code', - 'adomain': ['justpremium.com'] + 'adomain': ['justpremium.com'], + 'ext': { + 'pg': true + } }] }, 'pass': { @@ -142,6 +145,9 @@ describe('justpremium adapter', function () { meta: { advertiserDomains: ['justpremium.com'] }, + adserverTargeting: { + 'hb_deal_justpremium': 'jp_pg' + } } ] @@ -159,6 +165,7 @@ describe('justpremium adapter', function () { expect(result[0].netRevenue).to.equal(true) expect(result[0].format).to.equal('lb') expect(result[0].meta.advertiserDomains[0]).to.equal('justpremium.com') + expect(result[0].adserverTargeting).to.deep.equal({'hb_deal_justpremium': 'jp_pg'}) }) it('Verify wrong server response', function () { From df13627d34fce5a04356875f90d26fd99d0627a0 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Tue, 26 Oct 2021 06:19:48 -0400 Subject: [PATCH 228/250] Between Bid Adapter & Airgrid rtd module: fix support for ie11 (#7619) * Update betweenBidAdapter.js * Update yahoosspBidAdapter.js * Update adapterManager_spec.js * Update adapterManager_spec.js * Update airgridRtdProvider.js * Update yahoosspBidAdapter.js --- modules/airgridRtdProvider.js | 2 +- modules/betweenBidAdapter.js | 3 ++- test/spec/unit/core/adapterManager_spec.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/airgridRtdProvider.js b/modules/airgridRtdProvider.js index 8d212204da8..f5403cca3eb 100644 --- a/modules/airgridRtdProvider.js +++ b/modules/airgridRtdProvider.js @@ -33,7 +33,7 @@ export function attachScriptTagToDOM(rtdConfig) { edktInitializor.load = function(e) { var p = e || 'sdk'; var n = document.createElement('script'); - n.type = 'text/javascript'; + n.type = 'module'; n.async = true; n.src = 'https://cdn.edkt.io/' + p + '/edgekit.min.js'; document.getElementsByTagName('head')[0].appendChild(n); diff --git a/modules/betweenBidAdapter.js b/modules/betweenBidAdapter.js index 09c8678d1ff..b2f63488e12 100644 --- a/modules/betweenBidAdapter.js +++ b/modules/betweenBidAdapter.js @@ -6,6 +6,7 @@ const BIDDER_CODE = 'between'; let ENDPOINT = 'https://ads.betweendigital.com/adjson?t=prebid'; const CODE_TYPES = ['inpage', 'preroll', 'midroll', 'postroll']; +const includes = require('core-js-pure/features/array/includes.js'); export const spec = { code: BIDDER_CODE, aliases: ['btw'], @@ -53,7 +54,7 @@ export const spec = { params.mind = video.mind; params.pos = 'atf'; ENDPOINT += '&jst=pvc'; - params.codeType = CODE_TYPES.includes(video.codeType) ? video.codeType : 'inpage'; + params.codeType = includes(CODE_TYPES, video.codeType) ? video.codeType : 'inpage'; } if (i.params.itu !== undefined) { diff --git a/test/spec/unit/core/adapterManager_spec.js b/test/spec/unit/core/adapterManager_spec.js index 75fd74748a0..30aa30c52e9 100644 --- a/test/spec/unit/core/adapterManager_spec.js +++ b/test/spec/unit/core/adapterManager_spec.js @@ -456,7 +456,8 @@ describe('adapterManager tests', function () { }); it('should call spec\'s onBidderError callback when callBidderError is called', function () { - const bidderRequest = getBidRequests().find(bidRequest => bidRequest.bidderCode === bidder); + const bidRequests = getBidRequests(); + const bidderRequest = find(bidRequests, bidRequest => bidRequest.bidderCode === bidder); const xhrErrorMock = { status: 500, statusText: 'Internal Server Error' From 6c14892fb673f33b4024e8374d31fdc8ff1b3921 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Tue, 26 Oct 2021 03:31:43 -0700 Subject: [PATCH 229/250] Yahoo Bid Adapter: Support IE11 -> includes to indexOf (#7627) * includes to indexOf * lint --- modules/yahoosspBidAdapter.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/yahoosspBidAdapter.js b/modules/yahoosspBidAdapter.js index ac91596f8d0..101cb0ca9e3 100644 --- a/modules/yahoosspBidAdapter.js +++ b/modules/yahoosspBidAdapter.js @@ -144,9 +144,9 @@ function getAdapterMode() { function getResponseFormat(bid) { const adm = bid.adm; - if (adm.includes('o2playerSettings') || adm.includes('YAHOO.VideoPlatform.VideoPlayer') || adm.includes('AdPlacement')) { + if (adm.indexOf('o2playerSettings') !== -1 || adm.indexOf('YAHOO.VideoPlatform.VideoPlayer') !== -1 || adm.indexOf('AdPlacement') !== -1) { return BANNER; - } else if (adm.includes('VAST')) { + } else if (adm.indexOf('VAST') !== -1) { return VIDEO; } }; @@ -188,23 +188,23 @@ function validateAppendObject(validationType, allowedKeys, inputObject, appendTo for (const objectKey in inputObject) { switch (validationType) { case 'string': - if (allowedKeys.includes(objectKey) && isStr(inputObject[objectKey])) { + if (allowedKeys.indexOf(objectKey) !== -1 && isStr(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; }; break; case 'number': - if (allowedKeys.includes(objectKey) && isNumber(inputObject[objectKey])) { + if (allowedKeys.indexOf(objectKey) !== -1 && isNumber(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; }; break; case 'array': - if (allowedKeys.includes(objectKey) && isArray(inputObject[objectKey])) { + if (allowedKeys.indexOf(objectKey) !== -1 && isArray(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; }; break; case 'object': - if (allowedKeys.includes(objectKey) && isPlainObject(inputObject[objectKey])) { + if (allowedKeys.indexOf(objectKey) !== -1 && isPlainObject(inputObject[objectKey])) { outputObject[objectKey] = inputObject[objectKey]; }; break; From 523a16c3cc0ce71235add8493b4336164800c50c Mon Sep 17 00:00:00 2001 From: PWyrembak Date: Tue, 26 Oct 2021 15:15:39 +0300 Subject: [PATCH 230/250] TrustX Bid Adapter: fix for segments format (#7629) * Add trustx adapter and tests for it * update integration example * Update trustx adapter * Post-review fixes of Trustx adapter * Code improvement for trustx adapter: changed default price type from gross to net * Update TrustX adapter to support the 1.0 version * Make requested changes for TrustX adapter * Updated markdown file for TrustX adapter * Fix TrustX adapter and spec file * Update TrustX adapter: r parameter was added to ad request as cache buster * Add support of gdpr to Trustx Bid Adapter * Add wtimeout to ad request params for TrustX Bid Adapter * TrustX Bid Adapter: remove last ampersand in the ad request * Update TrustX Bid Adapter to support identical uids in parameters * Update TrustX Bid Adapter to ignore bids that sizes do not match the size of the request * Update TrustX Bid Adapter to support instream and outstream video * Added wrapperType and wrapperVersion parameters in ad request for TrustX Bid Adapter * Update TrustX Bid Adapter to use refererInfo instead depricated function utils.getTopWindowUrl * HOTFIX for referrer encodind in TrustX Bid Adapter * Fix test for TrustX Bid Adapter * TrustX Bid Adapter: added keywords passing support * TrustX Bid Adapter: added us_privacy parameter in bid request * TrustX Bid Adapter: fix us_privacy parameter in bid request * Fix alias error for TrustX Bid Adapter * TrustX Bid Adapter: added new request format * TrustX Bid adapter: fix new format endpoint * TrustX Bid Adapter: update md file to support useNewFormat parameter * TrustX Bid Adapter: added additional sync url * TrustX Bid Adapter: added check for enabled syncs number + added gdpr data to sync urls * TrustX Bid Adapter: added support of meta.advertiserDomains * TrustX Bid Adapter: added support rtd permutive and jwplayer for new and old request format * TrustX Bid Adapter: Use new format by default + new keywords logic * TrustX Bid Adapter: fix md file * TrustX: Convert all id-like request fields to a string * TrustX: added vastUrl support * TrustX: fix segments format --- modules/trustxBidAdapter.js | 14 ++++++++------ test/spec/modules/trustxBidAdapter_spec.js | 6 +++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/trustxBidAdapter.js b/modules/trustxBidAdapter.js index e74dbd6b4d8..9907d1b2ff4 100644 --- a/modules/trustxBidAdapter.js +++ b/modules/trustxBidAdapter.js @@ -429,9 +429,10 @@ function addSegments(name, segName, segments, data, bidConfigName) { if (segments && segments.length) { data.push({ name: name, - segment: segments.map((seg) => { - return {name: segName, value: seg}; - }) + segment: segments + .map((seg) => seg && (seg.id || seg)) + .filter((seg) => seg && (typeof seg === 'string' || typeof seg === 'number')) + .map((seg) => ({ name: segName, value: seg.toString() })) }); } else if (bidConfigName) { const configData = config.getConfig('ortb2.user.data'); @@ -445,9 +446,10 @@ function addSegments(name, segName, segments, data, bidConfigName) { if (segData && segData.length) { data.push({ name: name, - segment: segData.map((seg) => { - return {name: segName, value: seg}; - }) + segment: segData + .map((seg) => seg && (seg.id || seg)) + .filter((seg) => seg && (typeof seg === 'string' || typeof seg === 'number')) + .map((seg) => ({ name: segName, value: seg.toString() })) }); } } diff --git a/test/spec/modules/trustxBidAdapter_spec.js b/test/spec/modules/trustxBidAdapter_spec.js index 435f0402f3a..73bc9d45365 100644 --- a/test/spec/modules/trustxBidAdapter_spec.js +++ b/test/spec/modules/trustxBidAdapter_spec.js @@ -402,7 +402,7 @@ describe('TrustXAdapter', function () { }); it('if segment is present in permutive targeting, payload must have right params', function () { - const permSegments = ['test_perm_1', 'test_perm_2']; + const permSegments = [{id: 'test_perm_1'}, {id: 'test_perm_2'}]; const bidRequestsWithPermutiveTargeting = bidRequests.map((bid) => { return Object.assign({ rtd: { @@ -421,8 +421,8 @@ describe('TrustXAdapter', function () { expect(payload.user.data).to.deep.equal([{ name: 'permutive', segment: [ - {name: 'p_standard', value: permSegments[0]}, - {name: 'p_standard', value: permSegments[1]} + {name: 'p_standard', value: permSegments[0].id}, + {name: 'p_standard', value: permSegments[1].id} ] }]); }); From d0605aeb28f5b4c7b4d4c2c57f1a35c3410b7e62 Mon Sep 17 00:00:00 2001 From: Rikard Drugge <38916683+rikdru@users.noreply.github.com> Date: Tue, 26 Oct 2021 16:02:39 +0200 Subject: [PATCH 231/250] Delta Projects bid adapter: add new bid adapter (#7564) * Delta Projects bid adapter: add new bid adapter * Delta Projects bid adapter: revert accidental change to hello_world.html * Remove unsupported functions by IE, add support for floor price remove bidderParams which is not currently supported remove bid parameter floor remove unused function so linting is happy Remove unused params in tests use adservercurrency include .js to make linter happy again Co-authored-by: Boris-Tang --- modules/deltaprojectsBidAdapter.js | 252 +++++++++++ modules/deltaprojectsBidAdapter.md | 32 ++ .../modules/deltaprojectsBidAdapter_spec.js | 399 ++++++++++++++++++ 3 files changed, 683 insertions(+) create mode 100644 modules/deltaprojectsBidAdapter.js create mode 100644 modules/deltaprojectsBidAdapter.md create mode 100644 test/spec/modules/deltaprojectsBidAdapter_spec.js diff --git a/modules/deltaprojectsBidAdapter.js b/modules/deltaprojectsBidAdapter.js new file mode 100644 index 00000000000..33df5bd252e --- /dev/null +++ b/modules/deltaprojectsBidAdapter.js @@ -0,0 +1,252 @@ +import { registerBidder } from '../src/adapters/bidderFactory.js'; +import { BANNER } from '../src/mediaTypes.js'; +import { + _each, _map, isFn, isNumber, createTrackPixelHtml, deepAccess, parseUrl, logWarn, logError +} from '../src/utils.js'; +import {config} from '../src/config.js'; + +export const BIDDER_CODE = 'deltaprojects'; +export const BIDDER_ENDPOINT_URL = 'https://d5p.de17a.com/dogfight/prebid'; +export const USERSYNC_URL = 'https://userservice.de17a.com/getuid/prebid'; + +/** -- isBidRequestValid --**/ +function isBidRequestValid(bid) { + if (!bid) return false; + + if (bid.bidder !== BIDDER_CODE) return false; + + // publisher id is required + const publisherId = deepAccess(bid, 'params.publisherId') + if (!publisherId) { + logError('Invalid bid request, missing publisher id in params'); + return false; + } + + return true; +} + +/** -- Build requests --**/ +function buildRequests(validBidRequests, bidderRequest) { + /** == shared ==**/ + // -- build id + const id = bidderRequest.auctionId; + + // -- build site + const loc = parseUrl(bidderRequest.refererInfo.referer); + const publisherId = setOnAny(validBidRequests, 'params.publisherId'); + const siteId = setOnAny(validBidRequests, 'params.siteId'); + const site = { + id: siteId, + domain: loc.hostname, + page: loc.href, + ref: loc.href, + publisher: { id: publisherId }, + }; + + // -- build device + const ua = navigator.userAgent; + const device = { + ua, + w: screen.width, + h: screen.height + } + + // -- build user, reg + let user = { ext: {} }; + const regs = { ext: {} }; + const gdprConsent = bidderRequest && bidderRequest.gdprConsent; + if (gdprConsent) { + user.ext = { consent: gdprConsent.consentString }; + if (typeof gdprConsent.gdprApplies == 'boolean') { + regs.ext.gdpr = gdprConsent.gdprApplies ? 1 : 0 + } + } + + // -- build tmax + let tmax = (bidderRequest && bidderRequest.timeout > 0) ? bidderRequest.timeout : undefined; + + // build bid specific + return validBidRequests.map(validBidRequest => { + const openRTBRequest = buildOpenRTBRequest(validBidRequest, id, site, device, user, tmax, regs); + return { + method: 'POST', + url: BIDDER_ENDPOINT_URL, + data: openRTBRequest, + options: { contentType: 'application/json' }, + bids: [validBidRequest], + }; + }); +} + +function buildOpenRTBRequest(validBidRequest, id, site, device, user, tmax, regs) { + // build cur + const currency = config.getConfig('currency.adServerCurrency') || deepAccess(validBidRequest, 'params.currency'); + const cur = currency && [currency]; + + // build impression + const impression = buildImpression(validBidRequest, currency); + + // build test + const test = deepAccess(validBidRequest, 'params.test') ? 1 : 0 + + const at = 1 + + // build source + const source = { + tid: validBidRequest.transactionId, + fd: 1, + } + + return { + id, + at, + imp: [impression], + site, + device, + user, + test, + tmax, + cur, + source, + regs, + ext: {}, + }; +} + +function buildImpression(bid, currency) { + const impression = { + id: bid.bidId, + tagid: bid.params.tagId, + ext: {}, + }; + + const bannerMediaType = deepAccess(bid, `mediaTypes.${BANNER}`); + impression.banner = buildImpressionBanner(bid, bannerMediaType); + + // bid floor + const bidFloor = getBidFloor(bid, BANNER, '*', currency); + if (bidFloor) { + impression.bidfloor = bidFloor.floor; + impression.bidfloorcur = bidFloor.currency; + } + + return impression; +} + +function buildImpressionBanner(bid, bannerMediaType) { + const bannerSizes = (bannerMediaType && bannerMediaType.sizes) || bid.sizes; + return { + format: _map(bannerSizes, ([width, height]) => ({ w: width, h: height })), + }; +} + +/** -- Interpret response --**/ +function interpretResponse(serverResponse) { + if (!serverResponse.body) { + logWarn('Response body is invalid, return !!'); + return []; + } + + const { body: { id, seatbid, cur } } = serverResponse; + if (!id || !seatbid) { + logWarn('Id / seatbid of response is invalid, return !!'); + return []; + } + + const bidResponses = []; + + _each(seatbid, seatbid => { + _each(seatbid.bid, bid => { + const bidObj = { + requestId: bid.impid, + cpm: parseFloat(bid.price), + width: parseInt(bid.w), + height: parseInt(bid.h), + creativeId: bid.crid || bid.id, + dealId: bid.dealid || null, + currency: cur, + netRevenue: true, + ttl: 60, + }; + + bidObj.mediaType = BANNER; + bidObj.ad = bid.adm; + if (bid.nurl) { + bidObj.ad += createTrackPixelHtml(decodeURIComponent(bid.nurl)); + } + if (bid.ext) { + bidObj[BIDDER_CODE] = bid.ext; + } + bidResponses.push(bidObj); + }); + }); + return bidResponses; +} + +/** -- On Bid Won -- **/ +function onBidWon(bid) { + let cpm = bid.cpm; + if (bid.currency && bid.currency !== bid.originalCurrency && typeof bid.getCpmInNewCurrency === 'function') { + cpm = bid.getCpmInNewCurrency(bid.originalCurrency); + } + const wonPrice = Math.round(cpm * 1000000); + const wonPriceMacroPatten = /\$\{AUCTION_PRICE:B64\}/g; + bid.ad = bid.ad.replace(wonPriceMacroPatten, wonPrice); +} + +/** -- Get user syncs --**/ +function getUserSyncs(syncOptions, serverResponses, gdprConsent) { + const syncs = [] + + if (syncOptions.pixelEnabled) { + let gdprParams; + if (gdprConsent) { + if (typeof gdprConsent.gdprApplies === 'boolean') { + gdprParams = `?gdpr=${Number(gdprConsent.gdprApplies)}&gdpr_consent=${gdprConsent.consentString}`; + } else { + gdprParams = `?gdpr_consent=${gdprConsent.consentString}`; + } + } else { + gdprParams = ''; + } + syncs.push({ + type: 'image', + url: USERSYNC_URL + gdprParams + }); + } + return syncs; +} + +/** -- Get bid floor --**/ +export function getBidFloor(bid, mediaType, size, currency) { + if (isFn(bid.getFloor)) { + const bidFloorCurrency = currency || 'USD'; + const bidFloor = bid.getFloor({currency: bidFloorCurrency, mediaType: mediaType, size: size}); + if (isNumber(bidFloor.floor)) { + return bidFloor; + } + } +} + +/** -- Helper methods --**/ +function setOnAny(collection, key) { + for (let i = 0, result; i < collection.length; i++) { + result = deepAccess(collection[i], key); + if (result) { + return result; + } + } +} + +/** -- Register -- */ +export const spec = { + code: BIDDER_CODE, + supportedMediaTypes: [BANNER], + isBidRequestValid, + buildRequests, + interpretResponse, + onBidWon, + getUserSyncs, +}; + +registerBidder(spec); diff --git a/modules/deltaprojectsBidAdapter.md b/modules/deltaprojectsBidAdapter.md new file mode 100644 index 00000000000..97cef4dd228 --- /dev/null +++ b/modules/deltaprojectsBidAdapter.md @@ -0,0 +1,32 @@ +# Overview + +``` +Module Name: Delta Projects Bid Adapter +Module Type: Bidder Adapter +Maintainer: dev@deltaprojects.com +``` + +# Description + +Connects to Delta Projects DSP for bids. + +# Test Parameters +``` +// define banner unit +var bannerUnit = { + code: 'div-gpt-ad-1460505748561-0', + mediaTypes: { + banner: { + sizes: [[300, 250], [300,600]], + } + }, + // Replace this object to test a new Adapter! + bids: [{ + bidder: 'deltaprojects', + params: { + publisherId: '4' //required + } + }] +}; +``` + diff --git a/test/spec/modules/deltaprojectsBidAdapter_spec.js b/test/spec/modules/deltaprojectsBidAdapter_spec.js new file mode 100644 index 00000000000..382415eab62 --- /dev/null +++ b/test/spec/modules/deltaprojectsBidAdapter_spec.js @@ -0,0 +1,399 @@ +import { expect } from 'chai'; +import { + BIDDER_CODE, + BIDDER_ENDPOINT_URL, + spec, USERSYNC_URL, + getBidFloor +} from 'modules/deltaprojectsBidAdapter.js'; + +const BID_REQ_REFER = 'http://example.com/page?param=val'; + +describe('deltaprojectsBidAdapter', function() { + describe('isBidRequestValid', function () { + function makeBid() { + return { + bidder: BIDDER_CODE, + params: { + publisherId: '12345' + }, + adUnitCode: 'adunit-code', + sizes: [ + [300, 250], + ], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + }; + } + + it('should return true when bidder set correctly', function () { + expect(spec.isBidRequestValid(makeBid())).to.equal(true); + }); + + it('should return false when bid request is null', function () { + expect(spec.isBidRequestValid(undefined)).to.equal(false); + }); + + it('should return false when bidder not set correctly', function () { + let bid = makeBid(); + delete bid.bidder; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + + it('should return false when publisher id is not set', function () { + let bid = makeBid(); + delete bid.params.publisherId; + expect(spec.isBidRequestValid(bid)).to.equal(false); + }); + }); + + describe('buildRequests', function () { + const BIDREQ = { + bidder: BIDDER_CODE, + params: { + tagId: '403370', + siteId: 'example.com', + }, + sizes: [ + [300, 250], + ], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + } + const bidRequests = [BIDREQ]; + const bannerRequest = spec.buildRequests(bidRequests, {refererInfo: { referer: BID_REQ_REFER }})[0]; + const bannerRequestBody = bannerRequest.data; + + it('send bid request with test tag if it is set in the param', function () { + const TEST_TAG = 1; + const bidRequest = Object.assign({}, BIDREQ, { + params: { ...BIDREQ.params, test: TEST_TAG }, + }); + const bidderRequest = { refererInfo: { referer: BID_REQ_REFER } }; + const request = spec.buildRequests([bidRequest], bidderRequest)[0]; + expect(request.data.test).to.equal(TEST_TAG); + }); + + it('send bid request with correct timeout', function () { + const TMAX = 10; + const bidderRequest = { refererInfo: { referer: BID_REQ_REFER }, timeout: TMAX }; + const request = spec.buildRequests(bidRequests, bidderRequest)[0]; + expect(request.data.tmax).to.equal(TMAX); + }); + + it('send bid request to the correct endpoint URL', function () { + expect(bannerRequest.url).to.equal(BIDDER_ENDPOINT_URL); + }); + + it('sends bid request to our endpoint via POST', function () { + expect(bannerRequest.method).to.equal('POST'); + }); + + it('sends screen dimensions', function () { + expect(bannerRequestBody.device.w).to.equal(screen.width); + expect(bannerRequestBody.device.h).to.equal(screen.height); + }); + + it('includes the ad size in the bid request', function () { + expect(bannerRequestBody.imp[0].banner.format[0].w).to.equal(BIDREQ.sizes[0][0]); + expect(bannerRequestBody.imp[0].banner.format[0].h).to.equal(BIDREQ.sizes[0][1]); + }); + + it('sets domain and href correctly', function () { + expect(bannerRequestBody.site.domain).to.equal(BIDREQ.params.siteId); + expect(bannerRequestBody.site.page).to.equal(BID_REQ_REFER); + }); + + const gdprBidRequests = [{ + bidder: BIDDER_CODE, + params: { + tagId: '403370', + siteId: 'example.com' + }, + sizes: [ + [300, 250] + ], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475' + }]; + const consentString = 'BOJ/P2HOJ/P2HABABMAAAAAZ+A=='; + + const GDPR_REQ_REFERER = 'http://localhost:9876/' + function getGdprRequestBody(gdprApplies, consentString) { + const gdprRequest = spec.buildRequests(gdprBidRequests, { + gdprConsent: { + gdprApplies: gdprApplies, + consentString: consentString, + }, + refererInfo: { + referer: GDPR_REQ_REFERER, + }, + })[0]; + return gdprRequest.data; + } + + it('should handle gdpr applies being present and true', function() { + const gdprRequestBody = getGdprRequestBody(true, consentString); + expect(gdprRequestBody.regs.ext.gdpr).to.equal(1); + expect(gdprRequestBody.user.ext.consent).to.equal(consentString); + }) + + it('should handle gdpr applies being present and false', function() { + const gdprRequestBody = getGdprRequestBody(false, consentString); + expect(gdprRequestBody.regs.ext.gdpr).to.equal(0); + expect(gdprRequestBody.user.ext.consent).to.equal(consentString); + }) + + it('should handle gdpr applies being undefined', function() { + const gdprRequestBody = getGdprRequestBody(undefined, consentString); + expect(gdprRequestBody.regs).to.deep.equal({ext: {}}); + expect(gdprRequestBody.user.ext.consent).to.equal(consentString); + }) + + it('should handle gdpr consent being undefined', function() { + const gdprRequest = spec.buildRequests(gdprBidRequests, {refererInfo: { referer: GDPR_REQ_REFERER }})[0]; + const gdprRequestBody = gdprRequest.data; + expect(gdprRequestBody.regs).to.deep.equal({ ext: {} }); + expect(gdprRequestBody.user).to.deep.equal({ ext: {} }); + }) + }); + + describe('interpretResponse', function () { + const bidRequests = [ + { + bidder: BIDDER_CODE, + params: { + tagId: '403370', + siteId: 'example.com', + currency: 'USD', + }, + sizes: [ + [300, 250], + ], + bidId: '30b31c1838de1e', + bidderRequestId: '22edbae2733bf6', + auctionId: '1d1a030790a475', + }, + ]; + const request = spec.buildRequests(bidRequests, {refererInfo: { referer: BID_REQ_REFER }})[0]; + function makeResponse() { + return { + body: { + id: '5e5c23a5ba71e78', + seatbid: [ + { + bid: [ + { + id: '6vmb3isptf', + crid: 'deltaprojectscreative', + impid: '322add653672f68', + price: 1.22, + adm: '', + attr: [5], + h: 90, + nurl: 'http://nurl', + w: 728, + } + ], + seat: 'MOCK' + } + ], + bidid: '5e5c23a5ba71e78', + cur: 'USD' + } + }; + } + const expectedBid = { + requestId: '322add653672f68', + cpm: 1.22, + width: 728, + height: 90, + creativeId: 'deltaprojectscreative', + dealId: null, + currency: 'USD', + netRevenue: true, + mediaType: 'banner', + ttl: 60, + ad: '
' + }; + + it('should get incorrect bid response if response body is missing', function () { + let response = makeResponse(); + delete response.body; + let result = spec.interpretResponse(response, request); + expect(result.length).to.equal(0); + }); + + it('should get incorrect bid response if id or seat id of response body is missing', function () { + let response1 = makeResponse(); + delete response1.body.id; + let result1 = spec.interpretResponse(response1, request); + expect(result1.length).to.equal(0); + + let response2 = makeResponse(); + delete response2.body.seatbid; + let result2 = spec.interpretResponse(response2, request); + expect(result2.length).to.equal(0); + }); + + it('should get the correct bid response', function () { + let result = spec.interpretResponse(makeResponse(), request); + expect(result.length).to.equal(1); + expect(result[0]).to.deep.equal(expectedBid); + }); + + it('should handle a missing crid', function () { + let noCridResponse = makeResponse(); + delete noCridResponse.body.seatbid[0].bid[0].crid; + const fallbackCrid = noCridResponse.body.seatbid[0].bid[0].id; + let noCridResult = Object.assign({}, expectedBid, {'creativeId': fallbackCrid}); + let result = spec.interpretResponse(noCridResponse, request); + expect(result.length).to.equal(1); + expect(result[0]).to.deep.equal(noCridResult); + }); + + it('should handle a missing nurl', function () { + let noNurlResponse = makeResponse(); + delete noNurlResponse.body.seatbid[0].bid[0].nurl; + let noNurlResult = Object.assign({}, expectedBid); + noNurlResult.ad = ''; + let result = spec.interpretResponse(noNurlResponse, request); + expect(result.length).to.equal(1); + expect(result[0]).to.deep.equal(noNurlResult); + }); + + it('handles empty bid response', function () { + let response = { + body: { + id: '5e5c23a5ba71e78', + seatbid: [] + } + }; + let result = spec.interpretResponse(response, request); + expect(result.length).to.equal(0); + }); + + it('should keep custom properties', () => { + const customProperties = {test: 'a test message', param: {testParam: 1}}; + const expectedResult = Object.assign({}, expectedBid, {[spec.code]: customProperties}); + const response = makeResponse(); + response.body.seatbid[0].bid[0].ext = customProperties; + const result = spec.interpretResponse(response, request); + expect(result.length).to.equal(1); + expect(result[0]).to.deep.equal(expectedResult); + }); + }); + + describe('onBidWon', function () { + const OPEN_RTB_RESP = { + body: { + id: 'abc', + seatbid: [ + { + bid: [ + { + 'id': 'abc*123*456', + 'impid': 'xxxxxxx', + 'price': 46.657196, + 'adm': '