files.com 1.0.62 → 1.0.67

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: 47b2517c82f3f42d1734e705931677fb550521a147ce08000d01ef1404c29024
4
- data.tar.gz: e7cbe0ac99053c1d156c57f8983ec58842552eef38d3e8b3e72faf8e4c262c8e
3
+ metadata.gz: ad3dc40bcbf022324c5002a75477568d213893b79d0f0e2538a3f48720bc6135
4
+ data.tar.gz: 3f4b7093d51bb6ea3da0b8cfee2266f32a0b0f3570ae481c7b28c4241a68180a
5
5
  SHA512:
6
- metadata.gz: a41ec5693d7f81ff075f8d3ad29f9b8e8fb047007ea0de0b2035b94bf9983bc1dd461f5fc06637628000dd9b815438c16a35bc4c35acdb94c801a0f6e69e94dc
7
- data.tar.gz: 2e2091a78586c778fae7573569d03a019a9dd20a8cd78d34c75dcba404560b967bef6c1efc3da603cda03409d44dce82e6b515a0ec8d0982e18e457b9344619e
6
+ metadata.gz: cd13285ed3725855ed062d740e3b16b8eb073f864fd8d6f93f70a80f23c237d44d84233e3e7f6c70618b862164f9ee4eb068a76d59a4153ea1373ef0dc6d4dec
7
+ data.tar.gz: c6d134d8fa1c968537db4c738bae87e15c8518a8440d7a253638f9bd73782464647405c54f9b8978f7f04dfeded4f1feef0bdffc5f68a9720fb10e01f6d45014
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.62
1
+ 1.0.67
@@ -8,4 +8,4 @@
8
8
  }
9
9
  ```
10
10
 
11
- * `dynamic` (object): Additional data
11
+ * `dynamic` (object):
@@ -60,7 +60,7 @@ Files::Behavior.list_for(path,
60
60
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
61
61
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
62
62
  * `path` (string): Required - Path to operate on.
63
- * `recursive` (string): Show behaviors below this path?
63
+ * `recursive` (string): Show behaviors above this path?
64
64
  * `behavior` (string): If set only shows folder behaviors matching this behavior type.
65
65
 
66
66
 
@@ -105,7 +105,9 @@ Files::Behavior.create(
105
105
  Files::Behavior.webhook_test(
106
106
  url: "https://www.site.com/...",
107
107
  method: "GET",
108
- encoding: "RAW"
108
+ encoding: "RAW",
109
+ headers: "x-test-header => testvalue",
110
+ body: "test-param => testvalue"
109
111
  )
110
112
  ```
111
113
 
@@ -114,6 +116,8 @@ Files::Behavior.webhook_test(
114
116
  * `url` (string): Required - URL for testing the webhook.
115
117
  * `method` (string): HTTP method(GET or POST).
116
118
  * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data).
119
+ * `headers` (object): Additional request headers.
120
+ * `body` (object): Additional body parameters.
117
121
 
118
122
 
119
123
  ---
@@ -4,33 +4,35 @@
4
4
 
5
5
  ```
6
6
  {
7
- "id": 1,
8
7
  "code": "abc123",
9
- "created_at": "2000-01-01T01:00:00Z",
8
+ "url": "https://subdomain.files.com/f/12345678",
10
9
  "description": "The public description of the bundle.",
10
+ "password_protected": true,
11
+ "require_registration": true,
12
+ "id": 1,
13
+ "created_at": "2000-01-01T01:00:00Z",
11
14
  "expires_at": "2000-01-01T01:00:00Z",
12
- "paths": [
13
-
14
- ],
15
15
  "note": "The internal note on the bundle.",
16
- "password_protected": true,
17
- "url": "https://subdomain.files.com/f/12345678",
18
16
  "user_id": 1,
19
- "username": "user"
17
+ "username": "user",
18
+ "paths": [
19
+
20
+ ]
20
21
  }
21
22
  ```
22
23
 
23
- * `id` (int64): Bundle ID
24
24
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
25
- * `created_at` (date-time): Bundle created at date/time
25
+ * `url` (string): Public URL of Share Link
26
26
  * `description` (string): Public description
27
+ * `password_protected` (boolean): Is this bundle password protected?
28
+ * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
29
+ * `id` (int64): Bundle ID
30
+ * `created_at` (date-time): Bundle created at date/time
27
31
  * `expires_at` (date-time): Bundle expiration date/time
28
- * `paths` (array): A list of paths in this bundle
29
32
  * `note` (string): Bundle internal note
