diff --git a/cookbook/helper/recipe_search.py b/cookbook/helper/recipe_search.py index d63dba0f..195cafef 100644 --- a/cookbook/helper/recipe_search.py +++ b/cookbook/helper/recipe_search.py @@ -38,6 +38,7 @@ def search_recipes(request, queryset, params): search_keywords = params.getlist('keywords', []) search_foods = params.getlist('foods', []) search_books = params.getlist('books', []) + search_steps = params.getlist('steps', []) search_units = params.get('units', None) # TODO I think default behavior should be 'AND' which is how most sites operate with facet/filters based on results @@ -191,6 +192,10 @@ def search_recipes(request, queryset, params): if search_units: queryset = queryset.filter(steps__ingredients__unit__id=search_units) + # probably only useful in Unit list view, so keeping it simple + if search_steps: + queryset = queryset.filter(steps__id__in=search_steps) + if search_internal: queryset = queryset.filter(internal=True) diff --git a/cookbook/schemas.py b/cookbook/schemas.py index f1553d9c..fc8ded6c 100644 --- a/cookbook/schemas.py +++ b/cookbook/schemas.py @@ -39,6 +39,11 @@ class RecipeSchema(AutoSchema): "description": 'Id of book a recipe should have. For multiple repeat parameter.', 'schema': {'type': 'string', }, }) + parameters.append({ + "name": 'steps', "in": "query", "required": False, + "description": 'Id of a step a recipe should have. For multiple repeat parameter.', + 'schema': {'type': 'string', }, + }) parameters.append({ "name": 'keywords_or', "in": "query", "required": False, "description": 'If recipe should have all (AND) or any (OR) of the provided keywords.', @@ -86,7 +91,8 @@ class TreeSchema(AutoSchema): }) parameters.append({ "name": 'root', "in": "query", "required": False, - "description": 'Return first level children of {obj} with ID [int]. Integer 0 will return root {obj}s.'.format(obj=api_name), + "description": 'Return first level children of {obj} with ID [int]. Integer 0 will return root {obj}s.'.format( + obj=api_name), 'schema': {'type': 'int', }, }) parameters.append({ @@ -110,3 +116,17 @@ class FilterSchema(AutoSchema): 'schema': {'type': 'string', }, }) return parameters + + +class QueryOnlySchema(AutoSchema): + def get_path_parameters(self, path, method): + if not is_list_view(path, method, self.view): + return super(QueryOnlySchema, self).get_path_parameters(path, method) + + parameters = super().get_path_parameters(path, method) + parameters.append({ + "name": 'query', "in": "query", "required": False, + "description": 'Query string matched (fuzzy) against object name.', + 'schema': {'type': 'string', }, + }) + return parameters diff --git a/cookbook/serializer.py b/cookbook/serializer.py index 451fdb80..115b5e96 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -34,7 +34,8 @@ class ExtendedRecipeMixin(serializers.ModelSerializer): api_serializer = None # extended values are computationally expensive and not needed in normal circumstances try: - if bool(int(self.context['request'].query_params.get('extended', False))) and self.__class__ == api_serializer: + if bool(int( + self.context['request'].query_params.get('extended', False))) and self.__class__ == api_serializer: return fields except AttributeError: pass @@ -49,11 +50,13 @@ class ExtendedRecipeMixin(serializers.ModelSerializer): def get_image(self, obj): # TODO add caching - recipes = Recipe.objects.filter(**{self.recipe_filter: obj}, space=obj.space).exclude(image__isnull=True).exclude(image__exact='') + recipes = Recipe.objects.filter(**{self.recipe_filter: obj}, space=obj.space).exclude( + image__isnull=True).exclude(image__exact='') try: if recipes.count() == 0 and obj.has_children(): obj__in = self.recipe_filter + '__in' - recipes = Recipe.objects.filter(**{obj__in: obj.get_descendants()}, space=obj.space).exclude(image__isnull=True).exclude(image__exact='') # if no recipes found - check whole tree + recipes = Recipe.objects.filter(**{obj__in: obj.get_descendants()}, space=obj.space).exclude( + image__isnull=True).exclude(image__exact='') # if no recipes found - check whole tree except AttributeError: # probably not a tree pass @@ -404,7 +407,10 @@ class FoodSerializer(UniqueFieldsMixin, WritableNestedModelSerializer, ExtendedR class Meta: model = Food - fields = ('id', 'name', 'description', 'recipe', 'ignore_shopping', 'supermarket_category', 'image', 'parent', 'numchild', 'numrecipe') + fields = ( + 'id', 'name', 'description', 'recipe', 'ignore_shopping', 'supermarket_category', 'image', 'parent', + 'numchild', + 'numrecipe') read_only_fields = ('id', 'numchild', 'parent', 'image') @@ -425,12 +431,13 @@ class IngredientSerializer(WritableNestedModelSerializer): ) -class StepSerializer(WritableNestedModelSerializer): +class StepSerializer(WritableNestedModelSerializer, ExtendedRecipeMixin): ingredients = IngredientSerializer(many=True) ingredients_markdown = serializers.SerializerMethodField('get_ingredients_markdown') ingredients_vue = serializers.SerializerMethodField('get_ingredients_vue') file = UserFileViewSerializer(allow_null=True, required=False) step_recipe_data = serializers.SerializerMethodField('get_step_recipe_data') + recipe_filter = 'steps' def create(self, validated_data): validated_data['space'] = self.context['request'].space @@ -442,6 +449,9 @@ class StepSerializer(WritableNestedModelSerializer): def get_ingredients_markdown(self, obj): return obj.get_instruction_render() + def get_step_recipes(self, obj): + return list(obj.recipe_set.values_list('id', flat=True).all()) + def get_step_recipe_data(self, obj): # check if root type is recipe to prevent infinite recursion # can be improved later to allow multi level embedding @@ -452,7 +462,7 @@ class StepSerializer(WritableNestedModelSerializer): model = Step fields = ( 'id', 'name', 'type', 'instruction', 'ingredients', 'ingredients_markdown', - 'ingredients_vue', 'time', 'order', 'show_as_header', 'file', 'step_recipe', 'step_recipe_data' + 'ingredients_vue', 'time', 'order', 'show_as_header', 'file', 'step_recipe', 'step_recipe_data', 'numrecipe' ) diff --git a/cookbook/urls.py b/cookbook/urls.py index 5ed5b825..9be128ac 100644 --- a/cookbook/urls.py +++ b/cookbook/urls.py @@ -10,7 +10,8 @@ from cookbook.helper import dal from .models import (Comment, Food, InviteLink, Keyword, MealPlan, Recipe, RecipeBook, RecipeBookEntry, RecipeImport, ShoppingList, - Storage, Supermarket, SupermarketCategory, Sync, SyncLog, Unit, get_model_name, Automation, UserFile) + Storage, Supermarket, SupermarketCategory, Sync, SyncLog, Unit, get_model_name, Automation, + UserFile, Step) from .views import api, data, delete, edit, import_export, lists, new, views, telegram router = routers.DefaultRouter() @@ -177,7 +178,7 @@ for m in generic_models: ) ) -vue_models = [Food, Keyword, Unit, Supermarket, SupermarketCategory, Automation, UserFile] +vue_models = [Food, Keyword, Unit, Supermarket, SupermarketCategory, Automation, UserFile, Step] for m in vue_models: py_name = get_model_name(m) url_name = py_name.replace('_', '-') diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 24063da0..026629d1 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -48,7 +48,7 @@ from cookbook.models import (CookLog, Food, Ingredient, Keyword, MealPlan, from cookbook.provider.dropbox import Dropbox from cookbook.provider.local import Local from cookbook.provider.nextcloud import Nextcloud -from cookbook.schemas import FilterSchema, RecipeSchema, TreeSchema +from cookbook.schemas import FilterSchema, RecipeSchema, TreeSchema, QueryOnlySchema from cookbook.serializer import (FoodSerializer, IngredientSerializer, KeywordSerializer, MealPlanSerializer, MealTypeSerializer, RecipeBookSerializer, @@ -410,7 +410,7 @@ class RecipeBookViewSet(viewsets.ModelViewSet, StandardFilterMixin): permission_classes = [CustomIsOwner] def get_queryset(self): - self.queryset = self.queryset.filter(created_by=self.request.user).filter(space=self.request.space) + self.queryset = self.queryset.filter(Q(created_by=self.request.user) | Q(shared=self.request.user)).filter(space=self.request.space) return super().get_queryset() @@ -498,9 +498,16 @@ class StepViewSet(viewsets.ModelViewSet): queryset = Step.objects serializer_class = StepSerializer permission_classes = [CustomIsUser] + pagination_class = DefaultPagination + schema = QueryOnlySchema() def get_queryset(self): - return self.queryset.filter(recipe__space=self.request.space) + queryset = self.queryset.filter(recipe__space=self.request.space) + + query = self.request.query_params.get('query', None) + if query is not None: + queryset = queryset.filter(Q(name__icontains=query) | Q(recipe__name__icontains=query)) + return queryset class RecipePagination(PageNumberPagination): diff --git a/cookbook/views/lists.py b/cookbook/views/lists.py index 87ceb802..c6a1fca2 100644 --- a/cookbook/views/lists.py +++ b/cookbook/views/lists.py @@ -221,6 +221,23 @@ def user_file(request): ) +@group_required('user') +def step(request): + # recipe-param is the name of the parameters used when filtering recipes by this attribute + # model-name is the models.js name of the model, probably ALL-CAPS + return render( + request, + 'generic/model_template.html', + { + "title": _("Steps"), + "config": { + 'model': "STEP", # *REQUIRED* name of the model in models.js + 'recipe_param': 'steps', + } + } + ) + + @group_required('user') def shopping_list_new(request): # recipe-param is the name of the parameters used when filtering recipes by this attribute diff --git a/vue/src/apps/ModelListView/ModelListView.vue b/vue/src/apps/ModelListView/ModelListView.vue index a0250f14..a14528e6 100644 --- a/vue/src/apps/ModelListView/ModelListView.vue +++ b/vue/src/apps/ModelListView/ModelListView.vue @@ -28,8 +28,8 @@ {{ this.this_model.name }} - +
@@ -431,7 +431,7 @@ export default { // TODO: make this generic let params = {'pageSize': 50} params[this.this_recipe_param] = item.id - + console.log('RECIPE PARAM', this.this_recipe_param, params, item.id) this.genericAPI(this.Models.RECIPE, this.Actions.LIST, params).then((result) => { parent = this.findCard(item.id, this['items_' + col]) if (parent) { diff --git a/vue/src/components/ModelMenu.vue b/vue/src/components/ModelMenu.vue index cc74e167..71d12925 100644 --- a/vue/src/components/ModelMenu.vue +++ b/vue/src/components/ModelMenu.vue @@ -34,6 +34,10 @@ {{ Models['USERFILE'].name }} + + {{ Models['STEP'].name }} + + diff --git a/vue/src/utils/models.js b/vue/src/utils/models.js index 94cb5068..0f437097 100644 --- a/vue/src/utils/models.js +++ b/vue/src/utils/models.js @@ -371,14 +371,25 @@ export class Models { 'name': i18n.t('Recipe'), 'apiName': 'Recipe', 'list': { - 'params': ['query', 'keywords', 'foods', 'units', 'rating', 'books', 'keywordsOr', 'foodsOr', 'booksOr', 'internal', 'random', '_new', 'page', 'pageSize', 'options'], + 'params': ['query', 'keywords', 'foods', 'units', 'rating', 'books', 'steps', 'keywordsOr', 'foodsOr', 'booksOr', 'internal', 'random', '_new', 'page', 'pageSize', 'options'], 'config': { 'foods': {'type': 'string'}, 'keywords': {'type': 'string'}, 'books': {'type': 'string'}, } }, + } + static STEP = { + 'name': i18n.t('Step'), + 'apiName': 'Step', + 'paginated': true, + 'list': { + 'header_component': { + 'name': 'BetaWarning' + }, + 'params': ['query', 'page', 'pageSize', 'options'], + }, } static USER_NAME = { diff --git a/vue/src/utils/openapi/api.ts b/vue/src/utils/openapi/api.ts index e339eafa..5d4aabc5 100644 --- a/vue/src/utils/openapi/api.ts +++ b/vue/src/utils/openapi/api.ts @@ -215,12 +215,6 @@ export interface Food { * @memberof Food */ supermarket_category?: FoodSupermarketCategory | null; - /** - * - * @type {string} - * @memberof Food - */ - image?: string; /** * * @type {string} @@ -233,12 +227,6 @@ export interface Food { * @memberof Food */ numchild?: number; - /** - * - * @type {string} - * @memberof Food - */ - numrecipe?: string; } /** * @@ -387,12 +375,6 @@ export interface ImportLogKeyword { * @memberof ImportLogKeyword */ description?: string; - /** - * - * @type {string} - * @memberof ImportLogKeyword - */ - image?: string; /** * * @type {string} @@ -405,12 +387,6 @@ export interface ImportLogKeyword { * @memberof ImportLogKeyword */ numchild?: number; - /** - * - * @type {string} - * @memberof ImportLogKeyword - */ - numrecipe?: string; /** * * @type {string} @@ -444,10 +420,10 @@ export interface Ingredient { food: StepFood | null; /** * - * @type {StepUnit} + * @type {FoodSupermarketCategory} * @memberof Ingredient */ - unit: StepUnit | null; + unit: FoodSupermarketCategory | null; /** * * @type {string} @@ -629,10 +605,10 @@ export interface InlineResponse2004 { previous?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof InlineResponse2004 */ - results?: Array; + results?: Array; } /** * @@ -660,10 +636,10 @@ export interface InlineResponse2005 { previous?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof InlineResponse2005 */ - results?: Array; + results?: Array; } /** * @@ -691,10 +667,10 @@ export interface InlineResponse2006 { previous?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof InlineResponse2006 */ - results?: Array; + results?: Array; } /** * @@ -722,10 +698,10 @@ export interface InlineResponse2007 { previous?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof InlineResponse2007 */ - results?: Array; + results?: Array; } /** * @@ -753,9 +729,40 @@ export interface InlineResponse2008 { previous?: string | null; /** * - * @type {Array} + * @type {Array} * @memberof InlineResponse2008 */ + results?: Array; +} +/** + * + * @export + * @interface InlineResponse2009 + */ +export interface InlineResponse2009 { + /** + * + * @type {number} + * @memberof InlineResponse2009 + */ + count?: number; + /** + * + * @type {string} + * @memberof InlineResponse2009 + */ + next?: string | null; + /** + * + * @type {string} + * @memberof InlineResponse2009 + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof InlineResponse2009 + */ results?: Array; } /** @@ -794,12 +801,6 @@ export interface Keyword { * @memberof Keyword */ description?: string; - /** - * - * @type {string} - * @memberof Keyword - */ - image?: string; /** * * @type {string} @@ -812,12 +813,6 @@ export interface Keyword { * @memberof Keyword */ numchild?: number; - /** - * - * @type {string} - * @memberof Keyword - */ - numrecipe?: string; /** * * @type {string} @@ -881,10 +876,10 @@ export interface MealPlan { date: string; /** * - * @type {number} + * @type {MealPlanMealType} * @memberof MealPlan */ - meal_type: number; + meal_type: MealPlanMealType; /** * * @type {string} @@ -910,6 +905,55 @@ export interface MealPlan { */ meal_type_name?: string; } +/** + * + * @export + * @interface MealPlanMealType + */ +export interface MealPlanMealType { + /** + * + * @type {number} + * @memberof MealPlanMealType + */ + id?: number; + /** + * + * @type {string} + * @memberof MealPlanMealType + */ + name: string; + /** + * + * @type {number} + * @memberof MealPlanMealType + */ + order?: number; + /** + * + * @type {string} + * @memberof MealPlanMealType + */ + icon?: string | null; + /** + * + * @type {string} + * @memberof MealPlanMealType + */ + color?: string | null; + /** + * + * @type {boolean} + * @memberof MealPlanMealType + */ + _default?: boolean; + /** + * + * @type {string} + * @memberof MealPlanMealType + */ + created_by?: string; +} /** * * @export @@ -1037,6 +1081,24 @@ export interface MealType { * @memberof MealType */ order?: number; + /** + * + * @type {string} + * @memberof MealType + */ + icon?: string | null; + /** + * + * @type {string} + * @memberof MealType + */ + color?: string | null; + /** + * + * @type {boolean} + * @memberof MealType + */ + _default?: boolean; /** * * @type {string} @@ -1288,12 +1350,6 @@ export interface RecipeKeywords { * @memberof RecipeKeywords */ description?: string; - /** - * - * @type {string} - * @memberof RecipeKeywords - */ - image?: string; /** * * @type {string} @@ -1306,12 +1362,6 @@ export interface RecipeKeywords { * @memberof RecipeKeywords */ numchild?: number; - /** - * - * @type {string} - * @memberof RecipeKeywords - */ - numrecipe?: string; /** * * @type {string} @@ -1574,6 +1624,12 @@ export interface RecipeSteps { * @memberof RecipeSteps */ step_recipe_data?: string; + /** + * + * @type {string} + * @memberof RecipeSteps + */ + numrecipe?: string; } /** @@ -1680,10 +1736,10 @@ export interface ShoppingListEntries { food: StepFood | null; /** * - * @type {StepUnit} + * @type {FoodSupermarketCategory} * @memberof ShoppingListEntries */ - unit?: StepUnit | null; + unit?: FoodSupermarketCategory | null; /** * * @type {string} @@ -1729,10 +1785,10 @@ export interface ShoppingListEntry { food: StepFood | null; /** * - * @type {StepUnit} + * @type {FoodSupermarketCategory} * @memberof ShoppingListEntry */ - unit?: StepUnit | null; + unit?: FoodSupermarketCategory | null; /** * * @type {string} @@ -2004,6 +2060,12 @@ export interface Step { * @memberof Step */ step_recipe_data?: string; + /** + * + * @type {string} + * @memberof Step + */ + numrecipe?: string; } /** @@ -2084,12 +2146,6 @@ export interface StepFood { * @memberof StepFood */ supermarket_category?: FoodSupermarketCategory | null; - /** - * - * @type {string} - * @memberof StepFood - */ - image?: string; /** * * @type {string} @@ -2102,12 +2158,6 @@ export interface StepFood { * @memberof StepFood */ numchild?: number; - /** - * - * @type {string} - * @memberof StepFood - */ - numrecipe?: string; } /** * @@ -2129,10 +2179,10 @@ export interface StepIngredients { food: StepFood | null; /** * - * @type {StepUnit} + * @type {FoodSupermarketCategory} * @memberof StepIngredients */ - unit: StepUnit | null; + unit: FoodSupermarketCategory | null; /** * * @type {string} @@ -2164,43 +2214,6 @@ export interface StepIngredients { */ no_amount?: boolean; } -/** - * - * @export - * @interface StepUnit - */ -export interface StepUnit { - /** - * - * @type {number} - * @memberof StepUnit - */ - id?: number; - /** - * - * @type {string} - * @memberof StepUnit - */ - name: string; - /** - * - * @type {string} - * @memberof StepUnit - */ - description?: string | null; - /** - * - * @type {string} - * @memberof StepUnit - */ - numrecipe?: string; - /** - * - * @type {string} - * @memberof StepUnit - */ - image?: string; -} /** * * @export @@ -2458,18 +2471,6 @@ export interface Unit { * @memberof Unit */ description?: string | null; - /** - * - * @type {string} - * @memberof Unit - */ - numrecipe?: string; - /** - * - * @type {string} - * @memberof Unit - */ - image?: string; } /** * @@ -4782,6 +4783,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) * @param {number} [units] Id of unit a recipe should have. * @param {number} [rating] Id of unit a recipe should have. * @param {string} [books] Id of book a recipe should have. For multiple repeat parameter. + * @param {string} [steps] Id of a step a recipe should have. For multiple repeat parameter. * @param {string} [keywordsOr] If recipe should have all (AND) or any (OR) of the provided keywords. * @param {string} [foodsOr] If recipe should have all (AND) or any (OR) any of the provided foods. * @param {string} [booksOr] If recipe should be in all (AND) or any (OR) any of the provided books. @@ -4793,7 +4795,7 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listRecipes: async (query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options: any = {}): Promise => { + listRecipes: async (query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, steps?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options: any = {}): Promise => { const localVarPath = `/api/recipe/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4830,6 +4832,10 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['books'] = books; } + if (steps !== undefined) { + localVarQueryParameter['steps'] = steps; + } + if (keywordsOr !== undefined) { localVarQueryParameter['keywords_or'] = keywordsOr; } @@ -4962,10 +4968,13 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) }, /** * + * @param {string} [query] Query string matched (fuzzy) against object name. + * @param {number} [page] A page number within the paginated result set. + * @param {number} [pageSize] Number of results to return per page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listSteps: async (options: any = {}): Promise => { + listSteps: async (query?: string, page?: number, pageSize?: number, options: any = {}): Promise => { const localVarPath = `/api/step/`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4978,6 +4987,18 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (query !== undefined) { + localVarQueryParameter['query'] = query; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize; + } + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); @@ -8892,7 +8913,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listCookLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listCookLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listCookLogs(page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -8917,7 +8938,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listImportLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listImportLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listImportLogs(page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -8988,6 +9009,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {number} [units] Id of unit a recipe should have. * @param {number} [rating] Id of unit a recipe should have. * @param {string} [books] Id of book a recipe should have. For multiple repeat parameter. + * @param {string} [steps] Id of a step a recipe should have. For multiple repeat parameter. * @param {string} [keywordsOr] If recipe should have all (AND) or any (OR) of the provided keywords. * @param {string} [foodsOr] If recipe should have all (AND) or any (OR) any of the provided foods. * @param {string} [booksOr] If recipe should be in all (AND) or any (OR) any of the provided books. @@ -8999,8 +9021,8 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(query, keywords, foods, units, rating, books, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options); + async listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, steps?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(query, keywords, foods, units, rating, books, steps, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -9032,11 +9054,14 @@ export const ApiApiFp = function(configuration?: Configuration) { }, /** * + * @param {string} [query] Query string matched (fuzzy) against object name. + * @param {number} [page] A page number within the paginated result set. + * @param {number} [pageSize] Number of results to return per page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listSteps(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listSteps(options); + async listSteps(query?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listSteps(query, page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -9055,7 +9080,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listSupermarketCategoryRelations(page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -9143,7 +9168,7 @@ export const ApiApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listViewLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async listViewLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listViewLogs(page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, @@ -10529,7 +10554,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listCookLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { + listCookLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { return localVarFp.listCookLogs(page, pageSize, options).then((request) => request(axios, basePath)); }, /** @@ -10552,7 +10577,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listImportLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { + listImportLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { return localVarFp.listImportLogs(page, pageSize, options).then((request) => request(axios, basePath)); }, /** @@ -10616,6 +10641,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {number} [units] Id of unit a recipe should have. * @param {number} [rating] Id of unit a recipe should have. * @param {string} [books] Id of book a recipe should have. For multiple repeat parameter. + * @param {string} [steps] Id of a step a recipe should have. For multiple repeat parameter. * @param {string} [keywordsOr] If recipe should have all (AND) or any (OR) of the provided keywords. * @param {string} [foodsOr] If recipe should have all (AND) or any (OR) any of the provided foods. * @param {string} [booksOr] If recipe should be in all (AND) or any (OR) any of the provided books. @@ -10627,8 +10653,8 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { - return localVarFp.listRecipes(query, keywords, foods, units, rating, books, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(axios, basePath)); + listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, steps?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.listRecipes(query, keywords, foods, units, rating, books, steps, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(axios, basePath)); }, /** * @@ -10656,11 +10682,14 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: }, /** * + * @param {string} [query] Query string matched (fuzzy) against object name. + * @param {number} [page] A page number within the paginated result set. + * @param {number} [pageSize] Number of results to return per page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listSteps(options?: any): AxiosPromise> { - return localVarFp.listSteps(options).then((request) => request(axios, basePath)); + listSteps(query?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.listSteps(query, page, pageSize, options).then((request) => request(axios, basePath)); }, /** * @@ -10677,7 +10706,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): AxiosPromise { + listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): AxiosPromise { return localVarFp.listSupermarketCategoryRelations(page, pageSize, options).then((request) => request(axios, basePath)); }, /** @@ -10756,7 +10785,7 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listViewLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { + listViewLogs(page?: number, pageSize?: number, options?: any): AxiosPromise { return localVarFp.listViewLogs(page, pageSize, options).then((request) => request(axios, basePath)); }, /** @@ -12270,6 +12299,7 @@ export class ApiApi extends BaseAPI { * @param {number} [units] Id of unit a recipe should have. * @param {number} [rating] Id of unit a recipe should have. * @param {string} [books] Id of book a recipe should have. For multiple repeat parameter. + * @param {string} [steps] Id of a step a recipe should have. For multiple repeat parameter. * @param {string} [keywordsOr] If recipe should have all (AND) or any (OR) of the provided keywords. * @param {string} [foodsOr] If recipe should have all (AND) or any (OR) any of the provided foods. * @param {string} [booksOr] If recipe should be in all (AND) or any (OR) any of the provided books. @@ -12282,8 +12312,8 @@ export class ApiApi extends BaseAPI { * @throws {RequiredError} * @memberof ApiApi */ - public listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any) { - return ApiApiFp(this.configuration).listRecipes(query, keywords, foods, units, rating, books, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(this.axios, this.basePath)); + public listRecipes(query?: string, keywords?: string, foods?: string, units?: number, rating?: number, books?: string, steps?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, _new?: string, page?: number, pageSize?: number, options?: any) { + return ApiApiFp(this.configuration).listRecipes(query, keywords, foods, units, rating, books, steps, keywordsOr, foodsOr, booksOr, internal, random, _new, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } /** @@ -12318,12 +12348,15 @@ export class ApiApi extends BaseAPI { /** * + * @param {string} [query] Query string matched (fuzzy) against object name. + * @param {number} [page] A page number within the paginated result set. + * @param {number} [pageSize] Number of results to return per page. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ApiApi */ - public listSteps(options?: any) { - return ApiApiFp(this.configuration).listSteps(options).then((request) => request(this.axios, this.basePath)); + public listSteps(query?: string, page?: number, pageSize?: number, options?: any) { + return ApiApiFp(this.configuration).listSteps(query, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } /**