files.com 1.2.294 → 1.2.295
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.
- package/README.md +68 -17
- package/_VERSION +1 -1
- package/lib/Files.js +1 -1
- package/package.json +1 -1
- package/src/Files.js +1 -1
package/README.md
CHANGED
|
@@ -427,6 +427,74 @@ try {
|
|
|
427
427
|
}
|
|
428
428
|
```
|
|
429
429
|
|
|
430
|
+
## Paths
|
|
431
|
+
|
|
432
|
+
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.
|
|
433
|
+
<div></div>
|
|
434
|
+
|
|
435
|
+
### Capitalization
|
|
436
|
+
|
|
437
|
+
Files.com compares paths in a **case-insensitive** manner. This means path segments are treated as equivalent regardless of letter casing.
|
|
438
|
+
|
|
439
|
+
For example, all of the following resolve to the same internal path:
|
|
440
|
+
|
|
441
|
+
| Path Variant | Interpreted As |
|
|
442
|
+
|---------------------------------------|------------------------------|
|
|
443
|
+
| `Documents/Reports/Q1.pdf` | `documents/reports/q1.pdf` |
|
|
444
|
+
| `documents/reports/q1.PDF` | `documents/reports/q1.pdf` |
|
|
445
|
+
| `DOCUMENTS/REPORTS/Q1.PDF` | `documents/reports/q1.pdf` |
|
|
446
|
+
|
|
447
|
+
This behavior applies across:
|
|
448
|
+
- API requests
|
|
449
|
+
- Folder and file lookup operations
|
|
450
|
+
- Automations and workflows
|
|
451
|
+
|
|
452
|
+
See also: [Case Sensitivity Documentation](https://www.files.com/docs/files-and-folders/case-sensitivity/)
|
|
453
|
+
|
|
454
|
+
The `pathNormalizer.same` function in the Files.com SDK is designed to help you determine if two paths on
|
|
455
|
+
your native file system would be considered the same on Files.com. This is particularly important
|
|
456
|
+
when handling errors related to duplicate file names and when developing tools for folder
|
|
457
|
+
synchronization.
|
|
458
|
+
|
|
459
|
+
```javascript title="Compare Case-Insensitive Files and Paths"
|
|
460
|
+
import { pathNormalizer } from 'files.com/lib/utils';
|
|
461
|
+
|
|
462
|
+
if (pathNormalizer.same('Fïłèńämê.Txt', 'filename.txt')) {
|
|
463
|
+
// the paths are the same
|
|
464
|
+
}
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### Slashes
|
|
468
|
+
|
|
469
|
+
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.
|
|
470
|
+
|
|
471
|
+
#### Path Slash Examples
|
|
472
|
+
| Path | Valid? | Notes |
|
|
473
|
+
|-----------------------------------|--------|-------------------------------|
|
|
474
|
+
| `folder/subfolder/file.txt` | ✅ | Correct, internal separators only |
|
|
475
|
+
| `/folder/subfolder/file.txt` | ❌ | Leading slash not allowed |
|
|
476
|
+
| `folder/subfolder/file.txt/` | ❌ | Trailing slash not allowed |
|
|
477
|
+
| `//folder//file.txt` | ❌ | Duplicate separators not allowed |
|
|
478
|
+
|
|
479
|
+
<div></div>
|
|
480
|
+
|
|
481
|
+
### Unicode Normalization
|
|
482
|
+
|
|
483
|
+
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.
|
|
484
|
+
|
|
485
|
+
For example, the following two paths are treated as equivalent after NFC normalization:
|
|
486
|
+
|
|
487
|
+
| Input | Normalized Form |
|
|
488
|
+
|----------------------------------------|------------------------|
|
|
489
|
+
| `uploads/\u0065\u0301.txt` | `uploads/é.txt` |
|
|
490
|
+
| `docs/Café/Report.txt` | `docs/Café/Report.txt` |
|
|
491
|
+
|
|
492
|
+
- All input must be UTF‑8 encoded.
|
|
493
|
+
- Precomposed and decomposed characters are unified.
|
|
494
|
+
- This affects search, deduplication, and comparisons across SDKs.
|
|
495
|
+
|
|
496
|
+
<div></div>
|
|
497
|
+
|
|
430
498
|
## Foreign Language Support
|
|
431
499
|
|
|
432
500
|
The Files.com Javascript SDK supports localized responses by using the `Files.setLanguage()` configuration method.
|
|
@@ -731,23 +799,6 @@ try {
|
|
|
731
799
|
}
|
|
732
800
|
```
|
|
733
801
|
|
|
734
|
-
## Case Sensitivity
|
|
735
|
-
|
|
736
|
-
The Files.com API compares files and paths in a case-insensitive manner. For related documentation see [Case Sensitivity Documentation](https://www.files.com/docs/files-and-folders/file-system-semantics/case-sensitivity).
|
|
737
|
-
|
|
738
|
-
The `pathNormalizer.same` function in the Files.com SDK is designed to help you determine if two paths on
|
|
739
|
-
your native file system would be considered the same on Files.com. This is particularly important
|
|
740
|
-
when handling errors related to duplicate file names and when developing tools for folder
|
|
741
|
-
synchronization.
|
|
742
|
-
|
|
743
|
-
```javascript title="Compare Case-Insensitive Files and Paths"
|
|
744
|
-
import { pathNormalizer } from 'files.com/lib/utils';
|
|
745
|
-
|
|
746
|
-
if (pathNormalizer.same('Fïłèńämê.Txt', 'filename.txt')) {
|
|
747
|
-
// the paths are the same
|
|
748
|
-
}
|
|
749
|
-
```
|
|
750
|
-
|
|
751
802
|
## Mock Server
|
|
752
803
|
|
|
753
804
|
Files.com publishes a Files.com API server, which is useful for testing your use of the Files.com
|
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.295
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.295';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED