@elaraai/e3-api-client 1.0.84 → 1.0.85
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 +25 -3
- package/dist/src/datasets-transfer.spec.js +40 -5
- package/dist/src/datasets-transfer.spec.js.map +1 -1
- package/dist/src/datasets.d.ts +83 -1
- package/dist/src/datasets.d.ts.map +1 -1
- package/dist/src/datasets.js +213 -37
- package/dist/src/datasets.js.map +1 -1
- package/dist/src/datasets.spec.js +273 -13
- package/dist/src/datasets.spec.js.map +1 -1
- package/dist/src/executions.d.ts +50 -15
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +57 -16
- package/dist/src/executions.js.map +1 -1
- package/dist/src/executions.spec.d.ts +6 -0
- package/dist/src/executions.spec.d.ts.map +1 -0
- package/dist/src/executions.spec.js +81 -0
- package/dist/src/executions.spec.js.map +1 -0
- package/dist/src/functions.d.ts +39 -8
- package/dist/src/functions.d.ts.map +1 -1
- package/dist/src/functions.js +39 -8
- package/dist/src/functions.js.map +1 -1
- package/dist/src/http.d.ts +65 -7
- package/dist/src/http.d.ts.map +1 -1
- package/dist/src/http.js +54 -14
- package/dist/src/http.js.map +1 -1
- package/dist/src/http.spec.js +106 -5
- package/dist/src/http.spec.js.map +1 -1
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +3 -3
- package/dist/src/packages.js.map +1 -1
- package/dist/src/packages.spec.d.ts +6 -0
- package/dist/src/packages.spec.d.ts.map +1 -0
- package/dist/src/packages.spec.js +118 -0
- package/dist/src/packages.spec.js.map +1 -0
- package/dist/src/platform.d.ts +103 -9
- package/dist/src/platform.d.ts.map +1 -1
- package/dist/src/platform.js +335 -315
- package/dist/src/platform.js.map +1 -1
- package/dist/src/platform.spec.d.ts +6 -0
- package/dist/src/platform.spec.d.ts.map +1 -0
- package/dist/src/platform.spec.js +85 -0
- package/dist/src/platform.spec.js.map +1 -0
- package/dist/src/records.spec.js +15 -5
- package/dist/src/records.spec.js.map +1 -1
- package/dist/src/repository.d.ts +8 -1
- package/dist/src/repository.d.ts.map +1 -1
- package/dist/src/repository.js +8 -1
- package/dist/src/repository.js.map +1 -1
- package/dist/src/tasks.d.ts +11 -7
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +16 -8
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/types.d.ts +63 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +7 -5
- package/dist/src/types.js.map +1 -1
- package/dist/src/workspaces.d.ts +16 -2
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +11 -4
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +4 -4
package/dist/src/executions.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
3
|
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
|
-
import { NullType, OptionType, none, some, variant } from '@elaraai/east';
|
|
6
|
-
import {
|
|
5
|
+
import { IntegerType, NullType, OptionType, lessFor, none, printFor, some, variant } from '@elaraai/east';
|
|
6
|
+
import { dataflowForce } from '@elaraai/e3-types';
|
|
7
|
+
import { TaskLogChunkType, DataflowRequestType, DataflowGraphType, DataflowBudgetType, DataflowExecutionStateType, } from './types.js';
|
|
7
8
|
import { get, post, verboseQuery, ApiError } from './http.js';
|
|
8
9
|
/**
|
|
9
10
|
* Start dataflow execution on a workspace (non-blocking).
|
|
@@ -25,7 +26,7 @@ export async function dataflowExecuteLaunch(url, repo, workspace, dataflowOption
|
|
|
25
26
|
for (let attempt = 0;; attempt++) {
|
|
26
27
|
try {
|
|
27
28
|
await post(url, verboseQuery(`/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow`, options), {
|
|
28
|
-
force: dataflowOptions.force
|
|
29
|
+
force: dataflowForce(dataflowOptions.force),
|
|
29
30
|
filter: dataflowOptions.filter != null ? some(dataflowOptions.filter) : none,
|
|
30
31
|
}, DataflowRequestType, NullType, options);
|
|
31
32
|
return;
|
|
@@ -113,10 +114,29 @@ function buildDataflowResult(state) {
|
|
|
113
114
|
duration: summary.duration,
|
|
114
115
|
};
|
|
115
116
|
}
|
|
117
|
+
/** Whether one event sequence number comes before another. */
|
|
118
|
+
const seqBefore = lessFor(IntegerType);
|
|
119
|
+
/**
|
|
120
|
+
* Whether a poll left events of the run for the next: those past its
|
|
121
|
+
* `nextSeq`, up to the run's last (`lastSeq`), which a poll served its limit,
|
|
122
|
+
* or e3-types' `DATAFLOW_POLL_EVENTS_MAX`, does not reach.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* A client that reads a run's events polls again at once from `nextSeq` while
|
|
126
|
+
* this holds, and takes a status that has ended as the run's last word only
|
|
127
|
+
* once it does not: the events of its end may be past the ones served.
|
|
128
|
+
*
|
|
129
|
+
* @param state - A poll's answer
|
|
130
|
+
* @returns Whether events of the run are past the poll's `nextSeq`
|
|
131
|
+
*/
|
|
132
|
+
export function dataflowEventsRemain(state) {
|
|
133
|
+
return seqBefore(state.nextSeq, state.lastSeq);
|
|
134
|
+
}
|
|
116
135
|
/**
|
|
117
136
|
* Execute dataflow on a workspace with client-side polling.
|
|
118
137
|
*
|
|
119
|
-
* Starts execution, polls until complete, and returns the result
|
|
138
|
+
* Starts execution, polls until complete, and returns the result, with every
|
|
139
|
+
* event of the run however many polls it takes.
|
|
120
140
|
*
|
|
121
141
|
* @param url - Base URL of the e3 API server
|
|
122
142
|
* @param repo - Repository name
|
|
@@ -130,12 +150,21 @@ export async function dataflowExecute(url, repo, workspace, dataflowOptions = {}
|
|
|
130
150
|
const { pollInterval = 500, timeout = 300000 } = pollOptions;
|
|
131
151
|
// Start execution
|
|
132
152
|
await dataflowExecuteLaunch(url, repo, workspace, dataflowOptions, options);
|
|
133
|
-
// Poll until complete
|
|
153
|
+
// Poll until complete, each poll served the events since the one before. A
|
|
154
|
+
// poll is served at most DATAFLOW_POLL_EVENTS_MAX of them: one that left
|
|
155
|
+
// some is followed at once, so the result has every event of the run.
|
|
134
156
|
const startTime = Date.now();
|
|
157
|
+
const events = [];
|
|
158
|
+
let since = 0n;
|
|
135
159
|
while (Date.now() - startTime < timeout) {
|
|
136
|
-
const state = await dataflowExecutePoll(url, repo, workspace, {}, options);
|
|
160
|
+
const state = await dataflowExecutePoll(url, repo, workspace, { since }, options);
|
|
161
|
+
events.push(...state.events);
|
|
162
|
+
const moved = seqBefore(since, state.nextSeq);
|
|
163
|
+
since = state.nextSeq;
|
|
164
|
+
if (moved && dataflowEventsRemain(state))
|
|
165
|
+
continue;
|
|
137
166
|
if (state.status.type === 'completed' || state.status.type === 'failed' || state.status.type === 'aborted') {
|
|
138
|
-
return buildDataflowResult(state);
|
|
167
|
+
return buildDataflowResult({ ...state, events });
|
|
139
168
|
}
|
|
140
169
|
await new Promise(r => setTimeout(r, pollInterval));
|
|
141
170
|
}
|
|
@@ -156,7 +185,11 @@ export async function dataflowGraph(url, repo, workspace, options) {
|
|
|
156
185
|
return get(url, `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/graph`, DataflowGraphType, options);
|
|
157
186
|
}
|
|
158
187
|
/**
|
|
159
|
-
* Read task
|
|
188
|
+
* Read a chunk of a task's log from a workspace: of the task's current
|
|
189
|
+
* execution, or of the one `logOptions.execution` names. The chunk names the
|
|
190
|
+
* execution it was read from and whether it has ended, so a client polling
|
|
191
|
+
* the log reads on from its offset, starts over when the execution changes,
|
|
192
|
+
* and stops once it has ended and its log is read.
|
|
160
193
|
*
|
|
161
194
|
* @param url - Base URL of the e3 API server
|
|
162
195
|
* @param repo - Repository name
|
|
@@ -164,7 +197,7 @@ export async function dataflowGraph(url, repo, workspace, options) {
|
|
|
164
197
|
* @param task - Task name
|
|
165
198
|
* @param logOptions - Log reading options
|
|
166
199
|
* @param options - Request options including auth token
|
|
167
|
-
* @returns Log chunk with data and metadata
|
|
200
|
+
* @returns Log chunk with data and metadata, and its execution
|
|
168
201
|
* @throws {ApiError} On application-level errors
|
|
169
202
|
* @throws {AuthError} On 401 Unauthorized
|
|
170
203
|
*/
|
|
@@ -176,20 +209,27 @@ export async function taskLogs(url, repo, workspace, task, logOptions = {}, opti
|
|
|
176
209
|
params.set('offset', String(logOptions.offset));
|
|
177
210
|
if (logOptions.limit != null)
|
|
178
211
|
params.set('limit', String(logOptions.limit));
|
|
212
|
+
if (logOptions.execution !== undefined) {
|
|
213
|
+
params.set('inputs', logOptions.execution.inputsHash);
|
|
214
|
+
params.set('execution', logOptions.execution.executionId);
|
|
215
|
+
}
|
|
179
216
|
const query = params.toString();
|
|
180
217
|
const path = `/repos/${encodeURIComponent(repo)}/workspaces/${encodeURIComponent(workspace)}/dataflow/logs/${encodeURIComponent(task)}${query ? `?${query}` : ''}`;
|
|
181
|
-
return get(url, path,
|
|
218
|
+
return get(url, path, TaskLogChunkType, options);
|
|
182
219
|
}
|
|
220
|
+
/** A cursor as a query spells it. */
|
|
221
|
+
const printSeq = printFor(IntegerType);
|
|
183
222
|
/**
|
|
184
223
|
* Get dataflow execution state (for polling).
|
|
185
224
|
*
|
|
186
|
-
* Returns the current
|
|
187
|
-
*
|
|
225
|
+
* Returns the current state of the workspace's latest run, and its events
|
|
226
|
+
* past the poll's cursor. A client polling a run passes the `nextSeq` each
|
|
227
|
+
* answer gives as the next poll's `since`, so each poll is served what is new.
|
|
188
228
|
*
|
|
189
229
|
* @param url - Base URL of the e3 API server
|
|
190
230
|
* @param repo - Repository name
|
|
191
231
|
* @param workspace - Workspace name
|
|
192
|
-
* @param stateOptions -
|
|
232
|
+
* @param stateOptions - The poll's cursor, and the most events it is served
|
|
193
233
|
* @param options - Request options including auth token
|
|
194
234
|
* @returns Execution state with events and summary
|
|
195
235
|
* @throws {ApiError} On application-level errors
|
|
@@ -197,8 +237,8 @@ export async function taskLogs(url, repo, workspace, task, logOptions = {}, opti
|
|
|
197
237
|
*/
|
|
198
238
|
export async function dataflowExecutePoll(url, repo, workspace, stateOptions = {}, options) {
|
|
199
239
|
const params = new URLSearchParams();
|
|
200
|
-
if (stateOptions.
|
|
201
|
-
params.set('
|
|
240
|
+
if (stateOptions.since != null)
|
|
241
|
+
params.set('since', printSeq(stateOptions.since));
|
|
202
242
|
if (stateOptions.limit != null)
|
|
203
243
|
params.set('limit', String(stateOptions.limit));
|
|
204
244
|
const query = params.toString();
|
|
@@ -229,7 +269,8 @@ export async function dataflowBudget(url, repo, workspace, options) {
|
|
|
229
269
|
* @param repo - Repository name
|
|
230
270
|
* @param workspace - Workspace name
|
|
231
271
|
* @param options - Request options (token, etc.)
|
|
232
|
-
* @throws {ApiError}
|
|
272
|
+
* @throws {ApiError} `dataflow_error`, "No active execution for this
|
|
273
|
+
* workspace", when no execution is running; or why else the cancel failed
|
|
233
274
|
* @throws {AuthError} On 401 Unauthorized
|
|
234
275
|
*/
|
|
235
276
|
export async function dataflowCancel(url, repo, workspace, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../src/executions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,iBAAi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
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.spec.d.ts","sourceRoot":"","sources":["../../src/executions.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Tests for reading a run's events through polls that serve at most 1,000
|
|
7
|
+
* each: `dataflowEventsRemain` says whether a poll left any, and
|
|
8
|
+
* `dataflowExecute` reads them all before it answers with the run's end,
|
|
9
|
+
* through a stand-in server given as the `fetch`.
|
|
10
|
+
*/
|
|
11
|
+
import { describe, it } from 'node:test';
|
|
12
|
+
import assert from 'node:assert/strict';
|
|
13
|
+
import { NullType, encodeBeast2For, none, some, variant } from '@elaraai/east';
|
|
14
|
+
import { ApiDataflowExecutionStateType, BEAST2_CONTENT_TYPE, DATAFLOW_POLL_EVENTS_MAX, ResponseType } from '@elaraai/e3-types';
|
|
15
|
+
import { dataflowEventsRemain, dataflowExecute } from './executions.js';
|
|
16
|
+
const BASE = 'https://e3.test';
|
|
17
|
+
const AT = '2026-10-04T00:00:00.000Z';
|
|
18
|
+
/** A BEAST2 success envelope, as the server sends one. */
|
|
19
|
+
function success(type, value, status = 200) {
|
|
20
|
+
const body = encodeBeast2For(ResponseType(type))(variant('success', value));
|
|
21
|
+
return new Response(body, { status, headers: { 'Content-Type': BEAST2_CONTENT_TYPE } });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A server whose run has ended with `held` task completions, each its own
|
|
25
|
+
* event, and which answers a poll as e3's does: at most its limit past its
|
|
26
|
+
* cursor, and never more than the cap. Its summary names `last` as the run's
|
|
27
|
+
* last event, `held` unless a test has it run ahead of the events.
|
|
28
|
+
*
|
|
29
|
+
* @returns Each poll's query, and the `fetch` the server answers
|
|
30
|
+
*/
|
|
31
|
+
function endedRun(held, last = held) {
|
|
32
|
+
const polls = [];
|
|
33
|
+
const fetch = (async (input, init) => {
|
|
34
|
+
const url = new URL(String(input));
|
|
35
|
+
if ((init?.method ?? 'GET') === 'POST' && url.pathname === '/api/repos/r/workspaces/ws/dataflow')
|
|
36
|
+
return success(NullType, null, 202);
|
|
37
|
+
if (url.pathname !== '/api/repos/r/workspaces/ws/dataflow/execution')
|
|
38
|
+
return new Response(`unexpected ${url.href}`, { status: 500 });
|
|
39
|
+
polls.push(url.search);
|
|
40
|
+
if (polls.length > 10)
|
|
41
|
+
return new Response('the client polled on past the run\'s end', { status: 500 });
|
|
42
|
+
const since = Number(url.searchParams.get('since') ?? '0');
|
|
43
|
+
const limit = Math.min(Number(url.searchParams.get('limit') ?? DATAFLOW_POLL_EVENTS_MAX), DATAFLOW_POLL_EVENTS_MAX);
|
|
44
|
+
const events = Array.from({ length: Math.max(0, Math.min(limit, held - since)) }, (_, i) => variant('complete', { task: `t${since + i + 1}`, timestamp: AT, duration: 1, peakBytes: none }));
|
|
45
|
+
return success(ApiDataflowExecutionStateType, {
|
|
46
|
+
runId: 'run-1', status: variant('completed', null), startedAt: AT, completedAt: some(AT),
|
|
47
|
+
summary: some({ executed: BigInt(held), cached: 0n, failed: 0n, skipped: 0n, duration: 1_000 }),
|
|
48
|
+
events, nextSeq: BigInt(since + events.length), lastSeq: BigInt(last),
|
|
49
|
+
budget: none, waiting: [], splits: [],
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return { polls, fetch };
|
|
53
|
+
}
|
|
54
|
+
/** Counts the client's waits between polls, each answered at once. */
|
|
55
|
+
function countWaits(t) {
|
|
56
|
+
const realSetTimeout = globalThis.setTimeout;
|
|
57
|
+
const waits = t.mock.method(globalThis, 'setTimeout', ((callback) => realSetTimeout(callback, 0)));
|
|
58
|
+
return () => waits.mock.callCount();
|
|
59
|
+
}
|
|
60
|
+
describe('reading a run\'s events', () => {
|
|
61
|
+
it('says whether a poll left events for the next', () => {
|
|
62
|
+
assert.deepEqual([{ nextSeq: 3n, lastSeq: 7n }, { nextSeq: 7n, lastSeq: 7n }, { nextSeq: 0n, lastSeq: 0n }].map(dataflowEventsRemain), [true, false, false]);
|
|
63
|
+
});
|
|
64
|
+
it('reads every event of a run that ended before its first poll, polling again at once, before it answers', async (t) => {
|
|
65
|
+
const waits = countWaits(t);
|
|
66
|
+
const server = endedRun(2_500);
|
|
67
|
+
const result = await dataflowExecute(BASE, 'r', 'ws', {}, { token: null, fetch: server.fetch });
|
|
68
|
+
assert.equal(result.tasks.length, 2_500);
|
|
69
|
+
assert.deepEqual([result.tasks[0].name, result.tasks.at(-1).name], ['t1', 't2500']);
|
|
70
|
+
assert.deepEqual(server.polls, ['?since=0', '?since=1000', '?since=2000']);
|
|
71
|
+
assert.equal(waits(), 0, 'no wait between polls that left events');
|
|
72
|
+
});
|
|
73
|
+
it('answers once a poll serves nothing past its cursor, whatever the summary names, rather than poll again at once', async () => {
|
|
74
|
+
// A store whose summary has run ahead of the events it holds.
|
|
75
|
+
const server = endedRun(5, 10);
|
|
76
|
+
const result = await dataflowExecute(BASE, 'r', 'ws', {}, { token: null, fetch: server.fetch });
|
|
77
|
+
assert.equal(result.tasks.length, 5);
|
|
78
|
+
assert.deepEqual(server.polls, ['?since=0', '?since=5']);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=executions.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executions.spec.js","sourceRoot":"","sources":["../../src/executions.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAoB,MAAM,WAAW,CAAC;AAC3D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAmC,MAAM,eAAe,CAAC;AAChH,OAAO,EAAE,6BAA6B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|
* @param version - Package version
|
|
39
39
|
* @param fn - Function name
|
|
40
40
|
* @param req - The arguments, one beast2 value each, a runner to run on
|
|
41
|
-
* instead of the function's own, and the limits
|
|
41
|
+
* instead of the function's own, and the limits. A package has no workspace
|
|
42
|
+
* to read a dataset argument from: one is `invalid` here, and passed through
|
|
43
|
+
* {@link workspaceFunctionCall}
|
|
42
44
|
* @param options - Request options including auth token
|
|
43
45
|
* @returns The call's terminal result
|
|
44
46
|
* @throws {ApiError} `permission_denied` (`path` `runner`) when the caller may
|
|
@@ -46,27 +48,56 @@ export declare function functionDescribe(url: string, repo: string, pkg: string,
|
|
|
46
48
|
* @throws {AuthError} On 401 Unauthorized
|
|
47
49
|
*/
|
|
48
50
|
export declare function functionCall(url: string, repo: string, pkg: string, version: string, fn: string, req: FunctionCallRequest, options: RequestOptions): Promise<ExecuteResult>;
|
|
49
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* List the deployed package's functions.
|
|
53
|
+
*
|
|
54
|
+
* @param url - Base URL of the e3 API server
|
|
55
|
+
* @param repo - Repository name
|
|
56
|
+
* @param ws - The workspace whose deployed package holds the functions
|
|
57
|
+
* @param options - Request options including auth token
|
|
58
|
+
* @returns Each function's name and signature
|
|
59
|
+
* @throws {ApiError} `workspace_not_deployed` for a workspace nothing is
|
|
60
|
+
* deployed to, and `workspace_not_found`
|
|
61
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
62
|
+
*/
|
|
50
63
|
export declare function workspaceFunctionList(url: string, repo: string, ws: string, options: RequestOptions): Promise<FunctionSignature[]>;
|
|
51
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Describe a function of the deployed package.
|
|
66
|
+
*
|
|
67
|
+
* @param url - Base URL of the e3 API server
|
|
68
|
+
* @param repo - Repository name
|
|
69
|
+
* @param ws - The workspace whose deployed package holds the function
|
|
70
|
+
* @param fn - Function name
|
|
71
|
+
* @param options - Request options including auth token
|
|
72
|
+
* @returns The function's signature
|
|
73
|
+
* @throws {ApiError} `workspace_not_deployed` for a workspace nothing is
|
|
74
|
+
* deployed to, and `workspace_not_found`
|
|
75
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
76
|
+
*/
|
|
52
77
|
export declare function workspaceFunctionDescribe(url: string, repo: string, ws: string, fn: string, options: RequestOptions): Promise<FunctionSignature>;
|
|
53
78
|
/**
|
|
54
79
|
* Call a function of the deployed package synchronously.
|
|
55
80
|
*
|
|
56
81
|
* @remarks
|
|
57
82
|
* A runner the request names is held to the caller's grant, as
|
|
58
|
-
* {@link functionCall} says.
|
|
83
|
+
* {@link functionCall} says. An argument is a value, or a dataset of the
|
|
84
|
+
* workspace (`variant('dataset', path)`), pinned by its hash at launch as a
|
|
85
|
+
* one-shot's is: the result's `inputs` names each dataset argument's path and
|
|
86
|
+
* the hash it was pinned at, in argument order, and an unassigned one is
|
|
87
|
+
* `invalid`.
|
|
59
88
|
*
|
|
60
89
|
* @param url - Base URL of the e3 API server
|
|
61
90
|
* @param repo - Repository name
|
|
62
|
-
* @param ws - The workspace whose deployed package holds the function
|
|
91
|
+
* @param ws - The workspace whose deployed package holds the function, and
|
|
92
|
+
* whose datasets its arguments may name
|
|
63
93
|
* @param fn - Function name
|
|
64
|
-
* @param req - The arguments, a runner to run on
|
|
65
|
-
* own, and the limits
|
|
94
|
+
* @param req - The arguments (values or dataset paths), a runner to run on
|
|
95
|
+
* instead of the function's own, and the limits
|
|
66
96
|
* @param options - Request options including auth token
|
|
67
97
|
* @returns The call's terminal result
|
|
68
98
|
* @throws {ApiError} `permission_denied` (`path` `runner`) when the caller may
|
|
69
|
-
* not run the function on the runner the request names
|
|
99
|
+
* not run the function on the runner the request names, and
|
|
100
|
+
* `workspace_not_found` / `workspace_not_deployed`
|
|
70
101
|
* @throws {AuthError} On 401 Unauthorized
|
|
71
102
|
*/
|
|
72
103
|
export declare function workspaceFunctionCall(url: string, repo: string, ws: string, fn: string, req: FunctionCallRequest, options: RequestOptions): Promise<ExecuteResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAC;AAWpB,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAuBzE,wDAAwD;AACxD,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAE9B;AAED,kEAAkE;AAClE,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iBAAiB,CAAC,CAE5B;AAED
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAChB,MAAM,YAAY,CAAC;AAWpB,OAAO,EAA2B,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAuBzE,wDAAwD;AACxD,wBAAsB,YAAY,CAChC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,iB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ACrB,OAAO,EAAE,cAAc,EACvB,WAAW,GAAE,gBAAqB,GACjC,OAAO,CAAC,eAAe,CAAC,CAO1B"}
|
package/dist/src/functions.js
CHANGED
|
@@ -46,7 +46,9 @@ export async function functionDescribe(url, repo, pkg, version, fn, options) {
|
|
|
46
46
|
* @param version - Package version
|
|
47
47
|
* @param fn - Function name
|
|
48
48
|
* @param req - The arguments, one beast2 value each, a runner to run on
|
|
49
|
-
* instead of the function's own, and the limits
|
|
49
|
+
* instead of the function's own, and the limits. A package has no workspace
|
|
50
|
+
* to read a dataset argument from: one is `invalid` here, and passed through
|
|
51
|
+
* {@link workspaceFunctionCall}
|
|
50
52
|
* @param options - Request options including auth token
|
|
51
53
|
* @returns The call's terminal result
|
|
52
54
|
* @throws {ApiError} `permission_denied` (`path` `runner`) when the caller may
|
|
@@ -59,11 +61,34 @@ export async function functionCall(url, repo, pkg, version, fn, req, options) {
|
|
|
59
61
|
// =============================================================================
|
|
60
62
|
// Workspace-scoped named functions (package resolved from the deployment)
|
|
61
63
|
// =============================================================================
|
|
62
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* List the deployed package's functions.
|
|
66
|
+
*
|
|
67
|
+
* @param url - Base URL of the e3 API server
|
|
68
|
+
* @param repo - Repository name
|
|
69
|
+
* @param ws - The workspace whose deployed package holds the functions
|
|
70
|
+
* @param options - Request options including auth token
|
|
71
|
+
* @returns Each function's name and signature
|
|
72
|
+
* @throws {ApiError} `workspace_not_deployed` for a workspace nothing is
|
|
73
|
+
* deployed to, and `workspace_not_found`
|
|
74
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
75
|
+
*/
|
|
63
76
|
export async function workspaceFunctionList(url, repo, ws, options) {
|
|
64
77
|
return get(url, wsBase(repo, ws), ArrayType(FunctionSignatureType), options);
|
|
65
78
|
}
|
|
66
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Describe a function of the deployed package.
|
|
81
|
+
*
|
|
82
|
+
* @param url - Base URL of the e3 API server
|
|
83
|
+
* @param repo - Repository name
|
|
84
|
+
* @param ws - The workspace whose deployed package holds the function
|
|
85
|
+
* @param fn - Function name
|
|
86
|
+
* @param options - Request options including auth token
|
|
87
|
+
* @returns The function's signature
|
|
88
|
+
* @throws {ApiError} `workspace_not_deployed` for a workspace nothing is
|
|
89
|
+
* deployed to, and `workspace_not_found`
|
|
90
|
+
* @throws {AuthError} On 401 Unauthorized
|
|
91
|
+
*/
|
|
67
92
|
export async function workspaceFunctionDescribe(url, repo, ws, fn, options) {
|
|
68
93
|
return get(url, wsBase(repo, ws, fn), FunctionSignatureType, options);
|
|
69
94
|
}
|
|
@@ -72,18 +97,24 @@ export async function workspaceFunctionDescribe(url, repo, ws, fn, options) {
|
|
|
72
97
|
*
|
|
73
98
|
* @remarks
|
|
74
99
|
* A runner the request names is held to the caller's grant, as
|
|
75
|
-
* {@link functionCall} says.
|
|
100
|
+
* {@link functionCall} says. An argument is a value, or a dataset of the
|
|
101
|
+
* workspace (`variant('dataset', path)`), pinned by its hash at launch as a
|
|
102
|
+
* one-shot's is: the result's `inputs` names each dataset argument's path and
|
|
103
|
+
* the hash it was pinned at, in argument order, and an unassigned one is
|
|
104
|
+
* `invalid`.
|
|
76
105
|
*
|
|
77
106
|
* @param url - Base URL of the e3 API server
|
|
78
107
|
* @param repo - Repository name
|
|
79
|
-
* @param ws - The workspace whose deployed package holds the function
|
|
108
|
+
* @param ws - The workspace whose deployed package holds the function, and
|
|
109
|
+
* whose datasets its arguments may name
|
|
80
110
|
* @param fn - Function name
|
|
81
|
-
* @param req - The arguments, a runner to run on
|
|
82
|
-
* own, and the limits
|
|
111
|
+
* @param req - The arguments (values or dataset paths), a runner to run on
|
|
112
|
+
* instead of the function's own, and the limits
|
|
83
113
|
* @param options - Request options including auth token
|
|
84
114
|
* @returns The call's terminal result
|
|
85
115
|
* @throws {ApiError} `permission_denied` (`path` `runner`) when the caller may
|
|
86
|
-
* not run the function on the runner the request names
|
|
116
|
+
* not run the function on the runner the request names, and
|
|
117
|
+
* `workspace_not_found` / `workspace_not_deployed`
|
|
87
118
|
* @throws {AuthError} On 401 Unauthorized
|
|
88
119
|
*/
|
|
89
120
|
export async function workspaceFunctionCall(url, repo, ws, fn, req, options) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../src/functions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2BH,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAuB,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAE/B,SAAS,OAAO,CAAC,IAAY,EAAE,GAAW,EAAE,OAAe,EAAE,EAAW;IACtE,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;IAClF,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,EAAU,EAAE,EAAW;IACnD,MAAM,IAAI,GAAG,UAAU,GAAG,CAAC,IAAI,CAAC,eAAe,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC;IACnE,OAAO,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CA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AAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC/E,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
|
package/dist/src/http.d.ts
CHANGED
|
@@ -35,8 +35,17 @@ export interface RetryOptions {
|
|
|
35
35
|
attempts?: number;
|
|
36
36
|
/** Base delay for exponential backoff, in milliseconds (default 100). */
|
|
37
37
|
baseDelayMs?: number;
|
|
38
|
-
/** Upper bound on any single backoff delay
|
|
38
|
+
/** Upper bound on any single backoff delay the client picks itself, in
|
|
39
|
+
* milliseconds (default 2000). A server's `Retry-After` is bounded by
|
|
40
|
+
* {@link maxRetryAfterMs} instead. */
|
|
39
41
|
maxDelayMs?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Upper bound on a server's `Retry-After` hint, in milliseconds (default
|
|
44
|
+
* 30000). A server that asks for longer than the client's own backoff is
|
|
45
|
+
* waited for as it asks, up to this: e3-api-server's repository gate asks
|
|
46
|
+
* for 5 s while an upgrade it owes waits.
|
|
47
|
+
*/
|
|
48
|
+
maxRetryAfterMs?: number;
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* Request options for authenticated API calls.
|
|
@@ -57,7 +66,33 @@ export interface RequestOptions {
|
|
|
57
66
|
* param — no wire-type change — so a server that predates it simply ignores
|
|
58
67
|
* it. Runtime-only: never affects hashing or caching. */
|
|
59
68
|
verbose?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The `fetch` every request of the call goes through: its API requests, the
|
|
71
|
+
* upload and download URLs they are sent to, and their retries. Absent, the
|
|
72
|
+
* global `fetch`.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* A host that answers e3's API itself passes its own: e3 running in a page,
|
|
76
|
+
* whose requests a function answers rather than the network. The client
|
|
77
|
+
* calls it as a plain function, never as a method of these options, so a
|
|
78
|
+
* browser's `fetch` passed as it stands works.
|
|
79
|
+
*/
|
|
80
|
+
fetch?: typeof globalThis.fetch;
|
|
60
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* The `fetch` a request goes through: the one its options give, or the global
|
|
84
|
+
* `fetch`, looked up when the request is made.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The result is called as a plain function, never as a method of the options:
|
|
88
|
+
* a browser's `fetch` refuses to run with another object as its `this`.
|
|
89
|
+
*
|
|
90
|
+
* @param options - The request's options
|
|
91
|
+
* @returns The `fetch` to call
|
|
92
|
+
*/
|
|
93
|
+
export declare function requestFetch(options: {
|
|
94
|
+
fetch?: typeof globalThis.fetch;
|
|
95
|
+
}): typeof globalThis.fetch;
|
|
61
96
|
/** Append `?verbose=1` to an endpoint path when verbose was requested. */
|
|
62
97
|
export declare function verboseQuery(path: string, options: RequestOptions): string;
|
|
63
98
|
/**
|
|
@@ -113,8 +148,9 @@ export declare function isRetryableNetworkError(err: unknown): boolean;
|
|
|
113
148
|
*/
|
|
114
149
|
export declare function parseRetryAfter(value: string | null, nowMs: number): number | undefined;
|
|
115
150
|
/**
|
|
116
|
-
* Compute the delay before the next attempt. A server `Retry-After` hint wins
|
|
117
|
-
*
|
|
151
|
+
* Compute the delay before the next attempt. A server `Retry-After` hint wins,
|
|
152
|
+
* waited for as the server asks up to `maxRetryAfterMs` — however far past the
|
|
153
|
+
* client's own backoff cap; otherwise exponential backoff with full jitter — a
|
|
118
154
|
* uniform random point in `[0, min(maxDelayMs, baseDelayMs · 2^attempt)]` — which
|
|
119
155
|
* spreads retries so concurrent clients don't lock-step a cold upstream.
|
|
120
156
|
*
|
|
@@ -148,13 +184,15 @@ export declare function computeBackoffMs(attempt: number, cfg: Required<RetryOpt
|
|
|
148
184
|
* @param init - Standard `fetch` init; a re-readable body (string / `Uint8Array` / `Blob`) is required for a retry to resend it.
|
|
149
185
|
* Pass a function to build the init afresh for every attempt instead — the way to retry a body that is a stream, which
|
|
150
186
|
* one attempt consumes.
|
|
151
|
-
* @param opts - `idempotent` gates transient-status retries; `retry` overrides the {@link DEFAULT_RETRY} policy (set `attempts: 1` to opt out)
|
|
187
|
+
* @param opts - `idempotent` gates transient-status retries; `retry` overrides the {@link DEFAULT_RETRY} policy (set `attempts: 1` to opt out);
|
|
188
|
+
* `fetch` is the `fetch` every attempt goes through ({@link RequestOptions.fetch}), the global one when absent.
|
|
152
189
|
* @returns The final `fetch` response — a success, or the last transient/non-retryable response for the caller to decode.
|
|
153
190
|
* @throws The original error once retries are exhausted or the error is non-retryable; the abort reason if `init.signal` aborts.
|
|
154
191
|
*/
|
|
155
192
|
export declare function fetchWithRetry(input: string | URL, init: RequestInit | (() => RequestInit), opts: {
|
|
156
193
|
idempotent: boolean;
|
|
157
194
|
retry?: RetryOptions;
|
|
195
|
+
fetch?: typeof globalThis.fetch;
|
|
158
196
|
}): Promise<globalThis.Response>;
|
|
159
197
|
/**
|
|
160
198
|
* Fetch with consistent auth header injection and 401 → AuthError handling.
|
|
@@ -167,8 +205,21 @@ export declare function fetchWithRetry(input: string | URL, init: RequestInit |
|
|
|
167
205
|
*/
|
|
168
206
|
export declare function fetchWithAuth(input: string, init: RequestInit, options: RequestOptions): Promise<globalThis.Response>;
|
|
169
207
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
208
|
+
* Read an error answer's body as the `ApiError` the rest of the client throws.
|
|
209
|
+
*
|
|
210
|
+
* @remarks
|
|
211
|
+
* A JSON `{ error: { type, message } }` — what a route that answers JSON, and
|
|
212
|
+
* the repository gate, refuse with — gives its type as the code and its
|
|
213
|
+
* message as the details; a JSON `{ message }` gives its message under the
|
|
214
|
+
* fallback code; any other body is the details under the fallback code. A
|
|
215
|
+
* client of a host's own route, built on {@link fetchWithAuth}, throws its
|
|
216
|
+
* refusals through it, so they carry the codes every other client function's
|
|
217
|
+
* do.
|
|
218
|
+
*
|
|
219
|
+
* @param text - The answer's body
|
|
220
|
+
* @param fallbackCode - The code when the body names none, such as one by the
|
|
221
|
+
* answer's HTTP status
|
|
222
|
+
* @returns The error
|
|
172
223
|
*/
|
|
173
224
|
export declare function parseErrorBody(text: string, fallbackCode: string): ApiError;
|
|
174
225
|
/**
|
|
@@ -211,6 +262,13 @@ export declare function putEmpty<T extends EastType>(url: string, path: string,
|
|
|
211
262
|
* The initial request is retried per {@link fetchWithRetry} (GET is idempotent);
|
|
212
263
|
* once streaming begins a mid-stream failure surfaces, since a partial download
|
|
213
264
|
* cannot be safely resumed.
|
|
265
|
+
*
|
|
266
|
+
* @param url - The URL to download
|
|
267
|
+
* @param onProgress - Told the bytes downloaded so far and the total
|
|
268
|
+
* @param signal - Aborts the download
|
|
269
|
+
* @param fetch - The `fetch` the download goes through
|
|
270
|
+
* ({@link RequestOptions.fetch}); the global one when absent
|
|
271
|
+
* @returns The downloaded bytes
|
|
214
272
|
*/
|
|
215
|
-
export declare function fetchWithProgress(url: string, onProgress?: (downloaded: number, total: number) => void, signal?: AbortSignal): Promise<Uint8Array>;
|
|
273
|
+
export declare function fetchWithProgress(url: string, onProgress?: (downloaded: number, total: number) => void, signal?: AbortSignal, fetch?: typeof globalThis.fetch): Promise<Uint8Array>;
|
|
216
274
|
//# 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;AAE3D,OAAO,EAAgB,SAAS,EAAE,MAAM,YAAY,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC,OAAO,SAAS,CAAC,CAAA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