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/jira/validate-workflow.js

Index: package/out/validators/modules-validators/jira/validate-workflow.js
===================================================================
--- package/out/validators/modules-validators/jira/validate-workflow.js
+++ package/out/validators/modules-validators/jira/validate-workflow.js
@@ -0,0 +1,44 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.validateJiraWorkflowCondition = exports.validateJiraWorkflowValidator = void 0;
+const types_1 = require("../../../types");
+const text_1 = require("../../../text");
+const utils_1 = require("../../../utils");
+function validateJiraWorkflowValidator(modules, yamlContentByLine) {
+    const validationErrors = [];
+    modules[types_1.AllModuleTypes.JiraWorkflowValidator]?.forEach((module) => {
+        if (!module.expression && !module.function) {
+            validationErrors.push({
+                message: text_1.errors.modules.jiraWorkflowValidator.missingProperty(module.key),
+                reference: text_1.References.Modules,
+                level: 'error',
+                ...(0, utils_1.findPosition)(module.key, yamlContentByLine)
+            });
+        }
+        if (module.expression && module.function) {
+            validationErrors.push({
+                message: text_1.errors.modules.jiraWorkflowValidator.invalidProperty(module.key),
+                reference: text_1.References.Modules,
+                level: 'error',
+                ...(0, utils_1.findPosition)(module.key, yamlContentByLine)
+            });
+        }
+    });
+    return validationErrors;
+}
+exports.validateJiraWorkflowValidator = validateJiraWorkflowValidator;
+function validateJiraWorkflowCondition(modules, yamlContentByLine) {
+    const validationErrors = [];
+    modules[types_1.AllModuleTypes.JiraWorkflowCondition]?.forEach((module) => {
+        if (!(module.expression && module.expression.trim())) {
+            validationErrors.push({
+                message: text_1.errors.modules.jiraWorkflowCondition.missingExpression(module.key),
+                reference: text_1.References.Modules,
+                level: 'error',
+                ...(0, utils_1.findPosition)(module.key, yamlContentByLine)
+            });
+        }
+    });
+    return validationErrors;
+}
+exports.validateJiraWorkflowCondition = validateJiraWorkflowCondition;