@crvouga/mockingbird-service-sqs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog — @crvouga/mockingbird-service-sqs
2
+
3
+ ## 0.1.0 (2026-09-22)
4
+
5
+ Initial release.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @crvouga/mockingbird-service-sqs
2
+
3
+ Stateful Amazon SQS mock for AWS SDK v3. It models standard and FIFO queues, message attributes, visibility and receipt handles, batches, deduplication, purge locking, and dead-letter redrive without contacting AWS.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -D @crvouga/mockingbird-service-sqs
9
+ ```
10
+
11
+ ESM only. Node 22+ or Bun 1.2+.
12
+
13
+ ## Usage
14
+
15
+ Point `SQS_ENDPOINT_URL` or the AWS SDK `endpoint` option at the served mock. Fixture SigV4 credentials are accepted.
16
+
17
+ ```ts
18
+ import { createServer } from "@crvouga/mockingbird-service-sqs/server"
19
+
20
+ const mock = await createServer({
21
+ queues: [{ name: "jobs", attributes: { VisibilityTimeout: "30" } }],
22
+ })
23
+ const health = await fetch(`${mock.url}/health`)
24
+ ```
25
+
26
+ Supported operations are CreateQueue, GetQueueUrl, GetQueueAttributes, SendMessage, SendMessageBatch, ReceiveMessage, DeleteMessage, ChangeMessageVisibility, and PurgeQueue. Receive honors maximum messages, visibility timeout, system attribute selection, and message attribute selection. The injected shared clock controls visibility expiry and redrive without sleeps.
27
+
28
+ ### Admin and deterministic controls
29
+
30
+ - `GET /__admin/queues` shows queue depths; `GET /__admin/messages?queue=…` exposes raw local messages.
31
+ - `POST /__admin/messages` enqueues a fixture; `POST /__admin/messages/:id/receive-count` sets redrive state; `POST /__admin/messages/:id/duplicate` makes an in-flight message immediately redeliverable.
32
+ - `POST /__admin/queues/:name/drain` atomically empties one queue.
33
+ - Fault presets are `throttled` and one-shot `unavailable`; generic faults can delay or duplicate a receive at the caller level.
34
+
35
+ The shared runtime supplies reset, clock, journal, timeline, metrics, faults, and namespace isolation. Select a namespace through `x-mockingbird-namespace`, `/ns/<name>`, or SigV4 access-key mappings.
36
+
37
+ ### Deliberately not modelled
38
+
39
+ Operations outside the listed Geviti surface, IAM policy evaluation, server-side encryption, queue tagging, production throughput and size limits beyond the 1 MiB message limit, real long-poll wall-clock waits, AWS dashboards, and billing are not modelled.
40
+
41
+ ## API
42
+
43
+ - `SqsAPI`, `SqsAPIOptions`, `SqsSeedQueue`: portable AWS JSON handler and fixtures.
44
+ - `SqsMessage`, `SqsMessageAttribute`, `SqsQueue`: state types.
45
+ - `createRuntime`, `SqsRuntime`, `SqsRuntimeOptions`: full Mockingbird runtime.
46
+ - `SQS_NAMESPACE`, `SQS_PRESETS`, `accessKeyCredential`: constants and controls.
47
+ - `document`, `operationIds`, `supportedOperationIds`: generated OpenAPI metadata.
48
+ - `createServer`, `SqsServerOptions`, `DEFAULT_PORT`, `serveTarget` from `./server`: Node HTTP adapter and CLI integration.
49
+
50
+ Official oracle: [Amazon SQS API Reference](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.html).