# Commanded v1.4.12 - API Reference

## Modules

- [Commanded](Commanded.md): Use Commanded to build your own Elixir applications following the CQRS/ES pattern.
- [Commanded.Application](Commanded.Application.md): Defines a Commanded application.
- [Commanded.UUID](Commanded.UUID.md): Generate and format random, version 4 UUIDs.

- [Commanded.Event.ErrorHandler](Commanded.Event.ErrorHandler.md)
- [Commanded.Serialization.Serializer](Commanded.Serialization.Serializer.md): Specification of a generic serializer.

- Aggregates
  - [Commanded.Aggregate.Multi](Commanded.Aggregate.Multi.md): Use `Commanded.Aggregate.Multi` to generate multiple events from a single
command.
  - [Commanded.Aggregates.Aggregate](Commanded.Aggregates.Aggregate.md): Aggregate is a `GenServer` process used to provide access to an
instance of an event sourced aggregate.
  - [Commanded.Aggregates.AggregateLifespan](Commanded.Aggregates.AggregateLifespan.md): The `Commanded.Aggregates.AggregateLifespan` behaviour is used to control the
aggregate `GenServer` process lifespan.
  - [Commanded.Aggregates.AggregateStateBuilder](Commanded.Aggregates.AggregateStateBuilder.md): Builds an aggregate's state by loading its snapshot and/or events from the
event store.
  - [Commanded.Aggregates.DefaultLifespan](Commanded.Aggregates.DefaultLifespan.md): The default implementation of the `Commanded.Aggregates.AggregateLifespan`
behaviour.
  - [Commanded.Aggregates.ExecutionContext](Commanded.Aggregates.ExecutionContext.md): Defines the arguments used to execute a command for an aggregate.
  - [Commanded.Aggregates.Supervisor](Commanded.Aggregates.Supervisor.md): Supervises `Commanded.Aggregates.Aggregate` instance processes.

- Commands
  - [Commanded.Commands.CompositeRouter](Commanded.Commands.CompositeRouter.md): Composite router allows you to combine multiple router modules into a single
router able to dispatch any registered command from an included child router.
  - [Commanded.Commands.ExecutionResult](Commanded.Commands.ExecutionResult.md): Contains the aggregate, events, and metadata created by a successfully
executed command.
  - [Commanded.Commands.Handler](Commanded.Commands.Handler.md): Defines the behaviour a command handler module must implement to support command dispatch.
  - [Commanded.Commands.Router](Commanded.Commands.Router.md): Command routing macro to allow configuration of each command to its command handler.

- Events
  - [Commanded.Event.FailureContext](Commanded.Event.FailureContext.md): Data related to an event handling failure.
  - [Commanded.Event.Handler](Commanded.Event.Handler.md): Defines the behaviour an event handler must implement and
provides a convenience macro that implements the behaviour, allowing you to
handle only the events you are interested in processing.
  - [Commanded.Event.Mapper](Commanded.Event.Mapper.md): Map events to/from the structs used for persistence.
  - [Commanded.Event.Upcaster](Commanded.Event.Upcaster.md): Protocol to allow an event to be transformed before being passed to a
consumer.

- Process Managers
  - [Commanded.ProcessManagers.FailureContext](Commanded.ProcessManagers.FailureContext.md): Data related to a process manager event handling or command dispatch failure.
  - [Commanded.ProcessManagers.ProcessManager](Commanded.ProcessManagers.ProcessManager.md): Macro used to define a process manager.

- Event Store
  - [Commanded.EventStore](Commanded.EventStore.md): Use the event store configured for a Commanded application.
  - [Commanded.EventStore.Adapter](Commanded.EventStore.Adapter.md): Defines the behaviour to be implemented by an event store adapter to be used by Commanded.

  - [Commanded.EventStore.Adapters.InMemory](Commanded.EventStore.Adapters.InMemory.md): An in-memory event store adapter implemented as a `GenServer` process which
stores events in memory only.
  - [Commanded.EventStore.EventData](Commanded.EventStore.EventData.md): EventData contains the data for a single event before being persisted to
storage.

  - [Commanded.EventStore.RecordedEvent](Commanded.EventStore.RecordedEvent.md): Contains the persisted stream identity, type, data, and metadata for a single event.
  - [Commanded.EventStore.SnapshotData](Commanded.EventStore.SnapshotData.md): Snapshot data

  - [Commanded.EventStore.TypeProvider](Commanded.EventStore.TypeProvider.md): Specification to convert between an Elixir struct and a corresponding string type.

- Pub Sub
  - [Commanded.PubSub](Commanded.PubSub.md): Use the pubsub configured for a Commanded application.

  - [Commanded.PubSub.Adapter](Commanded.PubSub.Adapter.md): Pub/sub behaviour for use by Commanded to subscribe to and broadcast messages.

  - [Commanded.PubSub.LocalPubSub](Commanded.PubSub.LocalPubSub.md): Local pub/sub adapter, restricted to a single node, using Elixir's `Registry`.
  - [Commanded.PubSub.PhoenixPubSub](Commanded.PubSub.PhoenixPubSub.md): Pub/sub adapter using Phoenix's distributed pub/sub and presence platform.

- Registry
  - [Commanded.Registration](Commanded.Registration.md): Use the process registry configured for a Commanded application.

  - [Commanded.Registration.Adapter](Commanded.Registration.Adapter.md): Defines a behaviour for a process registry to be used by Commanded.
  - [Commanded.Registration.GlobalRegistry](Commanded.Registration.GlobalRegistry.md): Distributed process registration using Erlangs `:global` registry[1].
  - [Commanded.Registration.LocalRegistry](Commanded.Registration.LocalRegistry.md): Local process registration, restricted to a single node, using Elixir's
`Registry` module.

- Serialization
  - [Commanded.Serialization.JsonDecoder](Commanded.Serialization.JsonDecoder.md)
  - [Commanded.Serialization.JsonSerializer](Commanded.Serialization.JsonSerializer.md): A serializer that uses the JSON format and Jason library.

  - [Commanded.Serialization.ModuleNameTypeProvider](Commanded.Serialization.ModuleNameTypeProvider.md): A type provider that uses the Elixir module name

- Middleware
  - [Commanded.Middleware](Commanded.Middleware.md): Middleware provides an extension point to add functions that you want to be
called for every command the router dispatches.
  - [Commanded.Middleware.ConsistencyGuarantee](Commanded.Middleware.ConsistencyGuarantee.md): An internal `Commanded.Middleware` that blocks after successful command
dispatch until the requested dispatch consistency has been met.
  - [Commanded.Middleware.ExtractAggregateIdentity](Commanded.Middleware.ExtractAggregateIdentity.md): An internal `Commanded.Middleware` that extracts the target aggregate's
identity from the command.

  - [Commanded.Middleware.Logger](Commanded.Middleware.Logger.md): A `Commanded.Middleware` that logs each stage of the command dispatch using
the Elixir `Logger`
  - [Commanded.Middleware.Pipeline](Commanded.Middleware.Pipeline.md): Pipeline is a struct used as an argument in the callback functions of modules
implementing the `Commanded.Middleware` behaviour.

- Testing
  - [Commanded.Assertions.EventAssertions](Commanded.Assertions.EventAssertions.md): Provides test assertion and wait for event functions to help test applications
built using Commanded.

## Mix Tasks

- Tasks
  - [mix commanded.reset](Mix.Tasks.Commanded.Reset.md): Reset an event handler.

