convoy.rb 0.1.7 → 0.1.9
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 +4 -4
- data/lib/convoy/api_operations/delete.rb +1 -1
- data/lib/convoy/api_operations/get.rb +1 -1
- data/lib/convoy/api_operations/list.rb +1 -1
- data/lib/convoy/api_operations/request.rb +5 -2
- data/lib/convoy/convoy_configuration.rb +2 -1
- data/lib/convoy/resources/delivery_attempt.rb +2 -1
- data/lib/convoy/resources/endpoint.rb +1 -0
- data/lib/convoy/resources/event_delivery.rb +2 -1
- data/lib/convoy/resources/source.rb +23 -0
- data/lib/convoy/resources/subscription.rb +23 -0
- data/lib/convoy/version.rb +1 -1
- data/lib/convoy.rb +2 -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: f33937f312b1c892facfce7d871bb972fd0f18ccd4fd0480697e91cd7a8b1662
|
4
|
+
data.tar.gz: 8f8335fc9c3257ad80d68c07fda93fe3066792a0acdb55b1e9c3c9c89da73521
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6efa47b6410966a4ee0fd8d254210a5e1e201634544725585739e7b2f80b562b82d5c8ee621bb4890095da43f755f15e410aa2ef77e6e0495e4089c5848e321a
|
7
|
+
data.tar.gz: 680f6f45ab3fc28ea5ef4236d0b8a26676566ba927d4a9f352c0921af03c4a32735fbce7ce9fc75c37733b4dae65f6c5597c7724ba52afdeee1c3d78ab457d02
|
@@ -32,8 +32,11 @@ module Convoy
|
|
32
32
|
req
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
if !config.api_key.nil?
|
36
|
+
request['Authorization'] = "Bearer #{config.api_key}"
|
37
|
+
else
|
38
|
+
request.basic_auth config.username, config.password
|
39
|
+
end
|
37
40
|
|
38
41
|
# Build HTTP Client.
|
39
42
|
client = Net::HTTP.new(uri.host, uri.port)
|
@@ -5,13 +5,14 @@ module Convoy
|
|
5
5
|
attr_accessor :debug
|
6
6
|
attr_accessor :username
|
7
7
|
attr_accessor :password
|
8
|
+
attr_accessor :api_key
|
8
9
|
attr_accessor :base_uri
|
9
10
|
attr_accessor :path_version
|
10
11
|
attr_accessor :logger
|
11
12
|
attr_accessor :log_level
|
12
13
|
|
13
14
|
def initialize
|
14
|
-
@base_uri = "https://
|
15
|
+
@base_uri = "https://dashboard.getconvoy.io"
|
15
16
|
@path_version = "/v1"
|
16
17
|
@ssl = true
|
17
18
|
@debug = false
|
@@ -3,9 +3,10 @@ module Convoy
|
|
3
3
|
include ApiOperations::Get
|
4
4
|
include ApiOperations::List
|
5
5
|
|
6
|
-
def initialize(eventId = nil, id = nil, config = Convoy.config)
|
6
|
+
def initialize(eventId = nil, id = nil, config = Convoy.config, **kwargs)
|
7
7
|
@eventId = eventId
|
8
8
|
@id = id
|
9
|
+
@params = kwargs[:params].nil? ? {} : kwargs[:params]
|
9
10
|
@config = config
|
10
11
|
end
|
11
12
|
|
@@ -3,8 +3,9 @@ module Convoy
|
|
3
3
|
include ApiOperations::Get
|
4
4
|
include ApiOperations::List
|
5
5
|
|
6
|
-
def intialize(eventId = nil, id = nil, config = Convoy.config)
|
6
|
+
def intialize(eventId = nil, id = nil, config = Convoy.config, **kwargs)
|
7
7
|
@eventId = eventId
|
8
|
+
@params = kwargs[:params].nil? ? {} : kwargs[:params]
|
8
9
|
@id = id
|
9
10
|
@config = config
|
10
11
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Convoy
|
2
|
+
class Source < ApiResource
|
3
|
+
include ApiOperations::Save
|
4
|
+
include ApiOperations::Delete
|
5
|
+
include ApiOperations::List
|
6
|
+
extend ApiOperations::Create
|
7
|
+
|
8
|
+
def initialize(id = nil, config = Convoy.config, **kwargs)
|
9
|
+
@id = id
|
10
|
+
@data = kwargs[:data].nil? ? {} : kwargs[:data]
|
11
|
+
@params = kwargs[:params].nil? ? {} : kwargs[:params]
|
12
|
+
@config = config
|
13
|
+
end
|
14
|
+
|
15
|
+
def resource_url
|
16
|
+
if @id.nil?
|
17
|
+
return "#{@config.base_uri}/#{@config.path_version}/sources"
|
18
|
+
end
|
19
|
+
|
20
|
+
"#{@config.base_uri}/#{@config.path_version}/sources" + "/#{@id}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Convoy
|
2
|
+
class Subscription < ApiResource
|
3
|
+
include ApiOperations::Save
|
4
|
+
include ApiOperations::Delete
|
5
|
+
include ApiOperations::List
|
6
|
+
extend ApiOperations::Create
|
7
|
+
|
8
|
+
def initialize(id = nil, config = Convoy.config, **kwargs)
|
9
|
+
@id = id
|
10
|
+
@data = kwargs[:data].nil? ? {} : kwargs[:data]
|
11
|
+
@params = kwargs[:params].nil? ? {} : kwargs[:params]
|
12
|
+
@config = config
|
13
|
+
end
|
14
|
+
|
15
|
+
def resource_url
|
16
|
+
if @id.nil?
|
17
|
+
return "#{@config.base_uri}/#{@config.path_version}/subscriptions"
|
18
|
+
end
|
19
|
+
|
20
|
+
"#{@config.base_uri}/#{@config.path_version}/subscriptions" + "/#{@id}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/convoy/version.rb
CHANGED
data/lib/convoy.rb
CHANGED
@@ -20,10 +20,12 @@ module Convoy
|
|
20
20
|
attr_reader :config
|
21
21
|
|
22
22
|
# User configurable options
|
23
|
+
# Some of them have defaults
|
23
24
|
def_delegators :@config, :ssl, :ssl=
|
24
25
|
def_delegators :@config, :debug, :debug=
|
25
26
|
def_delegators :@config, :username, :username=
|
26
27
|
def_delegators :@config, :password, :password=
|
28
|
+
def_delegators :@config, :api_key, :api_key=
|
27
29
|
def_delegators :@config, :base_uri, :base_uri=
|
28
30
|
def_delegators :@config, :logger, :logger=
|
29
31
|
def_delegators :@config, :log_level, :log_level=
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: convoy.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Subomi Oluwalana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -60,6 +60,8 @@ files:
|
|
60
60
|
- lib/convoy/resources/event.rb
|
61
61
|
- lib/convoy/resources/event_delivery.rb
|
62
62
|
- lib/convoy/resources/group.rb
|
63
|
+
- lib/convoy/resources/source.rb
|
64
|
+
- lib/convoy/resources/subscription.rb
|
63
65
|
- lib/convoy/version.rb
|
64
66
|
homepage: https://getconvoy.io
|
65
67
|
licenses:
|