@adobe/alloy 2.11.0-beta.0 → 2.11.0-beta.3

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.
@@ -4,6 +4,8 @@ exports.default = void 0;
4
4
 
5
5
  var _libraryVersion = require("../../constants/libraryVersion");
6
6
 
7
+ var _coreCommands = require("../../constants/coreCommands");
8
+
7
9
  /*
8
10
  Copyright 2019 Adobe. All rights reserved.
9
11
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -15,14 +17,20 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
15
17
  OF ANY KIND, either express or implied. See the License for the specific language
16
18
  governing permissions and limitations under the License.
17
19
  */
18
- var createLibraryInfo = function createLibraryInfo() {
20
+ var createLibraryInfo = function createLibraryInfo(_ref) {
21
+ var config = _ref.config,
22
+ componentRegistry = _ref.componentRegistry;
23
+ var allCommands = componentRegistry.getCommandNames();
24
+ allCommands.push(_coreCommands.CONFIGURE, _coreCommands.SET_DEBUG);
19
25
  return {
20
26
  commands: {
21
27
  getLibraryInfo: {
22
28
  run: function run() {
23
29
  return {
24
30
  libraryInfo: {
25
- version: _libraryVersion.default
31
+ version: _libraryVersion.default,
32
+ configs: config,
33
+ commands: allCommands.sort()
26
34
  }
27
35
  };
28
36
  }
@@ -25,7 +25,7 @@ var _default = function _default(_ref) {
25
25
  var executeDecisions = _ref.executeDecisions;
26
26
 
27
27
  var filterItemsPredicate = function filterItemsPredicate(item) {
28
- return SUPPORTED_SCHEMAS.includes(item.schema);
28
+ return SUPPORTED_SCHEMAS.indexOf(item.schema) > -1;
29
29
  };
30
30
 
31
31
  var updatePropositionItems = function updatePropositionItems(_ref2) {
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ exports.SET_DEBUG = exports.CONFIGURE = void 0;
4
+
5
+ /*
6
+ Copyright 2020 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 CONFIGURE = "configure";
17
+ exports.CONFIGURE = CONFIGURE;
18
+ var SET_DEBUG = "setDebug";
19
+ exports.SET_DEBUG = SET_DEBUG;
@@ -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.11.0-beta.0";
18
+ var _default = "2.11.0-beta.3";
19
19
  exports.default = _default;
@@ -187,6 +187,7 @@ var createExecuteCommand = function createExecuteCommand(_ref) {
187
187
  var componentLogger = createComponentLogger(componentName);
188
188
  return {
189
189
  config: config,
190
+ componentRegistry: componentRegistry,
190
191
  consent: consent,
191
192
  eventManager: eventManager,
192
193
  fireReferrerHideableImage: fireReferrerHideableImage,
@@ -4,6 +4,8 @@ exports.default = void 0;
4
4
 
5
5
  var _utils = require("../utils");
6
6
 
7
+ var _coreCommands = require("../constants/coreCommands");
8
+
7
9
  /*
8
10
  Copyright 2019 Adobe. All rights reserved.
9
11
  This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -15,11 +17,6 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
15
17
  OF ANY KIND, either express or implied. See the License for the specific language
16
18
  governing permissions and limitations under the License.
17
19
  */
18
- var coreCommands = {
19
- CONFIGURE: "configure",
20
- SET_DEBUG: "setDebug"
21
- };
22
-
23
20
  var _default = function _default(_ref) {
24
21
  var logger = _ref.logger,
25
22
  configureCommand = _ref.configureCommand,
@@ -31,7 +28,7 @@ var _default = function _default(_ref) {
31
28
  var getExecutor = function getExecutor(commandName, options) {
32
29
  var executor;
33
30
 
34
- if (commandName === coreCommands.CONFIGURE) {
31
+ if (commandName === _coreCommands.CONFIGURE) {
35
32
  if (configurePromise) {
36
33
  throw new Error("The library has already been configured and may only be configured once.");
37
34
  }
@@ -46,7 +43,7 @@ var _default = function _default(_ref) {
46
43
  throw new Error("The library must be configured first. Please do so by executing the configure command.");
47
44
  }
48
45
 
49
- if (commandName === coreCommands.SET_DEBUG) {
46
+ if (commandName === _coreCommands.SET_DEBUG) {
50
47
  executor = function executor() {
51
48
  return setDebugCommand(options);
52
49
  };
@@ -56,7 +53,7 @@ var _default = function _default(_ref) {
56
53
  var command = componentRegistry.getCommand(commandName);
57
54
 
58
55
  if (!command || !(0, _utils.isFunction)(command.run)) {
59
- var commandNames = (0, _utils.values)(coreCommands).concat(componentRegistry.getCommandNames()).join(", ");
56
+ var commandNames = [_coreCommands.CONFIGURE, _coreCommands.SET_DEBUG].concat(componentRegistry.getCommandNames()).join(", ");
60
57
  throw new Error("The " + commandName + " command does not exist. List of available commands: " + commandNames + ".");
61
58
  }
62
59
 
@@ -10,15 +10,23 @@ 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 libraryVersion from "../../constants/libraryVersion";
13
+ import { CONFIGURE, SET_DEBUG } from "../../constants/coreCommands";
13
14
 
14
- const createLibraryInfo = () => {
15
+ const createLibraryInfo = ({
16
+ config,
17
+ componentRegistry
18
+ }) => {
19
+ const allCommands = componentRegistry.getCommandNames();
20
+ allCommands.push(CONFIGURE, SET_DEBUG);
15
21
  return {
16
22
  commands: {
17
23
  getLibraryInfo: {
18
24
  run: () => {
19
25
  return {
20
26
  libraryInfo: {
21
- version: libraryVersion
27
+ version: libraryVersion,
28
+ configs: config,
29
+ commands: allCommands.sort()
22
30
  }
23
31
  };
24
32
  }
@@ -18,7 +18,7 @@ export const SUPPORTED_SCHEMAS = [DOM_ACTION, HTML_CONTENT_ITEM];
18
18
  export default (({
19
19
  executeDecisions
20
20
  }) => {
21
- const filterItemsPredicate = item => SUPPORTED_SCHEMAS.includes(item.schema);
21
+ const filterItemsPredicate = item => SUPPORTED_SCHEMAS.indexOf(item.schema) > -1;
22
22
 
23
23
  const updatePropositionItems = ({
24
24
  items,
@@ -0,0 +1,13 @@
1
+ /*
2
+ Copyright 2020 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 CONFIGURE = "configure";
13
+ export const SET_DEBUG = "setDebug";
@@ -11,4 +11,4 @@ governing permissions and limitations under the License.
11
11
  */
12
12
  // The __VERSION__ keyword will be replace at alloy build time with the package.json version.
13
13
  // see babel-plugin-version
14
- export default "2.11.0-beta.0";
14
+ export default "2.11.0-beta.3";
@@ -152,6 +152,7 @@ export const createExecuteCommand = ({
152
152
  const componentLogger = createComponentLogger(componentName);
153
153
  return {
154
154
  config,
155
+ componentRegistry,
155
156
  consent,
156
157
  eventManager,
157
158
  fireReferrerHideableImage,
@@ -9,11 +9,8 @@ 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 { isFunction, isObject, values } from "../utils";
13
- const coreCommands = {
14
- CONFIGURE: "configure",
15
- SET_DEBUG: "setDebug"
16
- };
12
+ import { isFunction, isObject } from "../utils";
13
+ import { CONFIGURE, SET_DEBUG } from "../constants/coreCommands";
17
14
  export default (({
18
15
  logger,
19
16
  configureCommand,
@@ -26,7 +23,7 @@ export default (({
26
23
  const getExecutor = (commandName, options) => {
27
24
  let executor;
28
25
 
29
- if (commandName === coreCommands.CONFIGURE) {
26
+ if (commandName === CONFIGURE) {
30
27
  if (configurePromise) {
31
28
  throw new Error("The library has already been configured and may only be configured once.");
32
29
  }
@@ -41,7 +38,7 @@ export default (({
41
38
  throw new Error(`The library must be configured first. Please do so by executing the configure command.`);
42
39
  }
43
40
 
44
- if (commandName === coreCommands.SET_DEBUG) {
41
+ if (commandName === SET_DEBUG) {
45
42
  executor = () => setDebugCommand(options);
46
43
  } else {
47
44
  executor = () => {
@@ -49,7 +46,7 @@ export default (({
49
46
  const command = componentRegistry.getCommand(commandName);
50
47
 
51
48
  if (!command || !isFunction(command.run)) {
52
- const commandNames = values(coreCommands).concat(componentRegistry.getCommandNames()).join(", ");
49
+ const commandNames = [CONFIGURE, SET_DEBUG].concat(componentRegistry.getCommandNames()).join(", ");
53
50
  throw new Error(`The ${commandName} command does not exist. List of available commands: ${commandNames}.`);
54
51
  }
55
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/alloy",
3
- "version": "2.11.0-beta.0",
3
+ "version": "2.11.0-beta.3",
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.11.0-alpha.8",
67
+ "@adobe/alloy": "^2.11.0-beta.2",
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",