@adobe/alloy 2.15.0 → 2.16.0-alpha.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/DataCollector/index.js +26 -10
- package/libEs5/components/DataCollector/validateApplyResponse.js +11 -0
- package/libEs5/components/DataCollector/validateUserEventOptions.js +2 -1
- package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +4 -1
- package/libEs5/components/Identity/createComponent.js +13 -2
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +11 -3
- package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +8 -11
- package/libEs5/components/Identity/index.js +8 -4
- package/libEs5/components/Personalization/constants/loggerMessage.js +12 -0
- package/libEs5/components/Personalization/utils/composePersonalizationResultingObject.js +11 -0
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +11 -0
- package/libEs5/components/Privacy/createComponent.js +4 -2
- package/libEs5/components/Privacy/index.js +2 -1
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +6 -2
- package/libEs5/components/Privacy/validateSetConsentOptions.js +13 -1
- package/libEs5/constants/apiVersion.js +12 -0
- package/libEs5/constants/edgeBasePath.js +12 -0
- package/libEs5/constants/identityMapAuthenticatedState.js +12 -0
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/core/config/createCoreConfigs.js +2 -1
- package/libEs5/core/createEventManager.js +5 -1
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +11 -0
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +11 -0
- package/libEs5/utils/filterObject.js +57 -0
- package/libEs5/utils/index.js +24 -0
- package/libEs5/utils/prepareConfigOverridesForEdge.js +61 -0
- package/libEs5/utils/request/createRequestPayload.js +6 -0
- package/libEs5/utils/stringToBoolean.js +11 -0
- package/libEs5/utils/validateConfigOverride.js +20 -0
- package/libEs6/components/DataCollector/index.js +25 -10
- package/libEs6/components/DataCollector/validateApplyResponse.js +11 -0
- package/libEs6/components/DataCollector/validateUserEventOptions.js +3 -2
- package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +3 -1
- package/libEs6/components/Identity/createComponent.js +13 -2
- package/libEs6/components/Identity/getIdentity/createGetIdentity.js +10 -3
- package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +6 -10
- package/libEs6/components/Identity/index.js +8 -4
- package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +11 -0
- package/libEs6/components/Personalization/constants/loggerMessage.js +11 -0
- package/libEs6/components/Personalization/utils/composePersonalizationResultingObject.js +11 -0
- package/libEs6/components/Personalization/validateApplyPropositionsOptions.js +11 -0
- package/libEs6/components/Privacy/createComponent.js +4 -2
- package/libEs6/components/Privacy/createConsentHashStore.js +11 -0
- package/libEs6/components/Privacy/index.js +2 -1
- package/libEs6/components/Privacy/injectSendSetConsentRequest.js +6 -2
- package/libEs6/components/Privacy/validateSetConsentOptions.js +14 -2
- package/libEs6/constants/apiVersion.js +11 -0
- package/libEs6/constants/edgeBasePath.js +11 -0
- package/libEs6/constants/identityMapAuthenticatedState.js +11 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/config/createCoreConfigs.js +3 -2
- package/libEs6/core/createEventManager.js +5 -1
- package/libEs6/core/edgeNetwork/handleRequestFailure.js +11 -0
- package/libEs6/core/edgeNetwork/injectApplyResponse.js +11 -0
- package/libEs6/core/edgeNetwork/mergeLifecycleResponses.js +11 -0
- package/libEs6/utils/filterObject.js +59 -0
- package/libEs6/utils/index.js +3 -0
- package/libEs6/utils/prepareConfigOverridesForEdge.js +57 -0
- package/libEs6/utils/request/createRequestPayload.js +3 -1
- package/libEs6/utils/stringToBoolean.js +11 -0
- package/libEs6/utils/validateConfigOverride.js +13 -0
- package/package.json +6 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _isNil = require("./isNil");
|
|
6
|
+
|
|
7
|
+
var _filterObject = require("./filterObject");
|
|
8
|
+
|
|
9
|
+
var _isEmptyObject = require("./isEmptyObject");
|
|
10
|
+
|
|
11
|
+
var _isNonEmptyArray = require("./isNonEmptyArray");
|
|
12
|
+
|
|
13
|
+
var _isNonEmptyString = require("./isNonEmptyString");
|
|
14
|
+
|
|
15
|
+
var _isNumber = require("./isNumber");
|
|
16
|
+
|
|
17
|
+
var _isBoolean = require("./isBoolean");
|
|
18
|
+
|
|
19
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
20
|
+
|
|
21
|
+
// We want to avoid mapping between specific keys because we want Konductor
|
|
22
|
+
// to be able to add overrides in the future without us needing to make
|
|
23
|
+
// any changes to the Web SDK
|
|
24
|
+
var _default = function _default(configuration) {
|
|
25
|
+
if ((0, _isNil.default)(configuration) || _typeof(configuration) !== "object") {
|
|
26
|
+
return null;
|
|
27
|
+
} // remove entries that are empty strings or arrays
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var configOverrides = (0, _filterObject.default)(configuration, function (value) {
|
|
31
|
+
if ((0, _isNil.default)(value)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if ((0, _isBoolean.default)(value)) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if ((0, _isNumber.default)(value)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if ((0, _isNonEmptyString.default)(value)) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if ((0, _isNonEmptyArray.default)(value)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if ((0, _isEmptyObject.default)(configOverrides)) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return configOverrides;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.default = _default;
|
|
@@ -21,10 +21,16 @@ var _default = function _default(options) {
|
|
|
21
21
|
var content = options.content,
|
|
22
22
|
addIdentity = options.addIdentity,
|
|
23
23
|
hasIdentity = options.hasIdentity;
|
|
24
|
+
|
|
25
|
+
var _mergeConfigOverride = (0, _.createMerger)(content, "meta.configOverrides");
|
|
26
|
+
|
|
24
27
|
return {
|
|
25
28
|
mergeMeta: (0, _.createMerger)(content, "meta"),
|
|
26
29
|
mergeState: (0, _.createMerger)(content, "meta.state"),
|
|
27
30
|
mergeQuery: (0, _.createMerger)(content, "query"),
|
|
31
|
+
mergeConfigOverride: function mergeConfigOverride(updates) {
|
|
32
|
+
return _mergeConfigOverride((0, _.prepareConfigOverridesForEdge)(updates));
|
|
33
|
+
},
|
|
28
34
|
addIdentity: addIdentity,
|
|
29
35
|
hasIdentity: hasIdentity,
|
|
30
36
|
toJSON: function toJSON() {
|
|
@@ -4,6 +4,17 @@ exports.default = void 0;
|
|
|
4
4
|
|
|
5
5
|
var _isString = require("./isString");
|
|
6
6
|
|
|
7
|
+
/*
|
|
8
|
+
Copyright 2023 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
|
+
*/
|
|
7
18
|
var _default = function _default(str) {
|
|
8
19
|
return (0, _isString.default)(str) && str.toLowerCase() === "true";
|
|
9
20
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.default = void 0;
|
|
4
|
+
|
|
5
|
+
var _validation = require("./validation");
|
|
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 = (0, _validation.objectOf)({});
|
|
19
|
+
|
|
20
|
+
exports.default = _default;
|
|
@@ -11,9 +11,11 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
import validateUserEventOptions from "./validateUserEventOptions";
|
|
13
13
|
import validateApplyResponse from "./validateApplyResponse";
|
|
14
|
+
import { deepAssign } from "../../utils";
|
|
14
15
|
|
|
15
16
|
const createDataCollector = ({
|
|
16
|
-
eventManager
|
|
17
|
+
eventManager,
|
|
18
|
+
logger
|
|
17
19
|
}) => {
|
|
18
20
|
return {
|
|
19
21
|
commands: {
|
|
@@ -35,7 +37,8 @@ const createDataCollector = ({
|
|
|
35
37
|
decisionScopes = [],
|
|
36
38
|
// Note: this option will soon be deprecated, please use personalization.decisionScopes instead
|
|
37
39
|
personalization = {},
|
|
38
|
-
datasetId
|
|
40
|
+
datasetId,
|
|
41
|
+
edgeConfigOverrides
|
|
39
42
|
} = options;
|
|
40
43
|
const event = eventManager.createEvent();
|
|
41
44
|
|
|
@@ -58,19 +61,31 @@ const createDataCollector = ({
|
|
|
58
61
|
});
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
const sendEventOptions = {
|
|
65
|
+
renderDecisions,
|
|
66
|
+
decisionScopes,
|
|
67
|
+
personalization
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
if (edgeConfigOverrides) {
|
|
71
|
+
sendEventOptions.edgeConfigOverrides = edgeConfigOverrides;
|
|
72
|
+
}
|
|
73
|
+
|
|
61
74
|
if (datasetId) {
|
|
62
|
-
event.
|
|
63
|
-
|
|
64
|
-
|
|
75
|
+
logger.warn("The 'datasetId' option has been deprecated. Please use 'edgeConfigOverrides.experience_platform.datasets.event' instead.");
|
|
76
|
+
sendEventOptions.edgeConfigOverrides = edgeConfigOverrides || {};
|
|
77
|
+
deepAssign(sendEventOptions.edgeConfigOverrides, {
|
|
78
|
+
com_adobe_experience_platform: {
|
|
79
|
+
datasets: {
|
|
80
|
+
event: {
|
|
81
|
+
datasetId
|
|
82
|
+
}
|
|
83
|
+
}
|
|
65
84
|
}
|
|
66
85
|
});
|
|
67
86
|
}
|
|
68
87
|
|
|
69
|
-
return eventManager.sendEvent(event,
|
|
70
|
-
renderDecisions,
|
|
71
|
-
decisionScopes,
|
|
72
|
-
personalization
|
|
73
|
-
});
|
|
88
|
+
return eventManager.sendEvent(event, sendEventOptions);
|
|
74
89
|
}
|
|
75
90
|
},
|
|
76
91
|
applyResponse: {
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { anything, arrayOf, boolean, mapOfValues, objectOf, string } from "../../utils/validation";
|
|
2
13
|
export default (({
|
|
3
14
|
options
|
|
@@ -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 { string, objectOf, boolean, arrayOf } from "../../utils/validation";
|
|
13
|
-
import { validateIdentityMap } from "../../utils";
|
|
13
|
+
import { validateConfigOverride, validateIdentityMap } from "../../utils";
|
|
14
14
|
/**
|
|
15
15
|
* Verifies user provided event options.
|
|
16
16
|
* @param {*} options The user event options to validate
|
|
@@ -35,7 +35,8 @@ export default (({
|
|
|
35
35
|
surfaces: arrayOf(string()).uniqueItems()
|
|
36
36
|
}),
|
|
37
37
|
datasetId: string(),
|
|
38
|
-
mergeId: string()
|
|
38
|
+
mergeId: string(),
|
|
39
|
+
edgeConfigOverrides: validateConfigOverride
|
|
39
40
|
}).required().noUnknownFields();
|
|
40
41
|
return eventOptionsValidator(options);
|
|
41
42
|
});
|
package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js
CHANGED
|
@@ -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 { validateConfigOverride } from "../../../utils";
|
|
12
13
|
import { objectOf, string } from "../../../utils/validation";
|
|
13
14
|
/**
|
|
14
15
|
* Verifies user provided event options.
|
|
@@ -17,5 +18,6 @@ import { objectOf, string } from "../../../utils/validation";
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
export default objectOf({
|
|
20
|
-
url: string().required().nonEmpty()
|
|
21
|
+
url: string().required().nonEmpty(),
|
|
22
|
+
edgeConfigOverrides: validateConfigOverride
|
|
21
23
|
}).required().noUnknownFields();
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { assign } from "../../utils";
|
|
2
13
|
import getIdentityOptionsValidator from "./getIdentity/getIdentityOptionsValidator";
|
|
3
14
|
import appendIdentityToUrlOptionsValidator from "./appendIdentityToUrl/appendIdentityToUrlOptionsValidator";
|
|
@@ -57,7 +68,7 @@ export default (({
|
|
|
57
68
|
optionsValidator: getIdentityOptionsValidator,
|
|
58
69
|
run: options => {
|
|
59
70
|
return consent.awaitConsent().then(() => {
|
|
60
|
-
return ecid ? undefined : getIdentity(options
|
|
71
|
+
return ecid ? undefined : getIdentity(options);
|
|
61
72
|
}).then(() => {
|
|
62
73
|
return {
|
|
63
74
|
identity: {
|
|
@@ -72,7 +83,7 @@ export default (({
|
|
|
72
83
|
optionsValidator: appendIdentityToUrlOptionsValidator,
|
|
73
84
|
run: options => {
|
|
74
85
|
return consent.withConsent().then(() => {
|
|
75
|
-
return ecid ? undefined : getIdentity(options
|
|
86
|
+
return ecid ? undefined : getIdentity(options);
|
|
76
87
|
}).then(() => {
|
|
77
88
|
return {
|
|
78
89
|
url: appendIdentityToUrl(ecid, options.url)
|
|
@@ -12,11 +12,18 @@ governing permissions and limitations under the License.
|
|
|
12
12
|
export default (({
|
|
13
13
|
sendEdgeNetworkRequest,
|
|
14
14
|
createIdentityRequestPayload,
|
|
15
|
-
createIdentityRequest
|
|
15
|
+
createIdentityRequest,
|
|
16
|
+
globalConfigOverrides
|
|
16
17
|
}) => {
|
|
17
|
-
return
|
|
18
|
+
return ({
|
|
19
|
+
namespaces,
|
|
20
|
+
edgeConfigOverrides: localConfigOverrides
|
|
21
|
+
} = {}) => {
|
|
18
22
|
const payload = createIdentityRequestPayload(namespaces);
|
|
19
|
-
const request = createIdentityRequest(payload);
|
|
23
|
+
const request = createIdentityRequest(payload); // merge the configurations, but give preference to the command-local configs
|
|
24
|
+
|
|
25
|
+
payload.mergeConfigOverride(globalConfigOverrides);
|
|
26
|
+
payload.mergeConfigOverride(localConfigOverrides);
|
|
20
27
|
return sendEdgeNetworkRequest({
|
|
21
28
|
request
|
|
22
29
|
});
|
|
@@ -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 { validateConfigOverride } from "../../../utils";
|
|
12
13
|
import { objectOf, literal, arrayOf } from "../../../utils/validation";
|
|
13
14
|
/**
|
|
14
15
|
* Verifies user provided event options.
|
|
@@ -16,14 +17,9 @@ import { objectOf, literal, arrayOf } from "../../../utils/validation";
|
|
|
16
17
|
* @returns {*} Validated options
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
|
-
export default (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// To-Do: Accept namespace from given options
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
namespaces: ["ECID"]
|
|
28
|
-
};
|
|
20
|
+
export default objectOf({
|
|
21
|
+
namespaces: arrayOf(literal("ECID")).nonEmpty().uniqueItems().default(["ECID"]),
|
|
22
|
+
edgeConfigOverrides: validateConfigOverride
|
|
23
|
+
}).noUnknownFields().default({
|
|
24
|
+
namespaces: ["ECID"]
|
|
29
25
|
});
|
|
@@ -40,7 +40,8 @@ const createIdentity = ({
|
|
|
40
40
|
}) => {
|
|
41
41
|
const {
|
|
42
42
|
orgId,
|
|
43
|
-
thirdPartyCookiesEnabled
|
|
43
|
+
thirdPartyCookiesEnabled,
|
|
44
|
+
edgeConfigOverrides: globalConfigOverrides
|
|
44
45
|
} = config;
|
|
45
46
|
const getEcidFromVisitor = injectGetEcidFromVisitor({
|
|
46
47
|
logger,
|
|
@@ -64,7 +65,8 @@ const createIdentity = ({
|
|
|
64
65
|
const getIdentity = createGetIdentity({
|
|
65
66
|
sendEdgeNetworkRequest,
|
|
66
67
|
createIdentityRequestPayload,
|
|
67
|
-
createIdentityRequest
|
|
68
|
+
createIdentityRequest,
|
|
69
|
+
globalConfigOverrides
|
|
68
70
|
});
|
|
69
71
|
const setDomainForInitialIdentityPayload = injectSetDomainForInitialIdentityPayload({
|
|
70
72
|
thirdPartyCookiesEnabled,
|
|
@@ -100,7 +102,8 @@ const createIdentity = ({
|
|
|
100
102
|
});
|
|
101
103
|
const appendIdentityToUrl = injectAppendIdentityToUrl({
|
|
102
104
|
dateProvider: () => new Date(),
|
|
103
|
-
orgId
|
|
105
|
+
orgId,
|
|
106
|
+
globalConfigOverrides
|
|
104
107
|
});
|
|
105
108
|
return createComponent({
|
|
106
109
|
addEcidQueryToPayload,
|
|
@@ -112,7 +115,8 @@ const createIdentity = ({
|
|
|
112
115
|
getIdentity,
|
|
113
116
|
consent,
|
|
114
117
|
appendIdentityToUrl,
|
|
115
|
-
logger
|
|
118
|
+
logger,
|
|
119
|
+
config
|
|
116
120
|
});
|
|
117
121
|
};
|
|
118
122
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
// Example: adobe_mc=TS%3D1641432103%7CMCMID%3D77094828402023918047117570965393734545%7CMCORGID%3DFAF554945B90342F0A495E2C%40AdobeOrg
|
|
2
13
|
// Decoded: adobe_mc=TS=1641432103|MCMID=77094828402023918047117570965393734545|MCORGID=FAF554945B90342F0A495E2C@AdobeOrg
|
|
3
14
|
import { queryString } from "../../utils";
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
export const AUTHORING_ENABLED = "Rendering is disabled for authoring mode.";
|
|
2
13
|
export const REDIRECT_EXECUTION_ERROR = "An error occurred while executing the redirect offer.";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import addRenderAttemptedToDecisions from "./addRenderAttemptedToDecisions";
|
|
2
13
|
export default ((decisions = [], renderDecisions) => {
|
|
3
14
|
const resultingObject = {
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { anything, objectOf, arrayOf } from "../../utils/validation";
|
|
2
13
|
export const EMPTY_PROPOSITIONS = {
|
|
3
14
|
propositions: []
|
|
@@ -57,7 +57,8 @@ export default (({
|
|
|
57
57
|
optionsValidator: validateSetConsentOptions,
|
|
58
58
|
run: ({
|
|
59
59
|
consent: consentOptions,
|
|
60
|
-
identityMap
|
|
60
|
+
identityMap,
|
|
61
|
+
edgeConfigOverrides
|
|
61
62
|
}) => {
|
|
62
63
|
consent.suspend();
|
|
63
64
|
const consentHashes = consentHashStore.lookup(consentOptions);
|
|
@@ -65,7 +66,8 @@ export default (({
|
|
|
65
66
|
if (consentHashes.isNew()) {
|
|
66
67
|
return sendSetConsentRequest({
|
|
67
68
|
consentOptions,
|
|
68
|
-
identityMap
|
|
69
|
+
identityMap,
|
|
70
|
+
edgeConfigOverrides
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import computeConsentHash from "./computeConsentHash";
|
|
2
13
|
|
|
3
14
|
const getKey = ({
|
|
@@ -38,7 +38,8 @@ const createPrivacy = ({
|
|
|
38
38
|
const sendSetConsentRequest = injectSendSetConsentRequest({
|
|
39
39
|
createConsentRequestPayload,
|
|
40
40
|
createConsentRequest,
|
|
41
|
-
sendEdgeNetworkRequest
|
|
41
|
+
sendEdgeNetworkRequest,
|
|
42
|
+
edgeConfigOverrides: config.edgeConfigOverrides
|
|
42
43
|
});
|
|
43
44
|
const storage = createNamespacedStorage(`${sanitizeOrgIdForCookieName(orgId)}.consentHashes.`);
|
|
44
45
|
const consentHashStore = createConsentHashStore({
|
|
@@ -13,13 +13,17 @@ import { isObject } from "../../utils";
|
|
|
13
13
|
export default (({
|
|
14
14
|
createConsentRequestPayload,
|
|
15
15
|
createConsentRequest,
|
|
16
|
-
sendEdgeNetworkRequest
|
|
16
|
+
sendEdgeNetworkRequest,
|
|
17
|
+
edgeConfigOverrides: globalConfigOverrides
|
|
17
18
|
}) => ({
|
|
18
19
|
consentOptions,
|
|
19
|
-
identityMap
|
|
20
|
+
identityMap,
|
|
21
|
+
edgeConfigOverrides: localConfigOverrides
|
|
20
22
|
}) => {
|
|
21
23
|
const payload = createConsentRequestPayload();
|
|
22
24
|
payload.setConsent(consentOptions);
|
|
25
|
+
payload.mergeConfigOverride(globalConfigOverrides);
|
|
26
|
+
payload.mergeConfigOverride(localConfigOverrides);
|
|
23
27
|
|
|
24
28
|
if (isObject(identityMap)) {
|
|
25
29
|
Object.keys(identityMap).forEach(key => {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { objectOf, anything, arrayOf } from "../../utils/validation";
|
|
2
|
-
import { validateIdentityMap } from "../../utils";
|
|
13
|
+
import { validateIdentityMap, validateConfigOverride } from "../../utils";
|
|
3
14
|
export default objectOf({
|
|
4
15
|
consent: arrayOf(anything()).required().nonEmpty(),
|
|
5
|
-
identityMap: validateIdentityMap
|
|
16
|
+
identityMap: validateIdentityMap,
|
|
17
|
+
edgeConfigOverrides: validateConfigOverride
|
|
6
18
|
}).noUnknownFields().required();
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
export default "v1";
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
export default "ee";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
export const AMBIGUOUS = "ambiguous";
|
|
2
13
|
export const AUTHENTICATED = "authenticated";
|
|
3
14
|
export const LOGGED_OUT = "loggedOut";
|
|
@@ -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 { boolean, string, callback, enumOf } from "../../utils/validation";
|
|
13
|
-
import { noop } from "../../utils";
|
|
13
|
+
import { noop, validateConfigOverride } from "../../utils";
|
|
14
14
|
import { EDGE as EDGE_DOMAIN } from "../../constants/domain";
|
|
15
15
|
import EDGE_BASE_PATH from "../../constants/edgeBasePath";
|
|
16
16
|
import { IN, OUT, PENDING } from "../../constants/consentStatus";
|
|
@@ -21,5 +21,6 @@ export default (() => ({
|
|
|
21
21
|
edgeDomain: string().domain().default(EDGE_DOMAIN),
|
|
22
22
|
edgeBasePath: string().nonEmpty().default(EDGE_BASE_PATH),
|
|
23
23
|
orgId: string().unique().required(),
|
|
24
|
-
onBeforeEventSend: callback().default(noop)
|
|
24
|
+
onBeforeEventSend: callback().default(noop),
|
|
25
|
+
edgeConfigOverrides: validateConfigOverride
|
|
25
26
|
}));
|
|
@@ -24,7 +24,8 @@ export default (({
|
|
|
24
24
|
applyResponse
|
|
25
25
|
}) => {
|
|
26
26
|
const {
|
|
27
|
-
onBeforeEventSend
|
|
27
|
+
onBeforeEventSend,
|
|
28
|
+
edgeConfigOverrides: globalConfigOverrides
|
|
28
29
|
} = config;
|
|
29
30
|
return {
|
|
30
31
|
createEvent,
|
|
@@ -49,12 +50,15 @@ export default (({
|
|
|
49
50
|
const {
|
|
50
51
|
renderDecisions = false,
|
|
51
52
|
decisionScopes,
|
|
53
|
+
edgeConfigOverrides: localConfigOverrides,
|
|
52
54
|
personalization
|
|
53
55
|
} = options;
|
|
54
56
|
const payload = createDataCollectionRequestPayload();
|
|
55
57
|
const request = createDataCollectionRequest(payload);
|
|
56
58
|
const onResponseCallbackAggregator = createCallbackAggregator();
|
|
57
59
|
const onRequestFailureCallbackAggregator = createCallbackAggregator();
|
|
60
|
+
payload.mergeConfigOverride(globalConfigOverrides);
|
|
61
|
+
payload.mergeConfigOverride(localConfigOverrides);
|
|
58
62
|
return lifecycle.onBeforeEvent({
|
|
59
63
|
event,
|
|
60
64
|
renderDecisions,
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
export default (onRequestFailureCallbackAggregator => {
|
|
2
13
|
return error => {
|
|
3
14
|
// Regardless of whether the network call failed, an unexpected status
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { createCallbackAggregator, noop } from "../../utils";
|
|
2
13
|
import mergeLifecycleResponses from "./mergeLifecycleResponses";
|
|
3
14
|
import handleRequestFailure from "./handleRequestFailure";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 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
|
+
*/
|
|
1
12
|
import { assign } from "../../utils";
|
|
2
13
|
export default (returnValues => {
|
|
3
14
|
// Merges all returned objects from all `onResponse` callbacks into
|