filebound_client 0.3.4 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8156e7efc52c251f7da708595679f9cef56dbe2f1ccfe2e3c885bb3984bf0e58
4
- data.tar.gz: 28b7efd8ab5961dbda136b339463837e82c4bd7340a50916e59aecd2f6b35ea7
3
+ metadata.gz: e4c298380990383c5572e670540c81fa7ba921ad6ed6fc89569c2feaab43da05
4
+ data.tar.gz: 1c7317c2116217d0f27c469e584402af783e5dd4568488e01a84d9b3319f53c5
5
5
  SHA512:
6
- metadata.gz: b11fb0336dc19655ea72ff67e6eff8ddff378cfc988fbe539b40f6c85ef75b5396ee2a1d84f1b03bf899bd3590d637035406cce9dd3918a2eff07197f122d78a
7
- data.tar.gz: d784366f53fe5e96cf8764ee7f68f3714c8c16913cda326067b32948953c84846f93f7abfc88e24f0c399208c4c643b36bf93bf33ab09646d5ebc796d9983863
6
+ metadata.gz: 5d42ec2aac7f053fd6d05e278d3b56ad9c38d58d87ad3a2ec0232a1a236fbb099293a70c72f4f77b3135ec82ce630b076ab6498e96b2a26b06a10c8f004ddb6e
7
+ data.tar.gz: 1778bf7e70fa174a231d50fecea4b4acfdc495702be32c4135e77d2071322090e3e43265e41aed237970f19f0f440e078aec53f1a19516a811a4e0bb419b5099
@@ -0,0 +1,30 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby 2.6
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ version: 2.6.x
20
+
21
+ - name: Publish to RubyGems
22
+ run: |
23
+ mkdir -p $HOME/.gem
24
+ touch $HOME/.gem/credentials
25
+ chmod 0600 $HOME/.gem/credentials
26
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
27
+ gem build *.gemspec
28
+ gem push *.gem
29
+ env:
30
+ GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
@@ -3,7 +3,52 @@
3
3
 
4
4
  Changes to this gem will be noted here.
5
5
 
6
- ## [0.3.3] - 2019-03-20
6
+ ## [0.4.1] - 2021-01-13
7
+
8
+ ### Changed
9
+
10
+ - Allowed for the possibility that the Filebound API may return an empty string in the response body
11
+
12
+ ### Added
13
+
14
+ - Spec for creating a document note
15
+
16
+ ## [0.4.0] - 2020-12-30
17
+
18
+ ### Added
19
+
20
+ - Created FileboundClient::Endpoints::Documents#document_comments for retrieve comments for a document
21
+ - Created FileboundClient::Endpoints::Documents#document_add_comment for creating new comments on a document
22
+ - Created FileboundClient::Endpoints::Files#file_comments for retrieve comments for a file
23
+ - Created FileboundClient::Endpoints::Files#file_add_comment for creating new comments on a file
24
+
25
+ ## [0.3.8] - 2020-04-15
26
+
27
+ ### Changed
28
+
29
+ - Updated bundler to 2.1.4
30
+ - Updated gem dependencies to latest versions
31
+
32
+ ## [0.3.7] - 2019-07-29
33
+
34
+ ### Changed
35
+
36
+ - Updated yard to fix a security vulnerability (https://github.com/lsegal/yard/security/advisories/GHSA-xfhh-rx56-rxcr)
37
+ - Updated bundler to 1.17.3
38
+
39
+ ## [0.3.6] - 2019-06-06
40
+
41
+ ### Added
42
+
43
+ - Partially implemented Groups endpoint
44
+
45
+ ## [0.3.5] - 2019-03-20
46
+
47
+ ### Changed
48
+
49
+ - Enabled quirks mode on the JSON parser for all responses being parsed.
50
+
51
+ ## [0.3.4] - 2019-03-20
7
52
 
8
53
  ### Changed
9
54
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- filebound_client (0.3.3)
4
+ filebound_client (0.4.1)
5
5
  httpi (~> 2.4.0)
6
6
  rubyntlm (~> 0.6.0)
7
7
 
@@ -10,30 +10,30 @@ GEM
10
10
  specs:
11
11
  ast (2.4.0)
12
12
  diff-lcs (1.3)
13
- httpi (2.4.4)
13
+ httpi (2.4.5)
14
14
  rack
15
15
  socksify
16
- jaro_winkler (1.5.1)
17
- parallel (1.12.1)
18
- parser (2.5.1.2)
16
+ jaro_winkler (1.5.4)
17
+ parallel (1.19.1)
18
+ parser (2.7.1.1)
19
19
  ast (~> 2.4.0)
20
20
  powerpack (0.1.2)
21
- rack (2.0.6)
21
+ rack (2.2.3)
22
22
  rainbow (3.0.0)
23
- rake (12.3.1)
24
- rspec (3.7.0)
25
- rspec-core (~> 3.7.0)
26
- rspec-expectations (~> 3.7.0)
27
- rspec-mocks (~> 3.7.0)
28
- rspec-core (3.7.1)
29
- rspec-support (~> 3.7.0)
30
- rspec-expectations (3.7.0)
23
+ rake (12.3.3)
24
+ rspec (3.9.0)
25
+ rspec-core (~> 3.9.0)
26
+ rspec-expectations (~> 3.9.0)
27
+ rspec-mocks (~> 3.9.0)
28
+ rspec-core (3.9.1)
29
+ rspec-support (~> 3.9.1)
30
+ rspec-expectations (3.9.1)
31
31
  diff-lcs (>= 1.2.0, < 2.0)
32
- rspec-support (~> 3.7.0)
33
- rspec-mocks (3.7.0)
32
+ rspec-support (~> 3.9.0)
33
+ rspec-mocks (3.9.1)
34
34
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.7.0)
36
- rspec-support (3.7.1)
35
+ rspec-support (~> 3.9.0)
36
+ rspec-support (3.9.2)
37
37
  rubocop (0.58.2)
