files.com 1.0.72 → 1.0.77

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Folder
5
5
  attr_reader :options, :attributes
6
+
6
7
  def self.[](*_)
7
8
  raise NotImplementedError
8
9
  end
@@ -3,6 +3,7 @@
3
3
  module Files
4
4
  class Session
5
5
  attr_reader :options, :attributes
6
+
6
7
  def destroy(params = {}, options = {})
7
8
  Session.destroy(params, options.merge(session: self, session_id: nil))
8
9
  end
@@ -404,6 +404,11 @@ module Files
404
404
  @attributes[:sftp_user_root_enabled]
405
405
  end
406
406
 
407
+ # boolean - Allow bundle creation
408
+ def sharing_enabled
409
+ @attributes[:sharing_enabled]
410
+ end
411
+
407
412
  # boolean - Show request access link for users without access? Currently unused.
408
413
  def show_request_access_link
409
414
  @attributes[:show_request_access_link]
@@ -605,6 +610,7 @@ module Files
605
610
  # disable_users_from_inactivity_period_days - int64 - If greater than zero, users will unable to login if they do not show activity within this number of days.
606
611
  # non_sso_groups_allowed - boolean - If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider.
607
612
  # non_sso_users_allowed - boolean - If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider.
613
+ # sharing_enabled - boolean - Allow bundle creation
608
614
  # allowed_2fa_method_sms - boolean - Is SMS two factor authentication allowed?
609
615
  # allowed_2fa_method_u2f - boolean - Is U2F two factor authentication allowed?
610
616
  # allowed_2fa_method_totp - boolean - Is TOTP two factor authentication allowed?
@@ -666,6 +672,7 @@ module Files
666
672
  raise InvalidParameterError.new("Bad parameter: default_time_zone must be an String") if params.dig(:default_time_zone) and !params.dig(:default_time_zone).is_a?(String)
667
673
  raise InvalidParameterError.new("Bad parameter: desktop_app_session_lifetime must be an Integer") if params.dig(:desktop_app_session_lifetime) and !params.dig(:desktop_app_session_lifetime).is_a?(Integer)
668
674
  raise InvalidParameterError.new("Bad parameter: welcome_screen must be an String") if params.dig(:welcome_screen) and !params.dig(:welcome_screen).is_a?(String)
675
+ raise InvalidParameterError.new("Bad parameter: session_expiry must be an Float") if params.dig(:session_expiry) and !params.dig(:session_expiry).is_a?(Float)
669
676
  raise InvalidParameterError.new("Bad parameter: user_lockout_tries must be an Integer") if params.dig(:user_lockout_tries) and !params.dig(:user_lockout_tries).is_a?(Integer)
670
677
  raise InvalidParameterError.new("Bad parameter: user_lockout_within must be an Integer") if params.dig(:user_lockout_within) and !params.dig(:user_lockout_within).is_a?(Integer)
671
678
  raise InvalidParameterError.new("Bad parameter: user_lockout_lock_period must be an Integer") if params.dig(:user_lockout_lock_period) and !params.dig(:user_lockout_lock_period).is_a?(Integer)
@@ -167,6 +167,15 @@ module Files
167
167
  @attributes[:group_ids] = value
168
168
  end
169
169
 
170
+ # string - Text to display to the user in the header of the UI
171
+ def header_text
172
+ @attributes[:header_text]
173
+ end
174
+
175
+ def header_text=(value)
176
+ @attributes[:header_text] = value
177
+ end
178
+
170
179
  # string - Preferred language
171
180
  def language
172
181
  @attributes[:language]
@@ -528,6 +537,7 @@ module Files
528
537
  # dav_permission - boolean - Can the user connect with WebDAV?
529
538
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting.
530
539
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
540
+ # header_text - string - Text to display to the user in the header of the UI
531
541
  # language - string - Preferred language
532
542
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
533
543
  # name - string - User's full name
