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:
Philipp Fischbeck 2022-01-09 07:15:23 +01:00 committed by GitHub
commit 86c99b10a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
114 changed files with 2218 additions and 2033 deletions

View file

@ -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;

View 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;
}

View 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;
}

View file

@ -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;
}

View file

@ -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 {

View 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;
}

View 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;
}

View 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;
}

View file

@ -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;
}

View file

@ -1,15 +1,15 @@
import { AxiosResponse } from "axios";
interface RequestResponse<T> {
export interface RequestResponse<T> {
response: AxiosResponse<T> | null;
data: T | null;
error: any;
}
export interface ApiRequestInstance {
get<T>(url: string, data?: T | object): Promise<RequestResponse<T>>;
post<T>(url: string, data: T | object | any): Promise<RequestResponse<T>>;
put<T>(url: string, data: T | object): Promise<RequestResponse<T>>;
patch<T>(url: string, data: T | object): Promise<RequestResponse<T>>;
delete<T>(url: string, data?: T | object): Promise<RequestResponse<T>>;
get<T>(url: string, data?: unknown): Promise<RequestResponse<T>>;
post<T>(url: string, data: unknown): Promise<RequestResponse<T>>;
put<T, U = T>(url: string, data: U): Promise<RequestResponse<T>>;
patch<T, U = Partial<T>>(url: string, data: U): Promise<RequestResponse<T>>;
delete<T>(url: string): Promise<RequestResponse<T>>;
}

View file

@ -1,4 +1,4 @@
import { TranslateResult } from "vue-i18n";
import { TranslateResult } from "vue-i18n/types";
export interface SideBarLink {
icon: string;

View file

@ -4,6 +4,7 @@ export interface FormField {
section?: string;
sectionDetails?: string;
label?: string;
hint?: string;
varName: string;
type: FormFieldType;
rules?: string[];

View file

@ -1,45 +1,53 @@
// This Code is auto generated by gen_global_componenets.py
import BaseCardSectionTitle from "@/components/global/BaseCardSectionTitle.vue";
import AppLoader from "@/components/global/AppLoader.vue";
import BaseButton from "@/components/global/BaseButton.vue";
import BaseDialog from "@/components/global/BaseDialog.vue";
import BaseStatCard from "@/components/global/BaseStatCard.vue";
import ToggleState from "@/components/global/ToggleState.vue";
import AppButtonCopy from "@/components/global/AppButtonCopy.vue";
import BaseColorPicker from "@/components/global/BaseColorPicker.vue";
import BaseDivider from "@/components/global/BaseDivider.vue";
import AutoForm from "@/components/global/AutoForm.vue";
import AppButtonUpload from "@/components/global/AppButtonUpload.vue";
import BasePageTitle from "@/components/global/BasePageTitle.vue";
import BaseAutoForm from "@/components/global/BaseAutoForm.vue";
// This Code is auto generated by gen_global_components.py
import BaseCardSectionTitle from "@/components/global/BaseCardSectionTitle.vue";
import MarkdownEditor from "@/components/global/MarkdownEditor.vue";
import AppLoader from "@/components/global/AppLoader.vue";
import BaseOverflowButton from "@/components/global/BaseOverflowButton.vue";
import ReportTable from "@/components/global/ReportTable.vue";
import AppToolbar from "@/components/global/AppToolbar.vue";
import BaseButton from "@/components/global/BaseButton.vue";
import BaseDialog from "@/components/global/BaseDialog.vue";
import RecipeJsonEditor from "@/components/global/RecipeJsonEditor.vue";
import BaseStatCard from "@/components/global/BaseStatCard.vue";
import ToggleState from "@/components/global/ToggleState.vue";
import AppButtonCopy from "@/components/global/AppButtonCopy.vue";
import BaseDivider from "@/components/global/BaseDivider.vue";
import AutoForm from "@/components/global/AutoForm.vue";
import AppButtonUpload from "@/components/global/AppButtonUpload.vue";
import BasePageTitle from "@/components/global/BasePageTitle.vue";
import TheSnackbar from "@/components/layout/TheSnackbar.vue";
import AppHeader from "@/components/layout/AppHeader.vue";
import AppSidebar from "@/components/layout/AppSidebar.vue";
import AppFooter from "@/components/layout/AppFooter.vue";
import TheSnackbar from "@/components/layout/TheSnackbar.vue";
import AppHeader from "@/components/layout/AppHeader.vue";
import AppSidebar from "@/components/layout/AppSidebar.vue";
import AppFooter from "@/components/layout/AppFooter.vue";
declare module "vue" {
export interface GlobalComponents {
// Global Components
BaseCardSectionTitle: typeof BaseCardSectionTitle;
AppLoader: typeof AppLoader;
BaseButton: typeof BaseButton;
BaseDialog: typeof BaseDialog;
BaseStatCard: typeof BaseStatCard;
ToggleState: typeof ToggleState;
AppButtonCopy: typeof AppButtonCopy;
BaseColorPicker: typeof BaseColorPicker;
BaseDivider: typeof BaseDivider;
AutoForm: typeof AutoForm;
AppButtonUpload: typeof AppButtonUpload;
BasePageTitle: typeof BasePageTitle;
BaseAutoForm: typeof BaseAutoForm;
// Layout Components
TheSnackbar: typeof TheSnackbar;
AppHeader: typeof AppHeader;
AppSidebar: typeof AppSidebar;
AppFooter: typeof AppFooter;
BaseCardSectionTitle: typeof BaseCardSectionTitle;
MarkdownEditor: typeof MarkdownEditor;
AppLoader: typeof AppLoader;
BaseOverflowButton: typeof BaseOverflowButton;
ReportTable: typeof ReportTable;
AppToolbar: typeof AppToolbar;
BaseButton: typeof BaseButton;
BaseDialog: typeof BaseDialog;
RecipeJsonEditor: typeof RecipeJsonEditor;
BaseStatCard: typeof BaseStatCard;
ToggleState: typeof ToggleState;
AppButtonCopy: typeof AppButtonCopy;
BaseDivider: typeof BaseDivider;
AutoForm: typeof AutoForm;
AppButtonUpload: typeof AppButtonUpload;
BasePageTitle: typeof BasePageTitle;
// Layout Components
TheSnackbar: typeof TheSnackbar;
AppHeader: typeof AppHeader;
AppSidebar: typeof AppSidebar;
AppFooter: typeof AppFooter;
}
}
export {};
export {};

View file

@ -1,7 +0,0 @@
import Auth from "@nuxtjs/auth-next/dist/core/auth";
declare module "vue/types/vue" {
interface Vue {
$auth: Auth;
}
}

View file

@ -2,7 +2,3 @@ declare module "*.vue" {
import Vue from "vue"
export default Vue
}
interface VForm extends HTMLFormElement {
validate(): boolean;
}

View file

@ -1,22 +0,0 @@
import Vue from "vue";
import "@nuxt/types";
import { Icon } from "~/utils/icons/icon-type";
interface Globals {
icons: Icon;
}
declare module "vue/types/vue" {
interface Vue {
$globals: any;
}
}
declare module "vue/types/options" {
interface ComponentOptions<V extends Vue> {
$globals?: Globals;
}
interface ComponentOptions<V extends UseContextReturn> {
$globals?: Globals;
}
}

11
frontend/types/vuetify.ts Normal file
View file

@ -0,0 +1,11 @@
// TODO Remove this file when upgrading to Vuetify 3.0
export type VTooltip = Vue & {
deactivate(): void;
}
export type VForm = Vue & {
validate: () => boolean;
resetValidation: () => boolean;
reset: () => void;
};