@emulates/eventbridge 0.0.0-stage → 0.1.1

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,9 @@
1
+ # Changelog — @emulates/eventbridge
2
+
3
+ ## 0.1.1 (2026-10-06)
4
+
5
+ Initial release.
6
+
7
+ ### Dependencies
8
+
9
+ - `@emulates/sqlite`
package/DISCOVERY.md ADDED
@@ -0,0 +1,55 @@
1
+ # @emulates/eventbridge discovery
2
+
3
+ This is the installed-package index for coding agents and tooling. All relative links resolve
4
+ inside `node_modules/@emulates/eventbridge/`; no repository checkout is needed to discover the emulator's
5
+ supported surface or documented behavior.
6
+
7
+ ## Capability and behavior sources
8
+
9
+ | Question | Authoritative file | What it contains |
10
+ | --- | --- | --- |
11
+ | Behaviour and integration | [`README.md`](README.md) | Routes, state transitions, auth, webhooks, controls, presets and deliberate omissions. |
12
+ | Exact capabilities | [`SUPPORT.md`](SUPPORT.md) | Supported, unsupported and parity-covered operations or commands, including reasons for gaps. |
13
+ | Wire contract | [`openapi.yaml`](openapi.yaml) | Machine-readable paths, methods, schemas, responses and parity annotations. |
14
+ | Public API | [`dist/index.d.ts`](dist/index.d.ts) | The installed package's exact TypeScript exports and signatures. |
15
+ | Package metadata | [`package.json`](package.json) | Runtime/entry-point claims, vendor links, parity scope/tier and `emulates.discovery`. |
16
+
17
+ Read these together: the contract/capability matrix says *what* is available, while the README
18
+ defines stateful behavior, lifecycle rules, test controls, and intentional oracle differences.
19
+ If prose and an executable surface disagree, report a parity mismatch instead of adding a
20
+ consumer-side workaround.
21
+
22
+ ## Parity and oracle
23
+
24
+ - Declared parity surface: **Seeded rule and target discovery with pagination**.
25
+ - Parity tier: **cold** (the repository controls when live checks run).
26
+ - Oracle: **Live vendor API or sandbox**.
27
+ - Repository command: `bun run parity:service -- eventbridge`.
28
+ - Evidence model: Run from an Emulates checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2.
29
+
30
+ The npm package contains evidence summaries and the exact contract, not credentials or the
31
+ repository-only parity harness. Self-parity/property and acceptance tests run in the Emulates
32
+ repository; live parity is an additional oracle check, not a substitute for the packaged matrix.
33
+
34
+ ## Runtime introspection
35
+
36
+ - `GET /__admin/health`
37
+ - `GET /__admin`
38
+ - `GET /__admin/state`
39
+ - `GET /__admin/requests`
40
+ - `GET /__admin/metrics`
41
+ - `GET /__admin/faults/presets`
42
+ - `GET /__admin/ui`
43
+
44
+ For HTTP services, use `x-emulates-namespace` (or the documented credential/path carrier) so
45
+ parallel tests do not share state. Admin state, journal, metrics and fault-preset endpoints are
46
+ designed for assertions and diagnosis by consuming test suites.
47
+
48
+ ## Report a mismatch or missing capability
49
+
50
+ Follow the [agent reporting contract](https://github.com/crvouga/emulators/blob/main/docs/REPORTING_ISSUES.md). Include package version,
51
+ operation/command, a minimal redacted request, actual emulator result, expected oracle result or vendor
52
+ documentation, and whether the mismatch appears in the matrix. Never include keys, tokens,
53
+ customer data, prompts, PHI, card data, or unredacted recordings.
54
+
55
+ Service key: `eventbridge`.
package/README.md CHANGED
@@ -1,3 +1,81 @@
1
- # Temporary Holding Version
1
+ # @emulates/eventbridge
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Part of [Emulates](https://github.com/crvouga/emulators): high-fidelity, in-process emulators for APIs and databases.
4
+
5
+ WIP AWS EventBridge control-plane discovery. Seeded rule and target reads use AWS JSON 1.1;
6
+ no containers or infrastructure are executed. Follows the official
7
+ [ListRules](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListRules.html),
8
+ [ListTargetsByRule](https://docs.aws.amazon.com/eventbridge/latest/APIReference/API_ListTargetsByRule.html)
9
+ and [common errors](https://docs.aws.amazon.com/eventbridge/latest/APIReference/CommonErrors.html).
10
+
11
+ ## Install
12
+
13
+ `bun add @emulates/eventbridge`
14
+
15
+ ## Usage
16
+
17
+ ```ts
18
+ import { createServer } from "@emulates/eventbridge/server"
19
+ const server = await createServer({
20
+ rules: [{ rule: { Name: "nightly", Arn: "arn:aws:events:us-east-1:000000000000:rule/nightly" }, targets: [] }],
21
+ })
22
+ // boto3.client("events", endpoint_url=server.url, region_name="us-east-1",
23
+ // aws_access_key_id="fixture", aws_secret_access_key="fixture")
24
+ await server.close()
25
+ ```
26
+
27
+ CLI: `emulates-eventbridge serve --port 12128`. Set your client factory's endpoint_url
28
+ or AWS_ENDPOINT_URL_EVENTBRIDGE to that URL. The default instance has no rules.
29
+ POST / dispatches X-Amz-Target AWSEvents.ListRules and AWSEvents.ListTargetsByRule.
30
+ NamePrefix filters names; Limit (1–100) and NextToken paginate rules and targets.
31
+ The terminal page omits NextToken. Missing buses/rules return ResourceNotFoundException (400).
32
+
33
+ ## Controls and state
34
+
35
+ Seed through options.rules ({rule, targets}) or POST /__admin/state/rules with
36
+ {id: "default:nightly", value: {rule: {Name, Arn}, targets: [{Id, Arn, EcsParameters}]}}.
37
+ Custom buses must also be seeded in options.buses or /__admin/state/buses ({name}).
38
+ The default bus always exists. Rule.EventBusName defaults to default.
39
+ Target objects, including TaskDefinitionArn and awsvpcConfiguration, round-trip without execution.
40
+ State collections: rules, buses, cursors and initialization marker.
41
+ Shared /__admin provides health, state, reset, Timeline checkpoints, clock, journal, metrics and UI.
42
+ Namespaces work via x-emulates-namespace, /__admin/ns/name and SigV4 access-key mappings
43
+ set with PUT /__admin/credentials. No cryptographic signature or IAM evaluation is performed.
44
+ The journal records metadata, not request bodies or credentials.
45
+
46
+ Presets: access_denied (403), throttled (AWS 400), rate_limited (explicit HTTP 429 fault),
47
+ internal_error (500), connection_drop. Standard faults support deterministic latency.
48
+ No outbound webhooks are emitted.
49
+
50
+ ## Verification
51
+
52
+ Run `bun test` here for acceptance, JS SDK, self-parity and deliberate divergence tests.
53
+ Run `bun scripts/sdk.ts` with uv installed for the separate pinned boto3 1.43.56
54
+ drop-in/paginator/error proof (uv obtains that exact package; no AWS credentials are needed).
55
+ Live safe empty-prefix discovery: `bun run parity` with EVENTBRIDGE_ACCESS_KEY_ID,
56
+ EVENTBRIDGE_SECRET_ACCESS_KEY, optional EVENTBRIDGE_REGION. Missing credentials exit 2.
57
+ The SDK tests prove client compatibility, not live AWS equivalence.
58
+
59
+ ## Deliberately not modelled
60
+
61
+ Rule/target mutation, event delivery, schedules, IAM policy evaluation, cryptographic SigV4
62
+ validation, real execution, provisioning and deployment. Seeded resources are fixtures, not
63
+ AWS accounts. Cursor strings and their one-hour emulator-clock lifetime are deterministic local
64
+ stand-ins; AWS does not document a fixed lifetime or wire token format. Pagination binds
65
+ arguments but does not freeze a snapshot of concurrent fixture edits. Result order is fixture
66
+ insertion order, not a guarantee about AWS ordering. HTTP 429 is a test fault, not the normal
67
+ EventBridge throttling status.
68
+
69
+ ## API
70
+
71
+ - `EventbridgeAPI`, `createAwsRuntime`, and `createAwsServer` (server entry): separate extended AWS operations runtime.
72
+
73
+ Main exports: EventBridgeAPI, EVENTBRIDGE_NAMESPACE, createRuntime, EVENTBRIDGE_PRESETS,
74
+ document, operationIds, supportedOperationIds.
75
+ Types: Rule, Target, SeedRule, EventBridgeAPIOptions, EventBridgeRuntimeOptions, EventBridgeRuntime.
76
+ Server entry: createServer, DEFAULT_PORT, serveTarget; type EventBridgeServerOptions.
77
+ CLI entry runs the serve command and exports no runtime values.
78
+
79
+ ## Extended AWS operations runtime
80
+
81
+ `createAwsRuntime` (and `createAwsServer` from the server entry) exposes the additional LocalStack-oriented event bus, rule, target, event ingestion and tagging operations. It has separate state and does not claim the seeded discovery runtime's pagination behavior. The default `createRuntime` retains the documented discovery contract and fixtures. Both modes remain WIP. Run `bun run parity:localstack` for the extended runtime.
package/SUPPORT.md ADDED
@@ -0,0 +1,11 @@
1
+ # AWS EventBridge discovery — operation support
2
+
3
+ Generated from `openapi.yaml`; do not edit by hand.
4
+
5
+ - operations in spec: **1**
6
+ - supported by the emulator: **1**
7
+ - parity enabled: **1**
8
+
9
+ | operationId | route | emulator | parity | notes |
10
+ | --- | --- | --- | --- | --- |
11
+ | `EventBridgeRpc` | `POST /` | ✅ supported | ✅ | |