@elaraai/e3-api-client 0.0.2-beta.5 → 0.0.2-beta.51

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 (50) hide show
  1. package/README.md +2 -2
  2. package/dist/src/datasets.d.ts +73 -4
  3. package/dist/src/datasets.d.ts.map +1 -1
  4. package/dist/src/datasets.js +194 -19
  5. package/dist/src/datasets.js.map +1 -1
  6. package/dist/src/executions.d.ts +74 -11
  7. package/dist/src/executions.d.ts.map +1 -1
  8. package/dist/src/executions.js +184 -36
  9. package/dist/src/executions.js.map +1 -1
  10. package/dist/src/http.d.ts +67 -12
  11. package/dist/src/http.d.ts.map +1 -1
  12. package/dist/src/http.js +168 -34
  13. package/dist/src/http.js.map +1 -1
  14. package/dist/src/index.d.ts +9 -6
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +11 -5
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/packages.d.ts +32 -27
  19. package/dist/src/packages.d.ts.map +1 -1
  20. package/dist/src/packages.js +175 -39
  21. package/dist/src/packages.js.map +1 -1
  22. package/dist/src/platform.d.ts +553 -1343
  23. package/dist/src/platform.d.ts.map +1 -1
  24. package/dist/src/platform.js +123 -915
  25. package/dist/src/platform.js.map +1 -1
  26. package/dist/src/repos.d.ts +16 -0
  27. package/dist/src/repos.d.ts.map +1 -0
  28. package/dist/src/repos.js +19 -0
  29. package/dist/src/repos.js.map +1 -0
  30. package/dist/src/repository.d.ts +67 -5
  31. package/dist/src/repository.d.ts.map +1 -1
  32. package/dist/src/repository.js +94 -10
  33. package/dist/src/repository.js.map +1 -1
  34. package/dist/src/tasks.d.ts +25 -3
  35. package/dist/src/tasks.d.ts.map +1 -1
  36. package/dist/src/tasks.js +29 -8
  37. package/dist/src/tasks.js.map +1 -1
  38. package/dist/src/types.d.ts +755 -1251
  39. package/dist/src/types.d.ts.map +1 -1
  40. package/dist/src/types.js +62 -453
  41. package/dist/src/types.js.map +1 -1
  42. package/dist/src/util.d.ts +21 -0
  43. package/dist/src/util.d.ts.map +1 -0
  44. package/dist/src/util.js +26 -0
  45. package/dist/src/util.js.map +1 -0
  46. package/dist/src/workspaces.d.ts +51 -9
  47. package/dist/src/workspaces.d.ts.map +1 -1
  48. package/dist/src/workspaces.js +87 -26
  49. package/dist/src/workspaces.js.map +1 -1
  50. package/package.json +4 -4
package/dist/src/http.js CHANGED
@@ -3,29 +3,110 @@
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
5
  import { encodeBeast2For, decodeBeast2For } from '@elaraai/east';
6
+ import { BEAST2_CONTENT_TYPE } from '@elaraai/e3-types';
6
7
  import { ResponseType } from './types.js';
