@elaraai/e3-api-client 0.0.2-beta.11 → 0.0.2-beta.13

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 (42) hide show
  1. package/README.md +1 -1
  2. package/dist/src/datasets.d.ts +25 -4
  3. package/dist/src/datasets.d.ts.map +1 -1
  4. package/dist/src/datasets.js +45 -8
  5. package/dist/src/datasets.js.map +1 -1
  6. package/dist/src/executions.d.ts +40 -8
  7. package/dist/src/executions.d.ts.map +1 -1
  8. package/dist/src/executions.js +59 -27
  9. package/dist/src/executions.js.map +1 -1
  10. package/dist/src/http.d.ts +23 -4
  11. package/dist/src/http.d.ts.map +1 -1
  12. package/dist/src/http.js +68 -8
  13. package/dist/src/http.js.map +1 -1
  14. package/dist/src/index.d.ts +7 -5
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +6 -4
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/packages.d.ts +16 -5
  19. package/dist/src/packages.d.ts.map +1 -1
  20. package/dist/src/packages.js +20 -10
  21. package/dist/src/packages.js.map +1 -1
  22. package/dist/src/platform.d.ts +62 -878
  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/repository.d.ts +80 -5
  27. package/dist/src/repository.d.ts.map +1 -1
  28. package/dist/src/repository.js +128 -8
  29. package/dist/src/repository.js.map +1 -1
  30. package/dist/src/tasks.d.ts +19 -3
  31. package/dist/src/tasks.d.ts.map +1 -1
  32. package/dist/src/tasks.js +23 -5
  33. package/dist/src/tasks.js.map +1 -1
  34. package/dist/src/types.d.ts +486 -1
  35. package/dist/src/types.d.ts.map +1 -1
  36. package/dist/src/types.js +209 -2
  37. package/dist/src/types.js.map +1 -1
  38. package/dist/src/workspaces.d.ts +22 -7
  39. package/dist/src/workspaces.d.ts.map +1 -1
  40. package/dist/src/workspaces.js +28 -14
  41. package/dist/src/workspaces.js.map +1 -1
  42. package/package.json +4 -4
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, ... }
@@ -3,23 +3,29 @@
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 DatasetListItem } 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
12
16
  */
13
- export declare function datasetList(url: string, workspace: string): Promise<string[]>;
17
+ export declare function datasetList(url: string, repo: string, workspace: string, options: RequestOptions): Promise<string[]>;
14
18
  /**
15
19
  * List field names at a path in workspace dataset tree.
16
20
  *
17
21
  * @param url - Base URL of the e3 API server
22
+ * @param repo - Repository name
18
23
  * @param workspace - Workspace name
19
24
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
25
+ * @param options - Request options including auth token
20
26
  * @returns Array of field names at path
21
27
  */
