@fgv/ts-web-extras 5.1.0-1 → 5.1.0-11

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 (286) hide show
  1. package/.rush/temp/63a2c58f11944fdb592459d835a6483c79343b3f.tar.log +237 -0
  2. package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +19 -39
  3. package/.rush/temp/operation/build/all.log +19 -39
  4. package/.rush/temp/operation/build/log-chunks.jsonl +19 -39
  5. package/.rush/temp/operation/build/state.json +1 -1
  6. package/.rush/temp/shrinkwrap-deps.json +690 -633
  7. package/config/typedoc.json +2 -1
  8. package/dist/packlets/file-tree/httpTreeAccessors.js +128 -41
  9. package/dist/packlets/file-tree/httpTreeAccessors.js.map +1 -1
  10. package/dist/test/unit/httpTreeAccessors.test.js +438 -74
  11. package/dist/test/unit/httpTreeAccessors.test.js.map +1 -1
  12. package/dist/ts-web-extras.d.ts +20 -0
  13. package/dist/tsdoc-metadata.json +1 -1
  14. package/docs/CryptoUtils/README.md +60 -0
  15. package/docs/CryptoUtils/classes/BrowserCryptoProvider.decrypt.md +27 -0
  16. package/docs/CryptoUtils/classes/BrowserCryptoProvider.deriveKey.md +26 -0
  17. package/docs/CryptoUtils/classes/BrowserCryptoProvider.encrypt.md +25 -0
  18. package/docs/CryptoUtils/classes/BrowserCryptoProvider.fromBase64.md +24 -0
  19. package/docs/CryptoUtils/classes/BrowserCryptoProvider.generateKey.md +17 -0
  20. package/docs/CryptoUtils/classes/BrowserCryptoProvider.generateRandomBytes.md +24 -0
  21. package/docs/CryptoUtils/classes/BrowserCryptoProvider.md +151 -0
  22. package/docs/CryptoUtils/classes/BrowserCryptoProvider.toBase64.md +24 -0
  23. package/docs/CryptoUtils/classes/BrowserHashProvider.hashParts.md +26 -0
  24. package/docs/CryptoUtils/classes/BrowserHashProvider.hashString.md +25 -0
  25. package/docs/CryptoUtils/classes/BrowserHashProvider.md +81 -0
  26. package/docs/CryptoUtils/functions/createBrowserCryptoProvider.md +12 -0
  27. package/docs/FileTreeHelpers/README.md +85 -0
  28. package/docs/FileTreeHelpers/functions/extractFileListMetadata.md +11 -0
  29. package/docs/FileTreeHelpers/functions/extractFileMetadata.md +11 -0
  30. package/docs/FileTreeHelpers/functions/fromDirectoryUpload.md +12 -0
  31. package/docs/FileTreeHelpers/functions/fromFileList.md +12 -0
  32. package/docs/FileTreeHelpers/functions/getOriginalFile.md +11 -0
  33. package/docs/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +9 -0
  34. package/docs/README.md +499 -53
  35. package/docs/classes/BrowserCryptoProvider.decrypt.md +27 -0
  36. package/docs/classes/BrowserCryptoProvider.deriveKey.md +26 -0
  37. package/docs/classes/BrowserCryptoProvider.encrypt.md +25 -0
  38. package/docs/classes/BrowserCryptoProvider.fromBase64.md +24 -0
  39. package/docs/classes/BrowserCryptoProvider.generateKey.md +17 -0
  40. package/docs/classes/BrowserCryptoProvider.generateRandomBytes.md +24 -0
  41. package/docs/classes/BrowserCryptoProvider.md +151 -0
  42. package/docs/classes/BrowserCryptoProvider.toBase64.md +24 -0
  43. package/docs/classes/BrowserHashProvider.hashParts.md +26 -0
  44. package/docs/classes/BrowserHashProvider.hashString.md +25 -0
  45. package/docs/classes/BrowserHashProvider.md +81 -0
  46. package/docs/classes/DirectoryHandleStore.getAll.md +17 -0
  47. package/docs/classes/DirectoryHandleStore.getAllLabels.md +17 -0
  48. package/docs/classes/DirectoryHandleStore.load.md +24 -0
  49. package/docs/classes/DirectoryHandleStore.md +65 -61
  50. package/docs/classes/DirectoryHandleStore.remove.md +24 -0
  51. package/docs/classes/DirectoryHandleStore.save.md +25 -0
  52. package/docs/classes/FileApiTreeAccessors.create.md +25 -0
  53. package/docs/classes/FileApiTreeAccessors.createFromHttp.md +24 -0
  54. package/docs/classes/FileApiTreeAccessors.createFromLocalStorage.md +25 -0
  55. package/docs/classes/FileApiTreeAccessors.createPersistent.md +26 -0
  56. package/docs/classes/FileApiTreeAccessors.createPersistentFromFile.md +27 -0
  57. package/docs/classes/FileApiTreeAccessors.extractFileMetadata.md +24 -0
  58. package/docs/classes/FileApiTreeAccessors.fromDirectoryUpload.md +25 -0
  59. package/docs/classes/FileApiTreeAccessors.fromFileList.md +25 -0
  60. package/docs/classes/FileApiTreeAccessors.getOriginalFile.md +27 -0
  61. package/docs/classes/FileApiTreeAccessors.md +87 -201
  62. package/docs/classes/FileSystemAccessTreeAccessors.deleteFile.md +22 -0
  63. package/docs/classes/FileSystemAccessTreeAccessors.fileIsMutable.md +22 -0
  64. package/docs/classes/FileSystemAccessTreeAccessors.fromDirectoryHandle.md +25 -0
  65. package/docs/classes/FileSystemAccessTreeAccessors.fromFileHandle.md +29 -0
  66. package/docs/classes/FileSystemAccessTreeAccessors.getDirtyPaths.md +15 -0
  67. package/docs/classes/FileSystemAccessTreeAccessors.isDirty.md +15 -0
  68. package/docs/classes/FileSystemAccessTreeAccessors.md +128 -410
  69. package/docs/classes/FileSystemAccessTreeAccessors.saveFileContents.md +23 -0
  70. package/docs/classes/FileSystemAccessTreeAccessors.syncToDisk.md +15 -0
  71. package/docs/classes/HttpTreeAccessors.deleteFile.md +22 -0
  72. package/docs/classes/HttpTreeAccessors.fileIsMutable.md +24 -0
  73. package/docs/classes/HttpTreeAccessors.fromHttp.md +24 -0
  74. package/docs/classes/HttpTreeAccessors.getDirtyPaths.md +17 -0
  75. package/docs/classes/HttpTreeAccessors.isDirty.md +17 -0
  76. package/docs/classes/HttpTreeAccessors.md +121 -368
  77. package/docs/classes/HttpTreeAccessors.saveFileContents.md +25 -0
  78. package/docs/classes/HttpTreeAccessors.syncToDisk.md +22 -0
  79. package/docs/classes/LocalStorageTreeAccessors.deleteFile.md +24 -0
  80. package/docs/classes/LocalStorageTreeAccessors.fileIsMutable.md +24 -0
  81. package/docs/classes/LocalStorageTreeAccessors.fromStorage.md +25 -0
  82. package/docs/classes/LocalStorageTreeAccessors.getDirtyPaths.md +17 -0
  83. package/docs/classes/LocalStorageTreeAccessors.isDirty.md +17 -0
  84. package/docs/classes/LocalStorageTreeAccessors.md +121 -371
  85. package/docs/classes/LocalStorageTreeAccessors.saveFileContents.md +25 -0
  86. package/docs/classes/LocalStorageTreeAccessors.syncToDisk.md +17 -0
  87. package/docs/functions/createBrowserCryptoProvider.md +12 -0
  88. package/docs/functions/exportAsJson.md +6 -17
  89. package/docs/functions/exportUsingFileSystemAPI.md +6 -21
  90. package/docs/functions/extractDirectoryPath.md +6 -16
  91. package/docs/functions/extractFileListMetadata.md +11 -0
  92. package/docs/functions/extractFileMetadata.md +11 -0
  93. package/docs/functions/fromDirectoryUpload.md +12 -0
  94. package/docs/functions/fromFileList.md +12 -0
  95. package/docs/functions/getOriginalFile.md +11 -0
  96. package/docs/functions/isDirectoryHandle.md +6 -18
  97. package/docs/functions/isFileHandle.md +6 -18
  98. package/docs/functions/isFilePath.md +6 -16
  99. package/docs/functions/parseContextFilter.md +6 -16
  100. package/docs/functions/parseQualifierDefaults.md +6 -16
  101. package/docs/functions/parseResourceTypes.md +6 -16
  102. package/docs/functions/parseUrlParameters.md +6 -10
  103. package/docs/functions/safeShowDirectoryPicker.md +6 -19
  104. package/docs/functions/safeShowOpenFilePicker.md +6 -19
  105. package/docs/functions/safeShowSaveFilePicker.md +6 -19
  106. package/docs/functions/supportsFileSystemAccess.md +6 -18
  107. package/docs/interfaces/FilePickerAcceptType.accept.md +9 -0
  108. package/docs/interfaces/FilePickerAcceptType.description.md +9 -0
  109. package/docs/interfaces/FilePickerAcceptType.md +54 -9
  110. package/docs/interfaces/FileSystemCreateWritableOptions.keepExistingData.md +9 -0
  111. package/docs/interfaces/FileSystemCreateWritableOptions.md +37 -8
  112. package/docs/interfaces/FileSystemDirectoryHandle._asyncIterator_.md +13 -0
  113. package/docs/interfaces/FileSystemDirectoryHandle.entries.md +13 -0
  114. package/docs/interfaces/FileSystemDirectoryHandle.getDirectoryHandle.md +21 -0
  115. package/docs/interfaces/FileSystemDirectoryHandle.getFileHandle.md +21 -0
  116. package/docs/interfaces/FileSystemDirectoryHandle.keys.md +13 -0
  117. package/docs/interfaces/FileSystemDirectoryHandle.kind.md +9 -0
  118. package/docs/interfaces/FileSystemDirectoryHandle.md +140 -103
  119. package/docs/interfaces/FileSystemDirectoryHandle.removeEntry.md +21 -0
  120. package/docs/interfaces/FileSystemDirectoryHandle.resolve.md +20 -0
  121. package/docs/interfaces/FileSystemDirectoryHandle.values.md +13 -0
  122. package/docs/interfaces/FileSystemFileHandle.createWritable.md +20 -0
  123. package/docs/interfaces/FileSystemFileHandle.getFile.md +13 -0
  124. package/docs/interfaces/FileSystemFileHandle.kind.md +9 -0
  125. package/docs/interfaces/FileSystemFileHandle.md +98 -58
  126. package/docs/interfaces/FileSystemGetDirectoryOptions.create.md +9 -0
  127. package/docs/interfaces/FileSystemGetDirectoryOptions.md +37 -8
  128. package/docs/interfaces/FileSystemGetFileOptions.create.md +9 -0
  129. package/docs/interfaces/FileSystemGetFileOptions.md +37 -8
  130. package/docs/interfaces/FileSystemHandle.isSameEntry.md +20 -0
  131. package/docs/interfaces/FileSystemHandle.kind.md +9 -0
  132. package/docs/interfaces/FileSystemHandle.md +88 -39
  133. package/docs/interfaces/FileSystemHandle.name.md +9 -0
  134. package/docs/interfaces/FileSystemHandle.queryPermission.md +20 -0
  135. package/docs/interfaces/FileSystemHandle.requestPermission.md +20 -0
  136. package/docs/interfaces/FileSystemHandlePermissionDescriptor.md +37 -8
  137. package/docs/interfaces/FileSystemHandlePermissionDescriptor.mode.md +9 -0
  138. package/docs/interfaces/FileSystemRemoveOptions.md +37 -8
  139. package/docs/interfaces/FileSystemRemoveOptions.recursive.md +9 -0
  140. package/docs/interfaces/FileSystemWritableFileStream.md +83 -68
  141. package/docs/interfaces/FileSystemWritableFileStream.seek.md +20 -0
  142. package/docs/interfaces/FileSystemWritableFileStream.truncate.md +20 -0
  143. package/docs/interfaces/FileSystemWritableFileStream.write.md +20 -0
  144. package/docs/interfaces/IDirectoryHandleTreeInitializer.dirHandles.md +9 -0
  145. package/docs/interfaces/IDirectoryHandleTreeInitializer.md +71 -10
  146. package/docs/interfaces/IDirectoryHandleTreeInitializer.nonRecursive.md +9 -0
  147. package/docs/interfaces/IDirectoryHandleTreeInitializer.prefix.md +9 -0
  148. package/docs/interfaces/IFileHandleTreeInitializer.fileHandles.md +9 -0
  149. package/docs/interfaces/IFileHandleTreeInitializer.md +54 -9
  150. package/docs/interfaces/IFileHandleTreeInitializer.prefix.md +9 -0
  151. package/docs/interfaces/IFileListTreeInitializer.fileList.md +9 -0
  152. package/docs/interfaces/IFileListTreeInitializer.md +37 -8
  153. package/docs/interfaces/IFileMetadata.lastModified.md +9 -0
  154. package/docs/interfaces/IFileMetadata.md +105 -12
  155. package/docs/interfaces/IFileMetadata.name.md +9 -0
  156. package/docs/interfaces/IFileMetadata.path.md +9 -0
  157. package/docs/interfaces/IFileMetadata.size.md +9 -0
  158. package/docs/interfaces/IFileMetadata.type.md +9 -0
  159. package/docs/interfaces/IFileSystemAccessTreeParams.autoSync.md +12 -0
  160. package/docs/interfaces/IFileSystemAccessTreeParams.filePath.md +13 -0
  161. package/docs/interfaces/IFileSystemAccessTreeParams.logger.md +11 -0
  162. package/docs/interfaces/IFileSystemAccessTreeParams.md +138 -20
  163. package/docs/interfaces/IFileSystemAccessTreeParams.requireWritePermission.md +13 -0
  164. package/docs/interfaces/IFsAccessApis.md +36 -31
  165. package/docs/interfaces/IFsAccessApis.showDirectoryPicker.md +20 -0
  166. package/docs/interfaces/IFsAccessApis.showOpenFilePicker.md +20 -0
  167. package/docs/interfaces/IFsAccessApis.showSaveFilePicker.md +20 -0
  168. package/docs/interfaces/IHttpTreeParams.autoSync.md +9 -0
  169. package/docs/interfaces/IHttpTreeParams.baseUrl.md +9 -0
  170. package/docs/interfaces/IHttpTreeParams.fetchImpl.md +9 -0
  171. package/docs/interfaces/IHttpTreeParams.logger.md +9 -0
  172. package/docs/interfaces/IHttpTreeParams.md +172 -22
  173. package/docs/interfaces/IHttpTreeParams.namespace.md +9 -0
  174. package/docs/interfaces/IHttpTreeParams.userId.md +9 -0
  175. package/docs/interfaces/ILocalStorageTreeParams.autoSync.md +12 -0
  176. package/docs/interfaces/ILocalStorageTreeParams.md +121 -20
  177. package/docs/interfaces/ILocalStorageTreeParams.pathToKeyMap.md +13 -0
  178. package/docs/interfaces/ILocalStorageTreeParams.storage.md +12 -0
  179. package/docs/interfaces/IUrlConfigOptions.config.md +11 -0
  180. package/docs/interfaces/IUrlConfigOptions.configStartDir.md +11 -0
  181. package/docs/interfaces/IUrlConfigOptions.contextFilter.md +11 -0
  182. package/docs/interfaces/IUrlConfigOptions.input.md +11 -0
  183. package/docs/interfaces/IUrlConfigOptions.inputStartDir.md +11 -0
  184. package/docs/interfaces/IUrlConfigOptions.interactive.md +11 -0
  185. package/docs/interfaces/IUrlConfigOptions.loadZip.md +11 -0
  186. package/docs/interfaces/IUrlConfigOptions.maxDistance.md +11 -0
  187. package/docs/interfaces/IUrlConfigOptions.md +241 -20
  188. package/docs/interfaces/IUrlConfigOptions.qualifierDefaults.md +11 -0
  189. package/docs/interfaces/IUrlConfigOptions.reduceQualifiers.md +11 -0
  190. package/docs/interfaces/IUrlConfigOptions.resourceTypes.md +11 -0
  191. package/docs/interfaces/IUrlConfigOptions.zipFile.md +11 -0
  192. package/docs/interfaces/IUrlConfigOptions.zipPath.md +11 -0
  193. package/docs/interfaces/ShowDirectoryPickerOptions.id.md +9 -0
  194. package/docs/interfaces/ShowDirectoryPickerOptions.md +71 -10
  195. package/docs/interfaces/ShowDirectoryPickerOptions.mode.md +9 -0
  196. package/docs/interfaces/ShowDirectoryPickerOptions.startIn.md +9 -0
  197. package/docs/interfaces/ShowOpenFilePickerOptions.excludeAcceptAllOption.md +9 -0
  198. package/docs/interfaces/ShowOpenFilePickerOptions.id.md +9 -0
  199. package/docs/interfaces/ShowOpenFilePickerOptions.md +105 -12
  200. package/docs/interfaces/ShowOpenFilePickerOptions.multiple.md +9 -0
  201. package/docs/interfaces/ShowOpenFilePickerOptions.startIn.md +9 -0
  202. package/docs/interfaces/ShowOpenFilePickerOptions.types.md +9 -0
  203. package/docs/interfaces/ShowSaveFilePickerOptions.excludeAcceptAllOption.md +9 -0
  204. package/docs/interfaces/ShowSaveFilePickerOptions.id.md +9 -0
  205. package/docs/interfaces/ShowSaveFilePickerOptions.md +105 -12
  206. package/docs/interfaces/ShowSaveFilePickerOptions.startIn.md +9 -0
  207. package/docs/interfaces/ShowSaveFilePickerOptions.suggestedName.md +9 -0
  208. package/docs/interfaces/ShowSaveFilePickerOptions.types.md +9 -0
  209. package/docs/type-aliases/TreeInitializer.md +7 -7
  210. package/docs/type-aliases/WellKnownDirectory.md +7 -7
  211. package/docs/type-aliases/WindowWithFsAccess.md +7 -7
  212. package/docs/variables/DEFAULT_DIRECTORY_HANDLE_DB.md +5 -7
  213. package/docs/variables/DEFAULT_DIRECTORY_HANDLE_STORE.md +5 -7
  214. package/docs/variables/defaultFileApiTreeInitParams.md +9 -0
  215. package/lib/packlets/file-tree/httpTreeAccessors.d.ts +20 -0
  216. package/lib/packlets/file-tree/httpTreeAccessors.d.ts.map +1 -1
  217. package/lib/packlets/file-tree/httpTreeAccessors.js +128 -41
  218. package/lib/packlets/file-tree/httpTreeAccessors.js.map +1 -1
  219. package/lib/test/unit/httpTreeAccessors.test.js +438 -74
  220. package/lib/test/unit/httpTreeAccessors.test.js.map +1 -1
  221. package/package.json +27 -26
  222. package/rush-logs/ts-web-extras.build.cache.log +3 -0
  223. package/rush-logs/ts-web-extras.build.log +19 -39
  224. package/src/packlets/file-tree/httpTreeAccessors.ts +142 -45
  225. package/src/test/unit/httpTreeAccessors.test.ts +556 -84
  226. package/temp/build/typescript/ts_8nwakTlr.json +1 -1
  227. package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1 -1
  228. package/temp/coverage/crypto-utils/browserHashProvider.ts.html +1 -1
  229. package/temp/coverage/crypto-utils/index.html +1 -1
  230. package/temp/coverage/file-tree/directoryHandleStore.ts.html +1 -1
  231. package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +1 -1
  232. package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
  233. package/temp/coverage/file-tree/httpTreeAccessors.ts.html +507 -216
  234. package/temp/coverage/file-tree/index.html +11 -11
  235. package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1 -1
  236. package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
  237. package/temp/coverage/helpers/index.html +1 -1
  238. package/temp/coverage/index.html +11 -11
  239. package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1 -1
  240. package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +1 -1
  241. package/temp/coverage/lcov-report/crypto-utils/index.html +1 -1
  242. package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +1 -1
  243. package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +1 -1
  244. package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
  245. package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +507 -216
  246. package/temp/coverage/lcov-report/file-tree/index.html +11 -11
  247. package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1 -1
  248. package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
  249. package/temp/coverage/lcov-report/helpers/index.html +1 -1
  250. package/temp/coverage/lcov-report/index.html +11 -11
  251. package/temp/coverage/lcov-report/url-utils/index.html +1 -1
  252. package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
  253. package/temp/coverage/lcov.info +520 -387
  254. package/temp/coverage/url-utils/index.html +1 -1
  255. package/temp/coverage/url-utils/urlParams.ts.html +1 -1
  256. package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
  257. package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
  258. package/temp/ts-web-extras.api.json +2 -2
  259. package/.rush/temp/chunked-rush-logs/ts-web-extras.test.chunks.jsonl +0 -70
  260. package/.rush/temp/operation/build/error.log +0 -18
  261. package/.rush/temp/operation/test/all.log +0 -70
  262. package/.rush/temp/operation/test/error.log +0 -16
  263. package/.rush/temp/operation/test/log-chunks.jsonl +0 -70
  264. package/.rush/temp/operation/test/state.json +0 -3
  265. package/docs/@fgv/namespaces/CryptoUtils/README.md +0 -18
  266. package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserCryptoProvider.md +0 -203
  267. package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserHashProvider.md +0 -63
  268. package/docs/@fgv/namespaces/CryptoUtils/functions/createBrowserCryptoProvider.md +0 -18
  269. package/docs/@fgv/namespaces/FileTreeHelpers/README.md +0 -19
  270. package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileListMetadata.md +0 -23
  271. package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileMetadata.md +0 -23
  272. package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromDirectoryUpload.md +0 -33
  273. package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromFileList.md +0 -33
  274. package/docs/@fgv/namespaces/FileTreeHelpers/functions/getOriginalFile.md +0 -25
  275. package/docs/@fgv/namespaces/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +0 -11
  276. package/rush-logs/ts-web-extras.build.error.log +0 -18
  277. package/rush-logs/ts-web-extras.test.cache.log +0 -1
  278. package/rush-logs/ts-web-extras.test.error.log +0 -16
  279. package/rush-logs/ts-web-extras.test.log +0 -70
  280. package/temp/coverage/crypto/browserHashProvider.ts.html +0 -304
  281. package/temp/coverage/crypto/index.html +0 -116
  282. package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +0 -304
  283. package/temp/coverage/lcov-report/crypto/index.html +0 -116
  284. package/temp/test/jest/haste-map-b931e4e63102f86c5bd4949f7dced44f-9d713eb41149188b4e5c0ae3d86d0a57-2ad8e16b24e391b8cdbe50b55c137169 +0 -0
  285. package/temp/test/jest/perf-cache-b931e4e63102f86c5bd4949f7dced44f-da39a3ee5e6b4b0d3255bfef95601890 +0 -1
  286. /package/temp/test/jest/{jest-transform-cache-b931e4e63102f86c5bd4949f7dced44f-79ef2876fae7ca75eedb2aa53dc48338/b5/package_b5f57afc9ec2c011239b1608ee5bdfa5 → jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/7c/package_7c16afc8299e635d80273763175c7a50} +0 -0
