@elaraai/e3-api-client 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.
Files changed (51) hide show
  1. package/LICENSE.md +4 -0
  2. package/README.md +51 -15
  3. package/dist/src/datasets.d.ts +73 -4
  4. package/dist/src/datasets.d.ts.map +1 -1
  5. package/dist/src/datasets.js +200 -20
  6. package/dist/src/datasets.js.map +1 -1
  7. package/dist/src/executions.d.ts +74 -11
  8. package/dist/src/executions.d.ts.map +1 -1
  9. package/dist/src/executions.js +184 -36
  10. package/dist/src/executions.js.map +1 -1
  11. package/dist/src/http.d.ts +72 -12
  12. package/dist/src/http.d.ts.map +1 -1
  13. package/dist/src/http.js +168 -34
  14. package/dist/src/http.js.map +1 -1
  15. package/dist/src/index.d.ts +9 -6
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/index.js +11 -5
  18. package/dist/src/index.js.map +1 -1
  19. package/dist/src/packages.d.ts +32 -27
  20. package/dist/src/packages.d.ts.map +1 -1
  21. package/dist/src/packages.js +175 -39
  22. package/dist/src/packages.js.map +1 -1
  23. package/dist/src/platform.d.ts +571 -1343
  24. package/dist/src/platform.d.ts.map +1 -1
  25. package/dist/src/platform.js +123 -915
  26. package/dist/src/platform.js.map +1 -1
  27. package/dist/src/repos.d.ts +16 -0
  28. package/dist/src/repos.d.ts.map +1 -0
  29. package/dist/src/repos.js +19 -0
  30. package/dist/src/repos.js.map +1 -0
  31. package/dist/src/repository.d.ts +67 -5
  32. package/dist/src/repository.d.ts.map +1 -1
  33. package/dist/src/repository.js +94 -10
  34. package/dist/src/repository.js.map +1 -1
  35. package/dist/src/tasks.d.ts +25 -3
  36. package/dist/src/tasks.d.ts.map +1 -1
  37. package/dist/src/tasks.js +29 -8
  38. package/dist/src/tasks.js.map +1 -1
  39. package/dist/src/types.d.ts +776 -1252
  40. package/dist/src/types.d.ts.map +1 -1
  41. package/dist/src/types.js +62 -453
  42. package/dist/src/types.js.map +1 -1
  43. package/dist/src/util.d.ts +21 -0
  44. package/dist/src/util.d.ts.map +1 -0
  45. package/dist/src/util.js +26 -0
  46. package/dist/src/util.js.map +1 -0
  47. package/dist/src/workspaces.d.ts +51 -9
  48. package/dist/src/workspaces.d.ts.map +1 -1
  49. package/dist/src/workspaces.js +87 -26
  50. package/dist/src/workspaces.js.map +1 -1
  51. package/package.json +15 -15
package/LICENSE.md CHANGED
@@ -34,6 +34,10 @@ On the Change Date (four years after each release), the Licensed Work will be ma
34
34
 
35
35
  THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. THE LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36
36
 
37
+ ### Package-Specific Licenses
38
+
39
+ Individual packages within this repository may have different licensing terms. See the LICENSE.md file in each package directory for details.
40
+
37
41
  ## Commercial Licensing
38
42
 
39
43
  To obtain a commercial license for Production Use, contact:
package/README.md CHANGED
@@ -20,7 +20,7 @@ Stateless functions for interacting with an e3 API server. Uses BEAST2 binary se
20
20
  import { repoStatus, repoGc } from '@elaraai/e3-api-client';
21
21
 
22
22
  const status = await repoStatus('http://localhost:3000');
23
- // { path: '/path/to/.e3', objectCount: 42n, packageCount: 3n, workspaceCount: 2n }
23
+ // { path: '/path/to/repo', objectCount: 42n, packageCount: 3n, workspaceCount: 2n }
24
24
 
25
25
  const gcResult = await repoGc(url, { dryRun: true, minAge: variant('none', null) });
26
26
  // { deletedObjects: 0n, retainedObjects: 42n, bytesFreed: 0n, ... }