8
+ /**
9
+ * API error with typed error details.
10
+ */
11
+ export class ApiError extends Error {
12
+ code;
13
+ details;
14
+ constructor(code, details) {
15
+ super(`API error: ${code}`);
16
+ this.code = code;
17
+ this.details = details;
18
+ this.name = 'ApiError';
19
+ }
20
+ }
21
+ /**
22
+ * Authentication error (401 response).
23
+ */
24
+ export class AuthError extends Error {
25
+ constructor(message) {
26
+ super(`Authentication failed: ${message}`);
27
+ this.name = 'AuthError';
28
+ }
29
+ }
30
+ /**
31
+ * Fetch with consistent auth header injection and 401 → AuthError handling.
32
+ *
33
+ * Use this for multi-step transfer flows where raw `fetch` is needed
34
+ * (e.g. upload/download to presigned URLs, polling endpoints).
35
+ */
36
+ export async function fetchWithAuth(input, init, options) {
37
+ const headers = { ...init.headers };
38
+ if (options.token) {
39
+ headers['Authorization'] = `Bearer ${options.token}`;
40
+ }
41
+ const response = await fetch(input, { ...init, headers });
42
+ if (response.status === 401) {
43
+ throw new AuthError(await response.text());
44
+ }
45
+ return response;
46
+ }
47
+ /**
48
+ * Parse error details from response text.
49
+ * Returns an ApiError with the error code from the body if available, otherwise uses fallback.
50
+ */
51
+ function parseErrorBody(text, fallbackCode) {
52
+ try {
53
+ const json = JSON.parse(text);
54
+ if (json.error?.type) {
55
+ return new ApiError(json.error.type, json.error.message);
56
+ }
57
+ if (json.message) {
58
+ return new ApiError(fallbackCode, json.message);
59
+ }
60
+ }
61
+ catch {
62
+ // Not JSON
63
+ }
64
+ return new ApiError(fallbackCode, text || undefined);
65
+ }
66
+ /** HTTP status code to error code mapping */
67
+ const STATUS_CODES = {
68
+ 400: 'bad_request',
69
+ 401: 'unauthorized',
70
+ 403: 'forbidden',
71
+ 404: 'not_found',
72
+ 405: 'method_not_allowed',
73
+ 409: 'conflict',
74
+ 415: 'unsupported_media_type',
75
+ 422: 'unprocessable_entity',
76
+ 429: 'too_many_requests',
77
+ 500: 'internal_server_error',
78
+ 502: 'bad_gateway',
79
+ 503: 'service_unavailable',
80
+ 504: 'gateway_timeout',
81
+ };
7
82
  /**
8
83
  * Make a GET request and decode BEAST2 response.
84
+ * @throws {ApiError} On application-level errors
85
+ * @throws {AuthError} On 401 Unauthorized
9
86
  */
