files.com 1.1.743 → 1.1.744

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: a422fb27c774606b951cf47d99d36f6480eab1489536c421ec5f9a805a1b477a
4
- data.tar.gz: 32674edcd54f7a5a70e59a50a29cb500029b0400d29af20285ab6dbefd7bd1ba
3
+ metadata.gz: b8af62f099ab3fe1820b5ff20e5dc202bee1a742c42505961cd9d00c7c894d66
4
+ data.tar.gz: 337cc2a388ec0cc310a9fe9473906ce64eeaa20bd8a17ea74b9c2dc1a43f6ef8
5
5
  SHA512:
6
- metadata.gz: babbaee413ae863433f3f7276342383112da748360da76f7e2bc3c0883aaa82cba1e3987178ee224b5a27f38b32410bc5b0780980c3ab719c97cdfe1435a9fd2
7
- data.tar.gz: '08c007519882b709a66584483fec546a5fb9533fae557d91b180c64f608dc72a9223dc8ad8111f6defccde00959109ce439f09d1f937b9a3d3c77fb6bde0594c'
6
+ metadata.gz: c30b00f9b88d92ea33ba15f91cf370478862dce94240b2118027294efeb76a24885a0f100cfb7ee6771e51ff3c84d0bb2f20edd688bb7972ba72178db7e8ffda
7
+ data.tar.gz: 8a559215377d6c771e06610d57ac45e29d30ee1a0a7c51945a77ee620e650a450892964060de75d255cdf21610969116e5adaa9df35a5983507d9c48598db27d
data/README.md CHANGED
@@ -346,16 +346,16 @@ end
346
346
 
347
347
  ## Paths
348
348
 
349
- Working with paths in Files.com involves several important considerations. Understanding how path comparisons are applied helps developers ensure consistency and accuracy across all interactions with the platform.
349
+ Files.com preserves the spelling of file and folder paths while comparing them using shared case and Unicode rules. Use the SDK comparison helpers when matching paths locally.
350
350
  <div></div>
351
351
 
352
352
  ### Capitalization
353
353
 
354
- Files.com compares paths in a **case-insensitive** manner. This means path segments are treated as equivalent regardless of letter casing.
354
+ Files.com uses case-insensitive path matching based on its fixed Unicode comparison map.
355
355
 
356
- For example, all of the following resolve to the same internal path:
356
+ For example, the following paths have the same comparison key:
357
357
 
358
- | Path Variant | Interpreted As |
358
+ | Path Variant | Comparison Key |
359
359
  |---------------------------------------|------------------------------|
360
360
  | `Documents/Reports/Q1.pdf` | `documents/reports/q1.pdf` |
361
361
  | `documents/reports/q1.PDF` | `documents/reports/q1.pdf` |
@@ -370,32 +370,27 @@ See also: [Case Sensitivity Documentation](https://www.files.com/docs/files-and-
370
370
 
371
371
  ### Slashes
372
372
 
373
- All path parameters in Files.com (API, SDKs, CLI, automations, integrations) must **omit leading and trailing slashes**. Paths are always treated as **absolute and slash-delimited**, so only internal `/` separators are used and never at the start or end of the string.
373
+ Use `/` between folder and file names, without leading or trailing slashes. SDK normalization helpers convert backslashes to `/`, remove duplicate separators, and discard exact `.` and `..` components. Discarding `..` leaves the preceding folder name intact.
374
374
 
375
- #### Path Slash Examples
376
- | Path | Valid? | Notes |
377
- |-----------------------------------|--------|-------------------------------|
378
- | `folder/subfolder/file.txt` | ✅ | Correct, internal separators only |
379
- | `/folder/subfolder/file.txt` | ❌ | Leading slash not allowed |
380
- | `folder/subfolder/file.txt/` | ❌ | Trailing slash not allowed |
381
- | `//folder//file.txt` | ❌ | Duplicate separators not allowed |
375
+ | Input | Normalized path |
376
+ |-------|-----------------|
377
+ | `folder/subfolder/file.txt` | `folder/subfolder/file.txt` |
378
+ | `/folder/subfolder/file.txt` | `folder/subfolder/file.txt` |
379
+ | `folder/subfolder/file.txt/` | `folder/subfolder/file.txt` |
380
+ | `//folder//file.txt` | `folder/file.txt` |
381
+ | `folder/../file.txt` | `folder/file.txt` |
382
382
 
383
383
  <div></div>
384
384
 
385
- ### Unicode Normalization
385
+ ### Unicode and Path Comparison
386
386
 
387
- Files.com normalizes all paths using [Unicode NFC (Normalization Form C)](https://www.unicode.org/reports/tr15/#Norm_Forms) before comparison. This ensures consistency across different representations of the same characters.
387
+ Files.com compares paths using a fixed mapping shared by the server and SDKs. It treats case and many accent differences as equivalent: `Résumé.txt` and `resume.txt` identify the same file, as do `q` followed by a combining acute accent and `q`. The mapping also handles other equivalences, such as Hiragana and Katakana. Lowercasing or applying a standard Unicode normalization form alone does not reproduce these rules.
388
388
 
389
- For example, the following two paths are treated as equivalent after NFC normalization:
389
+ SDK comparison helpers normalize path separators and dot segments, then apply the bundled [versioned comparison map](https://github.com/Files-com/files-sdk-javascript/blob/master/shared/path_comparison.json). The [shared examples](https://github.com/Files-com/files-sdk-javascript/blob/master/shared/comparison_examples.json) give exact comparison results for integrations that implement their own matching. The map uses hexadecimal Unicode scalar values as keys: a missing entry preserves the character, an empty replacement removes it, and other replacements may contain several characters. Apply each replacement once without normalizing or lowercasing the result again.
390
390
 
391
- | Input | Normalized Form |
392
- |----------------------------------------|------------------------|
393
- | `uploads/\u0065\u0301.txt` | `uploads/é.txt` |
394
- | `docs/Café/Report.txt` | `docs/Café/Report.txt` |
391
+ Use comparison results only for matching. Send the original path spelling in API requests and preserve it for display and local filenames; comparison results can have a different spelling or length.
395
392
 
396
- - All input must be UTF‑8 encoded.
397
- - Precomposed and decomposed characters are unified.
398
- - This affects search, deduplication, and comparisons across SDKs.
393
+ Trailing whitespace is significant for comparison. `report.txt` and `report.txt ` are different file paths, and SDK helpers preserve spaces, tabs, and newlines. Folder names cannot end in whitespace. See [Unicode Normalization](https://www.files.com/docs/files-and-folders/file-system-semantics/unicode-normalization) for the complete path rules.
399
394
 
400
395
  <div></div>
401
396
 
data/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.743
1
+ 1.1.744
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "json"
4
+
3
5
  module Files
4
6
  module PathUtil
5
- TRANSLIT_MAP = "ÀA,ÁA,ÂA,ÃA,ÄA,ÅA,ÆAE,ÇC,ÈE,ÉE,ÊE,ËE,ÌI,ÍI,ÎI,ÏI,ÐD,ÑN,ÒO,ÓO,ÔO,ÕO,ÖO,ØO,ÙU,ÚU,ÛU,ÜU,ÝY,ßss,àa,áa,âa,ãa,äa,åa,æae,çc,èe,ée,êe,ëe,ìi,íi,îi,ïi,ðd,ñn,òo,óo,ôo,õo,öo,øo,ùu,úu,ûu,üu,ýy,ÿy,ĀA,āa,ĂA,ăa,ĄA,ąa,ĆC,ćc,ĈC,ĉc,ĊC,ċc,ČC,čc,ĎD,ďd,ĐD,đd,ĒE,ēe,ĔE,ĕe,ĖE,ėe,ĘE,ęe,ĚE,ěe,ĜG,ĝg,ĞG,ğg,ĠG,ġg,ĢG,ģg,ĤH,ĥh,ĦH,ħh,ĨI,ĩi,ĪI,īi,ĬI,ĭi,ĮI,įi,İI,IJIJ,ijij,ĴJ,ĵj,ĶK,ķk,ĹL,ĺl,ĻL,ļl,ĽL,ľl,ŁL,łl,ŃN,ńn,ŅN,ņn,ŇN,ňn,ʼn'n,ŌO,ōo,ŎO,ŏo,ŐO,őo,ŒOE,œoe,ŔR,ŕr,ŖR,ŗr,ŘR,řr,ŚS,śs,ŜS,ŝs,ŞS,şs,ŠS,šs,ŢT,ţt,ŤT,ťt,ŨU,ũu,ŪU,ūu,ŬU,ŭu,ŮU,ůu,ŰU,űu,ŲU,ųu,ŴW,ŵw,ŶY,ŷy,ŸY,ŹZ,źz,ŻZ,żz,ŽZ,žz".split(",").to_h { |val| [ val[0], val[1..2] ] }.freeze
7
+ COMPARISON_MAP = JSON.parse(File.read(File.expand_path("../../shared/path_comparison.json", __dir__))).fetch("mapping").to_h { |hex, value| [ hex.to_i(16).chr(Encoding::UTF_8), value.freeze ] }.freeze
6
8
 
7
9
  def self.normalize_for_comparison(*args)
8
- unicode_normalize_and_transliterate(normalize(*args).to_s).downcase.rstrip
10
+ normalize(*args).gsub(/[^ -@\[-~]/) { |character| COMPARISON_MAP.fetch(character, character) }
9
11
  end
10
12
 
11
13
  def self.same?(a, b)
@@ -39,14 +41,5 @@ module Files
39
41
  new_string.force_encoding("ISO-8859-1").encode("UTF-8")
40
42
  end
41
43
  end
42
-
43
- private_class_method def self.unicode_normalize_and_transliterate(string)
44
- # convert multi-code-point characters into single-code-point characters
45
- normalized_string = string.unicode_normalize(:nfkc)
46
-
47
- normalized_string.gsub(/[^\x00-\x7f]/u) do |char|
48
- TRANSLIT_MAP[char] || char
49
- end
50
- end
51
44
  end
52
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Files
4
- VERSION = "1.1.743"
4
+ VERSION = "1.1.744"
5
5
  end
@@ -0,0 +1,20 @@
1
+ [
2
+ ["Résumé.TXT", "resume.txt"],
3
+ ["q́/ậ.txt", "q/a.txt"],
4
+ ["ς/Σ/ά", "σ/σ/α"],
5
+ ["か/カ/ガ", "か/か/か"],
6
+ ["private\u00ad\u200d\ufe0f/file", "private/file"],
7
+ ["\u0307", ""],
8
+ ["a\u0001b", "ab"],
9
+ ["folder \t", "folder \t"],
10
+ ["Ა/ა", "Ა/ა"],
11
+ ["\u09cb/\u09c7\u09be", "\u09cb/\u09c7\u09be"],
12
+ ["ка/का/क", "ка/का/क"],
13
+ ["й/и", "й/и"],
14
+ ["日本語", "日本語"],
15
+ ["가/가", "가/가"],
16
+ ["A/B/℀/…", "a/b/a/c/..."],
17
+ ["𐐀/𐐨", "𐐨/𐐨"],
18
+ ["𠀀/𠀁", "𠀀/𠀁"],
19
+ ["ﷺ", "صلى الله"]
20
+ ]
@@ -8,15 +8,15 @@
8
8
  [ "A\\B\\C.TXT", "a/b/c.txt" ],
9
9
  [ "A/B\\C.TXT", "a/b/c.txt" ],
10
10
  [ "//a/b//c.txt", "a/b/c.txt" ],
11
- [ "a/b/c.txt ", "a/b/c.txt" ],
12
- [ "a/b/c.txt\t", "a/b/c.txt" ],
13
- [ "a/b/c.txt\n", "a/b/c.txt" ],
14
- [ "a/b/c.txt\r", "a/b/c.txt" ],
11
+ [ "a/b/c.txt ", "a/b/c.txt "],
12
+ [ "a/b/c.txt\t", "a/b/c.txt\t"],
13
+ [ "a/b/c.txt\n", "a/b/c.txt\n"],
14
+ [ "a/b/c.txt\r", "a/b/c.txt\r"],
15
15
  [ " space_at_beginning", " space_at_beginning"],
16
- [ "space_at_end ", "space_at_end"],
16
+ [ "space_at_end ", "space_at_end "],
17
17
  [ "tab\tseparated", "tab\tseparated"],
18
18
  [ "<title>hello</hello>", "<title>hello</hello>"],
19
- [ "안녕하세요", "안녕하세요" ],
19
+ [ "안녕하세요", "안녕하세요"],
20
20
  [ "こんにちは", "こんにちは" ],
21
21
  [ "今日は", "今日は" ],
22
22
  [ "longest_unicode_character_﷽", "longest_unicode_character_﷽"],
@@ -27,16 +27,16 @@
27
27
  [ "/../../remote\\path//./to/file.txt", "remote/path/to/file.txt" ],
28
28
  [ "one_code_point_ą", "one_code_point_a" ],
29
29
  [ "two_code_points_ą", "two_code_points_a" ],
30
- [ "one_code_point_훯", "one_code_point_훯"],
31
- [ "three_code_points_훯", "three_code_points_훯" ],
30
+ [ "one_code_point_훯", "one_code_point_훯"],
31
+ [ "three_code_points_훯", "three_code_points_훯"],
32
32
  [ "ÞþŊŋŦŧ", "þþŋŋŧŧ" ],
33
33
  [ "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "aaaaaaaeceeeeiiiidnoooooouuuuyssaaaaaaaeceeeeiiiidnoooooouuuuyy" ],
34
34
  [ "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİIJij", "aaaaaaccccccccddddeeeeeeeeeegggggggghhhhiiiiiiiiiijij" ],
35
35
  [ "ĴĵĶķĹĺĻļĽľŁłŃńŅņŇňʼnŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤť", "jjkkllllllllnnnnnnʼnoooooooeoerrrrrrsssssssstttt" ],
36
36
  [ "ŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž", "uuuuuuuuuuuuwwyyyzzzzzz" ],
37
- [ "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗", "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗" ],
38
- [ "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️", "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️" ],
39
- [ "emoji_‼️", "emoji_!!️" ],
37
+ [ "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗", "😂❤😍🤣😊🙏💕😭😘👍😅👏😁♥🔥💔💖💙😢🤔😆🙄💪😉☺👌🤗"],
38
+ [ "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️", "💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣"],
39
+ [ "emoji_‼️", "emoji_!!"],
40
40
  [ "<title>hello<:hello>.txt", "<title>hello<:hello>.txt" ],
41
41
  [ "twodotfile..txt", "twodotfile..txt" ],
42
42
  [ "three/.../dots_path", "three/.../dots_path" ],