@fgv/ts-web-extras 5.1.0-0 → 5.1.0-2

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 (332) hide show
  1. package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +56 -33
  2. package/.rush/temp/chunked-rush-logs/ts-web-extras.test.chunks.jsonl +75 -0
  3. package/.rush/temp/operation/build/all.log +56 -33
  4. package/.rush/temp/operation/build/error.log +18 -0
  5. package/.rush/temp/operation/build/log-chunks.jsonl +56 -33
  6. package/.rush/temp/operation/build/state.json +1 -1
  7. package/.rush/temp/operation/test/all.log +75 -0
  8. package/.rush/temp/operation/test/error.log +18 -0
  9. package/.rush/temp/operation/test/log-chunks.jsonl +75 -0
  10. package/.rush/temp/operation/test/state.json +3 -0
  11. package/dist/packlets/file-tree/fileApiTreeAccessors.js +15 -0
  12. package/dist/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
  13. package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js +79 -10
  14. package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -1
  15. package/dist/packlets/file-tree/httpTreeAccessors.js +336 -0
  16. package/dist/packlets/file-tree/httpTreeAccessors.js.map +1 -0
  17. package/dist/packlets/file-tree/index.js +1 -0
  18. package/dist/packlets/file-tree/index.js.map +1 -1
  19. package/dist/packlets/file-tree/localStorageTreeAccessors.js +51 -0
  20. package/dist/packlets/file-tree/localStorageTreeAccessors.js.map +1 -1
  21. package/dist/test/unit/fileApiTreeAccessors.test.js +51 -0
  22. package/dist/test/unit/fileApiTreeAccessors.test.js.map +1 -1
  23. package/dist/test/unit/fileSystemAccessTreeAccessors.test.js +265 -160
  24. package/dist/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -1
  25. package/dist/test/unit/httpTreeAccessors.test.js +1229 -0
  26. package/dist/test/unit/httpTreeAccessors.test.js.map +1 -0
  27. package/dist/test/unit/localStorageTreeAccessors.test.js +218 -1
  28. package/dist/test/unit/localStorageTreeAccessors.test.js.map +1 -1
  29. package/dist/ts-web-extras.d.ts +138 -0
  30. package/docs/@fgv/namespaces/CryptoUtils/README.md +18 -0
  31. package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserCryptoProvider.md +203 -0
  32. package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserHashProvider.md +63 -0
  33. package/docs/@fgv/namespaces/CryptoUtils/functions/createBrowserCryptoProvider.md +18 -0
  34. package/docs/@fgv/namespaces/FileTreeHelpers/README.md +19 -0
  35. package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileListMetadata.md +23 -0
  36. package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileMetadata.md +23 -0
  37. package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromDirectoryUpload.md +33 -0
  38. package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromFileList.md +33 -0
  39. package/docs/@fgv/namespaces/FileTreeHelpers/functions/getOriginalFile.md +25 -0
  40. package/docs/@fgv/namespaces/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +11 -0
  41. package/docs/README.md +78 -0
  42. package/docs/classes/DirectoryHandleStore.md +116 -0
  43. package/docs/classes/FileApiTreeAccessors.md +286 -0
  44. package/docs/classes/FileSystemAccessTreeAccessors.md +557 -0
  45. package/docs/classes/HttpTreeAccessors.md +508 -0
  46. package/docs/classes/LocalStorageTreeAccessors.md +520 -0
  47. package/docs/functions/exportAsJson.md +23 -0
  48. package/docs/functions/exportUsingFileSystemAPI.md +26 -0
  49. package/docs/functions/extractDirectoryPath.md +23 -0
  50. package/docs/functions/isDirectoryHandle.md +23 -0
  51. package/docs/functions/isFileHandle.md +23 -0
  52. package/docs/functions/isFilePath.md +21 -0
  53. package/docs/functions/parseContextFilter.md +22 -0
  54. package/docs/functions/parseQualifierDefaults.md +22 -0
  55. package/docs/functions/parseResourceTypes.md +22 -0
  56. package/docs/functions/parseUrlParameters.md +15 -0
  57. package/docs/functions/safeShowDirectoryPicker.md +24 -0
  58. package/docs/functions/safeShowOpenFilePicker.md +24 -0
  59. package/docs/functions/safeShowSaveFilePicker.md +24 -0
  60. package/docs/functions/supportsFileSystemAccess.md +23 -0
  61. package/docs/interfaces/FilePickerAcceptType.md +16 -0
  62. package/docs/interfaces/FileSystemCreateWritableOptions.md +15 -0
  63. package/docs/interfaces/FileSystemDirectoryHandle.md +187 -0
  64. package/docs/interfaces/FileSystemFileHandle.md +106 -0
  65. package/docs/interfaces/FileSystemGetDirectoryOptions.md +15 -0
  66. package/docs/interfaces/FileSystemGetFileOptions.md +15 -0
  67. package/docs/interfaces/FileSystemHandle.md +69 -0
  68. package/docs/interfaces/FileSystemHandlePermissionDescriptor.md +15 -0
  69. package/docs/interfaces/FileSystemRemoveOptions.md +15 -0
  70. package/docs/interfaces/FileSystemWritableFileStream.md +127 -0
  71. package/docs/interfaces/IDirectoryHandleTreeInitializer.md +17 -0
  72. package/docs/interfaces/IFileHandleTreeInitializer.md +16 -0
  73. package/docs/interfaces/IFileListTreeInitializer.md +15 -0
  74. package/docs/interfaces/IFileMetadata.md +19 -0
  75. package/docs/interfaces/IFileSystemAccessTreeParams.md +30 -0
  76. package/docs/interfaces/IFsAccessApis.md +57 -0
  77. package/docs/interfaces/IHttpTreeParams.md +32 -0
  78. package/docs/interfaces/ILocalStorageTreeParams.md +30 -0
  79. package/docs/interfaces/IUrlConfigOptions.md +27 -0
  80. package/docs/interfaces/ShowDirectoryPickerOptions.md +17 -0
  81. package/docs/interfaces/ShowOpenFilePickerOptions.md +19 -0
  82. package/docs/interfaces/ShowSaveFilePickerOptions.md +19 -0
  83. package/docs/type-aliases/TreeInitializer.md +11 -0
  84. package/docs/type-aliases/WellKnownDirectory.md +11 -0
  85. package/docs/type-aliases/WindowWithFsAccess.md +11 -0
  86. package/docs/variables/DEFAULT_DIRECTORY_HANDLE_DB.md +11 -0
  87. package/docs/variables/DEFAULT_DIRECTORY_HANDLE_STORE.md +11 -0
  88. package/etc/ts-web-extras.api.md +33 -0
  89. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +9 -0
  90. package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -1
  91. package/lib/packlets/file-tree/fileApiTreeAccessors.js +15 -0
  92. package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
  93. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts +17 -1
  94. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts.map +1 -1
  95. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js +78 -9
  96. package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -1
  97. package/lib/packlets/file-tree/httpTreeAccessors.d.ts +102 -0
  98. package/lib/packlets/file-tree/httpTreeAccessors.d.ts.map +1 -0
  99. package/lib/packlets/file-tree/httpTreeAccessors.js +340 -0
  100. package/lib/packlets/file-tree/httpTreeAccessors.js.map +1 -0
  101. package/lib/packlets/file-tree/index.d.ts +1 -0
  102. package/lib/packlets/file-tree/index.d.ts.map +1 -1
  103. package/lib/packlets/file-tree/index.js +1 -0
  104. package/lib/packlets/file-tree/index.js.map +1 -1
  105. package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts +12 -0
  106. package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts.map +1 -1
  107. package/lib/packlets/file-tree/localStorageTreeAccessors.js +51 -0
  108. package/lib/packlets/file-tree/localStorageTreeAccessors.js.map +1 -1
  109. package/lib/test/unit/fileApiTreeAccessors.test.js +51 -0
  110. package/lib/test/unit/fileApiTreeAccessors.test.js.map +1 -1
  111. package/lib/test/unit/fileSystemAccessTreeAccessors.test.js +265 -160
  112. package/lib/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -1
  113. package/lib/test/unit/httpTreeAccessors.test.d.ts +2 -0
  114. package/lib/test/unit/httpTreeAccessors.test.d.ts.map +1 -0
  115. package/lib/test/unit/httpTreeAccessors.test.js +1231 -0
  116. package/lib/test/unit/httpTreeAccessors.test.js.map +1 -0
  117. package/lib/test/unit/localStorageTreeAccessors.test.js +218 -1
  118. package/lib/test/unit/localStorageTreeAccessors.test.js.map +1 -1
  119. package/package.json +25 -25
  120. package/rush-logs/ts-web-extras.build.cache.log +0 -3
  121. package/rush-logs/ts-web-extras.build.error.log +18 -0
  122. package/rush-logs/ts-web-extras.build.log +56 -33
  123. package/rush-logs/ts-web-extras.test.cache.log +1 -0
  124. package/rush-logs/ts-web-extras.test.error.log +18 -0
  125. package/rush-logs/ts-web-extras.test.log +75 -0
  126. package/src/packlets/file-tree/fileApiTreeAccessors.ts +18 -0
  127. package/src/packlets/file-tree/fileSystemAccessTreeAccessors.ts +100 -8
  128. package/src/packlets/file-tree/httpTreeAccessors.ts +448 -0
  129. package/src/packlets/file-tree/index.ts +1 -0
  130. package/src/packlets/file-tree/localStorageTreeAccessors.ts +53 -0
  131. package/src/test/unit/fileApiTreeAccessors.test.ts +69 -0
  132. package/src/test/unit/fileSystemAccessTreeAccessors.test.ts +341 -188
  133. package/src/test/unit/httpTreeAccessors.test.ts +1571 -0
  134. package/src/test/unit/localStorageTreeAccessors.test.ts +269 -1
  135. package/temp/build/typescript/ts_8nwakTlr.json +1 -1
  136. package/temp/coverage/crypto/browserHashProvider.ts.html +304 -0
  137. package/temp/coverage/crypto/index.html +116 -0
  138. package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1 -1
  139. package/temp/coverage/crypto-utils/browserHashProvider.ts.html +1 -1
  140. package/temp/coverage/crypto-utils/index.html +1 -1
  141. package/temp/coverage/file-tree/directoryHandleStore.ts.html +1 -1
  142. package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +60 -6
  143. package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +410 -134
  144. package/temp/coverage/file-tree/httpTreeAccessors.ts.html +1429 -0
  145. package/temp/coverage/file-tree/index.html +35 -20
  146. package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +318 -159
  147. package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
  148. package/temp/coverage/helpers/index.html +1 -1
  149. package/temp/coverage/index.html +11 -11
  150. package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +304 -0
  151. package/temp/coverage/lcov-report/crypto/index.html +116 -0
  152. package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1 -1
  153. package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +1 -1
  154. package/temp/coverage/lcov-report/crypto-utils/index.html +1 -1
  155. package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +1 -1
  156. package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +60 -6
  157. package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +410 -134
  158. package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +1429 -0
  159. package/temp/coverage/lcov-report/file-tree/index.html +35 -20
  160. package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +318 -159
  161. package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
  162. package/temp/coverage/lcov-report/helpers/index.html +1 -1
  163. package/temp/coverage/lcov-report/index.html +11 -11
  164. package/temp/coverage/lcov-report/url-utils/index.html +1 -1
  165. package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
  166. package/temp/coverage/lcov.info +2021 -1197
  167. package/temp/coverage/url-utils/index.html +1 -1
  168. package/temp/coverage/url-utils/urlParams.ts.html +1 -1
  169. package/temp/test/jest/haste-map-b931e4e63102f86c5bd4949f7dced44f-9d713eb41149188b4e5c0ae3d86d0a57-2ad8e16b24e391b8cdbe50b55c137169 +0 -0
  170. package/temp/test/jest/perf-cache-b931e4e63102f86c5bd4949f7dced44f-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
  171. package/temp/ts-web-extras.api.json +1313 -354
  172. package/temp/ts-web-extras.api.md +33 -0
  173. package/.rush/temp/81e0881271ff236956b2f52e8ca99da6574c6e1e.tar.log +0 -223
  174. package/docs/index.md +0 -34
  175. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider._constructor_.md +0 -50
  176. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.decrypt.md +0 -104
  177. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.derivekey.md +0 -88
  178. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.encrypt.md +0 -72
  179. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.frombase64.md +0 -56
  180. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generatekey.md +0 -19
  181. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generaterandombytes.md +0 -56
  182. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.md +0 -169
  183. package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.tobase64.md +0 -56
  184. package/docs/ts-web-extras.cryptoutils.browserhashprovider.hashparts.md +0 -88
  185. package/docs/ts-web-extras.cryptoutils.browserhashprovider.hashstring.md +0 -72
  186. package/docs/ts-web-extras.cryptoutils.browserhashprovider.md +0 -66
  187. package/docs/ts-web-extras.cryptoutils.createbrowsercryptoprovider.md +0 -19
  188. package/docs/ts-web-extras.cryptoutils.md +0 -71
  189. package/docs/ts-web-extras.exportasjson.md +0 -70
  190. package/docs/ts-web-extras.exportusingfilesystemapi.md +0 -104
  191. package/docs/ts-web-extras.extractdirectorypath.md +0 -52
  192. package/docs/ts-web-extras.fileapitreeaccessors.create.md +0 -72
  193. package/docs/ts-web-extras.fileapitreeaccessors.createfromlocalstorage.md +0 -74
  194. package/docs/ts-web-extras.fileapitreeaccessors.createpersistent.md +0 -76
  195. package/docs/ts-web-extras.fileapitreeaccessors.extractfilemetadata.md +0 -54
  196. package/docs/ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md +0 -72
  197. package/docs/ts-web-extras.fileapitreeaccessors.fromfilelist.md +0 -72
  198. package/docs/ts-web-extras.fileapitreeaccessors.getoriginalfile.md +0 -72
  199. package/docs/ts-web-extras.fileapitreeaccessors.md +0 -146
  200. package/docs/ts-web-extras.filepickeraccepttype.accept.md +0 -11
  201. package/docs/ts-web-extras.filepickeraccepttype.description.md +0 -11
  202. package/docs/ts-web-extras.filepickeraccepttype.md +0 -75
  203. package/docs/ts-web-extras.filesystemaccesstreeaccessors._constructor_.md +0 -114
  204. package/docs/ts-web-extras.filesystemaccesstreeaccessors.fileismutable.md +0 -52
  205. package/docs/ts-web-extras.filesystemaccesstreeaccessors.fromdirectoryhandle.md +0 -72
  206. package/docs/ts-web-extras.filesystemaccesstreeaccessors.getdirtypaths.md +0 -17
  207. package/docs/ts-web-extras.filesystemaccesstreeaccessors.isdirty.md +0 -17
  208. package/docs/ts-web-extras.filesystemaccesstreeaccessors.md +0 -159
  209. package/docs/ts-web-extras.filesystemaccesstreeaccessors.savefilecontents.md +0 -66
  210. package/docs/ts-web-extras.filesystemaccesstreeaccessors.synctodisk.md +0 -17
  211. package/docs/ts-web-extras.filesystemcreatewritableoptions_2.keepexistingdata.md +0 -11
  212. package/docs/ts-web-extras.filesystemcreatewritableoptions_2.md +0 -58
  213. package/docs/ts-web-extras.filesystemdirectoryhandle_2._symbol.asynciterator_.md +0 -15
  214. package/docs/ts-web-extras.filesystemdirectoryhandle_2.entries.md +0 -15
  215. package/docs/ts-web-extras.filesystemdirectoryhandle_2.getdirectoryhandle.md +0 -66
  216. package/docs/ts-web-extras.filesystemdirectoryhandle_2.getfilehandle.md +0 -66
  217. package/docs/ts-web-extras.filesystemdirectoryhandle_2.keys.md +0 -15
  218. package/docs/ts-web-extras.filesystemdirectoryhandle_2.kind.md +0 -11
  219. package/docs/ts-web-extras.filesystemdirectoryhandle_2.md +0 -146
  220. package/docs/ts-web-extras.filesystemdirectoryhandle_2.removeentry.md +0 -66
  221. package/docs/ts-web-extras.filesystemdirectoryhandle_2.resolve.md +0 -50
  222. package/docs/ts-web-extras.filesystemdirectoryhandle_2.values.md +0 -15
  223. package/docs/ts-web-extras.filesystemfilehandle_2.createwritable.md +0 -52
  224. package/docs/ts-web-extras.filesystemfilehandle_2.getfile.md +0 -15
  225. package/docs/ts-web-extras.filesystemfilehandle_2.kind.md +0 -11
  226. package/docs/ts-web-extras.filesystemfilehandle_2.md +0 -92
  227. package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.create.md +0 -11
  228. package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.md +0 -58
  229. package/docs/ts-web-extras.filesystemgetfileoptions_2.create.md +0 -11
  230. package/docs/ts-web-extras.filesystemgetfileoptions_2.md +0 -58
  231. package/docs/ts-web-extras.filesystemhandle_2.issameentry.md +0 -50
  232. package/docs/ts-web-extras.filesystemhandle_2.kind.md +0 -11
  233. package/docs/ts-web-extras.filesystemhandle_2.md +0 -119
  234. package/docs/ts-web-extras.filesystemhandle_2.name.md +0 -11
  235. package/docs/ts-web-extras.filesystemhandle_2.querypermission.md +0 -52
  236. package/docs/ts-web-extras.filesystemhandle_2.requestpermission.md +0 -52
  237. package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.md +0 -58
  238. package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.mode.md +0 -11
  239. package/docs/ts-web-extras.filesystemremoveoptions_2.md +0 -58
  240. package/docs/ts-web-extras.filesystemremoveoptions_2.recursive.md +0 -11
  241. package/docs/ts-web-extras.filesystemwritablefilestream_2.md +0 -57
  242. package/docs/ts-web-extras.filesystemwritablefilestream_2.seek.md +0 -50
  243. package/docs/ts-web-extras.filesystemwritablefilestream_2.truncate.md +0 -50
  244. package/docs/ts-web-extras.filesystemwritablefilestream_2.write.md +0 -50
  245. package/docs/ts-web-extras.filetreehelpers.defaultfileapitreeinitparams.md +0 -13
  246. package/docs/ts-web-extras.filetreehelpers.extractfilelistmetadata.md +0 -56
  247. package/docs/ts-web-extras.filetreehelpers.extractfilemetadata.md +0 -56
  248. package/docs/ts-web-extras.filetreehelpers.fromdirectoryupload.md +0 -76
  249. package/docs/ts-web-extras.filetreehelpers.fromfilelist.md +0 -76
  250. package/docs/ts-web-extras.filetreehelpers.getoriginalfile.md +0 -72
  251. package/docs/ts-web-extras.filetreehelpers.md +0 -102
  252. package/docs/ts-web-extras.idirectoryhandletreeinitializer.dirhandles.md +0 -11
  253. package/docs/ts-web-extras.idirectoryhandletreeinitializer.md +0 -100
  254. package/docs/ts-web-extras.idirectoryhandletreeinitializer.nonrecursive.md +0 -11
  255. package/docs/ts-web-extras.idirectoryhandletreeinitializer.prefix.md +0 -11
  256. package/docs/ts-web-extras.ifilehandletreeinitializer.filehandles.md +0 -11
  257. package/docs/ts-web-extras.ifilehandletreeinitializer.md +0 -79
  258. package/docs/ts-web-extras.ifilehandletreeinitializer.prefix.md +0 -11
  259. package/docs/ts-web-extras.ifilelisttreeinitializer.filelist.md +0 -11
  260. package/docs/ts-web-extras.ifilelisttreeinitializer.md +0 -58
  261. package/docs/ts-web-extras.ifilemetadata.lastmodified.md +0 -11
  262. package/docs/ts-web-extras.ifilemetadata.md +0 -124
  263. package/docs/ts-web-extras.ifilemetadata.name.md +0 -11
  264. package/docs/ts-web-extras.ifilemetadata.path.md +0 -11
  265. package/docs/ts-web-extras.ifilemetadata.size.md +0 -11
  266. package/docs/ts-web-extras.ifilemetadata.type.md +0 -11
  267. package/docs/ts-web-extras.ifilesystemaccesstreeparams.autosync.md +0 -13
  268. package/docs/ts-web-extras.ifilesystemaccesstreeparams.md +0 -78
  269. package/docs/ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md +0 -13
  270. package/docs/ts-web-extras.ifsaccessapis.md +0 -56
  271. package/docs/ts-web-extras.ifsaccessapis.showdirectorypicker.md +0 -52
  272. package/docs/ts-web-extras.ifsaccessapis.showopenfilepicker.md +0 -52
  273. package/docs/ts-web-extras.ifsaccessapis.showsavefilepicker.md +0 -52
  274. package/docs/ts-web-extras.ilocalstoragetreeparams.autosync.md +0 -13
  275. package/docs/ts-web-extras.ilocalstoragetreeparams.md +0 -97
  276. package/docs/ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md +0 -13
  277. package/docs/ts-web-extras.ilocalstoragetreeparams.storage.md +0 -13
  278. package/docs/ts-web-extras.isdirectoryhandle.md +0 -56
  279. package/docs/ts-web-extras.isfilehandle.md +0 -56
  280. package/docs/ts-web-extras.isfilepath.md +0 -52
  281. package/docs/ts-web-extras.iurlconfigoptions.config.md +0 -13
  282. package/docs/ts-web-extras.iurlconfigoptions.configstartdir.md +0 -13
  283. package/docs/ts-web-extras.iurlconfigoptions.contextfilter.md +0 -13
  284. package/docs/ts-web-extras.iurlconfigoptions.input.md +0 -13
  285. package/docs/ts-web-extras.iurlconfigoptions.inputstartdir.md +0 -13
  286. package/docs/ts-web-extras.iurlconfigoptions.interactive.md +0 -13
  287. package/docs/ts-web-extras.iurlconfigoptions.loadzip.md +0 -13
  288. package/docs/ts-web-extras.iurlconfigoptions.maxdistance.md +0 -13
  289. package/docs/ts-web-extras.iurlconfigoptions.md +0 -286
  290. package/docs/ts-web-extras.iurlconfigoptions.qualifierdefaults.md +0 -13
  291. package/docs/ts-web-extras.iurlconfigoptions.reducequalifiers.md +0 -13
  292. package/docs/ts-web-extras.iurlconfigoptions.resourcetypes.md +0 -13
  293. package/docs/ts-web-extras.iurlconfigoptions.zipfile.md +0 -13
  294. package/docs/ts-web-extras.iurlconfigoptions.zippath.md +0 -13
  295. package/docs/ts-web-extras.localstoragetreeaccessors.fileismutable.md +0 -56
  296. package/docs/ts-web-extras.localstoragetreeaccessors.fromstorage.md +0 -56
  297. package/docs/ts-web-extras.localstoragetreeaccessors.getdirtypaths.md +0 -19
  298. package/docs/ts-web-extras.localstoragetreeaccessors.isdirty.md +0 -19
  299. package/docs/ts-web-extras.localstoragetreeaccessors.md +0 -131
  300. package/docs/ts-web-extras.localstoragetreeaccessors.savefilecontents.md +0 -72
  301. package/docs/ts-web-extras.localstoragetreeaccessors.synctodisk.md +0 -19
  302. package/docs/ts-web-extras.md +0 -558
  303. package/docs/ts-web-extras.parsecontextfilter.md +0 -52
  304. package/docs/ts-web-extras.parsequalifierdefaults.md +0 -52
  305. package/docs/ts-web-extras.parseresourcetypes.md +0 -52
  306. package/docs/ts-web-extras.parseurlparameters.md +0 -17
  307. package/docs/ts-web-extras.safeshowdirectorypicker.md +0 -72
  308. package/docs/ts-web-extras.safeshowopenfilepicker.md +0 -72
  309. package/docs/ts-web-extras.safeshowsavefilepicker.md +0 -72
  310. package/docs/ts-web-extras.showdirectorypickeroptions.id.md +0 -11
  311. package/docs/ts-web-extras.showdirectorypickeroptions.md +0 -96
  312. package/docs/ts-web-extras.showdirectorypickeroptions.mode.md +0 -11
  313. package/docs/ts-web-extras.showdirectorypickeroptions.startin.md +0 -11
  314. package/docs/ts-web-extras.showopenfilepickeroptions.excludeacceptalloption.md +0 -11
  315. package/docs/ts-web-extras.showopenfilepickeroptions.id.md +0 -11
  316. package/docs/ts-web-extras.showopenfilepickeroptions.md +0 -134
  317. package/docs/ts-web-extras.showopenfilepickeroptions.multiple.md +0 -11
  318. package/docs/ts-web-extras.showopenfilepickeroptions.startin.md +0 -11
  319. package/docs/ts-web-extras.showopenfilepickeroptions.types.md +0 -11
  320. package/docs/ts-web-extras.showsavefilepickeroptions.excludeacceptalloption.md +0 -11
  321. package/docs/ts-web-extras.showsavefilepickeroptions.id.md +0 -11
  322. package/docs/ts-web-extras.showsavefilepickeroptions.md +0 -134
  323. package/docs/ts-web-extras.showsavefilepickeroptions.startin.md +0 -11
  324. package/docs/ts-web-extras.showsavefilepickeroptions.suggestedname.md +0 -11
  325. package/docs/ts-web-extras.showsavefilepickeroptions.types.md +0 -11
  326. package/docs/ts-web-extras.supportsfilesystemaccess.md +0 -56
  327. package/docs/ts-web-extras.treeinitializer.md +0 -15
  328. package/docs/ts-web-extras.wellknowndirectory.md +0 -13
  329. package/docs/ts-web-extras.windowwithfsaccess.md +0 -15
  330. package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
  331. package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +0 -1
  332. /package/temp/test/jest/{jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/8d/package_8dcbedef69e4299f0f51fcda8f4f1c8e → jest-transform-cache-b931e4e63102f86c5bd4949f7dced44f-79ef2876fae7ca75eedb2aa53dc48338/b5/package_b5f57afc9ec2c011239b1608ee5bdfa5} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"localStorageTreeAccessors.test.js","sourceRoot":"","sources":["../../../src/test/unit/localStorageTreeAccessors.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW;IAAjB;QACU,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IA0BjD,CAAC;IAxBC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,GAAW;;QACjB,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,mCAAI,IAAI,CAAC;IACrC,CAAC;IAED,GAAG,CAAC,KAAa;;QACf,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,mCAAI,IAAI,CAAC;IAC7B,CAAC;IAED,UAAU,CAAC,GAAW;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,C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AE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YAExF,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC;YAChD,MAAM,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACrC,WAAW,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;YAE3F,MAAM,SAAS,GAAG,yBAAyB,CAAC,WAAW,CAAC;gBACtD,YAAY,EAAE;oBACZ,mBAAmB,EAAE,qBAAqB;iBAC3C;gBACD,OAAO,EAAE,WAAW;gBACpB,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC,OAAO,EAAE,CAAC;YAEb,mEAAmE;YACnE,MAAM,UAAU,GAAG,SAAS,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACpG,MAAM,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,qCAAqC,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport '@fgv/ts-utils-jest';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { LocalStorageTreeAccessors, FileApiTreeAccessors } from '../../packlets/file-tree';\n\n/**\n * Mock Storage implementation for testing\n */\nclass MockStorage implements Storage {\n private _data: Map<string, string> = new Map();\n\n get length(): number {\n return this._data.size;\n }\n\n clear(): void {\n this._data.clear();\n }\n\n getItem(key: string): string | null {\n return this._data.get(key) ?? null;\n }\n\n key(index: number): string | null {\n const keys = Array.from(this._data.keys());\n return keys[index] ?? null;\n }\n\n removeItem(key: string): void {\n this._data.delete(key);\n }\n\n setItem(key: string, value: string): void {\n this._data.set(key, value);\n }\n}\n\ndescribe('LocalStorageTreeAccessors', () => {\n let mockStorage: MockStorage;\n\n beforeEach(() => {\n mockStorage = new MockStorage();\n });\n\n describe('fromStorage', () => {\n test('creates accessors from empty storage', () => {\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n expect(accessors.isDirty()).toBe(false);\n });\n });\n\n test('loads collections from storage', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: { item1: {} } },\n collection2: { items: { item2: {} } }\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/collection1.json')).toSucceed();\n expect(accessors.getFileContents('/data/ingredients/collection2.json')).toSucceed();\n });\n });\n\n test('loads from multiple storage keys', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/ing1.json')).toSucceed();\n expect(accessors.getFileContents('/data/fillings/fill1.json')).toSucceed();\n });\n });\n\n test('skips corrupted JSON data', () => {\n mockStorage.setItem('test:ingredients:v1', 'not valid json');\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n\n test('skips non-object JSON', () => {\n mockStorage.setItem('test:ingredients:v1', '\"string value\"');\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n\n test('loads string values (new format) with inferred extension', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n jsonCollection: '{\"items\":{}}',\n yamlCollection: 'metadata:\\n name: test\\nitems: {}'\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/jsonCollection.json')).toSucceedWith(\n '{\"items\":{}}'\n );\n expect(accessors.getFileContents('/data/ingredients/yamlCollection.yaml')).toSucceedWith(\n 'metadata:\\n name: test\\nitems: {}'\n );\n });\n });\n\n test('skips non-object non-string collection values', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n good: { items: {} },\n bad: 42\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/good.json')).toSucceed();\n });\n });\n\n test('applies prefix parameter', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n prefix: '/myapp'\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/myapp/data/ingredients/collection1.json')).toSucceed();\n });\n });\n\n test('succeeds with empty storage when no data present', () => {\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n });\n\n describe('dirty tracking', () => {\n test('starts with no dirty files', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n expect(accessors.isDirty()).toBe(false);\n expect(accessors.getDirtyPaths()).toEqual([]);\n });\n\n test('marks files as dirty after modification', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const newContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/collection1.json', newContent).orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n expect(accessors.getDirtyPaths()).toContain('/data/ingredients/collection1.json');\n });\n\n test('tracks multiple dirty files', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: {} },\n collection2: { items: {} }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n accessors\n .saveFileContents('/data/ingredients/collection2.json', JSON.stringify({ items: { b: 2 } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n expect(accessors.getDirtyPaths()).toHaveLength(2);\n });\n });\n\n describe('syncToDisk', () => {\n test('syncs modified files to storage', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({ collection1: { items: { original: true } } })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const newContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/collection1.json', newContent).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n const stored = mockStorage.getItem('test:ingredients:v1');\n expect(stored).toBeTruthy();\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(newContent);\n });\n\n test('clears dirty state after successful sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n expect(accessors.isDirty()).toBe(true);\n\n await accessors.syncToDisk();\n expect(accessors.isDirty()).toBe(false);\n expect(accessors.getDirtyPaths()).toEqual([]);\n });\n\n test('syncs multiple files to same storage key', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: {} },\n collection2: { items: {} }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const content1 = JSON.stringify({ items: { a: 1 } });\n const content2 = JSON.stringify({ items: { b: 2 } });\n accessors.saveFileContents('/data/ingredients/collection1.json', content1).orThrow();\n accessors.saveFileContents('/data/ingredients/collection2.json', content2).orThrow();\n\n await accessors.syncToDisk();\n\n const stored = mockStorage.getItem('test:ingredients:v1');\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(content1);\n expect(parsed.collection2).toBe(content2);\n });\n\n test('syncs files to different storage keys', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/ing1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n accessors.saveFileContents('/data/fillings/fill1.json', JSON.stringify({ items: { b: 2 } })).orThrow();\n\n await accessors.syncToDisk();\n\n const ingContent = JSON.stringify({ items: { a: 1 } });\n const fillContent = JSON.stringify({ items: { b: 2 } });\n const ingStored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n const fillStored = JSON.parse(mockStorage.getItem('test:fillings:v1')!);\n // New format: values are raw content strings\n expect(ingStored.ing1).toBe(ingContent);\n expect(fillStored.fill1).toBe(fillContent);\n });\n\n test('succeeds with no dirty files', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n }).orThrow();\n\n const result = await accessors.syncToDisk();\n expect(result).toSucceed();\n });\n\n test('preserves existing collections when syncing', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n existing: { items: { keep: true } },\n toModify: { items: { original: true } }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const modifiedContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/toModify.json', modifiedContent).orThrow();\n await accessors.syncToDisk();\n\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n // existing was loaded from legacy format and not modified, so it stays as legacy object\n // toModify was saved with new content, so it's now a raw string\n expect(stored.toModify).toBe(modifiedContent);\n });\n });\n\n describe('autoSync mode', () => {\n test('automatically syncs on save when enabled', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { auto: true } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(false);\n const autoContent = JSON.stringify({ items: { auto: true } });\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n // New format: values are raw content strings\n expect(stored.collection1).toBe(autoContent);\n });\n\n test('does not auto-sync when disabled', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: false\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { manual: true } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n // Storage should still have the original legacy format (not yet synced)\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n expect(stored.collection1).toEqual({ items: {} });\n });\n });\n\n describe('fileIsMutable', () => {\n test('returns persistent detail when mutable', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n expect(accessors.fileIsMutable('/data/ingredients/collection1.json')).toSucceedWithDetail(\n true,\n 'persistent'\n );\n });\n\n test('returns not-mutable when not mutable', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: false\n }).orThrow();\n\n const result = accessors.fileIsMutable('/data/ingredients/collection1.json');\n expect(result.isFailure()).toBe(true);\n if (result.isFailure()) {\n expect(result.detail).toBe('not-mutable');\n }\n });\n });\n\n describe('integration with FileApiTreeAccessors', () => {\n test('createFromLocalStorage creates FileTree with persistent accessors', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n });\n\n expect(result).toSucceed();\n\n const tree = result.orThrow();\n expect(tree).toBeInstanceOf(FileTree.FileTree);\n expect(FileTree.isPersistentAccessors(tree.hal)).toBe(true);\n\n const file = tree.getFile('/data/ingredients/collection1.json').orThrow();\n expect(file.getIsMutable()).toSucceedWithDetail(true, 'persistent');\n });\n\n test('createFromLocalStorage with multiple paths', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage,\n mutable: true\n });\n\n expect(result).toSucceedAndSatisfy((tree) => {\n expect(tree.getFile('/data/ingredients/ing1.json')).toSucceed();\n expect(tree.getFile('/data/fillings/fill1.json')).toSucceed();\n });\n });\n\n test('createFromLocalStorage with empty storage', () => {\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((tree) => {\n expect(tree).toBeInstanceOf(FileTree.FileTree);\n });\n });\n\n test('createFromLocalStorage fails when localStorage is not available', () => {\n // Remove the global window object to ensure no fallback\n const originalWindow = (global as any).window;\n delete (global as any).window;\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: undefined\n });\n\n // Restore window\n (global as any).window = originalWindow;\n\n expect(result).toFailWith(/localStorage is not available/i);\n });\n });\n\n describe('path matching and error handling', () => {\n test('handles files outside configured paths', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Try to save a file outside the configured path\n const saveResult = accessors.saveFileContents('/other/path/file.json', JSON.stringify({ test: 1 }));\n expect(saveResult).toSucceed();\n\n // But syncing should fail because no storage key is configured\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/No storage key configured for path/i);\n });\n\n test('handles files inside configured paths', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Save a file inside the configured path\n accessors.saveFileContents('/data/ingredients/newfile.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Syncing should succeed\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n });\n\n test('handles failed content retrieval during sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Modify a file\n accessors.saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Override getFileContents to fail\n const originalGetFileContents = accessors.getFileContents.bind(accessors);\n accessors.getFileContents = jest.fn((path: string) => {\n if (path === '/data/ingredients/collection1.json') {\n return { isSuccess: () => false, isFailure: () => true, message: 'File not found' } as any;\n }\n return originalGetFileContents(path);\n });\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/Failed to get file contents.*File not found/i);\n });\n\n test('handles corrupted JSON in localStorage during sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Modify a file\n accessors.saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Corrupt the existing storage data\n mockStorage.setItem('test:ingredients:v1', 'not valid json');\n\n // Sync should still succeed by starting fresh\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n // Verify the data was written correctly despite corrupted previous data\n const stored = mockStorage.getItem('test:ingredients:v1');\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(JSON.stringify({ test: 1 }));\n });\n\n test('syncs non-JSON content (YAML) without error', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Create and save a YAML file\n const yamlContent = 'metadata:\\n name: test\\nitems: {}';\n accessors.saveFileContents('/data/ingredients/my-collection.yaml', yamlContent).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n expect(stored['my-collection']).toBe(yamlContent);\n });\n\n test('handles multiple sync failures with aggregated errors', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Add files outside configured paths\n accessors.saveFileContents('/other1/file1.json', JSON.stringify({ test: 1 })).orThrow();\n accessors.saveFileContents('/other2/file2.json', JSON.stringify({ test: 2 })).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/Failed to sync 2 file\\(s\\)/i);\n });\n\n test('handles auto-sync failure', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: true\n }).orThrow();\n\n // Try to save a file outside configured path with autoSync enabled\n const saveResult = accessors.saveFileContents('/other/path/file.json', JSON.stringify({ test: 1 }));\n expect(saveResult).toFailWith(/No storage key configured for path/i);\n });\n });\n});\n"]}
