# @crvouga/mockingbird-service-apigateway 中文文档

规范地址：https://npmcn.com/package/%40crvouga/mockingbird-service-apigateway/

版本：1\.11\.0
npm 元数据更新时间：2026-11-11T01:58:01.703Z
中文译文更新时间：2026-11-11T06:35:54.884Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40crvouga/mockingbird-service-apigateway
原文对照：https://npmcn.com/package/%40crvouga/mockingbird-service-apigateway/?lang=original
项目主页：https://github.com/crvouga/mockingbird/tree/main/packages/service/apigateway#readme
源码仓库：https://github.com/crvouga/mockingbird

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

- 包体积（解压后）：4.7 MB，18 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：1 个
- 首次发布：2026-10-05T09:23:26.461Z
- 最新版本发布：2026-11-11T01:58:01.348Z
- 近 30 天下载量：2832（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：22（近 12 个月 22 个）

## 中文简介

Amazon API Gateway REST API 运输脚手架;供应商业务没有执行.

## 安装

```sh
npm install @crvouga/mockingbird-service-apigateway
```

也可以使用：`pnpm add @crvouga/mockingbird-service-apigateway`、`yarn add @crvouga/mockingbird-service-apigateway`、`bun add @crvouga/mockingbird-service-apigateway`

## README

# @crvouga/ mockingbird-service-apigateway (英语)

> 本地模拟器。 真正的API合同. 部分 [嘲笑鸟](https://github.com/crvouga/mockingbird)。 。 。 .

亚马逊API Gateway REST API的运输脚手架. 无害环境管理;节点22+或Bun 1.2+.

## 使用量

```ts
import { APIGatewayClient, GetRestApisCommand } from "@aws-sdk/client-api-gateway"
import { createServer } from "@crvouga/mockingbird-service-apigateway/server"

// Test setup: start the emulator and point the AWS SDK client your application uses at it.
const emulator = await createServer()
const apigateway = new APIGatewayClient({
  endpoint: emulator.url,
  region: "us-east-1",
  credentials: { accessKeyId: "fixture", secretAccessKey: "fixture" },
})

// No operation is implemented yet, so every SDK call rejects. The emulator answers 400
// UnknownOperationException as XML, which this REST JSON client reports as a parse error.
const failure = await apigateway.send(new GetRestApisCommand({})).catch((error: Error) => error)
// failure instanceof Error

await emulator.close() // after the test
```

国家住在SQLite收藏 并参与共享运行时间命名空间隔离, 重置,时间表,时钟,日记,度量衡和故障控制. 不需要 AWS 账户 .

**计划未执行**,AWS操作: `CreateRestApi`, (中文(简体) ), `GetRestApi`, (中文(简体) ), `GetRestApis`, (中文(简体) ), `UpdateRestApi`, (中文(简体) ), `DeleteRestApi`, (中文(简体) ), `GetResources`, (中文(简体) ), `CreateResource`, (中文(简体) ), `GetResource`, (中文(简体) ), `DeleteResource`, (中文(简体) ), `PutMethod`, (中文(简体) ), `GetMethod`, (中文(简体) ), `DeleteMethod`, (中文(简体) ), `PutIntegration`, (中文(简体) ), `GetIntegration`, (中文(简体) ), `DeleteIntegration`, (中文(简体) ), `CreateDeployment`, (中文(简体) ), `GetDeployments`, (中文(简体) ), `CreateStage`, (中文(简体) ), `GetStage`, (中文(简体) ), `GetStages`, (中文(简体) ), `DeleteStage`, (中文(简体) ), `CreateApiKey`, (中文(简体) ), `GetApiKeys`, (中文(简体) ), `DeleteApiKey`, (中文(简体) ), `CreateUsagePlan`, (中文(简体) ), `GetUsagePlans`, (中文(简体) ), `DeleteUsagePlan`。 。 。 .

本列表以外的操作明显失败 。 这个软件包模拟了API状态,而不是AWS基础设施, 生产配额、计费、IAM执行或供应商控制台。 特定服务的疏漏和 甲骨文证据记录于 [aWS 覆盖分类账](https://npmcn.com/docs/AWS_COVERAGE.md)。 。 。 .

运行 `bun run parity` 启用本地端盘 `http://127.0.0.1:4566`; 不可用预告失败运行 . 没有记录此整合的本地Stack 运行 。 等同指令是一个有边框的只读 SDK 信封探测器,而不是完全供应商等同的证据.

## 执行情况

没有执行供应商业务。 请求明显失败 `UnknownOperationException`; 运输测试覆盖了这个边界和错误的输入. 这个包还不是可用的供应商替换。 不主张本地Stack或现场AWS对等.

## 安装

```sh
bun add @crvouga/mockingbird-service-apigateway
```

## API 密码

-   `ApigatewayAPI(options?)`: 低级 AWS 运输实例 `fetch` 财务报告和审定财务报表 `reset`。 。 。 .
    
-   `createRuntime(options?)`:在进程中获取 API 和共享状态控制 .
    
-   `createServer(options?)` 从 `/server` 条目: HTTP 收听器 `url`, (中文(简体) ), `runtime`,以及 `close()`。 。 。 .
    
-   `document`, (中文(简体) ), `operationIds`,以及 `supportedOperationIds`:生成运输合同元数据.

## 常见问题

### @crvouga/mockingbird-service-apigateway 是什么？

Amazon API Gateway REST API 运输脚手架;供应商业务没有执行\.

### 如何安装 @crvouga/mockingbird-service-apigateway？

在项目目录运行 npm install @crvouga/mockingbird-service-apigateway，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 mockingbird-apigateway，可以用 npx mockingbird-apigateway 直接运行。

### @crvouga/mockingbird-service-apigateway 支持 TypeScript 吗？

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

### @crvouga/mockingbird-service-apigateway 支持 ESM 还是 CommonJS？

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

### @crvouga/mockingbird-service-apigateway 可以商用吗？

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

### @crvouga/mockingbird-service-apigateway 的下载量有多少？

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

### @crvouga/mockingbird-service-apigateway 还在维护吗？

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

