From 9a2a9d37d2d3a32da99de3b3ef6d8db5e60dd3e5 Mon Sep 17 00:00:00 2001 From: wiem Date: Fri, 21 Oct 2022 11:47:54 +0200 Subject: [PATCH 1/2] update with live-connect last change --- modules/liveIntentIdSystem.js | 6 +----- package-lock.json | 16 ++++++++-------- package.json | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index 724bf5ece6a..683dab2811d 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -10,7 +10,6 @@ import { submodule } from '../src/hook.js'; import { LiveConnect } from 'live-connect-js/esm/initializer.js'; import { gdprDataHandler, uspDataHandler } from '../src/adapterManager.js'; import { getStorageManager } from '../src/storageManager.js'; -import { MinimalLiveConnect } from 'live-connect-js/esm/minimal-live-connect.js'; const MODULE_NAME = 'liveIntentId'; export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME}); @@ -113,7 +112,7 @@ function initializeLiveConnect(configParams) { // 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); + liveConnect = LiveConnect(liveConnectConfig, storage, calls); if (configParams.emailHash) { liveConnect.push({ hash: configParams.emailHash }) } @@ -139,9 +138,6 @@ export const liveIntentIdSubmodule = { setModuleMode(mode) { this.moduleMode = mode }, - getInitializer() { - return this.moduleMode === 'minimal' ? MinimalLiveConnect : LiveConnect - }, /** * decode the stored id value for passing to bid requests. Note that lipb object is a wrapper for everything, and diff --git a/package-lock.json b/package-lock.json index ffc179f2914..e0a655fde2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "prebid.js", - "version": "7.21.0-pre", + "version": "7.23.0-pre", "license": "Apache-2.0", "dependencies": { "@babel/core": "^7.16.7", @@ -22,7 +22,7 @@ "express": "^4.15.4", "fun-hooks": "^0.9.9", "just-clone": "^1.0.2", - "live-connect-js": "2.4.0" + "live-connect-js": "3.0.0-alpha.1" }, "devDependencies": { "@babel/eslint-parser": "^7.16.5", @@ -13957,9 +13957,9 @@ "dev": true }, "node_modules/live-connect-js": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-2.4.0.tgz", - "integrity": "sha512-MSBLKfnXoxH+pqwji/Mf8yZu3VZMq4tnNfwMw7NTWN5a+TBM6f0RWgwui1YMA3nHmMhX/nzxxsso0SkyKcF0fA==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-3.0.0-alpha.1.tgz", + "integrity": "sha512-Z3V4t/Chk3XUBPogXOLNEall/9rWrQsZL5OA2yl6gxaLQpEKxM+xNJht/G4NXs/NU2bYODfJ5XlVApLmIaC7tQ==", "dependencies": { "tiny-hashes": "1.0.1" }, @@ -32987,9 +32987,9 @@ "dev": true }, "live-connect-js": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-2.4.0.tgz", - "integrity": "sha512-MSBLKfnXoxH+pqwji/Mf8yZu3VZMq4tnNfwMw7NTWN5a+TBM6f0RWgwui1YMA3nHmMhX/nzxxsso0SkyKcF0fA==", + "version": "3.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/live-connect-js/-/live-connect-js-3.0.0-alpha.1.tgz", + "integrity": "sha512-Z3V4t/Chk3XUBPogXOLNEall/9rWrQsZL5OA2yl6gxaLQpEKxM+xNJht/G4NXs/NU2bYODfJ5XlVApLmIaC7tQ==", "requires": { "tiny-hashes": "1.0.1" } diff --git a/package.json b/package.json index a463546efa1..95a6baea7fa 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "express": "^4.15.4", "fun-hooks": "^0.9.9", "just-clone": "^1.0.2", - "live-connect-js": "2.4.0" + "live-connect-js": "3.0.0-alpha.1" }, "optionalDependencies": { "fsevents": "^2.3.2" From a311c07443ab58713d783ed92ef517186d286987 Mon Sep 17 00:00:00 2001 From: wiem Date: Fri, 21 Oct 2022 12:32:04 +0200 Subject: [PATCH 2/2] define globalVarName --- modules/liveIntentIdSystem.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/liveIntentIdSystem.js b/modules/liveIntentIdSystem.js index 683dab2811d..463a1c7d1e8 100644 --- a/modules/liveIntentIdSystem.js +++ b/modules/liveIntentIdSystem.js @@ -4,7 +4,7 @@ * @module modules/liveIntentIdSystem * @requires module:modules/userId */ -import { triggerPixel, logError } from '../src/utils.js'; +import { generateUUID, 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'; @@ -14,6 +14,7 @@ import { getStorageManager } from '../src/storageManager.js'; const MODULE_NAME = 'liveIntentId'; export const storage = getStorageManager({gvlid: null, moduleName: MODULE_NAME}); const defaultRequestedAttributes = {'nonId': true} +const globalVarName = `prebid_liQ_${generateUUID().slice(0, 8)}` const calls = { ajaxGet: (url, onSuccess, onError, timeout) => { ajaxBuilder(timeout)( @@ -109,6 +110,7 @@ function initializeLiveConnect(configParams) { liveConnectConfig.gdprApplies = gdprConsent.gdprApplies; liveConnectConfig.gdprConsent = gdprConsent.consentString; } + liveConnectConfig.globalVarName = globalVarName // 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