@@ -0,0 +1,3 @@
1
+ Caching build output folders: dist, lib, temp, .rush/temp/operation/build
2
+ Successfully set cache entry.
3
+ Cache key: 63a2c58f11944fdb592459d835a6483c79343b3f
@@ -1,75 +1,55 @@
1
1
  Invoking: heft test --clean
2
2
  ---- build started ----
3
- [build:clean] Deleted 0 files and 3 folders
4
3
  [build:typescript] The TypeScript compiler version 5.9.3 is newer than the latest version that was tested with Heft (5.8); it may not work correctly.
5
4
  [build:typescript] Using TypeScript version 5.9.3
6
- [build:api-extractor] Using API Extractor version 7.57.6
5
+ [build:api-extractor] Using API Extractor version 7.57.7
7
6
  [build:api-extractor] Analysis will use the bundled TypeScript version 5.8.2
8
7
  [build:api-extractor] *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
9
- ---- build finished (3.991s) ----
8
+ ---- build finished (25.695s) ----
10
9
  ---- test started ----
11
- [test:clean] Deleted 0 files and 1 folder
12
10
  [test:jest] Using Jest version 29.5.0
13
11
  [test:jest]
14
12
  [test:jest] Run start. 9 test suites
15
- [test:jest] START lib/test/unit/fileApiTreeAccessors.test.js
16
13
  [test:jest] START lib/test/unit/httpTreeAccessors.test.js
