files.com 1.1.521 → 1.1.523

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f97f841328ce55b8b6af2396e8ae1ae490f6af3728c26d0ef2619041e71db51
4
- data.tar.gz: ed28506e03a339d33fb14f6b825bf690b3d1ea29b9358712d6b3f8c30f1730a3
3
+ metadata.gz: 1a87136180440e5be8891cd2d8f2e8ad7b9c427548ec76d5524b2a2ba4ea2ac0
4
+ data.tar.gz: c47f9f7702fffd25e1b257014a78c0deac92eb658a0773e2893d378fff4a4e1b
5
5
  SHA512:
6
- metadata.gz: e8456512dc44ac96e5774883f6ec5d80ad7d220da7adc3af73d4163e79f5c258af1ca3f0f7beb7514c40acf74ffed0dc744b211af093febdaeb186ea1be80dc3
7
- data.tar.gz: a198c8dec523f1ce75f990cf1aee36169a351c4777953eb96476172315a112cd0c38f82a451271cf427557b6343fb91520b074884abbd3419b4cc6c00ef55324
6
+ metadata.gz: 9ac15cc9b59b28e94813afd262e68aaf2865a6b0c2064473eac3bdc8b0ee3cf193054832f00111d61e74bddbc8552357ff36fb830f8153e3c94d376bed3fc660
7
+ data.tar.gz: d11fb3fca8098225ac1282b8f62fbb8662a1901866c6b9b8ea761c7c3f54a5bad0abed7f60abd7d3ca9c346e7c8a2ad6b230e9ca1b023c1d03b7253b5a3a28f4
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.521
1
+ 1.1.523
data/docs/bundle.md CHANGED
@@ -154,7 +154,7 @@ Files::Bundle.list(
154
154
  * `cursor` (string): Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
155
155
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
156
156
  * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
157
- * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
157
+ * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
158
158
  * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
159
159
  * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
160
160
  * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
data/docs/file.md CHANGED
@@ -212,6 +212,19 @@ Files::File.find(path,
212
212
  * `with_priority_color` (boolean): Include file priority color information?
213
213
 
214
214
 
215
+ ---
216
+
217
+ ## List the contents of a ZIP file
218
+
219
+ ```
220
+ Files::File.zip_list_contents(path)
221
+ ```
222
+
223
+ ### Parameters
224
+
225
+ * `path` (string): Required - Path to operate on.
226
+
227
+
215
228
  ---
216
229
 
217
230
  ## Copy File/Folder
@@ -250,6 +263,44 @@ Files::File.move(path,
250
263
  * `overwrite` (boolean): Overwrite existing file(s) in the destination?
251
264
 
252
265
 
266
+ ---
267
+
268
+ ## Extract a ZIP file to a destination folder
269
+
270
+ ```
271
+ Files::File.unzip(path,
272
+ destination: "destination",
273
+ overwrite: false
274
+ )
275
+ ```
276
+
277
+ ### Parameters
278
+
279
+ * `path` (string): Required - ZIP file path to extract.
280
+ * `destination` (string): Required - Destination folder path for extracted files.
281
+ * `filename` (string): Optional single entry filename to extract.
282
+ * `overwrite` (boolean): Overwrite existing files in the destination?
283
+
284
+
285
+ ---
286
+
287
+ ## Create a ZIP from one or more paths and save it to a destination path
288
+
289
+ ```
290
+ Files::File.zip(
291
+ paths: "paths",
292
+ destination: "destination",
293
+ overwrite: false
294
+ )
295
+ ```
296
+
297
+ ### Parameters
298
+
299
+ * `paths` (array(string)): Required - Paths to include in the ZIP.
300
+ * `destination` (string): Required - Destination file path for the ZIP.
301
+ * `overwrite` (boolean): Overwrite existing file in the destination?
302
+
303
+
253
304
  ---
254
305
 
255
306
  ## Begin File Upload
@@ -340,6 +391,21 @@ file.delete(
340
391
  * `recursive` (boolean): If true, will recursively delete folders. Otherwise, will error on non-empty folders.
341
392
 
342
393
 
394
+ ---
395
+
396
+ ## List the contents of a ZIP file
397
+
398
+ ```
399
+ file = Files::File.find(path)
400
+
401
+ file.zip_list_contents
402
+ ```
403
+
404
+ ### Parameters
405
+
406
+ * `path` (string): Required - Path to operate on.
407
+
408
+
343
409
  ---
344
410
 
345
411
  ## Copy File/Folder
@@ -382,6 +448,27 @@ file.move(
382
448
  * `overwrite` (boolean): Overwrite existing file(s) in the destination?
383
449
 
384
450
 
451
+ ---
452
+
453
+ ## Extract a ZIP file to a destination folder
454
+
455
+ ```
456
+ file = Files::File.find(path)
457
+
458
+ file.unzip(
459
+ destination: "destination",
460
+ overwrite: false
461
+ )
462
+ ```
463
+
464
+ ### Parameters
465
+
466
+ * `path` (string): Required - ZIP file path to extract.
467
+ * `destination` (string): Required - Destination folder path for extracted files.
468
+ * `filename` (string): Optional single entry filename to extract.
469
+ * `overwrite` (boolean): Overwrite existing files in the destination?
470
+
471
+
385
472
  ---
386
473
 
387
474
  ## Begin File Upload
@@ -0,0 +1,13 @@
1
+ # ZipListEntry
2
+
3
+ ## Example ZipListEntry Object
4
+
5
+ ```
6
+ {
7
+ "path": "example",
8
+ "size": 1
9
+ }
10
+ ```
11
+
12
+ * `path` (string): Entry path inside the ZIP. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
13
+ * `size` (int64): Uncompressed size in bytes.
@@ -531,7 +531,7 @@ module Files
531
531
  # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
532
532
  # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
533
533
  # sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
534
- # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
534
+ # filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
535
535
  # filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
536
536
  # filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
537
537
  # filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
@@ -1019,6 +1019,17 @@ module Files
1019
1019
  nil
1020
1020
  end
1021
1021
 
1022
+ # List the contents of a ZIP file
1023
+ def zip_list_contents(params = {})
1024
+ params ||= {}
1025
+ params[:path] = @attributes[:path]
1026
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
1027
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1028
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1029
+
1030
+ Api.send_request("/file_actions/zip_list/#{@attributes[:path]}", :get, params, @options)
1031
+ end
1032
+
1022
1033
  # Copy File/Folder
1023
1034
  #
1024
1035
  # Parameters:
@@ -1054,6 +1065,25 @@ module Files
1054
1065
  Api.send_request("/file_actions/move/#{@attributes[:path]}", :post, params, @options)
1055
1066
  end
1056
1067
 
1068
+ # Extract a ZIP file to a destination folder
1069
+ #
1070
+ # Parameters:
1071
+ # destination (required) - string - Destination folder path for extracted files.
1072
+ # filename - string - Optional single entry filename to extract.
1073
+ # overwrite - boolean - Overwrite existing files in the destination?
1074
+ def unzip(params = {})
1075
+ params ||= {}
1076
+ params[:path] = @attributes[:path]
1077
+ raise MissingParameterError.new("Current object doesn't have a path") unless @attributes[:path]
1078
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1079
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
1080
+ raise InvalidParameterError.new("Bad parameter: filename must be an String") if params[:filename] and !params[:filename].is_a?(String)
1081
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1082
+ raise MissingParameterError.new("Parameter missing: destination") unless params[:destination]
1083
+
1084
+ Api.send_request("/file_actions/unzip", :post, params, @options)
1085
+ end
1086
+
1057
1087
  # Begin File Upload
1058
1088
  #
1059
1089
  # Parameters:
@@ -1193,6 +1223,19 @@ module Files
1193
1223
  find(path, params, options)
1194
1224
  end
1195
1225
 
1226
+ # List the contents of a ZIP file
1227
+ def self.zip_list_contents(path, params = {}, options = {})
1228
+ params ||= {}
1229
+ params[:path] = path
1230
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1231
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1232
+
1233
+ response, options = Api.send_request("/file_actions/zip_list/#{params[:path]}", :get, params, options)
1234
+ response.data.map do |entity_data|
1235
+ ZipListEntry.new(entity_data, options)
1236
+ end
1237
+ end
1238
+
1196
1239
  # Copy File/Folder
1197
1240
  #
1198
1241
  # Parameters:
@@ -1228,6 +1271,39 @@ module Files
1228
1271
  FileAction.new(response.data, options)
1229
1272
  end
1230
1273
 
1274
+ # Extract a ZIP file to a destination folder
1275
+ #
1276
+ # Parameters:
1277
+ # destination (required) - string - Destination folder path for extracted files.
1278
+ # filename - string - Optional single entry filename to extract.
1279
+ # overwrite - boolean - Overwrite existing files in the destination?
1280
+ def self.unzip(path, params = {}, options = {})
1281
+ params ||= {}
1282
+ params[:path] = path
1283
+ raise InvalidParameterError.new("Bad parameter: path must be an String") if params[:path] and !params[:path].is_a?(String)
1284
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
1285
+ raise InvalidParameterError.new("Bad parameter: filename must be an String") if params[:filename] and !params[:filename].is_a?(String)
1286
+ raise MissingParameterError.new("Parameter missing: path") unless params[:path]
1287
+ raise MissingParameterError.new("Parameter missing: destination") unless params[:destination]
1288
+
1289
+ response, options = Api.send_request("/file_actions/unzip", :post, params, options)
1290
+ FileAction.new(response.data, options)
1291
+ end
1292
+
1293
+ # Parameters:
1294
+ # paths (required) - array(string) - Paths to include in the ZIP.
1295
+ # destination (required) - string - Destination file path for the ZIP.
1296
+ # overwrite - boolean - Overwrite existing file in the destination?
1297
+ def self.zip(params = {}, options = {})
1298
+ raise InvalidParameterError.new("Bad parameter: paths must be an Array") if params[:paths] and !params[:paths].is_a?(Array)
1299
+ raise InvalidParameterError.new("Bad parameter: destination must be an String") if params[:destination] and !params[:destination].is_a?(String)
1300
+ raise MissingParameterError.new("Parameter missing: paths") unless params[:paths]
1301
+ raise MissingParameterError.new("Parameter missing: destination") unless params[:destination]
1302
+
1303
+ response, options = Api.send_request("/file_actions/zip", :post, params, options)
1304
+ FileAction.new(response.data, options)
1305
+ end
1306
+
1231
1307
  # Begin File Upload
1232
1308
  #
1233
1309
  # Parameters:
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Files
4
+ class ZipListEntry
5
+ attr_reader :options, :attributes
6
+
7
+ def initialize(attributes = {}, options = {})
8
+ @attributes = attributes || {}
9
+ @options = options || {}
10
+ end
11
+
12
+ # string - Entry path inside the ZIP. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
13
+ def path
14
+ @attributes[:path]
15
+ end
16
+
17
+ # int64 - Uncompressed size in bytes.
18
+ def size
19
+ @attributes[:size]
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.521"
4
+ VERSION = "1.1.523"
5
5
  end
data/lib/files.com.rb CHANGED
@@ -145,6 +145,7 @@ require "files.com/models/user_sftp_client_use"
145
145
  require "files.com/models/web_dav_action_log"
146
146
  require "files.com/models/webhook_test"
147
147
  require "files.com/models/workspace"
148
+ require "files.com/models/zip_list_entry"
148
149
 
149
150
  require "files.com/models/dir"
150
151
  require "files.com/models/file_utils"
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.1.521
4
+ version: 1.1.523
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-23 00:00:00.000000000 Z
11
+ date: 2026-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -270,6 +270,7 @@ files:
270
270
  - docs/web_dav_action_log.md
271
271
  - docs/webhook_test.md
272
272
  - docs/workspace.md
273
+ - docs/zip_list_entry.md
273
274
  - files.com.gemspec
274
275
  - lib/files.com.rb
275
276
  - lib/files.com/api.rb
@@ -391,6 +392,7 @@ files:
391
392
  - lib/files.com/models/web_dav_action_log.rb
392
393
  - lib/files.com/models/webhook_test.rb
393
394
  - lib/files.com/models/workspace.rb
395
+ - lib/files.com/models/zip_list_entry.rb
394
396
  - lib/files.com/path_util.rb
395
397
  - lib/files.com/response.rb
396
398
  - lib/files.com/sizable_io.rb