@milaboratories/pl-drivers 1.5.13 → 1.5.15
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/clients/upload.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/clients/upload.ts +18 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-drivers",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.15",
|
|
4
4
|
"description": "Drivers and a low-level clients for log streaming, downloading and uploading files from and to pl",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"undici": "^7.2.3",
|
|
29
29
|
"zod": "~3.23.8",
|
|
30
30
|
"@milaboratories/ts-helpers": "^1.1.3",
|
|
31
|
-
"@milaboratories/
|
|
32
|
-
"@milaboratories/pl-
|
|
33
|
-
"@milaboratories/pl-
|
|
34
|
-
"@milaboratories/
|
|
31
|
+
"@milaboratories/pl-client": "^2.7.4",
|
|
32
|
+
"@milaboratories/pl-tree": "^1.4.23",
|
|
33
|
+
"@milaboratories/pl-model-common": "^1.10.5",
|
|
34
|
+
"@milaboratories/computable": "^2.3.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"eslint": "^9.16.0",
|
package/src/clients/upload.ts
CHANGED
|
@@ -69,20 +69,24 @@ export class ClientUpload {
|
|
|
69
69
|
const chunk = await readFileChunk(path, info.chunkStart, info.chunkEnd);
|
|
70
70
|
await checkExpectedMTime(path, expectedMTimeUnix);
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
72
|
+
try {
|
|
73
|
+
const {
|
|
74
|
+
body: rawBody,
|
|
75
|
+
statusCode,
|
|
76
|
+
headers,
|
|
77
|
+
} = await request(info.uploadUrl, {
|
|
78
|
+
dispatcher: this.httpClient,
|
|
79
|
+
body: chunk,
|
|
80
|
+
headers: toHeadersMap(info.headers),
|
|
81
|
+
method: info.method.toUpperCase() as Dispatcher.HttpMethod,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// always read the body for resources to be garbage collected.
|
|
85
|
+
const body = await rawBody.text();
|
|
86
|
+
checkStatusCodeOk(statusCode, body, headers, info);
|
|
87
|
+
} catch (e: unknown) {
|
|
88
|
+
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)}`);
|
|
89
|
+
}
|
|
86
90
|
|
|
87
91
|
await this.grpcUpdateProgress({ id, type }, info.chunkEnd - info.chunkStart, options);
|
|
88
92
|
}
|