14
+ [test:jest] START lib/test/unit/fileApiTreeAccessors.test.js
17
15
  [test:jest] START lib/test/unit/localStorageTreeAccessors.test.js
18
16
  [test:jest] START lib/test/unit/fileSystemAccessTreeAccessors.test.js
17
+ [test:jest] PASS lib/test/unit/localStorageTreeAccessors.test.js (duration: 1.968s, 44 passed, 0 failed)
19
18
  [test:jest] START lib/test/unit/fileTreeHelpers.test.js
19
+ [test:jest] PASS lib/test/unit/httpTreeAccessors.test.js (duration: 2.175s, 61 passed, 0 failed)
20
20
  [test:jest] START lib/test/unit/fileApiTypes.test.js
21
+ [test:jest] PASS lib/test/unit/fileApiTreeAccessors.test.js (duration: 2.633s, 65 passed, 0 failed)
21
22
  [test:jest] START lib/test/unit/urlParams.test.js
23
+ [test:jest] PASS lib/test/unit/fileSystemAccessTreeAccessors.test.js (duration: 1.502s, 44 passed, 0 failed)
22
24
  [test:jest] START lib/test/unit/directoryHandleStore.test.js
25
+ [test:jest] PASS lib/test/unit/fileApiTypes.test.js (duration: 1.432s, 36 passed, 0 failed)
23
26
  [test:jest] START lib/test/unit/browserHashProvider.test.js
