@adobe/alloy 2.29.0-beta.14 → 2.29.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libEs5/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -3
- package/libEs5/components/Advertising/identities/collectID5Id.js +1 -1
- package/libEs5/components/Advertising/identities/collectRampId.js +1 -1
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs6/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -3
- package/libEs6/components/Advertising/identities/collectID5Id.js +1 -1
- package/libEs6/components/Advertising/identities/collectRampId.js +1 -1
- package/libEs6/constants/libraryVersion.js +1 -1
- package/package.json +2 -2
- package/types/components/Advertising/handlers/onBeforeSendEventHandler.d.ts.map +1 -1
|
@@ -7,6 +7,7 @@ var _collectRampId = require("../identities/collectRampId.js");
|
|
|
7
7
|
var _helpers = require("../utils/helpers.js");
|
|
8
8
|
var _index = require("../constants/index.js");
|
|
9
9
|
var _consentStatus = require("../../../constants/consentStatus.js");
|
|
10
|
+
var _browser = require("../../../constants/browser.js");
|
|
10
11
|
/*
|
|
11
12
|
Copyright 2023 Adobe. All rights reserved.
|
|
12
13
|
Licensed under the Apache License, Version 2.0.
|
|
@@ -14,10 +15,10 @@ http://www.apache.org/licenses/LICENSE-2.0
|
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
const isAdvertisingDisabled = advertising => {
|
|
17
|
-
return ![_consentStatus.AUTO, _consentStatus.WAIT].includes(advertising?.handleAdvertisingData);
|
|
18
|
+
return ![_consentStatus.AUTO, _consentStatus.WAIT].includes(advertising?.handleAdvertisingData?.toLowerCase());
|
|
18
19
|
};
|
|
19
20
|
const waitForAdvertisingId = advertising => {
|
|
20
|
-
return advertising?.handleAdvertisingData === _consentStatus.WAIT;
|
|
21
|
+
return advertising?.handleAdvertisingData?.toLowerCase() === _consentStatus.WAIT;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -47,7 +48,11 @@ async function handleOnBeforeSendEvent({
|
|
|
47
48
|
if (isAdvertisingDisabled(advertising) || isClickThru || (0, _helpers.isThrottled)(_index.SURFER_ID, cookieManager) && (0, _helpers.isThrottled)(_index.ID5_ID, cookieManager) && (0, _helpers.isThrottled)(_index.RAMP_ID, cookieManager)) return;
|
|
48
49
|
try {
|
|
49
50
|
const useShortTimeout = waitForAdvertisingId(advertising);
|
|
50
|
-
|
|
51
|
+
let rampIdPromise = null;
|
|
52
|
+
if (!getBrowser || getBrowser() !== _browser.CHROME) {
|
|
53
|
+
rampIdPromise = (0, _collectRampId.getRampId)(logger, componentConfig.rampIdJSPath, cookieManager, useShortTimeout, useShortTimeout);
|
|
54
|
+
}
|
|
55
|
+
const [surferIdResult, id5IdResult, rampIdResult] = await Promise.allSettled([(0, _collectSurferId.default)(cookieManager, getBrowser, useShortTimeout), (0, _collectID5Id.getID5Id)(logger, componentConfig.id5PartnerId, useShortTimeout, useShortTimeout), rampIdPromise]);
|
|
51
56
|
const availableIds = {};
|
|
52
57
|
if (surferIdResult.status === "fulfilled" && surferIdResult.value && !(0, _helpers.isThrottled)(_index.SURFER_ID, cookieManager)) {
|
|
53
58
|
availableIds.surferId = surferIdResult.value;
|
|
@@ -17,7 +17,7 @@ governing permissions and limitations under the License.
|
|
|
17
17
|
|
|
18
18
|
let id5Id = "";
|
|
19
19
|
let inProgressId5Promise = null;
|
|
20
|
-
const SHORT_TIMEOUT_MS =
|
|
20
|
+
const SHORT_TIMEOUT_MS = 2000;
|
|
21
21
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
22
22
|
const initiateID5Call = (partnerId, useShortTimeout, logger) => {
|
|
23
23
|
partnerId = Math.floor(Number(partnerId));
|
|
@@ -14,4 +14,4 @@ governing permissions and limitations under the License.
|
|
|
14
14
|
*/
|
|
15
15
|
// The __VERSION__ keyword will be replace at alloy build time with the package.json version.
|
|
16
16
|
// see babel-plugin-version
|
|
17
|
-
var _default = exports.default = "2.29.0-beta.
|
|
17
|
+
var _default = exports.default = "2.29.0-beta.15";
|
|
@@ -10,11 +10,12 @@ import { getRampId } from "../identities/collectRampId.js";
|
|
|
10
10
|
import { appendAdvertisingIdQueryToEvent, getUrlParams, isThrottled } from "../utils/helpers.js";
|
|
11
11
|
import { SURFER_ID, ID5_ID, RAMP_ID } from "../constants/index.js";
|
|
12
12
|
import { AUTO, WAIT } from "../../../constants/consentStatus.js";
|
|
13
|
+
import { CHROME } from "../../../constants/browser.js";
|
|
13
14
|
const isAdvertisingDisabled = advertising => {
|
|
14
|
-
return ![AUTO, WAIT].includes(advertising?.handleAdvertisingData);
|
|
15
|
+
return ![AUTO, WAIT].includes(advertising?.handleAdvertisingData?.toLowerCase());
|
|
15
16
|
};
|
|
16
17
|
const waitForAdvertisingId = advertising => {
|
|
17
|
-
return advertising?.handleAdvertisingData === WAIT;
|
|
18
|
+
return advertising?.handleAdvertisingData?.toLowerCase() === WAIT;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -44,7 +45,11 @@ export default async function handleOnBeforeSendEvent({
|
|
|
44
45
|
if (isAdvertisingDisabled(advertising) || isClickThru || isThrottled(SURFER_ID, cookieManager) && isThrottled(ID5_ID, cookieManager) && isThrottled(RAMP_ID, cookieManager)) return;
|
|
45
46
|
try {
|
|
46
47
|
const useShortTimeout = waitForAdvertisingId(advertising);
|
|
47
|
-
|
|
48
|
+
let rampIdPromise = null;
|
|
49
|
+
if (!getBrowser || getBrowser() !== CHROME) {
|
|
50
|
+
rampIdPromise = getRampId(logger, componentConfig.rampIdJSPath, cookieManager, useShortTimeout, useShortTimeout);
|
|
51
|
+
}
|
|
52
|
+
const [surferIdResult, id5IdResult, rampIdResult] = await Promise.allSettled([collectSurferId(cookieManager, getBrowser, useShortTimeout), getID5Id(logger, componentConfig.id5PartnerId, useShortTimeout, useShortTimeout), rampIdPromise]);
|
|
48
53
|
const availableIds = {};
|
|
49
54
|
if (surferIdResult.status === "fulfilled" && surferIdResult.value && !isThrottled(SURFER_ID, cookieManager)) {
|
|
50
55
|
availableIds.surferId = surferIdResult.value;
|
|
@@ -13,7 +13,7 @@ import { loadScript } from "../../../utils/dom/index.js";
|
|
|
13
13
|
import { ID5_SCRIPT_URL } from "../constants/index.js";
|
|
14
14
|
let id5Id = "";
|
|
15
15
|
let inProgressId5Promise = null;
|
|
16
|
-
const SHORT_TIMEOUT_MS =
|
|
16
|
+
const SHORT_TIMEOUT_MS = 2000;
|
|
17
17
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
18
18
|
const initiateID5Call = (partnerId, useShortTimeout, logger) => {
|
|
19
19
|
partnerId = Math.floor(Number(partnerId));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/alloy",
|
|
3
|
-
"version": "2.29.0-beta.
|
|
3
|
+
"version": "2.29.0-beta.15",
|
|
4
4
|
"description": "Adobe Experience Platform Web SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "libEs5/index.js",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"uuid": "^11.1.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@adobe/alloy": "^2.29.0-beta.
|
|
97
|
+
"@adobe/alloy": "^2.29.0-beta.14",
|
|
98
98
|
"@babel/cli": "^7.28.3",
|
|
99
99
|
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
|
|
100
100
|
"@babel/plugin-transform-runtime": "^7.28.3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onBeforeSendEventHandler.d.ts","sourceRoot":"","sources":["../../../../src/components/Advertising/handlers/onBeforeSendEventHandler.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"onBeforeSendEventHandler.d.ts","sourceRoot":"","sources":["../../../../src/components/Advertising/handlers/onBeforeSendEventHandler.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AACH,6HARG;IAAuB,aAAa;IACb,MAAM;IACN,KAAK;IACL,KAAK;IACL,eAAe;IACf,WAAW;IACT,UAAU;CACrC,iBAsFA"}
|