files.com 1.1.757 → 1.1.759

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: ebfcb0a65a636d80b045dec828bd4febd6691b14f5b6499b2429093b577ce61a
4
- data.tar.gz: 8741f0fe95e2590c5c817dbcd1f4b5f2218608d5caa09e95c61a36b9489ec6c4
3
+ metadata.gz: 844199f222c0d7a81f7a17742192f06608db347a37872ff38e1cb6d07998c1ee
4
+ data.tar.gz: b84c2d7340036beafea02c69321fe1b718ff7370f847dff54af10d587572b276
5
5
  SHA512:
6
- metadata.gz: ee616f53de17251896dd450716b6fbdc000e70cb29e7f66be2b68ea48239cb14f2a81e5e300cba022f632eafe23e99bbec9931fe1b47a8e0dce55da77f9f807e
7
- data.tar.gz: 31bb8f5f62b4db746062ab14b9f867d66a2b63ed272f73411c4461669bccca8b26c5f48bb990d047d3cf05c1e6f041f99129f5503bcedc3059094a41785748a2
6
+ metadata.gz: 773fa097b3fdbf512cbb946d82a367bf220606f3743b68c00cab6af1f2ed5ae011fa678d3d963a46384a301e86f605c2bdf9934488d37d0719c06a77236de6e0
7
+ data.tar.gz: ff3a484319e8e215f48ab3241f09d3dd9e548858f3e04441b3cff3f998e4233fa3971c07fd7241c3950d83f819648e6d85f1ff5a493c29a165d81ad2c6a51162
data/README.md CHANGED
@@ -684,6 +684,7 @@ Files::FolderAdminPermissionRequiredError -> Files::NotAuthorizedError -> Files:
684
684
  |`TooManySharesError`| `RateLimitedError` |
685
685
  |`AutomationsUnavailableError`| `ServiceUnavailableError` |
686
686
  |`MigrationInProgressError`| `ServiceUnavailableError` |
687
+ |`SearchUnavailableError`| `ServiceUnavailableError` |
687
688
  |`SiteDisabledError`| `ServiceUnavailableError` |
688
689
  |`UploadsUnavailableError`| `ServiceUnavailableError` |
