brainiac-zoho 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/brainiac/plugins/zoho/cli.rb +4 -2
- data/lib/brainiac/plugins/zoho/config.rb +1 -1
- data/lib/brainiac/plugins/zoho/handler.rb +3 -2
- data/lib/brainiac/plugins/zoho/triage.rb +1 -1
- data/lib/brainiac/plugins/zoho/version.rb +1 -1
- data/lib/brainiac/plugins/zoho.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 451a0bd2fc0bc2198f8fadf4a68c7e5383770cdf28439e495a16d1b67377af51
|
|
4
|
+
data.tar.gz: 1ad12e2adb8b802b0d9e92253e263469c9f3da0c6e2bb6d20ee1ec317d2966e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8de16eeb4b370d3de0022e39ccf3f8334235dac8df8336948b7b767920713a78811d412e7ad5448f935a46caea5f4482c42f0f0e5ec4432d8a2ae6ea9e8167f8
|
|
7
|
+
data.tar.gz: 648bd02269587eb115700c6588a0c28b60dcfb10baf08b5d1c2df76f8db412ca62c7e1aea1a4f40b36ef2844bb1de94b21be3c8dbbfc4fa0ab4a2a6801981ff4
|
|
@@ -32,7 +32,8 @@ module Brainiac
|
|
|
32
32
|
puts "Created #{config_file} from template"
|
|
33
33
|
else
|
|
34
34
|
puts "Template not found — creating minimal config"
|
|
35
|
-
default_config = { "hook_secret" => nil, "
|
|
35
|
+
default_config = { "hook_secret" => nil, "default_notify_target" => "", "notify_channel" => "discord", "rules" => [],
|
|
36
|
+
"fallback" => { "enabled" => true } }
|
|
36
37
|
File.write(config_file, JSON.pretty_generate(default_config))
|
|
37
38
|
puts "Created #{config_file}"
|
|
38
39
|
end
|
|
@@ -54,7 +55,8 @@ module Brainiac
|
|
|
54
55
|
puts "Zoho Configuration:"
|
|
55
56
|
puts " Config file: #{config_file}"
|
|
56
57
|
puts " Hook secret: #{config["hook_secret"] ? "captured" : "(pending — waiting for first webhook)"}"
|
|
57
|
-
puts " Default channel: #{config["
|
|
58
|
+
puts " Default channel: #{config["default_notify_target"] || "(not set)"}"
|
|
59
|
+
puts " Notify channel: #{config["notify_channel"] || "discord"}"
|
|
58
60
|
puts " Notify as: #{config["notify_as"] || "(default)"}"
|
|
59
61
|
puts " Rules: #{rules.size} configured"
|
|
60
62
|
rules.each { |r| puts " - #{r["label"]} (#{r["enabled"] == false ? "disabled" : "enabled"})" }
|
|
@@ -70,7 +70,7 @@ module Brainiac
|
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def notify_match(email, rule)
|
|
73
|
-
target = rule["notify_target"] ||
|
|
73
|
+
target = rule["notify_target"] || Config.default_notify_target
|
|
74
74
|
channel = rule["notify_channel"] || Config.notify_channel
|
|
75
75
|
|
|
76
76
|
unless target
|
|
@@ -107,7 +107,8 @@ module Brainiac
|
|
|
107
107
|
|
|
108
108
|
{ "label" => fallback["label"] || "Unmatched Email",
|
|
109
109
|
"emoji" => fallback["emoji"] || "📬",
|
|
110
|
-
"
|
|
110
|
+
"notify_target" => fallback["notify_target"],
|
|
111
|
+
"notify_channel" => fallback["notify_channel"],
|
|
111
112
|
"notify_as" => fallback["notify_as"] }
|
|
112
113
|
end
|
|
113
114
|
|
|
@@ -171,7 +171,7 @@ module Brainiac
|
|
|
171
171
|
end
|
|
172
172
|
|
|
173
173
|
def execute_decision(decision, email, rule)
|
|
174
|
-
channel_id = rule["notify_target"] ||
|
|
174
|
+
channel_id = rule["notify_target"] || Config.default_notify_target
|
|
175
175
|
notify_channel = rule["notify_channel"] || Config.notify_channel
|
|
176
176
|
bot_name = rule["notify_as"] || Config.notify_as
|
|
177
177
|
|
|
@@ -37,7 +37,8 @@ module Brainiac
|
|
|
37
37
|
else
|
|
38
38
|
default_config = {
|
|
39
39
|
"hook_secret" => nil,
|
|
40
|
-
"
|
|
40
|
+
"default_notify_target" => "",
|
|
41
|
+
"notify_channel" => "discord",
|
|
41
42
|
"notify_as" => "merlin",
|
|
42
43
|
"rules" => [],
|
|
43
44
|
"fallback" => { "enabled" => true, "label" => "Unmatched Email", "emoji" => "📬" }
|