@adobe/alloy 2.14.0-alpha.0 → 2.14.0-alpha.10

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.
Files changed (67) hide show
  1. package/libEs5/components/Context/injectPlaceContext.js +6 -3
  2. package/libEs5/components/DataCollector/index.js +28 -9
  3. package/libEs5/components/DataCollector/validateUserEventOptions.js +6 -1
  4. package/libEs5/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +4 -1
  5. package/libEs5/components/Identity/createComponent.js +2 -2
  6. package/libEs5/components/Identity/getIdentity/createGetIdentity.js +11 -3
  7. package/libEs5/components/Identity/getIdentity/getIdentityOptionsValidator.js +8 -11
  8. package/libEs5/components/Identity/index.js +8 -4
  9. package/libEs5/components/Personalization/constants/surface.js +23 -0
  10. package/libEs5/components/Personalization/createComponent.js +8 -2
  11. package/libEs5/components/Personalization/createGetPageLocation.js +23 -0
  12. package/libEs5/components/Personalization/createPersonalizationDetails.js +44 -10
  13. package/libEs5/components/Personalization/groupDecisions.js +3 -3
  14. package/libEs5/components/Personalization/index.js +6 -0
  15. package/libEs5/components/Personalization/utils/isPageWideScope.js +24 -0
  16. package/libEs5/components/Personalization/utils/surfaceUtils.js +128 -0
  17. package/libEs5/components/Privacy/createComponent.js +4 -2
  18. package/libEs5/components/Privacy/index.js +2 -1
  19. package/libEs5/components/Privacy/injectSendSetConsentRequest.js +6 -2
  20. package/libEs5/components/Privacy/validateSetConsentOptions.js +2 -1
  21. package/libEs5/constants/libraryVersion.js +1 -1
  22. package/libEs5/core/config/createCoreConfigs.js +2 -1
  23. package/libEs5/core/createEventManager.js +12 -3
  24. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +3 -2
  25. package/libEs5/core/index.js +6 -1
  26. package/libEs5/utils/filterObject.js +57 -0
  27. package/libEs5/utils/index.js +24 -0
  28. package/libEs5/utils/isNil.js +1 -1
  29. package/libEs5/utils/prepareConfigOverridesForEdge.js +61 -0
  30. package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +54 -0
  31. package/libEs5/utils/request/createRequestPayload.js +6 -0
  32. package/libEs5/utils/request/index.js +9 -1
  33. package/libEs5/utils/validateConfigOverride.js +20 -0
  34. package/libEs6/components/Context/injectPlaceContext.js +6 -3
  35. package/libEs6/components/DataCollector/index.js +27 -9
  36. package/libEs6/components/DataCollector/validateUserEventOptions.js +7 -2
  37. package/libEs6/components/Identity/appendIdentityToUrl/appendIdentityToUrlOptionsValidator.js +3 -1
  38. package/libEs6/components/Identity/createComponent.js +2 -2
  39. package/libEs6/components/Identity/getIdentity/createGetIdentity.js +10 -3
  40. package/libEs6/components/Identity/getIdentity/getIdentityOptionsValidator.js +6 -10
  41. package/libEs6/components/Identity/index.js +8 -4
  42. package/libEs6/components/Personalization/constants/surface.js +15 -0
  43. package/libEs6/components/Personalization/createComponent.js +6 -1
  44. package/libEs6/components/Personalization/createGetPageLocation.js +16 -0
  45. package/libEs6/components/Personalization/createPersonalizationDetails.js +40 -8
  46. package/libEs6/components/Personalization/groupDecisions.js +2 -2
  47. package/libEs6/components/Personalization/index.js +5 -0
  48. package/libEs6/components/Personalization/utils/isPageWideScope.js +14 -0
  49. package/libEs6/components/Personalization/utils/surfaceUtils.js +93 -0
  50. package/libEs6/components/Privacy/createComponent.js +4 -2
  51. package/libEs6/components/Privacy/index.js +2 -1
  52. package/libEs6/components/Privacy/injectSendSetConsentRequest.js +6 -2
  53. package/libEs6/components/Privacy/validateSetConsentOptions.js +3 -2
  54. package/libEs6/constants/libraryVersion.js +1 -1
  55. package/libEs6/core/config/createCoreConfigs.js +3 -2
  56. package/libEs6/core/createEventManager.js +12 -3
  57. package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +3 -2
  58. package/libEs6/core/index.js +7 -2
  59. package/libEs6/utils/filterObject.js +59 -0
  60. package/libEs6/utils/index.js +3 -0
  61. package/libEs6/utils/isNil.js +1 -1
  62. package/libEs6/utils/prepareConfigOverridesForEdge.js +57 -0
  63. package/libEs6/utils/request/createGetAssuranceValidationTokenParams.js +47 -0
  64. package/libEs6/utils/request/createRequestPayload.js +3 -1
  65. package/libEs6/utils/request/index.js +2 -1
  66. package/libEs6/utils/validateConfigOverride.js +13 -0
  67. package/package.json +5 -4
