"""Domain types for EvidentSource."""

from evidentsource_core.domain.constraints import (
    AppendCondition,
    Constraint,
    MaxConstraint,
    MinConstraint,
    RangeConstraint,
    combine_constraints,
)
from evidentsource_core.domain.errors import (
    BlankConstraint,
    ConcurrentWriteCollision,
    ConstraintConflict,
    ConstraintError,
    ConstraintViolations,
    DatabaseAlreadyExists,
    DatabaseError,
    DatabaseErrorWithContext,
    DatabaseNotFound,
    DatabaseServerError,
    DatabaseTimeout,
    DuplicateEventId,
    DuplicateTransactionId,
    EmptyTransaction,
    EventError,
    EvidentSourceError,
    IdentifierError,
    IncompatibleSelectors,
    InvalidConstraints,
    InvalidDatabaseName,
    InvalidEventId,
    InvalidEvents,
    InvalidEventSource,
    InvalidEventSubject,
    InvalidEventType,
    InvalidRange,
    InvalidStateChangeName,
    InvalidStateViewName,
    InvalidStreamName,
    InvalidTransactionId,
    OperationContext,
    StateChangeError,
    StateChangeExecutionError,
    StateChangeNotFound,
    StateChangeServerError,
    StateChangeValidationError,
    StateViewError,
    StateViewEvolveError,
    StateViewNotFound,
    StateViewServerError,
    TransactionError,
    TransactionTooLarge,
)
from evidentsource_core.domain.events import (
    BinaryEventData,
    BooleanExtension,
    Event,
    EventData,
    ExtensionValue,
    IntegerExtension,
    ProspectiveEvent,
    StringEventData,
    StringExtension,
    Transaction,
    TransactionSummary,
    event_data_as_bytes,
)
from evidentsource_core.domain.identifiers import (
    NAME_PATTERN,
    NAME_PATTERN_STR,
    RECORDEDTIME_KEY,
    SAFE_DELIMITER,
    SEQUENCE_KEY,
    DatabaseName,
    EventId,
    EventSubject,
    EventType,
    StateChangeName,
    StateViewName,
    StreamName,
)
from evidentsource_core.domain.revision import (
    Range,
    Revision,
)
from evidentsource_core.domain.selectors import (
    AndSelector,
    EqualsSelector,
    EventAttribute,
    EventAttributePrefix,
    EventSelector,
    EventTypeAttribute,
    EventTypePrefix,
    FlatAndNode,
    FlatEqualsNode,
    FlatOrNode,
    FlatSelectorNode,
    FlatStartsWithNode,
    OrSelector,
    QueryDirection,
    QueryOptions,
    Selector,
    StartsWithSelector,
    StreamAttribute,
    StreamPrefix,
    SubjectAttribute,
    SubjectPrefix,
)
from evidentsource_core.domain.state_change import (
    Command,
    CommandParseError,
    CommandRequest,
    CommandRequestError,
    DeserializationFailed,
    NoBody,
    SerializationFailed,
    StateChangeDefinitionSummary,
    StateChangeVersion,
)
from evidentsource_core.domain.state_view import (
    StateView,
    StateViewCodec,
    StateViewVersion,
)

__all__ = [
    # Constants
    "SAFE_DELIMITER",
    "SEQUENCE_KEY",
    "RECORDEDTIME_KEY",
    "NAME_PATTERN",
    "NAME_PATTERN_STR",
    # Identifiers
    "DatabaseName",
    "StreamName",
    "EventId",
    "EventType",
    "EventSubject",
    "StateViewName",
    "StateChangeName",
    # Errors
    "EvidentSourceError",
    "IdentifierError",
    "InvalidDatabaseName",
    "InvalidStreamName",
    "InvalidEventId",
    "InvalidEventType",
    "InvalidEventSubject",
    "InvalidStateViewName",
    "InvalidStateChangeName",
    "ConstraintError",
    "BlankConstraint",
    "InvalidRange",
    "ConstraintConflict",
    "IncompatibleSelectors",
    "EventError",
    "InvalidEventSource",
    "DuplicateEventId",
    "TransactionError",
    "EmptyTransaction",
    "InvalidTransactionId",
    "TransactionTooLarge",
    "DuplicateTransactionId",
    "InvalidEvents",
    "InvalidConstraints",
    "ConstraintViolations",
    "OperationContext",
    "DatabaseError",
    "DatabaseNotFound",
    "DatabaseAlreadyExists",
    "ConcurrentWriteCollision",
    "DatabaseTimeout",
    "DatabaseServerError",
    "DatabaseErrorWithContext",
    "StateViewError",
    "StateViewNotFound",
    "StateViewEvolveError",
    "StateViewServerError",
    "StateChangeError",
    "StateChangeNotFound",
    "StateChangeExecutionError",
    "StateChangeServerError",
    "StateChangeValidationError",
    # Events
    "EventData",
    "BinaryEventData",
    "StringEventData",
    "event_data_as_bytes",
    "ExtensionValue",
    "BooleanExtension",
    "IntegerExtension",
    "StringExtension",
    "ProspectiveEvent",
    "Event",
    "Transaction",
    "TransactionSummary",
    # Revision
    "Revision",
    "Range",
    # Selectors
    "EventAttribute",
    "StreamAttribute",
    "SubjectAttribute",
    "EventTypeAttribute",
    "EventAttributePrefix",
    "StreamPrefix",
    "SubjectPrefix",
    "EventTypePrefix",
    "EventSelector",
    "EqualsSelector",
    "StartsWithSelector",
    "AndSelector",
    "OrSelector",
    "FlatSelectorNode",
    "FlatEqualsNode",
    "FlatStartsWithNode",
    "FlatAndNode",
    "FlatOrNode",
    "QueryDirection",
    "QueryOptions",
    "Selector",
    # Constraints
    "AppendCondition",
    "MinConstraint",
    "MaxConstraint",
    "RangeConstraint",
    "Constraint",
    "combine_constraints",
    # State View
    "StateViewVersion",
    "StateView",
    "StateViewCodec",
    # State Change
    "StateChangeVersion",
    "StateChangeDefinitionSummary",
    "CommandParseError",
    "NoBody",
    "DeserializationFailed",
    "CommandRequestError",
    "SerializationFailed",
    "Command",
    "CommandRequest",
]
