@elaraai/e3-core 0.0.2-beta.9 → 1.0.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/LICENSE.md +4 -0
- package/README.md +74 -35
- package/dist/src/dataflow/api-compat.d.ts +90 -0
- package/dist/src/dataflow/api-compat.d.ts.map +1 -0
- package/dist/src/dataflow/api-compat.js +139 -0
- package/dist/src/dataflow/api-compat.js.map +1 -0
- package/dist/src/dataflow/api-compat.spec.d.ts +6 -0
- package/dist/src/dataflow/api-compat.spec.d.ts.map +1 -0
- package/dist/src/dataflow/api-compat.spec.js +182 -0
- package/dist/src/dataflow/api-compat.spec.js.map +1 -0
- package/dist/src/dataflow/index.d.ts +18 -0
- package/dist/src/dataflow/index.d.ts.map +1 -0
- package/dist/src/dataflow/index.js +23 -0
- package/dist/src/dataflow/index.js.map +1 -0
- package/dist/src/dataflow/orchestrator/LocalOrchestrator.d.ts +76 -0
- package/dist/src/dataflow/orchestrator/LocalOrchestrator.d.ts.map +1 -0
- package/dist/src/dataflow/orchestrator/LocalOrchestrator.js +729 -0
- package/dist/src/dataflow/orchestrator/LocalOrchestrator.js.map +1 -0
- package/dist/src/dataflow/orchestrator/index.d.ts +12 -0
- package/dist/src/dataflow/orchestrator/index.d.ts.map +1 -0
- package/dist/src/dataflow/orchestrator/index.js +12 -0
- package/dist/src/dataflow/orchestrator/index.js.map +1 -0
- package/dist/src/dataflow/orchestrator/interfaces.d.ts +163 -0
- package/dist/src/dataflow/orchestrator/interfaces.d.ts.map +1 -0
- package/dist/src/dataflow/orchestrator/interfaces.js +52 -0
- package/dist/src/dataflow/orchestrator/interfaces.js.map +1 -0
- package/dist/src/dataflow/state-store/FileStateStore.d.ts +67 -0
- package/dist/src/dataflow/state-store/FileStateStore.d.ts.map +1 -0
- package/dist/src/dataflow/state-store/FileStateStore.js +300 -0
- package/dist/src/dataflow/state-store/FileStateStore.js.map +1 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.d.ts +42 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.d.ts.map +1 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.js +229 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.js.map +1 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.spec.d.ts +6 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.spec.d.ts.map +1 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.spec.js +114 -0
- package/dist/src/dataflow/state-store/InMemoryStateStore.spec.js.map +1 -0
- package/dist/src/dataflow/state-store/index.d.ts +13 -0
- package/dist/src/dataflow/state-store/index.d.ts.map +1 -0
- package/dist/src/dataflow/state-store/index.js +13 -0
- package/dist/src/dataflow/state-store/index.js.map +1 -0
- package/dist/src/dataflow/state-store/interfaces.d.ts +159 -0
- package/dist/src/dataflow/state-store/interfaces.d.ts.map +1 -0
- package/dist/src/dataflow/state-store/interfaces.js +6 -0
- package/dist/src/dataflow/state-store/interfaces.js.map +1 -0
- package/dist/src/dataflow/steps.d.ts +222 -0
- package/dist/src/dataflow/steps.d.ts.map +1 -0
- package/dist/src/dataflow/steps.js +707 -0
- package/dist/src/dataflow/steps.js.map +1 -0
- package/dist/src/dataflow/steps.spec.d.ts +6 -0
- package/dist/src/dataflow/steps.spec.d.ts.map +1 -0
- package/dist/src/dataflow/steps.spec.js +343 -0
- package/dist/src/dataflow/steps.spec.js.map +1 -0
- package/dist/src/dataflow/types.d.ts +127 -0
- package/dist/src/dataflow/types.d.ts.map +1 -0
- package/dist/src/dataflow/types.js +7 -0
- package/dist/src/dataflow/types.js.map +1 -0
- package/dist/src/dataflow-orchestration.spec.d.ts +6 -0
- package/dist/src/dataflow-orchestration.spec.d.ts.map +1 -0
- package/dist/src/dataflow-orchestration.spec.js +1025 -0
- package/dist/src/dataflow-orchestration.spec.js.map +1 -0
- package/dist/src/dataflow.d.ts +113 -38
- package/dist/src/dataflow.d.ts.map +1 -1
- package/dist/src/dataflow.js +269 -416
- package/dist/src/dataflow.js.map +1 -1
- package/dist/src/dataflow.spec.d.ts +6 -0
- package/dist/src/dataflow.spec.d.ts.map +1 -0
- package/dist/src/dataflow.spec.js +663 -0
- package/dist/src/dataflow.spec.js.map +1 -0
- package/dist/src/dataset-refs.d.ts +124 -0
- package/dist/src/dataset-refs.d.ts.map +1 -0
- package/dist/src/dataset-refs.js +319 -0
- package/dist/src/dataset-refs.js.map +1 -0
- package/dist/src/errors.d.ts +39 -9
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +51 -8
- package/dist/src/errors.js.map +1 -1
- package/dist/src/errors.spec.d.ts +6 -0
- package/dist/src/errors.spec.d.ts.map +1 -0
- package/dist/src/errors.spec.js +276 -0
- package/dist/src/errors.spec.js.map +1 -0
- package/dist/src/execution/LocalTaskRunner.d.ts +73 -0
- package/dist/src/execution/LocalTaskRunner.d.ts.map +1 -0
- package/dist/src/execution/LocalTaskRunner.js +399 -0
- package/dist/src/execution/LocalTaskRunner.js.map +1 -0
- package/dist/src/execution/MockTaskRunner.d.ts +49 -0
- package/dist/src/execution/MockTaskRunner.d.ts.map +1 -0
- package/dist/src/execution/MockTaskRunner.js +54 -0
- package/dist/src/execution/MockTaskRunner.js.map +1 -0
- package/dist/src/execution/index.d.ts +16 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +8 -0
- package/dist/src/execution/index.js.map +1 -0
- package/dist/src/execution/interfaces.d.ts +246 -0
- package/dist/src/execution/interfaces.d.ts.map +1 -0
- package/dist/src/execution/interfaces.js +6 -0
- package/dist/src/execution/interfaces.js.map +1 -0
- package/dist/src/execution/processHelpers.d.ts +20 -0
- package/dist/src/execution/processHelpers.d.ts.map +1 -0
- package/dist/src/execution/processHelpers.js +62 -0
- package/dist/src/execution/processHelpers.js.map +1 -0
- package/dist/src/executions.d.ts +71 -104
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +113 -481
- package/dist/src/executions.js.map +1 -1
- package/dist/src/executions.spec.d.ts +6 -0
- package/dist/src/executions.spec.d.ts.map +1 -0
- package/dist/src/executions.spec.js +387 -0
- package/dist/src/executions.spec.js.map +1 -0
- package/dist/src/formats.d.ts +18 -2
- package/dist/src/formats.d.ts.map +1 -1
- package/dist/src/formats.js +34 -2
- package/dist/src/formats.js.map +1 -1
- package/dist/src/gc.spec.d.ts +6 -0
- package/dist/src/gc.spec.d.ts.map +1 -0
- package/dist/src/gc.spec.js +512 -0
- package/dist/src/gc.spec.js.map +1 -0
- package/dist/src/index.d.ts +20 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +48 -18
- package/dist/src/index.js.map +1 -1
- package/dist/src/objects.d.ts +7 -53
- package/dist/src/objects.d.ts.map +1 -1
- package/dist/src/objects.js +13 -232
- package/dist/src/objects.js.map +1 -1
- package/dist/src/objects.spec.d.ts +6 -0
- package/dist/src/objects.spec.d.ts.map +1 -0
- package/dist/src/objects.spec.js +247 -0
- package/dist/src/objects.spec.js.map +1 -0
- package/dist/src/packages.d.ts +41 -14
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +151 -89
- package/dist/src/packages.js.map +1 -1
- package/dist/src/packages.spec.d.ts +6 -0
- package/dist/src/packages.spec.d.ts.map +1 -0
- package/dist/src/packages.spec.js +324 -0
- package/dist/src/packages.spec.js.map +1 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts +35 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts.map +1 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.js +107 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.js.map +1 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.spec.d.ts +6 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.spec.d.ts.map +1 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.spec.js +187 -0
- package/dist/src/storage/in-memory/InMemoryRepoStore.spec.js.map +1 -0
- package/dist/src/storage/in-memory/InMemoryStorage.d.ts +139 -0
- package/dist/src/storage/in-memory/InMemoryStorage.d.ts.map +1 -0
- package/dist/src/storage/in-memory/InMemoryStorage.js +439 -0
- package/dist/src/storage/in-memory/InMemoryStorage.js.map +1 -0
- package/dist/src/storage/in-memory/index.d.ts +12 -0
- package/dist/src/storage/in-memory/index.d.ts.map +1 -0
- package/dist/src/storage/in-memory/index.js +12 -0
- package/dist/src/storage/in-memory/index.js.map +1 -0
- package/dist/src/storage/index.d.ts +18 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +10 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +581 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +6 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/local/LocalBackend.d.ts +56 -0
- package/dist/src/storage/local/LocalBackend.d.ts.map +1 -0
- package/dist/src/storage/local/LocalBackend.js +145 -0
- package/dist/src/storage/local/LocalBackend.js.map +1 -0
- package/dist/src/storage/local/LocalDatasetRefStore.d.ts +22 -0
- package/dist/src/storage/local/LocalDatasetRefStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalDatasetRefStore.js +118 -0
- package/dist/src/storage/local/LocalDatasetRefStore.js.map +1 -0
- package/dist/src/storage/local/LocalLockService.d.ts +111 -0
- package/dist/src/storage/local/LocalLockService.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLockService.js +364 -0
- package/dist/src/storage/local/LocalLockService.js.map +1 -0
- package/dist/src/storage/local/LocalLockService.spec.d.ts +6 -0
- package/dist/src/storage/local/LocalLockService.spec.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLockService.spec.js +148 -0
- package/dist/src/storage/local/LocalLockService.spec.js.map +1 -0
- package/dist/src/storage/local/LocalLogStore.d.ts +23 -0
- package/dist/src/storage/local/LocalLogStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLogStore.js +66 -0
- package/dist/src/storage/local/LocalLogStore.js.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts +55 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.js +300 -0
- package/dist/src/storage/local/LocalObjectStore.js.map +1 -0
- package/dist/src/storage/local/LocalRefStore.d.ts +50 -0
- package/dist/src/storage/local/LocalRefStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalRefStore.js +337 -0
- package/dist/src/storage/local/LocalRefStore.js.map +1 -0
- package/dist/src/storage/local/LocalRepoStore.d.ts +55 -0
- package/dist/src/storage/local/LocalRepoStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalRepoStore.js +365 -0
- package/dist/src/storage/local/LocalRepoStore.js.map +1 -0
- package/dist/src/storage/local/LocalRepoStore.spec.d.ts +6 -0
- package/dist/src/storage/local/LocalRepoStore.spec.d.ts.map +1 -0
- package/dist/src/storage/local/LocalRepoStore.spec.js +255 -0
- package/dist/src/storage/local/LocalRepoStore.spec.js.map +1 -0
- package/dist/src/storage/local/gc.d.ts +92 -0
- package/dist/src/storage/local/gc.d.ts.map +1 -0
- package/dist/src/storage/local/gc.js +377 -0
- package/dist/src/storage/local/gc.js.map +1 -0
- package/dist/src/storage/local/index.d.ts +18 -0
- package/dist/src/storage/local/index.d.ts.map +1 -0
- package/dist/src/storage/local/index.js +18 -0
- package/dist/src/storage/local/index.js.map +1 -0
- package/dist/src/storage/local/localHelpers.d.ts +25 -0
- package/dist/src/storage/local/localHelpers.d.ts.map +1 -0
- package/dist/src/storage/local/localHelpers.js +69 -0
- package/dist/src/storage/local/localHelpers.js.map +1 -0
- package/dist/src/{repository.d.ts → storage/local/repository.d.ts} +8 -4
- package/dist/src/storage/local/repository.d.ts.map +1 -0
- package/dist/src/{repository.js → storage/local/repository.js} +31 -29
- package/dist/src/storage/local/repository.js.map +1 -0
- package/dist/src/storage/local/repository.spec.d.ts +6 -0
- package/dist/src/storage/local/repository.spec.d.ts.map +1 -0
- package/dist/src/storage/local/repository.spec.js +186 -0
- package/dist/src/storage/local/repository.spec.js.map +1 -0
- package/dist/src/tasks.d.ts +16 -10
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +35 -41
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/tasks.spec.d.ts +6 -0
- package/dist/src/tasks.spec.d.ts.map +1 -0
- package/dist/src/tasks.spec.js +105 -0
- package/dist/src/tasks.spec.js.map +1 -0
- package/dist/src/test-helpers.d.ts +5 -4
- package/dist/src/test-helpers.d.ts.map +1 -1
- package/dist/src/test-helpers.js +9 -21
- package/dist/src/test-helpers.js.map +1 -1
- package/dist/src/transfer/InMemoryTransferBackend.d.ts +75 -0
- package/dist/src/transfer/InMemoryTransferBackend.d.ts.map +1 -0
- package/dist/src/transfer/InMemoryTransferBackend.js +211 -0
- package/dist/src/transfer/InMemoryTransferBackend.js.map +1 -0
- package/dist/src/transfer/index.d.ts +9 -0
- package/dist/src/transfer/index.d.ts.map +1 -0
- package/dist/src/transfer/index.js +11 -0
- package/dist/src/transfer/index.js.map +1 -0
- package/dist/src/transfer/interfaces.d.ts +103 -0
- package/dist/src/transfer/interfaces.d.ts.map +1 -0
- package/dist/src/transfer/interfaces.js +6 -0
- package/dist/src/transfer/interfaces.js.map +1 -0
- package/dist/src/transfer/process.d.ts +55 -0
- package/dist/src/transfer/process.d.ts.map +1 -0
- package/dist/src/transfer/process.js +144 -0
- package/dist/src/transfer/process.js.map +1 -0
- package/dist/src/transfer/types.d.ts +106 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/transfer/types.js +61 -0
- package/dist/src/transfer/types.js.map +1 -0
- package/dist/src/trees.d.ts +102 -63
- package/dist/src/trees.d.ts.map +1 -1
- package/dist/src/trees.js +319 -479
- package/dist/src/trees.js.map +1 -1
- package/dist/src/trees.spec.d.ts +6 -0
- package/dist/src/trees.spec.d.ts.map +1 -0
- package/dist/src/trees.spec.js +635 -0
- package/dist/src/trees.spec.js.map +1 -0
- package/dist/src/uuid.d.ts +26 -0
- package/dist/src/uuid.d.ts.map +1 -0
- package/dist/src/uuid.js +80 -0
- package/dist/src/uuid.js.map +1 -0
- package/dist/src/workspaceStatus.d.ts +6 -4
- package/dist/src/workspaceStatus.d.ts.map +1 -1
- package/dist/src/workspaceStatus.js +46 -60
- package/dist/src/workspaceStatus.js.map +1 -1
- package/dist/src/workspaces.d.ts +46 -47
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +281 -221
- package/dist/src/workspaces.js.map +1 -1
- package/dist/src/workspaces.spec.d.ts +6 -0
- package/dist/src/workspaces.spec.d.ts.map +1 -0
- package/dist/src/workspaces.spec.js +273 -0
- package/dist/src/workspaces.spec.js.map +1 -0
- package/package.json +15 -15
- package/dist/src/gc.d.ts +0 -54
- package/dist/src/gc.d.ts.map +0 -1
- package/dist/src/gc.js +0 -233
- package/dist/src/gc.js.map +0 -1
- package/dist/src/repository.d.ts.map +0 -1
- package/dist/src/repository.js.map +0 -1
- package/dist/src/workspaceLock.d.ts +0 -67
- package/dist/src/workspaceLock.d.ts.map +0 -1
- package/dist/src/workspaceLock.js +0 -217
- package/dist/src/workspaceLock.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Transfer backend interfaces for presigned URL object transfer.
|
|
7
|
+
*
|
|
8
|
+
* TransferBackend is a separate top-level interface (not part of StorageBackend).
|
|
9
|
+
* It provides cloud-agnostic abstractions for uploading/downloading datasets and
|
|
10
|
+
* packages via presigned URLs. Implementations:
|
|
11
|
+
* - InMemoryTransferBackend (local server, tests)
|
|
12
|
+
* - S3DynamoTransferBackend (AWS cloud, future)
|
|
13
|
+
*/
|
|
14
|
+
import type { DatasetUpload, PackageImport, PackageExport } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Manages staged dataset uploads.
|
|
17
|
+
*
|
|
18
|
+
* Flow: create → getUploadUrl → (client uploads) → commitObject → delete
|
|
19
|
+
*/
|
|
20
|
+
export interface DatasetUploadStore {
|
|
21
|
+
create(id: string, record: DatasetUpload): Promise<void>;
|
|
22
|
+
get(id: string): Promise<DatasetUpload | null>;
|
|
23
|
+
delete(id: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* URL the client PUTs bytes to. The upload ID is embedded in the URL
|
|
26
|
+
* so concurrent uploads to the same hash are unambiguous.
|
|
27
|
+
*/
|
|
28
|
+
getUploadUrl(id: string, repo: string, hash: string): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Verify the upload and make the object visible in the catalogue.
|
|
31
|
+
* On success, the object is queryable via storage.objects.read(repo, hash).
|
|
32
|
+
* On failure, throws — caller should clean up the transfer record.
|
|
33
|
+
*/
|
|
34
|
+
commitObject(repo: string, hash: string, uploadId: string): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Generates download URLs for dataset objects.
|
|
38
|
+
*
|
|
39
|
+
* Local: creates temporary records so `/api/downloads/:id` can look up the object.
|
|
40
|
+
* Cloud: returns presigned S3 URLs directly; `get`/`delete` are never called.
|
|
41
|
+
*/
|
|
42
|
+
export interface DatasetDownloadStore {
|
|
43
|
+
/** Create a temporary download record and return the URL. */
|
|
44
|
+
getDownloadUrl(repo: string, hash: string): Promise<string>;
|
|
45
|
+
/** Look up a download record by ID (for local server data handlers). */
|
|
46
|
+
get(id: string): Promise<{
|
|
47
|
+
repo: string;
|
|
48
|
+
hash: string;
|
|
49
|
+
} | null>;
|
|
50
|
+
/** Clean up after serving. */
|
|
51
|
+
delete(id: string): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Manages package import lifecycle: upload zip → process → poll completion.
|
|
55
|
+
*
|
|
56
|
+
* Flow: create → getUploadUrl → (client uploads) → execute → poll get → delete
|
|
57
|
+
*/
|
|
58
|
+
export interface PackageImportStore {
|
|
59
|
+
create(id: string, record: PackageImport): Promise<void>;
|
|
60
|
+
get(id: string): Promise<PackageImport | null>;
|
|
61
|
+
updateStatus(id: string, status: PackageImport['status']): Promise<void>;
|
|
62
|
+
delete(id: string): Promise<void>;
|
|
63
|
+
/** URL the client PUTs zip bytes to. */
|
|
64
|
+
getUploadUrl(id: string, repo: string): Promise<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Dispatch processing.
|
|
67
|
+
* Local: calls packageImport() inline, updates status to completed/failed.
|
|
68
|
+
* Cloud: invokes background processor asynchronously.
|
|
69
|
+
*/
|
|
70
|
+
execute(id: string, repo: string): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Manages package export lifecycle: trigger → process → poll → download.
|
|
74
|
+
*
|
|
75
|
+
* Flow: create → execute → poll get → getDownloadUrl → delete
|
|
76
|
+
*/
|
|
77
|
+
export interface PackageExportStore {
|
|
78
|
+
create(id: string, record: PackageExport): Promise<void>;
|
|
79
|
+
get(id: string): Promise<PackageExport | null>;
|
|
80
|
+
updateStatus(id: string, status: PackageExport['status']): Promise<void>;
|
|
81
|
+
delete(id: string): Promise<void>;
|
|
82
|
+
/** URL the client GETs zip bytes from. */
|
|
83
|
+
getDownloadUrl(id: string, repo: string): Promise<string>;
|
|
84
|
+
/**
|
|
85
|
+
* Dispatch processing.
|
|
86
|
+
* Local: calls packageExport() inline, updates status to completed/failed.
|
|
87
|
+
* Cloud: invokes background processor asynchronously.
|
|
88
|
+
*/
|
|
89
|
+
execute(id: string, repo: string): Promise<void>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Cloud-agnostic transfer backend for presigned URL object transfer.
|
|
93
|
+
*
|
|
94
|
+
* Separate from StorageBackend — depends on it for actual object/ref operations
|
|
95
|
+
* but has its own lifecycle (staging, jobs, URLs).
|
|
96
|
+
*/
|
|
97
|
+
export interface TransferBackend {
|
|
98
|
+
readonly datasetUpload: DatasetUploadStore;
|
|
99
|
+
readonly datasetDownload: DatasetDownloadStore;
|
|
100
|
+
readonly packageImport: PackageImportStore;
|
|
101
|
+
readonly packageExport: PackageExportStore;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/transfer/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAM9E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEtE;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E;AAMD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5D,wEAAwE;IACxE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QA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,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAMD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,eAAe,EAAE,oBAAoB,CAAC;IAC/C,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/transfer/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import type { StorageBackend } from '../storage/index.js';
|
|
6
|
+
import type { PackageExportStore, PackageImportStore } from './interfaces.js';
|
|
7
|
+
/** Dependencies for handleProcessExport. */
|
|
8
|
+
export interface ProcessExportDeps {
|
|
9
|
+
storage: StorageBackend;
|
|
10
|
+
exportStore: PackageExportStore;
|
|
11
|
+
}
|
|
12
|
+
/** Input for handleProcessExport. */
|
|
13
|
+
export interface ProcessExportInput {
|
|
14
|
+
id: string;
|
|
15
|
+
repo: string;
|
|
16
|
+
zipPath: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Processes a package or workspace export job.
|
|
20
|
+
*
|
|
21
|
+
* Gets the export record, determines whether this is a package or workspace
|
|
22
|
+
* export (based on the `workspace` field), runs the appropriate export
|
|
23
|
+
* function, and updates the status to completed or failed.
|
|
24
|
+
*
|
|
25
|
+
* @param deps - Storage backend and export store
|
|
26
|
+
* @param input - Job ID, repository path, and output zip path
|
|
27
|
+
*
|
|
28
|
+
* @throws Re-throws errors after updating status to failed and cleaning up
|
|
29
|
+
*/
|
|
30
|
+
export declare function handleProcessExport(deps: ProcessExportDeps, input: ProcessExportInput): Promise<void>;
|
|
31
|
+
/** Dependencies for handleProcessImport. */
|
|
32
|
+
export interface ProcessImportDeps {
|
|
33
|
+
storage: StorageBackend;
|
|
34
|
+
importStore: PackageImportStore;
|
|
35
|
+
}
|
|
36
|
+
/** Input for handleProcessImport. */
|
|
37
|
+
export interface ProcessImportInput {
|
|
38
|
+
id: string;
|
|
39
|
+
repo: string;
|
|
40
|
+
zipPath: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Processes a package import job.
|
|
44
|
+
*
|
|
45
|
+
* Gets the import record, verifies the file size matches, runs packageImport,
|
|
46
|
+
* and updates the status to completed or failed. Cleans up the staging zip
|
|
47
|
+
* file in all cases.
|
|
48
|
+
*
|
|
49
|
+
* @param deps - Storage backend and import store
|
|
50
|
+
* @param input - Job ID, repository path, and staging zip path
|
|
51
|
+
*
|
|
52
|
+
* @throws Re-throws errors after updating status to failed
|
|
53
|
+
*/
|
|
54
|
+
export declare function handleProcessImport(deps: ProcessImportDeps, input: ProcessImportInput): Promise<void>;
|
|
55
|
+
//# sourceMappingURL=process.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../src/transfer/process.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AA6C9E,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAiCf;AAMD,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,EAAE,kBAAkB,CAAC;CACjC;AAED,qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,iBAAiB,EACvB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Shared processing handlers for package import/export.
|
|
7
|
+
*
|
|
8
|
+
* These are cloud-agnostic handlers that perform the actual import/export work.
|
|
9
|
+
* Used by both the local InMemoryTransferBackend and cloud backends
|
|
10
|
+
* (e.g. AWS Lambda/Step Functions).
|
|
11
|
+
*/
|
|
12
|
+
import { stat, unlink } from 'node:fs/promises';
|
|
13
|
+
import { variant } from '@elaraai/east';
|
|
14
|
+
import { packageExport } from '../packages.js';
|
|
15
|
+
import { workspaceExport } from '../workspaces.js';
|
|
16
|
+
import { packageImport } from '../packages.js';
|
|
17
|
+
// =============================================================================
|
|
18
|
+
// Throttled progress callback
|
|
19
|
+
// =============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Creates a progress callback that throttles updates to at most once per interval.
|
|
22
|
+
*
|
|
23
|
+
* @param fn - The function to call with throttled updates
|
|
24
|
+
* @param intervalMs - Minimum interval between calls in milliseconds
|
|
25
|
+
* @returns A throttled version of the progress callback
|
|
26
|
+
*/
|
|
27
|
+
function throttledProgress(fn, intervalMs = 1000) {
|
|
28
|
+
let lastCall = 0;
|
|
29
|
+
let pending = null;
|
|
30
|
+
const throttled = async (progress) => {
|
|
31
|
+
const now = Date.now();
|
|
32
|
+
if (now - lastCall >= intervalMs) {
|
|
33
|
+
lastCall = now;
|
|
34
|
+
pending = null;
|
|
35
|
+
await fn(progress);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
pending = progress;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
throttled.flush = async () => {
|
|
42
|
+
if (pending) {
|
|
43
|
+
await fn(pending);
|
|
44
|
+
pending = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return throttled;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Processes a package or workspace export job.
|
|
51
|
+
*
|
|
52
|
+
* Gets the export record, determines whether this is a package or workspace
|
|
53
|
+
* export (based on the `workspace` field), runs the appropriate export
|
|
54
|
+
* function, and updates the status to completed or failed.
|
|
55
|
+
*
|
|
56
|
+
* @param deps - Storage backend and export store
|
|
57
|
+
* @param input - Job ID, repository path, and output zip path
|
|
58
|
+
*
|
|
59
|
+
* @throws Re-throws errors after updating status to failed and cleaning up
|
|
60
|
+
*/
|
|
61
|
+
export async function handleProcessExport(deps, input) {
|
|
62
|
+
const { storage, exportStore } = deps;
|
|
63
|
+
const { id, repo, zipPath } = input;
|
|
64
|
+
const record = await exportStore.get(id);
|
|
65
|
+
if (!record)
|
|
66
|
+
throw new Error(`Export record ${id} not found`);
|
|
67
|
+
const onProgress = throttledProgress(async ({ objectsProcessed }) => {
|
|
68
|
+
await exportStore.updateStatus(id, variant('processing', variant('exporting', { objectsProcessed: BigInt(objectsProcessed) })));
|
|
69
|
+
});
|
|
70
|
+
try {
|
|
71
|
+
if (record.workspace.type === 'some') {
|
|
72
|
+
await workspaceExport(storage, repo, record.workspace.value, zipPath, record.name, record.version, {
|
|
73
|
+
onProgress,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
await packageExport(storage, repo, record.name, record.version, zipPath, {
|
|
78
|
+
onProgress,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
await onProgress.flush();
|
|
82
|
+
const fileStat = await stat(zipPath);
|
|
83
|
+
await exportStore.updateStatus(id, variant('completed', {
|
|
84
|
+
size: BigInt(fileStat.size),
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
await unlink(zipPath).catch(() => { });
|
|
89
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
90
|
+
await exportStore.updateStatus(id, variant('failed', { message }));
|
|
91
|
+
throw err;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Processes a package import job.
|
|
96
|
+
*
|
|
97
|
+
* Gets the import record, verifies the file size matches, runs packageImport,
|
|
98
|
+
* and updates the status to completed or failed. Cleans up the staging zip
|
|
99
|
+
* file in all cases.
|
|
100
|
+
*
|
|
101
|
+
* @param deps - Storage backend and import store
|
|
102
|
+
* @param input - Job ID, repository path, and staging zip path
|
|
103
|
+
*
|
|
104
|
+
* @throws Re-throws errors after updating status to failed
|
|
105
|
+
*/
|
|
106
|
+
export async function handleProcessImport(deps, input) {
|
|
107
|
+
const { storage, importStore } = deps;
|
|
108
|
+
const { id, repo, zipPath } = input;
|
|
109
|
+
const record = await importStore.get(id);
|
|
110
|
+
if (!record)
|
|
111
|
+
throw new Error(`Import record ${id} not found`);
|
|
112
|
+
// Verify file size matches
|
|
113
|
+
const fileStat = await stat(zipPath);
|
|
114
|
+
if (BigInt(fileStat.size) !== record.size) {
|
|
115
|
+
const message = `size mismatch: expected ${record.size}, got ${fileStat.size}`;
|
|
116
|
+
await importStore.updateStatus(id, variant('failed', { message }));
|
|
117
|
+
await unlink(zipPath).catch(() => { });
|
|
118
|
+
throw new Error(message);
|
|
119
|
+
}
|
|
120
|
+
try {
|
|
121
|
+
const onProgress = throttledProgress(async ({ objectsProcessed }) => {
|
|
122
|
+
await importStore.updateStatus(id, variant('processing', variant('importing', { objectsProcessed: BigInt(objectsProcessed) })));
|
|
123
|
+
});
|
|
124
|
+
const result = await packageImport(storage, repo, zipPath, {
|
|
125
|
+
onProgress,
|
|
126
|
+
});
|
|
127
|
+
await onProgress.flush();
|
|
128
|
+
await importStore.updateStatus(id, variant('completed', {
|
|
129
|
+
name: result.name,
|
|
130
|
+
version: result.version,
|
|
131
|
+
packageHash: result.packageHash,
|
|
132
|
+
objectCount: BigInt(result.objectCount),
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
catch (err) {
|
|
136
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
137
|
+
await importStore.updateStatus(id, variant('failed', { message }));
|
|
138
|
+
throw err;
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
await unlink(zipPath).catch(() => { });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../src/transfer/process.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,gFAAgF;AAChF,8BAA8B;AAC9B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,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;YACzD,UAAU;SACX,CAAC,CAAC;QAEH,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;QACzB,MAAM,WAAW,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,WAAW,EAAE;YACtD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;SACxC,CAAC,CAAC,CAAC;IACN,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,MAAM,WAAW,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* East types for transfer backend stored state.
|
|
7
|
+
*
|
|
8
|
+
* These define the shape of records persisted by TransferBackend implementations
|
|
9
|
+
* (in-memory Maps for local, DynamoDB for cloud).
|
|
10
|
+
*/
|
|
11
|
+
import { StructType, StringType, IntegerType, VariantType, NullType, OptionType, DateTimeType, type ValueTypeOf } from '@elaraai/east';
|
|
12
|
+
import { PackageImportProgressType, PackageExportProgressType } from '@elaraai/e3-types';
|
|
13
|
+
export { PackageImportProgressType, PackageExportProgressType };
|
|
14
|
+
export declare const DatasetUploadType: StructType<{
|
|
15
|
+
readonly repo: StringType;
|
|
16
|
+
readonly workspace: StringType;
|
|
17
|
+
readonly path: StringType;
|
|
18
|
+
readonly hash: StringType;
|
|
19
|
+
readonly size: IntegerType;
|
|
20
|
+
}>;
|
|
21
|
+
export type DatasetUpload = ValueTypeOf<typeof DatasetUploadType>;
|
|
22
|
+
export declare const PackageImportStatusType: VariantType<{
|
|
23
|
+
readonly created: NullType;
|
|
24
|
+
readonly uploaded: NullType;
|
|
25
|
+
readonly processing: VariantType<{
|
|
26
|
+
readonly pending: NullType;
|
|
27
|
+
readonly downloading: NullType;
|
|
28
|
+
readonly importing: StructType<{
|
|
29
|
+
readonly objectsProcessed: IntegerType;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
readonly completed: StructType<{
|
|
33
|
+
readonly name: StringType;
|
|
34
|
+
readonly version: StringType;
|
|
35
|
+
readonly packageHash: StringType;
|
|
36
|
+
readonly objectCount: IntegerType;
|
|
37
|
+
}>;
|
|
38
|
+
readonly failed: StructType<{
|
|
39
|
+
readonly message: StringType;
|
|
40
|
+
}>;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const PackageImportType: StructType<{
|
|
43
|
+
readonly repo: StringType;
|
|
44
|
+
readonly size: IntegerType;
|
|
45
|
+
readonly status: VariantType<{
|
|
46
|
+
readonly created: NullType;
|
|
47
|
+
readonly uploaded: NullType;
|
|
48
|
+
readonly processing: VariantType<{
|
|
49
|
+
readonly pending: NullType;
|
|
50
|
+
readonly downloading: NullType;
|
|
51
|
+
readonly importing: StructType<{
|
|
52
|
+
readonly objectsProcessed: IntegerType;
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
readonly completed: StructType<{
|
|
56
|
+
readonly name: StringType;
|
|
57
|
+
readonly version: StringType;
|
|
58
|
+
readonly packageHash: StringType;
|
|
59
|
+
readonly objectCount: IntegerType;
|
|
60
|
+
}>;
|
|
61
|
+
readonly failed: StructType<{
|
|
62
|
+
readonly message: StringType;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
readonly createdAt: DateTimeType;
|
|
66
|
+
}>;
|
|
67
|
+
export type PackageImport = ValueTypeOf<typeof PackageImportType>;
|
|
68
|
+
export declare const PackageExportStatusType: VariantType<{
|
|
69
|
+
readonly processing: VariantType<{
|
|
70
|
+
readonly pending: NullType;
|
|
71
|
+
readonly exporting: StructType<{
|
|
72
|
+
readonly objectsProcessed: IntegerType;
|
|
73
|
+
}>;
|
|
74
|
+
readonly uploading: NullType;
|
|
75
|
+
}>;
|
|
76
|
+
readonly completed: StructType<{
|
|
77
|
+
readonly size: IntegerType;
|
|
78
|
+
}>;
|
|
79
|
+
readonly failed: StructType<{
|
|
80
|
+
readonly message: StringType;
|
|
81
|
+
}>;
|
|
82
|
+
}>;
|
|
83
|
+
export declare const PackageExportType: StructType<{
|
|
84
|
+
readonly repo: StringType;
|
|
85
|
+
readonly name: StringType;
|
|
86
|
+
readonly version: StringType;
|
|
87
|
+
readonly workspace: OptionType<StringType>;
|
|
88
|
+
readonly status: VariantType<{
|
|
89
|
+
readonly processing: VariantType<{
|
|
90
|
+
readonly pending: NullType;
|
|
91
|
+
readonly exporting: StructType<{
|
|
92
|
+
readonly objectsProcessed: IntegerType;
|
|
93
|
+
}>;
|
|
94
|
+
readonly uploading: NullType;
|
|
95
|
+
}>;
|
|
96
|
+
readonly completed: StructType<{
|
|
97
|
+
readonly size: IntegerType;
|
|
98
|
+
}>;
|
|
99
|
+
readonly failed: StructType<{
|
|
100
|
+
readonly message: StringType;
|
|
101
|
+
}>;
|
|
102
|
+
}>;
|
|
103
|
+
readonly createdAt: DateTimeType;
|
|
104
|
+
}>;
|
|
105
|
+
export type PackageExport = ValueTypeOf<typeof PackageExportType>;
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/transfer/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;AAMhE,eAAO,MAAM,iBAAiB;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAMlE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;EAWlC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAMlE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;EAIlC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAO5B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* East types for transfer backend stored state.
|
|
7
|
+
*
|
|
8
|
+
* These define the shape of records persisted by TransferBackend implementations
|
|
9
|
+
* (in-memory Maps for local, DynamoDB for cloud).
|
|
10
|
+
*/
|
|
11
|
+
import { StructType, StringType, IntegerType, VariantType, NullType, OptionType, DateTimeType, } from '@elaraai/east';
|
|
12
|
+
import { PackageImportProgressType, PackageExportProgressType } from '@elaraai/e3-types';
|
|
13
|
+
export { PackageImportProgressType, PackageExportProgressType };
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// Dataset Upload
|
|
16
|
+
// =============================================================================
|
|
17
|
+
export const DatasetUploadType = StructType({
|
|
18
|
+
repo: StringType,
|
|
19
|
+
workspace: StringType,
|
|
20
|
+
path: StringType,
|
|
21
|
+
hash: StringType,
|
|
22
|
+
size: IntegerType,
|
|
23
|
+
});
|
|
24
|
+
// =============================================================================
|
|
25
|
+
// Package Import
|
|
26
|
+
// =============================================================================
|
|
27
|
+
export const PackageImportStatusType = VariantType({
|
|
28
|
+
created: NullType,
|
|
29
|
+
uploaded: NullType,
|
|
30
|
+
processing: PackageImportProgressType,
|
|
31
|
+
completed: StructType({
|
|
32
|
+
name: StringType,
|
|
33
|
+
version: StringType,
|
|
34
|
+
packageHash: StringType,
|
|
35
|
+
objectCount: IntegerType,
|
|
36
|
+
}),
|
|
37
|
+
failed: StructType({ message: StringType }),
|
|
38
|
+
});
|
|
39
|
+
export const PackageImportType = StructType({
|
|
40
|
+
repo: StringType,
|
|
41
|
+
size: IntegerType,
|
|
42
|
+
status: PackageImportStatusType,
|
|
43
|
+
createdAt: DateTimeType,
|
|
44
|
+
});
|
|
45
|
+
// =============================================================================
|
|
46
|
+
// Package Export
|
|
47
|
+
// =============================================================================
|
|
48
|
+
export const PackageExportStatusType = VariantType({
|
|
49
|
+
processing: PackageExportProgressType,
|
|
50
|
+
completed: StructType({ size: IntegerType }),
|
|
51
|
+
failed: StructType({ message: StringType }),
|
|
52
|
+
});
|
|
53
|
+
export const PackageExportType = StructType({
|
|
54
|
+
repo: StringType,
|
|
55
|
+
name: StringType,
|
|
56
|
+
version: StringType,
|
|
57
|
+
workspace: OptionType(StringType),
|
|
58
|
+
status: PackageExportStatusType,
|
|
59
|
+
createdAt: DateTimeType,
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/transfer/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,GAEb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;AAEhE,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW;CAClB,CAAC,CAAC;AAIH,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC;IACjD,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,yBAAyB;IACrC,SAAS,EAAE,UAAU,CAAC;QACpB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE,WAAW;KACzB,CAAC;IACF,MAAM,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,uBAAuB;IAC/B,SAAS,EAAE,YAAY;CACxB,CAAC,CAAC;AAIH,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEh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