@vrtmrz/livesync-commonlib 0.3.0 → 0.3.1

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.
Files changed (57) hide show
  1. package/README.md +17 -4
  2. package/dist/API/DirectFileManipulatorV2.d.ts +1 -0
  3. package/dist/API/DirectFileManipulatorV2.js +6 -12
  4. package/dist/API/processSetting.d.ts +1 -0
  5. package/dist/common/models/setting.const.defaults.js +1 -0
  6. package/dist/common/models/setting.const.qr.js +1 -0
  7. package/dist/common/models/setting.policy.d.ts +4 -0
  8. package/dist/common/models/setting.policy.js +1 -0
  9. package/dist/common/models/setting.type.d.ts +2 -0
  10. package/dist/common/models/tweak.definition.d.ts +1 -0
  11. package/dist/common/pathNamespace.d.ts +4 -0
  12. package/dist/common/pathNamespace.js +10 -0
  13. package/dist/common/settingConstants.d.ts +1 -0
  14. package/dist/common/settingConstants.js +4 -0
  15. package/dist/platform/AmbiguousNormalisedPathError.d.ts +16 -0
  16. package/dist/platform/AmbiguousNormalisedPathError.js +21 -0
  17. package/dist/platform/StoragePathResolver.d.ts +15 -0
  18. package/dist/platform/StoragePathResolver.js +113 -0
  19. package/dist/platform/browser/UnicodeResolvingFileSystemAccessStorageAdapter.d.ts +74 -0
  20. package/dist/platform/browser/UnicodeResolvingFileSystemAccessStorageAdapter.js +169 -0
  21. package/dist/platform/browser/index.d.ts +1 -0
  22. package/dist/platform/browser/index.js +2 -0
  23. package/dist/platform/browser/storage.d.ts +23 -0
  24. package/dist/platform/browser/storage.js +138 -0
  25. package/dist/platform/node/UnicodeResolvingNodeStorageAdapter.d.ts +79 -0
  26. package/dist/platform/node/UnicodeResolvingNodeStorageAdapter.js +218 -0
  27. package/dist/platform/node/index.d.ts +1 -0
  28. package/dist/platform/node/index.js +2 -0
  29. package/dist/platform/node/storage.d.ts +30 -1
  30. package/dist/platform/node/storage.js +88 -0
  31. package/dist/platform/pathComparison.d.ts +53 -0
  32. package/dist/platform/pathComparison.js +39 -0
  33. package/dist/platform/pathTypes.d.ts +154 -0
  34. package/dist/platform/pathTypes.js +0 -0
  35. package/dist/platform/storagePathResolution.d.ts +13 -0
  36. package/dist/platform/storagePathResolution.js +9 -0
  37. package/dist/replication/couchdb/LiveSyncReplicator.js +5 -3
  38. package/dist/replication/trystero/TrysteroReplicator.d.ts +2 -0
  39. package/dist/serviceModules/Rebuilder.js +2 -1
  40. package/dist/services/base/FileProcessingService.d.ts +2 -2
  41. package/dist/services/base/RemoteConnection.d.ts +2 -0
  42. package/dist/services/base/RemoteService.d.ts +1 -1
  43. package/dist/services/base/RemoteService.js +13 -5
  44. package/dist/services/implements/injectable/InjectableVaultService.d.ts +1 -1
  45. package/dist/services/lib/couchdbHttpCache.d.ts +5 -0
  46. package/dist/services/lib/couchdbHttpCache.js +36 -0
  47. package/dist/storage.d.ts +4 -0
  48. package/dist/storage.js +19 -0
  49. package/dist/string_and_binary/path.js +4 -7
  50. package/dist/worker/bgWorker.js +1 -1
  51. package/docs/adr/2026_11_shared_storage_path_resolution.md +73 -0
  52. package/docs/design_docs/storage_path_resolution.md +305 -0
  53. package/docs/development.md +11 -1
  54. package/docs/platform-storage.md +61 -0
  55. package/docs/releasing.md +25 -0
  56. package/docs/unicode-path-identity.md +48 -17
  57. package/package.json +9 -1
@@ -1,3 +1,4 @@
1
+ import { splitPathNamespace } from "../common/pathNamespace.js";
1
2
  import { Minimatch } from "minimatch";
2
3
  import { getWebCrypto } from "../mods.js";
3
4
  import {
@@ -13,7 +14,7 @@ import {
13
14
  import { memorizeFuncWithLRUCache } from "../common/utils.js";
14
15
  import { uint8ArrayToHexString, writeString } from "./convert.js";
15
16
  import { unique } from "octagonal-wheels/collection.js";
16
- import { CHeader, ICHeader, ICXHeader, PSCHeader } from "../common/models/fileaccess.const.js";
17
+ import { CHeader } from "../common/models/fileaccess.const.js";
17
18
  import { computeKeyedId } from "../common/idDerivation.js";
18
19
  function isValidFilenameInWidows(filename) {
19
20
  const regex = /[\u0000-\u001f]|[\\":?<>|*#]/g;
@@ -45,12 +46,8 @@ function addPrefix(path, prefix) {
45
46
  return `${prefix ?? ""}${path}`;
46
47
  }
47
48
  function expandFilePathPrefix(path) {
48
- for (const prefix of [ICHeader, ICXHeader, PSCHeader]) {
49
- if (path.startsWith(prefix)) {
50
- return [prefix, path.substring(prefix.length)];
51
- }
52
- }
53
- return ["", path];
49
+ const [prefix, body] = splitPathNamespace(path);
50
+ return [prefix, body];
54
51
  }
55
52
  function expandDocumentIDPrefix(id) {
56
53
  for (const prefix of [CHeader, PREFIX_OBFUSCATED]) {