@forge/manifest
Advanced tools
Comparing version 7.9.0-next.9 to 7.9.0-next.10
@@ -107,3 +107,3 @@ import { type ForgeSupportedLocaleCode } from '../schema/manifest'; | ||
trigger: { | ||
filteringWorksOnlyWithJiraEvents: () => string; | ||
ignoreSelfFilteringWorksOnlyWithJiraEvents: () => string; | ||
endpointOnlySupportSystemToken: (productEventKey: string, endpointModuleKey: string) => string; | ||
@@ -110,0 +110,0 @@ endpointNeedsRoute: (productEventKey: string, endpointModuleKey: string) => string; |
@@ -119,3 +119,3 @@ "use strict"; | ||
trigger: { | ||
filteringWorksOnlyWithJiraEvents: () => `Trigger filtering works only with Jira events`, | ||
ignoreSelfFilteringWorksOnlyWithJiraEvents: () => `Trigger filtering with ignoreSelf works only with Jira events`, | ||
endpointOnlySupportSystemToken: (productEventKey, endpointModuleKey) => `Trigger module: '${productEventKey}' using remote endpoint: '${endpointModuleKey}' only supports appSystemToken. Update appUserToken to false.`, | ||
@@ -122,0 +122,0 @@ endpointNeedsRoute: (productEventKey, endpointModuleKey) => `Trigger module: '${productEventKey}' using remote endpoint: '${endpointModuleKey}' requires 'route' parameter.` |
@@ -9,7 +9,9 @@ "use strict"; | ||
modules?.trigger?.forEach((module) => { | ||
if (module.filter) { | ||
let isIgnoreSelfErrorAdded = false; | ||
if (module?.filter?.ignoreSelf) { | ||
const onlyJiraEvents = module.events.every((e) => e.includes('jira')); | ||
if (!onlyJiraEvents) { | ||
if (!onlyJiraEvents && !isIgnoreSelfErrorAdded) { | ||
isIgnoreSelfErrorAdded = true; | ||
validationErrors.push({ | ||
message: text_1.errors.modules.trigger.filteringWorksOnlyWithJiraEvents(), | ||
message: text_1.errors.modules.trigger.ignoreSelfFilteringWorksOnlyWithJiraEvents(), | ||
reference: text_1.References.Modules, | ||
@@ -21,2 +23,16 @@ level: 'error', | ||
} | ||
module.events.forEach((event) => { | ||
if (typeof event === 'object' && event?.filter?.ignoreSelf) { | ||
const isJiraEvent = event.eventType.includes('jira'); | ||
if (!isJiraEvent && !isIgnoreSelfErrorAdded) { | ||
isIgnoreSelfErrorAdded = true; | ||
validationErrors.push({ | ||
message: text_1.errors.modules.trigger.ignoreSelfFilteringWorksOnlyWithJiraEvents(), | ||
reference: text_1.References.Modules, | ||
level: 'error', | ||
...(0, utils_1.findPosition)(module.key, yamlContentByLine) | ||
}); | ||
} | ||
} | ||
}); | ||
}); | ||
@@ -23,0 +39,0 @@ return validationErrors; |
{ | ||
"name": "@forge/manifest", | ||
"version": "7.9.0-next.9", | ||
"version": "7.9.0-next.10", | ||
"description": "Definitions and validations of the Forge manifest", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3297933
94942