30
- * `password_protected` (boolean): Is this bundle password protected?
31
- * `url` (string): Public URL of Share Link
32
33
  * `user_id` (int64): Bundle creator user ID
33
34
  * `username` (string): Bundle creator username
35
+ * `paths` (array): A list of paths in this bundle
34
36
  * `password` (string): Password for this bundle.
35
37
 
36
38
 
@@ -79,7 +81,8 @@ Files::Bundle.create(
79
81
  expires_at: "2000-01-01T01:00:00Z",
80
82
  description: "The public description of the bundle.",
81
83
  note: "The internal note on the bundle.",
82
- code: "abc123"
84
+ code: "abc123",
85
+ require_registration: true
83
86
  )
84
87
  ```
85
88
 
@@ -92,6 +95,7 @@ Files::Bundle.create(
92
95
  * `description` (string): Public description
93
96
  * `note` (string): Bundle internal note
94
97
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
98
+ * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
95
99
 
96
100
 
97
101
  ---
@@ -122,7 +126,8 @@ Files::Bundle.update(id,
122
126
  expires_at: "2000-01-01T01:00:00Z",
123
127
  description: "The public description of the bundle.",
124
128
  note: "The internal note on the bundle.",
125
- code: "abc123"
129
+ code: "abc123",
130
+ require_registration: true
126
131
  )
127
132
  ```
128
133
 
@@ -134,6 +139,7 @@ Files::Bundle.update(id,
134
139
  * `description` (string): Public description
135
140
  * `note` (string): Bundle internal note
136
141
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
142
+ * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
137
143
 
138
144
 
139
145
  ---
@@ -181,7 +187,8 @@ bundle.update(
181
187
  expires_at: "2000-01-01T01:00:00Z",
182
188
  description: "The public description of the bundle.",
183
189
  note: "The internal note on the bundle.",
184
- code: "abc123"
190
+ code: "abc123",
191
+ require_registration: true
185
192
  )
186
193
  ```
187
194
 
@@ -193,6 +200,7 @@ bundle.update(
193
200
  * `description` (string): Public description
194
201
  * `note` (string): Bundle internal note
195
202
  * `code` (string): Bundle code. This code forms the end part of the Public URL.
203
+ * `require_registration` (boolean): Show a registration page that captures the downloader's name and email address?
196
204
 
197
205
 
198
206
  ---
@@ -4,21 +4,25 @@
4
4
 
5
5
  ```
6
6
  {
7
- "name": "My Group",
8
- "id": 1,
7
+ "group_name": "My Group",
8
+ "group_id": 1,
9
+ "user_id": 1,
9
10
  "admin": true,
10
11
  "usernames": [
11
12
 
12
- ]
13
+ ],
14
+ "name": "",
15
+ "id": ""
13
16
  }
14
17
  ```
15
18
 
16
- * `name` (string): Group name
17
- * `id` (int64): Group ID
19
+ * `group_name` (string): Group name
20
+ * `group_id` (int64): Group ID
21
+ * `user_id` (int64): User ID
18
22
  * `admin` (boolean): Is this user an administrator of this group?
19
23
  * `usernames` (array): A list of usernames for users in this group
20
- * `group_id` (int64): Group ID to add user to.
21
- * `user_id` (int64): User ID to add to group.
24
+ * `name` (string):
25
+ * `id` (string):
22
26
 
23
27
 
24
28
  ---
@@ -36,11 +40,11 @@ Files::GroupUser.list(
36
40
 
37
41
  ### Parameters
38
42
 
39
- * `user_id` (int64): User ID. If provided, will return groups of which this user is a member.
43
+ * `user_id` (int64): User ID. If provided, will return group_users of this user.
40
44
  * `page` (int64): Current page number.
41
45
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
42
46
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
43
- * `group_id` (int64): Group ID. If provided, will return members of this group.
47
+ * `group_id` (int64): Group ID. If provided, will return group_users of this group.
44
48
 
45
49
 
46
50
  ---
@@ -42,7 +42,9 @@ Files::Notification.list(
42
42
  user_id: 1,
43
43
  page: 1,
44
44
  per_page: 1,
45
- group_id: 1
45
+ group_id: 1,
46
+ path: "path",
47
+ include_ancestors: true
46
48
  )
47
49
  ```
48
50
 