1
+ {"version":3,"file":"localStorageTreeAccessors.test.js","sourceRoot":"","sources":["../../../src/test/unit/localStorageTreeAccessors.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW;IAAjB;QACU,UAAK,GAAwB,IAAI,GAAG,EAAE,CAAC;IA0BjD,CAAC;IAxBC,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,GAAW;;QACjB,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,mCAAI,IAAI,CAAC;IACrC,CAAC;IAED,GAAG,CAAC,KAAa;;QACf,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,mCAAI,IAAI,CAAC;IAC7B,CAAC;IAED,UAAU,CAAC,GAAW;QACpB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,GAAW,EAAE,KAAa;QAChC,IAAI,CAAC,KAAK,CAAC,GAAG,CA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AAqC,EAAE,SAAS,CAAC,CAAC;QAClG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;QACjD,IAAI,CAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;YACrF,6FAA6F;YAC7F,+EAA+E;YAC/E,iDAAiD;YACjD,MAAM,SAAS,GAAG,yBAAyB,CAAC,WAAW,CAAC;gBACtD,YAAY,EAAE;oBACZ,mBAAmB,EAAE,qBAAqB;iBAC3C;gBACD,OAAO,EAAE,WAAW;gBACpB,OAAO,EAAE,IAAI;aACd,CAAC,CAAC,OAAO,EAAE,CAAC;YAEb,0CAA0C;YAC1C,SAAS,CAAC,gBAAgB,CAAC,yBAAyB,EAAE,cAAc,CAAC,CAAC,OAAO,EAAE,CAAC;YAEhF,MAAM,UAAU,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC;YAChD,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,EAAE,CAAC;YAE/B,qFAAqF;YACrF,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;YAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;YAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAO,CAA4B,CAAC;YAC9D,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*\n * Copyright (c) 2026 Erik Fortune\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\nimport '@fgv/ts-utils-jest';\nimport { FileTree } from '@fgv/ts-json-base';\nimport { LocalStorageTreeAccessors, FileApiTreeAccessors } from '../../packlets/file-tree';\n\n/**\n * Mock Storage implementation for testing\n */\nclass MockStorage implements Storage {\n private _data: Map<string, string> = new Map();\n\n get length(): number {\n return this._data.size;\n }\n\n clear(): void {\n this._data.clear();\n }\n\n getItem(key: string): string | null {\n return this._data.get(key) ?? null;\n }\n\n key(index: number): string | null {\n const keys = Array.from(this._data.keys());\n return keys[index] ?? null;\n }\n\n removeItem(key: string): void {\n this._data.delete(key);\n }\n\n setItem(key: string, value: string): void {\n this._data.set(key, value);\n }\n}\n\ndescribe('LocalStorageTreeAccessors', () => {\n let mockStorage: MockStorage;\n\n beforeEach(() => {\n mockStorage = new MockStorage();\n });\n\n describe('fromStorage', () => {\n test('creates accessors from empty storage', () => {\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n expect(accessors.isDirty()).toBe(false);\n });\n });\n\n test('loads collections from storage', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: { item1: {} } },\n collection2: { items: { item2: {} } }\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/collection1.json')).toSucceed();\n expect(accessors.getFileContents('/data/ingredients/collection2.json')).toSucceed();\n });\n });\n\n test('loads from multiple storage keys', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/ing1.json')).toSucceed();\n expect(accessors.getFileContents('/data/fillings/fill1.json')).toSucceed();\n });\n });\n\n test('skips corrupted JSON data', () => {\n mockStorage.setItem('test:ingredients:v1', 'not valid json');\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n\n test('skips non-object JSON', () => {\n mockStorage.setItem('test:ingredients:v1', '\"string value\"');\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n\n test('loads string values (new format) with inferred extension', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n jsonCollection: '{\"items\":{}}',\n yamlCollection: 'metadata:\\n name: test\\nitems: {}'\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/jsonCollection.json')).toSucceedWith(\n '{\"items\":{}}'\n );\n expect(accessors.getFileContents('/data/ingredients/yamlCollection.yaml')).toSucceedWith(\n 'metadata:\\n name: test\\nitems: {}'\n );\n });\n });\n\n test('skips non-object non-string collection values', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n good: { items: {} },\n bad: 42\n })\n );\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/data/ingredients/good.json')).toSucceed();\n });\n });\n\n test('applies prefix parameter', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n prefix: '/myapp'\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors.getFileContents('/myapp/data/ingredients/collection1.json')).toSucceed();\n });\n });\n\n test('succeeds with empty storage when no data present', () => {\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((accessors) => {\n expect(accessors).toBeInstanceOf(LocalStorageTreeAccessors);\n });\n });\n });\n\n describe('dirty tracking', () => {\n test('starts with no dirty files', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n expect(accessors.isDirty()).toBe(false);\n expect(accessors.getDirtyPaths()).toEqual([]);\n });\n\n test('marks files as dirty after modification', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const newContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/collection1.json', newContent).orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n expect(accessors.getDirtyPaths()).toContain('/data/ingredients/collection1.json');\n });\n\n test('tracks multiple dirty files', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: {} },\n collection2: { items: {} }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n accessors\n .saveFileContents('/data/ingredients/collection2.json', JSON.stringify({ items: { b: 2 } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n expect(accessors.getDirtyPaths()).toHaveLength(2);\n });\n });\n\n describe('syncToDisk', () => {\n test('syncs modified files to storage', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({ collection1: { items: { original: true } } })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const newContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/collection1.json', newContent).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n const stored = mockStorage.getItem('test:ingredients:v1');\n expect(stored).toBeTruthy();\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(newContent);\n });\n\n test('clears dirty state after successful sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n expect(accessors.isDirty()).toBe(true);\n\n await accessors.syncToDisk();\n expect(accessors.isDirty()).toBe(false);\n expect(accessors.getDirtyPaths()).toEqual([]);\n });\n\n test('syncs multiple files to same storage key', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: { items: {} },\n collection2: { items: {} }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const content1 = JSON.stringify({ items: { a: 1 } });\n const content2 = JSON.stringify({ items: { b: 2 } });\n accessors.saveFileContents('/data/ingredients/collection1.json', content1).orThrow();\n accessors.saveFileContents('/data/ingredients/collection2.json', content2).orThrow();\n\n await accessors.syncToDisk();\n\n const stored = mockStorage.getItem('test:ingredients:v1');\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(content1);\n expect(parsed.collection2).toBe(content2);\n });\n\n test('syncs files to different storage keys', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/ing1.json', JSON.stringify({ items: { a: 1 } }))\n .orThrow();\n accessors.saveFileContents('/data/fillings/fill1.json', JSON.stringify({ items: { b: 2 } })).orThrow();\n\n await accessors.syncToDisk();\n\n const ingContent = JSON.stringify({ items: { a: 1 } });\n const fillContent = JSON.stringify({ items: { b: 2 } });\n const ingStored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n const fillStored = JSON.parse(mockStorage.getItem('test:fillings:v1')!);\n // New format: values are raw content strings\n expect(ingStored.ing1).toBe(ingContent);\n expect(fillStored.fill1).toBe(fillContent);\n });\n\n test('succeeds with no dirty files', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n }).orThrow();\n\n const result = await accessors.syncToDisk();\n expect(result).toSucceed();\n });\n\n test('preserves existing collections when syncing', async () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n existing: { items: { keep: true } },\n toModify: { items: { original: true } }\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const modifiedContent = JSON.stringify({ items: { modified: true } });\n accessors.saveFileContents('/data/ingredients/toModify.json', modifiedContent).orThrow();\n await accessors.syncToDisk();\n\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n // existing was loaded from legacy format and not modified, so it stays as legacy object\n // toModify was saved with new content, so it's now a raw string\n expect(stored.toModify).toBe(modifiedContent);\n });\n });\n\n describe('autoSync mode', () => {\n test('automatically syncs on save when enabled', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: true\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { auto: true } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(false);\n const autoContent = JSON.stringify({ items: { auto: true } });\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n // New format: values are raw content strings\n expect(stored.collection1).toBe(autoContent);\n });\n\n test('does not auto-sync when disabled', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: false\n }).orThrow();\n\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { manual: true } }))\n .orThrow();\n\n expect(accessors.isDirty()).toBe(true);\n // Storage should still have the original legacy format (not yet synced)\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n expect(stored.collection1).toEqual({ items: {} });\n });\n });\n\n describe('fileIsMutable', () => {\n test('returns persistent detail when mutable', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n expect(accessors.fileIsMutable('/data/ingredients/collection1.json')).toSucceedWithDetail(\n true,\n 'persistent'\n );\n });\n\n test('returns not-mutable when not mutable', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: false\n }).orThrow();\n\n const result = accessors.fileIsMutable('/data/ingredients/collection1.json');\n expect(result.isFailure()).toBe(true);\n if (result.isFailure()) {\n expect(result.detail).toBe('not-mutable');\n }\n });\n });\n\n describe('integration with FileApiTreeAccessors', () => {\n test('createFromLocalStorage creates FileTree with persistent accessors', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n });\n\n expect(result).toSucceed();\n\n const tree = result.orThrow();\n expect(tree).toBeInstanceOf(FileTree.FileTree);\n expect(FileTree.isPersistentAccessors(tree.hal)).toBe(true);\n\n const file = tree.getFile('/data/ingredients/collection1.json').orThrow();\n expect(FileTree.isMutableFileItem(file)).toBe(true);\n if (FileTree.isMutableFileItem(file)) {\n expect(file.getIsMutable()).toSucceedWithDetail(true, 'persistent');\n }\n });\n\n test('createFromLocalStorage with multiple paths', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ ing1: { items: {} } }));\n mockStorage.setItem('test:fillings:v1', JSON.stringify({ fill1: { items: {} } }));\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1',\n '/data/fillings': 'test:fillings:v1'\n },\n storage: mockStorage,\n mutable: true\n });\n\n expect(result).toSucceedAndSatisfy((tree) => {\n expect(tree.getFile('/data/ingredients/ing1.json')).toSucceed();\n expect(tree.getFile('/data/fillings/fill1.json')).toSucceed();\n });\n });\n\n test('createFromLocalStorage with empty storage', () => {\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage\n });\n\n expect(result).toSucceedAndSatisfy((tree) => {\n expect(tree).toBeInstanceOf(FileTree.FileTree);\n });\n });\n\n test('createFromLocalStorage fails when localStorage is not available', () => {\n // Remove the global window object to ensure no fallback\n const originalWindow = (global as any).window;\n delete (global as any).window;\n\n const result = FileApiTreeAccessors.createFromLocalStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: undefined\n });\n\n // Restore window\n (global as any).window = originalWindow;\n\n expect(result).toFailWith(/localStorage is not available/i);\n });\n });\n\n describe('path matching and error handling', () => {\n test('handles files outside configured paths', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Try to save a file outside the configured path\n const saveResult = accessors.saveFileContents('/other/path/file.json', JSON.stringify({ test: 1 }));\n expect(saveResult).toSucceed();\n\n // But syncing should fail because no storage key is configured\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/No storage key configured for path/i);\n });\n\n test('handles files inside configured paths', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Save a file inside the configured path\n accessors.saveFileContents('/data/ingredients/newfile.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Syncing should succeed\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n });\n\n test('handles failed content retrieval during sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Modify a file\n accessors.saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Override getFileContents to fail\n const originalGetFileContents = accessors.getFileContents.bind(accessors);\n accessors.getFileContents = jest.fn((path: string) => {\n if (path === '/data/ingredients/collection1.json') {\n return { isSuccess: () => false, isFailure: () => true, message: 'File not found' } as any;\n }\n return originalGetFileContents(path);\n });\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/Failed to get file contents.*File not found/i);\n });\n\n test('handles corrupted JSON in localStorage during sync', async () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Modify a file\n accessors.saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ test: 1 })).orThrow();\n\n // Corrupt the existing storage data\n mockStorage.setItem('test:ingredients:v1', 'not valid json');\n\n // Sync should still succeed by starting fresh\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n // Verify the data was written correctly despite corrupted previous data\n const stored = mockStorage.getItem('test:ingredients:v1');\n const parsed = JSON.parse(stored!);\n // New format: values are raw content strings\n expect(parsed.collection1).toBe(JSON.stringify({ test: 1 }));\n });\n\n test('syncs non-JSON content (YAML) without error', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Create and save a YAML file\n const yamlContent = 'metadata:\\n name: test\\nitems: {}';\n accessors.saveFileContents('/data/ingredients/my-collection.yaml', yamlContent).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n const stored = JSON.parse(mockStorage.getItem('test:ingredients:v1')!);\n expect(stored['my-collection']).toBe(yamlContent);\n });\n\n test('handles multiple sync failures with aggregated errors', async () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Add files outside configured paths\n accessors.saveFileContents('/other1/file1.json', JSON.stringify({ test: 1 })).orThrow();\n accessors.saveFileContents('/other2/file2.json', JSON.stringify({ test: 2 })).orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toFailWith(/Failed to sync 2 file\\(s\\)/i);\n });\n\n test('handles auto-sync failure', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: { items: {} } }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true,\n autoSync: true\n }).orThrow();\n\n // Try to save a file outside configured path with autoSync enabled\n const saveResult = accessors.saveFileContents('/other/path/file.json', JSON.stringify({ test: 1 }));\n expect(saveResult).toFailWith(/No storage key configured for path/i);\n });\n });\n\n describe('deleteFile', () => {\n test('deletes a file from in-memory storage and from localStorage', () => {\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n collection1: '{\"items\":{}}',\n collection2: '{\"items\":{}}'\n })\n );\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const result = accessors.deleteFile('/data/ingredients/collection1.json');\n expect(result).toSucceedWith(true);\n\n // File should no longer be accessible in-memory\n expect(accessors.getFileContents('/data/ingredients/collection1.json')).toFail();\n\n // The deleted collection should be removed from localStorage; collection2 remains\n const stored = mockStorage.getItem('test:ingredients:v1');\n expect(stored).toBeTruthy();\n const parsed = JSON.parse(stored!);\n expect(parsed).not.toHaveProperty('collection1');\n expect(parsed).toHaveProperty('collection2');\n });\n\n test('removes the storage key entirely when last entry is deleted', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ onlyCollection: '{\"items\":{}}' }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const result = accessors.deleteFile('/data/ingredients/onlyCollection.json');\n expect(result).toSucceedWith(true);\n\n // Storage key should be removed entirely since no more entries remain\n expect(mockStorage.getItem('test:ingredients:v1')).toBeNull();\n });\n\n test('removes path from dirty set when deleting a dirty file', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: '{\"items\":{}}' }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Mark file as dirty first\n accessors\n .saveFileContents('/data/ingredients/collection1.json', JSON.stringify({ items: { modified: true } }))\n .orThrow();\n expect(accessors.isDirty()).toBe(true);\n\n // Deleting the file should clean it from the dirty set\n const result = accessors.deleteFile('/data/ingredients/collection1.json');\n expect(result).toSucceedWith(true);\n expect(accessors.isDirty()).toBe(false);\n expect(accessors.getDirtyPaths()).not.toContain('/data/ingredients/collection1.json');\n });\n\n test('fails when deleting a non-existent file', () => {\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const result = accessors.deleteFile('/data/ingredients/nonexistent.json');\n expect(result).toFail();\n });\n\n test('does not modify storage when file has no matching storage key', () => {\n // Create accessors with one path, but a file that will be stored outside that path\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Add and delete a file inside the configured path but with no existing storage entry\n accessors.saveFileContents('/data/ingredients/newfile.json', '{\"items\":{}}').orThrow();\n // Sync so it exists in storage\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ newfile: '{\"items\":{}}' }));\n\n // Now re-load and delete — the file should be removed from storage\n const accessors2 = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n const result = accessors2.deleteFile('/data/ingredients/newfile.json');\n expect(result).toSucceedWith(true);\n expect(mockStorage.getItem('test:ingredients:v1')).toBeNull();\n });\n\n test('handles deletion when localStorage key has no entry for the file', () => {\n // Storage key exists but does not contain an entry for the file being deleted\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ other: '{\"items\":{}}' }));\n\n // Manually add a file to in-memory without it being in the storage JSON\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Save a new file (marks dirty but does not update storage yet)\n accessors.saveFileContents('/data/ingredients/newfile.json', '{\"items\":{}}').orThrow();\n\n // Clear the dirty flag by directly removing from storage (simulate storage mismatch)\n // Then delete the file — _deleteFileFromStorage gets the existing JSON which lacks 'newfile'\n // This exercises the path where the collection is not in the existing JSON\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ other: '{\"items\":{}}' }));\n\n const result = accessors.deleteFile('/data/ingredients/newfile.json');\n expect(result).toSucceedWith(true);\n\n // 'other' should still remain in storage since only 'newfile' was deleted (which wasn't there)\n const stored = mockStorage.getItem('test:ingredients:v1');\n expect(stored).toBeTruthy();\n const parsed = JSON.parse(stored!);\n expect(parsed).toHaveProperty('other');\n });\n\n test('handles deletion when storage entry for key is missing entirely', () => {\n // No storage key at all — _deleteFileFromStorage should return early\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Manually put a file in memory by saving it\n accessors.saveFileContents('/data/ingredients/newfile.json', '{\"items\":{}}').orThrow();\n\n // Delete the storage key so getItem returns null\n mockStorage.removeItem('test:ingredients:v1');\n\n // deleteFile should still succeed (in-memory deletion succeeds; storage cleanup is a no-op)\n const result = accessors.deleteFile('/data/ingredients/newfile.json');\n expect(result).toSucceedWith(true);\n });\n\n test('handles deletion when storage contains corrupted JSON', () => {\n mockStorage.setItem('test:ingredients:v1', JSON.stringify({ collection1: '{\"items\":{}}' }));\n\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Corrupt the storage so JSON.parse fails in _deleteFileFromStorage\n mockStorage.setItem('test:ingredients:v1', 'not valid json {{{');\n\n // deleteFile should still succeed — corrupted JSON is silently ignored\n const result = accessors.deleteFile('/data/ingredients/collection1.json');\n expect(result).toSucceedWith(true);\n });\n\n test('deletes a file at a path outside all configured storage keys', () => {\n // A file can be saved in-memory at a path that has no matching storage key.\n // When deleted, _deleteFileFromStorage should return early without touching storage.\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Save a file outside the configured path (succeeds in-memory, marks dirty)\n accessors.saveFileContents('/untracked/file.json', '{\"items\":{}}').orThrow();\n\n // Delete it — should succeed even though there is no storage key for this path\n const result = accessors.deleteFile('/untracked/file.json');\n expect(result).toSucceedWith(true);\n\n // Storage should be untouched\n expect(mockStorage.getItem('test:ingredients:v1')).toBeNull();\n });\n });\n\n describe('inferContentType callback in _loadFromStorage', () => {\n test('calls inferContentType when loading files from storage', () => {\n // Covers lines 163-164: the params.inferContentType branch in _loadFromStorage\n mockStorage.setItem(\n 'test:ingredients:v1',\n JSON.stringify({\n myCollection: '{\"items\":{}}'\n })\n );\n\n const inferContentType = jest.fn((filePath: string, _provided: string | undefined) => {\n const { succeed: s } = require('@fgv/ts-utils') as typeof import('@fgv/ts-utils');\n return s('application/json' as string);\n });\n\n const result = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n inferContentType\n });\n\n expect(result).toSucceed();\n expect(inferContentType).toHaveBeenCalledWith('/data/ingredients/myCollection.json', undefined);\n });\n });\n\n describe('extension-less file path handling', () => {\n test('syncs a file whose path has no extension (collection ID has no dot)', async () => {\n // Covers line 249: dotIndex <= 0 case in _getCollectionIdFromPath, returning cleanPath as-is\n // We save a file at a path with no file extension; the collection ID extracted\n // will be the entire basename (no dot to strip).\n const accessors = LocalStorageTreeAccessors.fromStorage({\n pathToKeyMap: {\n '/data/ingredients': 'test:ingredients:v1'\n },\n storage: mockStorage,\n mutable: true\n }).orThrow();\n\n // Save a file at a path with no extension\n accessors.saveFileContents('/data/ingredients/nodot', '{\"items\":{}}').orThrow();\n\n const syncResult = await accessors.syncToDisk();\n expect(syncResult).toSucceed();\n\n // The collection ID stored in localStorage should be 'nodot' (no extension stripped)\n const stored = mockStorage.getItem('test:ingredients:v1');\n expect(stored).toBeTruthy();\n const parsed = JSON.parse(stored!) as Record<string, unknown>;\n expect(parsed.nodot).toBe('{\"items\":{}}');\n });\n });\n});\n"]}
@@ -12,6 +12,7 @@
12
12
  import { CryptoUtils as CryptoUtils_2 } from '@fgv/ts-extras';