@@ -0,0 +1,57 @@
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
+ import isNil from "./isNil";
13
+ import filterObject from "./filterObject";
14
+ import isEmptyObject from "./isEmptyObject";
15
+ import isNonEmptyArray from "./isNonEmptyArray";
16
+ import isNonEmptyString from "./isNonEmptyString";
17
+ import isNumber from "./isNumber";
18
+ import isBoolean from "./isBoolean"; // We want to avoid mapping between specific keys because we want Konductor
19
+ // to be able to add overrides in the future without us needing to make
20
+ // any changes to the Web SDK
21
+
22
+ export default (configuration => {
23
+ if (isNil(configuration) || typeof configuration !== "object") {
24
+ return null;
25
+ } // remove entries that are empty strings or arrays
26
+
27
+
28
+ const configOverrides = filterObject(configuration, value => {
29
+ if (isNil(value)) {
30
+ return false;
31
+ }
32
+
33
+ if (isBoolean(value)) {
34
+ return true;
35
+ }
36
+
37
+ if (isNumber(value)) {
38
+ return true;
39
+ }
40
+
41
+ if (isNonEmptyString(value)) {
42
+ return true;
43
+ }
44
+
45
+ if (isNonEmptyArray(value)) {
46
+ return true;
47
+ }
48
+
49
+ return false;
50
+ });
51
+
52
+ if (isEmptyObject(configOverrides)) {
53
+ return null;
54
+ }
55
+
56
+ return configOverrides;
57
+ });
@@ -0,0 +1,47 @@
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
+ import { uuid, queryString } from "../index";
13
+ const ASSURANCE_VALIDATION_SESSION_URL_PARAM = "adb_validation_sessionid";
14
+ const ASSURANCE_VALIDATION_NAMESPACE = "validation.";
15
+ const CLIENT_ID = "clientId";
16
+
17
+ const getOrCreateAssuranceClientId = storage => {
18
+ let clientId = storage.persistent.getItem(CLIENT_ID);
19
+
20
+ if (!clientId) {
21
+ clientId = uuid();
22
+ storage.persistent.setItem(CLIENT_ID, clientId);
23
+ }
24
+
25
+ return clientId;
26
+ };
27
+
28
+ export default (({
29
+ window,
30
+ createNamespacedStorage
31
+ }) => {
32
+ const storage = createNamespacedStorage(ASSURANCE_VALIDATION_NAMESPACE);
33
+ return () => {
34
+ const parsedQuery = queryString.parse(window.location.search);
35
+ const validationSessionId = parsedQuery[ASSURANCE_VALIDATION_SESSION_URL_PARAM];
36
+
37
+ if (!validationSessionId) {
38
+ return "";
39
+ }
40
+
41
+ const clientId = getOrCreateAssuranceClientId(storage);
42
+ const validationToken = `${validationSessionId}|${clientId}`;
43
+ return `&${queryString.stringify({
44
+ adobeAepValidationToken: validationToken
45
+ })}`;
46
+ };
47
+ });
@@ -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 ".."; // This provides the base functionality that all types of
12
+ import { createMerger, prepareConfigOverridesForEdge } from ".."; // This provides the base functionality that all types of
13
13
  // request payloads share.
14
14
 
15
15
  export default (options => {
@@ -18,10 +18,12 @@ export default (options => {
18
18
  addIdentity,
19
19
  hasIdentity
20
20
  } = options;
21
+ const mergeConfigOverride = createMerger(content, "meta.configOverrides");
21
22
  return {
22
23
  mergeMeta: createMerger(content, "meta"),
23
24
  mergeState: createMerger(content, "meta.state"),
24
25
  mergeQuery: createMerger(content, "query"),
26
+ mergeConfigOverride: updates => mergeConfigOverride(prepareConfigOverridesForEdge(updates)),
25
27
  addIdentity,
26
28
  hasIdentity,
27
29
 
@@ -14,4 +14,5 @@ export { default as createDataCollectionRequest } from "./createDataCollectionRe
14
14
  export { default as createDataCollectionRequestPayload } from "./createDataCollectionRequestPayload";
15
15
  export { default as createHasIdentity } from "./createHasIdentity";
16
16
  export { default as createRequest } from "./createRequest";
17
- export { default as createRequestPayload } from "./createRequestPayload";
17
+ export { default as createRequestPayload } from "./createRequestPayload";
18
+ export { default as createGetAssuranceValidationTokenParams } from "./createGetAssuranceValidationTokenParams";
@@ -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
+ import { objectOf } from "./validation";
13
+ export default objectOf({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.14.0-alpha.0",
3
+ "version": "2.14.0-alpha.10",
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.13.0",
67
+ "@adobe/alloy": "^2.14.0-alpha.9",
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",
@@ -95,6 +95,7 @@
95
95
  "karma-jasmine": "^2.0.1",
96
96
  "karma-jasmine-html-reporter": "^1.4.2",
97
97
  "karma-jasmine-matchers": "^4.0.1",
98
+ "karma-junit-reporter": "^2.0.1",
98
99
  "karma-rollup-preprocessor": "^7.0.5",
99
100
  "karma-safari-launcher": "^1.0.0",
100
101
  "karma-sauce-launcher": "^4.3.6",
@@ -118,8 +119,8 @@
118
119
  "semver": "^7.3.7",
119
120
  "start-server-and-test": "^1.10.6",
120
121
  "testcafe": "^1.19.0",
121
- "testcafe-browser-provider-saucelabs": "^1.8.3",
122
- "testcafe-reporter-json": "^2.2.0",
122
+ "testcafe-browser-provider-saucelabs": "^1.9.0",
123
+ "testcafe-reporter-junit": "^3.0.2",
123
124
  "url-exists-nodejs": "^0.1.0",
124
125
  "url-parse": "^1.4.7",
125
126
  "yargs": "^16.2.0"