files.com 1.0.475 → 1.0.477

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
  SHA256:
3
- metadata.gz: 8d21ba0970c8e89837e22a3331f55582ba72cee4b2427a5b59c48d475fb0d9e0
4
- data.tar.gz: 77654a114b8374a0d4f9b09a30f217cde9a47565f90b74b86fc52af989983062
3
+ metadata.gz: 5d2d3867066ef49d33dcd988f6e7bf64565b79a9c0d7f899e9d3b9dab9299139
4
+ data.tar.gz: 057aef5a0059cafcc818cdc20dfda9c9e39ed1ed561aa600f1b185544c5518cb
5
5
  SHA512:
6
- metadata.gz: 2ca9290f18deead0e0f89c5e0df6636d389d2988ab3cada8933068d881379bca124c443a4defc298b630e41a24a57238eb81864f5a643aed5a487b90832be672
7
- data.tar.gz: beeea188350014df0c37a08b4af452ed577251574a9cee00d3689040bb7e926f6e06e7f4787da07666a6cd5b259edc4fac89b5cb3b2dcceaf5f44f5e5262ea08
6
+ metadata.gz: de8bf6dfca781f772fd812cee93de79b502f95f91bcf34c793abd3fa1ff5ee407f738eb45d51fc21c1ca0d914480e9cb20de3c11b9371f707c3f64549be101cf
7
+ data.tar.gz: 9c45266b39899b4b22da5882b78c8852535efa458aa2f0d4c7f12ea61b957acb056f743478ee6e2d40007f021f2e62fb08c489923ed9ca8e018def3d9eeae7c3
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.475
1
+ 1.0.477
@@ -8,6 +8,7 @@
8
8
  "name": "account",
9
9
  "company": "Action Verb",
10
10
  "email": "john.doe@files.com",
11
+ "ip": "10.1.1.1",
11
12
  "clickwrap_body": "example",
12
13
  "form_field_set_id": 1,
13
14
  "form_field_data": {
@@ -24,6 +25,7 @@
24
25
  * `name` (string): Registrant name
25
26
  * `company` (string): Registrant company name
26
27
  * `email` (string): Registrant email address
28
+ * `ip` (string): Registrant IP Address
27
29
  * `clickwrap_body` (string): Clickwrap text that was shown to the registrant
28
30
  * `form_field_set_id` (int64): Id of associated form field set
29
31
  * `form_field_data` (object): Data for form field set with form field ids as keys and user data as values
@@ -229,7 +229,7 @@ module Files
229
229
  end
230
230
 
231
231
  case e
232
- when Faraday::ClientError
232
+ when Faraday::ClientError, Faraday::ServerError
233
233
  if e.response
234
234
  handle_error_response(e.response, error_context)
235
235
  else
@@ -29,6 +29,11 @@ module Files
29
29
  @attributes[:email]
30
30
  end
31
31
 
32
+ # string - Registrant IP Address
33
+ def ip
34
+ @attributes[:ip]
35
+ end
36
+
32
37
  # string - Clickwrap text that was shown to the registrant
33
38
  def clickwrap_body
34
39
  @attributes[:clickwrap_body]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.0.475"
4
+ VERSION = "1.0.477"
5
5
  end
@@ -0,0 +1,44 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Files::ApiClient do
4
+ let(:subject) { described_class.new }
5
+
6
+ describe "#execute_request_with_rescues" do
7
+ let(:context) { double('context', method: 'some method', path: 'some path') }
8
+
9
+ shared_examples 'a server error handler' do
10
+ before do
11
+ allow(subject).to receive(:log_request).and_raise(Faraday::ServerError.new('', mock_response))
12
+ end
13
+
14
+ it 'retries with sleeps and raises general api error' do
15
+ expect(subject).to receive(:sleep).with(0.5).ordered
16
+ expect(subject).to receive(:sleep).with(be_between(0.5, 1)).ordered
17
+ expect(subject).to receive(:sleep).with(be_between(1, 2)).ordered
18
+ expect {
19
+ subject.execute_request_with_rescues(1, context) { 'empty block' }
20
+ }.to raise_error(Files::APIError, error_message)
21
+ end
22
+ end
23
+
24
+ context 'when response is a valid json' do
25
+ it_behaves_like 'a server error handler' do
26
+ let(:error_message) { "Server Error" }
27
+ let(:mock_response) { { status: 502, headers: {}, body: { error: error_message }.to_json } }
28
+ end
29
+ end
30
+
31
+ context 'when response is html' do
32
+ it_behaves_like 'a server error handler' do
33
+ let(:mock_response) {
34
+ {
35
+ status: 502,
36
+ headers: { "Content-Type" => "text/html" },
37
+ body: "<html><head><title>502 Bad Gateway</title></head><body><center><h1>502 Bad Gateway</h1></center><hr><center>files.com</center></body></html>"
38
+ }
39
+ }
40
+ let(:error_message) { "Unexpected response object from API: \"#{mock_response[:body]}\" (HTTP response code was 502)" }
41
+ end
42
+ end
43
+ end
44
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.475
4
+ version: 1.0.477
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-25 00:00:00.000000000 Z
11
+ date: 2023-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -295,6 +295,7 @@ files:
295
295
  - lib/files.com/util.rb
296
296
  - lib/files.com/version.rb
297
297
  - shared/normalization_for_comparison_test_data.json
298
+ - spec/lib/api_client_spec.rb
298
299
  - spec/list_spec.rb
299
300
  - spec/models/file_spec.rb
300
301
  - spec/models/folder_spec.rb