tacklebox 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +37 -0
- data/History.txt +4 -0
- data/README.md +11 -11
- data/lib/tacklebox/apis/error.rb +12 -0
- data/lib/tacklebox/version.rb +1 -1
- data/pkg/tacklebox-0.1.2.gem +0 -0
- 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: f1973460060805e71fd83a169c9b7e43e65085eda9b1f4e3f2df2574a1b2f816
|
4
|
+
data.tar.gz: f0d047e8cd449ef65ad61b9815404594ce297784c2dce46a5f89e7d9b8aaba20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c61418c2ed5683ead0e5afdd238c0ebb526630c2a14ff301193929f28f75acbf6088cc6f2c449d011080f5ce34533c53b34cb1223dd143846e9c1d3a8efffdc3
|
7
|
+
data.tar.gz: 89c522ff3baa894a500706e83aa0b1973ffc49c7e11598f371b372bc3d8a8ef300e60b89206e17c342052bc7373a6e171529bb8975e541ec0b0f9c47a122779a
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tacklebox (0.1.3)
|
5
|
+
faraday (~> 1.4, >= 1.4.1)
|
6
|
+
json (~> 2.5, >= 2.5.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
faraday (1.4.2)
|
12
|
+
faraday-em_http (~> 1.0)
|
13
|
+
faraday-em_synchrony (~> 1.0)
|
14
|
+
faraday-excon (~> 1.1)
|
15
|
+
faraday-net_http (~> 1.0)
|
16
|
+
faraday-net_http_persistent (~> 1.1)
|
17
|
+
multipart-post (>= 1.2, < 3)
|
18
|
+
ruby2_keywords (>= 0.0.4)
|
19
|
+
faraday-em_http (1.0.0)
|
20
|
+
faraday-em_synchrony (1.0.0)
|
21
|
+
faraday-excon (1.1.0)
|
22
|
+
faraday-net_http (1.0.1)
|
23
|
+
faraday-net_http_persistent (1.1.0)
|
24
|
+
json (2.5.1)
|
25
|
+
multipart-post (2.1.1)
|
26
|
+
rake (12.3.3)
|
27
|
+
ruby2_keywords (0.0.4)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
x86_64-linux
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
rake (~> 12.0)
|
34
|
+
tacklebox!
|
35
|
+
|
36
|
+
BUNDLED WITH
|
37
|
+
2.2.17
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -11,11 +11,11 @@ Tacklebox is an open-source serverless framework that offers webhooks as a servi
|
|
11
11
|
|
12
12
|
It includes:
|
13
13
|
- a [CLI tool](https://github.com/tacklebox-webhooks/cli) to deploy and manage AWS infrastructure
|
14
|
-
- 4 client libraries ([
|
14
|
+
- 4 client libraries ([JavaScript](https://github.com/tacklebox-webhooks/javascript),
|
15
15
|
[Ruby](https://github.com/tacklebox-webhooks/ruby),
|
16
16
|
[Python](https://github.com/tacklebox-webhooks/python),
|
17
17
|
and [Go](https://github.com/tacklebox-webhooks/golang))
|
18
|
-
- a RESTful API
|
18
|
+
- a RESTful API
|
19
19
|
- a management UI
|
20
20
|
|
21
21
|
You can read more about our case study [here](https://tacklebox-webhooks.github.io"),
|
@@ -58,39 +58,39 @@ require 'tacklebox'
|
|
58
58
|
|
59
59
|
# Initialize a Tacklebox object using the API Key and API Host
|
60
60
|
# obtained after running 'tacklebox deploy'
|
61
|
-
tacklebox = Tacklebox.new(API_KEY, API_HOST)
|
61
|
+
tacklebox = Tacklebox.new(API_KEY, API_HOST)
|
62
62
|
```
|
63
63
|
|
64
64
|
Once you include the package and initialize a Tacklebox object, you can do
|
65
65
|
many things. For example, you can create a service like so:
|
66
66
|
|
67
67
|
```ruby
|
68
|
-
tacklebox.service.create({ "name" => "service1" })
|
68
|
+
tacklebox.service.create({ "name" => "service1" })
|
69
69
|
```
|
70
70
|
|
71
71
|
Once you create services, event types, users and subscriptions,
|
72
72
|
you can create a new event like so:
|
73
73
|
|
74
74
|
```ruby
|
75
|
-
service_id = "d90af763-5839-4a90-834c-5512980984f5"
|
76
|
-
user_id = "cabea1b5-b485-41b7-8146-72ece22dc458"
|
75
|
+
service_id = "d90af763-5839-4a90-834c-5512980984f5"
|
76
|
+
user_id = "cabea1b5-b485-41b7-8146-72ece22dc458"
|
77
77
|
|
78
78
|
event_data = {
|
79
79
|
"event_type" => "greet",
|
80
80
|
"payload" => {
|
81
|
-
|
81
|
+
"message" => "Hello from the Ruby wrapper!"
|
82
82
|
},
|
83
83
|
"idempotency_key" => "1"
|
84
84
|
}
|
85
85
|
|
86
|
-
tacklebox.event.create(service_id, user_id, event_data)
|
86
|
+
tacklebox.event.create(service_id, user_id, event_data)
|
87
87
|
```
|
88
88
|
|
89
89
|
If you want to see the message log for a specific user and service:
|
90
90
|
|
91
91
|
```ruby
|
92
|
-
service_id = "d90af763-5839-4a90-834c-5512980984f5"
|
93
|
-
user_id = "cabea1b5-b485-41b7-8146-72ece22dc458"
|
92
|
+
service_id = "d90af763-5839-4a90-834c-5512980984f5"
|
93
|
+
user_id = "cabea1b5-b485-41b7-8146-72ece22dc458"
|
94
94
|
|
95
|
-
tacklebox.message.list(service_id, user_id)
|
95
|
+
tacklebox.message.list(service_id, user_id)
|
96
96
|
```
|
data/lib/tacklebox/apis/error.rb
CHANGED
@@ -26,6 +26,10 @@ module Validation
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def is_valid_subscription_data(data)
|
29
|
+
if data['eventTypes']
|
30
|
+
data['event_types'] = data['eventTypes']
|
31
|
+
end
|
32
|
+
|
29
33
|
(
|
30
34
|
data['url'] &&
|
31
35
|
data['url'].class == String &&
|
@@ -35,6 +39,14 @@ module Validation
|
|
35
39
|
end
|
36
40
|
|
37
41
|
def is_valid_event_data(data)
|
42
|
+
if data['eventType']
|
43
|
+
data['event_type'] = data['eventType']
|
44
|
+
end
|
45
|
+
|
46
|
+
if data['idempotencyKey']
|
47
|
+
data['idempotency_key'] = data['idempotencyKey']
|
48
|
+
end
|
49
|
+
|
38
50
|
(
|
39
51
|
data['event_type'] &&
|
40
52
|
data['event_type'].class == String &&
|
data/lib/tacklebox/version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tacklebox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Palma
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-06-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -60,6 +60,7 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- Gemfile
|
63
|
+
- Gemfile.lock
|
63
64
|
- History.txt
|
64
65
|
- LICENSE.txt
|
65
66
|
- README.md
|
@@ -85,6 +86,7 @@ files:
|
|
85
86
|
- lib/tacklebox/version.rb
|
86
87
|
- pkg/tacklebox-0.1.0.gem
|
87
88
|
- pkg/tacklebox-0.1.1.gem
|
89
|
+
- pkg/tacklebox-0.1.2.gem
|
88
90
|
- tacklebox.gemspec
|
89
91
|
homepage: https://github.com/tacklebox-webhooks/ruby
|
90
92
|
licenses:
|