@adobe/alloy 2.8.0-beta.1 → 2.9.0-alpha.1
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/README.md +1 -1
- package/libEs5/components/DataCollector/index.js +2 -4
- package/libEs5/components/DataCollector/validateUserEventOptions.js +2 -12
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +2 -2
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +3 -5
- package/libEs5/components/Personalization/constants/eventType.js +19 -0
- package/libEs5/components/Personalization/createCollect.js +3 -1
- package/libEs5/components/Personalization/createComponent.js +6 -0
- package/libEs5/components/Personalization/createOnClickHandler.js +3 -1
- package/libEs5/components/Personalization/createViewCollect.js +3 -1
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +3 -1
- package/libEs5/components/Personalization/dom-actions/images.js +3 -1
- package/libEs5/components/Personalization/dom-actions/scripts.js +5 -3
- package/libEs5/components/Personalization/dom-actions/swapImage.js +3 -3
- package/libEs5/components/Privacy/createConsentRequest.js +2 -2
- package/libEs5/components/Privacy/createConsentRequestPayload.js +2 -2
- package/libEs5/constants/elementAttribute.js +17 -0
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/tagName.js +1 -3
- package/libEs5/core/index.js +3 -5
- package/libEs5/{core/edgeNetwork/requests/contentModifiers → utils/request}/createAddIdentity.js +0 -0
- package/libEs5/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequest.js +0 -0
- package/libEs5/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequestPayload.js +1 -1
- package/libEs5/{core/edgeNetwork/requests → utils/request}/createRequest.js +2 -2
- package/libEs5/{core/edgeNetwork/requests → utils/request}/createRequestPayload.js +3 -3
- package/libEs5/utils/request/index.js +42 -0
- package/libEs6/components/DataCollector/index.js +2 -4
- package/libEs6/components/DataCollector/validateUserEventOptions.js +2 -14
- package/libEs6/components/Identity/getIdentity/createIdentityRequest.js +1 -1
- package/libEs6/components/Identity/getIdentity/createIdentityRequestPayload.js +1 -2
- package/libEs6/components/Personalization/constants/eventType.js +13 -0
- package/libEs6/components/Personalization/createCollect.js +2 -1
- package/libEs6/components/Personalization/createComponent.js +5 -0
- package/libEs6/components/Personalization/createOnClickHandler.js +2 -1
- package/libEs6/components/Personalization/createViewCollect.js +2 -1
- package/libEs6/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +2 -1
- package/libEs6/components/Personalization/dom-actions/images.js +2 -1
- package/libEs6/components/Personalization/dom-actions/scripts.js +2 -1
- package/libEs6/components/Personalization/dom-actions/swapImage.js +1 -1
- package/libEs6/components/Privacy/createConsentRequest.js +1 -1
- package/libEs6/components/Privacy/createConsentRequestPayload.js +1 -1
- package/libEs6/constants/elementAttribute.js +12 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/constants/tagName.js +0 -1
- package/libEs6/core/index.js +1 -2
- package/libEs6/{core/edgeNetwork/requests/contentModifiers → utils/request}/createAddIdentity.js +0 -0
- package/libEs6/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequest.js +0 -0
- package/libEs6/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequestPayload.js +1 -1
- package/libEs6/{core/edgeNetwork/requests → utils/request}/createRequest.js +1 -1
- package/libEs6/{core/edgeNetwork/requests → utils/request}/createRequestPayload.js +1 -1
- package/libEs6/utils/request/index.js +16 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
Alloy is the code name for the Adobe Experience Platform Web SDK. It allows for recording events into Adobe Experience Platform, syncing identities, personalizing content, and more.
|
|
6
6
|
|
|
7
|
-
For documentation on how to use Alloy, please see the [user documentation](https://adobe.
|
|
7
|
+
For documentation on how to use Alloy, please see the [user documentation](https://experienceleague.adobe.com/docs/experience-platform/edge/home.html).
|
|
8
8
|
|
|
9
9
|
For documentation on how to contribute to Alloy, please see the [developer documentation](https://github.com/adobe/alloy/wiki).
|
|
@@ -16,16 +16,14 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
var createDataCollector = function createDataCollector(_ref) {
|
|
19
|
-
var eventManager = _ref.eventManager
|
|
20
|
-
logger = _ref.logger;
|
|
19
|
+
var eventManager = _ref.eventManager;
|
|
21
20
|
return {
|
|
22
21
|
commands: {
|
|
23
22
|
sendEvent: {
|
|
24
23
|
documentationUri: "https://adobe.ly/2r0uUjh",
|
|
25
24
|
optionsValidator: function optionsValidator(options) {
|
|
26
25
|
return (0, _validateUserEventOptions.default)({
|
|
27
|
-
options: options
|
|
28
|
-
logger: logger
|
|
26
|
+
options: options
|
|
29
27
|
});
|
|
30
28
|
},
|
|
31
29
|
run: function run(options) {
|
|
@@ -21,12 +21,10 @@ governing permissions and limitations under the License.
|
|
|
21
21
|
/**
|
|
22
22
|
* Verifies user provided event options.
|
|
23
23
|
* @param {*} options The user event options to validate
|
|
24
|
-
* @param {*} logger
|
|
25
24
|
* @returns {*} Validated options
|
|
26
25
|
*/
|
|
27
26
|
var _default = function _default(_ref) {
|
|
28
|
-
var options = _ref.options
|
|
29
|
-
logger = _ref.logger;
|
|
27
|
+
var options = _ref.options;
|
|
30
28
|
var eventOptionsValidator = (0, _validation.objectOf)({
|
|
31
29
|
type: (0, _validation.string)(),
|
|
32
30
|
xdm: (0, _validation.objectOf)({
|
|
@@ -38,15 +36,7 @@ var _default = function _default(_ref) {
|
|
|
38
36
|
decisionScopes: (0, _validation.arrayOf)((0, _validation.string)()),
|
|
39
37
|
datasetId: (0, _validation.string)()
|
|
40
38
|
}).required();
|
|
41
|
-
|
|
42
|
-
var type = validatedOptions.type,
|
|
43
|
-
xdm = validatedOptions.xdm;
|
|
44
|
-
|
|
45
|
-
if (xdm && !xdm.eventType && !type) {
|
|
46
|
-
logger.warn("No type or xdm.eventType specified.");
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return validatedOptions;
|
|
39
|
+
return eventOptionsValidator(options);
|
|
50
40
|
};
|
|
51
41
|
|
|
52
42
|
exports.default = _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _request = require("../../../utils/request");
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -16,7 +16,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
var _default = function _default(identityRequestPayload) {
|
|
19
|
-
return (0,
|
|
19
|
+
return (0, _request.createRequest)({
|
|
20
20
|
payload: identityRequestPayload,
|
|
21
21
|
getAction: function getAction() {
|
|
22
22
|
return "identity/acquire";
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var _createAddIdentity = require("../../../core/edgeNetwork/requests/contentModifiers/createAddIdentity");
|
|
5
|
+
var _request = require("../../../utils/request");
|
|
8
6
|
|
|
9
7
|
/*
|
|
10
8
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -25,9 +23,9 @@ var _default = function _default(namespaces) {
|
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
25
|
};
|
|
28
|
-
return (0,
|
|
26
|
+
return (0, _request.createRequestPayload)({
|
|
29
27
|
content: content,
|
|
30
|
-
addIdentity: (0,
|
|
28
|
+
addIdentity: (0, _request.createAddIdentity)(content)
|
|
31
29
|
});
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.INTERACT = exports.DISPLAY = 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 DISPLAY = "decisioning.propositionDisplay";
|
|
17
|
+
exports.DISPLAY = DISPLAY;
|
|
18
|
+
var INTERACT = "decisioning.propositionInteract";
|
|
19
|
+
exports.INTERACT = INTERACT;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
+
var _eventType = require("./constants/eventType");
|
|
6
|
+
|
|
5
7
|
/*
|
|
6
8
|
Copyright 2020 Adobe. All rights reserved.
|
|
7
9
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,7 +25,7 @@ var _default = function _default(_ref) {
|
|
|
23
25
|
documentMayUnload = _ref2$documentMayUnlo === void 0 ? false : _ref2$documentMayUnlo;
|
|
24
26
|
var event = eventManager.createEvent();
|
|
25
27
|
event.mergeXdm({
|
|
26
|
-
eventType:
|
|
28
|
+
eventType: _eventType.DISPLAY
|
|
27
29
|
});
|
|
28
30
|
mergeDecisionsMeta(event, decisionsMeta);
|
|
29
31
|
|
|
@@ -38,6 +38,12 @@ var _default = function _default(_ref) {
|
|
|
38
38
|
onResponse = _ref2$onResponse === void 0 ? _utils.noop : _ref2$onResponse,
|
|
39
39
|
_ref2$onRequestFailur = _ref2.onRequestFailure,
|
|
40
40
|
onRequestFailure = _ref2$onRequestFailur === void 0 ? _utils.noop : _ref2$onRequestFailur;
|
|
41
|
+
// Include proositions on all responses, overridden with data as needed
|
|
42
|
+
onResponse(function () {
|
|
43
|
+
return {
|
|
44
|
+
propositions: []
|
|
45
|
+
};
|
|
46
|
+
});
|
|
41
47
|
|
|
42
48
|
if (isAuthoringModeEnabled()) {
|
|
43
49
|
logger.warn(_loggerMessage.AUTHORING_ENABLED); // If we are in authoring mode we disable personalization
|
|
@@ -4,6 +4,8 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _utils = require("../../utils");
|
|
6
6
|
|
|
7
|
+
var _eventType = require("./constants/eventType");
|
|
8
|
+
|
|
7
9
|
/*
|
|
8
10
|
Copyright 2020 Adobe. All rights reserved.
|
|
9
11
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -31,7 +33,7 @@ var _default = function _default(_ref) {
|
|
|
31
33
|
|
|
32
34
|
if ((0, _utils.isNonEmptyArray)(decisionsMeta)) {
|
|
33
35
|
event.mergeXdm({
|
|
34
|
-
eventType:
|
|
36
|
+
eventType: _eventType.INTERACT
|
|
35
37
|
});
|
|
36
38
|
mergeDecisionsMeta(event, decisionsMeta);
|
|
37
39
|
}
|
|
@@ -4,6 +4,8 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _utils = require("../../utils");
|
|
6
6
|
|
|
7
|
+
var _eventType = require("./constants/eventType");
|
|
8
|
+
|
|
7
9
|
/*
|
|
8
10
|
Copyright 2020 Adobe. All rights reserved.
|
|
9
11
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -23,7 +25,7 @@ var _default = function _default(_ref) {
|
|
|
23
25
|
var decisionsMeta = _ref2.decisionsMeta,
|
|
24
26
|
xdm = _ref2.xdm;
|
|
25
27
|
var data = {
|
|
26
|
-
eventType:
|
|
28
|
+
eventType: _eventType.DISPLAY
|
|
27
29
|
};
|
|
28
30
|
var event = eventManager.createEvent();
|
|
29
31
|
|
|
@@ -6,6 +6,8 @@ var _dom = require("../../../utils/dom");
|
|
|
6
6
|
|
|
7
7
|
var _tagName = require("../../../constants/tagName");
|
|
8
8
|
|
|
9
|
+
var _elementAttribute = require("../../../constants/elementAttribute");
|
|
10
|
+
|
|
9
11
|
var _dom2 = require("./dom");
|
|
10
12
|
|
|
11
13
|
/*
|
|
@@ -24,7 +26,7 @@ var is = function is(element, tagName) {
|
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
var isInlineStyleElement = function isInlineStyleElement(element) {
|
|
27
|
-
return is(element, _tagName.STYLE) && !(0, _dom2.getAttribute)(element,
|
|
29
|
+
return is(element, _tagName.STYLE) && !(0, _dom2.getAttribute)(element, _elementAttribute.SRC);
|
|
28
30
|
};
|
|
29
31
|
|
|
30
32
|
var _default = function _default(fragment) {
|
|
@@ -6,6 +6,8 @@ var _dom = require("../../../utils/dom");
|
|
|
6
6
|
|
|
7
7
|
var _tagName = require("../../../constants/tagName");
|
|
8
8
|
|
|
9
|
+
var _elementAttribute = require("../../../constants/elementAttribute");
|
|
10
|
+
|
|
9
11
|
var _dom2 = require("./dom");
|
|
10
12
|
|
|
11
13
|
/*
|
|
@@ -36,7 +38,7 @@ exports.loadImage = loadImage;
|
|
|
36
38
|
var loadImages = function loadImages(fragment) {
|
|
37
39
|
var images = (0, _dom.selectNodes)(_tagName.IMG, fragment);
|
|
38
40
|
images.forEach(function (image) {
|
|
39
|
-
var url = (0, _dom2.getAttribute)(image,
|
|
41
|
+
var url = (0, _dom2.getAttribute)(image, _elementAttribute.SRC);
|
|
40
42
|
|
|
41
43
|
if (url) {
|
|
42
44
|
loadImage(url);
|
|
@@ -8,6 +8,8 @@ var _dom = require("../../../utils/dom");
|
|
|
8
8
|
|
|
9
9
|
var _tagName = require("../../../constants/tagName");
|
|
10
10
|
|
|
11
|
+
var _elementAttribute = require("../../../constants/elementAttribute");
|
|
12
|
+
|
|
11
13
|
var _dom2 = require("./dom");
|
|
12
14
|
|
|
13
15
|
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; }
|
|
@@ -23,11 +25,11 @@ var is = function is(element, tagName) {
|
|
|
23
25
|
exports.is = is;
|
|
24
26
|
|
|
25
27
|
var isInlineScript = function isInlineScript(element) {
|
|
26
|
-
return is(element, _tagName.SCRIPT) && !(0, _dom2.getAttribute)(element,
|
|
28
|
+
return is(element, _tagName.SCRIPT) && !(0, _dom2.getAttribute)(element, _elementAttribute.SRC);
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
var isRemoteScript = function isRemoteScript(element) {
|
|
30
|
-
return is(element, _tagName.SCRIPT) && (0, _dom2.getAttribute)(element,
|
|
32
|
+
return is(element, _tagName.SCRIPT) && (0, _dom2.getAttribute)(element, _elementAttribute.SRC);
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
var getInlineScripts = function getInlineScripts(fragment) {
|
|
@@ -80,7 +82,7 @@ var getRemoteScriptsUrls = function getRemoteScriptsUrls(fragment) {
|
|
|
80
82
|
continue;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
|
-
var url = (0, _dom2.getAttribute)(element,
|
|
85
|
+
var url = (0, _dom2.getAttribute)(element, _elementAttribute.SRC);
|
|
84
86
|
|
|
85
87
|
if (!url) {
|
|
86
88
|
continue;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _elementAttribute = require("../../../constants/elementAttribute");
|
|
6
6
|
|
|
7
7
|
var _dom = require("./dom");
|
|
8
8
|
|
|
@@ -27,9 +27,9 @@ var _default = function _default(container, url) {
|
|
|
27
27
|
|
|
28
28
|
(0, _images.loadImage)(url); // Remove "src" so there is no flicker
|
|
29
29
|
|
|
30
|
-
(0, _dom.removeAttribute)(container,
|
|
30
|
+
(0, _dom.removeAttribute)(container, _elementAttribute.SRC); // Replace the image "src"
|
|
31
31
|
|
|
32
|
-
(0, _dom.setAttribute)(container,
|
|
32
|
+
(0, _dom.setAttribute)(container, _elementAttribute.SRC, url);
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
exports.default = _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _request = require("../../utils/request");
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -16,7 +16,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
var _default = function _default(consentRequestPayload) {
|
|
19
|
-
return (0,
|
|
19
|
+
return (0, _request.createRequest)({
|
|
20
20
|
payload: consentRequestPayload,
|
|
21
21
|
getAction: function getAction() {
|
|
22
22
|
return "privacy/set-consent";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _request = require("../../utils/request");
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -17,7 +17,7 @@ governing permissions and limitations under the License.
|
|
|
17
17
|
*/
|
|
18
18
|
var _default = function _default() {
|
|
19
19
|
var content = {};
|
|
20
|
-
var payload = (0,
|
|
20
|
+
var payload = (0, _request.createRequestPayload)({
|
|
21
21
|
content: content,
|
|
22
22
|
addIdentity: function addIdentity(namespaceCode, identity) {
|
|
23
23
|
content.identityMap = content.identityMap || {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.SRC = 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 SRC = "src";
|
|
17
|
+
exports.SRC = SRC;
|
|
@@ -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.9.0-alpha.1";
|
|
19
19
|
exports.default = _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports.STYLE = exports.
|
|
3
|
+
exports.STYLE = exports.SCRIPT = exports.IMG = exports.IFRAME = exports.HEAD = exports.DIV = exports.BODY = void 0;
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -25,7 +25,5 @@ var STYLE = "STYLE";
|
|
|
25
25
|
exports.STYLE = STYLE;
|
|
26
26
|
var SCRIPT = "SCRIPT";
|
|
27
27
|
exports.SCRIPT = SCRIPT;
|
|
28
|
-
var SRC = "src";
|
|
29
|
-
exports.SRC = SRC;
|
|
30
28
|
var HEAD = "HEAD";
|
|
31
29
|
exports.HEAD = HEAD;
|
package/libEs5/core/index.js
CHANGED
|
@@ -52,9 +52,7 @@ var _createEventManager = require("./createEventManager");
|
|
|
52
52
|
|
|
53
53
|
var _createCookieTransfer = require("./createCookieTransfer");
|
|
54
54
|
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
var _createDataCollectionRequest = require("./edgeNetwork/requests/createDataCollectionRequest");
|
|
55
|
+
var _request = require("../utils/request");
|
|
58
56
|
|
|
59
57
|
var _injectSendEdgeNetworkRequest = require("./edgeNetwork/injectSendEdgeNetworkRequest");
|
|
60
58
|
|
|
@@ -168,8 +166,8 @@ var createExecuteCommand = function createExecuteCommand(_ref) {
|
|
|
168
166
|
lifecycle: lifecycle,
|
|
169
167
|
consent: consent,
|
|
170
168
|
createEvent: _createEvent.default,
|
|
171
|
-
createDataCollectionRequestPayload:
|
|
172
|
-
createDataCollectionRequest:
|
|
169
|
+
createDataCollectionRequestPayload: _request.createDataCollectionRequestPayload,
|
|
170
|
+
createDataCollectionRequest: _request.createDataCollectionRequest,
|
|
173
171
|
sendEdgeNetworkRequest: sendEdgeNetworkRequest
|
|
174
172
|
});
|
|
175
173
|
return (0, _initializeComponents.default)({
|
package/libEs5/{core/edgeNetwork/requests/contentModifiers → utils/request}/createAddIdentity.js
RENAMED
|
File without changes
|
|
File without changes
|
package/libEs5/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequestPayload.js
RENAMED
|
@@ -4,7 +4,7 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _createRequestPayload = require("./createRequestPayload");
|
|
6
6
|
|
|
7
|
-
var _createAddIdentity = require("./
|
|
7
|
+
var _createAddIdentity = require("./createAddIdentity");
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _ = require("..");
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Copyright 2020 Adobe. All rights reserved.
|
|
@@ -20,7 +20,7 @@ var _default = function _default(options) {
|
|
|
20
20
|
var payload = options.payload,
|
|
21
21
|
_getAction = options.getAction,
|
|
22
22
|
_getUseSendBeacon = options.getUseSendBeacon;
|
|
23
|
-
var id = (0,
|
|
23
|
+
var id = (0, _.uuid)();
|
|
24
24
|
var shouldUseThirdPartyDomain = false;
|
|
25
25
|
var isIdentityEstablished = false;
|
|
26
26
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _ = require("..");
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Copyright 2019 Adobe. All rights reserved.
|
|
@@ -21,8 +21,8 @@ var _default = function _default(options) {
|
|
|
21
21
|
var content = options.content,
|
|
22
22
|
addIdentity = options.addIdentity;
|
|
23
23
|
return {
|
|
24
|
-
mergeState: (0,
|
|
25
|
-
mergeQuery: (0,
|
|
24
|
+
mergeState: (0, _.createMerger)(content, "meta.state"),
|
|
25
|
+
mergeQuery: (0, _.createMerger)(content, "query"),
|
|
26
26
|
addIdentity: addIdentity,
|
|
27
27
|
toJSON: function toJSON() {
|
|
28
28
|
return content;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "createAddIdentity", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function get() {
|
|
6
|
+
return _createAddIdentity.default;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "createDataCollectionRequest", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return _createDataCollectionRequest.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "createDataCollectionRequestPayload", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _createDataCollectionRequestPayload.default;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "createRequest", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _createRequest.default;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "createRequestPayload", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function get() {
|
|
30
|
+
return _createRequestPayload.default;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var _createAddIdentity = require("./createAddIdentity");
|
|
35
|
+
|
|
36
|
+
var _createDataCollectionRequest = require("./createDataCollectionRequest");
|
|
37
|
+
|
|
38
|
+
var _createDataCollectionRequestPayload = require("./createDataCollectionRequestPayload");
|
|
39
|
+
|
|
40
|
+
var _createRequest = require("./createRequest");
|
|
41
|
+
|
|
42
|
+
var _createRequestPayload = require("./createRequestPayload");
|
|
@@ -12,8 +12,7 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
import validateUserEventOptions from "./validateUserEventOptions";
|
|
13
13
|
|
|
14
14
|
const createDataCollector = ({
|
|
15
|
-
eventManager
|
|
16
|
-
logger
|
|
15
|
+
eventManager
|
|
17
16
|
}) => {
|
|
18
17
|
return {
|
|
19
18
|
commands: {
|
|
@@ -21,8 +20,7 @@ const createDataCollector = ({
|
|
|
21
20
|
documentationUri: "https://adobe.ly/2r0uUjh",
|
|
22
21
|
optionsValidator: options => {
|
|
23
22
|
return validateUserEventOptions({
|
|
24
|
-
options
|
|
25
|
-
logger
|
|
23
|
+
options
|
|
26
24
|
});
|
|
27
25
|
},
|
|
28
26
|
run: options => {
|
|
@@ -14,13 +14,11 @@ import { validateIdentityMap } from "../../utils";
|
|
|
14
14
|
/**
|
|
15
15
|
* Verifies user provided event options.
|
|
16
16
|
* @param {*} options The user event options to validate
|
|
17
|
-
* @param {*} logger
|
|
18
17
|
* @returns {*} Validated options
|
|
19
18
|
*/
|
|
20
19
|
|
|
21
20
|
export default (({
|
|
22
|
-
options
|
|
23
|
-
logger
|
|
21
|
+
options
|
|
24
22
|
}) => {
|
|
25
23
|
const eventOptionsValidator = objectOf({
|
|
26
24
|
type: string(),
|
|
@@ -33,15 +31,5 @@ export default (({
|
|
|
33
31
|
decisionScopes: arrayOf(string()),
|
|
34
32
|
datasetId: string()
|
|
35
33
|
}).required();
|
|
36
|
-
|
|
37
|
-
const {
|
|
38
|
-
type,
|
|
39
|
-
xdm
|
|
40
|
-
} = validatedOptions;
|
|
41
|
-
|
|
42
|
-
if (xdm && !xdm.eventType && !type) {
|
|
43
|
-
logger.warn("No type or xdm.eventType specified.");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return validatedOptions;
|
|
34
|
+
return eventOptionsValidator(options);
|
|
47
35
|
});
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import createRequest from "../../../
|
|
12
|
+
import { createRequest } from "../../../utils/request";
|
|
13
13
|
export default (identityRequestPayload => {
|
|
14
14
|
return createRequest({
|
|
15
15
|
payload: identityRequestPayload,
|
|
@@ -9,8 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import createRequestPayload from "../../../
|
|
13
|
-
import createAddIdentity from "../../../core/edgeNetwork/requests/contentModifiers/createAddIdentity";
|
|
12
|
+
import { createAddIdentity, createRequestPayload } from "../../../utils/request";
|
|
14
13
|
export default (namespaces => {
|
|
15
14
|
const content = {
|
|
16
15
|
query: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export const DISPLAY = "decisioning.propositionDisplay";
|
|
13
|
+
export const INTERACT = "decisioning.propositionInteract";
|
|
@@ -9,6 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
import { DISPLAY } from "./constants/eventType";
|
|
12
13
|
export default (({
|
|
13
14
|
eventManager,
|
|
14
15
|
mergeDecisionsMeta
|
|
@@ -20,7 +21,7 @@ export default (({
|
|
|
20
21
|
}) => {
|
|
21
22
|
const event = eventManager.createEvent();
|
|
22
23
|
event.mergeXdm({
|
|
23
|
-
eventType:
|
|
24
|
+
eventType: DISPLAY
|
|
24
25
|
});
|
|
25
26
|
mergeDecisionsMeta(event, decisionsMeta);
|
|
26
27
|
|
|
@@ -30,6 +30,11 @@ export default (({
|
|
|
30
30
|
onResponse = noop,
|
|
31
31
|
onRequestFailure = noop
|
|
32
32
|
}) {
|
|
33
|
+
// Include proositions on all responses, overridden with data as needed
|
|
34
|
+
onResponse(() => ({
|
|
35
|
+
propositions: []
|
|
36
|
+
}));
|
|
37
|
+
|
|
33
38
|
if (isAuthoringModeEnabled()) {
|
|
34
39
|
logger.warn(AUTHORING_ENABLED); // If we are in authoring mode we disable personalization
|
|
35
40
|
|
|
@@ -10,6 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { isNonEmptyArray } from "../../utils";
|
|
13
|
+
import { INTERACT } from "./constants/eventType";
|
|
13
14
|
export default (({
|
|
14
15
|
mergeDecisionsMeta,
|
|
15
16
|
collectClicks,
|
|
@@ -28,7 +29,7 @@ export default (({
|
|
|
28
29
|
|
|
29
30
|
if (isNonEmptyArray(decisionsMeta)) {
|
|
30
31
|
event.mergeXdm({
|
|
31
|
-
eventType:
|
|
32
|
+
eventType: INTERACT
|
|
32
33
|
});
|
|
33
34
|
mergeDecisionsMeta(event, decisionsMeta);
|
|
34
35
|
}
|
|
@@ -10,6 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { isNonEmptyArray } from "../../utils";
|
|
13
|
+
import { DISPLAY } from "./constants/eventType";
|
|
13
14
|
export default (({
|
|
14
15
|
eventManager,
|
|
15
16
|
mergeDecisionsMeta
|
|
@@ -20,7 +21,7 @@ export default (({
|
|
|
20
21
|
xdm
|
|
21
22
|
}) => {
|
|
22
23
|
const data = {
|
|
23
|
-
eventType:
|
|
24
|
+
eventType: DISPLAY
|
|
24
25
|
};
|
|
25
26
|
const event = eventManager.createEvent();
|
|
26
27
|
|
|
@@ -10,7 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { selectNodes } from "../../../utils/dom";
|
|
13
|
-
import {
|
|
13
|
+
import { STYLE } from "../../../constants/tagName";
|
|
14
|
+
import { SRC } from "../../../constants/elementAttribute";
|
|
14
15
|
import { getAttribute, getNonce } from "./dom";
|
|
15
16
|
|
|
16
17
|
const is = (element, tagName) => element.tagName === tagName;
|
|
@@ -10,7 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { createNode, selectNodes } from "../../../utils/dom";
|
|
13
|
-
import { IMG
|
|
13
|
+
import { IMG } from "../../../constants/tagName";
|
|
14
|
+
import { SRC } from "../../../constants/elementAttribute";
|
|
14
15
|
import { getAttribute } from "./dom";
|
|
15
16
|
export const isImage = element => element.tagName === IMG;
|
|
16
17
|
export const loadImage = url => {
|
|
@@ -11,7 +11,8 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
import loadScript from "@adobe/reactor-load-script";
|
|
13
13
|
import { selectNodes, createNode } from "../../../utils/dom";
|
|
14
|
-
import {
|
|
14
|
+
import { SCRIPT } from "../../../constants/tagName";
|
|
15
|
+
import { SRC } from "../../../constants/elementAttribute";
|
|
15
16
|
import { getAttribute, getNonce } from "./dom";
|
|
16
17
|
export const is = (element, tagName) => !!element && element.tagName === tagName;
|
|
17
18
|
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { SRC } from "../../../constants/
|
|
12
|
+
import { SRC } from "../../../constants/elementAttribute";
|
|
13
13
|
import { setAttribute, removeAttribute } from "./dom";
|
|
14
14
|
import { isImage, loadImage } from "./images";
|
|
15
15
|
export default ((container, url) => {
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import createRequest from "../../
|
|
12
|
+
import { createRequest } from "../../utils/request";
|
|
13
13
|
export default (consentRequestPayload => {
|
|
14
14
|
return createRequest({
|
|
15
15
|
payload: consentRequestPayload,
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import createRequestPayload from "../../
|
|
12
|
+
import { createRequestPayload } from "../../utils/request";
|
|
13
13
|
export default (() => {
|
|
14
14
|
const content = {};
|
|
15
15
|
const payload = createRequestPayload({
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export const SRC = "src";
|
package/libEs6/core/index.js
CHANGED
|
@@ -34,8 +34,7 @@ import injectSendBeaconRequest from "./network/requestMethods/injectSendBeaconRe
|
|
|
34
34
|
import createLogger from "./createLogger";
|
|
35
35
|
import createEventManager from "./createEventManager";
|
|
36
36
|
import createCookieTransfer from "./createCookieTransfer";
|
|
37
|
-
import createDataCollectionRequestPayload from "
|
|
38
|
-
import createDataCollectionRequest from "./edgeNetwork/requests/createDataCollectionRequest";
|
|
37
|
+
import { createDataCollectionRequest, createDataCollectionRequestPayload } from "../utils/request";
|
|
39
38
|
import injectSendEdgeNetworkRequest from "./edgeNetwork/injectSendEdgeNetworkRequest";
|
|
40
39
|
import injectProcessWarningsAndErrors from "./edgeNetwork/injectProcessWarningsAndErrors";
|
|
41
40
|
import isRequestRetryable from "./network/isRequestRetryable";
|
package/libEs6/{core/edgeNetwork/requests/contentModifiers → utils/request}/createAddIdentity.js
RENAMED
|
File without changes
|
|
File without changes
|
package/libEs6/{core/edgeNetwork/requests → utils/request}/createDataCollectionRequestPayload.js
RENAMED
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import createRequestPayload from "./createRequestPayload";
|
|
13
|
-
import createAddIdentity from "./
|
|
13
|
+
import createAddIdentity from "./createAddIdentity";
|
|
14
14
|
export default (() => {
|
|
15
15
|
const content = {};
|
|
16
16
|
const payload = createRequestPayload({
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { uuid } from "
|
|
12
|
+
import { uuid } from ".."; // This provides the base functionality that all types of requests share.
|
|
13
13
|
|
|
14
14
|
export default (options => {
|
|
15
15
|
const {
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { createMerger } from "
|
|
12
|
+
import { createMerger } from ".."; // This provides the base functionality that all types of
|
|
13
13
|
// request payloads share.
|
|
14
14
|
|
|
15
15
|
export default (options => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
export { default as createAddIdentity } from "./createAddIdentity";
|
|
13
|
+
export { default as createDataCollectionRequest } from "./createDataCollectionRequest";
|
|
14
|
+
export { default as createDataCollectionRequestPayload } from "./createDataCollectionRequestPayload";
|
|
15
|
+
export { default as createRequest } from "./createRequest";
|
|
16
|
+
export { default as createRequestPayload } from "./createRequestPayload";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/alloy",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0-alpha.1",
|
|
4
4
|
"description": "Adobe Experience Platform Web SDK",
|
|
5
5
|
"main": "libEs5/index.js",
|
|
6
6
|
"module": "libEs6/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^3.3.2"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@adobe/alloy": "^2.
|
|
67
|
+
"@adobe/alloy": "^2.9.0-alpha.0",
|
|
68
68
|
"@babel/cli": "^7.12.8",
|
|
69
69
|
"@babel/core": "^7.2.2",
|
|
70
70
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|