@@ -128,38 +128,70 @@ const logs = await taskLogs(url, 'production', 'compute', { stream: 'stdout' });
128
128
  // { data: '...', offset: 0n, size: 1024n, totalSize: 2048n, complete: false }
129
129
  ```
130
130
 
131
+ ## Claude Code plugin
132
+
133
+ The East ecosystem also ships a [Claude Code](https://claude.com/claude-code) plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the `elaraai` marketplace:
134
+
135
+ ```text
136
+ # Inside Claude Code
137
+ /plugin marketplace add elaraai/east-workspace
138
+ /plugin install east@elaraai
139
+ ```
140
+
141
+ ```bash
142
+ # From a terminal
143
+ claude plugin marketplace add elaraai/east-workspace
144
+ claude plugin install east@elaraai
145
+ ```
146
+
131
147
  ## License
132
148
 
133
149
  BSL 1.1. See [LICENSE.md](./LICENSE.md).
134
150
 
135
151
  ### Ecosystem
136
152
 
137
- - **[East Node](https://github.com/elaraai/east-node)**: Node.js platform functions for I/O, databases, and system operations. Connect East programs to filesystems, SQL/NoSQL databases, cloud storage, and network services.
138
- - [@elaraai/east-node-std](https://www.npmjs.com/package/@elaraai/east-node-std): Filesystem, console, HTTP fetch, crypto, random distributions, timestamps
139
- - [@elaraai/east-node-io](https://www.npmjs.com/package/@elaraai/east-node-io): SQLite, PostgreSQL, MySQL, MongoDB, S3, FTP, SFTP
153
+ - **[East](https://github.com/elaraai/east-workspace/tree/main/libs/east)**: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.
154
+ - [@elaraai/east](https://www.npmjs.com/package/@elaraai/east): Core language SDK with type system, expressions, and reference JS compiler
155
+
156
+ - **[East Node](https://github.com/elaraai/east-workspace/tree/main/libs/east-node)**: Node.js platform functions for I/O, databases, and system operations.
157
+ - [@elaraai/east-node-std](https://www.npmjs.com/package/@elaraai/east-node-std): Console, FileSystem, Fetch, Crypto, Time, Path, Random
158
+ - [@elaraai/east-node-io](https://www.npmjs.com/package/@elaraai/east-node-io): SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
140
159
  - [@elaraai/east-node-cli](https://www.npmjs.com/package/@elaraai/east-node-cli): CLI for running East IR programs in Node.js
141
160
 
142
- - **[East Python](https://github.com/elaraai/east-py)**: Python runtime and platform functions for data science and machine learning. Execute East programs with access to optimization solvers, gradient boosting, neural networks, and model explainability.
143
- - [@elaraai/east-py-datascience](https://www.npmjs.com/package/@elaraai/east-py-datascience): TypeScript types for optimization, gradient boosting, neural networks, explainability
161
+ - **[East C](https://github.com/elaraai/east-workspace/tree/main/libs/east-c)**: C11 native runtime for executing East IR. Tarballed for `linux-x64` and `linux-arm64`, attached to each GitHub Release.
162
+ - `east-c`: Core runtime type system, IR interpreter, 200+ builtins, serialization (Beast2, JSON, CSV, East text)
163
+ - `east-c-std`: Console, FileSystem, Fetch, Crypto, Time, Path, Random
164
+ - `east-c-cli`: CLI for running East IR programs natively
165
+
166
+ - **[East Python](https://github.com/elaraai/east-workspace/tree/main/libs/east-py)**: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.
167
+ - [east-py](https://pypi.org/project/east-py/): Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
168
+ - [east-py-std](https://pypi.org/project/east-py-std/): Console, FileSystem, Fetch, Crypto, Time, Path, Random
169
+ - [east-py-io](https://pypi.org/project/east-py-io/): SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
170
+ - [east-py-cli](https://pypi.org/project/east-py-cli/): CLI for running East IR programs in Python
171
+ - [east-py-datascience](https://pypi.org/project/east-py-datascience/) (PyPI) + [@elaraai/east-py-datascience](https://www.npmjs.com/package/@elaraai/east-py-datascience) (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
144
172
 
145
- - **[East UI](https://github.com/elaraai/east-ui)**: East types and expressions for building dashboards and interactive layouts. Define UIs as data structures that render consistently across React, web, and other environments.
173
+ - **[East UI](https://github.com/elaraai/east-workspace/tree/main/libs/east-ui)**: Typed UI component definitions and React renderer, plus VS Code preview.
146
174
  - [@elaraai/east-ui](https://www.npmjs.com/package/@elaraai/east-ui): 50+ typed UI components for layouts, forms, charts, tables, dialogs
147
- - [@elaraai/east-ui-components](https://www.npmjs.com/package/@elaraai/east-ui-components): React renderer with Chakra UI styling
175
+ - [@elaraai/east-ui-components](https://www.npmjs.com/package/@elaraai/east-ui-components): React renderer with Chakra UI v3 styling
176
+ - [@elaraai/e3-ui](https://www.npmjs.com/package/@elaraai/e3-ui): e3 + UI bridge — Data bindings, `e3.ui()` task, manifest
177
+ - [@elaraai/e3-ui-components](https://www.npmjs.com/package/@elaraai/e3-ui-components): React Query hooks and preview components for the e3 API
178
+ - [east-ui-preview](https://marketplace.visualstudio.com/items?itemName=ElaraAI.east-ui-preview): VS Code extension for live East UI component preview
148
179
 
149
- - **[e3 - East Execution Engine](https://github.com/elaraai/e3)**: Durable execution engine for running East pipelines at scale. Features Git-like content-addressable storage, automatic memoization, task queuing, and real-time monitoring.
180
+ - **[e3 East Execution Engine](https://github.com/elaraai/east-workspace/tree/main/libs/e3)**: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.
150
181
  - [@elaraai/e3](https://www.npmjs.com/package/@elaraai/e3): SDK for authoring e3 packages with typed tasks and pipelines
151
- - [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core): Git-like object store, task queue, result caching
182
+ - [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core): Object store, dataflow orchestrator, execution state
152
183
  - [@elaraai/e3-types](https://www.npmjs.com/package/@elaraai/e3-types): Shared type definitions for e3 packages
153
- - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 init`, `e3 run`, `e3 logs` commands for managing and monitoring tasks
154
- - [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3 servers
184
+ - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 repo`, `e3 package`, `e3 workspace`, `e3 start`, `e3 watch`, `e3 logs` commands
185
+ - [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3 repositories
155
186
  - [@elaraai/e3-api-server](https://www.npmjs.com/package/@elaraai/e3-api-server): REST API server for e3 repositories
187
+ - [@elaraai/e3-api-tests](https://www.npmjs.com/package/@elaraai/e3-api-tests): Shared API compliance test suites
156
188
 
157
189
  ## Links
158
190
 
159
- - [East Language](https://github.com/elaraai/east)
160
- - [East Python Runtime](https://github.com/elaraai/east-py)
191
+ - [East Language](https://github.com/elaraai/east-workspace/tree/main/libs/east)
192
+ - [East Python Runtime](https://github.com/elaraai/east-workspace/tree/main/libs/east-py)
161
193
  - [Elara AI](https://elaraai.com/)
162
- - [Issues](https://github.com/elaraai/e3/issues)
194
+ - [Issues](https://github.com/elaraai/east-workspace/issues)
163
195
  - support@elara.ai
164
196
 
165
197
  ## About Elara
@@ -168,4 +200,8 @@ East is developed by [Elara AI Pty Ltd](https://elaraai.com/), an AI-powered pla
168
200
 
169
201
  ---
170
202
 
203
+ *Developed by [Elara AI Pty Ltd](https://elaraai.com/).*
204
+
205
+ ---
206
+
171
207
  *Developed by [Elara AI Pty Ltd](https://elaraai.com/)*
@@ -3,23 +3,33 @@
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
5
  import type { TreePath } from '@elaraai/e3-types';
6
+ import { type RequestOptions } from './http.js';
7
+ import { type ListEntry, type DatasetStatusDetail } from './types.js';
6
8
  /**
7
9
  * List field names at root of workspace dataset tree.
8
10
  *
9
11
  * @param url - Base URL of the e3 API server
12
+ * @param repo - Repository name
10
13
  * @param workspace - Workspace name
14
+ * @param options - Request options including auth token
11
15
  * @returns Array of field names at root
16
+ * @throws {ApiError} On application-level errors
17
+ * @throws {AuthError} On 401 Unauthorized
12
18
  */
13
- export declare function datasetList(url: string, workspace: string): Promise<string[]>;
19
+ export declare function datasetList(url: string, repo: string, workspace: string, options: RequestOptions): Promise<string[]>;
14
20
  /**
15
21
  * List field names at a path in workspace dataset tree.
16
22
  *
17
23
  * @param url - Base URL of the e3 API server
24
+ * @param repo - Repository name
18
25
  * @param workspace - Workspace name
19
26
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
27
+ * @param options - Request options including auth token
20
28
  * @returns Array of field names at path
29
+ * @throws {ApiError} On application-level errors
30
+ * @throws {AuthError} On 401 Unauthorized
21
31
  */
22
- export declare function datasetListAt(url: string, workspace: string, path: TreePath): Promise<string[]>;
32
+ export declare function datasetListAt(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<string[]>;
23
33
  /**
24
34
  * Get a dataset value as raw BEAST2 bytes.
25
35
  *
@@ -27,18 +37,77 @@ export declare function datasetListAt(url: string, workspace: string, path: Tree
27
37
  * Use decodeBeast2 or decodeBeast2For to decode with the appropriate type.
28
38
  *
29
39
  * @param url - Base URL of the e3 API server
40
+ * @param repo - Repository name
30
41
  * @param workspace - Workspace name
31
42
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
43
+ * @param options - Request options including auth token
32
44
  * @returns Raw BEAST2 bytes
33
45
  */
34
- export declare function datasetGet(url: string, workspace: string, path: TreePath): Promise<Uint8Array>;
46
+ export declare function datasetGet(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<{
47
+ data: Uint8Array;
48
+ hash: string;
49
+ size: number;
50
+ }>;
35
51
  /**
36
52
  * Set a dataset value from raw BEAST2 bytes.
37
53
  *
54
+ * For payloads > 1MB, uses a transfer flow (init → upload → complete) to
55
+ * avoid inline body size limits. For smaller payloads, uses inline PUT.
56
+ *
38
57
  * @param url - Base URL of the e3 API server
58
+ * @param repo - Repository name
39
59
  * @param workspace - Workspace name
40
60
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
41
61
  * @param data - Raw BEAST2 encoded value
62
+ * @param options - Request options including auth token
63
+ */
64
+ export declare function datasetSet(url: string, repo: string, workspace: string, path: TreePath, data: Uint8Array, options: RequestOptions): Promise<void>;
65
+ /**
66
+ * List all entries recursively under a path (flat list of datasets and trees).
67
+ *
68
+ * @param url - Base URL of the e3 API server
69
+ * @param repo - Repository name
70
+ * @param workspace - Workspace name
71
+ * @param path - Starting path (empty for root)
72
+ * @param options - Request options including auth token
73
+ * @returns Array of list entries (dataset or tree variants) with path, type, hash, and size
74
+ * @throws {ApiError} On application-level errors
75
+ * @throws {AuthError} On 401 Unauthorized
76
+ */
77
+ export declare function datasetListRecursive(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<ListEntry[]>;
78
+ /**
79
+ * List all descendant dataset paths recursively (paths only, no types/status).
80
+ *
81
+ * @param url - Base URL of the e3 API server
82
+ * @param repo - Repository name
83
+ * @param workspace - Workspace name
84
+ * @param path - Starting path (empty for root)
85
+ * @param options - Request options including auth token
86
+ * @returns Array of dataset path strings
87
+ */
88
+ export declare function datasetListRecursivePaths(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<string[]>;
89
+ /**
90
+ * List immediate children with type, hash, and size details.
91
+ *
92
+ * @param url - Base URL of the e3 API server
93
+ * @param repo - Repository name
94
+ * @param workspace - Workspace name
95
+ * @param path - Path to list (empty for root)
96
+ * @param options - Request options including auth token
97
+ * @returns Array of list entries (dataset or tree variants) with path, type, hash, and size
98
+ */
99
+ export declare function datasetListWithStatus(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<ListEntry[]>;
100
+ /**
101
+ * Get status detail for a single dataset.
102
+ *
103
+ * @param url - Base URL of the e3 API server
104
+ * @param repo - Repository name
105
+ * @param workspace - Workspace name
106
+ * @param path - Path to the dataset
107
+ * @param options - Request options including auth token
108
+ * @returns Dataset status detail including path, type, refType, hash, and size
109
+ * @throws {ApiError} On application-level errors
110
+ * @throws {AuthError} On 401 Unauthorized
42
111
  */
43
- export declare function datasetSet(url: string, workspace: string, path: TreePath, data: Uint8Array): Promise<void>;
112
+ export declare function datasetGetStatus(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<DatasetStatusDetail>;
44
113
  //# sourceMappingURL=datasets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../../src/datasets.ts"],"names":[],"mappings":"A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AC,CAGtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,mBAAmB,CAAC,CAQ9B"}
@@ -2,31 +2,48 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
- import { ArrayType, StringType } from '@elaraai/east';
6
- import { get, unwrap } from './http.js';
5
+ import { ArrayType, NullType, StringType, decodeBeast2For, encodeBeast2For } from '@elaraai/east';
6
+ import { BEAST2_CONTENT_TYPE } from '@elaraai/e3-types';
7
+ import { computeHash } from './util.js';
8
+ import { ApiError, AuthError, fetchWithAuth, parseErrorBody, get } from './http.js';
9
+ import { ResponseType, DatasetStatusDetailType, ListEntryType, TransferUploadRequestType, TransferUploadResponseType, TransferDoneResponseType, } from './types.js';
10
+ function datasetEndpoint(repo, workspace, path) {
11
+ let endpoint = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`;
12
+ if (path.length > 0) {
13
+ const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
14
+ endpoint = `${endpoint}/${pathStr}`;
15
+ }
16
+ return endpoint;
17
+ }
7
18
  /**
8
19
  * List field names at root of workspace dataset tree.
9
20
  *
10
21
  * @param url - Base URL of the e3 API server
22
+ * @param repo - Repository name
11
23
  * @param workspace - Workspace name
24
+ * @param options - Request options including auth token
12
25
  * @returns Array of field names at root
26
+ * @throws {ApiError} On application-level errors
27
+ * @throws {AuthError} On 401 Unauthorized
13
28
  */
