synapseruby 1.0.11 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -7
- data/lib/synapse_api/client.rb +17 -3
- data/lib/synapse_api/user.rb +10 -3
- data/lib/synapse_api/version.rb +1 -1
- data/samples.md +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76f9a5b46f47d798880cff6f3432b6b899ada8cf
|
4
|
+
data.tar.gz: 9fa5d394c21d02ae7c852acb6a66ea1f7fe3c6ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90c1d6b5c0f04432817d51261f53a7b7e96bb65e206c56296183ff54365cf14d5b5fb5bbd3a3da0c0dcf790c474cf0d2b1663caac56d38a7b08abec4dac3fe33
|
7
|
+
data.tar.gz: 55498ae1597aa6b9cee18f3b64f9f503d66b70c48831f4f470273263a5ca2d7bd15f43d445b8acaf81cde90622d1f3babb2b5e5b00184e6a896e6fb279d59fe1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synapseruby (1.0.
|
4
|
+
synapseruby (1.0.11)
|
5
5
|
rest-client (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,14 +9,15 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
ansi (1.5.0)
|
11
11
|
builder (3.2.3)
|
12
|
-
domain_name (0.5.
|
12
|
+
domain_name (0.5.20190701)
|
13
13
|
unf (>= 0.0.5, < 1.0.0)
|
14
14
|
dotenv (2.1.2)
|
15
|
+
http-accept (1.7.0)
|
15
16
|
http-cookie (1.0.3)
|
16
17
|
domain_name (~> 0.5)
|
17
|
-
mime-types (3.
|
18
|
+
mime-types (3.3)
|
18
19
|
mime-types-data (~> 3.2015)
|
19
|
-
mime-types-data (3.
|
20
|
+
mime-types-data (3.2019.1009)
|
20
21
|
minitest (5.8.5)
|
21
22
|
minitest-reporters (1.1.19)
|
22
23
|
ansi
|
@@ -25,14 +26,16 @@ GEM
|
|
25
26
|
ruby-progressbar
|
26
27
|
netrc (0.11.0)
|
27
28
|
rake (10.5.0)
|
28
|
-
rest-client (2.0
|
29
|
+
rest-client (2.1.0)
|
30
|
+
http-accept (>= 1.7.0, < 2.0)
|
29
31
|
http-cookie (>= 1.0.2, < 2.0)
|
30
32
|
mime-types (>= 1.16, < 4.0)
|
31
33
|
netrc (~> 0.8)
|
32
34
|
ruby-progressbar (1.10.0)
|
35
|
+
rubygems-update (3.0.6)
|
33
36
|
unf (0.1.4)
|
34
37
|
unf_ext
|
35
|
-
unf_ext (0.0.7.
|
38
|
+
unf_ext (0.0.7.6)
|
36
39
|
|
37
40
|
PLATFORMS
|
38
41
|
ruby
|
@@ -43,7 +46,8 @@ DEPENDENCIES
|
|
43
46
|
minitest (~> 5.8.2)
|
44
47
|
minitest-reporters (~> 1.1.5)
|
45
48
|
rake (~> 10.0)
|
49
|
+
rubygems-update
|
46
50
|
synapseruby!
|
47
51
|
|
48
52
|
BUNDLED WITH
|
49
|
-
1.17.
|
53
|
+
1.17.2
|
data/lib/synapse_api/client.rb
CHANGED
@@ -234,19 +234,33 @@ module Synapse
|
|
234
234
|
end
|
235
235
|
|
236
236
|
# Returns all of the webhooks belonging to client
|
237
|
+
# @param page [Integer] (Optional)
|
238
|
+
# @param per_page [Integer] (Optional)
|
237
239
|
# @return [Hash]
|
238
|
-
def webhook_logs()
|
240
|
+
def webhook_logs(**options)
|
239
241
|
path = subscriptions_path + "/logs"
|
242
|
+
|
243
|
+
params = VALID_QUERY_PARAMS.map do |p|
|
244
|
+
options[p] ? "#{p}=#{options[p]}" : nil
|
245
|
+
end.compact
|
246
|
+
|
247
|
+
path += '?' + params.join('&') if params.any?
|
248
|
+
|
240
249
|
client.get(path)
|
241
250
|
end
|
242
251
|
|
243
252
|
# Issues public key for client
|
244
253
|
# @param scope [String]
|
254
|
+
# @param user_id [String] (Optional)
|
245
255
|
# @see https://docs.synapsefi.com/docs/issuing-public-key
|
246
256
|
# @note valid scope "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS"
|
247
|
-
def issue_public_key(scope:)
|
257
|
+
def issue_public_key(scope:, user_id: nil)
|
248
258
|
path = '/client?issue_public_key=YES'
|
249
|
-
|
259
|
+
|
260
|
+
path += "&scope=#{scope}"
|
261
|
+
|
262
|
+
path += "&user_id=#{user_id}" if user_id
|
263
|
+
|
250
264
|
response = client.get(path)
|
251
265
|
response[ "public_key_obj"]
|
252
266
|
end
|
data/lib/synapse_api/user.rb
CHANGED
@@ -282,7 +282,7 @@ module Synapse
|
|
282
282
|
# @return API response
|
283
283
|
def create_ubo(payload:)
|
284
284
|
path = get_user_path(user_id: self.user_id)
|
285
|
-
path = path +
|
285
|
+
path = path + "/ubo"
|
286
286
|
|
287
287
|
begin
|
288
288
|
response = client.patch(path,payload)
|
@@ -684,9 +684,16 @@ module Synapse
|
|
684
684
|
# Queries a node for a specific subnet by subnet_id
|
685
685
|
# @param node_id [String] id of node
|
686
686
|
# @param subnet_id [String,void] (optional) id of a subnet to look up
|
687
|
+
# @param full_dehydrate [String](optional)
|
687
688
|
# @return [Synapse::Subnet]
|
688
|
-
def get_subnet(node_id:,subnet_id
|
689
|
+
def get_subnet(node_id:,subnet_id:,**options)
|
689
690
|
path = node(user_id: self.user_id, node_id: node_id) + "/subnets/#{subnet_id}"
|
691
|
+
|
692
|
+
params = VALID_QUERY_PARAMS.map do |p|
|
693
|
+
options[p] ? "#{p}=#{options[p]}" : nil
|
694
|
+
end.compact
|
695
|
+
path += '?' + params.join('&') if params.any?
|
696
|
+
|
690
697
|
begin
|
691
698
|
subnet = client.get(path)
|
692
699
|
rescue Synapse::Error::Unauthorized
|
@@ -729,7 +736,7 @@ module Synapse
|
|
729
736
|
# @param payload [Hash]
|
730
737
|
# @see https://docs.synapsefi.com/reference#generate-node-statements
|
731
738
|
# @return API response [Hash]
|
732
|
-
def
|
739
|
+
def generate_node_statements(node_id:,payload:)
|
733
740
|
|
734
741
|
path = node(user_id: self.user_id, node_id: node_id) + "/statements"
|
735
742
|
|
data/lib/synapse_api/version.rb
CHANGED
data/samples.md
CHANGED
@@ -206,7 +206,7 @@ institutions = client.get_all_institutions(page: 5, per_page: 5)
|
|
206
206
|
- Returns api response
|
207
207
|
|
208
208
|
```bash
|
209
|
-
scope = "USERS|GET,USER|GET,USER|PATCH"
|
209
|
+
scope = ["USERS|GET","USER|GET","USER|PATCH"]
|
210
210
|
public_key = client.issue_public_key(scope: scope)
|
211
211
|
```
|
212
212
|
|
@@ -215,7 +215,7 @@ public_key = client.issue_public_key(scope: scope)
|
|
215
215
|
##### Get New Oauth
|
216
216
|
|
217
217
|
```bash
|
218
|
-
scope =["USERS|GET,USER|GET,USER|PATCH"]
|
218
|
+
scope =["USERS|GET","USER|GET","USER|PATCH"]
|
219
219
|
user.authenticate(scope: scope)
|
220
220
|
```
|
221
221
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synapseruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emmanuel Mawutor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|