@elaraai/e3-types 1.0.93 → 1.0.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/beast2-http.d.ts +65 -0
- package/dist/src/beast2-http.d.ts.map +1 -0
- package/dist/src/beast2-http.js +77 -0
- package/dist/src/beast2-http.js.map +1 -0
- package/dist/src/beast2-http.spec.d.ts +6 -0
- package/dist/src/beast2-http.spec.d.ts.map +1 -0
- package/dist/src/beast2-http.spec.js +34 -0
- package/dist/src/beast2-http.spec.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/release.d.ts +1 -1
- package/dist/src/release.js +1 -1
- package/package.json +2 -2
- package/src/beast2-http.spec.ts +37 -0
- package/src/beast2-http.ts +90 -0
- package/src/index.ts +4 -0
- package/src/release.ts +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The BEAST2 envelopes of e3's HTTP APIs over the standard `Request` and
|
|
7
|
+
* `Response`, which every host has: a Hono route, a Lambda handler, a page's
|
|
8
|
+
* worker. A request's body is BEAST2 and says so in its `Content-Type`; an
|
|
9
|
+
* answer is the {@link ResponseType} envelope, `success` or `error`, with the
|
|
10
|
+
* same content type.
|
|
11
|
+
*/
|
|
12
|
+
import { type EastType, type ValueTypeOf } from '@elaraai/east';
|
|
13
|
+
import { ErrorType } from './api.js';
|
|
14
|
+
/**
|
|
15
|
+
* Decodes a request's BEAST2 body as a value of a type.
|
|
16
|
+
*
|
|
17
|
+
* @param request - The request, whose `Content-Type` must be BEAST2's
|
|
18
|
+
* @param type - The type of the body's value
|
|
19
|
+
* @returns The decoded value
|
|
20
|
+
*
|
|
21
|
+
* @throws {Error} When the content type is another, or the body does not decode
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const body = await decodeBeast2Request(c.req.raw, WorkspaceCreateRequestType);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function decodeBeast2Request<T extends EastType>(request: Request, type: T): Promise<ValueTypeOf<T>>;
|
|
29
|
+
/** What an answer carries beside its envelope. */
|
|
30
|
+
export interface Beast2AnswerOptions {
|
|
31
|
+
/** The HTTP status: 200 unless given */
|
|
32
|
+
status?: number;
|
|
33
|
+
/** Headers beside the body's, such as the `ETag` a conditional route names its answer by */
|
|
34
|
+
headers?: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Answers a success envelope: the value, under `success`, as BEAST2.
|
|
38
|
+
*
|
|
39
|
+
* @param type - The type of the answer's value
|
|
40
|
+
* @param value - The answer's value
|
|
41
|
+
* @param options - The status and the headers beside the body's
|
|
42
|
+
* @returns The response
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* return beast2Success(WorkspaceInfoType, info, { headers: { ETag: tag } });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function beast2Success<T extends EastType>(type: T, value: ValueTypeOf<T>, options?: Beast2AnswerOptions): Response;
|
|
50
|
+
/**
|
|
51
|
+
* Answers an error envelope: the error, under `error`, as BEAST2, with
|
|
52
|
+
* status 200 unless given: the envelope says what went wrong.
|
|
53
|
+
*
|
|
54
|
+
* @param type - The type the answer's value would have had
|
|
55
|
+
* @param error - What went wrong
|
|
56
|
+
* @param options - The status and the headers beside the body's
|
|
57
|
+
* @returns The response
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* return beast2Error(WorkspaceInfoType, variant('workspace_not_found', { workspace }));
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function beast2Error<T extends EastType>(type: T, error: ValueTypeOf<typeof ErrorType>, options?: Beast2AnswerOptions): Response;
|
|
65
|
+
//# sourceMappingURL=beast2-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beast2-http.d.ts","sourceRoot":"","sources":["../../src/beast2-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAA6C,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,SAAS,EAAgB,MAAM,UAAU,CAAC;AAGnD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,SAAS,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAMhH;AAED,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,GAAE,mBAAwB,GAAG,QAAQ,CAG7H;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,SAAS,CAAC,EAAE,OAAO,GAAE,mBAAwB,GAAG,QAAQ,CAG1I"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The BEAST2 envelopes of e3's HTTP APIs over the standard `Request` and
|
|
7
|
+
* `Response`, which every host has: a Hono route, a Lambda handler, a page's
|
|
8
|
+
* worker. A request's body is BEAST2 and says so in its `Content-Type`; an
|
|
9
|
+
* answer is the {@link ResponseType} envelope, `success` or `error`, with the
|
|
10
|
+
* same content type.
|
|
11
|
+
*/
|
|
12
|
+
import { decodeBeast2For, encodeBeast2For, variant } from '@elaraai/east';
|
|
13
|
+
import { ResponseType } from './api.js';
|
|
14
|
+
import { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
15
|
+
/**
|
|
16
|
+
* Decodes a request's BEAST2 body as a value of a type.
|
|
17
|
+
*
|
|
18
|
+
* @param request - The request, whose `Content-Type` must be BEAST2's
|
|
19
|
+
* @param type - The type of the body's value
|
|
20
|
+
* @returns The decoded value
|
|
21
|
+
*
|
|
22
|
+
* @throws {Error} When the content type is another, or the body does not decode
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const body = await decodeBeast2Request(c.req.raw, WorkspaceCreateRequestType);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export async function decodeBeast2Request(request, type) {
|
|
30
|
+
const contentType = request.headers.get('content-type');
|
|
31
|
+
if (contentType !== BEAST2_CONTENT_TYPE) {
|
|
32
|
+
throw new Error(`Expected Content-Type: ${BEAST2_CONTENT_TYPE}, got ${contentType ?? 'none'}`);
|
|
33
|
+
}
|
|
34
|
+
return decodeBeast2For(type)(new Uint8Array(await request.arrayBuffer()));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Answers a success envelope: the value, under `success`, as BEAST2.
|
|
38
|
+
*
|
|
39
|
+
* @param type - The type of the answer's value
|
|
40
|
+
* @param value - The answer's value
|
|
41
|
+
* @param options - The status and the headers beside the body's
|
|
42
|
+
* @returns The response
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* return beast2Success(WorkspaceInfoType, info, { headers: { ETag: tag } });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export function beast2Success(type, value, options = {}) {
|
|
50
|
+
const responseType = ResponseType(type);
|
|
51
|
+
return answer(encodeBeast2For(responseType)(variant('success', value)), options);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Answers an error envelope: the error, under `error`, as BEAST2, with
|
|
55
|
+
* status 200 unless given: the envelope says what went wrong.
|
|
56
|
+
*
|
|
57
|
+
* @param type - The type the answer's value would have had
|
|
58
|
+
* @param error - What went wrong
|
|
59
|
+
* @param options - The status and the headers beside the body's
|
|
60
|
+
* @returns The response
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* return beast2Error(WorkspaceInfoType, variant('workspace_not_found', { workspace }));
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
export function beast2Error(type, error, options = {}) {
|
|
68
|
+
const responseType = ResponseType(type);
|
|
69
|
+
return answer(encodeBeast2For(responseType)(variant('error', error)), options);
|
|
70
|
+
}
|
|
71
|
+
function answer(body, options) {
|
|
72
|
+
return new Response(body, {
|
|
73
|
+
status: options.status ?? 200,
|
|
74
|
+
headers: { 'Content-Type': BEAST2_CONTENT_TYPE, 'Content-Length': String(body.byteLength), ...options.headers },
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=beast2-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beast2-http.js","sourceRoot":"","sources":["../../src/beast2-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAmC,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAa,YAAY,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,mBAAmB,E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CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE;KAChH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beast2-http.spec.d.ts","sourceRoot":"","sources":["../../src/beast2-http.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { describe, it } from 'node:test';
|
|
6
|
+
import assert from 'node:assert/strict';
|
|
7
|
+
import { IntegerType, decodeBeast2For, encodeBeast2For, equalFor, variant } from '@elaraai/east';
|
|
8
|
+
import { ResponseType } from './api.js';
|
|
9
|
+
import { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
10
|
+
import { beast2Error, beast2Success, decodeBeast2Request } from './beast2-http.js';
|
|
11
|
+
const sameAnswer = equalFor(ResponseType(IntegerType));
|
|
12
|
+
const decodeAnswer = decodeBeast2For(ResponseType(IntegerType));
|
|
13
|
+
describe('beast2 over Request and Response', () => {
|
|
14
|
+
it('decodes a BEAST2 request body and refuses another content type', async () => {
|
|
15
|
+
const body = encodeBeast2For(IntegerType)(42n);
|
|
16
|
+
const request = new Request('http://e3.test/v1', { method: 'POST', headers: { 'content-type': BEAST2_CONTENT_TYPE }, body });
|
|
17
|
+
assert.equal(await decodeBeast2Request(request, IntegerType), 42n);
|
|
18
|
+
const json = new Request('http://e3.test/v1', { method: 'POST', headers: { 'content-type': 'application/json' }, body: '42' });
|
|
19
|
+
await assert.rejects(decodeBeast2Request(json, IntegerType), /Expected Content-Type/);
|
|
20
|
+
});
|
|
21
|
+
it('answers success and error envelopes with the status and headers asked for', async () => {
|
|
22
|
+
const ok = beast2Success(IntegerType, 7n, { status: 202, headers: { ETag: '"a"' } });
|
|
23
|
+
assert.equal(ok.status, 202);
|
|
24
|
+
assert.equal(ok.headers.get('content-type'), BEAST2_CONTENT_TYPE);
|
|
25
|
+
assert.equal(ok.headers.get('etag'), '"a"');
|
|
26
|
+
const bytes = new Uint8Array(await ok.arrayBuffer());
|
|
27
|
+
assert.equal(ok.headers.get('content-length'), String(bytes.byteLength));
|
|
28
|
+
assert(sameAnswer(decodeAnswer(bytes), variant('success', 7n)));
|
|
29
|
+
const failed = beast2Error(IntegerType, variant('internal', { message: 'no' }));
|
|
30
|
+
assert.equal(failed.status, 200);
|
|
31
|
+
assert(sameAnswer(decodeAnswer(new Uint8Array(await failed.arrayBuffer())), variant('error', variant('internal', { message: 'no' }))));
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=beast2-http.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beast2-http.spec.js","sourceRoot":"","sources":["../../src/beast2-http.spec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;AACvD,MAAM,YAAY,GAAG,eAAe,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;AAEhE,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,EAAE,CAAC,gEAAgE,EAAE,KAAK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,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAChE,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzI,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export { isCollectionRoot, encodeDatasetBlob, writeCollectionManifest, SEGMENT_W
|
|
|
41
41
|
export { COLLECTION_MANIFEST_KIND, CollectionManifestType, CollectionManifestEntryType, type CollectionManifest, type CollectionManifestEntry, isCollectionManifestType, isCollectionManifest, encodeCollectionManifest, decodeCollectionManifest, manifestElementCount, manifestByteSize, } from './collection-manifest.js';
|
|
42
42
|
export { checkDatasetType, datasetAddress, type DatasetTypeMismatch, } from './dataset-type.js';
|
|
43
43
|
export { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
44
|
+
export { decodeBeast2Request, beast2Success, beast2Error, type Beast2AnswerOptions } from './beast2-http.js';
|
|
44
45
|
export { WorkspaceNotFoundErrorType, WorkspaceNotDeployedErrorType, WorkspaceExistsErrorType, LockHolderType, WorkspaceLockedErrorType, PackageNotFoundErrorType, PackageExistsErrorType, PackageInvalidErrorType, DatasetNotFoundErrorType, TaskNotFoundErrorType, ExecutionNotFoundErrorType, ObjectNotFoundErrorType, DataflowErrorType, PermissionDeniedErrorType, InternalErrorType, RepositoryNotFoundErrorType, DatasetTypeMismatchErrorType, InvalidNameErrorType, ErrorType, ResponseType, RepositoryStatusType, GcRequestType, GcResultType, AsyncOperationStatusType, GcStartResultType, GcStatusResultType, RepositoryRemovalType, PackageListItemType, PackageInfoType, PackageDetailsType, WorkspaceCreateRequestType, WorkspaceCopyRequestType, WorkspaceInfoType, SchemaPolicyType, InputPolicyType, WorkspaceDeployRequestType, RecordPlanType, RecordIndexPlanType, InputPlanType, RecordDeployStepType, RecordDeployStateType, DeployProgressType, WorkspaceDeployResultType, WorkspaceDeployProgressType, WorkspaceDeployStatusType, WorkspaceExportRequestType, DatasetStatusType, TaskStatusUpToDateType, TaskStatusWaitingType, TaskStatusInProgressType, TaskStatusFailedType, TaskStatusErrorType, TaskStatusStaleRunningType, TaskStatusType, DatasetStatusInfoType, TaskStatusInfoType, WorkspaceStatusSummaryType, WorkspaceStatusResultType, TaskListItemType, TaskDetailsType, DataflowRequestType, LogChunkType, TaskLogChunkType, TaskExecutionResultType, DataflowResultType, DataflowEventType, ApiExecutionStatusType, DataflowExecutionSummaryType, DataflowBudgetType, UnitWaitType, SplitProgressType, ApiDataflowExecutionStateType, DATAFLOW_POLL_EVENTS_MAX, ExecutionHistoryStatusType, ExecutionListItemType, TASK_EXECUTIONS_PAGE_DEFAULT, TASK_EXECUTIONS_PAGE_MAX, TreeKindType, ListEntryType, DatasetStatusDetailType, ExecuteLimitsType, DiagnosticType, ExecuteResultType, CallArgType, FunctionCallRequestType, FunctionSignatureType, OneShotRequestType, SplitCallArgType, SplitCallRequestType, SplitCallProgressType, SplitCallStatusType, SplitCallPlanType, MutationCallRequestType, MutationResultType, RecordMigrationAppliedType, RecordSignatureType, RecordCommitInfoType, RecordArgPreviewType, RecordCommitArgsType, RecordHistoryCommitType, RecordHistoryResultType, RECORD_ARG_TEXT_CHARS, RECORD_ARG_TEXT_BYTES, RECORD_ARGS_READ_BYTES, type Error, type RepositoryStatus, type GcRequest, type GcResult, type AsyncOperationStatus, type GcStartResult, type GcStatusResult, type RepositoryRemoval, type PackageListItem, type PackageInfo, type PackageDetails, type WorkspaceInfo, type WorkspaceCreateRequest, type WorkspaceCopyRequest, type WorkspaceDeployRequest, type SchemaPolicy, type InputPolicy, type RecordPlan, type RecordIndexPlan, type InputPlan, type RecordDeployStep, type RecordDeployState, type DeployProgress, type WorkspaceDeployResult, type WorkspaceDeployProgress, type WorkspaceDeployStatus, type DatasetStatus, type TaskStatus as ApiTaskStatus, type DatasetStatusInfo, type TaskStatusInfo, type WorkspaceStatusSummary, type WorkspaceStatusResult, type TaskListItem, type TaskDetails, type DataflowRequest, type LogChunk, type TaskLogChunk, type TaskExecutionResult, type DataflowResult, type DataflowEvent, type ApiExecutionStatus, type DataflowExecutionSummary, type DataflowBudget, type UnitWait, type SplitProgress, type ApiDataflowExecutionState, type ExecutionHistoryStatus, type ExecutionListItem, type TreeKind, type ListEntry, type DatasetStatusDetail, type ExecuteLimits, type Diagnostic, type ExecuteResult, type CallArg, type FunctionCallRequest, type FunctionSignature, type OneShotRequest, type SplitCallArg, type SplitCallRequest, type SplitCallProgress, type SplitCallStatus, type SplitCallPlan, type MutationCallRequest, type MutationResult, type RecordMigrationApplied, type RecordSignature, type RecordCommitInfo, type RecordArgPreview, type RecordCommitArgs, type RecordHistoryCommit, type RecordHistoryResult, } from './api.js';
|
|
45
46
|
export { type DataflowExecutionStatus, type TaskStatus, TaskStateType, type TaskState, DataflowGraphTaskType, type DataflowGraphTask, DataflowGraphType, type DataflowGraph, StageUnitType, type StageUnit, RequeueReasonType, type RequeueReason, ExecutionEventType, type ExecutionEvent, type PartitionProgress, DataflowForceType, type DataflowForce, dataflowForce, dataflowForceOption, DataflowExecutionStateType, type DataflowExecutionState, decodeDataflowExecutionState, ExecutionStateSummaryType, type ExecutionStateSummary, executionStateSummary, lastEventSeq, DataflowRunStatusType, type DataflowRunStatus, TaskExecutionRecordType, type TaskExecutionRecord, DataflowRunSummaryType, type DataflowRunSummary, DataflowRunType, type DataflowRun, } from './dataflow.js';
|
|
46
47
|
export { PIECE_SIZES, type PieceSizes } from './pieces.js';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,UAAU,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,QAAQ,EACb,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,SAAS,EACd,kBAAkB,EAClB,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,QAAQ,GACd,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,KAAK,eAAe,EACpB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,4BAA4B,EAC5B,KAAK,wBAAwB,EAC7B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,aAAa,EACb,KAAK,SAAS,EACd,eAAe,EACf,KAAK,WAAW,EAChB,YAAY,EACZ,KAA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B,GAC1B,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,KAAK,UAAU,EACf,gBAAgB,EAChB,YAAY,EACZ,KAAK,QAAQ,EACb,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,SAAS,EACd,kBAAkB,EAClB,KAAK,cAAc,EACnB,cAAc,EACd,KAAK,UAAU,EACf,gBAAgB,EAChB,KAAK,YAAY,EACjB,YAAY,EACZ,KAAK,QAAQ,GACd,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACpB,qBAAqB,EACrB,KAAK,iBAAiB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AgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,aAAa,EACb,KAAK,SAAS,EACd,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,SAAS,EACd,iBAAiB,EACjB,KAAK,aAAa,EAClB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,sBAAsB,EAC3B,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,YAAY,EAEZ,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,eAAe,EACf,KAAK,WAAW,GACjB,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,QAAQ,EACb,cAAc,EACd,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -68,6 +68,9 @@ export { COLLECTION_MANIFEST_KIND, CollectionManifestType, CollectionManifestEnt
|
|
|
68
68
|
export { checkDatasetType, datasetAddress, } from './dataset-type.js';
|
|
69
69
|
// Wire format constants
|
|
70
70
|
export { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
71
|
+
// The BEAST2 request and answer envelopes over the standard Request and
|
|
72
|
+
// Response, which every host's routes answer with
|
|
73
|
+
export { decodeBeast2Request, beast2Success, beast2Error } from './beast2-http.js';
|
|
71
74
|
// API wire types (shared between e3-api-client and e3-api-server)
|
|
72
75
|
export {
|
|
73
76
|
// Error types
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,4BAA4B;AAC5B,OAAO,EACL,WAAW,EAEX,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,2DAA2D;AAC3D,OAAO,EACL,iBAAiB,EAEjB,cAAc,GAEf,MAAM,kBAAkB,CAAC;AAE1B,mBAAmB;AACnB,OAAO,EACL,gBAAgB,EAChB,cAAc,EAEd,gBAAgB,EAChB,YAAY,EAEZ,iBAAiB,EAEjB,aAAa,EAEb,kBAAkB,EAElB,cAAc,EAEd,gBAAgB,EAEhB,YAAY,GAEb,MAAM,WAAW,CAAC;AAEnB,yBAAyB;AACzB,OAAO,EACL,mBAAmB,EAEnB,qBAAqB,EAErB,mBAAmB,EAEnB,oBAAoB,EAEpB,oBAAoB,EAEpB,4BAA4B,EAE5B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAE1B,2BAA2B;AAC3B,OAAO,EACL,aAAa,EAEb,eAAe,EAEf,YAAY,EAKZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,oBAAoB;AACpB,OAAO,EACL,UAAU,EAEV,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,mBAAmB;AACnB,OAAO,EACL,kBAAkB,EAElB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB,iBAAiB;AACjB,OAAO,EACL,gBAAgB,EAEhB,kBAAkB,EAElB,gBAAgB,EAEhB,kBAAkB,EAClB,qBAAqB,E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B,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GA0EvB,MAAM,UAAU,CAAC;AAElB,2BAA2B;AAC3B,OAAO,EAGL,aAAa,EAEb,qBAAqB,EAErB,iBAAiB,EAEjB,aAAa,EAEb,iBAAiB,EAEjB,kBAAkB,EAGlB,iBAAiB,EAEjB,aAAa,EACb,mBAAmB,EACnB,0BAA0B,EAE1B,4BAA4B,EAC5B,yBAAyB,EAEzB,qBAAqB,EACrB,YAAY;AACZ,uBAAuB;AACvB,qBAAqB,EAErB,uBAAuB,EAEvB,sBAAsB,EAEtB,eAAe,GAEhB,MAAM,eAAe,CAAC;AAEvB,wEAAwE;AACxE,iDAAiD;AACjD,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAE3D,+CAA+C;AAC/C,OAAO,EACL,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAEjB,YAAY,EAEZ,cAAc,EACd,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|
package/dist/src/release.d.ts
CHANGED
package/dist/src/release.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* release beside this one.
|
|
16
16
|
*/
|
|
17
17
|
/** The release of e3 this build is. */
|
|
18
|
-
export const E3_RELEASE = '1.0.
|
|
18
|
+
export const E3_RELEASE = '1.0.95';
|
|
19
19
|
/** A semantic version: its core, a pre-release, and build metadata. */
|
|
20
20
|
const RELEASE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
21
21
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elaraai/e3-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.95",
|
|
4
4
|
"description": "Shared type definitions for e3 (East Execution Engine)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"directory": "libs/e3/packages/e3-types"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@elaraai/east": "1.0.
|
|
21
|
+
"@elaraai/east": "1.0.95"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^22.0.0",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, it } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { IntegerType, decodeBeast2For, encodeBeast2For, equalFor, variant } from '@elaraai/east';
|
|
9
|
+
import { ResponseType } from './api.js';
|
|
10
|
+
import { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
11
|
+
import { beast2Error, beast2Success, decodeBeast2Request } from './beast2-http.js';
|
|
12
|
+
|
|
13
|
+
const sameAnswer = equalFor(ResponseType(IntegerType));
|
|
14
|
+
const decodeAnswer = decodeBeast2For(ResponseType(IntegerType));
|
|
15
|
+
|
|
16
|
+
describe('beast2 over Request and Response', () => {
|
|
17
|
+
it('decodes a BEAST2 request body and refuses another content type', async () => {
|
|
18
|
+
const body = encodeBeast2For(IntegerType)(42n);
|
|
19
|
+
const request = new Request('http://e3.test/v1', { method: 'POST', headers: { 'content-type': BEAST2_CONTENT_TYPE }, body });
|
|
20
|
+
assert.equal(await decodeBeast2Request(request, IntegerType), 42n);
|
|
21
|
+
const json = new Request('http://e3.test/v1', { method: 'POST', headers: { 'content-type': 'application/json' }, body: '42' });
|
|
22
|
+
await assert.rejects(decodeBeast2Request(json, IntegerType), /Expected Content-Type/);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('answers success and error envelopes with the status and headers asked for', async () => {
|
|
26
|
+
const ok = beast2Success(IntegerType, 7n, { status: 202, headers: { ETag: '"a"' } });
|
|
27
|
+
assert.equal(ok.status, 202);
|
|
28
|
+
assert.equal(ok.headers.get('content-type'), BEAST2_CONTENT_TYPE);
|
|
29
|
+
assert.equal(ok.headers.get('etag'), '"a"');
|
|
30
|
+
const bytes = new Uint8Array(await ok.arrayBuffer());
|
|
31
|
+
assert.equal(ok.headers.get('content-length'), String(bytes.byteLength));
|
|
32
|
+
assert(sameAnswer(decodeAnswer(bytes), variant('success', 7n)));
|
|
33
|
+
const failed = beast2Error(IntegerType, variant('internal', { message: 'no' }));
|
|
34
|
+
assert.equal(failed.status, 200);
|
|
35
|
+
assert(sameAnswer(decodeAnswer(new Uint8Array(await failed.arrayBuffer())), variant('error', variant('internal', { message: 'no' }))));
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The BEAST2 envelopes of e3's HTTP APIs over the standard `Request` and
|
|
8
|
+
* `Response`, which every host has: a Hono route, a Lambda handler, a page's
|
|
9
|
+
* worker. A request's body is BEAST2 and says so in its `Content-Type`; an
|
|
10
|
+
* answer is the {@link ResponseType} envelope, `success` or `error`, with the
|
|
11
|
+
* same content type.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { decodeBeast2For, encodeBeast2For, variant, type EastType, type ValueTypeOf } from '@elaraai/east';
|
|
15
|
+
import { ErrorType, ResponseType } from './api.js';
|
|
16
|
+
import { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Decodes a request's BEAST2 body as a value of a type.
|
|
20
|
+
*
|
|
21
|
+
* @param request - The request, whose `Content-Type` must be BEAST2's
|
|
22
|
+
* @param type - The type of the body's value
|
|
23
|
+
* @returns The decoded value
|
|
24
|
+
*
|
|
25
|
+
* @throws {Error} When the content type is another, or the body does not decode
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const body = await decodeBeast2Request(c.req.raw, WorkspaceCreateRequestType);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export async function decodeBeast2Request<T extends EastType>(request: Request, type: T): Promise<ValueTypeOf<T>> {
|
|
33
|
+
const contentType = request.headers.get('content-type');
|
|
34
|
+
if (contentType !== BEAST2_CONTENT_TYPE) {
|
|
35
|
+
throw new Error(`Expected Content-Type: ${BEAST2_CONTENT_TYPE}, got ${contentType ?? 'none'}`);
|
|
36
|
+
}
|
|
37
|
+
return decodeBeast2For(type)(new Uint8Array(await request.arrayBuffer()));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** What an answer carries beside its envelope. */
|
|
41
|
+
export interface Beast2AnswerOptions {
|
|
42
|
+
/** The HTTP status: 200 unless given */
|
|
43
|
+
status?: number;
|
|
44
|
+
/** Headers beside the body's, such as the `ETag` a conditional route names its answer by */
|
|
45
|
+
headers?: Record<string, string>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Answers a success envelope: the value, under `success`, as BEAST2.
|
|
50
|
+
*
|
|
51
|
+
* @param type - The type of the answer's value
|
|
52
|
+
* @param value - The answer's value
|
|
53
|
+
* @param options - The status and the headers beside the body's
|
|
54
|
+
* @returns The response
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* return beast2Success(WorkspaceInfoType, info, { headers: { ETag: tag } });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export function beast2Success<T extends EastType>(type: T, value: ValueTypeOf<T>, options: Beast2AnswerOptions = {}): Response {
|
|
62
|
+
const responseType = ResponseType(type);
|
|
63
|
+
return answer(encodeBeast2For(responseType)(variant('success', value) as ValueTypeOf<typeof responseType>), options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Answers an error envelope: the error, under `error`, as BEAST2, with
|
|
68
|
+
* status 200 unless given: the envelope says what went wrong.
|
|
69
|
+
*
|
|
70
|
+
* @param type - The type the answer's value would have had
|
|
71
|
+
* @param error - What went wrong
|
|
72
|
+
* @param options - The status and the headers beside the body's
|
|
73
|
+
* @returns The response
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* return beast2Error(WorkspaceInfoType, variant('workspace_not_found', { workspace }));
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export function beast2Error<T extends EastType>(type: T, error: ValueTypeOf<typeof ErrorType>, options: Beast2AnswerOptions = {}): Response {
|
|
81
|
+
const responseType = ResponseType(type);
|
|
82
|
+
return answer(encodeBeast2For(responseType)(variant('error', error) as ValueTypeOf<typeof responseType>), options);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function answer(body: Uint8Array, options: Beast2AnswerOptions): Response {
|
|
86
|
+
return new Response(body, {
|
|
87
|
+
status: options.status ?? 200,
|
|
88
|
+
headers: { 'Content-Type': BEAST2_CONTENT_TYPE, 'Content-Length': String(body.byteLength), ...options.headers },
|
|
89
|
+
});
|
|
90
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -295,6 +295,10 @@ export {
|
|
|
295
295
|
// Wire format constants
|
|
296
296
|
export { BEAST2_CONTENT_TYPE } from './constants.js';
|
|
297
297
|
|
|
298
|
+
// The BEAST2 request and answer envelopes over the standard Request and
|
|
299
|
+
// Response, which every host's routes answer with
|
|
300
|
+
export { decodeBeast2Request, beast2Success, beast2Error, type Beast2AnswerOptions } from './beast2-http.js';
|
|
301
|
+
|
|
298
302
|
// API wire types (shared between e3-api-client and e3-api-server)
|
|
299
303
|
export {
|
|
300
304
|
// Error types
|
package/src/release.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
/** The release of e3 this build is. */
|
|
20
|
-
export const E3_RELEASE = '1.0.
|
|
20
|
+
export const E3_RELEASE = '1.0.95';
|
|
21
21
|
|
|
22
22
|
/** A semantic version: its core, a pre-release, and build metadata. */
|
|
23
23
|
const RELEASE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|