13
13
  import { DetailedResult } from '@fgv/ts-utils';
14
14
  import { FileTree } from '@fgv/ts-json-base';
15
+ import { Logging } from '@fgv/ts-utils';
15
16
  import { Result } from '@fgv/ts-utils';
16
17
 
17
18
  /**
@@ -245,6 +246,14 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
245
246
  * @public
246
247
  */
247
248
  static createPersistent<TCT extends string = string>(dirHandle: FileSystemDirectoryHandle_2, params?: IFileSystemAccessTreeParams<TCT>): Promise<Result<FileTree.FileTree<TCT>>>;
249
+ /**
250
+ * Create a persistent FileTree from an HTTP storage service.
251
+ *
252
+ * @param params - Configuration including API base URL, namespace, and optional autoSync
253
+ * @returns Promise resolving to a FileTree with persistence capability
254
+ * @public
255
+ */
256
+ static createFromHttp<TCT extends string = string>(params: IHttpTreeParams<TCT>): Promise<Result<FileTree.FileTree<TCT>>>;
248
257
  /**
249
258
  * Create a persistent FileTree from a single File System Access API file handle.
250
259
  * The tree contains exactly one file at `/<filename>`.
@@ -382,8 +391,10 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
382
391
  private readonly _handles;
383
392
  private readonly _rootDir;
384
393
  private readonly _dirtyFiles;
394
+ private readonly _pendingDeletions;
385
395
  private readonly _autoSync;
386
396
  private readonly _hasWritePermission;
397
+ private readonly _logger;
387
398
  /**
388
399
  * Protected constructor for FileSystemAccessTreeAccessors.
389
400
  * @param files - An array of in-memory files to include in the tree.
@@ -393,6 +404,7 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
393
404
  * @param hasWritePermission - Whether write permission was granted.
394
405
  */
