@crvouga/嘲笑鸟-服务-锯
本地模拟器。 真正的API合同. 部分 嘲笑鸟。 。 。 .
合并了S3对象存储,SQS队列,IAM身份和STS证书. 通过Mockingbird的便携式抓取运行时间,并带有SQLite坚持性,命名空间,检查站,断层和管理员控制等功能.
安装
npm install @crvouga/mockingbird-service-aws
使用量
import { ListBucketsCommand, S3Client } from "@aws-sdk/client-s3"
import { createServer } from "@crvouga/mockingbird-service-aws/server"
// Test setup: start the emulator and point the AWS SDK client your application uses at it.
const emulator = await createServer({ seed: 1 })
const s3 = new S3Client({
endpoint: emulator.url,
region: "us-east-1",
credentials: { accessKeyId: "fixture", secretAccessKey: "fixture" },
forcePathStyle: true,
})
// Application code: ordinary SDK calls.
const { Buckets } = await s3.send(new ListBucketsCommand({}))
// Buckets[0].Name === "emulate-default"
await emulator.close() // after the test
API 密码
AwsAPI:便携式提供者实例;接受SQLite,命名空间,时钟,定着和基底Url.createRuntime:共享运行时间,包括本地命名空间和检查站控制.AWS_NAMESPACE: 默认存储名空间.document, (中文(简体) ),operationIds, (中文(简体) ),supportedOperationIds: 注册供应商路线盘点.createServer, (中文(简体) ),DEFAULT_PORT, (中文(简体) ),serveTarget从/server:回放收听器和CLI配置.
fixtures 接受合成供应商种子记录. reset() 恢复默认值。 模拟0.12.1只是一个测试神谕,从来不是一个运行时间依赖. 在Apache-2.0下移植的供应商操作员保留其许可证和归属;见LICENSE EMULATE和TIII PARTY NOTICES.md.