@elaraai/e3-api-tests

中文文档
1.0.107发布于 2026/11/13BUSL-1.1TypeScriptES Module构建来源已验证近 30 天下载 3526

East Execution Engine API Compliance Tests - shared test suites for e3 API implementations

原始使用文档
文档目录8 节
  1. Installation
  2. Usage
  3. Exports
  4. Claude Code plugin
  5. License
  6. Ecosystem
  7. Links
  8. About Elara

@elaraai/e3-api-tests

Compliance test suite for e3 API servers, used for integration tests in the e3 monorepo. Intended to verify the reference server (@elaraai/e3-api-server), and ensure any alternative e3 server implementations conform to the same API contract.

Installation

npm install @elaraai/e3-api-tests

Usage

Each test receives a fresh, isolated context via a TestSetup<T> factory, enabling concurrent execution:

import { describe, after } from 'node:test';
import { createServer } from '@elaraai/e3-api-server';
import { allApiTests, createTestContext, type TestSetup, type TestContext } from '@elaraai/e3-api-tests';

// Shared server (one per test run)
const server = await createServer({ reposDir: tempDir, port: 0 });
await server.start();

// Per-test setup: creates a fresh repo + context
const setup: TestSetup<TestContext> = async (t) => {
  const ctx = await createTestContext({
    baseUrl: `http://localhost:${server.port}`,
    getToken: async () => '',
    // No auth: a reader's token is the admin's
    getReaderToken: async () => '',
    cleanup: true,
  });
  t.after(() => ctx.cleanup());
  return ctx;
};

describe('API compliance', { concurrency: true }, () => {
  after(() => server.stop());
  allApiTests(setup);
});

The suites call as two callers:

  • getToken's, who may do anything the suites do.
  • getReaderToken(repo)'s, who may read repo, and whose one-shot grant there is platform_free: the reader cases in functionTests run as it. A harness whose server keeps access per repository grants this caller access to repo before it answers.

A server with no auth answers any token. One with auth needs both tokens signed or fetched, as test/integration/src/api-compliance.spec.ts signs them for the local server.

A harness whose server answers requests in its own process, such as e3 running in a page, gives fetch. Every request of the suites then goes through it: the client's calls, the suites' own requests (ctx.fetch) and e3's platform functions. The integration tests' API compliance parts (test/integration/src/compliance-parts.ts) run the suites through a fetch that forwards to the local server, while the global fetch refuses every request.

A harness whose server runs no commands, such as e3 running in a page, sets commands: false. The suites' tasks are East, which every server runs, and their failing tasks fail in East: each is recorded failed, exit code 1, with its message in its stderr log. One case in dataflowTests runs a command, a custom task that exits 1. On a server that runs commands it expects that task failed, exit code 1; on one that runs none, recorded error, with a message saying the server runs no commands.

Exports

ExportDescription
TestSetup<T>Type for per-test context factory: (t: TestContext) => Promise<T>
createTestContextCreate test context with helpers for setup/teardown
allApiTestsRegister every API test suite of apiTestSuites: repository, packages, workspaces, datasets, dataset pages, dataset transfer, dataflow, functions, records, keyed records, record deploys, package transfer and platform
apiTestSuitesEvery API test suite by name, in the order allApiTests registers them: for a harness that runs them in parts, and checks its parts name each once
allTestsRegister all tests including CLI tests (requires credentials env)
repositoryTestsRepository CRUD tests
packageTestsPackage import/export tests
workspaceTestsWorkspace management tests
datasetTestsDataset read/write tests
datasetPageTestsPaged dataset reads and key search
datasetTransferTestsDataset uploads and downloads through the transfer protocol
dataflowTestsDataflow execution tests
functionTestsFunction calls, one-shots and split calls, as an admin and as a reader
recordTestsRecord mutations
keyedRecordTestsKeyed records: every write form, and their indexes
recordDeployTestsRecords across deploys: migrations
packageTransferTestsPackage imports and exports as jobs
platformTestsPlatform capability tests
cliTestsCLI integration tests
transferTestsCross-repository transfer tests
createPackageZipCreate a test package zip file
runE3CommandRun an e3 CLI command

Claude Code plugin

The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:

# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai
# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraai

License

BSL 1.1. See LICENSE.md.

Ecosystem

  • East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.

    • @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
  • East Node: Node.js platform functions for I/O, databases, and system operations.

  • East C: C11 native runtime for executing East IR. Distributed via npm (launcher + per-platform optional dependencies) and as tarballs on each GitHub Release.

    • @elaraai/east-c-cli: npm launcher — installs the matching native binary as an optional dependency
    • east-c: Core runtime — type system, IR interpreter, builtins, serialization (Beast2, JSON, CSV, East text)
    • east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-c-cli: CLI for running East IR programs natively
  • East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.

    • east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
    • east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
    • east-py-cli: CLI for running East IR programs in Python
    • east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
  • East UI: Typed UI component definitions and React renderer, plus VS Code preview.

  • e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.

About Elara

East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.


Developed by Elara AI Pty Ltd.


Developed by Elara AI Pty Ltd

版本与发布记录

@elaraai/e3-api-tests 共发布 149 个版本,首次发布于 2026/01/19;过去 12 个月发布了 149 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.107latest2026/11/13今天
1.0.1062026/11/094 天前
1.0.1052026/11/085 天前
1.0.1042026/11/067 天前
1.0.1032026/11/049 天前
1.0.1022026/11/0310 天前

其他发布通道:beta → 0.0.2-beta.54。

关于 @elaraai/e3-api-tests 的常见问题

@elaraai/e3-api-tests 是什么?

East Execution Engine API Compliance Tests - shared test suites for e3 API implementations

如何安装 @elaraai/e3-api-tests?

在项目目录运行 npm install @elaraai/e3-api-tests,或使用 pnpm add / yarn add / bun add。

@elaraai/e3-api-tests 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elaraai/e3-api-tests 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@elaraai/e3-api-tests 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.2.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@elaraai/e3-api-tests 可以商用吗?

@elaraai/e3-api-tests 使用 BUSL-1.1 许可。声明的许可为 BUSL-1.1,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@elaraai/e3-api-tests 的下载量有多少?

根据 npm 官方下载统计,@elaraai/e3-api-tests 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,526 次,日均约 118 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elaraai/e3-api-tests 还在维护吗?

最新版本 1.0.107 发布于 2026/11/13(今天);至今共发布 149 个版本,其中过去 12 个月发布了 149 个;首次发布于 2026/01/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。