15 Commits

Author SHA1 Message Date
FoxxMD
f6b3f02e05 unescape content before report/comment 2021-06-11 10:36:37 -04:00
FoxxMD
788af401b3 Support JSON5 for parsing configuration 2021-06-10 13:20:11 -04:00
FoxxMD
6bc74b383f Implement resource caching
User-configurable global/subreddit-level caching for author activities, wiki pages, and author checks
2021-06-10 13:13:57 -04:00
FoxxMD
0eeb204371 Update ajv and fix schema generation issues
* Update ajv to fix #ref warning
* Consolidate ajv instantiation so config is always the same
* Remove propOrder flag for schema generation since its out of spec
2021-06-09 14:39:23 -04:00
FoxxMD
5905c910b0 Implement name references for actions and rules
Action/Rule objects they can now be referenced by name from anywhere in the configuration
2021-06-08 12:40:00 -04:00
FoxxMD
01161c3493 Implement specific activity checking through cli
* Refactor application input to use commando for extensibility
* Add all args/env as options for easy readout on command line
* Add 'check' command to allow running checks against a specific activity
* BC: must specify 'run' to run regular manager/unattended operation
2021-06-07 13:38:37 -04:00
FoxxMD
bd1ad7bffa Specify minimum node level 2021-06-03 23:15:42 -04:00
FoxxMD
bf70a23a25 Refactor json parsing to use ajv for all validation instead of guards
* Generate individual schemas for root objects from config (Rule, RuleSet, Action)
* Using ajv validation means we can also report all validation errors
* Remove noisy generated guard files
2021-06-03 15:19:47 -04:00
FoxxMD
c632efbbb2 More annotation improvements 2021-06-03 14:32:56 -04:00
FoxxMD
81e95e2cc8 Further improvements for json schema 2021-06-03 12:05:51 -04:00
FoxxMD
4ccec4021a Refactor winston to use nested labels for better context
Closes #3
2021-06-02 18:29:02 -04:00
FoxxMD
6eeef81d66 Make rule return value useful for information and subsequent rule runs
* Return plain data (RuleResult) with setup (premise), boolean triggered, and optional result text/data (for later use in action maybe?)
* Use RuleResult to prevent running a rule that has already been run with the same setup (premise) -- will speed up execution and prevent extraneous api calls
2021-06-02 15:11:00 -04:00
FoxxMD
69eea271cb Implement wiki comment action
* Get comment text from wiki page with 'wiki:' prefix in content
* Cache for 5 minutes (will make configurable later)
* Render comment content with Mustache template

Closes #2
2021-06-01 23:24:47 -04:00
FoxxMD
fc854d3d73 Implement repeat submissions rule 2021-06-01 15:38:07 -04:00
FoxxMD
18023b1edc Initial commit 2021-05-27 17:27:26 -04:00