@@ -53,6 +55,8 @@ Files::Notification.list(
53
55
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
54
56
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
55
57
  * `group_id` (int64): Show notifications for this Group ID.
58
+ * `path` (string): Show notifications for this Path.
59
+ * `include_ancestors` (boolean): If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
56
60
 
57
61
 
58
62
  ---
@@ -32,6 +32,8 @@
32
32
  "disable_password_reset": true,
33
33
  "domain": "my-custom-domain.com",
34
34
  "email": "john.doe@files.com",
35
+ "non_sso_groups_allowed": true,
36
+ "non_sso_users_allowed": true,
35
37
  "folder_permissions_groups_only": true,
36
38
  "hipaa": true,
37
39
  "icon128": "",
@@ -140,6 +142,8 @@
140
142
  * `disable_password_reset` (boolean): Is password reset disabled?
141
143
  * `domain` (string): Custom domain
142
144
  * `email` (email): Main email for this site
145
+ * `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.
146
+ * `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.
143
147
  * `folder_permissions_groups_only` (boolean): If true, permissions for this site must be bound to a group (not a user). Otherwise, permissions must be bound to a user.
144
148
  * `hipaa` (boolean): Is there a signed HIPAA BAA between Files.com and this site?
145
149
  * `icon128`: Branded icon 128x128
@@ -289,6 +293,8 @@ Files::Site.update(
289
293
  use_provided_modified_at: true,
290
294
  custom_namespace: true,
291
295
  disable_users_from_inactivity_period_days: 1,
296
+ non_sso_groups_allowed: true,
297
+ non_sso_users_allowed: true,
292
298
  allowed_2fa_method_sms: true,
293
299
  allowed_2fa_method_u2f: true,
294
300
  allowed_2fa_method_totp: true,
@@ -377,6 +383,8 @@ Files::Site.update(
377
383
  * `use_provided_modified_at` (boolean): Allow uploaders to set `provided_modified_at` for uploaded files?
378
384
  * `custom_namespace` (boolean): Is this site using a custom namespace for users?
379
385
  * `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.
386
+ * `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.
387
+ * `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.
380
388
  * `allowed_2fa_method_sms` (boolean): Is SMS two factor authentication allowed?
381
389
  * `allowed_2fa_method_u2f` (boolean): Is U2F two factor authentication allowed?
382
390
  * `allowed_2fa_method_totp` (boolean): Is TOTP two factor authentication allowed?
@@ -4,7 +4,9 @@
4
4
 
5
5
  ```
6
6
  {
7
- "protocol": "okta",
7
+ "protocol": [
8
+
9
+ ],
8
10
  "provider": "okta",
9
11
  "label": "My Corporate SSO Provider",
10
12
  "logo_url": "https://mysite.files.com/.../logo.png",
@@ -19,6 +21,8 @@
19
21
  "subdomain": "my-site",
20
22
  "provision_users": true,
21
23
  "provision_groups": true,
24
+ "deprovision_users": true,
25
+ "deprovision_groups": true,
22
26
  "provision_group_default": "Employees",
23
27
  "provision_group_exclusion": "Employees",
24
28
  "provision_group_inclusion": "Employees",
@@ -26,10 +30,8 @@
26
30
  "provision_attachments_permission": true,
27
31
  "provision_dav_permission": true,
28
32
  "provision_ftp_permission": true,
29
- "provision_group_action": "disabled",
30
33
  "provision_sftp_permission": true,
31
34
  "provision_time_zone": "Eastern Time (US & Canada)",
32
- "provision_user_action": "disabled",
33
35
  "ldap_base_dn": "",
34
36
  "ldap_domain": "mysite.com",
35
37
  "enabled": true,
@@ -38,13 +40,12 @@
38
40
  "ldap_host_3": "ldap3.site.com",
39
41
  "ldap_port": 1,
40
42
  "ldap_secure": true,
41
- "ldap_user_include_groups": "",
42
43
  "ldap_username": "[ldap username]",
43
44
  "ldap_username_field": "sAMAccountName"
44
45
  }
45
46
  ```
46
47
 
47
- * `protocol` (string): SSO Protocol
48
+ * `protocol` (array): SSO Protocol
48
49
  * `provider` (string): Provider name
49
50
  * `label` (string): Custom label for the SSO provider on the login page.
50
51
  * `logo_url` (string): URL holding a custom logo for the SSO provider on the login page.
@@ -59,6 +60,8 @@
59
60
  * `subdomain` (string): Subdomain
60
61
  * `provision_users` (boolean): Auto-provision users?
61
62
  * `provision_groups` (boolean): Auto-provision group membership based on group memberships on the SSO side?
63
+ * `deprovision_users` (boolean): Auto-deprovision users?
64
+ * `deprovision_groups` (boolean): Auto-deprovision group membership based on group memberships on the SSO side?
62
65
  * `provision_group_default` (string): Comma-separated list of group names for groups to automatically add all auto-provisioned users to.
63
66
  * `provision_group_exclusion` (string): Comma-separated list of group names for groups (with optional wildcards) that will be excluded from auto-provisioning.
64
67
  * `provision_group_inclusion` (string): Comma-separated list of group names for groups (with optional wildcards) that will be auto-provisioned.
@@ -66,10 +69,8 @@
66
69
  * `provision_attachments_permission` (boolean): Auto-provisioned users get Sharing permission?
67
70
  * `provision_dav_permission` (boolean): Auto-provisioned users get WebDAV permission?
68
71
  * `provision_ftp_permission` (boolean): Auto-provisioned users get FTP permission?
69
- * `provision_group_action` (string): Should we sync groups from this strategy?
70
72
  * `provision_sftp_permission` (boolean): Auto-provisioned users get SFTP permission?
71
73
  * `provision_time_zone` (string): Default time zone for auto provisioned users.
72
- * `provision_user_action` (string): Should we sync users from this strategy?
73
74
  * `ldap_base_dn` (string): Base DN for looking up users in LDAP server
74
75
  * `ldap_domain` (string): Domain name that will be appended to LDAP usernames
75
76
  * `enabled` (boolean): Is strategy enabled?
@@ -78,7 +79,6 @@
78
79
  * `ldap_host_3` (string): LDAP backup host
79
80
  * `ldap_port` (int64): LDAP port
80
81
  * `ldap_secure` (boolean): Use secure LDAP?
81
- * `ldap_user_include_groups` (string): Comma or newline separated list of group names (with optional wildcards) - if provided, only users in these groups will be added or synced.
82
82
  * `ldap_username` (string): Username for signing in to LDAP server.
83
83
  * `ldap_username_field` (string): LDAP username field
84
84
 
@@ -17,5 +17,5 @@
17
17
  * `code` (int64): Status http code
18
18
  * `message` (string): Error message
19
19
  * `status` (string): Status message
20
- * `data`:
20
+ * `data`: Additional data
21
21
  * `errors` (array): A list of api errors
@@ -93,7 +93,7 @@
93
93
  * `ssl_required` (string): SSL required setting
94
94
  * `sso_strategy_id` (int64): SSO (Single Sign On) strategy ID for the user, if applicable.
95
95
  * `subscribe_to_newsletter` (boolean): Is the user subscribed to the newsletter?
96
- * `externally_managed` (boolean): Is this user managed by an external source (such as LDAP)?
96
+ * `externally_managed` (boolean): Is this user managed by a SsoStrategy?
97
97
  * `time_zone` (string): User time zone
98
98
  * `type_of_2fa` (string): Type(s) of 2FA methods in use. Will be either `sms`, `totp`, `u2f`, `yubi`, or multiple values sorted alphabetically and joined by an underscore.
99
99
  * `user_root` (string): Root folder for FTP (and optionally SFTP if the appropriate site-wide setting is set.) Note that this is not used for API, Desktop, or Web interface.
@@ -132,6 +132,8 @@ Files::User.list(
132
132
  * `q[password_validity_days]` (string): If set, list only users with overridden password validity days setting.
133
133
  * `q[ssl_required]` (string): If set, list only users with overridden SSL required setting.
134
134
  * `search` (string): Searches for partial matches of name, username, or email.
135
+ * `sort_by[last_login_at]` (string): If set, sort users by 'last_login_at' in either 'asc' or 'desc' direction
136
+ * `sort_by[authenticate_until]` (string): If set, sort users by 'authenticate_until' in either 'asc' or 'desc' direction
135
137
 
136
138
 
137
139
  ---
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.add_dependency 'faraday', ">= 1.0.1"
15
15
  s.add_dependency 'net-http-persistent'
16
16
  s.add_dependency 'addressable', ">= 2.7.0"
17
+ s.add_dependency 'concurrent-ruby', ">= 1.1.6"
17
18
 
18
19
  s.files = `find *`.split("\n").uniq.sort.reject(&:empty?)
19
20
  s.executables = [ "files", "files-console" ]
@@ -11,11 +11,13 @@ require "set"
11
11
  require "socket"
12
12
  require "uri"
13
13
  require "addressable/uri"
14
+ require "concurrent/promise"
14
15
 
15
16
  $LOAD_PATH.push __dir__
16
17
 
17
18
  require "files.com/version"
18
19
 
20
+ require "files.com/sizable_io"
19
21
  require "files.com/api"
20
22
  require "files.com/api_client"
21
23
  require "files.com/errors"
@@ -146,13 +146,19 @@ module Files
146
146
 
147
147
  def stream_download(uri, io)
148
148
  if conn.adapter == Faraday::Adapter::NetHttp
149
- remote_request(:get, uri) do |req|
150
- req.options.on_data = proc do |chunk, _overall_received_bytes|
151
- io.write(chunk.encode!)
149
+ uri = URI(uri)
150
+ Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
151
+ request = Net::HTTP::Get.new uri
152
+ http.request request do |response|
153
+ io.fulfill_content_length(response.content_length) if io.respond_to?(:fulfill_content_length)
154
+ response.read_body do |chunk|
155
+ io << chunk.encode!
156
+ end
152
157
  end
153
158
  end
154
159
  else
155
160
  response = remote_request(:get, uri)
161
+ io.fulfill_content_length(response.content_length) if io.respond_to?(:fulfill_content_length)
156
162
  io.write(response.body)
157
163
  end
158
164
  end
@@ -9,7 +9,7 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
- # object - Additional data
12
+ # object
13
13
  def dynamic
14
14
  @attributes[:dynamic]
15
15
  end
@@ -123,7 +123,7 @@ module Files
123
123
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
124
124
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
125
125
  # path (required) - string - Path to operate on.
126
- # recursive - string - Show behaviors below this path?
126
+ # recursive - string - Show behaviors above this path?
127
127
  # behavior - string - If set only shows folder behaviors matching this behavior type.
128
128
  def self.list_for(path, params = {}, options = {})
129
129
  params ||= {}
@@ -175,10 +175,14 @@ module Files
175
175
  # url (required) - string - URL for testing the webhook.
176
176
  # method - string - HTTP method(GET or POST).
177
177
  # encoding - string - HTTP encoding method. Can be JSON, XML, or RAW (form data).
178
+ # headers - object - Additional request headers.
179
+ # body - object - Additional body parameters.
178
180
  def self.webhook_test(params = {}, options = {})
179
181
  raise InvalidParameterError.new("Bad parameter: url must be an String") if params.dig(:url) and !params.dig(:url).is_a?(String)
180
182
  raise InvalidParameterError.new("Bad parameter: method must be an String") if params.dig(:method) and !params.dig(:method).is_a?(String)
181
183
  raise InvalidParameterError.new("Bad parameter: encoding must be an String") if params.dig(:encoding) and !params.dig(:encoding).is_a?(String)
184
+ raise InvalidParameterError.new("Bad parameter: headers must be an Hash") if params.dig(:headers) and !params.dig(:headers).is_a?(Hash)
185
+ raise InvalidParameterError.new("Bad parameter: body must be an Hash") if params.dig(:body) and !params.dig(:body).is_a?(Hash)
182
186
  raise MissingParameterError.new("Parameter missing: url") unless params.dig(:url)
183
187
 
184
188
  response, _options = Api.send_request("/behaviors/webhook/test", :post, params, options)
@@ -9,15 +9,6 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
- # int64 - Bundle ID
13
- def id
14
- @attributes[:id]
15
- end
16
-
17
- def id=(value)
18
- @attributes[:id] = value
19
- end
20
-
21
12
  # string - Bundle code. This code forms the end part of the Public URL.
22
13
  def code
23
14
  @attributes[:code]
@@ -27,9 +18,13 @@ module Files
27
18
  @attributes[:code] = value
28
19
  end
29
20
 
30
- # date-time - Bundle created at date/time
31
- def created_at
32
- @attributes[:created_at]
21
+ # string - Public URL of Share Link
22
+ def url
23
+ @attributes[:url]
24
+ end
25
+
26
+ def url=(value)
27
+ @attributes[:url] = value
33
28
  end
34
29
 
35
30
  # string - Public description
@@ -41,49 +36,54 @@ module Files
41
36
  @attributes[:description] = value
42
37
  end
43
38
 
44
- # date-time - Bundle expiration date/time
45
- def expires_at
46
- @attributes[:expires_at]
39
+ # boolean - Is this bundle password protected?
40
+ def password_protected
41
+ @attributes[:password_protected]
47
42
  end
48
43
 
49
- def expires_at=(value)
50
- @attributes[:expires_at] = value
44
+ def password_protected=(value)
45
+ @attributes[:password_protected] = value
51
46
  end
52
47
 
53
- # array - A list of paths in this bundle
54
- def paths
55
- @attributes[:paths]
48
+ # boolean - Show a registration page that captures the downloader's name and email address?
49
+ def require_registration
50
+ @attributes[:require_registration]
56
51
  end
57
52
 
58
- def paths=(value)
59
- @attributes[:paths] = value
53
+ def require_registration=(value)
54
+ @attributes[:require_registration] = value
60
55
  end
61
56
 
62
- # string - Bundle internal note
63
- def note
64
- @attributes[:note]
57
+ # int64 - Bundle ID
58
+ def id
59
+ @attributes[:id]
65
60
  end
66
61
 
67
- def note=(value)
68
- @attributes[:note] = value
62
+ def id=(value)
63
+ @attributes[:id] = value
69
64
  end
70
65
 
71
- # boolean - Is this bundle password protected?
72
- def password_protected
73
- @attributes[:password_protected]
66
+ # date-time - Bundle created at date/time
67
+ def created_at
68
+ @attributes[:created_at]
74
69
  end
75
70
 
76
- def password_protected=(value)
77
- @attributes[:password_protected] = value
71
+ # date-time - Bundle expiration date/time
72
+ def expires_at
73
+ @attributes[:expires_at]
78
74
  end
79
75
 
80
- # string - Public URL of Share Link
81
- def url
82
- @attributes[:url]
76
+ def expires_at=(value)
77
+ @attributes[:expires_at] = value
83
78
  end
84
79
 
85
- def url=(value)
86
- @attributes[:url] = value
80
+ # string - Bundle internal note
81
+ def note
82
+ @attributes[:note]
83
+ end
84
+
85
+ def note=(value)
86
+ @attributes[:note] = value
87
87
  end
88
88
 
89
89
  # int64 - Bundle creator user ID
@@ -104,6 +104,15 @@ module Files
104
104
  @attributes[:username] = value
105
105
  end
106
106
 
107
+ # array - A list of paths in this bundle
108
+ def paths
109
+ @attributes[:paths]
110
+ end
111
+
112
+ def paths=(value)
113
+ @attributes[:paths] = value
114
+ end
115
+
107
116
  # string - Password for this bundle.
108
117
  def password
109
118
  @attributes[:password]
@@ -137,6 +146,7 @@ module Files
137
146
  # description - string - Public description
138
147
  # note - string - Bundle internal note
139
148
  # code - string - Bundle code. This code forms the end part of the Public URL.
149
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
140
150
  def update(params = {})
141
151
  params ||= {}
142
152
  params[:id] = @attributes[:id]
@@ -217,6 +227,7 @@ module Files
217
227
  # description - string - Public description
218
228
  # note - string - Bundle internal note
219
229
  # code - string - Bundle code. This code forms the end part of the Public URL.
230
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
220
231
  def self.create(params = {}, options = {})
221
232
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
222
233
  raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params.dig(:paths) and !params.dig(:paths).is_a?(Array)
@@ -255,6 +266,7 @@ module Files
255
266
  # description - string - Public description
256
267
  # note - string - Bundle internal note
257
268
  # code - string - Bundle code. This code forms the end part of the Public URL.
269
+ # require_registration - boolean - Show a registration page that captures the downloader's name and email address?
258
270
  def self.update(id, params = {}, options = {})
259
271
  params ||= {}
260
272
  params[:id] = id
@@ -389,7 +389,7 @@ module Files
389
389
 
390
390
  def read_io
391
391
  @read_io ||= begin
392
- r, w = IO.pipe
392
+ r, w = SizableIO.pipe
393
393
  Thread.new do
394
394
  download_content(w)
395
395
  ensure
@@ -10,21 +10,30 @@ module Files
10
10
  end
11
11
 
12
12
  # string - Group name
13
- def name
14
- @attributes[:name]
13
+ def group_name
14
+ @attributes[:group_name]
15
15
  end
16
16
 
17
- def name=(value)
18
- @attributes[:name] = value
17
+ def group_name=(value)
18
+ @attributes[:group_name] = value
19
19
  end
20
20
 
21
21
  # int64 - Group ID
22
- def id
23
- @attributes[:id]
22
+ def group_id
23
+ @attributes[:group_id]
24
24
  end
25
25
 
26
- def id=(value)
27
- @attributes[:id] = value
26
+ def group_id=(value)
27
+ @attributes[:group_id] = value
28
+ end
29
+
30
+ # int64 - User ID
31
+ def user_id
32
+ @attributes[:user_id]
33
+ end
34
+
35
+ def user_id=(value)
36
+ @attributes[:user_id] = value
28
37
  end
29
38
 
30
39
  # boolean - Is this user an administrator of this group?
@@ -45,22 +54,22 @@ module Files
45
54
  @attributes[:usernames] = value
46
55
  end
47
56
 
48
- # int64 - Group ID to add user to.
49
- def group_id
50
- @attributes[:group_id]
57
+ # string
58
+ def name
59
+ @attributes[:name]
51
60
  end
52
61
 
53
- def group_id=(value)
54
- @attributes[:group_id] = value
62
+ def name=(value)
63
+ @attributes[:name] = value
55
64
  end
56
65
 
57
- # int64 - User ID to add to group.
58
- def user_id
59
- @attributes[:user_id]
66
+ # string
67
+ def id
68
+ @attributes[:id]
60
69
  end
61
70
 
62
- def user_id=(value)
63
- @attributes[:user_id] = value
71
+ def id=(value)
72
+ @attributes[:id] = value
64
73
  end
65
74
 
66
75
  # Parameters:
@@ -100,11 +109,11 @@ module Files
100
109
  end
101
110
 
102
111
  # Parameters:
103
- # user_id - int64 - User ID. If provided, will return groups of which this user is a member.
112
+ # user_id - int64 - User ID. If provided, will return group_users of this user.
104
113
  # page - int64 - Current page number.
105
114
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
106
115
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
107
- # group_id - int64 - Group ID. If provided, will return members of this group.
116
+ # group_id - int64 - Group ID. If provided, will return group_users of this group.
108
117
  def self.list(params = {}, options = {})
109
118
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
110
119
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
@@ -161,12 +161,15 @@ module Files
161
161
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
162
162
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
163
163
  # group_id - int64 - Show notifications for this Group ID.
164
+ # path - string - Show notifications for this Path.
165
+ # include_ancestors - boolean - If `include_ancestors` is `true` and `path` is specified, include notifications for any parent paths. Ignored if `path` is not specified.
164
166
  def self.list(params = {}, options = {})
165
167
  raise InvalidParameterError.new("Bad parameter: user_id must be an Integer") if params.dig(:user_id) and !params.dig(:user_id).is_a?(Integer)
166
168
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
167
169
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
168
170
  raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)
169
171
  raise InvalidParameterError.new("Bad parameter: group_id must be an Integer") if params.dig(:group_id) and !params.dig(:group_id).is_a?(Integer)
172
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params.dig(:path) and !params.dig(:path).is_a?(String)
170
173
 
171
174
  response, options = Api.send_request("/notifications", :get, params, options)
172
175
  end
@@ -149,6 +149,16 @@ module Files
149
149
  @attributes[:email]
150
150
  end
151
151
 
152
+ # boolean - If true, groups can be manually created / modified / deleted by Site Admins. Otherwise, groups can only be managed via your SSO provider.
153
+ def non_sso_groups_allowed
154
+ @attributes[:non_sso_groups_allowed]
155
+ end
156
+
157
+ # boolean - If true, users can be manually created / modified / deleted by Site Admins. Otherwise, users can only be managed via your SSO provider.
158
+ def non_sso_users_allowed
159
+ @attributes[:non_sso_users_allowed]
160
+ end
161
+
152
162
  # boolean - If true, permissions for this site must be bound to a group (not a user). Otherwise, permissions must be bound to a user.
153
163
  def folder_permissions_groups_only
154
164
  @attributes[:folder_permissions_groups_only]
@@ -593,6 +603,8 @@ module Files
593
603
  # use_provided_modified_at - boolean - Allow uploaders to set `provided_modified_at` for uploaded files?
594
604
  # custom_namespace - boolean - Is this site using a custom namespace for users?
595
605
  # 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
+ # 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
+ # 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.
596
608
  # allowed_2fa_method_sms - boolean - Is SMS two factor authentication allowed?
597
609
  # allowed_2fa_method_u2f - boolean - Is U2F two factor authentication allowed?
598
610
  # allowed_2fa_method_totp - boolean - Is TOTP two factor authentication allowed?
@@ -9,7 +9,7 @@ module Files
9
9
  @options = options || {}
10
10
  end
11
11
 
12
- # string - SSO Protocol
12
+ # array - SSO Protocol
13
13
  def protocol
14
14
  @attributes[:protocol]
15
15
  end
@@ -84,6 +84,16 @@ module Files
84
84
  @attributes[:provision_groups]
85
85
  end
86
86
 
87
+ # boolean - Auto-deprovision users?
88
+ def deprovision_users
89
+ @attributes[:deprovision_users]
90
+ end
91
+
92
+ # boolean - Auto-deprovision group membership based on group memberships on the SSO side?
93
+ def deprovision_groups
94
+ @attributes[:deprovision_groups]
95
+ end
96
+
87
97
  # string - Comma-separated list of group names for groups to automatically add all auto-provisioned users to.
88
98
  def provision_group_default
89
99
  @attributes[:provision_group_default]
@@ -119,11 +129,6 @@ module Files
119
129
  @attributes[:provision_ftp_permission]
120
130
  end
121
131
 
122
- # string - Should we sync groups from this strategy?
123
- def provision_group_action
124
- @attributes[:provision_group_action]
125
- end
126
-
127
132
  # boolean - Auto-provisioned users get SFTP permission?
128
133
  def provision_sftp_permission
129
134
  @attributes[:provision_sftp_permission]
@@ -134,11 +139,6 @@ module Files
134
139
  @attributes[:provision_time_zone]
135
140
  end
136
141
 
137
- # string - Should we sync users from this strategy?
138
- def provision_user_action
139
- @attributes[:provision_user_action]
140
- end
141
-
142
142
  # string - Base DN for looking up users in LDAP server
143
143
  def ldap_base_dn
144
144
  @attributes[:ldap_base_dn]
@@ -179,11 +179,6 @@ module Files
179
179
  @attributes[:ldap_secure]
180
180
  end
181
181
 
182
- # string - Comma or newline separated list of group names (with optional wildcards) - if provided, only users in these groups will be added or synced.
183
- def ldap_user_include_groups
184
- @attributes[:ldap_user_include_groups]
185
- end
186
-
187
182
  # string - Username for signing in to LDAP server.
188
183
  def ldap_username
189
184
  @attributes[:ldap_username]
@@ -24,6 +24,7 @@ module Files
24
24
  @attributes[:status]
25
25
  end
26
26
 
27
+ # Additional data
27
28
  def data
28
29
  @attributes[:data]
29
30
  end
@@ -356,7 +356,7 @@ module Files
356
356
  @attributes[:subscribe_to_newsletter] = value
357
357
  end
358
358
 
359
- # boolean - Is this user managed by an external source (such as LDAP)?
359
+ # boolean - Is this user managed by a SsoStrategy?
360
360
  def externally_managed
361
361
  @attributes[:externally_managed]
362
362
  end
@@ -612,6 +612,8 @@ module Files
612
612
  # q[password_validity_days] - string - If set, list only users with overridden password validity days setting.
613
613
  # q[ssl_required] - string - If set, list only users with overridden SSL required setting.
614
614
  # search - string - Searches for partial matches of name, username, or email.
615
+ # sort_by[last_login_at] - string - If set, sort users by 'last_login_at' in either 'asc' or 'desc' direction
616
+ # sort_by[authenticate_until] - string - If set, sort users by 'authenticate_until' in either 'asc' or 'desc' direction
615
617
  def self.list(params = {}, options = {})
616
618
  raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
617
619
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
@@ -0,0 +1,32 @@
1
+ module Files
2
+ class SizableIO < IO
3
+ def self.pipe
4
+ r, w = super
5
+
6
+ w.instance_variable_set(:@read_io, r)
7
+
8
+ [r, w]
9
+ end
10
+
11
+ def size
12
+ read_io.content_length_promise.wait.value
13
+ end
14
+
15
+ def fulfill_content_length(length)
16
+ read_io.content_length = length
17
+ read_io.content_length_promise.execute
18
+ end
19
+
20
+ protected
21
+
22
+ attr_accessor :content_length
23
+
24
+ def content_length_promise
25
+ @content_length_promise ||= Concurrent::Promise.new { content_length }
26
+ end
27
+
28
+ def read_io
29
+ @read_io || self
30
+ end
31
+ end
32
+ end
@@ -24,8 +24,9 @@ RSpec.describe Files::File, :with_test_folder do
24
24
 
25
25
  it "returns an IO Object" do
26
26
  file = Files::File.find(test_folder.join("read.txt").to_s, {}, options)
27
- expect(file.read_io.class).to eq(IO)
27
+ expect(file.read_io).to be_a_kind_of(IO)
28
28
  expect(file.read_io.read).to eq("contents")
29
+ expect(file.read_io.size).to eq("contents".length)
29
30
  end
30
31
  end
31
32
 
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.62
4
+ version: 1.0.67
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-02 00:00:00.000000000 Z
11
+ date: 2020-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.7.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: concurrent-ruby
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.6
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 1.1.6
55
69
  description: The Files.com Ruby client.
56
70
  email:
57
71
  - support@files.com
@@ -173,6 +187,7 @@ files:
173
187
  - lib/files.com/models/user.rb
174
188
  - lib/files.com/models/user_cipher_use.rb
175
189
  - lib/files.com/response.rb
190
+ - lib/files.com/sizable_io.rb
176
191
  - lib/files.com/system_profiler.rb
177
192
  - lib/files.com/util.rb
178
193
  - lib/files.com/version.rb