# @bryter\_io/custom-actions 中文文档

规范地址：https://npmcn.com/package/%40bryter_io/custom-actions/

版本：3\.2\.0
npm 元数据更新时间：2023-05-26T13:02:42.015Z
中文译文更新时间：2026-11-08T17:06:15.142Z
软件包许可：Apache 2\.0

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bryter_io/custom-actions
原文对照：https://npmcn.com/package/%40bryter_io/custom-actions/?lang=original
项目主页：https://developer.bryter.io/

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：41.5 kB，32 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=18\.0\.0
- 运行依赖：3 个
- 首次发布：2023-03-24T08:47:05.417Z
- 最新版本发布：2023-05-26T13:02:41.906Z
- 近 30 天下载量：10354（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：7（近 12 个月 0 个）

## 中文简介

用于构建 BRYTER 平台自定义动作的图书馆.

## 安装

```sh
npm install @bryter_io/custom-actions
```

也可以使用：`pnpm add @bryter_io/custom-actions`、`yarn add @bryter_io/custom-actions`、`bun add @bryter_io/custom-actions`

## README

# 自定义动作元数据

这个库提供了类型和json schema,用于工作并验证自定义动作元数据.

更多关于自定义动作 [开发者门户网站](https://developer.bryter.io/)。 。 。 .

## 使用量

定义自定义动作的元数据 :

```typescript
import { CustomActionMetadata } from '@bryter_io/custom-actions'
const metadata: CustomActionMetadata = {
  key: 'echo-action',
  developerEmail: 'developer@example.com',
  name: 'Echo action',
  description: 'Takes a string and returns it',
  parameters: [{
    type: 'text',
    name: 'Input string',
    description: 'Text to echo back'
  }],
  result: {
    type: 'text',
    description: 'Text echoed back'
  }
}
```

您可以在网站上找到更多代码样本 [开发者门户网站](https://developer.bryter.io/)。 。 。 .

### 安装

```
npm install --save @bryter_io/custom-actions
```

## \* 在当地工作

### 测试

```
npm test

npm run lint
```

### 验证 JSON 计划

用于验证自定义动作元数据的 JSON 计划载于 `custom-actions-schema.json` 文档。 此文件被API用于验证发送给后端的元数据.

本地验证单个文件可以通过命令行进行 :

```bash
# validate JSON schema
npm run validate-metadata ./path/to/file.json 

```

💡 此命令需要有 [npx 数据](https://www.npmjs.com/package/npx) 全球安装.

## 常见问题

### @bryter\_io/custom-actions 是什么？

用于构建 BRYTER 平台自定义动作的图书馆\.

### 如何安装 @bryter\_io/custom-actions？

在项目目录运行 npm install @bryter\_io/custom-actions，或使用 pnpm add / yarn add / bun add。

### @bryter\_io/custom-actions 支持 TypeScript 吗？

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

### @bryter\_io/custom-actions 支持 ESM 还是 CommonJS？

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

### @bryter\_io/custom-actions 需要什么版本的 Node\.js？

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

### @bryter\_io/custom-actions 可以商用吗？

@bryter\_io/custom-actions 使用 Apache 2\.0 许可。声明的许可为 Apache 2\.0，请阅读许可原文确认使用条件。以上为概括，不构成法律意见，请以许可原文为准。

### @bryter\_io/custom-actions 的下载量有多少？

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

### @bryter\_io/custom-actions 还在维护吗？

最新版本 3\.2\.0 发布于 2023/05/26（3 年前）；至今共发布 7 个版本，其中过去 12 个月发布了 0 个；首次发布于 2023/03/24。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

