@adobe/alloy 2.20.0-alpha.0 → 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.
- package/libEs5/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +42 -42
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +163 -157
- package/libEs5/components/LegacyMediaAnalytics/media/constants.js +20 -20
- package/libEs5/components/MediaCollection/{createMediaRequestPayload.js → constants/eventTypes.js} +9 -13
- package/libEs5/components/MediaCollection/createHeartbeatEngine.js +12 -4
- package/libEs5/components/MediaCollection/createMediaEventManager.js +21 -31
- package/libEs5/components/MediaCollection/createMediaSessionCacheManager.js +10 -10
- package/libEs5/components/MediaCollection/createUpdateMediaSessionState.js +3 -7
- package/libEs5/components/MediaCollection/index.js +12 -6
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/utils/validation/index.js +6 -1
- package/{libEs6/components/MediaCollection/createMediaRequestPayload.js → libEs5/utils/validation/matchesRegexpValidator.js} +10 -14
- package/libEs6/components/LegacyMediaAnalytics/createMediaAnalyticsTracker.js +22 -22
- package/libEs6/components/LegacyMediaAnalytics/createMediaHelper.js +163 -150
- package/libEs6/components/LegacyMediaAnalytics/media/constants.js +10 -10
- package/libEs6/components/MediaCollection/constants/eventTypes.js +21 -0
- package/libEs6/components/MediaCollection/createHeartbeatEngine.js +11 -4
- package/libEs6/components/MediaCollection/createMediaEventManager.js +23 -30
- package/libEs6/components/MediaCollection/createMediaSessionCacheManager.js +10 -10
- package/libEs6/components/MediaCollection/createUpdateMediaSessionState.js +2 -8
- package/libEs6/components/MediaCollection/index.js +12 -6
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/utils/validation/index.js +6 -1
- package/libEs6/utils/validation/matchesRegexpValidator.js +17 -0
- package/package.json +2 -2
- package/libEs5/components/MediaCollection/mediaConstants/mediaEvents.js +0 -13
- package/libEs6/components/MediaCollection/mediaConstants/mediaEvents.js +0 -9
|
@@ -90,6 +90,7 @@ import numberValidator from "./numberValidator";
|
|
|
90
90
|
import regexpValidator from "./regexpValidator";
|
|
91
91
|
import requiredValidator from "./requiredValidator";
|
|
92
92
|
import stringValidator from "./stringValidator";
|
|
93
|
+
import matchesRegexpValidator from "./matchesRegexpValidator";
|
|
93
94
|
|
|
94
95
|
// The base validator does no validation and just returns the value unchanged
|
|
95
96
|
const base = value => value;
|
|
@@ -134,6 +135,9 @@ const nonEmptyObject = function nonEmptyObject() {
|
|
|
134
135
|
const regexp = function regexp() {
|
|
135
136
|
return nullSafeChain(this, regexpValidator);
|
|
136
137
|
};
|
|
138
|
+
const matches = function matches(regexpPattern) {
|
|
139
|
+
return nullSafeChain(this, matchesRegexpValidator(regexpPattern));
|
|
140
|
+
};
|
|
137
141
|
const unique = function createUnique() {
|
|
138
142
|
return nullSafeChain(this, createUniqueValidator());
|
|
139
143
|
};
|
|
@@ -206,7 +210,8 @@ const string = function string() {
|
|
|
206
210
|
regexp,
|
|
207
211
|
domain,
|
|
208
212
|
nonEmpty: nonEmptyString,
|
|
209
|
-
unique
|
|
213
|
+
unique,
|
|
214
|
+
matches
|
|
210
215
|
});
|
|
211
216
|
};
|
|
212
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.20.0-alpha.
|
|
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",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"uuid": "^3.3.2"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@adobe/alloy": "^2.
|
|
73
|
+
"@adobe/alloy": "^2.20.0-alpha.0",
|
|
74
74
|
"@babel/cli": "^7.12.8",
|
|
75
75
|
"@babel/core": "^7.2.2",
|
|
76
76
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.default = void 0;
|
|
4
|
-
var _default = {
|
|
5
|
-
PAUSE: "media.pauseStart",
|
|
6
|
-
PLAY: "media.play",
|
|
7
|
-
BUFFERING: "media.buffering",
|
|
8
|
-
AD_START: "media.adStart",
|
|
9
|
-
SESSION_END: "media.sessionEnd",
|
|
10
|
-
SESSION_START: "media.sessionStart",
|
|
11
|
-
SESSION_COMPLETE: "media.sessionComplete"
|
|
12
|
-
};
|
|
13
|
-
exports.default = _default;
|