@air/api-rest

中文文档
0.12.0发布于 2026/11/06MITTypeScriptESM + CJS近 30 天下载 2.3万

Typed REST client for Air API

原始使用文档
文档目录4 节
  1. Installation
  2. What's included
  3. Documentation
  4. License

@air/api-rest

Typed REST client for the Air API SDK.

This package provides the resource classes (boards, showcases, assets, tags, custom fields, discussions, members, uploads, imports, roles) and their TypeScript types. It builds on @air/api-core for HTTP transport.

Installation

Most users should install @air/api-sdk instead, which includes this package:

npm install @air/api-sdk

If you only need the REST resource layer:

npm install @air/api-rest

What's included

  • Resource classes: Boards, Showcases, Assets, Tags, CustomFields, Discussions, Members, Uploads, Imports, Roles
  • Discussions: list, get, listComments, create, createComment, update, updateComment, deleteComment
  • Members: list
  • Showcases: list, get, create, update, updateShareLink, addAssets, removeAsset, addBoards, removeBoard, plus a showcaseId filter on assets.list and boards.list
  • Asset CDN link helpers: listCdnLinks, createCdnLink, and updateCdnLink
  • Share links: listShareLinks, createShareLink, and updateShareLink on assets and boards
  • Full TypeScript types for all API request/response shapes
  • AirApi client class that composes all resources

Documentation

License

MIT

版本与发布记录

@air/api-rest 共发布 15 个版本,首次发布于 2026/03/28;过去 12 个月发布了 15 个版本。

版本发布日期距今
0.12.0latest2026/11/062 天前
0.11.02026/10/309 天前
0.10.02026/10/299 天前
0.9.02026/10/2811 天前
0.8.02026/10/2711 天前
0.7.02026/10/2217 天前

关于 @air/api-rest 的常见问题

@air/api-rest 是什么?

Typed REST client for Air API

如何安装 @air/api-rest?

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

@air/api-rest 支持 TypeScript 吗?

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

@air/api-rest 支持 ESM 还是 CommonJS?

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

@air/api-rest 需要什么版本的 Node.js?

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

@air/api-rest 可以商用吗?

@air/api-rest 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@air/api-rest 的下载量有多少?

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

@air/api-rest 还在维护吗?

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