files.com 1.0.107 → 1.0.112

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: 2f22ba094581162f8700aca2d4648dc63fb4aa516387f85f1d5eebf757d669c5
4
- data.tar.gz: 2068551573d3f8fd7cab1f27bfe3b837993c2b64e55c7e4b3e3b7c1421525812
3
+ metadata.gz: dd4923d22b6374dc1cc8a95e73996ea20b73b757a4dea9e082862ee131fe6913
4
+ data.tar.gz: eba5623bcb8dd00d3dbb3db800a6b6b28ef4ddff5301a69e8083bbc004ae2d80
5
5
  SHA512:
6
- metadata.gz: d492fe0ac79d09ed0870b231e90c7291c4b151e09ba29628f2b8906cc8cfe8384e4f0c63528aca6ee658187833331558677e5451474c06fb43d97f707b1fa4d0
7
- data.tar.gz: f5b4739a52bc9c6ddef904f074d0931013ba46d10545ca404174eee9078aa2c8c30701257f103a61033e24de614c096ae64f715c19b237e0827c1905d5b3df98
6
+ metadata.gz: 1e324b0b73af796761e30838b8866f30fc08f0461c250b7e6ab4523e82c041e88643c467ab22349d4bd986797198b6e47b4298f979c8270f209f4645f3cb762d
7
+ data.tar.gz: af7687afbb21b1aa8bf27dc6f45f9455a2717d22dec11412d065068c65e652dc7a91c1478fc42a3c30019af7aedf52a2bead169e1c59704c864bf1b23b894a52
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.107
1
+ 1.0.112
@@ -20,6 +20,7 @@
20
20
  "username": "user",
21
21
  "clickwrap_id": 1,
22
22
  "inbox_id": 1,
23
+ "has_inbox": true,
23
24
  "paths": [
24
25
 
25
26
  ]
@@ -42,6 +43,7 @@
42
43
  * `username` (string): Bundle creator username
43
44
  * `clickwrap_id` (int64): ID of the clickwrap to use with this bundle.
44
45
  * `inbox_id` (int64): ID of the associated inbox, if available.
46
+ * `has_inbox` (boolean): Does this bundle have an associated inbox?
45
47
  * `paths` (array): A list of paths in this bundle
46
48
  * `password` (string): Password for this bundle.
47
49
 
@@ -0,0 +1,39 @@
1
+ # FileUploadPart
2
+
3
+ ## Example FileUploadPart Object
4
+
5
+ ```
6
+ {
7
+ "send": "",
8
+ "action": "multipart",
9
+ "ask_about_overwrites": true,
10
+ "available_parts": 1,
11
+ "expires": "",
12
+ "headers": "",
13
+ "http_method": "PUT",
14
+ "next_partsize": 1,
15
+ "parallel_parts": true,
16
+ "parameters": "{}",
17
+ "part_number": 1,
18
+ "partsize": 1,
19
+ "path": "",
20
+ "ref": "upload-1",
21
+ "upload_uri": ""
22
+ }
23
+ ```
24
+
25
+ * `send` (object): Content-Type and File to send
26
+ * `action` (string): Type of upload
27
+ * `ask_about_overwrites` (boolean): If `true`, this file exists and you may wish to ask the user for overwrite confirmation
28
+ * `available_parts` (int64): Number of parts in the upload
29
+ * `expires` (string): Date/time of when this Upload part expires and the URL cannot be used any more
30
+ * `headers` (object): Additional upload headers to provide as part of the upload
31
+ * `http_method` (string): HTTP Method to use for uploading the part, usually `PUT`
32
+ * `next_partsize` (int64): Size in bytes for this part
33
+ * `parallel_parts` (boolean): If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order.
34
+ * `parameters` (object): Additional HTTP parameters to send with the upload
35
+ * `part_number` (int64): Number of this upload part
36
+ * `partsize` (int64): Size in bytes for the next upload part
37
+ * `path` (string): New file path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
38
+ * `ref` (string): Reference name for this upload part
39
+ * `upload_uri` (string): URI to upload this part to
@@ -34,7 +34,7 @@
34
34
  * `id` (int64): History Export ID
35
35
  * `start_at` (date-time): Start date/time of export range.
36
36
  * `end_at` (date-time): End date/time of export range.
37
- * `status` (string): Status of export. Will be: `building` or `ready`
37
+ * `status` (string): Status of export. Will be: `building`, `ready`, or `failed`
38
38
  * `query_action` (string): Filter results by this this action type. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