38
38
  jaro_winkler (~> 1.5.1)
39
39
  parallel (~> 1.10)
@@ -42,22 +42,19 @@ GEM
42
42
  rainbow (>= 2.2.2, < 4.0)
43
43
  ruby-progressbar (~> 1.7)
44
44
  unicode-display_width (~> 1.0, >= 1.0.1)
45
- ruby-progressbar (1.9.0)
45
+ ruby-progressbar (1.10.1)
46
46
  rubyntlm (0.6.2)
47
47
  socksify (1.7.1)
48
- unicode-display_width (1.4.0)
49
- yard (0.9.15)
48
+ unicode-display_width (1.7.0)
49
+ yard (0.9.24)
50
50
 
51
51
  PLATFORMS
52
52
  ruby
53
53
 
54
54
  DEPENDENCIES
55
- bundler (~> 1.16.0)
55
+ bundler (~> 2.1.4)
56
56
  filebound_client!
57
57
  rake (~> 12.3.0)
58
58
  rspec (~> 3.0)
59
59
  rubocop (~> 0.58.2)
60
- yard (~> 0.9.0)
61
-
62
- BUNDLED WITH
63
- 1.16.2
60
+ yard (>= 0.9.20)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FileboundClient
2
2
 
3
- This gem provides a easy way for you to access the Filebound API.
3
+ This gem provides an easy way for you to access the Filebound API.
4
4
 