14
- export async function datasetList(url, workspace) {
15
- const response = await get(url, `/api/workspaces/${encodeURIComponent(workspace)}/list`, ArrayType(StringType));
16
- return unwrap(response);
29
+ export async function datasetList(url, repo, workspace, options) {
30
+ return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`, ArrayType(StringType), options);
17
31
  }
18
32
  /**
19
33
  * List field names at a path in workspace dataset tree.
20
34
  *
21
35
  * @param url - Base URL of the e3 API server
36
+ * @param repo - Repository name
22
37
  * @param workspace - Workspace name
23
38
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
39
+ * @param options - Request options including auth token
24
40
  * @returns Array of field names at path
41
+ * @throws {ApiError} On application-level errors
42
+ * @throws {AuthError} On 401 Unauthorized
25
43
  */
26
- export async function datasetListAt(url, workspace, path) {
44
+ export async function datasetListAt(url, repo, workspace, path, options) {
27
45
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
28
- const response = await get(url, `/api/workspaces/${encodeURIComponent(workspace)}/list/${pathStr}`, ArrayType(StringType));
29
- return unwrap(response);
46
+ return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}?list=true`, ArrayType(StringType), options);
30
47
  }
31
48
  /**
32
49
  * Get a dataset value as raw BEAST2 bytes.
@@ -35,43 +52,206 @@ export async function datasetListAt(url, workspace, path) {
35
52
  * Use decodeBeast2 or decodeBeast2For to decode with the appropriate type.
36
53
  *
37
54
  * @param url - Base URL of the e3 API server
55
+ * @param repo - Repository name
38
56
  * @param workspace - Workspace name
39
57
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
58
+ * @param options - Request options including auth token
40
59
  * @returns Raw BEAST2 bytes
41
60
  */
