aiteamutils 0.2.77__py3-none-any.whl → 0.2.79__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
aiteamutils/base_model.py CHANGED
@@ -24,15 +24,18 @@ class BaseColumn(Base):
24
24
  nullable=False
25
25
  )
26
26
  created_at: Mapped[datetime] = mapped_column(
27
+ TIMESTAMP(timezone=True),
27
28
  default=datetime.now(timezone.utc),
28
29
  index=True
29
30
  )
30
31
  updated_at: Mapped[datetime] = mapped_column(
32
+ TIMESTAMP(timezone=True),
31
33
  default=datetime.now(timezone.utc),
32
34
  onupdate=datetime.now(timezone.utc),
33
35
  index=True
34
36
  )
35
37
  deleted_at: Mapped[datetime] = mapped_column(
38
+ TIMESTAMP(timezone=True),
36
39
  default=None,
37
40
  nullable=True
38
41
  )
aiteamutils/database.py CHANGED
@@ -508,7 +508,7 @@ async def get_entity(
508
508
  ##################
509
509
  async def log_create(
510
510
  session: AsyncSession,
511
- model: str,
511
+ model: Type[ModelType],
512
512
  log_data: Dict[str, Any],
513
513
  request: Optional[Request] = None
514
514
  ) -> None:
aiteamutils/security.py CHANGED
@@ -1,18 +1,17 @@
1
1
  """보안 관련 유틸리티."""
2
2
  from datetime import datetime, timedelta, timezone
3
- from typing import Dict, Any, Optional, Literal, Callable, TYPE_CHECKING
3
+ from typing import Dict, Any, Optional, Literal, Callable, TYPE_CHECKING, TypeVar
4
4
  from fastapi import Request, HTTPException, status
5
5
  from functools import wraps
6
6
  from jose import jwt, JWTError
7
7
  from passlib.context import CryptContext
8
8
  import logging
9
9
  from sqlalchemy.ext.asyncio import AsyncSession
10
-
11
10
  from .exceptions import CustomException, ErrorCode
12
11
  from .enums import ActivityType
13
- from .database import log_create
14
12
 
15
13
  pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
14
+ ModelType = TypeVar("ModelType")
16
15
 
17
16
  # 전역 rate limit 상태 저장
18
17
  _rate_limits: Dict[str, Dict[str, Any]] = {}
@@ -133,7 +132,7 @@ def rate_limit(
133
132
  return decorator
134
133
 
135
134
  async def create_jwt_token(
136
- user_data: Dict[str, Any],
135
+ user_data: Optional[ModelType],
137
136
  token_type: Literal["access", "refresh"],
138
137
  db_session: AsyncSession,
139
138
  token_settings: Dict[str, Any],
aiteamutils/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  """버전 정보"""
2
- __version__ = "0.2.77"
2
+ __version__ = "0.2.79"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.77
3
+ Version: 0.2.79
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -1,15 +1,15 @@
1
1
  aiteamutils/__init__.py,sha256=kRBpRjark0M8ZwFfmKiMFol6CbIILN3WE4f6_P6iIq0,1089
2
- aiteamutils/base_model.py,sha256=SWifZPzlUGyKAjmV7Uoe7PUhedm215efD7zOay8DhNc,2906
2
+ aiteamutils/base_model.py,sha256=bnRJJaGXGS3TKxfCWWV3arFjdG0qLsPFDXuguYsDyVM,3008
3
3
  aiteamutils/base_repository.py,sha256=VLCLLVkNnYLmZ6EMcr3Tu0RkMqDyMhtCO3M_2j6q-R8,4409
4
4
  aiteamutils/base_service.py,sha256=GmO_fqrSEbIs_Jc5BoRBTLfaJaS6CIxYPAs4B4TdtaU,9123
5
5
  aiteamutils/cache.py,sha256=07xBGlgAwOTAdY5mnMOQJ5EBxVwe8glVD7DkGEkxCtw,1373
6
6
  aiteamutils/config.py,sha256=YdalpJb70-txhGJAS4aaKglEZAFVWgfzw5BXSWpkUz4,3232
7
- aiteamutils/database.py,sha256=zf5Ab5ZFYQBrtvxW9te9RoVsWlMkOpTdmJ8rDwfvINs,19192
7
+ aiteamutils/database.py,sha256=Q2rwVfhS8Rpnj89EwtcLtmsDpANkJ1AlprlqQsgIQAg,19204
8
8
  aiteamutils/enums.py,sha256=ipZi6k_QD5-3QV7Yzv7bnL0MjDz-vqfO9I5L77biMKs,632
9
9
  aiteamutils/exceptions.py,sha256=3FUCIqXgYmMqonnMgUlh-J2xtApiiCgg4WM-2UV4vmQ,15823
10
- aiteamutils/security.py,sha256=I8X_ABREYHObUZt1xi70v0dTCGUgGCmI6NxieZCN1qo,9648
10
+ aiteamutils/security.py,sha256=dPprEiKZ_VCg9bf27OaBvWw5SMBb_V0KGajIbgIbejs,9661
11
11
  aiteamutils/validators.py,sha256=PvI9hbMEAqTawgxPbiWRyx2r9yTUrpNBQs1AD3w4F2U,7726
12
- aiteamutils/version.py,sha256=73Vlr-_6fNkFw1Zd12TlIw0hBU7AOnfd-bV9rDxyz3Q,42
13
- aiteamutils-0.2.77.dist-info/METADATA,sha256=64hwUhsBPM-DwlehLu8fXmUwJOnkRQSKWr05BxUFNxI,1718
14
- aiteamutils-0.2.77.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- aiteamutils-0.2.77.dist-info/RECORD,,
12
+ aiteamutils/version.py,sha256=CzBQOXpe_-RfEDV4RvVHykuSQFo8eYW1g0gu7UOhJ-E,42
13
+ aiteamutils-0.2.79.dist-info/METADATA,sha256=pQkGcF9V5M-cOJKyAYJsCYyYe5DnCDQhmqh36G30vb4,1718
14
+ aiteamutils-0.2.79.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
+ aiteamutils-0.2.79.dist-info/RECORD,,