mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 15:49:42 +02:00
Use composition API for more components, enable more type checking (#914)
* Activate more linting rules from eslint and typescript * Properly add VForm as type information * Fix usage of native types * Fix more linting issues * Rename vuetify types file, add VTooltip * Fix some more typing problems * Use composition API for more components * Convert RecipeRating * Convert RecipeNutrition * Convert more components to composition API * Fix globals plugin for type checking * Add missing icon types * Fix vuetify types in Nuxt context * Use composition API for RecipeActionMenu * Convert error.vue to composition API * Convert RecipeContextMenu to composition API * Use more composition API and type checking in recipe/create * Convert AppButtonUpload to composition API * Fix some type checking in RecipeContextMenu * Remove unused components BaseAutoForm and BaseColorPicker * Convert RecipeCategoryTagDialog to composition API * Convert RecipeCardSection to composition API * Convert RecipeCategoryTagSelector to composition API * Properly import vuetify type definitions * Convert BaseButton to composition API * Convert AutoForm to composition API * Remove unused requests API file * Remove static routes from recipe API * Fix more type errors * Convert AppHeader to composition API, fixing some search bar focus problems * Convert RecipeDialogSearch to composition API * Update API types from pydantic models, handle undefined values * Improve more typing problems * Add types to other plugins * Properly type the CRUD API access * Fix typing of static image routes * Fix more typing stuff * Fix some more typing problems * Turn off more rules
This commit is contained in:
parent
d5ab5ec66f
commit
86c99b10a2
114 changed files with 2218 additions and 2033 deletions
|
@ -5,6 +5,26 @@
|
|||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
*/
|
||||
|
||||
export interface AdminAboutInfo {
|
||||
production: boolean;
|
||||
version: string;
|
||||
demoStatus: boolean;
|
||||
versionLatest: string;
|
||||
apiPort: number;
|
||||
apiDocs: boolean;
|
||||
dbType: string;
|
||||
dbUrl: string;
|
||||
defaultGroup: string;
|
||||
}
|
||||
export interface AllBackups {
|
||||
imports: BackupFile[];
|
||||
templates: string[];
|
||||
}
|
||||
export interface BackupFile {
|
||||
name: string;
|
||||
date: string;
|
||||
size: string;
|
||||
}
|
||||
export interface AppInfo {
|
||||
production: boolean;
|
||||
version: string;
|
||||
|
@ -17,36 +37,31 @@ export interface AppStatistics {
|
|||
uncategorizedRecipes: number;
|
||||
untaggedRecipes: number;
|
||||
}
|
||||
export interface BackupJob {
|
||||
tag?: string;
|
||||
options: BackupOptions;
|
||||
templates?: string[];
|
||||
}
|
||||
export interface BackupOptions {
|
||||
recipes?: boolean;
|
||||
settings?: boolean;
|
||||
pages?: boolean;
|
||||
themes?: boolean;
|
||||
groups?: boolean;
|
||||
users?: boolean;
|
||||
notifications?: boolean;
|
||||
}
|
||||
export interface CategoryBase {
|
||||
name: string;
|
||||
id: number;
|
||||
slug: string;
|
||||
export interface CheckAppConfig {
|
||||
emailReady?: boolean;
|
||||
ldapReady?: boolean;
|
||||
baseUrlSet?: boolean;
|
||||
}
|
||||
export interface ChowdownURL {
|
||||
url: string;
|
||||
}
|
||||
export interface Colors {
|
||||
primary?: string;
|
||||
accent?: string;
|
||||
secondary?: string;
|
||||
success?: string;
|
||||
info?: string;
|
||||
warning?: string;
|
||||
error?: string;
|
||||
export interface CommentImport {
|
||||
name: string;
|
||||
status: boolean;
|
||||
exception?: string;
|
||||
}
|
||||
export interface CreateBackup {
|
||||
tag?: string;
|
||||
options: BackupOptions;
|
||||
templates?: string[];
|
||||
}
|
||||
export interface CustomPageBase {
|
||||
name: string;
|
||||
|
@ -62,51 +77,87 @@ export interface RecipeCategoryResponse {
|
|||
}
|
||||
export interface Recipe {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
description?: string;
|
||||
recipeCategory?: string[];
|
||||
tags?: string[];
|
||||
rating?: number;
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
recipeYield?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
recipeInstructions?: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
tools?: string[];
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
recipeInstructions?: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
settings?: RecipeSettings;
|
||||
assets?: RecipeAsset[];
|
||||
notes?: RecipeNote[];
|
||||
orgURL?: string;
|
||||
extras?: {
|
||||
[k: string]: unknown;
|
||||
};
|
||||
comments?: CommentOut[];
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeTag {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
title?: string;
|
||||
note?: string;
|
||||
unit?: RecipeIngredientUnit;
|
||||
food?: RecipeIngredientFood;
|
||||
unit?: IngredientUnit | CreateIngredientUnit;
|
||||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface RecipeIngredientUnit {
|
||||
name?: string;
|
||||
export interface IngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface RecipeIngredientFood {
|
||||
name?: string;
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
}
|
||||
export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
id?: string;
|
||||
title?: string;
|
||||
text: string;
|
||||
ingredientReferences?: IngredientReferences[];
|
||||
}
|
||||
/**
|
||||
* A list of ingredient references.
|
||||
*/
|
||||
export interface IngredientReferences {
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface Nutrition {
|
||||
calories?: string;
|
||||
|
@ -124,6 +175,7 @@ export interface RecipeSettings {
|
|||
landscapeView?: boolean;
|
||||
disableComments?: boolean;
|
||||
disableAmount?: boolean;
|
||||
locked?: boolean;
|
||||
}
|
||||
export interface RecipeAsset {
|
||||
name: string;
|
||||
|
@ -134,12 +186,13 @@ export interface RecipeNote {
|
|||
title: string;
|
||||
text: string;
|
||||
}
|
||||
export interface CommentOut {
|
||||
export interface RecipeCommentOut {
|
||||
recipeId: number;
|
||||
text: string;
|
||||
id: number;
|
||||
uuid: string;
|
||||
recipeSlug: string;
|
||||
dateAdded: string;
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updateAt: string;
|
||||
userId: string;
|
||||
user: UserBase;
|
||||
}
|
||||
export interface UserBase {
|
||||
|
@ -159,16 +212,6 @@ export interface CustomPageOut {
|
|||
categories?: RecipeCategoryResponse[];
|
||||
id: number;
|
||||
}
|
||||
export interface DebugInfo {
|
||||
production: boolean;
|
||||
version: string;
|
||||
demoStatus: boolean;
|
||||
apiPort: number;
|
||||
apiDocs: boolean;
|
||||
dbType: string;
|
||||
dbUrl: string;
|
||||
defaultGroup: string;
|
||||
}
|
||||
export interface GroupImport {
|
||||
name: string;
|
||||
status: boolean;
|
||||
|
@ -182,7 +225,6 @@ export interface ImportBase {
|
|||
export interface ImportJob {
|
||||
recipes?: boolean;
|
||||
settings?: boolean;
|
||||
pages?: boolean;
|
||||
themes?: boolean;
|
||||
groups?: boolean;
|
||||
users?: boolean;
|
||||
|
@ -191,14 +233,6 @@ export interface ImportJob {
|
|||
force?: boolean;
|
||||
rebase?: boolean;
|
||||
}
|
||||
export interface Imports {
|
||||
imports: LocalBackup[];
|
||||
templates: string[];
|
||||
}
|
||||
export interface LocalBackup {
|
||||
name: string;
|
||||
date: string;
|
||||
}
|
||||
export interface MigrationFile {
|
||||
name: string;
|
||||
date: string;
|
||||
|
@ -229,23 +263,6 @@ export interface SettingsImport {
|
|||
status: boolean;
|
||||
exception?: string;
|
||||
}
|
||||
export interface SiteSettings {
|
||||
language?: string;
|
||||
firstDayOfWeek?: number;
|
||||
showRecent?: boolean;
|
||||
cardsPerSection?: number;
|
||||
categories?: CategoryBase[];
|
||||
}
|
||||
export interface SiteTheme {
|
||||
id?: number;
|
||||
name?: string;
|
||||
colors?: Colors;
|
||||
}
|
||||
export interface ThemeImport {
|
||||
name: string;
|
||||
status: boolean;
|
||||
exception?: string;
|
||||
}
|
||||
export interface UserImport {
|
||||
name: string;
|
||||
status: boolean;
|
||||
|
|
184
frontend/types/api-types/cookbook.ts
Normal file
184
frontend/types/api-types/cookbook.ts
Normal file
|
@ -0,0 +1,184 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-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
|
||||
*/
|
||||
|
||||
export interface CategoryBase {
|
||||
name: string;
|
||||
id: number;
|
||||
slug: string;
|
||||
}
|
||||
export interface CreateCookBook {
|
||||
name: string;
|
||||
description?: string;
|
||||
slug?: string;
|
||||
position?: number;
|
||||
categories?: CategoryBase[];
|
||||
}
|
||||
export interface ReadCookBook {
|
||||
name: string;
|
||||
description?: string;
|
||||
slug?: string;
|
||||
position?: number;
|
||||
categories?: CategoryBase[];
|
||||
id: number;
|
||||
groupId: string;
|
||||
}
|
||||
export interface RecipeCategoryResponse {
|
||||
name: string;
|
||||
id: number;
|
||||
slug: string;
|
||||
recipes?: Recipe[];
|
||||
}
|
||||
export interface Recipe {
|
||||
id?: number;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
recipeYield?: string;
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
recipeInstructions?: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
settings?: RecipeSettings;
|
||||
assets?: RecipeAsset[];
|
||||
notes?: RecipeNote[];
|
||||
extras?: {
|
||||
[k: string]: unknown;
|
||||
};
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeTag {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
title?: string;
|
||||
note?: string;
|
||||
unit?: IngredientUnit | CreateIngredientUnit;
|
||||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface IngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
}
|
||||
export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
id?: string;
|
||||
title?: string;
|
||||
text: string;
|
||||
ingredientReferences?: IngredientReferences[];
|
||||
}
|
||||
/**
|
||||
* A list of ingredient references.
|
||||
*/
|
||||
export interface IngredientReferences {
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface Nutrition {
|
||||
calories?: string;
|
||||
fatContent?: string;
|
||||
proteinContent?: string;
|
||||
carbohydrateContent?: string;
|
||||
fiberContent?: string;
|
||||
sodiumContent?: string;
|
||||
sugarContent?: string;
|
||||
}
|
||||
export interface RecipeSettings {
|
||||
public?: boolean;
|
||||
showNutrition?: boolean;
|
||||
showAssets?: boolean;
|
||||
landscapeView?: boolean;
|
||||
disableComments?: boolean;
|
||||
disableAmount?: boolean;
|
||||
locked?: boolean;
|
||||
}
|
||||
export interface RecipeAsset {
|
||||
name: string;
|
||||
icon: string;
|
||||
fileName?: string;
|
||||
}
|
||||
export interface RecipeNote {
|
||||
title: string;
|
||||
text: string;
|
||||
}
|
||||
export interface RecipeCommentOut {
|
||||
recipeId: number;
|
||||
text: string;
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updateAt: string;
|
||||
userId: string;
|
||||
user: UserBase;
|
||||
}
|
||||
export interface UserBase {
|
||||
id: number;
|
||||
username?: string;
|
||||
admin: boolean;
|
||||
}
|
||||
export interface RecipeCookBook {
|
||||
name: string;
|
||||
description?: string;
|
||||
slug?: string;
|
||||
position?: number;
|
||||
categories: RecipeCategoryResponse[];
|
||||
id: number;
|
||||
groupId: string;
|
||||
}
|
||||
export interface SaveCookBook {
|
||||
name: string;
|
||||
description?: string;
|
||||
slug?: string;
|
||||
position?: number;
|
||||
categories?: CategoryBase[];
|
||||
groupId: string;
|
||||
}
|
||||
export interface UpdateCookBook {
|
||||
name: string;
|
||||
description?: string;
|
||||
slug?: string;
|
||||
position?: number;
|
||||
categories?: CategoryBase[];
|
||||
id: number;
|
||||
}
|
28
frontend/types/api-types/group.ts
Normal file
28
frontend/types/api-types/group.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-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
|
||||
*/
|
||||
|
||||
export interface CreateWebhook {
|
||||
enabled?: boolean;
|
||||
name?: string;
|
||||
url?: string;
|
||||
time?: string;
|
||||
}
|
||||
export interface ReadWebhook {
|
||||
enabled?: boolean;
|
||||
name?: string;
|
||||
url?: string;
|
||||
time?: string;
|
||||
groupId: string;
|
||||
id: number;
|
||||
}
|
||||
export interface SaveWebhook {
|
||||
enabled?: boolean;
|
||||
name?: string;
|
||||
url?: string;
|
||||
time?: string;
|
||||
groupId: string;
|
||||
}
|
|
@ -5,6 +5,15 @@
|
|||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
*/
|
||||
|
||||
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "snack";
|
||||
|
||||
export interface CreatePlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
title?: string;
|
||||
text?: string;
|
||||
recipeId?: number;
|
||||
}
|
||||
export interface ListItem {
|
||||
title?: string;
|
||||
text?: string;
|
||||
|
@ -36,9 +45,90 @@ export interface MealPlanOut {
|
|||
startDate: string;
|
||||
endDate: string;
|
||||
planDays: MealDayIn[];
|
||||
uid: number;
|
||||
id: number;
|
||||
shoppingList?: number;
|
||||
}
|
||||
export interface ReadPlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
title?: string;
|
||||
text?: string;
|
||||
recipeId?: number;
|
||||
id: number;
|
||||
groupId: string;
|
||||
recipe?: RecipeSummary;
|
||||
}
|
||||
export interface RecipeSummary {
|
||||
id?: number;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
recipeYield?: string;
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
title?: string;
|
||||
note?: string;
|
||||
unit?: IngredientUnit | CreateIngredientUnit;
|
||||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface IngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
}
|
||||
export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface SavePlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
title?: string;
|
||||
text?: string;
|
||||
recipeId?: number;
|
||||
groupId: string;
|
||||
}
|
||||
export interface ShoppingListIn {
|
||||
name: string;
|
||||
group?: string;
|
||||
|
@ -50,3 +140,12 @@ export interface ShoppingListOut {
|
|||
items: ListItem[];
|
||||
id: number;
|
||||
}
|
||||
export interface UpdatePlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
title?: string;
|
||||
text?: string;
|
||||
recipeId?: number;
|
||||
id: number;
|
||||
groupId: string;
|
||||
}
|
||||
|
|
|
@ -5,14 +5,8 @@
|
|||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
*/
|
||||
|
||||
export interface CreateRecipe {
|
||||
name: string;
|
||||
}
|
||||
export type RegisteredParser = "nlp" | "brute";
|
||||
|
||||
export interface AllRecipeRequest {
|
||||
properties: string[];
|
||||
limit?: number;
|
||||
}
|
||||
export interface CategoryBase {
|
||||
name: string;
|
||||
id: number;
|
||||
|
@ -21,26 +15,65 @@ export interface CategoryBase {
|
|||
export interface CategoryIn {
|
||||
name: string;
|
||||
}
|
||||
export interface CommentIn {
|
||||
text: string;
|
||||
export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface CommentOut {
|
||||
text: string;
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
}
|
||||
export interface CreateRecipe {
|
||||
name: string;
|
||||
}
|
||||
export interface CreateRecipeBulk {
|
||||
url: string;
|
||||
categories?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface CreateRecipeByUrl {
|
||||
url: string;
|
||||
}
|
||||
export interface CreateRecipeByUrlBulk {
|
||||
imports: CreateRecipeBulk[];
|
||||
}
|
||||
export interface IngredientConfidence {
|
||||
average?: number;
|
||||
comment?: number;
|
||||
name?: number;
|
||||
unit?: number;
|
||||
quantity?: number;
|
||||
food?: number;
|
||||
}
|
||||
export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
id: number;
|
||||
uuid: string;
|
||||
recipeSlug: string;
|
||||
dateAdded: string;
|
||||
user: UserBase;
|
||||
}
|
||||
export interface UserBase {
|
||||
export interface IngredientRequest {
|
||||
parser?: RegisteredParser & string;
|
||||
ingredient: string;
|
||||
}
|
||||
export interface IngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
id: number;
|
||||
username?: string;
|
||||
admin: boolean;
|
||||
}
|
||||
export interface CommentSaveToDB {
|
||||
text: string;
|
||||
recipeSlug: string;
|
||||
user: number;
|
||||
export interface IngredientsRequest {
|
||||
parser?: RegisteredParser & string;
|
||||
ingredients: string[];
|
||||
}
|
||||
export interface Nutrition {
|
||||
calories?: string;
|
||||
|
@ -51,60 +84,68 @@ export interface Nutrition {
|
|||
sodiumContent?: string;
|
||||
sugarContent?: string;
|
||||
}
|
||||
export interface ParsedIngredient {
|
||||
input?: string;
|
||||
confidence?: IngredientConfidence;
|
||||
ingredient: RecipeIngredient;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
title?: string;
|
||||
note?: string;
|
||||
unit?: IngredientUnit | CreateIngredientUnit;
|
||||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface Recipe {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
image: string;
|
||||
description: string;
|
||||
recipeCategory: string[];
|
||||
tags: string[];
|
||||
rating: number;
|
||||
dateAdded: string;
|
||||
dateUpdated: string;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
recipeYield?: string;
|
||||
recipeIngredient: RecipeIngredient[];
|
||||
recipeInstructions: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
tools?: string[];
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
recipeInstructions?: RecipeStep[];
|
||||
nutrition?: Nutrition;
|
||||
settings?: RecipeSettings;
|
||||
assets?: RecipeAsset[];
|
||||
notes?: RecipeNote[];
|
||||
orgURL?: string;
|
||||
extras?: {
|
||||
[k: string]: unknown;
|
||||
};
|
||||
comments?: CommentOut[];
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
referenceId: string;
|
||||
title: string;
|
||||
note: string;
|
||||
unit?: RecipeIngredientUnit | null;
|
||||
food?: RecipeIngredientFood | null;
|
||||
disableAmount: boolean;
|
||||
quantity: number;
|
||||
}
|
||||
export interface RecipeIngredientUnit {
|
||||
name?: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
}
|
||||
export interface RecipeIngredientFood {
|
||||
name?: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface IngredientToStepRef {
|
||||
referenceId: string;
|
||||
export interface RecipeTool {
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
id: string;
|
||||
id?: string;
|
||||
title?: string;
|
||||
text: string;
|
||||
ingredientReferences: IngredientToStepRef[];
|
||||
ingredientReferences?: IngredientReferences[];
|
||||
}
|
||||
/**
|
||||
* A list of ingredient references.
|
||||
*/
|
||||
export interface IngredientReferences {
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface RecipeSettings {
|
||||
public?: boolean;
|
||||
|
@ -113,6 +154,7 @@ export interface RecipeSettings {
|
|||
landscapeView?: boolean;
|
||||
disableComments?: boolean;
|
||||
disableAmount?: boolean;
|
||||
locked?: boolean;
|
||||
}
|
||||
export interface RecipeAsset {
|
||||
name: string;
|
||||
|
@ -123,23 +165,86 @@ export interface RecipeNote {
|
|||
title: string;
|
||||
text: string;
|
||||
}
|
||||
export interface RecipeCommentOut {
|
||||
recipeId: number;
|
||||
text: string;
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updateAt: string;
|
||||
userId: string;
|
||||
user: UserBase;
|
||||
}
|
||||
export interface UserBase {
|
||||
id: number;
|
||||
username?: string;
|
||||
admin: boolean;
|
||||
}
|
||||
export interface RecipeCategoryResponse {
|
||||
name: string;
|
||||
id: number;
|
||||
slug: string;
|
||||
recipes?: Recipe[];
|
||||
}
|
||||
export interface RecipeCommentCreate {
|
||||
recipeId: number;
|
||||
text: string;
|
||||
}
|
||||
export interface RecipeCommentSave {
|
||||
recipeId: number;
|
||||
text: string;
|
||||
userId: string;
|
||||
}
|
||||
export interface RecipeCommentUpdate {
|
||||
id: string;
|
||||
text: string;
|
||||
}
|
||||
export interface RecipeSlug {
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeSummary {
|
||||
id?: number;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
recipeYield?: string;
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory: string[];
|
||||
tags: string[];
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeURLIn {
|
||||
url: string;
|
||||
export interface RecipeTagResponse {
|
||||
name: string;
|
||||
id: number;
|
||||
slug: string;
|
||||
recipes?: Recipe[];
|
||||
}
|
||||
export interface RecipeTool1 {
|
||||
name: string;
|
||||
onHand?: boolean;
|
||||
id: number;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeToolCreate {
|
||||
name: string;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeToolResponse {
|
||||
name: string;
|
||||
onHand?: boolean;
|
||||
id: number;
|
||||
slug: string;
|
||||
recipes?: Recipe[];
|
||||
}
|
||||
export interface SlugResponse {}
|
||||
export interface TagBase {
|
||||
|
|
49
frontend/types/api-types/reports.ts
Normal file
49
frontend/types/api-types/reports.ts
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-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
|
||||
*/
|
||||
|
||||
export type ReportCategory = "backup" | "restore" | "migration";
|
||||
export type ReportSummaryStatus = "in-progress" | "success" | "failure" | "partial";
|
||||
|
||||
export interface ReportCreate {
|
||||
timestamp?: string;
|
||||
category: ReportCategory;
|
||||
groupId: string;
|
||||
name: string;
|
||||
status?: ReportSummaryStatus & string;
|
||||
}
|
||||
export interface ReportEntryCreate {
|
||||
reportId: string;
|
||||
timestamp?: string;
|
||||
success?: boolean;
|
||||
message: string;
|
||||
exception?: string;
|
||||
}
|
||||
export interface ReportEntryOut {
|
||||
reportId: string;
|
||||
timestamp?: string;
|
||||
success?: boolean;
|
||||
message: string;
|
||||
exception?: string;
|
||||
id: string;
|
||||
}
|
||||
export interface ReportOut {
|
||||
timestamp?: string;
|
||||
category: ReportCategory;
|
||||
groupId: string;
|
||||
name: string;
|
||||
status?: ReportSummaryStatus & string;
|
||||
id: string;
|
||||
entries?: ReportEntryOut[];
|
||||
}
|
||||
export interface ReportSummary {
|
||||
timestamp?: string;
|
||||
category: ReportCategory;
|
||||
groupId: string;
|
||||
name: string;
|
||||
status?: ReportSummaryStatus & string;
|
||||
id: string;
|
||||
}
|
12
frontend/types/api-types/response.ts
Normal file
12
frontend/types/api-types/response.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-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
|
||||
*/
|
||||
|
||||
export interface ErrorResponse {
|
||||
message: string;
|
||||
error?: boolean;
|
||||
exception?: string;
|
||||
}
|
25
frontend/types/api-types/server.ts
Normal file
25
frontend/types/api-types/server.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
/* tslint:disable */
|
||||
/* eslint-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
|
||||
*/
|
||||
|
||||
export type ServerTaskNames = "Background Task" | "Database Backup" | "Bulk Recipe Import";
|
||||
export type ServerTaskStatus = "running" | "finished" | "failed";
|
||||
|
||||
export interface ServerTask {
|
||||
groupId: string;
|
||||
name?: ServerTaskNames & string;
|
||||
createdAt?: string;
|
||||
status?: ServerTaskStatus & string;
|
||||
log?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface ServerTaskCreate {
|
||||
groupId: string;
|
||||
name?: ServerTaskNames & string;
|
||||
createdAt?: string;
|
||||
status?: ServerTaskStatus & string;
|
||||
log?: string;
|
||||
}
|
|
@ -16,7 +16,7 @@ export interface ChangePassword {
|
|||
}
|
||||
export interface CreateToken {
|
||||
name: string;
|
||||
parentId: number;
|
||||
userId: string;
|
||||
token: string;
|
||||
}
|
||||
export interface GroupBase {
|
||||
|
@ -24,48 +24,33 @@ export interface GroupBase {
|
|||
}
|
||||
export interface GroupInDB {
|
||||
name: string;
|
||||
id: number;
|
||||
id: string;
|
||||
categories?: CategoryBase[];
|
||||
webhookUrls?: string[];
|
||||
webhookTime?: string;
|
||||
webhookEnable: boolean;
|
||||
webhooks?: unknown[];
|
||||
users?: UserOut[];
|
||||
mealplans?: MealPlanOut[];
|
||||
shoppingLists?: ShoppingListOut[];
|
||||
preferences?: ReadGroupPreferences;
|
||||
}
|
||||
export interface UserOut {
|
||||
canOrganize: boolean;
|
||||
canManage: boolean;
|
||||
canInvite: boolean;
|
||||
username?: string;
|
||||
fullName?: string;
|
||||
email: string;
|
||||
admin: boolean;
|
||||
admin?: boolean;
|
||||
group: string;
|
||||
advanced?: boolean;
|
||||
favoriteRecipes?: string[];
|
||||
id: number;
|
||||
canInvite?: boolean;
|
||||
canManage?: boolean;
|
||||
canOrganize?: boolean;
|
||||
id: string;
|
||||
groupId: string;
|
||||
tokens?: LongLiveTokenOut[];
|
||||
cacheKey: string;
|
||||
}
|
||||
export interface LongLiveTokenOut {
|
||||
name: string;
|
||||
id: number;
|
||||
}
|
||||
export interface MealPlanOut {
|
||||
group: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
planDays: MealDayIn[];
|
||||
uid: number;
|
||||
shoppingList?: number;
|
||||
}
|
||||
export interface MealDayIn {
|
||||
date?: string;
|
||||
meals: MealIn[];
|
||||
}
|
||||
export interface MealIn {
|
||||
slug?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
export interface ShoppingListOut {
|
||||
name: string;
|
||||
|
@ -79,39 +64,108 @@ export interface ListItem {
|
|||
quantity?: number;
|
||||
checked?: boolean;
|
||||
}
|
||||
export interface ReadGroupPreferences {
|
||||
privateGroup?: boolean;
|
||||
firstDayOfWeek?: number;
|
||||
recipePublic?: boolean;
|
||||
recipeShowNutrition?: boolean;
|
||||
recipeShowAssets?: boolean;
|
||||
recipeLandscapeView?: boolean;
|
||||
recipeDisableComments?: boolean;
|
||||
recipeDisableAmount?: boolean;
|
||||
groupId: string;
|
||||
id: number;
|
||||
}
|
||||
export interface LoingLiveTokenIn {
|
||||
name: string;
|
||||
}
|
||||
export interface LongLiveTokenInDB {
|
||||
name: string;
|
||||
parentId: number;
|
||||
userId: string;
|
||||
token: string;
|
||||
id: number;
|
||||
user: UserInDB;
|
||||
user: PrivateUser;
|
||||
}
|
||||
export interface UserInDB {
|
||||
export interface PrivateUser {
|
||||
username?: string;
|
||||
fullName?: string;
|
||||
email: string;
|
||||
admin: boolean;
|
||||
admin?: boolean;
|
||||
group: string;
|
||||
advanced?: boolean;
|
||||
favoriteRecipes?: string[];
|
||||
id: number;
|
||||
canInvite?: boolean;
|
||||
canManage?: boolean;
|
||||
canOrganize?: boolean;
|
||||
id: string;
|
||||
groupId: string;
|
||||
tokens?: LongLiveTokenOut[];
|
||||
cacheKey: string;
|
||||
password: string;
|
||||
}
|
||||
export interface RecipeSummary {
|
||||
id?: number;
|
||||
userId?: string;
|
||||
groupId?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
image?: unknown;
|
||||
recipeYield?: string;
|
||||
totalTime?: string;
|
||||
prepTime?: string;
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: string[];
|
||||
tags?: string[];
|
||||
recipeCategory?: RecipeTag[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
orgURL?: string;
|
||||
recipeIngredient?: RecipeIngredient[];
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
title?: string;
|
||||
note?: string;
|
||||
unit?: IngredientUnit | CreateIngredientUnit;
|
||||
food?: IngredientFood | CreateIngredientFood;
|
||||
disableAmount?: boolean;
|
||||
quantity?: number;
|
||||
referenceId?: string;
|
||||
}
|
||||
export interface IngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
description?: string;
|
||||
fraction?: boolean;
|
||||
abbreviation?: string;
|
||||
}
|
||||
export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
id: number;
|
||||
}
|
||||
export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface SignUpIn {
|
||||
name: string;
|
||||
admin: boolean;
|
||||
|
@ -136,34 +190,44 @@ export interface TokenData {
|
|||
}
|
||||
export interface UpdateGroup {
|
||||
name: string;
|
||||
id: number;
|
||||
id: string;
|
||||
categories?: CategoryBase[];
|
||||
webhookUrls?: string[];
|
||||
webhookTime?: string;
|
||||
webhookEnable: boolean;
|
||||
webhooks?: unknown[];
|
||||
}
|
||||
export interface UserBase {
|
||||
username?: string;
|
||||
fullName?: string;
|
||||
email: string;
|
||||
admin: boolean;
|
||||
admin?: boolean;
|
||||
group?: string;
|
||||
advanced?: boolean;
|
||||
favoriteRecipes?: string[];
|
||||
canInvite?: boolean;
|
||||
canManage?: boolean;
|
||||
canOrganize?: boolean;
|
||||
}
|
||||
export interface UserFavorites {
|
||||
username?: string;
|
||||
fullName?: string;
|
||||
email: string;
|
||||
admin: boolean;
|
||||
admin?: boolean;
|
||||
group?: string;
|
||||
advanced?: boolean;
|
||||
favoriteRecipes?: RecipeSummary[];
|
||||
canInvite?: boolean;
|
||||
canManage?: boolean;
|
||||
canOrganize?: boolean;
|
||||
}
|
||||
export interface UserIn {
|
||||
username?: string;
|
||||
fullName?: string;
|
||||
email: string;
|
||||
admin: boolean;
|
||||
admin?: boolean;
|
||||
group?: string;
|
||||
advanced?: boolean;
|
||||
favoriteRecipes?: string[];
|
||||
canInvite?: boolean;
|
||||
canManage?: boolean;
|
||||
canOrganize?: boolean;
|
||||
password: string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue