synapseruby 1.0.12 → 1.0.17

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
  SHA1:
3
- metadata.gz: 5a77704cf37b9f664f423ab883cac5d8725194e6
4
- data.tar.gz: a33557fe6a3cc2830c14e95c361199313190a007
3
+ metadata.gz: 3d72b50ae4a0ed0be8f6714b5e1ea302a2ac40e0
4
+ data.tar.gz: e9f16ead3dd715a98d0bb7c1b6a9e5f857bc832a
5
5
  SHA512:
6
- metadata.gz: 2b5748d02dfa27b52633b134621562a98d5ef4ce0d24daa9a4623296af1962d93a1008fbfa809e488ff7edcd142e2b67dedab82f0da474b1b30b71175f68a86b
7
- data.tar.gz: 948a6f8c08ca2f3c20aa9eea2c8d70b9d1964d216dfffaf41d3116314556940f188858ed30844a4a2ce71954e24586bef65dda7f310ef79ce54614759f0296ee
6
+ metadata.gz: f0bce87c732feda7771d5a1675c9e604559f12a1a5bb841876cfe976d9eaeaf2a328ac838f0d58d8fd551c3e314b31ed7d79d73c27c89f4222264bb1fcdaeff4
7
+ data.tar.gz: 146751c632365fea84c80617dd0e24d9b6a4d8b33e92f2b258eedfd340b57bd41571df53a2ea8b86c73dd3259aac4af1aef2edd5fa336ba36a12954f6f4699d0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synapseruby (1.0.4)
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.20180417)
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.2.2)
18
+ mime-types (3.3)
18
19
  mime-types-data (~> 3.2015)
19
- mime-types-data (3.2018.0812)
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.2)
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.5)
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.1
53
+ 1.17.2
@@ -116,7 +116,7 @@ module Synapse
116
116
  Users.new(limit: response["limit"],
117
117
  page: response["page"],
118
118
  page_count: response["page_count"],
119
- user_count: response["user_count"],
119
+ user_count: response["users_count"],
120
120
  payload: users,
121
121
  http_client: client
122
122
  )
@@ -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
- path += "&scope=#{scope}"
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
@@ -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 get_node_statements(node_id:,payload:)
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
 
@@ -11,6 +11,7 @@ module Synapse
11
11
  @page = page
12
12
  @page_count = page_count
13
13
  @limit =limit
14
+ @user_count = user_count
14
15
  @payload = payload
15
16
  end
16
17
  end
@@ -4,7 +4,7 @@
4
4
  # gem push pkg/<pkg name>
5
5
  module Synapse
6
6
  # Gem version
7
- VERSION = '1.0.12'.freeze
7
+ VERSION = '1.0.17'.freeze
8
8
  end
9
9
 
10
10
 
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.12
4
+ version: 1.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emmanuel Mawutor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client