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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 386e959b01ecbdba6859b7256d0af025b4f76efe95c77e497ff78a761ee5fd5e
4
- data.tar.gz: e035b1208494431bf24a56891fc998000567e4c49bae08edbe1b24b4145d816a
3
+ metadata.gz: 451a0bd2fc0bc2198f8fadf4a68c7e5383770cdf28439e495a16d1b67377af51
4
+ data.tar.gz: 1ad12e2adb8b802b0d9e92253e263469c9f3da0c6e2bb6d20ee1ec317d2966e1
5
5
  SHA512:
6
- metadata.gz: 2bf6504d360b62f1626d6fd2db180be29fd24e2efa16a47e1fa04a7e9731af005bd223e61a46eeff4eab9c36489477435debcd0b79e31ab64c8b642297cef8d7
7
- data.tar.gz: ebc6c1dd39d5d79601da0a58ae9b07612159cbbb49a281a7b0276be6cf2930bdf0ebfb8fd33db1d970f5ca594336e6626754203fb2bcad27ef123642e5feddf0
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, "default_discord_channel_id" => "", "rules" => [], "fallback" => { "enabled" => true } }
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["default_discord_channel_id"] || "(not set)"}"
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"})" }
@@ -36,7 +36,7 @@ module Brainiac
36
36
  end
37
37
 
38
38
  def default_notify_target
39
- @config["default_notify_target"] || @config["default_discord_channel_id"]
39
+ @config["default_notify_target"]
40
40
  end
41
41
 
42
42
  def notify_channel
@@ -70,7 +70,7 @@ module Brainiac
70
70
  end
71
71
 
72
72
  def notify_match(email, rule)
73
- target = rule["notify_target"] || rule["discord_channel_id"] || Config.default_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
- "discord_channel_id" => fallback["discord_channel_id"],
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"] || rule["discord_channel_id"] || Config.default_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
 
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Zoho
6
- VERSION = "0.0.1"
6
+ VERSION = "0.0.2"
7
7
  end
8
8
  end
9
9
  end
@@ -37,7 +37,8 @@ module Brainiac
37
37
  else
38
38
  default_config = {
39
39
  "hook_secret" => nil,
40
- "default_discord_channel_id" => "",
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" => "📬" }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-zoho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis