@adobe/alloy 2.19.2 → 2.20.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.
Files changed (59) hide show
  1. package/libEs5/components/Identity/index.js +1 -2
  2. package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +0 -4
  3. package/libEs5/components/Identity/injectAwaitIdentityCookie.js +11 -7
  4. package/libEs5/components/Identity/injectEnsureSingleIdentity.js +3 -6
  5. package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +272 -0
  6. package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +188 -0
  7. package/libEs5/components/LegacyMediaAnalytics/index.js +48 -0
  8. package/libEs5/components/LegacyMediaAnalytics/media/constants.js +154 -0
  9. package/libEs5/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +51 -0
  10. package/libEs5/components/MediaCollection/constants/eventTypes.js +25 -0
  11. package/libEs5/components/MediaCollection/createHeartbeatEngine.js +63 -0
  12. package/libEs5/components/MediaCollection/createMediaEventManager.js +109 -0
  13. package/libEs5/components/MediaCollection/createMediaRequest.js +30 -0
  14. package/libEs5/components/MediaCollection/createMediaSessionCacheManager.js +62 -0
  15. package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +31 -0
  16. package/libEs5/components/MediaCollection/index.js +165 -0
  17. package/libEs5/components/MediaCollection/validateMediaEventOptions.js +35 -0
  18. package/libEs5/components/MediaCollection/validateMediaSessionOptions.js +36 -0
  19. package/libEs5/components/Personalization/createFetchDataHandler.js +1 -4
  20. package/libEs5/components/Personalization/createNotificationHandler.js +2 -8
  21. package/libEs5/components/Personalization/createOnDecisionHandler.js +1 -1
  22. package/libEs5/constants/libraryVersion.js +1 -1
  23. package/libEs5/core/componentCreators.js +3 -1
  24. package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +1 -1
  25. package/libEs5/utils/debounce.js +30 -0
  26. package/libEs5/utils/request/createRequest.js +8 -1
  27. package/libEs5/utils/validation/createMaximumValidator.js +22 -0
  28. package/libEs5/utils/validation/index.js +11 -1
  29. package/libEs5/utils/validation/matchesRegexpValidator.js +22 -0
  30. package/libEs6/components/Identity/index.js +1 -2
  31. package/libEs6/components/Identity/injectAddQueryStringIdentityToPayload.js +1 -5
  32. package/libEs6/components/Identity/injectAwaitIdentityCookie.js +11 -7
  33. package/libEs6/components/Identity/injectEnsureSingleIdentity.js +3 -4
  34. package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +276 -0
  35. package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +186 -0
  36. package/libEs6/components/LegacyMediaAnalytics/index.js +45 -0
  37. package/libEs6/components/LegacyMediaAnalytics/media/constants.js +140 -0
  38. package/libEs6/components/LegacyMediaAnalytics/media/mediaKeysToXdmConverter.js +46 -0
  39. package/libEs6/components/MediaCollection/constants/eventTypes.js +21 -0
  40. package/libEs6/components/MediaCollection/createHeartbeatEngine.js +64 -0
  41. package/libEs6/components/MediaCollection/createMediaEventManager.js +115 -0
  42. package/libEs6/components/MediaCollection/createMediaRequest.js +28 -0
  43. package/libEs6/components/MediaCollection/createMediaSessionCacheManager.js +63 -0
  44. package/libEs6/components/MediaCollection/createUpdateMediaSessionState.js +30 -0
  45. package/libEs6/components/MediaCollection/index.js +164 -0
  46. package/libEs6/components/MediaCollection/validateMediaEventOptions.js +32 -0
  47. package/libEs6/components/MediaCollection/validateMediaSessionOptions.js +34 -0
  48. package/libEs6/components/Personalization/createFetchDataHandler.js +1 -4
  49. package/libEs6/components/Personalization/createNotificationHandler.js +2 -6
  50. package/libEs6/components/Personalization/createOnDecisionHandler.js +1 -1
  51. package/libEs6/constants/libraryVersion.js +1 -1
  52. package/libEs6/core/componentCreators.js +3 -1
  53. package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +1 -1
  54. package/libEs6/utils/debounce.js +22 -0
  55. package/libEs6/utils/request/createRequest.js +8 -1
  56. package/libEs6/utils/validation/createMaximumValidator.js +16 -0
  57. package/libEs6/utils/validation/index.js +11 -1
  58. package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
  59. package/package.json +3 -8
@@ -0,0 +1,16 @@
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
+ */
12
+ import { assertValid } from "./utils";
13
+ export default ((typeName, maximum) => (value, path) => {
14
+ assertValid(value <= maximum, value, path, `${typeName} less than or equal to ${maximum}`);
15
+ return value;
16
+ });
@@ -77,6 +77,7 @@ import createDeprecatedValidator from "./createDeprecatedValidator";
77
77
  import createLiteralValidator from "./createLiteralValidator";