395
406
  protected constructor(files: FileTree.IInMemoryFile<TCT>[], rootDir: FileSystemDirectoryHandle_2, handles: Map<string, FileSystemFileHandle_2>, params: IFileSystemAccessTreeParams<TCT> | undefined, hasWritePermission: boolean);
407
+ private _runAutoSyncTask;
396
408
  /**
397
409
  * Creates a new FileSystemAccessTreeAccessors instance from a directory handle.
398
410
  * @param dirHandle - The FileSystemDirectoryHandle to load files from.
@@ -457,6 +469,10 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
457
469
  * Implements `FileTree.IPersistentFileTreeAccessors.getDirtyPaths`
458
470
  */
459
471
  getDirtyPaths(): string[];
472
+ /**
473
+ * Override deleteFile to track pending deletions for syncToDisk.
474
+ */
475
+ deleteFile(path: string): Result<boolean>;
460
476
  /**
461
477
  * Implements `FileTree.IMutableFileTreeAccessors.saveFileContents`
462
478
  */
@@ -472,6 +488,13 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
472
488
  * @internal
473
489
  */
474
490
  private _syncFile;
491
+ /**
492
+ * Delete a file from disk using the File System Access API.
493
+ * @param path - The path of the file to delete.
494
+ * @returns Promise resolving to success or failure.
495
+ * @internal
496
+ */
497
+ private _deleteFileFromDisk;
475
498
  /**
476
499
  * Create a new file and write its contents.
477
500
  * @param path - The path of the file to create.
@@ -628,6 +651,94 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
628
651
  */
