@milaboratories/pl-drivers 1.5.66 → 1.5.68
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/download.d.ts +2 -0
- package/dist/clients/download.d.ts.map +1 -1
- package/dist/clients/upload.d.ts +4 -0
- package/dist/clients/upload.d.ts.map +1 -1
- package/dist/drivers/download_blob/download_blob_task.d.ts.map +1 -1
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts +1 -0
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts.map +1 -1
- package/dist/drivers/download_blob_url/task.d.ts.map +1 -1
- package/dist/drivers/helpers/helpers.d.ts +1 -0
- package/dist/drivers/helpers/helpers.d.ts.map +1 -1
- package/dist/helpers/download.d.ts +1 -0
- package/dist/helpers/download.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1717 -1669
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/clients/download.ts +6 -2
- package/src/clients/upload.ts +12 -4
- package/src/drivers/download_blob/download_blob_task.ts +3 -1
- package/src/drivers/download_blob/sparse_cache/cache.ts +3 -1
- package/src/drivers/download_blob_url/task.ts +3 -1
- package/src/drivers/download_url.ts +3 -1
- package/src/drivers/helpers/helpers.ts +3 -1
- package/src/helpers/download.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-drivers",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.68",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"decompress": "^4.2.1",
|
|
24
|
-
"@grpc/grpc-js": "~1.13.
|
|
25
|
-
"@protobuf-ts/grpc-transport": "2.
|
|
26
|
-
"@protobuf-ts/runtime": "2.
|
|
27
|
-
"@protobuf-ts/runtime-rpc": "2.
|
|
28
|
-
"@protobuf-ts/plugin": "2.
|
|
24
|
+
"@grpc/grpc-js": "~1.13.4",
|
|
25
|
+
"@protobuf-ts/grpc-transport": "2.11.0",
|
|
26
|
+
"@protobuf-ts/runtime": "2.11.0",
|
|
27
|
+
"@protobuf-ts/runtime-rpc": "2.11.0",
|
|
28
|
+
"@protobuf-ts/plugin": "2.11.0",
|
|
29
29
|
"denque": "^2.1.0",
|
|
30
|
-
"tar-fs": "^3.0.
|
|
31
|
-
"undici": "~7.
|
|
30
|
+
"tar-fs": "^3.0.9",
|
|
31
|
+
"undici": "~7.10.0",
|
|
32
32
|
"zod": "~3.23.8",
|
|
33
33
|
"upath": "^2.0.1",
|
|
34
|
-
"@milaboratories/ts-helpers": "^1.
|
|
35
|
-
"@milaboratories/
|
|
36
|
-
"@milaboratories/
|
|
34
|
+
"@milaboratories/ts-helpers": "^1.4.0",
|
|
35
|
+
"@milaboratories/pl-client": "^2.11.0",
|
|
36
|
+
"@milaboratories/computable": "^2.5.0",
|
|
37
37
|
"@milaboratories/helpers": "^1.6.12",
|
|
38
|
-
"@milaboratories/pl-
|
|
39
|
-
"@milaboratories/pl-tree": "^1.6.
|
|
38
|
+
"@milaboratories/pl-model-common": "^1.15.5",
|
|
39
|
+
"@milaboratories/pl-tree": "^1.6.9"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"eslint": "^9.25.1",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"vitest": "^2.1.9",
|
|
48
48
|
"@vitest/coverage-v8": "^2.1.9",
|
|
49
49
|
"@types/tar-fs": "^2.0.4",
|
|
50
|
-
"@milaboratories/
|
|
51
|
-
"@milaboratories/
|
|
50
|
+
"@milaboratories/eslint-config": "^1.0.4",
|
|
51
|
+
"@milaboratories/platforma-build-configs": "1.0.3"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"type-check": "tsc --noEmit --composite false",
|
package/src/clients/download.ts
CHANGED
|
@@ -121,10 +121,14 @@ function isLocal(url: string) {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/** Throws when a local URL have invalid scheme. */
|
|
124
|
-
export class WrongLocalFileUrl extends Error {
|
|
124
|
+
export class WrongLocalFileUrl extends Error {
|
|
125
|
+
name = 'WrongLocalFileUrl';
|
|
126
|
+
}
|
|
125
127
|
|
|
126
128
|
/** Happens when a storage for a local file can't be found. */
|
|
127
|
-
export class UnknownStorageError extends Error {
|
|
129
|
+
export class UnknownStorageError extends Error {
|
|
130
|
+
name = 'UnknownStorageError';
|
|
131
|
+
}
|
|
128
132
|
|
|
129
133
|
export function newLocalStorageIdsToRoot(projections: LocalStorageProjection[]) {
|
|
130
134
|
const idToRoot: Map<string, string> = new Map();
|
package/src/clients/upload.ts
CHANGED
|
@@ -12,14 +12,22 @@ import { UploadClient } from '../proto/github.com/milaboratory/pl/controllers/sh
|
|
|
12
12
|
import { toHeadersMap } from './helpers';
|
|
13
13
|
import type { IncomingHttpHeaders } from 'undici/types/header';
|
|
14
14
|
|
|
15
|
-
export class MTimeError extends Error {
|
|
15
|
+
export class MTimeError extends Error {
|
|
16
|
+
name = 'MTimeError';
|
|
17
|
+
}
|
|
16
18
|
|
|
17
|
-
export class UnexpectedEOF extends Error {
|
|
19
|
+
export class UnexpectedEOF extends Error {
|
|
20
|
+
name = 'UnexpectedEOF';
|
|
21
|
+
}
|
|
18
22
|
|
|
19
|
-
export class NetworkError extends Error {
|
|
23
|
+
export class NetworkError extends Error {
|
|
24
|
+
name = 'NetworkError';
|
|
25
|
+
}
|
|
20
26
|
|
|
21
27
|
/** Happens when the file doesn't exist */
|
|
22
|
-
export class NoFileForUploading extends Error {
|
|
28
|
+
export class NoFileForUploading extends Error {
|
|
29
|
+
name = 'NoFileForUploading';
|
|
30
|
+
}
|
|
23
31
|
|
|
24
32
|
/** Low-level client for grpc uploadapi.
|
|
25
33
|
* The user should pass here a concrete BlobUpload/<storageId> resource,
|
|
@@ -150,7 +150,9 @@ export function nonRecoverableError(e: any) {
|
|
|
150
150
|
|
|
151
151
|
/** The downloading task was aborted by a signal.
|
|
152
152
|
* It may happen when the computable is done, for example. */
|
|
153
|
-
class DownloadAborted extends Error {
|
|
153
|
+
class DownloadAborted extends Error {
|
|
154
|
+
name = 'DownloadAborted';
|
|
155
|
+
}
|
|
154
156
|
|
|
155
157
|
export function getDownloadedBlobResponse(
|
|
156
158
|
handle: LocalBlobHandle | undefined,
|
|
@@ -7,7 +7,9 @@ import { writeToSparseFile } from './file';
|
|
|
7
7
|
import { functions } from '@milaboratories/helpers';
|
|
8
8
|
|
|
9
9
|
/** The implementer of SparseCacheRanges could throw it if ranges were corrupted. */
|
|
10
|
-
export class CorruptedRangesError extends Error {
|
|
10
|
+
export class CorruptedRangesError extends Error {
|
|
11
|
+
name = 'CorruptedRangesError';
|
|
12
|
+
}
|
|
11
13
|
|
|
12
14
|
/** Extracted ranges methods to be able to store ranges somewhere else (e.g. in memory for tests). */
|
|
13
15
|
export interface SparseCacheRanges {
|
|
@@ -212,7 +212,9 @@ type DownloadCtx = {
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
/** Throws when a downloading aborts. */
|
|
215
|
-
class URLAborted extends Error {
|
|
215
|
+
class URLAborted extends Error {
|
|
216
|
+
name = 'URLAborted';
|
|
217
|
+
}
|
|
216
218
|
|
|
217
219
|
export function nonRecoverableError(e: any) {
|
|
218
220
|
return (
|
|
@@ -289,7 +289,9 @@ class DownloadByUrlTask {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
/** Throws when a downloading aborts. */
|
|
292
|
-
class URLAborted extends Error {
|
|
292
|
+
class URLAborted extends Error {
|
|
293
|
+
name = 'URLAborted';
|
|
294
|
+
}
|
|
293
295
|
|
|
294
296
|
/** Gets a directory size by calculating sizes recursively. */
|
|
295
297
|
async function dirSize(dir: string): Promise<number> {
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
} from '@milaboratories/pl-client';
|
|
9
9
|
|
|
10
10
|
/** Throws when a driver gets a resource with a wrong resource type. */
|
|
11
|
-
export class WrongResourceTypeError extends Error {
|
|
11
|
+
export class WrongResourceTypeError extends Error {
|
|
12
|
+
name = 'WrongResourceTypeError';
|
|
13
|
+
}
|
|
12
14
|
|
|
13
15
|
/** Updater incorporates a pattern when someone wants to run a callback
|
|
14
16
|
* that updates something only when it's not already running. */
|
package/src/helpers/download.ts
CHANGED
|
@@ -12,7 +12,9 @@ export interface DownloadResponse {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** Throws when a status code of the downloading URL was in range [400, 500). */
|
|
15
|
-
export class NetworkError400 extends Error {
|
|
15
|
+
export class NetworkError400 extends Error {
|
|
16
|
+
name = 'NetworkError400';
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
export class RemoteFileDownloader {
|
|
18
20
|
constructor(public readonly httpClient: Dispatcher) {}
|