@milaboratories/pl-drivers 1.9.1 → 1.10.1
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/constructors.d.ts +4 -3
- package/dist/clients/constructors.d.ts.map +1 -0
- package/dist/clients/download.d.ts +8 -7
- package/dist/clients/download.d.ts.map +1 -0
- package/dist/clients/logs.d.ts +7 -6
- package/dist/clients/logs.d.ts.map +1 -0
- package/dist/clients/ls_api.d.ts +6 -5
- package/dist/clients/ls_api.d.ts.map +1 -0
- package/dist/clients/progress.d.ts +7 -6
- package/dist/clients/progress.d.ts.map +1 -0
- package/dist/clients/upload.cjs +31 -10
- package/dist/clients/upload.cjs.map +1 -1
- package/dist/clients/upload.d.ts +14 -7
- package/dist/clients/upload.d.ts.map +1 -0
- package/dist/clients/upload.js +31 -11
- package/dist/clients/upload.js.map +1 -1
- package/dist/drivers/download_blob/blob_key.d.ts +2 -1
- package/dist/drivers/download_blob/blob_key.d.ts.map +1 -0
- package/dist/drivers/download_blob/download_blob.d.ts +9 -6
- package/dist/drivers/download_blob/download_blob.d.ts.map +1 -0
- package/dist/drivers/download_blob/download_blob_task.d.ts +8 -5
- package/dist/drivers/download_blob/download_blob_task.d.ts.map +1 -0
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts +1 -0
- package/dist/drivers/download_blob/sparse_cache/cache.d.ts.map +1 -0
- package/dist/drivers/download_blob/sparse_cache/file.d.ts +2 -1
- package/dist/drivers/download_blob/sparse_cache/file.d.ts.map +1 -0
- package/dist/drivers/download_blob/sparse_cache/ranges.d.ts +4 -3
- package/dist/drivers/download_blob/sparse_cache/ranges.d.ts.map +1 -0
- package/dist/drivers/download_blob_url/driver.d.ts +9 -7
- package/dist/drivers/download_blob_url/driver.d.ts.map +1 -0
- package/dist/drivers/download_blob_url/driver_id.d.ts +3 -2
- package/dist/drivers/download_blob_url/driver_id.d.ts.map +1 -0
- package/dist/drivers/download_blob_url/snapshot.d.ts +4 -3
- package/dist/drivers/download_blob_url/snapshot.d.ts.map +1 -0
- package/dist/drivers/download_blob_url/task.d.ts +8 -5
- package/dist/drivers/download_blob_url/task.d.ts.map +1 -0
- package/dist/drivers/download_blob_url/url.d.ts +1 -0
- package/dist/drivers/download_blob_url/url.d.ts.map +1 -0
- package/dist/drivers/download_url/driver.d.ts +6 -4
- package/dist/drivers/download_url/driver.d.ts.map +1 -0
- package/dist/drivers/download_url/task.d.ts +7 -4
- package/dist/drivers/download_url/task.d.ts.map +1 -0
- package/dist/drivers/helpers/download_local_handle.d.ts +5 -2
- package/dist/drivers/helpers/download_local_handle.d.ts.map +1 -0
- package/dist/drivers/helpers/download_remote_handle.d.ts +6 -3
- package/dist/drivers/helpers/download_remote_handle.d.ts.map +1 -0
- package/dist/drivers/helpers/files_cache.d.ts +2 -1
- package/dist/drivers/helpers/files_cache.d.ts.map +1 -0
- package/dist/drivers/helpers/helpers.d.ts +1 -0
- package/dist/drivers/helpers/helpers.d.ts.map +1 -0
- package/dist/drivers/helpers/logs_handle.d.ts +4 -1
- package/dist/drivers/helpers/logs_handle.d.ts.map +1 -0
- package/dist/drivers/helpers/ls_remote_import_handle.d.ts +3 -2
- package/dist/drivers/helpers/ls_remote_import_handle.d.ts.map +1 -0
- package/dist/drivers/helpers/ls_storage_entry.d.ts +2 -1
- package/dist/drivers/helpers/ls_storage_entry.d.ts.map +1 -0
- package/dist/drivers/helpers/polling_ops.d.ts +1 -0
- package/dist/drivers/helpers/polling_ops.d.ts.map +1 -0
- package/dist/drivers/helpers/read_file.d.ts +2 -1
- package/dist/drivers/helpers/read_file.d.ts.map +1 -0
- package/dist/drivers/helpers/test_helpers.d.ts +1 -0
- package/dist/drivers/helpers/test_helpers.d.ts.map +1 -0
- package/dist/drivers/logs.d.ts +7 -5
- package/dist/drivers/logs.d.ts.map +1 -0
- package/dist/drivers/logs_stream.d.ts +7 -5
- package/dist/drivers/logs_stream.d.ts.map +1 -0
- package/dist/drivers/ls.cjs +15 -6
- package/dist/drivers/ls.cjs.map +1 -1
- package/dist/drivers/ls.d.ts +5 -4
- package/dist/drivers/ls.d.ts.map +1 -0
- package/dist/drivers/ls.js +14 -5
- package/dist/drivers/ls.js.map +1 -1
- package/dist/drivers/types.d.ts +5 -4
- package/dist/drivers/types.d.ts.map +1 -0
- package/dist/drivers/upload.d.ts +9 -7
- package/dist/drivers/upload.d.ts.map +1 -0
- package/dist/drivers/upload_task.cjs +7 -3
- package/dist/drivers/upload_task.cjs.map +1 -1
- package/dist/drivers/upload_task.d.ts +10 -7
- package/dist/drivers/upload_task.d.ts.map +1 -0
- package/dist/drivers/upload_task.js +8 -4
- package/dist/drivers/upload_task.js.map +1 -1
- package/dist/drivers/urls/url.d.ts +3 -2
- package/dist/drivers/urls/url.d.ts.map +1 -0
- package/dist/drivers/virtual_storages.d.ts +2 -1
- package/dist/drivers/virtual_storages.d.ts.map +1 -0
- package/dist/helpers/download.d.ts +4 -3
- package/dist/helpers/download.d.ts.map +1 -0
- package/dist/helpers/validate.d.ts +1 -0
- package/dist/helpers/validate.d.ts.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +8 -2
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +9 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +8 -2
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +9 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +9 -3
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +12 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +9 -3
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +14 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +8 -2
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs +47 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts +15 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts +44 -2
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js +48 -2
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +58 -4
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +22 -7
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +12 -4
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +7 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +23 -7
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +1 -0
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +8 -2
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -0
- package/dist/proto/google/api/http.d.ts +7 -1
- package/dist/proto/google/api/http.d.ts.map +1 -0
- package/dist/proto/google/protobuf/any.d.ts +11 -1
- package/dist/proto/google/protobuf/any.d.ts.map +1 -0
- package/dist/proto/google/protobuf/descriptor.d.ts +7 -1
- package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -0
- package/dist/proto/google/protobuf/duration.d.ts +10 -1
- package/dist/proto/google/protobuf/duration.d.ts.map +1 -0
- package/dist/proto/google/protobuf/empty.d.ts +7 -1
- package/dist/proto/google/protobuf/empty.d.ts.map +1 -0
- package/dist/proto/google/protobuf/struct.d.ts +10 -1
- package/dist/proto/google/protobuf/struct.d.ts.map +1 -0
- package/dist/proto/google/protobuf/timestamp.d.ts +10 -1
- package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/proto/google/protobuf/wrappers.d.ts +10 -1
- package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -0
- package/dist/test_env.d.ts +1 -0
- package/dist/test_env.d.ts.map +1 -0
- package/package.json +12 -11
- package/src/clients/upload.ts +38 -14
- package/src/drivers/ls.ts +17 -6
- package/src/drivers/upload_task.ts +10 -3
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.ts +69 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../src/drivers/download_blob/sparse_cache/cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAA2C,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG/F,OAAO,EAA4B,MAAM,EAAkF,MAAM,UAAU,CAAC;AAI5I,oFAAoF;AACpF,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,IAAI,SAA0B;CAC/B;AAED,qGAAqG;AACrG,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,+EAA+E;AAC/E,qBAAa,mBAAoB,YAAW,iBAAiB;IAEzD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM;IAGnC,OAAO,CAAC,KAAK;IAIP,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAI/B,MAAM,CAAC,GAAG,EAAE,MAAM;CAGzB;AAED,oDAAoD;AACpD,M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AK;gBAGE,MAAM,EAAE,QAAQ;IAChC,+BAA+B;IACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,iBAAiB;IAG5C;kCAC8B;IACxB,KAAK;IAMX;kCAC8B;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAMtE;kCAC8B;IACxB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;YAM5D,WAAW;YAeX,SAAS;YAmBT,SAAS;IAKvB,yGAAyG;IACnG,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBzF,4EAA4E;IACtE,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBpC,8GAA8G;YAChG,SAAS;IAiBvB,wEAAwE;YAC1D,KAAK;CAKpB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { MiLogger } from
|
|
1
|
+
import { MiLogger } from "@milaboratories/ts-helpers";
|
|
2
2
|
/** Creates a sparse file for all systems
|
|
3
3
|
* Table of what supports sparse files:
|
|
4
4
|
* https://en.wikipedia.org/wiki/Comparison_of_file_systems#Allocation_and_layout_policies */
|
|
5
5
|
export declare function createSparseFile(logger: MiLogger, path: string, platform: NodeJS.Platform): Promise<void>;
|
|
6
6
|
/** Ensures the file is created and writes to it. */
|
|
7
7
|
export declare function writeToSparseFile(logger: MiLogger, platform: NodeJS.Platform, path: string, data: Uint8Array, from: number): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/drivers/download_blob/sparse_cache/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAG9E;;6FAE6F;AAC7F,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,CAAC,QAAQ,iBAU1B;AAcD,oDAAoD;AACpD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,iBASb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { RangeBytes } from
|
|
3
|
-
import { MiLogger } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RangeBytes } from "@milaboratories/pl-model-common";
|
|
3
|
+
import { MiLogger } from "@milaboratories/ts-helpers";
|
|
4
4
|
/** The content of the ranges file: ranges of bytes.
|
|
5
5
|
* The ranges should be normalized: sorted and no overlaps.
|
|
6
6
|
* For that, use `normalizeRanges` function. */
|
|
@@ -43,3 +43,4 @@ export declare function addRange(s: Ranges, range: RangeBytes): {
|
|
|
43
43
|
}[];
|
|
44
44
|
};
|
|
45
45
|
export {};
|
|
46
|
+
//# sourceMappingURL=ranges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranges.d.ts","sourceRoot":"","sources":["../../../../src/drivers/download_blob/sparse_cache/ranges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAwB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG5E;;+CAE+C;AAC/C,QAAA,MAAM,MAAM;;cAoBwC,EAAE,SAAS;YAExD,EAAG,SAAS;;;;;;;;;;;;;;;;;;EApBjB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAE5C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBpF;AAED,gEAAgE;AAChE,wBAAsB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAInF;AAED,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,QASxC;AASD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,UAEnC;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAQ5E;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU;;;;;EAKpD"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ComputableCtx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import type { ComputableCtx } from '@milaboratories/computable';
|
|
2
|
+
import { Computable } from '@milaboratories/computable';
|
|
3
|
+
import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
4
|
+
import type { ResourceId } from '@milaboratories/pl-client';
|
|
5
|
+
import { type ArchiveFormat, type BlobToURLDriver, type FolderURL } from '@milaboratories/pl-model-common';
|
|
6
|
+
import type { DownloadableBlobSnapshot } from './snapshot';
|
|
7
|
+
import type { PlTreeEntry } from '@milaboratories/pl-tree';
|
|
7
8
|
import { DownloadAndUnarchiveTask } from './task';
|
|
8
|
-
import { ClientDownload } from '../../clients/download';
|
|
9
|
+
import type { ClientDownload } from '../../clients/download';
|
|
9
10
|
export type DownloadBlobToURLDriverOps = {
|
|
10
11
|
cacheSoftSizeBytes: number;
|
|
11
12
|
nConcurrentDownloads: number;
|
|
@@ -43,3 +44,4 @@ export declare class DownloadBlobToURLDriver implements BlobToURLDriver {
|
|
|
43
44
|
private removeTask;
|
|
44
45
|
private getFilePath;
|
|
45
46
|
}
|
|
47
|
+
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_blob_url/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAW,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAO7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,SAAS,EAAe,MAAM,iCAAiC,CAAC;AACxH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,wBAAwB,EAAW,MAAM,QAAQ,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM7D,MAAM,MAAM,0BAA0B,GAAG;IACvC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;uDACuD;AACvD,qBAAa,uBAAwB,YAAW,eAAe;IAS3D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAZvB,OAAO,CAAC,YAAY,CAAgD;IACpE,OAAO,CAAC,aAAa,CAAgB;IAErC;mCAC+B;IAC/B,OAAO,CAAC,KAAK,CAAuC;gBAGjC,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,0BAGtB;IAYI,IAAI,IAAI,GAAG;IAUlB;;OAEG;IACH,wBAAwB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;IAQhD,uBAAuB,CACrB,GAAG,EAAE,wBAAwB,GAAG,WAAW,EAC3C,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,aAAa,GACjB,SAAS,GAAG,SAAS;IAExB,uBAAuB,CACrB,GAAG,EAAE,wBAAwB,GAAG,WAAW,EAC3C,MAAM,EAAE,aAAa,GACpB,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;IA+BpC,OAAO,CAAC,4BAA4B;IAsBpC,wEAAwE;IAClE,WAAW,CAAC,IAAI,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM;IAMlE;mCAC+B;IACzB,WAAW,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA8BzF,2CAA2C;IACrC,UAAU;IAgBhB,OAAO,CAAC,UAAU;IAgBlB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ResourceId } from '@milaboratories/pl-client';
|
|
2
|
-
import { ArchiveFormat } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { ResourceId } from '@milaboratories/pl-client';
|
|
2
|
+
import type { ArchiveFormat } from '@milaboratories/pl-model-common';
|
|
3
3
|
/** A key in the driver task queue. */
|
|
4
4
|
export type Id = string;
|
|
5
5
|
export declare function newId(id: ResourceId, format: ArchiveFormat): Id;
|
|
6
|
+
//# sourceMappingURL=driver_id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver_id.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_blob_url/driver_id.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,sCAAsC;AACtC,MAAM,MAAM,EAAE,GAAG,MAAM,CAAC;AAExB,wBAAgB,KAAK,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,GAAG,EAAE,CAE/D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComputableCtx } from '@milaboratories/computable';
|
|
2
|
-
import { InferSnapshot, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor } from '@milaboratories/pl-tree';
|
|
1
|
+
import type { ComputableCtx } from '@milaboratories/computable';
|
|
2
|
+
import type { InferSnapshot, PlTreeEntry, PlTreeEntryAccessor, PlTreeNodeAccessor } from '@milaboratories/pl-tree';
|
|
3
3
|
/** We need only resource type for this driver. */
|
|
4
|
-
export declare const DownloadableBlobSnapshot: import(
|
|
4
|
+
export declare const DownloadableBlobSnapshot: import("@milaboratories/pl-tree").ResourceSnapshotSchema<undefined, undefined, undefined>;
|
|
5
5
|
export type DownloadableBlobSnapshot = InferSnapshot<typeof DownloadableBlobSnapshot>;
|
|
6
6
|
export declare function makeDownloadableBlobSnapshot(entryOrAccessor: PlTreeEntry | PlTreeNodeAccessor | PlTreeEntryAccessor, ctx: ComputableCtx): DownloadableBlobSnapshot;
|
|
7
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_blob_url/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGnH,kDAAkD;AAClD,eAAO,MAAM,wBAAwB,2FAAe,CAAC;AACrD,MAAM,MAAM,wBAAwB,GAAG,aAAa,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEtF,wBAAgB,4BAA4B,CAC1C,eAAe,EAAE,WAAW,GAAG,kBAAkB,GAAG,mBAAmB,EACvE,GAAG,EAAE,aAAa,GACjB,wBAAwB,CAQ1B"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { Watcher
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { Watcher } from '@milaboratories/computable';
|
|
2
|
+
import { ChangeSource } from '@milaboratories/computable';
|
|
3
|
+
import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
4
|
+
import { CallersCounter } from '@milaboratories/ts-helpers';
|
|
5
|
+
import type { DownloadableBlobSnapshot } from './snapshot';
|
|
6
|
+
import { type ClientDownload } from '../../clients/download';
|
|
7
|
+
import type { ArchiveFormat, FolderURL } from '@milaboratories/pl-model-common';
|
|
6
8
|
export type URLResult = {
|
|
7
9
|
url?: FolderURL;
|
|
8
10
|
error?: string;
|
|
@@ -61,3 +63,4 @@ type DownloadCtx = {
|
|
|
61
63
|
};
|
|
62
64
|
export declare function nonRecoverableError(e: any): boolean;
|
|
63
65
|
export {};
|
|
66
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_blob_url/task.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,Y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AAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IAK7B,QAAQ;IAsBd,+DAA+D;YACjD,qBAAqB;IAyEnC,MAAM,IAAI,SAAS,GAAG,SAAS;IAQ/B,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,QAAQ;IAIhB,KAAK,CAAC,MAAM,EAAE,MAAM;CAGrB;AAmBD,wBAAwB;AACxB,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,iBAEzC;AAED,oEAAoE;AACpE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAOF,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,GAAG,WAazC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_blob_url/url.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComputableCtx, Watcher
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ComputableCtx, Watcher } from '@milaboratories/computable';
|
|
2
|
+
import { Computable } from '@milaboratories/computable';
|
|
3
|
+
import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
4
|
+
import type { Dispatcher } from 'undici';
|
|
5
|
+
import type { BlockUIURL, FrontendDriver } from '@milaboratories/pl-model-common';
|
|
5
6
|
import { DownloadByUrlTask } from './task';
|
|
6
7
|
export interface DownloadUrlSyncReader {
|
|
7
8
|
/** Returns a Computable that (when the time will come)
|
|
@@ -60,3 +61,4 @@ export declare class DownloadUrlDriver implements DownloadUrlSyncReader, Fronten
|
|
|
60
61
|
private removeTask;
|
|
61
62
|
private getFilePath;
|
|
62
63
|
}
|
|
64
|
+
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_url/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EACP,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIzC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,EAAE,iBAAiB,EAAW,MAAM,QAAQ,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC;;sEAEkE;IAClE,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,SAAS;IACxB;qDACiD;IACjD,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;SAGK;IACL,kBAAkB,EAAE,MAAM,CAAC;IAE3B,mFAAmF;IACnF,UAAU,EAAE,OAAO,CAAC;IAEpB;;SAEK;IACL,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;qCACqC;AACrC,qBAAa,iBAAkB,YAAW,qBAAqB,EAAE,cAAc;IAW3E,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAdvB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAuB;IAEtD,OAAO,CAAC,aAAa,CAA6C;IAClE,OAAO,CAAC,aAAa,CAAgB;IAErC;mCAC+B;IAC/B,OAAO,CAAC,KAAK,CAAgC;gBAG1B,MAAM,EAAE,QAAQ,EACjC,UAAU,EAAE,UAAU,EACL,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,oBAItB;IAOH,2DAA2D;IAC3D,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS;IAE3D,4CAA4C;IAC5C,MAAM,CAAC,GAAG,EAAE,GAAG,GAAG,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;IAwBnD,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IAkBlD,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAQtC,wEAAwE;IAClE,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM;IAM3D;mCAC+B;IACzB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA+B5D,2CAA2C;IACrC,UAAU;IAgBhB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;CAIpB"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Watcher
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { Watcher } from '@milaboratories/computable';
|
|
2
|
+
import { ChangeSource } from '@milaboratories/computable';
|
|
3
|
+
import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
4
|
+
import { CallersCounter } from '@milaboratories/ts-helpers';
|
|
5
|
+
import type { RemoteFileDownloader } from '../../helpers/download';
|
|
6
|
+
import type { UrlResult } from './driver';
|
|
5
7
|
/** Downloads and extracts an archive to a directory. */
|
|
6
8
|
export declare class DownloadByUrlTask {
|
|
7
9
|
private readonly logger;
|
|
@@ -37,3 +39,4 @@ export declare class URLAborted extends Error {
|
|
|
37
39
|
}
|
|
38
40
|
/** Do rm -rf on dir. */
|
|
39
41
|
export declare function rmRFDir(path: string): Promise<void>;
|
|
42
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../../src/drivers/download_url/task.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EACV,QAAQ,EACR,MAAM,EACP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,cAAc,EAKf,MAAM,4BAA4B,CAAC;AAMpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,wDAAwD;AACxD,qBAAa,iBAAiB;IAS1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,GAAG,EAAE,GAAG;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM;IAZ1B,QAAQ,CAAC,OAAO,iBAAwB;IACxC,QAAQ,CAAC,MAAM,eAAsB;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,UAAS;IACb,IAAI,SAAK;gBAGU,MAAM,EAAE,QAAQ,EACxB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM;IAGnB,IAAI;;;;;;;IAUX,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IAK7B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO;YAkB1D,gBAAgB;IAmC9B,MAAM,IAAI,SAAS,GAAG,SAAS;IAU/B,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,QAAQ;IAIhB,KAAK,CAAC,MAAM,EAAE,MAAM;CAGrB;AAED,wCAAwC;AACxC,qBAAa,UAAW,SAAQ,KAAK;IACnC,IAAI,SAAgB;CACrB;AAmBD,wBAAwB;AACxB,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,iBAEzC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** Handle of locally downloaded blob. This handle is issued only after the
|
|
2
|
+
* blob's content is downloaded locally, and ready for quick access. */
|
|
3
|
+
import type { LocalBlobHandle } from '@milaboratories/pl-model-common';
|
|
4
|
+
import type { Signer } from '@milaboratories/ts-helpers';
|
|
3
5
|
export declare function newLocalHandle(path: string, signer: Signer): LocalBlobHandle;
|
|
4
6
|
export declare function isLocalBlobHandle(handle: string): handle is LocalBlobHandle;
|
|
5
7
|
export declare function parseLocalHandle(handle: LocalBlobHandle, signer: Signer): {
|
|
6
8
|
path: string;
|
|
7
9
|
signature: string;
|
|
8
10
|
};
|
|
11
|
+
//# sourceMappingURL=download_local_handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download_local_handle.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/download_local_handle.ts"],"names":[],"mappings":"AAAA;uEACuE;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAKzD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAE5E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,eAAe,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM;;;EAWvE"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
/** Handle of remote blob. This handle is issued as soon as the data becomes
|
|
2
|
+
* available on the remote server. */
|
|
3
|
+
import type { Signer } from '@milaboratories/ts-helpers';
|
|
4
|
+
import type { OnDemandBlobResourceSnapshot } from '../types';
|
|
5
|
+
import type { RemoteBlobHandle } from '@milaboratories/pl-model-common';
|
|
4
6
|
import { ResourceInfo } from '@milaboratories/pl-tree';
|
|
5
7
|
export declare function newRemoteHandle(rInfo: OnDemandBlobResourceSnapshot, signer: Signer): RemoteBlobHandle;
|
|
6
8
|
export declare function isRemoteBlobHandle(handle: string): handle is RemoteBlobHandle;
|
|
@@ -8,3 +10,4 @@ export declare function parseRemoteHandle(handle: RemoteBlobHandle, signer: Sign
|
|
|
8
10
|
info: ResourceInfo;
|
|
9
11
|
size: number;
|
|
10
12
|
};
|
|
13
|
+
//# sourceMappingURL=download_remote_handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download_remote_handle.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/download_remote_handle.ts"],"names":[],"mappings":"AAAA;qCACqC;AAErC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAOvD,wBAAgB,eAAe,CAC7B,KAAK,EAAE,4BAA4B,EACnC,MAAM,EAAE,MAAM,GACb,gBAAgB,CAIlB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,gBAAgB,CAE7E;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,GAAG;IAC3E,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACb,CAiBD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallersCounter } from '@milaboratories/ts-helpers';
|
|
1
|
+
import type { CallersCounter } from '@milaboratories/ts-helpers';
|
|
2
2
|
type PathLike = string;
|
|
3
3
|
export interface CachedFile {
|
|
4
4
|
/** Size in bytes. */
|
|
@@ -26,3 +26,4 @@ export declare class FilesCache<T extends CachedFile> {
|
|
|
26
26
|
removeCache(file: T): void;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
29
|
+
//# sourceMappingURL=files_cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files_cache.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/files_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGjE,KAAK,QAAQ,GAAG,MAAM,CAAC;AAEvB,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;8CAG8C;AAC9C,qBAAa,UAAU,CAAC,CAAC,SAAS,UAAU;IAI9B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAH1C,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,cAAc,CAAa;gBAEN,aAAa,EAAE,MAAM;IAElD,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAInC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IASxD;yDACqD;IACrD,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC,EAAE;IAKjD,4EAA4E;IAC5E,QAAQ,IAAI,CAAC,EAAE;IAqBf,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM;IAclC,WAAW,CAAC,IAAI,EAAE,CAAC;CAIpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/helpers.ts"],"names":[],"mappings":"AASA,uEAAuE;AACvE,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,IAAI,SAA4B;CACjC;AAED;gEACgE;AAChE,qBAAa,OAAO;IAGN,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAFrC,OAAO,CAAC,QAAQ,CAA4B;gBAEf,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC;IAE1D,QAAQ;CAaT"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** Handle of logs. This handle should be passed
|
|
2
|
+
* to the driver for retrieving logs. */
|
|
3
|
+
import type { ResourceInfo } from '@milaboratories/pl-tree';
|
|
2
4
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
3
5
|
export declare function newLogHandle(live: boolean, rInfo: ResourceInfo): sdk.AnyLogHandle;
|
|
4
6
|
/** Handle of the live logs of a program.
|
|
@@ -10,3 +12,4 @@ export declare function isLiveLogHandle(handle: string): handle is sdk.LiveLogHa
|
|
|
10
12
|
export declare const readyHandleRegex: RegExp;
|
|
11
13
|
export declare function isReadyLogHandle(handle: string): handle is sdk.ReadyLogHandle;
|
|
12
14
|
export declare function getResourceInfoFromLogHandle(handle: sdk.AnyLogHandle): ResourceInfo;
|
|
15
|
+
//# sourceMappingURL=logs_handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs_handle.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/logs_handle.ts"],"names":[],"mappings":"AAAA;wCACwC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAG5D,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,GAAG,GAAG,CAAC,YAAY,CAMjF;AAED;;kDAEkD;AAElD,eAAO,MAAM,eAAe,QAC6D,CAAC;AAE1F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC,aAAa,CAE3E;AAED,6CAA6C;AAE7C,eAAO,MAAM,gBAAgB,QAC6D,CAAC;AAE3F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,GAAG,CAAC,cAAc,CAE7E;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,GAAG,CAAC,YAAY,GAAG,YAAY,CAgBnF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Signer } from '@milaboratories/ts-helpers';
|
|
2
|
-
import { ImportFileHandleIndexData, ImportFileHandleUploadData } from '../types';
|
|
3
1
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
2
|
+
import type { Signer } from '@milaboratories/ts-helpers';
|
|
3
|
+
import { ImportFileHandleIndexData, ImportFileHandleUploadData } from '../types';
|
|
4
4
|
export declare function createIndexImportHandle(storageName: string, path: string): sdk.ImportFileHandleIndex;
|
|
5
5
|
export declare function createUploadImportHandle(localPath: string, signer: Signer, sizeBytes: bigint, modificationTimeSeconds: bigint): sdk.ImportFileHandleUpload;
|
|
6
6
|
export declare function parseUploadHandle(handle: sdk.ImportFileHandleUpload): ImportFileHandleUploadData;
|
|
7
7
|
export declare function parseIndexHandle(handle: sdk.ImportFileHandleIndex): ImportFileHandleIndexData;
|
|
8
|
+
//# sourceMappingURL=ls_remote_import_handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls_remote_import_handle.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/ls_remote_import_handle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAEjF,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,qBAAqB,CAO3B;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,uBAAuB,EAAE,MAAM,GAC9B,GAAG,CAAC,sBAAsB,CAS5B;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,sBAAsB,GAAG,0BAA0B,CAKhG;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,qBAAqB,GAAG,yBAAyB,CAG7F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResourceId, ResourceType } from '@milaboratories/pl-client';
|
|
2
1
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
2
|
+
import type { ResourceId, ResourceType } from '@milaboratories/pl-client';
|
|
3
3
|
export type StorageHandleData = RemoteStorageHandleData | LocalStorageHandleData;
|
|
4
4
|
/**
|
|
5
5
|
* Gets a storage handle and gives an underlying data from it.
|
|
@@ -20,3 +20,4 @@ export type RemoteStorageHandleData = {
|
|
|
20
20
|
};
|
|
21
21
|
export declare function isRemoteStorageHandle(handle: sdk.StorageHandle): handle is sdk.StorageHandleRemote;
|
|
22
22
|
export declare function createRemoteStorageHandle(name: string, rId: ResourceId): sdk.StorageHandleRemote;
|
|
23
|
+
//# sourceMappingURL=ls_storage_entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls_storage_entry.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/ls_storage_entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI1E,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC;AAEjF;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,GAAG,iBAAiB,CAQ/E;AAMD,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,KAAK,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,GAAG,MAAM,IAAI,GAAG,CAAC,kBAAkB,CAEhG;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,kBAAkB,CAE3F;AAmBD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,UAAU,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAIF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,GAAG,CAAC,aAAa,GACxB,MAAM,IAAI,GAAG,CAAC,mBAAmB,CAEnC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,GAAG,CAAC,mBAAmB,CAEhG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polling_ops.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/polling_ops.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,MAAM,UAAU,GAAG;IACvB,6EAA6E;IAC7E,eAAe,EAAE,MAAM,CAAC;IACxB,uFAAuF;IACvF,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RangeBytes } from '@milaboratories/pl-model-common';
|
|
1
|
+
import type { RangeBytes } from '@milaboratories/pl-model-common';
|
|
2
2
|
/**
|
|
3
3
|
* Reads file content with concurrency limiting and proper error handling.
|
|
4
4
|
* Ensures file descriptors are properly cleaned up even in error cases.
|
|
5
5
|
*/
|
|
6
6
|
export declare function readFileContent(path: string, range?: RangeBytes): Promise<Uint8Array>;
|
|
7
|
+
//# sourceMappingURL=read_file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read_file.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/read_file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAOlE;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAmB3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test_helpers.d.ts","sourceRoot":"","sources":["../../../src/drivers/helpers/test_helpers.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,KAEzB,CAAC"}
|
package/dist/drivers/logs.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ComputableCtx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DownloadDriver } from './download_blob/download_blob';
|
|
1
|
+
import type { ComputableCtx } from '@milaboratories/computable';
|
|
2
|
+
import { Computable } from '@milaboratories/computable';
|
|
3
|
+
import type { PlTreeEntry, ResourceInfo } from '@milaboratories/pl-tree';
|
|
4
|
+
import type { LogsStreamDriver } from './logs_stream';
|
|
6
5
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
6
|
+
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
7
|
+
import type { DownloadDriver } from './download_blob/download_blob';
|
|
7
8
|
export declare class LogsDriver implements sdk.LogsDriver {
|
|
8
9
|
private readonly logger;
|
|
9
10
|
private readonly logsStreamDriver;
|
|
@@ -30,3 +31,4 @@ export declare class LogsDriver implements sdk.LogsDriver {
|
|
|
30
31
|
lastLines(handle: sdk.AnyLogHandle, lineCount: number, offsetBytes?: number, searchStr?: string): Promise<sdk.StreamingApiResponse>;
|
|
31
32
|
readText(handle: sdk.AnyLogHandle, lineCount: number, offsetBytes?: number, searchStr?: string): Promise<sdk.StreamingApiResponse>;
|
|
32
33
|
}
|
|
34
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/drivers/logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGpE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ACxB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAM9B,QAAQ,CACZ,MAAM,EAAE,GAAG,CAAC,YAAY,EACxB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;CAKrC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ComputableCtx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { ComputableCtx } from '@milaboratories/computable';
|
|
2
|
+
import { Computable } from '@milaboratories/computable';
|
|
3
|
+
import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
4
|
+
import type { ClientLogs } from '../clients/logs';
|
|
5
|
+
import type { PlTreeEntry, ResourceInfo } from '@milaboratories/pl-tree';
|
|
6
6
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
7
|
+
import type { PollingOps } from './helpers/polling_ops';
|
|
7
8
|
export type LogsStreamDriverOps = PollingOps & {
|
|
8
9
|
/** Max number of concurrent requests to log streaming backend while calculating computable states */
|
|
9
10
|
nConcurrentGetLogs: number;
|
|
@@ -49,3 +50,4 @@ export declare class LogsStreamDriver implements sdk.LogsDriver {
|
|
|
49
50
|
private mainLoop;
|
|
50
51
|
private getAllLogs;
|
|
51
52
|
}
|
|
53
|
+
//# sourceMappingURL=logs_stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs_stream.d.ts","sourceRoot":"","sources":["../../src/drivers/logs_stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,UAAU,EAEX,MAAM,4BAA4B,CAAC;AAQpC,OAAO,KAAK,EA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AG,EAAE,YAAY,GAAG,WAAW,EAC/B,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,aAAa,GACjB,MAAM,GAAG,SAAS;IAsBrB,OAAO,CAAC,mBAAmB;IAwB3B,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC;IAC3E,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,GAAG,CAAC,YAAY;IAkBnF,OAAO,CAAC,iBAAiB;IAMnB,SAAS,CACb,MAAM,EAAE,GAAG,CAAC,YAAY,EACxB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS;IAY1B,QAAQ,CACZ,MAAM,EAAE,GAAG,CAAC,YAAY,EACxB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS;YAYlB,eAAe;YAyBf,eAAe;YAKf,kBAAkB;IAK1B,UAAU;IAEhB,OAAO,CAAC,oBAAoB,CAA0B;IAEtD,OAAO,CAAC,mBAAmB;IAI3B,2BAA2B;IAC3B,OAAO,CAAC,aAAa;IAKrB,2BAA2B;IAC3B,OAAO,CAAC,YAAY;IAIpB,yDAAyD;IACzD,OAAO,CAAC,WAAW,CAAS;IAC5B,iCAAiC;IACjC,OAAO,CAAC,WAAW,CAAwC;YAE7C,QAAQ;IAyBtB,OAAO,CAAC,UAAU;CAKnB"}
|
package/dist/drivers/ls.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var plClient = require('@milaboratories/pl-client');
|
|
4
4
|
var plModelCommon = require('@milaboratories/pl-model-common');
|
|
5
|
-
var path = require('node:path');
|
|
6
5
|
var fsp = require('node:fs/promises');
|
|
6
|
+
var path = require('node:path');
|
|
7
|
+
var constructors = require('../clients/constructors.cjs');
|
|
8
|
+
var validate = require('../helpers/validate.cjs');
|
|
7
9
|
var ls_remote_import_handle = require('./helpers/ls_remote_import_handle.cjs');
|
|
8
10
|
var ls_storage_entry = require('./helpers/ls_storage_entry.cjs');
|
|
9
|
-
var validate = require('../helpers/validate.cjs');
|
|
10
11
|
var virtual_storages = require('./virtual_storages.cjs');
|
|
11
|
-
var constructors = require('../clients/constructors.cjs');
|
|
12
12
|
|
|
13
13
|
function _interopNamespaceDefault(e) {
|
|
14
14
|
var n = Object.create(null);
|
|
@@ -27,8 +27,8 @@ function _interopNamespaceDefault(e) {
|
|
|
27
27
|
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
31
30
|
var fsp__namespace = /*#__PURE__*/_interopNamespaceDefault(fsp);
|
|
31
|
+
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
32
32
|
|
|
33
33
|
class LsDriver {
|
|
34
34
|
logger;
|
|
@@ -55,8 +55,17 @@ class LsDriver {
|
|
|
55
55
|
}
|
|
56
56
|
async getLocalFileContent(file, range) {
|
|
57
57
|
const localPath = await this.tryResolveLocalFileHandle(file);
|
|
58
|
-
if (range)
|
|
59
|
-
|
|
58
|
+
if (range) {
|
|
59
|
+
const fileHandle = await fsp__namespace.open(localPath, 'r');
|
|
60
|
+
try {
|
|
61
|
+
const buffer = Buffer.alloc(range.length);
|
|
62
|
+
const { bytesRead } = await fileHandle.read(buffer, 0, range.length, range.offset);
|
|
63
|
+
return new Uint8Array(buffer.subarray(0, bytesRead));
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
await fileHandle.close();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
60
69
|
return await fsp__namespace.readFile(localPath);
|
|
61
70
|
}
|
|
62
71
|
async getLocalFileSize(file) {
|
package/dist/drivers/ls.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ls.cjs","sources":["../../src/drivers/ls.ts"],"sourcesContent":["import type { PlClient, ResourceData, ResourceId } from '@milaboratories/pl-client';\nimport { isNotNullResourceId } from '@milaboratories/pl-client';\nimport type { MiLogger, Signer } from '@milaboratories/ts-helpers';\nimport type * as sdk from '@milaboratories/pl-model-common';\nimport type {\n LocalImportFileHandle,\n LsEntry,\n OpenDialogOps,\n OpenMultipleFilesResponse,\n OpenSingleFileResponse,\n TableRange,\n} from '@milaboratories/pl-model-common';\nimport {\n isImportFileHandleIndex,\n} from '@milaboratories/pl-model-common';\nimport type { ClientLs } from '../clients/ls_api';\nimport * as path from 'node:path';\nimport * as fsp from 'node:fs/promises';\nimport {\n createIndexImportHandle,\n createUploadImportHandle,\n parseIndexHandle,\n parseUploadHandle,\n} from './helpers/ls_remote_import_handle';\nimport {\n createLocalStorageHandle,\n createRemoteStorageHandle,\n parseStorageHandle,\n} from './helpers/ls_storage_entry';\nimport type { LocalStorageProjection, VirtualLocalStorageSpec } from './types';\nimport { validateAbsolute } from '../helpers/validate';\nimport { DefaultVirtualLocalStorages } from './virtual_storages';\nimport { createLsFilesClient } from '../clients/constructors';\n\n/**\n * Extends public and safe SDK's driver API with methods used internally in the middle\n * layer and in tests.\n */\nexport interface InternalLsDriver extends sdk.LsDriver {\n /**\n * Given local path, generates well-structured and signed upload handle.\n * To be used in tests and in implementation of the native file selection UI API.\n * */\n getLocalFileHandle(localPath: string): Promise<sdk.LocalImportFileHandle>;\n\n listRemoteFilesWithAdditionalInfo(storage: sdk.StorageHandle, fullPath: string): Promise<ListRemoteFilesResultWithAdditionalInfo>;\n}\n\nexport type ListRemoteFilesResultWithAdditionalInfo = {\n parent?: string;\n entries: LsEntryWithAdditionalInfo[];\n};\n\nexport type LsEntryWithAdditionalInfo = LsEntry & {\n size: number;\n};\n\nexport type OpenFileDialogCallback = (\n multipleFiles: boolean,\n ops?: OpenDialogOps\n) => Promise<undefined | string[]>;\n\nexport class LsDriver implements InternalLsDriver {\n private constructor(\n private readonly logger: MiLogger,\n private readonly lsClient: ClientLs,\n /** Pl storage id, to resource id. The resource id can be used to make LS GRPC calls to. */\n private readonly storageIdToResourceId: Record<string, ResourceId>,\n private readonly signer: Signer,\n /** Virtual storages by name */\n private readonly virtualStoragesMap: Map<string, VirtualLocalStorageSpec>,\n /** Local projections by storageId */\n private readonly localProjectionsMap: Map<string, LocalStorageProjection>,\n private readonly openFileDialogCallback: OpenFileDialogCallback,\n ) {}\n\n public async getLocalFileContent(\n file: LocalImportFileHandle,\n range?: TableRange,\n ): Promise<Uint8Array> {\n const localPath = await this.tryResolveLocalFileHandle(file);\n if (range) throw new Error('Range request not yet supported.');\n return await fsp.readFile(localPath);\n }\n\n public async getLocalFileSize(file: LocalImportFileHandle): Promise<number> {\n const localPath = await this.tryResolveLocalFileHandle(file);\n const stat = await fsp.stat(localPath);\n return stat.size;\n }\n\n public async showOpenMultipleFilesDialog(\n ops?: OpenDialogOps,\n ): Promise<OpenMultipleFilesResponse> {\n const result = await this.openFileDialogCallback(true, ops);\n if (result === undefined) return {};\n return {\n files: await Promise.all(result.map((localPath) => this.getLocalFileHandle(localPath))),\n };\n }\n\n public async showOpenSingleFileDialog(ops?: OpenDialogOps): Promise<OpenSingleFileResponse> {\n const result = await this.openFileDialogCallback(false, ops);\n if (result === undefined) return {};\n return {\n file: await this.getLocalFileHandle(result[0]),\n };\n }\n\n /**\n * Resolves local handle to local file path.\n *\n * @param handle handle to be resolved\n * @private\n */\n private async tryResolveLocalFileHandle(handle: LocalImportFileHandle): Promise<string> {\n if (isImportFileHandleIndex(handle)) {\n const handleData = parseIndexHandle(handle);\n const localProjection = this.localProjectionsMap.get(handleData.storageId);\n if (!localProjection)\n throw new Error(`Storage ${handleData.storageId} is not mounted locally.`);\n return path.join(localProjection.localPath, handleData.path);\n } else {\n const handleData = parseUploadHandle(handle);\n // checking it is a valid local handle from out machine\n this.signer.verify(\n handleData.localPath,\n handleData.pathSignature,\n 'Failed to validate local file handle signature.',\n );\n\n const localPath = handleData.localPath;\n\n const stat = await fsp.stat(localPath, { bigint: true });\n if (String(stat.mtimeMs / 1000n) !== handleData.modificationTime)\n throw new Error('File has changed since the handle was created.');\n\n return localPath;\n }\n }\n\n public async getLocalFileHandle(\n localPath: string,\n ): Promise<sdk.ImportFileHandle & LocalImportFileHandle> {\n validateAbsolute(localPath);\n\n // Checking if local path is directly reachable by pl, because it is in one of the\n // locally mounted storages\n for (const lp of this.localProjectionsMap.values()) {\n // note: empty lp.localPath will match any address\n if (localPath.startsWith(lp.localPath)) {\n // Just in case:\n // > path.relative(\"/a/b\", \"/a/b/c\");\n // 'c'\n const pathWithinStorage\n = lp.localPath === '' ? localPath : path.relative(lp.localPath, localPath);\n return createIndexImportHandle(\n lp.storageId,\n pathWithinStorage,\n ) as sdk.ImportFileHandleIndex & LocalImportFileHandle;\n }\n }\n\n // we get here if none of the local projections matched the path\n\n const stat = await fsp.stat(localPath, { bigint: true });\n return createUploadImportHandle(\n localPath,\n this.signer,\n stat.size,\n stat.mtimeMs / 1000n, // integer division\n ) as sdk.ImportFileHandleUpload & LocalImportFileHandle;\n }\n\n public async getStorageList(): Promise<sdk.StorageEntry[]> {\n const virtualStorages = [...this.virtualStoragesMap.values()].map((s) => ({\n name: s.name,\n handle: createLocalStorageHandle(s.name, s.root),\n initialFullPath: s.initialPath,\n }));\n\n const otherStorages = Object.entries(this.storageIdToResourceId!).map(\n ([storageId, resourceId]) => ({\n name: storageId,\n handle: createRemoteStorageHandle(storageId, resourceId),\n initialFullPath: '', // we don't have any additional information from where to start browsing remote storages\n isInitialPathHome: false,\n }),\n );\n\n // root must be a storage so we can index any file,\n // but for UI it's enough\n // to have local virtual storage on *nix,\n // and local_disk_${drive} on Windows.\n const noRoot = otherStorages.filter((it) => it.name !== 'root');\n\n return [...virtualStorages, ...noRoot];\n }\n\n public async listFiles(\n storageHandle: sdk.StorageHandle,\n fullPath: string,\n ): Promise<sdk.ListFilesResult> {\n const storageData = parseStorageHandle(storageHandle);\n\n if (storageData.isRemote) {\n const response = await this.lsClient.list(storageData, fullPath);\n return {\n entries: response.items.map((e) => ({\n type: e.isDir ? 'dir' : 'file',\n name: e.name,\n fullPath: e.fullName,\n handle: createIndexImportHandle(storageData.name, e.fullName),\n })),\n };\n }\n\n if (path.sep === '/' && fullPath === '') fullPath = '/';\n\n if (storageData.rootPath === '') {\n validateAbsolute(fullPath);\n }\n const lsRoot = path.isAbsolute(fullPath) ? fullPath : path.join(storageData.rootPath, fullPath);\n\n const entries: LsEntry[] = [];\n for await (const dirent of await fsp.opendir(lsRoot)) {\n if (!dirent.isFile() && !dirent.isDirectory()) continue;\n\n // We cannot use no dirent.fullPath no dirent.parentPath,\n // since the former is deprecated\n // and the later works differently on different versions.\n const absolutePath = path.join(lsRoot, dirent.name);\n\n entries.push({\n type: dirent.isFile() ? 'file' : 'dir',\n name: dirent.name,\n fullPath: absolutePath,\n handle: await this.getLocalFileHandle(absolutePath),\n });\n }\n\n return { entries };\n }\n\n public async listRemoteFilesWithAdditionalInfo(\n storageHandle: sdk.StorageHandle,\n fullPath: string,\n ): Promise<ListRemoteFilesResultWithAdditionalInfo> {\n const storageData = parseStorageHandle(storageHandle);\n if (!storageData.isRemote) {\n throw new Error(`Storage ${storageData.name} is not remote`);\n }\n\n const response = await this.lsClient.list(storageData, fullPath);\n\n return {\n entries: response.items.map((e) => ({\n type: e.isDir ? 'dir' : 'file',\n name: e.name,\n fullPath: e.fullName,\n handle: createIndexImportHandle(storageData.name, e.fullName),\n size: Number(e.size),\n })),\n };\n }\n\n public async fileToImportHandle(file: sdk.FileLike): Promise<sdk.ImportFileHandle> {\n throw new Error(\n 'Not implemented. This method must be implemented and intercepted in desktop preload script.',\n );\n }\n\n public static async init(\n logger: MiLogger,\n client: PlClient,\n signer: Signer,\n /** Pl storages available locally */\n localProjections: LocalStorageProjection[],\n openFileDialogCallback: OpenFileDialogCallback,\n virtualStorages?: VirtualLocalStorageSpec[],\n ): Promise<LsDriver> {\n const lsClient = createLsFilesClient(client, logger);\n\n if (!virtualStorages) virtualStorages = await DefaultVirtualLocalStorages();\n\n // validating inputs\n for (const vp of virtualStorages) validateAbsolute(vp.root);\n for (const lp of localProjections) if (lp.localPath !== '') validateAbsolute(lp.localPath);\n\n // creating indexed maps for quick access\n const virtualStoragesMap = new Map(virtualStorages.map((s) => [s.name, s]));\n const localProjectionsMap = new Map(localProjections.map((s) => [s.storageId, s]));\n\n // validating there is no intersection\n if (\n new Set([...virtualStoragesMap.keys(), ...localProjectionsMap.keys()]).size\n !== virtualStoragesMap.size + localProjectionsMap.size\n )\n throw new Error(\n 'Intersection between local projection storage ids and virtual storages names detected.',\n );\n\n return new LsDriver(\n logger,\n lsClient,\n await doGetAvailableStorageIds(client),\n signer,\n virtualStoragesMap,\n localProjectionsMap,\n openFileDialogCallback,\n );\n }\n}\n\nasync function doGetAvailableStorageIds(client: PlClient): Promise<Record<string, ResourceId>> {\n return client.withReadTx('GetAvailableStorageIds', async (tx) => {\n const lsProviderId = await tx.getResourceByName('LSProvider');\n const provider = await tx.getResourceData(lsProviderId, true);\n\n return providerToStorageIds(provider);\n });\n}\n\nfunction providerToStorageIds(provider: ResourceData) {\n return Object.fromEntries(\n provider.fields\n .filter((f) => f.type == 'Dynamic' && isNotNullResourceId(f.value))\n .map((f) => [f.name.substring('storage/'.length), f.value as ResourceId]),\n );\n}\n"],"names":["fsp","isImportFileHandleIndex","parseIndexHandle","path","parseUploadHandle","validateAbsolute","createIndexImportHandle","createUploadImportHandle","createLocalStorageHandle","createRemoteStorageHandle","parseStorageHandle","createLsFilesClient","DefaultVirtualLocalStorages","isNotNullResourceId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Da,QAAQ,CAAA;AAEA,IAAA,MAAA;AACA,IAAA,QAAA;AAEA,IAAA,qBAAA;AACA,IAAA,MAAA;AAEA,IAAA,kBAAA;AAEA,IAAA,mBAAA;AACA,IAAA,sBAAA;IAVnB,WAAA,CACmB,MAAgB,EAChB,QA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MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF;QAEH,OAAO,IAAI,QAAQ,CACjB,MAAM,EACN,QAAQ,EACR,MAAM,wBAAwB,CAAC,MAAM,CAAC,EACtC,MAAM,EACN,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,CACvB;IACH;AACD;AAED,eAAe,wBAAwB,CAAC,MAAgB,EAAA;IACtD,OAAO,MAAM,CAAC,UAAU,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAI;QAC9D,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,iBAAiB,CAAC,YAAY,CAAC;QAC7D,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC;AAE7D,QAAA,OAAO,oBAAoB,CAAC,QAAQ,CAAC;AACvC,IAAA,CAAC,CAAC;AACJ;AAEA,SAAS,oBAAoB,CAAC,QAAsB,EAAA;AAClD,IAAA,OAAO,MAAM,CAAC,WAAW,CACvB,QAAQ,CAAC;AACN,SAAA,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,SAAS,IAAIQ,4BAAmB,CAAC,CAAC,CAAC,KAAK,CAAC;SACjE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,KAAmB,CAAC,CAAC,CAC5E;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"ls.cjs","sources":["../../src/drivers/ls.ts"],"sourcesContent":["import type { PlClient, ResourceData, ResourceId } from '@milaboratories/pl-client';\nimport { isNotNullResourceId } from '@milaboratories/pl-client';\nimport type * as sdk from '@milaboratories/pl-model-common';\nimport type {\n LocalImportFileHandle,\n LsEntry,\n OpenDialogOps,\n OpenMultipleFilesResponse,\n OpenSingleFileResponse,\n TableRange,\n} from '@milaboratories/pl-model-common';\nimport {\n isImportFileHandleIndex,\n} from '@milaboratories/pl-model-common';\nimport type { MiLogger, Signer } from '@milaboratories/ts-helpers';\nimport * as fsp from 'node:fs/promises';\nimport * as path from 'node:path';\nimport { createLsFilesClient } from '../clients/constructors';\nimport type { ClientLs } from '../clients/ls_api';\nimport { validateAbsolute } from '../helpers/validate';\nimport {\n createIndexImportHandle,\n createUploadImportHandle,\n parseIndexHandle,\n parseUploadHandle,\n} from './helpers/ls_remote_import_handle';\nimport {\n createLocalStorageHandle,\n createRemoteStorageHandle,\n parseStorageHandle,\n} from './helpers/ls_storage_entry';\nimport type { LocalStorageProjection, VirtualLocalStorageSpec } from './types';\nimport { DefaultVirtualLocalStorages } from './virtual_storages';\n\n/**\n * Extends public and safe SDK's driver API with methods used internally in the middle\n * layer and in tests.\n */\nexport interface InternalLsDriver extends sdk.LsDriver {\n /**\n * Given local path, generates well-structured and signed upload handle.\n * To be used in tests and in implementation of the native file selection UI API.\n * */\n getLocalFileHandle(localPath: string): Promise<sdk.LocalImportFileHandle>;\n\n listRemoteFilesWithAdditionalInfo(storage: sdk.StorageHandle, fullPath: string): Promise<ListRemoteFilesResultWithAdditionalInfo>;\n}\n\nexport type ListRemoteFilesResultWithAdditionalInfo = {\n parent?: string;\n entries: LsEntryWithAdditionalInfo[];\n};\n\nexport type LsEntryWithAdditionalInfo = LsEntry & {\n size: number;\n};\n\nexport type OpenFileDialogCallback = (\n multipleFiles: boolean,\n ops?: OpenDialogOps\n) => Promise<undefined | string[]>;\n\nexport class LsDriver implements InternalLsDriver {\n private constructor(\n private readonly logger: MiLogger,\n private readonly lsClient: ClientLs,\n /** Pl storage id, to resource id. The resource id can be used to make LS GRPC calls to. */\n private readonly storageIdToResourceId: Record<string, ResourceId>,\n private readonly signer: Signer,\n /** Virtual storages by name */\n private readonly virtualStoragesMap: Map<string, VirtualLocalStorageSpec>,\n /** Local projections by storageId */\n private readonly localProjectionsMap: Map<string, LocalStorageProjection>,\n private readonly openFileDialogCallback: OpenFileDialogCallback,\n ) {}\n\n public async getLocalFileContent(\n file: LocalImportFileHandle,\n range?: TableRange,\n ): Promise<Uint8Array> {\n const localPath = await this.tryResolveLocalFileHandle(file);\n\n if (range) {\n const fileHandle = await fsp.open(localPath, 'r');\n try {\n const buffer = Buffer.alloc(range.length);\n const { bytesRead } = await fileHandle.read(buffer, 0, range.length, range.offset);\n return new Uint8Array(buffer.subarray(0, bytesRead));\n } finally {\n await fileHandle.close();\n }\n }\n\n return await fsp.readFile(localPath);\n }\n\n public async getLocalFileSize(file: LocalImportFileHandle): Promise<number> {\n const localPath = await this.tryResolveLocalFileHandle(file);\n const stat = await fsp.stat(localPath);\n return stat.size;\n }\n\n public async showOpenMultipleFilesDialog(\n ops?: OpenDialogOps,\n ): Promise<OpenMultipleFilesResponse> {\n const result = await this.openFileDialogCallback(true, ops);\n if (result === undefined) return {};\n return {\n files: await Promise.all(result.map((localPath) => this.getLocalFileHandle(localPath))),\n };\n }\n\n public async showOpenSingleFileDialog(ops?: OpenDialogOps): Promise<OpenSingleFileResponse> {\n const result = await this.openFileDialogCallback(false, ops);\n if (result === undefined) return {};\n return {\n file: await this.getLocalFileHandle(result[0]),\n };\n }\n\n /**\n * Resolves local handle to local file path.\n *\n * @param handle handle to be resolved\n * @private\n */\n private async tryResolveLocalFileHandle(handle: LocalImportFileHandle): Promise<string> {\n if (isImportFileHandleIndex(handle)) {\n const handleData = parseIndexHandle(handle);\n const localProjection = this.localProjectionsMap.get(handleData.storageId);\n if (!localProjection)\n throw new Error(`Storage ${handleData.storageId} is not mounted locally.`);\n return path.join(localProjection.localPath, handleData.path);\n } else {\n const handleData = parseUploadHandle(handle);\n // checking it is a valid local handle from out machine\n this.signer.verify(\n handleData.localPath,\n handleData.pathSignature,\n 'Failed to validate local file handle signature.',\n );\n\n const localPath = handleData.localPath;\n\n const stat = await fsp.stat(localPath, { bigint: true });\n if (String(stat.mtimeMs / 1000n) !== handleData.modificationTime)\n throw new Error('File has changed since the handle was created.');\n\n return localPath;\n }\n }\n\n public async getLocalFileHandle(\n localPath: string,\n ): Promise<sdk.ImportFileHandle & LocalImportFileHandle> {\n validateAbsolute(localPath);\n\n // Checking if local path is directly reachable by pl, because it is in one of the\n // locally mounted storages\n for (const lp of this.localProjectionsMap.values()) {\n // note: empty lp.localPath will match any address\n if (localPath.startsWith(lp.localPath)) {\n // Just in case:\n // > path.relative(\"/a/b\", \"/a/b/c\");\n // 'c'\n const pathWithinStorage\n = lp.localPath === '' ? localPath : path.relative(lp.localPath, localPath);\n return createIndexImportHandle(\n lp.storageId,\n pathWithinStorage,\n ) as sdk.ImportFileHandleIndex & LocalImportFileHandle;\n }\n }\n\n // we get here if none of the local projections matched the path\n\n const stat = await fsp.stat(localPath, { bigint: true });\n return createUploadImportHandle(\n localPath,\n this.signer,\n stat.size,\n stat.mtimeMs / 1000n, // integer division\n ) as sdk.ImportFileHandleUpload & LocalImportFileHandle;\n }\n\n public async getStorageList(): Promise<sdk.StorageEntry[]> {\n const virtualStorages = [...this.virtualStoragesMap.values()].map((s) => ({\n name: s.name,\n handle: createLocalStorageHandle(s.name, s.root),\n initialFullPath: s.initialPath,\n }));\n\n const otherStorages = Object.entries(this.storageIdToResourceId!).map(\n ([storageId, resourceId]) => ({\n name: storageId,\n handle: createRemoteStorageHandle(storageId, resourceId),\n initialFullPath: '', // we don't have any additional information from where to start browsing remote storages\n isInitialPathHome: false,\n }),\n );\n\n // root must be a storage so we can index any file,\n // but for UI it's enough\n // to have local virtual storage on *nix,\n // and local_disk_${drive} on Windows.\n const noRoot = otherStorages.filter((it) => it.name !== 'root');\n\n return [...virtualStorages, ...noRoot];\n }\n\n public async listFiles(\n storageHandle: sdk.StorageHandle,\n fullPath: string,\n ): Promise<sdk.ListFilesResult> {\n const storageData = parseStorageHandle(storageHandle);\n\n if (storageData.isRemote) {\n const response = await this.lsClient.list(storageData, fullPath);\n return {\n entries: response.items.map((e) => ({\n type: e.isDir ? 'dir' : 'file',\n name: e.name,\n fullPath: e.fullName,\n handle: createIndexImportHandle(storageData.name, e.fullName),\n })),\n };\n }\n\n if (path.sep === '/' && fullPath === '') fullPath = '/';\n\n if (storageData.rootPath === '') {\n validateAbsolute(fullPath);\n }\n const lsRoot = path.isAbsolute(fullPath) ? fullPath : path.join(storageData.rootPath, fullPath);\n\n const entries: LsEntry[] = [];\n for await (const dirent of await fsp.opendir(lsRoot)) {\n if (!dirent.isFile() && !dirent.isDirectory()) continue;\n\n // We cannot use no dirent.fullPath no dirent.parentPath,\n // since the former is deprecated\n // and the later works differently on different versions.\n const absolutePath = path.join(lsRoot, dirent.name);\n\n entries.push({\n type: dirent.isFile() ? 'file' : 'dir',\n name: dirent.name,\n fullPath: absolutePath,\n handle: await this.getLocalFileHandle(absolutePath),\n });\n }\n\n return { entries };\n }\n\n public async listRemoteFilesWithAdditionalInfo(\n storageHandle: sdk.StorageHandle,\n fullPath: string,\n ): Promise<ListRemoteFilesResultWithAdditionalInfo> {\n const storageData = parseStorageHandle(storageHandle);\n if (!storageData.isRemote) {\n throw new Error(`Storage ${storageData.name} is not remote`);\n }\n\n const response = await this.lsClient.list(storageData, fullPath);\n\n return {\n entries: response.items.map((e) => ({\n type: e.isDir ? 'dir' : 'file',\n name: e.name,\n fullPath: e.fullName,\n handle: createIndexImportHandle(storageData.name, e.fullName),\n size: Number(e.size),\n })),\n };\n }\n\n public async fileToImportHandle(file: sdk.FileLike): Promise<sdk.ImportFileHandle> {\n throw new Error(\n 'Not implemented. This method must be implemented and intercepted in desktop preload script.',\n );\n }\n\n public static async init(\n logger: MiLogger,\n client: PlClient,\n signer: Signer,\n /** Pl storages available locally */\n localProjections: LocalStorageProjection[],\n openFileDialogCallback: OpenFileDialogCallback,\n virtualStorages?: VirtualLocalStorageSpec[],\n ): Promise<LsDriver> {\n const lsClient = createLsFilesClient(client, logger);\n\n if (!virtualStorages) virtualStorages = await DefaultVirtualLocalStorages();\n\n // validating inputs\n for (const vp of virtualStorages) validateAbsolute(vp.root);\n for (const lp of localProjections) if (lp.localPath !== '') validateAbsolute(lp.localPath);\n\n // creating indexed maps for quick access\n const virtualStoragesMap = new Map(virtualStorages.map((s) => [s.name, s]));\n const localProjectionsMap = new Map(localProjections.map((s) => [s.storageId, s]));\n\n // validating there is no intersection\n if (\n new Set([...virtualStoragesMap.keys(), ...localProjectionsMap.keys()]).size\n !== virtualStoragesMap.size + localProjectionsMap.size\n )\n throw new Error(\n 'Intersection between local projection storage ids and virtual storages names detected.',\n );\n\n return new LsDriver(\n logger,\n lsClient,\n await doGetAvailableStorageIds(client),\n signer,\n virtualStoragesMap,\n localProjectionsMap,\n openFileDialogCallback,\n );\n }\n}\n\nasync function doGetAvailableStorageIds(client: PlClient): Promise<Record<string, ResourceId>> {\n return client.withReadTx('GetAvailableStorageIds', async (tx) => {\n const lsProviderId = await tx.getResourceByName('LSProvider');\n const provider = await tx.getResourceData(lsProviderId, true);\n\n return providerToStorageIds(provider);\n });\n}\n\nfunction providerToStorageIds(provider: ResourceData) {\n return Object.fromEntries(\n provider.fields\n .filter((f) => f.type == 'Dynamic' && isNotNullResourceId(f.value))\n .map((f) => [f.name.substring('storage/'.length), f.value as ResourceId]),\n );\n}\n"],"names":["fsp","isImportFileHandleIndex","parseIndexHandle","path","parseUploadHandle","validateAbsolute","createIndexImportHandle","createUploadImportHandle","createLocalStorageHandle","createRemoteStorageHandle","parseStorageHandle","createLsFilesClient","DefaultVirtualLocalStorages","isNotNullResourceId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8Da,QAAQ,CAAA;AAEA,IAAA,MAAA;AACA,IAAA,QAAA;AAEA,IAAA,qBAAA;AACA,IAAA,MAAA;AAEA,IAAA,kBAAA;AAEA,IAAA,mBAAA;AACA,IAAA,sBAAA;IAVnB,WAAA,CACmB,MAAgB,EAChB,QAAkB;;AAElB,IAAA,qBAAiD,EACjD,MAAc;;IAEd,kBAAwD;;AAExD,IAAA,mBAAwD,EACxD,sBAA8C,EAAA;QAT9C,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,QAAQ,GAAR,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aboratories/pl-client';
|
|
2
|
-
import { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
3
|
-
import { LocalImportFileHandle, LsEntry, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, TableRange } from '@milaboratories/pl-model-common';
|
|
4
|
-
import { LocalStorageProjection, VirtualLocalStorageSpec } from './types';
|
|
1
|
+
import type { PlClient } from '@milaboratories/pl-client';
|
|
5
2
|
import type * as sdk from '@milaboratories/pl-model-common';
|
|
3
|
+
import type { LocalImportFileHandle, LsEntry, OpenDialogOps, OpenMultipleFilesResponse, OpenSingleFileResponse, TableRange } from '@milaboratories/pl-model-common';
|
|
4
|
+
import type { MiLogger, Signer } from '@milaboratories/ts-helpers';
|
|
5
|
+
import type { LocalStorageProjection, VirtualLocalStorageSpec } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* Extends public and safe SDK's driver API with methods used internally in the middle
|
|
8
8
|
* layer and in tests.
|
|
@@ -55,3 +55,4 @@ export declare class LsDriver implements InternalLsDriver {
|
|
|
55
55
|
/** Pl storages available locally */
|
|
56
56
|
localProjections: LocalStorageProjection[], openFileDialogCallback: OpenFileDialogCallback, virtualStorages?: VirtualLocalStorageSpec[]): Promise<LsDriver>;
|
|
57
57
|
}
|
|
58
|
+
//# sourceMappingURL=ls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../src/drivers/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAA4B,MAAM,2BAA2B,CAAC;AAEpF,OAAO,KAAK,KAAK,GAAG,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EACV,qBAAqB,EACrB,OAAO,EACP,aAAa,EACb,yBAAyB,EACzB,sBAAsB,EACtB,UAAU,EACX,MAAM,iCAAiC,CAAC;AAIzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAiBnE,OAAO,K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