24
- (node:72593) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
25
- (Use `node --trace-deprecation ...` to show where the warning was created)
26
- (node:72591) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
27
- (Use `node --trace-deprecation ...` to show where the warning was created)
28
- (node:72598) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
29
- (Use `node --trace-deprecation ...` to show where the warning was created)
30
- [test:jest] PASS lib/test/unit/httpTreeAccessors.test.js (duration: 0.858s, 52 passed, 0 failed)
31
- [test:jest] PASS lib/test/unit/fileSystemAccessTreeAccessors.test.js (duration: 0.900s, 44 passed, 0 failed)
32
- [test:jest] PASS lib/test/unit/browserHashProvider.test.js (duration: 0.969s, 15 passed, 0 failed)
33
- (node:72594) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
34
- (Use `node --trace-deprecation ...` to show where the warning was created)
35
- [test:jest] PASS lib/test/unit/fileTreeHelpers.test.js (duration: 0.968s, 35 passed, 0 failed)
36
- [test:jest] PASS lib/test/unit/directoryHandleStore.test.js (duration: 0.948s, 19 passed, 0 failed)
37
- (node:72597) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
38
- (Use `node --trace-deprecation ...` to show where the warning was created)
39
- (node:72590) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
40
- (Use `node --trace-deprecation ...` to show where the warning was created)
41
- (node:72596) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
42
- (Use `node --trace-deprecation ...` to show where the warning was created)
43
- (node:72592) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
44
- (Use `node --trace-deprecation ...` to show where the warning was created)
45
- [test:jest] PASS lib/test/unit/urlParams.test.js (duration: 0.916s, 60 passed, 0 failed)
46
- [test:jest] PASS lib/test/unit/fileApiTreeAccessors.test.js (duration: 0.987s, 65 passed, 0 failed)
47
- [test:jest] PASS lib/test/unit/localStorageTreeAccessors.test.js (duration: 0.974s, 44 passed, 0 failed)
48
- (node:72595) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
49
- (Use `node --trace-deprecation ...` to show where the warning was created)
50
- [test:jest] PASS lib/test/unit/fileApiTypes.test.js (duration: 0.933s, 36 passed, 0 failed)
27
+ [test:jest] PASS lib/test/unit/fileTreeHelpers.test.js (duration: 1.702s, 35 passed, 0 failed)
28
+ [test:jest] PASS lib/test/unit/urlParams.test.js (duration: 1.387s, 60 passed, 0 failed)
29
+ [test:jest] PASS lib/test/unit/directoryHandleStore.test.js (duration: 1.409s, 19 passed, 0 failed)
30
+ [test:jest] PASS lib/test/unit/browserHashProvider.test.js (duration: 1.440s, 15 passed, 0 failed)
51
31
  [test:jest]
52
32
  [test:jest] Tests finished:
53
- [test:jest] Successes: 370
33
+ [test:jest] Successes: 379
54
34
  [test:jest] Failures: 0
55
- [test:jest] Total: 371
35
+ [test:jest] Total: 380
56
36
  -----------------------------------|---------|----------|---------|---------|-------------------
57
37
  File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
58
38
  -----------------------------------|---------|----------|---------|---------|-------------------
59
- All files | 100 | 100 | 100 | 100 |
39
+ All files | 100 | 99.62 | 100 | 100 |
60
40
  crypto-utils | 100 | 100 | 100 | 100 |
61
41
  browserCryptoProvider.ts | 100 | 100 | 100 | 100 |
62
42
  browserHashProvider.ts | 100 | 100 | 100 | 100 |
63
- file-tree | 100 | 100 | 100 | 100 |
43
+ file-tree | 100 | 99.58 | 100 | 100 |
64
44
  directoryHandleStore.ts | 100 | 100 | 100 | 100 |
65
45
  fileApiTreeAccessors.ts | 100 | 100 | 100 | 100 |
66
46
  fileSystemAccessTreeAccessors.ts | 100 | 100 | 100 | 100 |
67
- httpTreeAccessors.ts | 100 | 100 | 100 | 100 |
47
+ httpTreeAccessors.ts | 100 | 98.42 | 100 | 100 | 369
68
48
  localStorageTreeAccessors.ts | 100 | 100 | 100 | 100 |