42
- export async function datasetGet(url, workspace, path) {
61
+ export async function datasetGet(url, repo, workspace, path, options) {
43
62
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
44
- const response = await fetch(`${url}/api/workspaces/${encodeURIComponent(workspace)}/get/${pathStr}`, {
63
+ const response = await fetchWithAuth(`${url}/api/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}`, {
45
64
  method: 'GET',
46
- headers: {
47
- 'Accept': 'application/beast2',
48
- },
49
- });
65
+ headers: { 'Accept': BEAST2_CONTENT_TYPE },
66
+ }, options);
50
67
  if (!response.ok) {
51
- throw new Error(`Failed to get dataset: ${response.status} ${response.statusText}`);
68
+ const text = await response.text();
69
+ const error = parseErrorBody(text, `http_${response.status}`);
70
+ if (response.status === 401) {
71
+ throw new AuthError(error.details ?? 'Authentication required');
72
+ }
73
+ throw error;
74
+ }
75
+ // Handle redirect response — server returns JSON with download URL for large datasets
76
+ const contentType = response.headers.get('Content-Type') ?? '';
77
+ if (contentType.includes('application/json')) {
78
+ const body = await response.json();
79
+ const redirectResponse = await fetch(body.url, {
80
+ method: 'GET',
81
+ headers: { 'Accept': BEAST2_CONTENT_TYPE },
82
+ });
83
+ if (!redirectResponse.ok) {
84
+ throw new Error(`Failed to get dataset (download): ${redirectResponse.status} ${redirectResponse.statusText}`);
85
+ }
86
+ const buffer = await redirectResponse.arrayBuffer();
87
+ const data = new Uint8Array(buffer);
88
+ const hash = redirectResponse.headers.get('X-Content-SHA256') ?? response.headers.get('X-Content-SHA256') ?? '';
89
+ const size = parseInt(redirectResponse.headers.get('Content-Length') ?? response.headers.get('X-Content-Length') ?? '0', 10);
90
+ return { data, hash, size };
52
91
  }
53
92
  const buffer = await response.arrayBuffer();
54
- return new Uint8Array(buffer);
93
+ const data = new Uint8Array(buffer);
94
+ const hash = response.headers.get('X-Content-SHA256') ?? '';
95
+ const size = parseInt(response.headers.get('Content-Length') ?? '0', 10);
96
+ return { data, hash, size };
55
97
  }
98
+ const SIZE_THRESHOLD = 1 * 1024 * 1024; // 1 MB
56
99
  /**
57
100
  * Set a dataset value from raw BEAST2 bytes.
58
101
  *
102
+ * For payloads > 1MB, uses a transfer flow (init → upload → complete) to
103
+ * avoid inline body size limits. For smaller payloads, uses inline PUT.
104
+ *
59
105
  * @param url - Base URL of the e3 API server
106
+ * @param repo - Repository name
60
107
  * @param workspace - Workspace name
61
108
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
62
109
  * @param data - Raw BEAST2 encoded value
110
+ * @param options - Request options including auth token
63
111
  */
64
- export async function datasetSet(url, workspace, path, data) {
112
+ export async function datasetSet(url, repo, workspace, path, data, options) {
113
+ if (data.byteLength > SIZE_THRESHOLD) {
114
+ return datasetSetTransfer(url, repo, workspace, path, data, options);
115
+ }
65
116
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
66
- const response = await fetch(`${url}/api/workspaces/${encodeURIComponent(workspace)}/set/${pathStr}`, {
117
+ const response = await fetchWithAuth(`${url}/api/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}`, {
67
118
  method: 'PUT',
68
119
  headers: {
69
- 'Content-Type': 'application/beast2',
120
+ 'Content-Type': BEAST2_CONTENT_TYPE,
121
+ 'Accept': BEAST2_CONTENT_TYPE,
70
122
  },
71
123
  body: data,
72
- });
124
+ }, options);
73
125
  if (!response.ok) {
74
126
  throw new Error(`Failed to set dataset: ${response.status} ${response.statusText}`);
75
127
  }
128
+ // Decode BEAST2 response to check for application-level errors
129
+ const buffer = await response.arrayBuffer();
130
+ const decode = decodeBeast2For(ResponseType(NullType));
131
+ const result = decode(new Uint8Array(buffer));
132
+ if (result.type === 'error') {
133
+ throw new ApiError(result.value.type, result.value.value);
134
+ }
135
+ }
136
+ /**
137
+ * Set a large dataset using the transfer flow (init → upload → complete).
138
+ */
139
+ async function datasetSetTransfer(url, repo, workspace, path, data, options) {
140
+ const hash = await computeHash(data);
141
+ const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
142
+ const repoEncoded = encodeURIComponent(repo);
143
+ const wsEncoded = encodeURIComponent(workspace);
144
+ // 1. Init transfer (BEAST2 request/response)
145
+ const encodeInit = encodeBeast2For(TransferUploadRequestType);
146
+ const initRes = await fetchWithAuth(`${url}/api/repos/${repoEncoded}/workspaces/${wsEncoded}/datasets/${pathStr}/upload`, {
147
+ method: 'POST',
148
+ headers: {
149
+ 'Content-Type': BEAST2_CONTENT_TYPE,
150
+ 'Accept': BEAST2_CONTENT_TYPE,
151
+ },
152
+ body: encodeInit({ hash, size: BigInt(data.byteLength) }),
153
+ }, options);
154
+ if (!initRes.ok) {
155
+ throw new Error(`Transfer init failed: ${initRes.status} ${initRes.statusText}`);
156
+ }
157
+ const initBuffer = new Uint8Array(await initRes.arrayBuffer());
158
+ const decodeInit = decodeBeast2For(ResponseType(TransferUploadResponseType));
159
+ const initResult = decodeInit(initBuffer);
160
+ if (initResult.type === 'error') {
161
+ throw new ApiError(initResult.value.type, initResult.value.value);
162
+ }
163
+ const init = initResult.value;
164
+ // Dedup — object already exists, ref updated
165
+ if (init.type === 'completed')
166
+ return;
167
+ // 2. Upload to staging (no auth — URL may be a presigned S3 URL)
168
+ const uploadRes = await fetch(init.value.uploadUrl, {
169
+ method: 'PUT',
170
+ headers: {
171
+ 'Content-Type': BEAST2_CONTENT_TYPE,
172
+ 'Accept': BEAST2_CONTENT_TYPE,
173
+ },
174
+ body: data,
175
+ });
176
+ if (!uploadRes.ok) {
177
+ throw new Error(`Transfer upload failed: ${uploadRes.status} ${uploadRes.statusText}`);
178
+ }
179
+ // 3. Commit — server verifies hash + updates ref (BEAST2 response)
180
+ const commitRes = await fetchWithAuth(`${url}/api/repos/${repoEncoded}/workspaces/${wsEncoded}/datasets/${pathStr}/upload/${init.value.id}`, {
181
+ method: 'POST',
182
+ headers: { 'Accept': BEAST2_CONTENT_TYPE },
183
+ }, options);
184
+ if (!commitRes.ok) {
185
+ throw new Error(`Transfer commit failed: ${commitRes.status} ${commitRes.statusText}`);
186
+ }
187
+ const commitBuffer = new Uint8Array(await commitRes.arrayBuffer());
188
+ const decodeDone = decodeBeast2For(ResponseType(TransferDoneResponseType));
189
+ const commitResult = decodeDone(commitBuffer);
190
+ if (commitResult.type === 'error') {
191
+ throw new ApiError(commitResult.value.type, commitResult.value.value);
192
+ }
193
+ if (commitResult.value.type === 'error') {
194
+ throw new Error(`Transfer failed: ${commitResult.value.value.message}`);
195
+ }
196
+ }
197
+ /**
198
+ * List all entries recursively under a path (flat list of datasets and trees).
199
+ *
200
+ * @param url - Base URL of the e3 API server
201
+ * @param repo - Repository name
202
+ * @param workspace - Workspace name
203
+ * @param path - Starting path (empty for root)
204
+ * @param options - Request options including auth token
205
+ * @returns Array of list entries (dataset or tree variants) with path, type, hash, and size
206
+ * @throws {ApiError} On application-level errors
207
+ * @throws {AuthError} On 401 Unauthorized
208
+ */
209
+ export async function datasetListRecursive(url, repo, workspace, path, options) {
210
+ const endpoint = `${datasetEndpoint(repo, workspace, path)}?list=true&recursive=true&status=true`;
211
+ return get(url, endpoint, ArrayType(ListEntryType), options);
212
+ }
213
+ /**
214
+ * List all descendant dataset paths recursively (paths only, no types/status).
215
+ *
216
+ * @param url - Base URL of the e3 API server
217
+ * @param repo - Repository name
218
+ * @param workspace - Workspace name
219
+ * @param path - Starting path (empty for root)
220
+ * @param options - Request options including auth token
221
+ * @returns Array of dataset path strings
222
+ */
223
+ export async function datasetListRecursivePaths(url, repo, workspace, path, options) {
224
+ const endpoint = `${datasetEndpoint(repo, workspace, path)}?list=true&recursive=true`;
225
+ return get(url, endpoint, ArrayType(StringType), options);
226
+ }
227
+ /**
228
+ * List immediate children with type, hash, and size details.
229
+ *
230
+ * @param url - Base URL of the e3 API server
231
+ * @param repo - Repository name
232
+ * @param workspace - Workspace name
233
+ * @param path - Path to list (empty for root)
234
+ * @param options - Request options including auth token
235
+ * @returns Array of list entries (dataset or tree variants) with path, type, hash, and size
236
+ */
237
+ export async function datasetListWithStatus(url, repo, workspace, path, options) {
238
+ const endpoint = `${datasetEndpoint(repo, workspace, path)}?list=true&status=true`;
239
+ return get(url, endpoint, ArrayType(ListEntryType), options);
240
+ }
241
+ /**
242
+ * Get status detail for a single dataset.
243
+ *
244
+ * @param url - Base URL of the e3 API server
245
+ * @param repo - Repository name
246
+ * @param workspace - Workspace name
247
+ * @param path - Path to the dataset
248
+ * @param options - Request options including auth token
249
+ * @returns Dataset status detail including path, type, refType, hash, and size
250
+ * @throws {ApiError} On application-level errors
251
+ * @throws {AuthError} On 401 Unauthorized
252
+ */
253
+ export async function datasetGetStatus(url, repo, workspace, path, options) {
254
+ const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
255
+ return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}?status=true`, DatasetStatusDetailType, options);
76
256
  }
77
257
  //# sourceMappingURL=datasets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.js","sourceRoot":"","sources":["../../src/datasets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,SAAiB;IAC9D,MAAM,QAAQ,GAAG,MAAM,GAAG,CACxB,GAAG,EACH,mBAAmB,kBAAkB,CAAC,SAAS,CAAC,OAAO,EACvD,SAAS,CAAC,UAAU,CAAC,CACtB,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,GAAW,EACX,SAAiB,EACjB,IAAc;IAEd,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrE,MAAM,QAAQ,GAAG,MAAM,GAAG,CACxB,GAAG,EACH,mBAAmB,kBAAkB,CAAC,SAAS,CAAC,SAAS,OAAO,EAAE,EAClE,SAAS,CAAC,UAAU,CAAC,CACtB,CAAC;IACF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CA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