🔨 refactor(schemas.py): update import statement for ApiKeyRead to reflect new file structure

🔨 refactor(schemas.py): update import statement for ApiKeyRead to reflect
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-25 12:03:03 -03:00
commit edd58705e4
3 changed files with 22 additions and 9 deletions

View file

@ -1,7 +1,8 @@
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from langflow.services.database.models.api_key import ApiKeyRead
from uuid import UUID
from langflow.services.database.models.api_key.api_key import ApiKeyRead
from langflow.services.database.models.flow import FlowCreate, FlowRead
from langflow.services.database.models.user import UserRead
from pydantic import BaseModel, Field, validator
@ -138,12 +139,24 @@ class ComponentListRead(BaseModel):
flows: List[FlowRead]
class ApiKeyResponse(BaseModel):
total_count: int
user_id: str
api_keys: List[ApiKeyRead]
class UsersResponse(BaseModel):
total_count: int
users: List[UserRead]
class ApiKeyResponse(BaseModel):
id: str
api_key: str
name: str
created_at: str
last_used_at: str
class ApiKeysResponse(BaseModel):
total_count: int
user_id: UUID
api_keys: List[ApiKeyRead]
class CreateApiKeyRequest(BaseModel):
name: str

View file

@ -19,7 +19,7 @@ from langflow.services.auth.utils import (
get_current_active_user,
get_password_hash,
)
from langflow.services.database.models.user.utils import (
from langflow.services.database.models.user.crud import (
update_user,
)

View file

@ -5,7 +5,7 @@ from typing import Annotated, Coroutine
from uuid import UUID
from langflow.services.auth.service import AuthManager
from langflow.services.database.models.user.user import User
from langflow.services.database.models.user.utils import (
from langflow.services.database.models.user.crud import (
get_user_by_id,
get_user_by_username,
update_user_last_login_at,