629
652
  declare function getOriginalFile(fileList: FileList, path: string): Result<File>;
630
653
 
654
+ /**
655
+ * HTTP-backed file tree accessors that cache data in memory and persist via REST API.
656
+ * @public
657
+ */
658
+ export declare class HttpTreeAccessors<TCT extends string = string> extends FileTree.InMemoryTreeAccessors<TCT> implements FileTree.IPersistentFileTreeAccessors<TCT> {
659
+ private readonly _baseUrl;
660
+ private readonly _namespace;
661
+ private readonly _fetchImpl;
662
+ private readonly _dirtyFiles;
663
+ private readonly _pendingDeletions;
664
+ private readonly _autoSync;
665
+ private readonly _userId;
666
+ private readonly _logger;
667
+ /** Guards against concurrent syncToDisk calls (thundering herd from autoSync). */
668
+ private _syncPromise;
669
+ private constructor();
670
+ private _runAutoSyncTask;
671
+ /**
672
+ * Creates a new HttpTreeAccessors instance from an HTTP backend.
673
+ * @param params - Configuration parameters for the HTTP tree accessors.
674
+ * @returns A promise that resolves to a result containing the new HttpTreeAccessors instance or an error message.
675
+ */
676
+ static fromHttp<TCT extends string = string>(params: IHttpTreeParams<TCT>): Promise<Result<HttpTreeAccessors<TCT>>>;
677
+ /**
678
+ * Synchronizes all dirty files to the HTTP backend.
679
+ *
680
+ * Uses a concurrency guard: if a sync is already in progress, callers
681
+ * await the existing operation rather than starting a parallel one.
682
+ * This prevents the thundering herd that occurs when autoSync fires
683
+ * for every file written during a bulk operation (e.g. restore).
684
+ *
685
+ * @returns A promise that resolves to a result indicating success or failure.
686
+ */
687
+ syncToDisk(): Promise<Result<void>>;
688
+ private _doSync;
689
+ /**
690
+ * Checks if there are any dirty files that need synchronization.
691
+ * @returns True if there are dirty files, false otherwise.
692
+ */
693
+ isDirty(): boolean;
694
+ /**
695
+ * Gets the list of paths for all dirty files.
696
+ * @returns An array of file paths that have been modified but not yet synchronized.
697
+ */
698
+ getDirtyPaths(): string[];
699
+ deleteFile(path: string): Result<boolean>;
700
+ /**
701
+ * Saves file contents and marks the file as dirty for synchronization.
702
+ * @param path - The path to the file.
703
+ * @param contents - The new contents of the file.
704
+ * @returns A result indicating success or failure.
705
+ */
706
+ saveFileContents(path: string, contents: string): Result<string>;
707
+ /**
708
+ * Checks if a file is mutable (can be modified).
709
+ * @param path - The path to the file.
710
+ * @returns A detailed result indicating if the file is mutable and the reason.
711
+ */
712
+ fileIsMutable(path: string): DetailedResult<boolean, FileTree.SaveDetail>;
713
+ /**
714
+ * Makes an HTTP request to the specified resource path.
715
+ * @param resourcePath - The path to the resource.
716
+ * @param init - Optional request initialization options.
717
+ * @returns A promise that resolves to a result containing the response data or an error message.
718
+ */
719
+ private _request;
720
+ /**
721
+ * Wraps `_request` with retry logic for transient failures
722
+ * (network errors, 503 service unavailable, etc.).
723
+ */
724
+ private _requestWithRetry;
725
+ /**
726
+ * Loads files from the HTTP backend for the specified directory path.
727
+ * @param params - Configuration parameters for the HTTP tree accessors.
728
+ * @param directoryPath - The path to the directory to load files from.
729
+ * @returns A promise that resolves to a result containing the loaded files or an error message.
730
+ */
731
+ private static _loadFiles;
732
+ /**
733
+ * Makes an HTTP request with query parameters to the specified resource path.
734
+ * @param params - Configuration parameters for the HTTP tree accessors.
735
+ * @param resourcePath - The path to the resource.
736
+ * @param query - Query parameters to include in the request.
737
+ * @returns A promise that resolves to a result containing the response data or an error message.
738
+ */
739
+ private static _requestWithParams;
740
+ }
741
+
631
742
  declare type ICryptoProvider = CryptoUtils_2.ICryptoProvider;
