@milaboratories/pl-drivers 1.11.59 → 1.11.61
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,68 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var tsHelpers = require('@milaboratories/ts-helpers');
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let _milaboratories_ts_helpers = require("@milaboratories/ts-helpers");
|
|
4
3
|
|
|
4
|
+
//#region src/drivers/helpers/files_cache.ts
|
|
5
5
|
/** Holds counters of how many callers need the file.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (file.size < 0) {
|
|
55
|
-
throw new Error(`empty sizeBytes: ${file}`);
|
|
56
|
-
}
|
|
57
|
-
if (created) {
|
|
58
|
-
this.totalSizeBytes += file.size;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
removeCache(file) {
|
|
62
|
-
this.cache.delete(file.path);
|
|
63
|
-
this.totalSizeBytes -= file.size;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
6
|
+
* If some counters become zero and a cache size exceeds a soft limit,
|
|
7
|
+
* remove not needed blobs one by one.
|
|
8
|
+
* If all the files are needed, do nothing. */
|
|
9
|
+
var FilesCache = class {
|
|
10
|
+
cache = /* @__PURE__ */ new Map();
|
|
11
|
+
totalSizeBytes = 0;
|
|
12
|
+
constructor(softSizeBytes) {
|
|
13
|
+
this.softSizeBytes = softSizeBytes;
|
|
14
|
+
}
|
|
15
|
+
existsFile(path) {
|
|
16
|
+
return this.cache.get(path) != void 0;
|
|
17
|
+
}
|
|
18
|
+
getFile(path, callerId) {
|
|
19
|
+
const file = this.cache.get(path);
|
|
20
|
+
if (file != void 0) file.counter.inc(callerId);
|
|
21
|
+
return file;
|
|
22
|
+
}
|
|
23
|
+
/** Decrements a counter in a cache and if we exceeds
|
|
24
|
+
* a soft limit, removes files with zero counters. */
|
|
25
|
+
removeFile(path, callerId) {
|
|
26
|
+
(0, _milaboratories_ts_helpers.mapGet)(this.cache, path).counter.dec(callerId);
|
|
27
|
+
return this.toDelete();
|
|
28
|
+
}
|
|
29
|
+
/** Returns what results should be deleted to comply with the soft limit. */
|
|
30
|
+
toDelete() {
|
|
31
|
+
if (this.totalSizeBytes <= this.softSizeBytes) return [];
|
|
32
|
+
const result = [];
|
|
33
|
+
let freedBytes = 0;
|
|
34
|
+
(0, _milaboratories_ts_helpers.mapEntries)(this.cache).filter(([_, file]) => file.counter.isZero()).forEach(([path, _]) => {
|
|
35
|
+
if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) return;
|
|
36
|
+
const file = (0, _milaboratories_ts_helpers.mapGet)(this.cache, path);
|
|
37
|
+
freedBytes += file.size;
|
|
38
|
+
result.push(file);
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
addCache(file, callerId) {
|
|
43
|
+
const created = this.cache.get(file.path) == void 0;
|
|
44
|
+
this.cache.set(file.path, file);
|
|
45
|
+
file.counter.inc(callerId);
|
|
46
|
+
if (file.size < 0) throw new Error(`empty sizeBytes: ${file}`);
|
|
47
|
+
if (created) this.totalSizeBytes += file.size;
|
|
48
|
+
}
|
|
49
|
+
removeCache(file) {
|
|
50
|
+
this.cache.delete(file.path);
|
|
51
|
+
this.totalSizeBytes -= file.size;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
66
54
|
|
|
55
|
+
//#endregion
|
|
67
56
|
exports.FilesCache = FilesCache;
|
|
68
|
-
//# sourceMappingURL=files_cache.cjs.map
|
|
57
|
+
//# sourceMappingURL=files_cache.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files_cache.cjs","sources":["../../../src/drivers/helpers/files_cache.ts"],"sourcesContent":["import type { CallersCounter } from \"@milaboratories/ts-helpers\";\nimport { mapEntries, mapGet } from \"@milaboratories/ts-helpers\";\n\ntype PathLike = string;\n\nexport interface CachedFile {\n /** Size in bytes. */\n size: number;\n path: PathLike;\n counter: CallersCounter;\n}\n\n/** Holds counters of how many callers need the file.\n * If some counters become zero and a cache size exceeds a soft limit,\n * remove not needed blobs one by one.\n * If all the files are needed, do nothing. */\nexport class FilesCache<T extends CachedFile> {\n private cache: Map<PathLike, T> = new Map();\n private totalSizeBytes: number = 0;\n\n constructor(private readonly softSizeBytes: number) {}\n\n existsFile(path: PathLike): boolean {\n return this.cache.get(path) != undefined;\n }\n\n getFile(path: PathLike, callerId: string): T | undefined {\n const file = this.cache.get(path);\n if (file != undefined) {\n file.counter.inc(callerId);\n }\n\n return file;\n }\n\n /** Decrements a counter in a cache and if we exceeds\n * a soft limit, removes files with zero counters. */\n removeFile(path: PathLike, callerId: string): T[] {\n mapGet(this.cache, path).counter.dec(callerId);\n return this.toDelete();\n }\n\n /** Returns what results should be deleted to comply with the soft limit. */\n toDelete(): T[] {\n if (this.totalSizeBytes <= this.softSizeBytes) return [];\n\n const result: T[] = [];\n let freedBytes = 0;\n\n mapEntries(this.cache)\n .filter(([_, file]: [string, T]) => file.counter.isZero())\n .forEach(([path, _]) => {\n if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) {\n return;\n }\n\n const file = mapGet(this.cache, path);\n freedBytes += file.size;\n result.push(file);\n });\n\n return result;\n }\n\n addCache(file: T, callerId: string) {\n const created = this.cache.get(file.path) == undefined;\n this.cache.set(file.path, file);\n file.counter.inc(callerId);\n\n if (file.size < 0) {\n throw new Error(`empty sizeBytes: ${file}`);\n }\n\n if (created) {\n this.totalSizeBytes += file.size;\n }\n }\n\n removeCache(file: T) {\n this.cache.delete(file.path);\n this.totalSizeBytes -= file.size;\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"files_cache.cjs","names":[],"sources":["../../../src/drivers/helpers/files_cache.ts"],"sourcesContent":["import type { CallersCounter } from \"@milaboratories/ts-helpers\";\nimport { mapEntries, mapGet } from \"@milaboratories/ts-helpers\";\n\ntype PathLike = string;\n\nexport interface CachedFile {\n /** Size in bytes. */\n size: number;\n path: PathLike;\n counter: CallersCounter;\n}\n\n/** Holds counters of how many callers need the file.\n * If some counters become zero and a cache size exceeds a soft limit,\n * remove not needed blobs one by one.\n * If all the files are needed, do nothing. */\nexport class FilesCache<T extends CachedFile> {\n private cache: Map<PathLike, T> = new Map();\n private totalSizeBytes: number = 0;\n\n constructor(private readonly softSizeBytes: number) {}\n\n existsFile(path: PathLike): boolean {\n return this.cache.get(path) != undefined;\n }\n\n getFile(path: PathLike, callerId: string): T | undefined {\n const file = this.cache.get(path);\n if (file != undefined) {\n file.counter.inc(callerId);\n }\n\n return file;\n }\n\n /** Decrements a counter in a cache and if we exceeds\n * a soft limit, removes files with zero counters. */\n removeFile(path: PathLike, callerId: string): T[] {\n mapGet(this.cache, path).counter.dec(callerId);\n return this.toDelete();\n }\n\n /** Returns what results should be deleted to comply with the soft limit. */\n toDelete(): T[] {\n if (this.totalSizeBytes <= this.softSizeBytes) return [];\n\n const result: T[] = [];\n let freedBytes = 0;\n\n mapEntries(this.cache)\n .filter(([_, file]: [string, T]) => file.counter.isZero())\n .forEach(([path, _]) => {\n if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) {\n return;\n }\n\n const file = mapGet(this.cache, path);\n freedBytes += file.size;\n result.push(file);\n });\n\n return result;\n }\n\n addCache(file: T, callerId: string) {\n const created = this.cache.get(file.path) == undefined;\n this.cache.set(file.path, file);\n file.counter.inc(callerId);\n\n if (file.size < 0) {\n throw new Error(`empty sizeBytes: ${file}`);\n }\n\n if (created) {\n this.totalSizeBytes += file.size;\n }\n }\n\n removeCache(file: T) {\n this.cache.delete(file.path);\n this.totalSizeBytes -= file.size;\n }\n}\n"],"mappings":";;;;;;;;AAgBA,IAAa,aAAb,MAA8C;CAC5C,AAAQ,wBAA0B,IAAI,KAAK;CAC3C,AAAQ,iBAAyB;CAEjC,YAAY,AAAiB,eAAuB;EAAvB;;CAE7B,WAAW,MAAyB;AAClC,SAAO,KAAK,MAAM,IAAI,KAAK,IAAI;;CAGjC,QAAQ,MAAgB,UAAiC;EACvD,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK;AACjC,MAAI,QAAQ,OACV,MAAK,QAAQ,IAAI,SAAS;AAG5B,SAAO;;;;CAKT,WAAW,MAAgB,UAAuB;AAChD,yCAAO,KAAK,OAAO,KAAK,CAAC,QAAQ,IAAI,SAAS;AAC9C,SAAO,KAAK,UAAU;;;CAIxB,WAAgB;AACd,MAAI,KAAK,kBAAkB,KAAK,cAAe,QAAO,EAAE;EAExD,MAAM,SAAc,EAAE;EACtB,IAAI,aAAa;AAEjB,6CAAW,KAAK,MAAM,CACnB,QAAQ,CAAC,GAAG,UAAuB,KAAK,QAAQ,QAAQ,CAAC,CACzD,SAAS,CAAC,MAAM,OAAO;AACtB,OAAI,KAAK,iBAAiB,cAAc,KAAK,cAC3C;GAGF,MAAM,8CAAc,KAAK,OAAO,KAAK;AACrC,iBAAc,KAAK;AACnB,UAAO,KAAK,KAAK;IACjB;AAEJ,SAAO;;CAGT,SAAS,MAAS,UAAkB;EAClC,MAAM,UAAU,KAAK,MAAM,IAAI,KAAK,KAAK,IAAI;AAC7C,OAAK,MAAM,IAAI,KAAK,MAAM,KAAK;AAC/B,OAAK,QAAQ,IAAI,SAAS;AAE1B,MAAI,KAAK,OAAO,EACd,OAAM,IAAI,MAAM,oBAAoB,OAAO;AAG7C,MAAI,QACF,MAAK,kBAAkB,KAAK;;CAIhC,YAAY,MAAS;AACnB,OAAK,MAAM,OAAO,KAAK,KAAK;AAC5B,OAAK,kBAAkB,KAAK"}
|
|
@@ -1,66 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mapEntries, mapGet } from "@milaboratories/ts-helpers";
|
|
2
2
|
|
|
3
|
+
//#region src/drivers/helpers/files_cache.ts
|
|
3
4
|
/** Holds counters of how many callers need the file.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
if (file.size < 0) {
|
|
53
|
-
throw new Error(`empty sizeBytes: ${file}`);
|
|
54
|
-
}
|
|
55
|
-
if (created) {
|
|
56
|
-
this.totalSizeBytes += file.size;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
removeCache(file) {
|
|
60
|
-
this.cache.delete(file.path);
|
|
61
|
-
this.totalSizeBytes -= file.size;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
5
|
+
* If some counters become zero and a cache size exceeds a soft limit,
|
|
6
|
+
* remove not needed blobs one by one.
|
|
7
|
+
* If all the files are needed, do nothing. */
|
|
8
|
+
var FilesCache = class {
|
|
9
|
+
cache = /* @__PURE__ */ new Map();
|
|
10
|
+
totalSizeBytes = 0;
|
|
11
|
+
constructor(softSizeBytes) {
|
|
12
|
+
this.softSizeBytes = softSizeBytes;
|
|
13
|
+
}
|
|
14
|
+
existsFile(path) {
|
|
15
|
+
return this.cache.get(path) != void 0;
|
|
16
|
+
}
|
|
17
|
+
getFile(path, callerId) {
|
|
18
|
+
const file = this.cache.get(path);
|
|
19
|
+
if (file != void 0) file.counter.inc(callerId);
|
|
20
|
+
return file;
|
|
21
|
+
}
|
|
22
|
+
/** Decrements a counter in a cache and if we exceeds
|
|
23
|
+
* a soft limit, removes files with zero counters. */
|
|
24
|
+
removeFile(path, callerId) {
|
|
25
|
+
mapGet(this.cache, path).counter.dec(callerId);
|
|
26
|
+
return this.toDelete();
|
|
27
|
+
}
|
|
28
|
+
/** Returns what results should be deleted to comply with the soft limit. */
|
|
29
|
+
toDelete() {
|
|
30
|
+
if (this.totalSizeBytes <= this.softSizeBytes) return [];
|
|
31
|
+
const result = [];
|
|
32
|
+
let freedBytes = 0;
|
|
33
|
+
mapEntries(this.cache).filter(([_, file]) => file.counter.isZero()).forEach(([path, _]) => {
|
|
34
|
+
if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) return;
|
|
35
|
+
const file = mapGet(this.cache, path);
|
|
36
|
+
freedBytes += file.size;
|
|
37
|
+
result.push(file);
|
|
38
|
+
});
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
addCache(file, callerId) {
|
|
42
|
+
const created = this.cache.get(file.path) == void 0;
|
|
43
|
+
this.cache.set(file.path, file);
|
|
44
|
+
file.counter.inc(callerId);
|
|
45
|
+
if (file.size < 0) throw new Error(`empty sizeBytes: ${file}`);
|
|
46
|
+
if (created) this.totalSizeBytes += file.size;
|
|
47
|
+
}
|
|
48
|
+
removeCache(file) {
|
|
49
|
+
this.cache.delete(file.path);
|
|
50
|
+
this.totalSizeBytes -= file.size;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
64
53
|
|
|
54
|
+
//#endregion
|
|
65
55
|
export { FilesCache };
|
|
66
|
-
//# sourceMappingURL=files_cache.js.map
|
|
56
|
+
//# sourceMappingURL=files_cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files_cache.js","sources":["../../../src/drivers/helpers/files_cache.ts"],"sourcesContent":["import type { CallersCounter } from \"@milaboratories/ts-helpers\";\nimport { mapEntries, mapGet } from \"@milaboratories/ts-helpers\";\n\ntype PathLike = string;\n\nexport interface CachedFile {\n /** Size in bytes. */\n size: number;\n path: PathLike;\n counter: CallersCounter;\n}\n\n/** Holds counters of how many callers need the file.\n * If some counters become zero and a cache size exceeds a soft limit,\n * remove not needed blobs one by one.\n * If all the files are needed, do nothing. */\nexport class FilesCache<T extends CachedFile> {\n private cache: Map<PathLike, T> = new Map();\n private totalSizeBytes: number = 0;\n\n constructor(private readonly softSizeBytes: number) {}\n\n existsFile(path: PathLike): boolean {\n return this.cache.get(path) != undefined;\n }\n\n getFile(path: PathLike, callerId: string): T | undefined {\n const file = this.cache.get(path);\n if (file != undefined) {\n file.counter.inc(callerId);\n }\n\n return file;\n }\n\n /** Decrements a counter in a cache and if we exceeds\n * a soft limit, removes files with zero counters. */\n removeFile(path: PathLike, callerId: string): T[] {\n mapGet(this.cache, path).counter.dec(callerId);\n return this.toDelete();\n }\n\n /** Returns what results should be deleted to comply with the soft limit. */\n toDelete(): T[] {\n if (this.totalSizeBytes <= this.softSizeBytes) return [];\n\n const result: T[] = [];\n let freedBytes = 0;\n\n mapEntries(this.cache)\n .filter(([_, file]: [string, T]) => file.counter.isZero())\n .forEach(([path, _]) => {\n if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) {\n return;\n }\n\n const file = mapGet(this.cache, path);\n freedBytes += file.size;\n result.push(file);\n });\n\n return result;\n }\n\n addCache(file: T, callerId: string) {\n const created = this.cache.get(file.path) == undefined;\n this.cache.set(file.path, file);\n file.counter.inc(callerId);\n\n if (file.size < 0) {\n throw new Error(`empty sizeBytes: ${file}`);\n }\n\n if (created) {\n this.totalSizeBytes += file.size;\n }\n }\n\n removeCache(file: T) {\n this.cache.delete(file.path);\n this.totalSizeBytes -= file.size;\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"files_cache.js","names":[],"sources":["../../../src/drivers/helpers/files_cache.ts"],"sourcesContent":["import type { CallersCounter } from \"@milaboratories/ts-helpers\";\nimport { mapEntries, mapGet } from \"@milaboratories/ts-helpers\";\n\ntype PathLike = string;\n\nexport interface CachedFile {\n /** Size in bytes. */\n size: number;\n path: PathLike;\n counter: CallersCounter;\n}\n\n/** Holds counters of how many callers need the file.\n * If some counters become zero and a cache size exceeds a soft limit,\n * remove not needed blobs one by one.\n * If all the files are needed, do nothing. */\nexport class FilesCache<T extends CachedFile> {\n private cache: Map<PathLike, T> = new Map();\n private totalSizeBytes: number = 0;\n\n constructor(private readonly softSizeBytes: number) {}\n\n existsFile(path: PathLike): boolean {\n return this.cache.get(path) != undefined;\n }\n\n getFile(path: PathLike, callerId: string): T | undefined {\n const file = this.cache.get(path);\n if (file != undefined) {\n file.counter.inc(callerId);\n }\n\n return file;\n }\n\n /** Decrements a counter in a cache and if we exceeds\n * a soft limit, removes files with zero counters. */\n removeFile(path: PathLike, callerId: string): T[] {\n mapGet(this.cache, path).counter.dec(callerId);\n return this.toDelete();\n }\n\n /** Returns what results should be deleted to comply with the soft limit. */\n toDelete(): T[] {\n if (this.totalSizeBytes <= this.softSizeBytes) return [];\n\n const result: T[] = [];\n let freedBytes = 0;\n\n mapEntries(this.cache)\n .filter(([_, file]: [string, T]) => file.counter.isZero())\n .forEach(([path, _]) => {\n if (this.totalSizeBytes - freedBytes <= this.softSizeBytes) {\n return;\n }\n\n const file = mapGet(this.cache, path);\n freedBytes += file.size;\n result.push(file);\n });\n\n return result;\n }\n\n addCache(file: T, callerId: string) {\n const created = this.cache.get(file.path) == undefined;\n this.cache.set(file.path, file);\n file.counter.inc(callerId);\n\n if (file.size < 0) {\n throw new Error(`empty sizeBytes: ${file}`);\n }\n\n if (created) {\n this.totalSizeBytes += file.size;\n }\n }\n\n removeCache(file: T) {\n this.cache.delete(file.path);\n this.totalSizeBytes -= file.size;\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAa,aAAb,MAA8C;CAC5C,AAAQ,wBAA0B,IAAI,KAAK;CAC3C,AAAQ,iBAAyB;CAEjC,YAAY,AAAiB,eAAuB;EAAvB;;CAE7B,WAAW,MAAyB;AAClC,SAAO,KAAK,MAAM,IAAI,KAAK,IAAI;;CAGjC,QAAQ,MAAgB,UAAiC;EACvD,MAAM,OAAO,KAAK,MAAM,IAAI,KAAK;AACjC,MAAI,QAAQ,OACV,MAAK,QAAQ,IAAI,SAAS;AAG5B,SAAO;;;;CAKT,WAAW,MAAgB,UAAuB;AAChD,SAAO,KAAK,OAAO,KAAK,CAAC,QAAQ,IAAI,SAAS;AAC9C,SAAO,KAAK,UAAU;;;CAIxB,WAAgB;AACd,MAAI,KAAK,kBAAkB,KAAK,cAAe,QAAO,EAAE;EAExD,MAAM,SAAc,EAAE;EACtB,IAAI,aAAa;AAEjB,aAAW,KAAK,MAAM,CACnB,QAAQ,CAAC,GAAG,UAAuB,KAAK,QAAQ,QAAQ,CAAC,CACzD,SAAS,CAAC,MAAM,OAAO;AACtB,OAAI,KAAK,iBAAiB,cAAc,KAAK,cAC3C;GAGF,MAAM,OAAO,OAAO,KAAK,OAAO,KAAK;AACrC,iBAAc,KAAK;AACnB,UAAO,KAAK,KAAK;IACjB;AAEJ,SAAO;;CAGT,SAAS,MAAS,UAAkB;EAClC,MAAM,UAAU,KAAK,MAAM,IAAI,KAAK,KAAK,IAAI;AAC7C,OAAK,MAAM,IAAI,KAAK,MAAM,KAAK;AAC/B,OAAK,QAAQ,IAAI,SAAS;AAE1B,MAAI,KAAK,OAAO,EACd,OAAM,IAAI,MAAM,oBAAoB,OAAO;AAG7C,MAAI,QACF,MAAK,kBAAkB,KAAK;;CAIhC,YAAY,MAAS;AACnB,OAAK,MAAM,OAAO,KAAK,KAAK;AAC5B,OAAK,kBAAkB,KAAK"}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
'use strict';
|
|
2
1
|
|
|
2
|
+
//#region src/drivers/helpers/helpers.ts
|
|
3
3
|
/** Throws when a driver gets a resource with a wrong resource type. */
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
var WrongResourceTypeError = class extends Error {
|
|
5
|
+
name = "WrongResourceTypeError";
|
|
6
|
+
};
|
|
7
7
|
/** Updater incorporates a pattern when someone wants to run a callback
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
})();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
8
|
+
* that updates something only when it's not already running. */
|
|
9
|
+
var Updater = class {
|
|
10
|
+
updating;
|
|
11
|
+
constructor(onUpdate) {
|
|
12
|
+
this.onUpdate = onUpdate;
|
|
13
|
+
}
|
|
14
|
+
schedule() {
|
|
15
|
+
if (this.updating == void 0) this.updating = (async () => {
|
|
16
|
+
try {
|
|
17
|
+
await this.onUpdate();
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.log(`error while updating in Updater: ${e}`);
|
|
20
|
+
} finally {
|
|
21
|
+
this.updating = void 0;
|
|
22
|
+
}
|
|
23
|
+
})();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
31
26
|
|
|
27
|
+
//#endregion
|
|
32
28
|
exports.Updater = Updater;
|
|
33
29
|
exports.WrongResourceTypeError = WrongResourceTypeError;
|
|
34
|
-
//# sourceMappingURL=helpers.cjs.map
|
|
30
|
+
//# sourceMappingURL=helpers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.cjs","sources":["../../../src/drivers/helpers/helpers.ts"],"sourcesContent":["/** Throws when a driver gets a resource with a wrong resource type. */\nexport class WrongResourceTypeError extends Error {\n name = \"WrongResourceTypeError\";\n}\n\n/** Updater incorporates a pattern when someone wants to run a callback\n * that updates something only when it's not already running. */\nexport class Updater {\n private updating: Promise<void> | undefined;\n\n constructor(private readonly onUpdate: () => Promise<void>) {}\n\n schedule() {\n if (this.updating == undefined) {\n this.updating = (async () => {\n try {\n await this.onUpdate();\n } catch (e) {\n console.log(`error while updating in Updater: ${e}`);\n } finally {\n this.updating = undefined;\n }\n })();\n }\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"helpers.cjs","names":[],"sources":["../../../src/drivers/helpers/helpers.ts"],"sourcesContent":["/** Throws when a driver gets a resource with a wrong resource type. */\nexport class WrongResourceTypeError extends Error {\n name = \"WrongResourceTypeError\";\n}\n\n/** Updater incorporates a pattern when someone wants to run a callback\n * that updates something only when it's not already running. */\nexport class Updater {\n private updating: Promise<void> | undefined;\n\n constructor(private readonly onUpdate: () => Promise<void>) {}\n\n schedule() {\n if (this.updating == undefined) {\n this.updating = (async () => {\n try {\n await this.onUpdate();\n } catch (e) {\n console.log(`error while updating in Updater: ${e}`);\n } finally {\n this.updating = undefined;\n }\n })();\n }\n }\n}\n"],"mappings":";;;AACA,IAAa,yBAAb,cAA4C,MAAM;CAChD,OAAO;;;;AAKT,IAAa,UAAb,MAAqB;CACnB,AAAQ;CAER,YAAY,AAAiB,UAA+B;EAA/B;;CAE7B,WAAW;AACT,MAAI,KAAK,YAAY,OACnB,MAAK,YAAY,YAAY;AAC3B,OAAI;AACF,UAAM,KAAK,UAAU;YACd,GAAG;AACV,YAAQ,IAAI,oCAAoC,IAAI;aAC5C;AACR,SAAK,WAAW;;MAEhB"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
//#region src/drivers/helpers/helpers.d.ts
|
|
1
2
|
/** Throws when a driver gets a resource with a wrong resource type. */
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare class WrongResourceTypeError extends Error {
|
|
4
|
+
name: string;
|
|
4
5
|
}
|
|
5
6
|
/** Updater incorporates a pattern when someone wants to run a callback
|
|
6
7
|
* that updates something only when it's not already running. */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
declare class Updater {
|
|
9
|
+
private readonly onUpdate;
|
|
10
|
+
private updating;
|
|
11
|
+
constructor(onUpdate: () => Promise<void>);
|
|
12
|
+
schedule(): void;
|
|
12
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Updater, WrongResourceTypeError };
|
|
13
16
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
+
//#region src/drivers/helpers/helpers.ts
|
|
1
2
|
/** Throws when a driver gets a resource with a wrong resource type. */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
3
|
+
var WrongResourceTypeError = class extends Error {
|
|
4
|
+
name = "WrongResourceTypeError";
|
|
5
|
+
};
|
|
5
6
|
/** Updater incorporates a pattern when someone wants to run a callback
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
})();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
7
|
+
* that updates something only when it's not already running. */
|
|
8
|
+
var Updater = class {
|
|
9
|
+
updating;
|
|
10
|
+
constructor(onUpdate) {
|
|
11
|
+
this.onUpdate = onUpdate;
|
|
12
|
+
}
|
|
13
|
+
schedule() {
|
|
14
|
+
if (this.updating == void 0) this.updating = (async () => {
|
|
15
|
+
try {
|
|
16
|
+
await this.onUpdate();
|
|
17
|
+
} catch (e) {
|
|
18
|
+
console.log(`error while updating in Updater: ${e}`);
|
|
19
|
+
} finally {
|
|
20
|
+
this.updating = void 0;
|
|
21
|
+
}
|
|
22
|
+
})();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
29
25
|
|
|
26
|
+
//#endregion
|
|
30
27
|
export { Updater, WrongResourceTypeError };
|
|
31
|
-
//# sourceMappingURL=helpers.js.map
|
|
28
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sources":["../../../src/drivers/helpers/helpers.ts"],"sourcesContent":["/** Throws when a driver gets a resource with a wrong resource type. */\nexport class WrongResourceTypeError extends Error {\n name = \"WrongResourceTypeError\";\n}\n\n/** Updater incorporates a pattern when someone wants to run a callback\n * that updates something only when it's not already running. */\nexport class Updater {\n private updating: Promise<void> | undefined;\n\n constructor(private readonly onUpdate: () => Promise<void>) {}\n\n schedule() {\n if (this.updating == undefined) {\n this.updating = (async () => {\n try {\n await this.onUpdate();\n } catch (e) {\n console.log(`error while updating in Updater: ${e}`);\n } finally {\n this.updating = undefined;\n }\n })();\n }\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"helpers.js","names":[],"sources":["../../../src/drivers/helpers/helpers.ts"],"sourcesContent":["/** Throws when a driver gets a resource with a wrong resource type. */\nexport class WrongResourceTypeError extends Error {\n name = \"WrongResourceTypeError\";\n}\n\n/** Updater incorporates a pattern when someone wants to run a callback\n * that updates something only when it's not already running. */\nexport class Updater {\n private updating: Promise<void> | undefined;\n\n constructor(private readonly onUpdate: () => Promise<void>) {}\n\n schedule() {\n if (this.updating == undefined) {\n this.updating = (async () => {\n try {\n await this.onUpdate();\n } catch (e) {\n console.log(`error while updating in Updater: ${e}`);\n } finally {\n this.updating = undefined;\n }\n })();\n }\n }\n}\n"],"mappings":";;AACA,IAAa,yBAAb,cAA4C,MAAM;CAChD,OAAO;;;;AAKT,IAAa,UAAb,MAAqB;CACnB,AAAQ;CAER,YAAY,AAAiB,UAA+B;EAA/B;;CAE7B,WAAW;AACT,MAAI,KAAK,YAAY,OACnB,MAAK,YAAY,YAAY;AAC3B,OAAI;AACF,UAAM,KAAK,UAAU;YACd,GAAG;AACV,YAAQ,IAAI,oCAAoC,IAAI;aAC5C;AACR,SAAK,WAAW;;MAEhB"}
|
|
@@ -1,50 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let _milaboratories_pl_client = require("@milaboratories/pl-client");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** Handle of logs. This handle should be passed
|
|
6
|
-
* to the driver for retrieving logs. */
|
|
4
|
+
//#region src/drivers/helpers/logs_handle.ts
|
|
7
5
|
function newLogHandle(live, rInfo) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
6
|
+
if (live) return `log+live://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
7
|
+
return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
12
8
|
}
|
|
13
9
|
/** Handle of the live logs of a program.
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
* The resource that represents a log can be deleted,
|
|
11
|
+
* in this case the handle should be refreshed. */
|
|
16
12
|
const liveHandleRegex = /^log\+live:\/\/log\/(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*)$/;
|
|
17
13
|
function isLiveLogHandle(handle) {
|
|
18
|
-
|
|
14
|
+
return liveHandleRegex.test(handle);
|
|
19
15
|
}
|
|
20
16
|
/** Handle of the ready logs of a program. */
|
|
21
17
|
const readyHandleRegex = /^log\+ready:\/\/log\/(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*)$/;
|
|
22
18
|
function isReadyLogHandle(handle) {
|
|
23
|
-
|
|
19
|
+
return readyHandleRegex.test(handle);
|
|
24
20
|
}
|
|
25
21
|
function getResourceInfoFromLogHandle(handle) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
id: plClient.bigintToResourceId(BigInt(resourceId)),
|
|
40
|
-
type: { name: resourceType, version: resourceVersion },
|
|
41
|
-
};
|
|
22
|
+
let parsed;
|
|
23
|
+
if (isLiveLogHandle(handle)) parsed = handle.match(liveHandleRegex);
|
|
24
|
+
else if (isReadyLogHandle(handle)) parsed = handle.match(readyHandleRegex);
|
|
25
|
+
else throw new Error(`Log handle is malformed: ${handle}`);
|
|
26
|
+
if (parsed == null) throw new Error(`Log handle wasn't parsed: ${handle}`);
|
|
27
|
+
const { resourceType, resourceVersion, resourceId } = parsed.groups;
|
|
28
|
+
return {
|
|
29
|
+
id: (0, _milaboratories_pl_client.bigintToResourceId)(BigInt(resourceId)),
|
|
30
|
+
type: {
|
|
31
|
+
name: resourceType,
|
|
32
|
+
version: resourceVersion
|
|
33
|
+
}
|
|
34
|
+
};
|
|
42
35
|
}
|
|
43
36
|
|
|
37
|
+
//#endregion
|
|
44
38
|
exports.getResourceInfoFromLogHandle = getResourceInfoFromLogHandle;
|
|
45
39
|
exports.isLiveLogHandle = isLiveLogHandle;
|
|
46
|
-
exports.isReadyLogHandle = isReadyLogHandle;
|
|
47
|
-
exports.liveHandleRegex = liveHandleRegex;
|
|
48
40
|
exports.newLogHandle = newLogHandle;
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=logs_handle.cjs.map
|
|
41
|
+
//# sourceMappingURL=logs_handle.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs_handle.cjs","sources":["../../../src/drivers/helpers/logs_handle.ts"],"sourcesContent":["/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\n\nimport type { ResourceInfo } from \"@milaboratories/pl-tree\";\nimport type * as sdk from \"@milaboratories/pl-model-common\";\nimport { bigintToResourceId } from \"@milaboratories/pl-client\";\n\nexport function newLogHandle(live: boolean, rInfo: ResourceInfo): sdk.AnyLogHandle {\n if (live) {\n return `log+live://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}` as sdk.LiveLogHandle;\n }\n\n return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}` as sdk.ReadyLogHandle;\n}\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\n\nexport const liveHandleRegex =\n /^log\\+live:\\/\\/log\\/(?<resourceType>.*)\\/(?<resourceVersion>.*)\\/(?<resourceId>.*)$/;\n\nexport function isLiveLogHandle(handle: string): handle is sdk.LiveLogHandle {\n return liveHandleRegex.test(handle);\n}\n\n/** Handle of the ready logs of a program. */\n\nexport const readyHandleRegex =\n /^log\\+ready:\\/\\/log\\/(?<resourceType>.*)\\/(?<resourceVersion>.*)\\/(?<resourceId>.*)$/;\n\nexport function isReadyLogHandle(handle: string): handle is sdk.ReadyLogHandle {\n return readyHandleRegex.test(handle);\n}\n\nexport function getResourceInfoFromLogHandle(handle: sdk.AnyLogHandle): ResourceInfo {\n let parsed: RegExpMatchArray | null;\n\n if (isLiveLogHandle(handle)) {\n parsed = handle.match(liveHandleRegex);\n } else if (isReadyLogHandle(handle)) {\n parsed = handle.match(readyHandleRegex);\n } else throw new Error(`Log handle is malformed: ${handle}`);\n if (parsed == null) throw new Error(`Log handle wasn't parsed: ${handle}`);\n\n const { resourceType, resourceVersion, resourceId } = parsed.groups!;\n\n return {\n id: bigintToResourceId(BigInt(resourceId)),\n type: { name: resourceType, version: resourceVersion },\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"logs_handle.cjs","names":[],"sources":["../../../src/drivers/helpers/logs_handle.ts"],"sourcesContent":["/** Handle of logs. This handle should be passed\n * to the driver for retrieving logs. */\n\nimport type { ResourceInfo } from \"@milaboratories/pl-tree\";\nimport type * as sdk from \"@milaboratories/pl-model-common\";\nimport { bigintToResourceId } from \"@milaboratories/pl-client\";\n\nexport function newLogHandle(live: boolean, rInfo: ResourceInfo): sdk.AnyLogHandle {\n if (live) {\n return `log+live://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}` as sdk.LiveLogHandle;\n }\n\n return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}` as sdk.ReadyLogHandle;\n}\n\n/** Handle of the live logs of a program.\n * The resource that represents a log can be deleted,\n * in this case the handle should be refreshed. */\n\nexport const liveHandleRegex =\n /^log\\+live:\\/\\/log\\/(?<resourceType>.*)\\/(?<resourceVersion>.*)\\/(?<resourceId>.*)$/;\n\nexport function isLiveLogHandle(handle: string): handle is sdk.LiveLogHandle {\n return liveHandleRegex.test(handle);\n}\n\n/** Handle of the ready logs of a program. */\n\nexport const readyHandleRegex =\n /^log\\+ready:\\/\\/log\\/(?<resourceType>.*)\\/(?<resourceVersion>.*)\\/(?<resourceId>.*)$/;\n\nexport function isReadyLogHandle(handle: string): handle is sdk.ReadyLogHandle {\n return readyHandleRegex.test(handle);\n}\n\nexport function getResourceInfoFromLogHandle(handle: sdk.AnyLogHandle): ResourceInfo {\n let parsed: RegExpMatchArray | null;\n\n if (isLiveLogHandle(handle)) {\n parsed = handle.match(liveHandleRegex);\n } else if (isReadyLogHandle(handle)) {\n parsed = handle.match(readyHandleRegex);\n } else throw new Error(`Log handle is malformed: ${handle}`);\n if (parsed == null) throw new Error(`Log handle wasn't parsed: ${handle}`);\n\n const { resourceType, resourceVersion, resourceId } = parsed.groups!;\n\n return {\n id: bigintToResourceId(BigInt(resourceId)),\n type: { name: resourceType, version: resourceVersion },\n };\n}\n"],"mappings":";;;;AAOA,SAAgB,aAAa,MAAe,OAAuC;AACjF,KAAI,KACF,QAAO,kBAAkB,MAAM,KAAK,KAAK,GAAG,MAAM,KAAK,QAAQ,GAAG,OAAO,MAAM,GAAG;AAGpF,QAAO,mBAAmB,MAAM,KAAK,KAAK,GAAG,MAAM,KAAK,QAAQ,GAAG,OAAO,MAAM,GAAG;;;;;AAOrF,MAAa,kBACX;AAEF,SAAgB,gBAAgB,QAA6C;AAC3E,QAAO,gBAAgB,KAAK,OAAO;;;AAKrC,MAAa,mBACX;AAEF,SAAgB,iBAAiB,QAA8C;AAC7E,QAAO,iBAAiB,KAAK,OAAO;;AAGtC,SAAgB,6BAA6B,QAAwC;CACnF,IAAI;AAEJ,KAAI,gBAAgB,OAAO,CACzB,UAAS,OAAO,MAAM,gBAAgB;UAC7B,iBAAiB,OAAO,CACjC,UAAS,OAAO,MAAM,iBAAiB;KAClC,OAAM,IAAI,MAAM,4BAA4B,SAAS;AAC5D,KAAI,UAAU,KAAM,OAAM,IAAI,MAAM,6BAA6B,SAAS;CAE1E,MAAM,EAAE,cAAc,iBAAiB,eAAe,OAAO;AAE7D,QAAO;EACL,sDAAuB,OAAO,WAAW,CAAC;EAC1C,MAAM;GAAE,MAAM;GAAc,SAAS;GAAiB;EACvD"}
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
import { bigintToResourceId } from
|
|
1
|
+
import { bigintToResourceId } from "@milaboratories/pl-client";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* to the driver for retrieving logs. */
|
|
3
|
+
//#region src/drivers/helpers/logs_handle.ts
|
|
5
4
|
function newLogHandle(live, rInfo) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
5
|
+
if (live) return `log+live://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
6
|
+
return `log+ready://log/${rInfo.type.name}/${rInfo.type.version}/${BigInt(rInfo.id)}`;
|
|
10
7
|
}
|
|
11
8
|
/** Handle of the live logs of a program.
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
* The resource that represents a log can be deleted,
|
|
10
|
+
* in this case the handle should be refreshed. */
|
|
14
11
|
const liveHandleRegex = /^log\+live:\/\/log\/(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*)$/;
|
|
15
12
|
function isLiveLogHandle(handle) {
|
|
16
|
-
|
|
13
|
+
return liveHandleRegex.test(handle);
|
|
17
14
|
}
|
|
18
15
|
/** Handle of the ready logs of a program. */
|
|
19
16
|
const readyHandleRegex = /^log\+ready:\/\/log\/(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*)$/;
|
|
20
17
|
function isReadyLogHandle(handle) {
|
|
21
|
-
|
|
18
|
+
return readyHandleRegex.test(handle);
|
|
22
19
|
}
|
|
23
20
|
function getResourceInfoFromLogHandle(handle) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
id: bigintToResourceId(BigInt(resourceId)),
|
|
38
|
-
type: { name: resourceType, version: resourceVersion },
|
|
39
|
-
};
|
|
21
|
+
let parsed;
|
|
22
|
+
if (isLiveLogHandle(handle)) parsed = handle.match(liveHandleRegex);
|
|
23
|
+
else if (isReadyLogHandle(handle)) parsed = handle.match(readyHandleRegex);
|
|
24
|
+
else throw new Error(`Log handle is malformed: ${handle}`);
|
|
25
|
+
if (parsed == null) throw new Error(`Log handle wasn't parsed: ${handle}`);
|
|
26
|
+
const { resourceType, resourceVersion, resourceId } = parsed.groups;
|
|
27
|
+
return {
|
|
28
|
+
id: bigintToResourceId(BigInt(resourceId)),
|
|
29
|
+
type: {
|
|
30
|
+
name: resourceType,
|
|
31
|
+
version: resourceVersion
|
|
32
|
+
}
|
|
33
|
+
};
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
export { getResourceInfoFromLogHandle, isLiveLogHandle, newLogHandle };
|
|
38
|
+
//# sourceMappingURL=logs_handle.js.map
|