39
39
  * `query_interface` (string): Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`
40
40
  * `query_user_id` (string): Return results that are actions performed by the user indiciated by this User ID
@@ -13,6 +13,7 @@
13
13
  "id": 1,
14
14
  "saml_provider_cert_fingerprint": "",
15
15
  "saml_provider_issuer_url": "",
16
+ "saml_provider_metadata_content": "",
16
17
  "saml_provider_metadata_url": "",
17
18
  "saml_provider_slo_target_url": "",
18
19
  "saml_provider_sso_target_url": "",
@@ -53,6 +54,7 @@
53
54
  * `id` (int64): ID
54
55
  * `saml_provider_cert_fingerprint` (string): Identity provider sha256 cert fingerprint if saml_provider_metadata_url is not available.
55
56
  * `saml_provider_issuer_url` (string): Identity provider issuer url
57
+ * `saml_provider_metadata_content` (string): Custom identity provider metadata
56
58
  * `saml_provider_metadata_url` (string): Metadata URL for the SAML identity provider
57
59
  * `saml_provider_slo_target_url` (string): Identity provider SLO endpoint
58
60
  * `saml_provider_sso_target_url` (string): Identity provider SSO endpoint if saml_provider_metadata_url is not available.
@@ -30,6 +30,7 @@
30
30
  "last_protocol_cipher": "",
31
31
  "lockout_expires": "2000-01-01T01:00:00Z",
32
32
  "name": "John Doe",
33
+ "company": "ACME Corp.",
33
34
  "notes": "Internal notes on this user.",
34
35
  "notification_daily_send_time": 18,
35
36
  "office_integration_enabled": true,
@@ -78,6 +79,7 @@
78
79
  * `last_protocol_cipher` (string): The last protocol and cipher used
79
80
  * `lockout_expires` (date-time): Time in the future that the user will no longer be locked out if applicable
80
81
  * `name` (string): User's full name
82
+ * `company` (string): User's company
81
83
  * `notes` (string): Any internal notes on the user
82
84
  * `notification_daily_send_time` (int64): Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
83
85
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
@@ -127,13 +129,13 @@ Files::User.list(
127
129
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
128
130
  * `action` (string): Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
129
131
  * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
130
- * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `master_admin`, `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `notes`, `site_admin`, `receive_admin_alerts`, `allowed_ips`, `password_validity_days`, `ssl_required` or `not_site_admin`.
131
- * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
132
- * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
133
- * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
134
- * `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
135
- * `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
136
- * `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
132
+ * `sort_by` (object): If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `master_admin`, `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `company`, `name`, `notes`, `site_admin`, `receive_admin_alerts`, `allowed_ips`, `password_validity_days`, `ssl_required` or `not_site_admin`.
133
+ * `filter` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
134
+ * `filter_gt` (object): If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
135
+ * `filter_gteq` (object): If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
136
+ * `filter_like` (object): If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
137
+ * `filter_lt` (object): If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
138
+ * `filter_lteq` (object): If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
137
139
  * `ids` (string): comma-separated list of User IDs
138
140
  * `q[username]` (string): List users matching username.
139
141
  * `q[email]` (string): List users matching email.
