@adobe/alloy 2.12.0 → 2.13.0-beta.0
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/ActivityCollector/attachClickActivityCollector.js +4 -9
- package/libEs5/components/ActivityCollector/createLinkClick.js +7 -1
- package/libEs5/components/Context/createComponent.js +7 -6
- package/libEs5/components/Context/index.js +17 -13
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +55 -0
- package/libEs5/components/DataCollector/index.js +26 -0
- package/libEs5/components/DataCollector/validateApplyResponse.js +22 -0
- package/libEs5/components/DataCollector/validateUserEventOptions.js +5 -3
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +1 -1
- package/libEs5/components/Personalization/constants/propositionEventType.js +20 -0
- package/libEs5/components/Personalization/createCollect.js +3 -1
- package/libEs5/components/Personalization/createComponent.js +19 -13
- package/libEs5/components/Personalization/createFetchDataHandler.js +1 -2
- package/libEs5/components/Personalization/createOnClickHandler.js +3 -1
- package/libEs5/components/Personalization/createSetTargetMigration.js +34 -0
- package/libEs5/components/Personalization/createViewChangeHandler.js +3 -1
- package/libEs5/components/Personalization/event.js +5 -2
- package/libEs5/components/Personalization/index.js +12 -3
- package/libEs5/constants/cookieNameKey.js +4 -2
- package/libEs5/constants/highEntropyUserAgentClientHints.js +17 -0
- package/libEs5/constants/legacyCookies.js +21 -0
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/core/createCookieTransfer.js +2 -9
- package/libEs5/core/createEventManager.js +32 -1
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +20 -0
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +62 -0
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +18 -1
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +14 -29
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +28 -0
- package/libEs5/core/index.js +19 -3
- package/libEs5/core/injectShouldTransferCookie.js +33 -0
- package/libEs5/utils/isUnique.js +38 -0
- package/libEs5/utils/request/createRequestPayload.js +1 -0
- package/libEs5/utils/validateIdentityMap.js +1 -1
- package/libEs5/utils/validation/createUniqueItemsValidator.js +26 -0
- package/libEs5/utils/validation/index.js +8 -1
- package/libEs6/components/ActivityCollector/attachClickActivityCollector.js +3 -8
- package/libEs6/components/ActivityCollector/createLinkClick.js +7 -1
- package/libEs6/components/Context/createComponent.js +4 -5
- package/libEs6/components/Context/index.js +10 -2
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +46 -0
- package/libEs6/components/DataCollector/index.js +24 -0
- package/libEs6/components/DataCollector/validateApplyResponse.js +16 -0
- package/libEs6/components/DataCollector/validateUserEventOptions.js +5 -3
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +1 -1
- package/libEs6/components/Personalization/constants/propositionEventType.js +15 -0
- package/libEs6/components/Personalization/createCollect.js +2 -1
- package/libEs6/components/Personalization/createComponent.js +9 -1
- package/libEs6/components/Personalization/createFetchDataHandler.js +1 -5
- package/libEs6/components/Personalization/createOnClickHandler.js +2 -1
- package/libEs6/components/Personalization/createSetTargetMigration.js +27 -0
- package/libEs6/components/Personalization/createViewChangeHandler.js +2 -1
- package/libEs6/components/Personalization/event.js +6 -2
- package/libEs6/components/Personalization/index.js +14 -4
- package/libEs6/constants/cookieNameKey.js +2 -1
- package/libEs6/constants/highEntropyUserAgentClientHints.js +12 -0
- package/libEs6/constants/legacyCookies.js +14 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/createCookieTransfer.js +3 -10
- package/libEs6/core/createEventManager.js +32 -2
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +14 -0
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +48 -0
- package/libEs6/core/edgeNetwork/injectGetLocationHint.js +17 -1
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +5 -21
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +9 -0
- package/libEs6/core/index.js +17 -3
- package/libEs6/core/injectShouldTransferCookie.js +24 -0
- package/libEs6/utils/isUnique.js +32 -0
- package/libEs6/utils/request/createRequestPayload.js +1 -0
- package/libEs6/utils/validateIdentityMap.js +1 -1
- package/libEs6/utils/validation/createUniqueItemsValidator.js +18 -0
- package/libEs6/utils/validation/index.js +7 -1
- package/package.json +4 -3
|
@@ -22,7 +22,9 @@ var createClickHandler = function createClickHandler(_ref) {
|
|
|
22
22
|
return function (clickEvent) {
|
|
23
23
|
// TODO: Consider safeguarding from the same object being clicked multiple times in rapid succession?
|
|
24
24
|
var clickedElement = clickEvent.target;
|
|
25
|
-
var event = eventManager.createEvent();
|
|
25
|
+
var event = eventManager.createEvent(); // this is to make sure a exit link personalization metric use send beacon
|
|
26
|
+
|
|
27
|
+
event.documentMayUnload();
|
|
26
28
|
return lifecycle.onClick({
|
|
27
29
|
event: event,
|
|
28
30
|
clickedElement: clickedElement
|
|
@@ -41,16 +43,9 @@ var createClickHandler = function createClickHandler(_ref) {
|
|
|
41
43
|
};
|
|
42
44
|
|
|
43
45
|
var _default = function _default(_ref2) {
|
|
44
|
-
var
|
|
45
|
-
eventManager = _ref2.eventManager,
|
|
46
|
+
var eventManager = _ref2.eventManager,
|
|
46
47
|
lifecycle = _ref2.lifecycle,
|
|
47
48
|
handleError = _ref2.handleError;
|
|
48
|
-
var enabled = config.clickCollectionEnabled;
|
|
49
|
-
|
|
50
|
-
if (!enabled) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
49
|
var clickHandler = createClickHandler({
|
|
55
50
|
eventManager: eventManager,
|
|
56
51
|
lifecycle: lifecycle,
|
|
@@ -43,8 +43,14 @@ var findSupportedAnchorElement = function findSupportedAnchorElement(targetEleme
|
|
|
43
43
|
|
|
44
44
|
var _default = function _default(window, config) {
|
|
45
45
|
return function (event, targetElement) {
|
|
46
|
-
|
|
46
|
+
var clickCollectionEnabled = config.clickCollectionEnabled;
|
|
47
|
+
|
|
48
|
+
if (!clickCollectionEnabled) {
|
|
49
|
+
return;
|
|
50
|
+
} // Search parent elements for an anchor element
|
|
47
51
|
// TODO: Replace with generic DOM tool that can fetch configured properties
|
|
52
|
+
|
|
53
|
+
|
|
48
54
|
var anchorElement = findSupportedAnchorElement(targetElement);
|
|
49
55
|
|
|
50
56
|
if (!anchorElement) {
|
|
@@ -15,11 +15,11 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
15
15
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
var _default = function _default(config, logger,
|
|
18
|
+
var _default = function _default(config, logger, optionalContexts, requiredContexts) {
|
|
19
19
|
var configuredContexts = config.context;
|
|
20
20
|
var contexts = (0, _utils.flatMap)(configuredContexts, function (context, i) {
|
|
21
|
-
if (
|
|
22
|
-
return [
|
|
21
|
+
if (optionalContexts[context]) {
|
|
22
|
+
return [optionalContexts[context]];
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
logger.warn("Invalid context[" + i + "]: '" + context + "' is not available.");
|
|
@@ -31,10 +31,11 @@ var _default = function _default(config, logger, availableContexts, requiredCont
|
|
|
31
31
|
onBeforeEvent: function onBeforeEvent(_ref) {
|
|
32
32
|
var event = _ref.event;
|
|
33
33
|
var xdm = {};
|
|
34
|
-
contexts.
|
|
35
|
-
return context(xdm);
|
|
34
|
+
return Promise.all(contexts.map(function (context) {
|
|
35
|
+
return Promise.resolve(context(xdm, logger));
|
|
36
|
+
})).then(function () {
|
|
37
|
+
return event.mergeXdm(xdm);
|
|
36
38
|
});
|
|
37
|
-
event.mergeXdm(xdm);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
};
|
|
@@ -16,19 +16,16 @@ var _implementationDetails = require("./implementationDetails");
|
|
|
16
16
|
|
|
17
17
|
var _createComponent = require("./createComponent");
|
|
18
18
|
|
|
19
|
+
var _injectHighEntropyUserAgentHints = require("./injectHighEntropyUserAgentHints");
|
|
20
|
+
|
|
19
21
|
var _validation = require("../../utils/validation");
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
-
OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
-
governing permissions and limitations under the License.
|
|
31
|
-
*/
|
|
23
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
+
|
|
25
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
+
|
|
27
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
+
|
|
32
29
|
var web = (0, _injectWeb.default)(window);
|
|
33
30
|
var device = (0, _injectDevice.default)(window);
|
|
34
31
|
var environment = (0, _injectEnvironment.default)(window);
|
|
@@ -38,12 +35,19 @@ var placeContext = (0, _injectPlaceContext.default)(function () {
|
|
|
38
35
|
var timestamp = (0, _injectTimestamp.default)(function () {
|
|
39
36
|
return new Date();
|
|
40
37
|
});
|
|
41
|
-
var
|
|
38
|
+
var highEntropyUserAgentHints = (0, _injectHighEntropyUserAgentHints.default)(navigator);
|
|
39
|
+
var defaultEnabledContexts = {
|
|
42
40
|
web: web,
|
|
43
41
|
device: device,
|
|
44
42
|
environment: environment,
|
|
45
43
|
placeContext: placeContext
|
|
46
44
|
};
|
|
45
|
+
var defaultDisabledContexts = {
|
|
46
|
+
highEntropyUserAgentHints: highEntropyUserAgentHints
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var optionalContexts = _objectSpread(_objectSpread({}, defaultEnabledContexts), defaultDisabledContexts);
|
|
50
|
+
|
|
47
51
|
var requiredContexts = [timestamp, _implementationDetails.default];
|
|
48
52
|
|
|
49
53
|
var createContext = function createContext(_ref) {
|
|
@@ -54,7 +58,7 @@ var createContext = function createContext(_ref) {
|
|
|
54
58
|
|
|
55
59
|
createContext.namespace = "Context";
|
|
56
60
|
createContext.configValidators = {
|
|
57
|
-
context: (0, _validation.arrayOf)((0, _validation.string)()).default(Object.keys(
|
|
61
|
+
context: (0, _validation.arrayOf)((0, _validation.string)()).default(Object.keys(defaultEnabledContexts))
|
|
58
62
|
};
|
|
59
63
|
var _default = createContext;
|
|
60
64
|
exports.default = _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _utils = require("../../utils");
|
|
6
|
+
|
|
7
|
+
var _highEntropyUserAgentClientHints = require("../../constants/highEntropyUserAgentClientHints");
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
11
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
|
|
15
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
governing permissions and limitations under the License.
|
|
19
|
+
*/
|
|
20
|
+
var browserSupportsUserAgentClientHints = function browserSupportsUserAgentClientHints(navigator) {
|
|
21
|
+
return typeof navigator.userAgentData !== "undefined";
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _default = function _default(navigator) {
|
|
25
|
+
if (!browserSupportsUserAgentClientHints(navigator)) {
|
|
26
|
+
return _utils.noop;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return function (xdm, logger) {
|
|
30
|
+
try {
|
|
31
|
+
return navigator.userAgentData.getHighEntropyValues(_highEntropyUserAgentClientHints.default).then(function (hints) {
|
|
32
|
+
var userAgentClientHints = {};
|
|
33
|
+
|
|
34
|
+
_highEntropyUserAgentClientHints.default.forEach(function (hint) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(hints, hint)) {
|
|
36
|
+
userAgentClientHints[hint] = hints[hint];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
(0, _utils.deepAssign)(xdm, {
|
|
41
|
+
environment: {
|
|
42
|
+
browserDetails: {
|
|
43
|
+
userAgentClientHints: userAgentClientHints
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
} catch (error) {
|
|
49
|
+
logger.warn("Unable to collect user-agent client hints. " + error.message);
|
|
50
|
+
return _utils.noop;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.default = _default;
|
|
@@ -4,6 +4,8 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _validateUserEventOptions = require("./validateUserEventOptions");
|
|
6
6
|
|
|
7
|
+
var _validateApplyResponse = require("./validateApplyResponse");
|
|
8
|
+
|
|
7
9
|
/*
|
|
8
10
|
Copyright 2019 Adobe. All rights reserved.
|
|
9
11
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -72,6 +74,30 @@ var createDataCollector = function createDataCollector(_ref) {
|
|
|
72
74
|
decisionScopes: decisionScopes
|
|
73
75
|
});
|
|
74
76
|
}
|
|
77
|
+
},
|
|
78
|
+
applyResponse: {
|
|
79
|
+
documentationUri: "",
|
|
80
|
+
optionsValidator: function optionsValidator(options) {
|
|
81
|
+
return (0, _validateApplyResponse.default)({
|
|
82
|
+
options: options
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
run: function run(options) {
|
|
86
|
+
var _options$renderDecisi2 = options.renderDecisions,
|
|
87
|
+
renderDecisions = _options$renderDecisi2 === void 0 ? false : _options$renderDecisi2,
|
|
88
|
+
_options$responseHead = options.responseHeaders,
|
|
89
|
+
responseHeaders = _options$responseHead === void 0 ? {} : _options$responseHead,
|
|
90
|
+
_options$responseBody = options.responseBody,
|
|
91
|
+
responseBody = _options$responseBody === void 0 ? {
|
|
92
|
+
handle: []
|
|
93
|
+
} : _options$responseBody;
|
|
94
|
+
var event = eventManager.createEvent();
|
|
95
|
+
return eventManager.applyResponse(event, {
|
|
96
|
+
renderDecisions: renderDecisions,
|
|
97
|
+
responseHeaders: responseHeaders,
|
|
98
|
+
responseBody: responseBody
|
|
99
|
+
});
|
|
100
|
+
}
|
|
75
101
|
}
|
|
76
102
|
}
|
|
77
103
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _validation = require("../../utils/validation");
|
|
6
|
+
|
|
7
|
+
var _default = function _default(_ref) {
|
|
8
|
+
var options = _ref.options;
|
|
9
|
+
var validator = (0, _validation.objectOf)({
|
|
10
|
+
renderDecisions: (0, _validation.boolean)(),
|
|
11
|
+
responseHeaders: (0, _validation.mapOfValues)((0, _validation.string)().required()),
|
|
12
|
+
responseBody: (0, _validation.objectOf)({
|
|
13
|
+
handle: (0, _validation.arrayOf)((0, _validation.objectOf)({
|
|
14
|
+
type: (0, _validation.string)().required(),
|
|
15
|
+
payload: (0, _validation.anything)().required()
|
|
16
|
+
})).required()
|
|
17
|
+
}).required()
|
|
18
|
+
}).noUnknownFields();
|
|
19
|
+
return validator(options);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.default = _default;
|
|
@@ -32,10 +32,12 @@ var _default = function _default(_ref) {
|
|
|
32
32
|
identityMap: _utils.validateIdentityMap
|
|
33
33
|
}),
|
|
34
34
|
data: (0, _validation.objectOf)({}),
|
|
35
|
+
documentUnloading: (0, _validation.boolean)(),
|
|
35
36
|
renderDecisions: (0, _validation.boolean)(),
|
|
36
|
-
decisionScopes: (0, _validation.arrayOf)((0, _validation.string)()),
|
|
37
|
-
datasetId: (0, _validation.string)()
|
|
38
|
-
|
|
37
|
+
decisionScopes: (0, _validation.arrayOf)((0, _validation.string)()).uniqueItems(),
|
|
38
|
+
datasetId: (0, _validation.string)(),
|
|
39
|
+
mergeId: (0, _validation.string)()
|
|
40
|
+
}).required().noUnknownFields();
|
|
39
41
|
return eventOptionsValidator(options);
|
|
40
42
|
};
|
|
41
43
|
|
|
@@ -23,7 +23,7 @@ governing permissions and limitations under the License.
|
|
|
23
23
|
*/
|
|
24
24
|
var _default = function _default(options) {
|
|
25
25
|
var getIdentityOptionsValidator = (0, _validation.objectOf)({
|
|
26
|
-
namespaces: (0, _validation.arrayOf)((0, _validation.literal)("ECID")).nonEmpty()
|
|
26
|
+
namespaces: (0, _validation.arrayOf)((0, _validation.literal)("ECID")).nonEmpty().uniqueItems()
|
|
27
27
|
}).noUnknownFields();
|
|
28
28
|
getIdentityOptionsValidator(options); // Return default options for now
|
|
29
29
|
// To-Do: Accept namespace from given options
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.PropositionEventType = void 0;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var PropositionEventType = {
|
|
17
|
+
DISPLAY: "display",
|
|
18
|
+
INTERACT: "interact"
|
|
19
|
+
};
|
|
20
|
+
exports.PropositionEventType = PropositionEventType;
|
|
@@ -4,6 +4,8 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _eventType = require("./constants/eventType");
|
|
6
6
|
|
|
7
|
+
var _propositionEventType = require("./constants/propositionEventType");
|
|
8
|
+
|
|
7
9
|
var _utils = require("../../utils");
|
|
8
10
|
|
|
9
11
|
/*
|
|
@@ -41,7 +43,7 @@ var _default = function _default(_ref) {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
if ((0, _utils.isNonEmptyArray)(decisionsMeta)) {
|
|
44
|
-
mergeDecisionsMeta(event, decisionsMeta);
|
|
46
|
+
mergeDecisionsMeta(event, decisionsMeta, _propositionEventType.PropositionEventType.DISPLAY);
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
event.mergeXdm(data);
|
|
@@ -30,18 +30,24 @@ var _default = function _default(_ref) {
|
|
|
30
30
|
mergeQuery = _ref.mergeQuery,
|
|
31
31
|
viewCache = _ref.viewCache,
|
|
32
32
|
showContainers = _ref.showContainers,
|
|
33
|
-
applyPropositions = _ref.applyPropositions
|
|
33
|
+
applyPropositions = _ref.applyPropositions,
|
|
34
|
+
setTargetMigration = _ref.setTargetMigration;
|
|
34
35
|
return {
|
|
35
36
|
lifecycle: {
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
onBeforeRequest: function onBeforeRequest(_ref2) {
|
|
38
|
+
var request = _ref2.request;
|
|
39
|
+
setTargetMigration(request);
|
|
40
|
+
return Promise.resolve();
|
|
41
|
+
},
|
|
42
|
+
onBeforeEvent: function onBeforeEvent(_ref3) {
|
|
43
|
+
var event = _ref3.event,
|
|
44
|
+
renderDecisions = _ref3.renderDecisions,
|
|
45
|
+
_ref3$decisionScopes = _ref3.decisionScopes,
|
|
46
|
+
decisionScopes = _ref3$decisionScopes === void 0 ? [] : _ref3$decisionScopes,
|
|
47
|
+
_ref3$onResponse = _ref3.onResponse,
|
|
48
|
+
onResponse = _ref3$onResponse === void 0 ? _utils.noop : _ref3$onResponse,
|
|
49
|
+
_ref3$onRequestFailur = _ref3.onRequestFailure,
|
|
50
|
+
onRequestFailure = _ref3$onRequestFailur === void 0 ? _utils.noop : _ref3$onRequestFailur;
|
|
45
51
|
// Include propositions on all responses, overridden with data as needed
|
|
46
52
|
onResponse(function () {
|
|
47
53
|
return {
|
|
@@ -93,9 +99,9 @@ var _default = function _default(_ref) {
|
|
|
93
99
|
});
|
|
94
100
|
}
|
|
95
101
|
},
|
|
96
|
-
onClick: function onClick(
|
|
97
|
-
var event =
|
|
98
|
-
clickedElement =
|
|
102
|
+
onClick: function onClick(_ref4) {
|
|
103
|
+
var event = _ref4.event,
|
|
104
|
+
clickedElement = _ref4.clickedElement;
|
|
99
105
|
onClickHandler({
|
|
100
106
|
event: event,
|
|
101
107
|
clickedElement: clickedElement
|
|
@@ -14,7 +14,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
var _default = function _default(_ref) {
|
|
17
|
-
var
|
|
17
|
+
var prehidingStyle = _ref.prehidingStyle,
|
|
18
18
|
responseHandler = _ref.responseHandler,
|
|
19
19
|
hideContainers = _ref.hideContainers,
|
|
20
20
|
mergeQuery = _ref.mergeQuery;
|
|
@@ -23,7 +23,6 @@ var _default = function _default(_ref) {
|
|
|
23
23
|
personalizationDetails = _ref2.personalizationDetails,
|
|
24
24
|
event = _ref2.event,
|
|
25
25
|
onResponse = _ref2.onResponse;
|
|
26
|
-
var prehidingStyle = config.prehidingStyle;
|
|
27
26
|
|
|
28
27
|
if (personalizationDetails.isRenderDecisions()) {
|
|
29
28
|
hideContainers(prehidingStyle);
|
|
@@ -6,6 +6,8 @@ var _utils = require("../../utils");
|
|
|
6
6
|
|
|
7
7
|
var _eventType = require("./constants/eventType");
|
|
8
8
|
|
|
9
|
+
var _propositionEventType = require("./constants/propositionEventType");
|
|
10
|
+
|
|
9
11
|
var _scope = require("./constants/scope");
|
|
10
12
|
|
|
11
13
|
/*
|
|
@@ -48,7 +50,7 @@ var _default = function _default(_ref) {
|
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
event.mergeXdm(xdm);
|
|
51
|
-
mergeDecisionsMeta(event, decisionsMeta);
|
|
53
|
+
mergeDecisionsMeta(event, decisionsMeta, _propositionEventType.PropositionEventType.INTERACT);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _utils = require("../../utils");
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
9
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
11
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
14
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
15
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
|
+
governing permissions and limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
var _default = function _default(_ref) {
|
|
19
|
+
var targetMigrationEnabled = _ref.targetMigrationEnabled;
|
|
20
|
+
|
|
21
|
+
if (targetMigrationEnabled) {
|
|
22
|
+
return function (request) {
|
|
23
|
+
request.getPayload().mergeMeta({
|
|
24
|
+
target: {
|
|
25
|
+
migration: true
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return _utils.noop;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.default = _default;
|
|
@@ -6,6 +6,8 @@ var _composePersonalizationResultingObject = require("./utils/composePersonaliza
|
|
|
6
6
|
|
|
7
7
|
var _utils = require("../../utils");
|
|
8
8
|
|
|
9
|
+
var _propositionEventType = require("./constants/propositionEventType");
|
|
10
|
+
|
|
9
11
|
/*
|
|
10
12
|
Copyright 2020 Adobe. All rights reserved.
|
|
11
13
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -32,7 +34,7 @@ var _default = function _default(_ref) {
|
|
|
32
34
|
return executeDecisions(viewDecisions).then(function (decisionsMeta) {
|
|
33
35
|
// if there are decisions to be rendered we render them and attach the result in experience.decisions.propositions
|
|
34
36
|
if ((0, _utils.isNonEmptyArray)(decisionsMeta)) {
|
|
35
|
-
mergeDecisionsMeta(event, decisionsMeta);
|
|
37
|
+
mergeDecisionsMeta(event, decisionsMeta, _propositionEventType.PropositionEventType.DISPLAY);
|
|
36
38
|
onResponse(function () {
|
|
37
39
|
return (0, _composePersonalizationResultingObject.default)(viewDecisions, true);
|
|
38
40
|
});
|
|
@@ -19,11 +19,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
19
19
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
20
|
governing permissions and limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var
|
|
22
|
+
var EVENT_TYPE_TRUE = 1;
|
|
23
|
+
|
|
24
|
+
var mergeDecisionsMeta = function mergeDecisionsMeta(event, decisionsMeta, eventType) {
|
|
23
25
|
event.mergeXdm({
|
|
24
26
|
_experience: {
|
|
25
27
|
decisioning: {
|
|
26
|
-
propositions: decisionsMeta
|
|
28
|
+
propositions: decisionsMeta,
|
|
29
|
+
propositionEventType: _defineProperty({}, eventType, EVENT_TYPE_TRUE)
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
});
|
|
@@ -42,6 +42,8 @@ var _createNonRenderingHandler = require("./createNonRenderingHandler");
|
|
|
42
42
|
|
|
43
43
|
var _createApplyPropositions = require("./createApplyPropositions");
|
|
44
44
|
|
|
45
|
+
var _createSetTargetMigration = require("./createSetTargetMigration");
|
|
46
|
+
|
|
45
47
|
/*
|
|
46
48
|
Copyright 2019 Adobe. All rights reserved.
|
|
47
49
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -57,6 +59,8 @@ var createPersonalization = function createPersonalization(_ref) {
|
|
|
57
59
|
var config = _ref.config,
|
|
58
60
|
logger = _ref.logger,
|
|
59
61
|
eventManager = _ref.eventManager;
|
|
62
|
+
var targetMigrationEnabled = config.targetMigrationEnabled,
|
|
63
|
+
prehidingStyle = config.prehidingStyle;
|
|
60
64
|
var collect = (0, _createCollect.default)({
|
|
61
65
|
eventManager: eventManager,
|
|
62
66
|
mergeDecisionsMeta: _event.mergeDecisionsMeta
|
|
@@ -100,7 +104,7 @@ var createPersonalization = function createPersonalization(_ref) {
|
|
|
100
104
|
showContainers: _flicker.showContainers
|
|
101
105
|
});
|
|
102
106
|
var fetchDataHandler = (0, _createFetchDataHandler.default)({
|
|
103
|
-
|
|
107
|
+
prehidingStyle: prehidingStyle,
|
|
104
108
|
responseHandler: responseHandler,
|
|
105
109
|
hideContainers: _flicker.hideContainers,
|
|
106
110
|
mergeQuery: _event.mergeQuery
|
|
@@ -117,6 +121,9 @@ var createPersonalization = function createPersonalization(_ref) {
|
|
|
117
121
|
executeDecisions: executeDecisions,
|
|
118
122
|
viewCache: viewCache
|
|
119
123
|
});
|
|
124
|
+
var setTargetMigration = (0, _createSetTargetMigration.default)({
|
|
125
|
+
targetMigrationEnabled: targetMigrationEnabled
|
|
126
|
+
});
|
|
120
127
|
return (0, _createComponent.default)({
|
|
121
128
|
logger: logger,
|
|
122
129
|
fetchDataHandler: fetchDataHandler,
|
|
@@ -126,13 +133,15 @@ var createPersonalization = function createPersonalization(_ref) {
|
|
|
126
133
|
mergeQuery: _event.mergeQuery,
|
|
127
134
|
viewCache: viewCache,
|
|
128
135
|
showContainers: _flicker.showContainers,
|
|
129
|
-
applyPropositions: applyPropositions
|
|
136
|
+
applyPropositions: applyPropositions,
|
|
137
|
+
setTargetMigration: setTargetMigration
|
|
130
138
|
});
|
|
131
139
|
};
|
|
132
140
|
|
|
133
141
|
createPersonalization.namespace = "Personalization";
|
|
134
142
|
createPersonalization.configValidators = {
|
|
135
|
-
prehidingStyle: (0, _validation.string)().nonEmpty()
|
|
143
|
+
prehidingStyle: (0, _validation.string)().nonEmpty(),
|
|
144
|
+
targetMigrationEnabled: (0, _validation.boolean)().default(false)
|
|
136
145
|
};
|
|
137
146
|
var _default = createPersonalization;
|
|
138
147
|
exports.default = _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.IDENTITY = exports.CONSENT = exports.CLUSTER = void 0;
|
|
3
|
+
exports.MBOX = exports.IDENTITY = exports.CONSENT = exports.CLUSTER = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -18,4 +18,6 @@ exports.IDENTITY = IDENTITY;
|
|
|
18
18
|
var CONSENT = "consent";
|
|
19
19
|
exports.CONSENT = CONSENT;
|
|
20
20
|
var CLUSTER = "cluster";
|
|
21
|
-
exports.CLUSTER = CLUSTER;
|
|
21
|
+
exports.CLUSTER = CLUSTER;
|
|
22
|
+
var MBOX = "mbox";
|
|
23
|
+
exports.MBOX = MBOX;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var _default = ["architecture", "bitness", "model", "platformVersion", "wow64"];
|
|
17
|
+
exports.default = _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.MBOX_EDGE_CLUSTER = exports.MBOX = exports.AT_QA_MODE = void 0;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var MBOX_EDGE_CLUSTER = "mboxEdgeCluster";
|
|
17
|
+
exports.MBOX_EDGE_CLUSTER = MBOX_EDGE_CLUSTER;
|
|
18
|
+
var AT_QA_MODE = "at_qa_mode";
|
|
19
|
+
exports.AT_QA_MODE = AT_QA_MODE;
|
|
20
|
+
var MBOX = "mbox";
|
|
21
|
+
exports.MBOX = MBOX;
|
|
@@ -15,5 +15,5 @@ governing permissions and limitations under the License.
|
|
|
15
15
|
*/
|
|
16
16
|
// The __VERSION__ keyword will be replace at alloy build time with the package.json version.
|
|
17
17
|
// see babel-plugin-version
|
|
18
|
-
var _default = "2.
|
|
18
|
+
var _default = "2.13.0-beta.0";
|
|
19
19
|
exports.default = _default;
|
|
@@ -19,7 +19,7 @@ var STATE_STORE_HANDLE_TYPE = "state:store";
|
|
|
19
19
|
|
|
20
20
|
var _default = function _default(_ref) {
|
|
21
21
|
var cookieJar = _ref.cookieJar,
|
|
22
|
-
|
|
22
|
+
shouldTransferCookie = _ref.shouldTransferCookie,
|
|
23
23
|
apexDomain = _ref.apexDomain,
|
|
24
24
|
dateProvider = _ref.dateProvider;
|
|
25
25
|
return {
|
|
@@ -39,14 +39,7 @@ var _default = function _default(_ref) {
|
|
|
39
39
|
|
|
40
40
|
if (!isEndpointFirstParty) {
|
|
41
41
|
var cookies = cookieJar.get();
|
|
42
|
-
var entries = Object.keys(cookies).filter(function (
|
|
43
|
-
// We have a contract with the server that we will pass
|
|
44
|
-
// all cookies whose names are namespaced according to the
|
|
45
|
-
// logic in isNamespacedCookieName as well as any legacy
|
|
46
|
-
// cookie names (so that the server can handle migrating
|
|
47
|
-
// identities on websites previously using Visitor.js)
|
|
48
|
-
return (0, _utils.isNamespacedCookieName)(orgId, name);
|
|
49
|
-
}).map(function (qualifyingCookieName) {
|
|
42
|
+
var entries = Object.keys(cookies).filter(shouldTransferCookie).map(function (qualifyingCookieName) {
|
|
50
43
|
return {
|
|
51
44
|
key: qualifyingCookieName,
|
|
52
45
|
value: cookies[qualifyingCookieName]
|