fixed book sharing and added step page

This commit is contained in:
vabene1111 2021-11-14 15:33:25 +01:00
parent 7c4cd02dfa
commit 695cab29a1
10 changed files with 274 additions and 166 deletions

View File

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

View File

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

View File

@ -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'
)

View File

@ -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('_', '-')

View File

@ -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):

View File

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

View File

@ -28,8 +28,8 @@
<!-- <span><b-button variant="link" size="sm" class="text-dark shadow-none"><i class="fas fa-chevron-down"></i></b-button></span> -->
<model-menu/>
<span>{{ this.this_model.name }}</span>
<span><b-button variant="link" @click="startAction({'action':'new'})"><i
class="fas fa-plus-circle fa-2x"></i></b-button></span>
<span v-if="this_model.name !== 'Step'"><b-button variant="link" @click="startAction({'action':'new'})"><i
class="fas fa-plus-circle fa-2x"></i></b-button></span><!-- TODO add proper field to model config to determine if create should be available or not -->
</h3>
</div>
<div class="col-md-3" style="position: relative; margin-top: 1vh">
@ -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) {

View File

@ -34,6 +34,10 @@
<i class="fas fa-file fa-fw"></i> {{ Models['USERFILE'].name }}
</b-dropdown-item>
<b-dropdown-item :href="resolveDjangoUrl('list_step')">
<i class="fas fa-puzzle-piece fa-fw"></i>{{ Models['STEP'].name }}
</b-dropdown-item>
</b-dropdown>
</span>
</template>

View File

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

View File

@ -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<RecipeOverview>}
* @type {Array<Step>}
* @memberof InlineResponse2004
*/
results?: Array<RecipeOverview>;
results?: Array<Step>;
}
/**
*
@ -660,10 +636,10 @@ export interface InlineResponse2005 {
previous?: string | null;
/**
*
* @type {Array<ViewLog>}
* @type {Array<RecipeOverview>}
* @memberof InlineResponse2005
*/
results?: Array<ViewLog>;
results?: Array<RecipeOverview>;
}
/**
*
@ -691,10 +667,10 @@ export interface InlineResponse2006 {
previous?: string | null;
/**
*
* @type {Array<CookLog>}
* @type {Array<ViewLog>}
* @memberof InlineResponse2006
*/
results?: Array<CookLog>;
results?: Array<ViewLog>;
}
/**
*
@ -722,10 +698,10 @@ export interface InlineResponse2007 {
previous?: string | null;
/**
*
* @type {Array<SupermarketCategoryRelation>}
* @type {Array<CookLog>}
* @memberof InlineResponse2007
*/
results?: Array<SupermarketCategoryRelation>;
results?: Array<CookLog>;
}
/**
*
@ -753,9 +729,40 @@ export interface InlineResponse2008 {
previous?: string | null;
/**
*
* @type {Array<ImportLog>}
* @type {Array<SupermarketCategoryRelation>}
* @memberof InlineResponse2008
*/
results?: Array<SupermarketCategoryRelation>;
}
/**
*
* @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<ImportLog>}
* @memberof InlineResponse2009
*/
results?: Array<ImportLog>;
}
/**
@ -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<RequestArgs> => {
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<RequestArgs> => {
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<RequestArgs> => {
listSteps: async (query?: string, page?: number, pageSize?: number, options: any = {}): Promise<RequestArgs> => {
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<InlineResponse2006>> {
async listCookLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2007>> {
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<InlineResponse2008>> {
async listImportLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2009>> {
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<InlineResponse2004>> {
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<InlineResponse2005>> {
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<Array<Step>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.listSteps(options);
async listSteps(query?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2004>> {
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<InlineResponse2007>> {
async listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2008>> {
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<InlineResponse2005>> {
async listViewLogs(page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<InlineResponse2006>> {
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<InlineResponse2006> {
listCookLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2007> {
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<InlineResponse2008> {
listImportLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2009> {
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<InlineResponse2004> {
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<InlineResponse2005> {
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<Array<Step>> {
return localVarFp.listSteps(options).then((request) => request(axios, basePath));
listSteps(query?: string, page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2004> {
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<InlineResponse2007> {
listSupermarketCategoryRelations(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2008> {
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<InlineResponse2005> {
listViewLogs(page?: number, pageSize?: number, options?: any): AxiosPromise<InlineResponse2006> {
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));
}
/**