@milaboratories/pl-drivers 1.5.65 → 1.5.67

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-drivers",
3
- "version": "1.5.65",
3
+ "version": "1.5.67",
4
4
  "engines": {
5
5
  "node": ">=20"
6
6
  },
@@ -32,11 +32,11 @@
32
32
  "zod": "~3.23.8",
33
33
  "upath": "^2.0.1",
34
34
  "@milaboratories/helpers": "^1.6.12",
35
- "@milaboratories/ts-helpers": "^1.3.2",
36
- "@milaboratories/pl-client": "^2.10.1",
37
- "@milaboratories/computable": "^2.4.11",
38
- "@milaboratories/pl-tree": "^1.6.7",
39
- "@milaboratories/pl-model-common": "^1.15.3"
35
+ "@milaboratories/computable": "^2.4.12",
36
+ "@milaboratories/pl-client": "^2.10.2",
37
+ "@milaboratories/pl-tree": "^1.6.8",
38
+ "@milaboratories/ts-helpers": "^1.3.3",
39
+ "@milaboratories/pl-model-common": "^1.15.5"
40
40
  },
41
41
  "devDependencies": {
42
42
  "eslint": "^9.25.1",
@@ -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();
@@ -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. */
@@ -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) {}