From 31c53ac0c80bffaf3b93b3a7f321a7395bdd8307 Mon Sep 17 00:00:00 2001 From: Patrick McCann Date: Fri, 13 Oct 2023 08:40:03 -0400 Subject: [PATCH] Revert "Utiq ID submodule: Update submodule name and parameters (#10587)" This reverts commit 86736ac4d5ee97cdecf772b68b37c36cca96f1e6. --- modules/.submodules.json | 2 +- modules/{utiqIdSystem.js => utiqSystem.js} | 8 +++--- modules/{utiqIdSystem.md => utiqSystem.md} | 7 ++++- ...tiqIdSystem_spec.js => utiqSystem_spec.js} | 28 +++++++++---------- 4 files changed, 25 insertions(+), 20 deletions(-) rename modules/{utiqIdSystem.js => utiqSystem.js} (96%) rename modules/{utiqIdSystem.md => utiqSystem.md} (54%) rename test/spec/modules/{utiqIdSystem_spec.js => utiqSystem_spec.js} (86%) diff --git a/modules/.submodules.json b/modules/.submodules.json index 8253307c36b..5699cbfdc87 100644 --- a/modules/.submodules.json +++ b/modules/.submodules.json @@ -38,7 +38,7 @@ "tapadIdSystem", "teadsIdSystem", "tncIdSystem", - "utiqIdSystem", + "utiqSystem", "uid2IdSystem", "euidIdSystem", "unifiedIdSystem", diff --git a/modules/utiqIdSystem.js b/modules/utiqSystem.js similarity index 96% rename from modules/utiqIdSystem.js rename to modules/utiqSystem.js index 8228da3a629..473dc5854a9 100644 --- a/modules/utiqIdSystem.js +++ b/modules/utiqSystem.js @@ -1,7 +1,7 @@ /** * This module adds Utiq provided by Utiq SA/NV to the User ID module * The {@link module:modules/userId} module is required - * @module modules/utiqIdSystem + * @module modules/utiqSystem * @requires module:modules/userId */ import { logInfo } from '../src/utils.js'; @@ -9,7 +9,7 @@ import { submodule } from '../src/hook.js'; import { getStorageManager } from '../src/storageManager.js'; import { MODULE_TYPE_UID } from '../src/activities/modules.js'; -const MODULE_NAME = 'utiqId'; +const MODULE_NAME = 'utiq'; const LOG_PREFIX = 'Utiq module'; export const storage = getStorageManager({ @@ -56,7 +56,7 @@ function getUtiqFromStorage() { } /** @type {Submodule} */ -export const utiqIdSubmodule = { +export const utiqSubmodule = { /** * Used to link submodule with config * @type {string} @@ -135,4 +135,4 @@ export const utiqIdSubmodule = { } }; -submodule('userId', utiqIdSubmodule); +submodule('userId', utiqSubmodule); diff --git a/modules/utiqIdSystem.md b/modules/utiqSystem.md similarity index 54% rename from modules/utiqIdSystem.md rename to modules/utiqSystem.md index c7f4f95827f..d2c53480383 100644 --- a/modules/utiqIdSystem.md +++ b/modules/utiqSystem.md @@ -5,7 +5,7 @@ Utiq ID Module. First, make sure to add the utiq submodule to your Prebid.js package with: ``` -gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,utiqIdSystem +gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,utiqSystem ``` ## Parameter Descriptions @@ -15,3 +15,8 @@ gulp build --modules=userId,adfBidAdapter,ixBidAdapter,prebidServerBidAdapter,ut | name | String | The name of the module | `"utiq"` | | params | Object | Object with configuration parameters for utiq User Id submodule | - | | params.maxDelayTime | Integer | Max amount of time (in seconds) before looking into storage for data | 2500 | +| bidders | Array of Strings | An array of bidder codes to which this user ID may be sent. Currently required and supporting AdformOpenRTB | [`"adf"`, `"adformPBS"`, `"ix"`] | +| storage | Object | Local storage configuration object | - | +| storage.type | String | Type of the storage that would be used to store user ID. Must be `"html5"` to utilise HTML5 local storage. | `"html5"` | +| storage.name | String | The name of the key in local storage where the user ID will be stored. | `"utiq"` | +| storage.expires | Integer | How long (in days) the user ID information will be stored. For safety reasons, this information is required. | `1` | diff --git a/test/spec/modules/utiqIdSystem_spec.js b/test/spec/modules/utiqSystem_spec.js similarity index 86% rename from test/spec/modules/utiqIdSystem_spec.js rename to test/spec/modules/utiqSystem_spec.js index 62754d39fa3..afeeea7c3ea 100644 --- a/test/spec/modules/utiqIdSystem_spec.js +++ b/test/spec/modules/utiqSystem_spec.js @@ -1,8 +1,8 @@ import { expect } from 'chai'; -import { utiqIdSubmodule } from 'modules/utiqIdSystem.js'; -import { storage } from 'modules/utiqIdSystem.js'; +import { utiqSubmodule } from 'modules/utiqSystem.js'; +import { storage } from 'modules/utiqSystem.js'; -describe('utiqIdSystem', () => { +describe('utiqSystem', () => { const utiqPassKey = 'utiqPass'; const getStorageData = (idGraph) => { @@ -17,7 +17,7 @@ describe('utiqIdSystem', () => { }; it('should have the correct module name declared', () => { - expect(utiqIdSubmodule.name).to.equal('utiqId'); + expect(utiqSubmodule.name).to.equal('utiq'); }); describe('utiq getId()', () => { @@ -26,13 +26,13 @@ describe('utiqIdSystem', () => { }); it('it should return object with key callback', () => { - expect(utiqIdSubmodule.getId()).to.have.property('callback'); + expect(utiqSubmodule.getId()).to.have.property('callback'); }); it('should return object with key callback with value type - function', () => { storage.setDataInLocalStorage(utiqPassKey, JSON.stringify(getStorageData())); - expect(utiqIdSubmodule.getId()).to.have.property('callback'); - expect(typeof utiqIdSubmodule.getId().callback).to.be.equal('function'); + expect(utiqSubmodule.getId()).to.have.property('callback'); + expect(typeof utiqSubmodule.getId().callback).to.be.equal('function'); }); it('tests if localstorage & JSON works properly ', () => { @@ -50,7 +50,7 @@ describe('utiqIdSystem', () => { 'atid': 'atidValue', }; storage.setDataInLocalStorage(utiqPassKey, JSON.stringify(getStorageData(idGraph))); - const response = utiqIdSubmodule.getId(); + const response = utiqSubmodule.getId(); expect(response).to.have.property('id'); expect(response.id).to.have.property('utiq'); expect(response.id.utiq).to.be.equal('atidValue'); @@ -61,7 +61,7 @@ describe('utiqIdSystem', () => { 'domain': 'test.domain', 'atid': 'atidValue', }; - const response = utiqIdSubmodule.getId(); + const response = utiqSubmodule.getId(); expect(response).to.have.property('callback'); expect(response.callback.toString()).contain('result(callback)'); @@ -82,7 +82,7 @@ describe('utiqIdSystem', () => { 'atid': 'atidValue', }; - const response = utiqIdSubmodule.getId(); + const response = utiqSubmodule.getId(); expect(response).to.have.property('callback'); expect(response.callback.toString()).contain('result(callback)'); @@ -105,7 +105,7 @@ describe('utiqIdSystem', () => { 'atid': 'atidValue', }; - const response = utiqIdSubmodule.getId({params: {maxDelayTime: 200}}); + const response = utiqSubmodule.getId({params: {maxDelayTime: 200}}); expect(response).to.have.property('callback'); expect(response.callback.toString()).contain('result(callback)'); @@ -138,7 +138,7 @@ describe('utiqIdSystem', () => { ]; VALID_API_RESPONSES.forEach(responseData => { it('should return a newly constructed object with the utiq for a payload with {utiq: value}', () => { - expect(utiqIdSubmodule.decode(responseData.payload)).to.deep.equal( + expect(utiqSubmodule.decode(responseData.payload)).to.deep.equal( {utiq: responseData.expected} ); }); @@ -146,7 +146,7 @@ describe('utiqIdSystem', () => { [{}, '', {foo: 'bar'}].forEach((response) => { it(`should return null for an invalid response "${JSON.stringify(response)}"`, () => { - expect(utiqIdSubmodule.decode(response)).to.be.null; + expect(utiqSubmodule.decode(response)).to.be.null; }); }); }); @@ -177,7 +177,7 @@ describe('utiqIdSystem', () => { window.dispatchEvent(new MessageEvent('message', eventData)); - const response = utiqIdSubmodule.getId(); + const response = utiqSubmodule.getId(); expect(response).to.have.property('id'); expect(response.id).to.have.property('utiq'); expect(response.id.utiq).to.be.equal('atidValue');