10
- export async function get(url, path, successType) {
11
- const response = await fetch(`${url}${path}`, {
87
+ export async function get(url, path, successType, options) {
88
+ const response = await fetch(`${url}/api${path}`, {
12
89
  method: 'GET',
13
90
  headers: {
14
- 'Accept': 'application/beast2',
91
+ 'Accept': BEAST2_CONTENT_TYPE,
92
+ ...(options.token ? { 'Authorization': `Bearer ${options.token}` } : {}),
15
93
  },
16
94
  });
17
95
  return decodeResponse(response, successType);
18
96
  }
19
97
  /**
20
98
  * Make a POST request with BEAST2 body and decode BEAST2 response.
99
+ * @throws {ApiError} On application-level errors
100
+ * @throws {AuthError} On 401 Unauthorized
21
101
  */
22
- export async function post(url, path, body, requestType, successType) {
102
+ export async function post(url, path, body, requestType, successType, options) {
23
103
  const encode = encodeBeast2For(requestType);
24
- const response = await fetch(`${url}${path}`, {
104
+ const response = await fetch(`${url}/api${path}`, {
25
105
  method: 'POST',
26
106
  headers: {
27
- 'Content-Type': 'application/beast2',
28
- 'Accept': 'application/beast2',
107
+ 'Content-Type': BEAST2_CONTENT_TYPE,
108
+ 'Accept': BEAST2_CONTENT_TYPE,
109
+ ...(options.token ? { 'Authorization': `Bearer ${options.token}` } : {}),
29
110
  },
30
111
  body: encode(body),
31
112
  });
@@ -33,14 +114,17 @@ export async function post(url, path, body, requestType, successType) {
33
114
  }
34
115
  /**
35
116
  * Make a PUT request with BEAST2 body and decode BEAST2 response.
117
+ * @throws {ApiError} On application-level errors
118
+ * @throws {AuthError} On 401 Unauthorized
36
119
  */
37
- export async function put(url, path, body, requestType, successType) {
120
+ export async function put(url, path, body, requestType, successType, options) {
38
121
  const encode = encodeBeast2For(requestType);
39
- const response = await fetch(`${url}${path}`, {
122
+ const response = await fetch(`${url}/api${path}`, {
40
123
  method: 'PUT',
41
124
  headers: {
42
- 'Content-Type': 'application/beast2',
43
- 'Accept': 'application/beast2',
125
+ 'Content-Type': BEAST2_CONTENT_TYPE,
126
+ 'Accept': BEAST2_CONTENT_TYPE,
127
+ ...(options.token ? { 'Authorization': `Bearer ${options.token}` } : {}),
44
128
  },
45
129
  body: encode(body),
46
130
  });
@@ -48,32 +132,95 @@ export async function put(url, path, body, requestType, successType) {
48
132
  }
49
133
  /**
50
134
  * Make a DELETE request and decode BEAST2 response.
135
+ * @throws {ApiError} On application-level errors
136
+ * @throws {AuthError} On 401 Unauthorized
51
137
  */
52
- export async function del(url, path, successType) {
53
- const response = await fetch(`${url}${path}`, {
138
+ export async function del(url, path, successType, options) {
139
+ const response = await fetch(`${url}/api${path}`, {
54
140
  method: 'DELETE',
55
141
  headers: {
56
- 'Accept': 'application/beast2',
142
+ 'Accept': BEAST2_CONTENT_TYPE,
143
+ ...(options.token ? { 'Authorization': `Bearer ${options.token}` } : {}),
144
+ },
145
+ });
146
+ return decodeResponse(response, successType);
147
+ }
148
+ /**
149
+ * Make a PUT request without body and decode BEAST2 response.
150
+ * @throws {ApiError} On application-level errors
151
+ * @throws {AuthError} On 401 Unauthorized
152
+ */
153
+ export async function putEmpty(url, path, successType, options) {
154
+ const response = await fetch(`${url}/api${path}`, {
155
+ method: 'PUT',
156
+ headers: {
157
+ 'Accept': BEAST2_CONTENT_TYPE,
158
+ ...(options.token ? { 'Authorization': `Bearer ${options.token}` } : {}),
57
159
  },
58
160
  });
59
161
  return decodeResponse(response, successType);
60
162
  }
61
163
  /**
62
- * Decode a BEAST2 response with the Response wrapper type.
164
+ * Decode a BEAST2 response, throwing on errors.
165
+ * @throws {ApiError} On application-level errors (including BEAST2 error responses)
166
+ * @throws {AuthError} On 401 Unauthorized
63
167
  */
64
168
  async function decodeResponse(response, successType) {
65
- if (response.status === 400) {
66
- throw new Error(`Bad request: ${await response.text()}`);
67
- }
68
- if (response.status === 415) {
69
- throw new Error(`Unsupported media type: expected application/beast2`);
169
+ // Handle HTTP-level errors
170
+ if (!response.ok) {
171
+ const text = await response.text();
172
+ const error = parseErrorBody(text, STATUS_CODES[response.status] ?? `http_${response.status}`);
173
+ if (response.status === 401) {
174
+ throw new AuthError(error.details ?? 'Authentication required');
175
+ }
176
+ throw error;
70
177
  }
178
+ // Decode BEAST2 response
71
179
  const buffer = await response.arrayBuffer();
72
180
  const decode = decodeBeast2For(ResponseType(successType));
73
- return decode(new Uint8Array(buffer));
181
+ const result = decode(new Uint8Array(buffer));
182
+ // Handle application-level errors in BEAST2 response
183
+ if (result.type === 'error') {
184
+ throw new ApiError(result.value.type, result.value.value);
185
+ }
186
+ return result.value;
187
+ }
188
+ /**
189
+ * Fetch a URL with streaming download progress reporting.
190
+ *
191
+ * Falls back to a single `arrayBuffer()` call if no `onProgress` callback
192
+ * is provided or if the response has no readable body stream.
193
+ */
194
+ export async function fetchWithProgress(url, onProgress, signal) {
195
+ const res = await fetch(url, { method: 'GET', signal });
196
+ if (!res.ok)
197
+ throw new Error(`Download failed: ${res.status} ${res.statusText}`);
198
+ if (!onProgress || !res.body) {
199
+ return new Uint8Array(await res.arrayBuffer());
200
+ }
201
+ const total = parseInt(res.headers.get('Content-Length') ?? '0', 10);
202
+ const reader = res.body.getReader();
203
+ const chunks = [];
204
+ let downloaded = 0;
205
+ for (;;) {
206
+ const { done, value } = await reader.read();
207
+ if (done)
208
+ break;
209
+ chunks.push(value);
210
+ downloaded += value.byteLength;
211
+ onProgress(downloaded, total);
212
+ }
213
+ const result = new Uint8Array(downloaded);
214
+ let offset = 0;
215
+ for (const chunk of chunks) {
216
+ result.set(chunk, offset);
217
+ offset += chunk.byteLength;
218
+ }
219
+ return result;
74
220
  }
75
221
  /**
76
222
  * Unwrap a response, throwing on error.
223
+ * @deprecated Functions now throw ApiError on error; this function is no longer needed.
77
224
  */
78
225
  export function unwrap(response) {
79
226
  if (response.type === 'error') {
@@ -82,17 +229,4 @@ export function unwrap(response) {
82
229
  }
83
230
  return response.value;
84
231
  }
85
- /**
86
- * API error with typed error details.
87
- */
88
- export class ApiError extends Error {
89
- code;
90
- details;
91
- constructor(code, details) {
92
- super(`API error: ${code}`);
93
- this.code = code;
94
- this.details = details;
95
- this.name = 'ApiError';
96
- }
97
- }
98
232
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAa,MAAM,YAAY,CAAC;AAMrD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,GAAG,CACvB,GAAW,EACX,IAAY,EACZ,WAAc;IAEd,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,EAAE,EAAE;QAC5C,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,QAAQ,EAAE,oBAAoB;SAC/B;KACF,CAAC,CAAC;IAEH,OAAO,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,GAAW,EACX,IAAY,EACZ,IAAsB,EACtB,WAAgB,EAChB,WAAgB;IAEhB,MAAM,MAAM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export { ApiTypes } from './types.js';
12
- export type { RepositoryStatus, GcRequest, GcResult, PackageListItem, PackageImportResult, WorkspaceInfo, WorkspaceStatusResult, DatasetStatus, DatasetStatusInfo, TaskStatus, TaskStatusInfo, WorkspaceStatusSummary, TaskListItem, TaskDetails, DataflowGraph, GraphTask, LogChunk, TaskExecutionResult, DataflowResult, } from './types.js';
13
- export { repoStatus, repoGc } from './repository.js';
14
- export { packageList, packageGet, packageImport, packageExport, packageRemove, } from './packages.js';
12
+ export type { RepositoryStatus, GcRequest, GcResult, GcStartResult, GcStatusResult, AsyncOperationStatus, PackageListItem, PackageImportResult, WorkspaceInfo, WorkspaceStatusResult, DatasetStatus, DatasetStatusInfo, TaskStatus, TaskStatusInfo, WorkspaceStatusSummary, TaskListItem, TaskDetails, DataflowGraph, DataflowGraphTask, LogChunk, TaskExecutionResult, DataflowResult, DataflowEvent, ExecutionStatus, DataflowExecutionSummary, DataflowExecutionState, ExecutionListItem, ExecutionHistoryStatus, TreeKind, ListEntry, DatasetStatusDetail, } from './types.js';
13
+ export { ApiError, AuthError, fetchWithAuth, get, post, put, del, putEmpty, unwrap } from './http.js';
14
+ export type { RequestOptions, Response } from './http.js';
15
+ export { repoStatus, repoGc, repoGcStart, repoGcStatus, repoCreate, repoRemove, } from './repository.js';
16
+ export { repoList } from './repos.js';
17
+ export { packageList, packageGet, packageImport, packageExport, packageRemove, pollExport, } from './packages.js';
15
18
  export { workspaceList, workspaceCreate, workspaceGet, workspaceStatus, workspaceRemove, workspaceDeploy, workspaceExport, } from './workspaces.js';
16
- export { datasetList, datasetListAt, datasetGet, datasetSet, } from './datasets.js';
17
- export { taskList, taskGet } from './tasks.js';
18
- export { dataflowStart, dataflowExecute, dataflowGraph, taskLogs, type DataflowOptions, type LogOptions, } from './executions.js';
19
+ export { datasetList, datasetListAt, datasetListRecursive, datasetListRecursivePaths, datasetListWithStatus, datasetGet, datasetGetStatus, datasetSet, } from './datasets.js';
20
+ export { taskList, taskGet, taskExecutionList } from './tasks.js';
21
+ export { dataflowExecute, dataflowExecuteLaunch, dataflowExecutePoll, dataflowGraph, dataflowCancel, taskLogs, dataflowStart, dataflowExecution, type DataflowOptions, type DataflowPollOptions, type LogOptions, type ExecutionStateOptions, } from './executions.js';
19
22
  export { Platform, PlatformImpl, LogOptionsType, platform_repo_status, platform_repo_gc, platform_package_list, platform_package_get, platform_package_import, platform_package_export, platform_package_remove, platform_workspace_list, platform_workspace_create, platform_workspace_get, platform_workspace_status, platform_workspace_remove, platform_workspace_deploy, platform_workspace_export, platform_dataset_list, platform_dataset_list_at, platform_dataset_get, platform_dataset_set, platform_task_list, platform_task_get, platform_dataflow_start, platform_dataflow_execute, platform_dataflow_graph, platform_task_logs, } from './platform.js';
20
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,cAAc,GACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,GACX,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,QAAQ,EACR,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,S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qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
package/dist/src/index.js CHANGED
@@ -10,18 +10,24 @@
10
10
  */
11
11
  // Types
12
12
  export { ApiTypes } from './types.js';
13
+ // HTTP utilities and auth
14
+ export { ApiError, AuthError, fetchWithAuth, get, post, put, del, putEmpty, unwrap } from './http.js';
13
15
  // Repository
14
- export { repoStatus, repoGc } from './repository.js';
16
+ export { repoStatus, repoGc, repoGcStart, repoGcStatus, repoCreate, repoRemove, } from './repository.js';
17
+ // Repos (multi-repo operations)
18
+ export { repoList } from './repos.js';
15
19
  // Packages
16
- export { packageList, packageGet, packageImport, packageExport, packageRemove, } from './packages.js';
20
+ export { packageList, packageGet, packageImport, packageExport, packageRemove, pollExport, } from './packages.js';
17
21
  // Workspaces
18
22
  export { workspaceList, workspaceCreate, workspaceGet, workspaceStatus, workspaceRemove, workspaceDeploy, workspaceExport, } from './workspaces.js';
19
23
  // Datasets
20
- export { datasetList, datasetListAt, datasetGet, datasetSet, } from './datasets.js';
24
+ export { datasetList, datasetListAt, datasetListRecursive, datasetListRecursivePaths, datasetListWithStatus, datasetGet, datasetGetStatus, datasetSet, } from './datasets.js';
21
25
  // Tasks
22
- export { taskList, taskGet } from './tasks.js';
26
+ export { taskList, taskGet, taskExecutionList } from './tasks.js';
23
27
  // Executions
24
- export { dataflowStart, dataflowExecute, dataflowGraph, taskLogs, } from './executions.js';
28
+ export { dataflowExecute, dataflowExecuteLaunch, dataflowExecutePoll, dataflowGraph, dataflowCancel, taskLogs,
29
+ // Backward compatibility aliases
30
+ dataflowStart, dataflowExecution, } from './executions.js';
25
31
  // Platform functions
26
32
  export { Platform, PlatformImpl, LogOptionsType, platform_repo_status, platform_repo_gc, platform_package_list, platform_package_get, platform_package_import, platform_package_export, platform_package_remove, platform_workspace_list, platform_workspace_create, platform_workspace_get, platform_workspace_status, platform_workspace_remove, platform_workspace_deploy, platform_workspace_export, platform_dataset_list, platform_dataset_list_at, platform_dataset_get, platform_dataset_set, platform_task_list, platform_task_get, platform_dataflow_start, platform_dataflow_execute, platform_dataflow_graph, platform_task_logs, } from './platform.js';
27
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,QAAQ;AACR,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAuBtC,aAAa;AACb,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAErD,WAAW;AACX,OAAO,EACL,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,aAAa;AACb,OAAO,EACL,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,WAAW;AACX,OAAO,EACL,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,GACX,MAAM,eAAe,CAAC;AAEvB,QAAQ;AACR,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE/C,aAAa;AACb,OAAO,EACL,aAAa,EACb,eAAe,EACf,aAAa,EACb,QAAQ,GAGT,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,E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,iCAAiC;AACjC,aAAa,EACb,iBAAiB,GAKlB,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
@@ -3,46 +3,51 @@
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
5
  import { type PackageObject } from '@elaraai/e3-types';
6
- import type { PackageListItem, PackageImportResult } from './types.js';
6
+ import { type PackageImportProgress, type PackageExportProgress, type PackageImportResult, type PackageExportStatus } from '@elaraai/e3-types';
7
+ import type { PackageListItem } from './types.js';
8
+ import { type RequestOptions } from './http.js';
7
9
  /**
8
10
  * List all packages in the repository.
9
- *
10
- * @param url - Base URL of the e3 API server
11
- * @returns Array of package info (name, version)
12
11
  */
13
- export declare function packageList(url: string): Promise<PackageListItem[]>;
12
+ export declare function packageList(url: string, repo: string, options: RequestOptions): Promise<PackageListItem[]>;
14
13
  /**
15
14
  * Get package object.
16
- *
17
- * @param url - Base URL of the e3 API server
18
- * @param name - Package name
19
- * @param version - Package version
20
- * @returns Package object
21
15
  */
22
- export declare function packageGet(url: string, name: string, version: string): Promise<PackageObject>;
16
+ export declare function packageGet(url: string, repo: string, name: string, version: string, options: RequestOptions): Promise<PackageObject>;
23
17
  /**
24
- * Import a package from a zip archive.
18
+ * Options for package import progress reporting.
19
+ */
20
+ export interface PackageImportOptions {
21
+ onProgress?: (progress: PackageImportProgress) => void;
22
+ onUploadProgress?: (uploaded: number, total: number) => void;
23
+ signal?: AbortSignal;
24
+ }
25
+ /**
26
+ * Import a package from a zip archive using the transfer protocol.
25
27
  *
26
- * @param url - Base URL of the e3 API server
27
- * @param archive - Zip archive as bytes
28
- * @returns Imported package info
28
+ * Flow: init upload upload zip trigger import → poll for result
29
29
  */
30
- export declare function packageImport(url: string, archive: Uint8Array): Promise<PackageImportResult>;
30
+ export declare function packageImport(url: string, repo: string, archive: Uint8Array, options: RequestOptions, importOptions?: PackageImportOptions): Promise<PackageImportResult>;
31
31
  /**
32
- * Export a package as a zip archive.
32
+ * Options for package export progress reporting.
33
+ */
34
+ export interface PackageExportOptions {
35
+ onProgress?: (progress: PackageExportProgress) => void;
36
+ onDownloadProgress?: (downloaded: number, total: number) => void;
37
+ signal?: AbortSignal;
38
+ }
39
+ /**
40
+ * Export a package as a zip archive using the transfer protocol.
33
41
  *
34
- * @param url - Base URL of the e3 API server
35
- * @param name - Package name
36
- * @param version - Package version
37
- * @returns Zip archive as bytes
42
+ * Flow: trigger export poll for result download zip
38
43
  */
39
- export declare function packageExport(url: string, name: string, version: string): Promise<Uint8Array>;
44
+ export declare function packageExport(url: string, repo: string, name: string, version: string, options: RequestOptions, exportOptions?: PackageExportOptions): Promise<Uint8Array>;
40
45
  /**
41
46
  * Remove a package from the repository.
42
- *
43
- * @param url - Base URL of the e3 API server
44
- * @param name - Package name
45
- * @param version - Package version
46
47
  */
47
- export declare function packageRemove(url: string, name: string, version: string): Promise<void>;
48
+ export declare function packageRemove(url: string, repo: string, name: string, version: string, options: RequestOptions): Promise<void>;
49
+ /**
50
+ * Poll a package export job until it completes or fails.
51
+ */
52
+ export declare function pollExport(url: string, repoEncoded: string, id: string, options: RequestOptions, onProgress?: (progress: PackageExportProgress) => void, signal?: AbortSignal, intervalMs?: number): Promise<PackageExportStatus>;
48
53
  //# sourceMappingURL=packages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAIvE;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAGzE;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,mBAAmB,CAAC,CAG9B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC,CAOrB;AAED;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAOf"}
1
+ {"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAML,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,OAAO,EAAwD,KAAK,cAAc,EAAiB,MAAM,WAAW,CAAC;AAErH;;GA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