mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-27 20:55:12 -05:00
Consolidate frontend types (#1245)
This commit is contained in:
committed by
GitHub
parent
6a88a59981
commit
479900e912
@@ -1,6 +1,7 @@
|
||||
# GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
from .about import *
|
||||
from .backup import *
|
||||
from .email import *
|
||||
from .maintenance import *
|
||||
from .migration import *
|
||||
from .restore import *
|
||||
|
||||
@@ -28,10 +28,10 @@ class AdminAboutInfo(AppInfo):
|
||||
|
||||
|
||||
class CheckAppConfig(MealieModel):
|
||||
email_ready: bool = False
|
||||
ldap_ready: bool = False
|
||||
base_url_set: bool = False
|
||||
is_up_to_date: bool = False
|
||||
email_ready: bool
|
||||
ldap_ready: bool
|
||||
base_url_set: bool
|
||||
is_up_to_date: bool
|
||||
|
||||
|
||||
class DockerVolumeText(MealieModel):
|
||||
|
||||
14
mealie/schema/admin/email.py
Normal file
14
mealie/schema/admin/email.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from mealie.schema._mealie import MealieModel
|
||||
|
||||
|
||||
class EmailReady(MealieModel):
|
||||
ready: bool
|
||||
|
||||
|
||||
class EmailSuccess(MealieModel):
|
||||
success: bool
|
||||
error: str = None
|
||||
|
||||
|
||||
class EmailTest(MealieModel):
|
||||
email: str
|
||||
@@ -1,3 +1,5 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import UUID4
|
||||
|
||||
from mealie.schema._mealie import MealieModel
|
||||
@@ -8,4 +10,4 @@ from .group_preferences import UpdateGroupPreferences
|
||||
class GroupAdminUpdate(MealieModel):
|
||||
id: UUID4
|
||||
name: str
|
||||
preferences: UpdateGroupPreferences
|
||||
preferences: Optional[UpdateGroupPreferences] = None
|
||||
|
||||
@@ -16,7 +16,7 @@ class PlanEntryType(str, Enum):
|
||||
side = "side"
|
||||
|
||||
|
||||
class CreatRandomEntry(MealieModel):
|
||||
class CreateRandomEntry(MealieModel):
|
||||
date: date
|
||||
entry_type: PlanEntryType = PlanEntryType.dinner
|
||||
|
||||
|
||||
@@ -26,14 +26,3 @@ class AssignTags(ExportBase):
|
||||
|
||||
class DeleteRecipes(ExportBase):
|
||||
pass
|
||||
|
||||
|
||||
class BulkActionError(MealieModel):
|
||||
recipe: str
|
||||
error: str
|
||||
|
||||
|
||||
class BulkActionsResponse(MealieModel):
|
||||
success: bool
|
||||
message: str
|
||||
errors: list[BulkActionError] = []
|
||||
|
||||
@@ -12,3 +12,11 @@ class RecipeSlug(MealieModel):
|
||||
class SlugResponse(BaseModel):
|
||||
class Config:
|
||||
schema_extra = {"example": "adult-mac-and-cheese"}
|
||||
|
||||
|
||||
class UpdateImageResponse(BaseModel):
|
||||
image: str
|
||||
|
||||
|
||||
class RecipeZipTokenResponse(BaseModel):
|
||||
token: str
|
||||
|
||||
@@ -2,4 +2,4 @@ from pydantic import BaseModel
|
||||
|
||||
|
||||
class ValidationResponse(BaseModel):
|
||||
valid: bool = False
|
||||
valid: bool
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any, Optional
|
||||
from uuid import UUID
|
||||
@@ -18,19 +17,18 @@ from ..recipe import CategoryBase
|
||||
settings = get_app_settings()
|
||||
|
||||
|
||||
class LoingLiveTokenIn(MealieModel):
|
||||
class LongLiveTokenIn(MealieModel):
|
||||
name: str
|
||||
|
||||
|
||||
class LongLiveTokenOut(LoingLiveTokenIn):
|
||||
id: int
|
||||
created_at: datetime
|
||||
class LongLiveTokenOut(MealieModel):
|
||||
token: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class CreateToken(LoingLiveTokenIn):
|
||||
class CreateToken(LongLiveTokenIn):
|
||||
user_id: UUID4
|
||||
token: str
|
||||
|
||||
@@ -38,6 +36,13 @@ class CreateToken(LoingLiveTokenIn):
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class DeleteTokenResponse(MealieModel):
|
||||
token_delete: str
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
class ChangePassword(MealieModel):
|
||||
current_password: str
|
||||
new_password: str
|
||||
|
||||
Reference in New Issue
Block a user