@elaraai/e3-api-client 0.0.2-beta.12 → 0.0.2-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/datasets.d.ts +25 -4
- package/dist/src/datasets.d.ts.map +1 -1
- package/dist/src/datasets.js +45 -8
- package/dist/src/datasets.js.map +1 -1
- package/dist/src/executions.d.ts +40 -8
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +59 -27
- package/dist/src/executions.js.map +1 -1
- package/dist/src/http.d.ts +23 -4
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +68 -8
- package/dist/src/http.js.map +1 -1
- package/dist/src/index.d.ts +7 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/packages.d.ts +16 -5
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +20 -10
- package/dist/src/packages.js.map +1 -1
- package/dist/src/platform.d.ts +62 -878
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/platform.js +99 -891
- package/dist/src/platform.js.map +1 -1
- package/dist/src/repository.d.ts +80 -5
- package/dist/src/repository.d.ts.map +1 -1
- package/dist/src/repository.js +128 -8
- package/dist/src/repository.js.map +1 -1
- package/dist/src/tasks.d.ts +19 -3
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +23 -5
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/types.d.ts +486 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +209 -2
- package/dist/src/types.js.map +1 -1
- package/dist/src/workspaces.d.ts +22 -7
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +28 -14
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +2 -2
package/dist/src/platform.js
CHANGED
|
@@ -15,643 +15,82 @@ import { dataflowStart, dataflowExecute, dataflowGraph, taskLogs, } from './exec
|
|
|
15
15
|
// =============================================================================
|
|
16
16
|
// Repository Platform Functions
|
|
17
17
|
// =============================================================================
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* and workspace count. Use this to monitor repository health and size.
|
|
23
|
-
*
|
|
24
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
25
|
-
* in East programs running on Node.js.
|
|
26
|
-
*
|
|
27
|
-
* @param url - Base URL of the e3 API server
|
|
28
|
-
* @returns Repository status including object, package, and workspace counts
|
|
29
|
-
*
|
|
30
|
-
* @throws {EastError} When request fails:
|
|
31
|
-
* - Network error
|
|
32
|
-
* - Server unavailable
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```ts
|
|
36
|
-
* const getStatus = East.function([StringType], RepositoryStatusType, ($, url) => {
|
|
37
|
-
* return Platform.repoStatus(url);
|
|
38
|
-
* });
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export const platform_repo_status = East.asyncPlatform('e3_repo_status', [StringType], RepositoryStatusType);
|
|
42
|
-
/**
|
|
43
|
-
* Runs garbage collection on the repository.
|
|
44
|
-
*
|
|
45
|
-
* Removes unreferenced objects from the object store to free disk space.
|
|
46
|
-
* Use dryRun mode to preview what would be deleted without actually deleting.
|
|
47
|
-
*
|
|
48
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
49
|
-
* in East programs running on Node.js.
|
|
50
|
-
*
|
|
51
|
-
* @param url - Base URL of the e3 API server
|
|
52
|
-
* @param options - GC options (dryRun to preview, minAge for object age filter)
|
|
53
|
-
* @returns GC result with counts and freed bytes
|
|
54
|
-
*
|
|
55
|
-
* @throws {EastError} When request fails:
|
|
56
|
-
* - Network error
|
|
57
|
-
* - Server unavailable
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* const runGc = East.function([StringType, GcRequestType], GcResultType, ($, url, options) => {
|
|
62
|
-
* return Platform.repoGc(url, options);
|
|
63
|
-
* });
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export const platform_repo_gc = East.asyncPlatform('e3_repo_gc', [StringType, GcRequestType], GcResultType);
|
|
18
|
+
export const platform_repo_status = East.asyncPlatform('e3_repo_status', [StringType, StringType, StringType], // url, repo, token
|
|
19
|
+
RepositoryStatusType);
|
|
20
|
+
export const platform_repo_gc = East.asyncPlatform('e3_repo_gc', [StringType, StringType, GcRequestType, StringType], // url, repo, options, token
|
|
21
|
+
GcResultType);
|
|
67
22
|
// =============================================================================
|
|
68
23
|
// Package Platform Functions
|
|
69
24
|
// =============================================================================
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
* @throws {EastError} When request fails:
|
|
82
|
-
* - Network error
|
|
83
|
-
* - Server unavailable
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* const listPackages = East.function([StringType], ArrayType(PackageListItemType), ($, url) => {
|
|
88
|
-
* return Platform.packageList(url);
|
|
89
|
-
* });
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
export const platform_package_list = East.asyncPlatform('e3_package_list', [StringType], ArrayType(PackageListItemType));
|
|
93
|
-
/**
|
|
94
|
-
* Gets a package object by name and version.
|
|
95
|
-
*
|
|
96
|
-
* Returns the complete package object including tasks, data structure, and metadata.
|
|
97
|
-
*
|
|
98
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
99
|
-
* in East programs running on Node.js.
|
|
100
|
-
*
|
|
101
|
-
* @param url - Base URL of the e3 API server
|
|
102
|
-
* @param name - Package name
|
|
103
|
-
* @param version - Package version
|
|
104
|
-
* @returns Package object
|
|
105
|
-
*
|
|
106
|
-
* @throws {EastError} When request fails:
|
|
107
|
-
* - Package not found
|
|
108
|
-
* - Network error
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```ts
|
|
112
|
-
* const getPackage = East.function([StringType, StringType, StringType], PackageObjectType, ($, url, name, version) => {
|
|
113
|
-
* return Platform.packageGet(url, name, version);
|
|
114
|
-
* });
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
export const platform_package_get = East.asyncPlatform('e3_package_get', [StringType, StringType, StringType], PackageObjectType);
|
|
118
|
-
/**
|
|
119
|
-
* Imports a package from a zip archive.
|
|
120
|
-
*
|
|
121
|
-
* Takes a zip archive containing a package and imports it into the repository.
|
|
122
|
-
*
|
|
123
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
124
|
-
* in East programs running on Node.js.
|
|
125
|
-
*
|
|
126
|
-
* @param url - Base URL of the e3 API server
|
|
127
|
-
* @param archive - Zip archive as bytes
|
|
128
|
-
* @returns Import result with package info and object count
|
|
129
|
-
*
|
|
130
|
-
* @throws {EastError} When request fails:
|
|
131
|
-
* - Invalid package format
|
|
132
|
-
* - Package already exists
|
|
133
|
-
* - Network error
|
|
134
|
-
*
|
|
135
|
-
* @example
|
|
136
|
-
* ```ts
|
|
137
|
-
* const importPackage = East.function([StringType, BlobType], PackageImportResultType, ($, url, archive) => {
|
|
138
|
-
* return Platform.packageImport(url, archive);
|
|
139
|
-
* });
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
export const platform_package_import = East.asyncPlatform('e3_package_import', [StringType, BlobType], PackageImportResultType);
|
|
143
|
-
/**
|
|
144
|
-
* Exports a package as a zip archive.
|
|
145
|
-
*
|
|
146
|
-
* Returns a zip archive containing the package that can be transferred or stored.
|
|
147
|
-
*
|
|
148
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
149
|
-
* in East programs running on Node.js.
|
|
150
|
-
*
|
|
151
|
-
* @param url - Base URL of the e3 API server
|
|
152
|
-
* @param name - Package name
|
|
153
|
-
* @param version - Package version
|
|
154
|
-
* @returns Zip archive as bytes
|
|
155
|
-
*
|
|
156
|
-
* @throws {EastError} When request fails:
|
|
157
|
-
* - Package not found
|
|
158
|
-
* - Network error
|
|
159
|
-
*
|
|
160
|
-
* @example
|
|
161
|
-
* ```ts
|
|
162
|
-
* const exportPackage = East.function([StringType, StringType, StringType], BlobType, ($, url, name, version) => {
|
|
163
|
-
* return Platform.packageExport(url, name, version);
|
|
164
|
-
* });
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export const platform_package_export = East.asyncPlatform('e3_package_export', [StringType, StringType, StringType], BlobType);
|
|
168
|
-
/**
|
|
169
|
-
* Removes a package from the repository.
|
|
170
|
-
*
|
|
171
|
-
* Deletes a package by name and version. Does not affect objects referenced by other packages.
|
|
172
|
-
*
|
|
173
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
174
|
-
* in East programs running on Node.js.
|
|
175
|
-
*
|
|
176
|
-
* @param url - Base URL of the e3 API server
|
|
177
|
-
* @param name - Package name
|
|
178
|
-
* @param version - Package version
|
|
179
|
-
* @returns null on success
|
|
180
|
-
*
|
|
181
|
-
* @throws {EastError} When request fails:
|
|
182
|
-
* - Package not found
|
|
183
|
-
* - Network error
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```ts
|
|
187
|
-
* const removePackage = East.function([StringType, StringType, StringType], NullType, ($, url, name, version) => {
|
|
188
|
-
* return Platform.packageRemove(url, name, version);
|
|
189
|
-
* });
|
|
190
|
-
* ```
|
|
191
|
-
*/
|
|
192
|
-
export const platform_package_remove = East.asyncPlatform('e3_package_remove', [StringType, StringType, StringType], NullType);
|
|
25
|
+
export const platform_package_list = East.asyncPlatform('e3_package_list', [StringType, StringType, StringType], // url, repo, token
|
|
26
|
+
ArrayType(PackageListItemType));
|
|
27
|
+
export const platform_package_get = East.asyncPlatform('e3_package_get', [StringType, StringType, StringType, StringType, StringType], // url, repo, name, version, token
|
|
28
|
+
PackageObjectType);
|
|
29
|
+
export const platform_package_import = East.asyncPlatform('e3_package_import', [StringType, StringType, BlobType, StringType], // url, repo, archive, token
|
|
30
|
+
PackageImportResultType);
|
|
31
|
+
export const platform_package_export = East.asyncPlatform('e3_package_export', [StringType, StringType, StringType, StringType, StringType], // url, repo, name, version, token
|
|
32
|
+
BlobType);
|
|
33
|
+
export const platform_package_remove = East.asyncPlatform('e3_package_remove', [StringType, StringType, StringType, StringType, StringType], // url, repo, name, version, token
|
|
34
|
+
NullType);
|
|
193
35
|
// =============================================================================
|
|
194
36
|
// Workspace Platform Functions
|
|
195
37
|
// =============================================================================
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* ```ts
|
|
213
|
-
* const listWorkspaces = East.function([StringType], ArrayType(WorkspaceInfoType), ($, url) => {
|
|
214
|
-
* return Platform.workspaceList(url);
|
|
215
|
-
* });
|
|
216
|
-
* ```
|
|
217
|
-
*/
|
|
218
|
-
export const platform_workspace_list = East.asyncPlatform('e3_workspace_list', [StringType], ArrayType(WorkspaceInfoType));
|
|
219
|
-
/**
|
|
220
|
-
* Creates a new empty workspace.
|
|
221
|
-
*
|
|
222
|
-
* Creates a workspace with the given name that can be used to deploy packages.
|
|
223
|
-
*
|
|
224
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
225
|
-
* in East programs running on Node.js.
|
|
226
|
-
*
|
|
227
|
-
* @param url - Base URL of the e3 API server
|
|
228
|
-
* @param name - Workspace name
|
|
229
|
-
* @returns Created workspace info
|
|
230
|
-
*
|
|
231
|
-
* @throws {EastError} When request fails:
|
|
232
|
-
* - Workspace already exists
|
|
233
|
-
* - Network error
|
|
234
|
-
*
|
|
235
|
-
* @example
|
|
236
|
-
* ```ts
|
|
237
|
-
* const createWorkspace = East.function([StringType, StringType], WorkspaceInfoType, ($, url, name) => {
|
|
238
|
-
* return Platform.workspaceCreate(url, name);
|
|
239
|
-
* });
|
|
240
|
-
* ```
|
|
241
|
-
*/
|
|
242
|
-
export const platform_workspace_create = East.asyncPlatform('e3_workspace_create', [StringType, StringType], WorkspaceInfoType);
|
|
243
|
-
/**
|
|
244
|
-
* Gets workspace state including deployed package info.
|
|
245
|
-
*
|
|
246
|
-
* Returns the full workspace state including the deployed package and current root hash.
|
|
247
|
-
*
|
|
248
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
249
|
-
* in East programs running on Node.js.
|
|
250
|
-
*
|
|
251
|
-
* @param url - Base URL of the e3 API server
|
|
252
|
-
* @param name - Workspace name
|
|
253
|
-
* @returns Workspace state
|
|
254
|
-
*
|
|
255
|
-
* @throws {EastError} When request fails:
|
|
256
|
-
* - Workspace not found
|
|
257
|
-
* - Network error
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
* ```ts
|
|
261
|
-
* const getWorkspace = East.function([StringType, StringType], WorkspaceStateType, ($, url, name) => {
|
|
262
|
-
* return Platform.workspaceGet(url, name);
|
|
263
|
-
* });
|
|
264
|
-
* ```
|
|
265
|
-
*/
|
|
266
|
-
export const platform_workspace_get = East.asyncPlatform('e3_workspace_get', [StringType, StringType], WorkspaceStateType);
|
|
267
|
-
/**
|
|
268
|
-
* Gets comprehensive workspace status.
|
|
269
|
-
*
|
|
270
|
-
* Returns detailed status including all datasets, tasks, lock info, and summary counts.
|
|
271
|
-
* Use this to monitor execution progress after calling dataflowStart.
|
|
272
|
-
*
|
|
273
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
274
|
-
* in East programs running on Node.js.
|
|
275
|
-
*
|
|
276
|
-
* @param url - Base URL of the e3 API server
|
|
277
|
-
* @param name - Workspace name
|
|
278
|
-
* @returns Workspace status with datasets, tasks, and summary
|
|
279
|
-
*
|
|
280
|
-
* @throws {EastError} When request fails:
|
|
281
|
-
* - Workspace not found
|
|
282
|
-
* - Network error
|
|
283
|
-
*
|
|
284
|
-
* @example
|
|
285
|
-
* ```ts
|
|
286
|
-
* const getStatus = East.function([StringType, StringType], WorkspaceStatusResultType, ($, url, name) => {
|
|
287
|
-
* return Platform.workspaceStatus(url, name);
|
|
288
|
-
* });
|
|
289
|
-
* ```
|
|
290
|
-
*/
|
|
291
|
-
export const platform_workspace_status = East.asyncPlatform('e3_workspace_status', [StringType, StringType], WorkspaceStatusResultType);
|
|
292
|
-
/**
|
|
293
|
-
* Removes a workspace.
|
|
294
|
-
*
|
|
295
|
-
* Deletes a workspace and all its data. Cannot be undone.
|
|
296
|
-
*
|
|
297
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
298
|
-
* in East programs running on Node.js.
|
|
299
|
-
*
|
|
300
|
-
* @param url - Base URL of the e3 API server
|
|
301
|
-
* @param name - Workspace name
|
|
302
|
-
* @returns null on success
|
|
303
|
-
*
|
|
304
|
-
* @throws {EastError} When request fails:
|
|
305
|
-
* - Workspace not found
|
|
306
|
-
* - Network error
|
|
307
|
-
*
|
|
308
|
-
* @example
|
|
309
|
-
* ```ts
|
|
310
|
-
* const removeWorkspace = East.function([StringType, StringType], NullType, ($, url, name) => {
|
|
311
|
-
* return Platform.workspaceRemove(url, name);
|
|
312
|
-
* });
|
|
313
|
-
* ```
|
|
314
|
-
*/
|
|
315
|
-
export const platform_workspace_remove = East.asyncPlatform('e3_workspace_remove', [StringType, StringType], NullType);
|
|
316
|
-
/**
|
|
317
|
-
* Deploys a package to a workspace.
|
|
318
|
-
*
|
|
319
|
-
* Sets up the workspace with the specified package's data structure and tasks.
|
|
320
|
-
*
|
|
321
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
322
|
-
* in East programs running on Node.js.
|
|
323
|
-
*
|
|
324
|
-
* @param url - Base URL of the e3 API server
|
|
325
|
-
* @param name - Workspace name
|
|
326
|
-
* @param packageRef - Package reference (name or name@version)
|
|
327
|
-
* @returns null on success
|
|
328
|
-
*
|
|
329
|
-
* @throws {EastError} When request fails:
|
|
330
|
-
* - Workspace not found
|
|
331
|
-
* - Package not found
|
|
332
|
-
* - Network error
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```ts
|
|
336
|
-
* const deploy = East.function([StringType, StringType, StringType], NullType, ($, url, workspace, packageRef) => {
|
|
337
|
-
* return Platform.workspaceDeploy(url, workspace, packageRef);
|
|
338
|
-
* });
|
|
339
|
-
* ```
|
|
340
|
-
*/
|
|
341
|
-
export const platform_workspace_deploy = East.asyncPlatform('e3_workspace_deploy', [StringType, StringType, StringType], NullType);
|
|
342
|
-
/**
|
|
343
|
-
* Exports workspace as a package zip archive.
|
|
344
|
-
*
|
|
345
|
-
* Creates a zip archive of the workspace that can be imported elsewhere.
|
|
346
|
-
*
|
|
347
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
348
|
-
* in East programs running on Node.js.
|
|
349
|
-
*
|
|
350
|
-
* @param url - Base URL of the e3 API server
|
|
351
|
-
* @param name - Workspace name
|
|
352
|
-
* @returns Zip archive as bytes
|
|
353
|
-
*
|
|
354
|
-
* @throws {EastError} When request fails:
|
|
355
|
-
* - Workspace not found
|
|
356
|
-
* - Network error
|
|
357
|
-
*
|
|
358
|
-
* @example
|
|
359
|
-
* ```ts
|
|
360
|
-
* const exportWorkspace = East.function([StringType, StringType], BlobType, ($, url, name) => {
|
|
361
|
-
* return Platform.workspaceExport(url, name);
|
|
362
|
-
* });
|
|
363
|
-
* ```
|
|
364
|
-
*/
|
|
365
|
-
export const platform_workspace_export = East.asyncPlatform('e3_workspace_export', [StringType, StringType], BlobType);
|
|
38
|
+
export const platform_workspace_list = East.asyncPlatform('e3_workspace_list', [StringType, StringType, StringType], // url, repo, token
|
|
39
|
+
ArrayType(WorkspaceInfoType));
|
|
40
|
+
export const platform_workspace_create = East.asyncPlatform('e3_workspace_create', [StringType, StringType, StringType, StringType], // url, repo, name, token
|
|
41
|
+
WorkspaceInfoType);
|
|
42
|
+
export const platform_workspace_get = East.asyncPlatform('e3_workspace_get', [StringType, StringType, StringType, StringType], // url, repo, name, token
|
|
43
|
+
WorkspaceStateType);
|
|
44
|
+
export const platform_workspace_status = East.asyncPlatform('e3_workspace_status', [StringType, StringType, StringType, StringType], // url, repo, name, token
|
|
45
|
+
WorkspaceStatusResultType);
|
|
46
|
+
export const platform_workspace_remove = East.asyncPlatform('e3_workspace_remove', [StringType, StringType, StringType, StringType], // url, repo, name, token
|
|
47
|
+
NullType);
|
|
48
|
+
export const platform_workspace_deploy = East.asyncPlatform('e3_workspace_deploy', [StringType, StringType, StringType, StringType, StringType], // url, repo, name, packageRef, token
|
|
49
|
+
NullType);
|
|
50
|
+
export const platform_workspace_export = East.asyncPlatform('e3_workspace_export', [StringType, StringType, StringType, StringType], // url, repo, name, token
|
|
51
|
+
BlobType);
|
|
366
52
|
// =============================================================================
|
|
367
53
|
// Dataset Platform Functions
|
|
368
54
|
// =============================================================================
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
* @param url - Base URL of the e3 API server
|
|
378
|
-
* @param workspace - Workspace name
|
|
379
|
-
* @returns Array of field names at root
|
|
380
|
-
*
|
|
381
|
-
* @throws {EastError} When request fails:
|
|
382
|
-
* - Workspace not found
|
|
383
|
-
* - Network error
|
|
384
|
-
*
|
|
385
|
-
* @example
|
|
386
|
-
* ```ts
|
|
387
|
-
* const listDatasets = East.function([StringType, StringType], ArrayType(StringType), ($, url, workspace) => {
|
|
388
|
-
* return Platform.datasetList(url, workspace);
|
|
389
|
-
* });
|
|
390
|
-
* ```
|
|
391
|
-
*/
|
|
392
|
-
export const platform_dataset_list = East.asyncPlatform('e3_dataset_list', [StringType, StringType], ArrayType(StringType));
|
|
393
|
-
/**
|
|
394
|
-
* Lists field names at a path in workspace dataset tree.
|
|
395
|
-
*
|
|
396
|
-
* Returns field names at the specified path in the workspace's data tree.
|
|
397
|
-
*
|
|
398
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
399
|
-
* in East programs running on Node.js.
|
|
400
|
-
*
|
|
401
|
-
* @param url - Base URL of the e3 API server
|
|
402
|
-
* @param workspace - Workspace name
|
|
403
|
-
* @param path - Path to the dataset
|
|
404
|
-
* @returns Array of field names at path
|
|
405
|
-
*
|
|
406
|
-
* @throws {EastError} When request fails:
|
|
407
|
-
* - Workspace not found
|
|
408
|
-
* - Path not found
|
|
409
|
-
* - Network error
|
|
410
|
-
*
|
|
411
|
-
* @example
|
|
412
|
-
* ```ts
|
|
413
|
-
* const listAt = East.function([StringType, StringType, TreePathType], ArrayType(StringType), ($, url, workspace, path) => {
|
|
414
|
-
* return Platform.datasetListAt(url, workspace, path);
|
|
415
|
-
* });
|
|
416
|
-
* ```
|
|
417
|
-
*/
|
|
418
|
-
export const platform_dataset_list_at = East.asyncPlatform('e3_dataset_list_at', [StringType, StringType, TreePathType], ArrayType(StringType));
|
|
419
|
-
/**
|
|
420
|
-
* Gets a dataset value as raw BEAST2 bytes.
|
|
421
|
-
*
|
|
422
|
-
* Returns the raw BEAST2 encoded data for a dataset.
|
|
423
|
-
* Use decodeBeast2 or decodeBeast2For to decode with the appropriate type.
|
|
424
|
-
*
|
|
425
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
426
|
-
* in East programs running on Node.js.
|
|
427
|
-
*
|
|
428
|
-
* @param url - Base URL of the e3 API server
|
|
429
|
-
* @param workspace - Workspace name
|
|
430
|
-
* @param path - Path to the dataset
|
|
431
|
-
* @returns Raw BEAST2 bytes
|
|
432
|
-
*
|
|
433
|
-
* @throws {EastError} When request fails:
|
|
434
|
-
* - Workspace not found
|
|
435
|
-
* - Dataset not found
|
|
436
|
-
* - Network error
|
|
437
|
-
*
|
|
438
|
-
* @example
|
|
439
|
-
* ```ts
|
|
440
|
-
* const getData = East.function([StringType, StringType, TreePathType], BlobType, ($, url, workspace, path) => {
|
|
441
|
-
* return Platform.datasetGet(url, workspace, path);
|
|
442
|
-
* });
|
|
443
|
-
* ```
|
|
444
|
-
*/
|
|
445
|
-
export const platform_dataset_get = East.asyncPlatform('e3_dataset_get', [StringType, StringType, TreePathType], BlobType);
|
|
446
|
-
/**
|
|
447
|
-
* Sets a dataset value from raw BEAST2 bytes.
|
|
448
|
-
*
|
|
449
|
-
* Stores the BEAST2 encoded data at the specified dataset path.
|
|
450
|
-
*
|
|
451
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
452
|
-
* in East programs running on Node.js.
|
|
453
|
-
*
|
|
454
|
-
* @param url - Base URL of the e3 API server
|
|
455
|
-
* @param workspace - Workspace name
|
|
456
|
-
* @param path - Path to the dataset
|
|
457
|
-
* @param data - Raw BEAST2 encoded value
|
|
458
|
-
* @returns null on success
|
|
459
|
-
*
|
|
460
|
-
* @throws {EastError} When request fails:
|
|
461
|
-
* - Workspace not found
|
|
462
|
-
* - Invalid path
|
|
463
|
-
* - Network error
|
|
464
|
-
*
|
|
465
|
-
* @example
|
|
466
|
-
* ```ts
|
|
467
|
-
* const setData = East.function([StringType, StringType, TreePathType, BlobType], NullType, ($, url, workspace, path, data) => {
|
|
468
|
-
* return Platform.datasetSet(url, workspace, path, data);
|
|
469
|
-
* });
|
|
470
|
-
* ```
|
|
471
|
-
*/
|
|
472
|
-
export const platform_dataset_set = East.asyncPlatform('e3_dataset_set', [StringType, StringType, TreePathType, BlobType], NullType);
|
|
55
|
+
export const platform_dataset_list = East.asyncPlatform('e3_dataset_list', [StringType, StringType, StringType, StringType], // url, repo, workspace, token
|
|
56
|
+
ArrayType(StringType));
|
|
57
|
+
export const platform_dataset_list_at = East.asyncPlatform('e3_dataset_list_at', [StringType, StringType, StringType, TreePathType, StringType], // url, repo, workspace, path, token
|
|
58
|
+
ArrayType(StringType));
|
|
59
|
+
export const platform_dataset_get = East.asyncPlatform('e3_dataset_get', [StringType, StringType, StringType, TreePathType, StringType], // url, repo, workspace, path, token
|
|
60
|
+
BlobType);
|
|
61
|
+
export const platform_dataset_set = East.asyncPlatform('e3_dataset_set', [StringType, StringType, StringType, TreePathType, BlobType, StringType], // url, repo, workspace, path, data, token
|
|
62
|
+
NullType);
|
|
473
63
|
// =============================================================================
|
|
474
64
|
// Task Platform Functions
|
|
475
65
|
// =============================================================================
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
*
|
|
481
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
482
|
-
* in East programs running on Node.js.
|
|
483
|
-
*
|
|
484
|
-
* @param url - Base URL of the e3 API server
|
|
485
|
-
* @param workspace - Workspace name
|
|
486
|
-
* @returns Array of task info (name, hash)
|
|
487
|
-
*
|
|
488
|
-
* @throws {EastError} When request fails:
|
|
489
|
-
* - Workspace not found
|
|
490
|
-
* - Workspace not deployed
|
|
491
|
-
* - Network error
|
|
492
|
-
*
|
|
493
|
-
* @example
|
|
494
|
-
* ```ts
|
|
495
|
-
* const listTasks = East.function([StringType, StringType], ArrayType(TaskListItemType), ($, url, workspace) => {
|
|
496
|
-
* return Platform.taskList(url, workspace);
|
|
497
|
-
* });
|
|
498
|
-
* ```
|
|
499
|
-
*/
|
|
500
|
-
export const platform_task_list = East.asyncPlatform('e3_task_list', [StringType, StringType], ArrayType(TaskListItemType));
|
|
501
|
-
/**
|
|
502
|
-
* Gets task details including runner and typed inputs/outputs.
|
|
503
|
-
*
|
|
504
|
-
* Returns the complete task definition including command IR and input/output paths.
|
|
505
|
-
*
|
|
506
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
507
|
-
* in East programs running on Node.js.
|
|
508
|
-
*
|
|
509
|
-
* @param url - Base URL of the e3 API server
|
|
510
|
-
* @param workspace - Workspace name
|
|
511
|
-
* @param name - Task name
|
|
512
|
-
* @returns Task details
|
|
513
|
-
*
|
|
514
|
-
* @throws {EastError} When request fails:
|
|
515
|
-
* - Workspace not found
|
|
516
|
-
* - Task not found
|
|
517
|
-
* - Network error
|
|
518
|
-
*
|
|
519
|
-
* @example
|
|
520
|
-
* ```ts
|
|
521
|
-
* const getTask = East.function([StringType, StringType, StringType], TaskDetailsType, ($, url, workspace, name) => {
|
|
522
|
-
* return Platform.taskGet(url, workspace, name);
|
|
523
|
-
* });
|
|
524
|
-
* ```
|
|
525
|
-
*/
|
|
526
|
-
export const platform_task_get = East.asyncPlatform('e3_task_get', [StringType, StringType, StringType], TaskDetailsType);
|
|
66
|
+
export const platform_task_list = East.asyncPlatform('e3_task_list', [StringType, StringType, StringType, StringType], // url, repo, workspace, token
|
|
67
|
+
ArrayType(TaskListItemType));
|
|
68
|
+
export const platform_task_get = East.asyncPlatform('e3_task_get', [StringType, StringType, StringType, StringType, StringType], // url, repo, workspace, name, token
|
|
69
|
+
TaskDetailsType);
|
|
527
70
|
// =============================================================================
|
|
528
71
|
// Execution Platform Functions
|
|
529
72
|
// =============================================================================
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
537
|
-
* in East programs running on Node.js.
|
|
538
|
-
*
|
|
539
|
-
* @param url - Base URL of the e3 API server
|
|
540
|
-
* @param workspace - Workspace name
|
|
541
|
-
* @param options - Execution options (concurrency, force, filter)
|
|
542
|
-
* @returns null on success
|
|
543
|
-
*
|
|
544
|
-
* @throws {EastError} When request fails:
|
|
545
|
-
* - Workspace not found
|
|
546
|
-
* - Workspace locked
|
|
547
|
-
* - Network error
|
|
548
|
-
*
|
|
549
|
-
* @example
|
|
550
|
-
* ```ts
|
|
551
|
-
* const start = East.function([StringType, StringType, DataflowRequestType], NullType, ($, url, workspace, options) => {
|
|
552
|
-
* return Platform.dataflowStart(url, workspace, options);
|
|
553
|
-
* });
|
|
554
|
-
* ```
|
|
555
|
-
*/
|
|
556
|
-
export const platform_dataflow_start = East.asyncPlatform('e3_dataflow_start', [StringType, StringType, DataflowRequestType], NullType);
|
|
557
|
-
/**
|
|
558
|
-
* Executes dataflow on a workspace (blocking).
|
|
559
|
-
*
|
|
560
|
-
* Waits for execution to complete and returns the result with per-task outcomes.
|
|
561
|
-
*
|
|
562
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
563
|
-
* in East programs running on Node.js.
|
|
564
|
-
*
|
|
565
|
-
* @param url - Base URL of the e3 API server
|
|
566
|
-
* @param workspace - Workspace name
|
|
567
|
-
* @param options - Execution options (concurrency, force, filter)
|
|
568
|
-
* @returns Dataflow execution result
|
|
569
|
-
*
|
|
570
|
-
* @throws {EastError} When request fails:
|
|
571
|
-
* - Workspace not found
|
|
572
|
-
* - Workspace locked
|
|
573
|
-
* - Network error
|
|
574
|
-
*
|
|
575
|
-
* @example
|
|
576
|
-
* ```ts
|
|
577
|
-
* const execute = East.function([StringType, StringType, DataflowRequestType], DataflowResultType, ($, url, workspace, options) => {
|
|
578
|
-
* return Platform.dataflowExecute(url, workspace, options);
|
|
579
|
-
* });
|
|
580
|
-
* ```
|
|
581
|
-
*/
|
|
582
|
-
export const platform_dataflow_execute = East.asyncPlatform('e3_dataflow_execute', [StringType, StringType, DataflowRequestType], DataflowResultType);
|
|
583
|
-
/**
|
|
584
|
-
* Gets the dependency graph for a workspace.
|
|
585
|
-
*
|
|
586
|
-
* Returns the task dependency graph showing which tasks depend on which others.
|
|
587
|
-
*
|
|
588
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
589
|
-
* in East programs running on Node.js.
|
|
590
|
-
*
|
|
591
|
-
* @param url - Base URL of the e3 API server
|
|
592
|
-
* @param workspace - Workspace name
|
|
593
|
-
* @returns Dataflow graph with tasks and dependencies
|
|
594
|
-
*
|
|
595
|
-
* @throws {EastError} When request fails:
|
|
596
|
-
* - Workspace not found
|
|
597
|
-
* - Network error
|
|
598
|
-
*
|
|
599
|
-
* @example
|
|
600
|
-
* ```ts
|
|
601
|
-
* const getGraph = East.function([StringType, StringType], DataflowGraphType, ($, url, workspace) => {
|
|
602
|
-
* return Platform.dataflowGraph(url, workspace);
|
|
603
|
-
* });
|
|
604
|
-
* ```
|
|
605
|
-
*/
|
|
606
|
-
export const platform_dataflow_graph = East.asyncPlatform('e3_dataflow_graph', [StringType, StringType], DataflowGraphType);
|
|
607
|
-
/**
|
|
608
|
-
* Log request options type.
|
|
609
|
-
*/
|
|
73
|
+
export const platform_dataflow_start = East.asyncPlatform('e3_dataflow_start', [StringType, StringType, StringType, DataflowRequestType, StringType], // url, repo, workspace, options, token
|
|
74
|
+
NullType);
|
|
75
|
+
export const platform_dataflow_execute = East.asyncPlatform('e3_dataflow_execute', [StringType, StringType, StringType, DataflowRequestType, StringType], // url, repo, workspace, options, token
|
|
76
|
+
DataflowResultType);
|
|
77
|
+
export const platform_dataflow_graph = East.asyncPlatform('e3_dataflow_graph', [StringType, StringType, StringType, StringType], // url, repo, workspace, token
|
|
78
|
+
DataflowGraphType);
|
|
610
79
|
export const LogOptionsType = StructType({
|
|
611
80
|
stream: StringType,
|
|
612
81
|
offset: IntegerType,
|
|
613
82
|
limit: IntegerType,
|
|
614
83
|
});
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
*
|
|
618
|
-
* Returns a chunk of log data from the specified task's stdout or stderr.
|
|
619
|
-
*
|
|
620
|
-
* This is a platform function for the East language, enabling e3 API operations
|
|
621
|
-
* in East programs running on Node.js.
|
|
622
|
-
*
|
|
623
|
-
* @param url - Base URL of the e3 API server
|
|
624
|
-
* @param workspace - Workspace name
|
|
625
|
-
* @param task - Task name
|
|
626
|
-
* @param options - Log options (stream, offset, limit)
|
|
627
|
-
* @returns Log chunk with data and metadata
|
|
628
|
-
*
|
|
629
|
-
* @throws {EastError} When request fails:
|
|
630
|
-
* - Workspace not found
|
|
631
|
-
* - Task not found
|
|
632
|
-
* - Network error
|
|
633
|
-
*
|
|
634
|
-
* @example
|
|
635
|
-
* ```ts
|
|
636
|
-
* const getLogs = East.function([StringType, StringType, StringType, LogOptionsType], LogChunkType, ($, url, workspace, task, options) => {
|
|
637
|
-
* return Platform.taskLogs(url, workspace, task, options);
|
|
638
|
-
* });
|
|
639
|
-
* ```
|
|
640
|
-
*/
|
|
641
|
-
export const platform_task_logs = East.asyncPlatform('e3_task_logs', [StringType, StringType, StringType, LogOptionsType], LogChunkType);
|
|
84
|
+
export const platform_task_logs = East.asyncPlatform('e3_task_logs', [StringType, StringType, StringType, StringType, LogOptionsType, StringType], // url, repo, workspace, task, options, token
|
|
85
|
+
LogChunkType);
|
|
642
86
|
// =============================================================================
|
|
643
87
|
// Platform Implementation
|
|
644
88
|
// =============================================================================
|
|
645
|
-
/**
|
|
646
|
-
* Node.js implementation of e3 API platform functions.
|
|
647
|
-
*
|
|
648
|
-
* Pass this array to {@link East.compileAsync} to enable e3 API operations.
|
|
649
|
-
*/
|
|
650
89
|
const PlatformImpl = [
|
|
651
90
|
// Repository
|
|
652
|
-
platform_repo_status.implement(async (url) => {
|
|
91
|
+
platform_repo_status.implement(async (url, repo, token) => {
|
|
653
92
|
try {
|
|
654
|
-
return await repoStatus(url);
|
|
93
|
+
return await repoStatus(url, repo, { token });
|
|
655
94
|
}
|
|
656
95
|
catch (err) {
|
|
657
96
|
throw new EastError(`Failed to get repository status: ${err.message}`, {
|
|
@@ -660,9 +99,9 @@ const PlatformImpl = [
|
|
|
660
99
|
});
|
|
661
100
|
}
|
|
662
101
|
}),
|
|
663
|
-
platform_repo_gc.implement(async (url, options) => {
|
|
102
|
+
platform_repo_gc.implement(async (url, repo, options, token) => {
|
|
664
103
|
try {
|
|
665
|
-
return await repoGc(url, options);
|
|
104
|
+
return await repoGc(url, repo, options, { token });
|
|
666
105
|
}
|
|
667
106
|
catch (err) {
|
|
668
107
|
throw new EastError(`Failed to run garbage collection: ${err.message}`, {
|
|
@@ -672,9 +111,9 @@ const PlatformImpl = [
|
|
|
672
111
|
}
|
|
673
112
|
}),
|
|
674
113
|
// Packages
|
|
675
|
-
platform_package_list.implement(async (url) => {
|
|
114
|
+
platform_package_list.implement(async (url, repo, token) => {
|
|
676
115
|
try {
|
|
677
|
-
return await packageList(url);
|
|
116
|
+
return await packageList(url, repo, { token });
|
|
678
117
|
}
|
|
679
118
|
catch (err) {
|
|
680
119
|
throw new EastError(`Failed to list packages: ${err.message}`, {
|
|
@@ -683,9 +122,9 @@ const PlatformImpl = [
|
|
|
683
122
|
});
|
|
684
123
|
}
|
|
685
124
|
}),
|
|
686
|
-
platform_package_get.implement(async (url, name, version) => {
|
|
125
|
+
platform_package_get.implement(async (url, repo, name, version, token) => {
|
|
687
126
|
try {
|
|
688
|
-
return await packageGet(url, name, version);
|
|
127
|
+
return await packageGet(url, repo, name, version, { token });
|
|
689
128
|
}
|
|
690
129
|
catch (err) {
|
|
691
130
|
throw new EastError(`Failed to get package ${name}@${version}: ${err.message}`, {
|
|
@@ -694,9 +133,9 @@ const PlatformImpl = [
|
|
|
694
133
|
});
|
|
695
134
|
}
|
|
696
135
|
}),
|
|
697
|
-
platform_package_import.implement(async (url, archive) => {
|
|
136
|
+
platform_package_import.implement(async (url, repo, archive, token) => {
|
|
698
137
|
try {
|
|
699
|
-
return await packageImport(url, archive);
|
|
138
|
+
return await packageImport(url, repo, archive, { token });
|
|
700
139
|
}
|
|
701
140
|
catch (err) {
|
|
702
141
|
throw new EastError(`Failed to import package: ${err.message}`, {
|
|
@@ -705,9 +144,9 @@ const PlatformImpl = [
|
|
|
705
144
|
});
|
|
706
145
|
}
|
|
707
146
|
}),
|
|
708
|
-
platform_package_export.implement(async (url, name, version) => {
|
|
147
|
+
platform_package_export.implement(async (url, repo, name, version, token) => {
|
|
709
148
|
try {
|
|
710
|
-
return await packageExport(url, name, version);
|
|
149
|
+
return await packageExport(url, repo, name, version, { token });
|
|
711
150
|
}
|
|
712
151
|
catch (err) {
|
|
713
152
|
throw new EastError(`Failed to export package ${name}@${version}: ${err.message}`, {
|
|
@@ -716,9 +155,9 @@ const PlatformImpl = [
|
|
|
716
155
|
});
|
|
717
156
|
}
|
|
718
157
|
}),
|
|
719
|
-
platform_package_remove.implement(async (url, name, version) => {
|
|
158
|
+
platform_package_remove.implement(async (url, repo, name, version, token) => {
|
|
720
159
|
try {
|
|
721
|
-
await packageRemove(url, name, version);
|
|
160
|
+
await packageRemove(url, repo, name, version, { token });
|
|
722
161
|
return null;
|
|
723
162
|
}
|
|
724
163
|
catch (err) {
|
|
@@ -729,9 +168,9 @@ const PlatformImpl = [
|
|
|
729
168
|
}
|
|
730
169
|
}),
|
|
731
170
|
// Workspaces
|
|
732
|
-
platform_workspace_list.implement(async (url) => {
|
|
171
|
+
platform_workspace_list.implement(async (url, repo, token) => {
|
|
733
172
|
try {
|
|
734
|
-
return await workspaceList(url);
|
|
173
|
+
return await workspaceList(url, repo, { token });
|
|
735
174
|
}
|
|
736
175
|
catch (err) {
|
|
737
176
|
throw new EastError(`Failed to list workspaces: ${err.message}`, {
|
|
@@ -740,9 +179,9 @@ const PlatformImpl = [
|
|
|
740
179
|
});
|
|
741
180
|
}
|
|
742
181
|
}),
|
|
743
|
-
platform_workspace_create.implement(async (url, name) => {
|
|
182
|
+
platform_workspace_create.implement(async (url, repo, name, token) => {
|
|
744
183
|
try {
|
|
745
|
-
return await workspaceCreate(url, name);
|
|
184
|
+
return await workspaceCreate(url, repo, name, { token });
|
|
746
185
|
}
|
|
747
186
|
catch (err) {
|
|
748
187
|
throw new EastError(`Failed to create workspace ${name}: ${err.message}`, {
|
|
@@ -751,9 +190,9 @@ const PlatformImpl = [
|
|
|
751
190
|
});
|
|
752
191
|
}
|
|
753
192
|
}),
|
|
754
|
-
platform_workspace_get.implement(async (url, name) => {
|
|
193
|
+
platform_workspace_get.implement(async (url, repo, name, token) => {
|
|
755
194
|
try {
|
|
756
|
-
return await workspaceGet(url, name);
|
|
195
|
+
return await workspaceGet(url, repo, name, { token });
|
|
757
196
|
}
|
|
758
197
|
catch (err) {
|
|
759
198
|
throw new EastError(`Failed to get workspace ${name}: ${err.message}`, {
|
|
@@ -762,9 +201,9 @@ const PlatformImpl = [
|
|
|
762
201
|
});
|
|
763
202
|
}
|
|
764
203
|
}),
|
|
765
|
-
platform_workspace_status.implement(async (url, name) => {
|
|
204
|
+
platform_workspace_status.implement(async (url, repo, name, token) => {
|
|
766
205
|
try {
|
|
767
|
-
return await workspaceStatus(url, name);
|
|
206
|
+
return await workspaceStatus(url, repo, name, { token });
|
|
768
207
|
}
|
|
769
208
|
catch (err) {
|
|
770
209
|
throw new EastError(`Failed to get workspace status ${name}: ${err.message}`, {
|
|
@@ -773,9 +212,9 @@ const PlatformImpl = [
|
|
|
773
212
|
});
|
|
774
213
|
}
|
|
775
214
|
}),
|
|
776
|
-
platform_workspace_remove.implement(async (url, name) => {
|
|
215
|
+
platform_workspace_remove.implement(async (url, repo, name, token) => {
|
|
777
216
|
try {
|
|
778
|
-
await workspaceRemove(url, name);
|
|
217
|
+
await workspaceRemove(url, repo, name, { token });
|
|
779
218
|
return null;
|
|
780
219
|
}
|
|
781
220
|
catch (err) {
|
|
@@ -785,9 +224,9 @@ const PlatformImpl = [
|
|
|
785
224
|
});
|
|
786
225
|
}
|
|
787
226
|
}),
|
|
788
|
-
platform_workspace_deploy.implement(async (url, name, packageRef) => {
|
|
227
|
+
platform_workspace_deploy.implement(async (url, repo, name, packageRef, token) => {
|
|
789
228
|
try {
|
|
790
|
-
await workspaceDeploy(url, name, packageRef);
|
|
229
|
+
await workspaceDeploy(url, repo, name, packageRef, { token });
|
|
791
230
|
return null;
|
|
792
231
|
}
|
|
793
232
|
catch (err) {
|
|
@@ -797,9 +236,9 @@ const PlatformImpl = [
|
|
|
797
236
|
});
|
|
798
237
|
}
|
|
799
238
|
}),
|
|
800
|
-
platform_workspace_export.implement(async (url, name) => {
|
|
239
|
+
platform_workspace_export.implement(async (url, repo, name, token) => {
|
|
801
240
|
try {
|
|
802
|
-
return await workspaceExport(url, name);
|
|
241
|
+
return await workspaceExport(url, repo, name, { token });
|
|
803
242
|
}
|
|
804
243
|
catch (err) {
|
|
805
244
|
throw new EastError(`Failed to export workspace ${name}: ${err.message}`, {
|
|
@@ -809,9 +248,9 @@ const PlatformImpl = [
|
|
|
809
248
|
}
|
|
810
249
|
}),
|
|
811
250
|
// Datasets
|
|
812
|
-
platform_dataset_list.implement(async (url, workspace) => {
|
|
251
|
+
platform_dataset_list.implement(async (url, repo, workspace, token) => {
|
|
813
252
|
try {
|
|
814
|
-
return await datasetList(url, workspace);
|
|
253
|
+
return await datasetList(url, repo, workspace, { token });
|
|
815
254
|
}
|
|
816
255
|
catch (err) {
|
|
817
256
|
throw new EastError(`Failed to list datasets in ${workspace}: ${err.message}`, {
|
|
@@ -820,9 +259,9 @@ const PlatformImpl = [
|
|
|
820
259
|
});
|
|
821
260
|
}
|
|
822
261
|
}),
|
|
823
|
-
platform_dataset_list_at.implement(async (url, workspace, path) => {
|
|
262
|
+
platform_dataset_list_at.implement(async (url, repo, workspace, path, token) => {
|
|
824
263
|
try {
|
|
825
|
-
return await datasetListAt(url, workspace, path);
|
|
264
|
+
return await datasetListAt(url, repo, workspace, path, { token });
|
|
826
265
|
}
|
|
827
266
|
catch (err) {
|
|
828
267
|
throw new EastError(`Failed to list datasets at path in ${workspace}: ${err.message}`, {
|
|
@@ -831,9 +270,9 @@ const PlatformImpl = [
|
|
|
831
270
|
});
|
|
832
271
|
}
|
|
833
272
|
}),
|
|
834
|
-
platform_dataset_get.implement(async (url, workspace, path) => {
|
|
273
|
+
platform_dataset_get.implement(async (url, repo, workspace, path, token) => {
|
|
835
274
|
try {
|
|
836
|
-
return await datasetGet(url, workspace, path);
|
|
275
|
+
return await datasetGet(url, repo, workspace, path, { token });
|
|
837
276
|
}
|
|
838
277
|
catch (err) {
|
|
839
278
|
throw new EastError(`Failed to get dataset in ${workspace}: ${err.message}`, {
|
|
@@ -842,9 +281,9 @@ const PlatformImpl = [
|
|
|
842
281
|
});
|
|
843
282
|
}
|
|
844
283
|
}),
|
|
845
|
-
platform_dataset_set.implement(async (url, workspace, path, data) => {
|
|
284
|
+
platform_dataset_set.implement(async (url, repo, workspace, path, data, token) => {
|
|
846
285
|
try {
|
|
847
|
-
await datasetSet(url, workspace, path, data);
|
|
286
|
+
await datasetSet(url, repo, workspace, path, data, { token });
|
|
848
287
|
return null;
|
|
849
288
|
}
|
|
850
289
|
catch (err) {
|
|
@@ -855,9 +294,9 @@ const PlatformImpl = [
|
|
|
855
294
|
}
|
|
856
295
|
}),
|
|
857
296
|
// Tasks
|
|
858
|
-
platform_task_list.implement(async (url, workspace) => {
|
|
297
|
+
platform_task_list.implement(async (url, repo, workspace, token) => {
|
|
859
298
|
try {
|
|
860
|
-
return await taskList(url, workspace);
|
|
299
|
+
return await taskList(url, repo, workspace, { token });
|
|
861
300
|
}
|
|
862
301
|
catch (err) {
|
|
863
302
|
throw new EastError(`Failed to list tasks in ${workspace}: ${err.message}`, {
|
|
@@ -866,9 +305,9 @@ const PlatformImpl = [
|
|
|
866
305
|
});
|
|
867
306
|
}
|
|
868
307
|
}),
|
|
869
|
-
platform_task_get.implement(async (url, workspace, name) => {
|
|
308
|
+
platform_task_get.implement(async (url, repo, workspace, name, token) => {
|
|
870
309
|
try {
|
|
871
|
-
return await taskGet(url, workspace, name);
|
|
310
|
+
return await taskGet(url, repo, workspace, name, { token });
|
|
872
311
|
}
|
|
873
312
|
catch (err) {
|
|
874
313
|
throw new EastError(`Failed to get task ${name} in ${workspace}: ${err.message}`, {
|
|
@@ -878,13 +317,13 @@ const PlatformImpl = [
|
|
|
878
317
|
}
|
|
879
318
|
}),
|
|
880
319
|
// Executions
|
|
881
|
-
platform_dataflow_start.implement(async (url, workspace, options) => {
|
|
320
|
+
platform_dataflow_start.implement(async (url, repo, workspace, options, token) => {
|
|
882
321
|
try {
|
|
883
|
-
await dataflowStart(url, workspace, {
|
|
322
|
+
await dataflowStart(url, repo, workspace, {
|
|
884
323
|
concurrency: options.concurrency.value != null ? Number(options.concurrency.value) : undefined,
|
|
885
324
|
force: options.force,
|
|
886
325
|
filter: options.filter.value ?? undefined,
|
|
887
|
-
});
|
|
326
|
+
}, { token });
|
|
888
327
|
return null;
|
|
889
328
|
}
|
|
890
329
|
catch (err) {
|
|
@@ -894,13 +333,13 @@ const PlatformImpl = [
|
|
|
894
333
|
});
|
|
895
334
|
}
|
|
896
335
|
}),
|
|
897
|
-
platform_dataflow_execute.implement(async (url, workspace, options) => {
|
|
336
|
+
platform_dataflow_execute.implement(async (url, repo, workspace, options, token) => {
|
|
898
337
|
try {
|
|
899
|
-
return await dataflowExecute(url, workspace, {
|
|
338
|
+
return await dataflowExecute(url, repo, workspace, {
|
|
900
339
|
concurrency: options.concurrency.value != null ? Number(options.concurrency.value) : undefined,
|
|
901
340
|
force: options.force,
|
|
902
341
|
filter: options.filter.value ?? undefined,
|
|
903
|
-
});
|
|
342
|
+
}, { token });
|
|
904
343
|
}
|
|
905
344
|
catch (err) {
|
|
906
345
|
throw new EastError(`Failed to execute dataflow in ${workspace}: ${err.message}`, {
|
|
@@ -909,9 +348,9 @@ const PlatformImpl = [
|
|
|
909
348
|
});
|
|
910
349
|
}
|
|
911
350
|
}),
|
|
912
|
-
platform_dataflow_graph.implement(async (url, workspace) => {
|
|
351
|
+
platform_dataflow_graph.implement(async (url, repo, workspace, token) => {
|
|
913
352
|
try {
|
|
914
|
-
return await dataflowGraph(url, workspace);
|
|
353
|
+
return await dataflowGraph(url, repo, workspace, { token });
|
|
915
354
|
}
|
|
916
355
|
catch (err) {
|
|
917
356
|
throw new EastError(`Failed to get dataflow graph for ${workspace}: ${err.message}`, {
|
|
@@ -920,13 +359,13 @@ const PlatformImpl = [
|
|
|
920
359
|
});
|
|
921
360
|
}
|
|
922
361
|
}),
|
|
923
|
-
platform_task_logs.implement(async (url, workspace, task, options) => {
|
|
362
|
+
platform_task_logs.implement(async (url, repo, workspace, task, options, token) => {
|
|
924
363
|
try {
|
|
925
|
-
return await taskLogs(url, workspace, task, {
|
|
364
|
+
return await taskLogs(url, repo, workspace, task, {
|
|
926
365
|
stream: options.stream,
|
|
927
366
|
offset: Number(options.offset),
|
|
928
367
|
limit: Number(options.limit),
|
|
929
|
-
});
|
|
368
|
+
}, { token });
|
|
930
369
|
}
|
|
931
370
|
catch (err) {
|
|
932
371
|
throw new EastError(`Failed to get logs for task ${task} in ${workspace}: ${err.message}`, {
|
|
@@ -939,269 +378,38 @@ const PlatformImpl = [
|
|
|
939
378
|
// =============================================================================
|
|
940
379
|
// Grouped Export
|
|
941
380
|
// =============================================================================
|
|
942
|
-
/**
|
|
943
|
-
* Grouped e3 API platform functions.
|
|
944
|
-
*
|
|
945
|
-
* Provides e3 repository, package, workspace, dataset, task, and execution operations
|
|
946
|
-
* for East programs running on Node.js.
|
|
947
|
-
*
|
|
948
|
-
* @example
|
|
949
|
-
* ```ts
|
|
950
|
-
* import { East, StringType } from "@elaraai/east";
|
|
951
|
-
* import { Platform, RepositoryStatusType } from "@elaraai/e3-api-client";
|
|
952
|
-
*
|
|
953
|
-
* const getStatus = East.function([StringType], RepositoryStatusType, ($, url) => {
|
|
954
|
-
* return Platform.repoStatus(url);
|
|
955
|
-
* });
|
|
956
|
-
*
|
|
957
|
-
* const compiled = await East.compileAsync(getStatus.toIR(), Platform.Implementation);
|
|
958
|
-
* const status = await compiled("http://localhost:3000");
|
|
959
|
-
* console.log(status.objectCount);
|
|
960
|
-
* ```
|
|
961
|
-
*/
|
|
962
381
|
export const Platform = {
|
|
963
382
|
// Repository
|
|
964
|
-
/**
|
|
965
|
-
* Gets repository status information.
|
|
966
|
-
*
|
|
967
|
-
* Returns statistics about the e3 repository including object count, package count,
|
|
968
|
-
* and workspace count.
|
|
969
|
-
*
|
|
970
|
-
* @param url - Base URL of the e3 API server
|
|
971
|
-
* @returns Repository status
|
|
972
|
-
*
|
|
973
|
-
* @example
|
|
974
|
-
* ```ts
|
|
975
|
-
* const getStatus = East.function([StringType], RepositoryStatusType, ($, url) => {
|
|
976
|
-
* return Platform.repoStatus(url);
|
|
977
|
-
* });
|
|
978
|
-
*
|
|
979
|
-
* const compiled = await East.compileAsync(getStatus.toIR(), Platform.Implementation);
|
|
980
|
-
* await compiled("http://localhost:3000");
|
|
981
|
-
* ```
|
|
982
|
-
*/
|
|
983
383
|
repoStatus: platform_repo_status,
|
|
984
|
-
/**
|
|
985
|
-
* Runs garbage collection on the repository.
|
|
986
|
-
*
|
|
987
|
-
* Removes unreferenced objects from the object store to free disk space.
|
|
988
|
-
*
|
|
989
|
-
* @param url - Base URL of the e3 API server
|
|
990
|
-
* @param options - GC options
|
|
991
|
-
* @returns GC result with counts and freed bytes
|
|
992
|
-
*
|
|
993
|
-
* @example
|
|
994
|
-
* ```ts
|
|
995
|
-
* const runGc = East.function([StringType, GcRequestType], GcResultType, ($, url, options) => {
|
|
996
|
-
* return Platform.repoGc(url, options);
|
|
997
|
-
* });
|
|
998
|
-
*
|
|
999
|
-
* const compiled = await East.compileAsync(runGc.toIR(), Platform.Implementation);
|
|
1000
|
-
* await compiled("http://localhost:3000", { dryRun: true, minAge: { type: "none", value: null } });
|
|
1001
|
-
* ```
|
|
1002
|
-
*/
|
|
1003
384
|
repoGc: platform_repo_gc,
|
|
1004
385
|
// Packages
|
|
1005
|
-
/**
|
|
1006
|
-
* Lists all packages in the repository.
|
|
1007
|
-
*
|
|
1008
|
-
* @param url - Base URL of the e3 API server
|
|
1009
|
-
* @returns Array of package info
|
|
1010
|
-
*/
|
|
1011
386
|
packageList: platform_package_list,
|
|
1012
|
-
/**
|
|
1013
|
-
* Gets a package object by name and version.
|
|
1014
|
-
*
|
|
1015
|
-
* @param url - Base URL of the e3 API server
|
|
1016
|
-
* @param name - Package name
|
|
1017
|
-
* @param version - Package version
|
|
1018
|
-
* @returns Package object
|
|
1019
|
-
*/
|
|
1020
387
|
packageGet: platform_package_get,
|
|
1021
|
-
/**
|
|
1022
|
-
* Imports a package from a zip archive.
|
|
1023
|
-
*
|
|
1024
|
-
* @param url - Base URL of the e3 API server
|
|
1025
|
-
* @param archive - Zip archive as bytes
|
|
1026
|
-
* @returns Import result
|
|
1027
|
-
*/
|
|
1028
388
|
packageImport: platform_package_import,
|
|
1029
|
-
/**
|
|
1030
|
-
* Exports a package as a zip archive.
|
|
1031
|
-
*
|
|
1032
|
-
* @param url - Base URL of the e3 API server
|
|
1033
|
-
* @param name - Package name
|
|
1034
|
-
* @param version - Package version
|
|
1035
|
-
* @returns Zip archive as bytes
|
|
1036
|
-
*/
|
|
1037
389
|
packageExport: platform_package_export,
|
|
1038
|
-
/**
|
|
1039
|
-
* Removes a package from the repository.
|
|
1040
|
-
*
|
|
1041
|
-
* @param url - Base URL of the e3 API server
|
|
1042
|
-
* @param name - Package name
|
|
1043
|
-
* @param version - Package version
|
|
1044
|
-
* @returns null on success
|
|
1045
|
-
*/
|
|
1046
390
|
packageRemove: platform_package_remove,
|
|
1047
391
|
// Workspaces
|
|
1048
|
-
/**
|
|
1049
|
-
* Lists all workspaces in the repository.
|
|
1050
|
-
*
|
|
1051
|
-
* @param url - Base URL of the e3 API server
|
|
1052
|
-
* @returns Array of workspace info
|
|
1053
|
-
*/
|
|
1054
392
|
workspaceList: platform_workspace_list,
|
|
1055
|
-
/**
|
|
1056
|
-
* Creates a new empty workspace.
|
|
1057
|
-
*
|
|
1058
|
-
* @param url - Base URL of the e3 API server
|
|
1059
|
-
* @param name - Workspace name
|
|
1060
|
-
* @returns Created workspace info
|
|
1061
|
-
*/
|
|
1062
393
|
workspaceCreate: platform_workspace_create,
|
|
1063
|
-
/**
|
|
1064
|
-
* Gets workspace state including deployed package info.
|
|
1065
|
-
*
|
|
1066
|
-
* @param url - Base URL of the e3 API server
|
|
1067
|
-
* @param name - Workspace name
|
|
1068
|
-
* @returns Workspace state
|
|
1069
|
-
*/
|
|
1070
394
|
workspaceGet: platform_workspace_get,
|
|
1071
|
-
/**
|
|
1072
|
-
* Gets comprehensive workspace status.
|
|
1073
|
-
*
|
|
1074
|
-
* @param url - Base URL of the e3 API server
|
|
1075
|
-
* @param name - Workspace name
|
|
1076
|
-
* @returns Workspace status with datasets, tasks, and summary
|
|
1077
|
-
*/
|
|
1078
395
|
workspaceStatus: platform_workspace_status,
|
|
1079
|
-
/**
|
|
1080
|
-
* Removes a workspace.
|
|
1081
|
-
*
|
|
1082
|
-
* @param url - Base URL of the e3 API server
|
|
1083
|
-
* @param name - Workspace name
|
|
1084
|
-
* @returns null on success
|
|
1085
|
-
*/
|
|
1086
396
|
workspaceRemove: platform_workspace_remove,
|
|
1087
|
-
/**
|
|
1088
|
-
* Deploys a package to a workspace.
|
|
1089
|
-
*
|
|
1090
|
-
* @param url - Base URL of the e3 API server
|
|
1091
|
-
* @param name - Workspace name
|
|
1092
|
-
* @param packageRef - Package reference
|
|
1093
|
-
* @returns null on success
|
|
1094
|
-
*/
|
|
1095
397
|
workspaceDeploy: platform_workspace_deploy,
|
|
1096
|
-
/**
|
|
1097
|
-
* Exports workspace as a package zip archive.
|
|
1098
|
-
*
|
|
1099
|
-
* @param url - Base URL of the e3 API server
|
|
1100
|
-
* @param name - Workspace name
|
|
1101
|
-
* @returns Zip archive as bytes
|
|
1102
|
-
*/
|
|
1103
398
|
workspaceExport: platform_workspace_export,
|
|
1104
399
|
// Datasets
|
|
1105
|
-
/**
|
|
1106
|
-
* Lists field names at root of workspace dataset tree.
|
|
1107
|
-
*
|
|
1108
|
-
* @param url - Base URL of the e3 API server
|
|
1109
|
-
* @param workspace - Workspace name
|
|
1110
|
-
* @returns Array of field names
|
|
1111
|
-
*/
|
|
1112
400
|
datasetList: platform_dataset_list,
|
|
1113
|
-
/**
|
|
1114
|
-
* Lists field names at a path in workspace dataset tree.
|
|
1115
|
-
*
|
|
1116
|
-
* @param url - Base URL of the e3 API server
|
|
1117
|
-
* @param workspace - Workspace name
|
|
1118
|
-
* @param path - Path to the dataset
|
|
1119
|
-
* @returns Array of field names
|
|
1120
|
-
*/
|
|
1121
401
|
datasetListAt: platform_dataset_list_at,
|
|
1122
|
-
/**
|
|
1123
|
-
* Gets a dataset value as raw BEAST2 bytes.
|
|
1124
|
-
*
|
|
1125
|
-
* @param url - Base URL of the e3 API server
|
|
1126
|
-
* @param workspace - Workspace name
|
|
1127
|
-
* @param path - Path to the dataset
|
|
1128
|
-
* @returns Raw BEAST2 bytes
|
|
1129
|
-
*/
|
|
1130
402
|
datasetGet: platform_dataset_get,
|
|
1131
|
-
/**
|
|
1132
|
-
* Sets a dataset value from raw BEAST2 bytes.
|
|
1133
|
-
*
|
|
1134
|
-
* @param url - Base URL of the e3 API server
|
|
1135
|
-
* @param workspace - Workspace name
|
|
1136
|
-
* @param path - Path to the dataset
|
|
1137
|
-
* @param data - Raw BEAST2 encoded value
|
|
1138
|
-
* @returns null on success
|
|
1139
|
-
*/
|
|
1140
403
|
datasetSet: platform_dataset_set,
|
|
1141
404
|
// Tasks
|
|
1142
|
-
/**
|
|
1143
|
-
* Lists tasks in a workspace.
|
|
1144
|
-
*
|
|
1145
|
-
* @param url - Base URL of the e3 API server
|
|
1146
|
-
* @param workspace - Workspace name
|
|
1147
|
-
* @returns Array of task info
|
|
1148
|
-
*/
|
|
1149
405
|
taskList: platform_task_list,
|
|
1150
|
-
/**
|
|
1151
|
-
* Gets task details.
|
|
1152
|
-
*
|
|
1153
|
-
* @param url - Base URL of the e3 API server
|
|
1154
|
-
* @param workspace - Workspace name
|
|
1155
|
-
* @param name - Task name
|
|
1156
|
-
* @returns Task details
|
|
1157
|
-
*/
|
|
1158
406
|
taskGet: platform_task_get,
|
|
1159
407
|
// Executions
|
|
1160
|
-
/**
|
|
1161
|
-
* Starts dataflow execution (non-blocking).
|
|
1162
|
-
*
|
|
1163
|
-
* @param url - Base URL of the e3 API server
|
|
1164
|
-
* @param workspace - Workspace name
|
|
1165
|
-
* @param options - Execution options
|
|
1166
|
-
* @returns null on success
|
|
1167
|
-
*/
|
|
1168
408
|
dataflowStart: platform_dataflow_start,
|
|
1169
|
-
/**
|
|
1170
|
-
* Executes dataflow (blocking).
|
|
1171
|
-
*
|
|
1172
|
-
* @param url - Base URL of the e3 API server
|
|
1173
|
-
* @param workspace - Workspace name
|
|
1174
|
-
* @param options - Execution options
|
|
1175
|
-
* @returns Dataflow execution result
|
|
1176
|
-
*/
|
|
1177
409
|
dataflowExecute: platform_dataflow_execute,
|
|
1178
|
-
/**
|
|
1179
|
-
* Gets the dependency graph for a workspace.
|
|
1180
|
-
*
|
|
1181
|
-
* @param url - Base URL of the e3 API server
|
|
1182
|
-
* @param workspace - Workspace name
|
|
1183
|
-
* @returns Dataflow graph
|
|
1184
|
-
*/
|
|
1185
410
|
dataflowGraph: platform_dataflow_graph,
|
|
1186
|
-
/**
|
|
1187
|
-
* Reads task logs from a workspace.
|
|
1188
|
-
*
|
|
1189
|
-
* @param url - Base URL of the e3 API server
|
|
1190
|
-
* @param workspace - Workspace name
|
|
1191
|
-
* @param task - Task name
|
|
1192
|
-
* @param options - Log options
|
|
1193
|
-
* @returns Log chunk
|
|
1194
|
-
*/
|
|
1195
411
|
taskLogs: platform_task_logs,
|
|
1196
|
-
/**
|
|
1197
|
-
* Node.js implementation of e3 API platform functions.
|
|
1198
|
-
*
|
|
1199
|
-
* Pass this to {@link East.compileAsync} to enable e3 API operations.
|
|
1200
|
-
*/
|
|
1201
412
|
Implementation: PlatformImpl,
|
|
1202
|
-
/**
|
|
1203
|
-
* Type definitions for platform operations.
|
|
1204
|
-
*/
|
|
1205
413
|
Types: {
|
|
1206
414
|
RepositoryStatus: RepositoryStatusType,
|
|
1207
415
|
GcRequest: GcRequestType,
|