hexok 2.2.2 → 2.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexok",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "TypeScript primitives for hexagonal software: Schema, Entity, UseCase, Port, Adapter, Mapper, Event, EventCatalog, EventHandler, and Errors.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@ A port parameter typed as the catalog class does not check event key or payload,
52
52
 
53
53
  `parse` throws `hexok: catalog "blog" expected { key, payload }` when `value` lacks a string `key` or a `payload`. An unknown key throws `hexok: event "<key>" is not in catalog "blog"`. A payload the event schema rejects throws `CodedError` `VALIDATION` from that event's `parse`.
54
54
 
55
- `examples/app-template` keeps one catalog in the app, `DomainEvents`. `DomainEventPublisher` calls `DomainEvents.message` and `@hexok/queue` carries that message. The worker calls `DomainEvents.parse` before `handle`. `@hexok/queue` does not own the catalog.
55
+ `examples/app-template` keeps one catalog in the app, `DomainEvents`. The publisher calls `DomainEvents.message` so an event from outside the catalog fails. It publishes the event token as the queue topic and the message payload as the body. The worker calls `handler.event.parse` before `handle`. `@hexok/queue` does not own the catalog.
56
56
 
57
57
  `EventInstance<typeof BlogEvents>` is the union of event instances in the catalog. Each instance carries its token. `EventMessage<typeof BlogEvents>` is the matching `{ key, payload }` union. The second type argument keeps one entry. `key` on a message is the map key. The event token is `BlogEvents.get(message.key).token`, and `event.token` on the instance.
58
58