mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-20 13:33:39 -07:00
feat: Add label notifier (#5879)
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
parent
9e46c57e78
commit
d3436a5ca8
29 changed files with 281 additions and 153 deletions
|
@ -79,7 +79,8 @@
|
|||
"tag-events": "Tag Events",
|
||||
"category-events": "Category Events",
|
||||
"when-a-new-user-joins-your-group": "When a new user joins your group",
|
||||
"recipe-events": "Recipe Events"
|
||||
"recipe-events": "Recipe Events",
|
||||
"label-events": "Label Events"
|
||||
},
|
||||
"general": {
|
||||
"add": "Add",
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
@ -117,6 +116,7 @@ export interface CustomPageBase {
|
|||
export interface RecipeCategoryResponse {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
recipes?: RecipeSummary[];
|
||||
}
|
||||
|
@ -149,18 +149,21 @@ export interface RecipeSummary {
|
|||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
householdsWithTool?: string[];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
@ -39,7 +38,6 @@ export interface QueryFilterJSONPart {
|
|||
attributeName?: string | null;
|
||||
relationalOperator?: RelationalKeyword | RelationalOperator | null;
|
||||
value?: string | string[] | null;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeCookBook {
|
||||
name: string;
|
||||
|
@ -83,18 +81,21 @@ export interface RecipeSummary {
|
|||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
householdsWithTool?: string[];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
@ -70,6 +69,9 @@ export interface GroupEventNotifierOptions {
|
|||
categoryCreated?: boolean;
|
||||
categoryUpdated?: boolean;
|
||||
categoryDeleted?: boolean;
|
||||
labelCreated?: boolean;
|
||||
labelUpdated?: boolean;
|
||||
labelDeleted?: boolean;
|
||||
}
|
||||
export interface GroupEventNotifierOptionsOut {
|
||||
testMessage?: boolean;
|
||||
|
@ -94,6 +96,9 @@ export interface GroupEventNotifierOptionsOut {
|
|||
categoryCreated?: boolean;
|
||||
categoryUpdated?: boolean;
|
||||
categoryDeleted?: boolean;
|
||||
labelCreated?: boolean;
|
||||
labelUpdated?: boolean;
|
||||
labelDeleted?: boolean;
|
||||
id: string;
|
||||
}
|
||||
export interface GroupEventNotifierOptionsSave {
|
||||
|
@ -119,6 +124,9 @@ export interface GroupEventNotifierOptionsSave {
|
|||
categoryCreated?: boolean;
|
||||
categoryUpdated?: boolean;
|
||||
categoryDeleted?: boolean;
|
||||
labelCreated?: boolean;
|
||||
labelUpdated?: boolean;
|
||||
labelDeleted?: boolean;
|
||||
notifierId: string;
|
||||
}
|
||||
export interface GroupEventNotifierOut {
|
||||
|
@ -166,6 +174,7 @@ export interface GroupRecipeActionOut {
|
|||
export interface GroupRecipeActionPayload {
|
||||
action: GroupRecipeActionOut;
|
||||
content: unknown;
|
||||
recipeScale: number;
|
||||
}
|
||||
export interface HouseholdCreate {
|
||||
groupId?: string | null;
|
||||
|
@ -587,18 +596,21 @@ export interface RecipeSummary {
|
|||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
householdsWithTool?: string[];
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
*/
|
||||
|
||||
import type { HouseholdSummary } from "./household";
|
||||
|
||||
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side";
|
||||
export type PlanRulesDay = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | "unset";
|
||||
export type PlanRulesType = "breakfast" | "lunch" | "dinner" | "side" | "unset";
|
||||
|
@ -44,9 +41,6 @@ export interface PlanRulesOut {
|
|||
householdId: string;
|
||||
id: string;
|
||||
queryFilter?: QueryFilterJSON;
|
||||
categories?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
households?: HouseholdSummary[];
|
||||
}
|
||||
export interface QueryFilterJSON {
|
||||
parts?: QueryFilterJSONPart[];
|
||||
|
@ -108,18 +102,21 @@ export interface RecipeSummary {
|
|||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
[k: string]: unknown;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
householdsWithTool?: string[];
|
||||
|
|
|
@ -19,6 +19,7 @@ export interface AssignCategories {
|
|||
export interface CategoryBase {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
}
|
||||
export interface AssignSettings {
|
||||
|
@ -40,6 +41,7 @@ export interface AssignTags {
|
|||
export interface TagBase {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
}
|
||||
export interface CategoryIn {
|
||||
|
@ -48,8 +50,8 @@ export interface CategoryIn {
|
|||
export interface CategoryOut {
|
||||
name: string;
|
||||
id: string;
|
||||
slug: string;
|
||||
groupId: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface CategorySave {
|
||||
name: string;
|
||||
|
@ -97,11 +99,13 @@ export interface CreateRecipeBulk {
|
|||
}
|
||||
export interface RecipeCategory {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: string | null;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
|
@ -223,7 +227,7 @@ export interface Recipe {
|
|||
groupId?: string;
|
||||
name?: string | null;
|
||||
slug?: string;
|
||||
image?: string;
|
||||
image?: unknown;
|
||||
recipeServings?: number;
|
||||
recipeYieldQuantity?: number;
|
||||
recipeYield?: string | null;
|
||||
|
@ -255,6 +259,7 @@ export interface Recipe {
|
|||
}
|
||||
export interface RecipeTool {
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
name: string;
|
||||
slug: string;
|
||||
householdsWithTool?: string[];
|
||||
|
@ -293,6 +298,7 @@ export interface UserBase {
|
|||
export interface RecipeCategoryResponse {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
recipes?: RecipeSummary[];
|
||||
}
|
||||
|
@ -399,6 +405,7 @@ export interface RecipeSuggestionResponseItem {
|
|||
export interface RecipeTagResponse {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
recipes?: RecipeSummary[];
|
||||
}
|
||||
|
@ -447,12 +454,14 @@ export interface RecipeToolOut {
|
|||
name: string;
|
||||
householdsWithTool?: string[];
|
||||
id: string;
|
||||
groupId: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeToolResponse {
|
||||
name: string;
|
||||
householdsWithTool?: string[];
|
||||
id: string;
|
||||
groupId: string;
|
||||
slug: string;
|
||||
recipes?: RecipeSummary[];
|
||||
}
|
||||
|
@ -507,7 +516,7 @@ export interface ScrapeRecipeTest {
|
|||
url: string;
|
||||
useOpenAI?: boolean;
|
||||
}
|
||||
export interface SlugResponse { }
|
||||
export interface SlugResponse {}
|
||||
export interface TagIn {
|
||||
name: string;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* tslint:disable */
|
||||
|
||||
/**
|
||||
/* This file was automatically generated from pydantic models by running pydantic2ts.
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
|
@ -63,6 +62,7 @@ export interface GroupInDB {
|
|||
export interface CategoryBase {
|
||||
name: string;
|
||||
id: string;
|
||||
groupId?: string | null;
|
||||
slug: string;
|
||||
}
|
||||
export interface ReadWebhook {
|
||||
|
@ -197,7 +197,6 @@ export interface UserBase {
|
|||
canManage?: boolean;
|
||||
canManageHousehold?: boolean;
|
||||
canOrganize?: boolean;
|
||||
advancedOptions?: boolean;
|
||||
}
|
||||
export interface UserIn {
|
||||
id?: string | null;
|
||||
|
|
|
@ -368,6 +368,24 @@ export default defineNuxtComponent({
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
text: i18n.t("events.label-events"),
|
||||
options: [
|
||||
{
|
||||
text: i18n.t("general.create") as string,
|
||||
key: "labelCreated",
|
||||
},
|
||||
{
|
||||
text: i18n.t("general.update") as string,
|
||||
key: "labelUpdated",
|
||||
},
|
||||
{
|
||||
text: i18n.t("general.delete") as string,
|
||||
key: "labelDeleted",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
|
|
2
frontend/types/components.d.ts
vendored
2
frontend/types/components.d.ts
vendored
|
@ -81,4 +81,4 @@ declare module "vue" {
|
|||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
export { };
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
"""'Add label notifier CRUD bools'
|
||||
|
||||
Revision ID: e6bb583aac2d
|
||||
Revises: d7b3ce6fa31a
|
||||
Create Date: 2025-08-09 19:32:37.285172
|
||||
|
||||
"""
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "e6bb583aac2d"
|
||||
down_revision: str | None = "d7b3ce6fa31a"
|
||||
branch_labels: str | tuple[str, ...] | None = None
|
||||
depends_on: str | tuple[str, ...] | None = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("group_events_notifier_options", schema=None) as batch_op:
|
||||
batch_op.add_column(
|
||||
sa.Column(
|
||||
"label_created", sa.Boolean(), nullable=False, default=False, server_default=sa.sql.expression.false()
|
||||
)
|
||||
)
|
||||
batch_op.add_column(
|
||||
sa.Column(
|
||||
"label_updated", sa.Boolean(), nullable=False, default=False, server_default=sa.sql.expression.false()
|
||||
)
|
||||
)
|
||||
batch_op.add_column(
|
||||
sa.Column(
|
||||
"label_deleted", sa.Boolean(), nullable=False, default=False, server_default=sa.sql.expression.false()
|
||||
)
|
||||
)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table("group_events_notifier_options", schema=None) as batch_op:
|
||||
batch_op.drop_column("label_deleted")
|
||||
batch_op.drop_column("label_updated")
|
||||
batch_op.drop_column("label_created")
|
||||
|
||||
# ### end Alembic commands ###
|
|
@ -46,6 +46,10 @@ class GroupEventNotifierOptionsModel(SqlAlchemyBase, BaseMixins):
|
|||
category_updated: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
category_deleted: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
|
||||
label_created: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
label_updated: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
label_deleted: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
|
||||
@auto_init()
|
||||
def __init__(self, **_) -> None:
|
||||
pass
|
||||
|
|
|
@ -3,7 +3,7 @@ from functools import cached_property
|
|||
from fastapi import APIRouter, Depends
|
||||
from pydantic import UUID4
|
||||
|
||||
from mealie.routes._base.base_controllers import BaseUserController
|
||||
from mealie.routes._base.base_controllers import BaseCrudController
|
||||
from mealie.routes._base.controller import controller
|
||||
from mealie.routes._base.mixins import HttpRepo
|
||||
from mealie.routes._base.routers import MealieCrudRoute
|
||||
|
@ -15,13 +15,14 @@ from mealie.schema.labels import (
|
|||
)
|
||||
from mealie.schema.labels.multi_purpose_label import MultiPurposeLabelPagination
|
||||
from mealie.schema.response.pagination import PaginationQuery
|
||||
from mealie.services.event_bus_service.event_types import EventLabelData, EventOperation, EventTypes
|
||||
from mealie.services.group_services.labels_service import MultiPurposeLabelService
|
||||
|
||||
router = APIRouter(prefix="/groups/labels", tags=["Groups: Multi Purpose Labels"], route_class=MealieCrudRoute)
|
||||
|
||||
|
||||
@controller(router)
|
||||
class MultiPurposeLabelsController(BaseUserController):
|
||||
class MultiPurposeLabelsController(BaseCrudController):
|
||||
@cached_property
|
||||
def service(self):
|
||||
return MultiPurposeLabelService(self.repos)
|
||||
|
@ -53,7 +54,15 @@ class MultiPurposeLabelsController(BaseUserController):
|
|||
|
||||
@router.post("", response_model=MultiPurposeLabelOut)
|
||||
def create_one(self, data: MultiPurposeLabelCreate):
|
||||
return self.service.create_one(data)
|
||||
new_label = self.service.create_one(data)
|
||||
self.publish_event(
|
||||
event_type=EventTypes.label_created,
|
||||
document_data=EventLabelData(operation=EventOperation.create, label_id=new_label.id),
|
||||
group_id=new_label.group_id,
|
||||
household_id=None,
|
||||
message=self.t("notifications.generic-created", name=new_label.name),
|
||||
)
|
||||
return new_label
|
||||
|
||||
@router.get("/{item_id}", response_model=MultiPurposeLabelOut)
|
||||
def get_one(self, item_id: UUID4):
|
||||
|
@ -61,8 +70,25 @@ class MultiPurposeLabelsController(BaseUserController):
|
|||
|
||||
@router.put("/{item_id}", response_model=MultiPurposeLabelOut)
|
||||
def update_one(self, item_id: UUID4, data: MultiPurposeLabelUpdate):
|
||||
return self.mixins.update_one(data, item_id)
|
||||
label = self.mixins.update_one(data, item_id)
|
||||
self.publish_event(
|
||||
event_type=EventTypes.label_updated,
|
||||
document_data=EventLabelData(operation=EventOperation.update, label_id=label.id),
|
||||
group_id=label.group_id,
|
||||
household_id=None,
|
||||
message=self.t("notifications.generic-updated", name=label.name),
|
||||
)
|
||||
return label
|
||||
|
||||
@router.delete("/{item_id}", response_model=MultiPurposeLabelOut)
|
||||
def delete_one(self, item_id: UUID4):
|
||||
return self.mixins.delete_one(item_id) # type: ignore
|
||||
label = self.mixins.delete_one(item_id)
|
||||
if label:
|
||||
self.publish_event(
|
||||
event_type=EventTypes.label_deleted,
|
||||
document_data=EventLabelData(operation=EventOperation.delete, label_id=label.id),
|
||||
group_id=label.group_id,
|
||||
household_id=None,
|
||||
message=self.t("notifications.generic-deleted", name=label.name),
|
||||
)
|
||||
return label
|
||||
|
|
|
@ -3,11 +3,11 @@ from .datetime_parse import DateError, DateTimeError, DurationError, TimeError
|
|||
from .mealie_model import HasUUID, MealieModel, SearchType
|
||||
|
||||
__all__ = [
|
||||
"HasUUID",
|
||||
"MealieModel",
|
||||
"SearchType",
|
||||
"DateError",
|
||||
"DateTimeError",
|
||||
"DurationError",
|
||||
"TimeError",
|
||||
"HasUUID",
|
||||
"MealieModel",
|
||||
"SearchType",
|
||||
]
|
||||
|
|
|
@ -18,28 +18,10 @@ from .restore import (
|
|||
from .settings import CustomPageBase, CustomPageOut
|
||||
|
||||
__all__ = [
|
||||
"MaintenanceLogs",
|
||||
"MaintenanceStorageDetails",
|
||||
"MaintenanceSummary",
|
||||
"ChowdownURL",
|
||||
"MigrationFile",
|
||||
"MigrationImport",
|
||||
"Migrations",
|
||||
"CustomPageBase",
|
||||
"CustomPageOut",
|
||||
"CommentImport",
|
||||
"CustomPageImport",
|
||||
"GroupImport",
|
||||
"ImportBase",
|
||||
"NotificationImport",
|
||||
"RecipeImport",
|
||||
"SettingsImport",
|
||||
"UserImport",
|
||||
"AllBackups",
|
||||
"BackupFile",
|
||||
"BackupOptions",
|
||||
"CreateBackup",
|
||||
"ImportJob",
|
||||
"AdminAboutInfo",
|
||||
"AppInfo",
|
||||
"AppStartupInfo",
|
||||
|
@ -49,5 +31,23 @@ __all__ = [
|
|||
"EmailReady",
|
||||
"EmailSuccess",
|
||||
"EmailTest",
|
||||
"CustomPageBase",
|
||||
"CustomPageOut",
|
||||
"AllBackups",
|
||||
"BackupFile",
|
||||
"BackupOptions",
|
||||
"CreateBackup",
|
||||
"ImportJob",
|
||||
"MaintenanceLogs",
|
||||
"MaintenanceStorageDetails",
|
||||
"MaintenanceSummary",
|
||||
"DebugResponse",
|
||||
"CommentImport",
|
||||
"CustomPageImport",
|
||||
"GroupImport",
|
||||
"ImportBase",
|
||||
"NotificationImport",
|
||||
"RecipeImport",
|
||||
"SettingsImport",
|
||||
"UserImport",
|
||||
]
|
||||
|
|
|
@ -7,13 +7,13 @@ from .group_seeder import SeederConfig
|
|||
from .group_statistics import GroupStorage
|
||||
|
||||
__all__ = [
|
||||
"GroupAdminUpdate",
|
||||
"GroupStorage",
|
||||
"GroupDataExport",
|
||||
"SeederConfig",
|
||||
"CreateGroupPreferences",
|
||||
"ReadGroupPreferences",
|
||||
"UpdateGroupPreferences",
|
||||
"GroupStorage",
|
||||
"DataMigrationCreate",
|
||||
"SupportedMigrations",
|
||||
"SeederConfig",
|
||||
"GroupAdminUpdate",
|
||||
]
|
||||
|
|
|
@ -70,49 +70,6 @@ from .invite_token import CreateInviteToken, EmailInitationResponse, EmailInvita
|
|||
from .webhook import CreateWebhook, ReadWebhook, SaveWebhook, WebhookPagination, WebhookType
|
||||
|
||||
__all__ = [
|
||||
"GroupEventNotifierCreate",
|
||||
"GroupEventNotifierOptions",
|
||||
"GroupEventNotifierOptionsOut",
|
||||
"GroupEventNotifierOptionsSave",
|
||||
"GroupEventNotifierOut",
|
||||
"GroupEventNotifierPrivate",
|
||||
"GroupEventNotifierSave",
|
||||
"GroupEventNotifierUpdate",
|
||||
"GroupEventPagination",
|
||||
"CreateGroupRecipeAction",
|
||||
"GroupRecipeActionOut",
|
||||
"GroupRecipeActionPagination",
|
||||
"GroupRecipeActionPayload",
|
||||
"GroupRecipeActionType",
|
||||
"SaveGroupRecipeAction",
|
||||
"CreateWebhook",
|
||||
"ReadWebhook",
|
||||
"SaveWebhook",
|
||||
"WebhookPagination",
|
||||
"WebhookType",
|
||||
"CreateHouseholdPreferences",
|
||||
"ReadHouseholdPreferences",
|
||||
"SaveHouseholdPreferences",
|
||||
"UpdateHouseholdPreferences",
|
||||
"HouseholdCreate",
|
||||
"HouseholdInDB",
|
||||
"HouseholdPagination",
|
||||
"HouseholdRecipeBase",
|
||||
"HouseholdRecipeCreate",
|
||||
"HouseholdRecipeOut",
|
||||
"HouseholdRecipeSummary",
|
||||
"HouseholdRecipeUpdate",
|
||||
"HouseholdSave",
|
||||
"HouseholdSummary",
|
||||
"HouseholdUserSummary",
|
||||
"UpdateHousehold",
|
||||
"UpdateHouseholdAdmin",
|
||||
"HouseholdStatistics",
|
||||
"CreateInviteToken",
|
||||
"EmailInitationResponse",
|
||||
"EmailInvitation",
|
||||
"ReadInviteToken",
|
||||
"SaveInviteToken",
|
||||
"ShoppingListAddRecipeParams",
|
||||
"ShoppingListAddRecipeParamsBulk",
|
||||
"ShoppingListCreate",
|
||||
|
@ -136,5 +93,48 @@ __all__ = [
|
|||
"ShoppingListSave",
|
||||
"ShoppingListSummary",
|
||||
"ShoppingListUpdate",
|
||||
"GroupEventNotifierCreate",
|
||||
"GroupEventNotifierOptions",
|
||||
"GroupEventNotifierOptionsOut",
|
||||
"GroupEventNotifierOptionsSave",
|
||||
"GroupEventNotifierOut",
|
||||
"GroupEventNotifierPrivate",
|
||||
"GroupEventNotifierSave",
|
||||
"GroupEventNotifierUpdate",
|
||||
"GroupEventPagination",
|
||||
"CreateGroupRecipeAction",
|
||||
"GroupRecipeActionOut",
|
||||
"GroupRecipeActionPagination",
|
||||
"GroupRecipeActionPayload",
|
||||
"GroupRecipeActionType",
|
||||
"SaveGroupRecipeAction",
|
||||
"CreateHouseholdPreferences",
|
||||
"ReadHouseholdPreferences",
|
||||
"SaveHouseholdPreferences",
|
||||
"UpdateHouseholdPreferences",
|
||||
"SetPermissions",
|
||||
"CreateInviteToken",
|
||||
"EmailInitationResponse",
|
||||
"EmailInvitation",
|
||||
"ReadInviteToken",
|
||||
"SaveInviteToken",
|
||||
"HouseholdStatistics",
|
||||
"CreateWebhook",
|
||||
"ReadWebhook",
|
||||
"SaveWebhook",
|
||||
"WebhookPagination",
|
||||
"WebhookType",
|
||||
"HouseholdCreate",
|
||||
"HouseholdInDB",
|
||||
"HouseholdPagination",
|
||||
"HouseholdRecipeBase",
|
||||
"HouseholdRecipeCreate",
|
||||
"HouseholdRecipeOut",
|
||||
"HouseholdRecipeSummary",
|
||||
"HouseholdRecipeUpdate",
|
||||
"HouseholdSave",
|
||||
"HouseholdSummary",
|
||||
"HouseholdUserSummary",
|
||||
"UpdateHousehold",
|
||||
"UpdateHouseholdAdmin",
|
||||
]
|
||||
|
|
|
@ -47,6 +47,10 @@ class GroupEventNotifierOptions(MealieModel):
|
|||
category_updated: bool = False
|
||||
category_deleted: bool = False
|
||||
|
||||
label_created: bool = False
|
||||
label_updated: bool = False
|
||||
label_deleted: bool = False
|
||||
|
||||
|
||||
class GroupEventNotifierOptionsSave(GroupEventNotifierOptions):
|
||||
notifier_id: UUID4
|
||||
|
|
|
@ -12,9 +12,6 @@ from .plan_rules import PlanRulesCreate, PlanRulesDay, PlanRulesOut, PlanRulesPa
|
|||
from .shopping_list import ListItem, ShoppingListIn, ShoppingListOut
|
||||
|
||||
__all__ = [
|
||||
"ListItem",
|
||||
"ShoppingListIn",
|
||||
"ShoppingListOut",
|
||||
"CreatePlanEntry",
|
||||
"CreateRandomEntry",
|
||||
"PlanEntryPagination",
|
||||
|
@ -22,6 +19,9 @@ __all__ = [
|
|||
"ReadPlanEntry",
|
||||
"SavePlanEntry",
|
||||
"UpdatePlanEntry",
|
||||
"ListItem",
|
||||
"ShoppingListIn",
|
||||
"ShoppingListOut",
|
||||
"PlanRulesCreate",
|
||||
"PlanRulesDay",
|
||||
"PlanRulesOut",
|
||||
|
|
|
@ -89,35 +89,6 @@ from .recipe_tool import RecipeToolCreate, RecipeToolOut, RecipeToolResponse, Re
|
|||
from .request_helpers import RecipeDuplicate, RecipeSlug, RecipeZipTokenResponse, SlugResponse, UpdateImageResponse
|
||||
|
||||
__all__ = [
|
||||
"IngredientReferences",
|
||||
"RecipeStep",
|
||||
"RecipeNote",
|
||||
"CategoryBase",
|
||||
"CategoryIn",
|
||||
"CategoryOut",
|
||||
"CategorySave",
|
||||
"RecipeCategoryResponse",
|
||||
"RecipeTagResponse",
|
||||
"TagBase",
|
||||
"TagIn",
|
||||
"TagOut",
|
||||
"TagSave",
|
||||
"RecipeAsset",
|
||||
"RecipeTimelineEventCreate",
|
||||
"RecipeTimelineEventIn",
|
||||
"RecipeTimelineEventOut",
|
||||
"RecipeTimelineEventPagination",
|
||||
"RecipeTimelineEventUpdate",
|
||||
"TimelineEventImage",
|
||||
"TimelineEventType",
|
||||
"RecipeSuggestionQuery",
|
||||
"RecipeSuggestionResponse",
|
||||
"RecipeSuggestionResponseItem",
|
||||
"Nutrition",
|
||||
"RecipeShareToken",
|
||||
"RecipeShareTokenCreate",
|
||||
"RecipeShareTokenSave",
|
||||
"RecipeShareTokenSummary",
|
||||
"CreateIngredientFood",
|
||||
"CreateIngredientFoodAlias",
|
||||
"CreateIngredientUnit",
|
||||
|
@ -140,13 +111,27 @@ __all__ = [
|
|||
"SaveIngredientFood",
|
||||
"SaveIngredientUnit",
|
||||
"UnitFoodBase",
|
||||
"RecipeTimelineEventCreate",
|
||||
"RecipeTimelineEventIn",
|
||||
"RecipeTimelineEventOut",
|
||||
"RecipeTimelineEventPagination",
|
||||
"RecipeTimelineEventUpdate",
|
||||
"TimelineEventImage",
|
||||
"TimelineEventType",
|
||||
"Nutrition",
|
||||
"AssignCategories",
|
||||
"AssignSettings",
|
||||
"AssignTags",
|
||||
"DeleteRecipes",
|
||||
"ExportBase",
|
||||
"ExportRecipes",
|
||||
"ExportTypes",
|
||||
"RecipeCommentCreate",
|
||||
"RecipeCommentOut",
|
||||
"RecipeCommentPagination",
|
||||
"RecipeCommentSave",
|
||||
"RecipeCommentUpdate",
|
||||
"UserBase",
|
||||
"RecipeSettings",
|
||||
"CreateRecipe",
|
||||
"CreateRecipeBulk",
|
||||
"CreateRecipeByUrlBulk",
|
||||
|
@ -160,25 +145,40 @@ __all__ = [
|
|||
"RecipeTagPagination",
|
||||
"RecipeTool",
|
||||
"RecipeToolPagination",
|
||||
"ScrapeRecipe",
|
||||
"ScrapeRecipeBase",
|
||||
"ScrapeRecipeData",
|
||||
"ScrapeRecipeTest",
|
||||
"AssignCategories",
|
||||
"AssignSettings",
|
||||
"AssignTags",
|
||||
"DeleteRecipes",
|
||||
"ExportBase",
|
||||
"ExportRecipes",
|
||||
"ExportTypes",
|
||||
"RecipeToolCreate",
|
||||
"RecipeToolOut",
|
||||
"RecipeToolResponse",
|
||||
"RecipeToolSave",
|
||||
"RecipeImageTypes",
|
||||
"IngredientReferences",
|
||||
"RecipeStep",
|
||||
"RecipeNote",
|
||||
"RecipeSuggestionQuery",
|
||||
"RecipeSuggestionResponse",
|
||||
"RecipeSuggestionResponseItem",
|
||||
"RecipeSettings",
|
||||
"RecipeShareToken",
|
||||
"RecipeShareTokenCreate",
|
||||
"RecipeShareTokenSave",
|
||||
"RecipeShareTokenSummary",
|
||||
"RecipeAsset",
|
||||
"RecipeDuplicate",
|
||||
"RecipeSlug",
|
||||
"RecipeZipTokenResponse",
|
||||
"SlugResponse",
|
||||
"UpdateImageResponse",
|
||||
"RecipeToolCreate",
|
||||
"RecipeToolOut",
|
||||
"RecipeToolResponse",
|
||||
"RecipeToolSave",
|
||||
"CategoryBase",
|
||||
"CategoryIn",
|
||||
"CategoryOut",
|
||||
"CategorySave",
|
||||
"RecipeCategoryResponse",
|
||||
"RecipeTagResponse",
|
||||
"TagBase",
|
||||
"TagIn",
|
||||
"TagOut",
|
||||
"TagSave",
|
||||
"ScrapeRecipe",
|
||||
"ScrapeRecipeBase",
|
||||
"ScrapeRecipeData",
|
||||
"ScrapeRecipeTest",
|
||||
"RecipeImageTypes",
|
||||
]
|
||||
|
|
|
@ -28,14 +28,14 @@ __all__ = [
|
|||
"QueryFilterJSONPart",
|
||||
"RelationalKeyword",
|
||||
"RelationalOperator",
|
||||
"ValidationResponse",
|
||||
"SearchFilter",
|
||||
"OrderByNullPosition",
|
||||
"OrderDirection",
|
||||
"PaginationBase",
|
||||
"PaginationQuery",
|
||||
"RecipeSearchQuery",
|
||||
"RequestQuery",
|
||||
"SearchFilter",
|
||||
"ValidationResponse",
|
||||
"ErrorResponse",
|
||||
"FileTokenResponse",
|
||||
"SuccessResponse",
|
||||
|
|
|
@ -38,12 +38,6 @@ from .user_passwords import (
|
|||
)
|
||||
|
||||
__all__ = [
|
||||
"ForgotPassword",
|
||||
"PasswordResetToken",
|
||||
"PrivatePasswordResetToken",
|
||||
"ResetPassword",
|
||||
"SavePasswordResetToken",
|
||||
"ValidateResetToken",
|
||||
"CredentialsRequest",
|
||||
"CredentialsRequestForm",
|
||||
"Token",
|
||||
|
@ -75,4 +69,10 @@ __all__ = [
|
|||
"UserRatings",
|
||||
"UserSummary",
|
||||
"UserSummaryPagination",
|
||||
"ForgotPassword",
|
||||
"PasswordResetToken",
|
||||
"PrivatePasswordResetToken",
|
||||
"ResetPassword",
|
||||
"SavePasswordResetToken",
|
||||
"ValidateResetToken",
|
||||
]
|
||||
|
|
|
@ -53,6 +53,10 @@ class EventTypes(Enum):
|
|||
category_updated = auto()
|
||||
category_deleted = auto()
|
||||
|
||||
label_created = auto()
|
||||
label_updated = auto()
|
||||
label_deleted = auto()
|
||||
|
||||
|
||||
class EventDocumentType(Enum):
|
||||
generic = "generic"
|
||||
|
@ -68,6 +72,7 @@ class EventDocumentType(Enum):
|
|||
recipe_bulk_report = "recipe_bulk_report"
|
||||
recipe_timeline_event = "recipe_timeline_event"
|
||||
tag = "tag"
|
||||
label = "label"
|
||||
|
||||
|
||||
class EventOperation(Enum):
|
||||
|
@ -106,6 +111,11 @@ class EventCategoryData(EventDocumentDataBase):
|
|||
category_id: UUID4
|
||||
|
||||
|
||||
class EventLabelData(EventDocumentDataBase):
|
||||
document_type: EventDocumentType = EventDocumentType.label
|
||||
label_id: UUID4
|
||||
|
||||
|
||||
class EventCookbookData(EventDocumentDataBase):
|
||||
document_type: EventDocumentType = EventDocumentType.cookbook
|
||||
cookbook_id: UUID4
|
||||
|
|
|
@ -38,6 +38,9 @@ def preferences_generator():
|
|||
category_created=random_bool(),
|
||||
category_updated=random_bool(),
|
||||
category_deleted=random_bool(),
|
||||
label_created=random_bool(),
|
||||
label_updated=random_bool(),
|
||||
label_deleted=random_bool(),
|
||||
).model_dump(by_alias=True)
|
||||
|
||||
|
||||
|
|
|
@ -173,8 +173,6 @@ units = "/api/units"
|
|||
"""`/api/units`"""
|
||||
units_merge = "/api/units/merge"
|
||||
"""`/api/units/merge`"""
|
||||
users = "/api/users"
|
||||
"""`/api/users`"""
|
||||
users_api_tokens = "/api/users/api-tokens"
|
||||
"""`/api/users/api-tokens`"""
|
||||
users_forgot_password = "/api/users/forgot-password"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue