@milaboratories/pl-drivers 1.11.18 → 1.11.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/dist/clients/constructors.cjs +5 -5
  2. package/dist/clients/constructors.cjs.map +1 -1
  3. package/dist/clients/constructors.js +5 -5
  4. package/dist/clients/constructors.js.map +1 -1
  5. package/dist/clients/download.cjs +29 -5
  6. package/dist/clients/download.cjs.map +1 -1
  7. package/dist/clients/download.d.ts +5 -4
  8. package/dist/clients/download.d.ts.map +1 -1
  9. package/dist/clients/download.js +30 -6
  10. package/dist/clients/download.js.map +1 -1
  11. package/dist/clients/logs.cjs +57 -16
  12. package/dist/clients/logs.cjs.map +1 -1
  13. package/dist/clients/logs.d.ts +6 -5
  14. package/dist/clients/logs.d.ts.map +1 -1
  15. package/dist/clients/logs.js +58 -17
  16. package/dist/clients/logs.js.map +1 -1
  17. package/dist/clients/ls_api.cjs +44 -8
  18. package/dist/clients/ls_api.cjs.map +1 -1
  19. package/dist/clients/ls_api.d.ts +4 -4
  20. package/dist/clients/ls_api.d.ts.map +1 -1
  21. package/dist/clients/ls_api.js +45 -9
  22. package/dist/clients/ls_api.js.map +1 -1
  23. package/dist/clients/progress.cjs +32 -29
  24. package/dist/clients/progress.cjs.map +1 -1
  25. package/dist/clients/progress.d.ts +5 -5
  26. package/dist/clients/progress.d.ts.map +1 -1
  27. package/dist/clients/progress.js +33 -30
  28. package/dist/clients/progress.js.map +1 -1
  29. package/dist/clients/upload.cjs +96 -30
  30. package/dist/clients/upload.cjs.map +1 -1
  31. package/dist/clients/upload.d.ts +8 -11
  32. package/dist/clients/upload.d.ts.map +1 -1
  33. package/dist/clients/upload.js +97 -31
  34. package/dist/clients/upload.js.map +1 -1
  35. package/dist/drivers/download_blob/download_blob.cjs +2 -2
  36. package/dist/drivers/download_blob/download_blob.cjs.map +1 -1
  37. package/dist/drivers/download_blob/download_blob.js +1 -1
  38. package/dist/drivers/download_blob/download_blob.js.map +1 -1
  39. package/dist/drivers/download_blob/download_blob_task.cjs +5 -5
  40. package/dist/drivers/download_blob/download_blob_task.cjs.map +1 -1
  41. package/dist/drivers/download_blob/download_blob_task.js +2 -2
  42. package/dist/drivers/download_blob/download_blob_task.js.map +1 -1
  43. package/dist/drivers/download_blob_url/task.cjs +5 -5
  44. package/dist/drivers/download_blob_url/task.cjs.map +1 -1
  45. package/dist/drivers/download_blob_url/task.js +2 -2
  46. package/dist/drivers/download_blob_url/task.js.map +1 -1
  47. package/dist/drivers/download_url/task.cjs +2 -2
  48. package/dist/drivers/download_url/task.cjs.map +1 -1
  49. package/dist/drivers/download_url/task.js +2 -2
  50. package/dist/drivers/download_url/task.js.map +1 -1
  51. package/dist/drivers/logs_stream.cjs.map +1 -1
  52. package/dist/drivers/logs_stream.js.map +1 -1
  53. package/dist/helpers/download.cjs +5 -24
  54. package/dist/helpers/download.cjs.map +1 -1
  55. package/dist/helpers/download.d.ts +0 -13
  56. package/dist/helpers/download.d.ts.map +1 -1
  57. package/dist/helpers/download.js +5 -21
  58. package/dist/helpers/download.js.map +1 -1
  59. package/dist/helpers/download_errors.cjs +43 -0
  60. package/dist/helpers/download_errors.cjs.map +1 -0
  61. package/dist/helpers/download_errors.d.ts +23 -0
  62. package/dist/helpers/download_errors.d.ts.map +1 -0
  63. package/dist/helpers/download_errors.js +36 -0
  64. package/dist/helpers/download_errors.js.map +1 -0
  65. package/dist/index.cjs +7 -0
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.ts +1 -0
  68. package/dist/index.d.ts.map +1 -1
  69. package/dist/index.js +1 -0
  70. package/dist/index.js.map +1 -1
  71. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs +2 -2
  72. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs.map +1 -0
  73. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs.map +1 -0
  74. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -0
  75. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js.map +1 -0
  76. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -0
  77. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js +2 -2
  78. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js.map +1 -0
  79. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs +2 -2
  80. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs.map +1 -0
  81. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs.map +1 -0
  82. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -0
  83. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js.map +1 -0
  84. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -0
  85. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js +2 -2
  86. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js.map +1 -0
  87. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs +3 -3
  88. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs.map +1 -0
  89. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs.map +1 -0
  90. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -0
  91. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js.map +1 -0
  92. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -0
  93. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js +3 -3
  94. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js.map +1 -0
  95. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs +6 -6
  96. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs.map +1 -0
  97. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs.map +1 -0
  98. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -0
  99. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js.map +1 -0
  100. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -0
  101. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js +6 -6
  102. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js.map +1 -0
  103. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs +84 -84
  104. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs.map +1 -0
  105. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs.map +1 -0
  106. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts +16 -16
  107. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts.map +1 -0
  108. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js.map +1 -0
  109. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts +118 -118
  110. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts.map +1 -0
  111. package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js +76 -76
  112. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js.map +1 -0
  113. package/dist/proto-grpc/google/api/http.d.ts.map +1 -0
  114. package/dist/{proto → proto-grpc}/google/protobuf/descriptor.d.ts +5 -149
  115. package/dist/proto-grpc/google/protobuf/descriptor.d.ts.map +1 -0
  116. package/dist/proto-grpc/google/protobuf/duration.cjs.map +1 -0
  117. package/dist/proto-grpc/google/protobuf/duration.d.ts.map +1 -0
  118. package/dist/proto-grpc/google/protobuf/duration.js.map +1 -0
  119. package/dist/proto-grpc/google/protobuf/timestamp.cjs.map +1 -0
  120. package/dist/proto-grpc/google/protobuf/timestamp.d.ts.map +1 -0
  121. package/dist/proto-grpc/google/protobuf/timestamp.js.map +1 -0
  122. package/dist/proto-rest/downloadapi.d.ts +105 -0
  123. package/dist/proto-rest/downloadapi.d.ts.map +1 -0
  124. package/dist/proto-rest/index.d.ts +17 -0
  125. package/dist/proto-rest/index.d.ts.map +1 -0
  126. package/dist/proto-rest/lsapi.d.ts +148 -0
  127. package/dist/proto-rest/lsapi.d.ts.map +1 -0
  128. package/dist/proto-rest/progressapi.d.ts +159 -0
  129. package/dist/proto-rest/progressapi.d.ts.map +1 -0
  130. package/dist/proto-rest/streamingapi.d.ts +469 -0
  131. package/dist/proto-rest/streamingapi.d.ts.map +1 -0
  132. package/dist/proto-rest/uploadapi.d.ts +355 -0
  133. package/dist/proto-rest/uploadapi.d.ts.map +1 -0
  134. package/package.json +10 -6
  135. package/src/clients/constructors.ts +11 -11
  136. package/src/clients/download.ts +34 -11
  137. package/src/clients/logs.ts +69 -21
  138. package/src/clients/ls_api.ts +58 -14
  139. package/src/clients/progress.ts +41 -44
  140. package/src/clients/upload.ts +117 -53
  141. package/src/drivers/download_blob/download_blob.ts +1 -1
  142. package/src/drivers/download_blob/download_blob_task.ts +2 -2
  143. package/src/drivers/download_blob_url/task.ts +2 -2
  144. package/src/drivers/download_url/task.ts +2 -2
  145. package/src/drivers/logs_stream.ts +1 -1
  146. package/src/drivers/upload.test.ts +6 -25
  147. package/src/helpers/download.ts +4 -26
  148. package/src/helpers/download_errors.ts +40 -0
  149. package/src/index.ts +1 -0
  150. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +1 -1
  151. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +2 -2
  152. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +1 -1
  153. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +2 -2
  154. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +1 -1
  155. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +3 -3
  156. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +1 -1
  157. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +6 -6
  158. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.ts +21 -21
  159. package/src/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.ts +159 -159
  160. package/src/{proto → proto-grpc}/google/api/http.ts +1 -1
  161. package/src/{proto → proto-grpc}/google/protobuf/descriptor.ts +9 -217
  162. package/src/{proto → proto-grpc}/google/protobuf/duration.ts +1 -1
  163. package/src/{proto → proto-grpc}/google/protobuf/timestamp.ts +1 -1
  164. package/src/proto-rest/downloadapi.ts +105 -0
  165. package/src/proto-rest/index.ts +28 -0
  166. package/src/proto-rest/lsapi.ts +148 -0
  167. package/src/proto-rest/progressapi.ts +159 -0
  168. package/src/proto-rest/streamingapi.ts +469 -0
  169. package/src/proto-rest/uploadapi.ts +355 -0
  170. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +0 -53
  171. package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +0 -1
  172. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs.map +0 -1
  173. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs.map +0 -1
  174. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +0 -1
  175. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js.map +0 -1
  176. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +0 -1
  177. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js.map +0 -1
  178. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs.map +0 -1
  179. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs.map +0 -1
  180. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +0 -1
  181. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js.map +0 -1
  182. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +0 -1
  183. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js.map +0 -1
  184. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs.map +0 -1
  185. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs.map +0 -1
  186. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +0 -1
  187. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js.map +0 -1
  188. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +0 -1
  189. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js.map +0 -1
  190. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs.map +0 -1
  191. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs.map +0 -1
  192. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +0 -1
  193. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js.map +0 -1
  194. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +0 -1
  195. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js.map +0 -1
  196. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs.map +0 -1
  197. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs.map +0 -1
  198. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts.map +0 -1
  199. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js.map +0 -1
  200. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts.map +0 -1
  201. package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js.map +0 -1
  202. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +0 -329
  203. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +0 -1
  204. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +0 -5358
  205. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +0 -1
  206. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +0 -537
  207. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +0 -1
  208. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +0 -87
  209. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +0 -1
  210. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +0 -106
  211. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +0 -1
  212. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +0 -256
  213. package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +0 -1
  214. package/dist/proto/google/api/http.d.ts.map +0 -1
  215. package/dist/proto/google/protobuf/any.d.ts +0 -181
  216. package/dist/proto/google/protobuf/any.d.ts.map +0 -1
  217. package/dist/proto/google/protobuf/descriptor.d.ts.map +0 -1
  218. package/dist/proto/google/protobuf/duration.cjs.map +0 -1
  219. package/dist/proto/google/protobuf/duration.d.ts.map +0 -1
  220. package/dist/proto/google/protobuf/duration.js.map +0 -1
  221. package/dist/proto/google/protobuf/empty.d.ts +0 -32
  222. package/dist/proto/google/protobuf/empty.d.ts.map +0 -1
  223. package/dist/proto/google/protobuf/struct.d.ts +0 -187
  224. package/dist/proto/google/protobuf/struct.d.ts.map +0 -1
  225. package/dist/proto/google/protobuf/timestamp.cjs.map +0 -1
  226. package/dist/proto/google/protobuf/timestamp.d.ts.map +0 -1
  227. package/dist/proto/google/protobuf/timestamp.js.map +0 -1
  228. package/dist/proto/google/protobuf/wrappers.d.ts +0 -335
  229. package/dist/proto/google/protobuf/wrappers.d.ts.map +0 -1
  230. package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +0 -125
  231. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +0 -406
  232. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +0 -14986
  233. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +0 -1474
  234. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +0 -181
  235. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +0 -251
  236. package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +0 -693
  237. package/src/proto/google/protobuf/any.ts +0 -326
  238. package/src/proto/google/protobuf/empty.ts +0 -94
  239. package/src/proto/google/protobuf/struct.ts +0 -484
  240. package/src/proto/google/protobuf/wrappers.ts +0 -785
  241. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs +0 -0
  242. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +0 -0
  243. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js +0 -0
  244. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +0 -0
  245. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs +0 -0
  246. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +0 -0
  247. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js +0 -0
  248. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +0 -0
  249. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs +0 -0
  250. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +0 -0
  251. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js +0 -0
  252. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +0 -0
  253. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs +0 -0
  254. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +0 -0
  255. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js +0 -0
  256. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +0 -0
  257. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs +0 -0
  258. /package/dist/{proto → proto-grpc}/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js +0 -0
  259. /package/dist/{proto → proto-grpc}/google/api/http.d.ts +0 -0
  260. /package/dist/{proto → proto-grpc}/google/protobuf/duration.cjs +0 -0
  261. /package/dist/{proto → proto-grpc}/google/protobuf/duration.d.ts +0 -0
  262. /package/dist/{proto → proto-grpc}/google/protobuf/duration.js +0 -0
  263. /package/dist/{proto → proto-grpc}/google/protobuf/timestamp.cjs +0 -0
  264. /package/dist/{proto → proto-grpc}/google/protobuf/timestamp.d.ts +0 -0
  265. /package/dist/{proto → proto-grpc}/google/protobuf/timestamp.js +0 -0
@@ -1,22 +1,35 @@
1
- import { StreamingClient } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client';
2
1
  import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
3
2
  import type { MiLogger } from '@milaboratories/ts-helpers';
4
3
  import { notEmpty } from '@milaboratories/ts-helpers';
5
4
  import type { Dispatcher } from 'undici';
6
- import type { GrpcClientProvider, GrpcClientProviderFactory } from '@milaboratories/pl-client';
7
- import { addRTypeToMetadata } from '@milaboratories/pl-client';
8
- import type { StreamingAPI_Response } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol';
5
+ import type { WireClientProvider, WireClientProviderFactory } from '@milaboratories/pl-client';
6
+ import { addRTypeToMetadata, createRTypeRoutingHeader, RestAPI } from '@milaboratories/pl-client';
7
+ import type { StreamingAPI_Response } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol';
8
+ import { StreamingClient } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client';
9
+ import type { StreamingApiPaths, StreamingRestClientType } from '../proto-rest';
9
10
  import type { ResourceInfo } from '@milaboratories/pl-tree';
10
11
 
11
12
  export class ClientLogs {
12
- public readonly grpcClient: GrpcClientProvider<StreamingClient>;
13
+ public readonly wire: WireClientProvider<StreamingRestClientType | StreamingClient>;
13
14
 
14
15
  constructor(
15
- grpcClientProviderFactory: GrpcClientProviderFactory,
16
+ wireClientProviderFactory: WireClientProviderFactory,
16
17
  public readonly httpClient: Dispatcher,
17
18
  public readonly logger: MiLogger,
18
19
  ) {
19
- this.grpcClient = grpcClientProviderFactory.createGrpcClientProvider((transport) => new StreamingClient(transport));
20
+ this.wire = wireClientProviderFactory.createWireClientProvider(
21
+ (wire) => {
22
+ if (wire.type === 'grpc') {
23
+ return new StreamingClient(wire.Transport);
24
+ }
25
+
26
+ return RestAPI.createClient<StreamingApiPaths>({
27
+ hostAndPort: wire.Config.hostAndPort,
28
+ ssl: wire.Config.ssl,
29
+ dispatcher: wire.Dispatcher,
30
+ middlewares: wire.Middlewares,
31
+ });
32
+ });
20
33
  }
21
34
 
22
35
  close() {}
@@ -31,17 +44,32 @@ export class ClientLogs {
31
44
  searchStr?: string,
32
45
  options?: RpcOptions,
33
46
  ): Promise<StreamingAPI_Response> {
34
- return (
35
- await this.grpcClient.get().lastLines(
36
- {
37
- resourceId: rId,
38
- lineCount: lineCount,
39
- offset: offsetBytes,
40
- search: searchStr,
41
- },
42
- addRTypeToMetadata(rType, options),
43
- )
44
- ).response;
47
+ const client = this.wire.get();
48
+ if (client instanceof StreamingClient) {
49
+ return (
50
+ await client.lastLines(
51
+ { resourceId: rId, lineCount: lineCount, offset: offsetBytes, search: searchStr },
52
+ addRTypeToMetadata(rType, options),
53
+ )
54
+ ).response;
55
+ }
56
+
57
+ const resp = (await client.POST('/v1/last-lines', {
58
+ body: {
59
+ resourceId: rId.toString(),
60
+ lineCount: lineCount,
61
+ offset: offsetBytes.toString(),
62
+ search: searchStr ?? '',
63
+ searchRe: '',
64
+ },
65
+ headers: { ...createRTypeRoutingHeader(rType) },
66
+ })).data!;
67
+
68
+ return {
69
+ data: new Uint8Array(Buffer.from(resp.data)),
70
+ size: BigInt(resp.size),
71
+ newOffset: BigInt(resp.newOffset),
72
+ };
45
73
  }
46
74
 
47
75
  /** Reads the file forward and returns the text,
@@ -54,8 +82,10 @@ export class ClientLogs {
54
82
  searchStr?: string,
55
83
  options?: RpcOptions,
56
84
  ): Promise<StreamingAPI_Response> {
57
- return (
58
- await this.grpcClient.get().readText(
85
+ const client = this.wire.get();
86
+
87
+ if (client instanceof StreamingClient) {
88
+ return (await client.readText(
59
89
  {
60
90
  resourceId: notEmpty(rId),
61
91
  readLimit: BigInt(lineCount),
@@ -64,6 +94,24 @@ export class ClientLogs {
64
94
  },
65
95
  addRTypeToMetadata(rType, options),
66
96
  )
67
- ).response;
97
+ ).response;
98
+ }
99
+
100
+ const resp = (await client.POST('/v1/read/text', {
101
+ body: {
102
+ resourceId: rId.toString(),
103
+ readLimit: lineCount.toString(),
104
+ offset: offsetBytes.toString(),
105
+ search: searchStr ?? '',
106
+ searchRe: '',
107
+ },
108
+ headers: { ...createRTypeRoutingHeader(rType) },
109
+ })).data!;
110
+
111
+ return {
112
+ data: new Uint8Array(Buffer.from(resp.data)),
113
+ size: BigInt(resp.size),
114
+ newOffset: BigInt(resp.newOffset),
115
+ };
68
116
  }
69
117
  }
@@ -1,19 +1,35 @@
1
1
  import type { MiLogger } from '@milaboratories/ts-helpers';
2
- import type { LsAPI_List_Response } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol';
3
- import { LSClient } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client';
4
2
  import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
5
- import type { GrpcClientProvider, GrpcClientProviderFactory } from '@milaboratories/pl-client';
6
- import { addRTypeToMetadata } from '@milaboratories/pl-client';
3
+ import type { WireClientProvider, WireClientProviderFactory } from '@milaboratories/pl-client';
4
+ import { RestAPI } from '@milaboratories/pl-client';
5
+ import { addRTypeToMetadata, createRTypeRoutingHeader } from '@milaboratories/pl-client';
6
+ import type { LsAPI_List_Response, LsAPI_ListItem } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol';
7
+ import { LSClient } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client';
8
+ import type { LsApiPaths, LsRestClientType } from '../proto-rest';
9
+
7
10
  import type { ResourceInfo } from '@milaboratories/pl-tree';
8
11
 
9
12
  export class ClientLs {
10
- private readonly grpcClient: GrpcClientProvider<LSClient>;
13
+ private readonly wire: WireClientProvider<LsRestClientType | LSClient>;
11
14
 
12
15
  constructor(
13
- grpcClientProviderFactory: GrpcClientProviderFactory,
16
+ wireClientProviderFactory: WireClientProviderFactory,
14
17
  private readonly logger: MiLogger,
15
18
  ) {
16
- this.grpcClient = grpcClientProviderFactory.createGrpcClientProvider((transport) => new LSClient(transport));
19
+ this.wire = wireClientProviderFactory.createWireClientProvider(
20
+ (wire) => {
21
+ if (wire.type === 'grpc') {
22
+ return new LSClient(wire.Transport);
23
+ }
24
+
25
+ return RestAPI.createClient<LsApiPaths>({
26
+ hostAndPort: wire.Config.hostAndPort,
27
+ ssl: wire.Config.ssl,
28
+ dispatcher: wire.Dispatcher,
29
+ middlewares: wire.Middlewares,
30
+ });
31
+ },
32
+ );
17
33
  }
18
34
 
19
35
  close() {}
@@ -23,12 +39,40 @@ export class ClientLs {
23
39
  path: string,
24
40
  options?: RpcOptions,
25
41
  ): Promise<LsAPI_List_Response> {
26
- return await this.grpcClient.get().list(
27
- {
28
- resourceId: rInfo.id,
29
- location: path,
30
- },
31
- addRTypeToMetadata(rInfo.type, options),
32
- ).response;
42
+ const client = this.wire.get();
43
+
44
+ if (client instanceof LSClient) {
45
+ return await client.list(
46
+ {
47
+ resourceId: rInfo.id,
48
+ location: path,
49
+ },
50
+ addRTypeToMetadata(rInfo.type, options),
51
+ ).response;
52
+ } else {
53
+ const resp = (await client.POST('/v1/list', {
54
+ body: {
55
+ resourceId: rInfo.id.toString(),
56
+ location: path,
57
+ },
58
+ headers: { ...createRTypeRoutingHeader(rInfo.type) },
59
+ })).data!;
60
+
61
+ const items: LsAPI_ListItem[] = resp.items.map((item) => ({
62
+ name: item.name,
63
+ size: BigInt(item.size),
64
+ isDir: item.isDir,
65
+ fullName: item.fullName,
66
+ directory: item.directory,
67
+ // TODO: check we get value in a correct way here
68
+ lastModified: { seconds: BigInt(item.lastModified), nanos: 0 },
69
+ version: item.version,
70
+ }));
71
+
72
+ return {
73
+ items,
74
+ delimiter: resp.delimiter,
75
+ };
76
+ }
33
77
  }
34
78
  }
@@ -1,11 +1,12 @@
1
- import { ProgressClient } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client';
2
1
  import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
3
- import { Duration } from '../proto/google/protobuf/duration';
4
- import type { GrpcClientProvider, GrpcClientProviderFactory, PlClient } from '@milaboratories/pl-client';
5
- import { addRTypeToMetadata } from '@milaboratories/pl-client';
2
+ import type { WireClientProvider, WireClientProviderFactory, PlClient } from '@milaboratories/pl-client';
3
+ import { addRTypeToMetadata, createRTypeRoutingHeader, RestAPI } from '@milaboratories/pl-client';
6
4
  import type { MiLogger } from '@milaboratories/ts-helpers';
7
5
  import { notEmpty } from '@milaboratories/ts-helpers';
8
6
  import type { Dispatcher } from 'undici';
7
+ import { ProgressClient } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client';
8
+ import type { ProgressAPI_Report } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol';
9
+ import type { ProgressApiPaths, ProgressRestClientType } from '../proto-rest';
9
10
  import type { ResourceInfo } from '@milaboratories/pl-tree';
10
11
 
11
12
  export type ProgressStatus = {
@@ -20,27 +21,55 @@ export type ProgressStatus = {
20
21
  // When blobs are transfered, one can got a status of transfering
21
22
  // using this API.
22
23
  export class ClientProgress {
23
- public readonly grpcClient: GrpcClientProvider<ProgressClient>;
24
+ public readonly wire: WireClientProvider<ProgressRestClientType | ProgressClient>;
24
25
 
25
26
  constructor(
26
- grpcClientProviderFactory: GrpcClientProviderFactory,
27
+ wireClientProviderFactory: WireClientProviderFactory,
27
28
  _: Dispatcher,
28
29
  public readonly client: PlClient,
29
30
  public readonly logger: MiLogger,
30
31
  ) {
31
- this.grpcClient = grpcClientProviderFactory.createGrpcClientProvider((transport) => new ProgressClient(transport));
32
+ this.wire = wireClientProviderFactory.createWireClientProvider(
33
+ (wire) => {
34
+ if (wire.type === 'grpc') {
35
+ return new ProgressClient(wire.Transport);
36
+ }
37
+
38
+ return RestAPI.createClient<ProgressApiPaths>({
39
+ hostAndPort: wire.Config.hostAndPort,
40
+ ssl: wire.Config.ssl,
41
+ dispatcher: wire.Dispatcher,
42
+ middlewares: wire.Middlewares,
43
+ });
44
+ },
45
+ );
32
46
  }
33
47
 
34
48
  close() {}
35
49
 
36
50
  /** getStatus gets a progress status by given rId and rType. */
37
51
  async getStatus({ id, type }: ResourceInfo, options?: RpcOptions): Promise<ProgressStatus> {
38
- const status = await this.grpcClient.get().getStatus(
39
- { resourceId: id },
40
- addRTypeToMetadata(type, options),
41
- );
52
+ const client = this.wire.get();
42
53
 
43
- const report = notEmpty(status.response.report);
54
+ let report: ProgressAPI_Report;
55
+ if (client instanceof ProgressClient) {
56
+ report = notEmpty((await client.getStatus(
57
+ { resourceId: id },
58
+ addRTypeToMetadata(type, options),
59
+ ).response).report);
60
+ } else {
61
+ const resp = (await client.POST('/v1/get-progress', {
62
+ body: { resourceId: id.toString() },
63
+ headers: { ...createRTypeRoutingHeader(type) },
64
+ })).data!.report;
65
+ report = {
66
+ done: resp.done,
67
+ progress: resp.progress,
68
+ bytesProcessed: BigInt(resp.bytesProcessed),
69
+ bytesTotal: BigInt(resp.bytesTotal),
70
+ name: resp.name,
71
+ };
72
+ }
44
73
 
45
74
  return {
46
75
  done: report.done,
@@ -49,36 +78,4 @@ export class ClientProgress {
49
78
  bytesTotal: String(report.bytesTotal),
50
79
  };
51
80
  }
52
-
53
- // realtimeStatus returns a async generator that takes statuses from
54
- // GRPC stream every updateIntervalMs milliseconds.
55
- async *realtimeStatus(
56
- { id, type }: ResourceInfo,
57
- updateIntervalMs: number = 100,
58
- options?: RpcOptions,
59
- ) {
60
- options = addRTypeToMetadata(type, options);
61
-
62
- const secs = Math.floor(updateIntervalMs / 1000);
63
- const nanos = (updateIntervalMs - secs * 1000) * 1000000;
64
- const updateInterval = Duration.create({
65
- seconds: BigInt(secs),
66
- nanos: nanos,
67
- });
68
-
69
- try {
70
- const { responses } = this.grpcClient.get().realtimeStatus(
71
- {
72
- resourceId: id,
73
- updateInterval: updateInterval,
74
- },
75
- options,
76
- );
77
-
78
- yield * responses;
79
- } catch (e) {
80
- this.logger.warn('Failed to get realtime status' + String(e));
81
- throw e;
82
- }
83
- }
84
81
  }
@@ -1,13 +1,14 @@
1
- import type { GrpcClientProvider, GrpcClientProviderFactory, PlClient, ResourceId, ResourceType } from '@milaboratories/pl-client';
2
- import { addRTypeToMetadata } from '@milaboratories/pl-client';
1
+ import type { WireClientProvider, WireClientProviderFactory, PlClient } from '@milaboratories/pl-client';
2
+ import { addRTypeToMetadata, createRTypeRoutingHeader, RestAPI } from '@milaboratories/pl-client';
3
3
  import type { ResourceInfo } from '@milaboratories/pl-tree';
4
4
  import type { MiLogger } from '@milaboratories/ts-helpers';
5
5
  import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
6
6
  import * as fs from 'node:fs/promises';
7
7
  import type { Dispatcher } from 'undici';
8
8
  import { request } from 'undici';
9
- import { uploadapi_ChecksumAlgorithm, type uploadapi_GetPartURL_Response } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol';
10
- import { UploadClient } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client';
9
+ import { UploadAPI_ChecksumAlgorithm, type UploadAPI_GetPartURL_Response } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol';
10
+ import { UploadClient } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client';
11
+ import type { UploadApiPaths, UploadRestClientType } from '../proto-rest';
11
12
  import { crc32c } from './crc32c';
12
13
 
13
14
  import type { IncomingHttpHeaders } from 'undici/types/header';
@@ -37,15 +38,28 @@ export class BadRequestError extends Error {
37
38
  * The user should pass here a concrete BlobUpload/<storageId> resource,
38
39
  * it can be got from handle field of BlobUpload. */
39
40
  export class ClientUpload {
40
- private readonly grpcClient: GrpcClientProvider<UploadClient>;
41
+ private readonly wire: WireClientProvider<UploadRestClientType | UploadClient>;
41
42
 
42
43
  constructor(
43
- grpcClientProviderFactory: GrpcClientProviderFactory,
44
+ wireClientProviderFactory: WireClientProviderFactory,
44
45
  public readonly httpClient: Dispatcher,
45
46
  _: PlClient,
46
47
  public readonly logger: MiLogger,
47
48
  ) {
48
- this.grpcClient = grpcClientProviderFactory.createGrpcClientProvider((transport) => new UploadClient(transport));
49
+ this.wire = wireClientProviderFactory.createWireClientProvider(
50
+ (wire) => {
51
+ if (wire.type === 'grpc') {
52
+ return new UploadClient(wire.Transport);
53
+ }
54
+
55
+ return RestAPI.createClient<UploadApiPaths>({
56
+ hostAndPort: wire.Config.hostAndPort,
57
+ ssl: wire.Config.ssl,
58
+ dispatcher: wire.Dispatcher,
59
+ middlewares: wire.Middlewares,
60
+ });
61
+ },
62
+ );
49
63
  }
50
64
 
51
65
  close() {}
@@ -56,13 +70,33 @@ export class ClientUpload {
56
70
  ): Promise<{
57
71
  overall: bigint;
58
72
  toUpload: bigint[];
59
- checksumAlgorithm: uploadapi_ChecksumAlgorithm;
73
+ checksumAlgorithm: UploadAPI_ChecksumAlgorithm;
60
74
  checksumHeader: string;
61
75
  }> {
62
- const init = await this.grpcInit(id, type, options);
76
+ const client = this.wire.get();
77
+
78
+ if (client instanceof UploadClient) {
79
+ const init = (await client.init({ resourceId: id }, addRTypeToMetadata(type, options)))
80
+ .response;
81
+
82
+ return {
83
+ overall: init.partsCount,
84
+ toUpload: this.partsToUpload(init.partsCount, init.uploadedParts),
85
+ checksumAlgorithm: init.checksumAlgorithm,
86
+ checksumHeader: init.checksumHeader,
87
+ };
88
+ }
89
+
90
+ const init = (await client.POST('/v1/upload/init', {
91
+ body: {
92
+ resourceId: id.toString(),
93
+ },
94
+ headers: { ...createRTypeRoutingHeader(type) },
95
+ })).data!;
96
+
63
97
  return {
64
- overall: init.partsCount,
65
- toUpload: this.partsToUpload(init.partsCount, init.uploadedParts),
98
+ overall: BigInt(init.partsCount),
99
+ toUpload: this.partsToUpload(BigInt(init.partsCount), init.uploadedParts.map(BigInt)),
66
100
  checksumAlgorithm: init.checksumAlgorithm,
67
101
  checksumHeader: init.checksumHeader,
68
102
  };
@@ -73,22 +107,50 @@ export class ClientUpload {
73
107
  path: string,
74
108
  expectedMTimeUnix: bigint,
75
109
  partNumber: bigint,
76
- checksumAlgorithm: uploadapi_ChecksumAlgorithm,
110
+ checksumAlgorithm: UploadAPI_ChecksumAlgorithm,
77
111
  checksumHeader: string,
78
112
  options?: RpcOptions,
79
113
  ) {
80
- const info = await this.grpcGetPartUrl(
81
- { id, type },
82
- partNumber,
83
- 0n, // we update progress as a separate call later.
84
- options,
85
- );
114
+ const client = this.wire.get();
115
+
116
+ let info: UploadAPI_GetPartURL_Response;
117
+ if (client instanceof UploadClient) {
118
+ // partChecksum isn't used for now but protoc requires it to be set
119
+ info = (await client.getPartURL(
120
+ {
121
+ resourceId: id,
122
+ partNumber,
123
+ uploadedPartSize: 0n,
124
+ isInternalUse: false,
125
+ partChecksum: '',
126
+ },
127
+ addRTypeToMetadata(type, options),
128
+ )).response;
129
+ } else {
130
+ const resp = (await client.POST('/v1/upload/get-part-url', {
131
+ body: {
132
+ resourceId: id.toString(),
133
+ partNumber: partNumber.toString(),
134
+ uploadedPartSize: '0',
135
+ isInternalUse: false,
136
+ partChecksum: '',
137
+ },
138
+ headers: { ...createRTypeRoutingHeader(type) },
139
+ })).data!;
140
+ info = {
141
+ uploadUrl: resp.uploadUrl,
142
+ method: resp.method,
143
+ headers: resp.headers,
144
+ chunkStart: BigInt(resp.chunkStart),
145
+ chunkEnd: BigInt(resp.chunkEnd),
146
+ };
147
+ }
86
148
 
87
149
  const chunk = await readFileChunk(path, info.chunkStart, info.chunkEnd);
88
150
  await checkExpectedMTime(path, expectedMTimeUnix);
89
151
 
90
152
  const crc32cChecksum = calculateCrc32cChecksum(chunk);
91
- if (checksumAlgorithm === uploadapi_ChecksumAlgorithm.CRC32C) {
153
+ if (checksumAlgorithm === UploadAPI_ChecksumAlgorithm.CRC32C) {
92
154
  info.headers.push({ name: checksumHeader, value: crc32cChecksum });
93
155
  }
94
156
 
@@ -136,11 +198,22 @@ export class ClientUpload {
136
198
  throw new Error(`partUpload: error ${JSON.stringify(e)} happened while trying to do part upload to the url ${info.uploadUrl}, headers: ${JSON.stringify(info.headers)}`);
137
199
  }
138
200
 
139
- await this.grpcUpdateProgress({ id, type }, BigInt(info.chunkEnd - info.chunkStart), options);
201
+ await this.updateProgress({ id, type }, BigInt(info.chunkEnd - info.chunkStart), options);
140
202
  }
141
203
 
142
204
  public async finalize(info: ResourceInfo, options?: RpcOptions) {
143
- return await this.grpcFinalize(info, options);
205
+ const client = this.wire.get();
206
+
207
+ if (client instanceof UploadClient) {
208
+ await client.finalize({ resourceId: info.id }, addRTypeToMetadata(info.type, options));
209
+ } else {
210
+ await client.POST('/v1/upload/finalize', {
211
+ body: {
212
+ resourceId: info.id.toString(),
213
+ },
214
+ headers: { ...createRTypeRoutingHeader(info.type) },
215
+ });
216
+ }
144
217
  }
145
218
 
146
219
  /** Calculates parts that need to be uploaded from the parts that were
@@ -156,41 +229,32 @@ export class ClientUpload {
156
229
  return toUpload;
157
230
  }
158
231
 
159
- private async grpcInit(id: ResourceId, type: ResourceType, options?: RpcOptions) {
160
- return await this.grpcClient.get().init({ resourceId: id }, addRTypeToMetadata(type, options))
161
- .response;
162
- }
163
-
164
- private async grpcGetPartUrl(
165
- { id, type }: ResourceInfo,
166
- partNumber: bigint,
167
- uploadedPartSize: bigint,
168
- options?: RpcOptions,
169
- ) {
170
- // partChecksum isn't used for now but protoc requires it to be set
171
- return await this.grpcClient.get().getPartURL(
172
- { resourceId: id, partNumber, uploadedPartSize, isInternalUse: false, partChecksum: '' },
173
- addRTypeToMetadata(type, options),
174
- ).response;
175
- }
176
-
177
- private async grpcUpdateProgress(
232
+ private async updateProgress(
178
233
  { id, type }: ResourceInfo,
179
234
  bytesProcessed: bigint,
180
235
  options?: RpcOptions,
181
- ) {
182
- await this.grpcClient.get().updateProgress(
183
- {
184
- resourceId: id,
185
- bytesProcessed,
186
- },
187
- addRTypeToMetadata(type, options),
188
- ).response;
189
- }
236
+ ): Promise<void> {
237
+ const client = this.wire.get();
238
+
239
+ if (client instanceof UploadClient) {
240
+ await client.updateProgress(
241
+ {
242
+ resourceId: id,
243
+ bytesProcessed,
244
+ },
245
+ addRTypeToMetadata(type, options),
246
+ ).response;
247
+ return;
248
+ }
190
249
 
191
- private async grpcFinalize({ id, type }: ResourceInfo, options?: RpcOptions) {
192
- return await this.grpcClient.get().finalize({ resourceId: id }, addRTypeToMetadata(type, options))
193
- .response;
250
+ await client.POST('/v1/upload/update-progress', {
251
+ body: {
252
+ resourceId: id.toString(),
253
+ bytesProcessed: bytesProcessed.toString(),
254
+ },
255
+ headers: { ...createRTypeRoutingHeader(type) },
256
+ });
257
+ return;
194
258
  }
195
259
  }
196
260
 
@@ -243,7 +307,7 @@ function checkStatusCodeOk(
243
307
  statusCode: number,
244
308
  body: string,
245
309
  headers: IncomingHttpHeaders,
246
- info: uploadapi_GetPartURL_Response,
310
+ info: UploadAPI_GetPartURL_Response,
247
311
  ) {
248
312
  if (statusCode == 400) {
249
313
  throw new BadRequestError(`response is not ok, status code: ${statusCode},`
@@ -63,7 +63,7 @@ import { blobKey, pathToKey } from './blob_key';
63
63
  import { DownloadBlobTask, nonRecoverableError } from './download_blob_task';
64
64
  import { FilesCache } from '../helpers/files_cache';
65
65
  import { SparseCache, SparseCacheFsFile, SparseCacheFsRanges } from './sparse_cache/cache';
66
- import { isOffByOneError } from '../../helpers/download';
66
+ import { isOffByOneError } from '../../helpers/download_errors';
67
67
 
68
68
  export type DownloadDriverOps = {
69
69
  /**
@@ -18,7 +18,7 @@ import * as path from 'node:path';
18
18
  import { Writable } from 'node:stream';
19
19
  import type { ClientDownload } from '../../clients/download';
20
20
  import { UnknownStorageError, WrongLocalFileUrl } from '../../clients/download';
21
- import { NetworkError400 } from '../../helpers/download';
21
+ import { isDownloadNetworkError400 } from '../../helpers/download_errors';
22
22
  import { resourceIdToString, stringifyWithResourceId } from '@milaboratories/pl-client';
23
23
 
24
24
  /** Downloads a blob and holds callers and watchers for the blob. */
@@ -155,7 +155,7 @@ export class DownloadBlobTask {
155
155
  export function nonRecoverableError(e: any) {
156
156
  return (
157
157
  e instanceof DownloadAborted
158
- || e instanceof NetworkError400
158
+ || isDownloadNetworkError400(e)
159
159
  || e instanceof UnknownStorageError
160
160
  || e instanceof WrongLocalFileUrl
161
161
  // file that we downloads from was moved or deleted.
@@ -4,7 +4,7 @@ import * as tar from 'tar-fs';
4
4
  import path from 'path';
5
5
  import fs from 'fs';
6
6
  import * as fsp from 'fs/promises';
7
- import { NetworkError400 } from '../../helpers/download';
7
+ import { isDownloadNetworkError400 } from '../../helpers/download_errors';
8
8
  import type { Watcher } from '@milaboratories/computable';
9
9
  import { ChangeSource } from '@milaboratories/computable';
10
10
  import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
@@ -224,7 +224,7 @@ class URLAborted extends Error {
224
224
  export function nonRecoverableError(e: any) {
225
225
  return (
226
226
  e instanceof URLAborted
227
- || e instanceof NetworkError400
227
+ || isDownloadNetworkError400(e)
228
228
  || e instanceof UnknownStorageError
229
229
  || e instanceof WrongLocalFileUrl
230
230
  // file that we downloads from was moved or deleted.
@@ -17,7 +17,7 @@ import { Transform, Writable } from 'node:stream';
17
17
  import * as zlib from 'node:zlib';
18
18
  import * as tar from 'tar-fs';
19
19
  import type { RemoteFileDownloader } from '../../helpers/download';
20
- import { NetworkError400 } from '../../helpers/download';
20
+ import { isDownloadNetworkError400 } from '../../helpers/download_errors';
21
21
  import type { UrlResult } from './driver';
22
22
  import { newBlockUIURL } from '../urls/url';
23
23
 
@@ -59,7 +59,7 @@ export class DownloadByUrlTask {
59
59
  this.setDone(size);
60
60
  this.change.markChanged(`download of ${this.url} finished`);
61
61
  } catch (e: unknown) {
62
- if (e instanceof URLAborted || e instanceof NetworkError400) {
62
+ if (e instanceof URLAborted || isDownloadNetworkError400(e)) {
63
63
  this.setError(e);
64
64
  this.change.markChanged(`download of ${this.url} failed`);
65
65
  // Just in case we were half-way extracting an archive.
@@ -21,7 +21,7 @@ import { randomUUID } from 'node:crypto';
21
21
  import type { PlTreeEntry, ResourceInfo } from '@milaboratories/pl-tree';
22
22
  import { treeEntryToResourceInfo } from '@milaboratories/pl-tree';
23
23
  import { scheduler } from 'node:timers/promises';
24
- import type { StreamingAPI_Response } from '../proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol';
24
+ import type { StreamingAPI_Response } from '../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol';
25
25
  import type * as sdk from '@milaboratories/pl-model-common';
26
26
  import type { PollingOps } from './helpers/polling_ops';
27
27
  import type { RpcError } from '@protobuf-ts/runtime-rpc';