brainiac-zoho 0.0.3 → 0.0.5

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: f3acff47990af640d828a95ba79aea6c15e1e16bbe76239fe9ea74ec9f529bfb
4
- data.tar.gz: 948fa2fee5a0a56d12bc18fcc229202c7bfabd010ca35c7b3556bbdbb4be5c87
3
+ metadata.gz: 6c45768ba2349e526449567aac34857037eb8b9a919c551a0ec1d432642753fc
4
+ data.tar.gz: a250706a5bf7154e6814c100ed4970b26be4961366293dd51db42013c39c4e08
5
5
  SHA512:
6
- metadata.gz: b179cea2f12b99817495762ad360125915dcd7908500a485310cfeafdf74ff47211d6ef44d5a0af2e419580aaec4e1e6b8f3b40af1484cdbb64d4c66ea32e3e0
7
- data.tar.gz: 68670e1a970f8401105fd0b8ec9af379bd1b72d0038dabdadd8c6a3c8fd8d2540faa33cb8dac645b33102d793cbce674d29ab59cfc6cf3c3c74e832c62ce50df
6
+ metadata.gz: 1a49255275f0cf1fac3672ed3573b9f3c740f06d840a7b3fbf63df8121042f40a454634ea6a294f3224688871f544e04f584894fa3f4d340dd9e0d67ac0df2da
7
+ data.tar.gz: 7dffd5638f0df44b611187dff65cb3768c08f9ae2185283cac09dc875449212c88ba0cbac24ffcc75a54e5291c48b1a36eb7900d978fccc654a31beb7dafe62e
data/README.md CHANGED
@@ -23,7 +23,8 @@ Config lives at `~/.brainiac/zoho.json`:
23
23
  ```json
24
24
  {
25
25
  "hook_secret": null,
26
- "default_discord_channel_id": "YOUR_CHANNEL_ID",
26
+ "default_notify_target": "YOUR_CHANNEL_ID",
27
+ "notify_channel": "discord",
27
28
  "notify_as": "merlin",
28
29
  "rules": [
29
30
  {
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Zoho
6
- VERSION = "0.0.3"
6
+ VERSION = "0.0.5"
7
7
  end
8
8
  end
9
9
  end
@@ -22,6 +22,7 @@ module Brainiac
22
22
  # @param app [Sinatra::Application] The running Brainiac server
23
23
  def register(app)
24
24
  Config.load!
25
+ register_agent_lifecycle_hooks!
25
26
  setup_routes(app)
26
27
  LOG.info "[Zoho] Plugin registered (webhook: /zoho)"
27
28
  end
@@ -49,6 +50,18 @@ module Brainiac
49
50
 
50
51
  private
51
52
 
53
+ def register_agent_lifecycle_hooks!
54
+ Brainiac.on(:agent_added) do |ctx|
55
+ Config.reload!
56
+ LOG.info "[Zoho] Agent added: #{ctx[:display_name]} — config reloaded" if defined?(LOG)
57
+ end
58
+
59
+ Brainiac.on(:agent_removed) do |ctx|
60
+ Config.reload!
61
+ LOG.info "[Zoho] Agent removed: #{ctx[:agent_key]} — config reloaded" if defined?(LOG)
62
+ end
63
+ end
64
+
52
65
  def setup_routes(app)
53
66
  app.post "/zoho" do
54
67
  content_type :json
@@ -1,18 +1,21 @@
1
1
  {
2
2
  "hook_secret": null,
3
- "default_discord_channel_id": "YOUR_DISCORD_CHANNEL_ID",
3
+ "default_notify_target": "YOUR_DISCORD_CHANNEL_ID",
4
+ "notify_channel": "discord",
4
5
  "notify_as": "merlin",
5
6
  "rules": [
6
7
  {
7
- "label": "Item Sold",
8
+ "label": "Labs Contact",
8
9
  "enabled": true,
9
10
  "from_contains": "",
10
11
  "to_contains": "",
11
- "subject_contains": "sold",
12
+ "subject_contains": "[Labs Contact]",
12
13
  "body_contains": "",
13
14
  "exclude_words": [],
14
- "emoji": "💰",
15
- "discord_channel_id": null,
15
+ "emoji": "🧪",
16
+ "show_body": true,
17
+ "notify_target": null,
18
+ "notify_channel": null,
16
19
  "notify_as": null
17
20
  }
18
21
  ],
@@ -21,7 +24,8 @@
21
24
  "label": "Unmatched Email",
22
25
  "emoji": "📬",
23
26
  "exclude_words": [],
24
- "discord_channel_id": null,
27
+ "notify_target": null,
28
+ "notify_channel": null,
25
29
  "notify_as": null
26
30
  }
27
31
  }
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.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis