zaikio-webhooks 0.0.4 → 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: 27fbeb3ce67b0e03b8215f4cd2344d30b3df01630ce95ccaa14b2d511be033c7
4
- data.tar.gz: a980c357f59e5466edca94db1128aac9c8f0188dea3de2a733fef3dcf145e6f0
3
+ metadata.gz: '0284963ea43cfb186d4f911a8ae0ac18bf5f4d79ce7ed9171f16b39ab31a27b6'
4
+ data.tar.gz: a428431616525d08df2219592481f335a1e79aaabf0f72ac5a9c8ac85db1b89f
5
5
  SHA512:
6
- metadata.gz: 84738f12afd7bb68e76cc82526c406c1aeb63f4ae57312a31f5ed7abc49ff9f52c7fc0391271ea1cba921dae0b6d80c3b63d379fc39a96fb4811ca7c88481cd3
7
- data.tar.gz: 89c6e95be27de8d33c6e6b9aaef7ebe6d9bc8d732142ba5f27ec78e96dac461447aeb9c98eeae26e2f9aa5b321c2086d9cb3e83232d9a6b9a246494e92151ef8
6
+ metadata.gz: 26bd963797a01f76f803f40dd1480fff156783423f8441a0cf6161c14955fe664cfbeda545a0d45bf1f88d31d456a9aee9f67e7493321e55fac09ca2a0b82385
7
+ data.tar.gz: c98a228af1b46b23e836f7f39da6fa9c6fe08d815e129881af15e323182232a8b3f5e18612da09f140bc353e4b8b336c081da15cd192529cbf6dd135e136a221
data/README.md CHANGED
@@ -77,3 +77,9 @@ class AddMachineJob < ApplicationJob
77
77
  end
78
78
  end
79
79
  ```
80
+
81
+ ### 6. Add Webhook URL to Zaikio Hub
82
+
83
+ Login to [Zaikio Hub](https://directory.zaikio.com/) and go to your Apps and go to Edit App and add your webhook URL e.g. `https://mydomain.de/zaikio/webhook/my_app_name`.
84
+
85
+ Now you should receive all events you subscribed to.
@@ -0,0 +1 @@
1
+ Rails.application.config.active_job.custom_serializers << Zaikio::Webhooks::EventSerializer
@@ -1,5 +1,6 @@
1
1
  require "zaikio/webhooks/configuration"
2
2
  require "zaikio/webhooks/event"
3
+ require "zaikio/webhooks/event_serializer"
3
4
  require "zaikio/webhooks/engine"
4
5
 
5
6
  module Zaikio
@@ -5,7 +5,7 @@ module Zaikio
5
5
  class Event
6
6
  extend Forwardable
7
7
  attr_reader :data
8
- def_delegators :data, :id, :name, :version, :payload, :link
8
+ def_delegators :data, :id, :name, :version, :payload, :link, :to_h
9
9
 
10
10
  def initialize(event_data)
11
11
  @data = OpenStruct.new(event_data)
@@ -0,0 +1,17 @@
1
+ module Zaikio
2
+ module Webhooks
3
+ class EventSerializer < ActiveJob::Serializers::ObjectSerializer
4
+ def serialize?(argument)
5
+ argument.is_a? Event
6
+ end
7
+
8
+ def serialize(event)
9
+ super(event.to_h)
10
+ end
11
+
12
+ def deserialize(data)
13
+ Event.new(data)
14
+ end
15
+ end
16
+ end
17
+ end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Webhooks
3
- VERSION = "0.0.4".freeze
3
+ VERSION = "0.0.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -41,6 +41,7 @@ files:
41
41
  - README.md
42
42
  - Rakefile
43
43
  - app/controllers/zaikio/webhooks/webhooks_controller.rb
44
+ - config/initializers/register_zaikio_webhooks_event_serializer.rb
44
45
  - config/routes.rb
45
46
  - lib/tasks/zaikio/webhook_tasks.rake
46
47
  - lib/zaikio/webhooks.rb
@@ -48,6 +49,7 @@ files:
48
49
  - lib/zaikio/webhooks/configuration.rb
49
50
  - lib/zaikio/webhooks/engine.rb
50
51
  - lib/zaikio/webhooks/event.rb
52
+ - lib/zaikio/webhooks/event_serializer.rb
51
53
  - lib/zaikio/webhooks/version.rb
52
54
  homepage: https://www.zaikio.com/
53
55
  licenses: