@milaboratories/pl-drivers 1.11.59 → 1.11.60
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/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/clients/constructors.cjs +28 -28
- package/dist/clients/constructors.cjs.map +1 -1
- package/dist/clients/constructors.d.ts +17 -13
- package/dist/clients/constructors.js +28 -26
- package/dist/clients/constructors.js.map +1 -1
- package/dist/clients/crc32c.cjs +8 -13
- package/dist/clients/crc32c.cjs.map +1 -1
- package/dist/clients/crc32c.js +8 -12
- package/dist/clients/crc32c.js.map +1 -1
- package/dist/clients/download.cjs +119 -160
- package/dist/clients/download.cjs.map +1 -1
- package/dist/clients/download.d.ts +45 -41
- package/dist/clients/download.js +115 -137
- package/dist/clients/download.js.map +1 -1
- package/dist/clients/logs.cjs +78 -82
- package/dist/clients/logs.cjs.map +1 -1
- package/dist/clients/logs.d.ts +34 -24
- package/dist/clients/logs.js +77 -80
- package/dist/clients/logs.js.map +1 -1
- package/dist/clients/ls_api.cjs +62 -68
- package/dist/clients/ls_api.cjs.map +1 -1
- package/dist/clients/ls_api.d.ts +15 -11
- package/dist/clients/ls_api.js +61 -66
- package/dist/clients/ls_api.js.map +1 -1
- package/dist/clients/progress.cjs +49 -59
- package/dist/clients/progress.cjs.map +1 -1
- package/dist/clients/progress.d.ts +27 -20
- package/dist/clients/progress.js +48 -57
- package/dist/clients/progress.js.map +1 -1
- package/dist/clients/upload.cjs +189 -250
- package/dist/clients/upload.cjs.map +1 -1
- package/dist/clients/upload.d.ts +44 -34
- package/dist/clients/upload.js +187 -229
- package/dist/clients/upload.js.map +1 -1
- package/dist/drivers/download_blob/blob_key.cjs +9 -26
- package/dist/drivers/download_blob/blob_key.cjs.map +1 -1
- package/dist/drivers/download_blob/blob_key.js +7 -5
- package/dist/drivers/download_blob/blob_key.js.map +1 -1
- package/dist/drivers/download_blob/download_blob.cjs +395 -478
- package/dist/drivers/download_blob/download_blob.cjs.map +1 -1
- package/dist/drivers/download_blob/download_blob.d.ts +102 -100
- package/dist/drivers/download_blob/download_blob.js +388 -453
- package/dist/drivers/download_blob/download_blob.js.map +1 -1
- package/dist/drivers/download_blob/download_blob_task.cjs +128 -163
- package/dist/drivers/download_blob/download_blob_task.cjs.map +1 -1
- package/dist/drivers/download_blob/download_blob_task.js +125 -141
- package/dist/drivers/download_blob/download_blob_task.js.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/cache.cjs +166 -195
- package/dist/drivers/download_blob/sparse_cache/cache.cjs.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/cache.js +164 -193
- package/dist/drivers/download_blob/sparse_cache/cache.js.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/file.cjs +29 -50
- package/dist/drivers/download_blob/sparse_cache/file.cjs.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/file.js +28 -29
- package/dist/drivers/download_blob/sparse_cache/file.js.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/ranges.cjs +48 -76
- package/dist/drivers/download_blob/sparse_cache/ranges.cjs.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/ranges.js +47 -54
- package/dist/drivers/download_blob/sparse_cache/ranges.js.map +1 -1
- package/dist/drivers/download_blob_url/driver.cjs +125 -165
- package/dist/drivers/download_blob_url/driver.cjs.map +1 -1
- package/dist/drivers/download_blob_url/driver.d.ts +45 -42
- package/dist/drivers/download_blob_url/driver.js +123 -144
- package/dist/drivers/download_blob_url/driver.js.map +1 -1
- package/dist/drivers/download_blob_url/driver_id.cjs +4 -4
- package/dist/drivers/download_blob_url/driver_id.cjs.map +1 -1
- package/dist/drivers/download_blob_url/driver_id.js +4 -3
- package/dist/drivers/download_blob_url/driver_id.js.map +1 -1
- package/dist/drivers/download_blob_url/snapshot.cjs +7 -11
- package/dist/drivers/download_blob_url/snapshot.cjs.map +1 -1
- package/dist/drivers/download_blob_url/snapshot.d.ts +10 -5
- package/dist/drivers/download_blob_url/snapshot.js +5 -8
- package/dist/drivers/download_blob_url/snapshot.js.map +1 -1
- package/dist/drivers/download_blob_url/task.cjs +147 -194
- package/dist/drivers/download_blob_url/task.cjs.map +1 -1
- package/dist/drivers/download_blob_url/task.d.ts +55 -57
- package/dist/drivers/download_blob_url/task.js +140 -170
- package/dist/drivers/download_blob_url/task.js.map +1 -1
- package/dist/drivers/download_url/driver.cjs +109 -146
- package/dist/drivers/download_url/driver.cjs.map +1 -1
- package/dist/drivers/download_url/driver.d.ts +59 -57
- package/dist/drivers/download_url/driver.js +107 -125
- package/dist/drivers/download_url/driver.js.map +1 -1
- package/dist/drivers/download_url/task.cjs +104 -137
- package/dist/drivers/download_url/task.cjs.map +1 -1
- package/dist/drivers/download_url/task.d.ts +33 -37
- package/dist/drivers/download_url/task.js +99 -113
- package/dist/drivers/download_url/task.js.map +1 -1
- package/dist/drivers/helpers/download_local_handle.cjs +13 -14
- package/dist/drivers/helpers/download_local_handle.cjs.map +1 -1
- package/dist/drivers/helpers/download_local_handle.js +13 -13
- package/dist/drivers/helpers/download_local_handle.js.map +1 -1
- package/dist/drivers/helpers/download_remote_handle.cjs +23 -24
- package/dist/drivers/helpers/download_remote_handle.cjs.map +1 -1
- package/dist/drivers/helpers/download_remote_handle.js +22 -22
- package/dist/drivers/helpers/download_remote_handle.js.map +1 -1
- package/dist/drivers/helpers/files_cache.cjs +53 -64
- package/dist/drivers/helpers/files_cache.cjs.map +1 -1
- package/dist/drivers/helpers/files_cache.js +52 -62
- package/dist/drivers/helpers/files_cache.js.map +1 -1
- package/dist/drivers/helpers/helpers.cjs +24 -28
- package/dist/drivers/helpers/helpers.cjs.map +1 -1
- package/dist/drivers/helpers/helpers.d.ts +10 -7
- package/dist/drivers/helpers/helpers.js +24 -27
- package/dist/drivers/helpers/helpers.js.map +1 -1
- package/dist/drivers/helpers/logs_handle.cjs +24 -33
- package/dist/drivers/helpers/logs_handle.cjs.map +1 -1
- package/dist/drivers/helpers/logs_handle.js +24 -29
- package/dist/drivers/helpers/logs_handle.js.map +1 -1
- package/dist/drivers/helpers/ls_remote_import_handle.cjs +20 -20
- package/dist/drivers/helpers/ls_remote_import_handle.cjs.map +1 -1
- package/dist/drivers/helpers/ls_remote_import_handle.js +20 -18
- package/dist/drivers/helpers/ls_remote_import_handle.js.map +1 -1
- package/dist/drivers/helpers/ls_storage_entry.cjs +36 -40
- package/dist/drivers/helpers/ls_storage_entry.cjs.map +1 -1
- package/dist/drivers/helpers/ls_storage_entry.js +36 -37
- package/dist/drivers/helpers/ls_storage_entry.js.map +1 -1
- package/dist/drivers/helpers/polling_ops.d.ts +6 -5
- package/dist/drivers/helpers/read_file.cjs +34 -57
- package/dist/drivers/helpers/read_file.cjs.map +1 -1
- package/dist/drivers/helpers/read_file.js +30 -34
- package/dist/drivers/helpers/read_file.js.map +1 -1
- package/dist/drivers/logs.cjs +94 -112
- package/dist/drivers/logs.cjs.map +1 -1
- package/dist/drivers/logs.d.ts +35 -32
- package/dist/drivers/logs.js +93 -110
- package/dist/drivers/logs.js.map +1 -1
- package/dist/drivers/logs_stream.cjs +210 -242
- package/dist/drivers/logs_stream.cjs.map +1 -1
- package/dist/drivers/logs_stream.d.ts +55 -53
- package/dist/drivers/logs_stream.js +209 -240
- package/dist/drivers/logs_stream.js.map +1 -1
- package/dist/drivers/ls.cjs +151 -238
- package/dist/drivers/ls.cjs.map +1 -1
- package/dist/drivers/ls.d.ts +53 -49
- package/dist/drivers/ls.js +148 -216
- package/dist/drivers/ls.js.map +1 -1
- package/dist/drivers/types.cjs +25 -53
- package/dist/drivers/types.cjs.map +1 -1
- package/dist/drivers/types.d.ts +91 -106
- package/dist/drivers/types.js +23 -50
- package/dist/drivers/types.js.map +1 -1
- package/dist/drivers/upload.cjs +127 -153
- package/dist/drivers/upload.cjs.map +1 -1
- package/dist/drivers/upload.d.ts +52 -50
- package/dist/drivers/upload.js +126 -151
- package/dist/drivers/upload.js.map +1 -1
- package/dist/drivers/upload_task.cjs +223 -260
- package/dist/drivers/upload_task.cjs.map +1 -1
- package/dist/drivers/upload_task.d.ts +54 -52
- package/dist/drivers/upload_task.js +221 -258
- package/dist/drivers/upload_task.js.map +1 -1
- package/dist/drivers/urls/url.cjs +30 -35
- package/dist/drivers/urls/url.cjs.map +1 -1
- package/dist/drivers/urls/url.js +28 -33
- package/dist/drivers/urls/url.js.map +1 -1
- package/dist/drivers/virtual_storages.cjs +36 -48
- package/dist/drivers/virtual_storages.cjs.map +1 -1
- package/dist/drivers/virtual_storages.d.ts +6 -2
- package/dist/drivers/virtual_storages.js +32 -46
- package/dist/drivers/virtual_storages.js.map +1 -1
- package/dist/helpers/download.cjs +72 -95
- package/dist/helpers/download.cjs.map +1 -1
- package/dist/helpers/download.d.ts +13 -9
- package/dist/helpers/download.js +71 -93
- package/dist/helpers/download.js.map +1 -1
- package/dist/helpers/download_errors.cjs +28 -27
- package/dist/helpers/download_errors.cjs.map +1 -1
- package/dist/helpers/download_errors.d.ts +16 -13
- package/dist/helpers/download_errors.js +28 -26
- package/dist/helpers/download_errors.js.map +1 -1
- package/dist/helpers/validate.cjs +8 -7
- package/dist/helpers/validate.cjs.map +1 -1
- package/dist/helpers/validate.d.ts +4 -1
- package/dist/helpers/validate.js +6 -5
- package/dist/helpers/validate.js.map +1 -1
- package/dist/index.cjs +75 -79
- package/dist/index.d.ts +22 -22
- package/dist/index.js +22 -21
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs +238 -249
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs +27 -27
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +25 -23
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js +26 -25
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +51 -87
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js +238 -245
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs +295 -289
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs +30 -30
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js +29 -28
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +86 -150
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js +295 -285
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs +385 -393
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs +34 -34
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +33 -34
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js +33 -32
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +78 -129
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js +385 -387
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs +570 -468
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs +82 -82
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +109 -112
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js +81 -80
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +243 -264
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js +569 -460
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs +751 -729
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs +67 -67
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js +66 -65
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js.map +1 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts +15 -381
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js +749 -718
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.cjs +92 -100
- package/dist/proto-grpc/google/protobuf/duration.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/duration.d.ts +38 -43
- package/dist/proto-grpc/google/protobuf/duration.js +91 -98
- package/dist/proto-grpc/google/protobuf/duration.js.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.cjs +117 -128
- package/dist/proto-grpc/google/protobuf/timestamp.cjs.map +1 -1
- package/dist/proto-grpc/google/protobuf/timestamp.d.ts +50 -55
- package/dist/proto-grpc/google/protobuf/timestamp.js +116 -126
- package/dist/proto-grpc/google/protobuf/timestamp.js.map +1 -1
- package/dist/proto-rest/downloadapi.d.ts +85 -91
- package/dist/proto-rest/index.d.ts +11 -16
- package/dist/proto-rest/progressapi.d.ts +130 -140
- package/dist/proto-rest/streamingapi.d.ts +413 -434
- package/package.json +12 -12
- package/dist/clients/constructors.d.ts.map +0 -1
- package/dist/clients/crc32c.d.ts +0 -2
- package/dist/clients/crc32c.d.ts.map +0 -1
- package/dist/clients/download.d.ts.map +0 -1
- package/dist/clients/logs.d.ts.map +0 -1
- package/dist/clients/ls_api.d.ts.map +0 -1
- package/dist/clients/progress.d.ts.map +0 -1
- package/dist/clients/upload.d.ts.map +0 -1
- package/dist/drivers/download_blob/blob_key.d.ts +0 -5
- package/dist/drivers/download_blob/blob_key.d.ts.map +0 -1
- package/dist/drivers/download_blob/download_blob.d.ts.map +0 -1
- package/dist/drivers/download_blob/download_blob_task.d.ts +0 -56
- package/dist/drivers/download_blob/download_blob_task.d.ts.map +0 -1
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts +0 -82
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts.map +0 -1
- package/dist/drivers/download_blob/sparse_cache/file.d.ts +0 -8
- package/dist/drivers/download_blob/sparse_cache/file.d.ts.map +0 -1
- package/dist/drivers/download_blob/sparse_cache/ranges.d.ts +0 -46
- package/dist/drivers/download_blob/sparse_cache/ranges.d.ts.map +0 -1
- package/dist/drivers/download_blob_url/driver.d.ts.map +0 -1
- package/dist/drivers/download_blob_url/driver_id.d.ts +0 -6
- package/dist/drivers/download_blob_url/driver_id.d.ts.map +0 -1
- package/dist/drivers/download_blob_url/snapshot.d.ts.map +0 -1
- package/dist/drivers/download_blob_url/task.d.ts.map +0 -1
- package/dist/drivers/download_url/driver.d.ts.map +0 -1
- package/dist/drivers/download_url/task.d.ts.map +0 -1
- package/dist/drivers/helpers/download_local_handle.d.ts +0 -11
- package/dist/drivers/helpers/download_local_handle.d.ts.map +0 -1
- package/dist/drivers/helpers/download_remote_handle.d.ts +0 -13
- package/dist/drivers/helpers/download_remote_handle.d.ts.map +0 -1
- package/dist/drivers/helpers/files_cache.d.ts +0 -29
- package/dist/drivers/helpers/files_cache.d.ts.map +0 -1
- package/dist/drivers/helpers/helpers.d.ts.map +0 -1
- package/dist/drivers/helpers/logs_handle.d.ts +0 -15
- package/dist/drivers/helpers/logs_handle.d.ts.map +0 -1
- package/dist/drivers/helpers/ls_remote_import_handle.d.ts +0 -8
- package/dist/drivers/helpers/ls_remote_import_handle.d.ts.map +0 -1
- package/dist/drivers/helpers/ls_storage_entry.d.ts +0 -23
- package/dist/drivers/helpers/ls_storage_entry.d.ts.map +0 -1
- package/dist/drivers/helpers/polling_ops.d.ts.map +0 -1
- package/dist/drivers/helpers/read_file.d.ts +0 -12
- package/dist/drivers/helpers/read_file.d.ts.map +0 -1
- package/dist/drivers/helpers/test_helpers.d.ts +0 -2
- package/dist/drivers/helpers/test_helpers.d.ts.map +0 -1
- package/dist/drivers/logs.d.ts.map +0 -1
- package/dist/drivers/logs_stream.d.ts.map +0 -1
- package/dist/drivers/ls.d.ts.map +0 -1
- package/dist/drivers/types.d.ts.map +0 -1
- package/dist/drivers/upload.d.ts.map +0 -1
- package/dist/drivers/upload_task.d.ts.map +0 -1
- package/dist/drivers/urls/url.d.ts +0 -13
- package/dist/drivers/urls/url.d.ts.map +0 -1
- package/dist/drivers/virtual_storages.d.ts.map +0 -1
- package/dist/helpers/download.d.ts.map +0 -1
- package/dist/helpers/download_errors.d.ts.map +0 -1
- package/dist/helpers/validate.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +0 -46
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts +0 -108
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts.map +0 -1
- package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts.map +0 -1
- package/dist/proto-grpc/google/api/http.d.ts +0 -460
- package/dist/proto-grpc/google/api/http.d.ts.map +0 -1
- package/dist/proto-grpc/google/protobuf/descriptor.d.ts +0 -2340
- package/dist/proto-grpc/google/protobuf/descriptor.d.ts.map +0 -1
- package/dist/proto-grpc/google/protobuf/duration.d.ts.map +0 -1
- package/dist/proto-grpc/google/protobuf/timestamp.d.ts.map +0 -1
- package/dist/proto-rest/downloadapi.d.ts.map +0 -1
- package/dist/proto-rest/index.d.ts.map +0 -1
- package/dist/proto-rest/lsapi.d.ts +0 -148
- package/dist/proto-rest/lsapi.d.ts.map +0 -1
- package/dist/proto-rest/progressapi.d.ts.map +0 -1
- package/dist/proto-rest/streamingapi.d.ts.map +0 -1
- package/dist/proto-rest/uploadapi.d.ts +0 -355
- package/dist/proto-rest/uploadapi.d.ts.map +0 -1
- package/dist/test_env.d.ts +0 -6
- package/dist/test_env.d.ts.map +0 -1
|
@@ -1,208 +1,179 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_ranges = require('./ranges.cjs');
|
|
3
|
+
const require_file = require('./file.cjs');
|
|
4
|
+
let _milaboratories_ts_helpers = require("@milaboratories/ts-helpers");
|
|
5
|
+
let _milaboratories_helpers = require("@milaboratories/helpers");
|
|
6
|
+
let node_fs = require("node:fs");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
node_path = require_runtime.__toESM(node_path);
|
|
9
9
|
|
|
10
|
+
//#region src/drivers/download_blob/sparse_cache/cache.ts
|
|
10
11
|
/** The implementer of SparseCacheRanges could throw it if ranges were corrupted. */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
12
|
+
var CorruptedRangesError = class extends Error {
|
|
13
|
+
name = "CorruptedRangesError";
|
|
14
|
+
};
|
|
14
15
|
/** Stores ranges in a directory as JSON files (the default implementation). */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}
|
|
16
|
+
var SparseCacheFsRanges = class {
|
|
17
|
+
constructor(logger, cacheDir) {
|
|
18
|
+
this.logger = logger;
|
|
19
|
+
this.cacheDir = cacheDir;
|
|
20
|
+
}
|
|
21
|
+
fPath(key) {
|
|
22
|
+
return node_path.default.join(this.cacheDir, require_ranges.rangesFileName(key));
|
|
23
|
+
}
|
|
24
|
+
async get(key) {
|
|
25
|
+
return await require_ranges.readRangesFile(this.logger, this.fPath(key));
|
|
26
|
+
}
|
|
27
|
+
async set(key, ranges) {
|
|
28
|
+
return await require_ranges.writeRangesFile(this.logger, this.fPath(key), ranges);
|
|
29
|
+
}
|
|
30
|
+
async delete(key) {
|
|
31
|
+
await node_fs.promises.rm(this.fPath(key));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
35
34
|
/** Stores sparse files in a directory (the default implementation). */
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
await fs.promises.rm(this.path(key));
|
|
61
|
-
}
|
|
62
|
-
}
|
|
35
|
+
var SparseCacheFsFile = class {
|
|
36
|
+
suffix = ".sparse.bin";
|
|
37
|
+
constructor(logger, cacheDir) {
|
|
38
|
+
this.logger = logger;
|
|
39
|
+
this.cacheDir = cacheDir;
|
|
40
|
+
}
|
|
41
|
+
async all() {
|
|
42
|
+
await (0, _milaboratories_ts_helpers.ensureDirExists)(this.cacheDir);
|
|
43
|
+
return (await node_fs.promises.readdir(this.cacheDir)).filter((f) => f.endsWith(this.suffix));
|
|
44
|
+
}
|
|
45
|
+
async exists(key) {
|
|
46
|
+
return await (0, _milaboratories_ts_helpers.fileExists)(this.path(key));
|
|
47
|
+
}
|
|
48
|
+
path(key) {
|
|
49
|
+
return node_path.default.join(this.cacheDir, key + this.suffix);
|
|
50
|
+
}
|
|
51
|
+
async write(key, data, from) {
|
|
52
|
+
await (0, _milaboratories_ts_helpers.ensureDirExists)(this.cacheDir);
|
|
53
|
+
await require_file.writeToSparseFile(this.logger, process.platform, this.path(key), data, from);
|
|
54
|
+
}
|
|
55
|
+
async delete(key) {
|
|
56
|
+
await node_fs.promises.rm(this.path(key));
|
|
57
|
+
}
|
|
58
|
+
};
|
|
63
59
|
/** LRU cache for ranges of sparse files. */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
catch (e) {
|
|
170
|
-
if (e instanceof CorruptedRangesError) {
|
|
171
|
-
// We need to reset a state of the cache and update current size,
|
|
172
|
-
// it's the only way to calculate the real size when one of the ranges were corrupted.
|
|
173
|
-
await this.rmKey(key);
|
|
174
|
-
await this.resetUnsafe();
|
|
175
|
-
return await this.ranges.get(key);
|
|
176
|
-
}
|
|
177
|
-
throw e;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/** Removes a key the state of the cache. The size should be updated. */
|
|
181
|
-
async rmKey(key) {
|
|
182
|
-
await this.storage.delete(key);
|
|
183
|
-
await this.ranges.delete(key);
|
|
184
|
-
this.keyToLastAccessTime.delete(key);
|
|
185
|
-
}
|
|
186
|
-
async dispose() {
|
|
187
|
-
await this.lock.acquireAsync();
|
|
188
|
-
}
|
|
189
|
-
async [Symbol.asyncDispose]() {
|
|
190
|
-
await this.dispose();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
60
|
+
var SparseCache = class {
|
|
61
|
+
/** Fields are public for tests. */
|
|
62
|
+
/** The lock to make sure cache requests are done one by one. */
|
|
63
|
+
lock = new _milaboratories_helpers.functions.AwaitLock();
|
|
64
|
+
keyToLastAccessTime = /* @__PURE__ */ new Map();
|
|
65
|
+
size = 0;
|
|
66
|
+
constructor(logger, maxSize, ranges, storage) {
|
|
67
|
+
this.logger = logger;
|
|
68
|
+
this.maxSize = maxSize;
|
|
69
|
+
this.ranges = ranges;
|
|
70
|
+
this.storage = storage;
|
|
71
|
+
}
|
|
72
|
+
/** Resets a cache's size by rereading everything we already store.
|
|
73
|
+
* Safe for concurrent use. */
|
|
74
|
+
async reset() {
|
|
75
|
+
await withLock(this.lock, async () => {
|
|
76
|
+
await this.resetUnsafe();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** Returns a path to the key if the range exists in a cache, otherwise returns undefined.
|
|
80
|
+
* Safe for concurrent use. */
|
|
81
|
+
async get(key, range) {
|
|
82
|
+
return await withLock(this.lock, async () => {
|
|
83
|
+
return await this.getUnsafe(key, range);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/** Sets data to the cache's file and clear the cache if it's needed.
|
|
87
|
+
* Safe for concurrent use. */
|
|
88
|
+
async set(key, range, data) {
|
|
89
|
+
await withLock(this.lock, async () => {
|
|
90
|
+
await this.setUnsafe(key, range, data);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async resetUnsafe() {
|
|
94
|
+
this.size = 0;
|
|
95
|
+
this.keyToLastAccessTime = /* @__PURE__ */ new Map();
|
|
96
|
+
const now = /* @__PURE__ */ new Date();
|
|
97
|
+
for (const key of await this.storage.all()) {
|
|
98
|
+
const ranges = await this.ranges.get(key);
|
|
99
|
+
this.size += require_ranges.rangesSize(ranges);
|
|
100
|
+
this.keyToLastAccessTime.set(key, now);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async getUnsafe(key, range) {
|
|
104
|
+
if (await this.storage.exists(key)) {
|
|
105
|
+
this.keyToLastAccessTime.set(key, /* @__PURE__ */ new Date());
|
|
106
|
+
if (require_ranges.doesRangeExist(await this.getRanges(key), range)) return this.storage.path(key);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async setUnsafe(key, range, data) {
|
|
111
|
+
await this.setWithoutEviction(key, range, data);
|
|
112
|
+
await this.ensureEvicted();
|
|
113
|
+
}
|
|
114
|
+
/** Sets a key and recalculates a size, but doesn't ensures that the size is less than the hard limit. */
|
|
115
|
+
async setWithoutEviction(key, range, data) {
|
|
116
|
+
if (range.to - range.from !== data.length) throw new Error(`SparseCache.set: trying to set ${key} with wrong range length: range: ${JSON.stringify(range)}, data: ${data.length}`);
|
|
117
|
+
this.keyToLastAccessTime.set(key, /* @__PURE__ */ new Date());
|
|
118
|
+
const ranges = await this.getRanges(key);
|
|
119
|
+
this.size -= require_ranges.rangesSize(ranges);
|
|
120
|
+
await this.storage.write(key, data, range.from);
|
|
121
|
+
const newRanges = require_ranges.addRange(ranges, range);
|
|
122
|
+
this.size += require_ranges.rangesSize(newRanges);
|
|
123
|
+
await this.ranges.set(key, newRanges);
|
|
124
|
+
}
|
|
125
|
+
/** Ensures the size is less than hard limit by deleting the oldest keys. */
|
|
126
|
+
async ensureEvicted() {
|
|
127
|
+
const byTime = (0, _milaboratories_ts_helpers.mapEntries)(this.keyToLastAccessTime);
|
|
128
|
+
byTime.sort(([_, aDate], [__, bDate]) => bDate.getTime() - aDate.getTime());
|
|
129
|
+
while (this.size > this.maxSize) {
|
|
130
|
+
const keyAndDate = byTime.pop();
|
|
131
|
+
if (!keyAndDate) break;
|
|
132
|
+
const [key, _] = keyAndDate;
|
|
133
|
+
const ranges = await this.getRanges(key);
|
|
134
|
+
this.size -= require_ranges.rangesSize(ranges);
|
|
135
|
+
this.rmKey(key);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Gets ranges and if they were corrupted, then remove the file from the cache and reset the cache's size. */
|
|
139
|
+
async getRanges(key) {
|
|
140
|
+
try {
|
|
141
|
+
return await this.ranges.get(key);
|
|
142
|
+
} catch (e) {
|
|
143
|
+
if (e instanceof CorruptedRangesError) {
|
|
144
|
+
await this.rmKey(key);
|
|
145
|
+
await this.resetUnsafe();
|
|
146
|
+
return await this.ranges.get(key);
|
|
147
|
+
}
|
|
148
|
+
throw e;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
/** Removes a key the state of the cache. The size should be updated. */
|
|
152
|
+
async rmKey(key) {
|
|
153
|
+
await this.storage.delete(key);
|
|
154
|
+
await this.ranges.delete(key);
|
|
155
|
+
this.keyToLastAccessTime.delete(key);
|
|
156
|
+
}
|
|
157
|
+
async dispose() {
|
|
158
|
+
await this.lock.acquireAsync();
|
|
159
|
+
}
|
|
160
|
+
async [Symbol.asyncDispose]() {
|
|
161
|
+
await this.dispose();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
193
164
|
/** Acquires the lock and executes a callback. */
|
|
194
165
|
async function withLock(lock, cb) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
166
|
+
try {
|
|
167
|
+
await lock.acquireAsync();
|
|
168
|
+
return await cb();
|
|
169
|
+
} finally {
|
|
170
|
+
lock.release();
|
|
171
|
+
}
|
|
202
172
|
}
|
|
203
173
|
|
|
174
|
+
//#endregion
|
|
204
175
|
exports.CorruptedRangesError = CorruptedRangesError;
|
|
205
176
|
exports.SparseCache = SparseCache;
|
|
206
177
|
exports.SparseCacheFsFile = SparseCacheFsFile;
|
|
207
178
|
exports.SparseCacheFsRanges = SparseCacheFsRanges;
|
|
208
|
-
//# sourceMappingURL=cache.cjs.map
|
|
179
|
+
//# sourceMappingURL=cache.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.cjs","sources":["../../../../src/drivers/download_blob/sparse_cache/cache.ts"],"sourcesContent":["import { RangeBytes } from \"@milaboratories/pl-model-common\";\nimport { ensureDirExists, fileExists, mapEntries, MiLogger } from \"@milaboratories/ts-helpers\";\nimport { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport {\n addRange,\n doesRangeExist,\n Ranges,\n rangesFileName,\n rangesSize,\n readRangesFile,\n writeRangesFile,\n} from \"./ranges\";\nimport { writeToSparseFile } from \"./file\";\nimport { functions } from \"@milaboratories/helpers\";\n\n/** The implementer of SparseCacheRanges could throw it if ranges were corrupted. */\nexport class CorruptedRangesError extends Error {\n name = \"CorruptedRangesError\";\n}\n\n/** Extracted ranges methods to be able to store ranges somewhere else (e.g. in memory for tests). */\nexport interface SparseCacheRanges {\n get(key: string): Promise<Ranges>;\n set(key: string, ranges: Ranges): Promise<void>;\n delete(key: string): Promise<void>;\n}\n\n/** Stores ranges in a directory as JSON files (the default implementation). */\nexport class SparseCacheFsRanges implements SparseCacheRanges {\n constructor(\n private readonly logger: MiLogger,\n private readonly cacheDir: string,\n ) {}\n\n private fPath(key: string): string {\n return path.join(this.cacheDir, rangesFileName(key));\n }\n\n async get(key: string): Promise<Ranges> {\n return await readRangesFile(this.logger, this.fPath(key));\n }\n\n async set(key: string, ranges: Ranges) {\n return await writeRangesFile(this.logger, this.fPath(key), ranges);\n }\n\n async delete(key: string) {\n await fs.rm(this.fPath(key));\n }\n}\n\n/** Extracted interface for storing sparse files. */\nexport interface SparseFileStorage {\n all(): Promise<string[]>;\n exists(key: string): Promise<boolean>;\n path(key: string): string;\n write(key: string, data: Uint8Array, from: number): Promise<void>;\n delete(key: string): Promise<void>;\n}\n\n/** Stores sparse files in a directory (the default implementation). */\nexport class SparseCacheFsFile implements SparseFileStorage {\n private readonly suffix = \".sparse.bin\";\n\n constructor(\n private readonly logger: MiLogger,\n private readonly cacheDir: string,\n ) {}\n\n async all(): Promise<string[]> {\n await ensureDirExists(this.cacheDir);\n const files = await fs.readdir(this.cacheDir);\n return files.filter((f) => f.endsWith(this.suffix));\n }\n\n async exists(key: string): Promise<boolean> {\n return await fileExists(this.path(key));\n }\n\n path(key: string): string {\n return path.join(this.cacheDir, key + this.suffix);\n }\n\n async write(key: string, data: Uint8Array, from: number): Promise<void> {\n await ensureDirExists(this.cacheDir);\n await writeToSparseFile(this.logger, process.platform, this.path(key), data, from);\n }\n\n async delete(key: string): Promise<void> {\n await fs.rm(this.path(key));\n }\n}\n\n/** LRU cache for ranges of sparse files. */\nexport class SparseCache implements AsyncDisposable {\n /** Fields are public for tests. */\n\n /** The lock to make sure cache requests are done one by one. */\n private lock = new functions.AwaitLock();\n\n public keyToLastAccessTime = new Map<string, Date>();\n public size = 0;\n\n constructor(\n public readonly logger: MiLogger,\n /** The hard limit in bytes. */\n public readonly maxSize: number,\n public readonly ranges: SparseCacheRanges,\n public readonly storage: SparseFileStorage,\n ) {}\n\n /** Resets a cache's size by rereading everything we already store.\n * Safe for concurrent use. */\n async reset() {\n await withLock(this.lock, async () => {\n await this.resetUnsafe();\n });\n }\n\n /** Returns a path to the key if the range exists in a cache, otherwise returns undefined.\n * Safe for concurrent use. */\n async get(key: string, range: RangeBytes): Promise<string | undefined> {\n return await withLock(this.lock, async () => {\n return await this.getUnsafe(key, range);\n });\n }\n\n /** Sets data to the cache's file and clear the cache if it's needed.\n * Safe for concurrent use. */\n async set(key: string, range: RangeBytes, data: Uint8Array): Promise<void> {\n await withLock(this.lock, async () => {\n await this.setUnsafe(key, range, data);\n });\n }\n\n private async resetUnsafe() {\n this.size = 0;\n this.keyToLastAccessTime = new Map<string, Date>();\n\n const now = new Date();\n // In rmKey method we first deletes the key from a storage and only then from ranges,\n // so if something goes wrong between 2 operations,\n // on reset the logic will be correct.\n for (const key of await this.storage.all()) {\n const ranges = await this.ranges.get(key);\n this.size += rangesSize(ranges);\n this.keyToLastAccessTime.set(key, now);\n }\n }\n\n private async getUnsafe(key: string, range: RangeBytes): Promise<string | undefined> {\n // It first checks the storage, and then the ranges.\n // In another method, when we remove a key, it first deletes a key from a storage and then from ranges,\n // so if we don't have a key in storage but have it in ranges, the logic here is correct.\n // We probably could reverse the operations here and there, and everywhere we work with both storage and ranges.\n if (await this.storage.exists(key)) {\n this.keyToLastAccessTime.set(key, new Date());\n\n const ranges = await this.getRanges(key);\n if (doesRangeExist(ranges, range)) {\n return this.storage.path(key);\n }\n\n return undefined;\n }\n\n return undefined;\n }\n\n private async setUnsafe(key: string, range: { from: number; to: number }, data: Uint8Array) {\n await this.setWithoutEviction(key, range, data);\n await this.ensureEvicted();\n }\n\n /** Sets a key and recalculates a size, but doesn't ensures that the size is less than the hard limit. */\n async setWithoutEviction(key: string, range: RangeBytes, data: Uint8Array): Promise<void> {\n if (range.to - range.from !== data.length) {\n throw new Error(\n `SparseCache.set: trying to set ${key} with wrong range length: ` +\n `range: ${JSON.stringify(range)}, data: ${data.length}`,\n );\n }\n\n this.keyToLastAccessTime.set(key, new Date());\n\n const ranges = await this.getRanges(key);\n this.size -= rangesSize(ranges);\n\n await this.storage.write(key, data, range.from);\n\n const newRanges = addRange(ranges, range);\n this.size += rangesSize(newRanges);\n\n await this.ranges.set(key, newRanges);\n }\n\n /** Ensures the size is less than hard limit by deleting the oldest keys. */\n async ensureEvicted(): Promise<void> {\n const byTime = mapEntries(this.keyToLastAccessTime);\n byTime.sort(([_, aDate], [__, bDate]) => bDate.getTime() - aDate.getTime());\n\n while (this.size > this.maxSize) {\n const keyAndDate = byTime.pop(); // removes the oldest\n if (!keyAndDate) {\n break;\n }\n const [key, _] = keyAndDate;\n\n const ranges = await this.getRanges(key);\n this.size -= rangesSize(ranges);\n this.rmKey(key);\n }\n }\n\n /** Gets ranges and if they were corrupted, then remove the file from the cache and reset the cache's size. */\n private async getRanges(key: string) {\n try {\n return await this.ranges.get(key);\n } catch (e: unknown) {\n if (e instanceof CorruptedRangesError) {\n // We need to reset a state of the cache and update current size,\n // it's the only way to calculate the real size when one of the ranges were corrupted.\n await this.rmKey(key);\n await this.resetUnsafe();\n\n return await this.ranges.get(key);\n }\n\n throw e;\n }\n }\n\n /** Removes a key the state of the cache. The size should be updated. */\n private async rmKey(key: string) {\n await this.storage.delete(key);\n await this.ranges.delete(key);\n this.keyToLastAccessTime.delete(key);\n }\n\n async dispose(): Promise<void> {\n await this.lock.acquireAsync();\n }\n\n async [Symbol.asyncDispose](): Promise<void> {\n await this.dispose();\n }\n}\n\n/** Acquires the lock and executes a callback. */\nasync function withLock<T>(lock: functions.AwaitLock, cb: () => Promise<T>): Promise<T> {\n try {\n await lock.acquireAsync();\n return await cb();\n } finally {\n lock.release();\n }\n}\n"],"names":["rangesFileName","readRangesFile","ranges","writeRangesFile","fs","ensureDirExists","fileExists","writeToSparseFile","functions","rangesSize","doesRangeExist","addRange","mapEntries"],"mappings":";;;;;;;;;AAgBA;AACM,MAAO,oBAAqB,SAAQ,KAAK,CAAA;IAC7C,IAAI,GAAG,sBAAsB;AAC9B;AASD;MACa,mBAAmB,CAAA;AAEX,IAAA,MAAA;AACA,IAAA,QAAA;IAFnB,WAAA,CACmB,MAAgB,EAChB,QAAgB,EAAA;QADhB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,QAAQ,GAAR,QAAQ;IACxB;AAEK,IAAA,KAAK,CAAC,GAAW,EAAA;AACvB,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAEA,qBAAc,CAAC,GAAG,CAAC,CAAC;IACtD;IAEA,MAAM,GAAG,CAAC,GAAW,EAAA;AACnB,QAAA,OAAO,MAAMC,qBAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,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,CAAI,IAAyB,EAAE,EAAoB,EAAA;AACxE,IAAA,IAAI;AACF,QAAA,MAAM,IAAI,CAAC,YAAY,EAAE;QACzB,OAAO,MAAM,EAAE,EAAE;IACnB;YAAU;QACR,IAAI,CAAC,OAAO,EAAE;IAChB;AACF;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"cache.cjs","names":["path","rangesFileName","readRangesFile","writeRangesFile","fs","writeToSparseFile","functions","rangesSize","doesRangeExist","addRange"],"sources":["../../../../src/drivers/download_blob/sparse_cache/cache.ts"],"sourcesContent":["import { RangeBytes } from \"@milaboratories/pl-model-common\";\nimport { ensureDirExists, fileExists, mapEntries, MiLogger } from \"@milaboratories/ts-helpers\";\nimport { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nimport {\n addRange,\n doesRangeExist,\n Ranges,\n rangesFileName,\n rangesSize,\n readRangesFile,\n writeRangesFile,\n} from \"./ranges\";\nimport { writeToSparseFile } from \"./file\";\nimport { functions } from \"@milaboratories/helpers\";\n\n/** The implementer of SparseCacheRanges could throw it if ranges were corrupted. */\nexport class CorruptedRangesError extends Error {\n name = \"CorruptedRangesError\";\n}\n\n/** Extracted ranges methods to be able to store ranges somewhere else (e.g. in memory for tests). */\nexport interface SparseCacheRanges {\n get(key: string): Promise<Ranges>;\n set(key: string, ranges: Ranges): Promise<void>;\n delete(key: string): Promise<void>;\n}\n\n/** Stores ranges in a directory as JSON files (the default implementation). */\nexport class SparseCacheFsRanges implements SparseCacheRanges {\n constructor(\n private readonly logger: MiLogger,\n private readonly cacheDir: string,\n ) {}\n\n private fPath(key: string): string {\n return path.join(this.cacheDir, rangesFileName(key));\n }\n\n async get(key: string): Promise<Ranges> {\n return await readRangesFile(this.logger, this.fPath(key));\n }\n\n async set(key: string, ranges: Ranges) {\n return await writeRangesFile(this.logger, this.fPath(key), ranges);\n }\n\n async delete(key: string) {\n await fs.rm(this.fPath(key));\n }\n}\n\n/** Extracted interface for storing sparse files. */\nexport interface SparseFileStorage {\n all(): Promise<string[]>;\n exists(key: string): Promise<boolean>;\n path(key: string): string;\n write(key: string, data: Uint8Array, from: number): Promise<void>;\n delete(key: string): Promise<void>;\n}\n\n/** Stores sparse files in a directory (the default implementation). */\nexport class SparseCacheFsFile implements SparseFileStorage {\n private readonly suffix = \".sparse.bin\";\n\n constructor(\n private readonly logger: MiLogger,\n private readonly cacheDir: string,\n ) {}\n\n async all(): Promise<string[]> {\n await ensureDirExists(this.cacheDir);\n const files = await fs.readdir(this.cacheDir);\n return files.filter((f) => f.endsWith(this.suffix));\n }\n\n async exists(key: string): Promise<boolean> {\n return await fileExists(this.path(key));\n }\n\n path(key: string): string {\n return path.join(this.cacheDir, key + this.suffix);\n }\n\n async write(key: string, data: Uint8Array, from: number): Promise<void> {\n await ensureDirExists(this.cacheDir);\n await writeToSparseFile(this.logger, process.platform, this.path(key), data, from);\n }\n\n async delete(key: string): Promise<void> {\n await fs.rm(this.path(key));\n }\n}\n\n/** LRU cache for ranges of sparse files. */\nexport class SparseCache implements AsyncDisposable {\n /** Fields are public for tests. */\n\n /** The lock to make sure cache requests are done one by one. */\n private lock = new functions.AwaitLock();\n\n public keyToLastAccessTime = new Map<string, Date>();\n public size = 0;\n\n constructor(\n public readonly logger: MiLogger,\n /** The hard limit in bytes. */\n public readonly maxSize: number,\n public readonly ranges: SparseCacheRanges,\n public readonly storage: SparseFileStorage,\n ) {}\n\n /** Resets a cache's size by rereading everything we already store.\n * Safe for concurrent use. */\n async reset() {\n await withLock(this.lock, async () => {\n await this.resetUnsafe();\n });\n }\n\n /** Returns a path to the key if the range exists in a cache, otherwise returns undefined.\n * Safe for concurrent use. */\n async get(key: string, range: RangeBytes): Promise<string | undefined> {\n return await withLock(this.lock, async () => {\n return await this.getUnsafe(key, range);\n });\n }\n\n /** Sets data to the cache's file and clear the cache if it's needed.\n * Safe for concurrent use. */\n async set(key: string, range: RangeBytes, data: Uint8Array): Promise<void> {\n await withLock(this.lock, async () => {\n await this.setUnsafe(key, range, data);\n });\n }\n\n private async resetUnsafe() {\n this.size = 0;\n this.keyToLastAccessTime = new Map<string, Date>();\n\n const now = new Date();\n // In rmKey method we first deletes the key from a storage and only then from ranges,\n // so if something goes wrong between 2 operations,\n // on reset the logic will be correct.\n for (const key of await this.storage.all()) {\n const ranges = await this.ranges.get(key);\n this.size += rangesSize(ranges);\n this.keyToLastAccessTime.set(key, now);\n }\n }\n\n private async getUnsafe(key: string, range: RangeBytes): Promise<string | undefined> {\n // It first checks the storage, and then the ranges.\n // In another method, when we remove a key, it first deletes a key from a storage and then from ranges,\n // so if we don't have a key in storage but have it in ranges, the logic here is correct.\n // We probably could reverse the operations here and there, and everywhere we work with both storage and ranges.\n if (await this.storage.exists(key)) {\n this.keyToLastAccessTime.set(key, new Date());\n\n const ranges = await this.getRanges(key);\n if (doesRangeExist(ranges, range)) {\n return this.storage.path(key);\n }\n\n return undefined;\n }\n\n return undefined;\n }\n\n private async setUnsafe(key: string, range: { from: number; to: number }, data: Uint8Array) {\n await this.setWithoutEviction(key, range, data);\n await this.ensureEvicted();\n }\n\n /** Sets a key and recalculates a size, but doesn't ensures that the size is less than the hard limit. */\n async setWithoutEviction(key: string, range: RangeBytes, data: Uint8Array): Promise<void> {\n if (range.to - range.from !== data.length) {\n throw new Error(\n `SparseCache.set: trying to set ${key} with wrong range length: ` +\n `range: ${JSON.stringify(range)}, data: ${data.length}`,\n );\n }\n\n this.keyToLastAccessTime.set(key, new Date());\n\n const ranges = await this.getRanges(key);\n this.size -= rangesSize(ranges);\n\n await this.storage.write(key, data, range.from);\n\n const newRanges = addRange(ranges, range);\n this.size += rangesSize(newRanges);\n\n await this.ranges.set(key, newRanges);\n }\n\n /** Ensures the size is less than hard limit by deleting the oldest keys. */\n async ensureEvicted(): Promise<void> {\n const byTime = mapEntries(this.keyToLastAccessTime);\n byTime.sort(([_, aDate], [__, bDate]) => bDate.getTime() - aDate.getTime());\n\n while (this.size > this.maxSize) {\n const keyAndDate = byTime.pop(); // removes the oldest\n if (!keyAndDate) {\n break;\n }\n const [key, _] = keyAndDate;\n\n const ranges = await this.getRanges(key);\n this.size -= rangesSize(ranges);\n this.rmKey(key);\n }\n }\n\n /** Gets ranges and if they were corrupted, then remove the file from the cache and reset the cache's size. */\n private async getRanges(key: string) {\n try {\n return await this.ranges.get(key);\n } catch (e: unknown) {\n if (e instanceof CorruptedRangesError) {\n // We need to reset a state of the cache and update current size,\n // it's the only way to calculate the real size when one of the ranges were corrupted.\n await this.rmKey(key);\n await this.resetUnsafe();\n\n return await this.ranges.get(key);\n }\n\n throw e;\n }\n }\n\n /** Removes a key the state of the cache. The size should be updated. */\n private async rmKey(key: string) {\n await this.storage.delete(key);\n await this.ranges.delete(key);\n this.keyToLastAccessTime.delete(key);\n }\n\n async dispose(): Promise<void> {\n await this.lock.acquireAsync();\n }\n\n async [Symbol.asyncDispose](): Promise<void> {\n await this.dispose();\n }\n}\n\n/** Acquires the lock and executes a callback. */\nasync function withLock<T>(lock: functions.AwaitLock, cb: () => Promise<T>): Promise<T> {\n try {\n await lock.acquireAsync();\n return await cb();\n } finally {\n lock.release();\n }\n}\n"],"mappings":";;;;;;;;;;;AAiBA,IAAa,uBAAb,cAA0C,MAAM;CAC9C,OAAO;;;AAWT,IAAa,sBAAb,MAA8D;CAC5D,YACE,AAAiB,QACjB,AAAiB,UACjB;EAFiB;EACA;;CAGnB,AAAQ,MAAM,KAAqB;AACjC,SAAOA,kBAAK,KAAK,KAAK,UAAUC,8BAAe,IAAI,CAAC;;CAGtD,MAAM,IAAI,KAA8B;AACtC,SAAO,MAAMC,8BAAe,KAAK,QAAQ,KAAK,MAAM,IAAI,CAAC;;CAG3D,MAAM,IAAI,KAAa,QAAgB;AACrC,SAAO,MAAMC,+BAAgB,KAAK,QAAQ,KAAK,MAAM,IAAI,EAAE,OAAO;;CAGpE,MAAM,OAAO,KAAa;AACxB,QAAMC,iBAAG,GAAG,KAAK,MAAM,IAAI,CAAC;;;;AAchC,IAAa,oBAAb,MAA4D;CAC1D,AAAiB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