78
78
  import createMapOfValuesValidator from "./createMapOfValuesValidator";
79
79
  import createMinimumValidator from "./createMinimumValidator";
80
+ import createMaximumValidator from "./createMaximumValidator";
80
81
  import createNoUnknownFieldsValidator from "./createNoUnknownFieldsValidator";
81
82
  import createNonEmptyValidator from "./createNonEmptyValidator";
82
83
  import createObjectOfValidator from "./createObjectOfValidator";
@@ -89,6 +90,7 @@ import numberValidator from "./numberValidator";
89
90
  import regexpValidator from "./regexpValidator";
90
91
  import requiredValidator from "./requiredValidator";
91
92
  import stringValidator from "./stringValidator";
93
+ import matchesRegexpValidator from "./matchesRegexpValidator";
92
94
 
93
95
  // The base validator does no validation and just returns the value unchanged
94
96
  const base = value => value;
@@ -113,6 +115,9 @@ const minimumInteger = function minimumInteger(minValue) {
113
115
  const minimumNumber = function minimumNumber(minValue) {
114
116
  return nullSafeChain(this, createMinimumValidator("a number", minValue));
115
117
  };
118
+ const maximumNumber = function maximumNumber(maxValue) {
119
+ return nullSafeChain(this, createMaximumValidator("a number", maxValue));
120
+ };
116
121
  const integer = function integer() {
117
122
  return nullSafeChain(this, integerValidator, {
118
123
  minimum: minimumInteger
@@ -130,6 +135,9 @@ const nonEmptyObject = function nonEmptyObject() {
130
135
  const regexp = function regexp() {
131
136
  return nullSafeChain(this, regexpValidator);
132
137
  };
138
+ const matches = function matches(regexpPattern) {
139
+ return nullSafeChain(this, matchesRegexpValidator(regexpPattern));
140
+ };
133
141
  const unique = function createUnique() {
134
142
  return nullSafeChain(this, createUniqueValidator());
135
143
  };
@@ -164,6 +172,7 @@ const literal = function literal(literalValue) {
164
172
  const number = function number() {
165
173
  return nullSafeChain(this, numberValidator, {
166
174
  minimum: minimumNumber,
175
+ maximum: maximumNumber,
167
176
  integer,
168
177
  unique
169
178
  });
@@ -201,7 +210,8 @@ const string = function string() {
201
210
  regexp,
202
211
  domain,
203
212
  nonEmpty: nonEmptyString,
204
- unique
213
+ unique,
214
+ matches
205
215
  });
206
216
  };
207
217
  const boundAnyOf = anyOf.bind(base);
@@ -0,0 +1,17 @@
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
+ */
12
+
13
+ import { assertValid } from "./utils";
14
+ export default (regexp => (value, path) => {
15
+ assertValid(regexp.test(value), value, path, `does not match the ${regexp.toString()}`);
16
+ return value;
17
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.19.2",
3
+ "version": "2.20.0-alpha.1",
4
4
  "description": "Adobe Experience Platform Web SDK",
5
5
  "main": "libEs5/index.js",
6
6
  "module": "libEs6/index.js",
@@ -31,8 +31,7 @@
31
31
  "prepare": "husky install && cd sandbox && npm install",
32
32
  "prepublishOnly": "rimraf libEs5 libEs6 && babel src -d libEs5 --env-name npmEs5 && babel src -d libEs6 --env-name npmEs6",
33
33
  "checkthattestfilesexist": "./scripts/checkThatTestFilesExist.js",
34
- "add-license": "./scripts/add-license.js",
35
- "preinstall": "npx force-resolutions"
34
+ "add-license": "./scripts/add-license.js"
36
35
  },
37
36
  "lint-staged": {
38
37
  "./*.js": [
@@ -71,7 +70,7 @@
71
70
  "uuid": "^3.3.2"
72
71
  },
73
72
  "devDependencies": {
74
- "@adobe/alloy": "^2.19.2-beta.1",
73
+ "@adobe/alloy": "^2.20.0-alpha.0",
75
74
  "@babel/cli": "^7.12.8",
76
75
  "@babel/core": "^7.2.2",
77
76
  "@babel/plugin-proposal-object-rest-spread": "^7.3.2",
@@ -92,7 +91,6 @@
92
91
  "eslint-plugin-import": "^2.28.1",
93
92
  "eslint-plugin-prettier": "^3.0.1",
94
93
  "eslint-plugin-testcafe": "^0.2.1",
95
- "force-resolutions": "^1.0.11",
96
94
  "glob": "^7.1.3",
97
95
  "handlebars": "^4.7.7",
98
96
  "husky": "^6.0.0",
@@ -136,8 +134,5 @@
136
134
  "url-exists-nodejs": "^0.1.0",
137
135
  "url-parse": "^1.4.7",
138
136
  "yargs": "^16.2.0"
139
- },
140
- "resolutions": {
141
- "webdriverio": "^7.19.5"
142
137
  }
143
138
  }