@@ -562,6 +572,7 @@ module Files
562
572
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
563
573
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
564
574
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
575
+ raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
565
576
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
566
577
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
567
578
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
@@ -668,6 +679,7 @@ module Files
668
679
  # dav_permission - boolean - Can the user connect with WebDAV?
669
680
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting.
670
681
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
682
+ # header_text - string - Text to display to the user in the header of the UI
671
683
  # language - string - Preferred language
672
684
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
673
685
  # name - string - User's full name
@@ -698,6 +710,7 @@ module Files
698
710
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
699
711
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
700
712
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
713
+ raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
701
714
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
702
715
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
703
716
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
@@ -768,6 +781,7 @@ module Files
768
781
  # dav_permission - boolean - Can the user connect with WebDAV?
769
782
  # disabled - boolean - Is user disabled? Disabled users cannot log in, and do not count for billing purposes. Users can be automatically disabled after an inactivity period via a Site setting.
770
783
  # ftp_permission - boolean - Can the user access with FTP/FTPS?
784
+ # header_text - string - Text to display to the user in the header of the UI
771
785
  # language - string - Preferred language
772
786
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
773
787
  # name - string - User's full name
@@ -801,6 +815,7 @@ module Files
801
815
  raise InvalidParameterError.new("Bad parameter: allowed_ips must be an String") if params.dig(:allowed_ips) and !params.dig(:allowed_ips).is_a?(String)
802
816
  raise InvalidParameterError.new("Bad parameter: authenticate_until must be an String") if params.dig(:authenticate_until) and !params.dig(:authenticate_until).is_a?(String)
803
817
  raise InvalidParameterError.new("Bad parameter: authentication_method must be an String") if params.dig(:authentication_method) and !params.dig(:authentication_method).is_a?(String)
818
+ raise InvalidParameterError.new("Bad parameter: header_text must be an String") if params.dig(:header_text) and !params.dig(:header_text).is_a?(String)
804
819
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
805
820
  raise InvalidParameterError.new("Bad parameter: notification_daily_send_time must be an Integer") if params.dig(:notification_daily_send_time) and !params.dig(:notification_daily_send_time).is_a?(Integer)
806
821
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
@@ -5,7 +5,7 @@ module Files
5
5
 
6
6
  w.instance_variable_set(:@read_io, r)
7
7
 
8
- [r, w]
8
+ [ r, w ]
9
9
  end
10
10
 
11
11
  def size
@@ -29,4 +29,4 @@ module Files
29
29
  @read_io || self
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -12,15 +12,34 @@ RSpec.describe Files::List do
12
12
  let(:per_page) { 3 }
13
13
 
14
14
  context "when response includes a cursor" do
15
- let(:client) { instance_double(Files::ApiClient, cursor: "XXX-XXX") }
15
+ let(:client) { instance_double(Files::ApiClient) }
16
+ let(:stubbed_cursors) {
17
+ [
18
+ '3',
19
+ '6',
20
+ nil
21
+ ]
22
+ }
23
+
24
+ before do
25
+ allow(client).to receive(:cursor).and_return(*stubbed_cursors)
26
+ end
16
27
 
17
28
  it "does not call the API until out of responses" do
18
29
  server_results = ('a'..'h').to_a
19
30
  times_block_yielded = 0
31
+ request_cursor = nil
32
+ response_cursor = nil
33
+
20
34
  list = described_class.new(ResourceWrapper, params) {
21
35
  times_block_yielded += 1
36
+ request_cursor = params[:cursor]
37
+ range_start = params[:cursor] ? params[:cursor].to_i : 0
38
+
39
+ response_data = server_results[range_start, per_page]
40
+ response_cursor = (range_start + per_page).to_s
22
41
  [
23
- instance_double(Files::Response, data: server_results.shift(per_page), http_status: 200),
42
+ instance_double(Files::Response, data: response_data, http_status: 200, http_headers: { "x-files-cursor" => response_cursor }),
24
43
  options
25
44
  ]
26
45
  }
@@ -29,15 +48,18 @@ RSpec.describe Files::List do
29
48
  expect(times_block_yielded).to eq(0)
