From 08c085e3a9f47f8cbab0e4d8ea37755f86e11478 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Fri, 4 Jun 2021 13:11:56 -0400 Subject: [PATCH] Specify name on rule/check/action must conform to pattern alphanumeric with spaces, underscore, dashes -- so we can use them to normalize rule results for templating --- src/Schema/Action.json | 3 ++- src/Schema/App.json | 29 +++++++++++++++++++---------- src/Schema/Rule.json | 3 ++- src/Schema/RuleSet.json | 9 ++++++--- 4 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/Schema/Action.json b/src/Schema/Action.json index 289e7f5..e9004df 100644 --- a/src/Schema/Action.json +++ b/src/Schema/Action.json @@ -13,7 +13,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, diff --git a/src/Schema/App.json b/src/Schema/App.json index 7e61d13..3dbabf0 100644 --- a/src/Schema/App.json +++ b/src/Schema/App.json @@ -133,7 +133,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, @@ -199,7 +200,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this check (highly recommended) -- EX \"repeatCrosspostReport\"", + "description": "Friendly name for this Check EX \"crosspostSpamCheck\"\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "rules": { @@ -272,7 +274,8 @@ "type": "boolean" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "sticky": { @@ -351,7 +354,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "text": { @@ -385,7 +389,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, @@ -473,7 +478,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "thresholds": { @@ -556,7 +562,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, @@ -614,7 +621,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "threshold": { @@ -684,7 +692,7 @@ "description": "Report the Activity", "properties": { "content": { - "description": "The text of the report", + "description": "The text of the report. If longer than 100 characters will be truncated to \"[content]...\"", "type": "string" }, "kind": { @@ -699,7 +707,8 @@ "type": "string" }, "name": { - "description": "A friendly name for this Action", + "description": "An optional, but highly recommended, friendly name for this Action. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, diff --git a/src/Schema/Rule.json b/src/Schema/Rule.json index fb10163..8b46700 100644 --- a/src/Schema/Rule.json +++ b/src/Schema/Rule.json @@ -88,7 +88,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, diff --git a/src/Schema/RuleSet.json b/src/Schema/RuleSet.json index b551581..a90261c 100644 --- a/src/Schema/RuleSet.json +++ b/src/Schema/RuleSet.json @@ -133,7 +133,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" } }, @@ -214,7 +215,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "thresholds": { @@ -327,7 +329,8 @@ "type": "string" }, "name": { - "description": "A friendly, descriptive name for this rule. Highly recommended to make it easier to track logs EX \"repeatCrosspostRule\"", + "description": "An optional, but highly recommended, friendly name for this rule. If not present will default to `kind`.\n\nCan only contain letters, numbers, underscore, spaces, and dashes\n\nname is used to reference Rule result data during Action content templating. See CommentAction or ReportAction for more details.", + "pattern": "^[a-zA-Z]([\\w -]*[\\w])?$", "type": "string" }, "threshold": {