632
743
 
633
744
  /**
@@ -695,6 +806,8 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
695
806
  * If omitted, defaults to `/<filename>`.
696
807
  */
697
808
  filePath?: string;
809
+ /** Optional logger for auto-sync and persistence failures. */
810
+ logger?: Logging.LogReporter<unknown>;
698
811
  }
699
812
 
700
813
  /**
@@ -707,6 +820,19 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
707
820
  showSaveFilePicker(options?: ShowSaveFilePickerOptions): Promise<FileSystemFileHandle_2>;
708
821
  }
709
822
 
823
+ /**
824
+ * Configuration for creating HTTP-backed tree accessors.
825
+ * @public
826
+ */
827
+ export declare interface IHttpTreeParams<TCT extends string = string> extends FileTree.IFileTreeInitParams<TCT> {
828
+ readonly baseUrl: string;
829
+ readonly namespace?: string;
830
+ readonly autoSync?: boolean;
831
+ readonly fetchImpl?: typeof fetch;
832
+ readonly userId?: string;
833
+ readonly logger?: Logging.LogReporter<unknown>;
834
+ }
835
+
710
836
  /**
711
837
  * Configuration for LocalStorageTreeAccessors.
712
838
  * @public
@@ -876,6 +1002,11 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
876
1002
  * @internal
877
1003
  */