30
49
  expect(results.next.object).to eq('a')
31
50
  expect(times_block_yielded).to eq(1)
51
+ expect(request_cursor).to eq(nil)
32
52
  expect(results.next.object).to eq('b')
33
53
  expect(results.next.object).to eq('c')
34
54
  expect(results.next.object).to eq('d')
35
55
  expect(times_block_yielded).to eq(2)
56
+ expect(request_cursor).to eq("3")
36
57
  expect(results.next.object).to eq('e')
37
58
  expect(results.next.object).to eq('f')
38
59
  expect(results.next.object).to eq('g')
39
60
  expect(results.next.object).to eq('h')
40
61
  expect(times_block_yielded).to eq(3)
62
+ expect(request_cursor).to eq("6")
41
63
  end
42
64
 
43
65
  it "stops calling the API once there is an error" do
@@ -16,9 +16,7 @@ RSpec.configure do |config|
16
16
  let(:options) { { api_key: api_key } }
17
17
  end
18
18
 
19
- RSpec.configure do |config|
20
- config.include_context "API Helpers", :with_test_folder
21
- end
19
+ config.include_context "API Helpers", :with_test_folder
22
20
 
23
21
  config.around(:example, :with_test_folder) do |all|
24
22
  @api_key = ENV["TEST_API_KEY"] || File.read("../../config/test_api_key.txt")
@@ -63,7 +63,7 @@ end
63
63
 
64
64
  def test_sessions
65
65
  session = Files::Session.create(username: "sessionuser", password: "sessionuserpassword")
66
- user = Files::ApiKey.list({ user_id: 0 }, session: session)
66
+ Files::ApiKey.list({ user_id: 0 }, session: session)
67
67
  session.destroy
68
68
  end
69
69
 
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.72
4
+ version: 1.0.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-21 00:00:00.000000000 Z
11
+ date: 2020-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: faraday
14
+ name: addressable
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.1
19
+ version: 2.7.0
20
20
  type: :runtime
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.0.1
26
+ version: 2.7.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: net-http-persistent
28
+ name: concurrent-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 1.1.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 1.1.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: addressable
42
+ name: faraday
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 2.7.0
47
+ version: 1.0.1
48
48
  type: :runtime
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: 2.7.0
54
+ version: 1.0.1
55
55
  - !ruby/object:Gem::Dependency
56
- name: concurrent-ruby
56
+ name: net-http-persistent
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.1.3
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.1.3
68
+ version: '0'
69
69
  description: The Files.com Ruby client.
70
70
  email:
71
71
  - support@files.com
@@ -77,6 +77,7 @@ extra_rdoc_files: []
77
77
  files:
78
78
  - CONTRIBUTORS
79
79
  - Gemfile
80
+ - Gemfile.lock
80
81
  - LICENSE
81
82
  - README.md
82
83
  - Rakefile
@@ -91,6 +92,8 @@ files:
91
92
  - docs/automation.md
92
93
  - docs/behavior.md
93
94
  - docs/bundle.md
95
+ - docs/bundle_download.md
96
+ - docs/clickwrap.md
94
97
  - docs/dns_record.md
95
98
  - docs/errors.md
96
99
  - docs/file.md
@@ -145,6 +148,8 @@ files:
145
148
  - lib/files.com/models/automation.rb
146
149
  - lib/files.com/models/behavior.rb
147
150
  - lib/files.com/models/bundle.rb
151
+ - lib/files.com/models/bundle_download.rb
152
+ - lib/files.com/models/clickwrap.rb
148
153
  - lib/files.com/models/dir.rb
149
154
  - lib/files.com/models/dns_record.rb
150
155
  - lib/files.com/models/errors.rb
@@ -209,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
214
  requirements:
210
215
  - - ">="
211
216
  - !ruby/object:Gem::Version
212
- version: '2.3'
217
+ version: '2.5'
213
218
  required_rubygems_version: !ruby/object:Gem::Requirement
214
219
  requirements:
215
220
  - - ">="