@elaraai/e3-core 0.0.2-beta.4 → 0.0.2-beta.40
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/README.md +25 -22
- 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/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 +695 -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/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/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.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/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/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 +110 -476
- package/dist/src/executions.js.map +1 -1
- package/dist/src/index.d.ts +19 -9
- 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 +8 -51
- package/dist/src/objects.d.ts.map +1 -1
- package/dist/src/objects.js +13 -230
- package/dist/src/objects.js.map +1 -1
- package/dist/src/packages.d.ts +22 -14
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +134 -88
- package/dist/src/packages.js.map +1 -1
- 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/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 +355 -0
- package/dist/src/storage/local/LocalLockService.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/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/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/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 +66 -0
- package/dist/src/transfer/InMemoryTransferBackend.d.ts.map +1 -0
- package/dist/src/transfer/InMemoryTransferBackend.js +166 -0
- package/dist/src/transfer/InMemoryTransferBackend.js.map +1 -0
- package/dist/src/transfer/index.d.ts +8 -0
- package/dist/src/transfer/index.d.ts.map +1 -0
- package/dist/src/transfer/index.js +9 -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/types.d.ts +79 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/transfer/types.js +58 -0
- package/dist/src/transfer/types.js.map +1 -0
- package/dist/src/trees.d.ts +147 -59
- package/dist/src/trees.d.ts.map +1 -1
- package/dist/src/trees.js +372 -419
- package/dist/src/trees.js.map +1 -1
- 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 +43 -49
- package/dist/src/workspaceStatus.js.map +1 -1
- package/dist/src/workspaces.d.ts +35 -47
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +194 -156
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +4 -4
- 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,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* In-memory TransferBackend implementation.
|
|
7
|
+
*
|
|
8
|
+
* Pure in-memory — no filesystem access. Package import/export execute as
|
|
9
|
+
* simplified mocks (trust hash, return placeholder results). Real transfer
|
|
10
|
+
* flows are tested via integration tests against the actual server.
|
|
11
|
+
*/
|
|
12
|
+
/* eslint-disable @typescript-eslint/require-await */
|
|
13
|
+
import { randomUUID } from 'node:crypto';
|
|
14
|
+
import { variant } from '@elaraai/east';
|
|
15
|
+
// =============================================================================
|
|
16
|
+
// Dataset Upload
|
|
17
|
+
// =============================================================================
|
|
18
|
+
class InMemoryDatasetUploadStore {
|
|
19
|
+
baseUrl;
|
|
20
|
+
records = new Map();
|
|
21
|
+
constructor(baseUrl) {
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
}
|
|
24
|
+
async create(id, record) {
|
|
25
|
+
this.records.set(id, record);
|
|
26
|
+
}
|
|
27
|
+
async get(id) {
|
|
28
|
+
return this.records.get(id) ?? null;
|
|
29
|
+
}
|
|
30
|
+
async delete(id) {
|
|
31
|
+
this.records.delete(id);
|
|
32
|
+
}
|
|
33
|
+
async getUploadUrl(id, _repo, _hash) {
|
|
34
|
+
return `${this.baseUrl}/api/uploads/${id}`;
|
|
35
|
+
}
|
|
36
|
+
async commitObject(_repo, _hash, uploadId) {
|
|
37
|
+
// Mock — just remove the record. Real verification happens in integration tests.
|
|
38
|
+
this.records.delete(uploadId);
|
|
39
|
+
}
|
|
40
|
+
clear() {
|
|
41
|
+
this.records.clear();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// =============================================================================
|
|
45
|
+
// Dataset Download
|
|
46
|
+
// =============================================================================
|
|
47
|
+
class InMemoryDatasetDownloadStore {
|
|
48
|
+
baseUrl;
|
|
49
|
+
records = new Map();
|
|
50
|
+
constructor(baseUrl) {
|
|
51
|
+
this.baseUrl = baseUrl;
|
|
52
|
+
}
|
|
53
|
+
async getDownloadUrl(repo, hash) {
|
|
54
|
+
const id = randomUUID();
|
|
55
|
+
this.records.set(id, { repo, hash });
|
|
56
|
+
return `${this.baseUrl}/api/downloads/${id}`;
|
|
57
|
+
}
|
|
58
|
+
async get(id) {
|
|
59
|
+
return this.records.get(id) ?? null;
|
|
60
|
+
}
|
|
61
|
+
async delete(id) {
|
|
62
|
+
this.records.delete(id);
|
|
63
|
+
}
|
|
64
|
+
clear() {
|
|
65
|
+
this.records.clear();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// =============================================================================
|
|
69
|
+
// Package Import
|
|
70
|
+
// =============================================================================
|
|
71
|
+
class InMemoryPackageImportStore {
|
|
72
|
+
baseUrl;
|
|
73
|
+
records = new Map();
|
|
74
|
+
constructor(baseUrl) {
|
|
75
|
+
this.baseUrl = baseUrl;
|
|
76
|
+
}
|
|
77
|
+
async create(id, record) {
|
|
78
|
+
this.records.set(id, record);
|
|
79
|
+
}
|
|
80
|
+
async get(id) {
|
|
81
|
+
return this.records.get(id) ?? null;
|
|
82
|
+
}
|
|
83
|
+
async updateStatus(id, status) {
|
|
84
|
+
const record = this.records.get(id);
|
|
85
|
+
if (!record)
|
|
86
|
+
throw new Error(`Package import ${id} not found`);
|
|
87
|
+
this.records.set(id, { ...record, status });
|
|
88
|
+
}
|
|
89
|
+
async delete(id) {
|
|
90
|
+
this.records.delete(id);
|
|
91
|
+
}
|
|
92
|
+
async getUploadUrl(id, _repo) {
|
|
93
|
+
return `${this.baseUrl}/api/uploads/${id}`;
|
|
94
|
+
}
|
|
95
|
+
async execute(id, _repo) {
|
|
96
|
+
const record = this.records.get(id);
|
|
97
|
+
if (!record)
|
|
98
|
+
throw new Error(`Package import ${id} not found`);
|
|
99
|
+
await this.updateStatus(id, variant('completed', {
|
|
100
|
+
name: 'mock',
|
|
101
|
+
version: '0.0.0',
|
|
102
|
+
packageHash: 'mock',
|
|
103
|
+
objectCount: 0n,
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
clear() {
|
|
107
|
+
this.records.clear();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// =============================================================================
|
|
111
|
+
// Package Export
|
|
112
|
+
// =============================================================================
|
|
113
|
+
class InMemoryPackageExportStore {
|
|
114
|
+
baseUrl;
|
|
115
|
+
records = new Map();
|
|
116
|
+
constructor(baseUrl) {
|
|
117
|
+
this.baseUrl = baseUrl;
|
|
118
|
+
}
|
|
119
|
+
async create(id, record) {
|
|
120
|
+
this.records.set(id, record);
|
|
121
|
+
}
|
|
122
|
+
async get(id) {
|
|
123
|
+
return this.records.get(id) ?? null;
|
|
124
|
+
}
|
|
125
|
+
async updateStatus(id, status) {
|
|
126
|
+
const record = this.records.get(id);
|
|
127
|
+
if (!record)
|
|
128
|
+
throw new Error(`Package export ${id} not found`);
|
|
129
|
+
this.records.set(id, { ...record, status });
|
|
130
|
+
}
|
|
131
|
+
async delete(id) {
|
|
132
|
+
this.records.delete(id);
|
|
133
|
+
}
|
|
134
|
+
async getDownloadUrl(id, _repo) {
|
|
135
|
+
return `${this.baseUrl}/api/downloads/${id}`;
|
|
136
|
+
}
|
|
137
|
+
async execute(id, _repo) {
|
|
138
|
+
const record = this.records.get(id);
|
|
139
|
+
if (!record)
|
|
140
|
+
throw new Error(`Package export ${id} not found`);
|
|
141
|
+
await this.updateStatus(id, variant('completed', { size: 0n }));
|
|
142
|
+
}
|
|
143
|
+
clear() {
|
|
144
|
+
this.records.clear();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
export class InMemoryTransferBackend {
|
|
148
|
+
datasetUpload;
|
|
149
|
+
datasetDownload;
|
|
150
|
+
packageImport;
|
|
151
|
+
packageExport;
|
|
152
|
+
constructor(options) {
|
|
153
|
+
const baseUrl = options.baseUrl ?? '';
|
|
154
|
+
this.datasetUpload = new InMemoryDatasetUploadStore(baseUrl);
|
|
155
|
+
this.datasetDownload = new InMemoryDatasetDownloadStore(baseUrl);
|
|
156
|
+
this.packageImport = new InMemoryPackageImportStore(baseUrl);
|
|
157
|
+
this.packageExport = new InMemoryPackageExportStore(baseUrl);
|
|
158
|
+
}
|
|
159
|
+
clear() {
|
|
160
|
+
this.datasetUpload.clear();
|
|
161
|
+
this.datasetDownload.clear();
|
|
162
|
+
this.packageImport.clear();
|
|
163
|
+
this.packageExport.clear();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=InMemoryTransferBackend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InMemoryTransferBackend.js","sourceRoot":"","sources":["../../../src/transfer/InMemoryTransferBackend.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,qDAAqD;AACrD,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C7D,IAAI,CAAC,eAAe,GAAG,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,CAAC,aAAa,GAAG,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,aAAa,GAAG,IAAI,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
export { DatasetUploadType, type DatasetUpload, PackageImportType, PackageImportStatusType, type PackageImport, PackageExportType, PackageExportStatusType, type PackageExport, } from './types.js';
|
|
6
|
+
export { type DatasetUploadStore, type DatasetDownloadStore, type PackageImportStore, type PackageExportStore, type TransferBackend, } from './interfaces.js';
|
|
7
|
+
export { InMemoryTransferBackend, type InMemoryTransferBackendOptions, } from './InMemoryTransferBackend.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transfer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,aAAa,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,GACpC,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
// Types
|
|
6
|
+
export { DatasetUploadType, PackageImportType, PackageImportStatusType, PackageExportType, PackageExportStatusType, } from './types.js';
|
|
7
|
+
// InMemory implementation
|
|
8
|
+
export { InMemoryTransferBackend, } from './InMemoryTransferBackend.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/transfer/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,QAAQ;AACR,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EACjB,uBAAuB,EAEvB,iBAAiB,EACjB,uBAAuB,GAExB,MAAM,YAAY,CAAC;AAWpB,0BAA0B;AAC1B,OAAO,EACL,uBAAuB,GAExB,MAAM,8BAA8B,CAAC"}
|
|
@@ -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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,CAAC,CAAC;IAElC,0CAA0C;IAC1C,cAAc,CAAC,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,79 @@
|
|
|
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, DateTimeType, type ValueTypeOf } from '@elaraai/east';
|
|
12
|
+
export declare const DatasetUploadType: StructType<{
|
|
13
|
+
readonly repo: StringType;
|
|
14
|
+
readonly workspace: StringType;
|
|
15
|
+
readonly path: StringType;
|
|
16
|
+
readonly hash: StringType;
|
|
17
|
+
readonly size: IntegerType;
|
|
18
|
+
}>;
|
|
19
|
+
export type DatasetUpload = ValueTypeOf<typeof DatasetUploadType>;
|
|
20
|
+
export declare const PackageImportStatusType: VariantType<{
|
|
21
|
+
readonly created: NullType;
|
|
22
|
+
readonly uploaded: NullType;
|
|
23
|
+
readonly processing: NullType;
|
|
24
|
+
readonly completed: StructType<{
|
|
25
|
+
readonly name: StringType;
|
|
26
|
+
readonly version: StringType;
|
|
27
|
+
readonly packageHash: StringType;
|
|
28
|
+
readonly objectCount: IntegerType;
|
|
29
|
+
}>;
|
|
30
|
+
readonly failed: StructType<{
|
|
31
|
+
readonly message: StringType;
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const PackageImportType: StructType<{
|
|
35
|
+
readonly repo: StringType;
|
|
36
|
+
readonly size: IntegerType;
|
|
37
|
+
readonly status: VariantType<{
|
|
38
|
+
readonly created: NullType;
|
|
39
|
+
readonly uploaded: NullType;
|
|
40
|
+
readonly processing: NullType;
|
|
41
|
+
readonly completed: StructType<{
|
|
42
|
+
readonly name: StringType;
|
|
43
|
+
readonly version: StringType;
|
|
44
|
+
readonly packageHash: StringType;
|
|
45
|
+
readonly objectCount: IntegerType;
|
|
46
|
+
}>;
|
|
47
|
+
readonly failed: StructType<{
|
|
48
|
+
readonly message: StringType;
|
|
49
|
+
}>;
|
|
50
|
+
}>;
|
|
51
|
+
readonly createdAt: DateTimeType;
|
|
52
|
+
}>;
|
|
53
|
+
export type PackageImport = ValueTypeOf<typeof PackageImportType>;
|
|
54
|
+
export declare const PackageExportStatusType: VariantType<{
|
|
55
|
+
readonly processing: NullType;
|
|
56
|
+
readonly completed: StructType<{
|
|
57
|
+
readonly size: IntegerType;
|
|
58
|
+
}>;
|
|
59
|
+
readonly failed: StructType<{
|
|
60
|
+
readonly message: StringType;
|
|
61
|
+
}>;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const PackageExportType: StructType<{
|
|
64
|
+
readonly repo: StringType;
|
|
65
|
+
readonly name: StringType;
|
|
66
|
+
readonly version: StringType;
|
|
67
|
+
readonly status: VariantType<{
|
|
68
|
+
readonly processing: NullType;
|
|
69
|
+
readonly completed: StructType<{
|
|
70
|
+
readonly size: IntegerType;
|
|
71
|
+
}>;
|
|
72
|
+
readonly failed: StructType<{
|
|
73
|
+
readonly message: StringType;
|
|
74
|
+
}>;
|
|
75
|
+
}>;
|
|
76
|
+
readonly createdAt: DateTimeType;
|
|
77
|
+
}>;
|
|
78
|
+
export type PackageExport = ValueTypeOf<typeof PackageExportType>;
|
|
79
|
+
//# 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,YAAY,EACZ,KAAK,WAAW,EACjB,MAAM,eAAe,CAAC;AAMvB,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;;;;;;;;;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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, DateTimeType, } from '@elaraai/east';
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// Dataset Upload
|
|
14
|
+
// =============================================================================
|
|
15
|
+
export const DatasetUploadType = StructType({
|
|
16
|
+
repo: StringType,
|
|
17
|
+
workspace: StringType,
|
|
18
|
+
path: StringType,
|
|
19
|
+
hash: StringType,
|
|
20
|
+
size: IntegerType,
|
|
21
|
+
});
|
|
22
|
+
// =============================================================================
|
|
23
|
+
// Package Import
|
|
24
|
+
// =============================================================================
|
|
25
|
+
export const PackageImportStatusType = VariantType({
|
|
26
|
+
created: NullType,
|
|
27
|
+
uploaded: NullType,
|
|
28
|
+
processing: NullType,
|
|
29
|
+
completed: StructType({
|
|
30
|
+
name: StringType,
|
|
31
|
+
version: StringType,
|
|
32
|
+
packageHash: StringType,
|
|
33
|
+
objectCount: IntegerType,
|
|
34
|
+
}),
|
|
35
|
+
failed: StructType({ message: StringType }),
|
|
36
|
+
});
|
|
37
|
+
export const PackageImportType = StructType({
|
|
38
|
+
repo: StringType,
|
|
39
|
+
size: IntegerType,
|
|
40
|
+
status: PackageImportStatusType,
|
|
41
|
+
createdAt: DateTimeType,
|
|
42
|
+
});
|
|
43
|
+
// =============================================================================
|
|
44
|
+
// Package Export
|
|
45
|
+
// =============================================================================
|
|
46
|
+
export const PackageExportStatusType = VariantType({
|
|
47
|
+
processing: NullType,
|
|
48
|
+
completed: StructType({ size: IntegerType }),
|
|
49
|
+
failed: StructType({ message: StringType }),
|
|
50
|
+
});
|
|
51
|
+
export const PackageExportType = StructType({
|
|
52
|
+
repo: StringType,
|
|
53
|
+
name: StringType,
|
|
54
|
+
version: StringType,
|
|
55
|
+
status: PackageExportStatusType,
|
|
56
|
+
createdAt: DateTimeType,
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1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