69
49
  helpers | 100 | 100 | 100 | 100 |
70
50
  fileTreeHelpers.ts | 100 | 100 | 100 | 100 |
71
51
  url-utils | 100 | 100 | 100 | 100 |
72
52
  urlParams.ts | 100 | 100 | 100 | 100 |
73
53
  -----------------------------------|---------|----------|---------|---------|-------------------
74
- ---- test finished (2.336s) ----
75
- -------------------- Finished (6.331s) --------------------
54
+ ---- test finished (8.236s) ----
55
+ -------------------- Finished (33.942s) --------------------
@@ -79,6 +79,9 @@ export class HttpTreeAccessors<TCT extends string = string>
79
79
  private readonly _userId: string | undefined;
80
80
  private readonly _logger: Logging.LogReporter<unknown>;
81
81
 
82
+ /** Guards against concurrent syncToDisk calls (thundering herd from autoSync). */
83
+ private _syncPromise: Promise<Result<void>> | undefined;
84
+
82
85
  private constructor(files: FileTree.IInMemoryFile<TCT>[], params: IHttpTreeParams<TCT>) {
83
86
  super(files, params);
84
87
  this._baseUrl = params.baseUrl.replace(/\/$/, '');
@@ -117,65 +120,116 @@ export class HttpTreeAccessors<TCT extends string = string>
117
120
 
118
121
  /**
119
122
  * Synchronizes all dirty files to the HTTP backend.
123
+ *
124
+ * Uses a concurrency guard: if a sync is already in progress, callers
125
+ * await the existing operation rather than starting a parallel one.
126
+ * This prevents the thundering herd that occurs when autoSync fires
127
+ * for every file written during a bulk operation (e.g. restore).
128
+ *
120
129
  * @returns A promise that resolves to a result indicating success or failure.
121
130
  */
122
131
  public async syncToDisk(): Promise<Result<void>> {
123
- if (this._dirtyFiles.size === 0 && this._pendingDeletions.size === 0) {
124
- return succeed(undefined);
132
+ if (this._syncPromise) {
133
+ // Wait for the in-flight sync — it drains the queue in a loop,
134
+ // so any items added before it finishes will be included.
135
+ return this._syncPromise;
125
136
  }
126
137
 
127
- for (const path of this._pendingDeletions) {
128
- const query = new URLSearchParams();
129
- query.set('path', path);
130
- if (this._namespace) {
131
- query.set('namespace', this._namespace);
132
- }
138
+ this._syncPromise = this._doSync().finally(() => {
139
+ this._syncPromise = undefined;
140
+ });
141
+ return this._syncPromise;
142
+ }
133
143
 
134
- const deleteResult = await this._request<{ deleted: boolean }>(`/file?${query.toString()}`, {
135
- method: 'DELETE'
136
- });
137
- if (deleteResult.isFailure()) {
138
- return fail(`delete ${path}: ${deleteResult.message}`);
144
+ private async _doSync(): Promise<Result<void>> {
145
+ // Drain loop: keep processing as long as new items arrive.
146
+ // This is critical for bulk operations (e.g. reset) where many
147
+ // deleteFile/saveFileContents calls happen synchronously — only
148
+ // the first may be in the set when we snapshot, but the rest
149
+ // arrive during the async gaps and must be picked up before
150
+ // we return.
151
+ let didWork = false;
152
+ while (this._dirtyFiles.size > 0 || this._pendingDeletions.size > 0) {
153
+ didWork = true;
154
+ // Snapshot and clear so that changes arriving during the async
155
+ // requests land in the live sets for the next iteration.
156
+ const deletions = new Set(this._pendingDeletions);
157
+ const dirty = new Set(this._dirtyFiles);
158
+ this._pendingDeletions.clear();
159
+ this._dirtyFiles.clear();
160
+
161
+ for (const path of deletions) {
162
+ const query = new URLSearchParams();
163
+ query.set('path', path);
164
+ if (this._namespace) {
165
+ query.set('namespace', this._namespace);
166
+ }
167
+
168
+ const deleteResult = await this._requestWithRetry<{ deleted: boolean }>(`/file?${query.toString()}`, {
169
+ method: 'DELETE'
170
+ });
171
+ if (deleteResult.isFailure()) {
172
+ this._restoreUnsynced(deletions, dirty);
173
+ return fail(`delete ${path}: ${deleteResult.message}`);
174
+ }
139
175
  }
140
- }
141
176
 
142
- for (const path of this._dirtyFiles) {
143
- const contentsResult = this.getFileContents(path);
144
- if (contentsResult.isFailure()) {
145
- return fail(`${path}: ${contentsResult.message}`);
177
+ for (const path of dirty) {
178
+ const contentsResult = this.getFileContents(path);
179
+ if (contentsResult.isFailure()) {
180
+ this._restoreUnsynced(deletions, dirty);
181
+ return fail(`${path}: ${contentsResult.message}`);
182
+ }
183
+
184
+ const body: Record<string, unknown> = {
185
+ path,
186
+ contents: contentsResult.value
187
+ };
188
+ if (this._namespace) {
189
+ body.namespace = this._namespace;
190
+ }
191
+
192
+ const saveResult = await this._requestWithRetry<IHttpStorageFileResponse>('/file', {
193
+ method: 'PUT',
194
+ body: JSON.stringify(body)
195
+ });
196
+ if (saveResult.isFailure()) {
197
+ this._restoreUnsynced(deletions, dirty);
198
+ return fail(`sync ${path}: ${saveResult.message}`);
199
+ }
146
200
  }
201
+ }
147
202
 
148
- const body: Record<string, unknown> = {
149
- path,
150
- contents: contentsResult.value
151
- };
203
+ if (didWork) {
204
+ const syncBody: Record<string, unknown> = {};
152
205
  if (this._namespace) {
153
- body.namespace = this._namespace;
206
+ syncBody.namespace = this._namespace;
154
207
  }
155
208
 
156
- const saveResult = await this._request<IHttpStorageFileResponse>('/file', {
157
- method: 'PUT',
158
- body: JSON.stringify(body)
209
+ const syncResult = await this._requestWithRetry<IHttpStorageSyncResponse>('/sync', {
210
+ method: 'POST',
211
+ body: JSON.stringify(syncBody)
159
212
  });
160
- if (saveResult.isFailure()) {
161
- return fail(`sync ${path}: ${saveResult.message}`);
213
+
214
+ if (syncResult.isFailure()) {
215
+ return fail(syncResult.message);
162
216
  }
163
217
  }
218
+ return succeed(undefined);
219
+ }
164
220
 
165
- this._pendingDeletions.clear();
166
- this._dirtyFiles.clear();
167
-
168
- const syncBody: Record<string, unknown> = {};
169
- if (this._namespace) {
170
- syncBody.namespace = this._namespace;
221
+ /**
222
+ * Restores snapshotted items back into the live dirty sets so they
223
+ * are retried on the next sync attempt. Items that were added to
224
+ * the live sets while the sync was in flight are preserved.
225
+ */
226
+ private _restoreUnsynced(deletions: Set<string>, dirty: Set<string>): void {
227
+ for (const path of deletions) {
228
+ this._pendingDeletions.add(path);
229
+ }
230
+ for (const path of dirty) {
231
+ this._dirtyFiles.add(path);
171
232
  }
172
-
173
- const syncResult = await this._request<IHttpStorageSyncResponse>('/sync', {
174
- method: 'POST',
175
- body: JSON.stringify(syncBody)
176
- });
177
-
178
- return syncResult.isFailure() ? fail(syncResult.message) : succeed(undefined);
179
233
  }
180
234
 
181
235
  /**
@@ -269,7 +323,10 @@ export class HttpTreeAccessors<TCT extends string = string>
269
323
  }
270
324
 
271
325
  if (!response.ok) {
272
- const message = await response.text().catch(() => `HTTP ${response.status}`);
326
+ const body = await response.text().catch(() => '');
327
+ const message = body
328
+ ? `HTTP ${response.status}: ${body}`
329
+ : `HTTP ${response.status} ${response.statusText}`;
273
330
  return fail(message);
274
331
  }
275
332
 
@@ -280,6 +337,44 @@ export class HttpTreeAccessors<TCT extends string = string>
280
337
  return succeed(json as T);
281
338
  }
282
339
 
340
+ /**
341
+ * Wraps `_request` with retry logic for transient failures
342
+ * (network errors, 503 service unavailable, etc.).
343
+ */
344
+ private async _requestWithRetry<T>(resourcePath: string, init?: RequestInit): Promise<Result<T>> {
345
+ const maxAttempts = 3;
346
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
347
+ const result = await this._request<T>(resourcePath, init);
348
+ if (result.isSuccess() || attempt === maxAttempts) {
349
+ return result;
350
+ }
351
+ // Retry on transient-looking errors
352
+ const msg = result.message;
353
+ const lowerMsg = msg.toLowerCase();
354
+ const isTransient =
355
+ msg.includes('503') ||
356
+ msg.includes('502') ||
357
+ msg.includes('429') ||
358
+ lowerMsg.includes('disconnect') ||
359
+ lowerMsg.includes('econnreset') ||
360
+ lowerMsg.includes('failed to fetch') ||
361
+ lowerMsg.includes('network');
362
+ if (!isTransient) {
363
+ return result;
364
+ }
365
+ // Exponential backoff: 500ms, 1000ms
366
+ const delayMs = 500 * Math.pow(2, attempt - 1);
367
+ this._logger.detail(
368
+ `Retrying ${
369
+ init?.method ?? 'GET'
370
+ } ${resourcePath} after ${delayMs}ms (attempt ${attempt}/${maxAttempts})`
371
+ );
372
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
373
+ }
374
+ /* c8 ignore next 1 - defensive coding: loop always returns */
375
+ return fail('retry loop exited unexpectedly');
376
+ }
377
+
283
378
  /**
284
379
  * Loads files from the HTTP backend for the specified directory path.
285
380
  * @param params - Configuration parameters for the HTTP tree accessors.
@@ -352,8 +447,7 @@ export class HttpTreeAccessors<TCT extends string = string>
352
447
  }
353
448
 
354
449
  const fetchImpl = normalizeFetch(params.fetchImpl);
355
- /* c8 ignore next 3 - userId header in static _requestWithParams; covered by userId tests via fromHttp */
356
- const userIdHeaders: RequestInit | undefined = params.userId
450
+ const userIdHeaders: RequestInit | undefined = /* c8 ignore next */ params.userId
357
451
  ? { headers: { 'X-User-Id': params.userId } }
358
452
  : undefined;
359
453
  const response = await fetchImpl(
@@ -367,7 +461,10 @@ export class HttpTreeAccessors<TCT extends string = string>
367
461
  }
368
462
 
369
463
  if (!response.ok) {
370
- const message = await response.text().catch(() => `HTTP ${response.status}`);
464
+ const body = await response.text().catch(() => '');
465
+ const message = body
466
+ ? `HTTP ${response.status}: ${body}`
467
+ : `HTTP ${response.status} ${response.statusText}`;
371
468
  return fail(message);
372
469
  }
373
470