878
1004
  private _getCollectionIdFromPath;
1005
+ /**
1006
+ * Remove a file's entry from its localStorage key.
1007
+ * @internal
1008
+ */
1009
+ private _deleteFileFromStorage;
879
1010
  /**
880
1011
  * Sync a single dirty file to localStorage.
881
1012
  * @internal
@@ -899,6 +1030,13 @@ declare function extractFileListMetadata(fileList: FileList): Array<IFileMetadat
899
1030
  * @public
900
1031
  */
901
1032
  getDirtyPaths(): string[];
1033
+ /**
1034
+ * Delete a file and remove it from localStorage.
1035
+ * @param path - File path to delete
1036
+ * @returns Result with true if deleted, or error
1037
+ * @public
1038
+ */
1039
+ deleteFile(path: string): Result<boolean>;
902
1040
  /**
903
1041
  * Save file contents. Marks file as dirty and optionally auto-syncs.
904
1042
  * @param path - File path
@@ -0,0 +1,18 @@
1
+ [**@fgv/ts-web-extras**](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@fgv/ts-web-extras](../../../README.md) / CryptoUtils
6
+
7
+ # CryptoUtils
8
+
9
+ Browser-compatible cryptographic utilities using the Web Crypto API.
10
+
11
+ ## Classes
12
+
13
+ - [BrowserCryptoProvider](classes/BrowserCryptoProvider.md)
14
+ - [BrowserHashProvider](classes/BrowserHashProvider.md)
15
+
16
+ ## Functions
17
+
18
+ - [createBrowserCryptoProvider](functions/createBrowserCryptoProvider.md)