@@ -182,6 +184,7 @@ Files::User.create(
182
184
  language: "en",
183
185
  notification_daily_send_time: 18,
184
186
  name: "John Doe",
187
+ company: "ACME Corp.",
185
188
  notes: "Internal notes on this user.",
186
189
  office_integration_enabled: true,
187
190
  password_validity_days: 1,
@@ -227,6 +230,7 @@ Files::User.create(
227
230
  * `language` (string): Preferred language
228
231
  * `notification_daily_send_time` (int64): Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
229
232
  * `name` (string): User's full name
233
+ * `company` (string): User's company
230
234
  * `notes` (string): Any internal notes on the user
231
235
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
232
236
  * `password_validity_days` (int64): Number of days to allow user to use the same password
@@ -308,6 +312,7 @@ Files::User.update(id,
308
312
  language: "en",
309
313
  notification_daily_send_time: 18,
310
314
  name: "John Doe",
315
+ company: "ACME Corp.",
311
316
  notes: "Internal notes on this user.",
312
317
  office_integration_enabled: true,
313
318
  password_validity_days: 1,
@@ -354,6 +359,7 @@ Files::User.update(id,
354
359
  * `language` (string): Preferred language
355
360
  * `notification_daily_send_time` (int64): Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
356
361
  * `name` (string): User's full name
362
+ * `company` (string): User's company
357
363
  * `notes` (string): Any internal notes on the user
358
364
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
359
365
  * `password_validity_days` (int64): Number of days to allow user to use the same password
@@ -456,6 +462,7 @@ user.update(
456
462
  language: "en",
457
463
  notification_daily_send_time: 18,
458
464
  name: "John Doe",
465
+ company: "ACME Corp.",
459
466
  notes: "Internal notes on this user.",
460
467
  office_integration_enabled: true,
461
468
  password_validity_days: 1,
@@ -502,6 +509,7 @@ user.update(
502
509
  * `language` (string): Preferred language
503
510
  * `notification_daily_send_time` (int64): Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
504
511
  * `name` (string): User's full name
512
+ * `company` (string): User's company
505
513
  * `notes` (string): Any internal notes on the user
506
514
  * `office_integration_enabled` (boolean): Enable integration with Office for the web?
507
515
  * `password_validity_days` (int64): Number of days to allow user to use the same password
@@ -25,6 +25,7 @@ require "files.com/response"
25
25
  require "files.com/system_profiler"
26
26
  require "files.com/util"
27
27
  require "files.com/list"
28
+ require "files.com/uri"
28
29
 
29
30
  require "files.com/models/account_line_item"
30
31
  require "files.com/models/action"
@@ -46,7 +47,7 @@ require "files.com/models/file"
46
47
  require "files.com/models/file_action"
47
48
  require "files.com/models/file_comment"
48
49
  require "files.com/models/file_comment_reaction"
49
- require "files.com/models/file_part_upload"
50
+ require "files.com/models/file_upload_part"
50
51
  require "files.com/models/folder"
51
52
  require "files.com/models/group"
52
53
  require "files.com/models/group_user"
@@ -170,7 +170,12 @@ module Files
170
170
  end
171
171
 
172
172
  private def api_url(url = "", base_url = nil)
173
- Addressable::URI.parse((base_url || Files.base_url) + "/api/rest/v1" + url).normalize!.to_s
173
+ uri = Addressable::URI.new
174
+ uri.host = Addressable::URI.parse(base_url).host
175
+ uri.path = "/api/rest/v1" + Files::URI.normalized_path(url)
176
+ uri.scheme = Addressable::URI.parse(base_url).scheme
177
+
178
+ uri.to_s
174
179
  end
175
180
 
176
181
  private def check_api_key!(api_key)
@@ -149,6 +149,15 @@ module Files
149
149
  @attributes[:inbox_id] = value
150
150
  end
151
151
 
152
+ # boolean - Does this bundle have an associated inbox?
153
+ def has_inbox
154
+ @attributes[:has_inbox]
155
+ end
156
+
157
+ def has_inbox=(value)
158
+ @attributes[:has_inbox] = value
159
+ end
160
+
152
161
  # array - A list of paths in this bundle
153
162
  def paths
154
163
  @attributes[:paths]
@@ -119,7 +119,7 @@ module Files
119
119
 
120
120
  response, options = Api.send_request("/file_actions/begin_upload/#{params[:path]}", :post, params, options)
121
121
  response.data.map do |entity_data|
122
- FilePartUpload.new(entity_data, options)
122
+ FileUploadPart.new(entity_data, options)
123
123
  end
124
124
  end
125
125
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- class FilePartUpload
4
+ class FileUploadPart
5
5
  attr_reader :options, :attributes
6
6
 
7
7
  def initialize(attributes = {}, options = {})
@@ -19,57 +19,57 @@ module Files
19
19
  @attributes[:action]
20
20
  end
21
21
 
22
- # boolean - If false, rename conflicting files instead of asking for overwrite confirmation
22
+ # boolean - If `true`, this file exists and you may wish to ask the user for overwrite confirmation
23
23
  def ask_about_overwrites
24
24
  @attributes[:ask_about_overwrites]
25
25
  end
26
26
 
27
- # int64 - Currently unused
27
+ # int64 - Number of parts in the upload
28
28
  def available_parts
29
29
  @attributes[:available_parts]
30
30
  end
31
31
 
32
- # string - Currently unused
32
+ # string - Date/time of when this Upload part expires and the URL cannot be used any more
33
33
  def expires
34
34
  @attributes[:expires]
35
35
  end
36
36
 
37
- # object - Additional upload headers
37
+ # object - Additional upload headers to provide as part of the upload
38
38
  def headers
39
39
  @attributes[:headers]
40
40
  end
41
41
 
42
- # string - Upload method, usually POST
42
+ # string - HTTP Method to use for uploading the part, usually `PUT`
43
43
  def http_method
44
44
  @attributes[:http_method]
45
45
  end
46
46
 
47
- # int64 - Currently unused
47
+ # int64 - Size in bytes for this part
48
48
  def next_partsize
49
49
  @attributes[:next_partsize]
50
50
  end
51
51
 
52
- # boolean - If true, parts may be uploaded in parallel
52
+ # boolean - If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order.
53
53
  def parallel_parts
54
54
  @attributes[:parallel_parts]
55
55
  end
56
56
 
57
- # object - Additional upload parameters
57
+ # object - Additional HTTP parameters to send with the upload
58
58
  def parameters
59
59
  @attributes[:parameters]
60
60
  end
61
61
 
62
- # int64 - Currently unused
62
+ # int64 - Number of this upload part
63
63
  def part_number
64
64
  @attributes[:part_number]
65
65
  end
66
66
 
67
- # int64 - Currently unused
67
+ # int64 - Size in bytes for the next upload part
68
68
  def partsize
69
69
  @attributes[:partsize]
70
70
  end
71
71
 
72
- # string - Upload path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
72
+ # string - New file path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
73
73
  def path
74
74
  @attributes[:path]
75
75
  end
@@ -36,7 +36,7 @@ module Files
36
36
  @attributes[:end_at] = value
37
37
  end
38
38
 
39
- # string - Status of export. Will be: `building` or `ready`
39
+ # string - Status of export. Will be: `building`, `ready`, or `failed`
40
40
  def status
41
41
  @attributes[:status]
42
42
  end
@@ -44,6 +44,11 @@ module Files
44
44
  @attributes[:saml_provider_issuer_url]
45
45
  end
46
46
 
47
+ # string - Custom identity provider metadata
48
+ def saml_provider_metadata_content
49
+ @attributes[:saml_provider_metadata_content]
50
+ end
51
+
47
52
  # string - Metadata URL for the SAML identity provider
48
53
  def saml_provider_metadata_url
49
54
  @attributes[:saml_provider_metadata_url]
@@ -221,6 +221,15 @@ module Files
221
221
  @attributes[:name] = value
222
222
  end
223
223
 
224
+ # string - User's company
225
+ def company
226
+ @attributes[:company]
227
+ end
228
+
229
+ def company=(value)
230
+ @attributes[:company] = value
231
+ end
232
+
224
233
  # string - Any internal notes on the user
225
234
  def notes
226
235
  @attributes[:notes]
@@ -550,6 +559,7 @@ module Files
550
559
  # language - string - Preferred language
551
560
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
552
561
  # name - string - User's full name
562
+ # company - string - User's company
553
563
  # notes - string - Any internal notes on the user
554
564
  # office_integration_enabled - boolean - Enable integration with Office for the web?
555
565
  # password_validity_days - int64 - Number of days to allow user to use the same password
@@ -586,6 +596,7 @@ module Files
586
596
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
587
597
  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)
588
598
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
599
+ raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
589
600
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
590
601
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
591
602
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
@@ -626,13 +637,13 @@ module Files
626
637
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
627
638
  # action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
628
639
  # cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header.
629
- # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `master_admin`, `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `notes`, `site_admin`, `receive_admin_alerts`, `allowed_ips`, `password_validity_days`, `ssl_required` or `not_site_admin`.
630
- # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
631
- # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
632
- # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
633
- # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
634
- # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
635
- # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
640
+ # sort_by - object - If set, sort records by the specified field in either 'asc' or 'desc' direction (e.g. sort_by[last_login_at]=desc). Valid fields are `active`, `master_admin`, `site_id`, `authenticate_until`, `email`, `last_desktop_login_at`, `last_login_at`, `username`, `company`, `name`, `notes`, `site_admin`, `receive_admin_alerts`, `allowed_ips`, `password_validity_days`, `ssl_required` or `not_site_admin`.
641
+ # filter - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
642
+ # filter_gt - object - If set, return records where the specifiied field is greater than the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
643
+ # filter_gteq - object - If set, return records where the specifiied field is greater than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
644
+ # filter_like - object - If set, return records where the specifiied field is equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
645
+ # filter_lt - object - If set, return records where the specifiied field is less than the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
646
+ # filter_lteq - object - If set, return records where the specifiied field is less than or equal to the supplied value. Valid fields are `username`, `email`, `company`, `notes`, `site_admin`, `allowed_ips`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until` or `not_site_admin`.
636
647
  # ids - string - comma-separated list of User IDs
637
648
  # q[username] - string - List users matching username.
638
649
  # q[email] - string - List users matching email.
@@ -708,6 +719,7 @@ module Files
708
719
  # language - string - Preferred language
709
720
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
710
721
  # name - string - User's full name
722
+ # company - string - User's company
711
723
  # notes - string - Any internal notes on the user
712
724
  # office_integration_enabled - boolean - Enable integration with Office for the web?
713
725
  # password_validity_days - int64 - Number of days to allow user to use the same password
@@ -740,6 +752,7 @@ module Files
740
752
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
741
753
  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)
742
754
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
755
+ raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
743
756
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
744
757
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
745
758
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
@@ -811,6 +824,7 @@ module Files
811
824
  # language - string - Preferred language
812
825
  # notification_daily_send_time - int64 - Hour of the day at which daily notifications should be sent. Can be in range 0 to 23
813
826
  # name - string - User's full name
827
+ # company - string - User's company
814
828
  # notes - string - Any internal notes on the user
815
829
  # office_integration_enabled - boolean - Enable integration with Office for the web?
816
830
  # password_validity_days - int64 - Number of days to allow user to use the same password
@@ -846,6 +860,7 @@ module Files
846
860
  raise InvalidParameterError.new("Bad parameter: language must be an String") if params.dig(:language) and !params.dig(:language).is_a?(String)
847
861
  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)
848
862
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String)
863
+ raise InvalidParameterError.new("Bad parameter: company must be an String") if params.dig(:company) and !params.dig(:company).is_a?(String)
849
864
  raise InvalidParameterError.new("Bad parameter: notes must be an String") if params.dig(:notes) and !params.dig(:notes).is_a?(String)
850
865
  raise InvalidParameterError.new("Bad parameter: password_validity_days must be an Integer") if params.dig(:password_validity_days) and !params.dig(:password_validity_days).is_a?(Integer)
851
866
  raise InvalidParameterError.new("Bad parameter: ssl_required must be an String") if params.dig(:ssl_required) and !params.dig(:ssl_required).is_a?(String)
@@ -0,0 +1,70 @@
1
+ module Files
2
+ module URI
3
+ # This is a copy of Addressable::URI.normalize_component without Addressable::IDNA.unicode_normalize_kc.
4
+ def self.normalize_component(component, character_class =
5
+ Addressable::URI::CharacterClasses::RESERVED + Addressable::URI::CharacterClasses::UNRESERVED,
6
+ leave_encoded = '')
7
+ return nil if component.nil?
8
+
9
+ unless component.is_a? String
10
+ begin
11
+ component = component.to_str
12
+ rescue NoMethodError, TypeError
13
+ raise TypeError, "Can't convert #{component.class} into String."
14
+ end
15
+ end
16
+
17
+ unless [ String, Regexp ].include?(character_class.class)
18
+ raise TypeError,
19
+ "Expected String or Regexp, got #{character_class.inspect}"
20
+ end
21
+ if character_class.is_a?(String)
22
+ leave_re = unless leave_encoded.empty?
23
+ character_class = "#{character_class}%" unless character_class.include?('%')
24
+
25
+ "|%(?!#{leave_encoded.chars.map do |char|
26
+ seq = SEQUENCE_ENCODING_TABLE[char]
27
+ [ seq.upcase, seq.downcase ]
28
+ end.flatten.join('|')})"
29
+ end
30
+
31
+ character_class = /[^#{character_class}]#{leave_re}/
32
+ end
33
+ # We can't perform regexps on invalid UTF sequences, but
34
+ # here we need to, so switch to ASCII.
35
+ component = component.dup
36
+ component.force_encoding(Encoding::ASCII_8BIT)
37
+ unencoded = Addressable::URI.unencode_component(component, String, leave_encoded)
38
+ begin
39
+ encoded = Addressable::URI.encode_component(
40
+ # Addressable::IDNA.unicode_normalize_kc(unencoded),
41
+ unencoded,
42
+ character_class,
43
+ leave_encoded
44
+ )
45
+ rescue ArgumentError
46
+ encoded = encode_component(unencoded)
47
+ end
48
+ encoded.force_encoding(Encoding::UTF_8)
49
+ encoded
50
+ end
51
+
52
+ def self.normalized_path(path)
53
+ if path =~ Addressable::URI::NORMPATH
54
+ # Relative paths with colons in the first segment are ambiguous.
55
+ path = path.sub(":", "%2F")
56
+ end
57
+ # String#split(delimeter, -1) uses the more strict splitting behavior
58
+ # found by default in Python.
59
+ result = path.strip.split(Addressable::URI::SLASH, -1).map do |segment|
60
+ normalize_component(
61
+ segment,
62
+ Addressable::URI::CharacterClasses::PCHAR
63
+ )
64
+ end.join(Addressable::URI::SLASH)
65
+
66
+ # All normalized values should be UTF-8
67
+ result.force_encoding(Encoding::UTF_8)
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,11 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Files::URI do
4
+ describe "normalized_path" do
5
+ it { expect(described_class.normalized_path("[[strange stuff]]#yes.text")).to eq("%5B%5Bstrange%20stuff%5D%5D%23yes.text") }
6
+ it { expect(Addressable::URI.unencode_component(described_class.normalized_path("[[strange stuff]]#yes.text"))).to eq("[[strange stuff]]#yes.text") }
7
+
8
+ it { expect(described_class.normalized_path("folder/AdÇe")).to eq("folder/AdC%CC%A7e") }
9
+ it { expect(Addressable::URI.unencode_component(described_class.normalized_path("AdÇe"))).to eq("AdÇe") }
10
+ end
11
+ 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.107
4
+ version: 1.0.112
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-08-23 00:00:00.000000000 Z
11
+ date: 2020-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -105,7 +105,7 @@ files:
105
105
  - docs/file_action.md
106
106
  - docs/file_comment.md
107
107
  - docs/file_comment_reaction.md
108
- - docs/file_part_upload.md
108
+ - docs/file_upload_part.md
109
109
  - docs/file_utils.md
110
110
  - docs/folder.md
111
111
  - docs/group.md
@@ -170,7 +170,7 @@ files:
170
170
  - lib/files.com/models/file_action.rb
171
171
  - lib/files.com/models/file_comment.rb
172
172
  - lib/files.com/models/file_comment_reaction.rb
173
- - lib/files.com/models/file_part_upload.rb
173
+ - lib/files.com/models/file_upload_part.rb
174
174
  - lib/files.com/models/file_utils.rb
175
175
  - lib/files.com/models/folder.rb
176
176
  - lib/files.com/models/group.rb
@@ -211,12 +211,14 @@ files:
211
211
  - lib/files.com/response.rb
212
212
  - lib/files.com/sizable_io.rb
213
213
  - lib/files.com/system_profiler.rb
214
+ - lib/files.com/uri.rb
214
215
  - lib/files.com/util.rb
215
216
  - lib/files.com/version.rb
216
217
  - spec/list_spec.rb
217
218
  - spec/models/file_spec.rb
218
219
  - spec/models/folder_spec.rb
219
220
  - spec/spec_helper.rb
221
+ - spec/uri_spec.rb
220
222
  - test.sh
221
223
  - test/test.rb
222
224
  homepage: https://www.files.com
@@ -1,39 +0,0 @@
1
- # FilePartUpload
2
-
3
- ## Example FilePartUpload Object
4
-
5
- ```
6
- {
7
- "send": "",
8
- "action": "upload/direct",
9
- "ask_about_overwrites": true,
10
- "available_parts": 1,
11
- "expires": "",
12
- "headers": "",
13
- "http_method": "POST",
14
- "next_partsize": 1,
15
- "parallel_parts": true,
16
- "parameters": "{}",
17
- "part_number": 1,
18
- "partsize": 1,
19
- "path": "",
20
- "ref": "upload-1",
21
- "upload_uri": ""
22
- }
23
- ```
24
-
25
- * `send` (object): Content-Type and File to send
26
- * `action` (string): Type of upload
27
- * `ask_about_overwrites` (boolean): If false, rename conflicting files instead of asking for overwrite confirmation
28
- * `available_parts` (int64): Currently unused
29
- * `expires` (string): Currently unused
30
- * `headers` (object): Additional upload headers
31
- * `http_method` (string): Upload method, usually POST
32
- * `next_partsize` (int64): Currently unused
33
- * `parallel_parts` (boolean): If true, parts may be uploaded in parallel
34
- * `parameters` (object): Additional upload parameters
35
- * `part_number` (int64): Currently unused
36
- * `partsize` (int64): Currently unused
37
- * `path` (string): Upload path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
38
- * `ref` (string): Reference name for this upload part
39
- * `upload_uri` (string): URI to upload this part to