@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.
- package/.rush/temp/63a2c58f11944fdb592459d835a6483c79343b3f.tar.log +237 -0
- package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +19 -39
- package/.rush/temp/operation/build/all.log +19 -39
- package/.rush/temp/operation/build/log-chunks.jsonl +19 -39
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/shrinkwrap-deps.json +690 -633
- package/config/typedoc.json +2 -1
- package/dist/packlets/file-tree/httpTreeAccessors.js +128 -41
- package/dist/packlets/file-tree/httpTreeAccessors.js.map +1 -1
- package/dist/test/unit/httpTreeAccessors.test.js +438 -74
- package/dist/test/unit/httpTreeAccessors.test.js.map +1 -1
- package/dist/ts-web-extras.d.ts +20 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/docs/CryptoUtils/README.md +60 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.decrypt.md +27 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.deriveKey.md +26 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.encrypt.md +25 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.fromBase64.md +24 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.generateKey.md +17 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.generateRandomBytes.md +24 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.md +151 -0
- package/docs/CryptoUtils/classes/BrowserCryptoProvider.toBase64.md +24 -0
- package/docs/CryptoUtils/classes/BrowserHashProvider.hashParts.md +26 -0
- package/docs/CryptoUtils/classes/BrowserHashProvider.hashString.md +25 -0
- package/docs/CryptoUtils/classes/BrowserHashProvider.md +81 -0
- package/docs/CryptoUtils/functions/createBrowserCryptoProvider.md +12 -0
- package/docs/FileTreeHelpers/README.md +85 -0
- package/docs/FileTreeHelpers/functions/extractFileListMetadata.md +11 -0
- package/docs/FileTreeHelpers/functions/extractFileMetadata.md +11 -0
- package/docs/FileTreeHelpers/functions/fromDirectoryUpload.md +12 -0
- package/docs/FileTreeHelpers/functions/fromFileList.md +12 -0
- package/docs/FileTreeHelpers/functions/getOriginalFile.md +11 -0
- package/docs/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +9 -0
- package/docs/README.md +499 -53
- package/docs/classes/BrowserCryptoProvider.decrypt.md +27 -0
- package/docs/classes/BrowserCryptoProvider.deriveKey.md +26 -0
- package/docs/classes/BrowserCryptoProvider.encrypt.md +25 -0
- package/docs/classes/BrowserCryptoProvider.fromBase64.md +24 -0
- package/docs/classes/BrowserCryptoProvider.generateKey.md +17 -0
- package/docs/classes/BrowserCryptoProvider.generateRandomBytes.md +24 -0
- package/docs/classes/BrowserCryptoProvider.md +151 -0
- package/docs/classes/BrowserCryptoProvider.toBase64.md +24 -0
- package/docs/classes/BrowserHashProvider.hashParts.md +26 -0
- package/docs/classes/BrowserHashProvider.hashString.md +25 -0
- package/docs/classes/BrowserHashProvider.md +81 -0
- package/docs/classes/DirectoryHandleStore.getAll.md +17 -0
- package/docs/classes/DirectoryHandleStore.getAllLabels.md +17 -0
- package/docs/classes/DirectoryHandleStore.load.md +24 -0
- package/docs/classes/DirectoryHandleStore.md +65 -61
- package/docs/classes/DirectoryHandleStore.remove.md +24 -0
- package/docs/classes/DirectoryHandleStore.save.md +25 -0
- package/docs/classes/FileApiTreeAccessors.create.md +25 -0
- package/docs/classes/FileApiTreeAccessors.createFromHttp.md +24 -0
- package/docs/classes/FileApiTreeAccessors.createFromLocalStorage.md +25 -0
- package/docs/classes/FileApiTreeAccessors.createPersistent.md +26 -0
- package/docs/classes/FileApiTreeAccessors.createPersistentFromFile.md +27 -0
- package/docs/classes/FileApiTreeAccessors.extractFileMetadata.md +24 -0
- package/docs/classes/FileApiTreeAccessors.fromDirectoryUpload.md +25 -0
- package/docs/classes/FileApiTreeAccessors.fromFileList.md +25 -0
- package/docs/classes/FileApiTreeAccessors.getOriginalFile.md +27 -0
- package/docs/classes/FileApiTreeAccessors.md +87 -201
- package/docs/classes/FileSystemAccessTreeAccessors.deleteFile.md +22 -0
- package/docs/classes/FileSystemAccessTreeAccessors.fileIsMutable.md +22 -0
- package/docs/classes/FileSystemAccessTreeAccessors.fromDirectoryHandle.md +25 -0
- package/docs/classes/FileSystemAccessTreeAccessors.fromFileHandle.md +29 -0
- package/docs/classes/FileSystemAccessTreeAccessors.getDirtyPaths.md +15 -0
- package/docs/classes/FileSystemAccessTreeAccessors.isDirty.md +15 -0
- package/docs/classes/FileSystemAccessTreeAccessors.md +128 -410
- package/docs/classes/FileSystemAccessTreeAccessors.saveFileContents.md +23 -0
- package/docs/classes/FileSystemAccessTreeAccessors.syncToDisk.md +15 -0
- package/docs/classes/HttpTreeAccessors.deleteFile.md +22 -0
- package/docs/classes/HttpTreeAccessors.fileIsMutable.md +24 -0
- package/docs/classes/HttpTreeAccessors.fromHttp.md +24 -0
- package/docs/classes/HttpTreeAccessors.getDirtyPaths.md +17 -0
- package/docs/classes/HttpTreeAccessors.isDirty.md +17 -0
- package/docs/classes/HttpTreeAccessors.md +121 -368
- package/docs/classes/HttpTreeAccessors.saveFileContents.md +25 -0
- package/docs/classes/HttpTreeAccessors.syncToDisk.md +22 -0
- package/docs/classes/LocalStorageTreeAccessors.deleteFile.md +24 -0
- package/docs/classes/LocalStorageTreeAccessors.fileIsMutable.md +24 -0
- package/docs/classes/LocalStorageTreeAccessors.fromStorage.md +25 -0
- package/docs/classes/LocalStorageTreeAccessors.getDirtyPaths.md +17 -0
- package/docs/classes/LocalStorageTreeAccessors.isDirty.md +17 -0
- package/docs/classes/LocalStorageTreeAccessors.md +121 -371
- package/docs/classes/LocalStorageTreeAccessors.saveFileContents.md +25 -0
- package/docs/classes/LocalStorageTreeAccessors.syncToDisk.md +17 -0
- package/docs/functions/createBrowserCryptoProvider.md +12 -0
- package/docs/functions/exportAsJson.md +6 -17
- package/docs/functions/exportUsingFileSystemAPI.md +6 -21
- package/docs/functions/extractDirectoryPath.md +6 -16
- package/docs/functions/extractFileListMetadata.md +11 -0
- package/docs/functions/extractFileMetadata.md +11 -0
- package/docs/functions/fromDirectoryUpload.md +12 -0
- package/docs/functions/fromFileList.md +12 -0
- package/docs/functions/getOriginalFile.md +11 -0
- package/docs/functions/isDirectoryHandle.md +6 -18
- package/docs/functions/isFileHandle.md +6 -18
- package/docs/functions/isFilePath.md +6 -16
- package/docs/functions/parseContextFilter.md +6 -16
- package/docs/functions/parseQualifierDefaults.md +6 -16
- package/docs/functions/parseResourceTypes.md +6 -16
- package/docs/functions/parseUrlParameters.md +6 -10
- package/docs/functions/safeShowDirectoryPicker.md +6 -19
- package/docs/functions/safeShowOpenFilePicker.md +6 -19
- package/docs/functions/safeShowSaveFilePicker.md +6 -19
- package/docs/functions/supportsFileSystemAccess.md +6 -18
- package/docs/interfaces/FilePickerAcceptType.accept.md +9 -0
- package/docs/interfaces/FilePickerAcceptType.description.md +9 -0
- package/docs/interfaces/FilePickerAcceptType.md +54 -9
- package/docs/interfaces/FileSystemCreateWritableOptions.keepExistingData.md +9 -0
- package/docs/interfaces/FileSystemCreateWritableOptions.md +37 -8
- package/docs/interfaces/FileSystemDirectoryHandle._asyncIterator_.md +13 -0
- package/docs/interfaces/FileSystemDirectoryHandle.entries.md +13 -0
- package/docs/interfaces/FileSystemDirectoryHandle.getDirectoryHandle.md +21 -0
- package/docs/interfaces/FileSystemDirectoryHandle.getFileHandle.md +21 -0
- package/docs/interfaces/FileSystemDirectoryHandle.keys.md +13 -0
- package/docs/interfaces/FileSystemDirectoryHandle.kind.md +9 -0
- package/docs/interfaces/FileSystemDirectoryHandle.md +140 -103
- package/docs/interfaces/FileSystemDirectoryHandle.removeEntry.md +21 -0
- package/docs/interfaces/FileSystemDirectoryHandle.resolve.md +20 -0
- package/docs/interfaces/FileSystemDirectoryHandle.values.md +13 -0
- package/docs/interfaces/FileSystemFileHandle.createWritable.md +20 -0
- package/docs/interfaces/FileSystemFileHandle.getFile.md +13 -0
- package/docs/interfaces/FileSystemFileHandle.kind.md +9 -0
- package/docs/interfaces/FileSystemFileHandle.md +98 -58
- package/docs/interfaces/FileSystemGetDirectoryOptions.create.md +9 -0
- package/docs/interfaces/FileSystemGetDirectoryOptions.md +37 -8
- package/docs/interfaces/FileSystemGetFileOptions.create.md +9 -0
- package/docs/interfaces/FileSystemGetFileOptions.md +37 -8
- package/docs/interfaces/FileSystemHandle.isSameEntry.md +20 -0
- package/docs/interfaces/FileSystemHandle.kind.md +9 -0
- package/docs/interfaces/FileSystemHandle.md +88 -39
- package/docs/interfaces/FileSystemHandle.name.md +9 -0
- package/docs/interfaces/FileSystemHandle.queryPermission.md +20 -0
- package/docs/interfaces/FileSystemHandle.requestPermission.md +20 -0
- package/docs/interfaces/FileSystemHandlePermissionDescriptor.md +37 -8
- package/docs/interfaces/FileSystemHandlePermissionDescriptor.mode.md +9 -0
- package/docs/interfaces/FileSystemRemoveOptions.md +37 -8
- package/docs/interfaces/FileSystemRemoveOptions.recursive.md +9 -0
- package/docs/interfaces/FileSystemWritableFileStream.md +83 -68
- package/docs/interfaces/FileSystemWritableFileStream.seek.md +20 -0
- package/docs/interfaces/FileSystemWritableFileStream.truncate.md +20 -0
- package/docs/interfaces/FileSystemWritableFileStream.write.md +20 -0
- package/docs/interfaces/IDirectoryHandleTreeInitializer.dirHandles.md +9 -0
- package/docs/interfaces/IDirectoryHandleTreeInitializer.md +71 -10
- package/docs/interfaces/IDirectoryHandleTreeInitializer.nonRecursive.md +9 -0
- package/docs/interfaces/IDirectoryHandleTreeInitializer.prefix.md +9 -0
- package/docs/interfaces/IFileHandleTreeInitializer.fileHandles.md +9 -0
- package/docs/interfaces/IFileHandleTreeInitializer.md +54 -9
- package/docs/interfaces/IFileHandleTreeInitializer.prefix.md +9 -0
- package/docs/interfaces/IFileListTreeInitializer.fileList.md +9 -0
- package/docs/interfaces/IFileListTreeInitializer.md +37 -8
- package/docs/interfaces/IFileMetadata.lastModified.md +9 -0
- package/docs/interfaces/IFileMetadata.md +105 -12
- package/docs/interfaces/IFileMetadata.name.md +9 -0
- package/docs/interfaces/IFileMetadata.path.md +9 -0
- package/docs/interfaces/IFileMetadata.size.md +9 -0
- package/docs/interfaces/IFileMetadata.type.md +9 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.autoSync.md +12 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.filePath.md +13 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.logger.md +11 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.md +138 -20
- package/docs/interfaces/IFileSystemAccessTreeParams.requireWritePermission.md +13 -0
- package/docs/interfaces/IFsAccessApis.md +36 -31
- package/docs/interfaces/IFsAccessApis.showDirectoryPicker.md +20 -0
- package/docs/interfaces/IFsAccessApis.showOpenFilePicker.md +20 -0
- package/docs/interfaces/IFsAccessApis.showSaveFilePicker.md +20 -0
- package/docs/interfaces/IHttpTreeParams.autoSync.md +9 -0
- package/docs/interfaces/IHttpTreeParams.baseUrl.md +9 -0
- package/docs/interfaces/IHttpTreeParams.fetchImpl.md +9 -0
- package/docs/interfaces/IHttpTreeParams.logger.md +9 -0
- package/docs/interfaces/IHttpTreeParams.md +172 -22
- package/docs/interfaces/IHttpTreeParams.namespace.md +9 -0
- package/docs/interfaces/IHttpTreeParams.userId.md +9 -0
- package/docs/interfaces/ILocalStorageTreeParams.autoSync.md +12 -0
- package/docs/interfaces/ILocalStorageTreeParams.md +121 -20
- package/docs/interfaces/ILocalStorageTreeParams.pathToKeyMap.md +13 -0
- package/docs/interfaces/ILocalStorageTreeParams.storage.md +12 -0
- package/docs/interfaces/IUrlConfigOptions.config.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.configStartDir.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.contextFilter.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.input.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.inputStartDir.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.interactive.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.loadZip.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.maxDistance.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.md +241 -20
- package/docs/interfaces/IUrlConfigOptions.qualifierDefaults.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.reduceQualifiers.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.resourceTypes.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.zipFile.md +11 -0
- package/docs/interfaces/IUrlConfigOptions.zipPath.md +11 -0
- package/docs/interfaces/ShowDirectoryPickerOptions.id.md +9 -0
- package/docs/interfaces/ShowDirectoryPickerOptions.md +71 -10
- package/docs/interfaces/ShowDirectoryPickerOptions.mode.md +9 -0
- package/docs/interfaces/ShowDirectoryPickerOptions.startIn.md +9 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.excludeAcceptAllOption.md +9 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.id.md +9 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.md +105 -12
- package/docs/interfaces/ShowOpenFilePickerOptions.multiple.md +9 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.startIn.md +9 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.types.md +9 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.excludeAcceptAllOption.md +9 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.id.md +9 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.md +105 -12
- package/docs/interfaces/ShowSaveFilePickerOptions.startIn.md +9 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.suggestedName.md +9 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.types.md +9 -0
- package/docs/type-aliases/TreeInitializer.md +7 -7
- package/docs/type-aliases/WellKnownDirectory.md +7 -7
- package/docs/type-aliases/WindowWithFsAccess.md +7 -7
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_DB.md +5 -7
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_STORE.md +5 -7
- package/docs/variables/defaultFileApiTreeInitParams.md +9 -0
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts +20 -0
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/httpTreeAccessors.js +128 -41
- package/lib/packlets/file-tree/httpTreeAccessors.js.map +1 -1
- package/lib/test/unit/httpTreeAccessors.test.js +438 -74
- package/lib/test/unit/httpTreeAccessors.test.js.map +1 -1
- package/package.json +27 -26
- package/rush-logs/ts-web-extras.build.cache.log +3 -0
- package/rush-logs/ts-web-extras.build.log +19 -39
- package/src/packlets/file-tree/httpTreeAccessors.ts +142 -45
- package/src/test/unit/httpTreeAccessors.test.ts +556 -84
- package/temp/build/typescript/ts_8nwakTlr.json +1 -1
- package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1 -1
- package/temp/coverage/crypto-utils/browserHashProvider.ts.html +1 -1
- package/temp/coverage/crypto-utils/index.html +1 -1
- package/temp/coverage/file-tree/directoryHandleStore.ts.html +1 -1
- package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +1 -1
- package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
- package/temp/coverage/file-tree/httpTreeAccessors.ts.html +507 -216
- package/temp/coverage/file-tree/index.html +11 -11
- package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +1 -1
- package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/helpers/index.html +1 -1
- package/temp/coverage/index.html +11 -11
- package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1 -1
- package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +1 -1
- package/temp/coverage/lcov-report/crypto-utils/index.html +1 -1
- package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +1 -1
- package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +1 -1
- package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +1 -1
- package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +507 -216
- package/temp/coverage/lcov-report/file-tree/index.html +11 -11
- package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +1 -1
- package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/lcov-report/helpers/index.html +1 -1
- package/temp/coverage/lcov-report/index.html +11 -11
- package/temp/coverage/lcov-report/url-utils/index.html +1 -1
- package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
- package/temp/coverage/lcov.info +520 -387
- package/temp/coverage/url-utils/index.html +1 -1
- package/temp/coverage/url-utils/urlParams.ts.html +1 -1
- package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
- package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
- package/temp/ts-web-extras.api.json +2 -2
- package/.rush/temp/chunked-rush-logs/ts-web-extras.test.chunks.jsonl +0 -70
- package/.rush/temp/operation/build/error.log +0 -18
- package/.rush/temp/operation/test/all.log +0 -70
- package/.rush/temp/operation/test/error.log +0 -16
- package/.rush/temp/operation/test/log-chunks.jsonl +0 -70
- package/.rush/temp/operation/test/state.json +0 -3
- package/docs/@fgv/namespaces/CryptoUtils/README.md +0 -18
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserCryptoProvider.md +0 -203
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserHashProvider.md +0 -63
- package/docs/@fgv/namespaces/CryptoUtils/functions/createBrowserCryptoProvider.md +0 -18
- package/docs/@fgv/namespaces/FileTreeHelpers/README.md +0 -19
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileListMetadata.md +0 -23
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileMetadata.md +0 -23
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromDirectoryUpload.md +0 -33
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromFileList.md +0 -33
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/getOriginalFile.md +0 -25
- package/docs/@fgv/namespaces/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +0 -11
- package/rush-logs/ts-web-extras.build.error.log +0 -18
- package/rush-logs/ts-web-extras.test.cache.log +0 -1
- package/rush-logs/ts-web-extras.test.error.log +0 -16
- package/rush-logs/ts-web-extras.test.log +0 -70
- package/temp/coverage/crypto/browserHashProvider.ts.html +0 -304
- package/temp/coverage/crypto/index.html +0 -116
- package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +0 -304
- package/temp/coverage/lcov-report/crypto/index.html +0 -116
- package/temp/test/jest/haste-map-b931e4e63102f86c5bd4949f7dced44f-9d713eb41149188b4e5c0ae3d86d0a57-2ad8e16b24e391b8cdbe50b55c137169 +0 -0
- package/temp/test/jest/perf-cache-b931e4e63102f86c5bd4949f7dced44f-da39a3ee5e6b4b0d3255bfef95601890 +0 -1
- /package/temp/test/jest/{jest-transform-cache-b931e4e63102f86c5bd4949f7dced44f-79ef2876fae7ca75eedb2aa53dc48338/b5/package_b5f57afc9ec2c011239b1608ee5bdfa5 → jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/7c/package_7c16afc8299e635d80273763175c7a50} +0 -0
|
@@ -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.
|
|
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 (
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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:
|
|
33
|
+
[test:jest] Successes: 379
|
|
54
34
|
[test:jest] Failures: 0
|
|
55
|
-
[test:jest] Total:
|
|
35
|
+
[test:jest] Total: 380
|
|
56
36
|
-----------------------------------|---------|----------|---------|---------|-------------------
|
|
57
37
|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
58
38
|
-----------------------------------|---------|----------|---------|---------|-------------------
|
|
59
|
-
All files | 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 |
|
|
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 |
|
|
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 (
|
|
75
|
-
-------------------- Finished (
|
|
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.
|
|
124
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
138
|
+
this._syncPromise = this._doSync().finally(() => {
|
|
139
|
+
this._syncPromise = undefined;
|
|
140
|
+
});
|
|
141
|
+
return this._syncPromise;
|
|
142
|
+
}
|
|
133
143
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
contents: contentsResult.value
|
|
151
|
-
};
|
|
203
|
+
if (didWork) {
|
|
204
|
+
const syncBody: Record<string, unknown> = {};
|
|
152
205
|
if (this._namespace) {
|
|
153
|
-
|
|
206
|
+
syncBody.namespace = this._namespace;
|
|
154
207
|
}
|
|
155
208
|
|
|
156
|
-
const
|
|
157
|
-
method: '
|
|
158
|
-
body: JSON.stringify(
|
|
209
|
+
const syncResult = await this._requestWithRetry<IHttpStorageSyncResponse>('/sync', {
|
|
210
|
+
method: 'POST',
|
|
211
|
+
body: JSON.stringify(syncBody)
|
|
159
212
|
});
|
|
160
|
-
|
|
161
|
-
|
|
213
|
+
|
|
214
|
+
if (syncResult.isFailure()) {
|
|
215
|
+
return fail(syncResult.message);
|
|
162
216
|
}
|
|
163
217
|
}
|
|
218
|
+
return succeed(undefined);
|
|
219
|
+
}
|
|
164
220
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|