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 +4 -4
- data/_VERSION +1 -1
- data/docs/inbox_registration.md +2 -0
- data/lib/files.com/api_client.rb +1 -1
- data/lib/files.com/models/inbox_registration.rb +5 -0
- data/lib/files.com/version.rb +1 -1
- data/spec/lib/api_client_spec.rb +44 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d2d3867066ef49d33dcd988f6e7bf64565b79a9c0d7f899e9d3b9dab9299139
|
4
|
+
data.tar.gz: 057aef5a0059cafcc818cdc20dfda9c9e39ed1ed561aa600f1b185544c5518cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de8bf6dfca781f772fd812cee93de79b502f95f91bcf34c793abd3fa1ff5ee407f738eb45d51fc21c1ca0d914480e9cb20de3c11b9371f707c3f64549be101cf
|
7
|
+
data.tar.gz: 9c45266b39899b4b22da5882b78c8852535efa458aa2f0d4c7f12ea61b957acb056f743478ee6e2d40007f021f2e62fb08c489923ed9ca8e018def3d9eeae7c3
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.477
|
data/docs/inbox_registration.md
CHANGED
@@ -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
|
data/lib/files.com/api_client.rb
CHANGED
data/lib/files.com/version.rb
CHANGED
@@ -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.
|
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-
|
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
|