"""iisi-app-core public API."""

from .bootstrap import (
    ComponentDefinition,
    ComponentKind,
    ComponentLifetime,
    ComponentRegistry,
    ContainerBuilder,
    DuplicateComponentError,
    PortDefinition,
    PortKind,
    PortsAndAdaptersViolationError,
    application,
    component_definition_for,
    driven_adapter,
    driven_port,
    driving_adapter,
    driving_port,
    infer_interface,
    port_definition_for,
    register,
    seed,
)
from .bootstrap.autoload import ModuleAutoloadError, autoload
from .datetime_utils import ensure_utc_datetime, isoformat_z, utc_now
from .dispatch import (
    ApiExceptionMapper,
    ApiGatewayEventHandler,
    ApiRequest,
    ApiRoute,
    ApiRouteResolver,
    DefaultApiExceptionMapper,
    DefaultApiRouteResolver,
    DefaultCorsPolicy,
    DefaultPolicyResolver,
    EventBridgeEventHandler,
    EventEnvelope,
    EventPolicy,
    ICorsHandler,
    IJwtTokenHandler,
    IPolicyHandler,
    IRestHandler,
    IUseCase,
    JwtTokenHandler,
    PolicyResolver,
    PrincipalProvider,
    RequestAuthenticator,
    SystemPrincipalProvider,
)
from .feature_flags import feature_enabled
from .handlers import CorsPreflightRestHandler, CorsResponseHandler
from .runtime.context import (
    RequestScope,
    RequestState,
    correlation_id,
    current_container,
    current_request_state,
    get_app_context,
    principal,
    set_principal,
    use_correlation_id,
)
from .runtime.lambda_handler import (
    ContainerProvider,
    DefaultLambdaDispatcher,
    Event,
    LambdaDispatcher,
    LambdaHandler,
    build_lambda_handler,
)
from .support.authz import (
    ROLE_ORDER,
    Principal,
    Role,
    at_least,
    authorize,
    ensure_at_least,
    has_role,
    is_admin,
    is_reader,
    require_role,
)
from .support.errors import (
    AmbiguousPolicyError,
    AmbiguousRouteError,
    DomainError,
    DomainValidationError,
    FeatureDisabledError,
    ForbiddenError,
    MissingRequestScopeError,
    NotFoundError,
    PolicyNotFoundError,
    RouteNotFoundError,
    RoutingError,
    UnauthorizedError,
)
from .support.logging import (
    CorrelationIdFilter,
    JsonFormatter,
    LoggingConfig,
    LogSanitizer,
    PlainFormatter,
    RequestLogEntry,
    ResponseLogEntry,
    ShortLoggerNameFilter,
    configure_logging,
    get_logger,
    make_log_hook,
)
from .support.serialization import Serializer, asdict_primitives, to_primitive

__all__ = [
    "AmbiguousPolicyError",
    "AmbiguousRouteError",
    "ApiExceptionMapper",
    "ApiGatewayEventHandler",
    "ApiRequest",
    "ApiRoute",
    "ApiRouteResolver",
    "ComponentDefinition",
    "ComponentKind",
    "ComponentLifetime",
    "ComponentRegistry",
    "ContainerBuilder",
    "ContainerProvider",
    "CorrelationIdFilter",
    "CorsPreflightRestHandler",
    "CorsResponseHandler",
    "DefaultApiExceptionMapper",
    "DefaultApiRouteResolver",
    "DefaultCorsPolicy",
    "DefaultLambdaDispatcher",
    "DefaultPolicyResolver",
    "DomainError",
    "DomainValidationError",
    "DuplicateComponentError",
    "Event",
    "EventBridgeEventHandler",
    "EventEnvelope",
    "EventPolicy",
    "FeatureDisabledError",
    "ForbiddenError",
    "ICorsHandler",
    "IJwtTokenHandler",
    "IPolicyHandler",
    "IRestHandler",
    "IUseCase",
    "JsonFormatter",
    "JwtTokenHandler",
    "LambdaDispatcher",
    "LambdaHandler",
    "LogSanitizer",
    "LoggingConfig",
    "MissingRequestScopeError",
    "ModuleAutoloadError",
    "NotFoundError",
    "PlainFormatter",
    "PolicyNotFoundError",
    "PolicyResolver",
    "PortDefinition",
    "PortKind",
    "PortsAndAdaptersViolationError",
    "Principal",
    "PrincipalProvider",
    "ROLE_ORDER",
    "RequestAuthenticator",
    "RequestLogEntry",
    "RequestScope",
    "RequestState",
    "ResponseLogEntry",
    "Role",
    "RouteNotFoundError",
    "RoutingError",
    "Serializer",
    "ShortLoggerNameFilter",
    "SystemPrincipalProvider",
    "UnauthorizedError",
    "application",
    "adapter",
    "asdict_primitives",
    "at_least",
    "authorize",
    "autoload",
    "build_lambda_handler",
    "component_definition_for",
    "configure_logging",
    "correlation_id",
    "current_container",
    "current_request_state",
    "driven_adapter",
    "driven_port",
    "driving_adapter",
    "driving_port",
    "ensure_at_least",
    "ensure_utc_datetime",
    "feature_enabled",
    "get_app_context",
    "get_logger",
    "has_role",
    "infer_interface",
    "input_adapter",
    "isoformat_z",
    "is_admin",
    "is_reader",
    "make_log_hook",
    "output_adapter",
    "port_definition_for",
    "principal",
    "register",
    "require_role",
    "seed",
    "service",
    "set_principal",
    "to_primitive",
    "use_correlation_id",
    "utc_now",
]
