@bryter_io/custom-actions

中文文档
3.2.0发布于 2023/05/26Apache 2.0TypeScriptESM + CJS近 30 天下载 1万

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

中文使用文档
文档目录5 节
  1. 使用量
  2. 安装
  3. * 在当地工作
  4. 测试
  5. 验证 JSON 计划

自定义动作元数据

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

更多关于自定义动作 开发者门户网站。 。 。 .

使用量

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

import { CustomActionMetadata } from '@bryter_io/custom-actions'
const metadata: CustomActionMetadata = {
  key: 'echo-action',
  developerEmail: '[email protected]',
  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'
  }
}

您可以在网站上找到更多代码样本 开发者门户网站。 。 。 .

安装

npm install --save @bryter_io/custom-actions

* 在当地工作

测试

npm test

npm run lint

验证 JSON 计划

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

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

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

💡 此命令需要有 npx 数据 全球安装.

版本与发布记录

@bryter_io/custom-actions 共发布 7 个版本,首次发布于 2023/03/24;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.2.0latest2023/05/263 年前
3.1.02023/05/243 年前
3.0.02023/05/243 年前
2.0.02023/05/233 年前
1.1.02023/05/223 年前
1.0.12023/03/243 年前

关于 @bryter_io/custom-actions 的常见问题

@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 和提交记录判断。