@contract-case/case-connector

中文文档
0.31.4发布于 2026/10/08BSD-3-ClauseTypeScriptESM + CJS近 30 天下载 123.5万

Connector to allow ContractCase to run as a server. Use only if you're creating a custom wrapper for a new language

原始使用文档

Case-Connector

Build and test Known Vulnerabilities

This is the server connector (formerly case-boundary) to allow ContractCase to be run as a server.

If you're wanting to learn about ContractCase, start here instead

Don't depend on this directly unless you are writing a custom wrapper for ContractCase.

This package exists to work around this JSii bug, by exposing the communication layer as a gRPC service.

Additionally, it exposes the boundary layer as @contract-case/case-connector for ESM imports, and @contract-case/case-connector/cjs for CJS imports.

For details of the protocol schema, see the case-connector-proto package.

Authentication

The connector binds to the loopback interface only, on a free port that it announces on stdout in the form:

[SERVER] Started on port: <PORT>

To prevent other local processes from connecting to it, wrappers must generate an unguessable random token and pass it to the connector process via the CASE_CONNECTOR_TOKEN environment variable. The connector rejects (with UNAUTHENTICATED) any call that doesn't present the same token in the authorization metadata of the gRPC call.

If CASE_CONNECTOR_TOKEN is not set, the connector refuses to start. This means the connector always requires a compatible wrapper (any wrapper released after the token was introduced).

版本与发布记录

@contract-case/case-connector 共发布 50 个版本,首次发布于 2023/10/12;过去 12 个月发布了 13 个版本。

版本发布日期距今
0.31.4latest2026/10/081 个月前
0.31.32026/10/021 个月前
0.31.22026/08/312 个月前
0.31.12026/08/312 个月前
0.31.02026/08/282 个月前
0.30.22026/08/282 个月前

关于 @contract-case/case-connector 的常见问题

@contract-case/case-connector 是什么?

Connector to allow ContractCase to run as a server. Use only if you're creating a custom wrapper for a new language

如何安装 @contract-case/case-connector?

在项目目录运行 npm install @contract-case/case-connector,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 case-connector,可以用 npx case-connector 直接运行。

@contract-case/case-connector 支持 TypeScript 吗?

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

@contract-case/case-connector 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@contract-case/case-connector 可以商用吗?

@contract-case/case-connector 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@contract-case/case-connector 的下载量有多少?

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

@contract-case/case-connector 还在维护吗?

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