npm package diff
Package: @forge/manifest
Versions: 7.5.2-next.0-experimental-10722bc - 7.7.0-next.13
File: package/out/validators/modules-validators/rovo/validate-undefined-action-name.js
Index: package/out/validators/modules-validators/rovo/validate-undefined-action-name.js
===================================================================
--- package/out/validators/modules-validators/rovo/validate-undefined-action-name.js
+++ package/out/validators/modules-validators/rovo/validate-undefined-action-name.js
@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.validateUndefinedActionName = void 0;
+const types_1 = require("../../../types");
+const text_1 = require("../../../text");
+const utils_1 = require("../../../utils");
+const validateUndefinedActionName = (allModules, yamlContentByLine) => {
+ const validationErrors = [];
+ const actionsWithUndefinedName = getUndefinedActionName(allModules);
+ actionsWithUndefinedName.forEach((action) => {
+ validationErrors.push(getValidationError(action, yamlContentByLine));
+ });
+ return validationErrors;
+};
+exports.validateUndefinedActionName = validateUndefinedActionName;
+function getUndefinedActionName(allModules) {
+ const actionKey = (0, utils_1.cleanKey)(types_1.AllModuleTypes.CoreAction);
+ const allActions = allModules[actionKey];
+ return allActions?.filter((action) => !action.name).map((action) => action.key) ?? [];
+}
+function getValidationError(action, yamlContentByLine) {
+ return {
+ message: text_1.errors.modules.rovo.undefinedActionName(action),
+ reference: text_1.References.Modules,
+ level: 'warning',
+ ...(0, utils_1.findPosition)(action, yamlContentByLine)
+ };
+}