5
5
  [![Build Status](https://travis-ci.org/JDHeiskell/filebound_client.svg?branch=master)](https://travis-ci.org/JDHeiskell/filebound_client)
6
6
 
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_development_dependency 'bundler', '~> 1.16.0'
24
+ spec.add_development_dependency 'bundler', '~> 2.1.4'
25
25
  spec.add_development_dependency 'rake', '~> 12.3.0'
26
- spec.add_development_dependency 'yard', '~> 0.9.0'
26
+ spec.add_development_dependency 'yard', '>= 0.9.20'
27
27
 
28
28
  spec.add_runtime_dependency 'httpi', '~> 2.4.0'
29
29
  spec.add_runtime_dependency 'rubyntlm', '~> 0.6.0'
@@ -42,7 +42,7 @@ module FileboundClient
42
42
  # @param [Hash] query_params the optional query parameters to pass to the GET request
43
43
  # @return [Hash] the JSON parsed hash of the response body
44
44
  def get(url, query_params = nil)
45
- JSON.parse(perform('get', url, query: query_params), symbolize_names: true)
45
+ JSON.parse(perform('get', url, query: query_params), symbolize_names: true, quirks_mode: true)
46
46
  end
47
47
 
48
48
  # Executes a GET request on the current Filebound client session expecting binary in the body of the response
@@ -60,7 +60,7 @@ module FileboundClient
60
60
  # @return [Hash] the JSON parsed hash of the response body
61
61
  def put(url, query_params = nil, body = nil)
62
62
  params = { headers: { 'Content-Type' => 'application/json' }, query: query_params, body: body }
63
- JSON.parse(perform('put', url, params), symbolize_names: true)
63
+ JSON.parse(perform('put', url, params), symbolize_names: true, quirks_mode: true)
64
64
  end
65
65
 
66
66
  # Executes a POST request on the current Filebound client session expecting JSON in the body of the request/response
@@ -70,7 +70,7 @@ module FileboundClient
70
70
  # @return [Hash] the JSON parsed hash of the response body
71
71
  def post(url, query_params = nil, body = nil)
72
72
  params = { headers: { 'Content-Type' => 'application/json' }, query: query_params, body: body }
73
- JSON.parse(perform('post', url, params), symbolize_names: true)
73
+ JSON.parse(perform('post', url, params), symbolize_names: true, quirks_mode: true)
74
74
  end
75
75
 
76
76
  # Executes a DELETE request on the current Filebound client session
@@ -101,7 +101,11 @@ module FileboundClient
101
101
  raise FileboundClientException.new(message, response.code)
102
102
  end
103
103
 
104
- response.body
104
+ if response.body.nil? || response.body.to_s == ''
105
+ '{}'
106
+ else
107
+ response.body
108
+ end
105
109
  end
106
110
  end
107
111
  end
@@ -42,6 +42,7 @@ module FileboundClient
42
42
  include FileboundClient::Endpoints::Users
43
43
  include FileboundClient::Endpoints::Routes
44
44
  include FileboundClient::Endpoints::RoutedItems
45
+ include FileboundClient::Endpoints::Groups
45
46
  end
46
47
  end
47
48
  # rubocop:enable Metrics/MethodLength, Metrics/AbcSize
@@ -94,9 +94,24 @@ module FileboundClient
94
94
  # Delete a document
95
95
  # @param [int] document_id the document key
96
96
  # @return [bool] true if document was deleted successfully
97
- def document_delete(document_id)
97
+ def document_delete(document_id, query_params = nil)
98
98
  delete("/documents/#{document_id}")
99
99
  end
100
+
101
+ # Returns the document comments for the supplied document key
102
+ # @param [int] document_id the document key
103
+ # @param [Hash] query_params the additional query params to send in the request
104
+ def document_comments(document_id, query_params = nil)
105
+ get("/documents/#{document_id}/comments", query_params)
106
+ end
107
+
108
+ # Adds a comment to document
109
+ # @param [int] document_id the document key
110
+ # @param [Hash] comment_data the comment to add
111
+ # @return [Hash] the newly added document comment hash
112
+ def document_add_comment(document_id, comment_data, query_params = nil)
113
+ put("/documents/#{document_id}/comments", nil, comment_data)
114
+ end
100
115
  end
101
116
  end
102
117
  end
@@ -64,6 +64,21 @@ module FileboundClient
64
64
  def file_delete(file_id)
65
65
  delete("/files/#{file_id}")
66
66
  end
67
+
68
+ # Returns the file comments for the supplied file key
69
+ # @param [int] file_id the file key
70
+ # @param [Hash] query_params the additional query params to send in the request
71
+ def file_comments(file_id, query_params = nil)
72
+ get("/files/#{file_id}/comments", query_params)
73
+ end
74
+
75
+ # Adds a comment to file
76
+ # @param [int] file_id the file key
77
+ # @param [Hash] comment_data the comment to add
78
+ # @return [Hash] the newly added file comment hash
79
+ def file_add_comment(file_id, comment_data, query_params = nil)
80
+ put("/files/#{file_id}/comments", nil, comment_data)
81
+ end
67
82
  end
68
83
  end
69
84
  end
@@ -0,0 +1,30 @@
1
+ module FileboundClient
2
+ module Endpoints
3
+ # Module for Groups resource endpoint
4
+ module Groups
5
+ # This will call macros to create resource methods on the fly
6
+ def self.included(klass)
7
+ klass.instance_eval do
8
+ allow_new :group
9
+ allow_all :groups
10
+ end
11
+ end
12
+
13
+ # Retrieves a single group by its key
14
+ # @param [int] group_id the group key
15
+ # @param [Hash] query_params additional query params to send in the request (optional params: filter)
16
+ # @return [Hash] the group hash
17
+ def group(group_id, query_params = nil)
18
+ get("/groups/#{group_id}", query_params)
19
+ end
20
+
21
+ # Retrieves projects assigned to the group
22
+ # @param [int] group_id the group key
23
+ # @param [Hash] query_params additional query params to send in the request (option params: filter)
24
+ # @return [Hash] the group hash
25
+ def group_projects(group_id, query_params = nil)
26
+ get("/groups/#{group_id}/projects", query_params)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,4 +1,4 @@
1
1
  module FileboundClient
2
2
  # Current version of gem
3
- VERSION = '0.3.4'.freeze
3
+ VERSION = '0.4.1'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filebound_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Richardson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.16.0
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.16.0
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: yard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.9.0
47
+ version: 0.9.20
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.9.0
54
+ version: 0.9.20
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: httpi
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -90,6 +90,7 @@ files:
90
90
  - ".github/ISSUE_TEMPLATE/bug_report.md"
91
91
  - ".github/ISSUE_TEMPLATE/feature_request.md"
92
92
  - ".github/PULL_REQUEST_TEMPLATE.md"
93
+ - ".github/workflows/gempush.yml"
93
94
  - ".gitignore"
94
95
  - ".rspec"
95
96
  - ".rubocop.yml"
@@ -120,6 +121,7 @@ files:
120
121
  - lib/filebound_client/endpoints/eform_data.rb
121
122
  - lib/filebound_client/endpoints/eform_detail.rb
122
123
  - lib/filebound_client/endpoints/files.rb
124
+ - lib/filebound_client/endpoints/groups.rb
123
125
  - lib/filebound_client/endpoints/projects.rb
124
126
  - lib/filebound_client/endpoints/query.rb
125
127
  - lib/filebound_client/endpoints/routed_items.rb
@@ -148,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
150
  - !ruby/object:Gem::Version
149
151
  version: '0'
150
152
  requirements: []
151
- rubyforge_project:
152
- rubygems_version: 2.7.6
153
+ rubygems_version: 3.2.3
153
154
  signing_key:
154
155
  specification_version: 4
155
156
  summary: Provides connection to FileBound API