zaikio-webhooks 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/config/initializers/register_zaikio_webhooks_event_serializer.rb +1 -0
- data/lib/zaikio/webhooks.rb +1 -0
- data/lib/zaikio/webhooks/event.rb +1 -1
- data/lib/zaikio/webhooks/event_serializer.rb +17 -0
- data/lib/zaikio/webhooks/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0284963ea43cfb186d4f911a8ae0ac18bf5f4d79ce7ed9171f16b39ab31a27b6'
|
4
|
+
data.tar.gz: a428431616525d08df2219592481f335a1e79aaabf0f72ac5a9c8ac85db1b89f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/zaikio/webhooks.rb
CHANGED
@@ -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
|
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
|
+
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-
|
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:
|