@elaraai/e3-api-client 0.0.2-beta.21 → 0.0.2-beta.23
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/dist/src/datasets.d.ts +6 -0
- package/dist/src/datasets.d.ts.map +1 -1
- package/dist/src/datasets.js +10 -7
- package/dist/src/datasets.js.map +1 -1
- package/dist/src/executions.d.ts +9 -0
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +15 -11
- package/dist/src/executions.js.map +1 -1
- package/dist/src/http.d.ts +41 -19
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +77 -61
- package/dist/src/http.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/packages.d.ts +10 -0
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +16 -11
- package/dist/src/packages.js.map +1 -1
- package/dist/src/repos.d.ts +2 -0
- package/dist/src/repos.d.ts.map +1 -1
- package/dist/src/repos.js +4 -3
- package/dist/src/repos.js.map +1 -1
- package/dist/src/repository.d.ts +10 -0
- package/dist/src/repository.d.ts.map +1 -1
- package/dist/src/repository.js +16 -11
- package/dist/src/repository.js.map +1 -1
- package/dist/src/tasks.d.ts +6 -0
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +10 -7
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/workspaces.d.ts +14 -0
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +22 -15
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +3 -3
package/dist/src/datasets.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { type DatasetListItem } from './types.js';
|
|
|
13
13
|
* @param workspace - Workspace name
|
|
14
14
|
* @param options - Request options including auth token
|
|
15
15
|
* @returns Array of field names at root
|
|
16
|
+
* @throws {ApiError} On application-level errors
|
|
17
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
16
18
|
*/
|
|
17
19
|
export declare function datasetList(url: string, repo: string, workspace: string, options: RequestOptions): Promise<string[]>;
|
|
18
20
|
/**
|
|
@@ -24,6 +26,8 @@ export declare function datasetList(url: string, repo: string, workspace: string
|
|
|
24
26
|
* @param path - Path to the dataset (e.g., ['inputs', 'config'])
|
|
25
27
|
* @param options - Request options including auth token
|
|
26
28
|
* @returns Array of field names at path
|
|
29
|
+
* @throws {ApiError} On application-level errors
|
|
30
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
27
31
|
*/
|
|
28
32
|
export declare function datasetListAt(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<string[]>;
|
|
29
33
|
/**
|
|
@@ -60,6 +64,8 @@ export declare function datasetSet(url: string, repo: string, workspace: string,
|
|
|
60
64
|
* @param path - Starting path (empty for root)
|
|
61
65
|
* @param options - Request options including auth token
|
|
62
66
|
* @returns Array of dataset items with path, type, hash, and size
|
|
67
|
+
* @throws {ApiError} On application-level errors
|
|
68
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
63
69
|
*/
|
|
64
70
|
export declare function datasetListRecursive(url: string, repo: string, workspace: string, path: TreePath, options: RequestOptions): Promise<DatasetListItem[]>;
|
|
65
71
|
//# 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;AAClD,OAAO,
|
|
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;AAClD,OAAO,EAAO,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAO1H;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,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;;;;;;;;;;;GAWG;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,CAS5B"}
|
package/dist/src/datasets.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import { ArrayType, StringType } from '@elaraai/east';
|
|
6
|
-
import { get
|
|
6
|
+
import { get } from './http.js';
|
|
7
7
|
import { DatasetListItemType } from './types.js';
|
|
8
8
|
/**
|
|
9
9
|
* List field names at root of workspace dataset tree.
|
|
@@ -13,10 +13,11 @@ import { DatasetListItemType } from './types.js';
|
|
|
13
13
|
* @param workspace - Workspace name
|
|
14
14
|
* @param options - Request options including auth token
|
|
15
15
|
* @returns Array of field names at root
|
|
16
|
+
* @throws {ApiError} On application-level errors
|
|
17
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
16
18
|
*/
|
|
17
19
|
export async function datasetList(url, repo, workspace, options) {
|
|
18
|
-
|
|
19
|
-
return unwrap(response);
|
|
20
|
+
return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`, ArrayType(StringType), options);
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* List field names at a path in workspace dataset tree.
|
|
@@ -27,11 +28,12 @@ export async function datasetList(url, repo, workspace, options) {
|
|
|
27
28
|
* @param path - Path to the dataset (e.g., ['inputs', 'config'])
|
|
28
29
|
* @param options - Request options including auth token
|
|
29
30
|
* @returns Array of field names at path
|
|
31
|
+
* @throws {ApiError} On application-level errors
|
|
32
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
30
33
|
*/
|
|
31
34
|
export async function datasetListAt(url, repo, workspace, path, options) {
|
|
32
35
|
const pathStr = path.map(p => encodeURIComponent(p.value)).join('/');
|
|
33
|
-
|
|
34
|
-
return unwrap(response);
|
|
36
|
+
return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets/${pathStr}?list=true`, ArrayType(StringType), options);
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* Get a dataset value as raw BEAST2 bytes.
|
|
@@ -100,6 +102,8 @@ export async function datasetSet(url, repo, workspace, path, data, options) {
|
|
|
100
102
|
* @param path - Starting path (empty for root)
|
|
101
103
|
* @param options - Request options including auth token
|
|
102
104
|
* @returns Array of dataset items with path, type, hash, and size
|
|
105
|
+
* @throws {ApiError} On application-level errors
|
|
106
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
103
107
|
*/
|
|
104
108
|
export async function datasetListRecursive(url, repo, workspace, path, options) {
|
|
105
109
|
let endpoint = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/datasets`;
|
|
@@ -108,7 +112,6 @@ export async function datasetListRecursive(url, repo, workspace, path, options)
|
|
|
108
112
|
endpoint = `${endpoint}/${pathStr}`;
|
|
109
113
|
}
|
|
110
114
|
endpoint = `${endpoint}?recursive=true`;
|
|
111
|
-
|
|
112
|
-
return unwrap(response);
|
|
115
|
+
return get(url, endpoint, ArrayType(DatasetListItemType), options);
|
|
113
116
|
}
|
|
114
117
|
//# sourceMappingURL=datasets.js.map
|
package/dist/src/datasets.js.map
CHANGED
|
@@ -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,
|
|
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,EAAuB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAwB,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAW,EAAE,IAAY,EAAE,SAAiB,EAAE,OAAuB;IACrG,OAAO,GAAG,CACR,GAAG,EACH,UAAU,kBAAkB,CAAC,IAAI,CAAC,eAAe,kBAAkB,CAAC,SAAS,CAAC,WAAW,EACzF,SAAS,CAAC,UAAU,CAAC,EACrB,OAAO,CACR,CAAC;AACJ,CAAC;AAED;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jB,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,OAAO,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/src/executions.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export interface DataflowPollOptions {
|
|
|
35
35
|
* @param workspace - Workspace name
|
|
36
36
|
* @param dataflowOptions - Execution options
|
|
37
37
|
* @param options - Request options including auth token
|
|
38
|
+
* @throws {ApiError} On application-level errors
|
|
39
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
38
40
|
*/
|
|
39
41
|
export declare function dataflowExecuteLaunch(url: string, repo: string, workspace: string, dataflowOptions: DataflowOptions | undefined, options: RequestOptions): Promise<void>;
|
|
40
42
|
/**
|
|
@@ -60,6 +62,8 @@ export { dataflowExecuteLaunch as dataflowStart };
|
|
|
60
62
|
* @param workspace - Workspace name
|
|
61
63
|
* @param options - Request options including auth token
|
|
62
64
|
* @returns Dataflow graph with tasks and dependencies
|
|
65
|
+
* @throws {ApiError} On application-level errors
|
|
66
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
63
67
|
*/
|
|
64
68
|
export declare function dataflowGraph(url: string, repo: string, workspace: string, options: RequestOptions): Promise<DataflowGraph>;
|
|
65
69
|
/**
|
|
@@ -83,6 +87,8 @@ export interface LogOptions {
|
|
|
83
87
|
* @param logOptions - Log reading options
|
|
84
88
|
* @param options - Request options including auth token
|
|
85
89
|
* @returns Log chunk with data and metadata
|
|
90
|
+
* @throws {ApiError} On application-level errors
|
|
91
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
86
92
|
*/
|
|
87
93
|
export declare function taskLogs(url: string, repo: string, workspace: string, task: string, logOptions: LogOptions | undefined, options: RequestOptions): Promise<LogChunk>;
|
|
88
94
|
/**
|
|
@@ -106,6 +112,8 @@ export interface ExecutionStateOptions {
|
|
|
106
112
|
* @param stateOptions - Pagination options for events
|
|
107
113
|
* @param options - Request options including auth token
|
|
108
114
|
* @returns Execution state with events and summary
|
|
115
|
+
* @throws {ApiError} On application-level errors
|
|
116
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
109
117
|
*/
|
|
110
118
|
export declare function dataflowExecutePoll(url: string, repo: string, workspace: string, stateOptions: ExecutionStateOptions | undefined, options: RequestOptions): Promise<DataflowExecutionState>;
|
|
111
119
|
export { dataflowExecutePoll as dataflowExecution };
|
|
@@ -117,6 +125,7 @@ export { dataflowExecutePoll as dataflowExecution };
|
|
|
117
125
|
* @param workspace - Workspace name
|
|
118
126
|
* @param options - Request options (token, etc.)
|
|
119
127
|
* @throws {ApiError} If cancellation fails or no execution is running
|
|
128
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
120
129
|
*/
|
|
121
130
|
export declare function dataflowCancel(url: string, repo: string, workspace: string, options: RequestOptions): Promise<void>;
|
|
122
131
|
//# 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,sBAAsB,EAAuB,MAAM,YAAY,CAAC;AAOvH,OAAO,
|
|
1
|
+
{"version":3,"file":"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;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,UAAU,YAAK,EAC3B,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,QAAQ,CAAC,CAUnB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,qBAAqB,YAAK,EACxC,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,sBAAsB,CAAC,CASjC;AAGD,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,CAAC;AAEpD;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
package/dist/src/executions.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { NullType, none, some, variant } from '@elaraai/east';
|
|
6
6
|
import { LogChunkType, DataflowRequestType, DataflowGraphType, DataflowExecutionStateType, } from './types.js';
|
|
7
|
-
import { get, post
|
|
7
|
+
import { get, post } from './http.js';
|
|
8
8
|
/**
|
|
9
9
|
* Start dataflow execution on a workspace (non-blocking).
|
|
10
10
|
*
|
|
@@ -16,14 +16,15 @@ import { get, post, unwrap } from './http.js';
|
|
|
16
16
|
* @param workspace - Workspace name
|
|
17
17
|
* @param dataflowOptions - Execution options
|
|
18
18
|
* @param options - Request options including auth token
|
|
19
|
+
* @throws {ApiError} On application-level errors
|
|
20
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
19
21
|
*/
|
|
20
22
|
export async function dataflowExecuteLaunch(url, repo, workspace, dataflowOptions = {}, options) {
|
|
21
|
-
|
|
23
|
+
await post(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow`, {
|
|
22
24
|
concurrency: dataflowOptions.concurrency != null ? some(BigInt(dataflowOptions.concurrency)) : none,
|
|
23
25
|
force: dataflowOptions.force ?? false,
|
|
24
26
|
filter: dataflowOptions.filter != null ? some(dataflowOptions.filter) : none,
|
|
25
27
|
}, DataflowRequestType, NullType, options);
|
|
26
|
-
unwrap(response);
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* Build DataflowResult from DataflowExecutionState.
|
|
@@ -135,10 +136,11 @@ export { dataflowExecuteLaunch as dataflowStart };
|
|
|
135
136
|
* @param workspace - Workspace name
|
|
136
137
|
* @param options - Request options including auth token
|
|
137
138
|
* @returns Dataflow graph with tasks and dependencies
|
|
139
|
+
* @throws {ApiError} On application-level errors
|
|
140
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
138
141
|
*/
|
|
139
142
|
export async function dataflowGraph(url, repo, workspace, options) {
|
|
140
|
-
|
|
141
|
-
return unwrap(response);
|
|
143
|
+
return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/graph`, DataflowGraphType, options);
|
|
142
144
|
}
|
|
143
145
|
/**
|
|
144
146
|
* Read task logs from a workspace.
|
|
@@ -150,6 +152,8 @@ export async function dataflowGraph(url, repo, workspace, options) {
|
|
|
150
152
|
* @param logOptions - Log reading options
|
|
151
153
|
* @param options - Request options including auth token
|
|
152
154
|
* @returns Log chunk with data and metadata
|
|
155
|
+
* @throws {ApiError} On application-level errors
|
|
156
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
153
157
|
*/
|
|
154
158
|
export async function taskLogs(url, repo, workspace, task, logOptions = {}, options) {
|
|
155
159
|
const params = new URLSearchParams();
|
|
@@ -161,8 +165,7 @@ export async function taskLogs(url, repo, workspace, task, logOptions = {}, opti
|
|
|
161
165
|
params.set('limit', String(logOptions.limit));
|
|
162
166
|
const query = params.toString();
|
|
163
167
|
const path = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/logs/${encodeURIComponent(task)}${query ? `?${query}` : ''}`;
|
|
164
|
-
|
|
165
|
-
return unwrap(response);
|
|
168
|
+
return get(url, path, LogChunkType, options);
|
|
166
169
|
}
|
|
167
170
|
/**
|
|
168
171
|
* Get dataflow execution state (for polling).
|
|
@@ -176,6 +179,8 @@ export async function taskLogs(url, repo, workspace, task, logOptions = {}, opti
|
|
|
176
179
|
* @param stateOptions - Pagination options for events
|
|
177
180
|
* @param options - Request options including auth token
|
|
178
181
|
* @returns Execution state with events and summary
|
|
182
|
+
* @throws {ApiError} On application-level errors
|
|
183
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
179
184
|
*/
|
|
180
185
|
export async function dataflowExecutePoll(url, repo, workspace, stateOptions = {}, options) {
|
|
181
186
|
const params = new URLSearchParams();
|
|
@@ -185,8 +190,7 @@ export async function dataflowExecutePoll(url, repo, workspace, stateOptions = {
|
|
|
185
190
|
params.set('limit', String(stateOptions.limit));
|
|
186
191
|
const query = params.toString();
|
|
187
192
|
const path = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/execution${query ? `?${query}` : ''}`;
|
|
188
|
-
|
|
189
|
-
return unwrap(response);
|
|
193
|
+
return get(url, path, DataflowExecutionStateType, options);
|
|
190
194
|
}
|
|
191
195
|
// Backward compatibility alias
|
|
192
196
|
export { dataflowExecutePoll as dataflowExecution };
|
|
@@ -198,9 +202,9 @@ export { dataflowExecutePoll as dataflowExecution };
|
|
|
198
202
|
* @param workspace - Workspace name
|
|
199
203
|
* @param options - Request options (token, etc.)
|
|
200
204
|
* @throws {ApiError} If cancellation fails or no execution is running
|
|
205
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
201
206
|
*/
|
|
202
207
|
export async function dataflowCancel(url, repo, workspace, options) {
|
|
203
|
-
|
|
204
|
-
unwrap(response);
|
|
208
|
+
await post(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/cancel`, null, NullType, NullType, options);
|
|
205
209
|
}
|
|
206
210
|
//# sourceMappingURL=executions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,GAAG,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAuB,MAAM,WAAW,CAAC;AAwB3D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,GAAW,E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,EAAE,CAAC;IAE5I,OAAO,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC;AAED,+BAA+B;AAC/B,OAAO,EAAE,mBAAmB,IAAI,iBAAiB,EAAE,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAW,EACX,IAAY,EACZ,SAAiB,EACjB,OAAuB;IAEvB,MAAM,IAAI,CACR,GAAG,EACH,UAAU,kBAAkB,CAAC,IAAI,CAAC,eAAe,kBAAkB,CAAC,SAAS,CAAC,kBAAkB,EAChG,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,OAAO,CACR,CAAC;AACJ,CAAC"}
|
package/dist/src/http.d.ts
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { EastType, ValueTypeOf } from '@elaraai/east';
|
|
6
6
|
import { ErrorType } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* API response wrapper - success or typed error.
|
|
9
|
+
*
|
|
10
|
+
* This type mirrors the BEAST2 wire format (ResponseType from types.ts) used for
|
|
11
|
+
* HTTP 200 responses. The server sends either { type: 'success', value } or
|
|
12
|
+
* { type: 'error', value } as BEAST2-encoded payloads.
|
|
13
|
+
*
|
|
14
|
+
* Note: Client functions now throw ApiError instead of returning this type directly.
|
|
15
|
+
* This type is still used internally for decoding responses and is exported for
|
|
16
|
+
* cases where callers need to work with the wire format directly.
|
|
17
|
+
*/
|
|
7
18
|
export type Response<T> = {
|
|
8
19
|
type: 'success';
|
|
9
20
|
value: T;
|
|
@@ -20,42 +31,53 @@ export interface RequestOptions {
|
|
|
20
31
|
/** Bearer token for authentication (optional depending on server) */
|
|
21
32
|
token: string | null;
|
|
22
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* API error with typed error details.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ApiError extends Error {
|
|
38
|
+
readonly code: string;
|
|
39
|
+
readonly details?: unknown | undefined;
|
|
40
|
+
constructor(code: string, details?: unknown | undefined);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Authentication error (401 response).
|
|
44
|
+
*/
|
|
45
|
+
export declare class AuthError extends Error {
|
|
46
|
+
constructor(message: string);
|
|
47
|
+
}
|
|
23
48
|
/**
|
|
24
49
|
* Make a GET request and decode BEAST2 response.
|
|
50
|
+
* @throws {ApiError} On application-level errors
|
|
51
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
25
52
|
*/
|
|
26
|
-
export declare function get<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<
|
|
53
|
+
export declare function get<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<ValueTypeOf<T>>;
|
|
27
54
|
/**
|
|
28
55
|
* Make a POST request with BEAST2 body and decode BEAST2 response.
|
|
56
|
+
* @throws {ApiError} On application-level errors
|
|
57
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
29
58
|
*/
|
|
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<
|
|
59
|
+
export declare function post<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res, options: RequestOptions): Promise<ValueTypeOf<Res>>;
|
|
31
60
|
/**
|
|
32
61
|
* Make a PUT request with BEAST2 body and decode BEAST2 response.
|
|
62
|
+
* @throws {ApiError} On application-level errors
|
|
63
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
33
64
|
*/
|
|
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<
|
|
65
|
+
export declare function put<Req extends EastType, Res extends EastType>(url: string, path: string, body: ValueTypeOf<Req>, requestType: Req, successType: Res, options: RequestOptions): Promise<ValueTypeOf<Res>>;
|
|
35
66
|
/**
|
|
36
67
|
* Make a DELETE request and decode BEAST2 response.
|
|
68
|
+
* @throws {ApiError} On application-level errors
|
|
69
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
37
70
|
*/
|
|
38
|
-
export declare function del<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<
|
|
71
|
+
export declare function del<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<ValueTypeOf<T>>;
|
|
39
72
|
/**
|
|
40
73
|
* Make a PUT request without body and decode BEAST2 response.
|
|
74
|
+
* @throws {ApiError} On application-level errors
|
|
75
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
41
76
|
*/
|
|
42
|
-
export declare function putEmpty<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<
|
|
77
|
+
export declare function putEmpty<T extends EastType>(url: string, path: string, successType: T, options: RequestOptions): Promise<ValueTypeOf<T>>;
|
|
43
78
|
/**
|
|
44
79
|
* Unwrap a response, throwing on error.
|
|
80
|
+
* @deprecated Functions now throw ApiError on error; this function is no longer needed.
|
|
45
81
|
*/
|
|
46
82
|
export declare function unwrap<T>(response: Response<T>): T;
|
|
47
|
-
/**
|
|
48
|
-
* API error with typed error details.
|
|
49
|
-
*/
|
|
50
|
-
export declare class ApiError extends Error {
|
|
51
|
-
readonly code: string;
|
|
52
|
-
readonly details: unknown;
|
|
53
|
-
constructor(code: string, details: unknown);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Authentication error (401 response).
|
|
57
|
-
*/
|
|
58
|
-
export declare class AuthError extends Error {
|
|
59
|
-
constructor(message: string);
|
|
60
|
-
}
|
|
61
83
|
//# sourceMappingURL=http.d.ts.map
|
package/dist/src/http.d.ts.map
CHANGED
|
@@ -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,EA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ACd,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAUzB;AAkCD;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAMlD"}
|
package/dist/src/http.js
CHANGED
|
@@ -4,8 +4,60 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { encodeBeast2For, decodeBeast2For } from '@elaraai/east';
|
|
6
6
|
import { ResponseType } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* API error with typed error details.
|
|
9
|
+
*/
|
|
10
|
+
export class ApiError extends Error {
|
|
11
|
+
code;
|
|
12
|
+
details;
|
|
13
|
+
constructor(code, details) {
|
|
14
|
+
super(`API error: ${code}`);
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.details = details;
|
|
17
|
+
this.name = 'ApiError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Authentication error (401 response).
|
|
22
|
+
*/
|
|
23
|
+
export class AuthError extends Error {
|
|
24
|
+
constructor(message) {
|
|
25
|
+
super(`Authentication failed: ${message}`);
|
|
26
|
+
this.name = 'AuthError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parse error details from response text.
|
|
31
|
+
* Returns an ApiError with the error code from the body if available, otherwise uses fallback.
|
|
32
|
+
*/
|
|
33
|
+
function parseErrorBody(text, fallbackCode) {
|
|
34
|
+
try {
|
|
35
|
+
const json = JSON.parse(text);
|
|
36
|
+
if (json.error?.type) {
|
|
37
|
+
return new ApiError(json.error.type, json.error.message);
|
|
38
|
+
}
|
|
39
|
+
if (json.message) {
|
|
40
|
+
return new ApiError(fallbackCode, json.message);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Not JSON
|
|
45
|
+
}
|
|
46
|
+
return new ApiError(fallbackCode, text || undefined);
|
|
47
|
+
}
|
|
48
|
+
/** HTTP status code to error code mapping */
|
|
49
|
+
const STATUS_CODES = {
|
|
50
|
+
400: 'bad_request',
|
|
51
|
+
401: 'unauthorized',
|
|
52
|
+
403: 'forbidden',
|
|
53
|
+
404: 'not_found',
|
|
54
|
+
405: 'method_not_allowed',
|
|
55
|
+
415: 'unsupported_media_type',
|
|
56
|
+
};
|
|
7
57
|
/**
|
|
8
58
|
* Make a GET request and decode BEAST2 response.
|
|
59
|
+
* @throws {ApiError} On application-level errors
|
|
60
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
9
61
|
*/
|
|
10
62
|
export async function get(url, path, successType, options) {
|
|
11
63
|
const response = await fetch(`${url}/api${path}`, {
|
|
@@ -19,6 +71,8 @@ export async function get(url, path, successType, options) {
|
|
|
19
71
|
}
|
|
20
72
|
/**
|
|
21
73
|
* Make a POST request with BEAST2 body and decode BEAST2 response.
|
|
74
|
+
* @throws {ApiError} On application-level errors
|
|
75
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
22
76
|
*/
|
|
23
77
|
export async function post(url, path, body, requestType, successType, options) {
|
|
24
78
|
const encode = encodeBeast2For(requestType);
|
|
@@ -35,6 +89,8 @@ export async function post(url, path, body, requestType, successType, options) {
|
|
|
35
89
|
}
|
|
36
90
|
/**
|
|
37
91
|
* Make a PUT request with BEAST2 body and decode BEAST2 response.
|
|
92
|
+
* @throws {ApiError} On application-level errors
|
|
93
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
38
94
|
*/
|
|
39
95
|
export async function put(url, path, body, requestType, successType, options) {
|
|
40
96
|
const encode = encodeBeast2For(requestType);
|
|
@@ -51,6 +107,8 @@ export async function put(url, path, body, requestType, successType, options) {
|
|
|
51
107
|
}
|
|
52
108
|
/**
|
|
53
109
|
* Make a DELETE request and decode BEAST2 response.
|
|
110
|
+
* @throws {ApiError} On application-level errors
|
|
111
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
54
112
|
*/
|
|
55
113
|
export async function del(url, path, successType, options) {
|
|
56
114
|
const response = await fetch(`${url}/api${path}`, {
|
|
@@ -64,6 +122,8 @@ export async function del(url, path, successType, options) {
|
|
|
64
122
|
}
|
|
65
123
|
/**
|
|
66
124
|
* Make a PUT request without body and decode BEAST2 response.
|
|
125
|
+
* @throws {ApiError} On application-level errors
|
|
126
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
67
127
|
*/
|
|
68
128
|
export async function putEmpty(url, path, successType, options) {
|
|
69
129
|
const response = await fetch(`${url}/api${path}`, {
|
|
@@ -76,55 +136,33 @@ export async function putEmpty(url, path, successType, options) {
|
|
|
76
136
|
return decodeResponse(response, successType);
|
|
77
137
|
}
|
|
78
138
|
/**
|
|
79
|
-
* Decode a BEAST2 response
|
|
139
|
+
* Decode a BEAST2 response, throwing on errors.
|
|
140
|
+
* @throws {ApiError} On application-level errors (including BEAST2 error responses)
|
|
141
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
80
142
|
*/
|
|
81
143
|
async function decodeResponse(response, successType) {
|
|
82
|
-
// Handle
|
|
83
|
-
if (response.
|
|
84
|
-
throw new AuthError(await response.text());
|
|
85
|
-
}
|
|
86
|
-
if (response.status === 400) {
|
|
87
|
-
throw new Error(`Bad request: ${await response.text()}`);
|
|
88
|
-
}
|
|
89
|
-
if (response.status === 404) {
|
|
90
|
-
// Try to parse JSON error message
|
|
91
|
-
const text = await response.text();
|
|
92
|
-
let message = 'Not found';
|
|
93
|
-
try {
|
|
94
|
-
const json = JSON.parse(text);
|
|
95
|
-
message = json.message ?? message;
|
|
96
|
-
}
|
|
97
|
-
catch {
|
|
98
|
-
// Not JSON, use text as-is
|
|
99
|
-
if (text)
|
|
100
|
-
message = `Not found: ${text}`;
|
|
101
|
-
}
|
|
102
|
-
throw new Error(message);
|
|
103
|
-
}
|
|
104
|
-
if (response.status === 405) {
|
|
105
|
-
// Try to parse JSON error message
|
|
144
|
+
// Handle HTTP-level errors
|
|
145
|
+
if (!response.ok) {
|
|
106
146
|
const text = await response.text();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
message = json.message ?? message;
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
// Not JSON, use text as-is
|
|
114
|
-
if (text)
|
|
115
|
-
message = `Method not allowed: ${text}`;
|
|
147
|
+
const error = parseErrorBody(text, STATUS_CODES[response.status] ?? 'error');
|
|
148
|
+
if (response.status === 401) {
|
|
149
|
+
throw new AuthError(error.details ?? 'Authentication required');
|
|
116
150
|
}
|
|
117
|
-
throw
|
|
118
|
-
}
|
|
119
|
-
if (response.status === 415) {
|
|
120
|
-
throw new Error(`Unsupported media type: expected application/beast2`);
|
|
151
|
+
throw error;
|
|
121
152
|
}
|
|
153
|
+
// Decode BEAST2 response
|
|
122
154
|
const buffer = await response.arrayBuffer();
|
|
123
155
|
const decode = decodeBeast2For(ResponseType(successType));
|
|
124
|
-
|
|
156
|
+
const result = decode(new Uint8Array(buffer));
|
|
157
|
+
// Handle application-level errors in BEAST2 response
|
|
158
|
+
if (result.type === 'error') {
|
|
159
|
+
throw new ApiError(result.value.type, result.value.value);
|
|
160
|
+
}
|
|
161
|
+
return result.value;
|
|
125
162
|
}
|
|
126
163
|
/**
|
|
127
164
|
* Unwrap a response, throwing on error.
|
|
165
|
+
* @deprecated Functions now throw ApiError on error; this function is no longer needed.
|
|
128
166
|
*/
|
|
129
167
|
export function unwrap(response) {
|
|
130
168
|
if (response.type === 'error') {
|
|
@@ -133,26 +171,4 @@ export function unwrap(response) {
|
|
|
133
171
|
}
|
|
134
172
|
return response.value;
|
|
135
173
|
}
|
|
136
|
-
/**
|
|
137
|
-
* API error with typed error details.
|
|
138
|
-
*/
|
|
139
|
-
export class ApiError extends Error {
|
|
140
|
-
code;
|
|
141
|
-
details;
|
|
142
|
-
constructor(code, details) {
|
|
143
|
-
super(`API error: ${code}`);
|
|
144
|
-
this.code = code;
|
|
145
|
-
this.details = details;
|
|
146
|
-
this.name = 'ApiError';
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Authentication error (401 response).
|
|
151
|
-
*/
|
|
152
|
-
export class AuthError extends Error {
|
|
153
|
-
constructor(message) {
|
|
154
|
-
super(`Authentication failed: ${message}`);
|
|
155
|
-
this.name = 'AuthError';
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
174
|
//# sourceMappingURL=http.js.map
|
package/dist/src/http.js.map
CHANGED
|
@@ -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;
|
|
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;AA2BrD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IAEf;IACA;IAFlB,YACkB,IAAY,EACZ,OAAiB;QAEjC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;QAHZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAU;QAGjC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YAAY,OAAe;QACzB,KAAK,CAAC,0BAA0B,OAAO,EAAE,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAWD;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAY,EAAE,YAAoB;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,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AC;YAC5B,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,OAAiB,IAAI,yBAAyB,CAAC,CAAC;QAC5E,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,yBAAyB;IACzB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;IAC5C,MAAM,MAAM,GAAG,eAAe,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAA6B,CAAC;IAE1E,qDAAqD;IACrD,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAI,QAAqB;IAC7C,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC9B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC3B,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC;AACxB,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export { ApiTypes } from './types.js';
|
|
12
12
|
export type { RepositoryStatus, GcRequest, GcResult, GcStartResult, GcStatusResult, AsyncOperationStatus, PackageListItem, PackageImportResult, WorkspaceInfo, WorkspaceStatusResult, DatasetStatus, DatasetStatusInfo, TaskStatus, TaskStatusInfo, WorkspaceStatusSummary, TaskListItem, TaskDetails, DataflowGraph, GraphTask, LogChunk, TaskExecutionResult, DataflowResult, DataflowEvent, ExecutionStatus, DataflowExecutionSummary, DataflowExecutionState, ExecutionListItem, ExecutionHistoryStatus, DatasetListItem, } from './types.js';
|
|
13
|
-
export { ApiError, AuthError } from './http.js';
|
|
13
|
+
export { ApiError, AuthError, get, post, put, del, putEmpty, unwrap } from './http.js';
|
|
14
14
|
export type { RequestOptions, Response } from './http.js';
|
|
15
15
|
export { repoStatus, repoGc, repoGcStart, repoGcStatus, repoCreate, repoRemove, } from './repository.js';
|
|
16
16
|
export { repoList } from './repos.js';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -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,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,SAAS,EACT,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,eAAe,EACf,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,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,eA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