"""Utilities related to MsgSpec."""

from datetime import datetime
from typing import Annotated

from msgspec import Meta
from msgspec.json import Encoder

json_encoder = Encoder()

# Useful msgspec types

AwareDatetime = Annotated[datetime, Meta(tz=True)]

PositiveInt = Annotated[int, Meta(gt=0)]
NonEmptyStr = Annotated[str, Meta(min_length=1)]

PublicSshKey = Annotated[str, Meta(min_length=20)]  # TODO
EmailStr = Annotated[str, Meta(min_length=5)]  # TODO
