@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,56 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ClientLogs } from "../clients/logs.js";
|
|
2
|
+
import { PollingOps } from "./helpers/polling_ops.js";
|
|
3
|
+
import { MiLogger } from "@milaboratories/ts-helpers";
|
|
4
|
+
import { Computable, ComputableCtx } from "@milaboratories/computable";
|
|
5
|
+
import * as sdk from "@milaboratories/pl-model-common";
|
|
6
|
+
import { PlTreeEntry, ResourceInfo } from "@milaboratories/pl-tree";
|
|
7
|
+
|
|
8
|
+
//#region src/drivers/logs_stream.d.ts
|
|
9
|
+
type LogsStreamDriverOps = PollingOps & {
|
|
10
|
+
/** Max number of concurrent requests to log streaming backend while calculating computable states */nConcurrentGetLogs: number;
|
|
11
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
|
-
|
|
12
|
+
declare class LogsStreamDriver implements sdk.LogsDriver {
|
|
13
|
+
private readonly logger;
|
|
14
|
+
private readonly clientLogs;
|
|
15
|
+
private readonly opts;
|
|
16
|
+
/** Holds a map of StreamManager Resource Id to all logs of this stream. */
|
|
17
|
+
private readonly idToLastLines;
|
|
18
|
+
/** Holds a map of StreamManager Resource Id to the last log line of this stream. */
|
|
19
|
+
private readonly idToProgressLog;
|
|
20
|
+
/** Holds a map of StreamManager Resource Id to log id smart object. */
|
|
21
|
+
private readonly hooks;
|
|
22
|
+
constructor(logger: MiLogger, clientLogs: ClientLogs, opts?: LogsStreamDriverOps);
|
|
23
|
+
getLastLogs(res: ResourceInfo | PlTreeEntry, lines: number): Computable<string | undefined>;
|
|
24
|
+
getLastLogs(res: ResourceInfo | PlTreeEntry, lines: number, ctx: ComputableCtx): Computable<string | undefined>;
|
|
25
|
+
private getLastLogsNoCtx;
|
|
26
|
+
/** Returns a last line that has patternToSearch.
|
|
27
|
+
* Notifies when a new line appeared or EOF reached. */
|
|
28
|
+
getProgressLog(res: ResourceInfo | PlTreeEntry, patternToSearch: string): Computable<string | undefined>;
|
|
29
|
+
getProgressLog(res: ResourceInfo | PlTreeEntry, patternToSearch: string, ctx: ComputableCtx): string | undefined;
|
|
30
|
+
private getProgressLogNoCtx;
|
|
31
|
+
getLogHandle(res: ResourceInfo | PlTreeEntry): Computable<sdk.AnyLogHandle>;
|
|
32
|
+
getLogHandle(res: ResourceInfo | PlTreeEntry, ctx: ComputableCtx): sdk.AnyLogHandle;
|
|
33
|
+
private getLogHandleNoCtx;
|
|
34
|
+
lastLines(handle: sdk.AnyLogHandle, lineCount: number, offsetBytes?: number, searchStr?: string | undefined): Promise<sdk.StreamingApiResponse>;
|
|
35
|
+
readText(handle: sdk.AnyLogHandle, lineCount: number, offsetBytes?: number, searchStr?: string | undefined): Promise<sdk.StreamingApiResponse>;
|
|
36
|
+
private tryWithNotFound;
|
|
37
|
+
private releaseLastLogs;
|
|
38
|
+
private releaseProgressLog;
|
|
39
|
+
releaseAll(): Promise<void>;
|
|
40
|
+
private scheduledOnNextState;
|
|
41
|
+
private scheduleOnNextState;
|
|
42
|
+
/** Called from observer */
|
|
43
|
+
private startUpdating;
|
|
44
|
+
/** Called from observer */
|
|
45
|
+
private stopUpdating;
|
|
46
|
+
/** Stops polling loop and waits for it to finish */
|
|
47
|
+
terminate(): Promise<void>;
|
|
48
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
49
|
+
/** If true, main loop will continue polling pl state. */
|
|
50
|
+
private keepRunning;
|
|
51
|
+
/** Actual state of main loop. */
|
|
52
|
+
private currentLoop;
|
|
53
|
+
private mainLoop;
|
|
54
|
+
private getAllLogs;
|
|
55
55
|
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { LogsStreamDriver, LogsStreamDriverOps };
|
|
56
58
|
//# sourceMappingURL=logs_stream.d.ts.map
|
|
@@ -1,246 +1,215 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { WrongResourceTypeError } from "./helpers/helpers.js";
|
|
2
|
+
import { getResourceInfoFromLogHandle, isLiveLogHandle, newLogHandle } from "./helpers/logs_handle.js";
|
|
3
|
+
import { isNotFoundError, resourceIdToString, stringifyWithResourceId } from "@milaboratories/pl-client";
|
|
4
|
+
import { CallersCounter, asyncPool } from "@milaboratories/ts-helpers";
|
|
5
|
+
import { ChangeSource, Computable, PollingComputableHooks } from "@milaboratories/computable";
|
|
6
|
+
import { treeEntryToResourceInfo } from "@milaboratories/pl-tree";
|
|
7
|
+
import { randomUUID } from "node:crypto";
|
|
8
|
+
import { scheduler } from "node:timers/promises";
|
|
9
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
try {
|
|
164
|
-
const logs = this.getAllLogs();
|
|
165
|
-
await asyncPool(this.opts.nConcurrentGetLogs, logs.map((getter) => async () => await getter.update()));
|
|
166
|
-
toNotify.forEach((n) => n.resolve());
|
|
167
|
-
}
|
|
168
|
-
catch (e) {
|
|
169
|
-
console.error(e);
|
|
170
|
-
toNotify.forEach((n) => n.reject(e));
|
|
171
|
-
}
|
|
172
|
-
if (!this.keepRunning)
|
|
173
|
-
break;
|
|
174
|
-
await scheduler.wait(this.opts.pollingInterval);
|
|
175
|
-
}
|
|
176
|
-
this.currentLoop = undefined;
|
|
177
|
-
}
|
|
178
|
-
getAllLogs() {
|
|
179
|
-
return Array.from(this.idToLastLines.entries())
|
|
180
|
-
.concat(Array.from(this.idToProgressLog.entries()))
|
|
181
|
-
.map(([_, getter]) => getter);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
10
|
+
//#region src/drivers/logs_stream.ts
|
|
11
|
+
var LogsStreamDriver = class {
|
|
12
|
+
/** Holds a map of StreamManager Resource Id to all logs of this stream. */
|
|
13
|
+
idToLastLines = /* @__PURE__ */ new Map();
|
|
14
|
+
/** Holds a map of StreamManager Resource Id to the last log line of this stream. */
|
|
15
|
+
idToProgressLog = /* @__PURE__ */ new Map();
|
|
16
|
+
/** Holds a map of StreamManager Resource Id to log id smart object. */
|
|
17
|
+
hooks;
|
|
18
|
+
constructor(logger, clientLogs, opts = {
|
|
19
|
+
nConcurrentGetLogs: 10,
|
|
20
|
+
pollingInterval: 1e3,
|
|
21
|
+
stopPollingDelay: 1e3
|
|
22
|
+
}) {
|
|
23
|
+
this.logger = logger;
|
|
24
|
+
this.clientLogs = clientLogs;
|
|
25
|
+
this.opts = opts;
|
|
26
|
+
this.hooks = new PollingComputableHooks(() => this.startUpdating(), () => this.stopUpdating(), { stopDebounce: opts.stopPollingDelay }, (resolve, reject) => this.scheduleOnNextState(resolve, reject));
|
|
27
|
+
}
|
|
28
|
+
getLastLogs(res, lines, ctx) {
|
|
29
|
+
if (ctx == void 0) return Computable.make((ctx) => this.getLastLogs(res, lines, ctx));
|
|
30
|
+
const r = treeEntryToResourceInfo(res, ctx);
|
|
31
|
+
const callerId = randomUUID();
|
|
32
|
+
ctx.attacheHooks(this.hooks);
|
|
33
|
+
ctx.addOnDestroy(() => this.releaseLastLogs(r.id, callerId));
|
|
34
|
+
const result = this.getLastLogsNoCtx(ctx.watcher, r, lines, callerId);
|
|
35
|
+
ctx.markUnstable("The logs are from stream, so we consider them unstable. Final values will be got from blobs.");
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
getLastLogsNoCtx(w, rInfo, lines, callerId) {
|
|
39
|
+
validateResourceType("getLastLogs", rInfo.type);
|
|
40
|
+
let logGetter = this.idToLastLines.get(rInfo.id);
|
|
41
|
+
if (logGetter == void 0) {
|
|
42
|
+
const newLogGetter = new LogGetter(this.logger, this.clientLogs, rInfo, lines);
|
|
43
|
+
this.idToLastLines.set(rInfo.id, newLogGetter);
|
|
44
|
+
logGetter = newLogGetter;
|
|
45
|
+
}
|
|
46
|
+
logGetter.attach(w, callerId);
|
|
47
|
+
const result = logGetter.getLog();
|
|
48
|
+
if (result.error != void 0) throw result.error;
|
|
49
|
+
return result.log;
|
|
50
|
+
}
|
|
51
|
+
getProgressLog(res, patternToSearch, ctx) {
|
|
52
|
+
if (ctx == void 0) return Computable.make((ctx) => this.getProgressLog(res, patternToSearch, ctx));
|
|
53
|
+
const r = treeEntryToResourceInfo(res, ctx);
|
|
54
|
+
const callerId = randomUUID();
|
|
55
|
+
ctx.attacheHooks(this.hooks);
|
|
56
|
+
ctx.addOnDestroy(() => this.releaseProgressLog(r.id, callerId));
|
|
57
|
+
const result = this.getProgressLogNoCtx(ctx.watcher, r, patternToSearch, callerId);
|
|
58
|
+
ctx.markUnstable("The progress log is from the stream, so we consider it unstable. Final value will be got from blobs.");
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
getProgressLogNoCtx(w, rInfo, patternToSearch, callerId) {
|
|
62
|
+
validateResourceType("getProgressLog", rInfo.type);
|
|
63
|
+
let logGetter = this.idToProgressLog.get(rInfo.id);
|
|
64
|
+
if (logGetter == void 0) {
|
|
65
|
+
const newLogGetter = new LogGetter(this.logger, this.clientLogs, rInfo, 1, patternToSearch);
|
|
66
|
+
this.idToProgressLog.set(rInfo.id, newLogGetter);
|
|
67
|
+
logGetter = newLogGetter;
|
|
68
|
+
}
|
|
69
|
+
logGetter.attach(w, callerId);
|
|
70
|
+
const result = logGetter.getLog();
|
|
71
|
+
if (result.error) throw result.error;
|
|
72
|
+
return result.log;
|
|
73
|
+
}
|
|
74
|
+
getLogHandle(res, ctx) {
|
|
75
|
+
if (ctx == void 0) return Computable.make((ctx) => this.getLogHandle(res, ctx));
|
|
76
|
+
const r = treeEntryToResourceInfo(res, ctx);
|
|
77
|
+
const result = this.getLogHandleNoCtx(r);
|
|
78
|
+
ctx.markUnstable(`live_log:${resourceIdToString(r.id)}`);
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
getLogHandleNoCtx(rInfo) {
|
|
82
|
+
validateResourceType("getLogHandle", rInfo.type);
|
|
83
|
+
return newLogHandle(true, rInfo);
|
|
84
|
+
}
|
|
85
|
+
async lastLines(handle, lineCount, offsetBytes, searchStr) {
|
|
86
|
+
return await this.tryWithNotFound(handle, () => this.clientLogs.lastLines(getResourceInfoFromLogHandle(handle), lineCount, BigInt(offsetBytes ?? 0), searchStr));
|
|
87
|
+
}
|
|
88
|
+
async readText(handle, lineCount, offsetBytes, searchStr) {
|
|
89
|
+
return await this.tryWithNotFound(handle, () => this.clientLogs.readText(getResourceInfoFromLogHandle(handle), lineCount, BigInt(offsetBytes ?? 0), searchStr));
|
|
90
|
+
}
|
|
91
|
+
async tryWithNotFound(handle, method) {
|
|
92
|
+
if (!isLiveLogHandle(handle)) throw new Error(`Not live log handle was passed to live log driver, handle: ${handle}`);
|
|
93
|
+
try {
|
|
94
|
+
const resp = await method();
|
|
95
|
+
return {
|
|
96
|
+
live: true,
|
|
97
|
+
shouldUpdateHandle: false,
|
|
98
|
+
data: resp.data,
|
|
99
|
+
size: Number(resp.size),
|
|
100
|
+
newOffset: Number(resp.newOffset)
|
|
101
|
+
};
|
|
102
|
+
} catch (e) {
|
|
103
|
+
if (isNotFoundError(e)) return { shouldUpdateHandle: true };
|
|
104
|
+
throw e;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async releaseLastLogs(rId, callerId) {
|
|
108
|
+
if (this.idToLastLines.get(rId)?.release(callerId)) this.idToLastLines.delete(rId);
|
|
109
|
+
}
|
|
110
|
+
async releaseProgressLog(rId, callerId) {
|
|
111
|
+
if (this.idToProgressLog.get(rId)?.release(callerId)) this.idToProgressLog.delete(rId);
|
|
112
|
+
}
|
|
113
|
+
async releaseAll() {}
|
|
114
|
+
scheduledOnNextState = [];
|
|
115
|
+
scheduleOnNextState(resolve, reject) {
|
|
116
|
+
this.scheduledOnNextState.push({
|
|
117
|
+
resolve,
|
|
118
|
+
reject
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** Called from observer */
|
|
122
|
+
startUpdating() {
|
|
123
|
+
this.keepRunning = true;
|
|
124
|
+
if (this.currentLoop === void 0) this.currentLoop = this.mainLoop();
|
|
125
|
+
}
|
|
126
|
+
/** Called from observer */
|
|
127
|
+
stopUpdating() {
|
|
128
|
+
this.keepRunning = false;
|
|
129
|
+
}
|
|
130
|
+
/** Stops polling loop and waits for it to finish */
|
|
131
|
+
async terminate() {
|
|
132
|
+
this.stopUpdating();
|
|
133
|
+
if (this.currentLoop !== void 0) await this.currentLoop;
|
|
134
|
+
}
|
|
135
|
+
async [Symbol.asyncDispose]() {
|
|
136
|
+
await this.terminate();
|
|
137
|
+
}
|
|
138
|
+
/** If true, main loop will continue polling pl state. */
|
|
139
|
+
keepRunning = false;
|
|
140
|
+
/** Actual state of main loop. */
|
|
141
|
+
currentLoop = void 0;
|
|
142
|
+
async mainLoop() {
|
|
143
|
+
while (this.keepRunning) {
|
|
144
|
+
const toNotify = this.scheduledOnNextState;
|
|
145
|
+
this.scheduledOnNextState = [];
|
|
146
|
+
try {
|
|
147
|
+
const logs = this.getAllLogs();
|
|
148
|
+
await asyncPool(this.opts.nConcurrentGetLogs, logs.map((getter) => async () => await getter.update()));
|
|
149
|
+
toNotify.forEach((n) => n.resolve());
|
|
150
|
+
} catch (e) {
|
|
151
|
+
console.error(e);
|
|
152
|
+
toNotify.forEach((n) => n.reject(e));
|
|
153
|
+
}
|
|
154
|
+
if (!this.keepRunning) break;
|
|
155
|
+
await scheduler.wait(this.opts.pollingInterval);
|
|
156
|
+
}
|
|
157
|
+
this.currentLoop = void 0;
|
|
158
|
+
}
|
|
159
|
+
getAllLogs() {
|
|
160
|
+
return Array.from(this.idToLastLines.entries()).concat(Array.from(this.idToProgressLog.entries())).map(([_, getter]) => getter);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
184
163
|
/** A job that gets last lines from a StreamWorkdir resource. */
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.change.markChanged();
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
this.logger.error(`Stream log lines for ${stringifyWithResourceId(this.rInfo.id)} failed, reason: ${JSON.stringify(e)}`);
|
|
234
|
-
throw e;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
164
|
+
var LogGetter = class {
|
|
165
|
+
logs;
|
|
166
|
+
error = void 0;
|
|
167
|
+
change = new ChangeSource();
|
|
168
|
+
counter = new CallersCounter();
|
|
169
|
+
constructor(logger, clientLogs, rInfo, lines, patternToSearch) {
|
|
170
|
+
this.logger = logger;
|
|
171
|
+
this.clientLogs = clientLogs;
|
|
172
|
+
this.rInfo = rInfo;
|
|
173
|
+
this.lines = lines;
|
|
174
|
+
this.patternToSearch = patternToSearch;
|
|
175
|
+
}
|
|
176
|
+
getLog() {
|
|
177
|
+
return {
|
|
178
|
+
log: this.logs,
|
|
179
|
+
error: this.error
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
attach(w, callerId) {
|
|
183
|
+
this.change.attachWatcher(w);
|
|
184
|
+
this.counter.inc(callerId);
|
|
185
|
+
}
|
|
186
|
+
release(callerId) {
|
|
187
|
+
return this.counter.dec(callerId);
|
|
188
|
+
}
|
|
189
|
+
async update() {
|
|
190
|
+
try {
|
|
191
|
+
const resp = await this.clientLogs.lastLines(this.rInfo, this.lines, 0n, this.patternToSearch);
|
|
192
|
+
const newLogs = new TextDecoder().decode(resp.data);
|
|
193
|
+
if (this.logs != newLogs) this.change.markChanged(`logs for ${resourceIdToString(this.rInfo.id)} updated`);
|
|
194
|
+
this.logs = newLogs;
|
|
195
|
+
this.error = void 0;
|
|
196
|
+
return;
|
|
197
|
+
} catch (e) {
|
|
198
|
+
if (isNotFoundError(e)) {
|
|
199
|
+
this.logs = "";
|
|
200
|
+
this.error = e;
|
|
201
|
+
this.change.markChanged();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
this.logger.error(`Stream log lines for ${stringifyWithResourceId(this.rInfo.id)} failed, reason: ${JSON.stringify(e)}`);
|
|
205
|
+
throw e;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
238
209
|
function validateResourceType(methodName, rType) {
|
|
239
|
-
|
|
240
|
-
throw new WrongResourceTypeError(`${methodName}: wrong resource type: ${rType.name}, ` +
|
|
241
|
-
`expected: a resource of type 'StreamWorkdir'.`);
|
|
242
|
-
}
|
|
210
|
+
if (!rType.name.startsWith("StreamWorkdir")) throw new WrongResourceTypeError(`${methodName}: wrong resource type: ${rType.name}, expected: a resource of type 'StreamWorkdir'.`);
|
|
243
211
|
}
|
|
244
212
|
|
|
213
|
+
//#endregion
|
|
245
214
|
export { LogsStreamDriver };
|
|
246
|
-
//# sourceMappingURL=logs_stream.js.map
|
|
215
|
+
//# sourceMappingURL=logs_stream.js.map
|