22
- export declare function datasetListAt(url: string, workspace: string, path: TreePath): Promise<string[]>;
28
+ export declare function datasetListAt(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<string[]>;
23
29
  /**
24
30
  * Get a dataset value as raw BEAST2 bytes.
25
31
  *
@@ -27,18 +33,33 @@ export declare function datasetListAt(url: string, workspace: string, path: Tree
27
33
  * Use decodeBeast2 or decodeBeast2For to decode with the appropriate type.
28
34
  *
29
35
  * @param url - Base URL of the e3 API server
36
+ * @param repo - Repository name
30
37
  * @param workspace - Workspace name
31
38
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
39
+ * @param options - Request options including auth token
32
40
  * @returns Raw BEAST2 bytes
33
41
  */
34
- export declare function datasetGet(url: string, workspace: string, path: TreePath): Promise<Uint8Array>;
42
+ export declare function datasetGet(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<Uint8Array>;
35
43
  /**
36
44
  * Set a dataset value from raw BEAST2 bytes.
37
45
  *
38
46
  * @param url - Base URL of the e3 API server
47
+ * @param repo - Repository name
39
48
  * @param workspace - Workspace name
40
49
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
41
50
  * @param data - Raw BEAST2 encoded value
51
+ * @param options - Request options including auth token
42
52
  */
43
- export declare function datasetSet(url: string, workspace: string, path: TreePath, data: Uint8Array): Promise<void>;
53
+ export declare function datasetSet(url: string, repo: string, workspace: string, path: TreePath, data: Uint8Array, options: RequestOptions): Promise<void>;
54
+ /**
55
+ * List all datasets recursively under a path (flat list).
56
+ *
57
+ * @param url - Base URL of the e3 API server
58
+ * @param repo - Repository name
59
+ * @param workspace - Workspace name
60
+ * @param path - Starting path (empty for root)
61
+ * @param options - Request options including auth token
62
+ * @returns Array of dataset items with path, type, hash, and size
63
+ */
64
+ export declare function datasetListRecursive(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<DatasetListItem[]>;
44
65
  //# sourceMappingURL=datasets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datasets.d.ts","sourceRoot":"","sources":["../../src/datasets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC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,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,UAAU,CAAC,CAuBrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,EAAE,CAAC,CAU5B"}
@@ -4,28 +4,33 @@
4
4
  */
5
5
  import { ArrayType, StringType } from '@elaraai/east';
6
6
  import { get, unwrap } from './http.js';
7
+ import { DatasetListItemType } from './types.js';
7
8
  /**
8
9
  * List field names at root of workspace dataset tree.
9
10
  *
10
11
  * @param url - Base URL of the e3 API server
12
+ * @param repo - Repository name
11
13
  * @param workspace - Workspace name
14
+ * @param options - Request options including auth token
12
15
  * @returns Array of field names at root
13
16
  */
14
- export async function datasetList(url, workspace) {
15
- const response = await get(url, `/api/workspaces/${encodeURIComponent(workspace)}/list`, ArrayType(StringType));
17
+ export async function datasetList(url, repo, workspace, options) {
18
+ const response = await get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`, ArrayType(StringType), options);
16
19
  return unwrap(response);
17
20
  }
18
21
  /**
19
22
  * List field names at a path in workspace dataset tree.
20
23
  *
21
24
  * @param url - Base URL of the e3 API server
25
+ * @param repo - Repository name
22
26
  * @param workspace - Workspace name
23
27
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
28
+ * @param options - Request options including auth token
24
29
  * @returns Array of field names at path
25
30
  */
26
- export async function datasetListAt(url, workspace, path) {
31
+ export async function datasetListAt(url, repo, workspace, path, options) {
27
32
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
28
- const response = await get(url, `/api/workspaces/${encodeURIComponent(workspace)}/list/${pathStr}`, ArrayType(StringType));
33
+ const response = await get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}?list=true`, ArrayType(StringType), options);
29
34
  return unwrap(response);
30
35
  }
31
36
  /**
@@ -35,18 +40,24 @@ export async function datasetListAt(url, workspace, path) {
35
40
  * Use decodeBeast2 or decodeBeast2For to decode with the appropriate type.
36
41
  *
37
42
  * @param url - Base URL of the e3 API server
43
+ * @param repo - Repository name
38
44
  * @param workspace - Workspace name
39
45
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
46
+ * @param options - Request options including auth token
40
47
  * @returns Raw BEAST2 bytes
41
48
  */
42
- export async function datasetGet(url, workspace, path) {
49
+ export async function datasetGet(url, repo, workspace, path, options) {
43
50
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
44
- const response = await fetch(`${url}/api/workspaces/${encodeURIComponent(workspace)}/get/${pathStr}`, {
51
+ const response = await fetch(`${url}/api/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}`, {
45
52
  method: 'GET',
46
53
  headers: {
47
54
  'Accept': 'application/beast2',
55
+ 'Authorization': `Bearer ${options.token}`,
48
56
  },
49
57
  });
58
+ if (response.status === 401) {
59
+ throw new Error(`Authentication failed: ${await response.text()}`);
60
+ }
50
61
  if (!response.ok) {
51
62
  throw new Error(`Failed to get dataset: ${response.status} ${response.statusText}`);
52
63
  }
@@ -57,21 +68,47 @@ export async function datasetGet(url, workspace, path) {
57
68
  * Set a dataset value from raw BEAST2 bytes.
58
69
  *
59
70
  * @param url - Base URL of the e3 API server
71
+ * @param repo - Repository name
60
72
  * @param workspace - Workspace name
61
73
  * @param path - Path to the dataset (e.g., ['inputs', 'config'])
62
74
  * @param data - Raw BEAST2 encoded value
75
+ * @param options - Request options including auth token
63
76
  */
64
- export async function datasetSet(url, workspace, path, data) {
77
+ export async function datasetSet(url, repo, workspace, path, data, options) {
65
78
  const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
66
- const response = await fetch(`${url}/api/workspaces/${encodeURIComponent(workspace)}/set/${pathStr}`, {
79
+ const response = await fetch(`${url}/api/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}`, {
67
80
  method: 'PUT',
68
81
  headers: {
69
82
  'Content-Type': 'application/beast2',
83
+ 'Authorization': `Bearer ${options.token}`,
70
84
  },
71
85
  body: data,
72
86
  });
87
+ if (response.status === 401) {
88
+ throw new Error(`Authentication failed: ${await response.text()}`);
89
+ }
73
90
  if (!response.ok) {
74
91
  throw new Error(`Failed to set dataset: ${response.status} ${response.statusText}`);
75
92
  }
76
93
  }
94
+ /**
95
+ * List all datasets recursively under a path (flat list).
96
+ *
97
+ * @param url - Base URL of the e3 API server
98
+ * @param repo - Repository name
99
+ * @param workspace - Workspace name
100
+ * @param path - Starting path (empty for root)
101
+ * @param options - Request options including auth token
102
+ * @returns Array of dataset items with path, type, hash, and size
103
+ */
104
+ export async function datasetListRecursive(url, repo, workspace, path, options) {
105
+ let endpoint = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`;
106
+ if (path.length > 0) {
107
+ const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
108
+ endpoint = `${endpoint}/${pathStr}`;
109
+ }
110
+ endpoint = `${endpoint}?recursive=true`;
111
+ const response = await get(url, endpoint, ArrayType(DatasetListItemType), options);
112
+ return unwrap(response);
113
+ }
77
114
  //# 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,MAA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AG,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,0BAA0B,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0BAA0B,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACtF,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,GAAW,EACX,IAAY,EACZ,SAAiB,EACjB,IAAc,EACd,OAAuB;IAEvB,IAAI,QAAQ,GAAG,UAAU,kBAAkB,CAAC,IAAI,CAAC,eAAe,kBAAkB,CAAC,SAAS,CAAC,WAAW,CAAC;IACzG,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,QAAQ,GAAG,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC;IACtC,CAAC;IACD,QAAQ,GAAG,GAAG,QAAQ,iBAAiB,CAAC;IAExC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;IACnF,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Copyright (c) 2025 Elara AI Pty Ltd
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
- import type { LogChunk, DataflowGraph, DataflowResult } from './types.js';
5
+ import type { LogChunk, DataflowGraph, DataflowResult, DataflowExecutionState } from './types.js';
6
+ import { type RequestOptions } from './http.js';
6
7
  /**
7
8
  * Options for starting dataflow execution.
8
9
  */
@@ -21,29 +22,35 @@ export interface DataflowOptions {
21
22
  * Use workspaceStatus() to poll for progress.
22
23
  *
23
24
  * @param url - Base URL of the e3 API server
25
+ * @param repo - Repository name
24
26
  * @param workspace - Workspace name
25
- * @param options - Execution options
27
+ * @param dataflowOptions - Execution options
28
+ * @param options - Request options including auth token
26
29
  */
27
- export declare function dataflowStart(url: string, workspace: string, options?: DataflowOptions): Promise<void>;
30
+ export declare function dataflowStart(url: string, repo: string, workspace: string, dataflowOptions: DataflowOptions | undefined, options: RequestOptions): Promise<void>;
28
31
  /**
29
32
  * Execute dataflow on a workspace (blocking).
30
33
  *
31
34
  * Waits for execution to complete and returns the result.
32
35
  *
33
36
  * @param url - Base URL of the e3 API server
37
+ * @param repo - Repository name
34
38
  * @param workspace - Workspace name
35
- * @param options - Execution options
39
+ * @param dataflowOptions - Execution options
40
+ * @param options - Request options including auth token
36
41
  * @returns Dataflow execution result
37
42
  */
38
- export declare function dataflowExecute(url: string, workspace: string, options?: DataflowOptions): Promise<DataflowResult>;
43
+ export declare function dataflowExecute(url: string, repo: string, workspace: string, dataflowOptions: DataflowOptions | undefined, options: RequestOptions): Promise<DataflowResult>;
39
44
  /**
40
45
  * Get the dependency graph for a workspace.
41
46
  *
42
47
  * @param url - Base URL of the e3 API server
48
+ * @param repo - Repository name
43
49
  * @param workspace - Workspace name
50
+ * @param options - Request options including auth token
44
51
  * @returns Dataflow graph with tasks and dependencies
45
52
  */
46
- export declare function dataflowGraph(url: string, workspace: string): Promise<DataflowGraph>;
53
+ export declare function dataflowGraph(url: string, repo: string, workspace: string, options: RequestOptions): Promise<DataflowGraph>;
47
54
  /**
48
55
  * Options for reading task logs.
49
56
  */
@@ -59,10 +66,35 @@ export interface LogOptions {
59
66
  * Read task logs from a workspace.
60
67
  *
61
68
  * @param url - Base URL of the e3 API server
69
+ * @param repo - Repository name
62
70
  * @param workspace - Workspace name
63
71
  * @param task - Task name
64
- * @param options - Log reading options
72
+ * @param logOptions - Log reading options
73
+ * @param options - Request options including auth token
65
74
  * @returns Log chunk with data and metadata
66
75
  */
67
- export declare function taskLogs(url: string, workspace: string, task: string, options?: LogOptions): Promise<LogChunk>;
76
+ export declare function taskLogs(url: string, repo: string, workspace: string, task: string, logOptions: LogOptions | undefined, options: RequestOptions): Promise<LogChunk>;
77
+ /**
78
+ * Options for getting execution state.
79
+ */
80
+ export interface ExecutionStateOptions {
81
+ /** Skip first N events (default: 0) */
82
+ offset?: number;
83
+ /** Maximum events to return (default: all) */
84
+ limit?: number;
85
+ }
86
+ /**
87
+ * Get dataflow execution state (for polling).
88
+ *
89
+ * Returns the current execution state including events for progress tracking.
90
+ * Use offset/limit for pagination of events.
91
+ *
92
+ * @param url - Base URL of the e3 API server
93
+ * @param repo - Repository name
94
+ * @param workspace - Workspace name
95
+ * @param stateOptions - Pagination options for events
96
+ * @param options - Request options including auth token
97
+ * @returns Execution state with events and summary
98
+ */
99
+ export declare function dataflowExecution(url: string, repo: string, workspace: string, stateOptions: ExecutionStateOptions | undefined, options: RequestOptions): Promise<DataflowExecutionState>;
68
100
  //# sourceMappingURL=executions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executions.d.ts","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAS1E;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,IAAI,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B,CAAC,CAUjC"}
@@ -3,7 +3,7 @@
3
3
  * Licensed under BSL 1.1. See LICENSE for details.
4
4
  */
5
5
  import { NullType, none, some } from '@elaraai/east';
6
- import { LogChunkType, DataflowRequestType, DataflowGraphType, DataflowResultType, } from './types.js';
6
+ import { LogChunkType, DataflowRequestType, DataflowGraphType, DataflowResultType, DataflowExecutionStateType, } from './types.js';
7
7
  import { get, post, unwrap } from './http.js';
8
8
  /**
9
9
  * Start dataflow execution on a workspace (non-blocking).
@@ -12,15 +12,17 @@ import { get, post, unwrap } from './http.js';
12
12
  * Use workspaceStatus() to poll for progress.
13
13
  *
14
14
  * @param url - Base URL of the e3 API server
15
+ * @param repo - Repository name
15
16
  * @param workspace - Workspace name
16
- * @param options - Execution options
17
+ * @param dataflowOptions - Execution options
18
+ * @param options - Request options including auth token
17
19
  */
18
- export async function dataflowStart(url, workspace, options = {}) {
19
- const response = await post(url, `/api/workspaces/${encodeURIComponent(workspace)}/start`, {
20
- concurrency: options.concurrency != null ? some(BigInt(options.concurrency)) : none,
21
- force: options.force ?? false,
22
- filter: options.filter != null ? some(options.filter) : none,
23
- }, DataflowRequestType, NullType);
20
+ export async function dataflowStart(url, repo, workspace, dataflowOptions = {}, options) {
21
+ const response = await post(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow`, {
22
+ concurrency: dataflowOptions.concurrency != null ? some(BigInt(dataflowOptions.concurrency)) : none,
23
+ force: dataflowOptions.force ?? false,
24
+ filter: dataflowOptions.filter != null ? some(dataflowOptions.filter) : none,
25
+ }, DataflowRequestType, NullType, options);
24
26
  unwrap(response);
25
27
  }
26
28
  /**
@@ -29,49 +31,79 @@ export async function dataflowStart(url, workspace, options = {}) {
29
31
  * Waits for execution to complete and returns the result.
30
32
  *
31
33
  * @param url - Base URL of the e3 API server
34
+ * @param repo - Repository name
32
35
  * @param workspace - Workspace name
33
- * @param options - Execution options
36
+ * @param dataflowOptions - Execution options
37
+ * @param options - Request options including auth token
34
38
  * @returns Dataflow execution result
35
39
  */
36
- export async function dataflowExecute(url, workspace, options = {}) {
37
- const response = await post(url, `/api/workspaces/${encodeURIComponent(workspace)}/execute`, {
38
- concurrency: options.concurrency != null ? some(BigInt(options.concurrency)) : none,
39
- force: options.force ?? false,
40
- filter: options.filter != null ? some(options.filter) : none,
41
- }, DataflowRequestType, DataflowResultType);
40
+ export async function dataflowExecute(url, repo, workspace, dataflowOptions = {}, options) {
41
+ const response = await post(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/execute`, {
42
+ concurrency: dataflowOptions.concurrency != null ? some(BigInt(dataflowOptions.concurrency)) : none,
43
+ force: dataflowOptions.force ?? false,
44
+ filter: dataflowOptions.filter != null ? some(dataflowOptions.filter) : none,
45
+ }, DataflowRequestType, DataflowResultType, options);
42
46
  return unwrap(response);
43
47
  }
44
48
  /**
45
49
  * Get the dependency graph for a workspace.
46
50
  *
47
51
  * @param url - Base URL of the e3 API server
52
+ * @param repo - Repository name
48
53
  * @param workspace - Workspace name
54
+ * @param options - Request options including auth token
49
55
  * @returns Dataflow graph with tasks and dependencies
50
56
  */
51
- export async function dataflowGraph(url, workspace) {
52
- const response = await get(url, `/api/workspaces/${encodeURIComponent(workspace)}/graph`, DataflowGraphType);
57
+ export async function dataflowGraph(url, repo, workspace, options) {
58
+ const response = await get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/graph`, DataflowGraphType, options);
53
59
  return unwrap(response);
54
60
  }
55
61
  /**
56
62
  * Read task logs from a workspace.
57
63
  *
58
64
  * @param url - Base URL of the e3 API server
65
+ * @param repo - Repository name
59
66
  * @param workspace - Workspace name
60
67
  * @param task - Task name
61
- * @param options - Log reading options
68
+ * @param logOptions - Log reading options
69
+ * @param options - Request options including auth token
62
70
  * @returns Log chunk with data and metadata
63
71
  */
64
- export async function taskLogs(url, workspace, task, options = {}) {
72
+ export async function taskLogs(url, repo, workspace, task, logOptions = {}, options) {
65
73
  const params = new URLSearchParams();
66
- if (options.stream)
67
- params.set('stream', options.stream);
68
- if (options.offset != null)
69
- params.set('offset', String(options.offset));
70
- if (options.limit != null)
71
- params.set('limit', String(options.limit));
74
+ if (logOptions.stream)
75
+ params.set('stream', logOptions.stream);
76
+ if (logOptions.offset != null)
77
+ params.set('offset', String(logOptions.offset));
78
+ if (logOptions.limit != null)
79
+ params.set('limit', String(logOptions.limit));
72
80
  const query = params.toString();
73
- const path = `/api/workspaces/${encodeURIComponent(workspace)}/logs/${encodeURIComponent(task)}${query ? `?${query}` : ''}`;
74
- const response = await get(url, path, LogChunkType);
81
+ const path = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/logs/${encodeURIComponent(task)}${query ? `?${query}` : ''}`;
82
+ const response = await get(url, path, LogChunkType, options);
83
+ return unwrap(response);
84
+ }
85
+ /**
86
+ * Get dataflow execution state (for polling).
87
+ *
88
+ * Returns the current execution state including events for progress tracking.
89
+ * Use offset/limit for pagination of events.
90
+ *
91
+ * @param url - Base URL of the e3 API server
92
+ * @param repo - Repository name
93
+ * @param workspace - Workspace name
94
+ * @param stateOptions - Pagination options for events
95
+ * @param options - Request options including auth token
96
+ * @returns Execution state with events and summary
97
+ */
98
+ export async function dataflowExecution(url, repo, workspace, stateOptions = {}, options) {
99
+ const params = new URLSearchParams();
100
+ if (stateOptions.offset != null)
101
+ params.set('offset', String(stateOptions.offset));
102
+ if (stateOptions.limit != null)
103
+ params.set('limit', String(stateOptions.limit));
104
+ const query = params.toString();
105
+ const path = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/execution${query ? `?${query}` : ''}`;
106
+ const response = await get(url, path, DataflowExecutionStateType, options);
75
107
  return unwrap(response);
76
108
  }
77
109
  //# sourceMappingURL=executions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executions.js","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;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ChC,MAAM,IAAI,GAAG,UAAU,kBAAkB,CAAC,IAAI,CAAC,eAAe,kBAAkB,CAAC,SAAS,CAAC,sBAAsB,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAE5I,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC"}
@@ -11,22 +11,35 @@ export type Response<T> = {
11
11
  type: 'error';
12
12
  value: ValueTypeOf<typeof ErrorType>;
13
13
  };
14
+ /**
15
+ * Request options for authenticated API calls.
16
+ *
17
+ * The token is mandatory to ensure callers explicitly handle authentication (or not).
18
+ */
19
+ export interface RequestOptions {
20
+ /** Bearer token for authentication (optional depending on server) */
21
+ token: string | null;
22
+ }
14
23
  /**
15
24
  * Make a GET request and decode BEAST2 response.
16
25
  */
17
- export declare function get<T extends EastType>(url: string, path: string, successType: T): Promise<Response<ValueTypeOf<T>>>;
26
+ export declare function get<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<Response<ValueTypeOf<T>>>;
18
27
  /**
19
28
  * Make a POST request with BEAST2 body and decode BEAST2 response.
20
29
  */
21
- export declare function post<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res): Promise<Response<ValueTypeOf<Res>>>;
30
+ export declare function post<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res, options: RequestOptions): Promise<Response<ValueTypeOf<Res>>>;
22
31
  /**
23
32
  * Make a PUT request with BEAST2 body and decode BEAST2 response.
24
33
  */
25
- export declare function put<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res): Promise<Response<ValueTypeOf<Res>>>;
34
+ export declare function put<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res, options: RequestOptions): Promise<Response<ValueTypeOf<Res>>>;
26
35
  /**
27
36
  * Make a DELETE request and decode BEAST2 response.
28
37
  */
29
- export declare function del<T extends EastType>(url: string, path: string, successType: T): Promise<Response<ValueTypeOf<T>>>;
38
+ export declare function del<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<Response<ValueTypeOf<T>>>;
39
+ /**
40
+ * Make a PUT request without body and decode BEAST2 response.
41
+ */
42
+ export declare function putEmpty<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<Response<ValueTypeOf<T>>>;
30
43
  /**
31
44
  * Unwrap a response, throwing on error.
32
45
  */
@@ -39,4 +52,10 @@ export declare class ApiError extends Error {
39
52
  readonly details: unknown;
40
53
  constructor(code: string, details: unknown);
41
54
  }
55
+ /**
56
+ * Authentication error (401 response).
57
+ */
58
+ export declare class AuthError extends Error {
59
+ constructor(message: string);
60
+ }
42
61
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC,OAAO,SAAS,CAAC,CAAA;CAAE,CAAC;AAE5D;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,QAAQ,EAC1C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,GACb,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAA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