689
690
  |`AccountAlreadyExistsError`| `SiteConfigurationError` |
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.757
1
+ 1.1.759
data/docs/folder.md CHANGED
@@ -125,7 +125,7 @@ Files::Folder.list_for(path,
125
125
  * `path` (string): Required - Path to operate on.
126
126
  * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
127
127
  * `sort_by` (object): Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
128
- * `search` (string): If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
128
+ * `search` (string): If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process. During scheduled search maintenance, indexed searches return HTTP 422 with error type `service-unavailable/search-unavailable`; retry after maintenance ends. Folder listing without `search` remains available.
129
129
  * `search_custom_metadata_key` (string): If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
130
130
  * `search_all` (boolean): Search entire site? If true, we will search the entire site. Do not provide a path when using this parameter. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
131
131
  * `with_previews` (boolean): Include file previews?
@@ -111,7 +111,7 @@
111
111
  * `s3_assume_role_duration_seconds` (int64): Session duration in seconds for AssumeRole authentication (900-43200).
112
112
  * `s3_assume_role_external_id` (string): External ID for AssumeRole authentication.
113
113
  * `server_certificate` (string): Remote server certificate
114
- * `server_host_key` (string): Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
114
+ * `server_host_key` (string): Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
115
115
  * `server_type` (string): Remote server type.
116
116
  * `workspace_id` (int64): Workspace ID (0 for default workspace)
117
117
  * `ssl` (string): Should we require SSL?
@@ -401,7 +401,7 @@ Files::RemoteServer.create(
401
401
  * `s3_compatible_virtual_hosted_style` (boolean): S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
402
402
  * `s3_region` (string): S3 region
403
403
  * `server_certificate` (string): Remote server certificate
404
- * `server_host_key` (string): Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
404
+ * `server_host_key` (string): Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
405
405
  * `server_type` (string): Remote server type.
406
406
  * `sharepoint_client_id` (string): SharePoint: Microsoft Entra application client ID for app-only authentication.
407
407
  * `sharepoint_site_url` (string): SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -574,7 +574,7 @@ Files::RemoteServer.update(id,
574
574
  * `s3_compatible_virtual_hosted_style` (boolean): S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
575
575
  * `s3_region` (string): S3 region
576
576
  * `server_certificate` (string): Remote server certificate
577
- * `server_host_key` (string): Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
577
+ * `server_host_key` (string): Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
578
578
  * `server_type` (string): Remote server type.
579
579
  * `sharepoint_client_id` (string): SharePoint: Microsoft Entra application client ID for app-only authentication.
580
580
  * `sharepoint_site_url` (string): SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -778,7 +778,7 @@ remote_server.update(
778
778
  * `s3_compatible_virtual_hosted_style` (boolean): S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
779
779
  * `s3_region` (string): S3 region
780
780
  * `server_certificate` (string): Remote server certificate
781
- * `server_host_key` (string): Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
781
+ * `server_host_key` (string): Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
782
782
  * `server_type` (string): Remote server type.
783
783
  * `sharepoint_client_id` (string): SharePoint: Microsoft Entra application client ID for app-only authentication.
784
784
  * `sharepoint_site_url` (string): SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -257,6 +257,7 @@ module Files
257
257
  class ServiceUnavailableError < APIError; end
258
258
  class AutomationsUnavailableError < ServiceUnavailableError; end
259
259
  class MigrationInProgressError < ServiceUnavailableError; end
260
+ class SearchUnavailableError < ServiceUnavailableError; end
260
261
  class SiteDisabledError < ServiceUnavailableError; end
261
262
  class UploadsUnavailableError < ServiceUnavailableError; end
262
263
 
@@ -34,10 +34,19 @@ module Files
34
34
  end
35
35
 
36
36
  def self.download_file(path, local_path = nil)
37
- local_path ||= File.basename(path)
37
+ local_path ||= default_local_path(path)
38
38
  new(path).download_file(local_path)
39
39
  end
40
40
 
41
+ private_class_method def self.default_local_path(path)
42
+ name = PathUtil.normalize(path).split("/").last.to_s
43
+ # On Windows a colon makes the name a drive-relative path or an NTFS
44
+ # stream, which can write outside the working directory or onto another file.
45
+ raise InvalidParameterError.new("Bad parameter: local_path is required because #{name.inspect} is not a valid local file name") if Gem.win_platform? && name.include?(":")
46
+
47
+ name
48
+ end
49
+
41
50
  private_class_method def self.underscore_destination_path(root, id, relative_path = nil)
42
51
  PathUtil.normalize("_", root, id.to_s, relative_path)
43
52
  end
@@ -491,7 +491,7 @@ module Files
491
491
  # path (required) - string - Path to operate on.
492
492
  # preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
493
493
  # sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
494
- # search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
494
+ # search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process. During scheduled search maintenance, indexed searches return HTTP 422 with error type `service-unavailable/search-unavailable`; retry after maintenance ends. Folder listing without `search` remains available.
495
495
  # search_custom_metadata_key - string - If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
496
496
  # search_all - boolean - Search entire site? If true, we will search the entire site. Do not provide a path when using this parameter. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
497
497
  # with_previews - boolean - Include file previews?
@@ -207,7 +207,7 @@ module Files
207
207
  @attributes[:server_certificate] = value
208
208
  end
209
209
 
210
- # string - Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
210
+ # string - Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
211
211
  def server_host_key
212
212
  @attributes[:server_host_key]
213
213
  end
@@ -1023,7 +1023,7 @@ module Files
1023
1023
  # s3_compatible_virtual_hosted_style - boolean - S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
1024
1024
  # s3_region - string - S3 region
1025
1025
  # server_certificate - string - Remote server certificate
1026
- # server_host_key - string - Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
1026
+ # server_host_key - string - Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
1027
1027
  # server_type - string - Remote server type.
1028
1028
  # sharepoint_client_id - string - SharePoint: Microsoft Entra application client ID for app-only authentication.
1029
1029
  # sharepoint_site_url - string - SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -1283,7 +1283,7 @@ module Files
1283
1283
  # s3_compatible_virtual_hosted_style - boolean - S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
1284
1284
  # s3_region - string - S3 region
1285
1285
  # server_certificate - string - Remote server certificate
1286
- # server_host_key - string - Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
1286
+ # server_host_key - string - Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
1287
1287
  # server_type - string - Remote server type.
1288
1288
  # sharepoint_client_id - string - SharePoint: Microsoft Entra application client ID for app-only authentication.
1289
1289
  # sharepoint_site_url - string - SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -1463,7 +1463,7 @@ module Files
1463
1463
  # s3_compatible_virtual_hosted_style - boolean - S3-compatible: If true, use virtual-hosted-style URLs instead of path-style URLs
1464
1464
  # s3_region - string - S3 region
1465
1465
  # server_certificate - string - Remote server certificate
1466
- # server_host_key - string - Pinned plain SSH host key for SFTP, in OpenSSH public key format. If omitted, Files.com detects and stores the server's plain host key, including when the server offers an OpenSSH host certificate. With `server_certificate=require_match` (the default), the server must present the pinned key and prove it holds the matching private key. The pin remains in force until an administrator updates `server_host_key`. Files.com does not authenticate remote hosts through SSH certificates and does not check their CA signatures, principals, or validity periods. Certificate expiration does not end the pin; update `server_host_key` to retire a host key.
1466
+ # server_host_key - string - Pinned SSH host key or OpenSSH host certificate for SFTP. If omitted, Files.com detects and stores a host key, preferring plain keys over certificates. With `server_certificate=require_match` (the default), the server must present the exact pinned key or certificate and prove it holds the matching private key. A pinned certificate is compared in full, so renewal can require updating `server_host_key` even when its underlying key is unchanged. Files.com does not check certificate CA signatures, principals, or validity periods. Certificate expiration alone does not end the pin. Update `server_host_key` to replace the pin.
1467
1467
  # server_type - string - Remote server type.
1468
1468
  # sharepoint_client_id - string - SharePoint: Microsoft Entra application client ID for app-only authentication.
1469
1469
  # sharepoint_site_url - string - SharePoint: Site URL to scope app-only authentication to a single site. Leave blank to browse all sites.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.757"
4
+ VERSION = "1.1.759"
5
5
  end
@@ -0,0 +1,22 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Files::File do
4
+ describe ".download_file without a local path" do
5
+ it "downloads to the remote file name" do
6
+ allow(Gem).to receive(:win_platform?).and_return(false)
7
+ file = described_class.new("folder/report:2026.txt")
8
+ allow(described_class).to receive(:new).with("folder/report:2026.txt").and_return(file)
9
+ expect(file).to receive(:download_file).with("report:2026.txt")
10
+
11
+ described_class.download_file("folder/report:2026.txt")
12
+ end
13
+
14
+ it "refuses a drive or stream name on Windows" do
15
+ allow(Gem).to receive(:win_platform?).and_return(true)
16
+
17
+ [ "folder/C:victim.txt", "C:victim.txt", "folder/victim.txt::$DATA" ].each do |remote_path|
18
+ expect { described_class.download_file(remote_path) }.to raise_error(Files::InvalidParameterError)
19
+ end
20
+ end
21
+ end
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: files.com
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.757
4
+ version: 1.1.759
5
5
  platform: ruby
6
6
  authors:
7
7
  - files.com
@@ -487,6 +487,7 @@ files:
487
487
  - spec/language_spec.rb
488
488
  - spec/lib/api_client_spec.rb
489
489
  - spec/list_spec.rb
490
+ - spec/models/file_download_default_path_spec.rb
490
491
  - spec/models/file_spec.rb
491
492
  - spec/models/file_underscore_destinations_spec.rb
492
493
  - spec/models/folder_spec.rb